ZHANGYUXUAN-zR commited on
Commit
a0679d6
·
verified ·
1 Parent(s): 5cec0f8

Add files using upload-large-folder tool

Browse files
Files changed (50) hide show
  1. md/train/5SST78xEh4A/5SST78xEh4A.md +352 -0
  2. md/train/63pC59XOZLZ/63pC59XOZLZ.md +263 -0
  3. md/train/9xC2tWEwBD/9xC2tWEwBD.md +327 -0
  4. md/train/B1al7jg0b/B1al7jg0b.md +279 -0
  5. md/train/B1ewdt9xe/B1ewdt9xe.md +301 -0
  6. md/train/B1xm3RVtwB/B1xm3RVtwB.md +279 -0
  7. md/train/B1xmOgrFPS/B1xmOgrFPS.md +249 -0
  8. md/train/BJxhLAuxg/BJxhLAuxg.md +232 -0
  9. md/train/BkevoJSYPB/BkevoJSYPB.md +656 -0
  10. md/train/ByGq7hRqKX/ByGq7hRqKX.md +308 -0
  11. md/train/Esd7tGH3Spl/Esd7tGH3Spl.md +244 -0
  12. md/train/HfpNVDg3ExA/HfpNVDg3ExA.md +366 -0
  13. md/train/HkgSk2A9Y7/HkgSk2A9Y7.md +0 -0
  14. md/train/HklXn1BKDH/HklXn1BKDH.md +378 -0
  15. md/train/Hklso24Kwr/Hklso24Kwr.md +386 -0
  16. md/train/HyTqHL5xg/HyTqHL5xg.md +384 -0
  17. md/train/HyeSin4FPB/HyeSin4FPB.md +0 -0
  18. md/train/I-VfjSBzi36/I-VfjSBzi36.md +236 -0
  19. md/train/Ic9vRN3VpZ/Ic9vRN3VpZ.md +237 -0
  20. md/train/LkFG3lB13U5/LkFG3lB13U5.md +0 -0
  21. md/train/S1J2ZyZ0Z/S1J2ZyZ0Z.md +395 -0
  22. md/train/S1x0CnEtvB/S1x0CnEtvB.md +307 -0
  23. md/train/SJa9iHgAZ/SJa9iHgAZ.md +274 -0
  24. md/train/SJeS16EKPr/SJeS16EKPr.md +668 -0
  25. md/train/SJgCEpVtvr/SJgCEpVtvr.md +281 -0
  26. md/train/SJgVHkrYDH/SJgVHkrYDH.md +496 -0
  27. md/train/SJlh8CEYDB/SJlh8CEYDB.md +438 -0
  28. md/train/SJx9ngStPH/SJx9ngStPH.md +436 -0
  29. md/train/SJxbu6VKDr/SJxbu6VKDr.md +280 -0
  30. md/train/SyX0IeWAW/SyX0IeWAW.md +223 -0
  31. md/train/YTWGvpFOQD-/YTWGvpFOQD-.md +591 -0
  32. md/train/_RnHyIeu5Y5/_RnHyIeu5Y5.md +272 -0
  33. md/train/_SKUm2AJpvN/_SKUm2AJpvN.md +325 -0
  34. md/train/_eXwwWOyqT_/_eXwwWOyqT_.md +425 -0
  35. md/train/axNDkxU9-6z/axNDkxU9-6z.md +0 -0
  36. md/train/bEoxzW_EXsa/bEoxzW_EXsa.md +0 -0
  37. md/train/blfSjHeFM_e/blfSjHeFM_e.md +660 -0
  38. md/train/dV19Yyi1fS3/dV19Yyi1fS3.md +496 -0
  39. md/train/eEn8KTtJOx/eEn8KTtJOx.md +398 -0
  40. md/train/eoTy4ihL0W/eoTy4ihL0W.md +270 -0
  41. md/train/f4jw35Vrk6d/f4jw35Vrk6d.md +358 -0
  42. md/train/hfkER_KJiNw/hfkER_KJiNw.md +358 -0
  43. md/train/jlchsFOLfeF/jlchsFOLfeF.md +278 -0
  44. md/train/rJgUfTEYvH/rJgUfTEYvH.md +374 -0
  45. md/train/rk8wKk-R-/rk8wKk-R-.md +336 -0
  46. md/train/rkeS1RVtPS/rkeS1RVtPS.md +0 -0
  47. md/train/rkhlb8lCZ/rkhlb8lCZ.md +303 -0
  48. md/train/rylrdxHFDr/rylrdxHFDr.md +442 -0
  49. md/train/ryxB2lBtvH/ryxB2lBtvH.md +356 -0
  50. md/train/uIMwuJHfuLM/uIMwuJHfuLM.md +0 -0
md/train/5SST78xEh4A/5SST78xEh4A.md ADDED
@@ -0,0 +1,352 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # PROSELFLC: PROGRESSIVE SELF LABEL CORRECTION FOR TRAINING ROBUST DEEP NEURAL NETWORKS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ To train robust deep neural networks (DNNs), we systematically study several target modification approaches, which include output regularisation, self and nonself label correction (LC). Two key issues are discovered: (1) Self LC is the most appealing as it exploits its own knowledge and requires no extra models. However, how to automatically decide the trust degree of a learner as training goes is not well answered in the literature? (2) Some methods penalise while the others reward low-entropy predictions, prompting us to ask which one is better?
8
+
9
+ To resolve the first issue, taking two well-accepted propositions–deep neural networks learn meaningful patterns before fitting noise (Arpit et al., 2017) and minimum entropy regularisation principle (Grandvalet & Bengio, 2006)–we propose a novel end-to-end method named ProSelfLC, which is designed according to learning time and entropy. Specifically, given a data point, we progressively increase trust in its predicted label distribution versus its annotated one if a model has been trained for enough time and the prediction is of low entropy (high confidence). For the second issue, according to ProSelfLC, we empirically prove that it is better to redefine a meaningful low-entropy status and optimise the learner toward it. This serves as a defence of entropy minimisation. We demonstrate the effectiveness of ProSelfLC through extensive experiments in both clean and noisy settings.
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ There exist many target (label) modification approaches. They can be roughly divided into two groups: (1) Output regularisation (OR), which is proposed to penalise overconfident predictions for regularising deep neural networks. It includes label smoothing (LS) (Szegedy et al., 2016; Müller et al., 2019) and confidence penalty (CP) (Pereyra et al., 2017); (2) Label correction (LC). On the one hand, LC regularises neural networks by adding the similarity structure information over training classes into one-hot label distributions so that the learning targets become structured and soft. On the other hand, it can correct the semantic classes of noisy label distributions. LC can be further divided into two subgroups: Non-self LC and Self LC. The former requires extra learners, while the latter relies on the model itself. A typical approach of Non-self LC is knowledge distillation (KD), which exploits the predictions of other model(s), usually termed teacher(s) (Hinton et al., 2015). Self LC methods include Pseudo-Label (Lee, 2013), bootstrapping (Boot-soft and Boot-hard) (Reed et al., 2015), Joint Optimisation (Joint-soft and Joint-hard) (Tanaka et al., 2018), and Tf- ${ \mathrm { K D } } _ { s e l f }$ (Yuan et al., 2020). According to an overview in Figure 1 (detailed derivation is in Section 3 and Table 1), in label modification, the output target of a data point is defined by combining a one-hot label distribution and its corresponding prediction or a predefined label distribution.
14
+
15
+ Firstly, we present the drawbacks of existing approaches: (1) OR methods naively penalise confident outputs without leveraging easily accessible knowledge from other learners or itself (Figure 1a); (2) Non-self LC relies on accurate auxiliary models to generate predictions (Figure 1b). (3) Self LC is the most appealing because it exploits its own knowledge and requires no extra learners. However, there is a core question that is not well answered:
16
+
17
+ # In Self LC, how much should we trust a learner to leverage its knowledge?
18
+
19
+ As shown in Figure 1b, in Self LC, for a data point, we have two labels: a predefined one-hot q and a predicted structured p. Its learning target is $( 1 - \epsilon ) \mathbf { q } + \epsilon \mathbf { p }$ , i.e., a trade-off between q and p, where $\epsilon$ defines the trust score of a learner. In existing methods, $\epsilon$ is fixed without considering that a model’s (a) OR includes LS (Szegedy et al., 2016) and CP (Pereyra et al., 2017). LS softens a target by adding a uniform label distribution. CP changes the probability 1 to a smaller value $1 - \epsilon$ in the one-hot target. The double-ended arrow means factual equivalence, because an output is definitely non-negative after a softmax layer.
20
+
21
+ ![](images/4ec618d424c008219333fd3aad931860b7ccc3edfad166d77494cd98dd80172f.jpg)
22
+
23
+ ![](images/667be94f42736a8518c158bc6b48a8079ddbc87fa14a14e0db24550b250a7407.jpg)
24
+
25
+ (b) LC contains Self LC (Lee, 2013; Reed et al., 2015; Tanaka et al., 2018; Yuan et al., 2020) and Non-self LC (Hinton et al., 2015). The parameter  defines how much a predicted label distribution is trusted.
26
+
27
+ Figure 1: Target modification includes OR (LS and CP), and LC (Self LC and Non-self LC). Assume there are three training classes. q is the one-hot target. u is a uniform label distribution. p denotes a predicted label distribution. The target combination parameter is $\epsilon \in [ 0 , 1 ]$ .
28
+
29
+ knowledge grows as the training progresses. For example, in bootstrapping, $\epsilon$ is fixed throughout the training process. Joint Optimisation stage-wisely trains a model. It fully trusts predicted labels and uses them to replace old ones when a stage ends, i.e., $\epsilon = 1$ . Tf- ${ \mathrm { K D } } _ { s e l f }$ trains a model by two stages: $\epsilon = 0$ in the first one while $\epsilon$ is tuned for the second stage. Note that $\mathbf { p }$ is generated by a preceding-stage model in stage-wise training, which requires significant human intervention and is time-consuming in practice.
30
+
31
+ To improve Self LC, we propose a novel method named Progressive Self Label Correction (ProSelfLC), which is end-to-end trainable and needs negligible extra cost. Most importantly, ProSelfLC modifies the target progressively and adaptively as training goes. Two design principles of ProSelfLC are: (1) When a model learns from scratch, human annotations are more reliable than its own predictions in the early phase, during which the model is learning simple meaningful patterns before fitting noise, even when severe label noise exists in human annotations (Arpit et al., 2017). (2) As a learner attains confident knowledge as time progresses, we leverage it to revise annotated labels. This is surrounded by minimum entropy regularisation, which is widely evaluated in unsupervised and semi-supervised scenarios (Grandvalet & Bengio, 2005; 2006).
32
+
33
+ Secondly, note that OR methods penalise low entropy while LC rewards it, intuitively leading to a second vital question:
34
+
35
+ Should we penalise a low-entropy status or reward it?
36
+
37
+ Entropy minimisation is the most widely used principle in machine learning (Hartigan & Wong, 1979; Rumelhart et al., 1986; Grandvalet & Bengio, 2005; 2006; LeCun et al., 2015). In standard classification, minimising categorical cross entropy (CCE) optimises a model towards a low-entropy status defined by human annotations, which contain noise in very large-scale machine learning. As a result, confidence penalty becomes popular for reducing noisy fitting. In contrast, we prove that it is better to reward a meaningful low-entropy status redefined by our ProSelfLC. Therefore, our work offers a defence of entropy minimisation against the recent confidence penalty practice (Szegedy et al., 2016; Müller et al., 2019; Pereyra et al., 2017; Dubey et al., 2018).
38
+
39
+ Finally, we summarise our main contributions:
40
+
41
+ • We provide a theoretical study on popular target modification methods through entropy and KL divergence (Kullback & Leibler, 1951). Accordingly, we reveal their drawbacks and propose ProSelfLC as a solution. ProSelfLC can: (1) enhance the similarity structure information over training classes; (2) correct the semantic classes of noisy label distributions. ProSelfLC is the first method to trust self knowledge progressively and adaptively. Our extensive experiments: (1) defend the entropy minimisation principle; (2) demonstrate the effectiveness of ProSelfLC in both clean and noisy settings.
42
+
43
+ # 2 RELATED WORK
44
+
45
+ Label noise and semi-supervised learning. We test target modification approaches in the setting of label noise because it is generic and connected with semi-supervised learning, where only a subset of training examples are annotated, leading to missing labels. Then the key to semi-supervised training is to reliably fill them. When these missing labels are incorrectly filled, the challenge of semisupervised learning changes to noisy labels. For a further comparison, in semi-supervised learning, the annotated set is clean and reliable, because the label noise only exists in the unannotated set. While in our experimental setting, we are not given information on whether an example is trusted or not, thus being even more challenging. We summarise existing approaches for solving label noise: (1) Loss correction, in which we are given or we need to estimate a noise-transition matrix, which defines the distribution of noise labels (Li et al., 2017; Goldberger & Ben-Reuven, 2017; Sukhbaatar & Fergus, 2014; Vahdat, 2017; Yao et al., 2019; Han et al., 2018a; Patrini et al., 2017; Xiao et al., 2015). A noise-transition matrix is difficult and complex to estimate in practice; (2) Exploiting an auxiliary trusted training set to differentiate examples (Veit et al., 2017; Lee et al., 2018; Hendrycks et al., 2018). This requires extra annotation cost; (3) Co-training strategies, which train two or more learners (Malach & Shalev-Shwartz, 2017; Jiang et al., 2018; Han et al., 2018b; Yu et al., 2019; Wei et al., 2020; Qiao et al., 2018) and exploit their ‘disagreement’ information to differentiate data points; (4) Label engineering methods (Song et al., 2019; Lee, 2013; Reed et al., 2015; Tanaka et al., 2018; Yao et al., 2019), which relate to our focus in this work. Their strategy is to annotate unlabelled samples or correct noisy labels.
46
+
47
+ LC and knowledge distillation $( K D )$ (Bucila et al., 2006; Hinton et al., 2015). Mathematically, we derive that some KD methods also modify labels. We use the term label correction instead of KD for two reasons: (1) label correction is more descriptive; (2) the scope of KD is not limited to label modification. For example, multiple networks are trained for KD (Furlanello et al., 2018). When two models are trained, the consistency between their predictions of a data point is promoted in (Ba & Caruana, 2014; Zhang et al., 2018), while the distance between their feature maps is reduced in (Romero et al., 2015). Regarding self KD, two examples of the same class are constrained to have consistent output distributions (Xu & Liu, 2019; Yun et al., 2020). In another self KD (Zhang et al., 2019), the deepest classifier provides knowledge for shallower classifiers. In a recent self KD method (Yuan et al., 2020), Tf- $\mathrm { K D } _ { s e l f }$ applies two-stage training. In the second stage, a model is trained by exploiting its knowledge learned in the first stage. Our focus is to improve the end-to-end self LC. Finally, we acknowledge that exploiting ProSelfLC to improve non-self KD and stage-wise approaches is an area for future work, e.g., a better teacher model can be trained using ProSelfLC.
48
+
49
+ # 3 MATHEMATICAL ANALYSIS AND THEORY
50
+
51
+ Let $\mathbf { X } = \{ ( \mathbf { x } _ { i } , y _ { i } ) \} _ { i = 1 } ^ { N }$ represent $N$ training examples, where $\left( \mathbf { x } _ { i } , y _ { i } \right)$ denotes $i -$ th sample with input $\mathbf { x } _ { i } \in \mathbb { R } ^ { D }$ and label $y _ { i } \in \{ 1 , 2 , . . . , C \}$ . $C$ is the number of classes. A deep neural network $z$ consists of an embedding network $f ( \cdot ) : \bar { \mathbb { R } } ^ { D } \mathbb { R } ^ { K }$ and a linear classifier $\begin{array} { r } { g ( \cdot ) \dot { \mathbf { \Psi } } : \mathbb { R } ^ { K } \mathbb { R } ^ { C } } \end{array}$ , i.e., $\mathbf { z } _ { i } = z ( \mathbf { x } _ { i } ) = g ( f ( \mathbf { x } _ { i } ) ) ^ { \mathit { \prime } } : \mathbb { R } ^ { D } \mathbb { R } ^ { C }$ . For the brevity of analysis, we take a data point and omit its subscript so that it is denoted by $\left( \mathbf { x } , y \right)$ . The linear classifier is usually the last fully-connected layer. Its output is named logit vector $\mathbf { z } \in \mathbb { R } ^ { C }$ . We produce its classification probabilities $\mathbf { p }$ by normalising the logits using a softmax function:
52
+
53
+ $$
54
+ \mathbf { p } ( j | \mathbf { x } ) = \exp ( \mathbf { z } _ { j } ) / { \sum _ { m = 1 } ^ { C } \exp ( \mathbf { z } _ { m } ) } ,
55
+ $$
56
+
57
+ where $\mathbf { p } ( j | \mathbf { x } )$ is the probability of $\mathbf { x }$ belonging to class $j$ . Its corresponding ground-truth is usually denoted by a one-hot representation q: $\mathbf { q } ( j | \mathbf { x } ) = 1$ if $j = y$ , $\mathbf { q } ( j | \mathbf { x } ) = 0$ otherwise.
58
+
59
+ # 3.1 SEMANTIC CLASS AND SIMILARITY STRUCTURE IN A LABEL DISTRIBUTION
60
+
61
+ Definition 1 (Semantic Class). Given a target label distribution $\tilde { \mathbf { q } } ( \mathbf { x } ) \in \mathbb { R } ^ { C }$ , the semantic class is defined by arg $\operatorname* { m a x } _ { j } { \tilde { \mathbf { q } } } ( j | \mathbf { x } )$ , i.e., the class whose probability is the largest.
62
+
63
+ Definition 2 (Similarity Structure). In $\tilde { \bf q } ( { \bf x } )$ , $\mathbf { x }$ has $C$ probabilities of being predicted to $C$ classes.
64
+ The similarity structure of $\mathbf { x }$ versus $C$ classes is defined by these probabilities and their differences.
65
+
66
+ Table 1: Summary of CCE, LS, CP and LC.
67
+
68
+ <table><tr><td></td><td>CCE</td><td>LS</td><td>CP</td><td>LC</td></tr><tr><td>Learning Target</td><td>q</td><td>qLs = (1- ε)q +εu</td><td>qcp = (1- e)q -ep</td><td>qLc = (1 - ɕ)q +ep</td></tr><tr><td>Cross Entropy</td><td>Eq(-log_P)</td><td>EaLs(-log_P) (1-e)KL(qlIp)</td><td>Eacp(-log P) (1-c)KL(qllp)</td><td>EqLc(-log P) (1-c)KL(qlIp)</td></tr><tr><td>KL Divergence</td><td>KL(qllp)</td><td>+eKL(ullp)</td><td>+eKL(pllu)</td><td>-eKL(pllu)</td></tr><tr><td>Entropy minimisation</td><td></td><td>Penalise over CCE</td><td>Penalise over CCE</td><td>Reward over CCE</td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Semantic class</td><td>Annotated</td><td>Annotated</td><td>Annotated</td><td>Annotated andLearned</td></tr><tr><td>Similarity structure</td><td>No</td><td>No</td><td>No</td><td>Yes</td></tr></table>
69
+
70
+ # 3.2 REVISIT OF CCE, LS, CP AND LC
71
+
72
+ Standard CCE. For any input $\left( \mathbf { x } , y \right)$ , the minimisation objective of standard CCE is:
73
+
74
+ $$
75
+ L _ { \mathrm { C C E } } ( \mathbf { q } , \mathbf { p } ) = \mathrm { H } ( \mathbf { q } , \mathbf { p } ) = \mathrm { E } _ { \mathbf { q } } ( - \log \ \mathbf { p } ) ,
76
+ $$
77
+
78
+ where $\operatorname { H } ( \cdot , \cdot )$ represents the cross entropy. $\operatorname { E } _ { \mathbf { q } } ( - \log \mathbf { \delta p } )$ denotes the expectation of negative loglikelihood, and $\mathbf { q }$ is the probability mass function.
79
+
80
+ Label smoothing. In LS (Szegedy et al., 2016; Hinton et al., 2015), we soften one-hot targets by adding a uniform distribution: $\tilde { \bf q } _ { \mathrm { L S } } = ( 1 - \epsilon ) { \bf q } + \epsilon { \bf u }$ , $\mathbf { u } \in \mathbb { R } ^ { C }$ , and $\begin{array} { r } { \forall j , \mathbf { u } _ { j } = \frac { 1 } { C } } \end{array}$ . Consequently:
81
+
82
+ $$
83
+ L _ { \mathrm { C C E + L S } } ( \mathbf { q } , \mathbf { p } ; \epsilon ) = \mathrm { H } ( \tilde { \mathbf { q } } _ { \mathrm { L S } } , \mathbf { p } ) = \mathrm { E } _ { \tilde { \mathbf { q } } _ { \mathrm { L S } } } ( - \log \mathbf { \delta p } ) = ( 1 - \epsilon ) \mathrm { H } ( \mathbf { q } , \mathbf { p } ) + \epsilon \mathrm { H } ( \mathbf { u } , \mathbf { p } ) .
84
+ $$
85
+
86
+ Confidence penalty. CP (Pereyra et al., 2017) penalises highly confident predictions:
87
+
88
+ $$
89
+ L _ { \mathrm { C C E + C P } } ( \mathbf { q } , \mathbf { p } ; \epsilon ) = ( 1 - \epsilon ) \mathrm { H } ( \mathbf { q } , \mathbf { p } ) - \epsilon \mathrm { H } ( \mathbf { p } , \mathbf { p } ) .
90
+ $$
91
+
92
+ Label correction. As illustrated in Figure 1, LC is a family of algorithms, where a one-hot label distribution is modified to a convex combination of itself and a predicted distribution:
93
+
94
+ $$
95
+ \tilde { \bf q } _ { \mathrm { I C } } = ( 1 - \epsilon ) { \bf q } + \epsilon { \bf p } \Rightarrow L _ { \mathrm { C C E + L C } } ( { \bf q } , { \bf p } ; \epsilon ) = \mathrm { H } ( \tilde { \bf q } _ { \mathrm { L C } } , { \bf p } ) = ( 1 - \epsilon ) \mathrm { H } ( { \bf q } , { \bf p } ) + \epsilon \mathrm { H } ( { \bf p } , { \bf p } ) .
96
+ $$
97
+
98
+ We remark: (1) $\mathbf { p }$ provides meaningful information about an example’s relative probabilities of being different training classes; (2) If $\epsilon$ is large, and $\mathbf { p }$ is confident in predicting a different class, i.e., a $\begin{array} { r } { \arg \operatorname* { m a x } _ { j } \mathbf { p } ( j | \mathbf { x } ) \neq \arg \operatorname* { m a x } _ { j } \mathbf { q } ( j | \mathbf { x } ) , } \end{array}$ $\tilde { \bf q } _ { \mathrm { L C } }$ defines a different semantic class from $\mathbf { q }$ .
99
+
100
+ # 3.3 THEORY
101
+
102
+ Proposition 1. LS, CP and $L C$ modify the learning targets of standard CCE
103
+
104
+ Proof. $L _ { \mathrm { C C E + C P } } ( \mathbf { q } , \mathbf { p } ; \epsilon ) = ( 1 - \epsilon ) \mathrm { H } ( \mathbf { q } , \mathbf { p } ) - \epsilon \mathrm { H } ( \mathbf { p } , \mathbf { p } ) = \mathrm { E } _ { ( \mathbf { 1 } - \epsilon ) \mathbf { q } - \epsilon \mathbf { p } } ( - \log \mathbf { \ p } )$ . Therefore, $\mathbf { \tilde { q } } _ { \mathrm { C P } } =$ $( 1 - \epsilon ) \mathbf { q } { - } \epsilon \mathbf { p }$ . Additionally, $\tilde { \mathbf { q } } _ { \mathrm { L S } } = ( 1 - \epsilon ) \mathbf { q } + \epsilon \mathbf { u }$ , $\tilde { \bf q } _ { \mathrm { L C } } = ( 1 - \epsilon ) { \bf q } + \epsilon { \bf p }$ . 
105
+
106
+ Proposition 2. Some $K D$ methods, which aim to minimise the KL divergence between predictions of a teacher and a student, belong to the family of label correction.
107
+
108
+ Proof. In general, a loss function of such methods can be defined to be $L _ { \mathrm { K D } } ( \mathbf { q } , \mathbf { p } _ { t } , \mathbf { p } ) = ( 1 -$ $\epsilon ) \mathrm { H } ( \mathbf { q } , \mathbf { p } ) \bar { + } \epsilon \mathrm { K L } ( \mathbf { p } _ { t } | | \mathbf { p } )$ (Yuan et al., 2020). $\operatorname { K L } ( \cdot | | \cdot )$ denotes the KL divergence. As ${ \mathrm { K L } } ( \mathbf { p } _ { t } | | \mathbf { p } ) =$ $\mathrm { H } ( \mathbf { p } _ { t } , \mathbf { p } ) { - } \mathrm { H } ( \mathbf { p } _ { t } , \mathbf { p } _ { t } )$ , $\mathbf { p } _ { t }$ is from a teacher and fixed when training a student. We can omit $\mathrm { H } ( \mathbf { p } _ { t } , \mathbf { p } _ { t } )$ :
109
+
110
+ $$
111
+ \begin{array} { r } { L _ { \mathrm { K D } } ( \mathbf { q } , \mathbf { p } t , \mathbf { p } ) = ( 1 - \epsilon ) \mathrm { H } ( \mathbf { q } , \mathbf { p } ) + \epsilon \mathrm { H } ( \mathbf { p } t , \mathbf { p } ) = \mathrm { E } _ { ( 1 - \epsilon ) \mathbf { q } + \mathbf { c p } _ { t } } ( - \log \mathbf { p } ) \Rightarrow \tilde { \mathbf { q } } _ { \mathrm { K D } } = ( 1 - \epsilon ) \mathbf { q } + \epsilon \mathbf { p } t . } \end{array}
112
+ $$
113
+
114
+ Consistent with LC in Eq (5), $L _ { \mathrm { K D } } ( \mathbf { q } , \mathbf { p } _ { t } , \mathbf { p } )$ revises a label using $\mathbf { p } _ { t }$ .
115
+
116
+ Proposition 3. Compared with CCE, LS and $C P$ penalise entropy minimisation while $L C$ reward it.
117
+
118
+ Proposition 4. In CCE, $L S$ and $C P ,$ a data point x has the same semantic class. In addition, x has an identical probability of belonging to other classes except for its semantic class.
119
+
120
+ The proof of propositions 3 and 4 is presented in the Appendix A. Only LC exploits informative information and has the ability to correct labels, while LS and CP only relax the hard targets. We summarise CCE, LS, CP and LC in Table 1. Constant terms are ignored for concision.
121
+
122
+ # 4 PROSELFLC: PROGRESSIVE AND ADAPTIVE LABEL CORRECTION
123
+
124
+ In standard CCE, a semantic class is considered while the similarity structure is ignored. It is mainly due to the difficulty of annotating the similarity structure for every data point, especially when $C$ is large ( $\mathrm { { X u } }$ et al., 2020). Fortunately, recent progress demonstrates that there are some effective approaches to define the similarity structure of data points without annotation: (1) In KD, an auxiliary teacher model can provide a student model the similarity structure information (Hinton et al., 2015; Müller et al., 2019); (2) In Self LC, e.g., Boot-soft, a model helps itself by exploiting the knowledge it has learned so far. We focus on studying the end-to-end Self LC.
125
+
126
+ Table 2: Instantiating ProSelfLC under different cases. For all terms, we use concrete values for concise interpretation. We bold the special case when the semantic class is changed.
127
+
128
+ <table><tr><td rowspan="2"></td><td colspan="3">l(p): Consistency is defined by whether p and q share the semantic class or not.</td></tr><tr><td></td><td></td><td>0.1(non-confident)0.9(confidently consistent) 0.9(confidently inconsistent)</td></tr><tr><td>Earlier phase g(t) = 0.1</td><td>0.01</td><td>0.09</td><td>0.09</td></tr><tr><td>Later phase g(t) = 0.9</td><td>0.09</td><td>0.81</td><td>0.81</td></tr></table>
129
+
130
+ In Self LC, $\epsilon$ indicates how much a predicted label distribution is trusted. In ProSelfLC, we propose to set it automatically according to learning time $t$ and prediction entropy $\mathrm { H } ( \mathbf { p } )$ , i.e., ProSelfLC trusts self knowledge according to training time and confidence. For any $\mathbf { x }$ , we summarise:
131
+
132
+ Loss: $: L _ { ( \tilde { \bf q } _ { \mathrm { P r o S e l f L C } } , { \bf p } ; \epsilon _ { \mathrm { P r o S e l f L C } } ) } = \mathrm { H } ( \tilde { \bf q } _ { \mathrm { P r o S e l f L C } } , { \bf p } ) = \mathrm { E } _ { \tilde { \bf q } _ { \mathrm { P r o S e l f L C } } } ( - \log { \bf p } ) .$ Label: $\begin{array} { r } { \tilde { \bf q } _ { \mathrm { P r o S e l f L C } } = ( 1 - \epsilon _ { \mathrm { P r o S e l f L C } } ) { \bf q } + \epsilon _ { \mathrm { P r o S e l f L C } } { \bf p } . } \end{array}$ $\mathrm { S e l f ~ t r u s t : } \ \epsilon _ { \mathrm { P r o S e l f L C } } = g ( t ) \times l ( \mathbf { p } ) \left\{ g ( t ) = h ( t / \Gamma - 0 . 5 , B ) \in ( 0 , 1 ) , \right. $
133
+
134
+ $t$ and $\Gamma$ are the iteration counter and the number of total iterations, respectively. $h ( \eta , B ) ~ =$ $1 / ( 1 + \exp ( - \eta \times B ) ) . B$ $B , \Gamma$ are task-dependent and searched on a validation set. We clarify: Global trust score $g ( t )$ denotes how much we trust a learner. It is independent of data points, thus being global. $g ( t )$ grows as $t$ rises. $B$ adjusts the exponentiation’s base and growth speed of $g ( t )$ . The local trust score $l ( \mathbf { p } )$ indicates how much we trust an output distribution $\mathbf { p }$ , which is datadependent. $l ( \mathbf { p } )$ rises as $\mathrm { H } ( \mathbf { p } )$ becomes lower, rewarding a confident distribution.
135
+
136
+ Design reason. (1) Regarding $g ( t )$ , in the earlier learning phase, i.e., $t < \Gamma / 2$ , $g ( t ) < 0 . 5 \Rightarrow$ ProSelfLC $< 0 . 5 , \forall \mathbf { p }$ , so that the human annotations dominate and ProSelfLC only modifies the similarity structure. When a learner has not seen the training data for enough time at the earlier stage, its knowledge is less reliable and a wrong confident prediction may occur. Our design assuages the bad impact of such unexpected cases. When it comes to the later training phase, i.e., $t > \Gamma / 2$ , we have $g ( t ) > 0 . 5$ as it has been trained for more than half of entire iterations. (2) Regarding $l ( \mathbf { p } )$ , it affects the later learning phase. If $\mathbf { p }$ is less confident, $l ( \mathbf { p } )$ will be smaller, then ProSelfLC will be smaller, hence we trust $\mathbf { p }$ less when it is of higher uncertainty. If $\mathbf { p }$ is highly confident, we trust its confident knowledge. Ablation study of our design is in Figure 2, where three variants of  are presented. In our experiments, note that when $\epsilon$ is fixed, we try three values (0.125, 0.25, 0.50) and display the best instantiation, i.e., $\epsilon = 0 . 5 0$ .
137
+
138
+ We conduct the case analysis of ProSelfLC in Table 2 and summarise its core tactics as follows: (1) Correct the similarity structure for every data point in all cases, thanks to exploiting the self knowledge of a learner, i.e., $\mathbf { p }$ . (2) Revise the semantic class when $t$ is large enough and $\mathbf { p }$ is confidently inconsistent. As highlighted in Table 2, when two conditions are met, we have $\epsilon _ { \mathrm { P r o S e l f L C } } > 0 . 5$ and $\operatorname { a r g m a x } _ { j } \mathbf { p } ( j | \mathbf { x } ) \ \neq \ \operatorname { a r g m a x } _ { j } \mathbf { q } ( j | \mathbf { x } )$ , then $\mathbf { p }$ redefines the semantic class. For example, if $\mathbf { p } ~ = ~ [ 0 . 9 5 , 0 . 0 1 , 0 . 0 4 ] , \mathbf { q } ~ = ~ [ 0 , 0 , 1 ] ,$ $\epsilon _ { \mathrm { P r o S e l f L C } } ~ = ~ 0 . 8 ~ \Rightarrow ~ \tilde { \bf q } _ { \mathrm { P r o S e l f L C } } ~ = ~ ( 1 ~ -$  $\mathrm { \Delta \ p o S e l f L C } \mathbf { \Psi } ) \mathbf { q } + \epsilon _ { \mathrm { P r o S e l f L C } } \mathbf { p } = [ 0 . 7 6 , 0 . 0 0 8 , 0 . 2 3 2 ]$ . Note that ProSelfLC also becomes robust against lengthy exposure to the training data, as demonstrated in Figures 2 and 3.
139
+
140
+ # 5 EXPERIMENTS
141
+
142
+ In our experiments, we re-implement CCE, LS and CP. Regarding Self LC methods, we reimplement Boot-soft (Reed et al., 2015), where $\epsilon$ is fixed throughout training. We do not reimplement stage-wise Self LC and KD methods, e.g., Joint Optimisation and Tf- $\mathrm { K D } _ { s e l f }$ respectively, because time-consuming tuning is required. We fix the random seed and do not use any random accelerator for an entirely fair comparison. In standard and synthetic cases, we train on $80 \%$ training data (corrupted in synthetic cases) and use $20 \%$ trusted training data as a validation set to search hyperparameters, e.g., $\epsilon , \Gamma , B$ and settings of an optimiser. Note that $\Gamma$ and an optimiser’s settings are searched first and then shared by all methods. Finally, we retrain a model on the entire training data (corrupted in synthetic cases) and report its accuracy on the test data to fairly compare with prior results. In real-world label noise, the used dataset has a separate clean validation set for searching hyperparameters. Code will be released once this work is accepted.
143
+
144
+ ![](images/b82a73bddf1405565e918850ac86e4d14d341ba4f7fe03f94c02e04204a87e30.jpg)
145
+ Figure 2: Comparison of setting $\epsilon$ using different schemes. Experiments are done on CIFAR-100 with asymmetric label noise $r = 0 . 4$ . For data-dependent items, mean results are reported.
146
+
147
+ # 5.1 STANDARD IMAGE CLASSIFICATION
148
+
149
+ Datasets and training details. (1) CIFAR-100 (Krizhevsky, 2009) has 20 coarse classes, each containing 5 fine classes. There are 500 and 100 images per class in the training and testing sets, respectively. The image size is $3 2 \times 3 2$ . We apply simple data augmentation (He et al., 2016), i.e., we pad 4 pixels on every side of the image, and then randomly crop it with a size of $3 2 \times 3 2$ . Finally, this crop is horizontally flipped with a probability of 0.5. We choose SGD with its settings as: (a) a learning rate of 0.1; (b) a momentum of 0.9; (c) a weight decay of $5 e - 4$ ; (d) the batch size is 256 and the number of training iterations is $3 0 \mathrm { k }$ . We divide the learning rate by 10 at $1 5 \mathrm { k }$ and $2 2 \mathrm { k }$ iterations, respectively. (2) We train ResNet-50 (He et al., 2016) on ImageNet 2012 classification dataset, which has 1k classes and $5 0 \mathrm { k }$ images in the test set (Russakovsky et al., 2015). We use SGD with a start learning rate of $2 e - 3$ . A polynomial learning rate decay with a power of 2 is used. We set the momentum to 0.95 and the weight decay to $1 e - 4$ . We train on a single V100 GPU and the batch size is 64. We report the final test accuracy when the training ends at 500k iterations. We use the standard data augmentation: an original image is warped to $2 5 6 \times 2 5 6$ , followed by a random crop of $2 2 4 \times 2 2 4$ . This crop is randomly flipped. We fix common settings to fairly compare CCE, LS, CP, Boot-soft and ProSelfLC.
150
+
151
+ Result analysis. In Table 3, we observe the superiority of ProSelfLC in standard setting without considering label noise. Being probably surprising, LS and CP reduce the performance consistently as $\epsilon$ increases on ImageNet. Instead, Boot-soft and ProSelfLC improve versus CCE. We remark that both test sets are large so that their differences are noticeable.
152
+
153
+ # 5.2 SYNTHETIC LABEL NOISE
154
+
155
+ Noise generation. (1) Symmetric label noise: the original label of an image is uniformly changed to one of the other classes with a probability of $r$ ; (2) Asymmetric label noise: we follow (Wang et al., 2019) to generate asymmetric label noise to fairly compare with their reported results. Within each coarse class, we randomly select two fine classes $A$ and $B$ . Then we flip $\overline { { r } } \times 1 0 0 \%$ labels of $A$ to $B$ , and $r \times 1 0 0 \%$ labels of $B$ to $A$ . We remark that the overall label noise rate is smaller than $r$ .
156
+
157
+ Baselines.1 We compare with the results reported recently in SL (Wang et al., 2019). Forward is a loss correction approach that uses a noise-transition matrix (Patrini et al., 2017). D2L monitors the subspace dimensionality change at training (Ma et al., 2018). GCE denotes generalised cross entropy (Zhang & Sabuncu, 2018) and SL is symmetric cross entropy (Wang et al., 2019). They are robust losses designed for solving label noise. Training details are the same as Section 5.1.
158
+
159
+ Result analysis. For all methods, we directly report their final results when training terminates. Therefore, we test the robustness of a model against not only label noise, but also a long time being exposed to the data. In Table 4, we observe that: (1) ProSelfLC outperforms all baselines, which is significant in most cases; (2) In both implementation, Boot-hard and Boot-soft perform worse than the others. However, our ProSelfLC makes Self LC the best solution. Furthermore, learning dynamics are visualised in Figure 3, which helps to understand why ProSelfLC works better.
160
+
161
+ Table 3: Test accuracy $( \% )$ in the standard setting. We report three settings of hyperparameters.
162
+
163
+ ![](images/ca018fc03e952dcd2298d4fa92a06cbe8e9325f355fda66e63778d74ee3c7064.jpg)
164
+ Figure 3: Comprehensive learning dynamics on CIFAR-100 with asymmetric label noise $r = 0 . 4$ . For data-dependent items, mean results are reported. At training, a learner is NOT GIVEN whether a label is trusted or not. We store intermediate models and analyse them when the training ends.
165
+
166
+ Results of different $B , \epsilon$ are in Table 5. Appendix B shows the learning dynamics when $r$ changes.
167
+
168
+ Revising the semantic class and similarity structure. In Figures 3b and 3c, we show dynamic statistics of different approaches on fitting wrong labels and correcting them. ProSelfLC is much better than its counterparts. Semantic class correction reflects the change of similarity structure.
169
+
170
+ To redefine and reward a low-entropy status. On the one hand, we observe that LS and CP work well, being consistent with prior claims. In Figures 3d and 3e, the entropies of both clean and noisy subsets are much higher in LS and CP, correspondingly their generalisation is the best except for ProSelfLC in Figure 3f. On the other hand, ProSelfLC has the lowest entropy while performs the best, which proves that a learner’s confidence does not necessarily weaken its generalisation performance. Instead, a model needs to be careful with what to be confident in. As shown by Figures 3b and 3c, ProSelfLC has the least wrong fitting and most semantic class correction, which indicates that a meaningful low-entropy status is redefined.
171
+
172
+ # 5.3 REAL-WORLD LABEL NOISE
173
+
174
+ Clothing 1M (Xiao et al., 2015) has around $3 8 . 4 6 \%$ label noise in the training data and about 1 million images of 14 classes from shopping websites. Its internal noise structure is agnostic.
175
+
176
+ Baselines. For loss correction and estimating the noise-transition matrix, S-adaption (Goldberger & Ben-Reuven, 2017) uses an extra softmax layer, while Masking (Han et al., 2018a) exploits human cognition. MD-DYR-SH (Arazo et al., 2019) is a combination of three techniques: dynamic mixup (MD), dynamic bootstrapping together with label regularisation (DYR) and soft to hard (SH). The
177
+
178
+ Table 4: Accuracy $( \% )$ on the CIFAR-100 clean test set. All compared methods use ResNet-44.
179
+
180
+ <table><tr><td rowspan="2"></td><td rowspan="2">Method</td><td colspan="3">Asymmetric Noisy Labels</td><td rowspan="2"></td><td colspan="3">Symmetric Noisy Labels</td></tr><tr><td>r=0.2</td><td>r=0.3</td><td>r=0.4</td><td>r=0.2</td><td>r=0.4</td><td>r=0.6</td></tr><tr><td rowspan="5">Results From SL (Wang et al., 2019)</td><td>Boot-hard</td><td>63.4</td><td>63.2</td><td>62.1</td><td></td><td>57.9</td><td>48.2</td><td>12.3</td></tr><tr><td>Forward</td><td>64.1</td><td>64.0</td><td>60.9</td><td></td><td>59.8</td><td>53.1</td><td>24.7</td></tr><tr><td>D2L</td><td>62.4</td><td>63.2</td><td>61.4</td><td></td><td>59.2</td><td>52.0</td><td>35.3</td></tr><tr><td>GCE</td><td>63.0</td><td>63.2</td><td>61.7</td><td></td><td>59.1</td><td>53.3</td><td>36.2</td></tr><tr><td>SL</td><td>65.6</td><td>65.1</td><td>63.1</td><td></td><td>60.0</td><td>53.7</td><td>41.5</td></tr><tr><td rowspan="5">Our Trained Results</td><td>CCE</td><td>66.6</td><td>63.4</td><td>59.5</td><td></td><td>58.0</td><td>50.1</td><td>37.9</td></tr><tr><td>LS</td><td>67.9</td><td>66.4</td><td>65.0</td><td></td><td>63.8</td><td>57.2</td><td>46.5</td></tr><tr><td>CP</td><td>67.7</td><td>66.0</td><td>64.4</td><td></td><td>64.0</td><td>56.8</td><td>44.1</td></tr><tr><td>Boot-soft</td><td>66.9</td><td>65.3</td><td>61.0</td><td></td><td>63.2</td><td>59.0</td><td>44.8</td></tr><tr><td>ProSelfLC</td><td>68.7</td><td>68.5</td><td>67.9</td><td></td><td>64.8</td><td>59.3</td><td>47.7</td></tr></table>
181
+
182
+ Table 5: The results of different hyperparameters on CIFAR-100 using ResNet-44. Under different noise rates, the best instantiation of each approach is bolded except for CCE.
183
+
184
+ <table><tr><td>Method</td><td>Value of</td><td colspan="3">Asymmetric label noise</td><td colspan="3">Symmetric label noise</td><td rowspan="2">Clean</td></tr><tr><td>(hyperparameter)</td><td>hyperparameter</td><td>20%</td><td>30%</td><td>40%</td><td>20%</td><td>40%</td><td>60%</td></tr><tr><td rowspan="2">CCE</td><td>None or ε = 0</td><td>66.6</td><td>63.4</td><td>59.5</td><td>58.0</td><td>50.1</td><td>37.9</td><td>69.0</td></tr><tr><td>0.125</td><td>66.4</td><td>65.6</td><td>63.1</td><td>61.7</td><td>52.5</td><td>39.1</td><td>69.9</td></tr><tr><td rowspan="3">LS (e)</td><td>0.25</td><td>67.9</td><td>66.4</td><td>65.0</td><td>62.8</td><td>55.9</td><td>40.9</td><td>69.6</td></tr><tr><td>0.50</td><td>66.8</td><td>65.8</td><td>64.6</td><td>63.8</td><td>57.2</td><td>46.5</td><td>68.4</td></tr><tr><td>0.125</td><td>65.7</td><td>64.2</td><td>60.3</td><td>59.8</td><td>52.3</td><td>39.6</td><td>69.5</td></tr><tr><td rowspan="3">CP(e)</td><td>0.25</td><td>66.8</td><td>65.1</td><td>61.6</td><td>61.0</td><td>53.3</td><td>40.9</td><td>69.3</td></tr><tr><td>0.50</td><td>67.7</td><td>66.0</td><td>64.4</td><td>64.0</td><td>56.8</td><td>44.1</td><td>68.7</td></tr><tr><td>0.125</td><td>65.8</td><td>64.1</td><td>60.7</td><td>59.7</td><td>51.2</td><td>40.6</td><td>68.9</td></tr><tr><td rowspan="3">Boot-soft (ε)</td><td>0.25</td><td>66.2</td><td>64.1</td><td>60.3</td><td>61.1</td><td>54.4</td><td>43.3</td><td>69.1</td></tr><tr><td>0.50</td><td>66.9</td><td>65.3</td><td>61.0</td><td>63.2</td><td>59.0</td><td>44.8</td><td>69.1</td></tr><tr><td>8</td><td>67.8</td><td>67.4</td><td>67.9</td><td>64.7</td><td>57.7</td><td>47.7</td><td>70.1</td></tr><tr><td rowspan="4">ProSelfLC (B)</td><td>10</td><td>68.5</td><td>68.5</td><td>66.8</td><td>63.9</td><td>59.0</td><td>47.5</td><td>70.3</td></tr><tr><td>12</td><td>68.6</td><td>67.9</td><td>67.4</td><td>64.0</td><td>59.3</td><td>47.5</td><td>69.8</td></tr><tr><td>14</td><td>68.7</td><td>68.0</td><td>67.8</td><td>64.8</td><td>59.0</td><td>47.4</td><td>69.6</td></tr><tr><td>16</td><td>68.4</td><td>67.2</td><td>67.3</td><td>63.7</td><td>59.0</td><td>32.3</td><td>69.9</td></tr></table>
185
+
186
+ Table 6: Test accuracy $( \% )$ on the real-world noisy dataset Clothing 1M.
187
+
188
+ <table><tr><td rowspan="2">Boot- hard</td><td rowspan="2">Forward</td><td rowspan="2">D2L</td><td rowspan="2">GCE</td><td rowspan="2">SL</td><td rowspan="2">S- adaptation</td><td rowspan="2">Masking</td><td rowspan="2">MD- DYR-SH</td><td rowspan="2">Joint- soft</td><td colspan="4">Our Trained Results</td></tr><tr><td>CCE</td><td>LS</td><td>CP</td><td>Boot-soft ProSelfLC</td></tr><tr><td>68.9</td><td>69.8</td><td>69.5</td><td>69.8</td><td>71.0</td><td>70.3</td><td>71.1</td><td>71.0</td><td>72.2</td><td>71.8</td><td>72.6 72.4</td><td>72.3</td><td>73.4</td></tr></table>
189
+
190
+ other baselines have been introduced heretofore.
191
+
192
+ Training details. We follow (Tanaka et al., 2018) to train ResNet-50 and initialise it by a trained model on ImageNet. We follow Section 5.1 with small changes: the initial learning rate is 0.01 and we train 10k iterations. They are searched on the separate clean validation set.
193
+
194
+ Result analysis. In Table 6, analogously to CIFAR-100, we report our trained results of CCE, LS, CP, Boot-soft and ProSelfLC for an entirely fair comparison. ProSelfLC has the highest accuracy, which demonstrates its effectiveness again.
195
+
196
+ # 6 CONCLUSION
197
+
198
+ We present a thorough mathematical study on several target modification techniques. Through analysis of entropy and KL divergence, we reveal their relationships and limitations.
199
+
200
+ To improve and endorse self label correction, we propose ProSelfLC. Extensive experiments prove its superiority over existing methods under standard and noisy settings. ProSelfLC enhances the similarity structure information over classes, and rectifies the semantic classes of noisy label distributions. ProSelfLC is the first approach to trust self knowledge progressively and adaptively.
201
+
202
+ ProSelfLC redirects and promotes entropy minimisation, which is in marked contrast to recent practices of confidence penalty (Szegedy et al., 2016; Pereyra et al., 2017; Dubey et al., 2018).
203
+
204
+ # REFERENCES
205
+
206
+ Eric Arazo, Diego Ortego, Paul Albert, Noel O’Connor, and Kevin Mcguinness. Unsupervised label noise modeling and loss correction. In ICML, 2019.
207
+
208
+ Devansh Arpit, Stanisław Jastrz˛ebski, Nicolas Ballas, David Krueger, Emmanuel Bengio, Maxinder S. Kanwal, Tegan Maharaj, Asja Fischer, Aaron Courville, Yoshua Bengio, and Simon Lacoste-Julien. A closer look at memorization in deep networks. In ICML, 2017.
209
+
210
+ Jimmy Ba and Rich Caruana. Do deep nets really need to be deep? In NeurIPS, 2014.
211
+
212
+ Cristian Bucila, Rich Caruana, and Alexandru Niculescu-Mizil. Model compression. In KDDM, 2006.
213
+
214
+ Abhimanyu Dubey, Otkrist Gupta, Ramesh Raskar, and Nikhil Naik. Maximum-entropy fine grained classification. In NeurIPS, 2018.
215
+
216
+ Tommaso Furlanello, Zachary Lipton, Michael Tschannen, Laurent Itti, and Anima Anandkumar. Born again neural networks. In ICML, 2018.
217
+
218
+ Jacob Goldberger and Ehud Ben-Reuven. Training deep neural-networks using a noise adaptation layer. In ICLR, 2017.
219
+
220
+ Yves Grandvalet and Yoshua Bengio. Semi-supervised learning by entropy minimization. In NeurIPS, 2005.
221
+
222
+ Yves Grandvalet and Yoshua Bengio. Entropy regularization. Semi-supervised learning, pp. 151– 168, 2006.
223
+
224
+ Bo Han, Jiangchao Yao, Gang Niu, Mingyuan Zhou, Ivor Tsang, Ya Zhang, and Masashi Sugiyama. Masking: A new perspective of noisy supervision. In NeurIPS, 2018a.
225
+
226
+ 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 NeurIPS, 2018b.
227
+
228
+ John A Hartigan and Manchek A Wong. Algorithm as 136: A k-means clustering algorithm. Journal of the Royal Statistical Society. Series C (Applied Statistics), 28(1):100–108, 1979.
229
+
230
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
231
+
232
+ Dan Hendrycks, Mantas Mazeika, Duncan Wilson, and Kevin Gimpel. Using trusted data to train deep networks on labels corrupted by severe noise. In NeurIPS, 2018.
233
+
234
+ Geoffrey Hinton, Oriol Vinyals, and Jeffrey Dean. Distilling the knowledge in a neural network. In NeurIPS Deep Learning and Representation Learning Workshop, 2015.
235
+
236
+ Lu Jiang, Zhengyuan Zhou, Thomas Leung, Li-Jia Li, and Li Fei-Fei. Mentornet: Learning datadriven curriculum for very deep neural networks on corrupted labels. In ICML, 2018.
237
+
238
+ Alex Krizhevsky. Learning multiple layers of features from tiny images. 2009.
239
+
240
+ Solomon Kullback and Richard A Leibler. On information and sufficiency. The annals of mathematical statistics, pp. 79–86, 1951.
241
+
242
+ Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, pp. 436, 2015.
243
+
244
+ Dong-Hyun Lee. Pseudo-label: The simple and efficient semi-supervised learning method for deep neural networks. 2013.
245
+
246
+ Kuang-Huei Lee, Xiaodong He, Lei Zhang, and Linjun Yang. Cleannet: Transfer learning for scalable image classifier training with label noise. In CVPR, 2018.
247
+
248
+ Yuncheng Li, Jianchao Yang, Yale Song, Liangliang Cao, Jiebo Luo, and Li-Jia Li. Learning from noisy labels with distillation. In ICCV, 2017.
249
+
250
+ Xingjun Ma, Yisen Wang, Michael E Houle, Shuo Zhou, Sarah M Erfani, Shu-Tao Xia, Sudanthi Wijewickrema, and James Bailey. Dimensionality-driven learning with noisy labels. In ICML, 2018.
251
+
252
+ Eran Malach and Shai Shalev-Shwartz. Decoupling "when to update" from "how to update". In NeurIPS, 2017.
253
+
254
+ Rafael Müller, Simon Kornblith, and Geoffrey E Hinton. When does label smoothing help? In NeurIPS, 2019.
255
+
256
+ Giorgio Patrini, Alessandro Rozza, Aditya Krishna Menon, Richard Nock, and Lizhen Qu. Making deep neural networks robust to label noise: A loss correction approach. In CVPR, 2017.
257
+
258
+ Gabriel Pereyra, George Tucker, Jan Chorowski, Łukasz Kaiser, and Geoffrey Hinton. Regularizing neural networks by penalizing confident output distributions. In ICLR Workshop, 2017.
259
+
260
+ Siyuan Qiao, Wei Shen, Zhishuai Zhang, Bo Wang, and Alan Yuille. Deep co-training for semisupervised image recognition. In ECCV, 2018.
261
+
262
+ Scott Reed, Honglak Lee, Dragomir Anguelov, Christian Szegedy, Dumitru Erhan, and Andrew Rabinovich. Training deep neural networks on noisy labels with bootstrapping. In ICLR Workshop, 2015.
263
+
264
+ Adriana Romero, Nicolas Ballas, Samira Ebrahimi Kahou, Antoine Chassang, Carlo Gatta, and Yoshua Bengio. Fitnets: Hints for thin deep nets. In ICLR, 2015.
265
+
266
+ David E Rumelhart, Geoffrey E Hinton, and Ronald J Williams. Learning representations by backpropagating errors. Nature, pp. 533–536, 1986.
267
+
268
+ Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International Journal of Computer Vision, pp. 211–252, 2015.
269
+
270
+ Hwanjun Song, Minseok Kim, and Jae-Gil Lee. Selfie: Refurbishing unclean samples for robust deep learning. In ICML, 2019.
271
+
272
+ Sainbayar Sukhbaatar and Rob Fergus. Learning from noisy labels with deep neural networks. arXiv preprint arXiv:1406.2080, 2014.
273
+
274
+ Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In CVPR, 2016.
275
+
276
+ Daiki Tanaka, Daiki Ikami, Toshihiko Yamasaki, and Kiyoharu Aizawa. Joint optimization framework for learning with noisy labels. In CVPR, 2018.
277
+
278
+ Arash Vahdat. Toward robustness against label noise in training deep discriminative neural networks. In NeurIPS, 2017.
279
+
280
+ Andreas Veit, Neil Alldrin, Gal Chechik, Ivan Krasin, Abhinav Gupta, and Serge Belongie. Learning from noisy large-scale datasets with minimal supervision. In CVPR, 2017.
281
+
282
+ Yisen Wang, Xingjun Ma, Zaiyi Chen, Yuan Luo, Jinfeng Yi, and James Bailey. Symmetric cross entropy for robust learning with noisy labels. In ICCV, 2019.
283
+
284
+ Hongxin Wei, Lei Feng, Xiangyu Chen, and Bo An. Combating noisy labels by agreement: A joint training method with co-regularization. In CVPR, 2020.
285
+
286
+ Tong Xiao, Tian Xia, Yi Yang, Chang Huang, and Xiaogang Wang. Learning from massive noisy labeled data for image classification. In CVPR, 2015.
287
+
288
+ Lingxi Xie, Jingdong Wang, Zhen Wei, Meng Wang, and Qi Tian. Disturblabel: Regularizing cnn on the loss layer. In CVPR, 2016.
289
+
290
+ Ning Xu, Jun Shu, Yun-Peng Liu, and Xin Geng. Variational label enhancement. In ICML, 2020.
291
+
292
+ Ting-Bing Xu and Cheng-Lin Liu. Data-distortion guided self-distillation for deep neural networks. In AAAI, 2019.
293
+
294
+ Jiangchao Yao, Hao Wu, Ya Zhang, Ivor W Tsang, and Jun Sun. Safeguarded dynamic label regression for noisy supervision. In AAAI, 2019.
295
+
296
+ Xingrui Yu, Bo Han, Jiangchao Yao, Gang Niu, Ivor W Tsang, and Masashi Sugiyama. How does disagreement help generalization against label corruption? In ICML, 2019.
297
+
298
+ Li Yuan, Francis EH Tay, Guilin Li, Tao Wang, and Jiashi Feng. Revisiting knowledge distillation via label smoothing regularization. In CVPR, 2020.
299
+
300
+ Sukmin Yun, Jongjin Park, Kimin Lee, and Jinwoo Shin. Regularizing class-wise predictions via self-knowledge distillation. In CVPR, 2020.
301
+
302
+ Linfeng Zhang, Jiebo Song, Anni Gao, Jingwei Chen, Chenglong Bao, and Kaisheng Ma. Be your own teacher: Improve the performance of convolutional neural networks via self distillation. In ICCV, 2019.
303
+
304
+ Ying Zhang, Tao Xiang, Timothy M Hospedales, and Huchuan Lu. Deep mutual learning. In CVPR, 2018.
305
+
306
+ Zhilu Zhang and Mert R Sabuncu. Generalized cross entropy loss for training deep neural networks with noisy labels. In NeurIPS, 2018.
307
+
308
+ # A PROOF OF PROPOSITIONS
309
+
310
+ Proposition 3. Compared with CCE, LS and $C P$ penalise entropy minimisation while $L C$ reward it. Proof. We can rewrite CCE, LS, CP, and LC from the viewpoint of KL divergence:
311
+
312
+ $$
313
+ L _ { \mathrm { C C E } } ( \mathbf { q } , \mathbf { p } ) = \mathrm { H } ( \mathbf { q } , \mathbf { p } ) = \mathrm { K L } ( \mathbf { q } | | \mathbf { p } ) + \mathrm { H } ( \mathbf { q } , \mathbf { q } ) = \mathrm { K L } ( \mathbf { q } | | \mathbf { p } ) ,
314
+ $$
315
+
316
+ where we have $\mathrm { H } ( \mathbf { q } , \mathbf { q } ) = 0$ because $\mathbf { q }$ is a one-hot distribution.
317
+
318
+ $$
319
+ \begin{array} { r l } & { L _ { \mathrm { C C E + L S } } ( \mathbf { q } , \mathbf { p } ; \epsilon ) = ( 1 - \epsilon ) \mathrm { K L } ( \mathbf { q } | | \mathbf { p } ) + \epsilon \mathrm { K L } ( \mathbf { u } | | \mathbf { p } ) + \epsilon \mathrm { H } ( \mathbf { u } , \mathbf { u } ) } \\ & { \quad \quad \quad = ( 1 - \epsilon ) \mathrm { K L } ( \mathbf { q } | | \mathbf { p } ) + \epsilon \mathrm { K L } ( \mathbf { u } | | \mathbf { p } ) + \epsilon \cdot \mathrm { c o n s t a n t } , } \end{array}
320
+ $$
321
+
322
+ $$
323
+ \begin{array} { r l } & { L _ { \mathrm { C C E + C P } } ( { \mathbf { q } } , { \mathbf { p } } ; \epsilon ) = ( 1 - \epsilon ) \mathrm { K L } ( { \mathbf { q } } | | { \mathbf { p } } ) - \epsilon ( \mathrm { H } ( { \mathbf { p } } , { \mathbf { u } } ) - \mathrm { K L } ( { \mathbf { p } } | | { \mathbf { u } } ) ) } \\ & { \qquad = ( 1 - \epsilon ) \mathrm { K L } ( { \mathbf { q } } | | { \mathbf { p } } ) + \epsilon \mathrm { K L } ( { \mathbf { p } } | | { \mathbf { u } } ) - \epsilon \cdot \mathrm { c o n s t a n t } , } \end{array}
324
+ $$
325
+
326
+ where $\mathrm { H } ( \mathbf { p } , \mathbf { u } ) = \mathrm { H } ( \mathbf { u } , \mathbf { u } ) = { \mathrm { c c } }$ onstant. Analogously, LC in Eq (5) can also be rewritten:
327
+
328
+ $$
329
+ L _ { \mathrm { C C E + L C } } ( \mathbf { q } , \mathbf { p } ; \epsilon ) = ( 1 - \epsilon ) \mathrm { K L } ( \mathbf { q } | | \mathbf { p } ) - \epsilon \mathrm { K L } ( \mathbf { p } | | \mathbf { u } ) + \epsilon \cdot \mathrm { c o n s t a n t } .
330
+ $$
331
+
332
+ In LS and CP, both $+ \mathrm { K L } ( \mathbf { u } | | \mathbf { p } )$ and $+ \mathrm { K L } ( \mathbf { p } | | \mathbf { u } )$ pulls $\mathbf { p }$ towards $\mathbf { u }$ . While in LC, the term $- \mathrm { K L } ( \mathbf { p } | | \mathbf { u } )$ pushes $\mathbf { p }$ away from $\mathbf { u }$ . 
333
+
334
+ Proposition 4. In CCE, $L S$ and $C P ,$ a data point x has the same semantic class. In addition, x has an identical probability of belonging to other classes except for its semantic class.
335
+
336
+ Proof. In LS, the target is $\tilde { \mathbf { q } } _ { \mathrm { L S } } = ( 1 - \epsilon ) \mathbf { q } + \epsilon \mathbf { u }$ . For any $0 \leq \epsilon < 1$ , the semantic class is not changed, because $1 - \epsilon + \epsilon * \overset { - } { \underset { C } { \ F } } > \bar { \epsilon } * \frac { 1 } { C }$ . In addition, $\begin{array} { r } { j _ { 1 } \neq y , \dot { j } _ { 2 } \neq y \Rightarrow \tilde { \mathbf { q } } _ { \mathrm { L S } } ( j _ { 1 } | \mathbf { x } ) = \tilde { \mathbf { q } } _ { \mathrm { L S } } ( j _ { 2 } | \mathbf { x } ) = \frac { \epsilon } { C } } \end{array}$ .
337
+
338
+ In CP, $\tilde { \bf q } _ { \mathrm { C P } } = ( 1 - \epsilon ) { \bf q } - \epsilon { \bf p }$ . In terms of label definition, $C P$ is against intuition because these zero-value positions in q are filled with negative values in $\tilde { \mathbf { q } } _ { \mathrm { C P } }$ . A probability has to be not smaller than zero. So we rephrase $\tilde { \mathbf { q } } _ { \mathrm { C P } } ( y | \mathbf { x } ) = ( 1 - \epsilon ) - \epsilon * \mathbf { p } ( y | \mathbf { x } )$ , and $\forall j \neq y , \tilde { \mathbf { q } } _ { \mathrm { C P } } ( j | \mathbf { x } ) = 0$ by replacing negative values with zeros, as illustrated in Figure 1a. 
339
+
340
+ # B LEARNING DYNAMICS OF DIFFERENT NOISE RATES
341
+
342
+ In Figure 4, we store a model every 1000 iterations to monitor the learning process.
343
+
344
+ C THE CHANGES OF ENTROPY STATISTICS AND ProSelfLC AT TRAINING
345
+
346
+ In Figure 5, we visualise how the entropies of noisy and clean subsets change at training.
347
+
348
+ ![](images/d88add6873c102c97acc6fd4a47f9e73306162e4658746c17c92302937b7099f.jpg)
349
+ Figure 4: Learning dynamics on CIFAR-100 under asymmetric noisy labels. We show all iterations only in (a) and (d). In the others, we show the second half iterations, which are of higher interest. As the noise rate increases, the superiority of ProSelfLC becomes more significant, i.e., avoiding fitting noise in the 2nd row and leading to better generalisation in the 1st row.
350
+
351
+ ![](images/87d3947c11ab7a345e37aa40de395b01cf8f4a64c3228a8fe122237e7d38ce9f.jpg)
352
+ Figure 5: The changes of entropy statistics and ProSelfLC at training. We store a model every 1000 iterations to monitor the learning process. For data-dependent metrics, after training, we split the corrupted training data into clean and noisy subsets according to the information about how the training data is corrupted before training. Finally, we report the mean results of each subset.
md/train/63pC59XOZLZ/63pC59XOZLZ.md ADDED
@@ -0,0 +1,263 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Learning to Iteratively Solve Routing Problems with Dual-Aspect Collaborative Transformer
2
+
3
+ Yining $\mathbf { M } \mathbf { a } ^ { 1 }$ , Jingwen $\mathbf { L i } ^ { 1 }$ , Zhiguang $\mathbf { C a o ^ { 2 , * } }$ , Wen Song3,∗, Le Zhang4, Zhenghua Chen5, Jing Tang6
4
+
5
+ 1National University of Singapore 2Singapore Institute of Manufacturing Technology, A\*STAR 3Institute of Marine Science and Technology, Shandong University 4University of Electronic Science and Technology of China 5Institute for Infocomm Research, A\*STAR 6The Hong Kong University of Science and Technology {yiningma, lijingwen}@u.nus.edu, zhiguangcao@outlook.com, wensong@email.sdu.edu.cn, zhangleuestc@gmail.com, chen0832@e.ntu.edu.sg, jingtang@ust.hk
6
+
7
+ # Abstract
8
+
9
+ Recently, Transformer has become a prevailing deep architecture for solving vehicle routing problems (VRPs). However, it is less effective in learning improvement models for VRP because its positional encoding (PE) method is not suitable in representing VRP solutions. This paper presents a novel Dual-Aspect Collaborative Transformer (DACT) to learn embeddings for the node and positional features separately, instead of fusing them together as done in existing ones, so as to avoid potential noises and incompatible correlations. Moreover, the positional features are embedded through a novel cyclic positional encoding (CPE) method to allow Transformer to effectively capture the circularity and symmetry of VRP solutions (i.e., cyclic sequences). We train DACT using Proximal Policy Optimization and design a curriculum learning strategy for better sample efficiency. We apply DACT to solve the traveling salesman problem (TSP) and capacitated vehicle routing problem (CVRP). Results show that our DACT outperforms existing Transformer based improvement models, and exhibits much better generalization performance across different problem sizes on synthetic and benchmark instances, respectively.
10
+
11
+ # 1 Introduction
12
+
13
+ Vehicle Routing problems (VRPs), such as the Traveling Salesman Problem (TSP) and the Capacitated Vehicle Routing Problem (CVRP) which consider finding the optimal route for a single or fleet of vehicles to serve a set of customers, have ubiquitous real-world applications [1, 2]. Despite being intensively studied in the Operations Research (OR) community, VRPs still remain challenging due to their NP-hard nature [3]. Recent studies on learning neural heuristics are gathering attention as promising extensions to traditional hand-crafted ones (e.g., [4–14]), where reinforcement learning (RL) [15] is usually exploited to train a deep neural network as an efficient solver without hand-crafted rules. A salient motivation is that deep neural networks may learn better heuristics by identifying useful patterns in an end-to-end and data-driven fashion.
14
+
15
+ Solutions to VRPs, i.e., routes, are sequences of nodes (customer and depot locations). Naturally, deep models for Natural Language Processing (NLP), which deal with sequence data as well, are ideal choices for encoding VRP solutions. Given its remarkable performance in NLP tasks, Transformer [16] is standing at the forefront in the learning based methods for VRPs (e.g., [5, 7, 8, 11–13, 17]). The original Transformer encodes a sentence, i.e., a sequence of words, into a unified set of embeddings by injecting word positional information into its word embeddings through positional encoding (PE). When it comes to VRPs, while is not required in construction models, positional information is critical for deep models that learn improvement heuristics since the input are solutions to be improved.
16
+
17
+ ![](images/17403d04b62870e5603e11128aad37f05c9529785e72e7e24fbc237438272fea.jpg)
18
+ Figure 1: Transformer frameworks for VRPs. (a) $\mathrm { W u }$ et al. [11] (the original one); (b) DACT (ours).
19
+
20
+ Although some success has been achieved, learning improvement heuristics for VRPs based on the original Transformer encoder is yet lacking from our perspective. Firstly, directly applying addition operation on PE vectors and the embeddings in absolute PE method (i.e., Figure 1(a)) could limit the representation of the model [18], as the mixed correlations2 existing in the self-attention can bring unreasonable noises and random biases to the encoder (details in Appendix A). Secondly, existing PE methods tend to fuse the node and positional information into one unified representation. NLP tasks such as translation may benefit from this owing to the deterministic and instructive nature of the positional information. However, such design may not be optimal for routing tasks because the positional information therein can be non-deterministic and sometimes even random. This may cause disharmony or disturbance in the encoder and may thus deteriorate the performance. Finally, most VRPs seek the shortest loop of the nodes, making their solutions to be cyclic sequences. However, existing PE methods are only designated to encode linear sequences3, which may fail to identify such circular input. As will be shown in our experiments, this could severely damage the generalization performance, since the cyclic feature of VRP solutions is not correctly reflected by the encoder.
21
+
22
+ In this paper, we address the above issues and contribute to the line of using RL to learn neural improvement heuristics for VRPs. We introduce the Dual-Aspect Collaborative Transformer (DACT), where we revisit the solution representations and propose to learn separated groups of embeddings for the node and positional features of a VRP solution as shown in Figure 1(b). Our DACT follows the encoder-decoder structure. In the encoder, each set of embeddings encodes the solution mainly from its own aspect, and at the same time exploits a cross-aspect referential attention mechanism for better perceiving the consistence and differentiation with respect to the other aspect. The decoder then collects action distribution proposals from the two aspects and synthesizes them to output the final one. Meanwhile, we design a novel cyclic positional encoding (CPE) method to capture the circularity and symmetry of VRP solutions, which allows Transformer to encode cyclic inputs, and also boost the generalization performance for solving VRPs. As the last contribution, we design a simple yet effective curriculum learning strategy to improve the sample efficiency. This further leads to faster and more stable convergence of RL training. Extensive experiments show that our DACT can outperform existing Transformer based improvement models with fewer parameters, and also generalizes well across different sizes of synthetic and benchmark instances, respectively.
23
+
24
+ # 2 Related work
25
+
26
+ # 2.1 Positional encoding (PE) in Transformer.
27
+
28
+ The original Transformer adopted the absolute PE method to describe the absolute position of elements in the sequence [16], especially for NLP. As formulated in Eq. (1), each generated positional embedding $p _ { i } \in \mathbb { R } ^ { d }$ is added together with the $i$ -th word embedding $x _ { i }$ in the first layer of the encoder,
29
+
30
+ $$
31
+ \alpha _ { i , j } ^ { \mathrm { A b s } } = \frac { 1 } { \sqrt { d } } ( ( x _ { i } + p _ { i } ) W ^ { Q } ) ( ( x _ { j } + p _ { j } ) W ^ { K } ) ^ { T } .
32
+ $$
33
+
34
+ The relative PE method was further proposed in Shaw et al. [19] to better capture the relative order information. On the basis of absolute PE, it introduces an inductive bias to the attention as follows,
35
+
36
+ $$
37
+ \alpha _ { i , j } ^ { \mathrm { R e l } } = \frac { 1 } { \sqrt { d } } ( ( x _ { i } + p _ { i } ) W ^ { Q } ) ( ( x _ { j } + p _ { j } ) W ^ { K } + a _ { j - i } ) ^ { T } ,
38
+ $$
39
+
40
+ where $a _ { j - i } \in \mathbb { R } ^ { d }$ is learnable parameters for encoding the relative position $j - i$ . To avoid the mixed and noisy correlations between word semantics and positional information in the above two PEs, the Transformer with United Positional Encoding (TUPE) [18] was proposed for NLP which utilizes separated projection metrics $W _ { x }$ and $W _ { p }$ for each information as follows,
41
+
42
+ $$
43
+ \alpha _ { i , j } ^ { \mathrm { T U P E } } = \frac { 1 } { \sqrt { 2 d } } ( x _ { i } W _ { x } ^ { Q } ) ( x _ { j } W _ { x } ^ { K } ) ^ { T } + \frac { 1 } { \sqrt { 2 d } } ( p _ { i } W _ { p } ^ { Q } ) ( p _ { j } W _ { p } ^ { K } ) ^ { T } + b _ { j - i } .
44
+ $$
45
+
46
+ However, as mentioned previously, existing PE methods are less effective for VRPs since they simply fuse the node and positional information into one unified set of embeddings during or after the calculation of the attention correlation $\alpha _ { i , j }$ . Meanwhile, they are also unable to properly encode and handle cyclic input sequences as in VRP solutions.
47
+
48
+ # 2.2 Deep models for VRP.
49
+
50
+ Various deep architectures such as Recurrent Neural Network (RNN), Graph Neural Network (GNN), and Transformer have been employed in solving VRPs.
51
+
52
+ RNN based models. As the pioneering work of neural VRP solvers, Pointer Network adopted RNN and supervised learning to solve TSP [20] (extended to RL in Bello et al. [21] and CVRP in Nazari et al. [22]). While the models in [20–23] learn construction heuristics, NeuRewriter [4] learns improvement heuristic for CVRP using LSTM to encode the positional information of a solution. In Hottung et al. [13], the conditional variational autoencoder was adopted to learn a continuous and latent search space for VRP, where high-quality solutions were taken as input and encoded by RNNs. However, recurrence structures in RNN are less efficient in both representation and computation [5].
53
+
54
+ GNN based models. In Dai et al. [24], GNN was combined with Q-learning for solving TSP. Based on supervised learning, Joshi et al. [6] used GNN to learn heatmaps that prescribe the probability of each edge appearing in the optimal TSP tour. This idea was extended in Fu et al. [25] with additional components such as graph sampling and heatmap merging to enable generalization to larger TSP instances. These models often require post-processing to construct feasible solutions from heatmaps (e.g., beam search [6], Monte-Carlo tree search [25], and dynamic programming [26]).
55
+
56
+ Transformer based models. The Attention Model (AM) by Kool et al. [5] was recognized as the first success of Transformer based models for VRPs. Based on AM, Xin et al. [7] proposed a MultiDecoder AM that learns multiple diverse policies for better performance. In Kwon et al. [8], the RL algorithm of AM was improved which leaded to a new solver, i.e., POMO (Policy Optimization with Multiple Optima), and achieved the state-of-the-art performance. However, POMO is still lacking in generalization. Besides these construction models, Transformer was also explored to learn improvement heuristics. Hottung and Tierney [27] learned first neural large neighborhood search algorithm for VRPs. Lu et al. [12] proposed the L2I model that learns to select local search operators from a pool of traditional ones. Both methods used a Transformer-style encoder, but the positional information is captured in the node features (information of previous and next nodes) instead of using PE methods. Though L2I was shown to outperform LKH3 [28], it is limited to CVRP and the required time is considerably long. Wu et al. [11] proposed a Transformer model which learns to pick node pair in each step to perform a pairwise local operator (e.g., 2-opt). However, it suffers from the inaccurate representation of positional information given the original Transformer encoder.
57
+
58
+ ![](images/5ace11ce359bbb755998396b80534ff05688295f43970028840cdf0661b073b3.jpg)
59
+ Figure 3: Architecture of our policy network, dual-aspect collaborative Transformer (DACT).
60
+
61
+ # 3 Problem formulation
62
+
63
+ We define a VRP instance as a group of $N$ nodes to visit, where the node feature $x _ { i }$ of node $i$ contains 2-dim coordinates and other problem-specific features (e.g., customer demand). A solution $\delta$ consists of a sequence of nodes visited in order where we denote $p _ { i }$ to be the position (indices) of node $i$ in the solution which is deemed as the positional feature of node $i$ . The objective is to minimize the total travel distance $D ( \delta )$ under certain problem-specific constraints.
64
+
65
+ Starting with an initial yet complete solution, our neural RL policy tries to improve the solution iteratively. At each step, the policy automatically selects a pair of nodes and locally adjusts the solution using a preset pairwise operator such as 2-opt, insert, or swap. As illustrated in Figure 2, given a node pair $( i , j )$ , the 2-opt operator adjusts a solution by reversing the segment between node $i$ and node $j$ ; the insert operator adjusts a solution by placing node $i$ after node $j$ ; and the swap operator adjusts a solution by exchanging the position of node $i$ and node $j$ . Such operation is repeated until reaching the step limit $T$ and we model it in the form of Markov Decision Process (MDP) as follows.
66
+
67
+ ![](images/3abc3c66ae47d31052903aafee9790f52c0e269b59a1a7ed0217c149d678c265.jpg)
68
+ Figure 2: Illustration examples of three pairwise operators for routing problems when node pair $( i = 2 , j = 1 )$ ) is specified for operating. From left to right: 2-opt, insert, and swap.
69
+
70
+ State. For an instance with $N$ nodes, a state describes current solution $\delta _ { t }$ using its node and positional features of each node, i.e., $s _ { t } = \Psi ( \delta _ { t } ) = \{ x _ { 1 } ^ { t } , . . . , x _ { N } ^ { t } , p _ { 1 } ^ { t } , . . . , p _ { N } ^ { t } \}$ .
71
+
72
+ Action. The action $a _ { t } = ( i , j )$ specifies a node pair $( i , j )$ for the pairwise operator.
73
+
74
+ Reward. The reward function is defined as, $r _ { t } = D ( \delta _ { t } ^ { * } ) - m i n \left[ D ( \delta _ { t + 1 } ) , D ( \delta _ { t } ^ { * } ) \right]$ where $\delta _ { t } ^ { * }$ is the best incumbent solution found until time $t$ . It refers to the immediate reduced cost at each step with respects to the best incumbent solution, which ensures the cumulative reward equal to the total reduced cost over the initial solution. Hence the reward $r _ { t } > 0$ if and only if a better solution is found. Policy. The policy $\pi _ { \theta }$ is parameterized by the proposed DACT model with parameters $\theta$ . At each time step, the action $( i , j )$ is obtained by sampling the stochastic policy for both training and inference.
75
+
76
+ Transition. The next state $s _ { t + 1 }$ is originated from $s _ { t }$ by performing the preset pairwise operator on the given node pair (action). Our state transient is deterministic, in the sense that it always accepts the next solution as the next state (infeasible solutions will be masked), regardless of its objective value. With such simple rule, the RL agent is expected to automatically learn how to combine multiple steps of simple local movements to achieve better solutions, even if some of them may worsen the current solution. Note that the step limit $T$ can be any user-specified value according to the allowed time budget. Hence, our MDP can have infinite horizon and we consider the reward discount factor $\gamma < 1$ .
77
+
78
+ # 4 Dual-aspect collaborative Transformer model
79
+
80
+ We now present the details of our Dual-Aspect Collaborative Transformer (DACT). The concrete architecture of DACT is presented in Figure 3, where we take the TSP with $N$ nodes as an illustration example. Our DACT leverages separate aspects of embeddings to encode a VRP solution. In the DAC encoder, the self-attention correlations are computed individually for each aspect, and a cross-aspect referential attention mechanism is proposed to enable one aspect to effectively exploit attention correlations from the other aspect as optional references. The DAC decoder then collects action distribution proposals from both aspects and synthesize them to the final one.
81
+
82
+ ![](images/89f6fef802cd35891d1ed76d002b348f40ea6b89b2545c5f6d954311286d8b4a.jpg)
83
+ Figure 5: Comparison of our CPE method with absolute PE method on a TSP instance with 20 nodes. (a) the embedding vectors, (b) the correlations (dot products) between every two embeddings, and (c) the top two principal components after PCA (principal component analysis) projection.
84
+ Figure 4: An example of cyclic Gray code where 4 digits are used to encode $N { = } 1 6$ nodes. The top left shows the base symmetry pattern $\cdot _ { 1 0 0 1 }$ ’ in Gray code, and the top right plots its representation in our method.
85
+
86
+ # 4.1 Dual-aspect solution representation
87
+
88
+ Specifically, we propose to learn two sets of embeddings, i.e., the node feature embeddings (NFEs) for node representation and the positional feature embeddings (PFEs) for positional representation.
89
+
90
+ NFEs. Following [5, 11], the NFE $h _ { i }$ of node $i$ is initialized as the linear projection of its node feature $x _ { i }$ with output dimension4 $d i m = 6 4$ .
91
+
92
+ PFEs. The PFE $g _ { i }$ of the positional feature $p _ { i }$ is initialized as a real-valued vector $( d i m = 6 4 )$ by applying our cyclic positional encoding (CPE), which is designed based on cyclic Gray codes [29].
93
+
94
+ <table><tr><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>6</td><td rowspan=1 colspan=1>7</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>9</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>11</td><td rowspan=1 colspan=1>12</td><td rowspan=1 colspan=1>13</td><td rowspan=1 colspan=1>14</td><td rowspan=1 colspan=1>15</td><td rowspan=1 colspan=1>16</td></tr><tr><td rowspan=2 colspan=1>11</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td></tr></table>
95
+
96
+ As illustrated in Figure 4, the cyclic Gray codes present a cyclic property (‘1110’ in the last column is adjacent to ‘1111’ in the first column) and an adjacency similarity property (any codes in adjacent columns only differ in one digit), both of which are desirable for cyclic sequences. To preserve these properties in designing our CPE, we follow two observed patterns: 1) each numerical digit contains a periodic cycle with reflectional symmetry, e.g., the $\mathbf { \dot { \rho } } _ { 1 0 | 0 1 } ,$ in the lowest digit; and 2) the higher the numerical digit, the longer the period. Accordingly, we create similar patterns based on the sinusoidal functions in Eq. (4), where a periodic function with period $\frac { 4 \pi } { \omega _ { d } }$ (induced by modulus) is used to generate one base symmetry pattern (the top right in Figure 4),
97
+
98
+ $$
99
+ \begin{array} { r } { \overrightarrow { g _ { i } ^ { \prime } } ^ { ( d ) } : = \left\{ \begin{array} { l l } { s i n ( \omega _ { d } \cdot \mathrm { \Gamma } ( z ( i ) \bmod \frac { 4 \pi } { \omega _ { d } } ) - \frac { 2 \pi } { \omega _ { d } } \mathrm { \Gamma } ) , \mathrm { ~ i f ~ } d \mathrm { ~ i s ~ e v e n } } \\ { c o s ( \omega _ { d } \cdot \mathrm { \Gamma } ( z ( i ) \bmod \frac { 4 \pi } { \omega _ { d } } ) - \frac { 2 \pi } { \omega _ { d } } \mathrm { \Gamma } ) , \mathrm { ~ i f ~ } d \mathrm { ~ i s ~ o d d } } \end{array} \right. } \end{array}
100
+ $$
101
+
102
+ $\begin{array} { r } { z ( i ) = \frac { i - 1 } { N } \frac { 2 \pi } { \omega _ { d } } \left\lceil \frac { N + 1 } { 2 \pi / \omega _ { d } } \right\rceil } \end{array}$ is to make $N$ nodes linearly spaced in the generated pattern; the angular frequency $\omega _ { d }$ is decreasing along the dimension to make the wavelength longer within the range $[ N ^ { \frac { 1 } { [ d i m / 2 ] } } , N ]$ (see Appendix B for details). In Figure 5, we visualize the comparison between the absolute PE and our CPE for encoding a TSP instance of 20 nodes. Figure 5(a) demonstrates that our real-valued base symmetry pattern has a longer cyclic period as the digit grows. Figure 5(b) indicates that our method (blue) is able to correctly reflect the adjacency between the head and tail of the cyclic sequence whereas the PE method (red) fails to do so. Figure 5(c) verifies that our CPE vectors are well distributed in space with desired cyclic and adjacency similarity properties.
103
+
104
+ # 4.2 The encoder
105
+
106
+ The encoder consists of $L = 3$ stacked DAC encoders. In each DAC encoder, we retain relatively independent encoding stream for NFEs and PFEs as in Eq. (5) and Eq. (6), respectively, each of which consists of a shared Dual-Aspect Collaborative Attention (DAC-Att) sub-layer and an independent feed-forward network (FFN) sub-layer. DAC-Att takes both sets of embeddings as input and then outputs their respective enhanced embeddings, i.e., NFEs $\{ \tilde { h } \} _ { i = 1 } ^ { N }$ and PFEs $\{ \tilde { g } \} _ { i = 1 } ^ { N }$ . Each sub-layer is followed by skip connection [30] and layer normalization [31] as same as the original Transformer.
107
+
108
+ $$
109
+ \begin{array} { r } { h _ { i } ^ { ( l ) } = \mathbf { L N } \Big ( h _ { i } ^ { \prime } + \mathbf { F F N } _ { h } ^ { ( l ) } ( h _ { i } ^ { \prime } ) \Big ) , h _ { i } ^ { \prime } = \mathbf { L N } \Big ( h _ { i } ^ { ( l - 1 ) } + \tilde { h } _ { i } ^ { ( l ) } \Big ) , } \\ { g _ { i } ^ { ( l ) } = \mathbf { L N } \Big ( g _ { i } ^ { \prime } + \mathbf { F F N } _ { g } ^ { ( l ) } ( g _ { i } ^ { \prime } ) \Big ) , g _ { i } ^ { \prime } = \mathbf { L N } \Big ( g _ { i } ^ { ( l - 1 ) } + \tilde { g } _ { i } ^ { ( l ) } \Big ) . } \end{array}
110
+ $$
111
+
112
+ DAC-Att. The DAC-Att sub-layer enhances each set of embedding from its own aspect, while leveraging attention correlations from the other aspect to achieve the synergy. Given the two sets of embeddings5, $\{ h _ { i } \} _ { i = 1 } ^ { N }$ and $\{ g _ { i } \} _ { i = 1 } ^ { N }$ , we first compute the self-attention correlation from both aspects,
113
+
114
+ $$
115
+ \alpha _ { i , j } ^ { h } = \frac { 1 } { \sqrt { d _ { k } } } \left( h _ { i } W _ { h } ^ { Q } \right) \left( h _ { j } W _ { h } ^ { K } \right) ^ { T } , \quad \alpha _ { i , j } ^ { g } = \frac { 1 } { \sqrt { d _ { k } } } \left( g _ { i } W _ { g } ^ { Q } \right) \left( g _ { j } W _ { g } ^ { K } \right) ^ { T } ,
116
+ $$
117
+
118
+ where independent matrices $W _ { h } ^ { Q } , W _ { h } ^ { K } , W _ { g } ^ { Q }$ and $W _ { g } ^ { K } \in \mathbb { R } ^ { d i m \times d _ { k } }$ are used to calculate queries and keys. The obtained correlations are further normalized to $\tilde { \alpha } _ { i , j } ^ { h }$ and $\tilde { \alpha } _ { i , j } ^ { g }$ via Softmax. Note that the correlations are computed from their own aspect, which eliminates possible noises and conduces to correctly describe the incompatible node pair relationships in different aspects of VRP solutions.
119
+
120
+ We then exploit a cross-aspect referential attention mechanism, which allows computed correlations to be shared between each other, as additional references for both contradistinction and collaboration,
121
+
122
+ $$
123
+ \mathrm { o u t } _ { i } ^ { h } = \mathrm { C o n c a t } \left[ \sum _ { j = 1 } ^ { N } \tilde { \alpha } _ { i , j } ^ { h } \left( h _ { j } W _ { h } ^ { V } \right) , \sum _ { j = 1 } ^ { N } \tilde { \alpha } _ { i , j } ^ { g } \left( h _ { j } W _ { h } ^ { V r e f } \right) \right] ,
124
+ $$
125
+
126
+ $$
127
+ \mathrm { o u t } _ { i } ^ { g } = \mathrm { C o n c a t } \left[ \sum _ { j = 1 } ^ { N } { \tilde { \alpha } } _ { i , j } ^ { g } \left( g _ { j } W _ { g } ^ { V } \right) , \sum _ { j = 1 } ^ { N } { \tilde { \alpha } } _ { i , j } ^ { h } \left( g _ { j } W _ { g } ^ { V r e f } \right) \right] ,
128
+ $$
129
+
130
+ wheand $W _ { h } ^ { V } , W _ { g } ^ { V } \in \mathbb R ^ { d i m \times d _ { v } }$ are trainable parameter matrices for formulating values in each aspect; are parameter matrices for each aspect to generate referential values. $W _ { h } ^ { V r e f } , W _ { g } ^ { V r e f } \in \mathbb R ^ { d i m \times d _ { v } }$ We finally use the multi-head attention to get NFEs $\tilde { h } _ { i }$ and PFEs $\tilde { g } _ { i }$ as follows,
131
+
132
+ $$
133
+ \begin{array} { r } { \begin{array} { c } { \tilde { h } _ { i } , \tilde { g } _ { i } = \mathbf { D A C - A t t } \left( W ^ { Q } , ~ W ^ { K } , W ^ { V } , W ^ { V _ { r e f } } , W ^ { O } \right) , } \\ { \tilde { h } _ { i } = \mathbf { C o n c a t } \left[ \mathrm { h e a d } _ { i , 1 } ^ { h } , . . . , \mathrm { h e a d } _ { i , m } ^ { h } \right] W _ { h } ^ { O } , ~ \tilde { g } _ { i } = \mathbf { C o n c a t } \left[ \mathrm { h e a d } _ { i , 1 } ^ { g } , . . . , \mathrm { h e a d } _ { i , m } ^ { g } \right] W _ { g } ^ { O } , } \end{array} } \end{array}
134
+ $$
135
+
136
+ where h $\mathbf { e a d } _ { i , k } ^ { h } = o u t _ { i , k } ^ { h }$ , $\mathbf { h e a d } _ { i , k } ^ { g } = o u t _ { i , k } ^ { g }$ , and $W _ { h } ^ { O } , W _ { g } ^ { O } \ \in \ \mathbb { R } ^ { 2 m d _ { v } \times d i m }$ are trainable parameter matrices. In our model, we adopt $m = 4$ and $d _ { k } = d _ { v } = 1 6$ .
137
+
138
+ FFN. Our FFN sub-layer has only one hidden layer with 64 hidden unites and adopts the ReLU activation function. The parameters of $\mathbf { F F N } _ { h }$ and $\mathbf { F F N } _ { g }$ are different for each group of embeddings.
139
+
140
+ # 4.3 The decoder
141
+
142
+ In the DAC decoder, the two sets of embeddings $\{ h _ { i } ^ { ( L ) } \} _ { i = 1 } ^ { N }$ and $\{ g _ { i } ^ { ( L ) } \} _ { i = 1 } ^ { N }$ are first passed through a Max-pooling sub-layer and a multi-head compatibility (MHC) sub-layer to independently generate diversified node-pair selection proposals from their own aspect, which are then aggregated through a feed-forward aggregation (FFA) sub-layer for output.
143
+
144
+ Max-pooling. For each set of embeddings, we adopt the max-pooling sub-layer in Wu et al. [11] to aggregate the global representation of all $N$ embeddings into each respective one6.
145
+
146
+ MHC. The compatibility sub-layer computes the attention correlations for each embedding pair, where the obtained correlations with size $N \times N$ will be deemed as a proposal distribution for node pair selection. Our correlations are computed based on multiple heads for diversity. And we calculate separated attention score matrices $\boldsymbol { Y } _ { k } ^ { h } , \boldsymbol { \dot { Y } } _ { k } ^ { g } \in \mathbb { R } ^ { N \times N }$ (of head $k$ ) from the two aspects independently. Accordingly, the action distribution proposals would be different due to their aspect-specific focus and cognitions of the current solution, which will provide the subsequent FFA layer with a rich pool of proposals and allow our model to be more flexible and robust.
147
+
148
+ FFA. Once all proposals from two aspects are collected, a FFN with four layers (dimensions are $2 m$ , 32, 32 and 1, respectively) and ReLU activation is used to aggregate them,
149
+
150
+ $$
151
+ \tilde { Y } _ { i , j } = \mathbf { F } \mathbf { F } \mathbf { A } \left( Y _ { i , j , 1 } ^ { g } , . . . , Y _ { i , j , m } ^ { g } , Y _ { i , j , 1 } ^ { h } , . . . Y _ { i , j , m } ^ { h } \right) ,
152
+ $$
153
+
154
+ where $m = 4$ is the number of heads; and the output $\tilde { Y } _ { i , j }$ is a scalar indicating the likelihood of selecting node pair $( i , j )$ as an action. Afterwards, we apply $\hat { Y } _ { i j } = C \cdot \mathrm { T a n h } ( \tilde { Y } _ { i , j } )$ with $C = 6$ to control the entropy, and mask 7 the infeasible node pairs $( i ^ { \prime } , j ^ { \prime } )$ as $\hat { Y } _ { i ^ { \prime } j ^ { \prime } } = - \infty$ . Lastly, the likelihoods are normalized using Softmax function to obtain the final action distribution $P _ { i , j }$ .
155
+
156
+ # 4.4 Reinforcement learning algorithm
157
+
158
+ We adopt the proximal policy optimization [32] with $n$ -step return estimation for training (details are given in Appendix C), and design a curriculum learning (CL) strategy for better sample efficiency.
159
+
160
+ Curriculum learning strategy. The strategy in Wu et al. [11] sets a maximum of $T _ { t r a i n }$ steps for training and estimates future returns by bootstrapping [33]. However, due to the concern of training cost, $T _ { t r a i n }$ is usually much smaller than actual $T$ for inference (e.g., 200 v.s. 10k), which may leave the agent a poor chance of observing high-quality solutions (states) during training. Consequently, it may cause high variance for bootstrapping because the value function is mostly fitted on low-quality solutions and may render it less knowledgeable in estimating long-term future returns accurately. In this paper, we tackle this issue by a simple yet efficient strategy which gradually prescribes higher-quality solutions as the initial states for training. In doing so, 1) it increases the probability for the agent to observe better solutions and thus reduce the variance of the value function; 2) it increases the difficulty of the learning task (higher-quality solutions are harder to improve) in a gradual manner and achieves better sample efficiency [34]. In practice, those higher-quality solutions can be easily achieved by improving the randomly generated ones using the current policy for a few $T _ { i n i t }$ steps, where $T _ { i n i t }$ could be slightly increased as the epoch grows.
161
+
162
+ # 5 Experiments
163
+
164
+ We evaluate our DACT model on two representative routing problems, i.e., TSP and CVRP [5, 8, 11]. For each problem, we abide by existing conventions to randomly generate instances on the fly for three sizes, i.e., $N = 2 0$ , 50 and 100. Initial experiments with three operators including 2-opt, swap and insert show that 2-opt performs best for both TSP and CVRP (with insert better than swap), hence we report results of our method based on 2-opt. Following [4, 11, 27] we use randomly generated initial solutions for training and the solutions generated by the greedy algorithm for inference. Since each problem has its own constraints and node features, we adjust the input, feasibility masks, and problem-dependent hyperparameters for each problem, the details of which are provided in Appendix D and E. The DACT is trained and tested on a server equipped with TITAN RTX GPU cards and Intel i9-10940X CPU at $3 . 3 0 \mathrm { G H z }$ . Our code in PyTorch are available here8.
165
+
166
+ Table 1: Comparison with various baselines on TSP and CVRP.
167
+
168
+ <table><tr><td rowspan="2" colspan="2">Method</td><td colspan="3">N=20</td><td colspan="3">N=50</td><td colspan="3">N=100</td></tr><tr><td>Obj.</td><td>Gap</td><td>Time</td><td>Obj.</td><td>Gap</td><td>Time</td><td>Obj.</td><td>Gap</td><td>Time</td></tr><tr><td rowspan="10">LKH P</td><td>Concorde</td><td>3.83</td><td>=</td><td>(3m)</td><td>5.70</td><td></td><td>(10m)</td><td>7.76</td><td></td><td>(1h)</td></tr><tr><td></td><td>3.83</td><td>0.00%</td><td>(38s)</td><td>5.70</td><td>0.00%</td><td>(5m)</td><td>7.76</td><td>0.00%</td><td>(20m)</td></tr><tr><td>OR-Tools</td><td>3.86</td><td>0.94%</td><td>(42s)</td><td>5.85</td><td>2.87%</td><td>(5m)</td><td>8.06</td><td>3.86%</td><td>(23m)</td></tr><tr><td>Neural-2-Opt [23]</td><td>3.84</td><td>0.00%</td><td>(15m)</td><td>5.70</td><td>0.12%</td><td>(29m)</td><td>7.83</td><td>0.87%</td><td>(41m)</td></tr><tr><td>Wu et al. [11] (T=5k)</td><td>3.83</td><td>0.00%</td><td>(1h)</td><td>5.70</td><td>0.20%</td><td>(1.5h)</td><td>7.87</td><td>1.42%</td><td>(2h)</td></tr><tr><td>DACT (T=1k)</td><td>3.83</td><td>0.04%</td><td>{7s}(24s)</td><td>5.70</td><td>0.14%</td><td>{16s}(1m)</td><td>7.89</td><td>1.62%</td><td>{48s}(4m)</td></tr><tr><td>DACT (T=5k)</td><td>3.83</td><td>0.00%</td><td>{32s}(2m)</td><td>5.70</td><td>0.02%</td><td>{2m}(6m)</td><td>7.81</td><td>0.61%</td><td>{4m}(18m)</td></tr><tr><td>DACT (T=10k)</td><td>3.83</td><td>0.00%</td><td>{1m}(5m)</td><td>5.70</td><td>0.01%</td><td>{3m}(13m)</td><td>7.79</td><td>0.37%</td><td>{8m}(40m)</td></tr><tr><td>DACT×4 augment</td><td>3.83</td><td>0.00%</td><td>{3m}(10m)</td><td>5.70</td><td>0.00%</td><td>{10m}(1h)</td><td>7.77</td><td>0.09%</td><td>{29m}(2.5h)</td></tr><tr><td>GCN-BS [6]</td><td>3.84</td><td>0.01%</td><td>(12m)</td><td>5.70</td><td>0.01%</td><td>(18m)</td><td>7.87</td><td>1.39%</td><td>(40m)</td></tr><tr><td>AM-sampling [5]</td><td>3.84</td><td>0.08%</td><td>(5m)</td><td>5.73</td><td>0.52%</td><td>(24m)</td><td>7.94</td><td>2.26%</td><td>(1h)</td></tr><tr><td>MDAM-BS[7]</td><td>3.84t</td><td>0.00%</td><td>(3m)</td><td>5.70</td><td>0.03%</td><td>(14m)</td><td>7.79</td><td>0.38%</td><td>(44m)</td></tr><tr><td>POMO [8]</td><td>3.83</td><td>0.04%</td><td>(1s)</td><td>5.70</td><td>0.21%</td><td>(2s)</td><td>7.80</td><td>0.46%</td><td>(11s)</td></tr><tr><td>POMO×8 augment [8]</td><td>3.83</td><td>0.00%</td><td>(3s)</td><td>5.69t</td><td>0.03%</td><td>(16s)</td><td>7.78</td><td>0.15%</td><td>(1m)</td></tr><tr><td>DPDP(100k) [26]</td><td>-</td><td></td><td></td><td>-</td><td></td><td>=</td><td>7.77+</td><td>0.00%</td><td>(3h)</td></tr><tr><td rowspan="9">LKH OR-Tools NeuRewriter [4] NLNS [27]</td><td rowspan="9">CVAE-Opt-DE [13]</td><td>1</td><td>0.00%#</td><td>11m#</td><td>-</td><td>0.02%#</td><td>22m#</td><td>-</td><td>0.34%#</td><td>55m#</td></tr><tr><td></td><td>0.00%</td><td></td><td></td><td></td><td>4h</td><td>15.68</td><td></td><td></td></tr><tr><td>6.14 6.46</td><td>5.68%</td><td>1h 2m</td><td>10.38 11.27</td><td>0.00% 8.61%</td><td>13m</td><td>17.12</td><td>0.00% 9.54%</td><td>8h 46m</td></tr><tr><td>6.15#</td><td></td><td>6m#</td><td>10.51#</td><td></td><td>11m#</td><td>16.10#</td><td></td><td></td></tr><tr><td>6.19#</td><td>=</td><td>6m#</td><td>10.54#</td><td></td><td>11m#</td><td>15.99#</td><td>=</td><td>17m# 16m#</td></tr><tr><td>Wu et al. [11] (T=5k) 6.12</td><td>0.39%</td><td>(2h)</td><td>10.45</td><td>0.70%</td><td>(4h)</td><td>16.03t</td><td>= 2.47%</td><td></td></tr><tr><td>DACT (T=1k)</td><td>0.28%</td><td>{16s}(33s)</td><td>10.61</td><td>2.13%</td><td>{43s}(2m)</td><td>16.17</td><td>3.18%</td><td>(5h) {2m}(5m)</td></tr><tr><td>DACT (T=5k)</td><td>6.15 6.13 -0.00%</td><td>{1m}(3m)</td><td>10.48</td><td>1.01%</td><td>{3m}(8m)</td><td>15.92</td><td>1.55%</td><td>{8m}(23m)</td></tr><tr><td>DACT (T=10k)</td><td>-0.04%</td><td>{2m}(6m)</td><td>10.46</td><td>0.79%</td><td>{6m}(16m)</td><td>15.85</td><td>1.12%</td><td>{16m}(45m)</td></tr><tr><td rowspan="2">DACT×6 augment</td><td>6.13 6.13</td><td>-0.08%</td><td>{11m}(35m)</td><td>10.39</td><td>0.14%</td><td>{32m}(1.5h)</td><td>15.71</td><td>0.19%</td><td>{1.5h}(4.5h)</td></tr><tr><td>AM-sampling [5]</td><td>1.87%</td><td>(6m)</td><td>10.62</td><td>2.40%</td><td>(28m)</td><td></td><td></td><td></td></tr><tr><td rowspan="2">MDAM-BS[7]</td><td>6.25 6.14</td><td>0.18%</td><td>(5m)</td><td>10.48</td><td>0.98%</td><td>(15m)</td><td>16.23 15.99#</td><td>3.72% 2.23%</td><td>(2h)</td></tr><tr><td></td><td>0.82%</td><td>(1s)</td><td>10.49</td><td>1.14%</td><td>(4s)</td><td>15.83</td><td>0.98%</td><td>(1h) (19s)</td></tr><tr><td>POMO [8] POMO×8 augment [8]</td><td>6.17 6.14</td><td>0.21%</td><td>(5s)</td><td>10.42</td><td>0.45%</td><td>(26s)</td><td>15.73</td><td>0.32%</td><td>(2m)</td></tr><tr><td>DPDP(100k)[26]</td><td></td><td></td><td></td><td></td><td></td><td></td><td>15.69</td><td>0.31%</td><td></td></tr><tr><td>CVAE-Opt-DE [13]</td><td>= 6.14#</td><td></td><td>= 21m#</td><td>= 10.40#</td><td></td><td>41m#</td><td>15.75#</td><td></td><td>(6h) 1.5h#</td></tr></table>
169
+
170
+ # the obj. values, gaps or time are obtained based on 2,000 instances in their original papers, and not directly comparable to ours. ‡ the obj. values obtained by Concorde or LKH may be slightly different from ours since the 10,000 instances are randomly generated. E.g., for TSP50, the optimal values according to our running of Concorde is 5.70, while 5.69 in POMO and Wu et al.. We thus focus more on gaps.
171
+
172
+ # 5.1 Comparison studies
173
+
174
+ In Table 1, we compare our DACT with, (1) learning based improvement methods, including Wu et al. [11], Neural-2-Opt [23] (TSP only), NeuRewriter [4] (CVRP only), NLNS [27] (CVRP only), (2) learning based construction methods, including AM-sampling [5], GCN-BS [6] (TSP only), MDAM-BS [7], POMO [8], (3) conventional optimization algorithms equipped with learning based component(s), including DPDP [26], CVAE-Opt-DE [13], and (4) strong conventional solvers including Concorde [35], LKH [28, 36], and OR-Tools [37]. Though L2I [12] can outstrip LKH on CVRP, we do not inlude it as a baseline since it requires a prohibitively longer inference time than others9. All results are averaged over 10,000 randomly generated instances unless specified otherwise (e.g., the ones marked with # only infer 2,000 instances), and we report the metrics of objective values, (optimality) gaps and run time. Regarding baselines, we follow the results reported in their original papers, which may not include all the three metrics. For TSP, Concorde is adopted to get the optimal solutions, based on which the optimality gaps of other methods are calculated. CVRP is harder to be solved optimally, and the gaps are calculated based on solutions of LKH. Note that even for the baselines which infer 10,000 random instances, their objective values might be slightly different from ours (e.g., the ones marked with $\ddagger .$ ), therefore we focus more on gaps for fair comparison. The run time is also hard to compare due to various factors (e.g., GPU/CPU models, batch sizes, Python v.s. $\mathrm { C } { + + }$ ). For DACT, we report the time for inferring all 10,000 instances with multiple GPU cards in $^ { 6 6 } ( ) "$ , and a small batch (512 instances) with one single GPU card in “{}".
175
+
176
+ Pertaining to TSP, our DACT with inference step limit of 5,000 $\mathrm { ( T = 5 k }$ ) outperforms the traditional solver OR-Tools and all improvement models in terms of optimality gap, including Wu et al. [11] which directly adopted the original Transformer encoder. It also outstrips construction methods
177
+
178
+ Table 2: Generalization performance. (a) DACT v.s. baselines on benchmark datasets (up to 200 customers, see Appendix E.4 for detailed results and discussion); (b) PE v.s. CPE on different sizes.
179
+
180
+ <table><tr><td>Method</td><td>TSPLIB</td><td>CVRPLIB</td></tr><tr><td>OR-Tools [37]</td><td>3.34%</td><td>8.06%</td></tr><tr><td>AM-sampling [5]</td><td>22.83%</td><td>26.66%</td></tr><tr><td>POMO [8]</td><td>10.06%</td><td>6.10%</td></tr><tr><td>Wu et al. [11]</td><td>4.17%</td><td>5.20%</td></tr><tr><td>DACT</td><td>2.07%</td><td>3.41%</td></tr></table>
181
+
182
+ (a)
183
+
184
+ <table><tr><td rowspan="2">Method</td><td colspan="2">N=20</td><td colspan="2">N=100</td></tr><tr><td>Obj.</td><td>Gap</td><td>Obj.</td><td>Gap</td></tr><tr><td>DACT-PE (T=5k)</td><td>3.84</td><td>0.21%</td><td>8.38</td><td>7.93%</td></tr><tr><td>DACT-CPE (T=5k)</td><td>3.83</td><td>0.10%</td><td>7.99</td><td>2.98%</td></tr><tr><td>Wu et al.[11] (T=5k)</td><td>3.91</td><td>2.14%</td><td>9.03</td><td>16.37%</td></tr><tr><td>OR-Tools [37]</td><td>3.83</td><td>0.00%</td><td>8.06</td><td>3.87%</td></tr></table>
185
+
186
+ (b)
187
+
188
+ Table 3: Dual v.s. single aspect representation
189
+
190
+ <table><tr><td>Steps</td><td>Method</td><td>#Params</td><td>N=50</td><td>N=100</td></tr><tr><td rowspan="2">T=1k</td><td>SA-T</td><td>0.37M</td><td>0.35% (1m)</td><td>3.49% (3m)</td></tr><tr><td>DACT</td><td>0.29M</td><td>0.14% (1m)</td><td>1.62% (4m)</td></tr><tr><td rowspan="2">T=5k</td><td>SA-T</td><td>0.37M</td><td>0.05% (5m)</td><td>1.55% (16m)</td></tr><tr><td>DACT</td><td>0.29M</td><td>0.02% (6m)</td><td>0.61% (18m)</td></tr></table>
191
+
192
+ including AM-sampling and GCN-BS on TSP100. With larger step limit $\mathrm { T } { = } 1 0 \mathrm { k }$ , our DACT further boosts the solution qualities and outperforms other construction methods including MDAM-BS (beam search), and POMO (the current state-of-the-art). To further reduce the gaps, we also leverage the data augmentation technique in POMO (which considers flipping node coordinates without changing the optimal solution) to solve same instances multiple times in different ways. Although the inference time increases (we run data augmentation in serial on the same GPUs), our DACT with 4 augments not only outstrips POMO with 8 augments but also achieves the lowest objective values and gaps among all purely learning based models. In particular, our method almost optimally solved TSP20 and TSP50 with gap lower than $0 . 0 0 5 \%$ , and $0 . 0 9 \%$ on TSP100, which is superior to most of the recent neural solvers. Pertaining to CVRP, our DACT with $\mathrm { T } { = } 5 \mathrm { k }$ produces lower gaps than that of improvement models including NeuRewriter and NLNS. It also performs much better than Wu et al. [11] except on CVRP50. With $\mathrm { T } { = } 1 0 \mathrm { k }$ and 6 augments10, our DACT exhibits even better performance than the highly specialized heuristic solver LKH on CVRP20 and delivers the smallest gap of $0 . 1 9 \%$ on CVRP100 against other neural solvers including POMO with 8 augments. Besides, our DACT is also competitive to DPDP which leverages learnt heatmap and dynamic programming to search solutions. Though DPDP (100k) can solve TSP100 instances almost optimally, our DACT is more efficient than DPDP on CVRP100. Compared with CVAE-Opt-DE, despite that it is averaged over fewer instances and integrated with differential evolution, our objective values are still lower.
193
+
194
+ In terms of the inference time, our DACT is highly competitive against all neural solvers except POMO which learns a construction model by sampling diverse trajectories. However, when it comes to the generalization performance on benchmark datasets, i.e., TSPLIB [38] and CVRPLIB [39] in Table 2(a), DACT produces significantly lower average gaps than the POMO with 8 augments, which indicates that our DACT is more advantageous in practice despite its longer inference time. On the other hand, it is possible to adopt a similar diverse rollout strategy for DACT to find better solutions earlier, or explore other model compression techniques such as the knowledge distillation [40] to learn a lighter DACT model for faster inference. Since our focus is to ameliorate Transformer for neural improvement solvers, we will investigate these possibilities in the future.
195
+
196
+ # 5.2 Ablation studies
197
+
198
+ Dual-aspect representation. In Table 3, we evaluate the effectiveness of our dual-aspect representation against the single-aspect one (SA-T) on TSP50 and TSP100, where SA-T mainly follows the Transformer in $\mathbf { W } \mathbf { u }$ et al. [11] but equipped with the CPE, multi-head attentions and CL strategy for fair comparison. We observe that our DACT with fewer parameters consistently outperforms SA-T, which verifies the effectiveness of the dual-aspect representation.
199
+
200
+ ![](images/2102778a136af66f4a0dae7bc32cd3d938ae977b3f9616db51da4c7cf94b2d1f.jpg)
201
+ Figure 6: Visualization of the attention scores for the encoder when a trained model is used to solve instances with a larger size. (a) using PE method; (b) using CPE method (ours).
202
+
203
+ Cyclic positional encoding. Here we show that CPE significantly improves the generalization performance across different problem sizes. In Table 2(b), we record the results of our DACT with PE and CPE, and Wu et al. [11], when the model trained on TSP50 is directly used to solve instances from TSP20 and TSP100 with $\mathrm { T } { = } 5 \mathrm { k }$ . We see that even with PE, our DACT outperforms Wu et al. [11]. Further equipped with CPE, DACT outstrips DACT-PE and OR-Tools on TSP100. We continue to compare the two DACT variants by visualizing their attention scores. As depicted in Figure 6(a), although the absolute PE is designed for linear sequences, it did attempt to capture the circularity of
204
+
205
+ ![](images/dcaf347b7b825fb752b6ddcd50ad1a4968c6104e02beab829841e1b66d04fde2.jpg)
206
+ Figure 7: Training curves of PPO with and without CL on CVRP20 (random seeds 1-5).
207
+
208
+ VRP solutions (as highlighted in the green boxes) after training. However, the ability to perceive such properties significantly drops when generalizing over different problem size, which instead engenders random attention scores when generalizing to larger size (see right side of Figure 6(a)). In contrast, our DACT with CPE is able to capture the circularity as depicted in Figure 6(b), which verifies the effectiveness of CPE in representing cyclic sequences (i.e., VRP solutions).
209
+
210
+ Curriculum learning (CL) strategy. In Figure 7, we plot the training curves of PPO algorithm with and without our CL strategy, where the results are averaged over 5 independent runs with $90 \%$ confidence intervals. It shows that our CL strategy significantly improves the sample efficiency while reducing the variance of training, which aligns with our analysis in Section 4.4.
211
+
212
+ # 6 Conclusions and future work
213
+
214
+ In this paper, we present a novel DACT model for routing problems. It learns separate groups of embeddings for the node and positional features, and is equipped with cyclic positional encoding (CPE) to capture the circularity and symmetry of VRP solutions. A curriculum learning (CL) strategy is also exploited to improve the RL training efficiency. Extensive experiments on both synthetic and benchmark datasets justified the effectiveness of DACT in terms of both inference and generalization. A potential limitation is that DACT is more useful for learning improvement models at present. In the future, we will investigate how to extend DACT to construction models, and how to speed up the DACT through diverse rollouts or model compression techniques. It is also interesting to apply the proposed CPE to develop Transformer based model for other tasks where the cyclic property is also important, e.g., encoding circular DNA/RNA structures in computational biology [41, 42].
215
+
216
+ # Acknowledgments and Disclosure of Funding
217
+
218
+ This work was supported in part by the National Natural Science Foundation of China under Grant 61803104 and Grant 62102228, in part by the Young Scholar Future Plan of Shandong University under Grant 62420089964188, and in part by the A\*STAR CyberPhysical Production System (CPPS) - Towards Contextual and Intelligent Response Research Program, under the RIE2020 IAF-PP Grant A19C1a0018, and Model Factory $@$ SIMTech.
219
+
220
+ References
221
+ [1] Paolo Toth and Daniele Vigo. Vehicle routing: problems, methods, and applications. SIAM press, 2014.
222
+ [2] Michael Schneider, Andreas Stenger, and Dominik Goeke. The electric vehicle-routing problem with time windows and recharging stations. Transportation Science, 48(4):500–520, 2014.
223
+ [3] Jan Karel Lenstra and AHG Rinnooy Kan. Complexity of vehicle routing and scheduling problems. Networks, 11(2):221–227, 1981.
224
+ [4] Xinyun Chen and Yuandong Tian. Learning to perform local rewriting for combinatorial optimization. In Advances in Neural Information Processing Systems, volume 32, pages 6281–6292, 2019.
225
+ [5] Wouter Kool, Herke van Hoof, and Max Welling. Attention, learn to solve routing problems! In International Conference on Learning Representations, 2018.
226
+ [6] Chaitanya K Joshi, Thomas Laurent, and Xavier Bresson. An efficient graph convolutional network technique for the travelling salesman problem. arxiv preprint arxiv:1906.01227, ArXiV, 2019.
227
+ [7] Liang Xin, Wen Song, Zhiguang Cao, and Jie Zhang. Multi-decoder attention model with embedding glimpse for solving vehicle routing problems. In Proceedings of 35th AAAI Conference on Artificial Intelligence, pages 12042–12049, 2021.
228
+ [8] Yeong-Dae Kwon, Jinho Choo, Byoungjip Kim, Iljoo Yoon, Youngjune Gwon, and Seungjai Min. POMO: Policy optimization with multiple optima for reinforcement learning. In Advances in Neural Information Processing Systems, volume 33, pages 21188–21198, 2020.
229
+ [9] Liang Xin, Wen Song, Zhiguang Cao, and Jie Zhang. Step-wise deep learning models for solving routing problems. IEEE Transactions on Industrial Informatics, 17(7):4861–4871, 2020.
230
+ [10] Cong Zhang, Wen Song, Zhiguang Cao, Jie Zhang, Puay Siew Tan, and Xu Chi. Learning to dispatch for job shop scheduling via deep reinforcement learning. In Advances in Neural Information Processing Systems, volume 33, pages 1621–1632, 2020.
231
+ [11] Yaoxin Wu, Wen Song, Zhiguang Cao, Jie Zhang, and Andrew Lim. Learning improvement heuristics for solving routing problems. IEEE Transactions on Neural Networks and Learning Systems, 2021.
232
+ [12] Hao Lu, Xingwen Zhang, and Shuang Yang. A learning-based iterative method for solving vehicle routing problems. In International Conference on Learning Representations, 2019.
233
+ [13] André Hottung, Bhanu Bhandari, and Kevin Tierney. Learning a latent search space for routing problems using variational autoencoders. In International Conference on Learning Representations, 2021.
234
+ [14] Jingwen Li, Yining Ma, Ruize Gao, Zhiguang Cao, Andrew Lim, Wen Song, and Jie Zhang. Deep reinforcement learning for solving the heterogeneous capacitated vehicle routing problem. IEEE Transactions on Cybernetics, 2021.
235
+ [15] Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, 2018.
236
+ [16] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, volume 30, pages 6000–6010, 2017.
237
+ [17] Jingwen Li, Liang Xin, Zhiguang Cao, Andrew Lim, Wen Song, and Jie Zhang. Heterogeneous attentions for solving pickup and delivery problem via deep reinforcement learning. IEEE Transactions on Intelligent Transportation Systems, 2021.
238
+ [18] Guolin Ke, Di He, and Tie-Yan Liu. Rethinking the positional encoding in language pre-training. In International Conference on Learning Representations, 2020.
239
+ [19] Peter Shaw, Jakob Uszkoreit, and Ashish Vaswani. Self-attention with relative position representations. In North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 464–468, 2018.
240
+ [20] Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer networks. In Advances in Neural Information Processing Systems, volume 28, pages 2692–2700, 2015.
241
+ [21] Irwan Bello, Hieu Pham, Quoc V Le, Mohammad Norouzi, and Samy Bengio. Neural combinatorial optimization with reinforcement learning. In International Conference on Machine Learning (Workshop), 2017.
242
+ [22] Mohammadreza Nazari, Afshin Oroojlooy, Martin Takác, and Lawrence V Snyder. Reinforcement learning ˇ for solving the vehicle routing problem. In Advances in Neural Information Processing Systems, pages 9861–9871, 2018.
243
+ [23] Paulo R d O Costa, Jason Rhuggenaath, Yingqian Zhang, and Alp Akcay. Learning 2-opt heuristics for the traveling salesman problem via deep reinforcement learning. In Asian Conference on Machine Learning, pages 465–480, 2020.
244
+ [24] Hanjun Dai, Elias B Khalil, Yuyu Zhang, Bistra Dilkina, and Le Song. Learning combinatorial optimization algorithms over graphs. In Advances in Neural Information Processing Systems, pages 6351–6361, 2017.
245
+ [25] Zhang-Hua Fu, Kai-Bin Qiu, and Hongyuan Zha. Generalize a small pre-trained model to arbitrarily large TSP instances. In AAAI Conference on Artificial Intelligence, 2021.
246
+ [26] Wouter Kool, Herke van Hoof, Joaquim Gromicho, and Max Welling. Deep policy dynamic programming for vehicle routing problems. arXiv preprint arXiv:2102.11756, 2021.
247
+ [27] André Hottung and Kevin Tierney. Neural large neighborhood search for the capacitated vehicle routing problem. In European Conference on Artificial Intelligence, 2020.
248
+ [28] Keld Helsgaun. LKH-3 (version 3.0.6), 2019. URL http://webhotel4.ruc.dk/\~keld/research/ LKH-3/.
249
+ [29] Wikipedia. Gray code, 2021. URL: https://en.wikipedia.org/wiki/Gray_code. Last visited on 2020/05/19.
250
+ [30] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In IEEE conference on computer vision and pattern recognition, pages 770–778, 2016.
251
+ [31] Lei Jimmy Ba, Jamie Ryan Kiros, and Geoffrey E. Hinton. Layer normalization. Corr: abs/1607.06450, ArXiV, 2016.
252
+ [32] John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arxiv preprint arxiv:1707.06347, ArXiV, 2017.
253
+ [33] Fabio Pardo, Arash Tavakoli, Vitaly Levdik, and Petar Kormushev. Time limits in reinforcement learning. In International Conference on Machine Learning, pages 4045–4054, 2018.
254
+ [34] Yoshua Bengio, Jérôme Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In International Conference on Machine Learning, pages 41–48, 2009.
255
+ [35] David L Applegate, Robert E Bixby, Vašek Chvátal, and William J Cook. Concorde TSP Solver, 2020. URL http://www.math.uwaterloo.ca/tsp/concorde/.
256
+ [36] Keld Helsgaun. LKH (version 2.0.9), 2018. URL http://webhotel4.ruc.dk/\~keld/research/ LKH/.
257
+ [37] Laurent Perron and Vincent Furnon. OR-Tools (version 7.2), 2019. URL https://developers.google. com/optimization/.
258
+ [38] Gerhard Reinelt. TSPLIB-A traveling salesman problem library. ORSA journal on computing, 3(4): 376–384, 1991.
259
+ [39] Eduardo Uchoa, Diego Pecin, Artur Pessoa, Marcus Poggi, Thibaut Vidal, and Anand Subramanian. New benchmark instances for the capacitated vehicle routing problem. European Journal of Operational Research, 257(3):845–858, 2017.
260
+ [40] Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
261
+ [41] Chun-Ying Yu, Tung-Cheng Li, Yi-Ying Wu, Chan-Hsien Yeh, Wei Chiang, Ching-Yu Chuang, and Hung-Chih Kuo. The circular rna circbirc6 participates in the molecular circuitry controlling human pluripotency. Nature communications, 8(1):1–15, 2017.
262
+ [42] Chengyu Liu, Yu-Chen Liu, Hsien-Da Huang, and Wei Wang. Biogenesis mechanisms of circular rna can be categorized through feature extraction of a machine learning model. Bioinformatics, 35(23):4867–4870, 2019.
263
+ [43] Logan Engstrom, Andrew Ilyas, Shibani Santurkar, Dimitris Tsipras, Firdaus Janoos, Larry Rudolph, and Aleksander Madry. Implementation matters in deep policy gradients: A case study on PPO and TRPO. In International Conference on Learning Representations, 2020.
md/train/9xC2tWEwBD/9xC2tWEwBD.md ADDED
@@ -0,0 +1,327 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # A PANDA? NO, IT’S A SLOTH: SLOWDOWN ATTACKS ON ADAPTIVE MULTI-EXIT NEURAL NETWORK INFERENCE
2
+
3
+ Sanghyun Hong∗, Yigitcan Kaya ˇ ∗, Ionut,-Vlad Modoranu†, Tudor Dumitras,
4
+
5
+ University of Maryland, College Park, USA †Alexandru Ioan Cuza University, Ias,i, Romania
6
+
7
+ shhong@cs.umd.edu, yigitcan@cs.umd.edu, modoranu.ionut.vlad@hotmail.com, tudor@umd.edu
8
+
9
+ # ABSTRACT
10
+
11
+ Recent increases in the computational demands of deep neural networks (DNNs), combined with the observation that most input samples require only simple models, have sparked interest in input-adaptive multi-exit architectures, such as MSDNets or Shallow-Deep Networks. These architectures enable faster inferences and could bring DNNs to low-power devices, e.g., in the Internet of Things (IoT). However, it is unknown if the computational savings provided by this approach are robust against adversarial pressure. In particular, an adversary may aim to slowdown adaptive DNNs by increasing their average inference time—a threat analogous to the denial-of-service attacks from the Internet. In this paper, we conduct a systematic evaluation of this threat by experimenting with three generic multi-exit DNNs (based on VGG16, MobileNet, and ResNet56) and a custom multi-exit architecture, on two popular image classification benchmarks (CIFAR-10 and Tiny ImageNet). To this end, we show that adversarial example-crafting techniques can be modified to cause slowdown, and we propose a metric for comparing their impact on different architectures. We show that a slowdown attack reduces the efficacy of multi-exit DNNs by $9 0 { - } 1 0 0 \%$ , and it amplifies the latency by $1 . 5 – 5 \times$ in a typical IoT deployment. We also show that it is possible to craft universal, reusable perturbations and that the attack can be effective in realistic black-box scenarios, where the attacker has limited knowledge about the victim. Finally, we show that adversarial training provides limited protection against slowdowns. These results suggest that further research is needed for defending multi-exit architectures against this emerging threat. Our code is available at https://github.com/sanghyun-hong/deepsloth.
12
+
13
+ # 1 INTRODUCTION
14
+
15
+ The inference-time computational demands of deep neural networks (DNNs) are increasing, owing to the “going deeper" (Szegedy et al., 2015) strategy for improving accuracy: as a DNN gets deeper, it progressively gains the ability to learn higher-level, complex representations. This strategy has enabled breakthroughs in many tasks, such as image classification (Krizhevsky et al., 2012) or speech recognition (Hinton et al., 2012), at the price of costly inferences. For instance, with $4 \times$ more inference cost, a 56-layer ResNet (He et al., 2016) improved the Top-1 accuracy on ImageNet by $19 \%$ over the 8-layer AlexNet. This trend continued with the 57-layer state-of-the-art EfficientNet (Tan & Le, 2019): it improved the accuracy by $10 \%$ over ResNet, with $9 \times$ costlier inferences.
16
+
17
+ The accuracy improvements stem from the fact that the deeper networks fix the mistakes of the shallow ones (Huang et al., 2018). This implies that some samples, which are already correctly classified by shallow networks, do not necessitate the extra complexity. This observation has motivated research on input-adaptive mechanisms, in particular, multi-exit architectures (Teerapittayanon et al., 2016; Huang et al., 2018; Kaya et al., 2019; Hu et al., 2020). Multi-exit architectures save computation by making input-specific decisions about bypassing the remaining layers, once the model becomes confident, and are orthogonal to techniques that achieve savings by permanently modifying the model (Li et al., 2016; Banner et al., 2018; Han et al., 2015; Taylor et al., 2018). Figure 1 illustrates how a multi-exit model (Kaya et al., 2019), based on a standard VGG-16 architecture, correctly classifies a selection of test images from ‘Tiny ImageNet’ before the final layer. We see that more typical samples, which have more supporting examples in the training set, require less depth and, therefore, less computation.
18
+
19
+ It is unknown if the computational savings provided by multi-exit architectures are robust against adversarial pressure. Prior research showed that DNNs are vulnerable to a wide range of attacks, which involve imperceptible input perturbations (Szegedy et al., 2014; Goodfellow et al., 2015; Papernot et al., 2016; Hu et al., 2020). Considering that a multi-exit model, on the worst-case input, does not provide any computational savings, we ask: Can the savings from multi-exit models be maliciously negated by input perturbations? As some natural inputs do require the full depth of the model, it may be possible to craft adversarial examples that delay the correct decision; it is unclear, however, how many inputs can be delayed with imperceptible perturbations. Furthermore, it is unknown if universal versions of these adversarial examples exist, if the examples transfer across multi-exit architectures and datasets, or if existing defenses (e.g. adversarial training) are effective against slowdown attacks.
20
+
21
+ ![](images/746d8efde4dde3f7f81419a6f62cb228c7561c4c925bbdc393202621421b32de.jpg)
22
+ Figure 1: Simple to complex inputs. Some Tiny ImageNet images a VGG-16 model can correctly classify if computation stops at the $1 ^ { s t }$ , $5 ^ { t h }$ , and $1 4 ^ { t h }$ layers.
23
+
24
+ Threat Model. We consider a new threat against DNNs, analogous to the denial-of-service $( D o S )$ attacks that have been plaguing the Internet for decades. By imperceptibly perturbing the input to trigger this worst-case, the adversary aims to slow down the inferences and increase the cost of using the DNN. This is an important threat for many practical applications, which impose strict limits on the responsiveness and resource usage of DNN models (e.g. in the Internet-of-Things (Taylor et al., 2018)), because the adversary could push the victim outside these limits. For example, against a commercial image classification system, such as Clarifai.com, a slowdown attack might waste valuable computational resources. Against a model partitioning scheme, such as Big-Little (De Coninck et al., 2015), it might introduce network latency by forcing excessive transmissions between local and remote models. A slowdown attack aims to force the victim to do more work than the adversary, e.g. by amplifying the latency needed to process the sample or by crafting reusable perturbations. The adversary may have to achieve this with incomplete information about the multi-exit architecture targeted, the training data used by the victim or the classification task (see discussion in Appendix A).
25
+
26
+ Our Contributions. To our best knowledge, we conduct the first study of the robustness of multi-exit architectures against adversarial slowdowns. To this end, we find that examples crafted by prior evasion attacks (Madry et al., 2017; Hu et al., 2020) fail to bypass the victim model’s early exits, and we show that an adversary can adapt such attacks to the goal of model slowdown by modifying its objective function. We call the resulting attack DeepSloth. We also propose an efficacy metric for comparing slowdowns across different multi-exit architectures. We experiment with three generic multi-exit DNNs (based on VGG16, ResNet56 and MobileNet) (Kaya et al., 2019) and a speciallydesigned multi-exit architecture, MSDNets (Huang et al., 2018), on two popular image classification benchmarks (CIFAR-10 and Tiny ImageNet). We find that DeepSloth reduces the efficacy of multiexit DNNs by $9 0 { - } 1 0 0 \%$ , i.e., the perturbations render nearly all early exits ineffective. In a scenario typical for IoT deployments, where the model is partitioned between edge devices and the cloud, our attack amplifies the latency by $1 . 5 – 5 \times$ , negating the benefits of model partitioning. We also show that it is possible to craft a universal DeepSloth perturbation, which can slow down the model on either all or a class of inputs. While more constrained, this attack still reduces the efficacy by $5- 4 5 \%$ . Further, we observe that DeepSloth can be effective in some black-box scenarios, where the attacker has limited knowledge about the victim. Finally, we show that a standard defense against adversarial samples—adversarial training—is inadequate against slowdowns. Our results suggest that further research will be required for protecting multi-exit architectures against this emerging security threat.
27
+
28
+ # 2 RELATED WORK
29
+
30
+ Adversarial Examples and Defenses. Prior work on adversarial examples has shown that DNNs are vulnerable to test-time input perturbations (Szegedy et al., 2014; Goodfellow et al., 2015; Papernot et al., 2017; Carlini & Wagner, 2017; Madry et al., 2018). An adversary who wants to maximize a model’s error on specific test-time samples can introduce human-imperceptible perturbations to these samples. Moreover, an adversary can also exploit a surrogate model for launching the attack and still hurt an unknown victim (Athalye et al., 2018; Tramèr et al., 2017b; Inkawhich et al., 2019). This transferability leads to adversarial examples in more practical black-box scenarios. Although many defenses (Kurakin et al., 2016; Xu et al., 2017; Song et al., 2018; Liao et al., 2018; Lecuyer et al., 2019) have been proposed against this threat, adversarial training (AT) has become the frontrunner (Madry et al., 2018). In Sec 5, we evaluate the vulnerability of multi-exit DNNs to adversarial slowdowns in white-box and black-box scenarios. In Sec 6, we show that standard AT and its simple adaptation to our perturbations are not sufficient for preventing slowdown attacks.
31
+
32
+ Efficient Input-Adaptive Inference. Recent input-adaptive DNN architectures have brought two seemingly distant goals closer: achieving both high predictive quality and computational efficiency. There are two types of input-adaptive DNNs: adaptive neural networks (AdNNs) and multi-exit architectures. During the inference, AdNNs (Wang et al., 2018; Figurnov et al., 2017) dynamically skip a certain part of the model to reduce the number of computations. This mechanism can be used only for ResNet-based architectures as they facilitate skipping within a network. On the other hand, multi-exit architectures (Teerapittayanon et al., 2016; Huang et al., 2018; Kaya et al., 2019) introduce multiple side branches—or early-exits—to a model. During the inference on an input sample, these models can preemptively stop the computation altogether once the stopping criteria are met at one of the branches. Kaya et al. (2019) have also identified that standard, non-adaptive DNNs are susceptible to overthinking, i.e., their inability to stop computation leads to inefficient inferences on many inputs.
33
+
34
+ Haque et al. (2020) presented attacks specifically designed for reducing the energy-efficiency of AdNNs by using adversarial input perturbations. However, our work studies a new threat model that an adversary causes slowdowns on multi-exit architectures. By imperceptibly perturbing the inputs, our attacker can (i) introduce network latency to an infrastructure that utilizes multi-exit architectures and (ii) waste the victim’s computational resources. To quantify this vulnerability, we define a new metric to measure the impact of adversarial input perturbation on different multi-exit architectures (Sec 3). In Sec 5, we also study practical attack scenarios and the transferability of adversarial input perturbations crafted by our attacker. Moreover, we discuss the potential defense mechanisms against this vulnerability, by proposing a simple adaptation of adversarial training (Sec 6). To the best of our knowledge, our work is the first systematic study of this new vulnerability.
35
+
36
+ Model Partitioning. Model partitioning has been proposed to bring DNNs to resource-constrained devices (De Coninck et al., 2015; Taylor et al., 2018). These schemes split a multi-exit model into sequential components and deploy them in separate endpoints, e.g., a small, local on-device part and a large, cloud-based part. For bringing DNNs to the Internet of Things (IoT), partitioning is instrumental as it reduces the transmissions between endpoints, a major bottleneck. In Sec 5.1, on a partitioning scenario, we show that our attack can force excessive transmissions.
37
+
38
+ # 3 EXPERIMENTAL SETUP
39
+
40
+ Datasets. We use two datasets: CIFAR-10 (Krizhevsky et al., 2009) and Tiny-ImageNet (Tiny). For testing the cross-domain transferability of our attacks, we use the CIFAR-100 dataset.
41
+
42
+ Architectures and Hyper-parameters. To demonstrate that the vulnerability to adversarial slowdowns is common among multi-exit architectures, we experiment on two recent techniques: ShallowDeep Networks (SDNs) (Kaya et al., 2019) and MSDNets (Huang et al., 2018). These architectures were designed for different purposes: SDNs are generic and can convert any DNN into a multi-exit model, and MSDNets are custom designed for efficiency. We evaluate an MSDNet architecture (6 exits) and three SDN architectures, based on VGG-16 (Simonyan & Zisserman, 2014) (14 exits), ResNet-56 (He et al., 2016) (27 exits), and MobileNet (Howard et al., 2017) (14 exits).
43
+
44
+ Metrics. We define the early-exit capability (EEC) curve of a multi-exit model to indicate the fraction of the test samples that exit early at a specific fraction of the model’s full inference cost.
45
+
46
+ Figure 2 shows the EEC curves of our SDNs on Tiny ImageNet, assuming that the computation stops when there is a correct classification at an exit point. For example, VGG-16-based SDN model can correctly classify ${ \sim } 5 0 \%$ of the samples using ${ \sim } 5 0 \%$ of its full cost. Note that this stopping criterion is impractical; in Sec 4, we will discuss the practical ones.
47
+
48
+ We define the early-exit efficacy, or efficacy in short, to quantify a model’s ability of utilizing its exit points. The efficacy of a multi-exit model is the area under its EEC curve, estimated via the trapezoidal rule. An ideal efficacy for a model is close to 1, when most of the input samples the computation stops very early; models that do not use their early exits have 0 efficacy. A model with low efficacy generally exhibits a higher latency; in a partitioned model, the low efficacy will cause more input transmissions to the cloud, and the latency is further amplified by the network round trips. A multi-exit model’s efficacy and accuracy are dictated by its stopping criteria, which we discuss in the next section. As for the classification performance, we report the Top-1 accuracy on the test data.
49
+
50
+ ![](images/2bf06ae00279a3cedeb142c999740cbd1b60e5613928b8a30f86d951383600a5.jpg)
51
+ tinyimagenet-vgg16bn(ACC 59.0) resnet56(ACC 53.5) mobilenet(ACC 59.5)
52
+ Figure 2: The EEC curves. Each curve shows the fraction of test samples a model classifies using a certain fraction of its full inference cost. ‘EFCY’ is short for the model’s efficacy.
53
+
54
+ # 4 ATTACKING THE MULTI-EXIT ARCHITECTURES
55
+
56
+ Setting. We consider the supervised classification setting with standard feedforward DNN architectures. A DNN model consists of $N$ blocks, or layers, that process the input sample, $x \in \mathbb { R } ^ { d }$ , from beginning to end and produce a classification. A classification, $F ( x , \theta ) \in \mathbf { \mathbb { R } } ^ { m }$ , is the predicted probability distribution of $x$ belonging to each label $y \in M = \{ 1 , . . . , m \}$ . Here, $\theta$ denotes the tunable parameters, or the weights, of the model. The parameters are learned on a training set $\mathcal { D }$ that contains multiple $( x _ { i } , y _ { i } )$ pairs; where $y _ { i }$ is the ground-truth label of the training sample $x _ { i }$ . We use $\theta _ { i }$ to denote the parameters at and before the $i ^ { t h }$ block; i.e., $\theta _ { i } \subset \theta _ { i + 1 }$ and $\theta _ { N } = \theta$ . Once a model is trained, its performance is then tested on a set of unseen samples, $s$ .
57
+
58
+ Multi-Exit Architectures. A multi-exit model contains $K$ exit points—internal classifiers—attached to a model’s hidden blocks. We use $F _ { i }$ to denote the $i ^ { t h }$ exit point, which is attached to the $j ^ { t h }$ block. Using the output of the $j ^ { t h } \left( j < N \right)$ block on $x$ , $F _ { i }$ produces an internal classification, i.e., $F _ { i } ( x , \theta _ { j } )$ , which we simply denote as $F _ { i } ( x )$ . In our experiments, we set $K = N$ for SDNs, i.e., one internal classifier at each block and $K = 6$ for MSDNets. Given $F _ { i } ( x )$ , a multi-exit model uses deterministic criteria to decide between forwarding $x$ to compute $F _ { i + 1 } ( x )$ and stopping for taking the early-exit at this block. Bypassing early-exits decreases a network’s efficacy as each additional block increases the inference cost. Note that multi-exit models process each sample individually, not in batches.
59
+
60
+ Practical Stopping Criteria. Ideally, a multi-exit model stops when it reaches a correct classification at an exit point, i.e., $\begin{array} { r } { \operatorname * { a r g m a x } _ { j \in M } F _ { i } ^ { ( \bar { j } ) } ( x ) = \hat { y } _ { i } = y ; y } \end{array}$ is the ground-truth label. However, for unseen samples, this is impractical as $y$ is unknown. The prior work has proposed two simple strategies to judge whether ${ \hat { y } } _ { i } = y$ : $F _ { i } ( x )$ ’s entropy (Teerapittayanon et al., 2016; Huang et al., 2018) or its confidence (Kaya et al., 2019). Our attack (see Sec 4.3) leverages the fact that a uniform $F _ { i } ( x )$ has both the highest entropy and the lowest confidence. For generality, we experiment with both confidence-based—SDNs—and entropy-based—MSDNets—strategies.
61
+
62
+ A strategy selects confidence, or entropy, thresholds, $T _ { i }$ , that determine whether the model should take the $\overline { { i } } ^ { t h }$ exit for an input sample. Conservative $T _ { i }$ ’s lead to fewer early exits and the opposite hurts the accuracy as the estimate of whether ${ \hat { y } } _ { i } = y$ becomes unreliable. As utility is a major practical concern, we set $T _ { i }$ ’s for balancing between efficiency and accuracy. On a holdout set, we set the thresholds to maximize a model’s efficacy while keeping its relative accuracy drop (RAD) over its maximum accuracy within $5 \%$ and $15 \%$ . We refer to these two settings as RAD $123 \%$ and RAD ${ < } 1 5 \%$ Table 2 (first segment) shows how accuracy and efficacy change in each setting.
63
+
64
+ # 4.1 THREAT MODEL
65
+
66
+ We consider an adversary who aims to decrease the early-exit efficacy of a victim model. The attacker crafts an imperceptible adversarial perturbation, $v \in \mathbb { R } ^ { d }$ that, when added to a test-time sample $x \in S$ , prevents the model from taking early-exits.
67
+
68
+ Adversary’s Capabilities. The attacker is able to modify the victim’s test-time samples to apply the perturbations, e.g., by compromising a camera that collects the data for inference. To ensure the imperceptibility, we focus on $\ell _ { \infty }$ norm bounded perturbations as they (i) are well are studied; (ii) have successful defenses (Madry et al., 2018); (iii) have prior extension to multi-exit models (Hu et al., 2020); and (iv) are usually the most efficient to craft. We show results on $\ell _ { 2 }$ and $\ell _ { 1 }$ perturbations in Appendix C. In line with the prior work, we bound the perturbations as follows: for CIFAR-10, $\lvert | v \rvert | _ { \infty } \leq \epsilon = 0 . 0 3$ (Madry et al., 2017), $| | v | | _ { 1 } \leq 8$ (Tramèr & Boneh, 2019) and $| | v | | _ { 2 } \leq 0 . 3 5$ (Chen et al., 2017); for Tiny ImageNet, $| | v | | _ { \infty } \leq \epsilon = 0 . 0 3$ (Yang et al., 2019), $| | \boldsymbol { v } | | _ { 1 } \le \mathrm { \dot { 1 6 } }$ and $| | v | | _ { 2 } \leq 0 . 6$
69
+
70
+ Adversary’s Knowledge. To assess the security vulnerability of multi-exit architectures, we study white-box scenarios, i.e., the attacker knows all the details of the victim model, including its $\mathcal { D }$ and $\theta$ . Further, in Sec 5.2, we study more practical black-box scenarios, i.e., the attacker crafts $v$ on a surrogate model and applies it to an unknown victim model.
71
+
72
+ Adversary’s Goals. We consider three DeepSloth variants, (i) the standard, (ii) the universal and (iii) the class-universal. The adversary, in (i) crafts a different $v$ for each $x \in S$ ; in (ii) crafts a single $v$ for all $x \in S$ ; in (iii) crafts a single $v$ for a target class $i \in M$ . Further, although the adversary does not explicitly target it; we observe that DeepSloth usually hurts the accuracy. By modifying the objective function we describe in Sec 4.3, we also experiment with DeepSloth variants that can explicitly preserve or hurt the accuracy, in addition to causing slowdowns.
73
+
74
+ # 4.2 STANDARD ADVERSARIAL ATTACKS DO NOT CAUSE DELAYS
75
+
76
+ To motivate DeepSloth, we first evaluate whether previous adversarial attacks have any effect on the efficacy of multi-exit models. These attacks add imperceptible perturbations to a victim’s test-time samples to force misclassifications. We experiment with the standard PGD attack (Madry et al., 2017); PGD-avg and PGD-max variants against multi-exit models (Hu et al., 2020) and the Universal Adversarial Perturbation (UAP) attack that crafts a single perturbation for all test samples (MoosaviDezfooli et al., 2017). Table 1 summarizes our findings that these attacks, although they hurt the accuracy, fail to cause any meaningful decrease in efficacy. In many cases, we observe that the attacks actually increase the efficacy. These experiments help us to identify the critical elements of the objective function of an attack that decreases the efficacy.
77
+
78
+ Table 1: Impact of existing evasion attacks on efficacy. Each entry shows a model’s efficacy (left) and accuracy (right) when subjected to the respective attack. The multi-exit models are trained on CIFAR-10 and use RAD ${ < } 5 \%$ as their early-exit strategy.
79
+
80
+ <table><tr><td>NETWORK</td><td>NO ATTACK</td><td>PGD-20</td><td>PGD-20 (AVG.)</td><td>PGD-20 (MAX.)</td><td>UAP</td></tr><tr><td>VGG-16</td><td>0.77 /89%</td><td>0.79 / 29%</td><td>0.85 /10%</td><td>0.81/27%</td><td>0.71/68%</td></tr><tr><td>REsNET-56</td><td>0.52 / 87%</td><td>0.55 / 12%</td><td>0.82/1%</td><td>0.70/ 6%</td><td>0.55 / 44%</td></tr><tr><td>MOBILENET</td><td>0.83/87%</td><td>0.85 /14%</td><td>0.93/ 3%</td><td>0.89 / 12%</td><td>0.77 / 60%</td></tr></table>
81
+
82
+ # 4.3 THE DEEPSLOTH ATTACK
83
+
84
+ The Layer-Wise Objective Function. Figure 3 shows that the attacks that only optimize for the final output, e.g., PGD or UAP, do not perturb the model’s earlier layer representations. This does not bypass the early-exits, which makes these attacks ineffective for decreasing the efficacy. Therefore, we modify the objective functions of adversarial example-crafting algorithms to incorporate the outputs of all $F _ { i } | i < K$ . For crafting $\ell _ { \infty }$ , $\ell _ { 2 }$ and $\ell _ { 1 }$ -bounded perturbations, we adapt the PGD (Madry et al., 2017), the DDN (Rony et al., 2019) and the SLIDE algorithms (Tramèr & Boneh, 2019), respectively. Next, we describe how we modify the PGD algorithm—we modify the others similarly:
85
+
86
+ $$
87
+ v ^ { t + 1 } = \prod _ { | | v | | _ { \infty } < \epsilon } \left( v ^ { t } + \alpha \operatorname { s g n } \left( { \nabla } _ { v } \sum _ { x \in D ^ { \prime } } \sum _ { 0 < i < K } { \mathcal { L } } \left( F _ { i } \left( x + v \right) , \bar { y } \right) \right) \right)
88
+ $$
89
+
90
+ Here, $t$ is the current attack iteration; $\alpha$ is the step size; $\Pi$ is the projection operator that enforces $| | v | | _ { \infty } < \epsilon$ and $\mathcal { L }$ is the cross-entropy loss function. The selection of $\mathcal { D } ^ { \prime }$ determines the type of the attack. For the standard variant: ${ \mathcal { D } } ^ { \prime } = \{ x \}$ , i.e., a single test-time sample. For the universal variant: $\mathcal { D } ^ { \prime } = \mathcal { D }$ , i.e., the whole training set. For the class-universal variant against the target class $i \in M$ : $\mathcal { D } ^ { \prime } = \{ ( x , y ) \in \mathcal { D } | y = i \}$ , i.e., the training set samples from the $i ^ { t h }$ class. Finally, $\bar { y }$ is the target label distribution our objective pushes $F _ { i } ( x )$ towards. Next, we explain how we select $\bar { y }$ .
91
+
92
+ Pushing $F _ { i } ( x )$ Towards a Uniform Distribution. Despite including all $F _ { i }$ , attacks such as PGDavg and PGD-max $\mathrm { H u }$ et al., 2020) still fail to decrease efficacy. How these attacks select $\bar { y }$ reflects their goal of causing misclassifications and, therefore, they trigger errors in early-exits, i.e., $\mathrm { a r g m a x } _ { j \in M } \bar { F } _ { i } ^ { ( j ) } ( x ) = \bar { y } \bar { \ne y }$ . However, as the early-exits still have high confidence, or low entropy, the model still stops its computation early. We select $\bar { y }$ as a uniform distribution over the class labels, i.e., $\bar { y } ^ { ( i ) } = 1 / m$ . This ensures that $( x + v )$ bypasses common stopping criteria as a uniform $F _ { i } ( x )$ has both the lowest confidence and the highest entropy.
93
+
94
+ # 5 EMPIRICAL EVALUATION
95
+
96
+ Here, we present the results for $\ell _ { \infty }$ DeepSloth against two SDNs—VGG-16 and MobileNet-based— and against the MSDNets. In the Appendix, we report the hyperparameters; the $\ell _ { 1 }$ and $\ell _ { 2 }$ attacks; the results on ResNet-56-based SDNs; the cost of the attacks; and some perturbed samples. Overall, we observe that $\ell _ { \infty }$ -bounded perturbations are more effective for slowdowns. The optimization challenges might explain this, as $\ell _ { 1 }$ and $\ell _ { 2 }$ attacks are usually harder to optimize (Carlini & Wagner, 2017; Tramèr & Boneh, 2019). Unlike objectives for misclassifications, the objective for slowdowns involves multiple loss terms and optimizes over all the output logits.
97
+
98
+ # 5.1 WHITE-BOX SCENARIOS
99
+
100
+ Perturbations Eliminate Early-Exits. Table 2 (second segment) shows that the victim models have $\sim 0$ efficacy on the samples perturbed by DeepSloth. Across the board, the attack makes the early-exit completely ineffective and force the victim models to forward all input samples till the end. Further, DeepSloth also drops the victim’s accuracy by $7 5 - 9 9 \%$ , comparable to the PGD attack. These results give an answer to our main research question: the multi-exit mechanisms are vulnerable and their benefits can be maliciously offset by adversarial input perturbations. In particular, as SDN modification mitigates overthinking in standard, non-adaptive DNNs (Kaya et al., 2019), DeepSloth also leads SDN-based models to overthink on almost all samples by forcing extra computations.
101
+
102
+ Note that crafting a single perturbation requires multiple back-propagations through the model and more floating points operations $( F L O P s )$ than the forward pass. The high cost of crafting, relative to the computational damage to the victim, might make this vulnerability unattractive for the adversary. In the next sections, we highlight scenarios where this vulnerability might lead to practical exploitation. First, we show that in an IoT-like scenarios, the input transmission is a major bottleneck and DeepSloth can exploit it. Second, we evaluate universal DeepSloth attacks that enable the adversary to craft the perturbation only once and reuse it on multiple inputs.
103
+
104
+ Attacking an IoT Scenario. Many IoT scenarios, e.g., health monitoring for elderly (Park et al., 2017), require collecting data from edge devices and making low-latency inferences on this data. However, complex deep learning models are impractical for low-power edge devices, such as an Arduino, that are common in the IoT scenarios (Chen & Ran, 2019). For example, on standard hardware, an average inference takes MSDNet model on Tiny ImageNet 35M FLOPs and ${ \sim } 1 0 \mathrm { m s }$ .
105
+
106
+ A potential solution is sending the inputs from the edge to a cloud model, which then returns the prediction. Even in our optimistic estimate with a nearby AWS EC2 instance, this back-and-forth introduces ${ \sim } 1 1 \mathrm { m s }$ latency per inference. Model partitioning alleviates this bottleneck by splitting a multi-exit model into two; deploying the small first part at the edge and the large second part at the cloud (De Coninck et al., 2015). The edge part sends an input only when its prediction does not meet the stopping criteria. For example, the first early-exit of MSDNets sends only $5 \%$ and $67 \%$ of all test samples, on CIFAR-10 and Tiny ImageNet, respectively. This leads to a lower average latency per inference, i.e., from 11ms down to $0 . 5 \mathrm { m s }$ and $7 . 4 \mathrm { m s }$ , respectively.
107
+
108
+ Table 2: The effectiveness of $\ell _ { \infty }$ DeepSloth. ‘ $\mathrm { 2 A D { < } } 5 , 1 5 \%$ ’ columns list the results in each early-exit setting. Each entry includes the model’s efficacy (left) and accuracy (right). The class-universal attack’s results are an average of 10 classes. ‘TI’: Tiny ImageNet and $\mathbf { \dot { C } } 1 0 ^ { \circ }$ : CIFAR-10.
109
+
110
+ <table><tr><td>NETWORK</td><td colspan="2">MSDNET</td><td colspan="2">VGG16</td><td colspan="2">MOBILENET</td></tr><tr><td>SET.</td><td>RAD&lt;5%</td><td>RAD&lt;15%</td><td>RAD&lt;5%</td><td>RAD&lt;15%</td><td>RAD&lt;5%</td><td>RAD&lt;15%</td></tr><tr><td colspan="7">BASELINE (NO ATTACK)</td></tr><tr><td>C10</td><td>0.89 / 85%</td><td>0.89 / 85%</td><td>0.77 /88%</td><td>0.89 / 79%</td><td>0.83 /87%</td><td>0.92 /79%</td></tr><tr><td>TI</td><td>0.64 / 55%</td><td>0.83 /50%</td><td>0.39 /57%</td><td>0.51 / 52%</td><td>0.42 /57%</td><td>0.59 /51%</td></tr><tr><td colspan="7">DEEPSLOTH</td></tr><tr><td>C10</td><td>0.06 / 17%</td><td>0.06 / 17%</td><td>0.01 /13%</td><td>0.04 / 16%</td><td>0.01 /12%</td><td>0.06 /16%</td></tr><tr><td>TI</td><td>0.06 /7%</td><td>0.06 /7%</td><td>0.00 /2%</td><td>0.01/2%</td><td>0.02 / 6%</td><td>0.04 / 6%</td></tr><tr><td colspan="7">UNIVERSAL DEEPSLOTH</td></tr><tr><td>C10</td><td>0.85 / 65%</td><td>0.85 /65%</td><td>0.62 / 65%</td><td>0.86 / 60%</td><td>0.73 / 61%</td><td>0.90 / 59%</td></tr><tr><td>TI</td><td>0.58 / 46%</td><td>0.81 /41%</td><td>0.31 / 47%</td><td>0.44 / 44%</td><td>0.33 / 47%</td><td>0.51 / 43%</td></tr><tr><td colspan="7">CLASS-UNIVERSAL DEEPSLOTH</td></tr><tr><td>C10</td><td>0.82/32%</td><td>0.82 /32%</td><td>0.47 /35%</td><td>0.78 /33%</td><td>0.60 /30%</td><td>0.85 /27%</td></tr><tr><td>TI</td><td>0.41 / 21%</td><td>0.71 /17%</td><td>0.20 /28%</td><td>0.33 /27%</td><td>0.21 /27%</td><td>0.38 /25%</td></tr></table>
111
+
112
+ The adversary we study uses DeepSloth perturbations to force the edge part to send all the input samples to the cloud. For the victim, we deploy MSDNet models that we split into two parts at their first exit point. Targeting the first part with DeepSloth forces it to send $96 \%$ and $9 9 . 9 7 \%$ of all test samples to the second part. This increases average inference latency to ${ \sim } 1 1 \mathrm { m s }$ and invalidates the benefits of model partitioning. In this scenario, perturbing each sample takes ${ \sim } 2 \mathrm { m s }$ on a Tesla V-100 GPU, i.e., the time adversary spends is amplified by $1 . 5 – 5 \times$ as the victim’s latency increase.
113
+
114
+ Reusable Universal Perturbations. The universal attacks, although limited, are a practical as the adversary can reuse the same perturbation indefinitely to cause minor slowdowns. Table 2 (third segment) shows that they decrease the efficacy by $3- 2 1 \%$ and the accuracy by $1 5 \mathrm { - } 2 5 \%$ , over the baselines. Having a less conservative early-exit strategy, e.g., RAD ${ < } 1 5 \%$ , increases the resilience to the attack at the cost of accuracy. Further, MSDNets are fairly resilient with only $3- 9 \%$ efficacy drop; whereas SDNs are more vulnerable with $12 \mathrm { - } 2 1 \%$ drop. The attack is also slightly more effective on the more complex task, Tiny ImageNet, as the early-exits become easier to bypass. Using random noise as a baseline, i.e., $v \sim U ^ { d } ( - \epsilon , \epsilon )$ , we find that at most it decreases the efficacy by ${ \sim } 3 \%$ .
115
+
116
+ In the universal attack, we observe a phenomenon: it pushes the samples towards a small subset of all classes. For example, ${ \sim } 1 7 \%$ of the perturbed samples are classified into the ’bird’ class of CIFAR-10; up from ${ \sim } 1 0 \%$ for the clean samples. Considering certain classes are distant in the feature space, e.g., ’truck’ and ’bird’; we expect the class-universal variant to be more effective. The results in Table 2 (fourth segment) confirm our intuition. We see that this attack decreases the baseline efficacy by $8 - 5 0 \%$ and the accuracy by $5 0 \mathrm { - } 6 5 \%$ . We report the average results across multiple classes; however, we observe that certain classes are slightly more vulnerable to this attack.
117
+
118
+ Feature Visualization of DeepSloth. In Figure 3, to shed light on how DeepSloth differs from prior attacks, e.g., PGD and PGD-avg, we visualize a model’s hidden block (layer) features on the original and perturbed test-time samples. We observe that in an earlier block (left panel), DeepSloth seems to disrupt the original features slightly more than the PGD attacks. Leaving earlier representations intact prevents PGDs from bypassing the early-exits. The behaviors of the attacks diverge in the middle blocks (middle panel). Here, DeepSloth features remain closer to the original features than prior attacks. The significant disruption of prior attacks leads to high-confidence misclassifications and fails to bypass early-exits. In the later block (right panel), we see that the divergent behavior persists.
119
+
120
+ Preserving or Hurting the Accuracy with DeepSloth. Here, we aim to answer whether DeepSloth can be applied when the adversary explicitly aims to cause or prevent misclassifications, while still causing slowdowns. Our main threat model has no explicit goal regarding misclassifications that hurt the user of the model, i.e., who consumes the output of the model. Whereas, slowdowns additionally hurt the executor or the owner of the model through the computations and latency increased at the cloud providers. In some ML-in-the-cloud scenarios, where these two are different actors, the adversary might aim to target only the executor or both the executor and the user. To this end, we modify our objective function to push $F _ { i } ( x )$ towards a slightly non-uniform distribution, favoring either the ground truth label for preventing misclassifications or a wrong label for causing them. We test this idea on our VGG-16-based SDN model on CIFAR-10 in RAD ${ < } 5 \%$ setting. We see that DeepSloth for preserving the accuracy leads to $81 \%$ accuracy with 0.02 efficacy and DeepSloth for hurting the accuracy leads to $4 \%$ accuracy with 0.01 efficacy—the original DeepSloth led to $13 \%$ accuracy with 0.01 efficacy. These results show the flexibility of DeepSloth and how it could be modified depending on the attacker’s goals.
121
+
122
+ ![](images/eb4db376fcea7527d2b8a56c5918847e8a4e1a6ae201be0033e35f93b1112bd1.jpg)
123
+ Figure 3: Visualising features against attacks using UMAP. VGG-16’s 3rd (left), 8th (middle), and 14th (right) hidden block features on CIFAR-10’s ’dog’ class (Best viewed in color, zoomed in).
124
+
125
+ 5.2 TOWARDS A BLACK-BOX ATTACK: TRANSFERABILITY OF DEEPSLOTH
126
+
127
+ Transferability of adversarial examples imply that they can still hurt a model that they were not crafted on (Tramèr et al., 2017a; Liu et al., 2017). Even though white-box attacks are important to expose the vulnerability, black-box attacks, by requiring fewer assumptions, are more practical. Here, on four distinct scenarios, we investigate whether DeepSloth is transferable. Based on the scenario’s constraints, we (i) train a surrogate model; (ii) craft the DeepSloth samples on it; and (iii) use these samples on the victim. We run these experiments on CIFAR-10 in the RAD ${ < } 5 \%$ .
128
+
129
+ Cross-Architecture. First, we relax the assumption that the attacker knows the victim architecture. We evaluate the transferability between a VGG-16-based SDN an an MSDNet—all trained using the same $\mathcal { D }$ . We find that the samples crafted on the MSDNet can slowdown the SDN: reducing its efficacy to 0.63 (from 0.77) and accuracy to $78 \%$ (from $8 8 \%$ ). Interestingly, the opposite seems not to be the case: on the samples crafted against the SDN, the MSDNet still has 0.87 efficacy (from 0.89) and $73 \%$ accuracy (from $8 5 \%$ ). This hints that DeepSloth transfers if the adversary uses an effective multi-exit models as the surrogate.
130
+
131
+ Limited Training Set Knowledge. Second, we relax the assumption that the attacker knows the victim’s training set, $\mathcal { D }$ . Here, the attacker only knows a random portion of $\mathcal { D }$ , i.e., $10 \%$ , $2 5 \%$ , and $50 \%$ . We use VGG-16 architecture for both the surrogate and victim models. In the $10 \%$ , $2 5 \%$ and $50 \%$ settings, respectively, the attacks reduce the victim’s efficacy to 0.66, 0.5, 0.45 and 0.43 (from 0.77); its accuracy to $81 \%$ , $73 \%$ , $72 \%$ and $74 \%$ (from $8 8 \%$ ). Overall, the more limited the adversary’s $\mathcal { D }$ is, the less generalization ability the surrogate has and the less transferable the attacks are.
132
+
133
+ Cross-Domain. Third, we relax the assumption that the attacker exactly knows the victim’s task. Here, the attacker uses $\mathcal { D } _ { \boldsymbol { \mathcal { J } } }$ to train the surrogate, different from the victim’s $\mathcal { D }$ altogether. We use a VGG-16 on CIFAR-100 as the surrogate and attack a VGG-16-based victim model on CIFAR-10. This transfer attack reduces the victim’s efficacy to 0.63 (from 0.77) and its accuracy to $83 \%$ (from $8 8 \%$ ). We see that the cross-domain attack might be more effective than the limited $\mathcal { D }$ scenarios. This makes DeepSloth particularly dangerous as the attacker, without knowing the victim’s $\mathcal { D }$ , can collect a similar dataset and still slowdown the victim. We hypothesize the transferability of earlier layer features in CNNs (Yosinski et al., 2014) enables the perturbations attack to transfer from one domain to another, as long as they are similar enough.
134
+
135
+ Cross-Mechnanism. Finally, we test the scenario where the victim uses a completely different mechanism than a multi-exit architecture to implement input adaptiveness, i.e., SkipNet (Wang et al., 2018). A SkipNet, a modified residual network, selectively skips convolutional blocks based on the activations of the previous layer and, therefore, does not include any internal classifiers. We use a pre-trained SkipNet on CIFAR-10 that reduces the average computation for each input sample by ${ \sim } 5 0 \%$ over an equivalent ResNet and achieves ${ \sim } 9 4 \%$ accuracy. We then feed DeepSloth samples crafted on a MSDNet to this SkipNet, which reduces its average computational saving to ${ \sim } 3 2 \%$ $3 6 \%$ less effective) and its accuracy to $37 \%$ . This result suggests that the two different mechanisms have more in common than previously known and might share the vulnerability. We believe that understanding the underlying mechanisms through which adaptive models save computation is an important research question for future work.
136
+
137
+ # 6 STANDARD ADVERSARIAL TRAINING IS NOT A COUNTERMEASURE
138
+
139
+ In this section, we examine whether a defender can adapt a standard countermeasure against adversarial perturbations, adversarial training (AT) (Madry et al., 2018), to mitigate our attack. AT decreases a model’s sensitivity to perturbations that significantly change the model’s outputs. While this scheme is effective against adversarial examples that aim to trigger misclassifications; it is unclear whether using our DeepSloth samples for AT can also robustify a multi-exit model against slowdown attacks.
140
+
141
+ To evaluate, we train our multi-exit models as follows. We first take a base network—VGG-16—and train it on CIFAR-10 on PGD-10 adversarial examples. We then convert the resulting model into a multi-exit architecture, using the modification from (Kaya et al., 2019). During this conversion, we adversarially train individual exit points using PGD-10, PGD-10 (avg.), PGD-10 (max.), and DeepSloth; similar to (Hu et al., 2020). Finally, we measure the efficacy and accuracy of the trained models against PGD-20, PGD-20 (avg.), PGD-20 (max.), and DeepSloth, on CIFAR-10’s test-set.
142
+
143
+ Table 3: Evaluating adversarial training against slowdown attacks. Each entry includes the model’s efficacy score (left) and accuracy (right). Results are on CIFAR-10, in the RAD ${ < } 5 \%$ setting.
144
+
145
+ <table><tr><td>ADV. TRAINING</td><td>NO ATTACK</td><td>PGD-20</td><td>PGD-20 (AVG.)</td><td>PGD-20 (MAX.)</td><td>DEEPSLOTH</td></tr><tr><td>UNDEFENDED</td><td>0.77 /89%</td><td>0.79/29%</td><td>0.85 /10%</td><td>0.81/27%</td><td>0.01 / 13%</td></tr><tr><td>PGD-10</td><td>0.61/ 72%</td><td>0.55 /38%</td><td>0.64 /23%</td><td>0.58 /29%</td><td>0.33 / 70%</td></tr><tr><td>PGD-10 (AVG.)</td><td>0.53 / 72%</td><td>0.47 / 36%</td><td>0.47 /35%</td><td>0.47 /35%</td><td>0.32 / 70%</td></tr><tr><td>PGD-10 (MAX.)</td><td>0.57 /72%</td><td>0.51/37%</td><td>0.54 / 30%</td><td>0.52 /34%</td><td>0.32 / 70%</td></tr><tr><td>OURS</td><td>0.74/72%</td><td>0.71/38%</td><td>0.82 /14%</td><td>0.77 /21%</td><td>0.44/ 67%</td></tr><tr><td>OURS + PGD-10</td><td>0.61/73%</td><td>0.55 /38%</td><td>0.63 /23%</td><td>0.58 /28%</td><td>0.33 / 70%</td></tr></table>
146
+
147
+ Our results in Table 3 verify that AT provides resilience against all PGD attacks. Besides, AT provides some resilience to our attack: DeepSloth reduces the efficacy to ${ \sim } 0 . 3 2$ on robust models vs. 0.01 on the undefended one. However, we identify a trade-off between the robustness and efficiency of multi-exits. Compared to the undefended model, on clean samples, we see that robust models have lower efficacy—0.77 vs. $0 . 5 3 \sim 0 . 6 1$ . We observe that the model trained only with our DeepSloth samples (Ours) can recover the efficacy on both the clean and our DeepSloth samples, but this model loses its robustness against PGD attacks. Moreover, when we train a model on both our DeepSloth samples and PGD-10 $\mathrm { \ O u r s } + \mathrm { P G D } { - } 1 0$ ), the trained model suffers from low efficacy. Our results imply that a defender may require an out-of-the-box defense, such as flagging the users whose queries bypass the early-exits more often than clean samples for which the multi-exit network was calibrated.
148
+
149
+ # 7 CONCLUSIONS
150
+
151
+ This work exposes the vulnerability of input-adaptive inference mechanisms against adversarial slowdowns. As a vehicle for exploring this vulnerability systematically, we propose DeepSloth, an attack that introduces imperceptible adversarial perturbations to test-time inputs for offsetting the computational benefits of multi-exit inference mechanisms. We show that a white-box attack, which perturbs each sample individually, eliminates any computational savings these mechanisms provide. We also show that it is possible to craft universal slowdown perturbations, which can be reused, and transferable samples, in a black-box setting. Moreover, adversarial training, a standard countermeasure for adversarial perturbations, is not effective against DeepSloth. Our analysis suggests that slowdown attacks are a realistic, yet under-appreciated, threat against adaptive models.
152
+
153
+ # ACKNOWLEDGMENT
154
+
155
+ We thank the anonymous reviewers for their feedback. This research was partially supported by the Department of Defense.
156
+
157
+ # REFERENCES
158
+
159
+ Anish Athalye, Nicholas Carlini, and David Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 274–283, Stockholmsmässan, Stockholm Sweden, 10–15 Jul 2018. PMLR. URL http: //proceedings.mlr.press/v80/athalye18a.html.
160
+
161
+ Ron Banner, Itay Hubara, Elad Hoffer, and Daniel Soudry. Scalable methods for 8-bit training of neural networks. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems 31, pp. 5145–5153. Curran Associates, Inc., 2018. URL http://papers.nips.cc/paper/ 7761-scalable-methods-for-8-bit-training-of-neural-networks.pdf.
162
+
163
+ N. Carlini and D. Wagner. Towards evaluating the robustness of neural networks. In 2017 IEEE Symposium on Security and Privacy (SP), pp. 39–57, 2017.
164
+
165
+ Jiasi Chen and Xukan Ran. Deep learning with edge computing: A review. Proceedings of the IEEE, 107(8): 1655–1674, 2019.
166
+
167
+ Pin-Yu Chen, Yash Sharma, Huan Zhang, Jinfeng Yi, and Cho-Jui Hsieh. Ead: elastic-net attacks to deep neural networks via adversarial examples. arXiv preprint arXiv:1709.04114, 2017.
168
+
169
+ Elias De Coninck, Tim Verbelen, Bert Vankeirsbilck, Steven Bohez, Pieter Simoens, Piet Demeester, and Bart Dhoedt. Distributed neural networks for internet of things: The big-little approach. In International Internet of Things Summit, pp. 484–492. Springer, 2015.
170
+
171
+ Michael Figurnov, Maxwell D. Collins, Yukun Zhu, Li Zhang, Jonathan Huang, Dmitry Vetrov, and Ruslan Salakhutdinov. Spatially Adaptive Computation Time for Residual Networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017.
172
+
173
+ Ian Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In International Conference on Learning Representations, 2015. URL http://arxiv.org/abs/1412. 6572.
174
+
175
+ Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. arXiv preprint arXiv:1510.00149, 2015.
176
+
177
+ Mirazul Haque, Anki Chauhan, Cong Liu, and Wei Yang. Ilfo: Adversarial attack on adaptive neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020.
178
+
179
+ K. He, X. Zhang, S. Ren, and J. Sun. Deep Residual Learning for Image Recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770–778, 2016.
180
+
181
+ Geoffrey Hinton, Li Deng, Dong Yu, George E Dahl, Abdel-rahman Mohamed, Navdeep Jaitly, Andrew Senior, Vincent Vanhoucke, Patrick Nguyen, Tara N Sainath, et al. Deep neural networks for acoustic modeling in speech recognition: The shared views of four research groups. IEEE Signal processing magazine, 29(6): 82–97, 2012.
182
+
183
+ Lu Hou, Zhiqi Huang, Lifeng Shang, Xin Jiang, Xiao Chen, and Qun Liu. DynaBERT: Dynamic BERT with Adaptive Width and Depth. In Advances in Neural Information Processing Systems, 2020.
184
+
185
+ Andrew G. Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications, 2017.
186
+
187
+ C. Hu, W. Bao, D. Wang, and F. Liu. Dynamic adaptive dnn surgery for inference acceleration on the edge. In IEEE INFOCOM 2019 - IEEE Conference on Computer Communications, pp. 1423–1431, 2019. doi: 10.1109/INFOCOM.2019.8737614.
188
+
189
+ Ting-Kuei Hu, Tianlong Chen, Haotao Wang, and Zhangyang Wang. Triple wins: Boosting accuracy, robustness and efficiency together by enabling input-adaptive inference. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id $\equiv$ rJgzzJHtDB.
190
+
191
+ Gao Huang, Danlu Chen, Tianhong Li, Felix Wu, Laurens van der Maaten, and Kilian Weinberger. Multiscale dense networks for resource efficient image classification. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $\equiv$ Hk2aImxAb.
192
+
193
+ Nathan Inkawhich, Wei Wen, Hai (Helen) Li, and Yiran Chen. Feature space perturbations yield more transferable adversarial examples. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2019.
194
+
195
+ Weiwen Jiang, Edwin H.-M. Sha, Xinyi Zhang, Lei Yang, Qingfeng Zhuge, Yiyu Shi, and Jingtong Hu. Achieving super-linear speedup across multi-fpga for real-time dnn inference. ACM Trans. Embed. Comput. Syst., 18(5s), October 2019. ISSN 1539-9087. doi: 10.1145/3358192. URL https://doi.org/10.1145/3358192.
196
+
197
+ Yiping Kang, Johann Hauswald, Cao Gao, Austin Rovinski, Trevor Mudge, Jason Mars, and Lingjia Tang. Neurosurgeon: Collaborative intelligence between the cloud and mobile edge. In Proceedings of the TwentySecond International Conference on Architectural Support for Programming Languages and Operating Systems, ASPLOS’17, pp. 615–629, New York, NY, USA, 2017. Association for Computing Machinery. ISBN 9781450344654. doi: 10.1145/3037697.3037698. URL https://doi.org/10.1145/3037697. 3037698.
198
+
199
+ Yigitcan Kaya, Sanghyun Hong, and Tudor Dumitra¸s. Shallow-Deep Networks: Understanding and mitigating ˘ network overthinking. In Proceedings of the 2019 International Conference on Machine Learning (ICML), Long Beach, CA, Jun 2019.
200
+
201
+ Alex Krizhevsky, Geoffrey Hinton, et al. Learning Multiple Layers of Features from Tiny Images. 2009.
202
+
203
+ Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pp. 1097–1105, 2012.
204
+
205
+ Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial machine learning at scale. arXiv preprint arXiv:1611.01236, 2016.
206
+
207
+ M. Lecuyer, V. Atlidakis, R. Geambasu, D. Hsu, and S. Jana. Certified robustness to adversarial examples with differential privacy. In 2019 IEEE Symposium on Security and Privacy (SP), pp. 656–672, 2019.
208
+
209
+ En Li, Zhi Zhou, and Xu Chen. Edge intelligence: On-demand deep learning model co-inference with deviceedge synergy. In Proceedings of the 2018 Workshop on Mobile Edge Communications, MECOMM’18, pp. 31–36, New York, NY, USA, 2018. Association for Computing Machinery. ISBN 9781450359061. doi: 10.1145/3229556.3229562. URL https://doi.org/10.1145/3229556.3229562.
210
+
211
+ Hao Li, Asim Kadav, Igor Durdanovic, Hanan Samet, and Hans Peter Graf. Pruning filters for efficient convnets. CoRR, abs/1608.08710, 2016. URL http://arxiv.org/abs/1608.08710.
212
+
213
+ Fangzhou Liao, Ming Liang, Yinpeng Dong, Tianyu Pang, Xiaolin Hu, and Jun Zhu. Defense against adversarial attacks using high-level representation guided denoiser. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018.
214
+
215
+ Yanpei Liu, Xinyun Chen, Chang Liu, and Dawn Song. Delving into transferable adversarial examples and black-box attacks. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017. URL https://openreview. net/forum?id $\equiv$ Sys6GJqxl.
216
+
217
+ Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083, 2017.
218
+
219
+ Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=rJzIBfZAb.
220
+
221
+ Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, Omar Fawzi, and Pascal Frossard. Universal adversarial perturbations. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017.
222
+
223
+ N. Papernot, P. McDaniel, S. Jha, M. Fredrikson, Z. B. Celik, and A. Swami. The limitations of deep learning in adversarial settings. In 2016 IEEE European Symposium on Security and Privacy (EuroS P), pp. 372–387, 2016.
224
+
225
+ Nicolas Papernot, Patrick McDaniel, Ian Goodfellow, Somesh Jha, Z Berkay Celik, and Ananthram Swami. Practical black-box attacks against machine learning. In Proceedings of the 2017 ACM on Asia conference on computer and communications security, pp. 506–519, 2017.
226
+
227
+ Se Jin Park, Murali Subramaniyam, Seoung Eun Kim, Seunghee Hong, Joo Hyeong Lee, Chan Min Jo, and Youngseob Seo. Development of the elderly healthcare monitoring system with iot. In Advances in Human Factors and Ergonomics in Healthcare, pp. 309–315. Springer, 2017.
228
+
229
+ Jérôme Rony, Luiz G Hafemann, Luiz S Oliveira, Ismail Ben Ayed, Robert Sabourin, and Eric Granger. Decoupling direction and norm for efficient gradient-based l2 adversarial attacks and defenses. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4322–4330, 2019.
230
+
231
+ Karen Simonyan and Andrew Zisserman. Very Deep Convolutional Networks for Large-Scale Image Recognition, 2014.
232
+
233
+ Yang Song, Taesup Kim, Sebastian Nowozin, Stefano Ermon, and Nate Kushman. Pixeldefend: Leveraging generative models to understand and defend against adversarial examples. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $=$ rJUYGxbCW.
234
+
235
+ C. Szegedy, Wei Liu, Yangqing Jia, P. Sermanet, S. Reed, D. Anguelov, D. Erhan, V. Vanhoucke, and A. Rabinovich. Going deeper with convolutions. In 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1–9, 2015.
236
+
237
+ Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In International Conference on Learning Representations, 2014. URL http://arxiv.org/abs/1312.6199.
238
+
239
+ Mingxing Tan and Quoc Le. EfficientNet: Rethinking model scaling for convolutional neural networks. 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. 6105–6114, Long Beach, California, USA, 09–15 Jun 2019. PMLR. URL http://proceedings.mlr.press/v97/tan19a. html.
240
+
241
+ Ben Taylor, Vicent Sanz Marco, Willy Wolff, Yehia Elkhatib, and Zheng Wang. Adaptive deep learning model selection on embedded systems. ACM SIGPLAN Notices, 53(6):31–43, 2018.
242
+
243
+ S. Teerapittayanon, B. McDanel, and H. T. Kung. Branchynet: Fast inference via early exiting from deep neural networks. In 2016 23rd International Conference on Pattern Recognition (ICPR), pp. 2464–2469, 2016.
244
+
245
+ Tiny. Tiny ImageNet Visual Recognition Challenge. http://tiny-imagenet.herokuapp.com/. Accessed: 2020-09-28.
246
+
247
+ Florian Tramèr and Dan Boneh. Adversarial training and robustness for multiple perturbations. In Advances in Neural Information Processing Systems, pp. 5866–5876, 2019.
248
+
249
+ Florian Tramèr, Nicolas Papernot, Ian Goodfellow, Dan Boneh, and Patrick McDaniel. The space of transferable adversarial examples. arXiv preprint arXiv:1704.03453, 2017a.
250
+
251
+ Florian Tramèr, Nicolas Papernot, Ian Goodfellow, Dan Boneh, and Patrick McDaniel. The space of transferable adversarial examples. arXiv preprint arXiv:1704.03453, 2017b.
252
+
253
+ Xin Wang, Fisher Yu, Zi-Yi Dou, Trevor Darrell, and Joseph E. Gonzalez. SkipNet: Learning Dynamic Routing in Convolutional Networks. In The European Conference on Computer Vision (ECCV), September 2018.
254
+
255
+ Weilin Xu, David Evans, and Yanjun Qi. Feature squeezing: Detecting adversarial examples in deep neural networks. arXiv preprint arXiv:1704.01155, 2017.
256
+
257
+ Yuzhe Yang, Guo Zhang, Dina Katabi, and Zhi Xu. Me-net: Towards effective adversarial robustness with matrix estimation. arXiv preprint arXiv:1905.11971, 2019.
258
+
259
+ Jason Yosinski, Jeff Clune, Yoshua Bengio, and Hod Lipson. How transferable are features in deep neural networks? In Advances in neural information processing systems, pp. 3320–3328, 2014.
260
+
261
+ Li Zhou, Hao Wen, Radu Teodorescu, and David H.C. Du. Distributing deep neural networks with containerized partitions at the edge. In 2nd USENIX Workshop on Hot Topics in Edge Computing (HotEdge 19), Renton, WA, July 2019. USENIX Association. URL https://www.usenix.org/conference/hotedge19/ presentation/zhou.
262
+
263
+ Wangchunshu Zhou, Canwen Xu, Tao Ge, Julian McAuley, Ke Xu, and Furu Wei. BERT Loses Patience: Fast and Robust Inference with Early Exit. In Advances in Neural Information Processing Systems, 2020.
264
+
265
+ # A MOTIVATING EXAMPLES
266
+
267
+ Here, we discuss two exemplary scenarios where an adversary can exploit the slowdown attacks.
268
+
269
+ • (Case 1) Attacks on cloud-based IoT applications. In most cases, cloud-based IoT applications, such as Apple Siri, Google Now, or Microsoft Cortana, run their DNN inferences in the cloud. This cloud-only approach puts all the computational burden on cloud servers and increases the communications between the servers and IoT devices. In consequence, recent work (Kang et al., 2017; Li et al., 2018; Zhou et al., 2019) utilizes multi-exit architectures for bringing computationally expensive models, e.g. language models (Zhou et al., 2020; Hou et al., 2020), in the cloud to IoT (or mobile) devices. They split a multi-exit model into two partitions and deploy each of them to a server and IoT devices, respectively. Under this scheme, the cloud server only takes care of complex inputs that the shallow partition cannot correctly classify at the edge. As a result, one can reduce the computations in the cloud and decrease communications between the cloud and edge.
270
+
271
+ On the other hand, our adversary, by applying human-imperceptible perturbations, can convert simple inputs into complex inputs. These adversarial inputs will bypass early-exits and, as a result, reduce (or even offset) the computational and communication savings provided by prior work.
272
+
273
+ Here, a defender may deploy DoS defenses such as firewalls or rate-limiting. In this setting, the attacker may not cause DoS because defenses keep the communications between the server and IoT devices under a certain-level. Nevertheless, the attacker still increases: (i) the computations at the edge (by making inputs skip early-exits) and (ii) the number of samples that cloud servers process. Recall that a VGG-16 SDN model classifies $90 \%$ of clean CIFAR-10 instances correctly at the first exit. If the adversarial examples crafted by the attacker bypass only the first exit, one can easily increase the computations on IoT devices and make them send requests to the cloud.
274
+
275
+ • (Case 2) Attacks on real-time DNN inference for resource- and time-constrained scenarios. Recent work on the real-time systems (Hu et al., 2019; Jiang et al., 2019) harnesses multi-exit architectures and model partitioning as a solution to optimize real-time DNN inference for resourceand time-constrained scenarios. Hu et al. (2019) showed a real-world prototype of an optimal model partitioning, which is based on a self-driving car video dataset, can improve latency and throughput of partitioned models on the cloud and edge by $6 . 5 – 1 4 \times$ , respectively.
276
+
277
+ However, the prior work does not consider the danger of slowdown attacks; our threat model has not been discussed before in the literature. Our results in Sec 5 suggest that slowdown can be induced adversarially, potentially violating real-time guarantees. For example, our attacker can force partitioned models on the cloud and edge to use maximal computations for inference. Further, the same adversarial examples also require the inference results from the model running on the cloud, which potentially increases the response time of the edge devices by $1 . 5 – 5 \times$ . Our work showed that multi-exit architectures should be used with caution in real-time systems.
278
+
279
+ # B HYPERPARAMETERS
280
+
281
+ In our experiments, we use the following hyperparameters to craft adversarial perturbations.
282
+
283
+ $\ell _ { \infty }$ -based DeepSloth. We find that $\ell _ { \infty }$ -based DeepSloth does not require careful tuning. For the standard attack, we set the total number of iterations to 30 and the step size to $\alpha = 0 . 0 0 2$ . For the modified attacks for hurting or preserving the accuracy, we set the total number of iterations to 75 and the step size to $\alpha = 0 . 0 0 1$ . We compute the standard perturbations using the entire $1 0 \mathrm { k }$ test-set samples in CIFAR-10 and Tiny Imagenet. For the universal variants, we set the total number of iterations to 12 and reduce the initial step size of $\alpha = 0 . 0 0 5$ by a factor of 10 every 4 iterations. To compute a universal perturbation, we use randomly chosen 250 (CIFAR-10) and 200 (Tiny Imagenet) training samples.
284
+
285
+ $\ell _ { 2 }$ -based DeepSloth. For both the standard and universal attacks, we set the total number of iterations to 550 and the step size $\gamma$ to 0.1. Our initial perturbation has the $\ell _ { 2 }$ -norm of 1.0. Here, we use the same number of samples for crafting the standard and universal perturbations as the $\ell _ { \infty }$ -based attacks.
286
+
287
+ $\ell _ { 1 }$ -based DeepSloth. For our standard $\ell _ { 1 }$ -based DeepSloth, we set the total number of iterations to 250, the step size $\alpha$ to 0.5, and the gradient sparsity to 99. For the universal variants, we reduce the total number of iterations to 100 and set the gradient sparsity to 90. Other hyperparameters remain the same. We use the same number of samples as the $\ell _ { \infty }$ -based attacks, to craft the perturbations.
288
+
289
+ # C EMPIRICAL EVALUATION OF $\ell _ { 1 }$ AND $\ell _ { 2 }$ DEEPSLOTH
290
+
291
+ Table 4 and Table 5 shows the effectiveness of $\ell _ { 1 }$ -based and $\ell _ { 2 }$ -based DeepSloth attacks, respectively.
292
+
293
+ Table 4: The effectiveness of $\ell _ { 1 }$ DeepSloth. ‘ $R \mathrm { A D } { < } 5 , 1 5 \%$ ’ columns list the results in each early-exit setting. Each entry includes the model’s efficacy score (left) and accuracy (right). The class-universal attack’s results are an average of 10 classes. ‘TI’ is Tiny Imagenet and $\mathbf { \dot { C } } 1 0 ^ { \circ }$ is CIFAR-10.
294
+
295
+ <table><tr><td>NETWORK</td><td colspan="2">MSDNET</td><td colspan="2">VGG16</td><td colspan="2">MOBILENET</td></tr><tr><td>SET.</td><td>RAD&lt;5%</td><td>RAD&lt;15%</td><td>RAD&lt;5%</td><td>RAD&lt;15%</td><td>RAD&lt;5%</td><td>RAD&lt;15%</td></tr><tr><td colspan="7">BASELINE (NO ATTACK)</td></tr><tr><td>C10</td><td>0.89 /85%</td><td>0.89 /85%</td><td>0.77 /89%</td><td>0.89 / 79%</td><td>0.83 /87%</td><td>0.92 /79%</td></tr><tr><td>TI</td><td>0.64 / 55%</td><td>0.83 /50%</td><td>0.39 / 57%</td><td>0.51 /52%</td><td>0.42 /57%</td><td>0.59 / 51%</td></tr><tr><td colspan="7">DEEPSLOTH</td></tr><tr><td>C10</td><td>0.36 / 51%</td><td>0.35 / 51%</td><td>0.12 /36%</td><td>0.34 /45%</td><td>0.18 / 41%</td><td>0.49 / 53%</td></tr><tr><td>TI</td><td>0.23 /37%</td><td>0.51 / 40%</td><td>0.08 /22%</td><td>0.15 / 25%</td><td>0.08 /33%</td><td>0.19 /35%</td></tr><tr><td colspan="7">UNIVERSAL DEEPSLOTH</td></tr><tr><td>C10</td><td>0.89 /83%</td><td>0.89 /83%</td><td>0.75 /85%</td><td>0.88 / 75%</td><td>0.82 /85%</td><td>0.92 /77%</td></tr><tr><td>TI</td><td>0.64 / 55%</td><td>0.83/50%</td><td>0.38 /57%</td><td>0.51 / 52%</td><td>0.41 / 57%</td><td>0.59 / 51%</td></tr><tr><td colspan="7">CLASS-UNIVERSAL DEEPSLOTH</td></tr><tr><td>C10</td><td>0.88/ 73%</td><td>0.88 / 73%</td><td>0.69 / 78%</td><td>0.86 /67%</td><td>0.76 /74%</td><td>0.89 / 65%</td></tr><tr><td>TI</td><td>0.64 /54%</td><td>0.83 /49%</td><td>0.39 / 59%</td><td>0.50 / 58%</td><td>0.41 / 60%</td><td>0.58 / 53%</td></tr></table>
296
+
297
+ Table 5: The effectiveness of $\ell _ { 2 }$ DeepSloth. $\cdot \mathrm { R A D } { < } 5 , 1 5 \%$ ’ columns list the results in each early-exit setting. Each entry includes the model’s efficacy score (left) and accuracy (right). The class-universal attack’s results are an average of 10 classes. ‘TI’ is Tiny Imagenet and $\mathbf { \dot { C } } 1 0 ^ { \circ }$ is CIFAR-10.
298
+
299
+ <table><tr><td>NETWORK</td><td colspan="2">MSDNET</td><td colspan="2">VGG16</td><td colspan="2">MOBILENET</td></tr><tr><td>SET.</td><td>RAD&lt;5%</td><td>RAD&lt;15%</td><td>RAD&lt;5%</td><td>RAD&lt;15%</td><td>RAD&lt;5%</td><td>RAD&lt;15%</td></tr><tr><td colspan="7">BASELINE (NO ATTACK)</td></tr><tr><td>C10</td><td>0.89 /85%</td><td>0.89 /85%</td><td>0.77 / 89%</td><td>0.89 / 79%</td><td>0.83 /87%</td><td>0.92 /79%</td></tr><tr><td>TI</td><td>0.64 / 55%</td><td>0.83 / 50%</td><td>0.39 / 57%</td><td>0.51 / 52%</td><td>0.42 /57%</td><td>0.59 / 51%</td></tr><tr><td colspan="7">DEEPSLOTH</td></tr><tr><td>C10</td><td>0.52 / 64%</td><td>0.52 /64%</td><td>0.22 /60%</td><td>0.45 / 62%</td><td>0.23 /46%</td><td>0.48 / 55%</td></tr><tr><td>TI</td><td>0.24 /42%</td><td>0.52 / 44%</td><td>0.13 /35%</td><td>0.21 /36%</td><td>0.12 /38%</td><td>0.25 /40%</td></tr><tr><td colspan="7">UNIVERSAL DEEPSLOTH</td></tr><tr><td>C10</td><td>0.89 /81%</td><td>0.89 /81%</td><td>0.75 /87%</td><td>0.88 / 76%</td><td>0.81/84%</td><td>0.92 /76%</td></tr><tr><td>TI</td><td>0.63 / 54%</td><td>0.82 /48%</td><td>0.38 /56%</td><td>0.51 / 52%</td><td>0.41 / 56%</td><td>0.58 / 51%</td></tr><tr><td colspan="7">CLASS-UNIVERSAL DEEPSLOTH</td></tr><tr><td>C10</td><td>0.88 /73%</td><td>0.88 / 73%</td><td>0.71 /81%</td><td>0.86 / 70%</td><td>0.76 /76%</td><td>0.89 /66%</td></tr><tr><td>TI</td><td>0.64 / 53%</td><td>0.83 /49%</td><td>0.38 /57%</td><td>0.50 / 57%</td><td>0.41 /58%</td><td>0.58 / 53%</td></tr></table>
300
+
301
+ Our results show that the $\ell _ { 1 } \cdot$ - and $\ell _ { 2 }$ -based attacks are less effective than the $\ell _ { \infty }$ -based attacks. In contrast to the $\ell _ { \infty }$ -based attacks that eliminate the efficacy of victim multi-exit models, the $\ell _ { 1 }$ - and $\ell _ { 2 }$ -based attacks reduce the efficacy of the same models by $0 . 2 4 { \sim } 0 . 6 5$ . Besides, the accuracy drops caused by $\ell _ { 1 } \cdot$ - and $\ell _ { 2 }$ -based attacks are in $6 \sim 2 1 \%$ , smaller than that of $\ell _ { \infty }$ -based DeepSloth $( 7 5 \sim 9 9 \% )$ . Moreover, we see that the universal variants of $\ell _ { 1 }$ - and $\ell _ { 2 }$ -based attacks can barely reduce the efficacy of multi-exit models—they decrease the efficacy up to 0.08 and the accuracy by $12 \%$ .
302
+
303
+ # D EMPIRICAL EVALUATION OF DEEPSLOTH ON RESNET56
304
+
305
+ Table 6 shows the the effectiveness of our DeepSloth attacks on ResNet56-base models.
306
+
307
+ Table 6: The effectiveness of DeepSloth on the ResNet-based models. $\cdot \mathrm { R A D } { < } 5 , 1 5 \%$ ’ columns list the results in each early-exit setting. Each entry includes the model’s efficacy score (left) and accuracy (right). The class-universal attack’s results are an average of 10 classes.
308
+
309
+ <table><tr><td>NETWORK</td><td colspan="2">RESNET(lo)</td><td colspan="2">RESNET (l1)</td><td colspan="2">RESNET(2)</td></tr><tr><td>SET.</td><td>RAD&lt;5%</td><td>RAD&lt;15%</td><td>RAD&lt;5%</td><td>RAD&lt;15%</td><td>RAD&lt;5%</td><td>RAD&lt;15%</td></tr><tr><td colspan="7">BASELINE (NO ATTACK)</td></tr><tr><td>C10</td><td>0.52 /87%</td><td>0.69 /80%</td><td>0.52/87%</td><td>0.69 / 80%</td><td>0.51 /87%</td><td>0.69 / 80%</td></tr><tr><td>TI</td><td>0.25 / 51%</td><td>0.39 /46%</td><td>0.25 /51%</td><td>0.39 /46%</td><td>0.25 /51%</td><td>0.39 / 46%</td></tr><tr><td colspan="7">DEEPSLOTH</td></tr><tr><td>C10</td><td>0.00 /19%</td><td>0.01 /19%</td><td>0.05 /43%</td><td>0.18 /47%</td><td>0.06 /45%</td><td>0.17 /48%</td></tr><tr><td>TI</td><td>0.00 /7%</td><td>0.01 / 7%</td><td>0.04 /27%</td><td>0.10 /28%</td><td>0.05 /34%</td><td>0.13 /35%</td></tr><tr><td colspan="7">UNIVERSAL DEEPSLOTH</td></tr><tr><td>C10</td><td>0.35 / 63%</td><td>0.59 /60%</td><td>0.49 /84%</td><td>0.68 /75%</td><td>0.48 /85%</td><td>0.67 /76%</td></tr><tr><td>TI</td><td>0.25 / 25%</td><td>0.34 / 37%</td><td>0.25 / 51%</td><td>0.39 / 46%</td><td>0.25 / 51%</td><td>0.38 /46%</td></tr><tr><td colspan="7">CLASS-UNIVERSAL DEEPSLOTH</td></tr><tr><td>C10</td><td>0.23 / 33%</td><td>0.48 / 29%</td><td>0.39 / 70%</td><td>0.60 / 61%</td><td>0.39 / 71%</td><td>0.60 / 61%</td></tr><tr><td>TI</td><td>0.11 /21%</td><td>0.23 /18%</td><td>0.23 / 51%</td><td>0.36 /46%</td><td>0.23 / 50%</td><td>0.36 /46%</td></tr></table>
310
+
311
+ Our results show that ResNet56-based models are vulnerable to all the $\ell _ { \infty }$ , $\ell _ { 2 }$ , and $\ell _ { 1 }$ -based DeepSloth attacks. Using our $\ell _ { \infty }$ -based DeepSloth, the attacker can reduce the efficacy of the victim models to $0 . 0 0 { \sim } 0 . 0 1$ and the accuracy by $3 9 \sim 6 8 \%$ . Besides, the $\ell _ { 2 }$ , and $\ell _ { 1 }$ -based attacks also decrease the efficacy to $0 . 0 4 { \sim } 0 . 1 8$ and the accuracy by $1 1 { \sim } 4 4 \%$ . Compared to the results on MSDNet, VGG16, and MobileNet in Table 4 and 5, the same attacks are more effective. The universal variants decrease the efficacy up to 0.21 and the accuracy up to $24 \%$ . In particular, the $\ell _ { 2 }$ , and $\ell _ { 1 }$ -based attacks (on CIFAR-10 models) are effective than the same attacks on MSDNet, VGG16, and MobileNet models.
312
+
313
+ # E COST OF CRAFTING DEEPSLOTH SAMPLES
314
+
315
+ In Table 7, we compare the cost of DeepSloth with other attack algorithms on a VGG16-based CIFAR10 model—executed on a single Nvidia Tesla-V100 GPU. For the universal DeepSloth, we measure the execution time for crafting a perturbation using one batch (250 samples) of the training set. For the other attacks, we measure the time for perturbing the whole test set of CIFAR-10. Our DeepSloth takes roughly the same time as the PGD and PGD-avg attacks and significantly less time than the PGD-max attack. Our
316
+
317
+ <table><tr><td>ATTACKS</td><td>TIME (SEC.)</td></tr><tr><td>PGD-20</td><td>38</td></tr><tr><td>PGD-20 (AVG.)</td><td>48</td></tr><tr><td>PGD-20 (MAX.)</td><td>475</td></tr><tr><td>DEEPSLOTH</td><td>44</td></tr><tr><td>UNIVERSAL DEEPSLOTH</td><td>2</td></tr></table>
318
+
319
+ Table 7: Time it takes to craft attacks.
320
+ universal DeepSloth takes only 2 seconds ( $1 0 \mathrm { x }$ faster than DeepSloth) as it only uses 250 samples.
321
+
322
+ # F ADVERSARIAL EXAMPLES FROM STANDARD ATTACKS AND DEEPSLOTH
323
+
324
+ In Figure 4, we visualize the adversarial examples from the PGD, UAP and our DeepSloth attacks.
325
+
326
+ ![](images/0bdcaea5dbd66848101c989036785e7979050485b14922c9d380c77e29ee961e.jpg)
327
+ Figure 4: Adversarial examples from the standard and our DeepSloth attacks. The leftmost column shows the clean images. In the next four columns, we show adversarial examples from PGD, PGD (avg.), PGD (max.), and UAP attacks, respectively. The last four columns include adversarial examples from the three variants of DeepSloth. Each row corresponds to each sample, and the last row contains the average $\ell _ { \mathrm { i n f } }$ -norm of the perturbations over the eight samples in each attack.
md/train/B1al7jg0b/B1al7jg0b.md ADDED
@@ -0,0 +1,279 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # OVERCOMING CATASTROPHIC INTERFERENCE USING CONCEPTOR-AIDED BACKPROPAGATION
2
+
3
+ Xu He, Herbert Jaeger
4
+ Department of Computer Science and Electrical Engineering
5
+ Jacobs University Bremen
6
+ Bremen, 28759, Germany
7
+ {x.he,h.jaeger}@jacobs-university.de
8
+
9
+ # ABSTRACT
10
+
11
+ Catastrophic interference has been a major roadblock in the research of continual learning. Here we propose a variant of the back-propagation algorithm, “conceptor-aided backprop” (CAB), in which gradients are shielded by conceptors against degradation of previously learned tasks. Conceptors have their origin in reservoir computing, where they have been previously shown to overcome catastrophic forgetting. CAB extends these results to deep feedforward networks. On the disjoint and permuted MNIST tasks, CAB outperforms two other methods for coping with catastrophic interference that have recently been proposed.
12
+
13
+ # 1 INTRODUCTION
14
+
15
+ Agents with general artificial intelligence are supposed to learn and perform well on multiple tasks. Continual learning refers to the scenarios where a machine learning system can retain previously acquired skills while learning new ones. However, when trained on a sequence of tasks, neural networks usually forget about previous tasks after their weights are adjusted for a new task. This notorious problem known as catastrophic interference (CI) (McCloskey & Cohen, 1989; Ratcliff, 1990; French, 1999; Kumaran et al., 2016) poses a serious challenge towards continual learning.
16
+
17
+ Many approaches have been proposed to overcome or mitigate the problem of CI in the last three decades (Hinton & Plaut, 1987; French, 1991; Ans & Rousset, 1997; French, 1997; Srivastava et al., 2014). Especially recently, an avalanche of new methods in the deep learning field has brought about dramatic improvements in continual learning in neural networks. Kirkpatrick et al. (2017) introduced a regularization-based method called elastic weight consolidation (EWC), which uses the posterior distribution of parameters for the old tasks as a prior for the new task. They approximated the posterior by a Gaussian distribution with the parameters for old tasks as the mean and the inverse diagonal of the Fisher information matrix as the variance. Lee et al. (2017) introduced two incremental moment matching (IMM) methods called mean-IMM and mode-IMM. Mean-IMM approximates the distribution of parameters for both old and new tasks by a Gaussian distribution, which is estimated by minimizing its KL-divergence from the mixture of two Gaussian posteriors, one for the old task and the other one for the new task. Mode-IMM estimates the mode of this mixture of two Gaussians and uses it as the optimal parameters for both tasks.
18
+
19
+ In the field of Reservoir Computing (Jaeger, 2001; Maass et al., 2002), an effective solution to CI using conceptors was proposed by Jaeger (2014) to incrementally train a recurrent neural network to generate spatial-temporal signals. Conceptors are a general-purpose neuro-computational mechanism that can be used in a diversity of neural information processing tasks including temporal pattern classification, one-shot learning, human motion pattern generation, de-noising and signal separation (Jaeger, 2017). In this paper, we adopt and extend the method introduced in Jaeger (2014) and propose a conceptor-aided backpropagation (CAB) algorithm to train feed-forward networks. For each layer of a network, CAB computes a conceptor to characterize the linear subspace spanned by the neural activations in that layer that have appeared in already learned tasks. When the network is trained on a new task, CAB uses the conceptor to adjust the gradients given by backpropagation so that the linear transformation restricted to the characterized subspace will be preserved after the gradient descent procedure. Experiment results of two benchmark tests showed highly competitive performance of CAB.
20
+
21
+ The rest of this paper is structured as follows. Section 2 introduces conceptors and their application to incremental learning by ridge regression. Section 3 extends the method to stochastic gradient descent and describes the CAB algorithm. Section 4 compares its performance on the permuted and disjoint MNIST tasks to recent methods that address the same problem. Finally we conclude our paper in Section 5.
22
+
23
+ # 2 INCREMENTAL RIDGE REGRESSION BY CONCEPTORS
24
+
25
+ This section reviews the basics of conceptor theory and its application to incrementally training linear readouts of recurrent neural networks as used in reservoir computing. A comprehensive treatment can be found in (Jaeger, 2014).
26
+
27
+ # 2.1 CONCEPTORS
28
+
29
+ ![](images/8cc681eef02ddc59f5850e76547b11fae2efd1c7890b07b3a27fa22575869775.jpg)
30
+ Figure 1: 3D point clouds (black dots) and their corresponding conceptors, represented by ellipsoids whose axes are the singular vectors of conceptors and the lengths of these axes match the singular values of conceptors. Each edge of the plot boxes range from $- 1$ to $+ 1$ admitted by neural dynamics with a tanh nonlinearity; conceptor ellipsiods lie inside the unit sphere.
31
+
32
+ In brief, a matrix conceptor $C$ for some vector-valued random variable $\boldsymbol { x } \in \mathbb { R } ^ { N }$ is defined as a linear transformation that minimizes the following loss function.
33
+
34
+ $$
35
+ \mathbb { E } _ { x } [ | | x - C x | | ^ { 2 } ] + \alpha ^ { - 2 } | | C | | _ { \mathrm { f r o } } ^ { 2 }
36
+ $$
37
+
38
+ where $\alpha$ is a control parameter called aperture and $| | \cdot | | _ { \mathrm { f r o } }$ is the Frobenius norm. This optimization problem has a closed-form solution
39
+
40
+ $$
41
+ C = R ( R + \alpha ^ { - 2 } I ) ^ { - 1 }
42
+ $$
43
+
44
+ where $R = \mathbb { E } _ { x } [ x x ^ { \top } ]$ is the $N \times N$ correlation matrix of $x$ , and $I$ is the $N \times N$ identity matrix. This result given in (2) can be understood by studying the singular value decomposition (SVD) of $C$ . If $R = \bar { U } \Sigma U ^ { \top }$ is the SVD of $R$ , then the SVD of $C$ is given as $U S U ^ { \top }$ , where the singular values $s _ { i }$ of $C$ can be written in terms of the singular values $\sigma _ { i }$ of $R$ : $s _ { i } = \sigma _ { i } / ( \sigma _ { i } + \alpha ^ { - 2 } ) \mathbf { \bar { \Omega } } \in [ 0 , 1 )$ . In intuitive terms, $C$ is a soft projection matrix on the linear subspace where the samples of $x$ lie. For a vector $y$ in this subspace, $C$ acts like the identity: $C y \approx y$ , and when some noise $\epsilon$ orthogonal to the subspace is added to $y$ , $C$ de-noises: $C ( y + \epsilon ) \approx y$ . Figure 1 shows the ellipsoids corresponding to three sets of $\mathbb { R } ^ { 3 }$ points. We define the quota $Q ( C )$ of a conceptor to be the mean singular values: $\begin{array} { r } { Q ( C ) : = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } s _ { i } } \end{array}$ . Intuitively, the quota measures the fraction of the total dimensions of the entire vector space that is claimed by $C$ .
45
+
46
+ Moreover, logic operations that satisfy most laws of Boolean logic can be defined on matrix conceptors as the following:
47
+
48
+ $$
49
+ \begin{array} { c } { { \neg C : = I - C , } } \\ { { C ^ { i } \vee C ^ { j } : = ( R ^ { i } + R ^ { j } ) ( R ^ { i } + R ^ { j } + \alpha ^ { - 2 } I ) ^ { - 1 } } } \\ { { C ^ { i } \wedge C ^ { j } : = \neg ( \neg C ^ { i } \vee \neg C ^ { j } ) } } \end{array}
50
+ $$
51
+
52
+ where $\lnot C$ softly projects onto a linear subspace that can be roughly understood as the orthogonal complement of the subspace characterized by $C$ . $C ^ { i } \vee C ^ { j }$ is the conceptor computed from the union of the two sets of sample points from which $C ^ { i }$ and $C ^ { j }$ are computed. It describes a space that is approximately the sum of linear subspaces characterized by $C ^ { i }$ and $C ^ { j }$ , respectively. The definition of $\bar { C } ^ { i } \wedge C ^ { j }$ reflects de Morgan’s law. Figure 2 illustrates the geometry of these operations.
53
+
54
+ ![](images/ac40caea8a02c56128dcbbb6714517c35c39b998c541267522f8ca3c04099e23.jpg)
55
+ Figure 2: Geometry of Boolean operations on 2-dimensional conceptors. The OR (resp. AND) operation gives a conceptor whose ellipsoid approximately is the smallest (largest) ellipsoid enclosing (contained in) the argument conceptor’s ellipsoids.
56
+
57
+ # 2.2 INCREMENTAL RIDGE REGRESSION
58
+
59
+ This subsection explains how conceptors can be applied to master continual learning in a simple linear model trained on a supervised task by ridge regression. The training is done sequentially on multiple input-to-output mapping tasks. This simplified scenario illustrates the working principle of continual learning with conceptors and will later be used repeatedly as a sub-procedure in the CAB algorithm for training multilayer feed-forward networks.
60
+
61
+ Consider a sequence of $m$ incoming tasks indexed by $j$ . We denote the training dataset for the $j$ -th task by $\{ ( x _ { 1 } ^ { j } , y _ { 1 } ^ { j } ) , \cdot \cdot \cdot , ( x _ { n } ^ { j } , y _ { n } ^ { j } ) \}$ , where $\boldsymbol { x } _ { i } ^ { j } \in \mathbb { R } ^ { N }$ are input vectors and $y _ { i } ^ { j } \in \mathbb { R } ^ { M }$ their corresponding target outputs. Whenever the training dataset for a new task is available, the incremental learning method will compute a matrix conceptor $C ^ { j }$ for the input variable of the new task using Equation 2 and update the linear model, resulting in a sequence of linear models $W ^ { 1 } , \ldots W ^ { m }$ such that $W ^ { j }$ solves not only the $j$ -th task but also all previous tasks: for $k \leq j , y ^ { k } \approx W ^ { j } x ^ { k }$ . The conceptor $C ^ { j }$ is a soft projection matrix onto the linear subspace spanned by input patterns from the $j$ -th task. Then, $A ^ { j - 1 } \overset { \cdot } { = } \overset { \cdot } { C } ^ { 1 } \vee \cdots \vee C ^ { j - 1 }$ characterizes the memory space already claimed by the tasks $1 , \ldots , j - 1$ and $F ^ { j } = \neg A ^ { j - 1 }$ , the orthogonal complement of $A ^ { j } - 1$ , represents the memory space still free for the $j$ -th task. Here “memory space” refers to the linear space of input vectors. In detail, this method proceeds in the following way:
62
+
63
+ • Initialization (no task trained yet): $W ^ { 0 } = 0 _ { M \times N } , A ^ { 0 } = 0 _ { N \times N }$ • Incremental task learning: For tasks $j = 1 , \ldots , m$ do:
64
+
65
+ 1. Store the input vectors from the $j$ -th training dataset of size $n$ into a $N \times n$ sized input collection matrix $X ^ { j }$ , and store the output vectors into a $M \times n$ sized output collection matrix $Y ^ { j }$ .
66
+
67
+ 2. Compute the conceptor for this task by $C ^ { j } ~ = ~ R ^ { j } ( R ^ { j } + \alpha ^ { - 2 } I ) ^ { - 1 }$ , where $R ^ { j } \ =$ $\scriptstyle { \frac { 1 } { n } } X ^ { j ^ { \prime } } X ^ { j ^ { \top } }$
68
+
69
+ 3. Train an increment matrix $W _ { i n c } ^ { j }$ (to be added to $W ^ { j - 1 }$ , yielding $W ^ { j }$ ), with the crucial aid of a helper conceptor $F ^ { j }$ :
70
+
71
+ (a) $F ^ { j } : = \neg A ^ { j - 1 }$ (comment: this conceptor characterizes the “still disposable” memory space for the $j$ -th task),
72
+ (b) $T : = Y ^ { j } - ( W ^ { j - 1 } X ^ { j } )$ (comment: this matrix consists of target values for a linear regression to compute $W _ { i n c . } ^ { j }$ ),
73
+ (c) $S : = F ^ { j } X ^ { j }$ (comment: this matrix consists of input arguments for the linear regression),
74
+
75
+ (d) $W _ { i n c } ^ { j } \ : = \ : ( ( S S ^ { \top } / n + \lambda ^ { - 2 } I ) ^ { - 1 } S T ^ { \top } / n ) ^ { \top }$ (comment: carry out the regression, regularized by $\lambda ^ { - 2 }$ ),
76
+
77
+ $W ^ { j }$ : $W ^ { j } = W ^ { j - 1 } + W _ { i n c } ^ { j }$
78
+
79
+ 5. Update $A : A ^ { j } = A ^ { j - 1 } \vee C ^ { j }$ (comment: this is possible due to the associativity of the ∨ operation on conceptors)
80
+
81
+ The weight increment $W _ { i n c } ^ { j }$ does not interfere much with the previously learned weights $W ^ { j - 1 }$ because the regularization in step 3(d) constrains the row space of $W _ { i n c } ^ { j }$ to be only the linear subspace spanned by input arguments defined in 3(c), which are inside the kernel of $W ^ { j - 1 }$ due to the projection by $F ^ { j }$ . Intuitively speaking, when learning a new task, this algorithm exploits only the components of input vectors in the still unused space (kernel of $W ^ { j - 1 }$ , characterized by $F ^ { j }$ ) to compensate errors for the new task and leaves the directions in the already used memory space (row space of $W ^ { j - 1 }$ , characterized by $A ^ { j - 1 }$ ) intact.
82
+
83
+ # 3 CONCEPTOR-AIDED SGD AND BACK-PROP
84
+
85
+ In this section, we first derive a stochastic gradient descent version of the algorithm described in the previous section, then present the procedure of CAB.
86
+
87
+ # 3.1 SGD
88
+
89
+ In the algorithm introduced in the previous section, $W _ { i n c } ^ { j }$ is computed by ridge regression, which offers a closed-form solution to minimize the following cost function
90
+
91
+ $$
92
+ \mathcal { I } ( W _ { i n c } ^ { j } ) : = \mathbb { E } [ | W _ { i n c } ^ { j } s - t | ^ { 2 } ] + \lambda ^ { - 2 } | W _ { i n c } ^ { j } | _ { \mathrm { f r o } } ^ { 2 }
93
+ $$
94
+
95
+ where $t = y ^ { j } - W ^ { j - 1 } x ^ { j } , s = F ^ { j } x ^ { j }$ . One can also minimize this cost function by stochastic gradient descent (SGD), which starts from an initial guess of $W _ { i n c } ^ { j }$ and repeatedly performs the following update
96
+
97
+ $$
98
+ W _ { i n c } ^ { j } W _ { i n c } ^ { j } - \eta \nabla _ { W _ { i n c } ^ { j } } \mathcal { I } ( W _ { i n c } ^ { j } )
99
+ $$
100
+
101
+ where $\eta$ is the learning rate and the gradient is given by:
102
+
103
+ $$
104
+ \nabla _ { W _ { i n c } ^ { j } } \mathcal { I } ( W _ { i n c } ^ { j } ) = 2 \mathbb { E } [ ( W _ { i n c } ^ { j } s - t ) s ^ { \top } ] + 2 \lambda ^ { - 2 } W _ { i n c } ^ { j }
105
+ $$
106
+
107
+ Substituting $t$ by $y ^ { j } - W ^ { j - 1 } x ^ { j }$ and $s$ by $F ^ { j } x ^ { j } = ( I - A ^ { j - 1 } ) x ^ { j }$ in (8), we get
108
+
109
+ $$
110
+ \begin{array} { r l } & { \nabla _ { W _ { i n c } ^ { j } } \mathcal { I } ( W _ { i n c } ^ { j } ) = 2 \mathbb { E } [ ( W _ { i n c } ^ { j } ( I - A ^ { j - 1 } ) x ^ { j } - y ^ { j } + W ^ { j - 1 } x ^ { j } ) s ^ { \top } ] + 2 \lambda ^ { - 2 } W _ { i n c } ^ { j } } \\ & { \phantom { \frac { 1 } { 1 } } = 2 \mathbb { E } [ ( - W _ { i n c } ^ { j } A ^ { j - 1 } x ^ { j } + ( W ^ { j - 1 } + W _ { i n c } ^ { j } ) x ^ { j } - y ^ { j } ) s ^ { \top } ] + 2 \lambda ^ { - 2 } W _ { i n c } ^ { j } } \end{array}
111
+ $$
112
+
113
+ Due to the regularization term in the cost function, as the optimization goes on, eventually $W _ { i n c }$ will null the input components that are not inside the linear subspace characterized by $F ^ { j }$ , hence $W _ { i n c } ^ { j } A ^ { j - 1 } x ^ { j }$ will converge to 0 as the algorithm proceeds. In addition, since $W ^ { j } = W ^ { j - 1 } + W _ { i n c } ^ { j }$ , (10) can be simplified to
114
+
115
+ $$
116
+ \nabla _ { { W _ { i n c } ^ { j } } } \mathcal { I } ( W _ { i n c } ^ { j } ) = 2 \mathbb { E } [ ( W ^ { j } x ^ { j } - y ^ { j } ) s ^ { \top } ] + 2 \lambda ^ { - 2 } W _ { i n c } ^ { j }
117
+ $$
118
+
119
+ Adding $W ^ { j - 1 }$ to both sides of (7), we obtain the update rule for $W ^ { j }$ :
120
+
121
+ $$
122
+ \begin{array} { r } { W ^ { j } W ^ { j } - 2 \eta \mathbb { E } [ e s ^ { \top } ] + 2 \eta \lambda ^ { - 2 } W _ { i n c } ^ { j } } \end{array}
123
+ $$
124
+
125
+ where $e : = W ^ { j } x ^ { j } - y ^ { j }$ . In practice, at every iteration, the expected value can be approximated by a mini-batch of size $n _ { B }$ , indexed by $i _ { B }$ :
126
+
127
+ $$
128
+ \hat { \mathbb { E } } [ e s ^ { \top } ] = \frac { 1 } { n _ { B } } \sum _ { i _ { B } = 0 } ^ { L } ( W ^ { j } x _ { i _ { B } } ^ { j } - y _ { i _ { B } } ^ { j } ) ( F ^ { j } x _ { i _ { B } } ^ { j } ) ^ { \top } = \frac { 1 } { n _ { B } } \sum _ { i _ { B } = 0 } ^ { L } ( W ^ { j } x _ { i _ { B } } ^ { j } - y _ { i _ { B } } ^ { j } ) x _ { i _ { B } } ^ { j ^ { \top } } F ^ { j ^ { \top } }
129
+ $$
130
+
131
+ where the transpose for $F ^ { j }$ can be dropped since it is symmetric.
132
+
133
+ If we only train the $j$ −th task without considering the previous tasks, the update rule given by normal SGD is
134
+
135
+ $$
136
+ W ^ { j } W ^ { j } - 2 \eta \mathbb { E } [ e x ^ { j \top } ] + 2 \eta \lambda ^ { - 2 } W ^ { j }
137
+ $$
138
+
139
+ Comparing this to the update rule in (12), we notice two modifications when a conceptor is adopted to avoid CI: first, the gradient of weights are calculated using the conceptor-projected input vector $s = F ^ { j } x ^ { j }$ instead of the original input vector $x ^ { j }$ ; second, regularization is done on the weight increment $W _ { i n c } ^ { j }$ rather than the final weight $W ^ { j }$ . These two modifications lead to our design of the conceptor-aided algorithm for training multilayer feed-forward networks.
140
+
141
+ # 3.2 BACKPROP
142
+
143
+ The basic idea of CAB is to guide the gradients of the loss function on every linear component of the network by a matrix conceptor computed from previous tasks during error back-propagation (Rumelhart et al., 1986), repeatedly applying the conceptor-aided SGD technique introduced in the previous section in every layer.
144
+
145
+ Consider a feed-forward network with $L + 1$ layers, indexed by $l = 0 , \ldots L$ , such that the 0-th and the $L$ -th layers are the input and output layers respectively. $W ^ { ( l ) }$ represents the linear connections between the $( l - 1 )$ -th and the $l$ -th layer, where we refer to the former as the pre-synaptic layer with respect to $W ^ { ( l ) }$ , and to the latter as the post-synaptic layer. We denote by $N ^ { ( l ) }$ the size of the $l$ -th layer (excluding the bias unit) and $A ^ { ( l ) ^ { j } }$ a conceptor characterizing the memory space in the $l$ -th layer used up by the first $j$ tasks. Let $\sigma ( \cdot )$ be the activation function of the nonlinear neurons and $\theta$ all the parameters of the network to be trained. Then the incremental training method with CAB proceeds as follows:
146
+
147
+ • Initialization (no task trained yet): $\forall l = 0 , \ldots , L - 1$ , $A ^ { ( l ) ^ { 0 } } : = 0 _ { ( N ^ { ( l ) } + 1 ) \times ( N ^ { ( l ) } + 1 ) }$ , and randomly initialize $W ^ { ( l + 1 ) ^ { 0 } }$ to be a matrix of size $\boldsymbol { N } ^ { ( l + 1 ) } \times \left( \boldsymbol { N } ^ { ( l ) } + 1 \right)$ .
148
+
149
+ • Incremental task learning: For $j = 1 , \ldots , m$ do:
150
+
151
+ 1. $\forall l = 0 , \ldots , L - 1 , F ^ { ( l ) ^ { j } } = \lnot A ^ { ( l ) ^ { ( j - 1 ) } }$ . (This conceptor characterizes the still disposable vector space in layer l for learning task $j$ )
152
+
153
+ 2. Update the network parameters $\theta ^ { ( j - 1 ) }$ obtained after training the first $j - 1$ tasks to $\theta ^ { j }$ by stochastic gradient descent, where the gradients are computed by CAB instead of the classical backprop. Algorithms 1 and 2 detail the forward and backward pass of CAB, respectively. Different from classical backprop, the gradients are guided by a matrix conceptor $F ^ { ( l ) ^ { j } }$ , such that in each layer only the activity in the still disposable memory space will contribute to the gradient. Note that the conceptors remain the same until convergence of the network for task $j$ .
154
+
155
+ 3. After training on the vectors, indexed by $i _ { B }$ $j$ -th task, run the forward procedure again on a batch of , taken from the $j$ -th training dataset, to collect activations $n _ { B }$ input $h _ { i _ { B } } ^ { ( l ) ^ { j } }$ of each layer into a $N ^ { ( l ) } \times n _ { B }$ sized matrix $H ^ { ( l ) ^ { j } }$ , and set the correlation matrix $\begin{array} { r } { R ^ { ( l ) ^ { j } } = \frac { \dot { 1 } } { n _ { B } } H ^ { ( l ) ^ { j } } ( H ^ { ( l ) ^ { j } } ) ^ { \top } } \end{array}$ .
156
+
157
+ 4. Compute a conceptor on the $l$ -th layer for the $j$ -th pattern by $C ^ { ( l ) ^ { j } } = R ^ { ( l ) ^ { j } } ( R ^ { ( l ) ^ { j } } +$ $\alpha ^ { - 2 } \hat { I } _ { N ^ { ( l ) } \times N ^ { ( l ) } } ) ^ { - 1 } , \forall l = 0 , \dots , L \bar { - } 1$ . Finding an optimal aperture can be done by a cross-validation search1.
158
+
159
+ 5. Update the conceptor for already used space in every layer: $A ^ { ( l ) ^ { j } } ~ = ~ A ^ { ( l ) ^ { j } } ~ \vee$ $C ^ { ( l ) ^ { j } } , \forall l = 0 , \dots , L - 1$ .
160
+
161
+ Algorithm 1 The forward procedure of conceptor-aided backprop, adapted from the traditional backprop. Input vectors are passed through a feed-forward network to compute the cost function. $\mathcal { L } ( \hat { y } ^ { j } , y ^ { j } )$ denotes the loss for the $j$ -th task, to which a regularizer $\Omega ( \theta _ { i n c } ^ { j } ) = \Omega ( \theta ^ { j } - \theta ^ { j - 1 } ) =$ $| | \theta ^ { j } - \theta ^ { j - 1 } | | _ { \mathrm { f r o } } ^ { 2 }$ is added to obtain the total cost $\mathcal { I }$ , where $\theta$ contains all the weights (biases are considered as weights connected to the bias units). The increment of parameters rather than the parameters themselves are regularized, similar to the conceptor-aided SGD.
162
+
163
+ Require: Network depth, $l$
164
+ Require: $W _ { . } ^ { ( l ) ^ { j } } , l \in \bar { \{ 1 , \ldots , L \} }$ , the weight matrices of the network
165
+ Require: $x ^ { j }$ , one input vector of the $j$ -th task
166
+ Require: $y ^ { j }$ , the target output for $x ^ { j }$
167
+ 1: $h ^ { ( 0 ) } = x ^ { j }$
168
+ 2: for $l = 1 , \dots L$ do 3: $b ^ { ( l ) } = [ h ^ { ( l - 1 ) \top } , 1 ] ^ { \top }$ , include the bias unit 4: $a ^ { ( l ) } = W ^ { ( l ) ^ { j } } b ^ { ( l ) }$ 5: $h ^ { ( l ) } = \sigma ( a ^ { ( l ) } )$
169
+ 6: end for
170
+ 7: ${ \hat { y } } ^ { j } = h ^ { ( l ) }$
171
+ 8: $\mathcal { I } = \mathcal { L } ( \hat { y } ^ { j } , y ^ { j } ) + \lambda \Omega ( \theta _ { i n c } ^ { j } )$
172
+
173
+ Algorithm 2 The backward procedure of conceptor-aided backprop for the $j$ -th task, adapted from the traditional backprop. The gradient $g$ of the loss function $\mathcal { L }$ on the activations $a ^ { ( l ) }$ represents the error for the linear transformation $W ^ { ( l ) ^ { j } }$ between the $( l - 1 )$ -th and the l−th layers. In the standard backprop algorithm, the gradient of $\mathcal { L }$ on $W ^ { ( l ) ^ { j } }$ is computed as an outer product of the post-synaptic errors $g$ and the pre-synaptic activities $\boldsymbol { h } ^ { ( l - 1 ) }$ . This resembles the computation of the gradient in the linear SGD algorithm, which motivates us to apply conceptors in a similar fashion as in the conceptor-aided SGD. Specifically, we project the gradient $\nabla _ { W ^ { ( l ) } } j \mathcal { L }$ by the matrix conceptor F (l−1) that indicates the free memory space on the pre-synaptic layer.
174
+
175
+ 1:
176
+
177
+ $$
178
+ \boldsymbol { g } \gets \nabla _ { \boldsymbol { \hat { y } } } \mathcal { I } = \nabla _ { \boldsymbol { \hat { y } } } \mathcal { L } ( \boldsymbol { \hat { y } } , \boldsymbol { y } )
179
+ $$
180
+
181
+ 2: for $l = L , L - 1 , \ldots , 1$ do
182
+
183
+ 3: Convert the gradient on the layer’s output into a gradient on the pre-nonlinearity activation ( $\odot$ denotes element-wise multiplication):
184
+
185
+ $$
186
+ g \nabla _ { a ^ { ( l ) } } \mathcal { I } = g \odot \sigma ^ { \prime } ( a ^ { ( l ) } )
187
+ $$
188
+
189
+ 4: Compute the gradient of weights, project it by $F ^ { ( l - 1 ) ^ { j } }$ , and add it to the regularization term on the increment:
190
+
191
+ $$
192
+ \begin{array} { l } { { \nabla _ { W ^ { ( l ) ^ { j } } } \mathcal { I } = g \big ( F ^ { ( l - 1 ) ^ { j } } b ^ { ( l - 1 ) } \big ) ^ { \top } + \lambda \nabla _ { W ^ { ( l ) ^ { j } } } \Omega \big ( \theta _ { i n c } ^ { j } \big ) = g b ^ { ( l - 1 ) ^ { \top } } F ^ { ( l - 1 ) ^ { j } } + 2 \lambda W _ { i n c } ^ { ( l ) ^ { j } } } } \\ { { \quad \quad = g b ^ { ( l - 1 ) ^ { \top } } F ^ { ( l - 1 ) ^ { j } } + 2 \lambda \big ( W ^ { ( l ) ^ { j } } - W ^ { ( l ) ^ { j - 1 } } \big ) } } \end{array}
193
+ $$
194
+
195
+ 5: Propagate the gradients w.r.t. the next lower-level hidden layers activations:
196
+
197
+ $$
198
+ g \gets \nabla _ { h ^ { ( l - 1 ) } } \mathcal { I } = W ^ { ( l ) ^ { j } } { } ^ { \top } g
199
+ $$
200
+
201
+ 6: end for
202
+
203
+ ![](images/1eda451ad86ac6f785232ef35b6928bbd7acc61b0179a85d29239e094465def7.jpg)
204
+ Figure 3: Average performance across already learned permuted MNIST tasks using CAB or EWC
205
+
206
+ # 4 EXPERIMENTS
207
+
208
+ # 4.1 PERMUTED MNIST EXPERIMENT
209
+
210
+ To test the performance of CAB, we evaluated it on the permuted MNIST experiment (Srivastava et al., 2013; Goodfellow et al., 2014; Kirkpatrick et al., 2017; Lee et al., 2017), where a sequence of pattern recognition tasks are created from the MNIST dataset (LeCun et al., 1998). For each task, a random permutation of input image pixels is generated and applied to all images in MNIST to obtain a new shuffled dataset, equally difficult to recognize as the original one, the objective of each task is to recognize these images with shuffled pixels.
211
+
212
+ For a proof-of-concept demonstration, we trained a simple but sufficient feed-forward network with [784-100-10] of neurons to classify 10 permuted MNIST datasets. The network has logistic sigmoid neurons in both hidden and output layers, and is trained with mean squared error as the cost function. Vanilla SGD was used in all experiments to optimize the cost function. Learning rate and aperture were set to 0.1 and 4, respectively. For comparison, we also tested EWC on the same task with the same network architecture, based on the implementation by Seff (2017). The parameters chosen for the EWC algorithm were 0.01 for the learning rate and 15 for the weight of the Fisher penalty term. Figure 3 shows the performance of CAB on this task, the average testing accuracy is $9 5 . 2 \%$ after learning all 10 tasks sequentially. Although a fair amount of effort was spent on searching for optimal parameters for EWC, the accuracies shown here might still not reflect its best performance. However, the same experiment with EWC was also conducted in Kemker et al. (2017), where the authors reimplemented EWC on a network with higher capacity (2 hidden layers and 400 ReLU neurons per layer) and the resulting average accuracy after learning 10 tasks sequentially was shown to be around $93 \%$ .
213
+
214
+ Since all tasks are generated by permuting the same dataset, the portion of the input space occupied by each of them should have the same size. However, as more tasks are learned, the chance that the space of a new task will overlap with the already used input space increases. Figure 4 shows the singular value spectra and quota of the input and hidden layer conceptors every time after a new task is learned. As the incremental learning proceeds, it becomes less likely for a new task to be in the free space. For example, the second task increases the quota of the input layer memory space by 0.1, whereas the 10th task increases it by only 0.03. However, CAB still manages to make the network learn new tasks based on their input components in the non-overlapping space.
215
+
216
+ ![](images/53ed68df2db8177a3a69102033ca7c87cdf1a0c0aff09975806a8fe949298c3e.jpg)
217
+ (b) Singular value spectra of conceptors $A ^ { ( 1 ) ^ { j } }$ on the hidden layer.
218
+ Figure 4: The development of singular value spectra of conceptors for “used-up” space on the input layer and hidden layer during incremental learning of 10 permuted MNIST tasks. Quota of these conceptors are displayed in the legends.
219
+
220
+ # 4.2 DISJOINT MNIST EXPERIMENT
221
+
222
+ We then applied CAB to categorize the disjoint MNIST datasets into 10 classes (Srivastava et al., 2013; Lee et al., 2017). In this experiment, the original MNIST dataset is divided into two disjoint datasets with the first one consisting of data for the first five digits (0 to 4), and the second one of the remaining five digits (5 to 9). This task requires a network to learn these two datasets one after the other, then examines its performance of classifying the entire MNIST testing images into 10 classes. The current state-of-the-art accuracy on this task, averaged over 10 learning trials, is $9 4 . 1 2 ( \pm 0 . 2 7 ) \%$ , achieved by Lee et al. (2017) using IMM. They also tested EWC on the same task and the average accuracy was $5 2 . 7 2 ( \pm 1 . 3 6 ) \%$ .
223
+
224
+ To test our method, we trained a feed-forward network with [784-800-10] neurons. Logistic sigmoid nonlinearities were used in both hidden and output layers, and the network was trained with vanilla SGD to minimize mean squared errors. The aperture $\alpha = 9$ was used for all conceptors on all layers, learning rate $\eta$ and regularization coefficient $\lambda$ were chosen to be 0.1 and 0.005 respectively. The accuracy of CAB on this task, measured by repeating the experiment 10 times, is $9 4 . 9 1 ( \pm 0 . { \dot { 3 } } 0 ) \%$ . It is worth mentioning that the network used by Lee et al. (2017) for testing IMM and EWC had [784-800-800-10] rectified linear units (ReLU), so CAB achieved better performance with fewer layers and neurons.
225
+
226
+ # 4.3 COMPUTATIONAL COST
227
+
228
+ If a conceptor is computed by ridge regression, the time complexity is $O ( n N ^ { 2 } + N ^ { 3 } )$ when the design matrix is dense, where $n$ is the number of samples and $N$ the number of features. In terms of wall time measures, the time taken to compute a conceptor from the entire MNIST training set (in this case, $n = 5 5 0 0 0$ images and $N = 7 8 4$ pixels, corresponding to the input layer in our networks) is 0.42 seconds of standard notebook CPU time on average. Although we did not implement it in these experiments, incremental online adaptation of conceptors by gradient descent is also possible in principle and would come at a cost of $\dot { O ( N ^ { 2 } ) }$ per update.
229
+
230
+ # 5 CONCLUSION
231
+
232
+ In this work, we first reviewed the conceptor-based incremental ridge regression algorithm, introduced in section 3.11 of Jaeger (2014) for memory management in recurrent neural networks. Then we derived its stochastic gradient descent version for optimizing the same objective. Finally we designed a conceptor-aided backprop algorithm by applying a conceptor to every linear layer of a feed-forward network. This method uses conceptors to guide gradients of parameters during the backpropagation procedure. As a result, learning a new task interferes only minimally with previously learned tasks, and the amount of already used network capacity can be monitored via the singular value spectra and quota of conceptors.
233
+
234
+ In Jaeger (2014), different scenarios for continual learning are investigated in a reservoir computing setting. Two extreme cases are obtained when (i) the involved learning tasks are entirely unrelated to each other, versus (ii) all tasks come from the same parametric family of learning tasks. The two cases differ conspicuously with regards to the geometry of involved conceptors, and with regards to opportunities to re-use previously acquired functionality in subsequent learning episodes. The permuted MNIST task is an example of (i) while the disjoint MNIST task rather is of type (ii). Conceptors provide an analytical tool to discuss the “family relatedness” and enabling/disabling conditions for continual learning in geometrical terms. Ongoing and future research is devoted to a comprehensive mathematical analysis of these phenomena which in our view lie at the heart of understanding continual learning.
235
+
236
+ # ACKNOWLEDGMENTS
237
+
238
+ The work reported in this article was partly funded through the European H2020 collaborative project NeuRAM3 (grant Nr 687299).
239
+
240
+ # REFERENCES
241
+
242
+ Bernard Ans and Stephane Rousset. Avoiding catastrophic forgetting by coupling two reverberating ´ neural networks. Comptes Rendus de l’Academie des Sciences-Series III-Sciences de la Vie ´ , 320 (12):989–997, 1997.
243
+
244
+ Robert M French. Using semi-distributed representations to overcome catastrophic forgetting in connectionist networks. Proceedings of the 13th Annual Cognitive Science Society Conference, pp. 173178, 1991.
245
+
246
+ Robert M French. Pseudo-recurrent connectionist networks: An approach to the ‘sensitivitystability’ dilemma. Connection Science, 9(4):353–380, 1997.
247
+
248
+ Robert M French. Catastrophic forgetting in connectionist networks. Trends in Cognitive Sciences, 3(4):128–135, 1999.
249
+
250
+ Ian J Goodfellow, Mehdi Mirza, Da Xiao, Aaron Courville, and Yoshua Bengio. An empirical investigation of catastrophic forgetting in gradient-based neural networks. International Conference on Learning Representations, 2014.
251
+
252
+ Geoffrey E Hinton and David C Plaut. Using fast weights to deblur old memories. In Proceedings of the Ninth Annual Conference of the Cognitive Science Society, pp. 177–186. Lawrence Erlbaum Associates, 1987.
253
+
254
+ Herbert Jaeger. The echo state approach to analysing and training recurrent neural networks-with an erratum note. German National Research Center for Information Technology GMD Technical Report, 148(34):13, 2001.
255
+
256
+ Herbert Jaeger. Controlling recurrent neural networks by conceptors. Jacobs University Technical Reports, (31), 2014. https://arxiv.org/abs/1403.3369.
257
+
258
+ Herbert Jaeger. Using conceptors to manage neural long-term memories for temporal patterns. Journal of Machine Learning Research, 18(13):1–43, 2017. URL http://jmlr.org/papers/ v18/15-449.html.
259
+
260
+ Ronald Kemker, Angelina Abitino, Marc McClure, and Christopher Kanan. Measuring catastrophic forgetting in neural networks. Computing Research Repository, abs/1708.02072, 2017. http: //arxiv.org/abs/1708.02072.
261
+
262
+ James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A. Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, Demis Hassabis, Claudia Clopath, Dharshan Kumaran, and Raia Hadsell. Overcoming catastrophic forgetting in neural networks. Proceedings of the National Academy of Sciences, 114(13):3521, 2017.
263
+
264
+ Dharshan Kumaran, Demis Hassabis, and James L McClelland. What learning systems do intelligent agents need? complementary learning systems theory updated. Trends in Cognitive Sciences, 20 (7):512–534, 2016.
265
+
266
+ Yann LeCun, Corinna Cortes, and Christopher JC Burges. The MNIST database of handwritten digits. 1998. http://yann.lecun.com/exdb/mnist/.
267
+
268
+ Sang-Woo Lee, Jin-Hwa Kim, JungWoo Ha, and Byoung-Tak Zhang. Overcoming catastrophic forgetting by incremental moment matching. Computing Research Repository, abs/1703.08475, 2017. http://arxiv.org/abs/1703.08475.
269
+
270
+ Wolfgang Maass, Thomas Natschlager, and Henry Markram. Real-time computing without stable ¨ states: A new framework for neural computation based on perturbations. Neural Computation, 14(11):2531–2560, 2002.
271
+
272
+ Michael McCloskey and Neal J Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. Psychology of Learning and Motivation, 24:109–165, 1989.
273
+
274
+ Roger Ratcliff. Connectionist models of recognition memory: Constraints imposed by learning and forgetting functions. Psychological Review, 97(2):285–308, 1990.
275
+
276
+ David E Rumelhart, Geoffrey E Hinton, and Ronald J Williams. Learning representations by backpropagating errors. Nature, 323:533–535, 1986.
277
+ Ari Seff. Implementation of overcoming catastrophic forgetting in neural networks in tensorflow. GitHub Repository, 2017. https://github.com/ariseff/ overcoming-catastrophic.
278
+ Rupesh K Srivastava, Jonathan Masci, Sohrob Kazerounian, Faustino Gomez, and Jurgen Schmid- ¨ huber. Compete to compute. In Advances in Neural Information Processing Systems, pp. 2310– 2318, 2013. http://papers.nips.cc/paper/5059-compete-to-compute.pdf.
279
+ Vipin Srivastava, Suchitra Sampath, and David J Parker. Overcoming catastrophic interference in connectionist networks using Gram-Schmidt orthogonalization. PloS ONE, 9(9):e105619, 2014.
md/train/B1ewdt9xe/B1ewdt9xe.md ADDED
@@ -0,0 +1,301 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DEEP PREDICTIVE CODING NETWORKS FOR VIDEO PREDICTION AND UNSUPERVISED LEARNING
2
+
3
+ William Lotter, Gabriel Kreiman & David Cox
4
+ Harvard University
5
+ Cambridge, MA 02215, USA
6
+ {lotter,davidcox}@fas.harvard.edu
7
+ gabriel.kreiman@tch.harvard.edu
8
+
9
+ # ABSTRACT
10
+
11
+ While great strides have been made in using deep learning algorithms to solve supervised learning tasks, the problem of unsupervised learning — leveraging unlabeled examples to learn about the structure of a domain — remains a difficult unsolved challenge. Here, we explore prediction of future frames in a video sequence as an unsupervised learning rule for learning about the structure of the visual world. We describe a predictive neural network (“PredNet”) architecture that is inspired by the concept of “predictive coding” from the neuroscience literature. These networks learn to predict future frames in a video sequence, with each layer in the network making local predictions and only forwarding deviations from those predictions to subsequent network layers. We show that these networks are able to robustly learn to predict the movement of synthetic (rendered) objects, and that in doing so, the networks learn internal representations that are useful for decoding latent object parameters (e.g. pose) that support object recognition with fewer training views. We also show that these networks can scale to complex natural image streams (car-mounted camera videos), capturing key aspects of both egocentric movement and the movement of objects in the visual scene, and the representation learned in this setting is useful for estimating the steering angle. Altogether, these results suggest that prediction represents a powerful framework for unsupervised learning, allowing for implicit learning of object and scene structure.
12
+
13
+ # 1 INTRODUCTION
14
+
15
+ Many of the most successful current deep learning architectures for vision rely on supervised learning from large sets of labeled training images. While the performance of these networks is undoubtedly impressive, reliance on such large numbers of training examples limits the utility of deep learning in many domains where such datasets are not available. Furthermore, the need for large numbers of labeled examples stands at odds with human visual learning, where one or a few views of an object is often all that is needed to enable robust recognition of that object across a wide range of different views, lightings and contexts. The development of a representation that facilitates such abilities, especially in an unsupervised way, is a largely unsolved problem.
16
+
17
+ In addition, while computer vision models are typically trained using static images, in the real world, visual objects are rarely experienced as disjoint snapshots. Instead, the visual world is alive with movement, driven both by self-motion of the viewer and the movement of objects within the scene. Many have suggested that temporal experience with objects as they move and undergo transformations can serve as an important signal for learning about the structure of objects (Foldi ¨ ak, 1991; ´ Softky, 1996; Wiskott & Sejnowski, 2002; George & Hawkins, 2005; Palm, 2012; O’Reilly et al., 2014; Agrawal et al., 2015; Goroshin et al., 2015a; Lotter et al., 2015; Mathieu et al., 2016; Srivastava et al., 2015; Wang & Gupta, 2015; Whitney et al., 2016). For instance, Wiskott and Sejnowski proposed “slow feature analysis” as a framework for exploiting temporal structure in video streams (Wiskott & Sejnowski, 2002). Their approach attempts to build feature representations that extract slowly-varying parameters, such as object identity, from parameters that produce fast changes in the image, such as movement of the object. While approaches that rely on temporal coherence have arguably not yet yielded representations as powerful as those learned by supervised methods, they nonetheless point to the potential of learning useful representations from video (Mohabi et al., 2009; Sun et al., 2014; Goroshin et al., 2015a; Maltoni & Lomonaco, 2015; Wang & Gupta, 2015).
18
+
19
+ Here, we explore another potential principle for exploiting video for unsupervised learning: prediction of future image frames (Softky, 1996; Palm, 2012; O’Reilly et al., 2014; Goroshin et al., 2015b; Srivastava et al., 2015; Mathieu et al., 2016; Patraucean et al., 2015; Finn et al., 2016; Vondrick et al., 2016). A key insight here is that in order to be able to predict how the visual world will change over time, an agent must have at least some implicit model of object structure and the possible transformations objects can undergo. To this end, we have designed a neural network architecture, which we informally call a “PredNet,” that attempts to continually predict the appearance of future video frames, using a deep, recurrent convolutional network with both bottom-up and topdown connections. Our work here builds on previous work in next-frame video prediction (Ranzato et al., 2014; Michalski et al., 2014; Srivastava et al., 2015; Mathieu et al., 2016; Lotter et al., 2015; Patraucean et al., 2015; Oh et al., 2015; Finn et al., 2016; Xue et al., 2016; Vondrick et al., 2016; Brabandere et al., 2016), but we take particular inspiration from the concept of “predictive coding” from the neuroscience literature (Rao & Ballard, 1999; Rao & Sejnowski, 2000; Lee & Mumford, 2003; Friston, 2005; Summerfield et al., 2006; Egner et al., 2010; Bastos et al., 2012; Spratling, 2012; Chalasani & Principe, 2013; Clark, 2013; O’Reilly et al., 2014; Kanai et al., 2015). Predictive coding posits that the brain is continually making predictions of incoming sensory stimuli (Rao & Ballard, 1999; Friston, 2005). Top-down (and perhaps lateral) connections convey these predictions, which are compared against actual observations to generate an error signal. The error signal is then propagated back up the hierarchy, eventually leading to an update of the predictions.
20
+
21
+ We demonstrate the effectiveness of our model for both synthetic sequences, where we have access to the underlying generative model and can investigate what the model learns, as well as natural videos. Consistent with the idea that prediction requires knowledge of object structure, we find that these networks successfully learn internal representations that are well-suited to subsequent recognition and decoding of latent object parameters (e.g. identity, view, rotation speed, etc.). We also find that our architecture can scale effectively to natural image sequences, by training using car-mounted camera videos. The network is able to successfully learn to predict both the movement of the camera and the movement of objects in the camera’s view. Again supporting the notion of prediction as an unsupervised learning rule, the model’s learned representation in this setting supports decoding of the current steering angle.
22
+
23
+ ![](images/96a1440b9f8c8bf098c1b691d0dce930f9e50a5bd99be7f869e6ae09b81b7762.jpg)
24
+ Figure 1: Predictive Coding Network (PredNet). Left: Illustration of information flow within two layers. Each layer consists of representation neurons $( R _ { l } )$ , which output a layer-specific prediction at each time step $( \hat { A } _ { l } )$ , which is compared against a target $( A _ { l } )$ (Bengio, 2014) to produce an error term $( E _ { l } )$ , which is then propagated laterally and vertically in the network. Right: Module operations for case of video sequences.
25
+
26
+ # 2 THE PREDNET MODEL
27
+
28
+ The PredNet architecture is diagrammed in Figure 1. The network consists of a series of repeating stacked modules that attempt to make local predictions of the input to the module, which is then subtracted from the actual input and passed along to the next layer. Briefly, each module of the network consists of four basic parts: an input convolutional layer $( A _ { l } )$ , a recurrent representation layer $( R _ { l } )$ , a prediction layer $( \hat { \hat { A } } _ { l } )$ , and an error representation $( E _ { l } )$ . The representation layer, $R _ { l }$ , is a recurrent convolutional network that generates a prediction, $\hat { A } _ { l }$ , of what the layer input, $A _ { l }$ , will be on the next frame. The network takes the difference between $A _ { l }$ and $\hat { A } _ { l }$ and outputs an error representation, $E _ { l }$ , which is split into separate rectified positive and negative error populations. The error, $E _ { l }$ , is then passed forward through a convolutional layer to become the input to the next layer $( A _ { l + 1 } )$ . The recurrent prediction layer $R _ { l }$ receives a copy of the error signal $E _ { l }$ , along with top-down input from the representation layer of the next level of the network $( R _ { l + 1 } )$ . The organization of the network is such that on the first time step of operation, the “right” side of the network ( $A _ { l }$ ’s and $E _ { l }$ ’s) is equivalent to a standard deep convolutional network. Meanwhile, the “left” side of the network (the $R _ { l }$ ’s) is equivalent to a generative deconvolutional network with local recurrence at each stage. The architecture described here is inspired by that originally proposed by (Rao & Ballard, 1999), but is formulated in a modern deep learning framework and trained end-to-end using gradient descent, with a loss function implicitly embedded in the network as the firing rates of the error neurons. Our work also shares motivation with the Deep Predictive Coding Networks of Chalasani & Principe (2013); however, their framework is based upon sparse coding and a linear dynamical system with greedy layer-wise training, whereas ours is rooted in convolutional and recurrent neural networks trained with backprop.
29
+
30
+ While the architecture is general with respect to the kinds of data it models, here we focus on image sequence (video) data. Consider a sequence of images, $x _ { t }$ . The target for the lowest layer is set to the the actual sequence itself, i.e. $\bar { A } _ { 0 } ^ { t } = x _ { t } \forall t$ . The targets for higher layers, $A _ { l } ^ { t }$ for $l > 0$ , are computed by a convolution over the error units from the layer below, $E _ { l - 1 } ^ { t }$ , followed by rectified linear unit (ReLU) activation and max-pooling. For the representation neurons, we specifically use convolutional LSTM units (Hochreiter & Schmidhuber, 1997; Shi et al., 2015). In our setting, the $R _ { l } ^ { t }$ hidden state is updated according to $R _ { l } ^ { t - 1 }$ , $E _ { l } ^ { t - 1 }$ , as well as $R _ { l + 1 } ^ { t }$ , which is first spatially upsampled (nearest-neighbor), due to the pooling present in the feedforward path. The predictions, $\hat { A } _ { l } ^ { t }$ are made through a convolution of the $R _ { l } ^ { t }$ stack followed by a ReLU non-linearity. For the lowest layer, $\hat { A } _ { l } ^ { t }$ is also passed through a saturating non-linearity set at the maximum pixel value: $\operatorname { S a t L U } ( x ; p _ { m a x } ) : = \operatorname* { m i n } ( p _ { m a x } , x )$ . Finally, the error response, $E _ { l } ^ { t }$ , is calculated from the difference between $\hat { A } _ { l } ^ { t }$ and $A _ { l } ^ { t }$ and is split into ReLU-activated positive and negative prediction errors, which are concatenated along the feature dimension. As discussed in (Rao & Ballard, 1999), although not explicit in their model, the separate error populations are analogous to the existence of on-center, off-surround and off-center, on-surround neurons early in the visual system.
31
+
32
+ The full set of update rules are listed in Equations (1) to (4). The model is trained to minimize the weighted sum of the activity of the error units. Explicitly, the training loss is formalized in Equation 5 with weighting factors by time, $\lambda _ { t }$ , and layer, $\lambda _ { l }$ , and where $n _ { l }$ is the number of units in the lth layer. With error units consisting of subtraction followed by ReLU activation, the loss at each layer is equivalent to an L1 error. Although not explored here, other error unit implementations, potentially even probabilistic or adversarial (Goodfellow et al., 2014), could also be used.
33
+
34
+ $$
35
+ \begin{array} { r l } & { A _ { l } ^ { t } = \bigg \{ x _ { t } } & { \mathrm { i f } l = 0 } \\ & { \mathbf { M } _ { \mathrm { A X P o o L } } ( \operatorname { R E L U } ( \operatorname { C o N v } ( E _ { l - 1 } ^ { t } ) ) ) } & { l > 0 } \\ & { \hat { A } _ { l } ^ { t } = \operatorname { R E L U } ( \operatorname { C o N v } ( R _ { l } ^ { t } ) ) } \\ & { E _ { l } ^ { t } = [ \operatorname { R E L U } ( A _ { l } ^ { t } - \hat { A } _ { l } ^ { t } ) ; \operatorname { R E L U } ( \hat { A } _ { l } ^ { t } - A _ { l } ^ { t } ) ] } \\ & { R _ { l } ^ { t } = \operatorname { C o N v L S T M } ( E _ { l } ^ { t - 1 } , R _ { l } ^ { t - 1 } , \operatorname { U P S A M P L E } ( R _ { l + 1 } ^ { t } ) ) } \end{array}
36
+ $$
37
+
38
+ $$
39
+ L _ { t r a i n } = \sum _ { t } \lambda _ { t } \sum _ { l } \frac { \lambda _ { l } } { n _ { l } } \sum _ { n _ { l } } E _ { l } ^ { t }
40
+ $$
41
+
42
+ # Algorithm 1 Calculation of PredNet states
43
+
44
+ <table><tr><td>Require: Xt</td><td></td></tr><tr><td>1:A←xt 2:</td><td>E,R←0</td></tr><tr><td>3:</td><td>fort=1 to Tdo</td></tr><tr><td>4:</td><td>for l = L to O do</td></tr><tr><td>5:</td><td>if l=L then</td></tr><tr><td>6:</td><td>Rt =CONVLSTM(Et-1,Rt-1)</td></tr><tr><td>7:</td><td>else</td></tr><tr><td>8:</td><td>Rt = CONVLSTM(E𝑡-1,Rt-1,UPSAMPLE(Rt+1))</td></tr><tr><td>9:</td><td>for l= O to L do</td></tr><tr><td>10:</td><td>if l= O then</td></tr><tr><td>11:</td><td>At = SATLU(RELU(CONV(Rδ)))</td></tr><tr><td>12:</td><td>else</td></tr><tr><td>13:</td><td>At = RELU(CoNv(Rt))</td></tr><tr><td>14:</td><td>Et = [RELU(At - At); RELU(At - A)]</td></tr><tr><td>15:</td><td>ifl&lt;L then</td></tr><tr><td>16:</td><td>At+1 = MAXPOOL(CONV(E))</td></tr></table>
45
+
46
+ The order in which each unit in the model is updated must also be specified, and our implementation is described in Algorithm 1. Updating of states occurs through two passes: a top-down pass where the $R _ { l } ^ { t }$ states are computed, and then a forward pass to calculate the predictions, errors, and higher level targets. A last detail of note is that $R _ { l }$ and $E _ { l }$ are initialized to zero, which, due to the convolutional nature of the network, means that the initial prediction is spatially uniform.
47
+
48
+ # 3 EXPERIMENTS
49
+
50
+ # 3.1 RENDERED IMAGE SEQUENCES
51
+
52
+ To gain an understanding of the representations learned in the proposed framework, we first trained PredNet models using synthetic images, for which we have access to the underlying generative stimulus model and all latent parameters. We created sequences of rendered faces rotating with two degrees of freedom, along the “pan” (out-of-plane) and “roll” (in-plane) axes. The faces start at a random orientation and rotate at a random constant velocity for a total of 10 frames. A different face was sampled for each sequence. The images were processed to be grayscale, with values normalized between 0 and 1, and 64x64 pixels in size. We used 16K sequences for training and 800 for both validation and testing.
53
+
54
+ Predictions generated by a PredNet model are shown in Figure 2. The model is able to accumulate information over time to make accurate predictions of future frames. Since the representation neurons are initialized to zero, the prediction at the first time step is uniform. On the second time step, with no motion information yet, the prediction is a blurry reconstruction of the first time step. After further iterations, the model adapts to the underlying dynamics to generate predictions that closely match the incoming frame.
55
+
56
+ For choosing the hyperparameters of the model, we performed a random search and chose the model that had the lowest L1 error in frame prediction averaged over time steps 2-10 on a validation set. Given this selection criteria, the best performing models tended to have a loss solely concentrated at the lowest layer (i.e. $\lambda _ { 0 } = 1$ , $\lambda _ { l > 0 } = 0 $ ), which is the case for the model shown. Using an equal loss at each layer considerably degraded predictions, but enforcing a moderate loss on upper layers that was one magnitude smaller than the lowest layer (i.e. $\lambda _ { 0 } = 1$ , $\lambda _ { l > 0 } = 0 . 1$ ) led to only slightly worse predictions, as illustrated in Figure 9 in the Appendix. In all cases, the time loss weight, $\lambda _ { t }$ , was set to zero for the first time step and then one for all time steps after. As for the remaining hyperparameters, the model shown has 5 layers with 3x3 filter sizes for all convolutions, max-pooling of stride 2, and number of channels per layer, for both $A _ { l }$ and $R _ { l }$ units, of (1, 32, 64, 128, 256). Model weights were optimized using the Adam algorithm (Kingma & Ba, 2014).
57
+
58
+ ![](images/47e158f8ba016838740a961f995997b73a4e432fd723f2faa4ecb1fae041441c.jpg)
59
+ time
60
+ Figure 2: PredNet next-frame predictions for sequences of rendered faces rotating with two degrees of freedom. Faces shown were not seen during training.
61
+
62
+ Quantitative evaluation of generative models is a difficult, unsolved problem (Theis et al., 2016), but here we report prediction error in terms of meansquared error (MSE) and the Structural Similarity Index Measure (SSIM) (Wang et al., 2004). SSIM is designed to be more correlated with perceptual judgments, and ranges from $- 1$ and 1, with a larger score indicating greater similarity. We compare the PredNet to the trivial solution of copying the last frame, as well as a control model that shares the overall architecture and training scheme of the PredNet, but that sends forward the layer-wise activations $( A _ { l } )$ rather than the errors $( E _ { l } )$ . This model thus takes the form of a more traditional encoder-decoder pair, with a CNN encoder that has lateral skip connections to a convolutional LSTM decoder. The performance of all models on the rotating faces dataset is summarized in Table 1, where the scores were calculated as an average over all predictions after the first frame. We report results for the PredNet model trained with loss only on the lowest layer, denoted as PredNet $L _ { 0 }$ , as well as the model trained with an 0.1 weight on upper layers, denoted as PredNet $L _ { a l l }$ . Both PredNet models outperformed the baselines on both measures, with the $L _ { 0 }$ model slightly outperforming $L _ { a l l }$ , as expected for evaluating the pixel-level predictions.
63
+
64
+ Table 1: Evaluation of next-frame predictions on Rotating Faces Dataset (test set).
65
+
66
+ <table><tr><td></td><td>MSE</td><td>SSIM</td></tr><tr><td>PredNet Lo</td><td>0.0152</td><td>0.937</td></tr><tr><td>PredNet Lall</td><td>0.0157</td><td>0.921</td></tr><tr><td>CNN-LSTM Enc.-Dec.</td><td>0.0180</td><td>0.907</td></tr><tr><td>Copy Last Frame</td><td>0.125</td><td>0.631</td></tr></table>
67
+
68
+ Synthetic sequences were chosen as the initial training set in order to better understand what is learned in different layers of the model, specifically with respect to the underlying generative model (Kulkarni et al., 2015). The rotating faces were generated using the FaceGen software package (Singular Inversions, Inc.), which internally generates 3D face meshes by a principal component analysis in “face space”, derived from a corpus of 3D face scans. Thus, the latent parameters of the image sequences used here consist of the initial pan and roll angles, the pan and roll velocities, and the principal component (PC) values, which control the “identity” of the face. To understand the information contained in the trained models, we decoded the latent parameters from the representation neurons $( R _ { l } )$ in different layers, using a ridge regression. The $R _ { l }$ states were taken at the earliest possible informative time steps, which, in the our notation, are the second and third steps, respectively, for the static and dynamic parameters. The regression was trained using $4 K$ sequences with 500 for validation and $1 K$ for testing. For a baseline comparison of the information implicitly embedded in the network architecture, we compare to the decoding accuracies of an untrained network with random initial weights. Note that in this randomly initialized case, we still expect above-chance decoding performance, given past theoretical and empirical work with random networks (Pinto et al., 2009; Jarrett et al., 2009; Saxe et al., 2010).
69
+
70
+ Latent variable decoding accuracies of the pan and roll velocities, pan initial angle, and first PC are shown in the left panel of Figure 3. There are several interesting patterns. First, the trained models learn a representation that generally permits a better linear decoding of the underlying latent factors than the randomly initialized model, with the most striking difference in terms of the the pan rotation speed $( \alpha _ { p a n } )$ . Second, the most notable difference between the $L _ { a l l }$ and $L _ { 0 }$ versions occurs with the first principle component, where the model trained with loss on all layers has a higher decoding accuracy than the model trained with loss only on the lowest layer.
71
+
72
+ ![](images/0abef2797da5fa19f50184da371c6feb85f35b1d2b18d3d978fa3150145a690d.jpg)
73
+ Figure 3: Information contained in PredNet representation for rotating faces sequences. Left: Decoding of latent variables using a ridge regression $( \alpha _ { p a n }$ : pan (out-of-frame) angular velocity, $\theta _ { p a n }$ : pan angle, PC-1: first principal component of face, $\alpha _ { r o l l }$ : roll (in-frame) angular velocity). Right: Orientation-invariant classification of static faces.
74
+
75
+ The latent variable decoding analysis suggests that the model learns a representation that may generalize well to other tasks for which it was not explicitly trained. To investigate this further, we assessed the models in a classification task from single, static images. We created a dataset of 25 previously unseen FaceGen faces at 7 pan angles, equally spaced between $[ - \frac { \pi } { 2 } , \frac { \pi } { 2 } ]$ , and 8 roll angles, equally spaced between $[ 0 , 2 \pi )$ . There were therefore orientations per identity, which were tested in a cross-validated fashion. A linear SVM to decode face identity was fit on a model’s representation of a random subset of orientations and then tested on the remaining angles. For each size of the SVM training set, ranging from 1-40 orientations per face, 50 different random splits were generated, with results averaged over the splits.
76
+
77
+ For the static face classification task, we compare the PredNets to a standard autoencoder and a variant of the Ladder Network (Valpola, 2015; Rasmus et al., 2015). Both models were constructed to have the same number of layers and channel sizes as the PredNets, as well as a similar alternating convolution/max-pooling, then upsampling/convolution scheme. As both networks are autoencoders, they were trained with a reconstruction loss, with a dataset consisting of all of the individual frames from the sequences used to train the PredNets. For the Ladder Network, which is a denoising autoencoder with lateral skip connections, one must also choose a noise parameter, as well as the relative weights of each layer in the total cost. We tested noise levels ranging from 0 to 0.5 in increments of 0.1, with loss weights either evenly distributed across layers, solely concentrated at the pixel layer, or 1 at the bottom layer and 0.1 at upper layers (analogous to the PredNet $L _ { a l l }$ model). Shown is the model that performed best for classification, which consisted of 0.4 noise and only pixel weighting. Lastly, as in our architecture, the Ladder Network has lateral and top-down streams that are combined by a combinator function. Inspired by (Pezeshki et al., 2015), where a learnable MLP improved results, and to be consistent in comparing to the PredNet, we used a purely convolutional combinator. Given the distributed representation in both networks, we decoded from a concatenation of the feature representations at all layers, except the pixel layer. For the PredNets, the representation units were used and features were extracted after processing one input frame.
78
+
79
+ Face classification accuracies using the representations learned by the $L _ { 0 }$ and $L _ { a l l }$ PredNets, a standard autoencoder, and a Ladder Network variant are shown in the right panel of Figure 3. Both PredNets compare favorably to the other models at all sizes of the training set, suggesting they learn a representation that is relatively tolerant to object transformations. Similar to the decoding accuracy of the first principle component, the PredNet $L _ { a l l }$ model actually outperformed the $L _ { 0 }$ variant. Altogether, these results suggest that predictive training with the PredNet can be a viable alternative to other models trained with a more traditional reconstructive or denoising loss, and that the relative layer loss weightings $( \lambda _ { l } ^ { } \mathbf { \dot { s } } )$ may be important for the particular task at hand.
80
+
81
+ # 3.2 NATURAL IMAGE SEQUENCES
82
+
83
+ We next sought to test the PredNet architecture on complex, real-world sequences. As a testbed, we chose car-mounted camera videos, since these videos span across a wide range of settings and are characterized by rich temporal dynamics, including both self-motion of the vehicle and the motion of other objects in the scene (Agrawal et al., 2015). Models were trained using the raw videos from the KITTI dataset (Geiger et al., 2013), which were captured by a roof-mounted camera on a car driving around an urban environment in Germany. Sequences of 10 frames were sampled from the “City”, “Residential”, and “Road” categories, with 57 recording sessions used for training and 4 used for validation. Frames were center-cropped and downsampled to 128x160 pixels. In total, the training set consisted of roughly 41K frames.
84
+
85
+ A random hyperparameter search, with model selection based on the validation set, resulted in a 4 layer model with 3x3 convolutions and layer channel sizes of (3, 48, 96, 192). Models were again trained with Adam (Kingma & Ba, 2014) using a loss either solely computed on the lowest layer $( L _ { 0 } )$ or with a weight of 1 on the lowest layer and 0.1 on the upper layers $( L _ { a l l } )$ . Adam parameters were initially set to their default values $\mathbf { \Phi } _ { \mathrm { { ( } } \alpha } = 0 . 0 0 1 $ , $\beta _ { 1 } = 0 . 9$ , $\beta _ { 2 } = 0 . 9 9 9 )$ with the learning rate, $\alpha$ , decreasing by a factor of 10 halfway through training. To assess that the network had indeed learned a robust representation, we tested on the CalTech Pedestrian dataset (Dollar et al., 2009), which´ consists of videos from a dashboard-mounted camera on a vehicle driving around Los Angeles. Testing sequences were made to match the frame rate of the KITTI dataset and again cropped to 128x160 pixels. Quantitative evaluation was performed on the entire CalTech test partition, split into sequences of 10 frames.
86
+
87
+ Sample PredNet predictions (for the $L _ { 0 }$ model) on the CalTech Pedestrian dataset are shown in Figure 4, and example videos can be found at https://coxlab.github.io/prednet/. The model is able to make fairly accurate predictions in a wide range of scenarios. In the top sequence of Fig. 4, a car is passing in the opposite direction, and the model, while not perfect, is able to predict its trajectory, as well as fill in the ground it leaves behind. Similarly in Sequence 3, the model is able to predict the motion of a vehicle completing a left turn. Sequences 2 and 5 illustrate that the PredNet can judge its own movement, as it predicts the appearance of shadows and a stationary vehicle as they approach. The model makes reasonable predictions even in difficult scenarios, such as when the camera-mounted vehicle is turning. In Sequence 4, the model predicts the position of a tree, as the vehicle turns onto a road. The turning sequences also further illustrate the model’s ability to “fill-in”, as it is able to extrapolate sky and tree textures as unseen regions come into view. As an additional control, we show a sequence at the bottom of Fig. 4, where the input has been temporally scrambled. In this case, the model generates blurry frames, which mostly just resemble the previous frame. Finally, although the PredNet shown here was trained to predict one frame ahead, it is also possible to predict multiple frames into the future, by feeding back predictions as the inputs and recursively iterating. We explore this in Appendix 5.3.
88
+
89
+ Quantitatively, the PredNet models again outperformed the CNN-LSTM EncoderDecoder. To ensure that the difference in performance was not simply because of the choice of hyperparameters, we trained models with four other sets of hyperparameters, which were sampled from the initial random search over the number of layers, fil
90
+
91
+ Table 2: Evaluation of Next-Frame Predictions on CalTech Pedestrian Dataset.
92
+
93
+ <table><tr><td></td><td>MSE</td><td>SSIM</td></tr><tr><td>PredNet Lo</td><td>3.13 × 10-3</td><td>0.884</td></tr><tr><td>PredNet Lall</td><td>3.33 ×10-3</td><td>0.875</td></tr><tr><td>CNN-LSTMEnc.-Dec.</td><td>3.67 × 10-3</td><td>0.865</td></tr><tr><td>Copy Last Frame</td><td>7.95 × 10-3</td><td>0.762</td></tr></table>
94
+
95
+ ter sizes, and number of filters per layer. For each of the four additional sets, the PredNet $L _ { 0 }$ had the best performance, with an average error reduction of $1 4 . 7 \%$ and $1 4 . 9 \%$ for MSE and SSIM,
96
+
97
+ ![](images/f2465bddecf762950203060719579f704eebd5b1c06d29b0051a317691866e37.jpg)
98
+ time →
99
+ Figure 4: PredNet predictions for car-cam videos. The first rows contain ground truth and the second rows contain predictions. The sequence below the red line was temporally scrambled. The model was trained on the KITTI dataset and sequences shown are from the CalTech Pedestrian dataset.
100
+
101
+ respectively, compared to the CNN-LSTM Encoder-Decoder. More details, as well as a thorough investigation of systematically simplified models on the continuum between the PredNet and the CNN-LSTM Encoder-Decoder can be found in Appendix 5.1. Briefly, the elementwise subtraction operation in the PredNet seems to be beneficial, and the nonlinearity of positive/negative splitting also adds modest improvements. Finally, while these experiments measure the benefits of each component of our model, we also directly compare against recent work in a similar car-cam setting, by reporting results on a 64x64 pixel, grayscale car-cam dataset released by Brabandere et al. (2016). Our PredNet model outperforms the model by Brabandere et al. (2016) by $2 9 \%$ . Details can be found in Appendix 5.2. Also in Appendix 5.2, we present results for the Human3.6M (Ionescu et al., 2014) dataset, as reported by Finn et al. (2016). Without re-optimizing hyperparameters, our model underperforms the concurrently developed DNA model by Finn et al. (2016), but outperforms the model by Mathieu et al. (2016).
102
+
103
+ To test the implicit encoding of latent parameters in the car-cam setting, we used the internal representation in the PredNet to estimate the car’s steering angle (Bojarski et al., 2016; Biasini et al., 2016). We used a dataset released by Comma.ai (Biasini et al., 2016) consisting of 11 videos totaling about 7 hours of mostly highway driving. We first trained networks for next-frame prediction and then fit a linear fully-connected layer on the learned representation to estimate the steering angle, using a MSE loss. We again concatenate the $R _ { l }$ representation at all layers, but first spatially average pool lower layers to match the spatial size of the upper layer, in order to reduce dimensionality. Steering angle estimation results, using the representation on the $1 0 ^ { \mathrm { t h } }$ time step, are shown in Figure 5. Given just 1K labeled training examples, a simple linear readout on the PredNet $L _ { 0 }$ representation explains $7 4 \%$ of the variance in the steering angle and outperforms the CNN-LSTM Enc.-Dec. by $3 5 \%$ . With 25K labeled training examples, the PredNet $L _ { 0 }$ has a MSE (in degrees2) of 2.14. As a point of reference, a CNN model designed to predict the steering angle (Biasini et al., 2016), albeit from a single frame instead of multiple frames, achieve a MSE of ${ \sim } 4$ when trained end-to-end using 396K labeled training examples. Details of this analysis can be found in Appendix 8. Interestingly, in this task, the PredNet $L _ { a l l }$ model actually underperformed the $L _ { 0 }$ model and slightly underperformed the CNN-LSTM Enc.-Dec, again suggesting that the $\lambda _ { l }$ parameter can affect the representation learned, and different values may be preferable in different end tasks. Nonetheless, the readout from the $L _ { a l l }$ model still explained a substantial proportion of the steering angle variance and strongly outperformed the random initial weights. Overall, this analysis again demonstrates that a representation learned through prediction, and particularly with the PredNet model with appropriate hyperparameters, can contain useful information about underlying latent parameters.
104
+
105
+ ![](images/4eacc964ba30df01ba5dfac8e925e09b97a2e2cd91639d41fa77b3ced7bfe30a.jpg)
106
+ Figure 5: Steering angle estimation accuracy on the Comma.ai dataset (Biasini et al., 2016). Left: Example steering angle curve with model estimations for a segment in the test set. Decoding was performed using a fully-connected readout on the PredNet representation trained with 25K labeled training examples. PredNet representation was trained for next-frame prediction on Comma.ai training set. Right: Mean-squared error of steering angle estimation.
107
+
108
+ # 4 DISCUSSION
109
+
110
+ Above, we have demonstrated a predictive coding inspired architecture that is able to predict future frames in both synthetic and natural image sequences. Importantly, we have shown that learning to predict how an object or scene will move in a future frame confers advantages in decoding latent parameters (such as viewing angle) that give rise to an object’s appearance, and can improve recognition performance. More generally, we argue that prediction can serve as a powerful unsupervised learning signal, since accurately predicting future frames requires at least an implicit model of the objects that make up the scene and how they are allowed to move. Developing a deeper understanding of the nature of the representations learned by the networks, and extending the architecture, by, for instance, allowing sampling, are important future directions.
111
+
112
+ # ACKNOWLEDGMENTS
113
+
114
+ We would like to thank Rasmus Berg Palm for fruitful discussions and early brainstorming. We would also like to thank the developers of Keras (Chollet, 2016). This work was supported by IARPA (contract D16PC00002), the National Science Foundation (NSF IIS 1409097), and the Center for Brains, Minds and Machines (CBMM, NSF STC award CCF-1231216).
115
+
116
+ # REFERENCES
117
+
118
+ Pulkit Agrawal, Joao Carreira, and Jitendra Malik. Learning to see by moving. ˜ CoRR, 2015.
119
+
120
+ Andre M. Bastos, W. Martin Usrey, Rick A. Adams, George R. Mangun, Pascal Fries, and Karl J. Friston. Canonical microcircuits for predictive coding. Neuron, 2012.
121
+
122
+ Samy Bengio, Oriol Vinyals, Navdeep Jaitly, and Noam Shazeer. Scheduled sampling for sequence prediction with recurrent neural networks. CoRR, 2015.
123
+
124
+ Yoshua Bengio. How auto-encoders could provide credit assignment in deep networks via target propagation. CoRR, 2014.
125
+
126
+ Riccardo Biasini, George Hotz, Sam Khalandovsky, Eder Santana, and Niel van der Westhuizen. Comma.ai research, 2016. URL https://github.com/commaai/research.
127
+
128
+ Mariusz Bojarski, Davide Del Testa, Daniel Dworakowski, Bernhard Firner, Beat Flepp, Prasoon Goyal, Lawrence D. Jackel, Mathew Monfort, Urs Muller, Jiakai Zhang, Xin Zhang, Jake Zhao, and Karol Zieba. End to end learning for self-driving cars. CoRR, 2016.
129
+
130
+ Bert De Brabandere, Xu Jia, Tinne Tuytelaars, and Luc Van Gool. Dynamic filter networks. CoRR, 2016.
131
+
132
+ Rakesh Chalasani and Jose C. Principe. Deep predictive coding networks. CoRR, 2013.
133
+
134
+ Franc¸ois Chollet. Comma.ai, 2016. URL http://keras.io/.
135
+
136
+ Andy Clark. Whatever next? predictive brains, situated agents, and the future of cognitive science. Behavioral and Brain Sciences, 2013.
137
+
138
+ Piotr Dollar, Christian Wojek, Bernt Schiele, and Pietro Perona. Pedestrian detection: A benchmark.´ In CVPR, 2009.
139
+
140
+ Tobias Egner, Jim M. Monti, and Christopher Summerfield. Expectation and surprise determine neural population responses in the ventral visual stream. J Neurosci, 2010.
141
+
142
+ Chelsea Finn, Ian J. Goodfellow, and Sergey Levine. Unsupervised learning for physical interaction through video prediction. CoRR, 2016.
143
+
144
+ Peter Foldi ¨ ak. Learning invariance from transformation sequences. ´ Neural Computation, 1991.
145
+
146
+ Karl Friston. A theory of cortical responses. Philos Trans R Soc Lond B Biol Sci, 2005.
147
+
148
+ Andreas Geiger, Philip Lenz, Christoph Stiller, and Raquel Urtasun. Vision meets robotics: The kitti dataset. International Journal of Robotics Research (IJRR), 2013.
149
+
150
+ Dileep George and Jeff Hawkins. A hierarchical bayesian model of invariant pattern recognition in the visual cortex. In Proceedings of the International Joint Conference on Neural Networks. IEEE, 2005.
151
+
152
+ Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In NIPS. 2014.
153
+
154
+ Ross Goroshin, Joan Bruna, Jonathan Tompson, David Eigen, and Yann LeCun. Unsupervised learning of spatiotemporally coherent metrics. CoRR, 2015a.
155
+
156
+ Ross Goroshin, Michael Mathieu, and Yann LeCun. Learning to linearize under uncertainty. ¨ CoRR, 2015b.
157
+
158
+ Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. Neural Computation, 1997.
159
+
160
+ Catalin Ionescu, Dragos Papava, Vlad Olaru, and Cristian Sminchisescu. Human3.6m: Large scale datasets and predictive methods for 3d human sensing in natural environments. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2014.
161
+
162
+ Kevin Jarrett, Koray Kavukcuoglu, MarcAurelio Ranzato, and Yann LeCun. What is the best multistage architecture for object recognition? In ICCV. 2009.
163
+
164
+ Ryota Kanai, Yutaka Komura, Stewart Shipp, and Karl Friston. Cerebral hierarchies : predictive processing , precision and the pulvinar. Philos Trans R Soc Lond B Biol Sci, 2015.
165
+
166
+ Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, 2014.
167
+
168
+ Tejas D. Kulkarni, Will Whitney, Pushmeet Kohli, and Joshua B. Tenenbaum. Deep convolutional inverse graphics network. CoRR, 2015.
169
+
170
+ Tai Sing Lee and David Mumford. Hierarchical bayesian inference in the visual cortex. J Opt Soc Am A Opt Image Sci Vis, 2003.
171
+
172
+ William Lotter, Gabriel Kreiman, and David Cox. Unsupervised learning of visual structure using predictive generative networks. CoRR, 2015.
173
+
174
+ Davide Maltoni and Vincenzo Lomonaco. Semi-supervised tuning from temporal coherence. CoRR, 2015.
175
+
176
+ Michael Mathieu, Camille Couprie, and Yann LeCun. Deep multi-scale video prediction beyond ¨ mean square error. ICLR, 2016.
177
+
178
+ Vincent Michalski, Roland Memisevic, and Kishore Konda. Modeling deep temporal dependencies with recurrent ”grammar cells”. In NIPS. 2014.
179
+
180
+ Hossein Mohabi, Ronan Collobert, and Jason Weston. Deep learning from temporal coherence in video. In ICML. 2009.
181
+
182
+ Junhyuk Oh, Xiaoxiao Guo, Honglak Lee, Richard L. Lewis, and Satinder P. Singh. Actionconditional video prediction using deep networks in atari games. CoRR, 2015.
183
+
184
+ Randall C. O’Reilly, Dean Wyatte, and John Rohrlich. Learning through time in the thalamocortical loops. CoRR, 2014.
185
+
186
+ Rasmus Berg Palm. Prediction as a candidate for learning deep hierarchical models of data. Master’s thesis, Technical University of Denmark, 2012.
187
+
188
+ Viorica Patraucean, Ankur Handa, and Roberto Cipolla. Spatio-temporal video autoencoder with differentiable memory. CoRR, 2015.
189
+
190
+ Mohammad Pezeshki, Linxi Fan, Philemon Brakel, Aaron C. Courville, and Yoshua Bengio. Deconstructing the ladder network architecture. CoRR, 2015.
191
+
192
+ Nicolas Pinto, David Doukhan, James J. DiCarlo, and David D. Cox. A high-throughput screening approach to discovering good forms of biologically inspired visual representation. PLoS Comput Biol, 2009.
193
+
194
+ Marc’Aurelio Ranzato, Arthur Szlam, Joan Bruna, Michael Mathieu, Ronan Collobert, and Sumit ¨ Chopra. Video (language) modeling: a baseline for generative models of natural videos. CoRR, 2014.
195
+
196
+ Rajesh P. N. Rao and Dana H. Ballard. Predictive coding in the visual cortex: a functional interpretation of some extra-classical receptive-field effects. Nature Neuroscience, 1999.
197
+
198
+ Rajesh P. N. Rao and T. J. Sejnowski. Predictive sequence learning in recurrent neocortical circuits. NIPS, 2000.
199
+
200
+ Antti Rasmus, Harri Valpola, Mikko Honkala, Mathias Berglund, and Tapani Raiko. Semisupervised learning with ladder network. CoRR, 2015.
201
+
202
+ Eder Santana and George Hotz. Learning a driving simulator. CoRR, 2016.
203
+
204
+ Andrew Saxe, Maneesh Bhand, Zhenghao Chen, Pang Wei Koh, Bipin Suresh, and Andrew Y. Ng. On random weights and unsupervised feature learning. In Workshop: Deep Learning and Unsupervised Feature Learning (NIPS). 2010.
205
+
206
+ Xingjian Shi, Zhourong Chen, Hao Wang, Dit-Yan Yeung, Wai-Kin Wong, and Wang-chun Woo. Convolutional LSTM network: A machine learning approach for precipitation nowcasting. CoRR, 2015.
207
+
208
+ Singular Inversions, Inc. FaceGen. http://facegen.com.
209
+
210
+ William R. Softky. Unsupervised pixel-prediction. NIPS, 1996.
211
+
212
+ M. W. Spratling. Unsupervised learning of generative and discriminative weights encoding elementary image components in a predictive coding model of cortical function. Neural Computation, 2012.
213
+
214
+ Nitish Srivastava, Elman Mansimov, and Ruslan Salakhutdinov. Unsupervised learning of video representations using lstms. CoRR, 2015.
215
+
216
+ Christopher Summerfield, Tobias Egner, Matthew Greene, Etienne Koechlin, Jennifer Mangels, and Joy Hirsch. Predictive codes for forthcoming perception in the frontal cortex. Science, 314, 2006.
217
+
218
+ Lin Sun, Kui Jia, Tsung-Han Chan, Yuqiang Fang, Gang Wang, and Shuicheng Yan. Dl-sfa: Deeplylearned slow feature analysis for action recognition. CVPR, 2014.
219
+
220
+ Lucas Theis, Aaron van den Oord, and Matthias Bethge. A note on the evaluation of generative models. ICLR, 2016.
221
+
222
+ Harri Valpola. From neural pca to deep unsupervised learning. CoRR, 2015.
223
+
224
+ Carl Vondrick, Hamed Pirsiavash, and Antonio Torralba. Generating videos with scene dynamics. CoRR, 2016.
225
+
226
+ Xiaolong Wang and Abhinav Gupta. Unsupervised learning of visual representations using videos. CoRR, 2015.
227
+
228
+ Zhou Wang, Alan Bovik, Hamid Sheikh, and Eero Simoncelli. Image quality assessment: From error visibility to structural similarity. IEEE Transactions on Image Processing, 2004.
229
+
230
+ William F. Whitney, Michael Chang, Tejas D. Kulkarni, and Joshua B. Tenenbaum. Understanding visual concepts with continuation learning. CoRR, 2016.
231
+
232
+ Laurenz Wiskott and Terrence J. Sejnowski. Learning invariance from transformation sequences. Neural Computation, 2002.
233
+
234
+ Tianfan Xue, Jiajun Wu, Katherine L. Bouman, and William T. Freeman. Visual dynamics: Probabilistic future frame synthesis via cross convolutional networks. CoRR, 2016.
235
+
236
+ # 5 APPENDIX
237
+
238
+ # 5.1 ADDITIONAL CONTROL MODELS
239
+
240
+ Table 3 contains results for additional variations of the PredNet and CNN-LSTM Encoder-Decoder evaluated on the CalTech Pedestrian Dataset after being trained on KITTI. We evaluate the models in terms of pixel prediction, thus using the PredNet model trained with loss only on the lowest layer (PredNet $L _ { 0 }$ ) as the base model. In addition to mean-squared error (MSE) and the Structural Similarity Index Measure (SSIM), we include calculations of the Peak Signal-To-Noise Ratio (PSNR). For each model, we evaluate it with the original set of hyperparameters (controlling the number of layers, filter sizes, and number of filters per layer), as well as with the four additional sets of hyperparameters that were randomly sampled from the initial random search (see main text for more details). Below is an explanation of the additional control models:
241
+
242
+ • PredNet (no E split): PredNet model except the error responses $( E _ { l } )$ are simply linear $( \hat { A } _ { l } - A _ { l } )$ instead of being split into positive and negative rectifications.
243
+
244
+ • CNN-LSTM Enc.-Dec. $2 \mathbf { x } \ A _ { l }$ filts): CNN-LSTM Encoder-Decoder model ( $\mathbf { \delta } _ { \cdot } A _ { l }$ ’s are passed instead of $E _ { l }$ ’s) except the number of filters in $A _ { l }$ is doubled. This controls for the total number of filters in the model compared to the PredNet, since the PredNet has filters to produce $\hat { A } _ { l }$ at each layer, which is integrated into the model’s feedforward response.
245
+
246
+ • CNN-LSTM Enc.-Dec. (except pass $E _ { 0 }$ ): CNN-LSTM Encoder-Decoder model except the error is passed at the lowest layer. All remaining layers pass the activations $A _ { l }$ . With training loss taken at only the lowest layer, this variation allows us to determine if the “prediction” subtraction operation in upper layers, which is essentially unconstrained and learnable in the $L _ { 0 }$ case, aids in the model’s performance.
247
+
248
+ • CNN-LSTM Enc.-Dec. $+ / -$ split): CNN-LSTM Encoder-Decoder model except the activations $A _ { l }$ are split into positive and negative populations before being passed to other layers in the network. This isolates the effect of the additional nonlinearity introduced by this procedure.
249
+
250
+ Table 3: Quantitative evaluation of additional controls for next-frame prediction in CalTech Pedestrian Dataset after training on KITTI. First number indicates score with original hyperparameters. Number in parenthesis indicates score averaged over total of five different hyperparameters.
251
+
252
+ <table><tr><td></td><td>MSE (x 10-3)</td><td>PSNR</td><td>SSIM</td></tr><tr><td>PredNet</td><td>3.13 (3.33)</td><td>25.8 (25.5)</td><td>0.884 (0.878)</td></tr><tr><td>PredNet (no Et split)</td><td>3.20 (3.37)</td><td>25.6 (25.4)</td><td>0.883 (0.878)</td></tr><tr><td>CNN-LSTMEnc.-Dec.</td><td>3.67 (3.91)</td><td>25.0 (24.6)</td><td>0.865 (0.856)</td></tr><tr><td>CNN-LSTM Enc.-Dec. (2x At filts)</td><td>3.82 (3.97)</td><td>24.8 (24.6)</td><td>0.857 (0.853)</td></tr><tr><td>CNN-LSTM Enc.-Dec. (except pass Eo)</td><td>3.41 (3.61)</td><td>25.4 (25.1)</td><td>0.873 (0.866)</td></tr><tr><td>CNN-LSTMEnc.-Dec. (+/- split)</td><td>3.71 (3.84)</td><td>24.9 (24.7)</td><td>0.861 (0.857)</td></tr><tr><td>Copy Last Frame</td><td>7.95</td><td>20.0</td><td>0.762</td></tr></table>
253
+
254
+ Equalizing the number of filters in the CNN-LSTM Encoder-Decoder (2x $A _ { l }$ filts) cannot account for its performance difference with the PredNet, and actually leads to overfitting and a decrease in performance. Passing the error at the lowest layer $( E _ { 0 } )$ in the CNN-LSTM Enc.-Dec. improves performance, but still does not match the PredNet, where errors are passed at all layers. Finally, splitting the activations $A _ { l }$ into positive and negative populations in the CNN-LSTM Enc.-Dec. does not help, but the PredNet with linear error activation (“no $E _ { l }$ split”) performs slightly worse than the original split version. Together, these results suggest that the PredNet’s error passing operation can lead to improvements in next-frame prediction performance.
255
+
256
+ # 5.2 COMPARING AGAINST OTHER MODELS
257
+
258
+ While our main comparison in the text was a control model that isolates the effects of the more unique components in the PredNet, here we directly compare against other published models. We report results on a $6 4 \mathrm { x 6 4 }$ pixel, grayscale car-cam dataset and the Human3.6M dataset (Ionescu et al., 2014) to compare against the two concurrently developed models by Brabandere et al. (2016)
259
+
260
+ and Finn et al. (2016), respectively. For both comparisons, we use a model with the same hyperparameters (# of layers, # of filters, etc.) of the PredNet $L _ { 0 }$ model trained on KITTI, but train from scratch on the new datasets. The only modification we make is to train using an L2 loss instead of the effective L1 loss, since both models train with an L2 loss and report results using L2-based metrics (MSE for Brabandere et al. (2016) and PSNR for Finn et al. (2016)). That is, we keep the original PredNet model intact but directly optimize using MSE between actual and predicted frames. We measure next-frame prediction performance after inputting 3 frames and 10 frames, respectively, for the 64x64 car-cam and Human3.6M datasets, to be consistent with the published works. We also include the results using a feedforward multi-scale network, similar to the model of Mathieu et al. (2016), on Human3.6M, as reported by Finn et al. (2016).
261
+
262
+ Table 4: Evaluation of Next-Frame Predictions on 64x64 Car-Cam Dataset. MSE (per-pixel)
263
+
264
+ <table><tr><td colspan="2">MSE (per-pixel)</td></tr><tr><td>DFN (Brabandere et al., 2016)</td><td>1.71 ×10-3</td></tr><tr><td>PredNet</td><td>1.16 ×10-3</td></tr><tr><td>Copy Last Frame</td><td>3.58 ×10-3</td></tr></table>
265
+
266
+ Table 5: Evaluation of Next-Frame Predictions on Human3.6M PSNR
267
+
268
+ <table><tr><td>DNA (Finn et al., 2016) PredNet FF multi-scale (Mathieu et al.,2016)</td><td>42.1 38.9 26.7 32.0</td></tr></table>
269
+
270
+ On a dataset similar to KITTI, our model outperforms the model proposed by Brabandere et al. (2016). On Human3.6M, our model outperforms a model similar to (Mathieu et al., 2016), but underperforms Finn et al. (2016), although we note we did not perform any hyperparameter optimization.
271
+
272
+ # 5.3 MULTIPLE TIME STEP PREDICTION
273
+
274
+ ![](images/d9c247d44b99433c9cfb95c59a9b7fce77018f62bc8529b66fb02544335c6500.jpg)
275
+ Figure 6: Extrapolation sequences generated by feeding PredNet predictions back into model. Left of the orange line: Normal $t + 1$ predictions; Right: Generated by recursively using the predictions as input. First row: Ground truth sequences. Second row: Generated frames of the original model, trained to solely predict $t + 1$ . Third row: Model fine-tuned for extrapolation.
276
+
277
+ While the models presented here were originally trained to predict one frame ahead, they can be made to predict multiple frames by treating predictions as actual input and recursively iterating. Examples of this process are shown in Figure 6 for the PredNet $L _ { 0 }$ model. Although the next frame predictions are reasonably accurate, the model naturally breaks down when extrapolating further into the future. This is not surprising since the predictions will unavoidably have different statistics than the natural images for which the model was trained to handle (Bengio et al., 2015). If we additionally train the model to process its own predictions, the model is better able to extrapolate. The third row for every sequence shows the output of the original PredNet fine-tuned for extrapolation. Starting from the trained weights, the model was trained with a loss over 15 time steps, where the actual frame was inputted for the first 10 and then the model’s predictions were used as input to the network for the last 5. For the first 10 time steps, the training loss was calculated on the $E _ { l }$ activations as usual, and for the last 5, it was calculated directly as the mean absolute error with respect to the ground truth frames. Despite eventual blurriness (which might be expected to some extent due to uncertainty), the fine-tuned model captures some key structure in its extrapolations after the tenth time step. For instance, in the first sequence, the model estimates the general shape of an upcoming shadow, despite minimal information in the last seen frame. In the second sequence, the model is able to extrapolate the motion of a car moving to the right. The reader is again encouraged to visit https://coxlab.github.io/prednet/ to view the predictions in video form. Quantitatively, the MSE of the model’s predictions stay well below the trivial solution of copying the last seen frame, as illustrated in Fig 7. The MSE increases fairly linearly from time steps 2-10, even though the model was only trained for up to $t + 5$ prediction.
278
+
279
+ ![](images/386c934c0c7cd4d4bb7e1f0e1e6977d14b386376dbb66698689a1d26524a0395.jpg)
280
+ Figure 7: MSE of PredNet predictions as a function of number of time steps ahead predicted. Model was fine-tuned for up to $t + 5$ prediction.
281
+
282
+ # 5.4 ADDITIONAL STEERING ANGLE ANALYSIS
283
+
284
+ In Figure 8, we show the steering angle estimation accuracy on the Comma.ai (Biasini et al., 2016) dataset using the representation learned by the PredNet $L _ { 0 }$ model, as a function of the number of frames inputted into the model. The PredNet’s representation at all layers was concatenated (after spatially pooling lower layers to a common spatial resolution) and a fully-connected readout was fit using MSE. For each level of the number of training examples, we average over 10 cross-validation splits. To serve as points of reference, we include results for two static models. The first model is an autoencoder trained on single frame reconstruction with appropriately matching hyperparameters. A fully-connected layer was fit on the autoencoder’s representation to estimate the steering angle in the same fashion as the PredNet. The second model is the default model in the posted Comma.ai code (Biasini et al., 2016), which is a five layer CNN. This model is trained end-to-end to estimate the steering angle given the current frame as input, with a MSE loss. In addition to 25K examples, we trained a version using all of the frames in the Comma dataset (\~396K). For all models, the final weights were chosen at the minimum validation error during training. Given the relatively small number of videos in the dataset compared to the average duration of each video, we used $5 \%$ of each video for validation and testing, chosen as a random continuous chunk, and discarded the 10 frames before and after the chosen segments from the training set.
285
+
286
+ ![](images/786ee29cf8d282ebc8e20ea4c6a1d601619f455dd6984bab67feeada0044938e.jpg)
287
+ Figure 8: Steering angle estimation accuracy as a function of the number of input frames.
288
+
289
+ As illustrated in Figure 8, the PredNet’s performance gets better over time, as one might expect, as the model is able to accumulate more information. Interestingly, it performs reasonably well after just one time step, in a regime that is orthogonal to the training procedure of the PredNet where there are no dynamics. Altogether, these results again point to the usefulness of the model in learning underlying latent parameters.
290
+
291
+ # 5.5 PREDNET $L _ { a l l }$ NEXT-FRAME PREDICTIONS
292
+
293
+ Figures 9 and 10 compare next-frame predictions by the PredNet $L _ { a l l }$ model, trained with a prediction loss on all layers ( $\lambda _ { 0 } = 1$ , $\lambda _ { l > 0 } = 0 . 1 $ ), and the PredNet $L _ { 0 }$ model, trained with a loss only on the lowest layer. At first glance, the difference in predictions seem fairly minor, and indeed, in terms of MSE, the $L _ { a l l }$ model only underperformed the $L _ { 0 }$ version by $3 \%$ and $6 \%$ , respectively, for the rotating faces and CalTech Pedestrian datasets. Upon careful inspection, however, it is apparent that the $L _ { a l l }$ predictions lack some of the finer details of the $L _ { 0 }$ predictions and are more blurry in regions of high variance. For instance, with the rotating faces, the facial features are less defined and with CalTech, details of approaching shadows and cars are less precise.
294
+
295
+ ![](images/235db1e2a31428ae54787e2a5c30dc4c978774edcf9dd06ef6ac6cecc851ece6.jpg)
296
+ time
297
+ Figure 9: Next-frame predictions of PredNet $L _ { a l l }$ model on the rotating faces dataset and comparison to $L _ { 0 }$ version. The ”Error ${ \cal L } _ { a l l } { - \cal L } _ { 0 } { } ^ { \cdots }$ visualization shows where the pixel error was smaller for the $L _ { 0 }$ model than the $L _ { a l l }$ model. Green regions correspond to where $L _ { 0 }$ was better and red corresponds to where $L _ { a l l }$ was better.
298
+
299
+ ![](images/5436ead45eb2f3750a49987e6825e0fe9897d10aa4f0e52240e2823c9aafffd5.jpg)
300
+ time
301
+ Figure 10: Next-frame predictions of PredNet $L _ { a l l }$ model on the CalTech Pedestrian dataset and comparison to $L _ { 0 }$ version. The ”Error ${ \cal L } _ { a l l } - { \cal L } _ { 0 } { } ^ { }$ visualization shows where the pixel error was smaller for the $L _ { 0 }$ model than the $L _ { a l l }$ model. Green regions correspond to where $L _ { 0 }$ was better and red corresponds to where $L _ { a l l }$ was better.
md/train/B1xm3RVtwB/B1xm3RVtwB.md ADDED
@@ -0,0 +1,279 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SIMPLIFIED ACTION DECODER FOR DEEP MULTI-AGENT REINFORCEMENT LEARNING
2
+
3
+ Hengyuan Hu, Jakob N Foerster Facebook AI Research, CA, USA {hengyuan,jnf}@fb.com
4
+
5
+ # ABSTRACT
6
+
7
+ In recent years we have seen fast progress on a number of benchmark problems in AI, with modern methods achieving near or super human performance in Go, Poker and Dota. One common aspect of all of these challenges is that they are by design adversarial or, technically speaking, zero-sum. In contrast to these settings, success in the real world commonly requires humans to collaborate and communicate with others, in settings that are, at least partially, cooperative. In the last year, the card game Hanabi has been established as a new benchmark environment for AI to fill this gap. In particular, Hanabi is interesting to humans since it is entirely focused on theory of mind, i.e., the ability to effectively reason over the intentions, beliefs and point of view of other agents when observing their actions. Learning to be informative when observed by others is an interesting challenge for Reinforcement Learning (RL): Fundamentally, RL requires agents to explore in order to discover good policies. However, when done naively, this randomness will inherently make their actions less informative to others during training. We present a new deep multi-agent RL method, the Simplified Action Decoder (SAD), which resolves this contradiction exploiting the centralized training phase. During training SAD allows other agents to not only observe the (exploratory) action chosen, but agents instead also observe the greedy action of their team mates. By combining this simple intuition with best practices for multi-agent learning, SAD establishes a new SOTA for learning methods for 2-5 players on the self-play part of the Hanabi challenge. Our ablations show the contributions of SAD compared with the best practice components. All of our code and trained agents are available at https://github.com/facebookresearch/Hanabi_SAD.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Humans are highly social creatures and spend vast amounts of time coordinating, collaborating and communicating with others. In contrast to these, at least partially, cooperative settings most progress on AI in games has been in zero-sum games where agents compete against each other, typically rendering communication futile. This includes examples such as Go (Silver et al., 2016; 2017; 2018), poker (Brown & Sandholm, 2017; Moravcík et al., 2017; Brown & Sandholm, 2019) ˇ and chess (Campbell et al., 2002).
12
+
13
+ This narrow focus is unfortunate, since communication and coordination require unique abilities. In order to enable smooth and efficient social interactions of groups of people, it is commonly required to reason over the intents, points of views and beliefs of other agents from observing their actions. For example, a driver can reasonably infer that if a truck in front of them is slowing down when approaching an intersection, then there is likely an obstacle ahead. Furthermore, humans are both able to interpret the actions of others and can act in a way that is informative when their actions are being observed by others, capabilities that are commonly called theory of Mind (ToM), (Baker et al., 2017). Importantly, in order to carry out this kind of reasoning, an agent needs to consider why a given action is taken and what this decision indicates about the state of the world. Simply observing what other agents are doing is not sufficient.
14
+
15
+ While these abilities are particularly relevant in partially observable, fully cooperative multi-agent settings, ToM reasoning clearly matters in a variety of real world scenarios. For example, autonomous cars will likely need to understand the point of view, intents and beliefs of other traffic participants in order to deal with highly interactive settings such as 4-way crossing or dense traffic in cities.
16
+
17
+ Hanabi is a fully cooperative, partially-observable card game that has recently been proposed as a new benchmark challenge problem for AI research (Bard et al., 2019) to fill the gap around ToM. In Hanabi, players need to find conventions that allow them to effectively exchange information from their local observations through their actions, taking advantage of the fact that actions are observed by all team mates.
18
+
19
+ Most prior state-of-the-art agents for Hanabi were developed using handcrafted algorithms, which beat off-the-shelf deep multi-agent RL methods by a large margin. This makes intuitive sense: Beyond the “standard” multi-agent challenges of credit assignment, nonstationarity and joint exploration, learning an informative policy presents an additional fundamentally new conflict. On the one hand, an RL agent needs to explore in order to discover good policies through trial and error. On the other hand, when carried out naively, this exploration will add noise to the policy of the agent during the training process, making their actions strictly less informative to their team mates.
20
+
21
+ One possible solution to this is to explore in the space of deterministic partial policies, rather than actions, and sample these policies from a distribution that conditions on a common knowledge Bayesian belief. This is successfully carried out in the Bayesian Action Decoder (BAD) (Foerster et al., 2019), the only previous Deep RL method to achieve a state-of-the-art in Hanabi. While this is a notable accomplishment, it comes at the cost of simplicity and generality. For a start, BAD requires an explicit common knowledge Bayesian belief to be tracked, which not only adds computational burden due to the required sampling steps, but also uses expert knowledge regarding the game dynamics. Furthermore, BAD, as presented, is trained using actor-critic methods which are sample inefficient and suffer from local optima. In order to get around this, BAD uses population based training, further increasing the number of samples required. Lastly, BAD’s explicit reliance on common knowledge limits the generality of the method.
22
+
23
+ In this paper we propose the Simplified Action Decoder (SAD), a method that achieves a similar goal to BAD, but addresses all of the issues mentioned above. At the core of SAD is a different approach towards resolving the conflict between exploration and being interpretable, which, like BAD, relies on the centralized training with decentralized control (CT/DC) regime. Under CT/DC information can be exchanged freely amongst all agents during centralized training, as long as the final policies are compatible with decentralized execution.
24
+
25
+ The key insight is that during training we do not have to chose between being informative, by taking greedy actions, and exploring, by taking random actions. To be informative, the greedy actions do not need to be executed by the environment, but only need to be observed by the team mates. Thus in SAD each agent takes two different actions at each time step: One greedy action, which is not presented to the environment but observed by the team mates at the next time step as an additional input, and the “standard” (exploratory) action that gets executed by the environment and is observed by the team mates as part of the environment dynamics. Importantly, during greedy execution the observed environment action can be used instead of centralized information for the additional input, since now the agent has stopped exploring.
26
+
27
+ Furthermore, to ensure that these greedy actions and observations get decoded into a meaningful representation, we can optionally train an auxiliary task that predicts key hidden game properties from the action-observation trajectories. While we note that this idea is in principle compatible with any kind of model-free deep RL method with minimal modifications to the core algorithm, we use a distributed version of recurrent DQN in order to improve sample efficiency, account for partial observability and reduce the risk of local optima. We also train a joint-action Q-function that consists of the sum of per-agent Q-values to allow for off-policy learning in this multi-agent setting using Value Decomposition Networks (VDN) (Sunehag et al., 2017).
28
+
29
+ Using SAD we establish a new SOTA for learning methods for 2-5 players in Hanabi, with a method that not only requires less expert knowledge and compute, but is also more general than previous approaches. In order to ensure that our results can be easily verified and extended, we also evaluate our method on a proof-of-principle matrix game and open-source our training code and agents. Beyond enabling more research into the self-play aspect of Hanabi, we believe these resources will provide a much needed starting point for the ad-hoc teamwork part of the Hanabi challenge.
30
+
31
+ # 2 RELATED WORK
32
+
33
+ Our work relates closely to research on emergent communication protocols using deep multi-agent RL, as first undertaken by Sukhbaatar et al. (2016) and Foerster et al. (2016) . There has been a large number of follow-up papers in this area, so listing all relevant work is beyond the scope and we refer the reader to Nguyen et al. (2018), a recent survey on deep multi-agent RL. One major difference to our work is that the environments considered typically contain a cheap-talk channel, which can be modeled as a continuous variable during the course of training. This allows agents to, for example, use differentiation across the communication channel in order to learn protocols. In contrast, in our setting agents have to communicate through the observable environment actions themselves, requiring fundamentally different methods.
34
+
35
+ Furthermore, our work is an example of cooperative multi-agent learning in partially observable settings under centralized training and decentralized control. There have been a large number of papers in this space, with seminal work including MADDPG (Lowe et al., 2017) and COMA (Foerster et al., 2018a), both of which are actor-critic methods that employ a centralized critic with decentralized actors. Again, we refer the reader to Nguyen et al. (2018) for a more comprehensive survey.
36
+
37
+ Until 2018, work on Hanabi had been focused on hand-coded methods and heuristics. Some relevant examples include SmartBot (O’Dwyer, 2019) and the so-called “hat-coding” strategies, as implemented by WTFWThat (Wu, 2018). These strategies use the information theoretic ideas that allow each hint to reveal information to all other agents at the same time. While they do not perform well for 2-player Hanabi due to the smaller action space, they get near perfect scores for 3-5 players.
38
+
39
+ In contrast, so far learning methods have seen limited success on Hanabi. Bard et al. (2019) undertake a systematic evaluation of current Deep RL methods for 2-5 players in two different regimes and open-source the Hanabi-Learning-Environment (HLE) to foster research on the game. They evaluate a feed-forward version of DQN trained on 100 million samples and a recurrent actor-critic agent with population based training using 20 billion samples. Notably, while both agents achieve near $0 \%$ win rate for 3-5 players in Hanabim, at a high level their DQN agent is a good starting point for our work. However, since the authors did not propose any specific method of accounting for the issues introduced by $\epsilon$ -greedy exploration in a ToM task, they resorted to setting $\epsilon$ to zero after a short burn-in phase. The only state-of-the-art in Hanabi established by an RL agent is from Foerster et al. (2019) which we refer to in more detail in Section 1 and Section 4. Recently there have also been attempts to train agents that are robust to different team-mates (Canaan et al., 2019) and even to extend to human-AI collaboration (Liang et al., 2019). For a more comprehensive review on previous results on Hanabi we refer the reader to Bard et al. (2019).
40
+
41
+ Poker is another partially observable multi-agent setting, although it is fundamentally different due to the game being zero-sum. Recent success in Poker has extensively benefited from search (Brown et al.). Examples of using search in Hanabi include Goodman (2019).
42
+
43
+ # 3 BACKGROUND
44
+
45
+ # 3.1 SETTING
46
+
47
+ In this paper we assume a Dec-POMDP (Oliehoek, 2012), in which $N$ agents interact in a partially observable environment. At each time step agent $a \in 1 . . N$ obtains an observation, $o _ { t } ^ { a } = { \bar { O } } ( s _ { t } , a )$ , where $s _ { t } \in S$ is the Markov state of the system and $O ( s _ { t } , a )$ is the deterministic observation function. Since we are interested in ToM, in our setting the observation function includes the last action of the acting agent, which is observed by all other agents at the next time step. We note that actions are commonly observable not only in board games but also in some real world multi-agent settings, such as autonomous driving.
48
+
49
+ For simplicity, we restrict ourselves to turn based settings, in which at each time step only the acting agents takes an action, $u _ { t } ^ { a }$ , which is sampled from their policy, $u ^ { a } \sim \pi _ { \theta } ^ { a } ( u ^ { a } | \tau ^ { a } )$ , while all other agents take a no-op action. Here $\tau ^ { a }$ is the action-observation history of agent $a$ , $\tau ^ { a } = \{ o _ { 0 } ^ { a } , u _ { 0 } ^ { a } , r _ { 1 } , . . r _ { T } , o _ { T } ^ { a } \}$ , $T$ is the length of the episode and $\theta$ are the weights of a function approximator that represents the policy, in our case recurrent neural networks, such as LSTMs (Hochreiter & Schmidhuber, 1997).
50
+
51
+ We further use $\tau _ { t }$ to describe the state-action sequence, $\tau = \{ s _ { 0 } , \mathbf { u _ { 0 } } , r _ { 1 } , . . r _ { T } , s _ { T } \}$ , where $\mathbf { u _ { t } }$ is the joint action of all agents.
52
+
53
+ As is typical in cooperative multi-agent RL, the goal of the agents is to maximize the total expected return, $J _ { \theta } = \mathbb { E } _ { \tau \sim P ( \tau \mid \theta ) } R _ { 0 } ( \tau )$ , where $R _ { 0 } ( \tau )$ is the return of the trajectory (in general $R _ { t } \bar { ( } \tau ) ~ =$ $\sum _ { t ^ { \prime } \geq t } \gamma ^ { t ^ { \prime } - t } r _ { t ^ { \prime } } )$ and $\gamma$ is an optional discount factor. We have also assumed that agents are sharing parameters, $\theta$ , as is common in cooperative MARL.
54
+
55
+ # 3.2 DISTRIBUTED RECURRENT DQN AND AUXILIARY TASKS
56
+
57
+ In Q-learning the agent approximates the expected return for a given state action-pair, $s , u$ , assuming that the agent acts greedily with respect to the Q-function for all future time steps, $Q ( s , u ) =$ $\mathbb { E } _ { \tau \sim P ( \tau | s , u ) } R _ { t } ( \tau )$ , where $\tau = \{ s _ { t } , u _ { t } , r _ { t + 1 } , . . . , s _ { T } \}$ , $u _ { t } = u$ and $u _ { t ^ { \prime } } = \arg \operatorname* { m a x } _ { u ^ { \prime } } Q ( s _ { t ^ { \prime } } , u ^ { \prime } ) , \forall t ^ { \prime } >$ $t$ . A common exploration scheme is $\epsilon$ -greedy, in which the agent takes a random action with probability $\epsilon$ and acts greedily otherwise. Importantly, the Q-function can be trained efficiently using the Bellman equation: $Q ( s , u ) = \mathbb { E } _ { s ^ { \prime } } [ r _ { t + 1 } + \gamma \operatorname* { m a x } _ { u ^ { \prime } } Q ( s ^ { \prime } , u ^ { \prime } ) ]$ , where for simplicity we have assumed a deterministic reward. In Deep Q-Learning (DQN) (Mnih et al., 2015) the Q-function is parameterized by a deep neural network and trained with transitions sampled from experience replay.
58
+
59
+ In our work we also incorporate other best practice components of the last few years, including doubleDQN (van Hasselt et al., 2015), dueling network architecture (Wang et al., 2015) and prioritized replay (Schaul et al., 2015). We also employ a distributed training architecture similar to the one proposed by Horgan et al. (2018) where a number of different actors with their own exploration rates collect experiences in parallel and feed them into a central replay buffer. Since our setting is partially observable the natural choice for the function approximator is a recurrent neural network. A combination of these techniques was first explored by Kapturowski et al. (2019) in single agent environments such as Atari and DMLab-30.
60
+
61
+ Another common best-practice in RL are auxiliary tasks Mirowski et al. (2016); Jaderberg et al. (2016), in which the agent produces extra output-heads that are trained on supervised tasks and optimized alongside the RL loss.
62
+
63
+ 3.3 CENTRALISED TRAINING, DECENTRALIZED EXECUTION AND JOINT Q-FUNCTIONS
64
+
65
+ The most straight forward application of Q-learning to multi-agent settings is Independent Q-Learning (IQL) (Tan, 1993) in which each agent keeps an independent estimate of the expected return, treating all other agents as part of the environment. One challenge with IQL is that the exploratory behavior of other agents is not corrected for via the max operator in the bootstrap. Notably, IQL does typically not take any advantage of centralized training with decentralised control (CT/DC), a paradigm under which information can be exchanged freely amongst agents during the training phase as long as the policies rely only on local observations during execution.
66
+
67
+ There are various approaches for learning joint-Q-functions in the CT/DC regime. For example, Value-Decomposition-Networks (VDN) (Sunehag et al., 2017) represent the joint-Q-function as a sum of per-agent contributions and QMIX (Rashid et al., 2018) learns a non-linear but monotonic combination of these contributions.
68
+
69
+ # 4 METHOD
70
+
71
+ # 4.1 THEORY OF MIND AND BAYESIAN REASONING
72
+
73
+ At the very core of interpreting the actions of another agent, and ToM in general, is Bayesian reasoning. Fundamentally, asking what a given action by another agent implies about the state of the world requires understanding of why this action was taken. To illustrate this, we start out with an agent that has a given belief about the state-action history of the world, $\tau _ { t }$ , given her own action-observation history $\tau _ { t } ^ { a }$ : $B ( \tau _ { t } ) = P ( \tau _ { t } | \tau _ { t } ^ { a } )$ .
74
+
75
+ Next the agent observes the action $u _ { t } ^ { a ^ { \prime } }$ of her team mate, $a ^ { \prime }$ , and carries out a Bayesian update:
76
+
77
+ $$
78
+ \begin{array} { r l } & { P ( \tau _ { t } | \tau _ { t } ^ { a } , u _ { t } ^ { a ^ { \prime } } ) = \frac { P ( u _ { t } ^ { a ^ { \prime } } | \tau _ { t } ) P ( \tau _ { t } | \tau _ { t } ^ { a } ) } { \sum _ { \tau _ { t } ^ { \prime } } P ( u _ { t } ^ { a ^ { \prime } } | \tau _ { t } ^ { \prime } ) P ( \tau _ { t } ^ { \prime } | \tau _ { t } ^ { a } ) } } \\ & { \qquad = \frac { \pi ^ { a ^ { \prime } } ( u _ { t } ^ { a ^ { \prime } } | O ( a ^ { \prime } , \tau _ { t } ) ) B ( \tau _ { t } ) } { \sum _ { \tau _ { t } ^ { \prime } } \pi ^ { a ^ { \prime } } ( u _ { t } ^ { a ^ { \prime } } | O ( a ^ { \prime } , \tau _ { t } ^ { \prime } ) ) B ( \tau _ { t } ^ { \prime } ) } , } \end{array}
79
+ $$
80
+
81
+ where, with a slight abuse of notation, we have used (and will keep using) $O ( a ^ { \prime } , \tau _ { t } )$ for the actionobservation history, $\tau _ { t } ^ { a ^ { \prime } }$ , that results from applying the observation function for agent $a ^ { \prime }$ to $\tau _ { t }$ at each time step. Note that for non-deterministic observation functions we would have to marginalize over $P ( \tau _ { t } ^ { a ^ { \prime } } | \bar { \tau _ { t } } )$ .
82
+
83
+ Clearly, since agents have access to the policy of their teammate during centralised training, we could in principle evaluate this explicit Bayesian belief. However, beyond the practical difficulty of computing this explicit belief, when it is used as an input to the policy it will lead to prohibitively costly higher order beliefs. The typical workout for this is a public belief over private features which only conditions on common knowledge and can therefore be calculated by all agents individually, we refer to Moravcík et al. (2017); Nayyar et al. (2013); Foerster et al. (2018b) for more details. ˇ
84
+
85
+ Instead, in this work we rely on RNNs to learn implicit representations of the sufficient statistics over the distribution of the Markov state given the action-observation histories, noting that they are unlikely to recover exact beliefs due to the issues mentioned above.
86
+
87
+ # 4.2 EXPLORATION AND BELIEFS
88
+
89
+ Next we illustrate the impact of exploration on the beliefs, which we will do in the explicit (exact) case, since it serves as an upper bound on the accuracy of the implicit beliefs. Since we are looking at fully-cooperative settings we assume that the optimal policy of the agent is deterministic and any randomness is due to exploration. Given that we are focused on value based methods we furthermore assume an $\epsilon$ -greedy exploration scheme, noting that the same analysis can be extended to other methods. Under this exploration scheme $\pi ^ { a ^ { \prime } } ( u _ { t } ^ { a ^ { \prime } } | O ( a ^ { \prime } , \tau _ { t } ) )$ ) becomes:
90
+
91
+ $$
92
+ \pi ^ { a ^ { \prime } } ( u _ { t } ^ { a ^ { \prime } } | O ( a ^ { \prime } , \tau _ { t } ) ) = ( 1 - \epsilon ) \mathbf { I } ( u ^ { * } ( \tau _ { t } ) , u _ { t } ^ { a ^ { \prime } } ) + \epsilon / | U | ,
93
+ $$
94
+
95
+ where we have used $\boldsymbol { u } ^ { * } ( \tau _ { t } )$ to indicate the greedy action of the agent $a ^ { \prime }$ , $\begin{array} { r l } { u ^ { * } ( \tau _ { t } ) } & { { } = } \end{array}$ arg $\operatorname* { m a x } _ { u } Q ^ { a ^ { \prime } } ( u , O ( a ^ { \prime } , \tau _ { t } ) )$ and $\mathbf { I }$ is the indicator function.
96
+
97
+ While the first part corresponds to a filtering operator, in which the indicator function only attributes finite probability to those histories that are consistent with the action taken under greedy execution, the exploration term adds a fixed (history independent) probability, which effectively ‘blurs’ the posterior:
98
+
99
+ $$
100
+ \begin{array} { r l r } { { P ( \tau _ { t } | \tau _ { t } ^ { a } , u _ { t } ^ { a ^ { \prime } } ) = \frac { ( ( 1 - \epsilon ) \mathbf { I } ( u ^ { * } ( \tau _ { t } ) , u _ { t } ^ { a ^ { \prime } } ) + \epsilon / | U | ) B ( \tau _ { t } ) } { \sum _ { \tau ^ { \prime } } ( ( 1 - \epsilon ) \mathbf { I } ( u ^ { * } ( \tau ^ { \prime } ) , u _ { t } ^ { a ^ { \prime } } ) + \epsilon / | U | ) B ( \tau ^ { \prime } ) } } } \\ & { } & { = \frac { ( ( 1 - \epsilon ) \mathbf { I } ( u ^ { * } ( \tau _ { t } ) , u _ { t } ^ { a ^ { \prime } } ) + \epsilon / | U | ) B ( \tau _ { t } ) } { \epsilon / | U | + \sum _ { \tau ^ { \prime } } ( ( 1 - \epsilon ) \mathbf { I } ( u ^ { * } ( \tau ^ { \prime } ) , u _ { t } ^ { a ^ { \prime } } ) ) B ( \tau ^ { \prime } ) } } \\ & { } & { = \frac { B ( \tau _ { t } ) } { 1 + | U | \sum _ { s ^ { \prime } } ( ( 1 / \epsilon - 1 ) \mathbf { I } ( u ^ { * } ( \tau ^ { \prime } ) , u _ { t } ^ { a ^ { \prime } } ) B ( \tau ^ { \prime } ) } } \\ & { } & { + \frac { ( ( 1 - \epsilon ) \mathbf { I } ( u ^ { * } ( \tau _ { t } ) , u _ { t } ^ { a ^ { \prime } } ) ) B ( \tau _ { t } ) } { \epsilon / | U | + \sum _ { \tau ^ { \prime } } ( ( 1 - \epsilon ) \mathbf { I } ( u ^ { * } ( \tau ^ { \prime } ) , u _ { t } ^ { a ^ { \prime } } ) ) B ( \tau ^ { \prime } ) } . } \end{array}
101
+ $$
102
+
103
+ We find that the posterior includes an additional term of the form $B ( \tau _ { t } )$ which carries over an unfiltered density over the trajectories from the prior. We further confirm that in the limit of $\epsilon = 1$ , the posterior collapses to the prior, $P ( \tau _ { t } | \tau _ { t } ^ { a } , u _ { t } ^ { a ^ { \prime } } ) = B ( \tau _ { t } )$ . This can be particularly worrisome in the context of our training setup, whereby different agents run different, and potentially high,  throughout the course of training. It fundamentally makes the beliefs obtained less informative.
104
+
105
+ While not making the above argument explicitly, the Bayesian Action Decoder (BAD) (Foerster et al., 2019), resolves this issue by shifting exploration to the level of deterministic partial policies, rather than action-level, and tracking an approximate Bayesian belief. As outlined in Section 1 this comes at a huge cost in the complexity of the method, the computation requirements and in the loss of generality of the method.
106
+
107
+ # 4.3 SIMPLIFIED ACTION DECODING
108
+
109
+ In this paper we take a drastically simpler and different approach towards the issue. We note that the ‘blurring’, which makes decoding of an action challenging, is entirely due to the $\epsilon$ -greedy exploration term. Furthermore, in order for another agent to do an implicit Bayesian update over an action taken, it is not required that this action is executed by the environment. Indeed, if we assume that other agents can observe the greedy action, $u ^ { * }$ , at every time step and condition their belief update on this, the terms depending on $\epsilon$ disappear from the Bayesian update:
110
+
111
+ $$
112
+ P ( \tau _ { t } | \tau _ { t } ^ { a } , u ^ { * } ) = \frac { \mathbf { I } ( u ^ { * } ( \tau _ { t } ) , u ^ { * } ) \big ) B ( \tau _ { t } ) } { \sum _ { \tau ^ { \prime } } \mathbf { I } ( u ^ { * } ( \tau ^ { \prime } ) , u ^ { * } ) \big ) B ( \tau ^ { \prime } ) }
113
+ $$
114
+
115
+ Therefore, to have our cake and eat it, in the Simplified Action Decoder (SAD) the acting agent is allowed to ‘take’ two actions at any given time step during training. The first action, $u ^ { a }$ , is the standard environment action, which gets executed as usual and is observed by all agents through the observation function at the next time step, as mentioned in Section 3. The second action, $u ^ { * }$ , is the greedy action of the active agent. This action does not get executed by the environment but instead is presented as an additional input to the other agents at the next time step, taking advantage of the centralized training regime during which information can be exchanged freely.
116
+
117
+ Clearly we are not allowed to pass around extra information during decentralized control, but luckily this is not needed. Since we set $\epsilon$ to 0 at test time we can simply use the, now greedy, environment action obtained from the observation function as our greedy-action input.
118
+
119
+ While this is most straight forward in settings where the last action is observed by other agents directly, in principle SAD can also be extended to settings where it is indirectly observed by all agents through the environment dynamics. In these cases we can replace the greedy-action side-channel with a learned inverse model that recovers the action from the observation history during execution.
120
+
121
+ Furthermore, to encourage the agent to meaningfully decode the information contained in the greedy action, we can optionally add an auxiliary task to the training process, such as predicting unobserved information from their observation history .
122
+
123
+ While this idea is compatible with any deep RL algorithm with minimal modifications, we use a recurrent version of DQN with distributed training, dueling networks and prioritized replay. We also learn a joint Q-function using VDN in order to address the challenges of multi-agent off-policy learning, please see Section 3 for details on all of these standard methods.
124
+
125
+ # 5 EXPERIMENTS
126
+
127
+ # 5.1 MATRIX GAME
128
+
129
+ We first verify the effectiveness of SAD in the two step, two player matrix game from Foerster et al. (2019), which replicates the communication through action challenge of Hanabi in a highly simplified setting. In this fully cooperative game each player obtains a privately observed ‘card’, which is drawn iid from two options (1,2).
130
+
131
+ After observing her card, the first player takes one of three possible discrete actions (1, 2, 3). Crucially, the second player observes both her own private card and the team mate’s action before acting herself, which establishes the opportunity to communicate. The payout is a function of both the two private cards and the two actions taken by both agents, as shown in Figure 1.
132
+
133
+ Importantly, there are some obvious strategies that do not “Tiny Hanabi”require any communication. For example, if both player learn to play the 2nd action, the payout is always 8 points, independent of the cards dealt. However, if the players do ● Each player knows their learn to communicate it is possible to achieve 10 points for every pair of cards dealt.
134
+
135
+ # 5.2 HANABI
136
+
137
+ ● Player 2 observes Player Hanabi is a fully cooperative card game in which all play1’s action and acts ers work together to complete piles of cards referred to as second.fireworks. Each card has a rank, 1 to 5, and a color, G / B $/ \textbf { W } / \textbf { Y } / \textbf { R }$ . Each firework (one per color) starts with a 1 and is finished once the 5 has been added. There are three 1s, one 5 and two of all other ranks for each of the colors, adding up to a total of 50 cards in the deck. The twist in Hanabi is that while players can observe the cards held by their team mates, they cannot observe their own cards and thus need to exchange information with each other in order to understand what cards can be played. There are two main means for doing so: First of all, players can take grounded hint actions, in which they reveal the subset of a team mate’s hand that matches a specific rank or color. An example hint is “Your third and fifth card are 1s”. These hint actions cost scarce information tokens, which can be replenished by discarding a card, an action that both removes the card from the game and makes it visible to all players.
138
+
139
+ ![](images/25f404762b879bc27cf6c88933eae05b823c51b2b16509fef1e770d1b412b811.jpg)
140
+ Figure 1: Illustration of the matrix game from Foerster et al. (2019)
141
+
142
+ Finally players can also choose to play a card. If this card is the next card for the firework of the corresponding color, it is added to the firework and the team scores one point. Otherwise the card is removed from the game, the identity is made public, and the team loses one of the 3 life tokens. If the team runs out of life tokens before the end of the game, all points collected so far are lost and the game finishes immediately. These rules result in a maximum score of $5 \times 5 = 2 5$ points in any game, which corresponds to all five fireworks being completed with five cards per firework.
143
+
144
+ To ensure reproducibility and comparability of our results we use the Hanabi Learning Environment (HLE) (Bard et al., 2019) for all experimentation. For further details regarding Hanabi and the self-play part of the Hanabi challenge please see Bard et al. (2019).
145
+
146
+ # 5.3 ARCHITECTURE AND COMPUTATION REQUIREMENTS
147
+
148
+ We borrow some ideas and insights from prior distributed Q-learning methods while bring extensions to MARL as well as innovations to improve throughput and efficiency. Following Horgan et al. (2018) and Kapturowski et al. (2019), we use a distributed prioritized replay buffer shared by $N$ asynchronous actors and a centralized trainer that samples mini-batches from the replay buffer to update the model. In each actor thread, we run $K$ environments sequentially and batch their observations together. The observation batch is then fed into an actor that utilize a GPU to compute a batch of actions. All asynchronous actors share one GPU and the trainer uses another GPU for gradient computation and model updates. This is different from prior works which run single actor and single environment in each thread on a CPU. Our method enables us to run a very large number of simulations with moderate computation resources. In all Hanabi experiments, we run $N = 8 0$ actor threads with $K = 8 0$ environments in each thread on single machine with 40 CPU cores and 2 GPUs. Without this architectural improvement, it may require at least a few hundred CPU cores to run 6400 Hanabi environments, in which case neural network agents and simulations have to be distributed across multiple machines, greatly reducing the reproducibility and accessibility of such research. Please refer to Appendix A for implementation details and hyper-parameters.
149
+
150
+ # 6 RESULTS
151
+
152
+ # 6.1 MATRIX GAME
153
+
154
+ As we can see in Figure 2, even in our simple matrix game the greedy action input makes a drastic difference. With an average reward of around 9.5 points, tabular IQL does well in this task, matching the $B A D$ results from Foerster et al. (2019). However, just by adding the greedy action as an additional input, we obtain an average performance of $9 . 9 7 \pm 0 . 0 2$ . Results are averaged over 100 seeds, and shading is s.e.m. The code is available here: www.bit.ly/2mBJLyk.
155
+
156
+ ![](images/5ad1d82f24e9ee7d32e4c518b21671940bf756b1552a474256a05432182b3238.jpg)
157
+ Figure 2: Results for the matrix game.
158
+
159
+ # 6.2 HANABI
160
+
161
+ As shown in Table 1, our findings from the matrix game are for the most part confirmed on the challenging Hanabi benchmark. To illustrate the contributions of the different components, we compare average scores and win rates across 13 independent training runs of SAD and three different options: IQL is simply the recurrent DQN agent with parameter sharing, VDN is the same agent but also learns a joint Q-function and finally SAD & AuxTask is the SAD agent with the auxiliary task.
162
+
163
+ While we find that SAD significantly outperforms our baselines (IQL and VDN) for 2, 4 and 5 players in terms of average score and/or win rate, there is no significant difference for 3 players, where VDN matches the performance of SAD.
164
+
165
+ Interestingly, the auxiliary task only significantly helps the 2-player performance, where it substantially boosts the average score and win rate. In contrast, it drastically hurts performance for 3-5 players, which opens an interesting avenue for future work.
166
+
167
+ For completeness we have included training curves showing average scores and s.e.m. across all training runs for all numbers of players for our methods and ablations in Appendix B. We find that for 5 players the auxiliary task drastically reduces the variance of SAD and intermittently leads to higher performance during training but ultimately results in lower final performance. We can also clearly see that despite 72 hours of training and billions of samples consumed, the performance has not plateaued for 3-5 players, pointing to an obvious avenue for further improvements.
168
+
169
+ The original numbers in the Hanabi challenge and BAD used population based training (Jaderberg et al., 2018), effectively reporting maximum performance across a large number of different runs. Therefore, for reproducibility purposes, we report evaluations of the best model from our various training runs for each method in Table 2.
170
+
171
+ As shown, under this reporting we establish a new SOTA for learning methods on the self-play part of the Hanabi challenge for 2-5 players, with the most drastic improvements being achieved for 3-5 players. In particular, we beat both the ACHA agent from Bard et al. (2019) and the BAD agent on average score, even though both of them used population based training and require more compute. We note that while we follow the counting convention proposed by the challenge paper, BAD was optimized for a different counting scheme, in which agents keep their scores when they run out of lives. This may explain the higher win rate $( 5 8 . 6 \% )$ of BAD combined with a relatively low mean score, which is exceeded even by our baseline methods. Once again, only the performance for 2-player is significantly improved by the auxiliary task and the 3-player setting is an outlier in the sense that SAD does not improve the best performance compared to VDN.
172
+
173
+ # 7 CONCLUSION AND FUTURE WORK
174
+
175
+ In this paper we presented the Simplified Action Decoder (SAD), a novel deep multi-agent RL algorithm that allows agents to learn communication protocols in settings where no cheap-talk channel is available. On the challenging benchmark Hanabi our work substantially improves the SOTA for an RL method for all numbers of players. For two players SAD establishes a new high-score across any method. Furthermore we accomplish all of this with a method that is both simpler and requires less compute than previous advances. While these are encouraging steps, there is clearly more work to do. In particular, there remains a large performance gap between the numbers achieved by SAD and the known performance of hat-coding strategies (Wu, 2018) for 3-5 players. One possible reason is that SAD does not undertake any explicit exploration in the space of possible conventions. Another promising route for future work is to integrate search with RL, since this has produced SOTA results in a number of different domains including Poker, Go and backgammon.
176
+
177
+ Table 1: Mean performance of our methods and baselines on Hanabi. We take the final models of 13 independent runs, i.e. 13 models per algorithm per player setting. Each model is evaluated on 100K games. Mean and s.e.m over the mean scores of the 13 models are shown in the table. The second row of each section is the win rate.
178
+
179
+ <table><tr><td>Agent</td><td> 2 Players</td><td> 3 Players</td><td> 4 Players</td><td> 5 Players</td></tr><tr><td>IQL (Baseline)</td><td>23.77 ± 0.04 43.88 ± 1.21 %</td><td>23.02 ± 0.10 26.16 ± 2.01 %</td><td>21.99 ± 0.09 10.15 ± 0.86 %</td><td>20.60 ± 0.11 2.27 ± 0.32 %</td></tr><tr><td>VDN</td><td>23.83 ± 0.03</td><td>23.71 ± 0.06</td><td>23.03 ± 0.15</td><td>21.18 ± 0.12</td></tr><tr><td>(Baseline) SAD</td><td>44.97 ± 1.28 % 23.87 ± 0.03</td><td>41.16 ± 1.27 % 23.69 ± 0.05</td><td>23.57 ± 2.20 % 23.27 ± 0.16</td><td>2.26 ± 0.32 % 22.06 ± 0.23</td></tr><tr><td>SAD AuxTask</td><td>47.90 ± 1.10 % 24.02 ± 0.01</td><td>41.12 ± 1.10 % 23.56 ± 0.07</td><td>29.38 ± 2.63 % 22.78 ± 0.10</td><td>7.22 ± 1.29 % 21.47 ± 0.08</td></tr></table>
180
+
181
+ Table 2: Comparison between the previous SOTA learning methods and ours. We take the best model of 13 runs for each of our methods and baselines. Each model is evaluated on 100K games with different seeds. Mean and s.e.m over the 100K games are shown in the table. The s.e.m. is less than 0.01 for most models. Bold numbers are the best results achieved with learning algorithms. The second row of each section is the win rate.
182
+
183
+ <table><tr><td>Agent</td><td>2 Players</td><td> 3 Players</td><td> 4 Players</td><td> 5 Players</td></tr><tr><td>Rainbow (Bard et al., 2019)</td><td>20.64 ± 0.03 2.5%</td><td>18.71 ±0.01 0.2%</td><td>18.00 ± 0.17 0%</td><td>15.26 ± 0.18 0%</td></tr><tr><td>ACHA (Bard et al., 2019)</td><td>22.73 ± 0.12 15.1%</td><td>20.24 ± 0.15 1.1%</td><td>21.57 ± 0.12 2.4%</td><td>16.80 ± 0.13 0%</td></tr><tr><td>BAD (Foerster et al.,2019)</td><td>23.92 ± 0.01 58.56%</td><td>=</td><td>=</td><td>1</td></tr><tr><td>IQL (Baseline) 50.47%</td><td>23.97 ± 0.01 40.25%</td><td>23.69 ± 0.01 19.39%</td><td>22.76 ± 0.01 4.93%</td><td>21.29 ± 0.01</td></tr><tr><td>VDN (Baseline)</td><td>23.96 ± 0.01 50.27%</td><td>23.99 ± 0.01 50.37%</td><td>23.79 ± 0.00 38.86%</td><td>21.80 ± 0.01 4.98%</td></tr><tr><td>SAD</td><td>24.01 ± 0.01 52.39%</td><td>23.93 ± 0.01 48.05%</td><td>23.81 ± 0.01 41.45%</td><td>23.01 ± 0.01 13.93%</td></tr><tr><td>SAD&amp; AuxTask</td><td>24.08 ± 0.01 56.09%</td><td>23.81 ± 0.01 49.74%</td><td>23.47 ± 0.01 33.87%</td><td>22.25 ± 0.01 7.33%</td></tr></table>
184
+
185
+ # REFERENCES
186
+
187
+ Chris L Baker, Julian Jara-Ettinger, Rebecca Saxe, and Joshua B Tenenbaum. Rational quantitative attribution of beliefs, desires and percepts in human mentalizing. Nature Human Behaviour, 1(4): 0064, 2017.
188
+
189
+ Nolan Bard, Jakob N. Foerster, Sarath Chandar, Neil Burch, Marc Lanctot, H. Francis Song, Emilio Parisotto, Vincent Dumoulin, Subhodeep Moitra, Edward Hughes, Iain Dunning, Shibl Mourad, Hugo Larochelle, Marc G. Bellemare, and Michael Bowling. The Hanabi Challenge: A New Frontier for AI Research. arXiv:1902.00506 [cs, stat], February 2019. URL http://arxiv. org/abs/1902.00506. arXiv: 1902.00506.
190
+
191
+ Noam Brown and Tuomas Sandholm. Superhuman AI for heads-up no-limit poker: Libratus beats top professionals. Science, pp. eaao1733, 2017.
192
+
193
+ Noam Brown and Tuomas Sandholm. Superhuman AI for multiplayer poker. Science, pp. eaay2400, 2019.
194
+
195
+ Noam Brown, Tuomas Sandholm, and Brandon Amos. Depth-Limited Solving for ImperfectInformation Games. pp. 14.
196
+
197
+ Murray Campbell, A Joseph Hoane Jr, and Feng-hsiung Hsu. Deep Blue. Artificial intelligence, 134 (1-2):57–83, 2002.
198
+
199
+ Rodrigo Canaan, Julian Togelius, Andy Nealen, and Stefan Menzel. Diverse agents for ad-hoc cooperation in hanabi. arXiv preprint arXiv:1907.03840, 2019.
200
+
201
+ Jakob Foerster, Ioannis Alexandros Assael, Nando de Freitas, and Shimon Whiteson. Learning to communicate with deep multi-agent reinforcement learning. In Advances in Neural Information Processing Systems, pp. 2137–2145, 2016.
202
+
203
+ Jakob Foerster, Francis Song, Edward Hughes, Neil Burch, Iain Dunning, Shimon Whiteson, Matthew Botvinick, and Michael Bowling. Bayesian action decoder for deep multi-agent reinforcement learning. In International Conference on Machine Learning, pp. 1942–1951, 2019.
204
+
205
+ Jakob N Foerster, Gregory Farquhar, Triantafyllos Afouras, Nantas Nardelli, and Shimon Whiteson. Counterfactual multi-agent policy gradients. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018a.
206
+
207
+ Jakob N. Foerster, Francis Song, Edward Hughes, Neil Burch, Iain Dunning, Shimon Whiteson, Matthew Botvinick, and Michael Bowling. Bayesian Action Decoder for Deep Multi-Agent Reinforcement Learning. arXiv:1811.01458 [cs], November 2018b. URL http://arxiv. org/abs/1811.01458. arXiv: 1811.01458.
208
+
209
+ James Goodman. Re-determinizing information set monte carlo tree search in hanabi. arXiv preprint arXiv:1902.06075, 2019.
210
+
211
+ Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural Comput., 9(8):1735– 1780, November 1997. ISSN 0899-7667. doi: 10.1162/neco.1997.9.8.1735. URL http://dx. doi.org/10.1162/neco.1997.9.8.1735.
212
+
213
+ Dan Horgan, John Quan, David Budden, Gabriel Barth-Maron, Matteo Hessel, Hado van Hasselt, and David Silver. Distributed prioritized experience replay. CoRR, abs/1803.00933, 2018. URL http://arxiv.org/abs/1803.00933.
214
+
215
+ Max Jaderberg, Volodymyr Mnih, Wojciech Marian Czarnecki, Tom Schaul, Joel Z Leibo, David Silver, and Koray Kavukcuoglu. Reinforcement learning with unsupervised auxiliary tasks. arXiv preprint arXiv:1611.05397, 2016.
216
+
217
+ Max Jaderberg, Wojciech M. Czarnecki, Iain Dunning, Luke Marris, Guy Lever, Antonio Garcia Castaneda, Charles Beattie, Neil C. Rabinowitz, Ari S. Morcos, Avraham Ruderman, Nicolas Sonnerat, Tim Green, Louise Deason, Joel Z. Leibo, David Silver, Demis Hassabis, Koray Kavukcuoglu, and Thore Graepel. Human-level performance in first-person multiplayer games with population-based deep reinforcement learning. arXiv:1807.01281 [cs, stat], July 2018. doi: 10.1126/science.aau6249. URL http://arxiv.org/abs/1807.01281. arXiv: 1807.01281.
218
+
219
+ Steven Kapturowski, Georg Ostrovski, John Quan, and Will Dabney. RECURRENT EXPERIENCE REPLAY IN DISTRIBUTED REINFORCEMENT LEARNING. pp. 1–19, 2019.
220
+
221
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
222
+
223
+ Claire Liang, Julia Proft, Erik Andersen, and Ross A Knepper. Implicit communication of actionable information in human-ai teams. In Proceedings of the 2019 CHI Conference on Human Factors in Computing Systems, pp. 95. ACM, 2019.
224
+
225
+ Ryan Lowe, Yi Wu, Aviv Tamar, Jean Harb, OpenAI Pieter Abbeel, and Igor Mordatch. Multi-agent actor-critic for mixed cooperative-competitive environments. In Advances in Neural Information Processing Systems, pp. 6379–6390, 2017.
226
+
227
+ Piotr Mirowski, Razvan Pascanu, Fabio Viola, Hubert Soyer, Andrew J Ballard, Andrea Banino, Misha Denil, Ross Goroshin, Laurent Sifre, Koray Kavukcuoglu, et al. Learning to navigate in complex environments. arXiv preprint arXiv:1611.03673, 2016.
228
+
229
+ Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A. Rusu, Joel Veness, Marc G. Bellemare, Alex Graves, Martin Riedmiller, Andreas K. Fidjeland, Georg Ostrovski, Stig Petersen, Charles Beattie, Amir Sadik, Ioannis Antonoglou, Helen King, Dharshan Kumaran, Daan Wierstra, Shane Legg, and Demis Hassabis. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 02 2015. URL http://dx.doi.org/10.1038/nature14236.
230
+
231
+ Matej Moravcík, Martin Schmid, Neil Burch, Viliam Lis ˇ y, Dustin Morrill, Nolan Bard, Trevor \` Davis, Kevin Waugh, Michael Johanson, and Michael Bowling. Deepstack: Expert-level artificial intelligence in heads-up no-limit poker. Science, 356(6337):508–513, 2017.
232
+
233
+ Ashutosh Nayyar, Aditya Mahajan, and Demosthenis Teneketzis. Decentralized stochastic control with partial history sharing: A common information approach. IEEE Transactions on Automatic Control, 58(7):1644–1658, 2013.
234
+
235
+ Thanh Thi Nguyen, Ngoc Duy Nguyen, and Saeid Nahavandi. Deep reinforcement learning for multiagent systems: a review of challenges, solutions and applications. arXiv preprint arXiv:1812.11794, 2018.
236
+
237
+ Arthur O’Dwyer. Hanabi. https://github.com/Quuxplusone/Hanabi, 2019.
238
+
239
+ Frans A Oliehoek. Decentralized pomdps. In Reinforcement Learning, pp. 471–503. Springer, 2012.
240
+
241
+ Tabish Rashid, Mikayel Samvelyan, Christian Schröder de Witt, Gregory Farquhar, Jakob N. Foerster, and Shimon Whiteson. QMIX: monotonic value function factorisation for deep multi-agent reinforcement learning. CoRR, abs/1803.11485, 2018. URL http://arxiv.org/abs/ 1803.11485.
242
+
243
+ Tom Schaul, John Quan, Ioannis Antonoglou, and David Silver. Prioritized Experience Replay. arXiv e-prints, art. arXiv:1511.05952, Nov 2015.
244
+
245
+ David Silver, Aja Huang, Chris J Maddison, Arthur Guez, Laurent Sifre, George Van Den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, et al. Mastering the game of go with deep neural networks and tree search. Nature, 529(7587):484–489, 2016.
246
+
247
+ David Silver, Julian Schrittwieser, Karen Simonyan, Ioannis Antonoglou, Aja Huang, Arthur Guez, Thomas Hubert, Lucas Baker, Matthew Lai, Adrian Bolton, et al. Mastering the game of go without human knowledge. Nature, 550(7676):354, 2017.
248
+
249
+ David Silver, Thomas Hubert, Julian Schrittwieser, Ioannis Antonoglou, Matthew Lai, Arthur Guez, Marc Lanctot, Laurent Sifre, Dharshan Kumaran, Thore Graepel, et al. A general reinforcement learning algorithm that masters chess, shogi, and go through self-play. Science, 362(6419): 1140–1144, 2018.
250
+
251
+ Sainbayar Sukhbaatar, arthur szlam, and Rob Fergus. Learning Multiagent Communication with Backpropagation. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems 29, pp. 2244–2252. Curran Associates, Inc., 2016. URL http://papers.nips.cc/paper/ 6398-learning-multiagent-communication-with-backpropagation.pdf.
252
+
253
+ Peter Sunehag, Guy Lever, Audrunas Gruslys, Wojciech Marian Czarnecki, Vinícius Flores Zambaldi, Max Jaderberg, Marc Lanctot, Nicolas Sonnerat, Joel Z. Leibo, Karl Tuyls, and Thore Graepel. Value-decomposition networks for cooperative multi-agent learning. CoRR, abs/1706.05296, 2017. URL http://arxiv.org/abs/1706.05296.
254
+
255
+ Richard S. Sutton. Learning to predict by the methods of temporal differences. Mach. Learn., 3(1):9–44, August 1988. ISSN 0885-6125. doi: 10.1023/A:1022633531479. URL https: //doi.org/10.1023/A:1022633531479.
256
+
257
+ Ming Tan. Multi-agent reinforcement learning: Independent vs. cooperative agents. In Proceedings of the tenth international conference on machine learning, pp. 330–337, 1993.
258
+
259
+ Hado van Hasselt, Arthur Guez, and David Silver. Deep reinforcement learning with double qlearning. CoRR, abs/1509.06461, 2015. URL http://arxiv.org/abs/1509.06461.
260
+
261
+ Ziyu Wang, Nando de Freitas, and Marc Lanctot. Dueling network architectures for deep reinforcement learning. CoRR, abs/1511.06581, 2015. URL http://arxiv.org/abs/1511.06581.
262
+
263
+ Jeff Wu. Hanabi simulation in rust. https://github.com/WuTheFWasThat/hanabi.rs, 2018.
264
+
265
+ # A NETWORK ARCHITECTURE AND HYPER-PAMAMETERS FOR HANABI
266
+
267
+ Our Hanabi agent uses dueling network architecture (Wang et al., 2015). The main body of the network consists of 1 fully connected layer of 512 units and 2 LSTM (Hochreiter & Schmidhuber, 1997) layers of 512 units, followed by two output heads for value and advantages respectively. The same network configuration is used across all Hanabi experiments. We take the default featurization of HLE and replace the card knowledge section with the V0-Belief proposed by Foerster et al. (2019). The maximum length of an episode is capped at 80 steps and the entire episode is stored in the replay buffer as one training sample. This avoids the “slate hidden states” problem as described in Kapturowski et al. (2019) because we can simply initialize the hidden states of LSTM as zero during training. For exploration and experience prioritization, we follow the simple strategy as in Horgan et al. (2018) and Kapturowski et al. (2019). Each actor executes an $\epsilon _ { i }$ -greedy policy where $\epsilon _ { i } = \bar { \epsilon } ^ { 1 + \frac { 1 } { N - 1 } \alpha }$ for $i \in \{ 0 , . . . , N - 1 \}$ but with a smaller $\epsilon = 0 . 1$ and $\alpha = 7$ . For simplicity, all players of a game use the same epsilon. The per time-step priority $\delta _ { t }$ is the TD error and per episode priority is computed following $\delta _ { e } = \eta \operatorname* { m a x } _ { t } \delta _ { i } + ( 1 - \eta ) \hat { \delta }$ where $\eta = 0 . 9$ . Priority exponent is set to 0.9 and importance sampling exponent is set to 0.6. We use $n$ -step return (Sutton, 1988) and double Q-learning (van Hasselt et al., 2015) for target computation during training. The discount factor $\gamma$ is set to 0.999. The network is updated using Adam optimizer (Kingma & Ba, 2014) with learning rate $l r = 6 . 2 5 \times 1 0 ^ { - 5 }$ and $\epsilon = \dot { 1 . 5 } \times 1 0 ^ { - 5 }$ . Trainer sends its network weights to all actors every 10 updates and target network is synchronized with online network every 2500 updates. These hyper-parameters are fixed across all experiments.
268
+
269
+ In the baseline, we use Independent Q-Learning where each player estimates the Q value and selects action independently at each time-step. Note that all players need to operate on the observations in order to update their recurrent hidden states while only the current player has non-trivial legal moves and other players can only select ‘pass’. Each player then writes its own version of the episode into the prioritized replay buffer and they are sampled independently during training. The prioritized replay buffer contains $2 ^ { 1 7 } ( 1 3 1 0 7 2 )$ episodes. We warm up the replay buffer with 10,000 episodes before training starts. Batch size during training is 128 for games of different numbers of players.
270
+
271
+ As mentioned in Section 4, the SAD agent is built on top of joint Q-function where the Q value is the sum of the individual Q value of all players given their own actions. One episode produces only one training sample with an extra dimension for the number of players. The replay buffer size is reduced to $2 ^ { 1 6 }$ for 2-player and 3-player games and $2 ^ { 1 5 }$ for 4-player and 5-player games. The batch sizes for 2-, 3-, 4-, 5-players are 64, 43, 32, 26 respectively to account for the fact that each sample contains more data.
272
+
273
+ Auxiliary task can be added to the agent to help it decode the greedy action more effectively. In Hanabi, the natural choice is the predict the card of player’s own hand. In our experiments, the auxiliary task is to predict the status of a card, which can be playable, discardable, or unknown. The loss is the average cross entropy loss per card and is simply added to the TD-error of reinforcement learning during training.
274
+
275
+ # B LEARNING CURVES FOR HANABI
276
+
277
+ ![](images/ccf9077cc9f7d726e6a7f0ea3a2fa7941948d5e7bedb2d3bea373709b6945a93.jpg)
278
+ Figure 3 shows learning curves of different algorithms averaged over 13 seeds per algorithm per player setting. Shading is error of the mean.
279
+ Figure 3: Learning Curves
md/train/B1xmOgrFPS/B1xmOgrFPS.md ADDED
@@ -0,0 +1,249 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # META-RCNN: META LEARNING FOR FEW-SHOT OBJECT DETECTION
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Despite significant advances in object detection in recent years, training effective detectors in a small data regime remains an open challenge. Labelling training data for object detection is extremely expensive, and there is a need to develop techniques that can generalize well from small amounts of labelled data. We investigate this problem of few-shot object detection, where a detector has access to only limited amounts of annotated data. Based on the recently evolving meta-learning principle, we propose a novel meta-learning framework for object detection named “Meta-RCNN”, which learns the ability to perform few-shot detection via meta-learning. Specifically, Meta-RCNN learns an object detector in an episodic learning paradigm on the (meta) training data. This learning scheme helps acquire a prior which enables Meta-RCNN to do few-shot detection on novel tasks. Built on top of the Faster RCNN model, in Meta-RCNN, both the Region Proposal Network (RPN) and the object classification branch are meta-learned. The meta-trained RPN learns to provide class-specific proposals, while the object classifier learns to do few-shot classification. The novel loss objectives and learning strategy of Meta-RCNN can be trained in an end-to-end manner. We demonstrate the effectiveness of Meta-RCNN in addressing few-shot detection on Pascal VOC dataset and achieve promising results.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Object detection is the task of identifying various objects in a given image, and localizing them with a bounding box. It is a widely studied problem in computer vision, and following the success deep convolutional neural networks (DCNN) in image classification (Karpathy et al., 2014; Krizhevsky et al., 2012), recent years have witnessed remarkable progress made in object detection based on deep learning. A series of detection algorithms based on DCNNs have been proposed which achieve state-of-the-art results on public detection benchmark datasets (Gidaris & Komodakis, 2015; Girshick et al., 2014; Ren et al., 2015; Lin et al., 2017a;b; Liu et al., 2016; Redmon & Farhadi, 2016). However, all these methods are data hungry, and require large amounts of annotated data to learn an immense number of parameters. For object detection, annotating the data is every expensive (much more than image classification), as it requires not only identifying the categorical labels for every object in the image, but also providing accurate localization information through bounding box coordinates. Moreover, in some applications, such as medical research, it’s often impossible to even collect sufficient data to annotate. This warrants a need for effective detectors that can generalize well from small amounts of annotated data. We refer to the problem of learning detectors from limited labeled data as few-shot detection. For example, in one-shot detection, only one image is available with objects of interest annotated, and a detector needs to train on just this image and generalize. When presented with such small amounts of annotated data, traditional detectors tend to suffer from overfitting. Inspired by the fact that humans can learn a new concepts from little annotated data, we aim to develop a new few-shot detection algorithm.
12
+
13
+ There have been several efforts exploring few-shot learning (Vinyals et al., 2016; Finn et al., 2017; Snell et al., 2017). Many of them follow the principle of meta learning. In meta learning, a set of tasks in a few-shot setting is simulated from a large corpus of annotated data, and the model is optimized to perform well over these few shot tasks. This trains the model to learn how to solve few-shot tasks. However, most existing efforts of meta learning are mainly focused on classification. Adapting few-shot classification algorithms directly for few-shot detection (e.g. by replacing the region classification branch of detector with a meta-learner) is non-trivial because of two major concerns: i). Detection algorithms not only require classifying objects but also need to correctly localize objects in cluttered backgrounds by using a Region Proposal Network (RPN) and bounding box (bbox) regressors. It is thus also desirable that both RPN and bbox regressors should also be capable enough to adapt to few-shot settings. ii). For a given task with one (or few) annotated image(s), the annotated image may contain objects from several classes. But only a few objects of interest are annotated. The goal of the few-shot detector is to detect only these objects of interest. Unfortunately, a naively trained meta-detector’s RPN would detect all objects (even objects from classes not of interest) and try to classify them as one of the classes of interest rather than background images (See Figure 1 for an example).
14
+
15
+ ![](images/7f5f879399d45be9afc799e08fc70cd081a33c773abb9d01cdfd53f0f02dc64e.jpg)
16
+ Figure 1: Few-Shot object detection in the meta-learning setting. From the meta-train dataset, a Kway-Nshot support set and a query set are sampled to create a task. The meta detector makes predictions on the query set by using the knowledge from the support set, and updates the detector based on the loss on the query set. In the example above, there are many objects (person, dog and truck), but it is annotated with the goal of detecting only a person. At test time, a single annotated image from a novel class (bear) is available for the detector to learn a model that can generalize.
17
+
18
+ We aim to address these challenges by proposing a novel method for solving few-shot detection using the meta-learning paradigm. We develop Meta-RCNN, an end to end trainable meta object detector. The proposed Meta-RCNN follows the episodic learning paradigm of meta-learning (Vinyals et al., 2016), where based on a give meta-train dataset, multiple few-shot tasks are simulated. For a given task, we first construct a class prototype for each of the annotated object categories in the support set. Using these prototypes, a class-specific feature map of the entire image is constructed, i.e., we obtain a feature map of the entire image for each of the class prototypes. These feature maps are tailored to detect only objects of the class of the prototype, by giving higher attention to appropriate regions in the image containing that object. Finally, all feature maps are merged to produce a combined feature map, followed by an RPN, and then classification and bbox regression layers.
19
+
20
+ Meta-RCNN learns few-shot detector where the whole framework can be trained via meta-learning in an end-to-end manner. In contrast to the naive adaptation of meta-learning for classification into an object detection framework, Meta-RCNN learns the few-shot classifier, the RPN, and the bbox regressor in the meta-learning setting, thus making all three components suitable for handling fewshot scenarios. Moreover, Meta-RCNN learns a class-specific feature map for a given class prototype enabling easier distinction between classes of interest and backgrounds (where other objects in the image from classes not of interest are considered as backgrounds). We demonstrate the effectiveness of Meta-RCNN on two few-shot detection benchmarks: Pascal VOC and animal subset of ImageNet, and show that Meta-RCNN significantly improves the detection result in few shot settings.
21
+
22
+ # 2 RELATED WORK
23
+
24
+ Generic Object Detection. Object detection based on deep learning can be broadly divided into two families: two-stage detectors and one-stage detectors. Two-stage detectors such as RCNN (Girshick et al., 2014), Fast RCNN (Gidaris & Komodakis, 2015) and Faster RCNN (Ren et al., 2015), first generate a sparse set of proposal candidates, and a fixed-length feature vector is extracted from each of these candidates, followed by a categorical classifier and a bounding box regressor. Twostage detection algorithms have achieved state-of-the-art results on many public benchmarks (He et al., 2016; Lin et al., 2017a), but are relatively slower than one-stage detectors. One-stage detectors such as SSD (Liu et al., 2016), Yolo (Redmon et al., 2016; Redmon & Farhadi, 2016) and RefineDet (Zhang et al., 2018) directly generate categorical proposals from the feature map and thus avoid cascaded region classifiers. One-stage detectors can achieve real-time inference speed but the detection accuracy is often inferior to two-stage detection algorithms. Both detection families assume access to a large set of annotated data, and are not suitable for scenarios where the model has access to small amounts of annotated training data. In contrast, our proposed Meta-RCNN method addresses detection problem of few-shot setting, and achieves promising results.
25
+
26
+ Meta Learning for few-shot classification. Few-shot learning has been widely explored in image classification, and currently the most promising methods are mainly based on meta learning. Ravi & Larochelle (2016) optimized the base-model via an LSTM-based meta-learner which simulates traditional SGD optimization method. Finn et al. (Finn et al., 2017) proposed MAML which learns a good feature initialization which can adapt to a new task in only one gradient step udpate. Based on MAML, Li et al. (2017) proposed Meta-SGD which learns a set of learnable parameters to control gradient step of different tasks. Learning initialization is potentially a very general idea for few-shot learning however, the training process can be unstable (Antoniou et al., 2018) especially for complex problems such as detection. Vinyals et al. (Vinyals et al., 2016; Snell et al., 2017) proposed a matching network which followed a non-parametric principle by learning a differentiable K-Nearest Neighbour model. Ren et al. (Ren et al., 2018) extended this idea to semi-supervised learning by self-learning from the unlabeled data. Sung et al. (Sung et al., 2018) proposed a relation network to automatically define the optimal distance metric. These metric-learning based methods are easy to train and effective in addressing few-shot classification. However, directly adapting these techniques for detection is very challenging as just replacing the object classification branch of a detector with a meta-learner is not sufficient, and training the RPN under a meta-learning paradigm is non-trivial.
27
+
28
+ Few-shot Object Detection. Few-shot detection has received considerably less interest from the community. Dong et al. (Dong et al., 2018) addressed few-shot detection using large scale unlabeled data. Their model is based on a semi-supervised method which extracts knowledge from unlabeled dataset to enrich training dataset by self-paced learning and multi-modal learning. However, their method may be misled by the incorrect predictions from initial model and also requires re-training the model for every new task. Chen et al. (Chen et al., 2018) propose a Low-shot Transfer Detector (LSTD) using regularization to transfer the knowledge from source domain to target domain by minimizing the gap between these two domains. RepMet (Schwartz et al., 2019) is a few-shot detection algorithm based on meta learning. It replaces the fully connected classification layer of a standard detector with modified prototypical network. However, they suffer from the two limitations of the RPN and bbox regression not being able to handle few-shot settings, and difficulties in distinguishing object classes of interest from background (including object classes not of interest). Our proposed method is also based on meta learning but can be optimized end-to-end and addresses these limitations to do effective few-shot detection.
29
+
30
+ # 3 PRELIMINARIES
31
+
32
+ # 3.1 PROBLEM SETTING
33
+
34
+ In this section we present the formal problem setting of few-shot detection investigated in our paper. Assume we have two datasets $L$ and $S$ , where $L$ is a large scale annotated dataset with $L _ { c }$ categories and $S$ is a dataset with only a few annotated images with $S _ { c }$ categories. There is no category overlap between two datasets: $L _ { c } \cap S _ { c } = \phi$ . Our goal is to learn a robust detector based on the annotated data in $L$ and $S$ to detect unlabeled objects of $S$ .
35
+
36
+ The proposed Meta-RCNN aims to learn a general detection framework which can be quickly adapted to different detection tasks which have only a few labeled samples. We follow the standard training scheme of meta learning, which splits the whole learning stage into two parts: meta-training and meta-testing, and the model is optimized over multiple few-shot tasks simulated from the metatraining data. Specifically, during meta-training, few-shot detection tasks are sampled from $L$ , and each task contains a support set and a query set. For the $i$ -th task, $K$ ways (or categories) and $N$ images per category are randomly selected from $L _ { c }$ to build support set: $\mathrm { T } _ { i } ^ { \mathrm { L } , \mathrm { s } }$ . Similarly, $Q$ images per category are randomly selected to build query set $\mathrm { T } _ { i } ^ { \mathrm { L , q } }$ . Support set $\mathrm { T } _ { i } ^ { \mathrm { L } , \mathrm { s } }$ and query set $\mathrm { T } _ { i } ^ { \mathrm { L , q } }$ construct a complete task extracted from $L$ (See Figure 1):
37
+
38
+ $$
39
+ \begin{array} { r } { \mathrm { T } _ { i } ^ { L } = \left\{ \mathrm { T } _ { i } ^ { \mathrm { L } , \mathrm { s } } , \mathrm { T } _ { i } ^ { \mathrm { L } , \mathrm { q } } \right\} } \end{array}
40
+ $$
41
+
42
+ where both the support set and query set are used to train the meta-model. The meta-model optimizes the base-model with respect to the support set and makes predictions on query set. Finally the loss suffered on the query set is used to update the model. In the meta-testing stage, similar to metatraining stage, a set of few-shot tasks are sampled from $S$ :
43
+
44
+ $$
45
+ \begin{array} { r } { \mathrm { T } _ { i } ^ { S } = \left\{ \mathrm { T } _ { i } ^ { { \mathrm { S } } , { \mathrm { s } } } , \mathrm { T } _ { i } ^ { { \mathrm { S } } , { \mathrm { q } } } \right\} } \end{array}
46
+ $$
47
+
48
+ where $\mathrm { T } _ { i } ^ { \mathrm { S , s } }$ is support set and $\mathrm { T } _ { i } ^ { \mathrm { S , q } }$ is query set. The model makes predictions on the query set, and these results are averaged across several few-shot tasks to evaluate the expected performance of the few-shot detector over a variety of novel few-shot detection tasks.
49
+
50
+ # 3.2 OVERVIEW OF FASTER RCNN
51
+
52
+ Meta-RCNN is based on two-stage region based object detection algorithms. In this paper, we use the state-of-the-art detection algorithm Faster RCNN (Ren et al., 2015) as our base model, which is widely used in the computer vision community. Faster RCNN consists of two components, an RPN (Region Proposal Network) for proposal generation and Fast RCNN for region classification. RPN generates a sparse set of proposals which are classified into different categories by the region classifiers. Specifically, RPN extracts a feature vector from each region by scanning the whole image using sliding windows. This is followed by a binary classifier (objects vs backgrounds) and a bounding box regressor, where easy negatives are filtered. For each proposal, a fixed-length feature vector is extracted by using ROI Pooling layers. This vector is then fed into a sequence of dense connected layers branching into two outputs. One output is responsible for representing softmax probability over $K + 1$ classes( $K$ target classes and one background class), and the other one encodes four real-values for refining bounding box position. We denoted $u$ and $v$ as the category and bounding box label respectively, $p$ as the predicted probability distribution over C classes, and $t _ { u }$ as the predicted bounding box prediction of class $u$ , and $\lambda$ as the trade-off parameter. $L _ { \mathrm { c l s } }$ represents softmax loss and $L _ { \mathrm { l o c } }$ represents SmoothL1 loss function. The entire network can be optimized in an end-to-end manner by minimizing loss $L ( p , u , t ^ { u } , v )$ :
53
+
54
+ $$
55
+ \begin{array} { r } { L ( p , u , t ^ { u } , v ) = L _ { \mathrm { c l s } } ( p , u ) + \lambda [ u \geq 1 ] L _ { \mathrm { l o c } } ( t ^ { u } , v ) , } \end{array}
56
+ $$
57
+
58
+ However, two-stage detectors require a lot of training samples to obtain a good performance. In the next section, we present the proposed Meta-RCNN which builds over Faster RCNN and is specifically designed to address few-shot detection.
59
+
60
+ # 4 META-RCNN
61
+
62
+ # 4.1 OVERVIEW
63
+
64
+ We now present our proposed method Meta-RCNN for few-shot detection (See Figure 2 for an overview). Meta-RCNN is trained with multiple few-shot tasks simulated from the meta-train dataset. For each episode, a few object categories of interest are assumed to be annotated (Support set). During meta-training, a prototype is computed for each object category. For each of these category prototypes, a class-specific feature map is generated by using a class-attention module which combines the prototype information with the feature map of the entire image. This feature map only highlights the signals of the class of interest, and suppresses information from other classes. Finally, feature maps of all target categories are combined, followed by RPN and RCNN branches to make predictions on the query set. Based on the loss on the query set, the model is updated.
65
+
66
+ ![](images/b52f0023c1f0af218431b36fa3102c84b153a96259a644df2e977b5e1d5cb980.jpg)
67
+ Figure 2: The Meta-RCNN workflow. A set of prototypes of different categories are extracted from the support set. For each class, conditioned on these prototypes, a class-specific feature map from query set is generated by applying the class attention module to the feature map of the entire image. The new class-specific feature map is tailored to detecting objects of that specific class. The classspecific feature maps are concatenated together and finally, an RPN is applied followed with region classification layer and bounding box regressors. The whole network is optimized via meta learning and can be trained end-to-end.
68
+
69
+ Meta-RCNN is general paradigm to train few-shot detector via by meta-learning. For each task, irrelevant categories and background can be filtered by attention module, and the final generated feature map learns a general representation for the given few-shot detection task. Compared to other variants (Schwartz et al., 2019) which directly replaces the FC classification branch with a metalearning branch, Meta-RCNN is more general and the whole framework can be optimized including RPN and bbox regressors, making all the components few-shot capable. Next, we present the details of the model.
70
+
71
+ # 4.2 META-TRAINING
72
+
73
+ During Meta-Training, multiple Kway-Nshot tasks are simulated from the annotated dataset $L$ . To fit memory size, in Meta-Training stage we train the model using 5way-1shot tasks, and only 5 query images (1 query image per class). This results in a total of 10 images for one task. With this, implementing the meta-training is not too difficult. For each task $T _ { i } ^ { L }$ , images of support set $T _ { i } ^ { L , s }$ are fed into Faster RCNN to generate region features. For each of the object categories of interest (those assumed to be annotated in the support image), a prototype $P _ { c }$ is generated based on the corresponding region features:
74
+
75
+ $$
76
+ P _ { c } = \frac { 1 } { N _ { c } } \sum _ { i } ^ { N _ { c } } { r _ { c } ^ { i } }
77
+ $$
78
+
79
+ where $P _ { c }$ denotes prototype of class $c$ , and $r _ { c } ^ { i }$ denotes $i$ -th region features of all annotated objects from class $c$ . Based on these generated prototypes, images of query set $T _ { i } ^ { L , q }$ are fed into the same Faster RCNN model and we obtain the image feature map before RPN and ROI Pooling. For each category, a class-specific feature map is learned based on the input query image and its corresponding prototype. We use a learnable class attention module here to highlight the signals of target class and suppress signals of other categories. The class attention module is based on basic channel-wise multiplication. The prototype $P _ { c }$ is encoded by a FC layer $\phi$ , which is later combined with feature map $f$ by element-wise multiplication:
80
+
81
+ $$
82
+ F _ { c } = f \odot \phi ( P _ { c } )
83
+ $$
84
+
85
+ For each category $c$ , one new feature map $F _ { c }$ is generated which aims to highlight the objects of class $c$ . Next, all these new feature maps are combined into one feature map $F$ :
86
+
87
+ $$
88
+ F = { \mathrm { c o n c a t e } } \{ F _ { 1 } , F _ { 2 } , . . . , F _ { k } \}
89
+ $$
90
+
91
+ $F$ learns a general representation of $\mathbf { K }$ -classes, where each sub-channel contains information of different classes of interest. Based on the new feature map $F$ , 1x1 conv layer is used to reduce computation cost, followed by RPN to produce region proposals. In order to recover the information lost in attention module, we finally combine the new generated feature map with original feature map by element-wise summation, and crop region features based on the new generated map. Finally, a $\mathrm { K } { + } 1$ region classifier and a bbox regressors are optimized w.r.t the label info from query set $T _ { i } ^ { L , q }$ :
92
+
93
+ $$
94
+ L ( T _ { i } ^ { L , q } ; T _ { i } ^ { L , s } , \theta ) = L _ { \mathrm { l o c } } + L _ { \mathrm { c l s } } + L _ { \mathrm { R P N } }
95
+ $$
96
+
97
+ where $\theta$ represents the parameters of Meta-RCNN.
98
+
99
+ # 4.3 META-TESTING
100
+
101
+ During meta-testing, we sample few-shot detection tasks from $S$ . The annotations of support set are available and we make predictions on the query set to evaluate the performance of Meta-RCNN. For each task $T _ { i } ^ { S }$ , prototypes are generated from support set $\boldsymbol { T } _ { i } ^ { S , q }$ , which are later used to generate new class-specific feature maps of images from query set model based on the labeled images of support set. Th $\boldsymbol { T } _ { i } ^ { S , q }$ . In this stage, we need to finetune theetuning operation addresses the learning limitation of non-parametric method when more labeled images are provided. Finally, we evaluate the output from the query set as traditional detection problem:
102
+
103
+ $$
104
+ p , u = \mathbf { M e t a R C N N } ( T _ { i } ^ { S , q } ; T _ { i } ^ { S , s } , \theta )
105
+ $$
106
+
107
+ where $p$ is class probability vector and $u$ is location set of bounding boxes.
108
+
109
+ # 5 EXPERIMENTS
110
+
111
+ # 5.1 DATASETS AND IMPLEMENTATION DETAILS
112
+
113
+ Table 1: Two few-shot object detection benchmark testbeds for performance evaluation
114
+
115
+ <table><tr><td rowspan=1 colspan=1>DATASET</td><td rowspan=1 colspan=1>Train</td><td rowspan=1 colspan=1>#Img</td><td rowspan=1 colspan=1>#cls</td><td rowspan=1 colspan=1>Test</td><td rowspan=1 colspan=1>#Img</td><td rowspan=1 colspan=1>#cls</td></tr><tr><td rowspan=1 colspan=1>VOC-FSOD</td><td rowspan=1 colspan=1>VOC2007trainval</td><td rowspan=1 colspan=1>~4.9k</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>VOC2007test</td><td rowspan=1 colspan=1>~2.2k</td><td rowspan=1 colspan=1>10</td></tr><tr><td rowspan=1 colspan=1>IMAGENET-FSOD</td><td rowspan=1 colspan=1>ImageNet-LOC</td><td rowspan=1 colspan=1>~ 53k</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>ImageNet-LOC</td><td rowspan=1 colspan=1>~117k</td><td rowspan=1 colspan=1>214</td></tr></table>
116
+
117
+ Benchmark Datasets: We construct two benchmark testbeds to facilitate the performance evaluation for few-shot object detection in meta-learning settings. The first is on Pascal VOC2007, and the second is on the animal subset of ImageNet-LOC dataset. Table 1 gives details of these datasets. Pascal VOC2007 has 20 categories with 5k images in trainval set and $5 \mathrm { k }$ images in test set. A subset of 10 categories are randomly from selected for VOC2007 trainval set for Meta-Training and the remaining 10-category subset of VOC2007 test set is used for Meta-Testing. Images without target object categories are removed. For ImageNet-FSOD benchmark, we use the subset of first 100 animal classes of ImageNet in Meta-Training stage and the subset of remaining 214 animal species in ImageNet-LOC in Meta-Testing stage. The model used in VOC-FSOD benchmark is pre-trained on ImageNet, while in ImageNet-FSOD benchmark, the model is pre-trained on MSCOCO dataset with $1 1 5 \mathrm { k }$ images in 80 categories.
118
+
119
+ Task Generation: For each benchmark, Meta-RCNN is evaluated on multiple tasks with different $K$ way- $N$ shot few-shot settings $N$ annotated images per category). For VOC-FSOD benchmark, we have 3 few-shot settings to evaluate Meta-RCNN: 5way-1shot, 5way-3shot and 5way-5shot. In detection, a single image has more than one object, and proposal generation will automatically increase the number of training samples, so the real number of training samples is about 5 times larger than $N$ . On ImageNet-FSOD benchmark, we mainly follow (Chen et al., 2018) and (Schwartz et al., 2019) with two settings: 50way-1shot and 50way-5shot.
120
+
121
+ Meta-model Parameter Setting: In Meta-Training stage, totally 1000 distinct tasks and 5000 tasks are generated in VOC-FSOD benchmark and ImageNet-FSOD benchmark respectively. There are 10 images per class in query set to update the model weights for 10 epochs. The initial learning rate is set to 1e-3 and is reduced to 1e-4 every 600 tasks and 3500 tasks in VOC-FSOD benchmark and ImageNet-FSOD benchmark. We set the batch size as 5 during query update.
122
+
123
+ Basic Detection Parameter Setting: The parameter settings in Meta-RCNN is identical to vanilla Faster RCNN. Proposal overlap with objects larger than 0.5 are considered positive and less than 0.3 are negative. During Meta-Training the top 128 confident proposals are selected for training and during evaluation, 300 proposals with largest confidence score are selected. we build our MetaRCNN based on Faster RCNN with VGG16 (Simonyan & Zisserman, 2014) and ResNet50 (He et al., 2016) model which is pretrained on ImageNet.
124
+
125
+ Model Evaluation: We evaluate Meta-RCNN based on multiple tasks of few-shot settings, which follows the evaluation metric of standard meta learning. More specifically, in evaluation stage, 200 $K$ shot-N shot tasks are sampled from dataset $S$ and images in query set will be evaluated. Mean average precision(mAP) over selected $K$ categories is used as evaluation metric.
126
+
127
+ # 5.2 RESULTS ON VOC-FSOD BENCHMARK
128
+
129
+ We validate the effectiveness of Meta-RCNN on VOC-FSOD benchmark where subset of 10 VOC categories are selected for Meta-Training and the other ten categories are used for Meta-Testing. For fair comparison, these two subsets are split as similar as possible. For example, we keep animal categories on both sides since they share similar semantic information (see appendix for details). Here we set up three baselines on VOC-FSOD benchmark to compete with proposed Meta-RCNN.
130
+
131
+ • vanilla FRCN (Ren et al., 2015): the vanilla Faster RCNN which is the most popular object detection algorithm with competitive performance on many benchmarks. The vanilla FRCN is not designed for few-shot detection problem, but we try to include this baseline by fine-tuning the detector on the few-shot training data. LSTD (Chen et al., 2018) is a few-shot detection algorithm based on Faster RCNN. LSTD uses categorical regularization items which transfers knowledge of $L$ dataset to $S$ dataset. FRCN-PN is a modified version of Faster RCNN using meta-learning, which replaces final FC classification layer with non-parametric prototypical network (PN), sharing the same principle of RepMet (Schwartz et al., 2019).
132
+
133
+ All three baselines as well as the proposed Meta-RCNN are based on VGG16 (Simonyan & Zisserman, 2014) backbone. For Regular FRCN and LSTD, we first train a global Faster RCNN during Meta-Training. Then the pretrained detector models are adapted to different tasks during MetaTesting. During Meta-Testing, Meta-RCNN and vanilla FRCN are finetuned for 4 epochs while LSTD requires longer finetuning period (10 epochs). For FRCN-PN, prototypes of different categories are extracted as Meta-RCNN, and metric distances are learned to assign correct labels to each proposal. We report the results on Table 2 based on three different settings.
134
+
135
+ From Table 2, the performances of all four methods improve with training shot increasing. Notably, FRCN-PN obtains much less improvement because the non-parametric property of PN layer limits its learning capacity from increased training samples. Benefit from the finetuning operation as well as FC layer in final classification and regression, Meta-RCNN can still maintain consistent improvement when trained with more samples. Furthermore, it’s interesting that Regular FRCN outperforms FRCN-PN even in very few-shot cases (5way-1shot), where non-parametric property does not help PN obtain better performance. We argue this is because few-shot detection problem is more difficult than few-shot classification problem, as we discussed in introduction section. FRCNPN cannot learn a representative prototype of background classes and the whole framework cannot be optimized by meta learning style (e.g., RPN and bbox regressors). The failure of FRCN-PN indicates naively attach components from few-shot classification framework cannot address few-shot detection problem. Finally, our Meta-RCNN achieves better results than all three baselines.
136
+
137
+ Performance of RPN: Here, we present the performance of RPN to validate our concerns of the negative impact of irrelevant categories. We use regular FRCN and FRCN-PN as our baseline. The models are optimized in the same manner as before but during Meta-Testing, we evaluate the recall on each task instead of mAP. From Table 3, Regular FRCN baseline outperform the FRCNPN significantly. This is because objects of irrelevant categories in the same image hurt the training process of RPN. And our proposed Meta-RCNN outperforms these two baseline significantly. Meta
138
+
139
+ Table 2: mAP Performance Evaluation on the VOC-FSOD BENCHMARK
140
+
141
+ <table><tr><td>Method</td><td>5way-1shot</td><td>5way-3shot</td><td>5way-5shot</td></tr><tr><td>vanilla FRCN (Ren et al., 2015)</td><td>14.78% ± 1.02%</td><td>20.34% ±1.26%</td><td>26.89% ± 1.23%</td></tr><tr><td>LSTD (Chen et al., 2018)</td><td>17.66% ± 1.65%</td><td>22.37% ± 0.81%</td><td>29.00% ±1.28%</td></tr><tr><td>FRCN-PN</td><td>12.71% ± 0.70%</td><td>13.91% ± 0.70%</td><td>14.33% ± 0.61%</td></tr><tr><td>Meta-RCNN (ours)</td><td>19.22% ± 1.01%</td><td>24.45% ± 1.20%</td><td>31.11% ± 0.88%</td></tr></table>
142
+
143
+ RCNN learns a general feature map for all Kway-Nshot detection problem and optimize RPN by meta learning scheme, which proves more effective in few-shot settings. Notably, the results are surprising since the recall of RPN in few-shot scenario is significantly lower $( > 9 0 \%$ with enough training data on VOC dataset).
144
+
145
+ <table><tr><td>Model</td><td>Backbone</td><td>5way-1shot</td><td>5way-3shot</td><td>5way-5shot</td></tr><tr><td>vanilla FRCN (Ren et al., 2015)</td><td>VGG16</td><td>24.9%</td><td>26.5%</td><td>28.4%</td></tr><tr><td>FRCN-PN</td><td>VGG16</td><td>24.7%</td><td>24.9%</td><td>26.1%</td></tr><tr><td>Meta-RCNN (ours)</td><td>VGG16</td><td>26.1%</td><td>27.9%</td><td>33.7%</td></tr></table>
146
+
147
+ Table 3: Recall evaluation of Meta-RCNN on VOC-FSOD BENCHMARK test set.
148
+
149
+ # 5.3 RESULTS ON IMAGENET-FSOD BENCHMARK
150
+
151
+ On ImageNet-FSOD benchmark, we adapt weights of detector pretrained on MSCOCO trainval set, and then optimize Meta-RCNN based on this starting point. The Meta-RCNN is evaluated on animal subset of ImageNet-LOC. Animal subset of ImageNet-LOC only contains single animal category per image, so there are no irrelevant classes during training and it’s simpler than the situation we discussed. In addition to FRCN and LSTD, we also include another latest baseline RepMet (Schwartz et al., 2019), which replaces FC classification layers in FRCN with more careful design of PN layers, as well as much more stronger backbone architecture (DCN (Dai et al., 2017) and FPN (Lin et al., 2017a)). In this benchmark, we have 50 categories per task, so we attach a 1x1 convolution layer before class-specific feature map generation to reduce computation cost. We report the results in Tab. 4. In 50way-1shot and 50way-5shot, Meta-RCNN is better than other methods.
152
+
153
+ <table><tr><td>Model</td><td>Backbone</td><td>50way-1shot</td><td>50way-5shot</td></tr><tr><td>vanilla FRCN (Ren et al., 2015)</td><td>VGG16</td><td>16.5%</td><td>34.3%</td></tr><tr><td>LSTD (Chen et al., 2018)</td><td>VGG16</td><td>19.2%</td><td>37.4%</td></tr><tr><td>RepMet (Schwartz et al.,2019)</td><td>DCN+FPN</td><td>24.1%</td><td>39.6%</td></tr><tr><td>Meta-RCNN (ours)</td><td>VGG16</td><td>24.6%</td><td>40.1%</td></tr><tr><td>Meta-RCNN (ours)</td><td>ResNet50</td><td>25.1%</td><td>40.3%</td></tr></table>
154
+
155
+ Table 4: mAP performance evaluation on IMAGENET-FSOD BENCHMARK.
156
+
157
+ # 5.4 DISCUSSIONS
158
+
159
+ Extension to other Meta-Learning Methods: Beyond prototypical networks, other meta-learning methods such as MAML (Finn et al., 2017) in principle can also be applied, e.g., we can apply MAML for vanilla FRCN framework, which updates the base model with the average gradient step of multiple tasks. However, in our experiments, the training process of MAML was unstable. This may be because few-shot detection is generally more difficult than few-shot classification, due to multiple dependent loss objectives (FRCN relies on RPN and regression loss etc.) and more complicated noisy contexts. In future, we plan to explore extensions to other meta-learning methods.
160
+
161
+ # 6 CONCLUSION
162
+
163
+ Object detection has been widely explored but little attention has been given to learning detectors under a few-shot regime. In this paper we propose a meta learning based detection algorithm MetaRCNN, which is robust to few-shot learning, and the proposed training strategies make it more suitable in detection scenario. Specifically it adapts the Faster RCNN method and enables meta-learning of the object classifier, the RPN and the bounding box regressor. The RPN is meta-trained through a novel class-specific attention module. We conduct several experiments and obtain promising results.
164
+
165
+ # REFERENCES
166
+
167
+ Antreas Antoniou, Harrison Edwards, and Amos Storkey. How to train your maml. arXiv preprint arXiv:1810.09502, 2018.
168
+
169
+ Hao Chen, Yali Wang, Guoyou Wang, and Yu Qiao. Lstd: A low-shot transfer detector for object detection. In AAAI, 2018.
170
+
171
+ Jifeng Dai, Haozhi Qi, Yuwen Xiong, Yi Li, Guodong Zhang, Han Hu, and Yichen Wei. Deformable convolutional networks. In ICCV, 2017.
172
+
173
+ Xuanyi Dong, Liang Zheng, Fan Ma, Yi Yang, and Deyu Meng. Few-example object detection with model communication. In TPAMI, 2018.
174
+
175
+ Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In International Conference on Machine Learning, ICML, 2017.
176
+
177
+ Spyros Gidaris and Nikos Komodakis. Object detection via a multi-region and semantic segmentation-aware cnn model. In ICCV, 2015.
178
+
179
+ Ross Girshick, Jeff Donahue, Trevor Darrell, and Jitendra Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In CVPR, 2014.
180
+
181
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
182
+
183
+ Andrej Karpathy, George Toderici, Sanketh Shetty, Thomas Leung, Rahul Sukthankar, and Li FeiFei. Large-scale video classification with convolutional neural networks. In CVPR, 2014.
184
+
185
+ Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In NeurIPS, 2012.
186
+
187
+ Zhenguo Li, Fengwei Zhou, Fei Chen, and Hang Li. Meta-sgd: Learning to learn quickly for fewshot learning. arXiv preprint arXiv:1707.09835, 2017.
188
+
189
+ Tsung-Yi Lin, Piotr Dollar, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie. ´ Feature pyramid networks for object detection. In CVPR, 2017a.
190
+
191
+ Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dollar. Focal loss for dense object ´ detection. In ICCV, 2017b.
192
+
193
+ Wei Liu, Dragomir Anguelov, Dumitru Erhan, Christian Szegedy, Scott Reed, Cheng-Yang Fu, and Alexander C Berg. SSD: Single shot multibox detector. In ECCV, 2016.
194
+
195
+ Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. ICLR, 2016.
196
+
197
+ Joseph Redmon and Ali Farhadi. Yolo9000: Better, faster, stronger. In arXiv preprint arXiv:1612.08242, 2016.
198
+
199
+ Joseph Redmon, Santosh Divvala, Ross Girshick, and Ali Farhadi. You only look once: Unified, real-time object detection. In CVPR, 2016.
200
+
201
+ Mengye Ren, Eleni Triantafillou, Sachin Ravi, Jake Snell, Kevin Swersky, Joshua B Tenenbaum, Hugo Larochelle, and Richard S Zemel. Meta-learning for semi-supervised few-shot classification. arXiv preprint arXiv:1803.00676, 2018.
202
+
203
+ Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In NeurIPS, 2015.
204
+
205
+ Eli Schwartz, Leonid Karlinsky, Joseph Shtok, Sivan Harary, Mattias Marder, Sharathchandra Pankanti, Rogerio Feris, Abhishek Kumar, Raja Giries, and Alex M Bronstein. Repmet: Representative-based metric learning for classification and one-shot object detection. In CVPR, 2019.
206
+
207
+ Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In arXiv preprint arXiv:1409.1556, 2014.
208
+
209
+ Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. In Advances in Neural Information Processing Systems, 2017.
210
+
211
+ Flood Sung, Yongxin Yang, Li Zhang, Tao Xiang, Philip HS Torr, and Timothy M Hospedales. Learning to compare: Relation network for few-shot learning. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018.
212
+
213
+ Oriol Vinyals, Charles Blundell, Timothy Lillicrap, Daan Wierstra, et al. Matching networks for one shot learning. In Advances in neural information processing systems, 2016.
214
+
215
+ Shifeng Zhang, Longyin Wen, Xiao Bian, Zhen Lei, and Stan Z Li. Single-shot refinement neural network for object detection. In CVPR, 2018.
216
+
217
+ # A APPENDIX
218
+
219
+ # A.1 CATEGORY SPLIT IN VOC-FSOD BENCHMARK AND 2
220
+
221
+ Here we describe the category splits ( $\ b { L _ { c } }$ and $S _ { c }$ ) of VOC-FSOD benchmark and ImageNet-FSOD benchmark. These splits are used in all our paper.
222
+
223
+ # VOC-FSOD benchmark:
224
+
225
+ $$
226
+ L _ { c } =
227
+ $$
228
+
229
+ aeroplane, bicycle, ’bird, car, cat, chair, cow, person, pottedplant, tvmonitor
230
+
231
+ $$
232
+ S _ { c } =
233
+ $$
234
+
235
+ bus, motorbike, train, dog, sheep, bottle, sofa, diningtable, horse, boat
236
+
237
+ # ImageNet-FSOD benchmark:
238
+
239
+ $$
240
+ L _ { c } =
241
+ $$
242
+
243
+ kit fox, English setter, Siberian husky, Australian terrier, English springer, grey whale, lesser panda, Egyptian cat, ibex, Persian cat, cougar, gazelle, porcupine, sea lion, malamute, badger, Great Dane, Walker hound, Welsh springer spaniel, whippet, Scottish deerhound, killer whale, mink, African elephant, Weimaraner, soft-coated wheaten terrier, Dandie Dinmont, red wolf, Old English sheepdog, jaguar, otterhound, bloodhound, Airedale, hyena, meerkat, giant schnauzer, titi, three-toed sloth, sorrel, black-footed ferret, dalmatian, black-and-tan coonhound, papillon, skunk, polecat, Staffordshire bullterrier, Mexican hairless, Bouvier des Flandres, weasel, miniature poodle, malinois, bighorn, fox squirrel, colobus, tiger cat, Lhasa, impala, coyote, Yorkshire terrier, Newfoundland, brown bear, red fox, Norwegian elkhound, Rottweiler, hartebeest, Saluki, grey fox, schipperke, Pekinese, Brabancon griffon, West Highland white terrier, Sealyham terrier, guenon, mongoose, indri, tiger, Irish wolfhound, wild boar, EntleBucher, zebra, ram, French bulldog, orangutan, basenji, leopard, Bernese mountain dog, Maltese dog, Norfolk terrier toy terrier vizsla, cairn, squirrel monkey, groenendael, clumber, Siamese cat, chimpanzee, komondor, Afghan hound, Japanese spaniel, proboscis monkey, guinea pig
244
+
245
+ $$
246
+ S _ { c } =
247
+ $$
248
+
249
+ Pomeranian, wombat, hare, snow leopard, Arctic fox, Sussex spaniel, lynx, wood rabbit, Saint Bernard, redbone, chow, collie, German shepherd, affenpinscher, dingo, golden retriever, American Staffordshire terrier, briard, kelpie, Tibetan terrier, cocker spaniel, sloth bear, standard poodle, wire-haired fox terrier, Border terrier, American black bear, Bedlington terrier, banded gecko, wallaby, Tibetan mastiff, flat-coated retriever, koala, toy poodle, Border collie, Chesapeake Bay retriever, German short-haired pointer, great grey owl, Doberman, Lakeland terrier, miniature pinscher, timber wolf, hog, marmot, Irish setter, bull mastiff, Irish terrier, Shetland sheepdog, keeshond, miniature schnauzer, llama, Pembroke, ice bear, standard schnauzer, white wolf, Boston bull, Gordon setter, Great Pyrenees, Irish water spaniel, warthog, Scotch terrier, Chihuahua, Norwich terrier, Rhodesian ridgeback, borzoi, gibbon, Samoyed, tabby, Kerry blue terrier, Labrador retriever, thunder snake, Ibizan hound, beagle, curly-coated retriever, African hunting dog, boxer, common newt, giant panda, ringneck snake, Angora, beaver, lion, bluetick, basset, alligator lizard, armadillo, pug, Greater Swiss Mountain dog, hognose snake, dhole, echidna, sidewinder, Komodo dragon, silky terrier, Brittany spaniel, patas, European fire salamander, Madagascar cat, macaque, boa constrictor, gorilla, polecat, howler monkey, Appenzeller, Blenheim spaniel, Indian cobra, Shih-Tzu, baboon, kuvasz, horned viper, rhinoceros beetle, tailed frog, Eskimo dog, Gila monster, mud turtle, capuchin, spider monkey, Leonberg, garter snake, African chameleon, barracouta, bullfrog, spotted salamander, leatherback turtle, rock python, marmoset, otter, Arabian camel, gar, tarantula, langur, tench, platypus, Italian greyhound, box turtle, cheetah, hippopotamus, English foxhound, eft, admiral, night snake, whiptail, siamang, agama, bittern, terrapin, axolotl, African grey, African crocodile, frilled lizard, quail, water ouzel, sulphur-crested cockatoo, bison, bustard, bulbul, cock, prairie chicken, ruffed grouse, jay, partridge, tusker, spoonbill, green snake, junco, black grouse, crane, water buffalo, toucan, redshank, hornbill, ostrich, vine snake, hummingbird, Indian elephant, magpie, albatross, king snake, little blue heron, bald eagle, peacock, limpkin, hamster, ruddy turnstone, jacamar, green mamba, kite, indigo bunting, American egret, American coot, coucal, house finch, ptarmigan, black stork, robin, white stork, brambling, red-backed sandpiper, king penguin, goldfinch, lorikeet, water snake, macaw, drake, vulture, bee eater, hen, dowitcher, red-breasted merganser, ox, diamondback, oystercatcher, goose, pelican, black swan,
md/train/BJxhLAuxg/BJxhLAuxg.md ADDED
@@ -0,0 +1,232 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # A DEEP LEARNING APPROACH FOR JOINT VIDEOFRAME AND REWARD PREDICTION IN ATARI GAMES
2
+
3
+ Felix Leibfried ∗
4
+ Max Planck Institute for Intelligent Systems
5
+ Max Planck Institute for Biological Cybernetics
6
+ Graduate Training Center of Neuroscience
7
+ Tuebingen, Germany
8
+ felix.leibfried@gmail.com
9
+
10
+ Nate Kushman & Katja Hofmann
11
+
12
+ Microsoft Research
13
+ Cambridge, UK
14
+ nkushman@microsoft.com
15
+ katja.hofmann@microsoft.com
16
+
17
+ # ABSTRACT
18
+
19
+ Reinforcement learning is concerned with learning to interact with environments that are initially unknown. State-of-the-art reinforcement learning approaches, such as DQN, are model-free and learn to act effectively across a wide range of environments such as Atari games, but require huge amounts of data. Modelbased techniques are more data-efficient, but need to acquire explicit knowledge about the environment dynamics or the reward structure.
20
+
21
+ In this paper we take a step towards using model-based techniques in environments with high-dimensional visual state space when system dynamics and the reward structure are both unknown and need to be learned, by demonstrating that it is possible to learn both jointly. Empirical evaluation on five Atari games demonstrate accurate cumulative reward prediction of up to 200 frames. We consider these positive results as opening up important directions for model-based RL in complex, initially unknown environments.
22
+
23
+ # 1 INTRODUCTION
24
+
25
+ When humans or animals receive reward for taking a particular action in a given situation, the probability is increased that they will act similarly in similar situations in the future. This is described by principles such as the law of effect (Thorndike, 1898), operant conditioning (Skinner, 1938) and trial-and-error learning (Thorpe, 1979) in behaviorist psychology, and has inspired a discipline of artificial intelligence called reinforcement learning (RL, Sutton & Barto (1998)). RL is concerned with finding optimal behavior policies in order to maximize agents’ cumulative future reward.
26
+
27
+ Approaches to RL can be divided into model-free and model-based approaches. In model-free approaches, agents learn by trial and error but do not aim to explicitly capture the dynamics of the environment or the structure of the reward function underlying the environment. State-of-the-art modelfree approaches, such as DQN (Mnih et al., 2015), effectively approximate so-called Q-values, i.e., the value of taking specific actions in a given state, using deep neural networks. The impressive effectiveness of these approaches comes from their ability to learn complex policies directly from high-dimensional input (e.g., video frames). Despite their effectiveness, model-free approaches require large amounts of training data that have to be collected through direct interactions with the environment, which makes them expensive to apply in settings where interactions are costly (such as most real-world applications). Additionally, model-free RL requires access to reward observations during training, which is problematic in environments with sparse reward structure—unless coupled with an explicit exploration mechanism.
28
+
29
+ RL approaches that explicitly learn statistics about the environment or the reward are generally referred to as model-based—in a more narrow definition these statistics comprise environment dynamics and the reward function. In recent work, model-based techniques were successfully used to learn statistics about cumulative future reward (Veness et al., 2015) and to improve exploration by favoring actions that are likely to lead to novel states (Bellemare et al., 2016; Oh et al., 2015), resulting in substantially more data efficient learning compared to model-free approaches. When an accurate model of the true environment dynamics and the true reward function is available, modelbased approaches, such as planning via Monte-Carlo tree search (Browne et al., 2012) outperform model-free state-of-the-art approaches (Guo et al., 2014).
30
+
31
+ A key open question is whether effective model-based RL is possible in complex settings where the environment dynamics and the reward function are initially unknown, and the agent has to acquire such knowledge through experience. In this paper, we take a step towards addressing this question by extending recent work on video frame prediction (Oh et al., 2015), which has been demonstrated to effectively learn system dynamics, to enable joint prediction of future states and rewards using a single latent representation. We propose a network architecture and training procedure for joint state and reward prediction, and evaluate our approach in the Arcade Learning Environment (ALE, Bellemare et al. (2013)).
32
+
33
+ Our empirical results on five Atari games demonstrate that our approach can successfully predict cumulative reward up to roughly 200 frames. We complement our quantitative results with a detailed error analysis by visualizing example predictions. Our results are the first to demonstrate the feasibility of using a learned dynamics and reward model for accurate planning. We see this as a significant step towards data efficient RL in high-dimensional environments without prior knowledge.
34
+
35
+ # 2 RELATED WORK AND MOTIVATION
36
+
37
+ Two lines of research are related to the work presented in this paper: model-based RL and optimal control theory. Model-based RL utilizes a given or learned model of some aspect of a task to, e.g., reduce data or exploration requirements (Bellemare et al., 2016; Oh et al., 2015; Veness et al., 2015). Optimal control theory describes mathematical principles for deriving control policies in continuous action spaces that maximize cumulative future reward in scenarios with known system dynamics and known reward structure (Bertsekas, 2007; 2005).
38
+
39
+ There has been recent interest in combining principles from optimal control theory and model-based learning in settings where no information on system dynamics is available a priori and instead has to be acquired from visual data (Finn et al., 2016; Wahlstrom et al., 2015; Watter et al., 2015). The ¨ general idea behind these approaches is to learn a compressed latent representation of the visual state space from raw images through autoencoder networks (Bengio, 2009) and to utilize the acquired latent representation to infer system dynamics. System dynamics are then used to specify a planning problem which can be solved by optimization techniques to derive optimal policies. Watter et al. (2015) introduce an approach for learning system dynamics from raw visual data by jointly training a variational autoencoder (Kingma & Welling, 2014; Rezende et al., 2014) and a state prediction model that operates in the autoencoder’s compressed latent state representation. A similar approach for jointly learning a compressed state representation and a predictive model is pursued by Wahlstrom et al. (2015).Finn et al. (2016) devise a sequential approach that first learns a latent state ¨ representation from visual data and that subsequently exploits this latent representation to augment a robot’s initial state space describing joint angles and end-effector positions. The augmented state space is then used to improve estimates of local system dynamics for planning.
40
+
41
+ The approaches presented above assume knowledge of the functional form of the true reward signal and are hence not directly applicable in settings like ALE (and many real-world settings) where the reward function is initially unknown. Planning in such settings therefore necessitates learning both system dynamics and reward function in order to infer optimal behavioral policies. Recent work by Oh et al. (2015) introduced an approach for learning environment dynamics from pixel images and demonstrated that this enabled successful video frame prediction over up to 400 frames. In our current paper, we extend this recent work to enable reward prediction as well by modifying the network’s architecture and training objective accordingly. The modification of the training objective bears a positive side effect: since our network must optimize a compound loss consisting of the video frame reconstruction loss and the reward loss, reward-relevant aspects in the video frames to which the reconstruction loss alone might be insensitive are explicitly captured by the optimization objective. In the subsequent section, we elucidate the approach from Oh et al. (2015) as well as our extensions for reward prediction in more detail.
42
+
43
+ ![](images/debc0e4e13acb719598c45070f146487cd9562cd8f9454fa101138d9cea47c15.jpg)
44
+ Figure 1: Network architecture for joint video frame and reward prediction. The architecture comprises three stages: an encoding stage mapping current input frames to some compressed latent representation, a transformation stage integrating the current action into the latent representation through element-wise vector multiplication denoted by $" \times "$ , and a final predictive stage for reconstructing the frame of the next time step and the current reward. The network uses three different types of neuron layers (’Conv’ for convolutional, ’Deconv’ for deconvolutional and ’Fc’ for forward connection) in combination with three different types of activation functions (’ReLU’, ’Softmax’ and ’Lin’ for linear activations). The dimensional extend of individual layers is either depicted beneath or within layers. The network part coloured in red highlights the extension for reward prediction.
45
+
46
+ # 3 NETWORK ARCHITECTURE AND TRAINING
47
+
48
+ The deep network proposed by Oh et al. (2015) for video frame prediction in Atari games aims at learning a function that predicts the video frame $\mathbf { s } _ { t + 1 }$ at the next time step $t + 1$ , given the current history of frames $\mathbf { S } _ { t - h + 1 : t }$ with time horizon $h$ and the current action $\mathbf { a } _ { t }$ taken by the agent—see Section 3.1. Here, we extend this work to enable joint video frame and reward prediction such that the network anticipates the current reward $\mathbf { r } _ { t }$ as well—see Sections 3.2 and 3.3.
49
+
50
+ # 3.1 VIDEO FRAME PREDICTION
51
+
52
+ The video-frame-predictive architecture from Oh et al. (2015) comprises three informationprocessing stages: an encoding stage that maps input frames to some compressed latent representation, a transformation stage that integrates the current action into the compressed latent representation, and a decoding stage that maps the compressed latent representation to the predicted next frame—see Figure 1. The initial encoding stage is a sequence of convolutional and forward operations that map the current frame history $\mathbf { S } _ { t - h + 1 : t }$ —a three-dimensional tensor—to a compressed feature vector $\mathbf { h } _ { t } ^ { \mathrm { e n c } }$ . The transformation stage converts this compressed feature vector $\mathbf { h } _ { t } ^ { \mathrm { e n c } }$ into an action-conditional representation $\mathbf { h } _ { t } ^ { \mathrm { d e c } }$ in vectorized form by integrating the current action $\mathbf { a } _ { t }$ . The current action $\mathbf { a } _ { t }$ is represented as a one-hot vector with length varying from game to game since there are at least 3 and at most 18 actions in ALE. The integration of the current action into the compressed feature vector includes an element-wise vector multiplication—depicted as $\because \mathbf { \nabla } _ { \times } ,$ in Figure 1—with the particularity that the two neuron layers involved in this element-wise multiplication are the only layers in the entire network without bias parameters, see Section 3.2 in Oh et al. (2015). Finally, the decoding stage performs a series of forward and deconvolutional operations (Dosovitskiy et al., 2015; Zeiler et al., 2010) by mapping the action-conditional representation $\mathbf { h } _ { t } ^ { \mathrm { d e c } }$ of the current frame history $\mathbf { S } _ { t - h + 1 : t }$ and the current action $\mathbf { a } _ { t }$ to the predicted video frame $\mathbf { s } _ { t + 1 }$ of the next time step $t + 1$ . Note that this necessitates a reshape operation at the beginning of the decoding cascade in order to transform the vectorized hidden representation into a three-dimensional tensor. The whole network uses linear and rectified linear units (Glorot et al., 2011) only. In all our experiments, following DQN (Mnih et al., 2015), the video frames processed by the network are $8 4 \times 8 4$ grey-scale images down-sampled from the full-resolution $2 1 0 \times 1 6 0$ Atari RGB images from ALE. Following Mnih et al. (2015) and Oh et al. (2015), the history frame time horizon $h$ is set to 4.
53
+
54
+ # 3.2 REWARD PREDICTION
55
+
56
+ In this section we detail our proposed network architecture for joint state and reward prediction. Our model assumes ternary rewards which result from reward clipping in line with Mnih et al. (2015). Original game scores in ALE are integers that can vary significantly between different Atari games and the corresponding original rewards are clipped to assume one of three values: $- 1$ for negative rewards, 0 for no reward and 1 for positive rewards. Because of reward clipping, rewards can be represented as vectors $\mathbf { r } _ { t }$ in one-hot encoding of size 3.
57
+
58
+ In Figure 1, our extension of the video-frame-predictive architecture from Oh et al. (2015) to enable reward prediction is highlighted in red. We add an additional softmax layer to predict the current reward $\mathbf { r } _ { t }$ with information contained in the action-conditional encoding $\dot { \mathbf { h } } _ { t } ^ { \mathrm { d e c } }$ . The motivation behind this extension is twofold. First, our extension makes it possible to jointly train the network with a compound objective that emphasizes both video frame reconstruction and reward prediction, and thus encourages the network to not abstract away reward-relevant features to which the reconstruction loss alone might be insensitive. Second, this formulation facilitates the future use of the model for reward prediction through virtual roll-outs in the compressed latent space, without the computational expensive necessity of reconstructing video frames explicitly—note that this requires another ”shortcut” predictive model to map from $\mathbf { h } _ { t } ^ { \mathrm { d e c } }$ to $\mathbf { h } _ { t + 1 } ^ { \mathrm { e n c } }$ .
59
+
60
+ Following previous work (Oh et al., 2015; Mnih et al., 2015), actions are chosen by the agent on every fourth frame and are repeated on frames that were skipped. Skipped frames and repeated actions are hence not part of the data sets used to train and test the predictive network on, and original reward values are accumulated over four frames before clipping.
61
+
62
+ # 3.3 TRAINING
63
+
64
+ Training the model for joint video frame and reward prediction requires trajectory samples $\left\{ \left( \mathbf { s } _ { n } ^ { ( i ) } , \mathbf { a } _ { n } ^ { ( i ) } , \mathbf { r } _ { n } ^ { ( i ) } \right) _ { n = 1 } ^ { N } \right\} _ { i = 1 } ^ { I }$ collected by some agent playing the Atari game, where $i$ is an index over trajectories and $n$ is a time index over samples within one trajectory $i$ . The parameter $I$ denotes the number of trajectories in the training set or the minibatch respectively and the parameter $N$ denotes the length of an individual trajectory. In our case, we use agents trained according to Mnih et al. (2015) in order to collect trajectory samples.
65
+
66
+ The original training objective in Oh et al. (2015) consists of a video frame reconstruction loss in terms of a squared loss function aimed at minimizing the quadratic $l ^ { 2 }$ -norm of the difference vector between the ground truth image and its action-conditional reconstruction. We extend this training objective to enable joint reward prediction. This results in a compound training loss consisting of the original video frame reconstruction loss and a reward prediction loss given by the cross entropy (Simard et al., 2003) between the ground truth reward and the corresponding prediction:
67
+
68
+ $$
69
+ L _ { K } ( \boldsymbol \theta ) = \frac { 1 } { 2 \cdot I \cdot T \cdot K } \sum _ { i = 1 } ^ { I } \sum _ { t = 0 } ^ { T - 1 } \sum _ { k = 1 } ^ { K } ( \underbrace { | \mathbf { s } _ { t + k } ^ { ( i ) } - \hat { \mathbf { s } } _ { t + k } ^ { ( i ) } | | _ { 2 } ^ { 2 } } _ { \mathrm { v i d e o f r a m e r e c o n s t u c t i o n 1 0 s s } } + \underbrace { \lambda \cdot ( - 1 ) \sum _ { l = 1 } ^ { 3 } \mathbf { r } _ { t + k } ^ { ( i ) } [ l ] \cdot \ln \mathbf { p } _ { t + k } ^ { ( i ) } [ l ] } _ { \mathrm { r e w a r d p r e d i c i t i o n 1 l o s s } } ) ,
70
+ $$
71
+
72
+ where $\hat { \mathbf { s } } _ { t + k } ^ { ( i ) }$ denotes the $k$ -step look ahead frame prediction with target video frame $\mathbf { s } _ { t + k } ^ { ( i ) }$ and p(i)t+k denotes the in red in Fi -step look ahead probability vare1—with target reward vector $\mathbf { r } _ { t + k } ^ { ( i ) }$ f the reward-p. The paramete $\lambda > 0$ softmax layer—depicted controls the trade-off between video frame reconstruction and reward loss. The parameter $T$ determines how often a single trajectory sample $i$ is unrolled into the future, and $K$ determines the look ahead prediction horizon dictating how far the network predicts into the future by using its own video frame predicted output as input for the next time step. Following Oh et al. (2015) and Michalski et al. (2014), we apply a curriculum learning (Bengio et al., 2009) scheme by successively increasing $K$ in the course of training such that the network initially learns to predict over a short time horizon and becomes fine-tuned on longer-term predictions as training advances (see Section A.1 for details). The network parameters $\theta$ are updated by stochastic gradient descent, derivatives of the training objective w.r.t. $\theta$ are computed with backpropagation through time (Werbos, 1988).
73
+
74
+ # 4 RESULTS
75
+
76
+ In our evaluations, we investigate cumulative reward predictions quantitatively and qualitatively on five different Atari games (Q\*bert, Seaquest, Freeway, Ms Pacman and Space Invaders). The quantitative analysis comprises evaluating the cumulative reward prediction error—see Section 4.1. The qualitative analysis comprises visualizations of example predictions in Seaquest—see Section 4.2.
77
+
78
+ 4.1 QUANTITATIVE REWARD PREDICTION ANALYSIS: CUMULATIVE REWARD ERROR
79
+
80
+ Our quantitative evaluation examines whether our joint model of system dynamics and reward function results in a shared latent representation that enables accurate cumulative reward prediction. We assess cumulative reward prediction on test sets consisting of approximately 50,000 video frames per game, including actions and rewards. Each network is evaluated on 1,000 trajectories—suitable to analyze up to 100-step ahead prediction—drawn randomly from the test set. Look ahead prediction is measured in terms of the cumulative reward error which is the difference between ground truth cumulative reward and predicted cumulative reward. For each game, this results in 100 empirical distributions over the cumulative reward error—one distribution for each look ahead step—consisting of 1,000 samples each (one for each trajectory). We compare our model predictions to a baseline model that samples rewards from the marginal reward distribution observed on the test set for each game. Note that negative reward values are absent in the games investigated for this study.
81
+
82
+ Figure 2 illustrates 20 of the 100 empirical cumulative reward error distributions in all games for our network model in blue and for the baseline model in red (histograms, bottom), together with the median and the 5 to 95 percentiles of the cumulative reward error over look ahead steps (top). Across all games, we observe that our joint state and reward prediction model accurately predicts future cumulative rewards at least 20 look ahead steps, and that it predicts future rewards substantially more accurately than the baseline model. This is evidenced by cumulative reward error distributions that maintain a unimodal form with mode zero and do not flatten out as quickly as the distributions for the random-prediction baseline model. Best results are achieved in Freeway and $\boldsymbol { \mathrm { Q } } ^ { * } \boldsymbol { \mathrm { b e r t } }$ where the probability of zero cumulative reward error at 51 look ahead steps is still around $8 0 \%$ and $6 0 \%$ respectively—see Figure 2. Note that 51 look ahead steps correspond to 204 frames because the underlying DQN agent, collecting trajectory samples for training and testing our model, skipped every fourth frame when choosing an action—see Section 3.2. Lowest performance is obtained in Seaquest where the probability of zero cumulative reward error at 26 steps (104 frames) is around $4 0 \%$ and begins to flatten out soon thereafter—see Figure 2. Running the ALE emulator at a frequency of 60fps, 26 steps correspond to more than 1 second real-time game play because of frame skipping. Since our model is capable of predicting 26 steps ahead in less than 1 second, our model enables real-time planning and could be therefore utilized in an online fashion.
83
+
84
+ We now turn our attention to error analysis. While the look ahead step at which errors become prominent differs substantially from game to game, we find that overall our model underestimates cumulative reward. This can be seen in the asymmetry towards positive cumulative reward error values when inspecting the 5 to 95 percentile intervals in the first plot per each game in Figure 2. We identify a likely cause in (pseudo-)stochastic transitions inherent in these games. Considering Seaquest as our running example, objects such as divers and submarines can enter the scene randomly from the right and from the left and at the same time have an essential impact on which rewards the agent can potentially collect. In the ground truth trajectories, the agent’s actions are reactions to these objects. If the predicted future trajectory deviates from the ground truth, targeted actions such as shooting will miss their target, leading to underestimating true reward. We analyze this effect in more detail in Section 4.2.
85
+
86
+ All our experiments were conducted in triplicate with different initial random seeds. Different initial random seeds did not have a significant impact on cumulative reward prediction in all games except Freeway—see Section A.5 for a detailed analysis. So far, we discussed results concerning reward prediction only. In the appendix, we also evaluate the joint performance of reward and video frame prediction on the test set in terms of the optimization objective as in Oh et al. (2015), where the authors report successful video frame reconstruction up to approximately 100 steps (400 frames), and observe similar results—see Section A.6.
87
+
88
+ In the previous section, we identified stochasticity in state transitions as a likely cause for relatively low performance in long-term cumulative reward prediction in games such as Seaquest. In Seaquest objects may randomly enter a scene in a non-deterministic fashion. Errors in predicting these events result in predicted possible futures that do not match actually observed future states, resulting in inaccurate reward predictions. Here, we support this hypothesis by visualizations in Seaquest illustrating joint video frame and reward prediction for a single network over 20 steps (80 frames)—see Figure 3 where ground truth video frames are compared to predicted video frames in terms of error maps. Error maps emphasize the difference between ground truth and predicted frames through squared error values between pixels in black or white depending on whether objects are absent or present by mistake in the network’s prediction. Actions, ground truth rewards and model-predicted rewards are shown between state transitions. Peculiarities in the prediction process are shown in red.
89
+
90
+ In step 2, the model predicts reward by mistake because the agent barely misses its target. Steps 4 to 6 report how the model predicts reward correctly but is off by one time step. Steps 7 to 14 depict problems caused by objects randomly entering the scene from the right which the model cannot predict. Steps 26 to 30 show how the model has problems to predict rewards at steps 26 and 28 as these rewards are attached to objects the model failed to notice entering the scene earlier.
91
+
92
+ # 5 CONCLUSION AND FUTURE WORK
93
+
94
+ In this paper, we extended recent work on video frame prediction (Oh et al., 2015) in Atari games to enable reward prediction. Our approach can be used to jointly predict video frames and cumulative rewards up to a horizon of approximately 200 frames in five different games ( $\mathbf { Q } ^ { * }$ bert, Seaquest, Freeway, Ms Pacman and Space Invaders). We achieved best results in Freeway and $\mathbf { Q } ^ { * }$ bert where the probability of zero cumulative reward error after 200 frames is still around $8 0 \%$ and $6 0 \%$ respectively, and worst results in Seaquest where the probability of zero cumulative reward error after 100 frames is around $4 0 \%$ . Our study fits into the general line of research using autoencoder networks to learn a latent representation from visual data (Finn et al., 2016; Goroshin et al., 2015; Gregor et al., 2015; Kulkarni et al., 2015; Srivastava et al., 2015; Wahlstrom et al., 2015; Watter et al., 2015; ¨ Kingma & Welling, 2014; Rezende et al., 2014; Lange et al., 2012; Hinton et al., 2011; Ranzato et al., 2007), and extends this line of research by showing that autoencoder networks are capable of learning a combined representation for system dynamics and the reward function in reinforcement learning settings with high-dimensional visual state spaces—a first step towards applying modelbased techniques for planning in environments where the reward function is not initially known.
95
+
96
+ Our positive results open up intriguing directions for future work. Our long-term goal is the integration of model-based and model-free approaches for effective interactive learning and planning in complex environments. Directions for achieving this long-standing challenge include the Dyna method (Sutton, 1990), which uses a predictive model to artificially augment expensive training data, and has been shown to lead to substantial reductions in data requirements in tabular RL approaches. Alternatively, the model could be could be utilized for planning via Monte-Carlo tree search (Guo et al., 2014; Browne et al., 2012). We hypothesize that such an approach would be particularly beneficial in multi-task or life-long learning scenarios where the reward function changes but the environment dynamics are stationary. Testing this hypothesis requires a flexible learning framework where the reward function and the artificial environment can be changed by the experimenter in an arbitrary fashion, which is not possible in ALE where the environment and the reward function are fixed per game. A learning environment providing such a flexibility is the recently released Malmo platform for Minecraft (Johnson et al., 2016) where researchers can create user-defined en-¨ vironments and tasks in order to evaluate the performance of artificial agents. In the shorter-term, we envision improving the prediction performance of our network by regularization methods such as dropout and max norm regularization (Srivastava et al., 2014)—a state-of-the-art regularizer in supervised learning—and by modifying the optimization objective to enforce similarity between hidden encodings in multi-step ahead prediction and one-step ahead prediction—see Watter et al. (2015). Finally, extensions of our model to non-deterministic state transitions through dropout and variational autoencoder schemes (Kingma & Welling, 2014; Rezende et al., 2014) is a promising direction to alleviate the limitations highlighted in Section 4.2—paving the way for models that adequately predict and reason over alternative possible future trajectories.
97
+
98
+ ![](images/02740b7abbfcbfdaf1dce245f49cc57b86ddcfd6ce7d81361d8571db31ad4b30.jpg)
99
+ two plots for each game. The top plot per game shows how the median and the 5 to 95 percentiles of the cumulative reward error evolve over look ahead steps for both our model (in blue) and a baseline model that samples rewards from the marginal reward distribution of the test set (in red). Each vertical slice of this concise representation corresponds to a single empirical distribution over the cumulative reward error. We depict these for every fifth look ahead step in the compound plots below for both models. These empirical error distributions demonstrate successful cumulative reward prediction over at least 20 steps (80 frames) in all five games as evidenced by their zero-centered and unimodal shape in the first column of each compound plot per game.
100
+
101
+ ![](images/5ca73ff0f11ebf0f135df66feefe058cd29d3977e94fcfe61f6728d039d6d497.jpg)
102
+ Figure 3: Example predictions in Seaquest. Ground truth video frames, model predictions and error maps emphasizing differences between ground truth and predicted frames—in form of the squared error between pixel values—are compared column-wise. Error maps highlight objects in black or white respectively depending on whether these objects are absent by mistake or present by mistake in the model’s prediction. Actions taken by the agent as well as ground truth rewards (’rew’) and reward predictions (’pred’) are shown below video and error frames. Peculiarities in the prediction process are marked in red. The figure demonstrates how our predictive model fails to anticipate objects that randomly enter the scene from the right and rewards associated to these objects.
103
+
104
+ # REFERENCES
105
+
106
+ M G Bellemare, Y Naddaf, J Veness, and M Bowling. The Arcade Learning Environment: an evaluation platform for general agents. Journal of Artificial Intelligence Research, 47:253–279, 2013.
107
+
108
+ M G Bellemare, S Srinivasan, G Ostrovski, T Schaul, D Saxton, and R Munos. Unifying count-based exploration and intrinsic motivation. arXiv preprint arXiv:1606.01868, 2016.
109
+
110
+ Y Bengio. Learning deep architectures for AI. Foundations and Trends in Machine Learning, 2(1): 1–127, 2009.
111
+
112
+ Y Bengio, J Louradour, R Collobert, and J Weston. Curriculum learning. In Proceedings of the International Conference on Machine Learning, 2009.
113
+
114
+ D P Bertsekas. Dynamic programming & optimal control, volume 1. Athena Scientific, 2005.
115
+
116
+ D P Bertsekas. Dynamic programming & optimal control, volume 2. Athena Scientific, 2007.
117
+
118
+ C Browne, E Powley, D Whitehouse, S Lucas, P I Cowling, P Rohlfshagen, S Tavener, D Perez, S Samothrakis, and S Colton. A survey of monte carlo tree search methods. IEEE Transactions on Computational Intelligence and AI in Games, 4(1):1–49, 2012.
119
+
120
+ A Dosovitskiy, J T Springenberg, and T Brox. Learning to generate chairs with convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2015.
121
+
122
+ C Finn, X Y Tan, Y Duan, T Darrell, S Levine, and P Abbeel. Deep spatial autoencoders for visuomotor learning. In Proceedings of the IEEE International Conference on Robotics and Automation, 2016.
123
+
124
+ X Glorot and Y Bengio. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the International Conference on Artificial Intelligence and Statistics, 2010.
125
+
126
+ X Glorot, A Bordes, and Y Bengio. Deep sparse rectifier neural networks. In Proceedings of the International Conference on Artificial Intelligence and Statistics, 2011.
127
+
128
+ R Goroshin, M Mathieu, and Y LeCun. Learning to linearize under uncertainty. Advances in Neural Information Processing Systems, 2015.
129
+
130
+ K Gregor, I Danihelka, A Graves, D J Rezende, and D Wierstra. DRAW: a recurrent neural network for image generation. In Proceedings of the International Conference on Machine Learning, 2015.
131
+
132
+ X Guo, S Singh, H Lee, R Lewis, and X Wang. Deep learning for real-time Atari game play using offline Monte-Carlo tree search planning. In Advances in Neural Information Processing Systems, 2014.
133
+
134
+ G E Hinton, A Krizhevsky, and S D Wang. Transforming auto-encoders. In Proceedings of the International Conference on Artificial Neural Networks, 2011.
135
+
136
+ M Johnson, K Hofmann, T Hutton, and D Bignell. The Malmo platform for artificial intelligence experimentation. In Proceedings of the International Joint Conference on Artificial Intelligence, 2016.
137
+
138
+ D P Kingma and J Ba. Adam: a method for stochastic optimization. In Proceedings of the International Conference on Learning Representations, 2015.
139
+
140
+ D P Kingma and M Welling. Auto-encoding variational Bayes. In Proceedings of the International Conference on Learning Representations, 2014.
141
+
142
+ T D Kulkarni, W F Whitney, P Kohli, and J B Tenenbaum. Deep convolutional inverse graphics network. In Advances in Neural Information Processing Systems, 2015.
143
+
144
+ S Lange, M Riedmiller, and A Voigtlander. Autonomous reinforcement learning on raw visual input ¨ data in a real world application. In Proceedings of the International Joint Conference on Neural Networks, 2012.
145
+
146
+ V Michalski, R Memisevic, and K Konda. Modeling deep temporal dependencies with recurrent grammar cells. In Advances in Neural Information Processing Systems, 2014.
147
+
148
+ V Mnih, K Kavukcuoglu, D Silver, A A Rusu, J Veness, M G Bellemare, A Graves, M Riedmiller, A K Fidjeland, G Ostrovski, S Petersen, C Beattie, A Sadik, I Antonoglou, H King, D Kumaran, D Wierstra, S Legg, and D Hassabis. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 2015.
149
+
150
+ J Oh, X Guo, H Lee, R Lewis, and S Singh. Action-conditional video prediction using deep networks in Atari games. In Advances in Neural Information Processing Systems, 2015.
151
+
152
+ R Pascanu, T Mikolov, and Y Bengio. On the difficulty of training recurrent neural networks. In Proceedings of the International Conference on Machine Learning, 2013.
153
+
154
+ M Ranzato, F J Huang, Y-L Boureau, and Y LeCun. Unsupervised learning of invariant feature hierarchies with applications to object recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2007.
155
+
156
+ D J Rezende, S Mohamed, and D Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In Proceedings of the International Conference on Machine Learning, 2014.
157
+
158
+ P Y Simard, D Steinkraus, and J C Platt. Best practices for convolutional neural networks applied to visual document analysis. In Proceedings of the International Conference on Document Analysis and Recognition, 2003.
159
+
160
+ B F Skinner. The behavior of organisms: an experimental analysis. Appleton-Century-Crofts, 1938.
161
+
162
+ N Srivastava, G E Hinton, A Krizhevsky, I Sutskever, and R Salakhutdinov. Dropout : a simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15: 1929–1958, 2014.
163
+
164
+ N Srivastava, E Mansimov, and R Salakhutdinov. Unsupervised learning of video representations using LSTMs. In Proceedings of the International Conference on Machine Learning, 2015.
165
+
166
+ R S Sutton. Integrated architectures for learning, planning, and reacting based on approximating dynamic programming. In Proceedings of the International Conference on Machine Learning, 1990.
167
+
168
+ R S Sutton and A G Barto. Reinforcement learning: an introduction. MIT Press, 1998.
169
+
170
+ E L Thorndike. Animal intelligence: an experimental study of the associative processes in animals. The Psychological Review: Monograph Supplements, 2(4):1–107, 1898.
171
+
172
+ W H Thorpe. The origins and rise of ethology. Heinemann Educational Books, 1979.
173
+
174
+ J Veness, M G Bellemare, M Hutter, A Chua, and G Desjardins. Compress and control. In Proceedings of the AAAI Conference on Artificial Intelligence, 2015.
175
+
176
+ N Wahlstrom, T B Sch ¨ on, and M P Deisenroth. From pixels to torques: policy learning with deep ¨ dynamical models. arXiv preprint arXiv:1502.02251, 2015.
177
+
178
+ M Watter, J T Springenberg, J Boedecker, and M Riedmiller. Embed to control: a locally linear latent dynamics model for control from raw images. In Advances in Neural Information Processing Systems, 2015.
179
+
180
+ P J Werbos. Generalization of backpropagation with application to a recurrent gas market model. Neural Networks, 1(4):339–356, 1988.
181
+
182
+ M D Zeiler, D Krishnan, G W Taylor, and R Fergus. Deconvolutional networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2010.
183
+
184
+ # A APPENDIX
185
+
186
+ # A.1 TRAINING DETAILS
187
+
188
+ We performed all our experiments in Python with Chainer and adhered to the instructions in Oh et al. (2015) as close as possible. Trajectory samples for learning the network parameters were obtained from a previously trained DQN agent according to Mnih et al. (2015). The dataset for training comprised around 500, 000 video frames per game in addition to actions chosen by the DQN agent and rewards collected during game play. Video frames used as network input were $8 4 \times 8 4$ grey-scale images with pixel values between 0 and 255 down-sampled from the full-resolution $2 1 0 \times 1 6 0$ ALE RGB images. We applied a further preprocessing step by dividing each pixel by 255 and subtracting mean pixel values from each image leading to final pixel values $\in \ [ - 1 ; 1 ]$ . A detailed network architecture is shown in Figure 1 in the main paper. All weights in the network were initialized according to Glorot & Bengio (2010) except for those two layers that participate in the element-wise multiplication in Figure 1: the weights of the action-processing layer were initialized uniformly in the range $[ - 0 . 1 ; 0 . { \bar { 1 } } ]$ and the weights of the layer receiving the latent encoding of the input video frames were initialized uniformly in the range $[ - 1 ; 1 ]$ . Training was performed for $1 , 5 0 0 , 0 0 0$ minibatch iterations with a curriculum learning scheme increasing the look ahead parameter $K$ every 500, 000 iterations from 1 to 3 to 5. When increasing the look ahead parameter $K$ for the first time after 500, 000 iterations, the minibatch size $I$ was also altered from 32 to 8 as was the learning rate for parameter updates from $1 0 ^ { - 4 }$ to $1 0 ^ { - 5 }$ . Throughout the entire curriculum scheme, the time horizon parameter determining the number of times a single trajectory is unrolled into the future was $T = 4$ . The optimizer for updating weights was Adam (Kingma & Ba, 2015) with gradient momentum 0.9, squared gradient momentum 0.95 and epsilon parameter $1 0 ^ { - 8 }$ . In evaluation mode, network outputs were clipped to $[ - 1 ; 1 ]$ so that strong activations could not accumulate over roll-out time in the network.
189
+
190
+ In our experiments, we modified the reward prediction loss slightly in order to prevent exploding gradient values by replacing the term $- \ln p$ with a first-order Taylor approximation for $p$ -values smaller than $e ^ { - 1 0 } { \mathrm { - a } } $ similar technique is used in DQN (Mnih et al., 2015) to improve the stability of the optimization algorithm. To identify optimal values for the reward weight $\lambda$ , we performed initial experiments on Ms Pacman without applying the aforementioned curriculum learning scheme instead using a fixed look ahead parameter $K = 1$ . We evaluated the effect of different $\lambda$ -values $\in \{ 0 . 1 , 1 , \bar { 1 0 } , 1 0 0 \}$ on the training objective and identified $\lambda = 1$ for conducting further experiments—see Section A.2. After identifying an optimal reward weight, we conducted additional initial experiments without curriculum learning with fixed look ahead parameter $K = 1$ on all of the five different Atari games used in this paper. We observed periodic oscillations in the reward prediction loss of the training objective in Seaquest, which was fixed by adding gradient clipping (Pascanu et al., 2013) with threshold parameter 1 to our optimization procedure—experiments investigating the effect of gradient clipping in Seaquest are reported in Section A.3. The fine-tuning effect of curriculum learning on the training objective in our final experiments is shown in Section A.4 for all of the five analysed Atari games.
191
+
192
+ # A.2 EFFECT OF REWARD WEIGHT IN MS PACMAN
193
+
194
+ To identify optimal values for the reward weight $\lambda$ , we conducted initial experiments in Ms Pacman without curriculum learning and a fixed look ahead horizon $K = 1$ . We tested four different $\lambda$ - values $\in \{ 0 . 1 , 1 , 1 0 , 1 0 0 \}$ and investigated how the frame reconstruction loss and the reward loss of the training objective evolve over minibatch iterations—see Figure 4. Best results were obtained for $\lambda = 1$ and for $\lambda = 1 0$ , whereas values of $\lambda = 0 . 1$ and $\lambda = 1 0 0$ lead to significantly slower convergence and worse overall training performance respectively.
195
+
196
+ # A.3 EFFECT OF GRADIENT CLIPPING IN SEAQUEST
197
+
198
+ After identifying an optimal value for the reward weight, see Section A.2, we observed oscillations in the reward loss of the training objective in Seaquest—see first column in Figure 5—which was solved by adding gradient clipping to our optimization procedure—see second and third column in Figure 5. We tested two different values for the gradient clipping threshold (5 and 1) both of which worked, but for a value of 1 the oscillation vanished completely.
199
+
200
+ ![](images/720d06db36adf5fcea69e6c832cc20f28160a2bac7d37f237596cd85afe2ab0c.jpg)
201
+ Figure 4: Effect of reward weight on training loss in Ms Pacman. Each of the four panels depicts one experiment with a different reward weight $\lambda$ . Each panel shows how the training loss evolves over minibatch iterations in terms of two subplots reporting video frame reconstruction and reward loss respectively. Each experiment was conducted three times with different initial random seeds depicted in blue, green and red. Graphs were smoothed with an exponential window of size 1000.
202
+
203
+ ![](images/36937623cd79e22cff1c94043eb54f0eaf9f923351d0908c7abcabc68ad664cb.jpg)
204
+ Figure 5: Effect of gradient clipping on training loss in Seaquest. The three panels compare experiments with no reward clipping to those with reward clipping using the threshold values 5 and 1 respectively. Subplots within each panel are similar to those in Figure 4 but display in the first row the evolution of the compound training loss in addition to the frame reconstruction and reward loss.
205
+
206
+ # A.4 EFFECT OF CURRICULUM LEARNING
207
+
208
+ In our final experiments with curriculum learning, the networks were trained for 1, 500, 000 minibatch iterations in total but the look ahead parameter $K$ was gradually increased every 500, 000 iterations from 1 to 3 to 5. The networks were hence initially trained on one-step ahead prediction only and later on fine-tuned on further-step ahead prediction. Figure 6 shows how the training objective evolves over iterations. The characteristic ”bumps” in the training objective every 500, 000 iterations as training evolves demonstrate improvements in long-term predictions in all games except Freeway where the training objective assumed already very low values within the first 500, 000 iterations and might have been therefore insensitive to further fine-tuning by curriculum learning.
209
+
210
+ ![](images/42260c8ebdefcaf5957906d4d18479b03baf8e2d6e219b90b9840e87cb4e0056.jpg)
211
+ Figure 6: Effect of curriculum learning on five different Atari games. Each panel corresponds to a different game, individual panels are structured in the same way as are those in Figure 5
212
+
213
+ # A.5 EFFECT OF RANDOM SEEDS
214
+
215
+ We conducted three different experiments per game with different initial random seeds. The effect of different initial random seeds on the cumulative reward error is summarized in Figure 7 which reports how the median and the 5 to 95 percentiles of the cumulative reward error evolve over look ahead steps in the different experiments per game. Note that the results of the first column in Figure 7 are shown in Figure 2 from the main paper together with a more detailed analysis depicting empirical cumulative reward error distributions for some look ahead steps. The random initial seed does not seem to have a significant impact on the cumulative reward prediction except for Freeway where the network in the third experiment starts to considerably overestimate cumulative rewards at around 30 to 40 look ahead steps.
216
+
217
+ In order to investigate this reward overestimation in Freeway further, we analyse visualizations of joint video frame and reward prediction for this particular seed (similar in style to Figure 3 from Section 4.2 in the main paper). The results are shown in Figure 8 where a peculiar situation occurs after 31 predicted look ahead steps. In Freeway, the agent’s job is to cross a busy road from the bottom to the top without bumping into a car in order to receive reward. If the agent bumps into a car, the agent is propelled downwards further away from the reward-yielding top. This propelled downwards movement happens even when the agent tries to move upwards. Exactly that kind of situation is depicted at the beginning of Figure 8 and occurs for this particular prediction after 31 steps. Our predictive model is however not able to correctly predict the aforementioned downwards movement caused by the agent hitting the car, which is highlighted in red throughout steps 31 to 35 documenting an increasing gap between ground truth and predicted agent position as the propelled downwards movement of the ground truth agent continues. In the course of further prediction, the network model assumes the agent to reach the reward-yielding top side of the road way too early which results in a sequence of erroneous positive reward predictions throughout steps 41 to 50, and as a side effect seemingly that the predictive model loses track of other objects in the scene. Concluding, this finding may serve as a possible explanation for cumulative reward overestimation for that particular experiment in Freeway.
218
+
219
+ ![](images/2c7c9ade8930ab6ee1fa7c50fd28ae1624b117ea38fbd937c24eace3779d16f4.jpg)
220
+ Figure 7: Effect of different initial random seeds on cumulative reward error. The plots show how the cumulative reward error evolves over look ahead steps in terms of the median and the 5 to 95 percentiles for our network model (blue) as well as the baseline model (red) in each experiment. Each row refers to a different game, each column refers to a different experiment per game initialized with a different random seed. The first column of this figure is presented in Figure 2 of the main paper explaining the results in more detail by additionally illustrating empirical distributions over the cumulative reward error for some look ahead steps.
221
+
222
+ ![](images/42cc60475d758ae8825e1726997fafe061eb4ad7e22120c1289032a7d756b091.jpg)
223
+ Figure 8: Example predictions in Freeway over 20 steps. The figure is similar in nature to Figure 3 from the main paper with the only difference that predictions are depicted from time step 31 onwards.
224
+
225
+ # A.6 LOSS ON TEST SET
226
+
227
+ In the main paper, our analysis focuses on evaluating how well our model serves the purpose of cumulative reward prediction. Here, we evaluate network performance in terms of both the video frame reconstruction loss as well as the reward prediction loss on the test set following the analysis conducted in Oh et al. (2015). For each game, we sample 300 minibatches of size $I = 5 0$ from the underlying test set and compute the test loss over $K = 1 0 0$ look ahead steps with the formula presented in the main paper in Section 3.3 used for learning network parameters, but without averaging over look ahead steps because we aim to illustrate the test loss as a function of look ahead steps—statistics of this analysis are plotted in Figure 9.
228
+
229
+ Best overall test loss is achieved in Freeway and for initial look ahead steps (up to roughly between 40 and 60 steps) in Q\*bert, which is in accordance with results for cumulative reward prediction from the main paper. Also in line with results from the main paper is the finding that the reward loss on the test set is worse in Seaquest, Ms Pacman and Space Invaders when compared to $\mathrm { Q ^ { * } }$ bert (up to approximately 40 steps) and Freeway. Worst video frame reconstruction loss is observed for Space Invaders in compliance with Oh et al. (2015) where the authors report that there are objects in the scene moving at a period of 9 time steps which is hard to predict by a network only taking the last 4 frames from the last 4 steps as input for future predictions. At first sight, it might seem a bit surprising that the reward prediction loss in Space Invaders is significantly lower than in Seaquest and Ms Pacman for long-term ahead prediction despite the higher frame reconstruction loss in Space Invaders. A possible explanation for this paradox might be the frequency at which rewards are collected—this frequency is significantly higher in Seaquest and Ms Pacman than in Space Invaders. A reward prediction model with bias towards zero rewards—as indicated by the main results in the paper—might therefore err less often in absolute terms when rewards are collected at a lower frequency and may hence achieve lower overall reward reconstruction loss.
230
+
231
+ ![](images/d68110c680a4ecb1d049be4cc34c6c6ee9b3614e4c0d331724fcd64d8d0f138b.jpg)
232
+ Figure 9: Loss on test set over look ahead steps. Each row reports the loss on the test set over 100 look ahead steps for a different game. The first column illustrates the compound loss consisting of the video frame reconstruction loss (second column) and the reward prediction loss (third column). The loss on the test set is computed according to Oh et al. (2015) similar to the training loss for learning network parameters, however with a different look ahead parameter $K = 1 0 0$ and a different minibatch size $I = 5 0$ , and without averaging over look ahead steps since we aim to plot the test loss as a function of look ahead steps. For each game, the test loss is computed for 300 minibatches resulting in an empirical distribution with 300 loss values per look ahead step. The figure shows the mean (in green), the median (in red), the 5 to 95 percentiles (in shaded blue) as well as minimum and maximum elements (in black dashed lines) of these empirical distributions.
md/train/BkevoJSYPB/BkevoJSYPB.md ADDED
@@ -0,0 +1,656 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DIFFERENTIATION OF BLACKBOX COMBINATORIAL SOLVERS
2
+
3
+ Marin Vlastelica1∗, Anselm Paulus1∗, V´ıt Musil2, Georg Martius1, Michal Rol´ınek1
4
+
5
+ 1 Max-Planck-Institute for Intelligent Systems, Tubingen, Germany ¨
6
+ 2 Universita degli Studi di Firenze, Italy \`
7
+ {marin.vlastelica, anselm.paulus, georg.martius, michal.rolinek}@tuebingen.mpg.de
8
+ vit.musil@unifi.it
9
+
10
+ # ABSTRACT
11
+
12
+ Achieving fusion of deep learning with combinatorial algorithms promises transformative changes to artificial intelligence. One possible approach is to introduce combinatorial building blocks into neural networks. Such end-to-end architectures have the potential to tackle combinatorial problems on raw input data such as ensuring global consistency in multi-object tracking or route planning on maps in robotics. In this work, we present a method that implements an efficient backward pass through blackbox implementations of combinatorial solvers with linear objective functions. We provide both theoretical and experimental backing. In particular, we incorporate the Gurobi MIP solver, Blossom V algorithm, and Dijkstra’s algorithm into architectures that extract suitable features from raw inputs for the traveling salesman problem, the min-cost perfect matching problem and the shortest path problem. The code is available at
13
+
14
+ https://github.com/martius-lab/blackbox-backprop.
15
+
16
+ # 1 INTRODUCTION
17
+
18
+ The toolbox of popular methods in computer science currently sees a split into two major components. On the one hand, there are classical algorithmic techniques from discrete optimization – graph algorithms, SAT-solvers, integer programming solvers – often with heavily optimized implementations and theoretical guarantees on runtime and performance. On the other hand, there is the realm of deep learning allowing data-driven feature extraction as well as the flexible design of end-to-end architectures. The fusion of deep learning with combinatorial optimization is desirable both for foundational reasons – extending the reach of deep learning to data with large combinatorial complexity – and in practical applications. These often occur for example in computer vision problems that require solving a combinatorial sub-task on top of features extracted from raw input such as establishing global consistency in multi-object tracking from a sequence of frames.
19
+
20
+ The fundamental problem with constructing hybrid architectures is differentiability of the combinatorial components. State-of-the-art approaches pursue the following paradigm: introduce suitable approximations or modifications of the objective function or of a baseline algorithm that eventually yield a differentiable computation. The resulting algorithms are often sub-optimal in terms of runtime, performance and optimality guarantees when compared to their unmodified counterparts. While the sources of sub-optimality vary from example to example, there is a common theme: any differentiable algorithm in particular outputs continuous values and as such it solves a relaxation of the original problem. It is well-known in combinatorial optimization theory that even strong and practical convex relaxations induce lower bounds on the approximation ratio for large classes of problems (Raghavendra, 2008; Thapper & Zivn ˇ y´, 2017) which makes them inherently sub-optimal. This inability to incorporate the best implementations of the best algorithms is unsatisfactory.
21
+
22
+ In this paper, we propose a method that, at the cost of one hyperparameter, implements a backward pass for a blackbox implementation of a combinatorial algorithm or a solver that optimizes a linear objective function. This effectively turns the algorithm or solver into a composable building block of neural network architectures, as illustrated in Fig. 1. Suitable problems with linear objective include classical problems such as SHORTEST-PATH, TRAVELING-SALESMAN (TSP), MIN-COSTPERFECT-MATCHING, various cut problems as well as entire frameworks such as integer programs (IP), Markov random fields (MRF) and conditional random fields (CRF).
23
+
24
+ ![](images/d9c8e2dacd0c0eb13bcfff5d9eb2f9ae98c1624ffa536006ff07f824ee59321e.jpg)
25
+ Figure 1: Architecture design enabled by Theorem 1. Blackbox combinatorial solver embedded into a neural network.
26
+
27
+ The main technical challenge boils down to providing an informative gradient of a piecewise constant function. To that end, we are able to heavily leverage the minimization structure of the underlying combinatorial problem and efficiently compute a gradient of a continuous interpolation. While the roots of the method lie in loss-augmented inference, the employed mathematical technique for continuous interpolation is novel. The computational cost of the introduced backward pass matches the cost of the forward pass. In particular, it also amounts to one call to the solver.
28
+
29
+ In experiments, we train architectures that contain unmodified implementations of the following efficient combinatorial algorithms: general-purpose mixed-integer programming solver Gurobi (Gurobi Optimization, 2019), state-of-the-art C implementation of MIN-COST-PERFECTMATCHING algorithm – Blossom V (Kolmogorov, 2009) and Dijkstra’s algorithm (Dijkstra, 1959) for SHORTEST-PATH. We demonstrate that the resulting architectures train without sophisticated tweaks and are able to solve tasks that are beyond the capabilities of conventional neural networks.
30
+
31
+ # 2 RELATED WORK
32
+
33
+ Multiple lines of work lie at the intersection of combinatorial algorithms and deep learning. We primarily distinguish them by their motivation.
34
+
35
+ Motivated by applied problems. Even though computer vision has seen a substantial shift from combinatorial methods to deep learning, some problems still have a strong combinatorial aspect and require hybrid approaches. Examples include multi-object tracking (Schulter et al., 2017), semantic segmentation (Chen et al., 2018), multi-person pose estimation (Pishchulin et al., 2016; Song et al., 2018), stereo matching (Knobelreiter et al. ¨ , 2017) and person re-identification (Ye et al., 2017). The combinatorial algorithms in question are typically Markov random fields (MRF) (Chen et al., 2015), conditional random fields (CRF) (Marin et al., 2019), graph matching (Ye et al., 2017) or integer programming (Schulter et al., 2017). In recent years, a plethora of hybrid end-to-end architectures have been proposed. The techniques used for constructing the backward pass range from employing various relaxations and approximations of the combinatorial problem (Chen et al., 2015; Zheng et al., 2015) over differentiating a fixed number of iterations of an iterative solver (Paschalidou et al., 2018; Tompson et al., 2014; Liu et al., 2015) all the way to relying on the structured SVM framework (Tsochantaridis et al., 2005; Chen et al., 2015).
36
+
37
+ Motivated by “bridging the gap”. Building links between combinatorics and deep learning can also be viewed as a foundational problem; for example, (Battaglia et al., 2018) advocate that “combinatorial generalization must be a top priority for AI”. One such line of work focuses on designing architectures with algorithmic structural prior – for example by mimicking the layout of a Turing machine (Sukhbaatar et al., 2015; Vinyals et al., 2015; Graves et al., 2014; 2016) or by promoting behaviour that resembles message-passing algorithms as it is the case in Graph Neural Networks and related architectures (Scarselli et al., 2009; Li et al., 2016; Battaglia et al., 2018). Another approach is to provide neural network building blocks that are specialized to solve some types of combinatorial problems such as satisfiability (SAT) instances (Wang et al., 2019), mixed integer programs (Ferber et al., 2019), sparse inference (Niculae et al., 2018), or submodular maximization (Tschiatschek et al., 2018). A related mindset of learning inputs to an optimization problem gave rise to the “predict-and-optimize” framework and its variants (Elmachtoub & Grigas, 2017; Demirovic et al., 2019; Mandi et al., 2019). Some works have directly addressed the question of learning combinatorial optimization algorithms such as the TRAVELING-SALESMAN-PROBLEM in (Bello et al., 2017) or its vehicle routing variants (Nazari et al., 2018). A recent approach also learns combinatorial algorithms via a clustering proxy (Wilder et al., 2019).
38
+
39
+ There are also efforts to bridge the gap in the opposite direction; to use deep learning methods to improve state-of-the-art combinatorial solvers, typically by learning (otherwise hand-crafted) heuristics. Some works have again targeted the TRAVELING-SALESMAN-PROBLEM (Kool et al., 2019; Deudon et al., 2018; Bello et al., 2017) as well as other NP-Hard problems (Li et al., 2018). Also, more general solvers received some attention; this includes SAT-solvers (Selsam & Bjørner, 2019; Selsam et al., 2019), integer programming solvers (often with learning branch-and-bound rules) (Khalil et al., 2016; Balcan et al., 2018; Gasse et al., 2019) and SMT-solvers (satisfiability modulo theories)(Balunovic et al., 2018).
40
+
41
+ # 3 METHOD
42
+
43
+ Let us first formalize the notion of a combinatorial solver. We expect the solver to receive continuous input $w \in W \subseteq \mathbb { R } ^ { N }$ (e.g. edge weights of a fixed graph) and return discrete output $y$ from some finite set $Y$ (e.g. all traveling salesman tours on a fixed graph) that minimizes some cost $\mathbf { c } ( w , y )$ (e.g. length of the tour). More precisely, the solver maps
44
+
45
+ $$
46
+ w \mapsto y ( w ) \quad { \mathrm { s u c h ~ t h a t } } \quad y ( w ) = \arg \operatorname* { m i n } _ { y \in Y } \mathbf { \exp } ( w , y ) .
47
+ $$
48
+
49
+ We will restrict ourselves to objective functions $\mathbf { c } ( w , y )$ that are linear , namely $\mathbf { c } ( w , y )$ may be represented as
50
+
51
+ $$
52
+ \mathbf { c } ( w , y ) = w \cdot \phi ( y ) \quad { \mathrm { f o r ~ } } w \in W { \mathrm { ~ a n d ~ } } y \in Y
53
+ $$
54
+
55
+ in which $\phi \colon Y \mathbb { R } ^ { N }$ is an injective representation of $y \in Y$ in $\mathbb { R } ^ { N }$ . For brevity, we omit the mapping $\phi$ and instead treat elements of $Y$ as discrete points in $\mathbb { R } ^ { N }$ .
56
+
57
+ Note that such definition of a solver is still very general as there are no assumptions on the set of constraints or on the structure of the output space $Y$ .
58
+
59
+ Example 1 (Encoding shortest-path problem). If $G = ( V , E )$ is a given graph with vertices $s , t \in V$ , the combinatorial solver for the $( s , t )$ -SHORTEST-PATH would take edge weights $w \in W = \mathbb { R } ^ { | E | }$ as input and produce the shortest path $y ( w )$ represented as $\phi ( y ) \subseteq \{ 0 , 1 \} ^ { | E | }$ an indicator vector of the selected edges. The cost function is then indeed the inner product $\mathbf { c } ( \dot { w } , y ) = w \cdot { \phi } ( y )$ .
60
+
61
+ The task to solve during back-propagation is the following. We receive the gradient $\mathrm { d } L / \mathrm { d } y$ of the global loss $L$ with respect to solver output $y$ at a given point $\hat { y } = y ( \hat { w } )$ . We are expected to return $\mathrm { d } L / \mathrm { d } w$ , the gradient of the loss with respect to solver input $w$ at a point $\hat { w }$ .
62
+
63
+ Since $Y$ is finite, there are only finitely many values of $y ( w )$ . In other words, this function of $w$ is piecewise constant and the gradient is identically zero or does not exist (at points of jumps). This should not come as a surprise; if one does a small perturbation to edge weights of a graph, one usually does not change the optimal TSP tour and on rare occasions alters it drastically. This has an important consequence:
64
+
65
+ The fundamental problem with differentiating through combinatorial solvers is not the lack of differentiability; the gradient exists almost everywhere. However, this gradient is a constant zero and as such is unhelpful for optimization.
66
+
67
+ Accordingly, we will not rely on standard techniques for gradient estimation (see (Mohamed et al., 2019) for a comprehensive survey).
68
+
69
+ ![](images/ccc85f2ab1b95aa0779c74202ea55b1e442adf5cc1b1c62194403e325eb252a6.jpg)
70
+ Figure 2: Continuous interpolation of a piecewise constant function. (a) $f _ { \lambda }$ for a small value of $\lambda$ ; the set $W _ { \mathrm { e q } } ^ { \lambda }$ is still substantial and only two interpolators $g _ { 1 }$ and $g _ { 2 }$ are incomplete. Also, all interpolators are 0-interpolators. (b) $f _ { \lambda }$ for a high value of $\lambda$ ; most interpolators are incomplete and we also encounter a $\delta$ -interpolator $g _ { 3 }$ (between $y _ { 1 }$ and $y _ { 2 }$ ) which attains the value $f ( y _ { 1 } )$ δ-away from the set $P _ { 1 }$ . Despite losing some local structure for high $\lambda$ , the gradient of $f _ { \lambda }$ is still informative.
71
+
72
+ First, we simplify the situation by considering the linearization $f$ of $L$ at the point $\hat { y }$ . Then for
73
+
74
+ $$
75
+ f ( y ) = L ( \hat { y } ) + \frac { \mathrm { d } L } { \mathrm { d } y } ( \hat { y } ) \cdot ( y - \hat { y } ) \quad \mathrm { w e ~ h a v e } \quad \frac { \mathrm { d } f \big ( y ( w ) \big ) } { \mathrm { d } w } = \frac { \mathrm { d } L } { \mathrm { d } w }
76
+ $$
77
+
78
+ and therefore it suffices to focus on differentiating the piecewise constant function $f ( \boldsymbol { y } ( \boldsymbol { w } ) )$
79
+
80
+ If the piecewise constant function at hand was arbitrary, we would be forced to use zero-order gradient estimation techniques such as computing finite differences. These require prohibitively many function evaluations particularly for high-dimensional problems.
81
+
82
+ However, the function $f ( \boldsymbol { y } ( \boldsymbol { w } ) )$ is a result of a minimization process and it is known that for smooth spaces $Y$ there are techniques for such “differentiation through argmin” (Schmidt & Roth, 2014; Samuel & Tappen, 2009; Foo et al., 2008; Domke, 2012; Amos et al., 2017; Amos & Kolter, 2017). It turns out to be possible to build – with different mathematical tools – a viable discrete analogy. In particular, we can efficiently construct a function $f _ { \lambda } ( w )$ , a continuous interpolation of $f ( y ( w ) )$ , whose gradient we return (see Fig. 2). The hyper-parameter $\lambda > 0$ controls the trade-off between “informativeness of the gradient” and “faithfulness to the original function”.
83
+
84
+ Before diving into the formalization, we present the final algorithm as listed in Algo. 1. It is simple to implement and the backward pass indeed only runs the solver once on modified input. Providing the justification, however, is not straightforward, and it is the subject of the rest of the section.
85
+
86
+ <table><tr><td colspan="2">Algorithm1 Forward and Backward Pass</td></tr><tr><td>function FORWARDPASS(ω)</td><td>function BACKWARDPASS( (), λ)</td></tr><tr><td>y := Solver(ω) I y= y(ω)</td><td>load ω and y from forward pass</td></tr><tr><td>save ω and y for backward pass</td><td>w&#x27;:=w+&gt;. 品 (y)</td></tr><tr><td>return y</td><td>Il Calculate perturbed weights</td></tr><tr><td></td><td>yx := Solver(w&#x27;)</td></tr><tr><td></td><td>return Vωfx(ω) := -1[y - yx]</td></tr><tr><td></td><td>ll Gradient of continuous interpolation</td></tr></table>
87
+
88
+ # 3.1 CONSTRUCTION AND PROPERTIES OF $f _ { \lambda }$
89
+
90
+ Before we give the exact definition of the function $f _ { \lambda }$ , we formulate several requirements on it. This will help us understand why $f _ { \lambda } ( w )$ is a reasonable replacement for $f ( \boldsymbol { y } ( \boldsymbol { w } ) )$ and, most importantly, why its gradient captures changes in the values of $f$ .
91
+
92
+ Property A1. For each $\lambda > 0$ , $f _ { \lambda }$ is continuous and piecewise affine.
93
+
94
+ The second property describes the trade-off induced by changing the value of $\lambda$ . For $\lambda > 0$ , we define sets $\dot { W } _ { \mathrm { e q } } ^ { \lambda }$ and $\dot { W } _ { \mathrm { d i f } } ^ { \lambda }$ as the sets where $f ( \boldsymbol { y } ( \boldsymbol { w } ) )$ and $f _ { \lambda } ( w )$ coincide and where they differ, i.e.
95
+
96
+ $$
97
+ W _ { \mathrm { e q } } ^ { \lambda } = \left\{ w \in W : f _ { \lambda } ( w ) = f \bigl ( y ( w ) \bigr ) \right\} \quad \mathrm { a n d } \quad W _ { \mathrm { d i f } } ^ { \lambda } = W \setminus W _ { \mathrm { e q } } ^ { \lambda } .
98
+ $$
99
+
100
+ Property A2. The sets $W _ { \mathrm { d i f } } ^ { \lambda }$ are monotone in $\lambda$ and they vanish as $\lambda 0 ^ { + }$ , i.e.
101
+
102
+ $$
103
+ W _ { \mathrm { d i f } } ^ { \lambda _ { 1 } } \subseteq W _ { \mathrm { d i f } } ^ { \lambda _ { 2 } } \quad \mathrm { f o r } 0 < \lambda _ { 1 } \leq \lambda _ { 2 } \quad \mathrm { a n d } \quad W _ { \mathrm { d i f } } ^ { \lambda } \to \varnothing \quad \mathrm { a s } \ \lambda \to 0 ^ { + } .
104
+ $$
105
+
106
+ In other words, Property A2 tells us that $\lambda$ controls the size of the set where $f _ { \lambda }$ deviates from $f$ and where $f _ { \lambda }$ has meaningful gradient. This behaviour of $f _ { \lambda }$ can be seen in Fig. 2.
107
+
108
+ In the third and final property, we want to capture the interpolation behavior of $f _ { \lambda }$ . For that purpose, we define a $\delta$ -interpolator of $f$ . We say that $g$ , defined on a set $G \subset W$ , is a $\delta$ -interpolator of $f$ between $y _ { 1 }$ and $y _ { 2 } \in Y$ , if
109
+
110
+ • $g$ is non-constant affine function;
111
+ • the image $g ( G )$ is an interval with endpoints $f ( y _ { 1 } )$ and $f ( y _ { 2 } )$ ;
112
+ • $g$ attains the boundary values $f ( y _ { 1 } )$ and $f ( y _ { 2 } )$ at most $\delta$ -far away from where $f ( y ( w ) )$ does. In particular, there is a point $w _ { k } \in G$ for which $g ( w _ { k } ) = f ( y _ { k } )$ and $\mathrm { d i s t } ( w _ { k } , P _ { k } ) \le \delta$ , where $P _ { k } = \{ w \in W : y ( w ) = y _ { k } \}$ , for $k = 1 , 2$ .
113
+
114
+ In the special case of a 0-interpolator $g$ , the graph of $g$ connects (in a topological sense) two components of the graph of $f ( y ( \dot { w } ) )$ . In the general case, $\delta$ measures displacement of the interpolator (see also Fig. 2 for some examples). This displacement on the one hand loosens the connection to $\dot { f } \left( y ( w ) \right)$ but on the other hand allows for less local interpolation which might be desirable.
115
+
116
+ Property A3. The function $f _ { \lambda }$ consists of finitely many (possibly incomplete) $\delta$ -interpolators of $f$ on $\hat { W } _ { \mathrm { d i f } } ^ { \lambda }$ where $\delta \leq C \lambda$ for some fixed $C$ . Equivalently, the displacement is linearly controlled by $\lambda$
117
+
118
+ Intuitively, the consequence of Property A3 is that $f _ { \lambda }$ has reasonable gradients everywhere since it consists of elementary affine interpolators.
119
+
120
+ For defining the function $f _ { \lambda }$ , we need a solution of a perturbed optimization problem
121
+
122
+ $$
123
+ y _ { \lambda } ( w ) = { \underset { y \in Y } { \operatorname { a r g m i n } } } \{ \mathbf { c } ( w , y ) + \lambda f ( y ) \} .
124
+ $$
125
+
126
+ Theorem 1. Let $\lambda > 0$ . The function $f _ { \lambda }$ defined by
127
+
128
+ $$
129
+ f _ { \lambda } ( w ) = f { \big ( } y _ { \lambda } ( w ) { \big ) } - { \frac { 1 } { \lambda } } { \Big [ } \mathbf { c } { \big ( } w , y ( w ) { \big ) } - \mathbf { c } { \big ( } w , y _ { \lambda } ( w ) { \big ) } { \Big ] }
130
+ $$
131
+
132
+ satisfies Properties A1, A2, A3.
133
+
134
+ Let us remark that already the continuity of $f _ { \lambda }$ is not apparent from its definition as the first term $f ( y _ { \lambda } ( w ) )$ is still a piecewise constant function. Proof of this result, along with geometrical description of $f _ { \lambda }$ , can be found in section A.2. Fig. 3 visualizes $f _ { \lambda }$ for different values if $\lambda$ .
135
+
136
+ Now, since $f _ { \lambda }$ is ensured to be differentiable, we have
137
+
138
+ $$
139
+ \nabla f _ { \lambda } ( w ) = - \frac { 1 } { \lambda } \Big [ \frac { \mathrm { d } \mathbf { c } } { \mathrm { d } w } \big ( w , y ( w ) \big ) - \frac { \mathrm { d } \mathbf { c } } { \mathrm { d } w } \big ( w , y _ { \lambda } ( w ) \big ) \Big ] = - \frac { 1 } { \lambda } \big [ y ( w ) - y _ { \lambda } ( w ) \big ] .
140
+ $$
141
+
142
+ The second equality then holds due to (2). We then return $\nabla f _ { \lambda }$ as a loss gradient.
143
+
144
+ Remark 1. The roots of the method we propose lie in loss-augmented inference. In fact, the update rule from (5) (but not the function $f _ { \lambda }$ or any of its properties) was already proposed in a different context in (Hazan et al., 2010; Song et al., 2016) and was later used in (Lorberbom et al., 2018; Mohapatra et al., 2018). The main difference to our work is that only the case of $\lambda 0 ^ { + }$ is recommended and studied, which in our situation computes the correct but uninformative zero gradient. Our analysis implies that larger values of $\lambda$ are not only sound but even preferable. This will be seen in experiments where we use values $\lambda \approx 1 0 - 2 0$ .
145
+
146
+ ![](images/1d726e1211cf775ed97ca541a5a85a081509a5088d2c2cad5b95f8fee7b5c1a1.jpg)
147
+ Figure 3: Example $f _ { \lambda }$ for $w \in \mathbb { R } ^ { 2 }$ and $\lambda = 3 , 1 0 , 2 0$ (left to right). As $\lambda$ changes, the interpolation $f _ { \lambda }$ is less faithful to the piecewise constant $f ( \boldsymbol { y } ( \boldsymbol { w } ) )$ but provides reasonable gradient on a larger set.
148
+
149
+ # 3.2 EFFICIENT COMPUTATION OF $f _ { \lambda }$
150
+
151
+ Computing $y _ { \lambda }$ in (3) is the only potentially expensive part of evaluating (5). However, the linear interplay of the cost function and the gradient trivially gives a resolution.
152
+
153
+ Proposition 1. Let $\hat { w } \in W$ be fixed. If we set $\begin{array} { r } { w ^ { \prime } = \hat { w } + \lambda \frac { \mathrm { d } L } { \mathrm { d } y } ( \hat { y } ) } \end{array}$ , we can compute $y _ { \lambda }$ as
154
+
155
+ $$
156
+ \boldsymbol { y } _ { \lambda } ( \hat { w } ) = \underset { \boldsymbol { y } \in Y } { \arg \operatorname* { m i n } } \mathbf { c } ( w ^ { \prime } , \boldsymbol { y } ) .
157
+ $$
158
+
159
+ In other words, $y _ { \lambda }$ is the output of calling the solver on input $w ^ { \prime }$ .
160
+
161
+ # 4 EXPERIMENTS
162
+
163
+ In this section, we experimentally validate a proof of concept: that architectures containing exact blackbox solvers (with backward pass provided by Algo. 1) can be trained by standard methods.
164
+
165
+ Table 1: Experiments Overview.
166
+
167
+ <table><tr><td>Graph Problem</td><td>Solver</td><td>Solver instance size</td><td>Input format</td></tr><tr><td>Shortest path</td><td>Dijkstra</td><td>up to 900 vertices</td><td>(image) up to 240 × 240</td></tr><tr><td>Min Cost PM</td><td>Blossom V</td><td>up to 1104 edges</td><td>(image) up to 528 × 528</td></tr><tr><td>Traveling Salesman</td><td>Gurobi</td><td>up to 780 edges</td><td>up to 40 images (20 × 40)</td></tr></table>
168
+
169
+ To that end, we solve three synthetic tasks as listed in Tab. 1. These tasks are designed to mimic practical examples from Section 2 and solving them anticipates a two-stage process: 1) extract suitable features from raw input, 2) solve a combinatorial problem over the features. The dimensionalities of input and of intermediate representations also aim to mirror practical problems and are chosen to be prohibitively large for zero-order gradient estimation methods. Guidelines of setting the hyperparameter $\lambda$ are given in section A.1.
170
+
171
+ We include the performance of ResNet18 (He et al., 2016) as a sanity check to demonstrate that the constructed datasets are too complex for standard architectures.
172
+
173
+ Remark 2. The included solvers have very efficient implementations and do not severely impact runtime. All models train in under two hours on a single machine with 1 GPU and no more than 24 utilized CPU cores. Only for the large TSP problems the solver’s runtime dominates.
174
+
175
+ # 4.1 WARCRAFT SHORTEST PATH
176
+
177
+ Problem input and output. The training dataset for problem $\operatorname { S P } ( k )$ consists of 10000 examples of randomly generated images of terrain maps from the Warcraft II tileset (Guyomarch, 2017). The maps have an underlying grid of dimension $k \times k$ where each vertex represents a terrain with a fixed cost that is unknown to the network. The shortest (minimum cost) path between top left and bottom right vertices is encoded as an indicator matrix and serves as a label (see also Fig. 4). We consider datasets $\operatorname { S P } ( k )$ for $k \in \{ 1 2 , 1 8 , 2 4 , 3 0 \}$ . More experimental details are provided in section A.3.
178
+
179
+ ![](images/aebd22f7122a987507b5a5df380f095e06acf0115c5b15b52129729f3f12359a.jpg)
180
+ Figure 4: The $\operatorname { S P } ( k )$ dataset. (a) Each input is a $k \times k$ grid of tiles corresponding to a Warcraft II terrain map, the respective label is a the matrix indicating the shortest path from top left to bottom right. (b) is a different map with correctly predicted shortest path.
181
+
182
+ Architecture. An image of the terrain map is presented to a convolutional neural network which outputs a $k \times k$ grid of vertex costs. These costs are then the input to the Dijkstra algorithm to compute the predicted shortest path for the respective map. The loss used for computing the gradient update is the Hamming distance between the true shortest path and the predicted shortest path.
183
+
184
+ Results. Our method learns to predict the shortest paths with high accuracy and generalization capability, whereas the ResNet18 baseline unsurprisingly fails to generalize already for small grid sizes of $k \_ =$ 12. Since the shortest paths in the maps are often nonunique (i.e. there are multiple shortest paths with the same cost), we report the percentage of shortest path predictions that have optimal cost. The results are summarized in Tab. 2.
185
+
186
+ Table 2: Results for Warcraft shortest path. Reported is the accuracy, i.e. percentage of paths with the optimal costs. Standard deviations are over five restarts.
187
+
188
+ <table><tr><td colspan="3">Embedding Dijkstra</td><td colspan="2">ResNet18</td></tr><tr><td>k</td><td>Train %</td><td>Test %</td><td>Train %</td><td>Test %</td></tr><tr><td>12</td><td>99.7±0.0</td><td>96.0± 0.3</td><td>100.0±0.0</td><td>23.0± 0.3</td></tr><tr><td>18</td><td>98.9 ± 0.2</td><td>94.4 ± 0.2</td><td>99.9 ± 0.0</td><td>0.7 ± 0.3</td></tr><tr><td>24</td><td>97.8 ± 0.2</td><td>94.4±0.6</td><td>100.0± 0.0</td><td>0.0±0.0</td></tr><tr><td>30</td><td>97.4± 0.1</td><td>94.0 ± 0.3</td><td>95.6 ± 0.5</td><td>0.0± 0.0</td></tr></table>
189
+
190
+ # 4.2 GLOBE TRAVELING SALESMAN PROBLEM
191
+
192
+ Problem input and output. The training dataset for problem $\mathrm { T S P } ( k )$ consists of 10000 examples where the input for each example is a $k$ -element subset of fixed 100 country flags and the label is the shortest traveling salesman tour through the capitals of the corresponding countries. The optimal tour is represented by its adjacency matrix (see also Fig. 5). We consider datasets $\mathrm { T S P } ( k )$ for $k \in \{ 5 , 1 0 , 2 0 , 4 0 \}$ .
193
+
194
+ ![](images/93a1371bc47f5fbc55fc3aa8629e790fdbf4bf0356d5477e55579af56987fedd.jpg)
195
+ Figure 5: The $\mathrm { T S P } ( k )$ problem. (a) illustrates the dataset. Each input is a sequence of $k$ flags and the corresponding label is the adjacency matrix of the optimal TSP tour around the corresponding capitals. (b) displays the learned locations of 10 country capitals in southeast Asia and Australia, accurately recovering their true position.
196
+
197
+ Architecture. Each of the $k$ flags is presented to a convolutional network that produces $k$ threedimensional vectors. These vectors are projected onto the unit sphere in $\mathbb { R } ^ { 3 }$ ; a representation of the globe. The TSP solver receives a matrix of pairwise distances of the $k$ computed locations. The loss of the network is the Hamming distance between the true and the predicted TSP adjacency matrix. The architecture is expected to learn the correct representations of the flags (i.e. locations of the respective countries’ capitals on Earth, up to rotations of the sphere). The employed Gurobi solver optimizes a mixed-integer programming formulation of TSP using the cutting plane method (Marchand et al., 2002) for lazy sub-tour elimination.
198
+
199
+ Results. This architecture not only learns to extract the correct TSP tours but also learns the correct representations. Quantitative evidence is presented in Tab. 3, where we see that the learned locations generalize well and lead to correct TSP tours also on the test set and also on somewhat large instances (note that there are $3 9 ! \approx 1 0 ^ { 4 6 }$ admissible TSP tours for $k = 4 0$ ). The baseline architecture
200
+
201
+ Table 3: Results for Globe TSP. Reported is the full tour accuracy. Standard deviations are over five restarts.
202
+
203
+ <table><tr><td></td><td>Embedding TSP Solver</td><td></td><td>ResNet18</td></tr><tr><td>k</td><td>Train %</td><td>Test %</td><td>Train % Test %</td></tr><tr><td>5</td><td>99.8± 0.0</td><td>99.2 ± 0.1</td><td>100.0± 0.0 1.9 ± 0.6</td></tr><tr><td>10</td><td>99.8 ±0.1</td><td>98.7 ± 0.2 99.0± 0.1</td><td>0.0±0.0</td></tr><tr><td>20</td><td>99.1 ± 0.1</td><td>98.4± 0.4 98.8 ± 0.3</td><td>0.0 ± 0.0</td></tr><tr><td>40</td><td>97.4± 0.2</td><td>96.7± 0.4 96.9 ± 0.3</td><td>0.0±0.0</td></tr></table>
204
+
205
+ only memorizes the training set. Additionally, we can extract the suggested locations of world capitals and compare them with reality. To that end, we present Fig. 5b, where the learned locations of 10 capitals in Southeast Asia are displayed.
206
+
207
+ # 4.3 MNIST MIN-COST PERFECT MATCHING
208
+
209
+ Problem input and output. The training dataset for problem $\mathrm { P M } ( k )$ consists of 10000 examples where the input to each example is a set of $k ^ { 2 }$ digits drawn from the MNIST dataset arranged in a $k \times k$ grid. For computing the label, we consider the underlying $k \times k$ grid graph (without diagonal edges) and solve a MIN-COST-PERFECT-MATCHING problem, where edge weights are given simply by reading the two vertex digits as a two-digit number (we read downwards for vertical edges and from left to right for horizontal edges). The optimal perfect matching (i.e. the label) is encoded by an indicator vector for the subset of the selected edges, see example in Fig. 6.
210
+
211
+ Architecture. The grid image is the input of a convolutional neural network which outputs a grid of vertex weights. These weights are transformed into edge weights as described above and given to the solver. The loss function is Hamming distance between solver output and the true label.
212
+
213
+ Results. The architecture containing the solver is capable of good generalizations suggesting that the correct representation is learned. The performance is good even on larger instances and despite the presence of noise in supervision – often there are many optimal matchings. In contrast, the ResNet18 baseline only achieves reasonable performance for the simplest case PM(4). The results are summarized in Tab. 4.
214
+
215
+ Table 4: Results for MNIST Min-cost perfect matching. Reported is the accuracy of predicting an optimal matching. Standard deviations are over five restarts.
216
+
217
+ <table><tr><td></td><td>Embedding Blossom V</td><td></td><td>ResNet18</td></tr><tr><td>k</td><td>Train %</td><td>Test %</td><td>Train % Test %</td></tr><tr><td>4</td><td>99.97 ± 0.01</td><td>98.32 ± 0.24 99.92 ± 0.01</td><td>100.0± 0.0 92.5±0.3 8.3±0.8</td></tr><tr><td>8 16</td><td>99.95 ± 0.04</td><td>99.06± 0.57</td><td>100.0 ± 0.0 100.0± 0.0 0.0±0.0</td></tr><tr><td>24</td><td>99.02 ± 0.84</td><td>92.06 ± 7.97</td><td>96.1 ± 0.5 0.0±0.0</td></tr><tr><td></td><td>95.63 ± 5.49</td><td></td><td></td></tr></table>
218
+
219
+ # 5 DISCUSSION
220
+
221
+ We provide a unified mathematically sound algorithm to embed combinatorial algorithms into neural networks. Its practical implementation is straightforward and training succeeds with standard deep learning techniques. The two main branches of future work are: 1) exploring the potential of newly enabled architectures, 2) addressing standing real-world problems. The latter case requires embedding approximate solvers (that are common in practice). This breaks some of our theoretical guarantees but given their strong empirical performance, the fusion might still work well in practice.
222
+
223
+ ![](images/25ffcca54f0937b5c6910ab99eac7f8e6385ee741c8c778f17c9c7232f8f0c99.jpg)
224
+ Figure 6: Visualization of the PM dataset. (a) shows the case of $\mathrm { P M } ( 4 )$ . Each input is a $4 \times 4$ grid of MNIST digits and the corresponding label is the indicator vector for the edges in the min-cost perfect matching. (b) shows the correct min-cost perfect matching output from the network. The cost of the matching is 348 ( $4 6 + 1 2$ horizontally and $2 7 + 4 5 + 4 0 + 6 7 + 7 8 + 3 3$ vertically).
225
+
226
+ # ACKNOWLEDGEMENT
227
+
228
+ We thank the International Max Planck Research School for Intelligent Systems (IMPRS-IS) for supporting Marin Vlastelica. We acknowledge the support from the German Federal Ministry of Education and Research (BMBF) through the Tbingen AI Center (FKZ: 01IS18039B). Additionally, we would like to thank Paul Swoboda and Alexander Kolesnikov for valuable feedback on an early version of the manuscript.
229
+
230
+ # REFERENCES
231
+
232
+ Google’s or-tools, 2019. URL https://developers.google.com/optimization/.
233
+
234
+ Brandon Amos and J. Zico Kolter. Optnet: Differentiable optimization as a layer in neural networks. arXiv, 1703.00443, 2017. URL http://arxiv.org/abs/1703.00443.
235
+
236
+ Brandon Amos, Lei Xu, and J Zico Kolter. Input convex neural networks. In 34th International Conference on Machine Learning (ICML’17), pp. 146–155. JMLR, 2017.
237
+
238
+ Maria-Florina Balcan, Travis Dick, Tuomas Sandholm, and Ellen Vitercik. Learning to branch. In Jennifer G. Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmsmassan, Stockholm, Sweden, July 10-15, 2018 ¨ , volume 80 of Proceedings of Machine Learning Research, pp. 353–362. PMLR, 2018. URL http://proceedings.mlr.press/v80/balcan18a.html.
239
+
240
+ Mislav Balunovic, Pavol Bielik, and Martin Vechev. Learning to solve SMT formulas. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems 31, pp. 10317–10328. Curran Associates, Inc., 2018.
241
+
242
+ Peter Battaglia, Jessica Blake Chandler Hamrick, Victor Bapst, Alvaro Sanchez, Vinicius Zambaldi, Mateusz Malinowski, Andrea Tacchetti, David Raposo, Adam Santoro, Ryan Faulkner, Caglar Gulcehre, Francis Song, Andy Ballard, Justin Gilmer, George E. Dahl, Ashish Vaswani, Kelsey Allen, Charles Nash, Victoria Jayne Langston, Chris Dyer, Nicolas Heess, Daan Wierstra, Pushmeet Kohli, Matt Botvinick, Oriol Vinyals, Yujia Li, and Razvan Pascanu. Relational inductive biases, deep learning, and graph networks. arXiv, abs/1806.01261, 2018. URL http://arxiv.org/abs/1806.01261.
243
+
244
+ Irwan Bello, Hieu Pham, Quoc V. Le, Mohammad Norouzi, and Samy Bengio. Neural combinatorial optimization with reinforcement learning. In 5th International Conference on Learning Representations, ICLR 2017, Workshop Track Proceedings, 2017. URL http://openreview.net/forum? id=Bk9mxlSFx.
245
+
246
+ L. Chen, G. Papandreou, I. Kokkinos, K. Murphy, and A. L. Yuille. DeepLab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected CRFs. IEEE Transactions on Pattern Analysis and Machine Intelligence, 40(04):834–848, 2018.
247
+
248
+ Liang-Chieh Chen, Alexander G. Schwing, Alan L. Yuille, and Raquel Urtasun. Learning deep structured models. In Proceedings of the 32nd International Conference on International Conference on Machine Learning, ICML’15, pp. 1785–1794. JMLR, 2015.
249
+
250
+ Emir Demirovic, Peter J. Stuckey, James Bailey, Jeffrey Chan, Christopher Leckie, Kotagiri Ramamohanarao, and Tias Guns. Predict+optimise with ranking objectives: Exhaustively learning linear functions. In Sarit Kraus (ed.), Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence, IJCAI 2019, Macao, China, August 10-16, 2019, pp. 1078–1085. ijcai.org, 2019. doi: 10.24963/ijcai.2019/151. URL https://doi.org/10.24963/ijcai.2019/151.
251
+
252
+ Michel Deudon, Pierre Cournut, Alexandre Lacoste, Yossiri Adulyasak, and Louis-Martin Rousseau. Learning heuristics for the tsp by policy gradient. In Willem-Jan van Hoeve (ed.), Proc. of Intl. Conf. on Integration of Constraint Programming, Artificial Intelligence, and Operations Research, pp. 170–181. Springer, 2018.
253
+
254
+ E. W. Dijkstra. A note on two problems in connexion with graphs. Numer. Math., 1(1):269–271, December 1959. doi: 10.1007/BF01386390.
255
+
256
+ Justin Domke. Generic methods for optimization-based modeling. In Artificial Intelligence and Statistics, pp. 318–326, 2012.
257
+
258
+ Jack Edmonds. Paths, trees, and flowers. Canad. J. Math., 17:449–467, 1965. URL www.cs. berkeley.edu/∼christos/classics/edmonds.ps.
259
+
260
+ Adam N. Elmachtoub and Paul Grigas. Smart ”predict, then optimize”. ArXiv, abs/1710.08005, 2017.
261
+
262
+ Aaron Ferber, Bryan Wilder, Bistra Dilkina, and Milind Tambe. Mipaal: Mixed integer program as a layer. CoRR, abs/1907.05912, 2019. URL http://arxiv.org/abs/1907.05912.
263
+
264
+ Chuan-sheng Foo, Chuong B Do, and Andrew Y Ng. Efficient multiple hyperparameter learning for log-linear models. In Advances in neural information processing systems, pp. 377–384, 2008.
265
+
266
+ Maxime Gasse, Didier Chetelat, Nicola Ferroni, Laurent Charlin, and Andrea Lodi. Exact combina- ´ torial optimization with graph convolutional neural networks. arXiv, abs/1906.01629, 2019. URL http://arxiv.org/abs/1906.01629.
267
+
268
+ John C. Gower and Garmt B. Dijksterhuis. Procrustes problems, volume 30 of Oxford Statistical Science Series. Oxford University Press, Oxford, UK, January 2004.
269
+
270
+ Alex Graves, Greg Wayne, and Ivo Danihelka. Neural turing machines. arXiv, abs/1410.5401, 2014. URL http://arxiv.org/abs/1410.5401.
271
+
272
+ Alex Graves, Greg Wayne, Malcolm Reynolds, Tim Harley, Ivo Danihelka, Agnieszka GrabskaBarwinska, Sergio G ´ omez Colmenarejo, Edward Grefenstette, Tiago Ramalho, John Agapiou, ´ Adria Puigdom \` enech Badia, Karl Moritz Hermann, Yori Zwols, Georg Ostrovski, Adam Cain, \` Helen King, Christopher Summerfield, Phil Blunsom, Koray Kavukcuoglu, and Demis Hassabis. Hybrid computing using a neural network with dynamic external memory. Nature, 538(7626): 471–476, October 2016.
273
+
274
+ LLC Gurobi Optimization. Gurobi optimizer reference manual, 2019. URL http://www.gurobi.com.
275
+
276
+ Jean Guyomarch. Warcraft ii open-source map editor, 2017. URL http://github.com/war2/war2edit.
277
+
278
+ Tamir Hazan, Joseph Keshet, and David A. McAllester. Direct loss minimization for structured prediction. In Advances in Neural Information Processing Systems 23, pp. 1594–1602. Curran Associates, Inc., 2010.
279
+
280
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2016.
281
+
282
+ Elias B. Khalil, Pierre Le Bodic, Le Song, George Nemhauser, and Bistra Dilkina. Learning to branch in mixed integer programming. In Proceedings of the Thirtieth AAAI Conference on Artificial Intelligence, AAAI16, pp. 724731. AAAI Press, 2016.
283
+
284
+ Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization, 2014. cite arxiv:1412.6980Comment: Published as a conference paper at the 3rd International Conference for Learning Representations, San Diego, 2015.
285
+
286
+ Patrick Knobelreiter, Christian Reinbacher, Alexander Shekhovtsov, and Thomas Pock. End-to-end¨ training of hybrid cnn-crf models for stereo. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR’17), July 2017.
287
+
288
+ Vladimir Kolmogorov. Blossom V: a new implementation of a minimum cost perfect matching algorithm. Mathematical Programming Computation, 1(1):43–67, Jul 2009. doi: 10.1007/ s12532-009-0002-8. URL http://pub.ist.ac.at/∼vnk/software.html.
289
+
290
+ Wouter Kool, Herke van Hoof, and Max Welling. Attention, learn to solve routing problems! In International Conference on Learning Representations (ICLR’19), 2019. URL http://openreview. net/forum?id=ByxBFsRqYm.
291
+
292
+ Yujia Li, Richard Zemel, Marc Brockschmidt, and Daniel Tarlow. Gated graph sequence neural networks. In International Conference on Learning Representations (ICLR’16), 2016. URL http://arxiv.org/abs/1511.05493.
293
+
294
+ Zhuwen Li, Qifeng Chen, and Vladlen Koltun. Combinatorial optimization with graph convolutional networks and guided tree search. In Advances in Neural Information Processing Systems, NeurIPS’18, pp. 537–546, USA, 2018. Curran Associates Inc.
295
+
296
+ Ziwei Liu, Xiaoxiao Li, Ping Luo, Chen-Change Loy, and Xiaoou Tang. Semantic image segmentation via deep parsing network. In IEEE International Conference on Computer Vision, ICCV’15, pp. 1377–1385. IEEE Computer Society, 2015. doi: 10.1109/ICCV.2015.162.
297
+
298
+ Guy Lorberbom, Andreea Gane, Tommi S. Jaakkola, and Tamir Hazan. Direct optimization through arg max for discrete variational auto-encoder. arXiv, abs/1806.02867, 2018. URL http://arxiv. org/abs/1806.02867.
299
+
300
+ Jaynta Mandi, Emir Demirovic, Peter J. Stuckey, and Tias Guns. Smart predict-and-optimize for hard combinatorial optimization problems. CoRR, abs/1911.10092, 2019. URL http://arxiv.org/ abs/1911.10092.
301
+
302
+ Hugues Marchand, Alexander Martin, Robert Weismantel, and Laurence Wolsey. Cutting planes in integer and mixed integer programming. Discrete Appl. Math., 123(1-3):397–446, November 2002. doi: 10.1016/S0166-218X(01)00348-1.
303
+
304
+ Dmitrii Marin, Meng Tang, Ismail Ben Ayed, and Yuri Boykov. Beyond gradient descent for regularized segmentation losses. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR’19), June 2019.
305
+
306
+ Shakir Mohamed, Mihaela Rosca, Michael Figurnov, and Andriy Mnih. Monte carlo gradient estimation in machine learning. arXiv, abs/1906.10652, 2019. URL http://arxiv.org/abs/1906.10652.
307
+
308
+ Pritish Mohapatra, Michal Rol´ınek, C.V. Jawahar, Vladimir Kolmogorov, and M. Pawan Kumar. Efficient optimization for rank-based loss functions. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR’18), June 2018.
309
+
310
+ MohammadReza Nazari, Afshin Oroojlooy, Lawrence Snyder, and Martin Takac. Reinforcement learning for solving the vehicle routing problem. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems 31, pp. 9839–9849. Curran Associates, Inc., 2018. URL http://papers.nips.cc/paper/ 8190-reinforcement-learning-for-solving-the-vehicle-routing-problem.pdf.
311
+
312
+ Vlad Niculae, Andre Martins, Mathieu Blondel, and Claire Cardie. SparseMAP: Differentiable sparse structured inference. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 3799–3808, Stockholmsmssan, Stockholm Sweden, 10–15 Jul 2018. PMLR. URL http://proceedings.mlr.press/v80/niculae18a.html.
313
+
314
+ Despoina Paschalidou, Ali Osman Ulusoy, Carolin Schmitt, Luc Gool, and Andreas Geiger. Raynet: Learning volumetric 3d reconstruction with ray potentials. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR’18), 2018.
315
+
316
+ Leonid Pishchulin, Eldar Insafutdinov, Siyu Tang, Bjorn Andres, Mykhaylo Andriluka, Peter Gehler, ¨ and Bernt Schiele. Deepcut: Joint subset partition and labeling for multi person pose estimation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR’16), pp. 4929–4937. IEEE, 2016.
317
+
318
+ Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks, 2015. URL http://arxiv.org/abs/1511.06434.
319
+
320
+ Prasad Raghavendra. Optimal algorithms and inapproximability results for every CSP? In Proceedings of the 40th Annual ACM Symposium on Theory of Computing, STOC ’08, pp. 245–254, New York, NY, USA, 2008. ACM. doi: 10.1145/1374376.1374414.
321
+
322
+ Kegan GG Samuel and Marshall F Tappen. Learning optimized map estimates in continuouslyvalued mrf models. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR’09), pp. 477–484, 2009.
323
+
324
+ Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. Trans. Neur. Netw., 20(1):61–80, January 2009. ISSN 1045- 9227. doi: 10.1109/TNN.2008.2005605.
325
+
326
+ Uwe Schmidt and Stefan Roth. Shrinkage fields for effective image restoration. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR’14), pp. 2774–2781, 2014.
327
+
328
+ Samuel Schulter, Paul Vernaza, Wongun Choi, and Manmohan Krishna Chandraker. Deep network flow for multi-object tracking. IEEE Conference on Computer Vision and Pattern Recognition (CVPR’17), pp. 2730–2739, 2017.
329
+
330
+ Daniel Selsam and Nikolaj Bjørner. Guiding high-performance SAT solvers with Unsat-Core predictions. In Mikola´s Janota and In ˇ es Lynce (eds.), ˆ Theory and Applications of Satisfiability Testing – SAT 2019, pp. 336–353. Springer International Publishing, 2019.
331
+
332
+ Daniel Selsam, Matthew Lamm, Benedikt Bunz, Percy Liang, Leonardo de Moura, and David L. ¨ Dill. Learning a SAT solver from single-bit supervision. In International Conference on Learning Representations (ICLR’19), 2019. URL http://openreview.net/forum?id=HJMC iA5tm.
333
+
334
+ Jie Song, Bjoern Andres, Michael Black, Otmar Hilliges, and Siyu Tang. End-to-end learning for graph decomposition. arXiv, 1812.09737, 2018. URL http://arxiv.org/abs/1812.09737.
335
+
336
+ Yang Song, Alexander Schwing, Richard, and Raquel Urtasun. Training deep neural networks via direct loss minimization. In 33rd International Conference on Machine Learning (ICML), volume 48 of Proceedings of Machine Learning Research, pp. 2169–2177. PMLR, 2016.
337
+
338
+ Sainbayar Sukhbaatar, Arthur Szlam, Jason Weston, and Rob Fergus. End-to-end memory networks. In Advances in Neural Information Processing Systems 28 (NIPS), pp. 2440–2448. Curran Associates, Inc., 2015.
339
+
340
+ Johan Thapper and Stanislav Zivn ˇ y. The limits of SDP relaxations for general-valued CSPs. In ´ 32nd Annual ACM/IEEE Symposium on Logic in Computer Science, LICS ’17, pp. 27:1–27:12, Piscataway, NJ, USA, 2017. IEEE Press.
341
+
342
+ Jonathan J Tompson, Arjun Jain, Yann LeCun, and Christoph Bregler. Joint training of a convolutional network and a graphical model for human pose estimation. In Advances in Neural Information Processing Systems 27 (NIPS’14), pp. 1799–1807. Curran Associates, Inc., 2014.
343
+
344
+ Sebastian Tschiatschek, Aytunc Sahin, and Andreas Krause. Differentiable submodular maximization. In Proc. International Joint Conference on Artificial Intelligence (IJCAI), July 2018.
345
+
346
+ Ioannis Tsochantaridis, Thorsten Joachims, Thomas Hofmann, and Yasemin Altun. Large margin methods for structured and interdependent output variables. J. Mach. Learn. Res., 6:1453–1484, 2005.
347
+
348
+ Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer networks. In Advances in Neural Information Processing Systems 28 (NIPS’15), pp. 2692–2700. Curran Associates, Inc., 2015.
349
+
350
+ Po-Wei Wang, Priya L. Donti, Bryan Wilder, and Zico Kolter. SATNet: Bridging deep learning and logical reasoning using a differentiable satisfiability solver. arXiv, 1905.12149, 2019. URL http://arxiv.org/abs/1905.12149.
351
+
352
+ Bryan Wilder, Eric Ewing, Bistra Dilkina, and Milind Tambe. End to end learning and optimization on graphs. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d AlcheBuc, E. Fox, and R. Garnett (eds.), Advances in Neural Information Processing Systems 32, pp. 4674–4685. Curran Associates, Inc., 2019. URL http://papers.nips.cc/paper/ 8715-end-to-end-learning-and-optimization-on-graphs.pdf.
353
+
354
+ Mang Ye, Andy J. Ma, Liang Zheng, Jiawei Li, and Pong C. Yuen. Dynamic label graph matching for unsupervised video re-identification. In IEEE International Conference on Computer Vision (ICCV’17). IEEE Computer Society, Oct 2017.
355
+
356
+ Shuai Zheng, Sadeep Jayasumana, Bernardino Romera-Paredes, Vibhav Vineet, Zhizhong Su, Dalong Du, Chang Huang, and Philip H. S. Torr. Conditional random fields as recurrent neural networks. In IEEE International Conference on Computer Vision (ICCV’15), pp. 1529–1537. IEEE Computer Society, 2015.
357
+
358
+ # A APPENDIX
359
+
360
+ # A.1 GUIDELINES FOR SETTING THE VALUES OF $\lambda$ .
361
+
362
+ In practice, $\lambda$ has to be chosen appropriately, but we found its exact choice uncritical (no precise tuning was required). Nevertheless, note that $\lambda$ should cause a noticeable disruption in the optimization problem from equation (3), otherwise it is too likely that $y ( w ) = y _ { \lambda } ( w )$ resulting in a zero gradient. In other words, $\lambda$ should roughly be of the magnitude that brings the two terms in the definition of $w ^ { \prime }$ in Prop. 1 to the same order:
363
+
364
+ $$
365
+ \lambda \approx \frac { \left. w \right. } { \left. \frac { \mathrm { d } L } { \mathrm { d } y } \right. }
366
+ $$
367
+
368
+ where $\langle \cdot \rangle$ stands for the average. This again justifies that $\lambda$ is a true hyperparameter and that there is no reason to expect values around $\lambda \bar { } 0 ^ { \bar { + } }$ .
369
+
370
+ # A.2 PROOFS
371
+
372
+ Proof of Proposition 1. Let us write $L = L ( \hat { y } )$ and $\begin{array} { r } { \nabla L = \frac { \mathrm { d } L } { \mathrm { d } y } ( \hat { y } ) } \end{array}$ , for brevity. Thanks to the linearity of $\mathbf { c }$ and the definition of $f$ , we have
373
+
374
+ $$
375
+ \mathbf { c } ( \hat { w } , y ) + \lambda f ( y ) = \hat { w } y + \lambda \big ( L + \nabla L ( y - \hat { y } ) \big ) = ( \hat { w } + \lambda \nabla L ) y + \lambda L - \lambda \nabla L \hat { y } = \mathbf { c } ( w ^ { \prime } , y ) + \mathbf { c } _ { 0 } ,
376
+ $$
377
+
378
+ where $\mathbf { c } _ { 0 } = \lambda L - \lambda \nabla L \hat { y }$ and $w ^ { \prime } = \hat { w } + \lambda \nabla L$ as desired. The conclusion about the points of minima then follows.
379
+
380
+ Before we prove Theorem 1, we make some preliminary observations. To start with, due to the definition of the solver, we have the fundamental inequality
381
+
382
+ $$
383
+ \mathbf { c } ( w , y ) \geq \mathbf { c } { \big ( } w , y ( w ) { \big ) } \quad { \mathrm { f o r ~ e v e r y ~ } } w \in W { \mathrm { ~ a n d ~ } } y \in Y .
384
+ $$
385
+
386
+ Observation 1. The function $w \mapsto \mathbf { c } \big ( w , y ( w ) \big )$ is continuous and piecewise linear.
387
+
388
+ Proof. Since c’s are linear and distinct, $\mathbf { c } ( w , y ( w ) )$ , as their pointwise minimum, has the desired properties. □
389
+
390
+ Analogous fundamental inequality
391
+
392
+ $\mathbf { c } ( w , y ) + \lambda f ( y ) \geq \mathbf { c } { \big ( } w , y _ { \lambda } ( w ) { \big ) } + \lambda f { \big ( } y _ { \lambda } ( w ) { \big ) } \quad { \mathrm { f o r ~ e } }$ very $w \in W$ and $y \in Y$
393
+
394
+ follows from the definition of the solution to the optimization problem (3).
395
+
396
+ A counterpart of Observation 1 reads as follows.
397
+
398
+ Observation 2. The function $w \mapsto { \bf c } \big ( w , y _ { \lambda } ( w ) \big ) + \lambda f \big ( y _ { \lambda } ( w ) \big )$ is continuous and piecewise affine.
399
+
400
+ Proof. The function under inspection is a pointwise minimum of distinct affine functions $w \mapsto$ $\mathbf { c } ( w , y ) + \lambda f ( y )$ as $y$ ranges $Y$ .
401
+
402
+ As a consequence of above-mentioned fundamental inequalities, we obtain the following two-sided estimates on $f _ { \lambda }$ .
403
+
404
+ Observation 3. The following inequalities hold for $w \in W$
405
+
406
+ $$
407
+ f \bigl ( y _ { \lambda } ( w ) \bigr ) \leq f _ { \lambda } ( w ) \leq f \bigl ( y ( w ) \bigr ) .
408
+ $$
409
+
410
+ Proof. Inequality (6) implies that $\mathbf { c } \big ( w , y ( w ) \big ) - \mathbf { c } \big ( w , y _ { \lambda } ( w ) \big ) \ \leq \ 0$ and the first inequality then follows simply from the definition of $f _ { \lambda }$ . As for the second one, it suffices to apply (7) to $y =$ $y ( w )$ .
411
+
412
+ Now, let us introduce few notions that will be useful later in the proofs. For a fixed $\lambda , W$ partitions into maximal connected sets $P$ on which $y _ { \lambda } ( w )$ is constant (see Fig. 7). We denote this collection of sets by ${ \mathcal { W } } _ { \lambda }$ and set $\mathcal { W } = \mathcal { W } _ { 0 }$ .
413
+
414
+ For $\lambda \in \mathbb { R }$ and $y _ { 1 } \ne y _ { 2 } \in Y$ , we denote
415
+
416
+ $$
417
+ F _ { \lambda } ( y _ { 1 } , y _ { 2 } ) = \big \{ w \in W : c ( w , y _ { 1 } ) + \lambda f ( y _ { 1 } ) = c ( w , y _ { 2 } ) + \lambda f ( y _ { 2 } ) \big \} .
418
+ $$
419
+
420
+ We write $F ( y _ { 1 } , y _ { 2 } ) = F _ { 0 } ( y _ { 1 } , y _ { 2 } )$ , for brevity. For technical reasons, we also allow negative values of $\lambda$ here.
421
+
422
+ (a) The situation for $\lambda \ = \ 0$ . We can see the polytope $P$ on which $y ( w )$ attains $y _ { 1 } \in Y$ . The boundary of $P$ is composed of segments of lines $F ( y _ { 1 } , y _ { k } )$ for $k = 2 , \ldots , 5$ .
423
+
424
+ ![](images/232f340aaca3efe65b2229d5e3ec72dad55d58b162a7c9e17e73c6dadfb41045.jpg)
425
+ (b) The same situation is captured for some relatively small $\lambda > 0$ . Each line $F _ { \lambda } ( y _ { 1 } , y _ { k } )$ is parallel to its corresponding $F ( y _ { 1 } , y _ { k } )$ and encompasses a convex polytope in ${ \mathcal { W } } _ { \lambda }$ .
426
+ Figure 7: The family ${ \mathcal { W } } _ { \lambda }$ of all maximal connected sets $P$ on which $y _ { \lambda }$ is constant.
427
+
428
+ Note, that if $W \ : = \ : \mathbb { R } ^ { N }$ , then $F _ { \lambda }$ is a hyperplane since c’s are linear. In general, $W$ may just be a proper subset of $\mathbb { R } ^ { N }$ and, in that case, $F _ { \lambda }$ is just the restriction of a hyperplane onto $W$ . Consequently, it may happen that $F _ { \lambda } ( y _ { 1 } , y _ { 2 } )$ will be empty for some pair of $y _ { 1 } , y _ { 2 }$ and some $\lambda \in \mathbb { R }$ . To emphasize this fact, we say “hyperplane in $W ^ { \prime \prime }$ . Analogous considerations should be taken into account for all other linear objects. The note “in $W ^ { \prime \prime }$ stands for the intersection of these linear object with the set $W$ .
429
+
430
+ Observation 4. Let $P \in \mathcal { W } _ { \lambda }$ and let $y _ { \lambda } ( w ) = y$ for $w \in P$ . Then $P$ is a convex polytope in $W$ , where the facets consist of parts of finitely many hyperplanes $F _ { \lambda } ( y , y _ { k } )$ in $W$ for some $\{ y _ { k } \} \subset Y$ .
431
+
432
+ Proof. Assume that $W = \mathbb { R } ^ { N }$ . The values of $y _ { \lambda }$ may only change on hyperplanes of the form $F _ { \lambda } ( y , y ^ { \prime } )$ for some $y ^ { \prime } \in Y$ . Then $P$ is an intersection of corresponding half-spaces and therefore $P$ is a convex polytope. If $W$ is a proper subset of $\mathbb { R } ^ { N }$ the claim follows by intersecting all the objects with $W$ . □
433
+
434
+ Observation 5. Let $y _ { 1 } , y _ { 2 } \in Y$ be distinct. If nonempty, the hyperplanes $F ( y _ { 1 } , y _ { 2 } )$ and $F _ { \lambda } ( y _ { 1 } , y _ { 2 } )$ are parallel and their distance is equal to $| \lambda | K ( y _ { 1 } , y _ { 2 } )$ , where
435
+
436
+ $$
437
+ K ( y _ { 1 } , y _ { 2 } ) = { \frac { | f ( y _ { 1 } ) - f ( y _ { 2 } ) | } { \| y _ { 1 } - y _ { 2 } \| } } .
438
+ $$
439
+
440
+ Proof. If we define a function $c ( w ) = \mathbf { c } ( w , y _ { 1 } ) - \mathbf { c } ( w , y _ { 2 } ) = w ( y _ { 1 } - y _ { 2 } )$ and a constant $C =$ $f ( y _ { 2 } ) - f ( y _ { 1 } )$ , then our objects rewrite to
441
+
442
+ $$
443
+ F ( y _ { 1 } , y _ { 2 } ) = \{ w \in W : c ( w ) = 0 \} \quad { \mathrm { a n d } } \quad F _ { \lambda } ( y _ { 1 } , y _ { 2 } ) = \{ w \in W : c ( w ) = \lambda C \} .
444
+ $$
445
+
446
+ Since $c$ is linear, these sets are parallel and $F ( y _ { 1 } , y _ { 2 } )$ intersects the origin. Thus, the required distance is the distance of the hyperplane $F _ { \lambda } ( y _ { 1 } , y _ { 2 } )$ from the origin, which equals to $| \lambda C | / \bar { | | } y _ { 1 } -$ $y _ { 2 } \|$ . □
447
+
448
+ As the set $Y$ is finite, there is a uniform upper bound $K$ on all values of $K ( y _ { 1 } , y _ { 2 } )$ . Namely
449
+
450
+ $$
451
+ K = \operatorname* { m a x } _ { \boldsymbol { y } _ { 1 } , \boldsymbol { y } _ { 2 } \in \boldsymbol { Y } \atop \boldsymbol { y } _ { 1 } \neq \boldsymbol { y } _ { 2 } } K ( \boldsymbol { y } _ { 1 } , \boldsymbol { y } _ { 2 } ) .
452
+ $$
453
+
454
+ # A.2.1 PROOF OF THEOREM 1
455
+
456
+ Proof of Property A1. Now, Property A1 follows, since
457
+
458
+ $$
459
+ f _ { \lambda } ( w ) = { \frac { 1 } { \lambda } } { \Big [ } \mathbf { c } { \big ( } w , y _ { \lambda } ( w ) { \big ) } + \lambda f { \big ( } y _ { \lambda } ( w ) { \big ) } { \Big ] } - { \frac { 1 } { \lambda } } \mathbf { c } { \big ( } w , y ( w ) { \big ) }
460
+ $$
461
+
462
+ and $f _ { \lambda }$ is a difference of continuous and piecewise affine functions.
463
+
464
+ Proof of Property A2. Let $0 < \lambda _ { 1 } \leq \lambda _ { 2 }$ be given. We show that $W _ { \mathsf { e q } } ^ { \lambda _ { 2 } } \subseteq W _ { \mathsf { e q } } ^ { \lambda _ { 1 } }$ which is the same as showing $W _ { \mathrm { d i f } } ^ { \lambda _ { 1 } } \subseteq W _ { \mathrm { d i f } } ^ { \lambda _ { 2 } }$ . Assume that $w \in W _ { \mathrm { e q } } ^ { \lambda _ { 2 } }$ , that is, by the definition of $W _ { \mathrm { e q } } ^ { \lambda _ { 2 } }$ and $f _ { \lambda }$ ,
465
+
466
+ $$
467
+ \mathbf { c } \bigl ( w , y ( w ) \bigr ) + \lambda _ { 2 } f \bigl ( y ( w ) \bigr ) = \mathbf { c } ( w , y _ { 2 } ) + \lambda _ { 2 } f \bigl ( y _ { 2 } \bigr ) ,
468
+ $$
469
+
470
+ in which we denoted $y _ { 2 } = y _ { \lambda _ { 2 } } ( w )$ . Our goal is to show that
471
+
472
+ $$
473
+ \mathbf { c } \bigl ( w , y ( w ) \bigr ) + \lambda _ { 1 } f \bigl ( y ( w ) \bigr ) = \mathbf { c } ( w , y _ { 1 } ) + \lambda _ { 1 } f \bigl ( y _ { 1 } \bigr ) ,
474
+ $$
475
+
476
+ where $y _ { 1 } = y _ { \lambda _ { 1 } } ( w )$ as this equality then guarantees that $w \in W _ { \mathrm { e q } } ^ { \lambda _ { 1 } }$ . Observe that (7) applied to $\lambda = \lambda _ { 1 }$ and $y = y ( w )$ , yields the inequality $\because$ in (10).
477
+
478
+ Let us show the reversed inequality. By Observation 3 applied to $\lambda = \lambda _ { 1 }$ , we have
479
+
480
+ $$
481
+ f ( y ( w ) ) \geq f ( y _ { 1 } ) .
482
+ $$
483
+
484
+ We now use (7) with $\lambda = \lambda _ { 2 }$ and $y = y _ { 1 }$ , followed by equality (9) to obtain
485
+
486
+ $$
487
+ \begin{array} { r l } & { \mathbf c ( w , y _ { 1 } ) + \lambda _ { 1 } f ( y _ { 1 } ) = \mathbf c ( w , y _ { 1 } ) + \lambda _ { 2 } f ( y _ { 1 } ) + ( \lambda _ { 1 } - \lambda _ { 2 } ) f ( y _ { 1 } ) } \\ & { \qquad \geq \mathbf c ( w , y _ { 2 } ) + \lambda _ { 2 } f ( y _ { 2 } ) + ( \lambda _ { 1 } - \lambda _ { 2 } ) f ( y _ { 1 } ) } \\ & { \qquad = \mathbf c ( w , y ( w ) ) + \lambda _ { 2 } f \big ( y ( w ) \big ) + ( \lambda _ { 1 } - \lambda _ { 2 } ) f ( y _ { 1 } ) } \\ & { \qquad = \mathbf c \big ( w , y ( w ) \big ) + \lambda _ { 1 } f \big ( y ( w ) \big ) + ( \lambda _ { 2 } - \lambda _ { 1 } ) \big [ f \big ( y ( w ) \big ) - f ( y _ { 1 } ) \big ] } \\ & { \qquad \geq \mathbf c \big ( w , y ( w ) \big ) + \lambda _ { 1 } f \big ( y ( w ) \big ) } \end{array}
488
+ $$
489
+
490
+ where the last inequality holds due to (11).
491
+
492
+ Next, we have to show that $W _ { \mathrm { d i f } } ^ { \lambda } \to \emptyset$ as $\lambda 0 ^ { + }$ , i.e. that for almost every $w \in W$ , there is a $\lambda > 0$ such that $w \not \in W _ { \mathrm { d i f } } ^ { \lambda }$ . To this end, let $w \in W$ be given. We can assume that $y ( w )$ is a unique solution of solver (1), since two solutions, say $y _ { 1 }$ and $y _ { 2 }$ , coincide only on the hyperplane $F ( y _ { 1 } , y _ { 2 } )$ in $W$ , which is of measure zero. Thus, since $Y$ is finite, the constant
493
+
494
+ $$
495
+ c = \operatorname* { m i n } _ { y \in Y \atop y \neq y ( w ) } \left\{ \mathbf { c } ( w , y ) - \mathbf { c } \big ( w , y ( w ) \big ) \right\}
496
+ $$
497
+
498
+ is positive. Denote
499
+
500
+ $$
501
+ d = \operatorname* { m a x } _ { y \in Y } \{ f { \big ( } y ( w ) { \big ) } - f ( y ) \} .
502
+ $$
503
+
504
+ If $d > 0$ , set $\lambda < c / d$ . Then, for every $y \in Y$ such that $f \left( y ( w ) \right) > f ( y )$ , we have
505
+
506
+ $$
507
+ \lambda < \frac { \mathbf { c } ( w , y ) - \mathbf { c } ( w , y ( w ) ) } { f \big ( y ( w ) \big ) - f ( y ) }
508
+ $$
509
+
510
+ which rewrites
511
+
512
+ $$
513
+ \mathbf { c } \big ( w , y ( w ) \big ) + \lambda f \big ( y ( w ) \big ) < \mathbf { c } ( w , y ) + \lambda f ( y ) .
514
+ $$
515
+
516
+ For the remaining ’s, (13) holds trivially for every $\lambda > 0$ . Therefore, $y ( w )$ is a solution of the minimization problem (3), whence $y _ { \lambda } ( w ) = y ( w )$ . This shows that $w \in W _ { \mathrm { e q } } ^ { \lambda }$ as we wished. If $d = 0$ , then $f \bigl ( y ( w ) \bigr ) \leq f ( y )$ for every $y \in Y$ and (13) follows again. □
517
+
518
+ Proof of Property A3. Let $y _ { 1 } \ne y _ { 2 } \in Y$ be given. We show that on the component of the set
519
+
520
+ $$
521
+ \{ w \in W : y ( w ) = y _ { 1 } \mathrm { a n d } y _ { \lambda } ( w ) = y _ { 2 } \}
522
+ $$
523
+
524
+ the function $f _ { \lambda }$ agrees with a $\delta$ -interpolator, where $\delta \leq C \lambda$ and $C > 0$ is an absolute constant. The claim follows as there are only finitely many sets and their components of the form (14) in $W _ { \mathrm { d i f } } ^ { \lambda }$ .
525
+
526
+ Let us set
527
+
528
+ $$
529
+ h ( w ) = \mathbf { c } ( w , y _ { 1 } ) - \mathbf { c } ( w , y _ { 2 } ) \quad { \mathrm { f o r ~ } } w \in W
530
+ $$
531
+
532
+ and
533
+
534
+ $$
535
+ g ( w ) = f ( y _ { 2 } ) - { \frac { 1 } { \lambda } } h ( w ) .
536
+ $$
537
+
538
+ The condition on c tells us that $h$ is a non-constant affine function. It follows by the definition of $F ( y _ { 1 } , y _ { 2 } )$ and $F _ { \lambda } ( y _ { 1 } , y _ { 2 } )$ that
539
+
540
+ $$
541
+ h ( w ) = 0 \quad { \mathrm { i f ~ a n d ~ o n l y ~ i f } } \quad w \in F ( y _ { 1 } , y _ { 2 } )
542
+ $$
543
+
544
+ and
545
+
546
+ $$
547
+ h ( w ) = \lambda { \big ( } f ( y _ { 2 } ) - f ( y _ { 1 } ) { \big ) } \quad { \mathrm { i f ~ a n d ~ o n l y ~ i f } } \quad w \in F _ { \lambda } ( y _ { 1 } , y _ { 2 } ) .
548
+ $$
549
+
550
+ By Observation 5, the sets $F$ and $F _ { \lambda }$ are parallel hyperplanes. Denote by $G$ the nonempty intersection of their corresponding half-spaces in $W$ . We show that $g$ is a $\delta$ -interpolator of $f$ on $G$ between $y _ { 1 }$ and $y _ { 2 }$ , with $\delta$ being linearly controlled by $\lambda$ .
551
+
552
+ We have already observed that $g$ is the affine function ranging from $f ( y _ { 1 } ) - \mathbf { o n }$ the set $F _ { \lambda } ( y _ { 1 } , y _ { 2 } ) -$ to $f ( y _ { 2 } )$ – on the set $F ( y _ { 1 } , y _ { 2 } )$ . It remains to show that $g$ attains both the values $f ( y _ { 1 } )$ and $f ( y _ { 2 } )$ at most $\delta$ -far from the sets $P _ { 1 }$ and $P _ { 2 }$ , respectively, where $P _ { k } \in \mathcal { W }$ denotes a component of the set $\{ w \in W : y ( w ) = y _ { k } \}$ , $k = 1 , 2$ .
553
+
554
+ Consider $y _ { 1 }$ first. By Observation 4, there are $z _ { 1 } , \dotsc , z _ { \ell } \in Y$ , such that facets of $P _ { 1 }$ are parts of hyperplanes $F ( y _ { 1 } , z _ { 1 } ) , \dots , F ( y _ { 1 } , z _ { \ell } )$ in $W$ . Each of them separates $W$ into two half-spaces, say $W _ { k } ^ { + }$ and $W _ { k } ^ { - }$ , where $W _ { k } ^ { - }$ is the half-space which contains $P _ { 1 }$ and $W _ { k } ^ { + }$ is the other one. Let us denote
555
+
556
+ $$
557
+ c _ { k } ( w ) = \mathbf { c } ( w , y _ { 1 } ) - \mathbf { c } ( w , z _ { k } ) \quad { \mathrm { f o r ~ } } w \in W { \mathrm { ~ a n d ~ } } k = 1 , \ldots , \ell .
558
+ $$
559
+
560
+ Every $c _ { k }$ is a non-zero linear function which is negative on $W _ { k } ^ { - }$ and positive on $W _ { k } ^ { + }$ . By the definition of $y _ { 1 }$ , we have
561
+
562
+ $$
563
+ \begin{array} { r } { \mathbf { c } ( w , y _ { 1 } ) + \lambda f ( y _ { 1 } ) \leq \mathbf { c } ( w , z _ { k } ) + \lambda f ( z _ { k } ) \quad \mathrm { f o r } w \in P _ { 1 } \mathrm { a n d f o r } k = 1 , \dots , \ell , } \end{array}
564
+ $$
565
+
566
+ that is
567
+
568
+ $$
569
+ c _ { k } ( w ) \leq \lambda { \big ( } f ( z _ { k } ) - f ( y _ { 1 } ) { \big ) } \quad { \mathrm { f o r ~ } } w \in P _ { 1 } { \mathrm { ~ a n d ~ f o r ~ } } k = 1 , \ldots , \ell .
570
+ $$
571
+
572
+ (a) The facets of $P _ { 1 }$ consist of parts of hyperplanes $F ( y _ { 1 } , z _ { k } )$ in $W$ . Each facet $F ( y _ { 1 } , z _ { k } )$ has its corresponding shifts $F _ { \lambda }$ and $F _ { - \lambda }$ , from which only one intersects $P$ . The polytope $P _ { 1 } ^ { \lambda }$ is then bounded by those outer shifts.
573
+
574
+ ![](images/0c295faf8067eef2fbe1620db532f98c27c070605735905923b255494d4de8be.jpg)
575
+ (b) The interpolator $g$ attains the value $f ( y _ { 1 } )$ on a part of $F _ { \lambda } ( y _ { 1 } , y _ { 2 } ) - \mathbf { a }$ border of the domain $G$ . The value $f ( y _ { 2 } )$ is attained on a part of $F ( y _ { 1 } , y _ { 2 } )$ – the second border of the strip $G$ .
576
+ Figure 8: The polytopes $P _ { 1 }$ and $P _ { 1 } ^ { \lambda }$ and the interpolator $g$
577
+
578
+ Now, denote
579
+
580
+ $$
581
+ W _ { k } ^ { \lambda } = \big \{ w \in W : c _ { k } ( w ) \leq \lambda \big | f ( z _ { k } ) - f ( y _ { 1 } ) \big | \big \} \quad \mathrm { f o r } \ k = 1 , \dots , \ell .
582
+ $$
583
+
584
+ Each $W _ { k } ^ { \lambda }$ is a half-space in $W$ containing $W _ { k } ^ { - }$ and hence $P _ { 1 }$ . Let us set $\begin{array} { r } { P _ { 1 } ^ { \lambda } = \bigcap _ { k = 1 } ^ { \ell } W _ { k } ^ { \lambda } } \end{array}$ . Clearly, $P _ { 1 } \subseteq P _ { 1 } ^ { \lambda }$ (see Fig. 8). By Observation 5, the distance of the hyperplane $\{ w \in W : c _ { k } ( w ) =$ $\lambda { \big | } f ( z _ { k } ) - f ( y _ { 1 } ) { \big | } \}$ from $P _ { 1 }$ is at most $\lambda K$ , where $K$ is given by (8). Therefore, since all the facets of $P _ { 1 } ^ { \lambda }$ are at most $\lambda K$ far from $P _ { 1 }$ , there is a constant $C$ such that each point of $P _ { 1 } ^ { \lambda }$ is at most $C \lambda$ far from $P _ { 1 }$ .
585
+
586
+ Finally, choose any $w _ { 1 } \in P _ { 1 } ^ { \lambda } \cap F _ { \lambda } ( y _ { 1 } , y _ { 2 } )$ . By (16), we have $g ( w _ { 1 } ) = f ( y _ { 1 } )$ , and by the definition of $P _ { 1 } ^ { \lambda }$ , $w _ { 1 }$ is no farther than $C \lambda$ away from $P _ { 1 }$ .
587
+
588
+ Now, let us treat $y _ { 2 }$ and define the set $P _ { 2 } ^ { \lambda }$ analogous to $P _ { 1 } ^ { \lambda }$ , where each occurrence of $y _ { 1 }$ is replaced by $y _ { 2 }$ . Any $w _ { 2 } \in \mathring { P } _ { 2 } ^ { \lambda } \cap F ( y _ { 1 } , y _ { 2 } )$ has desired properties. Indeed, (15) ensures that $g ( w _ { 2 } ) = f ( y _ { 2 } )$ and $w _ { 2 }$ is at most $C \lambda$ far away from $P _ { 2 }$ . □
589
+
590
+ # A.3 DETAILS OF EXPERIMENTS
591
+
592
+ # A.3.1 WARCRAFT SHORTEST PATH
593
+
594
+ The maps for the dataset have been generated with a custom random generation process by using 142 tiles from the Warcraft II tileset (Guyomarch, 2017). The costs for the different terrain types range from 0.8–9.2. Some example maps of size $1 8 \times 1 8$ are presented in Fig. 9a together with a histogram of the shortest path lengths. We used the first five layers of ResNet18 followed by a max-pooling operation to extract the latent costs for the vertices.
595
+
596
+ Optimization was carried out via Adam optimizer (Kingma & Ba, 2014) with scheduled learning rate drops dividing the learning rate by 10 at epochs 30 and 40. Hyperparameters and model details are listed in Tab. 5
597
+
598
+ Table 5: Experimental setup for Warcraft Shortest Path.
599
+
600
+ <table><tr><td>k</td><td>Optimizer(LR)</td><td>Architecture</td><td>Epochs</td><td>Batch Size</td><td>入</td></tr><tr><td>12,18,24, 30</td><td>Adam(5 × 10-4)</td><td>subset of ResNet18</td><td>50</td><td>70</td><td>20</td></tr></table>
601
+
602
+ ![](images/c4d7d1fad40aeeed7fe8bf5d7996e0f53a046bbf953f327668bd1e20bdbb8a7e.jpg)
603
+ Figure 9: Warcraft SP(18) dataset.
604
+
605
+ # A.3.2 MNIST MIN-COST PERFECT MATCHING
606
+
607
+ The dataset consists of randomly generated grids of MNIST digits that are sampled from a subset of 1000 digits of the full MNIST dataset. We trained a fully convolutional neural network with two convolutional layers followed by a max-pooling operation that outputs a $k \times k$ grid of vertex costs for each example. The vertex costs are transformed into the edge costs via the known cost function and the edge costs are then the inputs to the Blossom $\mathrm { v }$ solver (Edmonds, 1965) as implemented in (Kolmogorov, 2009).
608
+
609
+ Regarding the optimization procedure, we employed the Adam optimizer along with scheduled learning rate drops dividing the learning rate by 10 at epochs 10 and 20, respectively. Other training details are in Tab. 6. Lower batch sizes were used to reduce GPU memory requirements.
610
+
611
+ Table 6: Experimental setup for MNIST Min-cost Perfect Matching.
612
+
613
+ <table><tr><td>k</td><td>Optimizer(LR)</td><td>Architecture [channels,kernel size, stride]</td><td>Epochs</td><td>Batch Size</td><td>入</td></tr><tr><td>4,8</td><td>Adam(10-3)</td><td>[[20,5,1],[20, 5,1]]</td><td>30</td><td>70</td><td>10</td></tr><tr><td>16</td><td>Adam(10-3)</td><td>[[50, 5,1], [50, 5,1]]</td><td>30</td><td>40</td><td>10</td></tr><tr><td>24</td><td>Adam(10-3)</td><td>[50, 5,1], [50, 5,1]]</td><td>30</td><td>30</td><td>10</td></tr></table>
614
+
615
+ # A.3.3 GLOBE TRAVELING SALESMAN PROBLEM
616
+
617
+ For the Globe Traveling Salesman Problem we used a convolutional neural network architecture of three convolutional layers and two fully connected layers. The last layer outputs a vector of dimension $3 k$ containing the $k$ 3-dimensional representations of the respective countries’ capital cities. These representations are projected onto the unit sphere and the matrix of pairwise distances is fed to the TSP solver.
618
+
619
+ The high combinatorial complexity of TSP has negative effects on the loss landscape and results in many local minima and high sensitivity to random restarts. For reducing sensitivity to restarts, we set Adam parameters to $\beta _ { 1 } = 0 . 5$ (as it is done for example in GAN training (Radford et al., 2015)) and $\epsilon = 1 \dot { 0 } ^ { - 3 }$ .
620
+
621
+ The local minima correspond to solving planar TSP as opposed to spherical TSP. For example, if all cities are positioned to almost identical locations, the network can still make progress but it will never have the incentive to spread the cities apart in order to reach the global minimum. To mitigate that, we introduce a repellent force between epochs 15 and 30. In particular, we set
622
+
623
+ $$
624
+ L _ { \mathrm { r e p } } = \underset { i \neq j } { \mathbb { E } } e ^ { - \| x _ { i } - x _ { j } \| }
625
+ $$
626
+
627
+ where $x _ { i } \in \mathbb { R } ^ { 3 }$ for $i = 1 , \ldots , k$ are the positions of the $k$ cities on the unit sphere. The regularization constants $C _ { k }$ were chosen as 2.0, 3.0, 6.0, and 20.0 for $k \in \{ 5 , 1 0 , 2 0 , 4 0 \}$ .
628
+
629
+ For fine-tuning we also introduce scheduled learning rate drops where we divide the learning rate by 10 at epochs 80 and 90.
630
+
631
+ Table 7: Experimental setup for the Globe Traveling Salesman Problem.
632
+
633
+ <table><tr><td rowspan="2">k</td><td rowspan="2">Optimizer(LR)</td><td colspan="2">Architecture [channels,kernel size, stride],</td><td rowspan="2">Epochs</td><td rowspan="2">Batch Size</td><td rowspan="2">入</td></tr><tr><td>linear layer size</td><td></td></tr><tr><td>5,10,20</td><td>Adam(10-4)</td><td>[[20, 4,2], [50,4,2], 500]</td><td></td><td>100</td><td>50</td><td>20</td></tr><tr><td>40</td><td>Adam(5 × 10-5)</td><td>[20,4,2],[50,4,2],500]</td><td></td><td>100</td><td>50</td><td>20</td></tr></table>
634
+
635
+ In Fig. 5b, we compare the true city locations with the ones learned by the hybrid architecture. Due to symmetries of the sphere, the architecture can embed the cities in any rotated or flipped fashion. We resolve this by computing “the most favorable” isometric transformation of the suggested locations. In particular, we solve the orthogonal Procrustes problem (Gower & Dijksterhuis, 2004)
636
+
637
+ $$
638
+ R ^ { * } = \underset { R : R ^ { T } R = I } { \arg \operatorname* { m i n } } \| R X - Y \| ^ { 2 }
639
+ $$
640
+
641
+ where $X$ are the suggested locations, $Y$ the true locations, and $R ^ { * }$ the optimal transformation to apply. We report the resulting offsets in kilometers in Tab. 8.
642
+
643
+ Table 8: Average errors of city placement on the Earth.
644
+
645
+ <table><tr><td>k</td><td>5</td><td>10</td><td>20</td><td>40</td></tr><tr><td>Location offset (km)</td><td>69±11</td><td></td><td>19±511±5</td><td>58±7</td></tr></table>
646
+
647
+ # A.4 TRAVELING SALESMAN WITH AN APPROXIMATE SOLVER
648
+
649
+ Since approximate solvers often appear in practice where the combinatorial instances are too large to be solved exactly in reasonable time, we test our method also in this setup. In particular, we use the approximate solver (OR-Tools (ort, 2019)) for the Globe TSP. We draw two conclusions from the numbers presented below in Tab. 9.
650
+
651
+ (i) The choice of the solver matters. Even if OR-Tools is fed with the ground truth representations (i.e. true locations) it does not achieve perfect results on the test set (see the right column). We expect, that also in practical applications, running a suboptimal solver (e.g. a differentiable relaxation) substantially reduces the maximum attainable performance.
652
+ (ii) The suboptimality of the solver didn’t harm the feature extraction – the point of our method. Indeed, the learned locations yield performance that is close to the upper limit of what the solver allows (compare the middle and the right column).
653
+
654
+ Table 9: Perfect path accuracy for Globe TSP using the approximate solver OR-Tools (ort, 2019). The maximal achievable performance is in the right column, where the solver uses the ground truth city locations.
655
+
656
+ <table><tr><td colspan="3">Embedding OR-tools</td><td>OR-tools on GT locations</td></tr><tr><td>k</td><td>Train %</td><td>Test %</td><td>Test %</td></tr><tr><td>5</td><td>99.8 ±0.0</td><td>99.3 ± 0.1</td><td>100.0</td></tr><tr><td>10</td><td>84.3 ± 0.2</td><td>84.4±0.2</td><td>88.6</td></tr><tr><td>20</td><td>49.2 ±0.2</td><td>48.6± 0.8</td><td>54.4</td></tr><tr><td>40</td><td>14.6 ± 0.1</td><td>15.1 ± 0.3</td><td>15.2</td></tr></table>
md/train/ByGq7hRqKX/ByGq7hRqKX.md ADDED
@@ -0,0 +1,308 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # CROSS-TASK KNOWLEDGE TRANSFER FOR VISUALLY-GROUNDED NAVIGATION
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Recent efforts on training visual navigation agents conditioned on language using deep reinforcement learning have been successful in learning policies for two different tasks: learning to follow navigational instructions and embodied question answering. In this paper, we aim to learn a multitask model capable of jointly learning both tasks, and transferring knowledge of words and their grounding in visual objects across tasks. The proposed model uses a novel Dual-Attention unit to disentangle the knowledge of words in the textual representations and visual objects in the visual representations, and align them with each other. This disentangled task-invariant alignment of representations facilitates grounding and knowledge transfer across both tasks. We show that the proposed model outperforms a range of baselines on both tasks in simulated 3D environments. We also show that this disentanglement of representations makes our model modular, interpretable, and allows for transfer to instructions containing new words by leveraging object detectors.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Deep reinforcement learning has been shown to be capable of achieving super-human performance in playing games such as Atari 2600 (Mnih et al., 2013) and Go (Silver et al., 2016). Following the success of deep reinforcement learning in 3D Games such as Doom (Lample & Chaplot, 2017; Dosovitskiy & Koltun, 2017) and DeepmindLab (Mnih et al., 2016), there has been increased interest in using deep reinforcement learning for training embodied agents, which interact with a 3D environment by receiving first-person views of the environment and taking navigational actions. The simplest navigational agents learn a particular behaviour such as collecting or avoiding particular objects (Kempka et al., 2016; Jaderberg et al., 2016; Mirowski et al., 2016) or playing deathmatches (Lample & Chaplot, 2017; Dosovitskiy & Koltun, 2017). Subsequently, there have been efforts on training navigational agents whose behaviour is conditioned on a target specified using images (Zhu et al., 2017) or coordinates (Gupta et al., 2017a; Savva et al., 2017). More recently, there has been much interest in training agents conditioned on language as it offers several advantages over using images or coordinates.
12
+
13
+ Firstly, the compositionality of language allows generalization to new tasks without additional learning. Prior work (Oh et al., 2017; Hermann et al., 2017; Chaplot et al., 2017) has trained navigational agents to follow instructions and shown zero-shot generalization to new instructions which contain unseen composition of words seen in the training instructions. Secondly, language is also a convenient means for humans to communicate with autonomous agents. Language not only allows instruction but also interaction. Gordon et al. (2018) and Das et al. (2017) train agents to answer questions by navigating in the environment to gather the required information.
14
+
15
+ These multimodal tasks involve several challenges, such as perception from raw pixels, grounding of words in the instruction or question to visual objects and attributes, reasoning to perform relational tasks, fine-grained navigation in 3D environments with continuous state space, and learning to answer questions. Training a multi-task model can also facilitate knowledge transfer between the tasks and allow the model to generalize to scenarios which were not possible with single tasks. For example, if an agent learns to follow the instruction ‘Go to the red pillar’ and answer the question ‘What color is the torch?’, then it should also be able to follow the instruction ‘Go to the red torch’ and answer the question ‘What color is the pillar?’ without any additional training.
16
+
17
+ In this paper, we aim to train a multi-task navigation model to follow instructions and answer questions. To test the generalization of multi-task models, we define cross-task knowledge transfer as an evaluation criteria, evaluating zero-shot learning on instructions and questions consisting of unseen composition of words in both tasks. In order to achieve cross-task knowledge transfer, words in the input space of both tasks need to be aligned with each other and with the answer space while they are being grounded to visual objects and attributes. Prior models fail to achieve this as they are designed for a single task. We propose a novel dual-attention model involving sequential Gated- and Spatial-Attention operations to perform explicit task-invariant alignment between the image representation channels and the words in the input and answer space. We create datasets and simulation scenarios for testing cross-task knowledge transfer in the Doom environment (Kempka et al., 2016) and show that the proposed model outperforms a range of baselines on both tasks. Additionally, we demonstrate that the modularity of our model allows easy addition of new objects and attributes to a trained model. We plan to open-source the implementation of our proposed model as well as the datasets and simulation environments.
18
+
19
+ ![](images/c73220668e2566d5356bf6cee3722954a8f4847bd33438358c45fbb39f48d227.jpg)
20
+ Figure 1: An example of first-person view in the 3D Doom environment with sample instructions and questions. The test set consists of unseen instructions and questions. The dataset evaluates a model for cross-task knowledge transfer between Semantic Goal Navigation (SGN) and Embodied Question Answering (EQA).
21
+
22
+ # 2 RELATED WORK
23
+
24
+ This paper is motivated by a series of works on learning to follow navigation instructions (Oh et al., 2017; Hermann et al., 2017; Chaplot et al., 2017; Wu et al., 2018; Yu et al., 2018a) and learning to answer questions by navigating around the environment (Das et al., 2017; Gordon et al., 2018). Among methods learning from instructions in 3D environments, Oh et al. (2017) introduced a hierarchical RL model for learning sequences of instructions by learning skills to solve subtasks. Chaplot et al. (2017) introduced a gated-attention model for multimodal fusion of textual and visual representations using multiplicative interactions, whereas Hermann et al. (2017) introduced auxiliary tasks such as temporal autoencoding and language prediction to improve sample efficiency for this task. Yu et al. (2018a) proposed guided feature transformation which involves transformation of visual representations using latent sentence embeddings computed from the language input.
25
+
26
+ Among models for embodied question answering, Das et al. (2017) introduced a hierarchical model consisting of 4 modules, each for processing images, encoding questions, navigation, and questionanswering, each of which is pretrained with supervised or imitation learning, followed by fine-tuning of the navigation model using reinforcement learning. Gordon et al. (2018) introduced the task of Interactive Question Answering which involves interacting with objects in the environment with non-navigational actions for answering questions. They proposed Hierarchical Interactive Memory Network (HIMN), which allows temporal abstraction using a factorized set of controllers.
27
+
28
+ All of the above methods are designed for a single task, following navigational instructions or answering questions, whereas we aim to train a single model for both tasks. Yu et al. (2018b) introduced a model for interactive language acquisition by training on both Visual Question Answering and following instructions in a 2D grid world environment. We aim to tackle multimodal multitask learning in challenging 3D environments. Partial observability results in the requirement of learning to navigate for answering the questions, turning visual question answering to embodied question answering. 3D environments also allow us to test on interesting and more challenging instructions based on relative size of the objects, in addition to colors and types.
29
+
30
+ In addition to the above, there is a huge body of work on multimodal learning in static settings which do not involve navigation or reinforcement learning. Some relevant works which use attention mechanisms similar to the ones used in our proposed model include Perez et al. (2017); Fukui et al. (2016); Xu & Saenko (2016); Hudson & Manning (2018); Gupta et al. (2017b) for Visual Question Answering and Zhao et al. (2018) for grounding audio to vision.
31
+
32
+ ![](images/a49406c1969d1fd52bfa11b26df5a13669079ff90e34764405f0a9c3943df268.jpg)
33
+ Figure 2: Overview of our proposed architecture, described in detail in Section 4.
34
+
35
+ # 3 PROBLEM FORMULATION
36
+
37
+ Consider an autonomous agent interacting with an episodic environment as shown in Figure 1. In the beginning of each episode, the agent receives a textual input $T$ specifying the task that it needs to achieve. For example, $T$ could be an instruction describing the target object or a question querying about some visual detail of objects in the environment. At each time step $t$ , the agent observes a state $s _ { t } = ( I _ { t } , T )$ where $I _ { t }$ is the first-person (egocentric) view of the environment, and takes an action $a _ { t }$ , which could be a navigational action or an answer action. The agent’s objective is to learn a policy $\pi ( a _ { t } | s _ { t } )$ which leads to successful completion of the task specified by the textual input $T$ .
38
+
39
+ Tasks. We focus on the multi-task learning of two visually-grounded language navigation tasks: In Embodied Question Answering $( E Q A )$ , the agent is given a question (“What color is the torch?”), and it must navigate around the 3D environment to explore the environment and gather information to answer the question (“red”). In Semantic Goal Navigation (SGN), the agent is given a language instruction ( $^ { 6 6 } \mathrm { G o }$ to the red torch”) to navigate to a goal location.
40
+
41
+ Environments. We adapt the ViZDoom (Kempka et al., 2016)-based language grounding environment proposed by Chaplot et al. (2017) for visually-grounded multitask learning. It consists of a single room with 5 objects. The objects are randomized in each episode based on the textual input. We use two difficulty settings for the Doom domain: Easy: The agent is spawned at a fixed location. The candidate objects are spawned at five fixed locations along a single horizontal line in the field of view of the agent. Hard: The candidate objects and the agent are spawned at random locations and the objects may or may not be in the agents field of view in the initial configuration. The agent must explore the map to view all objects.
42
+
43
+ Datasets. We use the set of instructions from Chaplot et al. (2017) and create a dataset for questions using the same set of objects and attributes. We define cross-task knowledge transfer as an evaluation criteria for testing generalization of multi-task models. We create train-test splits for both instructions and questions datasets to explicitly test a multitask model’s ability to transfer the knowledge of words across different tasks. Each instruction in the test set contains a word that is never seen in any instruction in the training set but is seen in some questions in the training set. Similarly, each question in the test set contains a word never seen in any training set question. Figure 1 illustrates the train-test split of instructions and questions used in our experiments in the Doom domain. Note that for the EQA trainset, unseen words can be present in the answer.
44
+
45
+ The agent can take 4 actions: 3 navigational actions (forward, left, right) and 1 answer action. When the agent takes the answer action, the answer with the maximum probability in the output answer distribution is used. Other details such as the train-test splits are deferred to the Appendix. We also report results on an additional environment based on House3D (Wu et al., 2018) in the Appendix.
46
+
47
+ # 4 PROPOSED METHOD
48
+
49
+ In this section, we detail our proposed architecture (illustrated in Figure 2). At the start of each episode, the agent receives a textual input $T$ (an instruction or a question) specifying the task that it needs to achieve. At each time step, the agent observes an egocentric image $I _ { t }$ which is passed through a convolutional neural network (LeCun et al., 1995) with ReLU activations (Glorot et al., 2011) to produce the image representation $x _ { I } = f ( I _ { t } ; \theta _ { \mathrm { c o n v } } ) \in \mathbb { R } ^ { V \times H \times W }$ , where $\theta _ { \mathrm { c o n v } }$ denotes the parameters of the convolutional network, $V$ is the number of feature maps in the convolutional network output which is equal to the vocabulary size, and $H$ and $W$ are the height and width of each feature map. We use two representations for the textual input $T$ : (1) the bag-of-words representation denoted by $x _ { \mathrm { B o W } } ~ \in ~ \mathbb { R } ^ { V }$ and (2) a sentence representation $x _ { \mathrm { s e n t } } = f ( \breve { T } ; \theta _ { \mathrm { s e n t } } ) \in \mathbb { R } ^ { \breve { V } }$ , which is computed by passing the words in $T$ through a Gated Recurrent Unit (GRU) (Cho et al., 2014) network followed by a linear layer. Here, $\theta _ { \mathrm { s e n t } }$ denotes the parameters of the GRU network and the linear layer with ReLU activations. Next, the Dual-Attention unit $f _ { \mathrm { D A } }$ combines the image representation with the text representations to get the complete state representation $x _ { S }$ and answer prediction $x _ { \mathrm { A n s } }$ :
50
+
51
+ $$
52
+ x _ { \mathrm { S } } , x _ { \mathrm { A n s } } = f _ { \mathrm { D A } } ( x _ { I } , x _ { \mathrm { B o W } } , x _ { \mathrm { s e n t } } )
53
+ $$
54
+
55
+ Finally, $x _ { S }$ and $x _ { \mathrm { A n s } }$ , along with a time step embedding and a task indicator variable (for whether the task is SGN or EQA), are passed to the policy module to produce an action.
56
+
57
+ # 4.1 DUAL-ATTENTION UNIT
58
+
59
+ The Dual-Attention unit uses two types of attention mechanisms, Gated-Attention $f _ { \mathrm { G A } }$ and SpatialAttention $f _ { \mathrm { S A } }$ , to align representations in different modalities and tasks.
60
+
61
+ Gated-Attention. The Gated-Attention unit (Figure 3) was proposed in (Chaplot et al., 2017) for multimodal fusion. Intuitively, a GA unit attends to the different channels in the image representation based on the text representation. For example, if the textual input is the instruction ‘Go to the red pillar’, then the GA unit can learn to attend to channels which detect red things and pillars. More specifically, the GA unit takes as input a 3-dimensional tensor image representation $y _ { I } \in \mathring { \mathbb { R } } ^ { d \times H \times W }$ and a text representation $\bar { y _ { T } } \in \mathbb { R } ^ { d }$ , and outputs a 3-dimensional tensor ${ \boldsymbol { z } } \in \mathbb { R } ^ { d \times H \times W }$ . Note that the dimension of $y _ { T }$ is equal to the number of feature maps and the size of the first dimension of $y _ { I }$ . In the Gated-Attention unit, each element of $y _ { T }$ is expanded to a $H \times W$ matrix, resulting in a 3-dimensional tensor $M _ { y _ { T } } \in \mathbb { R } ^ { d \times H \times W }$ , whose $( i , j , k ) ^ { t \bar { h } }$ element is given by $M _ { y _ { T } } [ i , j , k ] = \bar { y } _ { T } [ i ]$ . This matrix is multiplied element-wise with the image representation: $z = f _ { \mathrm { G A } } ( y _ { I } , y _ { T } ) = M _ { y _ { T } } \odot y _ { I }$ , where $\odot$ denotes the Hadamard product (Horn, 1990).
62
+
63
+ ![](images/888f192624493aa788242aabe8918602f25c59af6c7afb47da6321d3f27acf6d.jpg)
64
+ Figure 3: Gated-Attention unit $f _ { \mathrm { G A } }$
65
+
66
+ Spatial-Attention. We propose a Spatial-Attention unit (Figure 4) which is analogous to the Gated-Attention unit except that it attends to different pixels in the image representation rather than the channels. For example, if the textual input is the question ‘Which object is blue in color?’, then we would like to spatially attend to the parts of the image which contain a blue object in order recognize the type of the blue object. The Spatial-Attention unit takes as input a 3-dimensional tensor image representation $y _ { I } \in \dot { \mathbb { R } ^ { d \times H \times W } }$ and a 2-dimensional spatial attention map $\mathit { y } _ { S } \in \mathbb { R } ^ { H \times W }$ , and outputs a tensor $\mathit { \check { z } } \in \mathbb { R } ^ { d \times H \times W }$ . Note that the height and width of the spatial attention map is equal to the height and width of the image representation. In the spatialattention unit, each element of the spatial attention map is expanded to a $d$ dimensional vector. This again results in a 3-dimensional tensor $M _ { y _ { S } } \in \mathbb { R } ^ { d \times \hat { H } \times W }$ , whose $( i , j , k ) ^ { t h }$ element is given by: $\bar { M } _ { y s } [ i , j , k ] = y _ { S } [ j , k ]$ . Just like in the Gated-Attention unit, this matrix is multiplied element-wise with the image representation: $z = f _ { \mathrm { S A } } ( y _ { I } , y _ { S } ) = M _ { y _ { S } } \odot y _ { I }$ . Similar spatial attention mechanisms have been used for Visual Question Answering (Fukui et al., 2016; Xu & Saenko, 2016; Hudson & Manning, 2018; Gupta et al., 2017b) and grounding audio in vision (Zhao et al., 2018).
67
+
68
+ ![](images/e7a785f4ad73bbe78d600384b1b5f88adcfc6098742f7d2bb686856c9e974c72.jpg)
69
+ Figure 4: Spatial-Attention unit $f _ { \mathrm { S A } }$
70
+
71
+ Dual-Attention. We now describe the operations in the Dual-Attention unit shown in Figure 5, as well as motivate the intuitions behind each operation. Given $x _ { I }$ , $x _ { \mathrm { B o W } }$ , and $x _ { \mathrm { s e n t } }$ , the Dual-Attention unit first computes a Gated-Attention over $x _ { I }$ using $x _ { \mathrm { B o W } }$ :
72
+
73
+ $$
74
+ x _ { \mathrm { G A l } } = f _ { \mathrm { G A } } ( x _ { I } , x _ { \mathrm { B o W } } ) \in \mathbb { R } ^ { V \times H \times W } .
75
+ $$
76
+
77
+ Intuitively, this first Gated-Attention unit associates each word in the vocabulary with a feature map in the image representation. A particular feature map is activated if and only if the corresponding word occurs in the textual input. In other words, the feature maps in the convolutional output learns to detect different objects and attributes, and words in the textual input specify which objects and attributes are relevant to the current task. The Gated-Attention using BoW representation attends to feature maps detecting corresponding objects and attributes, and masks all other feature maps. We use bag-of-words representation for the first GA unit as it explicitly aligns the words in textual input irrespective of whether it is a question or an instruction. Note that bag-of-words representation has been used previously in models trained for learning to follow instructions (Hermann et al., 2017).
78
+
79
+ ![](images/a7e5f5b2f4bacd0b9ce717a508e7d79925d868fa21a8c187b4d6a12dd64fc350.jpg)
80
+ Figure 5: Architecture of the Dual-Attention unit with example intermediate representations and operations.
81
+
82
+ Next, the output of the Gated-Attention unit $x _ { \mathrm { G A 1 } }$ is converted to a spatial attention map by summing over all channels followed by a softmax over $H \times W$ elements:
83
+
84
+ $$
85
+ x _ { \mathrm { s p a t } } = \sigma \left( \sum _ { i } ^ { V } { x _ { \mathrm { G A l } } [ i , : , : ] } \right) \in \mathbb { R } ^ { H \times W }
86
+ $$
87
+
88
+ where the softmax $\sigma ( z ) _ { j } = \exp ( z _ { j } ) / \sum _ { j } \exp ( z _ { j } )$ ensures that the attention map is normalized. Summation of $x _ { \mathrm { G A l } }$ along the depth dimension gives a spatial attention map which has high activations at spatial locations where relevant objects or attributes are detected. ReLU activations in the convolutional feature maps makes all elements positive, ensuring that the summation aggregates the activations of relevant feature maps.
89
+
90
+ $x _ { \mathrm { s p a t } }$ and $x _ { I }$ are then passed through a Spatial-Attention unit:
91
+
92
+ $$
93
+ x _ { \mathrm { S A } } = f _ { \mathrm { S A } } ( x _ { I } , x _ { \mathrm { s p a t } } ) \in \mathbb { R } ^ { V \times H \times W }
94
+ $$
95
+
96
+ The Spatial-Attention unit outputs all attributes present at the locations where relevant objects and attributes are detected. This is especially helpful for question answering, where a single GatedAttention may not be sufficient. For example, if the textual input is ‘Which color is the pillar?’, then the model needs to attend not only to feature maps detecting pillars (done by the Gated-Attention), but also to other attributes at the spatial locations where pillars are seen in order to predict their color. Note that a single Gated-Attention is sufficient for instruction following, as shown in (Chaplot et al., 2017). For example, if the textual input is ‘Go to the green pillar’, the first Gated-Attention unit can learn to attend to feature maps detecting green objects and pillar, and learn a navigation policy based on the spatial locations of the feature map activations.
97
+
98
+ $x _ { \mathrm { S A } }$ is then passed through another Gated-Attention unit with the sentence-level text representation:
99
+
100
+ $$
101
+ x _ { \mathrm { G A 2 } } = f _ { \mathrm { G A } } ( x _ { \mathrm { S A } } , x _ { \mathrm { s e n t } } ) \in \mathbb { R } ^ { V \times H \times W }
102
+ $$
103
+
104
+ This second Gated-Attention unit enables the model to attend to different types of attributes based on the question. For instance, if the question is asking about the color (‘Which color is the pillar?’), then the model needs to attend to the feature maps corresponding to colors; or if the question is asking about the object type (‘Which object is green in color?’), then the model needs to attend to the feature maps corresponding to object types. The sentence embedding $x _ { \mathrm { s e n t } }$ can learn to attend to multiple channels based on the textual input and mask the rest.
105
+
106
+ Next, the output is transformed to answer prediction by again doing a summation and softmax but this time summing over the height and width instead of the channels:
107
+
108
+ $$
109
+ x _ { \mathrm { A n s } } = \sigma \left( \sum _ { j , k } ^ { H , W } x _ { \mathrm { G A 2 } } [ : , j , k ] \right) \in \mathbb { R } ^ { V }
110
+ $$
111
+
112
+ Summation of $x _ { \mathrm { G A } 2 }$ along each feature map aggregates the activations for relevant attributes spatially. Again, ReLU activations for sentence embedding ensure aggregation of activations for each attribute or word. The answer space is identical to the textual input space $\mathbb { R } ^ { V }$ .
113
+
114
+ Finally, the Dual-Attention unit $f _ { \mathrm { D A } }$ outputs the answer prediction $x _ { \mathrm { A n s } }$ and the flattened spatial attention map $x _ { \mathrm { S } } = \mathrm { v e c } ( x _ { \mathrm { s p a t } } )$ , where $\mathrm { v e c } \bar { ( . ) }$ denotes the flattening operation.
115
+
116
+ Policy Module. The policy module takes as input the state representation $x _ { S }$ from the DualAttention unit, a time step embedding $t$ , and a task indicator variable $I$ (for whether the task is SGN or EQA). The inputs are concatenated then passed through a linear layer, then a recurrent GRU layer, then linear layers to estimate the policy function $\pi ( a _ { t } \mid I _ { t } , T )$ and the value function $V ( I _ { t } , T )$ .
117
+
118
+ All above operations are differentiable, making the entire architecture trainable end-to-end. Note that all attention mechanisms in the Dual-Attention unit only modulate the input image representation, i.e., mask or amplify specific feature maps or pixels. This ensures that there is an explicit alignment between the words in the textual input, the feature maps in the image representation, and the words in answer space. This forces the convolutional network to encode all the information required with respect to a certain word in the corresponding output channel. This explicit taskinvariant alignment between convolutional feature maps and words in the input and answer space facilitates grounding and allows for cross-task knowledge transfer. As shown in the results later, this also makes our model modular and allows easy addition of objects and attributes to a trained model.
119
+
120
+ # 4.2 OPTIMIZATION
121
+
122
+ The entire model is trained to predict both navigational actions and answers jointly. The policy is trained using Proximal Policy Optimization (PPO) (Schulman et al., 2017). For training the answer predictions, we use a supervised cross-entropy loss. Both types of losses have common parameters as the answer prediction is essentially an intermediate representation for the policy.
123
+
124
+ Auxiliary Task. As mentioned earlier, the feature maps in the convolutional output are expected to detect different objects and attributes. Consequently, we add a spatial auxiliary task to detect the object or attribute in the convolutional output channels corresponding to the word in the bag-of-words representation. A prior work (Gupta et al., 2017b) also explored the use of attribute and object recognition as an auxiliary task for Visual Question Answering. Rather than doing fine-grained object detection, we keep the size of the auxiliary predictions the same as the convolutional output to avoid increase in number of parameters, and maintain the explicit alignment on the convolutional feature maps with the words. Consequently, auxiliary labels are $( V \times H \times W )$ -dimensional tensors, where each of the $V$ channels correspond to a word in the vocabulary, and each element in a channel is 1 if the corresponding object or attribute is present in the current frame spatially. Figure 6 shows examples of auxiliary task labels for the channel corresponding to the word ‘red’. The auxiliary tasks are also trained with cross-entropy loss.
125
+
126
+ ![](images/fa7a1639c57b9e7bccb73053f54f5d1fe41e28c1028ec51acbe83fd8097150c0.jpg)
127
+ Figure 6: Example auxiliary task labels for the red channel.
128
+
129
+ # 5 EXPERIMENTS & RESULTS
130
+
131
+ Jointly learning semantic goal navigation and embodied question answering essentially involves a fusion of verbal and visual modalities. While prior methods are designed for a single task, we adapt several baselines for our environment and tasks by using their multimodal fusion techniques. We use two naive baselines, Image only and Text only; two baselines based on prior semantic goal navigation models, Concat (used by Hermann et al. (2017); Misra et al. (2017)) and Gated-Attention (GA) (Chaplot et al., 2017); and two baselines based on Question Answering models, FiLM (Perez et al., 2017) and PACMAN (Das et al., 2017). For fair comparison, we replace the proposed DualAttention unit with multimodal fusion techniques in the baselines and keep everything else identical to the proposed model. We provide more implementation details of all baselines in the Appendix.
132
+
133
+ # 5.1 RESULTS
134
+
135
+ We train all models for 10 million frames in the Easy setting and 50 million frames in the Hard setting. We use a $+ 1$ reward for reaching the correct object in SGN episodes and predicting the correct answer in EQA episodes. We use a small negative reward of -0.001 per time step to encourage shorter paths to target and answering questions as soon as possible. We also use distance-based reward shaping for SGN episodes, where the agent receives a small reward proportional to decrease in distance to the target. In the next subsection we evaluate the performance of the proposed model without the reward shaping. SGN episodes end when the agent reaches any object, and EQA episodes when the agent predicts any answer. All episodes have a maximum length of 210 time steps. We train all models with and without the auxiliary tasks using identical reward functions.
136
+
137
+ ![](images/0f763d40f3cf3cc304935d3ef380ea01fe08bd89fadf0f7ce22ecb962077a7f5.jpg)
138
+ Figure 7: Training accuracy of all models trained with auxiliary tasks for Easy (left) and Hard (right).
139
+
140
+ Table 1: Accuracy of all models on SGN & EQA test sets for both Easy & Hard difficulties.
141
+
142
+ <table><tr><td></td><td colspan="4">Easy</td><td colspan="4">Hard</td></tr><tr><td></td><td colspan="2">No Aux</td><td colspan="2">Aux</td><td colspan="2">No Aux</td><td colspan="2">Aux</td></tr><tr><td>Model</td><td>SGN</td><td>EQA</td><td>SGN</td><td>EQA</td><td>SGN</td><td>EQA</td><td>SGN</td><td>EQA</td></tr><tr><td>Text only</td><td>0.2</td><td>0.33</td><td>0.2</td><td>0.33</td><td>0.2</td><td>0.33</td><td>0.2</td><td>0.33</td></tr><tr><td>Image only</td><td>0.20</td><td>0.09</td><td>0.21</td><td>0.08</td><td>0.16</td><td>0.08</td><td>0.15</td><td>0.08</td></tr><tr><td>Concat</td><td>0.33</td><td>0.21</td><td>0.31</td><td>0.19</td><td>0.2</td><td>0.26</td><td>0.39</td><td>0.22</td></tr><tr><td>GA</td><td>0.27</td><td>0.18</td><td>0.35</td><td>0.24</td><td>0.18</td><td>0.11</td><td>0.22</td><td>0.24</td></tr><tr><td>FiLM</td><td>0.24</td><td>0.11</td><td>0.34</td><td>0.12</td><td>0.12</td><td>0.03</td><td>0.25</td><td>0.15</td></tr><tr><td>PACMAN</td><td>0.26</td><td>0.12</td><td>0.33</td><td>0.10</td><td>0.29</td><td>0.33</td><td>0.11</td><td>0.27</td></tr><tr><td>Dual-Attention</td><td>0.86</td><td>0.53</td><td>0.96</td><td>0.58</td><td>0.86</td><td>0.38</td><td>0.82</td><td>0.59</td></tr></table>
143
+
144
+ All models are trained jointly for both the tasks and tested on each task separately. In Figure 7, we show the training performance curves for all models trained with Auxiliary tasks in both Easy and Hard settings. In Table 1, we report the test performance of all models on both SGN and EQA for both Easy and Hard settings. During training, the Dual-Attention model learns faster as compared to the baselines in the Easy setting while achieving higher final performance in the Hard setting (see Figure 7). More interestingly, as shown in Table 1, the Dual-Attention model achieves considerably higher accuracy on the test set for SGN and EQA in both the difficulty settings when trained with or without auxiliary tasks. These results confirm the hypothesis that prior models, which are designed for a single task, lack the ability align the words in both the tasks and transfer knowledge across tasks. Lower accuracy on EQA for most models (see Table 1) indicates that EQA is more challenging than SGN as it involves alignment between not only input textual and visual representations but also with the answer space. As expected, using spatial auxiliary tasks lead to better performance for all models Visualization of the attention maps and intermediate representations in the model indicate that the textual and visual representations are aligned as expected (see Appendix for visualizations)1.
145
+
146
+ # 5.2 ABLATION TESTS
147
+
148
+ We perform a series of ablation tests in order to analyze the contribution of each component in the Dual-Attention unit: without Spatial-Attention (w/o SA), without the first Gated-Attention with $x _ { B o W }$ (w/o GA1), and without the second Gated-Attention with $x _ { \mathrm { s e n t } }$ (w/o GA2). We also try removing the task indicator variable (w/o Indicator Variable), removing reward shaping (w/o Reward Shaping), and training the proposed model on a single task, SGN or EQA (DA Single-Task).
149
+
150
+ Figure 8 shows the training performance curves for the Dual-Attention model along with all ablation models in the Easy Setting. In Table 2, we report the test set performance of all ablation models. The results indicate that SA and GA1 contribute the most to the performance of the Dual-Attention model. GA2 is critical for performance on EQA but not SGN (see Table 2). This is expected as GA2 is designed to attend to different objects and attributes based on the question and is used mainly for answer prediction. It is not critical for SGN as the spatial attention map consists of locations of relevant objects, which is sufficient for navigating to the correct object. Reward shaping and indicator variable help with learning speed (see Figure 8), but have little effect on the final performance (see Table 2). Dual-Attention models trained only on single tasks work well on SGN especially with auxiliary tasks. This is because the auxiliary task for single task models includes object detection labels corresponding to the words in the test set. This highlights a key advantage of the proposed model. Due to its modular and interpretable design, the model can used for transferring the policy to new objects and attributes without fine-tuning as discussed in the following subsection.
151
+
152
+ ![](images/69a4073a5b891f27a0c6d0e7e4b8f3eb9a94e900eda6ec575b749ee8e403a1d8.jpg)
153
+ Figure 8: Training accuracy of proposed Dual-Attention model with all ablation models trained without (left) and with (right) auxiliary tasks for the Easy environment.
154
+
155
+ Table 2: Accuracy of all the ablation models trained with and without Auxiliary tasks on SGN and EQA test sets for the Doom Easy environment.
156
+
157
+ <table><tr><td>Model</td><td>No Aux SGN EQA</td><td>Aux SGN</td></tr><tr><td>w/o SA</td><td></td><td>EQA</td></tr><tr><td>w/o GA1</td><td>0.20 0.16 0.25</td><td>0.20 0.15 0.16 0.38</td></tr><tr><td>w/o GA2</td><td>0.14 0.80 0.33</td><td>0.97 0.15</td></tr><tr><td>w/o Task Indicator</td><td>0.79 0.47</td><td>0.96 0.56</td></tr><tr><td>w/o Reward Shaping</td><td>0.82 0.49</td><td>0.93 0.51</td></tr><tr><td>DA Single-Task</td><td>0.63 0.31</td><td>0.91 0.34</td></tr><tr><td></td><td></td><td></td></tr><tr><td>DA Multi-Task</td><td>0.86 0.53</td><td>0.96 0.58</td></tr></table>
158
+
159
+ Table 3: The performance of a trained policy appended with object detectors on instructions containing unseen words (‘red’ and ‘pillar’).
160
+
161
+ <table><tr><td>Instruction</td><td>Easy</td><td>Hard</td></tr><tr><td>Go to the pillar</td><td>1.00</td><td>0.71</td></tr><tr><td>Go to the red object</td><td>0.99</td><td>0.89</td></tr><tr><td>Go to the tall/short pillar</td><td>0.99</td><td>0.68</td></tr><tr><td>Go to the &lt;known_color&gt;pillar.</td><td>1.00</td><td>0.79</td></tr><tr><td>Go to the red &lt;known_object&gt;</td><td>1.00</td><td>0.93</td></tr><tr><td>Go to the largest/smallest red object</td><td>0.95</td><td>0.69</td></tr><tr><td>Go to the tall/short red pillar</td><td>0.99</td><td>0.88</td></tr><tr><td>Go to the red pillar</td><td>0.99</td><td>0.82</td></tr></table>
162
+
163
+ # 5.3 EXTENSION: TRANSFER TO NEW WORDS
164
+
165
+ Consider a scenario of SGN where the agent is trained to follow instructions of certain objects and attributes. Suppose that the user wants the agent to follow instructions about a new object such as ‘pillar’ or a new attribute such the color ‘red’ which are never seen in any training instruction. Prior SGN models are shown to perform well to unseen combination of object-attribute pairs (Chaplot et al., 2017), but they do not generalize well to instructions containing a new word. The model retrained only on new instructions will lead to catastrophic forgetting of previous instructions.
166
+
167
+ In contrast, our model can be used for transfer to new words by training an object detector for each new word and appending it to the image representation $x _ { I }$ . In order to test this, we train a single-task SGN model using the proposed architecture on the training set for instructions. We use auxiliary tasks but only for words in the vocabulary of the instructions training set. After training the policy, we would like the agent to follow instructions containing test words ‘red’ and ‘pillar’, which the agent has never seen or received any supervision about how this attribute or object looks visually. For transferring the policy, we assume access to two object detectors which would give object detections for ‘red’ and ‘pillar’ separately. We resize the object detections to the size of a feature map in the image representation $( H \times W )$ and append them as channels to the image representation. We also append the words ‘red’ and ‘pillar’ to the bag-of-words representations in the same order such that they are aligned with the appended feature maps. We randomly initialize the embeddings of the new words for computing the sentence embedding. The results in Table 3 show that this policy generalizes well to different types of instructions with unseen words. This suggests that a trained policy can be scaled to more objects provided the complexity of navigation remains consistent.
168
+
169
+ # 6 CONCLUSION
170
+
171
+ We proposed a Dual-Attention model for visually-grounded multitask learning which uses Gatedand Spatial-Attention to disentangle attributes in feature representations and align them with the answer space. We show that the proposed model is able to transfer the knowledge of words across tasks and outperforms the baselines on both Semantic Goal Navigation and Embodied Question Answering by a considerable margin. We showed that disentangled and interpretable representations make our model modular and allows for easy addition of new objects or attributes to a trained model. In future, the model can potentially be extended to transferring knowledge across different domains by using modular interpretable representations of objects which are domain-invariant.
172
+
173
+ # REFERENCES
174
+
175
+ Devendra Singh Chaplot, Kanthashree Mysore Sathyendra, Rama Kumar Pasumarthi, Dheeraj Rajagopal, and Ruslan Salakhutdinov. Gated-attention architectures for task-oriented language grounding. arXiv preprint arXiv:1706.07230, 2017.
176
+
177
+ Kyunghyun Cho, Bart Van Merrienboer, Dzmitry Bahdanau, and Yoshua Bengio. On the properties ¨ of neural machine translation: Encoder-decoder approaches. arXiv preprint arXiv:1409.1259, 2014.
178
+
179
+ Abhishek Das, Samyak Datta, Georgia Gkioxari, Stefan Lee, Devi Parikh, and Dhruv Batra. Embodied question answering. arXiv preprint arXiv:1711.11543, 2017.
180
+
181
+ Alexey Dosovitskiy and Vladlen Koltun. Learning to act by predicting the future. In ICLR, 2017.
182
+
183
+ Akira Fukui, Dong Huk Park, Daylen Yang, Anna Rohrbach, Trevor Darrell, and Marcus Rohrbach. Multimodal compact bilinear pooling for visual question answering and visual grounding. arXiv preprint arXiv:1606.01847, 2016.
184
+
185
+ Xavier Glorot, Antoine Bordes, and Yoshua Bengio. Deep sparse rectifier neural networks. In Proceedings of the fourteenth international conference on artificial intelligence and statistics, pp. 315–323, 2011.
186
+
187
+ Daniel Gordon, Aniruddha Kembhavi, Mohammad Rastegari, Joseph Redmon, Dieter Fox, and Ali Farhadi. Iqa: Visual question answering in interactive environments. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4089–4098, 2018.
188
+
189
+ Saurabh Gupta, James Davidson, Sergey Levine, Rahul Sukthankar, and Jitendra Malik. Cognitive mapping and planning for visual navigation. arXiv preprint arXiv:1702.03920, 3, 2017a.
190
+
191
+ Tanmay Gupta, Kevin J Shih, Saurabh Singh, Derek Hoiem, Kevin J Shih, Arun Mallya, Wei Di, Vignesh Jagadeesh, Robinson Piramuthu, K Shih, et al. Aligned image-word representations improve inductive transfer across vision-language tasks. In ICCV, pp. 4223–4232, 2017b.
192
+
193
+ Karl Moritz Hermann, Felix Hill, Simon Green, Fumin Wang, Ryan Faulkner, Hubert Soyer, David Szepesvari, Wojtek Czarnecki, Max Jaderberg, Denis Teplyashin, et al. Grounded language learning in a simulated 3d world. arXiv preprint arXiv:1706.06551, 2017.
194
+
195
+ Roger A Horn. The hadamard product. In Proc. Symp. Appl. Math, volume 40, pp. 87–169, 1990.
196
+
197
+ Drew A Hudson and Christopher D Manning. Compositional attention networks for machine reasoning. arXiv preprint arXiv:1803.03067, 2018.
198
+
199
+ Max Jaderberg, Volodymyr Mnih, Wojciech Marian Czarnecki, Tom Schaul, Joel Z Leibo, David Silver, and Koray Kavukcuoglu. Reinforcement learning with unsupervised auxiliary tasks. arXiv preprint arXiv:1611.05397, 2016.
200
+
201
+ Michał Kempka, Marek Wydmuch, Grzegorz Runc, Jakub Toczek, and Wojciech Jaskowski. Viz- ´ doom: A doom-based ai research platform for visual reinforcement learning. arXiv preprint arXiv:1605.02097, 2016.
202
+
203
+ Guillaume Lample and Devendra Singh Chaplot. Playing FPS games with deep reinforcement learning. In Thirty-First AAAI Conference on Artificial Intelligence, 2017.
204
+
205
+ Yann LeCun, Yoshua Bengio, et al. Convolutional networks for images, speech, and time series. The handbook of brain theory and neural networks, 3361(10):1995, 1995.
206
+
207
+ Piotr Mirowski, Razvan Pascanu, Fabio Viola, Hubert Soyer, Andrew J Ballard, Andrea Banino, Misha Denil, Ross Goroshin, Laurent Sifre, Koray Kavukcuoglu, et al. Learning to navigate in complex environments. arXiv preprint arXiv:1611.03673, 2016.
208
+
209
+ Dipendra K Misra, John Langford, and Yoav Artzi. Mapping instructions and visual observations to actions with reinforcement learning. arXiv preprint arXiv:1704.08795, 2017.
210
+
211
+ Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin Riedmiller. Playing atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, 2013.
212
+
213
+ Volodymyr Mnih, Adria Puigdomenech Badia, Mehdi Mirza, Alex Graves, Timothy Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In ICML, 2016.
214
+
215
+ Junhyuk Oh, Satinder Singh, Honglak Lee, and Pushmeet Kohli. Zero-shot task generalization with multi-task deep reinforcement learning. arXiv preprint arXiv:1706.05064, 2017.
216
+
217
+ Ethan Perez, Florian Strub, Harm De Vries, Vincent Dumoulin, and Aaron Courville. Film: Visual reasoning with a general conditioning layer. arXiv preprint arXiv:1709.07871, 2017.
218
+
219
+ Manolis Savva, Angel X. Chang, Alexey Dosovitskiy, Thomas Funkhouser, and Vladlen Koltun. MINOS: Multimodal indoor simulator for navigation in complex environments. arXiv:1712.03931, 2017.
220
+
221
+ John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
222
+
223
+ David Silver, Aja Huang, Chris J Maddison, Arthur Guez, Laurent Sifre, George Van Den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, et al. Mastering the game of go with deep neural networks and tree search. Nature, 529(7587):484–489, 2016.
224
+
225
+ Yi Wu, Yuxin Wu, Georgia Gkioxari, and Yuandong Tian. Building generalizable agents with a realistic and rich 3d environment. arXiv preprint arXiv:1801.02209, 2018.
226
+
227
+ Huijuan Xu and Kate Saenko. Ask, attend and answer: Exploring question-guided spatial attention for visual question answering. In European Conference on Computer Vision, pp. 451–466. Springer, 2016.
228
+
229
+ Haonan Yu, Xiaochen Lian, Haichao Zhang, and Wei Xu. Guided feature transformation (gft): A neural language grounding module for embodied agents. arXiv preprint arXiv:1805.08329, 2018a.
230
+
231
+ Haonan Yu, Haichao Zhang, and Wei Xu. Interactive grounded language acquisition and generalization in a 2d world. arXiv preprint arXiv:1802.01433, 2018b.
232
+
233
+ Hang Zhao, Chuang Gan, Andrew Rouditchenko, Carl Vondrick, Josh McDermott, and Antonio Torralba. The sound of pixels. arXiv preprint arXiv:1804.03160, 2018.
234
+
235
+ Yuke Zhu, Roozbeh Mottaghi, Eric Kolve, Joseph J Lim, Abhinav Gupta, Li Fei-Fei, and Ali Farhadi. Target-driven visual navigation in indoor scenes using deep reinforcement learning. In Robotics and Automation (ICRA), 2017 IEEE International Conference on, pp. 3357–3364. IEEE, 2017.
236
+
237
+ # A VISUALIZATIONS
238
+
239
+ ![](images/eb82cf3d410040af24e674376db93bf154e95616c9f3df8c13dcc8542653e7ae.jpg)
240
+ Figure 9: Visualizations of convolutional output channels. We visualize the convolutional channels corresponding to 7 words (one in each row) for the same frame (shown in the rightmost column). The first column shows the auxiliary task labels for reference. The second column and third column show the output of the corresponding channel for the proposed Dual-Attention model trained without and with auxiliary tasks, respectively. As expected, the Aux model outputs are very close to the auxiliary task labels. The convolutional outputs of the No Aux model show that words and objects/properties in the images have been properly aligned even when the model is not trained with any auxiliary task labels. We do not provide any auxiliary label for words ‘smallest’ and ‘largest’ as they are not properties of an object and require relative comparison of objects. The visualizations in row 5 (corresponding to ‘smallest’) indicate that both models are able to compare the sizes of objects and detect the smallest object in the corresponding output channel even without any aux labels for the smallest object.
241
+
242
+ ![](images/c09df43f375517b1e7308882219ccaabee4d2f03fc7563c5a1c2705c93dc07be.jpg)
243
+ Figure 10: Spatial Attention and Answer Prediction Visualizations. An example EQA episode with the question “Which is the smallest blue object?”. The sentence embedding of the question is shown on the top $( x _ { s e n t } )$ . As expected, the embedding attends to object type words (’torch’, ’pillar’, ’skullkey’, etc.) as the question is asking about an object type (’Which object’). The rows show increasing time steps and columns show the input frame, the input frame overlaid with the spatial attention map, the predicted answer distribution, and the action at each time step. As the agent is turning, the spatial attention attends to small and blue objects. Time steps 1, 2: The model is attending to the yellow skullkey but the probability of the answer is not sufficiently high, likely because the skullkey is not blue. Time step 3: The model cannot see the skullkey anymore so it attends to the armor which is next smallest object. Consequently, the answer prediction also predicts armor, but the policy decides not to answer due to low probability. Time step 4: As the agent turns more, it observes and attends to the blue skullkey. The answer prediction has high probability for skullkey as it’s small and blue and the policy decides to answer the question.
244
+
245
+ ![](images/6acfbbc3bc1a92d1814e01f282a9c869e31804d2fe115c6a5a2a0783ad26bf0f.jpg)
246
+ Figure 11: Architecture of the policy module.
247
+
248
+ # B ADDITIONAL EXPERIMENTAL DETAILS
249
+
250
+ # B.1 HYPERPARAMETERS AND NETWORK DETAILS
251
+
252
+ The input image is rescaled to size $3 \times 1 6 8 \times 3 0 0$ . The convolutional network for processing the image consisted of 3 convolutional layers: conv1 containing $3 2 ~ 8 \mathrm { x } 8$ filters with stride 4, conv2 containing $6 4 ~ 4 \mathrm { x } 4$ filters with stride 2, and conv3 containing $V$ 3x3 filters with stride 2. We use ReLU activations for conv1 and conv2 and sigmoid for conv3, as its output is used as auxiliary task predictions directly. We use word embeddings and GRU of size 32 followed by linear layer of size $V$ to get the sentence-level representation. The policy module uses hidden dimension 128 for the linear and GRU layers (see Figure 11).
253
+
254
+ For reinforcement learning, we use Proximal Policy Optimization (PPO) with 8 actors and a time horizon of 128 steps. We use a single batch with 4 PPO epochs. The clipping parameter for PPO is set to 0.2. The discount factor $( \gamma )$ is 0.99. We used Adam optimizer with learning rate $2 . 5 \mathrm { e } { \cdot } 4$ for all experiments.
255
+
256
+ # B.2 BASELINE DETAILS
257
+
258
+ Image only: Naive baseline of just using the image representation: $x _ { \mathrm { S } } = \sec ( x _ { I } )$ where vec(.) denotes the flattening operation.
259
+
260
+ Text only: Naive baseline of just using the textual representations: $x _ { \mathrm { S } } = [ x _ { \mathrm { B o W } } , x _ { \mathrm { s e n t } } ]$
261
+
262
+ Concat: The image and textual representations are concatenated: $x _ { \mathrm { S } } = [ \mathrm { v e c } ( x _ { I } ) , x _ { \mathrm { B o W } } , x _ { \mathrm { s e n t } } ]$ . Note that concatenation is the most common method of combining representations. Hermann et al. (2017) concatenate convolutional image and bag-of-words textual representations for SGN, whereas Misra et al. (2017) use concatenation with sentence-level textual representations.
263
+
264
+ Gated-Attention: Adapted from Chaplot et al. (2017), who used Gated-Attention with sentencelevel textual representations for SGN: $x _ { \mathrm { S } } = f _ { \mathrm { G A } } ( x _ { I } , x _ { \mathrm { s e n t } } )$ .
265
+
266
+ FiLM: Perez et al. (2017) introduced a general-purpose conditioning method called Feature-wise Linear Modulation (FiLM) for Visual Question Answering. Using FiLM, $x _ { \mathrm { S } } = \gamma ( x _ { \mathrm { s e n t } } ) \odot x _ { I } +$ $\beta ( x _ { \mathrm { s e n t } } )$ where $\gamma ( x _ { \mathrm { s e n t } } )$ and $\beta ( x _ { \mathrm { s e n t } } )$ are learnable projections of the sentence representation.
267
+
268
+ PACMAN: Das et al. (2017) presented a hierarchical RL model for EQA. We adapt their method by using the attention mechanism in their QA module, which takes the last 5 frames and the text as input, and computes the similarity of the text with each frame using dot products between image and sentence-level text representations. These similarities are converted into attention weights using softmax, and the attention-weighted image features are concatenated with question embedding and passed through a softmax classifier to predict the answer distribution. For this particular baseline, we use the last 5 frames as input at each time step, unlike the proposed model and all other baselines which use a single frame as input. The attention-weighted image features are used as the state representation. The PACMAN model used a pretrained QA module, but we train this module jointly with the Navigation model for fair comparison with the proposed model.
269
+
270
+ For each of the above method except PACMAN, we use a linear layer $f$ with ReLU activations followed by softmax $\sigma$ to get a $V$ -dimensional answer prediction from the state representations: $x _ { \mathrm { A n s } } = \sigma ( \bar { f } ( x _ { \mathrm { S } } ; \theta _ { L i n } ) )$ . $x _ { \mathrm { { S } } }$ and $x _ { A n s }$ are concatenated and passed to the policy module along with the time step and task indicator variable just as in the proposed model.
271
+
272
+ ![](images/a6315480bb9a073f24a9632c6856b7874a62864e259308fb0863e2161017b386.jpg)
273
+ Figure 12: Plot showing the training accuracy of all the models without auxiliary tasks for Doom Easy and Hard environments.
274
+
275
+ ![](images/634ffdf84813ca11c0e122e1a00e556fb733df50e54d4f6c9664f00480c451dd.jpg)
276
+ Figure 13: Plot showing the training accuracy of 3 models across 3 training runs with different seeds with and without auxiliary tasks for Doom Easy environment without any smoothing.
277
+
278
+ # C DOOM EXPERIMENT DETAILS
279
+
280
+ Additional Results. We show the training accuracy of all models without auxiliary tasks for Doom Easy and Hard in Figure 12. We also show the training accuracy of 3 models across 3 training runs with different seeds with and without auxiliary tasks for Doom Easy environment in Figure 13.
281
+
282
+ Dataset. The Doom objects used in our experiments are illustrated in Figure 14. Instructions and questions used for training and evaluation are listed in Tables 4.
283
+
284
+ ![](images/69d7bb5a3ad8695b8a37ae82bea6b9ec1dbc83f181543eb44b38a763cd846842.jpg)
285
+ Figure 14: Objects of various colors and sizes used in the ViZDoom environment.
286
+
287
+ Table 4: Instructions and questions for ViZDoom experiments. We used 5 object classes (torch, pillar, keycard, skullkey, armor), 4 colors (red, green, blue, yellow), 2 sizes (tall, short), and 2 superlative sizes (smallest, largest).
288
+
289
+ <table><tr><td>SGN Instruction Type</td><td></td><td>42 Train Instructions: Not containing‘red&#x27;&amp;‘pillar&#x27;</td><td>28 Test Instructions: Containing‘red&#x27;or‘pillar&#x27;</td></tr><tr><td>Go to the (object).</td><td>Go to the color&gt;object.</td><td>torch,keycard,skullkey,armor yellow, green, blue</td><td>pillar red</td></tr><tr><td></td><td>Go to the size)object. Go to the {color) {object).</td><td>tall, short blue torch, green torch, green armor,</td><td>red torch,red skullkey,red pillar,</td></tr><tr><td></td><td></td><td>blue skullkey,blue keycard, yellow keycard, yellow skullkey</td><td>green pillar,red keycard,red armor</td></tr><tr><td></td><td>Go to the {size) (object). Go to the color) (size)object.</td><td>short torch,tall torch green tall, blue tall, blue short,</td><td>tall pillar, short pillar red short, red tall</td></tr><tr><td></td><td>Go to the size){color)object.</td><td>green short tall green, tall blue, short blue,</td><td>short red, tall red</td></tr><tr><td></td><td>Go to the {color)(size)(object).</td><td>short green green tall torch, green short torch,</td><td>red short pillar,red short torch,</td></tr><tr><td></td><td></td><td>blue short torch,blue tall torch</td><td>red tall pillar, green tall pillar, red tall torch, green short pillar</td></tr><tr><td></td><td>Go to the size) {color&gt; {object).</td><td>tall green torch,short green torch, short blue torch,tall blue torch</td><td>short red pillar, short red torch, tall red pillar, tall green pillar, tall red torch,short green pillar</td></tr><tr><td></td><td>Go to the superlative)object. Go to the {superlative&gt; (color) object.</td><td>largest, smallest smallest yellow, smallest blue, smallest green,largest blue,</td><td>largest red,smallest red</td></tr><tr><td>EQA</td><td>Question Type</td><td>largest green,largest yellow 21 Train Questions: Not containing‘blue&#x27;&amp;‘torch&#x27;</td><td>8 Test Questions: Containing‘blue&#x27;or‘torch&#x27;</td></tr><tr><td>Which {size)object is {color)in color?</td><td>What color is the {object)? What color is the {size){object&gt;? Which object is {color) in color?</td><td>pillar, keycard, skullkey,armor short pillar, tall pillar red,yellow, green</td><td>torch short torch, tall torch blue</td></tr></table>
290
+
291
+ # D HOUSE3D EXPERIMENTS
292
+
293
+ In the House3D domain, we train on one house environment and randomize the colors of each object at the start of each episode. The agent’s spawn location is fixed. We create instructions and questions dataset for this house similar to the Doom domain. The House3D objects used in our experiments are illustrated in Figure 15. Instructions and questions used for training and evaluation are listed in Table 6.
294
+
295
+ Each model is trained for 50 million frames jointly on both SGN and EQA, without the auxiliary tasks and using identical reward functions. Similar to Doom, we use a $+ 1$ reward for reaching the correct object in SGN episodes and predicting the correct answer in the EQA episodes. We use a small negative reward of - 0.001 per time step to encourage shorter paths to target and answering the questions as soon as possible. We also use distance based reward shaping for both SGN and EQA episodes, where the agent receives a small reward proportional to decrease in distance to the target. SGN episodes end when the agent reaches any object and EQA episodes when agent predicts any answer. All episodes have a maximum length of 420 time steps.
296
+
297
+ Table 5: Accuracy of all the models on the SGN and EQA train and test sets for the House3D Domain.
298
+
299
+ <table><tr><td></td><td colspan="2">SGN</td><td colspan="2">EQA</td></tr><tr><td>Model</td><td>Train</td><td>Test</td><td>Train</td><td>Test</td></tr><tr><td>Text only</td><td>0.63</td><td>0.33</td><td>0.22</td><td>0.23</td></tr><tr><td>Image only</td><td>0.28</td><td>0.01</td><td>0.12</td><td>0.22</td></tr><tr><td>Concat</td><td>0.65</td><td>0.13</td><td>0.31</td><td>0.13</td></tr><tr><td>GA</td><td>0.98</td><td>0.20</td><td>0.92</td><td>0.03</td></tr><tr><td>FiLM</td><td>0.99</td><td>0.37</td><td>0.92</td><td>0.24</td></tr><tr><td>PACMAN</td><td>0.73</td><td>0.20</td><td>0.40</td><td>0.21</td></tr><tr><td>Dual-Attention</td><td>0.99</td><td>0.47</td><td>0.89</td><td>0.29</td></tr></table>
300
+
301
+ In Table 5, we report the train and test performance of all the models on both SGN and EQA. The results are similar as in Doom: the Dual-Attention model outperforms the baselines by a considerable margin.
302
+
303
+ ![](images/af178f0259047b6ec08600ddcade5e3f117345df9c3c00343e94708605dc643a.jpg)
304
+ Figure 15: Example first-person views of the House3D environment with sample objects of various colors.
305
+
306
+ Table 6: Instructions and questions for House3D experiments. We used 6 object classes (refrigerator, office chair, fish tank, fireplace, bed, sofa) and 4 colors (red, green, blue, yellow).
307
+
308
+ <table><tr><td>SGN</td><td>Instruction Type</td><td>22 Train Instructions: Not containing‘red&#x27;&amp;‘bed&#x27;</td><td>11 Test Instructions: Containing‘red&#x27;or‘bed&#x27;</td></tr><tr><td></td><td>Go to the (object). Go to the {color)(object).</td><td>refrigerator,office_chair,fish_tank,fireplace green refrigerator, green office_chair, green fish_tank,green fireplace, green sofa, blue refrigerator, blue office_chair, blue fish_tank,blue fireplace,blue sofa, yellow refrigerator,yellow office_chair, yellow fish_tank,yellow fireplace,yellow sofa</td><td>bed red bed, green bed,blue bed, yellow bed,red refrigerator, red office_chair,red fish_tank, red fireplace,red sofa</td></tr><tr><td>EQA</td><td>Go to the {color) object. Question Type</td><td>green,blue,yellow 7 Train Questions:</td><td>red 2 Test Questions:</td></tr><tr><td></td><td></td><td>Not containing‘blue&#x27;&amp;‘sofa&#x27;</td><td>Containing‘blue&#x27;or‘sofa&#x27;</td></tr><tr><td></td><td>What color is the {object)? What object is color&gt; in color?</td><td>refrigerator,office_chair,fish_tank,fireplace,bed red, green,yellow</td><td>sofa blue</td></tr></table>
md/train/Esd7tGH3Spl/Esd7tGH3Spl.md ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Evaluating Efficient Performance Estimators of Neural Architectures
2
+
3
+ Xuefei Ning1] Changcheng Tang2
4
+
5
+ Wenshuo Li1
6
+
7
+ Zixuan Zhou1
8
+
9
+ Shuang Liang2
10
+
11
+ Huazhong Yang1†
12
+
13
+ Yu Wang1‡
14
+
15
+ Department of Electronic Engineering, Tsinghua University1 Novauto Technology Co. Ltd.2 ]foxdoraame@gmail.com, †yanghz@tsinghua.edu.cn, ‡yu-wang@tsinghua.edu.cn
16
+
17
+ # Abstract
18
+
19
+ Conducting efficient performance estimations of neural architectures is a major challenge in neural architecture search (NAS). To reduce the architecture training costs in NAS, one-shot estimators (OSEs) amortize the architecture training costs by sharing the parameters of one “supernet” between all architectures. Recently, zero-shot estimators (ZSEs) that involve no training are proposed to further reduce the architecture evaluation cost. Despite the high efficiency of these estimators, the quality of such estimations has not been thoroughly studied. In this paper, we conduct an extensive and organized assessment of OSEs and ZSEs on five NAS benchmarks: NAS-Bench-101/201/301, and NDS ResNet/ResNeXt-A. Specifically, we employ a set of NAS-oriented criteria to study the behavior of OSEs and ZSEs, and reveal their biases and variances. After analyzing how and why the OSE estimations are unsatisfying, we explore how to mitigate the correlation gap of OSEs from three perspectives. Through our analysis, we give out suggestions for future application and development of efficient architecture performance estimators. Furthermore, the analysis framework proposed in our work could be utilized in future research to give a more comprehensive understanding of newly designed architecture performance estimators. The code is available at https://github. com/walkerning/aw_nas [24].
20
+
21
+ # 1 Introduction
22
+
23
+ Neural architecture search (NAS) can automatically discover architectures that outperform the handcrafted ones for various applications [48, 10, 11]. Early NAS methods [48, 30] suffer from an extremely heavy computational burden, and can take tens of thousands of GPU hours to run. One of the major reasons for the computational challenge of NAS is that evaluating each candidate architecture is slow, which includes a full training and testing process. In the past years, studies [2, 27, 3, 5, 8, 45, 20, 1] have been focusing on developing more efficient performance estimators of neural architectures.
24
+
25
+ One-shot Estimator (OSE) Traditional NAS methods [48, 30, 2] conduct a costly separate training process to acquire the suitable parameters to evaluate each candidate architecture. To make NAS computationally tractable, ENAS [27] proposes the parameter-sharing technique to accelerate the architecture evaluation. Following this work, the parameter sharing technique is widely used for architecture search in different search spaces [39, 16] or incorporated with different search strategies [19, 16, 23, 40]. We refer to the parameter-sharing estimations as the “one-shot” estimations since it requires the training cost of one supernet.
26
+
27
+ How well the one-shot estimations are correlated with the standalone architecture performances is essential for the efficacy of NAS methods. Despite the widespread use of OSEs, studies [43] have revealed that the OSE estimations might fail to reflect the true ranking of architectures. However, their experiments are conducted in a toy search space with only 32 architectures. In this work, we conduct a more comprehensive study on OSEs in five search spaces with distinct properties, including three topological search spaces (NAS-Bench-101 [41], NAS-Bench-201 [9], and NAS-Bench-301 [32]), and two non-topological search spaces [29] (NDS ResNet, and NDS ResNeXt-A). We further analyze how and why OSE estimations have bias and variance, and explore how to improve OSEs.
28
+
29
+ Zero-shot Estimator (ZSE) More recently, in order to further reduce the architecture evaluation cost, several studies [20, 1, 15, 17, 26, 6] introduce “zero-shot” estimators that involve no training. In this work, we study various ZSEs on several benchmarks and reveal their properties and weakness.
30
+
31
+ Knowledge Our work reveals pieces of knowledge on OSEs and ZSEs. First of all, some behaviors of OSEs and ZSEs vary across search spaces (Appendix A.1.1, Sec. 4.2). Some of the common knowledge for OSEs revealed by our work include 1) OSEs bias towards architectures with lower complexity in the early training phase [18]. And this bias can be alleviated to various extents with sufficient training in different spaces (Sec. 5.1). 2) OSEs have variance and can be mitigated to some extent (Sec. 5.3, Sec. 6.1). 3) Reducing the sharing extent of OSEs can potentially improve their ranking quality [47] (Sec. 6.3).
32
+
33
+ As for ZSEs, we reveal that 1) Current ZSEs cannot benefit from one-shot training. The ranking qualities of ZSEs utilizing high-order information (i.e., gradients) even degrade a lot after one-shot training (Sec. 4.2). 2) Parameter-level ZSEs adapted from pruning literature are not suitable for ranking architectures, and their ranking qualities cannot surpass those of parameter size (#Param) or #FLOPs (Sec. 4.2). 3) Existing ZSEs have improper biases, some overestimate linear architectures without skip connections, and some overestimate architectures with smaller kernel sizes and receptive fields (Sec. 5.2). 4) The relative effectiveness of ZSEs varies between search spaces, relu_logdet [21] is the best on the three topological search spaces, and synflow [33] is better on the two non-topological search spaces (Sec. 4.2). 5) Most ZSEs are not sensitive to the input data distribution: They get similar architecture rankings when using random noises as the input (Appendix B.1).
34
+
35
+ Suggestions Based on our experiments and analyses, we give out suggestions for future OSE applications. For example: 1) Longer training makes one-shot estimations better (Sec. 4.1); 2) Using one-shot loss instead of accuracy significantly improves the ranking qualities in the DARTS space [16] (Sec. 4.1); 3) One should use enough validation data for OSEs, instead of merely several batches as in ZSEs (Sec. 4.1); 4) Using temporal ensemble helps reduce the ranking instability, and brings non-negative improvements on the ranking quality in different search spaces (Sec. 6.1); 5) In search space with isomorphic architectures, augmenting the sampling strategy to improve the sampling fairness is essential to avoid overestimating simple architectures (Sec. 6.2); 6) Affine operation should not be used in batch normalization (BN) during supernet training (Sec. 6.3).
36
+
37
+ As for ZSEs, we point out several open research problems: 1) Is there a general ZSE suitable for different types of search spaces? 2) Do we need to make ZSEs utilize the input data information better, and how can we do that? 3) Can we develop ZSEs that distinguish top architectures better? We also list out some technical suggestions for improving ZSEs: 1) Future ZSEs should conduct architecture-level analysis instead of using parameter-level analysis (Sec. 4.2). 2) According to some prominent bias of existing ZSEs, we can add some structural knowledge into ZSE voting ensembles, e.g., receptive field analysis seems promising for improving jacob_cov or relu_logdet (Sec. 5.2). 3) In future developments of ZSEs, researchers should add two simple comparison baselines, #Params, and #FLOPs, as they are actually very competitive baseline ZSEs (Sec. 4.2).
38
+
39
+ Our work provides strong baselines and diagnosis tools for future research of architecture performance estimators, and we suggest future research to utilize these baselines and tools for a more comprehensive understanding of newly designed performance estimators.
40
+
41
+ Analysis Framework Our analysis framework of efficient architecture performance estimators is organized as follows. We first introduce the evaluation criteria for estimator quality in Sec. 3. And Sec. 4 presents the quality evaluation of multiple OSEs and ZSEs. Then, we conduct an organized analysis on how and why the OSE and ZSE estimations have biases and variances in Sec. 5. Specifically, their complexity-level, operation-level, and architecture-level biases are demonstrated and analyzed. And the stability of OSE accuracy and ranking along the training process are analyzed. And in Sec. 6, based on our analysis framework, we present several case studies on improving OSEs from three perspectives: i.e. reducing the variance, bias, and parameter sharing extent.
42
+
43
+ # 2 Related Work
44
+
45
+ # 2.1 Efficient Performance Estimators of Neural Architectures
46
+
47
+ One-shot Estimators The vanilla NAS method [48] trains each architecture for 50 epochs to acquire its suitable parameters, which makes the NAS process prohibitively costly. As a remedy, ENAS [27] proposes to amortize the separate training costs by sharing parameters among architectures. Specifically, ENAS constructs an over-parametrized supernet such that all architectures can be evaluated using its parameter subsets. Throughout the search process, the shared supernet parameters are updated on the training set, and an RNN controller is updated alternatively on the validation set.
48
+
49
+ There are two types of parameter-sharing methods: 1) One-shot NAS methods [3, 13] that first train a supernet and then conduct architecture search without further supernet tuning. 2) Non-one-shot methods [27, 16, 40] that conduct supernet training and architecture search (i.e. controller update) jointly. And this work focuses on evaluating the estimations of the “one-shot” supernet, since it is the cleaner case without the complexity of varying controller settings and possible controller-supernet co-adaption. In each supernet training step, S architectures are randomly sampled to process a batch of training data. Here S denotes the number of Monte-Carlo architecture samples. Then, the gradients of these architectures are averaged to update the supernet.
50
+
51
+ Correlation of One-shot Estimators There exist some studies that carry out correlation evaluation for one-shot estimators. Zhang et al. [45] compare the correlation of OSEs and their proposed hyper-network-based estimator. However, their work is not aiming for a large-scale evaluation of OSEs and ZSEs, thus they only evaluate the OSE correlations on one search space, and do not conduct further analysis. Yu et al. [43] conduct parameter sharing NAS in a toy RNN search space with only 32 architectures in total, and discover that the parameter sharing rankings do not correlate with the true rankings of architectures. Zela et al. [44] also report that the correlation of parameter-sharing estimations is not satisfying with a Spearman correlation coefficient between -0.25 and 0.3 on a larger search space with around $1 5 \mathrm { k }$ architectures. Pourchot et al. [28] evaluate the Spearman’s ranking correlation of OSEs on NAS-Bench-101. Yu et al. [42] provide an analysis on how the heuristics and hyperparameters influence the supernet training on three benchmarks (i.e. NAS-Bench-101, NAS-Bench-201, and DARTS-NDS). But they only use the variants of Kendall’s Tau as the evaluation criteria, and do not further explore the biases and failing reasons of OSEs. Zhang et al. [47] point out the instability and poor ranking correlation of OSEs, and claim that the high extent of parameter sharing causes the unsatisfying performance. However, they only conduct experiments on a small search space with about 200 architectures.
52
+
53
+ In this paper, we conduct a more comprehensive study of OSE behaviors across five search spaces, and further investigate how and why the OSE estimations are not satisfying. We also propose and compare several techniques to mitigate the OSE correlation gap.
54
+
55
+ Zero-shot Estimators More recently, in order to further reduce the architecture evaluation cost, several researches [20, 1] propose “zero-shot” estimators that conduct no training and use random initialized models to estimate architecture performances. Based on the observation that good architectures have distinct local jacobian on different images, Mellor et al. [20] propose an indicator based on input jacobian correlation. Lopes et al. [17] improve the above indicator by calculating the jacobian correlation with respect to the class. Abdelfattah et al. [1] adapt several ZSEs from the pruning literature, and claim that these adapted ZSEs can perform well on NAS-Bench-201. Lin et al. [15] define the expected Gaussian complexity to measure the network expressivity, and efficiently discover architectures with state-of-the-art accuracy on ImagetNet. With a small training overhead, Ru et al. [31] propose to evaluate an architecture’s performance by its training speed. Concurrent to our work, White et al. [38] also evaluate various performance estimators on multiple benchmarks.
56
+
57
+ # 2.2 NAS Benchmarks
58
+
59
+ NAS benchmarks are proposed to enable researchers to verify the effectiveness of NAS methods efficiently. NAS-Bench-101 (NB101) [41] provides the performances of the $4 2 3 \mathrm { k }$ valid architectures in a cell-based search space. OSE cannot be easily applied for the whole NB101 search space due to its specific channel number rule. To reuse NB101 for benchmarking OSE, NAS-Bench-1shot1 (NB1shot) [44] picks out three sub-spaces of NB101, and a supernet can be easily constructed for these sub-spaces. In this work, we use the largest sub-space in NB1shot: NB1shot-3, and use the name “NB101” to refer to it. Another benchmark, NAS-Bench-201 (NB201) [9], provides the performances of all the 15625 architectures in a single-cell search space. Previous tabular benchmarks exhaustively train all architectures in a search space much smaller than commonly-used ones (e.g. DARTS [16] with size over $1 0 ^ { 1 8 }$ ). Recently, NAS-Bench-301 (NB301) [32] is proposed as a benchmark in the DARTS space. It adopts a surrogate-based methodology that predicts architecture performances with the performances of about 60k anchor architectures.
60
+
61
+ Besides these benchmarks on cell-based topological search spaces, we also experiment with two nontopological benchmarking search spaces [29], NDS ResNet, and NDS ResNeXt-A. The architectural decisions in these search spaces are the non-topological hyper-parameters of pre-defined blocks, including kernel size, width, depth, convolution group number, and so on. The properties of these benchmarking search spaces are summarized in Appendix Tab. A1.
62
+
63
+ # 3 Evaluation Criteria
64
+
65
+ This section introduces the major evaluation criteria used in our analysis framework, while the analysis criteria and methods of ranking bias and variance will be introduced in Sec. 5. We denote the total number of architectures as $M$ , the true (ground-truth, GT) performances and approximated estimated scores of architectures $\{ a _ { i } \} _ { i = 1 , \cdots , M }$ as $\{ y _ { i } \} _ { i = 1 , \cdots , M }$ and $\{ s _ { i } \} _ { i = 1 , \cdots , M }$ , respectively, and the ranking of the true and estimated score $y _ { i } , s _ { i }$ as $r _ { i } , n _ { i } \in \{ 1 , \cdots , M \}$ , respectively $( r _ { i } = 1$ indicates that $a _ { i }$ is the best architecture). The correlation criteria used in our framework are
66
+
67
+ • Pearson coefficient of linear correlation (LC): $\operatorname { c o r r } ( y , s ) / { \sqrt { \operatorname { c o r r } ( y , y ) \operatorname { c o r r } ( s , s ) } } .$ .
68
+ • Kendall’s Tau ranking correlation $( \mathrm { K D } \tau )$ : The relative difference of concordant pairs and
69
+ discordant pairs $\begin{array} { r } { \sum _ { i < j } \mathrm { s g n } ( y _ { i } - y _ { j } ) \mathrm { s g n } ( s _ { i } - s _ { j } ) / \binom { M } { 2 } } \end{array}$ .
70
+ • Spearman’s ranking correlation (SpearmanR): The pearson correlation coefficient between the ranking variables $\operatorname { c o r r } ( r , n ) / { \sqrt { \operatorname { c o r r } ( r , r ) \operatorname { c o r r } ( n , n ) } }$ .
71
+
72
+ Since the ability of differentiating between good architectures matters more than differentiating between bad ones, criteria that emphasize more on the relative order of architectures with good performances are desired. Denoting $A _ { K } = \{ a _ { i } | n _ { i } < K M \}$ as the set of architectures whose estimated scores $s$ are among the top $K$ portion of the search space, we use two set of criteira [25]:
73
+
74
+ • Precision $@ \mathrm { K }$ $\begin{array} { r } { ( \mathrm { P } \ @ \mathrm { t o p K } ) \in ( 0 , 1 ] = \frac { \# \{ i | r _ { i } < K M \wedge n _ { i } < K M \} } { K M } ; } \end{array}$ : The proportion of true top-K proportion architectures in the top- ${ \bf \nabla } \cdot { \bf K }$ architectures according to the scores. • BestRanking $@ \mathrm { K }$ $\mathrm { \sf ~ \zeta ( B R @ K ) } \in ( 0 , 1 ] = \mathrm { a r g } \operatorname* { m i n } _ { \alpha _ { i } \in A _ { K } } r _ { i } / M$ : The best normalized ranking among the top K proportion of architectures according to the scores (Lower is better).
75
+
76
+ Corresponding to P@topK, we also compare P@bottomK = #{i|ri>(1−K)M ∧ ni>(1−K)M} to reveal how the worst architectures are distinguished. And corresponding to $\mathrm { B R @ K }$ , we inspect WorstRanking $@ \mathrm { K }$ $\operatorname { K } \left( \operatorname { W R } \circledast \operatorname { K } \right) = \arg \operatorname* { m a x } _ { \alpha _ { i } \in A _ { K } } { r _ { i } } / M$ to reveal how the supernet is likely to regard a bad architecture to be good (Lower is better). Note that the rankings and architecture numbers are all relative numbers normalized by the total architecture number $M$ .
77
+
78
+ # 4 Evaluating Efficient Performance Estimators
79
+
80
+ # 4.1 Evaluation of One-shot Estimators
81
+
82
+ Trend of Different Criteria We inspect how these proposed criteria evolve during the training process. Unless otherwise noted, MC sample $S { = } 1$ is used in the experiments. And all training and evaluation settings are summarized in Appendix D. Fig. 1 and Appendix Fig. A24 show the criteria trend on topological and non-topological search spaces, respectively. We can see that the convergence speeds of criteria are different, and on all search spaces except NB101, all criteria show a rising trend as the training goes on, indicating that OSE gives better rankings with sufficient training.
83
+
84
+ Another fact is that on all search spaces except NB101, OSEs are better at distinguishing bad architectures (higher $\mathbf { P } \ @ \mathbf { b o t t o m } 5 \%$ ) than distinguishing good ones (lower $\mathbf { P } @ \mathbf { t o p } 5 \%$ ). This indicates that, although identifying the exactly optimal architecture might be difficult for OSEs, using them to filter bad architectures or warm-up sample-based NAS can be very effective. The results of more criteria are shown in Appendix Fig. A1.
85
+
86
+ ![](images/b8304783e77c6ebf99ae48f039807233487e76c290dc781e59acd148282487ed.jpg)
87
+ Figure 1: Top /Bottom: Criteria of using OS accuracy / OS loss as the estimations (right Y-axis: OS loss value). “Oneshot average” means the average oneshot score (accuracy or loss).
88
+
89
+ In the NB301 (DARTS) space, OS loss gives significantly better estimations than OS accuracy. For example, at epoch 1000, the KD $\tau$ of OS acc and loss are 0.381 and 0.512, respectively, while their $\mathrm { P @ t o p 5 \% }$ are $1 3 . 8 \%$ and $3 1 . 0 \%$ . This is because the loss value considers the network’s output distribution rather than a single label prediction, it has a less concentrated distribution and is more informative in ranking architectures. Fig. 2 shows that the OS accuracy distribution is indeed more concentrated than the OS loss on NB301.
90
+
91
+ ![](images/3d35aced6ca20a2e7936259372175c9884ec3242abfba7f15399adfac9a8d8eb.jpg)
92
+ Figure 2: The distribution of OS accuracy and loss.
93
+
94
+ Effect of the Validation Data Size We inspect OSEs’ ranking quality when using different numbers of validation data batches to evaluate the OS scores, and find that on both NB201/NB301, using more data improves the estimation quality. Specifically, we compute the average OS accuracies over $_ \mathrm { N }$ validation batches, where each batch contains 128 examples. And the effect of the batch number N on the ranking quality is shown in Fig. 3 and Appendix Fig. A3. Fig. 3 shows that on NB301, criteria get better when the batch number increases from 1 to 10 at epoch 1000. Interestingly, when the training is not sufficient (epoch 200), the criteria decrease with more data batches (especially those of the OS acc). To explain this, Fig. 3(upper right) shows the intra-“level” KD histogram, where architectures with the same OS accuracy using one validation batch are said to be in the same level. We can see that when the supernet is under-trained, it is not good at distinguishing between intra-level architectures (negative intra-level KDs). Therefore, using more validation data might bring negative impacts, while giving tie scores can avoid making wrong comparisons between similar architectures.
95
+
96
+ # 4.2 Evaluation of Zero-shot Estimators
97
+
98
+ Our work evaluates six parameter-level ZSEs and two architecture-level ZSEs. The six parameterlevel ZSEs are grad_norm, plain [22], snip [14], grasp [36], fisher [34, 35], and synflow [33]. These ZSEs are named after sensitivity indicators initially designed for fine-grained network pruning that measure the approximate loss change when certain parameters or activations are pruned. A recent work [1] proposes to sum up parameter-wise sensitivities of all parameters to evaluate an architecture. And architecture-level ZSEs measure the architecture’s discriminability by inference differences between different input images: jacob_cov [20] uses the input jacobian correlation, and relu_logdet [21] uses activation differences.
99
+
100
+ ![](images/881521b6730a6bd1f4e7cd29a61ace352aa7330c41d5d6a85f1ae466f167f1d2.jpg)
101
+ Figure 3: Criteria vary on NB301 as the batch number (X-axis) changes. Right: The histogram of intra-level KDs using 10-batch OS acc, the “levels” are partitioned according to 1-batch OS acc. Since batch_size ${ \mathrel { = } } 1 2 8$ , at most 128 levels can exist. The legend gives out the actual number of levels in 1-batch evaluation with format “#acc levels with #arch>1 / #total”.
102
+
103
+ The full evaluation results of ZSEs are shown in Appendix B and C, and Fig. 4 shows some of the results on NB201 and NB301. We can see that the ranking correlations of ZSEs except relu_logdet are even worse than the GT-Param correlation. Also, the relative effectiveness of ZSEs varies between search spaces. For example, on NB301, plain performs better than other ZSEs except
104
+
105
+ ![](images/0d8eec200ae47c370661711c4509e608c8fac6a10d52bb363270216a333f9730.jpg)
106
+ Figure 4: KD between GT, FLOPs/Params, OSEs (1k epoch) and ZSEs. Left: NB201; Right: NB301.
107
+
108
+ relu_logdet, while on NB201, plain performs worst among all ZSEs. And jacob_cov and synflow give relatively good estimations with KD of $0 . 6 1 \mathrm { ~ / ~ } 0 . 5 7$ , but they do not perform well on NB301 (KDs are $0 . 2 3 / 0 . 2 )$ . Also, as shown in Appendix Tab. A12, the best-performing ZSE on topological search spaces, relu_logdet, does not perform well on non-topological NDS ResNet and ResNeXt-A.
109
+
110
+ The vote ZSE [1] conducts a majority vote between various metrics to compare each pair of architectures. We choose three best-performing ZSEs as the voting experts, and find that this simple form of voting does not bring improvements over the best constituent ZSE. Better ways of ensembling different ZSEs need to be developed.
111
+
112
+ It is a natural idea to apply ZSEs on trained networks. Thus we explore whether ZSEs can benefit from one-shot training. According to Appendix Tab. A11, current ZSEs cannot benefit from one-shot training. The ranking qualities of ZSEs except relu_logdet even degrade a lot after one-shot training. A possible explanation is that these ZSEs utilize the gradient information, and the gradient magnitudes in a trained supernet are too small and obscure for architecture ranking.
113
+
114
+ # 5 How & Why the Estimations Are Not Satisfying
115
+
116
+ # 5.1 Bias of One-shot Estimators
117
+
118
+ Complexity-level Bias To identify which architectures are under- or overestimated, we investigate the relationship of the true-estimated Ranking Difference (RD) $r _ { i } - n _ { i } ; i = 1 , \cdots , M$ and the architecture complexity (i.e. Params, FLOPs). RD serves as an indicator of overestimation for arch $i$ : A positive RD indicates that this architecture is overestimated. Otherwise, it is underestimated.
119
+
120
+ Sub-architectures have different amounts of calculation and might converge with a different speed. Thus, we conduct the complexity-level bias analysis. In Fig. 5, we divide the architectures into five
121
+
122
+ ![](images/be6f1be83d88f80f18f1d90c0e7caf03cf1e6699448d1afcbe9416373bedec49.jpg)
123
+ Figure 5: Complexity-level bias. Left/right Y-axis: KD $\tau$ / Average RD within the complexity group. X-axis: Complexity groups (the group with the smallest FLOPs is at the leftmost).
124
+
125
+ complexity groups according to the amount of calculation (FLOPs), and show the KD and average RD in each group. In the early training stages (the 1st row), the average RD shows a decreasing trend, which means that the larger the model, the easier it is to be underestimated. This is because larger models converge at a slower speed. As the training goes on (the 2nd and 3rd rows), the absolute average RD decreases, indicating that the issue of underestimating larger models gets alleviated. And on both spaces, the decreasing intra-group KD $\tau$ indicates that it is harder for OSEs to compare larger models than comparing smaller ones.
126
+
127
+ Op-level Bias We inspect the changes of GT and OS accuracy when one operation is mutated to another (edit distance $^ { = 1 }$ ). On NB301, we examine 23476 mutation pairs and find that the OSE estimations overes
128
+
129
+ timate the effects brought by dilation (Dil) convolutions (Convs): All mutation types from other operations to DilConvs witness a higher OS increase ratio than the GT one. And the skip_connect operation is underestimated: All mutation pairs from skip_connect cause the OS increase ratio to be higher than the GT one. For example, when mutating one skip_connect operation to dil_conv_5x5, only $3 9 . 0 \%$ out of 2336 pairs get GT increases, while $9 4 . 9 \%$ get OS increases. This phenomenon is more remarkable when we only consider mutation pairs within the largest complexity group (grouped by Param): Only $1 5 . 3 \%$ of 569 pairs get GT increases, while $9 2 . 3 \%$ get OS increases. On NB201, based on a similar inspection of the mutation pairs, we find that OSE estimations slightly overestimate avgpool3x3 and underestimate conv $3 \mathbf { x } 3$ . Generally speaking, the op-level bias on NB201 is not as large as that on NB301. See Appendix A.2.2 for the figures and more results.
130
+
131
+ # 5.2 Bias of Zero-shot Estimators
132
+
133
+ ![](images/f1b7fb76b8566135b61ab87269543dad37fe963c3f1b3aea3acd73ad5b307df0.jpg)
134
+ Figure 6: The best architectures ranked by several ZSEs on NB201 and NB301.
135
+
136
+ Arch-level Bias By inspecting the best and worst architectures indicated by ZSEs, we find that existing ZSEs have improper biases. Fig. 6 shows that synflow has an excessive preference for large architectures. snip, grad_norm and fisher give similar rankings of architectures (see Fig. 4), and show improper preferences for architectures with gradient explosion: On NB201, they show a clear preference for architectures without skip connections, which are far from optimal. This is because gradient magnitudes in these architectures get exploded, and the absolute parameter-wise sensitivity is high. In a word, the parameter-level ZSEs adapted from the fine-grained pruning literature are not very suitable for ranking architectures, since they are designed to reflect the relative parameter-wise sensitivity. And due to their sensitivity to scales and gradient explosion, a simple form of adding up the parameter-wise sensitivity provides improperly biased estimations for architecture performances.
137
+
138
+ In contrast, architecture-level ZSEs (jacob_cov, relu_logdet) are more reasonable attempts that measure the architectures’ discriminability by inference differences between input images. Nevertheless, as shown in Fig. 6 and Appendix B.2, these two ZSEs prefer architectures with smaller receptive fields (prefer smaller kernel sizes or shallow architectures). Consequently, although these two ZSEs have relatively good ranking correlations on topological search spaces, they have difficulties in picking out top architectures (Poor $\mathrm { P @ }$ topKs, see Appendix Tab. A9).
139
+
140
+ # 5.3 Variance of One-shot Estimators
141
+
142
+ Accuracy Forgetting Due to the parameter sharing and the random sample training scheme, the training of subsequent architectures overwrites the weights of previous ones, thus degrades their OS accuracy. This “multi-model forgetting” phenomenon [4, 46] accounts for the variance of OS accuracies. Appendix Fig. A14 verifies the existence of the forgetting phenomenon. For each architecture in one epoch, we define its forgetting value (FV) as $\ a c c _ { 2 } \ - - \ a c c _ { 1 }$ , where $a c c _ { 1 }$ refers to its valid accuracy right after its training, and $a c c _ { 2 }$ refers to its accuracy after all the architectures in this epoch have been trained. Appendix Fig. A14 shows that the forgetting phenomenon exists in the early training stages, where the FVs are negative. As training progresses, the variance of the FVs decreases, which is natural due to the learning rate decay. Also, the mean FV becomes positive, indicating that training other architectures can have positive transferring effects on previous architectures instead of negative ones (i.e. forgetting). This observation can be explained by the increasing trend of inter-architecture gradient similarity in Appendix Fig. A15.
143
+
144
+ Ranking Stability We demonstrate the ranking stability in Fig. 7, since it plays an important role that influences the NAS process more directly than the accuracy stability. The criteria in this figure (i.e. relative KD, relative $\mathrm { P @ }$ top/bottomK) are calculated with two sets of adjacent OS estimations, while the estimations of the latter checkpoint are taken as the GT one. We can see that the ranking stability increases with sufficient training and the OS rankings of bad architectures are relatively stable (relP $@$ bottomK). On NB301, even with rather sufficient training
145
+
146
+ ![](images/c937c3d5779f53b4b06c43c35e0b94c97a112f032f9d40ea40218b8f8d11948d.jpg)
147
+ Figure 7: Ranking stability of OSEs.
148
+
149
+ (1k epoch) where the mean OS accuracy already saturates (Fig. 1), the ranking stability of top architectures is still not high (relP $@$ top $0 . 5 \% { \sim } 0 . 4 6 )$ . This is reasonable since that the accuracy differences between architectures in the DARTS space are smaller. And as expected, averaging the OS accuracy of multiple supernets stabilizes OSE estimations. Also, the temporal weight ensemble of multiple checkpoints can stabilize the estimations (Sec. 6.1).
150
+
151
+ # 6 How to Improve One-shot Estimations
152
+
153
+ Since different architectures require different values for supernet parameters, as the side effect of acceleration, parameter sharing serves as the intrinsic reason for the OSE correlation gap. Appendix Fig. A15 shows the gradient similarity distribution between architecture pairs on NB201. We can see that the inter-architecture gradient similarities vary in a large range, and one common phenomenon on NB201 and NB301 is that the mean similarity between architecture pairs is lower in the middle-stage layers and the architectures’ gradients in the very first and last layers are more similar. Another slightly counterintuitive fact is that the gradient directions become more similar as the training goes on, especially on NB201. This can explain the positive transferring effect in the latter training stages.
154
+
155
+ Due to parameter sharing, the random sample training scheme of OSE causes estimation variances. On the other hand, improper sampling distribution causes estimation biases. There are two types
156
+
157
+ of reasons for the bias: 1) Some architectures (e.g. with larger complexity) might need higher sampling probability to match their relative performance in standalone training. 2) Architectures are sampled from an unfair distribution, i.e., some architectures have undesirable higher equivalent probabilities.
158
+
159
+ Echoing the above analysis, this section conducts case studies to improve the OSE estimations from 3 perspectives, i.e. reducing the variance, bias, and parameter sharing extent. Sec. 6.1 experiments with 2 techniques that can reduce the OS estimation variance.And in Sec. 6.2, we demonstrate that using de-isomorphic sampling in space with isomorphic architectures (NB201) helps improve the sampling fairness, thus reduce the estimation bias.
160
+
161
+ ![](images/0b737e4b83011c839d8e9bae028ee47c8e85f8ba990ebeda34a8dfff42344abb.jpg)
162
+ Figure 8: Effect of ensemble techniques on OSEs. Top: NB201; Bottom: NB301.
163
+
164
+ # 6.1 Variance Reduction
165
+
166
+ Temporal Variance Reduction Sec. 5.3 shows that averaging OS scores of several supernets stabilizes the estimations. However, this technique is not practical due to its linearly enlarged consumption, as training k supernets takes k-times more computation. As a remedy, Guo et al. [12] propose to only train one supernet, and stabilize OS estimations by temporally averaging weights of supernet checkpoints. Besides the variance reduction effect shown in Fig. 7, Fig. 8 shows whether ensembling techniques can bring other ranking quality improvements. We can see that temporally ensembling 3 or 5 checkpoints brings improvements on NB201 but brings no bias improvements on NB301.
167
+
168
+ Sampling Variance Reduction We compare the results of using different MC sample numbers $S$ in supernet training. We also adapt Fair-NAS [7] sampling strategy to NB201 and NB301. Using multiple MC architecture samples has different influences in different spaces: It is beneficial for the estimation quality on NB301, while the estimation quality on NB201 decreases slightly as the MC sample number increases. See Appendix A.3.2 for more detailed results.
169
+
170
+ # 6.2 Sampling Fairness Improvement
171
+
172
+ Besides the complexity-level and op-level biases shown in Sec. 5.1, OSEs also have some evident architecture-level biases. The NB201 search space contains many isomorphic architectures with different representations, and there are 6466 unique structures (out of 15625) after de-isomorphism. We find that even after sufficient training, the supernet still overestimates some simple architectures significantly. Fig. 9(left) shows the top-2 ranked architectures by the average of 3 supernet’s OS scores at epoch 1000. With vanilla sampling (Iso), OS estimations bias towards simple architectures (a single Conv) with many isomorphic counterparts (Iso group size ${ } = 3 1 { }$ ). We find that this is because isomorphic architectures have identical gradients w.r.t. shared parameters, so that the shared parameters tend to be optimized towards the gradient directions of architectures with many isomorphic counterparts.
173
+
174
+ We compare the results of sampling w. or w.o. isomorphic architectures in Fig. 9(right). We can see that using the de-isomorphism (deiso) sampling strategy helps pick out top architectures and brings significant improvements on B $\mathbf { k } @ \mathbf { 0 . 5 } \%$ and ${ \bf P } @ 5 \%$ ( $1 . 9 \%$ to $0 . 2 3 \%$ , $2 1 . 3 \%$ to $4 6 . 7 \%$ ). We also experiment with a post-de-isomorphism (post-deiso) technique, in which the estimations of architectures in an isomorphic group are averaged during testing, while no changes are made during training. We can see that “post-deiso” brings slight improvements on $\mathrm { B R } @ \mathrm { K s }$ and $\mathrm { P @ }$ topKs compared with “no post-deiso”, which might owe to the decreased estimation variances. Actually, the deiso sampling strategy is to find a de-isomorphic representation space and conduct uniform sampling in it, and our study provides another evidence for the statement made by [37] that representations can be critical for NAS methods. More detailed results and discussions are in Appendix A.3.3.
175
+
176
+ ![](images/1527fc7344adb6fe1fb60cc8f7fc743634113c85af2a3247fb193c6f8836a989.jpg)
177
+ Figure 9: Comparison of Iso / Deiso sampling strategy. Left: Top-2 ranked architectures when the supernet is trained with Iso / Deiso sampling strategy, the legend’s format is “OS acc $( \% ) / \mathrm { G T }$ acc $( \% )$ , Iso group size”. Right: Criteria comparison along the training process.
178
+
179
+ # 6.3 Sharing Extent Reduction
180
+
181
+ Operation Pruning We remove one or two operations in the search space (SS) and conduct supernet training on the resulting sub-SS. After training the supernet, we compare the OS estimations on the sub-SS provided by the supernet trained on full SS and the sub-SS. The detailed results and analyses can be found in Appendix A.3.4. And the conclusion is: Sharing extent reduction by removing operations can bring improvements to the average OS scores of the remaining architectures in the sub-SS, especially in the early training stages. However, whether the improved absolute OS scores can bring ranking quality improvements is questionable, and the results vary across SSes.
182
+
183
+ One-shot Pruning We conduct SS pruning on NB201 by selecting the top $10 \%$ , $2 5 \%$ , $50 \%$ architectures ranked by the OS scores of supernet (epoch 600), and continue to finetune the supernet to 1000 epoch with these architectures. The good news is that on NB201, OS pruning brings improvements on both the average OS score and ranking quality in the sub-SS: $2 . 2 \% / 1 . 3 \% / 0 . 1 \%$ average OS score increases and 0.189/0.046/0.086 KD increases when the sub-SS contains $1 0 \% / 2 5 \% / 5 0 \%$ architectures, respectively. The results reveal the potential of dynamic SS pruning for improving the OSE quality, especially for good architectures. However, this per-architecture hard pruning scheme is not practical since it needs an exhaustive test of the full search space. To explore practical dynamic SS pruning methods, we conduct a case study on per-architecture soft pruning with a jointly-trained controller, where the controller gives higher sampling probability to the architectures with higher OS scores. The results and analyses are shown in Appendix A.3.4.
184
+
185
+ Remove the Affine Operation in BN We compare using or not using BN affine operations, and give out the comparison results in Appendix A.3.4. And the suggestion is that one should not use BN affine operations in the search process.
186
+
187
+ # 7 Conclusion
188
+
189
+ We present an analysis framework of efficient architecture performance estimators in NAS, containing carefully developed criteria and organized analyses. Within the framework, we conduct an in-depth analysis of OSEs and ZSEs on five benchmarking search spaces with distinct properties. Our work reveals the properties, weaknesses (variance and bias) of current architecture performance estimators. For OSEs, we further conclude three directions for their improvements and experiment with several mitigations accordingly. Our work gives out suggestions for future NAS applications and points out research directions to further improve current OSEs and ZSEs. Besides the take-away knowledge, our work also provides strong baselines for future research of efficient performance estimators, and the analysis framework could be utilized to diagnose new performance estimators.
190
+
191
+ # Acknowledgements
192
+
193
+ This work was supported by National Natural Science Foundation of China (No. U19B2019, 61832007), Tsinghua EE Xilinx AI Research Fund, Beijing National Research Center for Information Science and Technology (BNRist), and Beijing Innovation Center for Future Chips. We thank Zinan Lin, Tianchen Zhao, and Hanbo Sun for their valuable discussions. Finally, we thank all anonymous reviewers for their constructive suggestions.
194
+
195
+ # References
196
+
197
+ [1] Mohamed S. Abdelfattah, Abhinav Mehrotra, Łukasz Dudziak, and Nicholas D. Lane. ZeroCost Proxies for Lightweight NAS. In International Conference on Learning Representations, 2021.
198
+ [2] Bowen Baker, Otkrist Gupta, Ramesh Raskar, and Nikhil Naik. Accelerating neural architecture search using performance prediction. In International Conference on Learning Representations Workshop, 2018.
199
+ [3] Gabriel Bender, Pieter-Jan Kindermans, Barret Zoph, Vijay Vasudevan, and Quoc Le. Understanding and simplifying one-shot architecture search. In International Conference on Machine Learning, pages 550–559, 2018.
200
+ [4] Yassine Benyahia, Kaicheng Yu, Kamil Bennani Smires, Martin Jaggi, Anthony C Davison, Mathieu Salzmann, and Claudiu Musat. Overcoming multi-model forgetting. In International Conference on Machine Learning, pages 594–603. PMLR, 2019.
201
+ [5] Andrew Brock, Theodore Lim, James Millar Ritchie, and Nicholas J Weston. Smash: One-shot model architecture search through hypernetworks. In International Conference on Learning Representations, 2018.
202
+ [6] Wuyang Chen, Xinyu Gong, and Zhangyang Wang. Neural architecture search on imagenet in four gpu hours: A theoretically inspired perspective. In International Conference on Learning Representations, 2021.
203
+ [7] Xiangxiang Chu, Bo Zhang, Ruijun Xu, and Jixiang Li. Fairnas: Rethinking evaluation fairness of weight sharing neural architecture search. arXiv preprint arXiv:1907.01845, 2019.
204
+ [8] Xuanyi Dong and Yi Yang. One-shot neural architecture search via self-evaluated template network. In Proceedings of the IEEE International Conference on Computer Vision, pages 3681–3690, 2019.
205
+ [9] Xuanyi Dong and Yi Yang. Nas-bench-201: Extending the scope of reproducible neural architecture search. In International Conference on Learning Representations, 2020.
206
+ [10] Thomas Elsken, Jan Hendrik Metzen, Frank Hutter, et al. Neural architecture search: A survey. The Journal of Machine Learning Research, 20(55):1–21, 2019.
207
+ [11] Golnaz Ghiasi, Tsung-Yi Lin, and Quoc V Le. Nas-fpn: Learning scalable feature pyramid architecture for object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 7036–7045, 2019.
208
+ [12] Ronghao Guo, Chen Lin, Chuming Li, Keyu Tian, Ming Sun, Lu Sheng, and Junjie Yan. Powering one-shot topological nas with stabilized share-parameter proxy. In Proceedings of the European Conference on Computer Vision, pages 625–641. Springer, 2020.
209
+ [13] Zichao Guo, Xiangyu Zhang, Haoyuan Mu, Wen Heng, Zechun Liu, Yichen Wei, and Jian Sun. Single path one-shot neural architecture search with uniform sampling. In Proceedings of the European Conference on Computer Vision, pages 544–560. Springer, 2020.
210
+ [14] Namhoon Lee, Thalaiyasingam Ajanthan, and Philip HS Torr. Snip: Single-shot network pruning based on connection sensitivity. arXiv preprint arXiv:1810.02340, 2018.
211
+ [15] Ming Lin, Pichao Wang, Zhenhong Sun, Hesen Chen, Xiuyu Sun, Qi Qian, Hao Li, and Rong Jin. Zen-nas: A zero-shot nas for high-performance deep image recognition. In Proceedings of the IEEE International Conference on Computer Vision, pages 347–356, 2021.
212
+ [16] Hanxiao Liu, Karen Simonyan, and Yiming Yang. Darts: Differentiable architecture search. arXiv preprint arXiv:1806.09055, 2018.
213
+ [17] Vasco Lopes, Saeid Alirezazadeh, and Luís A Alexandre. Epe-nas: Efficient performance estimation without training for neural architecture search. arXiv preprint arXiv:2102.08099, 2021.
214
+ [18] Renqian Luo, Tao Qin, and Enhong Chen. Balanced one-shot neural architecture optimization. arXiv preprint arXiv:1909.10815, 2019.
215
+ [19] Renqian Luo, Fei Tian, Tao Qin, Enhong Chen, and Tie-Yan Liu. Neural architecture optimization. In Advances in Neural Information Processing Systems, pages 7816–7827. 2018.
216
+ [20] Joseph Mellor, Jack Turner, Amos Storkey, and Elliot J. Crowley. Neural architecture search without training. arXiv preprint arXiv:2006.04647, 2021.
217
+ [21] Joseph Mellor, Jack Turner, Amos Storkey, and Elliot J. Crowley. Neural architecture search without training. In International Conference on Machine Learning, 2021.
218
+ [22] Michael C Mozer and Paul Smolensky. Skeletonization: A technique for trimming the fat from a network via relevance assessment. In Advances in Neural Information Processing Systems, pages 107–115, 1989.
219
+ [23] Niv Nayman, Asaf Noy, Tal Ridnik, Itamar Friedman, Rong Jin, and Lihi Zelnik. Xnas: Neural architecture search with expert advice. Advances in Neural Information Processing Systems, 32:1977–1987, 2019.
220
+ [24] Xuefei Ning, Changcheng Tang, Wenshuo Li, Songyi Yang, Tianchen Zhao, Niansong Zhang, Tianyi Lu, Shuang Liang, Huazhong Yang, and Yu Wang. aw_nas: A modularized and extensible nas framework. arXiv preprint arXiv:2012.10388, 2020.
221
+ [25] Xuefei Ning, Yin Zheng, Tianchen Zhao, Yu Wang, and Huazhong Yang. A generic graph-based neural architecture encoding scheme for predictor-based nas. In Proceedings of the European Conference on Computer Vision, 2020.
222
+ [26] Daniel S Park, Jaehoon Lee, Daiyi Peng, Yuan Cao, and Jascha Sohl-Dickstein. Towards nngp-guided neural architecture search. arXiv preprint arXiv:2011.06006, 2020.
223
+ [27] Hieu Pham, Melody Guan, Barret Zoph, Quoc Le, and Jeff Dean. Efficient neural architecture search via parameters sharing. In International Conference on Machine Learning, pages 4095–4104. PMLR, 2018.
224
+ [28] Aloïs Pourchot, Alexis Ducarouge, and Olivier Sigaud. To share or not to share: A comprehensive appraisal of weight-sharing. arXiv preprint arXiv:2002.04289, 2020.
225
+ [29] Ilija Radosavovic, Justin Johnson, Saining Xie, Wan-Yen Lo, and Piotr Dollár. On network design spaces for visual recognition. In Proceedings of the IEEE International Conference on Computer Vision, pages 1882–1890, 2019.
226
+ [30] Esteban Real, Alok Aggarwal, Yanping Huang, and Quoc V Le. Regularized evolution for image classifier architecture search. In Proceedings of the aaai conference on artificial intelligence, volume 33, pages 4780–4789, 2019.
227
+ [31] Binxin Ru, Clare Lyle, Lisa Schut, Miroslav Fil, Mark van der Wilk, and Yarin Gal. Speedy performance estimation for neural architecture search, 2021.
228
+ [32] Julien Siems, Lucas Zimmer, Arber Zela, Jovita Lukasik, Margret Keuper, and Frank Hutter. Nas-bench-301 and the case for surrogate benchmarks for neural architecture search. arXiv preprint arXiv:2008.09777, 2020.
229
+ [33] Hidenori Tanaka, Daniel Kunin, Daniel LK Yamins, and Surya Ganguli. Pruning neural networks without any data by iteratively conserving synaptic flow. arXiv preprint arXiv:2006.05467, 2020.
230
+ [34] Lucas Theis, Iryna Korshunova, Alykhan Tejani, and Ferenc Huszár. Faster gaze prediction with dense networks and fisher pruning. arXiv preprint arXiv:1801.05787, 2018.
231
+ [35] Jack Turner, Elliot J Crowley, Michael O’Boyle, Amos Storkey, and Gavin Gray. Blockswap: Fisher-guided block substitution for network compression on a budget. arXiv preprint arXiv:1906.04113, 2019.
232
+ [36] Chaoqi Wang, Guodong Zhang, and Roger Grosse. Picking winning tickets before training by preserving gradient flow. arXiv preprint arXiv:2002.07376, 2020.
233
+ [37] Colin White, Willie Neiswanger, Sam Nolen, and Yash Savani. A study on encodings for neural architecture search. Advances in Neural Information Processing Systems, 2020.
234
+ [38] Colin White, Arber Zela, Binxin Ru, Yang Liu, and Frank Hutter. How powerful are performance predictors in neural architecture search? arXiv preprint arXiv:2104.01177, 2021.
235
+ [39] Bichen Wu, Xiaoliang Dai, Peizhao Zhang, Yanghan Wang, Fei Sun, Yiming Wu, Yuandong Tian, Peter Vajda, Yangqing Jia, and Kurt Keutzer. Fbnet: Hardware-aware efficient convnet design via differentiable neural architecture search. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 10734–10742, 2019.
236
+ [40] Zhaohui Yang, Yunhe Wang, Xinghao Chen, Boxin Shi, Chao Xu, Chunjing Xu, Qi Tian, and Chang Xu. Cars: Continuous evolution for efficient neural architecture search. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1829–1838, 2020.
237
+ [41] Chris Ying, Aaron Klein, Eric Christiansen, Esteban Real, Kevin Murphy, and Frank Hutter. Nas-bench-101: Towards reproducible neural architecture search. In International Conference on Machine Learning, pages 7105–7114. PMLR, 2019.
238
+ [42] Kaicheng Yu, René Ranftl, and Mathieu Salzmann. How to train your super-net: An analysis of training heuristics in weight-sharing NAS. abs/2003.04276, 2020.
239
+ [43] Kaicheng Yu, Christian Sciuto, Martin Jaggi, Claudiu Musat, and Mathieu Salzmann. Evaluating the search phase of neural architecture search. In International Conference on Learning Representations, 2020.
240
+ [44] Arber Zela, Julien Siems, and Frank Hutter. Nas-bench-1shot1: Benchmarking and dissecting one-shot neural architecture search. In International Conference on Learning Representations, 2020.
241
+ [45] Chris Zhang, Mengye Ren, and Raquel Urtasun. Graph hypernetworks for neural architecture search. In International Conference on Learning Representations, 2019.
242
+ [46] Miao Zhang, Huiqi Li, Shirui Pan, Xiaojun Chang, and Steven Su. Overcoming multi-model forgetting in one-shot nas with diversity maximization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2020.
243
+ [47] Yuge Zhang, Zejun Lin, Junyang Jiang, Quanlu Zhang, Yujing Wang, Hui Xue, Chen Zhang, and Yaming Yang. Deeper insights into weight sharing in neural architecture search. arXiv preprint arXiv:2001.01431, 2020.
244
+ [48] Barret Zoph and Quoc V. Le. Neural architecture search with reinforcement learning. In International Conference on Learning Representations, 2017.
md/train/HfpNVDg3ExA/HfpNVDg3ExA.md ADDED
@@ -0,0 +1,366 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Probabilistic Transformer for Time Series Analysis
2
+
3
+ Binh Tang Department of Statistics and Data Science Cornell University Ithaca, NY 14850 bvt5@cornell.edu
4
+
5
+ David S. Matteson Department of Statistics and Data Science Cornell University Ithaca, NY 14850 matteson@cornell.edu
6
+
7
+ # Abstract
8
+
9
+ Generative modeling of multivariate time series has remained challenging partly due to the complex, non-deterministic dynamics across long-distance time steps. In this paper, we propose deep probabilistic methods that combine state-space models (SSMs) with transformer architectures. In contrast to previously proposed SSMs, our approaches use attention mechanism to model non-Markovian dynamics in the latent space and avoid recurrent neural networks entirely. We also extend our models to include several layers of stochastic variables organized in a hierarchy for further expressiveness. Compared to transformer models, ours are probabilistic, non-autoregressive, and capable of generating diverse long-term forecasts with accounted uncertainty. Extensive experiments show that our models consistently outperform competitive baselines on various tasks and datasets, including time series forecasting and human motion prediction.
10
+
11
+ # 1 Introduction
12
+
13
+ Generative modeling of multivariate time series is a challenging problem with wide-ranging applications in demand forecasting [15, 76], autonomous driving [2, 16], robotics [29, 67], and health care [20, 21, 59]. Despite remarkable progress in recent years, models that predict high-dimensional future observations from a few past examples have remained intractable, partly due to the complex, non-deterministic temporal dynamics across long-distance time steps. Given a sequence of human poses, for example, such models must internally figure out the involved dynamics of various body components across space and time while maintaining the inherent uncertainty of multiple plausible futures, even though only one such future is observed.
14
+
15
+ Among proposed probabilistic approaches, state space models (SSMs) provide a principled framework for learning and drawing inference from sequential inputs [27, 66]. While autoregressive models feed its predictions back into the dynamics model without any compressed representation of data, SSMs model stochastic transitions between abstract states using latent variables, allowing for efficient state-to-state sampling without the need to render high-dimensional observations. Gaussian linear dynamical systems (LDSs), one of the best known SSMs [92], for example, postulate linear state transitions and enjoy exact inference via the celebrated Kalman filter algorithm.
16
+
17
+ While early extensions of LDSs focus on linearization [46] and unscented transform [88], recent work that marry state space models with deep neural networks offers much more flexibility to model complex dependencies across different time steps. Some approaches retain the Markovian dynamics of LDSs and only replace their linear observation models with feed-forward networks [23, 31, 47, 71], whereas others favor nonlinear state transitions and parametrize such dependencies via recurrent neural networks (RNNs) [22, 23, 30, 39, 51, 75]. Despite differences, both Markovian transitions and RNNs are often not capable of capturing long-range dependencies in highly structured sequential inputs [36, 100], limiting the capacity of the corresponding SSMs.
18
+
19
+ ![](images/6209b8c1681d417ef10b0d5a80eb743603ec9c0900243de7593a7d1462ab034a.jpg)
20
+ Figure 1: Graphical model representations of linear dynamical systems (LDSs) in (a), and our proposed models (ProTran) in (b), (c), and (d). Black arrows denote the generative mechanism and red arrows the inference procedure. The separation of generation and inference in (c) and (d) is for readability. While traditional SSMs such as LDSs are limited to Markovian dynamics and linear dependencies, our models allow for non-Markovian and non-linear interactions between time steps via attention mechanism. A multi-layer extension of our models further increases expressiveness without compromising the tractable inference procedure.
21
+
22
+ In this work, we propose to combine the complementary strengths of SSMs and transformer architectures [85], a powerful mechanism for modeling long-term interactions that enjoys success across a variety of sequence modeling tasks [26, 48, 99]. In contrast to most SSMs, our models make extensive use of attention mechanism [5, 85] between latent variables to model non-Markovian dynamics (see Figure 1). Compared to transformer-based methods, our models are probabilistic, nonautoregressive in a similar fashion to LDSs, and capable of generating diverse long-term forecasts with uncertainty estimates.
23
+
24
+ Our main contributions are threefold. First, we propose novel SSMs based on transformer architectures for multivariate time series, which include generative models and inference procedures based on variational inference [49, 74]. Second, we extend our models to include several layers of stochastic latent variables organized in a hierarchy for further expressiveness. Third, we conduct extensive experiments on time series forecasting and human motion prediction and demonstrate that our Probabilistic Transformer (ProTran) performs remarkably well compared to various state-of-theart baselines.
25
+
26
+ # 2 Preliminaries
27
+
28
+ # 2.1 Variational State Space Models
29
+
30
+ Let $\{ \mathbf { x } _ { 1 : T _ { i } } ^ { ( i ) } \} _ { i = 1 } ^ { N }$ consist of $N$ univariate time series w ere $\mathbf { x } _ { 1 : T _ { i } } ^ { ( i ) } = ( \mathbf { x } _ { 1 } ^ { ( i ) } , \mathbf { x } _ { 2 } ^ { ( i ) } , \cdot \cdot \cdot \mathbf { x } _ { T _ { i } } ^ { ( i ) } )$ and $\mathbf { x } _ { t } ^ { ( i ) }$ denotes the vaue of the $i$ $t$ We consider the multivariate form $\mathbf { x } _ { 1 : T } = ( \mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } , \ldots , \mathbf { x } _ { T } )$ where $\mathbf { x } _ { t } = ( \mathbf { x } _ { t } ^ { ( 1 ) } , . . . \mathbf { x } _ { t } ^ { ( N ) } ) \in \mathbb { R } ^ { N }$ . Conditioning on observed values up to time $C$ , we aim to produce distributional forecasts into the future $p ( \mathbf { x } _ { C + 1 : T } \mid \mathbf { x } _ { 1 : C } )$ . For clarity, we refer to $\mathbf { x } _ { 1 : C }$ and $\mathbf { x } _ { C + 1 : T }$ as contexts and targets, respectively.
31
+
32
+ We are interested in probabilistic models parametrized by $\theta$ of the form
33
+
34
+ $$
35
+ p _ { \theta } ( \mathbf { x } _ { 1 : T } \mid \mathbf { x } _ { 1 : C } ) = \int p _ { \theta } ( \mathbf { x } _ { 1 : T } \mid \mathbf { z } _ { 1 : T } ) p _ { \theta } ( \mathbf { z } _ { 1 : T } \mid \mathbf { x } _ { 1 : C } ) d \mathbf { z } _ { 1 : T }
36
+ $$
37
+
38
+ where ${ \bf z } _ { 1 : T } = ( { \bf z } _ { 1 } , { \bf z } _ { 2 } , \ldots , { \bf z } _ { T } )$ denotes the corresponding sequence of latent variables, sometimes referred to as states. In other words, we assume a generative model that can be decomposed into a transition model $p _ { \theta } ( \mathbf { z } _ { 1 : T } \mid \mathbf { x } _ { 1 : C } )$ between the latent variables conditioned on the contexts, and an emission model $p _ { \theta } ( \mathbf { x } _ { 1 : T } \mid \mathbf { z } _ { 1 : T } )$ from the latent variables to observable outputs. In particular, we further impose several assumptions on both models: 1
39
+
40
+ $$
41
+ p _ { \theta } ( \mathbf { z } _ { 1 : T } \mid \mathbf { x } _ { 1 : C } ) = \prod _ { t = 1 } ^ { T } p _ { \theta } ( \mathbf { z } _ { t } \mid \mathbf { z } _ { 1 : t - 1 } , \mathbf { x } _ { 1 : C } ) , \qquad p _ { \theta } ( \mathbf { x } _ { 1 : T } \mid \mathbf { z } _ { 1 : T } ) = \prod _ { t = 1 } ^ { T } p _ { \theta } ( \mathbf { x } _ { t } \mid \mathbf { z } _ { t } ) .
42
+ $$
43
+
44
+ As demonstrated in Figure 1(b), the latent variable $\mathbf { z } _ { t + 1 }$ depends not only on $\mathbf { z } _ { t }$ but also on all of its preceding latent variables, including $\mathbf { z } _ { t - 1 }$ , in contrast to linear dynamical systems (LDSs). In addition, the transition and emission models allow for non-linearity via neural network parametrizations. These assumptions aim to maximize model capacity for real-world applications with complex emissions or temporal dependencies.
45
+
46
+ However, neither $\mathbf { x } _ { 1 : t - 1 }$ nor $\mathbf { z } _ { 1 : t - 1 }$ are included in the emission model $p ( \mathbf { x } _ { t } \mid \mathbf { z } _ { 1 : T } , \mathbf { x } _ { 1 : C } )$ . Such assumptions are important, as it has been argued previously that a leakage of information from the latent space in autoregressive models can hinder long-term predictions [23, 47]. While all ground truth observations are available during training, the entire sequence has to be generated sequentially at test time, making the dependencies on $\mathbf { x } _ { 1 : t - 1 }$ prone to accumulated errors over multiple time steps. By letting the latent variable $\mathbf { z } _ { t }$ capture all information needed to render $\mathbf { x } _ { t }$ , we also avoid the computational costs associated with repeatedly decoding and encoding $\mathbf { x } _ { t }$ in multi-step predictions.
47
+
48
+ The inclusion of nonlinear state transitions and observation models necessarily requires approximate inference. We follow the stochastic variational inference framework [49, 74] and assume that the variational posterior parametrized by $\phi$ can be decomposed auto-regressively as $q _ { \phi } ( { \bf z } _ { 1 : T } \mid { \bf x } _ { 1 : T } ) =$ $\begin{array} { r } { \prod _ { t } q _ { \phi } ( \mathbf { z } _ { t } \mid \dot { \mathbf { z } } _ { 1 : t - 1 } , \mathbf { x } _ { 1 : T } ) } \end{array}$ , which leads to a lower bound on the log likelihood:
49
+
50
+ $$
51
+ \log p _ { \theta } ( \mathbf { x } _ { 1 : T } | \mathbf { x } _ { 1 : C } ) \geq \sum _ { t = 1 } ^ { T } ( \mathbb { E } _ { q } \left[ \log p _ { \theta } ( \mathbf { x } _ { t } | \mathbf { z } _ { t } ) \right] - \mathsf { K L } ( q _ { \phi } ( \mathbf { z } _ { t } | \mathbf { z } _ { 1 : t - 1 } , \mathbf { x } _ { 1 : T } ) \parallel p _ { \theta } ( \mathbf { z } _ { t } | \mathbf { z } _ { 1 : t - 1 } , \mathbf { x } _ { 1 : C } ) ) ) ,
52
+ $$
53
+
54
+ where $\mathsf { K L }$ is the Kullback-Leibler divergence.
55
+
56
+ For computational stability, we assume homoscedasticity and choose Laplace distribution with scale parameter $\beta$ as a parametric form for $p _ { \theta } ( \mathbf { x } _ { t } \mid \mathbf { z } _ { t } )$ , i.e. we optimize for $L _ { 1 }$ reconstruction loss with a cross-validated factor $\beta$ for the KL term, following similar variational autoencoder (VAE) work [24, 41, 86]. Such an assumption does not necessarily limit the capacity of our models, as powerful stochastic transitions and flexible emission models can theoretically characterize arbitrary noise covariance [66]. Incorporating structured probabilistic outputs such as Gaussian copulas [75] or normalizing flows [23] can potentially further improve our model performance.
57
+
58
+ # 2.2 Transformer Architectures
59
+
60
+ Central to our models and other transformer-based approaches [48, 85] is the notion of attention [5], which allows the models to focus on important parts within a context. Multi-head attention, for example, maps a sequence of queries $\mathbf { Q } \doteq \mathbb { R } ^ { \ell _ { q } \times \dot { d } }$ of length $\ell _ { q }$ to a sequence of outputs ${ \bf O } =$ $[ \mathbf { O } _ { 1 } , \dots , \mathbf { O } _ { H } ] \in \mathbb { R } ^ { \ell _ { q } \times d }$ of the same size by attending over given $\ell _ { k }$ key-value pairs $\mathbf { K } \in \mathbb { R } ^ { \ell _ { k } \times d }$ , V ∈ R\`k×d:
61
+
62
+ $$
63
+ \mathbf { O } _ { h } = \mathsf { A t t e n t i o n } ( \mathbf { Q } _ { h } , \mathbf { K } _ { h } , \mathbf { V } _ { h } ) = \mathsf { S o f t m a x } \left( \frac { \mathbf { Q } _ { h } \mathbf { K } _ { h } ^ { \mathsf { T } } } { \sqrt { d } } \right) \mathbf { V } _ { h } ,
64
+ $$
65
+
66
+ where $\mathbf { Q } _ { h } = \mathbf { Q } \mathbf { W } _ { h } ^ { Q }$ , $\mathbf { K } _ { h } = \mathbf { K } \mathbf { W } _ { h } ^ { K }$ , $\mathbf { V } _ { h } = \mathbf { V } \mathbf { W } _ { h } ^ { V }$ are projected queries, keys, and values coro head , we re $h \in [ 1 , H ]$ with learning parameters n attention mechanism as s $\mathbf { W } _ { h } ^ { Q } , \mathbf { W } _ { h } ^ { K } , \mathbf { W } _ { h } ^ { V }$ , respectively. In case $\mathbf { Q } = \mathbf { K } = \mathbf { V }$
67
+
68
+ Given fully observed sequences of inputs, the mapping can be computed efficiently without any imposed sequential order often seen in recurrent neural networks [19, 42]. More importantly, the direct connections between long-distance time steps are baked into the mechanism as information from previous time steps is easily accessible without being compressed into a fixed representation, easing optimization and learning of long-term dependencies [5, 85].
69
+
70
+ Without recurrence, Transformer [85] encodes information about each time step $t$ with pred efined sinusoidal positional embeddings Position $( t ) = [ p _ { t } ( 1 ) , \ldots , p _ { t } ( d ) ] \in \mathbb { R } ^ { d }$ where the $i$ -th embedding is given by $p _ { t } ( i ) = \sin ( t \cdot c ^ { i / d } )$ for even $i$ and $p _ { t } ( i ) = \cos ( t \cdot c ^ { i / d } )$ for odd $i$ and $c$ is some large constant. Empirical results show that such positional embeddings are also important to our models.
71
+
72
+ # 3 Probabilistic Transformer
73
+
74
+ In this section, we first present our single-layered model and subsequently its multi-layered extension for a hierarchy of stochastic latent variables. As alluded earlier, our model consists of a generative model and an inference model that share information and parameters extensively.
75
+
76
+ # 3.1 Single-Layered Probabilistic Transformer
77
+
78
+ Generative Model. Given some contexts $\mathbf { x } _ { 1 : C }$ , we first apply a linear projection and combine it with a positional embedding to obtain $\mathbf { h } _ { 1 : C } \in \mathbb { R } ^ { d }$ , i.e.
79
+
80
+ $$
81
+ \mathbf { h } _ { t } = \mathsf { L a y e r N o r m } ( \mathsf { M L P } ( \mathbf { x } _ { t } ) + \mathsf { P o s i t i o n } ( t ) ) ,
82
+ $$
83
+
84
+ where LayerNorm and MLP denote layer normalizations [4] and multi-layer perceptrons, respectively. While a traditional transformer model often dedicates an entire encoder for the same purpose [55, 72], we find such a simple mapping works sufficiently well in conjunction with the contextattention module of the corresponding decoder.
85
+
86
+ As implied in Equation (2), our latent dynamics decomposes auto-regressively. At each time step, we parametri ze the distribution $p _ { \theta } ( \mathbf { z } _ { t } \mid \mathbf { z } _ { 1 : t - 1 } , \mathbf { x } _ { 1 : C } )$ by a Gaussian with parameters resulting from two sequential steps of attention: a self-attention over the previously inferred states $\mathbf { z } _ { 1 : t - 1 }$ and another attention over the projected contexts $\mathbf { h } _ { 1 : C }$ . These two operations mirror those found in the decoder of Transformer [85], with the stochastic latent variables replacing its decoder inputs.
87
+
88
+ Unfortunately, using stochastic samples of $\mathbf { z } _ { t }$ as attention queries is problematic, as purely stochastic transitions make it difficult for the model to reliably retain information across multiple time steps [17, 30, 39]. We therefore encapsulate the latent variables in hidden representations $\mathbf { w } _ { t }$ that also has a deterministic component. Combined with the attention steps, such representations help model long-range temporal dependencies while accounting for the stochasticity of future observations.
89
+
90
+ Starting with a learnable, context-agnostic representation $\mathbf { w } _ { 0 }$ , we recursively update $\mathbf { w } _ { t }$ using a stochastic sample from $p _ { \theta } ( \mathbf { z } _ { t } \mid \mathbf { z } _ { 1 : t - 1 } , \mathbf { x } _ { 1 : C } )$ and th e positional embedding for the current time step $t$ . The generating process for the time step $t$ can be summarized by the following pseudocode:
91
+
92
+ $$
93
+ \begin{array} { r l } & { \bar { { \bf w } } _ { t } = \mathsf { L a y e r N o r m } \big ( { \bf w } _ { t - 1 } + \mathsf { A t t e n t i o n } \big ( { \bf w } _ { t - 1 } , { \bf w } _ { 1 : t - 1 } , { \bf w } _ { 1 : t - 1 } \big ) \big ) } \\ & { \hat { \bf w } _ { t } = \mathsf { L a y e r N o r m } \big ( \bar { \bf w } _ { t } + \mathsf { A t t e n t i o n } \big ( \bar { \bf w } _ { t } , { \bf h } _ { 1 : C } , { \bf h } _ { 1 : C } \big ) \big ) } \\ & { { \bf z } _ { t } = \mathsf { S a m p l e } \big ( \mathcal { N } \big ( { \bf z } _ { t } ; \mathsf { M L P } ( \hat { \bf w } _ { t } ) , \mathsf { S o f t p l u s } ( \mathsf { M L P } ( \hat { \bf w } _ { t } ) \big ) \big ) \big ) } \\ & { { \bf w } _ { t } = \mathsf { L a y e r N o r m } \big ( \hat { \bf w } _ { t } + \mathsf { M L P } ( { \bf z } _ { t } ) + \mathsf { P o s i t i o n } ( t ) \big ) , } \end{array}
94
+ $$
95
+
96
+ where Sample and Softplus are the Gaussian sampling and approximating rectifier operators.
97
+
98
+ Each stochastic sample of $\mathbf { w } _ { 1 : T }$ is then mapped to a sequence of $\mathbf { x } _ { \mathrm { 1 : } T }$ via a multi-layer perceptron. We emphasize that our generation procedure in the latent space is more efficient than others in the observation space, which requires encoding and decoding high-dimensional inputs repeatedly.
99
+
100
+ Inference Model. We parametrize the approximate posterior $q _ { \phi } ( \mathbf { z } _ { t } \mid \mathbf { z } _ { 1 : t - 1 } , \mathbf { x } _ { 1 : T } )$ at time step $t$ in a simi lar fashion to the prior $p _ { \theta } ( \mathbf { z } _ { t } \mid \mathbf { z } _ { 1 : t - 1 } , \mathbf { x } _ { 1 : C } )$ . Indeed, these parametrizations share most parameters and are done simultaneously in the same recursive loop, following the exact same steps in Equation (6) and Equation (7) (see Figure 1). We note that similar sharing techniques between the generative and inference processes have emerged as a common theme among recent successful VAE models [17, 62, 83].
101
+
102
+ While the prior only has access to the conditioning observations $\mathbf { x } _ { 1 : C }$ , the approximate posterior should take into account all observations during training, including the targets $x _ { C + 1 : T }$ . Due to the inherent unidirectional aspect of RNNs, previous work that uses RNNs to parametrize the approximate posterior often disregards such a property [22, 30, 51] and often resorts to a filtering routine $p ( \mathbf { z } _ { t } \mid \mathbf { z } _ { 1 : t - 1 } , \mathbf { x } _ { 1 : t } )$ . In contrast, our inference procedure resembles more of the smoothing process of LDSs, factoring in both past and future observations via another application of self-attention:
103
+
104
+ $$
105
+ \begin{array} { r l } & { { \bf k } _ { t } = \mathrm { A t t e n t i o n } ( { \bf h } _ { 1 : T } , { \bf h } _ { 1 : T } , { \bf h } _ { 1 : T } ) ) } \\ & { { \bf z } _ { t } = \mathsf { S a m p l e } ( \mathcal { N } ( { \bf z } _ { t } ; { \sf M L P } ( [ \hat { \bf w } _ { t } , { \bf k } _ { t } ] ) , \mathsf { S o f t p l u s } ( { \sf M L P } ( [ \hat { \bf w } _ { t } , { \bf k } _ { t } ] ) ) ) . } \end{array}
106
+ $$
107
+
108
+ Here, we replace Equation (8) in the generative model with Equation (11), where the hidden representation $\mathbf { k } _ { t }$ summarizing all information relevant to the current tim estep $t$ has been concatenate to the latent-and-context-aware representation $\hat { \mathbf { w } } _ { t }$ preceding the Gaussian parametrization.
109
+
110
+ The generative model and the inference model are trained end-to-end with a single stochastic variational inference objective stated in Equation (3). Such a variational bound includes the reconstruction loss for $\mathbf { X } _ { 1 : C }$ and the $\mathsf { K L }$ term for $\mathbf { z } _ { 1 : C }$ . Alternatively, we can exclude these terms from the objective, which is equivalent to starting the inference process from $t = C + 1$ instead of $t = 1$ .
111
+
112
+ Our models incur a time complexity of $\mathcal { O } ( T ^ { 2 } d )$ and a memory cost of $\mathcal { O } ( T ^ { 2 } d )$ , where $T$ is the total sequence length and $d$ is the dimensionality of the latent space. The recursive latent dynamics also does not allow use the take full advantange of parallelizable attentions. However, we find that our models are still efficient in practice, especially for reasonably small values of $T$ .
113
+
114
+ # 3.2 Multi-Layered Extension for Probabilistic Transformer
115
+
116
+ Inspired by recent work on hierarchical VAEs for non-sequential inputs [17, 80, 83, 101], we extend our proposed model to include several layers of latent variables, aiming to further increase its flexibility for modelling sequential data.
117
+
118
+ We represent each time step $t$ with a Ma rkov chain of $L$ latent variables $\mathbf { z } _ { t } ^ { ( 1 : L ) } = ( \mathbf { z } _ { t } ^ { ( 1 ) } , \ldots , \mathbf { z } _ { t } ^ { ( L ) } )$ for simplicity (see Figure 1). The generative and inference model also decompose auto-regressively across different time steps and may exhibit non-Markovian dynamics:
119
+
120
+ $$
121
+ \begin{array} { l } { { \displaystyle p _ { \theta } \left( { \bf x } _ { 1 : T } , { \bf z } _ { 1 : T } ^ { ( 1 : L ) } | { \bf x } _ { 1 : C } \right) = \left( \prod _ { \ell = 1 } ^ { T } p _ { \theta } \left( { \bf x } _ { t } | { \bf z } _ { t } ^ { ( L ) } \right) \right) \left( \prod _ { \ell = 1 } ^ { L } \prod _ { \ell = 1 } ^ { T } p _ { \theta } \left( { \bf z } _ { t } ^ { ( \ell ) } | { \bf z } _ { 1 : t - 1 } ^ { ( \ell ) } , { \bf z } _ { 1 : T } ^ { ( \ell - 1 ) } , { \bf x } _ { 1 : C } \right) \right) } } \\ { { \displaystyle q _ { \phi } \left( { \bf z } _ { 1 : T } ^ { ( 1 : L ) } | { \bf x } _ { 1 : T } \right) = \prod _ { \ell = 1 } ^ { L } \prod _ { \ell = 1 } ^ { T } q _ { \phi } \left( { \bf z } _ { t } ^ { ( \ell ) } | { \bf z } _ { 1 : t - 1 } ^ { ( \ell ) } , { \bf z } _ { 1 : T } ^ { ( \ell - 1 ) } , { \bf x } _ { 1 : T } \right) . } } \end{array}
122
+ $$
123
+
124
+ Intuitively, we generate samples $\mathbf { x } _ { 1 : T }$ conditioning on $\mathbf { x } _ { 1 : C }$ by following the latent dynamics from the bottom up and using the generative process described earlier within each layer. Analogously, inference proceeds in the same order, resulting in a variational bound similar to Equation (3):
125
+
126
+ $$
127
+ \begin{array} { l } { { \displaystyle \log p _ { \theta } \big ( { \bf x } _ { 1 : T } \mid { \bf x } _ { 1 : C } \big ) \geq \sum _ { t = 1 } ^ { T } \mathbb { E } _ { q } \left[ \log p _ { \theta } \big ( { \bf x } _ { t } ^ { ( L ) } \mid { \bf z } _ { t } \big ) \right] } \ ~ } \\ { { \displaystyle ~ - \sum _ { \ell = 1 } ^ { L } \mathsf { K L } \big ( q _ { \phi } \big ( { \bf z } _ { t } ^ { ( \ell ) } \mid { \bf z } _ { 1 : t - 1 } ^ { ( \ell ) } , { \bf z } _ { 1 : T } ^ { ( \ell ) } , { \bf x } _ { 1 : T } \big ) \ \big \| \ p _ { \theta } \big ( { \bf z } _ { t } ^ { ( \ell ) } \mid { \bf z } _ { 1 : t - 1 } ^ { ( \ell ) } , { \bf z } _ { 1 : T } ^ { ( \ell ) } , { \bf x } _ { 1 : C } \big ) \big ) } . } \end{array}
128
+ $$
129
+
130
+ As before, we parametrize the prior ) | z(\`)1:t−1, z(\`)1:T , x1:C ) using self-attention over the inferred(\`) latent variables from previous time steps w t−1 o n the same layer and another attention over contexts $\mathbf { h } _ { 1 : C }$ . In this case, however, we include an additional self-attention over all latent variables from the layer immediately below it (see Equation (16)):
131
+
132
+ $$
133
+ \begin{array} { r l } & { \tilde { \mathbf { w } } _ { t } ^ { ( \ell ) } = \mathsf { L a y e r N o r m } ( \mathbf { w } _ { t - 1 } ^ { ( \ell ) } + \mathsf { A t t e n t i o n } ( \mathbf { w } _ { t - 1 } ^ { ( \ell ) } , \mathbf { w } _ { 1 : T } ^ { ( \ell - 1 ) } , \mathbf { w } _ { 1 : T } ^ { ( \ell - 1 ) } ) ) } \\ & { \bar { \mathbf { w } } _ { t } ^ { ( \ell ) } = \mathsf { L a y e r N o r m } ( \tilde { \mathbf { w } } _ { t } ^ { ( \ell ) } + \mathsf { A t t e n t i o n } ( \tilde { \mathbf { w } } _ { t } ^ { ( \ell ) } , \mathbf { w } _ { 1 : t - 1 } ^ { ( \ell ) } , \mathbf { w } _ { 1 : t - 1 } ^ { ( \ell ) } ) ) } \\ & { \hat { \mathbf { w } } _ { t } ^ { ( \ell ) } = \mathsf { L a y e r N o r m } ( \bar { \mathbf { w } } _ { t } ^ { ( \ell ) } + \mathsf { A t t e n t i o n } ( \bar { \mathbf { w } } _ { t } ^ { ( \ell ) } , \mathbf { h } _ { 1 : C } , \mathbf { h } _ { 1 : C } ) ) } \\ & { \mathbf { z } _ { t } ^ { ( \ell ) } = \mathsf { S a m p l e } ( \mathcal { N } ( \mathbf { z } _ { t } ^ { ( \ell ) } ; \mathsf { M L P } ( \hat { \mathbf { w } } _ { t } ^ { ( \ell ) } ) , \mathbf { S o f t p l u s } ( \mathsf { M L P } ( \hat { \mathbf { w } } _ { t } ^ { ( \ell ) } ) ) ) ) } \\ & { \mathbf { w } _ { t } ^ { ( \ell ) } = \mathsf { L a y e r N o r m } ( \hat { \mathbf { w } } _ { t } ^ { ( \ell ) } + \mathsf { M L P } ( \mathbf { z } _ { t } ^ { ( \ell ) } ) + \mathsf { P o s i t i o n } ( t ) ) , } \end{array}
134
+ $$
135
+
136
+ Stacking multiple layers of latent variables increases model expressiveness, but it also result in a linear increase in running time and the number of parameters. The time complexity for the $L$ - layers transformer is $\mathcal { O } ( \bar { L _ { 1 } } T ^ { 2 } d )$ , while the space complexity remains $\mathcal { D } ( T ^ { 2 } d )$ due to the Markovian structure of the chain $\mathbf { z } _ { t } ^ { ( 1 : L ) }$ at each time step $t$ . In our experiments, we restrict the number of layers of our hierachical models to two or three.
137
+
138
+ # 4 Related Work
139
+
140
+ Deep State Space Models. Deep neural networks have been extensively combined with state space models, resulting in flexible, yet principledly motivated latent variable approaches. While some work keep the linear state transition intact to leverage the efficient Kalman filer algorithms [23, 31, 47, 71], more expressive, nonlinear latent dynamics parametrized by neural networks have been proposed [51, 52]. All such models are limited to the Markovian dynamics of LDSs, which hinders learning of long-range dependencies. The limitation is often alleviated by combining the stochastic transitions with a deterministic RNN that enables access to all past states [3, 8, 22, 30, 39, 77]. Our models are similarly non-Markovian, but the dependencies on the past states are done via attention, which allows for easy connections between long-distance time steps. In addition, while most existing deep SSMs represent each time step with a single latent variable, our models include several layers of hierarchical latent variables with tractable inference mechanism.
141
+
142
+ Attentive Recurrent Networks. Attention mechanism has also been widely adopted in recent time series work using sequence-to-sequence models [1, 28] or transformer architectures [14, 55, 57, 72, 81, 94]. While our models are equipped with latent variables, these transformer approaches [55, 72] lack inference mechanism and are susceptible to feeding back observation noise into the dynamics model at test time. Our work, however, can be considered as an extension of the attentive state space model proposed in [1], with discrete latent states replaced by their continuous analogs. Recent developments in natural language processing [58, 60, 90] also combine transformer and VAE; however, these approaches often use a time-agnostic latent variable, in contrast to our SSM formulation.
143
+
144
+ Time Series Forecasting. Traditional univariate time series models, such as Box-Jenkins methods [12] and exponential smoothing [43], often assume independence between any collection of time series [76]. While multivariate extensions of the classical approaches, including vector autoregression [82] and multivariate GARCH [7], do not require such a strong assumption, they come with many others such as stationarity and homocesdasticity, demand manual selection of covariates and models, and do not scale well to even a moderate number of time series [40, 69].
145
+
146
+ Deep learning methods for time series forecasting have recently emerged as an expressive, scalable framework for industrial applications [10, 68, 79, 91]. While early work focus on point forecasts [53, 70, 96], recent approaches often employ recurrent neural networks with probabilistic forecasts parametrized directly [76], using quantile functions [33], Gaussian copulas [75], normalizing flows [23], or diffusion models [73]. In contrast, our models are entirely devoid of such recurrent architectures and rely on latent variables to output distributional forecasts.
147
+
148
+ Human Motion Prediction. Despite being almost identical in formulation, human motion prediction has often been studied independently from time series forecasting. While some work deterministically generate future motions or video frames [13, 32, 34, 56], stochastic prediction has also been proposed with deep neural networks often outperforming traditional methods such as hidden Markov models [93] or Gaussian processes [89] on complex motion datasets [13, 32, 45, 54, 63]. In contrast to earlier work [95, 97] that employ a global latent variable across different time steps via conditional VAE [49], we leverage the principled framework of state space models for learning and inference of hierarchical, time-dependent latent variables.
149
+
150
+ # 5 Experiments
151
+
152
+ We present our experiment results on two tasks, namely, time series forecasting and human motion prediction. These tasks are often studied independently, despite being almost identical as conditional prediction problems.
153
+
154
+ Table 1: Test set ${ \mathsf { C R P S } } _ { \mathsf { s u m } }$ of time series forecasting models (lower is better). The means and standard deviations are computed over five runs using different random seeds.
155
+
156
+ <table><tr><td>DATASET</td><td>SOLAR</td><td>ELECTRICITY</td><td>TRAFFIC</td><td>TAXI</td><td>WIKIPEDIA</td></tr><tr><td>VES [43]</td><td>0.900 ± 0.003</td><td>0.880 ± 0.004</td><td>0.350 ± 0.002</td><td></td><td></td></tr><tr><td>VAR [61]</td><td>0.830 ± 0.006</td><td>0.039 ± 0.001</td><td>0.290 ± 0.001</td><td></td><td></td></tr><tr><td>VAR-Lasso [61]</td><td>0.510 ± 0.006</td><td>0.025 ± 0.000</td><td>0.150 ± 0.002</td><td></td><td>3.100 ± 0.004</td></tr><tr><td>GARCH [84]</td><td>0.880 ± 0.002</td><td>0.190 ± 0.001</td><td>0.370 ± 0.001</td><td></td><td></td></tr><tr><td>DeepAR [76]</td><td>0.336 ± 0.014</td><td>0.023 ± 0.001</td><td>0.055 ± 0.003</td><td></td><td>0.127 ± 0.042</td></tr><tr><td>LSTM-Copula [75]</td><td>0.319 ± 0.011</td><td>0.064 ± 0.008</td><td>0.103 ± 0.006</td><td>0.326 ± 0.007</td><td>0.241± 0.003</td></tr><tr><td>GP-Copula [75]</td><td>0.337 ± 0.024</td><td>0.024 ± 0.002</td><td>0.078 ± 0.002</td><td>0.208 ± 0.183</td><td>0.086 ± 0.004</td></tr><tr><td>KVAE [51]</td><td>0.340 ± 0.025</td><td>0.051 ± 0.019</td><td>0.100 ± 0.005</td><td></td><td>0.095 ± 0.012</td></tr><tr><td>NKF [23]</td><td>0.320 ± 0.020</td><td>0.016 ± 0.001</td><td>0.100 ± 0.002</td><td></td><td>0.071 ± 0.002</td></tr><tr><td>Transformer-MAF[72]</td><td>0.301 ± 0.014</td><td>0.021 ± 0.000</td><td>0.056 ± 0.001</td><td>0.179 ± 0.002</td><td>0.063 ± 0.003</td></tr><tr><td>TimeGrad[73]</td><td>0.287 ± 0.020</td><td>0.021 ± 0.001</td><td>0.044 ± 0.006</td><td>0.114 ± 0.020</td><td>0.049 ± 0.002</td></tr><tr><td>ProTran (Ours)</td><td>0.194 ± 0.030</td><td>0.016 ± 0.001</td><td>0.028 ± 0.001</td><td>0.084 ± 0.003</td><td>0.047 ± 0.004</td></tr></table>
157
+
158
+ # 5.1 Time-series Forecasting
159
+
160
+ Datasets & Covariates. Following the experiment setup in [72, 73, 75], we evaluate our models and multiple competitive baselines on five popular public datasets: SOLAR, ELECTRICITY, TRAFFIC, TAXI, and WIKIPEDIA. The data is recorded with hourly or daily frequency and shows seasonal patterns of different frequencies (see Appendix A for more dataset details). As in [72, 73], the covariates include lagged inputs, fixed time embeddings (e.g. day of week, hour of day), and learnable time-series embeddings. The inputs are scaled using the conditioning examples before being fed into the model, and the predictions are rescaled appropriately afterward.
161
+
162
+ Metrics. Following [23, 72, 75], we evaluate our model and all baselines using continuous ranked probability score (CRPS) [65] summed across time series, denoted by ${ \mathsf { C R P S } } _ { \mathsf { s u m } }$ . Given a univariate distribution function $F$ and an observation $x$ , CRPS is defined as
163
+
164
+ $$
165
+ { \mathsf { C R P S } } ( F , x ) = \int _ { \mathbb { R } } ( F ( z ) - \mathbb { 1 } _ { \{ x \leq z \} } ) ^ { 2 } d z ,
166
+ $$
167
+
168
+ where $1 _ { \{ x \leq z \} }$ is the indicator function. As argued in de Bezenac et al. [ ´ 23], ${ \mathsf { C R P S } } _ { \mathsf { s u m } }$ is a proper scoring rule [35] and can be computed without analytical forecast distributions. We compute the metrics in a rolling fashion and use 100 samples for the distributional forecasts, similar to the aforementioned work.
169
+
170
+ Baselines. We benchmark our models against various baselines, including (1) VES [43], an innovation state space model; (2) VAR-Lasso and VAR [61], two multivariate linear autoregressive models with and without Lasso regularization; (3) GARCH [84], a multivariate conditional heteroskedastic model; (4) DeepAR [76], an autoregressive recurrent neural network; LSTM-Copula and GP-Copula [75], two RNN-based models that use Gaussian copula to model nonlinearity; (5) KVAE [51], a variational approach based on linear dynamics; (6) NKF [23], a normalizing-flow model coupled with Kalman filters; (7) Transformer [72], a transformer-based model based on masked autoregressive flow; and (8) TimeGrad [73], a recent autoregressive approach that uses a diffusion model.
171
+
172
+ Implementations. We use 8-head attentions and 2-layers MLPs to parametrize the generative and inference models. The stochastic latent variables $\mathbf { z } _ { t }$ are 16-dimensional while the hidden representations $\mathbf { w } _ { t }$ are in $\mathbb { R } ^ { 1 2 8 }$ . Our probabilistic transformers for SOLAR and ELECTRICITY have one stochastic layer while those for the other datasets of higher dimensional observations employ two layers. We re
173
+
174
+ Table 2: Ablation study on TRAFFIC.
175
+
176
+ <table><tr><td>Two Layers One Layer Context Attention</td><td>√ × √</td><td>× √</td><td>× ×</td><td>× √</td></tr><tr><td>Deterministic</td><td>×</td><td>×</td><td>×</td><td>√</td></tr><tr><td>CRPSsum</td><td>0.028</td><td>0.031</td><td>0.033</td><td>0.041</td></tr></table>
177
+
178
+ port the numbers of parameters of our models in Table 4 in Appendix C, which are all comparable to those of the state-of-the-art approaches. See Appendix D for more details about hyper-parameters and training processes.
179
+
180
+ ![](images/2c04e02911790d4e50312ce21468be872c3332091a686e454ec6bd62c82ad8ba.jpg)
181
+ Figure 2: Prediction intervals and test set ground-truth from ProTran (our model) for the TRAFFIC dataset of the first 16 of 963 time series.
182
+
183
+ Accuracy Comparison. Table 1 shows that our models perform competitively across all five highdimensional time series datasets, achieving ${ \mathsf { C R P S } } _ { \mathsf { s u m } }$ comparable to the best methods on ELECTRICITY and WIKIPEDIA while outperforming all baselines, including a non-SSM transformer-based approach [72], by significant margins on SOLAR, TRAFFIC and TAXI. Further analyses with other metrics, including CRPS and MSE, in Appendix B also help confirm our findings.
184
+
185
+ Qualitative Results. Figure 2 shows that the distribution forecasts generated by our model follow closely the ground truths, which is consistent with our accuracy results. In addition, the model appears to capture the uncertainty of future forecasts to some extent; observations of large magnitudes and far into the future seem to correctly have higher variance estimates.
186
+
187
+ Ablation Study. We include a small scale ablation study on the TRAFFIC dataset to investigate which components of our models are essential. Table 2 suggests that removing the stochasticity from $\mathbf { w } _ { t }$ has most impacts on model performance, implying that incorprating latent variables into a transformer is indeed useful. Other aspects such as context attention or multiple layers of stochastic variables do not show dramatic effects in this study; however, they do contribute performance gains.
188
+
189
+ # 5.2 Human Motion Prediction
190
+
191
+ Datasets. Following the experiment setup in [97], we evaluation our models on two public motion capture datasets: Human3.6M[44] and HumanEva-I [78]. While Human3.6 is a large-scale dataset with 3.6 million video frames recorded at $5 0 \mathrm { H z }$ , HumanEva-I is smaller with only 3 subjects and recorded at $6 0 \mathrm { H z }$ . We follow the preprocessing steps of previous work [64, 97] and obtain a 17-joint skeleton for Human3.6 and a 15-joint skeleton for HumanEva-I. As in [97], we predict future motion for 2 seconds conditioning on observed motion of 0.5 seconds and 1 second conditioning on 0.25 seconds for Human3.6 and HumanEva-I, respectively.
192
+
193
+ ![](images/d9383da574a0f2a8ae5ae9ead64786b43baceb750e09f80f4d1df9b51d63a693.jpg)
194
+ Figure 3: Ground-truth pose sequences (first row) and corresponding predictions by ProTran (second row). Solid colors indicate later time-steps and faded ones are older. The body-part movements in the predicted and ground-truth poses resemble similar patterns, while certain variations are retained.
195
+
196
+ Table 3: Human motion prediction results.
197
+
198
+ <table><tr><td>DATASET</td><td colspan="2">HUMAN3.6M</td><td colspan="2">HUMANEVA-I</td></tr><tr><td>Method</td><td>ADE↓</td><td>FDE↓ ADE↓</td><td></td><td rowspan="3">FDE↓</td></tr><tr><td>ERD [32]</td><td>0.722</td><td>0.969 0.382</td><td>0.461</td></tr><tr><td>acLSTM[56]</td><td>0.789 1.126</td><td></td><td>0.429 0.541</td></tr><tr><td>MT-VAE [95]</td><td>0.457</td><td>0.595</td><td>0.345</td><td rowspan="4">0.403</td></tr><tr><td>Pose-Knows [87]</td><td>0.461</td><td>0.560</td><td>0.269 0.296</td></tr><tr><td>HP-GAN [6]</td><td>0.858</td><td>0.867</td><td>0.772 0.749</td></tr><tr><td>Best-Many [11]</td><td>0.448</td><td>0.533 0.271</td><td>0.279</td></tr><tr><td>GMVAE [25]</td><td>0.461</td><td>0.555</td><td>0.305</td><td>0.345</td></tr><tr><td>DeliGAN[38]</td><td>0.483</td><td>0.534</td><td>0.306</td><td>0.322</td></tr><tr><td>DSP [98]</td><td>0.493</td><td>0.592</td><td>0.273</td><td>0.290</td></tr><tr><td>DLow [97]</td><td>0.425</td><td>0.518</td><td>0.251</td><td>0.268</td></tr><tr><td>ProTran (Ours)</td><td>0.381</td><td>0.491</td><td>0.258</td><td>0.255</td></tr></table>
199
+
200
+ Metrics. Following previous work on trajectory forecasting [2, 37], we adopt two popular metrics, namely, average displacement error (ADE) and final displacement error (FDE). ADE measures the average $L _ { 2 }$ distance over all time steps between the ground truth motion and the closest sample, while FDE only consider such distance for the final pose.
201
+
202
+ Baselines. We compare our models against 9 models, including ERD [32] and acLSTM [56], two deterministic RNN-based approaches; MT-VAE [95] and Pose-Knows [87], two conditional VAE models; HP-GAN [6], a conditional GAN; Best-Many [11], GMVAE [25], DeliGAN [38]. and DSP [98], four approaches optimizing for diversity objectives. The results for these baselines are reported as in [97].
203
+
204
+ Implementations. Similar to the previous experiments, we use 8-head attentions and 2-layers MLPs. Since Human3.6M is significantly more complex and multi-modal than the time series forecasting datasets, we make use of 3 stochastic layers, as opposed to 2 layers for HumanEva-I. For Human3.6M, the context and target observations are significantly longer and set up for long-term predictions, so we only infer latent variables for target observations. Appendix C also contains further details about our models and their number of parameters.
205
+
206
+ Quantitative Results. Table 3 shows that our models convincingly outperform all baselines based on both metrics ADE and FDE, with the gains significantly higher for the larger dataset Human3.6M. We emphasize that our favorable performance is evaluated using random samples, while the closest competitor, DLow [97], relies on a separate model for selecting samples to promote diversity, which can potentially be combined with our probabilistic transformer for further improvements.
207
+
208
+ Qualitative Results. We show in Figure 3 human pose predictions made by our model that are most similar to the corresponding ground truths among a collection of such stochastic predictions. The similarities between the body-part movements in both sequences suggest that our model has been able to capture the temporal dynamics quite well.
209
+
210
+ # 6 Conclusion & Discussion
211
+
212
+ In this work, we have introduced generative models for multivariate time series that combines strengths of state space models and transformer architectures. In contrast to previous work, our models do not rely on recurrent neural networks but make extensive use of attention mechanism. We also extend our models to include hierarchical latent variables, inspired by recent developments of VAEs for non-sequential data [17, 83]. Empirical experiments show that our models perform remarkably well on time series forecasting and human motion prediction.
213
+
214
+ Our models do not come without limitations, however. As in other transformer-based approaches, the reliance on attention incurs a quadratic time and memory complexity. While we do not find it problematic in our experiments, the limitation necessarily hinders applications of our models in tasks characterized by long-term dependencies such as language modelling or music generation [36]. Fortunately, recent work on sparse transformer [9, 18, 50, 55] can potentially address the issue, and we leave such an investigation for future work.
215
+
216
+ Probabilistic time series forecasting is a fundamental research problem with wide-ranging applications in society. Although we have not explored healthcare applications of our work, previously proposed methods with similar formulations have demonstrated potentials of forecasting techniques [1, 81] in diagnoses or disease control.
217
+
218
+ # 7 Acknowledgment
219
+
220
+ Financial support is gratefully acknowledged from a Xerox PARC Faculty Research Award, National Science Foundation Awards 1455172, 1934985, 1940124, and 1940276, USAID, and Cornell University Atkinson Center for a Sustainable Future.
221
+
222
+ References
223
+ [1] Ahmed Alaa and Mihaela van der Schaar. Attentive state-space modeling of disease progression. 2019.
224
+ [2] Alexandre Alahi, Kratarth Goel, Vignesh Ramanathan, Alexandre Robicquet, Li Fei-Fei, and Silvio Savarese. Social lstm: Human trajectory prediction in crowded spaces. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 961–971, 2016.
225
+ [3] Evan Archer, Il Memming Park, Lars Buesing, John Cunningham, and Liam Paninski. Black box variational inference for state space models. arXiv preprint arXiv:1511.07367, 2015.
226
+ [4] Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
227
+ [5] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014. [6] Emad Barsoum, John Kender, and Zicheng Liu. Hp-gan: Probabilistic 3d human motion prediction via gan. In Proceedings of the IEEE conference on computer vision and pattern recognition workshops, pages 1418–1427, 2018. [7] Luc Bauwens, Sebastien Laurent, and Jeroen VK Rombouts. Multivariate garch models: a ´ survey. Journal of applied econometrics, 21(1):79–109, 2006. [8] Justin Bayer and Christian Osendorfer. Learning stochastic recurrent networks. In NIPS 2014 Workshop on Advances in Variational Inference, 2014.
228
+ [9] Iz Beltagy, Matthew E Peters, and Arman Cohan. Longformer: The long-document transformer. arXiv preprint arXiv:2004.05150, 2020.
229
+ [10] Konstantinos Benidis, Syama Sundar Rangapuram, Valentin Flunkert, Bernie Wang, Danielle Maddix, Caner Turkmen, Jan Gasthaus, Michael Bohlke-Schneider, David Salinas, Lorenzo Stella, et al. Neural forecasting: Introduction and literature overview. arXiv preprint arXiv:2004.10240, 2020.
230
+ [11] Apratim Bhattacharyya, Bernt Schiele, and Mario Fritz. Accurate and diverse sampling of sequences based on a “best of many” sample objective. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 8485–8493, 2018.
231
+ [12] George EP Box, Gwilym M Jenkins, Gregory C Reinsel, and Greta M Ljung. Time series analysis: forecasting and control. John Wiley & Sons, 2015.
232
+ [13] Judith Butepage, Michael J Black, Danica Kragic, and Hedvig Kjellstrom. Deep representation learning for human motion prediction and classification. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 6158–6166, 2017.
233
+ [14] Defu Cao, Yujing Wang, Juanyong Duan, Ce Zhang, Xia Zhu, Conguri Huang, Yunhai Tong, Bixiong Xu, Jing Bai, Jie Tong, et al. Spectral temporal graph neural network for multivariate time-series forecasting. arXiv preprint arXiv:2103.07719, 2021.
234
+ [15] Real Carbonneau, Kevin Laframboise, and Rustam Vahidov. Application of machine learning techniques for supply chain demand forecasting. European Journal of Operational Research, 184(3):1140–1154, 2008.
235
+ [16] Ming-Fang Chang, John Lambert, Patsorn Sangkloy, Jagjeet Singh, Slawomir Bak, Andrew Hartnett, De Wang, Peter Carr, Simon Lucey, Deva Ramanan, et al. Argoverse: 3d tracking and forecasting with rich maps. In 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 8740–8749. IEEE Computer Society, 2019.
236
+ [17] Rewon Child. Very deep vaes generalize autoregressive models and can outperform them on images. arXiv preprint arXiv:2011.10650, 2020.
237
+ [18] Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509, 2019.
238
+ [19] Kyunghyun Cho, B van Merrienboer, Caglar Gulcehre, F Bougares, H Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder-decoder for statistical machine translation. In Conference on Empirical Methods in Natural Language Processing (EMNLP 2014), 2014.
239
+ [20] Edward Choi, Mohammad Taha Bahadori, Joshua A Kulas, Andy Schuetz, Walter F Stewart, and Jimeng Sun. Retain: An interpretable predictive model for healthcare using reverse time attention mechanism. Advances in Neural Information Processing Systems, pages 3512–3520, 2016.
240
+ [21] Edward Choi, Mohammad Taha Bahadori, Andy Schuetz, Walter F Stewart, and Jimeng Sun. Doctor ai: Predicting clinical events via recurrent neural networks. In Machine learning for healthcare conference, pages 301–318. PMLR, 2016.
241
+ [22] Junyoung Chung, Kyle Kastner, Laurent Dinh, Kratarth Goel, Aaron C Courville, and Yoshua Bengio. A recurrent latent variable model for sequential data. Advances in Neural Information Processing Systems, 28:2980–2988, 2015.
242
+ [23] Emmanuel de Bezenac, Syama Sundar Rangapuram, Konstantinos Benidis, Michael Bohlke- ´ Schneider, Richard Kurle, Lorenzo Stella, Hilaf Hasson, Patrick Gallinari, and Tim Januschowski. Normalizing kalman filters for multivariate time series analysis. Advances in Neural Information Processing Systems, 33, 2020.
243
+ [24] Emily Denton and Rob Fergus. Stochastic video generation with a learned prior. In International Conference on Machine Learning, pages 1174–1183. PMLR, 2018.
244
+ [25] Nat Dilokthanakul, Pedro AM Mediano, Marta Garnelo, Matthew CH Lee, Hugh Salimbeni, Kai Arulkumaran, and Murray Shanahan. Deep unsupervised clustering with gaussian mixture variational autoencoders. arXiv preprint arXiv:1611.02648, 2016.
245
+ [26] Linhao Dong, Shuang Xu, and Bo Xu. Speech-transformer: a no-recurrence sequence-tosequence model for speech recognition. In 2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 5884–5888. IEEE, 2018.
246
+ [27] James Durbin and Siem Jan Koopman. Time series analysis by state space methods. Oxford university press, 2012.
247
+ [28] Chenyou Fan, Yuze Zhang, Yi Pan, Xiaoyue Li, Chi Zhang, Rong Yuan, Di Wu, Wensheng Wang, Jian Pei, and Heng Huang. Multi-horizon time series forecasting with temporal attention learning. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 2527–2535, 2019.
248
+ [29] Chelsea Finn, Ian Goodfellow, and Sergey Levine. Unsupervised learning for physical interaction through video prediction. In Proceedings of the 30th International Conference on Neural Information Processing Systems, pages 64–72, 2016.
249
+ [30] Marco Fraccaro, Søren Kaae Sønderby, Ulrich Paquet, and Ole Winther. Sequential neural models with stochastic layers. In Proceedings of the 30th International Conference on Neural Information Processing Systems, pages 2207–2215, 2016.
250
+ [31] Marco Fraccaro, Simon Kamronn, Ulrich Paquet, and Ole Winther. A disentangled recognition and nonlinear dynamics model for unsupervised learning. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 3604–3613, 2017.
251
+ [32] Katerina Fragkiadaki, Sergey Levine, Panna Felsen, and Jitendra Malik. Recurrent network models for human dynamics. In Proceedings of the IEEE International Conference on Computer Vision, pages 4346–4354, 2015.
252
+ [33] Jan Gasthaus, Konstantinos Benidis, Yuyang Wang, Syama Sundar Rangapuram, David Salinas, Valentin Flunkert, and Tim Januschowski. Probabilistic forecasting with spline quantile function rnns. In The 22nd international conference on artificial intelligence and statistics, pages 1901–1910. PMLR, 2019.
253
+ [34] Partha Ghosh, Jie Song, Emre Aksan, and Otmar Hilliges. Learning human motion models for long-term predictions. In 2017 International Conference on 3D Vision (3DV), pages 458– 466. IEEE, 2017.
254
+ [35] Tilmann Gneiting and Adrian E Raftery. Strictly proper scoring rules, prediction, and estimation. Journal of the American statistical Association, 102(477):359–378, 2007.
255
+ [36] Alexander Greaves-Tunnell and Zaid Harchaoui. A statistical investigation of long memory in language and music. In International Conference on Machine Learning, pages 2394–2403. PMLR, 2019.
256
+ [37] Agrim Gupta, Justin Johnson, Li Fei-Fei, Silvio Savarese, and Alexandre Alahi. Social gan: Socially acceptable trajectories with generative adversarial networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2255–2264, 2018.
257
+ [38] Swaminathan Gurumurthy, Ravi Kiran Sarvadevabhatla, and R Venkatesh Babu. Deligan: Generative adversarial networks for diverse and limited data. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 166–174, 2017.
258
+ [39] Danijar Hafner, Timothy Lillicrap, Ian Fischer, Ruben Villegas, David Ha, Honglak Lee, and James Davidson. Learning latent dynamics for planning from pixels. In International Conference on Machine Learning, pages 2555–2565. PMLR, 2019.
259
+ [40] Andrew C Harvey. Forecasting, Structural Time Series Models and the Kalman Filter. Cambridge University Press, 1990.
260
+ [41] Irina Higgins, Loic Matthey, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-vae: Learning basic visual concepts with a constrained variational framework. 2016.
261
+ [42] Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9 (8):1735–1780, 1997.
262
+ [43] Rob Hyndman, Anne B Koehler, J Keith Ord, and Ralph D Snyder. Forecasting with exponential smoothing: the state space approach. Springer Science & Business Media, 2008.
263
+ [44] Catalin Ionescu, Dragos Papava, Vlad Olaru, and Cristian Sminchisescu. Human3. 6m: Large scale datasets and predictive methods for 3d human sensing in natural environments. IEEE transactions on pattern analysis and machine intelligence, 36(7):1325–1339, 2013.
264
+ [45] Ashesh Jain, Amir R Zamir, Silvio Savarese, and Ashutosh Saxena. Structural-rnn: Deep learning on spatio-temporal graphs. In Proceedings of the ieee conference on computer vision and pattern recognition, pages 5308–5317, 2016.
265
+ [46] Andrew H Jazwinski. Stochastic processes and filtering theory. Courier Corporation, 2007.
266
+ [47] Maximilian Karl, Maximilian Soelch, Justin Bayer, and Patrick Van der Smagt. Deep variational bayes filters: Unsupervised learning of state space models from raw data. arXiv preprint arXiv:1605.06432, 2016.
267
+ [48] Jacob Devlin Ming-Wei Chang Kenton and Lee Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of NAACL-HLT, pages 4171–4186, 2019.
268
+ [49] Diederik P Kingma and Max Welling. Auto-encoding variational bayes. 2014.
269
+ [50] Nikita Kitaev, Łukasz Kaiser, and Anselm Levskaya. Reformer: The efficient transformer. arXiv preprint arXiv:2001.04451, 2020.
270
+ [51] Rahul Krishnan, Uri Shalit, and David Sontag. Structured inference networks for nonlinear state space models. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 31, 2017.
271
+ [52] Rahul G Krishnan, Uri Shalit, and David Sontag. Deep kalman filters. arXiv preprint arXiv:1511.05121, 2015.
272
+ [53] Guokun Lai, Wei-Cheng Chang, Yiming Yang, and Hanxiao Liu. Modeling long-and shortterm temporal patterns with deep neural networks. In The 41st International ACM SIGIR Conference on Research & Development in Information Retrieval, pages 95–104, 2018.
273
+ [54] Chen Li, Zhen Zhang, Wee Sun Lee, and Gim Hee Lee. Convolutional sequence to sequence model for human dynamics. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5226–5234, 2018.
274
+ [55] Shiyang Li, Xiaoyong Jin, Yao Xuan, Xiyou Zhou, Wenhu Chen, Yu-Xiang Wang, and Xifeng Yan. Enhancing the locality and breaking the memory bottleneck of transformer on time series forecasting. Advances in Neural Information Processing Systems, 32:5243–5253, 2019.
275
+ [56] Zimo Li, Yi Zhou, Shuangjiu Xiao, Chong He, Zeng Huang, and Hao Li. Autoconditioned recurrent networks for extended complex human motion synthesis. arXiv preprint arXiv:1707.05363, 2017.
276
+ [57] Bryan Lim, Sercan O Arik, Nicolas Loeff, and Tomas Pfister. Temporal fusion transformers for interpretable multi-horizon time series forecasting. arXiv preprint arXiv:1912.09363, 2019.
277
+ [58] Zhaojiang Lin, Genta Indra Winata, Peng Xu, Zihan Liu, and Pascale Fung. Variational transformers for diverse response generation. arXiv preprint arXiv:2003.12738, 2020.
278
+ [59] Zachary C Lipton, David C Kale, Charles Elkan, and Randall Wetzel. Learning to diagnose with lstm recurrent neural networks. In International Conference on Learning Representations, 2016.
279
+ [60] Danyang Liu and Gongshen Liu. A transformer-based variational autoencoder for sentence generation. In 2019 International Joint Conference on Neural Networks (IJCNN), pages 1–7. IEEE, 2019.
280
+ [61] Helmut Lutkepohl. ¨ New introduction to multiple time series analysis. Springer Science & Business Media, 2005.
281
+ [62] Lars Maaløe, Marco Fraccaro, Valentin Lievin, and Ole Winther. Biva: A very deep hierarchy of latent variables for generative modeling. In 33rd Conference on Neural Information Processing Systems, page 8882. Neural Information Processing Systems Foundation, 2019.
282
+ [63] Julieta Martinez, Michael J Black, and Javier Romero. On human motion prediction using recurrent neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2891–2900, 2017.
283
+ [64] Julieta Martinez, Rayat Hossain, Javier Romero, and James J Little. A simple yet effective baseline for 3d human pose estimation. In Proceedings of the IEEE International Conference on Computer Vision, pages 2640–2649, 2017.
284
+ [65] James E Matheson and Robert L Winkler. Scoring rules for continuous probability distributions. Management science, 22(10):1087–1096, 1976.
285
+ [66] Kevin P Murphy. Machine learning: a probabilistic perspective. 2012.
286
+ [67] Junhyuk Oh, Xiaoxiao Guo, Honglak Lee, Richard Lewis, and Satinder Singh. Actionconditional video prediction using deep networks in atari games. arXiv preprint arXiv:1507.08750, 2015.
287
+ [68] Boris N Oreshkin, Dmitri Carpov, Nicolas Chapados, and Yoshua Bengio. N-beats: Neural basis expansion analysis for interpretable time series forecasting. In International Conference on Learning Representations, 2019.
288
+ [69] Andrew J Patton. A review of copula models for economic time series. Journal of Multivariate Analysis, 110:4–18, 2012.
289
+ [70] Yao Qin, Dongjin Song, Haifeng Chen, Wei Cheng, Guofei Jiang, and Garrison Cottrell. A dual-stage attention-based recurrent neural network for time series prediction. arXiv preprint arXiv:1704.02971, 2017.
290
+ [71] Syama Sundar Rangapuram, Matthias W Seeger, Jan Gasthaus, Lorenzo Stella, Yuyang Wang, and Tim Januschowski. Deep state space models for time series forecasting. Advances in neural information processing systems, 31:7785–7794, 2018.
291
+ [72] Kashif Rasul, Abdul-Saboor Sheikh, Ingmar Schuster, Urs Bergmann, and Roland Vollgraf. Multi-variate probabilistic time series forecasting via conditioned normalizing flows. arXiv preprint arXiv:2002.06103, 2020.
292
+ [73] Kashif Rasul, Calvin Seward, Ingmar Schuster, and Roland Vollgraf. Autoregressive denoising diffusion models for multivariate probabilistic time series forecasting. arXiv preprint arXiv:2101.12072, 2021.
293
+ [74] Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In International conference on machine learning, pages 1278–1286. PMLR, 2014.
294
+ [75] David Salinas, Michael Bohlke-Schneider, Laurent Callot, Roberto Medico, and Jan Gasthaus. High-dimensional multivariate forecasting with low-rank gaussian copula processes. arXiv preprint arXiv:1910.03002, 2019.
295
+ [76] David Salinas, Valentin Flunkert, Jan Gasthaus, and Tim Januschowski. Deepar: Probabilistic forecasting with autoregressive recurrent networks. International Journal of Forecasting, 36 (3):1181–1191, 2020.
296
+ [77] Iulian Serban, Alessandro Sordoni, Ryan Lowe, Laurent Charlin, Joelle Pineau, Aaron Courville, and Yoshua Bengio. A hierarchical latent variable encoder-decoder model for generating dialogues. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 31, 2017.
297
+ [78] Leonid Sigal and Michael J Black. Humaneva: Synchronized video and motion capture dataset for evaluation of articulated human motion. Brown Univertsity TR, 120(2), 2006.
298
+ [79] Slawek Smyl, Jai Ranganathan, and Andrea Pasqua. M4 forecasting competition: Introducing a new hybrid es-rnn model. URL: https://eng. uber. com/m4-forecasting-competition, 2018.
299
+ [80] Casper Kaae Sønderby, Tapani Raiko, Lars Maaløe, Søren Kaae Sønderby, and Ole Winther. Ladder variational autoencoders. In Proceedings of the 30th International Conference on Neural Information Processing Systems, pages 3745–3753, 2016.
300
+ [81] Huan Song, Deepta Rajan, Jayaraman Thiagarajan, and Andreas Spanias. Attend and diagnose: Clinical time series analysis using attention models. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018.
301
+ [82] Ruey S Tsay. Multivariate time series analysis: with R and financial applications. John Wiley & Sons, 2013.
302
+ [83] Arash Vahdat and Jan Kautz. Nvae: A deep hierarchical variational autoencoder. arXiv preprint arXiv:2007.03898, 2020.
303
+ [84] Roy Van der Weide. Go-garch: a multivariate generalized orthogonal garch model. Journal of Applied Econometrics, 17(5):549–564, 2002.
304
+ [85] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 6000–6010, 2017.
305
+ [86] Ruben Villegas, Arkanath Pathak, Harini Kannan, Dumitru Erhan, Quoc V Le, and Honglak Lee. High fidelity video prediction with large stochastic recurrent neural networks. In NeurIPS, 2019.
306
+ [87] Jacob Walker, Kenneth Marino, Abhinav Gupta, and Martial Hebert. The pose knows: Video forecasting by generating pose futures. In Proceedings of the IEEE international conference on computer vision, pages 3332–3341, 2017.
307
+
308
+ [88] Eric A Wan and Rudolph Van Der Merwe. The unscented kalman filter for nonlinear estimation. In Proceedings of the IEEE 2000 Adaptive Systems for Signal Processing, Communications, and Control Symposium (Cat. No. 00EX373), pages 153–158. Ieee, 2000.
309
+
310
+ [89] Jack M Wang, David J Fleet, and Aaron Hertzmann. Gaussian process dynamical models for human motion. IEEE transactions on pattern analysis and machine intelligence, 30(2): 283–298, 2007.
311
+
312
+ [90] Tianming Wang and Xiaojun Wan. T-cvae: Transformer-based conditioned variational autoencoder for story completion. In IJCAI, pages 5233–5239, 2019.
313
+
314
+ [91] Yuyang Wang, Alex Smola, Danielle Maddix, Jan Gasthaus, Dean Foster, and Tim Januschowski. Deep factors for forecasting. In International Conference on Machine Learning, pages 6607–6617. PMLR, 2019.
315
+
316
+ [92] Mike West and Jeff Harrison. Bayesian forecasting and dynamic models. Springer Science & Business Media, 2006.
317
+
318
+ [93] Di Wu and Ling Shao. Leveraging hierarchical parametric networks for skeletal joints based action segmentation and recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 724–731, 2014.
319
+
320
+ [94] Neo Wu, Bradley Green, Xue Ben, and Shawn O’Banion. Deep transformer models for time series forecasting: The influenza prevalence case. arXiv preprint arXiv:2001.08317, 2020.
321
+
322
+ [95] Xinchen Yan, Akash Rastogi, Ruben Villegas, Kalyan Sunkavalli, Eli Shechtman, Sunil Hadap, Ersin Yumer, and Honglak Lee. Mt-vae: Learning motion transformations to generate multimodal human dynamics. In Proceedings of the European Conference on Computer Vision (ECCV), pages 265–281, 2018.
323
+
324
+ [96] Rose Yu, Stephan Zheng, Anima Anandkumar, and Yisong Yue. Long-term forecasting using tensor-train rnns. Arxiv, 2017.
325
+
326
+ [97] Ye Yuan and Kris Kitani. Dlow: Diversifying latent flows for diverse human motion prediction. In European Conference on Computer Vision, pages 346–364. Springer, 2020.
327
+
328
+ [98] Ye Yuan and Kris M Kitani. Diverse trajectory forecasting with determinantal point processes. In International Conference on Learning Representations, 2019.
329
+
330
+ [99] Han Zhang, Ian Goodfellow, Dimitris Metaxas, and Augustus Odena. Self-attention generative adversarial networks. In International conference on machine learning, pages 7354– 7363. PMLR, 2019.
331
+
332
+ [100] Jingyu Zhao, Feiqing Huang, Jia Lv, Yanjie Duan, Zhen Qin, Guodong Li, and Guangjian Tian. Do rnn and lstm have long memory? In International Conference on Machine Learning, pages 11365–11375. PMLR, 2020.
333
+
334
+ [101] Shengjia Zhao, Jiaming Song, and Stefano Ermon. Learning hierarchical features from generative models. arXiv preprint arXiv:1702.08396, 2017.
335
+
336
+ 1. For all authors...
337
+
338
+ (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] See Section 1 and 5.
339
+ (b) Did you describe the limitations of your work? [Yes] See Section 6.
340
+ (c) Did you discuss any potential negative societal impacts of your work? [Yes] See Section 6.
341
+ (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
342
+
343
+ 2. If you are including theoretical results...
344
+
345
+ (a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
346
+
347
+ 3. If you ran experiments...
348
+
349
+ (a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] See supplemental material.
350
+ (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Appdendix D in supplemental material.
351
+ (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] See Table 1.
352
+ (d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Appdendix D in supplemental material.
353
+
354
+ 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
355
+
356
+ (a) If your work uses existing assets, did you cite the creators? [Yes] See Section 4.
357
+ (b) Did you mention the license of the assets? [Yes] See Appendix A in supplemental material.
358
+ (c) Did you include any new assets either in the supplemental material or as a URL? [Yes] See supplemental material. We are also commited to open source our code upon publication.
359
+ (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [Yes] See Appendix A in supplemental material.
360
+ (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [Yes] See Appendix A in supplemental material.
361
+
362
+ 5. If you used crowdsourcing or conducted research with human subjects...
363
+
364
+ (a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
365
+ (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
366
+ (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
md/train/HkgSk2A9Y7/HkgSk2A9Y7.md ADDED
The diff for this file is too large to render. See raw diff
 
md/train/HklXn1BKDH/HklXn1BKDH.md ADDED
@@ -0,0 +1,378 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # LEARNING TO EXPLORE USING ACTIVE NEURAL SLAM
2
+
3
+ Devendra Singh Chaplot1†, Dhiraj Gandhi2, Saurabh Gupta3∗, Abhinav Gupta 1,2∗, Ruslan Salakhutdinov1∗ 1Carnegie Mellon University, 2Facebook AI Research, 3UIUC
4
+
5
+ Project webpage: https://devendrachaplot.github.io/projects/Neural-SLAM Code: https://github.com/devendrachaplot/Neural-SLAM
6
+
7
+ # ABSTRACT
8
+
9
+ This work presents a modular and hierarchical approach to learn policies for exploring 3D environments, called ‘Active Neural SLAM’. Our approach leverages the strengths of both classical and learning-based methods, by using analytical path planners with learned SLAM module, and global and local policies. The use of learning provides flexibility with respect to input modalities (in the SLAM module), leverages structural regularities of the world (in global policies), and provides robustness to errors in state estimation (in local policies). Such use of learning within each module retains its benefits, while at the same time, hierarchical decomposition and modular training allow us to sidestep the high sample complexities associated with training end-to-end policies. Our experiments in visually and physically realistic simulated 3D environments demonstrate the effectiveness of our approach over past learning and geometry-based approaches. The proposed model can also be easily transferred to the PointGoal task and was the winning entry of the CVPR 2019 Habitat PointGoal Navigation Challenge.
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ Navigation is a critical task in building intelligent agents. Navigation tasks can be expressed in many forms, for example, point goal tasks involve navigating to specific coordinates and semantic navigation involves finding the path to a specific scene or object. Irrespective of the task, a core problem for navigation in unknown environments is exploration, i.e., how to efficiently visit as much of the environment. This is useful for maximizing the coverage to give the best chance of finding the target in unknown environments or for efficiently pre-mapping environments on a limited time-budget.
14
+
15
+ Recent work from Chen et al. (2019) has used end-to-end learning to tackle this problem. Their motivation is three-fold: a) learning provides flexibility to the choice of input modalities (classical systems rely on observing geometry through the use of specialized sensors, while learning systems can infer geometry directly from RGB images), $b$ ) use of learning can improve robustness to errors in explicit state estimation, and $c _ { . }$ ) learning can effectively leverage structural regularities of the real world, leading to more efficient behavior in previously unseen environments. This lead to their design of an end-to-end trained neural network-based policy that processed raw sensory observations to directly output actions that the agent should execute.
16
+
17
+ While the use of learning for exploration is well-motivated, casting the exploration problem as an end-to-end learning problem has its own drawbacks. Learning about mapping, state-estimation, and path-planning purely from data in an end-to-end manner can be prohibitively expensive. Consequently, past end-to-end learning work for exploration from Chen et al. (2019) relies on the use of imitation learning and many millions of frames of experience, but still performs worse than classical methods that don’t require any training at all.
18
+
19
+ This motivates our work. In this paper, we investigate alternate formulations of employing learning for exploration that retains the advantages that learning has to offer, but doesn’t suffer from the drawbacks of full-blown end-to-end learning. Our key conceptual insight is that use of learning for leveraging structural regularities of indoor environments, robustness to state-estimation errors, and flexibility with respect to input modalities, happens at different time scales and can thus be factored out. This motivates the use of learning in a modular and hierarchical fashion inside of what one may call a ‘classical navigation pipeline’. This results in navigation policies that can work with raw sensory inputs such as RGB images, are robust to state estimation errors, and leverage the regularities of real-world layouts. This results in extremely competitive performance over both geometry-based methods and recent learning-based methods; at the same time requiring a fraction of the number of samples.
20
+
21
+ More specifically, our proposed exploration architecture comprises of a learned Neural SLAM module, a global policy, and a local policy, that are interfaced via the map and an analytical path planner. The learned Neural SLAM module produces free space maps and estimates agent pose from input RGB images and motion sensors. The global policy consumes this free-space map with the agent pose and employs learning to exploit structural regularities in layouts of real-world environments to produce long-term goals. These long-term goals are used to generate short-term goals for the local policy (using a geometric path-planner). This local policy uses learning to directly map raw RGB images to actions that the agent should execute. Use of learning in the SLAM module provides flexibility with respect to input modality, learned global policy can exploit regularities in layouts of real-world environments, while learned local policies can use visual feedback to exhibit more robust behavior. At the same time, hierarchical and modular design and use of analytical planning, significantly cuts down the search space during training, leading to better performance as well as sample efficiency.
22
+
23
+ We demonstrate our proposed approach in visually and physically realistic simulators for the task of geometric exploration (visit as much area as possible). We work with the Habitat simulator from Savva et al. (2019). While Habitat is already visually realistic (it uses real-world scans from Chang et al. (2017) and Xia et al. (2018) as environments), we improve its physical realism by using actuation and odometry sensor noise models, that we collected by conducting physical experiments on a real mobile robot. Our experiments and ablations in this realistic simulation reveal the effectiveness of our proposed approach for the task of exploration. A straightforward modification of our method also tackles point-goal navigation tasks, and won the AI Habitat challenge at CVPR2019 across all tracks.
24
+
25
+ # 2 RELATED WORK
26
+
27
+ Navigation has been well studied in classical robotics. There has been a renewed interest in the use of learning to arrive at navigation policies, for a variety of tasks. Our work builds upon concepts in classical robotics and learning for navigation. We survey related works below.
28
+
29
+ Navigation Approaches. Classical approaches to navigation break the problem into two parts: mapping and path planning. Mapping is done via simultaneous localization and mapping (Thrun et al., 2005; Hartley and Zisserman, 2003; Fuentes-Pacheco et al., 2015), by fusing information from multiple views of the environment. While sparse reconstruction can be done well with monocular RGB images (Mur-Artal and Tardós, 2017), dense mapping is inefficient (Newcombe et al., 2011) or requires specialized scanners such as Kinect (Izadi et al., 2011). Maps are used to compute paths to goal locations via path planning (Kavraki et al., 1996; Lavalle and Kuffner Jr, 2000; Canny, 1988). These classical methods have inspired recent learning-based techniques. Researchers have designed neural network policies that reason via spatial representations (Gupta et al., 2017; Parisotto and Salakhutdinov, 2018; Zhang et al., 2017; Henriques and Vedaldi, 2018; Gordon et al., 2018), topological representations (Savinov et al., 2018; 2019), or use differentiable and trainable planners (Tamar et al., 2016; Lee et al., 2018; Gupta et al., 2017; Khan et al., 2017). Our work furthers this research, and we study a hierarchical and modular decomposition of the problem and employ learning inside these components instead of end-to-end learning. Research also focuses on incorporating semantics in SLAM (Pronobis and Jensfelt, 2012; Walter et al., 2013).
30
+
31
+ Exploration in Navigation. While a number of works focus on passive map-building, path planning and goal-driven policy learning, a much smaller body of work tackles the the problem of active SLAM, i.e., how to actively control the camera for map building. We point readers to FuentesPacheco et al. (2015) for a detailed survey, and summarize the major themes below. Most such works frame this problem as a Partially Observable Markov Decision Process (POMDP) that are approximately solved (Martinez-Cantin et al., 2009; Kollar and Roy, 2008), and or seek to find a sequence of actions that minimizes uncertainty of maps (Stachniss et al., 2005; Carlone et al., 2014).
32
+
33
+ Another line of work explores by picking vantage points (such as on the frontier between explored and unexplored regions (Dornhege and Kleiner, 2013; Holz et al., 2010; Yamauchi, 1997; Xu et al., 2017)). Recent works from Chen et al. (2019); Savinov et al. (2019); Fang et al. (2019) attack this problem via learning. Our proposed modular policies unify the last two lines of research, and we show improvements over representative methods from both these lines of work. Exploration has also been studied more generally in RL in the context of exploration-exploitation trade-off (Sutton and Barto, 2018; Kearns and Singh, 2002; Auer, 2002; Jaksch et al., 2010).
34
+
35
+ Hierarchical and Modular Policies. Hierarchical RL (Dayan and Hinton, 1993; Sutton et al., 1999; Barto and Mahadevan, 2003) is an active area of research, aimed at automatically discovering hierarchies to speed up learning. However, this has proven to be challenging, and thus most work has resorted to using hand-defining hierarchies. For example in the context of navigation, Bansal et al. (2019) and Kaufmann et al. (2019) design modular policies for navigation, that interface learned policies with low-level feedback controllers. Hierarchical and modular policies have also been used for Embodied Question Answering (Das et al., 2018a; Gordon et al., 2018; Das et al., 2018b).
36
+
37
+ # 3 TASK SETUP
38
+
39
+ We follow the exploration task setup proposed by Chen et al. (2019) where the objective is to maximize the coverage in a fixed time budget. The coverage is defined as the total area in the map known to be traversable. Our objective is to train a policy which takes in an observation $s _ { t }$ at each time step $t$ and outputs a navigational action $a _ { t }$ to maximize the coverage.
40
+
41
+ We try to make our experimental setup in simulation as realistic as possible with the goal of transferring trained policies to the real world. We use the Habitat simulator (Savva et al., 2019) with the Gibson (Xia et al., 2018) and Matterport (MP3D) (Chang et al., 2017) datasets for our experiments. Both Gibson and Matterport datasets are based on real-world scene reconstructions are thus significantly more realistic than synthetic SUNCG dataset (Song et al., 2017) used for past research on exploration (Chen et al., 2019; Fang et al., 2019).
42
+
43
+ In addition to synthetic scenes, prior works on learning-based navigation have also assumed simplistic agent motion. Some works limit agent motion on a grid with 90 degree rotations (Zhu et al., 2017; Gupta et al., 2017; Chaplot et al., 2018). Other works which implement fine-grained control, typically assume unrealistic agent motion with no noise (Savva et al., 2019) or perfect knowledge of agent pose (Chaplot et al., 2016). Since the motion is simplistic, it becomes trivial to estimate the agent pose in most cases even if it is not assumed to be known. The reason behind these assumptions on agent motion and pose is that motion and sensor noise models are not known. In order to relax both these assumptions, we collect motion and sensor data in the real-world and implement more realistic agent motion and sensor noise models in the simulator as described in the following subsection.
44
+
45
+ # 3.1 ACTUATION AND SENSOR NOISE MODEL
46
+
47
+ We represent the agent pose by $( x , y , o )$ where $x$ and $y$ represent the xy co-ordinate of the agent measured in metres and $o$ represents the orientation of the agent in radians (measured counterclockwise from $x$ -axis). Without loss of generality, assume agents starts at $p _ { 0 } = ( 0 , 0 , 0 )$ . Now, suppose the agent takes an action $a _ { t }$ . Each action is implemented as a control command on a robot. Let the corresponding control command be $\Delta u _ { a } = ( x _ { a } , y _ { a } , o _ { a } )$ . Let the agent pose after the action be $p _ { 1 } = \left( x ^ { \star } , y ^ { \star } , o ^ { \star } \right)$ . The actuation noise $( \epsilon _ { a c t } )$ is the difference between the actual agent pose $( p _ { 1 } )$ after the action and the intended agent pose $( p _ { 0 } + \Delta u )$ :
48
+
49
+ $$
50
+ \epsilon _ { a c t } = p _ { 1 } - ( p _ { 0 } + \Delta u ) = ( x ^ { \star } - x _ { a } , y ^ { \star } - y _ { a } , o ^ { \star } - o _ { a } )
51
+ $$
52
+
53
+ Mobile robots typically have sensors which estimate the robot pose as it moves. Let the sensor estimate of the agent pose after the action be $p _ { 1 } ^ { \prime } = ( x ^ { \prime } , y ^ { \prime } , o ^ { \prime } )$ . The sensor noise $( \epsilon _ { s e n } )$ is given by the difference between the sensor pose estimate $( p _ { 1 } ^ { \prime } )$ and the actual agent pose $( p _ { 1 } )$ :
54
+
55
+ $$
56
+ \epsilon _ { s e n } = p _ { 1 } ^ { \prime } - p _ { 1 } = ( x ^ { \prime } - x ^ { \star } , y ^ { \prime } - y ^ { \star } , o ^ { \prime } - o ^ { \star } )
57
+ $$
58
+
59
+ In order to implement the actuation and sensor noise models, we would like to collect data for navigational actions in the Habitat simulator. We use three default navigational actions: Forward: move forward by $2 5 \mathrm { c m }$ , Turn Right: on the spot rotation clockwise by 10 degrees, and Turn Left: on the spot rotation counter-clockwise by 10 degrees. The control commands are implemented as $u _ { F o r w a r d } = ( 0 . 2 5 , 0 , 0 )$ , $u _ { R i g h t } : ( 0 , 0 , - 1 0 * \pi / 1 8 0 )$ and $u _ { L e f t } : ( 0 , 0 , 1 0 * \pi / 1 8 0 )$ . In practice, a robot can also rotate slightly while moving forward and translate a bit while rotating on-the-spot, creating rotational actuation noise in forward action and similarly, a translation actuation noise in on-the-spot rotation actions.
60
+
61
+ ![](images/0f828ac8d8031ec900e14da185f239abeaa1db5f7b3cc2e5cecbd62ba773fdd1.jpg)
62
+ Figure 1: Overview of our approach. The Neural SLAM module predicts a map and agent pose estimate from incoming RGB observations and sensor readings. This map and pose are used by a Global policy to output a long-term goal, which is converted to a short-term goal using an analytic path planner. A Local Policy is trained to navigate to this short-term goal.
63
+
64
+ We use a LoCoBot1 to collect data for building the actuation and sensor noise models. We use the pyrobot API (Murali et al., 2019) along with ROS (Quigley et al., 2009) to implement the control commands and get sensor readings. For each action $a$ , we fit a separate Gaussian Mixture Model for the actuation noise and sensor noise, making a total of 6 models. Each component in these Gaussian mixture models is a multi-variate Gaussian in 3 variables, $x , y$ and $o$ . For each model, we collect 600 datapoints. The number of components in each Gaussian mixture model is chosen using cross-validation. We implement these actuation and sensor noise models in the Habitat simulator for our experiments. We have released the noise models, along with their implementation in the Habitat simulator in the open-source code.
65
+
66
+ # 4 METHODS
67
+
68
+ We propose a modular navigation model, ‘Active Neural SLAM’. It consists of three components: a Neural SLAM module, a Global policy and a Local policy as shown in Figure 1. The Neural SLAM module predicts the map of the environment and the agent pose based on the current observations and previous predictions. The Global policy uses the predicted map and agent pose to produce a long-term goal. The long-term goal is converted into a short-term goal using path planning. The Local policy takes navigational actions based on the current observation to reach the short-term goal.
69
+
70
+ Map Representation. The Active Neural SLAM model internally maintains a spatial map, $m _ { t }$ and pose of the agent $x _ { t }$ . The spatial map, $m _ { t }$ , is a $2 \times M \times M$ matrix where $M \times M$ denotes the map size and each element in this spatial map corresponds to a cell of size $2 5 c m ^ { 2 }$ $( 5 c m \times 5 c m )$ in the physical world. Each element in the first channel denotes the probability of an obstacle at the corresponding location and each element in the second channel denotes the probability of that location being explored. A cell is considered to be explored when it is known to be free space or an obstacle. The spatial map is initialized with all zeros at the beginning of an episode, $m _ { 0 } = [ \dot { 0 } ] ^ { 2 \times M \times M }$ The pose $\boldsymbol { x } _ { t } \in { \mathbb { R } } ^ { 3 }$ denotes the $x$ and $y$ coordinates of the agent and the orientation of the agent at time $t$ . The agent always starts at the center of the map facing east at the beginning of the episode, $x _ { 0 } = ( M / 2 , \bar { M } / 2 , 0 . 0 ) $ .
71
+
72
+ Neural SLAM Module. The Neural SLAM Module $( f _ { S L A M } )$ takes in the current RGB observation, $s _ { t }$ , the current and last sensor reading of the agent pose $x _ { t - 1 : t } ^ { \prime }$ , last agent pose and map estimates, $\hat { x } _ { t - 1 } , m _ { t - 1 }$ and outputs an updated map, $m _ { t }$ , and the current agent pose estimate, $\hat { x } _ { t }$ , (see Figure 2): $m _ { t } , \hat { x } _ { t } = f _ { S L A M } ( s _ { t } , x _ { t - 1 : t } ^ { \prime } , \hat { x } _ { t - 1 } , \bar { m } _ { t - 1 } | \theta _ { S } )$ , where $\theta _ { S }$ denote the trainable parameters of the Neural SLAM module. It consists of two learned components, a Mapper and a Pose Estimator. The Mapper $( f _ { M a p } )$ outputs a egocentric top-down 2D spatial map, $p _ { t } ^ { e \dot { g } \dot { o } } \in [ 0 , 1 ] ^ { 2 \times V \times V }$ (where $V$ is the vision range), predicting the obstacles and the explored area in the current observation. The Pose Estimator $( f _ { P E } )$ predicts the agent pose $( \hat { x } _ { t } )$ based on past pose estimate $( \hat { x } _ { t - 1 } )$ and last two egocentric map predictions $( p _ { t - 1 : t } ^ { e g o } )$ . It essentially compares the current egocentric map prediction to the last egocentric map prediction transformed to the current frame to predict the pose change between the two maps. The egocentric map from the Mapper is transformed to a geocentric map based on the pose estimate given by the Pose Estimator and then aggregated with the previous spatial map $( m _ { t - 1 } )$ to get the current map $( m _ { t } )$ . More implementation details of the Neural SLAM module are provided in the Appendix.
73
+
74
+ ![](images/b80248233673c08cd64375a78fcf41addfd6f1f25c6dd5da99331d4bcce81b71.jpg)
75
+ Figure 2: Architecture of the Neural SLAM module: The Neural SLAM module $( f _ { M a p } )$ takes in the current RGB observation, $s _ { t }$ , the current and last sensor reading of the agent pose $x _ { t - 1 : t } ^ { \prime }$ , last agent pose estimate, $\hat { x } _ { t - 1 }$ and the map at the previous time step $m _ { t - 1 }$ and outputs an updated map, $m _ { t }$ and the current agent pose estimate, $\hat { x } _ { t }$ . ‘ST’ denotes spatial transformation.
76
+
77
+ Global Policy. The Global Policy takes $h _ { t } \in [ 0 , 1 ] ^ { 4 \times M \times M }$ as input, where the first two channels of $h _ { t }$ are the spatial map $m _ { t }$ given by the SLAM module, the third channel represents the current agent position estimated by the SLAM module, the fourth channel represents the visited locations, i.e. $\bar { \forall i } , j \in \{ 1 , 2 , \dots , m \}$ :
78
+
79
+ $$
80
+ \begin{array} { r l } & { h _ { t } [ c , i , j ] = m _ { t } [ c , i , j ] \quad \forall c \in \{ 0 , 1 \} } \\ & { h _ { t } [ 2 , i , j ] = 1 \qquad } & { \mathrm { i f ~ } i = \hat { x } _ { t } [ 0 ] \mathrm { ~ a n d ~ } j = \hat { x } _ { t } [ 1 ] } \\ & { h _ { t } [ 3 , i , j ] = 1 \qquad } & { \mathrm { i f ~ } ( i , j ) \in [ ( \hat { x } _ { k } [ 0 ] , \hat { x } _ { k } [ 1 ] ) ] _ { k \in \{ 0 , 1 , \ldots , t \} } } \end{array}
81
+ $$
82
+
83
+ We perform two transformations before passing $h _ { t }$ to the Global Policy model. The first transformation subsamples a window of size $4 \times G \times G$ around the agent from $h _ { t }$ . The second transformation performs max pooling operations to get an output of size $4 \times G \times G$ from $h _ { t }$ . Both the transformations are stacked to form a tensor of size $8 \times G \times G$ and passed as input to the Global Policy model. The Global Policy uses a convolutional neural network to predict a long-term goal, $g _ { t } ^ { l }$ in $G \times G$ space: $g _ { t } ^ { l } = \pi _ { G } ( h _ { t } | \dot { \theta } _ { G } )$ , where $\theta _ { G }$ are the parameters of the Global Policy.
84
+
85
+ Planner. The Planner takes the long-term goal $( g _ { t } ^ { l } )$ , the spatial obstacle map $( m _ { t } )$ and the agnet pose estimate $( \hat { x } _ { t } )$ as input and computes the short-term goal $g _ { t } ^ { s }$ , i.e. $g _ { t } ^ { s } = f _ { P l a n } ( g _ { t } ^ { l } , m _ { t } , \hat { x } _ { t } )$ . It computes the shortest path from the current agent location to the long-term goal $( g _ { t } ^ { l } )$ using the Fast Marching Method (Sethian, 1996) based on the current spatial map $m _ { t }$ . The unexplored area is considered as free space for planning. We compute a short-term goal coordinate (farthest point within $d _ { s } ( = 0 . 2 5 m )$ from the agent) on the planned path.
86
+
87
+ Local Policy. The Local Policy takes as input the current RGB observation $\left( { { s _ { t } } } \right)$ and the short-term goal $( g _ { t } ^ { s } )$ and outputs a navigational action, $a _ { t } = \pi _ { L } ( s _ { t } , g _ { t } ^ { s } | \theta _ { L } )$ , where $\theta _ { L }$ are the parameters of the Local Policy. The short-term goal coordinate is transformed into relative distance and angle from the agent’s location before being passed to the Local Policy. The Local Policy is a recurrent neural network consisting of a pretrained ResNet18 (He et al., 2016) as the visual encoder.
88
+
89
+ # 5 EXPERIMENTAL SETUP
90
+
91
+ We use the Habitat simulator (Savva et al., 2019) with the Gibson (Xia et al., 2018) and Matterport (MP3D) (Chang et al., 2017) datasets for our experiments. Both Gibson and MP3D consist of scenes which are 3D reconstructions of real-world environments, however, Gibson is collected using a different set of cameras, consists mostly of office spaces while MP3D consists of mostly homes with a larger average scene area. We will use Gibson as our training domain, and use MP3D for domain generalization experiments. The observation space consists of RGB images of size $3 \times 1 2 8 \times 1 2 8$ and base odometry sensor readings of size $3 \times 1$ denoting the change in agent’s x-y coordinates and orientation. The actions space consists of three actions: move_forward, turn_left, turn_right. Both the base odometry sensor readings and the agent motion based on the actions are noisy. They are implemented using the sensor and actuation noise models based on real-world data as discussed in Section 3.1.
92
+
93
+ We follow the Exploration task setup proposed by Chen et al. (2019) where the objective to maximize the coverage in a fixed time budget. Coverage is the total area in the map known to be traversable. We define a traversable point to be known if it is in the field-of-view of the agent and is less than $3 . 2 m$ away. We use two evaluation metrics, the absolute coverage area in $m ^ { 2 }$ (Cov) and the percentage of area explored in the scene ( $\%$ Cov), i.e. ratio of coverage to maximum possible coverage in the corresponding scene. During training, each episode lasts for a fixed length of 1000 steps.
94
+
95
+ We use train/val/test splits provided by Savva et al. (2019) for both the datasets. Note that the set of scenes used in each split is disjoint, which means the agent is tested on new scenes never seen during training. Gibson test set is not public but rather held out on an online evaluation server for the Pointgoal task. We use the validation as the test set for comparison and analysis for the Gibson domain. We do not use the validation set for hyper-parameter tuning. To analyze the performance of all the models with respect to the size of the scene, we split the Gibson validation set into two parts, a small set of 10 scenes with explorable area ranging from $1 6 m ^ { 2 }$ to $3 6 m ^ { 2 }$ , and a large set of 4 scenes with explorable area ranging from $5 5 m ^ { 2 }$ to $1 0 \hat { 0 } m ^ { 2 }$ . Note that the size of the map is usually much larger than the traversable area, with the largest map being about $2 3 m$ long and $1 1 m$ wide.
96
+
97
+ Training Details. We train our model in the Gibson domain and transfer it to the Matterport domain. The Mapper is trained to predict egocentric projections, and the Pose Estimator is trained to predict agent pose using supervised learning. The ground truth egocentric projection is computed using geometric projections from ground truth depth. The Global Policy is trained using Reinforcement Learning with reward proportional to the increase in coverage as the reward. The Local Policy is trained using Imitation Learning (behavioral cloning). All the modules are trained simultaneously. Their parameters are independent, but the data distribution is inter-dependent. Based on the actions taken by the Local policy, the future input to Neural SLAM module changes, which in turn changes the map and agent pose input to the Global policy and consequently affects the short-term goal given to the Local Policy. For more architecture and hyperparameter details, please refer to the supplementary material and the open-source code.
98
+
99
+ Baselines. We use a range of end-to-end Reinforcement Learning (RL) methods as baselines:
100
+
101
+ RL $^ +$ 3LConv: An RL Policy with 3 layer convolutional network followed by a GRU (Cho et al., 2014) as described by Savva et al. (2019).
102
+
103
+ $\mathbf { R L } + \mathbf { R e s } \mathbf { 1 8 }$ : A RL Policy initialized with ResNet18 (He et al., 2016) pre-trained on ImageNet followed by a GRU.
104
+
105
+ $\mathbf { R L } + \mathbf { R e s 1 8 } +$ AuxDepth: This baseline is adapted from Mirowski et al. (2017) who use depth prediction as an auxiliary task. We use the same architecture as our Neural SLAM module (conv layers from ResNet18) with one additional deconvolutional layer for Depth prediction followed by 3 layer convolution and GRU for the policy.
106
+
107
+ $\mathbf { R L } + \mathbf { R e s 1 8 } + \mathbf { P r }$ ojDepth: This baseline is adapted form Chen et al. (2019) who project the depth image in an egocentric top-down in addition to the RGB image as input to the RL policy. Since we do not have depth as input, we use the architecture from $\mathrm { R L } + \mathrm { R e s } 1 8 +$ AuxDepth for depth prediction and project the predicted depth before passing to 3Layer Conv and GRU policy.
108
+
109
+ For all the baselines, we also feed a 32-dimensional embedding of the sensor pose reading to the GRU along with the image-based representation. This embedding is also learnt end-to-end using RL. All baselines are trained using PPO (Schulman et al., 2017) with increase in coverage as the reward (identical to the reward used for Global policy). All the baselines require access to the ground-truth map during training for computing the reward. The supervision for the Global Policy, the Local Policy and the Mapper can also be obtained from the ground-truth map. The Pose Estimator requires additional supervision in the form of the ground-truth agent pose. We study the effect of this additional supervision in ablation experiments.
110
+
111
+ Table 1: Exploration performance of the proposed model, Active Neural SLAM (ANS) and baselines. The baselines are adated from [1] Savva et al. (2019), [2] Mirowski et al. (2017) and [3] Chen et al. (2019).
112
+
113
+ <table><tr><td></td><td colspan="2">Gibson Val</td><td colspan="2">Domain Generalization MP3D Test</td></tr><tr><td>Method</td><td>% Cov.</td><td>Cov. (m2)</td><td>% Cov.</td><td>Cov. (m2)</td></tr><tr><td>RL + 3LConv [1]</td><td>0.737</td><td>22.838</td><td>0.332</td><td>47.758</td></tr><tr><td>RL + Res18</td><td>0.747</td><td>23.188</td><td>0.341</td><td>49.175</td></tr><tr><td>RL + Res18 + AuxDepth [2]</td><td>0.779</td><td>24.467</td><td>0.356</td><td>51.959</td></tr><tr><td>RL + Res18 +ProjDepth [3]</td><td>0.789</td><td>24.863</td><td>0.378</td><td>54.775</td></tr><tr><td>Active Neural SLAM (ANS)</td><td>0.948</td><td>32.701</td><td>0.521</td><td>73.281</td></tr></table>
114
+
115
+ ![](images/97cf4af8c9e15b2b94848570a8a3140c5bf776534ac2e16e96b117b44c81d4be.jpg)
116
+ Figure 3: Plot showing the $\%$ Coverage as the episode progresses for ANS and the baselines on the large and small scenes in the Gibson Val set as well as the overall Gibson Val set.
117
+
118
+ # 6 RESULTS
119
+
120
+ We train the proposed ANS model and all the baselines for the Exploration task with 10 million frames on the Gibson training set. The results are shown in Table 1. The results on the Gibson Val set are averaged over a total of 994 episodes in 14 different unseen scenes. The proposed model achieves an average absolute and relative coverage of $3 2 . 7 0 1 m ^ { 2 } / 0 . 9 4 8$ as compared to $2 4 . 8 6 3 m ^ { 2 } / 0 . 7 8 9$ for the best baseline. This indicates that the proposed model is more efficient and effective at exhaustive exploration as compared to the baselines. This is because our hierarchical policy architecture reduces the horizon of the long-term exploration problem as instead of taking tens of low-level navigational actions, the Global policy only takes few long-term goal actions. We also report the domain generalization performance on the Exploration task in Table 1 (see shaded region), where all models trained on Gibson are evaluated on the Matterport domain. ANS leads to higher domain generalization performance $( 7 3 . 2 8 1 m ^ { 2 } / 0 . 5 2 1$ vs $5 4 . 7 7 5 \bar { m ^ { 2 } } / 0 . 3 7 8 )$ . The absolute coverage is higher and $\%$ Cov is lower for the Matterport domain as it consists of larger scenes on average. On a set of small MP3D test scenes (comparable to Gibson scene sizes), ANS achieved a performance of $3 1 . 4 0 7 m ^ { 2 } / 0 . 8 3 6$ as compared to $\dot { 2 } 3 . 0 9 1 m ^ { 2 } / 0 . 6 2 0$ for the best baseline. Some visualizations of policy execution are provided in Figure $4 ^ { 2 }$ .
121
+
122
+ In Fig. 3, we plot the relative coverage $( \% \thinspace \mathrm { C o v } )$ of all the models as the episode progresses on the large and small scene sets, as well as the overall Gibson Val set. The plot on the small scene set shows that ANS is able to almost completely explore the small scenes in around 500 steps, however, the baselines are only able to explore $8 5 - 9 0 \%$ of the small scenes in 1000 steps (see Fig. 3 center). This indicates that ANS explores more efficiently in small scenes. The plot on the large scenes set shows that the performance gap between ANS and baselines widens as the episode progresses (see Fig. 3 left). Looking at the behavior of the baselines, we saw that they often got stuck in local areas. This behavior indicates that they are unable to remember explored areas over long-time horizons and are ineffective at long-term planning. On the other hand, ANS uses a Global policy on the map which allows it to have the memory of explored areas over long-time horizons, and plan effectively to reach distant long-term goals by leveraging analytical planners. As a result, it is able to explore effectively in large scenes with long episode lengths.
123
+
124
+ Table 2: Results of the ablation experiments on the Gibson environment.
125
+ Time
126
+
127
+ <table><tr><td>Method</td><td colspan="2">Gibson Val Overall</td><td colspan="2">Gibson Val Large</td><td colspan="2">Gibson Val Small</td></tr><tr><td></td><td>% Cov.</td><td>Cov. (m2)</td><td>% Cov.</td><td>Cov. (m2)</td><td>% Cov.</td><td>Cov. (m2)</td></tr><tr><td>ANS w/o Local Policy + Det. Planner</td><td>0.941</td><td>32.188</td><td>0.845</td><td>53.999</td><td>0.980</td><td>23.464</td></tr><tr><td>ANS w/o Global Policy+FBE</td><td>0.925</td><td>30.981</td><td>0.782</td><td>49.731</td><td>0.982</td><td>23.481</td></tr><tr><td>ANS w/o Pose Estimation</td><td>0.916</td><td>30.746</td><td>0.771</td><td>49.518</td><td>0.973</td><td>23.237</td></tr><tr><td>ANS</td><td>0.948</td><td>32.701</td><td>0.862</td><td>55.608</td><td>0.983</td><td>23.538</td></tr></table>
128
+
129
+ ![](images/634add30d71a88e4809c1ba46c5269929205bf36e731d5b453c2c37dcd0a2fce.jpg)
130
+ Figure 4: Exploration visualization. Figure showing a sample trajectory of the Active Neural SLAM model in the Exploration task. Top: RGB observations seen by the agent. Inset: Global ground truth map and pose (not visible to the agent). Bottom: Local map and pose predictions. Long-term goals selected by the Global policy are shown by blue circles. The ground-truth map and pose are under-laid in grey. Map prediction is overlaid in green, with dark green denoting correct predictions and light green denoting false positives. Agent pose predictions are shown in red. The light blue shaded region shows the explored area.
131
+
132
+ # 6.1 ABLATIONS
133
+
134
+ Local Policy. An alternative to learning a Local Policy is to have a deterministic policy which follows the plan given by the Planner. As shown in Table 2, the ANS model performs slightly worse without the Local Policy. The Local Policy is designed to adapt to small errors in Mapping. We observed Local policy overcoming false positives encountered in mapping. For example, the Neural SLAM module could sometime wrongly predict a carpet as an obstacle. In this case, the planner would plan to go around the carpet. However, if the short-term goal is beyond the carpet, the Local policy can understand that the carpet is not an obstacle based on the RGB observation and learn to walk over it.
135
+
136
+ Global Policy. An alternative to learning a Global Policy for sampling long-term goals is to use a classical algorithm called Frontier-based exploration (FBE) (Yamauchi, 1997). A frontier is defined as the boundary between the explored free space and the unexplored space. Frontier-based exploration essentially sample points on this frontier as goals to explore the space. There are different variants of Frontier-based exploration based on the sampling strategy. Holz et al. (2010) compare different sampling strategies and find that sampling the point on the frontier closest to the agent gives the best results empirically. We implement this variant and replace it with our learned Global Policy. As shown in Table 2, the performance of the Frontier-based exploration policy is comparable on small scenes, but around $10 \%$ lower on large scenes, relative to the Global policy. This indicates the importance of learning as compared to classical exploration methods in larger scenes. Qualitatively, we observed that Frontier-based exploration spent a lot of time exploring corners or small areas behind furniture. In contrast, the trained Global policy ignored small spaces and chose distant long-term goals which led to higher coverage.
137
+
138
+ Pose Estimation. A difference between ANS and the baselines is that ANS uses additional supervision to train the Pose Estimator. In order to understand whether the performance gain is coming from this additional supervision, we remove the Pose Estimator from ANS and just use the input sensor reading as our pose estimate. Results in Table 2 show that the ANS still outperforms the baselines even without the Pose Estimator. We also observed that performance without the pose estimator drops only about $1 \%$ on small scenes, but around $10 \%$ on large scenes. This is expected because larger scenes take longer to explore, and pose errors accumulate over time to cause drift. Passing the ground truth pose as input the baselines instead of the sensor reading did not improve their performance.
139
+
140
+ ![](images/db3db1a4008a3d6ee4a8549012e244e24eeb09c0897fc920d47163d72bdcc9c9.jpg)
141
+ Figure 5: Real-world Transfer. Left: Image showing the living area in an apartment used for the real-world experiments. Right: Sample images seen by the robot and the predicted map. The long-term goal selected by the Global Policy is shown by a blue circle on the map.
142
+
143
+ # 6.2 REAL-WORLD TRANSFER
144
+
145
+ We deploy the trained ANS policy on a Locobot in the real-world. In order to match the real-world observations to the simulator observations as closely as possible, we change the simulator input configuration to match the camera intrinsics on the Locobot. This includes the camera height and horizontal and vertical field-of-views. In Figure 5, we show an episode of ANS exploring the living area in an apartment. The figure shows that the policy transfers well to the real-world and is able to effectively explore the environment. The long-term goals sampled by the Global policy (shown by blue circles on the map) are often towards open spaces in the explored map, which indicates that it is learning to exploit the structure in the map. Please refer to the project webpage for real-world transfer videos.
146
+
147
+ # 6.3 POINTGOAL TASK TRANSFER.
148
+
149
+ PointGoal has been the most studied task in recent literature on navigation where the objective is to navigate to a goal location whose relative coordinates are given as input in a limited time budget. In this task, each episode ends when either the agent takes the stop action or at a maximum of 500 timesteps. An episode is considered a success when the final position of the agent is within $0 . 2 \mathrm { m }$ of the goal location. In addition to Success rate (Succ), Success weighted by (normalized inverse) Path Length or SPL is also used as a metric for evaluation as proposed by Anderson et al. (2018).
150
+
151
+ All the baseline models trained for the task of Exploration either need to be retrained or at least finetuned to be transferred to the Pointgoal task. The modularity of ANS provides it another advantage that it can be transferred to the Pointgoal task without any additional training. For transferring to the Pointgoal task, we just fix the Global policy to always output the PointGoal coordinates as the long-term goal and use the Local Policy and Neural SLAM module trained for the Exploration task. We found that an ANS policy trained on exploration, when transferred to the Pointgoal task performed better than several RL and Imitation Learning baselines trained on the Pointgoal task. The transferred ANS model achieves a success rate/SPL of 0.950/0.846 as compared to 0.827/0.730 for the best baseline model on Gibson val set. The ANS model also generalized significantly better than the baselines to harder goals and to the Matterport domain. In addition to better performance, ANS was also 10 to 75 times more sample efficient than the baselines. This transferred ANS policy was also the winner of the CVPR 2019 Habitat Pointgoal Navigation Challenge for both RGB and RGB-D tracks among over 150 submissions from 16 teams. These results highlight a key advantage of our model. It allows us to transfer the knowledge of obstacle avoidance and control in low-level navigation across tasks, as the Local Policy and Neural SLAM module are task-invariant. More details about the Pointgoal experiments, baselines, results including domain and goal generalization on the Pointgoal task are provided in the supplementary material.
152
+
153
+ # 7 CONCLUSION
154
+
155
+ In this paper, we proposed a modular navigational model which leverages the strengths of classical and learning-based navigational methods. We show that the proposed model outperforms prior methods on both Exploration and PointGoal tasks and shows strong generalization across domains, goals, and tasks. In the future, the proposed model can be extended to complex semantic tasks such as Semantic Goal Navigation and Embodied Question Answering by using a semantic Neural SLAM module which creates a multi-channel map capturing semantic properties of the objects in the environment. The model can also be combined with prior work on Localization to relocalize in a previously created map for efficient navigation in subsequent episodes.
156
+
157
+ # ACKNOWLEDGEMENTS
158
+
159
+ This work was supported by IARPA DIVA D17PC00340, ONR Grant N000141812861, ONR MURI, ONR Young Investigator, DARPA MCS, and Apple. We would also like to acknowledge NVIDIA’s GPU support. We thank Guillaume Lample for discussions and coding during the initial stages of this project.
160
+
161
+ # Licenses for referenced datasets.
162
+
163
+ Gibson: http://svl.stanford.edu/gibson2/assets/GDS_agreement.pdf Matterport3D: http://kaldir.vc.in.tum.de/matterport/MP_TOS.pdf
164
+
165
+ # REFERENCES
166
+
167
+ Peter Anderson, Angel Chang, Devendra Singh Chaplot, Alexey Dosovitskiy, Saurabh Gupta, Vladlen Koltun, Jana Kosecka, Jitendra Malik, Roozbeh Mottaghi, Manolis Savva, et al. On evaluation of embodied navigation agents. arXiv preprint arXiv:1807.06757, 2018.
168
+
169
+ Peter Auer. Using confidence bounds for exploitation-exploration trade-offs. Journal of Machine Learning Research, 3(Nov):397–422, 2002.
170
+
171
+ Somil Bansal, Varun Tolani, Saurabh Gupta, Jitendra Malik, and Claire Tomlin. Combining optimal control and learning for visual navigation in novel environments. In Conference on Robot Learning (CoRL), 2019.
172
+
173
+ Andrew G Barto and Sridhar Mahadevan. Recent advances in hierarchical reinforcement learning. Discrete event dynamic systems, 13(1-2):41–77, 2003.
174
+
175
+ John Canny. The complexity of robot motion planning. MIT press, 1988.
176
+
177
+ Luca Carlone, Jingjing Du, Miguel Kaouk $\mathrm { N g }$ , Basilio Bona, and Marina Indri. Active slam and exploration with particle filters using kullback-leibler divergence. Journal of Intelligent & Robotic Systems, 75(2):291–311, 2014.
178
+
179
+ Angel Chang, Angela Dai, Thomas Funkhouser, Maciej Halber, Matthias Niebner, Manolis Savva, Shuran Song, Andy Zeng, and Yinda Zhang. Matterport3d: Learning from rgb-d data in indoor environments. In 2017 International Conference on 3D Vision (3DV), pages 667–676. IEEE, 2017.
180
+
181
+ Devendra Singh Chaplot and Guillaume Lample. Arnold: An autonomous agent to play fps games. In Thirty-First AAAI Conference on Artificial Intelligence, 2017.
182
+
183
+ Devendra Singh Chaplot, Guillaume Lample, Kanthashree Mysore Sathyendra, and Ruslan Salakhutdinov. Transfer deep reinforcement learning in 3d environments: An empirical study. In NIPS Deep Reinforcemente Leaning Workshop, 2016.
184
+
185
+ Devendra Singh Chaplot, Emilio Parisotto, and Ruslan Salakhutdinov. Active neural localization. ICLR, 2018.
186
+
187
+ Tao Chen, Saurabh Gupta, and Abhinav Gupta. Learning exploration policies for navigation. In ICLR, 2019.
188
+
189
+ Kyunghyun Cho, Bart Van Merriënboer, Dzmitry Bahdanau, and Yoshua Bengio. On the properties of neural machine translation: Encoder-decoder approaches. Eighth Workshop on Syntax, Semantics and Structure in Statistical Translation, 2014.
190
+
191
+ Abhishek Das, Samyak Datta, Georgia Gkioxari, Stefan Lee, Devi Parikh, and Dhruv Batra. Embodied question answering. In CVPR, 2018a.
192
+
193
+ Abhishek Das, Georgia Gkioxari, Stefan Lee, Devi Parikh, and Dhruv Batra. Neural modular control for embodied question answering. In Conference on Robot Learning, pages 53–62, 2018b.
194
+
195
+ Peter Dayan and Geoffrey E Hinton. Feudal reinforcement learning. In Advances in neural information processing systems, pages 271–278, 1993.
196
+
197
+ Christian Dornhege and Alexander Kleiner. A frontier-void-based approach for autonomous exploration in 3d. Advanced Robotics, 27(6):459–468, 2013.
198
+
199
+ Kuan Fang, Alexander Toshev, Li Fei-Fei, and Silvio Savarese. Scene memory transformer for embodied agents in long-horizon tasks. In CVPR, 2019.
200
+
201
+ J. Fuentes-Pacheco, J. Ruiz-Ascencio, and J. M. Rendón-Mancha. Visual simultaneous localization and mapping: a survey. Artificial Intelligence Review, 2015.
202
+
203
+ Daniel Gordon, Aniruddha Kembhavi, Mohammad Rastegari, Joseph Redmon, Dieter Fox, and Ali Farhadi. Iqa: Visual question answering in interactive environments. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4089–4098, 2018.
204
+
205
+ Saurabh Gupta, James Davidson, Sergey Levine, Rahul Sukthankar, and Jitendra Malik. Cognitive mapping and planning for visual navigation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2616–2625, 2017.
206
+
207
+ Richard Hartley and Andrew Zisserman. Multiple view geometry in computer vision. Cambridge university press, 2003.
208
+
209
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016.
210
+
211
+ Joao F Henriques and Andrea Vedaldi. Mapnet: An allocentric spatial memory for mapping environments. In proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 8476–8484, 2018.
212
+
213
+ Dirk Holz, Nicola Basilico, Francesco Amigoni, and Sven Behnke. Evaluating the efficiency of frontier-based exploration strategies. In ISR 2010 (41st International Symposium on Robotics) and ROBOTIK 2010 (6th German Conference on Robotics), pages 1–8. VDE, 2010.
214
+
215
+ Shahram Izadi, David Kim, Otmar Hilliges, David Molyneaux, Richard Newcombe, Pushmeet Kohli, Jamie Shotton, Steve Hodges, Dustin Freeman, Andrew Davison, and Andrew Fitzgibbon. KinectFusion: real-time 3D reconstruction and interaction using a moving depth camera. UIST, 2011.
216
+
217
+ Max Jaderberg, Karen Simonyan, Andrew Zisserman, et al. Spatial transformer networks. In Advances in neural information processing systems, pages 2017–2025, 2015.
218
+
219
+ Thomas Jaksch, Ronald Ortner, and Peter Auer. Near-optimal regret bounds for reinforcement learning. Journal of Machine Learning Research, 11(Apr):1563–1600, 2010.
220
+
221
+ Elia Kaufmann, Mathias Gehrig, Philipp Foehn, René Ranftl, Alexey Dosovitskiy, Vladlen Koltun, and Davide Scaramuzza. Beauty and the beast: Optimal methods meet learning for drone racing. In 2019 International Conference on Robotics and Automation (ICRA), pages 690–696. IEEE, 2019.
222
+
223
+ Lydia E Kavraki, Petr Svestka, J-C Latombe, and Mark H Overmars. Probabilistic roadmaps for path planning in high-dimensional configuration spaces. RA, 1996.
224
+
225
+ Michael Kearns and Satinder Singh. Near-optimal reinforcement learning in polynomial time. Machine learning, 49(2-3):209–232, 2002.
226
+
227
+ Arbaaz Khan, Clark Zhang, Nikolay Atanasov, Konstantinos Karydis, Daniel D Lee, and Vijay Kumar. End-to-end navigation in unknown environments using neural networks. arXiv preprint arXiv:1707.07385, 2017.
228
+
229
+ S. Kohlbrecher, J. Meyer, O. von Stryk, and U. Klingauf. A flexible and scalable slam system with full 3d motion estimation. In Proc. IEEE International Symposium on Safety, Security and Rescue Robotics (SSRR). IEEE, November 2011.
230
+
231
+ Thomas Kollar and Nicholas Roy. Trajectory optimization using reinforcement learning for map exploration. The International Journal of Robotics Research, 27(2):175–196, 2008.
232
+
233
+ Ilya Kostrikov. Pytorch implementations of reinforcement learning algorithms. https://github. com/ikostrikov/pytorch-a2c-ppo-acktr-gail, 2018.
234
+
235
+ Guillaume Lample and Devendra Singh Chaplot. Playing FPS games with deep reinforcement learning. In Thirty-First AAAI Conference on Artificial Intelligence, 2017.
236
+
237
+ Steven M Lavalle and James J Kuffner Jr. Rapidly-exploring random trees: Progress and prospects. In Algorithmic and Computational Robotics: New Directions, 2000.
238
+
239
+ Lisa Lee, Emilio Parisotto, Devendra Singh Chaplot, Eric Xing, and Ruslan Salakhutdinov. Gated path planning networks. In ICML, 2018.
240
+
241
+ Ruben Martinez-Cantin, Nando de Freitas, Eric Brochu, José Castellanos, and Arnaud Doucet. A bayesian exploration-exploitation approach for optimal online sensing and planning with a visually guided mobile robot. Autonomous Robots, 27(2):93–103, 2009.
242
+
243
+ Piotr Mirowski, Razvan Pascanu, Fabio Viola, Hubert Soyer, Andrew J Ballard, Andrea Banino, Misha Denil, Ross Goroshin, Laurent Sifre, Koray Kavukcuoglu, et al. Learning to navigate in complex environments. ICLR, 2017.
244
+
245
+ Raul Mur-Artal and Juan D Tardós. Orb-slam2: An open-source slam system for monocular, stereo, and rgb-d cameras. IEEE Transactions on Robotics, 33(5):1255–1262, 2017.
246
+
247
+ Adithyavairavan Murali, Tao Chen, Kalyan Vasudev Alwala, Dhiraj Gandhi, Lerrel Pinto, Saurabh Gupta, and Abhinav Gupta. Pyrobot: An open-source robotics framework for research and benchmarking. arXiv preprint arXiv:1906.08236, 2019.
248
+
249
+ Richard A Newcombe, Steven J Lovegrove, and Andrew J Davison. Dtam: Dense tracking and mapping in real-time. In 2011 international conference on computer vision, pages 2320–2327. IEEE, 2011.
250
+
251
+ Emilio Parisotto and Ruslan Salakhutdinov. Neural map: Structured memory for deep reinforcement learning. ICLR, 2018.
252
+
253
+ 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. NIPS 2017 Autodiff Workshop, 2017.
254
+
255
+ Andrzej Pronobis and Patric Jensfelt. Large-scale semantic mapping and reasoning with heterogeneous modalities. In 2012 IEEE International Conference on Robotics and Automation, pages 3515–3522. IEEE, 2012.
256
+
257
+ Morgan Quigley, Brian Gerkey, Ken Conley, Josh Faust, Tully Foote, Jeremy Leibs, Eric Berger, Rob Wheeler, and Andrew Ng. Ros: an open-source robot operating system. In Proc. of the IEEE Intl. Conf. on Robotics and Automation (ICRA) Workshop on Open Source Robotics, Kobe, Japan, May 2009.
258
+
259
+ Nikolay Savinov, Alexey Dosovitskiy, and Vladlen Koltun. Semi-parametric topological memory for navigation. In International Conference on Learning Representations (ICLR), 2018.
260
+
261
+ Nikolay Savinov, Anton Raichuk, Raphaël Marinier, Damien Vincent, Marc Pollefeys, Timothy Lillicrap, and Sylvain Gelly. Episodic curiosity through reachability. In ICLR, 2019.
262
+
263
+ Manolis Savva, Abhishek Kadian, Oleksandr Maksymets, Yili Zhao, Erik Wijmans, Bhavana Jain, Julian Straub, Jia Liu, Vladlen Koltun, Jitendra Malik, et al. Habitat: A platform for embodied ai research. In Proceedings of the IEEE International Conference on Computer Vision, pages 9339–9347, 2019.
264
+
265
+ John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
266
+
267
+ James A Sethian. A fast marching level set method for monotonically advancing fronts. Proceedings of the National Academy of Sciences, 93(4):1591–1595, 1996.
268
+
269
+ Shuran Song, Fisher Yu, Andy Zeng, Angel X Chang, Manolis Savva, and Thomas Funkhouser. Semantic scene completion from a single depth image. In CVPR, 2017.
270
+
271
+ Cyrill Stachniss, Giorgio Grisetti, and Wolfram Burgard. Information gain-based exploration using rao-blackwellized particle filters. In Robotics: Science and Systems, volume 2, pages 65–72, 2005.
272
+
273
+ Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, 2018.
274
+
275
+ Richard S Sutton, Doina Precup, and Satinder Singh. Between mdps and semi-mdps: A framework for temporal abstraction in reinforcement learning. Artificial intelligence, 112(1-2):181–211, 1999.
276
+
277
+ Aviv Tamar, Yi Wu, Garrett Thomas, Sergey Levine, and Pieter Abbeel. Value iteration networks. In Advances in Neural Information Processing Systems, pages 2154–2162, 2016.
278
+
279
+ Sebastian Thrun, Wolfram Burgard, and Dieter Fox. Probabilistic robotics. MIT press, 2005.
280
+
281
+ Matthew R Walter, Sachithra Hemachandra, Bianca Homberg, Stefanie Tellex, and Seth Teller. Learning semantic maps from natural language descriptions. In Robotics: Science and Systems, 2013.
282
+
283
+ Fei Xia, Amir R. Zamir, Zhi-Yang He, Alexander Sax, Jitendra Malik, and Silvio Savarese. Gibson Env: real-world perception for embodied agents. In Computer Vision and Pattern Recognition (CVPR), 2018 IEEE Conference on. IEEE, 2018.
284
+
285
+ Kai Xu, Lintao Zheng, Zihao Yan, Guohang Yan, Eugene Zhang, Matthias Niessner, Oliver Deussen, Daniel Cohen-Or, and Hui Huang. Autonomous reconstruction of unknown indoor scenes guided by time-varying tensor fields. ACM Transactions on Graphics (TOG), 36(6):202, 2017.
286
+
287
+ Brian Yamauchi. A frontier-based approach for autonomous exploration. In cira, volume 97, page 146, 1997.
288
+
289
+ Jingwei Zhang, Lei Tai, Joschka Boedecker, Wolfram Burgard, and Ming Liu. Neural slam: Learning to explore with external memory. arXiv preprint arXiv:1706.09520, 2017.
290
+
291
+ Yuke Zhu, Roozbeh Mottaghi, Eric Kolve, Joseph J Lim, Abhinav Gupta, Li Fei-Fei, and Ali Farhadi. Target-driven visual navigation in indoor scenes using deep reinforcement learning. In Robotics and Automation (ICRA), 2017 IEEE International Conference on, pages 3357–3364. IEEE, 2017.
292
+
293
+ Table 3: Performance of the proposed model, Active Neural SLAM (ANS) and all the baselines on the Exploration task. ‘ANS - Task Transfer’ refers to the ANS model transferred to the PointGoal task after training on the Exploration task.
294
+
295
+ <table><tr><td colspan="4"></td><td colspan="2">Domain Generalization</td><td colspan="3">Goal Generalization</td></tr><tr><td></td><td>Test Setting →</td><td>Gibson Val</td><td></td><td>MP3D Test</td><td></td><td>Hard-GEDR</td><td></td><td>Hard-Dist</td></tr><tr><td>Train Task</td><td>Method</td><td>Succ</td><td>SPL</td><td>Succ</td><td>SPL</td><td>Succ SPL</td><td>Succ</td><td> SPL</td></tr><tr><td>PointGoal</td><td>Random</td><td>0.027</td><td>0.021</td><td>0.010</td><td>0.010</td><td>0.000 0.000</td><td>0.000</td><td>0.000</td></tr><tr><td></td><td>RL + Blind</td><td>0.625</td><td>0.421</td><td>0.136</td><td>0.087</td><td>0.052 0.020</td><td>0.008</td><td>0.006</td></tr><tr><td></td><td>RL + 3LConv +GRU</td><td>0.550</td><td>0.406</td><td>0.102</td><td>0.080</td><td>0.072 0.046</td><td>0.006</td><td>0.006</td></tr><tr><td></td><td>RL +Res18+GRU</td><td>0.561</td><td>0.422</td><td>0.160</td><td>0.125</td><td>0.176 0.109</td><td>0.004</td><td>0.003</td></tr><tr><td></td><td>RL +Res18 +GRU+AuxDepth</td><td>0.640</td><td>0.461</td><td>0.189</td><td>0.143</td><td>0.277 0.197</td><td>0.013</td><td>0.011</td></tr><tr><td></td><td>RL+Res18 +GRU+ ProjDepth</td><td>0.614</td><td>0.436</td><td>0.134</td><td>0.111</td><td>0.180 0.129</td><td>0.008</td><td>0.004</td></tr><tr><td></td><td>IL + Res18+GRU</td><td>0.823</td><td>0.725</td><td>0.365</td><td>0.318</td><td>0.682 0.558</td><td>0.359</td><td>0.310</td></tr><tr><td></td><td>CMP</td><td>0.827</td><td>0.730</td><td>0.320</td><td>0.270</td><td>0.670 0.553</td><td>0.369</td><td>0.318</td></tr><tr><td></td><td>ANS</td><td>0.951</td><td>0.848</td><td>0.593</td><td>0.496</td><td>0.824 0.710</td><td>0.662</td><td>0.534</td></tr><tr><td>Exploration</td><td>ANS - Task Transfer</td><td>0.950</td><td>0.846</td><td>0.588</td><td>0.490</td><td>0.821 0.703</td><td>0.665</td><td>0.532</td></tr></table>
296
+
297
+ # A POINTGOAL EXPERIMENTS
298
+
299
+ PointGoal has been the most studied task in recent literature on navigation where the objective is to navigate to a goal location whose relative coordinates are given as input in a limited time budget. We follow the PointGoal task setup from Savva et al. (2019), using train/val/test splits for both Gibson and Matterport datasets. Note that the set of scenes used in each split is disjoint, which means the agent is tested on new scenes never seen during training. Gibson test set is not public but rather held out on an online evaluation server3. We report the performance of our model on the Gibson test set when submitted to the online server but also use the validation set as another test set for extensive comparison and analysis. We do not use the validation set for hyper-parameter tuning.
300
+
301
+ Savva et al. (2019) identify two measures to quantify the difficulty of a PointGoal dataset. The first is the average geodesic distance (distance along the shortest path) to the goal location from the starting location of the agent, and the second is the average geodesic to Euclidean distance ratio (GED ratio). The GED ratio is always greater than or equal to 1, with higher ratios resulting in harder episodes. The train/val/test splits in the Gibson dataset come from the same distribution of having similar average geodesic distance and GED ratio. In order to analyze the performance of the proposed model on out-of-set goal distribution, we create two harder sets, Hard-Dist and Hard-GEDR. In the Hard-Dist set, the geodesic distance to goal is always more than $1 0 \mathrm { m }$ and the average geodesic distance to the goal is $1 3 . 4 8 \mathrm { m }$ as compared to $6 . 9 / 6 . 5 / 7 . 0 \mathrm { m }$ in train/val/test splits (Savva et al., 2019). Hard-GEDR set consists of episodes with an average GED ratio of 2.52 and a minimum GED ratio of 2.0 as compared to average GED ratio 1.37 in the Gibson val set.
302
+
303
+ We also follow the episode specification from Savva et al. (2019). Each episode ends when either the agent takes the stop action or at a maximum of 500 timesteps. An episode is considered a success when the final position of the agent is within $0 . 2 \mathrm { m }$ of the goal location. In addition to Success rate (Succ), we also use Success weighted by (normalized inverse) Path Length or SPL as a metric for evaluation for the PointGoal task as proposed by Anderson et al. (2018).
304
+
305
+ # A.1 POINTGOAL RESULTS
306
+
307
+ In Table 3, we show the performance of the proposed model transferred to the PointGoal task along with the baselines trained on the PointGoal task with the same amount of data (10million frames). The proposed model achieves a success rate/SPL of 0.950/0.846 as compared to 0.827/0.730 for the best baseline model on Gibson val set. We also report the performance of the proposed model trained from scratch on the PointGoal task for 10 million frames. The results indicate that the performance of ANS transferred from Exploration is comparable to ANS trained on PointGoal. This highlights a key advantage of our model. It allows us to transfer the knowledge of obstacle avoidance and control in low-level navigation across tasks, as the Local Policy and Neural SLAM module are task-invariant.
308
+
309
+ Sample efficiency. RL models are typically trained for more than 10 million samples. In order to compare the performance and sample-efficiency, we trained the best performing RL model $[ \mathrm { R L } +$ $\mathrm { R e s 1 8 + G R U + P r o j D e p t h }$ ) for 75 million frames and it achieved a Succ/SPL of 0.678/0.486. ANS reaches the performance of 0.789/0.703 SPL/Succ at only 1 million frames. These numbers indicate that ANS achieves $> 7 5 \times$ speedup as compared to the best RL baseline.
310
+
311
+ ![](images/125f539165ecf987c00d0745b3114a291552b619d4ec5fd407abd5a90e170248.jpg)
312
+ Figure 7: Performance of the proposed ANS model along with CMP and $\mathrm { I L } + \mathrm { R e s 1 8 + G I }$ RU (GRU) baselines with increase in geodesic distance to goal and increase in GED Ratio on the Gibson Val set.
313
+
314
+ ![](images/448b2d88ce33e99167f69134866448cb347cdd5ee381be5723879a436e05a91f.jpg)
315
+ Figure 8: Figure showing sample trajectories of the proposed model along with the predicted map in the PointGoal task. The starting and goal locations are shown by black squares and blue circles, respectively. The ground-truth map is under-laid in grey. Map prediction is overlaid in green, with dark green denoting correct predictions and light green denoting false positives. The blue shaded region shows the explored area prediction. On the left, we show some successful trajectories which indicate that the model is effective at long distance goals with high GED ratio. On the right, we show a failure case due to mapping error.
316
+
317
+ Domain and Goal Generalization: In Table 3 (see shaded region), we evaluate all the baselines and ANS trained on the PointGoal task in the Gibson domain on the test set in Matterport domain as well as the harder goal sets in Gibson. We also transfer ANS trained on Exploration in Gibson on all the 3 sets. The results show that ANS outperforms all the baselines at all generalization sets. Interestingly, RL based methods almost fail completely on the Hard-Dist set. We also analyze the performance of the proposed model as compared to the two best baselines CMP and $\mathrm { I L } + \mathrm { R e s } 1 8 + \mathrm { G R U }$ as a function of geodesic distance to goal and GED ratio in Figure 7. The performance of the baselines drops faster as compared to ANS, especially with the increase in goal distance. This indicates that end-to-end learning methods are effective at short-term navigation but struggle when long-term planning is required to reach a distant goal. In Figure 8, we show some example trajectories of the ANS model along with the predicted map. The successful trajectories indicate that the model exhibits strong backtracking behavior which makes it effective at distant goals requiring long-term planning. Figure 9 visualizes a trajectory in the PointGoal task show first-person observation and corresponding map predictions. Please refer to the project webpage for visualization videos.
318
+
319
+ ![](images/3ee6da52fec18deff15dd2613acba5ba9c0a15c36cfd5e21d96779f911eb4415.jpg)
320
+ Figure 6: Screenshot of CVPR 2019 Habitat Challenge Results. The proposed model was submitted under code-name ‘Arnold’.
321
+
322
+ Habitat Challenge Results. We submitted the ANS model to the CVPR 2019 Habitat Pointgoal Navigation Challenge. The results are shown in Figure 6. ANS was submitted under code-name ‘Arnold’. ANS was the winning entry for both RGB and RGB-D tracks among over 150 submissions from 16 teams, achieving an SPL of 0.805 (RGB) and 0.948 (RGB-D) on the Test Challenge set.
323
+
324
+ # B NOISE MODEL IMPLEMENTATION DETAILS
325
+
326
+ In order to implement the actuation and sensor noise models, we would like to collect data for navigational actions in the Habitat simulator. We use three default navigational actions: Forward:
327
+
328
+ ![](images/284a0ddd76aff9d45adebc1c0417924b802d37437fdd8a990f36ba8c9cb9d790.jpg)
329
+ Figure 9: Pointgoal visualization. Figure showing sample trajectories of the proposed model along with predicted map in the Pointgoal task as the episode progresses. The starting and goal locations are shown by black squares and blue circles, respectively. Ground truth map is under-laid in grey. Map prediction is overlaid in green, with dark green denoting correct predictions and light green denoting false positives. Blue shaded region shows the explored area prediction.
330
+
331
+ move forward by $2 5 \mathrm { c m }$ , Turn Right: on the spot rotation clockwise by 10 degrees, and Turn Left: on the spot rotation counter-clockwise by 10 degrees. The control commands are implemented as $u _ { F o r w a r d } = ( 0 . 2 5 , 0 , 0 )$ , $u _ { R i g h t } : ( 0 , 0 , - 1 0 * \pi / 1 8 0 )$ and $u _ { L e f t } : ( 0 , 0 , 1 0 * \pi / 1 8 0 )$ . In practice, a robot can also rotate slightly while moving forward and translate a bit while rotating on-the-spot, creating rotational actuation noise in forward action and similarly, a translation actuation noise in on-the-spot rotation actions.
332
+
333
+ We use a Locobot 4 to collect data for building the actuation and sensor noise models. We use the pyrobot API (Murali et al., 2019) along with ROS (Quigley et al., 2009) to implement the control commands and get sensor readings. In order to get an accurate agent pose, we use an Hokuyo UST-10LX Scanning Laser Rangefinder (LiDAR) which is especially very precise in our scenario as we take static readings in 2D (Kohlbrecher et al., 2011). We install the LiDAR on the Locobot by replacing the arm with the LiDAR. We note that the Hokuyo UST-10LX Scanning Laser Rangefinder is an expensive sensor. It costs $\$ 1600$ as compared to the whole Locobot costing less than $\$ 2000$ without the arm. Using expensive sensors can improve the performance of a model, however, for a method to be scalable, it should ideally work with cheaper sensors too. In order to demonstrate the scalability of our method, we use the LiDAR only to collect the data for building noise models and not for training or deploying navigation policies in the real-world.
334
+
335
+ For the sensor estimate, we use the Kobuki base odometry available in Locobot. We approximate the LiDAR pose estimate to be the true pose of the agent as it is orders of magnitude more accurate than the base sensor. For each action, we collect 600 datapoints from both the base sensor and the LiDAR, making a total of 3600 datapoints $( 6 0 0 * 3 * 2 )$ ). We use 500 datapoints for each action to fit the actuation and sensor noise models and use the remaining 100 datapoints for validation. For each action $a$ , the LiDAR pose estimates gives us samples of $p _ { 1 }$ and the base sensor readings give us samples of $p _ { 1 } ^ { \prime } , i = 1 , 2 , \ldots , 6 0 0$ . The difference between LiDAR estimates $( p _ { 1 } ^ { i } )$ and control command $( \Delta u _ { a } )$ gives us samples for the actuation noise for the action $a$ : $\epsilon _ { a c t , a } ^ { i } = \bar { p _ { 1 } ^ { i } } - \Delta u _ { a }$ and difference between base sensor readings and LiDAR estimates gives us the samples for the sensor noise, $\epsilon _ { s e n , a } ^ { i } = p _ { 1 } ^ { i ^ { \prime } } - p _ { 1 } ^ { i }$ .
336
+
337
+ For each action $a$ , we fit a separate Gaussian Mixture Model for the actuation noise and sensor noise using samples $\epsilon _ { a c t , a } ^ { i }$ and $\epsilon _ { s e n , a } ^ { i }$ respectively, making a total of 6 models. We fit Gaussian mixture models with the number of components ranging from 1 to 20 for and pick the model with the highest likelihood on the validation set. Each component in these Gaussian mixture models is a multi-variate Gaussian in 3 variables, $x , y$ and $o$ . We implement these actuation and sensor noise models in the Habitat simulator for our experiments.
338
+
339
+ # C NEURAL SLAM MODULE IMPLEMENTATION DETAILS
340
+
341
+ The Neural SLAM module $( f _ { S L A M } )$ takes in the current RGB observation, $s _ { t } \in \mathbb { R } ^ { 3 \times H \times W }$ , the current and last sensor reading of the agent pose $x _ { t - 1 : t } ^ { \prime }$ and the map at the previous time step $m _ { t - 1 } \ \in \ \mathbb { R } ^ { 2 \times M \times M }$ and outputs an updated map, $m _ { t } ~ \in ~ \mathbb { R } ^ { 2 \times M \times M }$ , and the current agent pose estimate, $\hat { x } _ { t }$ (see Figure 2):
342
+
343
+ $$
344
+ m _ { t } , \hat { x } _ { t } = f _ { S L A M } ( s _ { t } , x _ { t - 1 : t } ^ { \prime } , \hat { x } _ { t - 1 } , m _ { t - 1 } | \theta _ { S } , b _ { t - 1 } )
345
+ $$
346
+
347
+ where $\theta _ { S }$ denote the trainable parameters and $b _ { t - 1 }$ denotes internal representations of the Neural SLAM module. The Neural SLAM module can be broken down into two parts, a Mapper $( f _ { M a p } )$ and a Pose Estimator Unit $( f _ { P E } , )$ . The Mapper outputs a egocentric top-down 2D spatial map, $p _ { t } ^ { e g o } \in [ 0 , 1 ] ^ { 2 \times V \times V }$ (where $V$ is the vision range), predicting the obstacles and the explored area in the current observation: $p _ { t } ^ { e g o } = f _ { M a p } ( s _ { t } | \bar { \theta _ { M } } )$ , where $\theta _ { M }$ are the parameters of the Mapper. It consists of Resnet18 convolutional layers to produce an embedding of the observation. This embedding is passed through two fully-connected layers followed by 3 deconvolutional layers to get the first-person top-down 2D spatial map prediction.
348
+
349
+ Now, we would like to add the egocentric map prediction $( p _ { t } ^ { e g o } )$ to the geocentric map from the previous time step $( m _ { t - 1 } )$ . In order to transform the egocentric map to the geocentric frame, we need the pose of the agent in the geocentric frame. The sensor reading $ { \boldsymbol { { x } } } _ { t } ^ { \prime }$ is typically noisy. Thus, we have a Pose Estimator to correct the sensor reading and give an estimate of the agent’s geocentric pose.
350
+
351
+ In order to estimate the pose of the agent, we first calculate the relative pose change $( d x )$ from the last time step using the sensor readings at the current and last time step $( x _ { t - 1 } ^ { \prime } , x _ { t } ^ { \prime } )$ . Then we use a Spatial Transformation (Jaderberg et al., 2015) on the egocentric map prediction at the last frame $( \bar { p } _ { t - 1 } ^ { e g o } )$ based on the relative pose change $( d x )$ , $p _ { t - 1 } ^ { \prime } = \bar { f _ { S T } } ( p _ { t - 1 } ^ { e g o } | d x )$ . Note that the parameters of this Spatial Transformation are not learnt, but calculated using the pose change $( d x )$ . This transforms the projection at the last step to the current egocentric frame of reference. If the sensor was accurate, $p _ { t - 1 } ^ { \prime }$ would highly overlap with $p _ { t } ^ { e g o }$ . The Pose Estimator Unit takes in $p _ { t - 1 } ^ { \prime }$ and $p _ { t } ^ { e g o }$ as input and predicts the relative pose change: $\hat { d x } _ { t } = f _ { P E } ( p _ { t - 1 } ^ { \prime } , p _ { t } ^ { e g o } | \theta _ { P } )$ The intuition is that by looking at the egocentric predictions of the last two frames, the pose estimator can learn to predict the small translation and/or rotation that would align them better. The predicted relative pose change is then added to the last pose estimate to get the final pose estimate $\bar { \hat { x _ { t } } } = \hat { x } _ { t - 1 } + \hat { d x _ { t } }$ .
352
+
353
+ Finally, the egocentric spatial map prediction is transformed to the geocentric frame using the current pose prediction of the agent $( \hat { x } _ { t } )$ using another Spatial Transformation and aggregated with the previous spatial map $( m _ { t - 1 } )$ using Channel-wise Pooling operation: $m _ { t } = m _ { t - 1 } + { \bar { f } } _ { S T } ( p _ { t } ^ { e g o } | { \hat { x _ { t } } } )$ .
354
+
355
+ Combing all the functions and transformations:
356
+
357
+ $$
358
+ \begin{array} { r l } & { m _ { t } , \hat { x } _ { t } = f _ { S L A M } \big ( s _ { t } , x _ { t - 1 : t } ^ { \prime } , m _ { t - 1 } \vert \theta _ { S } , b _ { t - 1 } \big ) } \\ & { \quad p _ { t } ^ { e g o } = f _ { M a p } \big ( s _ { t } \vert \theta _ { M } \big ) } \\ & { \quad \quad \hat { x } _ { t } = \hat { x } _ { t - 1 } + f _ { P E } \big ( f _ { S T } \big ( p _ { t - 1 } ^ { e g o } \vert \hat { x } _ { t - 1 : t } \big ) , p _ { t } ^ { e g o } \vert \theta _ { P } \big ) } \\ & { \quad m _ { t } = m _ { t - 1 } + f _ { S T } \big ( p _ { t } ^ { e g o } \vert \hat { x } _ { t } \big ) } \\ & { \quad \quad \quad \quad \mathrm { w h e r e ~ } \theta _ { M } , \theta _ { P } \in \theta _ { S } , \quad \mathrm { a n d } \quad p _ { t - 1 } ^ { e g o } , \hat { x } _ { t - 1 } \in b _ { t - 1 } } \end{array}
359
+ $$
360
+
361
+ # D ARCHITECTURE DETAILS
362
+
363
+ We use PyTorch (Paszke et al., 2017) for implementing and training our model. The Mapper in the Neural SLAM module consists of ResNet18 convolutional layers followed by 2 fully-connected layers trained with a dropout of 0.5, followed by 3 deconvolutional layers. The Pose Estimator consists of 3 convolutional layers followed by 3 fully connected layers. The Global Policy is a 5 layer convolutional network followed by 3 fully connected layers. We also pass the agent orientation as a separate input (not captured in the map tensor) to the Global Policy. It is processed by an Embedding layer and added as an input to the fully-connected layers. The Local Policy consists of a pretrained ResNet18 convolutional layers followed by fully connected layers and a recurrent GRU layer. In addition to the RGB observation, the Local policy receives relative distance and angle to the short-term goal as input. We bin the relative distance (bin size increasing with distance), relative angle (5 degree bins) and current timestep (30 time step bins) before passing them through embedding layers. This kind of discretization is used previously for RL policies (Lample and Chaplot, 2017; Chaplot and Lample, 2017) and it improved the sample efficiency as compared to passing the continuous values as input directly. For a fair comparison, we use the same discretization for all the baselines as well. The short-term goal is processed using Embedding layers. For the exact architectures of all the modules, please refer to the open-source code.
364
+
365
+ # E HYPERPARAMETER DETAILS
366
+
367
+ We train all the components with 72 parallel threads, with each thread using one of the 72 scenes in the Gibson training set. We maintain a FIFO memory of size 500000 for training the Neural SLAM module. After one step in all the environments (i.e. every 72 steps) we perform 10 updates to the Neural SLAM module with a batch size of 72. We use Adam optimizer with a learning rate of 0.0001. We use binary cross-entropy loss for obstacle map and explored area prediction and MSE Loss for pose prediction (in meters and radians). The obstacle map and explored area loss coefficients are 1 and the pose loss coefficient is 10000 (as MSE loss in meters and radians is much smaller).
368
+
369
+ The Global policy samples a new goal every 25 timesteps. We use Proximal Policy Optimization (PPO) (Schulman et al., 2017) for training the Global policy. Our PPO implementation for the Global Policy is based on Kostrikov (2018). The reward for the Global policy is the increase in coverage in $m ^ { 2 }$ scaled by 0.02. It is trained with 72 parallel threads and a horizon length of 40 steps (40 steps for Global policy is equivalent to 1000 low-level timesteps as Global policy samples a new goal after every 25 timesteps). We use 36 mini-batches and do 4 epochs in each PPO update. We use Adam optimizer with a learning rate of 0.000025, a discount factor of $\gamma = 0 . 9 9$ , an entropy coefficient of 0.001, value loss coefficient of 0.5 for training the Global Policy.
370
+
371
+ The Local Policy is trained using binary cross-entropy loss. We use Adam optimizer with a learning rate of 0.0001 for training the Local Policy.
372
+
373
+ Input frame size is $1 2 8 \times 1 2 8$ , the vision range for the SLAM module is $V = 6 4$ , i.e. $3 . 2 m$ (each cell is $5 c m$ in length). Since there are no parameters dependent on the map size, it can be adaptive. We train with a map size of $M = 4 8 0$ (equivalent to $2 4 m \ r$ ) for training and $M = 9 6 0$ (equivalent to $4 8 m \mathrm { , }$ ) for evaluation. A map of size $4 8 m \times 4 8 m$ is large enough for all scenes in the Gibson val set. The size of the Global Policy input is constant, $G = 2 4 0$ , which means we downscale map by 2 times during training and 4 times during evaluation. All hyperparameters are available in the code.
374
+
375
+ # F ADDITIONAL RESULTS
376
+
377
+ ![](images/40c6b21156c130b7ecc8258710b6b4b78e01ef968459be3306ccd2323ffc3680.jpg)
378
+ Figure 10: Plot showing the absolute Coverage in $m ^ { 2 }$ as the episode progresses for ANS and the baselines on the large and small scenes in the Gibson Val set as well as the overall Gibson Val set.
md/train/Hklso24Kwr/Hklso24Kwr.md ADDED
@@ -0,0 +1,386 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # CONTINUAL LEARNING WITH ADAPTIVE WEIGHTS(CLAW)
2
+
3
+ Tameem Adel
4
+ Department of Engineering, University of Cambridge
5
+ tah47@cam.ac.uk
6
+
7
+ Han Zhao Carnegie Mellon University han.zhao@cs.cmu.edu
8
+
9
+ Richard E. Turner
10
+ Department of Engineering, University of Cambridge
11
+ Microsoft Research
12
+ ret26@cam.ac.uk
13
+
14
+ # ABSTRACT
15
+
16
+ Approaches to continual learning aim to successfully learn a set of related tasks that arrive in an online manner. Recently, several frameworks have been developed which enable deep learning to be deployed in this learning scenario. A key modelling decision is to what extent the architecture should be shared across tasks. On the one hand, separately modelling each task avoids catastrophic forgetting but it does not support transfer learning and leads to large models. On the other hand, rigidly specifying a shared component and a task-specific part enables task transfer and limits the model size, but it is vulnerable to catastrophic forgetting and restricts the form of task-transfer that can occur. Ideally, the network should adaptively identify which parts of the network to share in a data driven way. Here we introduce such an approach called Continual Learning with Adaptive Weights (CLAW), which is based on probabilistic modelling and variational inference. Experiments show that CLAW achieves state-of-the-art performance on six benchmarks in terms of overall continual learning performance, as measured by classification accuracy, and in terms of addressing catastrophic forgetting.
17
+
18
+ # 1 INTRODUCTION
19
+
20
+ Continual learning (CL), sometimes called lifelong or incremental learning, refers to an online framework where the knowledge acquired from learning tasks in the past is kept and accumulated so that it can be reused in the present and future. Data belonging to different tasks could potentially be non i.i.d. (Schlimmer & Fisher, 1986; Sutton & Whitehead, 1993; Ring, 1997; Schmidhuber, 2013; Nguyen et al., 2018; Schmidhuber, 2018). A continual learner must be able to learn a new task, crucially, without forgetting previous tasks (Ring, 1995; Srivastava et al., 2013; Schwarz et al., 2018; Serra et al., 2018; Hu et al., 2019). In addition, CL frameworks should continually adapt to any domain shift occurring across tasks. The learning updates must be incremental – i.e, the model is updated at each task only using the new data and the old model, without access to all previous data (from earlier tasks) – due to speed, security and privacy constraints. A compromise must be found between adapting to new tasks and enforcing stability to preserve knowledge from previous tasks. Excessive adaptation could lead to inadvertent forgetting of how to perform earlier tasks. Indeed, catastrophic forgetting is one of the main pathologies in continual learning (McCloskey & Cohen, 1989; Ratcliff, 1990; Robins, 1993; 1995; French, 1999; Pape et al., 2011; Goodfellow et al., 2014a; Achille et al., 2018; Kemker et al., 2018; Kemker & Kanan, 2018; Diaz-Rodriguez et al., 2018; Zeno et al., 2018; Ahn et al., 2019; Parisi et al., 2019; Pfulb & Gepperth, 2019; Rajasegaran et al., 2019).
21
+
22
+ Many approaches to continual learning employ an architecture which is divided a priori into (i) a slowly evolving, global part; and (ii) a quickly evolving, task-specific, local part. This is one way to enable multi-task transfer whilst mitigating catastrophic forgetting, which has proven to be effective (Rusu et al., 2016b; Fernando et al., 2017; Yoon et al., 2018), albeit with limitations. Specifying a priori the shared global, and task-specific local parts in the architecture restricts flexibility. As more complex and heterogeneous tasks are considered, one would like a more flexible, data-driven approach to determine the appropriate amount of sharing across tasks. Here, we aim at automating the architecture adaptation process so that each neuron of the network can either be kept intact, i.e. acting as global, or adapted to the new task locally. Our proposed variational inference framework is flexible enough to learn the range within which the adaptation parameters can vary. We introduce for each neuron one binary parameter controlling whether or not to adapt, and two parameters to control the magnitude of adaptation. All parameters are learnt via variational inference. We introduce our framework as an expansion of the variational continual learning algorithm (Nguyen et al., 2018), whose variational and sequential Bayesian nature makes it convenient for our modelling and architecture adaptation procedure. Our modelling ideas can also be applied to other continual learning frameworks, see the Appendix for a brief discussion.
23
+
24
+ We highlight the following contributions: (1) A modelling framework which flexibly automates the adaptation of local and global parts of the (multi-task) continual architecture. This optimizes the tradeoff between mitigating catastrophic forgetting and improving task transfer. (2) A probabilistic variational inference algorithm which supports incremental updates with adaptively learned parameters. (3) The ability to combine our modelling and inference approaches without any significant augmentation of the architecture (no new neurons are needed). (4) State-of-the-art results in six experiments on five datasets, which demonstrate the effectiveness of our framework in terms of overall accuracy and reducing catastrophic forgetting.
25
+
26
+ # 2 BACKGROUND ON VARIATIONAL CONTINUAL LEARNING (VCL)
27
+
28
+ In this paper, we use Variational Continual Learning (VCL, Nguyen et al., 2018) as the underlying continual learning framework. However, our methods apply to other frameworks, see Appendix (Section A.1). VCL is a variational Bayesian framework where the posterior of the model parameters $\pmb \theta$ is learnt and updated continually from a sequence of $T$ datasets, $\{ \pmb { x } _ { t } ^ { ( n ) } , \pmb { y } _ { t } ^ { ( n ) } \} _ { n = 1 } ^ { N _ { t } }$ } tn=1 , where $t =$ $1 , 2 , \ldots , T$ and $N _ { t }$ is the size of the dataset associated with the $t$ -th task. More specifically, denote by $p ( \pmb { y } | \pmb { \theta } , \pmb { x } )$ the probability distribution returned by a discriminative classifier with input $_ { \textbf { \em x } }$ , output $\textbf { { y } }$ and parameters $\pmb { \theta }$ . For $\mathcal { D } _ { t } = \{ \pmb { y } _ { t } ^ { ( n ) } \} _ { n = 1 } ^ { N _ { t } }$ , we approximate the intractable posterior $p ( \pmb { \theta } | \mathcal { D } _ { 1 : t } )$ after observing the first $t$ datasets via a tractable variational distribution $q _ { t }$ as:1
29
+
30
+ $$
31
+ \mathbf { q } _ { t } ( \pmb \theta ) \approx \frac { 1 } { Z _ { t } } \mathbf { q } _ { t - 1 } ( \pmb \theta ) p ( \mathcal { D } _ { t } | \pmb \theta ) ,
32
+ $$
33
+
34
+ where ${ \bf q } _ { 0 }$ is the prior $p$ , $\begin{array} { r } { p ( \mathcal { D } _ { t } | \pmb { \theta } ) = \prod _ { n = 1 } ^ { N _ { t } } p ( \pmb { y } _ { t } ^ { ( n ) } | \pmb { \theta } , \pmb { x } _ { t } ^ { ( n ) } ) } \end{array}$ , and $Z _ { t }$ is the normalizing constant which does not depend on $\pmb \theta$ but only on the data $\mathcal { D }$ . This framework allows the approximate posterior $\mathbf { q } _ { t } ( \pmb { \theta } )$ to be updated incrementally from the previous approximate posterior $\mathbf { q } _ { t - 1 } ( \pmb { \theta } )$ in an online fashion. In VCL, the approximation in (1) is performed by minimizing the following KL-divergence over a family $\mathcal { Q }$ of tractable distributions:
35
+
36
+ $$
37
+ \mathbf { q } _ { t } ( \pmb \theta ) = \underset { \mathbf { q } \in \mathcal { Q } } { \mathrm { a r g m i n } } \mathrm { K L } \Big ( \mathbf { q } ( \pmb \theta ) \parallel \frac { 1 } { Z _ { t } } \mathbf { q } _ { t - 1 } ( \pmb \theta ) p ( \mathcal { D } _ { t } | \pmb \theta ) \Big ) .
38
+ $$
39
+
40
+ This framework can be enhanced to further mitigate catastrophic forgetting by using a coreset (Nguyen et al., 2018), i.e. a representative set of data from previously observed tasks that can serve as memory and can be revisited before making a decision. As discussed in the Related Work, this leads to overhead costs of memory and optimisation (selecting most representative data points). Previous work on VCL considered simple models without automatic architecture building or adaptation.
41
+
42
+ # 3 OUR CLAW APPROACH
43
+
44
+ In earlier CL approaches, the parts of the network architecture that are shared among the learnt tasks are designated a priori. To alleviate this rigidity and to effectively balance adaptation and stability, we propose a multi-task, continual model in which the adaptation of the architecture is data-driven by learning which neurons need to be adapted as well as the maximum adaptation capacity for each. All the model parameters (including those used for adaptation) are estimated via an efficient variational inference algorithm which incrementally learns from data of the successive tasks, without a need to store (nor generate) data from previous tasks and with no expansion in the network size.
45
+
46
+ # 3.1 MODELLING
47
+
48
+ With model parameters $\pmb \theta$ , the overall variational objective we aim at maximising at task with index t is equivalent to the following online marginal likelihood:
49
+
50
+ $$
51
+ \mathcal { L } ( \pmb { \theta } ) = - \mathrm { K L } \Big ( \mathbf { q } _ { t } ( \pmb { \theta } ) \| \mathbf { q } _ { t - 1 } ( \pmb { \theta } ) \Big ) + \sum _ { n = 1 } ^ { N _ { t } } \mathbb { E } _ { \mathbf { q } _ { t } ( \pmb { \theta } ) } \big [ \log p ( \pmb { y } ^ { ( n ) } | \pmb { x } ^ { ( n ) } , \pmb { \theta } ) \big ] .
52
+ $$
53
+
54
+ We propose a framework where the architecture, whose parameters are $\pmb \theta$ , is flexibly adapted based on the available tasks, via a learning procedure that will be described below. With each task, we automate the adaptation of the neuron contributions. Both the adaptation decisions (i.e. whether or not to adapt) and the maximum allowed degree of adaptation for every neuron are learnt. We refer to the binary adaptation variable as $_ \alpha$ . There is another variable s that is learnt in a multi-task fashion to control the maximum degree of adaptation, such that the expression s1+e−a − 1 limits how far the task-specific weights can differ from the global weights, in case the respective neuron is to be adapted. The parameter a depicts unconstrained adaptation, as described later.2
55
+
56
+ We illustrate the proposed model to perform this adaptation by learning the probabilistic contributions of the different neurons within the network architecture on a task-by-task basis. We follow this with the inference details. Steps of the proposed modeling are listed as follows:
57
+
58
+ • For a task $T$ , the classifier that we are modeling outputs: $\begin{array} { r } { \sum _ { n = 1 } ^ { N _ { T } } \left[ \log p ( \pmb { y } ^ { ( n ) } | \pmb { x } ^ { ( n ) } , \mathbf { w } ^ { T } ) \right] . } \end{array}$ • The task-specific weights $\mathbf { w } ^ { T }$ can be expressed in terms of their global counterparts as follows:
59
+
60
+ $$
61
+ \mathbf { w } ^ { T } = ( 1 + \mathbf { b } ^ { T } \pmb { \alpha } ^ { T } ) \circ \mathbf { w } .
62
+ $$
63
+
64
+ The symbol $\circ$ denotes an element-wise (Hadamard) multiplication.
65
+
66
+ • For each task $T$ and each neuron $\mathbf { j }$ at layer i, $\alpha _ { \mathrm { i , j } } ^ { T }$ is a binary variable which indicates whether the corresponding weight is adapted $( \alpha _ { \mathbf { i } , \mathbf { j } } ^ { T } = 1 )$ ) or unadapted $( \alpha _ { \mathbf { i } , \mathbf { j } } ^ { T } = 0 )$ . Initially assume that the adaptation probability $\alpha _ { \mathrm { i , j } } ^ { T }$ follows a Bernoulli distribution with probability $\mathbf { p _ { i , j } } ^ { 3 }$ , $\alpha _ { \mathrm { i , j } } ^ { T } \sim$ Bernoulli . Since this Bernoulli is not straightforward to optimise, and to adopt a scalable inference procedure based on continuous latent variables, we replace this Bernoulli with a Gaussian that has an equivalent mean and variance from which we draw $\alpha _ { \mathrm { i , j } } ^ { T }$ . For the sake of attaining higher fidelity than what is granted by a standard Gaussian, we base our inference on a variational Gaussian estimation. Though in a context different from continual learning and with different estimators, the idea of replacing Bernoulli with an equivalent Gaussian has proven to be effective with dropout (Srivastava et al., 2014; Kingma et al., 2015).
67
+
68
+ The approximation of the Bernoulli distribution by the corresponding Gaussian distribution is achieved by matching the mean and variance. The mean and variance of the Bernoulli distribution are $\mathbf { p _ { i , j } }$ , $\mathbf { p _ { i , j } } ( 1 - \mathbf { p _ { i , j } } )$ , respectively. A Gaussian distribution with the same mean and variance is used to fit αTi,j.
69
+
70
+ $$
71
+ \alpha _ { \mathbf { i } , \mathbf { j } } ^ { T } \sim \mathcal { N } ( \mathbf { p } _ { \mathbf { i } , \mathbf { j } } , \mathbf { p } _ { \mathbf { i } , \mathbf { j } } ( 1 - \mathbf { p } _ { \mathbf { i } , \mathbf { j } } ) ) .
72
+ $$
73
+
74
+ • The variable $\mathbf { b } ^ { T }$ controls the strength of the adaptation and it limits the range of adaptation via:
75
+
76
+ $$
77
+ 1 + \mathbf { b } ^ { T } = \frac { \mathbf { s } } { 1 + \mathrm { e } ^ { - \mathbf { a } ^ { T } } } .
78
+ $$
79
+
80
+ So that the maximum adaptation is s. The variable $\mathbf { a } ^ { T }$ is an unconstrained adaptation value, similar to that in (Swietojanski & Renals, 2014). The addition of 1 is to facilitate the usage of a probability distribution while still keeping an adaptation range allowing for the attenuation or amplification of each neuron’s contribution.
81
+
82
+ • Before facing the first dataset and learning task $\mathbf { t } = 1$ , the prior on the weights ${ \bf q } _ { 0 } ( { \bf w } ) = { \bf p } ( { \bf w } )$ is chosen to be a log-scale prior, which can be expressed as: $\mathbf { p } ( \log | \mathbf { w } | ) \propto \mathbf { c }$ , where $\mathbf { c }$ is a constant. The log-scale prior can alternatively be described as:
83
+
84
+ $$
85
+ \mathbf { p } ( | \mathbf { w } | ) \propto \frac { 1 } { | \mathbf { w } | } .
86
+ $$
87
+
88
+ At a high level, adapting neuron contributions can be seen as a generalisation of attention mechanisms in the context of continual learning. Applying this adaptation procedure to the input leads to an attention mechanism. However, our approach is more general since we do not apply it only to the very bottom (i.e. input) layer, but throughout the whole network. We next show how our variational inference mechanism enables us to learn the adaptation parameters.
89
+
90
+ # 3.2 INFERENCE
91
+
92
+ We describe the details related to the proposed variational inference mechanism. The adaptation parameters are included within the variational parameters.
93
+
94
+ The (unadapted version of the) model parameters $\pmb \theta$ consist of the weight vectors w. To automate adaptation, we perform inference on $\mathbf { p _ { i , j } }$ , which would have otherwise been a hyperparameter of the prior (Louizos et al., 2017; Molchanov et al., 2017; Ghosh et al., 2018). Multiplying w by $\left( 1 + \mathbf { b } \alpha \right)$ where $_ { \pmb { \alpha } }$ is distributed according to (5), then from (4) with random noise variable $\mathbf { \epsilon } \sim \mathcal { N } ( 0 , 1 )$ :
95
+
96
+ $$
97
+ \begin{array} { r } { \mathbf { w _ { i , j } ^ { T } } = \gamma _ { \mathbf { i , j } } \left( 1 + \mathbf { b _ { i , j } } \mathbf { p _ { i , j } } + \mathbf { b _ { i , j } } \sqrt { \mathbf { p _ { i , j } } ( 1 - \mathbf { p _ { i , j } } ) } \epsilon \right) , } \\ { \mathbf { q ( w _ { i , j } } \mid \gamma _ { \mathbf { i , j } } ) \sim \mathcal { N } \biggl ( \gamma _ { \mathbf { i , j } } ( 1 + \mathbf { b _ { i , j } } \mathbf { p _ { i , j } } ) , \mathbf { b _ { i , j } ^ { 2 } } \gamma _ { \mathbf { i , j } } ^ { 2 } \mathbf { p _ { i , j } } ( 1 - \mathbf { p _ { i , j } } ) \biggr ) . } \end{array}
98
+ $$
99
+
100
+ From (7) and (8), the corresponding KL-divergence between the variational posterior of $\mathbf { w }$ , $\mathbf { q } ( \mathbf { w } | \gamma )$ and the prior $\mathbf { p } ( \mathbf { w } )$ is as follows. The subscripts are removed when $\mathbf { q }$ in turn is used as a subscript for improved readability. The variational parameters are $\gamma _ { \mathrm { i , j } }$ and $\mathbf { p _ { i , j } }$ .
101
+
102
+ $$
103
+ \begin{array} { r l } & { \mathrm { K L } \Big ( \mathbf { q } ( \mathbf { w } _ { \mathrm { i } , \mathrm { j } } | \gamma _ { \mathrm { i } , \mathrm { j } } ) \ \lVert \ \mathbf { p } ( \mathbf { w } _ { \mathrm { i } , \mathrm { j } } ) \Big ) = \mathbb { E } _ { \mathbf { q } ( \mathbf { w } | \gamma ) } \log [ \mathbf { q } ( \mathbf { w } _ { \mathrm { i } , \mathrm { j } } | \gamma _ { \mathrm { i } , \mathrm { j } } ) / \mathbf { p } ( \mathbf { w } _ { \mathrm { i } , \mathrm { j } } ) ] = } \\ & { \mathbb { E } _ { \mathbf { q } ( \mathbf { w } | \gamma ) } \log \mathbf { q } ( \mathbf { w } _ { \mathrm { i } , \mathrm { j } } | \gamma _ { \mathrm { i } , \mathrm { j } } ) - \mathbb { E } _ { \mathbf { q } ( \mathbf { w } | \gamma ) } \log \mathbf { p } ( \mathbf { w } _ { \mathrm { i } , \mathrm { j } } ) = - \mathbf { H } ( \mathbf { q } ( \mathbf { w } _ { \mathrm { i } , \mathrm { j } } | \gamma _ { \mathrm { i } , \mathrm { j } } ) ) - \mathbb { E } _ { \mathbf { q } ( \mathbf { w } | \gamma ) } \log \mathbf { p } ( \mathbf { w } _ { \mathrm { i } , \mathrm { j } } ) } \\ & { = - 0 . 5 \Big ( 1 + \log ( 2 \pi ) + \log ( \mathbf { b } _ { \mathrm { i } , \mathrm { j } } ^ { 2 } \mathbf { p } _ { \mathrm { i } , \mathrm { j } } ( 1 - \mathbf { p } _ { \mathrm { i } , \mathrm { j } } ) ) \Big ) - \mathbb { E } _ { \mathbf { q } ( \mathbf { w } | \gamma ) } \log \frac { 1 } { \lvert \epsilon \rvert } } \\ & { = - \log \mathbf { b } _ { \mathrm { i } , \mathrm { j } } - 0 . 5 \log \mathbf { p } _ { \mathrm { i } , \mathrm { j } } - 0 . 5 \log ( 1 - \mathbf { p } _ { \mathrm { i } , \mathrm { j } } ) + \mathbf { c } + \mathbb { E } _ { \mathbf { q } ( \mathbf { w } _ { \mathrm { i } , \mathrm { j } } ) } \log \vert \epsilon \vert , } \end{array}
104
+ $$
105
+
106
+ where the switch from (9) to (10) is due to the entropy computation (Bernardo & Smith, 2000) of the Gaussian $\bf q ( w _ { i , j } | \gamma _ { i , j } )$ defined in (8). The switch from (10) to (11) is due to using a log-scale prior, similar to Appendix C in (Kingma et al., 2015) and to Section 4.2 in (Molchanov et al., 2017). $\mathbb { E } _ { \mathbf { q } ( \mathbf { w } \mid \gamma ) } \log | \boldsymbol { \epsilon } |$ is computed via an accurate approximation similar to equation (14) in (Molchanov et al., 2017), with slightly different values of $k _ { 1 }$ , $k _ { 2 }$ and $k _ { 3 }$ . This is a very close approximation via numerically pre-computing $\mathbb { E } _ { \mathbf { q } ( \mathbf { w } \mid \gamma ) } \log | \boldsymbol { \epsilon } |$ using a third degree polynomial (Kingma et al., 2015; Molchanov et al., 2017).
107
+
108
+ This is the form of the KL-divergence between the approximate posterior after the first task and the prior. Afterwards, it is straightforward to see how this KL-divergence applies for the subsequent tasks in a manner similar to (2), but while taking into account the new posterior form and original prior.
109
+
110
+ The KL-divergence expression derived in (11) is to be minimised. By minimising (11) with respect to $\mathbf { p _ { i , j } }$ and then using samples from the respective distributions to assign values to $\alpha _ { \mathrm { { i , j } } }$ , adapted contributions of each neuron j at each layer i of the network are learnt per task. Values of $\mathbf { p _ { i , j } }$ are constrained between 0 and 1 during training via projected gradient descent.
111
+
112
+ # Algorithm 1 Continual Learning with Adaptive Weights (CLAW)
113
+
114
+ Input: A sequence of $T$ datasets, $\{ \pmb { x } _ { t } ^ { ( n ) } , \pmb { y } _ { t } ^ { ( n ) } \} _ { n = 1 } ^ { N _ { t } }$ , where $t = 1 , 2 , \dots , T$ and $N _ { t }$ is the size of the dataset associated with the $t$ -th task.
115
+
116
+ Output: $\mathbf { q } _ { t } ( \pmb { \theta } )$ , where $\pmb \theta$ are the model parameters. Initialise all $\bf { p } ( | \mathbf { w _ { i , j } } | )$ with a log-scale prior, as in (7). for $t = 1 \dots T$ do Disclose the dataset $\{ \pmb { x } _ { t } ^ { ( n ) } , \pmb { y } _ { t } ^ { ( n ) } \} _ { n = 1 } ^ { N _ { t } }$ y(n)t }Ntn=1 for the current task t. for $\mathbf { i } = 1 \ldots \#$ layers do for $\mathbf { j } = 1 \ldots \#$ neurons at layer i do Compute $\mathbf { p _ { i , j } }$ using stochastic gradient descent on (11). Compute $\bf { s _ { i , j , t } }$ using (13). Update the corresponding general value $\mathbf { s _ { i , j } }$ using (14). end for end for end for
117
+
118
+ # 3.2.1 LEARNING THE MAXIMUM ADAPTATION VALUES
119
+
120
+ Using (6) to express the value of $\mathbf { b _ { i , j } }$ , and neglecting the constant term therein since it does not affect the optimisation, the KL-divergence in (11) is equivalent to:
121
+
122
+ $$
123
+ \begin{array} { r l } & { \mathrm { K L } \Big ( \mathbf { q } ( \mathbf { w _ { i , j } } | \gamma _ { \mathrm { i , j } } ) \ | \ \mathbf { p } ( \mathbf { w _ { i , j } } ) \Big ) \approx } \\ & { \mathrm { ~ - l o g ~ } \mathbf { s _ { i , j } } + \log ( 1 + \mathrm { e ^ { - \mathbf { a _ { i , j } } } } ) - 0 . 5 \log \mathbf { p _ { i , j } } - 0 . 5 \log ( 1 - \mathbf { p _ { i , j } } ) + \mathbf { c } + \mathbb { E } _ { \mathbf { q } ( \mathbf { w } / \gamma ) } \log | \epsilon | . } \end{array}
124
+ $$
125
+
126
+ Values of $\mathbf { a _ { i , j } }$ are learnt by minimising (12) with respect to $\mathbf { a _ { i , j } }$ . This subsection explains how to learn the maximum adaptation variable $\mathbf { s _ { i , j } }$ . Values of the maximum $\mathbf { s _ { i , j } }$ of the logistic function defined in (6) are learnt from multiple tasks. For each neuron $\mathbf { j }$ at layer i, there is a general value $\mathbf { s _ { i , j } }$ and another value that is specific for each task t, referred to as $\bf { s _ { i , j , t } }$ . This is similar to the meta-learning procedure proposed in (Finn et al., 2017). The following procedure to learn s is performed for each task t such that: (i) the optimisation performed to learn a task-specific value $\bf { s _ { i , j , t } }$ benefits from the warm initialisation with the general value $\mathbf { s _ { i , j } }$ rather than a random initial condition; and then (ii) the new information obtained from the current task $\mathbf { t }$ is reflected back to update the general value $\mathbf { s _ { i , j } }$ .
127
+
128
+ • First divide the sample $N _ { \mathbf { t } }$ into two halves. For the first half, depart from the general value of $\mathbf { s _ { i , j } }$ as an initial condition, and use the assigned data examples from task $\mathbf { t }$ to learn the taskspecific values $\begin{array} { r } { \sum _ { n = 1 } ^ { N _ { t } } \mathbb { E } _ { \mathbf { q } _ { t } ( \theta ) } \big [ \log p ( \pmb { y } ^ { ( n ) } | \pmb { x } ^ { ( n ) } , \pmb { \theta } ) \big ] } \end{array}$ $\bf { s _ { i , j , t } }$ for the current task t. For neuron j at layer i, refer to the second term in (3), as $\mathbf { f } _ { t } ( \pmb { x } , \pmb { y } , \mathbf { s _ { i , j } } )$ . The set of parameters $\pmb \theta$ contains s as well as other parameters, but we focus here on s in the f notation since the following procedure is developed to optimise s. Also, refer to the loss of the (classification) function f as $\mathbf { E r r ( f ) } = \mathbf { C E } ( \mathbf { f } ( \pmb { x } , \theta ) | | \pmb { y } )$ , where CE stands for the cross-entropy:
129
+
130
+ $$
131
+ \mathbf { s _ { i , j , t } } = \mathbf { s _ { i , j } } - \frac { 2 \omega _ { 1 } } { N _ { t } } \nabla _ { \mathbf { s _ { i , j } } } \sum _ { d = 1 } ^ { N _ { t } / 2 } \mathbf { E r r } ( \mathbf { f } _ { t } ( x _ { d } , y _ { d } , \mathbf { s _ { i , j } } ) ) .
132
+ $$
133
+
134
+ • Now use the second half of the data from task $\mathbf { t }$ to update the general learnt value $\mathbf { s _ { i , j } }$ :
135
+
136
+ $$
137
+ \mathbf { s _ { i , j } } = \mathbf { s _ { i , j } } - \frac { 2 \omega _ { 2 } } { N _ { t } } \nabla _ { \mathbf { s _ { i , j } } } \sum _ { d = 1 + N _ { t } / 2 } ^ { N _ { t } } \mathbf { E r r } \big ( \mathbf { f } _ { t } ( x _ { d } , y _ { d } , \mathbf { s } _ { i , j , t } ) \big ) .
138
+ $$
139
+
140
+ Where $\omega _ { 1 }$ and $\omega _ { 2 }$ are step-size parameters.
141
+
142
+ When testing on samples from task t after having faced future tasks $\mathbf { t } + 1 , \mathbf { t } + 2 , \ldots$ , the value of $\mathbf { s _ { i , j } }$ used is the learnt $\bf { s _ { i , j , t } }$ . There is only one value per neuron, so the overhead resulting from storing such values is negligible. The key steps of the algorithm are listed in Algorithm 1.
143
+
144
+ At task t, the algorithmic complexity of a single joint update of the parameters $\pmb \theta$ based on the additive terms in (12) is $O ( M \bar { E } L D ^ { 2 } )$ , where $L$ is the number of layers in the network, $D$ is the
145
+
146
+ (largest) number of neurons within a single layer, $E$ is the number of samples taken from the random noise variable $\epsilon$ , and $M$ is the minibatch size. Each $_ { \pmb { \alpha } }$ is obtained by taking one sample from the corresponding $\mathbf { p }$ , so that does not result in an overhead in terms of the complexity.
147
+
148
+ # 4 EXPERIMENTS
149
+
150
+ Our experiments mainly aim at evaluating the following: (i) the overall performance of the introduced CLAW, depicted by the average classification accuracy over all the tasks; (ii) the extent to which catastrophic forgetting can be mitigated when deploying CLAW; and (iii) the achieved degree of positive forward transfer. The experiments demonstrate the effectiveness of CLAW in achieving state-of-the-art continual learning results measured by classification accuracy and by the achieved reduction in catastrophic forgetting. We also perform ablations in Section D in the Appendix which exhibit the relevance of each of the proposed adaptation parameters.
151
+
152
+ We perform six experiments on five datasets. The datasets in use are: MNIST (LeCun et al., 1998), notMNIST (Butalov, 2011), Fashion-MNIST (Xiao et al., 2017), Omniglot (Lake et al., 2011) and CIFAR-100 (Krizhevsky & Hinton, 2009). We compare the results obtained by CLAW to six different state-of-the-art continual learning algorithms: the VCL algorithm (Nguyen et al., 2018) (original form and one with a coreset), the elastic weight consolidation (EWC) algorithm (Kirkpatrick et al., 2017), the progress and compress (P&C) algorithm (Schwarz et al., 2018), the reinforced continual learning (RCL) algorithm (Xu & Zhu, 2018), the one referred to as functional regularisation for continual learning (FRCL) using Gaussian processes (Titsias et al., 2019) and the learn-to-grow (LTG) algorithm (Li et al., 2019b).
153
+
154
+ # 4.1 OVERALL CLASSIFICATION ACCURACY
155
+
156
+ Our main metric is the all-important classification accuracy. We consider six continual learning experiments, based on the MNIST, notMNIST, Fashion-MNIST, Omniglot and CIFAR-100 datasets. The introduced CLAW is compared to two VCL versions: VCL with no coreset and VCL with a 200-point coreset assembled by the K-center method (Nguyen et al., 2018), EWC, P&C, RCL, FRCL (its TR version) and LTG4. All the reported classification accuracy values reflect the average classification accuracy over all tasks the learner has trained on so far. More specifically, assume that the continual learner has just finished training on a task $t$ , then the reported classification accuracy at time $t$ is the average accuracy value obtained from testing on equally sized sets each belonging to one of the tasks 1, 2, . . . , t. For all the classification experiments, statistics reported are averages of ten repetitions. Statistical significance and standard error of the average classification accuracy obtained after completing the last two tasks of each experiment are displayed in Section E in the Appendix.
157
+
158
+ As can be seen in Figure 1, CLAW achieves state-of-the-art classification accuracy in all the six experiments. The minibatch size is 128 for Split MNIST and 256 for all the other experiments. More detailed descriptions of the results of every experiment are given next:
159
+
160
+ Permuted MNIST Using MNIST, Permuted MNIST is a standard continual learning benchmark (Goodfellow et al., 2014a; Kirkpatrick et al., 2017; Zenke et al., 2017). For each task $t$ , the corresponding dataset is formed by performing a fixed random permutation process on labeled MNIST images. This random permutation is unique per task, i.e. it differs for each task. For the hyperparameter $\lambda$ of EWC, which controls the overall contribution from previous data, we experimented with two values, $\lambda = 1$ and $\lambda = 1 0 0$ . We report the latter since it has always outperformed EWC with $\lambda = 1$ in this experiment. EWC with $\lambda = 1 0 0$ has also previously produced the best EWC classification results (Nguyen et al., 2018). In this experiment, fully connected single-head networks with two hidden layers are used. There are 100 hidden units in each layer, with ReLU activations. Adam (Kingma & Ba, 2015) is the optimiser used in the 6 experiments with $\eta = 0 . 0 0 1$ , $\beta _ { 1 } = 0 . 9$ and $\beta _ { 2 } = 0 . 9 9 9$ . Further experimental details are given in Section C in the Appendix. Results of the accumulated classification accuracy, averaged over tasks, on a test set are displayed in Figure 1a. After 10 tasks, CLAW achieves significantly (check the Appendix) higher classification results than all the competitors.
161
+
162
+ Split MNIST In this MNIST based experiment, five binary classification tasks are processed in the following sequence: 0/1, 2/3, 4/5, 6/7, and 8/9 (Zenke et al., 2017). The architecture used consists of fully connected multi-head networks with two hidden layers, each consisting of 256 hidden units with ReLU activations. As can be seen in Figure 1b, CLAW achieves the highest classification accuracy.
163
+
164
+ Split notMNIST It contains 400,000 training images, and the classes are 10 characters, from A to J. Each image consists of one character, and there are different font styles. The five binary classification tasks are: A/F, B/G, C/H, D/I, and E/J. The networks used here contain four hidden layers, each containing 150 hidden units with ReLU activations. CLAW achieves a clear improvement in classification accuracy over competitors (Figure 1c).
165
+
166
+ Split Fashion-MNIST Fashion-MNIST is a dataset whose size is the same as MNIST but it is based on different (and more challenging) 10 classes. The five binary classification tasks here are: T-shirt/Trouser, Pullover/Dress, Coat/Sandals, Shirt/Sneaker, and Bag/Ankle boots. The architecture used is the same as in Split notMNIST. In most of the continual learning tasks (including the more significant, later ones) CLAW achieves a clear classification improvement (Figure 1d).
167
+
168
+ Omniglot This is a sequential learning task of handwritten characters of 50 alphabets (a total of over 1,600 characters with 20 examples each) belonging to the Omniglot dataset (Lake et al., 2011). We follow the same way via which this task has been used in continual learning before (Schwarz et al., 2018; Titsias et al., 2019); handwritten characters from each alphabet constitute a separate task. We thus have 50 tasks, which also allows to evaluate the scalability of the frameworks in comparison. The model used is a CNN. To deal with the convolutions in CLAW, we used the idea proposed and referred to as the local reparameterisation trick by Kingma et al. (2014; 2015), where a single global parameter is employed per neuron activation in the variational distribution, rather than employing parameters for every constituent weight element5. Further details about the CNN used are given in Section C. The automatically adaptable CLAW achieves better classification accuracy (Figure 1e).
169
+
170
+ CIFAR-100 This dataset consists of 60,000 colour images of size $3 2 \times 3 2$ . It contains 100 classes, with 600 images per class. We use a split version CIFAR-100. Similar to Lopez-Paz & Ranzato (2017), we perform a 20-task experiment with a disjoint subset of five classes per task. CLAW achieves significantly higher classification accuracy (Figure 1f) -also higher than the previous state of the art on CIFAR-100 by Kemker & Kanan (2018). Details of the used CNN are in Section C.
171
+
172
+ A conclusion that can be taken from Figure 1(a-f) is that CLAW consistently achieves state-of-the-art results (in all the 6 experiments). It can also be seen that CLAW scales well. For instance, the difference between CLAW and the best competitor is more significant with Split notMNIST than it is with the first two experiments, which are based on the smaller and less challenging MNIST. Also, CLAW achieves good results with Omniglot and CIFAR-100.
173
+
174
+ # 4.2 CATASTROPHIC FORGETTING
175
+
176
+ To assess catastrophic forgetting, we show how the accuracy on the initial task varies over the course of the training procedure on the remaining tasks (Schwarz et al., 2018). Since Omniglot (and CIFAR-100) contain a larger number of tasks: 50 (20) tasks, i.e. 49 (19) remaining tasks after the initial task, this setting is more relevant for Omniglot and CIFAR-100. We nonetheless display the results for Split MNIST, Split notMNIST, Split Fashion-MNIST, Omniglot and CIFAR-100. As can be seen in Figure 2, CLAW (at times jointly) achieves state-of-the-art performance retention degrees. Among the competitors, P&C and LTG also achieve high performance retention degrees.
177
+
178
+ An empirical conclusion that can be made out of this and the previous experiment, is that CLAW achieves better overall continual learning results, partially thanks to the way it addresses catastrophic forgetting. The idea of adapting the architecture by adapting the contributions of neurons of each layer also seems to be working well with datasets like Omniglot and CIFAR-100, giving directions for imminent future work where CLAW can be extended for other application areas based on CNNs.
179
+
180
+ # 4.3 POSITIVE FORWARD TRANSFER
181
+
182
+ The purpose of this experiment is to assess the impact of learning previous tasks on the current task. In other words, we want to evaluate whether an algorithm avoids negative transfer, by evaluating the
183
+
184
+ ![](images/e6ecdbe7d4c10b405132eb4e476925e2418df12a452749b89c23a32ad002e39e.jpg)
185
+ Figure 1: Average test classification accuracy vs. the number of observed tasks in 6 experiments. CLAW achieves significantly higher classification results than the competing continual learning frameworks. Statistical significance values are presented in Section E in the Appendix. The value of $\lambda$ for EWC is 10,000 in (c), and 100 in the other experiments. Best viewed in colour.
186
+
187
+ relative performance achieved on a unique task after learning a varying number of previous tasks (Schwarz et al., 2018). From Figure 3, we can see that CLAW achieves state-of-the-art results in 4 out of the 5 experiments (at par in the fifth) in terms of avoiding negative transfer.
188
+
189
+ ![](images/24bd99e22d08dd9ec2da8a8ae8c5091dc1b6f98f35803912905b538e304ea87b.jpg)
190
+ Figure 2: Evaluating catastrophic forgetting by measuring performance retention. Classification accuracy of the initial task is monitored along with the progression of tasks. Results are displayed for five datasets. CLAW is the least forgetful algorithm since performance levels achieved on the initial task do not degrade as much as in the other methods after facing new tasks. The legend and $\lambda$ values for EWC are the same as in Figure 1. Best viewed in colour.
191
+
192
+ ![](images/d854c8d0f2de31beb1e016c16efbae916c70049a0b38f49e1594338cf9599b38.jpg)
193
+ Figure 3: Evaluating Forward transfer, or to what extent a continual learning framework can avoid negative transfer. The impact of learning previous tasks on a specific task (the last task) is inspected and used as a proxy for evaluating forward transfer. This is performed by evaluating the relative performance achieved on a unique task after learning a varying number of previous tasks. This means that the value at $\mathbf { X } { \cdot } \mathbf { a } \mathbf { X } \mathbf { i } \mathbf { s } = 1$ refers to the learning accuracy of the last task after having learnt solely one task (only itself), the value at 2 refers to the learning accuracy of the last task after having learnt two tasks (an additional previous task), etc. Overall, CLAW achieves state-of-the-art results in 4 out of the 5 experiments (at par in the fifth) in terms of avoiding negative transfer. Best viewed in colour.
194
+
195
+ # 5 RELATED WORK
196
+
197
+ We briefly discuss three related approaches to continual learning: (a) regularisation-based, (b) architecture-based and (c) memory-based. We provide more details of related work in Section A in the Appendix. (a) A complementary approach to CLAW is the regularisation-based approach to balance adaptability with catastrophic forgetting: a level of stability is kept via protecting parameters that greatly influence the prediction against radical changes, while allowing the rest of the parameters to change without restriction (Li & Hoiem, 2016; Lee et al., 2017; Zenke et al., 2017; Chaudhry et al., 2018; Kim et al., 2018; Nguyen et al., 2018; Srivastava et al., 2013; Schwarz et al., 2018; Vuorio et al., 2018; Aljundi et al., 2019c). The elastic weight consolidation (EWC) algorithm by Kirkpatrick et al. (2017) is a seminal example, where a quadratic penalty is imposed on the difference between parameter values of the old and new tasks. One limitation is the high level of hand tuning required. (b) The architecture-based approach aims to deal with stability and adaptation issues by a fixed division of the architecture into global and local parts (Rusu et al., 2016b; Fernando et al., 2017; Shin et al., 2017; Kaplanis et al., 2018; Xu & Zhu, 2018; Yoon et al., 2018; Li et al., 2019b). (c) The memory-based approach relies on episodic memory to store data (or pseudo-data) from previous tasks (Ratcliff, 1990; Robins, 1993; 1995; Thrun, 1996; Schmidhuber, 2013; Hattori, 2014; Mocanu et al., 2016; Rebuffi et al., 2017; Kamra et al., 2017; Shin et al., 2017; Rolnick et al., 2018; van de Ven & Tolias, 2018; Wu et al., 2018; Titsias et al., 2019). Limitations include overheads for tasks such as data storage, replay, and optimisation to select (or generate) the points. CLAW can as well be seen as a combination of a regularisation-based approach (the variational inference mechanism) and a modelling approach which automates the architecture building process in a data-driven manner, avoiding the overhead resulting from either storing or generating data points from previous tasks. CLAW is also orthogonal to (and simple to combine with, if needed) memory-based methods.
198
+
199
+ # 6 CONCLUSION
200
+
201
+ We introduced a continual learning framework which learns how to adapt its architecture from the tasks and data at hand, based on variational inference. Rather than rigidly dividing the architecture into shared and task-specific parts, our approach adapts the contributions of each neuron. We achieve that without having to expand the architecture with new layers or new neurons. Results of six different experiments on five datasets demonstrate the strong empirical performance of the introduced framework, in terms of the average overall continual learning accuracy and forward transfer, and also in terms of effectively alleviating catastrophic forgetting.
202
+
203
+ # ACKNOWLEDGMENTS
204
+
205
+ HZ acknowledges support from the DARPA XAI project, contract#FA87501720152 and an Nvidia GPU grant. RT acknowledges support by Google, Amazon, Improbable and EPSRC grants EP/M0269571 and EP/L000776/1.
206
+
207
+ # REFERENCES
208
+
209
+ A. Achille, T. Eccles, L. Matthey, C. Burgess, N. Watters, A. Lerchner, and I. Higgins. Life-long disentangled representation learning with cross-domain latent homologies. Advances in neural information processing systems (NIPS), 2018.
210
+ Tameem Adel, Han Zhao, and Alexander Wong. Unsupervised domain adaptation with a relaxed covariate shift assumption. In Thirty-First AAAI Conference on Artificial Intelligence, 2017.
211
+ H. Ahn, D. Lee, S. Cha, and T. Moon. Uncertainty-based continual learning with adaptive regularization. arXiv preprint arXiv:1905.11614, 2019.
212
+ R. Aljundi, L. Caccia, E. Belilovsky, M. Caccia, M. Lin, L. Charlin, and T. Tuytelaars. Online continual learning with maximally interfered retrieval. Advances in neural information processing systems (NeurIPS), 2019a.
213
+ R. Aljundi, M. Lin, B. Goujaud, and Y. Bengio. Gradient based sample selection for online continual learning. Advances in neural information processing systems (NeurIPS), 2019b.
214
+ R. Aljundi, M. Rohrbach, and T. Tuytelaars. Selfless sequential learning. International Conference on Learning Representations (ICLR), 2019c.
215
+ B. Bakker and T. Heskes. Task clustering and gating for Bayesian multitask learning. Journal of Machine Learning Research (JMLR), 4:83–99, 2003.
216
+ J. Bernardo and A. Smith. Bayesian theory. John Wiley & Sons, 2000.
217
+ Y. Butalov. The notMNIST dataset. http://yaroslavvb.com/upload/notMNIST/, 2011.
218
+ G. Carpenter and S. Grossberg. A massively parallel architecture for a self-organizing neural pattern recognition machine. Computer vision, graphics, and image processing, 37:54–115, 1987.
219
+ R. Caruana. Multi-task learning. Machine Learning, 1997.
220
+ A. Chaudhry, P. Dokania, T. Ajanthan, and P. Torr. Riemannian walk for incremental learning: Understanding forgetting and intransigence. arXiv preprint arXiv:1801.10112, 2018.
221
+ E. Choi, K. Lee, and K. Choi. Autoencoder-based incremental class learning without retraining on old data. arXiv preprint arXiv:1907.07872, 2019.
222
+ N. Diaz-Rodriguez, V. Lomonaco, D. Filliat, and D. Maltoni. Don’t forget, there is more than forgetting: new metrics for Continual Learning. NIPS Continual Learning Workshop, 2018.
223
+ X. Du, G. Charan, F. Liu, and Y. Cao. Single-net continual learning with progressive segmented training (PST). arXiv preprint arXiv:1905.11550, 2019.
224
+ S. Ebrahimi, M. Elhoseiny, T. Darrell, and M. Rohrbach. Uncertainty-guided continual learning with Bayesian neural networks. arXiv preprint arXiv:1906.02425, 2019.
225
+ C. Fernando, D. Banarse, C. Blundell, Y. Zwols, D. Ha, A. Rusu, A. Pritzel, and D. Wierstra. PathNet: Evolution channels gradient descent in super neural networks. arXiv preprint arXiv:1701.08734, 2017.
226
+ C. Finn, P. Abbeel, and S. Levine. Model-agnostic meta-learning for fast adaptation of deep networks. International Conference on Machine Learning (ICML), 2017.
227
+ R. French. Catastrophic forgetting in connectionist networks. Trends in cognitive sciences, 3:128–135, 1999.
228
+ S. Ghosh, J. Yao, and F. Doshi-Velez. Structured variational learning of Bayesian neural networks with horseshoe priors. International Conference on Machine Learning (ICML), 2018.
229
+ I. Goodfellow. NIPS 2016 tutorial: Generative adversarial networks. arXiv preprint arXiv:1701.00160, 2016.
230
+ I. Goodfellow, D. Warde-Farley, M. Mirza, A. Courville, and Y. Bengio. Maxout networks. International Conference on Machine Learning (ICML), 2013.
231
+ I. Goodfellow, M. Mirza, D. Xiao, A. Courville, and Y. Bengio. An empirical investigation of catastrophic forgetting in gradient-based neural networks. International Conference on Learning Representations (ICLR), 2014a.
232
+ I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial nets. Advances in neural information processing systems (NIPS), pp. 2672–2680, 2014b.
233
+ M. Hattori. A biologically inspired dual-network memory model for reduction of catastrophic forgetting. Neurocomputing, 134:262–268, 2014.
234
+ X. He, J. Sygnowski, A. Galashov, A. Rusu, Y. Whye Teh, and R. Pascanu. Task agnostic continual learning via meta learning. arXiv preprint arXiv:1906.05201, 2019.
235
+ T. Heskes. Empirical Bayes for learning to learn. 2000.
236
+ W. Hu, Z. Lin, B. Liu, C. Tao, Z. Tao, J. Ma, D. Zhao, and R. Yan. Overcoming catastrophic forgetting via model adaptation. International Conference on Learning Representations (ICLR), 2019.
237
+ D. Isele and A. Cosgun. Selective experience replay for lifelong learning. arXiv preprint arXiv:1802.10269, 2018.
238
+ K. Javed and M. White. Meta-learning representations for continual learning. Advances in neural information processing systems (NeurIPS), 2019.
239
+ H. Jung, J. Ju, M. Jung, and J. Kim. Less-forgetting learning in deep neural networks. arXiv preprint arXiv:1607.00122, 2016.
240
+ N. Kamra, U. Gupta, and Y. Liu. Deep generative dual memory network for continual learning. arXiv preprint arXiv:1710.10368, 2017.
241
+ C. Kaplanis, M. Shanahan, and C. Clopath. Continual reinforcement learning with complex synapses. International Conference on Machine Learning (ICML), 2018.
242
+ R. Kemker and C. Kanan. FearNet: Brain-inspired model for incremental learnings. International Conference on Learning Representations (ICLR), 2018.
243
+ R. Kemker, M. McClure, A. Abitino, T. Hayes, and C. Kanan. Measuring catastrophic forgetting in neural networks. AAAI Conference on Artificial Intelligence, 32, 2018.
244
+ D. Kim, J. Bae, Y. Jo, and J. Choi. Incremental learning with maximum entropy regularization: Rethinking forgetting and intransigence. arXiv preprint arXiv:1902.00829, 2019.
245
+ H. Kim, S. Kim, and J. Lee. Keep and learn: Continual learning by constraining the latent space for knowledge preservation in neural networks. MICCAI, 2018.
246
+ D. Kingma and J. Ba. Adam: A Method for Stochastic Optimization. International Conference on Learning Representations (ICLR), 2015.
247
+
248
+ D. Kingma, D. Rezende, S. Mohamed, and M. Welling. Semi-supervised learning with deep generative models. Advances in neural information processing systems (NIPS), 28:3581–3589, 2014.
249
+
250
+ D. Kingma, T. Salimans, and M. Welling. Variational dropout and the local reparameterization trick. Advances in neural information processing systems (NIPS), pp. 2575–2583, 2015.
251
+
252
+ J. Kirkpatrick, R. Pascanu, N. Rabinowitz, J. Veness, G. Desjardins, A. Rusu, K. Milan, J. Quan, T. Ramalho, A. Grabska-Barwinska, D. Hassabis, C. Clopath, D. Kumaran, and R. Hadsell. Overcoming catastrophic forgetting in neural networks. Proceedings of the National Academy of Sciences (PNAS), 2017.
253
+
254
+ A. Krizhevsky and G. Hinton. Learning multiple layers of features from tiny images. Technical Report, University of Toronto, 2009.
255
+
256
+ B. Lake, R. Salakhutdinov, J. Gross, and J. Tenenbaum. One shot learning of simple visual concepts. Proceedings of the Cognitive Science Society, 33, 2011.
257
+
258
+ Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. In Proceedings of the IEEE, 86(11):2278–2324, 1998.
259
+
260
+ S. Lee, J. Kim, J. Jun, J. Ha, and B. Zhang. Overcoming catastrophic forgetting by incremental moment matching. Advances in neural information processing systems (NIPS), 2017.
261
+
262
+ H. Li, S. Enshaeifar, F. Ganz, and P. Barnaghi. Continual learning in deep neural network by using a Kalman optimiser. ICML Workshop, 2019a.
263
+
264
+ X. Li, Y. Zhou, T. Wu, R. Socher, and C. Xiong. Learn to grow: A continual structure learning framework for overcoming catastrophic forgetting. International Conference on Machine Learning (ICML), 2019b.
265
+
266
+ Z. Li and D. Hoiem. Learning without forgetting. European Conference on Computer Vision (ECCV), 2016.
267
+
268
+ M. Lin, J. Fu, and Y. Bengio. Conditional computation for continual learning. NIPS Continual Learning Workshop, 2018.
269
+
270
+ D. Lopez-Paz and M. Ranzato. Gradient episodic memory for continual learning. Advances in neural information processing systems (NIPS), 2017.
271
+
272
+ C. Louizos, K. Ullrich, and M. Welling. Bayesian compression for deep learning. Advances in neural information processing systems (NIPS), pp. 3288–3298, 2017.
273
+
274
+ M. McCloskey and N. Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. Psychology of Learning and Motivation, 1989.
275
+
276
+ D. Mocanu, M. Vega, E. Eaton, P. Stone, and A. Liotta. Online contrastive divergence with generative replay: Experience replay without storing data. arXiv preprint arXiv:1610.05555, 2016.
277
+
278
+ D. Molchanov, A. Ashukha, and D. Vetrov. Variational dropout sparsifies deep neural networks. International Conference on Machine Learning (ICML), pp. 2498–2507, 2017.
279
+
280
+ C. Nguyen, Y. Li, T. Bui, and R. Turner. Variational continual learning. International Conference on Learning Representations (ICLR), 2018.
281
+
282
+ O. Ostapenko, M. Puscas, T. Klein, P. Jahnichen, and M. Nabi. Learning to remember: A synaptic plasticity driven framework for continual learning. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019.
283
+
284
+ L. Pape, F. Gomez, M. Ring, and J. Schmidhuber. Modular deep belief networks that do not forget. IEEE International Joint Conference on Neural Networks (IJCNN), 2011.
285
+
286
+ G. Parisi, R. Kemker, J. Part, C. Kanan, and S. Wermter. Continual lifelong learning with neural networks: A review. Neural Networks, 2019.
287
+
288
+ D. Park, S. Hong, B. Han, and K. Lee. Continual learning by asymmetric loss approximation with single-side overestimation. arXiv preprint arXiv:1908.02984, 2019.
289
+ B. Pfulb and A. Gepperth. A comprehensive, application-oriented study of catastrophic forgetting in DNNs. International Conference on Learning Representations (ICLR), 2019.
290
+ J. Rajasegaran, M. Hayat, S. Khan, F. Khan, and L. Shao. Random path selection for incremental learning. Advances in neural information processing systems (NeurIPS), 2019.
291
+ R. Ratcliff. Connectionist models of recognition memory: Constraints imposed by learning and forgetting functions. Psychological Review, 1990.
292
+ S. Rebuffi, A. Kolesnikov, G. Sperl, and C. Lampert. iCaRL: Incremental classifier and representation learning. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017.
293
+ M. Riemer, I. Cases, R. Ajemian, M. Liu, I.Rish, Y. Tu, and G. Tesauro. Learning to learn without forgetting by maximizing transfer and minimizing interference. International Conference on Learning Representations (ICLR), 2019.
294
+ M. Ring. Continual learning in reinforcement environments. PhD thesis, University of Texas, Austin, 1995.
295
+ M. Ring. CHILD: A first step towards continual learning. Machine Learning, 1997.
296
+ A. Robins. Catastrophic forgetting in neural networks: The role of rehearsal mechanisms. IEEE Artificial Neural Networks and Expert Systems, pp. 65–68, 1993.
297
+ A. Robins. Catastrophic forgetting, rehearsal and pseudorehearsal. Connection Science, 7:123–146, 1995.
298
+ D. Rolnick, A. Ahuja, J. Schwarz, T. Lillicrap, and G. Wayne. Experience replay for continual learning. arXiv preprint arXiv:1811.11682, 2018.
299
+ A. Rusu, N. Rabinowitz, G. Desjardins, H. Soyer, J. Kirkpatrick, K. Kavukcuoglu, R. Pascanu, and R. Hadsell. Progressive neural networks. arXiv preprint arXiv:1606.04671, 2016a.
300
+ A. Rusu, M. Vecerik, T. Rothoerl, N. Heess, R. Pascanu, and R. Hadsell. Sim-to-Real robot learning from pixels with progressive nets. arXiv preprint arXiv:1610.04286, 2016b.
301
+ J. Schlimmer and D. Fisher. A case study of incremental concept induction. The National Conference on Artificial Intelligence, 1986.
302
+ J. Schmidhuber. Powerplay: Training an increasingly general problem solver by continually searching for the simplest still unsolvable problem. Frontiers in psychology, 4, 2013.
303
+ J. Schmidhuber. One big net for everything. arXiv preprint arXiv:1802.08864, 2018.
304
+ J. Schwarz, J. Luketina, W. Czarnecki, A. Grabska-Barwinska, Y. Whye Teh, R. Pascanu, and R. Hadsell. Progress & compress: A scalable framework for continual learning. International Conference on Machine Learning (ICML), 2018.
305
+ J. Serra, D. Suris, M. Miron, and A. Karatzoglou. Overcoming catastrophic forgetting with hard attention to the task. International Conference on Machine Learning (ICML), 2018.
306
+ H. Shin, J. Lee, J. Kim, and J. Kim. Continual learning with deep generative replay. Advances in neural information processing systems (NIPS), 2017.
307
+ N. Srivastava, G. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. Journal of Machine Learning Research (JMLR), 15: 1929–1958, 2014.
308
+ R. Srivastava, J. Masci, S. Kazerounian, F. Gomez, and J. Schmidhuber. Compete to compute. Advances in neural information processing systems (NIPS), 2013.
309
+ A. Stickland and I. Murray. BERT and PALs: Projected attention layers for efficient adaptation in multi-task learning. International Conference on Machine Learning (ICML), 2019.
310
+ R. Sutton and S. Whitehead. Online learning with random representations. International Conference on Machine Learning (ICML), 1993.
311
+ P. Swietojanski and S. Renals. Learning hidden unit contributions for unsupervised speaker adaptation of neural network acoustic models. IEEE Spoken Language Technology Workshop (SLT), 2014.
312
+ D. Teng and S. Dasgupta. Continual learning via online leverage score sampling. arXiv preprint arXiv:1908.00355, 2019.
313
+ S. Thrun. Explanation-based neural network learning: A lifelong learning approach. Springer Science & Business Media, 357, 1996.
314
+ M. Titsias, J. Schwarz, A. Matthews, R. Pascanu, and Y. Whye Teh. Functional regularisation for continual learning using Gaussian processes. arXiv preprint arXiv:1901.11356, 2019.
315
+ G. van de Ven and A. Tolias. Generative replay with feedback connections as a general strategy for continual learning. arXiv preprint arXiv:1809.10635, 2018.
316
+ R. Vuorio, D. Cho, D. Kim, and J. Kim. Meta continual learning. arXiv preprint arXiv:1806.06928, 2018.
317
+ C. Wu, L. Herranz, X. Liu, Y. Wang, J. van de Weijer, and B. Raducanu. Memory replay GANs: Learning to generate new categories without forgetting. Advances in neural information processing systems (NIPS), 2018.
318
+ H. Xiao, K. Rasul, and R. Vollgraf. Fashion-MNIST: a novel image dataset for benchmarking machine learning algorithms. arXiv preprint arXiv:1708.07747, 2017.
319
+ J. Xu and Z. Zhu. Reinforced continual learning. Advances in neural information processing systems (NIPS), 2018.
320
+ J. Xu, J. Ma, and Z. Zhu. Bayesian Optimized Continual Learning with Attention Mechanism. arXiv preprint arXiv:1905.03980, 2019.
321
+ J. Yoon, E. Yang, J. Lee, and S. Hwang. Lifelong learning with dynamically expandable networks. International Conference on Learning Representations (ICLR), 2018.
322
+ J. Yoon, S. Kim, E. Yang, and S. Hwang. ORACLE: Order robust adaptive continual learning. arXiv preprint arXiv:1902.09432, 2019.
323
+ F. Zenke, B. Poole, and S. Ganguli. Continual learning through synaptic intelligence. International Conference on Machine Learning (ICML), 2017.
324
+ C. Zeno, I. Golan, E. Hoffer, and D. Soudry. Task agnostic continual learning using online variational Bayes. NIPS Bayesian Deep Learning Workshop, 2018.
325
+ Han Zhao, Otilia Stretcu, Alex Smola, and Geoff Gordon. Efficient multitask feature and relationship learning. In Proceedings of the Thirty-Fifth Conference on Uncertainty in Artificial Intelligence. AUAI Press, 2019a.
326
+ Han Zhao, Yao-Hung Hubert Tsai, Ruslan Salakhutdinov, and Geoffrey J Gordon. Learning neural networks with adaptive regularization. In Advances in Neural Information Processing Systems, 2019b.
327
+
328
+ # APPENDIX
329
+
330
+ We begin by briefly summarising the contents of the Appendix below:
331
+
332
+ • Related works are described in Section A, followed by a brief discussion on the potential applicability of CLAW to another continual learning (CL) framework in Section A.1.
333
+ • In Section E, we provide the statistical significance and standard error of the average classification accuracy results obtained after completing the last two tasks from each experiment.
334
+ • Further experimental details are given in Section C.
335
+ • In Section D and Figures 4a- 4e, we display the results of performed ablations which manifest the relevance of each adaptation parameter.
336
+
337
+ # A MORE RELATED WORK
338
+
339
+ A complementary approach to CLAW, which could be combined with it, is the regularisation-based approach to balance adaptability with catastrophic forgetting: a level of stability is kept via protecting parameters that greatly influence the prediction against radical changes, while allowing the rest of the parameters to change without restriction (Li & Hoiem, 2016; Vuorio et al., 2018). In (Zenke et al., 2017), the regulariser is based on synapses where an importance measure is locally computed at each synapse during training, based on their respective contributions to the change in the global loss. During a task change, the less important synapses are given the freedom to change whereas catastrophic forgetting is avoided by preventing the important synapses from changing (Zenke et al., 2017). The elastic weight consolidation (EWC) algorithm, introduced by Kirkpatrick et al. (2017), is a seminal example of this approach where a quadratic penalty is imposed on the difference between parameter values of the old and new tasks. One limitation of EWC, which is rather alleviated by using minibatch or stochastic estimates, appears when the output space is not low-dimensional, since the diagonal of the Fisher information matrix over parameters of the old task must be computed, which requires a summation over all possible output labels (Kirkpatrick et al., 2017; Zenke et al., 2017; Schwarz et al., 2018). In addition, the regularisation term involves a sum over all previous tasks with a term from each and a hand-tuned hyperparameter that alters the weight given to it. The accumulation of this leads to a lot of hand-tuning. The work in (Chaudhry et al., 2018) is based on penalising confident fitting to the uncertain knowledge by a maximum entropy regulariser.
340
+
341
+ Another seminal algorithm based on regularisation, which can be applied to any model, is variational continual learning (VCL) (Nguyen et al., 2018) which formulates CL as a sequential approximate (variational) inference problem. However, VCL has only been applied to simple architectures, not involving any automatic model building or adaptation. The framework in (Lee et al., 2017) incrementally matches the moments of the posterior of a Bayesian neural network that has been trained on the first and then the second task, and so on. Other algorithms pursue regularisation approaches based on sparsity (Srivastava et al., 2013; Kim et al., 2018). For example, the work in (Aljundi et al., 2019c) encourages sparsity on the neuron activations to alleviate catastrophic forgetting. The $l _ { 2 }$ distance between the top hidden activations of the old and new tasks is used for regularisation in (Jung et al., 2016). This approach has achieved good results, but is computationally expensive due to the necessity of computing at least a forward pass for every new data point through the network representing the old task (Zenke et al., 2017). Other regularisation-based continual learning algorithms include (Ebrahimi et al., 2019; Park et al., 2019).
342
+
343
+ Another approach is the architecture-based one where the principal aim is to administer both the stability and adaptation issues via dividing the architecture into reusable parts that are less prone to changes, and other parts especially devoted to individual tasks (Rusu et al., 2016b; Fernando et al., 2017; Yoon et al., 2018; Du et al., 2019; He et al., 2019; Li et al., 2019a; Xu et al., 2019). To learn a new task in the work by Rusu et al. (2016a), the whole network from the previous task is first copied then augmented with a new part of the architecture. Although this is effective in eradicating catastrophic forgetting, there is a clear scalability issue since the architecture growth can be prohibitively high, especially with an increasing number of tasks. The work introduced in (Li et al., 2019b) bases its continual learning on neural architecture search, whereas the representation in (Javed & White, 2019) is optimised such that online updates minimize the error on all samples while limiting forgetting. The framework proposed by Xu & Zhu (2018) interestingly aims at solving this neural architecture structure learning problem, while balancing the tradeoff between adaptation and stability, via designed reinforcement learning (RL) strategies. When facing a new task, the optimal number of neurons and filters to add to each layer is cast as a combinatorial optimisation problem solved by an RL strategy whose reward signal is a function of validation accuracy and network complexity. Another RL based framework is the one presented by Kaplanis et al. (2018) where catastrophic forgetting is mitigated at multiple time scales via RL agents with a synaptic model inspired by neuroscience. Bottom layers (those near the input) are generally shared among the different tasks, while layers near the output are task-specific. Since the model structure is usually divided a priori and no automatic architecture learning nor adaptation takes place, alteration on the shared layers can still cause performance loss on earlier tasks due to forgetting (Shin et al., 2017). A clipped version of maxout networks (Goodfellow et al., 2013) is developed in (Lin et al., 2018) where parameters are partially shared among examples. The method in (Ostapenko et al., 2019) is based a dynamic network expansion accomplished by a generative adversarial network.
344
+
345
+ The memory-based approach, which is the third influential approach to address the adaptationcatastrophic forgetting tradeoff, relies on episodic memory to store data (or pseudodata) from previous tasks (Ratcliff, 1990; Robins, 1993; 1995; Hattori, 2014; Rolnick et al., 2018; Teng & Dasgupta, 2019). A major limitation of the memory-based approach is that data from previous tasks may not be available in all real-world problems (Shin et al., 2017; Choi et al., 2019). Another limitation is the overhead resulting from the memory requirements, e.g. storage, replay, etc. In addition, the optimisation required to select the best observation to replay for future tasks is a source of further overhead (Titsias et al., 2019). In addition to the explicit replay form, some works have been based on generative replay (Thrun, 1996; Schmidhuber, 2013; Mocanu et al., 2016; Rebuffi et al., 2017; Kamra et al., 2017; Shin et al., 2017; van de Ven & Tolias, 2018; Wu et al., 2018). Notably, Shin et al. (2017) train a deep generative model based on generative adversarial networks (GANs, Goodfellow et al., 2014b; Goodfellow, 2016) to mimic past data. This mitigates the aforementioned problem, albeit at the added cost of the training of the generative model (Schwarz et al., 2018) and sharing its parameters. Alleviating catastrophic forgetting via replay mechanisms has also been adopted in reinforcement learning, e.g. (Isele & Cosgun, 2018; Rolnick et al., 2018). A similar approach was introduced by Lopez-Paz & Ranzato (2017) where gradients of the previous task (rather than data examples) are stored so that a trust region consisting of gradients of all previous tasks can be formed to reduce forgetting. Other algorithms based on replay mechanisms include (Aljundi et al., 2019a;b).
346
+
347
+ Equivalent tradeoffs to the one between adaptation and stability can be found in the literature since the work in (Carpenter & Grossberg, 1987), in which a balance was needed to resolve the stabilityplasticity dilemma, where the latter refers to the ability to rapidly adapt to new tasks. The works introduced in (Chaudhry et al., 2018; Kim et al., 2019) shed light on the tradeoff between adaptation and stability, where they explore measures of intransigence and forgetting. The former refers to the inability to adapt to new tasks and data, whereas an increase in the latter clearly signifies an instability problem. Other recent works tackling the same tradeoff include (Riemer et al., 2019) where the transfer-interference (interference is catastrophic forgetting) tradeoff is optimised for the sake of maximising transfer and minimising interference by an algorithm based on experience replay and meta-learning. Other recent algorithms include the ORACLE algorithm by Yoon et al. (2019), which addresses the sensitivity of a continual learner to the order of tasks it encounters by establishing an order robust learner that represents the parameters of each task as a sum of task-shared and task-specific parameters. The algorithm in (Titsias et al., 2019) achieves functional regularisation by performing approximate inference over the function (instead of parameter) space. They use a Gaussian process obtained by assuming the weights of the last neural network layer to be Gaussian distributed. Our model is also related to the multi-task learning approach (Caruana, 1997; Heskes, 2000; Bakker & Heskes, 2003; Adel et al., 2017; Zhao et al., 2019a; Stickland & Murray, 2019; Zhao et al., 2019b).
348
+
349
+ # A.1 APPLICABILITY OF CLAW TO OTHER CL FRAMEWORKS
350
+
351
+ As mentioned in the main document, ideas of the proposed CLAW can be applied to continual learning frameworks other than VCL. The latter is more relevant for the inference part of CLAW since both are based on variational inference. As per the modeling ideas, e.g. the binary adaptation parameter depicting whether or not to adapt, and the maximum allowed adaptation, these can be integrated within other continual learning frameworks. For example, the algorithm in Xu & Zhu (2018) utilises reinforcement learning to adaptively expand the network. The optimal number of nodes and filters to be added is cast as a combinatorial optimisation problem. In CLAW, we do not expand the network. As such, an extension of the work in (Xu & Zhu, 2018) can be inspired by CLAW where not only the number of nodes and filters to be added is decided for each task, but also a soft and more general version where an adaptation based on the same network size is performed such that the network expansion needed in (Xu & Zhu, 2018) can be further moderated.
352
+
353
+ # B STATISTICAL SIGNIFICANCE AND STANDARD ERROR
354
+
355
+ In this section, we provide information about the statistical significance and standard error of CLAW and the competing continual learning frameworks. In Table 1, we list the average accuracy values (Figure 1 in the main document) obtained after completing the last two tasks from each of the six experiments. A bold entry in Table 1 denotes that the classification accuracy of an algorithm is significantly higher than its competitors. Significance results are identified using a paired t-test with $\mathrm { p = 0 . 0 5 }$ . Each average accuracy value is followed by the corresponding standard error. Average classification accuracy resulting from CLAW is significantly higher than its competitors on the 6 experiments.
356
+
357
+ Table 1: Average test classification accuracy of the last two tasks in each of the six experiments: Permuted MNIST, Split MNIST, Split notMNIST, Split Fashion-MNIST, Omniglot and CIFAR-100, followed by the corresponding standard error. A bold entry denotes that the classification accuracy of an algorithm is significantly higher than its competitors. Significance results are identified using a paired t-test with $\mathrm { p = 0 . 0 5 }$ . Average classification accuracy resulting from CLAW is significantly higher than its competitors on the 6 experiments.
358
+
359
+ <table><tr><td>Classification Accuracy</td><td>CLAW</td><td>VCL</td><td>VCL +Coreset</td><td>EWC</td></tr><tr><td>Permuted MNIST (task 9) Permuted MNIST (task 10) Split MNIST (task 4) Split MNIST (task 5) Split notMNIST (task 4) Split notMNIST (task 5) Split Fashion-MNIST (task 4) Split Fashion-MNIST (task 5) Omniglot (task 49)</td><td>99.2 ± 0.2 % 99.2 ± 0.1 % 99.2 ± 0.2 % 99.1 ± 0.2 % 98.7 ± 0.3 % 98.4 ± 0.2 % 93.2 ± 0.2 % 92.5 ± 0.2 % 84.5 ± 0.2 % 84.6 ± 0.3 %</td><td>93.5 ± 0.3 % 92.1 ± 0.3 % 98.6 ± 0.3 % 97.0 ± 0.4 % 95.8 ± 0.4 % 92.1 ± 0.3 % 90.0 ± 0.3 % 88.0 ± 0.2 % 81.1 ± 0.3 % 80.7 ± 0.3 %</td><td>95.5 ± 0.3 % 95 ± 0.5 % 98.7 ± 0.2 % 98.4 ± 0.3 % 96.9 ± 0.5 % 96.0 ± 0.3 % 90.7 ± 0.2 % 88.5 ± 0.4 % 81.8 ± 0.3 % 81.1 ± 0.4 %</td><td>92.1 ± 0.4 % 90.2 ± 0.4 % 94.9 ± 0.4 % 94.2 ± 0.5 % 92.9 ± 0.4 % 92.3 ± 0.4 % 89.4 ± 0.4 % 87.6 ± 0.3 % 78.2 ± 0.3 %</td></tr><tr><td>CIFAR-100 (task 19) CIFAR-100 (task 20) Classification Accuracy</td><td>95.6 ± 0.3 % P&amp;C</td><td>78.7 ± 0.4 % 77.2 ± 0.4 % RCL 96.4 ± 0.5 %</td><td>80.8 ± 0.3 % 79.9 ± 0.4 % FRCL 98.4 ± 0.4 %</td><td>63.1 ± 0.5 % 62.4 ± 0.4 % LTG</td></tr><tr><td>Permuted MNIST (task 9) Permuted MNIST (task 10) Split MNIST (task 4) Split MNIST (task 5) Split notMNIST (task 4) Split notMNIST (task 5) Split Fashion-MNIST (task 4) Split Fashion-MNIST (task 5) Omniglot (task 49) Omniglot (task 50)</td><td>94.4 ± 0.3 % 94.1± 0.6 % 97.3 ± 0.5 % 96.4 ± 0.4 % 97.8 ± 0.4 % 96.9 ± 0.5 % 91.4 ± 0.3 % 90.8 ± 0.2 % 82.8 ± 0.2 % 82.7 ± 0.3 %</td><td>96.3 ± 0.3 % 97.8 ± 0.7 % 97.5 ± 0.6 % 97.7 ± 0.2 % 97.3 ± 0.5 % 91.1 ± 0.3 % 89.7 ± 0.4 % 80.1 ± 0.4 % 80.2 ± 0.4 %</td><td>98.4± 0.5 % 98.2 ± 0.3 % 98.1 ± 0.2 % 96.1 ± 0.6 % 95.2 ± 0.7 % 90.4 ± 0.2 % 87.7 ± 0.4 % 79.9 ± 0.3 %</td><td>98.7 ± 0.3 % 98.7 ± 0.3 % 98.7 ± 0.2 % 98.3 ± 0.3 % 97.8 ± 0.3 % 97.4 ± 0.3 % 92.5 ± 0.4 % 91.1 ± 0.3 %</td></tr></table>
360
+
361
+ # C OTHER EXPERIMENTAL DETAILS
362
+
363
+ Here are some additional details about the datasets in use:
364
+
365
+ The MNIST dataset is used in both the Permuted MNIST and Split MNIST experiments. The MNIST (Mixed National Institute of Standards and Technology) dataset (LeCun et al., 1998) is a handwritten digit dataset. Each MNIST image consists of $2 8 \times 2 8$ pixels, which is also the pixel size of the notMNIST and Fashion-MNIST datasets. The MNIST dataset contains a training set of 60,000 instances and a test set of 10,000 instances.
366
+
367
+ As mentioned in the main document, each experiment is repeated ten times. Data is randomly split into three partitions, training, validation and test. A portion of $6 0 \%$ of the data is reserved for training, $2 0 \%$ for validation and $2 0 \%$ for testing. Statistics reported are the averages of these ten repetitions.
368
+
369
+ Number of epochs required per task to reach a saturation level for CLAW (and the bulk of the methods in comparison) was 10 epochs for all experiments except for Omniglot and CIFAR-100 (15 epochs). Used values of $\omega _ { 1 }$ and $\omega _ { 2 }$ are 0.05 and 0.02, respectively.
370
+
371
+ For Omniglot, we used a network similar to the one used in (Schwarz et al., 2018), which consists of 4 blocks of $3 \times 3$ convolutions with 64 filters, followed by a ReLU and a $2 \times 2$ max-pooling. The same CNN is used for CIFAR-100. CLAW achieves clearly higher classification accuracy on both Omniglot and CIFAR-100 (Figures 1e and 1f).
372
+
373
+ # D ABLATIONS
374
+
375
+ The plots displayed in this section empirically demonstrate how important the main adaptation parameters are in achieving the classification performance levels reached by CLAW. In each of the Figures 4a- 4f, the classification performance of CLAW is compared to the following three cases: 1) when the parameter controlling the maximum degree of adaptation is not learnt in a multi-task fashion, i.e. when the respective general value $\mathbf { s _ { i , j } }$ is used instead of $\mathbf { s _ { i , j , t } } . 2 )$ ) when adaptation always happens, i.e. the binary variable denoting the adaptation decision is always activated. 3) when adaptation never takes place. The differences in classification accuracy between CLAW and each of the other three plots in Figures 4a- 4f empirically demonstrate the relevance of each adaptation parameter.
376
+
377
+ # E RUN-TIME
378
+
379
+ In Table 2, we report the wall-clock run time (in seconds) after finishing training in each of the six experiments: Permuted MNIST, Split MNIST, Split notMNIST, Split Fashion-MNIST, Omniglot and CIFAR-100. VCL and CLAW converge (i.e. reach the accuracy levels reported earlier) more quickly than the other methods. CLAW was the fastest in 3 out of the 6 experiments, whereas VCL was the fastest in the other 3, but their training run-time values have always been close to each other. As reported in the earlier sections, there is a significant difference in classification accuracy in favour of CLAW. This has been achieved within reasonably acceptable run-time levels thanks to the proposed design where the whole data-driven adaptation procedure is kept as part of an amortised variational inference algorithm. RCL is the slowest since it is based on reinforcement learning, where a large number of trials are typically required. This has also been acknowledged and reported therein (Xu & Zhu, 2018).
380
+
381
+ Table 2: Wall-clock run time (in seconds) after finishing training in each of the six experiments: Permuted MNIST, Split MNIST, Split notMNIST, Split Fashion-MNIST, Omniglot and CIFAR-100. As mentioned earlier, the statistics reported are averages of ten repetitions.
382
+
383
+ <table><tr><td>Training Time (in seconds)</td><td>CLAW</td><td>VCL</td><td> VCL + Coreset EWC P&amp;C</td><td></td><td></td><td>RCL</td><td>FRCL</td><td>LTG</td></tr><tr><td>Permuted MNIST (after 10 tasks)</td><td>667</td><td>682</td><td>724</td><td>1117</td><td>1355</td><td>32575</td><td>919</td><td>705</td></tr><tr><td>Split MNIST (after 5 tasks)</td><td>649</td><td>637</td><td>708</td><td>1054</td><td>1312</td><td>31110</td><td>891</td><td>648</td></tr><tr><td>Split notMNIST (after 5 tasks)</td><td>722</td><td>714</td><td>792</td><td>1210</td><td>1407</td><td>34123</td><td>898</td><td>781</td></tr><tr><td>Split Fashion-MNIST(after 5 tasks)</td><td>829</td><td>818</td><td>901</td><td>1284</td><td></td><td>1498 35086</td><td>972</td><td>915</td></tr><tr><td>Omniglot (after 50 tasks)</td><td>1126</td><td>1241</td><td>1513</td><td>1637</td><td></td><td>1714 37247</td><td>1620</td><td>1312</td></tr><tr><td>CIFAR-100 (after 20 tasks)</td><td>792</td><td>810</td><td>914</td><td>802</td><td>1322</td><td>6102</td><td>1016</td><td>896</td></tr></table>
384
+
385
+ ![](images/c0ad7f594cb131bd63f8a58d89ff5d4798ba0d138c303661ecd49fbe7734dc4e.jpg)
386
+ Figure 4: Ablation studies on different datasets.
md/train/HyTqHL5xg/HyTqHL5xg.md ADDED
@@ -0,0 +1,384 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DEEP VARIATIONAL BAYES FILTERS: UNSUPERVISED LEARNING OF STATE SPACE MODELS FROM RAW DATA
2
+
3
+ Maximilian Karl, Maximilian Soelch, Justin Bayer, Patrick van der Smagt Data Lab, Volkswagen Group, 80805, München, Germany zip([maximilian.karl, maximilian.soelch], [@volkswagen.de])
4
+
5
+ # ABSTRACT
6
+
7
+ We introduce Deep Variational Bayes Filters (DVBF), a new method for unsupervised learning and identification of latent Markovian state space models. Leveraging recent advances in Stochastic Gradient Variational Bayes, DVBF can overcome intractable inference distributions via variational inference. Thus, it can handle highly nonlinear input data with temporal and spatial dependencies such as image sequences without domain knowledge. Our experiments show that enabling backpropagation through transitions enforces state space assumptions and significantly improves information content of the latent embedding. This also enables realistic long-term prediction.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Estimating probabilistic models for sequential data is central to many domains, such as audio, natural language or physical plants, Graves (2013); Watter et al. (2015); Chung et al. (2015); Deisenroth & Rasmussen (2011); Ko & Fox (2011). The goal is to obtain a model $p ( \mathbf { x } _ { 1 : T } )$ that best reflects a data set of observed sequences $\mathbf { x } _ { \mathrm { 1 : } T }$ . Recent advances in deep learning have paved the way to powerful models capable of representing high-dimensional sequences with temporal dependencies, e.g., Graves (2013); Watter et al. (2015); Chung et al. (2015); Bayer & Osendorfer (2014).
12
+
13
+ Time series for dynamic systems have been studied extensively in systems theory, cf. McGoff et al. (2015) and sources therein. In particular, state space models have shown to be a powerful tool to analyze and control the dynamics. Two tasks remain a significant challenge to this day: Can we identify the governing system from data only? And can we perform inference from observables to the latent system variables? These two tasks are competing: A more powerful representation of system requires more computationally demanding inference, and efficient inference, such as the well-known Kalman filters, Kalman & Bucy (1961), can prohibit sufficiently complex system classes.
14
+
15
+ Leveraging a recently proposed estimator based on variational inference, stochastic gradient variational Bayes (SGVB, Kingma & Welling (2013); Rezende et al. (2014)), approximate inference of latent variables becomes tractable. Extensions to time series have been shown in Bayer & Osendorfer (2014); Chung et al. (2015). Empirically, they showed considerable improvements in marginal data likelihood, i.e., compression, but lack full-information latent states, which prohibits, e.g., long-term sampling. Yet, in a wide range of applications, full-information latent states should be valued over compression. This is crucial if the latent spaces are used in downstream applications.
16
+
17
+ Our contribution is, to our knowledge, the first model that (i) enforces the latent state-space model assumptions, allowing for reliable system identification, and plausible long-term prediction of the observable system, (ii) provides the corresponding inference mechanism with rich dependencies, (iii) inherits the merit of neural architectures to be trainable on raw data such as images or other sensory inputs, and (iv) scales to large data due to optimization of parameters based on stochastic gradient descent, Bottou (2010). Hence, our model has the potential to exploit systems theory methodology for downstream tasks, e.g., control or model-based reinforcement learning, Sutton (1996).
18
+
19
+ # 2 BACKGROUND AND RELATED WORK
20
+
21
+ 2.1 PROBABILISTIC MODELING AND FILTERING OF DYNAMICAL SYSTEMS
22
+
23
+ We consider non-linear dynamical systems with observations $\mathbf { x } _ { t } \in \mathcal { X } \subset \mathbb { R } ^ { n _ { x } }$ , depending on control inputs (or actions) $\mathbf { u } _ { t } \in \mathcal { U } \subset \mathbb { R } ^ { n _ { u } }$ . Elements of $\mathcal { X }$ can be high-dimensional sensory data, e.g., raw images. In particular they may exhibit complex non-Markovian transitions. Corresponding timediscrete sequences of length $\mathrm { T }$ are denoted as $\mathbf { x } _ { 1 : T } = ( \mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } , \ldots , \mathbf { x } _ { T } )$ and $\mathbf { u } _ { 1 : T } = ( \mathbf { u } _ { 1 } , \mathbf { u } _ { 2 } , \ldots , \mathbf { u } _ { T } )$ .
24
+
25
+ We are interested in a probabilistic model1 $p ( \mathbf { x } _ { 1 : T } \mid \mathbf { u } _ { 1 : T } )$ . Formally, we assume the graphical model
26
+
27
+ $$
28
+ p ( \mathbf { x } _ { 1 : T } \mid \mathbf { u } _ { 1 : T } ) = \int p ( \mathbf { x } _ { 1 : T } \mid \mathbf { z } _ { 1 : T } , \mathbf { u } _ { 1 : T } ) p ( \mathbf { z } _ { 1 : T } \mid \mathbf { u } _ { 1 : T } ) \mathrm { d } \mathbf { z } _ { 1 : T } ,
29
+ $$
30
+
31
+ where $\mathbf { z } _ { 1 : T }$ , $\mathbf { z } _ { t } \in \mathcal { Z } \subset \mathbb { R } ^ { n _ { z } }$ , denotes the corresponding latent sequence. That is, we assume a generative model with an underlying latent dynamical system with emission model $p ( \mathbf { x } _ { 1 : T } \mid \mathbf { z } _ { 1 : T } , \mathbf { u } _ { 1 : T } )$ and transition model $p ( \mathbf { z } _ { 1 : T } \mid \mathbf { u } _ { 1 : T } )$ . We want to learn both components, i.e., we want to perform latent system identification. In order to be able to apply the identified system in downstream tasks, we need to find efficient posterior inference distributions $p ( \mathbf { z } _ { 1 : T } \mid \mathbf { x } _ { 1 : T } )$ . Three common examples are prediction, filtering, and smoothing: inference of $\mathbf { z } _ { t }$ from $\mathbf { x } _ { 1 : t - 1 }$ , $\mathbf { x } _ { 1 : t }$ , or $\mathbf { x } _ { 1 : T }$ , respectively. Accurate identification and efficient inference are generally competing tasks, as a wider generative model class typically leads to more difficult or even intractable inference.
32
+
33
+ The transition model is imperative for achieving good long-term results: a bad transition model can lead to divergence of the latent state. Accordingly, we put special emphasis on it through a Bayesian treatment. Assuming that the transitions may differ for each time step, we impose a regularizing prior distribution on a set of transition parameters $\beta _ { 1 : T }$ :
34
+
35
+ $$
36
+ ( 1 ) = \iint p ( { \bf x } _ { 1 : T } \mid { \bf z } _ { 1 : T } , { \bf u } _ { 1 : T } ) p ( { \bf z } _ { 1 : T } \mid \beta _ { 1 : T } , { \bf u } _ { 1 : T } ) p ( \beta _ { 1 : T } ) \mathrm { d } \beta _ { 1 : T } \mathrm { d } { \bf z } _ { 1 : T }
37
+ $$
38
+
39
+ To obtain state-space models, we impose assumptions on emission and state transition model,
40
+
41
+ $$
42
+ \begin{array} { l } { \displaystyle p ( \mathbf { x } _ { 1 : T } \mid \mathbf { z } _ { 1 : T } , \mathbf { u } _ { 1 : T } ) = \prod _ { t = 1 \atop t = 1 } ^ { T } p ( \mathbf { x } _ { t } \mid \mathbf { z } _ { t } ) , } \\ { \displaystyle p ( \mathbf { z } _ { 1 : T } \mid \beta _ { 1 : T } , \mathbf { u } _ { 1 : T } ) = \prod _ { t = 0 } ^ { T - 1 } p ( \mathbf { z } _ { t + 1 } \mid \mathbf { z } _ { t } , \mathbf { u } _ { t } , \beta _ { t } ) . } \end{array}
43
+ $$
44
+
45
+ Equations (3) and (4) assume that the current state $\mathbf { z } _ { t }$ contains all necessary information about the current observation $\mathbf { x } _ { t }$ , as well as the next state $\mathbf { z } _ { t + 1 }$ (given the current control input $\mathbf { u } _ { t }$ and transition parameters $\beta _ { t }$ ). That is, in contrast to observations, $\mathbf { z } _ { t }$ exhibits Markovian behavior.
46
+
47
+ A typical example of these assumptions are Linear Gaussian Models (LGMs), i.e., both state transition and emission model are affine transformations with Gaussian offset noise,
48
+
49
+ $$
50
+ \begin{array} { r l r } { \mathbf { z } _ { t + 1 } = \mathbf { F } _ { t } \mathbf { z } _ { t } + \mathbf { B } _ { t } \mathbf { u } _ { t } + \mathbf { w } _ { t } \quad } & { } & { \mathbf { w } _ { t } \sim \mathcal { N } ( \mathbf { 0 } , \mathbf { Q } _ { t } ) , } \\ { \mathbf { x } _ { t } = \mathbf { H } _ { t } \mathbf { z } _ { t } + \mathbf { y } _ { t } \quad } & { } & { \mathbf { y } _ { t } \sim \mathcal { N } ( \mathbf { 0 } , \mathbf { R } _ { t } ) . } \end{array}
51
+ $$
52
+
53
+ Typically, state transition matrix $\mathbf { F } _ { t }$ and control-input matrix $\mathbf { B } _ { t }$ are assumed to be given, so that $\boldsymbol { \beta } _ { t } = \mathbf { w } _ { t }$ . Section 3.3 will show that our approach allows other variants such as $\beta _ { t } = \left( \mathbf { F } _ { t } , \mathbf { B } _ { t } , \mathbf { w } _ { t } \right)$ . Under the strong assumptions (5) and (6) of LGMs, inference is provably solved optimally by the well-known Kalman filters. While extensions of Kalman filters to nonlinear dynamical systems exist, Julier & Uhlmann (1997), and are successfully applied in many areas, they suffer from two major drawbacks: firstly, its assumptions are restrictive and are violated in practical applications, leading to suboptimal results. Secondly, parameters such as $\mathbf { F } _ { t }$ and $\mathbf { B } _ { t }$ have to be known in order to perform posterior inference. There have been efforts to learn such system dynamics, cf. Ghahramani $\&$ Hinton (1996); Honkela et al. (2010) based on the expectation maximization (EM) algorithm or Valpola & Karhunen (2002), which uses neural networks. However, these algorithms are not applicable in cases where the true posterior distribution is intractable. This is the case if, e.g., image sequences are used, since the posterior is then highly nonlinear—typical mean-field assumptions on the approximate posterior are too simplified. Our new approach will tackle both issues, and moreover learn both identification and inference jointly by exploiting Stochastic Gradient Variational Bayes.
54
+
55
+ # 2.2 STOCHASTIC GRADIENT VARIATIONAL BAYES (SGVB) FOR TIME SERIES DISTRIBUTIONS
56
+
57
+ Replacing the bottleneck layer of a deterministic auto-encoder with stochastic units $\mathbf { z }$ , the variational auto-encoder (VAE, Kingma & Welling (2013); Rezende et al. (2014)) learns complex marginal data distributions on $\mathbf { x }$ in an unsupervised fashion from simpler distributions via the graphical model
58
+
59
+ $$
60
+ p ( \mathbf { x } ) = \int p ( \mathbf { x } , \mathbf { z } ) \mathrm { d } \mathbf { z } = \int p ( \mathbf { x } \mid \mathbf { z } ) p ( \mathbf { z } ) \mathrm { d } \mathbf { z } .
61
+ $$
62
+
63
+ In VAEs, $p ( \mathbf { x } \mid \mathbf { z } ) \equiv p _ { \theta } ( \mathbf { x } \mid \mathbf { z } )$ is typically parametrized by a neural network with parameters $\theta$ . Within this framework, models are trained by maximizing a lower bound to the marginal data log-likelihood via stochastic gradients:
64
+
65
+ $$
66
+ \ln p ( \mathbf { x } ) \geq \mathbb { E } _ { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } [ \ln p _ { \theta } ( \mathbf { x } \mid \mathbf { z } ) ] - \mathrm { K L } ( q _ { \phi } ( \mathbf { z } \mid \mathbf { x } ) \mid \mid p ( \mathbf { z } ) ) = : \mathcal { L } _ { \mathrm { S G V B } } ( \mathbf { x } , \phi , \theta )
67
+ $$
68
+
69
+ This is provably equivalent to minimizing the KL-divergence between the approximate posterior or recognition model $q _ { \phi } ( \mathbf { z } \mid \mathbf { x } )$ and the true, but usually intractable posterior distribution $p ( \mathbf { z } \mid \mathbf { x } )$ . $q _ { \phi }$ is parametrized by a neural network with parameters $\phi$ .
70
+
71
+ The principle of VAEs has been transferred to time series, Bayer & Osendorfer (2014); Chung et al. (2015). Both employ nonlinear state transitions in latent space, but violate eq. (4): Observations are directly included in the transition process. Empirically, reconstruction and compression work well. The state space $\mathcal { Z }$ , however, does not reflect all information available, which prohibits plausible generative long-term prediction. Such phenomena with generative models have been explained in Theis et al. (2015).
72
+
73
+ In Krishnan et al. (2015), the state-space assumptions (3) and (4) are softly encoded in the Deep Kalman Filter (DKF) model. Despite that, experiments, cf. section 4, show that their model fails to extract information such as velocity (and in general time derivatives), which leads to similar problems with prediction.
74
+
75
+ Johnson et al. (2016) give an algorithm for general graphical model variational inference, not tailored to dynamical systems. In contrast to previously discussed methods, it does not violate eq. (4). The approaches differ in that the recognition model outputs node potentials in combination with message passing to infer the latent state. Our approach focuses on learning dynamical systems for controlrelated tasks and therefore uses a neural network for inferring the latent state directly instead of an inference subroutine.
76
+
77
+ Others have been specifically interested in applying variational inference for controlled dynamical systems. In Watter et al. (2015) (Embed to Control—E2C), a VAE is used to learn the mappings to and from latent space. The regularization is clearly motivated by eq. (7). Still, it fails to be a mathematically correct lower bound to the marginal data likelihood. More significantly, their recognition model requires all observations that contain information w.r.t. the current state. This is nothing short of an additional temporal i.i.d. assumption on data: Multiple raw samples need to be stacked into one training sample such that all latent factors (in particular all time derivatives) are present within one sample. The task is thus greatly simplified, because instead of time-series, we learn a static auto-encoder on the processed data.
78
+
79
+ A pattern emerges: good prediction should boost compression. Still, previous methods empirically excel at compression, while prediction will not work. We conjecture that this is caused by previous methods trying to fit the latent dynamics to a latent state that is beneficial for reconstruction. This encourages learning of a stationary auto-encoder with focus of extracting as much from a single observation as possible. Importantly, it is not necessary to know the entire sequence for excellent reconstruction of single time steps. Once the latent states are set, it is hard to adjust the transition to them. This would require changing the latent states slightly, and that comes at a cost of decreasing the reconstruction (temporarily). The learning algorithm is stuck in a local optimum with good reconstruction and hence good compression only. Intriguingly, E2C bypasses this problem with its data augmentation.
80
+
81
+ ![](images/3575706f643090530f958bb9ba2559b160e8016b28d587187d9d19d1e13fff7e.jpg)
82
+ Figure 1: Left: Graphical model for one transition under state-space model assumptions. The updated latent state $\mathbf { z } _ { t + 1 }$ depends on the previous state $\mathbf { z } _ { t }$ , control input $\mathbf { u } _ { t }$ , and transition parameters $\beta _ { t }$ . $\mathbf { z } _ { t + 1 }$ contains all information for generating observation $\mathbf { x } _ { t + 1 }$ . Diamond nodes indicate a deterministic dependency on parent nodes. Right: Inference performed during training (or while filtering). Past observations are indirectly used for inference as $\mathbf { z } _ { t }$ contains all information about them.
83
+
84
+ This leads to a key contribution of this paper: We force the latent space to fit the transition—reversing the direction, and thus achieving the state-space model assumptions and full information in the latent states.
85
+
86
+ # 3 DEEP VARIATIONAL BAYES FILTERS
87
+
88
+ # 3.1 REPARAMETRIZING THE TRANSITION
89
+
90
+ The central problem for learning latent states system dynamics is efficient inference of a latent space that obeys state-space model assumptions. If the latter are fulfilled, the latent space must contain all information. Previous approaches emphasized good reconstruction, so that the space only contains information necessary for reconstruction of one time step. To overcome this, we establish gradient paths through transitions over time so that the transition becomes the driving factor for shaping the latent space, rather than adjusting the transition to the recognition model’s latent space. The key is to prevent the recognition model $\bar { q _ { \phi } } ( \mathbf { z } _ { 1 : T } \mid \mathbf { x } _ { 1 : T } )$ from directly drawing the latent state $\mathbf { z } _ { t }$ .
91
+
92
+ Similar to the reparametrization trick from Kingma & Welling (2013); Rezende et al. (2014) for making the Monte Carlo estimate differentiable w.r.t. the parameters, we make the transition differentiable w.r.t. the last state and its parameters:
93
+
94
+ $$
95
+ \mathbf { z } _ { t + 1 } = f ( \mathbf { z } _ { t } , \mathbf { u } _ { t } , \boldsymbol { \beta } _ { t } )
96
+ $$
97
+
98
+ Given the stochastic parameters $\beta _ { t }$ , the state transition is deterministic (which in turn means that by marginalizing $\beta _ { t }$ , we still have a stochastic transition). The immediate and crucial consequence is that errors in reconstruction of $\mathbf { x } _ { t }$ from $\mathbf { z } _ { t }$ are backpropagated directly through time.
99
+
100
+ This reparametrization has a couple of other important implications: the recognition model no longer infers latent states $\mathbf { z } _ { t }$ , but transition parameters $\beta _ { t }$ . In particular, the gradient $\partial { \mathbf z } _ { t + 1 } / \partial { \mathbf z } _ { t }$ is well-defined from (8)—gradient information can be backpropagated through the transition.
101
+
102
+ This is different from the method used in Krishnan et al. (2015), where the transition only occurs in the KL-divergence term of their loss function (a variant of eq. (7)). No gradient from the generative model is backpropagated through the transitions.
103
+
104
+ Much like in eq. (5), the stochastic parameters includes a corrective offset term $\mathbf { w } _ { t }$ , which emphasizes the notion of the recognition model as a filter. In theory, the learning algorithm could still learn the transition as $\mathbf { z } _ { t + 1 } = \mathbf { w } _ { t }$ . However, the introduction of $\beta _ { t }$ also enables us to regularize the transition with meaningful priors, which not only prevents overfitting the recognition model, but also enforces meaningful manifolds in the latent space via transition priors. Ignoring the potential of the transition over time yields large penalties from these priors. Thus, the problems outlined in Section 2 are overcome by construction.
105
+
106
+ To install such transition priors, we split $\boldsymbol { \beta } _ { t } = \left( \mathbf { w } _ { t } , \mathbf { v } _ { t } \right)$ . The interpretation of $\mathbf { w } _ { t }$ is a sample-specific process noise which can be inferred from incoming data, like in eq. (5). On the other hand, $\mathbf { v } _ { t }$ are universal transition parameters, which are sample-independent (and are only inferred from data during training). This corresponds to the idea of weight uncertainty in Hinton $\&$ Van Camp (1993). This interpretation leads to a natural factorization assumption on the recognition model:
107
+
108
+ ![](images/2f06dc66adf13f953b2b283f158982e7fca52642d7eaad76f111e49d154273f4.jpg)
109
+ (b) One particular example of a latent transition: local linearity.
110
+
111
+ ![](images/9d5530af0592aa3f830396220bcbb3bd0b1e56b2fc31b89d38a842b3e0406bf6.jpg)
112
+ Figure 2: Left: General architecture for DVBF. Stochastic transition parameters $\beta _ { t }$ are inferred via the recognition model, e.g., a neural network. Based on a sampled $\beta _ { t }$ , the state transition is computed deterministically. The updated latent state $\mathbf { z } _ { t + 1 }$ is used for predicting $\mathbf { x } _ { t + 1 }$ . For details, see section 3.1. Right: Zoom into latent space transition (red box in left figure). One exemplary transition is shown, the locally linear transition from section 3.3.
113
+
114
+ $$
115
+ q _ { \phi } ( \beta _ { 1 : T } \mid \mathbf { x } _ { 1 : T } ) = q _ { \phi } ( \mathbf { w } _ { 1 : T } \mid \mathbf { x } _ { 1 : T } ) q _ { \phi } ( \mathbf { v } _ { 1 : T } )
116
+ $$
117
+
118
+ When using the fully trained model for generative sampling, i.e., sampling without input, the universal state transition parameters can still be drawn from $q _ { \phi } ( \mathbf { v } _ { 1 : T } )$ , whereas $\mathbf { w } _ { 1 : T }$ is drawn from the prior in the absence of input data.
119
+
120
+ Figure 1 shows the underlying graphical model and the inference procedure. Figure 2a shows a generic view on our new computational architecture. An example of a locally linear transition parametrization will be given in section 3.3.
121
+
122
+ # 3.2 THE LOWER BOUND OBJECTIVE FUNCTION
123
+
124
+ In analogy to eq. (7), we now derive a lower bound to the marginal likelihood $p ( \mathbf { x } _ { 1 : T } \mid \mathbf { u } _ { 1 : T } )$ . After reflecting the Markov assumptions (3) and (4) in the factorized likelihood (2), we have:
125
+
126
+ $$
127
+ p ( \mathbf { x } _ { 1 : T } \mid \mathbf { u } _ { 1 : T } ) = \int \int p ( \beta _ { 1 : T } ) \prod _ { t = 1 } ^ { T } p _ { \theta } ( \mathbf { x } _ { t } \mid \mathbf { z } _ { t } ) \prod _ { t = 0 } ^ { T - 1 } p ( \mathbf { z } _ { t + 1 } \mid \mathbf { z } _ { t } , \mathbf { u } _ { t } , \beta _ { t } ) \mathrm { d } \beta _ { 1 : T } \mathrm { d } \mathbf { z } _ { 1 : T }
128
+ $$
129
+
130
+ Due to the deterministic transition given $\beta _ { t + 1 }$ , the last term is a product of Dirac distributions and the overall distribution simplifies greatly:
131
+
132
+ $$
133
+ \begin{array} { l } { p ( \mathbf { x } _ { 1 : T } \mid \mathbf { u } _ { 1 : T } ) = \displaystyle \int p ( \boldsymbol { \beta } _ { 1 : T } ) \prod _ { t = 1 } ^ { T } p _ { \boldsymbol { \theta } } ( \mathbf { x } _ { t } \mid \mathbf { z } _ { t } ) \Big \vert _ { \mathbf { z } _ { t } = f \left( \mathbf { z } _ { t - 1 } , \mathbf { u } _ { t - 1 } , \boldsymbol { \beta } _ { t - 1 } \right) } \mathrm { d } \boldsymbol { \beta } _ { 1 : T } } \\ { \displaystyle \left( = \int p ( \boldsymbol { \beta } _ { 1 : T } ) p _ { \boldsymbol { \theta } } ( \mathbf { x } _ { 1 : T } \mid \mathbf { z } _ { 1 : T } ) \mathrm { d } \boldsymbol { \beta } _ { 1 : T } \right) } \end{array}
134
+ $$
135
+
136
+ The last formulation is for notational brevity: the term $p _ { \theta } ( \mathbf { x } _ { 1 : T } \mid \mathbf { z } _ { 1 : T } )$ is not independent of $\beta _ { 1 : T }$ and $\mathbf { u } _ { 1 : T }$ . We now derive the objective function, a lower bound to the data likelihood:
137
+
138
+ $$
139
+ \begin{array}{c} \ln p ( \mathbf { x } _ { 1 : T } \mid \mathbf { u } _ { 1 : T } ) = \ln \int p ( \beta _ { 1 : T } ) p _ { \theta } ( \mathbf { x } _ { 1 : T } \mid \mathbf { z } _ { 1 : T } ) { \frac { q _ { \phi } ( \beta _ { 1 : T } \mid \mathbf { x } _ { 1 : T } , \mathbf { u } _ { 1 : T } ) } { q _ { \phi } ( \beta _ { 1 : T } \mid \mathbf { x } _ { 1 : T } , \mathbf { u } _ { 1 : T } ) } } \mathrm { d } \beta _ { 1 : T } \\ { \geq \int q _ { \phi } ( \beta _ { 1 : T } \mid \mathbf { x } _ { 1 : T } , \mathbf { u } _ { 1 : T } ) \ln \left( p _ { \theta } ( \mathbf { x } _ { 1 : T } \mid \mathbf { z } _ { 1 : T } ) { \frac { p ( \beta _ { 1 : T } ) } { q _ { \phi } ( \beta _ { 1 : T } \mid \mathbf { x } _ { 1 : T } , \mathbf { u } _ { 1 : T } ) } } \right) \mathrm { d } \beta _ { 1 : T } } \\ { = \mathbb { E } _ { q _ { \phi } } [ \ln p _ { \theta } ( \mathbf { x } _ { 1 : T } \mid \mathbf { z } _ { 1 : T } ) - \ln q _ { \phi } ( \beta _ { 1 : T } \mid \mathbf { x } _ { 1 : T } , \mathbf { u } _ { 1 : T } ) + \ln p ( \beta _ { 1 : T } ) ] } \\ { = \mathbb { E } _ { q _ { \phi } } [ \ln p _ { \theta } ( \mathbf { x } _ { 1 : T } \mid \mathbf { z } _ { 1 : T } ) ] - \mathrm { K L } ( q _ { \phi } ( \beta _ { 1 : T } \mid \mathbf { x } _ { 1 : T } , \mathbf { u } _ { 1 : T } ) \mid \mid p ( \beta _ { 1 : T } ) ) } & { ( \ln p ( \beta _ { 1 : T } ) ) } \\ { = : { \mathcal { L } } _ { \mathrm { D V B F } } ( \mathbf { x } _ { 1 : T } , \theta , \phi \mid \mathbf { u } _ { 1 : T } ) } \end{array}
140
+ $$
141
+
142
+ Our experiments show that an annealed version of (10) is beneficial to the overall performance:
143
+
144
+ $$
145
+ ( \mathbf { 1 0 ^ { \prime } } ) = \mathbb { E } _ { q _ { \phi } } [ c _ { i } \ln p _ { \theta } ( \mathbf { x } _ { 1 : T } ~ \vert ~ \mathbf { z } _ { 1 : T } ) - \ln q _ { \phi } ( \beta _ { 1 : T } ~ \vert ~ \mathbf { x } _ { 1 : T } , \mathbf { u } _ { 1 : T } ) + c _ { i } \ln p ( \mathbf { w } _ { 1 : T } ) + \ln p ( \mathbf { v } _ { 1 : T } ) ]
146
+ $$
147
+
148
+ Here, $c _ { i } = \operatorname* { m a x } ( 1 , 0 . 0 1 + i / T _ { A } )$ is an inverse temperature that increases linearly in the number of gradient updates $i$ until reaching 1 after $T _ { A }$ annealing iterations. Similar annealing schedules have been applied in, e.g., Ghahramani $\&$ Hinton (2000); Mandt et al. (2016); Rezende & Mohamed (2015), where it is shown that they smooth the typically highly non-convex error landscape. Additionally, the transition prior $p ( \mathbf { v } _ { 1 : T } )$ was estimated during optimization, i.e., through an empirical Bayes approach. In all experiments, we used isotropic Gaussian priors.
149
+
150
+ # 3.3 EXAMPLE: LOCALLY LINEAR TRANSITIONS
151
+
152
+ We have derived a learning algorithm for time series with particular focus on general transitions in latent space. Inspired by Watter et al. (2015), this section will show how to learn a particular instance: locally linear state transitions. That is, we set eq. (8) to
153
+
154
+ $$
155
+ \begin{array} { r } { \mathbf { z } _ { t + 1 } = \mathbf { A } _ { t } \mathbf { z } _ { t } + \mathbf { B } _ { t } \mathbf { u } _ { t } + \mathbf { C } _ { t } \mathbf { w } _ { t } , \qquad t = 1 , \ldots , T , } \end{array}
156
+ $$
157
+
158
+ where $\mathbf { w } _ { t }$ is a stochastic sample from the recognition model and $\mathbf { A } _ { t } , \mathbf { B } _ { t }$ , and $\mathbf { C } _ { t }$ are matrices of matching dimensions. They are stochastic functions of $\mathbf { z } _ { t }$ and $\mathbf { u } _ { t }$ (thus local linearity). We draw
159
+
160
+ $$
161
+ \mathbf { v } _ { t } = \Big \{ \mathbf { A } _ { t } ^ { ( i ) } , \mathbf { B } _ { t } ^ { ( i ) } , \mathbf { C } _ { t } ^ { ( i ) } \mid i = 1 , \ldots , M \Big \} ,
162
+ $$
163
+
164
+ from $q _ { \phi } ( \mathbf { v } _ { t } )$ , i.e., $M$ triplets of matrices, each corresponding to data-independent, but learned globally linear system. These can be learned as point estimates. We employed a Bayesian treatment as in Blundell et al. (2015). We yield $\mathbf { A } _ { t } , \mathbf { B } _ { t }$ , and $\mathbf { C } _ { t }$ as state- and control-dependent linear combinations:
165
+
166
+ $$
167
+ \begin{array}{c} \begin{array} { r l r l r l } & { \quad } & & { \quad } & & { \boldsymbol { \alpha } _ { t } = f _ { \psi } ( \mathbf { z } _ { t } , \mathbf { u } _ { t } ) \in \mathbb { R } ^ { M } } \\ & { \quad } & & { \quad } & { \quad } & { \quad } \\ & { \quad } & { \quad } & { \quad } & { \quad } & { \quad } \\ & { \quad } & { \quad } & { \quad } & { \quad } & { \quad } & { \quad } \\ & { \quad } & { \quad } & { \quad } & { \quad } & { \quad } & { \quad } \end{array} \qquad \begin{array} { r l } & { \quad } & { \quad } & { \boldsymbol { \alpha } _ { t } = f _ { \psi } ( \mathbf { z } _ { t } , \mathbf { u } _ { t } ) \in \mathbb { R } ^ { M } } \\ & { \quad } & { \quad } \\ & { \quad } & { \quad } \\ & { \quad } & { \quad } & { \quad } \end{array} \qquad \mathbf { C } _ { t } = \sum _ { i = 1 } ^ { M } { \boldsymbol { \alpha } _ { t } ^ { ( i ) } } \mathbf { C } _ { t } ^ { ( i ) } \end{array}
168
+ $$
169
+
170
+ The computation is depicted in fig. 2b. The function $f _ { \psi }$ can be, e.g., a (deterministic) neural network with weights $\psi$ . As a subset of the generative parameters $\theta$ , $\psi$ is part of the trainable parameters of our model. The weight vector $\pmb { \alpha } _ { t }$ is shared between the three matrices. There is a correspondence to eq. (5): ${ \bf A } _ { t }$ and $\mathbf { F } _ { t }$ , $\mathbf { B } _ { t }$ and $\mathbf { B } _ { t }$ , as well as $\mathbf { C } _ { t } \mathbf { C } _ { t } ^ { \top }$ and $\mathbf { Q } _ { t }$ are related.
171
+
172
+ We used this parametrization of the state transition model for our experiments. It is important that the parametrization is up to the user and the respective application.
173
+
174
+ # 4 EXPERIMENTS AND RESULTS
175
+
176
+ In this section we validate that DVBF with locally linear transitions (DVBF-LL) (section 3.3) outperforms Deep Kalman Filters (DKF, Krishnan et al. (2015)) in recovering latent spaces with full information. 2 We focus on environments that can be simulated with full knowledge of the
177
+
178
+ 2We do not include E2C, Watter et al. (2015), due to the need for data modification and its inability to provide a correct lower bound as mentioned in section 2.2.
179
+
180
+ ![](images/89343f9239b5f95d0b3f05f420ceb14168472d729834fda8850d44f8baa77701.jpg)
181
+ Figure 3: (a) Our DVBF-LL model trained on pendulum image sequences. The upper plots show the latent space with coloring according to the ground truth with angles on the left and angular velocities on the right. The lower plots show regression results for predicting ground truth from the latent representation. The latent space plots show clearly that all information for representing the full state of a pendulum is encoded in each latent state. (b) DKF from Krishnan et al. (2015) trained on the same pendulum dataset. The latent space plot shows that DKF fails to learn velocities of the pendulum. It is therefore not able to capture all information for representing the full pendulum state.
182
+
183
+ ground truth latent dynamical system. The experimental setup is described in the Supplementary Material. We published the code for DVBF and a link will be made available at https://brml. org/projects/dvbf.
184
+
185
+ # 4.1 DYNAMIC PENDULUM
186
+
187
+ In order to test our algorithm on truly non-Markovian observations of a dynamical system, we simulated a dynamic torque-controlled pendulum governed by the differential equation
188
+
189
+ $$
190
+ m l ^ { 2 } { \ddot { \varphi } } ( t ) = - \mu { \dot { \varphi } } ( t ) + m g l \sin \varphi ( t ) + u ( t ) ,
191
+ $$
192
+
193
+ $m = l = 1 , \mu = 0 . 5 , g = 9 . 8 1$ , via numerical integration, and then converted the ground-truth angle $\varphi$ into an image observation in $\mathcal { X }$ . The one-dimensional control corresponds to angle acceleration (which is proportional to joint torque). Angle and angular velocity fully describe the system.
194
+
195
+ Figure 3 shows the latent spaces for identical input data learned by DVBF-LL and DKF, respectively, colored with the ground truth in the top row. It should be noted that latent samples are shown, not means of posterior distributions. The state-space model was allowed to use three latent dimensions. As we can see in fig. 3a, DVBF-LL learned a two-dimensional manifold embedding, i.e., it encoded the angle in polar coordinates (thus circumventing the discontinuity of angles modulo $2 \pi$ ). The bottom row shows ordinary least-squares regressions (OLS) underlining the performance: there exists a high correlation between latent states and ground-truth angle and angular velocity for DVBF-LL. On the contrary, fig. 3b verifies our prediction that DKF is equally capable of learning the angle, but extracts little to no information on angular velocity.
196
+
197
+ The OLS regression results shown in table 1 validate this observation.3 Predicting $\sin ( \varphi )$ and $\cos ( \varphi )$ , i.e., polar coordinates of the ground-truth angle $\varphi$ , works almost equally well for DVBF-LL and DKF, with DVBF-LL slightly outperforming DKF. For predicting the ground truth velocity $\dot { \varphi }$ , DVBF-LL shows remarkable performance. DKF, instead, contains hardly any information, resulting in a very low goodness-of-fit score of $R ^ { 2 } = 0 . 0 3 5$ .
198
+
199
+ Table 1: Results for pendulum OLS regressions of all latent states on respective dependent variable.
200
+
201
+ <table><tr><td colspan="3">DVBF-LL</td><td colspan="2">DKF</td></tr><tr><td></td><td></td><td>Log-Likelihood</td><td>R² Log-Likelihood</td><td>R²</td></tr><tr><td>Dependent</td><td>sin()</td><td>3990.8</td><td>0.961 0.982</td><td>1737.6 0.929</td></tr><tr><td>ground truth</td><td>cos()</td><td>7231.1</td><td>6614.2</td><td>0.979</td></tr><tr><td>variable</td><td>6</td><td>-11139 0.916</td><td>-20289</td><td>0.035</td></tr></table>
202
+
203
+ ![](images/886df3e2f7dd268db086c2c03abc30a59759b198fe32da3389af3e840dbf5cc5.jpg)
204
+ (b) Reconstructive latent walk.
205
+
206
+ ![](images/d58aeaeeefb189a121cf98cce5b00a9f7e03e587fd265f3883b8988c3b5125e1.jpg)
207
+ (a) Generative latent walk.
208
+ (c) Ground truth (top), reconstructions (middle), generative samples (bottom) from identical initial latent state.
209
+ Figure 4: (a) Latent space walk in generative mode. (b) Latent space walk in filtering mode. (c) Ground truth and samples from recognition and generative model. The reconstruction sampling has access to observation sequence and performs filtering. The generative samples only get access to the observations once for creating the initial state while all subsequent samples are predicted from this single initial state. The red bar indicates the length of training sequences. Samples beyond show the generalization capabilities for sequences longer than during training. The complete sequence can be found in the Appendix in fig. 7.
210
+
211
+ <table><tr><td rowspan=1 colspan=31>1 5 10 15 20 40 45</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>`</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>.</td><td rowspan=1 colspan=1>,</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>,</td><td rowspan=1 colspan=1>,</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>:</td><td rowspan=1 colspan=1>.</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>.</td><td rowspan=1 colspan=1>.</td><td rowspan=1 colspan=1>.</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>、</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>·</td><td rowspan=1 colspan=1>·</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>·</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>、</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>,</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>:</td><td rowspan=1 colspan=1>、</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>:</td><td rowspan=1 colspan=1>.</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>.</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>.</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>,</td><td rowspan=1 colspan=1>,</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>:</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>,</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr></table>
212
+
213
+ Figure 4 shows that the strong relation between ground truth and latent state is beneficial for generative sampling. All plots show 100 time steps of a pendulum starting from the exact same latent state and not being actuated. The top row plots show a purely generative walk in the latent space on the left, and a walk in latent space that is corrected by filtering observations on the right. We can see that both follow a similar trajectory to an attractor. The generative model is more prone to noise when approaching the attractor.
214
+
215
+ The bottom plot shows the first 45 steps of the corresponding observations (top row), reconstructions (middle row), and generative samples (without correcting from observations). Interestingly, DVBF works very well even though the sequence is much longer than all training sequences (indicated by the red line).
216
+
217
+ Table (2) shows values of the lower bound to the marginal data likelihood (for DVBF-LL, this corresponds to eq. (11)). We see that DVBF-LL outperforms DKF in terms of compression, but only with a slight margin, which does not reflect the better generative sampling as Theis et al. (2015) argue.
218
+
219
+ ![](images/c9482434209e7dde8771c88440c90feb407a9a4f7b03d8c70dac223a41f3459b.jpg)
220
+ Figure 5: (a) Two dimensions of 4D bouncing ball latent space. Ground truth x and y coordinates are combined into a regular $3 \times 3$ checkerboard coloring. This checkerboard is correctly extracted by the embedding. (b) Remaining two latent dimensions. Same latent samples, colored with ball velocities in x and y direction (left and right image, respectively). The smooth, perpendicular coloring indicates that the ground truth value is stored in the latent dimension.
221
+
222
+ # 4.2 BOUNCING BALL
223
+
224
+ The bouncing ball experiment features a ball rolling within a bounding box in a plane. The system has a two-dimensional control input, added to the directed velocity of the ball. If the ball hits the wall, it bounces off, so that the true dynamics are highly dependent on the current position and velocity of the ball. The system’s state is four-dimensional, two dimensions each for position and velocity.
225
+
226
+ Consequently, we use a DVBF-LL with four latent dimensions. Figure 5 shows that DVBF again captures the entire system dynamics in the latent space. The checkerboard is quite a remarkable result: the ground truth position of the ball lies within the 2D unit square, the bounding box. In order to visualize how ground truth reappears in the learned latent states, we show the warping of the ground truth bounding box into the latent space. To this end, we partitioned (discretized) the ground truth unit square into a regular 3x3 checkerboard with respective coloring. We observed that DVBF learned to extract the 2D position from the 256 pixels, and aligned them in two dimensions of the latent space in strong correspondence to the physical system. The algorithm does the exact same pixel-to-2D inference that a human observer automatically does when looking at the image.
227
+
228
+ ![](images/0fee90b828d2c622647068fb4a7868c7ca217d5d2ed1f6ad3072d29a40f8c53b.jpg)
229
+ Figure 6: Ground truth (top), reconstructions (middle), generative samples (bottom) from identical initial latent state for the two bouncing balls experiment. Red bar indicates length of training sequences.
230
+
231
+ # 4.3 TWO BOUNCING BALLS
232
+
233
+ Another more complex environment4 features two balls in a bounding box. We used a 10-dimensional latent space to fully capture the position and velocity information of the balls. Reconstruction and generative samples are shown in fig. 6. Same as in the pendulum example we get a generative model with stable predictions beyond training data sequence length.
234
+
235
+ # 5 CONCLUSION
236
+
237
+ We have proposed Deep Variational Bayes Filters (DVBF), a new method to learn state space models from raw non-Markovian sequence data. DVBFs perform latent dynamic system identification, and subsequently overcome intractable inference. As DVBFs make use of stochastic gradient variational Bayes they naturally scale to large data sets. In a series of vision-based experiments we demonstrated that latent states can be recovered which identify the underlying physical quantities. The generative model showed stable long-term predictions far beyond the sequence length used during training.
238
+
239
+ # ACKNOWLEDGEMENTS
240
+
241
+ Part of this work was conducted at Chair of Robotics and Embedded Systems, Department of Informatics, Technische Universität München, Germany, and supported by the TACMAN project, EC Grant agreement no. 610967, within the FP7 framework programme.
242
+
243
+ We would like to thank Jost Tobias Springenberg, Adam Kosiorek, Moritz Münst, and anonymous reviewers for valuable input.
244
+
245
+ # REFERENCES
246
+
247
+ Justin Bayer and Christian Osendorfer. Learning stochastic recurrent networks. arXiv preprint arXiv:1411.7610, 2014.
248
+
249
+ Charles Blundell, Julien Cornebise, Koray Kavukcuoglu, and Daan Wierstra. Weight uncertainty in neural networks. arXiv preprint arXiv:1505.05424, 2015.
250
+
251
+ Léon Bottou. Large-scale machine learning with stochastic gradient descent. In Proceedings of COMPSTAT’2010, pp. 177–186. Springer, 2010.
252
+
253
+ Junyoung Chung, Kyle Kastner, Laurent Dinh, Kratarth Goel, Aaron C. Courville, and Yoshua Bengio. A recurrent latent variable model for sequential data. CoRR, abs/1506.02216, 2015. URL http://arxiv.org/abs/1506.02216.
254
+
255
+ Marc Deisenroth and Carl E Rasmussen. Pilco: A model-based and data-efficient approach to policy search. In Proceedings of the 28th International Conference on machine learning (ICML-11), pp. 465–472, 2011.
256
+
257
+ Zoubin Ghahramani and Geoffrey E Hinton. Parameter estimation for linear dynamical systems. Technical report, Technical Report CRG-TR-96-2, University of Toronto, Dept. of Computer Science, 1996.
258
+
259
+ Zoubin Ghahramani and Geoffrey E Hinton. Variational learning for switching state-space models. Neural computation, 12(4):831–864, 2000.
260
+
261
+ Alex Graves. Generating sequences with recurrent neural networks. arXiv preprint arXiv:1308.0850, 2013.
262
+
263
+ Geoffrey E Hinton and Drew Van Camp. Keeping the neural networks simple by minimizing the description length of the weights. In Proceedings of the sixth annual conference on Computational learning theory, pp. 5–13. ACM, 1993.
264
+
265
+ 4We used the script attached to Sutskever & Hinton (2007) for generating our datasets.
266
+
267
+ Antti Honkela, Tapani Raiko, Mikael Kuusela, Matti Tornio, and Juha Karhunen. Approximate riemannian conjugate gradient learning for fixed-form variational bayes. Journal of Machine Learning Research, 11(Nov):3235–3268, 2010.
268
+
269
+ Matthew J Johnson, David Duvenaud, Alexander B Wiltschko, Sandeep R Datta, and Ryan P Adams. Structured VAEs: Composing probabilistic graphical models and variational autoencoders. arXiv preprint arXiv:1603.06277, 2016.
270
+
271
+ Simon J Julier and Jeffrey K Uhlmann. New extension of the kalman filter to nonlinear systems. In AeroSense’97, pp. 182–193. International Society for Optics and Photonics, 1997.
272
+
273
+ Rudolph E Kalman and Richard S Bucy. New results in linear filtering and prediction theory. Journal of basic engineering, 83(1):95–108, 1961.
274
+
275
+ Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
276
+
277
+ Jonathan Ko and Dieter Fox. Learning gp-bayesfilters via gaussian process latent variable models. Autonomous Robots, 30(1):3–23, 2011.
278
+
279
+ Rahul G Krishnan, Uri Shalit, and David Sontag. Deep Kalman filters. arXiv preprint arXiv:1511.05121, 2015.
280
+
281
+ Stephan Mandt, James McInerney, Farhan Abrol, Rajesh Ranganath, and David Blei. Variational tempering. In Proceedings of the 19th International Conference on Artificial Intelligence and Statistics, pp. 704–712, 2016.
282
+
283
+ Kevin McGoff, Sayan Mukherjee, Natesh Pillai, et al. Statistical inference for dynamical systems: A review. Statistics Surveys, 9:209–252, 2015.
284
+
285
+ Danilo J. Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In Tony Jebara and Eric P. Xing (eds.), Proceedings of the 31st International Conference on Machine Learning (ICML-14), pp. 1278–1286. JMLR Workshop and Conference Proceedings, 2014. URL http://jmlr.org/proceedings/ papers/v32/rezende14.pdf.
286
+
287
+ Danilo Jimenez Rezende and Shakir Mohamed. Variational inference with normalizing flows. arXiv preprint arXiv:1505.05770, 2015.
288
+
289
+ Ilya Sutskever and Geoffrey E. Hinton. Learning multilevel distributed representations for high-dimensional sequences. In Marina Meila and Xiaotong Shen (eds.), Proceedings of the Eleventh International Conference on Artificial Intelligence and Statistics (AISTATS-07), volume 2, pp. 548–555. Journal of Machine Learning Research - Proceedings Track, 2007. URL http://jmlr.csail.mit.edu/proceedings/papers/v2/sutskever07a/ sutskever07a.pdf.
290
+
291
+ Leonid Kuvayev Rich Sutton. Model-based reinforcement learning with an approximate, learned model. In Proceedings of the ninth Yale workshop on adaptive and learning systems, pp. 101–105, 1996.
292
+
293
+ Lucas Theis, Aäron van den Oord, and Matthias Bethge. A note on the evaluation of generative models. arXiv preprint arXiv:1511.01844, 2015.
294
+
295
+ Harri Valpola and Juha Karhunen. An unsupervised ensemble learning method for nonlinear dynamic state-space models. Neural computation, 14(11):2647–2692, 2002.
296
+
297
+ Manuel Watter, Jost Springenberg, Joschka Boedecker, and Martin Riedmiller. Embed to control: A locally linear latent dynamics model for control from raw images. In Advances in Neural Information Processing Systems, pp. 2728–2736, 2015.
298
+
299
+ # A SUPPLEMENTARY TO LOWER BOUND
300
+
301
+ # A.1 ANNEALED KL-DIVERGENCE
302
+
303
+ We used the analytical solution of the annealed KL-divergence in eq. (10) for optimization:
304
+
305
+ $$
306
+ \begin{array} { r l r } & { } & { \mathbb { E } _ { q _ { \phi } } [ - \ln q _ { \phi } ( { \bf w } _ { 1 : T } \mid { \bf x } _ { 1 : T } , { \bf u } _ { 1 : T } ) + c _ { i } \ln p ( { \bf w } _ { 1 : T } ) ] = } \\ & { } & { c _ { i } \frac { 1 } { 2 } \ln ( 2 \pi \sigma _ { p } ^ { 2 } ) - \frac { 1 } { 2 } \ln ( 2 \pi \sigma _ { q } ^ { 2 } ) + c _ { i } \frac { \sigma _ { q } ^ { 2 } + ( \mu _ { q } - \mu _ { p } ) ^ { 2 } } { 2 \sigma _ { p } ^ { 2 } } - \frac { 1 } { 2 } } \end{array}
307
+ $$
308
+
309
+ # B SUPPLEMENTARY TO IMPLEMENTATION
310
+
311
+ # B.1 EXPERIMENTAL SETUP
312
+
313
+ In all our experiments, we use sequences of 15 raw images of the respective system with $1 6 \times 1 6$ pixels each, i.e., observation space $\mathcal { X } \subset \mathbb { R } ^ { 2 5 6 }$ , as well as control inputs of varying dimension and interpretation depending on the experiment. We used training, validation and test sets with 500 sequences each. Control input sequences were drawn randomly (“motor babbling”). Additional details about the implementation can be found in the published code at https://brml.org/ projects/dvbf.
314
+
315
+ # B.2 ADDITIONAL EXPERIMENT PLOTS
316
+
317
+ ![](images/e2917c69eb71d5423688cb5a5187f15f229e6017c11ecfbeb490972b4bf65861.jpg)
318
+
319
+ Figure 7: Ground truth and samples from recognition and generative model. Complete version of fig. 4 with all missing samples present.
320
+
321
+ B.3 IMPLEMENTATION DETAILS FOR DVBF IN PENDULUM EXPERIMENT
322
+
323
+ • Input: 15 timesteps of $1 6 ^ { 2 }$ observation dimensions and 1 action dimension
324
+ • Latent Space: 3 dimensions
325
+ • Observation Network $p ( \mathbf { x } _ { t } | \mathbf { z } _ { t } ) = \mathcal { N } ( \mathbf { x } _ { t } ; \mu ( \mathbf { z } _ { t } ) , \boldsymbol { \sigma } )$ : $1 2 8 \mathrm { R e L U + 1 6 ^ { 2 } }$ identity output
326
+ • Recognition Model: $1 2 8 { \mathrm { R e L U } } + 6$ identity output
327
+
328
+ $$
329
+ \begin{array} { r } { q ( \mathbf { w } _ { t } | \mathbf { z } _ { t } , \mathbf { x } _ { t + 1 } , \mathbf { u } _ { t } ) = \mathcal { N } ( \mathbf { w } _ { t } ; \boldsymbol { \mu } , \boldsymbol { \sigma } ) , } \\ { ( \boldsymbol { \mu } , \boldsymbol { \sigma } ) = f ( \mathbf { z } _ { t } , \mathbf { x } _ { t + 1 } , \mathbf { u } _ { t } ) } \end{array}
330
+ $$
331
+
332
+ • Transition Network ${ \pmb { \alpha } } _ { t } ( { \bf z } _ { t } )$ : 16 softmax output
333
+ • Initial Network $\mathbf { w } _ { 1 } \sim p ( \mathbf { x } _ { 1 : T } )$ : Fast Dropout BiRNN with: $1 2 8 { \mathrm { R e L U } } + 3$ identity output
334
+ • Initial Transition ${ \bf z } _ { 1 } ( { \bf w } _ { 1 } )$ : $1 2 8 { \mathrm { R e L U } } + 3$ identity output
335
+ • Optimizer: adadelta, 0.1 step rate
336
+ • Inverse temperature: $c _ { 0 } = 0 . 0 1$ , updated every 250th gradient update, $T _ { A } = 1 0 ^ { 5 }$ iterations
337
+ • Batch-size: 500
338
+
339
+ B.4 IMPLEMENTATION DETAILS FOR DVBF IN BOUNCING BALL EXPERIMENT
340
+
341
+ • Input: 15 timesteps of $1 6 ^ { 2 }$ observation dimensions and 2 action dimension
342
+ • Latent Space: 4 dimensions
343
+ • Observation Network $p ( \mathbf { x } _ { t } | \mathbf { z } _ { t } ) = \mathcal { N } ( \mathbf { x } _ { t } ; \mu ( \mathbf { z } _ { t } ) , \boldsymbol { \sigma } )$ : $1 2 8 \mathrm { R e L U + 1 6 ^ { 2 } }$ identity output
344
+ • Recognition Model: $1 2 8 { \mathrm { R e L U } } + 8$ identity output
345
+
346
+ $$
347
+ \begin{array} { r } { q ( \mathbf { w } _ { t } | \mathbf { z } _ { t } , \mathbf { x } _ { t + 1 } , \mathbf { u } _ { t } ) = \mathcal { N } ( \mathbf { w } _ { t } ; \boldsymbol { \mu } , \boldsymbol { \sigma } ) , } \\ { ( \boldsymbol { \mu } , \boldsymbol { \sigma } ) = f ( \mathbf { z } _ { t } , \mathbf { x } _ { t + 1 } , \mathbf { u } _ { t } ) } \end{array}
348
+ $$
349
+
350
+ • Transition Network ${ \pmb { \alpha } } _ { t } ( { \bf z } _ { t } )$ : 16 softmax output
351
+ • Initial Network $\mathbf { w } _ { 1 } \sim p ( \mathbf { x } _ { 1 : T } )$ : Fast Dropout BiRNN with: $1 2 8 { \mathrm { R e L U } } + 4$ identity output
352
+ • Initial Transition ${ \bf z } _ { 1 } ( { \bf w } _ { 1 } )$ : $1 2 8 { \mathrm { R e L U } } + 4$ identity output
353
+ Optimizer: adadelta, 0.1 step rate
354
+ • Inverse temperature: $c _ { 0 } = 0 . 0 1$ , updated every 250th gradient update, $T _ { A } = 1 0 ^ { 5 }$ iterations
355
+ • Batch-size: 500
356
+
357
+ B.5 IMPLEMENTATION DETAILS FOR DVBF IN TWO BOUNCING BALLS EXPERIMENT
358
+
359
+ • Input: 15 timesteps of $2 0 ^ { 2 }$ observation dimensions and 2000 samples
360
+ • Latent Space: 10 dimensions
361
+ • Observation Network $p ( \mathbf { x } _ { t } | \mathbf { z } _ { t } ) = \mathcal { N } ( \mathbf { x } _ { t } ; \mu ( \mathbf { z } _ { t } ) , \boldsymbol { \sigma } )$ : $1 2 8 \mathrm { R e L U + 2 0 ^ { 2 } }$ sigmoid output
362
+ • Recognition Model: $1 2 8 \mathrm { R e L U } + 2 0 $ identity output
363
+
364
+ $$
365
+ \begin{array} { r } { q ( \mathbf { w } _ { t } | \mathbf { z } _ { t } , \mathbf { x } _ { t + 1 } , \mathbf { u } _ { t } ) = \mathcal { N } ( \mathbf { w } _ { t } ; \boldsymbol { \mu } , \boldsymbol { \sigma } ) , } \\ { ( \boldsymbol { \mu } , \boldsymbol { \sigma } ) = f ( \mathbf { z } _ { t } , \mathbf { x } _ { t + 1 } , \mathbf { u } _ { t } ) } \end{array}
366
+ $$
367
+
368
+ • Transition Network ${ \pmb { \alpha } } _ { t } ( { \bf z } _ { t } )$ : 64 softmax output
369
+ • Initial Network $\mathbf { w } _ { 1 } \sim p ( \mathbf { x } _ { 1 : T } )$ : MLP with: $1 2 8 \mathrm { R e L U } + 1 0$ identity output
370
+ • Initial Transition ${ \bf z } _ { 1 } ( { \bf w } _ { 1 } )$ : $1 2 8 \mathrm { R e L U } + 1 0$ identity output
371
+ • Optimizer: adam, 0.001 step rate
372
+ • Inverse temperature: $c _ { 0 } = 0 . 0 1$ , updated every gradient update, $T _ { A } = 2 ~ 1 0 ^ { 5 }$ iterations
373
+ • Batch-size: 80
374
+
375
+ B.6 IMPLEMENTATION DETAILS FOR DKF IN PENDULUM EXPERIMENT
376
+
377
+ • Input: 15 timesteps of $1 6 ^ { 2 }$ observation dimensions and 1 action dimension
378
+ • Latent Space: 3 dimensions
379
+ • Observation Network $p ( \mathbf { x } _ { t } | \mathbf { z } _ { t } ) = { \mathcal { N } } ( \mathbf { x } _ { t } ; \mu ( \mathbf { z } _ { t } ) , \sigma ( \mathbf { z } _ { t } ) ) \colon 1 2 8 { \mathrm { ~ S i g m o i d } } + 1 2 8 { \mathrm { ~ S i g m o i d } } + 2 1 6 ^ { 2 }$ identity output
380
+ • Recognition Model: Fast Dropout BiRNN 128 Sigmoid $+ ~ 1 2 8$ Sigmoid $^ { + 3 }$ identity output
381
+ • Transition Network $p ( \mathbf { z } _ { t } | \mathbf { z } _ { t - 1 } , \mathbf { u } _ { t - 1 } )$ : 128 Sigmoid $+ ~ 1 2 8$ Sigmoid $+ ~ 6$ output
382
+ • Optimizer: adam, 0.001 step rate
383
+ • Inverse temperature: $c _ { 0 } = 0 . 0 1$ , updated every $2 5 \mathrm { t h }$ gradient update, $T _ { A } = 2 0 0 0$ iterations
384
+ • Batch-size: 500
md/train/HyeSin4FPB/HyeSin4FPB.md ADDED
The diff for this file is too large to render. See raw diff
 
md/train/I-VfjSBzi36/I-VfjSBzi36.md ADDED
@@ -0,0 +1,236 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # EARLYBERT: EFFICIENT BERT TRAINING VIA EARLY-BIRD LOTTERY TICKETS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Deep, heavily overparameterized language models such as BERT, XLNet and T5 have achieved impressive success in many natural language processing (NLP) tasks. However, their high model complexity requires enormous computation resources and extremely long training time for both pre-training and fine-tuning. Many works have studied model compression on large NLP models, but only focusing on reducing inference time while still requiring expensive training process. Other works use extremely large batch sizes to shorten the pre-training time, at the expense of higher computational resource demands. In this paper, inspired by the Early-Bird Lottery Tickets recently studied for computer vision tasks, we propose EarlyBERT, a general computationally-efficient training algorithm applicable to both pre-training and fine-tuning of large-scale language models. By slimming the self-attention and fully-connected sub-layers inside a transformer, we are the first to identify structured winning tickets in the early stage of BERT training. We apply those tickets towards efficient BERT training, and conduct comprehensive pre-training and fine-tuning experiments on GLUE and SQuAD downstream tasks. Our results show that EarlyBERT achieves comparable performance to standard BERT, with $3 5 \sim 4 5 \%$ less training time.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Large-scale pre-trained language models (e.g., BERT (Devlin et al., 2018), XLNet (Yang et al., 2019), T5 (Raffel et al., 2019)) have significantly advanced the state of the art in the NLP field. Despite impressive empirical success, their computational inefficiency has become an acute drawback in practice. As more and more transformer layers are stacked with larger self-attention blocks, model complexity increases rapidly. For example, compared to BERT-Large model with 340 million parameters, T5 has more than 10 billion to learn. Such high model complexity calls for expensive computational resources and extremely long training time.
12
+
13
+ Model compression is one approach to alleviating this issue. Recently, many methods propose to encode large NLP models compactly (Sun et al., 2019; Sanh et al., 2019; Sun et al., 2020). However, the focus is solely on reducing computational resources or inference time, leaving the process of searching for the right compact model ever more costly. Furthermore, almost all model compression methods start with a large pre-trained model, which in practice may not exist. Recent work (You et al., 2020b) proposes to use large training batches, which significantly shortens pre-training time of BERT-Large model but demands daunting computing resources (1,024 TPUv3 chips).
14
+
15
+ In contrast, our quest is to find a general resource-efficient training algorithm for large NLP models, which can be applied to both pre-training and fine-tuning stages. Our goal is to trim down the training time, but also avoiding more costs of the total training resources (e.g., taking large-batch or distributed training). To meet this challenge demand, we draw inspirations from a recent work (You et al., 2020a) that explores the use of Lottery Ticket Hypothesis (LTH) for efficient training of computer vision models. LTH was first proposed in Frankle & Carbin (2019) as an exploration to understand the training process of deep networks. The original LTH substantiates a trainable sparse sub-network at initialization, but it cannot be directly utilized for efficient training, since the subnetwork itself has to be searched through a tedious iterative process. In addition, most LTH works discussed only unstructured sparsity. The study of You et al. (2020a) presents new discoveries that structured lottery tickets can emerge in early stage of training (i.e., Early-Bird Ticket), and therefore a structurally sparse sub-network can be identified with much lower costs, leading to practical efficient training algorithms.
16
+
17
+ Inspired by the success of LTH and Early-Bird Ticket, we propose EarlyBERT, a general efficient training algorithm based on structured Early-Bird Tickets. Due to the vast differences between the architectures and building blocks of computer vision models and BERT, directly extending the method of (You et al., 2020a) is not applicable to our work. By instead using network slimming (Liu et al., 2017) on the self-attention and fully-connected sub-layers inside a transformer, we are the first to introduce an effective approach that can identify structured winning tickets in the early stage of BERT training, that are successfully applied for efficient language modeling pre-training and finetuning. Extensive experiments on BERT demonstrate that EarlyBERT can save $3 5 \sim 4 5 \%$ training time without sacrificing accuracy, when evaluated on GLUE and SQuAD benchmarks.
18
+
19
+ # 2 RELATED WORK
20
+
21
+ Efficient NLP Models It is well believed that BERT and other large NLP models are considerably overparameterized (McCarley, 2019; Sun et al., 2019). This explains the emergence of many model compression works, which can be roughly categorized into quantization (Shen et al., 2020; Zafrir et al., 2019), knowledge distillation (Sun et al., 2019; Jiao et al., 2019; Sanh et al., 2019; Sun et al., 2020), dynamic routing (Fan et al., 2019; Xin et al., 2020), and pruning (Li et al., 2020; Wang et al., 2019; McCarley, 2019; Michel et al., 2019). Almost all model compression methods focus on reducing inference time, while their common drawback is the reliance on fully-trained and heavilyengineered dense models, before proceeding to their compact, sparse versions - which essentially transplants the resource burden from the inference to the training stage
22
+
23
+ Pruning is the mainstream approach for compressing BERT so far. McCarley (2019) proposed to greedily and iteratively prune away attention heads contributing less to the model. Wang et al. (2019) proposed to structurally prune BERT models using low-rank factorization and augmented Lagrangian $\ell _ { 0 }$ norm regularization. McCarley (2019) pruned less important self-attention heads and slices of MLP layers by applying $\ell _ { 0 }$ regularization to the coefficient corresponding to each head/MLP layer. Another line of works aim to reduce the training time of transformer-based models via large-batch training and GPU model parallelism (You et al., 2020b; Shoeybi et al., 2019). Our work is orthogonal to those works, and can be readily combined for further efficiency boost.
24
+
25
+ Lottery Ticket Hypothesis in Computer Vision Lottery Ticket Hypothesis (LTH) was firstly proposed in Frankle & Carbin (2019), which shed light on the existence of sparse sub-networks (i.e., winning tickets) at initialization with non-trivial sparsity ratio that can achieve almost the same performance (compared to the full model) when trained alone. The winning tickets are identified by pruning fully trained networks using the so-called Iterative Magnitude-based Pruning (IMP). However, IMP is expensive due to its iterative nature. Moreover, IMP leads to unstructured sparsity, which is known to be insufficient in reducing training cost or accelerating training speed practically. Those barriers prevent LTH from becoming immediately helpful towards efficient training. Morcos et al. (2019) studies the transferability of winning tickets between datasets and optimizers. Zhou et al. (2019) investigates different components in LTH and observes the existence of super-masks in winning tickets. Lately, You et al. (2020a) pioneers to identify Early-Bird Tickets, which emerge at the early stage of the training process, and contain structured sparsity when pruned with Network Slimming (Liu et al., 2017). Early-bird tickets mitigate the two limitations of IMP aforementioned, and renders it possible to training deep models efficiently, by drawing such tickets early in the training and then focusing on training this compact subnetwork only.
26
+
27
+ Lottery Ticket Hypothesis in NLP All above works evaluate their methods on computer vision models. For NLP models, previous work has also found that matching subnetworks exist in training on Transformers and LSTMs (Yu et al., 2019; Renda et al., 2020). Evci et al. (2020) derived an algorithm for training sparse neural networks according to LTH and applied it to a character-level language modeling on WikiText-103. For BERT models, a latest work (Chen et al., 2020) found that the pre-trained BERT models contain sparse subnetworks, found by unstructured IMP at $40 \%$ to $90 \%$ sparsity, that are independently trainable and transferable to a range of downstream tasks with no performance degradation. Another concurrent work (Prasanna et al., 2020) aims to find structurally sparse lottery tickets for BERT, by pruning entire attention heads and MLP layers. Their experiments turn out that all subnetworks (“good” and “bad”) have “comparable performance” when fined-tuned on downstream tasks, leading to their “all tickets are winning” conclusion.
28
+
29
+ Nevertheless, both works (Chen et al., 2020; Prasanna et al., 2020) examine only the pre-trained BERT model, i.e., finding tickets with regard to the fine-tuning stage on downstream tasks. To our best knowledge, no existing study analyzes the LTH at the pre-training stage of BERT; nor has any work discussed the efficient BERT training using LTH, for either pre-training or fine-tuning stage. In comparision, our work represents the first attempt of introducing LTH to both efficient pre-training and efficient fine-tuning of BERT. Our results also provide positive evidence that LTH and Early-Bird Tickets in NLP models are amendable to structured pruning too.
30
+
31
+ # 3 THE EARLYBERT FRAMEWORK
32
+
33
+ In this section, we first revisit the original Lottery Ticket Hypothesis (LTH) (Frankle & Carbin, 2019) and its variant Early-Bird Ticket (You et al., 2020a), then describe our proposed EarlyBERT.
34
+
35
+ # 3.1 REVISITING LOTTERY TICKET HYPOTHESIS
36
+
37
+ Denote $f ( x ; \theta )$ as a deep network parameterized by $\theta$ and $x$ as its input. A sub-network of $f$ can be characterized by a binary mask $m$ , which has exactly the same dimension as $\theta$ . When applying the mask $m$ to the network, we obtain the sub-network $f ( x ; \theta \odot m )$ , where $\odot$ is the Hadamard product operator. LTH states that, for a network initialized with $\theta _ { 0 }$ , an algorithm called Iterative Magnitude Pruning (IMP) can identify a mask $m$ such that the sub-network $f ( x ; \theta _ { 0 } \odot m )$ can be trained to have no worse performance than the full model $f$ following the same training protocol. Such a sub-network $f ( x ; \bar { \theta } _ { 0 } \odot m )$ , including both the mask $m$ and initial parameters $\theta _ { 0 }$ , is called a winning ticket. The IMP algorithm works as follows: (1) initialize $m$ as an all-one mask; (2) fully train $f ( x ; \theta _ { 0 } \odot m )$ to obtain a well-trained $\theta$ ; (3) remove a small portion of weights with the smallest magnitudes from $\theta \odot m$ and update $m$ ; (4) repeat (2)-(3) until a certain sparsity ratio is achieved.
38
+
39
+ Two obstacles prevent LTH from being directly applied to efficient training. First, the iterative process in IMP is essential to preserve the performance of LTH; however, this is computationally expensive, especially when the number of iterations is high. Second, the original LTH does not pursue any structured sparsity in the winning tickets. In practice, unstructured sparsity is difficult to be utilized for computation acceleration even when the sparsity ratio is high (Wen et al., 2016).
40
+
41
+ To mitigate these gaps, Early-Bird Tickets are proposed by You et al. (2020a), who discovers that when using structured mask $m$ and a properly selected learning rate, the mask $m$ quickly converges and the corresponding mask emerges as the winning ticket in the early stage of training. The early emergence of winning tickets and the structured sparsity are both helpful in reducing computational cost in the training that follows. You et al. (2020a) focuses on computer vision tasks with convolutional networks such as VGG (Simonyan & Zisserman, 2014) and ResNet (He et al., 2016). Inspired by this, we set out to explore whether there are structured winning tickets in the early stage of BERT training that can significantly accelerate language model pre-training and fine-tuning.
42
+
43
+ # 3.2 DISCOVERING EARLYBERT
44
+
45
+ The proposed EarlyBERT1 training framework consists of three steps: (i) Searching Stage: jointly train BERT and the sparsity-inducing coefficients to be used to draw the winning ticket; (ii) Ticketdrawing Stage: draw the winning ticket using the learned coefficients; and (iii) Efficient-training Stage: train EarlyBERT for pre-training or downstream fine-tuning.
46
+
47
+ Searching Stage To search for the key sub-structure in BERT, we follow the main idea of Network Slimming (NS) (Liu et al., 2017). However, pruning in NS is based on the scaling factor $\gamma$ in batch normalization, which is not used in most NLP models such as BERT. Therefore, we make necessary modifications to the original NS so that it can be adapted to pruning BERT. Specifically, we propose to associate attention heads and intermediate layers of the fully-connected sub-layers in a transformer with learnable coefficients, which will be jointly trained with BERT but with an additional $\ell _ { 1 }$ regularization to promote sparsity.
48
+
49
+ Some studies (Michel et al., 2019; Voita et al., 2019) find that the multi-head self-attention module of transformer can be redundant sometimes, presenting the possibility of pruning some heads from each layer of BERT without hurting model capacity. A multi-head attention module (Vaswani et al., 2017) is formulated as:
50
+
51
+ $$
52
+ \begin{array} { r } { \begin{array} { r l } & { \mathrm { M u l t i H e a d } ( Q , K , V ) = \mathrm { C o n c a t } ( \mathrm { h e a d } _ { 1 } , \dots , \mathrm { h e a d } _ { h } ) W ^ { O } } \\ & { ~ \mathrm { w h e r e ~ h e a d } _ { i } = \mathrm { A t t e n t i o n } ( Q W _ { i } ^ { Q } , K W _ { i } ^ { K } , V W _ { i } ^ { V } ) , } \end{array} } \end{array}
53
+ $$
54
+
55
+ where the projections $W ^ { O } , W _ { i } ^ { Q } , W _ { i } ^ { K } , W _ { i } ^ { V }$ are used for output, query, key and value. Inspired by Liu et al. (2017), we introduce a set of scalar coefficients $c _ { i } ^ { h }$ ( $_ i$ is the index of attention heads and $h$ means “head”) inside ${ \mathrm { h e a d } } _ { i }$ :
56
+
57
+ $$
58
+ \mathrm { h e a d } _ { i } = c _ { i } ^ { h } \cdot \mathrm { A t t e n t i o n } ( Q W _ { i } ^ { Q } , K W _ { i } ^ { K } , V W _ { i } ^ { V } ) .
59
+ $$
60
+
61
+ After the self-attention sub-layer in each transformer layer, the output $\mathrm { M u l t i H e a d } ( Q , K , V )$ will be fed into a two-layer fully-connected network, in which the first layer increases the dimension of the embedding by 4 times and then reduces it back to the hidden size (768 for BERTBASE and 1,024 for BERTLARGE). We multiply learnable coefficients to the intermediate neurons:
62
+
63
+ $$
64
+ \mathrm { F F N } ( x ) = c ^ { f } \cdot \operatorname* { m a x } ( 0 , x W _ { 1 } + b _ { 1 } ) W _ { 2 } + b _ { 2 } .
65
+ $$
66
+
67
+ These modifications allow us to jointly train BERT with the coefficients, using the following loss:
68
+
69
+ $$
70
+ \mathcal { L } ( f ( \cdot ; \theta ) , c ) = \mathcal { L } _ { 0 } ( f ( \cdot ; \theta ) , c ) + \lambda \| c \| _ { 1 } ,
71
+ $$
72
+
73
+ where $\mathcal { L } _ { 0 }$ is the original loss function used in pre-training or fine-tuning, $c$ is the concatenation of all the coefficients in the model including those for attention heads and intermediate neurons, and $\lambda$ is the hyper-parameter that controls the strength of regularization.
74
+
75
+ Note that in this step, the joint training of BERT and the coefficients are still as expensive as normal BERT training. However, the winning strategy of EarlyBERT is that we only need to perform this joint training for a few steps, before the winning ticket emerges, which is much shorter than the full training process of pre-training or fine-tuning. In other words, we can identify the winning tickets at a very low cost compared to the full training. Then, we draw the ticket (i.e., the EarlyBERT), reset the parameters and train EarlyBERT that is computationally efficient thanks to its structured sparsity. Next, we introduce how we draw EarlyBERT from the learned coefficients.
76
+
77
+ Ticket-drawing Stage After training BERT and coefficients $c$ jointly, we draw EarlyBERT using the learned coefficients with a magnitude-based metric. Note that we prune attention heads and intermediate neurons separately, as they play different roles in BERT.
78
+
79
+ We prune the attention heads whose coefficients have the smallest magnitudes, and remove them from the computation graph. We also prune the rows in $W ^ { O }$ (see Eqn. (1)) that correspond to the removed heads. Note that this presents a design choice: should we prune the heads globally or layer-wisely? In this paper, we use layer-wise pruning for attention heads, because the number of heads in each layer is very small (12 for BERTBASE and 16 for BERTLARGE). We observe empirically that if pruned globally, the attention heads in some layers may be completely removed, making the network un-trainable. Furthermore, Ramsauer et al. (2020) observes that attention heads in different layers exhibit different behaviors. This also motivates us to only compare importance of attention heads within each layer.
80
+
81
+ Similar to pruning attention heads, we prune intermediate neurons in the fully-connected sub-layers. Pruning neurons is equivalent to reducing the size of intermediate layers, which leads to a reduced size of the weight matrices $W _ { 1 }$ and $W _ { 2 }$ in Eqn. (4). Between global and layer-wise pruning, empirical analysis shows that global pruning works better. We also observe that our algorithm naturally prunes more neurons for the later layers than earlier ones, which coincides with many pruning works on vision tasks. We leave the analysis of this phenomenon as future work.
82
+
83
+ Efficient-training Stage We then train EarlyBERT that we have drawn for pre-training or finetuning depending on the target task. If we apply EarlyBERT to pre-training, the initialization $\theta _ { 0 }$ of BERT will be a random initialization, the same setting as the original LTH (Frankle & Carbin, 2019)
84
+
85
+ and Early-Bird Tickets (You et al., 2020a). If we apply EarlyBERT to fine-tuning, then $\theta _ { 0 }$ can be any pre-trained model. We can also moderately reduce the training steps in this stage without sacrificing performance, which is empirically supported by the findings in Frankle & Carbin (2019); You et al. (2020a) that the winning tickets can be trained more effectively than the full model. In practice, the learning rate can also be increased to speed up training, in addition to reducing training steps.
86
+
87
+ Different from unstructured pruning used in LTH and many other compression works (Frankle & Carbin, 2019; Chen et al., 2020), structurally pruning attention heads and intermediate neurons in fully-connected layers can directly reduce the number of computations required in the transformer layer, and shrink the matrix size of the corresponding operations, yielding a direct reduction in computation and memory costs.
88
+
89
+ # 3.3 VALIDATION OF EARLYBERT
90
+
91
+ Early Emergence Following a similar manner in You et al. (2020a), we visualize the normalized mask distance between different training steps, to validate the early emergence of winning tickets. In Figure 1, the axes in the plots are the number of training steps finished. We only use one fullyconnected sub-layer to plot Figure 1(b),1(d) due to high dimensionality. In both pre-training and fine-tuning, the mask converges in a very early stage of the whole training process. Although we observe an increase of mask distance in fully-connected layers during pre-training (in Figure 1(b)), this can be easily eliminated by early stopping and using mask distance as the exit criterion.
92
+
93
+ Non-trivial Sub-network Here, by non-trivial we mean that with the same sparsity ratio as in EarlyBERT, randomly pruned model suffers from significant performance drop. The performance drop happens even if we only prune attention heads. We verify this by running fine-tuning experiments on BERTBASE. Specifically, we prune 4 heads from each transformer layer in BERTBASE and EarlyBERT. We finetune BERTBASE for 3 epochs with an ini
94
+
95
+ Table 1: Comparison between randomly-pruned models and EarlyBERT on 4 GLUE tasks. We prune 4 heads in each layer.
96
+
97
+ <table><tr><td>Methods</td><td>MNLI</td><td>QNLI</td><td>QQP</td><td>SST-2</td></tr><tr><td>BERTBASE</td><td>83.16</td><td>90.59</td><td>90.34</td><td>91.70</td></tr><tr><td>EarlyBERTBASE</td><td>83.58</td><td>90.33</td><td>90.41</td><td>92.09</td></tr><tr><td>Random</td><td>82.26</td><td>88.87</td><td>90.12</td><td>91.17</td></tr></table>
98
+
99
+ tial learning rate $2 \times \mathrm { i 0 ^ { - 5 } }$ . We run the searching stage for 0.2 epochs with $\lambda = 1 \times 1 0 ^ { - 4 }$ , draw EarlyBERT with pruning ratio $\rho = 1 / 3$ , and then fine-tune EarlyBERT for 2 epochs with doubled initial learning rate. For the randomly pruned models, we randomly prune 4 heads in each layer and follow the same fine-tuning protocol as EarlyBERT. The reported results of randomly pruned models are the average of 5 trials with different seeds for pruning. The results on three tasks from GLUE benchmark (Wang et al., 2018) presented in Table 1 show that randomly pruned model consistently under-performs EarlyBERT with a significant gap, supporting our claim that EarlyBERT indeed identifies non-trivial sub-structures.
100
+
101
+ # 4 EXPERIMENTS
102
+
103
+ # 4.1 EXPERIMENTAL SETTING
104
+
105
+ Backbone Models Following the official BERT implementation (Devlin et al., 2018; Wolf et al., 2019), we use both BERTBASE (12 transformer layers, hidden size 768, 3,072 intermediate neurons, 12 self-attention heads per layer, 110M parameters in total) and BERTLARGE (24 transformer layers, hidden size 1,024, 4,096 intermediate neurons, 16 self-attention heads per layer, 340M parameters in total) for experiments.
106
+
107
+ Datasets We use English Wikipedia (2,500M words) as the pre-training data. For fine-tuning experiments and evaluation of models in the pre-training experiments, we use tasks from GLUE benchmark (Wang et al., 2018) and a question-answering dataset SQuAD v1.1 (Rajpurkar et al., 2016). Note that as our goal is efficient pre-training and fine-tuning, we focus on larger datasets from GLUE (MNLI, QNLI, QQP and SST-2), as it is less meaningful to discuss efficient training on very small datasets. We use the default training settings for pre-training and fine-tuning on both models. To evaluate model performance, we use Matthew’s correlation score for CoLA, matched accuracy for MNLI, F1-score for SQuAD v1.1, and accuracy in percentage for other tasks on GLUE. We omit $\%$ symbols in all the tables on accuracy results.
108
+
109
+ ![](images/1ce7350e9d25cc7c12f257190fb0e0b767d241696732391e5ea24cf192a1a54a.jpg)
110
+ Figure 1: Illustration of Mask Distance. Top: mask distance observed in pre-training. Bottom: mask distance observed in fine-tuning. The color represents the normalized mask distance between different training steps. The darker the color, the smaller the mask distance.
111
+
112
+ Implementation Details For the vanilla BERT, we fine-tune on GLUE datasets for 3 epochs with initial learning rate $2 \times 1 0 ^ { - 5 }$ , and for 2 epochs on SQuAD with initial learning rate $\mathrm { { \bar { 3 } } \times 1 0 ^ { - 5 } }$ ; we use AdamW (Loshchilov & Hutter, 2017) optimizer for both cases. For pre-training, we adopt LAMB optimization technique (You et al., 2020b), which involves two phases of training: the first 9/10 of the total training steps uses a sequence length of 128, while the last 1/10 uses a sequence length of 512. Pre-training by default has 8,601 training steps and uses $6 4 \mathrm { k } / 3 2 \mathrm { k }$ batch sizes and $6 \times \mathrm { { 1 0 ^ { - 3 } } / 4 \times 1 0 ^ { - 3 } }$ initial learning rates for the two phases, respectively. All experiments are run on 16 NVIDIA V100 GPUs.
113
+
114
+ # 4.2 EXPERIMENTS ON FINE-TUNING
115
+
116
+ The main results of EarlyBERT in fine-tuning are presented in Table 2. When drawing EarlyBERT, we prune 4 heads in each layer from BERTBASE and 6 heads from BERTLARGE, and globally prune $40 \%$ intermediate neurons in fully-connected sub-layers in both models. We reduce the training epochs to two on GLUE benchmark and scale up the learning rate by 2 to buffer the effect of reduced epochs. For SQuAD dataset, we keep the default setting, as we find SQuAD is more sensitive to the number of training epochs. Ablation studies on the effects of the number of training epochs and learning rate are included in the following section.
117
+
118
+ Several observations can be drawn from Table 2. Firstly, in most tasks, EarlyBERT saves over $40 \%$ of the total training time without inducing much performance degradation. It can also outperform another strong baseline LayerDrop (Fan et al., 2019), which drops one third of the layers so that the number of remaining parameters are comparable to ours. Note that LayerDrop models are fine-tuned for three full epochs, yet EarlyBERT is still competitive in most cases. Secondly, we consistently observe obvious performance advantage of EarlyBERT over randomly pruned models, which provides another strong evidence that EarlyBERT does discover nontrivial key sparse structures. Even though there still exists a margin between EarlyBERT and the baseline (like (You et al., 2020a) also observed similarly in their tasks), the existence of structured winning tickets and its potential for efficient training is highly promising. We leave as future work to discover winning tickets of higher sparsity but better quality.
119
+
120
+ Table 2: Performance of EarlyBERT (fine-tuning) compared with different baselines.
121
+
122
+ <table><tr><td>Methods</td><td>MNLI</td><td>QNLI</td><td>QQP</td><td>SST-2</td><td>SQuAD</td><td>Time Saved2</td></tr><tr><td>BERTBASE</td><td>83.16</td><td>90.59</td><td>90.34</td><td>91.70</td><td>87.50</td><td>1</td></tr><tr><td>EarlyBERTBASE</td><td>81.81</td><td>89.18</td><td>90.06</td><td>90.71</td><td>86.13</td><td>40~45%</td></tr><tr><td>RandomBASE</td><td>79.92</td><td>84.46</td><td>89.42</td><td>89.68</td><td>84.47</td><td>45~50%</td></tr><tr><td>LayerDrop (Fan et al., 2019)</td><td>81.27</td><td>88.91</td><td>88.06</td><td>89.89</td><td>84.25</td><td>~33%</td></tr><tr><td>BERTLARGE</td><td>86.59</td><td>92.29</td><td>91.59</td><td>92.21</td><td>90.76</td><td>1</td></tr><tr><td>EarlyBERTLARGE</td><td>85.13</td><td>89.22</td><td>90.64</td><td>90.94</td><td>89.45</td><td>35~40%</td></tr><tr><td>RandomLARGE</td><td>78.45</td><td>84.46</td><td>89.89</td><td>88.65</td><td>88.79</td><td>40~45%</td></tr><tr><td>LayerDrop (Fan et al., 2019)</td><td>85.12</td><td>91.12</td><td>88.88</td><td>89.97</td><td>89.44</td><td>~33%</td></tr></table>
123
+
124
+ Ablation Studies on Fine-tuning We perform extensive ablation studies to investigate important hyperparameter settings in EarlyBERT, using EarlyBERTBASE as our testing bed. For all experiments, we use the average accuracy on the larger datasets from GLUE benchmark (MNLI, QNLI, QQP and SST-2) as the evaluation metric.
125
+
126
+ • Number of training epochs and learning rate. We first investigate whether we can properly reduce the number of training epochs, and if scaling the learning rate can help compliment the negative effect caused by reducing training steps. Results in Figure 2 show that when we fine-tune EarlyBERT for fewer epochs on GLUE benchmark, up-scaling learning rate first helps to recover performance, and then causes decrease again. We will use two epochs and $4 \times 1 0 ^ { - 5 }$ as learning rate for EarlyBERT on GLUE experiments.
127
+
128
+ • Regularization strength $\lambda .$ . A proper selection of the regularization strength $\lambda$ decides the quality of the winning ticket, consequently the performance of EarlyBERT after pre-training/finetuning. Results on different strength settings in Table 3 show that the regularization strength $\lambda$ has marginal influence on EarlyBERT performance. We use $\lambda = 1 0 ^ { - 4 }$ that achieves the best performance in following experiments.
129
+
130
+ • Pruning ratios $\rho$ . We further investigate the effects of different pruning ratios as well as layerwise/global pruning on the performance of EarlyBERT. As discussed in Sec. 3.2, we only consider layer-wise pruning for self-attention heads. Table 4 shows that the performance monotonically decreases when we prune more self-attention heads from BERT; however, we see a slight increase and then a sharp decrease in accuracy, when the pruning ratio is raised for intermediate neurons in fully-connected sub-layers $4 0 \%$ pruning ratio seems to be the sweet spot). We also observe consistent superiority of global pruning over layer-wise pruning for intermediate neurons.
131
+
132
+ # 4.3 EXPERIMENTS ON PRE-TRAINING
133
+
134
+ We also conduct pre-training experiments and present the main results in Table 5. Similar to the settings in fine-tuning experiments, we prune 4 heads in each layer from BERTBASE and 6 heads from BERTLARGE; however, we prune slightly fewer $( 3 0 \% )$ intermediate neurons in fully-connected sublayers in both models, since we empirically observe that pre-training is more sensitive to aggressive intermediate neuron pruning. In both phases of pre-training, we reduce the training steps to $80 \%$ of the default setting when training EarlyBERT (based on the ablation study shown in Figure 3). Other hyperparameters for pre-training follow the default setting described in Sec. 4.1. All models are fine-tuned and evaluated on GLUE (Wang et al., 2018) and SQuAD v1.1 datasets (Rajpurkar et al., 2016) with the default setting. Since we observe that the randomly pruned models do not competitive performance in fine-tuning experiment for all downstream tasks, in this section we focus on comparing the achievable performance EarlyBERT with full BERT baseline.
135
+
136
+ ![](images/53de4ee25232c6cf199cce8940f110e70ffbc7fd00618b608cf818901a60568a.jpg)
137
+ Figure 2: Effect of reducing training epochs and up-scaling learning rate for EarlyBERT in fine-tuning.
138
+
139
+ Table 3: Ablation of regularization strength $\lambda$ .
140
+
141
+ <table><tr><td>入</td><td>10-4</td><td>10-3</td><td>10-2</td></tr><tr><td>Avg. Acc.</td><td>89.10</td><td>88.81</td><td>88.93</td></tr></table>
142
+
143
+ Table 4: Ablation of pruning ratios on self-attention heads and intermediate neurons.
144
+
145
+ <table><tr><td>#Pruned Heads</td><td>4</td><td>5</td><td>6</td></tr><tr><td>Layer-wise pruning</td><td>89.10</td><td>88.69</td><td>88.26</td></tr><tr><td># Pruned Neurons</td><td>30%</td><td>40%</td><td>50%</td></tr><tr><td> Layer-wise pruning</td><td>88.33</td><td>88.48</td><td>87.91</td></tr><tr><td>Global pruning</td><td>88.54</td><td>88.70</td><td>88.01</td></tr></table>
146
+
147
+ Table 5: Performance of EarlyBERT (pre-training) compared with BERT baselines.
148
+
149
+ <table><tr><td>Methods</td><td>CoLA</td><td>MNLI</td><td>MRPC</td><td>QNLI</td><td>QQP</td><td>RTE</td><td>SST-2</td><td>SQuAD</td></tr><tr><td>BERTBASE</td><td>0.45</td><td>81.40</td><td>84.07</td><td>89.86</td><td>89.80</td><td>60.29</td><td>90.48</td><td>87.60</td></tr><tr><td>EarlyBERTBASE</td><td>0.41</td><td>79.97</td><td>80.39</td><td>89.86</td><td>89.44</td><td>61.01</td><td>90.94</td><td>85.48</td></tr><tr><td>BERTLARGE</td><td>0.50</td><td>83.56</td><td>85.90</td><td>90.44</td><td>90.45</td><td>59.93</td><td>92.55</td><td>90.43</td></tr><tr><td>EarlyBERTLARGE</td><td>0.47</td><td>82.54</td><td>85.54</td><td>90.46</td><td>90.38</td><td>61.73</td><td>91.51</td><td>89.36</td></tr></table>
150
+
151
+ From the results presented in Table 5, we can see that on downstream tasks with larger datasets such as QNLI, QQP and SST-2 we can achieve accuracies that are close to BERT baseline (within $1 \%$ accuracy gaps except for EarlyBERTBASE on MNLI and SQuAD). However, on downstream tasks with smaller learning rate, the patterns are not consistent: we observe big drops on CoLA and MRPC but improvement on RTE. Overall, EarlyBERT achieves comparable performance while saving $30 \sim 3 5 \%$ training time thanks to its structured sparsity and reduction in training steps.
152
+
153
+ Reducing Training Steps in Pre-training We investigate whether EarlyBERT, when non-essential heads and/or intermediate neurons are pruned, can train more efficiently, and whether we can reduce the number of training steps in pre-training. This can further help reduce training cost in addition to the efficiency gain from pruning. We use EarlyBERTBASESelf (only self-attention heads are pruned when drawing the winning ticket) as the testing bed. Figure 3 shows the performance decreases more when we reduce the number of training steps to $60 \%$ or less. Reducing it to $80 \%$ seems to be a sweet point with the best balance between performance and efficiency.
154
+
155
+ ![](images/f570bb768b9f42cfb8a25f43111639181bd1f083ab4afa9f6e087c5007461b5e.jpg)
156
+ Figure 3: Effect of reducing training steps in pre-training on EarlyBERTBASE.
157
+
158
+ # 5 CONCLUSION
159
+
160
+ In this paper, we present EarlyBERT, an efficient training framework for large-scale language model pre-training and fine-tuning. Based on Lottery Ticket Hypothesis, EarlyBERT identifies structured winning tickets in an early stage, then uses the pruned network for efficient training. Experimental results on GLUE and SQuAD demonstrate that the proposed method is able to achieve comparable performance to standard BERT with much less training time. Future work includes applying EarlyBERT to other pre-trained language models and exploring more data-efficient strategies to enhance the current training pipeline.
161
+
162
+ # REFERENCES
163
+
164
+ Tianlong Chen, Jonathan Frankle, Shiyu Chang, Sijia Liu, Yang Zhang, Zhangyang Wang, and Michael Carbin. The lottery ticket hypothesis for pre-trained bert networks, 2020.
165
+
166
+ 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.
167
+
168
+ Utku Evci, Trevor Gale, Jacob Menick, Pablo Samuel Castro, and Erich Elsen. Rigging the lottery: Making all tickets winners. In MLSys, pp. 471–481. 2020.
169
+
170
+ Angela Fan, Edouard Grave, and Armand Joulin. Reducing transformer depth on demand with structured dropout. arXiv preprint arXiv:1909.11556, 2019.
171
+
172
+ Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. In ICLR, 2019.
173
+
174
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, pp. 770–778, 2016.
175
+
176
+ Xiaoqi Jiao, Yichun Yin, Lifeng Shang, Xin Jiang, Xiao Chen, Linlin Li, Fang Wang, and Qun Liu. Tinybert: Distilling bert for natural language understanding. arXiv preprint arXiv:1909.10351, 2019.
177
+
178
+ Zhuohan Li, Eric Wallace, Sheng Shen, Kevin Lin, Kurt Keutzer, Dan Klein, and Joseph E. Gonzalez. Train large, then compress: Rethinking model size for efficient training and inference of transformers, 2020.
179
+
180
+ Zhuang Liu, Jianguo Li, Zhiqiang Shen, Gao Huang, Shoumeng Yan, and Changshui Zhang. Learning efficient convolutional networks through network slimming. In ICCV, 2017.
181
+
182
+ Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017.
183
+
184
+ J Scott McCarley. Pruning a bert-based question answering model. arXiv preprint arXiv:1910.06360, 2019.
185
+
186
+ Paul Michel, Omer Levy, and Graham Neubig. Are sixteen heads really better than one? In NeurIPS, 2019.
187
+
188
+ Ari Morcos, Haonan Yu, Michela Paganini, and Yuandong Tian. One ticket to win them all: generalizing lottery ticket initializations across datasets and optimizers. In NeurIPS, pp. 4932–4942, 2019.
189
+
190
+ Sai Prasanna, Anna Rogers, and Anna Rumshisky. When bert plays the lottery, all tickets are winning. arXiv preprint arXiv:2005.00561, 2020.
191
+
192
+ Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. arXiv preprint arXiv:1910.10683, 2019.
193
+
194
+ Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: $1 0 0 { , } 0 0 0 { + }$ questions for machine comprehension of text, 2016.
195
+
196
+ Hubert Ramsauer, Bernhard Schafl, Johannes Lehner, Philipp Seidl, Michael Widrich, Lukas Gru- ¨ ber, Markus Holzleitner, Milena Pavlovic, Geir Kjetil Sandve, Victor Greiff, et al. Hopfield ´ networks is all you need. arXiv preprint arXiv:2008.02217, 2020.
197
+
198
+ Alex Renda, Jonathan Frankle, and Michael Carbin. Comparing rewinding and fine-tuning in neural network pruning. arXiv preprint arXiv:2003.02389, 2020.
199
+
200
+ Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter. arXiv preprint arXiv:1910.01108, 2019.
201
+
202
+ Sheng Shen, Zhen Dong, Jiayu Ye, Linjian Ma, Zhewei Yao, Amir Gholami, Michael W Mahoney, and Kurt Keutzer. Q-bert: Hessian based ultra low precision quantization of bert. In AAAI, pp. 8815–8821, 2020.
203
+
204
+ M. Shoeybi, M. Patwary, R. Puri, P. LeGresley, J. Casper, and Bryan Catanzaro. Megatron-lm: Training multi-billion parameter language models using model parallelism. arXiv, 2019.
205
+
206
+ Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
207
+
208
+ S. Sun, Yu Cheng, Zhe Gan, and Jingjing Liu. Patient knowledge distillation for bert model compression. In EMNLP, 2019.
209
+
210
+ Zhiqing Sun, Hongkun Yu, Xiaodan Song, Renjie Liu, Yiming Yang, and Denny Zhou. MobileBERT: a compact task-agnostic BERT for resource-limited devices. In ACL, 2020.
211
+
212
+ Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS, pp. 5998–6008, 2017.
213
+
214
+ Elena Voita, David Talbot, Fedor Moiseev, Rico Sennrich, and Ivan Titov. Analyzing multi-head self-attention: Specialized heads do the heavy lifting, the rest can be pruned. arXiv preprint arXiv:1905.09418, 2019.
215
+
216
+ Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R Bowman. Glue: A multi-task benchmark and analysis platform for natural language understanding. arXiv preprint arXiv:1804.07461, 2018.
217
+
218
+ Ziheng Wang, Jeremy Wohlwend, and Tao Lei. Structured pruning of large language models. arXiv preprint arXiv:1910.04732, 2019.
219
+
220
+ Wei Wen, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Learning structured sparsity in deep neural networks. In NeurIPS, pp. 2074–2082, 2016.
221
+
222
+ Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Remi Louf, Morgan Funtowicz, et al. Huggingface’s transformers: ´ State-of-the-art natural language processing. ArXiv, pp. arXiv–1910, 2019.
223
+
224
+ Ji Xin, Raphael Tang, Jaejun Lee, Yaoliang Yu, and Jimmy Lin. DeeBERT: Dynamic early exiting for accelerating BERT inference. In ACL, pp. 2246–2251, Online, July 2020. Association for Computational Linguistics.
225
+
226
+ Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Russ R Salakhutdinov, and Quoc V Le. Xlnet: Generalized autoregressive pretraining for language understanding. In NeurIPS, 2019.
227
+
228
+ Haoran You, Chaojian Li, Pengfei Xu, Yonggan Fu, Yue Wang, Xiaohan Chen, Richard G. Baraniuk, Zhangyang Wang, and Yingyan Lin. Drawing early-bird tickets: Toward more efficient training of deep networks. In ICLR, 2020a.
229
+
230
+ Yang You, Jing Li, Sashank Reddi, Jonathan Hseu, Sanjiv Kumar, Srinadh Bhojanapalli, Xiaodan Song, James Demmel, Kurt Keutzer, and Cho-Jui Hsieh. Large batch optimization for deep learning: Training bert in 76 minutes. In ICLR, 2020b.
231
+
232
+ Haonan Yu, Sergey Edunov, Yuandong Tian, and Ari S Morcos. Playing the lottery with rewards and multiple languages: lottery tickets in rl and nlp. In ICLR, 2019.
233
+
234
+ Ofir Zafrir, Guy Boudoukh, Peter Izsak, and Moshe Wasserblat. Q8bert: Quantized 8bit bert. arXiv preprint arXiv:1910.06188, 2019.
235
+
236
+ Hattie Zhou, Janice Lan, Rosanne Liu, and Jason Yosinski. Deconstructing lottery tickets: Zeros, signs, and the supermask. In NeurIPS, pp. 3597–3607, 2019.
md/train/Ic9vRN3VpZ/Ic9vRN3VpZ.md ADDED
@@ -0,0 +1,237 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Neo-GNNs: Neighborhood Overlap-aware Graph Neural Networks for Link Prediction
2
+
3
+ Seongjun Yun, Seoyoon Kim, Junhyun Lee, Jaewoo Kang∗ , Hyunwoo J. Kim∗
4
+
5
+ Department of Computer Science and Engineering Korea University {ysj5419, sykim45, ljhyun33, kangj, hyunwoojkim}@korea.ac.kr
6
+
7
+ # Abstract
8
+
9
+ Graph Neural Networks (GNNs) have been widely applied to various fields for learning over graph-structured data. They have shown significant improvements over traditional heuristic methods in various tasks such as node classification and graph classification. However, since GNNs heavily rely on smoothed node features rather than graph structure, they often show poor performance than simple heuristic methods in link prediction where the structural information, e.g., overlapped neighborhoods, degrees, and shortest paths, is crucial. To address this limitation, we propose Neighborhood Overlap-aware Graph Neural Networks (Neo-GNNs) that learn useful structural features from an adjacency matrix and estimate overlapped neighborhoods for link prediction. Our Neo-GNNs generalize neighborhood overlap-based heuristic methods and handle overlapped multi-hop neighborhoods. Our extensive experiments on Open Graph Benchmark datasets (OGB) demonstrate that Neo-GNNs consistently achieve state-of-the-art performance in link prediction.
10
+
11
+ # 1 Introduction
12
+
13
+ Graph-structured data is ubiquitous in a wide range of domains ranging from social network analysis [1, 2, 3] to biology [4, 5, 6, 7] and computer vision [8, 9, 10]. In recent years, numerous variants of Graph neural networks (GNNs) have been proposed for learning representations over graph-structured data. GNNs learn low dimensional representations of nodes or graphs via iterative aggregation of features from neighbors using non-linear transformations. In this manner, GNNs have shown significant improvements over traditional methods, e.g., heuristic methods and embedding-based methods, and achieved state-of-the-art performance on various tasks, such as node classification [11, 12, 13, 14, 15], graph classification [16, 17, 18, 19, 20], and graph generation [21, 22, 23, 24].
14
+
15
+ However, in link prediction, traditional heuristic methods still show competitive performance compared to GNNs, which often even outperform GNNs. This is because structural information, (e.g., overlapped neighborhoods, degrees, and shortest path), is crucial for link prediction whereas GNNs heavily rely on smoothed node features rather than graph structure. Recently, SEAL [25] has been proposed to consider structural information for link prediction by utilizing the relative distance between the target node pair and their neighborhoods. Nonetheless, SEAL requires the expensive computational cost to apply a GNN independently to an extracted subgraph for each target node pair.
16
+
17
+ To address this limitation, we propose Neighborhood Overlap-aware Graph Neural Networks (NeoGNNs) that are designed to consider key structural information regarding links without manual processes. Specifically, instead of using input node features, Neo-GNNs first learn to generate useful structrual features for each node from an adjacency matrix. Then Neo-GNNs measure the existence of links by considering the structural features of overlapped neighbhorhoods via neighbhorhood overlap-aware aggregation scheme. Finally, to consider both structural information and input node features, our proposed model adaptively combines scores from Neo-GNNs and feature-based GNNs in an end-to-end fashion. We show that Neo-GNNs consistently outperform both state-of-the-art GNNs and heuristic methods on four Open Graph Benchmark datasets (OGB) for link prediction. Furthermore, Our Neo-GNNs generalize the neighborhood overlap-based heuristic methods which measure the likelihood of the link based on manually designed structural information of overlapped neighbors.
18
+
19
+ Our contributions are as follows: (i) We propose Neighborhood Overlap-aware Graph Neural Networks (Neo-GNNs) that learn useful structural features from an adjacency matrix and estimate overlapped neighborhoods for link prediction. (ii) Neo-GNNs generalize neighborhood overlap-based heuristic methods and handle overlapped multi-hop neighborhoods. (iii) Our extensive experiments on Open Graph Benchmark datasets (OGB) demonstrate that Neo-GNNs consistently achieve state-of-the-art performance in link prediction.
20
+
21
+ # 2 Related Works
22
+
23
+ Graph Neural Networks. GNNs have been designed to learn node representations by using neural networks on graph topology. Among deep learning based approaches, the message passing scheme is dominantly used in recent studies such as GCN [11], GraphSAGE [26], and GAT [12]. Due to the iterative aggregation step, each node representation vector can have information of neighbor nodes in multi-hop relationships required for downstream tasks. However, there is a limitation of the expressive power that is upper-bounded by the 1-Weisfeiler-Lehman (1-WL) graph isomorphism test. To overcome this limitation, recent works have tried to boost the expressive power of GNNs by augmenting node features with ordering vectors or position-aware vectors [11, 27, 28]. The main purpose of these works is to complement GNNs with structural information which is crucial for prediction tasks. Our study focuses on adaptively incorporating structural information to GNNs for the link prediction task.
24
+
25
+ Link Prediction. Link prediction has been studied in various ways. Conventionally, diverse heuristic methods have been proposed for link prediction. They basically measure the scores of given node pairs based on structural information e.g., overlapped neighbors and shortest path, about the pair of nodes. Common neighbors and preferential attachment [29] exploit structural information about one-hop neighbors to compute the score. To consider more than one-hop relationships, second-order heuristic methods (e.g., Adamic-Adar [30] and resource allocation [31]) and higher-order heuristic methods (e.g., Katz [32] , PageRank [33] , and SimRank [34]) have been proposed. Heuristic methods are extremely effective for link prediction. However, they require manually designed structural information for each heuristic method. To overcome this limitation, embedding-based methods have been proposed. They learn node embeddings based on connections between nodes and compute similarity scores using the embeddings. Typically, Matrix factorization [35] learns node embeddings by decomposing an adjacency matrix of the graph. Random walk-based embedding methods such as Deepwalk [36], and node2vec [37] learn node embeddings by applying the Skip-Gram [38] techniques on the random walks. LINK [39] learns to classify the existence of links based on each row in the adjacency matrix, which includes connectivity information. Since the performance of the embedding methods depends on the sparsity of the input graph, it is hard to regard these methods as generalized ones. Recently, with the success of GNNs in learning graph representations, there have been several attempts to apply them to the link prediction task. Typically, GAE and VGAE [40] learn node representations through GCN to reconstruct the input graph in the auto-encoder framework. Based on the GAE, various GNN architectures have been applied to link prediction. On the other hand, SEAL [25] reformulated the link prediction task to the classification of enclosing subgraphs. Instead of directly predicting the link, enclosing graphs are sampled around each target link to compose dataset and SEAL performs the graph classification task. Due to the node labeling step to mark nodes’ different roles in an enclosing subgraph, SEAL has better performance than GAE even though both are GNN-based methods. However, constructing subgraphs is inefficient because it requires a large amount of computation, whereas our model is as efficient as GAE and can consider structural information like SEAL.
26
+
27
+ # 3 Methods
28
+
29
+ The goal of our framework, Neighborhood Overlap-aware Graph Neural Networks (Neo-GNNs), is to learn useful structural features from an adjacency matrix and estimate overlapped neighbors for link prediction. We begin with defining the basic notions of graph neural networks for link prediction and review neighborhood overlap-based heuristic methods, and then introduce Neo-GNNs.
30
+
31
+ # 3.1 Preliminaries
32
+
33
+ Notations. Consider an undirected graph $\mathcal { G } = ( \nu , \mathcal { E } )$ with $N$ nodes, where $\mathcal { V } = \{ v _ { 1 } , v _ { 2 } , \ldots , v _ { N } \}$ represents a set of nodes and $\mathcal { E } = \{ e _ { i j } \ | \ v _ { i } , v _ { j } \ \in \mathcal { V } \}$ represents a set of edges where the nodes $v _ { i } , v _ { j } \in \mathcal { V }$ are connected. The adjacency matrix $A \in \mathbf { R } ^ { N \times N }$ is defined by $A _ { i j } = 1$ if $e _ { i j } \in \mathcal { E }$ and 0 otherwise. The degree matrix $D \in { \bf R } ^ { N \times N }$ is a diagonal matrix defined by $\begin{array} { r } { D _ { i i } = \sum _ { j } A _ { i j } } \end{array}$ . The nodes of $\mathcal { G }$ have their own feature vectors $\boldsymbol { x } _ { i } \in \mathbf { R } ^ { F }$ $( i \in \{ 1 , 2 , \ldots , N \} )$ , with $X \in \mathbf { R } ^ { N \times F }$ denoting the collection of such vectors in a matrix form.
34
+
35
+ Graph Neural Networks for Link Prediction. Given a graph $\mathcal { G }$ and a feature matrix $X$ , graph neural networks learn meaningful node representations by an iterative aggregation of transformed representations of neighbor nodes in each $l$ -th GNN layer as follows:
36
+
37
+ $$
38
+ \begin{array} { r } { H ^ { ( l + 1 ) } = \sigma \left( \tilde { A } _ { \mathrm { G N N } } H ^ { ( l ) } W ^ { ( l ) } \right) , } \end{array}
39
+ $$
40
+
41
+ where $\tilde { A } _ { \mathbf { G N N } } \in \mathbf { R } ^ { N \times N }$ is the adjacency matrix normalized in different ways depending on each GNN architecture (e.g., D˜ − 12 (A + I )D˜ − 12 ), W (l) ∈ Rd(l)×d(l+1) i s a trainable weight matrix, and $H ^ { ( 0 ) }$ is the node feature matrix $X \in \mathbf { R } ^ { N \times F }$ . After stacking $L$ GNN layers, node representations $H ^ { ( L ) }$ are then used to predict existence of each link $( i , j )$ :
42
+
43
+ $$
44
+ \hat { y } _ { i j } = \sigma ( s ( h _ { i } ^ { ( L ) } , h _ { j } ^ { ( L ) } ) ) ,
45
+ $$
46
+
47
+ where $s ( \cdot , \cdot )$ is a function, e.g., inner product or MLP, and $h _ { i } ^ { ( L ) }$ is the representation of the node $i$ from $H ^ { ( L ) }$ .
48
+
49
+ # 3.2 Neighborhood Overlap-based Heuristic Methods
50
+
51
+ Heuristic methods for link prediction measure the score of given node pairs based on structural information about the node pairs, e.g., shortest path, degree, and common neighbors. Although GNNs outperform existing traditional heuristic methods in various graph tasks, in link prediction, since GNNs heavily rely on smoothed node features rather than graph structure, the heuristic methods often show competitive performance compared to GNNs. Especially, neighborhood overlap-based heuristic methods are straightforward yet highly effective, even better than GNN models in several datasets, e.g., ogbl-collab and ogbl-ppa. Typical neighborhood overlap-based heuristic methods are Common Neighbors, Resource Allocation (RA) [31], and Adamic Adar [30]. The Common Neighbors method measures the score of link $( u , v )$ by counting the number of common neighbors between node $u$ and $v$ as
52
+
53
+ $$
54
+ \mathit { S c N } ( u , v ) = \left| \mathcal { N } ( u ) \cap \mathcal { N } ( v ) \right| = \sum _ { k \in \mathcal { N } ( u ) \cap \mathcal { N } ( v ) } 1 .
55
+ $$
56
+
57
+ The Common Neighbors method is simple and effective, but has a limitation that equally weighs the importance of each common neighbor. To solve this issue, several heuristic methods e.g., Resource Allocation, and Adamic-Adar measure the score for the link by considering the importance of each common neighbor. From the intuition that neighbor nodes with lower degrees are more significant, they give more weight to neighbors with lower degrees. Specifically, Resource Allocation (RA) [31] measures the score of link $( u , v )$ by counting the inverse degrees of common neighbors between node $u$ and $v$ as
58
+
59
+ $$
60
+ S _ { R A } ( u , v ) = \sum _ { k \in \mathcal { N } ( u ) \cap \mathcal { N } ( v ) } \frac { 1 } { d _ { k } } ,
61
+ $$
62
+
63
+ where $d _ { k }$ denotes the degree of node $k$ . Adamic-Adar has a relatively decreased penalty for higher degree compared to RA by using the reciprocal logarithm of common neighbors’ degrees between
64
+
65
+ ![](images/09c76c16cea1518b521ed316a7261cfcd630e83900e5fe848689b282756ac108.jpg)
66
+ Figure 1: The Neo-GNNs framework for link prediction. Neo-GNNs learn useful structural features from an adjacency matrix and estimate similarity scores based on overlapped neighborhoods. (a) Neo-GNNs first generate the structural feature vector $\boldsymbol { x } ^ { s t r u c t } \in \mathbf { R } ^ { N \times 1 }$ from an adjacency matrix $A \in \mathbf { R } ^ { N \times N }$ by using Structural feature generator $\mathcal { F } _ { \theta }$ , i.e., ${ \mathcal { F } } _ { \theta } ( A )$ . Then to consider only features of overlapped neighbors between nodes, (b) Neo-GNNs construct a diagonal matrix $X ^ { s t r u c t } \in \mathbf { R } ^ { N \times N }$ and (c) aggregate the features of multi-hop neighborhoods by multiplying the sum of powers of adjacency matrices, i.e., $\textstyle \sum _ { l = 1 } ^ { L } { \beta ^ { l - 1 } } A ^ { l }$ . Finally, two node representations $Z$ and $H$ , respectively from Neo-GNNs and feature-based GNNs, are used to (d) compute similarity scores and combined adaptively with the learnable parameter $\alpha$ .
67
+
68
+ node $u$ and $v$ as
69
+
70
+ $$
71
+ S _ { A A } ( u , v ) = \sum _ { k \in \mathcal { N } ( u ) \cap \mathcal { N } ( v ) } \frac { 1 } { \log d _ { k } } .
72
+ $$
73
+
74
+ These heuristic methods show comparable performance to GNNs for link prediction.
75
+
76
+ However, they have two limitations. First, each heuristic method uses manually designed structural features of neighborhoods, e.g., 1, $\textstyle { \frac { 1 } { d } }$ , $\frac { 1 } { \log d }$ . This requires the manual choice by domain experts to select the best heuristic method for each dataset. Second, they only consider structural similarity. While the GNNs do not use graph structures well compared to using node features, heuristic methods cannot utilize the node features for link prediction.
77
+
78
+ To address the limitations of both GNNs and heuristic methods, we propose Neighborhood Overlapaware Graph Neural Networks (Neo-GNN), that learn useful structural features from an adjacency matrix and estimate overlapped neighborhoods for link prediction, and adaptively combine with the conventional feature-based GNNs in an end-to-end fashion.
79
+
80
+ # 3.3 Neighborhood Overlap-aware Graph Neural Networks
81
+
82
+ We now introduce Neighborhood Overlap-aware Graph Neural Networks (Neo-GNNs) for link prediction. We first explain how Neo-GNNs learn and utilize structural information for link prediction and then explain the process of adaptively combining with the feature-based GNNs.
83
+
84
+ Neo-GNNs consist of two key components: (1) Structural feature generator and (2) neighborhood overlap-aware aggregation scheme. First, as we discussed in section 3.2, each heuristic method uses manually designed structural features of neighborhoods, 1, $\textstyle { \frac { 1 } { d } }$ , $\frac { 1 } { \log d }$ . To generalize and learn these structural features, we propose Structural feature generator $\mathcal { F } _ { \theta }$ which learns to generate structural features of each node using an only adjacency matrix $A \in \mathbf { R } ^ { N \times N }$ of the graph as
85
+
86
+ $$
87
+ x _ { i } ^ { s t r u c t } = \mathcal { F } _ { \theta } ( A _ { i } ) = f _ { \theta _ { n o d e } } \left( \sum _ { j \in \mathcal { N } _ { i } } f _ { \theta _ { e d g e } } ( A _ { i j } ) \right) ,
88
+ $$
89
+
90
+ where $x _ { i } ^ { s t r u c t }$ is a structural feature value of the node $i$ and $\mathcal { F } _ { \theta }$ is a learnable function comprised of two MLPs, $f _ { \theta _ { n o d e } }$ and $f _ { \theta _ { e d g e } }$ , for nodes and edges, respectively. That is to say, Neo-GNNs take only an adjacency matrix $A$ as an input to generate the most beneficial structural features. This input adjacency matrix $A$ can be replaced with the combination of powers of adjacency matrices. Now, Structural feature generator $\mathcal { F } _ { \theta }$ can generate structural features for each heuristic method. For example, if $f _ { \theta _ { n o d e } }$ is a reciprocal of the logarithm function, i.e., $\begin{array} { r } { f ( x ) = \frac { 1 } { \log x } } \end{array}$ , and $f _ { \theta _ { e d g e } }$ is an identity function, i.e., $f ( x ) = x$ , then Structural feature generator $\mathcal { F } _ { \theta }$ can generate the exactly same structural feature as the features used in Adamic-Adar method.
91
+
92
+ Based on the generated structural features of each node, the next process is to calculate the similarity score that considers only structural features of overlapped neighbors between given nodes. Note that conventional GNNs cannot compute this score due to two reasons: the normalized adjacency matrix and the lower dimension of hidden representations than the number of nodes (i.e., $d \ll N$ ). The normalized adjacency matrix hinders GNNs counting a number of neighborhoods and the low dimension makes features of each neighborhoods indistinguishable after aggregation, which cannot detect the neighborhoods overlap. We propose the neighborhood overlap-aware aggregation scheme to calculate neighborhood overlap-aware score. First, to maintain the respective features of each node after aggregation, we construct a diagonal matrix $X ^ { s t r u c t } \in \mathbf { R } ^ { N \times N }$ using the structural feature vector $\boldsymbol { x } ^ { s t r u c t } \in \mathbf { R } ^ { N \times 1 }$ as
93
+
94
+ $$
95
+ X ^ { s t r u c t } = \mathrm { { d i a g } } ( x ^ { s t r u c t } ) .
96
+ $$
97
+
98
+ Then, to consider the number of overlapped neighbors, we aggregate features of neighborhoods by multiplying an unnormalized adjacency matrix $A$ as
99
+
100
+ $$
101
+ Z = A X ^ { s t r u c t } .
102
+ $$
103
+
104
+ Now, each $i$ -th row vector of $Z , z _ { i }$ , involves all the features of node $i$ ’s neighboring nodes individually. If we compute the inner product of two row vectors in $Z$ , then we can compute the scores with the only overlapped neighborhoods, which equals the sum of square of structural feature values of overlapped neighborhoods, i.e., $\begin{array} { r } { z _ { i } ^ { T } z _ { j } = \sum _ { k \in \dot { \mathcal { N } } ( i ) \cap \mathcal { N } ( j ) } \big ( x _ { k } ^ { s t r u c t } \big ) ^ { 2 } } \end{array}$ .
105
+
106
+ Furthermore, to consider multi-hop overlapped neigbhors, we extend (8) to multi-hop settings as follows:
107
+
108
+ $$
109
+ Z = g _ { \Phi } \left( \sum _ { l = 1 } ^ { L } \beta ^ { l - 1 } A ^ { l } X ^ { s t r u c t } \right) ,
110
+ $$
111
+
112
+ where $\beta$ denotes a hyper-parameter controlling how much weight is given to close neighbors versus distant neighbors and $g _ { \Phi }$ is a MLP which controls the scale of representations $Z$ . Since node representations $Z$ are based on only structural information, we compute feature-based node representations H ∈ RN × d 0 using the conventional feature-based GNNs as
113
+
114
+ $$
115
+ H = \mathbf { G } \mathbf { N } \mathbf { N } ( X , \tilde { A } _ { G N N } ; W ) ,
116
+ $$
117
+
118
+ where $X \in \mathbf { R } ^ { N \times F }$ denotes the raw feature matrix, $\tilde { A } _ { G N N }$ denotes a normalized adjacency matrix, and $W$ is the parameter for GNNs. Then given a link $( i , j )$ , Neo-GNNs calculate both similarity scores from each representation matrix $Z$ and $H$ and compute the convex combination of two scores by a trainable parameter $\alpha$ as follows:
119
+
120
+ $$
121
+ \hat { y } _ { i j } = \alpha \cdot \sigma ( z _ { i } ^ { T } z _ { j } ) + ( 1 - \alpha ) \cdot \sigma ( s ( h _ { i } , h _ { j } ) ) ) ,
122
+ $$
123
+
124
+ Based on (12), we jointly train our proposed model and individual models using three standard (binary) cross-entropy losses
125
+
126
+ $$
127
+ \mathcal { L } = \sum _ { ( i , j ) \in D } \big ( \lambda _ { 1 } B C E ( \hat { y } _ { i j } , y _ { i j } ) + \lambda _ { 2 } B C E ( \sigma ( z _ { i } ^ { T } z _ { j } ) , y _ { i j } ) + \lambda _ { 3 } B C E ( \sigma ( s ( h _ { i } , h _ { j } ) ) , y _ { i j } ) \big ) ,
128
+ $$
129
+
130
+ where $B C E ( \cdot , \cdot )$ denotes binary cross entropy loss and $\lambda _ { i }$ are the weights.
131
+
132
+ Table 1: Statistics and evaluation metrics of OGB link prediction datasets.
133
+
134
+ <table><tr><td>Dataset</td><td>#Nodes</td><td>#Edges</td><td>Avg. node deg.</td><td>Density</td><td>Split ratio</td><td>Metric</td></tr><tr><td>OGB-PPA</td><td>576,289</td><td>30,326,273</td><td>73.7</td><td>0.018%</td><td>70/20/10</td><td>Hits @100</td></tr><tr><td>OGB-COLLAB</td><td>235,868</td><td>1,285,465</td><td>8.2</td><td>0.0046%</td><td>92/4/4</td><td>Hits @50</td></tr><tr><td>OGB-DDI</td><td>4,267</td><td>1,334,889</td><td>500.5</td><td>14.67%</td><td>80/10/10</td><td>Hits@20</td></tr><tr><td>OGB-CITATION2</td><td>2,927,963</td><td>30,561,187</td><td>20.7</td><td>0.00036%</td><td>98/1/1</td><td>MRR</td></tr></table>
135
+
136
+ Computational Complexity. Our proposed model uses the $N \times N$ matrix $X ^ { s t r u c t }$ for neigbhorhood overlap detection, which generally takes $O ( N | \mathcal { E } | _ { L } )$ computational time to compute node representations $Z$ in (9), where $| \mathcal { E } | _ { L }$ denotes a number of edges connected up to $L$ -hop. To solve this high complexity issue, we represent matrices $X ^ { s t r u c t }$ and $Z$ as the sparse matrix form and the computational time becomes just $\bar { O } ( \vert \mathcal { E } \vert _ { L } )$ . Also, as we can pre-compute the set of adjacency matrices $\{ A ^ { l } \} _ { l = 1 } ^ { L }$ in (9), thus there is no additional cost to calculate the powers of the adjacency matrix during training and inference.
137
+
138
+ # 4 Experiments
139
+
140
+ In this section, we evaluate the benefits of our method against state-of-the-art models on link prediction benchmarks. Then we analyze the contribution of each component in Neo-GNNs and show how Neo-GNNs can actually generalize and learn neighborhood overlap-based heuristic methods.
141
+
142
+ # 4.1 Experiment Settings
143
+
144
+ Datasets. We evaluate the effectiveness of our Neo-GNNs for link prediction on Open Graph Benchmark datasets [41] (OGB) : OGB-PPA, OGB-Collab, OGB-DDI, OGB-Citation2. Note that OGB-Collab contains multiple edges. Detailed statistics of each dataset are summarized in Table 1.
145
+
146
+ Evaluation. The evaluation for link prediction is based on the ranking performance of positive test edges over negative test edges. Specifically, in OGB-PPA, OGB-Collab, OGB-DDI, each model ranks positive test edges against randomly-sampled negative edges, and computes the ratio of positive test edges that are ranked at K-th place or above (Hits $\ @ \mathrm { K } )$ . In OGB-Citation2, the evaluation metric is Mean Reciprocal Rank (MRR), where the reciprocal rank of the true link among the negative candidates is calculated for each source node, and then the average is taken over all source nodes.
147
+
148
+ Baselines. To demonstrate the effectiveness of our Neo-GNNs in link prediction, we compare Neo-GNNs with three heuristic link prediction methods, three embedding-based methods, and five GNN-based models. For heuristic methods, we used three well-known neighborhood-overlap based heuristic methods, Common Neighbors, Adamic Adar [30], and Resource Allocation [31]. Without learning process, they predict links by utilizing each designed structural information regarding overlapped neighborhoods. For embedding-based methods, we used Matrix Factorization, Node2Vec [42], and Multi-Layer Perceptron (MLP). Furthermore, we compare our method to GNN-based models, GCN [11], GraphSAGE [26], JK-Net [43], GAT [12], and SEAL [25]. GCN, GraphSAGE, JK-Net, and GAT compute representations for each node and predict target links by measuring the similarity score between the source and target node of the target links. SEAL extracts enclosing subgraphs around target links and predict target links based on representations of the enclosing subgraphs as graph classification.
149
+
150
+ Implementation Details. We reimplemented neighborhood overlap-based heuristic method,i.e., Common neighbors, Adamic Adar, and Resource allocation from the referenced papers by using PyTorch. For Node2Vec, GCN, GraphSAGE, JK-Net, and GAT, we used the implementation in PyTorch Geometric [44] and the implementation in the official github repository for SEAL. We set the number of layers to 3 and latent dimensionality to 256 for all GNN-based models. To train our method, we used GCN as a feature-based GNN based model and all MLP models in our Neo-GNNs consist of 2 fully connected layers. We jointly trained feature-based GNNs and Neo-GNNs. Since a GNN model requires more epochs for convergence than that of Neo-GNNs on OGB-PPA, and OGB-DDI, we adopted pre-trained GCN to handle this issue. In OGB-Citation2, due to memory issue, we fix the $f _ { \theta _ { e d g e } }$ as the identity function. For fair comparison, we reported performances of all baselines and our Neo-GNNs as the mean and the standard deviation of performances from 10 independent runs, where each seed is from 0 to 9. The experiments are conducted on a RTX 3090 (24GB) and a Quadro RTX (48GB).
151
+
152
+ Table 2: Link prediction performances $( \% )$ of our Neo-GNNs and baselines on Open Graph Benchmark (OGB) datasets. Each number is the average performance for 10 random initialization of the experiments. OOM denotes ’out of memory’. Bold indicates the second best performance and underline indicates the best performance.
153
+
154
+ <table><tr><td>Method</td><td>OGB-PPA</td><td>OGB-COLLAB</td><td>OGB-DDI</td><td>OGB-CITATION2</td></tr><tr><td>Common Neighbors</td><td>27.65 ± 0.00</td><td>50.06 ±0.00</td><td>17.73 ± 0.00</td><td>76.20±0.00</td></tr><tr><td>Adamic Adar</td><td>32.45 ± 0.00</td><td>53.00 ± 0.00</td><td>18.61 ± 0.00</td><td>76.12 ± 0.00</td></tr><tr><td>Resource Allocation</td><td>49.33 ± 0.00</td><td>52.89 ± 0.00</td><td>6.23± 0.00</td><td>76.20 ± 0.00</td></tr><tr><td>Matrix Factorization</td><td>27.83 ± 2.02</td><td>38.74 ± 0.30</td><td>17.92 ± 3.57</td><td>53.08 ± 4.19</td></tr><tr><td>Node2Vec</td><td>17.24 ± 0.76</td><td>41.36 ± 0.69</td><td>21.95 ± 1.58</td><td>53.47 ± 0.12</td></tr><tr><td>MLP</td><td>0.47± 0.05</td><td>19.98 ± 0.96</td><td>N/A</td><td>28.99 ± 0.16</td></tr><tr><td>GCN</td><td>16.98 ± 1.33</td><td>47.01 ± 0.79</td><td>44.60 ± 8.87</td><td>84.79 ± 0.24</td></tr><tr><td>GraphSAGE</td><td>13.93 ± 2.38</td><td>48.60 ± 0.46</td><td>48.01 ± 9.02</td><td>82.64 ± 0.01</td></tr><tr><td>JK-Net</td><td>11.40 ± 2.04</td><td>48.84 ± 0.83</td><td>57.98 ± 6.88</td><td>OOM</td></tr><tr><td>GAT</td><td>OOM</td><td>44.89 ± 1.23</td><td>29.51 ±6.40</td><td>OOM</td></tr><tr><td>SEAL</td><td>48.15 ± 4.17</td><td>54.37 ± 0.02</td><td>26.25 ±6.00</td><td>86.32 ± 0.52</td></tr><tr><td>Neo-GNN</td><td>49.13 ± 0.60</td><td>57.52 ± 0.37</td><td>63.57 ± 3.52</td><td>87.26 ± 0.84</td></tr></table>
155
+
156
+ # 4.2 Results on Link Prediction
157
+
158
+ Table 2 shows link prediction results of the baselines and Neo-GNNs on Open Graph Benchmark (OGB) datasets. We use GCN to adaptively combine with Neo-GNNs across all datasets except OGBCitation2. In OGB-Citation2, since GCN requires 46 GB memory to train, we trained our Neo-GNNs without GCN. As shown in Table 2, we can observe that Neo-GNNs consistently achieve state-ofthe-arts performance across all datasets. Especially, Neo-GNNs show significant improvements on OGB-Collab and OGB-DDI, where the improvements of Neo-GNNs over the best baseline are $5 . 4 \%$ and $9 . 6 \%$ , respectively. Furthermore, note that Neo-GNNs achieved state-of-the-art performance in OGB-Citation2 without GCN, that is, by using only graph structures without input node features. Interestingly, conventional feature-based GNNs show poor performance with a huge gap than that of neighborhood overlap-based heuristic methods on OGB-PPA and OGB-Collab. This implies that feature-based GNNs have a difficulty in directly utilizing structural information e.g., degree and overlapped neighbors, for link prediction. According to this implication, Neo-GNNs and SEAL are able to learn structural information, thus these methods accomplish better performance than conventional GNNs do. Moreover, Neo-GNNs and SEAL even show good performance compared to the heuristic methods in all datasets as they can capture structural information that the heuristic methods utilize. Although SEAL shows good performance compared to heuristic methods, SEAL shows poor performance than feature-based GNNs in OGB-DDI. One possible interpretation is that SEAL cannot adaptively utilize the input node features and structural features according to each data. Instead, Neo-GNNs adaptively combine Neo-GNNs and GCN for each dataset using the learnable parameter $\alpha$ , which shows even higher performance than each performance of Neo-GNNs and GCN. We further analyze the effectiveness of $\alpha$ in 4.2
159
+
160
+ # 4.3 Ablation Studies
161
+
162
+ We present ablation experiments to identify the benefits of different components of Neo-GNNs. First, we evaluate our Neo-GNNs without GCN and examine the effectiveness of the parameter $\alpha$ that adaptively combine scores from Neo-GNNs and GCN. Then we study the effects of considering multihop overlapped neighborhoods. Specifically, we investigate the effectiveness of two hyper-parameters, the decaying factor $\beta$ and the maximum hop $L$ , related to multi-hop overlapped neighborhoods.
163
+
164
+ Table 3: Ablation study analyzing the significance of Neo-GNNs on the OGB-PPA, OGB-Collab, OGB-DDI, and OGB-Citation2 datasets for link prediction. $\alpha$ denotes the attention weight of Neo-GNNs’ scores.
165
+
166
+ <table><tr><td>Dataset</td><td>α</td><td>Neo-GNN (w/ GCN)</td><td>Neo-GNN (w/o GCN)</td><td>GCN</td></tr><tr><td>PPA</td><td>0.98 ± 0.003</td><td>49.13 ± 0.60</td><td>48.63 ± 0.88</td><td>16.98 ± 1.33</td></tr><tr><td>COLLAB</td><td>0.57 ± 0.130</td><td>57.52 ± 0.37</td><td>55.70 ± 0.24</td><td>47.01 ± 0.79</td></tr><tr><td>DDI</td><td>0.48 ± 0.015</td><td>63.57 ± 3.52</td><td>17.38 ± 4.05</td><td>44.60 ± 8.87</td></tr><tr><td>CITATION2</td><td>N/A</td><td>0OM</td><td>87.26 ± 0.84</td><td>84.79 ± 0.24</td></tr></table>
167
+
168
+ ![](images/19fdc09cfde826ac8942b6d759e51cb35f51a84e97b747f08e2badb452f619b2.jpg)
169
+ Figure 2: Link prediction results on the OGB-Collab dataset by varying the maximum hop $L$ (left) and the decaying factor $\beta$ (right).
170
+
171
+ Neo-GNNs without GCN. To measure the effectiveness of Neo-GNNs itself, we perform an ablation study on four datasets, as shown in Table 3. We can see that Neo-GNNs (w/o GCN) still show the state-of-the-art performances compared to baselines except OGB-DDI. Note that Neo-GNNs (w/o GCN) only use graph structures and outperform other GNNs whereas other GNNs use both input features and graph structures. This shows that utilizing key structrual information about overlapped neighbors is crucial for link prediction.
172
+
173
+ Effectiveness of the parameter $\alpha$ . To consider both structural information and input features, our proposed model predict similarity scores from the convex combination of two scores from Neo-GNNs and GCN by the trainable parameter $\alpha$ . As shown in Table 3, $\alpha$ varies for each dataset, which indicates that $\alpha$ properly adjusts the weight of structural information and features for each dataset. With the combining process, Neo-GNNs (w/ GCN) consistently show better performance than performances of individual model, i.e., Neo-GNN (w/o GCN) and GCN. Especially, in OGB-DDI, Neo-GNN (w/o GCN) and GCN show less than 50, but the combined model Neo-GNN (w/ GCN) shows $42 \%$ and $80 \%$ improved performance compared to each model.
174
+
175
+ Effectiveness of multi-hop overlapped neighborhoods. We study the effectiveness of multi-hop overlapped neighborhoods by investigating effects of two hyper-parameters, $L$ and $\beta$ , on OGB-Collab dataset. First, as shown in Figure 2, if Neo-GNNs only consider 1-hop ovelapped neighbhors, i.e., $L = 1$ , Neo-GNNs converge faster than other cases considering multi-hop overlapped neighbors. However, the best performance is lower than the others, which shows that multi-hop overlapped neighborhoods enhance the performance of Neo-GNNs for link prediction. Second, $\beta$ controls how much to reduce the effects of neighborhoods when the distance increases. As shown in Figure 2, as $\beta$ decreases, Neo-GNNs converge slowly but eventually show similar performance. This means that if multi-hop overlapped neighbors are informative, then Neo-GNNs achieve good performance robustly to the value of $\beta$ .
176
+
177
+ # 4.4 Analysis on learning neighborhood overlap-based heuristic methods
178
+
179
+ As we discussed in Sec 3.3, our Neo-GNNs generalize several neighborhood overlap-based heuristic methods, (e.g., Common Neighbors, Adamic Adar, and Resource Allocation). Further, in this section, we show that Neo-GNNs (w/o GCN) directly learn each neighbhorhood overlap-based heuristic method and implicitly learn the best one among three heuristic methods on OGB-PPA dataset. We first trained Neo-GNNs to fit the scores from each heuristic method on the train set of OGB-PPA. Then we measure the Spearman correlations by using ranks of test edges from each model. We analyze rank correlations between Neo-GNNs and three heuristic methods based on 50000 sampled test edges in Figure 3. As shown in Figure 3, Neo-GNNs show a strong correlation with other heuristic methods. That is, Neo-GNNs can learn each heuristic method. Next, to show that Neo-GNNs learn the most desirable heuristic method depending on datasets, we compute Spearman correlations between ranks from trained Neo-GNNs on OGB-PPA dataset and the heuristic methods. As a result, correlation scores between Neo-GNNs and Resource Allocation, Adamic Adar, and Common Neighbors are 0.9627, 0.9277, and 0.8982, respectively. We can see that correlation scores are proportional to performances of each heuristic method (49.33, 32.45, and 27.65), which learn the best heuristic method.
180
+
181
+ ![](images/692e5a685e638c68cb8e31f7dbca25df06abc85b6950dcf5f84e9e12d9c99021.jpg)
182
+ Figure 3: Comparison of rank correlation between our Neo-GNNs and three neighborhood overlapbased heuristic methods on OGB-PPA. We evaluate a rank correlation on positive test edges after ranking the entire test edge prediction scores. We visualize a rank correlation using randomly sampled 50,000 positive test edges. The 3(a), 3(b), and 3(c) show rank correlation when Neo-GNNs (w/o GCN) fit to scores of each heuristic method. The 3(d), 3(e), and 3(f) present the rank correlation between Neo-GNNs (w/o GCN) and each heuristic method upon OGB-PPA. The number in parentheses indicates Spearman Correlation coefficient.
183
+
184
+ # 5 Conclusion
185
+
186
+ We introduced Neighborhood Overlap-based Graph Neural Networks (Neo-GNNs) that learn and utilize structural information, which is a key element in link prediction. Neo-GNNs learn useful structural features from an adjacency matrix and estimate overlapped neighborhoods for link prediction. We also adaptively combine Neo-GNNs and feature-based GNNs to consider both structural features and input node features. Furthermore, our Neo-GNNs generalize several neigbhorhood overlap-based heuristic methods and handle overlapped multi-hop neigbhorhoods. Extensive experiments on four Open Graph Benchmark (OGB) datasets demonstrate that Neo-GNNs consistently acheive stateof-the-art performance on four OGB datasets in link prediction. In future work, we plan to further develop Neo-GNNs to generalize more link prediction-based heuristic methods and improve the scalability with efficient sparse matrix computation.
187
+
188
+ # 6 Acknowledgement
189
+
190
+ This work was supported by the following funding sources: National Research Foundation of Korea (NRF-2020R1A2C3010638, NRF-2014M3C9A3063541); ICT Creative Consilience program(IITP2021-2020-0-01819) supervised by the IITP; Samsung Research Funding & Incubation Center of Samsung Electronics under Project Number SRFC-IT1701-51.
191
+
192
+ # References
193
+
194
+ [1] Jiezhong Qiu, Jian Tang, Hao Ma, Yuxiao Dong, Kuansan Wang, and Jie Tang. Deepinf: Social influence prediction with deep learning. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining (KDD), pages 2110–2119, 2018.
195
+ [2] Lei Tang and Huan Liu. Graph mining applications to social network analysis. In Managing and Mining Graph Data, pages 487–513. Springer, 2010.
196
+ [3] Hao Wang, Tong Xu, Qi Liu, Defu Lian, Enhong Chen, Dongfang Du, Han Wu, and Wen Su. Mcne: An end-to-end framework for learning multiple conditional network representations of social network. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery Data Mining (KDD), pages 1064–1072, 2019.
197
+ [4] Nicola De Cao and Thomas Kipf. Molgan: An implicit generative model for small molecular graphs. arXiv preprint arXiv:1805.11973, 2018.
198
+ [5] David K Duvenaud, Dougal Maclaurin, Jorge Iparraguirre, Rafael Bombarell, Timothy Hirzel, Alan Aspuru-Guzik, and Ryan P Adams. Convolutional networks on graphs for learning molecular fingerprints. In Advances in Neural Information Processing Systems (NeurIPS) 28, pages 2224–2232. Curran Associates, Inc., 2015.
199
+ [6] Alex Fout, Jonathon Byrd, Basir Shariat, and Asa Ben-Hur. Protein interface prediction using graph convolutional networks. In Advances in Neural Information Processing Systems (NeurIPS) 30, pages 6530–6539. Curran Associates, Inc., 2017.
200
+ [7] 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, Proceedings of Machine Learning Research, pages 1263– 1272, 2017.
201
+ [8] Helisa Dhamo, Azade Farshad, Iro Laina, Nassir Navab, Gregory D. Hager, Federico Tombari, and Christian Rupprecht. Semantic image manipulation using scene graphs. In The IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 5213–5222, 2020.
202
+ [9] Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 652–660, 2017.
203
+ [10] Yue Wang, Yongbin Sun, Ziwei Liu, Sanjay E Sarma, Michael M Bronstein, and Justin M Solomon. Dynamic graph cnn for learning on point clouds. Acm Transactions On Graphics (tog), 38(5):1–12, 2019.
204
+ [11] Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations, 2017.
205
+ [12] Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua ´ Bengio. Graph attention networks. arXiv preprint arXiv:1710.10903, 2017.
206
+ [13] Johannes Klicpera, Stefan Weiß enberger, and Stephan Günnemann. Diffusion improves graph learning. In Advances in Neural Information Processing Systems (NeurIPS) 32, pages 13333–13345. Curran Associates, Inc., 2019.
207
+ [14] Ming Chen, Zhewei Wei, Zengfeng Huang, Bolin Ding, and Yaliang Li. Simple and deep graph convolutional networks. In Proceedings of the 37th International Conference on Machine Learning (ICML), pages 1725–1735, 2020.
208
+ [15] Cheng Zheng, Bo Zong, Wei Cheng, Dongjin Song, Jingchao Ni, Wenchao Yu, Haifeng Chen, and Wei Wang. Robust graph representation learning via neural sparsification. In Proceedings of the 37th International Conference on Machine Learning (ICML), pages 11458–11468, 2020.
209
+ [16] Muhan Zhang, Zhicheng Cui, Marion Neumann, and Yixin Chen. An end-to-end deep learning architecture for graph classification. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018.
210
+ [17] Rex Ying, Jiaxuan You, Christopher Morris, Xiang Ren, William L Hamilton, and Jure Leskovec. Hierarchical graph representation learning with differentiable pooling. arXiv preprint arXiv:1806.08804, 2018.
211
+ [18] Junhyun Lee, Inyeop Lee, and Jaewoo Kang. Self-attention graph pooling. In Kamalika Chaudhuri and Ruslan Salakhutdinov, editors, Proceedings of the 36th International Conference on Machine Learning. PMLR, 2019.
212
+ [19] Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? arXiv preprint arXiv:1810.00826, 2018.
213
+ [20] Seongmin Ok. A graph similarity for deep learning. In Advances in Neural Information Processing Systems (NeurIPS) 33, pages 1–12. Curran Associates, Inc., 2020.
214
+ [21] Wengong Jin, Regina Barzilay, and Tommi Jaakkola. Junction tree variational autoencoder for molecular graph generation. In International Conference on Machine Learning, pages 2323–2332. PMLR, 2018.
215
+ [22] Wengong Jin, Regina Barzilay, and Tommi Jaakkola. Hierarchical generation of molecular graphs using structural motifs. In Proceedings of the 37th International Conference on Machine Learning (ICML), pages 4839–4848, 2020.
216
+ [23] Jenny Liu, Aviral Kumar, Jimmy Ba, Jamie Kiros, and Kevin Swersky. Graph normalizing flows. In Advances in Neural Information Processing Systems (NeurIPS) 32, pages 13556–13566. Curran Associates, Inc., 2019.
217
+ [24] Jiaxuan You, Bowen Liu, Rex Ying, Vijay Pande, and Jure Leskovec. Graph convolutional policy network for goal-directed molecular graph generation. In Advances in Neural Information Processing Systems (NeurIPS) 31, pages 6412–6422. Curran Associates, Inc., 2018.
218
+ [25] Muhan Zhang and Yixin Chen. Link prediction based on graph neural networks. In Advances in Neural Information Processing Systems, pages 5165–5175, 2018.
219
+ [26] William Hamilton, Rex Ying, and Jure Leskovec. Inductive representation learning on large graphs. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems 30, pages 1024–1034. Curran Associates, Inc., 2017.
220
+ [27] Haggai Maron, Heli Ben-Hamu, Nadav Shamir, and Yaron Lipman. Invariant and equivariant graph networks. In International Conference on Learning Representations, 2018.
221
+ [28] Jiaxuan You, Rex Ying, and Jure Leskovec. Position-aware graph neural networks. In International Conference on Machine Learning, pages 7134–7143. PMLR, 2019.
222
+ [29] Albert-László Barabási and Réka Albert. Emergence of scaling in random networks. science, 286(5439):509–512, 1999.
223
+ [30] Lada A Adamic and Eytan Adar. Friends and neighbors on the web. Social networks, 25(3):211– 230, 2003.
224
+ [31] Tao Zhou, Linyuan Lü, and Yi-Cheng Zhang. Predicting missing links via local information. The European Physical Journal B, 71(4):623–630, 2009.
225
+ [32] Leo Katz. A new status index derived from sociometric analysis. Psychometrika, 18(1):39–43, 1953.
226
+ [33] Sergey Brin and Lawrence Page. Reprint of: The anatomy of a large-scale hypertextual web search engine. Computer networks, 56(18):3825–3833, 2012.
227
+ [34] Glen Jeh and Jennifer Widom. Simrank: a measure of structural-context similarity. In Proceedings of the eighth ACM SIGKDD international conference on Knowledge discovery and data mining, pages 538–543, 2002.
228
+ [35] Yehuda Koren, Robert Bell, and Chris Volinsky. Matrix factorization techniques for recommender systems. Computer, 42(8):30–37, 2009.
229
+ [36] 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, pages 701–710, 2014.
230
+ [37] Jiezhong Qiu, Yuxiao Dong, Hao Ma, Jian Li, Kuansan Wang, and Jie Tang. Network embedding as matrix factorization: Unifying deepwalk, line, pte, and node2vec. In Proceedings of the eleventh ACM international conference on web search and data mining, pages 459–467, 2018.
231
+ [38] Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781, 2013.
232
+ [39] Elena Zheleva and Lise Getoor. To join or not to join: The illusion of privacy in social networks with mixed public and private user profiles. In Proceedings of the 18th International Conference on World Wide Web, WWW ’09, page 531–540, 2009.
233
+ [40] Thomas N Kipf and Max Welling. Variational graph auto-encoders. arXiv preprint arXiv:1611.07308, 2016.
234
+ [41] Weihua Hu, Matthias Fey, Marinka Zitnik, Yuxiao Dong, Hongyu Ren, Bowen Liu, Michele Catasta, and Jure Leskovec. Open graph benchmark: Datasets for machine learning on graphs. arXiv preprint arXiv:2005.00687, 2020.
235
+ [42] 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, pages 855–864, 2016.
236
+ [43] Keyulu Xu, Chengtao Li, Yonglong Tian, Tomohiro Sonobe, Ken-ichi Kawarabayashi, and Stefanie Jegelka. Representation learning on graphs with jumping knowledge networks. In International Conference on Machine Learning, pages 5453–5462. PMLR, 2018.
237
+ [44] Matthias Fey and Jan E. Lenssen. Fast graph representation learning with PyTorch Geometric. In ICLR Workshop on Representation Learning on Graphs and Manifolds, 2019.
md/train/LkFG3lB13U5/LkFG3lB13U5.md ADDED
The diff for this file is too large to render. See raw diff
 
md/train/S1J2ZyZ0Z/S1J2ZyZ0Z.md ADDED
@@ -0,0 +1,395 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # INTERPRETABLE COUNTING FOR VISUAL QUESTION ANSWERING
2
+
3
+ Alexander Trott, Caiming Xiong∗, & Richard Socher Salesforce Research
4
+ Palo Alto, CA
5
+ {atrott,cxiong,rsocher}@salesforce.com
6
+
7
+ # ABSTRACT
8
+
9
+ Questions that require counting a variety of objects in images remain a major challenge in visual question answering (VQA). The most common approaches to VQA involve either classifying answers based on fixed length representations of both the image and question or summing fractional counts estimated from each section of the image. In contrast, we treat counting as a sequential decision process and force our model to make discrete choices of what to count. Specifically, the model sequentially selects from detected objects and learns interactions between objects that influence subsequent selections. A distinction of our approach is its intuitive and interpretable output, as discrete counts are automatically grounded in the image. Furthermore, our method outperforms the state of the art architecture for VQA on multiple metrics that evaluate counting.
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ Visual question answering (VQA) is an important benchmark to test for context-specific reasoning over complex images. While the field has seen substantial progress, counting-based questions have seen the least improvement (Chattopadhyay et al., 2017). Intuitively, counting should involve finding the number of distinct scene elements or objects that meet some criteria, see Fig. 1 for an example. In contrast, the predominant approach to VQA involves representing the visual input with the final feature map of a convolutional neural network (CNN), attending to regions based on an encoding of the question, and classifying the answer from the attention-weighted image features (Xu & Saenko, 2015; Yang et al., 2015; Xiong et al., 2016; Lu et al., 2016b; Fukui et al., 2016; Kim et al., 2017). Our intuition about counting seems at odds with the effects of attention, where a weighted average obscures any notion of distinct elements. As such, we are motivated to re-think the typical approach to counting in VQA and propose a method that embraces the discrete nature of the task.
14
+
15
+ Our approach is partly inspired by recent work that represents images as a set of distinct objects, as identified by object detection (Anderson et al., 2017), and making use of the relationships between these objects (Teney et al., 2016). We experiment with counting systems that build off of the vision module used for these two works, which represents each image as a set of detected objects. For training and evaluation, we create a new dataset, HowMany-QA. It is taken from the countingspecific union of VQA 2.0 (Goyal et al., 2017) and Visual Genome QA (Krishna et al., 2016).
16
+
17
+ We introduce the Interpretable Reinforcement Learning Counter (IRLC), which treats counting as a sequential decision process. We treat learning to count as learning to enumerate the relevant objects in the scene. As a result, IRLC not only returns a count but also the objects supporting its answer. This output is produced through an iterative method. Each step of this sequence has two stages: First, an object is selected to be added to the count. Second, the model adjusts the priority given to unselected objects based on their configuration with the selected objects (Fig. 1). We supervise only the final count and train the decision process using reinforcement learning (RL).
18
+
19
+ Additional experiments highlight the importance of the iterative approach when using this manner of weak supervision. Furthermore, we train the current state of the art model for VQA on HowManyQA and find that IRLC achieves a higher accuracy and lower count error. Lastly, we compare the grounded counts of our model to the attentional focus of the state of the art baseline to demonstrate the interpretability gained through our approach.
20
+
21
+ ![](images/c5c9e95ac41429cf8416b9cdb435a7bbb84393ff4f9260f52bb1e7cea6f04f52.jpg)
22
+ Figure 1: IRLC takes as input a counting question and image. Detected objects are added to the returned count through a sequential decision process. The above example illustrates actual model behavior after training.
23
+
24
+ # 2 RELATED WORK
25
+
26
+ Visual representations for counting. As a standalone problem, counting from images has received some attention but typically within specific problem domains. Segui et al. (2015) explore training a CNN to count directly from synthetic data. Counts can also be estimated by learning to produce density maps for some category of interest (typically people), as in Lempitsky & Zisserman (2010); Onoro-Rubio & L ˜ opez-Sastre ´ (2016); Zhang et al. (2015). Density estimation simplifies the more challenging approach of counting by instance-by-instance detection (Ren & Zemel, 2017). Methods to detect objects and their bounding boxes have advanced considerably (Girshick et al., 2015; Girshick, 2015; Ren et al., 2015b; Dai et al., 2016; Lin et al., 2017) but tuning redundancy reduction steps in order to count is unreliable (Chattopadhyay et al., 2017). Here, we overcome this limitation by allowing flexible, question specific interactions during counting.
27
+
28
+ Alternative approaches attempt to model subitizing, which describes the human ability to quickly and accurately gauge numerosity when at most a few objects are present. Zhang et al. (2017) demonstrates that CNNs may be trained towards a similar ability when estimating the number of salient objects in a scene. This approach was extended to counting 80 classes of objects simultaneously in Chattopadhyay et al. (2017). Their model is trained to estimate counts within each subdivision of the full image, where local counts are typically within the subitizing range.
29
+
30
+ The above studies apply counting to a fixed set of object categories. In contrast, we are interested in counting during visual question answering, where the criteria for counting change from question to question and can be arbitrarily complex. This places our work in a different setting than those that count from the image alone. For example, Chattopadhyay et al. (2017) apply their trained models to a subset of VQA questions, but their analysis was limited to the specific subset of examples where the question and answer labels agreed with the object detection labels they use for training. Here, we overcome this limitation by learning to count directly from question/answer pairs.
31
+
32
+ Visual question answering. The potential of deep learning to fuse visual and linguistic reasoning has been recognized for some time (Socher et al., 2014; Lu et al., 2016a). Visual question answering poses the challenge of retrieving question-specific information from an associated image, often requiring complex scene understanding and flexible reasoning. In recent years, a number of datasets have been introduced for studying this problem (Malinowski & Fritz, 2014; Ren et al., 2015a; Zhu et al., 2015; Agrawal et al., 2015; Goyal et al., 2017; Krishna et al., 2016). The majority of recent progress has been aimed at the so-named “VQA” datasets (Agrawal et al., 2015; Goyal et al., 2017), where counting questions represent roughly $11 \%$ of the data. Though our focus is on counting questions specifically, prior work on VQA is highly relevant.
33
+
34
+ An early baseline for VQA represents the question and image at a coarse granularity, respectively using a “bag of words” embedding along with spatially-pooled CNN outputs to classify the answer (Zhou et al., 2015). In Ren et al. (2015a), a similar fixed-length image representation is fused with the question embeddings as input to a recurrent neural network (RNN), from which the answer is classified.
35
+
36
+ Attention. More recent variants have chosen to represent the image at a finer granularity by omitting the spatial pooling of the CNN feature map and instead use attention to focus relevant image regions before producing an answer (Xu & Saenko, 2015; Yang et al., 2015; Xiong et al., 2016; Lu et al., 2016b; Fukui et al., 2016; Kim et al., 2017). These works use the spatially-tiled feature vectors output by a CNN to represent the image; others follow the intuition that a more meaningful representation may come from parsing the feature map according to the locations of objects in the scene (Shih et al., 2015; Ilievski et al., 2016). Notably, using object detection was a key design choice for the winning submission for the VQA 2017 challenge (Anderson et al., 2017; Teney et al., 2017). Work directed at VQA with synthetic images (which sidesteps the challenges created by computer vision) has further demonstrated the utility that relationships may provide as an additional form of image annotation (Teney et al., 2016).
37
+
38
+ Interpretable VQA. The use of “scene graphs” in real-image VQA would have the desirable property that intermediate model variables would be grounded in concepts explicitly, a step towards making neural reasoning more transparent. A conceptual parallel to this is found in Neural Module Networks (Andreas et al., 2016a;b; Hu et al., 2017), which gain interpretability by grounding the reasoning process itself in defined concepts. The general concept of interpretable VQA has been the subject of recent interest. Park et al. (2016) extends the task itself to include generating explanations for produced answers. Chandrasekaran et al. (2017) take a different approach, asking how well humans can learn patterns in answers and failures of a trained VQA model. While humans indeed identify some patterns, they do not gain any apparent insight from knowing intermediate states of the model (such as its attentional focus). In light of this, we are motivated by the goal of developing more transparent AI.
39
+
40
+ We address this at the level of counting in VQA. We show that, despite the challenge presented by this particular task, an intuitive approach gains in both performance and interpretability over state of the art.
41
+
42
+ # 3 DATASETS
43
+
44
+ Within the field of VQA, the majority of progress has been aimed at the VQA dataset (Agrawal et al., 2015) and, more recently, VQA 2.0 (Goyal et al., 2017), which expands the total number of questions in the dataset and attempts to reduce bias by balancing answers to repeated questions. VQA 2.0 consists of 1.1M questions pertaining to the 205K images from COCO (Lin et al., 2014). The examples are divided according to the official COCO splits.
45
+
46
+ In addition to VQA 2.0, we incorporate the Visual Genome (VG) dataset (Krishna et al., 2016). Visual Genome consists of 108K images, roughly half of which are part of COCO. VG includes its own visual question answering dataset. We include examples from that dataset when they pertain to an image in the VQA 2.0 training set.
47
+
48
+ # 3.1 HOWMANY-QA
49
+
50
+ In order to evaluate counting specifically, we define a subset of the QA pairs, which we refer to as HowMany-QA. Our inclusion criteria were designed to filter QA pairs where the question asks for a count, as opposed to simply an answer in the form of a number (Fig 2). For the first condition, we require that the question contains one of the following phrases: “how many”, “number of”, “amount of”, or “count of”. We also reject a question if it contains the phrase “number of the”, since this phrase frequently refers to a printed number rather than a count (i.e. “what is the number of the bus?”). Lastly, we require that the ground-truth answer is a number between 0 to 20 (inclusive). The original VQA 2.0 train set includes roughly 444K QA pairs, of which 57,606 are labeled as having a “number” answer. Focusing on counting questions results in a still very large dataset with 47,542 pairs, showing the importance of this subtask.
51
+
52
+ ![](images/668b7443547a18002b177a3df0279a6acb148c7c828c7408873ca9b1f71c9dbd.jpg)
53
+ Figure 2: Examples of question-answer pairs that are excluded from HowMany-QA. This selection exemplifies the common types of “number” questions that do not require counting and therefore distract from our objective: (from left to right) time, general number-based answers, ballparking, and reading numbers from images. Importantly, the standard VQA evaluation metrics do not distinguish these from counting questions; instead, performance is reported for “number” questions as a whole.
54
+
55
+ Due to our filter and focus on counting questions, we cannot make use of the official test data since its annotations are not available. Hence, we divide the validation data into separate development and test sets. More specifically, we apply the above criteria to the official validation data and select 5,000 of the resulting QA pairs to serve as the test data. The remaining 17,714 QA pairs are used as the development set.
56
+
57
+ As mentioned above, the HowMany-QA training data is augmented with available QA pairs
58
+
59
+ Table 1: Size breakdown of HowMany-QA. Neither development or test included VG data.
60
+
61
+ <table><tr><td>Split</td><td>QA Pairs</td><td>Images</td></tr><tr><td>Train</td><td>83,642</td><td>31,932</td></tr><tr><td>from VQA 2.0</td><td>47,542</td><td>31,932</td></tr><tr><td> from VG</td><td>36,100</td><td>0</td></tr><tr><td>Dev.</td><td>17,714</td><td>13,119</td></tr><tr><td>Test</td><td>5,000</td><td>2,483</td></tr></table>
62
+
63
+ from Visual Genome, which are selected using the same criteria. A breakdown of the size and composition of HowMany-QA is provided in Table 1. All models compared in this work are trained and evaluated on HowMany-QA. To facilitate future comparison to our work, we have made the training, development, and test question IDs available for download.
64
+
65
+ # 4 MODEL
66
+
67
+ In this work, we focus specifically on counting in the setting of visual question answering (where the criteria for counting changes on a question-by-question basis). In addition, we are interested in model interpretability. We explore this notion by experimenting with models that are capable of producing question-guided counts which are visually grounded in object proposals.
68
+
69
+ Rather than substantially modifying existing counting approaches – such as Chattopadhyay et al. (2017) – we compare three models whose architectures naturally fit within our experimental scope. These models each produce a count from the outputs of an object detection module and use identical strategies to encode the question and compare it to the detected objects. The models differ only in terms of how these components are used to produce a count (Fig. 3a).
70
+
71
+ # 4.1 OBJECT DETECTION
72
+
73
+ Our approach is inspired by the strategy of Anderson et al. (2017) and Teney et al. (2017). Their model, which represents current state of the art in VQA, infers objects as the input to the questionanswering system. This inference is performed using the Faster R-CNN architecture (Ren et al., 2015b). The Faster R-CNN proposes a set of regions corresponding to objects in the image. It encodes the image as a set of bounding boxes $\left\{ b _ { 1 } , . . . , b _ { N } \right\}$ , $b _ { i } \in \mathbb { R } ^ { 4 }$ and complementary set of object encodings $\left\{ v _ { 1 } , \dotsc , v _ { N } \right\}$ , $v _ { i } \in \mathbb { R } ^ { 2 0 4 8 }$ , corresponding to the locations and feature representations of each of the $N$ detected objects, respectively (blue box in Fig. 3a).
74
+
75
+ ![](images/2c5f371f62f7d35a6e0c81827a861b0cbd7733b1b7722346ef5e1d2947d80ced.jpg)
76
+ Figure 3: (a) Each model includes three basic modules: vision (blue), language (green), and counting (red). Text in the shaded regions describes which aspects of these modules are shared across models. (b) (left) The language model embeds the question and compares it to each object using a scoring function, which is jointly trained with caption grounding; (right) IRLC counting module.
77
+
78
+ Rather than train our own vision module from scratch, we make use of the publicly available object proposals learned in Anderson et al. (2017). These provide rich, object-centric representations for each image in our dataset. These representations are fixed when learning to count and are shared across each of the QA models we experiment with.
79
+
80
+ # 4.2 LANGUAGE
81
+
82
+ Each architecture encodes the question and compares it to each detected object via a scoring function. We define $q$ as the final hidden state of an LSTM (Hochreiter & Schmidhuber, 1997) after processing the question and compute a score vector for each object (Fig. 3, green boxes):
83
+
84
+ $$
85
+ \begin{array} { r l } { h ^ { t } = \mathrm { L S T M } \left( x ^ { t } , h ^ { t - 1 } \right) \quad } & { { } q = h ^ { T } } \\ { s _ { i } = f ^ { S } \left( [ q , v _ { i } ] \right) \quad } & { { } } \end{array}
86
+ $$
87
+
88
+ Here, $x _ { t }$ denotes the word embedding of the question token at position $t$ and $s _ { i } \in \mathbb { R } ^ { n }$ denotes the score vector encoding the relevance of object $i$ to the question. Following Anderson et al. (2017), we implement the scoring function $f ^ { S } : \bar { \mathbb { R } ^ { m } } \mathbb { R } ^ { n }$ as a layer of Gated Tanh Units (GTU) (van den Oord et al., 2016). $[ , ]$ denotes vector concatenation.
89
+
90
+ We experiment with jointly training the scoring function to perform caption grounding, which we supervise using region captions from Visual Genome. Region captions provide linguistic descriptions of localized regions within the image, and the goal of caption grounding is to identify which object a given caption describes (details provided in Section B.1 of the Appendix). Caption grounding uses a strategy identical to that for question answering (Eqs. 1 and 2): an LSTM is used to encode each caption and the scoring function $f ^ { S }$ is used to encode its relevance to each detected object. The weights of the scoring function are tied for counting and caption grounding (Fig. 3b). We include results from experiments where caption grounding is ignored.
91
+
92
+ # 4.3 COUNTING
93
+
94
+ Interpretable RL Counter (IRLC). For our proposed model, we aim to learn how to count by learning what to count. We assume that each counting question implicitly refers to a subset of the objects within a scene that meet some variable criteria. In this sense, the goal of our model is to enumerate that subset of objects.
95
+
96
+ ![](images/38515b73a92b92a456cb7bba1b7325872b69b3aabf00f2fea83d573919a8d087.jpg)
97
+ Figure 4: Grounded counts produced by IRLC. Counts are formed from selections of detected objects. Each image displays the objects that IRLC chose to count.
98
+
99
+ To implement this as a sequential decision process, we need to represent the probability of selecting a given action and how each action affects subsequent choices. To that end, we project the object scores $s \in \mathbb { R } ^ { N \times n }$ to a vector of logits $\boldsymbol { \kappa } \in \mathbb { R } ^ { N }$ , representing how likely each object is to be counted, where $N$ is the number of detected objects:
100
+
101
+ $$
102
+ \kappa = W s + b
103
+ $$
104
+
105
+ And we compute a matrix of interaction terms $\boldsymbol { \rho } \in \mathbb { R } ^ { N \times N }$ that are used to update the logits $\kappa$ . The value $\rho _ { i j }$ represents how selecting object $i$ will change $\kappa _ { j }$ . We calculate this interaction from a compressed representation of the question $( W q )$ , the dot product of the normalized object vectors $( \hat { v } _ { i } ^ { \mathrm { T } } \bar { \hat { v } } _ { j } )$ , the object coordinates $b _ { i }$ and $b _ { j }$ ), and basic overlap statistics $( \mathrm { I o U } _ { i j }$ , $\mathrm { O } _ { i j }$ , and ${ \mathrm { O } } _ { j i }$ ):
106
+
107
+ $$
108
+ \rho _ { i j } = f ^ { \rho } \left( \left[ W q , \hat { v } _ { i } ^ { \mathrm { T } } \hat { v } _ { j } , b _ { i } , b _ { j } , \mathrm { I o U } _ { i j } , \mathrm { O } _ { i j } , \mathrm { O } _ { j i } \right] \right)
109
+ $$
110
+
111
+ where $f ^ { \rho } : x \in \mathbb { R } ^ { m } \Rightarrow \mathbb { R }$ is a 2-layer MLP with ReLU activations.
112
+
113
+ For each step $t$ of the counting sequence we greedily select the action with the highest value (interpreted as either selecting the next object to count or terminating), and update $\kappa$ accordingly:
114
+
115
+ $$
116
+ \begin{array} { r } { a ^ { t } = \operatorname { a r g m a x } _ { i } \left[ \kappa ^ { t } , \zeta \right] } \\ { \kappa ^ { t + 1 } = \kappa ^ { t } + \rho ( a ^ { t } , \cdot ) } \end{array}
117
+ $$
118
+
119
+ where $\zeta$ is a learnable scalar representing the logit value of the terminal action, and $\kappa ^ { 0 }$ is the result of Equation 3 (Fig. 3b, red box). The action $a ^ { t }$ is expressed as the index of the selected object. $\rho ( \boldsymbol a ^ { t } , \cdot )$ denotes the row of $\rho$ indexed by $a ^ { t }$ . Each object is only allowed to be counted once. We define the count $C$ as the timestep when the terminal action was selected $t : a ^ { t } = N + 1$ .
120
+
121
+ This approach bears some similarity to Non-Maximal Suppression (NMS), a staple technique in object detection to suppress redundant proposals. However, our approach is far less rigid and allows the question to determine how similar and/or overlapping objects interact.
122
+
123
+ Training IRLC. Because the process of generating a count requires making discrete decisions, training requires that we use techniques from Reinforcement Learning. Given our formulation, a natural choice is to apply REINFORCE (Williams, 1992). To do so, we calculate a distribution over action probabilities $p ^ { t }$ from $\kappa ^ { t }$ and generate a count by iteratively sampling actions from the distribution:
124
+
125
+ $$
126
+ \begin{array} { l c r } { { p ^ { t } = \mathrm { s o f t m a x } \left( \left[ \kappa ^ { t } , \zeta \right] \right) } } & { { ~ a ^ { t } \sim p ^ { t } } } \\ { { \kappa ^ { t + 1 } = \kappa ^ { t } + \rho ( a ^ { t } , \cdot ) } } & { { } } \end{array}
127
+ $$
128
+
129
+ We calculate the reward using Self-Critical Sequence training (Rennie et al., 2017; Anderson et al., 2017; Paulus et al., 2017), a variation of policy gradient. We define $E = | C - C ^ { \mathrm { G T } } |$ to be the count error and define the reward as $R = E ^ { \mathrm { g r e e d y } } - E$ , where $E ^ { \mathrm { g r e e d y } }$ is the baseline count error obtained by greedy action selection (which is also how the count is measured at test time). From this, we define our (unnormalized) counting loss as
130
+
131
+ $$
132
+ \tilde { L } _ { C } = - R \sum _ { t } \log p ^ { t } \left( a ^ { t } \right)
133
+ $$
134
+
135
+ Additionally, we include two auxiliary objectives to aid learning. For each sampled sequence, we measure the total negative policy entropy $H$ across the observed time steps. We also measure the average interaction strength at each time step and collect the total
136
+
137
+ $$
138
+ \tilde { P } _ { \mathrm { H } } = - \sum _ { t } H \left( p ^ { t } \right) \qquad \tilde { P } _ { \mathrm { I } } = \sum _ { i \in \{ a ^ { 0 } . . . a ^ { t } \} } \frac { 1 } { N } \sum _ { j } L _ { 1 } \left( \rho _ { i j } \right)
139
+ $$
140
+
141
+ where $L _ { 1 }$ is the Huber loss from Eq 12. Including the entropy objective is a common strategy when using policy gradient (Williams & Peng, 1991; Minh et al., 2016; Luo et al., 2017) and is used to improve exploration. The interaction penalty is motivated by the a priori expectation that interactions should be sparse. During training, we minimize a weighted sum of the three losses, normalized by the number of decision steps. As before, we provide training and implementation details in the Appendix (Sec. B.2).
142
+
143
+ SoftCount. As a baseline approach, we train a model to count directly from the outputs $s$ of the scoring function. For each object, we project its score vector $s _ { i }$ to a scalar value and apply a sigmoid nonlinearity, denoted as $\sigma$ , to assign the object a count value between 0 and 1. The total count is the sum of these fractional, object-specific count values. We train this model by minimizing the Huber loss associated with the absolute difference $e$ between the predicted count $C$ and the ground truth count CGT:
144
+
145
+ $$
146
+ \begin{array} { l } { { C = \displaystyle \sum _ { i } \sigma \left( W s _ { i } \right) } } \\ { { \ } } \\ { { L _ { 1 } = \left\{ \begin{array} { l l } { { 0 . 5 e ^ { 2 } } } & { { \mathrm { i f } e \leq 1 } } \\ { { e - 0 . 5 } } & { { \mathrm { o t h e r w i s e } } } \end{array} \right. \ } } & { { e = \left| C - C ^ { \mathrm { G T } } \right| } } \end{array}
147
+ $$
148
+
149
+ For evaluation, we round the estimated count $C$ to the nearest integer and limit the output to the maximum ground truth count (in this case, 20).
150
+
151
+ Attention Baseline (UpDown). As a second baseline, we re-implement the QA architecture introduced in Anderson et al. (2017), which the authors refer to as UpDown – see also Teney et al. (2017) for additional details. We focus on this architecture for three main reasons. First, it represents the current state of the art for VQA 2.0. Second, it was designed to use the visual representations we employ. And, third, it exemplifies the common two-stage approach of (1) deploying question-based attention over image regions (here, detected objects) to get a fixed-length visual representation
152
+
153
+ $$
154
+ \alpha = \mathrm { s o f t m a x } \left( W s \right) ; \quad \hat { v } = \sum \alpha _ { i } v _ { i }
155
+ $$
156
+
157
+ and then (2) classifying the answer based on this average and the question encoding
158
+
159
+ $$
160
+ \begin{array} { r } { v ^ { \prime } = f ^ { V } \left( \hat { v } \right) ; \quad q ^ { \prime } = f ^ { Q } \left( q \right) } \\ { p = \mathrm { s o f t m a x } \left( f ^ { C } \left( v ^ { \prime } \otimes q ^ { \prime } \right) \right) } \end{array}
161
+ $$
162
+
163
+ where $s \in \mathbb { R } ^ { N \times n }$ denotes the matrix of score vectors for each of the $N$ detected objects and $\boldsymbol { \alpha } \in \mathbb { R } ^ { N }$ denotes the attention weights. Here, each function $f$ is implemented as a GTU layer and $\otimes$ denotes element-wise multiplication. For training, we use a cross entropy loss, with the target given by the ground-truth count. At test time, we use the most probable count given by $p$ .
164
+
165
+ # 5 RESULTS
166
+
167
+ # 5.1 COUNTING PERFORMANCE
168
+
169
+ We use two metrics for evaluation. For consistency with past work, we report the standard VQA test metric of accuracy. Since accuracy does not measure the degree of error we also report root-meansquared-error (RMSE), which captures the typical deviation between the estimated and ground-truth count and emphasizes extreme errors. Details are provided in the Appendix (Sec. D).
170
+
171
+ To better understand the performance of the above models, we also report the performance of two non-visual baselines. The first baseline (Guess1) shows the performance when the estimated count is always 1 (the most common answer in the training set). The second baseline (LSTM) learns to predict the count directly from a linear projection of the question embedding $q$ (Eq. 1).
172
+
173
+ ![](images/b3993a0fdceb6a5a7390b9fb11e39582f5a0a5c636da4ce7445c783758825216.jpg)
174
+ Figure 5: Model performance on the HowMany-QA development set, grouped according to the frequency with which the counting subject appeared in the training data.
175
+
176
+ IRLC achieves the highest overall accuracy and (with SoftCount) the lowest overall RMSE on the test set (Table 2). Interestingly, SoftCount clearly lags in accuracy but is competitive in RMSE, arguing that accuracy and RMSE are not redundant. We observe this to result from the fact that IRLC is less prone to small errors and very slightly more prone to large errors (which disproportionately impact RMSE). However, whereas UpDown improves in accuracy at the cost of RMSE, IRLC is substantially more accurate without sacrificing overall RMSE.
177
+
178
+ Table 2: HowMany-QA test set performance. Values in parentheses apply to models trained without caption grounding.
179
+
180
+ <table><tr><td>Model</td><td> Accuracy</td><td>RMSE</td></tr><tr><td>Guess1</td><td>33.8</td><td>3.74</td></tr><tr><td>LSTM</td><td>36.8</td><td>3.47</td></tr><tr><td>SoftCount</td><td>50.2 (49.2)</td><td>2.37 (2.45)</td></tr><tr><td>UpDown</td><td>52.7 (51.5)</td><td>2.64 (2.69)</td></tr><tr><td>IRLC</td><td>57.7 (56.1)</td><td>2.37 (2.45)</td></tr></table>
181
+
182
+ To gain more insight into the performance of these models, we calculate these metrics within the development set after separating the data according to how common the subject of the count is during training1. We break up the questions into 5 roughly equal-sized bins representing increasingly uncommon subjects. We include a 6th bin for subjects never seen during training. The accuracy and RMSE across the development set are reported for each of these bins in Figure 5.
183
+
184
+ Organizing the data this way reveals two main trends. First, all models perform better when asked to count subjects that were common during training. Second, the performance improvements offered by IRLC over UpDown persist over all groupings of the development data.
185
+
186
+ # 5.2 GROUNDING QUALITY
187
+
188
+ We introduce a novel analysis to quantify how well counted objects match the subject of the question. To perform this analysis, we form generic questions that refer to the object categories in the COCO object detection dataset. We take the object proposals counted in response to a given question and compare them to the ground truth COCO labels to determine how relevant the counted object proposals are. Our metric takes on a value of 1 when the counted objects perfectly map onto the category to which the question refers. Values around 0 indicate that the counted objects were not relevant to the question. Section D of the Appendix details how the grounding quality metric is calculated.
189
+
190
+ We perform this analysis for each of the 80 COCO categories using the images in the HowMany-QA development set. Figure 6 compares the grounding quality of SoftCount and IRLC, where each point represents the average grounding quality for a particular COCO category. As with the previous two metrics, grounding quality is highest for COCO categories that are more common during training. We observe that IRLC consistently grounds its counts in objects that are more relevant to the question than does SoftCount. A paired t-test shows that this trend is statistically significant $( p < 1 0 ^ { \frac { \cdot } { - 1 5 } }$ ).
191
+
192
+ ![](images/aac1bc41d15a6b233520ec746286c1de24c89f12695398f9e5b94ddc90fcbdb9.jpg)
193
+ Figure 6: (Left) Average grounding quality for each of the COCO object categories, as measured for SoftCount and IRLC. Each point represents a COCO category and is colored according to how common the category was during training (as in Figure 5). (Right) Histogram showing the difference in grounding quality between IRLC and SoftCount.
194
+
195
+ ![](images/b5b11846760f40370474dccf1f9bb6284b472b4081139758787c42427419aefd.jpg)
196
+ Figure 7: Examples of failure cases with common and rare subjects (“people” and “ties,” respectively). Each example shows the output of IRLC, where boxes correspond to counted objects, and the output of UpDown, where boxes are shaded according to their attention weights.
197
+
198
+ # 5.3 QUALITATIVE ANALYSIS
199
+
200
+ The design of IRLC is inspired by the ideal of interpretable VQA (Chandrasekaran et al., 2017). One hallmark of interpretability is the ability to predict failure modes. We argue that this is made more approachable by requiring IRLC to identify the objects in the scene that it chooses to count.
201
+
202
+ Figure 7 illustrates two failure cases that exemplify observed trends in IRLC. In particular, IRLC has little trouble counting people (they are the most common subject) but encounters difficulty with referring phrases (in this case, “sitting on the bench”). When asked to count ties (a rare subject), IRLC includes a sleeve in the output, demonstrating the tendency to misidentify objects with few training examples. These failures are obvious by virtue of the grounded counts, which point out exactly which objects IRLC counted. In comparison, the attention focus of UpDown (representing the closest analogy to a grounded output) does not identify any pattern. From the attention weights, it is unclear which scene elements form the basis of the returned count.
203
+
204
+ Indeed, the two models may share similar deficits. We observe that, in many cases, they produce similar counts. However, we stress that without IRLC and the chance to observe such similarities such deficits of the UpDown model would be difficult to identify.
205
+
206
+ The Appendix includes further visualizations and comparisons of model output, including examples of how IRLC uses the iterative decision process to produce discrete, grounded counts (Sec. A).
207
+
208
+ # 6 CONCLUSION
209
+
210
+ We present an interpretable approach to counting in visual question answering, based on learning to enumerate objects in a scene. By using RL, we are able to train our model to make binary decisions about whether a detected object contributes to the final count. We experiment with two additional baselines and control for variations due to visual representations and for the mechanism of visuallinguistic comparison. Our approach achieves state of the art for each of the evaluation metrics. In addition, our model identifies the objects that contribute to each count. These groundings provide traction for identifying the aspects of the task that the model has failed to learn and thereby improve not only performance but also interpretability.
211
+
212
+ # REFERENCES
213
+
214
+ Aishwarya Agrawal, Jiasen Lu, Stanislaw Antol, Margaret Mitchell, C. Lawrence Zitnick, Devi Parikh, and Dhruv Batra. VQA: Visual Question Answering. International Journal of Computer Vision, 2015.
215
+
216
+ Peter Anderson, Xiaodong He, Chris Buehler, Damien Teney, Mark Johnson, Stephen Gould, and Lei Zhang. Bottom-Up and Top-Down Attention for Image Captioning and VQA. arXiv, 2017.
217
+
218
+ Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Dan Klein. Neural module networks. In CVPR, 2016a.
219
+
220
+ Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Dan Klein. Learning to Compose Neural Networks for Question Answering. In NAACL, 2016b.
221
+
222
+ Arjun Chandrasekaran, Deshraj Yadav, Prithvijit Chattopadhyay, Viraj Prabhu, and Devi Parikh. It Takes Two to Tango: Towards Theory of AI’s Mind. arXiv, 2017.
223
+
224
+ Prithvijit Chattopadhyay, Ramakrishna Vedantam, Ramprasaath R. Selvaraju, Dhruv Batra, and Devi Parikh. Counting Everyday Objects in Everyday Scenes. In CVPR, 2017.
225
+
226
+ Jifeng Dai, Yi Li, Kaiming He, and Jian Sun. R-FCN: Object Detection via Region-based Fully Convolutional Networks. In NIPS, 2016.
227
+
228
+ Akira Fukui, Dong Huk Park, Daylen Yang, Anna Rohrbach, Trevor Darrell, and Marcus Rohrbach. Multimodal compact bilinear pooling for visual question answering and visual grounding. In EMNLP, 2016.
229
+
230
+ Ross Girshick. Fast R-CNN. In ICCV, 2015.
231
+
232
+ Ross Girshick, Jeff Donahue, Trevor Darrell, and Jitendra Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In CVPR, 2015.
233
+
234
+ Yash Goyal, Tejas Khot, Douglas Summers-Stay, Dhruv Batra, and Devi Parikh. Making the V in VQA Matter: Elevating the Role of Image Understanding in Visual Question Answering. In CVPR, 2017.
235
+
236
+ Sepp Hochreiter and Jurgen Schmidhuber. Long Short-Term Memory. ¨ Neural Computation, 9(8): 1735–1780, 1997.
237
+
238
+ Ronghang Hu, Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Kate Saenko. Learning to Reason: End-to-End Module Networks for Visual Question Answering. In ICCV, 2017.
239
+
240
+ Ilija Ilievski, Shuicheng Yan, and Jiashi Feng. A Focused Dynamic Attention Model for Visual Question Answering. arXiv, 2016.
241
+
242
+ Jin-Hwa Kim, Kyoung-Woon On, Woosang Lim, Jeonghee Kim, Jung-Woo Ha, and Byoung-Tak Zhang. Hadamard Product for Low-rank Bilinear Pooling. In ICLR, 2017.
243
+
244
+ Diederik P. Kingma and Jimmy Ba. Adam: A Method for Stochastic Optimization. arXiv, 2014.
245
+
246
+ Ranjay Krishna, Yuke Zhu, Oliver Groth, Justin Johnson, Kenji Hata, Joshua Kravitz, Stephanie Chen, Yannis Kalantidis, Li-Jia Li, David A. Shamma, Michael S. Bernstein, and Fei-Fei Li. Visual Genome: Connecting Language and Vision Using Crowdsourced Dense Image Annotations. International Journal of Computer Vision, 2016.
247
+
248
+ Victor Lempitsky and Andrew Zisserman. Learning To Count Objects in Images. NIPS, 2010.
249
+
250
+ Tsung-Yi Lin, Michael Maire, Serge Belongie, Lubomir Bourdev, Ross Girshick, James Hays, Pietro Perona, Deva Ramanan, C. Lawrence Zitnick, and Piotr Dollar. Microsoft COCO: Common ´ Objects in Context. In ECCV, 2014.
251
+
252
+ Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dollar. Focal Loss for Dense ´ Object Detection. ICCV, 2017.
253
+
254
+ Jiasen Lu, Caiming Xiong, Devi Parikh, and Richard Socher. Knowing When to Look: Adaptive Attention via A Visual Sentinel for Image Captioning. In CVPR, 2016a.
255
+
256
+ Jiasen Lu, Jianwei Yang, Dhruv Batra, and Devi Parikh. Hierarchical Question-Image Co-Attention for Visual Question Answering. In NIPS, 2016b.
257
+
258
+ Yuping Luo, Chung-cheng Chiu, Navdeep Jaitly, and Ilya Sutskever. Learning Online Alignments with Continuous Rewards Policy Gradient. In ICASSP, 2017.
259
+
260
+ Mateusz Malinowski and Mario Fritz. A Multi-World Approach to Question Answering about RealWorld Scenes based on Uncertain Input. In NIPS, 2014.
261
+
262
+ Volodymyr Minh, Adria Puigdom \` enech Badia, Mehdi Mirza, Alex Graves, Tim Harley, Timothy\` Lillicrap, David Silver, and Koray Kavukcuoglu. Asynchronous Methods for Deep Reinforcement Learning. In ICML, 2016.
263
+
264
+ Daniel Onoro-Rubio and Roberto J. L ˜ opez-Sastre. Towards perspective-free object counting with ´ deep learning. In ECCV, 2016.
265
+
266
+ Dong Huk Park, Lisa Anne Hendricks, Zeynep Akata, Bernt Schiele, Trevor Darrell, and Marcus Rohrbach. Attentive Explanations: Justifying Decisions and Pointing to the Evidence. arXiv, 2016.
267
+
268
+ Romain Paulus, Caiming Xiong, and Richard Socher. A Deep Reinforced Model for Abstractive Summarization. arXiv, 2017.
269
+
270
+ Jeffrey Pennington, Richard Socher, and Christopher Manning. Glove: Global Vectors for Word Representation. EMNLP, 2014.
271
+
272
+ Mengye Ren and Richard S. Zemel. End-to-End Instance Segmentation with Recurrent Attention. In CVPR, 2017.
273
+
274
+ Mengye Ren, Ryan Kiros, and Richard Zemel. Exploring Models and Data for Image Question Answering. In NIPS, 2015a.
275
+
276
+ Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks. In NIPS, 2015b.
277
+
278
+ Steven J. Rennie, Etienne Marcheret, Youssef Mroueh, Jarret Ross, and Vaibhava Goel. Self-critical Sequence Training for Image Captioning. In CVPR, 2017.
279
+
280
+ Santi Segui, Oriol Pujol, and Jordi Vitria. Learning to count with deep object features. In CVPRW, 2015.
281
+
282
+ Kevin J. Shih, Saurabh Singh, and Derek Hoiem. Where To Look: Focus Regions for Visual Question Answering. In CVPR, 2015.
283
+
284
+ Richard Socher, Andrej Karpathy, Quoc V Le, Christopher D Manning, and Andrew $\textsf { Y } \mathrm { N g }$ Grounded Compositional Semantics for Finding and Describing Images with Sentences. In TACL, 2014.
285
+
286
+ Damien Teney, Lingqiao Liu, and Anton van den Hengel. Graph-Structured Representations for Visual Question Answering. arXiv, 2016.
287
+ Damien Teney, Peter Anderson, Xiaodong He, and Anton van den Hengel. Tips and Tricks for Visual Question Answering: Learnings from the 2017 Challenge. In CVPR, 2017.
288
+ Aaron van den Oord, Nal Kalchbrenner, Oriol Vinyals, Lasse Espeholt, Alex Graves, and Koray Kavukcuoglu. Conditional Image Generation with PixelCNN Decoders. In NIPS, 2016.
289
+ R J Williams. Simple statistical gradient-following methods for connectionist reinforcement learning. Machine Learning, 8:229–256, 1992.
290
+ Ronald J. Williams and Jing Peng. Function Optimization using Connectionist Reinforcement Learning Algorithms. Connection Science, 3(3):241–268, 1991.
291
+ Caiming Xiong, Stephen Merity, and Richard Socher. Dynamic Memory Networks for Visual and Textual Question Answering. In ICML, 2016.
292
+ Huijuan Xu and Kate Saenko. Ask, Attend and Answer: Exploring Question-Guided Spatial Attention for Visual Question Answering. In ECCV, 2015.
293
+ Zichao Yang, Xiaodong He, Jianfeng Gao, Li Deng, and Alex Smola. Stacked Attention Networks for Image Question Answering. In CVPR, 2015.
294
+ Cong Zhang, Hongsheng Li, Xiaogang Wang, and Xiaokang Yang. Cross-scene crowd counting via deep convolutional neural networks. In CVPR, 2015.
295
+ Jianming Zhang, Shugao Ma, Mehrnoosh Sameki, Stan Sclaroff, Margrit Betke, Zhe Lin, Xiaohui Shen, Brian Price, and Radom´ır Mech. Salient Object Subitizing. ˇ International Journal of Computer Vision, 2017.
296
+ Bolei Zhou, Yuandong Tian, Sainbayar Sukhbaatar, Arthur Szlam, and Rob Fergus. Simple Baseline for Visual Question Answering. arXiv, 2015.
297
+ Yuke Zhu, Oliver Groth, Michael Bernstein, and Li Fei-Fei. Visual7W: Grounded Question Answering in Images. In CVPR, 2015.
298
+
299
+ ![](images/3317654381e9379c625179dd0473708e03b558c15dd4a60f3e3650bbfa100487.jpg)
300
+ A EXAMPLES
301
+ Figure 8: Example outputs produced by each model. For SoftCount, objects are shaded according to the fractional count of each $0 =$ transparent; $1 { = }$ opaque). For UpDown, we similarly shade the objects but use the attention focus to determine opacity. For IRLC, we plot only the boxes from objects that were selected as part of the count.
302
+
303
+ ![](images/d7f5c1fcafb3eeca6c5f2082b1a554c0eada328b7d767e2ceb40338d489c6c9a.jpg)
304
+ Figure 9: Sequential counting of IRLC. At each timestep, we illustrate the unchosen boxes in pink, and shade each box according to $\kappa ^ { t }$ (corresponding to the probability that the box would be selected at that time step; see main text). We also show the already-selected boxes in blue. For each of the questions, the counting sequence terminates at $t = 3$ , meaning that the returned count $C$ is 3. For each of these questions, that is the correct answer. The example on the far right is a ‘correct failure,’ a case where the correct answer is returned but the counted objects are not related to the question. These kinds of subtle failures are revealed with the grounded counts.
305
+
306
+ # B TRAINING AND IMPLEMENTATION DETAILS
307
+
308
+ # B.1 CAPTION GROUNDING
309
+
310
+ We experiment with jointly training counting and caption grounding. The goal of caption grounding is, given a set of objects and a caption, to identify the object that the caption describes. Identical to the first stages of answering the counting question, we use an LSTM to encode the caption and compare it to each of the objects using the scoring function:
311
+
312
+ $$
313
+ \begin{array} { l } { { h ^ { t } = \mathrm { L S T M } \left( x ^ { t } , h ^ { t - 1 } \right) } } \\ { { s _ { i } = f ^ { S } \left( \left[ h ^ { T } , v _ { i } \right] \right) } } \end{array}
314
+ $$
315
+
316
+ where $h \in \mathbb { R } ^ { 1 0 2 4 }$ , $x _ { i } ^ { t } \in \mathbb { R } ^ { 3 0 0 }$ is the embedding for the token at timestep $t$ of the caption, $T$ is the caption length, and $f ^ { S } : \mathbb { R } ^ { m } \mathbb { R } ^ { n }$ is the scoring function (Sec. 4.3). The embedding of object $i$ is denoted by $v _ { i }$ and the relevance of this object to the caption is encoded by the score vector $s _ { i }$ .
317
+
318
+ We project each such score vector to a scalar logit $\alpha _ { i }$ and apply a softmax nonlinearity to estimate $\boldsymbol { p } \in \mathbf { \mathbb { R } } ^ { \tilde { N } }$ , where $N$ is the number of object proposals and $p _ { i }$ denotes the probability that the caption describes object proposal $i$ :
319
+
320
+ $$
321
+ \begin{array} { l } { \alpha _ { i } = W s _ { i } + b } \\ { p = \operatorname { s o f t m a x } \left( \alpha \right) . } \end{array}
322
+ $$
323
+
324
+ During training, we randomly select four of the images in the batch of examples to use for caption grounding (rather than the full 32 images that make up a batch). To create training data from the region captions in Visual Genome, we assign each caption to one of the detected object proposals. To do so, we compute the intersection over union between the ground truth region that the caption describes and the coordinates of each object proposal. We assign the object proposal with the largest IoU to the caption. If the maximum IoU for the given caption is less than 0.5, we ignore it during training. We compute the grounding probability $p$ for each caption to which we can successfully assign a detection and train using the cross entropy loss averaged over the captions. We weight the loss associated with caption grounding by 0.1 relative to the counting loss.
325
+
326
+ # B.2 COUNTING MODELS
327
+
328
+ Each of the considered counting models makes use of the same basic architecture for encoding the question and comparing it with each of the detected objects. For each model, we initialized the word embeddings from GloVe (Pennington et al., 2014) and encoded the question with an LSTM of hidden size 1024. The only differences in the model-specific implementations of the language module was the hidden size of the scoring function $f ^ { S }$ . We determined these specifics from the optimal settings observed during initial experiments. We use a hidden size of 512 for SoftCount and UpDown and a hidden size of 2048 for IRLC. We observed that the former two models were more prone to overfitting, whereas IRLC benefited from the increased capacity.
329
+
330
+ When training on counting, we optimize using Adam (Kingma & Ba, 2014). For SoftCount and UpDown, we use a learning rate of $3 \mathrm { x } 1 0 ^ { - 4 }$ and decay the learning rate by 0.8 when the training accuracy plateaus. For IRLC, we use a learning rate of $5 \mathrm { x } 1 0 ^ { - 4 }$ and decay the learning rate by 0.99999 every iteration. For all models, we regularize using dropout and apply early stopping based on the development set accuracy (see below).
331
+
332
+ When training IRLC, we apply the sampling procedure 5 times per question and average the losses. We weight the entropy penalty $P _ { H }$ and interaction penalty $P _ { I }$ (Eq. 10) both by 0.005 relative to the counting loss. These penalty weights yield the best development set accuracy within the hyperparameter search we performed (Fig. 10).
333
+
334
+ # C ADDITIONAL ANALYSES AND EXPERIMENTS
335
+
336
+ IRLC auxiliary loss. We performed a grid search to determine the optimal setting for the weights of the auxiliary losses for training IRLC. From our observations, the entropy penalty is important to balance the exploration of the model during training. In addition, the interaction penalty prevents degenerate counting strategies. The results of the grid search suggest that these auxiliary losses improve performance but become unhelpful if given too much weight (Fig. 10). In any case, IRLC outperforms the baseline models across the range of settings explored.
337
+
338
+ ![](images/e485c8ca56415cc03c33f92e851009fc3740f2e90c71827bc0edf11559b48d96.jpg)
339
+ Figure 10: Results of a hyperparameter sweep over the penalty weights. The accuracy over the development set is reported for each weight setting.
340
+
341
+ ![](images/956077bd0329998beea6c243d33d4871e53571c08b1c9e9aeb9ddaa0d579b1e7.jpg)
342
+ Figure 11: HowMany-QA test set performance for models trained with the full HowMany-QA training data (blue) and trained without the additional data from Visual Genome (green).
343
+
344
+ Data augmentation with Visual Genome. Here, we compare performance on the HowManyQA test set for models trained with and without additional data from Visual Genome QA. In all cases, performance benefits from the additional training data (Fig. 11). On average, excluding Visual Genome from the training data decreases accuracy by $2 . 7 \%$ and increases RMSE by 0.12. Interestingly, the performance of IRLC is most robust to the loss of training data.
345
+
346
+ Ordinality of UpDown output. Whereas the training objectives for SoftCount and IRLC intrinsically reflect the ordinal nature of counts, the same is not true for UpDown. For example, the loss experienced by SoftCount and IRLC reflect the degree of error between the estimated count and the ground truth target; however, UpDown is trained only to place high probability mass on the ground truth value (missing by 1 or by 10 are treated as equally incorrect). We examine the patterns in the output count probabilities from UpDown to ask whether the model learns an ordinal representation despite its non-ordinal training objective. Figure 12 illustrates these trends. When the estimated count is less than 5, the second-most probable count is very frequently adjacent to the most probable count. When the estimated count is larger than 5, the probability distribution is less smooth, such that the second-most probable count is often considerably different than the most probable count. This result suggests that UpDown learns ordinality for lower count values (where training data is abundant) but fails to generalize this concept to larger counts (where training data is more sparse).
347
+
348
+ ![](images/c83c9cf326a316921071e1b3e49aed3326729b5a922b2e42e5b15a753ffae7ac.jpg)
349
+ Figure 12: (Left) Average count probability (Eq. 15) from UpDown, grouped according to the estimated count. (Right) Cumulative distribution of the absolute difference between the top two predicted counts, shown for when the most likely count was less than 5 (blue) and when it was greater than or equal to 5 (green). The probability distributions are much less smooth when the estimated count is large.
350
+
351
+ # D EVALUATION METRICS
352
+
353
+ Accuracy. The VQA dataset includes annotations from ten human reviewers per question. The accuracy of a given answer $a$ depends on how many of the provided answers it agrees with. It is scored as correct if at least 3 humans answers agree:
354
+
355
+ $$
356
+ \operatorname { \mathrm { \tt ~ A c c } } \left( a \right) = \operatorname* { m i n } \left[ \frac { \# \mathrm { h u m a n s ~ t h a t ~ s a i d } a } { 3 } , 1 \right] .
357
+ $$
358
+
359
+ Each answer’s accuracy is averaged over each 10-choose-9 set of human answers. As described in the main text, we only consider examples where the consensus answer was in the range of 0-20. We use all ten labels to calculate accuracy, regardless of whether individual labels deviate from this range. Thee accuracy values we report are taken from the average accuracy over some set of examples.
360
+
361
+ RMSE. This metric simply quantifies the typical deviation between the model count and the groundtruth. Across a set of $N$ , we calculate this metric as
362
+
363
+ $$
364
+ \mathrm { R M S E } = \sqrt { \frac { 1 } { N } \sum _ { i } ( \hat { C } _ { i } - C _ { i } ) ^ { 2 } } ,
365
+ $$
366
+
367
+ where $\hat { C } _ { i }$ and $C _ { i }$ are the predicted and ground truth counts, respectively, for question $i$ . RMSE is a measurement of error, so lower is better.
368
+
369
+ Grounding Quality. We introduce a new evaluation method for quantifying how relevant the objects counted by a model are to the type of object it was asked to count. This evaluation metric takes advantage of the ground truth labels included in the COCO dataset. These labels annotate each object instance of 80 different categories for each of the images in the development set. We make use of GloVe embeddings to compute semantic similarity. We use GloVe $( x ) \ { \stackrel { \cdot } { \in } } \ \mathbb { R } ^ { 3 0 0 }$ to denote the ( $L 2$ normalized) GloVe embedding of category $x$ .
370
+
371
+ For each image $m$ , the analysis is carried out in two stages.
372
+
373
+ First, we assign one of the COCO categories (or background) to each of the object proposals used for counting. For each object proposal, we find the object in the COCO labels with the largest IoU. If the IoU is above 0.5, we assign the object proposal to the category of the COCO object, otherwise we assign the object proposal to the background. Below, we use $k _ { i } ^ { m }$ to denote the category assigned to object proposal $i$ for image $m$ .
374
+
375
+ Second, for each of the COCO categories present in image $m$ , we use the category $q$ (i.e. $q = \ " \mathrm { c a r } \ ' )$ to build a question (i.e. “How many cars are there?”). For SoftCount and IRLC, the count returned in response to this question is the sum of each object proposal’s inferred count value:
376
+
377
+ $$
378
+ C ^ { ( m , q ) } = \sum _ { i } ^ { N ^ { m } } w _ { i } ^ { ( m , q ) } ,
379
+ $$
380
+
381
+ where $N ^ { m }$ is the number of object proposals in image $m$ and $w _ { i } ^ { ( m , q ) }$ is the count value given to proposal $i$ . We use the count values to compute a weighted sum of the semantic similarity between the assigned object proposal categories $k$ and the question category $q$ :
382
+
383
+ $$
384
+ s ^ { ( m , q ) } = \sum _ { i } ^ { N ^ { m } } w _ { i } ^ { ( m , q ) } \left( \mathsf { G l o V e } \left( k _ { i } ^ { m } \right) ^ { T } \mathsf { G l o V e } \left( q \right) \right) ,
385
+ $$
386
+
387
+ where semantic similarity is estimated from the dot product between the embeddings of the assigned category and the question category. If $k _ { i } ^ { m }$ corresponds to the background category, we replace its embedding with a vector of zeros.
388
+
389
+ The final metric is computed for each COCO category by accumulating the results over all images that contain a label for that category and normalizing by the net count to get an average:
390
+
391
+ $$
392
+ s ^ { ( q ) } = \frac { \Sigma _ { m } s ^ { ( m , q ) } } { \Sigma _ { m } C ^ { ( m , q ) } } .
393
+ $$
394
+
395
+ The interpretation of this metric is straightforward: on average, how relevant are the counted objects to the subject of the question.
md/train/S1x0CnEtvB/S1x0CnEtvB.md ADDED
@@ -0,0 +1,307 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # AutoGrow: AUTOMATIC LAYER GROWING IN DEEPCONVOLUTIONAL NETWORKS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Depth is a key component of Deep Neural Networks (DNNs), however, designing depth is heuristic and requires many human efforts. We propose AutoGrow to automate depth discovery in DNNs: starting from a shallow seed architecture, AutoGrow grows new layers if the growth improves the accuracy; otherwise, stops growing and thus discovers the depth. We propose robust growing and stopping policies to generalize to different network architectures and datasets. Our experiments show that by applying the same policy to different network architectures, AutoGrow can always discover near-optimal depth on various datasets of MNIST, FashionMNIST, SVHN, CIFAR10, CIFAR100 and ImageNet. For example, in terms of accuracy-computation trade-off, AutoGrow discovers a better depth combination in ResNets than human experts. Our AutoGrow is efficient. It discovers depth within similar time of training a single DNN.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Layer depth is one of the decisive factors of the success of Deep Neural Networks (DNNs). For example, image classification accuracy keeps improving as the depth of network models grows (Krizhevsky et al., 2012; Simonyan & Zisserman, 2014; Szegedy et al., 2015; He et al., 2016; Huang et al., 2017). Although shallow networks cannot ensure high accuracy, DNNs composed of too many layers may suffer from over-fitting and convergence difficulty in training. How to obtain the optimal depth for a DNN still remains mysterious. For instance, ResNet-152 (He et al., 2016) uses 3, 8, 36 and 3 residual blocks under output sizes of $5 6 \times 5 6 .$ , $2 8 \times 2 8$ , $1 4 \times 1 4$ and $7 \times 7$ , respectively, which don’t show an obvious quantitative relation. In practice, people usually reply on some heuristic trials and tests to obtain the depth of a network: they first design a DNN with a specific depth and then train and evaluate the network on a given dataset; finally, they change the depth and repeat the procedure until the accuracy meets the requirement. Besides the high computational cost induced by the iteration process, such trial & test iterations must be repeated whenever dataset changes. In this paper, we propose AutoGrow that can automate depth discovery given a layer architecture. We will show that AutoGrow generalizes to different datasets and layer architectures.
12
+
13
+ There are some previous works which add or morph layers to increase the depth in DNNs. VggNet (Simonyan & Zisserman, 2014) and DropIn (Smith et al., 2016) added new layers into shallower DNNs; Network Morphism (Wei et al., 2016; 2017; Chen et al., 2015) morphed each layer to multiple layers to increase the depth meanwhile preserving the function of the shallower net. Table 1 summarizes differences in this work. Their goal was to overcome difficulty of training deeper DNNs or accelerate it. Our goal is to automatically find an optimal depth. Moreover, previous works applied layer growth by once or a few times at pre-defined locations to grow a pre-defined number of layers; in contrast, ours automatically learns the number of new layers and growth locations without limiting growing times. We will summarize more related works in Section 4.
14
+
15
+ Figure 1 illustrates an example of AutoGrow. It starts from the shallowest backbone network and gradually grows sub-modules (A sub-module can be one or more layers, e.g., a residual block); the growth stops once a stopping policy is satisfied. We studied multiple initializers of new layers and multiple growing policies, and surprisingly find that: (1) a random initializer works equally or better than complicated Network Morphism; (2) it is more effective to grow before a shallow net converges. We hypothesize that this is because a converged shallow net is an inadequate initialization for training deeper net, while random initialization can help to escape from a bad starting point.
16
+
17
+ Motivated by this, we intentionally avoid full convergence during the growing by using (1) random initialization of new layers, (2) a constant large learning rate, and (3) a short growing interval.
18
+
19
+ ![](images/72e33b5122b717c13c9dc77bce7ee8b88fa746ca183412e7a3b8ecb0c8f45468.jpg)
20
+ Figure 1: A simple example of AutoGrow.
21
+
22
+ Table 1: Comparison with previous works about layer growth.
23
+
24
+ <table><tr><td colspan="2">Previous works</td><td>Ours</td></tr><tr><td>Goal</td><td>Ease training</td><td>Depth automation</td></tr><tr><td>Times</td><td>Once or a few</td><td>Unlimited</td></tr><tr><td>Locations</td><td>Human defined</td><td>Learned</td></tr><tr><td>Layer #</td><td>Human defined</td><td>Learned</td></tr></table>
25
+
26
+ Our contributions are: (1) We propose AutoGrow to automate DNN layer growing and depth discovery. AutoGrow is very robust. With the same hyper-parameters, it adapts network depth to various datasets including MNIST, FashionMNIST, SVHN, CIFAR10, CIFAR100 and ImageNet. Moreover, AutoGrow can also discover shallower DNNs when the dataset is a subset. (2) AutoGrow demonstrates high efficiency and scales up to ImageNet, because the layer growing is as fast as training a single DNN. On ImageNet, it discovers a new ResNets with better trade-off between accuracy and computation complexity. (3) We challenge the idea of Network Morphism, as random initialization works equally or better when growing layers. (4) We find that it is beneficial to rapidly grow layers before a shallower net converge, contradicting previous intuition.
27
+
28
+ # 2 AutoGrow – A DEPTH GROWING ALGORITHM
29
+
30
+ # Algorithm 1 AutoGrow Algorithm.
31
+
32
+ ![](images/e7209b24a99a73964f399e911a453f4a602e8d31ef04219a317e7a5047c6e827.jpg)
33
+
34
+ Figure 1 gives an overview of the proposed AutoGrow. In this paper, we use network, sub-networks, sub-modules and layers to describe the architecture hierarchy. A network is composed of a cascade of sub-networks. A sub-network is composed of sub-modules, which typical share the same output size. A sub-module (e.g. a residual block) is an elementary growing block composed of one or a few layers. In this section, we rigorously formulate a generic version of AutoGrow which will be materialized in subsections. A deep convolutional network $g ( \mathcal { X } _ { 0 } )$ is a cascade of sub-networks by composing functions as $g ( \mathcal { X } _ { 0 } ) = l \bar { ( } f _ { M - 1 } ( \pmb { f } _ { M - 2 } ( \cdot \cdot \cdot f _ { 1 } ( \pmb { f } _ { 0 } ( \mathcal { X } _ { 0 } ) ) \cdot \cdot \cdot \cdot ) ) ) .$ ), where $\mathcal { X } _ { 0 }$ is an input image, $M$ is the number of sub-networks, $l ( \cdot )$ is a loss function, and $\mathscr { X } _ { i + 1 } = f _ { i } \left( \mathscr { X } _ { i } \right)$ is a sub-network that operates on an input image or a feature tensor $\mathcal { X } _ { i } \in \mathbb { R } ^ { c _ { i } \times h _ { i } \times w _ { i } }$ . Here, $c _ { i }$ is the number of channels, and $h _ { i }$ and $w _ { i }$ are spatial dimensions. $f _ { i } \left( \mathcal { X } _ { i } \right)$ is a simplified notation of $\pmb { f } _ { i } \left( \mathcal { X } _ { i } ; \mathbb { W } _ { i } \right)$ , where $\mathbb { W } _ { i }$ is a set of sub-modules’ parameters within the $i$ -th sub-network. Thus $\mathbb { W } = \{ \mathbb { W } _ { i } : i = 0 \dots M - 1 \}$ denotes the whole set of parameters in the DNN. To facilitate growing, the following properties are supported within a sub-network: (1) the first sub-module usually reduces the size of input feature maps, e.g., using pooling or convolution with a stride; and (2) all sub-modules in a sub-network maintain the same output size. As such, our framework can support popular networks, including VggNet-like plain networks (Simonyan & Zisserman, 2014), GoogLeNet (Szegedy et al., 2015), ResNets (He et al., 2016) and DenseNets (Huang et al., 2017). In this paper, we select ResNets and VggNet-like nets as representatives of DNNs with and without shortcuts, respectively.
35
+
36
+ With above notations, Algorithm 1 rigorously describes the AutoGrow algorithm. In brief, AutoGrow starts with the shallowest net where every sub-network has only one sub-module for spatial dimension reduction. AutoGrow loops over all growing sub-networks in order. For each sub-network, AutoGrow stacks a new sub-module. When the new sub-module does not improve the accuracy, the growth in corresponding sub-network will be permanently stopped. The details of our method will be materialized in the following subsections.
37
+
38
+ # 2.1 SEED SHALLOW NETWORKS AND SUB-MODULES
39
+
40
+ In this paper, in all datasets except ImageNet, we explore growing depth for four types of DNNs: (1) Basic3ResNet: the same ResNet used for CIFAR10 in He et al. (2016), which has 3 residual subnetworks with output spatial sizes of $3 2 \times 3 2$ , $1 6 \times 1 6$ and $8 \times 8$ , respectively; (2) Basic4ResNet: a variant of ResNet used for ImageNet in He et al. (2016) built by basic residual blocks (each of which contains two convolutions and one shortcut). There are 4 sub-networks with output spatial sizes of $3 2 \times 3 2$ , $1 6 \times 1 6$ , $8 \times 8$ and $4 \times 4$ , respectively; (3) Plain3Net: a VggNet-like plain net by removing shortcuts in Basic3ResNet; (4) Plain4Net: a VggNet-like plain net by removing shortcuts in Basic4ResNet.
41
+
42
+ In AutoGrow, the architectures of seed shallow networks and sub-modules are pre-defined. In plain DNNs, a sub-module is a stack of convolution, Batch Normalization and ReLU; in residual DNNs, a sub-module is a residual block. In AutoGrow, a sub-network is a stack of all sub-modules with the same output spatial size. Unlike He et al. (2016) which manually designed the depth, AutoGrow starts from a seed architecture in which each sub-network has only one sub-module and automatically learns the number of sub-modules.
43
+
44
+ On ImageNet, we apply the same backbones in He et al. (2016) as the seed architectures. A seed architecture has only one sub-module under each output spatial size. For a ResNet using basic residual blocks or bottleneck residual blocks (He et al., 2016), we respectively name it as Basic4ResNet or Bottleneck4ResNet. Plain4Net is also obtained by removing shortcuts in Basic4ResNet.
45
+
46
+ # 2.2 SUB-MODULE INITIALIZERS
47
+
48
+ Here we explain how to initialize a new sub-module $\mathcal { W }$ in initializer $( \mathcal { W } )$ mentioned in Algorithm 1. Network Morphism changes DNN architecture meanwhile preserving the loss function via special initialization of new layers, that is, $g ( \mathcal { X } _ { 0 } ; \mathbb { W } ) = g ( \mathcal { X } _ { 0 } ; \mathbb { W } \cup \mathcal { W } ) \ \forall \mathcal { X } _ { 0 }$ . A residual sub-module shows a nice property: when stacking a residual block and initializing the last Batch Normalization layer as zeros, the function of the shallower net is preserved but the DNN is morphed to a deeper net. Thus, Network Morphism can be easily implemented by this zero initialization (ZeroInit).
49
+
50
+ In this work, all layers in $\mathcal { W }$ are initialized using default randomization, except for a special treatment of the last Batch Normalization layer in a residual sub-module. Besides ZeroInit, we propose a new AdamInit for Network Morphism. In AdamInit, we freeze all parameters except the last Batch Normalization layer in $\mathcal { W }$ , and then use Adam optimizer (Kingma & Ba, 2014) to optimize the last Bath Normalization for maximum 10 epochs till the training accuracy of the deeper net is as good as the shallower one. After AdamInit, all parameters are jointly optimized. We view AdamInit as a Network Morphism because the training loss is similar after AdamInit. We empirically find that AdamInit can usually find a solution in less than 3 epochs. We also study random initialization of the last Batch Normalization layer using uniform (UniInit) or Gaussian (GauInit) noises with a standard deviation 1.0. We will show that GauInit obtains the best result, challenging the idea of Network Morphism (Wei et al., 2016; 2017; Chen et al., 2015).
51
+
52
+ # 2.3 GROWING AND STOPPING POLICIES
53
+
54
+ In Algorithm 1, a growing policy refers to meetGrowingPolicy(), which returns true when the network should grow a sub-module. Two growing policies are studied here:
55
+
56
+ 1. Convergent Growth: meetGrowingPolicy() returns true when the improvement of validation accuracy is less than $\tau$ in the last $K$ epochs. That is, in Convergent Growth, AutoGrow only grows when current network has converged. This is a similar growing criterion adopted in previous works (Elsken et al., 2017; Cai et al., 2018a;b).
57
+ 2. Periodic Growth: meetGrowingPolicy() always returns true, that is, the network always grows every $K$ epochs. Therefore, $K$ is also the growing period. In the best practice of AutoGrow, $K$ is small (e.g. $K = 3$ ) such that it grows before current network converges.
58
+
59
+ Our experiments will show that Periodic Growth outperforms Convergent Growth. We hypothesize that a fully converged shallower net is an inadequate initialization to train a deeper net. We will perform experiments to test this hypothesis and visualize optimization trajectory to illustrate it.
60
+
61
+ A stopping policy denotes meetStoppingPolicy() in Algorithm 1. When Convergent Growth is adopted, meetStoppingPolicy() returns true if a recent growth does not improve validation accuracy more than $\tau$ within $K$ epochs. We use a similar stopping policy for Periodic Growth; however, as it can grow rapidly with a small period $K$ (e.g. $K \ : = \ : 3 ,$ ) before it converges, we use a larger window size $J$ for stop. Specifically, when Periodic Growth is adopted, meetStoppingPolicy() returns true when the validation accuracy improves less than $\tau$ in the last $J$ epochs, where $J \gg K$ .
62
+
63
+ Hyper-parameters $\tau$ , $J$ and $K$ control the operation of AutoGrow and can be easily setup and generalize well. $\tau$ denotes the significance of accuracy improvement for classification. We simply set $\tau = 0 . 0 5 \%$ in all experiments. $J$ represents how many epochs to wait for an accuracy improvement before stopping the growth of a sub-network. It is more meaningful to consider stopping when the new net is trained to some extent. As such, we set $J$ to the number of epochs $T$ under the largest learning rate when training a baseline. $K$ means how frequently AutoGrow checks the polices. In Convergent Growth, we simply set $K = T$ , which is long enough to ensure convergence. In Periodic Growth, $K$ is set to a small fraction of $T$ to enable fast growth before convergence; more importantly, $K = 3$ is very robust to all networks and datasets. Therefore, all those hyper-parameters are very robust and strongly correlated to design considerations.
64
+
65
+ # 3 EXPERIMENTS
66
+
67
+ In this paper, we use Basic3ResNet-2-3-2, for instance, to denote a model architecture which contains 2, 3 and 2 sub-modules in the first, second and third sub-networks, respectively. Sometimes we simplify it as $2 - 3 - 2$ for convenience. AutoGrow always starts from the shallowest depth of $1 - 1 - 1$ and uses the maximum validation accuracy as the metric to guide growing and stopping. All DNN baselines are trained by SGD with momentum 0.9 using staircase learning rate. The initial learning rate is 0.1 in ResNets and 0.01 in plain networks. On ImageNet, baselines are trained using batch size 256 for 90 epochs, within which learning rate is decayed by $0 . 1 \times$ at epoch 30 and 60. In all other smaller datasets, baselines are trained using batch size 128 for 200 epochs and learning rate is decayed by $0 . 1 \times$ at epoch 100 and 150.
68
+
69
+ Our early experiments followed prior wisdom by growing layers with Network Morphism (Wei et al., 2016; 2017; Chen et al., 2015; Elsken et al., 2017; Cai et al., 2018a;b), i.e., AutoGrow with ZeroInit (or AdamInit) and Convergent Growth policy; however, it stopped early with very shallow DNNs, failing to find optimal depth. We hypothesize that a converged shallow net with Network Morphism gives a bad initialization to train a deeper neural network. Section 3.1 experimentally test that the hypothesis is valid. To tackle this issue, we intentionally avoid convergence during growing by three simple solutions, which are evaluated in Section 3.2. Finally, Section 3.3 and Section 3.4 include extensive experiments to show the effectiveness of our final AutoGrow.
70
+
71
+ # 3.1 SUBOPTIMUM OF NETWORK MORPHISM AND CONVERGENT GROWTH
72
+
73
+ In this section, we study Network Morphism itself and its integration into our AutoGrow under Convergent Growth. When studying Network Morphism, we take the following steps: 1) train a shallower ResNet to converge, 2) stack residual blocks on top of each sub-network to morph to a deeper net, 3) use ZeroInit or AdamInit to initialize new layers, and 4) train the deeper net in a standard way. We compare the accuracy difference $( ^ { 6 6 } \Delta ^ { , 3 } )$ between Network Morphism and training the deeper net from scratch. Table 2 summaries our results. Network Morphism has a lower accuracy (negative “ $\cdot \Delta ^ { \prime \prime }$ ) in all the cases, which validates our hypothesis that a converged shallow network with Network Morphism gives a bad initialization to train a deeper net. We visualize the optimization trajectories in Appendix A.0.1 to illustrate the hypothesis.
74
+
75
+ To further validate our hypothesis, we integrate Network Morphism as the initializer in AutoGrow with Convergent Growth policy. We refer to this version of AutoGrow as $c$ -AutoGrow with “ $_ { \mathrm { ~ \tiny ~ c ~ } }$ -” denoting “Convergent.” More specific, we take ZeroInit or AdamInit as sub-module initializer and “Convergent Growth” policy in Algorithm 1. To recap, in this setting, AutoGrow trains a shallower net till it converges, then grows a sub-module which is initialized by Network Morphism, and repeats the same process till there is no further accuracy improvement. In every interval of $K$ training epochs (train $( g ( \mathcal { X } _ { 0 } ) , K )$ in Algorithm 1), “staircase” learning rate is used. The learning rate is reset to 0.1 at the first epoch, and decayed by $0 . 1 \times$ at epoch $\frac { K } { 2 }$ and $\frac { 3 K } { 4 }$ . The results are shown in Table 3 by “staircase” rows, which illustrate that $c$ -AutoGrow can grow a DNN multiple times and finally find a depth. However, there are two problems: 1) the final accuracy is lower than training the found net from scratch, as indicated by $^ { 6 6 } \Delta ^ { , 9 }$ , validating our hypothesis; 2) the depth learning stops too early with a relatively shallower net, while a deeper net beyond the found depth can achieve a higher accuracy as we will show in Table 6. These problems provide a circumstantial evidence of the hypothesis that a converged shallow net with Network Morphism gives a bad initialization. Thus, AutoGrow cannot receive signals to continue growing after a limited number of growths. In Appendix A.0.1, Figure 6(a) visualizes the trajectory of $c$ -AutoGrow corresponding to row $^ { 6 6 } 2 - 3 - 6 ^ { 3 3 }$ in Table 3.
76
+
77
+ # 3.2 ABLATION STUDY FOR AutoGrow DESIGN
78
+
79
+ Based on the findings in Section 3.1, we propose three simple but effective solutions to further enhance AutoGrow and refer it as $p$ -AutoGrow, with $\mathbf { \dot { \rho } } _ { p }$ -” denoting “Periodic”: (1) Use a large constant learning rate for growing, i.e., 0.1 for residual networks and 0.01 for plain networks. Stochastic gradient descent with a large learning rate intrinsically introduces noises, which help to avoid a full convergence into a bad initialization from a shallower net. Note that staircase learning rate is still used for fine-tuning after discovering the final DNN; (2) Use random initialization (UniInit or GauInit) as noises to escape from an inadequate initialization; (3) Grow rapidly before a shallower net converges by taking Periodic Growth with a small $K$ .
80
+
81
+ $p$ -AutoGrow is our final AutoGrow. In the rest part of this section, we perform ablation study to prove that the three solutions are effective. We start from $c$ -AutoGrow, and incrementally add above solutions one by one and eventually obtain $p$ -AutoGrow. In Table 3, first, we replace the staircase learning rate with a constant learning rate, the accuracy of AutoGrow improves and therefore $^ { 6 6 } \Delta ^ { , 9 }$ improves; second, we further replace Network Morphism (ZeroInit or AdamInit) with a random initializer (UniInit or GauInit) and result in a bigger gain. Overall, combining a constant learning rate with GauInit performs the best. Thus, constant learning rate and GauInit are adopted in the remaining experiments, unless we explicitly specify them.
82
+
83
+ Table 2: Network Morphism tested on CIFAR10.
84
+
85
+ <table><tr><td>net backbone</td><td>shallower</td><td>deeper</td><td>initializer</td><td>accu %</td><td>*</td></tr><tr><td>Basic3ResNet</td><td>3-3-3</td><td>5-5-5</td><td>ZeroInit AdamInit</td><td>92.71 92.82</td><td>-0.77</td></tr><tr><td rowspan="2">Basic3ResNet</td><td rowspan="2">5-5-5</td><td rowspan="2">9-9-9</td><td></td><td></td><td>-0.66</td></tr><tr><td>ZeroInit</td><td>93.64</td><td>-0.27 -0.38</td></tr><tr><td rowspan="2">Basic4ResNet</td><td rowspan="2">1-1-1-1</td><td rowspan="2">2-2-2-2</td><td>AdamInit</td><td>93.53 94.96</td><td></td></tr><tr><td>ZeroInit AdamInit</td><td>95.17</td><td>-0.37 -0.16</td></tr></table>
86
+
87
+ ∗ $\overline { { \Delta = } }$ (accuracy of Network Morphism) − (accuracy of training from scratch)
88
+
89
+ Table 3: Ablation study of $c$ -AutoGrow.
90
+
91
+ <table><tr><td>dataset</td><td>learning rate</td><td>initializer</td><td>found net†</td><td>accu %</td><td>△*</td><td>dataset</td><td>learning rate</td><td>initializer</td><td>found net</td><td>accu %</td><td>△*</td></tr><tr><td rowspan="6">CIFAR10</td><td>staircase</td><td>ZeroInit</td><td>2-3-6</td><td>91.77</td><td>-1.06</td><td rowspan="6"></td><td>staircase</td><td>ZeroInit</td><td>4-3-4</td><td>70.04</td><td>-0.65</td></tr><tr><td>staircase</td><td>AdamInit</td><td>3-4-3</td><td>92.21 -0.59</td><td></td><td>staircase</td><td>AdamInit</td><td>3-3-3</td><td>69.85</td><td>-0.65</td></tr><tr><td>constant</td><td>ZeroInit</td><td>2-2-4</td><td>92.23</td><td>0.16</td><td>CIFAR100 constant</td><td>ZeroInit</td><td>3-2-4</td><td>70.22</td><td>0.35</td></tr><tr><td>constant</td><td>AdamInit</td><td>3-4-4</td><td>92.60</td><td>-0.41</td><td>constant</td><td>AdamInit</td><td>3-3-3</td><td>70.00</td><td>-0.50</td></tr><tr><td>constant</td><td>UniInit</td><td>3-4-4</td><td>92.93</td><td>-0.08</td><td>constant</td><td>UniInit</td><td>4-4-3</td><td>70.39</td><td>0.36</td></tr><tr><td>constant</td><td>GauInit</td><td>2-4-3</td><td>93.12</td><td>0.55</td><td>constant</td><td>GauInit</td><td>3-4-3</td><td>70.66</td><td>0.91</td></tr></table>
92
+
93
+ † Basic3ResNet
94
+ ∗ ∆ = (accuracy of c-AutoGrow) − (accuracy of training from scratch)
95
+
96
+ Note that, in this paper, we are more interested in automating depth discovery to find a final DNN (“found net”) with a high accuracy (“accu”). Ideally, the “found net” has a minimum depth, a larger depth than which cannot further improve “accu”. We will show in Figure 3 that AutoGrow discovers a depth approximately satisfying this property. The “ $\Delta ^ { \prime \prime }$ is a metric to indicate how well shallower nets initialize deeper nets; a negative $^ { 6 6 } \Delta ^ { , 9 }$ indicates that weight initialization from a shallower net hurts training of a deeper net; while a positive “ $\cdot \Delta ^ { \prime \prime }$ indicates AutoGrow helps training a deeper net, which is a byproduct of this work.
97
+
98
+ Finally, we apply the last solution – Periodic Growth, and obtain our final $p$ -AutoGrow. Our ablation study results for $p$ -AutoGrow are summarized in Table 5 and Table 4. Table 5 analyzes the impact of the growing period $K$ . In general, $K$ is a hyper-parameter to trade off speed and accuracy: a smaller $K$ takes a longer learning time but discovers a deeper net, vice versa. Our results validate the preference of a faster growth (i.e. a smaller $K$ ). On CIFAR10/CIFAR100, the accuracy reaches plateau/peak at $K = 3$ ; further reducing $K$ produces a deeper net while the accuracy gain is marginal/impossible. In the following, we simply select $K = 3$ for robustness test. More importantly, our quantitative results in Table 5 show that $p$ -AutoGrow finds much deeper nets, overcoming the very-early stop issue in $c$ -AutoGrow in Table 3. That is, Periodic Growth proposed in this work is much more effective than Convergent Growth utilized in previous work.
99
+
100
+ For sanity check, we perform the ablation study of initializers for $p$ -AutoGrow. The results are in Table 8 in Appendix A.0.3, which further validates our wisdom on selecting GauInit. The motivation of Network Morphism in previous work was to start a deeper net from a loss function that has been well optimized by a shallower net, so as not to restart the deeper net training from scratch (Wei et al., 2016; 2017; Chen et al., 2015; Elsken et al., 2017; Cai et al., 2018a;b). In all our experiments, we find this is sure even with random initialization. Figure 2 plots the convergence curves and learning process for $^ { } 4 2 - 4 2 - 4 2 ^ { \circ }$ in Table 5. Even with GauInit, the loss and accuracy rapidly recover and no restart is observed. The convergence pattern in the “Growing” stage is similar to the “Fine-tuning” stage under the same learning rate (the initial learning rate 0.1). Similar results on ImageNet will be shown in Figure 8. Our results challenge the necessity of Network Morphism when growing neural networks.
101
+
102
+ At last, we perform the ablation study on the initial depth of the seed network. Table 4 demonstrates that a shallowest DNN works as well as a deeper seed. This implies that AutoGrow can appropriately stop regardless of the depth of the seed network. As the focus of this work is on depth automation, we prefer starting with the shallowest seed to avoid a manual search of a seed depth.
103
+
104
+ ![](images/7115fdf5652ea828e3ef817a308ac1719c82c992743edae687ce89c8bbfe3a43.jpg)
105
+ Figure 2: $p$ -AutoGrow on CIFAR10 $\ K \ : = \ : 3 ,$ . The seed net is Basic3ResNet $- 1 - 1 - 1$ .
106
+
107
+ Table 4: $p$ -AutoGrow with different seed architecture.
108
+
109
+ <table><tr><td>dataset</td><td>seed net</td><td>found net†</td><td>accuracy %</td></tr><tr><td rowspan="2">CIFAR10</td><td>1-1-1</td><td>42-42-42</td><td>94.27</td></tr><tr><td>5-5-5</td><td>46-46-46</td><td>94.16</td></tr><tr><td rowspan="2">CIFAR10</td><td>1-1-1-1</td><td>22-22-22-22</td><td>95.49</td></tr><tr><td>5-5-5-5</td><td>23-22-22-22</td><td>95.62</td></tr></table>
110
+
111
+ † Basic3ResNet or Basic4ResNet.
112
+
113
+ # 3.3 ADAPTABILITY OF AutoGrow
114
+
115
+ To verify the adaptability of AutoGrow, we use an identical configuration $\dot { p }$ -AutoGrow with $K = 3$ ) and test over 5 datasets and 4 seed architectures. Table 6 includes the results of all 20 combinations. Figure 3 compares AutoGrow with manual search which is obtained by training many DNNs with different depths from scratch. The results lead to the following conclusions and contributions:
116
+
117
+ Table 5: $p$ -AutoGrow with different growing interval $K$ .
118
+
119
+ <table><tr><td rowspan="2">K</td><td colspan="2">CIFAR10</td><td colspan="3">CIFAR100</td></tr><tr><td>found net</td><td>accu %</td><td>K</td><td>found net</td><td>accu %</td></tr><tr><td>50</td><td>6-5-3</td><td>92.95</td><td>50</td><td>8-5-7</td><td>72.07</td></tr><tr><td>20</td><td>7-7-7</td><td>93.26</td><td>20</td><td>8-11-10</td><td>72.93</td></tr><tr><td>10</td><td>19-19-19</td><td>93.46</td><td>10</td><td>18-18-18</td><td>73.64</td></tr><tr><td>5</td><td>23-22-22</td><td>93.98</td><td>5</td><td>23-23-23</td><td>73.70</td></tr><tr><td>3</td><td>42-42-42</td><td>94.27</td><td>3</td><td>54-53-53</td><td>74.72</td></tr><tr><td>1</td><td>77-76-76</td><td>94.30</td><td>1</td><td>68-68-68</td><td>74.51</td></tr></table>
120
+
121
+ † Basic3ResNet
122
+ † Basic3ResNet
123
+
124
+ Table 6: The adaptability of AutoGrow to datasets
125
+
126
+ <table><tr><td>net</td><td>dataset</td><td>found net</td><td>accu %</td><td>△*</td></tr><tr><td rowspan="5">Basic3ResNet</td><td>CIFAR10</td><td>42-42-42</td><td>94.27</td><td>-0.03</td></tr><tr><td>CIFAR100</td><td>54-53-53</td><td>74.72</td><td>-0.95</td></tr><tr><td>SVHN</td><td>34-34-34</td><td>97.22</td><td>0.04</td></tr><tr><td>FashionMNIST</td><td>30-29-29</td><td>94.57</td><td>-0.06</td></tr><tr><td>MNIST</td><td>33-33-33</td><td>99.64</td><td>-0.03</td></tr><tr><td rowspan="5">Basic4ResNet</td><td>CIFAR10</td><td>22-22-22-22</td><td>95.49</td><td>-0.10</td></tr><tr><td>CIFAR100</td><td>17-51-16-16</td><td>79.47</td><td>1.22</td></tr><tr><td>SVHN</td><td>20-20-19-19</td><td>97.32</td><td>-0.08</td></tr><tr><td>FashionMNIST</td><td>27-27-27-26</td><td>94.62</td><td>-0.17</td></tr><tr><td>MNIST</td><td>11-10-10-10</td><td>99.66</td><td>0.01</td></tr></table>
127
+
128
+ ∗ $\overline { { \Delta = } }$ (accuracy of AutoGrow) $-$ (accuracy of training from scratch)
129
+
130
+ <table><tr><td>net</td><td>dataset</td><td>found net</td><td>accu %</td><td>Δ*</td></tr><tr><td rowspan="5">Plain3Net</td><td>CIFAR10</td><td>23-22-22</td><td>90.82</td><td>6.49</td></tr><tr><td>CIFAR100</td><td>28-28-27</td><td>66.34</td><td>31.53</td></tr><tr><td>SVHN</td><td>36-35-35</td><td>96.79</td><td>77.20</td></tr><tr><td>FashionMNIST</td><td>17-17-17</td><td>94.49</td><td>0.56</td></tr><tr><td>MNIST</td><td>20-20-20</td><td>99.66</td><td>0.12</td></tr><tr><td rowspan="5">Plain4Net</td><td>CIFAR10</td><td>17-17-17-17</td><td>94.20</td><td>5.72</td></tr><tr><td>CIFAR100</td><td>16-15-15-15</td><td>73.91</td><td>29.34</td></tr><tr><td>SVHN</td><td>12-12-12-11</td><td>97.08</td><td>0.32</td></tr><tr><td>FashionMNIST</td><td>13-13-13-13</td><td>94.47</td><td>0.72</td></tr><tr><td>MNIST</td><td>13-12-12-12</td><td>99.57</td><td>0.03</td></tr></table>
131
+
132
+ 1. In Table 6, AutoGrow discovers layer depth across all scenarios without any tuning, achieving the main goal of this work. Manual design needs $m \cdot n \cdot k$ trials, where $m$ and $n$ are respectively the numbers of datasets and sub-module categories, and $k$ is the number of trials per dataset per sub-module category;
133
+
134
+ 2. For ResNets, a discovered depth $" \bullet '$ in Figure 3) falls at the location where accuracy saturates. This means AutoGrow discovers a near-optimal depth: a shallower depth will lose accuracy while a deeper one gains little. The final accuracy of AutoGrow is as good as training the discovered net from scratch as indicated by $\cdot \Delta ^ { , , }$ in Table 6, indicating that initialization from shallower nets does not hurt training of deeper nets. As a byproduct, in plain networks, there are large positive “ $\Delta \mathbf { i }$ ”s in Table 6. It implies that baselines fail to train very deep plain networks even using Batch Normalization, but AutoGrow enables the training of these networks; In Appendix A.0.3, Table 9 shows the accuracy improvement of plain networks by tuning $K$ , approaching the accuracy of ResNets with the same depth.
135
+
136
+ 3. For robustness and generalization study purpose, we stick to $K = 3$ in our experiments, however, we can tune $K$ to trade off accuracy and model size. As shown in Figure 3, AutoGrow discovers smaller DNNs when increasing $K$ from 3 $( ^ { 6 6 } \bullet \bullet )$ to 50 $( ^ { 6 6 } \bigcirc ^ { , 9 } )$ . Interestingly, the accuracy of plain networks even increases at $K = 5 0$ . This implies the possibility of discovering a better accuracy-depth trade-off by tuning $K$ , although we stick to $K = 3$ for generalizability study and it generalizes well.
137
+
138
+ 4. In Table 6, AutoGrow discovers different depths under different sub-modules. The final accuracy is limited by the sub-module design, not by our AutoGrow. Given a sub-module architecture, our AutoGrow can always find a near-optimal depth. With a better sub-module architecture, such as NASNet cell (Zoph et al., 2018), AutoGrow can improve accuracy.
139
+
140
+ Finally, our supposition is that: when the size of dataset is smaller, the optimal depth should be smaller. Under this supposition, we test the effectiveness of AutoGrow by sampling a subset of dataset and verify if AutoGrow can discover a shallower depth. In Appendix A.0.3, Table 11 summarizes the results. As expected, our experiments show that AutoGrow adapts to shallower networks when the datasets are smaller.
141
+
142
+ # 3.4 SCALING TO IMAGENET AND EFFICIENCY
143
+
144
+ In ImageNet, $K = 3$ should generalize well, but we explore AutoGrow with $K = 2$ and $K = 5$ to obtain an accuracy-depth trade-off line for comparison with human experts. The larger $K = 5$ enables AutoGrow to obtain a smaller DNN to trade-off accuracy and model size (computation) and the smaller $K = 2$ achieves higher accuracy. The results are shown in Table 7, which proves that AutoGrow automatically finds a good depth without any tuning. As a byproduct, the accuracy is even higher than training the found net from scratch, indicating that the Periodic Growth in AutoGrow helps training deeper nets. The comparison of AutoGrow and manual depth design (He et al., 2016) is in Figure 4, which shows that AutoGrow achieves better trade-off between accuracy and computation (measured by floating point operations).
145
+
146
+ Table 7: Scaling up to ImageNet
147
+
148
+ <table><tr><td>net</td><td>K</td><td>found net</td><td>Top-1</td><td>Top-5</td><td>△ Top-1</td></tr><tr><td rowspan="2">Basic4ResNet</td><td>2</td><td>12-12-11-11</td><td>76.28</td><td>92.79</td><td>0.43</td></tr><tr><td>5</td><td>9-3-6-4</td><td>74.75</td><td>91.97</td><td>0.72</td></tr><tr><td rowspan="2">Bottleneck4ResNet</td><td>2</td><td>6-6-6-17</td><td>77.99</td><td>93.91</td><td>0.83</td></tr><tr><td>5</td><td>6-7-3-9</td><td>77.33</td><td>93.65</td><td>0.83</td></tr><tr><td rowspan="2">Plain4Net</td><td>2</td><td>6-6-6-6</td><td>71.22</td><td>90.08</td><td>0.70</td></tr><tr><td>5</td><td>5-5-5-4</td><td>70.54</td><td>89.76</td><td>0.93</td></tr></table>
149
+
150
+ † ∆ = (Top-1 of AutoGrow) − (Top-1 of training from scratch)
151
+
152
+ In Appendix A.0.3, Table 10 summarizes the breakdown of wall-clock time in AutoGrow. The growing/searching time is as efficient as (often more efficient than) fine-tuning the single discovered DNN. The scalability of AutoGrow comes from its intrinsic features that (1) it grows quickly with a short period $K$ and stops immediately if no improvement is sensed; and (2) the network is small at the beginning of growing.
153
+
154
+ ![](images/f7a6254ad63b159c57ea06e4bc761b4e0c1049b8457efe33338457d61c2774a0.jpg)
155
+ Figure 3: AutoGrow vs manual search obtained by training many baselines from scratch. $x - a x i s$ is the number of parameters. Dataset is CIFAR10.
156
+
157
+ ![](images/84c1065d96345fcdaf849055087c1baabff04e3dc4738d9ef0934583464c554a.jpg)
158
+ Figure 4: AutoGrow vs. manual design (He et al., 2016) on ImageNet. Marker area is proportional to model size determined by depth. “basic”(“bottleneck”) refers to ResNets with basic (bottleneck) residual blocks.
159
+
160
+ # 4 RELATED WORK
161
+
162
+ Neural Architecture Search (NAS) (Zoph & Le, 2016) and neural evolution (Miikkulainen et al., 2019; Angeline et al., 1994; Stanley & Miikkulainen, 2002; Liu et al., 2017a; Real et al., 2017) can search network architectures from a gigantic search space. In NAS, the depth of DNNs in the search space is fixed, while AutoGrow learns the depth. Some NAS methods (Bender et al., 2018; Liu et al., 2018b; Cortes et al., 2017) can find DNNs with different depths, however, the maximum depth is pre-defined and shallower nets are obtained by padding zero operations or selecting shallower branches, while our AutoGrow learns the depth in an open domain to find a minimum depth, beyond which no accuracy improvement can be obtained. Moreover, NAS is very computation and memory intensive. To accelerate NAS, one-shot models (Saxena & Verbeek, 2016; Pham et al., 2018; Bender et al., 2018), DARTS (Liu et al., 2018b) and NAS with Transferable Cell (Zoph et al., 2018; Liu et al., 2018a) were proposed. The search time reduces dramatically but is still long from practical perspective. It is still very challenging to deploy these methods to larger datasets such as ImageNet. In contrast, our AutoGrow can scale up to ImageNet thanks to its short depth learning time, which is as efficient as training a single DNN.
163
+
164
+ In addition to architecture search which requires to train lots of DNNs from scratch, there are also many studies on learning neural structures within a single training. Structure pruning and growing were proposed for different goals, such as efficient inference (Wen et al., 2016; Li et al., 2016; Lebedev & Lempitsky, 2016; He et al., 2017; Luo et al., 2017; Liu et al., 2017b; Dai et al., 2017; Huang et al., 2018; Gordon et al., 2018; Du et al., 2019), lifelong learning (Yoon et al., 2017) and model adaptation (Feng & Darrell, 2015; Philipp & Carbonell, 2017). However, those works fixed the network depth and limited structure learning within the existing layers. Optimization over a DNN with fixed depth is easier as the skeleton architecture is known. AutoGrow performs in a scenario where the DNN depth is unknown hence we need to seek for the optimal depth.
165
+
166
+ # REFERENCES
167
+
168
+ Peter J Angeline, Gregory M Saunders, and Jordan B Pollack. An evolutionary algorithm that constructs recurrent neural networks. IEEE transactions on Neural Networks, 5(1):54–65, 1994.
169
+
170
+ Gabriel Bender, Pieter-Jan Kindermans, Barret Zoph, Vijay Vasudevan, and Quoc Le. Understanding and simplifying one-shot architecture search. In International Conference on Machine Learning, pp. 549–558, 2018.
171
+
172
+ Han Cai, Tianyao Chen, Weinan Zhang, Yong Yu, and Jun Wang. Efficient architecture search by network transformation. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018a.
173
+
174
+ Han Cai, Jiacheng Yang, Weinan Zhang, Song Han, and Yong Yu. Path-level network transformation for efficient architecture search. arXiv preprint arXiv:1806.02639, 2018b.
175
+
176
+ Tianqi Chen, Ian Goodfellow, and Jonathon Shlens. Net2net: Accelerating learning via knowledge transfer. arXiv preprint arXiv:1511.05641, 2015.
177
+
178
+ Corinna Cortes, Xavier Gonzalvo, Vitaly Kuznetsov, Mehryar Mohri, and Scott Yang. Adanet: Adaptive structural learning of artificial neural networks. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 874–883. JMLR. org, 2017.
179
+
180
+ Xiaoliang Dai, Hongxu Yin, and Niraj K Jha. Nest: A neural network synthesis tool based on a grow-and-prune paradigm. arXiv preprint arXiv:1711.02017, 2017.
181
+
182
+ Xiaocong Du, Zheng Li, and Yu Cao. Cgap: Continuous growth and pruning for efficient deep learning. arXiv preprint arXiv:1905.11533, 2019.
183
+
184
+ Thomas Elsken, Jan-Hendrik Metzen, and Frank Hutter. Simple and efficient architecture search for cnns. In Workshop on Meta-Learning (MetaLearn 2017) at NIPS, 2017.
185
+
186
+ Jiashi Feng and Trevor Darrell. Learning the structure of deep convolutional networks. In Proceedings of the IEEE international conference on computer vision, pp. 2749–2757, 2015.
187
+
188
+ Ariel Gordon, Elad Eban, Ofir Nachum, Bo Chen, Hao Wu, Tien-Ju Yang, and Edward Choi. Morphnet: Fast & simple resource-constrained structure learning of deep networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1586–1595, 2018.
189
+
190
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016.
191
+
192
+ Yihui He, Xiangyu Zhang, and Jian Sun. Channel pruning for accelerating very deep neural networks. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1389–1397, 2017.
193
+
194
+ Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 4700–4708, 2017.
195
+
196
+ Gao Huang, Shichen Liu, Laurens Van der Maaten, and Kilian Q Weinberger. Condensenet: An efficient densenet using learned group convolutions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2752–2761, 2018.
197
+
198
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
199
+
200
+ Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pp. 1097–1105, 2012.
201
+
202
+ Vadim Lebedev and Victor Lempitsky. Fast convnets using group-wise brain damage. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2554–2564, 2016.
203
+
204
+ Hao Li, Asim Kadav, Igor Durdanovic, Hanan Samet, and Hans Peter Graf. Pruning filters for efficient convnets. arXiv preprint arXiv:1608.08710, 2016.
205
+
206
+ Hao Li, Zheng Xu, Gavin Taylor, Christoph Studer, and Tom Goldstein. Visualizing the loss landscape of neural nets. In Advances in Neural Information Processing Systems, pp. 6391–6401, 2018.
207
+
208
+ Chenxi Liu, Barret Zoph, Maxim Neumann, Jonathon Shlens, Wei Hua, Li-Jia Li, Li Fei-Fei, Alan Yuille, Jonathan Huang, and Kevin Murphy. Progressive neural architecture search. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 19–34, 2018a.
209
+
210
+ Hanxiao Liu, Karen Simonyan, Oriol Vinyals, Chrisantha Fernando, and Koray Kavukcuoglu. Hierarchical representations for efficient architecture search. arXiv preprint arXiv:1711.00436, 2017a.
211
+
212
+ Hanxiao Liu, Karen Simonyan, and Yiming Yang. Darts: Differentiable architecture search. arXiv preprint arXiv:1806.09055, 2018b.
213
+
214
+ Zhuang Liu, Jianguo Li, Zhiqiang Shen, Gao Huang, Shoumeng Yan, and Changshui Zhang. Learning efficient convolutional networks through network slimming. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2736–2744, 2017b.
215
+
216
+ Jian-Hao Luo, Jianxin Wu, and Weiyao Lin. Thinet: A filter level pruning method for deep neural network compression. In Proceedings of the IEEE international conference on computer vision, pp. 5058–5066, 2017.
217
+
218
+ Risto Miikkulainen, Jason Liang, Elliot Meyerson, Aditya Rawal, Daniel Fink, Olivier Francon, Bala Raju, Hormoz Shahrzad, Arshak Navruzyan, Nigel Duffy, et al. Evolving deep neural networks. In Artificial Intelligence in the Age of Neural Networks and Brain Computing, pp. 293–312. Elsevier, 2019.
219
+
220
+ Hieu Pham, Melody Y Guan, Barret Zoph, Quoc V Le, and Jeff Dean. Efficient neural architecture search via parameter sharing. arXiv preprint arXiv:1802.03268, 2018.
221
+
222
+ George Philipp and Jaime G Carbonell. Nonparametric neural networks. arXiv preprint arXiv:1712.05440, 2017.
223
+
224
+ Esteban Real, Sherry Moore, Andrew Selle, Saurabh Saxena, Yutaka Leon Suematsu, Jie Tan, Quoc V Le, and Alexey Kurakin. Large-scale evolution of image classifiers. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 2902–2911. JMLR. org, 2017.
225
+
226
+ Shreyas Saxena and Jakob Verbeek. Convolutional neural fabrics. In Advances in Neural Information Processing Systems, pp. 4053–4061, 2016.
227
+
228
+ Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
229
+
230
+ Leslie N Smith, Emily M Hand, and Timothy Doster. Gradual dropin of layers to train very deep neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4763–4771, 2016.
231
+
232
+ Kenneth O Stanley and Risto Miikkulainen. Evolving neural networks through augmenting topologies. Evolutionary computation, 10(2):99–127, 2002.
233
+
234
+ Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1–9, 2015.
235
+
236
+ Guangcong Wang, Xiaohua Xie, Jianhuang Lai, and Jiaxuan Zhuo. Deep growing learning. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2812–2820, 2017.
237
+
238
+ Tao Wei, Changhu Wang, Yong Rui, and Chang Wen Chen. Network morphism. In International Conference on Machine Learning, pp. 564–572, 2016.
239
+
240
+ Tao Wei, Changhu Wang, and Chang Wen Chen. Modularized morphing of neural networks. arXiv preprint arXiv:1701.03281, 2017.
241
+
242
+ Wei Wen, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Learning structured sparsity in deep neural networks. In Advances in neural information processing systems, pp. 2074–2082, 2016.
243
+
244
+ Jaehong Yoon, Eunho Yang, Jeongtae Lee, and Sung Ju Hwang. Lifelong learning with dynamically expandable networks. arXiv preprint arXiv:1708.01547, 2017.
245
+
246
+ Barret Zoph and Quoc V Le. Neural architecture search with reinforcement learning. arXiv preprint arXiv:1611.01578, 2016.
247
+
248
+ Barret Zoph, Vijay Vasudevan, Jonathon Shlens, and Quoc V Le. Learning transferable architectures for scalable image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 8697–8710, 2018.
249
+
250
+ # A APPENDIX
251
+
252
+ # A.0.1 OPTIMIZATION TRAJECTORIES OF NETWORK MORPHISM
253
+
254
+ We hypothesize that a converged shallower net may not be an adequate initialization. Figure 5 visualizes and compares the optimization trajectories of Network Morphism and the training from scratch. In this figure, the shallower net is $\mathtt { B a s i c 3 R e s N e t - 3 - 3 - 3 }$ (ResNet-20) and the deeper one is $\mathtt { B a s i c 3 R e s N e t - 5 - 5 - 5 }$ (ResNet-32) in Table 2. The initializer is ZeroInit. The visualization method is extended from Li et al. (2018). Points on the trajectory are evenly sampled every a few epochs. To maximize the variance of trajectory, we use PCA to project from a high dimensional space to a 2D space and use the first two Principle Components (PC) to form the axes in Figure 5. The contours of training loss function and the trajectory are visualized around the final minimum of the deeper net. When projecting a shallower net to a deeper net space, zeros are padded for the parameters not existing in the deeper net. We must note that the loss increase along the trajectory does not truly represent the situation in high dimensional space, as the trajectory is just a projection. It is possible that the loss remains decreasing in the high dimension while it appears in an opposite way in the 2D space. The sharp detour at “Morphing” in Figure 5(a) may indicate that the shallower net plausibly converges to a point that the deeper net struggles to escape. In contrast, Figure 5(b) shows that the trajectory of the direct optimization in the deeper space smoothly converges to a better minimum.
255
+
256
+ Figure 6(a) visualizes the trajectory of $c$ -AutoGrow corresponding to row $^ { 6 6 } 2 - 3 - 6 ^ { 3 3 }$ in Table 3. Along the trajectory, there are many trials to detour and escape an initialization from a shallower net. Figure 6(b) visualizes the trajectory corresponding to row $^ { 6 6 } 2 - 4 - 3 ^ { 5 }$ in Table 3, which is much smoother compared to Figure 6(a). Figure 6(c)(d) visualize the trajectories of $p$ -AutoGrow with $K = 5 0$ and 3. The 2D projection gives limited information to reveal the advantages of $p$ -AutoGrow comparing to $c$ -AutoGrow in Figure 6(b), although the trajectory of our final $p$ -AutoGrow in Figure 6(d) is plausibly more similar to the one of training from scratch in Figure 5(b).
257
+
258
+ ![](images/7ec45dcda0e4eec27bfa06e165883796dfd3195ad9dd58aa345219a511289cad.jpg)
259
+ Figure 5: An optimization trajectory comparison between (a) Network Morphism and (b) training from scratch.
260
+
261
+ ![](images/202e978119acb59297fd26c27e8b39d29c725967d74a077abfd3cc74d2f35679.jpg)
262
+ Figure 6: Optimization trajectory of AutoGrow, tested by Basic3ResNet on CIFAR10. (a) $c$ -AutoGrow with staircase learning rate and ZeroInit during growing; (b) $c$ -AutoGrow with constant learning rate and GauInit during growing; (c) $p$ -AutoGrow with $K = 5 0$ ; and (d) $p$ - AutoGrow with $K = 3$ . For better illustration, the dots on the trajectory are plotted every 4, 20, 5 and 3 epochs in (a-d), respectively.
263
+
264
+ ![](images/5bb68bf43dfb0e6d077a75dac2d1c40a1628ddbdaa60cb6364875f9789fd1ae1.jpg)
265
+ Figure 7: Loss surfaces around minima found by baselines and AutoGrow. Dataset is CIFAR10.
266
+
267
+ # A.0.2 VISUALIZATION OF LOSS SURFACES AROUND MINIMA
268
+
269
+ Figure 7 visualizes loss surfaces around minima by AutoGrow and baseline. Intuitively, AutoGrow finds wider or deeper minima with less chaotic landscapes.
270
+
271
+ # A.0.3 MORE EXPERIMENTAL RESULTS
272
+
273
+ Figure 8 plots the growing and converging curves for two DNNs in Table 10.
274
+
275
+ Table 11 summarizes the adaptability of AutoGrow to the sizes of dataset. In each set of experiments, dataset is randomly down-sampled to $1 0 0 \%$ , $7 5 \%$ , $5 0 \%$ and $2 5 \%$ . For a fair comparison, $K$ is divided by the percentage of dataset such that the number of mini-batches between growths remains
276
+
277
+ Table 8: $p$ -AutoGrow under initializers with $K = 3$
278
+
279
+ <table><tr><td colspan="2">CIFAR10</td><td rowspan="2">accu</td></tr><tr><td>initializer</td><td>found nett</td></tr><tr><td>ZeroInit</td><td>31-30-30</td><td>93.57</td></tr><tr><td>AdamInit</td><td>37-37-36</td><td>93.79</td></tr><tr><td>UniInit</td><td>28-28-28</td><td>93.82</td></tr><tr><td>GauInit</td><td>42-42-42</td><td>94.27</td></tr></table>
280
+
281
+ † Basic3ResNet
282
+
283
+ <table><tr><td colspan="3">CIFAR100</td></tr><tr><td>initializer</td><td>found nett</td><td>accu</td></tr><tr><td>ZeroInit</td><td>26-25-25</td><td>73.45</td></tr><tr><td>AdamInit</td><td>27-27-27</td><td>73.92</td></tr><tr><td>UniInit</td><td>41-41-41</td><td>74.31</td></tr><tr><td>GauInit</td><td>54-53-53</td><td>74.72</td></tr></table>
284
+
285
+ † Basic3ResNet
286
+
287
+ Table 9: AutoGrow improves accuracy of plain nets.
288
+
289
+ <table><tr><td colspan="2">dataset</td><td>net layer #</td><td>method</td><td> accu %</td></tr><tr><td rowspan="3">CIFAR10</td><td>Plain4Net-6-6-6-6</td><td>26</td><td>baseline</td><td>93.90</td></tr><tr><td>Plain4Net-6-6-6-6</td><td>26</td><td>AutoGrow K=30</td><td>95.17</td></tr><tr><td>Basic4ResNet-3-3-3-3</td><td>26</td><td>baseline</td><td>95.33</td></tr><tr><td rowspan="3">CIFAR10</td><td>Plain3Net-11-11-10</td><td>34</td><td>baseline</td><td>90.45</td></tr><tr><td>Plain3Net-11-11-10</td><td>34</td><td>AutoGrow K=50</td><td>93.13</td></tr><tr><td>Basic3ResNet-6-6-5</td><td>36</td><td>baseline</td><td>93.60</td></tr></table>
290
+
291
+ Table 10: The efficiency of AutoGrow
292
+
293
+ <table><tr><td>net</td><td>GPUs</td><td>growing</td><td>fine-tuning</td></tr><tr><td>Basic4ResNet-12-12-11-11</td><td>4 GTX 1080 Ti</td><td>56.7 hours</td><td>157.9 hours</td></tr><tr><td>Basic4ResNet-9-3-6-4</td><td>4 GTX1080</td><td>47.9 hours</td><td>65.8 hours</td></tr><tr><td>Bottleneck4ResNet-6-6-6-17</td><td>4 TITAN V</td><td>45.3 hours</td><td>114.0 hours</td></tr><tr><td>Bottleneck4ResNet-6-7-3-9</td><td>4 TITAN V</td><td>61.6 hours</td><td>78.6 hours</td></tr><tr><td>Plain4Net-6-6-6-6</td><td>4 GTX 1080 Ti</td><td>11.7 hours</td><td>29.7 hours</td></tr><tr><td>Plain4Net-5-5-5-4</td><td>4 GTX 1080 Ti</td><td>25.6 hours</td><td>25.3 hours</td></tr></table>
294
+
295
+ ![](images/dcc4991c910983ddaab0d84913d1e1d63d3049b45ccade319b8e6be7bdb7f183.jpg)
296
+
297
+ ![](images/ff8de4cc3b0f11d571a7eff70a0eaf2908e5f3266d7d32a7c51b6d9bcc87ec95.jpg)
298
+
299
+ Table 11: The adaptability of AutoGrow to dataset sizes
300
+
301
+ <table><tr><td colspan="2">Basic3ResNet on CIFAR10</td></tr><tr><td>dataset size</td><td>found net accu %</td></tr><tr><td>100%</td><td>42-42-42 94.27</td></tr><tr><td>75%</td><td>32-31-31 93.54</td></tr><tr><td>50%</td><td>17-17-17 91.34</td></tr><tr><td>25%</td><td>21-12-7 88.18</td></tr><tr><td>Basic4ResNet on CIFAR100</td><td></td></tr><tr><td>dataset size found net</td><td> accu %</td></tr><tr><td>100%</td><td>17-51-16-16 79.47</td></tr><tr><td>75% 17-17-16-16</td><td>77.26</td></tr><tr><td>50% 12-12-12-11</td><td>72.91</td></tr><tr><td>25%</td><td>6-6-6-6 62.53</td></tr></table>
302
+
303
+ Figure 8: The convergence curves and growing process on ImageNet for (a) Basic4ResNet-9-3-6-4 and (b) Plain4Net-6-6-6-6 in Table 10.
304
+
305
+ <table><tr><td colspan="2">Plain3Net on MNIST</td></tr><tr><td>dataset size</td><td>found net accu %</td></tr><tr><td>100%</td><td>20-20-20 99.66</td></tr><tr><td>75%</td><td>12-12-12 99.54</td></tr><tr><td>50%</td><td>12-11-11 99.46</td></tr><tr><td>25%</td><td>10-9-9 99.33</td></tr><tr><td colspan="2">Plain4Net on SVHN</td></tr><tr><td>dataset size</td><td>found net accu %</td></tr><tr><td>100%</td><td>12-12-12-11 97.08</td></tr><tr><td>75%</td><td>9-9-9-9 96.71</td></tr><tr><td>50% 8-8-8-8</td><td>96.37 95.68</td></tr><tr><td>25%</td><td>5-5-5-5</td></tr></table>
306
+
307
+ the same. As expected, our experiments show that AutoGrow adapts to shallower networks when the sizes are smaller.
md/train/SJa9iHgAZ/SJa9iHgAZ.md ADDED
@@ -0,0 +1,274 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # RESIDUAL CONNECTIONS ENCOURAGE ITERATIVE INFERENCE
2
+
3
+ Stanisław Jastrz˛ebsk $^ { 1 , 2 , * }$ , Devansh Arpit $^ { 2 , * }$ , Nicolas Ballas3, Vikas Verma5, Tong Che2 & Yoshua Bengio2,6
4
+
5
+ 1 Jagiellonian University, Cracow, Poland
6
+ 2 MILA, Université de Montréal, Canada
7
+ 3 Facebook, Montreal, Canada
8
+ 4 University of Bonn, Bonn, Germany
9
+ 5 Aalto University, Finland
10
+ 6 CIFAR Senior Fellow
11
+ ∗ Equal Contribution
12
+
13
+ # ABSTRACT
14
+
15
+ Residual networks (Resnets) have become a prominent architecture in deep learning. However, a comprehensive understanding of Resnets is still a topic of ongoing research. A recent view argues that Resnets perform iterative refinement of features. We attempt to further expose properties of this aspect. To this end, we study Resnets both analytically and empirically. We formalize the notion of iterative refinement in Resnets by showing that residual connections naturally encourage features of residual blocks to move along the negative gradient of loss as we go from one block to the next. In addition, our empirical analysis suggests that Resnets are able to perform both representation learning and iterative refinement. In general, a Resnet block tends to concentrate representation learning behavior in the first few layers while higher layers perform iterative refinement of features. Finally we observe that sharing residual layers naively leads to representation explosion and counterintuitively, overfitting, and we show that simple existing strategies can help alleviating this problem.
16
+
17
+ # 1 INTRODUCTION
18
+
19
+ Traditionally, deep neural network architectures (e.g. VGG Simonyan & Zisserman (2014), AlexNet Krizhevsky et al. (2012), etc.) have been compositional in nature, meaning a hidden layer applies an affine transformation followed by non-linearity, with a different transformation at each layer. However, a major problem with deep architectures has been that of vanishing and exploding gradients. To address this problem, solutions like better activations (ReLU Nair & Hinton (2010)), weight initialization methods Glorot & Bengio (2010); He et al. (2015) and normalization methods Ioffe & Szegedy (2015); Arpit et al. (2016) have been proposed. Nonetheless, training compositional networks deeper than $1 5 - 2 0$ layers remains a challenging task.
20
+
21
+ Recently, residual networks (Resnets He et al. (2016a)) were introduced to tackle these issues and are considered a breakthrough in deep learning because of their ability to learn very deep networks and achieve state-of-the-art performance. Besides this, performance of Resnets are generally found to remain largely unaffected by removing individual residual blocks or shuffling adjacent blocks Veit et al. (2016). These attributes of Resnets stem from the fact that residual blocks transform representations additively instead of compositionally (like traditional deep networks). This additive framework along with the aforementioned attributes has given rise to two school of thoughts about Resnets– the ensemble view where they are thought to learn an exponential ensemble of shallower models Veit et al. (2016), and the unrolled iterative estimation view Liao & Poggio (2016); Greff et al. (2016), where Resnet layers are thought to iteratively refine representations instead of learning new ones. While the success of Resnets may be attributed partly to both these views, our work takes steps towards achieving a deeper understanding of Resnets in terms of its iterative feature refinement perspective. Our contributions are as follows:
22
+
23
+ 1. We study Resnets analytically and provide a formal view of iterative feature refinement using Taylor’s expansion, showing that for any loss function, a residual block naturally encourages representations to move along the negative gradient of the loss with respect to hidden representations. Each residual block is therefore encouraged to take a gradient step in order to minimize the loss in the hidden representation space. We empirically confirm this by measuring the cosine between the output of a residual block and the gradient of loss with respect to the hidden representations prior to the application of the residual block.
24
+
25
+ 2. We empirically observe that Resnet blocks can perform both hierarchical representation learning (where each block discovers a different representation) and iterative feature refinement (where each block improves slightly but keeps the semantics of the representation of the previous layer). Specifically in Resnets, lower residual blocks learn to perform representation learning, meaning that they change representations significantly and removing these blocks can sometimes drastically hurt prediction performance. The higher blocks on the other hand essentially learn to perform iterative inference– minimizing the loss function by moving the hidden representation along the negative gradient direction. In the presence of shortcut connections1, representation learning is dominantly performed by the shortcut connection layer and most of residual blocks tend to perform iterative feature refinement.
26
+
27
+ 3. The iterative refinement view suggests that deep networks can potentially leverage intensive parameter sharing for the layer performing iterative inference. But sharing large number of residual blocks without loss of performance has not been successfully achieved yet. Towards this end we study two ways of reusing residual blocks: 1. Sharing residual blocks during training; 2. Unrolling a residual block for more steps that it was trained to unroll. We find that training Resnet with naively shared blocks leads to bad performance. We expose reasons for this failure and investigate a preliminary fix for this problem.
28
+
29
+ # 2 BACKGROUND AND RELATED WORK
30
+
31
+ # Residual Networks and their analysis:
32
+
33
+ Recently, several papers have investigated the behavior of Resnets (He et al., 2016a). In (Veit et al., 2016; Littwin & Wolf, 2016), authors argue that Resnets are an ensemble of relatively shallow networks. This is based on the unraveled view of Resnets where there exist an exponential number of paths between the input and prediction layer. Further, observations that shuffling and dropping of residual blocks do not affect performance significantly also support this claim. Other works discuss the possibility that residual networks are approximating recurrent networks (Liao & Poggio, 2016; Greff et al., 2016). This view is in part supported by the observation that the mathematical formulation of Resnets bares similarity to LSTM (Hochreiter & Schmidhuber, 1997), and that successive layers cooperate and preserve the feature identity. Resnets have also been studied from the perspective of boosting theory Huang et al. (2017). In this work the authors propose to learn Resnets in a layerwise manner using a local classifier.
34
+
35
+ Our work has critical differences compared with the aforementioned studies. Most importantly we focus on a precise definition of iterative inference. In particular, we show that a residual block approximate a gradient descent step in the activation space. Our work can also be seen as relating the gap between the boosting and iterative inference interpretations since having a residual block whose output is aligned with negative gradient of loss is similar to how gradient boosting models work.
36
+
37
+ # Iterative refinement and weight sharing:
38
+
39
+ Humans frequently perform predictions with iterative refinement based on the level of difficulty of the task at hand. A leading hypothesis regarding the nature of information processing that happens in the visual cortex is that it performs fast feedforward inference (Thorpe et al., 1996) for easy stimuli or when quick response time is needed, and performs iterative refinement of prediction for complex stimuli (Vanmarcke et al., 2016). The latter is thought to be done by lateral connections within individual layers in the brain that iteratively act upon the current state of the layer to update it. This mechanism allows the brain to make fine grained predictions on complex tasks. A characteristic attribute of this mechanism is the recursive application of the lateral connections which can be thought of as shared weights in a recurrent model. The above views suggest that it is desirable to have deep network models that perform parameter sharing in order to make the iterative inference view complete.
40
+
41
+ # 3 ITERATIVE INFERENCE IN RESNETS
42
+
43
+ Our goal in this section is to formalize the notion of iterative inference in Resnets. We study the properties of representations that residual blocks tend to learn, as a result of being additive in nature, in contrast to traditional compositional networks. Specifically, we consider Resnet architectures (see figure 1) where the first hidden layer is a convolution layer, which is followed by $L$ residual blocks which may or may not have shortcut connections in between residual blocks.
44
+
45
+ A residual block applied on a representation $\mathbf { h } _ { i }$ transforms the representation as,
46
+
47
+ $$
48
+ \mathbf { h } _ { i + 1 } = \mathbf { h } _ { i } + F _ { i } ( \mathbf { h } _ { i } )
49
+ $$
50
+
51
+ Consider $L$ such residual blocks stacked on top of each other followed by a loss function. Then, we can Taylor expand any given loss function $\mathcal { L }$ recursively as,
52
+
53
+ $$
54
+ \begin{array} { r l } & { \mathcal { L } ( \mathbf { h } _ { L } ) = \mathcal { L } ( \mathbf { h } _ { L - 1 } + F _ { L - 1 } ( \mathbf { h } _ { L - 1 } ) ) } \\ & { \qquad = \mathcal { L } ( \mathbf { h } _ { L - 1 } ) + F _ { L - 1 } ( \mathbf { h } _ { L - 1 } ) . \frac { \partial \mathcal { L } ( \mathbf { h } _ { L - 1 } ) } { \partial \mathbf { h } _ { L - 1 } } } \\ & { \qquad + \mathcal { O } ( F _ { L - 1 } ^ { 2 } ( \mathbf { h } _ { L - 1 } ) ) } \end{array}
55
+ $$
56
+
57
+ ![](images/30c059da734b3d2c02faa59a50374494f97750a57f83d86bbe0194d629b12f90.jpg)
58
+ Figure 1: A typical residual network architecture.
59
+
60
+ Here we have Taylor expanded the loss function around $\mathbf { h } _ { L - 1 }$ . We can similarly expand the loss function recursively around $\mathbf { h } _ { L - 2 }$ and so on until $\mathbf { h } _ { i }$ and get,
61
+
62
+ $$
63
+ \mathcal { L } ( \mathbf { h } _ { L } ) = \mathcal { L } ( \mathbf { h } _ { i } ) + \sum _ { j = i } ^ { L - 1 } F _ { j } ( \mathbf { h } _ { j } ) . \frac { \partial \mathcal { L } ( \mathbf { h } _ { j } ) } { \partial \mathbf { h } _ { j } } + \mathcal { O } ( F _ { j } ^ { 2 } ( \mathbf { h } _ { j } ) )
64
+ $$
65
+
66
+ Notice we have explicitly only written the first order terms of each expansion. The rest of the terms are absorbed in the higher order terms $\mathcal { O } ( . )$ . Further, the first order term is a good approximation when the magnitude of $F _ { j }$ is small enough. In other cases, the higher order terms come into effect as well.
67
+
68
+ Thus in part, the loss equivalently minimizes the dot product between $F ( \mathbf { h } _ { i } )$ and $\frac { \partial \mathcal { L } ( \mathbf { h } _ { i } ) } { \partial \mathbf { h } _ { i } }$ , which can be achieved by making $F ( \mathbf { h } _ { i } )$ point in the opposite half space to that of $\frac { \partial \mathcal { L } ( \mathbf { h } _ { i } ) } { \partial \mathbf { h } _ { i } }$ . In other words, $\mathbf { h } _ { i } + F ( \mathbf { h } _ { i } )$ approximately moves $\mathbf { h } _ { i }$ in the same half space as that of − ∂L(hi) . The overall training criteria can then be seen as approximately minimizing the dot product between these 2 terms along a path in the $\mathbf { h }$ space between $\mathbf { h } _ { i }$ and $\mathbf { h } _ { L }$ such that loss gradually reduces as we take steps from $\mathbf { h } _ { i }$ to $\mathbf { h } _ { L }$ . The above analysis is justified in practice, as Resnets’ top layers output $F _ { j }$ has small magnitude (Greff et al., 2016), which we also report in Fig. 2.
69
+
70
+ Given our analysis we formalize iterative inference in Resnets as moving down the energy (loss) surface. It is also worth noting the resemblance of the function of a residual block to stochastic gradient descent. We make a more formal argument in the appendix.
71
+
72
+ # 4 EMPIRICAL ANALYSIS
73
+
74
+ Experiments are performed on CIFAR-10 (Krizhevsky & Hinton, 2009) and CIFAR-100 (see appendix) using the original Resnet architecture He et al. (2016b) and two other architectures that we introduce for the purpose of our analysis (described below). Our main goal is to validate that residual networks perform iterative refinement as discussed above, showing its various consequences. Specifically, we set out to empirically answer the following questions:
75
+
76
+ ![](images/71e298d1b076e4b12047251edf34dc58e2a1c373f3e912f67fd5b14882e5001a.jpg)
77
+ Figure 2: Average ratio of $\ell ^ { 2 }$ norm of output of residual block to the norm of the input of residual block for (left to right) original Resnet, single representation Resnet, avg-pooling Resnet, and wideResnet on CIFAR-10. (Train and validation curves are overlapping.)
78
+
79
+ ![](images/87b38cb14e7916bd262b494e479290beb8391b11457aece9f86c7741977ef81e.jpg)
80
+ Figure 3: Final prediction accuracy when individual residual blocks are dropped for (left to right) original Resnet, single representation Resnet, avg-pooling Resnet, and wideResnet on CIFAR-10.
81
+
82
+ ![](images/0ec713edda21a6d1f7e5a31027d4d2dfd72b09deebe8676ef252a106245389c0.jpg)
83
+ Figure 4: Average cos loss between residual block $F ( \mathbf { h } _ { i } )$ and $\frac { \partial \mathcal { L } ( \mathbf { h } _ { i } ) } { \partial \mathbf { h } _ { i } }$ for (left to right) original Resnet, single representation Resnet, avg-pooling Resnet, and wideResnet on CIFAR-10.
84
+
85
+ ![](images/c0c51db0ffe5a1c77726680f0afd4cddf8fa251638820c2aa980f194b59cbedc.jpg)
86
+ Figure 5: Prediction accuracy when plugging classifier after hidden states in the last stage of Resnets(if any) during training for (left to right) original Resnet, single representation Resnet, avgpooling Resnet, and wideResnet on CIFAR-10. (Blue to red spectrum denotes lower to higher residual blocks)
87
+
88
+ • Do residual blocks in Resnets behave similarly to each other or is there a distinction between blocks that perform iterative refinement vs. representation learning?
89
+ • Is the cosine between $\frac { \partial \mathcal { L } ( \mathbf { h } _ { i } ) } { \partial \mathbf { h } _ { i } }$ and $F _ { i } ( \mathbf { h } _ { i } )$ negative in residual networks?
90
+ • What kind of samples do residual blocks target?
91
+ • What happens when layers are shared in Resnets?
92
+
93
+ Resnet architectures: We use the following four architectures for our analysis:
94
+
95
+ 1. Original Resnet-110 architecture: This is the same architecture as used in He et al. (2016b) starting with a $3 \times 3$ convolution layer with 16 filters followed by 54 residual blocks in three different stages (of 18 blocks each with 16, 32 and 64 filters respectively) each separated by a shortcut connections ( ${ \bf \Phi } _ { 1 } \times { \bf \Phi } _ { 1 }$ convolution layers that allow change in the hidden space dimensionality) inserted after the $1 8 ^ { t h }$ and $3 6 ^ { t h }$ residual blocks such that the 3 stages have hidden space of height-width $3 2 \times 3 2$ , $1 6 \times 1 6$ and $8 \times 8$ . The model has a total of 1, 742, 762 parameters.
96
+
97
+ 2. Single representation Resnet: This architecture starts with a $3 \times 3$ convolution layer with 100 filters. This is followed by 10 residual blocks such that all hidden representations have the same height and width of $3 2 \times 3 2$ and 100 filters are used in all the convolution layers in residual blocks as well.
98
+
99
+ 3. Avg-pooling Resnet: This architecture repeats the residual blocks of the single representation Resnet (described above) three times such that there is a $2 \times 2$ average pooling layer after each set of 10 residual blocks that reduces the height and width after each stage by half. Also, in contrast to single representation architecture, it uses 150 filters in all convolution layers. This is followed by the classification block as in the single representation Resnet. It has 12, 201, 310 parameters. We call this architecture the avg-pooling architecture. We also ran experiments with max pooling instead of average pooling but do not report results because they were similar except that max pool acts more non-linearly compared with average pooling, and hence the metrics from max pooling are more similar to those from original Resnet.
100
+
101
+ 4. Wide Resnet: This architecture starts with a $3 \times 3$ convolution layer followed by 3 stages of four residual blocks with 160, 320 and 640 number of filters respectively, and $3 \times 3$ kernel size in all convolution layers. This model has a total of 45,732,842 parameters.
102
+
103
+ Experimental details: For all architectures, we use He-normal weight initialization as suggested in He et al. (2015), and biases are initialized to 0. For residual blocks, we use BatchNorm ReLU Conv BatchNorm ReLU Conv as suggested in He et al. (2016b). The classifier is composed of the following elements: BatchNorm ReLU AveragePool(8,8) Flatten Fully-Connected-Layer(#classes) Softmax. This model has 1, 829, 210 parameters. For all experiments for single representation and pooling Resnet architectures, we use SGD with momentum 0.9 and train for 200 epochs and 100 epochs (respectively) with learning rate 0.1 until epoch 40, 0.02 until 60, 0.004 until 80 and 0.0008 afterwards. For the original Resnet we use SGD with momentum 0.9 and train for 300 epochs with learning rate 0.1 until epoch 80, 0.01 until 120, 0.001 until 200, 0.00001 until 240 and 0.000011 afterwards. We use data augmentation (horizontal flipping and translation) during training of all architectures. For the wide Resnet architecture, we train the model with with learning rate 0.1 until epoch 60 and 0.02 until 100 epochs.
104
+
105
+ Note: All experiments on CIFAR-100 are reported in the appendix. In addition, we also record the metrics reported in sections 4.1 and 4.2 as a function of epochs (shown in the appendix due to space limitations). The conclusions are similar to what is reported below.
106
+
107
+ # 4.1 COSINE LOSS OF RESIDUAL BLOCKS
108
+
109
+ In this experiment we directly validate our theoretical prediction about Resnets minimizing the dot product between gradient of loss and block output. To this end compute the cosine loss $\bar { \Gamma _ { i } } ( \mathbf { h } _ { i } ) . \frac { \partial \mathcal { L } ( \mathbf { h } _ { i } ) } { \partial \mathbf { h } _ { i } }$
110
+ A negative cosine loss and small $F _ { i } ( . )$ together suggest that $F _ { i } ( . )$ is refining $\begin{array} { r } { \overline { { { \| { \cal F } _ { i } ( { \bf h } _ { i } ) \| _ { 2 } } \| \frac { \partial { \mathcal { L } } ( { \bf h } _ { i } ) } { \partial { \bf h } _ { i } } \| _ { 2 } } } } \end{array}$
111
+ features by moving them in the half space of $- \frac { \partial \mathcal { L } ( \mathbf { h } _ { i } ) } { \partial \mathbf { h } _ { i } }$ , thus reducing the loss value for the corresponding data samples. Figure 4 shows the cosine loss for CIFAR-10 on train and validation sets. These figures show that cosine loss is consistently negative for all residual blocks but especially for the higher residual blocks. Also, notice for deeper architectures (original Resnet and pooling Resnet), the higher blocks achieve more negative cosine loss and are thus more iterative in nature. Further, since the higher residual blocks make smaller changes to representation (figure 2), the first order Taylor’s term becomes dominant and hence these blocks effectively move samples in the half space of the negative cosine loss thus reducing loss value of prediction. This result formalizes the sense in which residual blocks perform iterative refinement of features– move representations in the half space of $- \frac { \partial \mathcal { L } ( \mathbf { h } _ { i } ) } { \partial \mathbf { h } _ { i } }$ .
112
+
113
+ # 4.2 REPRESENTATION LEARNING VS. FEATURE REFINEMENT
114
+
115
+ In this section, we are interested in investigating the behavior of residual layers in terms of representation learning vs. refinement of features. To this end, we perform the following experiments.
116
+
117
+ 1. $\ell ^ { 2 }$ ratio $\| F _ { i } ( \mathbf { h } _ { i } ) \| _ { 2 } / \| \mathbf { h } _ { i } \| _ { 2 }$ : A residual block $F _ { i } ( . )$ transforms representation as $\mathbf { h } _ { i + 1 } \mathbf { \Psi } = \mathbf { h } _ { i } \mathbf { \Psi } +$ $F _ { i } ( \mathbf { h } _ { i } )$ . For every such block in a Resnet, we measure the $\ell ^ { 2 }$ ratio of $\| F _ { i } ( \mathbf h _ { i } ) \| _ { 2 } / \| \mathbf h _ { i } \| _ { 2 }$ averaged across samples. This ratio directly shows how significantly $F _ { i } ( . )$ changes the representation $\mathbf { h } _ { i }$ ; a large change can be argued to be a necessary condition for layer to perform representation learning. Figure 2 shows the $\ell ^ { 2 }$ ratio for CIFAR-10 on train and validation sets. For single representation
118
+
119
+ Resnet and pooling Resnet, the first few residual blocks (especially the first residual block) changes representations significantly (up to twice the norm of the original representation), while the rest of the higher blocks are relatively much less significant and this effect is monotonic as we go to higher blocks. However this effect is not as drastic in the original Resnet and wide Resnet architectures which have two $1 \times 1$ (shortcut) convolution layers, thus adding up to a total of 3 convolution layers in the main path of the residual network (notice there exists only one convolution layer in the main path for the other two architectures). This suggests that residual blocks in general tend to learn to refine features but in the case when the network lacks enough compositional layers in the main path, lower residual blocks are forced to change representations significantly, as a proxy for the absence of compositional layers. Additionally, small $\ell ^ { \frac { \mathtt { A } } { 2 } }$ ratio justifies first order approximation used to derive our main result in Sec. 3.
120
+
121
+ 2. Effect of dropping residual layer on accuracy: We drop individual residual blocks from trained Resnets and make predictions using the rest of network on validation set. This analysis shows the significance of individual residual blocks towards the final accuracy that is achieved using all the residual blocks. Note, dropping individual residual blocks is possible because adjacent blocks operate in the same feature space. Figure 3 shows the result of dropping individual residual blocks. As one would expect given above analysis, dropping the first few residual layers (especially the first) for single representation Resnet and pooling Resnet leads to catastrophic performance drop while dropping most of the higher residual layers have minimal effect on performance. On the other hand, performance drops are not drastic for the original Resnet and wide Resnet architecture, which is in agreement with the observations in $\ell ^ { 2 }$ ratio experiments above.
122
+
123
+ In another set of experiments, we measure validation accuracy after individual residual block during the training process. This set of experiments is achieved by plugging the classifier right after each residual block in the last stage of hidden representation (i.e., after the last shortcut connection, if any). This is shown in figure 5. The figures show that accuracy increases very gradually when adding more residual blocks in the last stage of all architectures.
124
+
125
+ # 4.3 BORDERLINE EXAMPLES
126
+
127
+ In this section we investigate which samples get correctly classified after the application of a residual block. Individual residual blocks in general lead to small improvements in performance. Intuitively, since these layers move representations minimally (as shown by previous analysis), the samples that lead to these minor accuracy jump should be near the decision boundary but getting misclassified by a slight margin. To confirm this intuition, we focus on borderline examples, defined as examples that require less than $1 0 \%$ probability change to flip prediction to, or from the correct class. We measure loss, accuracy and entropy over borderline examples over last 5 blocks of the network using the network final classifier. Experiment is performed on CIFAR-10 using Resnet-110 architecture.
128
+
129
+ Fig 6 shows evolution of loss and accuracy on three groups of examples: borderline examples, already correctly classified and the whole dataset. While overall accuracy and loss remains similar across the top residual blocks, we observe that a significant chunk of borderline examples gets corrected by the immediate next residual block. This exposes the qualitative nature of examples that these feature refinement layers focus on, which is further reinforced by the fact that entropy decreases for all considered subsets. We also note that while train loss drops uniformly across layers, test sets loss increases after last block. Correcting this phenomenon could lead to improved generalization in Resnets, which we leave for future work.
130
+
131
+ # 4.4 UNROLLING RESIDUAL NETWORK
132
+
133
+ A fundamental requirement for a procedure to be truly iterative is to apply the same function. In this section we explore what happens when we unroll the last block of a trained residual network for more steps than it was trained for. Our main goal is to investigate if iterative inference generalizes to more steps than it was trained on. We focus on the same model as discussed in previous section, Resnet-110, and unroll the last residual block for 20 extra steps. Naively unrolling the network leads to activation explosion (we observe similar behavior in Sec. 4.5). To control for that effect, we added a scaling factor on the output of the last residual blocks. We hypothesize that controlling the scale limits the drift of the activation through the unrolled layer, i.e. they remains in a given neighbourhood on which the network is well behaved. Similarly to Sec. 4.3 we track evolution of loss and accuracy on three groups of examples: borderline examples, already correctly classified and the whole dataset. Experiments are repeated 4 times, and results are averaged.
134
+
135
+ ![](images/45ce3cb6c90773f203329525ca411c67d6772b3e60ca0f93709282eb77bc1563.jpg)
136
+ Figure 6: Accuracy, loss and entropy for last 5 blocks of Resnet-110. Performance on bordeline examples improves at the expense of performance (loss) of already correctly classified points (correct). This happens because last block output is encouraged by training to be negatively correlated (around $- 0 . 1$ cosine) with gradient of the loss.
137
+
138
+ ![](images/1cf6fb56177565aa740e3c99c5040589577c27df90aab5e834e0229f328a5f23.jpg)
139
+ Figure 7: Accuracy, loss and entropy for Resnet-110 with last block unrolled for 20 additional steps (with appropriate scaling). Borderline examples are corrected and overall performance accuracy improves. Note different scales for train and test. Curves are averaged over 4 runs.
140
+
141
+ We first investigate how unrolling blocks impact loss and accuracy. Loss on train set improved uniformly from 0.0012 to 0.001, while it increased on test set. There are on average 51 borderline examples in test $\mathrm { s e t } ^ { 2 }$ , on which performance is improved from $4 3 \%$ to $5 3 \%$ , which yields slight improvement in accuracy on test set. Next we shift our attention to cosine loss. We observe that cosine loss remains negative on the first two steps without rescaling, and all steps after scaling. Figure 7 shows evolution of loss and accuracy on the three groups of examples: borderline examples, already correctly classified and the whole dataset. Cosine loss and $\ell ^ { 2 }$ ratio for each block are reported in Appendix E.
142
+
143
+ To summarize, unrolling residual network to more steps than it was trained on improves both loss on train set, and maintains (in given neighbourhood) negative cosine loss on both train and test set.
144
+
145
+ # 4.5 SHARING RESIDUAL LAYERS
146
+
147
+ Our results suggest that top residual blocks should be shareable, because they perform similar iterative refinement. We consider a shared version of Resnet-110 model, where in each stage we share all the residual blocks from the $5 ^ { t h }$ block. All shared Resnets in this section have therefore a similar number of parameters as Resnet-38. Contrary to (Liao & Poggio, 2016) we observe that naively sharing the higher (iterative refinement) residual blocks of a Resnets in general leads to bad performance3 (especially for deeper Resnets).
148
+
149
+ First, we compare the unshared and shared version of Resnet-110. The shared version uses approximately 3 times less parameters. In Fig. 8, we report the train and validation performances of the Resnet-110. We observe that naively sharing parameters of the top residual blocks leads both to overfitting (given similar training accuracy, the shared Resnet-110 has significantly lower validation performances) and underfitting (worse training accuracy than Resnet-110). We also compared our shared model with a Resnet-38 that has a similar number of parameters and observe worse validation performances, while achieving similar training accuracy.
150
+
151
+ ![](images/bfbb0a7746950c10206f50512c34dd98c7f540cf633119c7a63f023e3d29f4fe.jpg)
152
+ Figure 8: Resnet-110 with naively shared top 13 layers of each block compared with unshared Resnet-38. Left plot present training and validation curves, shared Resnet-110 heavily overfits. In the right plot we track gradient norm ratio between first block in first and last stage of resnet $\begin{array} { r } { r = | | \frac { \hat { \partial } L } { \partial h _ { 1 } } | | / \frac { \partial L } { \partial h _ { 1 + 2 n } } | | \big ) } \end{array}$ L1 ||/ ∂L∂h1+2n ||). Significantly larger ratio in the naive sharing model suggests, that the overfitting is caused by early layers dominating learning. Metrics are tracked on train (solid line) and validation data (dashed line)
153
+
154
+ ![](images/317e694fb4391b1b7f026c109e8bd64f8f99052c805e6808e33e71ff5988a165.jpg)
155
+ Figure 9: Ablation study of different strategies to remedy sharing leading to overfitting phenomenon in Residual Networks. Left figure shows effect on training and test accuracy. Right figure studies norm explosion. All components are important, but it is most crucial to unshare BN statistics.
156
+
157
+ We notice that sharing layers make the layer activations explode during the forward propagation at initialization due to the repeated application of the same operation (Fig 8, right). Consequently, the norm of the gradients also explodes at initialization (Fig. 8, center).
158
+
159
+ To address this issue we introduce a variant of recurrent batch normalization (Cooijmans et al., 2016), which proposes to initialize $\gamma$ to 0.1 and unshare statistics for every step. On top of this strategy, we also unshare $\gamma$ and $\beta$ parameters. Tab. 1 shows that using our strategy alleviates explosion problem and leads to small improvement over baseline with similar number of parameters. We also perform an ablation to study, see Figure. 9 (left), which show that all additions to naive strategy are necessary and drastically reduce the initial activation explosion. Finally, we observe a similar trend for cosine loss, intermediate accuracy, and $\ell ^ { 2 }$ ratio for the shared Resnet as for the unshared Resnet discussed in the previous Sections. Full results are reported in Appendix D.
160
+
161
+ Unshared Batch Normalization strategy therefore mitigates this exploding activation problem. This problem, leading to exploding gradient in our case, appears frequently in recurrent neural network. This suggests that future unrolled Resnets should use insights from research on recurrent networks optimization, including careful initialization (Henaff et al., 2016) and parametrization changes (Hochreiter & Schmidhuber, 1997).
162
+
163
+ <table><tr><td>Model</td><td>CIFAR10</td><td>CIFAR100</td><td>Parameters</td></tr><tr><td>Resnet-32</td><td>1.53/7.14</td><td>12.62/30.08</td><td>467k-473k</td></tr><tr><td>Resnet-38</td><td>1.20/6.99</td><td>10.04/29.66</td><td>565k-571k</td></tr><tr><td>Resnet-110-UBN</td><td>0.63/6.62</td><td>7.75/29.94</td><td>570k-576k</td></tr><tr><td>Resnet-146-UBN</td><td>0.68/6.82</td><td>7.21/29.49</td><td>573k-579k</td></tr><tr><td>Resnet-182-UBN</td><td>0.48/6.97</td><td>6.42 /29.33</td><td>576k-581k</td></tr><tr><td>Resnet-56</td><td>0.58/6.53</td><td>5.19/28.99</td><td>857k-863k</td></tr><tr><td>Resnet-110</td><td>0.22/6.13</td><td>1.26 /27.54</td><td>1734k-1740k</td></tr></table>
164
+
165
+ Table 1: Train and test error of Resnet sharing top layers blocks (while using unshared both statistics and $\beta , \gamma$ in Batch Normalization) denoted as UBN (Unshared Batch Normalization) compared to baseline Resnet of varying depth. Training Resnet with unrolled layers can bring additional gain of $0 . 3 \%$ , while adding marginal amount of extra parameters. Runs are repeated 4 times.
166
+
167
+ # 5 CONCLUSION
168
+
169
+ Our main contribution is formalizing the view of iterative refinement in Resnets and showing analytically that residual blocks naturally encourage representations to move in the half space of negative loss gradient, thus implementing a gradient descent in the activation space (each block reduces loss and improves accuracy). We validate theory experimentally on a wide range of Resnet architectures.
170
+
171
+ We further explored two forms of sharing blocks in Resnet. We show that Resnet can be unrolled to more steps than it was trained on. Next, we found that counterintuitively training residual blocks with shared blocks leads to overfitting. While we propose a variant of batch normalization to mitigate it, we leave further investigation of this phenomena for future work. We hope that our developed formal view, and practical results, will aid analysis of other models employing iterative inference and residual connections.
172
+
173
+ # ACKNOWLEDGEMENTS
174
+
175
+ We acknowledge the computing resources provided by ComputeCanada and CalculQuebec. SJ was supported by Grant No. DI 2014/016644 from Ministry of Science and Higher Education, Poland. DA was supported by IVADO.
176
+
177
+ # REFERENCES
178
+
179
+ D. Arpit, Y. Zhou, B. U Kota, and V. Govindaraju. Normalization propagation: A parametric technique for removing internal covariate shift in deep networks. ICML, 2016.
180
+ Tim Cooijmans, Nicolas Ballas, César Laurent, Çaglar Gülçehre, and Aaron Courville. Recurrent ˘ batch normalization. arXiv preprint arXiv:1603.09025, 2016.
181
+ X. Glorot and Y. Bengio. Understanding the difficulty of training deep feedforward neural networks. In Aistats, 2010.
182
+ K. Greff, R. Srivastava, and J. Schmidhuber. Highway and residual networks learn unrolled iterative estimation. arXiV, 2016.
183
+ K. He, X. Zhang, S. Ren, and J. Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In ICCV, 2015.
184
+ K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In CVPR, 2016a.
185
+ K. He, X. Zhang, S. Ren, and J. Sun. Identity mappings in deep residual networks. In ECCV, 2016b.
186
+ M. Henaff, A. Szlam, and Y. LeCun. Recurrent orthogonal networks and long-memory tasks. In ICML, 2016.
187
+ S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural computation, 1997.
188
+
189
+ Furong Huang, Jordan Ash, John Langford, and Robert Schapire. Learning deep resnet blocks sequentially using boosting theory. arXiv preprint arXiv:1706.04964, 2017.
190
+
191
+ S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, 2015.
192
+
193
+ A. Krizhevsky and G. Hinton. Learning multiple layers of features from tiny images. 2009.
194
+
195
+ A. Krizhevsky, I. Sutskever, and G. Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, 2012.
196
+
197
+ Q. Liao and T. Poggio. Bridging the gaps between residual learning, recurrent neural networks and visual cortex. arXiV, 2016.
198
+
199
+ E. Littwin and L. Wolf. The loss surface of residual networks: Ensembles and the role of batch normalization. arXiV, 2016.
200
+
201
+ V. Nair and G. Hinton. Rectified linear units improve restricted boltzmann machines. In ICML, 2010.
202
+
203
+ K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv, 2014.
204
+
205
+ S. Thorpe, D. Fize, and C. Marlot. Speed of processing in the human visual system. Nature, 1996.
206
+
207
+ S. Vanmarcke, F. Calders, and F. Wagemans. The time-course of ultrarapid categorization: The influence of scene congruency and top-down processing. i-Perception, 2016.
208
+
209
+ A. Veit, M. Wilber, and S. Belongie. Residual networks are exponential ensembles of relatively shallow networks. arXiV, 2016.
210
+
211
+ # Appendices
212
+
213
+ A FURTHER ANALYSIS
214
+
215
+ A.1 A SIDE-EFFECT OF MOVING IN THE HALF SPACE OF $- \frac { \partial \mathcal { L } ( \mathbf { h } _ { o } ) } { \partial \mathbf { h } _ { o } }$
216
+
217
+ Let $\mathbf { h } _ { o } = \mathbf { W } \mathbf { x } + \mathbf { b }$ be the output of the first layer (convolution) of a ResNet. In this analysis we show that if $\mathbf { h } _ { o }$ moves in the half space of $- \frac { \partial \mathcal { L } ( \dot { \bf h } _ { o } ) } { \partial { \bf h } _ { o } }$ , then it is equivalent to updating the parameters of the convolution layer using a gradient update step. To see this, consider the change in $\mathbf { h } _ { o }$ from updating parameters using gradient descent with step size $\eta$ . This is given by,
218
+
219
+ $$
220
+ \begin{array} { r l } & { \Delta \mathbf { h } _ { o } = ( \mathbf { W } - \eta \frac { \partial \mathcal { L } } { \partial \mathbf { W } } ) \mathbf { x } + ( \mathbf { b } - \eta \frac { \partial \mathcal { L } } { \partial \mathbf { b } } ) - ( \mathbf { W } \mathbf { x } + \mathbf { b } ) } \\ & { \quad \quad = - \eta \frac { \partial \mathcal { L } } { \partial \mathbf { W } } \mathbf { x } - \eta \frac { \partial \mathcal { L } } { \partial \mathbf { b } } } \\ & { \quad \quad = - \eta \frac { \partial \mathcal { L } } { \partial \mathbf { h } _ { o } } \left( \frac { \partial \mathbf { h } _ { o } } { \partial \mathbf { W } } \mathbf { x } + \frac { \partial \mathbf { h } _ { o } } { \partial \mathbf { b } } \right) } \\ & { \quad \quad = - \eta \frac { \partial \mathcal { L } } { \partial \mathbf { h } _ { o } } \left( \| \mathbf { x } \| ^ { 2 } + 1 \right) } \\ & { \quad \quad \propto - \frac { \partial \mathcal { L } } { \partial \mathbf { h } _ { o } } } \end{array}
221
+ $$
222
+
223
+ Thus, moving $\mathbf { h } _ { o }$ in the half space of ∂L∂h has the same effect as that achieved by updating the parameters W, b using gradient descent. Although we found this insight interesting, we don’t build upon it in this paper. We leave this as a future work.
224
+
225
+ # B ANALYSIS ON CIFAR-100
226
+
227
+ Here we report the experiments as done in sections 4.2 and 4.1, for CIFAR-100 dataset. The plots are shown in figures 10, 11 and 12. The conclusions are same as reported in the main text for CIFAR-10.
228
+
229
+ # C ANALYSIS OF INTERMEDIATE METRICS ON CIFAR-10 AND CIFAR-100
230
+
231
+ Here we plot the accuracy, cosine loss and $\ell ^ { 2 }$ ratio metrics corresponding to each individual residual block on validation during the training process for CIFAR-10 (figures 13, 14, 5) and CIFAR-100 (figures 15, 16, 17). These plots are recorded only for the residual blocks in the last space for each architecture (this is because otherwise the dimensions of the output of the residual block and the classifier will not match). In the case of cosine loss after individual residual block, this set of experiments is achieved by plugging the classifier right after each hidden representation and measuring the cosine between the gradient w.r.t. hidden representation and the corresponding residual block’s output.
232
+
233
+ We find that the accuracy after individual residual blocks increases gradually as we move from from lower to higher residua blocks. Cosine loss on the other hand consistently remains negative for all architectures. Finally $\ell ^ { 2 }$ ratio tends to increase for residual blocks as training progresses.
234
+
235
+ # D ITERATIVE INFERENCE IN SHARED RESNET
236
+
237
+ In this section we extend results from Sec. 4.5. We report cosine loss, intermediate accuracy, and $\ell ^ { 2 }$ ratio for naively shared Resnet in Fig. 19, and with unshared batch normalization in Fig. ??.
238
+
239
+ ![](images/1b17acb195696f29ae3640e938149cc123114da395f8c230d9ab97cb13e31f33.jpg)
240
+ Figure 10: Average cos loss between residual block $F ( \mathbf { h } _ { i } )$ and $\frac { \partial \mathcal { L } ( \mathbf { h } _ { i } ) } { \partial \mathbf { h } _ { i } }$ for (left to right) original Resnet, single representation Resnet, avg-pooling Resnet, and wideResnet on CIFAR-100.
241
+
242
+ ![](images/6c3cb1928f9b9760fc6b0a476c1dbfe114c61337c0a10818f9d2531121cc3492.jpg)
243
+ Figure 11: Average ratio of $\ell ^ { 2 }$ norm of output of residual block to the norm of the input of residual block for (left to right) original Resnet, single representation Resnet, avg-pooling Resnet, and wideResnet on CIFAR-100. (Train and validation curves are overlapping.)
244
+
245
+ ![](images/6fa9571f937f9a10fa428290fe15ddf9157886ca0638d0c70792a5dfa9dbd224.jpg)
246
+ Figure 12: Final prediction accuracy when individual residual blocks are dropped for (left to right) original Resnet, single representation Resnet, avg-pooling Resnet, and wideResnet on CIFAR-100.
247
+
248
+ ![](images/35b4afd2a7979b9304c3d47ec0ba7f16e0dbb19db8dffad74d7b420d54dffd86.jpg)
249
+ Figure 13: Average cos loss between residual block $F ( \mathbf { h } _ { i } )$ and $\frac { \partial \mathcal { L } ( \mathbf { h } _ { i } ) } { \partial \mathbf { h } _ { i } }$ during training for (left to right) original Resnet, single representation Resnet, avg-pooling Resnet, and wideResnet on CIFAR10. (Blue to red spectrum denotes lower to higher residual blocks)
250
+
251
+ ![](images/47804a663459cbe85a632d724d137c87e5c163c0da670b05c469de4e12d1d468.jpg)
252
+ Figure 14: Average ratio of $\ell ^ { 2 }$ norm of output of residual block to the norm of the input of residual block during training for (left to right) original Resnet, single representation Resnet, avg-pooling Resnet, and wideResnet on CIFAR-10. (Blue to red spectrum denotes lower to higher residual blocks)
253
+
254
+ ![](images/b779c3d0cc4cfdca2c6f72fe04e29662322b5aa8270237d0879be36375e249eb.jpg)
255
+ Figure 15: Average cos loss between residual block $F ( \mathbf { h } _ { i } )$ and $\frac { \partial \mathcal { L } ( \mathbf { h } _ { i } ) } { \partial \mathbf { h } _ { i } }$ during training for (left to right) original Resnet, single representation Resnet, avg-pooling Resnet, and wideResnet on CIFAR100. (Blue to red spectrum denotes lower to higher residual blocks)
256
+
257
+ ![](images/be96d4ee5e6092d0abc3923a29ede16bae2a0e2f69dfda342c24dce27448fdc7.jpg)
258
+ Figure 16: Average ratio of $\ell ^ { 2 }$ norm of output of residual block to the norm of the input of residual block during training for (left to right) original Resnet, single representation Resnet, avg-pooling Resnet, and wideResnet on CIFAR-100. (Blue to red spectrum denotes lower to higher residual blocks)
259
+
260
+ ![](images/0e1c34c0292272d61a67bcf11c4d7dee673f157548679b261a2c86de4c4c0365.jpg)
261
+ Figure 17: Prediction accuracy when plugging classifier after hidden states in the last stage of Resnets(if any) during training for (left to right) original Resnet, single representation Resnet, avgpooling Resnet, and wideResnet on CIFAR-100. (Blue to red spectrum denotes lower to higher residual blocks)
262
+
263
+ ![](images/6971a298000f2b641ebb3b1777ff1c7001887d45ceeab449029d48e8d485df97.jpg)
264
+ Figure 18: Cosine loss, $\ell ^ { 2 }$ ratio, and intermediate accuracy for shared Resnet-110 with unshared Batch Normalization (described in Sec. 4.5). Each curve represents different block in Resnet. Red is closest to output.
265
+
266
+ ![](images/d0f2347f07953ddb059bbfaad26f0e9816ebf0fbb936fa7d0fd52f4002719440.jpg)
267
+ Figure 19: Cosine loss, $\ell ^ { 2 }$ ratio, and intermediate accuracy for naively shared Resnet-110. Each curve represents different block in Resnet. Red is closest to output.
268
+
269
+ ![](images/e116cb21a9e9e5bf5578ddf325e9427b0d83225b4a27e53806f38c6c3d213ffe.jpg)
270
+ Figure 20: First figure show that cosine loss in Resnet-110 after unrolling generalizes to more steps than it was trained on. Second plot shows evolution of $\ell ^ { 2 }$ ratio for Resnet-110. Third plot reports cosine loss Resnet-110 with scaled version of final block, as considered in Sec. 4.4. Rightmost plots reports $\ell ^ { 2 }$ ratio for scaled Resnet-110. Vertical line in plots indicates number of steps network was trained on.
271
+
272
+ # E UNROLLING RESIDUAL NETWORKS
273
+
274
+ In this section we report additional results for unrolling residual network. Figure 20 shows evolution of cosine loss an $\ell ^ { 2 }$ ratio for Resnet-110 with unrolled last block for 20 additional steps.
md/train/SJeS16EKPr/SJeS16EKPr.md ADDED
@@ -0,0 +1,668 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # LEARNING RELEVANT FEATURES FOR STATISTICAL INFERENCE
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Given two views of data, we consider the problem of finding the features of one view which can be most faithfully inferred from the other. We find that these are also the most correlated variables in the sense of deep canonical correlation analysis (DCCA). Moreover, we show that these variables can be used to construct a non-parametric representation of the implied joint probability distribution. This representation can be used to compute the expectations of functions over one view of data conditioned on the other, such as Bayesian estimators and their standard deviations. We test the approach using inference on occluded MNIST images, and show that our representation contains multiple modes. Surprisingly, when applied to supervised learning (one dataset consists of labels), this approach automatically provides regularization and faster convergence compared to the cross-entropy objective. We also explore using this approach to discover salient independent variables of a single dataset.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Given samples $( x _ { 1 } , y _ { 1 } ) , \dotsc , ( x _ { n } , y _ { n } )$ from an unknown joint probability distribution $p ( x , y )$ , we want to construct a useful representation of the conditional probabilities $p ( x | y )$ and $p ( y | x )$ , so that we that we can infer one view from the other on new data.
12
+
13
+ For instance, $x$ and $y$ could be past and future histories of dynamical data, visual and auditory inputs, actions and their effects, etc.
14
+
15
+ Following the approach introduced in Beny & Osborne (2013; 2015b) in the context of quantum ´ information theory, we look at the problem as follows: the conditional distributions $p ( y | x )$ can be thought of as representing a noisy communication channel (stochastic map). This channel is a linear map between spaces of typically ludicrously large dimensions (the spaces of all probability distributions over $x$ or $y$ ). We want a pair of small subspaces which best represent the channel. Specifically, we look for those vectors representing probability distributions over $x$ which lose least distinguishability under the channel, where the distinguishability is measured by the $\chi ^ { 2 }$ divergence.
16
+
17
+ We show in Section 3 that this is equivalent to performing a certain singular value decomposition of the channel (seen as an operator in Hilbert space) and keep only the components with the largest singular values. Moreover, the full singular value decomposition is equivalent to the decomposition in terms of canonical variables introduced in Lancaster (1958), namely,
18
+
19
+ $$
20
+ p ( \boldsymbol { y } | \boldsymbol { x } ) = p ( \boldsymbol { y } ) \sum _ { i = 1 } ^ { D } \eta _ { i } u _ { i } ( \boldsymbol { x } ) v _ { i } ( \boldsymbol { y } ) ,
21
+ $$
22
+
23
+ where $u _ { i }$ and $u _ { j }$ are real non-linear functions such that $\mathbb { E } ( u _ { i } u _ { j } ) = \delta _ { i j }$ , $\mathbb { E } ( v _ { i } v _ { j } ) = \delta _ { i j }$ , and $0 ~ <$ $\eta _ { D } \leq \cdot \cdot \cdot \leq \eta _ { 1 } \leq \eta _ { 0 } = 1$ are the singular values.
24
+
25
+ The practical advantage of this representation for inference (or prediction) is that it reduces the evaluation of conditional expectations to that of empirical averages over the (unconditional) marginal $p ( y )$ .
26
+
27
+ As observed in Michaeli et al. (2016), the span of the first $k$ canonical variables $u _ { i } , \ v _ { j }$ is what is learned by the deep canonical correlation analysis (DCCA) (Andrew et al., 2013). Indeed, these
28
+
29
+ variables are those which maximize the correlations $\mathbb { E } ( u _ { i } v _ { i } )$ subject to the same constraints as above.
30
+ (This reduces to CCA (Hotelling, 1936) when $u _ { i }$ , $v _ { j }$ are linear maps).
31
+
32
+ In this work, besides establishing this new information-theoretical interpretation of canonical variables and DCCA, we experiment with using this representation for performing inference on new data. Moreover, we propose a strategy for extracting disentangled variables from the canonical variables, inspired by analytical solutions.
33
+
34
+ # 2 RELATED WORK
35
+
36
+ This general problem (of building an effective representation of the conditional probability distributions implied by joint samples) covers many existing approaches in different contexts. For instance, if the variables $y$ has few possible states, then it reduces to a classification problem, usually solved by minimizing the crossentropy between a predicted distribution and the one-hot encoding of the classes.
37
+
38
+ When $y$ has a large number of states, or is fundamentally continuous, existing approaches usually do not model the whole conditional distribution, but either provide the average (regression), or approximately sample from it.
39
+
40
+ The main class of methods which allows for sampling from the conditional distributions are variational: a deterministic neural networks produces the parameters of analytical classes of probabilities.
41
+ This includes variational autoencoders Kingma & Welling (2013) (e.g., Iten et al. (2018); Wang et al.
42
+ (2016)), and approaches based on the minimum description length principle such as Gregor et al.
43
+ (2013).
44
+
45
+ Alternatively, it may also be possible to use adversarial training Goodfellow et al. (2014), by using a conditional Mirza & Osindero (2014) version of an energy-based GAN Zhao et al. (2016).
46
+
47
+ By contrast, our approach doesn’t require the training of a generative model. Instead, conditional expectations are constructed as linear combinations of unconditional empirical averages over the training data.
48
+
49
+ Previous approaches to equipping CCA or DCCA with an information-theoretic interpretation have explored different directions. For instance, in Wang et al. (2016), the authors generalize a probabilistic interpretation for CCA in terms of gaussian distributions, which leads to a variational approach. In Painsky et al. (2018), additional constraints on the mutual information between the data and the learned variables are added to the optimizations.
50
+
51
+ A previous attempt at designing a numerical solution for our singular value problem can be found in Beny (2018b). In that work, the relevant variables were represented through a PCA kernel produced ´ by Monte Carlo sampling, but wasn’t practical.
52
+
53
+ # 3 THEORY
54
+
55
+ We formalize the problem by assuming that our data was sampled from an unknown joint distribution $p ( x , y )$ over two random variables $X$ and $Y$ .
56
+
57
+ Let $V _ { X }$ and $V _ { Y }$ denote the linear spaces spanned by all probability distributions over $X$ and $Y$ respectively. Here we assume that $X$ and $Y$ take finitely many values for simplicity, but this formalism can be straightforwardly extended to infinite-dimensional vector spaces.
58
+
59
+ We will need inner products on $V _ { X }$ and $V _ { Y }$ , to make them into real Hilbert spaces. We use the Fisher information metrics evaluated at the points $p ( x )$ and $p ( y )$ respectively (marginals of $p ( x , y ) \mathrm { . }$ ), that is,
60
+
61
+ $$
62
+ \langle \mu , \mu ^ { \prime } \rangle _ { X } : = \sum _ { x } { \frac { \mu ( x ) \mu ^ { \prime } ( x ) } { p ( x ) } } \quad { \mathrm { a n d } } \quad \langle \nu , \nu ^ { \prime } \rangle _ { Y } : = \sum _ { y } { \frac { \nu ( y ) \nu ^ { \prime } ( y ) } { p ( y ) } }
63
+ $$
64
+
65
+ for any vectors $\mu , \mu ^ { \prime } \in V _ { X }$ and $\nu , \nu ^ { \prime } \in V _ { Y }$ .
66
+
67
+ Below we also call the marginals $p _ { X }$ and $p _ { Y }$ respectively when omitting their arguments $( p _ { X } ( x ) \equiv$ $p ( x )$ and $p _ { Y } ( y ) \equiv p ( y ) \rangle$ .
68
+
69
+ These inner products allow us to define the $\chi ^ { 2 }$ divergence:
70
+
71
+ $$
72
+ \chi ^ { 2 } ( q , p _ { X } ) = \langle q - p _ { X } , q - p _ { X } \rangle _ { X } ,
73
+ $$
74
+
75
+ which a measures of statistical distinguishability between $q$ and $p _ { X }$ . Specifically, it quantifies how easy it is to reject the null hypothesis that the state is $p _ { X }$ when it is actually $q$ , based on the empirical distribution obtained from independent samples. It is also the lowest order approximation of the Kullback-Leibler divergence.
76
+
77
+ The joint distribution $p ( x , y )$ yields conditional distributions $p ( y | x )$ and $p ( x | y )$ . These can be understood as the components (or kernels) of stochastic maps $\mathcal { N } : V _ { X } V _ { Y }$ and $\mathcal { N ^ { * } } : V _ { X } V _ { Y }$ respectively. Explicitely, if $\mu \in V _ { X }$ and $\nu \in V _ { Y }$ , then the images $\mathcal { N } ( \mu ) \in V _ { Y }$ and $\mathcal { N } ^ { * } ( \nu ) \in V _ { X }$ are defined by
78
+
79
+ $$
80
+ { \mathcal { N } } ( \mu ) ( y ) = \sum _ { x } p ( y | x ) \mu ( x ) \quad { \mathrm { a n d } } \quad { \mathcal { N } } ^ { * } ( \nu ) ( x ) = \sum _ { y } p ( x | y ) \nu ( y ) .
81
+ $$
82
+
83
+ These stochastic maps $\mathcal { N }$ and $\mathcal { N } ^ { * }$ perform inference of one variable given some (possibly imperfect) knowledge about the other, with priors given by the marginals $p ( x )$ or $p ( y )$ of $p ( x , y )$ depending on the direction of the inference. Importantly, $\mathcal { N } ^ { * }$ is the transpose of $\mathcal { N }$ in terms of the inner products defined above:
84
+
85
+ $$
86
+ \langle \nu , \mathcal { N } ( \mu ) \rangle _ { Y } = \langle \mathcal { N } ^ { * } ( \nu ) , \mu \rangle _ { X } .
87
+ $$
88
+
89
+ We now have the tools to address the problem mentioned in the introduction. The distinguishability between $q \in V _ { X }$ and $p _ { X }$ after the action of the channel $\mathcal { N }$ is $\chi ^ { 2 } ( \mathcal { N } ( q ) , p _ { Y } )$ since $p _ { Y } = \mathcal { N } ( p _ { X } )$ . Hence we want to find the distributions $p$ which maximize the relevance Beny & Osborne (2013). ´
90
+
91
+ $$
92
+ \eta ( q ) = \frac { \chi ^ { 2 } ( \mathcal { N } ( q ) , p _ { Y } ) } { \chi ^ { 2 } ( q , p _ { X } ) } = \frac { \langle \mathcal { N } ( \mu ) , \mathcal { N } ( \mu ) \rangle _ { Y } } { \langle \mu , \mu \rangle _ { X } } ,
93
+ $$
94
+
95
+ where $\mu = q - p _ { X }$ . The inner-product formulation makes it clear that this amounts to finding the eigenvector with largest eigenvalue for the symmetric map $\mathcal { N } ^ { * } \mathcal { N }$ , which is also the singular vector with largest singular value for $\mathcal { N }$ . On can then go on to find the eigenvector with next largest eigenvalue and so on, which are automatically orthogonal.
96
+
97
+ In practice, the inner products are more tractable to compute if we express elements $\mu \in V _ { X }$ and $\nu \in V _ { Y }$ in terms of variables $f$ and $g$ as $\mu = p _ { X } f$ and $\nu = p _ { Y } g$ , or
98
+
99
+ $$
100
+ \mu ( x ) = p ( x ) f ( x ) \quad { \mathrm { a n d } } \quad \nu ( y ) = p ( y ) g ( y )
101
+ $$
102
+
103
+ for all $x , y$ . Indeed, this yields simply
104
+
105
+ $$
106
+ \langle \mu , \mu ^ { \prime } \rangle _ { X } = \operatorname { \mathbb { E } } ( f f ^ { \prime } ) \quad { \mathrm { a n d } } \quad \langle \nu , \nu ^ { \prime } \rangle _ { Y } = \operatorname { \mathbb { E } } ( g g ^ { \prime } ) .
107
+ $$
108
+
109
+ We are now in measure to make the connection with DCCA Andrew et al. (2013). Indeed, the aims of DCCA is to maximize the correlations $\operatorname { c o r r } ( f , g ) = \mathbb { E } ( f g )$ over function $f ( x )$ and $g ( y )$ such that $\mathbb { E } ( f ^ { 2 } ) = \mathbb { E } ( g ^ { 2 } ) = 1$ . But, using $\mu = p _ { X } f$ and $\nu = p _ { Y } g$ , we have
110
+
111
+ $$
112
+ \mathbb { E } ( f g ) = \langle \nu , \mathcal { N } ( \mu ) \rangle _ { Y } ,
113
+ $$
114
+
115
+ which is maximized by the left- and right- singular vectors $\mu$ and $\nu$ of $\mathcal { N }$ with largest singular value.
116
+
117
+ Given all the singular vectors $\mu _ { i } = p _ { X } f _ { i }$ and $\nu _ { i } = p _ { Y } g _ { i }$ with singular values $\eta _ { i }$ , we obtain the representation
118
+
119
+ $$
120
+ \mathcal { N } ( \mu ) = \sum _ { i } \eta _ { i } \nu _ { i } \langle \mu _ { i } , \mu \rangle _ { X } ,
121
+ $$
122
+
123
+ which, using a more standard notation and the Kronecker delta $\delta _ { x }$ , yields Eq. 1:
124
+
125
+ $$
126
+ p ( y | x ) = { \mathcal { N } } ( \delta _ { x } ) ( y ) = { \frac { 1 } { p ( x ) } } \sum _ { i } \eta _ { i } \nu _ { i } ( y ) \mu _ { i } ( x ) = p ( y ) \sum _ { i } \eta _ { i } v _ { i } ( y ) u _ { i } ( x ) ,
127
+ $$
128
+
129
+ where $\mu _ { i } = p _ { X } u _ { i }$ and $\nu _ { i } = p _ { Y } v _ { i }$ .
130
+
131
+ For the purpose of the optimization and inference, we do not need to full diagonal decomposition, but just functions $f _ { i } = \mu _ { i } / p _ { X }$ and $g _ { j } = \nu _ { j } / p _ { Y } , i , j = 1 , \ldots , k _ { 0 }$ , which have the same span as the canonical variables $u _ { i }$ and $v _ { j }$ respectively for $i , j = 1 , \ldots , k _ { 0 }$ (assuming that $\eta _ { 1 } , \ldots , \eta _ { k _ { 0 } }$ are the largest singular vector). Below we refer to $f _ { i }$ and $g _ { j }$ as the $k _ { 0 }$ most relevant variables.
132
+
133
+ Because these functions may not be orthogonal, we need the covariance matrices
134
+
135
+ $$
136
+ K _ { i j } = \langle \mu _ { i } , \mu _ { j } \rangle _ { X } = \mathbb { E } ( f _ { i } f _ { j } ) , \quad L _ { i j } = \langle \nu _ { i } , \nu _ { j } \rangle _ { X } = \mathbb { E } ( g _ { i } g _ { j } ) , \quad A _ { i j } = \langle \nu _ { i } , N ( \mu _ { j } ) \rangle _ { Y } = \mathbb { E } ( g _ { i } f _ { j } ) .
137
+ $$
138
+
139
+ If $N _ { i j }$ denote the components of $\mathcal { N }$ in the sense that $\begin{array} { r } { \mathcal { N } ( p _ { X } f _ { j } ) = \sum _ { i } N _ { i j } p _ { Y } g _ { i } } \end{array}$ , then, using our inner products to isolate $N _ { i j }$ , we obtain $N = L ^ { - 1 } A$ . Similarly, the components of $\mathcal { N } ^ { * }$ are $N _ { i j } ^ { * } =$ $K ^ { - 1 } A ^ { \top }$ . This implies that the sum of the square of the singular values of $\mathcal { N }$ restricted to the spans of the vectors $p _ { X } f _ { i }$ and $p _ { Y } g _ { j }$ for all $i , j$ , which is what we want to maximize, is just given by
140
+
141
+ $$
142
+ \sum _ { i = 1 } ^ { k _ { 0 } } \eta _ { i } ^ { 2 } = \mathrm { T r } \left( N ^ { \ast } N \right) = \mathrm { T r } ( K ^ { - 1 } A ^ { \top } L ^ { - 1 } A ) .
143
+ $$
144
+
145
+ This is the DCCA objective. Below we use the objective function $C = k _ { 0 } - \mathrm { T r } \left( N ^ { \ast } N \right)$ , for the cosmetic reason that its optimal value is zero.
146
+
147
+ Moreover, the corresponding truncated representation of the conditional distribution is
148
+
149
+ $$
150
+ p ( \boldsymbol { y } | \boldsymbol { x } ) = \mathcal { N } ( \delta _ { \boldsymbol { x } } ) ( \boldsymbol { y } ) \simeq p ( \boldsymbol { y } ) \sum _ { i , j = 1 } ^ { k _ { 0 } } ( L ^ { - 1 } A K ^ { - 1 } ) _ { i j } g _ { i } ( \boldsymbol { y } ) f _ { j } ( \boldsymbol { x } ) ,
151
+ $$
152
+
153
+ where we used the fact that the components of $\delta _ { x }$ are $\begin{array} { r } { \delta _ { j } = \sum _ { i } K _ { j i } ^ { - 1 } f _ { i } ( x ) } \end{array}$ .
154
+
155
+ Of course, This approach can produce a faithful representation of the correlations only if $\mathcal { N }$ is actually close to being of rank $k _ { 0 }$ (see Appendix $\mathbf { B }$ for a more precise statement). If we interpret the relevant subspace as a space of probability over latent variable, this means that our latent variables have at most $k _ { 0 }$ discrete states.
156
+
157
+ However, even if the rank $k _ { 0 }$ corner of $\mathcal { N }$ is a not a good approximation, this strategy allows us to nevertheless do the correct inference on certain random variables, namely those which are in the span of the canonical variables!
158
+
159
+ Indeed, the exact conditional expectation of $g _ { k }$ is (assuming $D$ is the actual rank of $\mathcal { N }$ ),
160
+
161
+ $$
162
+ \begin{array} { l } { { \displaystyle \sum _ { y } g _ { k } ( y ) p ( y | x ) = \sum _ { i , j = 1 } ^ { D } ( L ^ { - 1 } A K ^ { - 1 } ) _ { i j } \mathbb { E } ( g _ { k } g _ { i } ) f _ { j } ( x ) } } \\ { { \displaystyle \qquad = \sum _ { j = 1 } ^ { D } ( A K ^ { - 1 } ) _ { k j } f _ { j } ( x ) = \sum _ { j = 1 } ^ { k _ { 0 } } ( A K ^ { - 1 } ) _ { k j } f _ { j } ( x ) } , } \end{array}
163
+ $$
164
+
165
+ where the last truncation is exact if $k \leq k _ { 0 }$ due to the assumption that the basis $f _ { i }$ and $g _ { j }$ have the same span as the $k _ { 0 }$ largest right and left singular vectors of $\mathcal { N }$ respectively.
166
+
167
+ For instance, if $p ( x , y )$ is Gaussian, the canonical variables can be computed analytically, as in Lancaster (1958) or Beny (2018a) in the multivariate case. Solutions for other distributions were ´ also computed in Eagleson (1964).
168
+
169
+ Notably, for any two dimensional Gaussian, the space of $k$ most relevant variables is simply spanned by the moments $f _ { n } ( x ) = x ^ { n }$ and $g _ { n } ( y ) = y ^ { n }$ for $n = 0 , \ldots , k - 1$ . Hence, in this case the first $k$ moments can be inferred exactly using only the $k + 1$ most relevant variables (See Appendix C).
170
+
171
+ # 4 ALGORITHM
172
+
173
+ Let us explicit the algorithm resulting from the above analysis.
174
+
175
+ We assume that we are given independent samples $( x _ { 1 } , y _ { 1 } ) , ( x _ { 1 } , y _ { 2 } ) , . . .$ from the otherwise unknown joint distribution $p ( x , y )$ .
176
+
177
+ We first perform DCCA (Andrew et al., 2013). That is, we need two independent deterministic feedforward neural networks. The first maps $x$ to a set of $k _ { 0 }$ real-valued variables $f _ { 1 } ( x ) , \ldots , f _ { k _ { 0 } } ( x )$ . The second maps $y$ to a different set of $k _ { 0 }$ variables $g _ { 1 } ( y ) , \ldots , g _ { k _ { 0 } } ( y )$ .
178
+
179
+ The parameters of the neural networks are to be set to minimize the objective function
180
+
181
+ $$
182
+ C = k _ { 0 } - \operatorname { T r } { \left( K ^ { - 1 } A ^ { \top } L ^ { - 1 } A \right) } ,
183
+ $$
184
+
185
+ where the matrices $K , L , A$ can be approximated over a mini-batch $( x _ { n } , y _ { n } )$ , $n = 1 , \ldots , N$ via
186
+
187
+ $$
188
+ K _ { i j } = { \frac { 1 } { N } } \sum _ { n = 1 } ^ { N } f _ { i } ( x _ { n } ) f _ { j } ( x _ { n } ) , \quad L _ { i j } = { \frac { 1 } { N } } \sum _ { n = 1 } ^ { N } g _ { i } ( y _ { n } ) g _ { j } ( y _ { n } ) , \quad A _ { i j } = { \frac { 1 } { N } } \sum _ { n = 1 } ^ { N } g _ { i } ( y _ { n } ) f _ { j } ( x _ { n } ) .
189
+ $$
190
+
191
+ We found that, provided the batch size is sufficiently large compared to $k _ { 0 }$ (about 10 times in our experience), this can be minimized using ADAM or direct gradient descent. However, to guarantee stability when using large $k _ { 0 }$ , we needed to explicit the gradient of the objective function in order to force the use of the Moore-Penrose pseudo-inverses for $K ^ { - 1 }$ and $L ^ { - 1 }$ in both the forward and backward passes, in addition to using 64 bits floats in these computations.
192
+
193
+ Once the relevant variables have been learned, we still need to use the training data in a second step. Indeed, suppose that we wish to use our model to infer the value of some function $\Theta ( x )$ , i.e., to compute its approximate expectation value in terms of the conditional distribution $x \mapsto p ( x | y )$ . Then we need to store, for each variable $j = 1 , \ldots , k _ { 0 }$ , the quantities
194
+
195
+ $$
196
+ \Theta _ { j } = \frac { 1 } { N _ { \mathrm { f u l l } } } \sum _ { n = 1 } ^ { N _ { \mathrm { f u l l } } } \Theta ( x _ { n } ) f _ { j } ( x _ { n } ) ,
197
+ $$
198
+
199
+ where the average is to be taken on the full training batch (of size $N _ { \mathrm { f u l l } } ,$ . The same can be done exchanging $x$ with $y$ and $f _ { j }$ with $g _ { j }$ for the reverse inference.
200
+
201
+ For instance, if a data point $x$ is composed of real components $x ^ { a }$ —such as pixel color components for an image—and we are interested in the estimator which minimize the expected $l ^ { 2 }$ distance to the predicted values of these components, then we need the expectation values of the components $\Theta ( x ) = x ^ { a }$ for all $a$ , and possibly higher moments to gain more knowledge about the shape of the posterior distribution, such as the second moments $\Theta ^ { \prime } ( \bar { x } ) = x ^ { 2 }$ , etc.
202
+
203
+ Inference can then be performed with new data using
204
+
205
+ $$
206
+ \overline { { { \Theta } } } = \sum _ { x } p ( x | y ) \Theta ( x ) \approx \sum _ { i , j = 1 } ^ { k _ { 0 } } ( K ^ { - 1 } A ^ { \top } L ^ { - 1 } ) _ { j i } \Theta _ { j } g _ { i } ( y ) .
207
+ $$
208
+
209
+ Moreover, the accuracy of thof the relevant variables, i.e., t depend on, for which $k _ { 0 }$ $\Theta$ taken in the span. $\begin{array} { r } { \Theta ( x ) = \sum _ { i = 1 } ^ { k } c _ { i } f _ { i } ( x ) } \end{array}$ $\begin{array} { r } { \Theta _ { j } = \sum _ { i = 1 } ^ { k _ { 0 } } c _ { i } K _ { i j } } \end{array}$
210
+
211
+ The reverse inference formulas are obtained simply by the exchanges $K L$ , $A A ^ { \top }$ , and $g _ { i } f _ { i }$ .
212
+
213
+ # 5 EXPERIMENTS
214
+
215
+ In all our experiments, we used the ADAM optimizer with learning rate 0.001. We used the Flux package (Innes, 2018) for Julia, as well as Tensorflow.
216
+
217
+ As usual the data is divided into a training set and a testing set. No aspect of the testing set is used during training. The loss function refers to Eq. (7). In order to monitor overfitting, we compute a “test loss” and a “training loss”. The test loss is computed from the trained variables using only the test data, and accordingly, the training loss is computed purely using the training data.
218
+
219
+ Moreover, when performing inference on test data using Eq. (10), we use the covariances $A , L , K$ and expectations $\Theta _ { j }$ (Equ. (9)) built from the training data only.
220
+
221
+ # 5.1 INFERENCE ON OCCLUDED MNIST
222
+
223
+ In this experiment, we use the left and right halves of the MNIST digit images as correlated variables $X$ and $Y$ . The goal is to obtain the expected left halves given the right halves, or vice versa.
224
+
225
+ The training set was augmented by random small rotations and displacements to make the task more ambiguous, as we want to explore the uncertainty in the prediction.
226
+
227
+ The relevant variables were represented by two convolutional neural networks of identical architecture. They are composed of four convolutional layers and one fully connected layer, an architecture that performs well for supervised learning on this dataset. For ease of implementation, these CNN have the whole image as input, but with either half zeroed (same value as black pixels). Half-width CNNs with proper padding at the cut perform similarly.
228
+
229
+ After training, we used the training dataset to also compute the expected pixel gray value as well as their covariance for each relevant variable using Eq. (9).
230
+
231
+ These were used into Eq. (10) to compute the mean pixel gray values and their covariances over the conditional probability of $X$ given $Y$ on test data. This mean is the Bayesian estimator for the $l ^ { 2 }$ distance between half images, i.e., it should minimize the expected distance $d _ { l ^ { 2 } }$ over the conditional distribution, where $\begin{array} { r } { d _ { l ^ { 2 } } ^ { 2 } ( x , \overline { { y } } ) = \sum _ { i } ( x _ { i } - y _ { i } ) ^ { 2 } } \end{array}$ , where $x _ { i } \in [ 0 , 1 ]$ is the value of the $\mathrm { i } ^ { t h }$ pixel. (This is equivalent to minimizing the mean square error).
232
+
233
+ The results on a randomly selected subset of test digits is shown in Fig. 1. For each example, we also computed the images obtained by adding plus or minus one standard deviation along the direction of greatest variance in the space of relevant variables. This reveals the main ambiguities (such as between 8 and 3 or 7 and 9 which share a similar right half).
234
+
235
+ The graph of the singular values shows that the rank cutoff of 200 is too low to capture all of the relevant variables (the sudden drop at the end is not robust to an increase in the cutoff), but the results are reasonable nevertheless. This shows that our representation of the conditional distributions contains valuable information besides the simple mean.
236
+
237
+ # 5.2 SUPERVISED LEARNING
238
+
239
+ In the context of a supervised classification task, one of the dataset (the labels) is of sufficiently low dimensionality that we can use a complete basis over its probability space as our relevant variables, such as the standard one-hot encoding of labels. This serves as a good first sanity test for our approach. Surprisingly, we find that it converges faster than standard approaches, and without the need for regularization.
240
+
241
+ Let the variable $Y$ stands for the labels, with values in $\{ 1 , \ldots , k \}$ . The probability space consists of vectors with $k$ real components. The canonical basis corresponds to the one-hot encoding $g _ { i } ( j ) =$ $\delta _ { i j }$ (Kronecker delta). All we need is a neural network to encode $k$ variables $f _ { 1 } , \ldots , f _ { k }$ on $X$ . After learning the most relevant variables $f _ { i }$ , we apply the reverse of Eq. (10) for function $\Theta ( y ) = y$ , and use the maximum component of expected value $\overline { y }$ to infer the labels from the data.
242
+
243
+ Let us refer to this procedure as DCCI (Deep Canonical Correlations based Inference).
244
+
245
+ We tested this approach on the MNIST and CIFAR10 datasets, and compared the results to the standard cross-entropy objective (Fig. 2).
246
+
247
+ We plotted the accuracy as function of the epoch rather than clock time which would depend on many factors. But the time per epoch is roughly the same for each approaches in the above experiments. Indeed, the training time is dominated by the forward and backward evaluations of the neural networks which are identical. (However, the time it takes to evaluate our objective can become significant for much larger number of labels $k$ , since it involves the inversion of matrices of dimension $k$ . This is in addition to the fact that a greater dimension would require also larger batches.)
248
+
249
+ We found that, without regularization, simply changing the objective from cross-entropy to DCCI provided a large improvement both of convergence speed and final accuracy for both models.
250
+
251
+ ![](images/201f3ce00c47dbafcb9ef33dbcddfe321ec4b0f6d68f48039079f27a17681d75.jpg)
252
+ Figure 1: Left mosaic: the left halves of the MNIST digits in a random sample from the test set are inferred from the right half, with cutoff $k _ { 0 } = 2 0 0$ . Three images are shown for each digit. Within each triplet, the middle image represents the mean over pixel intensity of the inferred condition distribution, while left and right images corresponds to a plus and minus one standard deviation from the mean in the direction of largest covariance (in the space of half-images). A particularly interesting example is highlighted. Top-right: loss per epoch for $k _ { 0 } ~ = ~ 2 0 0$ . Bottom-right: the singular values for different values of the cutoff $k _ { 0 }$ , after 150 epochs in each case.
253
+
254
+ ![](images/f1a73e5112ee1b5d1d1b809be05b2c39b82dfe510aa9cbf963a2647ac4f9eb88.jpg)
255
+ Figure 2: Loss and inaccuracy (error rate) on test sets for two classification tasks. The models were trained either using the cross-entropy (CE) or our approach (DCCI), with or without regularization layers. On the MNIST dataset, we used an “all CNN” network, and for the CIFAR10 dataset we used a short VGG variation with 10 convolutions and 3 fully connected layers. In the regularized form, post-activation Batchnorm layers were placed after each convolutional layers on the VGG network. What is shown is the mean over 10 independent runs for MNIST and 5 runs for CIFAR10. The shaded area spans the standard deviation. ADAM with default parameters was used in all cases. No data augmentation was used except for horizontal flips for CIFAR10 (resulting in epochs of 100,000 images).
256
+
257
+ ![](images/03b9882c59b4695eeffc013e7377800c0cf409c81087a146cf7fe4fc6b062c90.jpg)
258
+ Figure 3: Top-left: First 20 relevant variables (on $X$ ) determined by DCCA for a system where $X$ consists of two coordinates uniformly sampled over a circle and a surrounding ring, and $Y$ consists of the same points but shifted by a small normally distributed vector. The variables are arranged from left-to-right and top-to-bottom in order of decreasing relevance. Top-right: the same variables multiplied by the marginal $p _ { X }$ . Bottom row: introducing a gap in the ring allows for a monotonous function of the angle to serve as second most relevant variable (instead of the sine/cosine couple). Hence the angle is automatically “disentangled” from the other variables. (Mid-gray represents the value 0).
259
+
260
+ On MNIST, DCCI alone also outperformed cross-entropy with dropout. (Dropout did not yield any improvement in conjunction with DCCI). However, adding batch-normalization layers on the CIFAR example, erased any distinction between DCCI and cross-entropy.
261
+
262
+ # 5.3 STRUCTURE OF THE RELEVANT VARIABLES
263
+
264
+ We mentioned in Section 3 that if $p ( x , y )$ is a two-dimensional Gaussian distribution with zero mean, then the $n$ most relevant variables of $X$ are the first $n$ powers of $X$ itself, independently of the covariance matrix. This implies that the canonical variables are the Hermite polynomials in $X$ (which results from applying the Gram-Schmidt procedure to the basis $\{ 1 , x , x ^ { 2 } , \bar { . . . } \bar \} \}$ .
265
+
266
+ A similar property holds for multivariate Gaussians, namely, the less relevant singular values are polynomials in the more relevant ones. If this is true more generally, it should be possible to further compress and organize the latent space extracted with DCCA by finding a minimal set of generators, which ought to also be in the span of the most relevant variables.
267
+
268
+ We applied DCCA to a synthetic dataset to explore this idea, shown in Fig. 3. In this case, we actually performed a final SVD to obtain the unique uncorrelated canonical variables, and ordered them by decreasing relevance (their respective singular values).
269
+
270
+ Here, $X$ consists of two real numbers, distributed uniformly within a ring and a disk. The variable $Y$ is obtained by adding a random Gaussian shift to $X$ with a small standard deviation. The more relevant variables ought to be those which are more robust to such small random displacement. This formalizes the idea that we are interested in extracting “large-scale” variables Beny (2018b). ´
271
+
272
+ We would expect the relevant independent variables to be: the binary variable indicating whether the point is in the disk or the ring and the angle around the ring, followed by the radial component in the ring, and finally the Cartesian coordinates inside the disk. This is precisely what we see in Fig. 3.
273
+
274
+ Indeed—if we put aside for now the fact that the angle itself is not directly represented—besides the constant function, the two most relevant variables are the sine and cosine of the angle, followed by the binary variable separating the disk from the ring.
275
+
276
+ But these variables ought to span the space of probabilities over the relevant variables, not just the variables themselves. Hence the next six variables are sines and cosines of smaller wavelength, which can encode probability distributions which are increasingly more precisely localized, down to a precision (wavelength) comparable with the diameter of the inner disk. Accordingly, the next two most relevant variables are the Cartesian coordinates inside the disk. This is followed by additional moments of the angle, down to a wavelength equal to the ring’s thickness, at which point we see the radius in the ring appear.
277
+
278
+ ![](images/139ed066324617d38572ae37b20db57c2963cbc5f2e6fcfe36fcf651198597fd.jpg)
279
+ Figure 4: Left: Best mean squared error for images reconstructed from the $k$ most relevant variables, as a function of $k$ (the latent dimension). This logarithmic plot shows that improvements stop once the dimension reaches 19 (where the two lines cross). Right: images produced by the generator from latent variables sampled according to the best Gaussian fit in latent space, for feature subspaces of dimensions 2, 8 and 19.
280
+
281
+ As mentioned, we see that the angle itself is not represented, likely because it is discontinuous. However, as shown also in Fig. 3, creating a gap in the ring allows for the angle to emerge as most relevant variable. This suggests that this approach may be able to automatically learn intrinsic coordinates of the latent variable manifold.
282
+
283
+ # 5.4 INDEPENDENT VARIABLES AND GENERATIVE MODEL
284
+
285
+ If we postulate that the independent (or disentangled) relevant latent variables can be found in the linear span of the relevant variables, we can attempt to extract them by optimizing a neural network composed of two parts. Firstly, a linear layer maps the relevant variables to a small number of outputs (equal to the latent dimension). The purpose of this linear layer is to find the independent variables. These latent variables are then processed by an arbitrarily complex generative network to produce a possible value of the variable $X$ . As objective function, we may us an appropriate measure of similarity between the output and the data element from which the variables were obtained.
286
+
287
+ We tested this idea as follows. We took $X$ to consist of the MNIST digits, and produced $Y$ by randomly permuting neighboring pixels in the image, until the mean displacement per pixel is of order 1. In addition, we added independent Gaussian noise to the pixel values. (Hence the noise map $\mathcal { N }$ simulates the coarse-graining channel introduced in Beny & Osborne (2015a)). ´
288
+
289
+ As in the previous experiment, we do so to implement our intuition that the more relevant variables ought to be the ones which are of larger scale, or more robust to local perturbations.
290
+
291
+ The relevant variables of the clean images were produced by the same convolutional neural network as in Section 5.2, while the variables of the coarse-grained images were extracted by a network of the same geometry, but with half the number of filters and neurons.
292
+
293
+ We extracted the 1000 most relevant out of 1200 learned variables in this way. (The least relevant variables in this system happen to be highly dependent on the total number of variables and hence cannot be trusted to be correct). As a second step, we trained a linear layer coupled to a network composed of 5 fully-connected layers of 800 hidden neurons each. We refer to the number of output neurons in the first linear layer as the latent dimension.
294
+
295
+ As input, this network received the variables extracted from MNIST images using the above convolutional neural net (after it was fully trained using DCCA), and was trained to minimize the mean square error between its output and the original MNIST digit.
296
+
297
+ The resulting best mean square errors are shown in Fig. 4, as function of the latent dimension. Here we see a distinct change of polynomial scaling law at dimension 19. Increasing the dimension further provides no improvement. This behaviour is compatible with our hypothesis that the extra variables are just functions of those first twenty variables (functions which are effectively re-implemented by the generative network).
298
+
299
+ Images generated by sampling from a Gaussian approximation of the latent distribution for different latent dimensions are shown in Fig. 4. Below dimension 20, most generated image can be recognized as a specific digit.
300
+
301
+ # 6 OUTLOOK
302
+
303
+ We studied the classical (non-quantum) form of the theory introduced in Beny & Osborne (2013), ´ and found that the relevant observables of that theory are just the most correlated canonical variables in the sense of DCCA Andrew et al. (2013), and can be learned effectively using standard machine learning methods.
304
+
305
+ This point of views on DCCA provided us with several new insights. The first is that the learned relevant variables provide a useful representation of a joint probability distribution. We showed that performing inference using this representation can outperform crossentropy in predicting classes. Our experiments on halves of MNIST also show that the conditional distribution we obtain can effectively represent the uncertainty in the prediction of high-dimensional data.
306
+
307
+ A second insight relates to the interpretation of the canonical variables as spanning directions in the space of probability distributions. As suggested by the gaussian solutions and our experiment on synthetic data, we postulate that the canonical variables are functions of a small number of independent generators contained in their span. This hypothesis is supported by our experiment on MNIST, but further work is required to find a way to cleanly extract these variables.
308
+
309
+ We have yet to explore the potential applications of one of the salient aspect of this approach to inference, the fact that the canonical variables learned using DCCA are also those which can be most reliably predicted, irrespective of the value of the cutoff. To see why this is potentially significant, we observe that a central feature of scientific exploration is that we are not so concerned with making predictions about some given variables, as much as we are with discovering variables which can be predicted.
310
+
311
+ Another important feature of this approach is the fact that the resulting model allows for the direct evaluation of the expectation values in the posterior distribution without sampling. In particular this allows for the evaluation of credible intervals. Hence it should be especially suited to scientific applications where the ability to quantify uncertainty is essential.
312
+
313
+ Finally, the relationship that we established with theory of quantum origin points towards a potential quantum generalization of DCCA that would apply to quantum data, or classical measurements of quantum systems.
314
+
315
+ # ACKNOWLEDGMENTS
316
+
317
+ We would like to thank Joel B ¨ eny and Raban Iten for helpful suggestions. We are also in- ´ debted to an anonymous ICLR2020 referee for pointing out the connection between our approach and DCCA. This work was supported by the National Research Foundation of Korea (NRF2018R1D1A1A02048436).
318
+
319
+ # REFERENCES
320
+
321
+ Galen Andrew, Raman Arora, Jeff Bilmes, and Karen Livescu. Deep canonical correlation analysis. In International conference on machine learning, pp. 1247–1255, 2013.
322
+
323
+ C. Beny and T. J. Osborne. Information geometric approach to the renormalisation group. ´ Phys. Rev. A, 92:022330, 2015a. doi: 10.1103/PhysRevA.92.022330. (arXiv:1206.7004).
324
+ Cedric B ´ eny. Coarse-grained distinguishability of field interactions. ´ Quantum, 2:67, 2018a. (arXiv:1509.03249).
325
+ Cedric B ´ eny. Inferring relevant features: from qft to pca. ´ International Journal of Quantum Information, 16:1840012, 2018b. (arXiv:1802.05756).
326
+ Cedric B ´ eny and Tobias J Osborne. Renormalisation as an inference problem. ´ (arXiv:1310.3188), 2013.
327
+ Cedric B ´ eny and Tobias J Osborne. The renormalisation group via statistical inference. ´ New J. Phys., 17:083005, 2015b. doi: 10.1088/1367-2630/17/8/083005. (arXiv:1402.4949).
328
+ GK Eagleson. Polynomial expansions of bivariate distributions. The Annals of Mathematical Statistics, 35(3):1208–1215, 1964.
329
+ Carl Eckart and Gale Young. The approximation of one matrix by another of lower rank. Psychometrika, 1(3):211–218, 1936.
330
+ Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in neural information processing systems, pp. 2672–2680, 2014.
331
+ Karol Gregor, Ivo Danihelka, Andriy Mnih, Charles Blundell, and Daan Wierstra. Deep autoregressive networks. arXiv preprint arXiv:1310.8499, 2013.
332
+ Harold Hotelling. Relations between two sets of variates. Biometrika, 28(3/4):321–377, 1936.
333
+ Mike Innes. Flux: Elegant machine learning with julia. Journal of Open Source Software, 2018. doi: 10.21105/joss.00602.
334
+ Raban Iten, Tony Metger, Henrik Wilming, L´ıdia Del Rio, and Renato Renner. Discovering physical concepts with neural networks. (arXiv:1807.10300), 2018.
335
+ Diederik P Kingma and Max Welling. Auto-encoding variational bayes. (arXiv:1312.6114), 2013.
336
+ HO Lancaster. The structure of bivariate distributions. The Annals of Mathematical Statistics, 29 (3):719–736, 1958.
337
+ Tomer Michaeli, Weiran Wang, and Karen Livescu. Nonparametric canonical correlation analysis. In International Conference on Machine Learning, pp. 1967–1976, 2016.
338
+ Mehdi Mirza and Simon Osindero. Conditional generative adversarial nets. arXiv preprint arXiv:1411.1784, 2014.
339
+ M. Ohya and D. Petz. Quantum entropy and its use. Springer Verlag, 2004.
340
+ Amichai Painsky, Meir Feder, and Naftali Tishby. An information-theoretic framework for nonlinear canonical correlation analysis. arXiv preprint arXiv:1810.13259, 2018.
341
+ Weiran Wang, Xinchen Yan, Honglak Lee, and Karen Livescu. Deep variational canonical correlation analysis. arXiv preprint arXiv:1610.03454, 2016.
342
+ Junbo Zhao, Michael Mathieu, and Yann LeCun. Energy-based generative adversarial network. arXiv preprint arXiv:1609.03126, 2016.
343
+
344
+ # A EXTRA INFORMATION ABOUT THE ALGORITHM
345
+
346
+ # A.1 ALTERNATIVE INTERPRETATION OF THE OBJECTIVE
347
+
348
+ If we write $F _ { i j } : = f _ { j } ( x _ { i } )$ and $G _ { i j } : = g _ { j } ( y _ { i } )$ for the value of our variables on the dataset, then $\begin{array} { r } { K = \frac { 1 } { N } F ^ { \top } F } \end{array}$ , $\begin{array} { r } { L = \frac { 1 } { N } G ^ { \top } G } \end{array}$ and $\begin{array} { r } { A = \frac { 1 } { N } G ^ { \top } F } \end{array}$ . The DCCA objective can then be written as
349
+
350
+ $$
351
+ \operatorname { T r } \left( K ^ { - 1 } A ^ { \top } L ^ { - 1 } A \right) = \operatorname { T r } \left( P Q \right)
352
+ $$
353
+
354
+ where $P = F ( F ^ { \top } F ) ^ { - 1 } F ^ { \top }$ and $Q = G ( G ^ { \top } G ) ^ { - 1 } G ^ { \top }$ are the projectors on the ranges of $F$ and $G$ respectively. Hence, we are maximizing the overlap between those ranges (which represent possible linear combinations of datapoints, respectively determined from variables of one or the other correlated views.)
355
+
356
+ # A.2 HEURISTIC
357
+
358
+ Batch size—In our experiments, we observed that the batch size during training needs to be an order of magnitude larger than the number of variables (rank cutoff). When the batch size was too small, learning seemed to converge normally in terms of training and test loss, but resulted in variables which yield dramatically different losses when evaluated on larger batches, and yield spurious predictions.
359
+
360
+ Constant variables—The loss function $C$ takes value between 0 and $k _ { 0 } - 1$ because the constant variable always has relevance 1. The constant variable could be enforced a priori rather than learned, which, due to the objective, automatically forces the learned variables to have zero expectation values (be orthogonal to the constant variable). This might have advantages in certain circumstances, but in our experiments we found that this sometime hindered convergence.
361
+
362
+ Invertibility issues—The covariance matrices $K$ and $L$ can be ill-conditioned, potentially causing the gradient to “explode” because of the inverses $K ^ { - 1 }$ et $L ^ { - 1 }$ involved in the loss function. This can be avoided either by using the Moore-Penrose pseudo-inverse, or by replacing $K ^ { - 1 }$ by $( K + \epsilon { \bf 1 } ) ^ { - 1 }$ in the loss for some small positive number $\epsilon$ , and likewise for $L ^ { - 1 }$ .
363
+
364
+ Symmetries in the loss function—The loss $C$ only depends on the span of the variables $f _ { i }$ and $g _ { j }$ , hence it has a very large group of symmetries. In particular, it is invariant under a change of the norm of each variable independently from each other. Because of that, it is preferable not to have a linear last layer. Using a hyperbolic tangent as last nonlinearity worked in our experiments.
365
+
366
+ Regularization—In all our tests, dropout had no beneficial effect. In fact, our objective seems to already provide a form of regularization, as shown in Section 5.2.
367
+
368
+ # B THEORY IN MORE DETAILS
369
+
370
+ We consider two correlated random variables $X$ and $Y$ with a joint probability distribution $p ( x , y )$ . We assume that we are able to numerically evaluate expectations with respect to this distribution, for instance because we can sample from it. We want to use this ability in order to compute expectations with respect to the conditional distributions $p _ { X | Y } ( x | y ) \ : = \ : \dot { p } ( x , y ) / p _ { X } ( x )$ and $p _ { Y | X } ( y | x ) ~ = ~ p ( x , y ) / p _ { Y } ( y )$ , where $\begin{array} { r } { p _ { X } ( x ) \ = \ \sum _ { y } p ( x , y ) } \end{array}$ and $\begin{array} { r } { p _ { Y } ( y ) \ = \ \sum _ { x } p ( x , y ) } \end{array}$ are the marginals of $p$ . Below we sometime remove the subscripts $X , X | Y$ or $Y | X$ if there is no ambiguity.
371
+
372
+ For instance, suppose we generated samples of $y$ given $x$ , through explicit knowledge of $p _ { Y \mid X }$ . Then the evaluation of expectations with respect to $p _ { X | Y }$ is the subject of Bayesian inference. However, this is generally done in a context where the variable $X$ has low dimensionality and parameterizes a hand-crafted model. Our approach, however, is free of such a model and the variable $X$ can be of very high dimensionality.
373
+
374
+ # B.1 INNER PRODUCT ON PROBABILITY VECTORS
375
+
376
+ In order to define our strategy, we need to equip the spaces of probability distributions for $X$ and $Y$ with an inner product structure. Let us focus on $X$ , and assume that it takes discrete values to avoid unnecessary technicalities. The set of probability vectors is a convex subset of the real linear space $V _ { X } = \mathbb { R } ^ { n }$ . Let us equip this space with the product
377
+
378
+ $$
379
+ \langle \mu , \mu ^ { \prime } \rangle _ { X } : = \sum _ { x } { \frac { \mu ( x ) \mu ^ { \prime } ( x ) } { p _ { X } ( x ) } }
380
+ $$
381
+
382
+ for any $\mu , \mu ^ { \prime } \in V _ { X }$ . We also write $\| \mu \| _ { X } ^ { 2 } = \langle \mu , \mu \rangle _ { X }$ . Importantly, this depends explicitly on the fixed probability vector $p _ { X } ( x )$ , which we took to be the marginal of $p ( x , y )$ . If $p _ { X }$ has full support, this makes $V _ { X }$ into a real inner product space. The same can be done for the variable $Y$ , yielding the inner product $\langle \nu , \nu ^ { \prime } \rangle _ { Y }$ for $\nu , \nu ^ { \prime } \in V _ { Y }$ .
383
+
384
+ Had we interpreted $\mu$ and $\mu ^ { \prime }$ as tangent vectors to $V _ { X }$ , considered as a manifold, this would be the Fisher information (Riemannian) metric, as in Beny & Osborne (2015b). But this quantity is also ´ meaningful for finite vectors: the induced norm distance between $p _ { X }$ and any probability vector $q$ is the $\chi ^ { 2 }$ -divergence:
385
+
386
+ $$
387
+ \chi ^ { 2 } ( q , p _ { X } ) = \langle q - p _ { X } , q - p _ { X } \rangle _ { X } .
388
+ $$
389
+
390
+ The set of conditional probability distributions $p _ { Y \mid X }$ form a stochastic map, i.e., a linear map $\mathcal { N }$ $V _ { X } \to V _ { Y }$ , $\mu \mapsto { \mathcal { N } } ( \mu )$ , where
391
+
392
+ $$
393
+ \mathcal { N } ( \mu ) ( y ) = \sum _ { x } p _ { Y | X } ( y | x ) \mu ( x )
394
+ $$
395
+
396
+ for any $\mu \in V _ { X }$ .
397
+
398
+ It is straightforward to check that the stochastic map $\mathcal { N } ^ { * }$ defined by
399
+
400
+ $$
401
+ \mathcal { N ^ { * } } ( \nu ) ( x ) = \sum _ { x } p _ { X | Y } ( x | y ) \nu ( x )
402
+ $$
403
+
404
+ is the transpose $\mathcal { N } ^ { * }$ of $\mathcal { N }$ with respect to the inner products we defined (Ohya & Petz, 2004), i.e., for all $\nu \in V _ { Y }$ and $\mu \in V _ { X }$ ,
405
+
406
+ $$
407
+ \langle \nu , \mathcal { N } ( \mu ) \rangle _ { Y } = \langle \mathcal { N } ^ { * } ( \nu ) , \mu \rangle _ { X } .
408
+ $$
409
+
410
+ Also, we observe that $\mathcal { N } ( p _ { X } ) = p _ { Y }$ and $\mathcal { N } ^ { * } ( p _ { Y } ) = p _ { X }$ .
411
+
412
+ # B.2 EIGEN-RELEVANCE DECOMPOSITION
413
+
414
+ We can use the inner products on $V _ { X }$ and $V _ { Y }$ to define a singular value decomposition of the stochastic map $\mathcal { N }$ . That is, there is an orthonormal family $u _ { 1 } , \ldots , u _ { k }$ of $V _ { X }$ and an orthonormal family $v _ { 1 } , \ldots , v _ { k }$ of $V _ { Y }$ , such that
415
+
416
+ $$
417
+ \begin{array} { r } { \mathcal { N } ( u _ { j } ) = \eta _ { j } v _ { j } , } \end{array}
418
+ $$
419
+
420
+ for $j = 1 , \dotsc , k$ . For each $j , \eta _ { j }$ is a singular value of $\mathcal { N }$ , whose square we call the relevance of the vector $v _ { j }$ . Moreover $\eta _ { j } \in [ 0 , 1 ]$ since the $\chi ^ { 2 }$ divergence is contractive under any stochastic map. Given that ${ \ddot { \mathcal { N } } } ^ { * }$ is the transpose of $\mathcal { N }$ :
421
+
422
+ $$
423
+ \begin{array} { r } { \mathcal { N } ^ { * } ( v _ { j } ) = \eta _ { j } u _ { j } . } \end{array}
424
+ $$
425
+
426
+ Equivalently, $u _ { j }$ is an eigenvector of $\mathcal { N } ^ { \ast } \circ \mathcal { N }$ and $v _ { j }$ is an eigenvectors of $\mathcal { N } \circ \mathcal { N } ^ { \ast }$ , both with eigenvalue $\eta _ { j } ^ { 2 }$ .
427
+
428
+ Because $\mathcal { N }$ maps $p _ { X }$ to $p _ { Y }$ , we always have the dual eigenvectors $u _ { 0 } ~ = ~ p _ { X }$ and $v _ { 0 } = p _ { Y }$ with eigenvalue 1.
429
+
430
+ # B.3 LOW-RANK APPROXIMATION
431
+
432
+ Typically, the dimension $k$ of the space of probabilities is more than astronomically large. For instance, if the values of $X$ consists of small 256 gray level images of $2 8 \times 2 8$ pixels, then $k =$
433
+
434
+ $2 5 6 ^ { 2 8 ^ { 2 } } \simeq 1 0 ^ { 1 8 8 8 }$ . However, in many case, only very few of these dimensions may be relevant for the purpose of inferring other variables.
435
+
436
+ The core of our approach is to approximate $\mathcal { N }$ and $\mathcal { N } ^ { * }$ by restricting them to the span of the first $k _ { 0 }$ eigenvectors $u _ { j }$ and $v _ { j }$ with largest singular values $\eta _ { j }$ . That is, if we order the singular values $\eta _ { j }$ , $j = 1 , \dots , k$ in decreasing order, we propose to use the approximations
437
+
438
+ $$
439
+ \begin{array} { l } { { \displaystyle \mathcal { N } _ { 0 } ( \mu ) = \sum _ { j \leq k _ { 0 } } \eta _ { j } \langle u _ { j } , \mu \rangle _ { X } v _ { j } } } \\ { { \displaystyle \mathcal { N } _ { 0 } ^ { * } ( \nu ) = \sum _ { j \leq k _ { 0 } } \eta _ { j } \langle v _ { j } , \nu \rangle _ { Y } u _ { j } } } \end{array}
440
+ $$
441
+
442
+ to $\mathcal { N }$ and $\mathcal { N } ^ { * }$ respectively, for some $k _ { 0 }$ typically much smaller than $k$ , and any $\mu \in V _ { X }$ , $\nu \in V _ { Y }$ .
443
+
444
+ We denote the components of $\mathcal { N } _ { 0 }$ and $\mathcal { N } _ { 0 } ^ { \ast }$ by $q ( y | x )$ and $q ( x | y )$ , e.g.,
445
+
446
+ $$
447
+ { \mathcal { N } } _ { 0 } ( \mu ) ( y ) = \sum _ { x } q ( y | x ) \mu ( x ) .
448
+ $$
449
+
450
+ Since $\mathcal { N } _ { 0 }$ and $\mathcal { N } _ { 0 } ^ { \ast }$ are adjoint, we can define $q ( x , y ) = q ( x | y ) p _ { Y } ( y ) = q ( y | x ) p _ { X } ( x )$ . Although the marginals of $\dot { \boldsymbol { q } } ( \boldsymbol { x } , \boldsymbol { y } )$ are the probability distributions $p _ { X }$ and $p _ { Y }$ , the numbers $q ( x , y )$ are not necessarily positive.
451
+
452
+ The quality of this approximation for a given $k _ { 0 }$ does not directly depend on the dimensionality of $X$ and $Y$ , but only on the amount of correlations between the two variables. Our aim is to use a $k _ { 0 }$ small enough that the components of $\mathcal { N } _ { 0 }$ and $\mathcal { N } _ { 0 } ^ { \ast }$ can be computed explicitly.
453
+
454
+ Theorem 1. $\mathcal { N } _ { 0 }$ is the map of rank $k _ { 0 }$ which minimizes the average distance
455
+
456
+ $$
457
+ \sum _ { x } p ( x ) \| \mathcal { N } _ { 0 } ( \delta _ { x } ) - \mathcal { N } ( \delta _ { x } ) \| _ { Y } ^ { 2 } = \sum _ { x y } \frac { ( q ( x , y ) - p ( x , y ) ) ^ { 2 } } { p ( x ) p ( y ) } .
458
+ $$
459
+
460
+ Proof. The low rank approximation $\mathcal { N } _ { 0 }$ minimizes the distance $\| \mathcal { N } _ { 0 } - \mathcal { N } \| _ { \mathrm { F } }$ where
461
+
462
+ $$
463
+ \| \mathcal { M } \| _ { F } ^ { 2 } = \mathrm { T r } \left( \mathcal { M } ^ { * } \mathcal { M } \right)
464
+ $$
465
+
466
+ is the Hilbert-Schmidt (or Frobenius) norm (Eckart & Young, 1936). This follows from the fact that this is also the $l ^ { 2 }$ -norm of the vector of singular values of $\mathcal { M }$ . Let us find the explicit form of the trace. Each possible value $x$ of the variable $X$ is associated with a probability distribution $\delta _ { x } ( y ) = 1$ when $x = y$ and zero otherwise. These distributions form an orthogonal basis of $V _ { X }$ , and have norms $\langle \delta _ { x } , \delta _ { x } \rangle = 1 / p _ { X } ( x )$ . Therefore,
467
+
468
+ $$
469
+ \begin{array} { l } { \displaystyle \operatorname { T r } \left( \mathcal { M ^ { * } M } \right) = \sum _ { x } p _ { X } ( x ) \langle \delta _ { x } , \mathcal { M ^ { * } M } ( \delta _ { x } ) \rangle _ { Y } } \\ { \displaystyle \quad = \sum _ { x } p _ { X } ( x ) \| \mathcal { M } ( \delta _ { x } ) \| _ { Y } ^ { 2 } } \end{array}
470
+ $$
471
+
472
+ # B.4 RELEVANT VARIABLES
473
+
474
+ We express the elements $\mu \in \ V _ { X }$ and $\nu \in \ V _ { Y }$ in terms of the marginals $p _ { X }$ and $p _ { Y }$ as simple products:
475
+
476
+ $$
477
+ \mu ( x ) = p _ { X } ( x ) f ( x ) \quad { \mathrm { a n d } } \quad \nu ( y ) = p _ { Y } ( y ) g ( y )
478
+ $$
479
+
480
+ for all $x , y$ , where $f$ and $g$ are real functions of $x$ and $y$ .
481
+
482
+ The inner products then simply become correlations among variables. Using also $\mu ^ { \prime } = p _ { X } f ^ { \prime }$ and $\nu ^ { \prime } = p _ { Y } g ^ { \prime }$ , we obtain
483
+
484
+ $$
485
+ \begin{array} { l } { { \langle \mu , \mu ^ { \prime } \rangle _ { X } = \displaystyle \sum _ { x } p _ { X } ( x ) f ( x ) f ^ { \prime } ( x ) = \overline { { { f f ^ { \prime } } } } , } } \\ { { \langle \nu , \nu ^ { \prime } \rangle _ { Y } = \displaystyle \sum _ { y } p _ { Y } ( y ) g ( y ) g ^ { \prime } ( y ) = \overline { { { g g ^ { \prime } } } } . } } \end{array}
486
+ $$
487
+
488
+ These are simple expectation values with respect to $p$ , which we assumed is the type of quantity we can evaluate for arbitrary functions $f , f ^ { \prime } , g , \bar { g ^ { \prime } }$ .
489
+
490
+ Since $\mathcal { N } ^ { * } \mathcal { N }$ is self-adjoint in terms of this inner product, its eigenvectors $u _ { i }$ are orthogonal, and hence the corresponding variables $a _ { i }$ defined by ${ u } _ { i } \bar { ( x ) } = p _ { X } ( x ) \bar { a _ { i } } ( x )$ are uncorrelated. Indeed,
491
+
492
+ $$
493
+ \overline { { a _ { i } a _ { j } } } = \langle u _ { i } , u _ { j } \rangle _ { X } = 0 ,
494
+ $$
495
+
496
+ for all $i , j$ . Moreover, accounting for the eigenvector $u _ { 0 } = p _ { X }$ (corresponding to the constant feature $a _ { 0 } ( x ) = 1$ for all $x$ ),
497
+
498
+ $$
499
+ \overline { { a } } _ { i } = 0
500
+ $$
501
+
502
+ for all $i \neq 0$ . Hence we trivially have
503
+
504
+ $$
505
+ \overline { { a _ { i } a _ { j } } } = \overline { { a } } _ { i } \overline { { a } } _ { j }
506
+ $$
507
+
508
+ for all $i , j \neq 0$ .
509
+
510
+ Likewise for the eigenvectors of $\mathcal { N N } ^ { * }$ . If $v _ { i } ( y ) = p _ { Y } ( y ) b _ { i } ( y )$ :
511
+
512
+ $$
513
+ \overline { { b _ { i } b _ { j } } } = \langle v _ { i } , v _ { j } \rangle _ { Y } = 0 = \overline { { b } } _ { i } \overline { { b } } _ { j } .
514
+ $$
515
+
516
+ for all $i , j \neq 0$ .
517
+
518
+ Importantly, this does not mean that the variables $u _ { 1 } , u _ { 2 } , \ldots$ nor $v _ { 1 } , v _ { 2 } , \ldots$ are “disentangled”, i.e., they are not statistically independent. These variables represent components in the space of probability vectors, rather than the “sample” space. They should be understood as spanning a subspace of the space of functions over the relevant independent variables. We discuss this in more detail in Section 5.3.
519
+
520
+ # B.5 CORNERS OF $\mathcal { N }$ AND LOSS FUNCTION
521
+
522
+ The final piece of puzzle we need, is the ability to express the components (corners) of $\mathcal { N }$ and $\mathcal { N } ^ { * }$ in the span of possible non-orthogonal families of variables.
523
+
524
+ Let us therefore consider two arbitrary families $f _ { 1 } , \ldots , f _ { k _ { 0 } }$ and $g _ { 1 } , \ldots , g _ { k _ { 0 } }$ of variables, which respectively represent the vectors $p _ { X } f _ { j } \in V _ { X }$ and $p _ { Y } g _ { j } \in V _ { Y }$ .
525
+
526
+ Firstly, we need matrices representing the components of the inner products on $V _ { X }$ and $V _ { Y }$ . Those are the symmetric matrices
527
+
528
+ $$
529
+ \begin{array} { r } { K _ { i j } = \langle p _ { X } f _ { i } , p _ { X } f _ { j } \rangle _ { X } = \overline { { f _ { i } f _ { j } } } , } \\ { L _ { i j } = \langle p _ { Y } g _ { i } , p _ { Y } g _ { j } \rangle _ { Y } = \overline { { g _ { i } g _ { j } } } . } \end{array}
530
+ $$
531
+
532
+ The components $N _ { i j }$ of $\mathcal { N }$ are defined by
533
+
534
+ $$
535
+ \mathcal { N } ( p _ { X } f _ { j } ) = \sum _ { i } N _ { i j } p _ { Y } g _ { i } .
536
+ $$
537
+
538
+ Taking the inner product with $p _ { Y } g _ { k }$ , we obtain
539
+
540
+ $$
541
+ \langle p _ { Y } g _ { k } , \mathcal { N } ( p _ { X } f _ { j } ) \rangle = \sum _ { i } N _ { i j } L _ { k i } .
542
+ $$
543
+
544
+ The left-hand side can be computed using Equ. 13. It is the matrix
545
+
546
+ $$
547
+ \begin{array} { l } { { \displaystyle { \cal A } _ { k j } = \langle p _ { Y } g _ { k } , { \cal N } ( p _ { X } f _ { j } ) \rangle } } \\ { { \displaystyle ~ = \sum _ { x , y } \frac { p _ { Y } ( y ) g _ { k } ( y ) p _ { Y | X } ( y | x ) p _ { X } ( x ) f _ { j } ( x ) } { p _ { Y } ( y ) } } } \\ { { \displaystyle ~ = \sum _ { x , y } p ( x , y ) g _ { k } ( y ) f _ { j } ( x ) = \overline { { g _ { k } f _ { j } } } . } } \end{array}
548
+ $$
549
+
550
+ Therefore, in matrix notation, Equ. (34) is $A = L N$ , or
551
+
552
+ $$
553
+ N = L ^ { - 1 } A .
554
+ $$
555
+
556
+ The components $N _ { i j } ^ { * }$ of $\mathcal { N } ^ { * }$ are obtained by just swapping $X$ and $Y$ , yielding
557
+
558
+ $$
559
+ N ^ { * } = K ^ { - 1 } A ^ { \top } .
560
+ $$
561
+
562
+ Hence the singular values of the corner of $\mathcal { N }$ defined by the variables $f _ { j }$ and $g _ { j }$ are just the squareroot of the eigenvalues of the matrix $N ^ { * } N = K ^ { - 1 } A ^ { \top } L ^ { - 1 } A$ . In order to find the variables $f _ { j }$ and $g _ { j }$ with the same span as the first $k _ { 0 }$ eigenvectors $u _ { j } , v _ { j }$ , we just need to maximize all the eigenvalues of $N ^ { * } N$ . A simple way to do this is to use (minus) the trace of $N ^ { * } N$ as loss function, since it is the sum of the square of the singular values. We call $\mathrm { T r } \left( N ^ { * } N \right)$ the relevance of the subspaces defines by the variables $f _ { j }$ ad $g _ { i }$ for all $i , j$ . This yields the loss/cost function:
563
+
564
+ $$
565
+ C = k _ { 0 } - \operatorname { T r } \left( N ^ { \ast } N \right) = k _ { 0 } - \operatorname { T r } \left( K ^ { - 1 } A ^ { \top } L ^ { - 1 } A \right) .
566
+ $$
567
+
568
+ Once optimal variables have been found, one can obtain the components of the eigenvectors in the span of $f _ { 1 } , \ldots , f _ { k _ { 0 } }$ through standard numerical diagonalization of $N ^ { * } N$ .
569
+
570
+ # B.6 INFERENCE
571
+
572
+ The variables minimizing $C$ can be used to infer one variable from the other. For instance, given $y$ , the inferred probability distribution over $x$ is given by $p _ { X | Y } ( x | y ) = \mathcal { N } ^ { * } ( \delta _ { y } ) ( x )$ , where $\delta _ { y } ( \bar { y } ^ { \prime } )$ is 1 when $y = y ^ { \prime }$ and zero otherwise. In order to compute this, we first need the components of the distribution $\delta _ { y }$ in terms of the family $p _ { Y } g _ { 1 } , \ldots , p _ { Y } g _ { k _ { 0 } }$ , i.e., the real numbers $( \delta _ { y } ) _ { j }$ such that
573
+
574
+ $$
575
+ \delta _ { y } ( y ^ { \prime } ) = p _ { Y } ( y ^ { \prime } ) \sum _ { i = 1 } ^ { k _ { 0 } } ( \delta _ { y } ) _ { i } g _ { i } ( y ^ { \prime } ) + r ( y ^ { \prime } ) ,
576
+ $$
577
+
578
+ where $\langle r , p _ { Y } \delta _ { i } \rangle _ { Y } = 0$ for all $i$ . Taking the inner product with $p _ { Y } g _ { j }$ , we obtain
579
+
580
+ $$
581
+ \langle p _ { Y } g _ { j } , \delta _ { y } \rangle _ { Y } = \sum _ { i = 1 } ^ { k _ { 0 } } ( \delta _ { y } ) _ { i } L _ { j i } ,
582
+ $$
583
+
584
+ where the left hand side is also just
585
+
586
+ $$
587
+ \langle p _ { Y } g _ { j } , \delta _ { y } \rangle _ { Y } = g _ { j } ( y ) .
588
+ $$
589
+
590
+ Therefore the components of $\delta _ { y }$ are explicitly
591
+
592
+ $$
593
+ ( \delta _ { y } ) _ { i } = \sum _ { j } ( L ^ { - 1 } ) _ { i j } g _ { j } ( y ) .
594
+ $$
595
+
596
+ It follows that
597
+
598
+ $$
599
+ \begin{array} { l } { { \displaystyle p _ { X | Y } ( x | y ) = \mathcal { N } ^ { * } ( \delta _ { y } ) ( x ) \approx \mathcal { N } _ { 0 } ^ { * } ( \delta _ { y } ) ( x ) } } \\ { { \displaystyle ~ = \sum _ { i j k } N _ { k i } ^ { * } ( L ^ { - 1 } ) _ { i j } g _ { j } ( y ) f _ { k } ( x ) . } } \end{array}
600
+ $$
601
+
602
+ Then, for instance, the expected inferred value of $X$ is
603
+
604
+ $$
605
+ \overline { { { x } } } = \sum _ { i j k } N _ { k i } ^ { * } ( L ^ { - 1 } ) _ { i j } g _ { j } ( y ) \sum _ { x } p _ { X } ( x ) x f _ { k } ( x ) .
606
+ $$
607
+
608
+ For the inference of $Y$ from $x$ , we have
609
+
610
+ $$
611
+ p _ { Y | X } ( y | x ) \approx \sum _ { i j k } N _ { k i } ( K ^ { - 1 } ) _ { i j } f _ { j } ( x ) g _ { k } ( y ) .
612
+ $$
613
+
614
+ # C ANALYTICAL EXAMPLE
615
+
616
+ When $p ( x , y )$ is any multivariate Gaussian distribution, everything can be computed analytically. Let us consider here the one-dimensional case. We use $p ( x ) \ \propto \ \exp { \left( - x ^ { 2 } / 2 \tau ^ { 2 } \right) }$ , and the conditional $\underline { { { p } } } ( y | x ) ~ \propto ~ \exp \left( - ( y - x ) ^ { 2 } / 2 \sigma ^ { 2 } \right)$ . That is, $y$ is equal to $x$ but with some added Gaussian noise. This gives
617
+
618
+ $$
619
+ p _ { X | Y } ( x | y ) \propto \exp \left( - \frac { ( x - \gamma y ) ^ { 2 } } { 2 \tau ^ { 2 } ( 1 - \gamma ) } \right) , \quad \mathrm { w h e r e } \quad \gamma = \frac { \tau ^ { 2 } } { \sigma ^ { 2 } + \tau ^ { 2 } } .
620
+ $$
621
+
622
+ It was show in Lancaster (1958), that the most relevant subspace of dimension $k _ { 0 }$ on the variable $X$ is simply spanned by the variables
623
+
624
+ $$
625
+ f _ { n } ( x ) = x ^ { n } ,
626
+ $$
627
+
628
+ $n = 0 , \ldots , k _ { 0 } - 1$ . Similarly for $Y$ ;
629
+
630
+ $$
631
+ g _ { n } ( y ) = y ^ { n } .
632
+ $$
633
+
634
+ This independence of the relevant variables on the detailed parameters of $p$ is a general property of Gaussian joint distributions.
635
+
636
+ This means, for instance, that the most relevant feature $( n = 1$ ) for predicting the value of $X$ given $Y = y$ is simply $Y$ itself. The higher order variables have to do with inferring extra aspects of the probability distribution over $X$ .
637
+
638
+ A set of orthogonal variables can be obtain from the Gram-Schmidt procedure, which, if done from small to large $n$ much necessarily yield the eigenvectors $u _ { n }$ and $v _ { n }$ . For illustration purpose, let us work with the non-orthogonal vectors $f _ { n }$ and $g _ { n }$ , keeping only the first $k _ { 0 } = 3$ vectors.
639
+
640
+ The three matrices (correlators) we need can be easily computed:
641
+
642
+ $$
643
+ \begin{array} { l c c } { { K = \left( \begin{array} { c c c } { { 1 } } & { { 0 } } & { { \tau ^ { 2 } } } \\ { { 0 } } & { { \tau ^ { 2 } } } & { { 0 } } \\ { { \tau ^ { 2 } } } & { { 0 } } & { { 3 \tau ^ { 4 } } } \end{array} \right) } } & { { L = \left( \begin{array} { c c c } { { 1 } } & { { 0 } } & { { \tau ^ { 2 } + \sigma ^ { 2 } } } \\ { { 0 } } & { { \tau ^ { 2 } + \sigma ^ { 2 } } } & { { 0 } } \\ { { \tau ^ { 2 } + \sigma ^ { 2 } } } & { { 0 } } & { { 3 ( \tau ^ { 2 } + \sigma ^ { 2 } ) ^ { 2 } } } \end{array} \right) } } \\ { { A = \left( \begin{array} { c c c } { { 1 } } & { { 0 } } & { { \tau ^ { 2 } } } \\ { { 0 } } & { { \tau ^ { 2 } } } & { { 0 } } \\ { { \tau ^ { 2 } + \sigma ^ { 2 } } } & { { 0 } } & { { \tau ^ { 2 } ( \sigma ^ { 2 } + 3 \tau ^ { 2 } ) } } \end{array} \right) . } } \end{array}
644
+ $$
645
+
646
+ We obtain
647
+
648
+ $$
649
+ M = K ^ { - 1 } A ^ { \top } L ^ { - 1 } A = \left( \begin{array} { c c c } { { 1 } } & { { 0 } } & { { \tau ^ { 2 } ( 1 - \gamma ^ { 2 } ) } } \\ { { 0 } } & { { \gamma } } & { { 0 } } \\ { { 0 } } & { { 0 } } & { { \gamma ^ { 2 } } } \end{array} \right) .
650
+ $$
651
+
652
+ The eigenvalues of $M$ can be read on the diagonal, and the corresponding eigenvectors are $( 1 , 0 , 0 )$ , $( 0 , 1 , \bar { 0 } )$ and $( - \tau ^ { 2 } , 0 , 1 )$ , which means that the eigenfunctions are in order $\bar { u } _ { 0 } ( x ) = 1$ , $u _ { 1 } ( x ) = x$ and u2(x) = x2 − τ 2.
653
+
654
+ Because we are working with continuous variables, the true rank of $\mathcal { N }$ is infinite, even for any finite cutoff on the singular values. Nevertheless, it is instructive to see how the approximate inference fares for rank $k _ { 0 } = 3$ . Given the value $y$ for $Y$ , the inferred distribution over $X$ is
655
+
656
+ $$
657
+ \mathcal { N } _ { 0 } ^ { * } ( \delta _ { y } ) ( x ) = p _ { X } ( x ) p _ { Y } ( y ) \sum _ { j , k = 0 } ^ { 2 } ( K ^ { - 1 } A ^ { \top } L ^ { - 1 } ) _ { k j } y ^ { j } x ^ { k } .
658
+ $$
659
+
660
+ The approximately inferred first and second moments of $X$ is given by integrating the above times $x$ (resp. $x ^ { 2 }$ ) over $x$ . We obtain
661
+
662
+ $$
663
+ { \overline { { x } } } = \gamma y \quad { \mathrm { a n d } } \quad { \overline { { x ^ { 2 } } } } = \gamma ^ { 2 } y ^ { 2 } + ( 1 - \gamma ) \tau ^ { 2 } ,
664
+ $$
665
+
666
+ which are actually exact: they are equal to the first two moments of $X$ over $p _ { X | Y }$ as given in Eq. (46).
667
+
668
+ In fact, it is easy to see that this would be true for the first $k _ { 0 } - 1$ moments had we kept the $k _ { 0 }$ most relevant variables.
md/train/SJgCEpVtvr/SJgCEpVtvr.md ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DYNAMIC SELF-TRAINING FRAMEWORK FOR GRAPH CONVOLUTIONAL NETWORKS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Graph neural networks (GNN) such as GCN, GAT, MoNet have achieved stateof-the-art results on semi-supervised learning on graphs. However, when the number of labeled nodes is very small, the performances of GNNs downgrade dramatically. Self-training has proved to be effective for resolving this issue, however, the performance of self-trained GCN is still inferior to that of G2G and DGI for many settings. Moreover, additional model complexity make it more difficult to tune the hyper-parameters and do model selection. We argue that the power of self-training is still not fully explored for the node classification task. In this paper, we propose a unified end-to-end self-training framework called Dynamic Self-traning, which generalizes and simplifies prior work. A simple instantiation of the framework based on GCN is provided and empirical results show that our framework outperforms all previous methods including GNNs, embedding based method and self-trained GCNs by a noticeable margin. Moreover, compared with standard self-training, hyper-parameter tuning for our framework is easier.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Graphs or networks can be used to model any interactions between entities such as social interactions (Facebook, Twitter), biological networks (protein-protein interaction), and citation networks. There has been an increasing research interest in deep learning on graph structured data, e.g., (Bruna et al., 2014; Defferrard et al., 2016; Monti et al., 2017; Kipf & Welling, 2017; Hamilton et al., 2017; Velickovic et al., 2018; Tang et al., 2015; Perozzi et al., 2014).
12
+
13
+ Semi-supervised node classification on graphs is a fundamental learning task with many applications. Classic methods rely on some underly diffusion process to propagate label information. Recently, network embedding approaches have demonstrate outstanding performance on node classification (Tang et al., 2015; Grover & Leskovec, 2016; Bojchevski & Günnemann, 2018). This approach first learns a lower-dimensional embedding for each node in an unsupervised manner, and then the embeddings are used to train a supervised classifier for node classification, e.g., logistic regression or multi-layer perceptron (MLP). Graph neural networks (GNN) are semi-supervised models and have achieved state-of-the-art performance on many benchmark data sets (Monti et al., 2017; Kipf & Welling, 2017; Velickovic et al., 2018). GNNs generalize convolution to graph structured data and typically have a clear advantage when the number of training examples is reasonably large. However, when there are very few labeled nodes, GNNs is outperformed by embedding based method (as shown by our experimental results), e.g., G2G from (Bojchevski & Günnemann, 2018) and DGI from (Velickovi ˇ c et al., 2019). ´
14
+
15
+ To overcome this limitation of GCNs (Kipf & Welling, 2017), Li et al. (Li et al., 2018) propose to apply self-training and co-training techniques (Scudder, 1965). The idea of these techniques is to augment the original training set by adding in some unlabeled examples together with their label predictions. Such “pseudo-label” information is either from the base model trained on the original training set (self-training) or another learning algorithm (co-training). The results from (Li et al., 2018) demonstrate the effectiveness of co-training and self-training. However, among the four variants implemented in (Li et al., 2018), there is not a single one that achieves the best performance across different settings; and from our experiments, G2G and DGI outperforms all the four variants when the number of labels from each class is less than 10. There are clear restrictions in prior self-training approaches. First, the pseudo-label set is incremental only, i.e., after an unlabeled example is added to the training set, it will never be deleted and its pseudo-label will never change even if its prediction and/or the corresponding margin has changed drastically. Secondly, all the pseudo-labels are considered equal, although they may have very different classification margins. Furthermore, it introduces extra hyper-parameters such as the number of unlabeled nodes to be added into the training set and the total number of self-training iterations. The performance gain is sensitive to such parameters and their optimal values may differ for different data sets and label rates (Buchnik & Cohen, 2018).
16
+
17
+ To fully understand and explore the power of self-training on the node classification task, we propose a novel self-training framework, named Dynamic Self-training, which is general, flexible, and easy to use. We provide a simple instantiation of the framework based on GCN (Kipf & Welling, 2017) and empirically show that it outperforms state-of-art methods including GNNs, self-trained GCN (Li et al., 2018), and embedding based methods. Our framework has the following distinguishing features compared with (Li et al., 2018; Buchnik & Cohen, 2018).
18
+
19
+ 1. We augment the training set and recalculate the pseudo-labels after each epoch. So the number self-training iterations is the same as the number of epochs and the pseudo-label assigned to an unlabeled example may change during the training process.
20
+ 2. In stead of inserting a fixed number of new pseudo-labels with highest margin in each iteration, we use a threshold-based rule, i.e., insert an unlabeled node if and only if its classification margin is above the threshold.
21
+ 3. The pseudo-label set is dynamic. When the margin of an unlabeled node is above the threshold, we activate it by adding it to the loss function, but if the margin of this node becomes lower than the threshold in a later epoch, we will deactivate it.
22
+ 4. We assign a (dynamic) personalized weight to each active pseudo-label proportional to its current classification margin. The total pseudo-label loss is thus the weighted sum of losses corresponds to all pseudo-labels.
23
+
24
+ # 2 PRELIMINARIES
25
+
26
+ # 2.1 GRAPH NOTATION AND PROBLEM DEFINITION
27
+
28
+ In the problem, we are given an undirected graph with node attributes $G = ( V , E , X )$ , where $V$ is the vertex set, $E$ is the edge set. Here, $X$ is the feature matrix, the $i$ -th row of which, denoted as $x _ { i }$ , is the feature vector of node $i$ . We assume each node belongs to exactly one class and use $y _ { i }$ to denote the class label of the $i$ -th node. The aim is to design learning algorithms to predict the labels of all nodes based on the labels of a small set of training nodes provided in the beginning. We use $\mathcal { N } _ { k } ( i )$ to denote the set of nodes whose distance to node $i$ is at most $k$ . $\mathcal { L } \subset V$ is the set of labeled nodes and $\mathcal { U } = V \setminus \mathcal { L }$ is the set of unlabeled nodes.
29
+
30
+ # 2.2 GRAPH CONVOLUTIONAL NETWORKS
31
+
32
+ GCN introduced in (Kipf & Welling, 2017) is a graph neural network model for semi-supervised classification. GCN learns the representations of each node by iteratively aggregating the embeddings of its neighbors. Specifically, GCN consists of $L > 0$ layers each with the same propagation rule defined as follows. In the $l$ -th layer, the hidden representations $H ^ { ( l - 1 ) }$ are averaged among one-hop neighbors as:
33
+
34
+ $$
35
+ H ^ { ( l ) } = \sigma ( \tilde { D } ^ { - \frac { 1 } { 2 } } \tilde { A } \tilde { D } ^ { - \frac { 1 } { 2 } } H ^ { ( l - 1 ) } W ^ { ( l ) } ) .
36
+ $$
37
+
38
+ Here, ${ \tilde { A } } = A + I _ { n }$ is the adjacency matrix of $G$ after adding self-loops ( $I _ { n }$ is the identity matrix), $\tilde { D }$ is a diagonal matrix with $\tilde { D _ { i i } } = \dot { \sum _ { j } { A _ { i j } } }$ , $W ^ { ( l ) }$ is a trainable weight matrix of the $l$ -th layer, and $\sigma$ is a nonlinear activation function; $\dot { H ^ { ( l ) } } \in \mathbb { R } ^ { n \times d _ { l } }$ denotes hidden feature matrix of the $l$ -th layer and $H ^ { ( 0 ) } = X$ and $f _ { i } = H _ { i } ^ { ( L ) }$ represents the output of $i$ -th node.
39
+
40
+ We use $l ( y _ { i } , f _ { i } )$ to denote the classification loss of node $i$ , which is typically the cross entropy function. Thus, loss function used by GCN is of the form:
41
+
42
+ $$
43
+ L = \sum _ { i \in \mathcal { L } } l ( y _ { i } , f _ { i } )
44
+ $$
45
+
46
+ For a $k$ -layer GCN, the receptive field of each training example is its order- $k$ neighborhood. When there are only few training samples, we need to increase the number of layers in order to cover most of the unlabeled nodes. However, deeper GCN will cause the problem of over-smoothing, i.e., critical features of the vertices may be smoothed through the iterative averaging process, which makes nodes from different class indistinguishable (Xu et al., 2018; Li et al., 2018).
47
+
48
+ # 2.3 SELF TRAINING
49
+
50
+ Recently (Li et al., 2018) apply self-training to overcome these limitations of GCNs. Self-training is a natural and general approach to semi-supervised learning, which is particularly well-motivated in the context of node classification (Buchnik & Cohen, 2018; Li et al., 2018). Assume we have a base model/algorithm for the learning problem, which takes as input a set of labeled examples and makes predictions for other examples. Typically, for each unlabeled node, the base algorithm will also return an associated margin or confidence score. The self-training framework trains and applies the base model in rounds, where at the end of each round, the highest-confidence predictions are converted to become new labeled examples in the next round of training and prediction. Thus, the receptive fields of all the labeled nodes increases and will eventually cover the entire graph, which resolve the issue of GCNs without adding more layers.
51
+
52
+ # 3 OUR METHOD
53
+
54
+ # 3.1 A GENERALIZED SELF-TRAINING FRAMEWORK
55
+
56
+ # Algorithm 1: Dynamic Self-training Framework
57
+
58
+ 1 Generate initial parameter $\theta ^ { 0 }$ for model $f ( \cdot , \cdot )$ , and the initial confidence score vector $S _ { V }$ .
59
+ 2 for each epoch $t = 1 , 2 , . . . , T$ do
60
+ 3 Compute prediction $f _ { V } \gets f ( G , \theta ^ { t - 1 } )$
61
+ 4 Update confidence score $S _ { V } { \mathcal { U C } } ( f _ { V } )$ .
62
+ 5 Update model parameter by confidence score. $\theta ^ { t } \gets \mathcal { U P } ( f _ { V } , S _ { V } , f )$
63
+ 6 if stopping criteria is met then
64
+ 7 Break
65
+ 8 end
66
+ 9 end
67
+
68
+ Sun et al. (Sun et al., 2019) proposed Multi-stage Training Framework as generalization for selftraining method in (Li et al., 2018). Inspired by this, we propose a more generalized end-to-end self-training framework named Dynamic Self-training Framework shown in algorithm 1. Instead of operating on data split, we maintain a confidence score in each iteration. There is no specified training stages here, but we update the confidence value for each unlabeled node after every epoch.
69
+
70
+ Consider the original model $f ( \cdot , \cdot )$ as a forward predicting function with backward trainable parameters. The graph data $G$ and the trainable parameters $\theta ^ { t }$ is the input of this function, and the output of this model is collected into $f _ { V } \in \mathbb { R } ^ { n \times C }$ , where $f _ { v }$ denotes the output vector (before assigned with label) of node $v \in V$ , and $C = d _ { L }$ is the number of classes. Then we construct the confidence score vector $S _ { V } \in \mathbb { R } ^ { n }$ from the model output $f _ { v }$ using a function $\mathcal { U } \mathcal { C }$ , which can be instantiated in many forms. For example, Algorithm 2 illustrates how standard multi-stage self-training GCN implement this part. Finally we update the model parameters using a specified algorithm such as gradient descent, where the confidence score vector plays a role. The confidence score participates in the parameter updating process in an end-to-end manner. An example of this part can be seen in section 3.3.
71
+
72
+ # 3.2 PSEUDO LABEL METHOD
73
+
74
+ Define the pseudo label $\tilde { y } _ { i } \in \mathbb { R } ^ { d _ { L } }$ of $i$ -th node which satisfies :
75
+
76
+ $$
77
+ \tilde { y } _ { i j } = \left\{ \begin{array} { l l } { 1 } & { \mathrm { i f ~ } j = \arg \operatorname* { m a x } _ { j ^ { \prime } } f _ { i j ^ { \prime } } } \\ { 0 } & { \mathrm { o t h e r w i s e } } \end{array} \right.
78
+ $$
79
+
80
+ # Algorithm 2: Update confidence score for Multi-stage Self-training GCN
81
+
82
+ <table><tr><td colspan="2">if the stage is currently switched then</td></tr><tr><td>2</td><td>for each class k do</td></tr><tr><td>3</td><td>Find the top m vertices v in fv and v ∈U</td></tr><tr><td>4</td><td>Change the value of v in Sv to 1</td></tr><tr><td>5</td><td>end</td></tr><tr><td>6</td><td>return Sv</td></tr><tr><td colspan="2">7 end</td></tr></table>
83
+
84
+ (Lee, 2013) introduced a pseudo label version of semi-supervised losses:
85
+
86
+ $$
87
+ L = \sum _ { i \in \mathcal { L } } l ( y _ { i } , f _ { i } ) + \lambda \sum _ { i \in \mathcal { U } } l ( \tilde { y } _ { i } , f _ { i } ) ,
88
+ $$
89
+
90
+ where $\begin{array} { r } { \lambda = \frac { n } { n ^ { \prime } } \gamma } \end{array}$ , $n = | \mathcal { L } |$ , $n ^ { \prime } = | \boldsymbol { \mathcal { U } } |$ , $\gamma \in \mathbb R$ is a hyper-parameter and the additive term $\textstyle \sum _ { i \in { \mathcal { U } } } l ( { \tilde { y } } _ { i } , f _ { i } )$ is the pseudo label loss. Here, $\lambda$ measures how much the pseudo label term influence the training process. This is equivalent to Entropy Regularization for classification problems (Lee, 2013).
91
+
92
+ # 3.3 SOFT LABEL CONFIDENCE
93
+
94
+ In standard multi-stage self-training methods, a node just has two states: in the training set or not, which corresponds to binary-valued confidences $\{ 0 , 1 \}$ ; and in most cases, if a node is added in training set, it will be kept there. This simple setting hinders learning in some cases. For instance, if the classifier puts a wrongly labeled node into the training set, which is of high possibility in preliminary training epochs, it will persistently learn wrong knowledge from this node. Worse still, another wrongly adding is more possible. This negative feedback loop may contribute to a extremely poor classifier. Moreover, original labeled nodes and added nodes in the training are treated equally, which is too restricted and may harm the learning; explicitly distinguishing them in the training process could be beneficial. To resolve these problems, we introduce a mechanism named Soft Label Confidence as the confidence updating component in algorithm 1, which computes a personalized confidence value for each node, and the training set is dynamically changing except the ground truth labels. Based on the pseudo label loss (4), we propose the loss wrapped by soft label confidence:
95
+
96
+ $$
97
+ L = \sum _ { i \in \mathcal { L } } l ( y _ { i } , f _ { i } ) + \lambda \sum _ { i \in \mathcal { U } } \alpha ( f _ { i } ) l ( \tilde { y } _ { i } , f _ { i } ) .
98
+ $$
99
+
100
+ Here $\alpha$ is a function mapping from $\mathbb { R } ^ { d _ { L } }$ to $\mathbb { R }$ , defined as confidence function. While there are other possible choices for $\alpha$ , in our method we adopt a threshold based function:
101
+
102
+ $$
103
+ \alpha ( f _ { i } ) = \frac { 1 } { n _ { c ^ { i } } ^ { \prime } } \mathrm { m a x } ( \mathrm { R e L U } ( f _ { i } - \beta \cdot { \bf 1 } ) ) ,
104
+ $$
105
+
106
+ Here $\beta \in ( 0 , 1 )$ is a hyper-parameter as threshold, $n _ { c ^ { i } } ^ { \prime }$ denotes the number of nodes whose pseudo label belongs to class $c ^ { i }$ , $c ^ { i }$ is the class which $i$ -th node’s pseudo label belongs to, and 1 is the all 1 vector. We introduce $n _ { c ^ { i } } ^ { \prime }$ here to balance the categories of pseudo labels, because pseudo labels could be initially extremely unbalanced and lead to a poor classifier in practice.
107
+
108
+ Although $\alpha ( f _ { i } )$ depends on $f _ { i }$ , and thus a function of network’s weights, we will block the flow of gradient through $\alpha ( f _ { i } )$ for the following reasons: Firstly, confidence function is non-differentiable in most cases. Secondly, if we allow the gradient to flow through $\alpha ( f _ { i } )$ , the optimizer may tend to find a solution that satisfies $\operatorname* { m a x } ( f _ { i } ) < \beta , \mathsf { \bar { \forall } } i \in V$ , since for such a solution, $\overset { \vartriangle } { \alpha { \left( f _ { i } \right) } } = 0$ for all $i$ and the pseudo label loss is zero, which does no good to self-supervised learning. So we use the following way to compute the gradient:
109
+
110
+ $$
111
+ \frac { \partial L } { \partial W _ { s , t } ^ { l } } = \sum _ { i \in \mathcal { L } } \frac { \partial l ( y _ { i } , f _ { i } ) } { \partial W _ { s , t } ^ { l } } + \lambda \sum _ { i \in \mathcal { U } } \alpha ( f _ { i } ) \frac { \partial l ( \tilde { y } _ { i } , f _ { i } ) } { \partial W _ { s , t } ^ { l } }
112
+ $$
113
+
114
+ # 4 RELATED WORK
115
+
116
+ Graph Convolutional Network The work of GNNs seeks generalizations of the convolution operator to graph structured data. One way to do this is to apply convolution in the spectral domain, where the eigenvectors of the graph Laplacian are considered as the Fourier basis (Bruna et al., 2014; Henaff et al., 2015; Defferrard et al., 2016; Kipf & Welling, 2017). Such spectral methods learns hidden layer representations that encode both graph structure and node features simultaneously. Kipf and Welling (Kipf & Welling, 2017) simplify previous spectral techniques by restricting the propagation to a 1-hop neighborhood in each layer. (Chen et al., 2018) propose fast GCNs, which improves the training speed of the original GCN. GAT of (Velickovic et al., 2018) allows for assigning different importances to nodes of the same neighborhood via attention mechanisms. (Xu et al., 2018) introduce JK networks, which adjust the influence radii of each node adaptively. Another direction that generalizes convolutions to graph structured data, namely non-spectral approaches, define convolutions directly in the spatial domain (Duvenaud et al., 2015; Atwood & Towsley, 2016; Monti et al., 2017). Such methods are easier to be adapted to do inductive learning (Hamilton et al., 2017; Velickovic et al., 2018; Bojchevski & Günnemann, 2018). However, few-shot learning remains a challenge for this class of methods.
117
+
118
+ Label Propagation Unlike GNNs, which propagate node representations, the classic Label Propagation (LP) method (Zhu et al., 2003) iteratively propagates (soft) labels. More specifically, in each iteration, each unlabeled node obtains a new soft label that is the aggregation of the soft labels from the previous iteration of its neighbors. The key to LP is to design an effective propagation rule; for some propagation rules, the algorithm may not converge and/or the accuracy may not improve over iterations. Thus, one often needs to specify a stopping criteria and a validation set for model selection. LP can also be used as the base algorithm in the self-training framework.
119
+
120
+ Self-training Self-training is a natural and general approach to semi-supervised learning (Scudder, 1965) and has been widely used in the NLP literature. Self-training is used by (Yarowsky, 1995; Hearst, 1991) for word sense disambiguation. (Riloff et al., 1999) used self-training in the form of bootstrapping for information extraction and later for learning subjective nouns. (Riloff et al., 2003) with (Nigam et al., 2000) using EM for text classification. Self-training has been used for object recognition (Rosenberg et al., 2005; Zhou et al., 2012). (McClosky et al., 2006; 2008; Huang & Harper, 2009; Sagae, 2010) shows how effective can self-training be in parsing. (Wang et al., 2007; Huang et al., 2009; Qi et al., 2009) introduce self-training techniques to part of speech tagging, and (Kozareva et al., 2005; Liu et al., 2013a) adopt self-training in named entity recognition. (Van Asch & Daelemans, 2016; Drury et al., 2011; Liu et al., 2013b) used self-training in sentiment classification. Recently, self-training has also been successfully applied on node classification. Li et al. (Li et al., 2018) study self-training GCNs; Buchnik and Cohen (Buchnik & Cohen, 2018) mainly consider the effect self-training for diffusion-based techniques. In pseudo-label method of (Lee, 2013), for unlabeled data, their pseudo-labels are recalculated every weights update. However, they don’t assign weight to each unlabeled data.
121
+
122
+ As for the self-training algorithm itself, (Chen et al., 2011) shows that selecting highly confident instances with a pre-defined threshold may not perform well. (McClosky et al., 2006) produce a ranked list of n-best predicted parses and selected the best one. (Rosenberg et al., 2005) shows that a training data selection metric that is defined independently of the detector greatly outperforms a selection metric based on the detection confidence generated by the detector. (Zhou et al., 2012) suggests that selecting more informative unlabelled data using a guided search algorithm can significantly improve performance over standard self-training framework. Most recently, (Levatic et al., 2017) proposed ´ proposed an algorithm to automatically select appropriate threshold.
123
+
124
+ Network Embedding Node classification is also one of the main applications of network embedding methods, which learns a lower-dimensional representation for each node in an unsupervised manner, followed by a supervised classifier layer for node classification (Perozzi et al., 2014; Tang et al., 2015; Grover & Leskovec, 2016; Wang et al., 2016; Bojchevski & Günnemann, 2018). A recent work of (Bojchevski & Günnemann, 2018) proposes Graph2Gauss. This method embeds each node as a Gaussian distribution according to a novel ranking similarity based on the shortest path distances between nodes. A distribution embedding naturally captures the uncertainty about the representation. DGI (Velickovi ˇ c et al., 2019) is an embedding method based on GCNs, the unsupervised objective of ´ which is to maximize mutual information. The work of Embedding approaches achieve competitive performance in node classification tasks, while the learned representations also prove to be extremely useful for other downstream applications.
125
+
126
+ # 5 EVALUATION
127
+
128
+ # 5.1 DATASET
129
+
130
+ We conduct the evaluation on four benchmark citation datasets: Cora, Citeseer, Pubmed (Sen et al., 2008), and Core-full (Bojchevski & Günnemann, 2018). Each of these four datasets is undirected graph with node feature. Each node is a document and the edges denote the citation relationship; the feature of a node is the bag-of-words representation of the document. The number of layers in GCN is two by default, and thus the receptive field of each labeled node is its order-2 neighborhood. We measure the fraction of nodes which is covered by the 2-hop neighbors of all labeled nodes, i.e., $| \cup _ { s \in \mathcal { S } } \mathcal { N } _ { 2 } ( s ) | / | V |$ , where $s$ is the set of labeled nodes randomly sampled from $V$ . Here we report the 2-hop coverage ratio on the four datasets when the label rates are $1 \%$ and $0 . 5 \%$ respectively. We summarize the information of datasets in Table 1.
131
+
132
+ Table 1: Summary of datasets
133
+
134
+ <table><tr><td></td><td>Cora</td><td>Citeseer</td><td>Pubmed</td><td>Cora-full</td></tr><tr><td># of Nodes</td><td>2708</td><td>3327</td><td>19717</td><td>18703</td></tr><tr><td>#of Edges</td><td>5429</td><td>4732</td><td>44338</td><td>81124</td></tr><tr><td>#of Features</td><td>1433</td><td>3703</td><td>500</td><td>8710</td></tr><tr><td># of Classes</td><td>7</td><td>6</td><td>3</td><td>67</td></tr><tr><td>Coverage(0.5%)</td><td>14.78%</td><td>6.64%</td><td>21.58%</td><td>27.19%</td></tr><tr><td>Coverage(1%)</td><td>24.78%</td><td>12.14%</td><td>34.60%</td><td>47.42%</td></tr></table>
135
+
136
+ # 5.2 EXPERIMENT SETTINGS
137
+
138
+ We evaluate models on semi-supervised node classification tasks with varying label rates. Instead of evaluating on a fixed data split as in (Kipf & Welling, 2017; Velickovic et al., 2018), we mainly consider random splits as (Li et al., 2018) does. In detail, for a given label rate, we randomly generate 100 different splits on each dataset. In each split, there is a labeled set with prespecified size for training, and in this set each class contains the same number of labeled nodes. As in (Li et al., 2018), we don’t use a validation set, and all the remaining nodes will be used for testing. For simplicity, we will refer to a task in the form of dataset-l, where $l$ is the number of labeled nodes per class. For example, Cora-1 denotes the classification task on dataset Cora with one seed per class.
139
+
140
+ # 5.3 IMPLEMENTATION DETAILS
141
+
142
+ For all the models(Perozzi et al., 2014; Tang et al., 2015; Grover & Leskovec, 2016; Wang et al., 2016; Bojchevski & Günnemann, 2018; Velickovic et al., 2018; Monti et al., 2017) except for GCN based methods, settings of hyper-parameters are the same as suggested in original papers. All GCN based methods including GCN, Self-training GCN, Co-training GCN, Intersection GCN, Union GCN, and DSGCN share the same setting of hyper-parameter following (Shchur et al., 2018): one hidden layer with 64 units, dropout rate 0.8, Adam optimizer (Kingma & Ba, 2015) with learning rate $1 0 ^ { - 2 }$ , a $L _ { 2 }$ regularization with weight $1 0 ^ { - 3 }$ . We train other GCN based methods for a fixed epochs of 200, while DSGCN is trained for 600 epochs in few-label tasks such as 1, 3, 5, 10 tasks. Because 20 or 50 labels per class implies ample supervised information, we train DSGCN for 200 epochs in these tasks. The four variants of (Li et al., 2018): Self-training GCN, Co-training GCN, Intersection GCN and Union GCN follow original self-training settings in (Li et al., 2018). For DSGCN, we use a threshold of 0.6 when the number of labels per class is below 3, and set the threshold to 0.75 for label rate above 3 but below 10. Otherwise, the threshold is 0.9 by default.
143
+
144
+ # 5.4 RESULT ANALYSIS
145
+
146
+ The numerical results are summarized in Table 2 and Table 3. The highest accuracy in each column is highlighted in bold and the top 3 are underlined. We group all models into three categories: GNN variants(GCN, GAT, MoNet), unsupervised embedding methods (DeepWalk, DGI, LINE, G2G) and GCN with self-training (Co-training, Self-training, Union and Intersection, DSGCN).
147
+
148
+ Table 2: Summary of results in terms of mean classification accuracy (in percent) over 100 random splits in different tasks. Unsupervised approaches first learn a lower-dimensional embedding for each node in an unsupervised manner, and then the embeddings are used to train a supervised classifier for node classification. Here we use logistic regression as the classifier for unsupervised embeddings.
149
+
150
+ <table><tr><td></td><td colspan="6">Citeseer</td><td colspan="6">Cora</td></tr><tr><td># of Labels</td><td>1</td><td>3</td><td>5</td><td>10</td><td>20</td><td>50</td><td>1</td><td>3</td><td>5</td><td>10</td><td>20</td><td>50</td></tr><tr><td>LP</td><td>30.1</td><td>37.0</td><td>39.3</td><td>41.9</td><td>44.8</td><td>49.5</td><td>51.5</td><td>60.5</td><td>62.5</td><td>64.2</td><td>67.3</td><td>71.7</td></tr><tr><td>DeepWalk</td><td>28.3</td><td>34.7</td><td>38.1</td><td>42.0</td><td>45.6</td><td>50.7</td><td>40.4</td><td>53.8</td><td>59.4</td><td>65.4</td><td>69.9</td><td>74.2</td></tr><tr><td>LINE</td><td>28.0</td><td>34.7</td><td>38.0</td><td>43.1</td><td>48.5</td><td>54.6</td><td>49.4</td><td>62.6</td><td>63.4</td><td>71.1</td><td>74.0</td><td>76.5</td></tr><tr><td>G2G</td><td>45.1</td><td>56.4</td><td>60.3</td><td>63.1</td><td>65.7</td><td>68.2</td><td>54.5</td><td>68.1</td><td>70.9</td><td>73.8</td><td>75.8</td><td>77.0</td></tr><tr><td>DGI</td><td>46.1</td><td>59.2</td><td>64.1</td><td>67.6</td><td>68.7</td><td>72.3</td><td>55.3</td><td>70.9</td><td>72.6</td><td>76.4</td><td>77.9</td><td>78.7</td></tr><tr><td>GCN</td><td>36.4</td><td>50.3</td><td>57.5</td><td>63.2</td><td>68.8</td><td>72.2</td><td>42.4</td><td>61.6</td><td>68.4</td><td>75.1</td><td>80.2</td><td>83.5</td></tr><tr><td>GAT</td><td>32.8</td><td>48.6</td><td>54.9</td><td>60.8</td><td>68.2</td><td>71.5</td><td>41.8</td><td>61.7</td><td>71.1</td><td>76.0</td><td>79.6</td><td>83.4</td></tr><tr><td>MoNet</td><td>38.8</td><td>52.9</td><td>59.7</td><td>64.6</td><td>66.9</td><td>69.9</td><td>43.4</td><td>61.2</td><td>70.9</td><td>76.1</td><td>79.3</td><td>83.9</td></tr><tr><td>Co-training</td><td>36.7</td><td>49.0</td><td>55.0</td><td>60.7</td><td>65.9</td><td>70.0</td><td>53.1</td><td>65.7</td><td>70.2</td><td>73.8</td><td>78.7</td><td>82.5</td></tr><tr><td>Self-training</td><td>34.6</td><td>50.0</td><td>58.7</td><td>67.4</td><td>69.1</td><td>71.3</td><td>40.6</td><td>63.9</td><td>71.1</td><td>75.5</td><td>79.1</td><td>81.6</td></tr><tr><td>Union</td><td>37.2</td><td>50.8</td><td>55.9</td><td>64.4</td><td>67.5</td><td>70.6</td><td>50.1</td><td>67.3</td><td>72.5</td><td>76.2</td><td>79.8</td><td>82.4</td></tr><tr><td>Intersection</td><td>35.3</td><td>51.8</td><td>60.7</td><td>67.1</td><td>70.2</td><td>72.2</td><td>43.1</td><td>64.4</td><td>69.5</td><td>73.1</td><td>78.4</td><td>82.0</td></tr><tr><td>DSGCN</td><td>53.2</td><td>63.9</td><td>65.8</td><td>67.6</td><td>70.5</td><td>72.4</td><td>62.5</td><td>72.3</td><td>75.5</td><td>77.7</td><td>80.8</td><td>83.8</td></tr></table>
151
+
152
+ Table 3: Summary of results in terms of mean classification accuracy(in percent) over 100 random splits in different tasks. GNN variants are excluded due to limited computation resources.
153
+
154
+ <table><tr><td></td><td colspan="6">Pubmed</td><td colspan="6">Cora-full</td></tr><tr><td># of Labels</td><td>1</td><td>3</td><td>5</td><td>10</td><td>20</td><td>50</td><td>1</td><td>3</td><td>5</td><td>10</td><td>20</td><td>50</td></tr><tr><td>LP</td><td>55.7 41.3</td><td>61.9 54.9</td><td>63.5 63.6</td><td>65.2 71.2</td><td>66.4 77.8</td><td>67.5 81.0</td><td>26.3 26.4</td><td>32.4 42.8</td><td>35.1 49.3</td><td>38.0 54.4</td><td>41.0 61.2</td><td>46.0 65.4</td></tr><tr><td>GCN</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td> Co-training</td><td>55.1</td><td>64.7 62.7</td><td>69.0 67.2</td><td>73.5</td><td>77.9</td><td>80.5</td><td>28.3</td><td>38.1</td><td>42.8</td><td>48.5</td><td>53.8</td><td>62.2</td></tr><tr><td>Self-training</td><td>49.7</td><td>65.4</td><td>69.7</td><td>70.6 74.0</td><td>76.5 78.5</td><td>79.3 80.9</td><td>28.7 29.2</td><td>43.6 43.3</td><td>48.9 48.4</td><td>53.4 52.9</td><td>60.8 59.2</td><td>64.4 62.2</td></tr><tr><td>Union Intersection</td><td>55.1 52.7</td><td>63.4</td><td>67.8</td><td>70.6</td><td>75.9</td><td>79.0</td><td>26.8</td><td>37.7</td><td>44.4</td><td>51.5</td><td>58.4</td><td>62.1</td></tr><tr><td>DSGCN</td><td>55.8</td><td>67.1</td><td>70.2</td><td>74.7</td><td>77.8</td><td>81.0</td><td>30.9</td><td>45.6</td><td>51.3</td><td>57.5</td><td>61.4</td><td>64.8</td></tr></table>
155
+
156
+ Comparison Between GNN Variants and Embedding Methods As unsupervised methods, G2G and DGI outperform all GNN variants in very few labels cases, e.g., 1 and 3 per class on both Cora and Citeseer. Observing that LP performs well in Cora-1 while other feature propagation methods not, we can naturally conclude that in dataset with graph structure, concentrating more on the unsupervised information (both strong manifold structure(Li et al., 2018) and feature patterns) will improve semi-supervised model compared to just utilizing supervised information, in the case of low label rate. When label rate goes higher, all GNN variants enjoy better accuracies compared to unsupervised models. Hence we empirically verify the strong generalization ability of GNNs when the supervised information is sufficient. Sun et al. (Sun et al., 2019) has demonstrated the limitation of GCN in few labels case, and here we find that these convolution based methods suffer from inefficient propagation of label information as well, which can be seen as the intrinsic drawbacks of semi-supervised graph convolution based methods.
157
+
158
+ Comparison Between Self-training GCNs and All Other Models In all few-label tasks, selftraining strategies improve over GCN by a remarkable margin. Except for tasks with 50 labels per class, the best accuracy is always obtained by self-training GCN. Even in extreme one-label case, where unsupervised information is more vital, DSGCN outperforms G2G by a margin of $6 . 2 \%$ in Cora and $9 . 2 \%$ in Citeseer. We conclude that self-training strategy is capable of utilizing unsupervised information more effectively. Thus it significantly helps classification. Additionally, four naive selftraining GCNs implemented in (Li et al., 2018) are worse than GCN when label rate goes higher, e.g., Cora-50 and Cora-full-5, which manifests that inappropriate self-training strategies will sometimes degrade the performance of the base model. Hence there is a trade-off: capturing unsupervised signals, or learning supervised information well. However, DSGCN holds a good balance here. It doesn’t show much decrease compared to GCN even in the worst case task, Cora-full-50, where the accuracy only decreases by $0 . 6 \%$ ; in all other cases it is always better than GCN. This demonstrates that the dynamic self-training framework not only helps the original model to capture unsupervised information, but also retains the learning ability when there are enough labels.
159
+
160
+ ![](images/5612d4ef82c314a549957b6f901ddeb30cbef2a0a33782321d144bd0944db9e0.jpg)
161
+ Figure 1: Test accuracies in training process. Models with different threshold are denoted with different colors, which can be distinguished in legend. Specifically, threshold 1 represents that the model is equal to original GCN.
162
+
163
+ Comparison of Self-training GCNs By applying a simpler and more general self-training strategy, DSGCN outperforms other self-training based GCNs with considerable margins in most cases. In Citeseer-1, the margin even reaches $1 4 . \bar { 1 \% }$ compared with the best strategy among Co-training, Selftraining, Union and Intersection. This empirically supports the advantage of DSGCN for tackling a wide range of classification tasks over conventional self-training methods.
164
+
165
+ Effect of Threshold Here we discuss how the important hyper-parameter $\beta$ influence the performance of DSGCN. We train DSGCN with different threshold: 0.45, 0.6, 0.75, 0.9, 1.0 for 1000 epochs on dataset Cora and Citeseer for the same split with the same initialized weights. We conduct these experiments on tasks with different seed numbers, the results are presented in figure 1. As shown in figure 1, when labels are very few, DSGCN with a relatively lower threshold $\beta$ demonstrate a clear improvement in accuracy over the original GCN. Besides, GCN’s accuracy curve erratically fluctuates while the curve of DSGCN with a low threshold does not. Thus, we observe that the stability of the base model is also improved by wrapping it into the dynamic self-training framework. When more labels are provided, all models tend to be stable and a low threshold could harm the training process.
166
+
167
+ # 6 CONCLUSION
168
+
169
+ In this paper, we firstly introduce a novel self-training framework. This framework generalizes and simplifies prior work, providing customizable modules as extension for multi-stage self-training. Then we instantiate this framework based on GCN and empirically compare this model with a number of methods on different dataset splits. Result of experiments suggests that when labels are few, the proposed DSGCN not only outperform all previous models with noticeable margins in accuracy but also enjoy better stability in the training process. Overall, the Dynamic Self-training Framework is powerful for few-label tasks on graph data, and provides a novel perspective on self-training techniques.
170
+
171
+ # REFERENCES
172
+
173
+ James Atwood and Don Towsley. Diffusion-convolutional neural networks. In Advances in Neural Information Processing Systems, pp. 1993–2001, 2016.
174
+
175
+ Aleksandar Bojchevski and Stephan Günnemann. Deep gaussian embedding of graphs: Unsupervised inductive learning via ranking. International Conference on Learning Representations, 2018.
176
+
177
+ Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs. International Conference on Learning Representations, 2014.
178
+
179
+ Eliav Buchnik and Edith Cohen. Bootstrapped graph diffusions: Exposing the power of nonlinearity. In Abstracts of the 2018 ACM International Conference on Measurement and Modeling of Computer Systems, pp. 8–10. ACM, 2018.
180
+
181
+ Jie Chen, Tengfei Ma, and Cao Xiao. Fastgcn: fast learning with graph convolutional networks via importance sampling. International Conference on Learning Representations, 2018.
182
+
183
+ Minmin Chen, Kilian Q Weinberger, and John Blitzer. Co-training for domain adaptation. In Advances in neural information processing systems, pp. 2456–2464, 2011.
184
+
185
+ Michaël Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. In Advances in Neural Information Processing Systems, pp. 3844–3852, 2016.
186
+
187
+ Brett Drury, Luis Torgo, and Jose Joao Almeida. Guided self training for sentiment classification. In Proceedings of Workshop on Robust Unsupervised and Semisupervised Methods in Natural Language Processing, pp. 9–16, 2011.
188
+
189
+ 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.
190
+
191
+ 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.
192
+
193
+ Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Advances in Neural Information Processing Systems, pp. 1024–1034, 2017.
194
+
195
+ Marti Hearst. Noun homograph disambiguation using local context in large text corpora. Using Corpora, pp. 185–188, 1991.
196
+
197
+ Mikael Henaff, Joan Bruna, and Yann LeCun. Deep convolutional networks on graph-structured data. arXiv preprint arXiv:1506.05163, 2015.
198
+
199
+ Zhongqiang Huang and Mary Harper. Self-training pcfg grammars with latent annotations across languages. In Proceedings of the 2009 conference on empirical methods in natural language processing: Volume 2-Volume 2, pp. 832–841. Association for Computational Linguistics, 2009.
200
+
201
+ Zhongqiang Huang, Vladimir Eidelman, and Mary Harper. Improving a simple bigram hmm partof-speech tagger by latent annotation and self-training. In Proceedings of Human Language Technologies: The 2009 Annual Conference of the North American Chapter of the Association for Computational Linguistics, Companion Volume: Short Papers, pp. 213–216. Association for Computational Linguistics, 2009.
202
+
203
+ Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. International Conference on Learning Representations, 2015.
204
+
205
+ Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. International Conference on Learning Representations, 2017.
206
+
207
+ Zornitsa Kozareva, Boyan Bonev, and Andres Montoyo. Self-training and co-training applied to spanish named entity recognition. In Mexican International conference on Artificial Intelligence, pp. 770–779. Springer, 2005.
208
+
209
+ 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.
210
+
211
+ Jurica Levatic, Michelangelo Ceci, Dragi Kocev, and Sašo Džeroski. Self-training for multi-target ´ regression with tree ensembles. Knowledge-Based Systems, 123:41–60, 2017.
212
+
213
+ Qimai Li, Zhichao Han, and Xiao-Ming Wu. Deeper insights into graph convolutional networks for semi-supervised learning. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
214
+
215
+ Qian Liu, Bingyang Liu, Dayong Wu, Yue Liu, and Xueqi Cheng. A self-learning template approach for recognizing named entities from web text. In Proceedings of the Sixth International Joint Conference on Natural Language Processing, pp. 1139–1143, 2013a.
216
+
217
+ Zhiguang Liu, Xishuang Dong, Yi Guan, and Jinfeng Yang. Reserved self-training: A semi-supervised sentiment classification method for chinese microblogs. In Proceedings of the Sixth International Joint Conference on Natural Language Processing, pp. 455–462, 2013b.
218
+
219
+ David McClosky, Eugene Charniak, and Mark Johnson. Effective self-training for parsing. In Proceedings of the main conference on human language technology conference of the North American Chapter of the Association of Computational Linguistics, pp. 152–159. Association for Computational Linguistics, 2006.
220
+
221
+ David McClosky, Eugene Charniak, and Mark Johnson. When is self-training effective for parsing? In Proceedings of the 22nd International Conference on Computational Linguistics-Volume 1, pp. 561–568. Association for Computational Linguistics, 2008.
222
+
223
+ Federico Monti, Davide Boscaini, Jonathan Masci, Emanuele Rodola, Jan Svoboda, and Michael M Bronstein. Geometric deep learning on graphs and manifolds using mixture model cnns. In Proc. CVPR, volume 1, pp. 3, 2017.
224
+
225
+ Kamal Nigam, Andrew Kachites McCallum, Sebastian Thrun, and Tom Mitchell. Text classification from labeled and unlabeled documents using em. Machine learning, 39(2-3):103–134, 2000.
226
+
227
+ 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.
228
+
229
+ Yanjun Qi, Pavel Kuksa, Ronan Collobert, Kunihiko Sadamasa, Koray Kavukcuoglu, and Jason Weston. Semi-supervised sequence labeling with self-learned features. In 2009 Ninth IEEE International Conference on Data Mining, pp. 428–437. IEEE, 2009.
230
+
231
+ Ellen Riloff, Rosie Jones, et al. Learning dictionaries for information extraction by multi-level bootstrapping. In AAAI/IAAI, pp. 474–479, 1999.
232
+
233
+ Ellen Riloff, Janyce Wiebe, and Theresa Wilson. Learning subjective nouns using extraction pattern bootstrapping. In Proceedings of the seventh conference on Natural language learning at HLTNAACL 2003-Volume 4, pp. 25–32. Association for Computational Linguistics, 2003.
234
+
235
+ Chuck Rosenberg, Martial Hebert, and Henry Schneiderman. Semi-supervised self-training of object detection models. WACV/MOTION, 2, 2005.
236
+
237
+ Kenji Sagae. Self-training without reranking for parser domain adaptation and its impact on semantic role labeling. In Proceedings of the 2010 Workshop on Domain Adaptation for Natural Language Processing, pp. 37–44. Association for Computational Linguistics, 2010.
238
+
239
+ H Scudder. Probability of error of some adaptive pattern-recognition machines. IEEE Transactions on Information Theory, 11(3):363–371, 1965.
240
+
241
+ Prithviraj Sen, Galileo Namata, Mustafa Bilgic, Lise Getoor, Brian Galligher, and Tina Eliassi-Rad. Collective classification in network data. AI magazine, 29(3):93–93, 2008.
242
+
243
+ Oleksandr Shchur, Maximilian Mumme, Aleksandar Bojchevski, and Stephan Günnemann. Pitfalls of graph neural network evaluation. CoRR, abs/1811.05868, 2018. URL http://arxiv.org/ abs/1811.05868.
244
+
245
+ Ke Sun, Zhanxing Zhu, and Zhouchen Lin. Multi-stage self-supervised learning for graph convolutional networks. arXiv preprint arXiv:1902.11038, 2019.
246
+
247
+ 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, 2015.
248
+
249
+ Vincent Van Asch and Walter Daelemans. Predicting the effectiveness of self-training: Application to sentiment classification. arXiv preprint arXiv:1601.03288, 2016.
250
+
251
+ Petar Velickovic, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. Graph attention networks. International Conference on Learning Representations, 2018.
252
+
253
+ Petar Velickovi ˇ c, William Fedus, William L Hamilton, Pietro Liò, Yoshua Bengio, and R Devon ´ Hjelm. Deep graph infomax. International Conference on Learning Representations, 2019.
254
+
255
+ Daixin Wang, Peng Cui, and Wenwu Zhu. Structural deep network embedding. In Proceedings of the 22nd ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 1225–1234. ACM, 2016.
256
+
257
+ Wen Wang, Zhongqiang Huang, and Mary Harper. Semi-supervised learning for part-of-speech tagging of mandarin transcribed speech. In 2007 IEEE International Conference on Acoustics, Speech and Signal Processing-ICASSP’07, volume 4, pp. IV–137. IEEE, 2007.
258
+
259
+ Felix Wu, Amauri Souza, Tianyi Zhang, Christopher Fifty, Tao Yu, and Kilian Weinberger. Simplifying graph convolutional networks. In International Conference on Machine Learning, pp. 6861–6871, 2019.
260
+
261
+ Keyulu Xu, Chengtao Li, Yonglong Tian, Tomohiro Sonobe, Ken-ichi Kawarabayashi, and Stefanie Jegelka. Representation learning on graphs with jumping knowledge networks. International Conference on Machine Learning, 2018.
262
+
263
+ David Yarowsky. Unsupervised word sense disambiguation rivaling supervised methods. In 33rd annual meeting of the association for computational linguistics, 1995.
264
+
265
+ Yan Zhou, Murat Kantarcioglu, and Bhavani Thuraisingham. Self-training with selection-by-rejection. In 2012 IEEE 12th international conference on data mining, pp. 795–803. IEEE, 2012.
266
+
267
+ 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, pp. 912–919, 2003.
268
+
269
+ # A APPENDIX: ADDITIONAL EXPERIMENTS
270
+
271
+ We also test our self-training methods on other GNNs as well, e.g., SGC(Wu et al., 2019), GAT (Velickovic et al., 2018), and GraphSage (Hamilton et al., 2017). For the three GNN models, settings of hyper-parameters are the same as suggested in original papers. And our dynamic self-training framework share the same setting of hyper-parameter: one hidden layer with 32 units, dropout rate 0.7, Adam optimizer (Kingma & Ba, 2015), a $L _ { 2 }$ regularization with weight $5 ^ { - 4 }$ and set the threshold to 0.9. Clearly, our dynamic self-training framework achieves similar improvements on all the three base models. The numerical results are summarized in Table 4. We can see equipped with our DS framework, these models enjoys noticeable increase in performance.
272
+
273
+ Table 4: Summary of results in terms of mean classification accuracy (in percent) over 50 random splits in different tasks(the results of GAT experiments are from Table 2).
274
+
275
+ <table><tr><td></td><td colspan="4">Citeseer</td><td colspan="4">Cora</td></tr><tr><td># ofLabels</td><td>5</td><td>10</td><td>20</td><td>50</td><td>5</td><td>10</td><td>20</td><td>50</td></tr><tr><td>SGC</td><td>55.5</td><td>63.7</td><td>69.0</td><td>72.6</td><td>63.5</td><td>72.5</td><td>75.9</td><td>78.9</td></tr><tr><td>DS-SGC</td><td>59.6</td><td>65.0</td><td>69.7</td><td>73.4</td><td>65.0</td><td>73.4</td><td>76.2</td><td>78.9</td></tr><tr><td>GAT DS-GAT</td><td>54.9</td><td>60.8</td><td>68.2</td><td>71.5</td><td>71.1</td><td>76.0</td><td>79.6</td><td>83.4</td></tr><tr><td></td><td>58.3</td><td>67.0</td><td>70.8</td><td>73.4</td><td>71.9</td><td>77.1</td><td>81.0</td><td>83.6</td></tr><tr><td>GraphSAGE</td><td>59.7</td><td>65.4</td><td>68.8</td><td>72.1</td><td>69.3</td><td>75.3</td><td>79.2</td><td>82.5</td></tr><tr><td>DS-GraphSAGE</td><td>60.6</td><td>66.3</td><td>69.5</td><td>72.6</td><td>72.5</td><td>78.4</td><td>81.0</td><td>84.0</td></tr></table>
276
+
277
+ To evaluate the computation overhead introduced by dynamic self-training framework, we test the total training time for various models. Intuitively the computational cost will only slightly increase. The reason is that the computational cost of the original GCN model is dominated by previous layers, where the entire graph is included. So even if all nodes become pseudo labels, the size of the entire network is increased by at most a factor of 2, and the number of parameters remains the same. Therefore, the computational costs will increase by at most a small constant in theory. We have also verified this empirically. We record the training time of base models before and after applying our framework. In the experiments, the training size is 20 per class, the number of epoch is 200, and the time is the average time (in seconds) of 25 runs. The numerical results can be seen in Tabel 5.
278
+
279
+ Table 5: Total training time for various models in seconds(s), implemented on PyG.
280
+
281
+ <table><tr><td></td><td>Citeseer</td><td>Cora</td></tr><tr><td>GCN</td><td>3.0</td><td>2.6</td></tr><tr><td>DSGCN</td><td>9.7</td><td>6.3</td></tr><tr><td>SGC</td><td>1.4</td><td>1.3</td></tr><tr><td>DS-SGC</td><td>7.1</td><td>7.4</td></tr><tr><td>GAT</td><td>5.2</td><td>4.7</td></tr><tr><td>DS-GAT</td><td>11.9</td><td>8.7</td></tr><tr><td>GraphSAGE</td><td>1.9</td><td>2.1</td></tr><tr><td>DS-GraphSAGE</td><td>8.7</td><td>8.5</td></tr></table>
md/train/SJgVHkrYDH/SJgVHkrYDH.md ADDED
@@ -0,0 +1,496 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # LEARNING TO RETRIEVE REASONING PATHS OVER WIKIPEDIA GRAPH FOR QUESTION ANSWERING
2
+
3
+ Akari Asai∗†, Kazuma Hashimoto‡, Hannaneh Hajishirzi†§, Richard Socher‡ & Caiming Xiong‡
4
+
5
+ †University of Washington ‡Salesforce Research §Allen Institute for Artificial Intelligence
6
+ {akari,hannaneh}@cs.washington.edu
7
+ {k.hashimoto,rsocher,cxiong}@salesforce.com
8
+
9
+ # ABSTRACT
10
+
11
+ Answering questions that require multi-hop reasoning at web-scale necessitates retrieving multiple evidence documents, one of which often has little lexical or semantic relationship to the question. This paper introduces a new graphbased recurrent retrieval approach that learns to retrieve reasoning paths over the Wikipedia graph to answer multi-hop open-domain questions. Our retriever model trains a recurrent neural network that learns to sequentially retrieve evidence paragraphs in the reasoning path by conditioning on the previously retrieved documents. Our reader model ranks the reasoning paths and extracts the answer span included in the best reasoning path. Experimental results show state-of-the-art results in three open-domain QA datasets, showcasing the effectiveness and robustness of our method. Notably, our method achieves significant improvement in HotpotQA, outperforming the previous best model by more than 14 points.1
12
+
13
+ # 1 INTRODUCTION
14
+
15
+ Open-domain Question Answering (QA) is the task of answering a question given a large collection of text documents (e.g., Wikipedia). Most state-of-the-art approaches for open-domain QA (Chen et al., 2017; Wang et al., 2018a; Lee et al., 2018; Yang et al., 2019) leverage non-parameterized models (e.g., TF-IDF or BM25) to retrieve a fixed set of documents, where an answer span is extracted by a neural reading comprehension model. Despite the success of these pipeline methods in singlehop QA, whose questions can be answered based on a single paragraph, they often fail to retrieve the required evidence for answering multi-hop questions, e.g., the question in Figure 1. Multi-hop QA (Yang et al., 2018) usually requires finding more than one evidence document, one of which often consists of little lexical overlap or semantic relationship to the original question. However, retrieving a fixed list of documents independently does not capture relationships between evidence documents through bridge entities that are required for multi-hop reasoning.
16
+
17
+ Recent open-domain QA methods learn end-to-end models to jointly retrieve and read documents (Seo et al., 2019; Lee et al., 2019). These methods, however, face challenges for entity-centric questions since compressing the necessary information into an embedding space does not capture lexical information in entities. Cognitive Graph (Ding et al., 2019) incorporates entity links between documents for multi-hop QA to extend the list of retrieved documents. This method, however, compiles a fixed list of documents independently and expects the reader to find the reasoning paths.
18
+
19
+ In this paper, we introduce a new recurrent graph-based retrieval method that learns to retrieve evidence documents as reasoning paths for answering complex questions. Our method sequentially retrieves each evidence document, given the history of previously retrieved documents to form several reasoning paths in a graph of entities. Our method then leverages an existing reading comprehension model to answer questions by ranking the retrieved reasoning paths. The strong interplay between the retriever model and reader model enables our entire method to answer complex questions by exploring more accurate reasoning paths compared to other methods.
20
+
21
+ ![](images/5341787e714e2d214f06fea1dee98532372593e3609cbf71531d27fd1d839f5c.jpg)
22
+ Figure 1: An example of open-domain multi-hop question from HotpotQA. Paragraph 2 is unlikely to be retrieved using TF-IDF retrievers due to little lexical overlap to the given question.
23
+
24
+ To be more specific, our method (sketched in Figure 2) constructs the Wikipedia paragraph graph using Wikipedia hyperlinks and document structures to model the relationships between paragraphs. Our retriever trains a recurrent neural network to score reasoning paths in this graph by maximizing the likelihood of selecting a correct evidence paragraph at each step and fine-tuning paragraph BERT encodings. Our reader model is a multi-task learner to score each reasoning path according to its likelihood of containing and extracting the correct answer phrase. We leverage data augmentation and negative example mining for robust training of both models.
25
+
26
+ Our experimental results show that our method achieves the state-of-the-art results on HotpotQA full wiki and HotpotQA distractor settings (Yang et al., 2018), outperforming the previous stateof-the-art methods by more than 14 points absolute gain on the full wiki setting. We also evaluate our approach on SQuAD Open (Chen et al., 2017) and Natural Questions Open (Lee et al., 2019) without changing any architectural designs, achieving better or comparable to the state of the art, which suggests that our method is robust across different datasets. Additionally, our framework provides interpretable insights into the underlying entity relationships used for multi-hop reasoning.
27
+
28
+ # 2 RELATED WORK
29
+
30
+ Neural open-domain question answering Most current open-domain QA methods use a pipeline approach that includes a retriever and reader. Chen et al. (2017) incorporate a TF-IDF-based retriever with a state-of-the-art neural reading comprehension model. The subsequent work improves the heuristic retriever by re-ranking retrieved documents (Wang et al., 2018a;b; Lee et al., 2018; Lin et al., 2018). The performance of these methods is still bounded by the performance of the initial retrieval process. In multi-hop QA, non-parameterized retrievers face the challenge of retrieving all the relevant documents, one or some of which are lexically distant from the question. Recently, Lee et al. (2019) and Seo et al. (2019) introduce fully trainable models that retrieve a few candidates directly from large-scale Wikipedia collections. All these methods find evidence documents independently without the knowledge of previously selected documents or relationships between documents. This would result in failing to conduct multi-hop retrieval.
31
+
32
+ Retrievers guided by entity links Most relevant to our work are recent studies that attempt to use entity links for multi-hop open-domain QA. Cognitive Graph (Ding et al., 2019) retrieves evidence documents offline, and trains a reading comprehension model to jointly predict possible answer spans and next-hop spans to extend the reasoning chain. Instead, we train our retriever to find reasoning paths directly. Concurrent with our work, Entity-centric IR (Godbole et al., 2019) uses entity linking for multi-hop retrieval. Unlike our method, this method does not learn to retrieve reasoning paths sequentially, nor study the interplay between retriever and reader. Moreover, while the previous approaches require a system to encode all possible nodes, our beam search decoding process only encodes the nodes on the reasoning paths, which significantly reduces the computational costs. PullNet (Sun et al., 2019) learns to retrieve question-aware sub-graphs from text corpora and knowledge bases (e.g., Freebase), while we focus on open-domain QA solely based on text.
33
+
34
+ Multi-step (iterative) retrievers Similar to our recurrent retriever, multi-step retrievers explore multiple evidence documents iteratively. Multi-step reasoner (Das et al., 2019) repeats the retrieval process for a fixed number of steps, interacting with a reading comprehension model by reformulating the query in a latent space to enhance retrieval performance. Feldman & El-Yaniv (2019) also propose a query reformulation mechanism with a focus on multi-hop open-domain QA. Most recently, Qi et al. (2019) introduce GoldEn Retriever, which reads and generates search queries for two steps to search documents for HotpotQA full wiki. These methods do not use the graph structure of the documents during the iterative retrieval process. In addition, all of these multi-step retrieval methods do not accommodate arbitrary steps of reasoning and the termination condition is hard-coded. In contrast, our method leverages the Wikipedia graph to retrieve documents that are lexically or semantically distant to questions, and is adaptive to any reasoning path lengths, which leads to significant improvement over the previous work in HotpotQA and SQuAD Open.
35
+
36
+ ![](images/a022e60ad47bb8c69547f226d08e1ee9f406355a07b186ccc4cf766bef6162fb.jpg)
37
+ Figure 2: Overview of our framework.
38
+
39
+ # 3 OPEN-DOMAIN QUESTION ANSWERING OVER WIKIPEDIA GRAPH
40
+
41
+ Overview This paper introduces a new graph-based recurrent retrieval method (Section 3.1) that learns to find evidence documents as reasoning paths for answering complex questions. We then extend an existing reading comprehension model (Section 3.2) to answer questions given a collection of reasoning paths. Our method uses a strong interplay between retrieving and reading steps such that the retrieval method learns to retrieve a set of reasoning paths to narrow down the search space for our reader model, for robust pipeline process. Figure 2 sketches the overview of our QA model.
42
+
43
+ We use Wikipedia for open-domain QA, where each article is divided into paragraphs, resulting in millions of paragraphs in total. Each paragraph $p$ is considered as our retrieval target. Given a question $q$ , our framework aims at deriving its answer $a$ by retrieving and reading reasoning paths, each of which is represented with a sequence of paragraphs: $E = [ p _ { i } , \dotsc , p _ { k } ]$ . We formulate the task by decomposing the objective into the retriever objective $S _ { \mathrm { r e t r } } ( q , E )$ that selects reasoning paths $E$ relevant to the question, and the reader objective $S _ { \mathrm { r e a d } } ( q , E , a )$ that finds the answer $a$ in $E$ :
44
+
45
+ $$
46
+ \operatorname * { a r g m a x } _ { E , a } S ( q , E , a ) \mathrm { s . t . } S ( q , E , a ) = S _ { \mathrm { r e t r } } ( q , E ) + S _ { \mathrm { r e a d } } ( q , E , a ) .
47
+ $$
48
+
49
+ # 3.1 LEARNING TO RETRIEVE REASONING PATHS
50
+
51
+ Our method learns to retrieve reasoning paths across a graph structure. Evidence paragraphs for a complex question do not necessarily have lexical overlaps with the question, but one of them is likely to be retrieved, and its entity mentions and the question often entail another paragraph (e.g., Figure 1). To perform such multi-hop reasoning, we first construct a graph of paragraphs, covering all the Wikipedia paragraphs. Each node of the Wikipedia graph $\mathcal { G }$ represents a single paragraph $p _ { i }$ .
52
+
53
+ Constructing the Wikipedia graph Hyperlinks are commonly used to construct relationships between articles on the web, usually maintained by article writers, and are thus useful knowledge resources. Wikipedia consists of its internal hyperlinks to connect articles. We use the hyperlinks to construct the direct edges in $\mathcal { G }$ . We also consider symmetric within-document links, allowing a paragraph to hop to other paragraphs in the same article. The Wikipedia graph $\mathcal { G }$ is densely connected and covers a wide range of topics that provide useful evidence for open-domain questions. This graph is constructed offline and is reused throughout training and inference for any question.
54
+
55
+ # 3.1.1 THE GRAPH-BASED RECURRENT RETRIEVER
56
+
57
+ General formulation with a recurrent retriever We use a Recurrent Neural Network (RNN) to model the reasoning paths for the question $q$ . At the $t { \cdot }$ -th time step $( t \geq 1 )$ ) our model selects a paragraph $p _ { i }$ among candidate paragraphs $\mathbf { C } _ { t }$ given the current hidden state $h _ { t }$ of the RNN. The initial hidden state $h _ { 1 }$ is independent of any questions or paragraphs, and based on a parameterized vector. We use BERT’s [CLS] token representation (Devlin et al., 2019) to independently encode each candidate paragraph $p _ { i }$ along with $q$ .2 We then compute the probability $P ( \boldsymbol { p } _ { i } | h _ { t } )$ that $p _ { i }$ is selected. The RNN selection procedure captures relationships between paragraphs in the reasoning path by conditioning on the selection history. The process is terminated when [EOE], the end-ofevidence symbol, is selected, to allow it to capture reasoning paths with arbitrary length given each question. More specifically, the process of selecting $p _ { i }$ at the $t$ -th step is formulated as follows:
58
+
59
+ $$
60
+ \begin{array} { r l } & { w _ { i } = \mathrm { B E R T } _ { [ \mathrm { C L S } ] } ( q , p _ { i } ) \in \mathbb { R } ^ { d } , } \\ & { P ( p _ { i } | h _ { t } ) = \sigma ( w _ { i } \cdot h _ { t } + b ) , } \\ & { \quad \quad h _ { t + 1 } = \mathrm { R N N } ( h _ { t } , w _ { i } ) \in \mathbb { R } ^ { d } , } \end{array}
61
+ $$
62
+
63
+ where $b \in \mathbb { R } ^ { 1 }$ is a bias term. Motivated by Salimans & Kingma (2016), we normalize the RNN states to control the scale of logits in Equation (3) and allow the model to learn multiple reasoning paths. The details of Equation (4) are described in Appendix A.1. The next candidate set $\mathbf { C } _ { t + 1 }$ is constructed to include paragraphs that are linked from the selected paragraph $p _ { i }$ in the graph. To allow our model to flexibly retrieve multiple paragraphs within $\mathbf { C } _ { t }$ , we also add $K$ -best paragraphs other than $p _ { i }$ (from $\mathbf { C } _ { t } .$ ) to $\mathbf { C } _ { t + 1 }$ , based on the probabilities. We typically set $K = 1$ in this paper.
64
+
65
+ Beam search for candidate paragraphs It is computationally expensive to compute Equation (2) over millions of the possible paragraphs. Moreover, a fully trainable retriever often performs poorly for entity-centric questions such as SQuAD, since it does not explicitly maintain lexical information (Lee et al., 2019). To navigate our retriever in the large-scale graph effectively, we initialize candidate paragraphs with a TF-IDF-based retrieval and guide the search over the Wikipedia graph. In particular, the initial candidate set $\mathbf { C } _ { 1 }$ includes $F$ paragraphs with the highest TF-IDF scores with respect to the question. We expand $\mathbf { C } _ { t }$ $t \geq 2 ,$ ) by appending the [EOE] symbol. We additionally use a beam search to explore paths in the directed graph. We define the score of a reasoning path $E = [ p _ { i } , \dotsc , p _ { k } ]$ by multiplying the probabilities of selecting the paragraphs: $P ( p _ { i } | h _ { 1 } ) \ldots P ( p _ { k } | h _ { | E | } )$ . The beam search outputs the top $B$ reasoning paths $\mathbf { E } = \{ E _ { 1 } , \dots , E _ { B } \}$ with the highest scores to pass to the reader model i.e., $S ( q , E , a ) = S _ { \mathrm { r e a d } } ( q , E , a )$ for $E \in \mathbf { E }$ .
66
+
67
+ In terms of the computational cost, the number of the paragraphs processed by Equation (2) is bounded by $\begin{array} { r } { \mathcal { O } ( | \mathbf { C } _ { 1 } | + B \sum _ { t \geq 2 } | \overline { { \mathbf { C } _ { t } } } | ) } \end{array}$ , where $B$ is the beam size and $\overline { { | \mathbf { C } _ { t } | } }$ is the average size of $\mathbf { C } _ { t }$ over the $B$ hypothesises.
68
+
69
+ # 3.1.2 TRAINING OF THE GRAPH-BASED RECURRENT RETRIEVER
70
+
71
+ Data augmentation We train our retriever in a supervised fashion using evidence paragraphs annotated for each question. For multi-hop QA, we have multiple paragraphs for each question, and single paragraph for single-hop QA. We first derive a ground-truth reasoning path $g = [ p _ { 1 } , \dotsc , p _ { | g | } ]$ using the available annotated data in each dataset. $p _ { | { g \vert } }$ is set to [EOE] for the termination condition. To relax and stabilize the training process, we augment the training data with additional reasoning paths – not necessarily the shortest paths – that can derive the answer. In particular, we add a new training path $g _ { r } = [ \bar { p _ { r } } , p _ { 1 } , \dotsc , p _ { | g | } ]$ by adding a paragraph $p _ { r } \in \mathbf { C _ { 1 } }$ that has a high TF-IDF score and is linked to the first paragraph $p _ { 1 }$ in the ground-truth path $g$ . Adding these new training paths helps at the test time when the first paragraph in the reasoning path does not necessarily appear among the paragraphs that initialize the Wikipedia search using the heuristic TF-IDF retrieval.
72
+
73
+ Negative examples for robustness Our graph-based recurrent retriever needs to be trained to discriminate between relevant and irrelevant paragraphs at each step. We therefore use negative examples along with the ground-truth paragraphs; to be more specific, we use two types of negative examples: (1) TF-IDF-based and (2) hyperlink-based ones. For single-hop QA, we only use the type (1). For multi-hop QA, we use both types, and the type (2) is especially important to prevent our retriever from being distracted by reasoning paths without correct answer spans. We typically set the number of the negative examples to 50.
74
+
75
+ 2Appendix A.2 discusses the motivation, and Appendix C.4 shows results with an alternative approach.
76
+
77
+ Loss function For the sequential prediction task, we estimate $P ( \boldsymbol { p } _ { i } | h _ { t } )$ independently in Equation (3) and use the binary cross-entropy loss to maximize probability values of all the possible paths. Note that using the widely-used cross-entropy loss with the softmax normalization over $\mathbf { C } _ { t }$ is not desirable here; maximizing the probabilities of $g$ and $g _ { r }$ contradict with each other. More specifically, the loss function of $g$ at the $t$ -th step is defined as follows:
78
+
79
+ $$
80
+ L _ { \mathrm { r e t r } } ( p _ { t } , h _ { t } ) = - \log P ( p _ { t } | h _ { t } ) - \sum _ { \tilde { p } \in \tilde { \mathbf { C } } _ { t } } \log \left( 1 - P ( \tilde { p } | h _ { t } ) \right) ,
81
+ $$
82
+
83
+ where $\tilde { \mathbf { C } } _ { t }$ is a set of the negative examples described above, and includes [EOE] for $t < | g |$ . We exclude $p _ { r }$ from $\tilde { \mathbf { C } } _ { 1 }$ for the sake of our multi-path learning. The loss is also defined with respect to $g _ { r }$ in the same way. All the model parameters, including those in BERT, are jointly optimized.
84
+
85
+ # 3.2 READING AND ANSWERING GIVEN REASONING PATHS
86
+
87
+ Our reader model first verifies each reasoning path in $\mathbf { E }$ , and finally outputs an answer span $a$ from the most plausible reasoning path. This interplay is effective in making our framework robust; this is further discussed in Appendix A.3. We model the reader as a multi-task learning of (1) reading comprehension, that extracts an answer span from a reasoning path $E$ using a standard approach (Seo et al., 2017; Xiong et al., 2017; Devlin et al., 2019), and (2) reasoning path re-ranking, that re-ranks the retrieved reasoning paths by computing the probability that the path includes the answer.
88
+
89
+ For the reading comprehension task, we use BERT (Devlin et al., 2019), where the input is the concatenation of the question text and the text of all the paragraphs in $E$ . This lets our reader to fully leverage the self-attention mechanism across the concatenated paragraphs in the retrieved reasoning paths; this paragraph interaction is crucial for multi-hop reasoning (Wang et al., 2019a).
90
+
91
+ We share the same model for re-ranking, and use the BERT’s [CLS] representation to estimate the probability of selecting $E$ to answer the question:
92
+
93
+ $$
94
+ \begin{array} { r } { P ( E | q ) = \sigma ( w _ { n } \cdot u _ { E } ) \mathrm { s . t . } u _ { E } = \mathrm { B E R T } _ { [ \mathrm { C L S } ] } ( q , E ) \in \mathbb { R } ^ { D } , } \end{array}
95
+ $$
96
+
97
+ where $w _ { n } \in \mathbb { R } ^ { D }$ is a weight vector. At the inference time, we select the best evidence $E _ { b e s t } \in \mathbf { E }$ by $P ( E | q )$ , and output the answer span by $S _ { \mathrm { r e a d } }$ :
98
+
99
+ $$
100
+ E _ { b e s t } = \underset { E \in \mathbf { E } } { \arg \operatorname* { m a x } } P ( E | q ) , ~ S _ { \mathrm { r e a d } } = \underset { i , j , ~ i \leq j } { \arg \operatorname* { m a x } } P _ { i } ^ { s t a r t } P _ { j } ^ { e n d } ,
101
+ $$
102
+
103
+ where $P _ { i } ^ { s t a r t } , P _ { j } ^ { e n d }$ denote the probability that the $i$ -th and $j$ -th tokens in $E _ { b e s t }$ are the start and end positions, respectively, of the answer span, and are calculated by following Devlin et al. (2019).
104
+
105
+ Training examples To train the multi-task reader model, we use the ground-truth evidence paragraphs used for training our retriever. It is known to be effective in open-domain QA to use distantly supervised examples, which are not originally associated with the questions but include expected answer strings (Chen et al., 2017; Wang et al., 2018a; Hu et al., 2019). These distantly supervised examples are also effective to simulate the inference time process. Therefore, we combine distantly supervised examples from a TF-IDF retriever with the original supervised examples. Following the procedures in Chen et al. (2017), we add up to one distantly supervised example for each supervised example. We set the answer span as the string that matches $a$ and appears first.
106
+
107
+ To train our reader model to discriminate between relevant and irrelevant reasoning paths, we augment the original training data with additional negative examples to simulate incomplete evidence. In particular, we add paragraphs that appear to be relevant to the given question but actually do not contain the answer. For multi-hop QA, we select one ground-truth paragraph including the answer span, and swap it with one of the TF-IDF top ranked paragraphs. For single-hop QA, we simply replace the single ground-truth paragraph with TF-IDF-based negative examples which do not include the expected answer string. For the distorted evidence $\tilde { E }$ , we aim at minimizing $P ( \tilde { E } | q )$ .
108
+
109
+ Multi-task loss function The objective is the sum of cross entropy losses for the span prediction and re-ranking tasks. The loss for the question $q$ and its evidence candidate $E$ is as follows:
110
+
111
+ $$
112
+ L _ { \mathrm { r e a d } } = L _ { \mathrm { s p a n } } + L _ { \mathrm { n o \_ a n s w e r } } = ( - \log P _ { y ^ { s t a r t } } ^ { s t a r t } - \log P _ { y ^ { e n d } } ^ { e n d } ) - \log P ^ { r } ,
113
+ $$
114
+
115
+ where $y ^ { s t a r t }$ and $y ^ { e n d }$ are the ground-truth start and end indices, respectively. $L _ { \mathrm { n o \_ a n s w e r } }$ corresponds to the loss of the re-ranking model, to discriminate the distorted reasoning paths with no answers. $P ^ { r }$ is $P ( E | q )$ if $E$ is the ground-truth evidence; otherwise $P ^ { r } = 1 - P ( E | q )$ . We mask the span losses for negative examples, in order to avoid unexpected effects to the span predictions.
116
+
117
+ # 4 EXPERIMENTS
118
+
119
+ # 4.1 EXPERIMENTAL SETUP
120
+
121
+ We evaluate our method in three open-domain Wikipedia-sourced datasets: HotpotQA, SQuAD Open and Natural Questions Open. We target all the English Wikipedia paragraphs for SQuAD Open and Natural Questions Open, and the first paragraph (introductory paragraph) of each article for HotpotQA following previous studies. More details can be found in Appendix B.
122
+
123
+ HotpotQA HotpotQA (Yang et al., 2018) is a human-annotated large-scale multi-hop QA dataset. Each answer can be extracted from a collection of 10 paragraphs in the distractor setting, and from the entire Wikipedia in the full wiki setting. Two evidence paragraphs are associated with each question for training. Our primary target is the full wiki setting due to its open-domain scenario, and we use the distractor setting to evaluate how well our method works in a closed scenario where the two evidence paragraphs are always included. The dataset also provides annotations to evaluate the prediction of supporting sentences, and we adapt our retriever to the supporting fact prediction. Note that this subtask is specific to HotpotQA. More details are described in Appendix A.5.
124
+
125
+ SQuAD Open SQuAD Open (Chen et al., 2017) is composed of questions from the original SQuAD dataset (Rajpurkar et al., 2016). This is a single-hop QA task, and a single paragraph is associated with each question in the training data.
126
+
127
+ Natural Questions Open Natural Questions Open (Lee et al., 2019) is composed of questions from the Natural Questions dataset (Kwiatkowski et al., 2019),3 which is based on Google Search queries independently from the existing articles. A single paragraph is associated with each question, but our preliminary analysis showed that some questions benefit from multi-hop reasoning.
128
+
129
+ Metrics We report standard $F l$ and $E M$ scores for HotpotQA and SQuAD Open, and EM score for Natural Questions Open to evaluate the overall QA accuracy to find the correct answers. For HotpotQA, we also report Supporting Fact F1 $( S P F I )$ and Supporting Fact EM (SP EM) to evaluate the sentence-level supporting fact retrieval accuracy. To evaluate the paragraph-level retrieval accuracy for the multi-hop reasoning, we use the following metrics: Answer Recall (AR), which evaluates the recall of the answer string among top paragraphs (Wang et al., 2018a; Das et al., 2019), Paragraph Recall $( P R )$ , which evaluates if at least one of the ground-truth paragraphs is included among the retrieved paragraphs, and Paragraph Exact Match $( P E M )$ , which evaluates if both of the ground-truth paragraphs for multi-hop reasoning are included among the retrieved paragraphs.
130
+
131
+ Evidence Corpus and the Wikipedia graph We use English Wikipedia as the evidence corpus and do not use other data such as Google search snippets or external structured knowledge bases. We use the several versions of Wikipedia dumps for the three datasets (See Appendix B.5). To construct the Wikipedia graph, the hyperlinks are automatically extracted from the raw HTML source files. Directed edges are added between a paragraph $p _ { i }$ and all of the paragraphs included in the target article. The constructed graph consists of $3 2 . 7 \mathbf { M }$ nodes and 205.4M edges. For HotpotQA we only use the introductory paragraphs in the graph that includes about 5.2M nodes and 23.4M edges.
132
+
133
+ Implementation details We use the pre-trained BERT models (Devlin et al., 2019) using the uncased base configuration ( $d = 7 6 8$ ) for our retriever and the whole word masking uncased large (wwm) configuration ( $d = 1 0 2 4 ^ { \prime }$ ) for our readers. We follow Chen et al. (2017) for the TF-IDF-based retrieval model and use the same hyper-parameters. We tuned the most important hyper-parameters, $F$ , the number of the initial TF-IDF-based paragraphs, and $B$ , the beam size, by mainly using the HotpotQA development set (the effects of increasing $F$ are shown in Figure 5 in Appendix C.3 along with the results with $B = 1$ ). If not specified, we set $B = 8$ for all the datasets, $F = 5 0 0$ for HotpotQA full wiki and SQuAD Open, and $F = 1 0 0$ for Natural Questions Open.
134
+
135
+ <table><tr><td></td><td colspan="4">full wiki</td><td colspan="4">distractor</td></tr><tr><td></td><td colspan="2">QA</td><td colspan="2">SP</td><td colspan="2">QA</td><td colspan="2">SP</td></tr><tr><td>Models</td><td>F1</td><td>EM</td><td>F1</td><td>EM</td><td>F1</td><td>EM</td><td>F1</td><td>EM</td></tr><tr><td>Semantic Retrieval (Nie et al., 2019)</td><td>58.8</td><td>46.5</td><td>71.5</td><td>39.9</td><td>一</td><td></td><td></td><td>1</td></tr><tr><td>GoldEn Retriever (Qi et al.,2019)</td><td>49.8</td><td>1</td><td>64.6</td><td>一</td><td>1</td><td></td><td></td><td></td></tr><tr><td>Cognitive Graph (Ding et al., 2019)</td><td>49.4</td><td>37.6</td><td>58.5</td><td>23.1</td><td>一</td><td></td><td></td><td></td></tr><tr><td>DecompRC (Min et al.,2019c)</td><td>43.3</td><td></td><td></td><td></td><td>70.6</td><td></td><td></td><td></td></tr><tr><td>MUPPET (Feldman &amp; El-Yaniv,2019)</td><td>40.4</td><td>31.1</td><td>47.7</td><td>17.0</td><td>1</td><td></td><td>1</td><td></td></tr><tr><td>DFGN (Xiao et al., 2019)</td><td>1</td><td>1</td><td>1</td><td>1</td><td>69.2</td><td>55.4</td><td></td><td></td></tr><tr><td>QFE (Nishida et al., 2019)</td><td>1</td><td>1</td><td>1</td><td>一</td><td>68.7</td><td>53.7</td><td>84.7</td><td>58.8</td></tr><tr><td>Baseline (Yang et al., 2018)</td><td>34.4</td><td>24.7</td><td>41.0</td><td>5.3</td><td>58.3</td><td>44.4</td><td>66.7</td><td>22.0</td></tr><tr><td>Transformer-XH(Zhao et al., 2020)</td><td>62.4</td><td>50.2</td><td>71.6</td><td>42.2</td><td>1</td><td></td><td></td><td></td></tr><tr><td>Ours (Reader:BERT wwm)</td><td>73.3</td><td>60.5</td><td>76.1</td><td>49.3</td><td>81.2</td><td>68.0</td><td>1</td><td>1</td></tr><tr><td>Ours (Reader: BERT base)</td><td>65.8</td><td>52.7</td><td>75.0</td><td>47.9</td><td>73.3</td><td>59.4</td><td>85.2 84.6</td><td>58.6 57.4</td></tr></table>
136
+
137
+ Table 1: HotpotQA development set results: QA and SP (supporting fact prediction) results on HotpotQA’s full wiki and distractor settings. “–” denotes no results are available.
138
+
139
+ # 4.2 OVERALL RESULTS
140
+
141
+ Table 1 compares our method with previous published methods on the HotpotQA development set. Our method significantly outperforms all the previous results across the evaluation metrics under both the full wiki and distractor settings. Notably, our method achieves $1 4 . 5 \mathrm { F } 1$ and $1 4 . 0 \mathrm { E M }$ gains compared to state-of-the-art Semantic Retrieval (Nie et al., 2019) and 10.9 F1 gains over the concurrent Transformer-XH model (Zhao et al., 2020) on full wiki. We can see that our method, even with the BERT base configuration for our reader, significantly outperforms all the previous QA scores. Moreover, our method shows significant improvement in predicting supporting facts in the full wiki setting. We compare the performance of our approach to other models on the HotpotQA full wiki official hidden test set in Table 2. We outperform all the published and unpublished models including up-to-date work (marked with $\clubsuit$ ) by large margins in terms of QA performance.
142
+
143
+ On SQuAD Open, our model outperforms the concurrent state-of-the-art model (Wang et al., 2019b) by 2.9 F1 and 3.5 EM scores as shown in Table 3. Due to the fewer lexical overlap between questions and paragraphs on Natural Questions, pipelined approaches using term-based retrievers often face difficulties finding associated articles. Nevertheless, our approach matches the performance of the best end-to-end retriever (ORQA), as shown in Table 4. In addition to its competitive performance, our retriever can be handled on a single GPU machine, while a fully end-to-end retriever in general requires industry-scale computational resources for training (Seo et al., 2019). More results on these two datasets are discussed in Appendix D.
144
+
145
+ # 4.3 PERFORMANCE OF REASONING PATH RETRIEVAL
146
+
147
+ We compare our retriever with competitive retrieval methods for HotpotQA full wiki, with $F = 2 0$
148
+
149
+ TF-IDF (Chen et al., 2017), the widely used retrieval method that scores paragraphs according to the TF-IDF scores of the question-paragraph pairs. We simply select the top-2 paragraphs.
150
+
151
+ Re-rank (Nogueira & Cho, 2019) that learns to retrieve paragraphs by fine-tuning BERT to re-rank the top $F$ TF-IDF paragraphs. We select the top-2 paragraphs after re-ranking.
152
+
153
+ Re-rank 2hop which extends Re-rank to accommodate two-hop reasoning. It first adds paragraphs linked from the top TF-IDF paragraphs. It then uses the same BERT model to select the paragraphs.
154
+
155
+ Entity-centric IR is our re-implementation of Godbole et al. (2019) that is related to Re-rank 2hop, but instead of simply selecting the top two paragraphs, they re-rank the possible combinations of the paragraphs that are linked to each other.
156
+
157
+ Cognitive Graph (Ding et al., 2019) that uses the provided prediction results of the Cognitive Graph model on the HotpotQA development dataset.
158
+
159
+ Semantic Retrieval (Nie et al., 2019) that uses the provided prediction results of the state-of-the-art Semantic Retrieval model on the HotpotQA development dataset.
160
+
161
+ Retrieval results Table 5 shows that our recurrent retriever yields $8 . 8 \mathrm { ~ P ~ }$ EM and 9.1 AR, leading to the improvement of 10.3 QA EM over Semantic Retrieval. The significant improvement from
162
+
163
+ Table 2: HotpotQA full wiki test set results: official leaderboard results (on November 6, 2019) on the hidden test set of the HotpotQA full wiki setting. Work marked with ♣ appeared after September 25.
164
+
165
+ <table><tr><td colspan="2">Models QA</td><td colspan="2">SP</td></tr><tr><td>(*:anonymous)</td><td>F1 EM</td><td>F1</td><td>EM</td></tr><tr><td>Semantic Retrieval</td><td>57.3 45.3</td><td>70.8</td><td>38.7</td></tr><tr><td>GoldEn Retriever</td><td>48.6 37.9</td><td>64.2</td><td>30.7</td></tr><tr><td>Cognitive Graph</td><td>48.9 37.1</td><td>57.7</td><td>22.8</td></tr><tr><td>Entity-centric IR</td><td>46.3 35.4</td><td>43.2</td><td>0.06</td></tr><tr><td>MUPPET</td><td>40.3 30.6</td><td>47.3</td><td>16.7</td></tr><tr><td>DecompRC</td><td>40.7 30.0</td><td>1</td><td>1</td></tr><tr><td>QFE</td><td>38.1 28.7</td><td>44.4</td><td>14.2</td></tr><tr><td>Baseline</td><td>32.9 24.0</td><td>37.7</td><td>3.9</td></tr><tr><td>HGN*</td><td>69.2</td><td>56.7 76.4</td><td>50.0</td></tr><tr><td>MIR+EPS+BERT**</td><td>64.8 52.9</td><td>72.0</td><td>42.8</td></tr><tr><td>Transformer-XH*</td><td>60.8</td><td>49.0 70.0</td><td>41.7</td></tr><tr><td>Ours</td><td>73.0</td><td>60.0 76.4</td><td>49.1</td></tr></table>
166
+
167
+ Table 3: SQuAD Open results: we report F1 and EM scores on the test set of SQuAD Open, following previous work.
168
+
169
+ <table><tr><td>Models multi-passage (Wang et al.,2019b)</td><td>F1</td><td>EM</td></tr><tr><td>ORQA (Lee et al., 2019) BM25+BERT (Lee et al.,2019) Weaver (Raison et al.,2018) RE (Hu et al.,2019) MUPPET (Feldman &amp; El-Yaniv,2019) BERTserini (Yang et al., 2019) DENSPI-hybrid (Seo et al.,2019) MINIMAL (Min et al.,2018) Multi-step Reasoner (Das et al., 2019) Paragraph Ranker (Lee et al., 2018) R(Wang et al.,2018a)</td><td>60.9 1 1 1 50.2 46.2 46.1 44.4 42.5 39.2 1 37.5</td><td>53.0 20.2 33.2 42.3 41.9 39.3 38.6 36.2 34.7 31.9 30.2 29.1</td></tr><tr><td>DrQA (Chen et al., 2017) Ours</td><td>1 63.8</td><td>29.3 56.5</td></tr></table>
170
+
171
+ Table 4: Natural Questions Open results: we report EM scores on the test and development sets of Natural Questions Open, following previous work.
172
+
173
+ <table><tr><td rowspan="2">Models</td><td colspan="2">EM</td></tr><tr><td>Dev</td><td>Test</td></tr><tr><td>ORQA (Lee et al., 2019)</td><td>31.3</td><td>33.3</td></tr><tr><td>Hard EM (Min et al.,2019a)</td><td>28.8</td><td>28.1</td></tr><tr><td>BERT + BM 25 (Lee et al.,2019)</td><td>24.8</td><td>26.5</td></tr><tr><td>Ours</td><td>31.7</td><td>32.6</td></tr></table>
174
+
175
+ Table 5: Retrieval evaluation: Comparing our retrieval method with other methods across Answer Recall, Paragraph Recall, Paragraph EM, and QA EM metrics.
176
+
177
+ <table><tr><td>Models</td><td>AR</td><td>PR</td><td>P EM</td><td>EM</td></tr><tr><td>Ours (F= 20)</td><td>87.0</td><td>93.3</td><td>72.7</td><td>56.8</td></tr><tr><td>TF-IDF</td><td>39.7</td><td>66.9</td><td>10.0</td><td>18.2</td></tr><tr><td>Re-rank</td><td>55.1</td><td>85.9</td><td>29.6</td><td>35.7</td></tr><tr><td>Re-rank 2hop</td><td>56.0</td><td>70.1</td><td>26.1</td><td>38.8</td></tr><tr><td>Entity-centric IR</td><td>63.4</td><td>87.3</td><td>34.9</td><td>42.0</td></tr><tr><td>Cognitive Graph</td><td>76.0</td><td>87.6</td><td>57.8</td><td>37.6</td></tr><tr><td>Semantic Retrieval</td><td>77.9</td><td>93.2</td><td>63.9</td><td>46.5</td></tr></table>
178
+
179
+ Re-rank2hop to Entity-centric IR demonstrates that exploring entity links from the initially retrieved documents helps to retrieve the paragraphs with fewer lexical overlaps. On the other hand, comparing our retriever with Entity-centric IR and Semantic Retrieval shows the importance of learning to sequentially retrieve reasoning paths in the Wikipedia graph. It should be noted that our method with $F = 2 0$ outperforms all the QA EM scores in Table 1.
180
+
181
+ # 4.4 ANALYSIS
182
+
183
+ We conduct detailed analysis of our framework on the HotpotQA full wiki development set.
184
+
185
+ Ablation study of our framework To study the effectiveness of our modeling choices, we compare the performance of variants of our framework. We ablate the retriever with 1) No recurrent module, which removes the recurrence from our retriever, and computes the probability of each paragraph to be included in reasoning paths independently and selects the path with the highest joint probability path on the graph; 2) No beam search, which uses a greedy search $B = 1$ ) in our recurrent retriever; 3) No link-based negative examples, which trains the retriever model without adding hyperlink-based negative examples besides TF-IDF-based negative examples.
186
+
187
+ We ablate the reader model with 1) No reasoning path re-ranking, which outputs the answer only with the best reasoning path from the retriever model, and 2) No negative examples, which trains the model only with the gold paragraphs, removing $L _ { \mathrm { n o \_ a n s w e r } }$ from $L _ { \mathrm { r e a d } }$ . During inference,“No negative examples” reads all the paths and outputs an answer with the highest answer probability.
188
+
189
+ Table 6: Ablation study: evaluating different variants of our model on HotpotQA full wiki.
190
+
191
+ <table><tr><td>Settings (F = 100)</td><td>F1</td><td>EM</td></tr><tr><td>full retriever, no recurrent module retriever, no beam search retriever, no link-based negatives</td><td>72.4 52.5 68.7 64.1</td><td>59.5 42.1 56.2 52.6</td></tr><tr><td>reader, no reasoning path re-ranking reader, no negative examples</td><td>70.1 53.7</td><td>57.4 43.3</td></tr></table>
192
+
193
+ Table 7: Performance with different link structures: comparing our results on the Hotpot QA full wiki development set when we use an off-the-shelf entity linking system instead of the Wikipedia hyperlinks.
194
+
195
+ <table><tr><td rowspan=1 colspan=1>Settings (F = 100)</td><td rowspan=1 colspan=1>F1</td><td rowspan=1 colspan=1>EM</td></tr><tr><td rowspan=1 colspan=1>with hyperlinks with entity linking system</td><td rowspan=1 colspan=1>72.470.1</td><td rowspan=1 colspan=1>59.557.3</td></tr></table>
196
+
197
+ Table 8: Performance with different reasoning path length: comparing the performance with different path length on HotpotQA full wiki. $L$ -step retrieval sets the number of the reasoning steps to a fixed number.
198
+
199
+ <table><tr><td rowspan=1 colspan=3>Settings (F = 100) F1</td><td rowspan=1 colspan=1>EM</td></tr><tr><td rowspan=1 colspan=2>Adaptive retrieval</td><td rowspan=1 colspan=1>72.4</td><td rowspan=1 colspan=1>59.5</td></tr><tr><td rowspan=1 colspan=1>L-step retrieval</td><td rowspan=1 colspan=1>L=1L=2L=3L=4</td><td rowspan=1 colspan=1>45.871.470.166.3</td><td rowspan=1 colspan=1>35.558.557.753.9</td></tr></table>
200
+
201
+ Table 9: Statistics of the reasoning paths: the average length and the distribution of length of the reasoning paths selected by our retriever and reader for HotpotQA full wiki. Avg. EM represents QA EM performance.
202
+
203
+ <table><tr><td>(F=100)</td><td>Retriever</td><td>Reader</td><td>EM</td></tr><tr><td>Avg.#ofL</td><td>1.96</td><td>2.21</td><td>with L</td></tr><tr><td>1</td><td>539</td><td>403</td><td>31.2</td></tr><tr><td>2</td><td>6,639</td><td>5,655</td><td>60.0</td></tr><tr><td>3</td><td>227</td><td>1,347</td><td>63.0</td></tr></table>
204
+
205
+ Ablation results Table 6 shows that removing any of the listed components gives notable performance drop. The most critical component in our retriever model is the recurrent module, dropping the EM by 17.4 points. As shown in Figure 1, multi-step retrieval often relies on information mentioned in another paragraph. Therefore, without conditioning on the previous time steps, the model fails to retrieve the complete evidence. Training without hyperlink-based negative examples results in the second largest performance drop, indicating that the model can be easily distracted by reasoning paths without a correct answer and the importance of negative sampling for training. Replacing the beam search with the greedy search gives a performance drop of about 4 points on EM, which demonstrates that being aware of the graph structure is helpful in finding the best reasoning paths.
206
+
207
+ Performance drop by removing the reasoning path re-ranking indicates the importance of verifying the reasoning paths in our reader. Not using negative examples to train the reader degrades EM more than 16 points, due to the over-confident predictions as discussed in Clark & Gardner (2018).
208
+
209
+ The performance with an off-the-shelf entity linking system Although the existence of the hyperlinks is not special on the web, one question is how well our method works without the Wikipedia hyperlinks. We evaluate our method on the development set of HotpotQA full wiki with an off-theshelf entity linking system (Ferragina & Scaiella, 2011) to construct the document graph in our method. More details about this experimental setup can be found in Appendix B.7. Table 7 shows that our approach with the entity linking system shows only $2 . 3 \ \mathrm { F 1 }$ and $2 . 2 \ : \mathrm { E M }$ lower scores than those with the hyperlinks, still achieving the state of the art. This suggests that our approach is not restricted to the existence of the hyperlink information, and using hyperlinks is promising.
210
+
211
+ The effectiveness of arbitrary-step retrieval The existing iterative retrieval methods fix the number of reasoning steps (Qi et al., 2019; Das et al., 2019; Godbole et al., 2019; Feldman & El-Yaniv, 2019), while our approach accommodates arbitrary steps of reasoning. We also evaluate our method by fixing the length of the reasoning path $( L = \{ 1 , 2 , 3 , 4 \} )$ ). Table 8 shows that out adaptive retrieval performs the best, although the length of all the annotated reasoning paths in HotpotQA is two. As discussed in Min et al. (2019b), we also observe that some questions are answerable based on a single paragraph, where our model flexibly selects a single paragraph and then terminates retrieval.
212
+
213
+ The effectiveness of the interplay between retriever and reader Table 6 shows that the interplay between our retriever and reader models is effective. To understand this, we investigate the length of reasoning paths selected by our retriever and reader, and their final QA performance. Table 9 shows that the average length selected by our reader is notably longer than that by our retriever. Table 9 also presents the EM scores averaged over the questions with certain length of reasoning paths $( { \cal L } = \{ 1 , 2 , 3 \}$ ). We observe that our framework performs the best when it selects the reasoning paths with $L = 3$ , showing 63.0 EM score. Based on these observations, we expect the retriever favors a shorter path, while the reader tends to select a longer and more convincing multi-hop reasoning path to derive an answer string.
214
+
215
+ ![](images/2fab0de0d7ea4ea2c84b83905bb731f86e9b84a148e117a4942926d8a1522819.jpg)
216
+ Figure 3: Reasoning examples by our model (two paragraphs connected by a dotted line) and Re-rank (the bottom two paragraphs). Highlighted text denotes a bridge entity, and blue-underlined text represents hyperlinks.
217
+
218
+ ![](images/c8edbf87b7a401b990a6b1ccdeeb34aa6ffaded0ec76ec6dca1c3b92f5a620b7.jpg)
219
+ Figure 4: Reasoning examples by our retriever (the bottom paragraph) and our reader (two paragraphs connected by a dotted line). Highlighted text denotes a bridge entity, and blue-underlined text represents hyperlinks.
220
+
221
+ Qualitative examples of retrieved reasoning paths Finally, we show two examples from HotpotQA full wiki, and Appendix C.5 presents more qualitative examples. In Figure 3, our approach successfully retrieves the correct reasoning path and answers correctly, while Re-rank fails. The top two paragraphs next to the graph are the introductory paragraphs of the two entities on the reasoning path, and the paragraph at the bottom shows the wrong paragraph selected by Re-rank. The “Millwall F.C.” has fewer lexical overlaps and the bridge entity “Millwall” is not stated in the given question. Thus, Re-rank chooses a wrong paragraph with high lexical overlaps to the given question. In Figure 4, we compare the reasoning paths ranked highest by our retriever and reader. Although the gold path is included among the top 8 paths selected by the beam search, our retriever model selects a wrong paragraph as the best reasoning path. By re-ranking the reasoning paths, the reader eventually selects the correct reasoning path (“2017-18 Wigan Athletic F.C. season” “EFL Cup”). This example shows the effectiveness of the strong interplay of our retriever and reader.
222
+
223
+ # 5 CONCLUSION
224
+
225
+ This paper introduces a new graph-based recurrent retrieval approach, which retrieves reasoning paths over the Wikipedia graph to answer multi-hop open-domain questions. Our retriever model learns to sequentially retrieve evidence paragraphs to form the reasoning path. Subsequently, our reader model re-ranks the reasoning paths, and it determines the final answer as the one extracted from the best reasoning path. Our experimental results significantly advance the state of the art on HotpotQA by more than 14 points absolute gain on the full wiki setting. Our approach also achieves the state-of-the-art performance on SQuAD Open and Natural Questions Open without any architectural changes, demonstrating the robustness of our method. Our method provides insights into the underlying entity relationships, and the discrete reasoning paths are helpful in interpreting our framework’s reasoning process. Future work involves end-to-end training of our graph-based recurrent retriever and reader for improving upon our current two-stage training.
226
+
227
+ # ACKNOWLEDGMENTS
228
+
229
+ We acknowledge grants from ONR N00014-18-1-2826, DARPA N66001-19-2-403, NSF (IIS1616112, IIS1252835), and Samsung GRO. We thank Sewon Min, David Wadden, Yizhong Wang, Akhilesh Gotmare, Tong Niu, and UW NLP group and Salesforce research members for their insightful discussions. We would also like to show our gratitude to Melvin Gruesbeck for providing us with the artistic figures presented in this paper. We thank the anonymous reviewers for their helpful and thoughtful comments. Akari Asai is supported by The Nakajima Foundation Fellowship.
230
+
231
+ # REFERENCES
232
+
233
+ Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv:1607.06450, 2016.
234
+
235
+ Danqi Chen, Adam Fisch, Jason Weston, and Antoine Bordes. Reading Wikipedia to answer opendomain questions. In ACL, 2017.
236
+
237
+ Christopher Clark and Matt Gardner. Simple and effective multi-paragraph reading comprehension. In ACL, 2018.
238
+
239
+ Rajarshi Das, Shehzaad Dhuliawala, Manzil Zaheer, and Andrew McCallum. Multi-step retrieverreader interaction for scalable open-domain question answering. In ICLR, 2019.
240
+
241
+ Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In NAACL, 2019.
242
+
243
+ Ming Ding, Chang Zhou, Chang Zhou, Qibin Chen, Hongxia Yang, and Jie Tang. Cognitive graph for multi-hop reading comprehension at scale. In ACL, 2019.
244
+
245
+ Yair Feldman and Ran El-Yaniv. Multi-hop paragraph retrieval for open-domain question answering. In ACL, 2019.
246
+
247
+ Paolo Ferragina and Ugo Scaiella. Fast and accurate annotation of short texts with wikipedia pages. IEEE software, 29(1):70–75, 2011.
248
+
249
+ Ameya Godbole, Dilip Kavarthapu, Rajarshi Das, Zhiyu Gong, Abhishek Singhal, Xiaoxiao Yu, Mo Guo, Tian Gao, Hamed Zamani, Manzil Zaheer, and Andrew McCallum. Multi-step entitycentric information retrieval for multi-hop question answering. In Proceedings of the 2nd Workshop on Machine Reading for Question Answering, 2019.
250
+
251
+ Minghao Hu, Yuxing Peng, Zhen Huang, and Dongsheng Li. Retrieve, read, rerank: Towards endto-end multi-document reading comprehension. In ACL, 2019.
252
+
253
+ Hakan Inan, Khashayar Khosravi, and Richard Socher. Tying word vectors and word classifiers: A loss framework for language modeling. In ICLR, 2017.
254
+
255
+ Diederik P. Kingma and Jimmy Ba. Adam: A Method for Stochastic Optimization. In ICLR, 2015.
256
+
257
+ Bernhard Kratzwald and Stefan Feuerriegel. Adaptive document retrieval for deep question answering. In EMNLP, 2018.
258
+
259
+ Tom Kwiatkowski, Jennimaria Palomaki, Olivia Rhinehart, Michael Collins, Ankur Parikh, Chris Alberti, Danielle Epstein, Illia Polosukhin, Matthew Kelcey, Jacob Devlin, et al. Natural questions: a benchmark for question answering research. TACL, 2019.
260
+
261
+ Jinhyuk Lee, Seongjun Yun, Hyunjae Kim, Miyoung Ko, and Jaewoo Kang. Ranking paragraphs for improving answer recall in open-domain question answering. In EMNLP, 2018.
262
+
263
+ Kenton Lee, Ming-Wei Chang, and Kristina Toutanova. Latent retrieval for weakly supervised open domain question answering. In ACL, 2019.
264
+
265
+ Yankai Lin, Haozhe Ji, Zhiyuan Liu, and Maosong Sun. Denoising distantly supervised opendomain question answering. In ACL, 2018.
266
+
267
+ Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. RoBERTa: A robustly optimized bert pretraining approach. arXiv:1907.11692, 2019.
268
+
269
+ Sewon Min, Victor Zhong, Richard Socher, and Caiming Xiong. Efficient and robust question answering from minimal context over documents. In ACL, 2018.
270
+
271
+ Sewon Min, Danqi Chen, Hannaneh Hajishirzi, and Luke Zettlemoyer. A discrete hard em approach for weakly supervised question answering. In EMNLP, 2019a.
272
+
273
+ Sewon Min, Eric Wallace, Sameer Singh, Matt Gardner, Hannaneh Hajishirzi, and Luke Zettlemoyer. Compositional questions do not necessitate multi-hop reasoning. In ACL, 2019b.
274
+
275
+ Sewon Min, Victor Zhong, Luke Zettlemoyer, and Hannaneh Hajishirzi. Multi-hop reading comprehension through question decomposition and rescoring. In ACL, 2019c.
276
+
277
+ Yixin Nie, Songhe Wang, and Mohit Bansal. Revealing the importance of semantic retrieval for machine reading at scale. In EMNLP, 2019.
278
+
279
+ Kosuke Nishida, Kyosuke Nishida, Nagata Masaaki, Atsushi Otsuka, Itsumi Saito, Hisako Asano, and Junji Tomita. Answering while summarizing: Multi-task learning for multi-hop qa with evidence extraction. In ACL, 2019.
280
+
281
+ Rodrigo Nogueira and Kyunghyun Cho. Passage re-ranking with BERT. arXiv:1901.04085, 2019.
282
+
283
+ Myle Ott, Sergey Edunov, David Grangier, and Michael Auli. Scaling neural machine translation. In WMT, 2018.
284
+
285
+ Ofir Press and Lior Wolf. Using the output embedding to improve language models. In EACL, 2017.
286
+
287
+ Peng Qi, Xiaowen Lin, Leo Mehr, Zijian Wang, and Christopher D. Manning. Answering complex open-domain questions through iterative query generation. In EMNLP, 2019.
288
+
289
+ Martin Raison, Pierre-Emmanuel Mazare, Rajarshi Das, and Antoine Bordes. Weaver: Deep co- ´ encoding of questions and documents for machine reading. arXiv:1804.10490, 2018.
290
+
291
+ Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. SQuAD: $1 0 0 { , } 0 0 0 { + }$ questions for machine comprehension of text. In EMNLP, 2016.
292
+
293
+ Pranav Rajpurkar, Robin Jia, and Percy Liang. Know what you don’t know: Unanswerable questions for SQuAD. In ACL, 2018.
294
+
295
+ Tim Salimans and Durk P Kingma. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. In NeurIPS, 2016.
296
+
297
+ Minjoon Seo, Aniruddha Kembhavi, Ali Farhadi, and Hannaneh Hajishirzi. Bidirectional attention flow for machine comprehension. In ICLR, 2017.
298
+
299
+ Minjoon Seo, Jinhyuk Lee, Tom Kwiatkowski, Ankur P Parikh, Ali Farhadi, and Hannaneh Hajishirzi. Real-time open-domain question answering with dense-sparse phrase index. In ACL, 2019.
300
+
301
+ Haitian Sun, Tania Bedrax-Weiss, and William Cohen. PullNet: Open domain question answering with iterative retrieval on knowledge bases and text. In EMNLP, 2019.
302
+
303
+ Haoyu Wang, Mo Yu, Xiaoxiao Guo, Rajarshi Das, Wenhan Xiong, and Tian Gao. Do multi-hop readers dream of reasoning chains? In Proceedings of the 2nd Workshop on Machine Reading for Question Answering, 2019a.
304
+
305
+ Shuohang Wang, Mo Yu, Xiaoxiao Guo, Zhiguo Wang, Tim Klinger, Wei Zhang, Shiyu Chang, Gerry Tesauro, Bowen Zhou, and Jing Jiang. ${ \tt R } ^ { 3 }$ : Reinforced ranker-reader for open-domain question answering. In AAAI, 2018a.
306
+
307
+ Shuohang Wang, Mo Yu, Jing Jiang, Wei Zhang, Xiaoxiao Guo, Shiyu Chang, Zhiguo Wang, Tim Klinger, Gerald Tesauro, and Murray Campbell. Evidence aggregation for answer re-ranking in open-domain question answering. In ICLR, 2018b.
308
+
309
+ Zhiguo Wang, Patrick Ng, Ramesh Nallapati, and Bing Xiang. Multi-passage BERT: A globally normalized bert model for open-domain question answering. In EMNLP, 2019b.
310
+
311
+ Yunxuan Xiao, Yanru Qu, Lin Qiu, Hao Zhou, Lei Li, Weinan Zhang, and Yong Yu. Dynamically fused graph network for multi-hop reasoning. In ACL, 2019.
312
+
313
+ Caiming Xiong, Victor Zhong, and Richard Socher. Dynamic coattention networks for question answering. In ICLR, 2017.
314
+
315
+ Wei Yang, Yuqing Xie, Aileen Lin, Xingyu Li, Luchen Tan, Kun Xiong, Ming Li, and Jimmy Lin. End-to-end open-domain question answering with BERTserini. In NAACL (Demonstrations), 2019.
316
+
317
+ Zhilin Yang, Peng Qi, Saizheng Zhang, Yoshua Bengio, William Cohen, Ruslan Salakhutdinov, and Christopher D. Manning. HotpotQA: A dataset for diverse, explainable multi-hop question answering. In EMNLP, 2018.
318
+
319
+ Chen Zhao, Chenyan Xiong, Corby Rosset, Xia Song, Paul Bennett, and Saurabh Tiwary. Transformer-XH: Multi-hop question answering with extra hop attention. In ICLR, 2020.
320
+
321
+ # APPENDIX
322
+
323
+ # A DETAILS ABOUT MODELING
324
+
325
+ A.1 A NORMALIZED RNN
326
+
327
+ We decompose Equation (4) as follows:
328
+
329
+ $$
330
+ a _ { t + 1 } = W _ { r } [ h _ { t } ; w _ { i } ] + b _ { r } , \quad h _ { t + 1 } = \frac { \alpha } { \left\| a _ { t + 1 } \right\| } a _ { t + 1 } ,
331
+ $$
332
+
333
+ where $W _ { r } \in \mathbb { R } ^ { d \times 2 d }$ is a weight matrix, $b _ { r } \in \mathbb { R } ^ { d }$ is a bias vector, and $\alpha \in \mathbb { R } ^ { 1 }$ is a scalar parameter (initialized with 1.0). We set the global initial state $a _ { 1 }$ to a parameterized vector $s \in \mathbb { R } ^ { d }$ , and we also parameterize an [EOE] vector $w _ { [ \mathrm { E O E } ] } \in \mathbb { R } ^ { d }$ for the [EOE] symbol. The use of $w _ { i }$ for both the input and output layers is inspired by Inan et al. (2017); Press & Wolf (2017). In addition, we align the norm of $w _ { \mathrm { [ E O E ] } }$ with those of $w _ { i }$ , by applying layer normalization (Ba et al., 2016) of the last layer in BERT because $w _ { \mathrm { [ E O E ] } }$ is used along with the BERT outputs. Without the layer normalization, the $L 2$ -norms of $w _ { i }$ and $w _ { \mathrm { [ E O E ] } }$ can be quite different, and the model can easily discriminate between them by the difference of the norms.
334
+
335
+ # A.2 QUESTION-PARAGRAPH ENCODING IN OUR RETRIEVER COMPONENT
336
+
337
+ Equation (2) shows that we compute each paragraph representation $w _ { i }$ conditioned on the question $q$ . An alternative approach is separately encoding the paragraphs and the question, to directly retrieve paragraphs (Lee et al., 2019; Seo et al., 2019; Das et al., 2019). However, due to the lack of explicit interactions between the paragraphs and the question, such a neural retriever using questionindependent paragraph encodings suffers from compressing the necessary information into fixeddimensional vectors, resulting in low performance on entity-centric questions (Lee et al., 2019). It has been shown that attention-based paragraph-question interactions improve the retrieval accuracy if the retrieval scale is tractable (Wang et al., 2018a; Lee et al., 2018). There is a trade-off between the scalability and the accuracy, and this work aims at striking the balance by jointly using the lexical matching retrieval and the graphs, followed by the rich question-paragraph encodings.
338
+
339
+ A question-independent variant We can also formulate our retriever model by using a questionindependent approach. There are only two simple modifications. First, we reformulate Equation (2) as follows:
340
+
341
+ $$
342
+ w _ { i } = \mathrm { B E R T } _ { [ \mathrm { C L S } ] } ( p _ { i } ) ,
343
+ $$
344
+
345
+ where we no longer input the question $q$ together with the paragraphs. Next, we condition the initial RNN state $h _ { 1 }$ on the question information. More specifically, we compute $h _ { 1 }$ by using Equation (4) as follows:
346
+
347
+ $$
348
+ \begin{array} { l } { { w _ { q } = \mathrm { B E R T } _ { [ \mathrm { C L S } ] } ( q ) , } } \\ { { h _ { 1 } = \mathrm { R N N } ( h _ { 1 } ^ { \prime } , w _ { q } ) , } } \end{array}
349
+ $$
350
+
351
+ where $w _ { q }$ is computed by using the same BERT encoder as in Equation (10), and $h _ { 1 } ^ { \prime }$ is the original $h _ { 1 }$ used in our question-dependent approach as described in Appendix A.1. The remaining parts are exactly the same, and we can perform the reasoning path retrieval in the same manner.
352
+
353
+ # A.3 WHY IS THE INTERPLAY IMPORTANT?
354
+
355
+ Our retriever model learns to predict plausibility of the reasoning paths by capturing the paragraph interactions through the BERT’s [CLS] representations, after independently encoding the paragraphs along with the question; this makes our retriever scalable to the open-domain scenario. By contrast, our reader jointly learns to predict the plausibility and answer the question, and moreover, fully leverages the self-attention mechanism across the concatenated paragraphs in the retrieved reasoning paths; this paragraph interaction is crucial for multi-hop reasoning (Wang et al., 2019a). In summary, our retriever is scalable, but the top-1 prediction is not always enough to fully capture multi-hop reasoning to answer the question. Therefore, the additional re-ranking process mitigates the uncertainty and makes our framework more robust.
356
+
357
+ # A.4 HANDLING YES-NO QUESTIONS IN OUR READER COMPONENT
358
+
359
+ In the HotpotQA dataset, we need to handle yes-no questions as well as extracting answer spans from the paragraphs. We treat the two special types of the answers, yes and no, by extending the re-ranking model in Equation (6). In particular, we extend the binary classification to a multi-class classification task, where the positive “answerable” class is decomposed into the following three classes: span, yes, and no. If the probability of “yes” or “no” is the largest among the three classes, our reader directly outputs the label as the answer, without any span extraction. Otherwise, our reader uses the span extraction model to output the answer.
360
+
361
+ # A.5 SUPPORTING FACT PREDICTION IN HOTPOTQA
362
+
363
+ We adapt our recurrent retriever to the subtask of the supporting fact prediction in HotpotQA (Yang et al., 2018). The task is outputting sentences which support to answer the question. Such supporting sentences are annotated for the two ground-truth paragraphs in the training data. Since our framework outputs the most plausible reasoning path $E$ along with the answer, we can add an additional step to select supporting facts (sentences) from the paragraphs in $E$ . We train our recurrent retriever by using the training examples for the supporting fact prediction task, where the model parameters are not shared with those of our paragraph retriever. We replace the question-paragraph encoding in Equation (2) with question-answer-sentence encoding for the task, where a question string is concatenated with its answer string. The answer string is the ground-truth one during the training time. We then maximize the probability of selecting the ground-truth sequence of the supporting fact sentences, while setting the other sentences as negative examples. At test time, we use the best reasoning path and its predicted answer string from our retriever and reader models to finally output the supporting facts for each question. The supporting fact prediction task is performed after finalizing the reasoning path and the answer for each question, and hence this additional task does not affect the QA accuracy.
364
+
365
+ # B DETAILS ABOUT EXPERIMENTS
366
+
367
+ # B.1 DATASET DETAILS OF HOTPOTQA, SQUAD OPEN AND NATURAL QUESTIONS OPEN
368
+
369
+ HotpotQA The HotpotQA training, development, and test datasets contain 90,564, 7,405 and 7,405 questions, respectively. To train our retriever model for the distractor setting, we use the distractor training data, where only the original ten paragraphs are associated with each question. The retriever model trained with this setting is also used in our ablation study as “retriever, no linkbased negatives” in Table 6. For the full wiki setting, we train our retriever model with the data augmentation technique and the additional negative examples described in Section 3.1.2. We use the same reader model, for both the settings, trained with the augmented additional references and the negative examples described in Section 3.2.
370
+
371
+ SQuAD Open and Natural Questions Open For SQuAD Open, we use the original training set (containing 78,713 questions) as our training data, and the original development set (containing 10,570 questions) as our test data. For Natural Questions Open, we follow the dataset splits provided by Min et al. (2019a), and the training, development and test datasets contain 79,168, 8,757 and 3,610, respectively. For both the SQuAD Open and Natural Questions Open, we train our reader on the original examples with the augmented additional negative examples and the distantly supervised examples described in Section 3.2.
372
+
373
+ # B.2 DERIVING GROUND-TRUTH REASONING PATHS
374
+
375
+ Section 3.1.2 describes our training strategy for our recurrent retriever. We apply the data augmentation technique to HotpotQA and Natural Questions to consider multi-hop reasoning. To derive the ground-truth reasoning path $g$ , we use the ground-truth evidence paragraphs associated with the questions in the training data for each dataset. For SQuAD and Natural Questions Open, each training example has only single paragraph $p$ , and thus it is trivial to derive $g$ as $[ p , [ \mathrm { E O E } ] ]$ . For the multi-hop case, HotpotQA, we have two ground-truth paragraphs $p _ { 1 } , p _ { 2 }$ for each question. Assuming that $p _ { 2 }$ includes the answer string, we set $g = [ p _ { 1 } , \bar { p } _ { 2 }$ , $[ \mathrm { E O E } ] ]$ .
376
+
377
+ # B.3 DETAILS ABOUT NEGATIVE EXAMPLES FOR OUR READER MODEL IN SQUAD OPEN AND NATURAL QUESTIONS OPEN
378
+
379
+ To train our reader model for SQuAD Open, in addition to the TF-IDF top-ranked paragraphs, we add two types of additional negative examples: (i) paragraphs, which do not include the answer string, from the originally annotated articles, and (ii) “unanswerable” questions from SQuAD 2.0 (Rajpurkar et al., 2018). For Natural Questions Open, we add negative examples of the type (i).
380
+
381
+ # B.4 TRAINING SETTINGS
382
+
383
+ To use the pre-trained BERT models, we used the public code base, pytorch-transformers,4 written in PyTorch.5 For optimization, we used the code base’s implementation of the Adam optimizer (Kingma & Ba, 2015), with a weight-decay coefficient of 0.01 for non-bias parameters. A warm-up strategy in the code base was also used, with a warm-up rate of 0.1. Most of the settings follow the default settings. To train our recurrent retriever, we set the learning rate to $3 \cdot 1 0 ^ { - 5 }$ , and the maximum number of the training epochs to three. The mini-batch size is four; a mini-batch example consists of a question with its corresponding paragraphs. To train our reader model, we set the learning rate to $3 \cdot 1 0 ^ { - 5 }$ , and the maximum number of training epochs to two. Empirically we observe better performance with a larger batch size as discussed in previous work (Liu et al., 2019; Ott et al., 2018), and thus we set the mini-batch size to 120. A mini-batch example consists of a question with its evidence paragraphs. We will release our code to follow our experiments.
384
+
385
+ # B.5 THE WIKIPEDIA DUMPS FOR EACH DATASET
386
+
387
+ For HotpotQA full wiki, we use the pre-processed English Wikipedia dump from October, 2017, provided by the HotpotQA authors.6 For Natural Questions Open, we use the English Wikipedia dump from December 20, 2018, following Lee et al. (2019) and Min et al. (2019a). For SQuAD Open, we use the Wikipedia dump provided by Chen et al. (2017).
388
+
389
+ Although using a single dump for different open-domain QA datasets is a common practice (Chen et al., 2017; Wang et al., 2018a; Lee et al., 2018), this potentially causes inconsistent or even unfair evaluation across different experimental settings, due to the temporal inconsistency of the Wikipedia articles. More concretely, every Wikipedia article is editable and and as a result, a fact can be rephrased or could be removed. For instance, a question from the SQuAD development set, “Where does Kenya rank on the CPI scale?” is originally paired with a paragraph from the article of Kenya. Based on a single sentence “Kenya ranks low on Transparency International’s Corruption Perception Index (CPI)” from the paragraph, an annotated answer span is “low.” However, this sentence has been rewritten as “Kenya has a high degree of corruption according to Transparency International’s Corruption Perception Index (CPI)” in a later version of the same article.7 This is problematic considering the major evaluation metrics based on string matching.
390
+
391
+ Another problem exists especially in Natural Questions Open. The dataset contains real Google search queries, and some of them reflect temporal trends at the time when the queries were executed. If a query is related to a TV show broadcasted in 2018, we can hardly expect to extract the answer from a dump in 2017.
392
+
393
+ Like this, although Wikipedia is a useful knowledge source for open-domain QA research, its rapidly evolving nature should be considered more carefully for the reproducibility. We will make all of the data including pre-processed Wikipedia articles for each experiment available for future research.
394
+
395
+ B.6 DETAILS ABOUT INITIAL CANDIDATES $C _ { 1 }$ SELECTION
396
+
397
+ To retrieve the initial candidates $C _ { 1 }$ for each question, we use a TF-IDF based retriever with the bi-gram hashing (Chen et al., 2017). For HotpotQA full wiki, we retrieve top $F$ introductory paragraphs, for each question, from a corpus including all the introductory paragraphs. For SQuAD Open and Natural Questions Open, we first retrieve 50 Wikipedia articles through the same TF-IDF retriever, and further run another TF-IDF-based paragraph retriever (Clark & Gardner, 2018; Min et al., 2019a) to retrieve $F$ paragraphs in total.
398
+
399
+ # B.7 DETAILS ABOUT ENTITY LINKING EXPERIMENT
400
+
401
+ We experiment with a variant of our approach, where we incorporate an entity linking system with our framework, in place of the Wikipedia hyperlinks. In this experiment, we first retrieve seed paragraphs using TF-IDF $F = 1 0 0$ ), and run an off-the-shelf entity linker (TagMe by Ferragina & Scaiella (2011)) over the paragraphs. If the entity linker detects some entities, we retrieve their corresponding Wikipedia articles, and add edges from the seed paragraphs to the entity-linked paragraphs. Once we build the graph, then we re-run all of the experiments while the other components are exactly the same. We use the TagMe official Python wrapper.8
402
+
403
+ # C ADDITIONAL RESULTS ON HOTPOTQA
404
+
405
+ # C.1 UPPER-BOUND OF OUR RETRIEVAL MODULE
406
+
407
+ For scalability and computational efficiency, we bootstrap our retrieval module with TF-IDF retrieval; we first retrieval $F$ paragraphs using TF-IDF with the method described in Section B.6 and initialize $C _ { 1 }$ with these TF-IDF paragraphs. Although we expand our candidate paragraphs at each time step using the Wikipedia graph, if our method failed to retrieve paragraphs a few-hops away from the answer paragraphs, it is likely to fail to reach the answer paragraphs. To estimate the paragraph EM upper-bound, we have checked if two gold paragraphs are included in the top 20 TF-IDF paragraphs and their hyperlinked paragraphs in the HotpotQA full wiki setting. We found that for $7 5 . 4 \%$ of the questions, all of the gold paragraphs are included in the collections of the TF-IDF paragraphs and the hyperlinked paragraphs. Also, it should be noted when we only consider the TF-IDF retrieval results, the upper-bound drops to $3 5 . 1 \%$ , which suggests that the TF-IDF-based retrieval cannot effectively discover the paragraphs multi-hop away due to the few lexical overlap. When we increase the number of $F$ to 100 and 500, the upper-bound reaches $8 4 . 1 \%$ and $8 9 . 2 \%$ , respectively.
408
+
409
+ C.2 PER-CATEGORY QUESTION ANSWERING AND RETRIEVAL PERFORMANCE ON HOTPOTQA FULL WIKI
410
+
411
+ In HotpotQA, there are two types of questions, bridge and comparison. While comparison-type questions explicitly mention the two entities related to the given questions, in bridge-type questions, the bridge entities are rarely explicitly stated. This makes it hard for a retrieval system to discover the paragraphs entailed by the bridge entities only.
412
+
413
+ We evaluate the question answering and paragraph retrieval performance for each of the two question types. We compare the PR, P EM and QA EM for each of the two categories with two state-of-theart models, Cognitive Graph (Ding et al., 2019) and Semantic Retrieval (Nie et al., 2019). Here, we set our initial TF-IDF number $F$ to 500. Table 10 shows that our retriever yields $1 6 . 5 \mathrm { ~ P ~ }$ EM
414
+
415
+ <table><tr><td></td><td colspan="3">Total (7,405)</td><td colspan="3">Bridge (5.918)</td><td colspan="3">Comp (1,487)</td></tr><tr><td>Models</td><td>PR</td><td>PEM</td><td>EM</td><td>PR</td><td>PEM</td><td>EM</td><td>PR</td><td>PEM</td><td>EM</td></tr><tr><td>Ours_</td><td>94.3</td><td>75.7</td><td>60.5</td><td>93.9</td><td>73.7</td><td>57.8</td><td>98.7</td><td>83.5</td><td>70.5</td></tr><tr><td>Cognitive Graph (Ding et al., 2019)</td><td>87.6</td><td>57.8</td><td>-37.5</td><td>84.8</td><td>51.8</td><td>-36.1</td><td>98.6</td><td>81.6</td><td>53.7</td></tr><tr><td>Semantic Retrieval (Nie et al.,2019)</td><td>93.2</td><td>63.9</td><td>46.5</td><td>91.6</td><td>57.2</td><td>42.7</td><td>99.7</td><td>90.6</td><td>61.7</td></tr></table>
416
+
417
+ Table 10: Retrieval evaluation: Comparing our retrieval method with other methods across Answer Recall, Paragraph Recall, Paragraph EM, and QA EM metrics.
418
+
419
+ ![](images/6f898a3f08d4a52be317f5fb6fded715c90a3b2b814f49b909f439c573030551.jpg)
420
+ Figure 5: Robustness to the increase of $F$ . We compare the F1 scores of our model, our model without a beam search and Re-rank with different number of $F$ .
421
+
422
+ gain and 15.1 EM gain over Semantic Retrieval for the challenging bridge-type questions. For the comparison-type questions, our method achieves almost 10 point higher QA EM than Semantic Retrieval. We observed that some of the comparison-type questions can be answered based on single paragraph, and thus our model selects only one paragraph for some of these comparisontype questions, resulting in lower P EM scores on the comparison-type questions. We show several examples of the questions where we can answer based on single paragraph in Section C.5.
423
+
424
+ # C.3 ON THE ROBUSTNESS TO THE INCREASE OF THE PARAGRAPHS
425
+
426
+ As we discussed in 3.1.1, we aim at significantly reducing the search space and thus scaling the number of initial TF-IDF candidates. Increasing the number of the initial retrieved paragraphs often improves the recall of the evidence paragraphs of the datasets. On the other hand, increasing the candidate paragraphs introduces additional noises, may distract models, and eventually hurt the performance (Kratzwald & Feuerriegel, 2018). We compare the performance of three different approaches: (i) ours, (ii) ours (greedy, without reasoning path re-ranking), and (iii) $R e$ -rank. We increase the number of the TF-IDF-based retrieved paragraphs from 10 to 500 (For Re-rank, we compare the performance up to 200 paragraphs). Figure 5 clearly shows that our approach is robust towards the increase of the initial candidate paragraphs, and thus can constantly yield performance gains with more candidate paragraphs. Our approach with the greedy search also shows performance improvements; however, after a certain number, the greedy approach stops improving the performance. Re-rank starts suffering from the noises caused by many distracting paragraphs included in the initial candidate paragraphs at $F = 2 0 0$ .
427
+
428
+ # C.4 RESULTS OF QUESTION-INDEPENDENT PARAGRAPH ENCODING FOR OUR RETRIEVER
429
+
430
+ To show the importance of the question-paragraph encoding in our retriever model, we conduct an experiment on the development set of HotpotQA, by replacing it with the question-independent encoding described in Appendix A.2. For a fair comparison, we use the same initial TF-IDF-based retrieval (only for the full wiki setting), hyperlink-based Wikipedia graph, beam search, and reader model (BERT wwm). We train the alternative model without using the data augmentation technique (described in Section 3.1.2) for quick experiments.
431
+
432
+ Table 11: Effects of the question-dependent paragraph encoding: Comparing our retriever model with and without the query-dependent encoding. For our question-dependent approach, the full wiki results correspond to “retriever, no link-based negatives” in Table 6, and the distractor results correspond to “Ours (Reader: BERT wwm)” Table 1, to make the results comparable.
433
+
434
+ <table><tr><td></td><td>full wiki (F = 100)</td><td colspan="2">distractor</td></tr><tr><td>Encoding method</td><td>QA F1 QA EM</td><td>QA F1</td><td>QA EM</td></tr><tr><td>Question-dependent (our main model)</td><td>64.1</td><td>81.2</td><td>68.0</td></tr><tr><td>Question-independent</td><td>52.6 47.3 37.8</td><td>80.0</td><td>66.4</td></tr></table>
435
+
436
+ Table 11 shows the results in both the full wiki and distractor settings. As seen in this table, the QA F1 and EM performance significantly deteriorates on the full wiki setting, which demonstrates the importance of the question-dependent encoding for complex and entity-centric open-domain question answering.
437
+
438
+ We can also see that the performance drop on the distractor setting is much smaller than that on the full wiki setting. This is due to its closed nature; for each question, we are given only ten paragraphs and the two gold paragraphs are always included, which significantly narrows the searching space down and makes the retrieval task much easier than that in the full wiki setting. Therefore, our recurrent retriever model is likely to discover the gold reasoning paths by the beam search, and our reader model can select the gold paths by the robust re-ranking approach. To verify this hypothesis, we checked the P EM score as a retrieval accuracy in the distractor setting. If we only consider the top-1 path from the beam search, the P EM score of the question-independent model is $12 \%$ lower than that of our question-dependent model. However, if we consider all the reasoning paths produced by the beam search, the coverage of the gold paths is almost the same. As a result, our reader model can perform similarly with both the question-dependent/independent approaches. This additionally shows the robustness of our re-ranking approach.
439
+
440
+ # C.5 MORE QUALITATIVE ANALYSIS ON THE REASONING PATH ON HOTPOTQA FULL WIKI
441
+
442
+ In this section, we conduct more qualitative analysis on the reasoning paths predicted by our model. Explicitly retrieving plausible reasoning paths and re-ranking the paths provide us interpretable insights into the underlying entity relationships used for multi-hop reasoning.
443
+
444
+ As shown in Table 9, our model flexibly selects one or more paragraphs for each question. To understand these behaviors, we conduct qualitative analysis on these examples whose reasoning paths are shorter or longer than the original gold reasoning paths.
445
+
446
+ Reasoning path only with single paragraph First, we show two examples (one is a bridge-type question and the other is a comparison-type question), where our retriever selects single paragraph and terminates without selecting any additional paragraphs.
447
+
448
+ The bridge-type question in Table 12 shows that, while originally this question requires a system to read two paragraphs, Before I Go to Sleep (film) and Nicole Kidman, our retriever and reader eventually choose Nicole Kidman only. The second paragraph has a lot of lexical overlaps to the given question, and thus, a system may not need to read both of the paragraphs to answer.
449
+
450
+ The comparison-type question in Table 12 also shows that even comparison-type questions do not always require two paragraphs to answer the questions, and our model only selects one paragraph necessary to answer the given example question. In this example, the question has large lexical overlap with one of the ground-truth paragraph (The Bears and I), resulting in allowing our model to answer the question based on the single paragraph.
451
+
452
+ Min et al. (2019b) also observed that some of the questions do not necessarily require multi-hop reasoning, while HotpotQA is designed to require multi-hop reasoning (Yang et al., 2018). In that sense, we can say that our method automatical detects potentially single-hop questions.
453
+
454
+ Reasoning path with three paragraphs All of the HotpotQA questions are authored by annotators who are shown two relevant paragraphs, and thus, originally the length of ground-truth reasoning paths is always two. On the other hand, as our model accommodates arbitrary steps of reasoning, it often selects reasoning paths longer than the original annotations as shown in Table 9. When our model selects a longer reasoning path for a HotpotQA question, does it contain paragraphs that provide additional evidence? We show an example in Table 13, so as to answer this question. Our model selects an additional paragraph, Blue Jeans (Lana Del Rey song) at the first step, and then selects the two annotated gold paragraphs. This first paragraph is strongly relevant to the given question, but does not contain the answer. This additional evidence might help the reader to find the correct bridge entity (“Back to December”).
455
+
456
+ Table 12: Two examples of the questions that our model retrieves a reasoning path with only one paragraph. We partly remove sentences irrelevant to the questions. Words in red correspond to the answer strings.
457
+
458
+ <table><tr><td>Q[bridge]: Before I Go to Sleep stars an Australian actress, producer and occasional what?</td></tr><tr><td>Before IGo to Sleep (film): Before IGo to Sleep is a 2O14 mystery psychological thriller film writen and directed by Rowan Joff and based on the 2O11 novel of the same name by S. J. Watson. An international co-production between the United Kingdom, the United States, France,and Sweden, the film stars Nicole Kidman , Mark Strong, Colin Firth,and Anne-Marie Duff.</td></tr><tr><td>Nicole Kidman: Nicole Mary Kidman, , is an Australian actress, producer and occasional singer. She is the recipient of several awards, including an Academy Award, two Primetime Emmy Awards,a BAFTA Award, three Golden Globe Awards,and the Silver Bear for Best</td></tr><tr><td>Actress. Annotated reasoning path Before IGo to Sleep (film) →Nicole Kidman</td></tr><tr><td>Predicted reasoning path: Nicole Kidman</td></tr><tr><td>Q[comparison]: In between The Bears and I and Oceans which was released on July 31, 1974,by Buena Vista Distribution?</td></tr><tr><td>The Bears and I: The Bears and I is a 1974 American drama film directed by Bernard McEveety and written by John Whedon. The film stars Patrick Wayne, Chief Dan George, Andrew Duggan, Michael Ansara and Robert Pine. The film was released on July 31,1974, by Buena Vista Distribution.</td></tr><tr><td>Oceans (film): Oceans is a 2Oo9 French nature documentary film directed, produced,</td></tr><tr><td>co-written,and narrated by Jacques Perrin,with Jacques Cluzaud as co-director. Annotated reasoning path: The Bears and I, Oceans (film) Predicted reasoning path: The Bears and I</td></tr></table>
459
+
460
+ # C.6 QUALITATIVE ANALYSIS ON THE REASONING PATH ON HOTPOTQA DISTRACTOR
461
+
462
+ Although the main focus in this paper is on open-domain QA, we show the state-of-the-art performance on the HotpotQA distractor setting as well with the exactly same architecture. We conduct qualitative analysis to understand our model’s behavior in the closed setting. In this setting, the two ground-truth paragraphs are always given for each question.
463
+
464
+ Table 14 shows two examples from the HotpotQA distractor setting. In the first example, P1 and P2 are its corresponding ground-truth paragraphs. At the first time step, our retriever does not expect that P2 is related to the evidence to answer the question, as the retriever is not aware of the bridge entity, “Pasek & Paul”. If we simply adopt the Re-rank strategy, P3 with the second highest probability is selected, resulting in a wrong paragraph selection. In our framework, our retriever is conditioned on the previous retrieval history and thus, at the second time step, it chooses the correct paragraph, P2, lowering the probability of P3. This clearly shows the effectiveness of our multi-step retrieval method in the closed setting as well. At the third step, our model stops the prediction by outputting [EOS]. In 588 examples $( 7 . 9 \% )$ of the entire distractor development dataset, the paragraph selection by our graph-based recurrent retriever differs from the top-2 strategy.
465
+
466
+ Table 13: An example question where our model predicts reasoning paths of the length of three. Our model expects that the question is answerable based on the last paragraph of the annotated path.
467
+
468
+ <table><tr><td>Q: Yoann Lemoine,a French video director, has created music videos for Lana Del Rey, Katy Perry,and an orchestral country pop ballad by which top pop artist?</td></tr><tr><td>Yoann Lemoine: Yoann Lemoine (born 16 March 1983) is a French music video director, graphic designer and singer-songwriter. His most notable works include his music video direction for Katy Perry&#x27;s &quot;Teenage Dream”, Taylor Swift&#x27;s single “Back to December Lana Del Rey&#x27;s “Born to Die” and Mystery Jets’“Dreaming of Another World&quot;.</td></tr><tr><td>Back to December: “Back to December isa song written and recorded by American singer/songwriter Taylor Swift for her third studio album“Speak Now&quot; (2O1O). “Back to December&quot; is considered an orchestral country pop ballad and its lyrics are a remorseful plea for forgiveness for breaking up with a former lover.</td></tr><tr><td>Blue Jeans (Lana Del Rey song): “Blue Jeans&quot; is a song by American singer-songwriter Lana Del Rey for her second studio album “Born to Die&quot; (2012). Produced by Emile Haynie, the song was writen by Del Rey,Haynie,and Dan Heath. Charting across Europe and Asia, “Blue Jeans”reached the top 1O in Belgium,Poland,and Israel. The second was shot and directed by Yoann Lemoine,featuring film noir elements and crocodiles.</td></tr><tr><td>Annotated reasoning path: Yoann Lemoin-→ Back to December Predicted reasoning path: Blue Jeans (Lana Del Rey song) → Yoann Lemoin -→Back to December</td></tr></table>
469
+
470
+ Table 14: Two examples from the HotpotQA distractor development set. Highlighted text shows the bridge entities for multi-hop reasoning, and also the words in red denote the predicted answer.
471
+
472
+ <table><tr><td rowspan=1 colspan=6>Q:Which songwriting duo composed music for &quot;La La Land&quot;,and created lyrics for ”AChristmas Story: The Musica?</td></tr><tr><td rowspan=1 colspan=3>P1: A Christmas Story: The Musical is a musical version of the film &quot;A ChristmasStory ... The musical has music and lyrics written byPasek &amp; Pauland the bookby Joseph Robinette.</td><td rowspan=1 colspan=1>0.98</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.00</td></tr><tr><td rowspan=1 colspan=3> P2: Benj Pasek and Justin Paul, known together as Pasek and Paul,are an Americansongwriting duo and composing team for musical theater, films,and television..they won both the Golden Globe and Academy Award for Best Original Song forthe song &quot;City of Stars”.</td><td rowspan=1 colspan=1>0.08</td><td rowspan=1 colspan=1>0.89?</td><td rowspan=1 colspan=1>0.00</td></tr><tr><td rowspan=1 colspan=3>P3: La La Land”is a song recorded by American singer Demi Lovato. It was writ-ten by Lovato,Joe Jonas,Nick Jonas and Kevin Jonas and produced by the JonasBrothers alongside John Fields,for Lovato&#x27;s debut studio album,&quot;Dont Forget&quot;(2008).</td><td rowspan=1 colspan=1>0.12</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.00</td></tr><tr><td rowspan=1 colspan=6>Q:Alexander Kerensky was defeated and destroyed by the Bolsheviks in the course of a civilwar that ended when ?</td></tr><tr><td rowspan=5 colspan=3>P1: The Socialist Revolutionary Party,or Party of Socialists-Revolutionaries sery&quot;)was a major political party in early 2Oth century Russia and a key player in theRussian Revolution... The anti-Bolshevik faction of this party,known as theRight SRs,which remained loyal to the Provisional Government leader AlexanderKerensky was defeated and destroyed by the Bolsheviks in the course ofthe Rus-sian Civil Warand subsequent persecution.P2:The Russian Civil War (November 1917 October 1922) was a multi-party warin the former Russian Empire immediately after the Russian Revolutions of 1917,as many factions vied to determine Russias political future.P3: Alexander Fyodorovich Kerensky was a Russian lawyer and key political fig-ure in the Russian Revolution of 1917.</td><td rowspan=4 colspan=1>0.950.00</td><td rowspan=4 colspan=1>0.000.87√</td><td rowspan=3 colspan=1>0.00</td></tr><tr><td rowspan=1 colspan=1>Russian R</td></tr><tr><td rowspan=1 colspan=2>Right SRs,whi</td></tr><tr><td rowspan=1 colspan=1>0.00</td></tr><tr><td rowspan=1 colspan=1>0.08</td><td rowspan=1 colspan=1>0.09</td><td rowspan=1 colspan=1>0.00</td></tr></table>
473
+
474
+ Table 15: Statistics of the reasoning paths for SQuAD Open and Natural Questions Open: the average length and the distribution of length of the reasoning paths selected by our retriever and reader for SQuAD Open and Natural Questions Open.
475
+
476
+ <table><tr><td rowspan="2"></td><td colspan="2">SQuAD Open</td><td colspan="2">Natural Questions Open</td></tr><tr><td>Retriever 1.00</td><td>Reader 1.08</td><td>Retriever 1.23</td><td>Reader 1.54</td></tr><tr><td>1</td><td>10,570</td><td>9,759</td><td>6,719</td><td>4,047</td></tr><tr><td>2</td><td>0</td><td>811</td><td>2,038</td><td>4,702</td></tr><tr><td>3</td><td>0</td><td>0</td><td>0</td><td>8</td></tr></table>
477
+
478
+ We present another example, where only the graph-based recurrent retrieval model succeeds in finding the correct paragraph pair, (P1, P2). The second question in Table 14 shows that at the first time step our retriever successfully selects P1, but does not pay attention to P2 at all, as the retriever is not aware of the bridge entity, “the Russian Civil War”. Again, once it is conditioned on P1, which includes the bridge entity, it can select P2 at the second time step. Like this, we can see how our model successfully learns to model relationships between paragraphs for multi-hop reasoning.
479
+
480
+ # D ADDITIONAL RESULTS ON SQUAD OPEN AND NATURAL QUESTIONS OPEN
481
+
482
+ Although the main focus of this work is on multi-hop open-domain QA, our framework shows competitive performance on the two open-domain QA datasets, SQuAD Open and Natural Questions Open. Both of the two dataets are originally created by assigning a single ground-truth paragraph for each question, and in that sense, our framework is not specific to multi-hop reasoning tasks. In this section, we further analyze our experimental results on the two datasets.
483
+
484
+ SQuAD Open Table 15 shows statistics of the lengths of the selected reasoning paths on our SQuAD Open experiment. This table is analogous to Table 9 on our HotpotQA experiments. We can clearly see that our recurrent retriever always outputs a single paragraph for each question, if we only use the top-1 predictions. This is because our retriever model for this dataset is trained with the single-paragraph annotations. Our beam search can find longer reasoning paths, and as a result, the re-ranking process in our reader model somtimes selects the reasoning paths including two paragraphs. The trend is consistent with that in Table 9. However, the effects of selecting more than one paragraph do not have a big impact; we observed only $0 . 1 \%$ F1/EM improvement over our method with restricting the path length to one (based on the same experiment with $L = 1$ in Table 8). Considering that SQuAD is a single-hop QA dataset, the result matches our intuition.
485
+
486
+ Natural Questions Open Table 15 also shows the results on Natural Questions Open, where we see the same trend again. Thanks to the ground-truth path augmentation technique, our recurrent retriever model prefers longer reasoning paths than those on SQuAD Open. We observed $1 \%$ EM improvement over the $L = 1$ baseline on Natural Questions Open, and next we show an example to discuss why our reasoning path approach can be effective on this dataset.
487
+
488
+ Table 16 shows one example where our model finds a multi-hop reasoning path effectively in Natural Questions Open (development set). The question “who sang the original version of killing me so” has relatively fewer lexical overlap with the originally annotated paragraph (Killing Me Softly with His Song (V) in Table 16). Moreover, there are several entities named as “killing me softly” in Wikipedia, because many artists cover the song. To answer this question correctly, our retriever first selects Roberta Flack (I), and then hops to the originally annotated paragraph, Killing Me Softly with His Song (V). Our reader further verifies this reasoning path and extracts the correct answer from Killing Me Softly with His Song (V). This example shows that even without gold
489
+
490
+ <table><tr><td>Q: who sang the original version of killing me softly</td></tr><tr><td>Roberta Flack (I): Roberta Cleopatra Flack (born February 10,1937) is an American singer. She is known for her No. 1 singles &quot;The First Time Ever I Saw Your Face&quot;, &quot;Killing Me Softly with His Song&#x27;</td></tr><tr><td>Killing Me Softly with His Song (V), The song was written in collaboration with Lori Lieberman, who recorded the song in late 1971. In 1973 it became a number - one hit in the US and Canada for Roberta Flack, Many artists have covered the song...</td></tr><tr><td>Annotated reasoning path: Killing Me Softly with His Song (V) Predicted reasoning Path: Roberta Flack (I) →Killing Me Softly with His Song (V)</td></tr></table>
491
+
492
+ Table 16: An example from Natural Questions Open. The bold text represents titles and paragraph indices (e.g., (I) denotes that the paragraph is an introductory paragraph). The highlighted phrase represents a bridge entity and the text in red represents an answer span.
493
+
494
+ reasoning paths annotations, our model trained on the augmented examples learns to retrieve multihop reasoning paths from the entire Wikipedia.
495
+
496
+ These detailed experimental results on the two other open-domain QA datasets demonstrate that our framework learns to retrieve reasoning paths flexibly with evidence sufficient to answer a given question, according to each dataset’s nature.
md/train/SJlh8CEYDB/SJlh8CEYDB.md ADDED
@@ -0,0 +1,438 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # LEARN TO EXPLAIN EFFICIENTLY VIA NEURAL LOGIC INDUCTIVE LEARNING
2
+
3
+ Yuan Yang & Le Song
4
+ Georgia Institute of Technology
5
+ yyang754@gatech.edu, lsong@cc.gatech.edu
6
+
7
+ # ABSTRACT
8
+
9
+ The capability of making interpretable and self-explanatory decisions is essential for developing responsible machine learning systems. In this work, we study the learning to explain problem in the scope of inductive logic programming (ILP). We propose Neural Logic Inductive Learning (NLIL), an efficient differentiable ILP framework that learns first-order logic rules that can explain the patterns in the data. In experiments, compared with the state-of-the-art methods, we find NLIL can search for rules that are $\mathbf { x } 1 0$ times longer while remaining ${ \bf X } { \boldsymbol 3 }$ times faster. We also show that NLIL can scale to large image datasets, i.e. Visual Genome, with 1M entities.
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ ![](images/53938345393f74ae7f1529abeffdd37a9b841ca801cfdb53f2b1de158416bfec.jpg)
14
+ Figure 1: A scene-graph can describe the relations of objects in an image. The NLIL can utilize this graph and explain the presence of objects Car and Person by learning the first-order logic rules that characterize the common sub-patterns in the graph. The explanation is globally consistent and can be interpreted as commonsense knowledge.
15
+
16
+ The recent years have witnessed the growing success of deep learning models in a wide range of applications. However, these models are also criticized for the lack of interpretability in its behavior and decision making process (Lipton, 2016; Mittelstadt et al., 2019), and for being data-hungry. The ability to explain its decision is essential for developing a responsible and robust decision system (Guidotti et al., 2019). On the other hand, logic programming methods, in the form of first-order logic (FOL), are capable of discovering and representing knowledge in explicit symbolic structure that can be understood and examined by human (Evans & Grefenstette, 2018).
17
+
18
+ In this paper, we investigate the learning to explain problem in the scope of inductive logic programming (ILP) which seeks to learn first-order logic rules that explain the data. Traditional ILP methods (Galarraga et al., 2015) rely on hard matching and discrete logic for rule search which is ´ not tolerant for ambiguous and noisy data (Evans & Grefenstette, 2018). A number of works are proposed for developing differentiable ILP models that combine the strength of neural and logicbased computation (Evans & Grefenstette, 2018; Campero et al., 2018; Rocktaschel & Riedel, 2017; ¨ Payani & Fekri, 2019; Dong et al., 2019). Methods such as ∂ILP (Evans & Grefenstette, 2018) are referred to as forward-chaining methods. It constructs rules using a set of pre-defined templates and evaluates them by applying the rule on background data multiple times to deduce new facts that lie in the held-out set (related works available at Appendix A). However, general ILP problem involves several steps that are NP-hard: (i) the rule search space grows exponentially in the length of the rule; (ii) assigning the logic variables to be shared by predicates grows exponentially in the number of arguments, which we refer as variable binding problem; (iii) the number of rule instantiations needed for formula evaluation grows exponentially in the size of data. To alleviate these complexities, most works have limited the search length to within 3 and resort to template-based variable assignments, limiting the expressiveness of the learned rules (detailed discussion available at Appendix B). Still, most of the works are limited in small scale problems with less than 10 relations and 1K entities.
19
+
20
+ On the other hand, multi-hop reasoning methods (Guu et al., 2015; Lao & Cohen, 2010; Lin et al., 2015; Gardner & Mitchell, 2015; Das et al., 2016) are proposed for the knowledge base (KB) completion task. Methods such as NeuralLP (Yang et al., 2017) can answer the KB queries by searching for a relational path that leads from the subject to the object. These methods can be interpreted in the ILP domain where the learned relational path is equivalent to a chain-like first-order rule. Compared to the template-based counterparts, methods such as NeuralLP is highly efficient in variable binding and rule evaluation. However, they are limited in two aspects: (i) the chain-like rules represent a subset of the Horn clauses, and are limited in expressing complex rules such as those shown in Figure 1; (ii) the relational path is generated while conditioning on the specific query, meaning that the learned rule is only valid for the current query. This makes it difficult to learn rules that are globally consistent in the KB, which is an important aspect of a good explanation.
21
+
22
+ In this work, we propose Neural Logic Inductive Learning (NLIL), a differentiable ILP method that extends the multi-hop reasoning framework for general ILP problem. NLIL is highly efficient and expressive. We propose a divide-and-conquer strategy and decompose the search space into 3 subspaces in a hierarchy, where each of them can be searched efficiently using attentions. This enables us to search for $\mathbf { x } 1 0$ times longer rules while remaining x3 times faster than the state-of-theart methods. We maintain the global consistency of rules by splitting the training into rule generation and rule evaluation phase, where the former is only conditioned on the predicate type that is shared globally.
23
+
24
+ And more importantly, we show that a scalable ILP method is widely applicable for model explanations in supervised learning scenario. We apply NLIL on Visual Genome (Krishna et al., 2016) dataset for learning explanations for 150 object classes over 1M entities. We demonstrate that the learned rules, while maintaining the interpretability, have comparable predictive power as densely supervised models, and generalize well with less than $1 \%$ of the data.
25
+
26
+ # 2 PRELIMINARIES
27
+
28
+ Supervised learning typically involves learning classifiers that map an object from its input space to a score between 0 and 1. How can one explain the outcome of a classifier? Recent works on interpretability focus on generating heatmaps or attention that self-explains a classifier (Ribeiro et al., 2016; Chen et al., 2018; Olah et al., 2018). We argue that a more effective and humanintelligent explanation is through the description of the connection with other classifiers.
29
+
30
+ For example, consider an object detector with classifiers $\mathtt { P e r s o n } ( X )$ , $\mathtt { C a r } ( X )$ , Clothing $( X )$ and Inside $( X , X ^ { \prime } )$ that detects if certain region contains a person, a car, a clothing or is inside another region, respectively. To explain why a person is present, one can leverage its connection with other attributes, such as $\boldsymbol { \cdot } _ { X }$ is a person if it’s inside a car and wearing clothing”, as shown in Figure 1. This intuition draws a close connection to a longstanding problem of first-order logic literature, i.e. Inductive Logic Programming (ILP).
31
+
32
+ # 2.1 INDUCTIVE LOGIC PROGRAMMING
33
+
34
+ A typical first-order logic system consists of 3 components: entity, predicate and formula. Entities are objects $\mathbf { x } \in \mathcal { X }$ . For example, for a given image, a certain region is an entity $\mathbf { x }$ , and the set of all possible regions is $\mathcal { X }$ . Predicates are functions that map entities to 0 or 1, for example Person : $\mathbf { x } \mapsto \{ 0 , 1 \}$ , $\mathbf { x } \in \mathcal { X }$ . Classifiers can be seen as soft predicates. Predicates can take multiple arguments, e.g. Inside is a predicate with 2 inputs. The number of arguments is referred to as the arity. Atom is a predicate symbol applied to a logic variable, e.g. $\mathsf { P e r s o n } ( X )$ and Inside $( X , X ^ { \prime } )$ . A logic variable such as $X$ can be instantiated into any object in $\mathcal { X }$ .
35
+
36
+ A first-order logic (FOL) formula is a combination of atoms using logical operations $\{ \land , \lor , \lnot \}$ which correspond to logic and, or and not respectively. Given a set of predicates $\begin{array} { r l } { \mathcal { P } } & { { } = } \end{array}$ $\{ P _ { 1 } , . . . , P _ { K } \}$ , we define the explanation of a predicate $P _ { k }$ as a first-order logic entailment
37
+
38
+ $$
39
+ \forall X , X ^ { \prime } \exists Y _ { 1 } , Y _ { 2 } . . . P _ { k } ( X , X ^ { \prime } ) A ( X , X ^ { \prime } , Y _ { 1 } , Y _ { 2 } . . . ) ,
40
+ $$
41
+
42
+ where $P _ { k } ( X , X ^ { \prime } )$ is the head of the entailment, and it will become $P _ { k } ( X )$ if it is a unary predicate. $A$ is defined as the rule body and is a general formula, e.g. conjunction normal form (CNF), that is made of atoms with predicate symbols from $\mathcal { P }$ and logic variables that are either head variables $X$ , $X ^ { \prime }$ or one of the body variables $\mathcal { V } = \{ Y _ { 1 } , Y _ { 2 } , . . . \}$ .
43
+
44
+ By using the logic variables, the explanation becomes transferrable as it represents the “lifted” knowledge that does not depend on the specific data. It can be easily interpreted. For example,
45
+
46
+ $$
47
+ \mathtt { P e r s o n } ( X ) \gets \mathtt { I n s i d e } ( X , Y _ { 1 } ) \wedge \mathtt { C a r } ( Y _ { 1 } ) \wedge \mathtt { O n } ( Y _ { 2 } , X ) \wedge \mathtt { C l o t h i n g } ( Y _ { 2 } )
48
+ $$
49
+
50
+ represents the knowledge that “if an object is inside the car with clothing on it, then it’s a person”. To evaluate a formula on the actual data, one grounds the formula by instantiating all the variables into objects. For example, in Figure 1, Eq.(2) is applied to the specific regions of an image.
51
+
52
+ Given a relational knowledge base (KB) that consists of a set of facts $\{ \langle \mathbf { x } _ { i } , P _ { i } , \mathbf { x } _ { i } ^ { \prime } \rangle \} _ { i = 1 } ^ { N }$ where $P _ { i } \in \mathcal { P }$ and $\mathbf { x } _ { i } , \mathbf { x } _ { i } ^ { \prime } \in \mathcal { X }$ . The task of learning FOL rules in the form of Eq.(1) that entail target predicate $P ^ { * } \in \mathcal { P }$ is called inductive logic programming. For simplicity, we consider unary and binary predicates for the following contents, but this definition can be extended to predicates with higher arity as well.
53
+
54
+ # 2.2 MUTLI-HOP REASONING
55
+
56
+ The ILP problem is closely related to the multi-hop reasoning task on the knowledge graph (Guu et al., 2015; Lao & Cohen, 2010; Lin et al., 2015; Gardner & Mitchell, 2015; Das et al., 2016). Similar to ILP, the task operates on a KB that consists of a set of predicates $\mathcal { P }$ . Here the facts are stored with respect to the predicate $P _ { k }$ which is represented as a binary matrix ${ { \bf { M } } _ { k } }$ in $\{ 0 , 1 \} ^ { | \mathcal { X } | \times | \mathcal { X } | }$ . This is an adjacency matrix, meaning that $\langle \mathbf { x } _ { i } , P _ { k } , \mathbf { x } _ { j } \rangle$ is in the KB if and only if the $( i , j )$ entry of ${ { \bf { M } } _ { k } }$ is 1.
57
+
58
+ Given a query $q = \langle \mathbf { x } , P ^ { * } , \mathbf { x } ^ { \prime } \rangle$ . The task is to find a relational path $\textbf { x } \xrightarrow { P ^ { ( 1 ) } } \dots \xrightarrow { P ^ { ( T ) } } \textbf { x } ^ { \prime }$ , such that the two query entities are connected. Formally, let $\mathbf { v _ { x } }$ be the one-hot encoding of object $\mathbf { x }$ with dimension of $| \mathcal { X } |$ . Then, the $( t )$ th hop of the reasoning along the path is represented as
59
+
60
+ $$
61
+ \mathbf { v } ^ { ( 0 ) } = \mathbf { v } _ { \mathbf { x } } , \qquad \mathbf { v } ^ { ( t ) } = \mathbf { M } ^ { ( t ) } \mathbf { v } ^ { ( t - 1 ) } ,
62
+ $$
63
+
64
+ where $\mathbf { M } ^ { ( t ) }$ is the adjacency matrix of the predicate used in $( t )$ th hop. The $\mathbf { v } ^ { ( t ) }$ is the path features vector, where the jth element v(t)j counts the number of unique paths from $\mathbf { x }$ to $\mathbf { x } _ { j }$ (Guu et al., 2015). After $T$ steps of reasoning, the score of the query is computed as
65
+
66
+ $$
67
+ \operatorname { s c o r e } ( \mathbf { x } , \mathbf { x } ^ { \prime } ) = \mathbf { v } _ { \mathbf { x } ^ { \prime } } ^ { \top } \prod _ { t = 1 } ^ { T } \mathbf { M } ^ { ( t ) } \cdot \mathbf { v } _ { \mathbf { x } } .
68
+ $$
69
+
70
+ For each $q$ , the goal is to (i) find an appropriate $T$ and (ii) for each $t \in [ 1 , 2 , . . . , T ]$ , find the appropriate $\mathbf { M } ^ { ( t ) }$ to multiply, such that Eq.(3) is maximized. These two discrete picks can be relaxed as learning the weighted sum of scores from all possible paths, and weighted sum of matrices at each step. Let
71
+
72
+ $$
73
+ \kappa ( \mathbf { s } _ { \psi } , \mathbf { S } _ { \varphi } ) \equiv \sum _ { t ^ { \prime } = 1 } ^ { T } s _ { \psi } ^ { ( t ^ { \prime } ) } \left( \prod _ { t = 1 } ^ { t ^ { \prime } } \sum _ { k = 1 } ^ { K } s _ { \varphi , k } ^ { ( t ) } \mathbf { M } _ { k } \right)
74
+ $$
75
+
76
+ be the soft path selection function parameterized by (i) the path attention vector $\begin{array} { r l } { \mathbf { s } _ { \psi } } & { { } = } \end{array}$ $[ s _ { \psi } ^ { ( 1 ) } , . . . , s _ { \psi } ^ { ( T ) } ] ^ { \intercal }$ that softly picks the best path with length between 1 to $\mathrm { T }$ that answers the query, and (ii) the operator attention vectors $\mathbf { S } _ { \varphi } = [ \mathbf { s } _ { \varphi } ^ { ( 1 ) } , . . . , \mathbf { s } _ { \varphi } ^ { ( T ) } ] ^ { \top }$ s(T )ϕ ]>, where s(t)ϕ softly picks the $\mathbf { M } ^ { ( t ) }$ at $( t ) { \mathrm { t h } }$ step. Here we omit the dependence on $M _ { k }$ for notation clarity. These two attentions are generated with a model
77
+
78
+ $$
79
+ \mathbf { s } _ { \psi } , \mathbf { S } _ { \varphi } = \mathbb { T } ( \mathbf { x } ; \mathbf { w } )
80
+ $$
81
+
82
+ with learnable parameters w. For methods such as (Guu et al., 2015; Lao & Cohen, 2010), $\mathbb { T } ( \mathbf { x } ; \mathbf { w } )$ is a random walk sampler which generates one-hot vectors that simulate the random walk on the graph starting from x. And in NeuralLP (Yang et al., 2017), $\mathbb { T } ( \mathbf { x } ; \mathbf { w } )$ is an RNN controller that generates a sequence of normalized attention vectors with $\mathbf { v _ { x } }$ as the initial input. Therefore, the objective is defined as
83
+
84
+ $$
85
+ \underset { \mathbf { w } } { \arg \operatorname* { m a x } } \sum _ { q } \mathbf { v } _ { \mathbf { x } ^ { \prime } } ^ { \top } \kappa \big ( \mathbf { s } _ { \psi } , \mathbf { S } _ { \varphi } \big ) \mathbf { v } _ { \mathbf { x } } ,
86
+ $$
87
+
88
+ Learning the relational path in the multi-hop reasoning can be interpreted as solving an ILP problem with chain-like FOL rules (Yang et al., 2017)
89
+
90
+ $$
91
+ P ^ { * } ( X , X ^ { \prime } ) P ^ { ( 1 ) } ( X , Y _ { 1 } ) \land P ^ { ( 2 ) } ( Y _ { 1 } , Y _ { 2 } ) \land \ldots \land P ^ { ( T ) } ( Y _ { n - 1 } , X ^ { \prime } ) .
92
+ $$
93
+
94
+ Compared to the template-based ILP methods such as ∂ILP, this class of methods is efficient in rule exploration and evaluation. However, $( \mathbf { P 1 } )$ generating explanations for supervised models puts a high demand on the rule expressiveness. The chain-like rule space is limited in its expressive power because it represents a constrained subspace of the Horn clauses rule space. For example, Eq.(2) is a Horn clause and is not chain-like. And the ability to efficiently search beyond the chain-like rule space is still lacking in these methods. On the other hand, (P2) the attention generator $\mathbb { T } ( \mathbf { x } ; \mathbf { w } )$ is dependent on $\mathbf { x }$ , the subject of a specific query $q$ , meaning that the explanation generated for target $P ^ { * }$ can vary from query to query. This makes it difficult to learn FOL rules that are globally consistent in the KB.
95
+
96
+ # 3 NEURAL LOGIC INDUCTIVE LEARNING
97
+
98
+ In this section, we show the connection between the multi-hop reasoning methods with the general logic entailment defined in Eq.(1). Then we propose a hierarchical rule space to solve (P1), i.e. we extend the chain-like space for efficient learning of more expressive rules.
99
+
100
+ # 3.1 THE OPERATOR VIEW
101
+
102
+ In Eq.(1), variables that only appear in the body are under existential quantifier. We can turn Eq.(1) into Skolem normal form by replacing all variables under existential quantifier with functions with respect to $X$ and $X ^ { \prime }$ ,
103
+
104
+ $$
105
+ \forall X , X ^ { \prime } \exists \varphi _ { 1 } , \varphi _ { 2 } , \ldots P ^ { * } ( X , X ^ { \prime } ) A ( X , X ^ { \prime } , \varphi _ { 1 } ( X ) , \varphi _ { 1 } ( X ^ { \prime } ) , \varphi _ { 2 } ( X ) , \ldots ) .
106
+ $$
107
+
108
+ If the functions are known, Eq.(7) will be much easier to evaluate than Eq.(1). Because grounding this formula only requires to instantiate the head variables, and the rest of the body variables are then determined by the deterministic functions.
109
+
110
+ Functions in Eq.(7) can be arbitrary. But what are the functions that one can utilize? We propose to adopt the notions in section 2.2 and treat each predicate as an operator, such that we have a subspace of the functions $\Phi = \{ \varphi _ { 1 } , . . . , \varphi _ { K } \}$ , where
111
+
112
+ $$
113
+ \left\{ \begin{array} { l l } { \varphi _ { k } ( \boldsymbol { \mathbf { \rho } } ) = \mathbf { M } _ { k } \ \mathbf { 1 } \quad } & { \mathrm { i f } \ k \in \mathcal { U } , } \\ { \varphi _ { k } ( \mathbf { v _ { x } } ) = \mathbf { M } _ { k } \mathbf { v _ { x } } \quad } & { \mathrm { i f } \ k \in \mathcal { B } , } \end{array} \right.
114
+ $$
115
+
116
+ where $\mathcal { U }$ and $\boldsymbol { B }$ are the sets of unary and binary predicates respectively. The operator of the unary predicate takes no input and is parameterized with a diagonal matrix. Intuitively, given a subject entity $\mathbf { x }$ , $\varphi _ { k }$ returns the set embedding (Guu et al., 2015) that represents the object entities that, together with the subject, satisfy the predicate $P _ { k }$ . For example, let $\mathbf { v _ { x } }$ be the one-hot encoding of an object in the image, then $\varphi _ { \mathrm { I n s i d e } } ( \mathbf { v _ { x } } )$ returns the objects that spatially contain the input box. For unary predicate such as $\mathtt { C a r } ( X )$ , its operator $\varphi _ { \mathtt { C a r } } ( \ r ) = \mathbf { M } _ { \mathtt { c a r } } \mathbf { 1 }$ takes no input and returns the set of all objects labelled as car.
117
+
118
+ Since we only use $\Phi$ , a subspace of the functions, the existential variables that can be represented by the operator calls, denoted as $\hat { \mathcal { V } }$ , also form the subset $\hat { \mathcal { V } } \subseteq \mathcal { V }$ . This is slightly constrained from Eq.(1). For example, in $\mathtt { P e r s o n } ( X ) \mathtt { C a r } ( Y ) ,$ $Y$ can not be interpreted as the operator call from $X$ . However, we argue that such rules are generally trivial. For example, it’s not likely to infer “an image contains a person” by simply checking if “there is any car in the image”.
119
+
120
+ Therefore, any FOL formula that complies with Eq.(7) can now be converted into the operator form and vice versa. For example, Eq.(2) can be written as
121
+
122
+ $$
123
+ \mathtt { P e r s o n } ( X ) \gets \mathtt { C a r } ( \varphi _ { \mathtt { I n s i d e } } ( X ) ) \wedge \mathtt { O n } ( \varphi _ { \mathtt { C l o t h i n g } } ( ) , X ) ,
124
+ $$
125
+
126
+ where the variable $Y _ { 1 }$ and $Y _ { 2 }$ are eliminated. Note that this conversion is not unique. For example, $\mathtt { C a r } ( \varphi _ { \mathtt { I n s i d e } } ( X ) )$ can be also written as Inside $( X , \varphi _ { \mathtt { C a r } } ( ) )$ . The variable binding problem now becomes equivalent to the path-finding problem in section 2.2, where one searches for the appropriate chain of operator calls that can represent the variable in $\hat { \mathcal { V } }$ .
127
+
128
+ # 3.2 PRIMITIVE STATEMENTS
129
+
130
+ ![](images/eb2f5d21e1135794556ca7b84841c51082cde04b9508af4b15e6c1bd15c77a17.jpg)
131
+ Figure 2: Factor graphs of example chainlike, tree-like and conjunctions of rules. Each rule type is the subset of the latter. Succ stands for successor.
132
+
133
+ As discussed above, the Eq.(3) is equivalent to a chain-like rule. We want to extend this notion and be able to represent more expressive rules. To do this, we introduce the notion of primitive statement $\psi$ . Note that an atom is defined as a predicate symbol applied to specific logic variables. Similarly, we define a predicate symbol applied to the head variables or those in $\hat { \mathcal { V } }$ as a primitive statement. For example, in Eq.(8), $\psi _ { 1 } \ { \overset { \cdot } { = } } \ \complement \complement ( \varphi _ { \mathrm { I n s i d e } } ( X ) )$ and $\psi _ { 2 } = \mathrm { O n } ( \varphi _ { \mathrm { C l o t h i n g } } ( ) , X )$ are two primitive statements.
134
+
135
+ Similar to an atom, each primitive statement is a mapping from the input space to a scalar confidence score, i.e. $\psi ~ : ~ \hat { \mathbb { R } } ^ { | \mathcal { X } | } \ \times ~ \mathbb { R } ^ { | \mathcal { X } | } \ \mapsto \ s ~ \in$ $[ 0 , 1 ]$ . Formally, for a unary primitive statement $P _ { k } ( \varphi ^ { ( T ^ { \prime } ) } \cdot \ldots \cdot \varphi ^ { ( 1 ) } ( \mathbf { x } ^ { \prime } ) )$ and a binary one $P _ { k } \mathopen { } \mathclose \bgroup \left( \varphi ^ { ( T ) } \aftergroup \egroup \right)$ · $\dots \cdot \varphi ^ { ( 1 ) } ( \mathbf { x } ) , \varphi ^ { ( T ^ { \prime } ) } \cdot \dots \cdot \varphi ^ { ( 1 ) } ( \mathbf { x } ^ { \prime } ) )$ , their mappings are defined as
136
+
137
+ $$
138
+ \begin{array} { r } { \psi _ { k } ( \mathbf { x } , \mathbf { x } ^ { \prime } ) = \left\{ \begin{array} { l l } { \sigma ( ( \mathbf { M } _ { k } \mathbf { 1 } ) ^ { \top } ( \prod _ { t ^ { \prime } = 1 } ^ { T ^ { \prime } } \mathbf { M } ^ { ( t ^ { \prime } ) } \mathbf { v } _ { \mathbf { x } ^ { \prime } } ) ) \quad } & { \mathrm { ~ i f ~ } k \in \mathcal { U } , } \\ { \sigma ( ( \mathbf { M } _ { k } \prod _ { t = 1 } ^ { T } \mathbf { M } ^ { ( t ) } \mathbf { v } _ { \mathbf { x } } ) ^ { \top } ( \prod _ { t ^ { \prime } = 1 } ^ { T ^ { \prime } } \mathbf { M } ^ { ( t ^ { \prime } ) } \mathbf { v } _ { \mathbf { x } ^ { \prime } } ) ) \quad } & { \mathrm { ~ i f ~ } k \in \mathcal { B } , } \end{array} \right. } \end{array}
139
+ $$
140
+
141
+ where $\sigma ( \cdot )$ is the sigmoid function. Note that we give unary $\psi$ a dummy input $\mathbf { x }$ for notation convenience. For example, in
142
+
143
+ $$
144
+ \mathtt { E a r } ( X ) \mathtt { E y e } ( Y _ { 1 } ) \land \mathtt { O f } ( Y _ { 1 } , Y _ { 2 } ) \land \mathtt { O f } ( X , Y _ { 2 } ) ,
145
+ $$
146
+
147
+ the body is a single statement $\begin{array} { r l r } { \psi } & { { } = } & { \ O \mathrm { f } \left( \varphi _ { \mathrm { E y e } } ( ) , \varphi _ { \mathrm { O f } } ( X ) \right) } \end{array}$ . Its value is computed as $\psi _ { 0 \mathrm { f } } ( \varphi _ { \mathrm { E y e } } ( ) , \varphi _ { 0 \mathrm { f } } ( \mathbf { v _ { x ^ { \prime } } } ) ) = \sigma ( ( \mathbf { M } _ { 0 \mathrm { f } } \mathbf { M } _ { \mathrm { E y e } } \mathbf { 1 } ) ^ { \top } ( \mathbf { M } _ { 0 \mathrm { f } } \mathbf { v } _ { \mathbf { x ^ { \prime } } } ) )$ . Compared to Eq.(3), Eq.(9) replaces the target $\mathbf { v } _ { \mathbf { x } ^ { \prime } }$ into another relational path. This makes it possible to represent “correlations” between two variables, and the path that starts from the unary operator, e.g. $\varphi _ { \mathrm { E y e } } ( )$ . To see this, one can view a FOL rule as a factor graph with logic variables as the nodes and predicates as the potentials (Cohen et al., 2017). And running the operator call is essentially conducting the belief propagation over the graph in a fixed direction. As shown in Figure 2, primitive statement is capable of representing the tree-like factor graphs, which significantly improves the expressive power of the learned rules.
148
+
149
+ Similarly, Eq.(9) can be relaxed into weighted sums. In Eq.(6), all relational paths are summed with a single path attention vector ${ \bf s } _ { \psi }$ . We extend this notion by assigning separate vectors for each argument of the statement $\psi$ . Let $\mathbf { S } _ { \psi } , \mathbf { S } _ { \psi } ^ { \prime } \in \mathbb { R } ^ { K \times T }$ be the path attention matrices for the first and second argument of all statements in $\Psi$ , i.e. ${ \bf s } _ { \psi , k }$ and $\mathbf { s } _ { \psi , k } ^ { \prime }$ are the path attention vectors of the first and second argument of the $k$ th statement. Then we have
150
+
151
+ $$
152
+ \psi _ { k } ( \mathbf { x } , \mathbf { x } ^ { \prime } ) = \left\{ \begin{array} { l l } { \sigma \left( ( \mathbf { M } _ { k } \mathbf { 1 } ) ^ { \top } ( \kappa ( \mathbf { s } _ { \psi , k } ^ { \prime } , \mathbf { S } _ { \varphi } ) \mathbf { v } _ { \mathbf { x } ^ { \prime } } ) \right) } & { \quad \mathrm { i f } \ k \in \mathcal { U } , } \\ { \sigma \left( ( \mathbf { M } _ { k } \kappa ( \mathbf { s } _ { \psi , k } , \mathbf { S } _ { \varphi } ) \mathbf { v } _ { \mathbf { x } } ) ^ { \top } ( \kappa ( \mathbf { s } _ { \psi , k } ^ { \prime } , \mathbf { S } _ { \varphi } ) \mathbf { v } _ { \mathbf { x } ^ { \prime } } ) \right) } & { \quad \mathrm { i f } \ k \in \mathcal { B } . } \end{array} \right.
153
+ $$
154
+
155
+ # 3.3 LOGIC COMBINATION SPACE
156
+
157
+ By introducing the primitive statements, we are now one step away from representing the running example rule Eq.(8), which is the logic conjunction of two statements $\psi _ { 1 }$ and $\psi _ { 2 }$ . Specifically,
158
+
159
+ ![](images/b5b03e9d49a116682c9477c2802556c2991d8997cc58a0441c2fe1ead36619d2.jpg)
160
+ Figure 3: A hierarchical rule space where the operator calls, statement evaluations and logic combinations are all relaxed into the weight sums with respect to attentions $\mathbf { S } _ { \varphi } , \mathbf { S } _ { \psi } , \mathbf { S } _ { \psi } ^ { \prime } , \mathbf { S } _ { f } , \mathbf { S } _ { f } ^ { \prime }$ and ${ \bf s } _ { o }$ . W/sum denotes the weighted sum, Matmul denotes the matrix product, Neg denotes soft logic not, and XEnt denotes the cross-entropy loss.
161
+
162
+ we want to further extend the rule search space by exploring the logic combinations of primitive statements, via $\{ \land , \lor , \lnot \}$ , as shown in Figure 2. To do this, we utilize the soft logic not and soft logic and operations
163
+
164
+ $$
165
+ \neg p = 1 - p , \qquad p \wedge q = p \ast q ,
166
+ $$
167
+
168
+ where $p , q \ \in \ [ 0 , 1 ]$ . Here we do not include the logic $\vee$ operation because it can be implicitly represented as p ∨ q = ¬(¬p ∧ ¬q). Let Ψ = {ψk(x, x0)}Kk=1 be the set of primitive statements with all possible predicate symbols. We define the formula set at lth level as
169
+
170
+ $$
171
+ \begin{array} { r l } & { \mathcal { F } _ { 0 } = \boldsymbol { \Psi } , } \\ & { \hat { \mathcal { F } } _ { l - 1 } = \mathcal { F } _ { l - 1 } \cup \{ 1 - f ( \mathbf { x } , \mathbf { x } ^ { \prime } ) : f \in \mathcal { F } _ { l - 1 } \} , } \\ & { \mathcal { F } _ { l } = \{ f _ { i } ( \mathbf { x } , \mathbf { x } ^ { \prime } ) \ast f _ { i } ^ { \prime } ( \mathbf { x } , \mathbf { x } ^ { \prime } ) : f _ { i } , f _ { i } ^ { \prime } \in \hat { \mathcal { F } } _ { l - 1 } \} _ { i = 1 } ^ { C } , } \end{array}
172
+ $$
173
+
174
+ where each element in the formula set $\{ f : f \in \mathscr { F } _ { l } \}$ is called a formula such that $f : \mathbb { R } ^ { | \mathcal { X } | } \times \mathbb { R } ^ { | \mathcal { X } | } \mapsto$ $s \in \ [ 0 , 1 ]$ . Intuitively, we define the logic combination space in a similar way as that in pathfinding: the initial formula set contains only primitive statements $\Psi$ , because they are formulas by themselves. For the $l - 1$ th formula set $\mathcal { F } _ { l - 1 }$ , we concatenate it with its logic negation, which yields $\hat { \mathcal { F } } _ { l - 1 }$ . Then each formula in the next level is the logic and of two formulas from $\hat { \mathcal { F } } _ { l - 1 }$ . Enumerating all possible combinations at each level is expensive, so we set up a memory limitation $C$ to indicate the maximum number of combinations each level can keep track of1. In other words, each level $\mathcal { F } _ { l }$ is to search for $C$ logic and combinations on formulas from the previous level $\hat { \mathcal { F } } _ { l - 1 }$ , such that the cth formula at the lth level $f _ { l c }$ is
175
+
176
+ $$
177
+ f _ { l c } ( \mathbf { x } , \mathbf { x } ^ { \prime } ) = f _ { l - 1 , i } ( \mathbf { x } , \mathbf { x } ^ { \prime } ) * f _ { l - 1 , i } ^ { \prime } ( \mathbf { x } , \mathbf { x } ^ { \prime } ) , \qquad f _ { l - 1 , i } , f _ { l - 1 , i } ^ { \prime } \in \hat { \mathcal { F } } _ { l - 1 } .
178
+ $$
179
+
180
+ As an example, for $\Psi = \{ \psi _ { 1 } , \psi _ { 2 } \}$ and $C = 2$ , one possible level sequence is $\mathcal { F } _ { 0 } = \{ \psi _ { 1 } , \psi _ { 2 } \}$ , $\mathcal { F } _ { 1 } = \{ \psi _ { 1 } * \psi _ { 2 } , ( 1 - \psi _ { 2 } ) * \psi _ { 1 } \}$ , $\mathcal { \bar { F } } _ { 2 } = \{ ( \psi _ { 1 } * \psi _ { 2 } ) * \bar { ( } ( 1 - \psi _ { 2 } ) * \psi _ { 1 } ) , \bar { . . . } \}$ and etc. To collect the rules from all levels, the final level $L$ is the union of previous sets, i.e. $\mathcal { F } _ { L } = \mathcal { F } _ { 0 } \cup \dotsc \cup \mathcal { F } _ { L - 1 }$ . Note that Eq.(11) does not explicitly forbid trivial rules such as $\psi _ { 1 } * \left( 1 - \psi _ { 1 } \right)$ that is always true regardless of the input. This is alleviated by introducing nonexistent queries during the training (detailed discussion at section 5).
181
+
182
+ Again, the rule selection can be parameterized into the weighted-sum form with respect to the attentions. We define the formula attention tensors as $\mathbf { S } _ { f } , \mathbf { S } _ { f } ^ { \overline { { \prime } } } \in \mathbb { R } ^ { L - 1 \times C \times 2 C }$ , such that $f _ { l c }$ is the product of two summations over the previous outputs weighted by attention vectors $_ { \mathbf { s } _ { f , l c } }$ and $\mathbf { s } _ { f , l c } ^ { \prime }$ respectively2. Formally, we have
183
+
184
+ $$
185
+ \begin{array} { r } { f _ { l c } ( \mathbf { x } , \mathbf { x } ^ { \prime } ) = \mathbf { s } _ { f , l c } ^ { \top } \mathbf { f } _ { l - 1 } ( \mathbf { x } , \mathbf { x } ^ { \prime } ) * \mathbf { s } _ { f , l c } ^ { \prime \top } \mathbf { f } _ { l - 1 } ( \mathbf { x } , \mathbf { x } ^ { \prime } ) , } \end{array}
186
+ $$
187
+
188
+ where $\mathbf { f } _ { l - 1 } ( \mathbf { x } , \mathbf { x } ^ { \prime } ) \in \mathbb { R } ^ { 2 C }$ is the stacked outputs of all formulas $f \in \hat { \mathcal { F } } _ { l - 1 }$ with arguments $\langle \mathbf { x } , \mathbf { x } ^ { \prime } \rangle$ . Finally, we want to select the best explanation and compute the score for each query. Let ${ \bf s } _ { o }$ be the
189
+
190
+ ![](images/55419236102a6fa3b75f1edeec5fe772c0f09bb27c0ef2ec263aa49718a79bb5.jpg)
191
+ Figure 4: The hierarchical Transformer networks for attention generation without conditioning on the query.
192
+
193
+ attention vector over $\mathcal { F } _ { L }$ , so the output score is defined as
194
+
195
+ $$
196
+ \begin{array} { r } { \mathrm { s c o r e } ( \mathbf { x } , \mathbf { x } ^ { \prime } ) = \mathbf { s } _ { o } ^ { \top } \mathbf { f } _ { L } ( \mathbf { x } , \mathbf { x } ^ { \prime } ) . } \end{array}
197
+ $$
198
+
199
+ An overview of the relaxed hierarchical rule space is illustrated in Figure 3.
200
+
201
+ # 4 HIERARCHICAL TRANSFORMER NETWORKS FOR RULE GENERATION
202
+
203
+ We have defined a hierarchical rule space as shown in Figure 3, where the discrete selections on the operators, statements and logic combinations are all relaxed into the weight sums with respect to a series of attention parameters ${ \bf S } _ { \varphi } , { \bf S } _ { \psi } , { \bf S } _ { \psi } ^ { \prime } , { \bf S } _ { f } , { \bf S } _ { f } ^ { \prime }$ and ${ \bf s } _ { o }$ . In this section, we solve $( \mathbf { P } 2 )$ , i.e. we propose a differentiable model that generates these attentions without conditioning on the specific query.
204
+
205
+ The goal of NLIL is to generate data-independent FOL rules. In other words, for each target predicate $P ^ { * }$ , its rule set $\mathcal { F } _ { L }$ and the final output rule should remain unchanged for all the queries $q = \langle \mathbf { x } , P ^ { * } , \mathbf { x } ^ { \prime } \rangle$ (which is different from that in Eq.(5)). To do this, we define the learnable embeddings of all predicates as $\mathbf { H } = [ \mathbf { h } _ { 1 } , . . , \mathbf { h } _ { K } ] ^ { \intercal } \in \mathrm { ~ \mathbb { R } ^ { \it K \times d } ~ }$ , and the embeddings for the “dummy” arguments $X$ and $X ^ { \prime }$ as $\mathbf { e } _ { X } , \mathbf { e } _ { X ^ { \prime } } \in \mathbb { R } ^ { d }$ . We define the attention generation model as
206
+
207
+ $$
208
+ \begin{array} { r } { \mathbf { S } _ { \varphi } , \mathbf { S } _ { \psi } , \mathbf { S } _ { \psi } ^ { \prime } , \mathbf { S } _ { f } , \mathbf { S } _ { f } ^ { \prime } , \mathbf { s } _ { o } = \mathbb { T } ( \mathbf { e } _ { X } , \mathbf { h } ^ { * } , \mathbf { e } _ { X ^ { \prime } } ; \mathbf { w } ) , } \end{array}
209
+ $$
210
+
211
+ where $\mathbf { h } ^ { * }$ is the embedding of $P ^ { * }$ , such that attentions only vary with respect to $P ^ { * }$ .
212
+
213
+ As shown in Figure 4, we propose a stack of three Transformer (Vaswani et al., 2017) networks for attention generator $\mathbb { T }$ . Each module is designed to mimic the actual evaluation that could happen during the operator call, primitive statement evaluation and formula computation respectively with neural networks and “dummy” embeddings. And the attention matrices generated during this simulated evaluation process are kept for evaluating Eq.(14). A MultiHeadAttn is a standard Transformer module such that MultiHeadAttn : ${ \bf Q } ^ { q \times \bar { d } } \times \bar { \bf V } ^ { v \times d } \mapsto { \bf O } ^ { q \times d } \times { \bf S } ^ { q \times v }$ , where $d$ is the latent dimension and $q , v$ are the query and value dimensions respectively. It takes the query $\mathbf { Q }$ and input value $\mathbf { V }$ (which will be internally transformed into keys and values), and returns the output value $\mathbf { O }$ and attention matrix S. Intuitively, $\mathbf { S }$ encodes the “compatibility” between query and the value, and $\mathbf { O }$ represents the “outcome” of a query given its compatibility with the input.
214
+
215
+ Operator search: For target predicate $P ^ { * }$ , we alter the embedding matrix $\mathbf { H }$ with
216
+
217
+ $$
218
+ \hat { \mathbf { h } } _ { k } = \mathrm { F e e d F o r w a r d } ( \mathrm { C o n c a t } ( \mathbf { h } _ { k } , \mathbf { h } ^ { * } ) ) , \qquad \hat { \mathbf { H } } = [ \hat { \mathbf { h } } _ { 1 } , . . . , \hat { \mathbf { h } } _ { K } ] ^ { \top } ,
219
+ $$
220
+
221
+ such that the rule generation is predicate-specific. Let $\mathbf { q } _ { \varphi } ^ { ( t ) }$ be the learnable tth step operator query embedding. The operator transformer module is parameterized as
222
+
223
+ $$
224
+ \begin{array} { r l r l } & { \hat { \mathbf { V } } _ { \varphi } ^ { ( 0 ) } = [ \mathbf { e } _ { X } , \mathbf { e } _ { X ^ { \prime } } ] ^ { \top } , } & & { \hat { \mathbf { Q } } _ { \varphi } = \hat { \mathbf { H } } + \mathbf { e } _ { \varphi } , } \\ & { \hat { \mathbf { V } } _ { \varphi } ^ { ( t ) } , \hat { \mathbf { S } } _ { \varphi } ^ { ( t ) } = \mathrm { M u l t i H e a d A t t n } ( \hat { \mathbf { Q } } _ { \varphi } , \hat { \mathbf { V } } _ { \varphi } ^ { ( t - 1 ) } ) , } & & { \mathbf { v } _ { \varphi } ^ { ( t ) } , \mathbf { s } _ { \varphi } ^ { ( t ) } = \mathrm { M u l t i H e a d A t t n } ( \mathbf { q } _ { \varphi } ^ { ( t ) } , \hat { \mathbf { V } } _ { \varphi } ^ { ( t ) } ) . } \end{array}
225
+ $$
226
+
227
+ Here, $\hat { \mathbf { V } } _ { \varphi } ^ { ( 0 ) }$ is the dummy input embedding representing the starting points of the paths. $\mathbf { e } _ { \varphi }$ is a learnable operator encoding such that $\hat { \mathbf { Q } } _ { \varphi }$ represents the embeddings of all operators $\Phi$ . Therefore,
228
+
229
+ Table 1: MRR, Hits $@ 1 0$ and time (mins) of KB completion tasks.
230
+
231
+ <table><tr><td rowspan="2">Model</td><td colspan="3">FB15K-237</td><td colspan="3">WN18</td></tr><tr><td>MRR</td><td>Hits @10</td><td>Time</td><td>MRR</td><td>Hits@10</td><td>Time</td></tr><tr><td>NeuralLP</td><td>0.24</td><td>36.2</td><td>250</td><td>0.94</td><td>94.5</td><td>54</td></tr><tr><td>TransE</td><td>0.28</td><td>44.5</td><td>35</td><td>0.57</td><td>93.3</td><td>53</td></tr><tr><td>RotatE</td><td>0.34</td><td>52.6</td><td>342</td><td>0.94</td><td>95.5</td><td>254</td></tr><tr><td>NLIL</td><td>0.25</td><td>32.4</td><td>82</td><td>0.95</td><td>94.6</td><td>12</td></tr></table>
232
+
233
+ Table 2: Statistics of benchmark KBs and Visual Genome scene-graphs.
234
+
235
+ <table><tr><td>KB</td><td>#facts</td><td>#entities</td><td># predicates</td></tr><tr><td>ES-10</td><td>17</td><td>10</td><td>3</td></tr><tr><td>ES-50</td><td>77</td><td>50</td><td>3</td></tr><tr><td>ES-1K</td><td>1.5K</td><td>1K</td><td>3</td></tr><tr><td>WN18</td><td>106K</td><td>40K</td><td>18</td></tr><tr><td>FB15K</td><td>272K</td><td>15K</td><td>237</td></tr><tr><td>VG</td><td>1.9M</td><td>1.4M</td><td>2100</td></tr></table>
236
+
237
+ we consider that $\hat { \mathbf { V } } _ { \varphi } ^ { ( t ) }$ encodes the outputs of the operator calls of $K$ predicates. And we aggregate the outputs with another MultiHeadAttn with respect to a single query $\mathbf { q } _ { \varphi } ^ { ( t ) }$ , which in turn yields the operator path attention vector $\mathbf { s } _ { \varphi } ^ { ( t ) }$ and aggregated output $\mathbf { v } _ { \varphi } ^ { ( t ) }$ .
238
+
239
+ Primitive statement search: Let $\mathbf V _ { \varphi } = [ \mathbf v _ { \varphi } ^ { ( 1 ) } , . . . , \mathbf v _ { \varphi } ^ { ( T ) } ] ^ { \top }$ be the output embedding of $T$ paths. The path attention is generated as
240
+
241
+ $$
242
+ \begin{array} { r l r l } & { \mathbf { Q } _ { \psi } = \hat { \mathbf { H } } + \mathbf { e } _ { \psi } , \mathbf { Q } _ { \psi } ^ { \prime } = \hat { \mathbf { H } } + \mathbf { e } _ { \psi } ^ { \prime } , } & & { \tilde { \mathbf { V } } _ { \psi } , \mathbf { S } _ { \psi } = \mathrm { M u l t i H e a d A t t n } ( \mathbf { Q } _ { \psi } , \mathbf { V } _ { \varphi } ) , } \\ & { \tilde { \mathbf { V } } _ { \psi } ^ { \prime } , \mathbf { S } _ { \psi } ^ { \prime } = \mathrm { M u l t i H e a d A t t n } ( \mathbf { Q } _ { \psi } ^ { \prime } , \mathbf { V } _ { \varphi } ) , } & & { \mathbf { V } _ { \psi } = \mathrm { F e e d F o r w a r d } ( \mathrm { C o n c a t } ( \tilde { \mathbf { V } } _ { \psi } , \tilde { \mathbf { V } } _ { \psi } ^ { \prime } ) ) . } \end{array}
243
+ $$
244
+
245
+ Here, $\mathbf { e } _ { \psi }$ and $\mathbf { e } _ { \psi } ^ { \prime }$ are the first and second argument encodings, such that $\mathbf { Q } _ { \psi }$ and $\mathbf { Q } _ { \psi } ^ { \prime }$ encode the arguments of each statement in $\Psi$ . The compatibility between paths and the arguments are computed with two MultiHeadAttns. Finally, a FeedForward is used to aggregate the selections. Its output $\mathbf { V } _ { \psi } \in \mathbb { R } ^ { K \times d }$ represents the results of all statement evaluations in $\Psi$ .
246
+
247
+ Formula search: Let $\mathbf { Q } _ { f , l } , \mathbf { Q } _ { f , l } ^ { \prime } \in \mathbb { R } ^ { C \times d }$ be the learnable queries of the first and second argument of formulas at $l$ th level, and let $\mathbf { V } _ { f , 0 } = \mathbf { V } _ { \psi }$ . The formula attention is generated as
248
+
249
+ $$
250
+ \begin{array} { r l } & { \hat { \mathbf { V } } _ { f , l - 1 } = [ \mathbf { V } _ { f , l - 1 } + \mathbf { e } _ { + } , \mathbf { V } _ { f , l - 1 } + \mathbf { e } _ { - } ] , \qquad \tilde { \mathbf { V } } _ { f , l } , \mathbf { S } _ { f , l } = \mathrm { M u l t i H e a d A t t n } ( \mathbf { Q } _ { f , l } , \hat { \mathbf { V } } _ { f , l - 1 } ) , } \\ & { \tilde { \mathbf { V } } _ { f , l } ^ { \prime } , \mathbf { S } _ { f , l } ^ { \prime } = \mathrm { M u l t i H e a d A t t n } ( \mathbf { Q } _ { f , l } ^ { \prime } , \hat { \mathbf { V } } _ { f , l - 1 } ) , \quad \mathbf { V } _ { f , l } = \mathrm { F e e d F o r w a r d } ( \mathrm { C o n c a t } ( \tilde { \mathbf { V } } _ { f , l } , \tilde { \mathbf { V } } _ { f , l } ^ { \prime } ) ) . } \end{array}
251
+ $$
252
+
253
+ Here, $\mathbf { e } _ { + } , \mathbf { e } _ { - }$ are the learnable embeddings, such that $\hat { \mathbf { V } } _ { f , l - 1 }$ represents the positive and negative states of the formulas at $l - 1$ th level. Similar to the statement search, the compatibility between the logic and arguments and the previous formulas are computed with two MultiHeadAttns. And the embeddings of formulas at $l \mathrm { t h }$ level $\mathbf { V } _ { f , l }$ are aggregated by a FeedForward. Finally, let ${ \bf q } _ { o }$ be the learnable final output query and let $\mathbf { V } _ { o } { = } [ \mathbf { V } _ { f , 0 } , . . . , \mathbf { V } _ { f , L - 1 } ]$ . The output attention is computed as
254
+
255
+ $$
256
+ { \bf v } _ { o } , { \bf s } _ { o } = \mathrm { M u l t i H e a d A t t n } ( { \bf q } _ { o } , { \bf V } _ { o } ) .
257
+ $$
258
+
259
+ # 5 STOCHASTIC TRAINING AND RULE VISUALIZATIONS
260
+
261
+ The training of NLIL consists of two phases: rule generation and rule evaluation. During generation, we run Eq.(15) to obtain the attentions ${ \bf S } _ { \varphi } , { \bf S } _ { \psi } , { \bf S } _ { \psi } ^ { \prime } , { \bf S } _ { f } , { \bf S } _ { f } ^ { \prime }$ and ${ \bf s } _ { o }$ for all $P ^ { * } s$ . For the evaluation phase, we sample a mini-batch of queries $\{ \langle \mathbf { x } , P ^ { * } , \mathbf { x } ^ { \prime } , y \rangle _ { i } \} _ { i = 1 } ^ { b }$ , and evaluate the formulas using Eq.(14). Here, $y$ is the query label indicating if the triplet exists in the KB or not. We sample nonexistent queries to prevent the model from learning trivial rules that always output 1. In the experiments, these negative queries are sampled uniformly from the target query matrix $M ^ { * }$ where the entry is 0. Then the objective becomes
262
+
263
+ $$
264
+ \underset { \mathbf { w } } { \arg \operatorname* { m i n } } \frac { 1 } { b } \sum _ { i } ^ { b } \mathrm { C r o s s E n t r o p y } ( y _ { i } , \mathbf { s } _ { o } ^ { \top } \mathbf { f } _ { L } ( \mathbf { x } , \mathbf { x } ^ { \prime } ) ) .
265
+ $$
266
+
267
+ Since the attentions are generated from Eq.(15) differentiably, the loss is back-propagated through the attentions into the Transformer networks for end-to-end training.
268
+
269
+ # 5.1 EXTRACTING EXPLICIT RULES
270
+
271
+ During training, the results from operator calls and logic combinations are averaged via attentions. For validation and testing, we evaluate the model with the explicit FOL rules extracted from the attentions. To do this, one can view an attention vector as a categorical distribution. For example, $\mathbf { s } _ { \varphi } ^ { ( t ) }$ is such a distribution over random variables $k \in [ 1 , K ]$ . And the weighted sum is the expectation over $M _ { k }$ . Therefore, one can extract the explicit rules by sampling from the distributions (Kool et al., 2018; Yang et al., 2017).
272
+
273
+ ![](images/fb5a979eef1b9ab0d19b4722598f713ff025ac8a671a70606ec09397024f576c.jpg)
274
+ Figure 5: (a) Time (mins) for solving Even-and-Successor tasks. (-) indicates method runs out of time limit; (b) Running time for different rule lengths; (c) $\mathbb { R } \ @ 1$ for object classification with different training set size.
275
+
276
+ However, since we are interested in the best rules and the attentions usually become highly concentrated on one entity after convergence. We replace the sampling with the arg max, where we get the one-hot encoding of the entity with the largest probability mass.
277
+
278
+ # 6 EXPERIMENTS
279
+
280
+ We first evaluate NLIL on classical ILP benchmarks and compare it with 4 state-of-the-art KB completion methods in terms of their accuracy and efficiency. Then we show NLIL is capable of learning FOL explanations for object classifiers on a large image dataset when scene-graphs are present. Though each scene-graph corresponds to a small KB, the total amount of the graphs makes it infeasible for all classical ILP methods. We show that NLIL can overcome it via efficient stochastic training. Our implementation is available at https://github.com/gblackout/NLIL.
281
+
282
+ # 6.1 CLASSICAL ILP BENCHMARKS
283
+
284
+ We evaluate NLIL together with two state-of-the-art differentiable ILP methods, i.e. NeuralLP (Yang et al., 2017) and ∂ILP (Evans & Grefenstette, 2018), and two structure embedding methods, TransE (Bordes et al., 2013) and RotatE (Sun et al., 2019). Detailed experiments setup is available at Appendix C.
285
+
286
+ Benchmark datasets: (i) Even-and-Successor (ES) benchmark is introduced in (Evans & Grefenstette, 2018), which involves two unary predicates $\operatorname { E v e n } ( X )$ , $\operatorname { Z e r o } ( X )$ and one binary predicate ${ \mathsf { S u c c } } ( X , Y )$ . The goal is to learn FOL rules over a set of integers. The benchmark is evaluated with 10, 50 and 1K consecutive integers starting at 0; (ii) FB15K-237 is a subset of the Freebase knowledge base (Toutanova & Chen, 2015) containing general knowledge facts; (iii) WN18 (Bordes et al., 2013) is the subset of WordNet containing relations between words. Statistics of datasets are provided in Table 2.
287
+
288
+ Knowledge base completion: All models are evaluated on the KB completion task. The benchmark datasets are split into train/valid/test sets. The model is tasked to predict the probability of a fact triplet (query) being present in the KB. We use Mean Reciprocal Ranks (MRR) and Hits $@ 1 0$ for evaluation metrics (see Appendix C for details).
289
+
290
+ Results on Even-and-Successor benchmark are shown in Table 5a. Since the benchmark is noisefree, we only show the wall clock time for completely solving the task. As we have previously mentioned, the forward-chaining method, i.e. ∂ILP scales exponentially in the number of facts and quickly becomes infeasible for 1K entities. Thus, we skip its evaluation for other benchmarks.
291
+
292
+ Results on FB15K-237 and WN18 are shown in Table. 1. Compared to NeuralLP, NLIL yields slightly higher scores. This is due to the benchmarks favor symmetric/asymmetric relations or compositions of a few relations (Sun et al., 2019), such that most valuable rules will already lie within the chain-like search space of NeuralLP. Thus the improvements gained from a larger search space with NLIL are limited. On the other hand, with the Transformer block and smaller model created for each target predicate, NLIL can achieve a similar score at least 3 times faster. Compared to the structure embedding methods, NLIL is significantly outperformed by the current state-of-the-art, i.e. RotatE, on FB15K. This is expected because NLIL searches over the symbolic space that is highly constrained. However, the learned rules are still reasonably predictive, as its performance is comparable to that of TransE.
293
+
294
+ Scalability for long rules: we demonstrate that NLIL can explore longer rules efficiently. We compare the wall clock time of NeuralLP and NLIL for performing one epoch of training against different maximum rule lengths. As shown in Figure 5b, NeuralLP searches over a chain-like rule space thus scales linearly with the length, while NLIL searches over a hierarchical space thus grows in log scale. The search time for length 32 in NLIL is similar to that for length 3 in NerualLP.
295
+
296
+ # 6.2 ILP ON VISUAL GENOME DATASET
297
+
298
+ The ability to perform ILP efficiently extends the applications of NLIL to beyond canonical KB completion. For example in visual object detection and relation learning, supervised models can learn to generate a scene-graph (As shown in Figure 1) for each image. It consists of nodes each labeled as an object class. And each pair of objects are connected with one type of relation. The scene-graph can then be represented as a relational KB where one can perform ILP. Learning the FOL rules on such an output of a supervised model is beneficial. As it provides an alternative way of interpreting model behaviors in terms of its relations with other classifiers that are consistent across the dataset.
299
+
300
+ To show this, we conduct experiments on Visual Genome dataset (Krishna et al., 2016). The original dataset is highly noisy (Zellers et al., 2018), so we use a pre-processed version available as the GQA dataset (Hudson & Manning, 2019). The scene-graphs are converted to a collection KBs, and its statistics are shown in Table 2. We filter out the predicates with less than 1500 occurrences. The processed KBs contain 213 predicates. Then we perform ILP on learning the explanations for the top 150 objects in the dataset.
301
+
302
+ Table 3: $\mathbb { R } \ @ 1$ and $\mathbf { R } @ 5$ for 150 objects classification on VG.
303
+
304
+ <table><tr><td rowspan="2">Model</td><td colspan="2">Visual Genome</td></tr><tr><td>R@1</td><td>R@5</td></tr><tr><td>MLP+RCNN</td><td>0.53</td><td>0.81</td></tr><tr><td>Freq</td><td>0.40</td><td>0.44</td></tr><tr><td>NLIL</td><td>0.51</td><td>0.52</td></tr></table>
305
+
306
+ Quantitatively, we evaluate the learned rules on predicting the object class labels on a held-out set in terms of their $\mathbb { R } \ @ 1$ and $\mathbf { R } @ 5$ . As none of the ILP works scale to this benchmark, we compare NLIL with two supervised baselines: (i) MLP-RCNN: a MLP classifier with RCNN features of the object (available in GQA dataset) as input; and (ii) Freq: a frequency-based baseline that predicts object label by looking at the mostly occurred object class in the relation that contains the target. This method is nontrivial. As noted in (Zellers et al., 2018), a large number of triples in Visual Genome are highly predictive by knowing only the relation type and either one of the objects or subjects.
307
+
308
+ Explaining objects with rules: Results are shown in Table 3. We see that the supervised method achieves the best scores, as it relies on highly informative visual features. On the other hand, NLIL achieves a comparable score on $\mathbf { R } \ @ 1$ solely relying on KBs with sparse binary labels. We note that NLIL outperforms Freq significantly. This means the FOL rules learned by NLIL are beyond the superficial correlations exhibited by the dataset. We verify this finding by showing the rules for top objects in Table 4.
309
+
310
+ Induction for few-shot learning: Logic inductive learning is data-efficient and the learned rules are highly transferrable. To see this, we vary the size of the training set and compare the $\mathbf { R } \ @ 1$ scores for 3 methods. As shown in Figure 5c, the NLIL maintains a similar $\mathbf { R } \ @ 1$ score with less than $1 \%$ of the training set.
311
+
312
+ # 7 CONCLUSION
313
+
314
+ In this work, we propose Neural Logic Inductive Learning, a differentiable ILP framework that learns explanatory rules from data. We demonstrate that NLIL can scale to very large datasets while being able to search over complex and expressive rules. More importantly, we show that a scalable ILP method is effective in explaining decisions of supervised models, which provides an alternative perspective for inspecting the decision process of machine learning systems.
315
+
316
+ # ACKNOWLEDGMENTS
317
+
318
+ This project is partially supported by DARPA ASED program under FA8650-18-2-7882. We thank Ramesh Arvind3 and Hoon $\mathrm { { \dot { N } a ^ { 4 } } }$ for implementing the MLP baseline.
319
+
320
+ # REFERENCES
321
+
322
+ Ivana Balazevi ˇ c, Carl Allen, and Timothy M Hospedales. Tucker: Tensor factorization for knowl- ´ edge graph completion. arXiv preprint arXiv:1901.09590, 2019.
323
+
324
+ Antoine Bordes, Nicolas Usunier, Alberto Garcia-Duran, Jason Weston, and Oksana Yakhnenko. Translating embeddings for modeling multi-relational data. In Advances in neural information processing systems, pp. 2787–2795, 2013.
325
+
326
+ Andres Campero, Aldo Pareja, Tim Klinger, Josh Tenenbaum, and Sebastian Riedel. Logical rule induction and theory learning using neural theorem proving. arXiv preprint arXiv:1809.02193, 2018.
327
+
328
+ Xinlei Chen, Li-Jia Li, Li Fei-Fei, and Abhinav Gupta. Iterative visual reasoning beyond convolutions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7239–7248, 2018.
329
+
330
+ William W Cohen, Fan Yang, and Kathryn Rivard Mazaitis. TensorLog: Deep learning meets probabilistic DBs. July 2017.
331
+
332
+ Rajarshi Das, Arvind Neelakantan, David Belanger, and Andrew McCallum. Chains of reasoning over entities, relations, and text using recurrent neural networks. arXiv preprint arXiv:1607.01426, 2016.
333
+
334
+ Rajarshi Das, Shehzaad Dhuliawala, Manzil Zaheer, Luke Vilnis, Ishan Durugkar, Akshay Krishnamurthy, Alex Smola, and Andrew McCallum. Go for a walk and arrive at the answer: Reasoning over paths in knowledge bases using reinforcement learning. arXiv preprint arXiv:1711.05851, 2017.
335
+
336
+ Honghua Dong, Jiayuan Mao, Tian Lin, Chong Wang, Lihong Li, and Denny Zhou. Neural logic machines. In International Conference on Learning Representations, 2019. URL https:// openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ B1xY-hRctX.
337
+
338
+ Richard Evans and Edward Grefenstette. Learning explanatory rules from noisy data. Journal of Artificial Intelligence Research, 61:1–64, 2018.
339
+
340
+ Luis Galarraga, Christina Teflioudi, Katja Hose, and Fabian M Suchanek. Fast rule mining in onto- ´ logical knowledge bases with amie+. The VLDB JournalThe International Journal on Very Large Data Bases, 24(6):707–730, 2015.
341
+
342
+ Matt Gardner and Tom Mitchell. Efficient and expressive knowledge base completion using subgraph feature extraction. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pp. 1488–1498, 2015.
343
+
344
+ Riccardo Guidotti, Anna Monreale, Salvatore Ruggieri, Franco Turini, Fosca Giannotti, and Dino Pedreschi. A survey of methods for explaining black box models. ACM computing surveys (CSUR), 51(5):93, 2019.
345
+
346
+ Kelvin Guu, John Miller, and Percy Liang. Traversing knowledge graphs in vector space. arXiv preprint arXiv:1506.01094, 2015.
347
+
348
+ Vinh Thinh Ho, Daria Stepanova, Mohamed H Gad-Elrab, Evgeny Kharlamov, and Gerhard Weikum. Rule learning from knowledge graphs guided by embedding models. In International Semantic Web Conference, pp. 72–90. Springer, 2018.
349
+
350
+ Drew A Hudson and Christopher D Manning. Gqa: A new dataset for real-world visual reasoning and compositional question answering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 6700–6709, 2019.
351
+
352
+ Wouter Kool, Herke van Hoof, and Max Welling. Attention, learn to solve routing problems! arXiv preprint arXiv:1803.08475, 2018.
353
+
354
+ Ranjay Krishna, Yuke Zhu, Oliver Groth, Justin Johnson, Kenji Hata, Joshua Kravitz, Stephanie Chen, Yannis Kalantidis, Li-Jia Li, David A Shamma, Michael Bernstein, and Li Fei-Fei. Visual genome: Connecting language and vision using crowdsourced dense image annotations. 2016. URL https://arxiv.org/abs/1602.07332.
355
+
356
+ Ni Lao and William W Cohen. Relational retrieval using a combination of path-constrained random walks. Machine learning, 81(1):53–67, 2010.
357
+
358
+ Nada Lavrac and Saso Dzeroski. Inductive logic programming. In WLP, pp. 146–160. Springer, 1994.
359
+
360
+ Yankai Lin, Zhiyuan Liu, Huanbo Luan, Maosong Sun, Siwei Rao, and Song Liu. Modeling relation paths for representation learning of knowledge bases. arXiv preprint arXiv:1506.00379, 2015.
361
+
362
+ Zachary C Lipton. The mythos of model interpretability. arXiv preprint arXiv:1606.03490, 2016.
363
+
364
+ Pasquale Minervini, Matko Bosnjak, Tim Rocktaschel, and Sebastian Riedel. Towards neural theo-¨ rem proving at scale. arXiv preprint arXiv:1807.08204, 2018.
365
+
366
+ Brent Mittelstadt, Chris Russell, and Sandra Wachter. Explaining explanations in ai. In Proceedings of the conference on fairness, accountability, and transparency, pp. 279–288. ACM, 2019.
367
+
368
+ Chris Olah, Arvind Satyanarayan, Ian Johnson, Shan Carter, Ludwig Schubert, Katherine Ye, and Alexander Mordvintsev. The building blocks of interpretability. Distill, 3(3):e10, 2018.
369
+
370
+ Pouya Ghiasnezhad Omran, Kewen Wang, and Zhe Wang. Scalable rule learning via learning representation. In IJCAI, pp. 2149–2155, 2018.
371
+
372
+ Ali Payani and Faramarz Fekri. Inductive logic programming via differentiable deep neural logic networks. arXiv preprint arXiv:1906.03523, 2019.
373
+
374
+ Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. Why should i trust you?: Explaining the predictions of any classifier. In Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining, pp. 1135–1144. ACM, 2016.
375
+
376
+ Tim Rocktaschel and Sebastian Riedel. End-to-end differentiable proving. In ¨ Advances in Neural Information Processing Systems, pp. 3788–3800, 2017.
377
+
378
+ Richard Socher, Danqi Chen, Christopher D Manning, and Andrew Ng. Reasoning with neural tensor networks for knowledge base completion. In Advances in neural information processing systems, pp. 926–934, 2013.
379
+
380
+ Zhiqing Sun, Zhi-Hong Deng, Jian-Yun Nie, and Jian Tang. Rotate: Knowledge graph embedding by relational rotation in complex space. arXiv preprint arXiv:1902.10197, 2019.
381
+
382
+ Kristina Toutanova and Danqi Chen. Observed versus latent features for knowledge base and text inference. In Proceedings of the 3rd Workshop on Continuous Vector Space Models and their Compositionality, pp. 57–66, 2015.
383
+
384
+ Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, pp. 5998–6008, 2017.
385
+
386
+ Fan Yang, Zhilin Yang, and William W Cohen. Differentiable learning of logical rules for knowledge base reasoning. In Advances in Neural Information Processing Systems, pp. 2319–2328, 2017.
387
+
388
+ Rowan Zellers, Mark Yatskar, Sam Thomson, and Yejin Choi. Neural motifs: Scene graph parsing with global context. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5831–5840, 2018.
389
+
390
+ # A RELATED WORK
391
+
392
+ Inductive Logic Programming (ILP) is the task that seeks to summarize the underlying patterns shared in the data and express it as a set of logic programs (or rule/formulae) (Lavrac & Dzeroski, 1994). Traditional ILP methods such as $\mathrm { A M E + }$ (Galarraga et al., 2015) and RLvLR (Omran et al., ´ 2018) relies on explicit search-based method for rule mining with various pruning techniques. These works can scale up to very large knowledge bases. However, the algorithm complexity grows exponentially in the size of the variables and predicates involved. The acquired rules are often restricted to Horn clauses with a maximum length of less than 3, limiting the expressiveness of the rules. On the other hand, compared to the differentiable approach, traditional methods make use of hard matching and discrete logic for rule search, which lacks the tolerance for ambiguous and noisy data.
393
+
394
+ The state-of-the-art differentiable forward-chaining methods focus on rule learning on predefined templates (Evans & Grefenstette, 2018; Campero et al., 2018; Ho et al., 2018), typically in the form of a Horn clause with one head predicate and two body predicates with chain-like variables, i.e.
395
+
396
+ $$
397
+ P ^ { * } ( X , X ^ { \prime } ) P _ { 1 } ( X , Y ) \land P _ { 2 } ( Y , X ^ { \prime } ) .
398
+ $$
399
+
400
+ To evaluate the rules, one starts with a background set of facts and repeatedly apply rules for every possible triple until no new facts can be deduced. Then the deduced facts are compared with a heldout ground-truth set. Rules that are learned in this approach are in first-order, i.e. data-independent and can be readily interpreted. However, the deducing phase can quickly become infeasible with a larger background set. Although ∂ILP (Evans & Grefenstette, 2018) has proposed to alleviate by performing only a fixed number of steps, works of this type could generally scale to KBs with less than 1K facts and 100 entities. On the other hand, differentiable backward-chaining methods such as NTP (Rocktaschel & Riedel, 2017) are more efficient in rule evaluation. In (Minervini et al., ¨ 2018), NTP 2.0 can scale to larges KBs such as WordNet. However, FOL rules are searched with templates, so the expressiveness is still limited.
401
+
402
+ Another differentiable ILP method, i.e. Neural Logic Machine (NLM), is proposed in (Dong et al., 2019), which learns to represent logic predicates with tensorized operations. NLM is capable of both deductive and inductive learning on predicates with unknown arity. However, as a forward-chaining method, it also suffers from the scalability issue as ∂ILP. It involves a permutation operation over the tensors when performing logic deductions, making it difficult to scale to real-world KBs. On the other hand, the inductive rules learned by NLM are encoded by the network parameters implicitly, so it does not support representing the rules with explicit predicate and logic variable symbols.
403
+
404
+ Multi-hop reasoning: Multi-hop reasoning methods (Guu et al., 2015; Lao & Cohen, 2010; Lin et al., 2015; Gardner & Mitchell, 2015; Das et al., 2016; Yang et al., 2017) such as NeuralLP (Yang et al., 2017) construct rule on-the-fly when given a specific query. It adopts a flexible ILP setting: instead of pre-defining templates, it assumes a chain-like Horn clause can be constructed to answer the query
405
+
406
+ $$
407
+ P ^ { * } ( X , X ^ { \prime } ) P ^ { ( 1 ) } ( X , Y _ { 1 } ) \land P ^ { ( 2 ) } ( Y _ { 1 } , Y _ { 2 } ) \land \ldots \land P ^ { ( T ) } ( Y _ { n - 1 } , X ^ { \prime } ) .
408
+ $$
409
+
410
+ And each step of the reasoning in the chain can be efficiently represented by matrix multiplication. The resulting algorithm is highly scalable compared to the forward-chaining counter-parts and can learn rules on large datasets such as FreeBase. However, this approach reasons over a single chainlike path, and the path is sampled by performing random walks that are independent on the task context (Das et al., 2017), limiting the rule expressiveness. On the other hand, the FOL rule is generated while conditioning on the specific query, making it difficult to extract rules that are globally consistent.
411
+
412
+ Link prediction with relational embeddings: Besides multi-hop reasoning methods, a number of works are proposed for KB completion using learnable embeddings for KB relations. For example, In (Bordes et al., 2013; Sun et al., 2019; Balazevi ˇ c et al., 2019) it learns to map KB relations into ´ vector space and predict links with scoring functions. NTN (Socher et al., 2013), on the other hand, parameterizes each relation into a neural network. In this approach, embeddings are used for predicting links directly, thus its prediction cannot be interpreted as explicit FOL rules. This is different from that in NLIL, where predicate embeddings are used for generating data-independent rules.
413
+
414
+ Table 4: Example rules learned by NLIL
415
+
416
+ <table><tr><td rowspan=1 colspan=1>Person(X) ← (Shirt(Yi) ^ Wearing(X,Yi))V(Pants(Y2) ^ Wearing(X,Y2))V(Street(Y3)^WalkingOn(X,Y3))</td></tr><tr><td rowspan=1 colspan=1>Tree(X) ← (Leaf(Yi) ∧At(Yi,X))V(SideWalk(Y2) ∧ Near(Y2,X))</td></tr><tr><td rowspan=1 colspan=1>Shirt(X) ← (Person(Yi) ^ Wearing(Yi,X)) V(Child(Y2)^Wearing(Y2,X))</td></tr><tr><td rowspan=1 colspan=1>Sky(X) ← (Clouds(Yi) ^ in(Yi,X)) V(Airplane(Y2)^Below(X,Y2))</td></tr><tr><td rowspan=1 colspan=1>Head(X)← Helmet(Yi)^Above(Y1,X)</td></tr><tr><td rowspan=1 colspan=1>Head(X) ← Wearing(Yi,Y2)^SittingOn(X,Yi)^ Hat(Y2)</td></tr><tr><td rowspan=1 colspan=1>Sign(X) ← (Number(Yi)^ On(Yi,X))V (Post(Y2) ^ On(Y2,X))V(Letter(Y3)^ In(Y3,X))</td></tr><tr><td rowspan=1 colspan=1>Sign(X) ← StreetLight(Yi) ^ On(Yi,Y2)^ On(X,Y2)</td></tr><tr><td rowspan=1 colspan=1>Ground(X) ← (Dog(Yi) ∧ On(Yi,X)) V(Grass(Y2) ^ CoveredBy(X,Y2))</td></tr><tr><td rowspan=1 colspan=1>Car(X)←Wheel(Yi)^Of(Yi,X)∧Window(Y2)∧ Of(Y2,X)</td></tr><tr><td rowspan=1 colspan=1>Sidewalk(X) ← Person(Yi) ^WalkingOn(Yi,X) ^ Street(Y2) ^ Near(X,Y2)</td></tr><tr><td rowspan=1 colspan=1>Car(X)←Wheel(Yi)^Of(Yi,X)∧Window(Y2)∧ Of(Y2,X)</td></tr><tr><td rowspan=1 colspan=1>Ear(X)←Eye(Yi)^ Of(Yi,Y2)∧ Of(X,Y2)</td></tr><tr><td rowspan=1 colspan=1>Chair(X) ← Arm(Yi) ^ In(Y,X) ^ Person(Y2)^ SittingOn(Y2,X)</td></tr></table>
417
+
418
+ # B CHALLENGES IN ILP
419
+
420
+ Standard ILP approaches are difficult and involve several procedures that have been proved to be NP-hard. The complexity comes from 3 levels: first, the search space for a formula is vast. The body of the entailment can be arbitrarily long and the same predicate can appear multiple times with different variables, for example, the Inside predicate in Eq.(2) appears twice. Most ILP works constrain the logic entailment to be Horn clause, i.e. the body of the entailment is a flat conjunction over literals, and the length limited within 3 for large datasets.
421
+
422
+ Second, constructing formulas also involves assigning logic variables that are shared across different predicates, which we refer to as variable binding. For example, in Eq.(2), to express that a person is inside the car, we use $X$ and $Y$ to represent the region of a person and that of a car, and the same two variables are used in Inside to express their relations. Different bindings lead to different meanings. For a formula with $n$ arguments (Eq.(2) has 7), there are $\mathcal { O } ( n ^ { n } )$ possible assignments. Existing ILP works either resort to constructing formula from pre-defined templates (Evans & Grefenstette, 2018; Campero et al., 2018) or from chain-like variable reference (Yang et al., 2017), limiting the expressiveness of the learned rules.
423
+
424
+ Finally, evaluating a formula candidate is expensive. A FOL rule is data-independent. To evaluate it, one needs to replace the variables with actual entities and compute its value. This is referred to as grounding or instantiation. Each variable used in a formula can be grounded independently, meaning a formula with $n$ variables can be instantiated into ${ \mathcal { O } } ( C ^ { n } )$ grounded formulas, where $C$ is the number of total entities. For example, Eq.(2) contains 3 logic variables: $X$ , $Y$ and $Z$ . To evaluate this formula, one needs to instantiate these variables into $C ^ { 3 }$ possible combinations, and check if the rule holds or not in each case. However in many domains, such as object detection, such grounding space is vast (e.g. all possible bounding boxes of an image) making the full evaluation infeasible. Many forward-chaining methods such as ∂ILP (Evans & Grefenstette, 2018) scales exponentially in the size of the grounding space, thus are limited to small scale datasets with less than 10 predicates and 1K entities.
425
+
426
+ # C EXPERIMENTS
427
+
428
+ Baselines: For NeuralLP, we use the official implementation at here. For ∂ILP, we use the thirdparty implementation at here. For TransE, we use the implementation at here. For RotatE, we use the official implementation at here.
429
+
430
+ Table 5: Example low-accuracy rules learned by NLIL.
431
+
432
+ <table><tr><td rowspan=1 colspan=1>Bush(X)← -Tree(X)</td></tr><tr><td rowspan=1 colspan=1>Bus(X)← -(Shirt(Yi)^Wearing(Yi,X))</td></tr><tr><td rowspan=1 colspan=1>Backpack(X)← Person(Yi) ^With(Y,X)</td></tr><tr><td rowspan=1 colspan=1>Flowers(X)← Pot(Yi)^With(X,Yi)</td></tr><tr><td rowspan=1 colspan=1>Dirt(X) ← Ground(Yi) ^Near(Yi,X)</td></tr></table>
433
+
434
+ Model setting: For NLIL, we create separate Transformer blocks for each target predicate. All experiments are conducted on a machine with i7-8700K, 32G RAM and one GTX1080ti. We use the embedding size $d = 3 2$ . We use 3 layers of multi-head attentions for each Transformer network. The number of attention heads are set to number of heads $= 4$ for encoder, and the first two layers of the decoder. The last layer of the decoder has one attention head to produce the final attention required for rule evaluation.
435
+
436
+ For KB completion task, we set the number of operator calls $T = 2$ and formula combinations $L = 0$ , as most of the relations in those benchmarks can be recovered by symmetric/asymmetric relations or compositions of a few relations (Sun et al., 2019). Thus complex formulas are not preferred. For FB15K-237, binary predicates are grouped hierarchically into domains. To avoid unnecessary search overhead, we use the most frequent 20 predicates that share the same root domain (e.g. “award”, “location”) with the head predicate for rule body construction, which is a similar treatment as in (Yang et al., 2017). For VG dataset, we set $T = 3$ , $L = 2$ and $C = 4$ .
437
+
438
+ Evaluation metrics: Following the conventions in (Yang et al., 2017; Bordes et al., 2013) we use Mean Reciprocal Ranks (MRR) and Hits $@ 1 0$ for evaluation metrics. For each query $\langle \mathbf { x } , P _ { k } , \mathbf { x } ^ { \prime } \rangle$ , the model generates a ranking list over all possible groundings of predicate $P _ { k }$ , with other groundtruth triplets filtered out. Then MRR is the average of the reciprocal rank of the queries in their corresponding lists, and Hits $@ 1 0$ is the percentage of queries that are ranked within the top 10 in the list.
md/train/SJx9ngStPH/SJx9ngStPH.md ADDED
@@ -0,0 +1,436 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # NAS-BENCH-1SHOT1: BENCHMARKING AND DISSECTING ONE-SHOT NEURAL ARCHITECTURE SEARCH
2
+
3
+ Arber $\mathbf { Z e l a ^ { 1 * } }$ , Julien Siems1∗, & Frank Hutter1,2 1Department of Computer Science, University of Freiburg 2Bosch Center for Artificial Intelligence {zelaa, siemsj, fh}@cs.uni-freiburg.de
4
+
5
+ # ABSTRACT
6
+
7
+ One-shot neural architecture search (NAS) has played a crucial role in making NAS methods computationally feasible in practice. Nevertheless, there is still a lack of understanding on how these weight-sharing algorithms exactly work due to the many factors controlling the dynamics of the process. In order to allow a scientific study of these components, we introduce a general framework for one-shot NAS that can be instantiated to many recently-introduced variants and introduce a general benchmarking framework that draws on the recent large-scale tabular benchmark NAS-Bench-101 for cheap anytime evaluations of one-shot NAS methods. To showcase the framework, we compare several state-of-the-art one-shot NAS methods, examine how sensitive they are to their hyperparameters and how they can be improved by tuning their hyperparameters, and compare their performance to that of blackbox optimizers for NAS-Bench-101.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ While neural architecture search (NAS) has attracted a lot of attention due to the effectiveness in automatically designing state-of-the-art neural networks (Zoph & Le, 2017; Zoph et al., 2018; Real et al., 2017; 2019), the focus has recently shifted to making the search process more efficient (Pham et al., 2018; Elsken et al., 2019; Liu et al., 2019; Xie et al., 2019; Cai et al., 2019; Casale et al., 2019). The most crucial concept which led to a reduction in search costs to the order of a single function evaluation is certainly the weight-sharing paradigm: Training only a single large architecture (the one-shot model) subsuming all the possible architectures in the search space (Brock et al., 2018; Pham et al., 2018).
12
+
13
+ Despite the great advancements of these methods, the exact results of many NAS papers are often hard to reproduce (Li & Talwalkar, 2019; Yu et al., 2020; Yang et al., 2020). This is a result of several factors, such as unavailable original implementations, differences in the employed search spaces, training or evaluation pipelines, hyperparameter settings, and even pseudorandom number seeds (Lindauer & Hutter, 2019). One solution to guard against these problems would be a common library of NAS methods that provides primitives to construct different algorithm variants, similar to what as RLlib (Liang et al., 2017) offers for the field of reinforcement learning. Our paper makes a first step into this direction.
14
+
15
+ Furthermore, experiments in NAS can be computationally extremely costly, making it virtually impossible to perform proper scientific evaluations with many repeated runs to draw statistically robust conclusions. To address this issue, Ying et al. (2019) introduced NAS-Bench-101, a large tabular benchmark with $4 2 3 \mathrm { k }$ unique cell architectures, trained and fully evaluated using a one-time extreme amount of compute power (several months on thousands of TPUs), which now allows to cheaply simulate an arbitrary number of runs of NAS methods, even on a laptop. NAS-Bench-101 enabled a comprehensive benchmarking of many discrete NAS optimizers (Zoph & Le, 2017; Real et al., 2019), using the exact same settings. However, the discrete nature of this benchmark does not allow to directly benchmark one-shot NAS optimizers (Pham et al., 2018; Liu et al., 2019; Xie et al., 2019; Cai et al., 2019). In this paper, we introduce the first method for making this possible.
16
+
17
+ Specifically, after providing some background (Section 2), we make the following contributions:
18
+
19
+ 1. We introduce NAS-Bench-1Shot1, a novel benchmarking framework that allows us to reuse the extreme amount of compute time that went into generating NAS-Bench-101 (Ying et al., 2019) to cheaply benchmark one-shot NAS methods. Our mapping between search space representations is novel to the best of our knowledge and it allows querying the performance of found architectures from one-shot NAS methods, contrary to what is claimed by Ying et al. (2019). Specifically, it allows us to follow the full trajectory of architectures found by arbitrary one-shot NAS methods at each search epoch without the need for retraining them individually, allowing for a careful and statistically sound analysis (Section 3).
20
+ 2. We introduce a general framework for one-shot NAS methods that can be instantiated to many recent one-shot NAS variants, enabling fair head-to-head evaluations based on a single code base (Section 4).
21
+ 3. We use the above to compare several state-of-the-art one-shot NAS methods, assess the correlation between their one-shot model performance and final test performance, examine how sensitive they are to their hyperparameters, and compare their performance to that of black-box optimizers used in NAS-Bench-101 (Section 5).
22
+
23
+ We provide our open-source implementation1, which we expect will also facilitate the reproducibility and benchmarking of other one-shot NAS methods in the future.
24
+
25
+ # 2 BACKGROUND AND RELATED WORK
26
+
27
+ # 2.1 NAS-BENCH-101
28
+
29
+ NAS-Bench-101 (Ying et al., 2019) is a database of an exhaustive evaluation of all architectures in a constrained cell-structured space on CIFAR-10 (Krizhevsky, 2009). Each cell is represented as a directed acyclic graph (DAG) where the nodes represent operation choices and the edges represent the information flow through the neural network (see also Figure 1 and Section 3.1). To limit the number of architectures in the search space, the authors used the following constraints on the cell: 3 operations in the operation set $\mathcal { O } = \{ 3 \mathrm { x } 3 $ convolution, 1x1 convolution, $3 { \mathrm { x } } 3 { \mathrm { ~ m a x } } { \mathrm { - p o o l } } \}$ , at most 7 nodes (this includes input and output node, therefore 5 choice nodes) and at most 9 edges.
30
+
31
+ These constraints, and exploiting symmetries, reduced the search space to $4 2 3 \mathrm { k }$ unique valid architectures. Each architecture was trained from scratch three times to also obtain a measure of variance. In addition, each architecture was trained for 4, 12, 36 and 108 epochs; for our analysis, we mainly used the results for models trained for 108 epochs, if not stated otherwise.
32
+
33
+ # 2.2 NAS-BENCH-102
34
+
35
+ Concurrently to this work, Dong & Yang (2020) released NAS-Bench-102, which is another NAS benchmark that, differently from NAS-Bench-101, enables the evaluation of weight-sharing NAS methods. Their search space consists of a total of 15,625 architectures, which is exhaustively evaluated on 3 image classification datasets. Similarly to Zela et al. (2020) and this work, Dong & Yang (2020) found that architectural overfitting occurs for DARTS for all their datasets.
36
+
37
+ While NAS-Bench-102 and this work go towards the same direction, they differ in many ways:
38
+
39
+ 1. They use extensive computation to create a new benchmark (with 15.625 architectures), while we devise a novel reformulation to reuse the even much more extensive computation of the NASBench-101 dataset ( 120 TPU years) to create three new one-shot search spaces with the larges one containing 363.648 architectures. This required zero additional computational cost.
40
+ 2. We show that it is possible to reuse the graph representation in NAS-Bench-101 to run one-shot NAS methods; this requires changes to the one-shot search space, but allows a mapping which can be used for architecture evaluation.
41
+
42
+ ![](images/282ee12d642c910c0d623c37f9afca75b123967986e2ff858c8e7937724695a4.jpg)
43
+ Figure 1: Overview of the NAS-Bench-1Shot1 analysis strategy. The one-shot model we construct only contains discrete architectures that are elements of NAS-Bench-101 (Ying et al., 2019). The cell architecture chosen is similar to that of Bender et al. (2018), with each choice block containing an operation decision. Note that NAS-Bench-101 does not contain a separate reduction cell type. Plot on the right from Ying et al. (2019) (Best viewed in color).
44
+
45
+ 3. They evaluate their search space on 3 image classification datasets, while we introduce 3 different search spaces (as sub-spaces of NAS-Bench-101) with growing complexity.
46
+
47
+ # 2.3 ONE-SHOT NEURAL ARCHITECTURE SEARCH
48
+
49
+ The NAS problem can be defined as searching for the optimal operation (e.g. in terms of validation error of architectures) out of the operation set $\mathcal { O }$ in each node of the DAG and for the best connectivity pattern between these nodes.
50
+
51
+ Designing architectures for optimized accuracy or to comply with resource constraints led to significant breakthroughs on many standard benchmarks (Pham et al., 2018; Zoph & Le, 2017; Brock et al., 2018; Liu et al., 2019; Cai et al., 2019; Elsken et al., 2019). While early methods were computationally extremely expensive (Zoph & Le, 2017), the weight-sharing paradigm (Brock et al., 2018; Pham et al., 2018) led to a significant increase in search efficiency. Here, the weights of the operations in each architecture are shared in a supermodel (the so-called one-shot model or convolutional neural fabric (Saxena & Verbeek, 2016)), which contains an exponential number of sub-networks, each of which represents a discrete architecture. Architectures whose sub-networks share components (nodes/edges) also share the weights for these components’ operations; therefore, in analogy to DropOut (Srivastava et al., 2014), training one architecture implicitly also trains (parts of) an exponential number of related architectures. There are a variety of methods on how to conduct NAS by means of the one-shot model (Brock et al., 2018; Pham et al., 2018; Bender et al., 2018; Liu et al., 2019; Li & Talwalkar, 2019) (see also Appendix B), but the final problem is to find the optimal sub-network in this one-shot model.
52
+
53
+ The weight sharing method was used to great effect in DARTS (Liu et al., 2019), where it allows a gradient based optimization of both the architectural and the one-shot weights. Subsequent work on DARTS has addressed further lowering the computational and the memory requirements (Dong & Yang, 2019; Xu et al., 2020; Cai et al., 2019; Casale et al., 2019).
54
+
55
+ One fundamental drawback of the weight sharing method is the fact that the architecture search typically takes place in a lower fidelity model (e.g., using less cells and/or cheaper operations): the so-called proxy model. After the search, a discrete architecture is derived from the proxy model which is then trained with more parameters — a stage often referred to as architecture evaluation. This poses the question whether the architecture found in the proxy model is also a good architecture in the bigger model, a question studied by several recent works (Bender et al., 2018; Yu et al., 2020).
56
+
57
+ # 3 A GENERAL FRAMEWORK FOR BENCHMARKING ONE-SHOT NAS
58
+
59
+ We will now introduce our framework for cheaply benchmarking the anytime performance of oneshot NAS methods. Our main analysis strategy is the following: First, we run the search procedure of various methods and save the architecture weights of the one-shot models for each epoch. Second, we find the discrete architecture at each epoch and query it in NAS-Bench-101. The last step is not trivial due to the different representations of the search space used in NAS-Bench-101 and standard one-shot methods. Ying et al. (2019) state that one-shot methods cannot be directly evaluated on NAS-Bench-101. In the following sections we present a mapping between these different search space representations, which eventually enable us to evaluate one-shot methods on NAS-Bench101. To the best of our knowledge this is a novel contribution of this paper.
60
+
61
+ # 3.1 SEARCH SPACE REPRESENTATION
62
+
63
+ In order to carry out the analysis we propose in this work, we had to construct a search space that only contains discrete architectures that are also contained in NAS-Bench-101. This allows us to look up any discrete architectures’ performance in NAS-Bench-101 when the larger model is trained from scratch. Unfortunately, this is non-trivial since the NAS-Bench-101 space does not match the typical space used in one-shot NAS methods. We separately consider the various parts of the search space.
64
+
65
+ Network-Level Topology. In terms of network-level topology, our search spaces closely resemble the models which were evaluated in NAS-Bench-101. We used the same macro architecture as in NAS-Bench-101, i.e., 3 stacked blocks with a max-pooling operation in-between, where each block consists of 3 stacked cells (see Figure 1). While our final evaluation models exactly follow NAS-Bench-101 in order to be able to reuse its evaluations, our one-shot model only has 16 initial convolution filters, rather than the 128 used in NAS-Bench-101. This is a common practice to accelerate NAS and used similarly in, e.g., Liu et al. (2019).
66
+
67
+ Cell-Level Topology. The cell-level structure is represented as a DAG, where the input node is the output of a previous cell or the convolutional stem, and the output node is a concatenation of all the previous nodes. In order to have the operation choices still in the intermediate nodes of the DAG, we adapt the choice block motif from Bender et al. (2018) as depicted in Figure 1. The edges connecting input, output nodes and choice blocks represent only the information flow in the graph. To have a large and expressive enough search space(s), we introduce the following architectural weights in the DAG edges:
68
+
69
+ • $\alpha ^ { i , j }$ to edges connecting nodes $\textit { i } < \textit { j }$ to choice block $j$ . The input of choice block $j$ is then
70
+ computed as $\begin{array} { r } { I ^ { j } = \sum _ { i < j } \frac { \exp ( \alpha ^ { i , j } ) } { \sum _ { i ^ { \prime } < j } \exp ( \alpha ^ { i ^ { \prime } , j } ) } x ^ { i } } \end{array}$ , where $x ^ { i }$ is the output tensor of node $i$ (either input node or choice block).
71
+ • $\gamma ^ { j , k }$ to the edges connecting the input node or choice blocks $j < k$ to the output node $k$ of the cell,
72
+ where the corresponding feature maps are concatenated: Ok = ⊕j<k exp(γj,kP )j0<k exp(γj0,k) x , where $\oplus$ is the concatenation operator.
73
+
74
+ Note that the non-linearity applied to the edge weights varies depending on the NAS optimizer used; e.g. for GDAS (Dong & Yang, 2019) and SNAS (Xie et al., 2019) it would be a GumbelSoftmax (Eric Jang & Poole, 2017) instead.
75
+
76
+ Choice Blocks. As in Bender et al. (2018), each choice block inside the cell can select between the operations in the operations set $\mathcal { O }$ of NAS-Bench-101. In order to find the optimal operation in each choice block via gradient-based one-shot NAS methods, we assign an architectural weight $\beta ^ { o }$ to each operation $o \in \mathcal { O }$ inside the choice block. The output of the choice block $j$ is computed by adding element-wise the latent representations coming from the operations outputs:
77
+
78
+ $$
79
+ x ^ { j } = \sum _ { o \in \mathcal { O } } \frac { \exp ( \beta ^ { o } ) } { \sum _ { o ^ { \prime } \in \mathcal { O } } \exp ( \beta ^ { o ^ { \prime } } ) } o ( I ^ { j } ) ,
80
+ $$
81
+
82
+ which is basically the so-called MixedOp in DARTS. NASBench cells contain 1x1 projections in front every operation (demonstrated in Figure 1 in (Ying et al., 2019)). The number of output channels of each projection is chosen such that the output has the same number of channels as the
83
+
84
+ input. This adaptive choice for the number of channels is incompatible with the one-shot model due to the different tensor dimensionality coming from previous choice blocks. We used 1x1 projections with a fixed number of channels instead.
85
+
86
+ # 3.2 EVALUATION PROCEDURE
87
+
88
+ By means of these additional weights we do not restrict the possible architectures in the search space to contain only a fixed number of edges per cell, as done for example in Zoph et al. (2018), Pham et al. (2018), Liu et al. (2019), etc. This requirement would have restricted our architectural decisions heavily, leading to only small search spaces.
89
+
90
+ Table 1 shows the characteristics of each search space. We propose three different search spaces by making different decisions on the number of parents each choice block has. The decisions affect the quality and quantity of the architectures contained in each search space. For all search spaces note that the sum of the number of parents of all nodes in the search space is chosen to be 9, to match the NAS-Bench-101 requirement. Search space 1, 2 and 3 have 6240, 29160 and 363648 architectures with loose ends respectively, making search space 3 the largest investigated search space. To the best of our knowledge search space 3 is currently the largest and only available tabular benchmark for one-shot NAS. For details on each search space see Appendix A.
91
+
92
+ Table 1: Characteristic information of the search spaces.
93
+
94
+ <table><tr><td></td><td></td><td colspan="3">Search space</td></tr><tr><td rowspan="6">No. parents</td><td></td><td>1</td><td>2</td><td>3</td></tr><tr><td>Node 1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Node 2</td><td>2</td><td>1</td><td>1</td></tr><tr><td>Node 3</td><td>2</td><td>2</td><td>1</td></tr><tr><td>Node 4</td><td>2</td><td>2</td><td>2</td></tr><tr><td>Node 5 Output</td><td>-</td><td>- 3</td><td>2 2</td></tr><tr><td rowspan="2">No.archs.</td><td>w/ loose ends</td><td>2</td><td></td><td></td></tr><tr><td>w/o loose ends</td><td>6240 2487</td><td>29160 3609</td><td>363648 24066</td></tr></table>
95
+
96
+ Given the architectural weights of the cell shown in Figure 1 we query the test and validation error of the discrete architecture from NAS-Bench-101 as follows.
97
+
98
+ 1. We determine the operation chosen in each choice block by choosing the operation with the highest architectural weight.
99
+ 2. We determine the parents of each choice block and the output by choosing the top- $k$ edges according to Table 1 (e.g. for choice block 4 in search space 3 we would choose the top-2 edges as parents).
100
+ 3. From 1. we construct the operation list and from 2. the adjacency matrix of the cell which we use to query NAS-Bench-101 for the test and validation error.
101
+
102
+ Each node in the graph chooses its parents during evaluation following e.g. DARTS (Liu et al., 2019). However, because edges model information flow and the output edges are also architectural decisions there is possibility of a node being a loose end. These are nodes whose output does not contribute to the output of the discrete cell, as seen in the upper cell under evaluation of Figure 1. As a result, we can count the number of architectures with or without loose ends. Note, that had we chosen the children of each node we could have invalid architectures where a node has an output but no input.
103
+
104
+ # 4 A GENERAL FRAMEWORK FOR ONE-SHOT NAS METHODS
105
+
106
+ Most of the follow-up works of DARTS (Algorithm 1), which focus on making the search even more efficient and effective, started from the original DARTS codebase2, and each of them only change very few components compared to DARTS.
107
+
108
+ # Algorithm 1 DARTS
109
+
110
+ # Algorithm 2 PC-DARTS
111
+
112
+ # Algorithm 3 GDAS
113
+
114
+ 1: $\begin{array} { r } { I ^ { j } = \sum _ { i < j } S ( \alpha ^ { i , j } ) x ^ { i } } \end{array}$
115
+ 2: Ok = ⊕j<kS(γj,k)xj
116
+ 3: xj = Po∈O S(βo)o(Ij )
117
+ 4: m ← DAG(Ij , Ok , xj )
118
+ 5: while not converged do
119
+ 6: 7: 8: m.update(Λ, ∇ΛLvalid) m.update(w, ∇wLtrain) end while Return Λ
120
+
121
+ 1: Ij = Pi<j S(αi,j )xi
122
+ 2: Ok = ⊕j<kS(γj,k)xj
123
+ 3: xj = Po∈O S(βo)o(Mo∗Ij )+(1 − Mo ∗ Ij )
124
+ 4: m ← DAG(Ij , Ok , xj )
125
+ 5: while not converged do
126
+ 6: m.update(Λ, ∇ΛLvalid)
127
+ 7: 8: m.update(w, ∇wLtrain)
128
+ end while
129
+ 9: Return Λ
130
+ 1: Ij = Pi<j GS(αi,j )xi
131
+ 2: Ok = ⊕j<kGS(γj,k)xj
132
+ 3: xj = Po∈OGS(βo)o(Ij )
133
+ 4: m ← DAG(Ij , Ok , xj )
134
+ 5: while not converged do
135
+ 6: m.update(Λ, ∇ΛLvalid)
136
+ 7: m.update single path(w, ∇wLtrain)
137
+ 8: 9: end while
138
+ Return Λ
139
+
140
+ # Algorithm 4 Random NAS with Weight-sharing
141
+
142
+ # Algorithm 5 ENAS
143
+
144
+ 1: Ij = Pi<j x i
145
+ 2: = ⊕ j<k xj
146
+ 3: o ( I j )
147
+ 4: m ← DAG(Ij , Ok , xj )
148
+ 5: while not converged do
149
+ 6: arch ← sample using controller(m)
150
+ 7: m.update weights of single architecture(arch, w, ∇wLtrain)
151
+ 8: Update RNN controller
152
+ 9: end while
153
+ 10: for i ∈ 1..100 do
154
+ 11: arch samples ← sample using controller(m)
155
+ 12: end for
156
+ 13: Return arch ∈ arch samples with lowest validation error
157
+
158
+ 1: Ij = Pi<j x i 2: k = ⊕j<k xj
159
+ 3: x j = P o ( I j )
160
+ 4: m ← DAG(Ij , Ok , xj )
161
+ 6: 7: 8:9: 5: while not converged do arch sample uniformly at random(m) m.update weights of single architecture(arch, w, ∇wLtrain) end while for i ∈ 1..1000 do
162
+ 11: arch samples sample uniformly at random(m)
163
+ 12: end for
164
+ 13: Return arch $\in$ arch samples with lowest validation error
165
+
166
+ Algorithm 2 and Algorithm 3 highlight these components (relative to DARTS) for PC-DARTS (Xu et al., 2020) and GDAS (Dong & Yang, 2019), respectively. For example, when comparing PCDARTS and DARTS, the only difference in our benchmark is the partial channel connections (line 3 of Algorithm 2) in the choice blocks, which consists of a channel sampling mask $M ^ { o }$ that drops feature maps coming from $I ^ { j }$ . GDAS, on the other hand, replaces the Softmax (S) function in DARTS by a Gumbel-Softmax $( G S )$ , which applies for every architectural weight in $\Lambda = \{ \alpha , \beta , \gamma \}$ (lines 1-3 in Algorithm 3), and uses this concrete distribution to sample single paths through the cell during search (line 7 in Algorithm 3). Random Search with Weight Sharing (Random WS) (Li & Talwalkar, 2019) (Algorithm 4) and ENAS (Pham et al., 2018) (Algorithm 5) do not need the continuous relaxation in order to conduct the architecture search, instead they sample randomly in RandomWS or from the recurrent neural network controller (line 6 in Algorithm 1) in ENAS, in order to select the sub-network in the one-shot model to train.
167
+
168
+ These close correspondences between current one-shot NAS variants provide an opportunity to implement all of these variants in the same general code basis. This allows us to (a) automatically guard against any confounding factors when evaluating the strengths and weaknesses of different approaches, and (b) allows us to mix and match the components of different algorithms. We implemented all variants in a single code basis, which we are committed to grow into a flexible library of primitives for one-shot NAS methods, and for which we will gladly accept any help the community wants to provide.
169
+
170
+ One-shot NAS methods in this code basis inherit all the methods and attributes necessary for building the one-shot computational graph from a base parent class. This encapsulation and modularity ensures that all differences in their performance come from a few lines of code, and that all other confounding factors cannot affect these results. This will also facilitate the incorporation of other one-shot NAS methods and pinpoint the components that differ in them.
171
+
172
+ Furthermore, the primitives encoding the search spaces presented in Section 3 are defined separately from the NAS optimizers. This encapsulation will allow researchers to study each of these components in isolation, experimenting with one of them while being sure that the other one does not change.
173
+
174
+ # 5 NAS-BENCH-1SHOT1 AS A BENCHMARK AND ANALYSIS FRAMEWORK
175
+
176
+ We now demonstrate the use of NAS-Bench-1Shot1 as a benchmark for one-shot NAS. We first evaluate the anytime performance of five different one-shot NAS methods: DARTS (Liu et al., 2019), GDAS (Dong & Yang, 2019), PC-DARTS (Xu et al., 2020), ENAS (Pham et al., 2018) and Random Search with Weight Sharing (Random WS) (Li & Talwalkar, 2019).3 Afterwards, we investigate the robustness of these one-shot NAS optimizers towards their search hyperparameters and show that if these hyperparameters are carefully tuned, the one-shot NAS optimizer can outperform a wide range of other discrete NAS optimizers in our search spaces.
177
+
178
+ # 5.1 COMPARISON OF DIFFERENT ONE-SHOT NAS OPTIMIZERS
179
+
180
+ We ran the NAS search for 50 epochs4 using their respective default hyperparameter settings (see Appendix C). If not stated otherwise, all the following results were generated by running each experiment with six random seeds (0 to 5). All plots show the mean and standard deviation of the test regret queried from NAS-Bench-101. Over the three independent trainings contained in NASBench101 for each architecture on each epoch budget we average. The search was done on a single NVIDIA RTX2080Ti using the same python environment. In Figure 2 we report the anytime test regret for each of these methods. Our findings can be summarized as follows:
181
+
182
+ • While the one-shot validation error converged in all cases (except for GDAS due to the temperature annealing) the queried test error from NAS-Bench-101 of the architectures increased at some point, indicating that the architectural parameters overfit the validation set. This phenomenon occurred frequently for DARTS. The same result was also previously observed by Zela et al. (2020) on subspaces of the standard DARTS space.
183
+
184
+ • PC-DARTS demonstrated both a stable search and relatively good final performance in all search spaces, notably the best overall performance for search space 3. We attribute this behaviour to the regularization effect present in PC-DARTS via the partial channel connections (see Zela et al. (2020) and Section 5.3).
185
+
186
+ • Random WS and ENAS mainly explore poor architectures across all three search spaces. This behaviour is a result of the small correlation between the architectures evaluated with the one-shot weights and their true performance during architecture evaluation (as queried from NAS-Bench101 (see Section 5.2)). This correlation directly affects these methods since in the end of search they sample a certain number of architectures (1000 randomly sampled for Random WS and 100 using the learned controller policy for ENAS) and evaluate them using the one-shot model weights in order to select the architecture which is going to be trained from scratch in the final evaluation phase. When running ENAS for 100 epochs in search space 2 (Figure 7 in the appendix) we see that the it performs better than Random WS. ENAS also has a stronger correlation between the sampled architectures and the NAS-Bench-101 architectures for search space 2 (see Section 5.2).
187
+
188
+ • GDAS performs quite robustly across all 3 benchmarks, however, due to the temperature annealing of the Gumbel Softmax, it might manifest some premature convergence to a sub-optimal local minimum.
189
+
190
+ # 5.2 CORRELATION ANALYSIS
191
+
192
+ Many one-shot NAS methods, such as ENAS (Pham et al., 2018), NAONet (Luo et al., 2018) or Random WS (Li & Talwalkar, 2019) select the final architecture by means of the one-shot parameters. In order to assess if this is optimal we computed the correlation between a given architecture’s one-shot test error and its respective NAS-Bench-101 test error, for all 4 available budgets in NASBench-101 on every 10th search epoch. This analysis was performed for all architectures without loose ends in each search space. The only exception is ENAS, for which we decided to evaluate the correlation by sampling 100 architectures (as done by the algorithm after the search has finished to select the one to retrain from scratch) from the controller instead of evaluating every architecture in the search space.
193
+
194
+ ![](images/187f620f20c862a6e167a6a57746ab87c879dfbd0fab69f166fea9f7f0527db4.jpg)
195
+ Figure 2: Comparison of different one-shot NAS optimizers on the three different search spaces defined on NASBench. The solid lines show the anytime test regret (mean $\pm$ std), while the dashed blurred lines the one-shot validation error (Best viewed in color).
196
+
197
+ ![](images/d93ee4dc46df9c108774edb39099f8dd3f3e24d71798721df90711beb34fdf75.jpg)
198
+ Figure 3: Correlation between the one-shot validation error and the corresponding NAS-Bench-101 test error for each search space. (Best viewed in color).
199
+
200
+ As shown in Figure 3, there is almost no correlation between the weight sharing ranking and the true one (Spearman correlation coeff. between -0.25 and 0.3) during search for DARTS, PC-DARTS, GDAS and Random WS. Only ENAS shows some correlation for search space 2 and some anticorrelation for search spaces 1 and 3. These results agree with the ones reported by Yu et al. (2020) (who could only do this evaluationx on a small search space) and explain the poor performance of Random WS and ENAS on our benchmarks, since the architectures sampled during evaluation and ranked according to their one-shot validation error are unlikely to perform well when evaluated independently. To the best of our knowledge this is the first time that an evaluation of this correlation is conducted utilizing such a large number of architectures in the search space, namely 24066 different architectures for search space 3. We added further experiments on the correlation between the lower fidelity proxy model used in architecture search and the final model from architecture evaluation in the Appendix H.
201
+
202
+ # 5.3 ROBUSTNESS OF ONE-SHOT NAS OPTIMIZERS
203
+
204
+ As already observed by Zela et al. (2020), DARTS tends to become more robust when the inner objective $\mathcal { L } _ { t r a i n }$ in the bi-level optimization procedure has a relatively strong regularization factor during search. In order to investigate the long term behaviour, for this analysis we chose to run every search for 100 epochs instead of 50 epochs. Similarly to Zela et al. (2020), we find that enabling Cutout (DeVries & Taylor, 2017) or increasing the $L _ { 2 }$ factor for the search model weights, has a substantial effect on the quality of the solutions found by the NAS optimizers. See Figure 4 for the Cutout (CO) results and Figure 11 (in the appendix) for the results with different $L _ { 2 }$ regularization. Based on these results we observe that:
205
+
206
+ ![](images/57b04aa70225b163e317d2600c3537b14cf5e9d4f1b2c96713c74c08aad10c9a.jpg)
207
+ Figure 4: Illustration of the impact that Cutout has on the test regret on NAS-Bench-101 and the validation error of the one-shot model using DARTS, GDAS and PC-DARTS on search space 3 (Best viewed in color).
208
+
209
+ • As DARTS overfits to the validation set at the end of search for search space 1 and 3, applying Cutout during search either keeps the solutions to a good local minimum or reduces the overfitting effect, a finding similar as the one in Zela et al. (2020).
210
+ • Interestingly, while Zela et al. (2020) only showed overfitting behavior for DARTS, it may also occur for GDAS (Figure 13 in the appendix) and PC-DARTS (Figure 14 in the appendix), which indicates that this might be an intrinsic property of these methods due to the local updates in the architecture space.
211
+ • In PC-DARTS, there is already a strong regularization effect as a result of the partial channel connectivity, which explains the robust behavior of this optimizer and that its results deteriorate on average as we increase $L _ { 2 }$ regularization.
212
+
213
+ # 5.4 TUNABILITY OF ONE-SHOT NAS HYPERPARAMETERS
214
+
215
+ Next to the hyperparameters used in the evaluation pipeline, one-shot NAS methods have several hyperparameters of their own, such as the regularization hyperparameters studied in Section 5.3, learning rates, and other hyperparameters of the search phase.
216
+
217
+ Naively tuning these hyperparameters with the one-shot validation error as the objective would lead to sub-optimal configurations, since, as we saw, this metric is not a good indicator of generalization. In our proposed benchmarks, we can tune these hyperparameters of the NAS optimizer to minimize the validation error queried from NAS-Bench-101. By doing so, we aim to shed more light onto the influence these hyperparameters have during the one-shot search, and to study the sensitivity of the NAS method towards these hyperparameters.
218
+
219
+ To this end, we constructed 3 configuration spaces of increasing cardinality, CS1,
220
+
221
+ ![](images/88b0b2e4099127118d81a056b6be2e05beeb803856f438ceec5bd2e6d2738124.jpg)
222
+ Figure 5: Optimizing the hyperparameters of one-shot optimizers with BOHB on search space 3. (best viewed in color). Results for search space 1 and 2 are shown in Figure 16.
223
+
224
+ CS2 and CS3 (see Appendix F for details), which only include hyperparameters controlling the NAS process. We chose BOHB (Falkner et al. (2018), see Appendix F for details) as the hyperparameter optimization method and DARTS as our NAS method to be tuned across all configuration spaces, since in our benchmarks it was more brittle than PC-DARTS and GDAS. We provide the results in Appendix F.2.
225
+
226
+ In order to compare the tunability of NAS methods, we used BOHB to optimize all of DARTS, PCDARTS, and GDAS, starting from their respective default hyperparameter settings. Figure 5 shows the anytime test regret of the architectures found by the respective NAS method’s configurations tried by BOHB; as the figure shows, PC-DARTS and GDAS start with much more robust hyperparameter settings, but DARTS can also be tuned to perform as well or better. We note that carrying out this optimization on NAS-Bench-1Shot1 reduced the time for tuning DARTS from a simulated 45 GPU days to 1 day on 16 GPUs.
227
+
228
+ Figure 5 also provides an evaluation of DARTS, GDAS and PC-DARTS compared to the state-of-art discrete NAS optimizers used by Ying et al. (2019) (such as RL, RE, and HPO methods). Since these one-shot NAS methods are much faster than black-box methods, it is possible to tune them online using BOHB and the resulting BOHB-{DARTS, GDAS, PC-DARTS} typically still yields better performance over time. Note that we never use the validation set split used to evaluate the individual architectures in NAS-Bench-101 during the architecture search. This subset with $1 0 \mathrm { k }$ examples is only used to compute the objective function value that BOHB optimizes. Therefore, the one-shot optimizers use $2 0 \mathrm { k }$ examples for training and $2 0 \mathrm { k }$ for the architectural parameter updates. The x-axis in Figures 5 shows the simulated wall-clock time: $t _ { s i m } = t _ { s e a r c h } + t _ { t r a i n }$ , where tsearch is the time spent during search by each configuration and $t _ { t r a i n }$ is the training time for 108 epochs (queried from NAS-Bench-101) of the architectures selected by the one-shot optimizer. From this experiment, we make the following observations:
229
+
230
+ • On all search spaces the architectures BOHB-DARTS found outperformed the architectures found by the default DARTS configuration by a factor of 7 to 10.
231
+ • The found robust configurations did not only avoid overfitting in the architectural level, but they also typically outperformed the architectures found by state-of-art discrete NAS optimizers used by Ying et al. (2019) (such as RL, RE, and HPO methods).
232
+ • The multi-fidelity in BOHB does not only accelerate the hyperparameter optimization procedure, but in this case also allows to determine the sufficient number of epochs to run the NAS optimizer in order to get an optimal architecture. In fact, the best configuration on each of the incumbents comes usually from the lowest budget, i.e. 25 search epochs.
233
+ • The most robust configuration on each of the search spaces are typically the ones with a large regularization factor, relative to the default value in Liu et al. (2019) (see Figure 19 in the appendix).
234
+
235
+ # 6 CONCLUSION AND FUTURE DIRECTIONS
236
+
237
+ We proposed NAS-Bench-1Shot1, a set of 3 new benchmarks for one-shot neural architecture search which allows to track the trajectory and performance of the found architectures computationally cheaply. Using our analysis framework, we compared state-of-the-art one-shot NAS methods and inspected the robustness of the methods and how they are affected by different hyperparameters. Our framework allows a fair comparison of any one-shot NAS optimizer and discrete NAS optimizers without any confounding factors. We hope that our proposed framework and benchmarks will facilitate the evaluation of existing and new one-shot NAS methods, improve reproducibility of work in the field, and lead to new insights on the underlying mechanisms of one-shot NAS.
238
+
239
+ # ACKNOWLEDGMENTS
240
+
241
+ The authors acknowledge funding by the Robert Bosch GmbH, support by the European Research Council (ERC) under the European Unions Horizon 2020 research and innovation program through grant no. 716721, and by BMBF grant DeToL.
242
+
243
+ # REFERENCES
244
+
245
+ Gabriel Bender, Pieter-Jan Kindermans, Barret Zoph, Vijay Vasudevan, and Quoc Le. Understanding and simplifying one-shot architecture search. In International Conference on Machine Learning, 2018.
246
+
247
+ Andrew Brock, Theo Lim, J.M. Ritchie, and Nick Weston. SMASH: One-shot model architecture search through hypernetworks. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $=$ rydeCEhs-.
248
+
249
+ Han Cai, Ligeng Zhu, and Song Han. Proxylessnas: Direct neural architecture search on target task and hardware. In International Conference on Learning Representations, 2019.
250
+
251
+ Francesco Paolo Casale, Jonathan Gordon, and Nicolo Fusi. Probabilistic neural architecture search. arXiv preprint arXiv:1902.05116, 2019.
252
+
253
+ Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017.
254
+
255
+ Xuanyi Dong and Yi Yang. Searching for a robust neural architecture in four gpu hours. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1761– 1770, 2019.
256
+
257
+ Xuanyi Dong and Yi Yang. Nas-bench-102: Extending the scope of reproducible neural architecture search. In International Conference on Learning Representations, 2020. URL https: //openreview.net/forum?id $=$ HJxyZkBKDr.
258
+
259
+ Thomas Elsken, Jan Hendrik Metzen, and Frank Hutter. Efficient multi-objective neural architecture search via lamarckian evolution. In International Conference on Learning Representations, 2019.
260
+
261
+ Shixiang Gu Eric Jang and Ben Poole. Categorical reparameterization with gumbel-softmax. In International Conference on Learning Representations, 2017.
262
+
263
+ Stefan Falkner, Aaron Klein, and Frank Hutter. BOHB: Robust and efficient hyperparameter optimization at scale. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 1437–1446, Stockholmsmassan, Stockholm Sweden, 10–15 Jul 2018. PMLR. URL ¨ http://proceedings.mlr.press/v80/falkner18a.html.
264
+
265
+ F. Hutter, H. Hoos, and K. Leyton-Brown. An efficient approach for assessing hyperparameter importance. In E. Xing and T. Jebara (eds.), Proceedings of the 31th International Conference on Machine Learning, (ICML’14), pp. 754–762. Omnipress, 2014.
266
+
267
+ K. Jamieson and A. Talwalkar. Non-stochastic best arm identification and hyperparameter optimization. In Proceedings of the Seventeenth International Conference on Artificial Intelligence and Statistics (AISTATS), 2016.
268
+
269
+ A. Krizhevsky. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.
270
+
271
+ L. Li, K. Jamieson, G. DeSalvo, A. Rostamizadeh, and A. Talwalkar. Hyperband: Bandit-based configuration evaluation for hyperparameter optimization. In International Conference on Learning Representations, 2017.
272
+
273
+ Liam Li and Ameet Talwalkar. Random search and reproducibility for neural architecture search. In Proceedings of the Thirty-Fifth Conference on Uncertainty in Artificial Intelligence, UAI 2019, Tel Aviv, Israel, July 22-25, 2019, pp. 129, 2019. URL http://auai.org/uai2019/ proceedings/papers/129.pdf.
274
+
275
+ Eric Liang, Richard Liaw, Robert Nishihara, Philipp Moritz, Roy Fox, Joseph Gonzalez, Ken Goldberg, and Ion Stoica. Ray rllib: A composable and scalable reinforcement learning library. CoRR, abs/1712.09381, 2017. URL http://arxiv.org/abs/1712.09381.
276
+
277
+ Marius Lindauer and Frank Hutter. Best practices for scientific research on neural architecture search. arXiv preprint arXiv:1909.02453, 2019.
278
+
279
+ Hanxiao Liu, Karen Simonyan, and Yiming Yang. DARTS: Differentiable architecture search. In International Conference on Learning Representations, 2019.
280
+
281
+ Renqian Luo, Fei Tian, Tao Qin, and T. M. Liu. Neural architecture optimization. In NeurIPS, 2018.
282
+
283
+ Hieu Pham, Melody Y. Guan, Barret Zoph, Quoc V. Le, and Jeff Dean. Efficient neural architecture search via parameter sharing. In International Conference on Machine Learning, 2018.
284
+
285
+ Esteban Real, Sherry Moore, Andrew Selle, Saurabh Saxena, Yutaka Leon Suematsu, Jie Tan, Quoc V. Le, and Alexey Kurakin. Large-scale evolution of image classifiers. In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 2902–2911, International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR. URL http://proceedings.mlr. press/v70/real17a.html.
286
+
287
+ Esteban Real, Alok Aggarwal, Yanping Huang, and Quoc V. Le. Aging Evolution for Image Classifier Architecture Search. In AAAI, 2019.
288
+
289
+ Shreyas Saxena and Jakob Verbeek. Convolutional neural fabrics. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems 29, pp. 4053–4061. Curran Associates, Inc., 2016.
290
+
291
+ N. Srivastava, G. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15: 1929–1958, 2014.
292
+
293
+ B. Williams, T. Santner, and W. Notz. Sequential design of computer experiments to minimize integrated response functions. Statistica Sinica, 2000.
294
+
295
+ Sirui Xie, Hehui Zheng, Chunxiao Liu, and Liang Lin. SNAS: stochastic neural architecture search. In International Conference on Learning Representations, 2019.
296
+
297
+ Yuhui Xu, Lingxi Xie, Xiaopeng Zhang, Xin Chen, Guo-Jun Qi, Qi Tian, and Hongkai Xiong. Pc-darts: Partial channel connections for memory-efficient architecture search. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum? id $=$ BJlS634tPr.
298
+
299
+ Antoine Yang, Pedro M. Esperana, and Fabio M. Carlucci. Nas evaluation is frustratingly hard. In International Conference on Learning Representations, 2020. URL https://openreview. net/forum?id ${ . } = { }$ HygrdpVKvr.
300
+
301
+ Chris Ying, Aaron Klein, Eric Christiansen, Esteban Real, Kevin Murphy, and Frank Hutter. NASbench-101: Towards reproducible neural architecture search. 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. 7105–7114, Long Beach, California, USA, 09–15 Jun 2019. PMLR. URL http://proceedings.mlr.press/v97/ ying19a.html.
302
+
303
+ Kaicheng Yu, Christian Sciuto, Martin Jaggi, Claudiu Musat, and Mathieu Salzmann. Evaluating the search phase of neural architecture search. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } }$ H1loF2NFwr.
304
+
305
+ Arber Zela, Thomas Elsken, Tonmoy Saikia, Yassine Marrakchi, Thomas Brox, and Frank Hutter. Understanding and robustifying differentiable architecture search. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ H1gDNyrKDS.
306
+
307
+ Barret Zoph and Quoc V. Le. Neural architecture search with reinforcement learning. In International Conference on Learning Representations (ICLR) 2017 Conference Track, 2017.
308
+
309
+ Barret Zoph, Vijay Vasudevan, Jonathon Shlens, and Quoc V. Le. Learning transferable architectures for scalable image recognition. In Conference on Computer Vision and Pattern Recognition, 2018.
310
+
311
+ # A DETAILS ON SEARCH SPACES
312
+
313
+ Search space 1 The main characteristic of this search space is that the number of parents for each choice block and output has to be exactly 2 (apart from choice block 1 which is only connected to the input). Because of this requirement one choice block had to be discarded as that would exceed the requirement to have at most 9 edges. The total distribution of test error in shown in Figure 6a. It is the smallest search space discussed in this work.
314
+
315
+ Search space 2 This search space is related to search space 1 in that it only consists of 4 intermediate nodes, but in contrast the output has three parents and nodes 1 and 2 only one parent. This increases the number of architectures in this space compared to search space 1. The test error distribution is shown in Figure 6b.
316
+
317
+ Search space 3 All 5 intermediate nodes are used in this search space, making this search space the largest, but also the search space where each node has on average the least number of parents. The test error distribution is shown in Figure 6c.
318
+
319
+ # B OPTIMIZERS
320
+
321
+ DARTS (Liu et al., 2019) uses a weighted continuous relaxation over the operations to learn an architecture by solving a bilevel optimization problem. The training dataset is split in two parts, one used for updating the parameters of the operations in the one-shot model, and the other to update the weights appended to operations, that determine the importance of that operation.
322
+
323
+ For evaluation, we choose the parents of each choice block based on the highest architectural weights and the number of parents for that choice block given by Table 1. We pick the highest weighted operation from the choice block.
324
+
325
+ GDAS (Dong & Yang, 2019) modifies DARTS, such that individual paths are sampled differentiably through each cell using Gumbel-Softmax (Eric Jang & Poole, 2017) to adapt the architecture weights. This reduces the memory overhead created by DARTS as only the sampled paths have to be evaluated. GDAS uses the same search space and evaluation procedure as DARTS.
326
+
327
+ PC-DARTS (Xu et al., 2020) reduces the memory overhead by only evaluating a random fraction of the channels with the mixed-ops. The authors argue that this also regularizes the search as it lowers the bias towards weight-free operations such as skip-connect and max-pooling, which are often preferred early on in DARTS search. In addition to partial channel connections, the authors propose edge normalization, which adds additional architectural parameters to the edges connecting to an intermediate node. This is done to compensate for the added fluctuations due to the partial channel connections. These additional weights are already part of the search spaces we proposed in this paper.
328
+
329
+ Random Search with Weight Sharing (Random WS) (Li & Talwalkar, 2019) randomly samples architectures from the one-shot model for each training mini-batch and trains only the selected subset of the one-shot model on that mini-batch. Differently from DARTS, PC-DARTS and GDAS,
330
+
331
+ ![](images/5da0da750fd00ae77b724fbb9a81f66db85bd72a71421ef63b070db342259b31.jpg)
332
+ Figure 6: Distribution of test error in the search spaces with loose ends.
333
+
334
+ Random WS does not require a validation set, since there are no architectural weights that need to be updated. For evaluation Random WS samples 1000 architectures from the search space and evaluates each for only a small number of batches on the validation set using the optimized weights of the one-shot model corresponding to the sub-networks. Then the 5 architectures with the lowest one-shot validation error are chosen and fully evaluated on the validation set. The overall best architecture is returned.
335
+
336
+ ENAS (Pham et al., 2018) similarly to Random WS samples sub-networks of in the one-shot model, however by means of a recurrent neural network (RNN) controller rather than randomly. As the search progresses the parameters of the RNN controller are updated via REINFORCE (Williams et al., 2000) using the validation error of the sampled architectures as a reward. This way the sampling procedure is handled in a more effective way.
337
+
338
+ # C HYPERPARAMETERS
339
+
340
+ If not stated otherwise the following hyperparameters were used for all our experiments. We used a batch size of 96 throughout for DARTS, GDAS and PC-DARTS as the search spaces are small enough to allow it and as this reduces the randomness in the training, which makes the comparison between optimizers easier. Random WS was trained with a batch size of 64. All other hyperparameters were adapted from DARTS (Liu et al., 2019).
341
+
342
+ # D COMPARISON OF OPTIMIZERS OVER DIFFERENT BUDGETS
343
+
344
+ ![](images/c95165199a1cb9ec2be875a2019b76f4605846f7339da1019f62395df0686174.jpg)
345
+ Figure 7: Comparison of different One-Shot Neural Architecture optimizers on the three different search spaces defined on NAS-Bench-101 over 100 epochs.
346
+
347
+ ![](images/cdfe73f72ce5f677a5ed70ea5b68970dcb9f744a8b46d397ed44574cfdad8d1c.jpg)
348
+ Figure 8: Comparison of DARTS first and second order on the three different search spaces defined on NAS-Bench-101 for 25 epochs.
349
+
350
+ # E REGULARIZATION
351
+
352
+ # E.1 CUTOUT
353
+
354
+ Interestingly, for GDAS the validation error of the one-shot model is closer linked to the test regret on NASBench as that is the case for DARTS as shown in Figure 9. This is particularly striking in search space 2 in which the local minimum attained by the one-shot validation error is well aligned with the minimum of the test regret. It is interesting to note that GDAS very quickly overfits on this search space, since the validation error increases usually at around 50 epochs. This may be related to the linearly decreasing temperature schedule for the gumbel-softmax (Eric Jang & Poole, 2017) from 10 to 1 as proposed by Dong & Yang (2019). As the temperature decreases the operations with higher architectural weights will be sampled more often leading to overfitting on the architectural level as demonstrated by the increasing one-shot validation error. Cutout has little impact on the search phase of GDAS (Figure 9).
355
+
356
+ ![](images/54f7005facf4e0485e183119b32844dd0a0fdba949b27e8f4dc77fc6ffb31497.jpg)
357
+ Figure 9: Comparison of the effect of using Cutout during architecture search on GDAS for search space 1 and 2.
358
+
359
+ ![](images/eef30c999326d6c904c2f614651e1b70407d2fc78a255cd12103ba4d18a0cfb8.jpg)
360
+ Figure 10: Comparison of the effect of using cutout during architecture search on PC-DARTS for search space 1 and 2.
361
+
362
+ For PC-DARTS (Figure 10) cutout regularization helped find better architectures in particular in search space 3 and 1. This underlines the fact that strong regularization on the architectural level via partial channel connections can be effectively supported by cutout regularization on the training loss. Second order optimization as proposed by DARTS has no significant benefit for PC-DARTS and often decreases the performance.
363
+
364
+ # E.2 $L _ { 2 }$ REGULARIZATION
365
+
366
+ Increasing the $L _ { 2 }$ regularization has a positive effect on the found architectures for GDAS in search space 1 and 2 as shown in Figure 13. However, in search space 3 setting the weight decay to $8 1 e ^ { - 4 }$ has the effect of making the model unstable.
367
+
368
+ For PC-DARTS lowering the $L _ { 2 }$ regularization had overall a positive effect across all search spaces (Figure 14). However, this made the training also less stable as demonstrated by search space 1 (Figure 14a)
369
+
370
+ ![](images/7c648858f9cde8a1bc190c90b3249f593158fb0f823b41bf856af8e1ce4357f6.jpg)
371
+ Figure 11: Illustration of the impact that weight decay has on the test regret on NAS-Bench-101 and the validation error of the one-shot model using DARTS, GDAS and PC-DARTS on search space 3 (Best viewed in color).
372
+
373
+ ![](images/a11360e9821fd0a19a9e212b1db34d74af67dcb017d39b89dea19c2db254fd36.jpg)
374
+ Figure 12: DARTS first order w/o cutout trained with different levels of $L _ { 2 }$ regularization for search space 1 and 2.
375
+
376
+ ![](images/a615cba7fa442542623570d4841ac55ee61f9ee46f736dbf5dc8a9ebb3619d50.jpg)
377
+ Figure 13: Comparison of the effect of using different values of weight decay during architecture search on GDAS for search space 1 and 2.
378
+
379
+ ![](images/378fde47532e50d1c3a1597fc1e5811328088f6e59dc85c857ff5dc012c4b2ab.jpg)
380
+ Figure 14: Comparison of the effect of using different values of weight decay during architecture search on PC-DARTS for search space 1 and 2.
381
+
382
+ # F BOHB DETAILS
383
+
384
+ BOHB (Falkner et al., 2018) is a combination of Bayesian Optimization (BO) and Hyperband (HB) (Li et al., 2017). Hyperband uses SuccesssiveHalving (SH) (Jamieson & Talwalkar, 2016) to stop poorly performing trainings early. Success Halving starts trainings with an initial budget and advances the top fraction $( 1 / \eta )$ of them to the next stage with $\eta$ higher budget. Hyperband uses this a subroutine to evaluate many uniformly at random sampled configurations on small budgets. The budgets and scaling factors are chosen such that all SuccessiveHalving evaluations take approximately the same time. BOHB combines Hyperband with Bayesian Optimization by using a probabilistic model to guide the search towards better configurations. As a result, BOHB performs as well as Hyperband during early optimization, but samples better configurations once enough samples are available to build a model.
385
+
386
+ # F.1 SETUP
387
+
388
+ We ran BOHB for 64 iterations of SuccessiveHalving (Jamieson & Talwalkar, 2016) on 16 parallel workers, resulting in 280 full function evaluations. In our experiments we use the number of epochs that the one-shot NAS optimizers run the search as the fidelity used by BOHB and optimize the validation error after 108 epochs of training queried from NAS-Bench-101. Namely, we use min budget $= 2 5$ epochs, max budge $t = 1 0 0$ epochs and $\eta = 2$ in BOHB. Note that this is only the number of epochs used for the architecture search. Additionally, we never use the validation set split used to evaluate the individual architectures in NAS-Bench-101 during the architecture search. Therefore, each one-shot NAS optimizer will use $2 0 \mathrm { k }$ examples for training and 20k for search. The $\mathbf { X }$ -axis in Figures 15, 16, 17, 18 shows the simulated wall-clock time: $t _ { s i m } = t _ { s e a r c h } + t _ { t r a i n }$ , where $t _ { s e a r c h }$ is the time spent during search by each NAS algorithm configuration and $t _ { t r a i n }$ is the training time for 108 epochs (queried from NAS-Bench-101) of the architectures selected by the NAS optimizers.
389
+
390
+ We build 3 configuration spaces with different cardinality and which include hyperparameters affecting the architecture search process. The spaces are as follows:
391
+
392
+ 1. $C S 1 = \{ L _ { 2 }$ , CO prob}
393
+ 2. $C S 2 = \{ L _ { 2 } , C O _ { - } p r o b , l r \}$
394
+ 3. $C S 3 = \{ L _ { 2 }$ , $C O$ prob, lr, moment, CO len, batch size, grad clip, arch lr, arch L2}
395
+
396
+ # F.2 RESULTS
397
+
398
+ ![](images/fdb0bf4f2e614ade0c8bacba691331bb4d43c68275a4deaf9c75bd2cab7ff488.jpg)
399
+ Figure 15: Test regret of architectures found with DARTS (1st order) configurations sampled by BOHB on CS1. All the lines except the BOHB-DARTS one show the mean±std of the best architecture from 500 search repetitions (Best viewed in color).
400
+
401
+ Interestingly, optimizing on CS2 led to not only a more robust configuration of DARTS, but also in outperforming a state-of-the-art discrete NAS optimizer such as Regularized Evolution (RE) (Real et al., 2019). The found solutions by BOHB also outperform every other one-shot optimizer used throughout this paper with their default settings. Including the learning rate in the configuration space was crucial to achieve such a performance. Figure 16 shows the results when running BOHB with the same settings on CS1. Note that none of the sampled configurations outperforms RE. On the other hand, increasing the cardinality of the configuration space requires many more samples to build a good model. Figure 17 shows the results when optimizing with BOHB on CS3. Even though the learning rate was inside this space, again none of the sampled configurations is better than the discrete NAS optimizers.
402
+
403
+ ![](images/7fb2fc011a18adf1ef62c6025a5eb70ca0ef25003426a3ac51ee1329ec03cd4d.jpg)
404
+ Figure 16: Test regret of architectures found with DARTS, GDAS and PC-DARTS (1st order) configurations sampled by BOHB on CS2. All the lines except BOHB-DARTS, BOHB-GDAS and BOHB-PC-DARTS show the mean±std of the best architecture from 500 search repetitions (Best viewed in color).
405
+
406
+ ![](images/f987a2e0c1420f1f0d906b52a2cdec78f80804478291d2c4c50d931517887ed1.jpg)
407
+ Figure 17: Analogous to Figure 15, with the only difference being that here we optimize on CS3.
408
+
409
+ ![](images/ec48288c47e1f5ca8df1810e2b910c900eb30a5e199d9f09a193f920fe93b327.jpg)
410
+ Figure 18: Test regret of architectures found with DARTS, GDAS and PC-DARTS (2nd order) configurations sampled by BOHB on CS2.
411
+
412
+ # F.3 TRANSFERABILITY BETWEEN SPACES.
413
+
414
+ The following Table 2 shows the performance of the best found configuration on search space 3 for 50 epochs by BOHB when transferred to search spaces 1 and 2. The results show the mean and standard deviation of the architectures found by 6 independent search runs with the respective optimizers. We can see that there is no clear pattern on what is transferable where.
415
+
416
+ # G HYPERPARAMETER IMPORTANCE
417
+
418
+ To better understand the configuration space which we evaluated with BOHB we use functional analysis of variance (fANOVA) (Hutter et al., 2014). The idea is to assess the importance of individual hyperparameters by marginalizing performances over all possible values other hyperparameters could have taken. The marginalization estimates are determined by a random forest model which was trained on all configurations belonging to specific budgets during the BOHB optimization procedure.
419
+
420
+ Table 2: Results of architectures found on search space 1 and 2 with the best found configuration for 50 epochs by BOHB on search space 3.
421
+
422
+ <table><tr><td rowspan="2">Optimizer</td><td colspan="2">Test regret</td></tr><tr><td>Search space 1</td><td>Search Space 2</td></tr><tr><td rowspan="2">DARTS</td><td>Default config.</td><td>1.252e-2 ± 0.0 0.864e-2 ± 0.023e-2</td></tr><tr><td>Transferred config. 1.045e-2 ± 0.171e-2</td><td>0.992e-2 ± 0.211e-2</td></tr><tr><td rowspan="2">GDAS</td><td>Default config.</td><td>1.252e-2 ± 0.0 0.871e-2 ± 0.0</td></tr><tr><td>Transferred config. 3.093e-2 ± 3.975e-2</td><td>0.831e-2 ± 0.045e-2</td></tr><tr><td rowspan="2">PC-DARTS</td><td>Default config.</td><td>1.104e-2 ± 0.088e-2 1.133e-2 ± 0.404e-2</td></tr><tr><td>Transferred config. 5.843e-2 ± 4.118e-2</td><td>0.992e-2 ± 0.087e-2</td></tr></table>
423
+
424
+ Figure 19 shows the interaction between the Cutout (CO) and $L _ { 2 }$ factor when optimizing on CS2, DARTS 1st order, for search space 1, 2 and 3. It should be noted that the best found configuration involves at least one relatively high value of one of the regularizers in CS2.
425
+
426
+ ![](images/0fa3c20d8d35b26e8f9dddb8adea3e24e09fcef0af9ac544ad16f7d02ec7a7c7.jpg)
427
+ Figure 19: Parameter importance for two hyperparameters, Cutout (CO) and $L _ { 2 }$ regularization (CS2) across different training epochs and search spaces (SS).
428
+
429
+ # H CORRELATION BETWEEN THE ARCHITECTURE SEARCH MODEL AND THE ARCHITECTURE EVALUATION MODEL
430
+
431
+ As a further experiment we wanted to test how strongly the validation error of the models used in architectures search and architecture evaluation are correlated. For this we sampled 150 architectures from search space 3 and trained this architecture in the proxy model. During training we compute the Spearman rank correlation between the validation error of the proxy model and the full architecture evaluation as queried from NAS-Bench-101. The results are shown in Figure 20. Note that 9 cells in the proxy was used for all of our previous experiments as it is also used by the NAS-Bench-101 models.
432
+
433
+ For 9 cells (Figure 20c) in the proxy model, we find that increasing the total number of channels leads to stronger correlation between the proxy model and the full architecture. However, increasing it beyond 16 channels leads to a decrease in correlation. For 3 cells (Figure 20a) the strongest anytime correlation was interestingly found using only 2 initial channels, with more channels leading to worse performance at the beginning and no better final performance. The results suggest that there exists a set of good combinations between the number of cells and the initial number of channels to get the maximum correlation between the search and evaluation model. As a future work we plan to investigate this relationship, which could eventually lead to a more effective bandit-based NAS method.
434
+
435
+ ![](images/9eeb51d8a400b4c88d9e404eccca67fd3f7bd8a3ca37da9e0c5b70cd829ea444.jpg)
436
+ Figure 20: In this experiment we varied the total number of cells within [3, 6, 9] and the number of initial channels of the proxy model within [2, 4, 8, 16, 36].
md/train/SJxbu6VKDr/SJxbu6VKDr.md ADDED
@@ -0,0 +1,280 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # GATED CHANNEL TRANSFORMATION FOR VISUAL RECOGNITION
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ In this work, we propose a generally applicable transformation unit for visual recognition with deep convolutional neural networks. This transformation explicitly models channel relationships with explainable control variables. These variables determine the neuron behaviors of competition or cooperation, and they are jointly optimized with convolutional weights towards more accurate recognition. In Squeeze-and-Excitation (SE) Networks, the channel relationships are implicitly learned by fully connected layers, and the SE block is integrated at the block-level. We instead introduce a channel normalization layer to reduce the number of parameters and computational complexity. This lightweight layer incorporates a simple $l _ { 2 }$ normalization, enabling our transformation unit applicable to operator-level without much increase of additional parameters. Extensive experiments demonstrate the effectiveness of our unit with clear margins on many vision tasks, i.e., image classification on ImageNet, object detection and instance segmentation on COCO, video classification on Kinetics.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Convolutional Neural Networks (CNNs) have proven to be critical and robust in visual recognition tasks, such as image classification (Huang et al., 2018), detection (Singh et al., 2018), and segmentation (Singh et al., 2018). Notably, a single convolutional layer operates only on a neighboring local context of each spatial position of a feature map, which could possibly lead to local ambiguities (Torralba, 2003). To relief this problem, VGGNets (Simonyan & Zisserman, 2015) were proposed to construct deep CNNs, using a series of convolutional layers with non-linear activation functions and downsampling operators to cover a large extent of context. Moreover, He et al. (2016a) introduced a residual connection to help CNNs benefit from deeper architectures further.
12
+
13
+ Apart from improving the depth of CNNs, another branch of methods focuses on augmenting convolutional layer with modules that directly operate on context across large neighborhoods. Squeezeand-Excitation Networks (SE-Nets) (Hu et al., 2018b) leveraged globally embedding information to model channel relationship and modulate feature maps on the channel-wise level. Moreover, its following method, GE-Nets (Hu et al., 2018a), used largely neighboring embedding instead. These modules can be conveniently assembled into modern networks, such as ResNets (He et al., 2016a) and Inception (Szegedy et al., 2015) networks, to improve the representational ability of networks.
14
+
15
+ However, the SE module uses two fully connected $( F C )$ layers to process channel-wise embeddings, which leads to two problems. First, the number of SE modules to be applied in CNNs is limited. In Hu et al. (2018b), SE module was applied at the block-level, i.e., a single SE module is utilized per Res-block (He et al., 2016a) or Inception-block (Szegedy et al., 2016). The dimension of the $F C$ layer is decreased to save the computational cost further. However, the designed $F C$ layers still hinder the wide deployment of SE modules across all layers. Second, due to the complexity of the parameters in $F C$ (or convolutional layer in GE), it is difficult to analyze the interactions among the channels at different layers. The channel relationships learned by convolution and FC operations are inherently implicit (Hu et al., 2018b), resulting in agnostic behaviors of the neuron outputs.
16
+
17
+ In this paper, we propose a Gated Channel Transformation (GCT) for efficient and accurate contextual information modeling. First, we use a normalization component to replace the $F C$ layers. Normalization methods, e.g., Local Response Normalization (LRN) (Krizhevsky et al., 2012), create competitions among different neurons in neural networks. Batch normalization (Ioffe & Szegedy,
18
+
19
+ 2015) and its variants can smooth gradient and have been widely used in accelerating CNNs training process. We leverage a simple $l _ { 2 }$ normalization for modeling channel relationship, which is more stable and computationally efficient comparing to FC layers. Second, we introduce a few channelwise parameters to control the behavior of the gated adaptation of feature channels. Compared to the large number of parameters in $F C$ , our designed parameters are much more lightweight. Besides, the gating weight parameter is convenient for channel relationship analysis and is helpful to understand the effect of GCT modules across different layers. According to our visualization analysis, GCT prefers to encourage cooperation in shallower layers, but competition is enhanced in deeper layers.
20
+
21
+ Our experiments show that GCT is a simple and effective architecture for modeling relationship among channels. It significantly improves the generalization capability of deep convolutional networks across visual recognition tasks and datasets.
22
+
23
+ # 2 RELATED WORK
24
+
25
+ Gating and attention mechanisms. Gating mechanisms have been successfully deployed in some recurrent neural network architectures. Long Short-Term Memory (LSTM) (Hochreiter & Schmidhuber, 1997) introduced an input gate, output gate and forget gate, which are used to regulate the flow of information into and out of the module. Based on gating mechanisms, some attention methods focus on forcing computational resources towards the most informative components of features (Larochelle & Hinton, 2010; Mnih et al., 2014; Vaswani et al., 2017). Recent works introduce the attention mechanism into convolutional networks (e.g., (Gehring et al., 2017; Dauphin et al., 2017)). Following these studies, SE-Nets (Hu et al., 2018b) and its following work GE-Nets (Hu et al., 2018a) introduced a lightweight gating mechanism which focuses on enhancing the representational power of the convolutional network by modeling channel-wise relationship. Compared to the SE module, our GCT also pays attention to the cross-channel relationship but can achieve better performance gains with less computation and parameters.
26
+
27
+ Normalization layers. In recent years, normalization layers have been widely used in deep networks to create competition between neurons (Krizhevsky et al., 2012) and produce smoother optimization surfaces (Ioffe & Szegedy, 2015). Local Response Normalization (LRN) (Krizhevsky et al., 2012) computes the statistics in a small neighborhood among channels for each pixel. Batch Normalization (BN) (Ioffe & Szegedy, 2015) utilizes global spatial information along the batch dimension and suggests to be deployed for all layers. Layer Normalization (LN) (Ba et al., 2016) computes along the channel dimension instead of the batch dimension. Group Normalization (GN) (Wu & He, 2018) differently divides the channels into groups and computes within each group the mean and variance for normalization. Similar to LRN, GN and LN, our GCT also utilizes channel-related information with normalization structure.
28
+
29
+ Deep architectures. VGGNets (Simonyan & Zisserman, 2015) and Inception networks (Szegedy et al., 2015) demonstrated that it was significant to improve the quality of representation by increasing the depth of a network. ResNets (He et al., 2016a) utilized shortcut connections to identity-based skip connections, and proved that it was highly effective to build considerably deeper and stronger networks with them. Some other researchers focused on improving the representation ability of the computational elements contained within a network (Szegedy et al., 2016). The more diverse composition of operators within a computational element can be constructed with multi-branch convolutions or pooling layers. Other than this, grouped convolutions have proven to be a practical method to increase the cardinality of learned transformations (Xie et al., 2017). We build our GCT on these deep architectures. All these networks with GCT achieve promising performance improvements, but the growth of computational complexity is negligible.
30
+
31
+ # 3 GATED CHANNEL TRANSFORMATION
32
+
33
+ SE-Nets proposed a lightweight SE module to augment convolutional networks by operating on a global context. The SE module contains two operators, i.e., a “squeeze” operator to embed channel context and an “excitation” operator to modulate the feature maps. The architecture of our Gated Channel Transformation benefits from this framework. Differently, GCT leverages a normalization operator instead of the $F C$ layers in the SE module for channel relationship modeling. Notably, the normalization operator is parameter-free. To make GCT learnable, we redesign the structure of the “squeeze” and “excitation” operators. Our new operators contain three sets of channel-wise trainable parameters. Thus, GCT is more convenient to be deployed occupying a small number of parameters. The gating parameters can be visualized for easier analysis of GCT’s behavior, while the discriminative ability is maintained.
34
+
35
+ ![](images/35db85c1efdd0ee01b8a5c414d84000799edc706d13baf04e0ab8d2a4f6120c9.jpg)
36
+ Figure 1: An overview of the structure of Gated Channel Transformation (GCT).
37
+
38
+ Let $\mathbf { x } \in \mathbb { R } ^ { C \times H \times W }$ be an activation feature in a convolutional network, where $H$ and $W$ are the spatial height and width, and $C$ is the number of channels. In general, GCT performs the following transformation:
39
+
40
+ $$
41
+ \begin{array} { r } { \hat { \mathbf { x } } = F ( \mathbf { x } | \alpha , \gamma , \beta ) , \alpha , \gamma , \beta \in \mathbb { R } ^ { C } . } \end{array}
42
+ $$
43
+
44
+ Here $\alpha , \gamma$ and $\beta$ are trainable parameters. Embedding weights $_ { \pmb { \alpha } }$ are responsible for adapting the embedding outputs. The gating weights $\gamma$ and biases $\beta$ control the activation of the gate. They determine the behavior of GCT in each channel. The parameter complexity of GCT is $\bar { O ( C ) }$ , which is smaller than the SE module $( O ( C ^ { 2 } ) )$ ( $\mathrm { H u }$ et al., 2018b). In SE-Net, two $F C$ layers are leveraged, which have the parameter complexity of $O ( C ^ { 2 } )$ .
45
+
46
+ An illustration of the structure of GCT is shown in Fig. 1. Let $\textbf { x } = ~ [ x _ { 1 } , x _ { 2 } , . . . , x _ { C } ] , x _ { c } ~ =$ $[ x _ { c } ^ { i , j } ] _ { H \times W } ~ \in ~ \mathbb { R } ^ { H \times W } , c ~ \in ~ \{ 1 , 2 , . . . , C \}$ , where $x _ { c }$ is corresponding to each channel of $\mathbf { x }$ . The detailed transformation consists of following parts.
47
+
48
+ Global Context Embedding. Global context embedding (GCE) aggregates global context in each channel. GCE can exploit global contextual information outside the small receptive fields of convolutional layers. Given the embedding weights ${ \pmb { \alpha } } = [ \alpha _ { 1 } , . . . , \alpha _ { C } ]$ , GCE is defined as:
49
+
50
+ $$
51
+ s _ { c } = \alpha _ { c } | | x _ { c } | | _ { 2 } = \alpha _ { c } \{ [ \sum _ { i = 1 } ^ { H } \sum _ { j = 1 } ^ { W } ( x _ { c } ^ { i , j } ) ^ { 2 } ] + \epsilon \} ^ { \frac { 1 } { 2 } } ,
52
+ $$
53
+
54
+ where $\epsilon$ is a small constant to avoid the problem of derivation at the zero point. Different from SE, GCT does not use global average pooling (GAP) to aggregate channel context. GAP might fail in some extreme cases. For example, if SE is deployed after the Instance Normalization (Ulyanov et al., 2016) layer that is popular in style transfer task, the output of GAP will be constant for any inputs since IN fixes the mean of each channel of features. To avoid this problem, we choose $\ell _ { p }$ -norm instead. It is worth noting that GCT is robust with different $\ell _ { p }$ -norms. In Sec. 4.5, we compare the performance of some popular $\ell _ { p }$ -norms and choose the best one, $\ell _ { 2 }$ -norm, to be our default setting. Notably, the performance of $\ell _ { 1 }$ -norm is very close to $\ell _ { 2 }$ -norm and $\ell _ { 1 }$ -norm can be equivalently replaced by GAP when the input of GCT is always non-negative (for example, after ReLU activation). In this case, $\ell _ { 1 }$ -norm is more computationally efficient.
55
+
56
+ Besides, we use trainable parameters $\alpha _ { c }$ to adjust each channel because different channels should have different significance.
57
+
58
+ Channel Normalization. Normalization methods can model relationship in visual or photographic features (Lyu & Simoncelli, 2008) with lightweight computing resource (e.g., Ioffe & Szegedy (2015)). Similar to LRN, we use a $\ell _ { 2 }$ normalization to operate across channels, namely channel normalization (CN). Let $\mathbf { s } = [ s _ { 1 } , . . . , s _ { C } ]$ , the formula of CN is:
59
+
60
+ ![](images/d6365d27fdc7c5de3b2e985053b879fc13c21f86cccfb69f27cebcf4ba7ab755.jpg)
61
+ Figure 2: Training curve comparisons for ResNets with different depth on ImageNet.
62
+
63
+ $$
64
+ \hat { s } _ { c } = \frac { \sqrt { C } s _ { c } } { | | \mathbf { s } | | _ { 2 } } = \frac { \sqrt { C } s _ { c } } { [ ( \displaystyle \sum _ { c = 1 } ^ { C } s _ { c } ^ { 2 } ) + \epsilon ] ^ { \frac { 1 } { 2 } } } ,
65
+ $$
66
+
67
+ where $\epsilon$ is a small constant. The scalar $\sqrt { C }$ is used to normalize the scale of $\hat { s } _ { c }$ , avoiding a too small scale of $\hat { s } _ { c }$ when $C$ is large. Compared to the $F C$ layers used by SE, our CN operator has less computational complexity $( O ( C ) )$ compared to the $F C$ layers $( O ( C ^ { 2 } ) )$ .
68
+
69
+ Gating Adaptation. We employ a gating mechanism, namely gating adaptation, to adapt the original feature. By introducing the gating mechanism, our GCT can facilitate both competition and cooperation during the training process. Let the gating weights $\gamma = [ \gamma _ { 1 } , . . . , \gamma _ { C } ]$ and the gating biases $\beta = [ \beta _ { 1 } , . . . , \beta _ { C } ]$ , we design the following gating function:
70
+
71
+ $$
72
+ \hat { x } _ { c } = x _ { c } [ 1 + \operatorname { t a n h } ( \gamma _ { c } \hat { s } _ { c } + \beta _ { c } ) ] .
73
+ $$
74
+
75
+ The scale of each original channel $x _ { c }$ will be adapted by its corresponding gate, i.e., $1 + \operatorname { t a n h } ( \gamma _ { c } \hat { s } _ { c } +$ $\beta _ { c , \ - }$ ). The trainable $\gamma _ { c }$ and $\beta _ { c }$ are employed to control the activation of gate. LRN benefits from only the competitions among the neurons (Krizhevsky et al., 2012). However, the gating mechanism in GCT is able to create both competition and cooperation among different channels. This capability is more consistent with the training process in biological neural networks (Demin & Nekhaev, 2018). When the gating weight of one channel $( \gamma _ { c } )$ is activated positively, GCT promotes this channel to compete with the others as in LRN. When the gating weight is activated negatively, GCT encourages this channel to cooperate with the others. We analyze these adaptive channel relationships in Sec.4.4.
76
+
77
+ Besides, this gate function allows original features to pass to the next layer when the gating weights and biases are zeros, which is
78
+
79
+ $$
80
+ \hat { \mathbf { x } } = F ( \mathbf { x } | \alpha , \mathbf { 0 } , \mathbf { 0 } ) = \mathbf { 1 } \mathbf { x } = \mathbf { x } .
81
+ $$
82
+
83
+ The ability of modeling identity mapping can effectively improve the robustness to the degradation problem in deep networks. ResNets also benefits from this idea. Therefore, we propose to initialize $\gamma$ and $\beta$ to 0 in the initialization of GCT layers. By doing this, the initial steps of the training process will be more stable, and the final performance of GCT will be better.
84
+
85
+ # 4 EXPERIMENTS
86
+
87
+ We apply GCT for all the convolutional layers in deep networks rather than block-level deployment in SE-Net. In all GCT counterparts, we employ one GCT layer before each convolutional layer. In the Kinetics experiments, we apply GCT at the last two convolutional layers in each Res-Block. More training details are shown in Appendix A.
88
+
89
+ # 4.1 EXPERIMENTS ON IMAGENET
90
+
91
+ We experiment on the ImageNet 2012 dataset (Russakovsky et al., 2015) with $1 , 0 0 0$ classes. We train all the models on the 1.28M training images and evaluate on the $5 0 , 0 0 0$ validation images. We also conduct classification experiments on CIFAR (Krizhevsky & Hinton, 2009) in Appendix B.
92
+
93
+ Implementation details. In the training process of all the models, the input image is $2 2 4 \times 2 2 4$ randomly cropped from a resized image using the same augmentation in Szegedy et al. (2015). We use SGD with a mini-batch size of 256. For ResNet-152 and ResNeXt-50, we use half mini-batch size and double the training steps). The weight decay is 0.0001, and the momentum is 0.9. The base learning rate is 0.1, and we divide it by 10 every 30 epochs. All models are trained for 100 epochs from scratch, using the weight initialization strategy described in He et al. (2015). Besides, we start the training process with a learning rate of 0.01 for 1 epoch. After the warmup, we go back to the original learning rate schedule. In all comparisons, we evaluate the error on the single $2 2 4 \times 2 2 4$ center crop from an image whose shorter side is 256. For ResNet-200 (He et al., 2016b), we evaluate on $3 2 0 \times 3 2 0$ following He et al. (2016b).
94
+
95
+ Table 1: Improvement in error performance $( \% )$ on ImageNet. The numbers in brackets denote the improvement in performance over the baselines. ResNet- ${ } ^ { 2 0 0 ^ { * } }$ means we follow the strategy in (He et al., 2016b) to train this model on $2 2 4 \times 2 2 4$ but evaluate on $3 2 0 \times 3 2 0$ .
96
+
97
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2>original</td><td rowspan=1 colspan=2>GCT</td></tr><tr><td rowspan=1 colspan=1>Network</td><td rowspan=1 colspan=1>top-1</td><td rowspan=1 colspan=1>top-5</td><td rowspan=1 colspan=1>top-1</td><td rowspan=1 colspan=1>top-5</td></tr><tr><td rowspan=1 colspan=1>VGG-16 (Simonyan &amp; Zisserman,2015)</td><td rowspan=1 colspan=1>26.2</td><td rowspan=1 colspan=1>8.3</td><td rowspan=1 colspan=1>25.1(1.1)</td><td rowspan=1 colspan=1>7.5(0.8)</td></tr><tr><td rowspan=1 colspan=1>Inception-v3 (Szegedy et al., 2016)</td><td rowspan=1 colspan=1>24.3</td><td rowspan=1 colspan=1>7.3</td><td rowspan=1 colspan=1>23.7(0.6)</td><td rowspan=1 colspan=1>7.1(0.2)</td></tr><tr><td rowspan=1 colspan=1>ResNeXt-50 (Xie et al., 2017)</td><td rowspan=1 colspan=1>22.4</td><td rowspan=1 colspan=1>6.3</td><td rowspan=1 colspan=1>21.7(0.7)</td><td rowspan=1 colspan=1>6.0(0.3)</td></tr><tr><td rowspan=1 colspan=1>ResNet-50 (He et al., 2016a)</td><td rowspan=1 colspan=1>23.8</td><td rowspan=1 colspan=1>7.0</td><td rowspan=1 colspan=1>22.7(1.1)</td><td rowspan=1 colspan=1>6.3(0.7)</td></tr><tr><td rowspan=1 colspan=1>ResNet-101 (He et al.,2016a)</td><td rowspan=1 colspan=1>22.2</td><td rowspan=1 colspan=1>6.2</td><td rowspan=1 colspan=1>21.4(0.8)</td><td rowspan=1 colspan=1>5.9(0.3)</td></tr><tr><td rowspan=1 colspan=1>ResNet-152 (He et al.,2016a)</td><td rowspan=1 colspan=1>21.6</td><td rowspan=1 colspan=1>5.9</td><td rowspan=1 colspan=1>20.8(0.8)</td><td rowspan=1 colspan=1>5.5(0.4)</td></tr><tr><td rowspan=1 colspan=1>ResNet-200*(He et al.,2016b)</td><td rowspan=1 colspan=1>20.7</td><td rowspan=1 colspan=1>5.2</td><td rowspan=1 colspan=1>19.7(1.0)</td><td rowspan=1 colspan=1>4.8(0.4)</td></tr></table>
98
+
99
+ Table 2: Compared to SE in different networks on ImageNet. We evaluate the models of error performance $( \% )$ , GFLOPs (G) and parameters (M). G/P means GFLOPs/parameters. In VGG-16 experiments, SE is employed for all the convolutional layers, which is the same as GCT. In other experiments, SE is only employed in block level (Res-Block or Inception-Block) as proposed (Hu et al., 2018b). This difference makes that SE uses comparable GFLOPs with GCT.
100
+
101
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2>original</td><td rowspan=1 colspan=2>SE</td><td rowspan=1 colspan=2>GCT (ours)</td></tr><tr><td rowspan=1 colspan=1>Network</td><td rowspan=1 colspan=1>top-1/5</td><td rowspan=1 colspan=1>G/P</td><td rowspan=1 colspan=1>top-1/5</td><td rowspan=1 colspan=1>G/P</td><td rowspan=1 colspan=1>top-1/5</td><td rowspan=1 colspan=1>G/P</td></tr><tr><td rowspan=1 colspan=1>ResNet-50</td><td rowspan=1 colspan=1>23.8/7.0</td><td rowspan=1 colspan=1>3.879/25.61</td><td rowspan=1 colspan=1>22.9/6.6</td><td rowspan=1 colspan=1>3.893/28.14</td><td rowspan=1 colspan=1>22.7/6.3</td><td rowspan=1 colspan=1>3.900/25.68</td></tr><tr><td rowspan=1 colspan=1>ResNeXt-50</td><td rowspan=1 colspan=1>22.4/6.3</td><td rowspan=1 colspan=1>3.795/25.10</td><td rowspan=1 colspan=1>22.0/6.1</td><td rowspan=1 colspan=1>3.809/27.63</td><td rowspan=1 colspan=1>21.7/6.0</td><td rowspan=1 colspan=1>3.821/25.19</td></tr><tr><td rowspan=1 colspan=1>VGG-16</td><td rowspan=1 colspan=1>26.2/8.3</td><td rowspan=1 colspan=1>15.497/138.37</td><td rowspan=1 colspan=1>25.2/7.7</td><td rowspan=1 colspan=1>15.525/138.60</td><td rowspan=1 colspan=1>25.1/7.5</td><td rowspan=1 colspan=1>15.516/138.38</td></tr><tr><td rowspan=1 colspan=1>Inception-v3</td><td rowspan=1 colspan=1>24.3/7.3</td><td rowspan=1 colspan=1>2.847/23.87</td><td rowspan=1 colspan=1>24.0/7.2</td><td rowspan=1 colspan=1>2.851/25.53</td><td rowspan=1 colspan=1>23.7/7.1</td><td rowspan=1 colspan=1>2.862/23.99</td></tr></table>
102
+
103
+ Integration with deep modern architectures. We study the effects of integrating GCT layers with some state-of-the-art backbone architectures, e.g., ResNets and ResNeXts (Xie et al., 2017), in which we apply GCT before all the convolutional layers. We report all these results in Table 1. Compared to original architectures, we observe significant performance improvements by introducing GCT into networks. Particularly, the top-1 error of GCT-ResNet-101 is ${ \bf 2 1 . 4 \% }$ , which is even better than the ResNet-152 baseline $( 2 1 . 6 \% )$ with a deeper network and much more parameters. In addition, GCT is able to bring stable improvement in ResNets with different depth ( ${ \bf \cdot 1 . 1 \% }$ top-1 improvement in ResNet-50, $\mathbf { 0 . 8 \bar { \% } }$ in ResNet-152 and $\mathbf { 1 . 0 \% }$ in ResNet-200). Besides, we observe a smooth improvement throughout the training schedule, which is shown in Fig.2.
104
+
105
+ We also explore the improvement with GCT in non-residual networks (e.g., VGG-16 (Simonyan & Zisserman, 2015) and Inception-v3 (Szegedy et al., 2016)). To stabilize the training process, we employ BN (Ioffe & Szegedy, 2015) layers after every convolutional layer. Similar to the effectiveness in residual architectures, GCT layers bring promising improvements in non-residual structures.
106
+
107
+ Compared to SE. We conduct experiments on ImageNet to compare SE with GCT in both residual and non-residual networks and the results are reported in Table 2. We follow the methods in (Hu et al., 2018b) to integrate SE into VGG-16 (Simonyan & Zisserman, 2015), Inception (Szegedy et al., 2016), ResNet-50 (He et al., 2016a) and ResNeXt-50 (Xie et al., 2017) and train these models in same training schedule. Compared to SE, GCT always achieves better improvement.
108
+
109
+ In order to compare computational complexity, we calculate the GFLOPs and the number of parameters. In VGG-16 experiments, SE is employed for all the convolutional layers, which is the same as GCT. Under this fair condition, GCT achieves better performance with less increase in both GFLOPs (0.019G vs.0.028G) and parameters (0.01M vs.0.23M). In other experiments, SE is only employed in block-level (Res-Block or Inception-Block) as proposed (Hu et al., 2018b), which means the number of SE is smaller than GCT. However, the increase in parameters of GCT is still much less than SE, and the value of GFLOPs is comparable. Compared to SE, the increase in parameters of GCT is negligible, but the performance is better.
110
+
111
+ Table 3: Improvement on COCO with Mask R-CNN framework. $\mathbf { B N } ^ { * }$ means BN is frozen. $^ +$ means increasing the training iterations from 90K to 270K. When using GN, we follow the strategy in the original paper (Wu & He, 2018).
112
+
113
+ <table><tr><td rowspan=1 colspan=1>Backbone</td><td rowspan=1 colspan=1>box head</td><td rowspan=1 colspan=1>box AP</td><td rowspan=1 colspan=1>mask AP</td></tr><tr><td rowspan=1 colspan=1>ResNet-50BN*</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>37.8</td><td rowspan=1 colspan=1>34.2</td></tr><tr><td rowspan=1 colspan=1>ResNet-50BN*+GCT</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>39.8(2.0)</td><td rowspan=1 colspan=1>36.0(1.8)</td></tr><tr><td rowspan=1 colspan=1>ResNet-101BN*</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>40.1</td><td rowspan=1 colspan=1>36.1</td></tr><tr><td rowspan=2 colspan=1>ResNet-101BN*+GCT+ResNet-50 BN*</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>42.0(1.9)</td><td rowspan=1 colspan=1>37.7(1.6)</td></tr><tr><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>38.6</td><td rowspan=1 colspan=1>34.5</td></tr><tr><td rowspan=1 colspan=1>+ResNet-50 GN</td><td rowspan=1 colspan=1>GN</td><td rowspan=1 colspan=1>40.8(2.2)</td><td rowspan=1 colspan=1>36.1(1.6)</td></tr><tr><td rowspan=1 colspan=1>+ResNet-50 BN*+GCT</td><td rowspan=1 colspan=1>GN</td><td rowspan=1 colspan=1>41.6(3.0)</td><td rowspan=1 colspan=1>37.1(2.6)</td></tr><tr><td rowspan=1 colspan=1>+ResNet-50BN*+GCT</td><td rowspan=1 colspan=1>GN+GCT</td><td rowspan=1 colspan=1>41.8(3.2)</td><td rowspan=1 colspan=1>37.3(2.8)</td></tr><tr><td rowspan=1 colspan=1>+ResNet-101 BN*</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>40.9</td><td rowspan=1 colspan=1>36.4</td></tr><tr><td rowspan=1 colspan=1>+ResNet-101 GN</td><td rowspan=1 colspan=1>GN</td><td rowspan=1 colspan=1>42.3(1.4)</td><td rowspan=1 colspan=1>37.2(0.8)</td></tr><tr><td rowspan=1 colspan=1>ResNet-101BN*+GCT</td><td rowspan=1 colspan=1>GN</td><td rowspan=1 colspan=1>43.1(2.2)</td><td rowspan=1 colspan=1>38.3(1.9)</td></tr></table>
114
+
115
+ # 4.2 EXPERIMENTS ON COCO
116
+
117
+ Next we evaluate the generalizability on the COCO dataset (Lin et al., 2014). We train the models on the COCO train2017 set and evaluate on the COCO eval2017 set (a.k.a minival).
118
+
119
+ Implementation details. We experiment on the Mask R-CNN baselines (He et al., 2017) and its GN counterparts (Wu & He, 2018). All the backbone models are pre-trained on ImageNet using the scale and aspect ratio augmentation in Szegedy et al. (2015) and fine-tune on COCO with a batch size of 16 (2 images/GPU). Besides, all these experiments use the Feature Pyramid Network (FPN) Lin et al. (2017). We also use the same hyperparameters and two training schedules used in (Wu & He, 2018). The short schedule includes 90K iterations, in which the learning rate is divided by 10 at 60K and 80K iterations. The long schedule increases the iterations to 270K, in which the learning rate is divided by 10 at 210K and 250K. The base learning rate is 0.02 in both schedules.
120
+
121
+ Improvements on Mask R-CNN. Table 3 shows the comparison of $\mathbf { B N } ^ { * }$ (frozen BN), GN and $\mathbf { B } \mathbf { N } ^ { * } { + } \mathbf { G } \mathbf { C } \mathbf { T }$ (using GCT before all the convolutional layers of the backbones). First, we use a short training schedule to compare baselines and GCT counterparts. GCT shows stable and significant improvement in both ResNet-50 and ResNet-101. In ResNet-50, GCT improves detection AP by 2.0 and segmentation AP by 1.8. Moreover, in ResNet-101, GCT also improves detection AP by 1.9 and segmentation AP by 1.6. Then, we use the long schedule to compare GN and $\mathbf { B N ^ { * } { + } G C T }$ . GN is more effective than BN when batch size is small as in this case of detection and segmentation using Mask R-CNN. However, we deploy GCT together with BN into the backbone, and these $\mathbf { B } \mathbf { N } ^ { * } { + } \mathbf { G } \mathbf { C } \mathbf { T }$ counterparts achieve much better performance than GN backbones. Compared to GN in ResNet-101, $\mathrm { \mathbf { B } N ^ { * } { + } G C T }$ improves detection AP by 0.8 and segmentation AP by 1.1. In particular, ResNet-101 with $\mathrm { \mathbf { B } N ^ { * } { + } G C T }$ trained in the short schedule achieves better segmentation AP (37.7) than the GN counterpart (37.2) trained with the long schedule. This GN counterpart also uses GN in the backbone, the box heads, and the FPN. We also explore to combine GCT with GN by introducing GCT into GN box head. The results show $\mathrm { \bf G N { + } } \mathrm { \bf G C T }$ achieves a better performance. It demonstrates the benefits of integrating GCT with GN. We now have shown the effectiveness of GCT in working with both BN and GN.
122
+
123
+ # 4.3 EXPERIMENTS ON KINETICS
124
+
125
+ Our previous experiments demonstrate the effectiveness of GCT on image-related tasks. We now evaluate the generalizability in video understanding task of action recognition on the large scale Kinetics-400 (Kay et al., 2017) dataset. We employ the ResNet-50 (3D) and ResNet-101 (3D) as the backbone and apply GCT in the last two convolutional layers in each Res-Block. The backbone networks are pre-trained on ImageNet (Russakovsky et al., 2015).
126
+
127
+ ![](images/4f3eed4af43b00704fbd313bc531759518072555c6f428f60926c05148a110c1.jpg)
128
+ Figure 3: Analysis. The visulization of parameters of $\gamma$ (Fig.(a), (b)), and the ratio of variance of GCT output and input feature (Fig.(c)) in all the GCT layers in ResNet-50 on ImageNet.
129
+
130
+ We compare with the state-of-the-art Non-Local Networks (NL-Net) (Wang et al., 2018). The results show that GCT counterparts consistently improves the recognition accuracy over both the ResNet50 and ResNet-101 baselines, as shown in Table 4. Because of our limited memory resource, we can NOT apply GCT in all the convolutional layers, which we believe can further improve the performance.
131
+
132
+ In summary, extensive experiments demonstrate that GCT is effective across a wide range of architectures, tasks, and datasets.
133
+
134
+ # 4.4 ANALYSIS
135
+
136
+ To analyze the behavior of GCT in different layers, we visualize the distribution of the gating weights $( \gamma )$ of each GCT layer in ResNet-50 on ImageNet. Further, we sort these distributions according to their layer index in 3D space (Fig. 3a). The bigger layer index means it is closer to the network output. To make the visualization clearer, we re-scale the vertical $z$ axis with $\boldsymbol { l o g ( 1 + z ) }$ , which corresponds to the percentage density of $\gamma$ . We also calculate the mean and standard deviation (std) of $\gamma$ in each layer and show them in a bar chart (Fig. 3b). As shown in Fig. 3a and 3b, the mean of $\gamma$ tends to be less than 0 in the GCT layers far from the network output. Oppositely, in the layers close to the output, the mean tends to be greater than 0.
137
+
138
+ According to Eq. 3 & 4, the adaptation of channel $x _ { c }$ is related to $\hat { s } _ { c }$ , which corresponds to the ratio of the weighted $\ell _ { 2 }$ -norm of $x _ { c }$ (i.e., $s _ { c . }$ ) and the average of all the $s _ { c }$ . When the gating weight $\gamma _ { c }$ is greater than 0, the adaptation is positively correlated to $\hat { s } _ { c }$ and increases the variance between $x _ { c }$ and others; When $\gamma _ { c }$ is lower than 0, the adaptation is negatively correlated and reduces the variance.
139
+
140
+ Based on the analysis and the results we observe, we suppose that GCT tends to reduce the difference among channels in layers far away from the output. This behavior is helpful to encourage cooperation among channels and relieve overfitting. Apart from this, GCT tends to increase the difference among channels when close to the output. Here, GCT acts like the attention mechanism that is useful for creating competition.
141
+
142
+ To further validate our hypothesis, we calculate the ratio of the variance of output and input feature of each GCT layer, which we show in Fig. 3c. More visualizations are shown in Appendix C. Generally, the shallow layers learn low-level features to capture general characteristics like textures, edges, and corners. The feature variances become larger in deeper layers, where the high-level features are more discriminative and task-related. As expected, in the layers close to network output, GCT tends to magnify the variance of input feature (the ratio is always greater than 1), but in the layers far away from the output, GCT tends to reduce the variance (the ratio is always less than 1). This phenomenon is consistent with our previous hypothesis and shows that GCT is effective in creating both competition and cooperation among channels. Our observation validates that GCT can adaptively learn the channel relationships at different layers.
143
+
144
+ # 4.5 ABLATION STUDIES.
145
+
146
+ In this section, we conduct a serial of ablation experiments to explain the relative importance of each operator in the GCT. At last, we show how the performance changes with regards to the GCT position in a network.
147
+
148
+ Table 4: Improvement in top-1 accuracy $( \% )$ over the state-ofthe-art method on Kinetics.
149
+
150
+ <table><tr><td rowspan=1 colspan=1>Backbone</td><td rowspan=1 colspan=1>NL-Net</td><td rowspan=1 colspan=1>GCT</td></tr><tr><td rowspan=1 colspan=1>ResNet-50</td><td rowspan=1 colspan=1>74.6</td><td rowspan=1 colspan=1>75.1(0.5)</td></tr><tr><td rowspan=1 colspan=1>ResNet-101</td><td rowspan=1 colspan=1>75.7</td><td rowspan=1 colspan=1>76.2(0.5)</td></tr></table>
151
+
152
+ Table 5: Ablation experiments. We evaluate error performance in GCT-ResNet-50 on ImageNet $( \% )$ . The ResNet-50 baseline achieves a top-1 of 23.8 and a top-5 of 7.0.
153
+
154
+ (a) Embedding operator.
155
+
156
+ (b) Normalization operator.
157
+
158
+ <table><tr><td rowspan=1 colspan=1>Normalization</td><td rowspan=1 colspan=1>top-1</td><td rowspan=1 colspan=1>top-5</td></tr><tr><td rowspan=1 colspan=1>mean+variance</td><td rowspan=1 colspan=1>23.7</td><td rowspan=1 colspan=1>7.1</td></tr><tr><td rowspan=1 colspan=1>l1</td><td rowspan=1 colspan=1>22.9</td><td rowspan=1 colspan=1>6.4</td></tr><tr><td rowspan=1 colspan=1>l2</td><td rowspan=1 colspan=1>22.7</td><td rowspan=1 colspan=1>6.3</td></tr></table>
159
+
160
+ <table><tr><td rowspan=1 colspan=1>Norm</td><td rowspan=1 colspan=1>top-1</td><td rowspan=1 colspan=1>top-5</td></tr><tr><td rowspan=1 colspan=1>lo</td><td rowspan=1 colspan=1>23.1</td><td rowspan=1 colspan=1>6.7</td></tr><tr><td rowspan=1 colspan=1>l1</td><td rowspan=1 colspan=1>22.8</td><td rowspan=1 colspan=1>6.3</td></tr><tr><td rowspan=1 colspan=1>l2</td><td rowspan=1 colspan=1>22.7</td><td rowspan=1 colspan=1>6.3</td></tr></table>
161
+
162
+ (c) Adaptation operator.
163
+
164
+ <table><tr><td rowspan=1 colspan=1>Adaptation</td><td rowspan=1 colspan=1>top-1</td><td rowspan=1 colspan=1>top-5</td></tr><tr><td rowspan=1 colspan=1>Sigmoid</td><td rowspan=1 colspan=1>22.9</td><td rowspan=1 colspan=1>6.5</td></tr><tr><td rowspan=1 colspan=1>1+ELU</td><td rowspan=1 colspan=1>22.7</td><td rowspan=1 colspan=1>6.4</td></tr><tr><td rowspan=1 colspan=1>1+tanh</td><td rowspan=1 colspan=1>22.7</td><td rowspan=1 colspan=1>6.3</td></tr></table>
165
+
166
+ (d) Application position.
167
+
168
+ <table><tr><td rowspan=1 colspan=1>Position</td><td rowspan=1 colspan=1>top-1</td><td rowspan=1 colspan=1>top-5</td></tr><tr><td rowspan=1 colspan=1>after BN</td><td rowspan=1 colspan=1>23.1</td><td rowspan=1 colspan=1>6.6</td></tr><tr><td rowspan=1 colspan=1>before BN</td><td rowspan=1 colspan=1>23.1</td><td rowspan=1 colspan=1>6.5</td></tr><tr><td rowspan=1 colspan=1>before Conv</td><td rowspan=1 colspan=1>22.7</td><td rowspan=1 colspan=1>6.3</td></tr></table>
169
+
170
+ Table 6: Clock time comparison. We calculate average inference times (ms) per batch by using 1 GTX 1080Ti with 16 batch size for 1,000 iterations on ImageNet. For the sake of fairness, the modules are applied for all the Convs in VGG-16.
171
+
172
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>baseline</td><td rowspan=1 colspan=1>+SE</td><td rowspan=1 colspan=1>+GCT(l1-norm)</td><td rowspan=1 colspan=1>+GCT(l2-norm)</td></tr><tr><td rowspan=1 colspan=1>time(ms)/batch</td><td rowspan=1 colspan=1>51.11</td><td rowspan=1 colspan=1>87.3136.20↑</td><td rowspan=1 colspan=1>59.468.35↑</td><td rowspan=1 colspan=1>59.738.62↑</td></tr></table>
173
+
174
+ Embedding component. To explain the importance of $\ell _ { p }$ -norm in GCE, we compare embedding operators with different $\ell _ { p }$ norm. We report the results in Table 5a, which shows all the $\ell _ { p }$ -norms are effective in GCE, but the $\ell _ { 2 }$ -norm is slightly better than $\ell _ { 1 }$ -norm. The results demonstrate the GCE of GCT is robust to different $\ell _ { p }$ -norms. In addition, we make a clock time comparison between SE and GCTs with different embedding component. As shown in Table 6, $\ell _ { 2 }$ -norm is computationally similar to $\ell _ { 1 }$ -norm and GCT is much more efficient than SE $( { \bf 8 . 6 2 } m s \mathrm { ~ \uparrow ~ }$ vs. $3 6 . 2 0 m s \uparrow$ ).
175
+
176
+ Normalization component. We also explore the significance of $\ell _ { p }$ -norm in CN by comparing $\ell _ { p }$ normalization with mean and variance normalization. The mean and variance normalization will normalize mean to 0 and variance to 1, which is widely used in normalization layers (e.g., Ioffe & Szegedy (2015)). We show all these results in Table 5b. Particularly, mean and variance normalization achieves a top-1 error of $2 3 . 7 \%$ , which is only slightly better than the ResNet-50 baseline $( 2 3 . 8 \% )$ . Both $\ell _ { 1 }$ and $\ell _ { 2 }$ normalization make more promising improvements, and $\ell _ { 2 }$ performs slightly better. $\ell _ { p }$ normalization is better at representation learning in channel normalization.
177
+
178
+ Adaptation component. We replace the activation function of the gating adaptation with a few different non-linear activation functions and show the results in Table 5c. Compare to the baseline (top-1 of $2 3 . 8 \%$ ), all the non-linear adaptation operator achieves promising performance, and $1 +$ tanh achieves a slightly better improvement. Both $1 + t a n h$ and $1 +$ ELU (Clevert et al., 2016) can model identity mapping, and achieve better results than Sigmoid. These strong results show that GCT is also robust to the choice of activation functions and the identity mapping is important in training.
179
+
180
+ Application position. To find the best way to deploy GCT layers, we conduct experiments in ResNet-50 architecture on ImageNet by separately applying GCT after all the BN layers, before all the BN layers, and before all the convolutional layers. The results are reported in Table 5d. All the placement methods are effective in using GCT to improve the representational power of networks. However, it is better to employ GCT before all the convolutional layers, which is similar to the strategy in (Krizhevsky et al., 2012) (normalization after ReLU).
181
+
182
+ # 5 CONCLUSION AND FUTURE WORK
183
+
184
+ In this paper, we propose GCT, a novel layer that effectively improves the discriminability of deep CNNs by leveraging the relationship among channels. Benefit from the design of combining normalization and gating mechanisms, GCT can facilitate two types of neuron relations, i.e., competition and cooperation, with negligible complexity of parameters. We conduct expensive experiments to show the effectiveness and robustness of GCT across a wide range of modern CNNs and datasets. In future work, we will study the feasibility to apply GCT into recurrent networks.
185
+
186
+ # REFERENCES
187
+
188
+ Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
189
+
190
+ Djork-Arne Clevert, Thomas Unterthiner, and Sepp Hochreiter. Fast and accurate deep network ´ learning by exponential linear units (elus). In ICLR, 2016.
191
+
192
+ Yann N Dauphin, Angela Fan, Michael Auli, and David Grangier. Language modeling with gated convolutional networks. In ICML, 2017.
193
+
194
+ Vyacheslav Demin and Dmitry Nekhaev. Recurrent spiking neural network learning based on a competitive maximization of neuronal activity. Frontiers in neuroinformatics, 12, 2018.
195
+
196
+ Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N Dauphin. Convolutional sequence to sequence learning. In ICML, 2017.
197
+
198
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In ICCV, 2015.
199
+
200
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016a.
201
+
202
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In European conference on computer vision, pp. 630–645. Springer, 2016b.
203
+
204
+ Kaiming He, Georgia Gkioxari, Piotr Dollar, and Ross Girshick. Mask r-cnn. In ´ ICCV, 2017.
205
+
206
+ Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
207
+
208
+ Jie Hu, Li Shen, Samuel Albanie, Gang Sun, and Andrea Vedaldi. Gather-excite: Exploiting feature context in convolutional neural networks. In Advances in Neural Information Processing Systems, pp. 9401–9411, 2018a.
209
+
210
+ Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. In CVPR, 2018b.
211
+
212
+ Yanping Huang, Yonglong Cheng, Dehao Chen, HyoukJoong Lee, Jiquan Ngiam, Quoc V Le, and Zhifeng Chen. Gpipe: Efficient training of giant neural networks using pipeline parallelism. arXiv preprint arXiv:1811.06965, 2018.
213
+
214
+ Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, 2015.
215
+
216
+ Will Kay, Joao Carreira, Karen Simonyan, Brian Zhang, Chloe Hillier, Sudheendra Vijayanarasimhan, Fabio Viola, Tim Green, Trevor Back, Paul Natsev, et al. The kinetics human action video dataset. arXiv preprint arXiv:1705.06950, 2017.
217
+
218
+ Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
219
+
220
+ Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, 2012.
221
+
222
+ Hugo Larochelle and Geoffrey E Hinton. Learning to combine foveal glimpses with a third-order boltzmann machine. In NIPS, 2010.
223
+
224
+ Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollar, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In ´ ECCV. Springer, 2014.
225
+
226
+ Tsung-Yi Lin, Piotr Dollar, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie.´ Feature pyramid networks for object detection. In CVPR, 2017.
227
+
228
+ Ilya Loshchilov and Frank Hutter. Sgdr: Stochastic gradient descent with warm restarts. Learning, 10:3.
229
+
230
+ Siwei Lyu and Eero P Simoncelli. Nonlinear image representation using divisive normalization. In CVPR, 2008.
231
+
232
+ Volodymyr Mnih, Nicolas Heess, Alex Graves, et al. Recurrent models of visual attention. In NIPS, 2014.
233
+
234
+ Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. IJCV, 115(3):211–252, 2015.
235
+
236
+ Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2015.
237
+
238
+ Bharat Singh, Mahyar Najibi, and Larry S Davis. Sniper: Efficient multi-scale training. In Advances in Neural Information Processing Systems, pp. 9333–9343, 2018.
239
+
240
+ Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In ICCV, 2015.
241
+
242
+ Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In CVPR, 2016.
243
+
244
+ Antonio Torralba. Contextual priming for object detection. International journal of computer vision, 53(2):169–191, 2003.
245
+
246
+ Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. Instance normalization: The missing ingredient for fast stylization. arXiv preprint arXiv:1607.08022, 2016.
247
+
248
+ Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NIPS, 2017.
249
+
250
+ Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In CVPR, 2018.
251
+
252
+ Yuxin Wu and Kaiming He. Group normalization. In ECCV, 2018.
253
+
254
+ Saining Xie, Ross Girshick, Piotr Dollar, Zhuowen Tu, and Kaiming He. Aggregated residual trans-´ formations for deep neural networks. In CVPR, 2017.
255
+
256
+ # A TRAINING DETAILS
257
+
258
+ Same to modern normalization layers (e.g., BN (Ioffe & Szegedy, 2015)), we propose to apply GCT for all convolutional layers in deep networks. However, there are many different points nearby one convolutional layer to employ GCT. In deep networks, each convolutional layer always works together with a normalization layer (e.g., BN (Ioffe & Szegedy, 2015)) and an activation layer (e.g., ReLU). For this reason, there are three possible points to deploy GCT layer, which are before the convolutional layer, before the normalization layer, and after the normalization layer. All these methods are effective, but we find to be better to employ GNC before the convolutional layer. In Sec. 4.5, we compare the performance of these three application methods.
259
+
260
+ In the training process, we propose to use 1 to initialize $_ { \pmb { \alpha } }$ and use 0 to initialize all $\gamma$ and $\beta$ . By doing this, GCT will be initialized as an identity mapping module, which will make the training process more stable. Besides, to avoid the bad influence of unstable gradient on the GCT gate in initial training steps, we propose to use warmup method (to start training with a small learning rate). In all the experiments on ImageNet (Russakovsky et al., 2015) and CIFAR (Krizhevsky & Hinton, 2009), we start training with a learning rate of 0.01 for 1 epoch. After the warmup, we go back to the original learning rate schedule. Finally, we propose NOT to apply weight decay on $\beta$ parameters, which is possible to reduce the performance of GCT.
261
+
262
+ # B EXPERIMENTS ON CIFAR
263
+
264
+ We conduct more experiments on the CIFAR-10 and CIFAR-100 datasets (Krizhevsky & Hinton, 2009). We follow the same training and testing strategies in (He et al., 2016a) to conduct our experiments but with a different learning rate schedule. We use a base learning rate of 0.1 and take cosine decay method (Loshchilov & Hutter) to adjust the learning rate for 300 epochs, which achieves better baseline performance. Following the above training protocol, we start the training process with a learning rate of 0.01 for 1 epoch.
265
+
266
+ We report the performance of ResNet-110 (He et al., 2016a) and its GCT counterpart in Table 7. To reduce the variances from different runs, we repeat all experiments for 5 times and report the averaged the results. As with the previous experiments, we observe promising improvements in performance, which shows that GCT can generalize to other image classification datasets.
267
+
268
+ Table 7: Improvement in top-1 error $( \% )$ on the CIFAR-10 and CIFAR-100 datasets.
269
+
270
+ <table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1>ResNet-110</td><td rowspan=1 colspan=1>GCT</td></tr><tr><td rowspan=1 colspan=1>CIFAR-10</td><td rowspan=1 colspan=1>5.81</td><td rowspan=1 colspan=1>5.26(0.55)</td></tr><tr><td rowspan=1 colspan=1>CIFAR-100</td><td rowspan=1 colspan=1>26.66</td><td rowspan=1 colspan=1>25.77 (0.89)</td></tr></table>
271
+
272
+ # C MORE VISUALIZATION RESULTS
273
+
274
+ In ResNet-50 (He et al., 2016a) backbone, We visualize the channel activation before and after the GCT layer in both low-level stage (far away from the network output) and high-level stage (close to the output) in Fig.4 and 5, respectively. The input image is from the validation dataset of ImageNet. As we can see, for the stages far away from the network output, the proposed GCT layer tends to reduce the variance of input feature, which encourages cooperation among channels and avoids excessive activation values or loss of useful features. On the contrary, for those stages close to the output, GCT tends to magnify the variance. Here, GCT acts like the attention mechanism that is useful for creating competition.
275
+
276
+ ![](images/bba516bc4d3a63602666dab0b6c5ddc5af43ac6f9c2b8eb7fc1c547621d60211.jpg)
277
+ Figure 4: Visualization of the channel activation for a GCT layer in Stage 2 (low-level) of ResNet-50 on the validation dataset of ImageNet.
278
+
279
+ ![](images/cfb0388bec48aea32229c87f5fc1dc827cf9259d3d4ac76c3616a7ba8b94c909.jpg)
280
+ Figure 5: Visualization of the channel activation for a GCT layer in Stage 5 (high-level) of ResNet50 on the validation dataset of ImageNet.
md/train/SyX0IeWAW/SyX0IeWAW.md ADDED
@@ -0,0 +1,223 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # META LEARNING SHARED HIERARCHIES
2
+
3
+ Kevin Frans Henry M. Gunn High School Work done as an intern at OpenAI kevinfrans2@gmail.com
4
+
5
+ John Schulman OpenAI
6
+
7
+ Jonathan Ho, Xi Chen, Pieter Abbeel UC Berkeley, Department of Electrical Engineering and Computer Science
8
+
9
+ # ABSTRACT
10
+
11
+ We develop a metalearning approach for learning hierarchically structured policies, improving sample efficiency on unseen tasks through the use of shared primitives—policies that are executed for large numbers of timesteps. Specifically, a set of primitives are shared within a distribution of tasks, and are switched between by task-specific policies. We provide a concrete metric for measuring the strength of such hierarchies, leading to an optimization problem for quickly reaching high reward on unseen tasks. We then present an algorithm to solve this problem end-to-end through the use of any off-the-shelf reinforcement learning method, by repeatedly sampling new tasks and resetting task-specific policies. We successfully discover1 meaningful motor primitives for the directional movement of four-legged robots, solely by interacting with distributions of mazes. We also demonstrate the transferability of primitives to solve long-timescale sparse-reward obstacle courses, and we enable 3D humanoid robots to robustly walk and crawl with the same policy.
12
+
13
+ # 1 INTRODUCTION
14
+
15
+ Humans encounter a wide variety of tasks throughout their lives and utilize prior knowledge to master new tasks quickly. In contrast, reinforcement learning algorithms are typically used to solve each task independently and from scratch, and they require far more experience than humans. While a large body of research seeks to improve the sample efficiency of reinforcement learning algorithms, there is a limit to learning speed in the absence of prior knowledge.
16
+
17
+ We consider the setting where agents solve distributions of related tasks, with the goal of learning new tasks quickly. One challenge is that while we want to share information between the different tasks, these tasks have different optimal policies, so it’s suboptimal to learn a single shared policy for all tasks. Addressing this challenge, we propose a model containing a set of shared sub-policies (i.e., motor primitives), which are switched between by task-specific master policies. This design is closely related to the options framework (Sutton et al., 1999; Bacon et al., 2016), but applied to the setting of a task distribution. We propose a method for the end-to-end training of sub-policies that allow for quick learning on new tasks, handled solely by learning a master policy.
18
+
19
+ Our contributions are as follows.
20
+
21
+ • We formulate an optimization problem that answers the question of what is a good hierarchy?—the problem is to find a set of low-level motor primitives that enable the high-level master policy to be learned quickly. We propose an optimization algorithm that tractably and approximately solves the optimization problem we posed. The main novelty is in how we repeatedly reset the master policy, which allows us to adapt the sub-policies for fast learning.
22
+
23
+ We will henceforth refer to our proposed method—including the hierarchical architecture and optimization algorithm—as MLSH, for metalearning shared hierarchies.
24
+
25
+ We validate our approach on a wide range of environments, including 2D continuous movement, gridworld navigation, and 3D physics tasks involving the directional movement of robots. In the 3D environments, we enable humanoid robots to both walk and crawl with the same policy; and 4-legged robots to discover directional movement primitives to solve a distribution of mazes as well as sparse-reward obstacle courses. Our experiments show that our method is capable of learning meaningful sub-policies solely through interaction with a distributions of tasks, outperforming previously proposed algorithms. We also display that our method is efficient enough to learn in complex physics environments with long time horizons, and robust enough to transfer sub-policies towards otherwise unsolvable sparse-reward tasks.
26
+
27
+ # 2 RELATED WORK
28
+
29
+ Previous work in hierarchical reinforcement learning seeks to speed up the learning process by recombining a set of temporally extended primitives—the most well-known formulation is Options (Sutton et al., 1999). While the earliest work assumed that these options are given, more recent work seeks to learn them automatically (Vezhnevets et al., 2016; Daniel et al., 2016). Heess et al. (2016) discovers primitives by training over a set of simple tasks. Florensa et al. (2017) learns a master policy, where sub-policies are defined according to information-maximizing statistics. Bacon et al. (2016) introduces end-to-end learning of hierarchy through the options framework. Henderson et al. (2017) extends the options framework to include reward options. Several methods (Dayan & Hinton, 1993; Vezhnevets et al., 2017; Ghazanfari & Taylor, 2017) aim to learn a decomposition of complicated tasks into sub-goals. These prior works are mostly focused on the single-task setting and don’t account for the multi-task structure as part of the algorithm. Other past works (Thomas & Barto, 2011; Thomas, 2011; Thomas & Barto, 2012) have simultaneously learned modules that are used in conjunction to solve tasks, but do not incorporate temporal abstraction. On the other hand, our work takes advantage of the multi-task setting as a way to learn temporally extended primitives.
30
+
31
+ There has also been work in metalearning, where information from past experiences is used to learn quickly on specific tasks. Andrychowicz et al. (2016) proposes the use of a recurrent LSTM network to generate parameter updates. Duan et al. (2016) and Wang et al. (2016) aim to use recurrent networks as the entire learning process, giving the network the same inputs a traditional RL method would receive. Mishra et al. (2017) tackles a similar problem, utilizing temporal convolutions rather than recurrency. Finn et al. (2017) accounts for fine-tuning of a shared policy, by optimizing through a second gradient step. While the prior work on metalearning optimizes to learn as much as possible in a small number of gradient updates, MLSH (our method) optimizes to learn quickly over a large number of policy gradient updates in the RL setting—a regime not yet explored by prior work.
32
+
33
+ # 3 PROBLEM STATEMENT
34
+
35
+ First, we will formally define the optimization problem we would like to solve, in which we have a distribution over tasks, and we would like to find parameters that enable an agent to learn quickly on tasks sampled from this distribution.
36
+
37
+ Let $S$ and $A$ denote the state space and action space, respectively. A Markov Decision Process (MDP) is defined by the transition function $P ( s ^ { \prime } , \bar { r } | s , a )$ , where $( s ^ { \prime } , \bar { r } )$ are the next state and reward, and $( s , a )$ are the state and action.
38
+
39
+ Let $P _ { M }$ denote a distribution over MDPs $M$ with the same state-action space $( S , A )$ . An agent is a function mapping from a multi-episode history $\left( s _ { 0 } , a _ { 0 } , r _ { 0 } , s _ { 1 } , a _ { 2 } , r _ { 2 } , \dots s _ { t - 1 } \right)$ to the next action $a _ { t }$ . Specifically, an agent consists of a reinforcement learning algorithm which iteratively updates a parameter vector $( \phi , \theta )$ that defines a stochastic policy $\pi _ { \phi , \theta } ( a | s )$ . $\phi$ parameters are shared between all tasks and held fixed at test time. $\theta$ is learned from scratch (from a zero or random initialization) per-task, and encodes the state of the learning process on that task. In the setting we consider, first an MDP $M$ is sampled from $P _ { M }$ , then an agent is incarnated with the shared parameters $\phi$ , along with randomly-initialized $\theta$ parameters. During an agent’s $T$ -step interaction with the sampled MDP $M$ , the agent iteratively updates its $\theta$ parameters.
40
+
41
+ ![](images/e7efbd7a9f86cbc819ac0db5e5cc053b78029791ed7fa5a23d741e22e77c3324.jpg)
42
+ Figure 1: Structure of a hierarchical sub-policy agent. $\theta$ represents the master policy, which selects a sub-policy to be active. In the diagram, $\phi _ { 3 }$ is the active sub-policy, and actions are taken according to its output.
43
+
44
+ In other words, $\phi$ represents a set of parameters that is shared between tasks, and $\theta$ represents a set of per-task parameters, which is updated as the agent learns about the current task $M$ . An agent interacts with the task for $T$ timesteps, over multiple episodes, and receives total return $R =$ $r _ { 0 } + r _ { 1 } + . . . + r _ { T - 1 }$ . The meta-learning objective is to optimize the expected return during an agent’s entire lifetime, over the sampled tasks.
45
+
46
+ $$
47
+ \mathrm { m a x i m i z e } _ { \phi } E _ { M \sim P _ { M } , t = 0 \ldots T - 1 } [ R ]
48
+ $$
49
+
50
+ This objective tries to find a shared parameter vector $\phi$ that ensures that, when faced with a new MDP, the agent achieves high $T$ time-step returns by simply adapting $\theta$ while in this new MDP.
51
+
52
+ While there are various possible architectures incorporating shared parameters $\phi$ and per-task parameters $\theta$ , we propose an architecture that is motivated by the ideas of hierarchical reinforcement learning. Specifically, the shared parameter vector $\phi$ consists of a set of subvectors $\phi _ { 1 } , \phi _ { 2 } , \ldots , \phi _ { K }$ , where each subvector $\phi _ { k }$ defines a sub-policy $\pi _ { \phi _ { k } } ( a | s )$ . The parameter $\theta$ is a separate neural network that switches between the sub-policies. That is, $\theta$ parametrizes a stochastic policy, called the master policy whose action is to choose the index $k \in \{ 1 , 2 , \ldots , K \}$ . Furthermore, as in some other hierarchical policy architectures (e.g. options (Sutton et al., 1999)), the master policy chooses actions at a slower timescale than the sub-policies $\phi _ { k }$ . In this work, the master policy samples actions at a fixed frequency of $N$ timesteps, i.e., at $t = 0 , N , 2 N , \ldots .$
53
+
54
+ This architecture is illustrated in Figure 1. By discovering a strong set of sub-policies $\phi$ , learning on new tasks can be handled solely by updating the master policy $\theta$ . Furthermore, since the master policy chooses actions only every $N$ time steps, it sees a learning problem with a horizon that is only $1 / N$ times as long. Hence, it can adapt quickly to a new MDP $M$ , which is required by the learning objective (Equation (1)).
55
+
56
+ # 4 ALGORITHM
57
+
58
+ We would like to iteratively learn a set of sub-policies that allow newly incarnated agents to achieve maximum reward over $T$ -step interactions in a distribution of tasks.
59
+
60
+ An optimal set of sub-policies must be fine-tuned enough to achieve high performance. At the same time, they must be robust enough to work on wide ranges of tasks. Optimal sets of sub-policies must also be diversely structured such that master policies can be learned quickly. We present an update scheme of sub-policy parameters $\phi$ leading naturally to these qualities.
61
+
62
+ # 4.1 POLICY UPDATE IN MLSH
63
+
64
+ In this section, we will describe the MLSH (metalearning shared hierarchies) algorithm for learning sub-policy parameters $\phi$ . Starting from a random initialization, the algorithm (Algorithm 1) iteratively performs update steps which can be broken into two main components: a warmup period to optimize master policy parameters $\theta$ , along with a joint update period where both $\theta$ and $\phi$ are optimized.
65
+
66
+ # Algorithm 1 Meta Learning Shared Hierarchies
67
+
68
+ <table><tr><td>Initialize Φ</td></tr><tr><td>repeat Initialize 0</td></tr><tr><td>Sample task M ~ PM</td></tr><tr><td>for w = O,1,.W (warmup period) do</td></tr><tr><td>Collect D timesteps of experience using T𝜙,θ</td></tr><tr><td>Update θ to maximize expected return from 1/N timescale viewpoint</td></tr><tr><td>end for for u = O,1,...U (joint update period) do</td></tr><tr><td>Collect D timesteps of experience using ,θ</td></tr><tr><td>Update θ to maximize expected return from 1/N timescale viewpoint</td></tr><tr><td>Update to maximize expected return from full timescale viewpoint</td></tr><tr><td>end for</td></tr><tr><td>until convergence</td></tr></table>
69
+
70
+ From a high-level view, an MLSH update is structured as follows. We first sample a task $M$ from the distribution $P _ { M }$ . We then initialize an agent, using a previous set of sub-policies, parameterized by $\phi$ , and a master policy with randomly-initialized parameters $\theta$ . We then run a warmup period to optimize $\theta$ . At this point, our agent contains of a set of general sub-policies $\phi$ , as well as a master policy $\theta$ fine-tuned to the task at hand. We enter the joint update period, where both $\theta$ and $\phi$ are updated. Finally, we sample a new task, reset $\theta$ , and repeat.
71
+
72
+ The warmup period for optimizing the master policy $\theta$ is defined as follows. We assume a constant set of sub-policies as parameterized by $\phi$ . From the sampled task, we record $D$ timesteps of experience using $\pi _ { \phi , \theta } ( a | s )$ . We view this experience from the perspective of the master policy, as in Figure 2. Specifically, we consider the selection of a sub-policy as a single action. The next $N$ timesteps, along with corresponding state changes and rewards, are viewed as a single environment transition. We then update $\theta$ towards maximizing reward, using the collected experience along with an arbitrary reinforcement learning algorithm (for example DQN, A3C, TRPO, PPO) (Mnih et al., 2015; 2016; Schulman et al., 2015; 2017). We repeat this prodecure $W$ times.
73
+
74
+ Next, we will define a joint update period where both sub-policies $\phi$ and master policy $\theta$ are updated. For $U$ iterations, we collect experience and optimize $\theta$ as defined in the warmup period. Additionally, we reuse the same experience, but viewed from the perspective of the sub-policies. We treat the master policy as an extension of the environment. Specifically, we consider the master policy’s decision as a discrete portion of the environment’s observation. For each $N$ -timestep slice of experience, we only update the parameters of the sub-policy that had been activated by the master policy.
75
+
76
+ ![](images/0f586eac4e1bf551f1fa11420d53959ba42edf5f5cbd6b831580d373c5a0ca98.jpg)
77
+ Figure 2: Unrolled structure for a master policy action lasting $N \ = \ 3$ timesteps. Left: When training the master policy, the update only depends on the master policy’s action and total reward (blue region), treating the individual actions and rewards as part of the environment transition (red region). Right: When training sub-policies, the update considers the master policy’s action as part of the observation (blue region), ignoring actions in other timesteps (red region)
78
+
79
+ # 5 RATIONALE
80
+
81
+ We will now provide intuition for why this framework leads to a set of sub-policies $\phi$ which allow agents to quickly reach high reward when learning $\theta$ on a new task. In metalearning methods, it is common to optimize for reward over an entire inner loop (in the case of MLSH, training $\theta$ for $T$ iterations). However, we instead choose to optimize $\phi$ towards maximizing reward within a single episode. Our argument relies on the assumption that the warmup period of $\theta$ will learn an optimal master policy, given a set of fixed sub-polices $\phi$ . As such, the optimal $\phi$ at $\theta _ { \mathrm { f i n a l } }$ is equivalent to the optimal $\phi$ for training $\theta$ from scratch. While this assumption is at some times false, such as when a gradient update overshoots the optimal $\theta$ policy, we empirically find the assumption accurate enough for training purposes.
82
+
83
+ Next, we consider the inclusion of a warmup period. It is important that $\phi$ only be updated when $\theta$ is at a near-optimal level. A motivating example for this is a navigation task containing two possible destinations, as well as two sub-policies. If $\theta$ is random, the optimal sub-policies both lead the agent to the midpoint of the destinations. If $\theta$ contains information on the correct destination, the optimal sub-policies consist of one leading to the first destination, and the other to the second.
84
+
85
+ Finally, we will address the reasoning behind limiting the update period to $U$ iterations. As we update the sub-policy parameters $\phi$ while reusing master policy parameters $\theta$ , we are assuming that re-training $\theta$ will result in roughly the same master policy. However, as $\phi$ changes, this assumption holds less weight. We therefore stop and re-train $\theta$ once a threshold of $U$ iterations has passed.
86
+
87
+ # 6 EXPERIMENTS
88
+
89
+ We hypothesize that meaningful sub-policies can be learned by operating over distributions of tasks, in an efficient enough manner to handle complex physics domains. We also hypothesize that subpolicies can be transferred to complicated tasks outside the training distribution. In the following section, we present a series of experiments designed to test the performance of our method, through comparison to baselines and past methods with hierarchy.
90
+
91
+ # 6.1 EXPERIMENTAL SETUP
92
+
93
+ We present a series of environments containing both shared and task-specific information. We examine two curves: the overall learning on the entire distribution $( \phi )$ , as well as the learning on a sampled individual task $\mathbf { \eta } ^ { ( \theta ) }$ . For overall training, we compare to a baseline of a shared policy trained jointly across all tasks from the distribution. We also compare to running MLSH without a warmup period.
94
+
95
+ In the sampled individual task experiments, our MLSH agent utilizes sub-policies $( \phi )$ previously trained on the entire distribution, and only updates the master policy $\mathbf { \eta } ^ { ( \theta ) }$ towards the new task. To test the importance of the sub-policy structure, we compare against fine-tuning a single policy that has been optimized across all tasks. We also compare against training a new single policy from scratch, to test if the learned sub-policies are useful.
96
+
97
+ For both master and sub-policies, we use 2 layer MLPs with a hidden size of 64. Master policy actions are sampled through a softmax distribution. We train both master and sub-policies using policy gradient methods, specifically PPO (Schulman et al., 2017). For collecting experience, we compute a batchsize of $D { = } 2 0 0 0$ timesteps. We use a much larger learning rate for $\theta$ (0.01) than for $\phi$ (0.0003), since $\phi$ parameters should remain relatively consistent throughout a single warmup and joint-update period.
98
+
99
+ While the base MLSH algorithm is sequential, we run all experiments in a parallel multi-core setup for faster wall-clock training time. We split 120 cores into 10 groups of 12 cores, where a group represents a single MLSH learner which uses 12 cores to to collect experience in parallel. All groups sample individual tasks from the task distribution, and only $\phi$ parameters are shared. Viewed as a whole, we are optimizing a shared set of $\phi$ parameters towards 10 sampled tasks in parallel.
100
+
101
+ To prevent periods where the $\phi$ parameters are receiving no gradients, we stagger the warmup periods of each group, so a new group enters warmup as soon as another group leaves. Once a group has finished both its warmup and joint-update period, a new task is sampled along with a new random initialization of $\theta$ , both of which are shared within all cores in the group. Warmup and joint-update lengths for individual environment distributions will be described in the following section. As a general rule, a good warmup duration represents the amount of gradient updates required to approach convergence of $\theta$ .
102
+
103
+ ![](images/5755c998dc06436b1ff9c95df68e96e1e92aa123b95d5381c5a89bfe99740278.jpg)
104
+ Figure 3: Sampled tasks from 2D moving bandits. Small green dot represents the agent, while blue and yellow dots represent potential goal points. Right: Blue/red arrows correspond to movements when taking sub-policies 1 and 2 respectively.
105
+
106
+ 6.2 CAN MEANINGFUL SUB-POLICIES BE LEARNED OVER A DISTRIBUTION OF TASKS, AND DO THEY OUTPERFORM A SHARED POLICY?
107
+
108
+ Our motivating problem is a 2D moving bandits task (Figure 3), in which an agent is placed in a world and shown the positions of two randomly placed points. The agent may take discrete actions to move in the four cardinal directions, or opt to stay still. One of the two points is marked as correct, although the agent does not receive information on which one it is. The agent receives a reward of 1 if it is within a certain distance of the correct point, and a reward of 0 otherwise. Each episode lasts 50 timesteps, and master policy actions last for 10. We use two sub-policies, a warmup duration of 9, and a joint-update duration of 1.
109
+
110
+ ![](images/952cbd17c94a1496ff9e5b04287e2e96a3459fb1b3b09810f19a07abc7807b1b.jpg)
111
+ Figure 4: Learning curves for 2D Moving Bandits and Four Rooms.
112
+
113
+ After training, MLSH learns sub-policies corresponding to movement towards each potential goal point. Training a master policy is faster than training a single policy from scratch, as we are tasked only with discovering the correct goal, rather than also learning primitive movement. Learning a shared policy, on the other hand, results in an agent that always moves towards a certain goal point, ignoring the other and thereby cutting expected reward by half. We additionally compare to an $\mathtt { R L } ^ { 2 }$ policy (Duan et al., 2016), which encounters the same problem as the shared policy and ignores one of the goal points.
114
+
115
+ ![](images/50c559a48b1e887e60b394612e7b32c45118f8db9f44720f43daadc41a744612.jpg)
116
+ Figure 5: Top: Ant Twowalk. Ant must maneuver towards red goal point, either towards the top or towards the right. Bottom Left: Walking. Humanoid must move horizontally while maintaining an upright stance. Bottom Right: Crawling. Humanoid must move horizontally while a height-limiting obstacle is present.
117
+
118
+ We perform several ablation tests within the 2D moving bandits task. Removing the warmup period results in an MLSH agent which at first has both sub-policies moving to the same goal point, but gradually shifts one sub-policy towards the other point. Running the master policy on the same timescale as the sub-policies results in similar behavior to simply learning a shared policy, showing that the temporal extension of sub-policies is key. Finally, we run a hyperparameter comparison to test the influence of the sub-policy count and warmup duration.
119
+
120
+ # 6.3 HOW DOES MLSH COMPARE TO PAST METHODS IN THE HIERARCHICAL DOMAIN?
121
+
122
+ To compare to past methods, we consider the four-rooms domain described in Sutton et al. (1999) and expanded in Option Critic (Bacon et al., 2016). The agent starts at a specific spot in the gridworld, and is randomly assigned a goal position. A reward of 1 is awarded for being in the goal state. Episodes last for 100 timesteps, and master policy actions last for 25. We utilize four sub-policies, a warmup time of 20, and a joint-update time of 30.
123
+
124
+ First, we repeatedly train MLSH and Option Critic on many random goals in the four-rooms domain, until reward stops improving. Then, we sample an unseen goal position and fine-tune. We compare against baselines of training a single policy from scratch, using PPO against MLSH, and Actor Critic against Option Critic. In Figure 4, while Option Critic performs similarly to its baseline, we can see MLSH reach high reward faster than the PPO baseline. It is worth noting that when fine-tuning, the PPO baseline naturally reaches more stable reward than Actor Critic, so we do not compare MLSH and Option Critic directly.
125
+
126
+ # 6.4 IS THE MLSH FRAMEWORK SAMPLE-EFFICIENT ENOUGH TO LEARN DIVERSE SUB-POLICIES IN PHYSICS ENVIRONMENTS?
127
+
128
+ To test the scalability of the MLSH algorithm, we present a series of physics-based tasks which we describe below, all which are simulated through Mujoco (Todorov et al., 2012). Diverse subpolicies are naturally discovered, as shown in Figure 5 and Figure 6. Episodes last 1000 timesteps, and master policy actions last 200. We use a warmup time of 20, and a joint-update time of 40.
129
+
130
+ In the Twowalk tasks, we would like to examine if simulated robots can learn directional movement primitives. We test performance on a standard simulated four-legged ant, and use a sub-policy count of two. A destination point is placed in either the top edge of the world or the right edge of the world. Reward is given based on negative distance to this destination point.
131
+
132
+ ![](images/2a64ad4a78b48864dcc90ca1a8b516b9d3d78be1248e62d9351e77313e190412.jpg)
133
+ Figure 6: Top: Distribution of mazes. Red blocks are impassable tiles, and green blocks represent the goal. Bottom: Sub-policies learned from mazes to move up, right, and down.
134
+
135
+ In addition, we would like to determine if diverse sub-policies can be automatically discovered solely through interaction with the environment. We present a task where Ant robots must move to destination points in a set of mazes (Figure 6). Without human supervision, Ant robots are able to learn directional movement sub-policies in three directions, and use them in combination to solve the mazes.
136
+
137
+ In the Walk/Crawl task, we would like to determine if Humanoid robots can learn a variety of movement styles. Out of two possible locomotion objectives, one is randomly selected. In the first objective, the agent must move forwards while maintaining an upright stance. This was designed with a walking behavior in mind. In the second objective, the agent must move backwards underneath an obstacle limiting vertical height. This was designed to encourage a crawling behavior.
138
+
139
+ Additionally, we test the transfer capabilities of sub-policies trained in the Walk/Crawl task by introducing an unseen combination task. The Humanoid agent must first walk forwards until a certain distance, at which point it must switch movements, turn around, and crawl backwards under an obstacle.
140
+
141
+ <table><tr><td colspan="2">Reward on Walk/Crawl combination task</td></tr><tr><td>MLSHTransfer Shared Policy Transfer Single Policy</td><td>14333 6055 -643</td></tr></table>
142
+
143
+ On both Twowalk and Walk/Crawl tasks, MLSH significantly outperforms baselines, displaying scalability into complex physics domains. Ant robots learn temporally-extended directional movement primitives that lead to efficient exploration of mazes. In addition, we successfully discover diverse Humanoid sub-policies for both walking and crawling.
144
+
145
+ 6.5 CAN SUB-POLICIES BE USED TO LEARN IN AN OTHERWISE UNSOLVABLE SPARSE PHYSICS ENVIRONMENT?
146
+
147
+ Finally, we present a complex task that is unsolvable with naive PPO. The agent controls an Ant robot which has been placed into an obstacle course. The agent must navigate from the bottom-left corner to the top-right corner, to receive a reward of 1. In all other cases, the agent receives a reward of 0. Along the way, there are obstacles such as walls and a chasing enemy. We periodically reset the joints of the Ant robot to prevent it from falling over. An episode lasts for 2000 timesteps, and master policy actions last 200. To solve this task, we use sub-policies learned in the Ant Twowalk tasks. We then fine-tune the master policy on the obstacle course task.
148
+
149
+ ![](images/c45bb033ea0100b1e9b88a1ffab54662266208886df4ab8dd0b513236601577e.jpg)
150
+ Figure 7: Learning curves for Twowalk and Walk/Crawl tasks
151
+
152
+ ![](images/6ee2391f0ebd27ee68dc375118bbb0d74cc560b512c4cfe6455cc3b3dba69bb9.jpg)
153
+ Figure 8: Ant Obstacle course task. Agent must navigate to the green square in the top right corner. Entering the red circle causes an enemy to attack the agent, knocking it back.
154
+
155
+ In the sparse reward setting, naive PPO cannot learn, as exploration over the space of primitive action sequences is unlikely to result in reward signal. On the other hand, MLSH allows for exploration over the space of sub-policies, where it is easier to discover a sequence that leads to reward.
156
+
157
+ <table><tr><td colspan="2">Reward on Ant Obstacle task</td></tr><tr><td>MLSHTransfer Single Policy</td><td>193 0</td></tr></table>
158
+
159
+ # 7 DISCUSSION
160
+
161
+ In this work, we formulate an approach for the end-to-end metalearning of hierarchical policies. We present a model for representing shared information as a set of sub-policies. We then provide a framework for training these models over distributions of environments. Even though we do not optimize towards the true objective, we achieve significant speedups in learning. In addition, we naturally discover diverse sub-policies without the need for hand engineering.
162
+
163
+ # 7.1 FUTURE WORK
164
+
165
+ As there is no gradient signal being passed between the master and sub-policies, the MLSH model utilizes hard one-hot communication, as opposed to methods such as Gumbel-Softmax (Jang et al., 2016). This lack of a gradient also allows MLSH to be learning-method agnostic. While we used policy gradients in our experiments, it is entirely feasible to have the master or sub-policies be trained with evolution (Eigen) or Q-learning (Watkins & Dayan, 1992).
166
+
167
+ From another point of view, our training framework can be seen as a method of joint optimization over two sets of parameters. This framework can be applied to other scenarios than learning subpolicies. For example, distributions of tasks with similar observation distributions but different reward functions could be solved with a shared observational network, while learning independent policies.
168
+
169
+ This work draws inspiration from the domains of both hierarchical reinforcement learning and metalearning, the intersection at which architecture space has yet to be explored. For example, the set of sub-policies could be condensed into a single neural network, which receives a continuous vector from the master policy. If sample efficiency issues are addressed, several approximations in the MLSH method could be removed for a more unbiased estimator – such as training $\phi$ to maximize reward on the entire $T$ -timesteps, rather than on a single episode. We believe this work opens up many directions in training agents that can quickly adapt to new tasks.
170
+
171
+ # REFERENCES
172
+
173
+ Marcin Andrychowicz, Misha Denil, Sergio Gomez, Matthew W Hoffman, David Pfau, Tom Schaul, ´ and Nando de Freitas. Learning to learn by gradient descent by gradient descent. In Advances in Neural Information Processing Systems 29, 2016.
174
+
175
+ Pierre-Luc Bacon, Jean Harb, and Doina Precup. The option-critic architecture. arXiv preprint arXiv:1609.05140, 2016.
176
+
177
+ Christian Daniel, Herke Van Hoof, Jan Peters, and Gerhard Neumann. Probabilistic inference for determining options in reinforcement learning. Mach. Learn., 2016.
178
+
179
+ Peter Dayan and Geoffrey E Hinton. Feudal reinforcement learning. In Advances in Neural Information Processing Systems, 1993.
180
+
181
+ Yan Duan, John Schulman, Xi Chen, Peter L. Bartlett, Ilya Sutskever, and Pieter Abbeel. Rl2: Fast reinforcement learning via slow reinforcement learning. arXiv preprint 1611.02779, 2016.
182
+
183
+ Manfred Eigen. Ingo rechenberg evolutionsstrategie optimierung technischer systeme nach prinzipien der biologishen evolution.
184
+
185
+ Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In Proceedings of the 34th International Conference on Machine Learning, 2017.
186
+
187
+ Carlos Florensa, Yan Duan, and Pieter Abbeel. Stochastic neural networks for hierarchial reinforcement learning. In International Conference on Learning Representations, 2017.
188
+
189
+ Behzad Ghazanfari and Matthew E. Taylor. Autonomous extracting a hierarchical structure of tasks in reinforcement learning and multi-task reinforcement learning. arXiv preprint 1709.04579, 2017.
190
+
191
+ Nicolas Heess, Greg Wayne, Yuval Tassa, Timothy Lillicrap, Martin Riedmiller, and David Silver. Learning and transfer of modulated locomotor controllers. arXiv preprint arXiv:1610.05182, 2016.
192
+
193
+ Peter Henderson, Wei-Di Chang, Pierre-Luc Bacon, David Meger, Joelle Pineau, and Doina Precup. Optiongan: Learning joint reward-policy options using generative adversarial inverse reinforcement learning. arXiv preprint 1709.06683, 2017.
194
+
195
+ Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. arXiv preprint 1611.01144, 2016.
196
+
197
+ Nikhil Mishra, Mostafa Rohaninejad, Xi Chen, and Pieter Abbeel. Meta-learning with temporal convolutions. arXiv preprint 1707.03141, 2017.
198
+
199
+ Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A. Rusu, Joel Veness, Marc G. Bellemare, Alex Graves, Martin Riedmiller, Andreas K. Fidjeland, Georg Ostrovski, Stig Petersen, Charles Beattie, Amir Sadik, Ioannis Antonoglou, Helen King, Dharshan Kumaran, Daan Wierstra, Shane Legg, and Demis Hassabis. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 02 2015.
200
+
201
+ Volodymyr Mnih, Adria Puigdomenech Badia, Mehdi Mirza, Alex Graves, Timothy Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In International Conference on Machine Learning, pp. 1928–1937, 2016.
202
+
203
+ John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In Proceedings of the 32nd International Conference on Machine Learning (ICML-15), pp. 1889–1897, 2015.
204
+
205
+ John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint 1707.06347, 2017.
206
+
207
+ Richard S Sutton, Doina Precup, , and Satinder Singh. Between mdps and semi-mdps: A framework for temporal abstraction in reinforcement learning. In Artificial intelligence, 1999.
208
+
209
+ Philip S Thomas. Policy gradient coagent networks. In Advances in Neural Information Processing Systems, pp. 1944–1952, 2011.
210
+
211
+ Philip S Thomas and Andrew G Barto. Conjugate markov decision processes. In Proceedings of the 28th International Conference on Machine Learning (ICML-11), pp. 137–144, 2011.
212
+
213
+ Philip S Thomas and Andrew G Barto. Motor primitive discovery. In Development and Learning and Epigenetic Robotics (ICDL), 2012 IEEE International Conference on, pp. 1–8. IEEE, 2012.
214
+
215
+ E. Todorov, T. Erez, and Y. Tassa. Mujoco: A physics engine for model-based control. In Intelligent Robots and Systems (IROS), 2012.
216
+
217
+ Alexander Vezhnevets, Volodymyr Mnih, Simon Osindero, Alex Graves, Oriol Vinyals, John Agapiou, and Koray Kavukcuoglu. Strategic attentive writer for learning macro-actions. In Advances in Neural Information Processing Systems, 2016.
218
+
219
+ Alexander Sasha Vezhnevets, Simon Osindero, Tom Schaul, Nicolas Heess, Max Jaderberg, David Silver, and Koray Kavukcuoglu. Feudal networks for hierarchical reinforcement learning. arXiv preprint 1703.01161, 2017.
220
+
221
+ Jane X. Wang, Zeb Kurth-Nelson, Dhruva Tirumala, Hubert Soyer, Joel Z. Leibo, Remi Munos, ´ Charles Blundell, Dharshan Kumaran, and Matthew Botvinick. Learning to reinforcement learn. arXiv preprint 1611.05763, 2016.
222
+
223
+ Christopher JCH Watkins and Peter Dayan. Q-learning. Machine learning, 8(3-4):279–292, 1992.
md/train/YTWGvpFOQD-/YTWGvpFOQD-.md ADDED
@@ -0,0 +1,591 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DIFFERENTIALLY PRIVATE LEARNING NEEDS BETTER FEATURES (OR MUCH MORE DATA)
2
+
3
+ Florian Tramèr
4
+ Stanford University
5
+ tramer@cs.stanford.edu
6
+
7
+ Dan Boneh Stanford University dabo@cs.stanford.edu
8
+
9
+ # ABSTRACT
10
+
11
+ We demonstrate that differentially private machine learning has not yet reached its “AlexNet moment” on many canonical vision tasks: linear models trained on handcrafted features significantly outperform end-to-end deep neural networks for moderate privacy budgets. To exceed the performance of handcrafted features, we show that private learning requires either much more private data, or access to features learned on public data from a similar domain. Our work introduces simple yet strong baselines for differentially private learning that can inform the evaluation of future progress in this area.
12
+
13
+ # 1 INTRODUCTION
14
+
15
+ Machine learning (ML) models have been successfully applied to the analysis of sensitive user data such as medical images (Lundervold & Lundervold, 2019), text messages (Chen et al., 2019) or social media posts (Wu et al., 2016). Training these ML models under the framework of differential privacy (DP) (Dwork et al., 2006b; Chaudhuri et al., 2011; Shokri & Shmatikov, 2015; Abadi et al., 2016) can protect deployed classifiers against unintentional leakage of private training data (Shokri et al., 2017; Song et al., 2017; Carlini et al., 2019; 2020).
16
+
17
+ Yet, training deep neural networks with strong DP guarantees comes at a significant cost in utility (Abadi et al., 2016; Yu et al., 2020; Bagdasaryan et al., 2019; Feldman, 2020). In fact, on many ML benchmarks the reported accuracy of private deep learning still falls short of “shallow” (non-private) techniques. For example, on CIFAR-10, Papernot et al. (2020b) train a neural network to $6 6 . 2 \%$ accuracy for a large DP budget of $\varepsilon = 7 . 5 3$ , the highest accuracy we are aware of for this privacy budget. Yet, without privacy, higher accuracy is achievable with linear models and non-learned “handcrafted” features, e.g., (Coates & $\mathrm { N g }$ , 2012; Oyallon & Mallat, 2015). This leads to the central question of our work:
18
+
19
+ Can differentially private learning benefit from handcrafted features?
20
+
21
+ We answer this question affirmatively by introducing simple and strong handcrafted baselines for differentially private learning, that significantly improve the privacy-utility guarantees on canonical vision benchmarks.
22
+
23
+ Our contributions. We leverage the Scattering Network (ScatterNet) of Oyallon & Mallat (2015)— a non-learned SIFT-like feature extractor (Lowe, 1999)—to train linear models that improve upon the privacy-utility guarantees of deep learning on MNIST, Fashion-MNIST and CIFAR-10 (see Table 1). For example, on CIFAR-10 we exceed the accuracy reported by Papernot et al. (2020b) while simultaneously improving the provable DP-guarantee by $1 3 0 \times$ . On MNIST, we match the privacy-utility guarantees obtained with PATE (Papernot et al., 2018) without requiring access to any public data. We find that privately training deeper neural networks on handcrafted features also significantly improves over end-to-end deep learning, and even slightly exceeds the simpler linear models on CIFAR-10. Our results show that private deep learning remains outperformed by handcrafted priors on many tasks, and thus has yet to reach its “AlexNet moment” (Krizhevsky et al., 2012).
24
+
25
+ We find that models with handcrafted features outperform end-to-end deep models, despite having more trainable parameters. This is counter-intuitive, as the guarantees of private learning degrade with dimensionality in the worst case (Bassily et al., 2014).1 We explain the benefits of handcrafted features by analyzing the convergence rate of non-private gradient descent. First, we observe that with low enough learning rates, training converges similarly with or without privacy (both for models with and without handcrafted features). Second, we show that handcrafted features significantly boost the convergence rate of non-private learning at low learning rates. As a result, when training with privacy, handcrafted features lead to more accurate models for a fixed privacy budget.
26
+
27
+ Table 1: Test accuracy of models with handcrafted ScatterNet features compared to prior results with end-to-end CNNs for various DP budgets $( \varepsilon , \delta = 1 0 ^ { - 5 } )$ ). Lower $\varepsilon$ values provide stronger privacy. The end-to-end CNNs with maximal accuracy for each privacy budget are underlined. We select the best ScatterNet model for each DP budget $\varepsilon \le 3$ with a hyper-parameter search, and show the mean and standard deviation in accuracy for five runs.
28
+ Test Accuracy $( \% )$
29
+
30
+ <table><tr><td>Data</td><td>ε-DP</td><td>Source</td><td>CNN</td><td>ScatterNet+linear</td><td>ScatterNet+CNN</td></tr><tr><td rowspan="7">MNIST</td><td>1.2</td><td>Feldman &amp; Zrnic (2020)</td><td>96.6</td><td>98.1±0.1</td><td>97.8 ±0.1</td></tr><tr><td>2.0</td><td>Abadi et al. (2016)</td><td>95.0</td><td>98.5 ± 0.0</td><td>98.4±0.1</td></tr><tr><td>2.32</td><td>Bu et al. (2019)</td><td>96.6</td><td>98.6±0.0</td><td>98.5 ±0.0</td></tr><tr><td>2.5</td><td>Chen&amp;Lee (2020)</td><td>90.0</td><td>98.7 ± 0.0</td><td>98.6 ±0.0</td></tr><tr><td>2.93</td><td>Papernot et al. (2020a)</td><td>98.1</td><td>98.7 ± 0.0</td><td>98.7 ± 0.1</td></tr><tr><td>3.2</td><td>Nasr et al. (2020)</td><td>96.1</td><td>一</td><td></td></tr><tr><td>6.78</td><td>Yu et al. (2019b)</td><td>93.2</td><td>1</td><td></td></tr><tr><td rowspan="2">Fashion-MNIST</td><td>2.7</td><td>Papernot et al. (2020a)</td><td>86.1</td><td>89.5 ±0.0</td><td>88.7 ±0.1</td></tr><tr><td>3.0</td><td>Chen &amp; Lee (2020)</td><td>82.3</td><td>89.7 ± 0.0</td><td>89.0±0.1</td></tr><tr><td rowspan="4">CIFAR-10</td><td>3.0</td><td>Nasr et al. (2020)</td><td>55.0</td><td>67.0 ±0.1</td><td>69.3± 0.2</td></tr><tr><td>6.78</td><td>Yu et al. (2019b)</td><td>44.3</td><td></td><td></td></tr><tr><td>7.53</td><td>Papernot et al. (2020a)</td><td>66.2</td><td></td><td></td></tr><tr><td>8.0</td><td>Chen &amp; Lee (2020)</td><td>53.0</td><td></td><td></td></tr></table>
31
+
32
+ Considering these results, we ask: what is the cost of private learning’s “AlexNet moment”? That is, which additional resources do we need in order to outperform our private handcrafted baselines? Following McMahan et al. (2018), we first consider the data complexity of private end-to-end learning. On CIFAR-10, we use an additional 500,000 labeled Tiny Images from Carmon et al. (2019) to show that about an order of magnitude more private training data is needed for end-to-end deep models to outperform our handcrafted features baselines. The high sample-complexity of private deep learning could be detrimental for tasks that cannot leverage “internet-scale” data collection (e.g., most medical applications).
33
+
34
+ We further consider private learning with access to public data from a similar domain. In this setting, handcrafted features can be replaced by features learned from public data via transfer learning (Razavian et al., 2014). While differentially private transfer learning has been studied in prior work (Abadi et al., 2016; Papernot et al., 2020a), we find that its privacy-utility guarantees have been underestimated. We revisit these results and show that with transfer learning, strong privacy comes at only a minor cost in accuracy. For example, given public unlabeled ImageNet data, we train a CIFAR-10 model to $9 2 . 7 \%$ accuracy for a DP budget of $\varepsilon = 2$ .
35
+
36
+ Our work demonstrates that higher quality features—whether handcrafted or transferred from public data—are of paramount importance for improving the performance of private classifiers in low (private) data regimes.
37
+
38
+ Code to reproduce our experiments is available at https://github.com/ftramer/ Handcrafted-DP.
39
+
40
+ # 2 STRONG SHALLOW BASELINES FOR DIFFERENTIALLY PRIVATE LEARNING
41
+
42
+ We consider the standard central model of differential privacy (DP): a trusted party trains an ML model $f$ on a private dataset $D \in \mathcal { D }$ , and publicly releases the model. The learning algorithm $A$
43
+
44
+ satisfies $( \varepsilon , \delta )$ -differential privacy (Dwork et al., 2006a), if for any datasets $D , D ^ { \prime }$ that differ in one record, and any set of models $S$ :
45
+
46
+ $$
47
+ \operatorname* { P r } [ A ( D ) \in S ] \leq e ^ { \varepsilon } \operatorname* { P r } [ A ( D ^ { \prime } ) \in S ] + \delta .
48
+ $$
49
+
50
+ DP bounds an adversary’s ability to infer information about any individual training point from the model. Cryptography can split the trust in a central party across users (Jayaraman et al., 2018; Bonawitz et al., 2017).
51
+
52
+ Prior work has trained private deep neural networks “end-to-end” (e.g., from image pixels), with large losses in utility (Shokri & Shmatikov, 2015; Abadi et al., 2016; Papernot et al., 2020b). In contrast, we study the benefits of handcrafted features that encode priors on the learning task’s public domain (e.g., edge detectors for images). Although end-to-end neural networks outperform such features in the non-private setting, our thesis is that handcrafted features result in an easier learning task that is more amenable to privacy. We focus on computer vision, a canonical domain for private deep learning (Abadi et al., 2016; Yu et al., 2019b; Papernot et al., 2020b; Nasr et al., 2020)), with a rich literature on handcrafted features (Lowe, 1999; Dalal & Triggs, 2005; Bruna & Mallat, 2013). Our approach can be extended to handcrafted features in other domains, e.g., text or speech.
53
+
54
+ # 2.1 SCATTERING NETWORKS
55
+
56
+ We use the Scattering Network (ScatterNet) of Oyallon & Mallat (2015), a feature extractor that encodes natural image priors (e.g., invariance to small rotations and translations) using a cascade of wavelet transforms (Bruna & Mallat, 2013). As this cascade of transforms is data independent, we can obtain a differentially private classifier by privately fine-tuning a (linear) model on top of locally extracted features. In Appendix A, we discuss other candidate “non-deep” approaches that we believe to be less suitable for differentially private learning.
57
+
58
+ We use the default parameters in (Oyallon & Mallat, 2015), a ScatterNet $S ( { \pmb x } )$ of depth two with wavelets rotated along eight angles. For images of size $H \times W$ , this network extracts features of dimension $( K , H / 4 , \bar { W _ { } } / 4 )$ , with $K = 8 1$ for grayscale images, and $K = 2 4 3$ for RGB images. Note that the transform is thus expansive. More details on ScatterNets are in Appendix C.1.
59
+
60
+ # 2.2 DIFFERENTIALLY PRIVATE SCATTERNET CLASSIFIERS
61
+
62
+ To train private classifiers, we use the DP-SGD algorithm2 of Abadi et al. (2016) (see Appendix B). DP-SGD works as follows: (1) batches of expected size $B$ are sampled at random;3 (2) gradients are clipped to norm $C$ ; (3) Gaussian noise of variance $\sigma ^ { 2 } C ^ { 2 } / B ^ { 2 }$ is added to the mean gradient. DP-SGD guarantees privacy for gradients, and is thus oblivious to preprocessing applied independently to each data sample, such as the ScatterNet transform.
63
+
64
+ When training a supervised classifier on top of ScatterNet features with gradient descent, we find that normalizing the features is crucial to obtain strong performance. We consider two approaches:
65
+
66
+ • Group Normalization (Wu & He, 2018): the channels of $S ( { \pmb x } )$ are split into $G$ groups, and each is normalized to zero mean and unit variance. Data points are normalized independently so this step incurs no privacy cost.
67
+ • Data Normalization: the channels of $S ( { \pmb x } )$ are normalized by their mean and variance across the training data. This step incurs a privacy cost as the per-channel means and variances need to be privately estimated.
68
+
69
+ Table 2 shows that normalization significantly accelerates convergence of non-private linear models trained on ScatterNet features, for MNIST, Fashion-MNIST and CIFAR-10. For CIFAR-10, Data
70
+
71
+ Table 2: Effect of feature normalization on the test accuracy of non-private ScatterNet models after 20 epochs. We also report the maximal test accuracy upon convergence (mean and standard deviation over five runs).
72
+ Normalization (Test accuracy after 20 epochs)
73
+
74
+ <table><tr><td>Dataset</td><td>None</td><td>Group Normalization</td><td>Data Normalization</td><td>Maximal Accuracy</td></tr><tr><td>MNIST</td><td>95.9±0.0</td><td>99.1±0.0</td><td>99.1±0.0</td><td>99.3± 0.0</td></tr><tr><td>Fashion-MNIST</td><td>82.6 ±0.1</td><td>90.9 ± 0.1</td><td>91.0±0.2</td><td>91.5 ± 0.0</td></tr><tr><td>CIFAR-10</td><td>58.0±0.1</td><td>67.8± 0.2</td><td>70.7 ± 0.1</td><td>71.1 ± 0.0</td></tr></table>
75
+
76
+ Normalization performs significantly better than Group Normalization, so the small privacy cost of estimating channel statistics is warranted. While the maximal test accuracy of these models falls short of state-of-the-art CNNs, it exceeds all previously reported results for differentially private neural networks (even for large privacy budgets).
77
+
78
+ # 3 EVALUATING PRIVATE SCATTERNET CLASSIFIERS
79
+
80
+ We compare differentially private ScatterNet classifiers and deep learning models on MNIST (LeCun et al., 2010), Fashion-MNIST (Xiao et al., 2017) and CIFAR-10 (Krizhevsky, 2009). Many prior works have reported improvements over the DP-SGD procedure of Abadi et al. (2016) for these datasets. As we will show, ScatterNet classifiers outperform all prior approaches while making no algorithmic changes to DP-SGD. ScatterNet classifiers can thus serve as a strong canonical baseline for evaluating proposed improvements over DP-SGD in the future.
81
+
82
+ # 3.1 EXPERIMENTAL SETUP
83
+
84
+ Most prior works find the best model for a given DP budget using a hyper-parameter search. As the private training data is re-used many times, this overestimates the privacy guarantees. Private hyper-parameter search is possible at a small cost in the DP budget (Liu & Talwar, 2019), but we argue that fully accounting for this privacy leakage is hard as even our choices of architectures, optimizers, hyper-parameter ranges, etc. are informed by prior analysis of the same data. As in prior work, we thus do not account for this privacy leakage, and instead compare ScatterNet models and end-to-end CNNs with similar hyper-parameter searches. Moreover, we find that ScatterNet models are very robust to hyper-parameter changes and achieve near-optimal utility with random hyper-parameters (see Table 3). To evaluate ScatterNet models, we apply the following hyper-parameter search:
85
+
86
+ • We begin by fixing a privacy schedule. We target a moderate differential privacy budget of $( \varepsilon = \bar { 3 , } \delta = 1 0 ^ { - 5 } )$ and compute the noise scale $\sigma$ of DP-SGD so that the privacy budget is consumed after $T$ epochs. We try different values of $T$ , with larger values resulting in training for more steps but with higher noise.
87
+ • We fix the gradient clipping threshold for DP-SGD to $C = 0 . 1$ for all our experiments. Thakkar et al. (2019) suggest to vary this threshold adaptively, but we did not observe better performance by doing so.
88
+ • We try various batch sizes $B$ and base learning rates $\eta$ , with linear learning rate scaling (Goyal
89
+ et al., 2017).4
90
+ • We try both Group Normalization (Wu & He, 2018) with different choices for the number of groups, and private Data Normalization with different choices of privacy budgets (see Appendix B for details).
91
+
92
+ We perform a grid-search over all parameters as detailed in Appendix C.5. We compare our ScatterNet classifiers to the CNN models of Papernot et al. (2020b) (see Appendix C.2), which achieve the highest reported accuracy for our targeted privacy budget for all three datasets. We also perform a grid-search for these models, which reproduces the results of Papernot et al. (2020b). We use the ScatterNet implementation from Kymatio (Andreux et al., 2020), and the DP-SGD implementation in opacus (pytorch/opacus, 2020) (formerly called pytorch-dp).
93
+
94
+ ![](images/76722765eda82a7f80348b436da41ca7d2d38fe948cfbb64805ee66df04d605c.jpg)
95
+ Figure 1: Highest test accuracy achieved for each DP budget $( \varepsilon , \delta = 1 0 ^ { - 5 } )$ ) for ScatterNet classifiers and the end-to-end CNNs of Papernot et al. (2020b). We plot the mean and standard deviation across five runs.
96
+
97
+ We use a NVIDIA Titan $\mathrm { X p }$ GPU with 12GB of RAM for all our experiments. To run DP-SGD with large batch sizes $B$ , we use the “virtual batch” approach of opacus: the average of clipped gradients is accumulated over multiple “mini-batches”; once $B$ gradients have been averaged, we add noise and take a gradient update step. Code to reproduce our experiments is available at https://github.com/ftramer/Handcrafted-DP.
98
+
99
+ # 3.2 RESULTS
100
+
101
+ To measure a classifier’s accuracy for a range of privacy budgets, we compute the test accuracy as well as the DP budget $\varepsilon$ after each training epoch (with the last epoch corresponding to $\varepsilon = 3$ ). For various DP budgets $\mathit { \check { \Psi } } _ { \varepsilon , \delta } = 1 0 ^ { - 5 }$ ) used in prior work, Table 1 shows the maximal test accuracy achieved by a linear ScatterNet model in our hyper-parameter search, averaged over five runs. We also report results with CNNs trained on ScatterNet models, which are described in more detail below. Figure 1 further compares the full privacy-accuracy curves of our ScatterNets and of the CNNs of Papernot et al. (2020b). Linear models with handcrafted features significantly outperform prior results with end-to-end CNNs, for all privacy budgets $\varepsilon \le 3$ we consider. Even when prior work reports results for larger budgets, they do not exceed the accuracy of our baseline.
102
+
103
+ In particular, for CIFAR-10, we match the best CNN accuracy in (Papernot et al., 2020b)—namely $6 6 . \hat { 2 } \%$ for a budget of $\varepsilon = 7 . 5 3$ —with a much smaller budget of $\varepsilon = 2 . 6$ . This is an improvement in the DP-guarantee of $e ^ { 4 . 9 } \approx 1 3 4$ . On MNIST, we significantly improve upon CNN models, and match the results of PATE (Papernot et al., 2018), namely $9 8 . 5 \%$ accuracy at $\varepsilon = 1 . 9 7$ , in a more restricted setting (PATE uses 5,000 public unlabeled MNIST digits). In Appendix C.5, we provide the hyperparameters that result in the highest test accuracy for our target DP budget of $( \varepsilon = \mathsf { \bar { 3 } } , \delta = 1 0 ^ { - 5 } )$ . We did not consider larger privacy budgets for ScatterNet classifiers, as the accuracy we achieve at $\varepsilon = 3$ is close to the accuracy of non-private ScatterNet models (see Table 2).
104
+
105
+ As noted above, our models (and those of most prior work) are the result of a hyper-parameter search. While we do not account for the privacy cost of this search, Table 3 shows that an additional advantage of ScatterNet classifiers is an increased robustness to hyper-parameter changes. In particular, for CIFAR-10 the worst configuration for linear ScatterNet classifiers outperforms the best configuration for end-to-end CNNs. Moreover, on MNIST and Fashion-MNIST, the median accuracy of linear ScatterNet models outperforms the best end-to-end CNN.
106
+
107
+ Training CNNs on Handcrafted Features. Since linear models trained on handcrafted features outperform the privacy-utility guarantees of deep models trained end-to-end, a natural question is whether training deeper models on these features achieves even better results. We repeat the above experiment with a similar CNN model trained on ScatterNet features (see Appendix C.2). The privacy-accuracy curves for these models are in Figure 2. We find that handcrafted features also improve the utility of private deep models, a phenomenon which we analyze and explain in Section 4. On CIFAR-10, the deeper ScatterNet models even slightly outperform the linear models, while for MNIST and Fashion-MNIST the linear models perform best. This can be explained by the fact that in the non-private setting, linear ScatterNet models achieve close to state-of-the-art accuracy on MNIST and Fashion-MNIST, and thus there is little room for improvement with deeper models (see Table 11). Table 3 further shows that ScatterNet CNNs are also less sensitive to hyper-parameters than end-to-end CNNs.
108
+
109
+ Table 3: Variability across hyper-parameters. For each model, we report the minimum, maximum, median and median absolute deviation (MAD) in test accuracy (in $\%$ ) achieved for a DP budget of $( \varepsilon = 3 , \delta = 1 0 ^ { - 5 } ,$ ). The maximum accuracy below may exceed those in Table 1 and Figure 1, which are averages of five runs. SN stands for ScatterNet.
110
+
111
+ <table><tr><td></td><td colspan="4">MNIST</td><td colspan="4">Fashion-MNIST</td><td colspan="4">CIFAR-10</td></tr><tr><td>Model</td><td>Min</td><td>Max</td><td>Median</td><td>MAD</td><td>Min</td><td>Max</td><td>Median</td><td>MAD</td><td>Min</td><td>Max</td><td>Median</td><td>MAD</td></tr><tr><td>SN + Linear</td><td>96.8</td><td>98.8</td><td>98.4</td><td>0.2</td><td>85.3</td><td>89.8</td><td>88.7</td><td>0.5</td><td>59.5</td><td>67.0</td><td>65.4</td><td>0.9</td></tr><tr><td>SN +CNN</td><td>95.6</td><td>98.8</td><td>98.1</td><td>0.3</td><td>77.8</td><td>89.1</td><td>87.2</td><td>1.0</td><td>57.3</td><td>69.5</td><td>66.9</td><td>1.6</td></tr><tr><td>CNN</td><td>86.1</td><td>98.2</td><td>97.4</td><td>0.5</td><td>20.2</td><td>86.2</td><td>83.6</td><td>1.8</td><td>39.4</td><td>59.2</td><td>52.5</td><td>5.4</td></tr></table>
112
+
113
+ ![](images/62bdee377199d6d69c3d504af4fd39ce1cc5b1d74829a52eba6801829b5e7786.jpg)
114
+ Figure 2: Highest test accuracy achieved for each DP budget $( \varepsilon , \delta = 1 0 ^ { - 5 } )$ ) for linear ScatterNet classifiers, CNNs on top of ScatterNet features, and end-to-end CNNs. Shows mean and standard deviation across five runs.
115
+
116
+ Note that on each dataset we consider, end-to-end CNNs can outperform ScatterNet models when trained without privacy. Thus, end-to-end CNNs trained with DP-SGD must eventually surpass ScatterNet models for large enough privacy budgets. But this currently requires settling for weak provable privacy guarantees. On CIFAR-10 for example, ScatterNet classifiers still outperform end-to-end CNNs for $\varepsilon = 7 . 5 3$ (Papernot et al., 2020b). While the analysis of DP-SGD might not be tight, Jagielski et al. (2020) suggest that the true $\varepsilon$ guarantee of DP-SGD is at most one order of magnitude smaller than the current analysis suggests. Thus, surpassing handcrafted features for small privacy budgets on CIFAR-10 may require improvements beyond a tighter analysis of DP-SGD.
117
+
118
+ # 4 HOW DO HANDCRAFTED FEATURES HELP?
119
+
120
+ In this section, we analyze why private models with handcrafted features outperform end-to-end CNNs. We first consider the dimensionality of our models, but show that this does not explain the utility gap. Rather, we find that the higher accuracy of ScatterNet classifiers is due to their faster convergence rate when trained without noise.
121
+
122
+ Smaller models are not easier to train privately. The utility of private learning typically degrades as the model’s dimensionality increases (Chaudhuri et al., 2011; Bassily et al., 2014). This is also the case with DP-SGD which adds Gaussian noise, of scale proportional to the gradients, to each model parameter. We thus expect smaller models to be easier to train privately. Yet, as we see from Table 4, for MNIST and Fashion-MNIST the linear ScatterNet model has more parameters than the CNNs. For CIFAR-10, the end-to-end CNN we used is larger, so we repeat the experiment from Section 3 with a CNN of comparable size to the ScatterNet classifiers (see Appendix D.5). This has a minor effect on the performance of the CNN. Thus, the dimensionality of ScatterNet classifiers fails to explain their better performance.
123
+
124
+ Models with handcrafted features converge faster without privacy. DP-SGD typically requires a smaller learning rate than noiseless (clipped) SGD, so that the added noise gets averaged out over small steps. We indeed find that the optimal learning rate when training with DP-SGD is an order of magnitude lower than the optimal learning rate for training without noise addition (with gradients clipped to the same norm in both cases).
125
+
126
+ Table 4: Number of trainable parameters of our models. For CIFAR-10, we consider two different end-to-end CNN architectures (see Appendix C.2), the smaller of which has approximately as many parameters as the linear ScatterNet model.
127
+
128
+ <table><tr><td colspan="2">MNIST&amp;Fashion-MNIST</td><td>CIFAR-10</td></tr><tr><td>ScatterNet+Linear</td><td>40K</td><td>155K</td></tr><tr><td>ScatterNet+CNN</td><td>33K</td><td>187K</td></tr><tr><td>CNN</td><td>26K</td><td>551K/168K</td></tr></table>
129
+
130
+ ![](images/2af929bdcef192a8ec7be61ed64dd878bb38b710fbc9c6c3449c457c135cf5fa.jpg)
131
+ Figure 3: Convergence of DP-SGD with and without noise on CIFAR-10, for ScatterNet classifiers and end-to-end CNNs. (Left): low learning rate. (Right): high learning rate.
132
+
133
+ To understand the impact of gradient noise on the learning process, we conduct the following experiment: we select a low learning rate that is near-optimal for training models with gradient noise, and a high learning rate that is near-optimal for training without noise. For both learning rates, we train CIFAR-10 models both with and without noise (with gradient clipping in all cases). Figure 3 shows that with a high learning rate, all classifiers converge rapidly when trained without noise, but gradient noise vastly degrades performance. With a low learning rate however, training converges similarly whether we add noise or not. What distinguishes the ScatterNet models is the faster convergence rate of noiseless SGD. The experimental setup and similar qualitative results on MNIST and Fashion-MNIST are in Appendix C.6. Thus, we find that handcrafted features are beneficial for private learning because they result in a simpler learning task where training converges rapidly even with small update steps. Our analysis suggests two avenues towards obtaining higher accuracy with private deep learning:
134
+
135
+ • Faster convergence: Figure 3 suggests that faster convergence of non-private training could translate to better private learning. DP-SGD with adaptive updates (e.g., Adam (Kingma & Ba,
136
+ 2015)) indeed sometimes leads to small improvements (Papernot et al., 2020b; Chen & Lee,
137
+ 2020; Zhou et al., 2020a). Investigating private variants of second-order optimization methods is an interesting direction for future work. • More training steps (a.k.a more data): For a fixed DP-budget $\varepsilon$ and noise scale $\sigma$ , increasing the training set size $N$ allows for running more steps of DP-SGD (McMahan et al., 2018). In Section 5.1, we investigate how the collection of additional private data impacts the utility of private end-to-end models.
138
+
139
+ # 5 TOWARDS BETTER PRIVATE DEEP LEARNING
140
+
141
+ We have shown that on standard vision tasks, private learning strongly benefits from handcrafted features. Further improving our private baselines seems hard, as they come close to the maximal accuracy of ScatterNet models (see Table 2). We thus turn to other avenues for obtaining stronger privacy-utility guarantees. We focus on CIFAR-10, and discuss two natural paths towards better private models: (1) access to a larger private training set, and (2) access to a public image dataset from a different distribution (some works also consider access to public unlabeled data from the same distribution as the private data (Papernot et al., 2017; 2018; Zhu et al., 2020)).
142
+
143
+ ![](images/1026acafa710cb0c8ef6574d0ad16e92bacf81d41282a4065ed8bee8465b5094.jpg)
144
+ Figure 4: CIFAR-10 test accuracy for a training set of size $N$ and a DP budget of $( \varepsilon = 3 , \delta =$ $^ { 1 } / 2 N )$ ). For $N \mathrm { ~ > ~ } 5 0 \mathrm { K }$ , we augment CIFAR10 with pseudo-labeled Tiny Images collected by Carmon et al. (2019).
145
+
146
+ ![](images/ff7afb1249f0affcf176baad5c456972d60729366d02154137970a41d5e9ebe1.jpg)
147
+ Figure 5: Privacy-utility tradeoffs for transfer learning on CIFAR-10. We fine-tune linear models on features from a ResNeXt model trained on CIFAR-100, and from a SimCLR model trained on unlabeled ImageNet.
148
+
149
+ # 5.1 IMPROVING PRIVACY BY COLLECTING MORE DATA
150
+
151
+ We first analyze the benefits of additional private labeled data on the utility of private models. Since the privacy budget consumed by DP-SGD scales inversely with the size of the training data $N$ , collecting more data allows either to train for more steps, or to lower the amount of noise added per step—for a fixed DP budget $\varepsilon$ .
152
+
153
+ To obtain a larger dataset comparable to CIFAR-10, we use 500K pseudo-labeled Tiny Images5 (Torralba et al., 2008) collected by Carmon et al. (2019).6 We then train private models on subsets of size $1 0 , 0 0 0 \le N \le 5 5 0 , 0 0 0$ from this dataset. Figure 4 reports the highest test accuracy achieved for a privacy budget of $( \varepsilon = 3 , \delta = { ^ { 1 } \mathrm { / } } 2 N )$ ) (see Appendix C.7 for the experimental setup). We find that we need about an order-of-magnitude increase in the size of the private training dataset in order for end-to-end CNNs to outperform ScatterNet features. As we show in Appendix C.7, larger datasets allow DP-SGD to be run for more steps at a fixed privacy budget and noise level (as also observed in (McMahan et al., 2018))—thereby overcoming the slow convergence rate we uncovered in Section 4. While the increased sample complexity of private deep learning might be viable for “internet-scale” applications (e.g., language modeling across mobile devices), it is detrimental for sensitive applications with more stringent data collection requirements, such as in healthcare.
154
+
155
+ 5.2 TRANSFER LEARNING: BETTER FEATURES FROM PUBLIC DATA
156
+
157
+ Transfer learning is a natural candidate for privacy-preserving computer vision, as features learned on public image data often significantly outperform handcrafted features (Razavian et al., 2014). We first consider transfer learning from CIFAR-100 to CIFAR-10, where the labeled CIFAR-100 data is assumed public. We extract features from the penultimate layer of a ResNeXt (Xie et al., 2017) model trained on CIFAR-100. A non-private linear model trained on these features achieves $8 4 \%$ accuracy on CIFAR-10. When training linear models with DP-SGD, we get the privacy-utility curve in Figure 5 (see Appendix C.8 for details). We reach an accuracy of $8 0 . 0 \%$ at a budget of $( \varepsilon = 2 , \delta = \mathsf { \bar { 1 0 } ^ { - 5 } }$ ), a significant improvement over prior work for the same setting and privacy budget, e.g., $6 7 \%$ accuracy in (Abadi et al., 2016) and $7 2 \%$ accuracy in (Papernot et al., 2020a). The large gap between our results and prior work is mainly attributed to a better choice of source model (e.g., the transfer learning setup in (Papernot et al., 2020a) achieves $7 5 \%$ accuracy on CIFAR-10 in the non-private setting). Mirroring the work of Kornblith et al. (2019) on non-private transfer learning, we thus find that the heuristic rule “better models transfer better” also holds with differential privacy.
158
+
159
+ We further consider access to a public dataset of unlabeled images. We extract features from the penultimate layer of a SimCLR model (Chen et al., 2020a) trained on unlabeled ImageNet. A nonprivate linear model trained on these features achieves $9 5 \%$ accuracy on CIFAR-10 (using labeled ImageNet data marginally improves non-private transfer learning to CIFAR-10 (Chen et al., 2020a)). With the same setup as for CIFAR-100 (see Appendix C.8), we train a linear model to $9 2 . 7 \%$ accuracy for a DP budget of $( \varepsilon = 2 , \delta = 1 0 ^ { - 5 }$ ) (see Figure 5).
160
+
161
+ # 6 CONCLUSION AND OPEN PROBLEMS
162
+
163
+ We have demonstrated that differentially private learning benefits from “handcrafted” features that encode priors on the learning task’s domain. In particular, we have shown that private ScatterNet classifiers outperform end-to-end CNNs on MNIST, Fashion-MNIST and CIFAR-10. We have further found that handcrafted features can be surpassed when given access to more data, either a larger private training set, or a public dataset from a related domain. In addition to introducing strong baselines for evaluating future improvements to private deep learning and DP-SGD, our work suggests a number of open problems and directions for future work:
164
+
165
+ Improving DP by accelerating convergence: Our analysis in Section 4 shows that a limiting factor of private deep learning is the slow convergence rate of end-to-end deep models. While the existing literature on second-order optimization for deep learning has mainly focused on improving the overall wall-clock time of training, it suffices for DP to reduce the number of private training steps—possibly at an increase in computational cost.
166
+
167
+ Federated learning: While we have focused on a standard centralized setting for DP, our techniques can be extended to decentralized training schemes such as Federated Learning (McMahan et al., 2017; Bonawitz et al., 2017; Kairouz et al., 2019). DP has been considered for Federated Learning (Geyer et al., 2017; McMahan et al., 2018), but has also been found to significantly degrade performance in some settings (Yu et al., 2020).
168
+
169
+ Handcrafted features for ImageNet and non-vision domains: To our knowledge, there have not yet been any attempts to train ImageNet models with DP-SGD, partly due to the cost of computing per-sample gradients. While linear classifiers are unlikely to be competitive on ImageNet, handcrafted features can also help private learning by accelerating the convergence of CNNs, as we have shown in Figure 2. Notably, Oyallon et al. (2018) match the (non-private) accuracy of AlexNet (Krizhevsky et al., 2012) on ImageNet with a small six-layer CNN trained on ScatterNet features. Another interesting direction is to extend our results to domains beyond vision, e.g., with handcrafted features for text (Manning & Schutze, 1999) or speech (Andén & Mallat, 2014).
170
+
171
+ # ACKNOWLEDGEMENTS
172
+
173
+ We thank: Mani Malek, Ilya Mironov, Vaishaal Shankar and Ludwig Schmidt for fruitful discussions about differential privacy and computer vision baselines, and comments on early drafts of this paper; Nicolas Papernot and Shuang Song for helping us reproduce the results in (Papernot et al., 2020b); Nicolas Papernot for comments on early drafts of this paper; Edouard Oyallon for enlightening discussions about Scattering networks.
174
+
175
+ # REFERENCES
176
+
177
+ tensorflow/privacy, 2019. URL https://github.com/tensorflow/privacy.
178
+
179
+ pytorch/opacus, 2020. URL https://github.com/pytorch/opacus.
180
+
181
+ Martin Abadi, Andy Chu, Ian Goodfellow, H Brendan McMahan, Ilya Mironov, Kunal Talwar, and Li Zhang. Deep learning with differential privacy. In Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, pp. 308–318, 2016.
182
+
183
+ Joakim Andén and Stéphane Mallat. Deep scattering spectrum. IEEE Transactions on Signal Processing, 62 (16):4114–4128, 2014.
184
+
185
+ Mathieu Andreux, Tomás Angles, Georgios Exarchakis, Roberto Leonarduzzi, Gaspar Rochette, Louis Thiry, John Zarka, Stéphane Mallat, Joakim Andén, Eugene Belilovsky, Joan Bruna, Vincent Lostanlen, Matthew J. Hirn, Edouard Oyallon, Sixin Zhang, Carmine Cella, and Michael Eickenberg. Kymatio: Scattering transforms in Python. Journal of Machine Learning Research, 21(60):1–6, 2020.
186
+
187
+ Sanjeev Arora, Simon S Du, Zhiyuan Li, Ruslan Salakhutdinov, Ruosong Wang, and Dingli Yu. Harnessing the power of infinitely wide deep nets on small-data tasks. In International Conference on Learning Representations (ICLR), 2020.
188
+
189
+ Eugene Bagdasaryan, Omid Poursaeed, and Vitaly Shmatikov. Differential privacy has disparate impact on model accuracy. In Advances in Neural Information Processing Systems, pp. 15479–15488, 2019.
190
+
191
+ Raef Bassily, Adam Smith, and Abhradeep Thakurta. Private empirical risk minimization: Efficient algorithms and tight error bounds. In 2014 IEEE 55th Annual Symposium on Foundations of Computer Science, pp. 464–473. IEEE, 2014.
192
+
193
+ Keith Bonawitz, Vladimir Ivanov, Ben Kreuter, Antonio Marcedone, H Brendan McMahan, Sarvar Patel, Daniel Ramage, Aaron Segal, and Karn Seth. Practical secure aggregation for privacy-preserving machine learning. In ACM SIGSAC Conference on Computer and Communications Security (CCS), pp. 1175–1191. ACM, 2017.
194
+
195
+ Joan Bruna and Stéphane Mallat. Invariant scattering convolution networks. IEEE transactions on pattern analysis and machine intelligence, 35(8):1872–1886, 2013.
196
+
197
+ Zhiqi Bu, Jinshuo Dong, Qi Long, and Weijie J Su. Deep learning with Gaussian differential privacy. arXiv preprint arXiv:1911.11607, 2019.
198
+
199
+ Nicholas Carlini, Chang Liu, Úlfar Erlingsson, Jernej Kos, and Dawn Song. The secret sharer: Evaluating and testing unintended memorization in neural networks. In 28th USENIX Security Symposium, pp. 267–284, 2019.
200
+
201
+ Nicholas Carlini, Florian Tramer, Eric Wallace, Matthew Jagielski, Ariel Herbert-Voss, Katherine Lee, Adam Roberts, Tom Brown, Dawn Song, Ulfar Erlingsson, Alina Oprea, and Colin Raffel. Extracting training data from large language models. arXiv preprint arXiv:2012.07805, 2020.
202
+
203
+ Yair Carmon, Aditi Raghunathan, Ludwig Schmidt, John C Duchi, and Percy S Liang. Unlabeled data improves adversarial robustness. In Advances in Neural Information Processing Systems, pp. 11192–11203, 2019.
204
+
205
+ Kamalika Chaudhuri, Claire Monteleoni, and Anand D Sarwate. Differentially private empirical risk minimization. Journal of Machine Learning Research, 12(3), 2011.
206
+
207
+ Chen Chen and Jaewoo Lee. Stochastic adaptive line search for differentially private optimization. arXiv preprint arXiv:2008.07978, 2020.
208
+
209
+ Mia Xu Chen, Benjamin N Lee, Gagan Bansal, Yuan Cao, Shuyuan Zhang, Justin Lu, Jackie Tsay, Yinan Wang, Andrew M Dai, Zhifeng Chen, et al. Gmail smart compose: Real-time assisted writing. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 2287–2295, 2019.
210
+
211
+ Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. arXiv preprint arXiv:2002.05709, 2020a.
212
+
213
+ Ting Chen, Simon Kornblith, Kevin Swersky, Mohammad Norouzi, and Geoffrey Hinton. Big self-supervised models are strong semi-supervised learners. arXiv preprint arXiv:2006.10029, 2020b.
214
+
215
+ Adam Coates and Andrew Y Ng. Learning feature representations with k-means. In Neural networks: Tricks of the trade, pp. 561–580. Springer, 2012.
216
+
217
+ Navneet Dalal and Bill Triggs. Histograms of oriented gradients for human detection. In 2005 IEEE computer society conference on computer vision and pattern recognition (CVPR’05), volume 1, pp. 886–893. IEEE, 2005.
218
+
219
+ Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In Conference on Computer Vision and Pattern Recognition (CVPR), pp. 248–255. IEEE, 2009.
220
+
221
+ Cynthia Dwork, Krishnaram Kenthapadi, Frank McSherry, Ilya Mironov, and Moni Naor. Our data, ourselves: Privacy via distributed noise generation. In Annual International Conference on the Theory and Applications of Cryptographic Techniques, pp. 486–503. Springer, 2006a.
222
+
223
+ Cynthia Dwork, Frank McSherry, Kobbi Nissim, and Adam Smith. Calibrating noise to sensitivity in private data analysis. In Theory of cryptography conference, pp. 265–284. Springer, 2006b.
224
+
225
+ Cynthia Dwork, Vitaly Feldman, Moritz Hardt, Toniann Pitassi, Omer Reingold, and Aaron Leon Roth. Preserving statistical validity in adaptive data analysis. In Proceedings of the forty-seventh annual ACM symposium on Theory of computing, pp. 117–126, 2015.
226
+
227
+ Vitaly Feldman. Does learning require memorization? a short tale about a long tail. In Proceedings of the 52nd Annual ACM SIGACT Symposium on Theory of Computing, pp. 954–959, 2020.
228
+
229
+ Vitaly Feldman and Tijana Zrnic. Individual privacy accounting via a Rényi filter. arXiv preprint arXiv:2008.11193, 2020.
230
+
231
+ Vitaly Feldman, Ilya Mironov, Kunal Talwar, and Abhradeep Thakurta. Privacy amplification by iteration. In 2018 IEEE 59th Annual Symposium on Foundations of Computer Science (FOCS), pp. 521–532. IEEE, 2018.
232
+
233
+ Robin C Geyer, Tassilo Klein, and Moin Nabi. Differentially private federated learning: A client level perspective. arXiv preprint arXiv:1712.07557, 2017.
234
+
235
+ Priya Goyal, Piotr Dollár, Ross Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, Andrew Tulloch, Yangqing Jia, and Kaiming He. Accurate, large minibatch SGD: Training ImageNet in 1 hour. arXiv preprint arXiv:1706.02677, 2017.
236
+
237
+ Arthur Jacot, Franck Gabriel, and Clément Hongler. Neural tangent kernel: Convergence and generalization in neural networks. In Advances in neural information processing systems, pp. 8571–8580, 2018.
238
+
239
+ Matthew Jagielski, Jonathan Ullman, and Alina Oprea. Auditing differentially private machine learning: How private is private SGD? arXiv preprint arXiv:2006.07709, 2020.
240
+
241
+ Bargav Jayaraman, Lingxiao Wang, David Evans, and Quanquan Gu. Distributed learning without distress: Privacy-preserving empirical risk minimization. In Advances in Neural Information Processing Systems, pp. 6343–6354, 2018.
242
+
243
+ Peter Kairouz, H Brendan McMahan, Brendan Avent, Aurélien Bellet, Mehdi Bennis, Arjun Nitin Bhagoji, Keith Bonawitz, Zachary Charles, Graham Cormode, Rachel Cummings, et al. Advances and open problems in federated learning. arXiv preprint arXiv:1912.04977, 2019.
244
+
245
+ Peter Kairouz, Mónica Ribero, Keith Rush, and Abhradeep Thakurta. Dimension independence in unconstrained private erm via adaptive preconditioning. arXiv preprint arXiv:2008.06570, 2020.
246
+
247
+ Daniel Kifer, Adam Smith, and Abhradeep Thakurta. Private convex empirical risk minimization and highdimensional regression. In Conference on Learning Theory, pp. 25–1, 2012.
248
+
249
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015.
250
+
251
+ Simon Kornblith, Jonathon Shlens, and Quoc V Le. Do better imagenet models transfer better? In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2661–2671, 2019.
252
+
253
+ Alex Krizhevsky. Learning multiple layers of features from tiny images, 2009.
254
+
255
+ Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pp. 1097–1105, 2012.
256
+
257
+ Yann LeCun, Corinna Cortes, and CJ Burges. MNIST handwritten digit database. ATT Labs, 2010.
258
+
259
+ Zhiyuan Li, Ruosong Wang, Dingli Yu, Simon S Du, Wei Hu, Ruslan Salakhutdinov, and Sanjeev Arora. Enhanced convolutional neural tangent kernels. arXiv preprint arXiv:1911.00809, 2019.
260
+
261
+ Jingcheng Liu and Kunal Talwar. Private selection from private candidates. In Proceedings of the 51st Annual ACM SIGACT Symposium on Theory of Computing, pp. 298–309, 2019.
262
+
263
+ David G Lowe. Object recognition from local scale-invariant features. In Proceedings of the seventh IEEE international conference on computer vision, volume 2, pp. 1150–1157. Ieee, 1999.
264
+
265
+ Alexander Selvikvåg Lundervold and Arvid Lundervold. An overview of deep learning in medical imaging focusing on MRI. Zeitschrift für Medizinische Physik, 29(2):102–127, 2019.
266
+
267
+ Christopher Manning and Hinrich Schutze. Foundations of statistical natural language processing. 1999.
268
+
269
+ Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. Communicationefficient learning of deep networks from decentralized data. In Artificial Intelligence and Statistics, pp. 1273–1282. PMLR, 2017.
270
+
271
+ H Brendan McMahan, Daniel Ramage, Kunal Talwar, and Li Zhang. Learning differentially private recurrent language models. In International Conference on Learning Representations (ICLR), 2018.
272
+
273
+ Ilya Mironov. Rényi differential privacy. In 2017 IEEE 30th Computer Security Foundations Symposium (CSF), pp. 263–275. IEEE, 2017.
274
+
275
+ Ilya Mironov, Kunal Talwar, and Li Zhang. Rényi differential privacy of the sampled Gaussian mechanism. arXiv preprint arXiv:1908.10530, 2019.
276
+
277
+ Milad Nasr, Reza Shokri, and Amir houmansadr. Improving deep learning with differential privacy using gradient encoding and denoising. arXiv preprint arXiv:2007.11524, 2020.
278
+
279
+ Kobbi Nissim, Sofya Raskhodnikova, and Adam Smith. Smooth sensitivity and sampling in private data analysis. In Proceedings of the thirty-ninth annual ACM symposium on Theory of computing, pp. 75–84, 2007.
280
+
281
+ Edouard Oyallon and Stéphane Mallat. Deep roto-translation scattering for object classification. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2865–2873, 2015.
282
+
283
+ Edouard Oyallon, Sergey Zagoruyko, Gabriel Huang, Nikos Komodakis, Simon Lacoste-Julien, Matthew Blaschko, and Eugene Belilovsky. Scattering networks for hybrid representation learning. IEEE transactions on pattern analysis and machine intelligence, 41(9):2208–2221, 2018.
284
+
285
+ Nicolas Papernot, Martín Abadi, Ulfar Erlingsson, Ian Goodfellow, and Kunal Talwar. Semi-supervised knowledge transfer for deep learning from private training data. In International Conference on Learning Representations (ICLR), 2017.
286
+
287
+ Nicolas Papernot, Shuang Song, Ilya Mironov, Ananth Raghunathan, Kunal Talwar, and Úlfar Erlingsson. Scalable private learning with PATE. In International Conference on Learning Representations (ICLR), 2018.
288
+
289
+ Nicolas Papernot, Steve Chien, Shuang Song, Abhradeep Thakurta, and Ulfar Erlingsson. Making the shoe fit: Architectures, initializations, and tuning for learning with privacy, 2020a. URL https://openreview. net/forum?id $=$ rJg851rYwH.
290
+
291
+ Nicolas Papernot, Abhradeep Thakurta, Shuang Song, Steve Chien, and Úlfar Erlingsson. Tempered sigmoid activations for deep learning with differential privacy. In Theory and Practice of Differential Privacy, 2020b.
292
+
293
+ Vinay Uday Prabhu and Abeba Birhane. Large image datasets: A pyrrhic win for computer vision? arXiv preprint arXiv:2006.16923, 2020.
294
+
295
+ Ali Rahimi and Benjamin Recht. Random features for large-scale kernel machines. In Advances in neural information processing systems, pp. 1177–1184, 2008.
296
+
297
+ Ali Sharif Razavian, Hossein Azizpour, Josephine Sullivan, and Stefan Carlsson. CNN features off-the-shelf: an astounding baseline for recognition. In Computer Vision and Pattern Recognition Workshops (CVPRW), 2014 IEEE Conference on, pp. 512–519. IEEE, 2014.
298
+
299
+ Benjamin Recht, Rebecca Roelofs, Ludwig Schmidt, and Vaishaal Shankar. Do CIFAR-10 classifiers generalize to CIFAR-10? arXiv preprint arXiv:1806.00451, 2018.
300
+
301
+ Benjamin Rubinstein, Peter Bartlett, Ling Huang, and Nina Taft. Learning in a large function space: Privacypreserving mechanisms for SVM learning. Journal of Privacy and Confidentiality, 4(1):65–100, 2012.
302
+
303
+ Vaishaal Shankar, Alex Fang, Wenshuo Guo, Sara Fridovich-Keil, Ludwig Schmidt, Jonathan Ragan-Kelley, and Benjamin Recht. Neural kernels without tangents. In International Conference on Machine Learning (ICML), 2020.
304
+
305
+ Reza Shokri and Vitaly Shmatikov. Privacy-preserving deep learning. In Proceedings of the 22nd ACM SIGSAC conference on computer and communications security, pp. 1310–1321, 2015.
306
+
307
+ Reza Shokri, Marco Stronati, Congzheng Song, and Vitaly Shmatikov. Membership inference attacks against machine learning models. In 2017 IEEE Symposium on Security and Privacy (SP), pp. 3–18. IEEE, 2017.
308
+
309
+ Congzheng Song, Thomas Ristenpart, and Vitaly Shmatikov. Machine learning models that remember too much. In Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, pp. 587–601, 2017.
310
+
311
+ Om Thakkar, Galen Andrew, and H Brendan McMahan. Differentially private learning with adaptive clipping. arXiv preprint arXiv:1905.03871, 2019.
312
+
313
+ Antonio Torralba, Rob Fergus, and William T Freeman. 80 million tiny images: A large data set for nonparametric object and scene recognition. IEEE transactions on pattern analysis and machine intelligence, 30(11):1958– 1970, 2008.
314
+
315
+ Yu-Xiang Wang, Borja Balle, and Shiva Prasad Kasiviswanathan. Subsampled Rényi differential privacy and analytical moments accountant. Proceedings of Machine Learning Research, 89:1226–1235, 16–18 Apr 2019.
316
+
317
+ Shaomei Wu, Hermes Pique, and Jeffrey Wieland. Using artificial intelligence to help blind people ‘see’ Facebook. https://about.fb.com/news/2016/04/using-artificial-intelligenceto-help-blind-people-see-facebook/, 2016.
318
+
319
+ Yuxin Wu and Kaiming He. Group normalization. In Proceedings of the European conference on computer vision (ECCV), pp. 3–19, 2018.
320
+
321
+ Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms. arXiv preprint arXiv:1708.07747, 2017.
322
+
323
+ Saining Xie, Ross Girshick, Piotr Dollár, Zhuowen Tu, and Kaiming He. Aggregated residual transformations for deep neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1492–1500, 2017.
324
+
325
+ Da Yu, Huishuai Zhang, Wei Chen, Tie-Yan Liu, and Jian Yin. Gradient perturbation is underrated for differentially private convex optimization. arXiv preprint arXiv:1911.11363, 2019a.
326
+
327
+ Lei Yu, Ling Liu, Calton Pu, Mehmet Emre Gursoy, and Stacey Truex. Differentially private model publishing for deep learning. In 2019 IEEE Symposium on Security and Privacy (SP), pp. 332–349. IEEE, 2019b.
328
+
329
+ Tao Yu, Eugene Bagdasaryan, and Vitaly Shmatikov. Salvaging federated learning by local adaptation. arXiv preprint arXiv:2002.04758, 2020.
330
+
331
+ Yingxue Zhou, Xiangyi Chen, Mingyi Hong, Zhiwei Steven Wu, and Arindam Banerjee. Private stochastic nonconvex optimization: Adaptive algorithms and tighter generalization bounds. arXiv preprint arXiv:2006.13501, 2020a.
332
+
333
+ Yingxue Zhou, Zhiwei Steven Wu, and Arindam Banerjee. Bypassing the ambient dimension: Private SGD with gradient subspace identification. arXiv preprint arXiv:2007.03813, 2020b.
334
+
335
+ Yuqing Zhu, Xiang Yu, Manmohan Chandraker, and Yu-Xiang Wang. Private-kNN: Practical differential privacy for computer vision. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11854–11862, 2020.
336
+
337
+ # A WHY SCATTERNETS?
338
+
339
+ In this paper, we propose to use the ScatterNet features of Oyallon & Mallat (2015) as a basis for shallow differentially private vision classifiers. We briefly discuss a number of other shallow approaches that produce competitive results for canonical vision tasks, but which appear less suitable for private learning.
340
+
341
+ Unsupervised feature dictionaries. Coates & $\mathrm { N g }$ (2012) achieve above $8 0 \%$ test accuracy on CIFAR-10 with linear models trained on top of a dictionary of features extracted from a mixture of image patches. Their approach relies on a combination of many ‘tricks”, including data normalization, data whitening, tweaks to standard Gaussian-Mixture-Model (GMM) algorithms, feature selection, etc. While it is conceivable that each of these steps could be made differentially private, we opt here for a much simpler unlearned baseline that is easier to analyze and to apply to a variety of different tasks. We note that existing work on differentially-private learning of mixtures (e.g., (Nissim et al., 2007)) has mainly focused on asymptotic guarantees, and we are not aware of any exiting algorithms that have been evaluated on high-dimensional datasets such as CIFAR-10.
342
+
343
+ Kernel Machines. Recent work on Neural Tangent Kernels (Jacot et al., 2018) has shown that the performance of deep neural networks on CIFAR-10 could be matched by specialized kernel methods (Li et al., 2019; Arora et al., 2020; Shankar et al., 2020). Unfortunately, private learning with non-linear kernels is intractable in general (Chaudhuri et al., 2011; Rubinstein et al., 2012). Chaudhuri et al. (2011) propose to obtain private classifiers by approximating kernels using random features (Rahimi & Recht, 2008), but the very high dimensionality of the resulting learning problem makes it challenging to outperform our handcrafted features baseline. Indeed, we had originally considered a differentially-private variant of the random-feature CIFAR-10 classifier proposed in (Recht et al., 2018), but found the model’s high dimensionality (over 10 million features) to be detrimental to private learning.
344
+
345
+ # B DP-SGD, RDP AND PRIVATE DATA NORMALIZATION
346
+
347
+ Throughout this work, we use the DP-SGD algorithm of Abadi et al. (2016):
348
+
349
+ # Algorithm 1: DP-SGD (Abadi et al., 2016)
350
+
351
+ input :Data $\{ \pmb { x } _ { 1 } \ldots , \pmb { x } _ { N } \}$ , learning rate $\eta$ , noise scale $\sigma$ , batch size $B$ , gradient norm bound $C$ , epochs $T$
352
+ 1 Initialize $\pmb { \theta } _ { 0 }$ randomly for $t \in [ T \cdot ^ { N } / B ]$ do
353
+ 2 Sample a batch $\mathbf { \delta } _ { B _ { t } }$ by selecting each $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ independently with probability $B / _ { N }$
354
+ 3 For each $\pmb { x } _ { i } \in \pmb { B } _ { t }$ : $\pmb { g } _ { t } ( \pmb { x } _ { i } ) \nabla _ { \pmb { \theta } _ { t } } L ( \pmb { \theta } _ { t } , \pmb { x } _ { i } )$ // compute per-sample gradients
355
+ 4 $\tilde { g } _ { t } ( \pmb { x } _ { i } ) \gets g _ { t } ( \pmb { x } _ { i } ) \cdot \operatorname* { m i n } ( 1 , ^ { C } / | | g _ { t } ( \pmb { x } _ { i } ) | | _ { 2 } )$ // clip gradients
356
+ 5 $\begin{array} { r } { \tilde { g } _ { t } \gets \frac { 1 } { B } \Big ( \sum _ { \pmb { x } _ { i } \in B _ { t } } \tilde { g } _ { t } ( \pmb { x } _ { i } ) + \mathcal { N } ( 0 , \sigma ^ { 2 } C ^ { 2 } I ) \Big ) } \end{array}$ // add noise to average gradient with Gaussian mechanism
357
+ 6 $\begin{array} { r } { \pmb { \theta } _ { t + 1 } \pmb { \theta } _ { t } - \eta \tilde { \pmb { g } } _ { t } } \\ { \mathbf { p u t } : \pmb { \theta } _ { T N / B } } \end{array}$ // SGD step out
358
+
359
+ Definition B.1 (Rényi Divergence). For two probability distributions $P$ and $Q$ defined over a range $\mathcal { R }$ , the Rényi divergence of order $\alpha > 1$ is
360
+
361
+ $$
362
+ D _ { \alpha } ( P \| Q ) : = \frac { 1 } { \alpha - 1 } \log \underset { x \sim Q } { \mathbb { E } } \left( \frac { P ( x ) } { Q ( x ) } \right) ^ { \alpha } .
363
+ $$
364
+
365
+ Definition B.2 ( $( \alpha , \varepsilon )$ -RDP (Mironov, 2017)). A randomized mechanism $f : \mathcal { D } \mathcal { R }$ is said to have $\varepsilon$ -Rényi differential privacy of order $\alpha$ , or $( \alpha , \varepsilon )$ -RDP for short, if for any adjacent $D , D ^ { \prime } \in { \mathcal { D } }$ it holds that
366
+
367
+ $$
368
+ D _ { \alpha } ( f ( D ) \| f ( D ^ { \prime } ) ) \leq \varepsilon .
369
+ $$
370
+
371
+ To analyze the privacy guarantees of DP-SGD, we numerically compute $D _ { \alpha } ( f ( D ) \| f ( D ^ { \prime } ) )$ for a range of orders $\alpha$ (Mironov et al., 2019; Wang et al., 2019) in each training step, where $D$ and $D ^ { \prime }$ are training sets that differ in a single element. To obtain privacy guarantees for $t$ training steps, we use the composition properties of RDP:
372
+
373
+ Lemma B.3 (Adaptive composition of RDP (Mironov et al., 2019)). Let $f : \mathcal { D } \mathcal { R } _ { 1 }$ be $( \alpha , \varepsilon _ { 1 } )$ -RDP and $g : \mathcal { R } _ { 1 } \times \mathcal { D } \mathcal { R } _ { 2 }$ be $( \alpha , \varepsilon _ { 2 } )$ -RDP, then the mechanism defined as $( X , Y )$ , where $X \sim f ( D )$ and $Y \sim g ( X , D )$ , satisfies $( \alpha , \varepsilon _ { 1 } + \varepsilon _ { 2 } )$ -RDP.
374
+
375
+ Finally, the RDP guarantees of the full DP-SGD procedure can be converted into a $( \varepsilon , \delta )$ -DP guarantee:
376
+
377
+ Lemma B.4 (From RDP to $( \varepsilon , \delta )$ -DP (Mironov et al., 2019)). If $f$ is an $( \alpha , \varepsilon )$ -RDP mechanism, it also satisfies $\begin{array} { r } { ( \varepsilon + \frac { \log { 1 / \delta } } { \alpha - 1 } , \delta ) } \end{array}$ -DP for any $0 < \delta < 1$ .
378
+
379
+ Private Data Normalization. In order to apply Data Normalization to the ScatterNet features (which greatly improves convergence, especially on CIFAR-10), we use the PrivDataNorm procedure in Algorithm 2 to compute private estimates of the per-channel mean and variance of the ScatterNet features.
380
+
381
+ # Algorithm 2: Private Data Normalization
382
+
383
+ Function PrivChannelMean(data $\pmb { D } \in \mathbb { R } ^ { N \times K \times H \times W }$ , norm bound $C$ , noise scale $\sigma _ { n o r m }$
384
+
385
+ <table><tr><td>1</td><td>For1≤i≤ N: μi ← En,ω [D(i,,h,w)] ∈ RK // compute per-channel means for each sample μi ← μi · min(1,C/μill2) // clip each sample&#x27;s per-channel</td></tr></table>
386
+
387
+ In order to obtain tight privacy guarantees for the full training procedure (i.e., privacy-preserving Data Normalization followed by DP-SGD), we first derive the RDP guarantees of PrivDataNorm:
388
+
389
+ Claim B.5. The PrivDataNorm procedure is $( \alpha , \alpha / \sigma _ { n o r m } ^ { 2 } )$ -RDP for any $\alpha > 1$ .
390
+
391
+ The above claim follows from the RDP guarantees of the Gaussian mechanism in (Mironov, 2017), together with the composition properties of RDP in Lemma B.3 above.
392
+
393
+ Finally, given an RDP guarantee of $( \alpha , \varepsilon _ { 1 } )$ for PrivDataNorm, and an RDP guarantee of $( \alpha , \varepsilon _ { 2 } )$ for DP-SGD, we apply Lemma B.3 to obtain an RDP guarantee of $( \alpha , \varepsilon _ { 1 } + \varepsilon _ { 2 } )$ , and convert to a DP guarantee using Lemma B.4.
394
+
395
+ # C EXPERIMENTAL SETUP
396
+
397
+ # C.1 SCATTERING NETWORKS
398
+
399
+ We briefly review the scattering network (ScatterNet) of Oyallon & Mallat (2015). Consider an input $_ { \textbf { \em x } }$ . The output of a scattering network of depth $J$ is a feature vector given by
400
+
401
+ $$
402
+ S ( { \pmb x } ) : = A _ { J } \left| W _ { 2 } \left| W _ { 1 } { \pmb x } \right| \right| ,
403
+ $$
404
+
405
+ where the operators $W _ { 1 }$ and $W _ { 2 }$ are complex-valued wavelet transforms, each followed by a non-linear complex modulus, and the final operator $A$ performs spatial averaging over patches of $2 ^ { J }$ features. Both wavelet transforms $W _ { 1 }$ and $W _ { 2 }$ are linear operators that compute a cascade of convolutions with filters from a fixed family of wavelets. For an input image of spatial dimensions $H \times W$ , the ScatterNet is aptensor of dimension $( K , { \frac { H } { 2 ^ { J } } } , { \frac { W } { 2 ^ { J } } } )$ h of the image’s color channe. The channel dimensionality $K$ y to yield an outpthe network depth $J$ $K / 2 ^ { 2 J } = O ( 1 )$ approximately preserves the data dimensionality).
406
+
407
+ For all experiments, we use the default parameters proposed by Oyallon & Mallat (2015), namely a Scattering Network of depth $J = 2$ , consisting of wavelet filters rotated along eight angles. For an an input image of spatial dimensions $H \times W$ , this configuration produces an output of dimension $( K , \bar { H } / 4 , W / 4 )$ , with $K = 8 1$ for grayscale images, and $K = 2 4 3$ for RGB images.
408
+
409
+ # C.2 MODEL ARCHITECTURES
410
+
411
+ Below, we describe the ScatterNet+Linear, ScatterNet+CNN and end-to-end CNN architectures used in Section 3 and Section 4. The CNN architectures are adapted from Papernot et al. (2020b).
412
+
413
+ Linear ScatterNet Classifiers. The default Scattering Network of Oyallon & Mallat (2015) extracts feature vectors of size (81, 7, 7) for MNIST and Fashion-MNIST and of size (243, 8, 8) for CIFAR-10. We then train a standard logistic regression classifier (with per-class bias) on top of these features, as summarized below:
414
+
415
+ Table 5: Size of linear ScatterNet classifiers.
416
+
417
+ <table><tr><td>Dataset</td><td>Image size</td><td>Linear ScatterNet size</td></tr><tr><td>MNIST</td><td>28×28</td><td>3969 ×10</td></tr><tr><td>Fashion-MNIST</td><td>28×28</td><td>3969 ×10</td></tr><tr><td>CIFAR-10</td><td>32 ×32×3</td><td>15552 ×10</td></tr></table>
418
+
419
+ End-to-end CNNs. We use the CNN architectures proposed by Papernot et al. (2020b), which were found as a result of an architecture search tailored to DP-SGD.7 Notably, these CNNs are quite small (since the noise of DP-SGD grows with the model’s dimensionality) and use Tanh activations, which Papernot et al. (2020b) found to outperform the more common ReLU activations. For the experiments in Section 4, we also consider a smaller CIFAR-10 model, with a dimensionality comparable to the linear ScatterNet classifier. While the standard model has six convolutional layers of size 32-32-64-64-128-128, the smaller model has five convolutional layers of size 16-16-32-32-64 (with max-pooling after the $2 ^ { \mathrm { n d } }$ , $4 ^ { \mathrm { t h } }$ and $5 ^ { \mathrm { t h } }$ convolution).
420
+
421
+ Table 6: End-to-end CNN model for MNIST and Fashion-MNIST, with Tanh activations (Papernot et al., 2020b).
422
+
423
+ <table><tr><td>Layer</td><td>Parameters</td></tr><tr><td>Convolution</td><td>16 filters of 8x8,stride 2,padding 2</td></tr><tr><td>Max-Pooling</td><td>2x2,stride 1</td></tr><tr><td>Convolution</td><td>32 filters of 4x4,stride 2,padding O</td></tr><tr><td>Max-Pooling</td><td>2x2,stride 1</td></tr><tr><td>Fully connected</td><td>32 units</td></tr><tr><td>Fully connected</td><td>10 units</td></tr></table>
424
+
425
+ Table 7: End-to-end CNN model for CIFAR-10, with Tanh activations (Papernot et al., 2020b). In Section 4, we also use a smaller variant of this architecture with five convolutional layers of 16-16-32-32-64 filters.
426
+
427
+ <table><tr><td>Layer</td><td>Parameters</td></tr><tr><td>Convolution x2</td><td>32 filters of 3x3,stride 1,padding 1</td></tr><tr><td>Max-Pooling</td><td>2x2,stride 2</td></tr><tr><td>Convolution x2 Max-Pooling</td><td>64 filters of 3x3,stride 1, padding 1 2x2,stride 2</td></tr><tr><td>Convolution x2</td><td>128 filters of 3x3,stride 1,padding 1</td></tr><tr><td>Max-Pooling</td><td>2x2,stride 2</td></tr><tr><td>Fully connected</td><td>128 units</td></tr><tr><td>Fully connected</td><td>10 units</td></tr></table>
428
+
429
+ ScatterNet CNNs. To fine-tune CNNs on top of ScatterNet features, we adapt the CNNs from Table 6 and Table 7. As the ScatterNet feature vector is larger than the input image $7 8 4 3 9 6 9$ features for MNIST and Fashion-MNIST, and $3 0 7 2 1 5 5 5 2$ features for CIFAR-10), we use smaller CNN models. For MNIST and Fashion MNIST, we reduce the number of convolutional filters. For CIFAR-10, we reduce the network depth from 8 to 3, which results in a model with approximately as many parameters as the linear ScatterNet classifier.
430
+
431
+ Table 8: CNN model fine-tuned on ScatterNet features for MNIST and Fashion-MNIST, with Tanh activations.
432
+
433
+ <table><tr><td>Layer</td><td>Parameters</td></tr><tr><td>Convolution</td><td>16 filters of 3x3,stride 2,padding 1</td></tr><tr><td>Max-Pooling</td><td>2x2,stride 1</td></tr><tr><td>Convolution</td><td>32 filters of 3x3,stride1,padding 1</td></tr><tr><td>Max-Pooling</td><td>2x2,stride 1</td></tr><tr><td>Fully connected</td><td>32 units</td></tr><tr><td>Fully connected</td><td>10 units</td></tr></table>
434
+
435
+ Table 9: CNN model on ScatterNet features for CIFAR-10, with Tanh activations. In Section 4, we also use a smaller variant of this model with four convolutional layers of 16-16-32-32 filters.
436
+
437
+ <table><tr><td>Layer</td><td>Parameters</td></tr><tr><td>Convolution</td><td>64 filters of 3x3,stride 1, padding 1</td></tr><tr><td>Max-Pooling</td><td>2x2, stride 2</td></tr><tr><td>Convolution</td><td>64 filters of 3x3,stride1,padding 1</td></tr><tr><td>Max-Pooling</td><td>2x2,stride 2</td></tr><tr><td>Fully connected</td><td>10 units</td></tr></table>
438
+
439
+ # C.3 EFFECT OF NORMALIZATION
440
+
441
+ To evaluate the effect of feature normalization in Table 2, we train linear models on ScatterNet features using DP-SGD without noise $( \sigma = 0$ ). We train one model without feature normalization, one with Data Normalization, and three with Group Normalization (Wu & He, 2018) with $G \in \{ 9 , 2 7 , 8 1 \}$ groups. For Group Normalization, Table 2 reports results for the best choice of groups. The remaining hyper-parameters are given below.
442
+
443
+ Table 10: Hyper-parameters for evaluating the effect of feature normalization in Table 2.
444
+
445
+ <table><tr><td>Parameter</td><td>MNIST</td><td>Fashion-MNIST</td><td>CIFAR-10</td></tr><tr><td>Gradient clipping norm C</td><td>0.1</td><td>0.1</td><td>0.1</td></tr><tr><td>Momentum</td><td>0.9</td><td>0.9</td><td>0.9</td></tr><tr><td>Epochs T</td><td>20</td><td>20</td><td>20</td></tr><tr><td>Batch size B</td><td>512</td><td>512</td><td>512</td></tr><tr><td>Learning rate n</td><td>2</td><td>4</td><td>2</td></tr><tr><td>Best choice of groups G</td><td>27</td><td>81</td><td>27</td></tr></table>
446
+
447
+ # C.4 NON-PRIVATE MODEL PERFORMANCE
448
+
449
+ For each of the model architectures described in Appendix C.2, we report the best achieved test accuracy without privacy, and without any other form of explicit regularization. For MNIST and Fashion-MNIST, fine-tuning a linear model or a CNN on top of ScatterNet features results in similar performance, whereas on CIFAR-10, the CNN performs slightly better. For Fashion-MNIST the end-to-end CNN performs slightly worse than the linear model (mainly due to a lack of regularization). For CIFAR-10, the end-to-end CNN significantly outperforms the ScatterNet models.
450
+
451
+ Table 11: Test accuracy $( \mathrm { i n \% } )$ ) for models trained without privacy. Average and standard deviation are computed over five runs.
452
+
453
+ <table><tr><td>Dataset</td><td>ScatterNet+Linear</td><td>ScatterNet+CNN</td><td>CNN</td></tr><tr><td>MNIST</td><td>99.3 ±0.0</td><td>99.2 ± 0.0</td><td>99.2 ±0.0</td></tr><tr><td>Fashion-MNIST</td><td>91.5 ± 0.0</td><td>91.5 ± 0.2</td><td>90.1±0.2</td></tr><tr><td>CIFAR-10</td><td>71.1 ± 0.0</td><td>73.8 ± 0.3</td><td>80.0±0.1</td></tr></table>
454
+
455
+ # C.5 EVALUATING PRIVATE SCATTERNET CLASSIFIERS
456
+
457
+ We use DP-SGD with momentum for all experiments. Prior work found that the use of adaptive optimizers (e.g., Adam (Kingma & Ba, 2015)) provided only marginal benefits for private learning (Papernot et al., 2020a). Moreover, we use no data augmentation, weight decay, or other mechanisms aimed at preventing overfitting. The reason is that differential privacy is itself a powerful regularizer (informally, differential privacy implies low generalization error (Dwork et al., 2015)), so our models all underfit the training data.
458
+
459
+ The table below lists the ranges of hyper-parameters used for the experiments in Section 3, to train linear ScatterNet classifiers, end-to-end CNNs, and CNNs fine-tuned on ScatterNet features.
460
+
461
+ Table 12: Hyper-parameters for the evaluation of private linear classifiers fine-tuned on ScatterNet features, CNNs fine-tuned on ScatterNet features, and end-to-end CNNs in Section 3.
462
+
463
+ <table><tr><td>Parameter</td><td>MNIST</td><td>Fashion-MNIST</td><td>CIFAR-10</td></tr><tr><td>DP guarantee (ε, δ)</td><td>(3,10-5)</td><td>(3,10-5)</td><td>(3,10-5)</td></tr><tr><td>Gradient clipping norm C</td><td>0.1</td><td>0.1</td><td>0.1</td></tr><tr><td>Momentum</td><td>0.9</td><td>0.9</td><td>0.9</td></tr><tr><td>Batch size B</td><td>{512,1024,...,16384} {512,1024,...,16384} {512,1024,...,16384}</td><td></td><td></td></tr><tr><td>Learning rate n</td><td>{1/4,1/2,1,2} .B/512</td><td>{1/4,1/2,1,2}.B/512</td><td>{1/8,1/4,1/2,1}.B/512</td></tr><tr><td>Epochs T</td><td>{15,25,40}</td><td>{15,25,40}</td><td>{30,60,120}</td></tr><tr><td>DP-SGD noise scale σ</td><td>calculated numerically so that a DP budget of (ε,δ) is spent after T epochs</td><td></td><td></td></tr><tr><td>Group Norm. groups G Data Norm.(C1,C2,Onorm)</td><td>{9,27,81} (0.2,0.05,{6,8})</td><td>{9,27,81} (0.3,0.15, {6,8})</td><td>{9,27,81} (1.0,1.5, {6,8})</td></tr></table>
464
+
465
+ In Table 13, we give the set of hyper-parameters that resulted in the maximal accuracy for our target DP budget of $( \varepsilon = 3 , \delta = 1 0 ^ { - 5 } \mathrm { . }$ ). For each model, we report the base learning rate, before re-scaling by $B / 5 1 2$ . We find that some hyper-parameters that result in the best performance are at the boundary of our search range. Yet, as we show in Figure 8, modifying these hyper-parameters results in no significant upward trend, so we refrained from further increasing our search space.
466
+
467
+ Table 13: Set of hyper-parameters resulting in the highest test accuracy for a privacy budget of $( \varepsilon = 3 , \delta = 1 0 ^ { - 5 } )$ ). Note that we report the base learning rate (LR), before scaling by a factor of $B / 5 1 2$ . SN stands for ScatterNet.
468
+
469
+ <table><tr><td></td><td colspan="3">MNIST</td><td colspan="3">Fashion-MNIST</td><td colspan="3">CIFAR-10</td></tr><tr><td>Parameter</td><td>SN+Linear</td><td>SN+CNN</td><td>CNN</td><td>SN+Linear</td><td>SN+CNN</td><td>CNN</td><td>SN+Linear</td><td>SN+CNN</td><td>CNN</td></tr><tr><td>Batch size B</td><td>4096</td><td>1024</td><td>512</td><td>8192</td><td>2048</td><td>2048</td><td>8192</td><td>8192</td><td>1024</td></tr><tr><td>Base LR n</td><td>1</td><td>/</td><td>/</td><td>1</td><td>1</td><td>1</td><td>1/4</td><td>1/4</td><td>1/</td></tr><tr><td>Epochs T</td><td>40</td><td>25</td><td>40</td><td>40</td><td>40</td><td>40</td><td>60</td><td>60</td><td>30</td></tr><tr><td>Groups G</td><td>-</td><td>1</td><td>-</td><td>27</td><td>27</td><td>-</td><td>-</td><td>-</td><td>1</td></tr><tr><td>Data Norm. Onorm</td><td>8</td><td>8</td><td>-</td><td>1</td><td>-</td><td>-</td><td>8</td><td>8</td><td>1</td></tr></table>
470
+
471
+ # C.6 MEASURING MODEL CONVERGENCE SPEED
472
+
473
+ For the experiments in Section 4, we compare the convergence of the models from Appendix C.2 when trained with and without noise, and with either a low or high learning rate. The table below lists the hyper-parameters for the CIFAR-10 experiment in Figure 3, as well as for the corresponding experiments for MNIST and Fashion-MNIST in Figure 11. When training without privacy, we still clip gradients to a maximal norm of $C = 0 . 1$ , but omit the noise addition step of DP-SGD (and we also omit the noise when using Data Normalization).
474
+
475
+ Table 14: Hyper-parameters for the experiments on model convergence rates in Figure 3 and Figure 11.
476
+
477
+ <table><tr><td>Dataset</td><td>Batch size B Gradient Norm C</td><td></td><td>Learning rate n (low, high)</td><td>Epochs T</td><td>Normalization</td></tr><tr><td>MNIST</td><td>512</td><td>0.1</td><td>(1,8)</td><td>40</td><td>Data Norm. (Onorm = 8)</td></tr><tr><td>Fashion-MNIST</td><td>512</td><td>0.1</td><td>(1,16)</td><td>40</td><td>Group Norm. (G= 81)</td></tr><tr><td>CIFAR-10</td><td>512</td><td>0.1</td><td>(1/4,4)</td><td>60</td><td>Data Norm. (Onorm = 8)</td></tr></table>
478
+
479
+ # C.7 PRIVATE LEARNING ON LARGER DATASETS
480
+
481
+ For the experiment in Section 5.1, we use an additional 500K images from the Tiny Images dataset (Torralba et al., 2008), which were collected and labeled by Carmon et al. (2019) using a pre-trained CIFAR-10 classifier (see (Carmon et al., 2019, Appendix B.6) for details on the selection process for this dataset).8 We create datasets of size $N \in \{ 1 0 \mathbf { K } , 2 5 \mathbf { K } , 5 0 \mathbf { K } , 1 0 0 \mathbf { K } , 2 5 0 \mathbf { K } , 5 5 0 \mathbf { K } \}$ by taking subsets of this larger dataset. We only use the data of Carmon et al. (2019) to complement the CIFAR-10 dataset when $N > 5 0 \mathrm { K }$ . As noted by Carmon et al. (2019), the additional 500K images do not entirely match the distribution of CIFAR-10. Nevertheless, we find that training our classifiers without privacy on augmented datasets of size $N > 5 0 \mathrm { K }$ does not negatively impact the test accuracy on CIFAR-10.
482
+
483
+ For each training set size, we re-train our models with a hyper-parameter search. To limit computational cost, and informed by our prior experiments, we fix some parameters, as shown in Table 15. When applying Data Normalization to ScatterNet features, we compute the per-channel statistics only over the original CIFAR-10 samples, and compute the privacy guarantees of PrivDataNorm using the Rényi DP analysis of the sampled Gaussian mechanism (Mironov et al., 2019; Wang et al., 2019).
484
+
485
+ Table 15: Hyper-parameters for the evaluation of private classifiers on larger datasets in Section 5.1.
486
+
487
+ <table><tr><td>Parameter</td><td>Value for dataset of size N</td></tr><tr><td>DP guarantee (ε, δ)</td><td>(3,1/2N)</td></tr><tr><td>Gradient norm C</td><td>0.1</td></tr><tr><td>Momentum</td><td>0.9</td></tr><tr><td>Batch size B</td><td>8192</td></tr><tr><td>Learning rate n</td><td>{1/8,1/4,1/2,1,2}.8192/512</td></tr><tr><td>Epochs T</td><td>{15,30,60,120} . 50000/N</td></tr><tr><td>Data Norm. params (C1,C2, Onorm)</td><td>(1,1.5,8)</td></tr></table>
488
+
489
+ The only hyper-parameters are thus the number of epochs (normalized by the size of the original CIFAR-10 data) and the learning rate $\eta$ . The optimal values we found for these parameters are given below in Table 16. As we increase the dataset size, we obtain better accuracy by training for more steps and with higher learning rates. Figure 4 reports the final accuracy for these best-performing models.
490
+
491
+ Table 16: Set of hyper-parameters resulting in the highest test accuracy for a privacy budget of $( \varepsilon = 3 , \delta = { ^ { 1 } \mathrm { / 2 } } N _ { . }$ ). The test accuracy for these models are in Figure 4. Epochs are normalized by the size of the original CIFAR-10 dataset, so training for $T$ epochs corresponds to training on $T \cdot 5 0 { , } 0 0 0$ examples. Note that we report the base learning rate, before scaling by a factor of $8 1 9 2 / 5 1 2$ .
492
+
493
+ <table><tr><td></td><td colspan="2">ScatterNet+Linear</td><td colspan="2">ScatterNet+CNN</td><td colspan="2">CNN</td></tr><tr><td>N</td><td>Epochs T</td><td>Learning rate n</td><td>Epochs T</td><td>Learning rate n</td><td>Epochs T</td><td>Learning rate n</td></tr><tr><td>10K</td><td>30</td><td>1/8</td><td>60</td><td>1/8</td><td>30</td><td>1/8</td></tr><tr><td>25K</td><td>30</td><td></td><td>60</td><td>1/8</td><td>60</td><td>1/8</td></tr><tr><td>50K</td><td>60</td><td>诊</td><td>60</td><td>1/4</td><td>60</td><td>1/4</td></tr><tr><td>100K</td><td>60</td><td>诊</td><td>120</td><td></td><td>120</td><td>1/4</td></tr><tr><td>250K</td><td>120</td><td></td><td>120</td><td>14</td><td>120</td><td>1</td></tr><tr><td>550K</td><td>120</td><td></td><td>120</td><td>1</td><td>120</td><td>1</td></tr></table>
494
+
495
+ # C.8 EVALUATION OF PRIVATE TRANSFER LEARNING
496
+
497
+ For the transfer learning experiments in Figure 5, we use a ResNeXt-29 model pre-trained on CIFAR-100,9 and a ResNet-50 model trained on unlabeled ImageNet (Deng et al., 2009) using SimCLRv2 (Chen et al., 2020b).10
498
+
499
+ To train private linear classifiers on CIFAR-10, we first extract features from the penultimate layer of the above pre-trained models. For the ResNeXt model, we obtain features of dimension 1024, and for the SimCLRv2 ResNet, we obtain features of dimension 4096. We then use DP-SGD with a similar setup as for the linear ScatterNet classifiers, except that we do not normalize the extracted features. We also target a tighter privacy budget of $( \varepsilon = 2 , \bar { \delta } = 1 0 ^ { - 5 }$ ). We then run a hyper-parameter search as listed below in Table 17. Figure 5 shows the best test accuracy achieved for each DP budget, averaged across five runs. We further report the set of hyper-parameters that resulted in the maximal accuracy for the targeted privacy budget of $\mathit { \check { \Psi } } \varepsilon = 2 , \delta = \mathit { \dot { 1 } } 0 ^ { - 5 }$ ).
500
+
501
+ Table 17: Hyper-parameters for the evaluation of private transfer learning from CIFAR-100 (using a ResNeXt model) and from unlabeled ImageNet (using a SimCLR v2 model) in Section 5.2.
502
+
503
+ <table><tr><td>Parameter</td><td>Values</td><td>Best forResNeXtBest forSimCLRv2</td><td></td></tr><tr><td>DP guarantee (ε, δ)</td><td>(2,10-5)</td><td></td><td></td></tr><tr><td>Gradient norm C</td><td>0.1</td><td></td><td></td></tr><tr><td>Momentum</td><td>0.9</td><td></td><td>=</td></tr><tr><td>Batch size B</td><td>{512,1024,...,16384}</td><td>2048</td><td>1024</td></tr><tr><td>Learning rate n</td><td>{1/2,1,2,4} . B/512</td><td>2 . 2048/512</td><td>2 . 1024/512</td></tr><tr><td>Epochs T</td><td>{15,25,40}</td><td>40</td><td>40</td></tr></table>
504
+
505
+ # D ADDITIONAL EXPERIMENTS AND FIGURES
506
+
507
+ # D.1 ON THE EFFECT OF BATCH SIZES IN DP-SGD
508
+
509
+ In this section, we revisit the question of the selection of an optimal batch size for DP-SGD. In their seminal work, Abadi et al. (2016) already investigated this question, and noted that the choice of batch size can have a large influence on the privacy-utility tradeoff. They empirically found that for a dataset of size $N$ , a batch size of size approximately $\sqrt { N }$ produced the best results. However, their experiments measured the effect of the batch size while keeping other parameters, including the noise multiplier $\sigma$ and the learning rate $\eta _ { : }$ fixed.
510
+
511
+ When training without privacy, it has been shown empirically that the choice of batch size has little effect on the convergence rate of SGD, as long as the learning rate $\eta$ is scaled linearly with the batch size (Goyal et al., 2017). Hereafter, we argue formally and demonstrate empirically that if we use a linear learning rate scaling, and fix the number of training epochs $T$ for a target privacy budget $\varepsilon$ then the choice of batch size also has a minimal influence on the performance of DP-SGD.
512
+
513
+ We first consider the effect of the sampling rate $B / _ { N }$ on the noise scale $\sigma$ required to attain a fixed privacy budget of $\varepsilon$ after $T$ epochs. There is no known closed form expression for $\sigma$ , so it is usually estimated numerically. We empirically establish the following claim, and verify numerically that it holds for our setting in Figure 6:
514
+
515
+ Claim D.1. Given a fixed $D P$ budget $( \varepsilon , \delta )$ to be reached after $T$ epochs, the noise scale $\sigma$ as a function of the sampling rate $B / _ { N }$ is given by $\sigma ( { ^ B } / { _ { N } } ) \approx c \cdot \sqrt { { ^ B } / { N } } ,$ , for some constant $c \geq 0$ .
516
+
517
+ ![](images/b7e9c7babed34410c50d760b8d5d844ea358cef7d1c2ee30573b3f9661274326.jpg)
518
+ Figure 6: Noise scale $\sigma$ for DP-SGD that results in a privacy guarantee of $( \varepsilon = 3 , \delta = 1 0 ^ { - 5 }$ ) after 60 training epochs, for different batch sampling rates $B / _ { N }$ .
519
+
520
+ Given this relation between batch size and noise scale, we proceed with a similar analysis as in (Goyal et al., 2017), for the case of DP-SGD. Given some initial weight $\theta _ { t }$ , performing $k$ steps of DP-SGD with clipping norm $C = 1$ , batch size $B$ , learning rate $\eta$ and noise scale $\sigma$ yields:
521
+
522
+ $$
523
+ \begin{array} { l } { { \pmb \theta } _ { t + k } = \pmb \theta _ { t } - \eta \displaystyle \sum _ { j < k } \frac { 1 } { B } \big ( \displaystyle \sum _ { \pmb x \in B _ { t + j } } \tilde { \pmb g } _ { t + j } ( \pmb x ) + \mathcal { N } ( 0 , \sigma ^ { 2 } { \pmb I } ) \big ) } \\ { = \Big ( \pmb \theta _ { t } - \eta \displaystyle \frac { 1 } { B } \displaystyle \sum _ { j < k } \sum _ { \pmb x \in B _ { t + j } } \tilde { \pmb g } _ { t + j } ( \pmb x ) \Big ) + \mathcal { N } \Big ( 0 , \frac { k \eta ^ { 2 } \sigma ^ { 2 } } { B ^ { 2 } } \pmb I \Big ) } \end{array}
524
+ $$
525
+
526
+ If we instead take a single step of DP-SGD with larger batch size $k B$ , a linearly scaled learning rate of $k \eta$ , and an adjusted noise scale $\tilde { \sigma } = \sqrt { k } \sigma$ (by Claim D.1), we get:11
527
+
528
+ $$
529
+ \begin{array} { r l r } { { \pmb { \theta } _ { t + 1 } = \pmb { \theta } _ { t } - k \eta \frac { 1 } { k B } \big ( \sum _ { j < k } \sum _ { \pmb { x } \in B _ { t + j } } \pmb { \tilde { g } } _ { t } ( \pmb { x } ) + \mathcal { N } ( 0 , \tilde { \sigma } ^ { 2 } \pmb { I } ) \big ) } } \\ & { } & { = \bigg ( \pmb { \theta } _ { t } - \eta \frac { 1 } { B } \sum _ { j < k } \sum _ { \pmb { x } \in B _ { t + j } } \pmb { \tilde { g } } _ { t } ( \pmb { x } ) \bigg ) + \mathcal { N } \bigg ( 0 , \frac { k \eta ^ { 2 } \sigma ^ { 2 } } { B ^ { 2 } } \pmb { I } \bigg ) } \end{array}
530
+ $$
531
+
532
+ Thus, we find that the total noise in both updates is identical. Under the same heuristic assumption as in (Goyal et al., 2017) that $\tilde { \pmb { g } } _ { t } ( \pmb { x } ) \approx \tilde { \pmb { g } } _ { t + j } ( \pmb { x } )$ for all $j < k$ , the two DP-SGD updates above are thus similar. This analysis suggests that as in the non-private case (Goyal et al., 2017), increasing the batch size and linearly scaling the learning rate should have only a small effect on a model’s learning curve.
533
+
534
+ We now verify this claim empirically. We follow the experimental setup in Section 3, and set a privacy budget of $( \varepsilon = 3 , \delta = 1 0 ^ { - 5 } )$ to be reached after a fixed number of epochs $T$ . For different choices of batch size $B$ , we numerically compute the noise scale $\sigma$ that fits this “privacy schedule”. For the initial batch size of $B _ { 0 } = 5 1 2$ , we select a base learning rate $\eta$ that maximizes test accuracy at epoch $T$ . As we increase the batch size to $B = k B _ { 0 }$ , we linearly scale the learning rate to kη. The concrete parameters are given below:
535
+
536
+ Table 18: Hyper-parameters for comparing the convergence rate of DP-SGD with different batch sizes in Figure 7.
537
+
538
+ <table><tr><td></td><td>Epochs T</td><td>Batch size B</td><td>Learning rate η</td></tr><tr><td>MNIST</td><td>40</td><td>{512,1024,2048,4096}</td><td>1/2 . B/512</td></tr><tr><td>Fashion-MNIST</td><td>40</td><td>{512,1024,2048,4096}</td><td>1.B/512</td></tr><tr><td>CIFAR-10</td><td>60</td><td>{512,1024,2048,4096}</td><td>1/4 · B/512</td></tr></table>
539
+
540
+ As we can see in Figure 7, the training curves for CNNs trained with DP-SGD are indeed near identical across a variety of batch sizes.
541
+
542
+ ![](images/034428c0e834f4a5165823f473382154fb4d9aa72cbe72ed6777a6506fcbc298.jpg)
543
+ Figure 7: Convergence rate of DP-SGD for different batch sizes, with a fixed targeted privacy budget of $( \varepsilon = 3 , \delta = 1 \bar { 0 } ^ { - 5 } ,$ ) after $T = 4 0$ or $T = 6 0$ epochs, and linear scaling of the learning rate $\eta \cdot ^ { B } / 5 1 2$ .
544
+
545
+ # D.2 ANALYSIS OF HYPER-PARAMETERS
546
+
547
+ To understand the effect of varying the different hyper-parameters of DP-SGD, Figure 8 shows the median and maximum model performance for different choices of a single parameter. The median and maximum are computed over all choices for the other hyper-parameters in Table 12. As we can see, the maximal achievable test accuracy is remarkably stable when fixing one of the algorithm’s hyper-parameters, with the exception of overly large batch sizes or overly low learning rates for end-to-end CNNs.
548
+
549
+ ![](images/1b484164c0a0a8103ed353bebecbb42fa481b4aaf8d14ce2c81cf19935afc79d.jpg)
550
+ Figure 8: Median and maximum test accuracy of linear ScatterNet classifiers and end-to-end CNNs when we fix one hyper-parameter in Table 12 and run a grid-search over all others (for a privacy budget of $( \varepsilon = 3 , \delta = 1 \bar { 0 } ^ { - 5 } ,$ )).
551
+
552
+ # D.3 COMPARING DP-SGD AND PRIVACY AMPLIFICATION BY ITERATION
553
+
554
+ While DP-SGD is the algorithm of choice for differentially private non-convex learning, it is unclear why it should be the best choice for learning private linear models. Indeed, starting with the work of Chaudhuri et al. (2011), there have been many other proposals of algorithms for private convex optimization with provable utility guarantees, e.g., (Bassily et al., 2014; Kifer et al., 2012; Feldman et al., 2018). Yet, Yu et al. (2019a) show that DP-SGD can achieve higher utility than many of these approaches, both asymptotically and empirically.
555
+
556
+ Here, we take a closer look at the “Privacy Amplification by Iteration” work of (Feldman et al., 2018). Feldman et al. (2018) observe that DP-SGD guarantees differential privacy for every gradient update step. Under the assumption that intermediate model updates can be hidden from the adversary, they propose a different analysis of DP-SGD for convex optimization problems that has a number of conceptual advantages. First, the algorithm of Feldman et al. (2018) does not require the training indices selected for each batch $B _ { t }$ do be hidden from the adversary. Second, their approach can support much smaller privacy budgets than DP-SGD.
557
+
558
+ However, we show that these benefits come at a cost in practice: for the range of privacy budgets we consider in this work, DP-SGD requires adding less noise than Privacy Amplification by Iteration (PAI). To compare the two approaches, we proceed as follows: We analytically compute the noise scale $\sigma$ that results in a privacy guarantee of $( \varepsilon , \delta = 1 0 ^ { - 5 } )$ ) after 10 training epochs with a batch sampling rate of $5 1 2 / 5 0 0 0 0$ .12 Figure 9 shows that DP-SGD requires adding less noise, except for large privacy budgets $\varepsilon > 4 0$ ), or very small ones $\left( \varepsilon < 0 . 2 \right)$ . In the latter case, both algorithms require adding excessively large amounts of noise. We observe a qualitatively similar behavior for other sampling rates.
559
+
560
+ For completeness, we evaluate the PAI algorithm of Feldman et al. (2018) for training linear ScatterNet classifiers on CIFAR-10. We evaluate a broader range of hyper-parameters, including different clipping thresholds $C \in \{ 0 . 1 , 1 , 1 0 \}$ (PAI clips the data rather than the gradients), a wider range of batch sizes $B \in \{ 3 2 , 6 4 , \dotsc , 2 0 4 8 \}$ , and a wider range of base learning rates $\eta \in \{ 2 ^ { - 3 } , 2 ^ { - 2 } , . . . , 2 ^ { 3 } \}$ We find that for privacy budgets $1 \leq \varepsilon \leq 3$ , the optimal hyper-parameters for PAI and DP-SGD are similar, but the analysis of PAI requires a larger noise scale $\sigma$ . As a result, PAI performs worse than DP-SGD, as shown in Figure 10.
561
+
562
+ ![](images/d73462dc4094fd3aa7b439ace75f575cf49d4c27a1a858587b9f4e7558b46f56.jpg)
563
+ Figure 9: Gradient noise scale $\sigma$ required for a privacy guarantee of $( \varepsilon , \delta = 1 0 ^ { - 5 } )$ after 10 training epochs with batch sampling rate $5 1 2 / 5 0 0 0 0$ Privacy Amplification by Iteration (PAI) (Feldman et al., 2018) requires less noise than DPSGD only for very small or very large privacy budgets.
564
+
565
+ ![](images/e37dedc48513878f576eed38e1b0c0b6c677a0856b9629bfa41af878f10da8e0.jpg)
566
+ Figure 10: Comparison of DP-SGD (Abadi et al., 2016) and Privacy Amplification by Iteration (PAI) (Feldman et al., 2018) for training a private linear ScatterNet classifier on CIFAR-10. Shows the maximum accuracy achieved for each privacy budget, averaged over five runs.
567
+
568
+ # D.4 DP-SGD WITH POISSON SAMPLING
569
+
570
+ The analysis of DP-SGD (Abadi et al., 2016; Mironov et al., 2019) assumes that each batch $\scriptstyle { B _ { t } }$ is created by independently selecting each training sample with probability $B / _ { N }$ . This is in contrast to typical implementations of SGD, where the training data is randomly shuffled once per epoch, and divided into successive batches of size exactly $B$ . The latter “random shuffle” approach has been used in most implementations of DP-SGD (e.g., (tensorflow/privacy, 2019; pytorch/opacus, 2020)) as well as in prior work (e.g., (Abadi et al., 2016; Papernot et al., 2020b)), with the (implicit) assumption that this difference in batch sampling strategies will not affect model performance. We verify that this assumption is indeed valid in our setting. We re-train the linear ScatterNet and end-to-end CNN models that achieved the highest accuracy for a DP budget of $( \varepsilon = 3 , \delta = 1 0 ^ { - 5 } )$ ) (with the hyper-parameters detailed in Table 13), using the correct “Poisson sampling” strategy. The test accuracy of these models (averaged over five runs) are shown in Table 19. For all datasets and models, the two sampling schemes achieve similar accuracy when averaged over five runs.
571
+
572
+ Table 19: Comparison of DP-SGD with two different batch sampling schemes: (1) Poisson sampling, where a batch is formed by selecting each data point independently with probability $B / _ { N }$ ; (2) Random shuffle, where the training set is randomly shuffled at the beginning of each epoch, and split into consecutive batches of size $B$ . For both sampling schemes, we report the best test accuracy (in $\%$ ) at a DP budget of $( \varepsilon = 3 , \delta = 1 0 ^ { - 5 } )$ ), with means and standard deviations over five runs.
573
+
574
+ <table><tr><td></td><td colspan="2">ScatterNet</td><td colspan="2">CNN</td></tr><tr><td>Dataset</td><td>Poisson Sampling</td><td>Random Shuffle</td><td>Poisson Sampling</td><td>Random Shuffle</td></tr><tr><td>MNIST</td><td>98.6 ± 0.1</td><td>98.7±0.0</td><td>98.0±0.1</td><td>98.1±0.0</td></tr><tr><td>Fashion-MNIST</td><td>89.6 ± 0.1</td><td>89.7 ± 0.0</td><td>86.1 ± 0.2</td><td>86.0± 0.1</td></tr><tr><td>CIFAR-10</td><td>66.8 ± 0.2</td><td>67.0± 0.0</td><td>59.0± 0.4</td><td>59.2 ± 0.1</td></tr></table>
575
+
576
+ # D.5 EXPERIMENTS WITH SMALLER END-TO-END CNN MODEL ON CIFAR-10
577
+
578
+ In Section 4, we investigate whether the dimensionality of different classifiers has a noticeable impact on their privacy-utility tradeoffs. To this end, we repeat the CIFAR-10 experiments from
579
+
580
+ Section 3 with a smaller end-to-end CNN architecture. Specifically, we take the end-to-end CNN architecture from Table 7 and reduce the number of filters in each convolutional layer by a factor of two and remove the last convolutional layer). This results in a CNN model with a comparable number of trainable parameters as the linear ScatterNet classifier (see Table 4). In Table 20, we compare the privacy-utility of this smaller CNN models with the original larger CNN model evaluated in Section 3. While the change of model architecture does affect the model accuracy, the effect is minor, and the accuracy remains far below that of the ScatterNet classifiers with a comparable number of parameters.
581
+
582
+ Table 20: Best test accuracy $( \mathrm { i n ~ } \% )$ ) for two different model sizes on CIFAR-10 for a DP budget of $( \varepsilon = 3 , \delta = 1 0 ^ { - 5 } \mathrm { . }$ ). We compare two variants of the end-to-end CNN architecture from Table 7, with respectively 551K and 168K parameters. Average and standard deviation computed over five runs.
583
+
584
+ <table><tr><td>Model</td><td>Parameters</td><td>Accuracy</td></tr><tr><td>CNN</td><td>168K</td><td>60.7 ± 0.3</td></tr><tr><td></td><td>551K</td><td>59.2 ±0.1</td></tr></table>
585
+
586
+ # D.6 MODEL CONVERGENCE SPEED ON MNIST AND FASHION-MNIST
587
+
588
+ We run the same experiment as in Figure 3 for MNIST and Fashion-MNIST, to compare the convergence rate of different classifiers with and without privacy, for different learning rates. The experimental setup is described in Appendix C.6. Figure 11 shows qualitatively similar results as Figure 3: with a high learning rate, all models converge quickly when trained without gradient noise, but the addition of noise is detrimental to the learning process. In contrast, with a much lower learning rate the training curves for DP-SGD are nearly identical, whether we add noise or not. In this regime, the ScatterNet classifiers converge significantly faster than end-to-end CNNs when trained without privacy.
589
+
590
+ ![](images/6642bca072d43fce08c54ccb3b96895df7cb085967be14a190d64125d1ef4a32.jpg)
591
+ Figure 11: Comparison of convergence rates of linear classifiers fine-tuned on ScatterNet features, CNNs fine-tuned on ScatterNet features), and end-to-end CNNs with and without noise addition in DP-SGD. (Left): low learning rate. (Right): high learning rate. See Figure 3 for results on CIFAR-10.
md/train/_RnHyIeu5Y5/_RnHyIeu5Y5.md ADDED
@@ -0,0 +1,272 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ViTAE: Vision Transformer Advanced by Exploring Intrinsic Inductive Bias
2
+
3
+ Yufei Xu1∗ Qiming Zhang1∗ Jing Zhang1 Dacheng Tao2,1
4
+
5
+ 1The University of Sydney, Australia, 2JD Explore Academy, China
6
+
7
+ {yuxu7116,qzha2506}@uni.sydney.edu.au, jing.zhang1@sydney.edu.au, dacheng.tao@gmail.com
8
+
9
+ # Abstract
10
+
11
+ Transformers have shown great potential in various computer vision tasks owing to their strong capability in modeling long-range dependency using the self-attention mechanism. Nevertheless, vision transformers treat an image as 1D sequence of visual tokens, lacking an intrinsic inductive bias (IB) in modeling local visual structures and dealing with scale variance. Alternatively, they require large-scale training data and longer training schedules to learn the IB implicitly. In this paper, we propose a new Vision Transformer Advanced by Exploring intrinsic IB from convolutions, i.e., ViTAE. Technically, ViTAE has several spatial pyramid reduction modules to downsample and embed the input image into tokens with rich multi-scale context by using multiple convolutions with different dilation rates. In this way, it acquires an intrinsic scale invariance IB and is able to learn robust feature representation for objects at various scales. Moreover, in each transformer layer, ViTAE has a convolution block in parallel to the multi-head selfattention module, whose features are fused and fed into the feed-forward network. Consequently, it has the intrinsic locality IB and is able to learn local features and global dependencies collaboratively. Experiments on ImageNet as well as downstream tasks prove the superiority of ViTAE over the baseline transformer and concurrent works. Source code and pretrained models will be available at code.
12
+
13
+ # 1 Introduction
14
+
15
+ Transformers [79, 17, 40, 14, 46, 61] have shown a domination trend in NLP studies owing to their strong ability in modeling long-range dependencies by the self-attention mechanism [67, 81, 51]. Such success and good properties of transformers has inspired following many works that apply them in various computer vision tasks [19, 100, 97, 80, 7]. Among them, ViT [19] is the pioneering pure transformer model that embeds images into a sequence of visual tokens and models the global dependencies among them with stacked transformer blocks. Although it achieves promising performance on image classification, it requires large-scale training data and a longer training schedule. One important reason is that ViT
16
+
17
+ ![](images/4515266c49c6aff7e7d656459cb5d8b9e3662e222790882fee6a157e2ad56504.jpg)
18
+ Figure 1: Comparison of data and training efficiency of T2T-ViT-7 and ViTAE-T on ImageNet.
19
+
20
+ lacks intrinsic inductive bias (IB) in modeling local visual structures (e.g., edges and corners) and dealing with objects at various scales like convolutions. Alternatively, ViT has to learn such IB implicitly from large-scale data.
21
+
22
+ Unlike vision transformers, Convolution Neural Networks (CNNs) naturally equip with the intrinsic IBs of scale-invariance and locality and still serve as prevalent backbones in vision tasks [26, 70, 62, 8, 96]. The success of CNNs inspires us to explore intrinsic IBs in vision transformers. We start by analyzing the above two IBs of CNNs, i.e., locality and scale-invariance. Convolution that computes local correlation among neighbor pixels is good at extracting local features such as edges and corners. Consequently, CNNs can provide plentiful low-level features at the shallow layers [94], which are then aggregated into high-level features progressively by a bulk of sequential convolutions [32, 68, 71]. Moreover, CNNs have a hierarchy structure to extract multi-scale features at different layers [68, 38, 26]. Besides, intra-layer convolutions can also learn features at different scales by varying their kernel sizes and dilation rates [25, 70, 8, 45, 96]. Consequently, scale-invariant feature representation can be obtained via intra- or inter-layer feature fusion. Nevertheless, CNNs are not well suited to model long-range dependencies2, which is the key advantage of transformers. An interesting question comes up: Can we improve vision transformers by leveraging the good properties of CNNs? Recently, DeiT [76] explores the idea of distilling knowledge from CNNs to transformers to facilitate training and improve the performance. However, it requires an off-the-shelf CNN model as the teacher and consumes extra training cost.
23
+
24
+ Different from DeiT, we explicitly introduce intrinsic IBs into vision transformers by re-designing the network structures in this paper. Current vision transformers always obtain tokens with singlescale context [19, 93, 80, 86, 47, 69, 77] and learn to adapt to objects at different scales from data. For example, T2T-ViT [93] improves ViT by delicately generating tokens in a soft split manner. Specifically, it uses a series of Tokens-to-Token transformation layers to aggregate single-scale neighboring contextual information and progressively structurizes the image to tokens. Motivated by the success of CNNs in dealing with scale variance, we explore a similar design in transformers, i.e., intra-layer convolutions with different receptive fields [70, 91], to embed multi-scale context into tokens. Such a design allows tokens to carry useful features of objects at various scales, thereby naturally having the intrinsic scale-invariance IB and explicitly facilitating transformers to learn scale-invariant features more efficiently from data. On the other hand, low-level local features are fundamental elements to generate high-level discriminative features. Although transformers can also learn such features at shallow layers from data, they are not skilled as convolutions by design. Recently, [89, 43, 21] stack convolutions and attention layers sequentially and demonstrate that locality is a reasonable compensation of global dependency. However, this serial structure ignores the global context during locality modeling (and vice versa). To avoid such a dilemma, we follow the “divide-and-conquer” idea and propose to model locality and long-range dependencies in parallel and then fuse the features to account for both. In this way, we empower transformers to learn local and long-range features within each block more effectively.
25
+
26
+ Technically, we propose a new Vision Transformers Advanced by Exploring Intrinsic Inductive Bias $( V i T A E )$ , which is a combination of two types of basic cells, i.e., reduction cell (RC) and normal cell (NC). RCs are used to downsample and embed the input images into tokens with rich multi-scale context while NCs aim to jointly model locality and global dependencies in the token sequence. Moreover, these two types of cells share a simple basic structure, i.e., paralleled attention module and convolutional layers followed by a feed-forward network (FFN). It is noteworthy that RC has an extra pyramid reduction module with atrous convolutions of different dilation rates to embed multi-scale context into tokens. Following the setting in [93], we stack three reduction cells to reduce the spatial resolution by $1 / 1 6$ and a series of NCs to learn discriminative features from data. ViTAE outperforms representative vision transformers in terms of data efficiency and training efficiency (see Figure 1), as well as classification accuracy and generalization on downstream tasks.
27
+
28
+ Our contributions are threefold. First, we explore two types of intrinsic IB in transformers, i.e., scale invariance and locality, and demonstrate the effectiveness of this idea in improving the feature learning ability of transformers. Second, we design a new transformer architecture named ViTAE based on two new reduction and normal cells to intrinsically incorporate the above two IBs. The proposed ViTAE embeds multi-scale context into tokens and learns both local and long-range features effectively. Third, ViTAE outperforms representative vision transformers regarding classification accuracy, data efficiency, training efficiency, and generalization on downstream tasks. ViTAE achieves $7 5 . 3 \%$ and $8 2 . 0 \%$ top-1 accuracy on ImageNet with 4.8M and 23.6M parameters, respectively.
29
+
30
+ # 2 Related Work
31
+
32
+ # 2.1 CNNs with intrinsic IB
33
+
34
+ CNNs have led to a series of breakthroughs in image classification [38, 94, 26, 95, 87] and downstream computer vision tasks. The convolution operations in CNNs extract local features from the neighbor pixels within the receptive field determined by the kernel size [42]. Following the intuition that local pixels are more likely to be correlated in images [41], CNNs have the intrinsic IB in modeling locality. In addition to the locality, another critical topic in visual tasks is scale-invariance, where multi-scale features are needed to represent the objects at different scales effectively [49, 90]. For example, to effectively learn features of large objects, a large receptive field is needed by either using large convolution kernels [90, 91] or a series of convolution layers in deeper architectures [26, 32, 68, 71]. To construct multi-scale feature representation, the classical idea is using image pyramid [8, 1, 55, 4, 39, 16], where features are hand-crafted or learned from a pyramid of images at different resolutions respectively [44, 8, 52, 63, 35, 3]. Accordingly, features from the small scale image mainly encode the large objects while features from the large scale image respond more to small objects. In addition to the above inter-layer fusion way, another way is to aggregate multi-scale context by using multiple convolutions with different receptive fields within a single layer, i.e., intra-layer fusion [96, 71, 70, 70, 72]. Either inter-layer fusion or intra-layer fusion empower CNNs an intrinsic IB in modeling scale-invariance. This paper introduces such an IB to vision transformers by following the intra-layer fusion idea and utilizing multiple convolutions with different dilation rates in the reduction cells to encode multi-scale context into each visual token.
35
+
36
+ # 2.2 Vision transformers with learned IB
37
+
38
+ ViT [19] is the pioneering work that applies a pure transformer to vision tasks and achieves promising results. However, since ViT lacks intrinsic inductive bias in modeling local visual structures, it indeed learns the IB from amounts of data implicitly. Following works along this direction are to simplify the model structures with fewer intrinsic IBs and directly learn them from large scale data [50, 74, 75, 22, 18, 20, 27] which have achieved promising results and been studied actively. Another direction is to leverage the intrinsic IB from CNNs to facilitate the training of vision transformers, e.g., using less training data or shorter training schedules. For example, DeiT [76] proposes to distill knowledge from CNNs to transformers during training. However, it requires an off-the-shelf CNN model as a teacher, introducing extra computation cost during training. Recently, some works try to introduce the intrinsic IB of CNNs into vision transformers explicitly [23, 58, 21, 43, 15, 89, 83, 92, 6, 47, 11]. For example, [43, 21, 83] stack convolutions and attention layers sequentially, resulting in a serial structure and modeling the locality and global dependency accordingly. [80, 28] design sequential stage-wise structures while [47, 33] apply attention within local windows. However, these serial structure may ignore the global context during locality modeling (and vice versa). [88] establishes connection across different scales at the cost of heavy computation. Instead, we follow the “divide-and-conquer” idea and propose to model locality and global dependencies simultaneously via a parallel structure within each transformer layer. Conformer [58], the most relevant concurrent work to us, employs a unit to explore inter-block interactions between parallel convolution and transformer blocks. In contrast, in ViTAE, the convolution and attention modules are designed to be complementary to each other within the transformer block. In addition, Conformer is not designed to have inherent scale invariance IB.
39
+
40
+ # 3 Methodology
41
+
42
+ # 3.1 Revisit vision transformer
43
+
44
+ We first give a brief review of vision transformer in this part. To adapt transformers to vision tasks, ViT [19] first splits an image $x \in R ^ { H \times W \times C }$ into tokens with a reduction ratio of $p$ (i.e., $x _ { t } \in R ^ { ( ( H \times W ) / p ^ { 2 } ) \times D } )$ , where $H , W$ and $C$ denote the height, width, and channel dimensions of the input image, $D = C p ^ { 2 }$ denotes the token dimension. Then, an extra class token is concatenated to the visual tokens before adding position embeddings in an element-wise manner. The resulting tokens are fed into the following transformer layers. Each transformer layer is composed of two parts, i.e., a multi-head self-attention module (MHSA) and a feed forward network (FFN).
45
+
46
+ ![](images/12ff638562a0b78bbcef09633d771c21fc798831f54a00e148f38d5e89e3596b.jpg)
47
+ Figure 2: The structure of the proposed ViTAE. It is constructed by stacking three RCs and several NCs. Both types of cells share a simple basic structure, i.e., an MHSA module and a parallel convolutional module followed by an FFN. In particular, RC has an extra pyramid reduction module using atrous convolutions with different dilation rates to embed multi-scale context into tokens.
48
+
49
+ MHSA Multi-head self-attention extends single-head self-attention (SHSA) by using different projection matrices for each head. Specifically, the input tokens $x _ { t }$ are first projected to queries $( Q )$ , keys $( K )$ and values $( V )$ using projection matrices, i.e., $Q , K , V = x _ { t } W _ { Q } , x _ { t } Q _ { K } , x _ { t } Q _ { V }$ , where $W _ { Q / K / V } \in R ^ { D \times D }$ denotes the projection matrix for query, key, and value, respectively. Then, the self-attention operation is calculated as:
50
+
51
+ $$
52
+ A t t e n t i o n ( Q , K , V ) = s o f t m a x ( \frac { Q K ^ { T } } { \sqrt { D } } ) V .
53
+ $$
54
+
55
+ This SHSA module is repeated for $h$ times to formulate the MHSA module, where $h$ is the number of heads. The output features of the $h$ heads are concatenated along the channel dimension and formulate the output of the MHSA module.
56
+
57
+ FFN FFN is placed on top of the MHSA module and applied to each token identically and separately. It consists of two linear transformations with an activation function in between. Besides, a layer normalization [2] and a shortcut are added before and aside from the MHSA and FFN, respectively.
58
+
59
+ # 3.2 Overview architecture of ViTAE
60
+
61
+ ViTAE aims to introduce the intrinsic IB in CNNs to vision transformers. As shown in Figure 2, ViTAE is composed of two types of cells, i.e., RCs and NCs. RCs are responsible for embedding multi-scale context and local information into tokens, and NCs are used to further model the locality and long-range dependencies in the tokens. Taken an image $x \in R ^ { H \times W \times C }$ as input, three RCs are used to gradually downsample $x$ by $4 \times , 2 \times$ , and $2 \times$ , respectively. Thereby, the output tokens of the RCs are of size $[ H / 1 6 , W / 1 6 , D ]$ where $D$ is the token dimension (64 in our experiments). The output tokens of RCs are then flattened as $R ^ { H W / 2 5 6 \times D }$ , concatenated with the class token, and added by the sinusoid position encoding. Next, the tokens are fed into the following NCs, which keep the length of the tokens. Finally, the prediction probability is obtained using a linear classification layer on the class token from the last NC.
62
+
63
+ # 3.3 Reduction cell
64
+
65
+ Instead of directly splitting and flatten images into visual tokens based on a linear image patch embedding layer, we devise the reduction cell to embed multi-scale context and local information into visual tokens, which introduces the intrinsic scale-invariance and locality IBs from convolutions. Technically, RC has two parallel branches responsible for modeling locality and long-range dependency, respectively, followed by an FFN for feature transformation. We denote the input feature of the $i _ { t h } \ : \mathrm { R C }$ as $f _ { i } \in \dot { R } ^ { H _ { i } \times W _ { i } \times D _ { i } }$ . The input of the first RC is the image $x$ . In the global dependencies branch, $f _ { i }$ is firstly fed into a Pyramid Reduction Module (PRM) to extract multi-scale context, i.e.,
66
+
67
+ $$
68
+ f _ { i } ^ { m s } \triangleq P R M _ { i } ( f _ { i } ) = C a t ( [ C o n v _ { i j } ( f _ { i } ; s _ { i j } , r _ { i } ) | s _ { i j } \in S _ { i } , r _ { i } \in { \mathcal { R } } ] ) ,
69
+ $$
70
+
71
+ where $C o n v _ { i j } ( \cdot )$ indicates the $j$ th convolutional layer in the PRM $( P R M _ { i } ( \cdot ) )$ . It uses a dilation rate $s _ { i j }$ from the predefined dilation rate set $S _ { i }$ corresponding to the ith RC. Note that we use stride convolution to reduce the spatial dimension of features by a ratio $r _ { i }$ from the predefined reduction ratio set $\mathcal { R }$ . The conv features are concatenated along the channel dimension, i.e., $f _ { i } ^ { m s } \in$ $R ^ { ( W _ { i } / p ) \times ( H _ { i } / p ) \times ( | S _ { i } | D ) }$ , where $| { S _ { i } } |$ denotes the number of dilation rates in $S _ { i }$ . $f _ { i } ^ { m s }$ is then processed by an MHSA module to model long-range dependencies, i.e.,
72
+
73
+ $$
74
+ f _ { i } ^ { g } = M H S A _ { i } ( I m g 2 S e q ( f _ { i } ^ { m s } ) ) ,
75
+ $$
76
+
77
+ where $I m g 2 S e q ( \cdot )$ is a simple reshape operation to flatten the feature map to a 1D sequence. In this way, $f _ { i } ^ { g }$ embeds the multi-scale context in each token. In addition, we use a Parallel Convolutional Module (PCM) to embed local context within the tokens, which are fused with $f _ { i } ^ { g }$ as follows:
78
+
79
+ $$
80
+ f _ { i } ^ { l g } = f _ { i } ^ { g } + { \cal P } { \cal C } M _ { i } ( f _ { i } ) .
81
+ $$
82
+
83
+ Here, $P C M _ { i } ( \cdot )$ represents the PCM, which is composed of three stacked convolution layers and an $I m g 2 S e q ( \cdot )$ operation. It is noteworthy that the parallel convolution branch has the same spatial downsampling ratio as the PRM by using stride convolutions. In this way, the token features can carry both local and multi-scale context, implying that RC acquires the locality IB and scale-invariance IB by design. The fused tokens are then processed by the FFN, reshaped back to feature maps, and fed into the following RC or NC, i.e.,
84
+
85
+ $$
86
+ f _ { i + 1 } = S e q 2 I m g ( F F N _ { i } ( f _ { i } ^ { l g } ) + f _ { i } ^ { l g } ) ,
87
+ $$
88
+
89
+ where the $S e q 2 I m g ( \cdot )$ is a simple reshape operation to reshape a token sequence back to feature maps. $F F N _ { i } ( \cdot )$ represents the FFN in the ith RC. In our ViTAE, three RCs are stacked sequentially to gradually reduce the input image’s spatial dimension by $4 \times , 2 \times$ , and $2 \times$ , respectively. The feature maps generated by the last RC are of a size of $[ H / 1 6 , W / 1 6 , D ]$ , which are then flattened into visual tokens and fed into the following NCs.
90
+
91
+ # 3.4 Normal cell
92
+
93
+ As shown in the bottom right part of Figure 2, NCs share a similar structure with the reduction cell except for the absence of the PRM. Due to the relatively small $( \frac { 1 } { 1 6 } \times )$ spatial size of feature maps after RCs, it is unnecessary to use PRM in NCs. Given $f _ { 3 }$ from the third RC, we first concatenate it with the class token $t _ { c l s }$ , and then add it to the positional encodings to get the input tokens $t$ for the following NCs. Here we ignore the subscript for clarity since all NCs have an identical architecture but different learnable weights. $t _ { c l s }$ is randomly initialized at the start of training and fixed during the inference. Similar to the RC, the tokens are fed into the MHSA module, i.e., $t _ { g } = M H S A ( t )$ . Meanwhile, they are reshaped to 2D feature maps and fed into the PCM, i.e., $t _ { l } = \bar { I } m g 2 S e q ( P C M ( S e q 2 I m g ( t ) ) )$ . Note that the class token is discarded in PCM because it has no spatial connections with other visual tokens. To further reduce the parameters in NCs, we use group convolutions in PCM. The features from MHSA and PCM are then fused via element-wise sum, i.e., $t _ { l g } = t _ { g } + t _ { l }$ . Finally, $t _ { l g }$ are fed into the FFN to get the output features of NC, i.e., $t _ { n c } = F F N ( t _ { l g } ) \overline { { + } } t _ { l g }$ . Similar to ViT [19], we apply layer normalization to the class token generated by the last NC and feed it to the classification head to get the final classification result.
94
+
95
+ # 3.5 Model details
96
+
97
+ We use two variants of ViTAE in our experiments for a fair comparison of other models with similar model sizes. The details of them are summarized in Table 1. In the first RC, the default convolution kernel size is $7 \times 7$ with a
98
+
99
+ Table 1: Model details of two variants of ViTAE.
100
+
101
+ <table><tr><td>Model</td><td>Reduction Cell Dilation</td><td>Cells</td><td>Normal Cell Heads Embed Cells</td><td></td><td>Params Macs (M)</td><td>(G)</td></tr><tr><td>ViTAE-T</td><td>[1,2,3,4] √</td><td>3</td><td>4 256</td><td>7</td><td>4.8</td><td>1.5</td></tr><tr><td>ViTAE-S</td><td>[1,2,3,4] √</td><td>3</td><td>6</td><td>384 14</td><td>23.6</td><td>5.6</td></tr></table>
102
+
103
+ stride of 4 and dilation rates of $\mathcal { S } _ { 1 } = [ 1 , 2 , 3 , 4 ]$ . In the following two RCs, the convolution kernel size is $3 \times 3$ with a stride of 2 and dilation rates of $S _ { 2 } = [ 1 , 2 , 3 ]$ and $S _ { 3 } = [ 1 , 2 ]$ , respectively. Since the spatial dimension of tokens decreases, there is no need to use large kernels and dilation rates. PCM in both RCs and NCs comprises three convolutional layers with a kernel size of $3 \times 3$ .
104
+
105
+ # 4 Experiments
106
+
107
+ # 4.1 Implementation details
108
+
109
+ We train and test the proposed ViTAE model on the standard ImageNet [38] dataset, which contains about 1.3 million images and covers 1k classes. Unless explicitly stated, the image size during training is set to $2 2 4 \times 2 2 4$ . We use the AdamW [48] optimizer with the cosine learning rate scheduler and uses the data augmentation strategy exactly the same as T2T [93] for a fair comparison, regarding the training strategies and the size of models. We use a batch size of 512 for training all our models and set the initial learning rate to be 5e-4. The results of our models can be found in Table 2, where all the models are trained for 300 epochs on 8 V100 GPUs. The models are built on PyTorch [57] and TIMM [82].
110
+
111
+ # 4.2 Comparison with the state-of-the-art
112
+
113
+ We compare our ViTAE with both CNN models and vision transformers with similar model sizes in Table 2. Both Top-1/5 accuracy and real Top-1 accuracy on the ImageNet validation set are reported. We categorize the methods into CNN models, vision transformers with learned IB, and vision transformers with introduced intrinsic IB. Compared with CNN models, our ViTAE-T achieves a $7 5 . 3 \%$ Top-1 accuracy, which is better than ResNet-18 with more parameters. The real Top-1 accuracy of the ViTAE model is $8 2 . 9 \%$ , which is comparable to ResNet-50 that has four more times of parameters than ours. Similarly, our ViTAE-S achieves $8 2 . 0 \%$ Top-1 accuracy with half of the parameters of ResNet-101 and ResNet-152, showing the superiority of learning both local and longrange features from specific structures with corresponding intrinsic IBs by design. Similar phenomena can also be observed when comparing ViTAE-T with MobileNetV1 [31] and MobileNetV2 [65], where ViTAE obtains better performance with fewer parameters. When compared with larger models which are searched according to NAS [73], our ViTAE-S achieves a similar performance when using $3 8 4 \times 3 8 4$ images as input, which further shows the potential of vision transformers with intrinsic IB.
114
+
115
+ In addition, among the transformers with learned IB, ViT is the first pure transformer model for visual recognition. DeiT shares the same structure with ViT but uses different data augmentation and training strategies to facilitate the learning of transformers. DeiT⚗ denotes using an off-the-shelf CNN model as the teacher model to train DeiT, which introduces the intrinsic IB from CNN to transformer implicitly in a knowledge distillation manner, showing better performance than the vanilla ViT on the ImageNet dataset. It is exciting to see that our ViTAE-T with fewer parameters even outperforms the distilled model DeiT⚗, demonstrating the efficacy of introducing intrinsic IBs in transformers by design. Besides, compared with other transformers with explicit intrinsic IB, our ViTAE with fewer parameters also achieves comparable or better performance. For instance, ViTAE-T achieves comparable performance with LocalVit-T but has 1M fewer parameters, demonstrating the superiority of the proposed RCs and NCs in introducing intrinsic IBs.
116
+
117
+ # 4.3 Ablation study
118
+
119
+ We use T2T-ViT [93] as our baseline model in the following ablation study of our ViTAE. As shown in Table 3, we investigate the hyper-parameter settings in RCs and NCs by isolating them separately. All the models are trained for 100 epochs on ImageNet and follow the same training setting and data augmentation strategy as described in Section 4.1.
120
+
121
+ Table 2: Comparison of ViTAE and SOTA methods on the ImageNet validation set.
122
+
123
+ <table><tr><td rowspan="2">Type Model</td><td rowspan="2">Params (M)</td><td rowspan="2">MACs (G)</td><td rowspan="2">Input Size</td><td colspan="3">ImageNet Real</td></tr><tr><td>Top-1</td><td>Top-5</td><td>Top-1</td></tr><tr><td rowspan="9">CNN</td><td>ResNet-18 [26]</td><td>11.7</td><td>3.6</td><td>224</td><td>70.3</td><td>86.7</td><td>77.3</td></tr><tr><td>ResNet-50 [26]</td><td>25.6</td><td>7.6</td><td>224</td><td>76.7</td><td>93.3</td><td>82.5</td></tr><tr><td>ResNet-101 [26]</td><td>44.5</td><td>15.2</td><td>224</td><td>78.3</td><td>94.1</td><td>83.7</td></tr><tr><td>ResNet-152 [26]</td><td>60.2</td><td>22.6</td><td>224</td><td>78.9</td><td>94.4</td><td>84.1</td></tr><tr><td>EfficientNet-B0 [73]</td><td>5.3</td><td>0.8</td><td>224</td><td>77.1</td><td>93.3</td><td>83.5</td></tr><tr><td>EfficientNet-B4 [73]</td><td>19.3</td><td>8.4</td><td>380</td><td>82.9</td><td>96.4</td><td>88.0</td></tr><tr><td>MobileNetV1 [31]</td><td>4.3</td><td>0.6</td><td>224</td><td>72.3</td><td>1</td><td>-</td></tr><tr><td>MobileNetV2(1.4) [65]</td><td>6.9</td><td>0.6</td><td>224</td><td>74.7</td><td>-</td><td>-</td></tr><tr><td>RegNetY-600M[62]</td><td>6.1</td><td>1.2</td><td>224</td><td>75.5</td><td>-</td><td>-</td></tr><tr><td>RegNetY-4GF[62] RegNetY-8GF[62]</td><td>20.6 39.2</td><td>8.0 16.0</td><td>224</td><td>80.0</td><td>1</td><td>86.4</td></tr><tr><td></td><td></td><td></td><td></td><td>224</td><td>81.7</td><td>1</td><td>87.4</td></tr><tr><td rowspan="14"></td><td>DeiT-T[76]</td><td>5.7</td><td>2.6</td><td>224</td><td>72.2</td><td>91.1</td><td>80.6</td></tr><tr><td>DeiT-T [76]</td><td>5.7</td><td>2.6</td><td>224</td><td>74.5</td><td>91.9</td><td>82.1</td></tr><tr><td>LocalViT-T[43]</td><td>5.9</td><td>2.6</td><td>224</td><td>74.8</td><td>92.6</td><td></td></tr><tr><td>LocalViT-T2T[43]</td><td>4.3</td><td>2.4</td><td>224</td><td>72.5</td><td>-</td><td>1 1</td></tr><tr><td>ConT-Ti [89]</td><td>5.8</td><td>1.6</td><td>224</td><td>74.9</td><td>-</td><td>-</td></tr><tr><td>PiT-Ti [29]</td><td>4.9</td><td>1.4</td><td>224</td><td>73.0</td><td>-</td><td>1</td></tr><tr><td>T2T-ViT-7 [93]</td><td>4.3</td><td>1.2</td><td>224</td><td>71.7</td><td>90.9</td><td>79.7</td></tr><tr><td>ViTAE-T</td><td>4.8</td><td>1.5</td><td>224</td><td>75.3</td><td>92.7</td><td>82.9</td></tr><tr><td>ViTAE-T ↑ 384</td><td>4.8</td><td>5.7</td><td>384</td><td>77.2</td><td>93.8</td><td>84.4</td></tr><tr><td>CeiT-T [92]</td><td>6.4</td><td>2.4</td><td>224</td><td>76.4</td><td>93.4</td><td>83.6</td></tr><tr><td>ConViT-Ti[15]</td><td>6.0</td><td>2.0</td><td>224</td><td>73.1</td><td>1</td><td>1</td></tr><tr><td>Cross ViT-Ti [6]</td><td>6.9</td><td>3.2</td><td>224</td><td>73.4</td><td>1</td><td>1</td></tr><tr><td>ViTAE-6M</td><td>6.5</td><td>2.0</td><td>224</td><td>77.9</td><td>94.1</td><td>84.9</td></tr><tr><td>PVT-T[80] LocalViT-PVT [43]</td><td>13.2</td><td>3.8</td><td>224</td><td>75.1</td><td>1</td><td></td></tr><tr><td rowspan="8">PiT-XS [29] ConT-M [89] ViTAE-13M DeiT-S [76]</td><td>13.5</td><td>9.6</td><td>224</td><td></td><td>94.2</td><td>-</td></tr><tr><td>ConViT-Ti+ [15] 10.0</td><td>4.0</td><td>224</td><td>78.2 76.7</td><td></td><td>1</td></tr><tr><td></td><td>2.8</td><td></td><td>78.1</td><td>1</td><td>-</td></tr><tr><td>10.6 19.2</td><td>6.2</td><td>224 224</td><td>80.2</td><td>-</td><td>1</td></tr><tr><td>13.2</td><td>3.4</td><td>224</td><td>81.0</td><td>- 95.4</td><td>- 86.8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>22.1 DeiT-S [76] 22.1</td><td>9.8 9.8</td><td>224 224</td><td>79.9 81.2</td><td>95.0 95.4</td><td>85.7 86.8</td></tr><tr><td>PVT-S[80]</td><td>7.6</td><td>224</td><td>79.8</td><td>-</td><td></td></tr><tr><td></td><td>24.5 23.5</td><td>5.2</td><td></td><td>81.3</td><td></td><td>1</td></tr><tr><td>Conformer-Ti [58] Swin-T[47]</td><td></td><td></td><td>224</td><td></td><td>-</td><td></td></tr><tr><td>CeiT-S [92]</td><td>29.0</td><td>9.0</td><td>224</td><td>81.3</td><td>-</td><td>1</td></tr><tr><td>CvT-13 [83]</td><td>24.2 20.0</td><td>9.0</td><td>224</td><td>82.0 81.6</td><td>95.9</td><td>87.3 86.7</td></tr><tr><td>ConViT-S[15]</td><td>27.0</td><td>9.0 10.8</td><td>224 224</td><td>81.3</td><td>1 1</td><td>1</td></tr><tr><td>Cross ViT-S [6]</td><td>26.7</td><td>11.2</td><td>224</td><td>81.0</td><td>1</td><td>1</td></tr><tr><td>PiT-S [29]</td><td>23.5</td><td>4.8</td><td>224</td><td>80.9</td><td></td><td></td></tr><tr><td>TNT-S [23]</td><td></td><td></td><td></td><td></td><td>-</td><td>1</td></tr><tr><td>Twins-PCPVT-S[10]</td><td>23.8</td><td>10.4</td><td>224</td><td>81.3</td><td>95.6</td><td>-</td></tr><tr><td></td><td>24.1</td><td>7.4</td><td>224</td><td>81.2</td><td>-</td><td>-</td></tr><tr><td>Twins-SVT-S [10]</td><td>24.0</td><td>5.6</td><td>224</td><td>81.7</td><td>-</td><td>1</td></tr><tr><td>T2T-ViT-14 [93]</td><td>21.5</td><td>5.2</td><td>224</td><td>81.5</td><td>95.7</td><td>86.8</td></tr><tr><td>ViTAE-S</td><td>23.6</td><td>5.6</td><td>224</td><td>82.0</td><td>95.9</td><td>87.0</td></tr><tr><td>ViTAE-S ↑ 384</td><td>23.6</td><td>20.2</td><td>384</td><td>83.0</td><td>96.2</td><td>87.5</td></tr></table>
124
+
125
+ We use $\checkmark$ and $\times$ to denote whether or not the corresponding module is enabled during the experiments. If all columns under the RC and NC are marked $\times$ as shown in the first row, the model becomes the standard T2T-ViT model. “Pre” indicates the output features of PCM and MHSA are fused before FFN while “Post” indicates a late fusion strategy correspondingly. “BN” indicates whether PCM uses BN after the convolutional layer or not. $\mathit { \Omega } ^ { 6 } \times 3 \mathit { \Omega } ^ { 5 }$ in the first column denotes that the dilation rate set is the same in the three RCs. “ $[ 1 , 2 , 3 , 4 ]$ $\downarrow ^ { \circ }$ denotes using lower dilation rates in deeper RCs, i.e., $\mathcal { S } _ { 1 } = [ 1 , 2 , 3 , 4 ]$ , $S _ { 2 } = [ 1 , 2 , 3 ]$ , $S _ { 3 } = [ 1 , 2 ]$ .
126
+
127
+ As can be seen, using a pre-fusion strategy and BN achieves the best $6 9 . 9 \%$ Top-1 accuracy among other settings. It is noteworthy that all the variants of NC outperform the vanilla T2T-ViT, implying the effectiveness of PCM, which introduces the intrinsic locality IB in transformers. It can also be observed that BN plays an important role in improving the model’s performance as it can help to alleviate the scale deviation between convolution’s and attention’s features. For the RC, we first investigate the impact of using different dilation rates in the PRM, as shown in the first column. As can be seen, using larger dilation rates (e.g., 4 or 5) does not deliver better performance. We suspect that larger dilation rates may lead to plain features in the deeper RCs due to the smaller resolution of feature maps. To
128
+
129
+ Table 3: Ablation Study of RCs and NCs in our ViTAE. “Pre” indicates the output features of PCM and MHSA are fused before FFN while “Post” indicates a late fusion strategy correspondingly. “BN” indicates whether PCM uses BN or not. “ $[ 1 , 2 , 3 , 4 ]$ $\downarrow ^ { \circ }$ denotes using smaller dilation rates in deeper RCs, i.e., $\mathcal { S } _ { 1 } = [ 1 , 2 , 3 , 4 ]$ , $\mathsf { \bar { S } } _ { 2 } = [ 1 , 2 , 3 ]$ , $ { S _ { 3 } } = [ 1 , 2 ]$ .
130
+
131
+ <table><tr><td>Reduction Cell</td><td></td><td>Normal Cell</td><td rowspan="2">Top-1</td></tr><tr><td>Dilation (S1 ~ S3) PCM</td><td>Pre</td><td>BN Post</td></tr><tr><td>× ×</td><td>×</td><td>× ×</td><td>68.7</td></tr><tr><td>× ×</td><td>√</td><td>× ×</td><td>69.1</td></tr><tr><td>× ×</td><td>×</td><td>√ ×</td><td>69.0</td></tr><tr><td>× ×</td><td>×</td><td>√ √</td><td>68.8</td></tr><tr><td>× ×</td><td>√</td><td>× √</td><td>69.9</td></tr><tr><td>[1,2]×3</td><td>× ×</td><td>×</td><td>× 69.5</td></tr><tr><td>[1,2,3]×3 ×</td><td>×</td><td>× ×</td><td>69.9</td></tr><tr><td>[1,2,3,4] × 3 ×</td><td>×</td><td>× ×</td><td>69.2</td></tr><tr><td>[1,2,3,4,5] × 3 ×</td><td>×</td><td>× ×</td><td>68.9</td></tr><tr><td>[1,2,3,4]↓ ×</td><td>×</td><td>× ×</td><td>69.8</td></tr><tr><td>[1,2,3,4]↓ √</td><td>×</td><td>× ×</td><td>71.7</td></tr><tr><td>[1,2,3,4]↓ √</td><td>√</td><td>× √</td><td>72.6</td></tr></table>
132
+
133
+ validate the hypothesis, we use smaller dilation rates in deeper RCs as denoted by $[ 1 , 2 , 3 , 4 ] \downarrow$ . As can be seen, it achieves comparable performance as $[ 1 , 2 , 3 ] \times$ . However, compared with $[ 1 , 2 , 3 , 4 ] \downarrow$ , $[ 1 , 2 , 3 ] \times$ increases the amount of parameters from 4.35M to $4 . 6 \mathsf { M }$ . Therefore, we select $[ 1 , 2 , 3 , 4 ] \downarrow$ as the default setting. In addition, after using PCM in the RC, it introduces the intrinsic locality IB, and the performance increases to $7 1 . 7 \%$ Top-1 accuracy. Finally, the combination of RCs and NCs achieves the best accuracy at $7 2 . 6 \%$ , demonstrating the complementarity between our RCs and NCs.
134
+
135
+ # 4.4 Data efficiency and training efficiency
136
+
137
+ To validate the effectiveness of the introduced intrinsic IBs in improving data efficiency and training efficiency, we compare our ViTAE with T2T-ViT at different training settings: (a) training them using $20 \%$ , $60 \%$ , and $100 \%$ ImageNet training set for equivalent 100 epochs on the full ImageNet training set, e.g., we employ 5 times epochs when using $20 \%$ data for training compared with using $100 \%$ data; and (b) training them using the full ImageNet training set for 100, 200, and 300 epochs respectively. The results are shown in Figure 1. As can be seen, ViTAE consistently outperforms the T2T-ViT baseline by a large margin in terms of both data efficiency and training efficiency. For example, ViTAE using only $20 \%$ training data achieves comparable performance with T2T-ViT using all data. When $60 \%$ training data are used, ViTAE significantly outperforms T2T-ViT using all data by about an absolute $3 \%$ accuracy. It is also noteworthy that ViTAE trained for only 100 epochs has outperformed T2T-ViT trained for 300 epochs. After training ViTAE for 300 epochs, its performance is significantly boosted to $7 5 . 3 \%$ Top-1 accuracy. With the proposed RCs and NCs, the transformer layers in our ViTAE only need to focus on modeling long-range dependencies, leaving the locality and multi-scale context modeling to its convolution counterparts, i.e., PCM and PRM. Such a “divide-and-conquer” strategy facilitates the training of vision transformers, making it possible to learn more efficiently with less training data and fewer training epochs.
138
+
139
+ To further validate the data efficiency of ViTAE model, we train the ViTAE model from scratch on the smaller datasets, i.e., Cifar10 and Cifar100. The results are summarized in Table 4. It can be viewed that with only $1 / 7$ number of epochs, the ViTAE-T model achieves better classification performance on Cifar10 dataset, with far fewer parameters (4.8M v.s. 86M), which further confirms ViTAE model’s data efficiency.
140
+
141
+ Table 4: Results of training from scratch on Cifar10/100.
142
+
143
+ <table><tr><td>Model</td><td>Params (M)</td><td>Top-1 Acc</td><td>Epochs</td><td>Dataset</td></tr><tr><td>DeiT-B</td><td>86.0</td><td>97.5</td><td>7000</td><td>Cifar10</td></tr><tr><td>ViTAE-T</td><td>4.8</td><td>97.7</td><td>1000</td><td>Cifar10</td></tr><tr><td>ViTAE-T</td><td>4.8</td><td>85.0</td><td>1000</td><td>Cifar100</td></tr></table>
144
+
145
+ # 4.5 Generalization on downstream tasks
146
+
147
+ Table 5: Generalization of ViTAE and SOTA methods on different downstream tasks.
148
+
149
+ <table><tr><td>Model</td><td>Params (M)</td><td>Cifar10</td><td>Cifar100</td><td>iNat19</td><td>Cars</td><td>Flowers</td><td>Pets</td></tr><tr><td>Grafit ResNet-50 [78]</td><td>25.6</td><td>-</td><td>=</td><td>75.9</td><td>92.5</td><td>98.2</td><td>-</td></tr><tr><td>EfficientNet-B5 [73]</td><td>30</td><td>98.1</td><td>91.1</td><td>-</td><td>-</td><td>98.5</td><td>-</td></tr><tr><td>ViT-B/16 [19]</td><td>86.5</td><td>98.1</td><td>87.1</td><td>-</td><td>1</td><td>89.5</td><td>93.8</td></tr><tr><td>ViT-L/16 [19]</td><td>304.3</td><td>97.9</td><td>86.4</td><td>-</td><td>-</td><td>89.7</td><td>93.6</td></tr><tr><td>DeiT-B [76]</td><td>86.6</td><td>99.1</td><td>90.8</td><td>77.7</td><td>92.1</td><td>98.4</td><td>-</td></tr><tr><td>T2T-ViT-14 [93]</td><td>21.5</td><td>98.3</td><td>88.4</td><td>-</td><td>-</td><td>-</td><td>1</td></tr><tr><td>ViTAE-T</td><td>4.8</td><td>97.3</td><td>86.0</td><td>73.3</td><td>89.5</td><td>97.5</td><td>92.6</td></tr><tr><td>ViTAE-S</td><td>23.6</td><td>98.8</td><td>90.8</td><td>76.0</td><td>91.4</td><td>97.8</td><td>94.2</td></tr></table>
150
+
151
+ We further investigate the generalization of the proposed ViTAE models on downstream tasks by finetuning them on the training sets of several fine-grained classification tasks3, including Flowers [53], Cars [36], Pets [56], and iNaturalist19. We also fine-tune the proposed ViTAE models on Cifar10 [37] and Cifar100 [37]. The results are shown in Table 5. It can be seen that ViTAE achieves SOTA performance on most of the datasets using comparable or fewer parameters. These results demonstrate that the good generalization ability of our ViTAE.
152
+
153
+ # 4.6 Visual inspection of ViTAE
154
+
155
+ To further analyze the property of our ViTAE, we first calculate the average attention distance of each layer in ViTAE-T and the baseline T2T-ViT-7 on the ImageNet test set, respectively. The results are shown in Figure 3. It can be observed that with the usage of PCM, which focuses on modeling locality, the transformer layers in the proposed NCs can better focus on modeling long-range dependencies, especially in shallow layers. In the deep layers, the average attention distances of ViTAE-T and T2T-ViT-7 are almost the same since modeling long-range dependencies is much more important.
156
+
157
+ These results confirm the effectiveness of the adopted “divide-and-conquer” idea in the proposed ViTAE, i.e., introducing the intrinsic locality IB from convolutions into vision transformers makes it possible that transformer layers only need to be responsible to long-range dependencies, since locality can be well modeled by convolutions in PCM.
158
+
159
+ ![](images/0d27a138487be9062b7073116e5379b9d74b5e8122843b673cecf6fb02d9776d.jpg)
160
+ Figure 3: The average per-layer attention distance of T2T-ViT-7 and our ViTAE-T.
161
+
162
+ Besides, we apply Grad-CAM [66] on the MHSA’s output in the last NC to qualitatively inspect ViTAE. The visualization results are provided in Figure 4. Compared with the baseline T2T-ViT, our ViTAE covers the single or multiple targets in the images more precisely and attends less to the background. Moreover, ViTAE can better handle the scale variance issue as shown in Figure 4(b). Namely, it can precisely cover the birds no matter they are in small, middle, or large size. Such observations demonstrate that introducing the intrinsic IBs of locality and scale-invariance from convolutions to transformers helps ViTAE learn more discriminate features than the pure transformers.
163
+
164
+ ![](images/c40cbf192eae3a11c74a33bbbb56c6df92c409dc0cc54401ef7f9004a71cc003.jpg)
165
+ Figure 4: Visual inspection of T2T-ViT and ViTAE using Grad-CAM [66]. (a) Images containing multiple or single objects and the heatmaps. (b) Images containing the same class of objects at different scales and the heatmaps (Best viewed in color).
166
+
167
+ # 5 Limitation and discussion
168
+
169
+ In this paper, we explore two types of IBs and incorporate them into transformers through the proposed reduction and normal cells. With the collaboration of these two cells, our ViTAE model achieves impressive performance on the ImageNet with fast convergence and high data efficiency. Nevertheless, due to computational resource constraints, we have not scaled the ViTAE model and train it on largesize dataset, e.g., ImageNet-21K [38] and JFT-300M [30]. Although it remains unclear by now, we are optimistic about its scale property from the following preliminary evidence. As illustrated in Figure 2, our ViTAE model can be viewed as an intra-cell ensemble of complementary transformer layers and convolution layers owing to the skip connection and parallel structure. According to the attention distance analysis shown in Figure 3, the ensemble nature enables the transformer layers and convolution layers to focus on what they are good at, i.e., modeling long-range dependencies and locality. Therefore, ViTAE is very likely to learn better feature representation from large-scale data. Besides, we only study two typical IBs in this paper. More kinds of IBs such as constituting viewpoint invariance [64] can be explored in the future study.
170
+
171
+ # 6 Conclusion
172
+
173
+ In this paper, we re-design the transformer block by proposing two basic cells (reduction cells and normal cells) to incorporate two types of intrinsic inductive bias (IB) into transformers, i.e., locality and scale-invariance, resulting in a simple yet effective vision transformer architecture named ViTAE. Extensive experiments show that ViTAE outperforms representative vision transformers in various respects including classification accuracy, data efficiency, training efficiency, and generalization ability on downstream tasks. We plan to scale ViTAE to the large or huge model size and train it on large-size datasets in the future study. In addition, other kinds of IBs will also be investigated. We hope that this study will provide valuable insights to the following studies of introducing intrinsic IB into vision transformers and understanding the impact of intrinsic and learned IBs.
174
+
175
+ Acknowledgement Dr. Jing Zhang is supported by the ARC project FL-170100117.
176
+
177
+ # References
178
+
179
+ processing. RCA engineer, 29(6):33–41, 1984. [2] J. L. Ba, J. R. Kiros, and G. E. Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
180
+ [3] H. Bay, T. Tuytelaars, and L. Van Gool. Surf: Speeded up robust features. In European conference on computer vision, pages 404–417. Springer, 2006. [4] P. J. Burt and E. H. Adelson. The laplacian pyramid as a compact image code. In Readings in computer vision, pages 671–679. Elsevier, 1987.
181
+ [5] Z. Cai and N. Vasconcelos. Cascade r-cnn: Delving into high quality object detection. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 6154–6162, 2018. [6] C.-F. Chen, Q. Fan, and R. Panda. Crossvit: Cross-attention multi-scale vision transformer for image classification. arXiv preprint arXiv:2103.14899, 2021. [7] H. Chen, Y. Wang, T. Guo, C. Xu, Y. Deng, Z. Liu, S. Ma, C. Xu, C. Xu, and W. Gao. Pre-trained image processing transformer. arXiv preprint arXiv:2012.00364, 2020. [8] L.-C. Chen, G. Papandreou, F. Schroff, and H. Adam. Rethinking atrous convolution for semantic image segmentation. arXiv preprint arXiv:1706.05587, 2017.
182
+ [9] X. Chen, S. Xie, and K. He. An empirical study of training self-supervised vision transformers. arXiv preprint arXiv:2104.02057, 2021.
183
+ [10] X. Chu, Z. Tian, Y. Wang, B. Zhang, H. Ren, X. Wei, H. Xia, and C. Shen. Twins: Revisiting spatial attention design in vision transformers. arXiv preprint arXiv:2104.13840, 2021.
184
+ [11] X. Chu, Z. Tian, B. Zhang, X. Wang, X. Wei, H. Xia, and C. Shen. Conditional positional encodings for vision transformers. arXiv preprint arXiv:2102.10882, 2021.
185
+ [12] M. Contributors. MMSegmentation: Openmmlab semantic segmentation toolbox and benchmark. https: //github.com/open-mmlab/mmsegmentation, 2020.
186
+ [13] M. Contributors. Openmmlab pose estimation toolbox and benchmark. https://github.com/ open-mmlab/mmpose, 2020.
187
+ [14] Z. Dai, Z. Yang, Y. Yang, J. Carbonell, Q. V. Le, and R. Salakhutdinov. Transformer-xl: Attentive language models beyond a fixed-length context. arXiv preprint arXiv:1901.02860, 2019.
188
+ [15] S. d’Ascoli, H. Touvron, M. Leavitt, A. Morcos, G. Biroli, and L. Sagun. Convit: Improving vision transformers with soft convolutional inductive biases. arXiv preprint arXiv:2103.10697, 2021.
189
+ [16] H. Demirel and G. Anbarjafari. Image resolution enhancement by using discrete and stationary wavelet decomposition. IEEE transactions on image processing, 20(5):1458–1460, 2010.
190
+ [17] J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
191
+ [18] X. Ding, X. Zhang, J. Han, and G. Ding. Repmlp: Re-parameterizing convolutions into fully-connected layers for image recognition. arXiv preprint arXiv:2105.01883, 2021.
192
+ [19] A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
193
+ [20] A. El-Nouby, H. Touvron, M. Caron, P. Bojanowski, M. Douze, A. Joulin, I. Laptev, N. Neverova, G. Synnaeve, J. Verbeek, et al. Xcit: Cross-covariance image transformers. arXiv preprint arXiv:2106.09681, 2021.
194
+ [21] B. Graham, A. El-Nouby, H. Touvron, P. Stock, A. Joulin, H. Jégou, and M. Douze. Levit: a vision transformer in convnet’s clothing for faster inference. arXiv preprint arXiv:2104.01136, 2021.
195
+ [22] M.-H. Guo, Z.-N. Liu, T.-J. Mu, and S.-M. Hu. Beyond self-attention: External attention using two linear layers for visual tasks. arXiv preprint arXiv:2105.02358, 2021.
196
+ [23] K. Han, A. Xiao, E. Wu, J. Guo, C. Xu, and Y. Wang. Transformer in transformer. arXiv preprint arXiv:2103.00112, 2021.
197
+ [24] K. He, G. Gkioxari, P. Dollár, and R. Girshick. Mask r-cnn. In Proceedings of the IEEE international conference on computer vision, pages 2961–2969, 2017.
198
+ [25] K. He, X. Zhang, S. Ren, and J. Sun. Spatial pyramid pooling in deep convolutional networks for visual recognition. IEEE transactions on pattern analysis and machine intelligence, 37(9):1904–1916, 2015.
199
+ [26] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016.
200
+ [27] L. He, Y. Dong, Y. Wang, D. Tao, and Z. Lin. Gauge equivariant transformer. In Thirty-Fifth Conference on Neural Information Processing Systems, 2021.
201
+ [28] B. Heo, S. Yun, D. Han, S. Chun, J. Choe, and S. J. Oh. Rethinking spatial dimensions of vision transformers. In International Conference on Computer Vision (ICCV), 2021.
202
+ [29] B. Heo, S. Yun, D. Han, S. Chun, J. Choe, and S. J. Oh. Rethinking spatial dimensions of vision transformers. arXiv preprint arXiv:2103.16302, 2021.
203
+ [30] G. Hinton, O. Vinyals, and J. Dean. Distilling the knowledge in a neural network. In NIPS Deep Learning and Representation Learning Workshop, 2015.
204
+ [31] A. G. Howard, M. Zhu, B. Chen, D. Kalenichenko, W. Wang, T. Weyand, M. Andreetto, and H. Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017.
205
+ [32] G. Huang, Z. Liu, L. Van Der Maaten, and K. Q. Weinberger. Densely connected convolutional networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4700–4708, vision transformer. arXiv preprint arXiv:2106.03650, 2021.
206
+ [34] S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International conference on machine learning, pages 448–456. PMLR, 2015.
207
+ [35] Y. Ke and R. Sukthankar. Pca-sift: A more distinctive representation for local image descriptors. In Proceedings of the IEEE conference on computer vision and pattern recognition, volume 2, pages II–II. IEEE, 2004.
208
+ [36] J. Krause, M. Stark, J. Deng, and L. Fei-Fei. 3d object representations for fine-grained categorization. In 4th International IEEE Workshop on 3D Representation and Recognition (3dRR-13), Sydney, Australia, 2013.
209
+ [37] A. Krizhevsky, G. Hinton, et al. Learning multiple layers of features from tiny images. 2009.
210
+ [38] A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems, 25:1097–1105, 2012.
211
+ [39] W.-S. Lai, J.-B. Huang, N. Ahuja, and M.-H. Yang. Deep laplacian pyramid networks for fast and accurate super-resolution. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 624–632, 2017.
212
+ [40] Z. Lan, M. Chen, S. Goodman, K. Gimpel, P. Sharma, and R. Soricut. Albert: A lite bert for self-supervised learning of language representations. arXiv preprint arXiv:1909.11942, 2019.
213
+ [41] Y. LeCun, Y. Bengio, et al. Convolutional networks for images, speech, and time series. The handbook of brain theory and neural networks, 3361(10):1995, 1995.
214
+ [42] Y. LeCun, Y. Bengio, and G. Hinton. Deep learning. nature, 521(7553):436–444, 2015.
215
+ [43] Y. Li, K. Zhang, J. Cao, R. Timofte, and L. Van Gool. Localvit: Bringing locality to vision transformers. arXiv preprint arXiv:2104.05707, 2021.
216
+ [44] G. Lin, C. Shen, A. Van Den Hengel, and I. Reid. Efficient piecewise training of deep structured models for semantic segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3194–3203, 2016.
217
+ [45] T.-Y. Lin, P. Dollár, R. Girshick, K. He, B. Hariharan, and S. Belongie. Feature pyramid networks for object detection. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2117–2125, 2017.
218
+ [46] Y. Liu, M. Ott, N. Goyal, J. Du, M. Joshi, D. Chen, O. Levy, M. Lewis, L. Zettlemoyer, and V. Stoyanov. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692, 2019.
219
+ [47] Z. Liu, Y. Lin, Y. Cao, H. Hu, Y. Wei, Z. Zhang, S. Lin, and B. Guo. Swin transformer: Hierarchical vision transformer using shifted windows. arXiv preprint arXiv:2103.14030, 2021.
220
+ [48] I. Loshchilov and F. Hutter. Decoupled weight decay regularization. In International Conference on Learning Representations, 2018.
221
+ [49] W. Luo, Y. Li, R. Urtasun, and R. S. Zemel. Understanding the effective receptive field in deep convolutional neural networks. In Proceedings of the 30th International Conference on Neural Information Processing Systems, volume 29, pages 4898–4906, 2016.
222
+ [50] L. Melas-Kyriazi. Do you even need attention? a stack of feed-forward layers does surprisingly well on imagenet. arXiv: Computer Vision and Pattern Recognition, 2021.
223
+ [51] H. Nam, J.-W. Ha, and J. Kim. Dual attention networks for multimodal reasoning and matching. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 299–307, 2017.
224
+ [52] P. C. Ng and S. Henikoff. Sift: Predicting amino acid changes that affect protein function. Nucleic acids research, 31(13):3812–3814, 2003.
225
+ [53] M.-E. Nilsback and A. Zisserman. Automated flower classification over a large number of classes. In Indian Conference on Computer Vision, Graphics and Image Processing, Dec 2008.
226
+ [54] S. W. Oh, J.-Y. Lee, N. Xu, and S. J. Kim. Video object segmentation using space-time memory networks. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 9226–9235, 2019.
227
+ [55] H. Olkkonen and P. Pesola. Gaussian pyramid wavelet transform for multiresolution analysis of images. Graphical Models and Image Processing, 58(4):394–398, 1996.
228
+ [56] O. M. Parkhi, A. Vedaldi, A. Zisserman, and C. V. Jawahar. Cats and dogs. In IEEE Conference on Computer Vision and Pattern Recognition, 2012.
229
+ [57] A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga, A. Desmaison, A. Kopf, E. Yang, Z. DeVito, M. Raison, A. Tejani, S. Chilamkurthy, B. Steiner, L. Fang, J. Bai, and S. Chintala. Pytorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems, volume 32, pages 8026–8037, 2019.
230
+ [58] Z. Peng, W. Huang, S. Gu, L. Xie, Y. Wang, J. Jiao, and Q. Ye. Conformer: Local features coupling global representations for visual recognition. arXiv preprint arXiv:2105.03889, 2021.
231
+ [59] F. Perazzi, J. Pont-Tuset, B. McWilliams, L. Van Gool, M. Gross, and A. Sorkine-Hornung. A benchmark dataset and evaluation methodology for video object segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 724–732, 2016.
232
+ [60] J. Pont-Tuset, F. Perazzi, S. Caelles, P. Arbeláez, A. Sorkine-Hornung, and L. Van Gool. The 2017 davis challenge on video object segmentation. arXiv preprint arXiv:1704.00675, 2017.
233
+ [61] A. Radford, J. Wu, R. Child, D. Luan, D. Amodei, and I. Sutskever. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019.
234
+ [62] I. Radosavovic, R. P. Kosaraju, R. Girshick, K. He, and P. Dollár. Designing network design spaces. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 10428–10436, 2020.
235
+ [63] E. Rublee, V. Rabaud, K. Konolige, and G. Bradski. Orb: An efficient alternative to sift or surf. In Proceedings of the IEEE international conference on computer vision, pages 2564–2571. Ieee, 2011.
236
+ [64] S. Sabour, N. Frosst, and G. E. Hinton. Dynamic routing between capsules. arXiv preprint arXiv:1710.09829, 2017.
237
+ [65] M. Sandler, A. Howard, M. Zhu, A. Zhmoginov, and L.-C. Chen. Mobilenetv2: Inverted residuals and linear bottlenecks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4510–4520, 2018.
238
+ [66] R. R. Selvaraju, M. Cogswell, A. Das, R. Vedantam, D. Parikh, and D. Batra. Grad-cam: Visual explanations from deep networks via gradient-based localization. In Proceedings of the IEEE international conference on computer vision, pages 618–626, 2017.
239
+ [67] P. Shaw, J. Uszkoreit, and A. Vaswani. Self-attention with relative position representations. arXiv preprint arXiv:1803.02155, 2018.
240
+ [68] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
241
+ [69] A. Srinivas, T.-Y. Lin, N. Parmar, J. Shlens, P. Abbeel, and A. Vaswani. Bottleneck transformers for visual recognition. arXiv preprint arXiv:2101.11605, 2021.
242
+ [70] C. Szegedy, S. Ioffe, V. Vanhoucke, and A. Alemi. Inception-v4, inception-resnet and the impact of residual connections on learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 31, 2017.
243
+ [71] C. Szegedy, W. Liu, Y. Jia, P. Sermanet, S. Reed, D. Anguelov, D. Erhan, V. Vanhoucke, and A. Rabinovich. Going deeper with convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1–9, 2015.
244
+ [72] C. Szegedy, V. Vanhoucke, S. Ioffe, J. Shlens, and Z. Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2818–2826, 2016.
245
+ [73] M. Tan and Q. Le. Efficientnet: Rethinking model scaling for convolutional neural networks. In International Conference on Machine Learning, pages 6105–6114. PMLR, 2019.
246
+ [74] I. Tolstikhin, N. Houlsby, A. Kolesnikov, L. Beyer, X. Zhai, T. Unterthiner, J. Yung, D. Keysers, J. Uszkoreit, M. Lucic, and A. Dosovitskiy. Mlp-mixer: An all-mlp architecture for vision. arXiv preprint arXiv:2105.01601, 2021.
247
+ [75] H. Touvron, P. Bojanowski, M. Caron, M. Cord, A. El-Nouby, E. Grave, A. Joulin, G. Synnaeve, J. Verbeek, and H. Jégou. Resmlp: Feedforward networks for image classification with data-efficient training. arXiv preprint arXiv:2105.03404, 2021.
248
+ [76] H. Touvron, M. Cord, M. Douze, F. Massa, A. Sablayrolles, and H. Jégou. Training data-efficient image transformers & distillation through attention. arXiv preprint arXiv:2012.12877, 2020.
249
+ [77] H. Touvron, M. Cord, A. Sablayrolles, G. Synnaeve, and H. Jégou. Going deeper with image transformers. arXiv preprint arXiv:2103.17239, 2021.
250
+ [78] H. Touvron, A. Sablayrolles, M. Douze, M. Cord, and H. Jégou. Grafit: Learning fine-grained image representations with coarse labels. arXiv preprint arXiv:2011.12982, 2020.
251
+ [79] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and I. Polosukhin. Attention is all you need. In Proceedings of the 31st International Conference on Neural Information Processing Systems, volume 30, pages 5998–6008, 2017.
252
+ [80] W. Wang, E. Xie, X. Li, D.-P. Fan, K. Song, D. Liang, T. Lu, P. Luo, and L. Shao. Pyramid vision transformer: A versatile backbone for dense prediction without convolutions. arXiv preprint arXiv:2102.12122, 2021.
253
+ [81] X. Wang, R. Girshick, A. Gupta, and K. He. Non-local neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7794–7803, 2018.
254
+ [82] R. Wightman. Pytorch image models. https://github.com/rwightman/pytorch-image-models, 2019.
255
+ [83] H. Wu, B. Xiao, N. Codella, M. Liu, X. Dai, L. Yuan, and L. Zhang. Cvt: Introducing convolutions to vision transformers. arXiv preprint arXiv:2103.15808, 2021.
256
+ [84] B. Xiao, H. Wu, and Y. Wei. Simple baselines for human pose estimation and tracking. In Proceedings of the European Conference on Computer Vision (ECCV), September 2018.
257
+ [85] T. Xiao, Y. Liu, B. Zhou, Y. Jiang, and J. Sun. Unified perceptual parsing for scene understanding. In Proceedings of the European Conference on Computer Vision (ECCV), pages 418–434, 2018.
258
+ [86] J. Xie, R. Zeng, Q. Wang, Z. Zhou, and P. Li. So-vit: Mind visual tokens for vision transformer. arXiv preprint arXiv:2104.10935, 2021.
259
+ [87] S. Xie, R. Girshick, P. Dollár, Z. Tu, and K. He. Aggregated residual transformations for deep neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1492–1500, 2017.
260
+ [88] W. Xu, Y. Xu, T. Chang, and Z. Tu. Co-scale conv-attentional image transformers. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pages 9981–9990, October 2021.
261
+ [89] H. Yan, Z. Li, W. Li, C. Wang, M. Wu, and C. Zhang. Contnet: Why not use convolution and transformer at the same time? arXiv preprint arXiv:2104.13497, 2021.
262
+ [90] F. Yu and V. Koltun. Multi-scale context aggregation by dilated convolutions. In ICLR 2016 : International Conference on Learning Representations 2016, 2016.
263
+ [91] F. Yu, V. Koltun, and T. Funkhouser. Dilated residual networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 472–480, 2017.
264
+ [92] K. Yuan, S. Guo, Z. Liu, A. Zhou, F. Yu, and W. Wu. Incorporating convolution designs into visual transformers. arXiv preprint arXiv:2103.11816, 2021.
265
+ [93] L. Yuan, Y. Chen, T. Wang, W. Yu, Y. Shi, Z. Jiang, F. E. Tay, J. Feng, and S. Yan. Tokens-to-token vit: Training vision transformers from scratch on imagenet. arXiv preprint arXiv:2101.11986, 2021.
266
+ [94] M. D. Zeiler and R. Fergus. Visualizing and understanding convolutional networks. In European conference on computer vision, pages 818–833. Springer, 2014.
267
+ [95] X. Zhang, X. Zhou, M. Lin, and J. Sun. Shufflenet: An extremely efficient convolutional neural network for mobile devices. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 6848–6856, 2018.
268
+ [96] H. Zhao, J. Shi, X. Qi, X. Wang, and J. Jia. Pyramid scene parsing network. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2881–2890, 2017.
269
+ [97] S. Zheng, J. Lu, H. Zhao, X. Zhu, Z. Luo, Y. Wang, Y. Fu, J. Feng, T. Xiang, P. H. S. Torr, and L. Zhang. Rethinking semantic segmentation from a sequence-to-sequence perspective with transformers. arXiv preprint arXiv:2012.15840, 2020.
270
+ [98] B. Zhou, H. Zhao, X. Puig, S. Fidler, A. Barriuso, and A. Torralba. Scene parsing through ade20k dataset. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 633–641, 2017.
271
+ [99] B. Zhou, H. Zhao, X. Puig, T. Xiao, S. Fidler, A. Barriuso, and A. Torralba. Semantic understanding of scenes through the ade20k dataset. International Journal of Computer Vision, 127(3):302–321, 2019.
272
+ [100] X. Zhu, W. Su, L. Lu, B. Li, X. Wang, and J. Dai. Deformable detr: Deformable transformers for end-to-end object detection. In International Conference on Learning Representations, 2021.
md/train/_SKUm2AJpvN/_SKUm2AJpvN.md ADDED
@@ -0,0 +1,325 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DECOUPLING REPRESENTATION LEARNING FROM REINFORCEMENT LEARNING
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ In an effort to overcome limitations of reward-driven feature learning in deep reinforcement learning (RL) from images, we propose decoupling representation learning from policy learning. To this end, we introduce a new unsupervised learning (UL) task, called Augmented Temporal Contrast (ATC), which trains a convolutional encoder to associate pairs of observations separated by a short time difference, under image augmentations and using a contrastive loss. In online RL experiments, we show that training the encoder exclusively using ATC matches or outperforms end-to-end RL in most environments. Additionally, we benchmark several leading UL algorithms by pre-training encoders on expert demonstrations and using them, with weights frozen, in RL agents; we find that agents using ATC-trained encoders outperform all others. We also train multi-task encoders on data from multiple environments and show generalization to different downstream RL tasks. Finally, we ablate components of ATC, and introduce a new data augmentation to enable replay of (compressed) latent images from pre-trained encoders when RL requires augmentation. Our experiments span visually diverse RL benchmarks in DeepMind Control, DeepMind Lab, and Atari, and our complete code is available at hiddenurl.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Ever since the first fully-learned approach succeeded at playing Atari games from screen images (Mnih et al., 2015), standard practice in deep reinforcement learning (RL) has been to learn visual features and a control policy jointly, end-to-end. Several such deep RL algorithms have matured (Hessel et al., 2018; Schulman et al., 2017; Mnih et al., 2016; Haarnoja et al., 2018) and have been successfully applied to domains ranging from real-world (Levine et al., 2016; Kalashnikov et al., 2018) and simulated robotics (Lee et al., 2019; Laskin et al., 2020a; Hafner et al., 2020) to sophisticated video games (Berner et al., 2019; Jaderberg et al., 2019), and even high-fidelity driving simulators (Dosovitskiy et al., 2017). While the simplicity of end-to-end methods is appealing, relying on the reward function to learn visual features can be severely limiting. For example, it leaves features difficult to acquire under sparse rewards, and it can narrow their utility to a single task. Although our intent is broader than to focus on either sparse-reward or multi-task settings, they arise naturally in our studies. We investigate how to learn visual representations which are agnostic to rewards, without degrading the control policy.
12
+
13
+ A number of recent works have significantly improved RL performance by introducing auxiliary losses, which are unsupervised tasks that provide feature-learning signal to the convolution neural network (CNN) encoder, additionally to the RL loss (Jaderberg et al., 2017; van den Oord et al., 2018; Laskin et al., 2020b; Guo et al., 2020; Schwarzer et al., 2020). Meanwhile, in the field of computer vision, recent efforts in unsupervised and self-supervised learning (Chen et al., 2020; Grill et al., 2020; He et al., 2019) have demonstrated that powerful feature extractors can be learned without labels, as evidenced by their usefulness for downstream tasks such as ImageNet classification. Together, these advances suggest that visual features for RL could possibly be learned entirely without rewards, which would grant greater flexibility to improve overall learning performance. To our knowledge, however, no single unsupervised learning (UL) task has been shown adequate for this purpose in general vision-based environments.
14
+
15
+ In this paper, we demonstrate the first decoupling of representation learning from reinforcement learning that performs as well as or better than end-to-end RL. We update the encoder weights using only UL and train a control policy independently, on the (compressed) latent images. This capability stands in contrast to previous state-of-the-art methods, which have trained the UL and RL objectives jointly, or Laskin et al. (2020b), which observed diminished performance with decoupled encoders.
16
+
17
+ Our main enabling contribution is a new unsupervised task tailored to reinforcement learning, which we call Augmented Temporal Contrast (ATC). ATC requires a model to associate observations from nearby time steps within the same trajectory (Anand et al., 2019). Observations are encoded via a convolutional neural network (shared with the RL agent) into a small latent space, where the InfoNCE loss is applied (van den Oord et al., 2018). Within each randomly sampled training batch, the positive observation, $o _ { t + k }$ , for every anchor, $o _ { t }$ , serves as negative for all other anchors. For regularization, observations undergo stochastic data augmentation (Laskin et al., 2020b) prior to encoding, namely random shift (Kostrikov et al., 2020), and a momentum encoder (He et al., 2020; Laskin et al., 2020b) is used to process the positives. A learned predictor layer further processes the anchor code (Grill et al., 2020; Chen et al., 2020) prior to contrasting. In summary, our algorithm is a novel combination of elements that enables generic learning of the structure of observations and transitions in MDPs without requiring rewards or actions as input.
18
+
19
+ We include extensive experimental studies establishing the effectiveness of our algorithm in a visually diverse range of common RL environments: DeepMind Control Suite (DMControl; Tassa et al. 2018), DeepMind Lab (DMLab; Beattie et al. 2016), and Atari (Bellemare et al., 2013). Our experiments span discrete and continuous control, 2D and 3D visuals, and both on-policy and off policy RL algorithms. Complete code for all of our experiments is available at hiddenurl. Our empirical contributions are summarized as follows:
20
+
21
+ Online RL with UL: We find that the convolutional encoder trained solely with the unsupervised ATC objective can fully replace the end-to-end RL encoder without degrading policy performance. ATC achieves nearly equal or greater performance in all DMControl and DMLab environments tested and in 5 of the 8 Atari games tested. In the other 3 Atari games, using ATC as an auxiliary loss or for weight initialization still brings improvements over end-to-end RL.
22
+
23
+ Encoder Pre-Training Benchmarks: We pre-train the convolutional encoder to convergence on expert demonstrations, and evaluate it by training an RL agent using the encoder with weights frozen. We find that ATC matches or outperforms all prior UL algorithms as tested across all domains, demonstrating that ATC is a state-of-the-art UL algorithm for RL.
24
+
25
+ Multi-Task Encoders: An encoder is trained on demonstrations from multiple environments, and is evaluated, with weights frozen, in separate downstream RL agents. A single encoder trained on four DMControl environments generalizes successfully, performing equal or better than end-to-end RL in four held-out environments. Similar attempts to generalize across eight diverse Atari games result in mixed performance, confirming some limited feature sharing among games.
26
+
27
+ Ablations and Encoder Analysis: Components of ATC are ablated, showing their individual effects. Additionally, data augmentation is shown to be necessary in DMControl during RL even when using a frozen encoder. We introduce a new augmentation, subpixel random shift, which matches performance while augmenting the latent images, unlocking computation and memory benefits.
28
+
29
+ # 2 RELATED WORK
30
+
31
+ Several recent works have used unsupervised/self-supervised representation learning methods to improve performance in RL. The UNREAL agent (Jaderberg et al., 2017) introduced unsupervised auxiliary tasks to deep RL, including the Pixel Control task, a Q-learning method requiring predictions of screen changes in discrete control environments, which has become a standard in DMLab (Hessel et al., 2019). CPC (van den Oord et al., 2018) applied contrastive losses over multiple time steps as an auxiliary task for the convolutional and recurrent layers of RL agents, and it has been extended with future action-conditioning (Guo et al., 2018). Recently, PBL (Guo et al., 2020) surpassed these methods with an auxiliary loss of forward and backward predictions in the recurrent latent space using partial agent histories. Where the trend is of increasing sophistication in auxiliary recurrent architectures, our algorithm is markedly simpler, requiring only observations, and yet it proves sufficient in partially observed settings (POMDPs).
32
+
33
+ ST-DIM (Anand et al., 2019) introduced various temporal, contrastive losses, including ones that operate on “local” features from an intermediate layer within the encoder, without data augmentation. CURL (Laskin et al., 2020b) introduced an augmented, contrastive auxiliary task similar to ours, including a momentum encoder but without temporal contrast. Mazoure et al. (2020) provided extensive analysis pertaining to InfoNCE losses on functions of successive time steps in MDPs, including local features in their auxiliary loss (DRIML) similar to ST-DIM, and finally conducted experiments using global temporal contrast of augmented observations in the Procgen (Cobbe et al., 2019) environment. Most recently, MPR (Schwarzer et al., 2020) combined data augmentation with multi-step, convolutional forward modeling and a similarity loss to improve DQN agents in the Atari 100k benchmark. Hafner et al. (2019; 2020); Lee et al. (2019) proposed to leverage world-modeling in a latent-space for continuous control. A small number of model-free methods have attempted to decouple encoder training from the RL loss as ablations, but have met reduced performance relative to end-to-end RL (Laskin et al., 2020b; Lee et al., 2020). None have previously been shown effective in as diverse a collection of RL environments as ours (Bellemare et al., 2013; Tassa et al., 2018; Beattie et al., 2016).
34
+
35
+ Finn et al. (2016); Ha & Schmidhuber (2018) are example works which pretrained encoder features in advance using image reconstruction losses such as the VAE (Kingma & Welling, 2013). Devin et al. (2018); Kipf et al. (2019) pretrained object-centric representations, the latter learning a forward model by way of contrastive losses; Yan et al. (2020) introduced a similar technique to learn encoders supporting manipulation of deformable objects by traditional control methods. MERLIN (Wayne et al., 2018) trained a convolutional encoder and sophisticated memory module online, detached from the RL agent, which learned read-only accesses to memory. It used reconstruction and one-step latent-prediction losses and achieved high performance in DMLab-like environments with extreme partial observability. Our loss function may benefit those settings, as it outperforms similar reconstruction losses in our experiments. Decoupling unsupervised pretraining from downstream tasks is common in computer vision (Henaff et al., 2019; He et al., 2019; Chen et al., 2020) and has ´ favorable properties of providing task agnostic features which can be used for training smaller taskspecific networks, yielding significant gains in computational efficiency over end-to-end methods.
36
+
37
+ # 3 AUGMENTED TEMPORAL CONTRAST
38
+
39
+ Our unsupervised learning task, Augmented Temporal Contrast (ATC), requires a model to associate an observation, $o _ { t }$ , with one from a specified, near-future time step, $o _ { t + k }$ . Within each training batch, we apply stochastic data augmentation to the observations (Laskin et al., 2020b), namely random shift (Kostrikov et al., 2020), which is simple to implement and provides highly effective regularization in most cases. The augmented observations are encoded into a small latent space where a contrastive loss is applied. This task encourages the learned encoder to extract meaningful elements of the structure of the MDP from observations.
40
+
41
+ Our architecture for ATC consists of four learned components - (i) a convolutional encoder, $f _ { \theta }$ , which processes the anchor observation, $o _ { t }$ , into the latent image $z _ { t } ~ = ~ f _ { \theta } ( \operatorname { A U G } ( o _ { t } ) )$ , (ii) a linear global compressor, $g _ { \phi }$ to produce a small latent code vector $c _ { t } = g _ { \phi } ( z _ { t } )$ , (iii) a residual predictor MLP, $h _ { \psi }$ , which acts as an implicit forward model to advance the code $p _ { t } ~ = ~ h _ { \psi } ( c _ { t } ) + c _ { t }$ and (iv) a contrastive transformation matrix, $W$ . To process the positive observation, $o _ { t + k }$ into the target code $\bar { c } _ { t \pm k } = \bar { g _ { \bar { \phi } } } ( f _ { \bar { \theta } } ( \operatorname { A U G } ( o _ { t + k } ) )$ , we use a momentum encoder (He et al., 2019) parameterized as a slowly moving average of the weights from the learned encoder and compressor layer:
42
+
43
+ ![](images/baabe3a71bc43acb562a542e60773e7f84f3eea98027ab6fe84d45f9966eb5b7.jpg)
44
+ Figure 1: Augmented Temporal Contrast— augmented observations are processed through a learned encoder $f _ { \theta }$ , compressor, $g _ { \phi }$ and residual predictor $h _ { \psi }$ , and are associated through a contrastive loss with a positive example from $k$ time steps later, processed through a momentum encoder.
45
+
46
+ $$
47
+ \bar { \theta } ( 1 - \tau ) \bar { \theta } + \tau \theta ; \qquad \bar { \phi } ( 1 - \tau ) \bar { \phi } + \tau \phi .
48
+ $$
49
+
50
+ The complete architecture is shown in Figure 1. The convolutional encoder, $f _ { \theta }$ , alone is shared with the RL agent.
51
+
52
+ We employ the InfoNCE loss (Gutmann & Hyvarinen, 2010; van den Oord et al., 2018) using log- ¨ its computed bilinearly, as $l ~ = ~ p _ { t } W \bar { c } _ { t + k }$ . In our implementation, every anchor in the training batch utilizes the positives corresponding to all other anchors as its negative examples. Denoting an observation indexed from dataset $\mathcal { O }$ as $o _ { i }$ , and its positive as $o _ { i + }$ , the logits can be written as $l _ { i , j + } = p _ { i } W \bar { c } _ { j + }$ ; our loss function in practice is:
53
+
54
+ $$
55
+ \mathcal { L } ^ { A T C } = - \mathbb { E } _ { \mathcal { O } } \left[ \log \frac { \exp l _ { i , i + } } { \sum _ { o _ { j } \in \mathcal { O } } \exp l _ { i , j + } } \right] .
56
+ $$
57
+
58
+ # 4 EXPERIMENTS
59
+
60
+ # 4.1 EVALUATION ENVIRONMENTS AND ALGORITHMS
61
+
62
+ We evaluate ATC on three standard, visually diverse RL benchmarks - the DeepMind control suite (DMControl; Tassa et al. 2018), Atari games in the Arcade Learning Environment (Bellemare et al., 2013), and DeepMind Lab (DMLab; Beattie et al. 2016). Atari requires discrete control in arcadestyle games. DMControl is comprised of continuous control robotic locomotion and manipulation tasks. In contrast, DMLab requries the RL agent to reason in more visually complex 3D maze environments with partial observability.
63
+
64
+ We use ATC to enhance both on-policy and off-policy RL algorithms. For DMControl, we use RADSAC (Laskin et al., 2020a; Haarnoja et al., 2018) with the augmentation of Kostrikov et al. (2020), which randomly shifts the image in each coordinate (by up to 4 pixels), replicating edge pixel values as necessary to restore the original image size. A difference from prior work is that we use more downsampling in our convolutional network, by using strides $( 2 , 2 , 2 , 1 )$ instead of $( 2 , 1 , 1 , 1 )$ to reduce the convolution output image by $2 5 \mathrm { x }$ .1 For both Atari and DMLab, we use PPO (Schulman et al., 2017). In Atari, we use feed-forward agents, sticky actions, and no end-of-life boundaries for RL episodes. In DMLab we used recurrent, LSTM agents receiving only a single time-step image input, the four-layer convolution encoder from Jaderberg et al. (2019), and we tuned the entropy bonus for each level. In the online setting, the ATC loss is trained using small replay buffer of recent experiences.
65
+
66
+ We include all our own baselines for fair comparison and provide complete settings in an appendix. Unless otherwise noted, each curve represents a minimum of 3 random seeds. The bold lines show the average, and the lightly shaded area around each curve represents the maximum extent of the best and worst seeds at each checkpoint.
67
+
68
+ # 4.2 ONLINE RL WITH ATC
69
+
70
+ DMControl In the online setting, we found ATC to be capable of training the encoder by itself (i.e., with encoder fully detached from any RL gradient update), achieving essentially equal or better scores versus end-to-end RL in all six environments we tested, Figure 2. In CARTPOLE-SWINGUPSPARSE, where rewards are only received once the pole reaches vertical, ATC training enabled the agent to master the task significantly faster. The encoder is trained with one update for every RL update to the policy, using the same batch size, except in CHEETAH-RUN, which required twice the ATC updates.
71
+
72
+ DMLab We experimented with two kinds of levels in DMLab: EXPLORE GOAL LOCATIONS, which requires repeatedly navigating a maze whose layout is randomized every episode, and LASERTAG THREE OPPONENTS, which requires fast reflexes to pursue and tag enemies at a distance. We found ATC capable of training fully detached encoders while achieving equal or better performance than end-to-end RL. Results are shown in Figure 3. Both environments exhibit sparsity which is greater in the “large” version than the “small” version, which our algorithm addresses, discussed next.
73
+
74
+ ![](images/3bc961b4e4d3021562434fb49dfc796b984802350f35775720c5fb85ddde2e02.jpg)
75
+ Figure 2: Online encoder training by ATC, fully detached from RL training, performs as well as end-to-end RL in DMControl, and better in sparse-reward environments (environment steps shown, see appendix for action repeats). Each curve is 10 random seeds.
76
+
77
+ In EXPLORE, the goal object is rarely seen, especially early on, making its appearance difficult to learn. We therefore introduced prioritized sampling for ATC , with priorities corresponding to empirical absolute returns: $p \propto 1 + R _ { a b s }$ , where $\begin{array} { r } { R _ { a b s } ^ { - } = \sum _ { t = 0 } ^ { n } \gamma ^ { t } | r _ { t } | } \end{array}$ , to train more frequently on more informative scenes.2 Whereas uniform-ATC performs slightly below RL, uniform-ATC outperforms RL and nearly matches using ATC (uniform) as an auxiliary task. By considering the encoder as a stand-alone feature extractor separate from the policy, no importance sampling correction is required.
78
+
79
+ In LASERTAG, enemies are often seen, but the reward of tagging one is rarely achieved by the random agent. ATC learns the relevant features anyway, boosting performance while the RL-only agent remains at zero average score. We found that increasing the rate of UL training to do twice as many updates3 further improved the score to match the ATC-auxiliary agent, showing flexibility to address the representation-learning bottleneck when opponents are dispersed.
80
+
81
+ ![](images/529869cdc0639395a9c3ea1832e5de7f047624be22923583fb22ece1a3bdf01b.jpg)
82
+ Figure 3: Online encoder training by ATC, fully detached from the RL agent, performs as well or better than end-to-end RL in DMLab (1 agent step $= 4$ environment steps, the standard action repeat). Prioritized ATC replay (EXPLORE) or increased ATC training (LASERTAG) addresses sparsities to nearly match performance of RL with ATC as an auxiliary loss $( \mathrm { R L + A T C }$ ). Each curve is 3 random seeds.
83
+
84
+ Atari We tested a diverse subset of eight Atari games, shown in Figure 4. We found detachedencoder training to work as well as end-to-end RL in five games, but performance suffered in BREAKOUT and SPACE INVADERS in particular. Using ATC as an auxiliary task, however, improves performance in these games and others. We found it helpful to anneal the amount of UL training over the course of RL in Atari (details in an appendix). Notably, we found several games, including SPACE INVADERS, to benefit from using ATC only to initialize encoder weights, done using an initial $1 0 0 \mathrm { k }$ transitions gathered with a uniform random policy. Some of our remaining experiments provide more insights into the challenges of this domain.
85
+
86
+ # 4.3 ENCODER PRE-TRAINING BENCHMARKS
87
+
88
+ To benchmark the effectiveness of different UL algorithms for RL, we propose a new evaluation methodology that is similar to how UL pre-training techniques are measured in computer vision (see e.g. Chen et al. (2020); Grill et al. (2020)): (i) collect a data set composed of expert demonstrations from each environment; (ii) pre-train the CNN encoder with that data offline using UL; (iii) evaluate by using RL to learn a control policy while keeping the encoder weights frozen. This procedure isolates the asymptotic performance of each UL algorithm for RL. For convenience, we drew expert demonstrations from partially-trained RL agents, and every UL algorithm trained on the same data set for each environment. Our RL agents used the same post-encoder architectures as in the online experiments. Further details about pre-training by each algorithm are provided in an appendix.
89
+
90
+ ![](images/2cff74d17a83f427f4f8908036f45a1088f8557b69b4c13b3cf4d4bcf449ff73.jpg)
91
+ Figure 4: Online encoder training using ATC, fully detached from the RL agent, works well in 5 of 8 games tested (1 agent step $= 4$ environment steps, the standard action repeat). 6 of 8 games benefit significantly from using ATC as an auxiliary loss or for weight initialization. Each curve is 8 random seeds.
92
+
93
+ DMControl We compare ATC against two competing algorithms: Augmented Contrast (AC), from CURL (Laskin et al., 2020b), which uses the same observation for the anchor and the positive, and a VAE (Kingma & Welling, 2013), for which we found better performance by introducing a time delay to the target observation (VAE-T). We found ATC to match or outperform the other algorithms, in all four test environments, as shown in Figure 5. Further, ATC is the only one to match or outperform the reference end-to-end RL across all cases.
94
+
95
+ ![](images/f309dd47f7083677e9f184338a22014aa84f7b0a85c672257f0eb8412dcdd8f0.jpg)
96
+ Figure 5: RL in DMControl, using encoders pre-trained on expert demonstrations using UL, with weights frozen—across all domains, ATC outperforms prior methods and the end-to-end RL reference. Each curve is a mininum of 4 random seeds.
97
+
98
+ DMLab We compare against both Pixel Control (Jaderberg et al., 2017; Hessel et al., 2019) and CPC (van den Oord et al., 2018), which have been shown to bring strong benefits in DMLab. While all algorithms perform similarly well in EXPLORE, ATC performs significantly better in LASERTAG, Figure 6. Our algorithm is simpler than Pixel Control and CPC in the sense that it uses neither actions, deconvolution, nor recurrence.
99
+
100
+ Atari We compare against Pixel Control, VAE-T, and a basic inverse model which predicts actions between pairs of observations. We also compare against Spatio-Temporal Deep InfoMax (ST-DIM), which uses temporal contrastive losses with “local” features from an intermediate convolution layer to ensure attention to the whole screen; it was shown to produce detailed game-state knowledge when applied to individual frames (Anand et al., 2019). Of the four games shown in Figure 7, ATC is the only UL algorithm to match the end-to-end RL reference in GRAVITAR and BREAKOUT, and it performs best in SPACE INVADERS.
101
+
102
+ ![](images/3154101adf4b820cc0467150274febe9fb7d21036dc97115152835c455f59101.jpg)
103
+ Figure 6: RL in DMLab, using pre-trained encoders with weights frozen–in LASERTAG especially, ATC outperforms leading prior UL algorithms.
104
+
105
+ ![](images/121138f0c210cac9a3c4cfd52b0433a919852489cef2654c02ed829c55b70b77.jpg)
106
+ Figure 7: RL in Atari, using pre-trained encoders with weights frozen—ATC outperforms several leading, prior UL algorithms and exceeds the end-to-end RL reference in 3 of the 4 games tested.
107
+
108
+ # 4.4 MULTI-TASK ENCODERS
109
+
110
+ In the offline setting, we conducted initial explorations into the capability of ATC to learn multi-task encoders, simply by pre-training on demonstrations from multiple environments. We evaluate the encoder by using it, with frozen weights, in separate RL agents learning each downstream task.
111
+
112
+ DMControl Figure 8 shows our results in DMControl, where we pretrained using only the four environments in the top row. Although the encoder was never trained on the HOPPER, PENDULUM, nor FINGER domains, the multi-task encoder supports efficient RL in them. PENDULUM-SWINGUP and CARTPOLE-SWINGUP-SPARSE stand out as challenging environments which benefited from cross-domain and cross-task pre-training, respectively. The pretraining was remarkably efficient, requiring only 20,000 updates to the encoder.
113
+
114
+ ![](images/a1a082ebecffa5389e63c77f1ace713a46a8b37259167a313d56f09aba23a920.jpg)
115
+ Figure 8: Separate RL agents using a single encoder with weights frozen after pre-training on expert demonstrations from the four top environments. The encoder generalizes to four new environments, bottom row, where sparse reward tasks especially benefit from the transfer. Each curve is minimum 4 random seeds.
116
+
117
+ Atari Atari proved a more challenging domain for learning multi-task encoders. Learning all eight games together in Figure 11, in the appendix, resulted in diminished performance relative to single-game pretraining in three of the eight. The decrease was partially alleviated by widening the encoder with twice as many filters per layer, indicating that representation capacity is a limiting factor. To test generalization, we conducted a seven-game pre-training experiment where we test the encoder on the held-out game. Most games suffered diminished performance (although still perform significantly higher than a frozen random encoder), confirming the limited extent to which visual features transfer across these games.
118
+
119
+ ![](images/01ef7105d2680afb75ad5c5c4eed915c080de929140a61da789373eff80f213c.jpg)
120
+ Figure 9: BREAKOUT benefits from contrasting against negatives from several neighboring time steps.
121
+
122
+ ![](images/539e70000e4ecf18d2eba89d8be66353cc7947a0d1d8196f6ef9391f02b75278.jpg)
123
+ Figure 10: An example scene from BREAKOUT, where a lowperformance UL encoder (without shift) focuses on the paddle. Introducing random shift and sequence data makes the highperformance UL encoder (full ATC) focus near the ball, as does the encoder from a fully-trained, end-to-end RL agent.
124
+
125
+ # 4.5 ABLATIONS AND ENCODER ANALYSIS
126
+
127
+ Random Shift in ATC In offline experiments, we discovered random shift augmentations to be helpful in all domains. To our knowledge, this is the first application of random shift to 3D visual environments as in DMLab. In Atari, we found performance in GRAVITAR to suffer from random shift, but reducing the probability of applying random shift to each observation from 1.0 to 0.1 alleviated the effect while still bringing benefits in other games, so we used this setting in our main experiments. Results are shown in Figure 12 in an appendix.
128
+
129
+ Random Shift in RL In DMControl, we found the best results when using random shift during RL, even when training with a frozen encoder. This is evidence that the augmentation regularizes not only the representation but also the policy, which first processes the latent image into a 50- dimensional vector. To unlock computation and memory benefits of replaying only the latent images for the RL agent, we attempted to apply data augmentation to the latent image. But we found the smallest possible random shifts to be too extreme. Instead, we introduce a new augmentation, subpixel random shift, which linearly interpolates among neighboring pixels. As shown in Figure 13 in the appendix, this augmentation restores performance when applied to the latent images, allowing a pre-trained encoder to be entirely bypassed during policy training updates.
130
+
131
+ Temporal Contrast on Sequences In BREAKOUT alone, we discovered that composing the UL training batch of trajectory segments, rather than individual transitions, gave a significant benefit. Treating all elements of the training batch independently provides “hard” negatives, since the encoder must distinguish between neighboring time steps. This setting had no effect in the other Atari games tested, and we found equal or better performance using individual transitions in DMControl and DMLab. Figure 9 further shows that using a similarity loss (Grill et al., 2020) does not capture the benefit.
132
+
133
+ Encoder Analysis We analyzed the learned encoders in BREAKOUT to further study this ablation effect. Similar to Zagoruyko & Komodakis (2016), we compute spatial attention maps by mean-pooling the absolute values of the activations along the channel dimension and follow with a 2-dimensional spatial softmax. Figure 10 shows the attention of four different encoders on the displayed scene. The poorly performing UL encoder heavily utilizes the paddle to distinguish the observation. The UL encoder trained with random shift and sequence data, however, focuses near the ball, as does the fully-trained RL encoder. (The random encoder mostly highlights the bricks, which are less relevant for control.) In an appendix, we include other example encoder analyses from Atari and DMLab which show ATC-trained encoders attending only to key objects on the game screen, while RL-trained encoders additionally attend to potentially distracting features such as game score.
134
+
135
+ # 5 CONCLUSION
136
+
137
+ Reward-free representation learning from images provides flexibility and insights for improving deep RL agents. We have shown a broad range of cases where our new unsupervised learning algorithm can fully replace RL for training convolutional encoders while maintaining or improving online performance. In a small number of environments–a few of the Atari games–including the RL loss for encoder training still surpasses our UL-only method, leaving opportunities for further improvements in UL for RL.
138
+
139
+ Our preliminary efforts to use actions as inputs (into the predictor MLP) or as prediction outputs (inverse loss) with ATC did not immediately yield strong improvements. We experimented only with random shift, but other augmentations may be useful, as well. In multi-task encoder training, our technique avoids any need for sophisticated reward-balancing (Hessel et al., 2019), but more advanced training methods may still help when the required features are in conflict, as in Atari, or if they otherwise impact our loss function unequally. On the theoretical side, it may be helpful to analyze the effects of domain shift on the policy when a detached representation is learned online.
140
+
141
+ One obvious application of our offline methodology would be in the batch RL setting, where the agent learns from a fixed data set. Our offline experiments showed that a relatively small number of transitions are sufficient to learn rich representations by UL, and the lower limit could be further explored. Overall, we hope that our algorithm and experiments spur further developments leveraging unsupervised learning for reinforcement learning.
142
+
143
+ # REFERENCES
144
+
145
+ Ankesh Anand, Evan Racah, Sherjil Ozair, Yoshua Bengio, Marc-Alexandre Cotˆ e, and R Devon ´ Hjelm. Unsupervised state representation learning in atari. In Advances in Neural Information Processing Systems, 2019.
146
+
147
+ Charles Beattie, Joel Z. Leibo, Denis Teplyashin, Tom Ward, Marcus Wainwright, Heinrich Kuttler, ¨ Andrew Lefrancq, Simon Green, V´ıctor Valdes, Amir Sadik, Julian Schrittwieser, Keith Ander- ´ son, Sarah York, Max Cant, Adam Cain, Adrian Bolton, Stephen Gaffney, Helen King, Demis Hassabis, Shane Legg, and Stig Petersen. Deepmind lab. arXiv preprint arXiv:1612.03801, 2016.
148
+
149
+ Marc G Bellemare, Yavar Naddaf, Joel Veness, and Michael Bowling. The arcade learning environment: An evaluation platform for general agents. Journal of Artificial Intelligence Research, 47: 253–279, 2013.
150
+
151
+ Christopher Berner, Greg Brockman, Brooke Chan, Vicki Cheung, Przemyslaw Debiak, Christy Dennison, David Farhi, Quirin Fischer, Shariq Hashme, Chris Hesse, et al. Dota 2 with large scale deep reinforcement learning. arXiv preprint arXiv:1912.06680, 2019.
152
+
153
+ Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. arXiv:2002.05709, 2020.
154
+
155
+ Karl Cobbe, Christopher Hesse, Jacob Hilton, and John Schulman. Leveraging procedural generation to benchmark reinforcement learning. arXiv preprint arXiv:1912.01588, 2019.
156
+
157
+ Coline Devin, Pieter Abbeel, Trevor Darrell, and Sergey Levine. Deep object-centric representations for generalizable robot learning. In 2018 IEEE International Conference on Robotics and Automation (ICRA), pp. 7111–7118. IEEE, 2018.
158
+
159
+ Alexey Dosovitskiy, German Ros, Felipe Codevilla, Antonio Lopez, and Vladlen Koltun. Carla: An open urban driving simulator. arXiv preprint arXiv:1711.03938, 2017.
160
+
161
+ C. Finn, Xin Yu Tan, Yan Duan, T. Darrell, S. Levine, and P. Abbeel. Deep spatial autoencoders for visuomotor learning. In 2016 IEEE International Conference on Robotics and Automation (ICRA), pp. 512–519, 2016.
162
+
163
+ Jean-Bastien Grill, Florian Strub, Florent Altche, Corentin Tallec, Pierre H Richemond, Elena ´ Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Daniel Guo, Mohammad Gheshlaghi Azar, et al. Bootstrap your own latent: A new approach to self-supervised learning. arXiv preprint arXiv:2006.07733, 2020.
164
+
165
+ Daniel Guo, Bernardo Avila Pires, Bilal Piot, Jean-bastien Grill, Florent Altche, R ´ emi Munos, and ´ Mohammad Gheshlaghi Azar. Bootstrap latent-predictive representations for multitask reinforcement learning. arXiv preprint arXiv:2004.14646, 2020.
166
+
167
+ Zhaohan Daniel Guo, Mohammad Gheshlaghi Azar, Bilal Piot, Bernardo A Pires, and Remi Munos.´ Neural predictive belief representations. arXiv preprint arXiv:1811.06407, 2018.
168
+
169
+ Michael Gutmann and Aapo Hyvarinen. Noise-contrastive estimation: A new estimation principle ¨ for unnormalized statistical models. In International Conference on Artificial Intelligence and Statistics, 2010.
170
+
171
+ David Ha and Jurgen Schmidhuber. World models. ¨ arXiv preprint arXiv:1803.10122, 2018.
172
+
173
+ Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. In International Conference on Machine Learning, 2018.
174
+
175
+ Danijar Hafner, Timothy Lillicrap, Ian Fischer, Ruben Villegas, David Ha, Honglak Lee, and James Davidson. Learning latent dynamics for planning from pixels. In International Conference on Machine Learning, 2019.
176
+
177
+ Danijar Hafner, Timothy Lillicrap, Jimmy Ba, and Mohammad Norouzi. Dream to control: Learning behaviors by latent imagination. In International Conference on Learning Representations, 2020.
178
+
179
+ Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. arXiv preprint arXiv:1911.05722, 2019.
180
+
181
+ Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2020.
182
+
183
+ Olivier J Henaff, Aravind Srinivas, Jeffrey De Fauw, Ali Razavi, Carl Doersch, SM Eslami, and´ Aaron van den Oord. Data-efficient image recognition with contrastive predictive coding. arXiv preprint arXiv:1905.09272, 2019.
184
+
185
+ Matteo Hessel, Joseph Modayil, Hado van Hasselt, Tom Schaul, Georg Ostrovski, Will Dabney, Dan Horgan, Bilal Piot, Mohammad Azar, and David Silver. Rainbow: Combining improvements in deep reinforcement learning. In AAAI Conference on Artificial Intelligence, 2018.
186
+
187
+ Matteo Hessel, Hubert Soyer, Lasse Espeholt, Wojciech Czarnecki, Simon Schmitt, and Hado van Hasselt. Multi-task deep reinforcement learning with popart. In AAAI Conference on Artificial Intelligence, 2019.
188
+
189
+ Max Jaderberg, Volodymyr Mnih, Wojciech Marian Czarnecki, Tom Schaul, Joel Z Leibo, David Silver, and Koray Kavukcuoglu. Reinforcement learning with unsupervised auxiliary tasks. In International Conference on Learning Representations, 2017.
190
+
191
+ Max Jaderberg, Wojciech M Czarnecki, Iain Dunning, Luke Marris, Guy Lever, Antonio Garcia Castaneda, Charles Beattie, Neil C Rabinowitz, Ari S Morcos, Avraham Ruderman, et al. Humanlevel performance in 3d multiplayer games with population-based reinforcement learning. Science, 364(6443):859–865, 2019.
192
+
193
+ Dmitry Kalashnikov, Alex Irpan, Peter Pastor, Julian Ibarz, Alexander Herzog, Eric Jang, Deirdre Quillen, Ethan Holly, Mrinal Kalakrishnan, Vincent Vanhoucke, et al. Qt-opt: Scalable deep reinforcement learning for vision-based robotic manipulation. arXiv preprint arXiv:1806.10293, 2018.
194
+
195
+ Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
196
+
197
+ Thomas Kipf, Elise van der Pol, and Max Welling. Contrastive learning of structured world models. arXiv preprint arXiv:1911.12247, 2019.
198
+
199
+ Ilya Kostrikov, Denis Yarats, and Rob Fergus. Image augmentation is all you need: Regularizing deep reinforcement learning from pixels. arXiv preprint arXiv:2004.13649, 2020.
200
+
201
+ Michael Laskin, Kimin Lee, Adam Stooke, Lerrel Pinto, Pieter Abbeel, and Aravind Srinivas. Reinforcement learning with augmented data. arXiv preprint arXiv:2004.14990, 2020a.
202
+
203
+ Michael Laskin, Aravind Srinivas, and Pieter Abbeel. Curl: Contrastive unsupervised representations for reinforcement learning. In International Conference on Machine Learning, 2020b.
204
+
205
+ Alex X Lee, Anusha Nagabandi, Pieter Abbeel, and Sergey Levine. Stochastic latent actor-critic: Deep reinforcement learning with a latent variable model. arXiv preprint arXiv:1907.00953, 2019.
206
+
207
+ Kuang-Huei Lee, Ian Fischer, Anthony Liu, Yijie Guo, Honglak Lee, John Canny, and Sergio Guadarrama. Predictive information accelerates learning in rl. Advances in Neural Information Processing Systems, 33, 2020.
208
+
209
+ Sergey Levine, Chelsea Finn, Trevor Darrell, and Pieter Abbeel. End-to-end training of deep visuomotor policies. The Journal of Machine Learning Research, 17(1):1334–1373, 2016.
210
+
211
+ Bogdan Mazoure, Remi Tachet des Combes, Thang Doan, Philip Bachman, and R Devon Hjelm. Deep reinforcement and infomax learning. arXiv preprint arXiv:2006.07217, 2020.
212
+
213
+ 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–533, 2015.
214
+
215
+ Volodymyr Mnih, Adria Puigdomenech Badia, Mehdi Mirza, Alex Graves, Timothy Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In International Conference on Machine Learning, 2016.
216
+
217
+ John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
218
+
219
+ Max Schwarzer, Ankesh Anand, Rishab Goel, R Devon Hjelm, Aaron Courville, and Philip Bachman. Data-efficient reinforcement learning with momentum predictive representations. arXiv preprint arXiv:2007.05929, 2020.
220
+
221
+ Yuval Tassa, Yotam Doron, Alistair Muldal, Tom Erez, Yazhe Li, Diego de Las Casas, David Budden, Abbas Abdolmaleki, Josh Merel, Andrew Lefrancq, et al. Deepmind control suite. arXiv preprint arXiv:1801.00690, 2018.
222
+
223
+ Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
224
+
225
+ Greg Wayne, Chia-Chun Hung, David Amos, Mehdi Mirza, Arun Ahuja, Agnieszka GrabskaBarwinska, Jack Rae, Piotr Mirowski, Joel Z Leibo, Adam Santoro, et al. Unsupervised predictive memory in a goal-directed agent. arXiv preprint arXiv:1803.10760, 2018.
226
+
227
+ Wilson Yan, Ashwin Vangipuram, Pieter Abbeel, and Lerrel Pinto. Learning predictive representations for deformable objects using contrastive estimation. arXiv preprint arXiv:2003.05436, 2020.
228
+
229
+ Sergey Zagoruyko and Nikos Komodakis. Paying more attention to attention: Improving the performance of convolutional neural networks via attention transfer. arXiv preprint arXiv:1612.03928, 2016.
230
+
231
+ A APPENDIX
232
+
233
+ # A.1 ALGORITHMS
234
+
235
+ # Algorithm 1 Online RL with decoupled ATC encoder (steps distinct from end-to-end RL in blue)
236
+
237
+ Require: θAT C, φπ . ATC model parameters (encoder $f _ { \theta }$ thru contrast $W$ ), policy parameters
238
+ 1: $\mathcal { S } \{ \}$ $\triangleright$ replay buffer of observations
239
+ 2: $\bar { \theta } _ { A T C } \theta _ { A T C }$ . initialize momentum encoder (conv and linear only)
240
+ 3: repeat
241
+ 4: Sample environment and policy, through encoder:
242
+ 5: for 1 to m do . a minibatch
243
+ 6: $\begin{array} { l } { a \sim { \pi } ( \cdot | f _ { \theta } ( s ) ; \phi ) , { s } ^ { \prime } \sim T ( s , a ) , r \sim R ( s , a , { s } ^ { \prime } ) } \\ { \quad S S \cup \{ s \} } \\ { \quad s s ^ { \prime } } \end{array}$
244
+ 7: store observations (delete oldest if full)
245
+ 8:
246
+ 9: end for
247
+ 10: Update policy by given RL formula: $\triangleright$ on- or off-policy
248
+ 11: for 1 to n do $\triangleright$ given number RL updates per minibatch
249
+ 12: $\phi _ { \pi } \phi _ { \pi } + R L ( s , a , s ^ { \prime } , r ; \phi _ { \pi } )$ . stop gradient into encoder
250
+ 13: end for
251
+ 14: Update encoder (and contrastive model) by ATC:
252
+ 15: for 1 to p do
253
+ 16: 17: $\begin{array} { r l } & { s , s _ { + } \sim s } \\ & { \underline { { \theta } } _ { A T C } \theta _ { A T C } - \lambda _ { A T C } \nabla _ { \theta _ { A T C } } \mathcal { L } ^ { A T C } ( s , s _ { + } ) } \end{array}$ sample observations: anchors and positives $\triangleright$ ATC gradient update
254
+ 18: $\bar { \theta } _ { A T C } ( 1 - \tau ) \bar { \theta } _ { A T C } + \tau \theta _ { A T C }$ . update momentum encoder (conv and linear only)
255
+ 19: end for
256
+ 20: until converged
257
+ 21: return Encoder $f _ { \theta }$ and policy $\pi _ { \phi }$
258
+
259
+ # A.2 ADDITIONAL FIGURES
260
+
261
+ ![](images/5543152dd76206baac60db6f57cb863ab7342d883bbae0c2215217cd33cfa063.jpg)
262
+ Figure 11: RL using multi-task encoders (all with weights frozen) for eight Atari games gives mixed performance, partially improved by increased network capacity (8-game-wide). Training on 7 games and testing on the held-out one yields diminished but non-zero performance, showing some limited feature transfer between games.
263
+
264
+ In subpixel random shift, new pixels are a linearly weighted average of the four nearest pixels to a randomly chosen coordinate location. We used uniformly random horizontal and vertical shifts, and tested maximum displacements in $( \pm ) \left\{ 0 . 1 , 0 . 2 5 , 0 . 5 , 0 . 7 5 , 1 . 0 \right\}$ pixels (with “edge” mode padding $\pm 1 )$ . We found 0.5 to work well in all tested domains, restoring the performance of raw image augmentation but eliminating convolutions entirely from the RL training updates.
265
+
266
+ ![](images/4beb61e4ab5090b07268c86aa788662703783a664d7d871ba041b834c06ceeac.jpg)
267
+ Figure 12: Random shift augmentation helps in some Atari games and hurts in others, but applying with probability 0.1 is a performant middle ground. DMLab benefits from random shift. (Offline pre-training.)
268
+
269
+ ![](images/29ac0be5110940df74d1d5c3a4f0e6e4139c5451731cb9c5df2f23a86dd1c6d8.jpg)
270
+ Figure 13: Even after pre-training encoders for DMControl using random shift, RL requires augmentation— our subpixel augmentation acts on the (compressed) latent image, permitting its use in the replay buffer.
271
+
272
+ ![](images/1cce8da9c9fb4f83d8b7ebde417428125f913540be195ef011cceec933f3c869.jpg)
273
+ Figure 14: Attention map in BREAKOUT which shows the RL-trained encoder focusing on game score, whereas UL ATC encoder focuses properly on the paddle and ball.
274
+
275
+ ![](images/730bece2e848d8228104749b4de1d034becb59d3c9360f699590d057e7854254.jpg)
276
+ Figure 15: Attention map in LASERTAG. UL encoder with pixel control focuses on the score, while UL encoder with the proposed ATC focuses properly on the coin similar to RL-trained encoder.
277
+
278
+ ![](images/081300ec7a0548d8be5ff478ad26357c10b99de16be803312ba29ed20f5121ec.jpg)
279
+ Figure 16: Attention map in the LASERTAG which shows that UL encoders focus properly on the enemy similar to RL-trained encoder.
280
+
281
+ Table 1: DMControl, RAD-SAC Hyperparameters.
282
+
283
+ <table><tr><td>HYPERPARAMETER</td><td>VALUE</td></tr><tr><td>OBSERVATION RENDERING</td><td>(84,84),RGB</td></tr><tr><td>RANDOM SHIFT PAD</td><td>±4</td></tr><tr><td>REPLAY BUFFER SIZE</td><td>1e5</td></tr><tr><td>INITIAL STEPS</td><td>1e4</td></tr><tr><td>STACKED FRAMES</td><td>3</td></tr><tr><td>ACTIONREPEAT</td><td>2(FINGER,WALKER)</td></tr><tr><td></td><td>8 (CARTPOLE)</td></tr><tr><td></td><td>4 (REST)</td></tr><tr><td>OPTIMIZER</td><td>ADAM</td></tr><tr><td>(β1,β2)→(fθ,Tψ,Q)</td><td>(.9,.999)</td></tr><tr><td>(β1,β)→(a) LEARNING RATE(fθ,πψ,QΦ)</td><td>(.5,.999)</td></tr><tr><td></td><td>2e-4(CHEETAH)</td></tr><tr><td>LEARNING RATE (α)</td><td>1e-3 (REST)</td></tr><tr><td>BATCH SIZE</td><td>1e-4</td></tr><tr><td></td><td>512(CHEETAH,PENDULUM) 256 (REST)</td></tr><tr><td>Q FUNCTION EMA T</td><td>0.01</td></tr><tr><td>CRITIC TARGET UPDATE FREQ</td><td>2</td></tr><tr><td>CONVOLUTION FILTERS</td><td>[32,32,32,32]</td></tr><tr><td>CONVOLUTION STRIDES</td><td>[2,2,2,1]</td></tr><tr><td>CONVOLUTION FILTER SIZE</td><td>3</td></tr><tr><td>ENCODER EMAT</td><td>0.05</td></tr><tr><td>LATENT DIMENSION</td><td>50</td></tr><tr><td>HIDDEN UNITS (MLP)</td><td>[1024,1024]</td></tr><tr><td>DISCOUNT </td><td>.99</td></tr><tr><td>INITIAL TEMPERATURE</td><td>0.1</td></tr><tr><td></td><td></td></tr></table>
284
+
285
+ Table 2: Atari, PPO Hyperparameters.
286
+
287
+ <table><tr><td>HYPERPARAMETER</td><td>VALUE</td></tr><tr><td>OBSERVATION RENDERING</td><td>(84,84), GREY</td></tr><tr><td>STACKED FRAMES</td><td>4</td></tr><tr><td>ACTIONREPEAT</td><td>4</td></tr><tr><td>OPTIMIZER</td><td>ADAM</td></tr><tr><td>LEARNING RATE</td><td>2.5e-4</td></tr><tr><td>PARALLEL ENVIRONMENTS</td><td>16</td></tr><tr><td>SAMPLING INTERVAL</td><td>128</td></tr><tr><td>LIKELIHOOD RATIO CLIP, ∈</td><td>0.1</td></tr><tr><td>PPOEPOCHS</td><td>4</td></tr><tr><td>PPOMINIBATCHES</td><td>4</td></tr><tr><td>CONVOLUTION FILTERS</td><td>[32, 64, 64]</td></tr><tr><td>CONVOLUTION FILTER SIZES</td><td>[8,4,3]</td></tr><tr><td>CONVOLUTION STRIDES</td><td>[4,2,1]</td></tr><tr><td>HIDDEN UNITS (MLP)</td><td>[512]</td></tr><tr><td>DISCOUNT γ</td><td>.99</td></tr><tr><td>GENERALIZED ADVANTAGE ESTIMATION入</td><td>0.95</td></tr><tr><td>LEARNINGRATE ANNEALING</td><td>LINEAR</td></tr><tr><td>ENTROPY BONUS COEFFICIENT</td><td>0.01</td></tr><tr><td>EPISODIC LIVES</td><td>FALSE</td></tr><tr><td>REPEAT ACTIONPROBABILITY</td><td>0.25</td></tr><tr><td>REWARD CLIPPING</td><td>±1</td></tr><tr><td>VALUELOSS COEFFICIENT</td><td>1.0</td></tr></table>
288
+
289
+ Table 3: DMLab, PPO Hyperparameters.
290
+
291
+ <table><tr><td>HYPERPARAMETER</td><td>VALUE</td></tr><tr><td>OBSERVATION RENDERING</td><td>(72,96),RGB</td></tr><tr><td>STACKED FRAMES</td><td>1</td></tr><tr><td>ACTION REPEAT</td><td>4</td></tr><tr><td>OPTIMIZER</td><td>ADAM</td></tr><tr><td>LEARNING RATE</td><td>2.5e-4</td></tr><tr><td>PARALLEL ENVIRONMENTS</td><td>16</td></tr><tr><td>SAMPLING INTERVAL</td><td>128</td></tr><tr><td>LIKELIHOOD RATIO CLIP, E</td><td>0.1</td></tr><tr><td>PPO EPOCHS</td><td>1</td></tr><tr><td>PPOMINIBATCHES</td><td>2</td></tr><tr><td>CONVOLUTION FILTERS</td><td>[32,64,64,64]</td></tr><tr><td>CONVOLUTION FILTER SIZES</td><td>[8,4,3,3]</td></tr><tr><td>CONVOLUTION STRIDES</td><td>[4,2,1, 1]</td></tr><tr><td>HIDDEN UNITS (LSTM)</td><td>[256]</td></tr><tr><td>SKIP CONNECTIONS</td><td>CONV3,4; LSTM</td></tr><tr><td>DISCOUNT </td><td>.99</td></tr><tr><td>GENERALIZED ADVANTAGE ESTIMATION 入</td><td>0.97</td></tr><tr><td>LEARNING RATE ANNEALING</td><td>NONE</td></tr><tr><td>ENTROPY BONUS COEFFICIENT</td><td>0.01 (EXPLORE)</td></tr><tr><td></td><td>0.0003 (LASERTAG)</td></tr><tr><td>VALUE LOSS COEFFICIENT</td><td>0.5</td></tr></table>
292
+
293
+ # A.4 ONLINE ATC SETTINGS
294
+
295
+ Table 4: Common ATC Hyperparameters.
296
+
297
+ <table><tr><td>HYPERPARAMETER</td><td>VALUE</td></tr><tr><td>RANDOM SHIFT PAD</td><td>±4</td></tr><tr><td>LEARNING RATE</td><td>1e-3</td></tr><tr><td>LEARNING RATE ANNEALING</td><td>COSINE</td></tr><tr><td>TARGETUPDATE INTERVAL</td><td>1</td></tr><tr><td>TARGET UPDATE T PREDICTOR HIDDEN SIZES,h</td><td>0.01</td></tr><tr><td></td><td>[512]</td></tr><tr><td>REPLAY BUFFER SIZE</td><td>1e5</td></tr></table>
298
+
299
+ Table 5: DMControl ATC Hyperparameters.
300
+
301
+ <table><tr><td>HYPERPARAMETER</td><td>VALUE</td></tr><tr><td>RANDOMSHIFTPROBABILITY</td><td>1</td></tr><tr><td>BATCH SIZE</td><td>ASRL (INDIVIDUAL OBSERVATIONS)</td></tr><tr><td>TEMPORAL SHIFT,k</td><td>1</td></tr><tr><td>MIN AGENT STEPS TO UL</td><td>1e4</td></tr><tr><td>MIN AGENT STEPS TO RL</td><td>1e4</td></tr><tr><td>UL UPDATE SCHEDULE</td><td>ASRL</td></tr><tr><td></td><td>(2X CHEETAH)</td></tr><tr><td>LATENT SIZE</td><td>128</td></tr></table>
302
+
303
+ Table 6: Atari ATC Hyperparameters.
304
+
305
+ <table><tr><td>HYPERPARAMETER</td><td>VALUE</td></tr><tr><td>RANDOM SHIFTPROBABILITY</td><td>0.1</td></tr><tr><td>BATCH SIZE</td><td>512 (32 TRAJECTORIES OF 16 TIME STEPS)</td></tr><tr><td>TEMPORAL SHIFT,k</td><td>3</td></tr><tr><td>MIN AGENT STEPS TO UL</td><td>5e4</td></tr><tr><td>MIN AGENT STEPS TO RL</td><td>1e5</td></tr><tr><td>ULUPDATE SCHEDULE</td><td>ANNEALED QUADRATICALLY FROM6 PER SAMPLER ITERATION (1e4 ONCE AT 1e5 STEPS FOR WEIGHT INITIALIZATION)</td></tr><tr><td>LATENT SIZE</td><td>256</td></tr></table>
306
+
307
+ Table 7: DMLab ATC Hyperparameters.
308
+
309
+ <table><tr><td>HYPERPARAMETER</td><td>VALUE</td></tr><tr><td>RANDOMSHIFTPROBABILITY</td><td>1</td></tr><tr><td>BATCH SIZE</td><td>512 (INDIVIDUAL OBSERVATIONS)</td></tr><tr><td>TEMPORAL SHIFT,k</td><td>3</td></tr><tr><td>MIN AGENT STEPS TO UL</td><td>5e4</td></tr><tr><td>MIN AGENT STEPS TO RL</td><td>1e5</td></tr><tr><td>ULUPDATE SCHEDULE LATENT SIZE</td><td>2PER SAMPLERITERATION 256</td></tr></table>
310
+
311
+ # A.5 OFFLINE PRE-TRAINING DETAILS
312
+
313
+ We conducted coarse hyperparameter sweeps to tune each competing UL algorithm. In all cases, the best setting is the one shown in our comparisons.
314
+
315
+ When our VAEs include a time difference between input and reconstruction observations, we include one hidden layer with action additionally input between the encoder and decoder. We tried both 1.0 and 0.1 KL-divergence weight in the VAE loss, and found 0.1 to perform better in both DMControl and Atari.
316
+
317
+ DMControl For the VAE, we experimented with 0 and 1 time step difference between input and reconstruction target observations and training for either 1e4 or 5e4 updates. The best settings were 1-step temporal, and 5e4 updates, with batch size 128. ATC used 1-step temporal, 5e4 updates (although this can be significantly decreased), and batch size 256 (including CHEETAH). The pretraining data set consisted of the first 5e4 transitions from a RAD-SAC agent learning each task, including 5e3 random actions. Within this span, CARTPOLE and BALL IN CUP learned completely, but WALKER and CHEETAH reached average returns of 514 and 630, respectively (collected without the compressive convolution).
318
+
319
+ DMLab For Pixel Control, we used the settings from Hessel et al. (2019) (see the appendix therein), except we used only empirical returns, computed offline (without bootstrapping). For CPC, we tried training batch shapes, $b a t c h \times t i m e$ in (64, 8), (32, 16), (16, 32), and found the setting with rollouts of length 16 to be best. We contrasted all elements of the batch against each other, rather than only forward constrasts. In all cases we also used 16 steps to warmup the LSTM. For all algorithms we tried learning rates $3 \mathrm { e } { - 4 }$ and 1e−3 and both 5e4 and 1.5e5 updates. For ATC and CPC, the lower learning rate and higher number of updates helped in LASERTAG especially. The pretraining data was 125e3 samples from partially trained RL agents receiving average returns of 127 and 6 in EXPLORE GOAL LOCATIONS SMALL and LASERTAG THREE OPPONENTS SMALL, respectively.
320
+
321
+ Atari For the VAE, we experimented with 0, 1, and 3 time step difference between input and reconstruction target, and found 3 to work best. For ST-DIM we experimented with 1, 3, and 4 time steps differences, and batch sizes from 64 to 256, learning rates 1e−3 and 5e−4. Likewise, 3-step delay worked best. For the inverse model, we tried 1- and 3-step predictions, with 1-step working better overall, and found random shift augmentation to help. For pixel control, we used the settings in Jaderberg et al. (2017), again with full empirical returns. We ran each algorithm for up to 1e5 updates, although final ATC results used 5e4 updates. We ran each RL agent with and without observation normalization on the latent image and observed no difference in performance. Pretraining data was 125e3 samples sourced from the replay buffer of DQN agents trained for 15e6 steps with epsilon-greedy $\epsilon = 0 . 1$ . Evaluation scores were:
322
+
323
+ Table 8: Atari Pre-Training Data Source Agents.
324
+
325
+ <table><tr><td>GAME</td><td>EVALUATION SCORE</td></tr><tr><td>ALIEN</td><td>1,800</td></tr><tr><td>BREAKOUT</td><td>279</td></tr><tr><td>FROSTBITE</td><td>1,400</td></tr><tr><td>GRAVITAR</td><td>390</td></tr><tr><td>PONG</td><td>18</td></tr><tr><td>QBERT</td><td>8,800</td></tr><tr><td>SEAQUEST</td><td>11,000</td></tr><tr><td>SPACE INVADERS</td><td>1,200</td></tr></table>
md/train/_eXwwWOyqT_/_eXwwWOyqT_.md ADDED
@@ -0,0 +1,425 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Practical Large-Scale Linear Programming using Primal-Dual Hybrid Gradient
2
+
3
+ David Applegate Google Research dapplegate@google.com
4
+
5
+ Mateo Díaz California Institute of Technology∗ mateodd@caltech.edu
6
+
7
+ Oliver Hinder
8
+ Google Research
9
+ University of Pittsburgh
10
+ ohinder@pitt.edu
11
+
12
+ # Haihao Lu
13
+
14
+ Miles Lubin Google Research mlubin@google.com
15
+
16
+ University of Chicago† haihao.lu@chicagobooth.edu
17
+
18
+ Brendan O’Donoghue DeepMind bodonoghue@deepmind.com
19
+
20
+ Warren Schudy Google Research wschudy@google.com
21
+
22
+ # Abstract
23
+
24
+ We present PDLP, a practical first-order method for linear programming (LP) that can solve to the high levels of accuracy that are expected in traditional LP applications. In addition, it can scale to very large problems because its core operation is matrix-vector multiplications. PDLP is derived by applying the primaldual hybrid gradient (PDHG) method, popularized by Chambolle and Pock (2011), to a saddle-point formulation of LP. PDLP enhances PDHG for LP by combining several new techniques with older tricks from the literature; the enhancements include diagonal preconditioning, presolving, adaptive step sizes, and adaptive restarting. PDLP improves the state of the art for first-order methods applied to LP. We compare PDLP with SCS, an ADMM-based solver, on a set of $3 8 3 \ \mathrm { L P }$ instances derived from MIPLIB 2017. With a target of $1 0 ^ { - 8 }$ relative accuracy and 1 hour time limit, PDLP achieves a $6 . 3 \mathrm { x }$ reduction in the geometric mean of solve times and a 4.6x reduction in the number of instances unsolved (from 227 to 49). Furthermore, we highlight standard benchmark instances and a large-scale application (PageRank) where our open-source prototype of PDLP, written in Julia, outperforms a commercial LP solver.
25
+
26
+ # 1 Introduction
27
+
28
+ First-order methods (FOMs), which use gradient and not Hessian information, are now applied as standard practice in many areas of optimization [12]. A known weakness of FOMs is the tailing-off effect, where FOMs quickly find moderately accurate solutions, but progress towards an optimal solution slows down over time. While moderately accurate solutions are often sufficient for large machine learning applications, other applications traditionally demand higher precision. One such area is Linear Programming (LP), the focus of this work.
29
+
30
+ LP is a fundamental class of optimization problems in applied mathematics, operations research, and computer science with a huge range of applications, including mixed-integer programming, scheduling, network flow, chip design, budget allocation, and many others [17, 22, 65, 69]. Software for solving LP problems, called LP solvers, originated in the earliest days of computing, predating the invention of operating systems [55]. The state-of-the-art methods for LP, namely Dantzig’s simplex method [22,23] and interior-point (or barrier) methods [51], are quite mature and reliable at delivering highly accurate solutions. These widely successful methods have left little room for FOMs to make inroads. Furthermore, practitioners who use LP solvers are not accustomed to reasoning about the trade-off between accuracy and computing times typically intrinsic to FOMs.
31
+
32
+ In this paper, we provide evidence that, if properly enhanced, FOMs can obtain high quality solutions to LP problems quickly. Indeed, there’s reason to expect this, as authors have developed FOMs for LP with linear rates of convergence [24, 32, 47, 70, 71]. On the other hand, the linear rates depend on potentially loose and hard-to-compute constants; hence, tailing off may still be observed in practice. To our knowledge, ours is the first work to combine both theoretical enhancements with practical heuristics, demonstrating their combined effectiveness with extensive computational experiments on standard benchmark instances. In fact, our experiments will expose a substantial gap between algorithms presented in the literature and what’s needed to obtain good performance.
33
+
34
+ Starting from a baseline primal-dual hybrid gradient (PDHG) method [19] applied to a saddle point formulation of LP, we develop a series of algorithmic improvements. These enhancements include adaptive restarting [7], dynamic primal-dual step size selection [36, 37], presolving techniques [1], and diagonal preconditioning (data equilibration) [33]. Most of these enhancements, while inspired by existing literature, are novel. We name our collection of enhancements PDLP (PDHG for LP).
35
+
36
+ The impact of these improvements is substantial. For example, on $3 8 3 \mathrm { L P }$ instances derived from the MIPLIB 2017 collection [34], our implementation of a baseline version of PDHG solved only 50 problems to $1 0 ^ { - 8 }$ relative accuracy given a limit of approximately 100,000 iterations per problem. By contrast, PDLP solves 283 of the 383 problems under the same conditions. We demonstrate that PDLP outperforms FOM baselines and, in a small number of cases, obtains performance competitive with a commercial LP solver.
37
+
38
+ Although not the focus of this paper, we believe that our results open the door to a new set of possibilities and computational trade-offs when solving LP problems. PDLP has the potential to solve extremely large scale instances where the simplex method and interior-point methods are unable to run because of their reliance on matrix factorization. Since PDLP uses matrix-vector operations at its core, it can effectively run on multi-threaded CPUs, GPUs [68], or distributed clusters [26]. Furthermore, a GPU implementation of PDLP could efficiently solve batches of similar problems, a setup that has already been successfully applied with other optimization algorithms in applications like strong branching [46] and training neural networks that contain optimization layers [5].
39
+
40
+ Outline. The remainder of this section focuses on related work. Section 2 introduces LP and PDHG. Section 3 describes the set of enhancements that define PDLP. Section 4 presents numerical experiments, and Section 5 concludes and outlines future directions.
41
+
42
+ # 1.1 Literature review
43
+
44
+ PDHG PDHG was first developed by Zhu and Chan [72], with subsequent analysis and extension by a number of authors [3,18,19,21,27,38,60]. PDHG is closely related to the Arrow-Hurwicz method [8]. PDHG is a form of operator-splitting [11, 64] and can be interpreted as a variant of the alternating directions method of multipliers (ADMM) and Douglas-Rachford splitting (DRS) [16, 25, 56], which themselves are both instantiations of the proximal point method [25, 58, 62]. As opposed to ADMM or DRS, PDHG is ‘matrix-free’ in that the data matrix is only used for matrix-vector multiplications. This allows PDHG to scale to problems even larger than those tackled by these other techniques, and to make better use of parallel and distributed computation.
45
+
46
+ FOM-based solvers Recent interest in large-scale cone programming has sparked the development several first-order solvers based on competing methods. ProxSDP [66] is a solver for semidefinite programming based on PDHG. Solvers based on Nesterov’s accelerated gradients [49] include TFOCS [14], and FOM which is a suite of solvers employing both gradient and proximal algorithms [13]. Solvers based on operator splitting techniques like ADMM include SCS [52–54], OSQP [67], POGS [28], and COSMO [30]. Of these both SCS and POGS offer a matrix-free implementation where the linear system, that arises from the proximal operator used in ADMM, is solved using the conjugate gradient method. However, we shall show experimentally that our method can be significantly faster and more robust than this approach. Finally, [4] considers applying a truncated semismooth Newton method to the system of equations defining a fixed point of the SCS operator.
47
+
48
+ FOMs for LP Lan, Lu and Monteiro [40] and Renegar [61] develop FOMs for LP as a special case of semidefinite programming, with sublinear convergence rates. The FOM-based solvers above all apply to more general problem classes like cone programming or quadratic programming. In contrast, some of the enhancements that constitute PDLP are specialized, either in theory or practice, for LP (namely restarts [7] and presolving). A number of authors [24, 32, 47, 70, 71] have proposed linearly convergent FOMs for LP; to our knowledge, none have been subject of a comprehensive computational study. ECLIPSE [10] solves huge-scale industrial LP problems by accelerated gradient descent, without presenting comparisons on standard test problems. Lin et al. [42] propose an ADMM-based interior point method. In contrast with PDLP which solves to high accuracy (i.e., $1 0 ^ { - 8 }$ relative error), [42] perform experiments with $1 0 ^ { - 3 }$ and $1 0 ^ { - 5 }$ relative error. SNIPAL [41] is a semismooth Newton method based on the proximal augmented Lagrangian. SNIPAL has fast asymptotic convergence, yet, to get good performance, the authors use ADMM for warm-starts. Given PDLP’s favorable comparisons with SCS, it’s plausible that PDLP could provide a more effective warm-start. Finally, Pock and Chambolle [59] apply PDHG with diagonal preconditioning to a limited set of test LP problems and Applegate et al. [6] show how to extract infeasibility certificates when applying PDHG to LP.
49
+
50
+ # 2 Preliminaries
51
+
52
+ In this section, we introduce the notation we use throughout the paper, summarize the LP formulations we solve, and introduce the baseline PDHG algorithm.
53
+
54
+ Notation. Let $\mathbb { R }$ denote the set of real numbers, $\mathbb { R } ^ { + }$ the set of nonnegative real numbers, and $\mathbb { R } ^ { - }$ the set of nonpositive real numbers. Let $\mathbb { N }$ denote the set of natural numbers (starting from one). Let $\| \cdot \| _ { p }$ denote the $\ell _ { p }$ norm for a vector, and let $\| \cdot \| _ { 2 }$ denote the spectral norm for a matrix. For a vector $v \in \mathbb { R } ^ { n }$ , we use $v ^ { + }$ and $v ^ { - }$ for their positive and negative parts, i.e., $v _ { i } ^ { + } = \operatorname* { m a x } \{ 0 , v _ { i } \}$ and $v _ { i } ^ { - } = \operatorname* { m i n } \{ 0 , v _ { i } \}$ . The symbol $v _ { 1 : m }$ denotes the vector with the first $m$ components of $v$ . The symbols $K _ { i , }$ ,· and $K _ { \cdot , j }$ correspond to the $i$ th column and $j$ th row of the matrix $K$ , respectively. The symbol 1 denotes the vector of all ones. Given a convex set $X$ , we use $\mathbf { p r o j } _ { X }$ to denote the map that projects onto $X$ .
55
+
56
+ Linear Programming. We solve primal-dual LP problems of the form:
57
+
58
+ $$
59
+ { \begin{array} { r l } & { { \underset { x \in \mathbb { R } ^ { n } } { \mathrm { m i n i m i z e } } } ~ c ^ { \top } x } \\ & { { \mathrm { s u b j e c t ~ t o : } } ~ G x \geq h } \\ & { ~ A x = b } \\ & { ~ l \leq x \leq u } \end{array} }
60
+ $$
61
+
62
+ $$
63
+ \begin{array} { r l } { \underset { y \in \mathbb { R } ^ { m _ { 1 } + m _ { 2 } } , \lambda \in \mathbb { R } ^ { n } } { \mathrm { m a x i m i z e } } } & { q ^ { \top } y + l ^ { \top } \lambda ^ { + } - u ^ { \top } \lambda ^ { - } } \\ { \mathrm { s u b j e c t ~ t o : } } & { c - K ^ { \top } y = \lambda } \\ & { y _ { 1 : m _ { 1 } } \geq 0 } \\ & { \lambda \in \Lambda ~ , } \end{array}
64
+ $$
65
+
66
+ where $G \in \mathbb { R } ^ { m _ { 1 } \times n }$ , $\in \mathbb { R } ^ { m _ { 2 } \times n } , c \in \mathbb { R } ^ { n } , h \in \mathbb { R } ^ { m _ { 1 } } , b \in \mathbb { R } ^ { m _ { 2 } } , l \in ( \mathbb { R } \cup \{ - \infty \} ) ^ { n } , u \in ( \mathbb { R } \cup \{ \infty \} ) ^ { n } .$ , $K ^ { \top } = { \left( G ^ { \top } , A ^ { \top } \right) } , q ^ { \top } : = { \left( h ^ { \top } , b ^ { \top } \right) }$ , a nd
67
+
68
+ $$
69
+ \Lambda = \Lambda _ { 1 } \times \cdot \cdot \times \Lambda _ { n } \quad \Lambda _ { i } : = \left\{ \begin{array} { l l } { \{ 0 \} } & { l _ { i } = - \infty , u _ { i } = \infty , } \\ { \mathbb { R } ^ { - } } & { l _ { i } = - \infty , u _ { i } \in \mathbb { R } } \\ { \mathbb { R } ^ { + } } & { l _ { i } \in \mathbb { R } , u _ { i } = \infty } \\ { \mathbb { R } } & { \mathrm { o t h e r w i s e } } \end{array} \right.
70
+ $$
71
+
72
+ is the set of variables $\lambda$ such that the dual objective is finite. This pair of primal-dual problems is equivalent to the saddle-point problem:
73
+
74
+ $$
75
+ \operatorname* { m i n } _ { x \in X } \operatorname* { m a x } _ { y \in Y } { \mathcal { L } } ( x , y ) : = c ^ { \top } x - y ^ { \top } K x + q ^ { \top } y
76
+ $$
77
+
78
+ with $X : = \{ x \in \mathbb { R } ^ { n } : l \leq x \leq u \}$ , and $Y : = \{ y \in \mathbb { R } ^ { m _ { 1 } + m _ { 2 } } : y _ { 1 : m _ { 1 } } \geq 0 \}$
79
+
80
+ PDHG. When specialized to (2), the PDHG algorithm takes the form:
81
+
82
+ $$
83
+ \begin{array} { r l } & { x ^ { k + 1 } = \underset { X } { \mathbf { p r o j } } ( x ^ { k } - \tau ( c - K ^ { \top } y ^ { k } ) ) } \\ & { y ^ { k + 1 } = \underset { Y } { \mathbf { p r o j } } ( y ^ { k } + \sigma ( q - K ( 2 x ^ { k + 1 } - x ^ { k } ) ) ) } \end{array}
84
+ $$
85
+
86
+ where $\tau , \sigma > 0$ are primal and dual step sizes, respectively. PDHG is known to converge to an optimal solution when $\tau \sigma \| \dot { \boldsymbol { K } } \| _ { 2 } ^ { 2 } \leq 1$ [20, 21]. We reparameterize the step sizes by
87
+
88
+ $$
89
+ \tau = \eta / \omega \quad \mathrm { a n d } \quad \sigma = \omega \eta \qquad \mathrm { w i t h } \ \eta \in ( 0 , \infty ) \quad \mathrm { a n d } \quad \omega \in ( 0 , \infty ) .
90
+ $$
91
+
92
+ We call $\omega \in ( 0 , \infty )$ the primal weight, and $\eta \in ( 0 , \infty )$ the step size. Under this reparameterization PDHG converges for all $\eta \leq 1 / \| K \| _ { 2 }$ . This allows us to control the scaling between the primal and dual iterates with a single parameter $\omega$ . We use the term primal weight to describe $\omega$ because it weights the primal variables in the following norm:
93
+
94
+ $$
95
+ \| z \| _ { \omega } : = \sqrt { \omega \| x \| _ { 2 } ^ { 2 } + \frac { \| y \| _ { 2 } ^ { 2 } } { \omega } } .
96
+ $$
97
+
98
+ This norm plays a role in the theory for PDHG [20] and later algorithmic discussions.
99
+
100
+ For the baseline PDHG algorithm that we use for comparisons, we consider two simple choices for $\eta$ and $\omega$ . For the step size, set $\eta = 0 . 9 / \lVert K \rVert _ { 2 }$ where $\| K \| _ { 2 }$ is estimated via power iteration, and for the primal weight we set $\omega = 1$ ; this is similar to the default parameters in the standard PDHG implementation in ODL [2].
101
+
102
+ # 3 Practical algorithmic improvements
103
+
104
+ In this section, we detail these enhancements, and defer further experimental testing of them to Section 4 and ablation studies to Appendix C. While our enhancements are inspired by theory, our focus is on practical performance. The algorithm as a whole has no convergence guarantee, although some individual enhancements do; see Section 3.6 for further discussion.
105
+
106
+ Algorithm 1 presents pseudo-code for PDLP after preprocessing steps. We modify the step sizes (Section 3.1), add restarts (Section 3.2), and dynamically update the primal weights (Section 3.3). Before running Algorithm 1 we apply presolve (Section 3.4) and diagonal preconditioning (Section 3.5). There are some minor differences between the pseudo-code and the actual code. In particular, we only evaluate the restart or termination criteria (Line 10) every 40 iterations. This reduces the associated overheads with minimal impact on the total number of iterations. We also check the termination criteria before beginning the algorithm or if we detect a numerical error.
107
+
108
+ # Algorithm 1: PDLP (after preconditioning and presolve)
109
+
110
+ 1 Input: An initial solution z0,0;
111
+ 2 Initialize outer loop counter $n \gets 0$ , total iterations $k 0$ , step size $\hat { \eta } ^ { 0 , 0 } \gets 1 / \| K \| _ { \infty }$ , primal
112
+ weight $\omega ^ { 0 } $ InitializePrimalWeight $( c , q )$ ;
113
+ 3 repeat
114
+ 4 $t \gets 0$ ;
115
+ 5 repeat
116
+ 6 $\begin{array} { r l } & { z ^ { n , t + 1 } , \eta ^ { n , t + 1 } , \hat { \eta } ^ { n , t + 1 } \xleftarrow { \mathrm { A d a p t i v e S t e p } \ 0 \mathrm { f P D H } \mathfrak { G } } ( z ^ { n , t } , \omega ^ { n } , \hat { \eta } ^ { n , t } , k ) : } \\ & { \bar { z } ^ { n , t + 1 } \xleftarrow { \frac { 1 } { \sum _ { i = 1 } ^ { t + 1 } \eta ^ { n , i } } \sum _ { i = 1 } ^ { t + 1 } \eta ^ { n , i } z ^ { n , i } ; } } \\ & { z _ { \mathrm { c } } ^ { n , t + 1 } \xleftarrow { \mathrm { G e t R e s t a r t c a n d i d a t e } ( z ^ { n , t + 1 } , \bar { z } ^ { n , t + 1 } , z ^ { n , 0 } ) } ; } \\ & { t t + 1 , k k + 1 ; } \end{array}$
117
+ 7
118
+ 8
119
+ 9
120
+ 10 until restart or termination criteria holds;
121
+ 11 restart the outer loop. $z ^ { n + 1 , 0 } \gets z _ { \mathrm { c } } ^ { n , t }$ , $n \gets n + 1$ ;
122
+ 12 $\omega ^ { n } \gets$ PrimalWeightUpdate $( z ^ { n , 0 } , z ^ { n - 1 , 0 } , \omega ^ { n - 1 } )$ ;
123
+ 13 until termination criteria holds;
124
+ 14 Output: $z ^ { n , 0 }$ .
125
+
126
+ # 3.1 Step size choice
127
+
128
+ The convergence analysis [20, Equation (15)] of PDHG (equation (3)) relies on a small constant step size
129
+
130
+ $$
131
+ \eta \leq \frac { \| z ^ { k + 1 } - z ^ { k } \| _ { \omega } ^ { 2 } } { 2 ( y ^ { k + 1 } - y ^ { k } ) ^ { \top } K ( x ^ { k + 1 } - x ^ { k } ) }
132
+ $$
133
+
134
+ # Algorithm 2: One step of PDHG using our step size heuristic
135
+
136
+ Function AdaptiveStepOfPDHG $( z ^ { n , t } , \omega ^ { n } , \hat { \eta } ^ { n , t } , k )$ :
137
+ 2 $( x , y ) \gets z ^ { n , t }$ , $\eta \hat { \eta } ^ { n , t }$ ;
138
+ 3 for i = 1, . . . , ∞ do
139
+ 4 $\begin{array} { r } { x ^ { \prime } \mathbf { p r o j } _ { X } ( x - \frac { \eta } { \omega ^ { n } } ( c - K ^ { \top } y ) ) } \end{array}$ ;
140
+ 5 $y ^ { \prime } \mathbf { p r o j } _ { Y } ( y + \eta \omega ^ { n } ( q - K ( 2 x ^ { \prime } - x ) ) )$ ;
141
+ 6 η¯ ← k(x −x,y −y)k ωn2(y0−y)>K(x0−x) ;
142
+ 7 $\eta ^ { \prime } \operatorname* { m i n } ( ( 1 - ( k + 1 ) ^ { - 0 . 3 } ) \bar { \eta } , ( 1 + ( k + 1 ) ^ { - 0 . 6 } ) \eta ) ;$
143
+ 8 if $\eta \leq \bar { \eta }$ then
144
+ 9 return $( x ^ { \prime } , y ^ { \prime } ) , \eta , \eta ^ { \prime }$
145
+ 10 end
146
+ 11 $\eta \eta ^ { \prime }$ ;
147
+ 12 end
148
+
149
+ where $z ^ { k } = ( x ^ { k } , y ^ { k } )$ . Classically one would ensure (5) by picking $\begin{array} { r } { \eta = \frac { 1 } { \left. K \right. _ { 2 } } } \end{array}$ . This is overly pessimistic and requires estimation of $\| K \| _ { 2 }$ . Instead our AdaptiveStepOfPDHG adjusts $\eta$ dynamically to ensure that (5) is satisfied. If (5) isn’t satisfied, we abort the step; i.e., we reduce $\eta$ , and try again. If (5) is satisfied we accept the step. This is described in Algorithm 2. Note that in Algorithm 2 η¯ ≥ 1kKk2 holds always, and from this one can show the resulting step size $\begin{array} { r } { \eta \geq \frac { 1 - o ( 1 ) } { \| K \| _ { 2 } } } \end{array}$ holds as $k \to \infty$ .
150
+
151
+ Our step size routine compares favorably in practice with the line search by Malitsky and Pock [43] (See Appendix C.1).
152
+
153
+ # 3.2 Adaptive restarts
154
+
155
+ In PDLP, we adaptively restart the PDHG algorithm in each outer iteration. The key to our restarts at the $n$ -th outer iteration is the normalized duality gap at $z$ which for any radius $r \in ( 0 , \infty )$ is defined by
156
+
157
+ $$
158
+ \rho _ { r } ^ { n } ( z ) : = \frac { 1 } { r } \operatorname* { m a x i m i z e } _ { ( \hat { x } , \hat { y } ) \in \{ \hat { z } \in Z : \| \hat { z } - z \| _ { \omega ^ { n } } \leq r \} } \{ \mathcal { L } ( x , \hat { y } ) - \mathcal { L } ( \hat { x } , y ) \} ,
159
+ $$
160
+
161
+ introduced by [7]. Unlike the standard duality gap
162
+
163
+ $$
164
+ \operatorname* { m a x i m i z e } _ { ( { \hat { x } } , { \hat { y } } ) \in Z } \{ { \mathcal { L } } ( x , { \hat { y } } ) - { \mathcal { L } } ( { \hat { x } } , y ) \} ,
165
+ $$
166
+
167
+ the normalized duality gap is always a finite quantity. Furthermore, for any value of $r$ and $\omega ^ { n }$ , the normalized duality gap $\rho _ { r } ^ { n } ( z )$ is 0 if and only if the solution $z$ is an optimal solution to (2) [7]; thus, it provides a valid metric for measuring progress towards the optimal solution. The normalized duality gap is computable in linear time [7]. For brevity, define $\mu _ { n } ( z , z _ { \mathrm { r e f } } )$ as the normalized duality gap at $z$ with radius $\| z - z _ { \mathrm { r e f } } \| _ { \omega ^ { n } }$ , i.e.,
168
+
169
+ $$
170
+ \begin{array} { r } { \mu _ { n } ( z , z _ { \mathrm { r e f } } ) : = \rho _ { \parallel z - z _ { \mathrm { r e f } } \parallel _ { \omega ^ { n } } } ^ { n } ( z ) , } \end{array}
171
+ $$
172
+
173
+ where $z _ { \mathrm { r e f } }$ is a user-chosen reference point.
174
+
175
+ Choosing the restart candidate. To choose the restart candidate $z _ { \mathrm { c } } ^ { n , t + 1 }$ we call
176
+
177
+ $$
178
+ ( z ^ { n , t + 1 } , \bar { z } ^ { n , t + 1 } , z ^ { n , 0 } ) : = \left\{ \begin{array} { l l } { z ^ { n , t + 1 } } & { \mu _ { n } \big ( z ^ { n , t + 1 } , z ^ { n , 0 } \big ) < \mu _ { n } \big ( \bar { z } ^ { n , t + 1 } , z ^ { n , 0 } \big ) } \\ { \bar { z } ^ { n , t + 1 } } & { \mathrm { o t h e r w i s e } \ . } \end{array} \right.
179
+ $$
180
+
181
+ This choice is justified in Remark 5 of [7].
182
+
183
+ Restart criteria. We define three parameters: $\beta _ { \mathrm { s u f f i c i e n t } } \ \in \ ( 0 , 1 ) .$ , $\beta _ { \mathrm { n e c e s s a r y } } ~ \in ~ \left( 0 , \beta _ { \mathrm { s u f f i c i e n t } } \right)$ and $\beta _ { \mathrm { a r t i f i c i a l } } \in ( 0 , 1 )$ . In PDLP we use $\beta _ { \mathrm { s u f f i c i e n t } } = 0 . 9$ , $\beta _ { \mathrm { n e c e s s a r y } } = 0 . 1$ , and $\beta _ { \mathrm { a r t i f i c i a l } } = 0 . 5$ . The algorithm restarts if one of three conditions holds:
184
+
185
+ (i) (Sufficient decay in normalized duality gap) $\mu _ { n } ( z _ { \mathrm { c } } ^ { n , t + 1 } , z ^ { n , 0 } ) \leq \beta _ { \mathrm { s u f f i c i e n t } } \mu _ { n } ( z ^ { n , 0 } , z ^ { n - 1 , 0 } )$ , (ii) (Necessary decay $^ +$ no local progress in normalized duality gap)
186
+
187
+ $$
188
+ \begin{array} { r } { \mu _ { n } ( z _ { \mathrm { c } } ^ { n , t + 1 } , z ^ { n , 0 } ) \leq \beta _ { \mathrm { n e c e s s a r y } } \mu _ { n } ( z ^ { n , 0 } , z ^ { n - 1 , 0 } ) \quad \mathrm { a n d } \quad \mu _ { n } ( z _ { \mathrm { c } } ^ { n , t + 1 } , z ^ { n , 0 } ) > \mu _ { n } ( z _ { \mathrm { c } } ^ { n , t } , z ^ { n , 0 } ) , } \end{array}
189
+ $$
190
+
191
+ # (iii) (Long inner loop) $t \geq \beta _ { \mathrm { a r t i f i c i a l } } k$
192
+
193
+ The motivation for (i) is presented in [7]; it guarantees the linear convergence of restarted PDHG on LP problems. The second condition in (ii) is inspired by adaptive restart schemes for accelerated gradient descent where restarts are triggered if the function value increases [57]. The first inequality in (ii) provides a safeguard for the second one, preventing the algorithm restarting every inner iteration or never restarting. The motivation for (iii) relates to the primal weights (Section 3.3). In particular, primal weight updates only occur after a restart, and condition (iii) ensures that the primal weight will be updated infinitely often. This prevents a bad choice of primal weight in earlier iterations causing progress to stall for a long time.
194
+
195
+ # 3.3 Primal weight updates
196
+
197
+ The primal weight is initialized using
198
+
199
+ $$
200
+ \mathrm { I n i t i a l i z e P r i m a l W e i g h t } ( c , q ) : = \left\{ \begin{array} { l l } { \frac { \| c \| _ { 2 } } { \| q \| _ { 2 } } } & { \| c \| _ { 2 } , \| q \| _ { 2 } > \epsilon _ { \mathrm { z e r o } } } \\ { 1 } & { \mathrm { o t h e r w i s e } } \end{array} \right.
201
+ $$
202
+
203
+ where $\epsilon _ { \mathrm { z e r o } }$ is a small nonzero tolerance. This primal weight update scheme guarantees scale invariance. In particular, in Appendix A we consider PDHG with $\epsilon _ { \mathrm { z e r o } } = 0$ , $\eta = 0 . 9 / \| K \| _ { 2 }$ and $\omega =$ InitializePrimalWeight $( c , q )$ . In this simplified setting, we prove that if we multiply the objective, constraints, or the right hand side and variable bounds by a scalar then the iterate behaviour remain identical (up to a scaling factor).
204
+
205
+ # Algorithm 3: Primal weight update
206
+
207
+ 1 Function PrimalWeightUpdate(zn,0, zn−1,0, ωn−1):
208
+
209
+ 2 $\Delta _ { x } ^ { n } = \lVert x ^ { n , 0 } - x ^ { \bar { n - 1 } , 0 } \rVert _ { 2 } , \quad \Delta _ { y } ^ { n } = \lVert y ^ { n , 0 } - y ^ { n - 1 , 0 } \rVert _ { 2 } ;$
210
+ 3 if $\Delta _ { x } ^ { n } > \epsilon _ { z e r o }$ $\Delta _ { y } ^ { n } > \epsilon _ { z e r o }$
211
+ 4 $\begin{array} { r l } { \exp \left( \theta \log \left( \frac { \Delta _ { y } ^ { n } } { \Delta _ { x } ^ { n } } \right) + ( 1 - \theta ) \log \left( \omega ^ { n - 1 } \right) \right) } & { { } } \end{array}$
212
+ 5 else
213
+ 6 return $\omega ^ { n - 1 }$ ;
214
+ 7 end
215
+
216
+ Algorithm 3 aims to choose the primal weight $\omega ^ { n }$ such that distance to optimality in the primal and dual is the same, i.e., $\| ( x ^ { n , t } - \bar { x ^ { \star } } , \mathbf { 0 } ) \| _ { \omega ^ { n } } \approx \| ( \mathbf { 0 } , y ^ { n , t } - y ^ { \star } ) \| _ { \omega ^ { n } }$ . By definition of $\| \cdot \| _ { \omega }$ ,
217
+
218
+ $$
219
+ \| ( x ^ { n , t } - x ^ { \star } , \mathbf { 0 } ) \| _ { \omega ^ { n } } = \omega ^ { n } \| x ^ { n , t } - x ^ { \star } \| _ { 2 } , \quad \| ( \mathbf { 0 } , y ^ { n , t } - y ^ { \star } ) \| _ { \omega ^ { n } } = \frac { 1 } { \omega ^ { n } } \| y ^ { n , t } - y ^ { \star } \| _ { 2 } .
220
+ $$
221
+
222
+ Setting these two terms equal yields beforehand, but we attempt to estim $\begin{array} { r } { \omega ^ { n } = \frac { \| y ^ { n , t } - y ^ { \star } \| _ { 2 } } { \| x ^ { n , t } - x ^ { \star } \| _ { 2 } } } \end{array}$ f course, the quantity . However, the quant kyn,t−y?k2 is unknowncan change $\Delta _ { y } ^ { n } / \Delta _ { x } ^ { n }$ $\Delta _ { y } ^ { n } / \Delta _ { x } ^ { n }$ wildly from one restart to another, causing $\omega ^ { n }$ to oscillate. To dampen variations in $\omega ^ { n }$ , we first move to a log-scale where the primal weight is symmetric, i.e., $\log ( 1 / \omega ^ { n } ) = - \log ( \omega ^ { n } )$ , and perform a exponential smoothing with parameter $\theta \in [ 0 , 1 ]$ . In PDLP, we use $\theta = 0 . 5$ .
223
+
224
+ There are several important differences between our primal weight heuristic and literature [36, 37]. For example, [36,37] make relatively small changes to the primal weights at each iteration, attempting to balance the primal and dual residual. These changes have to be diminishingly small because, in our experience, PDHG may be unstable if they are too big. In contrast, in our method the primal weight is only updated during restarts, which in practice allows for much larger changes without instability issues. Moreover, our scheme tries to balance the weighted distance traveled in the primal and dual rather than the residuals [36, 37].
225
+
226
+ # 3.4 Presolve
227
+
228
+ Presolving refers to transformation steps that simplify the input problem before starting the optimization solver. These steps span from relatively easy transformations such as detecting inconsistent bounds, removing empty rows and columns of $K$ , and removing variables whose lower and upper bounds are equal, to more complex operations such as detecting duplicate rows in $K$ and tightening bounds. Presolve is a standard component of traditional LP solvers [44]. We are not aware of presolve being combined with PDHG for LP. However, [41, 42] combine presolve with other FOMs.
229
+
230
+ As an experiment to measure the impact of presolve, we used PaPILO [29], an open-source presolving library. For technical reasons, it was easier to use PaPILO as a standalone executable than as a library. We simulate its effect by simply solving the preprocessed instances. Convergence criteria are evaluated with respect to the presolved instance, not the original problem.
231
+
232
+ # 3.5 Diagonal Preconditioning
233
+
234
+ Preconditioning is a popular heuristic in optimization for improving the convergence of FOMs. To avoid factorizations, we only consider diagonal preconditioners. Our goal is to rescale the constraint matrix $K = ( G , A )$ to $\tilde { K } = ( \tilde { G } , \tilde { A } ) = \tilde { D _ { 1 } K } D _ { 2 }$ with positive diagonal matrices $D _ { 1 }$ and $D _ { 2 }$ , so that the resulting matrix $\tilde { K }$ is “well balanced”. Such preconditioning creates a new LP instance that replaces $A , G , c , b , h , u$ , and $l$ in (1) with $\tilde { G } , \tilde { A }$ , $\hat { x } = D _ { 2 } ^ { - 1 } x$ , $\tilde { c } = D _ { 2 } c$ , $( \tilde { b } , \tilde { h } ) = D _ { 1 } ( b , h )$ , $\tilde { u } = D _ { 2 } ^ { - 1 } u$ and $\tilde { l } = D _ { 2 } ^ { - 1 } l$ . Common choices for $D _ { 1 }$ and $D _ { 2 }$ include:
235
+
236
+ • No scaling: Solve the original LP instance (1) without additional scaling, namely $D _ { 1 } = D _ { 2 } = I$ . • Pock-Chambolle [59]: Pock and Chambolle proposed a family of diagonal preconditioners3 for PDHG parameterized by $\alpha$ , where the diagonal matrices are defined by $( D _ { 1 } ) _ { j j } = \sqrt { \| K _ { j , \cdot } \| _ { 2 - \alpha } }$ for $j = 1 , . . . , m _ { 1 } + m _ { 2 }$ and $( D _ { 2 } ) _ { i i } = \sqrt { \| K _ { \cdot , i } \| _ { \alpha } }$ for $i = 1 , . . . , n$ . We use $\alpha = 1$ in PDLP (we also tested $\alpha = 0$ and $\alpha = 2$ ). This is the baseline diagonal preconditioner in the PDHG literature. • Ruiz [63]: Ruiz scaling is a popular algorithm in numerical linear algebra to equilibrate matrices. In an iteration of Ruiz scaling, the diagonal matrices are defined as $( D _ { 1 } ) _ { j j } = \sqrt { \| K _ { j , \cdot } \| _ { \infty } }$ for $j = 1 , . . . , m _ { 1 } + m _ { 2 }$ and $( D _ { 2 } ) _ { i i } = \sqrt { \| K _ { \cdot , i } \| _ { \infty } }$ for $i = 1 , . . . , n$ . Ruiz [63] shows that if this rescaling is applied iteratively, the infinity norm of each row and each column converge to 1.
237
+
238
+ For the default PDLP settings, we apply a combination of Ruiz rescaling [63] and the preconditioning technique proposed by Pock and Chambolle [59]. In particular, we apply 10 iterations of Ruiz scaling and then apply the Pock-Chambolle scaling. To illustrate the effectiveness of our proposed scaling technique, we compare it against these three common techniques in Appendix C.5.
239
+
240
+ # 3.6 Theoretical guarantees for the above enhancements
241
+
242
+ While PDLP’s enhancements are motivated by theory, some of them may not preserve theoretical guarantees as discussed below:
243
+
244
+ • We do not have a proof of convergence for the adaptive step size rule (Section 3.1).
245
+ • One can show our restart criteria (Section 3.2) preserve convergence guarantees by modifying the proof of [7] to a more general setting.
246
+ • Primal weight updates (Section 3.3) do not readily preserve convergence guarantees, but we conjecture that a proof of convergence is possible if they are updated infrequently.
247
+ • Presolve (Section 3.4) and diagonal preconditioning (Section 3.5) preserve theoretical guarantees because they can be viewed as applying PDHG to an LP instance with different data.
248
+
249
+ # 4 Numerical experiments
250
+
251
+ Our numerical experiments study the effectiveness of PDLP primarily with respect to traditional LP applications and benchmark sets. Section 4.1 describes the setup for the experiments. Section 4.2 demonstrates PDLP’s improvements over baseline PDHG. Section 4.3 compares PDLP with other FOMs. Section 4.4 highlights benchmark instances where PDLP outperforms a commercial LP solver. Finally, Section 4.5 illustrates the ability of PDLP to scale to a large application where barrier and simplex-based solvers run out of memory. The supplemental materials contain extensive ablation studies and additional instructions for reproducing the experiments.
252
+
253
+ # 4.1 Experimental setup
254
+
255
+ Optimality termination criteria. PDLP terminates with an approximately optimal solution when the primal-dual iterates $x \in X$ , $y \in Y$ , $\lambda \in \Lambda$ , satisfy:
256
+
257
+ $$
258
+ \begin{array} { r l } & { | q ^ { \top } y + l ^ { \top } \lambda ^ { + } - u ^ { \top } \lambda ^ { - } - c ^ { \top } x | \leq \epsilon ( 1 + | q ^ { \top } y + l ^ { \top } \lambda ^ { + } - u ^ { \top } \lambda ^ { - } | + | c ^ { \top } x | ) } \\ & { \qquad \| ( { A x } - b ) \| _ { 2 } \leq \epsilon ( 1 + \| q \| _ { 2 } ) } \\ & { \qquad \| c - K ^ { \top } y - \lambda \| _ { 2 } \leq \epsilon ( 1 + \| c \| _ { 2 } ) } \end{array}
259
+ $$
260
+
261
+ where $\epsilon \in ( 0 , \infty )$ is the termination tolerance. Note that if (6) is satisfied with $\epsilon = 0$ , then by LP duality we have found an optimal solution [35]. Indeed, (6a) is the duality gap, (6b) is primal feasibility, and (6c) is dual feasibility. We use these criteria to be consistent with those of SCS [54]. The PDHG algorithm does not explicitly include a reduced costs variable $\lambda$ . Therefore, to evaluate the optimality termination criteria we compute $\lambda = \mathbf { p r o j } _ { \Lambda } ( c - K ^ { \top } y )$ . All instances considered have an optimal primal-dual solution. We use $\epsilon = 1 0 ^ { - 8 }$ as a benchmark for high-quality solutions and $\epsilon = \dot { 1 } 0 ^ { - 4 }$ for moderately accurate solutions.
262
+
263
+ Benchmark datasets. We use three datasets to compare algorithmic performance. One is the LP benchmark dataset of 56 problems, formed by merging the instances from “Benchmark of Simplex LP Solvers”, “Benchmark of Barrier LP solvers”, and “Large Network-LP Benchmark” from [45]. We also created a larger benchmark of 383 instances curated from LP relaxations of mixed-integer programming problems from the MIPLIB2017 collection [34] (see Appendix B) that we label MIP Relaxations. MIP Relaxations was used extensively during algorithmic development, e.g., for hyperparameter choices; we held out LP benchmark as a test set. Finally, we also performed some experiments on the Netlib LP benchmark [31], an historically important benchmark that is no longer state of the art for large-scale LP.
264
+
265
+ Software. PDLP is implemented in an open-source Julia [15] module available at https: //github.com/google-research/FirstOrderLp.jl. The module also contains a baseline implementation of the extragradient method with many of the same enhancements as PDLP (labeled ‘Enh. Extragradient’). We compare with two external packages: SCS [54] version 2.1.3, an opensource generic cone solver based on ADMM, and Gurobi version 9.0.1, a state-of-the-art commercial LP solver. SCS supports two modes for solving the linear system that arises at each iteration, a direct method based on a cached LDL factorization (which is the default ‘SCS’) and an indirect method based on the conjugate gradient method (which we label ‘SCS (matrix-free)’). All solvers are run single-threaded. SCS and Gurobi are provided the same presolved instances as PDLP.
266
+
267
+ Computing environment. We used two computing environments for our experiments: 1) e2-highmem-2 virtual machines (VMs) on Google Cloud Platform (GCP). Each VM provides two virtual CPUs and 16GB RAM. 2) A dedicated workstation with an Intel Xeon E5-2669 v3 processor and 128 GB RAM. This workstation has a license for Gurobi that permits at most one concurrent solve. Total compute time on GCP for all preliminary and final experiments was approximately 72, 000 virtual CPU hours.
268
+
269
+ Initialization. All first-order methods use all-zero vectors as the initial starting points.
270
+
271
+ Metrics. We use the term KKT passes to refer to the number of matrix multiplications by both $K$ and $K ^ { \top }$ . Given that the most expensive operation in our algorithm is matrix-vector multiplication, this metric is less noisy than runtime for comparing performance between matrix-free solvers. SGM10 stands for shifted geometric mean with shift 10, which is computed by adding 10 to all data points, taking the geometric mean, and then subtracting 10. Unsolved instances are assigned values corresponding to the limits specified in the next paragraph.
272
+
273
+ Time and KKT pass limits. For Section 4.2 we impose a limit on the KKT passes of 100, 000.
274
+ For Section 4.3 we impose a time limit of 1 hour.
275
+
276
+ # 4.2 Impact of PDLP’s improvements
277
+
278
+ The y-axes of Figure 1 display the SGM10 of the KKT passes normalized by the value for baseline PDHG. We can see, with the exception of presolve for LP benchmark at tolerance $1 0 ^ { - 4 }$ , each of our modifications described in Section 3 improves the performance of PDHG.
279
+
280
+ ![](images/cf07ba9149d88bf36db5d069d5bfdb95182df7c308b1a0cf6b0f32d746d94b6c.jpg)
281
+ Figure 1: Summary of relative impact of PDLP’s improvements
282
+
283
+ ![](images/495c51e32202a8940dcaf7bd76eccbc8cbf088dad2e040d7d6474b010e4021d0.jpg)
284
+ Figure 2: Number of problems solved for MIP Relaxations (top), LP benchmark (middle), and Netlib (bottom) datasets.
285
+
286
+ # 4.3 Comparison with other first-order baselines
287
+
288
+ We compared PDLP with several other first-order baselines: SCS [54], in both direct (default) mode and matrix-free mode, and our enhanced implementation of the extragradient method [39, 48]. For SCS in matrix-free mode, we include the KKT passes from the conjugate gradient solves; for SCS in direct mode there is no reasonable measure of KKT passes for the factorization and direct solve, so we only measure running time. The comparisons are summarized in Figure 2.
289
+
290
+ # 4.4 PDLP versus simplex and barrier
291
+
292
+ In this section, we test the performance of PDLP against the three methods available in Gurobi: barrier, primal simplex, and dual simplex. By default when provided multiple threads, Gurobi runs these three methods concurrently and terminates when the first method completes. We used default termination for Gurobi and set $\epsilon = 1 0 ^ { - 8 }$ for PDLP. We ran experiments with instances from the MIP Relaxations and LP benchmark. Although, for most instances, Gurobi outperforms PDLP, we found problems for which PDLP exhibits moderate to significant gains. Table 1 gives examples of instances where our prototype implementation is within a factor of two of the best of the three Gurobi methods. While further improvements are needed for PDLP to truly compete with the portfolio of methods that Gurobi offers, we interpret these results as evidence that PDLP itself could be of value in this portfolio.
293
+
294
+ Table 1: Instances from MIP Relaxations (top) and LP benchmark (bottom) where PDLP is within a factor of 2 of the best of all Gurobi methods. Time to solve in seconds.
295
+
296
+ <table><tr><td>Instance</td><td>PDLP</td><td>Gurobi Barrier</td><td>Gurobi Primal Simp.</td><td>Gurobi Dual Simp.</td></tr><tr><td>ex9</td><td>1.6</td><td>102.6</td><td>181.3</td><td>47.6</td></tr><tr><td>genus-sym-g62-2</td><td>2.1</td><td>10.7</td><td>6.7</td><td>33.2</td></tr><tr><td>highschooll-aigio</td><td>72.6</td><td>243.8</td><td>&gt;3600</td><td>&gt;3600</td></tr><tr><td>neos-578379</td><td>1.4</td><td>0.7</td><td>1.7</td><td>1.8</td></tr><tr><td>rwth-timetable</td><td>1870.3</td><td>&gt;3600</td><td>&gt;3600</td><td>&gt;3600</td></tr><tr><td>ex10</td><td>4.9</td><td>63.1</td><td>16.8</td><td>7.9</td></tr><tr><td>nug08-3rd</td><td>2.2</td><td>3.2</td><td>2219.2</td><td>24.1</td></tr><tr><td>savsched1</td><td>35.9</td><td>25.9</td><td>56.0</td><td>261.3</td></tr></table>
297
+
298
+ Table 2: Solve time for PageRank instances. Gurobi barrier has crossover disabled, 1 thread. PDLP and SCS solve to $1 0 ^ { - 8 }$ relative accuracy. SCS is matrix-free. Baseline PDHG is unable to solve any instances. Presolve not applied. $\mathrm { O O M } = \cdot$ Out of Memory. The number of nonzero coefficients per instance is $8 \times$ (# nodes) − 18.
299
+
300
+ <table><tr><td># nodes</td><td>PDLP</td><td>SCS</td><td>Gurobi Barrier</td><td>Gurobi Primal Simp.</td><td>Gurobi Dual Simp.</td></tr><tr><td>104</td><td>7.4 sec.</td><td>1.3 sec.</td><td>36 sec.</td><td>37 sec.</td><td>114 sec.</td></tr><tr><td>105</td><td>35 sec.</td><td>38 sec.</td><td>7.8 hr.</td><td>9.3 hr.</td><td>&gt;24 hr.</td></tr><tr><td>106</td><td>11 min.</td><td>25 min.</td><td>0OM</td><td>&gt;24 hr.</td><td>1</td></tr><tr><td>107</td><td>5.4 hr.</td><td>3.8 hr.</td><td>1</td><td>1</td><td>1</td></tr></table>
301
+
302
+ # 4.5 Large-scale application: PageRank
303
+
304
+ Nesterov [50, equation (7.3)] gives an LP formulation of the standard “PageRank” problem. Although the LP formulation is not the best approach to computing PageRank, it is a source of very large instances. For a random scalable collection of PageRank instances, we used Barabási-Albert [9] preferential attachment graphs with approximately three edges per node; see Appendix D for details. The results are summarized in Table 2.
305
+
306
+ # 5 Conclusions and future work
307
+
308
+ We find our experimental results encouraging for the application of FOMs like PDHG to LP. At a minimum, they provide evidence against the claim that FOMs are useful only when moderately accurate solutions are desired. The practical success of our heuristics that lack theoretical guarantees provides fresh motivation for theoreticians to study these methods. It is important, as well, to understand what drives the difficulty of some instances and how they could be transformed to solve more quickly. We hope the community will use the benchmarks and baselines released with this work as a starting point for further investigating new FOMs for LP. With additional algorithmic and implementation refinements, we believe that PDLP or similar approaches could become part of the standard toolkit for linear programming.
309
+
310
+ # Acknowledgments and Disclosure of Funding
311
+
312
+ We thank Yura Malitsky for advice on parameter choices for the linesearch rule of [43].
313
+
314
+ The authors have no third-party funding or competing interests to declare.
315
+
316
+ References
317
+ [1] T. Achterberg, R. E. Bixby, Z. Gu, E. Rothberg, and D. Weninger. Presolve reductions in mixed integer programming. INFORMS Journal on Computing, 32(2):473–506, 2020.
318
+ [2] J. Adler, H. Kohr, and O. Öktem. Operator discretization library (ODL), Jan. 2017.
319
+ [3] A. Alacaoglu, O. Fercoq, and V. Cevher. On the convergence of stochastic primal-dual hybrid gradient. arXiv preprint arXiv:1911.00799, 2019.
320
+ [4] A. Ali, E. Wong, and J. Z. Kolter. A semismooth Newton method for fast, generic convex programming. In International Conference on Machine Learning, pages 70–79. PMLR, 2017.
321
+ [5] B. Amos and J. Z. Kolter. OptNet: Differentiable optimization as a layer in neural networks. In D. Precup and Y. W. Teh, editors, Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 136–145. PMLR, 06–11 Aug 2017.
322
+ [6] D. Applegate, M. Díaz, H. Lu, and M. Lubin. Infeasibility detection with primal-dual hybrid gradient for large-scale linear programming. arXiv preprint arXiv:2102.04592, 2021.
323
+ [7] D. Applegate, O. Hinder, H. Lu, and M. Lubin. Faster First-Order Primal-Dual Methods for Linear Programming using Restarts and Sharpness. arXiv preprint arXiv:2105.12715, 2021.
324
+ [8] K. J. Arrow, L. Hurwicz, and H. Uzawa. Studies in linear and non-linear programming. Stanford University Press, 1958.
325
+ [9] A.-L. Barabási and R. Albert. Emergence of scaling in random networks. Science, 286(5439):509–512, 1999.
326
+ [10] K. Basu, A. Ghoting, R. Mazumder, and Y. Pan. ECLIPSE: An extreme-scale linear program solver for web-applications. In H. D. III and A. Singh, editors, Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pages 704–714, Virtual, 13–18 Jul 2020. PMLR.
327
+ [11] H. H. Bauschke and P. L. Combettes. Convex analysis and monotone operator theory in Hilbert spaces, volume 408. Springer, 2 edition, 2017.
328
+ [12] A. Beck. First-Order Methods in Optimization. Society for Industrial and Applied Mathematics, Philadelphia, PA, 2017.
329
+ [13] A. Beck and N. Guttmann-Beck. FOM–a MATLAB toolbox of first-order methods for solving convex optimization problems. Optimization Methods and Software, 34(1):172–193, 2019.
330
+ [14] S. R. Becker, E. J. Candès, and M. C. Grant. Templates for convex cone problems with applications to sparse signal recovery. Mathematical programming computation, 3(3):165, 2011.
331
+ [15] J. Bezanson, A. Edelman, S. Karpinski, and V. B. Shah. Julia: A fresh approach to numerical computing. SIAM Review, 59(1):65–98, 2017.
332
+ [16] S. Boyd, N. Parikh, E. Chu, B. Peleato, and J. Eckstein. Distributed optimization and statistical learning via the alternating direction method of multipliers. Foundations and Trends $\textsuperscript { \textregistered }$ in Machine learning, 3(1):1–122, 2011.
333
+ [17] S. Boyd and L. Vandenberghe. Convex optimization. Cambridge university press, 2004.
334
+ [18] A. Chambolle, M. J. Ehrhardt, P. Richtárik, and C.-B. Schonlieb. Stochastic primal-dual hybrid gradient algorithm with arbitrary sampling and imaging applications. SIAM Journal on Optimization, 28(4):2783–2808, 2018.
335
+ [19] A. Chambolle and T. Pock. A first-order primal-dual algorithm for convex problems with applications to imaging. Journal of mathematical imaging and vision, 40(1):120–145, 2011.
336
+ [20] A. Chambolle and T. Pock. On the ergodic convergence rates of a first-order primal–dual algorithm. Mathematical Programming, 159(1):253–287, 2016.
337
+ [21] L. Condat. A primal–dual splitting method for convex optimization involving Lipschitzian, proximable and linear composite terms. Journal of Optimization Theory and Applications, 158(2):460–479, 2013.
338
+ [22] G. Dantzig. Linear programming and extensions. Princeton university press, 2016.
339
+ [23] G. B. Dantzig. Origins of the simplex method. In A history of scientific computing, pages 141–151. Association for Computing Machinery, New York, NY, USA, 1990.
340
+ [24] J. Eckstein and D. P. Bertsekas. An alternating direction method for linear programming. Technical Report LIDS-P-1967, Laboratory for Information and Decision Systems, Massachusetts Institute of Technology, 1990.
341
+ [25] J. Eckstein and D. P. Bertsekas. On the Douglas–Rachford splitting method and the proximal point algorithm for maximal monotone operators. Mathematical Programming, 55(1-3):293– 318, 1992.
342
+ [26] J. Eckstein and G. Matyasfalvi. Efficient distributed-memory parallel matrix-vector multiplication with wide or tall unstructured sparse matrices. arXiv preprint arXiv:1812.00904, 2018.
343
+ [27] E. Esser, X. Zhang, and T. F. Chan. A general framework for a class of first order primal-dual algorithms for convex optimization in imaging science. SIAM Journal on Imaging Sciences, 3(4):1015–1046, 2010.
344
+ [28] C. Fougner and S. Boyd. Parameter selection and preconditioning for a graph form solver. In Emerging Applications of Control and Systems Theory, pages 41–61. Springer, 2018.
345
+ [29] G. Gamrath, D. Anderson, K. Bestuzheva, W.-K. Chen, L. Eifler, M. Gasse, P. Gemander, A. Gleixner, L. Gottwald, K. Halbig, et al. The SCIP optimization suite 7.0. ZIB-Report 20-10, Zuse Institut Berlin, 2020.
346
+ [30] M. Garstka, M. Cannon, and P. Goulart. COSMO: A conic operator splitting method for large convex problems. In European Control Conference, 2019.
347
+ [31] D. M. Gay. Electronic mail distribution of linear programming test problems. Mathematical Programming Society COAL Newsletter, 13:10–12, 1985.
348
+ [32] A. Gilpin, J. Pena, and T. Sandholm. First-order algorithm with $\mathcal { O } ( \ln ( 1 / \epsilon ) )$ convergence for $\epsilon$ -equilibrium in two-person zero-sum games. Mathematical programming, 133(1):279–298, 2012.
349
+ [33] P. Giselsson and S. Boyd. Linear convergence and metric selection for Douglas-Rachford splitting and ADMM. IEEE Transactions on Automatic Control, 62(2):532–544, 2016.
350
+ [34] A. Gleixner, G. Hendel, G. Gamrath, T. Achterberg, M. Bastubbe, T. Berthold, P. M. Christophel, K. Jarck, T. Koch, J. Linderoth, M. Lübbecke, H. D. Mittelmann, D. Ozyurt, T. K. Ralphs, D. Salvagnin, and Y. Shinano. MIPLIB 2017: Data-Driven Compilation of the 6th Mixed-Integer Programming Library. Mathematical Programming Computation, 2021.
351
+ [35] A. J. Goldman and A. W. Tucker. Theory of linear programming. Linear inequalities and related systems, 38:53–97, 1956.
352
+ [36] T. Goldstein, M. Li, and X. Yuan. Adaptive primal-dual splitting methods for statistical learning and image processing. In Advances in Neural Information Processing Systems, pages 2089–2097, 2015.
353
+ [37] T. Goldstein, M. Li, X. Yuan, E. Esser, and R. Baraniuk. Adaptive primal-dual hybrid gradient methods for saddle-point problems. arXiv preprint arXiv:1305.0546, 2013.
354
+ [38] B. He and X. Yuan. Convergence analysis of primal-dual algorithms for a saddle-point problem: from contraction perspective. SIAM Journal on Imaging Sciences, 5(1):119–149, 2012.
355
+ [39] G. M. Korpelevich. The extragradient method for finding saddle points and other problems. Matecon, 12:747–756, 1976.
356
+ [40] G. Lan, Z. Lu, and R. D. C. Monteiro. Primal-dual first-order methods with $\mathcal { O } ( 1 / \epsilon )$ iterationcomplexity for cone programming. Mathematical Programming, 126(1):1–29, Jan 2011.
357
+ [41] X. Li, D. Sun, and K.-C. Toh. An asymptotically superlinearly convergent semismooth newton augmented lagrangian method for linear programming. SIAM Journal on Optimization, 30(3):2410–2440, 2020.
358
+ [42] T. Lin, S. Ma, Y. Ye, and S. Zhang. An ADMM-based interior-point method for large-scale linear programming. Optimization Methods and Software, 36(2-3):389–424, 2021.
359
+ [43] Y. Malitsky and T. Pock. A first-order primal-dual algorithm with linesearch. SIAM Journal on Optimization, 28(1):411–432, 2018.
360
+ [44] I. Maros. Computational Techniques of the Simplex Method. International Series in Operations Research & Management Science. Springer US, 2002.
361
+ [45] H. Mittelmann. Decision tree for optimization software. http://plato.asu.edu/guide. html, 2021.
362
+ [46] V. Nair, S. Bartunov, F. Gimeno, I. von Glehn, P. Lichocki, I. Lobov, B. O’Donoghue, N. Sonnerat, C. Tjandraatmadja, P. Wang, R. Addanki, T. Hapuarachchi, T. Keck, J. Keeling, P. Kohli, I. Ktena, Y. Li, O. Vinyals, and Y. Zwols. Solving Mixed Integer Programs Using Neural Networks. arXiv preprint arXiv:2012.13349, Dec. 2020.
363
+ [47] I. Necoara, Y. Nesterov, and F. Glineur. Linear convergence of first order methods for nonstrongly convex optimization. Mathematical Programming, 175(1):69–107, May 2019.
364
+ [48] A. Nemirovski. Prox-method with rate of convergence $O ( 1 / t )$ for variational inequalities with Lipschitz continuous monotone operators and smooth convex-concave saddle point problems. SIAM Journal on Optimization, 15(1):229–251, 2004.
365
+ [49] Y. Nesterov. A method of solving a convex programming problem with convergence rate $O ( 1 / k ^ { 2 } )$ . Soviet Mathematics Doklady, 27(2):372–376, 1983.
366
+ [50] Y. Nesterov. Subgradient methods for huge-scale optimization problems. Mathematical Programming, 146:275–297, 2014.
367
+ [51] Y. Nesterov and A. Nemirovskii. Interior-point polynomial algorithms in convex programming, volume 13. SIAM, 1994.
368
+ [52] B. O’Donoghue. Operator splitting for a homogeneous embedding of the monotone linear complementarity problem. arXiv preprint arXiv:2004.02177, 2020.
369
+ [53] B. O’Donoghue, E. Chu, N. Parikh, and S. Boyd. Conic optimization via operator splitting and homogeneous self-dual embedding. Journal of Optimization Theory and Applications, 169(3):1042–1068, June 2016.
370
+ [54] B. O’Donoghue, E. Chu, N. Parikh, and S. Boyd. SCS: Splitting conic solver, version 2.1.0. https://github.com/cvxgrp/scs, Nov. 2017.
371
+ [55] W. Orchard-Hays. History of mathematical programming systems. IEEE Annals of the History of Computing, 6(3):296–312, 1984.
372
+ [56] D. O’Connor and L. Vandenberghe. On the equivalence of the primal-dual hybrid gradient method and Douglas–Rachford splitting. Mathematical Programming, 179(1):85–108, 2020.
373
+ [57] B. O’Donoghue and E. Candes. Adaptive restart for accelerated gradient schemes. Foundations of computational mathematics, 15(3):715–732, 2015.
374
+ [58] N. Parikh and S. Boyd. Proximal algorithms. Foundations and Trends $\textsuperscript { \textregistered }$ in Optimization, 1(3):127–239, 2014.
375
+ [59] T. Pock and A. Chambolle. Diagonal preconditioning for first order primal-dual algorithms in convex optimization. In 2011 International Conference on Computer Vision, pages 1762–1769. IEEE, 2011.
376
+ [60] T. Pock, D. Cremers, H. Bischof, and A. Chambolle. An algorithm for minimizing the mumfordshah functional. In 2009 IEEE 12th International Conference on Computer Vision, pages 1133–1140. IEEE, 2009.
377
+ [61] J. Renegar. Accelerated first-order methods for hyperbolic programming. Mathematical Programming, 173(1):1–35, Jan 2019.
378
+ [62] R. T. Rockafellar. Monotone operators and the proximal point algorithm. SIAM journal on control and optimization, 14(5):877–898, 1976.
379
+ [63] D. Ruiz. A scaling algorithm to equilibrate both rows and columns norms in matrices. Technical report, CM-P00040415, 2001.
380
+ [64] E. K. Ryu and S. Boyd. Primer on monotone operator methods. Appl. Comput. Math, 15(1):3–43, 2016.
381
+ [65] A. Schrijver. Theory of linear and integer programming. John Wiley & Sons, 1998.
382
+ [66] M. Souto, J. D. Garcia, and Á. Veiga. Exploiting low-rank structure in semidefinite programming by approximate operator splitting. Optimization, pages 1–28, 2020.
383
+ [67] B. Stellato, G. Banjac, P. Goulart, A. Bemporad, and S. Boyd. OSQP: an operator splitting solver for quadratic programs. Mathematical Programming Computation, 12(4):637–672, 2020.
384
+ [68] Y. M. Tsai, T. Cojean, and H. Anzt. Sparse linear algebra on AMD and NVIDIA GPUs – the race is on. In P. Sadayappan, B. L. Chamberlain, G. Juckeland, and H. Ltaief, editors, High Performance Computing, pages 309–327, Cham, 2020. Springer International Publishing.
385
+ [69] R. J. Vanderbei et al. Linear programming, volume 3. Springer, 2015.
386
+ [70] S. Wang and N. Shroff. A new alternating direction method for linear programming. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017.
387
+ [71] T. Yang and Q. Lin. RSG: Beating subgradient method without smoothness and strong convexity. The Journal of Machine Learning Research, 19(1):236–268, 2018.
388
+ [72] M. Zhu and T. Chan. An efficient primal-dual hybrid gradient algorithm for total variation image restoration. UCLA CAM Report, 34:8–34, 2008.
389
+
390
+ # Checklist
391
+
392
+ 1. For all authors...
393
+
394
+ (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
395
+ (b) Did you describe the limitations of your work? [Yes] Our comparisons with baselines show that PDLP is not always the best, hence demonstrating its limitations. We also note which of our heuristics are lacking theoretical guarantees.
396
+ (c) Did you discuss any potential negative societal impacts of your work? [No] As a purely algorithmic paper, we do not believe such a discussion is relevant. Linear programming is a mature area whose societal impact is well understood.
397
+ (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
398
+
399
+ 2. If you are including theoretical results...
400
+
401
+ (a) Did you state the full set of assumptions of all theoretical results? [Yes] The only theoretical result appear in the appendix (Proposition 1). (b) Did you include complete proofs of all theoretical results? [Yes]
402
+
403
+ 3. If you ran experiments...
404
+
405
+ (a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] Code, data, and instructions needed to reproduce the main experimental results are publicly released in an open source repository at https://github.com/google-research/ FirstOrderLp.jl. Additional instructions are included in the supplementary materials.
406
+ (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] We discussed that we used MIP Relaxations to build our algorithm
407
+
408
+ and LP benchmark and Netlib as held out evaluation sets. We run a large ablation study to justify algorithmic decisions and most hyperparameter settings.
409
+
410
+ (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No] We used large datasets that would have been computational intensive to run multiple times. When possible, we use the “KKT pass” metric that’s reproducible and not subject to measurement noise. Only the PageRank instances use a random seed, and these are too large to run multiple times because we have a single concurrent license for Gurobi.
411
+ (d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Section 4.1.
412
+
413
+ 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
414
+
415
+ (a) If your work uses existing assets, did you cite the creators? [Yes] We use LP Benchmark, MIP Relaxations, and Netlib datasets. We cite the sources for the datasets.
416
+ (b) Did you mention the license of the assets? [No] Although these datasets are widely used in the community, we were unable to find explicit licenses.
417
+ (c) Did you include any new assets either in the supplemental material or as a URL? [Yes] We include our code and data processing scripts in the supplemental material.
418
+ (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [No]
419
+ (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
420
+
421
+ 5. If you used crowdsourcing or conducted research with human subjects...
422
+
423
+ (a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
424
+ (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
425
+ (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
md/train/axNDkxU9-6z/axNDkxU9-6z.md ADDED
The diff for this file is too large to render. See raw diff
 
md/train/bEoxzW_EXsa/bEoxzW_EXsa.md ADDED
The diff for this file is too large to render. See raw diff
 
md/train/blfSjHeFM_e/blfSjHeFM_e.md ADDED
@@ -0,0 +1,660 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # MALI: A MEMORY EFFICIENT AND REVERSE ACCURATE INTEGRATOR FOR NEURAL ODES
2
+
3
+ Juntang Zhuang; Nicha C. Dvornek; Sekhar Tatikonda; James S. Duncan {j.zhuang; nicha.dvornek; sekhar.tatikonda; james.duncan} @yale.edu Yale University, New Haven, CT, USA
4
+
5
+ # ABSTRACT
6
+
7
+ Neural ordinary differential equations (Neural ODEs) are a new family of deeplearning models with continuous depth. However, the numerical estimation of the gradient in the continuous case is not well solved: existing implementations of the adjoint method suffer from inaccuracy in reverse-time trajectory, while the naive method and the adaptive checkpoint adjoint method (ACA) have a memory cost that grows with integration time. In this project, based on the asynchronous leapfrog (ALF) solver, we propose the Memory-efficient ALF Integrator (MALI), which has a constant memory cost w.r.t number of solver steps in integration similar to the adjoint method, and guarantees accuracy in reverse-time trajectory (hence accuracy in gradient estimation). We validate MALI in various tasks: on image recognition tasks, to our knowledge, MALI is the first to enable feasible training of a Neural ODE on ImageNet and outperform a well-tuned ResNet, while existing methods fail due to either heavy memory burden or inaccuracy; for time series modeling, MALI significantly outperforms the adjoint method; and for continuous generative models, MALI achieves new state-of-theart performance.We provide a pypi package: https://jzkay12.github. io/TorchDiffEqPack
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Recent research builds the connection between continuous models and neural networks. The theory of dynamical systems has been applied to analyze the properties of neural networks or guide the design of networks (Weinan, 2017; Ruthotto & Haber, 2019; Lu et al., 2018). In these works, a residual block (He et al., 2016) is typically viewed as a one-step Euler discretization of an ODE; instead of directly analyzing the discretized neural network, it might be easier to analyze the ODE.
12
+
13
+ Another direction is the neural ordinary differential equation (Neural ODE) (Chen et al., 2018), which takes a continuous depth instead of discretized depth. The dynamics of a Neural ODE is typically approximated by numerical integration with adaptive ODE solvers. Neural ODEs have been applied in irregularly sampled time-series (Rubanova et al., 2019), free-form continuous generative models (Grathwohl et al., 2018; Finlay et al., 2020), mean-field games (Ruthotto et al., 2020), stochastic differential equations (Li et al., 2020) and physically informed modeling (SanchezGonzalez et al., 2019; Zhong et al., 2019).
14
+
15
+ Though the Neural ODE has been widely applied in practice, how to train it is not extensively studied. The naive method directly backpropagates through an ODE solver, but tracking a continuous trajectory requires a huge memory. Chen et al. (2018) proposed to use the adjoint method to determine the gradient in continuous cases, which achieves constant memory cost $w . r . t$ integration time; however, as pointed out by Zhuang et al. (2020), the adjoint method suffers from numerical errors due to the inaccuracy in reverse-time trajectory. Zhuang et al. (2020) proposed the adaptive checkpoint adjoint (ACA) method to achieve accuracy in gradient estimation at a much smaller memory cost compared to the naive method, yet the memory consumption of ACA still grows linearly with integration time. Due to the non-constant memory cost, neither ACA nor naive method are suitable for large scale datasets (e.g. ImageNet) or high-dimensional Neural ODEs (e.g. FFJORD (Grathwohl et al., 2018)).
16
+
17
+ In this project, we propose the Memory-efficient Asynchronous Leapfrog Integrator (MALI) to achieve advantages of both the adjoint method and ACA: constant memory cost w.r.t integration time and accuracy in reverse-time trajectory. MALI is based on the asynchronous leapfrog (ALF) integrator (Mutze, 2013). With the ALF integrator, each numerical step forward in time is reversible. Therefore, with MALI, we delete the trajectory and only keep the end-time states, hence achieve constant memory cost w.r.t integration time; using the reversibility, we can accurately reconstruct the trajectory from the end-time value, hence achieve accuracy in gradient. Our contributions are:
18
+
19
+ 1. We propose a new method (MALI) to solve Neural ODEs, which achieves constant memory cost w.r.t number of solver steps in integration and accuracy in gradient estimation. We provide theoretical analysis.
20
+ 2. We validate our method with extensive experiments: (a) for image classification tasks, MALI enables a Neural ODE to achieve better accuracy than a well-tuned ResNet with the same number of parameters; to our knowledge, MALI is the first method to enable training of Neural ODEs on a large-scale dataset such as ImageNet, while existing methods fail due to either heavy memory burden or inaccuracy. (b) In time-series modeling, MALI achieves comparable or better results than other methods. (c) For generative modeling, a FFJORD model trained with MALI achieves new state-of-the-art results on MNIST and Cifar10.
21
+
22
+ # 2 PRELIMINARIES
23
+
24
+ # 2.1 NUMERICAL INTEGRATION METHODS
25
+
26
+ An ordinary differential equation (ODE) typically takes the form
27
+
28
+ $$
29
+ \frac { \mathrm { d } z ( t ) } { \mathrm { d } t } = f _ { \theta } ( t , z ( t ) ) \quad s . t . \quad z ( t _ { 0 } ) = x , t \in [ t _ { 0 } , T ] , \quad L o s s = L ( z ( T ) , y )
30
+ $$
31
+
32
+ where $z ( t )$ is the hidden state evolving with time, $T$ is the end time, $t _ { 0 }$ is the start time (typically 0), $x$ is the initial state. The derivative of $z ( t )$ w.r.t $t$ is defined by a function $f$ , and $f$ is defined as a sequence of layers parameterized by $\theta$ . The loss function is $L ( z ( T ) , y )$ , where $y$ is the target variable. Eq. 1 is called the initial value problem (IVP) because only $z ( t _ { 0 } )$ is specified.
33
+
34
+ Notations We summarize the notations following Zhuang et al. (2020).
35
+
36
+ • $z _ { i } ( t _ { i } ) / \overline { { z } } ( \tau _ { i } )$ : hidden state in forward/reverse time trajectory at time $t _ { i } / \tau _ { i }$ .
37
+ • $\psi _ { h } ( t _ { i } , z _ { i } )$ : the numerical solution at time $t _ { i } + h$ , starting from $( t _ { i } , z _ { i } )$ with a stepsize $h$ .
38
+ • $N _ { f } , N _ { z } \colon N _ { f }$ is the number of layers in $f$ in Eq. 1, $N _ { z }$ is the dimension of $z$ .
39
+ • $N _ { t } / N _ { r }$ : number of discretized points (outer iterations in Algo. 1) in forward / reverse integration.
40
+ • $m$ : average number of inner iterations in Algo. 1 to find an acceptable stepsize.
41
+
42
+ <table><tr><td>Algorithm1:Numerical Integration</td></tr><tr><td>Input initial state x,start timeto,end time T,error tolerance etol,initial</td></tr><tr><td>stepsize h. Initialize z(O) = x,t = to</td></tr><tr><td>Whilet&lt;T error_est=</td></tr><tr><td>While error_est&gt;etol h←h×DecayFactor</td></tr><tr><td>,error_est=yh(t,z) If error_est&lt;etol h←h×IncreaseFactor</td></tr></table>
43
+
44
+ Numerical Integration The algorithm for general adaptive-stepsize numerical ODE solvers is summarized in Algo. 1 (Wanner & Hairer, 1996). The solver repeatedly advances in time by a step, which is the outer loop in Algo. 1 (blue curve in Fig. 1). For each step, the solver decreases the stepsize until the estimate of error is lower than the tolerance, which is the inner loop in Algo. 1 (green curve in Fig. 1). For fixed-stepsize solvers, the inner loop is replaced with a single evaluation of $\psi _ { h } ( t , z )$ using predefined stepsize $h$ . Different methods typically use different $\psi$ , for example different orders of the Runge-Kutta method (Runge, 1895).
45
+
46
+ # 2.2 ANALYTICAL FORM OF GRADIENT IN CONTINUOUS CASE
47
+
48
+ We first briefly introduce the analytical form of the gradient in the continuous case, then we compare different numerical implementations in the literature to estimate the gradient. The analytical form
49
+
50
+ Table 1: Comparison between different methods for gradient estimation in continuous case. MALI achieves reverse accuracy, constant memory $w . r . t$ number of solver steps in integration, shallow computation graph and low computation cost.
51
+
52
+ <table><tr><td></td><td>Naive</td><td>Adjoint</td><td>ACA</td><td>MALI</td></tr><tr><td>Computation</td><td>NzNf×Nt×m×2</td><td>NzNf ×(Nt+Nr)×m</td><td>NzNf×Nt×(m+1)</td><td>NzNf×Nt×(m+2)</td></tr><tr><td>Memory</td><td>NzNf ×Nt × m</td><td>NzNf</td><td>Nz(Nf+Nt)</td><td>Nz(Nf +1)</td></tr><tr><td>Computation graph depth</td><td>Nf×Nt × m</td><td>Nf × Nr</td><td>Nf×Nt</td><td>Nf×Nt</td></tr><tr><td>Reverse accuracy</td><td></td><td>X</td><td></td><td></td></tr></table>
53
+
54
+ ![](images/22ff9c5a98236b61e291de2a5527538346dcc29c82d2c1ea58fe9325157384e8.jpg)
55
+ Figure 1: Illustration of numerical solver in forward-pass. For adaptive solvers, for each step forward-in-time, the stepsize is recursively adjusted until the estimated error is below predefined tolerance; the search process is represented by green curve, and the accepted step (ignore the search process) is represented by blue curve.
56
+
57
+ ![](images/b9c171536db45dffcafe51dcb7787e83aa5364bb5ae81e081dc303fe7404bbed.jpg)
58
+ Figure 2: In backward-pass, the adjoint method reconstructs trajectory as a separate IVP. Naive, ACA and MALI track the forward-time trajectory, hence are accurate. ACA and MALI only backpropagate through the accepted step, while naive method backpropagates through the search process hence has deeper computation graphs.
59
+
60
+ of the gradient in the continuous case is
61
+
62
+ $$
63
+ \frac { \mathrm { d } L } { \mathrm { d } \theta } = - \int _ { T } ^ { 0 } \boldsymbol { a } ( t ) ^ { \top } \frac { \partial f ( \boldsymbol { z } ( t ) , t , \theta ) } { \partial \theta } d t
64
+ $$
65
+
66
+ $$
67
+ \frac { \mathrm { d } a ( t ) } { d t } + \bigg ( \frac { \partial f ( z ( t ) , t , \theta ) } { \partial z ( t ) } \bigg ) ^ { \top } a ( t ) = 0 \ \forall t \in ( 0 , T ) , a ( T ) = \frac { \partial L } { \partial z ( T ) }
68
+ $$
69
+
70
+ where $a ( t )$ is the “adjoint state”. Detailed proof is given in (Pontryagin, 1962). In the next section we compare different numerical implementations of this analytical form.
71
+
72
+ # 2.3 NUMERICAL IMPLEMENTATIONS IN THE LITERATURE FOR THE ANALYTICAL FORM
73
+
74
+ We compare different numerical implementations of the analytical form in this section. The forwardpass and backward-pass of different methods are demonstrated in Fig. 1 and Fig. 2 respectively. Forward-pass is similar for different methods. The comparison of backward-pass among different methods are summarized in Table. 1. We explain methods in the literature below.
75
+
76
+ Naive method The naive method saves all of the computation graph (including search for optimal stepsize, green curve in Fig. 2) in memory, and backpropagates through it. Hence the memory cost is $N _ { z } N _ { f } \times N _ { t } \times m$ and depth of computation graph are $N _ { f } \times N _ { t } \times m$ , and the computation is doubled considering both forward and backward passes. Besides the large memory and computation, the deep computation graph might cause vanishing or exploding gradient (Pascanu et al., 2013).
77
+
78
+ Adjoint method Note that we use “adjoint state equation” to refer to the analytical form in Eq. 2 and 3, while we use “adjoint method” to refer to the numerical implementation by Chen et al. (2018). As in Fig. 1 and 2, the adjoint method forgets forward-time trajectory (blue curve) to achieve memory cost $N _ { z } N _ { f }$ which is constant to integration time; it takes the end-time state (derived from forward-time integration) as the initial state, and solves a separate IVP (red curve) in reverse-time.
79
+
80
+ the reconstructed initial value by the adjoint method is Theorem 2.1. (Zhuang et al., 2020) For an ODE solver of order $\begin{array} { r } { \sum _ { k = 0 } ^ { N - 1 } \left[ h _ { k } ^ { p + 1 } D \Phi _ { t _ { k } } ^ { T } ( z _ { k } ) l ( t _ { k } , z _ { k } ) \right. + } \end{array}$ $p _ { ; }$ , the error of $( - h _ { k } ) ^ { p + 1 } D \Phi _ { T } ^ { t _ { k } } ( { \overline { { z _ { k } } } } ) \overline { { l ( t _ { k } , { \overline { { z _ { k } } } } ) } } ] + O ( h ^ { p + 1 } )$ , where $\Phi$ is the ideal solution, $D \Phi$ is the Jacobian of $\Phi , l ( t , z )$ and $\overline { { l ( t , z ) } }$ are the local error in forward-time and reverse-time integration respectively.
81
+
82
+ Theorem 2.1 is stated as Theorem 3.2 in Zhuang et al. (2020); please see reference paper for detailed proof. To summarize, due to inevitable errors with numerical ODE solvers, the reverse-time trajectory (red curve, $\overline { { z } } ( \tau )$ ) cannot match the forward-time trajectory (blue curve, $z ( t ) .$ ) accurately. The error in $\overline { z }$ propagates to $\textstyle { \frac { \mathrm { d } L } { \mathrm { d } \theta } }$ by Eq. 2, hence affects the accuracy in gradient estimation.
83
+
84
+ Adaptive checkpoint adjoint (ACA) To solve the inaccuracy of adjoint method, Zhuang et al. (2020) proposed ACA: ACA stores forward-time trajectory in memory for backward-pass, hence guarantees accuracy; ACA deletes the search process (green curve in Fig. 2), and only backpropagates through the accepted step (blue curve in Fig. 2), hence has a shallower computation graph $( N _ { f } \times N _ { t }$ for ACA vs $N _ { f } \times N _ { t } \times m$ for naive method). ACA only stores $\{ z ( t _ { i } ) \} _ { i = 1 } ^ { N _ { t } }$ , and deletes the computation graph for $\{ f ( z ( t _ { i } ) , t _ { i } ) \} _ { i = 1 } ^ { N _ { t } }$ , hence the memory cost is $N _ { z } ( N _ { f } + N _ { t } )$ . Though the memory cost is much smaller than the naive method, it grows linearly with $N _ { t }$ , and can not handle very high dimensional models. In the following sections, we propose a method to overcome all these disadvantages of existing methods.
85
+
86
+ # 3 METHODS
87
+
88
+ # 3.1 ASYNCHRONOUS LEAPFROG INTEGRATOR
89
+
90
+ In this section we give a brief introduction to the asynchronous leapfrog (ALF) method (Mutze, 2013), and we provide theoretical analysis which is missing in Mutze (2013). For general firstorder ODEs in the form of Eq. 1, the tuple $( z , t )$ is sufficient for most ODE solvers to take a step numerically. For ALF, the required tuple is $( z , v , t )$ , where $v$ is the “approximated derivative”. Most numerical ODE solvers such as the Runge-Kutta method (Runge, 1895) track state $z$ evolving with time, while ALF tracks the “augmented state” $( z , v )$ . We explain the details of ALF as below.
91
+
92
+ # Algorithm 2: Forward of $\psi$ in ALF
93
+
94
+ <table><tr><td>Input (zin, Uin, Sin,h) where Sin is current time, Zin and Uin are correponding values at time Sin,h is stepsize.</td></tr><tr><td>Forward S1 = Sin +h/2</td></tr><tr><td>k1 = Zin + Uin × h/2</td></tr><tr><td></td></tr><tr><td>u1 = f(k1,S1)</td></tr><tr><td>Uout = Uin + 2(u1 - Uin)</td></tr><tr><td>Zout = k1 + Uout × h/2</td></tr><tr><td>Sout = S1 +h/2 Output (Zout,Vout, Sout,h)</td></tr></table>
95
+
96
+ Algorithm 3: $\psi ^ { - 1 }$ (Inverse of $\psi$ ) in ALF
97
+
98
+ <table><tr><td colspan="2">Input (zout, Uout, Sout,h) where Sout is current time, Zout and vout are corresponding values at Sout,h is stepsize. Inverse S1 = Sout -h/2 k1 = Zout - Uout X h/2 u1 = f(k1,S1)</td></tr></table>
99
+
100
+ Procedure of ALF Different ODE solvers have different $\psi$ in Algo. 1, hence we only summarize $\psi$ for ALF in Algo. 2. Note that for a complete algorithm of integration for ALF, we need to plug Algo. 2 into Algo. 1. The forward-pass is summarized in Algo. 2. Given stepsize $h$ , with input $( z _ { i n } , v _ { i n } , s _ { i n } )$ , a single step of ALF outputs $( z _ { o u t } , v _ { o u t } , s _ { o u t } )$ .
101
+
102
+ ![](images/da4dde8b53890c9e783c1ad01b8224fb995c8dfef6b9f8608c5ca38f19fdbd37.jpg)
103
+ $( z _ { j } , v _ { j } , t _ { j } )$ With ALF method, given and discretized time points $\{ t _ { i } \} _ { i = 1 } ^ { N _ { t } }$ rately due to the reversibility of ALF.
104
+
105
+ As in Fig. 3, given $( z _ { 0 } , v _ { 0 } , t _ { 0 } )$ , the numerical forwardtime integration calls Algo. 2 iteratively:
106
+
107
+ $$
108
+ \begin{array} { r } { ( z _ { i } , v _ { i } , t _ { i } , h _ { i } ) = \psi ( z _ { i - 1 } , v _ { i - 1 } , t _ { i - 1 } , h _ { i } ) } \\ { s . t . \ h _ { i } = t _ { i } - t _ { i - 1 } , \ i = 1 , 2 , . . . N _ { t } } \end{array}
109
+ $$
110
+
111
+ Invertibility of ALF An interesting property of ALF is that $\psi$ defines a bijective mapping; therefore, we can reconstruct $( z _ { i n } , v _ { i n } , s _ { i n } , h )$ from $( z _ { o u t } , v _ { o u t } , s _ { o u t } , h )$ , as demonstrated in Algo. 7. As in Fig. 3, we can reconstruct the entire trajectory given the state $( z _ { j } , v _ { j } )$ at time $t _ { j }$ , and the discretized time points $\left\{ { t } _ { 0 } , . . . t _ { N _ { t } } \right\}$ . For example, given $\left( z _ { N _ { t } } , v _ { N _ { t } } \right)$ and $\{ t _ { i } \} _ { i = 0 } ^ { N _ { t } }$ , the trajectory for Eq. 4 is reconstructed:
112
+
113
+ $$
114
+ ( z _ { i - 1 } , v _ { i - 1 } , t _ { i - 1 } , h _ { i } ) = \psi ^ { - 1 } ( z _ { i } , v _ { i } , t _ { i } , h _ { i } ) { \ s . t . \ h } _ { i } = t _ { i } - t _ { i - 1 } , { \ i = N _ { t } , N _ { t } - 1 , . . . , 1 }
115
+ $$
116
+
117
+ In the following sections, we will show the invertibility of ALF is the key to maintain accuracy at a constant memory cost to train Neural ODEs. Note that “inverse” refers to reconstructing the input from the output without computing the gradient, hence is different from “back-propagation”.
118
+
119
+ Initial value For an initial value problem (IVP) such as Eq. 1, typically $z _ { 0 } = z ( t _ { 0 } )$ is given while $v _ { 0 }$ is undetermined. We can construct $v _ { 0 } = f ( z ( t _ { 0 } ) , t _ { 0 } )$ , so the initial augmented state is $( z _ { 0 } , v _ { 0 } )$ .
120
+
121
+ Difference from midpoint integrator The midpoint integrator (Suli & Mayers, 2003) is similar ¨ to Algo. 2, except that it recomputes $v _ { i n } = f ( z _ { i n } , s _ { i n } )$ for every step, while ALF directly uses the input $v _ { i n }$ . Therefore, the midpoint method does not have an explicit form of inverse.
122
+
123
+ Local truncation error Theorem 3.1 indicates that the local truncation error of ALF is of order $O ( h ^ { 3 } )$ ; this implies the global error is $O ( h ^ { 2 } )$ . Detailed proof is in Appendix A.3.
124
+
125
+ Theorem 3.1. For a single step in ALF with stepsize $h$ , the local truncation error of $z$ is $O ( h ^ { 3 } )$ , and the local truncation error of v is $O ( h ^ { 2 } )$ .
126
+
127
+ A-Stability The ALF solver has a limited stability region, but this can be solved with damping. The damped ALF replaces the update of $v _ { o u t }$ in Algo. 2 with $v _ { o u t } = v _ { i n } + 2 \eta ( u _ { 1 } - v _ { i n } )$ , where $\eta$ is the “damping coefficient” between 0 and 1. We have the following theorem on its numerical stability.
128
+
129
+ Theorem 3.2. For the damped ALF integrator with stepsize $h$ , where $\sigma _ { i }$ is the $i$ -th eigenvalue of the Jacobian $\frac { \partial f } { \partial z }$ , then the solver is $A$ -stable $\left. \dot { \tau } f \right| 1 + \eta ( h \sigma _ { i } - 1 ) \pm \sqrt { \eta \big [ 2 h \sigma _ { i } + \eta ( h \sigma _ { i } - 1 ) ^ { 2 } \big ] } \Big | < 1$ , ∀i
130
+
131
+ Proof is in Appendix A.4 and A.5. Theorem 3.2 implies the following: when $\eta = 1$ , the damped ALF reduces to ALF, and the stability region is empty; when $0 < \eta < 1$ , the stability region is nonempty. However, stability describes the behaviour when $T$ goes to infinity; in practice we always use a bounded $T$ and ALF performs well. Inverse of damped ALF is in Appendix A.5.
132
+
133
+ # 3.2 MEMORY-EFFICIENT ALF INTEGRATOR (MALI) FOR GRADIENT ESTIMATION
134
+
135
+ An ideal solver for Neural ODEs should achieve two goals: accuracy in gradient estimation and constant memory cost w.r.t integration time. Yet none of the existing methods can achieve both goals. We propose a method based on the ALF solver, which to our knowledge is the first method to achieve the two goals simultaneously.
136
+
137
+ <table><tr><td>Algorithm 4: MALI to acheive accuracy at a constant memory cost w.r.t integration time</td></tr><tr><td>Input Initial state zo, start time to, end time T</td></tr><tr><td>Forward Apply the numerical integration in Algo.1, with the function defined by Algo. 2.</td></tr><tr><td>Delete computation graph on the fly, only keep end-time state (zNt, UNt)</td></tr><tr><td></td></tr><tr><td>Keep accepted discretized time points {ti}N=0 (ignore processto search for optimal stepsize) Backward</td></tr><tr><td>8L by Eq.3,initialize dL =0</td></tr><tr><td>Initialize a(T) = (T) d</td></tr><tr><td>For i in {Nt,Nt -1,..,2,1}:</td></tr><tr><td>Reconstruct (zi-1, Ui-1) from (zi,Ui) by Algo.7 Local forward (zi,Ui,ti,hi)= γ(zi-1,Ui-1,ti-1,hi)</td></tr><tr><td>Local backward, get Of(zi-1,ti-1,0) and f(2i-1ti-1,0)</td></tr><tr><td>dzi-1 80 dL</td></tr><tr><td>Update a(t) and byEq.2 and Eq. 3 discretized at time points ti-1 and ti de</td></tr><tr><td>Delete local computation graph</td></tr><tr><td>Output the adjoint state a(to) (gradient w.r.t input zo) and parameter gradient</td></tr></table>
138
+
139
+ Procedure of MALI Details of MALI are summarized in Algo. 4. For the forward-pass, we only keep the end-time state $\left( z _ { N _ { t } } , v _ { N _ { t } } \right)$ and the accepted discretized time points (blue curves in Fig. 1 and 2). We ignore the search process for optimal stepsize (green curve in Fig. 1 and 2), and delete other variables to save memory. During the backward pass, we can reconstruct the forward-time trajectory as in Eq. 5, then calculate the gradient by numerical discretization of Eq. 2 and Eq. 3.
140
+
141
+ Constant memory cost w.r.t number of solver steps in integration We delete the computation graph and only keep the end-time state to save memory. The memory cost is $N _ { z } ( N _ { f } + 1 )$ , where
142
+
143
+ ![](images/72f602b837ed8e185f46ef9611847d89781d838c60ee6b4f4fd38f08381e9dc4.jpg)
144
+ Figure 4: Comparison of error in gradient in Eq. 6. (a) error in $\scriptstyle { \frac { \mathrm { d } L } { \mathrm { d } z _ { 0 } } }$ . (b) error in $\textstyle { \frac { \mathrm { d } L } { \mathrm { d } \alpha } }$ . (c) memory cost.
145
+
146
+ ![](images/a5790d97491493f8fedf10284fe335bda1b1750debbcc4560d4977556c8c12ca.jpg)
147
+ Figure 5: Results on Cifar10. From left to right: (1) box plot of test accuracy (first 4 columns are Neural ODEs, last is ResNet); (2) test accuracy $\pm s t d$ v.s. training epoch for Neural ODE; (3) test accuracy $\pm s t d$ v.s. training time of 90 epochs for Neural ODE.
148
+
149
+ $N _ { z } N _ { f }$ is due to evaluating $f ( \boldsymbol { z } , t )$ and is irreducible for all methods. Compared with the adjoint method, MALI only requires extra $N _ { z }$ memory to record $v _ { N _ { t } }$ , and also has a constant memory cost $w . r . t$ time step $N _ { t }$ . The memory cost is $N _ { z } ( N _ { f } + 1 )$ .
150
+
151
+ Accuracy Our method guarantees the accuracy of reverse-time trajectory (e.g. blue curve in Fig. 2 matches the blue curve in Fig. 1), because ALF is explicitly invertible for free-form $f$ (see Algo. 7). Therefore, the gradient estimation in MALI is more accurate compared to the adjoint method.
152
+
153
+ Computation cost Recall that on average it takes $m$ steps to find an acceptable stepsize, whose error estimate is below tolerance. Therefore, the forward-pass with search process has computation burden $N _ { z } \times N _ { f } \times N _ { t } \times m$ . Note that we only reconstruct and backprop through the accepted step and ignore the search process, hence it takes another $N _ { z } \times N _ { f } \times N _ { t } \times 2$ computation. The overall computation burden is $N _ { z } N _ { f } \times N _ { t } \times ( m + 2 )$ as in Table 1.
154
+
155
+ Shallow computation graph Similar to ACA, MALI only backpropagates through the accepted step (blue curve in Fig. 2) and ignores the search process (green curve in Fig. 2), hence the depth of computation graph is $N _ { f } \times N _ { t }$ . The computation graph of MALI is much shallower than the naive method, hence is more robust to vanishing and exploding gradients (Pascanu et al., 2013).
156
+
157
+ Summary The adjoint method suffers from inaccuracy in reverse-time trajectory, the naive method suffers from exploding or vanishing gradient caused by deep computation graph, and ACA finds a balance but the memory grows linearly with integration time. MALI achieves accuracy in reversetime trajectory, constant memory $w . r . t$ integration time, and a shallow computation graph.
158
+
159
+ # 4 EXPERIMENTS
160
+
161
+ # 4.1 VALIDATION ON A TOY EXAMPLE
162
+
163
+ We compare the performance of different methods on a toy example, defined as
164
+
165
+ $$
166
+ L ( z ( T ) ) = z ( T ) ^ { 2 } \ s . t . \ z ( 0 ) = z _ { 0 } , \ \mathrm { d } z ( t ) / \mathrm { d } t = \alpha z ( t )
167
+ $$
168
+
169
+ The analytical solution is
170
+
171
+ $$
172
+ z ( t ) = z _ { 0 } e ^ { \alpha t } , L = z _ { 0 } ^ { 2 } e ^ { 2 \alpha T } , \mathrm { d } L / \mathrm { d } z _ { 0 } = 2 z _ { 0 } e ^ { 2 \alpha T } , \mathrm { d } L / d \alpha = 2 T z _ { 0 } ^ { 2 } e ^ { 2 \alpha T }
173
+ $$
174
+
175
+ We plot the amplitude of error between numerical solution and analytical solution varying with $T$ (integrated under the same error tolerance, $\mathrm { r t o l } = 1 0 ^ { - 5 } , \mathrm { a t o l } = 1 0 ^ { - 6 } )$ in Fig 4. ACA and MALI have similar errors, both outperforming other methods. We also plot the memory consumption for different methods on a Neural ODE with the same input in Fig. 4. As the error tolerance decreases, the solver evaluates more steps, hence the naive method and ACA increase memory consumption, while MALI and the adjoint method have a constant memory cost. These results validate our analysis in Sec. 3.2 and Table 1, and shows MALI achieves accuracy at a constant memory cost.
176
+
177
+ Table 2: Top-1 test accuracy of Neural ODE and ResNet on ImageNet. Neural ODE is trained with MALI, and ResNet is trained as the original model; Neural ODE is tested using different solvers without retraining.
178
+
179
+ <table><tr><td rowspan="2"></td><td colspan="6">Fixed-stepsize solvers of various stepsizes</td><td colspan="4">Adaptive-stepsize solver of various tolerances</td></tr><tr><td>Stepsize</td><td>1</td><td>0.5</td><td>0.25</td><td>0.15</td><td>0.1</td><td>Tolerance</td><td>1.00E+00</td><td>1.00E-01</td><td>1.00E-02</td></tr><tr><td rowspan="4">Neural ODE</td><td>MALI</td><td>42.33</td><td>66.4</td><td>69.59</td><td>70.17</td><td>69.94</td><td>MALI</td><td>62.56</td><td>69.89</td><td>69.87</td></tr><tr><td>Euler</td><td>21.94</td><td>61.25</td><td>67.38</td><td>68.69</td><td>70.02</td><td>Heun-Euler</td><td>68.48</td><td>69.87</td><td>69.88</td></tr><tr><td>RK2</td><td>42.33</td><td>69</td><td>69.72</td><td>70.14</td><td>69.92</td><td>RK23</td><td>50.77</td><td>69.89</td><td>69.93</td></tr><tr><td>RK4</td><td>12.6</td><td>69.99</td><td>69.91</td><td>70.21</td><td>69.96 70.09</td><td>Dopri5</td><td>52.3</td><td>68.58</td><td>69.71</td></tr><tr><td>ResNet</td><td colspan="14"></td></tr></table>
180
+
181
+ Table 3: Top-1 accuracy under FGSM attack. $\epsilon$ is the perturbation amplitude. For Neural ODE models, row names represent the solvers to derive the gradient for attack, and column names represent solvers for inference on the perturbed image.
182
+
183
+ <table><tr><td rowspan="2" colspan="2"></td><td colspan="4">∈=1/255</td><td colspan="4">∈=2/255</td></tr><tr><td>MALI</td><td>Heun-Euler</td><td>RK23</td><td>Dopri5</td><td>MALI</td><td>Heun-Euler</td><td>RK23</td><td>Dopri5</td></tr><tr><td rowspan="4">Neural ODE</td><td>MALI</td><td>14.69</td><td>14.72</td><td>14.77</td><td>15.71</td><td>10.38</td><td>10.46</td><td>10.62</td><td>10.62</td></tr><tr><td>Heun-Euler</td><td>14.77</td><td>14.75</td><td>14.80</td><td>15.74</td><td>10.63</td><td>10.47</td><td>10.44</td><td>10.49</td></tr><tr><td>RK23</td><td>14.82</td><td>14.77</td><td>14.79</td><td>15.69</td><td>10.78</td><td>10.53</td><td>10.48</td><td>10.56</td></tr><tr><td>Dopri5</td><td>14.82</td><td>14.78</td><td>14.79</td><td>15.15</td><td>10.76</td><td>10.49</td><td>10.48</td><td>10.51</td></tr><tr><td colspan="2">ResNet</td><td colspan="4">13.02</td><td colspan="4">9.57</td></tr></table>
184
+
185
+ # 4.2 IMAGE RECOGNITION WITH NEURAL ODE
186
+
187
+ We validate MALI on image recognition tasks using Cifar10 and ImageNet datasets. Similar to Zhuang et al. (2020), we modify a ResNet18 into its corresponding Neural ODE: the forward function is $y = x + f _ { \theta } ( x )$ and $\begin{array} { r } { y = \overset { \cdot } { x } + \int _ { 0 } ^ { T } f _ { \theta } ( z ) \mathrm { d } t } \end{array}$ for the residual block and Neural ODE respectively, where the same $f _ { \theta }$ is shared. We compare MALI with the naive method, adjoint method and ACA.
188
+
189
+ Results on Cifar10 Results of 5 independent runs on Cifar10 are summarized in Fig. 5. MALI achieves comparable accuracy to ACA, and both significantly outperform the naive and the adjoint method. Furthermore, the training speed of MALI is similar to ACA, and both are almost two times faster than the adjoint memthod, and three times faster than the naive method. This validates our analysis on accuracy and computation burden in Table 1.
190
+
191
+ Accuracy on ImageNet Due to the heavy memory burden caused by large images, the naive method and ACA are unable to train a Neural ODE on ImageNet with 4 GPUs; only MALI and the adjoint method are feasible due to the constant memory. We also compare the Neural ODE to a standard ResNet. As shown in Fig. 6, the accuracy of the Neural ODE trained with MALI closely follows ResNet, and significantly outperforms the adjoint method (top-1 validation: $70 \%$ v.s. $63 \%$ ).
192
+
193
+ ![](images/5baeedcaa97100e0df410b2d664c7ea69138b65803c881e78de14fc713349129.jpg)
194
+ Figure 6: Top-1 accuracy on ImageNet validation dataset.
195
+
196
+ Invariance to discretization scheme A continuous model should be invariant to discretization schemes (e.g. different types of ODE solvers) as long as the discretization is sufficiently accurate. We test the Neural ODE using different solvers without re-training; since ResNet is often viewed as a one-step Euler discretization of an ODE (Haber & Ruthotto, 2017), we perform similar experiments. As shown in Table 2, Neural ODE consistently achieves high accuracy $( \sim 7 0 \% )$ , while ResNet drops to random guessing $( \sim 0 . 1 \% )$ because ResNet as a one-step Euler discretization fails to be a meaningful dynamical system (Queiruga et al., 2020).
197
+
198
+ Robustness to adversarial attack Hanshu et al. (2019) demonstrated that Neural ODE is more robust to adversarial attack than ResNet on small-scale datasets such as Cifar10. We validate this result on the large-scale ImageNet dataset. The top-1 accuracy of Neural ODE and ResNet under FGSM attack (Goodfellow et al., 2014) are summarized in Table 3. For Neural ODE, due to its invariance to discretization scheme, we derive the gradient for attack using a certain solver (row in
199
+
200
+ Table 4: Test MSE $( \times 0 . 0 1 )$ on Mujoco dataset (lower is better). Results marked with superscript numbers correspond to literature in the footnote.
201
+
202
+ <table><tr><td rowspan="2">Percentage of training data</td><td rowspan="2">RNN1</td><td rowspan="2">RNN-GRU1</td><td colspan="4">Latent-ODE</td></tr><tr><td>Adjoint1</td><td>Naive2</td><td>ACA²</td><td>MALI</td></tr><tr><td>10%</td><td>2.451</td><td>1.972</td><td>0.471</td><td>0.362</td><td>0.312</td><td>0.35</td></tr><tr><td>20%</td><td>1.711</td><td>1.421</td><td>0.441</td><td>0.30²</td><td>0.272</td><td>0.27</td></tr><tr><td>50%</td><td>0.791</td><td>0.751</td><td>0.401</td><td>0.292</td><td>0.262</td><td>0.26</td></tr></table>
203
+
204
+ Table 5: Test ACC on Speech Command Dataset
205
+
206
+ <table><tr><td>Method</td><td>Accuracy (%)</td></tr><tr><td>Adjoint3</td><td>92.8± 0.4</td></tr><tr><td>SemiNorm3</td><td>92.9 ±0.4</td></tr><tr><td>Naive ACA</td><td>93.2±0.2</td></tr><tr><td>MALI</td><td>93.2±0.2</td></tr><tr><td></td><td>93.7 ±0.3</td></tr></table>
207
+
208
+ Table 3), and inference on the perturbed images using various solvers. For different combinations of solvers and perturbation amplitudes, Neural ODE consistently outperforms ResNet.
209
+
210
+ Summary In image recognition tasks, we demonstrate Neural ODE is accurate, invariant to discretization scheme, and more robust to adversarial attack than ResNet. Note that detailed explanation on the robustness of Neural ODE is out of the scope for this paper, but to our knowledge, MALI is the first method to enable training of Neural ODE on large datasets due to constant memory cost.
211
+
212
+ # 4.3 TIME-SERIES MODELING
213
+
214
+ We apply MALI to latent-ODE (Rubanova et al., 2019) and Neural Controlled Differential Equation (Neural CDE) (Kidger et al., 2020a;b). Our experiment is based on the official implementation from the literature. We report the mean squared error (MSE) on the Mujoco test set in Table 4, which is generated from the “Hopper” model using DeepMind control suite (Tassa et al., 2018); for all experiments with different ratios of training data, MALI achieves similar MSE to ACA, and both outperform the adjoint and naive method. We report the test accuracy on the Speech Command dataset for Neural CDE in Table 5; MALI achieves a higher accuracy than competing methods.
215
+
216
+ # 4.4 CONTINUOUS GENERATIVE MODELS
217
+
218
+ We apply MALI on FFJORD (Grathwohl et al., 2018), a free-from continuous generative model, and compare with several variants in the literature (Finlay et al., 2020; Kidger et al., 2020a). Our experiment is based on the official implementaion of Finlay et al. (2020); for a fair comparison, we train with MALI, and test with the same solver as in the literature (Grathwohl et al., 2018; Finlay et al., 2020), the Dopri5 solver with $\mathrm { r t o l } = \mathrm { a t o l } = 1 0 ^ { - 5 }$ from the torchdiffeq package (Chen et al., 2018). Bits per dim (BPD, lower is better) on validation set for various datasets are reported in Table 6. For continuous models, MALI consistently generates the lowest BPD, and outperforms the Vanilla FFJORD (trained with adjoint), RNODE (regularized FFJORD) and the SemiNorm Adjoint (Kidger et al., 2020a). Furthermore, FFJORD trained with MALI achieves comparable BPD to stateof-the-art discrete-layer flow models in the literature. Please see Sec. B.3 for generated samples.
219
+
220
+ # 5 RELATED WORKS
221
+
222
+ Besides ALF, the symplectic integrator (Verlet, 1967; Yoshida, 1990) is also able to reconstruct trajectory accurately, yet it’s typically restricted to second order Hamiltonian systems (De Almeida, 1990), and are unsuitable for general ODEs. Besides aforementioned methods, there are other methods for gradient estimation such as interpolated adjoint (Daulbaev et al., 2020) and spectral method (Quaglino et al., 2019), yet the implementations are involved and not publicly available. Other works focus on the theoretical properties of Neural ODEs (Dupont et al., 2019; Tabuada & Gharesifard, 2020; Massaroli et al., 2020). Neural ODE is recently applied to stochastic differential equation (Li et al., 2020), jump differential equation (Jia & Benson, 2019) and auto-regressive models (Wehenkel & Louppe, 2019).
223
+
224
+ # 6 CONCLUSION
225
+
226
+ Based on the asynchronous leapfrog integrator, we propose MALI to estimate the gradient for Neural ODEs. To our knowledge, our method is the first to achieve accuracy, fast speed and a constant memory cost. We provide comprehensive theoretical analysis on its properties. We validate MALI
227
+
228
+ Table 6: Bits per dim (BPD) of generative models, lower is better. Results marked with superscript numbers correspond to literature in the footnote.
229
+
230
+ <table><tr><td rowspan="2">Dataset</td><td colspan="4">Continuous Flow (FFJORD)</td><td colspan="5">Discrete Flow</td></tr><tr><td>Vanilla4</td><td>RNODE5</td><td>SemiNorm3</td><td>MALI</td><td>RealNVP6</td><td>i-ResNet</td><td>Glow8</td><td>Flow++9</td><td>Residual Flow10</td></tr><tr><td>MNIST</td><td>0.994</td><td>0.975</td><td>0.963</td><td>0.87</td><td>1.066</td><td>1.057</td><td>1.058</td><td>-</td><td>0.9710</td></tr><tr><td>CIFAR10</td><td>3.404</td><td>3.385</td><td>3.353</td><td>3.27</td><td>3.496</td><td>3.457</td><td>3.358</td><td>3.289</td><td>3.2810</td></tr><tr><td>ImageNet64</td><td>-</td><td>3.835</td><td>-</td><td>3.71</td><td>3.986</td><td>-</td><td>3.818</td><td>=</td><td>3.7610</td></tr></table>
231
+
232
+ with extensive experiments, and achieved new state-of-the-art results in various tasks, including image recognition, continuous generative modeling, and time-series modeling.
233
+
234
+ # 7 ACKNOWLEDGEMENT
235
+
236
+ This research was funded by the National Institutes of Health (NINDS-R01NS035193)
237
+
238
+ # REFERENCES
239
+
240
+ Jens Behrmann, Will Grathwohl, Ricky TQ Chen, David Duvenaud, and Jorn-Henrik Jacobsen. ¨ Invertible residual networks. In International Conference on Machine Learning, pp. 573–582, 2019.
241
+
242
+ Ricky TQ Chen, Yulia Rubanova, Jesse Bettencourt, and David K Duvenaud. Neural ordinary differential equations. In Advances in Neural Information Processing Systems, pp. 6571–6583, 2018.
243
+
244
+ Ricky TQ Chen, Jens Behrmann, David K Duvenaud, and Jorn-Henrik Jacobsen. Residual flows ¨ for invertible generative modeling. In Advances in Neural Information Processing Systems, pp. 9916–9926, 2019.
245
+
246
+ Talgat Daulbaev, Alexandr Katrutsa, Larisa Markeeva, Julia Gusak, Andrzej Cichocki, and Ivan Oseledets. Interpolated adjoint method for neural odes. arXiv preprint arXiv:2003.05271, 2020.
247
+
248
+ Alfredo M Ozorio De Almeida. Hamiltonian systems: chaos and quantization. Cambridge University Press, 1990.
249
+
250
+ Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real nvp. arXiv preprint arXiv:1605.08803, 2016.
251
+
252
+ Emilien Dupont, Arnaud Doucet, and Yee Whye Teh. Augmented neural odes. In Advances in Neural Information Processing Systems, pp. 3140–3150, 2019.
253
+
254
+ Chris Finlay, Jorn-Henrik Jacobsen, Levon Nurbekyan, and Adam M Oberman. How to train your ¨ neural ode: the world of jacobian and kinetic regularization. In International Conference on Machine Learning, 2020.
255
+
256
+ Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
257
+
258
+ Will Grathwohl, Ricky TQ Chen, Jesse Bettencourt, Ilya Sutskever, and David Duvenaud. Ffjord: Free-form continuous dynamics for scalable reversible generative models. arXiv preprint arXiv:1810.01367, 2018.
259
+
260
+ Eldad Haber and Lars Ruthotto. Stable architectures for deep neural networks. Inverse Problems, 34(1):014004, 2017.
261
+
262
+ YAN Hanshu, DU Jiawei, TAN Vincent, and FENG Jiashi. On robustness of neural ordinary differential equations. In International Conference on Learning Representations, 2019.
263
+
264
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016.
265
+
266
+ Jonathan Ho, Xi Chen, Aravind Srinivas, Yan Duan, and Pieter Abbeel. Flow $^ { + + }$ : Improving flowbased generative models with variational dequantization and architecture design. arXiv preprint arXiv:1902.00275, 2019.
267
+
268
+ Junteng Jia and Austin R Benson. Neural jump stochastic differential equations. In Advances in Neural Information Processing Systems, pp. 9847–9858, 2019.
269
+
270
+ Patrick Kidger, Ricky T. Q. Chen, and Terry Lyons. “Hey, that’s not an ODE”: Faster ODE Adjoints with 12 Lines of Code. arXiv:2009.09457, 2020a.
271
+
272
+ Patrick Kidger, James Morrill, James Foster, and Terry Lyons. Neural controlled differential equations for irregular time series. arXiv preprint arXiv:2005.08926, 2020b.
273
+
274
+ Durk P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In Advances in Neural Information Processing Systems, pp. 10215–10224, 2018.
275
+
276
+ Xuechen Li, Ting-Kam Leonard Wong, Ricky TQ Chen, and David Duvenaud. Scalable gradients for stochastic differential equations. arXiv preprint arXiv:2001.01328, 2020.
277
+
278
+ Kuang Liu. Train cifar10 with pytorch. 2017. URL https://github.com/kuangliu/ pytorch-cifar.
279
+
280
+ Yiping Lu, Aoxiao Zhong, Quanzheng Li, and Bin Dong. Beyond finite layer neural networks: Bridging deep architectures and numerical differential equations. In International Conference on Machine Learning, pp. 3276–3285. PMLR, 2018.
281
+
282
+ Stefano Massaroli, Michael Poli, Jinkyoo Park, Atsushi Yamashita, and Hajime Asama. Dissecting neural odes. arXiv preprint arXiv:2002.08071, 2020.
283
+
284
+ Ulrich Mutze. An asynchronous leapfrog method ii. arXiv preprint arXiv:1311.6602, 2013.
285
+
286
+ Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio. On the difficulty of training recurrent neural networks. In International conference on machine learning, pp. 1310–1318, 2013.
287
+
288
+ Lev Semenovich Pontryagin. Mathematical theory of optimal processes. Routledge, 1962.
289
+
290
+ Alessio Quaglino, Marco Gallieri, Jonathan Masci, and Jan Koutn´ık. Snode: Spectral discretization of neural odes for system identification. arXiv preprint arXiv:1906.07038, 2019.
291
+
292
+ Alejandro F Queiruga, N Benjamin Erichson, Dane Taylor, and Michael W Mahoney. Continuousin-depth neural networks. arXiv preprint arXiv:2008.02389, 2020.
293
+
294
+ Yulia Rubanova, Ricky TQ Chen, and David K Duvenaud. Latent ordinary differential equations for irregularly-sampled time series. In Advances in Neural Information Processing Systems, pp. 5320–5330, 2019.
295
+
296
+ Carl Runge. Uber die numerische aufl ¨ osung von differentialgleichungen. ¨ Mathematische Annalen, 46(2):167–178, 1895.
297
+
298
+ Lars Ruthotto and Eldad Haber. Deep neural networks motivated by partial differential equations. Journal of Mathematical Imaging and Vision, pp. 1–13, 2019.
299
+
300
+ Lars Ruthotto, Stanley J Osher, Wuchen Li, Levon Nurbekyan, and Samy Wu Fung. A machine learning framework for solving high-dimensional mean field game and mean field control problems. Proceedings of the National Academy of Sciences, 117(17):9183–9193, 2020.
301
+
302
+ Alvaro Sanchez-Gonzalez, Victor Bapst, Kyle Cranmer, and Peter Battaglia. Hamiltonian graph networks with ode integrators. arXiv preprint arXiv:1909.12790, 2019.
303
+
304
+ John R Silvester. Determinants of block matrices. The Mathematical Gazette, 84(501):460–467, 2000.
305
+
306
+ Endre Suli and David F Mayers. ¨ An introduction to numerical analysis. Cambridge university press, 2003.
307
+
308
+ Paulo Tabuada and Bahman Gharesifard. Universal approximation power of deep neural networks via nonlinear control theory. arXiv preprint arXiv:2007.06007, 2020.
309
+
310
+ Yuval Tassa, Yotam Doron, Alistair Muldal, Tom Erez, Yazhe Li, Diego de Las Casas, David Budden, Abbas Abdolmaleki, Josh Merel, Andrew Lefrancq, et al. Deepmind control suite. arXiv preprint arXiv:1801.00690, 2018.
311
+
312
+ Loup Verlet. Computer” experiments” on classical fluids. i. Thermodynamical properties of Lennard-Jones molecules. Physical review, 159(1):98, 1967.
313
+
314
+ Gerhard Wanner and Ernst Hairer. Solving ordinary differential equations II. Springer Berlin Heidelberg, 1996.
315
+
316
+ Antoine Wehenkel and Gilles Louppe. Unconstrained monotonic neural networks. In Advances in Neural Information Processing Systems, pp. 1545–1555, 2019.
317
+
318
+ E Weinan. A proposal on machine learning via dynamical systems. Communications in Mathematics and Statistics, 5(1):1–11, 2017.
319
+
320
+ Haruo Yoshida. Construction of higher order symplectic integrators. Physics letters A, 150(5-7): 262–268, 1990.
321
+
322
+ Yaofeng Desmond Zhong, Biswadip Dey, and Amit Chakraborty. Symplectic ode-net: Learning hamiltonian dynamics with control. arXiv preprint arXiv:1909.12077, 2019.
323
+
324
+ Juntang Zhuang, Nicha Dvornek, Xiaoxiao Li, Sekhar Tatikonda, Xenophon Papademetris, and James Duncan. Adaptive checkpoint adjoint method for gradient estimation in neural ode. International Conference on Machine Learning, 2020.
325
+
326
+ # CONTENTS (APPENDIX)
327
+
328
+ # A Theoretical properties of ALF integrator 13
329
+
330
+ A.1 Algorithm of ALF . 13
331
+ A.2 Preliminaries 13
332
+ A.3 Local truncation error of ALF 13
333
+ A.4 Stability analysis 15
334
+ A.5 Damped ALF 16
335
+
336
+ # B Experimental Details
337
+
338
+ # 1
339
+
340
+ B.1 Image Recognition 18
341
+
342
+ B.1.1 Experiment on Cifar10 18
343
+ B.1.2 Experiments on ImageNet 18
344
+ B.2 Time series modeling 19
345
+ B.3 Continuous generative models 20
346
+ B.3.1 Training details . 20
347
+ B.3.2 Addtional results 20
348
+ B.4 Error in gradient estimation for toy examples when $t < 1$ 20
349
+ B.5 Results of damped MALI 20
350
+
351
+ # A THEORETICAL PROPERTIES OF ALF INTEGRATOR
352
+
353
+ # A.1 ALGORITHM OF ALF
354
+
355
+ For the ease of reading, we write the algorithm for $\psi$ in ALF below, which is the same as Algo. 2 in the main paper, but uses slightly different notations for the ease of analysis.
356
+
357
+ # Algorithm 1: Forward of $\psi$ in ALF
358
+
359
+ Input $( \widehat { z _ { i n } } , \widehat { v _ { i n } } , s _ { i n } , h ) = ( \widehat { z _ { 0 } } , \widehat { v _ { 0 } } , s _ { 0 } , h )$ where $s _ { 0 }$ is current time, $\widehat { z } _ { 0 }$ and $\widehat { v _ { 0 } }$ are correponding c cvalues at time $s _ { 0 }$ ; stepsize $h$ .
360
+
361
+ Forward
362
+
363
+ $$
364
+ \begin{array} { r l } & { s _ { 1 } = s _ { 0 } + h / 2 } \\ & { \widehat { z } _ { 1 } = \widehat { z } _ { 0 } + \widehat { v } _ { 0 } \times h / 2 } \\ & { \widehat { v } _ { 1 } = f \big ( \widehat { z } _ { 1 } , s _ { 1 } \big ) } \\ & { \widehat { v } _ { 2 } = \widehat { v } _ { 1 } + \big ( \widehat { v } _ { 1 } - \widehat { v } _ { 0 } \big ) } \\ & { \widehat { z } _ { 2 } = \widehat { z } _ { 1 } + \widehat { v } _ { 2 } \times h / 2 } \\ & { s _ { 2 } = s _ { 1 } + h / 2 } \end{array}
365
+ $$
366
+
367
+ # Output
368
+
369
+ $$
370
+ ( \widehat { z _ { o u t } } , \widehat { v _ { o u t } } , s _ { o u t } , h ) = ( \widehat { z _ { 2 } } , \widehat { v _ { 2 } } , s _ { 2 } , h )
371
+ $$
372
+
373
+ For simplicity, we can re-write the forward of ALF as
374
+
375
+ $$
376
+ \begin{array} { r } { [ \widehat { z _ { 2 } } ] = [ { \widehat { z _ { 0 } } } + h f ( \widehat { z _ { 0 } } + \frac { h } { 2 } \widehat { v _ { 0 } } , s _ { 0 } + \frac { h } { 2 } ) ] } \\ { \widehat { v _ { 2 } } ] = [ 2 f ( \widehat { z _ { 0 } } + \frac { h } { 2 } \widehat { v _ { 0 } } , s _ { 0 } + \frac { h } { 2 } ) - \widehat { v _ { 0 } } ] } \end{array}
377
+ $$
378
+
379
+ Similarly, the inverse of ALF can be written as
380
+
381
+ $$
382
+ \begin{array} { r } { \left[ \widehat { z _ { 0 } } \right] = \left[ { \widehat { z _ { 2 } } } - h f ( \widehat { z _ { 2 } } - \frac { h } { 2 } \widehat { v _ { 2 } } , s _ { 2 } - \frac { h } { 2 } ) \right] } \\ { 2 f ( \widehat { z _ { 2 } } - \frac { h } { 2 } \widehat { v _ { 2 } } , s _ { 2 } - \frac { h } { 2 } ) - \widehat { v _ { 2 } } } \end{array}
383
+ $$
384
+
385
+ # A.2 PRELIMINARIES
386
+
387
+ For an ODE of the form
388
+
389
+ $$
390
+ \frac { \mathrm { d } \boldsymbol { z } ( t ) } { \mathrm { d } t } = \boldsymbol { f } ( \boldsymbol { z } ( t ) , t )
391
+ $$
392
+
393
+ We have:
394
+
395
+ $$
396
+ { \frac { \mathrm { d } ^ { 2 } z ( t ) } { d t ^ { 2 } } } = { \frac { \mathrm { d } } { \mathrm { d } t } } f ( z ( t ) , t ) = { \frac { \partial f ( z ( t ) , t ) } { \partial t } } + { \frac { \partial f ( z ( t ) , t ) } { \partial z } } { \frac { \mathrm { d } z ( t ) } { \mathrm { d } t } }
397
+ $$
398
+
399
+ For the ease of notation, we re-write Eq. 10 as
400
+
401
+ $$
402
+ { \frac { \mathrm { d } ^ { 2 } z ( t ) } { d t ^ { 2 } } } = f _ { t } + f _ { z } f
403
+ $$
404
+
405
+ where $f _ { t }$ and $f _ { z }$ represents the partial derivative of $f w . r . t \ t$ and $z$ respectively.
406
+
407
+ # A.3 LOCAL TRUNCATION ERROR OF ALF
408
+
409
+ Theorem A.1 (Theorem 3.1 in the main paper). For a single step in ALF with stepsize $h$ , the local truncation error of $z$ is $O ( h ^ { 3 } )$ , and the local truncation errof of $v$ is $O ( h ^ { 2 } )$ .
410
+
411
+ Proof. Under the same notation as Algo. 1, denote the ground-truth state of $z$ and $v$ starting from $\left( \widehat { z _ { 0 } } , s _ { 0 } \right)$ as $\widetilde { z }$ and $\widetilde { v }$ respectively. Then the local truncation error is
412
+
413
+ $$
414
+ L _ { z } = \widetilde { z } ( s _ { 0 } + h ) - \widehat { z } _ { 2 } , L _ { v } = \widetilde { v } ( s _ { 0 } + h ) - \widehat { v _ { 2 } }
415
+ $$
416
+
417
+ We estimate $L _ { z }$ and $L _ { v }$ in terms of polynomial of $h$ .
418
+
419
+ Under mild assumptions that $f$ is smooth up to 2nd order almost everywhere (this is typically satisfied with neural networks with bounded weights), hence Taylor expansion is meaningful for $f$ . By Eq. 11, the Taylor expansion of $\widetilde { z }$ around point $\left( \widehat { z _ { 0 } } , \widehat { v _ { 0 } } , s _ { 0 } \right)$ is
420
+
421
+ $$
422
+ \begin{array} { c } { { \displaystyle \widetilde { z } ( s _ { 0 } + h ) = \widehat { z } _ { 0 } + h \displaystyle \frac { \mathrm { d } z } { d t } + \displaystyle \frac { h ^ { 2 } } { 2 } \displaystyle \frac { \mathrm { d } ^ { 2 } z } { d t ^ { 2 } } + { \cal O } ( h ^ { 3 } ) } } \\ { { = \widehat { z } _ { 0 } + h f ( \widehat { z _ { 0 } } , s _ { 0 } ) + \displaystyle \frac { h ^ { 2 } } { 2 } \Big ( f _ { t } ( \widehat { z _ { 0 } } , s _ { 0 } ) + f _ { z } ( \widehat { z _ { 0 } } , s _ { 0 } ) f ( \widehat { z _ { 0 } } , s _ { 0 } ) \Big ) + { \cal O } ( h ^ { 3 } ) } } \end{array}
423
+ $$
424
+
425
+ Next, we analyze accuracy of the numerical approximation. For simplicity, we directly analyze Eq. 7 by performing Taylor Expansion on $f$ .
426
+
427
+ $$
428
+ f ( \widehat { z _ { 0 } } + \frac { h } { 2 } \widehat { v _ { 0 } } , s _ { 0 } + \frac { h } { 2 } ) = f ( \widehat { z _ { 0 } } , s _ { 0 } ) + \frac { h } { 2 } f _ { t } ( \widehat { z _ { 0 } } , s _ { 0 } ) + \frac { h \widehat { v _ { 0 } } } { 2 } f _ { z } ( \widehat { z _ { 0 } } , s _ { 0 } ) + O ( h ^ { 2 } )
429
+ $$
430
+
431
+ $$
432
+ \widehat { z _ { 2 } } = \widehat { z _ { 0 } } + h f ( \widehat { z _ { 0 } } + \frac { h } { 2 } \widehat { v _ { 0 } } , s _ { 0 } + \frac { h } { 2 } )
433
+ $$
434
+
435
+ Plug Eq. 14, Eq. 15 and E.q. 16 into the definition of $L _ { z }$ , we get
436
+
437
+ $$
438
+ \begin{array} { r l } & { L _ { z } = \widetilde { z } ( s _ { 0 } + h ) - \widehat { z _ { 2 } } } \\ & { \quad = \Big [ \widehat { z _ { 0 } } + h f ( \widehat { z _ { 0 } } , s _ { 0 } ) + \displaystyle \frac { h ^ { 2 } } { 2 } \Big ( f _ { t } ( \widehat { z _ { 0 } } , s _ { 0 } ) + f _ { z } ( \widehat { z _ { 0 } } , s _ { 0 } ) f ( \widehat { z _ { 0 } } , s _ { 0 } ) \Big ) \Big ] } \\ & { \quad - \Big [ \widehat { z _ { 0 } } + h \Big ( f ( \widehat { z _ { 0 } } , s _ { 0 } ) + \displaystyle \frac { h } { 2 } f _ { t } ( \widehat { z _ { 0 } } , s _ { 0 } ) + \displaystyle \frac { h \widehat { v _ { 0 } } } { 2 } f _ { z } ( \widehat { z _ { 0 } } , s _ { 0 } ) \Big ) \Big ] + O ( h ^ { 3 } ) } \\ & { \quad = \displaystyle \frac { h ^ { 2 } } { 2 } f _ { z } ( \widehat { z _ { 0 } } , s _ { 0 } ) \Big ( f ( \widehat { z _ { 0 } } , s _ { 0 } ) - \widehat { v _ { 0 } } \Big ) + O ( h ^ { 3 } ) } \end{array}
439
+ $$
440
+
441
+ Therefore, if $\left| f ( \widehat { z _ { 0 } } , s _ { 0 } ) - \widehat { v _ { 0 } } \right|$ is of order $O ( 1 )$ , $L _ { z }$ is of order $O ( h ^ { 2 } )$ ; if $\left| f ( \widehat { z _ { 0 } } , s _ { 0 } ) - \widehat { v _ { 0 } } \right|$ is of order $O ( h )$ or smaller, then $L _ { z }$ is of order $O ( h ^ { 3 } )$ . Specifically, at the start time of integration, we have $\begin{array} { r } { \Big | f ( \widehat { z _ { 0 } } , s _ { 0 } ) - \widehat { v _ { 0 } } = 0 \Big | . } \end{array}$ , by induction, $L _ { z }$ at end time is $O ( h ^ { 3 } )$ .
442
+
443
+ Next we analyze the local truncation error in $v$ , denoted as $L _ { v }$ . Denote the ground truth as $\widetilde { v } ( t _ { 0 } + h )$ , we have
444
+
445
+ $$
446
+ \begin{array} { r l } & { \widetilde { v } ( s _ { 0 } + h ) = f \bigl ( \widetilde { z } ( s _ { 0 } + h ) , s _ { 0 } + h \bigr ) } \\ & { \qquad = f ( \widehat { z _ { 0 } } , s _ { 0 } ) + h f _ { t } ( \widehat { z _ { 0 } } , s _ { 0 } ) + \bigl ( \widetilde { z } ( s _ { 0 } + h ) - \widehat { z _ { 0 } } \bigr ) f _ { z } ( \widehat { z _ { 0 } } , s _ { 0 } ) + O ( h ^ { 2 } ) } \end{array}
447
+ $$
448
+
449
+ Next we analyze the error in the numerical approximation. Plug Eq. 15 into Eq. 7,
450
+
451
+ $$
452
+ \begin{array} { l } { { \displaystyle \widehat { v _ { 2 } } = 2 f \big ( \widehat { z _ { 0 } } + \frac { h } { 2 } \widehat { v _ { 0 } } , s _ { 0 } + \frac { h } { 2 } \big ) - \widehat { v _ { 0 } } } } \\ { { \displaystyle \quad = f \big ( \widehat { z _ { 0 } } , s _ { 0 } \big ) + \big ( f \big ( \widehat { z _ { 0 } } , s _ { 0 } \big ) - \widehat { v _ { 0 } } \big ) + h f _ { t } \big ( \widehat { z _ { 0 } } , s _ { 0 } \big ) + h \widehat { v _ { 0 } } f _ { z } \big ( \widehat { z _ { 0 } } , s _ { 0 } \big ) + O \big ( h ^ { 2 } \big ) } } \end{array}
453
+ $$
454
+
455
+ From Eq. 14, Eq. 21 and Eq. 23, we have
456
+
457
+ $$
458
+ \begin{array} { r l } & { L _ { v } = \widetilde { v } ( s _ { 0 } + h ) - \widehat { v _ { 2 } } } \\ & { \qquad = \Big ( f ( \widehat { z _ { 0 } } , s _ { 0 } ) - \widehat { v _ { 0 } } \Big ) + \Big ( \widetilde { z } ( s _ { 0 } + h ) - \big ( \widehat { z _ { 0 } } + h \widehat { v _ { 0 } } \big ) \Big ) f _ { z } ( \widehat { z _ { 0 } } , s _ { 0 } ) + O ( h ^ { 2 } ) } \\ & { \qquad = \Big ( f ( \widehat { z _ { 0 } } , s _ { 0 } ) - \widehat { v _ { 0 } } \Big ) + h \Big ( f ( \widehat { z _ { 0 } } , s _ { 0 } ) - \widehat { v _ { 0 } } \Big ) f _ { z } ( \widehat { z _ { 0 } } , s _ { 0 } ) + O ( h ^ { 2 } ) } \end{array}
459
+ $$
460
+
461
+ The last equation is derived by plugging in Eq. 14. Note that Eq. 26 holds for every single step forward in time, and at the start time of integration, we have $\left| \hat { f } ( \widehat { z _ { 0 } } , s _ { 0 } ) - \widehat { v _ { 0 } } \right| = \mathbf { \bar { 0 } }$ due to our binitialization as in Sec. 3.1 of the main paper. Therefore, by induction, $L _ { v }$ bis of order $O ( h ^ { 2 } )$ for consecutive steps. □
462
+
463
+ # A.4 STABILITY ANALYSIS
464
+
465
+ Lemma A.shape, and matrix of the form , then we have det $\left[ \begin{array} { l l } { A } & { B } \\ { C } & { D } \end{array} \right]$ ${ \mathrm { : } } A , B , C , D$ square matrices of the same $C D = D C$ ${ \left[ \begin{array} { l l } { A } & { B } \\ { C } & { D } \end{array} \right] } = \operatorname* { d e t } ( A D - B C )$
466
+
467
+ Proof. See (Silvester, 2000) for a detailed proof.
468
+
469
+ Theorem A.2. For ALF integrator with stepsize $h$ , if $h \sigma _ { i }$ is $O$ or is imaginary with norm no larger than $^ { l }$ , where $\sigma _ { i }$ is the i-th eigenvalue of the Jacobian $\frac { \partial f } { \partial z }$ , then the solver is on the critical boundary of $A$ -stability; otherwise, the solver is not A-stable.
470
+
471
+ Proof. A solver is A-stable is equivalent to the eigenvalue of the numerical forward has a norm below 1. We calculate the eigenvalue of $\psi$ below.
472
+
473
+ For the function defined by Eq. 7, the Jacobian is
474
+
475
+ $$
476
+ J = \left[ \begin{array} { c c } { \frac { \partial \widehat { z } _ { 2 } } { \partial z _ { 0 } } } & { \frac { \partial \widehat { z } _ { 2 } } { \partial \widehat { v _ { 0 } } } } \\ { \frac { \partial \widehat { v _ { 2 } } } { \partial z _ { 0 } } } & { \frac { \partial \widehat { v _ { 2 } } } { \partial \widehat { v _ { 0 } } } } \end{array} \right] = \left[ \begin{array} { c c } { I + h \frac { \partial f } { \partial z } } & { \frac { h ^ { 2 } } { 2 } \frac { \partial f } { \partial z } } \\ { 2 \times \frac { \partial f } { \partial z } } & { h \frac { \partial f } { \partial z } - I } \end{array} \right]
477
+ $$
478
+
479
+ We determine the eigenvalue of $J$ by solving the equation
480
+
481
+ $$
482
+ \operatorname* { d e t } ( J - \lambda I ) = \left[ \begin{array} { c c } { h \frac { \partial f } { \partial z } + ( 1 - \lambda ) I } & { \frac { h ^ { 2 } } { 2 } \frac { \partial f } { \partial z } } \\ { 2 \times \frac { \partial f } { \partial z } } & { h \frac { \partial f } { \partial z } - ( 1 + \lambda ) I } \end{array} \right] = 0
483
+ $$
484
+
485
+ It’s trivial to check $J$ satisfies conditions for Lemma A.1.1.Therefore, we have
486
+
487
+ $$
488
+ \begin{array} { l } { \displaystyle \operatorname* { d e t } ( J - \lambda I ) = \operatorname* { d e t } \Bigl [ \Bigl ( h \frac { \partial f } { \partial z } + ( 1 - \lambda ) I \Bigr ) \Bigl ( h \frac { \partial f } { \partial z } - ( 1 + \lambda ) I \Bigr ) - \Bigl ( \frac { h ^ { 2 } } { 2 } \frac { \partial f } { \partial z } \Bigr ) \Bigl ( 2 \times \frac { \partial f } { \partial z } \Bigr ) \Bigr ] } \\ { = \operatorname* { d e t } \Bigl [ - 2 \lambda h \frac { \partial f } { \partial z } + ( \lambda ^ { 2 } - 1 ) I \Bigr ] } \end{array}
489
+ $$
490
+
491
+ Suppose the eigen-decompostion of $\frac { \partial f } { \partial z }$ can be written as
492
+
493
+ $$
494
+ \frac { \partial f } { \partial z } = \Lambda \left[ \begin{array} { c c c c c } { { \sigma _ { 1 } } } & { { } } & { { } } & { { } } & { { } } \\ { { } } & { { \sigma _ { 2 } } } & { { } } & { { } } & { { } } \\ { { } } & { { } } & { { \hdots } } & { { } } & { { } } \\ { { } } & { { } } & { { } } & { { } } & { { \sigma _ { N } } } \end{array} \right] \Lambda ^ { - 1 }
495
+ $$
496
+
497
+ Note that $I = \Lambda I \lambda ^ { - 1 }$ , hence we have
498
+
499
+ $$
500
+ \begin{array} { l } { { \displaystyle \operatorname * { d e t } ( J - \lambda I ) = \operatorname * { d e t } \ \Lambda \Bigg \{ - 2 \lambda h \left[ \begin{array} { l l l l } { { } } & { { } } & { { } } & { { } } \\ { { } } & { { \sigma _ { 2 } } } & { { } } & { { } } \\ { { } } & { { } } & { { \cdots } } & { { } } \\ { { } } & { { } } & { { } } & { { \sigma _ { N } } } \end{array} \right] + ( \lambda ^ { 2 } - 1 ) I \Bigg \} \Lambda ^ { - 1 } } } \\ { { \displaystyle \quad = \prod _ { i = 1 } ^ { N } ( \lambda ^ { 2 } - 2 h \sigma _ { i } \lambda - 1 ) } } \end{array}
501
+ $$
502
+
503
+ Hence the eigenvalues are
504
+
505
+ $$
506
+ \lambda _ { i \pm } = h \sigma _ { i } \pm \sqrt { h ^ { 2 } \sigma _ { i } ^ { 2 } + 1 }
507
+ $$
508
+
509
+ A-stability requires $| \lambda _ { i \pm } | < 1 , \forall i$ , and has no solution.
510
+
511
+ The critical boundary is $| \lambda _ { i \pm } | = 1$ , the solution is: $h \sigma _ { i }$ is 0 or on the imaginary line with norm no larger than 1.
512
+
513
+ # A.5 DAMPED ALF
514
+
515
+ # Algorithm 2: Forward of $\psi$ in Damped ALF $( \eta \in ( 0 , 1 ]$ )
516
+
517
+ Input $( \widehat { z _ { i n } } , \widehat { v _ { i n } } , s _ { i n } , h ) = ( \widehat { z _ { 0 } } , \widehat { v _ { 0 } } , s _ { 0 } , h )$ where $s _ { 0 }$ is current time, $\widehat { z } _ { 0 }$ and $\widehat { v _ { 0 } }$ are correponding c cvalues at time $s _ { 0 }$ ; stepsize $h$ .
518
+
519
+ Forward
520
+
521
+ $$
522
+ \begin{array} { r l } & { s _ { 1 } = s _ { 0 } + h / 2 } \\ & { \widehat { z _ { 1 } } = \widehat { z _ { 0 } } + \widehat { v _ { 0 } } \times h / 2 } \\ & { \widehat { v _ { 1 } } = f ( \widehat { z _ { 1 } } , s _ { 1 } ) } \\ & { \widehat { v _ { 2 } } = \widehat { v _ { 0 } } + 2 \eta ( \widehat { v _ { 1 } } - \widehat { v _ { 0 } } ) } \\ & { \widehat { z _ { 2 } } = \widehat { z _ { 1 } } + \widehat { v _ { 2 } } \times h / 2 } \\ & { s _ { 2 } = s _ { 1 } + h / 2 } \end{array}
523
+ $$
524
+
525
+ # Output
526
+
527
+ $$
528
+ ( \widehat { z _ { o u t } } , \widehat { v _ { o u t } } , s _ { o u t } , h ) = ( \widehat { z _ { 2 } } , \widehat { v _ { 2 } } , s _ { 2 } , h )
529
+ $$
530
+
531
+ # Algorithm 3: $\psi ^ { - 1 }$ (Inverse of $\psi$ ) in Damped ALF $( \eta \in ( 0 , 1 ]$ )
532
+
533
+ Input $\widehat { ( z _ { o u t } , v _ { o u t } , s _ { o u t } , h ) }$ where $s _ { o u t }$ is current time, $\widehat { z _ { o u t } }$ and $\widehat { v _ { o u t } }$ are corresponding values at $s _ { o u t }$ , $h$ d dis stepsize.
534
+
535
+ Inverse
536
+
537
+ $$
538
+ \begin{array} { r l r } { { \big ( \widehat { z _ { 2 } } , \widehat { v _ { 2 } } , s _ { 2 } , h \big ) = \big ( \widehat { z _ { o u t } } , \widehat { v _ { o u t } } , s _ { o u t } , h \big ) } } \\ & { } & \\ & { s _ { 1 } = s _ { 2 } - h / 2 } \\ & { } & \\ & { } & { \widehat { z _ { 1 } } = z _ { 2 } - \widehat { v _ { 2 } } \times h / 2 } \\ & { } & \\ & { } & { \widehat { v _ { 1 } } = f \big ( \widehat { z _ { 1 } } , s _ { 1 } \big ) } \\ & { } & { \widehat { v _ { 0 } } = \big ( \widehat { v _ { 2 } } - 2 \eta \widehat { v _ { 1 } } \big ) \big / \big ( 1 - 2 \eta \big ) } \\ & { } & \\ & { } & { \widehat { z _ { 0 } } = \widehat { z _ { 1 } } - \widehat { v _ { 0 } } \times h / 2 } \\ & { } & \\ & { } & { s _ { 0 } = s _ { 1 } - h / 2 } \\ & { } & \\ & { } & { \big ( \widehat { z _ { i n } } , \widehat { v _ { i n } } , s _ { i n } , h \big ) = \big ( \widehat { z _ { 0 } } , \widehat { v _ { 0 } } , s _ { 0 } , h \big ) } \end{array}
539
+ $$
540
+
541
+ # Output
542
+
543
+ The main difference between ALF and Damped ALF is marked in blue in Algo. 2. In ALF, the update of $\widehat { v _ { 2 } }$ is $\widehat { v _ { 2 } } = \widehat { ( v _ { 1 } - v _ { 0 } ) } + \widehat { v _ { 1 } } = 2 \widehat { ( v _ { 1 } - v _ { 0 } ) } + \widehat { v _ { 0 } }$ ; while in Damped ALF, the update is scaled by a factor $\eta$ b b b b bbetween 0 and 1, so the update is $\widehat { v _ { 2 } } = 2 \eta ( \widehat { v _ { 1 } } - \widehat { v _ { 0 } } ) + \widehat { v _ { 0 } }$ . When $\eta = 1$ , Damped ALF reduces to ALF.
544
+
545
+ Similar to Sec. A.1, we can write the forward as For simplicity, we can re-write the forward of ALF as
546
+
547
+ $$
548
+ { \left[ \begin{array} { l } { { \widehat { z _ { 2 } } } } \\ { 0 } \end{array} \right] } = { \left[ \begin{array} { l } { { \widehat { z _ { 0 } } } + \eta h f ( { \widehat { z _ { 0 } } } + { \frac { h } { 2 } } { \widehat { v _ { 0 } } } , s _ { 0 } + { \frac { h } { 2 } } ) + ( 1 - \eta ) h { \widehat { v _ { 0 } } } } \\ { 2 \eta f ( { \widehat { z _ { 0 } } } + { \frac { h } { 2 } } { \widehat { v _ { 0 } } } , s _ { 0 } + { \frac { h } { 2 } } ) + ( 1 - 2 \eta ) { \widehat { v _ { 0 } } } } \end{array} \right] }
549
+ $$
550
+
551
+ Similarly, the inverse of ALF can be written as
552
+
553
+ $$
554
+ \begin{array} { r } { \left[ \widehat { z _ { 0 } } \right] = \left[ { \begin{array} { c } { \widehat { z _ { 2 } } - h \frac { 1 - \eta } { 1 - 2 \eta } \widehat { v _ { 2 } } + h \frac { \eta } { 1 - 2 \eta } f \big ( \widehat { z _ { 2 } } - \frac { h } { 2 } \widehat { v _ { 2 } } , s _ { 2 } - \frac { h } { 2 } \big ) } \\ { \frac { 1 } { 1 - 2 \eta } \widehat { v _ { 2 } } - \frac { 2 \eta } { 1 - 2 \eta } f \big ( \widehat { z _ { 2 } } - \frac { h } { 2 } \widehat { v _ { 2 } } , s _ { 2 } - \frac { h } { 2 } \big ) } \end{array} } \right] } \end{array}
555
+ $$
556
+
557
+ Theorem A.3. For a single step in Damped $A L F$ with stepsize $h$ , the local truncation error of $z$ is $O ( h ^ { 2 } )$ , and the local truncation errof of $v$ is $O ( h )$ .
558
+
559
+ Proof. The proof is similar to Thm. A.3. By similar calculations using the Taylor Expansion in Eq. 15 and Eq. 14, we have
560
+
561
+ $$
562
+ \begin{array} { r l } & { \widehat { z _ { 2 } } - \widetilde { z } ( s _ { 0 } + h ) = ( 1 - \eta ) h \widehat { v _ { 0 } } + h \eta \Big [ f ( \widehat { z _ { 0 } } , s _ { 0 } ) + \displaystyle \frac { h } { 2 } f _ { t } ( \widehat { z _ { 0 } } , s _ { 0 } ) + \displaystyle \frac { h \widehat { v _ { 0 } } } { 2 } f _ { z } ( \widehat { z _ { 0 } } , s _ { 0 } ) \Big ] } \\ & { \qquad - h \Big [ f ( \widehat { z _ { 0 } } , s _ { 0 } ) + \displaystyle \frac { h } { 2 } f _ { t } \widehat { z _ { 0 } } , s _ { 0 } + \displaystyle \frac { h } { 2 } f _ { z } ( \widehat { z _ { 0 } } , s _ { 0 } ) f ( \widehat { z _ { 0 } } , s _ { 0 } ) \Big ] + O ( h ^ { 2 } ) } \\ & { \qquad = ( 1 - \eta ) h \Big ( \widehat { v _ { 0 } } - f ( \widehat { z _ { 0 } } , s _ { 0 } ) \Big ) + \displaystyle \frac { \eta - 1 } { 2 } h ^ { 2 } f _ { t } ( \widehat { z _ { 0 } } , s _ { 0 } ) } \\ & { \qquad + \displaystyle \frac { h ^ { 2 } } { 2 } \Big ( \eta \widehat { v _ { 0 } } - f ( \widehat { z _ { 0 } } , s _ { 0 } ) \Big ) f _ { z } ( \widehat { z _ { 0 } } , s _ { 0 } ) + O ( h ^ { 2 } ) } \end{array}
563
+ $$
564
+
565
+ Using Eq. 21, Eq. 15 and Eq. 14, we have
566
+
567
+ $$
568
+ \begin{array} { r l } & { \widetilde { v _ { 2 } } - \widehat { v _ { 2 } } = ( 1 - 2 \eta ) \widehat { v _ { 0 } } + ( 2 \eta - 1 ) f ( \widehat { z _ { 0 } } , s _ { 0 } ) + ( 1 - \eta ) h f _ { t } ( \widehat { z _ { 0 } } , s _ { 0 } ) } \\ & { \qquad + \left( \widetilde { z } ( s _ { 0 } + h ) - \widehat { z _ { 0 } } - \eta h \widehat { v _ { 0 } } \right) f _ { z } ( \widehat { z _ { 0 } } , s _ { 0 } ) + O ( h ^ { 2 } ) } \\ & { \qquad = ( 2 \eta - 1 ) \big [ f ( \widehat { z _ { 0 } } , s _ { 0 } ) - \widehat { z _ { 0 } } \big ] + ( 1 - \eta ) h f _ { t } ( \widehat { z _ { 0 } } , s _ { 0 } ) } \\ & { \qquad + \eta \Big [ h f ( \widehat { z _ { 0 } } , s _ { 0 } ) - h \widehat { v _ { 0 } } \Big ] f _ { z } ( \widehat { z _ { 0 } } , s _ { 0 } ) + O ( h ^ { 2 } ) } \end{array}
569
+ $$
570
+
571
+ Note that when $\eta = 1$ , Eq. 51 reduces to Eq. 19, and Eq. 53 reduces to Eq. 26. By initialization, we have $| f ( \widehat { z _ { 0 } } , s _ { 0 } ) - \widehat { v _ { 0 } } | = 0$ at initial time, hence by induction, the local truncation error for $z$ is $O ( h ^ { 2 } )$ b b; the local truncation error for $v$ is $O ( h )$ when $\eta < 1$ , and is $O ( h ^ { 2 } )$ when $\eta = 1$ . □
572
+
573
+ Theorem A.4 (Theorem 3.2 in the main paper). For Dampled $A L F$ integrator with stepsize $h$ , where $\sigma _ { i }$ is the $i$ -th eigenvalue of the Jacobian $\frac { \partial f } { \partial z }$ , then the solver is $A$ -stable $i f | 1 + \eta ( h \sigma -$ $1 ) \pm \sqrt { \eta \big [ 2 h \sigma _ { i } + \eta ( h \sigma _ { i } - 1 ) ^ { 2 } \big ] } \Big \vert < 1 , \forall i .$
574
+
575
+ Proof. The Jacobian of the forward-pass of a single step damped ALF is
576
+
577
+ $$
578
+ J = \left[ \begin{array} { c c } { I + \eta h \frac { \partial f } { \partial z } } & { ( 1 - \eta ) h I + \eta \frac { h ^ { 2 } } { 2 } \frac { \partial f } { \partial z } } \\ { 2 \eta \frac { \partial f } { \partial z } } & { \eta h \frac { \partial f } { \partial z } + ( 1 - 2 \eta ) I } \end{array} \right]
579
+ $$
580
+
581
+ when $\eta = 1$ , $J$ reduces to Eq. 27. We can determine the eigenvalue of $J$ using similar techniques. Assume the eigenvalues for $\frac { \partial f } { \partial z }$ are $\{ \sigma _ { i } \}$ , then we have
582
+
583
+ $$
584
+ \begin{array} { l } { \displaystyle \operatorname* { d e t } ( J - \lambda I ) = \operatorname* { d e t } \left[ \begin{array} { l l } { ( 1 - \lambda ) I + \eta h \frac { \partial f } { \partial z } } & { ( 1 - \eta ) h I + \eta \frac { h ^ { 2 } } { 2 } \frac { \partial f } { \partial z } } \\ { \displaystyle \qquad } & { \eta h \frac { \partial f } { \partial z } + ( 1 - 2 \eta - \lambda ) I } \end{array} \right] } \\ { \displaystyle = \operatorname* { d e t } \left[ \Big ( ( 1 - \lambda ) I + \eta h \frac { \partial f } { \partial z } \Big ) \Big ( \eta h \frac { \partial f } { \partial z } + ( 1 - 2 \eta - \lambda ) I \Big ) \right. } \\ { \displaystyle - \left( ( 1 - \eta ) h I + \eta h \frac { \partial ^ { 2 } } { 2 } \frac { \partial f } { \partial z } \Big ) \Big ( 2 \eta \frac { \partial f } { \partial z } \Big ) \right] } \\ { \displaystyle = \prod _ { i = 1 } ^ { N } \left[ 1 + \eta ( h \sigma _ { i } - 1 ) \pm \sqrt { \eta \big [ 2 h \sigma _ { i } + \eta ( h \sigma _ { i } - 1 ) ^ { 2 } \big ] } \right] } \end{array}
585
+ $$
586
+
587
+ when $\eta < 1$ , it’s easy to check that $\left| 1 + \eta ( h \sigma _ { i } - 1 ) \pm \sqrt { \eta \big [ 2 h \sigma _ { i } + \eta ( h \sigma _ { i } - 1 ) ^ { 2 } \big ] } \right| < 1$ has non-empty solutions for $h \sigma$ .
588
+
589
+ For a quick validation, we plot the region of A-stability on the imaginary plane for a single eigenvalue in Fig. 1. As $\eta$ increases, the area of stability decreases. When $\eta = 1$ , the system is no-where A-stable, and the boundary for A-stability is on the imaginary axis $[ - i , i ]$ where $i$ is the imaginary unit.
590
+
591
+ ![](images/101ac7d51d52296b4d11b9f4136ff79e830a99b276655dff89546fd5738863bb.jpg)
592
+ Figure 1: Region of A-stability for eigenvalue on the imaginary plane for damped ALF. From left to right, the region of stability for $\eta = 0 . 2 5$ , $\eta = 0 . 7 , \eta = 0 . 8$ respectively. As $\eta$ increases to 1, the area of stability region decreases.
593
+
594
+ # B EXPERIMENTAL DETAILS
595
+
596
+ # B.1 IMAGE RECOGNITION
597
+
598
+ # B.1.1 EXPERIMENT ON CIFAR10
599
+
600
+ We directly modify a ResNet18 into a Neural ODE, where the forward of a residual block $( y =$ $x + f ( x ) )$ and the forward of an ODE block $\begin{array} { r } { ( y = x + \int _ { 0 } ^ { T } f ( z , t ) d t } \end{array}$ where $T = 1$ ) share the same parameterization $f$ , hence they have the same number of parameters. Our experiment is based on the official implementation by Zhuang et al. (2020) and an open-source repository (Liu, 2017).
601
+
602
+ All models are trained with SGD optimizer for 90 epochs, with an initial learning rate of 0.01, and decayed by a factor of 10 at 30th epoch and 60th epoch respectively. Training scheme is the same for all models (ResNet, Neural ODE trained with adjoint, naive, ACA and MALI). For ACA, we follow the settings in (Zhuang et al., 2020) and use the official implementation torch ACA 1, and use a Heun-Euler solver with $r t o \bar { l } = 1 0 ^ { - 1 }$ , $a t o l = 1 0 ^ { - 2 }$ during training. For MALI, we use an adaptive version and set $r t o l = 1 0 ^ { - 1 }$ , $a t o l = 1 0 ^ { - 2 }$ . For the naive and adjoint method, we use the default Dopri5 solver from the torchdiffeq2 package with $\mathrm { r t o l } = \mathrm { a t o l } = \mathrm { \bar { 1 0 } } ^ { - 5 }$ . We train all models for 5 independent runs, and report the mean and standard deviation across runs.
603
+
604
+ # B.1.2 EXPERIMENTS ON IMAGENET
605
+
606
+ Training scheme We conduct experiments on ImageNet with ResNet18 and Neural-ODE18. All models are trained on 4 GTX-1080Ti GPUs with a batchsize of 256. All models are trained for 80 epochs, with an initial learning rate of 0.1, and decayed by a factor of 10 at $3 0 \mathrm { t h }$ and 60th epoch. Note that due to the large size input $2 5 6 \times 2 5 6$ , the naive method and ACA requires a huge memory, and is infeasible to train. MALI and the adjoint method requires a constant memory hence is suitable for large-scale experiments. For both MALI and the adjoint menthod, we use a fixed stepsize of 0.25, and integrates from 0 to $T = 1$ . As shown in Table. 2 in the main paper, a stepsize of 0.25 is sufficiently small to train a meaningful continuous model that is robust to discretization scheme.
607
+
608
+ Invariance to discretization scheme To test the influence of discretization scheme, we test our Neural ODE with different solvers without re-training. For fixed-stepsize solvers, we tested various step sizes including $\{ 0 . 1 , 0 . 1 5 , 0 . 2 5 , 0 . 5 , 1 . 0 \}$ ; for adaptive solvers, we set rto $\scriptstyle \mathbf { - 0 . 1 }$ , atol $= 0 . 0 1$ for MALI and Heun-Euler method, and set rto $1 \stackrel { { \textstyle \sum } } { = } 1 0 ^ { - 2 }$ , $\mathrm { a t o l } = 1 0 ^ { - 3 }$ for RK23 solver, and set rtol $=$ $1 0 ^ { - 4 }$ , $\mathrm { a t o l } = 1 0 ^ { - 5 }$ for Dopri5 solver. As shown in Table. 2, Neural ODE trained with MALI is robust to discretization scheme, and MALI significantly outperforms the adjoint method in terms of accuracy ( $70 \%$ v.s. $63 \%$ top-1 accuracy on the validation dataset). An interesting finding is that when trained with MALI which is a second-order solver, and tested with higher-order solver (e.g.
609
+
610
+ ![](images/a2eb3a813f5f7dc301a07eb82c50a2ff52e673b7a547da9299eb769bdf3b5a0e.jpg)
611
+ Figure 2: Results on ImageNet.
612
+
613
+ RK4), our Neural ODE achieves $7 0 . 2 1 \%$ top-1 accuracy, which is higher than both the same solver during training (MALI, $6 9 . 5 9 \%$ accuracy) and the ResNet18 ( $7 0 . 0 9 \%$ accuracy).
614
+
615
+ Furthermore, many papers claim ResNet to be an approximation for an ODE (Lu et al., 2018). However, Queiruga et al. (2020) argues that many numerical discretizations fail to be meaningful dynamical systems, while our experiments demonstrate that our model is continuous hence invariant to discretization schemes.
616
+
617
+ Adversarial robustness Besides the high accuracy and robustness to discretization scheme, another advantage of Neural ODE is the robustness to adversarial attack. The adversary robustness of Neural ODE is extensively studied in (Hanshu et al., 2019), but not only validated on small-scale datasets such as Cifar10. To our knowledge, our method is the first to enable effectuve training of Neural ODE on large-scale datasets such as ImageNet and achieve a high accuracy, and we are the first to validate the robustness of Neural ODE on ImageNet. We use the advertorch 3 toolbox to perform adversarial attack. We test the performance of ResNet and Neural ODE under FGSM attack. To be more convincing, we conduct experiment on the pretrained ResNet18 provided by the official PyTorch website 4. Since Neural ODE is invariant to discretization scheme, it’s possible to derive the gradient for attack using one ODE solver, and inference on the perturbed image using another solver. As summarized in Table. 3, Neural ODE consistently achieves a higher accuracy than ResNet under the same attack.
618
+
619
+ # B.2 TIME SERIES MODELING
620
+
621
+ We conduct experiments on Latent-ODE models (Rubanova et al., 2019) and Neural CDE (controlled differential equation) (Kidger et al., 2020a). For all experiments, we use the official implementation, and only replace the solver with MALI. The latent-ODE model is trained on the Mujoco dataset processed with code provided by the official implementation, and we experiment with different ratios $( 1 0 \% , 2 0 \% , 5 0 \% )$ of training data as described in (Rubanova et al., 2019). All models are trained for 300 epochs with Adamax optimizer, with an initial learning rate of 0.01 and scaled by 0.999 for each epoch. For the Neural CDE model, for the naive method, ACA and MALI, we perform 5 independent runs and report the mean value and standard deviation; results for the adjoint and seminorm adjoint are from (Kidger et al., 2020a). For Neural CDE, we use MALI with ALF solver with a fixed stepsize of 0.25, and train the model for 100 epochs with an initial learning rate of 0.004.
622
+
623
+ ![](images/b6df4d8f55cc3c56539cccaad8c15e32a0388b4569c6981a30dc533bc97487b4.jpg)
624
+ Figure 3: Results on MNIST dataset.
625
+
626
+ # B.3 CONTINUOUS GENERATIVE MODELS
627
+
628
+ # B.3.1 TRAINING DETAILS
629
+
630
+ Our experiment is based on the official implementation of (Finlay et al., 2020), with the only difference in ODE solver. For a fair comparison, we only use MALI for training, and use Dopri5 solver from torchdiffeq package (Chen et al., 2018) with ${ \dot { \mathrm { r t o l } } } = { \mathrm { a t o l } } = 1 0 ^ { - 5 }$ . For MALI, we use adaptive ALF solver with $r t o l \stackrel { - } { = } 1 0 ^ { - 2 } , a t o l = 1 0 ^ { - 3 }$ , and use an initial stepsize of 0.25. Integration time is from 0 to 1.
631
+
632
+ On MNIST and CIFAR dataset, we set the regularization coefficients for kinetic energy and Frobenius norm of the derivative function as 0.05. We train the model for 50 epochs with an initial learning rate of 0.001.
633
+
634
+ # B.3.2 ADDTIONAL RESULTS
635
+
636
+ We show generated examples on MNIST dataset in Fig. 3, results for Cifar10 dataset in Fig. 4, and results for ImageNet64 in Fig. 5.
637
+
638
+ # B.4 ERROR IN GRADIENT ESTIMATION FOR TOY EXAMPLES WHEN $t < 1$
639
+
640
+ We plot the error in gradient estimation for the toy example defined by Eq.6 in the main paper in Fig. 6. Note that the integration time $T$ is set as smaller than 1, while the main paper is larger than 20. We observe the same results, MALI and ACA generate smaller error than the adjoint and the naive method.
641
+
642
+ # B.5 RESULTS OF DAMPED MALI
643
+
644
+ For all experiments in the main paper, we set $\eta = 1$ and did not use damping. For completeness, we experimented with damped MALI using different values of $\eta$ . As shown in Table. 7, MALI is robust to different $\eta$ values.
645
+
646
+ ![](images/48da9b9babd714737d38d09b19d94eb40fd95e8c5c77a259a8a7074aeb5682a4.jpg)
647
+ Figure 4: Results on Cifar10 dataset.
648
+
649
+ ![](images/c19eeda53c981b7203c76904f278cb0dc6c8a5cb88712851c7e859297256e97b.jpg)
650
+ Figure 5: Results on ImageNet64 dataset.
651
+
652
+ Table 7: Results of damped MALI with different $\eta$ values. We report the test accuracy of Neural CDE on Speech Command dataset, and the test MSE of latent-ODE on Mujoco data.
653
+
654
+ <table><tr><td colspan="2">m</td><td>1.0</td><td>0.95</td><td>0.9</td><td>0.85</td></tr><tr><td colspan="2">Test Accuracy on Speech Commands (Higher is better)</td><td>93.7 ± 0.3</td><td>93.7 ± 0.1</td><td>93.5± 0.2</td><td>93.7 ± 0.3</td></tr><tr><td rowspan="2">Test MSEof latent ODE on Mujoco (Lower is better)</td><td>10% training data</td><td>0.35</td><td>0.36</td><td>0.33</td><td>0.33</td></tr><tr><td>20% training data</td><td>0.27</td><td>0.25</td><td>0.26</td><td>0.27</td></tr></table>
655
+
656
+ (a) Error in the estimation of gradient $w . r . t$ initial condition.
657
+
658
+ ![](images/54d1f8b4535f2e6c9ab6d5e48efe2c1fbf9d27fbbba330f9ffb47beffb0447af.jpg)
659
+ (b) Error in the estimation of gradient $w . r . t$ parameter $\alpha$
660
+ Figure 6: Comparison of error in gradient estimation for the toy example by Eq.6 of the main paper, when $t < 1$ .
md/train/dV19Yyi1fS3/dV19Yyi1fS3.md ADDED
@@ -0,0 +1,496 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # TRAINING WITH QUANTIZATION NOISE FOREXTREME MODEL COMPRESSION
2
+
3
+ Pierre Stock ∗ † Facebook AI Research, Inria
4
+
5
+ Angela Fan∗ Facebook AI Research, LORIA
6
+
7
+ Benjamin Graham Facebook AI Research
8
+
9
+ Edouard Grave Facebook AI Research
10
+
11
+ Rémi Gribonval Inria
12
+
13
+ Hervé Jégou Facebook AI Research
14
+
15
+ Armand Joulin Facebook AI Research
16
+
17
+ # ABSTRACT
18
+
19
+ We tackle the problem of producing compact models, maximizing their accuracy for a given model size. A standard solution is to train networks with Quantization Aware Training (Jacob et al., 2018), where the weights are quantized during training and the gradients approximated with the Straight-Through Estimator (Bengio et al., 2013). In this paper, we extend this approach to work beyond int8 fixedpoint quantization with extreme compression methods where the approximations introduced by STE are severe, such as Product Quantization. Our proposal is to only quantize a different random subset of weights during each forward, allowing for unbiased gradients to flow through the other weights. Controlling the amount of noise and its form allows for extreme compression rates while maintaining the performance of the original model. As a result we establish new state-of-the-art compromises between accuracy and model size both in natural language processing and image classification. For example, applying our method to state-of-the-art Transformer and ConvNet architectures, we can achieve $8 2 . 5 \%$ accuracy on MNLI by compressing RoBERTa to $1 4 \mathbf { M B }$ and $8 0 . 0 \%$ top-1 accuracy on ImageNet by compressing an EfficientNet-B3 to $3 . 3 \mathrm { M B }$ . 1
20
+
21
+ # 1 INTRODUCTION
22
+
23
+ Many of the best performing neural network architectures in real-world applications have a large number of parameters. For example, the current standard machine translation architecture, Transformer (Vaswani et al., 2017), has layers that contain millions of parameters. Even models that are designed to jointly optimize the performance and the parameter efficiency, such as EfficientNets (Tan & Le, 2019), still require dozens to hundreds of megabytes, which limits their applications to domains like robotics or virtual assistants.
24
+
25
+ Model compression schemes reduce the memory footprint of overparametrized models. Pruning (LeCun et al., 1990) and distillation (Hinton et al., 2015) remove parameters by reducing the number of network weights. In contrast, quantization focuses on reducing the bits per weight. This makes quantization particularly interesting when compressing models that have already been carefully optimized in terms of network architecture. Whereas deleting weights or whole hidden units will inevitably lead to a drop in performance, we demonstrate that quantizing the weights can be performed with little to no loss in accuracy.
26
+
27
+ Popular postprocessing quantization methods, like scalar quantization, replace the floating-point weights of a trained network by a lower-precision representation, like fixed-width integers (Vanhoucke et al., 2011). These approaches achieve a good compression rate with the additional benefit of accelerating inference on supporting hardware. However, the errors made by these approximations accumulate in the computations operated during the forward pass, inducing a significant drop in performance (Stock et al., 2019).
28
+
29
+ ![](images/e8fa608fc575221a61a670b21fc8efe8983cacc3f544405b658da957ea4c631e.jpg)
30
+ Figure 1: Quant-Noise trains models to be resilient to inference-time quantization by mimicking the effect of the quantization method during training time. This allows for extreme compression rates without much loss in accuracy on a variety of tasks and benchmarks.
31
+
32
+ A solution to address this drifting effect is to directly quantize the network during training. This raises two challenges. First, the discretization operators have a null gradient — the derivative with respect to the input is zero almost everywhere. This requires special workarounds to train a network with these operators. The second challenge that often comes with these workarounds is the discrepancy that appears between the train and test functions implemented by the network. Quantization Aware Training (QAT) (Jacob et al., 2018) resolves these issues by quantizing all the weights during the forward and using a straight through estimator (STE) (Bengio et al., 2013) to compute the gradient. This works when the error introduced by STE is small, like with int8 quantization, but does not suffice in compression regimes where the approximation made by the compression is more severe.
33
+
34
+ In this work, we show that quantizing only a subset of weights instead of the entire network during training is more stable for high compression schemes. Indeed, by quantizing only a random fraction of the network at each forward, most the weights are updated with unbiased gradients. Interestingly, we show that our method can employ a simpler quantization scheme during the training. This is particularly useful for quantizers with trainable parameters, such as Product Quantizer (PQ), for which our quantization proxy is not parametrized. Our approach simply applies a quantization noise, called Quant-Noise, to a random subset of the weights, see Figure 1. We observe that this makes a network resilient to various types of discretization methods: it significantly improves the accuracy associated with (a) low precision representation of weights like int8; and (b) state-of-the-art PQ. Further, we demonstrate that Quant-Noise can be applied to existing trained networks as a post-processing step, to improve the performance network after quantization.
35
+
36
+ In summary, this paper makes the following contributions:
37
+
38
+ • We introduce the Quant-Noise technique to learn networks that are more resilient to a variety of quantization methods such as int4, int8, and PQ; • Adding Quant-Noise to PQ leads to new state-of-the-art trade-offs between accuracy and model size. For instance, for natural language processing (NLP), we reach $8 2 . 5 \%$ accuracy on MNLI by compressing RoBERTa to 14 MB. Similarly for computer vision, we report $8 0 . 0 \%$ top-1 accuracy on ImageNet by compressing an EfficientNet-B3 to $3 . 3 { \mathrm { M B } }$ ; • By combining PQ and int8 to quantize weights and activations for networks trained with Quant-Noise, we obtain extreme compression with fixed-precision computation and achieve $7 9 . 8 \%$ top-1 accuracy on ImageNet and 21.1 perplexity on WikiText-103.
39
+
40
+ # 2 RELATED WORK
41
+
42
+ Model compression. Many compression methods focus on efficient parameterization, via weight pruning (LeCun et al., 1990; Li et al., 2016; Huang et al., 2018; Mittal et al., 2018), weight sharing (Dehghani et al., 2018; Turc et al., 2019; Lan et al., 2019) or with dedicated architectures (Tan & Le, 2019; Zhang et al., 2017; Howard et al., 2019). Weight pruning is implemented during training (Louizos et al., 2017) or as a fine-tuning post-processing step (Han et al., 2015; 2016). Many pruning methods are unstructured, i.e., remove individual weights (LeCun et al., 1990; Molchanov et al., 2017). On the other hand, structured pruning methods follow the structure of the weights to
43
+
44
+ reduce both the memory footprint and the inference time of a model (Li et al., 2016; Luo et al., 2017;
45
+ Fan et al., 2019). We refer the reader to Liu et al. (2018) for a review of different pruning strategies.
46
+
47
+ Other authors have worked on lightweight architectures, by modifying existing models (Zhang et al., 2018; Wu et al., 2019; Sukhbaatar et al., 2019a) or developing new networks, such as MobileNet (Howard et al., 2019), ShuffleNet (Zhang et al., 2017), and EfficientNet (Tan & Le, 2019) in vision.
48
+
49
+ Finally, knowledge distillation (Hinton et al., 2015) has been applied to sentence representation (Turc et al., 2019; Sanh et al., 2019a; Sun et al., 2019; Zhao et al., 2019; Jiao et al., 2019), to reduce the size of a BERT model (Devlin et al., 2018).
50
+
51
+ Quantization. There are extensive studies of scalar quantization to train networks with lowprecision weights and activations (Courbariaux et al., 2015; Courbariaux & Bengio, 2016; Rastegari et al., 2016; McDonnell, 2018). These methods benefit from specialized hardware to also improve the runtime during inference (Vanhoucke et al., 2011). Other quantization methods such as Vector Quantization (VQ) and PQ (Jegou et al., 2011) quantize blocks of weights simultaneously to achieve higher compression rate (Stock et al., 2019; Gong et al., 2014; Joulin et al., 2016; Carreira-Perpiñán & Idelbayev, 2017). Closer to our work, several works have focused at simultaneously training and quantizing a network (Jacob et al., 2018; Krishnamoorthi, 2018; Gupta et al., 2015; Dong et al., 2019). Gupta et al. (2015) assigns weights to a quantized bin stochastically which is specific to scalar quantization, but allows training with fixed point arithmetic. Finally, our method can be interpreted as a form of Bayesian compression (Louizos et al., 2017), using the Bayesian interpretation of Dropout (Gal & Ghahramani, 2016). As opposed to their work, we select our noise to match the weight transformation of a target quantization methods without restricting it to a scale mixture prior.
52
+
53
+ # 3 QUANTIZING NEURAL NETWORKS
54
+
55
+ In this section, we present the principles of quantization, several standard quantization methods, and describe how to combine scalar and product quantization. For clarity, we focus on the case of a fixed real matrix $\mathbf { W } \in \mathbf { R } ^ { n \times p }$ . We suppose that this matrix is split into $m \times q$ blocks $\mathbf { b } _ { k l }$ :
56
+
57
+ $$
58
+ \mathbf { W } = \left( \sum _ { \vdots } ^ { \mathbf { b } _ { 1 1 } } \mathrm { ~ ~ \cdots ~ } \sum _ { \mathbf { b } _ { m q } } \right) ,
59
+ $$
60
+
61
+ where the nature of these blocks is determined by the quantization method. A codebook is a set of $K$ vectors, i.e., ${ \mathcal { C } } = \{ \mathbf { c } [ 1 ] , \dots , \mathbf { c } [ K ] \}$ . Quantization methods compress the matrix W by assigning to each block $\mathbf { b } _ { k l }$ an index that points to a codeword $\mathbf { c }$ in a codebook $\mathcal { C }$ , and storing the codebook $\mathcal { C }$ and the resulting indices (as the entries ${ \bf { I } } _ { k l }$ of an index matrix $\mathbf { I }$ ) instead of the real weights. During the inference, they reconstruct an approximation $\widehat { \bf W }$ of the original matrix W such that $\widehat { \mathbf { b } } _ { k l } = \mathbf { c } [ \mathbf { I } _ { k l } ]$ .
62
+
63
+ We distinguish scalar quantization, such as int8, where each block $\mathbf { b } _ { k l }$ consists of a single weight, from vector quantization, where several weights are quantized jointly.
64
+
65
+ # 3.1 FIXED-POINT SCALAR QUANTIZATION
66
+
67
+ Fixed-point scalar quantization methods replace floating-point number representations by lowprecision fixed-point representations. They simultaneously reduce a model’s memory footprint and accelerate inference by using fixed-point arithmetic on supporting hardware.
68
+
69
+ Fixed-point scalar quantization operates on blocks that represent a single weight, i.e., $\mathbf { b } _ { k l } = \mathbf { W } _ { k l }$ Floating-point weights are replaced by $N$ bit fixed-point numbers (Gupta et al., 2015), with the extreme case of binarization where $N = 1$ (Courbariaux et al., 2015). More precisely, the weights are rounded to one of $2 ^ { N }$ possible codewords. These codewords correspond to bins evenly spaced by a scale factor $s$ and shifted by a bias $z$ . Each weight ${ \bf W } _ { k l }$ is mapped to its nearest codeword $c$ by successively quantizing with $z \mapsto$ round $( \mathbf { W } _ { k l } / s + z )$ and dequantizing with the inverse operation:
70
+
71
+ $$
72
+ \begin{array} { r } { \mathbf { c } = ( \mathrm { r o u n d } ( \mathbf { W } _ { k l } / s + z ) - z ) \times s , } \end{array}
73
+ $$
74
+
75
+ where we compute the scale and bias as:
76
+
77
+ $$
78
+ s = { \frac { \operatorname* { m a x } \mathbf { W } - \operatorname* { m i n } \mathbf { W } } { 2 ^ { N } - 1 } } \quad { \mathrm { a n d } } \quad z = \operatorname { r o u n d } ( \operatorname* { m i n } \mathbf { W } / s ) .
79
+ $$
80
+
81
+ We focus on this uniform rounding scheme instead of other non-uniform schemes (Choi et al., 2018; Li et al., 2019), because it allows for fixed-point arithmetic with implementations in PyTorch and Tensorflow (see Appendix). The compression rate is $\times 3 2 / N$ . The activations are also rounded to $N$ -bit fixed-point numbers. With int8 for instance, this leads to $\times 2$ to $\times 4$ faster inference on dedicated hardware. In this work, we consider both int4 and int8 quantization.
82
+
83
+ # 3.2 PRODUCT QUANTIZATION
84
+
85
+ Several quantization methods work on groups of weights, such as vectors, to benefit from the correlation induced by the structure of the network. In this work, we focus on Product Quantization for its good performance at extreme compression ratio (Stock et al., 2019).
86
+
87
+ Traditional PQ. In vector quantization methods, the blocks are predefined groups of weights instead of single weights. The codewords are groups of values, and the index matrix I maps groups of weights from the matrix W to these codewords. In this section, we present the Product Quantization framework as it generalizes both scalar and vector quantization. We consider the case where we apply PQ to the columns of W and thus assume that $q = p$ .
88
+
89
+ Traditional vector quantization techniques split the matrix $\mathbf { W }$ into its $p$ columns and learn a codebook on the resulting $p$ vectors. Instead, Product Quantization splits each column into $m$ subvectors and learns the same codebook for each of the resulting $m \times p$ subvectors. Each quantized vector is subsequently obtained by assigning its subvectors to the nearest codeword in the codebook. Learning the codebook is traditionally done using $k$ -means with a fixed number $K$ of centroids, typically $K = 2 5 6$ to store the index matrix I using int8. Thus, the objective function is written as:
90
+
91
+ $$
92
+ \Vert \mathbf { W } - \widehat { \mathbf { W } } \Vert _ { 2 } ^ { 2 } = \sum _ { k , l } \Vert \mathbf { b } _ { k l } - \mathbf { c } [ \mathbf { I } _ { k l } ] \Vert _ { 2 } ^ { 2 } .
93
+ $$
94
+
95
+ PQ shares representations between subvectors, which allows for higher compression rates than intN.
96
+
97
+ Iterative PQ. When quantizing a full network rather than a single matrix, extreme compression with PQ induces a quantization drift as reconstruction error accumulates (Stock et al., 2019). Indeed, subsequent layers take as input the output of preceding layers, which are modified by the quantization of the preceding layers. This creates a drift in the network activations, resulting in large losses of performance. A solution proposed by Stock et al. (2019), which we call iterative PQ (iPQ), is to quantize layers sequentially from the lowest to the highest, and finetune the upper layers as the lower layers are quantized, under the supervision of the uncompressed (teacher) model. Codewords of each layer are finetuned by averaging the gradients of their assigned elements with gradient steps:
98
+
99
+ $$
100
+ \mathbf { c } \gets \mathbf { c } - \eta \frac { 1 } { | J _ { \mathbf { c } } | } \sum _ { ( k , l ) \in J _ { \mathbf { c } } } \frac { \partial \mathcal { L } } { \partial \mathbf { b } _ { k l } } ,
101
+ $$
102
+
103
+ where $J _ { \mathbf { c } } = \{ ( k , l ) | \mathbf { c } [ \mathbf { I } _ { k l } ] = \mathbf { c } \}$ , $\mathcal { L }$ is the loss function and $\eta > 0$ is a learning rate. This adapts the upper layers to the drift appearing in their inputs, reducing the impact of the quantization approximation on the overall performance.
104
+
105
+ # 3.3 COMBINING FIXED-POINT WITH PRODUCT QUANTIZATION
106
+
107
+ Fixed-point quantization and Product Quantization are often regarded as competing choices, but can be advantageously combined. Indeed, PQ/iPQ compresses the network by replacing vectors of weights by their assigned centroids, but these centroids are in floating-point precision. Fixed-point quantization compresses both activations and weights to fixed-point representations. Combining both approaches means that the vectors of weights are mapped to centroids that are compressed to fixed-point representations, along with the activations. This benefits from the extreme compression ratio of iPQ and the finite-precision arithmetics of intN quantization.
108
+
109
+ More precisely, for a given matrix, we store the $\dot { \mathtt { 1 } } \mathtt { n t } \mathtt { 8 }$ representation of the $K$ centroids of dimension $d$ along with the $\log _ { 2 } K$ representations of the centroid assignments of the $m \times p$ subvectors. The int8 representation of the centroids is obtained with Eq. (2). The overall storage of the matrix and activations during a forward pass with batch size 1 (recalling that the input dimension is n) writes
110
+
111
+ $$
112
+ M = 8 \times K d + \log _ { 2 } { K } \times m p + 8 \times n \mathrm { b i t s } .
113
+ $$
114
+
115
+ In particular, when $K = 2 5 6$ , the centroid assignments are also stored in int8, which means that every value required for a forward pass is stored in an int8 format. We divide by 4 the float32 overhead of storing the centroids, although the storage requirement associated with the centroids is small compared to the cost of indexing the subvectors for standard networks. In contrast to iPQ alone where we only quantize the weights, we also quantize the activations using int8. We evaluate this approach on both natural language processing and computer vision tasks in Section 5.
116
+
117
+ # 4 METHOD
118
+
119
+ Deep networks are not exposed to the noise caused by the quantization drift during training, leading to suboptimal performance. A solution to make the network robust to quantization is to introduce it during training. Quantization Aware Training (QAT) (Jacob et al., 2018) exposes the network during training by quantizing weights during the forward pass. This transformation is not differentiable and gradients are approximated with a straight through estimator (STE) (Bengio et al., 2013; Courbariaux & Bengio, 2016). STE introduces a bias in the gradients that depends on level of quantization of the weights, and thus, the compression ratio. In this section, we propose a simple modification to control this induced bias with a stochastic amelioration of QAT, called Quant-Noise. The idea is to quantize a randomly selected fraction of the weights instead of the full network as in QAT, leaving some unbiased gradients flow through unquantized weights. Our general formulation can simulate the effect of both quantization and of pruning during training.
120
+
121
+ # 4.1 TRAINING NETWORKS WITH QUANTIZATION NOISE
122
+
123
+ We consider the case of a real matrix W as in Section 3. During the training of a network, our proposed Quant-Noise method works as follows: first, we compute blocks $\mathbf { b } _ { k l }$ related to a target quantization method. Then, during each forward pass, we randomly select a subset of these blocks and apply some distortion to them.
124
+
125
+ More formally, given a set of tuples of indices $J \subset \{ ( k , l ) \}$ for $1 \leq k \leq m$ , $1 \leq l \leq q$ and a distortion or noise function $\varphi$ acting on a block, we define an operator $\psi ( \cdot \mid J )$ such that, for each block $\mathbf { b } _ { k l }$ , we apply the following transformation:
126
+
127
+ $$
128
+ \psi ( \mathbf { b } _ { k l } \mid J ) = { \left\{ \begin{array} { l l } { \varphi ( \mathbf { b } _ { k l } ) } & { { \mathrm { i f ~ } } ( k , l ) \in J , } \\ { \mathbf { b } _ { k l } } & { { \mathrm { o t h e r w i s e } } . } \end{array} \right. }
129
+ $$
130
+
131
+ The noise function $\varphi$ simulates the change in the weights produced by the target quantization method (see Section 4.2 for details). We replace the matrix W by the resulting noisy matrix $\mathbf { W } _ { \mathrm { n o i s e } }$ during the forward pass to compute a noisy output $\mathbf { y } _ { \mathrm { n o i s e } }$ , i.e.,
132
+
133
+ $$
134
+ \mathbf { W } _ { \mathrm { n o i s e } } = ( \psi ( \mathbf { b } _ { k l } \mid J ) ) _ { k l } \mathrm { a n d } \mathbf { y } _ { \mathrm { n o i s e } } = \mathbf { x } \mathbf { W } _ { \mathrm { n o i s e } }
135
+ $$
136
+
137
+ where $\mathbf { x }$ is an input vector. During the backward pass, we apply STE, which amounts to replacing the distorted weights $\mathbf { W _ { \mathrm { n o i s e } } }$ by their non-distorted counterparts. Note that our approach is equivalent to QAT when $J$ containts all the tuples of indices. However, an advantage of Quant-Noise over QAT is that unbiased gradients continue to flow via blocks unaffected by the noise. As these blocks are randomly selected for each forward, we guarantee that each weight regularly sees gradients that are not affected by the nature of the function $\varphi$ . As a side effect, our quantization noise regularizes the network in a similar way as DropConnect (Wan et al., 2013) or LayerDrop (Fan et al., 2019).
138
+
139
+ Composing quantization noises. As noise operators are compositionally commutative, we can make a network robust to a combination of quantization methods by composing their noise operators:
140
+
141
+ $$
142
+ \psi ( \mathbf { b } _ { k l } \mid J ) = \psi _ { 1 } \circ \psi _ { 2 } ( \mathbf { b } _ { k l } \mid J ) .
143
+ $$
144
+
145
+ This property is particularly useful to combine quantization with pruning operators during training, as well as combining scalar quantization with product quantization.
146
+
147
+ # 4.2 ADDING NOISE TO SPECIFIC QUANTIZATION METHODS
148
+
149
+ In this section, we propose several implementations of the noise function $\varphi$ for the quantization methods described in Section 3. We also show how to handle pruning with it.
150
+
151
+ Table 1: Comparison of different quantization schemes with and without Quant-Noise on language modeling and image classification. For language modeling, we train a Transformer on the Wikitext-103 benchmark and report perplexity (PPL) on test. For image classification, we train a EfficientNet-B3 on the ImageNet-1k benchmark and report top-1 accuracy on validation and use our re-implementation of EfficientNet-B3. The original implementation of Tan & Le (2019) achieves an uncompressed Top-1 accuracy of $8 1 . 9 \%$ . For both settings, we report model size in megabyte (MB) and the compression ratio compared to the original model.
152
+
153
+ <table><tr><td>Quantization Scheme</td><td colspan="4">Language Modeling 16-layer Transformer Wikitext-103</td><td colspan="4">Image Classification EfficientNet-B3 ImageNet-1k</td></tr><tr><td></td><td>Size</td><td>Compression</td><td></td><td>PPL</td><td>Size</td><td>Compression</td><td></td><td>Top-1</td></tr><tr><td>Uncompressed model</td><td>942</td><td>×1</td><td></td><td>18.3</td><td>46.7</td><td>×1</td><td></td><td>81.5</td></tr><tr><td>int 4 quantization</td><td>118</td><td>×8</td><td></td><td>39.4</td><td>5.8</td><td>×8</td><td></td><td>45.3</td></tr><tr><td>- trained with QAT</td><td>118</td><td>×8</td><td></td><td>34.1</td><td>5.8</td><td>×8</td><td></td><td>59.4</td></tr><tr><td>- trained with Quant-Noise</td><td>118</td><td>×8</td><td></td><td>21.8</td><td>5.8</td><td>×8</td><td></td><td>67.8</td></tr><tr><td>int 8 quantization</td><td>236</td><td>×4</td><td></td><td>19.6</td><td>11.7</td><td>×4</td><td></td><td>80.7</td></tr><tr><td>- trained with QAT</td><td>236</td><td>×4</td><td></td><td>21.0</td><td>11.7</td><td>×4</td><td></td><td>80.8</td></tr><tr><td>- trained with Quant-Noise</td><td>236</td><td>×4</td><td></td><td>18.7</td><td>11.7</td><td>×4</td><td></td><td>80.9</td></tr><tr><td>iPQ</td><td>38</td><td>×25</td><td></td><td>25.2</td><td>3.3</td><td>×14</td><td></td><td>79.0</td></tr><tr><td>- trained with QAT</td><td>38</td><td>×25</td><td></td><td>41.2</td><td>3.3</td><td>×14</td><td></td><td>55.7</td></tr><tr><td>- trained with Quant-Noise</td><td>38</td><td>×25</td><td></td><td>20.7</td><td>3.3</td><td>×14</td><td></td><td>80.0</td></tr><tr><td>iPQ&amp;int8 +Quant-Noise</td><td>38</td><td>×25</td><td></td><td>21.1</td><td>3.1</td><td>×15</td><td></td><td>79.8</td></tr></table>
154
+
155
+ Fixed-point scalar quantization. In intN quantization, the blocks are atomic and weights are rounded to their nearest neighbor in the codebook. The function $\varphi$ replaces weight ${ \bf W } _ { k l }$ with the output of the rounding function defined in Eq. (2), i.e.,
156
+
157
+ $$
158
+ \varphi _ { \mathrm { i n t N } } ( w ) = ( \mathrm { r o u n d } ( w / s + z ) - z ) \times s ,
159
+ $$
160
+
161
+ where $s$ and $z$ are updated during training. In particular, the application of Quant-Noise to int8 scalar quantization is a stochastic amelioration of QAT.
162
+
163
+ Product quantization. As opposed to intN, codebooks in PQ require a clustering step based on weight values. During training, we learn codewords online and use the resulting centroids to implement the quantization noise. More precisely, the noise function $\varphi _ { \mathrm { P Q } }$ assigns a selected block b to its nearest codeword in the associated codebook $\mathcal { C }$ :
164
+
165
+ $$
166
+ \begin{array} { r } { \varphi _ { \mathrm { P Q } } ( \mathbf { v } ) = \operatorname * { a r g m i n } _ { \mathbf { c } \in \mathcal { C } } \| \mathbf { b } - \mathbf { c } \| _ { 2 } ^ { 2 } . } \end{array}
167
+ $$
168
+
169
+ Updating the codebooks online works well. However, empirically, running $k$ -means once per epoch is faster and does not noticeably modify the resulting accuracy.
170
+
171
+ Note that computing the exact noise function for PQ is computationally demanding. We propose a simpler and faster alternative approximation $\varphi _ { \mathrm { p r o x y } }$ to the operational transformation of PQ and iPQ. The noise function simply zeroes out the subvectors of the selected blocks, i.e., $\varphi _ { \mathrm { p r o x y } } ( \mathbf { v } ) = 0$ . As a sidenote, we considered other alternatives, for instance one where the subvectors are mapped to the mean subvector. In practice, we found that these approximations lead to similar performance, see Section 7.2. This proxy noise function is a form of Structured Dropout and encourages correlations between the subvectors. This correlation is beneficial to the subsequent clustering involved in PQ/iPQ.
172
+
173
+ Adding pruning to the quantization noise. The specific form of quantization noise can be adjusted to incorporate additional noise specific to pruning. We simply combine the noise operators of quantization and pruning by composing them following Eq. (8). We consider the pruning noise function of Fan et al. (2019) where they randomly drop predefined structures during training. In particular, we focus on LayerDrop, where the structures are the residual blocks of highway-like layers (Srivastava et al., 2015), as most modern architectures, such as ResNet or Transformer, are composed of this structure. More precisely, the corresponding noise operator over residual blocks $\mathbf { v }$ is $\dot { \varphi } _ { \mathrm { L a y e r D r o p } } ( \mathbf { v } ) = 0 .$ . For pruning, we do not use STE to backpropagate the gradient of pruned weights, as dropping them entirely during training has the benefit of speeding convergence (Huang et al., 2016). Once a model is trained with LayerDrop, the number of layers kept at inference can be adapted to match computation budget or time constraint.
174
+
175
+ ![](images/fb191eba2d0809d5fb2682e2e7926abb2bbee75ac52ef027ff222f8961c973a6.jpg)
176
+ Figure 2: Performance as a function of model size. We compare models quantized with PQ and trained with the related Quant-Noise to the state of the art. (a) Test perplexity on Wikitext-103 (b) Dev Accuracy on MNLI (c) ImageNet Top-1 accuracy. Model size is shown in megabytes on a log scale. Red and gray coloring indicates existing work, with different colors for visual distinction.
177
+
178
+ Table 2: Decomposing the impact of the different compression schemes. (a) we train Transformers with Adaptive Input and LayerDrop on Wikitext-103 (b) we pre-train RoBERTA base models with LayerDrop and then finetune on MNLI (c) we train an EfficientNet-B3 on ImageNet. We report the compression ratio w.r.t. to the original model (“comp.”) and the resulting size in MB.
179
+
180
+ <table><tr><td rowspan="3"></td><td colspan="4">Language modeling</td><td colspan="4">Sentence Representation</td><td colspan="4">Image Classification</td></tr><tr><td>Comp.</td><td></td><td>Size</td><td>PPL</td><td>Comp.</td><td></td><td>Size</td><td>Acc.</td><td>Comp.</td><td></td><td>Size</td><td>Acc.</td></tr><tr><td>Unquantized models</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Original model</td><td>×1</td><td></td><td>942</td><td>18.3</td><td>×1</td><td></td><td>480</td><td>84.8</td><td>×1</td><td></td><td>46.7</td><td>81.5</td></tr><tr><td>+ Sharing</td><td></td><td>×1.8</td><td>510</td><td>18.7</td><td>×1.9</td><td></td><td>250</td><td>84.0</td><td>×1.4</td><td></td><td>34.2</td><td>80.1</td></tr><tr><td>+ Pruning</td><td></td><td>×3.7</td><td>255</td><td>22.5</td><td>×3.8</td><td></td><td>125</td><td>81.3</td><td>×1.6</td><td></td><td>29.5</td><td>78.5</td></tr><tr><td>Quantized models</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>iPQ</td><td></td><td>×24.8</td><td>38</td><td>25.2</td><td>×12.6</td><td></td><td>38</td><td>82.5</td><td>× 14.1</td><td></td><td>3.3</td><td>79.0</td></tr><tr><td>+ Quant-Noise</td><td></td><td>×24.8</td><td>38</td><td>20.7</td><td>×12.6</td><td></td><td>38</td><td>83.6</td><td>×14.1</td><td></td><td>3.3</td><td>80.0</td></tr><tr><td>+ Sharing</td><td></td><td>× 49.5</td><td>19</td><td>22.0</td><td>×</td><td>34.3</td><td>14</td><td>82.5</td><td></td><td>×18</td><td>2.6</td><td>78.9</td></tr><tr><td>+ Pruning</td><td></td><td>×94.2</td><td>10</td><td>24.7</td><td></td><td>×58.5</td><td>8</td><td>78.8</td><td></td><td>×20</td><td>2.3</td><td>77.8</td></tr></table>
181
+
182
+ # 5 RESULTS
183
+
184
+ We demonstrate the impact of Quant-Noise on the performance of several quantization schemes in a variety of settings (see Appendix - Sec. 7.5).
185
+
186
+ # 5.1 IMPROVING COMPRESSION WITH QUANT-NOISE
187
+
188
+ Quant-Noise is a regularization method that makes networks more robust to the target quantization scheme or combination of quantization schemes during training. We show the impact of Quant-Noise in Table 1 for a variety of quantization methods: int8/int4 and iPQ.
189
+
190
+ We experiment in 2 different settings: a Transformer network trained for language modeling on WikiText-103 and a EfficientNet-B3 convolutional network trained for image classification on ImageNet-1k. Our quantization noise framework is general and flexible — Quant-Noise improves the performance of quantized models for every quantization scheme in both experimental settings. Importantly, Quant-Noise only changes model training by adding a regularization noise similar to dropout, with no impact on convergence and very limited impact on training speed $( < 5 \%$ slower).
191
+
192
+ This comparison of different quantization schemes shows that Quant-Noise works particularly well with high performance quantization methods, like iPQ, where QAT tends to degrade the performances, even compared to quantizing as a post-processing step. In subsequent experiments in this section, we focus on applications with iPQ because it offers the best trade-off between model performance and compression, and has little negative impact on FLOPS.
193
+
194
+ <table><tr><td>Language Modeling</td><td>PPL</td><td>RoBERTa</td><td>Acc.</td></tr><tr><td>Train without Quant-Noise</td><td>25.2</td><td>Train without Quant-Noise</td><td>82.5</td></tr><tr><td>+ Finetune with Quant-Noise</td><td>20.9</td><td>+ Finetune with Quant-Noise</td><td>83.4</td></tr><tr><td>Train with Quant-Noise</td><td>20.7</td><td>Train with Quant-Noise</td><td>83.6</td></tr></table>
195
+
196
+ Table 3: Quant-Noise: Finetuning vs training. We report performance after iPQ quantization. We train with the $\phi _ { \mathrm { p r o x y } }$ noise and finetune with Quant-Noise, and use it during the transfer to MNLI for each RoBERTa model.
197
+
198
+ Fixed-Point Product Quantization. Combining iPQ and int8 as described in Section 3.3 allows us to take advantage of the high compression rate of iPQ with a fixed-point representation of both centroids and activations. As shown in Table 1, this combination incurs little loss in accuracy with respect to $\mathrm { i } \mathrm { P Q } +$ Quant-Noise. Most of the memory footprint of iPQ comes from indexing and not storing centroids, so the compression ratios are comparable.
199
+
200
+ Complementarity with Weight Pruning and Sharing. We analyze how Quant-Noise is compatible and complementary with pruning (“+Prune”) and weight sharing ( $^ { 6 6 } { + } \mathrm { S l }$ hare”), see Appendix for details on weight sharing. We report results for Language modeling on WikiText-103, pre-trained sentence representations on MNLI and object classification on ImageNet-1k in Table 2. The conclusions are remarkably consistent across tasks and benchmarks: Quant-Noise gives a large improvement over strong iPQ baselines. Combining it with sharing and pruning offers additional interesting operating points of performance vs size.
201
+
202
+ # 5.2 COMPARISON WITH THE STATE OF THE ART
203
+
204
+ We now compare our approach on the same tasks against the state of the art. We compare $\mathrm { i } \mathrm { P Q } +$ Quant-Noise with 6 methods of network compression for Language modeling, 8 state-of-the-art methods for Text classification, and 8 recent methods evaluate image classification on Imagenet with compressed models. These comparisons demonstrate that Quant-Noise leads to extreme compression rates at a reasonable cost in accuracy. We apply our best quantization setup on competitive models and reduce their memory footprint by $\times 2 0 - 9 4 $ when combining with weight sharing and pruning, offering extreme compression for good performance.
205
+
206
+ Natural Language Processing. In Figure 2, we examine the trade-off between performance and model size. Our quantized RoBERTa offers a competitive trade-off between size and performance with memory reduction methods dedicated to BERT, like TinyBERT, MobileBERT, or AdaBERT.
207
+
208
+ Image Classification. We compress EfficientNet-B3 from 46.7Mb to $3 . 3 { \mathrm { M b } }$ ( $\times 1 4$ compression) while maintaining high top-1 accuracy $( 7 8 . 5 \%$ versus $8 0 \%$ for the original model). As shown in Figure 2, our quantized EfficientNet-B3 is smaller and more accurate than architectures dedicated to optimize on-device performance with limited size like MobileNet or ShuffleNet. We further evaluate the beneficial effect of Quant-Noise on ResNet-50 to compare directly with Stock et al. (2019). Results shown in Table 4 indicate improvement with Quant-Noise compared to previous work.
209
+
210
+ Incorporating pruning noise into quantization is also beneficial. For example, with pruning $\mathrm { i P Q + }$ Quant-Noise reduces size by $\times 2 5$ with only a drop of $2 . 4 \ : \mathrm { P P L }$ in language modeling. Further, pruning reduces FLOPS by the same ratio as its compression factor, in our case, $\times 2$ . By adding sharing with pruning, in language modeling, we achieve an extreme compression ratio of $\times 9 4$ with a drop of $6 . 4 \ : \mathrm { P P L }$ with FLOPS reduction from pruning entire shared chunks of layers. For comparison, our $1 0 \mathbf { M B }$ model has the same performance as the $5 7 0 \mathrm { M B }$ Transformer-XL base.
211
+
212
+ # 5.3 FINETUNING WITH QUANT-NOISE FOR POST-PROCESSING QUANTIZATION
213
+
214
+ We explore taking existing models and post-processing with Quant-Noise instead of training from scratch. For language modeling, we train for 10 additional epochs. For RoBERTa, we train for $2 5 \mathrm { k }$ additional updates. Finetuning with Quant-Noise incorporates the benefits and almost matches training from scratch (Table 3). In language modeling, there is only a $0 . 2 \ : \mathrm { P P L }$ difference. We further examine how to incorporate Quant-Noise more flexibly into pretraining RoBERTa. We take an already trained RoBERTa model and incorporate Quant-Noise during sentence classification finetuning. This is effective at compressing while retaining accuracy after quantization.
215
+
216
+ # 6 CONCLUSION
217
+
218
+ We show that quantizing a random subset of weights during training maintains performance in the high quantization regime. We validate that Quant-Noise works with a variety of different quantization schemes on several applications in text and vision. Our method can be applied to a combination of iPQ and int8 to benefit from extreme compression ratio and fixed-point arithmetic. Finally, we show that Quant-Noise can be used as a post-processing step to prepare already trained networks for subsequent quantization, to improve the performance of the compressed model.
219
+
220
+ # REFERENCES
221
+
222
+ A. Adcock, V. Reis, M. Singh, Z. Yan, L. van der Maaten, K. Zhang, S. Motwani, J. Guerin, N. Goyal, I. Misra, L. Gustafson, C. Changhan, and P. Goyal. Classy vision. 2019.
223
+ Alexei Baevski and Michael Auli. Adaptive input representations for neural language modeling. arXiv preprint arXiv:1809.10853, 2018.
224
+ Yoshua Bengio, Nicholas Léonard, and Aaron Courville. Estimating or propagating gradients through stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432, 2013.
225
+ James Bradbury, Stephen Merity, Caiming Xiong, and Richard Socher. Quasi-recurrent neural networks. arXiv preprint arXiv:1611.01576, 2016.
226
+ Qingqing Cao, Harsh Trivedi, Aruna Balasubramanian, and Niranjan Balasubramanian. Faster and just as accurate: A simple decomposition for transformer models.
227
+ Miguel A. Carreira-Perpiñán and Yerlan Idelbayev. Model compression as constrained optimization, with application to neural nets. part ii: quantization, 2017.
228
+ Daoyuan Chen, Yaliang Li, Minghui Qiu, Zhen Wang, Bofang Li, Bolin Ding, Hongbo Deng, Jun Huang, Wei Lin, and Jingren Zhou. Adabert: Task-adaptive bert compression with differentiable neural architecture search. arXiv preprint arXiv:2001.04246, 2020.
229
+ Jungwook Choi, Zhuo Wang, Swagath Venkataramani, Pierce I-Jen Chuang, Vijayalakshmi Srinivasan, and Kailash Gopalakrishnan. Pact: Parameterized clipping activation for quantized neural networks. arXiv preprint arXiv:1805.06085, 2018.
230
+ Matthieu Courbariaux and Yoshua Bengio. Binarynet: Training deep neural networks with weights and activations constrained to $+ 1$ or -1. CoRR, 2016.
231
+ Matthieu Courbariaux, Yoshua Bengio, and Jean-Pierre David. Binaryconnect: Training deep neural networks with binary weights during propagations. CoRR, 2015.
232
+ Zihang Dai, Zhilin Yang, Yiming Yang, William W Cohen, Jaime Carbonell, Quoc V Le, and Ruslan Salakhutdinov. Transformer-xl: Attentive language models beyond a fixed-length context. arXiv preprint arXiv:1901.02860, 2019.
233
+ Yann N. Dauphin, Angela Fan, Michael Auli, and David Grangier. Language modeling with gated convolutional networks. In Proc. of ICML, 2017.
234
+ Mostafa Dehghani, Stephan Gouws, Oriol Vinyals, Jakob Uszkoreit, and Łukasz Kaiser. Universal transformers, 2018.
235
+ J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. ImageNet: A Large-Scale Hierarchical Image Database. In CVPR, 2009.
236
+ 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.
237
+
238
+ Yinpeng Dong, Renkun Ni, Jianguo Li, Yurong Chen, Hang Su, and Jun Zhu. Stochastic quantization for learning accurate low-bit deep neural networks. International Journal of Computer Vision, 127 (11-12):1629–1642, 2019.
239
+
240
+ Angela Fan, Edouard Grave, and Armand Joulin. Reducing transformer depth on demand with structured dropout. arXiv preprint arXiv:1909.11556, 2019.
241
+
242
+ Yarin Gal and Zoubin Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In international conference on machine learning, pp. 1050–1059, 2016.
243
+
244
+ Yunchao Gong, Liu Liu, Ming Yang, and Lubomir Bourdev. Compressing deep convolutional networks using vector quantization. arXiv preprint arXiv:1412.6115, 2014.
245
+
246
+ Edouard Grave, Armand Joulin, Moustapha Cisse, David Grangier, and Herve Jegou. Efficient softmax approximation for gpus. arXiv, abs/1609.04309, 2016.
247
+
248
+ Suyog Gupta, Ankur Agrawal, Kailash Gopalakrishnan, and Pritish Narayanan. Deep learning with limited numerical precision. In ICML, 2015.
249
+
250
+ Song Han, Jeff Pool, John Tran, and William Dally. Learning both weights and connections for efficient neural network. In NIPS, pp. 1135–1143, 2015.
251
+
252
+ Song Han, Huizi Mao, and William J. Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and Huffman coding. ICLR, 2016.
253
+
254
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. CoRR, 2015.
255
+
256
+ Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
257
+
258
+ Andrew Howard, Mark Sandler, Grace Chu, Liang-Chieh Chen, Bo Chen, Mingxing Tan, Weijun Wang, Yukun Zhu, Ruoming Pang, Vijay Vasudevan, Quoc V. Le, and Hartwig Adam. Searching for mobilenetv3. arXiv e-prints, 2019.
259
+
260
+ Gao Huang, Yu Sun, Zhuang Liu, Daniel Sedra, and Kilian Q Weinberger. Deep networks with stochastic depth. In ECCV, 2016.
261
+
262
+ Gao Huang, Shichen Liu, Laurens Van der Maaten, and Kilian Q Weinberger. Condensenet: An efficient densenet using learned group convolutions. In CVPR, 2018.
263
+
264
+ Benoit Jacob, Skirmantas Kligys, Bo Chen, Menglong Zhu, Matthew Tang, Andrew Howard, Hartwig Adam, and Dmitry Kalenichenko. Quantization and training of neural networks for efficient integer-arithmetic-only inference. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2704–2713, 2018.
265
+
266
+ Herve Jegou, Matthijs Douze, and Cordelia Schmid. Product quantization for nearest neighbor search. PAMI, 2011.
267
+
268
+ Xiaoqi Jiao, Yichun Yin, Lifeng Shang, Xin Jiang, Xiao Chen, Linlin Li, Fang Wang, and Qun Liu. Tinybert: Distilling bert for natural language understanding. arXiv preprint arXiv:1909.10351, 2019.
269
+
270
+ Armand Joulin, Edouard Grave, Piotr Bojanowski, Matthijs Douze, Hérve Jégou, and Tomas Mikolov. Fasttext.zip: Compressing text classification models. arXiv preprint arXiv:1612.03651, 2016.
271
+
272
+ Raghuraman Krishnamoorthi. Quantizing deep convolutional networks for efficient inference: A whitepaper. arXiv preprint arXiv:1806.08342, 2018.
273
+
274
+ Guillaume Lample and Alexis Conneau. Cross-lingual language model pretraining. arXiv preprint arXiv:1901.07291, 2019.
275
+
276
+ Zhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, and Radu Soricut. Albert: A lite bert for self-supervised learning of language representations, 2019.
277
+
278
+ Yann LeCun, John S. Denker, and Sara A. Solla. Optimal brain damage. In NIPS, 1990.
279
+
280
+ Hao Li, Asim Kadav, Igor Durdanovic, Hanan Samet, and Hans Peter Graf. Pruning filters for efficient convnets. arXiv preprint arXiv:1608.08710, 2016.
281
+
282
+ Yuhang Li, Xin Dong, and Wei Wang. Additive powers-of-two quantization: A non-uniform discretization for neural networks. arXiv preprint arXiv:1909.13144, 2019.
283
+
284
+ Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692, 2019.
285
+
286
+ Zhuang Liu, Mingjie Sun, Tinghui Zhou, Gao Huang, and Trevor Darrell. Rethinking the value of network pruning. arXiv preprint arXiv:1810.05270, 2018.
287
+
288
+ Ilya Loshchilov and Frank Hutter. Sgdr: Stochastic gradient descent with warm restarts. arXiv preprint arXiv:1608.03983, 2016.
289
+
290
+ Christos Louizos, Max Welling, and Diederik P Kingma. Learning sparse neural networks through l_0 regularization. arXiv preprint arXiv:1712.01312, 2017.
291
+
292
+ Jian-Hao Luo, Jianxin Wu, and Weiyao Lin. Thinet: A filter level pruning method for deep neural network compression. In ICCV, 2017.
293
+
294
+ Ningning Ma, Xiangyu Zhang, Hai-Tao Zheng, and Jian Sun. Shufflenet V2: practical guidelines for efficient CNN architecture design. CoRR, 2018.
295
+
296
+ Xindian Ma, Peng Zhang, Shuai Zhang, Nan Duan, Yuexian Hou, Dawei Song, and Ming Zhou. A tensorized transformer for language modeling. arXiv preprint arXiv:1906.09777, 2019.
297
+
298
+ Mark D. McDonnell. Training wide residual networks for deployment using a single bit for each weight, 2018.
299
+
300
+ Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer Sentinel Mixture Models. arXiv, abs/1609.07843, 2016.
301
+
302
+ Deepak Mittal, Shweta Bhardwaj, Mitesh M Khapra, and Balaraman Ravindran. Recovering from random pruning: On the plasticity of deep convolutional neural networks. In WACV, 2018.
303
+
304
+ Dmitry Molchanov, Arsenii Ashukha, and Dmitry Vetrov. Variational dropout sparsifies deep neural networks. In ICML, 2017.
305
+
306
+ Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. fairseq: A fast, extensible toolkit for sequence modeling. In Proceedings of NAACL-HLT 2019: Demonstrations, 2019.
307
+
308
+ Razvan Pascanu, Caglar Gulcehre, Kyunghyun Cho, and Yoshua Bengio. How to construct deep recurrent neural networks. In Proceedings of the Second International Conference on Learning Representations (ICLR 2014), 2014.
309
+
310
+ 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.
311
+
312
+ Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. 2019.
313
+
314
+ Jack W Rae, Anna Potapenko, Siddhant M Jayakumar, and Timothy P Lillicrap. Compressive transformers for long-range sequence modelling. arXiv preprint arXiv:1911.05507, 2019.
315
+
316
+ Mohammad Rastegari, Vicente Ordonez, Joseph Redmon, and Ali Farhadi. Xnor-net: Imagenet classification using binary convolutional neural networks. In ECCV, 2016.
317
+
318
+ Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. Mobilenetv2: Inverted residuals and linear bottlenecks. In Conference on Computer Vision and Pattern Recognition, pp. 4510–4520, 2018.
319
+
320
+ Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter. 2019a.
321
+
322
+ Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter. arXiv preprint arXiv:1910.01108, 2019b.
323
+
324
+ Rupesh Kumar Srivastava, Klaus Greff, and Jürgen Schmidhuber. Highway networks. arXiv preprint arXiv:1505.00387, 2015.
325
+
326
+ Pierre Stock, Armand Joulin, Rémi Gribonval, Benjamin Graham, and Hervé Jégou. And the bit goes down: Revisiting the quantization of neural networks. CoRR, abs/1907.05686, 2019.
327
+
328
+ Sainbayar Sukhbaatar, Edouard Grave, Piotr Bojanowski, and Armand Joulin. Adaptive attention span in transformers. arXiv preprint arXiv:1905.07799, 2019a.
329
+
330
+ Sainbayar Sukhbaatar, Edouard Grave, Guillaume Lample, Herve Jegou, and Armand Joulin. Augmenting self-attention with persistent memory. arXiv preprint arXiv:1907.01470, 2019b.
331
+
332
+ Siqi Sun, Yu Cheng, Zhe Gan, and Jingjing Liu. Patient knowledge distillation for bert model compression. EMNLP, 2019.
333
+
334
+ Zhiqing Sun, Hongkun Yu, Xiaodan Song, Renjie Liu, Yiming Yang, and Denny Zhou. Mobilebert: Task-agnostic compression of bert for resource limited devices.
335
+
336
+ Ilya Sutskever, James Martens, George Dahl, and Geoffrey Hinton. On the importance of initialization and momentum in deep learning. In International conference on machine learning, pp. 1139–1147, 2013.
337
+
338
+ Mingxing Tan and Quoc V. Le. Efficientnet: Rethinking model scaling for convolutional neural networks, 2019.
339
+
340
+ Iulia Turc, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Well-read students learn better: The impact of student initialization on knowledge distillation. arXiv preprint arXiv:1908.08962, 2019.
341
+
342
+ Vincent Vanhoucke, Andrew Senior, and Mark Z Mao. Improving the speed of neural networks on cpus. 2011.
343
+
344
+ Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NIPS, 2017.
345
+
346
+ Li Wan, Matthew Zeiler, Sixin Zhang, Yann Le Cun, and Rob Fergus. Regularization of neural networks using DropConnect. In ICML, 2013.
347
+
348
+ Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. GLUE: A multi-task benchmark and analysis platform for natural language understanding. 2019. ICLR.
349
+
350
+ Kuan Wang, Zhijian Liu, Yujun Lin andx Ji Lin, and Song Han. HAQ: hardware-aware automated quantization. CoRR, 2018.
351
+
352
+ Adina Williams, Nikita Nangia, and Samuel R. Bowman. A broad-coverage challenge corpus for sentence understanding through inference. In Proceedings of NAACL-HLT, 2018.
353
+
354
+ Felix Wu, Angela Fan, Alexei Baevski, Yann Dauphin, and Michael Auli. Pay less attention with lightweight and dynamic convolutions. In ICLR, 2019.
355
+
356
+ Biao Zhang, Deyi Xiong, and Jinsong Su. Accelerating neural transformer via an average attention network. arXiv preprint arXiv:1805.00631, 2018.
357
+
358
+ Xiangyu Zhang, Xinyu Zhou, Mengxiao Lin, and Jian Sun. Shufflenet: An extremely efficient convolutional neural network for mobile devices. CoRR, 2017.
359
+
360
+ Sanqiang Zhao, Raghav Gupta, Yang Song, and Denny Zhou. Extreme language model compression with optimal subwords and shared projections. arXiv preprint arXiv:1909.11687, 2019.
361
+
362
+ <table><tr><td> Setting</td><td>Model</td><td>Compression</td><td>Top-1 Accuracy</td></tr><tr><td rowspan="2">Small Blocks</td><td>Stock et al. (2019)</td><td>19x</td><td>73.8</td></tr><tr><td>Quant-Noise</td><td>19x</td><td>74.3</td></tr><tr><td rowspan="2">Large Blocks</td><td>Stock et al. (2019)</td><td>32x</td><td>68.2</td></tr><tr><td>Quant-Noise</td><td>32x</td><td>68.8</td></tr></table>
363
+
364
+ ![](images/ba35cf41421a36478cb5c76c461ca17166f7ed7e069174cbe097a3f7e7e6cbf8.jpg)
365
+ Table 4: Compression of ResNet-50 with Quant-Noise. We compare to Stock et al. (2019) in both the small and large blocks regime. For fair comparison, we hold the compression rate constant. Quant-Noise provides improved performance in both settings.
366
+ Figure 3: Effect of Quantization Parameters. We report the influence of the proportion of blocks to which we apply the noise. We focus on Transformer for Wikitext-103 language modeling. We explore two settings: iPQ and int8. For iPQ, we use $\varphi _ { \mathrm { p r o x y } }$ .
367
+
368
+ # 7 APPENDIX
369
+
370
+ # 7.1 QUANTIZATION OF ADDITIONAL ARCHITECTURES
371
+
372
+ ResNet-50. We explore the compression of ResNet-50, a standard architecture used Computer Vision. In Table 4, we compare Quant-Noise to iPQ Compression from Stock et al. (2019) and show that Quant-Noise provide consistent additional improvement.
373
+
374
+ # 7.2 ABLATIONS
375
+
376
+ In this section, we examine the impact of the level of noise during training as well as the impact of approximating iPQ during training.
377
+
378
+ # 7.3 IMPACT OF NOISE RATE
379
+
380
+ We analyze the performance for various values of Quant-Noise in Figure 3 on a Transformer for language modeling. For iPQ, performance is impacted by high rates of quantization noise. For example, a Transformer with the noise function $\varphi _ { \mathrm { p r o x y } }$ degrades with rate higher than 0.5, i.e., when half of the weights are passed through the noise function $\varphi _ { \mathrm { p r o x y } }$ . We hypothesize that for large quantities of noise, a larger effect of using proxy rather than the exact PQ noise is observed. For int8 quantization and its noise function, higher rates of noise are slightly worse but not as severe. A rate of 1 for int8 quantization is equivalent to the Quantization Aware Training of (Krishnamoorthi, 2018), as the full matrix is quantized with STE, showing the potential benefit of partial quantization during training.
381
+
382
+ # 7.4 IMPACT OF APPROXIMATING THE NOISE FUNCTION
383
+
384
+ We study the impact of approximating quantization noise during training. We focus on the case of iPQ with the approximation described in Section 4.2. In Table 5, we compare the correct noise function for iPQ with its approximation $\varphi _ { \mathrm { p r o x y } }$ . This approximate noise function does not consider cluster assignments or centroid values and simply zeroes out the selected blocks. For completeness, we include an intermediate approximation where we consider cluster assignments to apply noise within each cluster, but still zero-out the vectors. These approximations do not affect the performance of the quantized models. This suggests that increasing the correlation between subvectors that are jointly clustered is enough to maintain the performance of a model quantized with iPQ. Since PQ tends to work well on highly correlated vectors, such as activations in convolutional networks, this is not surprising. Using the approximation $\varphi _ { \mathrm { p r o x y } }$ presents the advantage of speed and practicality. Indeed, one does not need to compute cluster assignments and centroids for every layer in the network after each epoch. Moreover, the approach $\varphi _ { \mathrm { p r o x y } }$ is less involved in terms of code.
385
+
386
+ Table 5: Exact versus proxy noise function for different block selections with iPQ. We compare exact $\phi _ { \mathrm { P Q } }$ and the approximation $\phi _ { \mathrm { p r o x y } }$ with blocks selected from all subvectors or subvectors from the same cluster.
387
+
388
+ <table><tr><td>Noise</td><td>Blocks</td><td>PPL</td><td>Quant PPL</td></tr><tr><td>PQ</td><td>Subvectors</td><td>18.3</td><td>21.1</td></tr><tr><td>PQ</td><td>Clusters</td><td>18.3</td><td>21.2</td></tr><tr><td>proxy</td><td>Subvectors</td><td>18.3</td><td>21.0</td></tr><tr><td>proxy</td><td>Clusters</td><td>18.4</td><td>21.1</td></tr></table>
389
+
390
+ # 7.5 EXPERIMENTAL SETTING
391
+
392
+ We assess the effectiveness of Quant-Noise on competitive language and vision benchmarks. We consider Transformers for language modeling, RoBERTa for pre-training sentence representations, and EfficientNet for image classification. Our models are implemented in PyTorch (Paszke et al., 2017). We use fairseq (Ott et al., 2019) for language modeling and pre-training for sentence representation tasks and Classy Vision (Adcock et al., 2019) for EfficientNet.
393
+
394
+ Language Modeling. We experiment on the Wikitext-103 benchmark (Merity et al., 2016) that contains 100M tokens and a vocabulary of 260k words. We train a 16 layer Transformer following Baevski & Auli (2018) with a LayerDrop rate of 0.2 (Fan et al., 2019). We report perplexity (PPL) on the test set.
395
+
396
+ Pre-Training of Sentence Representations. We pre-train the base BERT model (Devlin et al., 2018) on the BooksCorpus $^ +$ Wiki dataset with a LayerDrop rate of 0.2. We finetune the pre-trained models on the MNLI task (Williams et al., 2018) from the GLUE Benchmark (Wang et al., 2019) and report accuracy. We follow the parameters in Liu et al. (2019) training and finetuning.
397
+
398
+ Image Classification. We train an EfficientNet-B3 model (Tan & Le, 2019) on the ImageNet object classification benchmark (Deng et al., 2009). The EfficientNet-B3 of Classy Vision achieves a Top-1 accuracy of $8 1 . 5 \%$ , which is slightly below than the performance of $8 1 . 9 \%$ reported by Tan & Le (2019).
399
+
400
+ # 7.6 TRAINING DETAILS
401
+
402
+ Language Modeling To handle the large vocabulary of Wikitext-103, we follow (Dauphin et al., 2017) and (Baevski & Auli, 2018) in using adaptive softmax (Grave et al., 2016) and adaptive input for computational efficiency. For both input and output embeddings, we use dimension size 1024 and three adaptive bands: 20K, 40K, and 200K. We use a cosine learning rate schedule (Baevski & Auli, 2018; Loshchilov & Hutter, 2016) and train with Nesterov’s accelerated gradient (Sutskever et al., 2013). We set the momentum to 0.99 and renormalize gradients if the norm exceeds 0.1 (Pascanu et al., 2014). During training, we partition the data into blocks of contiguous tokens that ignore document boundaries. At test time, we respect sentence boundaries. We set LayerDrop to 0.2. We set Quant-Noise value to 0.05. During training time, we searched over the parameters (0.05, 0.1, 0.2) to determine the optimal value of Quant-Noise. During training time, the block size of Quant-Noise is 8.
403
+
404
+ RoBERTa The base architecture is a 12 layer model with embedding size 768 and FFN size 3072. We follow (Liu et al., 2019) in using the subword tokenization scheme from (Radford et al., 2019), which uses bytes as subword units. This eliminates unknown tokens. We train with large batches of size 8192 and maintain this batch size using gradient accumulation. We do not use next sentence prediction (Lample & Conneau, 2019). We optimize with Adam with a polynomial decay learning rate schedule. We set LayerDrop to 0.2. We set Quant-Noise value to 0.1. We did not hyperparameter
405
+
406
+ <table><tr><td>Model</td><td>MB</td><td>PPL</td></tr><tr><td>Trans XL Large (Dai et al., 2019) Compressive Trans (Rae et al.,2019) GCNN (Dauphin et al., 2017) 4 Layer QRNN (Bradbury et al., 2016)</td><td>970 970 870</td><td>18.3 17.1 37.2 33.0</td></tr><tr><td>Trans XL Base (Dai et al.,2019) Persis Mem (Sukhbaatar etal.,2019b) Tensorized core-2 (Ma et al.,2019)</td><td>570 506 325</td><td>24.0 20.6</td></tr><tr><td></td><td></td><td>18.9</td></tr><tr><td>Quant-Noise</td><td>38</td><td>20.7</td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td>Quant-Noise + Share + Prune</td><td></td><td></td></tr><tr><td></td><td>10</td><td></td></tr><tr><td></td><td></td><td>24.2</td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr></table>
407
+
408
+ Table 6: Performance on Wikitext-103. We report test set perplexity and model size in megabytes.
409
+ Lower perplexity is better.
410
+
411
+ search to determine the optimal value of Quant-Noise as training RoBERTa is computationally intensive. During training time, the block size of Quant-Noise is 8.
412
+
413
+ During finetuning, we hyperparameter search over three learning rate options (1e-5, 2e-5, 3e-5) and batchsize (16 or 32 sentences). The other parameters are set following (Liu et al., 2019). We do single task finetuning, meaning we only tune on the data provided for the given natural language understanding task. We do not perform ensembling. When finetuning models trained with LayerDrop, we apply LayerDrop and Quant-Noise during finetuning time as well.
414
+
415
+ EfficientNet We use the architecture of EfficientNet-B3 defined in Classy Vision (Adcock et al., 2019) and follow the default hyperparameters for training. We set Quant-Noise value to 0.1. During training time, we searched over the parameters (0.05, 0.1, 0.2) to determine the optimal value of Quant-Noise. During training time, the block size of Quant-Noise is set to 4 for all $1 \times 1$ convolutions, 9 for depth-wise $3 \times 3$ convolutions, 5 for depth-wise $5 \times 5$ convolutions and 4 for the classifier. For sharing, we shared weights between blocks 9-10, 11-12, 14-15, 16-17, 19-20-21, 22-23 and refer to blocks that share the same weights as a chunk. For LayerDrop, we drop the chunks of blocks defined previously with probability 0.2 and evaluate only with chunks 9-10, 14-15 and 19-20-21.
416
+
417
+ # 7.7 SCALAR QUANTIZATION DETAILS
418
+
419
+ We closely follow the methodology of PyTorch 1.4. We emulate scalar quantization by quantizing the weights and the activations. The scales and zero points of activations are determined by doing a few forward passes ahead of the evaluation and then fixed. We use the Histogram method to compute $s$ and $z$ , which aims at approximately minimizing the $L _ { 2 }$ quantization error by adjusting $s$ and $z$ . This scheme is a refinement of the MinMax scheme. Per channel quantization is also discussed in Table 10.
420
+
421
+ # 7.8 IPQ QUANTIZATION DETAILS
422
+
423
+ Language Modeling We quantize FFN with block size 8, embeddings with block size 8, and attention with block size 4. We tuned the block size for attention between the values (4, 8) to find the best performance. Note that during training with apply Quant-Noise to all the layers.
424
+
425
+ RoBERTa We quantize FFN with block size 4, embeddings with block size 4, and attention with block size 4. We tuned the block size between the values (4, 8) to find the best performance. Note that during training with apply Quant-Noise to all the layers.
426
+
427
+ EfficientNet We quantize blocks sequentially and end up with the classifier. The block sizes are 4 for all $1 \times 1$ convolutions, 9 for depth-wise $3 \times 3$ convolutions, 5 for depth-wise $5 \times 5$ convolutions and 4 for the classifier. Note that during training with apply Quant-Noise to all the weights in InvertedResidual Blocks (except the Squeeze-Excitation subblocks), the head convolution and the classifier.
428
+
429
+ Table 7: Performance on MNLI. We report accuracy and size in megabytes. \* indicates distillation using BERT Large. $\dagger$ indicates training with data augmentation. Work from Sun et al. (2019) and Zhao et al. (2019) do not report results on the dev set. Cao et al. do not report model size. Higher accuracy is better.
430
+
431
+ <table><tr><td>Model</td><td>MB</td><td>MNLI</td></tr><tr><td>RoBERTa Base +LD (Fan et al., 2019)</td><td>480</td><td>84.8</td></tr><tr><td>BERT Base (Devlin et al.,2018)</td><td>420</td><td>84.4</td></tr><tr><td>PreTrained Distil (Turc et al., 2019)</td><td>257</td><td>82.5</td></tr><tr><td>DistilBERT (Sanh et al.,2019b)</td><td>250</td><td>81.8</td></tr><tr><td>MobileBERT* (Sun et al.)</td><td>96</td><td>84.4</td></tr><tr><td>TinyBERTt (Jiao et al.,2019)</td><td>55</td><td>82.8</td></tr><tr><td>ALBERT Base (Lan et al.,2019)</td><td>45</td><td>81.6</td></tr><tr><td>AdaBERTt (Chen et al.,2020)</td><td>36</td><td>81.6</td></tr><tr><td>Quant-Noise</td><td>38</td><td>83.6</td></tr><tr><td>Quant-Noise+ Share +Prune</td><td>14</td><td>82.5</td></tr></table>
432
+
433
+ Table 8: Performance on ImageNet. We report accuracy and size in megabytes. Higher accuracy is better.
434
+
435
+ <table><tr><td>Model</td><td>MB</td><td>Acc.</td></tr><tr><td>EfficientNet-B7 (Tan &amp;Le,2019) ResNet-50 (He et al., 2015) DenseNet-169 (Huang et al., 2018) EfficientNet-BO (Tan &amp;Le,2019) MobileNet-v2 (Sandler et al., 2018)</td><td>260 97.5 53.4 20.2 13.4</td><td>84.4 76.1 76.2 77.3 71.9</td></tr><tr><td>Shufflenet-v2 ×1 (Ma et al.,2018) HAQ 4 bits (Wang et al., 2018) iPQ ResNet-50 (Stock et al.,2019)</td><td>8.7 12.4</td><td>69.4 76.2</td></tr><tr><td>Quant-Noise</td><td>5.09 3.3</td><td>76.1 80.0</td></tr><tr><td>Quant-Noise + Share + Prune</td><td>2.3</td><td>77.8</td></tr></table>
436
+
437
+ # 7.9 DETAILS OF PRUNING AND LAYER SHARING
438
+
439
+ We apply the Every Other Layer strategy from Fan et al. (2019). When combining layer sharing with pruning, we train models with shared layers and then prune chunks of shared layers. When sharing layers, the weights of adjacent layers are shared in chunks of two. For a concrete example, imagine we have a model with layers A, B, C, D, E, F, G, H. We share layers A and B, C and D, E and F, G and H. To prune, every other chunk would be pruned away, for example we could prune A, B, E, F.
440
+
441
+ # 7.10 NUMERICAL RESULTS FOR GRAPHICAL DIAGRAMS
442
+
443
+ We report the numerical values displayed in Figures 2 in Table 6 for language modeling, Table 7 for BERT, and Table 8 for ImageNet.
444
+
445
+ # 7.11 FURTHER ABLATIONS
446
+
447
+ # 7.11.1 IMPACT OF QUANT-NOISE FOR THE VISION SETUP
448
+
449
+ We provide another study showing the impact of the proportion of elements on which to apply Quant-Noise in Table 9.
450
+
451
+ # 7.11.2 IMPACT OF THE NUMBER OF CENTROIDS
452
+
453
+ We quantize with 256 centroids which represents a balance between size and representation capacity. The effect of the number of centroids on performance and size is shown in Figure 4 (a). Quantizing
454
+
455
+ <table><tr><td>p</td><td>0</td><td>0.2</td><td>0.4</td><td>0.6</td><td>0.8</td><td>1</td></tr><tr><td>Top-1</td><td>80.66</td><td>80.83</td><td>80.82</td><td>80.88</td><td>80.92</td><td>80.64</td></tr></table>
456
+
457
+ Table 9: Effect of Quantization Parameters. We report the influence of the Quant-Noise rate $p$ with Scalar Quantization (int8). We focus on EfficientNet for ImageNet classification.
458
+
459
+ ![](images/cf825d2cf66ad807058d5706153a322d0dca0137253c54a0e00ac009d8f56a9a.jpg)
460
+ Figure 4: Quantizing with a larger number of centroids. Results are shown on Wikitext-103 valid.
461
+
462
+ with more centroids improves perplexity — this parameter could be adjusted based on the practical storage constraints.
463
+
464
+ # 7.11.3 EFFECT OF INITIAL MODEL SIZE
465
+
466
+ Large, overparameterized models are more easily compressed. In Figure 5, we explore quantizing both shallower and skinnier models. For shallow models, the gap between quantized and non-quantized perplexity does not increase as layers are removed (Figure 5, left). In contrast, there is a larger gap in performance for models with smaller FFN (Figure 5, right). As the FFN size decreases, the weights are less redundant and more difficult to quantize with iPQ.
467
+
468
+ # 7.11.4 DIFFICULTY OF QUANTIZING DIFFERENT MODEL STRUCTURES
469
+
470
+ Quantization is applied to various portions of the Transformer architecture — the embedding, attention, feedforward, and classifier output. We compare the quantizability of various portions of the network in this section.
471
+
472
+ Is the order of structures important? We quantize specific network structures first — this is important as quantizing weight matrices can accumulate reconstruction error. Some structures of the network should be quantized last so the finetuning process can better adjust the centroids. We find that there are small variations in performance based on quantization order (see Figure 6). We choose to quantize FFN, then embeddings, and finally the attention matrices in Transformer networks.
473
+
474
+ Which structures can be compressed the most? Finally, we analyze which network structures can be most compressed. During quantization, various matrix block sizes can be chosen as a parameter — the larger the block size, the more compression, but also the larger the potential reduction of performance. Thus, it is important to understand how much each network structure can be compressed to reduce the memory footprint of the final model as much as possible. In Figure 6, we quantize two model structures with a fixed block size and vary the block size of the third between 4 and 32. As shown, the FFN and embedding structures are more robust to aggressive compression, while the attention drastically loses performance as larger block sizes are used.
475
+
476
+ # 7.11.5 APPROACH TO I N TN SCALAR QUANTIZATION
477
+
478
+ We compare quantizing per-channel to using a histogram quantizer in Table 10. The histogram quantizer maintains a running min/max and minimizes L2 distance between quantized and nonquantized values to find the optimal min/max. Quantizing per channel learns scales and offsets as vectors along the channel dimension, which provides more flexibility since scales and offsets can be different.
479
+
480
+ ![](images/89d51efee35f6dc30bb5ffaa4bb5b370bcc344263f7bf64ce5139ec44a66a0da.jpg)
481
+ Figure 5: (a) Effect of Initial Model Size for more shallow models (b) Effect of Initial Model Size more skinny models
482
+
483
+ ![](images/8012673edf3e43ed6c0eaae7f98a58780eb2aa1fbaa3915613839ed665d88982.jpg)
484
+ Figure 6: Effect of Quantization on Model Structures. Results are shown on the validation set of Wikitext-103. (a) Quantizing Attention, FFN, and Embeddings in different order. (b) More Extreme compression of different structures.
485
+
486
+ # 7.11.6 LAYERDROP WITH STE
487
+
488
+ For quantization noise, we apply the straight through estimator (STE) to remaining weights in the backward pass. We experiment with applying STE to the backward pass of LayerDrop’s pruning noise. Results are shown in Table 11 and find slightly worse results.
489
+
490
+ Table 10: Comparison of different approaches to int4 and int8 with and without QuantNoise on language modeling and image classification. For language modeling, we train a Transformer on the Wikitext-103 benchmark. We report perplexity (PPL) on the test set. For image classification, we train a EfficientNet-B3 on the ImageNet-1K benchmark. We report top-1 accuracy on the validation set. For both setting, we also report model size in megabyte (MB) and the compression ratio compared to the original model.
491
+
492
+ <table><tr><td>Quantization Scheme</td><td colspan="3">Language Modeling 16-layer Transformer Wikitext-103</td><td colspan="3">Image Classification EfficientNet-B3 ImageNet-1K</td></tr><tr><td></td><td>Size</td><td>Compress</td><td>Test PPL</td><td>Size</td><td>Compress</td><td>Top-1 Acc.</td></tr><tr><td>Uncompressed model</td><td>942</td><td>×1</td><td>18.3</td><td>46.7</td><td>×1</td><td>81.5</td></tr><tr><td>Int4 Quant Histogram</td><td>118</td><td>×8</td><td>39.4</td><td>5.8</td><td>×8</td><td>45.3</td></tr><tr><td>+ Quant-Noise</td><td>118</td><td>×8</td><td>21.8</td><td>5.8</td><td>×8</td><td>67.8</td></tr><tr><td>Int4 Quant Channel</td><td>118</td><td>×8</td><td>21.2</td><td>5.8</td><td>×8</td><td>68.2</td></tr><tr><td>+ Quant-Noise</td><td>118</td><td>×8</td><td>19.5</td><td>5.8</td><td>×8</td><td>72.3</td></tr><tr><td>Int8 Quant Histogram</td><td>236</td><td>×4</td><td>19.6</td><td>11.7</td><td>×4</td><td>80.7</td></tr><tr><td>+ Quant-Noise</td><td>236</td><td>×4</td><td>18.7</td><td>11.7</td><td>×4</td><td>80.9</td></tr><tr><td>Int8 Quant Channel</td><td>236</td><td>×4</td><td>18.5</td><td>11.7</td><td>×4</td><td>81.1</td></tr><tr><td>+ Quant-Noise</td><td>236</td><td>×4</td><td>18.3</td><td>11.7</td><td>×4</td><td>81.2</td></tr></table>
493
+
494
+ Table 11: Performance on Wikitext-103 when using STE in the backward pass of the LayerDrop pruning noise.
495
+
496
+ <table><tr><td>Model</td><td>MB</td><td>PPL</td></tr><tr><td>Quant-Noise + Share + Prune</td><td>10</td><td>24.2</td></tr><tr><td>Quant-Noise + Share + Prune with STE</td><td>10</td><td>24.5</td></tr></table>
md/train/eEn8KTtJOx/eEn8KTtJOx.md ADDED
@@ -0,0 +1,398 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # WANET – IMPERCEPTIBLE WARPING-BASED BACKDOOR ATTACK
2
+
3
+ Anh Tuan Nguyen1,2, Anh Tuan Tran1,3
4
+ 1VinAI Research, 2Hanoi University of Science and Technology, 3VinUniversity
5
+ {v.anhnt479,v.anhtt152}@vinai.io
6
+
7
+ # ABSTRACT
8
+
9
+ With the thriving of deep learning and the widespread practice of using pretrained networks, backdoor attacks have become an increasing security threat drawing many research interests in recent years. A third-party model can be poisoned in training to work well in normal conditions but behave maliciously when a trigger pattern appears. However, the existing backdoor attacks are all built on noise perturbation triggers, making them noticeable to humans. In this paper, we instead propose using warping-based triggers. The proposed backdoor outperforms the previous methods in a human inspection test by a wide margin, proving its stealthiness. To make such models undetectable by machine defenders, we propose a novel training mode, called the “noise” mode. The trained networks successfully attack and bypass the state of the art defense methods on standard classification datasets, including MNIST, CIFAR-10, GTSRB, and CelebA. Behavior analyses show that our backdoors are transparent to network inspection, further proving this novel attack mechanism’s efficiency. Our code is publicly available at https://github.com/VinAIResearch/ Warping-based_Backdoor_Attack-release.
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ Deep learning models are essential in many modern systems due to their superior performance compared to classical methods. Most state-of-the-art models, however, require expensive hardware, huge training data, and long training time. Hence, instead of training the models from scratch, it is a common practice to use pre-trained networks provided by third-parties these days. This poses a serious security threat of backdoor attack (Gu et al., 2017). A backdoor model is a network poisoned either at training or finetuning. It can work as a genuine model in the normal condition. However, when a specific trigger appears in the input, the model will act maliciously, as designed by the attacker. Backdoor attack can occur in various tasks, including image recognition (Chen et al., 2017), speech recognition (Liu et al., 2018b), natural language processing (Dai et al., 2019), and reinforcement learning (Hamon et al., 2020). In this paper, we will focus on image classification, the most popular attacking target with possible fatal consequences (e.g., for self-driving car).
14
+
15
+ Since introduced, backdoor attack has drawn a lot of research interests (Chen et al., 2017; Liu et al., 2018b; Salem et al., 2020; Nguyen & Tran, 2020). In most of these works, trigger patterns are based on patch perturbation or image blending. Recent papers have proposed novel patterns such as sinusoidal strips (Barni et al., 2019), and reflectance (Liu et al., 2020). These backdoor triggers, however, are unnatural and can be easily spotted by humans.
16
+
17
+ We believe that the added content, such as noise, strips, or reflectance, causes the backdoor samples generated by the previous methods strikingly detectable. Instead, we propose to use image warping that can deform but preserve image content. We also found that humans are not good at recognizing subtle image warping, while machines are excellent in this task.
18
+
19
+ Hence, in this paper, we design a novel, simple, but effective backdoor attack based on image warping called WaNet. We use a small and smooth warping field in generating backdoor images, making the modification unnoticeable, as illustrated in Fig. 1. Our backdoor images are natural and hard to be distinguished from the genuine examples, confirmed by our user study described in Sec. 4.3.
20
+
21
+ ![](images/ff3c3082a77419286dd5c7d0a7f2e6003a465d0672b89d00b49eab1053d420b0.jpg)
22
+ Figure 1: Comparison between backdoor examples generated by our method and by the previous backdoor attacks. Given the original image (leftmost), we generate the corresponding backdoor images using patch-based attacks (Gu et al., 2017; Liu et al., 2018b), blending-based attack (Chen et al., 2017), SIG (Barni et al., 2019), ReFool (Liu et al., 2020), and our method. For each method, we show the image (top), the magnified $( \times 2 )$ residual map (bottom). The images generated from the previous attacks are unnatural and can be detected by humans. In constrast, ours is almost identical to the original image, and the difference is unnoticeable.
23
+
24
+ To obtain a backdoor model, we first follow the common training procedure by poisoning a part of training data with a fixed ratio of $\rho _ { a } \in ( 0 , 1 )$ . While the trained networks provide high clean and attack accuracy, we found that they “cheated” by learning pixel-wise artifacts instead of the warping itself. It makes them easy to be caught by a popular backdoor defense Neural Cleanse. Instead, we add another mode in training, called “noise mode”, to enforce the models to learn only the predefined backdoor warp. This novel training scheme produces satisfactory models that are both effective and stealthy.
25
+
26
+ Our attack method achieves invisibility without sacrificing accuracy. It performs similarly to stateof-the-art backdoor methods in terms of clean and attack accuracy, verified on common benchmarks such as MNIST, CIFAR-10, GTSRB, and CelebA. Our attack is also undetectable by various backdoor defense mechanisms; none of existing algorithms can recognize or mitigate our backdoor. This is because the attack mechanism of our method is drastically different from any existing attack, breaking the assumptions of all defense methods.
27
+
28
+ Finally, we demonstrate that our novel backdoor can be a practical threat by deploying it for physical attacks. We tested the backdoor classifier with camera-captured images of physical screens. Despite image quality degradation via extreme capturing conditions, our backdoor is well-preserved, and the attack accuracy stays near $100 \%$ .
29
+
30
+ In short, we introduce a novel backdoor attack via image warping. To train such a model, we extend the standard backdoor training scheme by introducing a “noise” training mode. The attack is effective, and the backdoor is imperceptible by both humans and computational defense mechanisms. It can be deployed for physical attacks, creating a practical threat to deep-learning-based systems 1.
31
+
32
+ # 2 BACKGROUND
33
+
34
+ # 2.1 THREAT MODEL
35
+
36
+ Backdoor attacks are techniques of poisoning a system to have a hidden destructive functionality. The poisoned system can work genuinely on clean inputs but misbehave when a specific trigger pattern appears. In the attack mode for image classification, backdoor models can return a predefined target label, normally incorrect, regardless of image content. It allows the attacker to gain illegal benefits. For example, a backdoor face authentication system may allow the attacker to access whenever he puts a specific sticker on the face.
37
+
38
+ Backdoors can be injected into the deep model at any stage. We consider model poisoning at training since it is the most used threat model. The attacker has total control over the training process and maliciously alters data for his attack purposes. The poisoned model is then delivered to customers to deploy as-is. In our proposed attack, the attacker selects a fixed warping field and uses it to generate all the backdoor images in training and in testing-time attacks.
39
+
40
+ # 2.2 PREVIOUS BACKDOOR ATTACKS
41
+
42
+ We focus on backdoor attacks on image classification. The target network is trained for a classification task $f : \mathbb { X } \to \mathbb { C }$ , where $\mathbb { X }$ is an image domain and $\mathbb { C } = \operatorname { \bar { \{ } c _ { 1 } , } c _ { 2 } , . . . , c _ { M } \}$ is a set of $M$ target classes. When poisoning $f$ , we enforce it to learn an injection function $\boldsymbol { B }$ , a target label function $c$ , and alter the network behaviour so that:
43
+
44
+ $$
45
+ f ( \pmb { x } ) = y , \quad f ( \pmb { B } ( \pmb { x } ) ) = c ( y )
46
+ $$
47
+
48
+ for any pair of clean image $\pmb { x } \in \mathbb { X }$ and the corresponding label $y \in \mathbb { C }$
49
+
50
+ The earliest backdoor attack was BadNets (Gu et al., 2017). The authors suggested to poison a portion of training data by replacing each clean data pair $( { \pmb x } , y )$ with the corresponding poisoned pair $( B ( { \pmb x } ) , c ( { \pmb y } ) )$ . The injection function $\boldsymbol { B }$ simply replaces a fixed patch of the input image by a predefined trigger pattern. As for the target label function $c ( y )$ , the authors proposed two tests: (1) all-to-one with a constant target label $c ( y ) = { \hat { c } }$ and (2) all-to-all with $c ( y ) = y + 1$ .
51
+
52
+ After BadNets, many variants of backdoor attacks have been introduced. These approaches focus on changing either the backdoor injection process or the injection function $\boldsymbol { B }$ .
53
+
54
+ As for the backdoor injection process, Liu et al. (2018b) proposed to inject backdoor into clean models via fine-tuning instead of the training stage. Yao et al. (2019) suggested hiding backdoor inside latent neurons for transfer learning. Many recent studies (Turner et al., 2019; Barni et al., 2019; Liu et al., 2020), injected backdoor only on samples with unchanged labels, i.e., the target $c ( y )$ is the same as the ground-truth label $y$ , to dodge label inspection by humans.
55
+
56
+ In this paper, we focus on the development of a good injection function $\boldsymbol { B }$ . Most of the popular attack methods rely on fixed patch-based triggers. Chen et al. (2017) used image blending to embed the trigger into the input image, and Nguyen & Tran (2020) extended it to be input-aware. Salem et al. (2020) varied the patch-based trigger locations and patterns to make it “dynamic”. Barni et al. (2019) employed sinusoidal strips as the trigger alongside the clean-label strategy. Lately, Liu et al. (2020) proposed to disguise backdoor triggers as reflectance to make the poisoned images look natural. The backdoor images generated by these attacks, however, are easy to be spotted by humans. We instead propose an “invisible” backdoor that is imperceptible by even sharp-eyed people.
57
+
58
+ # 2.3 BACKDOOR DEFENSE METHODS
59
+
60
+ As the threat of backdoor attacks becomes more apparent, backdoor defense research is emerging. Based on usage scenarios, we can classify them into three groups: training defense, model defense, and testing-time defense.
61
+
62
+ Training defense assumes the defender has control over the training process, and the adversary attacks by providing infected training data (Tran et al., 2018). This assumption, however, does not match our threat model, where the already-trained backdoor model is provided by a third party. This mechanism is not applicable to our situation and will not be considered further in this paper.
63
+
64
+ Model defenses aim to verify or mitigate the provided model before deployment. Fine-Pruning (Liu et al., 2018a) suggested to prune the dormant neurons, defined by analyses on a clean image set, to mitigate the backdoor if present. Neural Cleanse (Wang et al., 2019) was the first work that could detect backdoor models. It optimized a patch-based trigger candidate for each target label, then detected if any candidate was abnormally smaller than the others as a backdoor indicator. ABS (Liu et al., 2019) scanned the neurons and generated trigger candidates by reverse engineering. Cheng et al. (2019) used GradCam (Selvaraju et al., 2017) to analyze the network behavior on a clean input image with and without the synthesized trigger to detect anomalies. Zhao et al. (2019) applied mode connectivity to effectively mitigate backdoor while keeping acceptable performance. Lately, Kolouri et al. (2020) introduced universal litmus patterns that can be fed to the network to detect backdoor.
65
+
66
+ Unlike model defense, testing-time defenses inspect models after deployment with the presence of input images. It focuses on verifying if the provided image is poisoned and how to mitigate it. STRIP (Gao et al., 2019) exploited the persistent outcome of the backdoor image under perturbations for detection. In contrast, Neo (Udeshi et al., 2019) searched for the candidate trigger patches where region blocking changed the predicted outputs. Recently, Doan et al. (2019) used GradCam inspection to detect potential backdoor locations. In all these methods, the trigger candidates were then verified by being injected into a set of clean images.
67
+
68
+ A common assumption in all previous defense methods is that the backdoor triggers are image patches. We instead propose a novel attack mechanism based on image warping, undermining the foundation of these methods.
69
+
70
+ # 2.4 ELASTIC IMAGE WARPING
71
+
72
+ Image warping is a basic image processing technique that deforms an image by applying the geometric transformation. The transformation can be affine, projective, elastic, or non-elastic. In this work, we propose to use elastic image warping given its advantages over the others: (1) Affine and projective transformations are naturally introduced to clean images via the image capturing process. If we apply these transformations to these images, the transformed images can be identical to other clean images that are of the same scenes but captured at different viewpoints. Hence, these transformations are not suitable to generate backdoor examples, particularly in physical attacks. (2) Elastic transformation still generates natural outputs while non-elastic one does not.
73
+
74
+ The most popular elastic warping technique is Thin-Plate Splines (TPS) (Duchon, 1977). TPS can interpolate a smooth warping field to transform the entire image given a set of control points with known original and target 2D coordinates. TPS was adopted in Spatial Transformer Networks (Jaderberg et al., 2015), the first deep learning study incorporating differential image warping.
75
+
76
+ We believe that elastic image warping can be utilized to generate invisible backdoor triggers. Unlike previous attack methods that introduce extra and independent information to an input image, elastic image warping only manipulates existing pixels of the image. Humans, while being excellent in spotting incongruent part of an image, are bad at recognizing small geometric transformations.
77
+
78
+ # 3 WARPING-BASED BACKDOOR ATTACK
79
+
80
+ We now describe our novel backdoor attack method WaNet, which stand for Warping-based poisoned Networks. WaNet are designed to be stealthy to both machine and human inspections.
81
+
82
+ # 3.1 OVERVIEW
83
+
84
+ Recall that a classification network is a function $f : \mathbb { X } \to \mathbb { C }$ , in which $\mathbb { X }$ is an input image domain and $\mathbb { C }$ is a set of target classes. To train $f$ , a training dataset $\mathbb { S } = \{ ( \mathbf { x } _ { i } , y _ { i } ) | \mathbf { x } _ { i } \in \mathbb { X } , \mathbf { \bar { y } } _ { i } \in \mathbb { C } , \bar { i } = \overline { { 1 , N } } \}$ is provided. We follow the training scheme of BadNets to poison a subset of $\mathbb { S }$ with ratio $\rho _ { a }$ for backdoor training. Each clean pair $( { \pmb x } , y )$ will be replaced by a backdoor pair $( B ( { \pmb x } ) , c ( { \pmb y } ) )$ , in which $\boldsymbol { B }$ is the backdoor injection function and $c ( y )$ is the target label function.
85
+
86
+ Our main focus is to redesign the injection function $\boldsymbol { B }$ based on image warping. We construct $\boldsymbol { B }$ using a warping function $\mathcal { W }$ and a predefined warping field $M$ :
87
+
88
+ $$
89
+ \ B ( \pmb { x } ) = \mathscr { W } ( \pmb { x } , \pmb { M } ) .
90
+ $$
91
+
92
+ $M$ acts like a motion field; it defines the relative sampling location of backward warping for each point in the target image. $\mathcal { W }$ allows a floating-point warping field as input. When a sampling pixel falls on non-integer 2D coordinates, it will be bi-linear interpolated. To implement $\mathcal { W }$ , we rely on the public API grid sample provided by PyTorch. However, this API inputs a grid of normalized absolute 2D coordinates of the sampling points. To use that API, we first sum $M$ with an identity sampling grid, then normalize to $[ - 1 , 1 ]$ to get the required grid input.
93
+
94
+ # 3.2 WARPING FIELD GENERATION
95
+
96
+ The warping field $M$ is a crucial component; it must guarantee that the warped images are both natural and effective for attacking purposes. Hence, $M$ are desired to satisfy the following properties:
97
+
98
+ • Small: $M$ should be small, to be unnoticeable to humans,
99
+
100
+ ![](images/81132bcaa7c20024d7ad25d9b48489f426beb6a86cbc53a6818d3cb183f3fe7e.jpg)
101
+ Figure 2: Process of creating the warping field $M$ and using it to generate poisoned images.
102
+
103
+ ![](images/7e29ff05e3b5688eba7a923ac82091bbc493f7a1cfef1eae1733fbd455b6f02a.jpg)
104
+ Figure 3: Effect of different hyper-parameters on the warping result. For each warped image, we show the image (top), the magnified $( \times 2 )$ residual map (bottom). The PSNR and LPIPS (Zhang et al., 2018) scores are computed at resolution $2 2 4 \times 2 2 4$ .
105
+
106
+ • Elastic: $M$ should be elastic, i.e., smooth and non-flat, to generate natural looking images, • Within image boundary: $M$ should not exceed the image boundary, to avoid creating suspicious black/plain outer area.
107
+
108
+ To get such a warping field, we borrow the idea of using control points from TPS but simplify the interpolation method. The process of generating the desired warp is illustrated by Fig. 2 and is described in the following subsections.
109
+
110
+ Selecting the control grid We first select the control points. For simplicity, we pick the target points on a uniform grid of size $k \times k$ over the entire image. Their backward warping field is denoted as $\boldsymbol { P } \in \mathbb { R } ^ { k \times k \times 2 }$ . We use a parameter $s$ to define the strength of $_ { r }$ and generate $_ { r }$ as following:
111
+
112
+ $$
113
+ P = \psi ( r a n d _ { [ - 1 , 1 ] } ( k , k , 2 ) ) \times s
114
+ $$
115
+
116
+ in which $r a n d _ { [ - 1 , 1 ] } ( . . . )$ is a function returning random tensor with the input shape and element value in the range $[ - 1 , 1 ]$ and $\psi$ is a normalization function. In this paper, we normalize the tensor elements by their mean absolute value:
117
+
118
+ $$
119
+ \psi ( A ) = { \frac { A } { { \frac { 1 } { s i z e ( A ) } } \sum _ { a _ { i } \in A } \left| a _ { i } \right| } }
120
+ $$
121
+
122
+ Upsampling From the control points, we interpolate the warping field of the entire image. Since these points are in a uniform grid covering the entire image, instead of using a complex spline-based interpolation like in TPS, we can simply apply bicubic interpolation. We denote the output of this step as $M _ { 0 } = \uparrow P \in \mathbb { R } ^ { h \times w \times 2 }$ , with $h$ and $w$ being the image height and width respectively.
123
+
124
+ Clipping Finally, we apply a clipping function $\phi$ so that the sampling points do not fall outside of the image border. The process of generating $M$ can be summarized by the equation:
125
+
126
+ $$
127
+ { \cal M } = \phi ( \uparrow ( \psi ( r a n d _ { [ - 1 , 1 ] } ( k , k , 2 ) ) \times s ) ) .
128
+ $$
129
+
130
+ We investigate the effect of the hyper-parameters $k$ and $s$ qualitatively in Fig. 3. The warping effect is almost invisible when $k < 6$ and $s < 0 . 7 5$ .
131
+
132
+ # 3.3 RUNNING MODES
133
+
134
+ After computing the warping field $M$ , we can train WaNet with with two modes, clean and attack, as the standard protocol. However, the models trained by that algorithm, while still achieving high
135
+
136
+ ![](images/d3ed2c75ea36444996fc393d65dbbcf12766b4c659f7673cc736ef40f18809b7.jpg)
137
+ Figure 4: Training pipeline with three running modes.
138
+
139
+ ![](images/ca04708b4a2d8b46d98f2e9c0480cb1c70f223fc550803c2276acec1d6ac343b.jpg)
140
+
141
+ accuracy in both clean and attack tests, tend to learn pixel-level artifacts instead of the warping. They are, therefore, easily exposed by a backdoor defense method such as Neural Cleanse. We will discuss more details in the ablation studies in Section 4.6.
142
+
143
+ To resolve this problem, we propose a novel training mode alongside the clean and attack mode, called noise mode. The idea is simple: when applying a random warping field $M ^ { \prime } \ne M$ , the network should not trigger the backdoor but return the correct class prediction.
144
+
145
+ Fig. 4 illustrates three running modes in our training pipelines. We first select the backdoor probability $\rho _ { a } \in ( 0 , 1 )$ and the noise probability $\rho _ { n } \in ( 0 , 1 )$ such that $\rho _ { a } + \rho _ { n } < 1$ . Then, for each clean input $( { \pmb x } , y )$ , we randomly select one of three modes and alter that pair accordingly:
146
+
147
+ $$
148
+ ( \pmb { x } , y ) \mapsto \left\{ \begin{array} { l l } { ( \pmb { x } , y ) } & { \mathrm { w i t h ~ p r o b a b i l i t y ~ } 1 - \rho _ { a } - \rho _ { n } } \\ { ( \mathcal { W } ( \pmb { x } , \pmb { M } ) , c ( y ) ) } & { \mathrm { w i t h ~ p r o b a b i l i t y ~ } \rho _ { a } } \\ { ( \mathcal { W } ( \pmb { x } , \pmb { M } + r a n d _ { [ - 1 , 1 ] } ( h , w , 2 ) ) , y ) } & { \mathrm { w i t h ~ p r o b a b i l i t y ~ } \rho _ { n } } \end{array} \right.
149
+ $$
150
+
151
+ Note that with the noise mode, instead of using a totally random warping field, we form it by adding Gaussian noise to $M$ for a more effective training. The modified training set is then used to train $f$ .
152
+
153
+ # 4 EXPERIMENTS
154
+
155
+ # 4.1 EXPERIMENTAL SETUP
156
+
157
+ Following the previous backdoor attack papers, we performed experiments on four datasets: MNIST (LeCun et al., 1998), CIFAR-10 (Krizhevsky et al., 2009), GTSRB (Stallkamp et al., 2012) and CelebA (Liu et al., 2015). Note that CelebA dataset has annotations for 40 independent binary attributes, which is not suitable for multi-class classification. Therefore, we follow the configuration suggested by Salem et al. (2020) to select the top three most balanced attributes, including Heavy Makeup, Mouth Slightly Open, and Smiling, then concatenate them to create eight classification classes. Their detail information are shown in Table 1. To build the classifier $f$ for the color image datasets, we used Pre-activation Resnet-18 (He et al., 2016) for the CIFAR-10 and GTSRB datasets as suggested by Kang (2020), and Resnet-18 for the CelebA dataset. As for the grayscale dataset MNIST, we defined a simple network structure as reported in Table 1.
158
+
159
+ We trained the networks using the SGD optimizer. The initial learning rate was 0.01, which was reduced by a factor of 10 after each 100 training epochs. The networks were trained until convergence. We used $k = 4$ , $s = 0 . 5$ , $\rho _ { a } = 0 . 1$ , and $\rho _ { n } = 0 . 2$ .
160
+
161
+ Table 1: Datasets and the classifiers used in our experiments. Each ConvBlock consists of a $3 \times 3$ convolution (stride $^ { \cdot = 2 }$ ), a BatchNorm, and a ReLU layer.
162
+
163
+ ![](images/9dd4edb918d24b7d2e5819528c233a4e8a5f2da0fa8f130159fec55c5486ad46.jpg)
164
+ Figure 6: Human inspection tests: (a) Success fooling rates of each backdoor method, (b) The most distinguishable cases from WaNet.
165
+
166
+ # 4.2 ATTACK EXPERIMENTS
167
+
168
+ We trained and tested the backdoor models in all-to-one configuration, i.e., $c ( y ) = \hat { c } \forall y$ . The accuracy values in clean mode, attack mode, and the noise mode are reported in Fig. 5a. As can be seen, with clean images, the networks could correctly classify them like any benign models, with accuracy near $100 \%$ on MNIST/GTSRB, $9 4 . 1 5 \%$ on CIFAR-10, and $7 9 . 7 7 \%$ on CelebA. When applying the pre-defined image warping, the attack success rate was near $100 \%$ on all datasets. However, when using a random warping, the classifiers still recognized the true image class with a similar accuracy as in the clean mode. This result is impressive given the fact that the poisoned images look almost identical to the original, as can be seen in Fig. 5b.
169
+
170
+ To evaluate our method’s robustness in real-life scenarios, we also tested if backdoor images would still be misclassified even when being distorted by the capturing process. We showed 50 clean and 50 backdoor images on a screen and recaptured them using a phone camera. Our model still worked well on recaptured images, obtaining $98 \%$ clean accuracy and $96 \%$ attack success rate. Fig. 5c displays an example of our test. The clean image was recognized correctly as “automobile”, while the look-a-like backdoor image was recognized as the “airplane” attack class.
171
+
172
+ # 4.3 HUMAN INSPECTION
173
+
174
+ To examine the realisticity of our backdoor and the previous methods, we created user studies with human inspection. First, we randomly selected 25 images from the GTSRB dataset. Second, for each backdoor injection function, we created the corresponding 25 backdoor images and mixed them with the original to obtain a set of 50 images. Finally, we asked 40 people to classify whether each image was genuine, collecting 2000 answers per method. The participants were trained about the mechanism and characteristics of the attack before answering the questions.
175
+
176
+ We collected the answers and reported the percentage of incorrect answers as the success fooling rates in Fig. 6a. Note that when the backdoor examples are more indistinguishable from the clean ones, the testers will find it harder to decide an image is clean or poisoned. Hence, better backdoor methods led to higher fooling rates on not only backdoor inputs but also on clean ones. The rates from previous methods are low, with maximum $7 . 7 \%$ on all inputs, implying that they are obvious to humans to detect. In contrast, our rate is $28 \%$ , four times their best number. It confirms that WaNet is stealthy and hard to detect, even with trained people.
177
+
178
+ Although our backdoor images are natural-looking, some of them have subtle properties that can be detected by trained testers. We provide two of the most detected backdoor examples from WaNet in Fig. 6b. In the first case, the circle sign is not entirely round. In the second case, the right edge of the traffic sign is slightly curved. Although these conditions can be found on real-life traffic signs, they are not common in the testing dataset GTSRB. These images are of the minority, and our fooling rate on backdoor images is $3 8 . 6 \%$ , not far away from the rate of $50 \%$ in random selection.
179
+
180
+ ![](images/f7f9082c0ff5c9c114493eea47e6bfd11a3b49ea7cbbcaab4d630a51fb8631cd.jpg)
181
+ Figure 7: Experiments on verifying WaNet by the state-of-the-art defense and visualization methods.
182
+
183
+ # 4.4 DEFENSE EXPERIMENTS
184
+
185
+ We will now test the trained models against the popular backdoor defense mechanisms, including Neural Cleanse, Fine-Prunning (Model defenses), and STRIPS (Testing-time defense).
186
+
187
+ Neural Cleanse (Wang et al., 2019) is a model-defense method based on the pattern optimization approach. It assumes that the backdoor is patch-based. For each class label, Neural Cleanse computes the optimal patch pattern to convert any clean input to that target label. It then checks if any label has a significantly smaller pattern as a sign of backdoor. Neural Cleanse quantifies it by the Anomaly Index metric with the clean/backdoor threshold $\tau = 2$ . We ran Neural Cleanse over our WaNet models and report the numbers in Fig. 7c. WaNet passed the test on all datasets; its scores are even smaller than the clean model ones on MNIST and CIFAR-10. We can explain it by the fact that our backdoor relies on warping, a different mechanism compared with patch-based blending.
188
+
189
+ Fine-Pruning (Liu et al., 2018a), instead, focuses on neuron analyses. Given a specific layer, it analyzes the neuron responses on a set of clean images and detects the dormant neurons, assuming they are more likely to tie to the backdoor. These neurons are then gradually pruned to mitigate the backdoor. We tested Fine-Pruning on our models and plotting the network accuracy, either clean or attack, with respect to the number of neurons pruned in Fig. 7a. On all datasets, at no point is the clean accuracy considerably higher than the attack one, making backdoor mitigation impossible.
190
+
191
+ STRIP (Gao et al., 2019) is a representative of the testing-time defense approach. It examines the model with the presence of the input image. STRIP works by perturbing the input image through a set of clean images from different classes and raising the alarm if the prediction is persistent, indicating by low entropy. With WaNet, the perturbation operation of STRIP will modify the image content and break the backdoor warping if present. Hence, WaNet behaves like genuine models, with similar entropy ranges, as shown in Fig. 7b.
192
+
193
+ # 4.5 NETWORK INSPECTION
194
+
195
+ Visualization tools, such as GradCam (Selvaraju et al., 2017), are helpful in inspecting network behaviors. Patch-based backdoor methods can be exposed easily due to the use of small trigger regions, as pointed out by Cheng et al. (2019); Doan et al. (2019). Our attack method is based on the warping on the entire image, so it is undetectable by this algorithm. We visualize activation based on the label that has the highest prediction score in Fig. 7d. With clean models, that label is for the correct class label. With WaNet and backdoor inputs, it is the backdoor label $\hat { c }$ . As can be seen, the visualization heatmaps of WaNet look like the ones from any clean model.
196
+
197
+ ![](images/902edff74c83bc38bd176b15e3f183a6000bf9a3c5c93a60ca8a5a9523d32ea0.jpg)
198
+ Figure 8: Ablation studies on CIFAR-10 dataset: (a) Role of the noise mode training, (b,c) Network performance when changing warping hyper-parameters.
199
+
200
+ # 4.6 ABLATION STUDIES
201
+
202
+ Role of the noise mode Without the noise mode, we could still train a backdoor model with similar clean and attack accuracy. However, these models failed the defense test with Neural Cleanse as shown in Fig. 9, and the optimized trigger patterns revealed their true behavior.
203
+
204
+ ![](images/cd132370d6ae5f49b8a4e76bbc6c4973500ffc7177fc53c933bb82191fa21597.jpg)
205
+ Figure 9: Networks’ performance against Neural Cleanse with and without noise mode.
206
+
207
+ Fig. 8a displays the trigger patterns optimized by Neural Cleanse for the attacking class “airplane” on CIFAR-10. With the clean model, this pattern has an airplane-like shape, and it is big enough to rewrite image content given any input. With our model trained without noise mode, the optimized pattern just consists of scattered points. This pattern is remarkably smaller, making the model caught by Neural Cleanse. It reveals that the model did not learn the specific backdoor warping; instead, it remembered the pixel-wise artifacts. By adding the noise training mode, our model no longer relies on those artifacts, and the optimized pattern looks similar to the clean model’s one.
208
+
209
+ Other hyper-parameters We investigated the effect of the warping hyper-parameters, including the strength $s$ and the grid size $k$ . Fig. 8b and 8c show the clean, attack, and noise mode accuracy of our network on the CIFAR-10 dataset when changing each of these parameters. When $k$ or $s$ is small, the backdoor images are similar to the clean ones. However, since they are a minority $( \rho _ { a } = 0 . 1 )$ , the network would treat them like data with noisy labels in those scenarios. Hence, clean and noise accuracies are stable across configurations. In contrast, backdoor accuracy suffers on the left side of the plots. It gradually increases when $s$ or $k$ is small, then saturates and stays near $100 \%$ .
210
+
211
+ # 5 CONCLUSION AND FUTURE WORKS
212
+
213
+ This paper introduces a novel backdoor attack method that generates backdoor images via subtle image warping. The backdoor images are proved to be natural and undetectable by humans. We incorporate in training a novel “noise” mode, making it stealthy and pass all the known defense methods. It opens a new domain of attack mechanism and encourages future defense research.
214
+
215
+ # REFERENCES
216
+
217
+ Mauro Barni, Kassem Kallas, and Benedetta Tondi. A new backdoor attack in cnns by training set corruption without label poisoning. In 2019 IEEE International Conference on Image Processing (ICIP), pp. 101–105. IEEE, 2019.
218
+
219
+ Xinyun Chen, Chang Liu, Bo Li, Kimberly Lu, and Dawn Song. Targeted backdoor attacks on deep learning systems using data poisoning. arXiv preprint arXiv:1712.05526, 2017.
220
+
221
+ Hao Cheng, Kaidi Xu, Sijia Liu, Pin-Yu Chen, Pu Zhao, and Xue Lin. Defending against Backdoor Attack on Deep Neural Networks. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining Workshop, 2019.
222
+
223
+ Jiazhu Dai, Chuanshuai Chen, and Yufeng Li. A backdoor attack against lstm-based text classification systems. IEEE Access, 7:138872–138878, 2019.
224
+
225
+ Bao Gia Doan, Ehsan Abbasnejad, and Damith C. Ranasinghe. Februus: Input Purification Defense Against Trojan Attacks on Deep Neural Network Systems. arXiv, Aug 2019. URL https: //arxiv.org/abs/1908.03369.
226
+
227
+ Jean Duchon. Splines minimizing rotation-invariant semi-norms in sobolev spaces. In Constructive theory of functions of several variables, pp. 85–100. Springer, 1977.
228
+
229
+ Yansong Gao, Change Xu, Derui Wang, Shiping Chen, Damith C Ranasinghe, and Surya Nepal. Strip: A defence against trojan attacks on deep neural networks. In Proceedings of the 35th Annual Computer Security Applications Conference, pp. 113–125, 2019.
230
+
231
+ Tianyu Gu, Brendan Dolan-Gavitt, and Siddharth Garg. Badnets: Identifying vulnerabilities in the machine learning model supply chain. In Proceedings of Machine Learning and Computer Security Workshop, 2017.
232
+
233
+ Ronan Hamon, Henrik Junklewitz, and Ignacio Sanchez. Robustness and explainability of artificial intelligence. Publications Office of the European Union, 2020.
234
+
235
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In European conference on computer vision, pp. 630–645. Springer, 2016.
236
+
237
+ Max Jaderberg, Karen Simonyan, Andrew Zisserman, et al. Spatial transformer networks. In Advances in neural information processing systems, pp. 2017–2025, 2015.
238
+
239
+ Liu Kang. pytorch-cifar, May 2020. URL https://github.com/kuangliu/ pytorch-cifar. [Online; accessed 4. Jun. 2020].
240
+
241
+ Soheil Kolouri, Aniruddha Saha, Hamed Pirsiavash, and Heiko Hoffmann. Universal litmus patterns: Revealing backdoor attacks in cnns. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 301–310, 2020.
242
+
243
+ Alex Krizhevsky et al. Learning multiple layers of features from tiny images. 2009.
244
+
245
+ Yann LeCun, Leon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to ´ document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
246
+
247
+ Kang Liu, Brendan Dolan-Gavitt, and Siddharth Garg. Fine-pruning: Defending against backdooring attacks on deep neural networks. In Proceedings of International Symposium on Research in Attacks, Intrusions, and Defenses, 2018a.
248
+
249
+ Yingqi Liu, Shiqing Ma, Yousra Aafer, Wen-Chuan Lee, Juan Zhai, Weihang Wang, and Xiangyu Zhang. Trojaning attack on neural networks. In Proceedings of Network and Distributed System Security Symposium, 2018b.
250
+
251
+ Yingqi Liu, Wen-Chuan Lee, Guanhong Tao, Shiqing Ma, Yousra Aafer, and Xiangyu Zhang. Abs: Scanning neural networks for back-doors by artificial brain stimulation. In Proceedings of the 2019 ACM SIGSAC Conference on Computer and Communications Security, pp. 1265–1282, 2019.
252
+
253
+ Yunfei Liu, Xingjun Ma, James Bailey, and Feng Lu. Reflection backdoor: A natural backdoor attack on deep neural networks. 2020.
254
+
255
+ Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proceedings of International Conference on Computer Vision (ICCV), December 2015.
256
+
257
+ Tuan Anh Nguyen and Anh Tran. Input-aware dynamic backdoor attack. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 3454–3464. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper/2020/file/ 234e691320c0ad5b45ee3c96d0d7b8f8-Paper.pdf.
258
+
259
+ Ahmed Salem, Rui Wen, Michael Backes, Shiqing Ma, and Yang Zhang. Dynamic backdoor attacks against machine learning models. arXiv preprint arXiv:2003.03675, 2020.
260
+
261
+ Ramprasaath R Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedantam, Devi Parikh, and Dhruv Batra. Grad-cam: Visual explanations from deep networks via gradient-based localization. In Proceedings of the IEEE international conference on computer vision, pp. 618–626, 2017.
262
+
263
+ Johannes Stallkamp, Marc Schlipsing, Jan Salmen, and Christian Igel. Man vs. computer: Benchmarking machine learning algorithms for traffic sign recognition. Neural networks, 32:323–332, 2012.
264
+
265
+ Brandon Tran, Jerry Li, and Aleksander Madry. Spectral signatures in backdoor attacks. In Proceedings of Advances in Neural Information Processing Systems, 2018.
266
+
267
+ Alexander Turner, Dimitris Tsipras, and Aleksander Madry. Clean-label backdoor attacks. https://people.csail.mit.edu/madry/lab/, 2019.
268
+
269
+ Sakshi Udeshi, Shanshan Peng, Gerald Woo, Lionell Loh, Louth Rawshan, and Sudipta Chattopadhyay. Model agnostic defence against backdoor attacks in machine learning. arXiv preprint arXiv:1908.02203, 2019.
270
+
271
+ Bolun Wang, Yuanshun Yao, Shawn Shan, Huiying Li, Bimal Viswanath, Haitao Zheng, and Ben Y Zhao. Neural cleanse: Identifying and mitigating backdoor attacks in neural networks. In Proceedings of 40th IEEE Symposium on Security and Privacy, 2019.
272
+
273
+ Yuanshun Yao, Huiying Li, Haitao Zheng, and Ben Y Zhao. Latent backdoor attacks on deep neural networks. In Proceedings of the 2019 ACM SIGSAC Conference on Computer and Communications Security, pp. 2041–2055, 2019.
274
+
275
+ Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In CVPR, 2018.
276
+
277
+ Pu Zhao, Pin-Yu Chen, Payel Das, Karthikeyan Natesan Ramamurthy, and Xue Lin. Bridging mode connectivity in loss landscapes and adversarial robustness. In International Conference on Learning Representations, 2019.
278
+
279
+ # A APPENDIX
280
+
281
+ # A.1 SYSTEM DETAILS
282
+
283
+ A.1.1 DATASETS
284
+
285
+ We used 3 standard datasets, from simple to more complex ones, to conduct our experiments. As the datasets are all used in previous related works, our results would be more comparable and reliable.
286
+
287
+ MNIST
288
+
289
+ The dataset (LeCun et al., 1998) is a subset of the larger dataset available from the National Institute of Technology (NIST). This dataset consists of 70,000 grayscale, $2 8 \times 2 8$ images, divided into a training set of 60,000 images and a test set of 10,000 images. Original dataset could be found at http://yann.lecun.com/exdb/mnist/.
290
+
291
+ We applied random cropping and random rotation as data augmentation for the training process.
292
+ During the evaluation stage, no augmentation is applied.
293
+
294
+ # CIFAR10
295
+
296
+ The dataset was introduced the first time by Krizhevsky et al. (2009). It is a labeled subset of the 80-millions-tiny-images dataset, collected by Alex Krizhevsky, Vinod Nair and Geoffrey Hinton, consists of 60,000 color images at the resolution of $3 2 \times 3 2$ . The dataset contains 10 classes, with 6,000 images per one. It is divided into two subsets: a training set of 50,000 images and a test set of 10,000 images. The data set is public and avalable at https://www.cs.toronto.edu/ ˜kriz/cifar.html.
297
+
298
+ During training stage, random crop, random rotation and random horizontal flip were applied as data augmentation. No augmentation was added at the evaluation stage.
299
+
300
+ # GTSRB
301
+
302
+ The German Traffic Sign Recognition Benchmark - the GTSRB (Stallkamp et al. (2012)) is used as an official dataset for the challenge held at the International Joint Conference on Neural Network (IJCNN) 2011. This dataset consists of 60,000 images with 43 classes and the resolution varying from $3 2 \times 3 2$ to $2 5 0 \times 2 5 0$ . It is divided into a training set of 39,209 images and a test set of 12,630. The dataset could be found at http://benchmark.ini.rub.de/?section $=$ gtsrb&subsection $=$ dataset.
303
+
304
+ Input images were all resized into $3 2 \times 3 2$ pixels, then applied random crop and random rotation at the training stage. No augmentation was used at the evaluation stage.
305
+
306
+ # CelebA
307
+
308
+ CelebFaces Attributes Dataset - CelebA, first introduced by Liu et al. (2015), is a large-scale face attributes dataset. It contains 10,177 identities with 202,599 face images. Each image has an annotation of 5 landmark locations and 40 binary attributes. The dataset is publicly available at http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html.
309
+
310
+ Noted that this dataset is highly unbalanced. Due to the time limitation, we select 3 out of 40 attributes, namely Heavy Makeup, Mouth Slightly Open and Smiling, as suggested by Salem et al. (2020). We then concatenate them into 8 classes to create a multiple label classification task. The input images were all resized into $6 4 \times 6 4$ pixels. Random crop and random rotation were applied as data augmentation at the training stage. No augmentation was applied at the evaluation stage.
311
+
312
+ # A.1.2 CLASSIFICATION NETWORKS
313
+
314
+ MNIST
315
+
316
+ We used a simple, self-defined structure as network classifier for this dataset. Detailed architecture will be mentioned in Table 2.
317
+
318
+ Table 2: Detailed architecture of MNIST classifier. $^ *$ means the layer is followed by a Dropout layer. $\dagger$ means the layer is followed by a BatchNormalization layer.
319
+
320
+ <table><tr><td>Layer</td><td>Filter</td><td>Filter Size</td><td>Stride</td><td>Padding</td><td>Activation</td></tr><tr><td>Conv2dt</td><td>32</td><td>3×3</td><td>2</td><td>1</td><td>ReLU</td></tr><tr><td>Conv2dt</td><td>64</td><td>3×3</td><td>2</td><td>0</td><td>ReLU</td></tr><tr><td>Conv2d</td><td>64</td><td>3×3</td><td>2</td><td>0</td><td>ReLU</td></tr><tr><td>Linear*</td><td>512</td><td>-</td><td></td><td>0</td><td>ReLU</td></tr><tr><td>Linear</td><td>10</td><td>-</td><td>1</td><td>0</td><td>Softmax</td></tr></table>
321
+
322
+ # CIFAR10 and GTSRB
323
+
324
+ For the CIFAR-10 and GTSRB datasets, we use PreActRes18 (He et al., 2016) architecture as classification networks.
325
+
326
+ CelebA
327
+
328
+ For the CelebA dataset, we use ResNet18 (He et al., 2016) architecture as the classification network.
329
+
330
+ # A.1.3 RUNNING TIME
331
+
332
+ We use a system of a GPU RTX 2080Ti and a CPU i7 9700K to conduct our experiment. Detailed inference time of each module will be demonstrated below.
333
+
334
+ Table 3: Inference time of our modules.
335
+
336
+ <table><tr><td>MNIST</td><td>CIFAR10</td><td>GTSRB</td><td>CelebA</td></tr><tr><td>time/sample 4.37 μs</td><td>18.64 μs</td><td>18.65 μs</td><td>87.51 μs</td></tr></table>
337
+
338
+ # A.2 ALL-TO-ALL ATTACK
339
+
340
+ Beside the single-target attack scenario, we also verified the effectiveness of WaNet in multi-target scenario, often called all-to-all attack. In this scenario, the input of class $y$ would be targeted into class $c ( y ) = ( y + 1 )$ mod $| C |$ , where $| C |$ is the number of classes.
341
+
342
+ # A.2.1 EXPERIMENTAL SETUP
343
+
344
+ We use the same experimental setups as in the single-target scenario, with a small modification. In the attack mode at training, we replace the fixed target label $\hat { c }$ by $( y + 1 )$ mod $| C |$ . In the attack test at evaluation, we also change the expected label similarly.
345
+
346
+ # A.2.2 ATTACK EXPERIMENT
347
+
348
+ We conducted attack experiments and reported result in Table 4. While models still achieve stateof-the-art performance on clean data, the attack efficacies slightly decreases. This is due to the fact that the target label now varies from input to input. Though, the lowest attack accuracy is $7 8 . 5 8 \%$ , which is still harmful to real-life deployment.
349
+
350
+ Similar to all-to-one scenario, we also tested our model with noise mode and recorded the noise accuracy.
351
+
352
+ # A.2.3 DEFENSE EXPERIMENTS
353
+
354
+ We repeat the same defense experiments used in the all-to-one scenario. Our backdoor models could also pass all the tests mentioned in Figure 7.
355
+
356
+ Table 4: All-to-all attack result.
357
+
358
+ <table><tr><td>Dataset</td><td>Clean Attack</td><td>Noise</td></tr><tr><td>MNIST</td><td>99.44</td><td>95.90 94.34</td></tr><tr><td>CIFAR-10</td><td>94.43</td><td>93.36 91.47</td></tr><tr><td>GTSRB</td><td>99.39</td><td>98.31 98.96</td></tr><tr><td>CelebA</td><td>78.73</td><td>78.58 76.12</td></tr></table>
359
+
360
+ ![](images/f367396f6d2069d7ae6303e002dc2f7bba043fbf49a75bf4494886421ccd4c5d.jpg)
361
+ Figure 10: Neural Cleanse against all-to-all scenario.
362
+
363
+ ![](images/240110dedb949e789ebf26b2bac7cc82d7809b12aa3f28b0957d007ebe1904ab.jpg)
364
+ Figure 11: Fine-pruning against all-to-all scenario.
365
+
366
+ ![](images/f155d1174d16171cb056992f82c5297b7a6cf6d562778244cd94f421ada9778c.jpg)
367
+ Figure 12: STRIP against all-to-all scenario.
368
+
369
+ # A.3 ADDITIONAL RESULTS
370
+
371
+ # A.3.1 ADDIONAL IMAGES FOR METIONED BACKDOOR ATTACK METHODS
372
+
373
+ We provide additional examples comparing backdoor images from WaNet and from other attack methods in Fig. 13.
374
+
375
+ # A.3.2 EXPERIMENT ON SPECTRAL SIGNATURE DEFENSE
376
+
377
+ Tran et al. (2018) proposed a data defense method based on the spectral signature of backdoor training data. Although this data-defense configuration does not match our threat model, we find it useful to verify if our backdoor data have the spectral signature discussed in that paper. We repeated the experiment in the last plot of its Fig. 1, using 5000 clean samples and 1172 backdoor samples generated by WaNet on the CIFAR-10 dataset, which is the same dataset used in the original paper. Fig. 14 plots histograms of the correlations between these samples’ learned representations and their covariance matrix’s top right singular vector. As can be seen, the histograms of the two populations are completely inseparable. Thereby, the backdoor training samples could not be removed from the training dataset using their proposed method. One possible explanation is that the distributional difference between the clean and backdoor correlations in the traditional backdoor methods was the result of the domination of a few backdoor neurons. We do not have such a phenomenon in WaNet, as proved in Fine-Prunning experiments, eliminating the appearance of spectral signature.
378
+
379
+ ![](images/25ebb670000e56552dca7c83822c1e95a8e3ae6ed170efc2d36e723a3c5c3378.jpg)
380
+ Figure 13: Additional images for mentioned backdoor attack methods.
381
+
382
+ # A.3.3 THE STABILITY OF WANET
383
+
384
+ In this section, we verify if WaNet is stable to the variations of the warping field $M$ . We trained 8 WaNet backdoor models, using 8 randomly generated warping fields, in the CIFAR10 dataset. The clean, backdoor, and noise accuracies of the trained models are all stable, as shown in Table 5.
385
+
386
+ Table 5: The stability of WaNet on the CIFAR-10 dataset.
387
+
388
+ <table><tr><td></td><td>Clean</td><td>Backdoor</td><td>Noise</td></tr><tr><td>Accuracy (%)</td><td>94.42 ± 0.08</td><td>99.40 ± 0.21</td><td>93.16 ± 0.43</td></tr></table>
389
+
390
+ ![](images/64b1c0ebfdc1868d7e11bcfaa630829bad191638ceff23bbb1669dfc01d36092.jpg)
391
+ Figure 14: Spectral Signature
392
+
393
+ # A.3.4 ADDITIONAL TRIGGER PATTERNS VISUALIZING THE ROLE OF THE NOISE MODE
394
+
395
+ This section further demonstrates the importance of noise mode by providing trigger patterns optimized by Neural Cleanse on more datasets and with more target classes. Fig. 15a and 15b visualize the patterns on MNIST and GTSRB dataset using backdoor models trained for target label 0, similar to Fig. 8a. Fig. 15c, 15d, and 15e provide results on all three datasets but with backdoor models for label 3. As can be seen, the WaNet models without noise mode training return sparse and small patterns, thus easy to be detected by Neural Cleanse. By including that training mode, the optimized patterns are more crowded and approach clean models’ ones. Note that we skip visualizing the results on the CelebA dataset; its patterns optimized on either clean or backdoor models are all too sparse and small for humans to analyze due to subtle differences between human faces.
396
+
397
+ ![](images/302d62acda83b4f16685d0d77492758ba6c737fa376cd6e835ed81fe8dfa954f.jpg)
398
+ Figure 15: Additional trigger patterns optimized by Neural Cleanse for the target label (small is bad).
md/train/eoTy4ihL0W/eoTy4ihL0W.md ADDED
@@ -0,0 +1,270 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Evolution Gym: A Large-Scale Benchmark for Evolving Soft Robots
2
+
3
+ Jagdeep Singh Bhatia MIT CSAIL jagdeep@mit.edu
4
+
5
+ Holly Jackson
6
+ MIT CSAIL
7
+ hjackson@mit.edu
8
+
9
+ Yunsheng Tian MIT CSAIL yunsheng@csail.mit.edu
10
+
11
+ Jie Xu MIT CSAIL jiex@csail.mit.edu
12
+
13
+ Wojciech Matusik MIT CSAIL wojciech@csail.mit.edu
14
+
15
+ # Abstract
16
+
17
+ Both the design and control of a robot play equally important roles in its task performance. However, while optimal control is well studied in the machine learning and robotics community, less attention is placed on finding the optimal robot design. This is mainly because co-optimizing design and control in robotics is characterized as a challenging problem, and more importantly, a comprehensive evaluation benchmark for co-optimization does not exist. In this paper, we propose Evolution Gym, the first large-scale benchmark for co-optimizing the design and control of soft robots. In our benchmark, each robot is composed of different types of voxels (e.g., soft, rigid, actuators), resulting in a modular and expressive robot design space. Our benchmark environments span a wide range of tasks, including locomotion on various types of terrains and manipulation. Furthermore, we develop several robot co-evolution algorithms by combining state-of-the-art design optimization methods and deep reinforcement learning techniques. Evaluating the algorithms on our benchmark platform, we observe robots exhibiting increasingly complex behaviors as evolution progresses, with the best evolved designs solving many of our proposed tasks. Additionally, even though robot designs are evolved autonomously from scratch without prior knowledge, they often grow to resemble existing natural creatures while outperforming hand-designed robots. Nevertheless, all tested algorithms fail to find robots that succeed in our hardest environments. This suggests that more advanced algorithms are required to explore the high-dimensional design space and evolve increasingly intelligent robots – an area of research in which we hope Evolution Gym will accelerate progress. Our website with code, environments, documentation, and tutorials is available at http://evogym.csail.mit.edu.
18
+
19
+ # 1 Introduction
20
+
21
+ One of the main goals of artificial intelligence is to develop effective approaches for the creation of embodied intelligent systems. Inspired from real organisms, where body structure and brain are two key factors for completing any task in a real environment, a successful intelligent robot typically requires concurrently optimizing its structure design and control mechanism. Such a co-design problem has been a long-standing key challenge in the robotics and machine learning communities. Surprisingly, despite its importance, most previous research works still either only develop complex control algorithms for existing robot structures [1, 2, 17, 30], or conduct co-optimization over robot morphology and control for only a few simple tasks (e.g., running, jumping) [7, 14, 31, 32], especially in the soft body domain. The primary reasons behind the under-exploration of co-design algorithms in sophisticated problems are: (1) the underlying complex bilevel optimization scheme of a co-design algorithm, where the inner control optimization loop leads to a long iteration cycle of the whole optimization process; (2) the lack of a well-established benchmark platform providing the researchers with a suite to evaluate and compare different algorithms.
22
+
23
+ Digital benchmark environments have proven to be successful at promoting the development of advanced learning techniques via providing a comprehensive evaluation suite to make fair comparisons among different algorithms [5, 11, 36]. However, to our best knowledge, all existing benchmark platforms constrain their domains within control optimization problems, and the space of co-optimization environment suites is still rarely explored.
24
+
25
+ To fill this gap, in this work we propose Evolution Gym, a large-scale benchmark for evolving both the shape structure and controller of soft robots. The body of each robot in Evolution Gym is composed of various types of primitive building blocks (e.g., soft voxels, rigid voxels, actuator voxels), and the control of the robot includes action signals applied on the actuator voxels. We choose to use this multi-material voxel-based structure as the representation of robot body since it provides a general and universal representation for various categories of robot designs, and at the same time results in a modular and expressive structure design space. We adopt a mass-spring dynamics system [26] with penalty-based frictional contact as the underlining physics engine. Such a light-weight simulator allows the co-design algorithms to significantly reduce the simulation cost and thus accelerate the develop-evaluate iteration cycle [3, 15, 23]. The back-end simulator is fully developed in $\mathrm { C } { + + }$ t o provide further computing efficiency. Another feature of Evolution Gym is its large variety of tasks categorized by varying difficulty levels, which offer an extensive evaluation benchmark for comparing approaches. The benchmark is currently comprised of more than 30 tasks, spanning locomotion on various types of terrains and manipulation. Moreover, Evolution Gym is easy to use. In order to have user-friendly interfaces, we build a Python wrapper outside the $\mathrm { C } { + + }$ simulator and carefully design our APIs off of the well-received APIs of OpenAI Gym with minimum modifications. Evolution Gym will be released fully open-source under the MIT license.
26
+
27
+ In addition, we develop several baseline algorithms by integrating state-of-the-art design optimization approaches and reinforcement learning techniques. Specifically, in our baseline algorithms, design optimization methods are served in the outer loop to evolve the physical structures of robots and reinforcement learning algorithms are applied in the inner loop to optimize a controller for a given proposed structure design. We conduct extensive experiments to evaluate all baseline algorithms on Evolution Gym. The experiment results demonstrate that intelligent robot designs can be evolved fully autonomously while outperforming hand-designed robots in easier tasks, which reaffirms the necessity of jointly optimizing for both robot structure and control. However, none of the baseline algorithms are capable enough to successfully find robots that complete the task in our hardest environments. Such insufficiency of the existing algorithms suggests the demand for more advanced robot co-design techniques, and we believe our proposed Evolution Gym provides a comprehensive evaluation testbed for robot co-design and unlocks future research in this direction.
28
+
29
+ In summary, our work has the following key contributions: (i) We propose Evolution Gym, the first large-scale benchmark for soft robot co-design algorithms. (ii) We develop several co-design algorithms by combining state-of-the-art design optimization methods and deep reinforcement learning techniques for control optimization. (iii) The developed algorithms are evaluated and analyzed on our proposed benchmark suite, and the results validate the efficacy of robot co-design while pointing out the failure and limitations of existing algorithms.
30
+
31
+ # 2 Related work
32
+
33
+ Robot co-design Co-designing the structure (i.e., body) and control (i.e., brain) of robots is a long-standing key challenge in the robotics community. As the earliest work in this space, Sims [31] represents the structure of a rigid robot as a directed graph and proposes an evolutionary algorithm defined on graphs to optimize the robot design. Subsequently, the co-design of rigid robots is formulated as a graph search problem where more efficient search algorithms are applied [13, 27, 39, 41] to achieve increasingly interesting results. However, with the restriction of having rigid components only, these algorithms are unable to produce optimal or even feasible designs for many challenging tasks where a compliant joint or robot component is required to achieve the goal.
34
+
35
+ On the contrary, soft components offer much more flexibility to represent arbitrary shapes, making the design of more complex, agile, and high-performing robots possible. Inspired by this, some work has been conducted to co-design robots composed of soft cells. Cheney et al. [7, 8]; Van Diepen and Shea [37]; Corucci et al. [10] propose evolutionary algorithms to co-optimize the structure and control of voxel-based robots. However those algorithms typically parameterize the control as an open-loop periodic sequence of actuation, which prevents robots from learning complex non-periodic tasks such as walking on uneven or varying terrains. Spielberg et al. [32] and Medvet et al. [23] jointly optimize the spatial-varying material parameters and the neural network policy for soft robots but leave the shape of the robot fixed. Our proposed benchmark shares a similar expressive structure design space as Cheney et al. [7], but allows the control to be parameterized by a sophisticated neural network feedback policy. To handle such sophisticated joint optimization of the robot structure and high-dimensional neural network control policy, we develop several baseline co-design algorithms by combining state-of-the-art design optimization strategies and reinforcement learning techniques for control optmization.
36
+
37
+ Benchmark environments for robotics learning Present research in robotics learning is largely facilitated by emerging benchmark environments. For instance, OpenAI Gym [5], DeepMind Control Suite [36], rllab [11], and Gibson [40] have been developed to benchmark RL algorithms for controlling rigid robots. At the same time, PlasticineLab [16] is specifically designed for soft robot learning. However, the existing benchmark environments are all constructed for learning the control only. To enable the possibility of evolving the structure of a robot, the existing co-design work has to either implement their own testing environment [32, 7, 8, 10, 37], or make substantial changes on the underlying code of the existing control-only environments [29]. The independent development of testing beds requires non-trivial workload, and as a result, existing co-design works mainly focus on evaluating the robot on a few simple tasks such as walking on a flat terrain [7, 6, 8, 37, 32, 23], or swimming along a single direction [9, 39]. An unintended consequence of such independency is an indirect comparison among different algorithms. Evolution Gym fills this gap by presenting a large variety of tasks with different difficulty levels that span from locomotion to manipulation. The proposed benchmark suite can be effectively used to test the generalizability of the algorithms on different tasks, potentially accelerating research in robot co-design.
38
+
39
+ # 3 Evolution Gym
40
+
41
+ ![](images/f540f0a25bd3a4ab567d628bc5020febbc9d55526a09cf77187a1637e5342b14.jpg)
42
+ Figure 1: Overview of Evolution Gym and its integration with the co-design algorithms. Evolution Gym is comprised of a back-end soft body simulator (A, B) and task-specific environments (C). A user-customized co-design algorithm can be plugged in to optimize for both robot structure and control through interacting with Evolution Gym on a certain task.
43
+
44
+ # 3.1 Overview
45
+
46
+ In this section, we present Evolution Gym, a large-scale benchmark for the co-design of voxel-based soft robots. Evolution Gym is featured by its versatile and expressive multi-material voxel-based structure design space, flexibility of the controller parameterization, wide spectrum of tasks of various difficulty levels, fast back-end soft-body simulation support, and user-friendly Python interfaces.
47
+
48
+ As shown in the overview in Figure 1, Evolution Gym is comprised of a task-specific environment and a back-end soft-body simulator. The gym suite provides seamless interfaces with a user-defined co-design algorithm. The co-design algorithm typically consists of a design optimizer and a control optimizer. The design optimizer can propose a new robot structure to the control optimizer, then the control optimizer will compute an optimized controller for the given structure through interactions with Evolution Gym and finally return the maximum reward that this robot structure can achieve. In this way, Evolution Gym provides an easy-to-use platform for co-design algorithms to evolve both robot structure and control to optimize for robots’ task performances. Evolution Gym is designed to be the first comprehensive testbed for benchmarking and comparing different co-design algorithms with the hope to facilitate the development of more novel and powerful algorithms in the co-design field.
49
+
50
+ # 3.2 Multi-material voxel-based representation
51
+
52
+ Evolution Gym employs a unified multi-material voxel-based representation for all the components in the environment (e.g., robot, terrain, object) as shown in Figure 1A. Specifically, each robot in our gym is composed of rigid voxels, soft voxels, horizontal/vertical actuator voxels, and empty voxels. For terrain and objects, we use the same voxel-based structure but with passive voxel types (i.e., soft/rigid voxels).
53
+
54
+ We chose a voxel-based representation for three main reasons. First, such a multi-material structure of robots provides a general and universal representation for various categories of robot designs and results in a modular structure design space. Additionally, with just the few voxel types described above, and less than 100 voxels per robot, we are able to construct a wide diversity of morphologies due to the resulting combinatorial robot design space. Even with this simple representation, our designed robots are capable of performing complex motions and completing difficult tasks. Finally, voxel-based robots can be simulated by a fast mass-spring simulation (see section 3.4) which allows our framework to be efficient enough to train robots in a matter of minutes and provides a computationally tractable benchmark for iterating co-design algorithms.
55
+
56
+ # 3.3 Task representation
57
+
58
+ Each task in Evolution Gym contains a robot structure proposed by the co-design algorithm, environment specifications (e.g., terrain, object), and a task-related goal (e.g., locomotion or manipulation). The tasks interface with the co-design algorithm through a few key elements including robot structure specification, observation, action, and reward. We introduce each element in detail below.
59
+
60
+ Robot structure specification As described in Section 3.2, we construct each robot from primitive building blocks arranged on a grid layout. In code, each robot is specified as a material matrix of voxels $\mathcal { M }$ and a connection link list $\mathcal { C }$ . The value of entry $m \in \mathcal { M }$ is a label corresponding to a voxel type from the set {Empty, Rigid, Soft, Horizontal Actuator, Vertical Actuator}. The connection link list $\mathcal { C }$ stores a list of connection pairs of adjacent voxels. The co-design algorithm can update the robot structure in the environment through initialization function with $\mathcal { M }$ and $\mathcal { C }$ as arguments.
61
+
62
+ Observation The observation is composed in each step to inform the controller of state information of the robot, terrain information of the environment, and goal-relevant information. More specifically, let $N$ be the total number of voxel corner points of the robot. Then the state information of the robot in our tasks is a $( 2 N + 3 )$ -D vector including the relative position of each voxel corner with respect to the center of mass of the robot (2N -D), and the velocity and orientation of center of mass (3-D). To handle complex tasks, specifically those with varying terrain types, an additional observation vector including terrain information is provided. We compile terrain information within a local window of size $2 W$ around the robot into a length- $2 W$ vector observation that describes the terrain’s elevation. Furthermore, goal-related information is offered to inform the controller of the execution status of the current task. This goal-related observation is task-specific and is defined on each task separately. For instance, in manipulation tasks where the robot interacts with some object $O$ , we provide orientation and velocity as well as the position of $O$ ’s center of mass relative to the robot.
63
+
64
+ Action At each time step, an action vector from the robot’s controller is provided to step Evolution Gym’s simulator. In Evolution Gym, each component of the action vector is associated with an actuator voxel (either horizontal or vertical) of the robot, and instructs a deformation target of that voxel. Specifically, the action value $u$ is within the range [0.6, 1.6], and corresponds to a gradual expansion/contraction of that actuator to $u$ times its rest length.
65
+
66
+ ![](images/053eb8c429dde48e5939018f6c3c0ddcb5a5e3b0be8c8177374baf33de67a0c2.jpg)
67
+ Figure 2: A visual overview of selected 10 environments from Evolution Gym. A verbal description of tasks is provided in Section 3.5.
68
+
69
+ Reward Each task is equipped with a reward function measuring the performance of the current robot and the control action. The value of the reward is defined step-wise and is fed back to the agent through step function. The reward function is highly task-specific and should be defined to precisely characterize the robot’s completeness of the task. Please refer to Section 3.5 and Appendix for detailed descriptions of the reward functions on each task.
70
+
71
+ # 3.4 Simulation engine
72
+
73
+ We model the dynamics of the underlying simulator as a 2D mass-spring system [26]. This simple, flexible formulation allows us to efficiently model soft robots with a wide range of capabilities in a wide range of environments. The simulation engine is written entirely in $\mathrm { C } { + + }$ . We create Python bindings of our simulator so it seamlessly interfaces with standard learning frameworks.
74
+
75
+ The simulation represents objects and their environment as a mass-spring system in a grid-like layout (Figure 1B). Objects and their environments are initialized as a set of non-overlapping, connected voxels. On initialization, each voxel is a cross-braced square, but may undergo deformation as the simulation progresses. Each edge acts as an ideal spring obeying Hooke’s law, with a spring constant defined by one of five possible material types. We employ symplectic RK-4 integration to step forward the simulation.
76
+
77
+ Collision detection is performed using a bounding-box tree structure [12]. Penalty-based contact forces and frictional forces are computed proportionally to the depth of penetration of the corresponding voxels in contact, and are applied on the voxel vertices in the normal and tangential directions of the contact respectively. Please refer to Appendix A for more details of simulation.
78
+
79
+ # 3.5 Benchmark environment suite
80
+
81
+ We have developed over 30 unique tasks with Evolution Gym and select 10 tasks here to illustrate the diversity and comprehensiveness of our benchmark task set. All tasks are organized into two categories – locomotion and manipulation – though some tasks are a mix of both. We further classify the tasks into different difficulty levels (i.e., easy, medium, hard) based on the performance of the baseline algorithms (see Section 4) on them. We briefly introduce the selected tasks in this section. For more detailed descriptions and visualizations of the tasks, please refer to our website or Appendix B. It is also worth mentioning that our gym is designed to be extendable and the user can easily create new tasks for their needs.
82
+
83
+ # 3.5.1 Locomotion tasks
84
+
85
+ Walker (Easy) This is a common standard task typically considered by previous works where the robot needs to walk on a flat terrain as fast as possible.
86
+
87
+ Bridge Walker (Easy) In this task, the robot traverses a series of soft “rope” bridges separated by fixed pillars, and similarly as before it needs to maximize its forward speed.
88
+
89
+ Up Stepper (Medium) The agent walks up a fixed staircase with steps of varying length.
90
+
91
+ Climber (Medium) The robot must climb two tall fixed walls on each side. The robot is rewarded by its upward climbing speed.
92
+
93
+ Traverser (Hard) In this hard task, the robot needs to traverse a pit of rigid blocks to get to the other side without sinking into the pit.
94
+
95
+ # 3.5.2 Object manipulation tasks
96
+
97
+ Carrier (Easy) The robot needs to catch a small, soft rectangular object initially dropped from above and then carry it along the forward direction. The robot is rewarded by the distance both it and the object have traveled.
98
+
99
+ Thrower (Medium) The robot throws a soft rectangular box as far as possible without moving itself significantly from its original position.
100
+
101
+ Beam Slider (Hard) In this task, a beam sits on top of a set of spaced-out floating platforms. The robot is rewarded for moving to the beam and sliding it in the forward direction.
102
+
103
+ Catcher (Hard) The agent needs to catch a spinning object randomly falling from a high location.
104
+
105
+ Lifter (Hard) The robot has to manipulate an object and lift it out of a hole.
106
+
107
+ # 4 Evolving soft robots
108
+
109
+ Robot evolution/co-design algorithms are formulated as a two-level optimization problem, which involves a design optimization method that evolves physical structures of the robots in the outer loop and a control optimization algorithm that computes an optimized controller for a given robot structure in the inner loop, as illustrated in Algorithm 1. We briefly introduce several instantiations of design optimization methods and control optimization methods in Section 4.1 and 4.2 that we use for evaluation on our benchmark, and more details can be found in Appendix C.
110
+
111
+ Inputs: Task specification $T$ , number of generations $n$ , population size $p$ .
112
+ Outputs: The best robot design $D ^ { * }$ and controller $C ^ { * }$ .
113
+ $S \emptyset$ // Dataset of robot designs, controllers and reward
114
+ $D _ { 1 } , . . . , D _ { p } \gets \mathrm { S A M P L E D E S I G N S } ( p )$ // Sample an initial population of robot designs
115
+ for $i \gets 1$ to $n$ do for $j 1$ to $p$ do $C _ { j } \gets 0 \mathrm { P T I M I Z E C O N T R O L } ( T , D _ { j } )$ // Optimize the controller of given robot design $r _ { j } \gets 1$ EVALUATEREWARD $( T , D _ { j } , C _ { j } )$ // Evaluate the reward of given design and controller $\bar { S } S \cup \{ ( D _ { j } , C _ { j } , r _ { j } ) \}$ // Update the evaluation result to the dataset $D _ { 1 } , . . . , D _ { p } \gets \mathrm { O P T I M I Z E D E S I G N S } ( S , p ) .$ // Optimize a population of robot designs to evaluate
116
+ Find the best design $D ^ { * }$ and controller $C ^ { * }$ in dataset $S$ with the maximum reward $r ^ { * }$ .
117
+
118
+ # 4.1 Design optimization
119
+
120
+ Design optimization aims at evolving robot structures to maximize the reward under two physical constraints: the body has to be connected, and actuators must exist. In this section, we introduce three instantiations of the design optimization algorithm (OPTIMIZEDESIGN in Algorithm 1).
121
+
122
+ Genetic algorithm (GA) GAs [24] are widely used in optimizing black-box functions by relying on biologically inspired operators such as mutation, crossover and selection, as demonstrated in previous works on evolving rigid robots [31, 39]. We implement a simple GA using elitism selection and a simple mutation strategy to evolve the population of robot designs. Specifically, in each generation, our elitism selection works by keeping the top $x \%$ of the robots from the current population as survivors and discarding the rest, where $x$ decreases gradually from 60 to 0 over generations. Next, we iteratively sample and mutate one of those survivors with $1 \dot { 0 } \%$ probability of changing each voxel of the robot to create more offsprings. Note that by mutating a voxel type from/to empty voxel, we are able to change the topology of the robot. The crossover operator is not implemented in our genetic algorithm.
123
+
124
+ Bayesian optimization (BO) BO [20, 25] is a commonly used global optimization method for black-box functions by learning and utilizing a surrogate model, which is usually employed to optimize expensive-to-evaluate functions, including evolving rigid robots in previous works [29, 21]. Specifically, we choose a batch BO algorithm as described in Kandasamy et al. [18] and implemented in the GPyOpt package [4] that supports categorical input data. We use Gaussian processes as the surrogate model, batch Thompson sampling for extracting the acquisition function, and L-BFGS algorithm to optimize the acquisition function. To ensure a fair comparison with other populationbased evolutionary baseline algorithms, the batch size of this algorithm is set equal to the population size of other algorithms.
125
+
126
+ CPPN-NEAT CPPN-NEAT is the predominant method for evolving soft robot design in previous literature [6, 7, 8]. In this method, the robot design is parameterized by a Compositional Pattern Producing Network (CPPN) [33]. The input to a CPPN is the spatial coordinate of a robot voxel and the output is the type of that voxel. Therefore, by querying the CPPN at all the spatial locations of a robot, we can obtain the type for each voxel to construct a robot. At the same time the NeuroEvolution of Augmenting Topologies (NEAT) algorithm [34] is used to evolve the structure of CPPNs by working as a genetic algorithm with specific mutation, crossover, and selection operators defined on network structures. Our implementation of CPPN-NEAT is based on the PyTorch-NEAT library [28] and the neat-python library [22].
127
+
128
+ # 4.2 Control optimization
129
+
130
+ In this section, we introduce the specific control optimization algorithm (OPTIMIZECONTROL in Algorithm 1) that we use in the robot evolution algorithms. In previous works on evolving soft robots, the controller is either encoded as a fixed periodic sequence of actuation [7] or is parameterized as a CPPN that outputs the frequency and phase offset of the periodic actuation for each voxel [8]. However, the periodic pattern of the control prevents robots from learning complex non-periodic tasks such as walking on uneven or varying terrains. Therefore, we use reinforcement learning (RL) [35] to train the controller, making it possible for the soft robots to perform arbitrarily complex tasks in our benchmark. Specifically, we apply a state-of-the-art RL algorithm named Proximal Policy Optimization (PPO) [30] for control optimization of robots, with code implementation given by [19].
131
+
132
+ # 5 Experiments and results
133
+
134
+ In this section we present the evaluation results of baseline robot co-design algorithms on 10 selected benchmark tasks described in Section 3.5. The complete evaluation results on all our benchmark tasks can be found in Appendix E.
135
+
136
+ We develop three baseline algorithms for robot evolution by combing the three design optimization methods in Section 4.1 and PPO for control optimization in Section 4.2. Since the control optimization method is the same for all baseline algorithms, we simply use GA, BO, CPPN-NEAT to denote these three baseline algorithms with different design optimization methods. The evaluations of our baseline algorithms are performed on machines with Intel Xeon CPU $\textcircled { \omega } 2 . 8 0 \mathrm { G H z } ^ { \ast } 8 0$ processors on Google Cloud Platform; GPU is not required. Evaluating one algorithm on a single task usually takes several hours to twenty hours, depending on the number of evaluations, size of population, etc. See Appendix D for more details on hyperparameters of all the experiments.
137
+
138
+ # 5.1 Comparisons among baseline algorithms
139
+
140
+ We plot the reward curves of the three baseline algorithms on 10 selected benchmark tasks in Figure 3. There is no single optimal algorithm that performs the best on all tasks, but overall, GA outperforms the other two baseline algorithms. This is surprising because our genetic algorithm is implemented with simple and intuitive operators for mutation and selection without sophisticated mechanisms. Therefore, we believe that with more carefully designed operators, GA has the potential to evolve much more intelligent robots. CPPN-NEAT generally performs well on locomotion tasks, as tested by previous works, but performs poorly on more complex manipulation tasks. This is possibly because
141
+
142
+ NEAT favors CPPNs with simpler structures, which encourages CPPNs to generate robots with more regular patterns. However, to succeed in complex manipulation tasks, some agile substructures of the robot must evolve, which might only exist in robots with irregular patterns. Finally, it is not surprising that BO performs poorly on most of the tasks because the high-dimensional categorical input parameter space and the noisy evaluation done by RL together pose a challenge to fitting an accurate surrogate model in BO.
143
+
144
+ ![](images/28e51489c7a7245067ab9847f4db9c6e44c41dc3361b5bced78ec9e49378767c.jpg)
145
+ Figure 3: Performance comparison among baseline algorithms. We plot the best performance of robots that each algorithm has evolved w.r.t. the number of evaluations on each task. All the curves are averaged over 6 different random seeds, and the variance is shown as a shaded region.
146
+
147
+ ![](images/d519dc86079772f8349aceead1bdea35217b757992471ed111590a2dd19d2cf5.jpg)
148
+ Figure 4: Evolution of robot designs. For each of the three selected tasks, we visualize the population in three different generations. Each column corresponds to one generation for which we show the four top performing robots along with their average reward.
149
+
150
+ # 5.2 Evolution analysis
151
+
152
+ In Figure 4 we visualize the top four robots in three different generations on training the genetic algorithm for the Carrier, Lifter, and Bridge Walker task. We also show the average reward these designs achieve.
153
+
154
+ In the carrier task, the robot must catch an object that falls from above and then carry that object as far as possible. Therefore, a successful design for this task achieves two main goals 1) allowing the robot to catch and hold the object securely 2) allowing the robot to move fast. We observe that robots with a block-holding mechanism and with legs are selected for in the top survivors of generation 1 (randomly initialized). As evolution progresses, these structures become increasingly optimized. Specifically, in later generations, the robots’ structures allow them to walk faster while still preventing the block from falling.
155
+
156
+ ![](images/8ffffcf3f893ce0f4598ad550be5790e071afbff144f94f4526036d0285a0e16.jpg)
157
+ Figure 5: Comparison between algorithm-optimized robots and hand designed robots on three tasks. In each task, we visualize one robot optimized by the algorithm and several hand-designed robots.
158
+
159
+ A similar comparison pattern can be seen in the Lifter task, where the algorithm learns a parallel gripper-like shape underneath the robot in order to manipulate an object. Unlike in the carrier task, the design structures that the algorithm generates are not prominently found in the initial generation. Finally, these patterns are echoed in the Bridge Walker task. Here the robot learns to evolve a large front foot to maximize its surface area and friction force to best walk across the soft rope bridge.
160
+
161
+ # 5.3 Comparison against hand-designed robots
162
+
163
+ We compare the performances of robots optimized by algorithm and the hand designed robots on several tasks to show the necessity of a co-design algorithm (Figure 5). The structure of the hand designed robots are bio-inspired and manually constructed according to our best intuition, and their control are optimized by PPO.
164
+
165
+ For every task, the hand designed robots are outperformed by at least one algorithm (usually more). For instance, for the Climber task we tested numerous natural robot designs. However, none of them successfully climbed very far. The issue with our designs is that we could not find the right trade off between getting traction on the wall, and accelerating upwards. The genetic algorithm, however, is able to find this balance. It develops leg-like structures that help the robot make forward progress, as well as a long flat back that maximizes contact/frictional forces with the wall. Additionally, the genetic algorithm selects for having a hole in the center of its body, which helps it achieve a certain optimized walking motion.
166
+
167
+ For other tasks, the performance between the hand designed robots and the robots produced by the algorithms is quite comparable. This is the case with the Carrier robots, as a very natural hand-designed Carrier robot performs almost as well as the best optimized robots produced by the design-optimization algorithms.
168
+
169
+ In the final case, there are tasks where neither a hand designed nor robot produced by the algorithm could achieve satisfying performance. One such environment is the Beam Slider environment. For this task, many of the hand design robots fail to even achieve the first part of the goal and position themselves underneath the beam. While there is one robot produced by the genetic algorithm that does slide the beam across several pegs, from visual observation we believe it comes nowhere close to exhibiting the optimal behavior in this environment. This suggests that further work is needed in designing co-optimization algorithms that can complete these hard tasks.
170
+
171
+ # 6 Conclusion and future work
172
+
173
+ In this paper we proposed Evolution Gym, the first large-scale benchmark for evolving the structure and control of soft robots. Through the wide spectrum of tasks in Evolution Gym, we systematically studied the performance of current state-of-the-art co-design algorithms. As a result, we observed how intelligent robots could be evolved autonomously from scratch yet still be capable of accomplishing some surprisingly complex tasks. We also discovered the limitations of existing techniques for evolving more intelligent embodied systems.
174
+
175
+ There are several potential directions to be explored in the future. First, with the help of our proposed benchmark, it is desirable to develop more advanced co-design algorithms to solve the difficult tasks which existing methods cannot address. Our currently implemented baseline algorithms share a bi-level optimization routine where the design optimization is in the outer loop while the control optimization is in the inner loop. However, Evolution Gym is agnostic to the specific training procedure used. As a result, some ideas for future work using our framework could include concurrently co-optimizing the design and control, neuroevolution algorithms, morphogenetic development, gradient-based methods for design optimization, or algorithms with decentralized controllers.
176
+
177
+ Second, a robot will be considered more successful if it can perform multiple tasks. Our benchmark suite naturally provides a comprehensive set of tasks and can potentially promote more exciting research work about multi-task or multi-objective robot co-design algorithms.
178
+
179
+ Another consideration is the specific morphological encodings used by the codesign algorithms as more intelligent encodings could lead to better performance. For instance, [38] analyzes the strengths and weaknesses of different morphological encodings. Our baseline algorithms use a direct encoding and CPPN but exploring other encoding representations remains interesting future work.
180
+
181
+ Finally, since tasks in Evolution Gym are currently limited to either locomotion or manipulation, we plan to further extend Evolution Gym to additional task categories such as flying or swimming by incorporating new simulation capabilities.
182
+
183
+ Overall, we believe our carefully-designed benchmarking tool fills an important missing piece in research in soft robotics and robotic evolution algorithms. Armed with the flexible and expressive framework Evolution Gym provides, we are optimistic that future researchers will use Evolution Gym as a standard test bed to improve co-design methods and evolve more intelligent robots.
184
+
185
+ # Societal Impact
186
+
187
+ We regard this work as a very preliminary piece of research in the field of soft robot co-design, and therefore think that we are still far away from causing harm to society. However, we can definitely foresee some problems if this technology were to be applied in the real world on a large scale. For instance, this work may inspire the automatic design of real biological creatures in which serious ethical issues exist. Additionally, since the users have full control over the reward design when customizing the benchmark environments, they could specify pernicious goals and encourage the co-design algorithm to produce more biased results.
188
+
189
+ # Acknowledgments and Disclosure of Funding
190
+
191
+ We thank Tao Du and the anonymous reviewers for their helpful comments in revising the paper. This work is supported by the Defense Advanced Research Projects Agency (FA8750-20-C-0075).
192
+
193
+ # References
194
+
195
+ [1] Ilge Akkaya, Marcin Andrychowicz, Maciek Chociej, Mateusz Litwin, Bob McGrew, Arthur Petron, Alex Paino, Matthias Plappert, Glenn Powell, Raphael Ribas, et al. Solving rubik’s cube with a robot hand. arXiv preprint arXiv:1910.07113, 2019.
196
+
197
+ [2] OpenAI: Marcin Andrychowicz, Bowen Baker, Maciek Chociej, Rafal Jozefowicz, Bob McGrew, Jakub Pachocki, Arthur Petron, Matthias Plappert, Glenn Powell, Alex Ray, et al. Learning dexterous in-hand manipulation. The International Journal of Robotics Research, 39(1):3–20, 2020.
198
+ [3] Jacob Austin, Rafael Corrales-Fatou, Sofia Wyetzner, and Hod Lipson. Titan: A parallel asynchronous library for multi-agent and soft-body robotics using nvidia cuda. In 2020 IEEE International Conference on Robotics and Automation (ICRA), pages 7754–7760, 2020.
199
+ [4] The GPyOpt authors. GPyOpt: A bayesian optimization framework in python. http:// github.com/SheffieldML/GPyOpt, 2016.
200
+ [5] Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym, 2016.
201
+ [6] Nicholas Cheney, Jeff Clune, and Hod Lipson. Evolved electrophysiological soft robots. In Artificial Life Conference Proceedings 14, pages 222–229. MIT Press, 2014.
202
+ [7] Nick Cheney, Robert MacCurdy, Jeff Clune, and Hod Lipson. Unshackling evolution: Evolving soft robots with multiple materials and a powerful generative encoding. SIGEVOlution, 7(1):11–23, August 2014.
203
+ [8] Francesco Corucci, Nick Cheney, Francesco Giorgio-Serchi, Josh Bongard, and Cecilia Laschi. Evolving soft locomotion in aquatic and terrestrial environments: effects of material properties and environmental transitions, 2017.
204
+ [9] Francesco Corucci, Nick Cheney, Francesco Giorgio-Serchi, Josh Bongard, and Cecilia Laschi. Evolving soft locomotion in aquatic and terrestrial environments: effects of material properties and environmental transitions. Soft robotics, 5(4):475–495, 2018.
205
+ [10] Francesco Corucci, Nick Cheney, Hod Lipson, Cecilia Laschi, and Josh Bongard. Evolving swimming soft-bodied creatures. In ALIFE XV, The Fifteenth International Conference on the Synthesis and Simulation of Living Systems, Late Breaking Proceedings, volume 6, 2016.
206
+ [11] Yan Duan, Xi Chen, Rein Houthooft, John Schulman, and Pieter Abbeel. Benchmarking deep reinforcement learning for continuous control. In International conference on machine learning, pages 1329–1338. PMLR, 2016.
207
+ [12] Christer Ericson. Real-time collision detection. CRC Press, 2004.
208
+ [13] David Ha. Reinforcement learning for improving agent design. Artificial life, 25(4):352–365, 2019.
209
+ [14] Donald J Hejna III, Pieter Abbeel, and Lerrel Pinto. Task-agnostic morphology evolution. arXiv preprint arXiv:2102.13100, 2021.
210
+ [15] Jonathan Hiller and Hod Lipson. Dynamic simulation of soft multimaterial 3d-printed objects. Soft robotics, 1(1):88–101, 2014.
211
+ [16] Zhiao Huang, Yuanming Hu, Tao Du, Siyuan Zhou, Hao Su, Joshua B. Tenenbaum, and Chuang Gan. Plasticinelab: A soft-body manipulation benchmark with differentiable physics, 2021.
212
+ [17] Jemin Hwangbo, Joonho Lee, Alexey Dosovitskiy, Dario Bellicoso, Vassilios Tsounis, Vladlen Koltun, and Marco Hutter. Learning agile and dynamic motor skills for legged robots. Science Robotics, 4(26), 2019.
213
+ [18] Kirthevasan Kandasamy, Akshay Krishnamurthy, Jeff Schneider, and Barnabás Póczos. Parallelised bayesian optimisation via thompson sampling. In International Conference on Artificial Intelligence and Statistics, pages 133–142. PMLR, 2018.
214
+ [19] Ilya Kostrikov. Pytorch implementations of reinforcement learning algorithms. https:// github.com/ikostrikov/pytorch-a2c-ppo-acktr-gail, 2018.
215
+ [20] Harold J Kushner. A new method of locating the maximum point of an arbitrary multipeak curve in the presence of noise. 1964.
216
+ [21] Thomas Liao, Grant Wang, Brian Yang, Rene Lee, Kristofer Pister, Sergey Levine, and Roberto Calandra. Data-efficient learning of morphology and controller for a microrobot. In 2019 International Conference on Robotics and Automation (ICRA), pages 2488–2494. IEEE, 2019.
217
+ [22] Alan McIntyre, Matt Kallada, Cesar G. Miguel, and Carolina Feher da Silva. neat-python. https://github.com/CodeReclaimers/neat-python.
218
+ [23] Eric Medvet, Alberto Bartoli, Andrea De Lorenzo, and Stefano Seriani. 2d-vsr-sim: A simulation tool for the optimization of 2-d voxel-based soft robots. SoftwareX, 12:100573, 2020.
219
+ [24] Zbigniew Michalewicz. Genetic algorithms $^ +$ data structures $=$ evolution programs. Springer Science & Business Media, 2013.
220
+ [25] J. Mockus. On bayesian methods for seeking the extremum. In G. I. Marchuk, editor, ˇ Optimization Techniques IFIP Technical Conference Novosibirsk, July 1–7, 1974, pages 400–404, Berlin, Heidelberg, 1975. Springer Berlin Heidelberg.
221
+ [26] Andrew Nealen, Matthias Müller, Richard Keiser, Eddy Boxerman, and Mark Carlson. Physically based deformable models in computer graphics. In Computer graphics forum, volume 25, pages 809–836. Wiley Online Library, 2006.
222
+ [27] Deepak Pathak, Chris Lu, Trevor Darrell, Phillip Isola, and Alexei A Efros. Learning to control self-assembling morphologies: a study of generalization via modularity. arXiv preprint arXiv:1902.05546, 2019.
223
+ [28] Uber Research. pytorch-neat. https://github.com/uber-research/PyTorch-NEAT.
224
+ [29] Charles Schaff, David Yunis, Ayan Chakrabarti, and Matthew R Walter. Jointly learning to construct and control agents using deep reinforcement learning. In 2019 International Conference on Robotics and Automation (ICRA), pages 9798–9805. IEEE, 2019.
225
+ [30] John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms, 2017.
226
+ [31] Karl Sims. Evolving virtual creatures. In Proceedings of the 21st annual conference on Computer graphics and interactive techniques, pages 15–22, 1994.
227
+ [32] Andrew Spielberg, Allan Zhao, Yuanming Hu, Tao Du, Wojciech Matusik, and Daniela Rus. Learning-in-the-loop optimization: End-to-end control and co-design of soft robots through learned deep latent representations. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché- Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019.
228
+ [33] Kenneth O Stanley. Compositional pattern producing networks: A novel abstraction of development. Genetic programming and evolvable machines, 8(2):131–162, 2007.
229
+ [34] Kenneth O Stanley and Risto Miikkulainen. Evolving neural networks through augmenting topologies. Evolutionary computation, 10(2):99–127, 2002.
230
+ [35] Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, 2018.
231
+ [36] Yuval Tassa, Yotam Doron, Alistair Muldal, Tom Erez, Yazhe Li, Diego de Las Casas, David Budden, Abbas Abdolmaleki, Josh Merel, Andrew Lefrancq, Timothy Lillicrap, and Martin Riedmiller. Deepmind control suite, 2018.
232
+ [37] Merel Van Diepen and Kristina Shea. A spatial grammar method for the computational design synthesis of virtual soft locomotion robots. Journal of Mechanical Design, 141(10), 2019.
233
+ [38] Frank Veenstra and Kyrre Glette. How different encodings affect performance and diversification when evolving the morphology and control of 2d virtual creatures. In Artificial Life Conference Proceedings, pages 592–601. MIT Press, 2020.
234
+ [39] Tingwu Wang, Yuhao Zhou, Sanja Fidler, and Jimmy Ba. Neural graph evolution: Towards efficient automatic robot design, 2019.
235
+ [40] Fei Xia, Amir R Zamir, Zhiyang He, Alexander Sax, Jitendra Malik, and Silvio Savarese. Gibson env: Real-world perception for embodied agents. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 9068–9079, 2018.
236
+ [41] Allan Zhao, Jie Xu, Mina Konakovic-Lukovi ´ c, Josephine Hughes, Andrew Spielberg, Daniela ´ Rus, and Wojciech Matusik. Robogrammar: Graph grammar for terrain-optimized robot design. ACM Trans. Graph., 39(6), November 2020.
237
+
238
+ # Checklist
239
+
240
+ 1. For all authors...
241
+
242
+ (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
243
+ (b) Did you describe the limitations of your work? [Yes] See Section 6.
244
+ (c) Did you discuss any potential negative societal impacts of your work? [Yes] See Section 6.
245
+ (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
246
+
247
+ 2. If you are including theoretical results...
248
+
249
+ (a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
250
+
251
+ 3. If you ran experiments...
252
+
253
+ (a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] The URL is presented in the abstract.
254
+ (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Appendix D.
255
+ (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] We ran experiments with multiple random seeds and reported error bars. See Section 5.
256
+ (d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Section 5.
257
+
258
+ 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
259
+
260
+ (a) If your work uses existing assets, did you cite the creators? [Yes] The existing code implementation for our baseline algorithms are cited in Section 4.
261
+ (b) Did you mention the license of the assets? [Yes] This benchmark platform will be released under the MIT license. See Section 1.
262
+ (c) Did you include any new assets either in the supplemental material or as a URL? [Yes] The URL is presented in the abstract.
263
+ (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
264
+ (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
265
+
266
+ 5. If you used crowdsourcing or conducted research with human subjects...
267
+
268
+ (a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
269
+ (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
270
+ (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
md/train/f4jw35Vrk6d/f4jw35Vrk6d.md ADDED
@@ -0,0 +1,358 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Improving Entropic Out-of-Distribution Detection using Isometric Distances and the Minimum Distance Score
2
+
3
+ Anonymous Author(s)
4
+ Affiliation
5
+ Address
6
+ email
7
+
8
+ # Abstract
9
+
10
+ 1 Current out-of-distribution detection approaches usually present special require
11
+ 2 ments (e.g., collecting outlier data and hyperparameter validation) and produce
12
+ 3 side effects (classification accuracy drop and slow/inefficient inferences). Recently,
13
+ 4 entropic out-of-distribution detection has been proposed as a seamless approach
14
+ 5 (i.e., a solution that avoids all the previously mentioned drawbacks). The entropic
15
+ 6 out-of-distribution detection solution comprises the IsoMax loss for training and
16
+ 7 the entropic score for out-of-distribution detection. The IsoMax loss works as a
17
+ 8 SoftMax loss drop-in replacement because swapping the SoftMax loss with the
18
+ 9 IsoMax loss requires no changes in the model’s architecture or training proce
19
+ 10 dures/hyperparameters. In this paper, we propose to perform what we call an
20
+ 11 isometrization of the distances used in the IsoMax loss. Additionally, we propose
21
+ 12 to replace the entropic score with the minimum distance score. Our experiments
22
+ 13 showed that these simple modifications increase out-of-distribution detection per
23
+ 14 formance while keeping the solution seamless.
24
+
25
+ # 15 1 Introduction
26
+
27
+ 16 Neural networks have been used in classification tasks in many real-world applications [4]. In such
28
+ 17 cases, the system usually needs to be able to identify whether a given input belongs to any of the
29
+ 18 classes on which it was trained. Hendrycks & Gimpel [9] called this capability out-of-distribution
30
+ 19 (OOD) detection and proposed datasets and metrics to allow standardized performance evaluation
31
+ 20 and comparison. However, current OOD detection solutions still present limitations (e.g., special
32
+ 21 requirements and side effects) that prevent a more general use of OOD detection capabilities in
33
+ 22 practical real-world applications [27] (Table 1).
34
+ 23 First, OOD detection solutions commonly present hyperparameters that usually presume access to
35
+ 24 out-of-distribution samples to be defined [23, 22, 19, 18, 3]. A consequence of presuming access to
36
+ 25 OOD samples to validate hyperparameters and using the same distribution to evaluate OOD detection
37
+ 26 results is producing overestimated performance estimations [32]. To avoid unrealistic access to OOD
38
+ 27 samples and overestimated performance, Lee et al. [19] proposed to validate hyperparameters using
39
+ 28 adversarial samples. However, this requires the generation of adversarial examples. Moreover, this
40
+ 29 procedure requires the determination of hyperparameters (e.g., maximum adversarial perturbation)
41
+ 30 typically unknown when dealing with novel datasets. Similar arguments hold for solutions based on
42
+ 31 adversarial training [8, 17, 21, 14, 18], which also result in higher training time. Approaches based
43
+ 32 on the generation of adversarial examples or the use of adversarial training may also have limited
44
+ 33 scalability when dealing with large images such as those presented in the ImageNet [2].
45
+ 34 Many solutions make use of the so-called input preprocessing technique introduced in ODIN [23].
46
+ 35 However, the use of the mentioned technique increases at least four times the inference delay and
47
+ 36 power consumption [27] since a combination of a first forward pass, backpropagation operation, and
48
+ 37 second forward pass is required [23, 19, 11, 3] for a single useful inference. Actually, approaches
49
+ 38 that may be applied directly to pretrained models and altogether avoid training or fine-tuning the
50
+ 39 model [23, 19, 30] usually produce inefficient inferences and/or additional computational complexity
51
+ 40 to perform OOD detection [26, Section IV, D]. From a practical point of view, this is a drawback, as
52
+ 41 inferences may be performed thousands or millions of times in the field. Hence, such approaches may
53
+ 42 be prohibitive (not sustainable) from environmental $[ 3 1 ] ^ { 1 }$ and real-world cost-based perspectives.
54
+ 43 Another harmful common side effect is the so-called classification accuracy drop2 [34, 11]. In such
55
+ 44 cases, higher OOD detection performance is achieved at the expense of a drop in the classification
56
+ 45 accuracy compared with models trained using the usual SoftMax loss (i.e., the combination of the
57
+ 46 SoftMax activation and the cross-entropy loss [24]). From a practical perspective, this situation is
58
+ 47 undesired because the detection of out-of-distribution samples may be a rare event. At the same time,
59
+ 48 the classification is the main aim of the designed system [1].
60
+ 49 Hsu et al. [11] proposed to use the in-distribution validation set to avoid the need for accessing
61
+ 50 OOD samples to determine the hyperparameters required by the solution. However, considering that
62
+ 51 CIFAR10 and CIFAR100 do not have separated sets for validation and testing, the results may also be
63
+ 52 overestimated because the validation sets used to define the hyperparameters were reused for OOD
64
+ 53 detection performance estimation. A more realistic OOD detection performance estimation could
65
+ 54 have been achieved by removing the in-distribution validation set from in-distribution training data.
66
+ 55 However, this would probably produce an even higher classification accuracy drop. Additionally, the
67
+ 56 solution proposed in [11] is expensive and not environment-friendly, as it uses input preprocessing
68
+ 57 and, consequently, produces slow and energy-inefficient inferences [27, 26]. Recently, many OOD
69
+ 58 detection approaches have used additional/extra/outlier data [10, 25, 5]. The Gram matrices solution
70
+ 59 calculates values produced by the model during inference [30] to perform OOD detection.
71
+
72
+ Table 1: Out-of-distribution detection approaches: special requirements and side effects.
73
+
74
+ <table><tr><td rowspan="2">Approach</td><td colspan="2">Special Requirement</td><td colspan="2">Side Effect</td></tr><tr><td>Hyperparameter Tuning</td><td>Outlier Data</td><td>Slow/Inefficient Inference</td><td>Classification Accuracy Drop</td></tr><tr><td>ODIN [23]</td><td>Required</td><td> Not Required</td><td>Present</td><td>Not Present</td></tr><tr><td>Mahalanobis [19]</td><td>Required</td><td>Not Required</td><td>Present</td><td>Not Present</td></tr><tr><td>ACET [8]</td><td>Required</td><td>Not Required</td><td>Not Present</td><td>Present</td></tr><tr><td>Outlier Exposure [10]</td><td>Not Required</td><td>Required</td><td>Not Present</td><td>Not Present</td></tr><tr><td>Generalized ODIN [11]</td><td>Required</td><td>Not Required</td><td>Present</td><td>Present</td></tr><tr><td>Gram Matrices [30]</td><td>Not Required</td><td>Not Required</td><td>Present</td><td>Not Present</td></tr><tr><td>Scaled Cosine [34]</td><td>Not Required</td><td>Not Required</td><td>Not Present</td><td>Present</td></tr><tr><td>Energy-based [25]</td><td>Required</td><td>Required</td><td>Not Present</td><td>Not Present</td></tr><tr><td>Entropic (Seamless) [27,26] IsoMax + Entropic Score</td><td>Not Required</td><td>Not Required</td><td>Not Present</td><td>Not Present</td></tr><tr><td>Entropic (Seamless) [ours] IsoMaxz + MinDistance Score</td><td>Not Required</td><td>Not Required</td><td>Not Present</td><td>Not Present</td></tr></table>
75
+
76
+ In some cases, an ensemble of classifiers is used [35]. For deep ensembles, Lakshminarayanan et al. [17] proposed an ensemble of same-architecture models trained with different random initial weights. Some proposals required model structural changes to tackle OOD detection [37], and certain trials used uncertainty or confidence estimation/calibration techniques [13, 20, 28, 16, 33]. However, Bayesian neural networks used in most of these are usually harder to implement and require
77
+
78
+ 65 much more computational resorces to train. Moreover, computational constraints usually require
79
+ 66 approximations that compromise the performance, which is also affected by the prior distribution
80
+ 67 used [17]. For example, MC-dropout uses pretrained models with dropout activated during the test
81
+ 68 time. An average of many inferences is used to perform a single decision [6].
82
+ 69 The entropic out-of-distribution detection approach, which is composed of the IsoMax loss for training
83
+ 70 and the entropic score for OOD detection, avoids all mentioned special requirements and side effects
84
+ 71 [27]. Indeed, no hyperparameter tuning is required because the entropic scale is a global constant
85
+ 72 kept equal to ten for all combinations of datasets and models. Even if we call the entropic scale a
86
+ 73 “hyperparameter”, the IsoMax does not involve hyperparameter tuning, as the same constant value of
87
+ 74 entropic scale is used in all situations. This is possible because Macêdo et al. experimentally showed
88
+ 75 in [27, Fig. 3] and in [26, Section IV, A] that the OOD detection performance presents a well-behaved
89
+ 76 dependence on the entropic scale regardless of the dataset and model. No additional/extra/outlier
90
+ 77 data are necessary. Models trained using IsoMax loss produce inferences as fast and energy-efficient
91
+ 78 as the inferences produced by SoftMax-loss-trained networks. The OOD detection requires only a
92
+ 79 speedy entropy calculation. Finally, no classification accuracy drop is observed.
93
+ 80 Contributions Our contribution in this paper is threefold: First, in addition to minor changes, we
94
+ 81 perform what we call an isometrization of the feature-prototype distances used by the IsoMax loss.
95
+ 82 We call our modified version of IsoMax the isometric isotropy maximization loss or isometric IsoMax
96
+ 83 loss $\operatorname { ( I s o M a x } _ { \mathbb { Z } }$ loss). Second, we propose to use the minimum feature-prototype distance as the score
97
+ 84 to perform OOD detection. Considering that the minimum feature-prototype distance is calculated
98
+ 85 to perform the classification, the OOD detection task presents essentially zero computational cost
99
+ 86 because we simply reuse this value as the score to perform OOD detection. Third, in addition to
100
+ 87 experimental evidence, we provide insights into why a combination of training using the isometric
101
+ 88 distances provided by $\operatorname { I s o M a x } _ { \mathbb { Z } }$ and performing OOD detection using the minimum distance scores
102
+ 89 produces a substantial performance increase in OOD detection compared to IsoMax combined with
103
+ 90 the entropic score. Our approach keeps the solution seamless (i.e., it avoids the previously mentioned
104
+ 91 special requirements and side effects) while significantly increasing the OOD detection performance.
105
+ 92 Similar to IsoMax loss, $\operatorname { I s o M a x } _ { \mathbb { Z } }$ works as a SoftMax loss drop-in replacement, as no procedures
106
+ 93 other than regular neural network training are required.
107
+
108
+ # 94 2 Isometric Distances and Minimum Distance Score
109
+
110
+ 95 Isometric Distances Consider an input $_ { \textbf { \em x } }$ applied to a neural network that performs a parametrized
111
+ 96 transformation ${ f } _ { \boldsymbol { \theta } } ( \boldsymbol { x } )$ . Moreover, consider $p _ { \phi } ^ { j }$ be the learnable prototype associated with the class $j$ .
112
+ 97 Additionally, let the expression $\| f _ { \theta } ( \pmb { x } ) - \pmb { p } _ { \phi } ^ { j } \|$ represent the nonsquared Euclidean distance between
113
+ 98 ${ f } _ { \theta } ( { \pmb x } )$ and $ { p _ { \phi } ^ { j } }$ . Finally, consider $ { p _ { \phi } ^ { k } }$ as a learnable prototype associated with the correct class for the
114
+ 99 input $_ { \textbf { \em x } }$ . Hence, we write the IsoMax loss [27] for a batch of $N$ examples using the equation below:
115
+
116
+ $$
117
+ \mathcal { L } _ { \sf l s o M a x } = - \frac { 1 } { N } \sum _ { k = 1 } ^ { N } \log \left( \frac { \exp ( - E _ { s } \| \mathbf { \cdot } \mathbf { \boldsymbol { f } } _ { \theta } ( x ) - \mathbf { \boldsymbol { p } } _ { \phi } ^ { k } \| ) } { \sum _ { j } \exp ( - E _ { s } \| \mathbf { \cdot } \mathbf { \boldsymbol { f } } _ { \theta } ( x ) - \mathbf { \boldsymbol { p } } _ { \phi } ^ { j } \| ) } \right)
118
+ $$
119
+
120
+ 100 In the above equation, the $E _ { s }$ represents the entropic scale. From Equation (1), we observe that
121
+ 101 the distances from IsoMax loss are given by the expression $\mathcal { D } = \| f _ { \theta } ( \pmb { x } ) - \pmb { p } _ { \phi } ^ { j } \|$ . During inference,
122
+ 102 probabilities calculated based on these distances are used to produce the negative entropy, which
123
+ 103 serves as a score to perform OOD detection. However, as the features ${ f } _ { \theta } ( { \pmb x } )$ are unnormalized,
124
+ 104 examples with low norms are unjustifiably favored to be considered OOD examples since they tend
125
+ 105 to produce high entropy. Additionally, as the weights $ { p _ { \phi } ^ { j } }$ are unnormalized, examples from classes
126
+ 106 that present prototypes with low norms are unjustifiably favored to be considered OOD examples for
127
+ 107 the same reason.
128
+
129
+ 108 Hence, we propose to replace ${ f } _ { \theta } ( { \pmb x } )$ with its normalized version given by $\widehat { { f _ { \theta } ( \mathbf { x } ) } } { = } f _ { \theta } ( \mathbf { x } ) / \| f _ { \theta } ( \mathbf { \boldsymbol { x } } ) \|$ . Additionally, we propose to replace 109 $ { p _ { \phi } ^ { j } }$ with its normalized version given by $\scriptstyle { p _ { \phi } ^ { j } = p _ { \phi } ^ { j } / \| p _ { \phi } ^ { j } \| }$ . The 110 expression $\lVert \boldsymbol { v } \rVert$ represents the 2-norm of a given vector $\textbf { { v } }$ .
130
+
131
+ Table 2: Classification accuracy of models trained using SoftMax, IsoMax, and $\mathbf { I s o M a x } _ { \mathcal { T } }$ losses. In addition to avoiding classification accuracy drop compared with SoftMax-loss- and IsoMax-losstrained networks, IsoMax $\boldsymbol { \mathcal { Z } }$ -loss-trained models show higher OOD detection performance (Table 3).
132
+
133
+ <table><tr><td>Model</td><td>Data</td><td>Train Accuracy (%) [↑] SoftMax Loss / IsoMax Loss / IsoMaxz Loss</td><td>Test Accuracy (%)[↑]</td></tr><tr><td rowspan="3">DenseNetBC100</td><td>CIFAR10</td><td>99.9 / 99.9 / 99.9</td><td>95.4 /95.2 /95.2</td></tr><tr><td>CIFAR100</td><td>99.9 /99.0 / 99.9</td><td>77.5 / 77.5 / 76.8</td></tr><tr><td>SVHN</td><td>96.9 / 97.6 /97.1</td><td>96.6 /96.6 /96.6</td></tr><tr><td rowspan="3">ResNet110</td><td>CIFAR10</td><td>99.9 / 99.9 / 99.9</td><td>94.5 /94.6 /94.6</td></tr><tr><td>CIFAR100</td><td>99.5 / 99.9 / 99.8</td><td>72.7 /74.1/ 73.9</td></tr><tr><td>SVHN</td><td>99.8 / 99.9 / 99.5</td><td>96.7 /96.9 /96.9</td></tr></table>
134
+
135
+ 111 However, while the distances in the original IsoMax loss may vary from zero to infinity, the distance
136
+ 112 between two normalized vectors is always equal to or lower than two. To avoid this unjustifiable and
137
+ 113 unreasonable restriction, we introduce the distance scale $d _ { s }$ , which is a scalar learnable parameter.
138
+ 114 Naturally, we require the distance scale to always be positive by taking its absolute value $| d _ { s } |$ .
139
+ 115 The feature normalization makes the solution isometric regardless of the norm of the features produced
140
+ 116 by the examples. The distance scale is class independent, as it is a single scalar value regularly
141
+ 117 learnable during training. The weight normalization and the class independence of the distance scale
142
+ 118 make the solution isometric regarding all classes. Hence, the proposed distance is isometric because
143
+ 119 it produces an isometric treatment of all features, prototypes, and classes. Therefore, we can write
144
+ 120 the expression for the isometric distances used by the $\operatorname { I s o M a x } _ { \mathcal { T } }$ loss as:
145
+
146
+ $$
147
+ \mathcal { D } _ { \mathcal { T } } = \left| d _ { s } \right| \widehat { \| f _ { \theta } ( x ) } - \widehat { p _ { \phi } ^ { j } } \|
148
+ $$
149
+
150
+ 121 Returning to Equation (1), we can write the expression for the $\operatorname { I s o M a x } _ { \mathbb { Z } }$ loss as follows:
151
+
152
+ $$
153
+ \mathcal { L } _ { \mathsf { l s o M a x } _ { \boldsymbol { \tau } } } = - \frac { 1 } { N } \sum _ { k = 1 } ^ { N } \log \left( \frac { \exp ( - E _ { s } \left| \boldsymbol { d } _ { s } \right| \left\| \widehat { \pmb { f _ { \theta } ( x ) } } - \widehat { \pmb { p _ { \phi } ^ { k } } } \right\| ) } { \sum _ { j } \exp ( - E _ { s } \left| \boldsymbol { d } _ { s } \right| \left\| \widehat { \pmb { f _ { \theta } ( x ) } } - \widehat { \pmb { p _ { \phi } ^ { j } } } \right\| ) } \right)
154
+ $$
155
+
156
+ 122 Applying the entropy maximization trick (i.e., the removal of the entropic score $E _ { s }$ for inference) [27],
157
+ 123 we can write the expression for the $\operatorname { I s o M a x } _ { \mathcal { T } }$ loss probabilities used during inference for performing
158
+ 124 OOD detection when using the entropic score [27]:
159
+
160
+ $$
161
+ \mathcal { P } _ { \mathsf { l s o M a x } _ { \mathcal { Z } } } ( y ^ { ( i ) } | x ) = \frac { \exp ( - \left| d _ { s } \right| \sqrt { f _ { \theta } ( x ) } - \widehat { p _ { \phi } ^ { i } } \| ) } { \sum _ { j } \exp ( - \left| d _ { s } \right| \| \widehat { f _ { \theta } ( x ) } - \widehat { p _ { \phi } ^ { j } } \| ) }
162
+ $$
163
+
164
+ 125 Different from IsoMax loss where the prototypes are initialized to a zero vector, we initialized all
165
+ 126 prototypes using a normal distribution with a mean of zero and standard deviation of one. This
166
+ 127 approach is necessary because we normalize the prototypes when using $\operatorname { I s o M a x } _ { \mathcal { T } }$ loss. The distance
167
+ 128 scale is initialized to one. We add no hyperparameters to the solution.
168
+ 129 Minimum Distance Score Motivated by the desired characteristics of the isometric distances used
169
+ 130 in $\operatorname { I s o M a x } _ { \mathbb { Z } }$ , we propose to use what we call the minimum distance as the score for performing OOD
170
+ 131 detection. Naturally, the minimum distance score for the $\operatorname { I s o M a x } _ { \mathcal { Z } }$ is given by:
171
+
172
+ $$
173
+ S _ { \mathrm { M i n D i s t a n c e } } = \operatorname* { m i n } _ { j } \left( \| { \widehat { \mathbf { f } _ { \theta } ( x ) } } - { \widehat { \mathbf { p } _ { \phi } ^ { j } } } \| \right)
174
+ $$
175
+
176
+ Table 3: Fair comparison of seamless approaches: No hyperparameter tuning, no additional/extra/outlier data, no classification accuracy drop, and no slow/inefficient inferences. SoftMax+ES means training using SoftMax loss and performing OOD detection using the entropic score (ES). IsoMax+ES means training using IsoMax loss and performing OOD detection using the entropic score (ES). $\operatorname { I s o M a x } _ { \mathbb { Z } } { + } \mathbf { M } \mathbf { D } \mathbf { S }$ means training using $\operatorname { I s o M a x } _ { \mathcal { Z } }$ loss and performing OOD detection using minimum distance score (MDS). The best results are in bold ( $0 . 5 \%$ tolerance).
177
+
178
+ <table><tr><td rowspan="2">Model</td><td rowspan="2">Data (training)</td><td rowspan="2">OOD (unseen)</td><td colspan="2">Out-of-Distribution Detection: Seamless Approaches.</td></tr><tr><td>TNR@TPR95 (%) [↑] SoftMax+ES /IsoMax+ES /IsoMaxx+MDS (ours)</td><td>AUROC (%) [↑]</td></tr><tr><td rowspan="5">DenseNetBC100</td><td>CIFAR10</td><td>SVHN TinyImageNet LSUN</td><td>33.2 / 77.0 /97.2 59.8 / 88.0 / 92.5</td><td>86.9 / 96.6 / 99.5 94.2/97.8/98.6</td></tr><tr><td>CIFAR100</td><td>SVHN TinyImageNet</td><td>69.5 / 94.5 /95.3 24.9/ 23.4/ 78.6 23.7 / 49.1 / 85.6</td><td>95.9 / 98.8 / 99.1 81.9 / 88.6 / 96.5 78.8 / 92.6 / 97.6</td></tr><tr><td rowspan="2"></td><td>LSUN</td><td>24.4 / 63.0 / 83.4</td><td>77.9 /94.7 / 97.4</td></tr><tr><td>CIFAR10</td><td>83.7 / 94.1 /95.3</td><td>96.9 / 98.5 /99.1</td></tr><tr><td rowspan="2">SVHN</td><td>TinyImageNet LSUN</td><td>90.0 / 97.0/98.3</td><td>98.1/99.1/99.7</td></tr><tr><td>SVHN</td><td></td><td>88.4 / 96.8 /97.8</td><td>97.8 / 99.1 / 99.7</td></tr><tr><td rowspan="6">ResNet110</td><td>CIFAR10</td><td>TinyImageNet</td><td>37.8/ 73.0/83.6 43.7 /73.7/75.5</td><td>89.6 / 95.1 / 97.3</td></tr><tr><td rowspan="2"></td><td>LSUN</td><td>52.1 / 82.8 /86.3</td><td>90.6 / 95.9/96.0 92.8 /96.9 / 97.7</td></tr><tr><td>SVHN</td><td></td><td></td></tr><tr><td rowspan="2">CIFAR100</td><td>TinyImageNet</td><td>15.4 / 18.7 /30.7</td><td>67.5 / 84.7 / 85.8</td></tr><tr><td>LSUN</td><td>18.8 /26.3 /42.9</td><td>73.5/ 84.5 / 87.9</td></tr><tr><td rowspan="2">SVHN</td><td>CIFAR10</td><td>21.3 / 30.2/46.9</td><td>76.4 / 87.1 / 89.4</td></tr><tr><td rowspan="2"></td><td>TinyImageNet</td><td>68.6 / 80.4 / 72.0 71.7 / 84.4 / 83.1</td><td>91.7 / 95.2/93.3</td></tr><tr><td>LSUN</td><td>69.1/ 80.4/ 76.3</td><td>93.1 / 95.8/96.2 91.8 /94.3/94.3</td></tr></table>
179
+
180
+ 132 In the previous equation, $| d _ { s } |$ was removed because it is a scale factor that does not change after
181
+ 133 the training is completed. The minimum distance is computed to perform the classification, as the
182
+ 134 predicted class is the one that presents the lowest feature-prototype distance. Therefore, when using
183
+ 135 this score, the OOD detection presents essentially zero latency and computational cost, as we simply
184
+ 136 reuse the minimum distance already calculated.
185
+
186
+ # 137 3 Experiments
187
+
188
+ 138 To allow standardized comparison, we used the datasets, training procedures, and metrics that were
189
+ 139 established in Hendrycks & Gimpel [9] and adopted in many subsequent OOD detection papers
190
+ 140 [23, 19, 8]. We did not compare to approaches that produce classification accuracy drop (e.g.,
191
+ 141 [34, 11]), as this is a substantial limitation from a practical perspective [1]. The code to reproduce the
192
+ 142 results is available as supplementary material.
193
+ 143 We trained many 100-layer DenseNetBCs with growth rate $k = 1 2$ (i.e., 0.8M parameters) [12],
194
+ 144 110-layer ResNets $[ 7 ] ^ { 3 }$ , and 34-layer ResNets $[ 7 ] ^ { \overline { { 4 } } }$ on CIFAR10 [15], CIFAR100 [15], and SVHN
195
+ 145 [29] datasets with SoftMax, IsoMax, and $\operatorname { I s o M a x } _ { \mathbb { Z } }$ losses using the same procedures (e.g., initial
196
+ 146 learning rate, learning rate schedule, weight decay) presented in Lee et al. [19].
197
+
198
+ We used SGD with the Nesterov moment equal to 0.9 during 300 epochs with a batch size of 64, and an initial learning rate of 0.1 with a learning rate decay rate equal to ten applied in the epoch number 150, 200, and 250. The weight decay was 0.0001. We did not use dropout. We used a computer with CPU Intel i7-4790K, 4.00GHz, x64, octa-core, 32Gb RAM, and a GPU Nvidia GTX 1080 Ti.
199
+
200
+ Table 4: Unfair comparison with approaches that use input preprocessing and produce slow/inefficient inferences in addition to requiring validation using adversarial examples. ODIN and Mahalanobis were applied to models trained using SoftMax loss. These approaches present at least four times slower and less power efficient inferences [27], as they use input preprocessing. Their hyperparameters were validated using adversarial examples. $\operatorname { I s o M a x } _ { \mathbb { Z } } { + } \mathbf { M } \mathbf { D } \mathbf { S }$ (ours) means training using $\operatorname { I s o M a x } _ { \mathbb { Z } }$ loss and performing OOD detection using minimum distance score (MDS). The best results are in bold ( $0 . 5 \%$ tolerance).
201
+
202
+ <table><tr><td rowspan="2">Model</td><td rowspan="2">Data (training)</td><td rowspan="2">0OD (unseen)</td><td colspan="2">Comparison with approaches that use input preprocessing and adversarial validation.</td></tr><tr><td>AUROC (%) [↑] ODIN /Mahalanobis /IsoMaxx+MDS (ours)</td><td>DTACC (%) [↑]</td></tr><tr><td rowspan="3">DenseNetBC100</td><td rowspan="2">CIFAR10</td><td>SVHN</td><td>92.8 / 97.6 / 99.5</td><td>86.5 / 92.6 / 96.3</td></tr><tr><td>TinyImageNet</td><td>97.2 / 98.8 / 98.6</td><td>92.1 / 95.0 / 93.9</td></tr><tr><td></td><td>LSUN</td><td>98.5 / 99.2 / 99.1</td><td>94.3 / 96.2 / 95.2</td></tr><tr><td rowspan="3"></td><td rowspan="2">CIFAR100</td><td>SVHN TinyImageNet</td><td>88.2 / 91.8 /96.5 85.3 / 97.0 /97.6</td><td>80.7 / 84.6 /90.0 77.2 / 91.8 / 91.6</td></tr><tr><td>LSUN</td><td>85.7 / 97.9 / 97.4</td><td>77.3 / 93.8 / 90.8</td></tr><tr><td></td><td>SVHN</td><td>86.5 / 95.5 / 98.2</td><td></td></tr><tr><td rowspan="3">ResNet34</td><td>CIFAR10</td><td>TinyImageNet</td><td>93.9 / 99.0 /94.8</td><td>77.8 / 89.1 / 93.0 86.0 / 95.4 / 88.5</td></tr><tr><td rowspan="2"></td><td>LSUN</td><td>93.7 / 99.5 / 96.6</td><td>85.8 / 97.2 / 91.0</td></tr><tr><td>SVHN</td><td></td><td></td></tr><tr><td rowspan="2"></td><td rowspan="2">CIFAR100</td><td>TinyImageNet</td><td>72.0 / 84.4 / 88.3 83.6 / 87.9 / 90.5</td><td>67.7 / 76.5 / 82.6</td></tr><tr><td>LSUN</td><td>81.9 / 82.3 / 88.3</td><td>75.9 / 84.6 / 84.4 74.6 / 79.7 / 82.6</td></tr></table>
203
+
204
+ Table 5: Unfair comparison of outlier exposure-enhanced SoftMax loss with IsoMax loss and $\mathbf { I s o M a x } _ { \mathcal { T } }$ loss without using extra data. SoftMax $\mathrm { \Lambda } ^ { \mathrm { O E } } { + } \mathrm { E } { S }$ means training using SoftMax loss enhanced during training by using outlier exposure [10], which requires the collection of outlier data, and performing OOD detection using the entropic score (ES). We used the same outlier data used in [10]. In each case, we collected the same amount of outlier data as the number of training examples present in the training set used to train SoftMaxOE. Despite being possible [26], the IsoMax loss and $\operatorname { I s o M a x } _ { \mathbb { Z } }$ loss were not enhanced with outlier exposure to keep the solution seamless. IsoMax $+ \mathrm { E S }$ means training using IsoMax loss and performing OOD detection using the entropic score (ES). $\operatorname { I s o M a x } _ { \mathbb { Z } } { + } \mathbf { M } \mathbf { D } \mathbf { S }$ (ours) means training using $\operatorname { I s o M a x } _ { \mathbb { Z } }$ loss and performing OOD detection using minimum distance score (MDS). The values of the performance metrics TNR $@$ TPR95 and AUROC were averaged over all out-of-distribution. The best values are in bold ( $0 . 5 \%$ tolerance).
205
+
206
+ <table><tr><td rowspan="2">Model</td><td rowspan="2">Data (training)</td><td colspan="2">Comparison of IsoMax loss variants without using extra data with outlier exposure-enhanced SoftMax loss.</td></tr><tr><td>TNR@TPR95 (%) [↑] SoftMaxOE+ES /IsoMax+ES /IsoMaxz+MDS (ours)</td><td>AUROC (%) [↑]</td></tr><tr><td rowspan="2">DenseNetBC100</td><td>CIFAR10</td><td>93.8 / 84.1 / 95.0</td><td>98.5 / 97.3 / 99.1</td></tr><tr><td>CIFAR100</td><td>23.0 / 45.1 / 82.5</td><td>80.5 / 91.9 / 97.0</td></tr><tr><td rowspan="2">ResNet110</td><td>CIFAR10</td><td>92.6 / 76.5 / 81.8</td><td>98.0 /96.0 / 97.0</td></tr><tr><td>CIFAR100</td><td>36.1 / 25.1 / 40.2</td><td>83.2 / 85.5 / 87.7</td></tr></table>
207
+
208
+ ![](images/19d3c6ca06a641259d05f06d12b5f22aafd23767a690f75e943dc89e4eb4816a.jpg)
209
+ Figure 1: (a) The no isometric distances used by the IsoMax loss make detecting out-of-distribution examples difficult using the minimum distance score. Consequently, the minimum distance score is not competitive with the entropic score in this case. (b) The isometric distances used by the $\operatorname { I s o M a x } _ { \mathbb { Z } }$ loss make detecting out-of-distribution examples easy using the minimum distance score. Consequently, the minimum distance score usually overcomes the entropic score in this situation.
210
+
211
+ 151 We used resized images from the datasets TinyImageNet $[ 2 ] ^ { 5 }$ and the Large-scale Scene UNderstand
212
+ 152 ing dataset (LSUN) $\overline { { [ 3 6 ] } } ^ { 5 }$ following Lee et al. [19] to create out-of-distribution samples. We added
213
+ 153 these out-of-distribution images to the validation sets presented in the CIFAR10, CIFAR100, and
214
+ 154 SVHN to form the test sets and evaluate the OOD detection performance.
215
+ 155 We evaluated the OOD detection performance using the true negative rate at $9 5 \%$ true positive
216
+ 156 rate (TNR $@$ TPR95), the area under the receiver operating characteristic curve (AUROC), and the
217
+ 157 detection accuracy (DTACC), which corresponds to the maximum classification probability over all
218
+ 158 possible thresholds $\delta$ :
219
+
220
+ $$
221
+ 1 - \operatorname* { m i n } _ { \delta } \left\{ P _ { \mathrm { i n } } \left( o \left( \mathbf { x } \right) \leq \delta \right) P \left( \mathbf { x } \mathrm { i s } \mathrm { f r o m } P _ { \mathrm { i n } } \right) + P _ { \mathrm { o u t } } \left( o \left( \mathbf { x } \right) > \delta \right) P \left( \mathbf { x } \mathrm { i s } \mathrm { f r o m } P _ { \mathrm { o u t } } \right) \right\} ,
222
+ $$
223
+
224
+ 159 where $o ( \mathbf { x } )$ is the OOD detection score. It is assumed that both positive and negative samples have
225
+ 160 an equal probability of being in the test set, i.e., $P$ ( $\mathbf { \bar { x } }$ is from $P _ { \mathrm { i n } } ) = P$ ( $\mathbf { x }$ is from $P _ { \mathrm { { o u t } } }$ ). All the
226
+ 161 mentioned metrics follow the calculation procedures specified in Lee et al. [19].
227
+
228
+ # 62 4 Results and Discussion
229
+
230
+ Classification Accuracy Table 2 presents the classification accuracy results. It shows that $\operatorname { I s o M a x } _ { \mathcal { T } }$ loss does not present classification accuracy drop compared to SoftMax loss or IsoMax loss for all datasets and models. We observe that the IsoMax loss variants present more than one percent $( \% 1 )$ better accuracy than the SoftMax loss when using ResNet110 on the CIFAR100 dataset.
231
+
232
+ 167 Out-of-Distribution Detection We report the results using the entropic score for SoftMax loss
233
+ 168 (SoftMax+ES), outlier exposure-enhanced SoftMax loss (SoftMax $\mathrm { ^ { O E } + E S }$ ), and IsoMax loss (Iso
234
+ 169 Max $+ \mathrm { E S }$ ) because it always overcame the maximum probability score and minimum distance score in
235
+ 170 these cases. For $\operatorname { I s o M a x } _ { \mathcal { T } }$ , we report the values using the minimum distance score $( \mathrm { I s o M a x } _ { \mathcal { T } } { + } \mathrm { M D S } )$ ),
236
+ 171 as it usually overcame the maximum probability and the entropic score in this situation.
237
+ 172 The Table 3 summarizes the results of the fair OOD detection comparison. In the mentioned table,
238
+ 173 all approaches are accurate (no classification accuracy drop), fast and power-efficient (inferences
239
+ 174 are performed without input preprocessing), and no validation is required to define hyperparameters.
240
+ 175 Additionally, no additional/extra/outlier data are needed. In most cases, $\operatorname { I s o M a x } _ { \mathbb { Z } } { + } \mathbf { M } \mathbf { D } \mathbf { S }$ overcomes
241
+ 176 IsoMax $+ \mathrm { E S }$ performance, regardless of the model, dataset, and out-of-distribution.
242
+ 177 The minimum distance score produces high OOD detection performance when combined with the
243
+ 178 $\operatorname { I s o M a x } _ { \mathcal { T } }$ , which evidences that the isometrization of the distances indeed work in this case. However,
244
+ 179 the same minimum distance score produced low OOD detection performance when combined with
245
+ 180 the original IsoMax loss. The Fig. 1 provides an explanation for this fact.
246
+ 181 Table 4 summarizes the results of an unfair OOD detection comparison, as the methods present differ
247
+ 182 ent requirements and produce distinct side effects. ODIN [23] and the Mahalanobis [19] approaches
248
+ 183 require adversarial samples to be generated to validate hyperparameters for each combination of
249
+ 184 dataset and model. Moreover, these approaches use input preprocessing, which makes inferences
250
+ 185 at least four times slower and at least four times less energy-efficient. Validation using adversarial
251
+ 186 examples may be a cumbersome procedure to be performed from scratch on novel datasets, as hyper
252
+ 187 parameters such as optimal adversarial perturbations may be unknown in such cases. $\operatorname { I s o M a x } _ { \mathbb { Z } } { + } \mathbf { M } \mathbf { D } \mathbf { S }$
253
+ 188 does not present these special requirements and does not produce the mentioned side effects.
254
+ 189 Nevertheless, $\operatorname { I s o M a x } _ { \mathcal { Z } } { + } \mathbf { M } \mathbf { D } \mathbf { S }$ provides higher performance than ODIN. Usually, this occurs by a
255
+ 190 large margin. In addition to the changes between the entropy maximization trick and temperature
256
+ 191 calibrations present in [27, 26], we emphasize that training with entropic scale affects the learning of
257
+ 192 all weights while changing the temperature during inference affects only the last layer. Hence, the fact
258
+ 193 that the proposed solution overcomes ODIN by a safe margin is additional evidence that the entropy
259
+ 194 maximization trick often produces much higher OOD detection performance than temperature cali
260
+ 195 bration, even when the latter is combined with input preprocessing. Besides, the entropy maximization
261
+ 196 trick does not require access to validation data to tune the temperature. In addition to being seamless
262
+ 197 and avoiding the Mahalanobis approach drawbacks, $\operatorname { I s o M a x } _ { \mathbb { Z } } { + } \operatorname { M D S }$ usually overcomes it in terms of
263
+ 198 AUROC and produces similar performance when considering the DTACC.
264
+ 199 Table 5 unfairly compares the performance of the proposed approach with the outlier exposure
265
+ 200 solution. Similar to IsoMax variants, the outlier exposure approach does not require hyperparameters
266
+ 201 tuning and produces efficient inferences. However, it requires collecting outlier data, while our
267
+ 202 approach does not. It is important to emphasize that outlier exposure may also be combined with
268
+ 203 IsoMax loss variants to increase the OOD detection performance further [26]. Nevertheless, in
269
+ 204 the mentioned table, we preferred to present the IsoMax loss variants without outlier exposure to
270
+ 205 show that the outlier exposure-enhanced SoftMax loss usually present lower OOD detection than
271
+ 206 $\operatorname { I s o M a x } _ { \mathbb { Z } } { + } \mathbf { M } \mathbf { D } \mathbf { S }$ even without using outlier exposure.
272
+
273
+ # 5 Conclusion
274
+
275
+ In this paper, we improved the IsoMax loss by replacing its original distance with what we call the isometric distance. Additionally, we proposed a zero computational cost minimum distance score. The experiments showed that these modifications produce higher OOD detection performance while keeping desired benefits of IsoMax loss (absence of hyperparameters to tune, no reliance on additional/extra/outlier data, fast and power-efficient inference, and no classification accuracy drop).
276
+
277
+ 213 Similar to IsoMax loss, after training using the proposed $\operatorname { I s o M a x } _ { \mathcal { Z } }$ loss, we may apply inference-based
278
+ 214 approaches (e.g., Gram matrices, outlier exposure, energy-based) to the pretrained model to eventually
279
+ 215 increase even more the overall OOD detection performance. Therefore, instead of competitors, the
280
+ 216 OOD detection approaches that may be applied to pretrained models are actually complementary to
281
+ 217 our approach [27, 26]. Hence, there is no drawback in training a model using $\operatorname { I s o M a x } _ { \mathbb { Z } }$ loss instead
282
+ 218 of SoftMax loss or IsoMax loss, regardless of planning to subsequently use an inference-based OOD
283
+ 219 detection approach to increase the OOD detection performance further.
284
+ 220 In future works, considering its simplicity, we plan to verify whether our approach scales satisfactorily
285
+ 221 to large-scale image datasets such as ImageNet. We also intend to verify the performance of our
286
+ 222 solution using text datasets.
287
+
288
+ # References
289
+
290
+ [1] Carlini, N., Athalye, A., Papernot, N., Brendel, W., Rauber, J., Tsipras, D., Goodfellow, I. J., Madry, A., and Kurakin, A. On evaluating adversarial robustness. CoRR, abs/1902.06705, 2019.
291
+ [2] Deng, J., Dong, W., Socher, R., Li, L., Li, K., and Li, F. ImageNet: A large-scale hierarchical image database. Computer Vision and Pattern Recognition, 2009.
292
+ [3] DeVries, T. and Taylor, G. W. Learning confidence for out-of-distribution detection in neural networks. CoRR, abs/1802.04865, 2018.
293
+ [4] DeVries, T. and Taylor, G. W. Leveraging uncertainty estimates for predicting segmentation quality. CoRR, abs/1807.00502, 2018.
294
+ [5] Dhamija, A. R., Günther, M., and Boult, T. E. Reducing network agnostophobia. Neural Information Processing Systems, 2018.
295
+ [6] Gal, Y. and Ghahramani, Z. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. International Conference on Machine Learning, 2016.
296
+ [7] He, K., Zhang, X., Ren, S., and Sun, J. Identity mappings in deep residual networks. European Conference on Computer Vision, 2016.
297
+ [8] Hein, M., Andriushchenko, M., and Bitterwolf, J. Why ReLU networks yield high-confidence predictions far away from the training data and how to mitigate the problem. Computer Vision and Pattern Recognition, 2018.
298
+ [9] Hendrycks, D. and Gimpel, K. A baseline for detecting misclassified and out-of-distribution examples in neural networks. International Conference on Learning Representations, 2017.
299
+ [10] Hendrycks, D., Mazeika, M., and Dietterich, T. Deep anomaly detection with outlier exposure. International Conference on Learning Representations, 2019.
300
+ [11] Hsu, Y.-C., Shen, Y., Jin, H., and Kira, Z. Generalized ODIN: Detecting out-of-distribution image without learning from out-of-distribution data. Computer Vision and Pattern Recognition, 2020.
301
+ [12] Huang, G., Liu, Z., Maaten, L. v. d., and Weinberger, K. Q. Densely connected convolutional networks. Computer Vision and Pattern Recognition, 2017.
302
+ [13] Kendall, A. and Gal, Y. What uncertainties do we need in bayesian deep learning for computer vision? Neural Information Processing Systems, 2017.
303
+ [14] Kliger, M. and Fleishman, S. Novelty detection with GAN. CoRR, abs/1802.10560, 2018.
304
+ [15] Krizhevsky, A. Learning multiple layers of features from tiny images. Science Department, University of Toronto, 2009.
305
+ [16] Kuleshov, V., Fenner, N., and Ermon, S. Accurate uncertainties for deep learning using calibrated regression. International Conference on Machine Learning, 2018.
306
+ [17] Lakshminarayanan, B., Pritzel, A., and Blundell, C. Simple and scalable predictive uncertainty estimation using deep ensembles. Neural Information Processing Systems, 2017.
307
+ [18] Lee, K., Lee, H., Lee, K., and Shin, J. Training confidence-calibrated classifiers for detecting out-of-distribution samples. International Conference on Learning Representations, 2018.
308
+ [19] Lee, K., Lee, K., Lee, H., and Shin, J. A simple unified framework for detecting out-ofdistribution samples and adversarial attacks. Neural Information Processing Systems, 2018.
309
+ [20] Leibig, C., Allken, V., Ayhan, M. S., Berens, P., and Wahl, S. Leveraging uncertainty information from deep neural networks for disease detection. Scientific Reports, 7, 2017.
310
+ [21] Li, D., Chen, D., Goh, J., and Ng, S. Anomaly detection with generative adversarial networks for multivariate time series. CoRR, abs/1809.04758, 2018.
311
+ [22] Liang, S., Li, Y., and Srikant, R. Principled detection of out-of-distribution examples in neural networks. CoRR, abs/1706.02690, 2017.
312
+ [23] Liang, S., Li, Y., and Srikant, R. Enhancing the reliability of out-of-distribution image detection in neural networks. International Conference on Learning Representations, 2018.
313
+ [24] Liu, W., Wen, Y., Yu, Z., and Yang, M. Large-margin softmax loss for convolutional neural networks. International Conference on Machine Learning, 2016.
314
+ [25] Liu, W., Wang, X., Owens, J. D., and Li, Y. Energy-based out-of-distribution detection. Neural Information Processing Systems, 2020.
315
+ [26] Macêdo, D., Ren, T. I., Zanchettin, C., Oliveira, A. L. I., and Ludermir, T. B. Entropic out-ofdistribution detection: Seamless detection of unknown examples. CoRR, abs/2006.04005, 2021. URL https://arxiv.org/abs/2006.04005.
316
+ [27] Macêdo, D., Ren, T. I., Zanchettin, C., Oliveira, A. L. I., and Ludermir, T. B. Entropic outof-distribution detection. Accepted for publication in The International Joint Conference on Neural Networks (IJCNN), 2021. URL https://arxiv.org/abs/1908.05569.
317
+ [28] Malinin, A. and Gales, M. Predictive uncertainty estimation via prior networks. Neural Information Processing Systems, 2018.
318
+ [29] Netzer, Y. and Wang, T. Reading digits in natural images with unsupervised feature learning. Neural Information Processing Systems, 2011.
319
+ [30] Sastry, C. S. and Oore, S. Detecting out-of-distribution examples with gram matrices. International Conference on Machine Learning, 2020.
320
+ [31] Schwartz, R., Dodge, J., Smith, N. A., and Etzioni, O. Green AI. Communications of the ACM, 63(12):54–63, 2020.
321
+ [32] Shafaei, A., Schmidt, M., and Little, J. J. A less biased evaluation of out-of-distribution sample detectors. British Machine Vision Conference, 2019.
322
+ [33] Subramanya, A., Srinivas, S., and Babu, R. V. Confidence estimation in deep neural networks via density modelling. CoRR, abs/1707.07013, 2017.
323
+ [34] Techapanurak, E., Suganuma, M., and Okatani, T. Hyperparameter-free out-of-distribution detection using cosine similarity. Asian Conference on Computer Vision (ACCV), November 2020.
324
+ [35] Vyas, A., Jammalamadaka, N., Zhu, X., Das, D., Kaul, B., and Willke, T. L. Out-of-distribution detection using an ensemble of self supervised leave-out classifiers. European Conference on Computer Vision, 2018.
325
+ [36] Yu, F., Zhang, Y., Song, S., Seff, A., and Xiao, J. LSUN: construction of a large-scale image dataset using deep learning with humans in the loop. CoRR, abs/1506.03365, 2015.
326
+ [37] Yu, Q. and Aizawa, K. Unsupervised out-of-distribution detection by maximum classifier discrepancy. International Conference on Computer Vision, 2019.
327
+
328
+ 1. For all authors...
329
+
330
+ (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] All claims are demonstrated using argumentation and substantial experiments.
331
+ (b) Did you describe the limitations of your work? [Yes] Please, see the last paragraph of the conclusion.
332
+ (c) Did you discuss any potential negative societal impacts of your work? [N/A] Actually, our approach is much more energy-efficient and environment-friendly than most competing approaches (see the third and the fifth paragraphs of the introduction).
333
+ (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
334
+
335
+ 2. If you are including theoretical results...
336
+
337
+ (a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
338
+
339
+ 3. If you ran experiments...
340
+
341
+ (a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes]
342
+ (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes]
343
+ (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [N/A] We applied a tolerance to indicate the best approaches.
344
+ (d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes]
345
+
346
+ 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
347
+
348
+ (a) If your work uses existing assets, did you cite the creators? [Yes]
349
+ (b) Did you mention the license of the assets? [Yes]
350
+ (c) Did you include any new assets either in the supplemental material or as a URL? [Yes]
351
+ (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
352
+ (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
353
+
354
+ 5. If you used crowdsourcing or conducted research with human subjects...
355
+
356
+ (a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
357
+ (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
358
+ (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
md/train/hfkER_KJiNw/hfkER_KJiNw.md ADDED
@@ -0,0 +1,358 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Graph Neural Networks with Adaptive Residual
2
+
3
+ Xiaorui Liu1 xiaorui@msu.edu
4
+
5
+ Jiayuan Ding1 dingjia5@msu.edu
6
+
7
+ Wei Jin1 jinwei2@msu.edu
8
+
9
+ Han Xu1 xuhan1@msu.edu
10
+
11
+ Yao Ma2 yao.ma@njit.edu
12
+
13
+ Zitao Liu3 liuzitao@100tal.com
14
+
15
+ Jiliang Tang1 tangjili@msu.edu
16
+
17
+ 1Michigan State University, East Lansing, MI, USA 2New Jersey Institute of Technology, Newark, NJ, USA 3TAL Education Group, Beijing, China
18
+
19
+ # Abstract
20
+
21
+ Graph neural networks (GNNs) have shown the power in graph representation learning for numerous tasks. In this work, we discover an interesting phenomenon that although residual connections in the message passing of GNNs help improve the performance, they immensely amplify GNNs’ vulnerability against abnormal node features. This is undesirable because in real-world applications, node features in graphs could often be abnormal such as being naturally noisy or adversarially manipulated. We analyze possible reasons to understand this phenomenon and aim to design GNNs with stronger resilience to abnormal features. Our understandings motivate us to propose and derive a simple, efficient, interpretable, and adaptive message passing scheme, leading to a novel GNN with Adaptive residual, AirGNN1. Extensive experiments under various abnormal feature scenarios demonstrate the effectiveness of the proposed algorithm.
22
+
23
+ # 1 Introduction
24
+
25
+ Recent years have witnessed the great success of graph neural networks (GNNs) in representation learning for graph structure data [1]. Essentially, GNNs generalize deep neural networks (DNNs) from regular grids, such as image, video and text, to irregular data such as social, energy, transportation, citation, and biological networks. Such data can be naturally represented as graphs with nodes and edges. The key building block for such generalization is the neural message passing framework [2]:
26
+
27
+ $$
28
+ \mathbf { x } _ { u } ^ { ( k + 1 ) } = \mathrm { U P D A T E } ^ { ( k ) } \left( \mathbf { x } _ { u } ^ { ( k ) } , \mathbf { m } _ { \mathcal { N } ( u ) } ^ { ( k ) } \right)
29
+ $$
30
+
31
+ where x(ku $\mathbf { x } _ { u } ^ { ( k ) } \in \mathbb { R } ^ { d }$ denotes the feature vector of node $u$ in the $k$ -th iteration of message passing, and $\mathbf { m } _ { \mathcal { N } ( u ) } ^ { ( k ) }$ is the message aggregated from $u$ ’s neighborhood $\mathcal { N } ( u )$ . The specific design of message passing scheme can be motivated from spectral domain [3, 4] or spatial domain [5, 6, 7, 2]. It usually linearly smooths the features in a local neighborhood on the graph.
32
+
33
+ GNNs have achieved superior performance in a large number of benchmark datasets [8] where the node features are assumed to be complete and informative. However, in real-world applications, some node features could be abnormal from various aspects. For instance, in social networks, new users might not have complete profile before they make connections with others, leading to missing user features. In transportation networks, node features can be noisy since there exist certain uncertainty and dynamics in the observation of the traffic information. What is worse, node features can be adversarially chosen by the attacker to maliciously manipulate the prediction made by GNNs. Therefore, it is greatly desired to design GNN models with stronger resilience to abnormal node features.
34
+
35
+ In this work, we first perform empirical investigations on how representative GNN models behave on graphs with abnormal features. Specifically, based upon standard benchmark datasets, we simulate the abnormal features by replacing the features of randomly selected nodes with random Gaussian noise. Then the performance of node classification on abnormal features and normal features are examined separately. From our preliminary study in Section 2, we reveal two interesting observations: (1) Feature aggregation can boost the resilience to abnormal features, but too many aggregations could hurt the performance on both normal and abnormal features; and (2) Residual connection helps GNNs benefit from more layers for normal features, while making GNNs more fragile to abnormal features. We then provide possible explanations to understand these observed phenomena from the perspective of graph Laplacian smoothing. Our analyses imply that there might exist an intrinsic tension between feature aggregation and residual connection, which results in a performance tradeoff between normal features and abnormal features.
36
+
37
+ Motivated by these findings and understandings, we aim to design new GNNs with stronger resilience to abnormal features while largely maintaining the performance on normal features. Our contributions can be summarized as follows:
38
+
39
+ • We discover an intrinsic tension between feature aggregation and residual connection in GNNs, and the corresponding performance tradeoff between abnormal and normal features. We also analyze possible reasons to explain and understand these findings.
40
+ • We propose a simple, efficient, principled and adaptive message passing scheme, which leads to a novel GNN model with adaptive residual, named as AirGNN.
41
+ • Extensive experiments under various abnormal feature scenarios demonstrate the superiority of the proposed algorithm. The ablation study demonstrates how the adaptive residuals mitigate the impact of abnormal features.
42
+
43
+ # 2 Preliminary
44
+
45
+ Before introducing the preliminary study, we first define the notations used throughout the paper.
46
+
47
+ Notations. We use bold upper-case letters such as $\mathbf { X }$ to denote matrices. Given a matrix $\mathbf { X } \in \mathbb { R } ^ { n \times d }$ , we use $\mathbf { X } _ { i }$ to denote its $i$ -th row and $\mathbf { X } _ { i j }$ to denote its element in $i$ -th row and $j$ -th column. The Frobenius norm and $\ell _ { 2 1 }$ norm of a matrix $\mathbf { X }$ are defined as $\Vert \mathbf { X } \Vert _ { F } = \sqrt { \sum _ { i j } \mathbf { X } _ { i j } ^ { 2 } }$ and $\| \mathbf { X } \| _ { 2 1 } =$ $\begin{array} { r } { \sum _ { i } \| \mathbf { X } _ { i } \| _ { 2 } = \sum _ { i } \sqrt { \sum _ { j } \mathbf { X } _ { i j } ^ { 2 } } } \end{array}$ , respectively. We define $\| \mathbf { X } \| _ { 2 } = \sigma _ { \operatorname* { m a x } } ( \mathbf { X } )$ where $\sigma _ { \mathrm { m a x } } ( \mathbf { X } )$ is the largest singular value of $\mathbf { X }$ .
48
+
49
+ Let $\mathcal { G } = \{ \nu , \mathcal { E } \}$ be a graph with the node set $\mathcal { V } = \{ v _ { 1 } , \ldots , v _ { n } \}$ and the undirected edge set $\mathcal { E } = \{ e _ { 1 } , \ldots , e _ { m } \}$ . We use $\mathcal { N } ( v _ { i } )$ to denote the neighboring nodes of node $v _ { i }$ , including $v _ { i }$ itself. Suppose that each node is associated with a $d$ -dimensional feature vector, and the features for all nodes are denoted as $\mathbf { X } _ { \mathrm { f e a } } \in \mathbb { R } ^ { n \times d }$ . The graph structure $\mathcal { G }$ can be represented as an adjacent matrix $\mathbf { A } \in \mathbb { R } ^ { n \times n }$ , where $\mathbf { A } _ { i j } ~ = ~ 1$ when there exists an edge between nodes $v _ { i }$ and $v _ { j }$ , and $\mathbf { A } _ { i j } \ = \ 0$ otherwise. The graph Laplacian matrix is defined as $\mathbf { L } = \mathbf { D } - \mathbf { A }$ , where $\mathbf { D }$ is the diagonal degree matrix. Let us denote the commonly used feature aggregation matrix in GNNs [3] as $\tilde { \bf A } = \hat { \bf D } ^ { - \frac { 1 } { 2 } } \bar { \hat { \bf A } } \hat { \bf D } ^ { - \frac { 1 } { 2 } }$ where $\hat { \mathbf { A } } = \mathbf { A } + \mathbf { I }$ is the adjacent matrix with self-loop and its degree matrix is $\hat { \bf D }$ . The corresponding Laplacian matrix is defined as $\tilde { \mathbf { L } } = \mathbf { I } - \tilde { \mathbf { A } }$ .
50
+
51
+ In this work, we focus on the setting where a subset of nodes in the graph contain abnormal features, while the remaining nodes have normal features. In the remaining of this paper, we use abnormal/normal features to denote nodes with abnormal/normal features, for simplicity.
52
+
53
+ # 2.1 Preliminary Study
54
+
55
+ Experimental setup. To investigate how GNNs behave on abnormal and normal node features, we design semi-supervised node classification experiments on three common datasets (i.e., Cora,
56
+
57
+ CiteSeer and PubMed), following the data splits in the work [3]. Moreover, we simulate the abnormal features by assigning $1 0 \%$ of the nodes with random features sampled from a standard Gaussian distribution. The experiments are performed on representative GNN models covering coupled and decoupled architectures, including GCN [3], GCNII [9], APPNP [10], and their variants with or without residual connections in feature aggregations, denoted as w/Res and wo/Res. All methods follow the hyperparameter settings in their original papers. We examine how these models perform when the number of layers increases. Note that for the decoupled architectures such as APPNP, we fix the 2-layer MLP and increase the number of propagation layers. While for the coupled architectures such as GCN and GCNII, we increase the number of feature transformation and propagation layers simultaneously. We report the average performance over 10 times of random selection of the noise node sets. The node classification accuracy (mean and standard variance) on nodes with abnormal and normal features is illustrated in Figure 1 and Figure. 2, separately.
58
+
59
+ ![](images/00d120485edd7da85f1457dd4c00230b18d99c238c177b5cb16e29a69a61afb9.jpg)
60
+ Figure 1: Node classification accuracy on abnormal nodes (Cora)
61
+
62
+ ![](images/08499e09f3e29a9b457146ea9c203108450fafd94446152fa1b7aada0f5024ce.jpg)
63
+ Figure 2: Node classification accuracy on normal nodes (Cora)
64
+
65
+ Observations. From Figure 1 and Figure 2, we can make the following observations: (1) Without residual connection, more layers (e.g., $> 2$ for GCN and GCNII, $> 1 0$ for APPNP) hurt the accuracy on nodes with normal features. However, more layers boost the accuracy on nodes with abnormal features significantly, before finally starting to decrease; (2) With residual connection, the accuracy on nodes with normal features keeps increasing with more layers2. However, the accuracy on nodes with abnormal features only increases marginally when stacking more layers, and then starts to decrease. While we only present the experiments on Cora, we defer the results on other datasets to Appendix C, which provide similar observations. To conclude, we can summarize these observations into two major findings:
66
+
67
+ • Finding I: Feature aggregation can boost the resilience to abnormal features, but too many aggregations could hurt the performance on both normal and abnormal nodes;
68
+
69
+ • Finding II: Residual connection helps GNNs benefit from more layers for nodes with normal features, while making GNNs more fragile to abnormal features.
70
+
71
+ # 2.2 Understandings
72
+
73
+ In this subsection, we provide the understanding and explanation for aforementioned findings, from the perspective of graph Laplacian smoothing.
74
+
75
+ # Understanding Finding I: Feature aggregation as Laplacian smoothing
76
+
77
+ The message passing in GCN [3], GCNII wo/ residual and APPNP wo/ residual (as well as many popular GNN models), follows the feature aggregation
78
+
79
+ $$
80
+ \mathbf { X } _ { \mathrm { o u t } } = \tilde { \mathbf { A } } \mathbf { X } _ { \mathrm { i n } } ,
81
+ $$
82
+
83
+ where ${ \bf X } _ { \mathrm { i n } }$ and $\mathbf { X _ { o u t } }$ represent the features before and after message passing layer, respectively. It can be interpreted as one gradient descent step for the Laplacian smoothing problem [11]
84
+
85
+ $$
86
+ \underset { \mathbf { X } \in \mathbb { R } ^ { n \times d } } { \arg \operatorname* { m i n } } \mathcal { L } _ { 1 } ( \mathbf { X } ) : = \frac { 1 } { 2 } \mathrm { t r } \Big ( \mathbf { X } ^ { \top } ( \mathbf { I } - \tilde { \mathbf { A } } ) \mathbf { X } \Big ) = \frac { 1 } { 2 } \sum _ { ( v _ { i } , v _ { j } ) \in \mathcal { E } } \| \frac { \mathbf { X } _ { i } } { \sqrt { d _ { i } + 1 } } - \frac { \mathbf { X } _ { j } } { \sqrt { d _ { j } + 1 } } \| _ { 2 } ^ { 2 } ,
87
+ $$
88
+
89
+ where $d _ { i }$ is the node degree of node $v _ { i }$ . Eq. (2) can be derived from $\mathbf { X } _ { \mathrm { o u t } } = \mathbf { X } _ { \mathrm { i n } } - ( \mathbf { I } - \tilde { \mathbf { A } } ) \mathbf { X } _ { \mathrm { i n } } = \tilde { \mathbf { A } } \mathbf { X } _ { \mathrm { i n } }$ , with the initialization $\mathbf { X } = \mathbf { X } _ { \mathrm { i n } }$ and stepsize $\gamma = 1$ . The Laplacian smoothing problem penalizes the feature difference between neighboring nodes. To reduce this penalty, the feature aggregation in Eq. (2) smooths the node features by taking the average of local neighbors, and thus can be considered as low-pass filter which gradually filters out high-frequency signals [12, 13]. Therefore, it increases the resilience to abnormal features which are likely to be high-frequency signals. In other words, the local neighboring nodes help to correct the abnormal features. Unfortunately, if applied too many times, these low-pass filters could overly smooth the features (well-known as oversmoothing [14, 15]) such that nodes are not distinguishable enough, providing an explanation to the degraded performance on both abnormal and normal features when stacking too many layers.
90
+
91
+ # Understanding Finding II: Residual connection maintains feature proximity
92
+
93
+ To adjust the feature smoothness for better performance, APPNP [10] utilizes residual connections in message passing as follows
94
+
95
+ $$
96
+ \mathbf { X } ^ { k + 1 } = ( 1 - \alpha ) \tilde { \mathbf { A } } \mathbf { X } ^ { k } + \alpha \mathbf { X _ { \mathrm { i n } } } ,
97
+ $$
98
+
99
+ where ${ \bf X } ^ { 0 } = { \bf X } _ { \mathrm { i n } }$ . It can be considered as an iterative solution for the regularized Laplacian smoothing problem [11]
100
+
101
+ $$
102
+ \underset { { \substack { \mathbf { X } \in \mathbb { R } ^ { n \times d } } } } { \arg \operatorname* { m i n } } \ \mathcal { L } _ { 2 } ( { \mathbf { X } } ) : = \frac { \alpha } { 2 ( 1 - \alpha ) } \| \mathbf { X } - \mathbf { X } _ { \mathrm { i n } } \| _ { F } ^ { 2 } + \frac { 1 } { 2 } \mathrm { t r } \Big ( \mathbf { X } ^ { \top } ( { \mathbf { I } } - \tilde { \mathbf { A } } ) \mathbf { X } \Big ) ,
103
+ $$
104
+
105
+ with initialization $\mathbf { X } = \mathbf { X } _ { \mathrm { i n } }$ and stepsize $\gamma = 1 - \alpha$ due to
106
+
107
+ $$
108
+ \mathbf { X } ^ { k + 1 } = \mathbf { X } ^ { k } - ( 1 - \alpha ) \bigg ( \frac { \alpha } { 1 - \alpha } ( \mathbf { X } ^ { k } - \mathbf { X _ { \mathrm { i n } } } ) + ( \mathbf { I } - \tilde { \mathbf { A } } ) \mathbf { X } ^ { k } \bigg ) = ( 1 - \alpha ) \tilde { \mathbf { A } } \mathbf { X } ^ { k } + \alpha \mathbf { X _ { \mathrm { i n } } } .
109
+ $$
110
+
111
+ GCNII [9] adopts a similar message passing but further combines a feature transformation layer in each message passing step, which leads to a coupled architecture, as contrast to the decoupled architecture of APPNP. The residual connection naturally arises when regularizing the proximity between input and output features, as showed in the first term of $\mathcal { L } _ { 2 } ( \mathbf { X } )$ . Such proximity can help avoid the trivial solution for the problem in Eq. (3), i.e., totally oversmoothed features only depending on node degrees, and consequently mitigates the oversmoothing issue. More intuitively, residual connections in GNNs provide direct information flows between layers that can preserve some necessary high-frequency signals for better discrimination between classes. More layers with residual provide a more accurate solution to Eq. (5), which explains the performance gain from deeper GNNs. Unfortunately, these residual connections also undesirably carry on abnormal features which are detrimental, leading to the inferior performance on abnormal features.
112
+
113
+ # 3 The Proposed Framework
114
+
115
+ In this section, we first motivate the proposed adaptive message passing scheme (AMP) with further discussions on our preliminary study. We then introduce more details about AMP, its interpretations, convergence guarantee and computation complexity, as well as the model architecture of AirGNN.
116
+
117
+ # 3.1 Design Motivation
118
+
119
+ Our preliminary study in Section 2 reveals an intrinsic tension between feature aggregation and residual connection: (1) feature aggregation helps smooth out abnormal features, while it could cause inappropriate smoothing for normal features; (2) residual connection is essential for adjusting the feature smoothness, but it could be detrimental for abnormal features. Although this conflict can be partially mitigated by adjusting the residual connection such as the residual weight $\alpha$ in GCNII [9] and APPNP [10], such global adjustment cannot be adaptive to a subset of the nodes, e.g., the nodes with abnormal features. This is crucial because in practice we often encounter the scenario where only a subset of nodes contain abnormal features. Therefore, how to reconcile this dilemma still desires dedicated efforts. We then naturally ask a question: Can we design a better message passing scheme with node-wise adaptive feature aggregation and residual connection?
120
+
121
+ The motivation of the proposed idea builds upon the following intuition: while it is important to maintain the proximity between input and output features as in Eq. (5), it could be over aggressive to penalize their deviations by the square of Frobenius norm, i.e., $\begin{array} { r } { \| \dot { \bf X } - \dot { \bf X } _ { \mathrm { i n } } \| _ { F } ^ { 2 } = \sum _ { i = 1 } ^ { n } \| \dot { \bf X } _ { i } - ( { \bf X } _ { \mathrm { i n } } ) _ { i } \| _ { 2 } ^ { 2 } } \end{array}$ The fact that this penalty does not tolerate large deviations weakens the capability to remove abnormal features through Laplacian smoothing. This motivates us to consider an alternative proximity penalty
122
+
123
+ $$
124
+ \| { \bf X } - { \bf X } _ { \mathrm { i n } } \| _ { 2 1 } : = \sum _ { i = 1 } ^ { n } \| { \bf X } _ { i } - ( { \bf X } _ { \mathrm { i n } } ) _ { i } \| _ { 2 } ,
125
+ $$
126
+
127
+ which instead penalizes the deviations by the $\ell _ { 1 }$ norm of row-wise $\ell _ { 2 }$ norms, namely $\ell _ { 2 1 }$ norm. The $\ell _ { 2 1 }$ norm promotes row sparsity in $\mathbf { X } - \mathbf { X } _ { \mathrm { i n } }$ , and it also allows large deviations because the penalty on large values is less aggressive, leading to the potential removal of abnormal features. Therefore, we propose the following Laplacian smoothing problem regularized by $\ell _ { 2 1 }$ norm proximity control:
128
+
129
+ $$
130
+ \underset { \mathbf { X } \in \mathbb { R } ^ { n \times d } } { \arg \operatorname* { m i n } } \lambda \| \mathbf { X } - \mathbf { X } _ { \mathrm { i n } } \| _ { 2 1 } + \frac { 1 } { 2 } \mathrm { t r } ( \mathbf { X } ^ { \top } ( \mathbf { I } - \tilde { \mathbf { A } } ) \mathbf { X } ) ,
131
+ $$
132
+
133
+ where $\lambda \in [ 0 , \infty )$ is a parameter to adjust the balance between proximity and Laplacian smoothing. In order to easy the tuning of $\lambda$ , we made a modification of Eq. (7):
134
+
135
+ $$
136
+ \underset { \mathbf { X } \in \mathbb { R } ^ { n \times d } } { \arg \operatorname* { m i n } } \ \mathcal { L } ( \mathbf { X } ) : = \lambda \| \mathbf { X } - \mathbf { X _ { \mathrm { i n } } } \| _ { 2 1 } + ( 1 - \lambda ) \mathrm { t r } ( \mathbf { X } ^ { \top } ( \mathbf { I } - \tilde { \mathbf { A } } ) \mathbf { X } ) ,
137
+ $$
138
+
139
+ where $\lambda \in [ 0 , 1 ]$ controls the balance.
140
+
141
+ # 3.2 Adaptive Message Passing
142
+
143
+ ![](images/b9c08a90235cf9dc7aa82eaeface75a6b91e84c8306c75e6acc04630e39b84db.jpg)
144
+ Figure 3: Diagram of Adaptive Message Passing
145
+
146
+ $\mathcal { L } ( \mathbf { X } )$ is a composite objective with non-smooth and smooth components. We optimize it by proximal gradient descent [16] and obtain the following iterations as the adaptive message passing (AMP):
147
+
148
+ $$
149
+ \begin{array} { r l } { { \displaystyle { \bf Y } ^ { k } = { \bf X } ^ { k } - 2 \gamma ( 1 - \lambda ) ( { \bf I } - \tilde { \bf A } ) { \bf X } ^ { k } = \left( 1 - 2 \gamma ( 1 - \lambda ) \right) { \bf X } ^ { k } + 2 \gamma ( 1 - \lambda ) \tilde { \bf A } { \bf X } ^ { k } } } & { { } { } { } } \\ { { \displaystyle { \bf X } ^ { k + 1 } = \arg \operatorname* { m i n } \left\{ \lambda \| { \bf X } - { \bf X } _ { \mathrm { i n } } \| _ { 2 1 } + \frac { 1 } { 2 \gamma } \| { \bf X } - { \bf Y } ^ { k } \| _ { F } ^ { 2 } \right\} } } & { { } { } { } } \end{array}
150
+ $$
151
+
152
+ where ${ \bf X } ^ { 0 } = { \bf X } _ { \mathrm { i n } }$ and $\gamma$ is the stepsize to be specified later. Let $\mathbf { Z } = \mathbf { X } - \mathbf { X } _ { \mathrm { i n } }$ , and Eq. (10) can be rewritten as:
153
+
154
+ $$
155
+ \begin{array} { r l } { { \mathbf { Z } ^ { k + 1 } = \arg \operatorname* { m i n } \{ \lambda \| \mathbf { Z } \| _ { 2 1 } + \frac { 1 } { 2 \gamma } \| \mathbf { Z } - ( \mathbf { Y } ^ { k } - \mathbf { X } _ { \mathrm { i n } } ) \| _ { F } ^ { 2 } \} } } \\ & { = \mathbf { p r o x } _ { \gamma \lambda \| \cdot \| _ { 2 1 } } ( \mathbf { Y } ^ { k } - \mathbf { X } _ { \mathrm { i n } } ) } \\ & { \mathbf { X } ^ { k + 1 } = \mathbf { X } _ { \mathrm { i n } } + \mathbf { Z } ^ { k + 1 } . } \end{array}
156
+ $$
157
+
158
+ The $i$ -th row of the proximal operator in Eq. (11) can be computed analytically
159
+
160
+ $$
161
+ \left( \mathbf { p r o x } _ { \gamma \lambda \parallel \cdot \parallel _ { 2 1 } } ( \mathbf { X } ) \right) _ { i } = \frac { \mathbf { X } _ { i } } { \parallel \mathbf { X } _ { i } \parallel _ { 2 } } \operatorname* { m a x } ( \parallel \mathbf { X } _ { i } \parallel _ { 2 } - \gamma \lambda , 0 ) = \operatorname* { m a x } ( 1 - \frac { \gamma \lambda } { \parallel \mathbf { X } _ { i } \parallel _ { 2 } } , 0 ) \cdot \mathbf { X } _ { i } .
162
+ $$
163
+
164
+ Note that the proximal operator returns 0 if the input vector is 0. Substituting $\mathbf { X }$ in Eq. (13) with $\mathbf { Y } ^ { k } - \mathbf { X } _ { \mathrm { i n } }$ and combining Eq. (11) and Eq. (12), then Eq. (12) becomes
165
+
166
+ $$
167
+ \mathbf { X } _ { i } ^ { k + 1 } = ( \mathbf { X } _ { \mathrm { i n } } ) _ { i } + \beta _ { i } ( \mathbf { Y } _ { i } ^ { k } - ( \mathbf { X } _ { \mathrm { i n } } ) _ { i } ) = ( 1 - \beta _ { i } ) ( \mathbf { X } _ { \mathrm { i n } } ) _ { i } + \beta _ { i } \mathbf { Y } _ { i } ^ { k } , \quad \forall i \in [ n ] ,
168
+ $$
169
+
170
+ where $\begin{array} { r } { \beta _ { i } : = \operatorname* { m a x } ( 1 - \frac { \gamma \lambda } { \| \mathbf { Y } _ { i } ^ { k } - ( \mathbf { X } _ { \mathrm { i n } } ) _ { i } \| _ { 2 } } , 0 ) } \end{array}$ . To summarize, the proposed adaptive message passing (AMP) scheme is showed in Figure 4, and a diagram is showed in Figure 3. In detail, AMP works as follows:
171
+
172
+ • The first step takes a feature aggregation within the local neighbors with a self-loop weighted by $1 - 2 \gamma ( 1 - \lambda )$ ;
173
+ • The second step computes a weight $\beta _ { i } \in [ 0 , 1 ]$ for each node $v _ { i }$ depending on the local deviation $\| { \bf Y } _ { i } ^ { k } - ( { \bf X } _ { \mathrm { i n } } ) _ { i } \| _ { 2 }$ .
174
+ • The final step takes a linear combination of input features $\mathbf { X } _ { \mathrm { i n } }$ and the aggregated features $\mathbf { Y } ^ { k }$ , where the node-wise residual is adaptively weighted by $1 - \beta _ { i }$ for each node $v _ { i }$ .
175
+
176
+ ![](images/31b59335ec89ac9c9b7a99814a2a6a89348cd1cc224bfd947556babaafd3c58b.jpg)
177
+ Figure 4: Adaptive Message Passing (AMP)
178
+
179
+ The convergence guarantee of AMP and parameter setting for the stepsize $\gamma$ are illustrated in Theorem 1 and proved in Appendix A. According to Theorem 1, if we set γ = 14(1−λ) or γ = 12(1−λ) , then the first step of AMP can be simplified as $\begin{array} { r } { \mathbf { Y } ^ { k } = \frac { 1 } { 2 } \mathbf { X } ^ { k } + \frac { 1 } { 2 } \tilde { \mathbf { A } } \mathbf { X } ^ { k } } \end{array}$ and $\mathbf { Y } ^ { k } = \tilde { \mathbf { A } } \mathbf { X } ^ { k }$ , respectively. The choice of stepsize will only impact the convergence speed but not the ultimate effect of AMP when it convergences to the fixed point solution. We also discuss the computation complexity per iteration of AMP in Remark 1.
180
+
181
+ Theorem 1 (Convergence of AMP). Under the stepsize setting < 1(1−λ)kL˜k , the proposed adaptive message passing scheme (AMP) in Eq. (9) and Eq. (10) converges to the optimal solution of the problem defined in Eq. (8). In practice, it is sufficient to choose any $\begin{array} { r } { \gamma < \frac { 1 } { 2 ( 1 - \lambda ) } } \end{array}$ since $\Vert \tilde { \mathbf { L } } \Vert _ { 2 } \leq 2$ Moreover, if the connected components of the graph $\mathcal { G }$ are not bipartite graphs, it is sufficient to choose $\begin{array} { r } { \gamma = \frac { 1 } { 2 ( 1 - \lambda ) } } \end{array}$ since $\Vert \tilde { \mathbf { L } } \Vert _ { 2 } < 2$ .
182
+
183
+ Remark 1 (Computation complexity). AMP is as efficient as simple feature aggregation $\mathbf { X } _ { o u t } =$ $\tilde { \mathbf { A } } \mathbf { X } _ { i n }$ because the additional computation cost from the second and third steps in Figure 4 is in the order $\mathcal { O } ( n d )$ , where $n$ is the number of nodes and $d$ is the feature dimension. This is negligible compared with the computation cost $\mathcal { O } ( m d )$ in feature aggregation, where m is the number of edges, due to the fact that usually there are many more edges than nodes in real-world graphs, i.e., $m \gg n$
184
+
185
+ # 3.3 Interpretation of AMP
186
+
187
+ Interestingly, the proposed AMP has a simple and intuitive interpretation as adaptive residual connection, which aligns well with our design motivation:
188
+
189
+ • If the feature of node $v _ { i }$ , i.e., $( \mathbf { X } _ { \mathrm { i n } } ) _ { i }$ , is significantly inconsistent with its local neighbors, i.e., the aggregated feature $\mathbf { Y } _ { i } ^ { k }$ , then the local deviation $\| { \bf Y } _ { i } ^ { k } - ( { \bf X } _ { \mathrm { i n } } ) _ { i } \| _ { 2 }$ will be large, which leads to a $\beta _ { i }$ close to 1. Therefore, the final step will assign a small weight to the residual, i.e., $( 1 - \beta _ { i } ) ( \mathbf { X } _ { \mathrm { i n } } ) _ { i }$ , and the aggregated feature $\mathbf { Y } _ { i } ^ { k }$ will dominate.
190
+
191
+ • On the contrary, if $( \mathbf { X } _ { \mathrm { i n } } ) _ { i }$ is already consistent with its local neighbors, $\| { \bf Y } _ { i } ^ { k } - ( { \bf X } _ { \mathrm { i n } } ) _ { i } \| _ { 2 }$ will be small, which leads to a $\beta _ { i }$ close to 0. Thus, the residual will dominate, which is reasonable since there is less need to aggregate features in this case.
192
+
193
+ • To summarize, the local deviation $\| { \bf Y } _ { i } ^ { k } - ( { \bf X } _ { \mathrm { i n } } ) _ { i } \| _ { 2 }$ provides a natural transition from $\beta _ { i } \to 1$ to $\beta _ { i } \to 0$ , and the transition can be modulated by $\lambda$ which can be either learned or tuned as a hyperparameter through cross-validation. This transition provides an node-wise adaptive residual connection for the message passing scheme.
194
+
195
+ Adaptivity for abnormal $\pmb { \& }$ normal features. According to the homophily assumption on graph structure data [17, 18, 19, 3], the feature representations of normal features should be more consistent with local neighbors than abnormal features. As a result, AMP will assign more residual (i.e., smaller $\beta$ ) to normal features but less residual (i.e., larger $\beta$ ) to abnormal features, providing a customized tradeoff between feature aggregation and residual connection. Consequently, it can promote both the resilience to abnormal features and the performance on normal features. Above discussion also implies a clear physical meaning for $\beta$ in AMP, and we formally define it as the adaptive score.
196
+
197
+ Definition 1 (Adaptive score). The variables $\{ \beta _ { 1 } , \cdot \cdot \cdot , \beta _ { n } \}$ in the adaptive message passing scheme (AMP) are defined as the adaptive scores for nodes $\{ v _ { 1 } , \cdots , v _ { n } \}$ respectively in graph $\mathcal { G }$ . In particular, the larger $\beta _ { i }$ is, the more likely the feature of node $v _ { i }$ is abnormal.
198
+
199
+ Remark 2 (Nonlinear smoother). Different from most existing message passing scheme which are linear smoothers, AMP is a nonlinear smoother because the weights $\{ \beta _ { i } \}$ are computed from $\mathbf { Y } ^ { k }$ and ${ \bf X } _ { i n }$ . This nonlinearity is the key to achieve adaptive residual connection for different nodes.
200
+
201
+ # 3.4 The Model Architecture
202
+
203
+ The proposed adaptive message passing (AMP) can be used as a building block in many GNN models to improve the resilience to abnormal node features. In this work, we choose the the decoupled architectures as APPNP [10] and DAGNN [20], and propose the Adaptive residual GNN (AirGNN):
204
+
205
+ $$
206
+ \begin{array} { r l } & { \mathbf { X } _ { \mathrm { i n } } = h _ { \theta } ( \mathbf { X } _ { \mathrm { f e a } } ) , } \\ & { \mathbf { Y } _ { \mathrm { p r e } } = \mathbf { A } \mathbf { M } \mathbf { P } \left( \mathbf { X } _ { \mathrm { i n } } , K , \lambda \right) . } \end{array}
207
+ $$
208
+
209
+ $h _ { \theta } ( \cdot )$ is any machine learning model parameterized by learnable parameters $\theta$ , such as multilayer perceptrons (MLPs). $\mathbf { X } _ { \mathrm { f e a } } \in \mathbb { R } ^ { n \times d }$ denotes the initial node features. The model $h _ { \theta } ( \cdot )$ will first transform the initial node features as $\mathbf { X } _ { \mathrm { i n } } = h _ { \theta } ( \mathbf { X } _ { \mathrm { f e a } } )$ . AMP takes $h _ { \theta } ( \mathbf { X } _ { \mathrm { f e a } } )$ as input, and performs $K$ steps of AMP with the hyperparameter $\lambda$ . Similar to the majority of existing GNN models, the training objective is the cross-entropy classification loss on the labeled nodes, and the whole model is trained in an end-to-end way. Note that AirGNN is very efficient as explained in Remark 1, and it only requires two hyperparameters $K$ and $\lambda$ without introducing additional parameters to learn, which could reduce the risk of overfitting.
210
+
211
+ # 4 Experiment
212
+
213
+ In this section, we aim to verify the effective of the proposed adaptive message passing scheme (AMP) and the AirGNN model through the semi-supervised node classification tasks. Specifically, we try to answer the following questions: (1) How does AirGNN perform on abnormal and normal features? (Section 4.2 and 4.3) and (2) How does AirGNN work by adjusting the adaptive residual? (Section 4.4)
214
+
215
+ # 4.1 Experimental Settings
216
+
217
+ Datasets and baselines. We conduct experiments on 8 real-world datasets including three citation graphs, i.e., Cora, Citeseer, Pubmed [21], two co-authorship graphs, i.e., Coauthor CS and Coauthor Physics [22], two co-purchase graphs, i.e., Amazon Computers and Amazon Photo [22], and one OGB dataset, i.e., ogbn-arxiv [23]. Due to the space limit, we only present the results on Cora, Citeseer, and Pubmed in this section, but defer the results on other datasets to Appendix D.1. More details about the data statistics and data splits are summarized in Appendix B. The proposed AirGNN is compared with representative GNNs, including GCN [3], GAT [6], APPNP [10] and GCNII [9]. We defer the comparison with the variants of APPNP and Robust GCN [24] to Appendix D.3 and D.4 respectively.
218
+
219
+ Parameter settings. For all baselines, we follow the best hyperparameter settings in their original papers. Additionally, we tune a best residual weight $\alpha$ for APPNP and GCNII in the range $[ 0 , 1 ]$ . For AirGNN, we use a two-layer MLP as the base model $h _ { \theta } ( \cdot )$ , following APPNP. We fix the learning rate 0.01, dropout 0.8, and weight decay 0.0005. Moreover, we set $\begin{array} { r } { \gamma = \frac { 1 } { 2 ( 1 - \lambda ) } } \end{array}$ as suggested by Theorem 1. We choose $K = 1 0$ and tune $\lambda$ in the range $[ 0 , 1 ]$ . Adam optimizer [25] is used in all experiments. We run all experiments by 10 times, and report the mean and variance.
220
+
221
+ Evaluation setting. We assess the performance of all models under two types of abnormal feature scenarios, including noisy features and adversarial features. The abnormal features are injected to randomly selected test nodes after model training. By default, all hyperparameters are tuned according to the performance on validation sets when the dataset is clean. If tuning the hyperparameter $\lambda$ of AirGNN according to the validation sets after injecting abnormal features, the performance will be even better, as discussed in Appendix D.2. The performance on clean data are showed in Appendix D.5 to demonstrate that AirGNN doesn’t need to sacrifice accuracy for better robustness against abnormal features.
222
+
223
+ # 4.2 Performance Comparison with Noisy Features
224
+
225
+ In this subsection, we consider the abnormal features in the noisy feature scenario. Specifically, we simulate the noisy features by assigning a subset of the nodes with random features sampled from a multivariate standard Gaussian distribution. Note that the selection of noise subsets has a apparent impact on the performance since some nodes are less vulnerable to abnormal features while others are more vulnerable. To reduce such variance, we report the average performance over 10 times of random selection of the noise node sets, similar to the settings in the preliminary study in Section 2. We report the node classification test accuracy on abnormal (noisy) features and normal features in Figure 5 and Figure 6, separately, under varying noisy ratio. From these figures, we can observe:
226
+
227
+ • Figure 5 shows that AirGNN significantly outperforms all baselines on all datasets in terms of the performance on noisy nodes. This verifies that AMP is able to improve the resilience to noisy features, aligning well with the design motivation.
228
+ • Figure 6 shows that AirGNN promotes the performance on normal nodes when abnormal nodes exist. This is because AMP can remove some abnormal features which are detrimental to normal nodes.
229
+
230
+ ![](images/cb981f452a6f87e6cccc28935d8e1aa89643dc8d85a1008f917f9b4fedf8a508.jpg)
231
+ Figure 5: Node classification accuracy on abnormal (noisy) nodes
232
+
233
+ # 4.3 Performance Comparison with Adversarial Features
234
+
235
+ In this subsection, we consider the abnormal feature scenario when the node features are maliciously attacked by the attacker to manipulate the prediction of GNNs. We use the Nettack [26] implemented in DeepRobust3 [27], a PyTorch library for adversarial attacks and defenses, to generate the adversarial features. We randomly choose 40 test nodes as the targeted nodes, and assess the performance under increasing perturbation budgets $\{ 0 , 5 , 1 0 , 2 0 , 5 0 , 8 0 \}$ , where the perturbation numbers denote the number of feature dimensions that can be manipulated. The node classification accuracy on these attacked nodes are showed in Figure 7. From these figures, we can make the following observations:
236
+
237
+ ![](images/521af9135379cb9d9a4e04bfd77d43979bb91c8146837931dfc5f87ae829d691.jpg)
238
+ Figure 6: Node classification accuracy on normal nodes
239
+
240
+ • AirGNN is significantly more robust against adversarially attacked features than all baselines. MLP is the most vulnerable model, which demonstrates the usefulness of graph structure information in combating against abnormal node features.
241
+
242
+ • The advantages of AirGNN over the baselines become much stronger with larger perturbation budgets. This suggests that AMP can significantly improve the resilience to abnormal features.
243
+
244
+ ![](images/b4a84b017c1ab3aee2d1fd5a97a59af3692c895e3672220068ba8be20564b118.jpg)
245
+ Figure 7: Node classification accuracy on adversarial nodes
246
+
247
+ # 4.4 Adaptive Residual for Abnormal & Normal Nodes
248
+
249
+ To further understand and verify how AMP and AirGNN work, we investigate the adaptive score $\beta _ { i }$ for each node $v _ { i }$ . Specifically, the average adaptive scores for abnormal nodes and normal nodes in the last layer of AMP are computed separately. In the noisy feature scenario, we fix ratio of noisy nodes as $10 \%$ . In the adversarial feature scenario, we choose 40 target nodes and fix the perturbation number as 80. The results in noisy and adversarial feature scenarios are showed in Table 1 and Table 2, respectively. From these tables, we can observe:
250
+
251
+ • On the one hand, it can be clearly observed that in both scenarios, the average adaptive scores for abnormal nodes are significantly higher than those for normal nodes. Therefore, it verifies our intuition that large adaptive scores are strongly related to abnormal features. • On the other hand, it also implies that the residual weights (i.e., $1 - \beta _ { i } )$ for abnormal nodes are much lower than those of normal nodes. This perfectly aligns with our motivation to remove abnormal features by reducing their residual connections.
252
+
253
+ The study on adaptive scores verifies how the adaptive residuals in AMP and AirGNN work as designed. It corroborates that AirGNN not only tremendously boosts the resilience to abnormal features but also provides interpretable information for anomaly detection that will be useful in many security-critical scenarios since the adaptive score serves as a good indicator of abnormal nodes. Morever, it is expected that APPNP without residual will perform well on abnormal nodes but it will sacrifice the performance on normal nodes. We provide detailed comparison with APPNP w/Res and APPNP wo/Res in Appendix D.3 to show the advantages of adaptive residual of AirGNN.
254
+
255
+ Table 1: Average adaptive score $( \beta )$ and residual weight $( 1 - \beta )$ in the noisy feature scenario.
256
+
257
+ <table><tr><td>Measure</td><td>Cora</td><td>CiteSeer</td><td>PubMed</td></tr><tr><td>Average adaptive score for abnormal nodes</td><td>0.998 ± 0.000</td><td>0.988 ± 0.000</td><td>0.996 ± 0.000</td></tr><tr><td>Average adaptive score for normal nodes Average residual weight for abnormal nodes</td><td>0.924 ± 0.002 0.002 ±0.000</td><td>0.807 ± 0.005 0.012 ± 0.000</td><td>0.869 ± 0.006</td></tr><tr><td>Average residual weight for normal nodes</td><td>0.076 ± 0.002</td><td>0.193 ± 0.005</td><td>0.004±0.000 0.131 ± 0.006</td></tr></table>
258
+
259
+ Table 2: Average adaptive score $( \beta )$ and residual weight $( 1 - \beta )$ in the adversarial feature scenario.
260
+
261
+ <table><tr><td>Measure</td><td>Cora</td><td>CiteSeer</td><td>PubMed</td></tr><tr><td>Average adaptive score for abnormal nodes Average adaptive score for normal nodes</td><td>0.987 ±0.000</td><td>0.930 ± 0.007</td><td>0.959 ± 0.005</td></tr><tr><td>Average residual weight for abnormal nodes</td><td>0.922 ± 0.004</td><td>0.689 ± 0.024</td><td>0.826 ± 0.016</td></tr><tr><td></td><td>0.013 ±0.000</td><td>0.070±0.007</td><td>0.041 ±0.005</td></tr><tr><td>Average residual weight for normal nodes</td><td>0.078 ± 0.004</td><td>0.311 ± 0.024</td><td>0.174 ± 0.016</td></tr></table>
262
+
263
+ # 5 Related Work
264
+
265
+ GNNs generalize convolutional neural networks (CNN) to graph structure data through the message passing framework [1, 2, 7]. The design of message passing and GNN architectures are majorly motivated in spectral domain [3, 4] and spatial domain [5, 6, 7, 2]. Recent works have shown that the message passing in GNNs can be regarded as low-pass graph filters [12, 13]. More generally, it has been proven that message passing in many GNNs can be uniformly derived from graph signal denoising [11, 28, 29, 30]. Classic GNNs such as GCN [3] and GAT [6] achieve their best performance with shallow models, but their performance degrades when stacking more layers, which can be partially explained through oversmoothing analyses [14, 15]. Recent works propose to use residual connections or skip connections to mitigate the oversmoothing issues, and they demonstrate the potential benefits from more feature aggregations. Examples include but not limited to DeepGCNs [31], JKNet [32], GCNII [9], APPNP [10] and DeeperGNN [20]. These models use global residual connection that can not be adaptive for each node, which significantly differ from the proposed AirGNN.
266
+
267
+ Recently, there are growing interests in reducing GNNs’ vulnerability to the graph structure noise, such as Robust GCN [24], GCN-SVD [33], Pro-GNN [34], IDGL [35], ElasticGNN [36], etc. Please refer to the comprehensive surveys [37, 38] for more details. However, how to design GNNs with strong resilience to abnormal node features remains to be developed. To the best of our knowledge, AirGNN is the first GNN model that is intrinsically robust to many types of abnormal node features by design. It improves the performance in various kinds of abnormal scenarios without needing to sacrifice clean accuracy in normal settings.
268
+
269
+ # 6 Conclusion
270
+
271
+ In this work, we discover an intrinsic tension between feature aggregation and residual connection in the message passing scheme of GNNs, as well as the corresponding performance tradeoff between nodes with abnormal and normal features. We analyze possible reasons to explain these findings from the perspective of graph Laplacian smoothing. Our understandings further motivate us to propose a simple, efficient, interpretable and adaptive message passing scheme as well as a new GNN model with adaptive residual, named AirGNN. AirGNN provides a node-wise adaptive transition between feature aggregation and residual connection, and the significant advantages of AirGNN are demonstrated through extensive experiments.
272
+
273
+ # Acknowledgments and Disclosure of Funding
274
+
275
+ This research is supported by the National Science Foundation (NSF) under grant numbers IIS1714741, CNS1815636, IIS1845081, IIS1907704, DRL2025244, IIS1928278, IIS1955285,
276
+
277
+ IOS2107215, IOS2035472 and Army Research Office (ARO) under grant number W911NF-21- 1-0198.
278
+
279
+ # Societal Impact and Limitations
280
+
281
+ The methodology proposed in this paper might have significant positive societal impact since it reduces machine learning models’ vulnerability to abnormal datasets that generally exist in real-world applications, especially in many security-critical scenarios. In practice, for a given graph, we do not have the prior knowledge about if the graph is clean, has noisy features or adversarial features. Therefore, algorithms like the proposed AirGNN that can work under both the clean and various abnormal feature settings are appealing. While we are unaware of any potential negative society impact, we point out two limitations of this work: (1) this paper focuses on abnormal node features and has not evaluated the performance of the proposed method when the dataset contains both abnormal node features and edges; (2) it is unclear how it performs on heterophilic graphs. It will be interesting to investigate these problems in future works.
282
+
283
+ # References
284
+
285
+ [1] Yao Ma and Jiliang Tang. Deep Learning on Graphs. Cambridge University Press, 2020.
286
+ [2] Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. In International Conference on Machine Learning, pages 1263–1272. PMLR, 2017.
287
+ [3] Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016.
288
+ [4] Michaël Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. In Proceedings of the 30th International Conference on Neural Information Processing Systems, pages 3844–3852, 2016.
289
+ [5] William L Hamilton, Rex Ying, and Jure Leskovec. Inductive representation learning on large graphs. arXiv preprint arXiv:1706.02216, 2017.
290
+ [6] Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua ´ Bengio. Graph attention networks. arXiv preprint arXiv:1710.10903, 2017.
291
+ [7] Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. IEEE transactions on neural networks, 20(1):61–80, 2008.
292
+ [8] Zonghan Wu, Shirui Pan, Fengwen Chen, Guodong Long, Chengqi Zhang, and S Yu Philip. A comprehensive survey on graph neural networks. IEEE transactions on neural networks and learning systems, 2020.
293
+ [9] Ming Chen, Zhewei Wei, Zengfeng Huang, Bolin Ding, and Yaliang Li. Simple and deep graph convolutional networks. In Hal Daumé III and Aarti Singh, editors, Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pages 1725–1735. PMLR, 13–18 Jul 2020.
294
+ [10] Johannes Klicpera, Aleksandar Bojchevski, and Stephan Günnemann. Predict then propagate: Graph neural networks meet personalized pagerank. arXiv preprint arXiv:1810.05997, 2018.
295
+ [11] Yao Ma, Xiaorui Liu, Tong Zhao, Yozen Liu, Jiliang Tang, and Neil Shah. A unified view on graph neural networks as graph signal denoising. Proceedings of the 30th ACM International Conference on Information and Knowledge Management, 2021.
296
+ [12] Hoang Nt and Takanori Maehara. Revisiting graph neural networks: All we have is low-pass filters. arXiv preprint arXiv:1905.09550, 2019.
297
+ [13] Lingxiao Zhao and Leman Akoglu. Pairnorm: Tackling oversmoothing in gnns. In International Conference on Learning Representations, 2019.
298
+ [14] Qimai Li, Zhichao Han, and Xiao-Ming Wu. Deeper insights into graph convolutional networks for semi-supervised learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018.
299
+ [15] Kenta Oono and Taiji Suzuki. Graph neural networks exponentially lose expressive power for node classification. In International Conference on Learning Representations, 2020.
300
+ [16] Stephen Boyd and Lieven Vandenberghe. Convex optimization. Cambridge university press, 2004.
301
+ [17] Miller McPherson, Lynn Smith-Lovin, and James M Cook. Birds of a feather: Homophily in social networks. Annual review of sociology, 27(1):415–444, 2001.
302
+ [18] Xiaojin Zhu and Zoubin Ghahramani. Learning from labeled and unlabeled data with label propagation.
303
+ [19] Dengyong Zhou, Olivier Bousquet, Thomas Navin Lal, Jason Weston, and Bernhard Schölkopf. Learning with local and global consistency. 2004.
304
+ [20] Meng Liu, Hongyang Gao, and Shuiwang Ji. Towards deeper graph neural networks. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining. ACM, 2020.
305
+ [21] Prithviraj Sen, Galileo Namata, Mustafa Bilgic, Lise Getoor, Brian Galligher, and Tina EliassiRad. Collective classification in network data. AI magazine, 29(3):93–93, 2008.
306
+ [22] Oleksandr Shchur, Maximilian Mumme, Aleksandar Bojchevski, and Stephan Günnemann. Pitfalls of graph neural network evaluation. arXiv preprint arXiv:1811.05868, 2018.
307
+ [23] Marinka Zitnik Yuxiao Dong Hongyu Ren Bowen Liu Michele Catasta Jure Leskovec Weihua Hu, Matthias Fey. Open graph benchmark: Datasets for machine learning on graphs. arXiv preprint arXiv:2005.00687, 2020.
308
+ [24] Dingyuan Zhu, Ziwei Zhang, Peng Cui, and Wenwu Zhu. Robust graph convolutional networks against adversarial attacks. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 1399–1407, 2019.
309
+ [25] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
310
+ [26] Daniel Zügner, Amir Akbarnejad, and Stephan Günnemann. Adversarial attacks on neural networks for graph data. In KDD. ACM, 2018.
311
+ [27] Yaxin Li, Wei Jin, Han Xu, and Jiliang Tang. Deeprobust: A pytorch library for adversarial attacks and defenses, 2020.
312
+ [28] Xuran Pan, Song Shiji, and Huang Gao. A unified framework for convolution-based graph neural networks. https://openreview.net/forum?id=zUMD–Fb9Bt, 2020.
313
+ [29] Meiqi Zhu, Xiao Wang, Chuan Shi, Houye Ji, and Peng Cui. Interpreting and unifying graph neural networks with an optimization framework, 2021.
314
+ [30] Siheng Chen, Yonina C. Eldar, and Lingxiao Zhao. Graph unrolling networks: Interpretable neural networks for graph signal denoising, 2020.
315
+ [31] Guohao Li, Matthias Müller, Ali Thabet, and Bernard Ghanem. Deepgcns: Can gcns go as deep as cnns? In The IEEE International Conference on Computer Vision (ICCV), 2019.
316
+ [32] Keyulu Xu, Chengtao Li, Yonglong Tian, Tomohiro Sonobe, Ken-ichi Kawarabayashi, and Stefanie Jegelka. Representation learning on graphs with jumping knowledge networks. In Jennifer Dy and Andreas Krause, editors, Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pages 5453–5462. PMLR, 10–15 Jul 2018.
317
+ [33] Negin Entezari, Saba A Al-Sayouri, Amirali Darvishzadeh, and Evangelos E Papalexakis. All you need is low (rank) defending against adversarial attacks on graphs. In Proceedings of the 13th International Conference on Web Search and Data Mining, pages 169–177, 2020.
318
+ [34] Wei Jin, Yao Ma, Xiaorui Liu, Xianfeng Tang, Suhang Wang, and Jiliang Tang. Graph structure learning for robust graph neural networks. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 66–74, 2020.
319
+ [35] Yu Chen, Lingfei Wu, and Mohammed Zaki. Iterative deep graph learning for graph neural networks: Better and robust node embeddings. Advances in Neural Information Processing Systems, 33, 2020.
320
+ [36] Xiaorui Liu, Wei Jin, Yao Ma, Yaxin Li, Hua Liu, Yiqi Wang, Ming Yan, and Jiliang Tang. Elastic graph neural networks. In Marina Meila and Tong Zhang, editors, Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pages 6837–6849. PMLR, 18–24 Jul 2021.
321
+ [37] Wei Jin, Yaxing Li, Han Xu, Yiqi Wang, Shuiwang Ji, Charu Aggarwal, and Jiliang Tang. Adversarial attacks and defenses on graphs. ACM SIGKDD Explorations Newsletter, 22(2):19– 34, 2021.
322
+ [38] Yanqiao Zhu, Weizhi Xu, Jinghao Zhang, Qiang Liu, Shu Wu, and Liang Wang. Deep graph structure learning for robust representations: A survey. arXiv preprint arXiv:2103.03036, 2021.
323
+ [39] Laurent Condat. A primal–dual splitting method for convex optimization involving lipschitzian, proximable and linear composite terms. Journal of optimization theory and applications, 158(2):460–479, 2013.
324
+ [40] Fan RK Chung and Fan Chung Graham. Spectral graph theory. Number 92. American Mathematical Soc., 1997.
325
+
326
+ # Checklist
327
+
328
+ 1. For all authors...
329
+
330
+ (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
331
+ (b) Did you describe the limitations of your work? [Yes]
332
+ (c) Did you discuss any potential negative societal impacts of your work? [Yes]
333
+ (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
334
+
335
+ 2. If you are including theoretical results...
336
+
337
+ (a) Did you state the full set of assumptions of all theoretical results? [Yes] (b) Did you include complete proofs of all theoretical results? [Yes]
338
+
339
+ 3. If you ran experiments...
340
+
341
+ (a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes]
342
+ (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes]
343
+ (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes]
344
+ (d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [No]
345
+
346
+ 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
347
+
348
+ (a) If your work uses existing assets, did you cite the creators? [Yes]
349
+ (b) Did you mention the license of the assets? [No]
350
+ (c) Did you include any new assets either in the supplemental material or as a URL? [No]
351
+ (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [No]
352
+ (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [No]
353
+
354
+ 5. If you used crowdsourcing or conducted research with human subjects...
355
+
356
+ (a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
357
+ (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
358
+ (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
md/train/jlchsFOLfeF/jlchsFOLfeF.md ADDED
@@ -0,0 +1,278 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Invariance Principle Meets Information Bottleneck for Out-of-Distribution Generalization
2
+
3
+ Kartik Ahuja†
4
+
5
+ Ethan Caballero∗ †
6
+
7
+ Dinghuai Zhang∗ †
8
+
9
+ Jean-Christophe Gagnon-Audet †
10
+
11
+ Yoshua Bengio †
12
+
13
+ Ioannis Mitliagkas†
14
+
15
+ Irina Rish†
16
+
17
+ # Abstract
18
+
19
+ The invariance principle from causality is at the heart of notable approaches such as invariant risk minimization (IRM) that seek to address out-of-distribution (OOD) generalization failures. Despite the promising theory, invariance principle-based approaches fail in common classification tasks, where invariant (causal) features capture all the information about the label. Are these failures due to the methods failing to capture the invariance? Or is the invariance principle itself insufficient? To answer these questions, we revisit the fundamental assumptions in linear regression tasks, where invariance-based approaches were shown to provably generalize OOD. In contrast to the linear regression tasks, we show that for linear classification tasks we need much stronger restrictions on the distribution shifts, or otherwise OOD generalization is impossible. Furthermore, even with appropriate restrictions on distribution shifts in place, we show that the invariance principle alone is insufficient. We prove that a form of the information bottleneck constraint along with invariance helps address key failures when invariant features capture all the information about the label and also retains the existing success when they do not. We propose an approach that incorporates both of these principles and demonstrate its effectiveness in several experiments.
20
+
21
+ # 1 Introduction
22
+
23
+ Recent years have witnessed an explosion of examples showing deep learning models are prone to exploiting shortcuts (spurious features) (Geirhos et al., 2020; Pezeshki et al., 2020) which make them fail to generalize out-of-distribution (OOD). In Beery et al. (2018), a convolutional neural network was trained to classify camels from cows; however, it was found that the model relied on the background color (e.g., green pastures for cows) and not on the properties of the animals (e.g., shape). These examples become very concerning when they occur in real-life applications (e.g., COVID-19 detection (DeGrave et al., 2020)).
24
+
25
+ To address these out-of-distribution generalization failures, invariant risk minimization (Arjovsky et al., 2019) and several other works were proposed (Ahuja et al., 2020; Pezeshki et al., 2020; Krueger et al., 2020; Robey et al., 2021; Zhang et al., 2021). The invariance principle from causality (Peters et al., 2015; Pearl, 1995) is at the heart of these works. The principle distinguishes predictors that only rely on the causes of the label from those that do not. The optimal predictor that only focuses on the causes is invariant and min-max optimal (Rojas-Carulla et al., 2018; Koyama and Yamaguchi, 2020; Ahuja et al., 2021) under many distribution shifts but the same is not true for other predictors.
26
+
27
+ Our contributions. Despite the promising theory, invariance principle-based approaches fail in settings (Aubin et al., 2021) where invariant features capture all information about the label contained in the input. A particular example is image classification (e.g., cow vs. camel) (Beery et al., 2018) where the label is a deterministic function of the invariant features (e.g., shape of the animal), and does not depend on the spurious features (e.g., background). To understand such failures, we revisit the fundamental assumptions in linear regression tasks, where invariance-based approaches were shown to provably generalize OOD. We show that, in contrast to the linear regression tasks, OOD generalization is significantly harder for linear classification tasks; we need much stronger restrictions in the form of support overlap assumptions3 on the distribution shifts, or otherwise it is not possible to guarantee OOD generalization under interventions on variables other than the target class. We then proceed to show that, even under the right assumptions on distribution shifts, the invariance principle is insufficient. However, we establish that information bottleneck (IB) constraints (Tishby et al., 2000), together with the invariance principle, provably works in both settings – when invariant features completely capture the information about the label and also when they do not. (Table 1 summarizes our theoretical results presented later). We propose an approach that combines both these principles and demonstrate its effectiveness on linear unit tests (Aubin et al., 2021) and on different real datasets.
28
+
29
+ <table><tr><td>Task</td><td>Invariant features capture label info</td><td>Support overlap invariant features</td><td>Support overlap spurious features</td><td>OOD generalization guarantee (εtr→εall) ERM IRM IB-ERM</td><td></td><td>IB-IRM</td></tr><tr><td rowspan="5">Linear Classification</td><td>Full/Partial</td><td>No</td><td>Yes/No</td><td></td><td>Impossible for any algorithm to generalize OOD [Thm2]</td><td rowspan="5">[Thm3,4]</td></tr><tr><td>Full</td><td>Yes</td><td>No</td><td>区 X</td><td>√</td></tr><tr><td>Partial</td><td>Yes</td><td>No</td><td>X X</td><td>? X</td></tr><tr><td>Full</td><td>Yes</td><td>Yes</td><td>√</td><td>√ √</td></tr><tr><td>Partial</td><td>Yes</td><td>Yes</td><td>√ X √</td><td>? √</td></tr><tr><td>Linear</td><td>Full</td><td>No</td><td>No</td><td>√</td><td>× √</td><td></td></tr><tr><td>Regression</td><td>Partial</td><td>No</td><td>No</td><td>区</td><td>X</td><td>√ √ [Thm4]</td></tr></table>
30
+
31
+ Table 1: Summary of the new and existing results (Arjovsky et al., 2019; Rosenfeld et al., 2021). IB-ERM (IRM): information bottleneck - empirical (invariant) risk minimization ERM (IRM).
32
+
33
+ # 2 OOD generalization and invariance: background & failures
34
+
35
+ Background. We consider a supervised training data $D$ gathered from a set of training environments $\mathcal { E } _ { t r }$ : $D = \{ D ^ { e } \} _ { e \in \mathcal { E } _ { t r } }$ , where $\bar { D ^ { e } } = \{ x _ { i } ^ { e } , y _ { i } ^ { e } \} _ { i = 1 } ^ { n ^ { e } }$ is the dataset from environment $e \in \mathcal { E } _ { t r }$ and $n ^ { e }$ is the number of instances in environment $e$ . $x _ { i } ^ { e } \in \mathbb { R } ^ { d }$ and $y _ { i } ^ { e } \in \mathcal { V } \subseteq \mathbb { R } ^ { k }$ correspond to the input feature value and the label for $i ^ { t h }$ instance respectively. Each $( x _ { i } ^ { e } , y _ { i } ^ { e } )$ is an i.i.d. draw from $\mathbb { P } ^ { e }$ , where $\mathbb { P } ^ { e }$ is the joint distribution of the input feature and the label in environment $e$ . Let $\mathcal { X } ^ { e }$ be the support of the input feature values in the environment $e$ . The goal of OOD generalization is to use training data $D$ to construct a predictor $f : \mathbb { R } ^ { d } \mathbb { R } ^ { k }$ that performs well across many unseen environments in ${ \mathcal { E } } _ { a l l }$ , where $\mathcal { E } _ { a l l } \supset \mathcal { E } _ { t r }$ . Define the risk of $f$ in environment $e$ as $R ^ { e } ( f ) \doteq \mathbb { E } \bigl [ \ell ( f ( X ^ { e } ) , Y ^ { e } ) \bigr ]$ , where for example $\ell$ can be 0-1 loss, logistic loss, square loss, $( X ^ { e } , Y ^ { e } ) \sim { \mathbb { P } } ^ { e }$ , and the expectation $\mathbb { E }$ is w.r.t. $\mathbb { P } ^ { e }$ . Formally stated, our goal is to use the data from training environments $\mathcal { E } _ { t r }$ to find $f : \mathbb { R } ^ { d } \mathcal { V }$ to minimize
36
+
37
+ $$
38
+ \operatorname* { m i n } _ { f } \operatorname* { m a x } _ { e \in { \mathscr { E } } _ { a l l } } R ^ { e } ( f ) .
39
+ $$
40
+
41
+ So far we did not state any restrictions on ${ \mathcal { E } } _ { a l l }$ . Consider binary classification: without any restrictions on ${ \mathcal { E } } _ { a l l }$ , no method can reduce the above objective ( $\ell$ is 0-1 loss) to below one. Suppose a method outputs $f ^ { * }$ ; if $\exists e \in \mathcal { E } _ { a l l } \ \backslash \mathcal { E } _ { t r }$ with labels based on $1 - f ^ { * }$ , then it achieves an error of one. Some assumptions on ${ \mathcal { E } } _ { a l l }$ are thus necessary. Consider how ${ \mathcal { E } } _ { a l l }$ is restricted using invariance for linear regressions (Arjovsky et al., 2019).
42
+
43
+ Assumption 1. Linear regression structural equation model (SEM). In each $e \in \mathcal { E } _ { a l l }$
44
+
45
+ $$
46
+ \begin{array} { r l } & { Y ^ { e } \gets w _ { \mathrm { i n v } } ^ { * } \cdot Z _ { \mathrm { i n v } } ^ { e } + \epsilon ^ { e } , \quad Z _ { \mathrm { i n v } } ^ { e } \perp \epsilon ^ { e } , \quad \mathbb { E } [ \epsilon ^ { e } ] = 0 , \mathbb { E } \big [ | \epsilon ^ { e } | ^ { 2 } \big ] \leq \sigma _ { \mathrm { s u p } } ^ { 2 } } \\ & { X ^ { e } \gets S ( Z _ { \mathrm { i n v } } ^ { e } , Z _ { \mathrm { s p u } } ^ { e } ) } \end{array}
47
+ $$
48
+
49
+ where $\boldsymbol { w _ { \mathrm { i n v } } ^ { * } } \in \mathbb { R } ^ { m }$ , $Z _ { \mathsf { i n v } } ^ { e } \in \mathbb { R } ^ { m }$ , $Z _ { \mathsf { s p u } } \in \mathbb { R } ^ { o }$ , $S \in \mathbb { R } ^ { d \times ( m + o ) }$ , $S$ is invertible $( m + o = d )$ . We focus on invertible $S$ but several results extend to non-invertible $S$ as well (see Appendix).
50
+
51
+ Assumption 1 states how $Y ^ { e }$ and $X ^ { e }$ are generated from latent invariant features $Z _ { \mathrm { i n v } } ^ { e \mathrm { ~ 4 ~ } }$ , latent spurious features $Z _ { \mathsf { s p u } } ^ { e }$ and noise $\epsilon ^ { e }$ . The relationship between label and invariant features is invariant, i.e., $w _ { \mathrm { i n v } } ^ { \ast }$ is fixed across all environments. However, the distributions of $Z _ { \mathrm { i n v } } ^ { e }$ , $Z _ { \mathsf { s p u } } ^ { e }$ , and $\epsilon ^ { e }$ are allowed to change arbitrarily across all the environments. Suppose is identity. If we regress only on the invariant features $Z _ { \mathrm { i n v } } ^ { e }$ , then the optimal solution is $w _ { \mathrm { i n v } } ^ { \ast }$ , which is independent of the environment, and the error it achieves is bounded above by the variance of $\epsilon ^ { e } ( \sigma _ { \mathsf { s u p } } ^ { 2 } )$ . If we regress on the entire $Z ^ { e }$ and the optimal predictor places a non-zero weight on $Z _ { \mathsf { s p u } } ^ { e }$ sup(e.g., $Z _ { \mathsf { s p u } } ^ { e } \gets Y ^ { e } + \zeta ^ { e } )$ , then this predictor fails to solve equation (1) ( $\exists e \in { \mathcal { E } } _ { a l l }$ , $Z _ { \mathsf { s p u } } ^ { e } \to \infty$ , error $ \infty$ , see Appendix for details). Also, not only regressing on $Z _ { \mathrm { i n v } } ^ { e }$ is better than on $Z ^ { e }$ , it can be shown that it is optimal, i.e., it solves equation (1) under Assumption 1 and achieves a value of $\sigma _ { \mathsf { s u p } } ^ { 2 }$ for the objective in equation (1).
52
+
53
+ Invariant predictor. Define a linear representation map $\Phi : \mathbb { R } ^ { r \times d }$ (that transforms $X ^ { e }$ as $\Phi ( X ^ { e } ) ) ,$
54
+ and searc classifitations $\boldsymbol { w } : \mathbb { R } ^ { k \times r }$ on the represeis invariant (in tion ssum $w \cdot \Phi ( X ^ { e } ) )$ $\Phi$ ${ \mathbb E } [ Y ^ { e } | \bar { \Phi } ( X ^ { e } ) ]$ $\bar { \Phi } ( X ^ { e } ) = Z _ { \mathrm { i n v } } ^ { e }$ $\mathbb { E } [ Y ^ { e } | \Phi ( X ^ { e } ) ]$ $\Phi$
55
+ $w \cdot \Phi$ across the set of training environments $\mathcal { E } _ { t r }$ if there is a predictor $w$ that simultaneously achieves
56
+ the minimum risk, i.e., $w \in \arg \operatorname* { m i n } _ { \tilde { w } } R ^ { e } ( \tilde { w } \cdot \Phi ) , \forall e \in \mathcal { E } _ { t r }$ . The main objective of IRM is stated as
57
+
58
+ $$
59
+ \operatorname* { m i n } _ { w \in \mathbb { R } ^ { k \times r } , \Phi \in \mathbb { R } ^ { r \times d } } \frac { 1 } { | \mathcal { E } _ { t r } | } \sum _ { e \in \mathcal { E } _ { t r } } R ^ { e } ( w \cdot \Phi ) \quad \mathrm { s . t . } w \in \arg \operatorname* { m i n } _ { \tilde { w } \in \mathbb { R } ^ { k \times r } } R ^ { e } ( \tilde { w } \cdot \Phi ) , \ \forall e \in \mathcal { E } _ { t r } .
60
+ $$
61
+
62
+ Observe that if we drop the constraints in the above which search only over invariant predictors, then we get the standard empirical risk minimization (ERM) (Vapnik, 1992) (assuming all the training environments occur with equal probability). In all our theorems, we use 0-1 loss for binary classification $\mathcal { V } = \{ 0 , 1 \}$ and square loss for regression $\mathcal { V } = \mathbb { R }$ . For binary classification, the output of the predictor is given as $\mathsf { I } ( w \cdot \Phi ( X ^ { e } ) )$ , where $\mathsf { I } ( \cdot )$ is the indicator function that takes 1 if the input is $\geq 0$ and 0 otherwise, and the risk is $R ^ { e } ( w \cdot \Phi ) = \mathbb { E } \big [ | | ( w \cdot \Phi ( X ^ { e } ) ) - Y ^ { e } | \big ]$ . For regression, the output of the predictor is $w \cdot \Phi ( X ^ { e } )$ and the corresponding risk is $R ^ { e } ( w \cdot \Phi ) = \mathbb { E } \big [ ( w \cdot \Phi ( X ^ { e } ) - Y ^ { e } ) ^ { 2 } \big ]$ . We now present the main OOD generalization result from Arjovsky et al. (2019) for linear regressions.
63
+
64
+ Theorem 1. (Informal) If Assumption $^ { l }$ is satisfied, $\mathsf { R a n k } [ \Phi ] > 0$ , $| \mathcal { E } _ { t r } | > 2 d ,$ , and $\mathcal { E } _ { t r }$ lie in a linear general position (a mild condition on the data in $\mathcal { E } _ { t r }$ , defined in the Appendix), then each solution to equation (3) achieves OOD generalization (solves equation (1), $\ b e \in \mathcal { E } _ { a l l }$ with $r i s k > \sigma _ { \mathsf { s u p } } ^ { 2 } ,$ .
65
+
66
+ Despite the above guarantees, IRM has been shown to fail in several cases including linear SEMs in (Aubin et al., 2021). We take a closer look at these failures next.
67
+
68
+ Understanding the failures: fully informative invariant features vs. partially informative invariant features (FIIF vs. PIIF). We define properties salient to the datasets/SEMs used in the OOD generalization literature. Each $e \in \mathcal { E } _ { a l l }$ , the distribution $( X ^ { e } , Y ^ { e } ) \sim { \mathbb { P } } ^ { e }$ satisfies the following properties. a) $\exists$ a map $\Phi ^ { * }$ (linear or not), which we call an invariant feature map, such that $\mathbb { E } \big [ Y ^ { e } \big | \Phi ^ { * } \big ( X ^ { e } \big ) \big ]$ is the same for all $e \in \mathcal { E } _ { a l l }$ and $Y ^ { e } \not \downarrow \Phi ^ { * } ( X ^ { e } )$ . These conditions ensure $\Phi ^ { * }$ maps to features that have a finite predictive power and have the same optimal predictor across ${ \mathcal { E } } _ { a l l }$ . For the SEM in Assumption 1, $\Phi ^ { * }$ maps to $Z _ { \mathrm { i n v } } ^ { e }$ . b) $\exists$ a map $\Psi ^ { * }$ (linear or not), which we call spurious feature map, such that $\mathbb { E } \big [ Y ^ { e } \big | \Psi ^ { * } \big ( X ^ { e } \big ) \big ]$ is not the same for all $e \in \mathcal { E } _ { a l l }$ and $Y ^ { e } \not \vdash \Psi ^ { * } ( X ^ { e } )$ for some environments. $\Psi ^ { * }$ often creates a hindrance in learning predictors that only rely on $\Phi ^ { * }$ . Note that $\Psi ^ { * }$ should not be a transformation of some $\Phi ^ { * }$ . For the SEM in Assumption 1, suppose $Z _ { \mathsf { s p u } } ^ { e }$ is anti-causally related to $Y ^ { e }$ , then $\Psi ^ { * }$ maps to $Z _ { \mathsf { s p u } } ^ { e }$ (See Appendix for an example).
69
+
70
+ In the colored MNIST (CMNIST) dataset (Arjovsky et al., 2019), the digits are colored in such a way that in the training domain, color is highly predictive of the digit label but this correlation being spurious breaks down at test time. Suppose the invariant feature map $\Phi ^ { * }$ extracts the uncolored digit and the spurious feature map $\Psi ^ { * }$ extracts the background color. Ahuja et al. (2021) studied two variations of the colored MNIST dataset, which differed in the way final labels are generated from original MNIST labels (corrupted with noise or not). They showed that the IRM exhibits good OOD generalization $5 0 \%$ improvement over ERM) in anti-causal-CMNIST (AC-CMNIST, original data from Arjovsky et al. (2019)) but is no different from ERM and fails in covariate shift-CMNIST (CSCMNIST). In AC-CMNIST, the invariant features $\Phi ^ { * } ( X ^ { e } )$ (uncolored digit) are partially informative about the label, i.e., $Y \not \perp X ^ { e } | \Phi ^ { * } ( X ^ { e } )$ , and color contains information about label not contained in the uncolored digit. On the other hand in CS-CMNIST, invariant features are fully informative about the label, i.e., $Y \perp X ^ { e } | \Phi ^ { * } ( X ^ { e } )$ , i.e., they contains all the information about the label that is contained in input $X ^ { e }$ . Most human labelled datasets have fully informative invariant features; the labels (digit value) only depend on the invariant features (uncolored digit) and spurious features (color of the digit) do not affect the label. 5 In the rare case, when the humans are asked to label images in which the object being labelled itself is blurred, humans can rely on spurious features such as the background making such a data representative of PIIF setting. In Table 2, we divide the different datasets used in the literature based on informativeness of the invariant features. We observe that when the invariant features are fully informative, both IRM and ERM fail but only in classification tasks and not in regression tasks (Ahuja et al., 2021); this is consistent with the linear regression result in Theorem 1, where IRM succeeds regardless of whether $Y ^ { e } \perp X ^ { e } | Z _ { \mathsf { i n v } } ^ { e }$ holds or not. Motivated by this observation, we take a closer look at the classification tasks where invariant features are fully informative.
71
+
72
+ <table><tr><td>Fully informative invariant features (FIF) ∀e ∈εau,Ye ⊥ Xe|Φ*(Xe)</td><td>Partially informative invariant features (PIIF) e∈εau Ye / Xe|Φ*(Xe)</td></tr><tr><td>Task:classification Example2/2S,CS-CMNIST</td><td>Task:classification or regression</td></tr><tr><td>SEM in Assumption 2</td><td>Example 1/1S,Example 3/3S,AC-CMNIST</td></tr><tr><td>ERM and IRMfail</td><td>SEM in Rosenfeld et al. (2021)</td></tr><tr><td>Theorem 3,4 (This paper)</td><td>ERMfails,IRM succeeds sometimes Theorem9,5.1 (Arjovsky et al.,2019;Rosenfeld etal.,2021)</td></tr></table>
73
+
74
+ Table 2: Categorization of OOD evaluation datasets and SEMs. Example 1/1S, 2/2S, 3/3S from (Aubin et al., 2021), AC-CMNIST(Arjovsky et al., 2019), CS-CMNIST(Ahuja et al., 2021).
75
+
76
+ # 3 OOD generalization theory for linear classification tasks
77
+
78
+ A two-dimensional example with fully informative invariant features. We start with a 2D classification example (based on Nagarajan et al. (2021)), which can be understood as a simplified version of the CS-CMNIST dataset (Ahuja et al., 2021), Example 2/2S of Aubin et al. (2021), where both IRM and ERM fail. The example goes as follows. In each training environment $e \in \mathcal { E } _ { t r }$
79
+
80
+ $Y ^ { e } \gets | \Big ( X _ { \mathsf { i n v } } ^ { e } - \frac { 1 } { 2 } \Big )$ , where $X _ { \mathrm { i n v } } ^ { e } \in \{ 0 , 1 \}$ is Bernoulli $\left( { \frac { 1 } { 2 } } \right)$ , $X _ { \mathsf { s p u } } ^ { e } X _ { \mathsf { i n v } } ^ { e } \oplus W ^ { e }$ , where $W ^ { e } \in \{ 0 , 1 \}$ is Bernoulli $\left( 1 - p ^ { e } \right)$ with selection bias $p ^ { e } > \frac { 1 } { 2 }$ where Bernoulli $( a )$ takes value 1 with probability $a$ and 0 otherwise. Each training environment is characterized by the probability $p ^ { e }$ . Following Assumption 1, we assume that the labelling function does not change from $\mathcal { E } _ { t r }$ to ${ \mathcal { E } } _ { a l l }$ , thus the relation between the label and the invariant features does not change. Assume that the distribution of $X _ { \mathrm { i n v } } ^ { e }$ and $X _ { \mathsf { s p u } } ^ { e }$ can change arbitrarily. See Figure 1a) for a pictorial representation of this example illustrating the gist of the problem: there are many classifiers with the same error on $\mathcal { E } _ { t r }$ while only the one identical to the labelling function $\vert ( X _ { \mathrm { i n v } } ^ { e } - \frac { 1 } { 2 } )$ generalizes correctly OOD. Define a classifier $\begin{array} { r } { \mathsf { I } \big ( w _ { \mathsf { i n v } } x _ { \mathsf { i n v } } + w _ { \mathsf { s p u } } x _ { \mathsf { s p u } } - \frac { 1 } { 2 } \big ( w _ { \mathsf { i n v } } + w _ { \mathsf { s p u } } \big ) \big ) } \end{array}$ . Define a set of classifiers $\mathcal { S } = \{ ( w _ { \mathsf { i n v } } , w _ { \mathsf { s p u } } )$ s.t. $w _ { \mathsf { i n v } } > | w _ { \mathsf { s p u } } | \}$ . Observe that all the classifiers in $s$ achieve a zero classification error on the training environments. However, only classifiers for which $w _ { \mathsf { s p u } } = 0$ solve the OOD generalization (eq. (1)). With $\Phi$ as the identity, it can be shown that all the classifiers $s$ form an invariant predictor (satisfy the constraint in equation (3) over all the training environments when $\ell$ is the 0-1 loss). Observe that increasing the number of training environments to infinity does not address the problem, unlike with the linear regression result discussed in Theorem 1 (Arjovsky et al., 2019), where it was shown that if the number of environments increases linearly in the dimension of the data, then the solution to IRM also solves the OOD generalization (eq. (1)). 6 We use the above example to construct general SEMs for linear classification when the invariant features are fully informative. We follow the structure of the SEM from Assumption 1 in our construction.
81
+
82
+ ![](images/16c42a9b566c62313af5b6128943b376915fe626ce3a411fbef1120c46d26f93.jpg)
83
+ Figure 1: a) 2D classification example illustrating multiple invariant predictors: Most of these predictors rely on spurious features and each of them achieve zero error across all $\mathcal { E } _ { t r }$ , b) illustration of the impossibility result. If latent invariant features in the training environments are separable, then there are multiple equally good candidates that could have generated the data, and the algorithm cannot distinguish between these.
84
+
85
+ # Assumption 2. Linear classification structural equation model (FIIF). In each $e \in \mathcal { E } _ { a l l }$
86
+
87
+ $$
88
+ \begin{array} { r l } & { Y ^ { e } \gets \mathsf { I } \big ( w _ { \mathsf { i n v } } ^ { * } \cdot Z _ { \mathsf { i n v } } ^ { e } \big ) \oplus N ^ { e } , \quad N ^ { e } \sim \mathsf { B e r n o u l i } ( q ) , q < \frac { 1 } { 2 } , \quad N ^ { e } \perp ( Z _ { \mathsf { i n v } } ^ { e } , Z _ { \mathsf { s p u } } ^ { e } ) , } \\ & { X ^ { e } \gets S \big ( Z _ { \mathsf { i n v } } ^ { e } , Z _ { \mathsf { s p u } } ^ { e } \big ) , } \end{array}
89
+ $$
90
+
91
+ where $\boldsymbol { w _ { \mathrm { i n v } } ^ { * } } \in \mathbb { R } ^ { m }$ with $\| w _ { \mathrm { i n v } } ^ { * } \| = 1$ is the labelling hyperplane, $Z _ { \mathrm { i n v } } ^ { e } \in \mathbb { R } ^ { m }$ , $Z _ { \mathsf { s p u } } ^ { e } \in \mathbb { R } ^ { o }$ , $N ^ { e }$ is binary noise with identical distribution across environments, $\oplus$ is the XOR operator, $S$ is invertible.
92
+
93
+ If noise level $q$ is zero, then the above SEM covers linearly separable problems. See Figure 2a) for the directed acyclic graph (DAG) corresponding to this SEM. From the DAG observe that $Y ^ { e } \perp X ^ { e } | Z _ { \mathsf { i n v } } ^ { e }$ which implies that the invariant features are fully informative. Contrast this with a DAG that follows Assumption 1 shown in Figure 2b), where $Y ^ { e } \downarrow X ^ { e } | Z _ { \mathrm { i n v } } ^ { e }$ and thus the invariant features are not fully informative. If can change arb ${ \mathcal { E } } _ { a l l }$ follows the SEM in Assumption 2 and suppose the distribution of ly, then it can be shown that only a classifier identical to the labellin $Z _ { \mathrm { i n v } } ^ { e } , Z _ { \mathsf { s p u } } ^ { e }$ $\mathsf { I } ( w _ { \mathsf { i n v } } ^ { \ast } \cdot Z _ { \mathsf { i n v } } ^ { e } )$ can solve the OOD generalization (eq. (1)); such a classifier achieves an error of $q$ (noise level) in all the environments. As a result, if for a classifier we can find $e \in \mathcal { E } _ { a l l }$ that follows Assumption 2 where the error is greater than $q$ , then such a classifier does not solve equation (1). Now we ask – what are the minimal conditions on training environments $\mathcal { E } _ { t r }$ to achieve OOD generalization when ${ \mathcal { E } } _ { a l l }$ follow Assumption 2? To achieve OOD generalization for linear regressions, in Theorem 1, it was required that the number of training environments grows linearly in the dimension of the data. However, there was no restriction on the support of the latent invariant and latent spurious features, and they were allowed to change arbitrarily from train to test (for further discussion on this, see the Appendix). Can we continue to work with similar assumptions for the SEM in Assumption 2 and solve the OOD generalization (eq. (1))? We state some assumptions and notations to answer that. Define the support of the invariant (spurious) features $Z _ { \mathrm { i n v } } ^ { e } ( Z _ { \mathsf { s p u } } ^ { e } )$ in environment $e$ as $\mathcal { Z } _ { \mathrm { i n v } } ^ { e } ( \mathcal { Z } _ { \mathsf { s p u } } ^ { e } )$ .
94
+
95
+ Assumption 3. Bounded invariant features. $\cup _ { e \in \mathcal { E } _ { t r } } \mathcal { Z } _ { \mathfrak { i n v } } ^ { e }$ is a bounded set.7
96
+
97
+ Assumption 4. Bounded spurious features. $\cup _ { e \in { \mathcal E } _ { t r } } { \mathcal Z } _ { \mathsf { s p u } } ^ { e }$ is a bounded set.
98
+
99
+ Assumption 5. Invariant feature support overlap. $\forall e \in \mathcal { E } _ { a l l } , \mathcal { Z } _ { \mathsf { i n v } } ^ { e } \subseteq \cup _ { e ^ { \prime } \in \mathcal { E } _ { t r } } \mathcal { Z } _ { \mathsf { i n v } } ^ { e ^ { \prime } }$
100
+ Assumption 6. Spurious feature support overlap. $\forall e \in \mathcal { E } _ { a l l } , \mathcal { Z } _ { \mathsf { s p u } } ^ { e } \subseteq \cup _ { e ^ { \prime } \in \mathcal { E } _ { t r } } \mathcal { Z } _ { \mathsf { s p u } } ^ { e ^ { \prime } }$
101
+
102
+ Assumption 5 (6) states that the support of the invariant (spurious) features for unseen environments is the same as the union of the support over the training environments. It is important to note that support overlap does not imply that the distribution over the invariant features does not change. We now define a margin that measures how much the is training support of invariant features $Z _ { \mathrm { i n v } } ^ { e }$ separated by the labelling hyperplane $w _ { \mathrm { i n v } } ^ { \ast }$ . Define Inv-Margin $\begin{array} { r l } { } & { = \operatorname* { m i n } _ { z \in \cup _ { e \in \varepsilon _ { t r } } \mathcal { Z } _ { \mathrm { i n v } } ^ { e } } \mathsf { s g n } \big ( w _ { \mathsf { i n v } } ^ { * } \cdot z \big ) \big ( w _ { \mathsf { i n v } } ^ { * } \cdot z \big ) } \end{array}$ . This margin only coincides with the standard margin in support vector machines when the noise level $q$ is 0 (linearly separable) and $S$ is identity. If Inv-Margin $> 0$ , then the labelling hyperplane $w _ { \mathrm { i n v } } ^ { \ast }$ separates the support into two halves (see Figure 1b)).
103
+
104
+ Assumption 7. Strictly separable invariant features. Inv-Margin $> 0$
105
+
106
+ Next, we show the importance of support overlap for invariant features.
107
+
108
+ Theorem 2. Impossibility of guaranteed OOD generalization for linear classification. Suppose each $e \in \mathcal { E } _ { a l l }$ follows Assumption 2. If for all the training environments $\mathcal { E } _ { t r }$ , the latent invariant features are bounded and strictly separable, i.e., Assumption 3 and 7 hold, then every deterministic algorithm fails to solve the OOD generalization (eq. (1)), i.e., for the output of every algorithm $\exists e \in \mathcal { E } _ { a l l }$ in which the error exceeds the minimum required value $q$ (noise level).
109
+
110
+ The proofs to all the theorems are in the Appendix. We provide a high-level intuiton as to why invariant feature support overlap is crucial to the impossibility result. In Figure 1b), we show that if the support of latent invariant features are strictly separated by the labelling hyperplane $w _ { \mathrm { i n v } } ^ { \ast }$ , then we can find another valid hyperplane $w _ { \mathrm { i n v } } ^ { + }$ that is equally likely to have generated the same data. There is no algorithm that can distinguish between $w _ { \mathrm { i n v } } ^ { \ast }$ and $w _ { \mathrm { i n v } } ^ { + }$ . As a result, if we use data from the region where the hyperplanes disagree (yellow region Figure 1b)), then the algorithm fails.
111
+
112
+ Significance of Theorem 2. We showed that without the support overlap assumption on the invariant features, OOD generalization is impossible for linear classification tasks. This is in contrast to linear regression in Theorem 1 (Arjovsky et al., 2019), where even in the absence of the support overlap assumption, guaranteed OOD generalization was possible. Applying the above Theorem 2 to the 2D case (eq. (4)) implies that we cannot assume that the support of invariant latent features can change, or else that case is also impossible to solve.
113
+
114
+ Next, we ask what further assumptions are minimally needed to be able to solve the OOD generalization (eq. (1)). Each classifier can be written as $\bar { w } \cdot \dot { X ^ { e } } = \bar { w } \cdot S ( Z _ { \mathrm { i n v } } ^ { e } , Z _ { \mathrm { s p u } } ^ { e } ) = \tilde { w } _ { \mathrm { i n v } } \cdot Z _ { \mathrm { i n v } } ^ { e } + \tilde { w } _ { \mathrm { s p u } } Z _ { \mathrm { s p u } } ^ { e }$ . If $\tilde { w } _ { \mathsf { s p u } } \neq 0$ , then the classifier $\bar { w }$ is said to rely on spurious features.
115
+
116
+ Theorem 3. Sufficiency and Insufficiency of ERM and IRM. Suppose each $\textit { e } \in \mathcal { E } _ { a l l }$ follows Assumption 2. Assume that a) the invariant features are strictly separable, bounded, and satisfy support overlap, $b$ ) the spurious features are bounded (Assumptions 3-5, 7 hold).
117
+
118
+ • Sufficiency: If the spurious features satisfy support overlap (Assumption 6 holds), then both ERM and IRM solve the OOD generalization problem (eq. (1)). Also, there exist solutions to ERM and IRM solutions that rely on the spurious features and still achieve OOD generalization.
119
+
120
+ • Insufficiency: If spurious features do not satisfy support overlap, then both ERM and IRM fail at solving the OOD generalization problem (eq. (1)). Also, there exist no such classifiers that rely on spurious features and also achieve OOD generalization.
121
+
122
+ Significance of Theorem 3. From the first part, we learn that if the support overlap is satisfied for both the invariant features and the spurious features, then either ERM or IRM can solve the OOD generalization (eq. (1)). Interestingly, in this case we can have classifiers that rely on the spurious features and yet solve the OOD generalization (eq. (1)). For the 2D case (eq. (4)) this case implies that the entire set $s$ solves the OOD generalization (eq. (1)). From the second part, we learn that if support overlap holds for invariant features but not for spurious features, then the ideal OOD optimal predictors rely only on the invariant features. In this case, methods like ERM and IRM continue to rely on spurious features and fail at OOD generalization. For the above 2D case (eq. (4)) this implies that only the predictors that rely only on $X _ { \mathrm { i n v } } ^ { e }$ in the set $s$ solve the OOD generalization (eq. (1)).
123
+
124
+ To summarize, we looked at SEMs for classification tasks when invariant features are fully informative, and find that the support overlap assumption over invariant features is necessary. Even in the presence of support overlap for invariant features, we showed that ERM and IRM can easily fail if the support overlap is violated for spurious features. This raises a natural question – Can we even solve the case with the support overlap assumption only on the invariant features? We will now show that the information bottleneck principle can help tackle these cases.
125
+
126
+ # 4 Information bottleneck principle meets invariance principle
127
+
128
+ Why the information bottleneck? The information bottleneck principle prescribes to learn a representation that compresses the input $X$ as much as possible while preserving all the relevant information about the target label $Y$ (Tishby et al., 2000). Mutual information $I ( { \bar { X } } ; \Phi ( X ) )$ is used to measure information compression. If representation $\Phi ( X )$ is a deterministic transformation of $X$ , then in principle we can use the entropy of $\Phi ( X )$ to measure compression (Kirsch et al., 2020). Let us revisit the 2D case (eq. (4)) and apply this principle to it. Following the second part of Theorem 3, where ERM and IRM failed, assume that invariant features satisfy the support overlap assumption, but make no such assumption for the spurious features. Consider three choices for $\Phi$ : identity (selects both features), selects invariant feature only, selects spurious feature only. The entropy of $\dot { H } ( \Phi ( X ^ { e } ) )$ when $\Phi$ is the identity is $H ( p ^ { e } ) + \log ( 2 )$ , where $\bar { H ( p ^ { e } ) }$ is the Shannon entropy in Bernoulli $( p ^ { e } )$ . If $\Phi$ selects the invariant/spurious features only, then $H ( \Phi ( X ^ { e } ) ) = \log ( 2 )$ . Among all three choices, the one that has the least entropy and also achieves zero error is the representation that focuses on the invariant feature. We could find the OOD optimal predictor in this example just by using information bottleneck. Does it mean the invariance principle isn’t needed? We answer this next.
129
+
130
+ ![](images/d7e9c47c2763b3601fbf394b12401d20b00afacedae56e0a8a224df7da6e7244.jpg)
131
+ Figure 2: Comparison of the DAG from Assumption 2 (fully informative invariant features) vs. DAGs from Rosenfeld et al. (2021); Arjovsky et al. (2019) (partially informative invariant features).
132
+
133
+ Whand sider a simple classification SEM. In each , where all the random variables involve $e \in \mathcal { E } _ { t r }$ , i $Y ^ { e } \gets X _ { \mathsf { i n v } } ^ { 1 , e } \oplus X _ { \mathsf { i n v } } ^ { 2 , e } \oplus N ^ { e }$ $X _ { \mathsf { s p u } } ^ { e } Y ^ { e } \oplus V ^ { e }$ $N ^ { e } , V ^ { e }$ are Berthen in li with parameters predictions based $q$ (in cal across are bette $\mathcal { E } _ { t r }$ ), a $c ^ { e }$ (varies across predictions ba $\mathcal { E } _ { t r }$ ) re on If . $c ^ { e } < q$ , $\mathcal { E } _ { t r }$ $X _ { \mathsf { s p u } } ^ { e }$ $\bar { X } _ { \mathfrak { i n v } } ^ { 1 , e } , X _ { \mathfrak { i n v } } ^ { 2 , e }$ $X _ { \mathrm { i n v } } ^ { 1 , e } , X _ { \mathrm { i n v } } ^ { 2 , e }$ formation band not on are uniform Bernoulli, then these features have a higher entropy than neck would bar using . Invariance constrai $X _ { \mathsf { i n v } } ^ { 1 , e } , X _ { \mathsf { i n v } } ^ { 2 , e }$ . Instead, we want the modge the model to focus on $X _ { \mathsf { s p u } } ^ { e }$ . In this case, $X _ { \mathsf { i n v } } ^ { 1 , e }$ $X _ { \mathsf { i n v } } ^ { 2 , e }$ $X _ { \mathsf { s p u } } ^ { e }$ $X _ { \mathsf { i n v } } ^ { 1 , e }$ $X _ { \mathsf { i n v } } ^ { 2 , e }$ example, observe that invariant features are partially informative unlike the 2D case (eq. (4)).
134
+
135
+ Why invariance and information bottleneck? We have illustrated through simple examples when the information bottleneck is needed but not invariance and vice-versa. We now provide a simple example where both these constraints are needed at the same time. This example combines the 2D case (eq. (4)) and the example we highlighted in the paragraph above: $Y ^ { e } \gets X _ { \mathsf { i n v } } ^ { e } \oplus N ^ { e }$ , $X _ { \mathsf { s p u } } ^ { 1 , e } \gets X _ { \mathsf { i n v } } ^ { e } \oplus W ^ { e }$ , and $X _ { \mathsf { s p u } } ^ { 2 , e } \gets Y ^ { e } \oplus V ^ { e }$ . In this case, the invariance constraint does not allow representations that use information bottleneck c $X _ { \mathsf { s p u } } ^ { 2 , e }$ but does not prohibit representations that rely oints on top ensure that representations that only use $X _ { \mathsf { s p u } } ^ { 1 , e }$ . However,re used. We $X _ { \mathrm { i n v } } ^ { e }$ now describe an objective 8 that combines both these principles:
136
+
137
+ $$
138
+ \operatorname* { m i n } _ { w , \Phi } \sum _ { e \in { \mathcal E } _ { t r } } h ^ { e } \big ( w \cdot \Phi \big ) \quad \mathrm { s . t . } \ \frac { 1 } { | { \mathcal E } _ { t r } | } \sum _ { e \in { \mathcal E } _ { t r } } R ^ { e } \big ( w \cdot \Phi \big ) \leq r ^ { \mathrm { t h } } , \ w \in \arg \operatorname* { m i n } _ { \tilde { w } \in \mathbb R ^ { k \times r } } R ^ { e } \big ( \tilde { w } \cdot \Phi \big ) , \forall e \in { \mathcal E } _ { t r } ,
139
+ $$
140
+
141
+ where $h ^ { e }$ in the above is a lower bounded differential entropy defined below and $r ^ { \mathrm { t h } }$ is the threshold on the average risk. Typical information bottleneck based optimization in neural networks involves minimization of the entropy of the representation output from a certain hidden layer. For both analytical convenience and also because the above setup is a linear model, we work with the simplest form of bottleneck which directly minimizes the entropy of the output layer. Recall the definition of differential entropy of a random variable $X$ $\quad , h ( X ) = - \mathbf { \bar { \mathbb { E } } } _ { X } [ \log d \mathbb { P } _ { X } ]$ and $d \mathbb { P } _ { X }$ is the Radon-Nikodym derivative of $\mathbb { P } _ { X }$ with respect to Lebesgue measure. Because in general differential entropy has no lower bound, we add a small independent noise term $\zeta$ (Kirsch et al., 2020) to the classifier to ensure that the entropy is bounded below. We call the above optimization information bottleneck based invariant risk minimization (IB-IRM). In summary, among all the highly predictive invariant predictors we pick the ones that have the least entropy. If we drop the invariance constraint from the above optimization, we get information bottleneck based empirical risk minimization (IB-ERM). In the above formulation and following result, we assume that $X ^ { e }$ are continuous random variables; the results continue to hold for discrete $X ^ { e }$ as well (See Appendix for details).
142
+
143
+ # Theorem 4. IB-IRM and IB-ERM vs. IRM and ERM
144
+
145
+ 8Results extend to alternate objective with information bottleneck constraints and average risk as objective.
146
+
147
+ • Fully informative invariant features (FIIF). Suppose each $e \in \mathcal { E } _ { a l l }$ follows Assumption 2. Assume that the invariant features are strictly separable, bounded, and satisfy support overlap (Assumptions 3,5 and 7 hold). Also, for each $e \in \mathcal { E } _ { t r }$ $Z _ { \mathsf { s p u } } ^ { e } A Z _ { \mathsf { i n v } } ^ { e } + W ^ { e }$ , where $A \in \mathbb { R } ^ { o \times m }$ , $W ^ { e } \in \mathbb { R } ^ { o }$ is continuous, bounded, and zero mean noise. Each solution to $I B$ -IRM (eq. (6), with $\ell$ as 0-1 loss, and $r ^ { \mathrm { t h } } = q ,$ ), and IB-ERM solves the OOD generalization (eq. (1)) but ERM and IRM (eq.(3)) fail.
148
+
149
+ • Partially informative invariant features $( P I I F )$ . Suppose each $e \in \mathcal { E } _ { a l l }$ follows Assumption 1 and $\exists \ e \in { \mathcal { E } } _ { t r }$ such that $\mathbb { E } [ \epsilon ^ { e } Z _ { \mathsf { s p u } } ^ { e } ] \neq 0$ . If $| \mathcal { E } _ { t r } | > 2 d$ and the set $\mathcal { E } _ { t r }$ lies in a linear general position (a mild condition defined in the Appendix), then each solution to IB-IRM (eq. (6), with $\ell$ as square loss, $\sigma _ { \epsilon } ^ { 2 } < r ^ { \mathsf { t h } } \le \sigma _ { Y } ^ { 2 }$ , where $\sigma _ { Y } ^ { 2 }$ and $\sigma _ { \epsilon } ^ { 2 }$ are the variance in the label and noise across $\mathcal { E } _ { t r }$ ) and IRM (eq.(3)) solves OOD generalization (eq. (1)) but IB-ERM and ERM fail.
150
+
151
+ Significance of Theorem 4 and remarks. In the first part (FIIF), IB-ERM and IB-IRM succeed without assuming support overlap for the spurious features, which was crucial for success of ERM and IRM in Theorem 3. This establishes that support overlap of spurious features is not a necessary condition. Observe that when invariant features are fully informative, IB-ERM and IB-IRM succeed, but when invariant features are partially informative IB-IRM and IRM succeed. In real data settings, we do not know if the invariant features are fully or partially informative. Since IB-IRM is the only common winner in both the settings, it would be pragmatic to use it in the absence of domain knowledge about the informativeness of the invariant features. In the paragraph preceding the objective in equation (6), we discussed examples where both the IB and IRM constraints were needed at the same time. In the Appendix, we generalize that example and show that if we change the assumptions in linear classification SEM in Assumption 2 such that the invariant features are partially informative, then we see the joint benefit of IB and IRM constraints. At this point, it is also worth pointing to a result in Rosenfeld et al. (2021), which focused on linear classification SEMs (DAG shown in Figure 2c) with partially informative invariant features. Under the assumption of complete support overlap for spurious and invariant features, authors showed IRM succeeds.
152
+
153
+ # 4.1 Proposed approach
154
+
155
+ We take the three terms from the optimization in equation (6) and create a weighted combination as
156
+
157
+ $$
158
+ \sum _ { \epsilon } \Big ( R ^ { e } ( \Phi ) + \lambda \| \nabla _ { w , w = 1 , 0 } R ^ { e } ( w \cdot \Phi ) \| ^ { 2 } + \nu h ^ { e } ( \Phi ) \Big ) \leq \sum _ { \epsilon } \Big ( R ^ { e } ( \Phi ) + \lambda \| \nabla _ { w , w = 1 , 0 } R ^ { e } ( w \cdot \Phi ) \| ^ { 2 } + \nu h ( \Phi ) \Big ) .
159
+ $$
160
+
161
+ In the LHS above, the first term corresponds to the risks across environments, the second term approximates invariance constraint (follows the IRMv1 objective (Arjovsky et al., 2019)), and the third term is the entropy of the classifier in each environment.
162
+
163
+ In the RHS, $h ( \Phi )$ is the entropy of $\Phi$ unconditional on the environment (the entropy on the left-hand side is entropy conditional on the environment assuming all the environments are equally likely). Optimizing over differential entropy is not easy, and thus we resort to minimizing an upper bound of it (Kirsch et al., 2020). We use the standard result that among all continuous random variables with the same variance, Gaussian has the maximum differential entropy. Since the entropy of Gaussian increases with its variance, we use the variance of $\Phi$ instead of the differential entropy (For further details, see the Appendix). Our final objective is given as
164
+
165
+ $$
166
+ \sum _ { e } \Big ( R ^ { e } ( \Phi ) + \lambda \| \nabla _ { w , w = 1 . 0 } R ^ { e } ( w \cdot \Phi ) \| ^ { 2 } + \gamma \mathsf { V a r } ( \Phi ) \Big ) .
167
+ $$
168
+
169
+ # On the behavior of gradient descent with and without informa
170
+
171
+ ![](images/8a3cf0e7bca3d1fa872223a8320e95f17f3937c66e0aca73f9415c50e7db929d.jpg)
172
+ Figure 3: Comparing convergence of $\frac { \vert w _ { \mathsf { s p u } } \vert } { \sqrt { w _ { \mathsf { s p u } } ^ { 2 } + w _ { \mathsf { i n v } } ^ { 2 } } }$ (metric from Nagarajan et al. (2021)) for average selection bias $p = 0 . 9$ .
173
+
174
+ tion bottleneck. In the entire discussion so far, we have focused on ensuring that the set of optimal solutions to the desired objective (IB-IRM, IB-ERM, etc.) correspond to the solutions of the OOD generalization problem (eq. (1)). In some simple cases, such as the 2D case (eq. (4)), it can be shown that gradient descent is biased towards selecting the ideal classifier (Soudry et al., 2018; Nagarajan et al., 2021). Even though gradient descent can eventually learn the ideal classifier that only relies on the invariant features, training is frustratingly slow as was shown by Nagarajan et al. (2021). In the next theorem, we characterize the impact of using IB penalty $( \mathsf { V a r } ( \Phi ) )$ in the 2D example (eq. (4)). We compare the methods in terms of | wspu(t)winv(t) |, which was the metric used in Nagarajan et al. (2021); $w _ { \mathsf { s p u } } ( t )$ and $w _ { \mathsf { i n v } } ( t )$ are the weights for the spurious feature and the invariant feature at time $t$ of training (assuming training happens with continuous time gradient descent).
175
+
176
+ Theorem 5. Impact of $\pmb { I B }$ on learning speed. Suppose each $\textit { e } \in \mathcal { E } _ { t r }$ follows the $2 D$ case from equation (4). Set $\lambda = 0$ , $\gamma > 0$ in equation (7) to get the $I B$ -ERM objective with $\ell$ as exponential loss. Continuous-time gradient descent on this IB-ERM objective achieves $| \frac { w _ { \mathsf { s p u } } ( t ) } { w _ { \mathsf { i n v } } ( t ) } | \leq \epsilon$ in time less than $\frac { W _ { 0 } ( \frac { 1 } { 2 \gamma } ) } { 2 ( 1 - p ) \epsilon }$ $W _ { 0 } ( \cdot )$ denotes the principal branch of the Lambert $W$ function), while in the same time the ratio for ERM $\begin{array} { r } { \vert \frac { w _ { \mathrm { s p u } } ( t ) } { w _ { \mathrm { i n v } } ( t ) } \vert \ge \ln ( \frac { 1 + 2 p } { 3 - 2 p } ) / \ln \left( 1 + \frac { W _ { 0 } ( \frac { 1 } { 2 \gamma } ) } { 2 ( 1 - p ) \epsilon } \right) } \end{array}$ W0( 12γ )2(1−p) , where p = 1|Etr | Pe∈Etr pe .
177
+
178
+ $| \frac { w _ { \mathsf { s p u } } ( t ) } { w _ { \mathsf { i n v } } ( t ) } |$ converges to zero for both methods, but it converges much faster for IB-ERM (for $p =$ $0 . 9 , \epsilon = 0 . 0 0 1 , \gamma = 0 . 5 8$ , the ratio for IB-ERM is $| \frac { w _ { \mathsf { s p u } } ( t ) } { w _ { \mathsf { i n v } } ( t ) } | \leq 0 . 0 0 1$ and ratio for ERM is $| \frac { w _ { \mathsf { s p u } } ( t ) } { w _ { \mathsf { i n v } } ( t ) } | \geq$ 0.09). In the above theorem, we analyzed the impact of information bottleneck only. The convergence analysis for both the penalties jointly comes with its own challenges, and we hope to explore this in future work. However, we carried out experiments with gradient descent on all the objectives for the 2D example (eq. (4)). See Figure 3 for the comparisons.
179
+
180
+ # 5 Experiments
181
+
182
+ Methods, datasets & metrics. We compare our approaches – information bottleneck based ERM (IBERM) and information bottleneck based IRM (IB-IRM) with ERM and IRM. We also compare with an Oracle model trained on data where spurious features are permuted to remove spurious correlations. We use all the datasets in Table 2, Terra Incognita dataset (Beery et al., 2018), and COCO (Ahmed et al., 2021). We follow the same protocol for tuning hyperparameters from Aubin et al. (2021); Arjovsky et al. (2019) for their respective datasets (see the Appendix for more details). As is reported in literature, for Example 2/2S, Example 3/3S we use classification error and for AC-CMNIST, CS-CMNIST, Terra Incognita, and COCO we use accuracy. For Example 1/1S, we use mean square error (MSE). The code for experiments can be found at https://github.com/ahujak/IB-IRM.
183
+
184
+ Summary of results. In Table 3, we provide a comparison of methods for different examples in linear unit tests (Aubin et al., 2021) for three and six training environments. In Table 4, we provide a comparison of the methods for different CMNIST datasets, Terra Incognita and COCO dataset. Based on our Theorem 4, we do not expect ERM and IB-ERM to do well on Example 1/1S, Example 3/3S and AC-CMNIST as these datasets fall in the PIIF category, i.e, the invariant features are partially informative. On these examples, we find that IRM and IB-IRM do better than ERM and IB-ERM (for Example 3/3S when there are three environments all methods perform poorly). Based on our Theorem 4, we do not expect IRM and ERM to do well on Example 2/2S, CS-CMNIST, Terra Incognita and COCO dataset,9 as these datasets fall in the FIIF category, i.e., the invariant features are fully informative. On these FIIF examples, we find that IB-ERM always performs well (close to oracle), and in some cases IB-IRM also performs well. Our experiments confirm that IB penalty has a crucial role to play in FIIF settings and IRMv1 penalty has a crucial role to play in PIIF settings (to further this claim, we provide an ablation study in the Appendix). On Example 1/1S, AC-CMNIST, we find that IB-IRM is able to extract the benefit of IRMv1 penalty. On CS-CMNIST and Example 2/2S we find that IB-IRM is able to extract the benefit of IB penalty. In settings such as COCO dataset, where IB-IRM does not perform as well as IB-ERM, better hyperparameter tuning strategies should be able to help IB-IRM adapt and put a higher weight on IB penalty. Overall, we can conclude that IB-ERM improves over ERM (significantly in FIIF and marginally in PIIF settings), and IB-IRM improves over IRM (improves in FIIF settings and retains advantages in PIIF settings).
185
+
186
+ Remark. As we move from three to six environments, we observe that MSE in Example 1/1S exhibits a larger variance. This is because of the way data is generated, the new environments that are sampled have labels that have a higher noise level (we follow the same procedure as in Aubin et al. (2021)).
187
+
188
+ # 6 Extensions, limitations, and future work
189
+
190
+ Extension to non-linear models and multi-class classification. In this work our theoretical analysis focused on linear models. Consider the map $X S ( Z _ { \mathsf { i n v } } , Z _ { \mathsf { s p u } } )$ in Assumption 2. Suppose $S$ is non-linear and bijective. We can divide the learning task into two parts a) invert $S$ to obtain $Z _ { \mathrm { i n v } }$ , $Z _ { \mathsf { s p u } }$ and b) learn a linear model that only relies on the invariant features $Z _ { \mathrm { i n v } }$ to predict the label $Y$ . For part b), we can rely on the approaches proposed in this work. For part a), we need to leverage advancements in the field of non-linear ICA (Khemakhem et al., 2020). The current state-of-the-art to solve part a) requires strong structural assumptions on the dependence between all the components of $Z _ { \mathrm { i n v } }$ , $Z _ { \mathsf { s p u } }$ (Lu et al., 2021). Therefore, solving part a) and part b) in conjunction with minimal assumptions forms an exciting future work. In the entire work, the discussion was focused on binary classification tasks and regression tasks. For multi-class classification settings, we consider natural extension of the SEM in Assumption 2 (See the Appendix) and our main results continue to hold.
191
+
192
+ <table><tr><td></td><td>#Envs</td><td>ERM</td><td>IB-ERM</td><td>IRM</td><td>IB-IRM</td><td>Oracle</td></tr><tr><td>Example1</td><td>3</td><td>13.36 ±1.49</td><td>12.96 ±1.30</td><td>11.15± 0.71</td><td>11.68 ± 0.90</td><td>10.42±0.16</td></tr><tr><td>Example1s</td><td>3</td><td>13.33 ± 1.49</td><td>12.92 ± 1.30</td><td>11.07 ± 0.68</td><td>11.74 ± 1.03</td><td>10.45±0.19</td></tr><tr><td>Example2</td><td>3</td><td>0.42 ± 0.01</td><td>0.00±0.00</td><td>0.45 ± 0.00</td><td>0.00 ±0.00</td><td>0.00 ±0.00</td></tr><tr><td>Example2s</td><td>3</td><td>0.45 ± 0.01</td><td>0.00 ± 0.01</td><td>0.45 ± 0.01</td><td>0.06 ± 0.12</td><td>0.00 ± 0.00</td></tr><tr><td>Example3</td><td>3</td><td>0.48 ± 0.07</td><td>0.49 ± 0.06</td><td>0.48 ± 0.07</td><td>0.48 ± 0.07</td><td>0.01 ± 0.00</td></tr><tr><td>Example3s</td><td>3</td><td>0.49 ± 0.06</td><td>0.49 ± 0.06</td><td>0.49 ± 0.07</td><td>0.49 ± 0.07</td><td>0.01 ±0.00</td></tr><tr><td>Example1</td><td>6</td><td>33.74 ± 60.18</td><td>32.03 ± 57.05</td><td>23.04 ± 40.64</td><td>25.66 ± 45.96</td><td>22.21±39.25</td></tr><tr><td>Example1s</td><td>6</td><td>33.62 ± 59.80</td><td>31.92 ± 56.70</td><td>22.92 ± 40.60</td><td>25.60 ± 45.62</td><td>22.13±38.93</td></tr><tr><td>Example2</td><td>6</td><td>0.37 ± 0.06</td><td>0.02 ± 0.05</td><td>0.46 ± 0.01</td><td>0.43 ± 0.11</td><td>0.00±0.00</td></tr><tr><td>Example2s</td><td>6</td><td>0.46 ± 0.01</td><td>0.02 ± 0.06</td><td>0.46 ± 0.01</td><td>0.45 ± 0.10</td><td>0.00±0.00</td></tr><tr><td>Example3</td><td>6</td><td>0.33 ± 0.18</td><td>0.26 ± 0.20</td><td>0.14 ± 0.18</td><td>0.19 ± 0.19</td><td>0.01±0.00</td></tr><tr><td>Example3s</td><td>6</td><td>0.36 ±0.19</td><td>0.27 ± 0.20</td><td>0.14 ± 0.18</td><td>0.19 ± 0.19</td><td>0.01±0.00</td></tr></table>
193
+
194
+ Table 3: Comparisons on linear unit tests in terms of mean square error (regression) and classification error (classification). “#Envs” means the number of training environments.
195
+
196
+ <table><tr><td></td><td>ERM</td><td>IB-ERM</td><td>IRM</td><td>IB-IRM</td></tr><tr><td>CS-CMNIST</td><td>60.27 ± 1.21</td><td>71.80 ± 0.69</td><td>61.49 ± 1.45</td><td>71.79 ± 0.70</td></tr><tr><td>AC-CMNIST</td><td>16.84 ± 0.82</td><td>50.24 ± 0.47</td><td>66.98 ± 1.65</td><td>67.67 ± 1.78</td></tr><tr><td>Terra Incognita</td><td>49.80 ± 4.40</td><td>56.40 ± 2.10</td><td>54.60 ± 1.30</td><td>54.10 ± 2.00</td></tr><tr><td>COCO</td><td>22.70 ± 1.04</td><td>31.66 ± 2.39</td><td>18.47 ± 10.20</td><td>25.10 ± 1.03</td></tr></table>
197
+
198
+ Table 4: Classification accuracy percentage on colored MNISTs, Terra Incognita and COCO dataset.
199
+
200
+ On the choice for IB penalty and IRMv1 penalty. We use the approximation for entropy (in equation (7)) described in Kirsch et al. (2020). The approximation (even though an upper bound) serves as an effective proxy for the true information bottleneck as shown in the experiments in Kirsch et al. (2020) (e.g., see their experiment on Imagenette dataset). Also, our experiments validate this approximation even in moderately high dimensions, as an example in CS-CMNIST, the dimension of the layer at which bottleneck constraints are applied is 256. Developing tighter approximations for information bottleneck in high dimensions and analyzing their impact on OOD generalization is an important future work. In recent works (Rosenfeld et al., 2021; Kamath et al., 2021; Gulrajani and Lopez-Paz, 2021), there has been criticism of different aspects of IRM, e.g., failure of IRMv1 penalty in non-linear models, the tuning of IRMv1 penalty, etc. Since we use IRMv1 penalty in our proposed loss, these criticisms apply to our objective as well. Other approximations of invariance have been proposed in the literature (Koyama and Yamaguchi, 2020; Ahuja et al., 2020; Chang et al., 2020). Exploring their benefits together with information bottleneck is a fruitful future work. Before concluding, we want to remark that we have already discussed the closest related works. However, we also provide a detailed discussion of the broader related literature in the Appendix.
201
+
202
+ # 7 Conclusion
203
+
204
+ In this work, we revisited the fundamental assumptions for OOD generalization for settings when invariant features capture all the information about the label. We showed how linear classification tasks are different and need much stronger assumptions than linear regression tasks. We provide a sharp characterization of performance of ERM and IRM under different assumptions on support overlap of invariant and spurious features. We showed that support overlap of invariant features is necessary or otherwise OOD generalization is impossible. However, ERM and IRM seem to fail even in the absence of support overlap of spurious features. We prove that a form of the information bottleneck constraint along with invariance goes a long way in overcoming the failures while retaining the existing provable guarantees.
205
+
206
+ # Acknowledgements
207
+
208
+ We thank Reyhane Askari Hemmat, Adam Ibrahim, Alexia Jolicoeur-Martineau, Divyat Mahajan, Ryan D’Orazio, Nicolas Loizou, Manuela Girotti, and Charles Guille-Escuret for the feedback. Kartik Ahuja would also like to thank Karthikeyan Shanmugam for discussions pertaining to the related works.
209
+
210
+ # Funding disclosure
211
+
212
+ We would like to thank Samsung Electronics Co., Ldt. for funding this research. Kartik Ahuja acknowledges the support provided by IVADO postdoctoral fellowship funding program. Yoshua Bengio acknowledges the support from CIFAR and IBM. Ioannis Mitliagkas acknowledges support from an NSERC Discovery grant (RGPIN-2019-06512), a Samsung grant, Canada CIFAR AI chair and MSR collaborative research grant. Irina Rish acknowledges the support from Canada CIFAR AI Chair Program and from the Canada Excellence Research Chairs Program. We thank Compute Canada for providing computational resources.
213
+
214
+ # References
215
+
216
+ Ahmed, F., Bengio, Y., van Seijen, H., and Courville, A. (2021). Systematic generalisation with group invariant predictions. In International Conference on Learning Representations.
217
+ Ahuja, K., Shanmugam, K., Varshney, K., and Dhurandhar, A. (2020). Invariant risk minimization games. In International Conference on Machine Learning, pages 145–155. PMLR.
218
+ Ahuja, K., Wang, J., Dhurandhar, A., Shanmugam, K., and Varshney, K. R. (2021). Empirical or invariant risk minimization? a sample complexity perspective. In International Conference on Learning Representations.
219
+ Arjovsky, M., Bottou, L., Gulrajani, I., and Lopez-Paz, D. (2019). Invariant risk minimization. arXiv preprint arXiv:1907.02893.
220
+ Aubin, B., Słowik, A., Arjovsky, M., Bottou, L., and Lopez-Paz, D. (2021). Linear unit-tests for invariance discovery. arXiv preprint arXiv:2102.10867.
221
+ Beery, S., Van Horn, G., and Perona, P. (2018). Recognition in terra incognita. In Proceedings of the European Conference on Computer Vision, pages 456–473.
222
+ Chang, S., Zhang, Y., Yu, M., and Jaakkola, T. S. (2020). Invariant rationalization. In International Conference on Machine Learning, 2020.
223
+ DeGrave, A. J., Janizek, J. D., and Lee, S.-I. (2020). AI for radiographic COVID-19 detection selects shortcuts over signal. medRxiv.
224
+ Geirhos, R., Jacobsen, J.-H., Michaelis, C., Zemel, R., Brendel, W., Bethge, M., and Wichmann, F. A. (2020). Shortcut learning in deep neural networks. Nature Machine Intelligence, 2(11):665–673.
225
+ Gulrajani, I. and Lopez-Paz, D. (2021). In search of lost domain generalization. In International Conference on Learning Representations.
226
+ Kamath, P., Tangella, A., Sutherland, D. J., and Srebro, N. (2021). Does invariant risk minimization capture invariance? arXiv preprint arXiv:2101.01134.
227
+ Khemakhem, I., Kingma, D., Monti, R., and Hyvarinen, A. (2020). Variational autoencoders and nonlinear ica: A unifying framework. In International Conference on Artificial Intelligence and Statistics, pages 2207–2217. PMLR.
228
+ Kirsch, A., Lyle, C., and Gal, Y. (2020). Unpacking information bottlenecks: Unifying informationtheoretic objectives in deep learning. arXiv preprint arXiv:2003.12537.
229
+ Koyama, M. and Yamaguchi, S. (2020). Out-of-distribution generalization with maximal invariant predictor. arXiv preprint arXiv:2008.01883.
230
+ Krueger, D., Caballero, E., Jacobsen, J.-H., Zhang, A., Binas, J., Zhang, D., Priol, R. L., and Courville, A. (2020). Out-of-distribution generalization via risk extrapolation (rex). arXiv preprint arXiv:2003.00688.
231
+ Lu, C., Wu, Y., Hernández-Lobato, J. M., and Schölkopf, B. (2021). Nonlinear invariant risk minimization: A causal approach. arXiv preprint arXiv:2102.12353.
232
+ Nagarajan, V., Andreassen, A., and Neyshabur, B. (2021). Understanding the failure modes of out-of-distribution generalization. In International Conference on Learning Representations.
233
+ Pearl, J. (1995). Causal diagrams for empirical research. Biometrika, 82(4):669–688.
234
+ Peters, J., Bühlmann, P., and Meinshausen, N. (2015). Causal inference using invariant prediction: identification and confidence intervals. arXiv preprint arXiv:1501.01332.
235
+ Pezeshki, M., Kaba, S.-O., Bengio, Y., Courville, A., Precup, D., and Lajoie, G. (2020). Gradient starvation: A learning proclivity in neural networks. arXiv preprint arXiv:2011.09468.
236
+ Robey, A., Pappas, G. J., and Hassani, H. (2021). Model-based domain generalization. arXiv preprint arXiv:2102.11436.
237
+ Rojas-Carulla, M., Schölkopf, B., Turner, R., and Peters, J. (2018). Invariant models for causal transfer learning. The Journal of Machine Learning Research, 19(1):1309–1342.
238
+ Rosenfeld, E., Ravikumar, P. K., and Risteski, A. (2021). The risks of invariant risk minimization. In International Conference on Learning Representations.
239
+ Soudry, D., Hoffer, E., Nacson, M. S., Gunasekar, S., and Srebro, N. (2018). The implicit bias of gradient descent on separable data. The Journal of Machine Learning Research, 19(1):2822–2878.
240
+ Tishby, N., Pereira, F. C., and Bialek, W. (2000). The information bottleneck method. arXiv preprint physics/0004057.
241
+ Vapnik, V. (1992). Principles of risk minimization for learning theory. In Advances in neural information processing systems, pages 831–838.
242
+ Zhang, D., Ahuja, K., Xu, Y., Wang, Y., and Courville, A. C. (2021). Can subnetwork structure be the key to out-of-distribution generalization? In ICML.
243
+
244
+ # Checklist
245
+
246
+ 1. For all authors...
247
+
248
+ (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] See Section 2-5 and the additional details such as the proofs in the supplementary material.
249
+ (b) Did you describe the limitations of your work? [Yes] See Section 4.1 and Section 6.
250
+ (c) Did you discuss any potential negative societal impacts of your work? [Yes] See Section A.1 in the Appendix in the supplementary material.
251
+ (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
252
+
253
+ 2. If you are including theoretical results...
254
+
255
+ (a) Did you state the full set of assumptions of all theoretical results? [Yes] See Section 2-4.
256
+ (b) Did you include complete proofs of all theoretical results? [Yes] See the Appendix in the Supplementary Material.
257
+
258
+ 3. If you ran experiments...
259
+
260
+ (a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] See https://github.com/ahujak/IB-IRM
261
+
262
+ (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section A.2 in the Appendix in the supplementary material.
263
+ (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] See Section A.2 in the Appendix in the supplementary material.
264
+ (d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Section A.2 in the Appendix in the supplementary material.
265
+
266
+ 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
267
+
268
+ (a) If your work uses existing assets, did you cite the creators? [Yes] We use the codes from following github repositories https://github.com/ facebookresearch/DomainBed, https://github.com/facebookresearch/ InvariantRiskMinimization and https://github.com/facebookresearch/ InvarianceUnitTests and we have cited the creators in the Section A.2 in the Appendix in the supplementary material.
269
+ (b) Did you mention the license of the assets? [Yes] All the repositories mentioned above use MIT license. We have mentioned this in Section A.2 in the Appendix in the supplementary material.
270
+ (c) Did you include any new assets either in the supplemental material or as a URL? [Yes] We have included code for our experiments in the supplementary material.
271
+ (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
272
+ (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
273
+
274
+ 5. If you used crowdsourcing or conducted research with human subjects...
275
+
276
+ (a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
277
+ (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
278
+ (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
md/train/rJgUfTEYvH/rJgUfTEYvH.md ADDED
@@ -0,0 +1,374 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # VIDEOFLOW: A CONDITIONAL FLOW-BASED MODEL FOR STOCHASTIC VIDEO GENERATION
2
+
3
+ Manoj Kumar∗, Mohammad Babaeizadeh, Dumitru Erhan, Chelsea Finn, Sergey Levine, Laurent Dinh, Durk Kingma
4
+
5
+ Google Research, Brain Team {mechcoder,mbz,dumitru,chelseaf,slevine,laurentdinh,durk}@google.com
6
+
7
+ # ABSTRACT
8
+
9
+ Generative models that can model and predict sequences of future events can, in principle, learn to capture complex real-world phenomena, such as physical interactions. However, a central challenge in video prediction is that the future is highly uncertain: a sequence of past observations of events can imply many possible futures. Although a number of recent works have studied probabilistic models that can represent uncertain futures, such models are either extremely expensive computationally as in the case of pixel-level autoregressive models, or do not directly optimize the likelihood of the data. To our knowledge, our work is the first to propose multi-frame video prediction with normalizing flows, which allows for direct optimization of the data likelihood, and produces high-quality stochastic predictions. We describe an approach for modeling the latent space dynamics, and demonstrate that flow-based generative models offer a viable and competitive approach to generative modeling of video.
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ Exponential progress in the capabilities of computational hardware, paired with a relentless effort towards greater insights and better methods, has pushed the field of machine learning from relative obscurity into the mainstream. Progress in the field has translated to improvements in various capabilities, such as classification of images (Krizhevsky et al., 2012), machine translation (Vaswani et al., 2017) and super-human game-playing agents (Mnih et al., 2013; Silver et al., 2017), among others. However, the application of machine learning technology has been largely constrained to situations where large amounts of supervision is available, such as in image classification or machine translation, or where highly accurate simulations of the environment are available to the learning agent, such as in game-playing agents. An appealing alternative to supervised learning is to utilize large unlabeled datasets, combined with predictive generative models. In order for a complex generative model to be able to effectively predict future events, it must build up an internal representation of the world. For example, a predictive generative model that can predict future frames in a video would need to model complex real-world phenomena, such as physical interactions. This provides an appealing mechanism for building models that have a rich understanding of the physical world, without any labeled examples. Videos of real-world interactions are plentiful and readily available, and a large generative model can be trained on large unlabeled datasets containing many video sequences, thereby learning about a wide range of real-world phenoma. Such a model could be useful for learning representations for further downstream tasks (Mathieu et al., 2016), or could even be used directly in applications where predicting the future enables effective decision making and control, such as robotics (Finn et al., 2016). A central challenge in video prediction is that the future is highly uncertain: a short sequence of observations of the present can imply many possible futures. Although a number of recent works have studied probabilistic models that can represent uncertain futures, such models are either extremely expensive computationally (as in the case of pixel-level autoregressive models), or do not directly optimize the likelihood of the data.
14
+
15
+ In this paper, we study the problem of stochastic prediction, focusing specifically on the case of conditional video prediction: synthesizing raw RGB video frames conditioned on a short context of past observations (Ranzato et al., 2014; Srivastava et al., 2015; Vondrick et al., 2015; Xingjian et al., 2015; Boots et al., 2014). Specifically, we propose a new class of video prediction models that can provide exact likelihoods, generate diverse stochastic futures, and accurately synthesize realistic and high-quality video frames. The main idea behind our approach is to extend flow-based generative models (Dinh et al., 2014; 2016) into the setting of conditional video prediction. To our knowledge, flow-based models have been applied only to generation of non-temporal data, such as images (Kingma & Dhariwal, 2018), and to audio sequences (Prenger et al., 2018). Conditional generation of videos presents its own unique challenges: the high dimensionality of video sequences makes them difficult to model as individual datapoints. Instead, we learn a latent dynamical system model that predicts future values of the flow model’s latent state. This induces Markovian dynamics on the latent state of the system, replacing the standard unconditional prior distribution. We further describe a practically applicable architecture for flow-based video prediction models, inspired by the Glow model for image generation (Kingma & Dhariwal, 2018), which we call VideoFlow.
16
+
17
+ Our empirical results show that VideoFlow achieves results that are competitive with the state-ofthe-art in stochastic video prediction on the action-free BAIR dataset, with quantitative results that rival the best VAE-based models. VideoFlow also produces excellent qualitative results, and avoids many of the common artifacts of models that use pixel-level mean-squared-error for training (e.g., blurry predictions), without the challenges associated with training adversarial models. Compared to models based on pixel-level autoregressive prediction, VideoFlow achieves substantially faster test-time image synthesis 1, making it much more practical for applications that require real-time prediction, such as robotic control (Finn & Levine, 2017). Finally, since VideoFlow directly optimizes the likelihood of training videos, without relying on a variational lower bound, we can evaluate its performance directly in terms of likelihood values.
18
+
19
+ # 2 RELATED WORK
20
+
21
+ Early work on prediction of future video frames focused on deterministic predictive models (Ranzato et al., 2014; Srivastava et al., 2015; Vondrick et al., 2015; Xingjian et al., 2015; Boots et al., 2014). Much of this research on deterministic models focused on architectural changes, such as predicting high-level structure (Villegas et al., 2017b), energy-based models (Xie et al., 2017), generative cooperative nets (Xie et al., 2020), ABPTT (Xie et al., 2019), incorporating pixel transformations (Finn et al., 2016; De Brabandere et al., 2016; Liu et al., 2017) and predictive coding architectures (Lotter et al., 2017), as well as different generation objectives (Mathieu et al., 2016; Vondrick & Torralba, 2017; Walker et al., 2015) and disentangling representations (Villegas et al., 2017a; Denton & Birodkar, 2017). With models that can successfully model many deterministic environments, the next key challenge is to address stochastic environments by building models that can effectively reason over uncertain futures. Real-world videos are always somewhat stochastic, either due to events that are inherently random, or events that are caused by unobserved or partially observable factors, such as off-screen events, humans and animals with unknown intentions, and objects with unknown physical properties. In such cases, since deterministic models can only generate one future, these models either disregard potential futures or produce blurry predictions that are the superposition or averages of possible futures.
22
+
23
+ A variety of methods have sought to overcome this challenge by incorporating stochasticity, via three types of approaches: models based on variational auto-encoders (VAEs) (Kingma & Welling, 2013; Rezende et al., 2014), generative adversarial networks (Goodfellow et al., 2014), and autoregressive models (Hochreiter & Schmidhuber, 1997; Graves, 2013; van den Oord et al., 2016b;c; Van Den Oord et al., 2016).
24
+
25
+ Among these models, techniques based on variational autoencoders which optimize an evidence lower bound on the log-likelihood have been explored most widely (Babaeizadeh et al., 2017; Denton & Fergus, 2018; Lee et al., 2018; Xue et al., 2016; Li et al., 2018). To our knowledge, the only prior class of video prediction models that directly maximize the log-likelihood of the data are autoregressive models (Hochreiter & Schmidhuber, 1997; Graves, 2013; van den Oord et al., 2016b;c; Van Den Oord et al., 2016), that generate the video one pixel at a time (Kalchbrenner et al., 2017). However, synthesis with such models is typically inherently sequential, making synthesis substantially inefficient on modern parallel hardware. Prior work has aimed to speed up training and synthesis with such auto-regressive models (Reed et al., 2017; Ramachandran et al., 2017). However, (Babaeizadeh et al., 2017) show that the predictions from these models are sharp but noisy and that the proposed VAE model produces substantially better predictions, especially for longer horizons. In contrast to autoregressive models, we find that our proposed method exhibits faster sampling, while still directly optimizing the log-likelihood and producing high-quality long-term predictions.
26
+
27
+ ![](images/0027199eb377c5633427a680c43a111c27c2795241099f59d443abe1ba5557b4.jpg)
28
+ Figure 1: Left: Multi-scale prior The flow model uses a multi-scale architecture using several levels of stochastic variables. Right: Autoregressive latent-dynamic prior The input at each timestep $\mathbf { x } _ { t }$ is encoded into multiple levels of stochastic variables $( \mathbf { z } _ { t } ^ { ( 1 ) } , \ldots , \mathbf { z } _ { t } ^ { ( L ) } )$ z(L)t ). We model those levels through a sequential process $\begin{array} { r } { \prod _ { t } \prod _ { l } p ( \mathbf { \hat { z } } _ { t } ^ { ( l ) } \mid \mathbf { z } _ { < t } ^ { ( l ) } , \mathbf { z } _ { t } ^ { ( > l ) } ) } \end{array}$ .
29
+
30
+ # 3 PRELIMINARIES: FLOW-BASED GENERATIVE MODELS
31
+
32
+ Flow-based generative models (Dinh et al., 2014; 2016) have a unique set of advantages: exact latentvariable inference, exact log-likelihood evaluation, and parallel sampling. In flow-based generative models (Dinh et al., 2014; 2016), we infer the latent variable $\mathbf { z }$ corresponding to a datapoint $\mathbf { x }$ , by transforming $\mathbf { x }$ through a composition of invertible functions $\mathbf { f } = \mathbf { f } _ { 1 } \circ \mathbf { f } _ { 2 } \circ \cdots \circ \mathbf { f } _ { K }$ . We assume a tractable prior $p _ { \pmb { \theta } } ( \mathbf { z } )$ over latent variable $\mathbf { z }$ , for eg. a Logistic or a Gaussian distribution. By constraining the transformations to be invertible, we can compute the log-likelihood of $\mathbf { x }$ exactly using the change of variables rule. Formally,
33
+
34
+ $$
35
+ \log p _ { \pmb \theta } ( \mathbf x ) = \log p _ { \pmb \theta } ( \mathbf z ) + \sum _ { i = 1 } ^ { K } \log | \operatorname* { d e t } ( d \mathbf h _ { i } / d \mathbf h _ { i - 1 } ) |
36
+ $$
37
+
38
+ where $\mathbf { h } _ { 0 } = \mathbf { x }$ , $\mathbf { h } _ { i } = \mathbf { f } _ { i } ( \mathbf { h } _ { i - 1 } )$ , $\mathbf { h } _ { K } = \mathbf { z }$ and $| \operatorname* { d e t } ( d \mathbf { h } _ { i } / d \mathbf { h } _ { i - 1 } |$ is the Jacobian determinant when $\mathbf { h } _ { i - 1 }$ is transformed to $\mathbf { h } _ { i }$ by $\mathbf { f } _ { i }$ . We learn the parameters of $\mathbf { f } _ { 1 } \ldots . \mathbf { f } _ { K }$ by maximizing the log-likelihood, i.e Equation (1), over a training set. Given $\mathbf { g } = \mathbf { f } ^ { - 1 }$ , we can now generate a sample $\hat { \bf x }$ from the data distribution, by sampling $\mathbf { z } \sim p _ { \pmb { \theta } } ( \mathbf { z } )$ and computing $\hat { \mathbf { x } } = \mathbf { g } ( \mathbf { z } )$ .
39
+
40
+ # 4 PROPOSED ARCHITECTURE
41
+
42
+ We propose a generative flow for video, using the standard multi-scale flow architecture in (Dinh et al., 2016; Kingma & Dhariwal, 2018) as a building block. In our model, we break up the latent space $\mathbf { z }$ into separate latent variables per timestep: $\mathbf { z } = \{ \mathbf { z } _ { t } \} _ { t = 1 } ^ { T }$ . The latent variable $\mathbf { z } _ { t }$ at timestep $t$ is an invertible transformation of a corresponding frame of video: $\mathbf { x } _ { t } = \mathbf { g } _ { \theta } ( \mathbf { z } _ { t } )$ . Furthermore, like in (Dinh et al., 2016; Kingma & Dhariwal, 2018), we use a multi-scale architecture for ${ \bf g } _ { \pmb { \theta } } ( { \bf z } _ { t } )$ (Fig. 1): the latent variable $\mathbf { z } _ { t }$ is composed of a stack of multiple levels: where each level $l$ encodes information about frame $\mathbf { x } _ { t }$ at a particular scale: $\mathbf { z } _ { t } = \{ \mathbf { z } _ { t } ^ { ( l ) } \} _ { l = 1 } ^ { \bar { L } }$ , one component $\mathbf { z } _ { t } ^ { ( l ) }$ per level.
43
+
44
+ We first briefly describe the invertible transformations used in the multi-scale architecture to infer $\{ \mathbf { z } _ { t } ^ { ( l ) } \} _ { l = 1 } ^ { L } = \mathbf { f } _ { \pmb { \theta } } ( \mathbf { x } _ { t } )$ and refer to (Dinh et al., 2016; Kingma & Dhariwal, 2018) for more details. For convenience, we omit the subscript $t$ in this subsection. We choose invertible transformations whose Jacobian determinant in Equation 1 is simple to compute, that is a triangular matrix, diagonal matrix or a permutation matrix as explored in prior work (Rezende & Mohamed, 2015; Deco & Brauer, 1995). For permutation matrices, the Jacobian determinant is one and for triangular and diagonal Jacobian matrices, the determinant is simply the product of diagonal terms.
45
+
46
+ • Actnorm: We apply a learnable per-channel scale and shift with data-dependent initialization.
47
+ • Coupling: We split the input $y$ equally across channels to obtain $y _ { 1 }$ and $y _ { 2 }$ . We compute $z _ { 2 } = f ( y _ { 1 } ) * y _ { 2 } + g ( y _ { 1 } )$ where $f$ and $g$ are deep networks. We concat $y _ { 1 }$ and $z _ { 2 }$ across channels.
48
+ • SoftPermute: We apply a 1x1 convolution that preserves the number of channels.
49
+ • Squeeze: We reshape the input from $H \times W \times C$ to $H / 2 \times W / 2 \times 4 C$ which allows the flow to operate on a larger receptive field.
50
+
51
+ We infer the latent variable $z ^ { ( l ) }$ at level $l$ using:
52
+
53
+ $$
54
+ \begin{array} { r l } & { \operatorname { F l o w } ( y ) = \operatorname { C o u p l i n g } ( \operatorname { S o f t P e r m u t e } ( \operatorname { A c t n o r m } ( y ) ) ) ) \times N } \\ & { \operatorname { F l o w } _ { \mathrm { 1 } } ( y ) = \operatorname { S p l i t } ( \operatorname { F l o w } ( \operatorname { S q u e e z e } ( y ) ) ) } \\ & { ( \mathbf { h } ^ { ( > l ) } , \mathbf { z } ^ { l } ) \operatorname { F l o w } _ { \mathrm { 1 } } ( \mathbf { h } ^ { ( > l - 1 ) } ) } \end{array}
55
+ $$
56
+
57
+ where $N$ is the number of steps of flow. In Equation (3), via Split, we split the output of Flow equally across channels into $\mathbf { h } ^ { ( > l ) }$ , the input to $\mathrm { F l o w } _ { ( \mathrm { l + 1 } ) } ( . )$ and $z ^ { ( l ) }$ , the latent variable at level $l$ . We, thus enable the flows at higher levels to operate on a lower number of dimensions and larger scales. When $l = 1$ , $\mathbf { h } ^ { ( > l - 1 ) }$ is just the input frame $x$ and for $l = L$ we omit the Split operation. Finally, our multi-scale architecture $\mathbf { f } _ { \pmb { \theta } } ( \mathbf { x } _ { t } )$ is a composition of the flows at multiple levels from $l = 1 \ldots L$ from which we obtain our latent variables i.e $\{ \mathbf { z } _ { t } ^ { ( l ) } \} _ { l = 1 } ^ { L }$ .
58
+
59
+ # 4.2 AUTOREGRESSIVE LATENT DYNAMICS MODEL
60
+
61
+ We use the multi-scale architecture described above to infer the set of corresponding latent variables for each individual frame of the video: $\{ \mathbf { z } _ { t } ^ { ( l ) } \} _ { l = 1 } ^ { L } = \mathbf { f } _ { \pmb { \theta } } ( \mathbf { x } _ { t } )$ ; see Figure 1 for an illustration. As in Equation (1), we need to choose a form of latent prior $p _ { \pmb { \theta } } ( \mathbf { z } )$ . We use the following autoregressive factorization for the latent prior:
62
+
63
+ $$
64
+ p _ { \pmb { \theta } } ( \mathbf { z } ) = \prod _ { t = 1 } ^ { T } p _ { \pmb { \theta } } ( \mathbf { z } _ { t } | \mathbf { z } _ { < t } )
65
+ $$
66
+
67
+ where $\mathbf { z } _ { < t }$ denotes the latent variables of frames prior to the $t$ -th timestep: $\left\{ \mathbf { z } _ { 1 } , . . . , \mathbf { z } _ { t - 1 } \right\}$ . We specify the conditional prior $p _ { \pmb { \theta } } ( \mathbf { z } _ { t } | \mathbf { z } _ { < t } )$ as having the following factorization:
68
+
69
+ $$
70
+ p _ { \pmb { \theta } } \big ( \mathbf { z } _ { t } \big | \mathbf { z } _ { < t } \big ) = \prod _ { l = 1 } ^ { L } p _ { \pmb { \theta } } \big ( \mathbf { z } _ { t } ^ { ( l ) } \big | \mathbf { z } _ { < t } ^ { ( l ) } , \mathbf { z } _ { t } ^ { ( > l ) } \big )
71
+ $$
72
+
73
+ where z(l)<t is the set of latent variables at previous timesteps and at the same level $l$ , while $\mathbf { z } _ { t } ^ { ( > l ) }$ is the set of latent variables at the same timestep and at higher levels. See Figure 1 for a graphical illustration of the dependencies.
74
+
75
+ We let each $p _ { \pmb { \theta } } ( \mathbf { z } _ { t } ^ { ( l ) } | \mathbf { z } _ { < t } ^ { ( l ) } , \mathbf { z } _ { t } ^ { ( > l ) } )$ be a conditionally factorized Gaussian density:
76
+
77
+ $$
78
+ \begin{array} { r l } & { p _ { \pmb { \theta } } ( \mathbf { z } _ { t } ^ { ( l ) } | \mathbf { z } _ { < t } ^ { ( l ) } , \mathbf { z } _ { t } ^ { ( > l ) } ) = \mathcal { N } ( \mathbf { z } _ { t } ^ { ( l ) } ; \pmb { \mu } , \sigma ) } \\ & { \quad \mathrm { w h e r e } \ ( \pmb { \mu } , \log \sigma ) = N N _ { \pmb { \theta } } ( \mathbf { z } _ { < t } ^ { ( l ) } , \mathbf { z } _ { t } ^ { ( > l ) } ) } \end{array}
79
+ $$
80
+
81
+ Table 1: We compare the realism of the generated trajectories using a real-vs-fake 2AFC Amazon Mechanical Turk with SAVP-VAE and SV2P.
82
+
83
+ <table><tr><td>Model</td><td>Fooling rate</td></tr><tr><td>SAVP-VAE</td><td>16.4 %</td></tr><tr><td>VideoFlow</td><td>31.8 %</td></tr><tr><td>SV2P</td><td>17.5 %</td></tr></table>
84
+
85
+ ![](images/d35db32dbe0a36e17916e99e637ed2949deae79ea445ab96809982139e8eebab.jpg)
86
+ Figure 2: We condition the VideoFlow model with the frame at $\mathrm { \Delta t } = 1$ and display generated trajectories at $\mathbf { t } = 2$ and $\mathrm { t } = 3$ for three different shapes.
87
+
88
+ where $N N _ { \theta } ( . )$ is a deep 3-D residual network (He et al., 2015) augmented with dilations and gated activation units and modified to predict the mean and log-scale. We describe the architecture and our ablations of the architecture in Section D and E of the appendix.
89
+
90
+ In summary, the log-likelhood objective of Equation (1) has two parts. The invertible multi-scale architecture contributes $\begin{array} { r l } { ~ } & { { } \sum _ { i = 1 } ^ { K } \log | \operatorname* { d e t } ( d \mathbf { h } _ { i } / d \mathbf { h } _ { i - 1 } ) | } \end{array}$ via the sum of the log Jacobian determinants of the invertible transformations mapping the video $\{ { \bf x } _ { t } \} _ { t = 1 } ^ { T }$ to $\{ \mathbf { z } _ { t } \} _ { t = 1 } ^ { T }$ ; the latent dynamics model contributes $\log p \pmb { \theta } ( \mathbf { z } )$ , i.e Equation (5). We jointly learn the parameters of the multi-scale architecture and latent dynamics model by maximizing this objective.
91
+
92
+ Note that in our architecture we have chosen to let the prior $p _ { \pmb { \theta } } ( \mathbf { z } )$ , as described in eq. (5), model temporal dependencies in the data, while constraining the flow $\mathbf { g } _ { \theta }$ to act on separate frames of video. We have experimented with using 3-D convolutional flows, but found this to be computationally overly expensive compared to an autoregressive prior; in terms of both number of operations and number of parameters. Further, due to memory limits, we found it only feasible to perform SGD with a small number of sequential frames per gradient step. In case of 3-D convolutions, this would make the temporal dimension considerably smaller during training than during synthesis; this would change the model’s input distribution between training and synthesis, which often leads to various temporal artifacts. Using 2-D convolutions in our flow $\mathbf { f } _ { \theta }$ with autoregressive priors, allows us to synthesize arbitrarily long sequences without introducing such artifacts.
93
+
94
+ # 5 EXPERIMENTS
95
+
96
+ All our generated videos and qualitative results can be viewed at this website. In the generated videos, a border of blue represents the conditioning frame, while a border of red represents the generated frames.
97
+
98
+ # 5.1 VIDEO MODELLING WITH THE STOCHASTIC MOVEMENT DATASET
99
+
100
+ We use VideoFlow to model the Stochastic Movement Dataset used in (Babaeizadeh et al., 2017). The first frame of every video consists of a shape placed near the center of a 64x64x3 resolution gray background with its type, size and color randomly sampled. The shape then randomly moves in one of eight directions with constant speed. (Babaeizadeh et al., 2017) show that conditioned on the first frame, a deterministic model averages out all eight possible directions in pixel space. Since the shape moves with a uniform speed, we should be able to model the position of the shape at the $( t + 1 ) ^ { t h }$ step using only the position of the shape at the $t ^ { t h }$ step. Using this insight, we extract random temporal patches of 2 frames from each video of 3 frames. We then use VideoFlow to maximize the loglikelihood of the second frame given the first, i.e the model looks back at just one frame. We observe that the bits-per-pixel on the holdout set reduces to a very low 0.04 bits-per-pixel for this model. On generating videos conditioned on the first frame, we observe that the model consistently predicts the future trajectory of the shape to be one of the eight random directions. We compare our model with two state-of-the-art stochastic video generation models SV2P and SAVP-VAE (Babaeizadeh et al., 2017; Lee et al., 2018) using their Tensor2Tensor implementation (Vaswani et al., 2018). We assess the quality of the generated videos using a real vs fake Amazon Mechanical Turk test. In the test, we inform the rater that a "real" trajectory is one in which the shape is consistent in color and congruent throughout the video. We show that VideoFlow outperforms the baselines in terms of fooling rate in Table 1 consistently generating plausible "real" trajectories at a greater rate.
101
+
102
+ Table 2: Left: We report the average bits-per-pixel across 10 target frames with 3 conditioning frames for the BAIR action-free dataset.
103
+
104
+ <table><tr><td>Model</td><td>Bits-per-pixel</td></tr><tr><td>VideoFlow</td><td>1.87</td></tr><tr><td>SAVP-VAE</td><td>≤6.73</td></tr><tr><td>SV2P</td><td>≤6.78</td></tr></table>
105
+
106
+ ![](images/4f86fdecfe5c88f19ab3804eaa6bdd874d0e3a55b517fd8a901450bd247a62a3.jpg)
107
+ Figure 3: We measure realism using a 2AFC test and diversity using mean pairwise cosine distance between generated samples in VGG perceptual space.
108
+
109
+ # 5.2 VIDEO MODELING WITH THE BAIR DATASET
110
+
111
+ We use the action-free version of the BAIR robot pushing dataset (Ebert et al., 2017) that contain videos of a Sawyer robotic arm with resolution 64x64. In the absence of actions, the task of video generation is completely unsupervised with multiple plausible trajectories due to the partial observability of the environment and stochasticity of the robot actions. We train the baseline models, SAVP-VAE, SV2P and SVG-LP to generate 10 target frames, conditioned on 3 input frames. We extract random temporal patches of 4 frames, and train VideoFlow to maximize the log-likelihood of the 4th frame given a context of 3 past frames. We, thus ensure that all models have seen a total of 13 frames during training.
112
+
113
+ Bits-per-pixel: We estimated the variational bound of the bits-per-pixel on the test set, via importance sampling, from the posteriors for the SAVP-VAE and SV2P models. We find that VideoFlow outperforms these models on bits-per-pixel and report these values in Table 2. We attribute the high values of bits-per-pixel of the baselines to their optimization objective. They do not optimize the variational bound on the log-likelihood directly due to the presence of a $\beta \neq 1$ term in their objective and scheduled sampling (Bengio et al., 2015).
114
+
115
+ ![](images/a683d1e7f1ae30c014fcb1618147921f56b5ab1a13ce574e5e1b417cbbc090af.jpg)
116
+ Figure 4: For a given set of conditioning frames on the BAIR action-free we sample 100 videos from each of the stochastic video generation models. We choose the video closest to the ground-truth on the basis of PSNR, SSIM and VGG perceptual metrics and report the best possible value for each of these metrics. All the models were trained using ten target frames but are tested to generate 27 frames. For all the reported metrics, higher is better.
117
+
118
+ Accuracy of the best sample: The BAIR robot-pushing dataset is highly stochastic and the number of plausible futures are high. Each generated video can be super realistic, can represent a plausible future in theory but can be far from the single ground truth video perceptually. To partially overcome this, we follow the metrics proposed in prior work (Babaeizadeh et al., 2017; Lee et al., 2018; Denton & Fergus, 2018) to evaluate our model. For a given set of conditioning frames in the BAIR action-free test-set, we generate 100 videos from each of the stochastic models. We then compute the closest of these generated videos to the ground truth according to three different metrics, PSNR (Peak Signal to
119
+
120
+ Noise Ratio), SSIM (Structural Similarity) (Wang et al., 2004) and cosine similarity using features obtained from a pretrained VGG network (Dosovitskiy & Brox, 2016; Johnson et al., 2016) and report our findings in Figure 4. This metric helps us understand if the true future lies in the set of all plausible futures according to the video model.
121
+
122
+ In prior work, (Lee et al., 2018; Babaeizadeh et al., 2017; Denton & Fergus, 2018) effectively tune the pixel-level variance as a hyperparameter and sample from a deterministic decoder. They obtain training stabiltiy and improve sample quality by removing pixel-level noise using this procedure. We can remove pixel-level noise in our VideoFlow model resulting in higher quality videos at the cost of diversity by sampling videos at a lower temperature, analogous to the procedure in (Kingma & Dhariwal, 2018). For a network trained with additive coupling layers, we can sample the $t ^ { t h }$ frame $x _ { t }$ from $P ( x _ { t } | x _ { < t } )$ with a temperature $T$ simply by scaling the standard deviation of the latent gaussian distribution $P ( \boldsymbol { z } _ { t } | \boldsymbol { z } _ { < t } )$ by a factor of $T$ . We report results with both a temperature of 1.0 and the optimal temperature tuned on the validation set using VGG similarity metrics in Figure 4. Additionally, we also applied low-temperature sampling to the latent gaussian priors of SV2P and SAVP-VAE and empirically found it to hurt performance. We report these results in Figure 12
123
+
124
+ For SAVP-VAE, we notice that the hyperparameters that perform the best on these metrics are the ones that have disappearing arms. For completeness, we report these numbers as well as the numbers for the best performing SAVP models that do not have disappearing arms. Our model with optimal temperature performs better or as well as the SAVP-VAE and SVG-LP models on the VGG-based similarity metrics, which correlate well with human perception (Zhang et al., 2018) and SSIM. Our model with temperature $T = 1 . 0$ is also competent with state-of-the-art video generation models on these metrics. PSNR is explicitly a pixel-level metric, which the VAE models incorporate as part of its optimization objective. VideoFlow on the other-hand models the conditional probability of the joint distribution of frames, hence as expected it underperforms on PSNR.
125
+
126
+ ![](images/7c96ecf49f00cd8a40874e3709c9498b9fc8b9cdb24e6e3baa904512d2a276bb.jpg)
127
+ Figure 5: We display three different futures for two sets of conditioning frames (left and right) at $T = 0 . 6$ showcasing diversity in outcomes
128
+
129
+ Diversity and quality in generated samples: For each set of conditioning frames in the test set, we generate 10 videos and compute the mean distance in VGG perceptual space across these 45 different pairs. We average this across the test-set for $T = 1 . 0$ and $T = 0 . 6$ and report these numbers in Figure 3. We also assess the quality of the generated videos at $T = 1 . 0$ and $T = 0 . 6$ , using a real vs fake Amazon Mechanical Turk test and report fooling rates. We observe that VideoFlow outperforms diversity values reported in prior work (Lee et al., 2018) while being competitive in the realism axis. We also find that VideoFlow at $T = 0 . 6$ has the highest fooling rate while being competent with state-of-the-art VAE models in diversity.
130
+
131
+ On inspection of the generated videos, we find that at lower temperatures, the arm exhibits less random behaviour with the background objects remaining static and clear achieving higher realism scores. At higher temperatures, the motion of arm is much more stochastic, achieving high diversity scores with the background objects becoming much noisier leading to a drop in realism.
132
+
133
+ Fréchet Video Distance (FVD): We evaluate VideoFlow using the recently proposed Fréchet Video Distance (FVD) metric (Unterthiner et al., 2018), an adaptation of the Fréchet Inception Distance (FID) metric (Heusel et al., 2017) for video generation. (Unterthiner et al., 2018) report results with models trained on a total of 16 frames with 2 conditioning frames; while we train our VideoFlow model on a total of 13 frames with 3 conditioning frames, making our results not directly comparable to theirs. We evaluate FVD for both shorter and longer rollouts in Table 3. We show that, even in the settings that are disadvantageous to VideoFlow, where we compute the FVD on a total of 16 frames, when trained on just 13 frames, VideoFlow performs comparable to SAVP.
134
+
135
+ <table><tr><td colspan="5"># Frames Seen: Training</td></tr><tr><td>Conditioning</td><td>3</td><td>3</td><td>3</td><td>2</td></tr><tr><td>Total</td><td>13</td><td>13</td><td>13</td><td>16</td></tr><tr><td></td><td colspan="3"># Frames: Evaluation</td><td></td></tr><tr><td>Ground truth</td><td>3</td><td>3</td><td>2</td><td></td></tr><tr><td>Total</td><td>13</td><td>16</td><td>16</td><td>26</td></tr><tr><td>Model</td><td colspan="3">FVD</td><td></td></tr><tr><td>VideoFlow (T=0.8)</td><td>95±4</td><td>127±3</td><td>131±5</td><td>-</td></tr><tr><td>VideoFlow (T=1.0)</td><td>149±6</td><td>221±8</td><td>251±7</td><td>1</td></tr><tr><td>SAVP</td><td>-</td><td>-</td><td>-</td><td>116</td></tr><tr><td>SV2P</td><td>=</td><td>-</td><td>-</td><td>263</td></tr></table>
136
+
137
+ # 5.3 LATENT SPACE INTERPOLATION
138
+
139
+ BAIR robot pushing dataset: We encode the first input frame and the last target frame into the latent space using our trained VideoFlow encoder and perform interpolations. We find that the motion of the arm is interpolated in a temporally cohesive fashion between the initial and final position. Further, we use the multi-level latent representation to interpolate representations at a particular level while keeping the representations at other levels fixed. We find that the bottom level interpolates the motion of background objects which are at a smaller scale while the top level interpolates the arm motion.
140
+
141
+ ![](images/aad55d52750b1b98a590db5a07d4d80b527972bc5a8c27149305eeda1edf2561.jpg)
142
+ Table 3: Fréchet Video Distance:. We report the mean and standard deviation across 5 runs for 3 different frame settings. Results are not directly comparable across models due to the differences between the total number of frames seen during training and the number of conditioning frames.
143
+ Figure 6: Left: We display interpolations between a) a small blue rectangle and a large yellow rectangle b) a small blue circle and a large yellow circle. Right: We display interpolations between the first input frame and the last target frame of two test videos in the BAIR robot pushing dataset.
144
+
145
+ Stochastic Movement Dataset: We encode two different shapes with their type fixed but a different size and color into the latent space. We observe that the size of the shape gets smoothly interpolated. During training, we sample the colors of the shapes from a uniform discrete distribution which is reflected in our experiments. We observe that all the colors in the interpolated space lie in the set of colors in the training set.
146
+
147
+ # 5.4 LONGER PREDICTIONS
148
+
149
+ We generate 100 frames into the future using our model trained on 13 frames with a temperature of 0.5 and display our results in Figure 7. On the top, even 100 frames into the future, the generated frames remain in the image manifold maintaining temporal consistency. In the presence of occlusions, the arm remains super-sharp but the background objects become noisier and blurrier. Our VideoFlow model has a bijection between the $\mathbf { z } _ { t }$ and $\mathbf { x } _ { t }$ meaning that the latent state $\mathbf { z } _ { t }$ cannot store information other than that present in the frame $\mathbf { x } _ { t }$ . This, in combination with the Markovian assumption in our latent dynamics means that the model can forget objects if they have been occluded for a few frames. In future work, we would address this by incorporating longer memory in our VideoFlow model; for example by parameterizing $N N _ { \theta } ( )$ as a recurrent neural network in our autoregressive prior (eq. 8) or using more memory-efficient backpropagation algorithms for invertible neural networks (Gomez et al., 2017).
150
+
151
+ ![](images/e59075b14cf3cea96145e3da800c6534f60d2202a1632b5473557eea428a6d49.jpg)
152
+ Figure 7: Left: We generate 100 frames into the future with a temperature of 0.5. The top and bottom row correspond to generated videos in the absence and presence of occlusions respectively. Right: We use VideoFlow to detect the plausibility of a temporally inconsistent frame to occur in the immediate future.
153
+
154
+ # 5.5 OUT-OF-SEQUENCE DETECTION
155
+
156
+ We use our trained VideoFlow model, conditioned on 3 frames as explained in Section 5.2, to detect the plausibility of a temporally inconsistent frame to occur in the immediate future. We condition the model on the first three frames of a test-set video $X _ { < 4 }$ to obtain a distribution $P ( X _ { 4 } | X _ { < 4 } )$ over its 4th frame $X _ { 4 }$ . We then compute the likelihood of the $t ^ { \mathrm { t h } }$ frame $X _ { t }$ of the same video to occur as the 4th time-step using this distribution. i.e, $\mathcal { P } ( X _ { 4 } = X _ { t } \vert X _ { < 4 } )$ for $t = 4 \dots 1 3$ . We average the corresponding bits-per-pixel values across the test set and report our findings in Figure 7. We find that our model assigns a monotonically decreasing log-likelihood to frames that are more far out in the future and hence less likely to occur in the 4th time-step.
157
+
158
+ # 6 OPEN SOURCE CODE AND CHECKPOINTS
159
+
160
+ We open-source the implementation of our code in the Tensor2Tensor codebase. We additionally open-source various components of our trained VideoFlow model, to evaluate log-likelihood, to generate frames and compute latent codes as reusable TFHub modules
161
+
162
+ # 7 CONCLUSION AND DISCUSSION
163
+
164
+ We describe a practically applicable architecture for flow-based video prediction models, inspired by the Glow model for image generation Kingma & Dhariwal (2018), which we call VideoFlow. We introduce a latent dynamical system model that predicts future values of the flow model’s latent state replacing the standard unconditional prior distribution. Our empirical results show that VideoFlow achieves results that are competitive with the state-of-the-art VAE models in stochastic video prediction. Finally, our model optimizes log-likelihood directly making it easy to evaluate while achieving faster synthesis compared to pixel-level autoregressive video models, making our model suitable for practical purposes. In future work, we plan to incorporate memory in VideoFlow to model arbitrary long-range dependencies and apply the model to challenging downstream tasks.
165
+
166
+ # ACKNOWLEDGEMENTS
167
+
168
+ We would like to thank Ryan Sepassi and Lukasz Kaiser for their extensive help in using Tensor2Tensor, Oscar Täckström for finding a bug in our evaluation pipeline that improved results across all models, Ruben Villegas for providing code for the SVG-LP baseline and Mostafa Dehghani for providing feedback on a draft of the rebuttal.
169
+
170
+ # REFERENCES
171
+
172
+ Mohammad Babaeizadeh, Chelsea Finn, Dumitru Erhan, Roy H Campbell, and Sergey Levine. Stochastic variational video prediction. arXiv preprint arXiv:1710.11252, 2017.
173
+
174
+ Samy Bengio, Oriol Vinyals, Navdeep Jaitly, and Noam Shazeer. Scheduled sampling for sequence prediction with recurrent neural networks. In Advances in Neural Information Processing Systems, pp. 1171–1179, 2015.
175
+
176
+ Byron Boots, Arunkumar Byravan, and Dieter Fox. Learning predictive models of a depth camera & manipulator from raw execution traces. In International Conference on Robotics and Automation (ICRA), 2014.
177
+
178
+ Bert De Brabandere, Xu Jia, Tinne Tuytelaars, and Luc Van Gool. Dynamic filter networks. In Neural Information Processing Systems (NIPS), 2016.
179
+
180
+ Gustavo Deco and Wilfried Brauer. Higher order statistical decorrelation without information loss. Advances in Neural Information Processing Systems, pp. 247–254, 1995.
181
+
182
+ Emily Denton and Vighnesh Birodkar. Unsupervised learning of disentangled representations from video. arXiv preprint arXiv:1705.10915, 2017.
183
+
184
+ Emily Denton and Rob Fergus. Stochastic video generation with a learned prior. arXiv preprint arXiv:1802.07687, 2018.
185
+
186
+ Laurent Dinh, David Krueger, and Yoshua Bengio. Nice: non-linear independent components estimation. arXiv preprint arXiv:1410.8516, 2014.
187
+
188
+ Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using Real NVP. arXiv preprint arXiv:1605.08803, 2016.
189
+
190
+ Alexey Dosovitskiy and Thomas Brox. Generating images with perceptual similarity metrics based on deep networks. In Advances in Neural Information Processing Systems, pp. 658–666, 2016.
191
+
192
+ Frederik Ebert, Chelsea Finn, Alex X Lee, and Sergey Levine. Self-supervised visual planning with temporal skip connections. arXiv preprint arXiv:1710.05268, 2017.
193
+
194
+ Chelsea Finn and Sergey Levine. Deep visual foresight for planning robot motion. In International Conference on Robotics and Automation (ICRA), 2017.
195
+
196
+ Chelsea Finn, Ian Goodfellow, and Sergey Levine. Unsupervised learning for physical interaction through video prediction. In Advances in Neural Information Processing Systems, 2016.
197
+
198
+ Aidan N Gomez, Mengye Ren, Raquel Urtasun, and Roger B Grosse. The reversible residual network: Backpropagation without storing activations. In Advances in Neural Information Processing Systems, pp. 2211–2221, 2017.
199
+
200
+ Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in Neural Information Processing Systems, pp. 2672–2680, 2014.
201
+
202
+ Alex Graves. Generating sequences with recurrent neural networks. arXiv preprint arXiv:1308.0850, 2013.
203
+
204
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. arXiv preprint arXiv:1512.03385, 2015.
205
+
206
+ Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. In Advances in neural information processing systems, pp. 6626–6637, 2017.
207
+
208
+ Sepp Hochreiter and Jürgen Schmidhuber. Long Short-Term Memory. Neural computation, 9(8): 1735–1780, 1997.
209
+
210
+ Catalin Ionescu, Dragos Papava, Vlad Olaru, and Cristian Sminchisescu. Human3. 6m: Large scale datasets and predictive methods for 3d human sensing in natural environments. IEEE transactions on pattern analysis and machine intelligence, 36(7):1325–1339, 2014.
211
+
212
+ Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In European Conference on Computer Vision, pp. 694–711. Springer, 2016.
213
+
214
+ Nal Kalchbrenner, Aäron van den Oord, Karen Simonyan, Ivo Danihelka, Oriol Vinyals, Alex Graves, and Koray Kavukcuoglu. Video pixel networks. International Conference on Machine Learning (ICML), 2017.
215
+
216
+ Diederik P Kingma and Max Welling. Auto-encoding variational Bayes. Proceedings of the 2nd International Conference on Learning Representations, 2013.
217
+
218
+ Durk P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In Advances in Neural Information Processing Systems, pp. 10236–10245, 2018.
219
+
220
+ Alex Krizhevsky, Ilya Sutskever, and Geoff Hinton. Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems 25, pp. 1106–1114, 2012.
221
+
222
+ Alex X Lee, Richard Zhang, Frederik Ebert, Pieter Abbeel, Chelsea Finn, and Sergey Levine. Stochastic adversarial video prediction. arXiv preprint arXiv:1804.01523, 2018.
223
+
224
+ Yijun Li, Chen Fang, Jimei Yang, Zhaowen Wang, Xin Lu, and Ming-Hsuan Yang. Flow-grounded spatial-temporal video prediction from still images. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 600–615, 2018.
225
+
226
+ Ziwei Liu, Raymond Yeh, Xiaoou Tang, Yiming Liu, and Aseem Agarwala. Video frame synthesis using deep voxel flow. International Conference on Computer Vision (ICCV), 2017.
227
+
228
+ William Lotter, Gabriel Kreiman, and David Cox. Deep predictive coding networks for video prediction and unsupervised learning. International Conference on Learning Representations (ICLR), 2017.
229
+
230
+ Michael Mathieu, Camille Couprie, and Yann LeCun. Deep multi-scale video prediction beyond mean square error. International Conference on Learning Representations (ICLR), 2016.
231
+
232
+ Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin Riedmiller. Playing Atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, 2013.
233
+
234
+ Ryan Prenger, Rafael Valle, and Bryan Catanzaro. Waveglow: A flow-based generative network for speech synthesis. CoRR, abs/1811.00002, 2018. URL http://arxiv.org/abs/1811. 00002.
235
+
236
+ Prajit Ramachandran, Tom Le Paine, Pooya Khorrami, Mohammad Babaeizadeh, Shiyu Chang, Yang Zhang, Mark A Hasegawa-Johnson, Roy H Campbell, and Thomas S Huang. Fast generation for convolutional autoregressive models. arXiv preprint arXiv:1704.06001, 2017.
237
+
238
+ MarcAurelio Ranzato, Arthur Szlam, Joan Bruna, Michael Mathieu, Ronan Collobert, and Sumit Chopra. Video (language) modeling: a baseline for generative models of natural videos. arXiv preprint arXiv:1412.6604, 2014.
239
+
240
+ Scott Reed, Aäron van den Oord, Nal Kalchbrenner, Sergio Gómez Colmenarejo, Ziyu Wang, Dan Belov, and Nando de Freitas. Parallel multiscale autoregressive density estimation. arXiv preprint arXiv:1703.03664, 2017.
241
+
242
+ Danilo Rezende and Shakir Mohamed. Variational inference with normalizing flows. In Proceedings of The 32nd International Conference on Machine Learning, pp. 1530–1538, 2015.
243
+
244
+ Danilo J Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In Proceedings of the 31st International Conference on Machine Learning (ICML-14), pp. 1278–1286, 2014.
245
+
246
+ David Silver, Julian Schrittwieser, Karen Simonyan, Ioannis Antonoglou, Aja Huang, Arthur Guez, Thomas Hubert, Lucas Baker, Matthew Lai, Adrian Bolton, et al. Mastering the game of go without human knowledge. Nature, 550(7676):354, 2017.
247
+
248
+ Nitish Srivastava, Elman Mansimov, and Ruslan Salakhudinov. Unsupervised learning of video representations using lstms. In International Conference on Machine Learning, 2015.
249
+
250
+ Thomas Unterthiner, Sjoerd van Steenkiste, Karol Kurach, Raphael Marinier, Marcin Michalski, and Sylvain Gelly. Towards accurate generative models of video: A new metric & challenges, 2018.
251
+
252
+ 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.
253
+
254
+ Aaron van den Oord, Nal Kalchbrenner, Lasse Espeholt, Oriol Vinyals, Alex Graves, et al. Conditional image generation with PixelCNN decoders. In Advances in Neural Information Processing Systems, pp. 4790–4798, 2016a.
255
+
256
+ Aaron van den Oord, Nal Kalchbrenner, and Koray Kavukcuoglu. Pixel recurrent neural networks. arXiv preprint arXiv:1601.06759, 2016b.
257
+
258
+ Aaron van den Oord, Nal Kalchbrenner, Oriol Vinyals, Lasse Espeholt, Alex Graves, and Koray Kavukcuoglu. Conditional image generation with PixelCNN decoders. arXiv preprint arXiv:1606.05328, 2016c.
259
+
260
+ Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, pp. 5998–6008, 2017.
261
+
262
+ Ashish Vaswani, Samy Bengio, Eugene Brevdo, Francois Chollet, Aidan N Gomez, Stephan Gouws, Llion Jones, Łukasz Kaiser, Nal Kalchbrenner, Niki Parmar, et al. Tensor2tensor for neural machine translation. arXiv preprint arXiv:1803.07416, 2018.
263
+
264
+ Ruben Villegas, Jimei Yang, Seunghoon Hong, Xunyu Lin, and Honglak Lee. Decomposing motion and content for natural video sequence prediction. arXiv preprint arXiv:1706.08033, 2017a.
265
+
266
+ Ruben Villegas, Jimei Yang, Yuliang Zou, Sungryull Sohn, Xunyu Lin, and Honglak Lee. Learning to generate long-term future via hierarchical prediction. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 3560–3569. JMLR. org, 2017b.
267
+
268
+ Carl Vondrick and Antonio Torralba. Generating the future with adversarial transformers. In Computer Vision and Pattern Recognition (CVPR), 2017.
269
+
270
+ Carl Vondrick, Hamed Pirsiavash, and Antonio Torralba. Anticipating the future by watching unlabeled video. arXiv preprint arXiv:1504.08023, 2015.
271
+
272
+ Jacob Walker, Abhinav Gupta, and Martial Hebert. Dense optical flow prediction from a static image. In International Conference on Computer Vision (ICCV), 2015.
273
+
274
+ Zhou Wang, Alan C Bovik, Hamid R Sheikh, and Eero P Simoncelli. Image quality assessment: from error visibility to structural similarity. IEEE transactions on image processing, 2004.
275
+
276
+ Jianwen Xie, Song-Chun Zhu, and Ying Nian Wu. Synthesizing dynamic patterns by spatial-temporal generative convnet. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017.
277
+
278
+ Jianwen Xie, Ruiqi Gao, Zilong Zheng, Song-Chun Zhu, and Ying Nian Wu. Learning dynamic generator model by alternating back-propagation through time. Proceedings of the AAAI Conference on Artificial Intelligence, 33:5498–5507, Jul 2019. ISSN 2159-5399. doi: 10.1609/aaai.v33i01. 33015498. URL http://dx.doi.org/10.1609/aaai.v33i01.33015498.
279
+
280
+ Jianwen Xie, Yang Lu, Ruiqi Gao, Song-Chun Zhu, and Ying Nian Wu. Cooperative training of descriptor and generator networks. IEEE Transactions on Pattern Analysis and Machine Intelligence, 42(1):27–45, Jan 2020. ISSN 1939-3539. doi: 10.1109/tpami.2018.2879081. URL http://dx.doi.org/10.1109/TPAMI.2018.2879081.
281
+
282
+ SHI Xingjian, Zhourong Chen, Hao Wang, Dit-Yan Yeung, Wai-Kin Wong, and Wang-chun Woo. Convolutional lstm network: A machine learning approach for precipitation nowcasting. In Advances in Neural Information Processing Systems, 2015.
283
+
284
+ Tianfan Xue, Jiajun Wu, Katherine Bouman, and Bill Freeman. Visual dynamics: Probabilistic future frame synthesis via cross convolutional networks. In Advances in Neural Information Processing Systems, 2016.
285
+
286
+ Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. arXiv preprint, 2018.
287
+
288
+ # A MOVING MNIST - QUALITATIVE EXPERIMENTS
289
+
290
+ ![](images/1ae26f8204c28db75dd59209d1dcc0d6dd90682a57d18be970e0ad56f9a81cbb.jpg)
291
+ Figure 8: We display ten frame rollouts conditioned on a single frame on the Moving MNIST dataset.
292
+
293
+ Similar to the Stochastic Movement Dataset as described in Section 5.1, we extract random temporal patches of 2 frames on the Moving MNIST dataset (Srivastava et al., 2015). We train our VideoFlow model to maximize the log-likelihood of the second frame, given the first. Our rollouts over 10 frames capture realistic digit movement.
294
+
295
+ # B HUMAN3.6M - QUALITATIVE EXPERIMENTS
296
+
297
+ We model the Human3.6M dataset (Ionescu et al., 2014), by maximizing the log-likelihood of the 4th frame given the first three frames, in a random temporal patch of 4 frames. We observe that on this dataset, our model fails to capture reasonable human motion. We hope that by increasing model capacity and using more expressive priors, we can acheive better performance on this dataset in the future.
298
+
299
+ # C DISCRETIZATION AND UNIFORM QUANTIZATION
300
+
301
+ Let $\mathcal { D } = \{ \mathbf { x } ^ { ( i ) } \} _ { i = 1 } ^ { N }$ be our dataset of i.i.d. observations of a random variable $\mathbf { x }$ with an unknown true distribution $p ^ { * } ( \mathbf { x } )$ . Our data consist of 8-bit videos, with each dimension rescaled to the domain $[ 0 , 2 5 5 / 2 5 6 ]$ . We add a small amount of uniform noise to the data, $\mathbf { u } \sim \mathcal { U } ( 0 , 1 / 2 5 6 . )$ , matching its discretization level (Dinh et al., 2016; Kingma & Dhariwal, 2018). Let $q ( \mathbf { x } )$ be the resulting empirical distribution corresponding to this scaling and addition of noise. Note that additive noise is required to prevent $q ( \mathbf { x } )$ from having infinite densities at the datapoints, which can result in ill-behaved optimization of the log-likelihood; it also allows us to recast maximization of the log-likelihood as minimization of a KL divergence.
302
+
303
+ ![](images/0b91185728f0b682c869ab816f2e0acfa8d631d2f9f9401e63f3241c1bc2e2cc.jpg)
304
+ Figure 9: We display ten frame rollouts conditioned on 3 frames on the Human3.6M dataset.
305
+
306
+ # D RESIDUAL NETWORK ARCHITECTURE
307
+
308
+ Here we’ll describe the architecture for the residual network N Nθ() that maps z(l)<t, z(>t to $( \mu _ { t } ^ { ( l ) } , \log \sigma _ { t } ^ { ( l ) } )$ (Left: Figure 10). As shown in the left of Figure 10, let $\mathbf { h } _ { t } ^ { ( > l ) }$ be the tensor representing $\mathbf { z } _ { t } ^ { ( > l ) }$ after the split operation between levels in the multi-scale architecture. We apply a $1 \times 1$ convolution over $\mathbf { h } _ { t } ^ { ( > l ) }$ and concatenate this across channels to each laobtain $( ( W \mathbf { h } _ { t } ^ { ( > l ) } ; \mathbf { z } _ { t - 1 } ^ { ( l ) } ) , ( W \mathbf { h } _ { t } ^ { ( > l ) } ; \mathbf { z } _ { t - 2 } ^ { ( l ) } ) \cdot \cdot \cdot ( W \mathbf { h } _ { t } ^ { ( > l ) } ; \mathbf { z } _ { t - n } ^ { ( l ) } ) )$ l independently. In this way, we. We transform these values into $( \mu _ { t } ^ { ( l ) } , \log \sigma _ { t } ^ { ( l ) } )$ via a stack of residual blocks. We obtain a reduction in parameter count by sharing parameters across every 2 time-steps via 3-D convolutions in our residual blocks.
309
+
310
+ As shown in the right of Figure 10, each 3-D residual block consists of three layers. The first layer has a filter size of $2 \mathrm { x } 3 \mathrm { x } 3 $ with 512 output channels followed by a ReLU activation. The second layer has two $1 \times 1 \times 1$ convolutions via the Gated Activation Unit Van Den Oord et al. (2016); van den Oord et al. (2016a). The third layer has a filter size of $2 \times 3 \times 3$ with the number of output channels determined by the level. This block is replicated three times in parallel, with dilation rates 1, 2 and 4, after which the results of each block, in addition to the input of the residual block, are summed.
311
+
312
+ The first two layers are initialized using a Gaussian distribution and the last layer is initialized to zeroes. In that way, the residual network behaves as an identity network during initialization allowing stable optimization. After applying a sequence of residual blocks, we use the last temporal activation that should capture all context. We apply a final $1 \times 1$ convolution to this activation to obtain $( \Delta \mathbf { z } _ { t } ^ { ( l ) } , \log \sigma _ { t } ^ { ( l ) } )$ . We then add $\Delta \mathbf { z } _ { t } ^ { ( l ) }$ to $\mathbf { z } _ { t - 1 } ^ { ( l ) }$ to a temporal skip connection to output $\mu _ { t } ^ { ( l ) }$ . This way, the network learns to predict the change in latent variables for a given level. We have provided visualizations of the network architecture in this website
313
+
314
+ # E ABLATION STUDIES
315
+
316
+ Through an ablation study, we experimentally evaluate the importance of the following components of our VideoFlow model: (1) the use of temporal skip connections, (2) the use Gated Activation Unit (GATU) instead of ReLUs in the residual network and (3) the use of dilations in $N N _ { \pmb \theta } ( \pmb )$ in Section D
317
+
318
+ We start with a VideoFlow model with 256 channels in the coupling layer, 16 steps of flow and remove the components mentioned above to create our baseline. We use four different combinations of our components (described in Fig. 11) and keep the rest of the hyperparameters fixed across those combinations. For each combination we plot the mean bits-per-pixel on the holdout BAIR-action free dataset over $3 0 0 \mathrm { K }$ training steps for both affine and additive coupling in Figure 11. For both the coupling layers, we observe that the VideoFlow model with all the components provide a significant boost in bits-per-pixel over our baseline.
319
+
320
+ ![](images/5c62f7722b1bac9a52aaa15acab7092dd9e004f373701395b671ba2a6b7d000b.jpg)
321
+ Figure 10: Left: We predict a gaussian distribution over $\mathbf { z } _ { t } ^ { ( l ) }$ via a 3-D Residual network conditioned on $\mathbf { z } _ { < t } ^ { ( l ) }$ and $\mathbf { z } _ { t } ^ { ( > l ) }$ . Right: Our 3-D residual network architecture is augmented with dilations and gated activation units improving performance.
322
+
323
+ ![](images/7a3a293bf33b4240af6209c8aba92fa7184ba01c0c8b6a6a636b8cac0096329f.jpg)
324
+ Figure 11: B: baseline, A: Temporal Skip Connection, C: Dilated Convolutions $^ +$ GATU, D: Dilation Convolutions $^ +$ Temporal Skip Connection, E: Dilation Convolutions $^ +$ Temporal Skip Connection $^ +$ GATU. We plot the holdout bits-per-pixel on the BAIR action-free dataset for different ablations of our VideoFlow model.
325
+
326
+ We also note that other combinations—dilated convolutions $+ \mathrm { G A T U }$ (C) and dilated convolutions $^ +$ the temporal skip connection —improve over the baseline. Finally, we experienced that increasing the receptive field in $N N _ { \pmb \theta } ( \pmb )$ using dilated convolutions alone in the absence of the temporal skip connection or the GATU makes training highly unstable.
327
+
328
+ # F EFFECT OF TEMPERATURE ON SAVP-VAE AND SV2P
329
+
330
+ We repeat our evaluations described in Figure 4 applying low temperature to the latent gaussian priors of SV2P and SAVP-VAE. We empirically find that decreasing temperature from 1.0 to 0.0 monotonically decreases the performance of the VAE models. Our insight is that the VideoFlow model gains by low-temperature sampling due to the following reason. At lower T, we obtain a tradeoff between a performance gain by noise removal from the background and a performance hit due to reduced stochasticity of the robot arm. On the other hand, the VAE models have a clear but slightly blurry background throughout from $T = 1 . 0$ to $T = 0 . 0$ . Reducing T in this case, solely reduces the stochasticity of the arm motion thus hurting performance.
331
+
332
+ ![](images/5bb63061df6ae8787f040753d2efd8153f7bb8335a1c7b8d8c4686ae0fbd1cb8.jpg)
333
+ Figure 12: We repeat our evaluations described on the SV2P and SAVP-VAE model in Figure 4 using temperatures from 0.0 to 1.0 while sampling from the latent gaussian prior.
334
+
335
+ # G LIKELIHOOD VS QUALITY
336
+
337
+ ![](images/d738542bde975a00b392ea89c391243f5b3697e11cff5cdb08c216e539cfd2cc.jpg)
338
+ Figure 13: We provide a comparison between training progression (measured in the mean bits-per-pixel objective on the test-set) and the quality of generated videos.
339
+
340
+ We show correlation between training progression (measured in bits per pixel) and quality of the generated videos in Figure 13. We display the videos generated by conditioning on frames from the test set for three different values of bits-per-pixel on the test-set. As we approach lower bits-per-pixel, our VideoFlow model learns to model the structure of the arm with high quality as well as its motion resulting in high quality video.
341
+
342
+ # H VIDEOFLOW - BAIR HYPERPARAMETERS
343
+
344
+ # H.1 QUANTITATIVE - BITS-PER-PIXEL
345
+
346
+ To report bits-per-pixel we use the following set of hyperparameters. We use a learning rate schedule of linear warmup for the first 10000 steps and apply a linear-decay schedule for the last 150000 steps.
347
+
348
+ <table><tr><td rowspan=1 colspan=1>Hyperparameter</td><td rowspan=1 colspan=1>Value</td></tr><tr><td rowspan=1 colspan=1>Flow levels</td><td rowspan=1 colspan=1>3</td></tr><tr><td rowspan=1 colspan=1>Flow steps per level</td><td rowspan=1 colspan=1>24</td></tr><tr><td rowspan=1 colspan=1>Coupling</td><td rowspan=1 colspan=1>Affine</td></tr><tr><td rowspan=1 colspan=1>Number of coupling layer channels</td><td rowspan=1 colspan=1>512</td></tr><tr><td rowspan=1 colspan=1>Optimier</td><td rowspan=1 colspan=1>Adam</td></tr><tr><td rowspan=1 colspan=1>Batch size</td><td rowspan=1 colspan=1>40</td></tr><tr><td rowspan=1 colspan=1>Learning rate</td><td rowspan=1 colspan=1>3e-4</td></tr><tr><td rowspan=1 colspan=1>Number of 3-D residual blocks</td><td rowspan=1 colspan=1>5</td></tr><tr><td rowspan=1 colspan=1>Numberof 3-D residualchannels</td><td rowspan=1 colspan=1>256</td></tr><tr><td rowspan=1 colspan=1>Training steps</td><td rowspan=1 colspan=1>600K</td></tr></table>
349
+
350
+ # H.2 QUALITATIVE EXPERIMENTS
351
+
352
+ For all qualitative experiments and quantitative comparisons with the baselines, we used the following sets of hyperparameters.
353
+
354
+ <table><tr><td rowspan=1 colspan=1>Hyperparameter</td><td rowspan=1 colspan=1>Value</td></tr><tr><td rowspan=1 colspan=1>Flowlevels</td><td rowspan=1 colspan=1>3</td></tr><tr><td rowspan=1 colspan=1>Flow steps per level</td><td rowspan=1 colspan=1>24</td></tr><tr><td rowspan=1 colspan=1>Coupling</td><td rowspan=1 colspan=1>Additive</td></tr><tr><td rowspan=1 colspan=1>Number of coupling layer channels</td><td rowspan=1 colspan=1>392</td></tr><tr><td rowspan=1 colspan=1>Optimier</td><td rowspan=1 colspan=1>Adam</td></tr><tr><td rowspan=1 colspan=1>Batch size</td><td rowspan=1 colspan=1>40</td></tr><tr><td rowspan=1 colspan=1>Learning rate</td><td rowspan=1 colspan=1>3e-4</td></tr><tr><td rowspan=1 colspan=1>Numberof 3-D residualblocks</td><td rowspan=1 colspan=1>5</td></tr><tr><td rowspan=1 colspan=1>Number of 3-D residual channels</td><td rowspan=1 colspan=1>256</td></tr><tr><td rowspan=1 colspan=1>Training steps</td><td rowspan=1 colspan=1>500K</td></tr></table>
355
+
356
+ # I HYPERPARAMETER GRID FOR THE BASELINE VIDEO MODELS.
357
+
358
+ We train all our baseline models for 300K steps using the Adam optimizer. Our models were tuned using the maximum VGG cosine similarity metric with the ground-truth across 100 decodes.
359
+
360
+ SAVP-VAE and SV2P: We use three values of latent loss multiplier 1e-3, 1e-4 and 1e-5. For the SAVP-VAE model, we additionally apply linear decay on the learning rate for the last 100K steps. SAVP-GAN: We tune the gan loss multiplier and the learning rate on a logscale from 1e-2 to 1e-4 and 1e-3 to 1e-5 respectively.
361
+
362
+ # J CORRELATION BETWEEN VGG PERCEPTUAL SIMILARITY AND BITS-PER-PIXEL
363
+
364
+ We plot correlation between cosine similarity using a pretrained VGG network and bits-per-pixel using our trained VideoFlow model. We compare $\bar { \mathcal { P } } ( X _ { 4 } ^ { - } = X _ { t } | X _ { < 4 } )$ as done in Section 5.5 and the VGG cosine similarity between $X _ { 4 }$ and $X _ { t }$ for $t = 4 \dots 1 3$ . We report our results for every video in the test set in Figure 15. We notice a weak correlation between VGG perceptual metrics and bits-per-pixel with a correlation factor of $- 0 . 5 1$ .
365
+
366
+ ![](images/92700e01fc04c693d4825d020ac49caa2609059e9174954bcaf7e0480c1bdb49.jpg)
367
+ Figure 14: We compare $\mathcal { P } ( X _ { 4 } = X _ { t } \vert X _ { < 4 } )$ and VGG cosine similarity between $X _ { 4 }$ and $X _ { t }$ for $t = 4 \dots 1 3$
368
+
369
+ # K VIDEOFLOW: LOW PARAMETER REGIME
370
+
371
+ We repeated our evaluations described in Figure 4, with a smaller version of our VideoFlow model with $4 \mathbf { x }$ parameter reduction. Our model remains competetive with SVG-LP on the VGG perceptual metrics.
372
+
373
+ ![](images/c076a1a61ad38e20102a452d42cf85215f6e6f8034a16c569e2e4227bb7e7cc0.jpg)
374
+ Figure 15: We repeat our evaluations described in Figure 4 with a smaller version of our VideoFlow model.
md/train/rk8wKk-R-/rk8wKk-R-.md ADDED
@@ -0,0 +1,336 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # CONVOLUTIONAL SEQUENCE MODELING REVISITED
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ This paper revisits the problem of sequence modeling using convolutional architectures. Although both convolutional and recurrent architectures have a long history in sequence prediction, the current “default” mindset in much of the deep learning community is that generic sequence modeling is best handled using recurrent networks. The goal of this paper is to question this assumption. Specifically, we consider a simple generic temporal convolution network (TCN), which adopts features from modern ConvNet architectures such as a dilations and residual connections. We show that on a variety of sequence modeling tasks, including many frequently used as benchmarks for evaluating recurrent networks, the TCN outperforms baseline RNN methods (LSTMs, GRUs, and vanilla RNNs) and sometimes even highly specialized approaches. We further show that the potential “infinite memory” advantage that RNNs have over TCNs is largely absent in practice: TCNs indeed exhibit longer effective history sizes than their recurrent counterparts. As a whole, we argue that it may be time to (re)consider ConvNets as the default “go to” architecture for sequence modeling.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Since the re-emergence of neural networks to the forefront of machine learning, two types of network architectures have played a pivotal role: the convolutional network, often used for vision and higher-dimensional input data; and the recurrent network, typically used for modeling sequential data. These two types of architectures have become so ingrained in modern deep learning that they can be viewed as constituting the “pillars” of deep learning approaches. This paper looks at the problem of sequence modeling, predicting how a sequence will evolve over time. This is a key problem in domains spanning audio, language modeling, music processing, time series forecasting, and many others. Although exceptions certainly exist in some domains, the current “default” thinking in the deep learning community is that these sequential tasks are best handled by some type of recurrent network. Our aim is to revisit this default thinking, and specifically ask whether modern convolutional architectures are in fact just as powerful for sequence modeling.
12
+
13
+ Before making the main claims of our paper, some history of convolutional and recurrent models for sequence modeling is useful. In the early history of neural networks, convolutional models were specifically proposed as a means of handling sequence data, the idea being that one could slide a 1-D convolutional filter over the data (and stack such layers together) to predict future elements of a sequence from past ones (Hinton, 1989; LeCun et al., 1995). Thus, the idea of using convolutional models for sequence modeling goes back to the beginning of convolutional architectures themselves. However, these models were subsequently largely abandoned for many sequence modeling tasks in favor of recurrent networks (Elman, 1990). The reasoning for this appears straightforward: while convolutional architectures have a limited ability to look back in time (i.e., their receptive field is limited by the size and layers of the filters), recurrent networks have no such limitation. Because recurrent networks propagate forward a hidden state, they are theoretically capable of infinite memory, the ability to make predictions based upon data that occurred arbitrarily long ago in the sequence. This possibility seems to be realized even moreso for the now-standard architectures of Long ShortTerm Memory networks (LSTMs) (Hochreiter & Schmidhuber, 1997), or recent incarnations such as the Gated Recurrent Unit (GRU) (Cho et al., 2014); these architectures aim to avoid the “vanishing gradient” challenge of traditional RNNs and appear to provide a means to actually realize this infinite memory.
14
+
15
+ Given the substantial limitations of convolutional architectures at the time that RNNs/LSTMs were initially proposed (when deep convolutional architectures were difficult to train, and strategies such as dilated convolutions had not reached widespread use), it is no surprise that CNNs fell out of favor to RNNs. While there have been a few notable examples in recent years of CNNs applied to sequence modeling (e.g., the WaveNet (Oord et al., 2016a) and PixelCNN (Oord et al., 2016b) architectures), the general “folk wisdom” of sequence modeling prevails, that the first avenue of attack for these problems should be some form of recurrent network.
16
+
17
+ The fundamental aim of this paper is to revisit this folk wisdom, and thereby make a counterclaim. We argue that with the tools of modern convolutional architectures at our disposal (namely the ability to train very deep networks via residual connections and other similar mechanisms, plus the ability to increase receptive field size via dilations), in fact convolutional architectures typically outperform recurrent architectures on sequence modeling tasks, especially (and perhaps somewhat surprisingly) on domains where a long effective history length is needed to make proper predictions.
18
+
19
+ This paper consists of two main contributions. First, we describe a generic, baseline temporal convolutional network (TCN) architecture, combining best practices in the design of modern convolutional architectures, including residual layers and dilation. We emphasize that we are not claiming to invent the practice of applying convolutional architectures to sequence prediction, and indeed the TCN architecture here mirrors closely architectures such as WaveNet (in fact TCN is notably simpler in some respects). We do, however, want to propose a generic modern form of convolutional sequence prediction for subsequent experimentation. Second, and more importantly, we extensively evaluate the TCN model versus alternative approaches on a wide variety of sequence modeling tasks, spanning many domains and datasets that have typically been the purview of recurrent models, including word- and character-level language modeling, polyphonic music prediction, and other baseline tasks commonly used to evaluate recurrent architectures. Although our baseline TCN can be outperformed by specialized (and typically highly-tuned) RNNs in some cases, for the majority of problems the TCN performs best, with minimal tuning on the architecture or the optimization. This paper also analyzes empirically the myth of “infinite memory” in RNNs, and shows that in practice, TCNs of similar size and complexity may actually demonstrate longer effective history sizes. Our chief claim in this paper is thus an empirical one: rather than presuming that RNNs will be the default best method for sequence modeling tasks, it may be time to (re)consider ConvNets as the “go-to” approach when facing a new dataset or task in sequence modeling.
20
+
21
+ # 2 RELATED WORK
22
+
23
+ In this section we highlight some of the key innovations in the history of recurrent and convolutional architectures for sequence prediction.
24
+
25
+ Recurrent networks broadly refer to networks that maintain a vector of hidden activations, which are kept over time by propagating them through the network. The intuitive appeal of this approach is that the hidden state can act as a sort of “memory” of everything that has been seen so far in a sequence, without the need for keeping an explicit history. Unfortunately, such memory comes at a cost, and it is well-known that the na¨ıve RNN architecture is difficult to train due to the exploding/vanishing gradient problem (Bengio et al., 1994).
26
+
27
+ A number of solutions have been proposed to address this issue. More than twenty years ago, Hochreiter & Schmidhuber (1997) introduced the now-ubiquitous Long Short-Term Memory (LSTM) which uses a set of gates to explicitly maintain memory cells that are propagated forward in time. Other solutions or refinements include a simplified variant of LSTM, the Gated Recurrent Unit (GRU) (Cho et al., 2014), peephole connections (Gers et al., 2002), Clockwork RNN (Koutnik et al., 2014) and recent works such as MI-RNN (Wu et al., 2016) and the Dilated RNN (Chang et al., 2017). Alternatively, several regularization techniques have been proposed to better train LSTMs, such as those based upon the properties of the RNN dynamical system (Pascanu et al., 2013); more recently, strategies such as Zoneout (Krueger et al., 2017) and AWD-LSTM (Merity et al., 2017) were also introduced to regularize LSTM in various ways, and have achieved exceptional results in the field of language modeling.
28
+
29
+ While it is frequently criticized as a seemingly “ad-hoc” architecture, LSTMs have proven to be extremely robust and is very hard to improve upon by other recurrent architectures, at least for general problems. Jozefowicz et al. (2015) concluded that if there were “architectures much better than the LSTM”, then they were “not trivial to find”. However, while they evaluated a variety of recurrent architectures with different combinations of components via an evolutionary search, they did not consider architectures that were fundamentally different from the recurrent ones.
30
+
31
+ The history of convolutional architectures for time series is comparatively shorter, as they soon fell out of favor compared to recurrent architectures for these tasks, though are also seeing a resurgence in recent years. Waibel et al. (1989) and Bottou et al. (1990) studied the usage of time-delay networks (TDNNs) for sequences, one of the earliest local-connection-based networks in this domain. LeCun et al. (1995) then proposed and examined the usage of CNNs on time-series data, pointing out that the same kind of feature extraction used in images could work well on sequence modeling with convolutional filters. Recent years have seen a re-emergence of convolutional models for sequence data. Perhaps most notably, the WaveNet (Oord et al., 2016a) applied a stacked convolutional architecture to model audio signals, using a combination of dilations (Yu & Koltun, 2015), skip connections, gating, and conditioning on context stacks; the WaveNet mode was additionally applied to a few other contexts, such as financial applications (Borovykh et al., 2017). Non-dilated gated convolutions have also been applied in the context of language modeling (Dauphin et al., 2017). And finally, convolutional models have seen a recent adoption in sequence to sequence modeling and machine translations applications, such as the ByteNet (Kalchbrenner et al., 2016) and ConvS2S architectures (Gehring et al., 2017).
32
+
33
+ Despite these successes, the general consensus of the deep learning community seems to be that RNNs (here meaning all RNNs including LSTM and its variants) are better suited to sequence modeling for two apparent reasons: 1) as discussed before, RNNs are theoretically capable of infinite memory; and 2) RNN models are inherently suitable for sequential inputs of varying length, whereas CNNs seem to be more appropriate in domains with fixed-size inputs (e.g., vision).
34
+
35
+ With this as the context, this paper reconsiders convolutional sequence modeling in general, first introducing a simple general-purpose convolutional sequence modeling architecture that can be applied in all the same scenarios as an RNN (the architecture acts as a “drop-in” replacement for RNNs of any kind). We then extensively evaluate the performance of the architecture on tasks from different domains, focusing on domains and settings that have been used explicitly as applications and benchmarks for RNNs in the recent past. With regard to the specific architectures mentioned above (e.g. WaveNet, ByteNet, gated convolutional language models), the primary goal here is to describe a simple, application-independent architecture that avoids much of the extra specialized components of these architectures (gating, complex residuals, context stacks, or the encoder-decoder architectures of seq2seq models), and keeps only the “standard” convolutional components from most image architectures, with the restriction that the convolutions be causal. In several cases we specifically compare the architecture with and without additional components (e.g., gating elements), and highlight that it does not seem to substantially improve performance of the architecture across domains. Thus, the primary goal of this paper is to provide a baseline architecture for convolutional sequence prediction tasks, and to evaluate the performance of this model across multiple domains.
36
+
37
+ # 3 CONVOLUTIONAL SEQUENCE MODELING
38
+
39
+ In this section, we propose a generic architecture for convolutional sequence prediction, and generally refer to it as Temporal Convolution Networks (TCNs). We emphasize that we adopt this term not as a label for a truly new architecture, but as a simple descriptive term for this and similar architectures. The distinguishing characteristics of the TCN are that: 1) the convolutions in the architecture are causal, meaning that there is no information “leakage” between future and past; 2) the architecture can take a sequence of any length and map it to an output sequence of the same length, just as with an RNN. Beyond this, we emphasize how to build very long effective history sizes (i.e., the ability for the networks to look very far into the past to make a prediction) using a combination of very deep networks (augmented with residual layers) and dilated convolutions.
40
+
41
+ # 3.1 THE SEQUENCE MODELING TASK
42
+
43
+ Before defining the network structure, we highlight the nature of the sequence modeling task. We suppose that we are given a sequence of inputs $x _ { 0 } , \ldots , x _ { T }$ , and we wish to predict some correspond
44
+
45
+ ![](images/e4db16452e482b763cd61552fcde4b5c943fbde3fd808c44865ddb9b473e207d.jpg)
46
+ Figure 1: A simple causal convolution with filter size 3.
47
+
48
+ ing outputs $y _ { 0 } , \ldots , y _ { T }$ at each time. The key constraint is that to predict the output $y _ { t }$ for some time $t$ , we are constrained to only use those inputs that have been previously observed: $x _ { 0 } , \ldots , x _ { t }$ . Formally, a sequence modeling network is any function $f : \mathcal { X } ^ { T + \bar { 1 } } \mathcal { Y } ^ { T + \bar { 1 } }$ that produces this mapping
49
+
50
+ $$
51
+ \hat { y } _ { 0 } , \dots , \hat { y } _ { T } = f ( x _ { 0 } , \dots , x _ { T } )
52
+ $$
53
+
54
+ if it satisfies the causal constraint that $y _ { t }$ depends only on $x _ { 0 } , \ldots , x _ { t }$ , and not on any “future” inputs $x _ { t + 1 } , \dots , x _ { T }$ . The goal of learning in the sequence modeling setting is to find the network $f$ minimizing some expected loss between the actual outputs and predictions $L ( y _ { 0 } , \dots , y _ { T } , f ( x _ { 0 } , \dots , x _ { T } ) )$ where the sequences and outputs are drawn according to some distribution.
55
+
56
+ This formalism encompasses many settings such as auto-regressive prediction (where we try to predict some signal given its past) by setting the target output to be simply the input shifted by one time step. It does not, however, directly capture domains such as machine translation, or sequenceto-sequence prediction in general, since in these cases the entire input sequence (including “future” states) can be used to predict each output (though the techniques can naturally be extended to work in such settings).
57
+
58
+ # 3.2 CAUSAL CONVOLUTIONS AND THE TCN
59
+
60
+ As mentioned above, the TCN is based upon two principles: the fact that the network produces an output of the same length as the input, and the fact that there can be no leakage from the future into the past. To accomplish the first point, the TCN uses a 1D fully-convolutional network (FCN) architecture (Long et al., 2015), where each hidden layer is the same length as the input layer, and zero padding of length (kernel size − 1) is added to keep subsequent layers the same length as previous ones. To achieve the second point, the TCN uses causal convolutions, convolutions where a subsequent output at time $t$ is convolved only with elements from time $t$ and before in the previous layer.1 Graphically, the network is shown in Figure 1. Put in a simple manner:
61
+
62
+ $$
63
+ \mathrm { T C N } = \mathrm { 1 D F C N } + \mathrm { c a u s a l ~ c o n v o l u t i o n s }
64
+ $$
65
+
66
+ It is worth emphasizing that this is essentially the same architecture as the time delay neural network proposed nearly 30 years ago by Waibel et al. (1989), with the sole tweak of zero padding to ensure equal sizes of all layers.
67
+
68
+ However, a major disadvantage of this “na¨ıve” approach is that in order to achieve a long effective history size, we need an extremely deep network or very large filters, neither of which were particularly feasible when the methods were first introduced. Thus, in the following sections, we describe how techniques from modern convolutional architectures can be integrated into the TCN to allow for both very deep networks and very long effective history.
69
+
70
+ ![](images/3d3384271f9fbd194ae3ecf347bb7e1e6b27e790b9063a1b747424be7bcaf5f9.jpg)
71
+ Figure 2: A dilated causal convolution with dilation factors $d = 1 , 2 , 4$ and filter size $k = 3$ . The receptive field is able to cover all values from the input sequence.
72
+
73
+ # 3.3 DILATED CONVOLUTIONS
74
+
75
+ Through convolutional filters, as previously addressed, a simple causal convolution is only able to look back at a history with size linear in the depth of the network. This makes it challenging to apply the aforementioned causal convolution on sequence tasks, especially those requiring longer history. Our solution here, used previously for example in audio synthesis by Oord et al. (2016a), is to employ dilated convolutions (Yu & Koltun, 2015) that enable an exponentially large receptive field. More formally, for a 1-D sequence input $\mathbf { x } \in \mathbb { R } ^ { n }$ and a filter $f : \bar { \{ 0 , \dots , k - 1 \bar { \} } } \mathbb { R }$ , the dilated convolution operation $F$ on element $s$ of the sequence is defined as
76
+
77
+ $$
78
+ F ( s ) = ( \mathbf { x } * _ { d } f ) ( s ) = \sum _ { i = 0 } ^ { k - 1 } f ( i ) \cdot \mathbf { x } _ { s + d \cdot i }
79
+ $$
80
+
81
+ where $d$ is the dilation factor and $k$ is the filter size. Dilation is thus equivalent to introducing a fixed step between every two adjacent filter taps. When taking $d = 1$ , for example, a dilated convolution is trivially a normal convolution operation. Using larger dilations enables an output at the top level to represent a wider range of inputs, thus effectively expanding the receptive field of a ConvNet.
82
+
83
+ This gives us two ways to increase the receptive field of the TCN: by choosing larger filter sizes $k$ , and by increasing the dilation factor $d$ , where the effective history of one such layer is $( k - 1 ) d$ . As is common when using dilated convolutions, we increase $d$ exponentially with the depth of the network (i.e., $d = O ( 2 ^ { i } )$ at level $i$ of the network). This ensures that there is some filter that hits each input within the effective history, while also allowing for an extremely large effective history using deep networks. We provide an illustration in Figure 2. Using filter size $k = 3$ and dilation factor $d = 1 , 2 , 4$ , the receptive field is able to cover all values from the input sequence.
84
+
85
+ # 3.4 RESIDUAL CONNECTIONS
86
+
87
+ Proposed by He et al. (2016), residual functions have proven to be especially useful in effectively training deep networks. In a residual network, each residual block contains a branch leading out to a series of transformations $\mathcal { F }$ , whose outputs are added to the input $\mathbf { x }$ of the block:
88
+
89
+ $$
90
+ o = \mathrm { A c t i v a t i o n } ( \mathbf { x } + \mathcal { F } ( \mathbf { x } ) )
91
+ $$
92
+
93
+ This effectively allows for the layers to learn modifications to the identity mapping rather than the entire transformation, which has been repeatedly shown to benefit very deep networks.
94
+
95
+ As the TCN’s receptive field depends on the network depth $n$ as well as filter size $k$ and dilation factor $d$ , stabilization of deeper and larger TCNs becomes important. For example, in a case where the prediction could depend on a history of size $2 ^ { 1 2 }$ and a high-dimensional input sequence, a network of up to 12 layers could be needed. Each layer, more specifically, consists of multiple filters for feature extraction. In our design of the generic TCN model, we therefore employed a generic residual module in place of a convolutional layer.
96
+
97
+ The residual block for our baseline TCN is shown in figure 3a. Within a residual block, the TCN has 2 layers of dilated causal convolution and non-linearity, for which we used the rectified linear unit
98
+
99
+ (a) TCN residual block. An 1x1 convolution is added when residual input and output have different dimensions.
100
+
101
+ ![](images/1813e828cfa0df05d2cac09fee75934b751463303c74b3ec805bc1f1e7e53827.jpg)
102
+ Figure 3: A visualization of the TCN residual block
103
+
104
+ (b) An example of residual connection in TCN. The blue lines are filters in the residual function, and the green lines are identity mappings.
105
+
106
+ (ReLU) (Nair & Hinton, 2010). For normalization, we applied Weight Normalization (Salimans & Kingma, 2016) to the filters in the dilated convolution (where we note that the filters are essentially vectors of size $k \times 1 \AA$ ). In addition, a 2-D dropout (Srivastava et al., 2014) layer was added after each dilated convolution for regularization: at each training step, a whole channel (in the width dimension) is zeroed out.
107
+
108
+ However, whereas in standard ResNet the input is passed in and added directly to the output of the residual function, in TCN (and ConvNet in general) the input and output could have different widths. Therefore in our TCN, when the input-output widths disagree, we use an additional 1x1 convolution to ensure that element-wise addition $\oplus$ receives tensors of the same shape (see Figure 3a, 3b).
109
+
110
+ Note that many further optimizations (e.g., gating, skip connections, context stacking as in audio generation using WaveNet) are possible in a TCN than what we described here. However, in this paper, we aim to present a generic, general-purpose TCN, to which additional twists can be added as needed. As we are going to show in Section 4, this general-purpose architecture is already able to outperform recurrent units like LSTM on a number of tasks by a good margin.
111
+
112
+ # 3.5 ADVANTAGES OF TCN SEQUENCE MODELING
113
+
114
+ There are several key advantages to a TCN model with the ingredients that we described above.
115
+
116
+ • Parallelism. Unlike in RNNs where the predictions for later timesteps must wait for their predecessors to complete, in a convolutional architecture these computations can be done in parallel since the same filter is used in each layer. Therefore, in training and evaluation, a (possibly long) input sequence can be processed as a whole in TCN, instead of serially as in RNN, which depends on the length of the sequence and could be less efficient.
117
+
118
+ • Flexible receptive field size. With a TCN, we can change its receptive field size in multiple ways. For instance, stacking more dilated (causal) convolutional layers, using larger dilation factors, or increasing the filter size are all viable options (with possibly different interpretations). TCN is thus easy to tune and adapt to different domains, since we now can directly control the size of the model’s memory.
119
+
120
+ • Stable gradients. Unlike recurrent architectures, TCN has a backpropagation path that is different from the temporal direction of the sequence. This enables it to avoid the problem of exploding/vanishing gradients, which is a major issue for RNNs (and which led to the development of LSTM, GRU, HF-RNN, etc.).
121
+
122
+ • Low memory requirement for training. In a task where the input sequence is long, a structure such as LSTM can easily use up a lot of memory to store the partial results for backpropagation (e.g., the results for each gate of the cell). However, in TCN, the backpropagation path only depends on the network depth and the filters are shared in each layer, which means that in practice, as model size or sequence length gets large, TCN is likely to use less memory than RNNs.
123
+
124
+ # 3.6 DISADVANTAGES OF TCN SEQUENCE MODELING
125
+
126
+ We also summarize two disadvantages of using TCN instead of RNNs.
127
+
128
+ • Data storage in evaluation. In evaluation/testing, RNNs only need to maintain a hidden state and take in a current input $x _ { t }$ in order to generate a prediction. In other words, a “summary” of the entire history is provided by the fixed-length set of vectors $h _ { t }$ , which means that the actual observed sequence can be discarded (and indeed, the hidden state can be used as a kind of encoder for all the observed history). In contrast, the TCN still needs to take in a sequence with non-trivial length (precisely the effective history length) in order to predict, thus possibly requiring more memory during evaluation. • Potential parameter change for a transfer of domain. Different domains can have different requirements on the amount of history the model needs to memorize. Therefore, when transferring a model from a domain where only little memory is needed (i.e., small $k$ and $d$ ) to a domain where much larger memory is required (i.e., much larger $k$ and $d$ ), TCN may perform poorly for not having a sufficiently large receptive field.
129
+
130
+ We want to emphasize, though, that we believe the notable lack of “infinite memory” for a TCN is decidedly not a practical disadvantage, since, as we show in Section 4, the TCN method actually outperforms RNNs in terms of the ability to deal with long temporal dependencies.
131
+
132
+ # 4 EXPERIMENTS
133
+
134
+ In this section, we conduct a series of experiments using the baseline TCN (described in section 3) and generic RNNs (namely LSTMs, GRUs, and vanilla RNNs). These experiments cover tasks and datasets from various domains, aiming to test different aspects of a model’s ability to learn sequence modeling. In several cases, specialized RNN models, or methods with particular forms of regularization can indeed vastly outperform both generic RNNs and the TCN on particular problems, which we highlight when applicable. But as a general-purpose architecture, we believe the experiments make a compelling case for the TCN as the “first attempt” approach for many sequential problems.
135
+
136
+ All experiments reported in this section used the same TCN architecture, just varying the depth of the network and occasionally the kernel size. We use an exponential dilation $d = 2 ^ { n }$ for layer $n$ in the network, and the Adam optimizer (Kingma & Ba, 2015) with learning rate 0.002 for TCN (unless otherwise noted). We also empirically find that gradient clipping helped training convergence of TCN, and we pick the maximum norm to clip from [0.3, 1]. When training recurrent models, we use a simple grid search to find a good set of hyperparameters (in particular, optimizer, recurrent drop $p \in [ 0 . 0 5 , 0 . 5 ]$ , the learning rate, gradient clipping, and initial forget-gate bias), while keeping the network around the same size as TCN. No other optimizations, such as gating mechanism (see Appendix D), or highway network, were added to TCN or the RNNs. The hyperparameters we use for TCN on different tasks are reported in Table 2 in Appendix B. In addition, we conduct a series controlled experiments to investigate the effects of filter size and residual function on the TCN’s performance. These results can be found in Appendix C.
137
+
138
+ # 4.1 TASKS AND RESULTS SUMMARY
139
+
140
+ In this section we highlight the general performance of generic TCNs vs generic LSTMs for a variety of domains from the sequential modeling literature. A complete description of each task, as well as references to some prior works that evaluated them, is given in Appendix A. In brief, the tasks we consider are: the adding problem, sequential MNIST, permuted MNIST (P-MNIST), the copy memory task, the Nottingham and JSB Chorales polyphonic music tasks, Penn Treebank (PTB), Wikitext-103 and LAMBADA word-level language modeling, as well as PTB and text8 characterlevel language modeling.
141
+
142
+ Table 1: Complete comparison of the TCN to regularized recurrent architectures in various tasks.
143
+
144
+ <table><tr><td rowspan="2">Sequential Tasks</td><td rowspan="2">Model Size (≈)</td><td colspan="4">Models</td></tr><tr><td>LSTM</td><td>GRU</td><td>RNN</td><td>TCN (ours)</td></tr><tr><td>Seq. MNIST (accuracy)</td><td>70K</td><td>87.2</td><td>96.2</td><td>21.5</td><td>99.0</td></tr><tr><td>P-Seq. MNIST (accuracy)</td><td>70K</td><td>85.7</td><td>87.3</td><td>25.3</td><td>97.2</td></tr><tr><td>The Adding Problem T=600 (loss)</td><td>70K</td><td>0.164</td><td>5.3e-5</td><td>0.177</td><td>5.8e-5</td></tr><tr><td>Copy Memory T=1000 (loss)</td><td>16K</td><td>0.0204</td><td>0.0197</td><td>1</td><td>3.5e-5</td></tr><tr><td>Music JSB Chorales (loss)</td><td>300K</td><td>8.45</td><td>8.43</td><td>8.91</td><td>8.10</td></tr><tr><td>Music Nottingham (loss)</td><td>1M</td><td>3.29</td><td>3.46</td><td>-</td><td>3.07</td></tr><tr><td>Word-level PTB (ppl)</td><td>13M</td><td>84.77</td><td>92.48</td><td>114.50</td><td>90.17</td></tr><tr><td>Word-level Wiki-103 (ppl)</td><td>-</td><td>48.4 (large)</td><td>-</td><td>1</td><td>45.19</td></tr><tr><td>Word-level LAMBADA (ppl)</td><td>-</td><td>4186</td><td>-</td><td>14725</td><td>1279</td></tr><tr><td>Char-level PTB (bpc)</td><td>3M</td><td>1.41</td><td>1.42</td><td>1.52</td><td>1.35</td></tr><tr><td>Char-level text8 (bpc)</td><td>5M</td><td>1.52</td><td>1.56</td><td>1.69</td><td>1.45</td></tr></table>
145
+
146
+ ![](images/ea6a8e859d355bb1c75732fd3c99b5619813b7328366f413036a0d184b56a648.jpg)
147
+ Figure 4: Results of TCN vs. recurrent architectures on the adding problem
148
+
149
+ A summary comparison of TCNs to the standard RNN architectures (LSTM, GRU, and vanilla RNN) is shown in Table 1. We will highlight many of these results below, and want to emphasize that for several tasks the baseline RNN architectures are still far from the state of the art (see Table 4), but in total the results make a strong case that the TCN architecture, as a generic sequence modeling framework, is often superior to generic RNN approaches. We now consider several of these experiments in detail, generally distinguishing between the “recurrent benchmark” tasks designed to show the limitations of networks for sequence modeling (adding problem, sequential & permuted MNIST, copy memory), and the “applied” tasks (polyphonic music and language modeling).
150
+
151
+ # 4.2 BASELINE RECURRENT TASKS
152
+
153
+ We first compare the results of the TCN architecture to those of RNNs on the toy baseline tasks that have been frequently used to evaluate sequential modeling (Hochreiter & Schmidhuber, 1997; Martens & Sutskever, 2011; Pascanu et al., 2013; Le et al., 2015; Cooijmans et al., 2016; Zhang et al., 2016; Krueger et al., 2017; Wisdom et al., 2016; Arjovsky et al., 2016).
154
+
155
+ The Adding Problem. Convergence results for the adding problem, for problem sizes $T =$ 200, 400, 600, are shown in Figure 4; all models were chosen to have roughly 70K parameters. In all three cases, TCNs quickly converged to a virtually perfect solution (i.e., an MSE loss very close to 0). LSTMs and vanilla RNNs performed significantly worse, while on this task GRUs also performed quite well, even though their convergence was slightly slower than TCNs.
156
+
157
+ Sequential MNIST and P-MNIST. Results on sequential and permuted MNIST, run over 10 epochs, are shown in Figures 5a and 5b; all models were picked to have roughly 70K parameters. For both problems, TCNs substantially outperform the alternative architectures, both in terms of convergence time and final performance level on the task. For the permuted sequential MNIST, TCNs outperform state of the art results using recurrent nets $( 9 5 . 9 \% )$ with Zoneout+Recurrent BatchNorm (Cooijmans et al., 2016; Krueger et al., 2017), a highly optimized method for regularizing RNNs.
158
+
159
+ ![](images/404df7deb85ffa4ae5c1945673693b1c2d442023841918eb5df6debfac1e9251.jpg)
160
+ Figure 5: Results of TCN vs. recurrent architectures on the Sequential MNIST and P-MNIST
161
+
162
+ ![](images/4cc3f571686b4edc1e41610e5d0966fcd5f75e40a815be1d639a5bcb8bd1de0b.jpg)
163
+ Figure 6: Result of TCN vs. recurrent architectures on the Copy Memory Task, for different $T$
164
+
165
+ Copy Memory Task. Finally, Figure 6 shows the results of the different methods (with roughly the same size) on the copy memory task. Again, the TCNs quickly converge to correct answers, while the LSTM and GRU simply converge to the same loss as predicting all zeros. In this case we also compare to the recently-proposed EURNN (Jing et al., 2017), which was highlighted to perform well on this task. While both perform well for sequence length $T = 5 0 0$ , the TCN again has a clear advantage for $T = 1 0 0 0$ and $T = 2 0 0 0$ (in terms of both loss and convergence).
166
+
167
+ # 4.3 RESULTS ON POLYPHONIC MUSIC AND LANGUAGE MODELING
168
+
169
+ Next, we compare the results of the TCN architecture to recurrent architectures on 6 different real datasets in polyphonic music as well as word- and character-level language modeling. These are areas where sequence modeling has been used most frequently. As domains where there is considerable practical interests, there have also been many specialized RNNs developed for these tasks (e.g., Zhang et al. (2016); Ha et al. (2017); Krueger et al. (2017); Grave et al. (2016); Greff et al. (2017); Merity et al. (2017)). We mention some of these comparisons when useful, but the primary goal here is to compare the generic TCN model to other generic RNN architectures, so we focus mainly on these comparisons.
170
+
171
+ Polyphonic Music. On the Nottingham and JSB Chorales datasets, the TCN with virtually no tuning is again able to beat the other models by a considerable margin (see Table 1), and even outperforms some improved recurrent models for this task such as HF-RNN (Boulanger-Lewandowski et al., 2012) and Diagonal RNN (Subakan & Smaragdis, 2017). Note however that other models such as the Deep Belief Net LSTM (Vohra et al., 2015) perform substantially better on this task; we believe this is likely due to the fact that the datasets involved in polyphonic music are relatively small, and thus the right regularization method or generative modeling procedure can improve performance significantly. This is largely orthogonal to the RNN/TCN distinction, as a similar variant of TCN may well be possible.
172
+
173
+ Word-level Language Modeling. Language modeling remains one of the primary applications of recurrent networks in general, where many recent works have been focusing on optimizing the usage of LSTMs (see Krueger et al. (2017); Merity et al. (2017)). In our implementation, we follow standard practices such as tying the weights of encoder and decoder layers for both TCN and RNNs (Press & Wolf, 2016), which significantly reduces the number of parameters in the model. When training the language modeling tasks, we use SGD optimizer with annealing learning rate (by a factor of 0.5) for TCN and RNNs.
174
+
175
+ Results on word-level language modeling are reported in Table 1. With a fine-tuned LSTM (i.e., with recurrent and embedding dropout, etc.), we find LSTM can outperform TCN in perplexity on the Penn TreeBank (PTB) dataset, where the TCN model still beats both GRU and vanilla RNN. On the much larger Wikitext-103 corpus, however, without performing much hyperparameter search (due to lengthy training process), we still observe that TCN outperforms the state of the art LSTM results (48.4 in perplexity) by Grave et al. (2016) (without continuous cache pointer; see Table 4). The same superiority is observed on the LAMBADA test (Paperno et al., 2016), where TCN achieves a much lower perplexity than its recurrent counterparts in predicting the last word based on a very long context (see Appendix A). We will further analyze this in section 4.4.
176
+
177
+ Character-level Language Modeling. The results of applying TCN and alternative models on PTB and text8 data for character-level language modeling are shown in Table 1, with performance measured in bits per character (bpc). While beaten by the state of the art (see Table 4), the generic TCN outperforms regularized LSTM and GRU as well as methods such as Norm-stabilized LSTM (Krueger & Memisevic, 2015). Moreover, we note that using a filter size of $k \leq 4$ works better than larger filter sizes in character-level language modeling, which suggests that capturing short history is more important than longer dependencies in these tasks.
178
+
179
+ # 4.4 MEMORY SIZE OF TCN AND RNNS
180
+
181
+ Finally, one of the important reasons why RNNs have been preferred over CNNs for general sequence modeling is that theoretically, recurrent architectures are capable of an infinite memory. We therefore attempt to study here how much memory TCN and LSTM/GRU are able to actually “backtrack”, via the copy memory task and the LAMBADA language modeling task.
182
+
183
+ The copy memory task is a simple but perfect task to examine a model’s ability to pick up its memory from a (possibly) distant past (by varying the value of sequence length $T$ ). However, different from the setting in Section 4.2, in order to compare the results for different sequence lengths, here we only report the accuracy on the last $I O$ elements of the output sequence. We used a model size of 10K for both TCN and RNNs.
184
+
185
+ ![](images/294b6d1f2397e8ec063d0643ac527f33c030df7f7c912acd3fc3b3fa37f37eaa.jpg)
186
+ Figure 7: Accuracy on the copy memory task for varying sequence length $T$ .
187
+
188
+ The results are shown in Figure 7. TCNs consistently converge to $100 \%$ accuracy for all sequence lengths, whereas it is increasingly challenging for recurrent models to memorize as $T$ grows (with accuracy converging to that of a random guess). LSTM’s accuracy quickly falls below $20 \%$ for $T \geq 5 0$ , which suggests that instead of infinite memory, LSTMs are only good at recalling a short history instead.
189
+
190
+ This observation is also backed up by the experiments of TCN on the LAMBADA dataset, which is specifically designed to test a model’s textual understanding in a broader discourse. The objective of LAMBADA dataset is to predict the last word of the target sentence given a sufficiently long context (see Appendix A for more details). Most of the existing models fail to guess accurately on this task. As shown in Table 1, TCN outperforms LSTMs by a significant margin in perplexity on LAMBADA (with a smaller network and virtually no tuning).
191
+
192
+ These results indicate that TCNs, despite their apparent finite history, in practice maintain a longer effective history than their recurrent counterparts. We would like to emphasize that this empirical observation does not contradict the good results that prior works have achieved using LSTM, such as in language modeling on PTB. In fact, the very success of $n$ -gram models (Brown et al., 1992) suggested that language modeling might not need a very long memory, a conclusion also reached by prior works such as Dauphin et al. (2017).
193
+
194
+ # 5 DISCUSSION
195
+
196
+ In this work, we revisited the topic of modeling sequence predictions using convolutional architectures. We introduced the key components of the TCN and analyzed some vital advantages and disadvantages of using TCN for sequence predictions instead of RNNs. Further, we compared our generic TCN model to the recurrent architectures on a set of experiments that span a wide range of domains and datasets. Through these experiments, we have shown that TCN with minimal tuning can outperform LSTM/GRU of the same model size (and with standard regularizations) in most of the tasks. Further experiments on the copy memory task and LAMBADA task revealed that TCNs actually has a better capability for long-term memory than the comparable recurrent architectures, which are commonly believed to have unlimited memory.
197
+
198
+ It is still important to note that, however, we only presented a generic architecture here, with components all coming from standard modern convolutional networks (e.g., normalization, dropout, residual network). And indeed, on specific problems, the TCN model can still be beaten by some specialized RNNs that adopt carefully designed optimization strategies. Nevertheless, we believe the experiment results in Section 4 might be a good signal that instead of considering RNNs as the “default” methodology for sequence modeling, convolutional networks too, can be a promising and powerful toolkit in studying time-series data.
199
+
200
+ # REFERENCES
201
+
202
+ Allan, M. and Williams, C. Harmonising chorales by probabilistic inference. In Advances in neural information processing systems, pp. 25–32, 2005.
203
+ Arjovsky, M., Shah, A., and Bengio, Y. Unitary evolution recurrent neural networks. In International Conference on Machine Learning (ICML-16), pp. 1120–1128, 2016.
204
+ Bengio, Y., Simard, P., and Frasconi, P. Learning long-term dependencies with gradient descent is difficult. IEEE transactions on neural networks, 5(2):157–166, 1994.
205
+ Borovykh, A., Bohte, S., and Oosterlee, C. W. Conditional time series forecasting with convolutional neural networks. arXiv preprint arXiv:1703.04691, 2017.
206
+ Bottou, L., Soulie, F. F., Blanchet, P., and Lienard, J.-S. Speaker-independent isolated digit recog- ´ nition: Multilayer perceptrons vs. dynamic time warping. Neural Networks, 3(4):453–465, 1990.
207
+ Boulanger-Lewandowski, N., Bengio, Y., and Vincent, P. Modeling temporal dependencies in highdimensional sequences: Application to polyphonic music generation and transcription. arXiv preprint arXiv:1206.6392, 2012.
208
+ Brown, P. F., Desouza, P. V., Mercer, R. L., Pietra, V. J. D., and Lai, J. C. Class-based n-gram models of natural language. Computational linguistics, 18(4):467–479, 1992.
209
+ Chang, S., Zhang, Y., Han, W., Yu, M., Guo, X., Tan, W., Cui, X., Witbrock, M., Hasegawa-Johnson, M., and Huang, T. Dilated recurrent neural networks. arXiv preprint arXiv:1710.02224, 2017.
210
+ Cho, K., Van Merrienboer, B., Bahdanau, D., and Bengio, Y. On the properties of neural machine ¨ translation: Encoder-decoder approaches. arXiv preprint arXiv:1409.1259, 2014.
211
+ Chung, J., Gulcehre, C., Cho, K., and Bengio, Y. Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv preprint arXiv:1412.3555, 2014.
212
+ Chung, J., Ahn, S., and Bengio, Y. Hierarchical multiscale recurrent neural networks. arXiv preprint arXiv:1609.01704, 2016.
213
+ Cooijmans, T., Ballas, N., Laurent, C., Gulc¸ehre, C¸ ., and Courville, A. Recurrent batch normaliza- ¨ tion. In International Conference on Learning Representations, 2016.
214
+ Dauphin, Y. N., Fan, A., Auli, M., and Grangier, D. Language modeling with gated convolutional networks. In International Conference on Machine Learning (ICML-17), pp. 933–941, 2017.
215
+ Elman, J. L. Finding structure in time. Cognitive science, 14(2):179–211, 1990.
216
+ Gehring, J., Auli, M., Grangier, D., Yarats, D., and Dauphin, Y. N. Convolutional sequence to sequence learning. arXiv preprint arXiv:1705.03122, 2017.
217
+ Gers, F. A., Schraudolph, N. N., and Schmidhuber, J. Learning precise timing with lstm recurrent networks. Journal of machine learning research, 3(Aug):115–143, 2002.
218
+ Grave, E., Joulin, A., and Usunier, N. Improving neural language models with a continuous cache. In International Conference on Learning Representations, 2016.
219
+ Greff, K., Srivastava, R. K., Koutn´ık, J., Steunebrink, B. R., and Schmidhuber, J. Lstm: A search space odyssey. IEEE transactions on neural networks and learning systems, 2017.
220
+ Ha, D., Dai, A., and Le, Q. V. Hypernetworks. In International Conference on Learning Representations, 2017.
221
+ He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learning for image recognition. In Computer Vision and Pattern Recognition, pp. 770–778, 2016.
222
+ Hinton, G. E. Connectionist learning procedures. Artificial intelligence, 40(1-3):185–234, 1989.
223
+ Hochreiter, S. and Schmidhuber, J. Long short-term memory. Neural computation, 9(8):1735–1780, 1997.
224
+ Jing, L., Shen, Y., Dubcek, T., Peurifoy, J., Skirlo, S., LeCun, Y., Tegmark, M., and Soljaciˇ c, M. ´ Tunable efficient unitary neural networks (EUNN) and their application to RNNs. In International Conference on Machine Learning (ICML-17), pp. 1733–1741, 2017.
225
+ Jozefowicz, R., Zaremba, W., and Sutskever, I. An empirical exploration of recurrent network architectures. In International Conference on Machine Learning (ICML-15), pp. 2342–2350, 2015.
226
+ Kalchbrenner, N., Espeholt, L., Simonyan, K., Oord, A. v. d., Graves, A., and Kavukcuoglu, K. Neural machine translation in linear time. arXiv preprint arXiv:1610.10099, 2016.
227
+ Kingma, D. and Ba, J. Adam: A method for stochastic optimization. In International Conference on Learning Representations, 2015.
228
+ Koutnik, J., Greff, K., Gomez, F., and Schmidhuber, J. A clockwork rnn. In International Conference on Machine Learning (ICML-14), pp. 1863–1871, 2014.
229
+ Krueger, D. and Memisevic, R. Regularizing rnns by stabilizing activations. arXiv preprint arXiv:1511.08400, 2015.
230
+ Krueger, D., Maharaj, T., Kramar, J., Pezeshki, M., Ballas, N., Ke, N. R., Goyal, A., Bengio, Y., ´ Larochelle, H., Courville, A., et al. Zoneout: Regularizing rnns by randomly preserving hidden activations. In International Conference on Learning Representations, 2017.
231
+ Le, Q. V., Jaitly, N., and Hinton, G. E. A simple way to initialize recurrent networks of rectified linear units. arXiv preprint arXiv:1504.00941, 2015.
232
+ LeCun, Y., Bengio, Y., et al. Convolutional networks for images, speech, and time series. In The handbook of brain theory and neural networks, volume 3361, pp. 1995. 1995.
233
+ Lecun, Y., Bottou, L., Bengio, Y., and Haffner, P. Gradient-based learning applied to document recognition. In Proceedings of the IEEE, pp. 2278–2324, 1998.
234
+ Long, J., Shelhamer, E., and Darrell, T. Fully convolutional networks for semantic segmentation. In Computer Vision and Pattern Recognition, pp. 3431–3440, 2015.
235
+ Marcus, M. P., Marcinkiewicz, M. A., and Santorini, B. Building a large annotated corpus of english: The penn treebank. Computational linguistics, 19(2):313–330, 1993.
236
+ Martens, J. and Sutskever, I. Learning recurrent neural networks with hessian-free optimization. In International Conference on Machine Learning (ICML-11), pp. 1033–1040, 2011.
237
+ Merity, S., Xiong, C., Bradbury, J., and Socher, R. Pointer sentinel mixture models. arXiv preprint arXiv:1609.07843, 2016.
238
+ Merity, S., Keskar, N. S., and Socher, R. Regularizing and Optimizing LSTM Language Models. arXiv preprint arXiv:1708.02182, 2017.
239
+ Mikolov, T., Sutskever, I., Deoras, A., Le, H.-S., Kombrink, S., and Cernocky, J. Subword language modeling with neural networks. preprint, 2012.
240
+ Miyamoto, Y. and Cho, K. Gated word-character recurrent language model. arXiv preprint arXiv:1606.01700, 2016.
241
+ Nair, V. and Hinton, G. E. Rectified linear units improve restricted boltzmann machines. In International Conference on Machine Learning (ICML-10), pp. 807–814, 2010.
242
+ Oord, A. v. d., Dieleman, S., Zen, H., Simonyan, K., Vinyals, O., Graves, A., Kalchbrenner, N., Senior, A., and Kavukcuoglu, K. Wavenet: A generative model for raw audio. In International Conference on Learning Representations, 2016a.
243
+ Oord, A. v. d., Kalchbrenner, N., Vinyals, O., Espeholt, L., Graves, A., and Kavukcuoglu, K. Conditional image generation with pixelcnn decoders. In Advances in Neural Information Processing Systems, pp. 4790–4798, 2016b.
244
+ Paperno, D., Kruszewski, G., Lazaridou, A., Pham, Q. N., Bernardi, R., Pezzelle, S., Baroni, M., Boleda, G., and Fernandez, R. The lambada dataset: Word prediction requiring a broad discourse ´ context. arXiv preprint arXiv:1606.06031, 2016.
245
+ Pascanu, R., Mikolov, T., and Bengio, Y. On the difficulty of training recurrent neural networks. In International Conference on Machine Learning (ICML-13), pp. 1310–1318, 2013.
246
+ Press, O. and Wolf, L. Using the output embedding to improve language models. arXiv preprint arXiv:1608.05859, 2016.
247
+ Salimans, T. and Kingma, D. P. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. In Advances in Neural Information Processing Systems, pp. 901–909. 2016.
248
+ Srivastava, N., Hinton, G. E., Krizhevsky, A., Sutskever, I., and Salakhutdinov, R. Dropout: a simple way to prevent neural networks from overfitting. Journal of machine learning research, 15(1): 1929–1958, 2014.
249
+ Subakan, Y. C. and Smaragdis, P. Diagonal rnns in symbolic music modeling. arXiv preprint arXiv:1704.05420, 2017.
250
+ Vohra, R., Goel, K., and Sahoo, J. Modeling temporal dependencies in data using a dbn-lstm. In Data Science and Advanced Analytics (DSAA), 2015. 36678 2015. IEEE International Conference on, pp. 1–4. IEEE, 2015.
251
+ Waibel, A., Hanazawa, T., Hinton, G., Shikano, K., and Lang, K. J. Phoneme recognition using time-delay neural networks. IEEE transactions on acoustics, speech, and signal processing, 37 (3):328–339, 1989.
252
+ Wisdom, S., Powers, T., Hershey, J., Le Roux, J., and Atlas, L. Full-capacity unitary recurrent neural networks. In Advances in Neural Information Processing Systems, pp. 4880–4888, 2016.
253
+ Wu, Y., Zhang, S., Zhang, Y., Bengio, Y., and Salakhutdinov, R. R. On multiplicative integration with recurrent neural networks. In Advances in Neural Information Processing Systems, pp. 2856– 2864, 2016.
254
+ Yu, F. and Koltun, V. Multi-scale context aggregation by dilated convolutions. In International Conference on Learning Representations, 2015.
255
+ Zhang, S., Wu, Y., Che, T., Lin, Z., Memisevic, R., Salakhutdinov, R. R., and Bengio, Y. Architectural complexity measures of recurrent neural networks. In Advances in Neural Information Processing Systems, pp. 1822–1830. 2016.
256
+
257
+ # A DESCRIPTION OF BENCHMARK TASKS
258
+
259
+ The Adding Problem: In this task, each input consists of a length- $\mathbf { \nabla } \cdot n$ sequence of depth 2, with all values randomly chosen in [0, 1], and the second dimension being all zeros expect for two elements that are marked by 1. The objective is to sum the two random values whose second dimensions are marked by 1. Simply predicting the sum to be 1 should give an MSE of about 0.1767. First introduced by Hochreiter & Schmidhuber (1997), the addition problem have been consistently used as a pathological test for evaluating sequential models (Pascanu et al., 2013; Le et al., 2015; Zhang et al., 2016; Arjovsky et al., 2016).
260
+
261
+ Sequential MNIST & P-MNIST: Sequential MNIST is frequently used to test a recurrent network’s ability to combine its information from a long memory context in order to make classification prediction (Le et al., 2015; Zhang et al., 2016; Cooijmans et al., 2016; Krueger et al., 2017; Jing et al., 2017). In this task, MNIST (Lecun et al., 1998) images are presented to the model as a $7 8 4 \times 1$ sequence for digit classification In a more challenging setting, we also permuted the order of the sequence by a random (fixed) order and tested the TCN on this permuted MNIST (P-MNIST) task.
262
+
263
+ Copy Memory Task: In copy memory task, each input sequence has length $T + 2 0$ . The first 10 values are chosen randomly from digit [1-8] with the rest being all zeros, except for the last 11 entries which are marked by 9 (the first $" 9 "$ is a delimiter). The goal of this task is to generate an output of same length that is zero everywhere, except the last 10 values after the delimiter, where the model is expected to repeat the same 10 values at the start of the input. This was used by prior works such as Arjovsky et al. (2016); Wisdom et al. (2016); Jing et al. (2017); but we also extended the sequence lengths to up to $T = 2 0 0 0$ .
264
+
265
+ JSB Chorales: JSB Chorales dataset (Allan & Williams, 2005) is a polyphonic music dataset consisting of the entire corpus of 382 four-part harmonized chorales by J. S. Bach. In a polyphonic music dataset, each input is a sequence of elements having 88 dimensions, representing the 88 keys on a piano. Therefore, each element $x _ { t }$ is a chord written in as binary vector, in which a “1” indicates a key pressed.
266
+
267
+ Nottingham: Nottingham dataset 2 is a collection of 1200 British and American folk tunes. Nottingham is a much larger dataset than JSB Chorales. Along with JSB Chorales, Nottingham has been used in a number of works that investigated recurrent models’ applicability in polyphonic music (Greff et al., 2017; Chung et al., 2014), and the performance for both tasks are measured in terms of negative log-likelihood (NLL) loss.
268
+
269
+ PennTreebank: We evaluated TCN on the PennTreebank (PTB) dataset (Marcus et al., 1993), for both character-level and word-level language modeling. When used as a character-level language corpus, PTB contains 5059K characters for training, 396K for validation and 446K for testing, with an alphabet size of 50. When used as a word-level language corpus, PTB contains 888K words for training, 70K for validation and 79K for testing, with vocabulary size 10000. This is a highly studied dataset in the field of language modeling (Miyamoto & Cho, 2016; Krueger et al., 2017; Merity et al., 2017), with exceptional results have been achieved by some highly optimized RNNs.
270
+
271
+ Wikitext-103: Wikitext-103 (Merity et al., 2016) is almost 110 times as large as PTB, featuring a vocabulary size of about 268K. The dataset contains 28K Wikipedia articles (about 103 million words) for training, 60 articles (about 218K words) for validation and 60 articles (246K words) for testing. This is a more representative (and realistic) dataset than PTB as it contains a much larger vocabulary, including many rare vocabularies.
272
+
273
+ LAMBADA: Introduced by Paperno et al. (2016), LAMBADA (LA nguage Modeling Boadened to Account for Discourse Aspects) is a dataset consisting of 10K passages extracted from novels, with on average 4.6 sentences as context, and 1 target sentence whose last word is to be predicted. This dataset was built so that human can guess naturally and perfectly when given the context, but would fail to do so when only given the target sentence. Therefore, LAMBADA is a very challenging dataset that evaluates a model’s textual understanding and ability to keep track of information in the broader discourse. Here is an example of a test in the LAMBADA dataset, where the last word “miscarriage” is to be predicted (which is not in the context):
274
+
275
+ Context: “Yes, I thought I was going to lose the baby.”“I was scared too.” he stated, sincerity flooding his eyes. “You were?”“Yes, of course. Why do you even ask?”“This baby wasn’t exactly planned for.”
276
+
277
+ Target Sentence: “Do you honestly think that I would want you to have a ”
278
+
279
+ Target Word: miscarriage
280
+
281
+ This dataset was evaluated in prior works such as Paperno et al. (2016); Grave et al. (2016). In general, better results on LAMBADA indicate that a model is better at capturing information from longer and broader context. The training data for LAMBADA is the full text of 2,662 novels with more than 200M words 3, and the vocabulary size is about 93K.
282
+
283
+ text8: We also used tex $8 ^ { 4 }$ dataset for character level language modeling (Mikolov et al., 2012). Compared to PTB, text8 is about 20 times as large, with about 100 million characters from Wikipedia (90M for training, 5M for validation and 5M for testing). The corpus contains 27 unique alphabets.
284
+
285
+ # B HYPERPARAMETERS SETTINGS
286
+
287
+ # B.1 HYPERPARAMETERS FOR TCN
288
+
289
+ In this supplementary section, we report in a table (see Table 2) the hyperparameters we used when applying the generic TCN model on the different tasks/datasets. The most important factor for picking parameters is to make sure that the TCN has a sufficiently large receptive field by choosing $k$ and $n$ that can cover the amount of context needed for the task.
290
+
291
+ Table 2: TCN parameter settings for experiments in Section. 4
292
+
293
+ <table><tr><td colspan="7">TCN SETTINGS</td></tr><tr><td>Dataset/Task</td><td>Subtask</td><td>k n</td><td>Hidden</td><td>Dropout</td><td>Grad Clip</td><td>Note</td></tr><tr><td rowspan="3">The Adding Problem</td><td>T=200</td><td>6</td><td>7 27</td><td></td><td></td><td></td></tr><tr><td>T= 400</td><td>7</td><td>7 27</td><td>0.0</td><td>N/A</td><td></td></tr><tr><td>T= 600</td><td>8</td><td>8 24</td><td></td><td></td><td></td></tr><tr><td rowspan="2">Seq. MNIST</td><td></td><td>7</td><td>8</td><td>25</td><td>0.0</td><td>N/A</td></tr><tr><td></td><td>6</td><td>8 20</td><td></td><td></td><td></td></tr><tr><td>Permuted MNIST</td><td></td><td>7 6</td><td>8 8</td><td>25 0.0 20</td><td>N/A</td><td></td></tr><tr><td rowspan="3">Copy Memory Task</td><td>T=500</td><td>6</td><td>9</td><td>10</td><td></td><td></td></tr><tr><td>T= 1000</td><td>8</td><td>8</td><td>10 0.05</td><td>1.0</td><td>RMSprop 5e-4</td></tr><tr><td>T= 2000</td><td>8</td><td>9 10</td><td></td><td></td><td></td></tr><tr><td>Music JSB Chorales</td><td>1</td><td>3</td><td>2</td><td>150</td><td>0.5 0.4</td><td></td></tr><tr><td>Music Nottingham</td><td>1</td><td>6</td><td>4</td><td>150</td><td>0.2 0.4</td><td></td></tr><tr><td rowspan="3">Word-level LM</td><td>PTB</td><td>3</td><td>4 600</td><td></td><td></td><td>Embed. size 600</td></tr><tr><td>Wiki-103</td><td>3</td><td>5 1000</td><td>0.4</td><td>0.3</td><td>Embed. size 400</td></tr><tr><td>LAMBADA</td><td>4</td><td>5 500</td><td></td><td></td><td>Embed. size 500</td></tr><tr><td rowspan="2">Char-level LM</td><td>PTB</td><td>3</td><td>3</td><td>450</td><td></td><td></td></tr><tr><td>text8</td><td>2</td><td>5</td><td>0.1 520</td><td>0.15</td><td>Embed. size 100</td></tr></table>
294
+
295
+ As previously mentioned in Section 4, the number of hidden units was chosen based on $k$ and $n$ such that the model size is approximately at the same level as the recurrent models. In the table above, a gradient clip of N/A means no gradient clipping was applied. However, in larger tasks, we empirically found that adding a gradient clip value (we randomly picked from [0.2, 1]) helps the training convergence.
296
+
297
+ # B.2 HYPERPARAMETERS FOR LSTM/GRU
298
+
299
+ We also report the parameter setting for LSTM in Table 3. These values are picked from hyperparameter search for LSTMs that have up to 3 layers, and the optimizers are chosen from {SGD, Adam, RMSprop, Adagrad}.
300
+
301
+ GRU hyperparameters were chosen in a similar fashion, but with more hidden units to keep the total model size approximately the same (since a GRU cell is smaller).
302
+
303
+ # B.3 COMPARE TO THE STATE OF THE ART RESULTS
304
+
305
+ As previously noted, TCN can still be outperformed by optimized RNNs in some of the tasks, whose results are summarized in Table 4 below. The same TCN architecture is used across all tasks.
306
+
307
+ Note that the size of the SoTA model may be different from the size of the TCN.
308
+
309
+ Table 3: LSTM parameter settings for experiments in Section 4.
310
+
311
+ <table><tr><td colspan="8">LSTM SETTINGS(KEY PARAMETERS)</td></tr><tr><td>Dataset/Task</td><td>Subtask</td><td>n</td><td>Hidden</td><td>Dropout</td><td>Grad Clip</td><td>Bias</td><td>Note</td></tr><tr><td rowspan="3">The Adding Problem</td><td>T= 200</td><td>2</td><td>77</td><td></td><td>50</td><td>5.0</td><td>SGD 1e-3</td></tr><tr><td>T= 400</td><td>2</td><td>77</td><td>0.0</td><td>50</td><td>10.0</td><td>Adam 2e-3</td></tr><tr><td>T= 600</td><td>1</td><td>130</td><td></td><td>5</td><td>1.0</td><td>1</td></tr><tr><td>Seq. MNIST</td><td>:</td><td>1</td><td>130</td><td>0.0</td><td>1</td><td>1.0</td><td>RMSprop 1e-3</td></tr><tr><td>Permuted MNIST</td><td>1</td><td>1</td><td>130</td><td>0.0</td><td>1</td><td>10.0</td><td>RMSprop 1e-3</td></tr><tr><td rowspan="3">Copy Memory Task</td><td>T= 500</td><td>1</td><td>50</td><td></td><td>0.25</td><td></td><td></td></tr><tr><td>T=1000</td><td>1</td><td>50</td><td>0.05</td><td>1</td><td>1</td><td>RMSprop/Adam</td></tr><tr><td>T= 2000</td><td>3</td><td>28</td><td></td><td>1</td><td></td><td></td></tr><tr><td>Music JSB Chorales</td><td>1</td><td>2</td><td>200</td><td>0.2</td><td>1</td><td>10.0</td><td>SGD/Adam</td></tr><tr><td>Music Nottingham</td><td>-</td><td>3</td><td>280</td><td>0.1</td><td>0.5</td><td>-</td><td>Adam 4e-3</td></tr><tr><td rowspan="3">Word-level LM</td><td></td><td>1</td><td>500</td><td></td><td>1</td><td>-</td><td></td></tr><tr><td>PTB</td><td>3</td><td>700</td><td>0.4</td><td>0.3</td><td>1.0</td><td>SGD 30,Emb. 700, etc.</td></tr><tr><td>Wiki-103</td><td>-</td><td>-</td><td>·</td><td>·</td><td>·</td><td>Grave et al. (2016)</td></tr><tr><td></td><td>LAMBADA</td><td>-</td><td>-</td><td>-</td><td>1</td><td>-</td><td>Grave et al. (2016)</td></tr><tr><td rowspan="2">Char-level LM</td><td>PTB</td><td></td><td>600</td><td>0.1</td><td>0.5</td><td>-</td><td>Emb. size 120</td></tr><tr><td>text8</td><td>21</td><td>1024</td><td>0.15</td><td>0.5</td><td>1</td><td>Adam 1e-2</td></tr></table>
312
+
313
+ Table 4: State of the art (SoTA) results for tasks in Section 4.
314
+
315
+ <table><tr><td rowspan=1 colspan=6>TCN VS. SoTA RESULTS</td></tr><tr><td rowspan=1 colspan=1>Task</td><td rowspan=1 colspan=1>TCN Result</td><td rowspan=1 colspan=1>Size</td><td rowspan=1 colspan=1>SoTA</td><td rowspan=1 colspan=1>Size</td><td rowspan=1 colspan=1>Model</td></tr><tr><td rowspan=1 colspan=1>Seq. MNIST (acc.)</td><td rowspan=1 colspan=1>99.0</td><td rowspan=1 colspan=1>21K</td><td rowspan=1 colspan=1>99.0</td><td rowspan=1 colspan=1>21K</td><td rowspan=1 colspan=1>Dilated GRU (Chang et al., 2017)</td></tr><tr><td rowspan=1 colspan=1>P-MNIST (acc.)</td><td rowspan=1 colspan=1>97.2</td><td rowspan=1 colspan=1>42K</td><td rowspan=1 colspan=1>95.9</td><td rowspan=1 colspan=1>42K</td><td rowspan=1 colspan=1> Zoneout (Krueger et al., 2017)</td></tr><tr><td rowspan=1 colspan=1>Adding Prob. 600 (loss)</td><td rowspan=1 colspan=1>5.8e-5</td><td rowspan=1 colspan=1>70K</td><td rowspan=1 colspan=1>5.3e-5</td><td rowspan=1 colspan=1>70K</td><td rowspan=1 colspan=1>Regularized GRU</td></tr><tr><td rowspan=1 colspan=1>Copy Memory 1000 (loss)</td><td rowspan=1 colspan=1>3.5e-5</td><td rowspan=1 colspan=1>70K</td><td rowspan=1 colspan=1>0.011</td><td rowspan=1 colspan=1>70K</td><td rowspan=1 colspan=1>EURNN (Jing et al., 2017)</td></tr><tr><td rowspan=1 colspan=1>JSB Chorales (loss)</td><td rowspan=1 colspan=1>8.10</td><td rowspan=1 colspan=1>300K</td><td rowspan=1 colspan=1>3.47</td><td rowspan=1 colspan=1>:</td><td rowspan=1 colspan=1>DBN+LSTM(Vohra et al., 2015)</td></tr><tr><td rowspan=1 colspan=1>Nottingham (loss)</td><td rowspan=1 colspan=1>3.07</td><td rowspan=1 colspan=1>1M</td><td rowspan=1 colspan=1>1.32</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>DBN+LSTM (Vohra et al., 2015)</td></tr><tr><td rowspan=1 colspan=1>Word PTB (ppl)</td><td rowspan=1 colspan=1>90.17</td><td rowspan=1 colspan=1>13M</td><td rowspan=1 colspan=1>52.8</td><td rowspan=1 colspan=1>24M</td><td rowspan=1 colspan=1>AWD-LSTM + Cont.Cache(Merity et al., 2017)</td></tr><tr><td rowspan=1 colspan=1>Word Wiki-103 (ppl)</td><td rowspan=1 colspan=1>45.19</td><td rowspan=1 colspan=1>148M</td><td rowspan=1 colspan=1>40.4</td><td rowspan=1 colspan=1>&gt;300M</td><td rowspan=1 colspan=1>Neural Cache Model (Large)(Grave et al., 2016)</td></tr><tr><td rowspan=1 colspan=1>Word LAMBADA (ppl)</td><td rowspan=1 colspan=1>1279</td><td rowspan=1 colspan=1>56M</td><td rowspan=1 colspan=1>138</td><td rowspan=1 colspan=1>&gt;100M</td><td rowspan=1 colspan=1>Neural Cache Model (Large)(Grave et al., 2016)</td></tr><tr><td rowspan=1 colspan=1>Char PTB (bpc)</td><td rowspan=1 colspan=1>1.35</td><td rowspan=1 colspan=1>3M</td><td rowspan=1 colspan=1>1.22</td><td rowspan=1 colspan=1>14M</td><td rowspan=1 colspan=1>2-LayerNorm HyperLSTM(Ha et al., 2017)</td></tr><tr><td rowspan=1 colspan=1>Char text8 (bpc)</td><td rowspan=1 colspan=1>1.45</td><td rowspan=1 colspan=1>4.6M</td><td rowspan=1 colspan=1>1.29</td><td rowspan=1 colspan=1>&gt;12M</td><td rowspan=1 colspan=1>HM-LSTM (Chung et al., 2016)</td></tr></table>
316
+
317
+ ![](images/5e61b9b3ee15df3f95a75c0ba19ebb15a423e433d11b444e7c29d44ad108a8d4.jpg)
318
+ Figure 8: Controlled experiments that examine different components of the TCN model
319
+
320
+ In this section we briefly study, via controlled experiments, the effect of filter size and residual block on the TCN’s ability to model different sequential tasks. Figure 8 shows the results of this ablative analysis. We kept the model size and the depth of the networks exactly the same within each experiment so that dilation factor is controlled. We conducted the experiment on three very different tasks: the copy memory task, permuted MNIST (P-MNIST), as well as word-level PTB language modeling.
321
+
322
+ Through these experiments, we empirically confirm that both filter sizes and residuals play important roles in TCN’s capability of modeling potentially long dependencies. In both the copy memory and the permuted MNIST task, we observed faster convergence and better result for larger filter sizes (e.g. in the copy memory task, a filter size $k \geq 3$ led to only suboptimal convergence). In word-level PTB, we find a filter size of $k = 3$ works best. This is not a complete surprise, since a size- $k$ filter on the inputs is analogous to a $k$ -gram model in language modeling.
323
+
324
+ Results of control experiments on the residual function are shown in Figure 8d, 8e and 8f. In all three scenarios, we observe that the residual stabilizes the training by bringing a faster convergence as well as better final results, compared to TCN with the same model size but no residual block.
325
+
326
+ # D EXPERIMENTS: GATING MECHANISM ON TCN
327
+
328
+ One component that has shown to be effective in adapting a TCN to language modeling is the gating mechanism within the residual block, which was used in works such as Dauphin et al. (2017). In this section, we empirically evaluate the effects of adding gated units to TCN.
329
+
330
+ We replace the ReLU within the TCN residual block with a gating mechanism, represented by an elementwise product between two convolutional layers, with one of them also passing through a sigmoid function $\sigma ( x ) ^ { 5 }$ . Prior works such as Dauphin et al. (2017) has used similar gating to control the path through which information flows in the network, and achieved great performance on language modeling tasks.
331
+
332
+ Table 5: TCN with Gating Mechanism within Residual Block.
333
+
334
+ <table><tr><td rowspan=1 colspan=3>RELU TCN VS.GATED TCN RESULTS</td></tr><tr><td rowspan=1 colspan=1>Task</td><td rowspan=1 colspan=1>TCN</td><td rowspan=1 colspan=1>TCN + Gating</td></tr><tr><td rowspan=1 colspan=1>Seq. MNIST (acc.)</td><td rowspan=1 colspan=1>99.0</td><td rowspan=1 colspan=1>99.0</td></tr><tr><td rowspan=1 colspan=1>P-MNIST (acc.)</td><td rowspan=1 colspan=1>97.2</td><td rowspan=1 colspan=1>96.9</td></tr><tr><td rowspan=1 colspan=1>Adding Prob. 600 (loss)</td><td rowspan=1 colspan=1>5.8e-5</td><td rowspan=1 colspan=1>5.6e-5</td></tr><tr><td rowspan=1 colspan=1>CopyMemory 11000 (loss)</td><td rowspan=1 colspan=1>3.5e-5</td><td rowspan=1 colspan=1>0.00508</td></tr><tr><td rowspan=1 colspan=1>JSB Chorales (loss)</td><td rowspan=1 colspan=1>8.10</td><td rowspan=1 colspan=1>8.13</td></tr><tr><td rowspan=1 colspan=1>Nottingham (loss)</td><td rowspan=1 colspan=1>3.07</td><td rowspan=1 colspan=1>3.12</td></tr><tr><td rowspan=1 colspan=1>Word PTB (ppl)</td><td rowspan=1 colspan=1>90.17</td><td rowspan=1 colspan=1>88.91</td></tr><tr><td rowspan=1 colspan=1>Char PTB (bpc)</td><td rowspan=1 colspan=1>1.35</td><td rowspan=1 colspan=1>1.343</td></tr><tr><td rowspan=1 colspan=1>Char text8 (bpc)</td><td rowspan=1 colspan=1>1.45</td><td rowspan=1 colspan=1>1.48</td></tr></table>
335
+
336
+ Through these comparisons, we notice that gating components do further improve the TCN results on certain language modeling datasets like PTB, which agrees with prior works. However, we do not observe such benefits to exist in general on sequence prediction tasks, such as on polyphonic music datasets, and those simpler benchmark tasks requiring more long-term memories. For example, on the copy memory task with $T = 1 0 0 0$ , we find that gating mechanism deteriorates the convergence of TCN to a suboptimal result that is only slightly better than random guess.
md/train/rkeS1RVtPS/rkeS1RVtPS.md ADDED
The diff for this file is too large to render. See raw diff
 
md/train/rkhlb8lCZ/rkhlb8lCZ.md ADDED
@@ -0,0 +1,303 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # WAVELET POOLING FOR CONVOLUTIONAL NEURAL NETWORKS
2
+
3
+ Travis Williams Department of Electrical Engineering North Carolina A&T State University Greensboro, NC 27410, USA tlwilli3@aggies.ncat.edu
4
+
5
+ Robert Li
6
+ Department of Electrical Engineering
7
+ North Carolina A&T State University
8
+ Greensboro, NC 27410, USA
9
+ eeli@ncat.edu
10
+
11
+ # ABSTRACT
12
+
13
+ Convolutional Neural Networks continuously advance the progress of 2D and 3D image and object classification. The steadfast usage of this algorithm requires constant evaluation and upgrading of foundational concepts to maintain progress. Network regularization techniques typically focus on convolutional layer operations, while leaving pooling layer operations without suitable options. We introduce Wavelet Pooling as another alternative to traditional neighborhood pooling. This method decomposes features into a second level decomposition, and discards the first-level subbands to reduce feature dimensions. This method addresses the overfitting problem encountered by max pooling, while reducing features in a more structurally compact manner than pooling via neighborhood regions. Experimental results on four benchmark classification datasets demonstrate our proposed method outperforms or performs comparatively with methods like max, mean, mixed, and stochastic pooling.
14
+
15
+ # 1 INTRODUCTION
16
+
17
+ Convolutional Neural Networks (CNNs) have become the standard-bearer in image and object classification (Nielsen, 2015). Due to the layer structures conforming to the shape of the inputs, CNNs consistently classify images, objects, videos, etc. at a higher accuracy rate than vector-based deep learning techniques (Nielsen, 2015). The strength of this algorithm motivates researchers to constantly evaluate and upgrade foundational concepts to continue growth and progress. The key components of CNN, the convolutional layer and pooling layer, consistently undergo modifications and innovations to elevate accuracy and efficiency of CNNs beyond previous benchmarks.
18
+
19
+ Pooling has roots in predecessors to CNN such as Neocognitron, which manual subsampling by the user occurs (Fukushima, 1979), and Cresceptron, which introduces the first max pooling operation in deep learning (Weng et al., 1992). Pooling subsamples the results of the convolutional layers, gradually reducing spatial dimensions of the data throughout the network. The benefits of this operation are to reduce parameters, increase computational efficiency, and regulate overfitting (Boureau et al., 2010).
20
+
21
+ Methods of pooling vary, with the most popular form being max pooling, and secondarily, average pooling (Nielsen, 2015; Lee et al., 2016). These forms of pooling are deterministic, efficient, and simple, but have weaknesses hindering the potential for optimal network learning (Lee et al., 2016; Yu et al., 2014). Other pooling operations, notably mixed pooling and stochastic pooling, use probabilistic approaches to correct some of the issues of the prior methods (Yu et al., 2014; Zeiler & Fergus, 2013).
22
+
23
+ However, one commonality all these pooling operations employ a neighborhood approach to subsampling, reminiscent of nearest neighbor interpolation in image processing. Neighborhood interpolation techniques perform fast, with simplicity and efficiency, but introduce artifacts such as edge halos, blurring, and aliasing (Parker et al., 1983). Minimizing discontinuities in the data are critical to aiding in network regularization, and increasing classification accuracy.
24
+
25
+ We propose a wavelet pooling algorithm that uses a second-level wavelet decomposition to subsample features. Our approach forgoes the nearest neighbor interpolation method in favor of an organic, subband method that more accurately represents the feature contents with less artifacts. We compare our proposed pooling method to max, mean, mixed, and stochastic pooling to verify its validity, and ability to produce near equal or superior results. We test these methods on benchmark image classification datasets such as Mixed National Institute of Standards and Technology (MNIST) (Lecun et al., 1998), Canadian Institute for Advanced Research (CIFAR-10) (Krizhevsky, 2009), Street House View Numbers (SHVN) (Netzer et al., 2011), and Karolinska Directed Emotional Faces (KDEF) (Lundqvist et al., 1998). We perform all simulations in MATLAB R2016b.
26
+
27
+ The rest of this paper organizes as follows: Section 2 gives the background, Section 3 describes the proposed methods, Section 4 discusses the experimental results, and Section 5 gives the summary and conclusion.
28
+
29
+ # 2 BACKGROUND
30
+
31
+ Pooling is another term for subsampling. In this layer, the dimensions of the output of the convolutional layer are condensed. The dimensionality reduction happens by summarizing a region into one neuron value, and this occurs until all neurons have been affected. The two most popular forms of pooling are max pooling and average pooling (Nielsen, 2015; Lee et al., 2016). Max pooling involves taking the maximum value of a region $R _ { i j }$ and selecting it for the condensed feature map. Average pooling involves calculating the average value of a region and selecting it for the condensed feature map. The max pooling function is expressed as:
32
+
33
+ $$
34
+ a _ { k i j } = \operatorname* { m a x } _ { ( p , q ) \in R _ { i j } } ( a _ { k p q } )
35
+ $$
36
+
37
+ While average pooling is shown by the following equation:
38
+
39
+ $$
40
+ a _ { k i j } = \frac { 1 } { | R _ { i j } | } \sum _ { ( p , q ) \in R _ { i j } } a _ { k p q }
41
+ $$
42
+
43
+ Where $a _ { k i j }$ is the output activation of the $k ^ { t h }$ feature map at $( i , j ) , a _ { k p q }$ is the input activation at $( p , q )$ within $R _ { i j }$ , and $| R _ { i j } |$ is the size of the pooling region. An illustration of both of these pooling methods is expressed in Figure 1 (Williams & Li, 2016):
44
+
45
+ <table><tr><td rowspan=1 colspan=8>Convolution Output</td></tr><tr><td rowspan=1 colspan=1>55</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>87</td><td rowspan=1 colspan=1>46</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>59</td><td rowspan=1 colspan=1>76</td><td rowspan=1 colspan=1>58</td></tr><tr><td rowspan=1 colspan=1>58</td><td rowspan=1 colspan=1>25</td><td rowspan=1 colspan=1>61</td><td rowspan=1 colspan=1>29</td><td rowspan=1 colspan=1>34</td><td rowspan=1 colspan=1>79</td><td rowspan=1 colspan=1>94</td><td rowspan=1 colspan=1>15</td></tr><tr><td rowspan=1 colspan=1>29</td><td rowspan=1 colspan=1>35</td><td rowspan=1 colspan=1>71</td><td rowspan=1 colspan=1>63</td><td rowspan=1 colspan=1>94</td><td rowspan=1 colspan=1>73</td><td rowspan=1 colspan=1>12</td><td rowspan=1 colspan=1>17</td></tr><tr><td rowspan=1 colspan=1>58</td><td rowspan=1 colspan=1>22</td><td rowspan=1 colspan=1>41</td><td rowspan=1 colspan=1>98</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>45</td><td rowspan=1 colspan=1>16</td><td rowspan=1 colspan=1>76</td></tr><tr><td rowspan=1 colspan=1>92</td><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>16</td><td rowspan=1 colspan=1>。</td><td rowspan=1 colspan=1>46</td><td rowspan=1 colspan=1>84</td><td rowspan=1 colspan=1>6</td><td rowspan=1 colspan=1>7</td></tr><tr><td rowspan=1 colspan=1>38</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>86</td><td rowspan=1 colspan=1>97</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>13</td><td rowspan=1 colspan=1>15</td><td rowspan=1 colspan=1>48</td></tr><tr><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>19</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>42</td><td rowspan=1 colspan=1>45</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>56</td></tr><tr><td rowspan=1 colspan=1>6</td><td rowspan=1 colspan=1>。</td><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>66</td><td rowspan=1 colspan=1>44</td><td rowspan=1 colspan=1>72</td><td rowspan=1 colspan=1>8</td></tr></table>
46
+
47
+ <table><tr><td rowspan=1 colspan=4>Max Pooling</td></tr><tr><td rowspan=1 colspan=1>58</td><td rowspan=1 colspan=1>87</td><td rowspan=1 colspan=1>79</td><td rowspan=1 colspan=1>94</td></tr><tr><td rowspan=1 colspan=1>58</td><td rowspan=1 colspan=1>98</td><td rowspan=1 colspan=1>94</td><td rowspan=1 colspan=1>76</td></tr><tr><td rowspan=1 colspan=1>92</td><td rowspan=1 colspan=1>97</td><td rowspan=1 colspan=1>84</td><td rowspan=1 colspan=1>48</td></tr><tr><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>42</td><td rowspan=1 colspan=1>66</td><td rowspan=1 colspan=1>72</td></tr></table>
48
+
49
+ Mean Pooling
50
+ Figure 1: Example of Max & Average Pooling with Stride of 2
51
+
52
+ <table><tr><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>56</td><td rowspan=1 colspan=1>51</td><td rowspan=1 colspan=1>61</td></tr><tr><td rowspan=1 colspan=1>36</td><td rowspan=1 colspan=1>68</td><td rowspan=1 colspan=1>61</td><td rowspan=1 colspan=1>30</td></tr><tr><td rowspan=1 colspan=1>35</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>52</td><td rowspan=1 colspan=1>19</td></tr><tr><td rowspan=1 colspan=1>14</td><td rowspan=1 colspan=1>16</td><td rowspan=1 colspan=1>39</td><td rowspan=1 colspan=1>34</td></tr></table>
53
+
54
+ While max and average pooling both are effective, simple methods, they also have shortcomings. Max pooling, depending on the data, can erase details from an image (Yu et al., 2014; Zeiler & Fergus, 2013). This happens if the main details have less intensity than the insignificant details. In addition, max pooling commonly overfits training data (Yu et al., 2014; Zeiler & Fergus, 2013). Average pooling, depending on the data, can dilute pertinent details from an image. The averaging of data with values much lower than significant details causes this action (Yu et al., 2014; Zeiler & Fergus, 2013). Figure 2 illustrates these shortcomings using the toy image example:
55
+
56
+ To combat these issues, researchers have created probabilistic pooling methods. Mixed pooling combines max and average pooling by randomly selecting one method over the other during training (Yu et al., 2014). There is no set way to perform mixed pooling. This method is applied arbitrarily in three different ways (1) for all features within a layer, (2) mixed between features within a layer, or (3) mixed between regions for different features within a layer (Lee et al., 2016; Yu et al., 2014). Mixed pooling is shown in the following equation:
57
+
58
+ ![](images/6836bbc3d6044d3b5f1a5e0d927f4633a7a7e6ef1b5ae5384f1dd2e7b57d9e59.jpg)
59
+ Figure 2: Shortcomings of Max & Average Pooling using Toy Image
60
+
61
+ $$
62
+ a _ { k i j } = \lambda \cdot \operatorname* { m a x } _ { ( p , q ) \in R _ { i j } } ( a _ { k p q } ) + ( 1 - \lambda ) \cdot \frac { 1 } { | R _ { i j } | } \sum _ { ( p , q ) \in R _ { i j } } a _ { k p q }
63
+ $$
64
+
65
+ where $\lambda$ is a random value 0 or 1, indicating max or average pooling for a particular region/feature/layer.
66
+
67
+ Another probabilistic pooling method, called stochastic pooling, improves upon max pooling by randomly sampling from neighborhood regions based on the probability values of each activation (Zeiler & Fergus, 2013). These probabilities $p$ for each region are calculated by normalizing the activations within the region:
68
+
69
+ $$
70
+ p _ { p q } = \frac { a _ { p q } } { \sum _ { ( p , q ) \in R _ { i j } } a _ { p q } }
71
+ $$
72
+
73
+ The pooled activation is sampled from a multinomial distribution based on $p$ to pick a location $l$ within the region (Zeiler & Fergus, 2013). The process is captured in the following equation (Zeiler & Fergus, 2013):
74
+
75
+ $$
76
+ a _ { k i j } = a _ { l } \quad w h e r e \quad l \sim P ( p _ { 1 } , . . . , p _ { | R _ { i j } | } )
77
+ $$
78
+
79
+ ![](images/2ca0fb375b792ba9a9b71febe50ad09430c488f886e3669eda98dc3d1a51f74a.jpg)
80
+ Figure 3 displays a visual example of stochastic pooling on a $3 { \bf x } 3$ region:
81
+ Figure 3: Stochastic Pooling Example
82
+
83
+ In Figure 3, a region of activations are shown, and in the adjacent region, their corresponding probabilities based on Equation 4. In any given region, the activations with the highest probabilities have the higher chance of selection. However, any activation can be chosen. In this example, the stochastic pooling method selects the midrange activation with a probability of $13 \%$ . By being based off probability, and not deterministic, stochastic pooling avoids the shortcomings of max and average pooling, while enjoying some of the advantages of max pooling (Zeiler & Fergus, 2013).
84
+
85
+ # 3 PROPOSED METHOD
86
+
87
+ The previously highlighted pooling methods use neighborhoods to subsample, almost identical to nearest neighbor interpolation. Previous studies explore the possibilities of wavelets in image interpolation versus traditional methods (Dumic et al., 2007). Our proposed pooling method uses wavelets to reduce the dimensions of the feature maps. We propose using the wavelet transform to minimize artifacts resulting from neighborhood reduction (Parker et al., 1983). We postulate that our approach, which discards the first-order subbands, more organically captures the data compression. This organic reduction therefore lessens the creation of jagged edges and other artifacts that may impede correct image classification.
88
+
89
+ # 3.1 FORWARD PROPAGATION
90
+
91
+ The proposed wavelet pooling scheme pools features by performing a 2nd order decomposition in the wavelet domain according to the fast wavelet transform (FWT) (Mallat, 1989; Nason & Silverman, 1995; Strang & Nguyen, 1996; Burrus et al., 1998), which is a more efficient implementation of the two-dimensional discrete wavelet transform (DWT) as follows (Chui, 1992; Strang & Strela, 1995; Rieder et al., 1994):
92
+
93
+ $$
94
+ W _ { \varphi } [ j + 1 , k ] = h _ { \varphi } [ - n ] * W _ { \varphi } [ j , n ] | _ { n = 2 k , k \le 0 }
95
+ $$
96
+
97
+ $$
98
+ W _ { \psi } [ j + 1 , k ] = h _ { \psi } [ - n ] * W _ { \psi } [ j , n ] | _ { n = 2 k , k \le 0 }
99
+ $$
100
+
101
+ where $\varphi$ is the approximation function, and $\psi$ is the detail function, $W _ { \varphi }$ , $W _ { \psi }$ are called approximation and detail coefficients. $h _ { \varphi } [ - n ]$ and $h _ { \psi } [ - n ]$ are the time reversed scaling and wavelet vectors, (n) represents the sample in the vector, while (j) denotes the resolution level. When using the FWT on images, we apply it twice (once on the rows, then again on the columns). By doing this in combination, we obtain our detail subbands (LH, HL, HH) at each decomposition level, and our approximation subband (LL) for the highest decomposition level.
102
+
103
+ After performing the 2nd order decomposition, we reconstruct the image features, but only using the 2nd order wavelet subbands. This method pools the image features by a factor of 2 using the inverse FWT (IFWT) (Mallat, 1989; Nason & Silverman, 1995; Strang & Nguyen, 1996; Burrus et al., 1998), which is based off of the inverse DWT (IDWT) (Chui, 1992; Strang & Strela, 1995; Rieder et al., 1994):
104
+
105
+ $$
106
+ W _ { \varphi } [ j , k ] = h _ { \varphi } [ - n ] * W _ { \varphi } [ j + 1 , n ] + h _ { \psi } [ - n ] * W _ { \psi } [ j + 1 , n ] | _ { n = { \frac { k } { 2 } } , k \leq 0 }
107
+ $$
108
+
109
+ ![](images/4f3d158ff784108d752855ef0f3ac75a0287d53a4f9a1c33a8ce754c00e1ff07.jpg)
110
+ Figure 4 gives an illustration of the algorithm for the forward propagation of wavelet pooling:
111
+ Figure 4: Wavelet Pooling Forward Propagation Algorithm
112
+
113
+ # 3.2 BACKPROPAGATION
114
+
115
+ The proposed wavelet pooling algorithm performs backpropagation by reversing the process of its forward propagation. First, the image feature being back propagated undergoes $1 ^ { s t }$ order wavelet decomposition. After decomposition, the detail coefficient subbands upsample by a factor of 2 to create a new $1 ^ { s t }$ level decomposition. The initial decomposition then becomes the $2 ^ { n d }$ level decomposition. Finally, this new $2 ^ { n d }$ order wavelet decomposition reconstructs the image feature for further backpropagation using the IDWT. Figure 5 details the backpropagation algorithm of wavelet pooling:
116
+
117
+ ![](images/67febc9a06058a1f18b93c877fafd23b66b72930b4b25034992e16feaa33623b.jpg)
118
+ Figure 5: Wavelet Pooling Backpropagation Algorithm
119
+
120
+ # 4 RESULTS AND DISCUSSION
121
+
122
+ All CNN experiments use MatConvNet (Vedaldi & Lenc, 2015). All training uses stochastic gradient descent (Bottou, 2010). For our proposed method, the wavelet basis is the Haar wavelet, mainly for its even, square subbands. All experiments are run on a 64-bit operating system, with an Intel Core i7-6800k CPU $\textcircled { a } ~ 3 . 4 0 ~ \mathrm { G H z }$ processor, with 64.0 GB of RAM. We utilize two GeForce Titan X Pascal GPUs with 12 GB of video memory for all training. All CNN structures except for MNIST use a network loosely based on Zeilers network (Zeiler & Fergus, 2013). We repeat the experiments with Dropout (Srivastava, 2013) and replace Local Response Normalization (Krizhevsky, 2009) with Batch Normalization (Ioffe & Szegedy, 2015) for CIFAR-10 and SHVN (Dropout only) to examine how these regularization techniques change the pooling results. To test the effectiveness of each pooling method on each dataset, we solely pool with that method for all pooling layers in that network. All pooling methods use a $2 \mathbf { x } 2$ window for an even comparison to the proposed method. Figure 6 gives a selection of each of the datasets.
123
+
124
+ # 4.1 MNIST
125
+
126
+ The network architecture is based on the example MNIST structure from MatConvNet, with batch normalization inserted. All other parameters are the same. Figure 7 shows our network structure for the MNIST experiments:
127
+
128
+ ![](images/ed5f7af51d677a75f6562aab9d4777531ec7fc85c14ca7ba987adc63d00a60a6.jpg)
129
+ Figure 6: Selection of Image Datasets
130
+
131
+ ![](images/95c98f5bb8cd108027f9a420c1a864090ebfbba981f7d03348eb869f3d9d69e0.jpg)
132
+ Figure 7: CNN MNIST Structure Block Diagram
133
+
134
+ The input training data and test data come from the MNIST database of handwritten digits. The full training set of 60,000 images is used, as well as the full testing set of 10,000 images. Table 1 shows our proposed method outperforms all methods. Given the small number of epochs, max pooling is the only method to start to overfit the data during training. Mixed and stochastic pooling show a rocky trajectory, but do not overfit. Average and wavelet pooling show a smoother descent in learning and error reduction. Figure 8 shows the energy of each method per epoch.
135
+
136
+ ![](images/deb898ce72595fd7b606ef3ff92190e8d12d0e163a108fe312e27b2c0706e6b5.jpg)
137
+ Figure 8: MNIST Pooling Method Energy Performance of Training & Validation Sets
138
+
139
+ Table 1 shows the accuracy of each method:
140
+
141
+ Table 1: MNIST Performance of Pooling Methods
142
+
143
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Average</td><td rowspan=1 colspan=1>Max</td><td rowspan=1 colspan=1>Mixed</td><td rowspan=1 colspan=1>Stochastic</td><td rowspan=1 colspan=1>Wavelet</td></tr><tr><td rowspan=1 colspan=1>Accuracy (%)</td><td rowspan=1 colspan=1>98.72</td><td rowspan=1 colspan=1>98.80</td><td rowspan=1 colspan=1>98.86</td><td rowspan=1 colspan=1>98.90</td><td rowspan=1 colspan=1>99.01</td></tr></table>
144
+
145
+ # 4.2 CIFAR-10
146
+
147
+ We run two sets of experiments with the pooling methods. The first is a regular network structure with no dropout layers. We use this network to observe each pooling method without extra regularization. The second uses dropout and batch normalization, and performs over 30 more epochs to observe the effects of these changes. Figure 9 shows our network structure for the CIFAR-10 experiments:
148
+
149
+ The input training and test data come from the CIFAR-10 dataset. The full training set of 50,000 images is used, as well as the full testing set of 10,000 images. For both cases, with no dropout, and with dropout, Table 2 and Table 3 show our proposed method has the second highest accuracy. Max pooling overfits fairly quickly, while wavelet pooling resists overfitting. The change in learning rate prevents our method from overfitting, and it continues to show a slower propensity for learning. Mixed and stochastic pooling maintain a consistent progression of learning, and their validation sets trend at a similar, but better rate than our proposed method. Average pooling shows the smoothest descent in learning and error reduction, especially in the validation set. Figure 10 shows the energy of each method per epoch.
150
+
151
+ ![](images/eab1af088fdeeed9fe5e1fdc17353c47fe3cad910a704148ae6af01cf8847a1f.jpg)
152
+ Figure 9: CNN CIFAR-10 Structure Block Diagram
153
+
154
+ ![](images/8343d05229f091b0ccaf3b71410317e193a25d016e7d738194f7228e11c02b31.jpg)
155
+ Figure 10: CIFAR-10 Pooling Method Energy Performance of Training & Validation Sets
156
+
157
+ Tables 2 and 3 show the accuracy of each method:
158
+
159
+ Table 2: CIFAR-10 Performance of Pooling Methods
160
+
161
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Average</td><td rowspan=1 colspan=1>Max</td><td rowspan=1 colspan=1>Mixed</td><td rowspan=1 colspan=1>Stochastic</td><td rowspan=1 colspan=1>Wavelet</td></tr><tr><td rowspan=1 colspan=1>Accuracy (%)</td><td rowspan=1 colspan=1>76.51</td><td rowspan=1 colspan=1>71.42</td><td rowspan=1 colspan=1>73.77</td><td rowspan=1 colspan=1>73.03</td><td rowspan=1 colspan=1>74.42</td></tr></table>
162
+
163
+ Table 3: CIFAR-10 Performance of Pooling Methods $^ +$ Dropout
164
+
165
+ <table><tr><td></td><td>Average</td><td>Max</td><td>Mixed</td><td>Stochastic</td><td>Wavelet</td></tr><tr><td>Accuracy (%)</td><td>81.15</td><td>80.30</td><td>79.21</td><td>80.09</td><td>80.28</td></tr></table>
166
+
167
+ # 4.3 SHVN
168
+
169
+ We run two sets of experiments with the pooling methods. The first is a regular network structure with no dropout layers. We use this network to observe each pooling method without extra regularization. The second uses dropout to observe the effects of this change. Figure 11 shows our network structure for the SHVN experiments:
170
+
171
+ The input training and test data come from the SHVN dataset. For the case with no dropout, we use 55,000 images from the training set. For the case with dropout, we use the full training set of 73,257 images, a validation set of 30,000 images we extract from the extra training set of 531,131 images, as well as the full testing set of 26,032 images. For both cases, with no dropout, and with dropout,
172
+
173
+ ![](images/b3a9dba3655fb309e5a32d14191f972a1e36fd28e5668c13d8d56ef140140af0.jpg)
174
+ Figure 11: CNN SHVN Structure Block Diagram
175
+
176
+ Table 4 and Table 5 show our proposed method has the second lowest accuracy. Max and wavelet pooling both slightly overfit the data. Our method follows the path of max pooling, but performs slightly better in maintaining some stability. Mixed, stochastic, and average pooling maintain a slow progression of learning, and their validation sets trend at near identical rates. Figure 12 shows the energy of each method per epoch.
177
+
178
+ ![](images/5cc6b495708b04e274769b4f7b6e0755d6376f1b03d688956c266d1d52014244.jpg)
179
+ Figure 12: SHVN Pooling Method Energy Performance of Training & Validation Sets
180
+
181
+ Tables 4 and 5 shows the accuracy of each method:
182
+
183
+ Table 4: SHVN Performance of Pooling Methods
184
+
185
+ <table><tr><td></td><td>Average</td><td>Max</td><td>Mixed</td><td>Stochastic</td><td>Wavelet</td></tr><tr><td>Accuracy (%)</td><td>89.83</td><td>88.09</td><td>89.25</td><td>89.97</td><td>88.51</td></tr></table>
186
+
187
+ Table 5: SHVN Performance of Pooling Methods $^ +$ Dropout
188
+
189
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Average</td><td rowspan=1 colspan=1>Max</td><td rowspan=1 colspan=1>Mixed</td><td rowspan=1 colspan=1>Stochastic</td><td rowspan=1 colspan=1>Wavelet</td></tr><tr><td rowspan=1 colspan=1>Accuracy (%)</td><td rowspan=1 colspan=1>92.80</td><td rowspan=1 colspan=1>92.18</td><td rowspan=1 colspan=1>92.13</td><td rowspan=1 colspan=1>91.04</td><td rowspan=1 colspan=1>91.10</td></tr></table>
190
+
191
+ # 4.4 KDEF
192
+
193
+ We run one set of experiments with the pooling methods that includes dropout. Figure 13 shows our network structure for the KDEF experiments:
194
+
195
+ The input training and test data come from the KDEF dataset. This dataset contains 4,900 images of 35 people displaying seven basic emotions (afraid, angry, disgusted, happy, neutral, sad, and surprised) using facial expressions. They display emotions at five poses (full left and right profiles, half left and right profiles, and straight).
196
+
197
+ ![](images/5313b03d57e276b0ac92f5d863296f151505f94fa4cade18ea3fc474dc79355c.jpg)
198
+ Figure 13: CNN KDEF Structure Block Diagram
199
+
200
+ This dataset contains a few errors that we fix (missing or corrupted images, uncropped images, etc.). All of the missing images are at angles of -90, -45, 45, or 90 degrees. We fix the missing and corrupt images by mirroring their counterparts in MATLAB and adding them back to the dataset. We manually crop the images that need to match the dimensions set by the creators $( 7 6 2 \mathrm { ~ x ~ } 5 6 2 )$ . KDEF does not designate a training or test data set. We shuffle the data and separate 3,900 images as training data, and 1,000 images as test data. We resize the images to $1 2 8 \mathrm { x } 1 2 8$ because of memory and time constraints.
201
+
202
+ The dropout layers regulate the network and maintain stability in spite of some pooling methods known to overfit. Table 6 shows our proposed method has the second highest accuracy. Max pooling eventually overfits, while wavelet pooling resists overfitting. Average and mixed pooling resist overfitting, but are unstable for most of the learning. Stochastic pooling maintains a consistent progression of learning. Wavelet pooling also follows a smoother, consistent progression of learning. Figure 14 shows the energy of each method per epoch.
203
+
204
+ ![](images/537316cbfa6f3889562dfa12841eb7528f683ecceedd841395fefc3334bf1b8a.jpg)
205
+ Figure 14: KDEF Pooling Method Energy Performance of Training & Validation Sets
206
+
207
+ Table 6 shows the accuracy of each method:
208
+
209
+ Table 6: KDEF Performance of Pooling Methods $^ +$ Dropout
210
+
211
+ <table><tr><td></td><td>Average</td><td>Max</td><td>Mixed</td><td>Stochastic</td><td>Wavelet</td></tr><tr><td>Accuracy (%)</td><td>76.5</td><td>75.6</td><td>72.6</td><td>72.7</td><td>75.9</td></tr></table>
212
+
213
+ # 4.5 COMPUTATIONAL COMPLEXITY
214
+
215
+ Our construction and implementation of wavelet pooling is not efficient. We present this proposed methods as a proof-of-concept, to show its potential and validity, and also to be open to massive improvements. The main area of improvement is computational efficiency. As a proof-of-concept, the code written to implement this method is not at its peak form. Additionally, we did not have the time, space, or resources to optimize the code. We view the accuracy results and novelty as a starting point to spawn improvements, both from our own research as well as other researchers.
216
+
217
+ We calculate efficiency in terms of mathematical operations (multiplications, additions, logical, etc.) that each method utilizes to complete its algorithm. For max pooling, we calculate operations based on the worst-case scenarios for each neighborhood in finding the maximum value. For average pooling, we calculate the number of additions and division for each neighborhood. Mixed pooling is the mean value of both average and max pooling. We calculate operations for stochastic pooling by counting the number of mathematical operations as well as the random selection of the values based on probability (Roulette Wheel Selection). For wavelet pooling, we calculate the number of operations for each subband at each level, in both decomposition and reconstruction.
218
+
219
+ Table 7 shows the number of mathematical operations for one image in forward propagation. This table shows that for all methods, average pooling has the least number of computations, followed by mixed pooling, with max pooling not far behind. Stochastic pooling is the least computationally efficient pooling method out of the neighborhood-based methods. It uses about $3 \mathbf { x }$ more mathematical operations than average pooling, the most computationally efficient.
220
+
221
+ However, wavelet pooling by far is the least computationally efficient method, using 54 to $2 1 3 \mathrm { x }$ more mathematical operations than average pooling. This is partially due to the implementation of the subband coding, which did not implement multidimensional decomposition and reconstruction.
222
+
223
+ Table 7: Number of Mathematical Operations for Each Method According to Dataset
224
+
225
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>MNIST</td><td rowspan=1 colspan=1>CIFAR-10</td><td rowspan=1 colspan=1>SHVN</td><td rowspan=1 colspan=1>KDEF</td></tr><tr><td rowspan=1 colspan=1>Max</td><td rowspan=1 colspan=1>6.2K</td><td rowspan=1 colspan=1>13K</td><td rowspan=1 colspan=1>26K</td><td rowspan=1 colspan=1>50K</td></tr><tr><td rowspan=1 colspan=1>Avg</td><td rowspan=1 colspan=1>3.5K</td><td rowspan=1 colspan=1>7.4K</td><td rowspan=1 colspan=1>15K</td><td rowspan=1 colspan=1>29K</td></tr><tr><td rowspan=1 colspan=1>Mix</td><td rowspan=1 colspan=1>4.8K</td><td rowspan=1 colspan=1>10K</td><td rowspan=1 colspan=1>20K</td><td rowspan=1 colspan=1>40K</td></tr><tr><td rowspan=1 colspan=1>Stoch</td><td rowspan=1 colspan=1>10.6K</td><td rowspan=1 colspan=1>22K</td><td rowspan=1 colspan=1>45K</td><td rowspan=1 colspan=1>86K</td></tr><tr><td rowspan=1 colspan=1>Wav</td><td rowspan=1 colspan=1>110K</td><td rowspan=1 colspan=1>405K</td><td rowspan=1 colspan=1>810K</td><td rowspan=1 colspan=1>6.2M</td></tr></table>
226
+
227
+ Nonetheless, by implementing our method through good coding practices (vectorization, architecture, etc.), GPUs, and an improved FTW algorithm, this method can prove to be a viable option. There exists a few improvements to the FTW algorithm that utilize multidimensional wavelets (Karlsson & Vetterli, 1988; Weeks & Bayoumi, 1998), lifting (Valens, 1999), parallelization Holmstrom (1995), as well as other methods that boast of improving the efficiency in speed and memory ¨ (Oliver & Malumbres, 2008; Khoromskij & Miao, 2014; Kopenkov, 2008)
228
+
229
+ # 5 CONCLUSION
230
+
231
+ We prove wavelet pooling has potential to equal or eclipse some of the traditional methods currently utilized in CNNs. Our proposed method outperforms all others in the MNIST dataset, outperforms all but one in the CIFAR-10 and KDEF datasets, and performs within respectable ranges of the pooling methods that outdo it in the SHVN dataset. The addition of dropout and batch normalization show our proposed methods response to network regularization. Like the non-dropout cases, it outperforms all but one in both the CIFAR- $1 0 ~ \&$ KDEF datasets, and performs within respectable ranges of the pooling methods that outdo it in the SHVN dataset. Our results confirm previous studies proving that no one pooling method is superior, but some perform better than others depending on the dataset and network structure Boureau et al. (2010); Lee et al. (2016). Furthermore, many networks alternate between different pooling methods to maximize the effectiveness of each method.
232
+
233
+ Future work and improvements in this area could be to vary the wavelet basis to explore which basis performs best for the pooling. Altering the upsampling and downsampling factors in the decomposition and reconstruction can lead to better image feature reductions outside of the $2 \mathbf { x } 2$ scale. Retention of the subbands we discard for the backpropagation could lead to higher accuracies and fewer errors. Improving the method of FTW we use could greatly increase computational efficiency. Finally, analyzing the structural similarity (SSIM) of wavelet pooling versus other methods could further prove the vitality of using our approach.
234
+
235
+ # ACKNOWLEDGMENTS
236
+
237
+ This research is supported by the Title III HBGI PhD Fellowship grant from the U.S. Department of Education.
238
+
239
+ # REFERENCES
240
+
241
+ Leon Bottou. Large–scale machine learning with stochastic gradient descent. In ´ Proceedings of COMPSTAT 2010, pp. 177–186. Springer, 2010.
242
+
243
+ Y-Lan Boureau, Jean Ponce, and Yann Lecun. A theoretical analysis of feature pooling in visual recognition. In 27TH INTERNATIONAL CONFERENCE ON MACHINE LEARNING, HAIFA, ISRAEL, 2010.
244
+
245
+ C Sidney Burrus, Ramesh A Gopinath, Haitao Guo, Jan E Odegard, and Ivan W Selesnick. Introduction to wavelets and wavelet transforms: a primer, volume 1. Prentice hall New Jersey, 1998.
246
+
247
+ C. K. Chui. An Introduction to Wavelets. New York: Academic Press, 1992.
248
+
249
+ Emil Dumic, Sonja Grgic, and Mislav Grgic. The use of wavelets in image interpolation: possibilities and limitations. RADIOENGINEERING-PRAGUE-, 16(4):101, 2007.
250
+
251
+ K Fukushima. Neural network model for a mechanism of pattern recognition unaffected by shift in position Neocognitron. Trans. IECE, J62-A(10):658–665, 1979.
252
+
253
+ Mats Holmstrom. Parallelizing the fast wavelet transform. ¨ Parallel Computing, 21(11):1837–1848, 1995.
254
+
255
+ Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International Conference on Machine Learning, pp. 448–456, 2015.
256
+
257
+ Gunnar Karlsson and Martin Vetterli. Three dimensional sub-band coding of video. In Acoustics, Speech, and Signal Processing, 1988. ICASSP-88., 1988 International Conference on, pp. 1100– 1103. IEEE, 1988.
258
+
259
+ Boris N Khoromskij and Sentao Miao. Superfast wavelet transform using quantics-tt approximation. i. application to haar wavelets. Computational Methods in Applied Mathematics, 14(4):537–553, 2014.
260
+
261
+ VN Kopenkov. Efficient algorithms of local discrete wavelet transform with haar-like bases. Pattern Recognition and Image Analysis, 18(4):654–661, 2008.
262
+
263
+ Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.
264
+
265
+ Yann Lecun, Lon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. In Proceedings of the IEEE, pp. 2278–2324, 1998.
266
+
267
+ Chen-Yu Lee, Patrick W. Gallagher, and Zhuowen Tu. Generalizing pooling functions in convolutional neural networks: Mixed, gated, and tree. In Proceedings of the 19th International Conference on Artificial Intelligence and Statistics, pp. 464–472, 2016.
268
+
269
+ Daniel Lundqvist, Anders Flykt, and Arne Ohman. The karolinska directed emotional faces (kdef). ¨ CD ROM from Department of Clinical Neuroscience, Psychology section, Karolinska Institutet, 1998.
270
+
271
+ Stephane G Mallat. A theory for multiresolution signal decomposition: the wavelet representation. IEEE transactions on pattern analysis and machine intelligence, 11(7):674–693, 1989.
272
+
273
+ Guy P Nason and Bernard W Silverman. The stationary wavelet transform and some statistical applications. In Wavelets and statistics, pp. 281–299. Springer, 1995.
274
+
275
+ Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. In NIPS Workshop on Deep Learning and Unsupervised Feature Learning, 2011.
276
+
277
+ Michael A. Nielsen. Neural Networks and Deep Learning. Determination Press, 2015.
278
+
279
+ Jose Oliver and Manuel Perez Malumbres. On the design of fast wavelet transform algorithms with low memory requirements. IEEE Transactions on Circuits and Systems for Video Technology, 18 (2):237–248, 2008.
280
+
281
+ J. Anthony Parker, Robert V. Kenyon, and Donald E. Troxel. Comparison of interpolating methods for image resampling. IEEE Transactions on Medical Imaging, 2(1):31–39, 1983.
282
+
283
+ Peter Rieder, Jiirgen Gotze, and Josef A Nossek. Multiwavelet transforms based on several scaling functions. In Proceedings of the IEEE–SP International Symposium on Time–Frequency and Time–Scale Analysis, pp. 393–396. IEEE, 1994.
284
+
285
+ Nitish Srivastava. Improving neural networks with dropout. Master’s thesis, University of Toronto, 2013.
286
+
287
+ Gilbert Strang and Truong Nguyen. Wavelets and filter banks. SIAM, 1996.
288
+
289
+ Gilbert Strang and Vasily Strela. Short wavelets and matrix dilation equations. IEEE Transactions on Signal Processing, 43(1):108–115, 1995.
290
+
291
+ C Valens. The fast lifting wavelet transform. A tutorial, 1999.
292
+
293
+ Andrea Vedaldi and Karel Lenc. Matconvnet: Convolutional neural networks for matlab. In Proceedings of the 23rd ACM international conference on Multimedia, pp. 689–692. ACM, 2015.
294
+
295
+ Michael Weeks and Magdy Bayoumi. 3d discrete wavelet transform architectures. In Circuits and Systems, 1998. ISCAS’98. Proceedings of the 1998 IEEE International Symposium on, volume 4, pp. 57–60. IEEE, 1998.
296
+
297
+ Juyang Weng, Narendra Ahuja, and Thomas S Huang. Cresceptron: a self-organizing neural network which grows adaptively. In International Joint Conference on Neural Networks (IJCNN), volume 1, pp. 576–581. IEEE, 1992.
298
+
299
+ Travis Williams and Robert Li. Advanced image classification using wavelets and convolutional neural networks. In 2016 15th IEEE International Conference on Machine Learning and Applications (ICMLA), pp. 233–239, 2016.
300
+
301
+ Dingjun Yu, Hanli Wang, Peiqiu Chen, and Zhihua Wei. Mixed Pooling for Convolutional Neural Networks, pp. 364–375. Springer International Publishing, 2014.
302
+
303
+ Matthew Zeiler and Robert Fergus. Stochastic pooling for regularization of deep convolutional neural networks. In Proceedings of the International Conference on Learning Representation (ICLR), 2013.
md/train/rylrdxHFDr/rylrdxHFDr.md ADDED
@@ -0,0 +1,442 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # STATE ALIGNMENT-BASED IMITATION LEARNING
2
+
3
+ Fangchen Liu Zhan Ling Tongzhou Mu Hao Su
4
+
5
+ University of California San Diego La Jolla, CA 92093, USA {fliu,z6ling,t3mu,haosu}@eng.ucsd.edu
6
+
7
+ # ABSTRACT
8
+
9
+ Consider an imitation learning problem that the imitator and the expert have different dynamics models. Most of the current imitation learning methods fail because they focus on imitating actions. We propose a novel state alignment based imitation learning method to train the imitator to follow the state sequences in expert demonstrations as much as possible. The state alignment comes from both local and global perspectives and we combine them into a reinforcement learning framework by a regularized policy update objective. We show the superiority of our method on standard imitation learning settings and imitation learning settings where the expert and imitator have different dynamics models.
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ Learning from demonstrations (imitation learning, abbr. as IL) is a basic strategy to train agents for solving complicated tasks. Imitation learning methods can be generally divided into two categories: behavior cloning (BC) and inverse reinforcement learning (IRL). Behavior cloning (Ross et al., 2011b) formulates a supervised learning problem to learn a policy that maps states to actions using demonstration trajectories. Inverse reinforcement learning (Russell, 1998; $\mathrm { N g }$ et al., 2000) tries to find a proper reward function that can induce the given demonstration trajectories. GAIL (Ho & Ermon, 2016) and its variants (Fu et al.; Qureshi et al., 2018; Xiao et al., 2019) are the recently proposed IRL-based methods, which uses a GAN-based reward to align the distribution of stateaction pairs between the expert and the imitator.
14
+
15
+ Although state-of-the-art BC and IRL methods have demonstrated compelling performance in standard imitation learning settings, e.g. control tasks (Ho & Ermon, 2016; Fu et al.; Qureshi et al., 2018; Xiao et al., 2019) and video games (Aytar et al., 2018b), these approaches are developed based on a strong assumption: the expert and the imitator share the same dynamics model; specifically, they have the same action space, and any feasible state-action pair leads to the same next state in probability for both agents. The assumption brings severe limitation in practical scenarios: Imagine that a robot with a low speed limit navigates through a maze by imitating another robot which moves fast, then, it is impossible for the slow robot to execute the exact actions as the fast robot. However, the demonstration from the fast robot should still be useful because it shows the path to go through the maze.
16
+
17
+ We are interested in the imitation learning problem under a relaxed assumption: Given an imitator that shares the same state space with the expert but their dynamics may be different, we train the imitator to follow the state sequence in expert demonstrations as much as possible. This is a more general formulation since it poses fewer requirements on the experts and makes demonstration collection easier. Due to the dynamics mismatch, the imitator becomes more likely to deviate from the demonstrations compared with the traditional imitation learning setting. Therefore, it is very important that the imitator should be able to resume to the demonstration trajectory by itself. Note that neither BC-based methods nor GAIL-based IRL methods have learned to handle dynamics misalignment and deviation correction.
18
+
19
+ To address the issues, we propose a novel approach with four main features: 1) State-based. Compared to the majority of literature in imitation learning, our approach is state-based rather than action-based. Not like BC and IRL that essentially match state-action pairs between the expert and the imitator, we only match states. An inverse model of the imitator dynamics is learned to recover the action; 2) Deviation Correction. A state-based $\beta$ -VAE (Higgins et al., 2017) is learned as the prior for the next state to visit. Compared with ordinary behavior cloning, this VAE-based next state predictor can advise the imitator to return to the demonstration trajectory when it deviates. The robustness benefits from VAE’s latent stochastic sampling; 3) Global State Alignment. While the VAE can help the agent to correct its trajectory to some extent, the agent may still occasionally enter states that are far away from demonstrations, where the VAE has no clue how to correct it. So we have to add a global constraint to align the states in demonstration and imitation. Inspired by GAIL that uses reward to align the distribution of state-action pairs, we also formulate an IRL problem whose maximal cumulative reward is the Wasserstein Distance between states of demonstration and imitation. Note that we choose not to involve state-action pairs as in GAIL(Ho & Ermon, 2016), or state-state pairs as in an observation-based GAIL (Torabi et al., 2018a), because our state-only formulation imposes weaker constraints than the two above options, thus providing more flexibility to handle different agent dynamics; 4) Regularized Policy Update. We combine the prior for next state learned from VAE and the Wasserstein distance-based global constraint from IRL in a unified framework, by imposing a Kullback-Leibler divergence based regularizer to the policy update in the Proximal Policy Optimization algorithm.
20
+
21
+ To empirically justify our ideas, we conduct experiments in two different settings. We first show that our approach can achieve similar or better results on the standard imitation learning setting, which assumes the same dynamics between the expert and the imitator. We then evaluate our approach in the more challenging setting that the dynamics of the expert and the imitator are different. In a number of control tasks, we either change the physics properties of the imitators or cripple them by changing their geometries. Existing approaches either fail or can only achieve very low rewards, but our approach can still exhibit decent performance. Finally, we show that even for imitation across agents of completely different actuators, it is still possible for the state-alignment based method to work. Surprisingly, a point mass and an ant in MuJoCo (Todorov et al., 2012) can imitate each other to navigate in a maze environment.
22
+
23
+ Our contributions can be summarized as follows:
24
+
25
+ • Propose to use a state alignment based method in the imitation learning problems where the expert’s and the imitator’s dynamics are different.
26
+ • Propose a local state alignment method based on $\beta$ -VAE and a global state alignment method based on Wasserstein distance. Combine the local alignment and global alignment components into a reinforcement learning framework by a regularized policy update objective.
27
+
28
+ # 2 RELATED WORK
29
+
30
+ Imitation learning is widely used in solving complicated tasks where pure reinforcement learning might suffer from high sample complexity, like robotics control (Le et al., 2017; Ye & Alterovitz, 2017; Pathak et al., 2018), autonomous vehicle (Fu et al.; Pomerleau, 1989), and playing video game (Hester et al., 2018; Pohlen et al., 2018; Aytar et al., 2018a). Behavioral cloning (Bain & Sommut, 1999) is a straight-forward method to learn a policy in a supervised way. However, behavioral cloning suffers from the problem of compounding errors as shown by (Ross & Bagnell, 2010), and this can be somewhat alleviated by interactive learning, such as DAGGER (Ross et al., 2011b). Another important line in imitation learning is inverse reinforcement learning (Russell, 1998; Ng et al., 2000; Abbeel & Ng, 2004; Ziebart et al., 2008; Fu et al.), which finds a cost function under which the expert is uniquely optimal.
31
+
32
+ Since IRL can be connected to min-max formulations, works like GAIL, SAM (Ho & Ermon, 2016; Blonde & Kalousis, 2018) utilize this to directly recover policies. Its connections with GANs (Good- ´ fellow et al., 2014) also lead to $f$ -divergence minimization (Ke et al., 2019; Nowozin et al., 2016) and Wasserstein distance minimization (Xiao et al., 2019). One can also extend the framework from matching state-action pairs to state distribution matching, such as Torabi et al. (2018a); Sun et al. (2019); Schroecker & Isbell (2017). Other works (Aytar et al., 2018b; Liu et al., 2018; Peng et al., 2018) also learn from observation alone, by defining reward on state and using IRL to solve the tasks. Works like (Lee et al., 2019; Lee et al.) also use state-based reward for exploration. Torabi et al. (2018b); Edwards et al. (2018) will recover actions from observations by learning an inverse model or latent actions. However, our work aims to combine the advantage of global state distribution matching and local state transition alignment, which combines the advantage of BC and IRL through a novel framework.
33
+
34
+ # 3 BACKGROUNDS
35
+
36
+ Variational Autoencoders Kingma & Welling (2013); Rezende et al. (2014) provides a framework to learn both a probabilistic generative model $p _ { \boldsymbol { \theta } } ( \mathbf { x } | \mathbf { z } )$ as well as an approximated posterior
37
+
38
+ ![](images/8f713a57a3b582c724f49c73d421b5634ed57391836fea1855a0f42d78faf61f.jpg)
39
+ Figure 2: Visualization of state alignment
40
+
41
+ distribution $q _ { \phi } ( { \bf z } | { \bf x } )$ . $\beta$ -VAE is a variant VAE that introduces an adjustable hyperparameter $\beta$ to the original objective:
42
+
43
+ $$
44
+ \mathcal { L } ( \boldsymbol { \theta } , \boldsymbol { \phi } ; \mathbf { x } , \mathbf { z } , \boldsymbol { \beta } ) = \mathbb { E } _ { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \left[ \log p _ { \theta } ( \mathbf { x } | \mathbf { z } ) \right] - \beta D _ { K L } \left( q _ { \phi } ( \mathbf { z } | \mathbf { x } ) \| p ( \mathbf { z } ) \right)
45
+ $$
46
+
47
+ Larger $\beta$ will penalize the total correlation (Chen et al., 2018) to encourage more disentangled latent representations, while smaller $\beta$ often results in sharper and more precise reconstructions.
48
+
49
+ Wasserstein distance The Wasserstein distance between two density functions $p ( x )$ and $q ( x )$ with support on a compact metric space $( M , d )$ has an alternative form due to Kantorovich-Rubenstein duality (Villani, 2008):
50
+
51
+ $$
52
+ \mathcal { W } ( p , q ) = \operatorname* { s u p } _ { \phi \in \mathcal { L } _ { 1 } } \mathbb { E } _ { p ( x ) } [ \phi ( x ) ] - \mathbb { E } _ { q ( x ) } [ \phi ( x ) ]
53
+ $$
54
+
55
+ Here, $\mathcal { L } _ { 1 }$ is the set of all 1-Lipschitz functions from $\mathcal { M }$ to $\mathbb { R }$ . Compared with the prevalent KLdivergence and its extension, the f-divergence family, Wasserstein distance has a number of advantages theoretically and numerically. Please refer to Arjovsky et al. (2017) and Solomon (2018) for a detailed discussion.
56
+
57
+ # 4 SAIL: STATE ALIGNMENT BASED IMITATION LEARNING
58
+
59
+ # 4.1 OVERVIEW
60
+
61
+ Our imitation learning method is based on state alignment from both local and global perspectives. For local alignment, the goal is to follow the transition of the demonstration as much as possible, and allow the return to the demonstration trajectory whenever the imitation deviates. To achieve both goals, we use a $\beta$ - VAE (Higgins et al., 2017) to generate the next state (Figure 2 Left). For global alignment, we set up an objective to minimize the Wasserstein distance between the states in the current trajectory and the demonstrations (Figure 2 Right). There has to be a framework to naturally combine the local alignment and global alignment components. We resort to the reinforcement learning framework by encoding the local alignment as policy prior and encoding the global alignment as reward over states. Using Proximal Policy Optimization (PPO) by Schulman et al. (2017) as the backbone
62
+
63
+ ![](images/bb04f74d535c7df95d8e43e3ca6c2ebaad133059d55f6f0861254be0462d0a9c.jpg)
64
+ Figure 1: Using VAE as a state predictive model will be more self-correctable because of the stochastic sampling mechanism. But this won’t happen when we use VAE to predict actions.
65
+
66
+ RL solver, we derive a regularized policy update. To maximally exploit the knowledge from demonstrations and reduce interactions with the environment, we adopt a pre-training stage to produce a good initialization based on the same policy prior induced by the local alignment. Our method is summarized in Algorithm 1. In the rest parts of this section, we will introduce all the components of our method in details.
67
+
68
+ # 4.2 LOCAL ALIGNMENT BY STATE PREDICTIVE VAE
69
+
70
+ To align the transition of states locally, we need a predictive model to generate the next state which the agent should target at. And then we can train an inverse dynamics model to recover the cor
71
+
72
+ Require: Expert trajectories $\tau _ { e } : [ s _ { 1 } , a _ { 1 } , s _ { 2 } , a _ { 2 } , . . . ] \sim \pi _ { e }$ , initial policy $\pi$ , inverse dynamics model
73
+ $g$ , discriminator $\phi$ , total episode $T$ , memory capacity $S$
74
+ 1: if Imitator and Expert have the same dynamics model then
75
+ 2: Pre-train $g$ using $\tau _ { e }$ and transitions collected by a random policy
76
+ 3 : else
77
+ 4: Pre-train $g$ using transitions collected by a random policy
78
+ 5: end if
79
+ 6: Pre-train VAE using $\tau _ { e }$ , and obtain the policy prior $\triangleright$ Pre-train VAE and obtain policy prior
80
+ 7: Pretrain $\pi$ using policy prior as described in Sec 4.5
81
+ 8: while episode $\leq \mathrm { T }$ do
82
+ 9: while $| \tau | \leq S$ do . $\tau$ is the collected trajectories
83
+ 10: Collect trajectory $\left\{ \left( s , a , s ^ { \prime } , r , d o n e \right) \right\}$ using $\pi$
84
+ 11: Update $r$ using (4)
85
+ 12: Add $\{ ( s , a , s ^ { \prime } , r , d o n e ) \}$ to $\tau$
86
+ 13: end while
87
+ 14: Train $\phi$ using $\begin{array} { r } { \operatorname* { m a x } _ { \phi \in \mathcal { L } _ { 1 } } E _ { s \sim \tau _ { e } } [ \phi ( s ) ] - E _ { s \sim \tau } [ \phi ( s ) ] } \end{array}$ . Calculate Wasserstein Distance
88
+ 15: Update inverse dynamics model $g$
89
+ 16: Update policy using (5)
90
+ 17: end while
91
+
92
+ responding action, so as to provide a direct supervision for policy. It is worth-noting that, while training an inverse dynamics model is generally challenging, it is not so hard if we only focus on the agent dynamics, especially when the low-dimensional control states are accessible as in many practical scenarios. The problem of how to learn high-quality inverse/forward dynamics models is an active research topic.
93
+
94
+ Instead of using an ordinary network to memorize the subsequent states, which will suffer from the same issue of compounding errors as behavioral cloning (Ross & Bagnell, 2010; Ross et al., 2011a), we propose to use VAE to generate the next state based on the following two reasons. First, as shown in (Dai et al., 2018), VAE is more robust to outliers and regularize itself to find the support set of a data manifold, so it will generalize better for unseen data. Second, because of the latent stochastic sampling, the local neighborhood of a data point will have almost the same prediction, which is self-correctable when combined with a precise inverse dynamics model as illustrated in Figure 1.
95
+
96
+ We can also use a VAE to generate action based on the current state. But if the agent deviated from the demonstration trajectory a little bit, this predicted action is not necessarily guide the agent back to the trajectory, as shown in Figure 1. And in $\mathrm { S e c } ~ 5 . 3 . 2 $ , we conduct experiments to compare the state predictive VAE and the action predictive VAE.
97
+
98
+ Instead of the vanilla VAE, we use $\beta$ -VAE to balance the KL penalty and prediction error, with formulation shown in (1). In Sec 5, we discuss the effects of the hyper-parameter $\beta$ in different experiment settings as one of the ablation studies.
99
+
100
+ # 4.3 GLOBAL ALIGNMENT BY WASSERSTEIN DISTANCE
101
+
102
+ Due to the difference of dynamics between the expert and the imitator, the VAE-based local alignment cannot fully prevent the imitator from deviating from demonstrations. In such circumstances, we still need to assess whether the imitator is making progress in learning from the demonstrations. We, therefore, seek to control the difference between the state visitation distribution of the demonstration and imitator trajectories, which is a global constraint.
103
+
104
+ Note that using this global constraint alone will not induce policies that follow from the demonstration. Consider the simple case of learning an imitator from experts of the same dynamics. The expert takes cyclic actions. If the expert runs for 100 cycles with a high velocity and the imitator runs for only 10 cycles with a low velocity within the same time span, their state distribution would still roughly align. That is why existing work such as GAIL aligns state-action occupancy measure. However, as shown later, our state-based distribution matching will be combined with the local alignment component, which will naturally resolve this issue. The advantage of this state-based distribution matching over state-action pair matching as in GAIL or state-next-state pair matching in (Torabi et al., 2018a) is that the constraint becomes loosened.
105
+
106
+ We use IRL approach to achieve the state distribution matching by introducing a reinforcement learning problem. Our task is to design the reward to train an imitator that matches the state distribution of the expert.
107
+
108
+ Before introducing the reward design, we first explain the computation of the Wasserstein distance between the expert trajectories $\{ \tau _ { e } \}$ and imitator trajectory $\{ \tau \}$ using the Kantorovich duality:
109
+
110
+ $$
111
+ \mathcal { W } ( \tau _ { e } , \tau ) = \operatorname* { s u p } _ { \phi \in \mathcal { L } _ { 1 } } \mathbb { E } _ { s \sim \tau _ { e } } [ \phi ( s ) ] - \mathbb { E } _ { s \sim \tau } [ \phi ( s ) ]
112
+ $$
113
+
114
+ where $\phi$ is the Kantorovich’s potential, and serves as the discriminator in WGAN (Arjovsky et al., 2017). $\phi$ is trained with a gradient penalty term as WGAN-GP introduced in (Gulrajani et al., 2017)
115
+
116
+ After the rollout of imitator policy is obtained, the potential $\phi$ will be updated by (3). Assume a transition among an imitation policy rollout of length $T$ is $( s _ { i } , s _ { i + 1 } )$ . To provide a dense signal every timestep, we assign the reward as:
117
+
118
+ $$
119
+ r ( s _ { i } , s _ { i + 1 } ) = \frac { 1 } { T } [ \phi ( s _ { i + 1 } ) - \mathbb { E } _ { s \sim \tau _ { e } } \phi ( s ) ]
120
+ $$
121
+
122
+ We now explain the intuition of the above reward. By solving (3), those states of higher probability in demonstration will have a larger $\phi$ value. The reward in (4) will thus encourage the imitator to visit such states.
123
+
124
+ Maximizing the curriculum reward will be equivalent to
125
+
126
+ $$
127
+ J ( \pi ) = \sum _ { t = 1 } ^ { T } \mathbb { E } _ { s _ { t } , s _ { t + 1 } \sim \pi } [ r ( s _ { t } , s _ { t + 1 } ) ] = \sum _ { t = 1 } ^ { T } \frac { \mathbb { E } _ { s _ { t + 1 } } [ \phi ( s _ { t + 1 } ) - \mathbb { E } _ { s \sim \tau _ { e } } [ \phi ( s ) ] ] } { T } = - \mathcal { W } ( \tau _ { e } , \tau )
128
+ $$
129
+
130
+ In other words, the optimal policy of this MDP best matches the state visitation distributions w.r.t Wasserstein distance.
131
+
132
+ Compared with AIRL (Fu et al.) that also defines rewards on states only, our approach indeed enjoys certain advantages in certain cases. We provide a theoretical justification in the Appendix D.
133
+
134
+ # 4.4 REGULARIZED PPO POLICY UPDATE OBJECTIVE
135
+
136
+ As mentioned in the second paragraph of Sec 4.3, the global alignment has to be combined with local alignment. This is achieved by adding a prior to the original clipped PPO objective.
137
+
138
+ We maximize the following unified objective function:
139
+
140
+ $$
141
+ J ( \pi _ { \boldsymbol { \theta } } ) = L ^ { C L I P } ( \boldsymbol { \theta } ) - \lambda D _ { K L } \left( \pi _ { \boldsymbol { \theta } } ( \cdot \left| \boldsymbol { s } _ { t } ) \right| \bigg | p _ { a } \right)
142
+ $$
143
+
144
+ We will explain the two terms in detail. $L ^ { C L I P } ( \theta )$ denotes the clipped surrogate objective used in the original PPO algorithm:
145
+
146
+ $$
147
+ L ^ { C L I P } \left( \theta \right) = \hat { \mathbb { E } } _ { t } \left[ \operatorname* { m i n } \left( \frac { \pi _ { \theta } ( a \vert s ) } { \pi _ { \theta _ { o l d } } ( a \vert s ) } \hat { A } _ { t } , \operatorname { c l i p } \left( \frac { \pi _ { \theta } ( a \vert s ) } { \pi _ { \theta _ { o l d } } ( a \vert s ) } , 1 - \epsilon , 1 + \epsilon \right) \hat { A } _ { t } \right) \right] ,
148
+ $$
149
+
150
+ where $\hat { A } _ { t }$ is an estimator of the advantage function at timestep $t$ . The advantage function is calculated based on a reward function described in Sec 4.3.
151
+
152
+ The $D _ { K L }$ term in (5) serves as a regularizer to keep the policy close to a learned policy prior $p _ { a }$ . This policy prior $p _ { a }$ is derived from the state predictive VAE and an inverse dynamics model. Assume the $\beta$ -VAE is $f ( s _ { t } ) = s _ { t + 1 }$ and the inverse dynamics model is $g _ { i n v } ( s _ { t } , \dot { s } _ { t + 1 } ) = a$ . To solve the case when the agents have different dynamics, we learn a state prediction network and use a learned inverse dynamics to decode the action. We define the action prior as
153
+
154
+ $$
155
+ p _ { a } ( a _ { t } | s _ { t } ) \propto \mathrm { e x p } \left( - \bigg | \Big | \frac { g _ { i n v } ( s _ { t } , f ( s _ { t } ) ) - a _ { t } } { \sigma } \Big | \Big | ^ { 2 } \right)
156
+ $$
157
+
158
+ where the RHS is a pre-defined policy prior, a Gaussian distribution centered at $g _ { i n v } { \left( s _ { t } , f ( s _ { t } ) \right) }$ . $\sigma$ controls how strong the action prior is when regularizing the policy update, which is a hyperparameter. Note that the inverse model can be further adjusted during interactions.
159
+
160
+ $L ^ { C L I P }$ is computed through the advantage $\hat { A } _ { t }$ and reflects the global alignment. The policy prior is obtained from the inverse model and local $\beta$ -VAE, which makes the $D _ { K L }$ serve as a local alignment constraint. Furthermore, our method can be regard as a combination of BC and IRL because our KLdivergence based action prior encodes the BC policy and we update the policy leveraging reward.
161
+
162
+ We would note that our state-alignment method augments state distribution matching by taking relationships of two consecutive states into account with robustness concern.
163
+
164
+ # 4.5 PRE-TRAINING
165
+
166
+ We pretrain the state predictive VAE and the inverse dynamics model, and then obtain the policy prior in (7), which is a Gaussian distribution. For pre-training, we want to initialize PPO’s Gaussian policy $\pi$ by this prior $p _ { a }$ , by minimizing the KL-divergence between them. Practically, we use direct supervision from $\hat { g _ { i n v } } ( s _ { t } , \mathbf { \hat { \boldsymbol { f } } } ( s _ { t } ) )$ and $\sigma$ in (7) to directly train both the mean and variance of the policy network, which is more efficient during the pre-training stage. During the online interaction, the update rule of PPO’s policy is by optimizing (5), and the variance will be further adjusted for all the dimensions of the action space.
167
+
168
+ # 5 EXPERIMENTS
169
+
170
+ We conduct two different kinds of experiments to show the superiority of our method. In Sec 5.1, we compare our method with behavior cloning (Bain & Sommut, 1999), GAIL (Ho & Ermon, 2016), and AIRL (Fu et al.) in control setting where the expert and the imitator have different dynamics model, e.g., both of them are ant robots but the imitator has shorter legs. In Sec 5.1, we further evaluate in the traditional imitation learning setting. Finally, in Sec 5.3, we conduct ablation study to show the contribution of the components.
171
+
172
+ # 5.1 IMITATION LEARNING ACROSS AGENTS OF DIFFERENT ACTION DYNAMICS
173
+
174
+ # 5.1.1 ACTORS OF MODIFIED PHYSICS AND GEOMETRY PROPERTIES
175
+
176
+ We create environments using MuJoCo (Todorov et al., 2012) by changing some properties of experts, such as density and geometry of the body. We choose 2 environments, Ant and Swimmer, and augment them to 6 different environments: Heavy/Light/Disabled Ant/Swimmer. The Heavy/Light agents have modified density, and the disabled agents have modified head/tail/leg lengths. The demonstrations are collected from the standard Ant-v2 and Swimmer-v2. More descriptions of the environments and the demonstration collection process can be founded in the Appendix.
177
+
178
+ We then evaluate our method on them.
179
+
180
+ ![](images/6d9f58378786fc1a4ae6f2d7092d4d32f56b716b914c0640900090fe6e7e7253.jpg)
181
+ Figure 3: Comparison with BC, GAIL and AIRL when dynamics are different from experts.
182
+
183
+ Figure 3 demonstrates the superiority of our methods over all the baselines. Our approach is the most stable in all the 6 environments and shows the leading performance in each of them. GAIL seems to be the most sensitive to dynamics difference. AIRL, which is designed to solve imitation learning for actors of different dynamics, can perform on par with our method in two swimmerbased environments (DisabledSwimmer and HeavySwimmer) that have relatively lower dimensional action space (2D for swimmer versus 8D for ants).
184
+
185
+ Interestingly, the stability and performance of vanilla behavior cloning are quite reasonable in 4 of the environments, although it failed to move about in the DisabledAnt and HeavyAnt environments. For these two tasks, the agent will reach dangerous states by cloning actions, yet our method will not approach these states by using state-based imitation. In the other four games, BC agents do not die but just move less efficiently, so they have a sub-optimal yet still reasonable score.
186
+
187
+ # 5.1.2 ACTORS OF HETEROGENEOUS ACTION DYNAMICS
188
+
189
+ We consider an extremely challenging setting that the imitator and demonstrator are functionally different. One typical example of expert/imitator pair in practice would be a human and a humanoid robot. We consider a much simplified version but with similar nature – a Point and an Ant in MuJoCo. In this task, even if the state space cannot be exactly matched, there are still some shared dimensions across the state space of the imitator and the actor, e.g., the location of the center of mass, and the demonstration should still teach the imitator in these dimensions.
190
+
191
+ We use the same setting as many hierarchical RL papers, such as HIRO and Near-Optimal RL (Nachum et al., 2018a;b). The agent need to reach a goal position in a maze, which is represented by (x,y) coordinates. We also know that the first two dimensions of states are the position of the agent. The prior knowledge includes: (1) the goal space (or the common space that need to be matched) (2) the projection from the state space to the goal space (select the first two dimensions of the states).
192
+
193
+ ![](images/ccd5c1239ca9d5ea869d72b30546620697406dffe201e7855b12b04bc6d22b43.jpg)
194
+ Figure 4: Imitation Learning of Actors with Heterogeneous Action Dynamics.
195
+
196
+ The first task is that the Ant should reach the other side of the maze from several successful demonstrations of a Point robot. As shown in Figure 4(c) and Figure 4(d), the maze structure for the ant and point mass is exactly the same.
197
+
198
+ To solve this problem, we first pre-train an VAE on the demonstrations, and use this VAE to propose the next “subgoal” for the Ant. This VAE is trained on the goal space (i.e. the first two dimensions) of the Point robot’s trajectory. Then we train an inverse model for Ant, which will generate an action based on the Ant’s current state (high dimensional) and goal predicted by VAE (2 dimensional).
199
+
200
+ Our performance is shown in Figure 5(c). After 1M training steps, the agent has success rate of 0.8 to reach the other side of the maze.
201
+
202
+ # 5.2 ACTORS OF THE SAME DYNAMICS (STANDARD IMITATION LEARNING)
203
+
204
+ We also evaluate our algorithm on 6 non-trivial control tasks in MuJoCo: Swimmer, Hopper, Walker, Ant, HalfCheetach, and Humanoid. We first collect demonstration trajectories with Soft ActorCritic, which can learn policies that achieve high scores in most of these environments2. For comparison, we evaluate our method against 3 baselines: behavior cloning, GAIL, and AIRL3. Also, to create even stronger baselines for the cumulative reward and imitator run-time sample complexity, we initialize GAIL with behavior cloning, which would obtain higher scores in Swimmer and Walker. Lastly, to evaluate how much each algorithm depends on the amount of demonstrations, we sampled demonstration trajectories of ten and fifty episodes.
205
+
206
+ Table 1 depicts representative results in Hopper and HalfCheetah4. The advantage of our methods over BC should be attributed to the inherent data augmentation by VAE. On Hopper-v2, we are significantly better with 10 demos but are just on par if the demos are increased to 50. On HalfCheetah-v2, the demo cheetah runs almost perfectly ( 12294 scores); in other words, the demo provides limited instruction when the imitator is even slightly off the demo states, thus the robustness from VAE becomes critical.
207
+
208
+ Table 1: Performance on Hopper-v2 and HalfCheetah-v2
209
+
210
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2>Hopper-v2</td><td rowspan=1 colspan=2>HalfCheetah-v2</td></tr><tr><td rowspan=1 colspan=1>#Demo</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=2>10 50</td></tr><tr><td rowspan=1 colspan=1>Expert</td><td rowspan=1 colspan=2>3566± 1.24</td><td rowspan=1 colspan=2>12294.22 ± 273.59</td></tr><tr><td rowspan=1 colspan=1>BC</td><td rowspan=1 colspan=1>1318.76± 804.36</td><td rowspan=1 colspan=1>3525.87 ± 160.74</td><td rowspan=1 colspan=1>971.42 ± 249.62</td><td rowspan=1 colspan=1>4813.20± 1949.26</td></tr><tr><td rowspan=1 colspan=1>GAIL</td><td rowspan=1 colspan=1>3372.66 ± 130.75</td><td rowspan=1 colspan=1>3363.97± 262.77</td><td rowspan=1 colspan=1>474.42 ± 389.30</td><td rowspan=1 colspan=1>-175.83± 26.76</td></tr><tr><td rowspan=1 colspan=1>BC-GAIL</td><td rowspan=1 colspan=1>3132.11 ± 520.65</td><td rowspan=1 colspan=1>3130.82 ± 554.54</td><td rowspan=1 colspan=1>578.85 ± 934.34</td><td rowspan=1 colspan=1>1597.51 ± 1173.93</td></tr><tr><td rowspan=1 colspan=1>AIRL</td><td rowspan=1 colspan=1>3.07 ± 0.02</td><td rowspan=1 colspan=1>3.31 ± 0.02</td><td rowspan=1 colspan=1>-146.46± 23.57</td><td rowspan=1 colspan=1>755.46± 10.92</td></tr><tr><td rowspan=1 colspan=1>Ourinit</td><td rowspan=1 colspan=1>3412.58 ± 450.97</td><td rowspan=1 colspan=1>3601.16± 300.14</td><td rowspan=1 colspan=1>1064.44 ± 227.32</td><td rowspan=1 colspan=1>7102.29 ± 910.54</td></tr><tr><td rowspan=1 colspan=1>Our final</td><td rowspan=1 colspan=1>3539.56 ±130.36</td><td rowspan=1 colspan=1>3614.19 ± 150.74</td><td rowspan=1 colspan=1>1616.34 ±180.76</td><td rowspan=1 colspan=1>8817.32 ± 860.55</td></tr></table>
211
+
212
+ # 5.3 ABLATION STUDY
213
+
214
+ # 5.3.1 COEFFICIENT $\beta$ IN $\beta$ -VAE
215
+
216
+ $\beta$ -VAE introduces an additional parameter to the original VAE. It controls the variance of the randomly sampled latent variable sampling, which subsequently affects the reconstruction quality and robustness. Theoretically, a smaller $\beta$ leads to better state prediction quality, with the cost of losing the deviation correction ability (Dai et al., 2018).
217
+
218
+ To empirically show the role of beta and check the sensitivity of our algorithm with respect to beta, we evaluate VAE in settings of both the imitator has the same dynamics and has different dynamics. We select HalfCheetah-v2 and HeavyAnt as an example. For HalfCheetah-v2, we pretrain the inverse dynamics and VAE using given demonstrations so that the initial performance will tell the quality of the VAE’s prediction. For DisabledAnt, we pretrain the dynamics with random trials, which results in forward/inverse dynamics estimation of less accuracy. In this case, we examine both its initialized performance and final performance. The results are shown in Table 2. We find out that for $\beta$ in [0.01, 0.1], the performance is better. Specifically, when the imitator is different from the expert, a smaller $\bar { \boldsymbol \beta }$ will result in poor performance as it overfits the demonstration data.
219
+
220
+ We also compare our method with an ordinary MLP trained by MSE loss. We find out that VAE outperforms MLP in all settings. Note that the MLP-based approach is very similar to the state-based behavior cloning work of (Torabi et al., 2018b).
221
+
222
+ # 5.3.2 ACTION PREDICTIVE $\beta$ -VAE
223
+
224
+ In Figure 1, we mentioned that a VAE to predict the next action is less favorable. To justify the claim, we compare a VAE-based BC with a vanilla BC that both predict actions, as shown in Table 3. Experiments show that VAE-BC is even outperformed by a vanilla BC, especially when $\beta$ is larger than 0.001. Compared with the last line in Table 2, we can conclude that VAE is more useful when predicting state, which consolidates that the advantage really comes from our state-based approach but not only the robustness of VAE.
225
+
226
+ # 5.3.3 EFFECT OF WASSERSTEIN DISTANCE AND KL REGULARIZATION
227
+
228
+ In our policy update process, we use Wasserstein distance with KL regularization to update the policy. To analyze their effects on the performance, we use HalfCheetah-v2 and Humanoid-v2 with
229
+
230
+ Table 2: Analyze the role of VAE coefficient. The “None” item means replacing VAE with an ordinary network with linear layers.
231
+
232
+ <table><tr><td rowspan="2">β</td><td colspan="4">Environments</td></tr><tr><td>HalfCheetah-50</td><td>HalfCheetah-20</td><td>HeavyAnt-Initial</td><td>HeavyAnt-Final</td></tr><tr><td>0.2</td><td>2007.86</td><td>1289.21</td><td>258.91</td><td>282.13</td></tr><tr><td>0.15</td><td>2653.04</td><td>1151.93</td><td>1149.65</td><td>1502.68</td></tr><tr><td>0.1</td><td>7102.29</td><td>1797.44</td><td>1219.34</td><td>5208.45</td></tr><tr><td>0.05</td><td>5933.28</td><td>2215.71</td><td>987.72</td><td>4850.62</td></tr><tr><td>0.01</td><td>5893.17</td><td>1982.62</td><td>740.54</td><td>1921.26</td></tr><tr><td>0.005</td><td>4415.04</td><td>1369.57</td><td>320.54</td><td>399.31</td></tr><tr><td>None</td><td>4759.69</td><td>1123.79</td><td>359.15</td><td>-62.13</td></tr></table>
233
+
234
+ Table 3: Compare behavior cloning to variational behavior cloning
235
+
236
+ <table><tr><td rowspan=2 colspan=1>β</td><td rowspan=1 colspan=2>Environments</td></tr><tr><td rowspan=1 colspan=1>HalfCheetah-50</td><td rowspan=1 colspan=1>Hopper-50</td></tr><tr><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>230.52±13.26</td><td rowspan=1 colspan=1>203.87 ±14.39</td></tr><tr><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>1320.04 ± 15.43</td><td rowspan=1 colspan=1>438.10± 20.43</td></tr><tr><td rowspan=1 colspan=1>0.001</td><td rowspan=1 colspan=1>3306.91 ± 12.51</td><td rowspan=1 colspan=1>3303.72±10.46</td></tr><tr><td rowspan=1 colspan=1>None</td><td rowspan=1 colspan=1>4813.20± 1949.26</td><td rowspan=1 colspan=1>3525.87 ± 6.74</td></tr></table>
237
+
238
+ ![](images/af5b94877281e6dbd09e56642dd12280cc3fb04531e9cd4ba0d68f4524d52fe1.jpg)
239
+ Figure 5: (a), (b) show the effects of Wasserstein distance and KL regularization on HalfCheetah-v2 and Humanoid-v2 given 20 demonstration trajectories. And (c) presents the result on Antmaze.
240
+
241
+ 20 expert trajectories. For each environment, they use the same pretrained inverse model and VAE, thus they have the same behavior after pretraining.
242
+
243
+ As shown in Figure 5(a)(b), Wasserstein distance combined with KL regularization performs the best. Wasserstein objective is used in our inverse RL based mechanism that would significantly penalize the exploration when the agent deviates from the demonstration far away. However, using this objective alone lacks constraints over consecutive states, thus performing the worst. The KL objective adds constraints over consecutive states using a VAE prior; however, VAE is unable to extrapolate to states when the imitator deviates far from the demo (green line gradually fails as in Fig 5 (b)), but this is the scenario when the Wasserstein distance would not favor, thus the reward from the Wasserstein distance will push the imitator back to the demonstration states.
244
+
245
+ # 6 CONCLUSION
246
+
247
+ We proposed SAIL, a flexible and practical imitation learning algorithms that use state alignment from both local and global perspective. We demonstrate the superiority of our method using MuJoCo environments, especially when the action dynamics are different from the demonstrations.
248
+
249
+ # REFERENCES
250
+
251
+ Pieter Abbeel and Andrew $\mathrm { ~ Y ~ N ~ g ~ }$ . Apprenticeship learning via inverse reinforcement learning. In Proceedings of the twenty-first international conference on Machine learning, pp. 1. ACM, 2004.
252
+
253
+ Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein gan. ´ arXiv preprint arXiv:1701.07875, 2017.
254
+
255
+ Yusuf Aytar, Tobias Pfaff, David Budden, Thomas Paine, Ziyu Wang, and Nando de Freitas. Playing hard exploration games by watching youtube. In Advances in Neural Information Processing Systems, pp. 2930–2941, 2018a.
256
+
257
+ Yusuf Aytar, Tobias Pfaff, David Budden, Thomas Paine, Ziyu Wang, and Nando de Freitas. Playing hard exploration games by watching youtube. In Advances in Neural Information Processing Systems, pp. 2930–2941, 2018b.
258
+
259
+ Michael Bain and Claude Sommut. A framework for behavioural cloning. Machine intelligence, 15 (15):103, 1999.
260
+
261
+ Lionel Blonde and Alexandros Kalousis. Sample-efficient imitation learning via generative adver- ´ sarial nets. arXiv preprint arXiv:1809.02064, 2018.
262
+
263
+ Tian Qi Chen, Xuechen Li, Roger B Grosse, and David K Duvenaud. Isolating sources of disentanglement in variational autoencoders. In Advances in Neural Information Processing Systems, pp. 2610–2620, 2018.
264
+
265
+ Bin Dai, Yu Wang, John Aston, Gang Hua, and David Wipf. Connections with robust pca and the role of emergent sparsity in variational autoencoder models. The Journal of Machine Learning Research, 19(1):1573–1614, 2018.
266
+
267
+ Ashley D Edwards, Himanshu Sahni, Yannick Schroecker, and Charles L Isbell. Imitating latent policies from observation. arXiv preprint arXiv:1805.07914, 2018.
268
+
269
+ Justin Fu, Katie Luo, and Sergey Levine. Learning robust rewards with adversarial inverse reinforcement learning. ICLR 2018.
270
+
271
+ Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in neural information processing systems, pp. 2672–2680, 2014.
272
+
273
+ Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved training of wasserstein gans. In Advances in neural information processing systems, pp. 5767–5777, 2017.
274
+
275
+ Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Offpolicy maximum entropy deep reinforcement learning with a stochastic actor. arXiv preprint arXiv:1801.01290, 2018.
276
+
277
+ Todd Hester, Matej Vecerik, Olivier Pietquin, Marc Lanctot, Tom Schaul, Bilal Piot, Dan Horgan, John Quan, Andrew Sendonaris, Ian Osband, et al. Deep q-learning from demonstrations. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
278
+
279
+ Irina Higgins, Loic Matthey, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-vae: Learning basic visual concepts with a constrained variational framework. ICLR, 2(5):6, 2017.
280
+
281
+ Jonathan Ho and Stefano Ermon. Generative adversarial imitation learning. In Advances in neural information processing systems, pp. 4565–4573, 2016.
282
+
283
+ Liyiming Ke, Matt Barnes, Wen Sun, Gilwoo Lee, Sanjiban Choudhury, and Siddhartha Srinivasa. Imitation learning as $f$ -divergence minimization. arXiv preprint arXiv:1905.12888, 2019.
284
+
285
+ Diederik $\mathrm { \bf P }$ Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
286
+
287
+ Hoang M Le, Yisong Yue, Peter Carr, and Patrick Lucey. Coordinated multi-agent imitation learning. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 1995– 2003. JMLR. org, 2017.
288
+
289
+ Lisa Lee, Benjamin Eysenbach, Emilio Parisotto, Ruslan Salakhutdinov, and Sergey Levine. State marginal matching with mixtures of policies.
290
+
291
+ Lisa Lee, Benjamin Eysenbach, Emilio Parisotto, Eric Xing, Sergey Levine, and Ruslan Salakhutdinov. Efficient exploration via state marginal matching. arXiv preprint arXiv:1906.05274, 2019.
292
+
293
+ YuXuan Liu, Abhishek Gupta, Pieter Abbeel, and Sergey Levine. Imitation from observation: Learning to imitate behaviors from raw video via context translation. In 2018 IEEE International Conference on Robotics and Automation (ICRA), pp. 1118–1125. IEEE, 2018.
294
+
295
+ Ofir Nachum, Shixiang Gu, Honglak Lee, and Sergey Levine. Near-optimal representation learning for hierarchical reinforcement learning. arXiv preprint arXiv:1810.01257, 2018a.
296
+
297
+ Ofir Nachum, Shixiang Shane Gu, Honglak Lee, and Sergey Levine. Data-efficient hierarchical reinforcement learning. In Advances in Neural Information Processing Systems, pp. 3303–3313, 2018b.
298
+
299
+ Andrew Y Ng, Stuart J Russell, et al. Algorithms for inverse reinforcement learning. In Icml, volume 1, pp. 2, 2000.
300
+
301
+ 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.
302
+
303
+ Deepak Pathak, Parsa Mahmoudieh, Michael Luo, Pulkit Agrawal, Dian Chen, Fred Shentu, Evan Shelhamer, Jitendra Malik, Alexei A Efros, and Trevor Darrell. Zero-shot visual imitation. international conference on learning representations, 2018.
304
+
305
+ Xue Bin Peng, Angjoo Kanazawa, Jitendra Malik, Pieter Abbeel, and Sergey Levine. Sfv: Reinforcement learning of physical skills from videos. ACM Trans. Graph., 37(6), November 2018.
306
+
307
+ Tobias Pohlen, Bilal Piot, Todd Hester, Mohammad Gheshlaghi Azar, Dan Horgan, David Budden, Gabriel Barth-Maron, Hado van Hasselt, John Quan, Mel Vecer ˇ ´ık, et al. Observe and look further: Achieving consistent performance on atari. arXiv preprint arXiv:1805.11593, 2018.
308
+
309
+ Dean A Pomerleau. Alvinn: An autonomous land vehicle in a neural network. In Advances in neural information processing systems, pp. 305–313, 1989.
310
+
311
+ Ahmed H Qureshi, Byron Boots, and Michael C Yip. Adversarial imitation via variational inverse reinforcement learning. arXiv preprint arXiv:1809.06404, 2018.
312
+
313
+ Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. arXiv preprint arXiv:1401.4082, 2014.
314
+
315
+ Stephane Ross and Drew Bagnell. Efficient reductions for imitation learning. In ´ Proceedings of the thirteenth international conference on artificial intelligence and statistics, pp. 661–668, 2010.
316
+
317
+ Stephane Ross, Geoffrey Gordon, and Drew Bagnell. A reduction of imitation learning and struc- ´ tured prediction to no-regret online learning. In Proceedings of the fourteenth international conference on artificial intelligence and statistics, pp. 627–635, 2011a.
318
+
319
+ Stephane Ross, Geoffrey Gordon, and Drew Bagnell. A reduction of imitation learning and struc- ´ tured prediction to no-regret online learning. In Proceedings of the fourteenth international conference on artificial intelligence and statistics, pp. 627–635, 2011b.
320
+
321
+ Stuart J Russell. Learning agents for uncertain environments. In COLT, volume 98, pp. 101–103, 1998.
322
+
323
+ Yannick Schroecker and Charles L Isbell. State aware imitation learning. In Advances in Neural Information Processing Systems, pp. 2911–2920, 2017.
324
+
325
+ 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.
326
+
327
+ John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
328
+
329
+ Justin Solomon. Optimal transport on discrete domains. AMS Short Course on Discrete Differential Geometry, 2018.
330
+
331
+ Wen Sun, Anirudh Vemula, Byron Boots, and J Andrew Bagnell. Provably efficient imitation learning from observation alone. arXiv preprint arXiv:1905.10948, 2019.
332
+
333
+ Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 5026–5033. IEEE, 2012.
334
+
335
+ Faraz Torabi, Garrett Warnell, and Peter Stone. Generative adversarial imitation from observation. arXiv preprint arXiv:1807.06158, 2018a.
336
+
337
+ Faraz Torabi, Garrett Warnell, and Peter Stone. Behavioral cloning from observation. arXiv preprint arXiv:1805.01954, 2018b.
338
+
339
+ Cedric Villani. ´ Optimal transport: old and new, volume 338. Springer Science & Business Media, 2008.
340
+
341
+ Huang Xiao, Michael Herman, Joerg Wagner, Sebastian Ziesche, Jalal Etesami, and Thai Hong Linh. Wasserstein adversarial imitation learning. arXiv preprint arXiv:1906.08113, 2019.
342
+
343
+ Gu Ye and Ron Alterovitz. Guided motion planning. In Robotics research, pp. 291–307. Springer, 2017.
344
+
345
+ Brian D Ziebart, Andrew Maas, J Andrew Bagnell, and Anind K Dey. Maximum entropy inverse reinforcement learning. 2008.
346
+
347
+ # A LEARNING ACROSS DIFFERENT ENVIRONMENTS
348
+
349
+ PointMaze & AntMaze As shown in Figure 4, a point mass or an ant is put in a $2 4 \times 2 4$ U-maze. The task is to make the agent reach the other side of U-maze with the demonstration from the point mass. The ant is trained to reach a random goal in the maze from a random location, and should reach the other side of the maze. The state space of ant is 30-dim, which contains the positions and velocities.
350
+
351
+ HeavyAnt Two times of original Ant’s density. Two times of original gear of the armature.
352
+
353
+ LightAnt One tenth of original Ant’s density.
354
+
355
+ DisabledAnt Two front legs are 3 quarters of original Ant’s legs.
356
+
357
+ HeavySwimmer 2.5 times of original Swimmer’s density.
358
+
359
+ LightSwimmer One twentieth of original Swimmer’s density.
360
+
361
+ DisabledSwimmer Make the last joint 1.2 times longer and the first joint 0.7 times of the original length
362
+
363
+ The exact results of these environments are listed in Table 4, 5. All the statistics are calculated from 20 trails.
364
+
365
+ Table 4: Performance on modifeid Swimmer
366
+
367
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>DisabledSwimmer</td><td rowspan=1 colspan=1>LightSwimmer</td><td rowspan=1 colspan=1>HeavySwimmer</td></tr><tr><td rowspan=1 colspan=1>BC</td><td rowspan=1 colspan=1>249.09±1.53</td><td rowspan=1 colspan=1>277.99± 3.41</td><td rowspan=1 colspan=1>255.95± 2.5</td></tr><tr><td rowspan=1 colspan=1>GAIL</td><td rowspan=1 colspan=1>228.46±2.02</td><td rowspan=1 colspan=1>-4.11 ± 0.51</td><td rowspan=1 colspan=1>254.91 ± 1.35</td></tr><tr><td rowspan=1 colspan=1>AIRL</td><td rowspan=1 colspan=1>283.42 ± 3.69</td><td rowspan=1 colspan=1>67.58 ± 25.09</td><td rowspan=1 colspan=1>301.27 ± 5.21</td></tr><tr><td rowspan=1 colspan=1>SAIL(Ours)</td><td rowspan=1 colspan=1>287.71 ± 2.31</td><td rowspan=1 colspan=1>342.61 ± 6.14</td><td rowspan=1 colspan=1>286.4 ± 3.2</td></tr></table>
368
+
369
+ Table 5: Performance on modified Ant
370
+
371
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>DisabledAnt</td><td rowspan=1 colspan=1>HeavyAnt</td><td rowspan=1 colspan=1>LightAnt</td></tr><tr><td rowspan=1 colspan=1>BC</td><td rowspan=1 colspan=1>1042.45± 75.13</td><td rowspan=1 colspan=1>550.6± 77.62</td><td rowspan=1 colspan=1>4936.59± 53.42</td></tr><tr><td rowspan=1 colspan=1>GAIL</td><td rowspan=1 colspan=1>-1033.54± 254.36</td><td rowspan=1 colspan=1>-1089.34± 174.13</td><td rowspan=1 colspan=1>-971.74 ± 123.14</td></tr><tr><td rowspan=1 colspan=1>AIRL</td><td rowspan=1 colspan=1>-3252.69± 153.47</td><td rowspan=1 colspan=1>-62.02± 5.33</td><td rowspan=1 colspan=1>-626.44 ± 104.31</td></tr><tr><td rowspan=1 colspan=1>SAIL(Ours)</td><td rowspan=1 colspan=1>3305.71 ± 67.21</td><td rowspan=1 colspan=1>5608.47 ± 57.67</td><td rowspan=1 colspan=1>4335.46± 82.34</td></tr></table>
372
+
373
+ # B IMITATION BENCHMARK EXPERIMENTS SETTINGS AND RESULTS
374
+
375
+ We use six MuJoCo (Todorov et al., 2012) control tasks. The name and version of the environments are listed in Table 6, which also list the state and action dimension of the tasks with expert performance and reward threshold to indicate the minimum score to solve the task. All the experts are trained by using SAC (Haarnoja et al., 2018) except Swimmer-v2 where TRPO (Schulman et al., 2015) get higher performance.
376
+
377
+ Table 6: Performance on benchmark control tasks
378
+
379
+ <table><tr><td rowspan=1 colspan=1>Environment</td><td rowspan=1 colspan=1>State Dim</td><td rowspan=1 colspan=1>Action Dim</td><td rowspan=1 colspan=1>Reward threshold</td><td rowspan=1 colspan=1>Expert Performance</td></tr><tr><td rowspan=1 colspan=1>Swimmer-v2</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>360</td><td rowspan=1 colspan=1>332</td></tr><tr><td rowspan=1 colspan=1>Hopper-v2</td><td rowspan=1 colspan=1>11</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>3800</td><td rowspan=1 colspan=1>3566</td></tr><tr><td rowspan=1 colspan=1>Walker2d-v2</td><td rowspan=1 colspan=1>17</td><td rowspan=1 colspan=1>6</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>4924</td></tr><tr><td rowspan=1 colspan=1>Ant-v2</td><td rowspan=1 colspan=1>111</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>6000</td><td rowspan=1 colspan=1>6157</td></tr><tr><td rowspan=1 colspan=1>HalfCheetah-v2</td><td rowspan=1 colspan=1>17</td><td rowspan=1 colspan=1>6</td><td rowspan=1 colspan=1>4800</td><td rowspan=1 colspan=1>12294</td></tr><tr><td rowspan=1 colspan=1>Humanoid-v2</td><td rowspan=1 colspan=1>376</td><td rowspan=1 colspan=1>17</td><td rowspan=1 colspan=1>1000</td><td rowspan=1 colspan=1>5187</td></tr></table>
380
+
381
+ The exact performance of all methods are list in Table 7, 8, 9, 10, 11, 12. We compare GAIL(Ho & Ermon, 2016), behavior cloning, GAIL with behavior cloning initilization and AIRL to our method containing. Means and standard deviations are calculated from 20 trajectories after the agents converge and the number total interactions with environments is less than one million environment steps.
382
+
383
+ Table 7: Performance on Swimmer-v2 with different trajectories
384
+
385
+ <table><tr><td rowspan=1 colspan=5>Swimmer-v2</td></tr><tr><td rowspan=1 colspan=1>#Demo</td><td rowspan=1 colspan=4>5 10 20 50</td></tr><tr><td rowspan=1 colspan=1>Expert</td><td rowspan=1 colspan=4>332.88 ± 1.24</td></tr><tr><td rowspan=1 colspan=1>BC</td><td rowspan=1 colspan=1>328.85 ± 2.26</td><td rowspan=1 colspan=1>331.17 ± 2.4</td><td rowspan=1 colspan=1>332.17 ± 2.4</td><td rowspan=1 colspan=1>330.65± 2.42</td></tr><tr><td rowspan=1 colspan=1>GAIL</td><td rowspan=1 colspan=1>304.64 ± 3.16</td><td rowspan=1 colspan=1>271.59 ± 11.77</td><td rowspan=1 colspan=1>56.16 ± 5.99</td><td rowspan=1 colspan=1>246.73 ± 5.76</td></tr><tr><td rowspan=1 colspan=1>BC-GAIL</td><td rowspan=1 colspan=1>313.80± 3.42</td><td rowspan=1 colspan=1>326.58 ± 7.87</td><td rowspan=1 colspan=1>294.93±12.21</td><td rowspan=1 colspan=1>315.68 ± 9.99</td></tr><tr><td rowspan=1 colspan=1>AIRL</td><td rowspan=1 colspan=1>332.11 ± 2.57</td><td rowspan=1 colspan=1>338.43±3.65</td><td rowspan=1 colspan=1>335.67 ± 2.72</td><td rowspan=1 colspan=1>340.08 ± 2.70</td></tr><tr><td rowspan=1 colspan=1>Our init</td><td rowspan=1 colspan=1>332.36± 3.62</td><td rowspan=1 colspan=1>335.78± 0.34</td><td rowspan=1 colspan=1>336.23± 2.53</td><td rowspan=1 colspan=1>334.03 ± 2.11</td></tr><tr><td rowspan=1 colspan=1>Our final</td><td rowspan=1 colspan=1>332.22 ± 3.23</td><td rowspan=1 colspan=1>339.67 ± 3.21</td><td rowspan=1 colspan=1>336.18 ± 1.87</td><td rowspan=1 colspan=1>336.31± 3.20</td></tr></table>
386
+
387
+ Table 8: Performance on Hopper-v2 with different trajectories
388
+
389
+ <table><tr><td rowspan=1 colspan=5>Hopper-v2</td></tr><tr><td rowspan=1 colspan=1>#Demo</td><td rowspan=1 colspan=4>5 10 20 50</td></tr><tr><td rowspan=1 colspan=1>Expert</td><td rowspan=1 colspan=4>3566±1.24</td></tr><tr><td rowspan=1 colspan=1>BC</td><td rowspan=1 colspan=1>1471.40 ± 637.25</td><td rowspan=1 colspan=1>1318.76± 804.36</td><td rowspan=1 colspan=1>1282.46± 772.24</td><td rowspan=1 colspan=1>3525.87 ± 160.74</td></tr><tr><td rowspan=1 colspan=1>GAIL</td><td rowspan=1 colspan=1>3300.32 ± 331.61</td><td rowspan=1 colspan=1>3372.66 ± 130.75</td><td rowspan=1 colspan=1>3201.97 ± 295.27</td><td rowspan=1 colspan=1>3363.97± 262.77</td></tr><tr><td rowspan=1 colspan=1>BC-GAIL</td><td rowspan=1 colspan=1>3122.23± 358.65</td><td rowspan=1 colspan=1>3132.11 ± 520.65</td><td rowspan=1 colspan=1>3111.42 ± 414.28</td><td rowspan=1 colspan=1>3130.82± 554.54</td></tr><tr><td rowspan=1 colspan=1>AIRL</td><td rowspan=1 colspan=1>4.12 ± 0.01</td><td rowspan=1 colspan=1>3.07 ± 0.02</td><td rowspan=1 colspan=1>4.11 ± 0.01</td><td rowspan=1 colspan=1>3.31 ± 0.02</td></tr><tr><td rowspan=1 colspan=1>Our init</td><td rowspan=1 colspan=1>2322.49 ± 300.93</td><td rowspan=1 colspan=1>3412.58 ± 450.97</td><td rowspan=1 colspan=1>3314.03± 310.32</td><td rowspan=1 colspan=1>3601.16± 300.14</td></tr><tr><td rowspan=1 colspan=1>Our final</td><td rowspan=1 colspan=1>3092.26± 670.72</td><td rowspan=1 colspan=1>3539.56±130.36</td><td rowspan=1 colspan=1>3516.81± 280.98</td><td rowspan=1 colspan=1>3610.19± 150.74</td></tr></table>
390
+
391
+ Table 9: Performance on Walker2d-v2 with different trajectories
392
+
393
+ <table><tr><td rowspan=1 colspan=5>Walker2d-v2</td></tr><tr><td rowspan=1 colspan=1>#Demo</td><td rowspan=1 colspan=4>5 10 20 50</td></tr><tr><td rowspan=1 colspan=1>Expert</td><td rowspan=1 colspan=4>5070.97士209.19</td></tr><tr><td rowspan=1 colspan=1>BC</td><td rowspan=1 colspan=1>1617.34 ± 693.63</td><td rowspan=1 colspan=1>4425.50± 930.62</td><td rowspan=1 colspan=1>4689.30± 372.33</td><td rowspan=1 colspan=1>4796.24 ± 490.05</td></tr><tr><td rowspan=1 colspan=1>GAIL</td><td rowspan=1 colspan=1>1307.21 ± 388.55</td><td rowspan=1 colspan=1>692.16±145.34</td><td rowspan=1 colspan=1>1991.58 ± 446.66</td><td rowspan=1 colspan=1>751.21 ± 150.18</td></tr><tr><td rowspan=1 colspan=1>BC-GAIL</td><td rowspan=1 colspan=1>3454.91 ± 792.40</td><td rowspan=1 colspan=1>2094.68 ±1425.05</td><td rowspan=1 colspan=1>3482.31 ± 828.21</td><td rowspan=1 colspan=1>2896.50± 828.18</td></tr><tr><td rowspan=1 colspan=1>AIRL</td><td rowspan=1 colspan=1>-7.13 ± 0.11</td><td rowspan=1 colspan=1>-7.39 ±0.09</td><td rowspan=1 colspan=1>-3.74 ± 0.13</td><td rowspan=1 colspan=1>-4.64 ± 0.09</td></tr><tr><td rowspan=1 colspan=1>Our init</td><td rowspan=1 colspan=1>1859.10± 720.44</td><td rowspan=1 colspan=1>2038.90±260.78</td><td rowspan=1 colspan=1>4509.82 ± 1470.65</td><td rowspan=1 colspan=1>4757.58 ± 880.45</td></tr><tr><td rowspan=1 colspan=1>Our final</td><td rowspan=1 colspan=1>2681.20± 530.67</td><td rowspan=1 colspan=1>3764.14 ± 470.01</td><td rowspan=1 colspan=1>4778.82 ± 760.34</td><td rowspan=1 colspan=1>4780.73± 360.66</td></tr></table>
394
+
395
+ Table 10: Performance on Ant-v2 with different trajectories
396
+
397
+ <table><tr><td rowspan=1 colspan=5>Ant-v2</td></tr><tr><td rowspan=1 colspan=1>#Demo</td><td rowspan=1 colspan=4>5 10 20 50</td></tr><tr><td rowspan=1 colspan=1>Expert</td><td rowspan=1 colspan=4>6190.90 ± 254.18</td></tr><tr><td rowspan=1 colspan=1>BC</td><td rowspan=1 colspan=1>3958.20 ± 661.28</td><td rowspan=1 colspan=1>3948.88± 753.41</td><td rowspan=1 colspan=1>5424.01 ± 473.05</td><td rowspan=1 colspan=1>5852.79± 572.97</td></tr><tr><td rowspan=1 colspan=1>GAIL</td><td rowspan=1 colspan=1>340.02 ± 59.02</td><td rowspan=1 colspan=1>335.25 ± 89.19</td><td rowspan=1 colspan=1>314.35 ± 52.13</td><td rowspan=1 colspan=1>284.18 ± 32.40</td></tr><tr><td rowspan=1 colspan=1>BC-GAIL</td><td rowspan=1 colspan=1>-1081.30± 673.65</td><td rowspan=1 colspan=1>-1177.27 ± 618.67</td><td rowspan=1 colspan=1>-13618.45 ± 4237.79</td><td rowspan=1 colspan=1>-1166.16±1246.79</td></tr><tr><td rowspan=1 colspan=1>AIRL</td><td rowspan=1 colspan=1>-839.32 ± -301.54</td><td rowspan=1 colspan=1>-386.43±156.98</td><td rowspan=1 colspan=1>-586.07 ± 145.43</td><td rowspan=1 colspan=1>-393.90± 145.13</td></tr><tr><td rowspan=1 colspan=1>Our init</td><td rowspan=1 colspan=1>1150.82 ± 200.87</td><td rowspan=1 colspan=1>3015.43± 300.70</td><td rowspan=1 colspan=1>5200.58± 870.74</td><td rowspan=1 colspan=1>5849.88 ± 890.56</td></tr><tr><td rowspan=1 colspan=1>Our final</td><td rowspan=1 colspan=1>1693.59± 350.74</td><td rowspan=1 colspan=1>3983.34± 250.99</td><td rowspan=1 colspan=1>5980.37± 420.16</td><td rowspan=1 colspan=1>5988.65± 470.03</td></tr></table>
398
+
399
+ Table 11: Performance on HalfCheetah-v2 with different trajectories
400
+
401
+ <table><tr><td rowspan=1 colspan=5>HalfCheetah-v2</td></tr><tr><td rowspan=1 colspan=1>#Demo</td><td rowspan=1 colspan=4>5 10 20 50</td></tr><tr><td rowspan=1 colspan=1>Expert</td><td rowspan=1 colspan=4>12294.22 ± 208.41</td></tr><tr><td rowspan=1 colspan=1>BC</td><td rowspan=1 colspan=1>225.42 ± 147.16</td><td rowspan=1 colspan=1>971.42 ± 249.62</td><td rowspan=1 colspan=1>2782.76± 959.67</td><td rowspan=1 colspan=1>4813.20 ±1949.26</td></tr><tr><td rowspan=1 colspan=1>GAIL</td><td rowspan=1 colspan=1>-84.92 ± 43.29</td><td rowspan=1 colspan=1>474.42 ± 389.30</td><td rowspan=1 colspan=1>-116.70± 34.14</td><td rowspan=1 colspan=1>-175.83 ± 26.76</td></tr><tr><td rowspan=1 colspan=1>BC-GAIL</td><td rowspan=1 colspan=1>1362.59 ± 1255.57</td><td rowspan=1 colspan=1>578.85 ± 934.34</td><td rowspan=1 colspan=1>3744.32 ± 1471.90</td><td rowspan=1 colspan=1>1597.51 ± 1173.93</td></tr><tr><td rowspan=1 colspan=1>AIRL</td><td rowspan=1 colspan=1>782.36± 48.98</td><td rowspan=1 colspan=1>-146.46± 23.57</td><td rowspan=1 colspan=1>1437.25 ± 25.45</td><td rowspan=1 colspan=1>755.46 ±10.92</td></tr><tr><td rowspan=1 colspan=1>Our init</td><td rowspan=1 colspan=1>267.71± 90.38</td><td rowspan=1 colspan=1>1064.44± 227.32</td><td rowspan=1 colspan=1>3200.80± 520.04</td><td rowspan=1 colspan=1>7102.74 ± 910.54</td></tr><tr><td rowspan=1 colspan=1>Our final</td><td rowspan=1 colspan=1>513.66 ± 15.31</td><td rowspan=1 colspan=1>1616.34 ± 180.76</td><td rowspan=1 colspan=1>6059.27 ± 344.41</td><td rowspan=1 colspan=1>8817.32 ± 860.55</td></tr></table>
402
+
403
+ Table 12: Performance on Humanoid-v2 with different trajectories
404
+
405
+ <table><tr><td rowspan=1 colspan=5>Humanoid-v2</td></tr><tr><td rowspan=1 colspan=1>#Demo</td><td rowspan=1 colspan=2>5 10</td><td rowspan=1 colspan=2>20 50</td></tr><tr><td rowspan=1 colspan=1>Expert</td><td rowspan=1 colspan=2>5286.21</td><td rowspan=1 colspan=2>± 145.98</td></tr><tr><td rowspan=1 colspan=1>BC</td><td rowspan=1 colspan=1>1521.55± 272.14</td><td rowspan=1 colspan=1>3491.07± 518.64</td><td rowspan=1 colspan=1>4686.05 ±355.74</td><td rowspan=1 colspan=1>4746.88 ±605.61</td></tr><tr><td rowspan=1 colspan=1>GAIL</td><td rowspan=1 colspan=1>485.92± 27.59</td><td rowspan=1 colspan=1>486.44 ±27.18</td><td rowspan=1 colspan=1>477.15± 22.07</td><td rowspan=1 colspan=1>481.14± 24.37</td></tr><tr><td rowspan=1 colspan=1>BC-GAIL</td><td rowspan=1 colspan=1>363.68 ±44.44</td><td rowspan=1 colspan=1>410.03±33.07</td><td rowspan=1 colspan=1>487.99± 30.77</td><td rowspan=1 colspan=1>464.91±33.21</td></tr><tr><td rowspan=1 colspan=1>AIRL</td><td rowspan=1 colspan=1>79.72± 4.27</td><td rowspan=1 colspan=1>87.15 ± 5.01</td><td rowspan=1 colspan=1>-1293.86±10.70</td><td rowspan=1 colspan=1>84.84±6.46</td></tr><tr><td rowspan=1 colspan=1>Ourinit</td><td rowspan=1 colspan=1>452.31± 190.12</td><td rowspan=1 colspan=1>1517.63 ± 110.45</td><td rowspan=1 colspan=1>4610.25± 2750.86</td><td rowspan=1 colspan=1>4776.83 ± 1320.46</td></tr><tr><td rowspan=1 colspan=1>Our final</td><td rowspan=1 colspan=1>1225.58± 210.88</td><td rowspan=1 colspan=1>2190.43± 280.18</td><td rowspan=1 colspan=1>4716.91 ±680.29</td><td rowspan=1 colspan=1>4780.07± 700.01</td></tr></table>
406
+
407
+ # C HYPER-PARAMETER AND NETWORK ARCHITECTURE
408
+
409
+ When we pretrain the policy network with our methods, we choose $\beta = 0 . 0 5$ in $\beta$ -VAE. We use Adam with learning rate 3e-4 as the basic optimization algorithms for all the experiments. The policy network and value network used in the algorithms all use a three-layer relu network with hidden size 256. We choose $\sigma = 0 . 1$ in the policy prior for all the environments.
410
+
411
+ # D COMPARISON WITH AIRL (FU ET AL.) FROM A THEORETICAL PERSPECTIVE
412
+
413
+ Here we illustrate the theoretical advantage of our SAIL algorithm over AIRL in certain scenarios by an example.
414
+
415
+ The theory of AIRL shows that it is able to recover the groundtruth reward of an MDP up to a constant if the reward of this MDP is define on states only, when the adversarial learning reaches the equilibrium. Next we show a basic case that violates the theoretical assumption of AIRL but can be solved by our algorithm.
416
+
417
+ ![](images/a74acd57a2c3bfb96d00ac866d6a1eafca4ca45eddae85b2b42d48ec161493ea.jpg)
418
+ Figure 6: Two-ring MDP with deterministic transition
419
+
420
+ Figure 6 shows the states and transition of an MDP. The demonstration policy jumps back and forth between $s _ { 1 }$ and $s _ { 2 }$ periodically. Because our algorithm has the action prior (local alignment), it is clear that we can solve this problem. The dynamics of many periodic games, such as Walker and HalfCheetah in MuJoco, are extension of this two-ring graph.
421
+
422
+ It is easy to show that it is impossible for the adversarial game in AIRL to solve this problem at equilibrium. According to Sec 6 of Fu et al., the reward family of AIRL is parameterized as
423
+
424
+ $$
425
+ f _ { \theta } ( s , s ^ { \prime } ) = g ( s ) + \gamma h ( s ^ { \prime } ) - h ( s )
426
+ $$
427
+
428
+ For simplicity of notation, let $\phi ( s ) = g ( s ) - h ( s )$ and $\psi ( s ) = \gamma h ( s )$ , then
429
+
430
+ $$
431
+ f _ { \theta } ( s , s ^ { \prime } ) = \phi ( s ) + \psi ( s ^ { \prime } )
432
+ $$
433
+
434
+ In other words, the reward of AIRL is decomposible to the sum of two functions defined on states only.
435
+
436
+ Again, for simplicity, we omit the arguments of functions but use subscripts to represent states. For example, $f _ { 1 2 } \stackrel { - } { = } f ( \stackrel { - } { s _ { 1 } } , s _ { 2 } )$ and $\phi _ { 1 } = { \bar { \phi } } ( s _ { 1 } )$ . Then,
437
+
438
+ $$
439
+ \begin{array} { r } { f _ { 1 2 } = \phi _ { 1 } + \psi _ { 2 } , f _ { 1 1 } = \phi _ { 1 } + \psi _ { 1 } } \\ { f _ { 2 1 } = \phi _ { 2 } + \psi _ { 1 } , f _ { 2 2 } = \phi _ { 2 } + \psi _ { 2 } } \end{array}
440
+ $$
441
+
442
+ Assume that AIRL has reached the equilibrium and learned the optimal policy, then it must be true that $f _ { 1 2 } > f _ { 1 1 }$ and $f _ { 2 1 } > f _ { 2 2 }$ (otherwise, there exists other optimal policies). But $f _ { 1 2 } > f _ { 1 1 }$ implies that $\psi _ { 2 } > \psi _ { 1 }$ , while $f _ { 2 1 } > f _ { 2 2 }$ implies that $\psi _ { 1 } > \psi _ { 2 }$ , which is a contradiction.
md/train/ryxB2lBtvH/ryxB2lBtvH.md ADDED
@@ -0,0 +1,356 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # LEARNING TO COORDINATE MANIPULATION SKILLS VIA SKILL BEHAVIOR DIVERSIFICATION
2
+
3
+ Youngwoon Lee, Jingyun Yang, Joseph J. Lim
4
+
5
+ Department of Computer Science University of Southern California {lee504,jingyuny,limjj}@usc.edu
6
+
7
+ # ABSTRACT
8
+
9
+ When mastering a complex manipulation task, humans often decompose the task into sub-skills of their body parts, practice the sub-skills independently, and then execute the sub-skills together. Similarly, a robot with multiple end-effectors can perform complex tasks by coordinating sub-skills of each end-effector. To realize temporal and behavioral coordination of skills, we propose a modular framework that first individually trains sub-skills of each end-effector with skill behavior diversification, and then learns to coordinate end-effectors using diverse behaviors of the skills. We demonstrate that our proposed framework is able to efficiently coordinate skills to solve challenging collaborative control tasks such as picking up a long bar, placing a block inside a container while pushing the container with two robot arms, and pushing a box with two ant agents. Videos and code are available at https://clvrai.com/coordination.
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ Imagine you wish to play Chopin’s Fantaisie Impromptu on the piano. With little prior knowledge about the piece, you would first practice playing the piece with each hand separately. After independently mastering the left and right hand parts, you would move on to practicing with both hands simultaneously. To find the synchronized and non-interfering movements of two hands, you would try variable ways of playing the same melody with each hand, and eventually create a complete piece of music. Through the decomposition of skills into sub-skills of two hands and learning variations of sub-skills, humans make the learning process of manipulation skills much faster than learning everything at once.
14
+
15
+ Can autonomous agents efficiently learn complicated tasks with coordination of different skills from multiple end-effectors like humans? Learning to perform collaborative and composite tasks from scratch requires a huge amount of environment interaction and extensive reward engineering, which often results in undesired behaviors (Riedmiller et al., 2018). Hence, instead of learning a task at once, modular approaches (Andreas et al., 2017; Oh et al., 2017; Frans et al., 2018; Lee et al., 2019; Peng et al., 2019; Goyal et al., 2020) suggest to learn reusable primitive skills and solve more complex tasks by recombining the skills. However, all these approaches either focus on working with single end-effector manipulation or single agent locomotion, and these do not scale to multi-agent problems.
16
+
17
+ To this end, we propose a modular framework that learns to coordinate multiple end-effectors with their primitive skills for various robotics tasks, such as bimanual manipulation. The main challenge is that naive simultaneous execution of primitive skills from multiple end-effectors can often cause unintended behaviors (e.g. collisions between end-effectors). Thus, as illustrated in Figure 1, our model needs to learn to appropriately coordinate end-effectors; and hence needs a way to obtain, represent, and control detailed behaviors of each primitive skill. Inspired by these intuitions, our method consists of two parts: (1) acquiring primitive skills with diverse behaviors by mutual information maximization, and (2) learning a meta policy that selects a skill for each end-effector and coordinates the chosen skills by controlling the behavior of each skill.
18
+
19
+ The main contribution of this paper is a modular and hierarchical approach that tackles cooperative manipulation tasks with multiple end-effectors by (1) learning primitive skills of each end-effector independently with skill behavior diversification and (2) coordinating end-effectors using diverse behaviors of the skills. Our empirical results indicate that our proposed method is able to efficiently learn primitive skills with diverse behaviors and coordinate these skills to solve challenging collaborative control tasks such as picking up a long bar, placing a block inside the container on the right side, and pushing a box with two ant agents. We provide additional qualitative results and code at https://clvrai.com/coordination.
20
+
21
+ ![](images/7e1b9f5f33a08c620e270f4735ec881e08b70e6cf015791f9524143e7c2eda6a.jpg)
22
+ Figure 1: Composing complex skills using multiple agents’ primitive skills requires proper coordination between agents since concurrent execution of primitive skills requires temporal and behavioral coordination. For example, to move a block into a container on the other end of the table, the agent needs to not only utilize pick, place, and push primitive skills at the right time but also select the appropriate behaviors for these skills, represented as latent vectors $z _ { 1 }$ , $z _ { 2 }$ , $z _ { 3 }$ , and $z _ { 4 }$ above. Naive methods neglecting either temporal or behavioral coordination will produce unintended behaviors, such as collisions between end-effectors.
23
+
24
+ # 2 RELATED WORK
25
+
26
+ Deep reinforcement learning (RL) for continuous control is an active research area. However, learning a complex task either from a sparse reward or a heavily engineered reward becomes computationally impractical as the target task becomes complicated. Instead of learning from scratch, complex tasks can be tackled by decomposing the tasks into easier and reusable sub-tasks. Hierarchical reinforcement learning temporally splits a task into a sequence of temporally extended meta actions. It often consists of one meta policy (high-level policy) and a set of low-level policies, such as options framework (Sutton et al., 1999). The meta policy decides which low-level policy to activate and the chosen low-level policy generates an action sequence until the meta policy switches it to another lowlevel policy. Options can be discovered without supervision (Schmidhuber, 1990; Bacon et al., 2017; Nachum et al., 2018; Levy et al., 2019), meta-learned (Frans et al., 2018), pre-defined (Kulkarni et al., 2016; Oh et al., 2017; Merel et al., 2019; Lee et al., 2019), or attained from additional supervision signals (Andreas et al., 2017; Ghosh et al., 2018). However, option frameworks are not flexible to solve a task that requires simultaneous activation or interpolation of multiple skills since only one skill can be activated at each time step.
27
+
28
+ To solve composite tasks multiple policies can be simultaneously activated by adding Qfunctions (Haarnoja et al., 2018a), additive composition (Qureshi et al., 2020; Goyal et al., 2020), or multiplicative composition (Peng et al., 2019). As each policy takes the whole observation as input and controls the whole agent, it is not robust to changes in unrelated parts of the observation. For example, a left arm skill can be affected by the pose change in the right arm, which is not relevant to the left arm skill. Hence, these skill composition approaches can fail when an agent encounters a new combination of skills or a new skill is introduced since the agent will experience unseen observations.
29
+
30
+ Instead of having a policy with the full observation and action space, multi-agent reinforcement learning (MARL) suggests to explicitly split the observation and action space according to agents (e.g. robots or end-effectors), which allows efficient low-level policy training as well as flexible skill composition. For cooperative tasks, communication mechanisms (Sukhbaatar et al., 2016; Peng et al., 2017; Jiang & Lu, 2018), sharing policy parameters (Gupta et al., 2017), and decentralized actor with centralized critic (Lowe et al., 2017; Foerster et al., 2018) have been actively used. However, these approaches suffer from the credit assignment problem (Sutton, 1984) among agents and the lazy agent problem (Sunehag et al., 2018). As agents have more complicated morphology and larger observation space, learning a policy for a multi-agent system from scratch requires extremely long training time. Moreover, the credit assignment problem becomes more challenging when the complexity of cooperative tasks increases and all agents need to learn completely from scratch. To resolve these issues, we propose to first train reusable skills for each agent in isolation, instead of learning primitive skills of multiple agents together. Then, we recombine these skills (Maes & Brooks, 1990) to complete more complicated tasks with learned coordination of the skills.
31
+
32
+ ![](images/63021c65e6e95a999eba964c17a1759f617f5364c3d76c2f449409b6d5dca506.jpg)
33
+ Figure 2: Our method is composed of two components: a meta policy and a set of agent-specific primitive policies relevant to task completion. The meta policy selects which primitive skill to run for each agent as well as the behavior embedding (i.e. variation in behavior) of the chosen primitive skill. Each selected primitive skill takes as input the agent observation and the behavior embedding and outputs action for that agent.
34
+
35
+ To coordinate skills from multiple agents, the skills have to be flexible; hence, a skill can be adjusted to collaborate with other agents’ skills. Maximum entropy policies (Haarnoja et al., 2017; 2018a;b) can learn diverse ways to achieve a goal by maximizing not only reward but also entropy of the policy. In addition, Eysenbach et al. (2019) proposes to discover diverse skills without reward by maximizing entropy as well as mutual information between resulting states and latent representations of skills (i.e. skill embeddings). Our method leverages the maximum entropy policy (Haarnoja et al., 2018b) with the discriminability objective (Eysenbach et al., 2019) to learn a primitive skill with diverse behaviors conditioned on a controllable skill embedding. This controllable skill embedding will be later used as a behavior embedding for the meta policy to adjust a primitive skill’s behavior for coordination.
36
+
37
+ # 3 METHOD
38
+
39
+ In this paper, we address the problem of solving cooperative manipulation tasks that require collaboration between multiple end-effectors or agents. Note that we use the terms “end-effector” and “agent” interchangeably in this paper. Instead of learning a multi-agent task from scratch (Lowe et al., 2017; Gupta et al., 2017; Sunehag et al., 2018; Foerster et al., 2018), modular approaches (Andreas et al., 2017; Frans et al., 2018; Peng et al., 2019) suggest to learn reusable primitive skills and solve more complex tasks by recombining these skills. However, concurrent execution of primitive skills of multiple agents fails when agents never experienced a combination of skills during the pre-training stage, or skills require temporal or behavioral coordination.
40
+
41
+ Therefore, we propose a modular and hierarchical framework that learns to coordinate multiple agents with primitive skills to perform a complex task. Moreover, during primitive skill training, we propose to learn a latent behavior embedding, which provides controllability of each primitive skill to the meta policy while coordinating skills. In Section 3.2, we describe our modular framework in detail. Next, in Section 3.3, we elaborate how controllable primitive skills can be acquired. Lastly, we describe how the meta policy learns to coordinate primitive skills in Section 3.4.
42
+
43
+ # 3.1 PRELIMINARIES
44
+
45
+ We formulate our problem as a Markov decision process defined by a tuple $\{ S , { \mathcal { A } } , { \mathcal { T } } , R , \rho , \gamma \}$ of states, actions, transition probability, reward, initial state distribution, and discount factor. In our formulation, we assume the environment includes $N$ agents. To promote consistency in our terminology, we use superscripts to denote the index of agent and subscripts to denote time or primitive skill index. Hence, the state space and action space for an agent $i$ can be represented as $S ^ { \imath }$ and $A ^ { i }$ where each element of $S ^ { i }$ is a subset of the corresponding element in $\boldsymbol { S }$ and $\mathcal { A } = \mathcal { A } ^ { 1 } \times \mathcal { A } ^ { 2 } \times \cdot \cdot \cdot \times \mathcal { A } ^ { N }$ , respectively. For each agent $i$ , we provide a set of $m ^ { i }$ skills, $\Pi ^ { i } = \{ \pi _ { 1 } ^ { i } , \ldots , \pi _ { m ^ { i } } ^ { i } \}$ . A policy of an agent $i$ is represented as $\pi _ { c _ { t } ^ { i } } ^ { i } \left( a _ { t } ^ { i } | s _ { t } ^ { i } \right) \in \Pi ^ { i }$ where is sam $c _ { t } ^ { i }$ is a skiled from index, , and t $s _ { t } ^ { i } \in S ^ { i }$ is a state, and agents take act $a _ { t } ^ { i } \in \mathcal A ^ { i }$ action at time sampled from $t$ . composite policy $\pi ( a _ { t } ^ { 1 } , \bar { a } _ { t } ^ { 2 } , \dots , a _ { t } ^ { N } | s _ { t } , c _ { t } ^ { 1 } , c _ { t } ^ { 2 } , \dots , \bar { c } _ { t } ^ { N } ) = ( \pi _ { c _ { t } ^ { 1 } } ^ { 1 } ( a _ { t } ^ { 1 } | s _ { t } ) , \pi _ { c _ { t } ^ { 2 } } ^ { 2 } ( a _ { t } ^ { 2 } | s _ { t } ) , \dots , \pi _ { c _ { t } ^ { N } } ^ { N } ( a _ { t } ^ { N } | s _ { t } ) )$ $\rho$ $N$ $a _ { t } ^ { 1 } , a _ { t } ^ { 2 } , \ldots , a _ { t } ^ { N }$ a singl, where reward is the e $r _ { t }$ . The performance is evaluated based on a discounted return sode horizon. $R =$ $\textstyle \sum _ { t = 0 } ^ { T - 1 } \gamma ^ { t } r _ { t }$ $T$
46
+
47
+ ![](images/852e7eff92afaaa227e4f7f1a58fdeda7147bb405d07ee79a206747f65017adf.jpg)
48
+ Figure 3: Different multi-agent architectures. (a) The vanilla RL method considers all agents as a monolithic agent; thus a single policy takes the full observation as input and outputs the full action. (b) The multi-agent RL method (MARL) consists of $N$ policies that operate on the observations and actions of corresponding agents. (c) The modular network consists of $N$ sets of skills for the $N$ agents trained in isolation and a meta policy that selects a skill for each agent. (d-f) The RL, MARL, and modular network methods augmented with skill behavior diversification (SBD) has a meta policy that outputs a skill behavior embedding vector $z$ for each skill.
49
+
50
+ # 3.2 MODULAR FRAMEWORK
51
+
52
+ As illustrated in Figure 2, our model is composed of two components: a meta policy $\pi _ { m e t a }$ and a set of primitive skills of $N$ agents $\Pi ^ { 1 } , \dots , \Pi ^ { N }$ . Note that each primitive skill $\pi _ { c ^ { i } } ^ { i } \in \Pi ^ { i }$ contains variants of behaviors parameterized by an $N _ { z }$ -dimensional latent behavior embedding $z ^ { i }$ (see Section 3.3). The meta policy selects a skill to execute for each agent, rather than selecting one primitive skill for the entire multi-agent system to execute. Also, we give the meta policy the capability to select which variant of the skill to execute (see Section 3.4). Then, the chosen primitive skills are simultaneously executed for $T _ { l o w }$ time steps.
53
+
54
+ The concurrent execution of multiple skills often leads to undesired results and therefore requires coordination between the skills. For example, naively placing a block in the left hand to a container being moved by the right hand can cause collision between the two robot arms. The arms can avoid collision while performing the skills by properly adjusting their skill behaviors (e.g. the left arm leaning to the left side while placing the block and the right arm leaning to the right side while pushing the container) as shown in Figure 1. In our method, the meta policy learns to coordinate multiple agents’ skills by manipulating the behavior embeddings (i.e. selecting a proper behavior from diverse behaviors of each skill).
55
+
56
+ # 3.3 TRAINING AGENT-SPECIFIC PRIMITIVE SKILLS WITH DIVERSE BEHAVIORS
57
+
58
+ To adjust a primitive skill to collaborate with other agents’ skills in a new environment, the skill needs to support variations of skill behaviors when executed at a given state. Moreover, a behavioral variation of a skill should be controllable by the meta policy for skill coordination. In order to make our primitive skill policies generate diverse behaviors controlled by a latent vector $z$ , we leverage the entropy and mutual information maximization objective introduced in Eysenbach et al. (2019).
59
+
60
+ More specifically, a primitive policy of an agent $i$ outputs an action $a \in { \mathcal { A } }$ conditioned on the current state $s \in S$ and a latent behavior embedding $z \sim p ( z )$ , where the prior distribution $p ( z )$ is Gaussian (we omit agent $i$ in this section for the simplicity of notations). Diverse behaviors conditioned on a random sample $z$ can be achieved by maximizing the mutual information between behaviors and states $M I ( s , z )$ , while minimizing the mutual information between behaviors and actions given the state $M I ( a , z | s )$ , together with maximizing the entropy of the policy $\mathcal { H } ( a | s )$ to encourage diverse behaviors. The objective can be written as follows (we refer the readers to Eysenbach et al. (2019)
61
+
62
+ # Algorithm 1 ROLLOUT
63
+
64
+ 1: Input: Meta policy $\pi _ { m e t a }$ , sets of primitive policies $\Pi ^ { 1 } , . . . , \Pi ^ { N }$ , and meta horizon $T _ { l o w }$
65
+ 2: Initialize an episode $t \gets 0$ and receive initial state $s _ { 0 }$
66
+ 3: while episode is not terminated do
67
+ 4: Sample skill indexes and behavior embeddings $( c _ { t } ^ { 1 } , \ldots , c _ { t } ^ { N } ) , ( z _ { t } ^ { 1 } , \ldots , z _ { t } ^ { N } ) \sim \pi _ { m e t a } ( s _ { t } )$
68
+ 5: $\tau 0$
69
+ 6: while $\tau < T _ { l o w }$ and episode is not terminated do
70
+ 7: $\boldsymbol a _ { t + \tau } = ( a _ { t + \tau } ^ { 1 } , \dots , \dot { a _ { t + \tau } ^ { N } } ) \sim ( \pi _ { c _ { t } ^ { 1 } } ^ { 1 } ( s _ { t + \tau } , z _ { t } ^ { 1 } ) , \dots , \pi _ { c _ { t } ^ { N } } ^ { N } ( s _ { t + \tau } , z _ { t } ^ { N } ) )$
71
+ 8: $\begin{array} { r l } & { s _ { t + \tau + 1 } , r _ { t + \tau } \gets \mathrm { E N V } ( s _ { t + \tau } , a _ { t + \tau } ) } \\ & { \tau \gets \tau + 1 } \end{array}$
72
+ 9:
73
+ 10: end while
74
+ 11: Add a transition $s _ { t } , ( c _ { t } ^ { 1 } , \ldots , c _ { t } ^ { N } ) , ( z _ { t } ^ { 1 } , \ldots , z _ { t } ^ { N } ) , s _ { t + \tau } , r _ { t : t + \tau - 1 }$ to the rollout buffer $\boldsymbol { B }$
75
+ 12: $t \gets t + \tau$
76
+ 13: end while
77
+
78
+ for derivation):
79
+
80
+ $$
81
+ \begin{array} { r l } & { \mathcal { F } ( \theta ) = M I ( s , z ) - M I ( a , z \vert s ) + \mathcal { H } ( a \vert s ) = \mathcal { H } ( a \vert s , z ) - \mathcal { H } ( z \vert s ) + \mathcal { H } ( z ) } \\ & { \quad \quad = \mathcal { H } ( a \vert s , z ) + \mathbb { E } _ { z \sim p ( z ) , s \sim \pi ( z ) } [ \log p ( z \vert s ) ] - \mathbb { E } _ { z \sim p ( z ) } [ \log p ( z ) ] } \\ & { \quad \quad \geq \mathcal { H } ( a \vert s , z ) + \mathbb { E } _ { z \sim p ( z ) , s \sim \pi ( z ) } [ \log q _ { \phi } ( z \vert s ) - \log p ( z ) ] , } \end{array}
82
+ $$
83
+
84
+ where the learned discriminator $q _ { \phi } ( z | s )$ approximates the posterior $p ( z | s )$ .
85
+
86
+ To achieve a primitive skill with diverse behaviors, we augment Equation (3) to the environment reward:
87
+
88
+ $$
89
+ r _ { t } + \lambda _ { 1 } \mathcal { H } ( a | s , z ) + \lambda _ { 2 } \mathbb { E } _ { z \sim p ( z ) , s \sim \pi ( z ) } [ \log q _ { \phi } ( z | s ) - \log p ( z ) ] ,
90
+ $$
91
+
92
+ where $\lambda _ { 1 }$ is the entropy coefficient and $\lambda _ { 2 }$ is the diversity coefficient which corresponds identifiability of behaviors. Maximizing Equation (3) encourages multi-modal exploration strategies while maximizing the reward $r _ { t }$ forces to achieve its own goal. Moreover, by maximizing identifiability of behaviors, the latent vector $z$ , named behavior embedding, can represent a variation of the learned policy and thus can be used to control the behavior of the policy. For example, when training a robot to move an object, a policy learns to move the object quickly as well as slowly, and these diverse behaviors map to different latent vectors $z$ . We empirically show that the policies with diverse behaviors achieve better compositionality with other agents in our experiments.
93
+
94
+ # 3.4 COMPOSING PRIMITIVE SKILLS WITH META POLICY
95
+
96
+ We denote the meta policy as $\pi _ { m e t a } ( c ^ { 1 } , \ldots , c ^ { N } , z ^ { 1 } , \ldots , z ^ { N } | s _ { t } )$ , where $c ^ { i } \in [ 1 , m ^ { i } ]$ represents a skill index of an agent $i \in [ 1 , N ]$ and $z ^ { i } \in \mathbb { R } ^ { N _ { z } }$ represents a behavior embedding of the skill. Every $T _ { l o w }$ time steps, the meta policy chooses one primitive skill $\pi _ { c ^ { i } } ^ { i } \in \Pi ^ { i }$ for each agent $i$ . Also, the meta policy outputs a set of latent behavior embeddings $( z ^ { 1 } , z ^ { 2 } , \dots , z ^ { N } )$ and feeds them to the corresponding skills (i.e. $\pi _ { c ^ { i } } ^ { i } ( a ^ { i } | s ^ { i } , z ^ { i } )$ for agent $i$ ). Once a set of primitive skills $\{ \pi _ { c ^ { 1 } } ^ { 1 } , \ldots , \pi _ { c ^ { N } } ^ { N } \}$ are chosen to be executed, each primitive skill generates an action $a ^ { i } \sim \pi _ { c ^ { i } } ^ { i } ( a ^ { i } | s ^ { i } , z ^ { i } )$ based on the current state $s ^ { i }$ and the latent vector $z ^ { i }$ . Algorithm 1 illustrates the overall rollout process.
97
+
98
+ Since there are a finite number of skills for each agent to execute, the meta action space for each agent $[ 1 , m ^ { i } ]$ is discrete, while the behavior embedding space for each agent $\mathbb { R } ^ { N _ { z } }$ is continuous. Thus, the meta policy is modeled as a $( 2 \times N )$ -head neural network where the first $N$ heads represent $m ^ { i }$ -way categorical distributions for skill selection and the last $N$ heads represent $N _ { z }$ -dimensional Gaussian distributions for behavior control of the chosen skill.
99
+
100
+ # 3.5 IMPLEMENTATION
101
+
102
+ We model the primitive policies and posterior distributions $q _ { \phi }$ as neural networks. We train the primitive policies using soft actor-critic (Haarnoja et al., 2018b). When we train a primitive policy, we use a unit Gaussian distribution as the prior distribution of latent variables $p ( z )$ . We use 5 as the size of latent behavior embedding $N _ { z }$ . Each primitive policy outputs the mean and standard deviation of a Gaussian distribution over an action space. For a primitive policy, we apply tanh activation to normalize the action between $[ - 1 , 1 ]$ . We model the meta policy as neural network with multiple heads that output the skill index $\bar { c } ^ { i }$ and behavior embedding $z ^ { i }$ for each agent. The meta policy is trained using PPO (Schulman et al., 2017; 2016; Dhariwal et al., 2017). All policy networks in this paper consist of 3 fully connected layers of 64 hidden units with ReLU nonlinearities. The discriminator $q _ { \phi }$ in Equation (4) is a 2-layer fully connected network with 64 hidden units.
103
+
104
+ ![](images/11edbefb96b52e765ac0cdb4e36075acafa79155b0f2fabe7fb7cdafaf5487ff.jpg)
105
+ Figure 4: The composite tasks pose a challenging combination of object manipulation and locomotion skills, which requires coordination of multiple agents and temporally extended behaviors. (a) The left Jaco arm needs to pick up a block while the right Jaco arm pushes a container, and then it places the block into the container. (b) Two Jaco arms are required to pick and place a bar-shaped block together. (c) Two ants push the red box to the goal location (green circle) together.
106
+
107
+ # 4 EXPERIMENTS
108
+
109
+ To demonstrate the effectiveness of our framework, we compare our method to prior methods in the field of multi-agent RL and ablate the components of our framework to understand their importance. We conducted experiments on a set of challenging robot control environments that require coordination of different agents to complete collaborative robotic manipulation and locomotion tasks.
110
+
111
+ Through our experiments, we aim to answer the following questions: (1) can our framework efficiently learn to combine primitive skills to execute a complicated task; (2) can our learned agent exhibit collaborative behaviors during task execution; and (3) can our framework leverage the controllable behavior variations of the primitive skills to achieve better coordination?
112
+
113
+ For details about environments and training, please refer to the supplementary material. As the performance of training algorithms varies between runs, we train each method on each task with 6 different random seeds and report mean and standard deviation of each method’s success rate.
114
+
115
+ # 4.1 BASELINES
116
+
117
+ We compare the performance of our method with various single- and multi-agent RL methods illustrated in Figure 3:
118
+
119
+ Single-agent RL (RL): A vanilla RL method where a single policy takes as input the full observation and outputs all agents’ actions.
120
+
121
+ Multi-agent RL (MARL): A multi-agent RL method where each of $N$ policies takes as input the observation of the corresponding agent and outputs an action for that agent. All policies share the global critic learned from a single task reward (Lowe et al., 2017).
122
+
123
+ Modular Framework (Modular): A modular framework composed of a meta policy and $N$ sets of primitive skills (i.e. one or more primitive skills per agent). Every $T _ { l o w }$ time steps, the meta policy selects a primitive skill for each agent based on the full observation. Then, the chosen skills are executed for $T _ { l o w }$ time steps.
124
+
125
+ ![](images/38d7a3b3c6d72759e19da2cea6bad148d9e0ead37b5a570252e66d5ccb027d90.jpg)
126
+ Figure 5: Success rates of our method (Modular-SBD) and baselines. For modular frameworks (Modular and Modular-SBD), we shift the learning curves rightwards the total number of environment steps the agent takes to learn the primitive skills (0.9 M, $1 . 2 \mathbf { M }$ , and $2 . 0 \mathbf { M }$ , respectively). Our method substantially improves learning speed and performance on JACO PICK-PUSH-PLACE and ANT PUSH. The shaded areas represent the standard deviation of results from six different seeds. The curves are smoothed using moving average over 10 runs.
127
+
128
+ Single-agent RL with Skill Behavior Diversification (RL-SBD): An RL method augmented with the behavior diversification objective. A meta policy is employed to generate a behavior embedding for a low-level policy, and the low-level policy outputs all agents’ actions conditioned on the behavior embedding and the full observation for $T _ { l o w }$ time steps. The meta policy and the low-level policy are jointly trained with the behavior diversification objective described in Equation (4).
129
+
130
+ Multi-agent RL with Skill Behavior Diversification (MARL-SBD): A MARL method augmented with the behavior diversification objective. A meta policy generates $N$ behavior embeddings. Then, each low-level policy outputs each agent’s action conditioned on its observation and behavior embedding for $T _ { l o w }$ time steps. All policies are jointly trained to maximize Equation (4).
131
+
132
+ Modular Framework with Skill Behavior Diversification (Modular-SBD, Ours): Our method which coordinates primitive skills of multiple agents. The modular framework consists of a meta policy and $N$ sets of primitive skills, where each primitive skill is conditioned on a behavior embedding $z$ . The meta policy takes as input the full observation and selects both a primitive skill and a behavior embedding for each agent. Then, each primitive skill outputs action for each agent.
133
+
134
+ # 4.2 JACO PICK-PUSH-PLACE
135
+
136
+ We developed JACO PICK-PUSH-PLACE and JACO BAR-MOVING environments using two Kinova Jaco arms, where each Jaco arm is a 9 DoF robotic arm with 3 fingers. JACO PICK-PUSH-PLACE starts with a block on the left and a container on the right. The robotic arms need to pick up the block, push the container to the center, and place the block inside the container. For successful completion of the task, the two Jaco arms have to concurrently execute their distinct sets of skills and dynamically adjust their picking, pushing, and placing directions to avoid collision between arms.
137
+
138
+ Primitives skills. There are three primitive skills available to each arm: Picking up, Pushing, and Placing to center (see Figure 4a). Picking up requires a robotic arm to pick up a small block, which is randomly placed on the table. If the block is not picked up after a certain amount of time or the arm drops the block, the agent fails. Pushing learns to push a big container to its opposite side (e.g. from left to the center or from right to center). The agent fails if it cannot place the container to the center. Placing to center requires placing an object in the gripper to the table. The agent only succeeds when it stably places the object at the desired location on the container.
139
+
140
+ Composite task. Our method (Modular-SBD) can successfully perform JACO PICK-PUSH-PLACE task while all baselines fail to compose primitive skills as shown in Figure 5a. The RL and MARL baselines cannot learn the composite task mainly because the agent requires to learn the combinatorial number of skill compositions and to solve the credit assignment problem across multiple agents. Since the composite task requires multiple primitive skills of multiple agents to be performed properly at the same time, a reward signal about a failure case cannot be assigned to the correct agent or skill. By using pre-trained primitive skills, the credit assignment problem is relaxed and all agents can
141
+
142
+ <table><tr><td></td><td>Jaco Pick-Push-Place</td><td>Jaco Bar-Moving</td><td>Ant Push</td></tr><tr><td>RL</td><td>0.000±0.000</td><td>0.000±0.000</td><td>0.000±0.000</td></tr><tr><td>MARL</td><td>0.000±0.000</td><td>0.000± 0.000</td><td>0.000± 0.000</td></tr><tr><td>RL-SBD</td><td>0.000± 0.000</td><td>0.000± 0.000</td><td>0.000±0.000</td></tr><tr><td>MARL-SBD</td><td>0.000 ± 0.000</td><td>0.000 ±0.000</td><td>0.000 ± 0.000</td></tr><tr><td>Modular</td><td>0.324± 0.468</td><td>0.917± 0.276</td><td>0.003± 0.058</td></tr><tr><td>Modular-SBD (Ours)</td><td>0.902 ± 0.298</td><td>0.950 ± 0.218</td><td>0.323 ± 0.468</td></tr></table>
143
+
144
+ Table 1: Success rates for all tasks, comparing our method against baselines. Each entry in the table represents average success rate and standard deviation over 100 runs. The baselines learning from scratch fail to learn complex tasks with multiple agents.
145
+
146
+ perform their skills concurrently. Therefore, the Modular baseline learns to achieve success but shows significantly lower performance than our method (Modular-SBD). This is because the lack of skill behavior diversification makes it impossible to adjust pushing and placing trajectories during skill composition time, which resulting in frequent end-effector collisions.
147
+
148
+ # 4.3 JACO BAR-MOVING
149
+
150
+ In JACO BAR-MOVING, two Jaco arms need to pick up a long bar together, move the bar towards a target location while maintaining its rotation, and place it on the table (see Figure 4b). The initial position of the bar is randomly initialized every episode and an agent needs to find appropriate coordination between two arms for each initialization. Compared to JACO PICK-PUSH-PLACE, this task requires that the two arms synchronize their movements and perform more micro-level adjustments to their behaviors.
151
+
152
+ Primitives skills. There are two pre-trained primitive skills available to each arm: Picking up and Placing towards arm. Picking up is same as described in Section 4.2. Placing towards arm learns to move a small block (half size of the block used in the composite task) in the hand towards the robotic arm and then place it on the table. The agent fails if it cannot place the block to the target location.
153
+
154
+ Composite task. The JACO BAR-MOVING task requires the two arms to work very closely together. For example, the Picking up skill of both arms should be synchronized when they start to lift the bar and two arms require to lift the bar while maintaining the relative position between them since they are connected by holding the bar. The modular framework without explicit coordination of skills (Modular) can synchronize the execution of picking, moving, and placing. But the inability to micro-adjust the movement of the other arm causes instability of bar picking and moving. This results in degraded success rates compared to the modular framework with explicit coordination. Meanwhile, all baselines without pre-defined primitive skills fail to learn JACO BAR-MOVING.
155
+
156
+ # 4.4 ANT PUSH
157
+
158
+ We developed a multi-ant environment, ANT-PUSH, inspired from Nachum et al. (2019), simulated in the MuJoCo (Todorov et al., 2012) physics engine. We use the ant model in OpenAI Gym (Brockman et al., 2016). In this environment, two ants need to push a large object toward a green target place, collaborating with each other to keep the angle of the object as stable as possible (see Figure 4c).
159
+
160
+ Primitives skills. We train walking skills of an ant agent in 4 directions: up, down, left, and right. During primitive skill training, a block (half size of the block used in the composite task) and an ant agent are randomly placed. Pushing the block gives an additional reward to the agent, which prevents an ant to avoid the block. The learned primitive skills have different speed and trajectories conditioned on the latent behavior embedding.
161
+
162
+ Composite task. Our method achieves $3 2 . 3 \%$ success rate on ANT PUSH task while all baselines fail to compose primitive skills as shown in Figure 5c and Table 1. The poor performance of RL, MARL, RL-SBD, and MARL-SBD baselines shows the difficulty of credit assignment between agents, which leads one of the ants moves toward a block and pushes it but another ant does not move. Moreover, the Modular baseline with primitive skills also fails to learn the pushing task. This result illustrates the importance of coordination of agents, which helps synchronizing and controlling the velocities of both ant agents to push the block toward the goal position while maintaining its rotation.
163
+
164
+ ![](images/99d31a6b5e96ecb62faf4db19c419b513aea19dd229cabd50fa233595361425f.jpg)
165
+ Figure 6: Learning curves of our method with different diversity coefficients $\lambda _ { 2 }$ on ANT PUSH.
166
+ Figure 7: Success rates of our method with different $T _ { l o w }$ coefficients on Jaco environments.
167
+
168
+ # 4.5 EFFECT OF DIVERSITY OF PRIMITIVE SKILLS
169
+
170
+ To analyze the effect of the diversity of primitive skills, we compare our model with primitive skills trained with different diversity coefficients $\lambda _ { 2 } = \{ 0 . 0 , 0 . 0 5 , 0 . 1 , 0 . 5 , 1 . 0 \}$ in Equation (4) on ANT PUSH. Figure 6 shows that with small diversity coefficients $\lambda _ { 2 } = \{ 0 . 0 5 , 0 . 1 \}$ , the agent can control detailed behaviors of primitive skills while primitive skills without diversity ${ \lambda } _ { 2 } = 0$ ) cannot be coordinated. The meta policy tries to synchronize two ant agents’ positions and velocities by switching primitive skills, but it cannot achieve proper coordination without diversified skills. On the other hand, large diversity coefficients $\lambda _ { 2 } = \bar { \{ 0 . 5 , 1 . 0 \} }$ make the primitive skills often focus on demonstrating diverse behaviors and fail to achieve the goals of the skills. Hence, these primitive skills do not have enough functionality to solve the target task. The diversity coefficient needs to be carefully chosen to acquire primitive skills with good performance as well as diverse behaviors.
171
+
172
+ # 4.6 EFFECT OF SKILL SELECTION INTERVAL $T _ { l o w }$
173
+
174
+ To analyze the effect of the skill selection interval hyperparameter $T _ { l o w }$ , we compare our method trained with $T _ { l o w } = \{ 1 , 2 , 3 , 5 , 1 0 \}$ on Jaco environments. The success rate curves in Figure 7 demonstrate that smaller $T _ { l o w }$ values in range [1, 3] lead to better performance. This can be because the agent can realize more flexible skill coordination by adjusting the behavior embedding frequently.
175
+
176
+ In addition to the fixed $T _ { l o w }$ values, we also consider the variation of our method in which the skill behavior embedding is only sampled when the meta policy updates its skill selection. Concretely, we set the value of $T _ { l o w }$ to 1 but update $( z _ { t } ^ { 1 } , \ldots , z _ { t } ^ { N } )$ only if $\mathbf { \bar { \Phi } } ( c _ { t } ^ { 1 } , \ldots , c _ { t } ^ { N } ) \neq ( c _ { t - 1 } ^ { 1 } , \ldots , c _ { t - 1 } ^ { N } )$ . We observe that in this setting, the meta policy at times switch back and forth between two skills in two consecutive time steps, leading to slightly worse performance compared to our method with small $T _ { l o w }$ values. This indicates that the meta policy needs to adjust the behavior embedding in order to optimally coordinate skills of the different agents.
177
+
178
+ # 5 CONCLUSION
179
+
180
+ In this paper, we propose a modular framework with skill coordination to tackle challenges of composition of sub-skills with multiple agents. Specifically, we use entropy maximization with mutual information maximization to train controllable primitive skills with diverse behaviors. To coordinate learned primitive skills, the meta policy predicts not only the skill to execute for each agent (end-effector) but also the behavior embedding that controls the chosen primitive skill’s behavior. The experimental results on robotic manipulation and locomotion tasks demonstrate that the proposed framework is able to efficiently learn primitive skills with diverse behaviors and coordinate multiple agents (end-effectors) to solve challenging cooperative control tasks. Acquiring skills without supervision and extending our method to a visual domain are exciting directions for future work.
181
+
182
+ # ACKNOWLEDGMENTS
183
+
184
+ This project was funded by SKT. The authors would like to thank Karl Pertsch and many members of the USC CLVR lab for helpful discussion.
185
+
186
+ # REFERENCES
187
+
188
+ Jacob Andreas, Dan Klein, and Sergey Levine. Modular multitask reinforcement learning with policy sketches. In International Conference on Machine Learning, pp. 166–175, 2017.
189
+
190
+ Pierre-Luc Bacon, Jean Harb, and Doina Precup. The option-critic architecture. In Association for the Advancement of Artificial Intelligence, 2017.
191
+
192
+ Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym. arXiv preprint arXiv:1606.01540, 2016.
193
+
194
+ Prafulla Dhariwal, Christopher Hesse, Oleg Klimov, Alex Nichol, Matthias Plappert, Alec Radford, John Schulman, Szymon Sidor, Yuhuai Wu, and Peter Zhokhov. Openai baselines. https: //github.com/openai/baselines, 2017.
195
+
196
+ Benjamin Eysenbach, Abhishek Gupta, Julian Ibarz, and Sergey Levine. Diversity is all you need: Learning skills without a reward function. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=SJx63jRqFm.
197
+
198
+ Jakob N Foerster, Gregory Farquhar, Triantafyllos Afouras, Nantas Nardelli, and Shimon Whiteson. Counterfactual multi-agent policy gradients. In Association for the Advancement of Artificial Intelligence, 2018.
199
+
200
+ Kevin Frans, Jonathan Ho, Xi Chen, Pieter Abbeel, and John Schulman. META LEARNING SHARED HIERARCHIES. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ SyX0IeWAW.
201
+
202
+ Dibya Ghosh, Avi Singh, Aravind Rajeswaran, Vikash Kumar, and Sergey Levine. Divide-andconquer reinforcement learning. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $=$ rJwelMbR-.
203
+
204
+ Anirudh Goyal, Shagun Sodhani, Jonathan Binas, Xue Bin Peng, Sergey Levine, and Yoshua Bengio. Reinforcement learning with competitive ensembles of information-constrained primitives. In International Conference on Learning Representations, 2020. URL https://openreview. net/forum?id $=$ ryxgJTEYDr.
205
+
206
+ Jayesh K Gupta, Maxim Egorov, and Mykel Kochenderfer. Cooperative multi-agent control using deep reinforcement learning. In International Conference on Autonomous Agents and Multi-Agent Systems, pp. 66–83, 2017.
207
+
208
+ Tuomas Haarnoja, Haoran Tang, Pieter Abbeel, and Sergey Levine. Reinforcement learning with deep energy-based policies. In International Conference on Machine Learning, pp. 1352–1361, 2017.
209
+
210
+ Tuomas Haarnoja, Vitchyr Pong, Aurick Zhou, Murtaza Dalal, Pieter Abbeel, and Sergey Levine. Composable deep reinforcement learning for robotic manipulation. In IEEE International Conference on Robotics and Automation, pp. 6244–6251, 2018a.
211
+
212
+ Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. In International Conference on Machine Learning, pp. 1856–1865, 2018b.
213
+
214
+ Jiechuan Jiang and Zongqing Lu. Learning attentional communication for multi-agent cooperation. In Advances in Neural Information Processing Systems, pp. 7254–7264, 2018.
215
+
216
+ Tejas D Kulkarni, Karthik Narasimhan, Ardavan Saeedi, and Josh Tenenbaum. Hierarchical deep reinforcement learning: Integrating temporal abstraction and intrinsic motivation. In Advances in Neural Information Processing Systems, pp. 3675–3683, 2016.
217
+
218
+ Youngwoon Lee, Shao-Hua Sun, Sriram Somasundaram, Edward Hu, and Joseph J. Lim. Composing complex skills by learning transition policies. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ rygrBhC5tQ.
219
+
220
+ Andrew Levy, Robert Platt, and Kate Saenko. Hierarchical reinforcement learning with hindsight. In International Conference on Learning Representations, 2019. URL https://openreview. net/forum?id ${ . } = { }$ ryzECoAcY7.
221
+
222
+ Ryan Lowe, Yi Wu, Aviv Tamar, Jean Harb, OpenAI Pieter Abbeel, and Igor Mordatch. Multi-agent actor-critic for mixed cooperative-competitive environments. In Advances in Neural Information Processing Systems, pp. 6379–6390, 2017.
223
+
224
+ Pattie Maes and Rodney A Brooks. Learning to coordinate behaviors. In Association for the Advancement of Artificial Intelligence, volume 90, pp. 796–802, 1990.
225
+
226
+ Josh Merel, Arun Ahuja, Vu Pham, Saran Tunyasuvunakool, Siqi Liu, Dhruva Tirumala, Nicolas Heess, and Greg Wayne. Hierarchical visuomotor control of humanoids. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id $=$ BJfYvo09Y7.
227
+
228
+ Ofir Nachum, Shixiang Shane Gu, Honglak Lee, and Sergey Levine. Data-efficient hierarchical reinforcement learning. In Advances in Neural Information Processing Systems, pp. 3303–3313, 2018.
229
+
230
+ Ofir Nachum, Michael Ahn, Hugo Ponte, Shixiang Gu, and Vikash Kumar. Multi-agent manipulation via locomotion using hierarchical sim2real. In Conference on Robot Learning, 2019.
231
+
232
+ Junhyuk Oh, Satinder Singh, Honglak Lee, and Pushmeet Kohli. Zero-shot task generalization with multi-task deep reinforcement learning. In International Conference on Machine Learning, pp. 2661–2670, 2017.
233
+
234
+ 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 Advances in Neural Information Processing Systems Autodiff Workshop, 2017.
235
+
236
+ Peng Peng, Ying Wen, Yaodong Yang, Quan Yuan, Zhenkun Tang, Haitao Long, and Jun Wang. Multiagent bidirectionally-coordinated nets: Emergence of human-level coordination in learning to play starcraft combat games. arXiv preprint arXiv:1703.10069, 2017.
237
+
238
+ Xue Bin Peng, Michael Chang, Grace Zhang, Pieter Abbeel, and Sergey Levine. Mcp: Learning composable hierarchical control with multiplicative compositional policies. Advances in Neural Information Processing Systems, 2019.
239
+
240
+ Ahmed H. Qureshi, Jacob J. Johnson, Yuzhe Qin, Taylor Henderson, Byron Boots, and Michael C. Yip. Composing task-agnostic policies with deep reinforcement learning. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id $=$ H1ezFREtwH.
241
+
242
+ Martin Riedmiller, Roland Hafner, Thomas Lampe, Michael Neunert, Jonas Degrave, Tom Van de Wiele, Volodymyr Mnih, Nicolas Heess, and Jost Tobias Springenberg. Learning by playing - solving sparse reward tasks from scratch. In International Conference on Machine Learning, 2018.
243
+
244
+ Jurgen Schmidhuber. ¨ Towards compositional learning with dynamic neural networks. Inst. fur¨ Informatik, 1990.
245
+
246
+ John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, and Pieter Abbeel. High-dimensional continuous control using generalized advantage estimation. In International Conference on Learning Representations, 2016.
247
+
248
+ John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
249
+
250
+ Sainbayar Sukhbaatar, Rob Fergus, et al. Learning multiagent communication with backpropagation. In Advances in Neural Information Processing Systems, pp. 2244–2252, 2016.
251
+
252
+ Peter Sunehag, Guy Lever, Audrunas Gruslys, Wojciech Marian Czarnecki, Vinicius Zambaldi, Max Jaderberg, Marc Lanctot, Nicolas Sonnerat, Joel Z Leibo, Karl Tuyls, et al. Value-decomposition networks for cooperative multi-agent learning based on team reward. In International Conference on Autonomous Agents and Multi-Agent Systems, pp. 2085–2087, 2018.
253
+
254
+ Richard S Sutton. Temporal credit assignment in reinforcement learning. PhD thesis, University of Massachusetts, 1984.
255
+
256
+ Richard S Sutton, Doina Precup, and Satinder Singh. Between mdps and semi-mdps: A framework for temporal abstraction in reinforcement learning. Artificial intelligence, 112(1-2):181–211, 1999.
257
+
258
+ Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 5026–5033, 2012.
259
+
260
+ # A ENVIRONMENT DETAILS
261
+
262
+ The details of observation spaces, action spaces, number of agents, and episode lengths are described in Table 2. All units in this section are in meters unless otherwise specified.
263
+
264
+ Table 2: Environment details
265
+
266
+ <table><tr><td colspan="2">Jaco Pick-Push-Place</td><td>Jaco Bar-Moving</td><td>Ant Push</td></tr><tr><td>Observation Space</td><td>88</td><td>88</td><td>100</td></tr><tr><td>- Robot observation</td><td>62</td><td>62</td><td>82</td></tr><tr><td>- Object observation</td><td>26</td><td>26</td><td>18</td></tr><tr><td>Action Space</td><td>18</td><td>18</td><td>16</td></tr><tr><td>Number of Agents</td><td>2</td><td>2</td><td>2</td></tr><tr><td>Episode length</td><td>150</td><td>100</td><td>200</td></tr></table>
267
+
268
+ # A.1 ENVIRONMENT DESCRIPTIONS
269
+
270
+ In both Jaco environments, the robot works on a table with size (1.6, 1.6) and top center position $( 0 , 0 , 0 . 8 2 )$ . The two Jaco arms are initialized at positions $( - 0 . 1 6 , - 0 . 1 6 , 1 . 2 )$ and $( \bar { - } 0 . 1 6 , 0 . \bar { 2 } 4 , 1 . 2 )$ Left arm and right arm objects are initialized around $( 0 . 3 , 0 . 2 , 0 . 8 6 )$ and ( $0 . 3 , - 0 . 2 , 0 . 8 6 )$ respectively in all primitive training and composite task training environments, with small random position and rotation perturbation.
271
+
272
+ In the Jaco Pick-Push-Place task, the right jaco arm needs to pick up the object and place it into the container initialized at the other side of the table. Success is defined by contact between the object and the inner top side of the container.
273
+
274
+ In the Jaco Bar-Moving task, the two Jaco arms need to together pick the long bar up by height of 0.7, move it towards the arms by distance of 0.15, and place it back on the table. Success is defined by (1) the bar being placed within 0.04 away from the desired destination both in height and in xy-position and (2) the bar having been picked 0.7 above the table.
275
+
276
+ In the Ant Push task, the two ant agents need to push a big box together to the goal position. The box has a size of $8 . 0 \times 1 . 6 \times 1 . 6$ . The distance between ants and the box is $2 0 \mathrm { c m }$ and the distance between the box and the goal is $3 0 \mathrm { c m }$ . Initial positions have $1 \mathrm { c m }$ of randomness and the agent has a randomness of 0.01 in each joint. The task is considered as success when both the distances between left and right end of the box and the goal are within $5 \mathrm { c m }$ .
277
+
278
+ # A.2 REWARD DESIGN
279
+
280
+ For every task, we add a control penalty, $- 0 . 0 0 1 * \| a \| ^ { 2 }$ , to regularize the magnitude of actions where $a$ is a torque action performed by an agent.
281
+
282
+ Jaco Pick: To help the agent learn to reach, pick, and hold the picked object, we provide dense reward to the agent defined by the weighted sum of pick reward, gripper-to-cube distance reward, cube position and quaternion stability reward, hold duration reward, success reward, and robot control reward. More concretely,
283
+
284
+ $$
285
+ \begin{array} { r l } & { R ( s ) = \lambda _ { p i c k } \cdot ( z _ { b o x } - z _ { i n i t } ) + \lambda _ { d i s t } \cdot \mathrm { d i s t } ( p _ { g r i p p e r } , p _ { b o x } ) + \lambda _ { p o s } \cdot \mathrm { d i s t } ( p _ { b o x } , p _ { i n i t } ) + } \\ & { \qquad \lambda _ { q u a t } \cdot \mathrm { a b s } ( \Delta _ { q u a t } ) + \lambda _ { h o l d } \cdot t _ { h o l d } + \lambda _ { s u c c e s s } \cdot \mathbf { 1 } _ { \mathrm { s u c c e s s } } + \lambda _ { c t r l } \| a \| ^ { 2 } , } \end{array}
286
+ $$
287
+
288
+ where $\lambda _ { p i c k } = 5 0 0 , \lambda _ { d i s t } = 1 0 0 , \lambda _ { p o s } = 1 0 0 0 , \lambda _ { q u a t } = 1 0 0 0 , \lambda _ { h o l d } = 1 0 , \lambda _ { s u c c e s s } = 1 0 0 , \lambda _ { c t r l } = 1 0 0 0 , \lambda _ { d i s t }$ $1 \times 1 0 ^ { - \hat { 4 } }$ .
289
+
290
+ Jaco Place: Reward for place primitive is defined by the weighted sum of xy-distance reward, height reward (larger when cube close to floor), success reward, and robot control reward.
291
+
292
+ $$
293
+ \begin{array} { r l } & { R ( s ) = \lambda _ { x y } \cdot \mathrm { d i s t } _ { x y } ( p _ { b o x } , p _ { g o a l } ) + \lambda _ { z } \cdot | z _ { b o x } - z _ { g o a l } | + \lambda _ { s u c c e s s } \cdot \mathbf { 1 } _ { \mathrm { s u c c e s s } } + \lambda _ { c t r l } \| a \| ^ { 2 } , } \\ & { \mathrm { ~ e \lambda _ { x y } = 5 0 0 , } \lambda _ { z } = 5 0 0 , \lambda _ { s u c c e s s } = 5 0 0 , \lambda _ { c t r l } = 1 \times 1 0 ^ { - 4 } . } \end{array}
294
+ $$
295
+
296
+ Jaco Push: Reward for push primitive is defined by the weighted sum of gripper reaching reward, box-to-destination distance reward, quaternion stability reward, hold duration reward, success reward, and robot control reward.
297
+
298
+ $$
299
+ \begin{array} { r } { R ( s ) = \lambda _ { r e a c h i n g } \cdot \mathrm { d i s t } ( p _ { g r i p p e r } , p _ { b o x } ) + \lambda _ { p o s } \cdot \mathrm { d i s t } ( p _ { b o x } , p _ { d e s t } ) + \phantom { x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x } } \\ { \lambda _ { q u a t } \cdot \mathsf { a b s } ( \Delta _ { q u a t } ) + \lambda _ { h o l d } \cdot t _ { h o l d } + \lambda _ { s u c c e s s } \cdot \mathbf { 1 } _ { s u c c e s s } + \lambda _ { c t r l } \| a \| ^ { 2 } , \phantom { x x x x x x x x x x x x x x } } \end{array}
300
+ $$
301
+
302
+ $$
303
+ \lambda _ { r e a c h i n g } = 1 0 0 , \lambda _ { p o s } = 5 0 0 , \lambda _ { q u a t } = 3 0 , \lambda _ { h o l d } = 1 0 , \lambda _ { s u c c e s s } = 1 0 0 0 , \lambda _ { c t r l } = 1 \times 1 0 ^ { - 4 } .
304
+ $$
305
+
306
+ Jaco Pick-Push-Place: Reward for Pick-Push-Place is defined by the weighted sum of gripper contact reward, per-stage reach/pick/push/place rewards, success reward, and control reward. We tune the reward carefully for all baselines.
307
+
308
+ $$
309
+ \begin{array} { r l } & { R ( s ) = \lambda _ { c o n t a c t } \cdot \big ( { \bf 1 } _ { \scriptscriptstyle { \mathrm { l e f f ~ g r i p p e r ~ r o u c h e s ~ c o n t a i n e r } } } + { \bf 1 } _ { \scriptscriptstyle { \mathrm { r i g h t ~ g r i p p e r ~ t o u c h e s ~ b o x } } } \big ) + } \\ & { \quad \quad \lambda _ { r e a c h } \cdot { \bf 1 } _ { \scriptscriptstyle { \mathrm { r e a c h } } } \cdot \big ( \mathrm { d i s t } ( p _ { l e f t . g r i p p e r } , p _ { c o n t a i n e r } ) + \mathrm { d i s t } ( p _ { r i g h t . g r i p p e r } , p _ { b o x } ) \big ) + } \\ & { \quad \quad \lambda _ { p i c k } \cdot { \bf 1 } _ { \scriptscriptstyle { \mathrm { p i c k } } } \cdot \mathrm { d i s t } ( p _ { b o x } , p _ { b o x . t a r g e t } ) + \lambda _ { p l a c e } \cdot { \bf 1 } _ { \scriptscriptstyle { \mathrm { p l a c e } } } \cdot \mathrm { d i s t } ( p _ { b o x } , p _ { b o x . t a r g e t } ) + } \\ & { \quad \quad \lambda _ { p u s h } \cdot \mathrm { d i s t } ( p _ { c o n t a i n e r } , p _ { c o n t a i n e r . t a r g e t } ) + \lambda _ { s u c c e s s } \cdot { \bf 1 } _ { \scriptscriptstyle { \mathrm { s u c c e s s } } } + \lambda _ { c t r l } \cdot \| a \| ^ { 2 } , } \end{array}
310
+ $$
311
+
312
+ where $\lambda _ { r e a c h } = 1 0 , \lambda _ { c o n t a c t } = 1 0 , \lambda _ { p i c k } = \lambda _ { p l a c e } = \lambda _ { p l a c e } = 1 0 , \lambda _ { s u c c e s s } = 5 0 , \lambda _ { c t r l } = 0 ,$ , and 1reaching, $\mathbf { 1 } _ { \mathrm { p i c k } }$ , and $\mathbf { 1 } _ { \mathrm { p l a c e } }$ are indicator functions specifying whether the agent is in reaching, pick or place stage. Agent stages are determined by how many multiples of 25 steps the agent has stepped through in the environment.
313
+
314
+ Jaco Bar-Moving: Reward for Bar-Moving is defined by the weighted sum of per-stage reach/pick/move/place rewards, success reward, and control reward.
315
+
316
+ $$
317
+ \begin{array} { r l } & { R ( s ) = \lambda _ { r e a c h } \cdot { \bf 1 } _ { r e a c h } \cdot \big ( \mathrm { d i s t } ( p _ { l e f t \_ g r i p p e r } , p _ { l e f t \_ h a n d l e } ) + \mathrm { d i s t } ( p _ { r i g h t \_ g r i p p e r } , p _ { r i g h t \_ h a n d l e } ) \big ) + } \\ & { \qquad \lambda _ { p i c k } \cdot { \bf 1 } _ { \mathrm { p i c k } } \cdot \mathrm { d i s t } ( p _ { b a r } , p _ { b a r \_ t a r g e t } ) + \lambda _ { m o v e } \cdot { \bf 1 } _ { \mathrm { p l a e } } \cdot \mathrm { d i s t } _ { x y } ( p _ { b a r \_ p b a r \_ t a r g e t } ) + } \\ & { \qquad \lambda _ { p l a c e } \cdot { \bf 1 } _ { \mathrm { p l a e } } \cdot \mathrm { d i s t } _ { z } ( p _ { b a r \_ p b a r \_ t a r g e t } ) + \lambda _ { s u c e s s } \cdot { \bf 1 } _ { \mathrm { s u c e s s } } + \lambda _ { c t r l } \cdot \| a \| ^ { 2 } , } \end{array}
318
+ $$
319
+
320
+ where $\lambda _ { r e a c h } = 1 0 , \lambda _ { p i c k } = 3 0 , \lambda _ { m o v e } = 1 0 0 , \lambda _ { p l a c e } = 1 0 0 , \lambda _ { s u c c e s s } = 1 0 0 , \lambda _ { c t r l } = 1 \times 1 0 ^ { - 4 }$ , and $\mathbf { 1 } _ { \mathrm { p i c k } }$ and $\mathbf { 1 } _ { \mathrm { p l a c e } }$ are indicator functions specifying whether the agent is in pick or place stage. Agent stages are determined by whether the pick objective is fulfilled or not.
321
+
322
+ Ant Push & Ant Moving: Reward for ANT PUSH is defined by upright, velocity towards the desired direction. We provide a dense reward to encourage the desired locomotion behavior using velocity, stability, and posture, as following:
323
+
324
+ $$
325
+ \begin{array} { r l } & { R ( s ) = \lambda _ { v e l } \cdot \mathbf { a b s } ( \Delta x _ { a n t } ) + \lambda _ { b o x v e l } \cdot \mathbf { a b s } ( \Delta x _ { b o x } ) + \lambda _ { u p r i g h t } \cdot \mathbf { c o s } ( \theta ) - \lambda _ { h e i g h t } \cdot \mathbf { a b s } ( 0 . 6 - h ) + } \\ & { ~ \lambda _ { g o a l } \cdot \mathbf { d i s t } ( p _ { g o a l } , p _ { b o x } ) , } \end{array}
326
+ $$
327
+
328
+ where $\lambda _ { v e l } = 5 0 , \lambda _ { b o x v e l } = 2 0 , \lambda _ { u p r i g h t } = 1 , \lambda _ { h e i g h t } = 0 . 5$ . For ANT PUSH, we provide an additional reward based on distance between the box and the goal position with $\lambda _ { g o a l } = 2 0 0$ .
329
+
330
+ # B EXPERIMENT DETAILS
331
+
332
+ We use PyTorch (Paszke et al., 2017) for our implementation and all experiments are conducted on a workstation with Intel Xeon Gold 6154 CPU and 4 NVIDIA GeForce RTX 2080 Ti GPUs.
333
+
334
+ # B.1 HYPERPARAMETERS
335
+
336
+ Table 3: Hyperparameters
337
+
338
+ <table><tr><td>Parameters</td><td>Value</td></tr><tr><td>learning rate</td><td>3e-4</td></tr><tr><td>gradient steps</td><td>50</td></tr><tr><td>batch size</td><td>256</td></tr><tr><td>discount factor</td><td>0.99</td></tr><tr><td>target smoothing coefficient</td><td>0.005</td></tr><tr><td>reward scale (SAC)</td><td>1.0</td></tr><tr><td>experience buffer size (# episodes)</td><td>1000</td></tr><tr><td>Tow</td><td>1 for JACO, 5 for ANT</td></tr><tr><td>Nz (dimensionality of z)</td><td>5</td></tr></table>
339
+
340
+ # B.2 NETWORK ARCHITECTURES
341
+
342
+ Actor Networks: In all experiments, we model our actor network for each primitive skill as a 3-layer MLP with hidden layer size 64. The last layer of the MLP is two-headed – one for the mean of the action distribution and the other for the standard deviation of it. We use ReLU as activation function in hidden layers. We do not apply any activation function for the final output layer. The action distribution output represents per-dimension normal distribution, from which single actions can be sampled and executed in the environment.
343
+
344
+ Critic Networks: The critic network for each primitive skill and meta policy is modeled as a 2-layer MLP with hidden layer size 128. ReLU is used as an activation function in the hidden layers. The critic network output is used to assess the value of a given state-action pair, and is trained by fitting its outputs to the target Q-value clamped by $\pm 1 0 0$ .
345
+
346
+ Meta Policy: The meta policy is modeled as a 3-layer MLP with hidden layer size of 64. Since the actions of meta policy are sampled from $N$ categorical distributions for each end-effector/agent and $N$ normal distributions for behavior embeddings, the output dimension of the meta policy is $\begin{array} { r } { \sum _ { i = 1 } ^ { N } ( m ^ { i } + N _ { z } ) } \end{array}$ . The meta policy uses ReLU as an activation function for all layers except for the final output layer.
347
+
348
+ # B.3 TRAINING DETAILS
349
+
350
+ For all baselines, we train the meta policies using PPO and the low-level policies using SAC. We use the same environment configurations, composite task reward definitions, and value of $T _ { l o w }$ across all baselines.
351
+
352
+ For Jaco tasks, we train a total of 4 primitive skills – right arm pick, right arm place-to-center, right arm place-towards-arm, and left arm push – to be composed by meta-policy. For Jaco Pick-PushPlace, we provide the meta-policy with right arm pick and right arm place-to-center as right arm primitives and left arm push as left arm primitives; for Jaco Bar-Moving, we provide the meta-policy with right arm pick and right arm place-towards-arm as both right and left arm primitives and left arm pick and right arm place-towards-arm as left arm primitives. We obtain left arm primitives for bar-moving task by using the learned right arm primitives directly.
353
+
354
+ To obtain the 4 primitives skills described above, we train right arm pick with diversity coefficient $\lambda _ { 2 } = 0 . 0 1$ and the other three primitives with $\lambda _ { 2 } = 0 . 1$ . The destination of right arm push is set to $( 0 . 3 , - 0 . 0 3 , 0 . 8 6 )$ , which is slightly left of the center of the table. After pick primitive is trained, we train the two right arm place primitives where episodes are initialized by intermediate states of successful right arm pick episodes where the height of the box is larger than 0.94 (0.01 higher than the target pick height). The place destinations for towards-arm and to-center primitives are $( 0 . 1 5 , - 0 . 2 , 0 . 8 6 )$ and $( 0 . 3 , - 0 . 0 2 , 0 . 8 6 )$ , respectively.
355
+
356
+ For non-modular baselines that incorporates skill behavior diversification, we use $\lambda _ { 2 } = 0 . 0 1$ for both Jaco Pick-Push-Place and Jaco Bar-Moving because both tasks require picking skills, which can only be trained with a small value of $\lambda _ { 2 }$ .
md/train/uIMwuJHfuLM/uIMwuJHfuLM.md ADDED
Binary file (56.1 kB). View file