Datasets:
Add files using upload-large-folder tool
Browse files- md/train/0WASBV4xkhy/0WASBV4xkhy.md +361 -0
- md/train/BJOFETxR-/BJOFETxR-.md +320 -0
- md/train/BJk7Gf-CZ/BJk7Gf-CZ.md +688 -0
- md/train/BJlnmgrFvS/BJlnmgrFvS.md +373 -0
- md/train/BkUHlMZ0b/BkUHlMZ0b.md +393 -0
- md/train/Bke6vTVYwH/Bke6vTVYwH.md +291 -0
- md/train/ByxQB1BKwH/ByxQB1BKwH.md +313 -0
- md/train/H1eH4n09KX/H1eH4n09KX.md +268 -0
- md/train/H1lS8oA5YQ/H1lS8oA5YQ.md +393 -0
- md/train/HyeaSkrYPH/HyeaSkrYPH.md +356 -0
- md/train/LLoe0U9ShkN/LLoe0U9ShkN.md +0 -0
- md/train/N51zJ7F3mw/N51zJ7F3mw.md +292 -0
- md/train/NSBrFgJAHg/NSBrFgJAHg.md +424 -0
- md/train/SyzVb3CcFX/SyzVb3CcFX.md +390 -0
- md/train/Uwh-v1HSw-x/Uwh-v1HSw-x.md +233 -0
- md/train/Wga_hrCa3P3/Wga_hrCa3P3.md +615 -0
- md/train/Wi5KUNlqWty/Wi5KUNlqWty.md +0 -0
- md/train/hhU9TEvB6AF/hhU9TEvB6AF.md +273 -0
- md/train/jfPU-u_52Tx/jfPU-u_52Tx.md +0 -0
- md/train/z-l1kpDXs88/z-l1kpDXs88.md +253 -0
md/train/0WASBV4xkhy/0WASBV4xkhy.md
ADDED
|
@@ -0,0 +1,361 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Towards a Theoretical Framework of Out-of-Distribution Generalization
|
| 2 |
+
|
| 3 |
+
Chuanlong XieHuawei Noah’s Ark Labxie.chuanlong@huawei.com
|
| 4 |
+
|
| 5 |
+
Haotian Ye
|
| 6 |
+
Peking University
|
| 7 |
+
Pazhou Lab
|
| 8 |
+
haotianye@pku.edu.cn
|
| 9 |
+
|
| 10 |
+
Tianle Cai Peking University caitianle1998@pku.edu.cn
|
| 11 |
+
|
| 12 |
+
# Ruichen Li
|
| 13 |
+
|
| 14 |
+
# Zhenguo Li
|
| 15 |
+
|
| 16 |
+
# Liwei Wang
|
| 17 |
+
|
| 18 |
+
Peking University xk-lrc@pku.edu.cn
|
| 19 |
+
|
| 20 |
+
Huawei Noah’s Ark Lab Li.Zhenguo@huawei.com
|
| 21 |
+
|
| 22 |
+
Key Laboratory of Machine Perception, MOE, School of EECS, Institute for Artificial Intelligence, Peking University wanglw@cis.pku.edu.cn
|
| 23 |
+
|
| 24 |
+
# Abstract
|
| 25 |
+
|
| 26 |
+
Generalization to out-of-distribution (OOD) data is one of the central problems in modern machine learning. Recently, there is a surge of attempts to propose algorithms that mainly build upon the idea of extracting invariant features. Although intuitively reasonable, theoretical understanding of what kind of invariance can guarantee OOD generalization is still limited, and generalization to arbitrary out-of-distribution is clearly impossible. In this work, we take the first step towards rigorous and quantitative definitions of 1) what is OOD; and 2) what does it mean by saying an OOD problem is learnable. We also introduce a new concept of expansion function, which characterizes to what extent the variance is amplified in the test domains over the training domains, and therefore give a quantitative meaning of invariant features. Based on these, we prove OOD generalization error bounds. It turns out that OOD generalization largely depends on the expansion function. As recently pointed out by [21], any OOD learning algorithm without a model selection module is incomplete. Our theory naturally induces a model selection criterion. Extensive experiments on benchmark OOD datasets demonstrate that our model selection criterion has a significant advantage over baselines.
|
| 27 |
+
|
| 28 |
+
# 1 Introduction
|
| 29 |
+
|
| 30 |
+
One of the most fundamental assumptions of classic supervised learning is the “i.i.d. assumption”, which states that the training and the test data are independent and identically distributed. However, this assumption can be easily violated in a reality [8, 10, 11, 17, 38, 48, 56] where the test data usually have a different distribution than the training data. This motivates the research on the out-ofdistribution (OOD) generalization, or domain generalization problem, which assumes access only to data drawn from a set $\mathcal { E } _ { a v a i l }$ of available domains during training, and the goal is to generalize to a larger domain set ${ \mathcal { E } } _ { a l l }$ including unseen domains.
|
| 31 |
+
|
| 32 |
+
To generalize to OOD data, most existing algorithms attempt to learn features that are invariant to a certain extent across training domains in the hope that such invariance also holds in unseen domains. For example, distributional matching-based methods [20, 35, 55] seek to learn features that have the same distribution across different domains; IRM [5] and its variants [1, 32, 33] learn feature representations such that the optimal linear classifier on top of the representation matches across domains.
|
| 33 |
+
|
| 34 |
+
35th Conference on Neural Information Processing Systems (NeurIPS 2021).
|
| 35 |
+
|
| 36 |
+
Though the idea of learning invariant features is intuitively reasonable, there is only limited theoretical understanding of what kind of invariance can guarantee OOD generalization. Clearly, generalization to an arbitrary out-of-distribution domain is impossible and in practice, the features can hardly be absolutely invariant from $\mathcal { E } _ { a v a i l }$ to ${ \mathcal { E } } _ { a l l }$ unless all the domains are identical. So it is necessary to first formulate what OOD data can be generalized to, or, what is the relation between the available training domain set $\mathcal { E } _ { a v a i l }$ and the entire domain set ${ \mathcal { E } } _ { a l l }$ . Meanwhile, to what extent the invariance of features on $\mathcal { E } _ { a v a i l }$ can be preserved in ${ \mathcal { E } } _ { a l l }$ should be rigorously characterized.
|
| 37 |
+
|
| 38 |
+
In this paper, we take the first step towards a general OOD framework by quantitatively formalizing the relationship between $\mathcal { E } _ { a v a i l }$ and ${ \mathcal { E } } _ { a l l }$ in terms of the distributions of features and provide OOD generalization guarantees based on our quantification of the difficulty of OOD generalization problem. Specifically, we first rigorously formulate the intuition of invariant features used in previous works by introducing the “variation” and “informativeness” (Definition 3.1 and 3.2) of each feature. Our theoretical insight can then be informally stated as: for learnable OOD problems, if a feature is informative for the classification task as well as invariant over $\mathcal { E } _ { a v a i l }$ , then it is still invariant over ${ \mathcal { E } } _ { a l l }$ . In other words, invariance of informative features in $\mathcal { E } _ { a v a i l }$ can be preserved in ${ \mathcal { E } } _ { a l l }$ . We further introduce a class of functions, dubbed expansion function (Definition 3.3), to quantitatively characterize to what extent the variance of features on $\mathcal { E } _ { a v a i l }$ is amplified on ${ \mathcal { E } } _ { a l l }$ .
|
| 39 |
+
|
| 40 |
+
Based on our formulation, we derive theoretical guarantees on the OOD generalization error, i.e., the gap of largest error between the domain in $\mathcal { E } _ { a v a i l }$ and domain in ${ \mathcal { E } } _ { a l l }$ . Specifically, we prove the upper and lower bound of OOD generalization error in terms of the expansion function and the variation of learned features over $\mathcal { E } _ { a v a i l }$ . Our results theoretically confirm that 1) the expansion function can reflect the difficulty of OOD generalization problem, i.e., problems with more rapidly increasing expansion functions are harder and have worse generalization guarantees; 2) the generalization error gap can tend to zero when the variation of learned features tend to zero, so minimizing the variation in $\mathcal { E } _ { a v a i l }$ can reduce the generalization error.
|
| 41 |
+
|
| 42 |
+
As pointed out by Gulrajani and Lopez-Paz [21], any OOD algorithm without a specified model selection criterion is not complete. Since ${ \mathcal { E } } _ { a l l }$ is unseen, hyper-parameters can only be chosen according to $\mathcal { E } _ { a v a i l }$ . Previous selection methods mainly focus on validation accuracy over $\mathcal { E } _ { a v a i l }$ which is only a biased metric of OOD performance. On the contrary, a promising model selection method should instead be predictive of OOD performance. Inspired by our bounds, we propose a model selection method to select models with high validation accuracy and low variation, which corresponds to the upper bound of OOD error. The introduction of a model’s variation relieves the problem of classic selection methods, in which models that overfit $\mathcal { E } _ { a v a i l }$ tend to be selected. Experimental results show that our method can outperform baselines and select models with higher OOD accuracy.
|
| 43 |
+
|
| 44 |
+
Contributions. We summarize our major contributions here:
|
| 45 |
+
|
| 46 |
+
• We introduce a quantitative and rigorous formulation of OOD generalization problem that characterizes the relation of invariance over the training domain set $\mathcal { E } _ { a v a i l }$ and test domain set ${ \mathcal { E } } _ { a l l }$ . The core quantity in our characterization, the expansion function, determines the difficulty of an OOD generalization problem.
|
| 47 |
+
|
| 48 |
+
• We prove novel OOD generalization error bounds based on our formulation. The upper and lower bounds together indicate that the expansion function well characterizes the OOD generalization ability of features with different levels of variation.
|
| 49 |
+
|
| 50 |
+
• We design a model selection criterion that is inspired by our generalization bounds. Our criterion takes both the performance on training domains and the variation of models into consideration and is predictive of OOD performance according to our bounds. Experimental results demonstrate our selection criterion can choose models with higher OOD accuracy.
|
| 51 |
+
|
| 52 |
+
The rest of the paper is organized as follows: Section 2 is our preliminary. In Section 3, we give our theoretical formulation. Section 4 gives our generalization bound. We propose our model selection method in Section 5. In Section 6 we conduct experiments on expansion function and model selection. We review more related works in Section 7 and conclude our work in Section 8.
|
| 53 |
+
|
| 54 |
+
# 2 Preliminary
|
| 55 |
+
|
| 56 |
+
Throughout the paper, we consider a multi-class classification task $\mathcal { X } \to \mathcal { Y } = \{ 1 , . . . , K \}$ .1 Let ${ \mathcal { E } } _ { a l l }$ be the domain set we want to generalize to, and $\mathcal { E } _ { a v a i l } \subseteq \mathcal { E } _ { a l l }$ be the available domain set, i.e., all domains we have during the training procedure. We denote $( X ^ { e } , Y ^ { e } )$ to be the input-label pair drawn from the data distribution of domain $e$ . The OOD generalization goal is to find a classifier $f ^ { * }$ that minimizes the worst-domain loss on ${ \mathcal { E } } _ { a l l }$ :
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
f ^ { * } = \underset { f \in \mathcal { F } } { \mathrm { a r g m i n } } \mathcal { L } ( \mathcal { E } _ { a l l } , f ) , \mathcal { L } ( \mathcal { E } , f ) \triangleq \underset { e \in \mathcal { E } } { \mathrm { m a x } } \mathbb { E } \big [ \ell \big ( f ( X ^ { e } ) , Y ^ { e } \big ) \big ]
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
where $\mathcal { F } : \mathcal { X } \xrightarrow { } \mathbb { R } ^ { K }$ is the the hypothetical space and $\ell ( \cdot , \cdot )$ is a loss function. Similar to previous works [5, 16, 27, 33], we assume that $f$ can be decomposed into $g \circ h$ , where $g \in \mathcal { G } : \mathbb { R } ^ { d } \mathbb { R } ^ { K }$ is the top classifier and $h : \mathcal { X } \mathbb { R } ^ { d }$ is a $d$ -dimensional feature extractor, i.e.,
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
h ( x ) = ( \phi _ { 1 } ( x ) , \phi _ { 2 } ( x ) , \ldots , \phi _ { d } ( x ) ) ^ { \top } , \quad \phi _ { i } \in \Phi .
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
Here $\Phi$ is the set of scalar feature maps which map $\mathcal { X }$ to $\mathbb { R }$ and $d$ is fixed. We will call each $\phi \in \Phi$ a feature for simplicity. Given a domain $e$ , we denote the $d$ -dimensional random vector $h ( X ^ { e } )$ as $h ^ { e }$ , one-dimensional feature $\phi ( X ^ { e } )$ as $\phi ^ { e }$ , and the conditional distribution of $h ^ { e } , \phi ^ { e }$ given $Y ^ { e } = y$ as $\mathbb { P } ( h ^ { e } | y ) , \mathbb { P } ( \phi ^ { e } | y )$ . For simplicity, we assume the data distribution is balanced in every domain, i.e., $P ( Y ^ { e } = y ) = \frac { 1 } { K } , \forall y \in \mathcal { Y } , e \in \mathcal { E } _ { a l l }$ . Our framework can be easily extended to the case where the balanced assumption is removed, with an additional term corresponding to the imbalance adding to the generalization bounds.
|
| 69 |
+
|
| 70 |
+
# 3 Framework of OOD Generalization Problem
|
| 71 |
+
|
| 72 |
+
The main challenge of formalizing the OOD generalization problem is to mathematically describe the connection between $\mathcal { E } _ { a v a i l }$ and ${ \mathcal { E } } _ { a l l }$ and how generalization depends on this relation. Towards this goal, we introduce several quantities to characterize the relation of feature distributions over different domains and bridge $\mathcal { E } _ { a v a i l }$ and ${ \mathcal { E } } _ { a l l }$ by expansion function (Definition 3.3) over the quantities we have introduced. Our framework is motivated by the understanding that, in an OOD generalization task, certain “property” of “good” features in $\mathcal { E } _ { a v a i l }$ should be “preserved” in ${ \mathcal { E } } _ { a l l }$ (the reason is described in Section 1). In Section 3.1, we will go into details on what we mean by “property” (variation, Definition 3.1), “good” (informativeness, Definition 3.2), and “preserved” (measured by expansion function). In Section 6.2, we further illustrate the key concepts in our framework by a real-world OOD problem.
|
| 73 |
+
|
| 74 |
+
# 3.1 Formalizing OOD Problem by Quantifying Feature Distribution
|
| 75 |
+
|
| 76 |
+
We first introduce the concepts “variation" and “informativeness" of a feature $\phi$ . The first one is what we expect to be preserved in ${ \mathcal { E } } _ { a l l }$ and the second one characterizes what features will be considered. Specifically, let $\rho ( \mathbb { P } , \mathbb { Q } )$ be a symmetric “distance” of two distributions. Note that $\rho$ can have many choices, like $L _ { 2 }$ Distance, Total Variation and symmetric KL-divergence, etc. The variation and informativeness are defined as follows:
|
| 77 |
+
|
| 78 |
+
Definition 3.1 (Variation). The variation of feature $\phi ( \cdot )$ across a domain set $\mathcal { E }$ is
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\mathcal { V } _ { \rho } ( \phi , \mathcal { E } ) = \operatorname* { m a x } _ { y \in \mathcal { V } } \operatorname* { s u p } _ { e , e ^ { \prime } \in \mathcal { E } } \rho \big ( \mathbb { P } ( \phi ^ { e } | y ) , \mathbb { P } ( \phi ^ { e ^ { \prime } } | y ) \big ) .
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
A feature $\phi ( \cdot )$ is $\varepsilon$ -invariant across $\mathcal { E }$ , $i f \varepsilon \geq \mathcal { V } ( \phi , \mathcal { E } )$ (We omit the subscript $\rho$ in case of no ambiguity). Definition 3.2 (Informativeness). The informativeness of feature $\phi ( \cdot )$ across a domain set $\mathcal { E }$ is
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\mathcal { T } _ { \rho } ( \phi , \mathcal { E } ) = \frac { 1 } { K ( K - 1 ) } \sum _ { \stackrel { y \neq y ^ { \prime } } { y , y ^ { \prime } \in y } } \operatorname* { m i n } _ { e \in \mathcal { E } } \rho \big ( \mathbb { P } ( \phi ^ { e } | y ) , \mathbb { P } ( \phi ^ { e } | y ^ { \prime } ) \big ) .
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
A feature $\phi ( \cdot )$ is $\delta$ -informative across $\varepsilon$ , if $\quad \delta \leq { \mathcal { I } } ( \phi , { \mathcal { E } } )$ .
|
| 91 |
+
|
| 92 |
+
The variation $\mathcal { V } ( \phi , \mathcal { E } )$ measures the stability of $\phi ( \cdot )$ over the domains in $\mathcal { E }$ and the informativeness ${ \mathcal { T } } ( \phi , { \mathcal { E } } )$ captures the ability of $\phi ( \cdot )$ to distinguish different labels. We would like to highlight that the variation and informativeness are defined on each one-dimensional feature $\phi ( \cdot )$ . Unlike previous distance between distributions defined in $d$ -dimensional space, our definitions are more reasonable and practical, since it can be easily calculated and analyzed.
|
| 93 |
+
|
| 94 |
+
We are now ready to introduce the core quantity for connecting $\mathcal { E } _ { a v a i l }$ and ${ \mathcal { E } } _ { a l l }$ . Our motivation, as elaborated in the introduction section, is that, if a feature is informative for the classification task and invariant over $\mathcal { E } _ { a v a i l }$ , then to enable OOD generalization from $\mathcal { E } _ { a v a i l }$ to ${ \mathcal { E } } _ { a l l }$ , it should be still invariant over ${ \mathcal { E } } _ { a l l }$ . So the relation between $\mathcal { V } ( \phi , \mathcal { E } _ { a v a i l } )$ and $\mathinner { \gamma \mathopen { \left( \phi , \mathcal { E } _ { a l l } \right) } }$ of an informative feature captures the feasibility and difficulty of OOD generalization. To quantitatively measure this relation, we define the following function class:
|
| 95 |
+
|
| 96 |
+
Definition 3.3 (Expansion Function). We say a function $s : \mathbb { R } ^ { + } \cup \{ 0 \} \mathbb { R } ^ { + } \cup \{ 0 , + \infty \}$ is an expansion function, iff the following properties hold: 1) $s ( \cdot )$ is monotonically increasing and $s ( x ) \geq x , \forall x \geq 0 ; 2 ,$ ) $\begin{array} { r } { \operatorname* { l i m } _ { x 0 ^ { + } } s ( x ) = s ( 0 ) = 0 } \end{array}$ .
|
| 97 |
+
|
| 98 |
+
This function class gives a full characterization of how the variation between $\mathcal { E } _ { a v a i l }$ and ${ \mathcal { E } } _ { a l l }$ is related. Based on this function class, we can introduce our formulation of the learnability of OOD generalization as follows:
|
| 99 |
+
|
| 100 |
+
Definition 3.4 (Learnability). Let $\Phi$ be the feature space and $\rho$ be a distribution distance. We say an OOD generalization problem from $\mathcal { E } _ { a v a i l }$ to ${ \mathcal { E } } _ { a l l }$ is learnable if there exists an expansion function $s ( \cdot )$ and $\delta \geq 0$ , such that: for all $\phi \in \Phi$ satisfying ${ \mathcal { T } } _ { \rho } ( \phi , { \mathcal { E } } _ { a v a i l } ) \geq \delta$ , we have $s ( \mathcal { V } _ { \rho } ( \phi , \mathcal { E } _ { a v a i l } ) ) \geq$ $\mathcal { V } _ { \rho } \big ( \phi , \mathcal { E } _ { a l l } \big )$ . If such $s ( \cdot )$ and $\delta$ exist, we further call this problem $( s ( \cdot ) , \delta )$ -learnable. If an $o o D$ generalization problem is not learnable, we call $i t$ unlearnable.
|
| 101 |
+
|
| 102 |
+
To understand the intuition and rationality of our formulation, several discussions are in order.
|
| 103 |
+
|
| 104 |
+
Properties of the expansion function. In Definition 3.3, we highlight two properties of the expansion function. The first property comes naturally from the monotonicity properties of variation: any $\varepsilon _ { 1 }$ -invariant feature is also $\varepsilon _ { 2 }$ -invariant for $\varepsilon _ { 2 } \geq \varepsilon _ { 1 }$ ; and $\mathcal { V } ( \phi , \mathcal { E } _ { 1 } ) \leq \mathcal { V } ( \phi , \mathcal { E } _ { 2 } )$ for any ${ \mathcal { E } } _ { 1 } \subseteq { \mathcal { E } } _ { 2 }$ . The monotonicity also implies that larger ${ \mathcal { E } } _ { a l l }$ will induce larger $s ( \cdot ) ^ { 2 }$ and it is also harder to be generalized to. From this view, we can see that the scale of $s ( \cdot )$ can reflect the difficulty of OOD generalization. The second property is more crucial since it formulates the intuition that if an informative feature is almost invariant in $\mathcal { E } _ { a v a i l }$ , it should remain invariant in ${ \mathcal { E } } _ { a l l }$ . Without this assumption, OOD generalization can never be guaranteed because we cannot predict whether an invariant and informative feature in $\mathcal { E } _ { a v a i l }$ will vary severely in unseen ${ \mathcal { E } } _ { a l l }$ .
|
| 105 |
+
|
| 106 |
+
Necessity of informativeness. We include a seemingly redundant quantity informativeness in the definition of learnability. However, this term is necessary because only informative features are responsible for the performance of classification. Non-informative but invariant features over $\mathcal { E } _ { a v a i l }$ may only capture some noise that is irrelevant to the classification problem, and we shall not expect the noise to be invariant over ${ \mathcal { E } } _ { a l l }$ . Moreover, we show in Figure 1 that in practice, many invariant but useless features in $\mathcal { E } _ { a v a i l }$ vary a lot in ${ \mathcal { E } } _ { a l l }$ , and adding the constraint of informativeness makes the expansion function reasonable. In addition, there are multiple choices of $( s ( \cdot ) , \delta )$ to make an OOD generalization problem learnable: larger $\delta$ will filter out more features, and so $\dot { s } ( \cdot )$ can be smaller (flatter). This multiplicity will result in a trade-off between $s ( \cdot )$ and $\delta$ , which will be discussed in Section 6.2.
|
| 107 |
+
|
| 108 |
+
Two extreme cases: i.i.d. & unlearnable. To better understand the concept of learnability, we consider two extreme cases. (1) The first example is when all data from different $\textit { e } \in \mathcal { E } _ { a l l }$ are identically distributed, i.e., the classic supervised learning setting. This problem is $( s ( \cdot ) , 0 )$ -learnable with $s ( x ) = x$ , implying no extra difficulty in OOD generalization. (2) As an example of unlearnable, consider the following case (modified from Colored MNIST [5]): For $e \in \mathcal { E } _ { a v a i l }$ , images with label 0 always has a red background while images with label 1 has a blue background. For $e \in \mathcal { E } _ { a l l } \ \backslash \ \mathcal { E } _ { a v a i l }$ , this relationship is entirely inverse. Since data from different $e \in \mathcal { E } _ { a v a i l }$ are identically distributed but different from other $e \in \mathcal { E } _ { a l l }$ , no expansion function can make it learnable, i.e., it is OOD-unlearnable.
|
| 109 |
+
|
| 110 |
+
The unlearnability of this case also coincides with our intuition: Without prior knowledge, it is not clear from merely the training data, whether the task is to distinguish digit 0 from 1, or to distinguish color red from blue. As a result, generalization to ${ \mathcal { E } } _ { a l l }$ cannot be guaranteed.
|
| 111 |
+
|
| 112 |
+
# 4 Generalization Bound
|
| 113 |
+
|
| 114 |
+
In this section, we consider an OOD generalization problem from $\mathcal { E } _ { a v a i l }$ to ${ \mathcal { E } } _ { a l l }$ , and our goal is to analyze the OOD generalization error of classifier $f = g \circ h$ defined by
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\mathrm { e r r } ( f ) = \mathcal { L } ( \mathcal { E } _ { a l l } , f ) - \mathcal { L } ( \mathcal { E } _ { a v a i l } , f ) ,
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
where we assume the loss function $l ( \cdot , \cdot )$ is bounded by $[ 0 , C ]$ . We prove two upper bounds (4.1, 4.2) as well as a lower bound (4.3) for $\operatorname { e r r } ( f )$ based on our formulation. Our bounds together provide a complete characterization of the difficulty of OOD generalization. Since we expect that an invariant classifier can generalize to unseen domains, we hope to bound $\operatorname { e r r } ( f )$ in terms of the certain variation of $f$ . To this end, we define the variation and informativeness of $f$ in terms of its features, i.e.,
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\begin{array} { r l r } { \mathcal { V } ^ { \operatorname* { s u p } } ( h , \mathcal { E } _ { a v a i l } ) } & { \triangleq } & { \underset { \beta \in S ^ { d - 1 } } { \operatorname* { s u p } } \mathcal { V } ( \beta ^ { \top } h , \mathcal { E } _ { a v a i l } ) , } \\ { \mathcal { T } ^ { \operatorname* { i n f } } ( h , \mathcal { E } _ { a v a i l } ) } & { \triangleq } & { \underset { \beta \in S ^ { d - 1 } } { \operatorname* { i n f } } \mathcal { T } ( \beta ^ { \top } h , \mathcal { E } _ { a v a i l } ) , } \end{array}
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
where $( \beta ^ { \top } h ) ( x ) = \beta ^ { \top } h ( x )$ is a feature and $S ^ { d - 1 } = \{ \beta \in \mathbb { R } ^ { d } : \| \beta \| _ { 2 } = 1 \}$ is the unit $( d - 1 )$ -sphere.
|
| 127 |
+
|
| 128 |
+
Necessity of using supremum over linear combination. One seemingly plausible definition of the variation of a classifier $f$ can be the supremum over all $\mathcal { V } ( \phi _ { i } , \mathcal { E } _ { a v a i l } ) , i \in [ d ]$ . However, as is shown in Appendix 1, it is possible that two high-dimensional joint distributions have close marginal distribution in each dimension, while they do not overlap. In other words, there exist cases where $\mathcal { V } ( \phi _ { i } , \mathcal { E } _ { a l l } ) = 0 , \forall i \in [ d ]$ but after applying the top model $g$ over $\phi _ { i }$ ’s, the distribution varies a lot in $\mathcal { E } _ { a v a i l }$ . Our definition comes from the simple idea that the class of top model $\mathcal { G }$ is at least a linear space, so we should at least consider the variation of every (normalized) linear combination of $h ( \cdot )$ With this, we can guarantee the joint distribution distance is still small.
|
| 129 |
+
|
| 130 |
+
Theorem 4.1 (Main Theorem). Suppose we have learned a classifier $f ( x ) = g ( h ( x ) )$ such that $\forall e \in \mathcal { E } _ { a l l }$ and $\forall y \in \mathcal { V } ;$ $, p _ { h ^ { e } | Y ^ { e } } ( h | y ) \in L ^ { 2 } ( \mathbb R ^ { d } )$ . Denote the characteristic function of random variable $h ^ { e } | Y ^ { e }$ as $\hat { p } _ { h ^ { e } | Y ^ { e } } ( t | y ) = \mathbb { E } [ \exp \{ i \langle t , h ^ { e } \rangle \} | Y ^ { e } = y ]$ . Assume the hypothetical space $\mathcal { F }$ satisfies the following regularity conditions that $\exists \alpha , M _ { 1 } , M _ { 2 } > 0 , \forall f \in \mathcal { F } , \forall e \in \mathcal { E } _ { a l l } , y \in \mathcal { V }$ ,
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\int _ { h \in \mathbb { R } ^ { d } } p _ { h ^ { e } | Y ^ { e } } ( h | y ) | h | ^ { \alpha } \mathrm { d } h \leq M _ { 1 } \quad a n d \quad \int _ { t \in \mathbb { R } ^ { d } } | \hat { p } _ { h ^ { e } | Y ^ { e } } ( t | y ) | | t | ^ { \alpha } \mathrm { d } t \leq M _ { 2 } .
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
$I f ( \mathcal { E } _ { a v a i l } , \mathcal { E } _ { a l l } )$ is $\left( s ( \cdot ) , \mathcal { T } ^ { i n f } ( h , \mathcal { E } _ { a v a i l } ) \right)$ -learnable under $\Phi$ with Total Variation $\rho ^ { 3 }$ , then we have
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\operatorname { e r r } ( f ) \leq O \left( s \left( \mathcal { V } _ { \rho } ^ { s u p } ( h , \mathcal { E } _ { a v a i l } ) \right) ^ { \frac { \alpha ^ { 2 } } { ( \alpha + d ) ^ { 2 } } } \right) .
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
Here $\rho$ is total variation distance, and $O ( \cdot )$ depends on $d , C , \alpha , M _ { 1 } , M _ { 2 }$ .
|
| 143 |
+
|
| 144 |
+
The above theorem holds for a general classifier learned by any algorithms. Due to its generality, we need to introduce some technical regularity conditions on the density function. The assumption (4) assume the decay rate of density and its characteristic function, which is common in the literature, e.g. [14]. This theorem demonstrates that, the generalization error can be bounded by a function of the variation of $h$ , and it converges to 0 as the variation approaches to 0. Under some special but typical case where the top model $g$ is linear, we can further show that even without the regularity conditions in Theorem 4.1, we have a much better (linear) convergence rate.
|
| 145 |
+
|
| 146 |
+
Theorem 4.2 (Linear Top Model). Consider any loss satisfying $\begin{array} { r } { \ell ( \hat { y } , y ) = \sum _ { k = 1 } ^ { K } \ell _ { 0 } ( \hat { y } _ { k } , y _ { k } ) } \end{array}$ .4 For any classifier with linear top model $g$ , i.e.,
|
| 147 |
+
|
| 148 |
+
$$
|
| 149 |
+
f ( x ) = A h ( x ) + b w i t h A \in \mathbb { R } ^ { K \times d } , b \in \mathbb { R } ^ { K } ,
|
| 150 |
+
$$
|
| 151 |
+
|
| 152 |
+
$i f ( \mathcal { E } _ { a v a i l } , \mathcal { E } _ { a l l } )$ is $\left( s ( \cdot ) , \mathcal { T } ^ { i n f } ( h , \mathcal { E } _ { a v a i l } ) \right)$ -learnable under $\Phi$ with Total Variation $\rho$ , then we have
|
| 153 |
+
|
| 154 |
+
$$
|
| 155 |
+
\mathrm { e r r } ( f ) \leq O \Bigl ( s \bigl ( \mathcal { V } ^ { s u p } ( h , \mathcal { E } _ { a v a i l } ) \bigr ) \Bigr ) .
|
| 156 |
+
$$
|
| 157 |
+
|
| 158 |
+
Here $O ( \cdot )$ depends only on d and $C$ .
|
| 159 |
+
|
| 160 |
+
Discussion. Theorem 4.1 shows that, for any model, the generalization gap depends largely on the model’s variation captured by $\mathcal { V } ^ { \mathrm { s u p } } ( h , \mathcal { E } _ { a v a i l } )$ . The result is irrelevant to the algorithm and provides a guarantee for the generalization gap from $\mathcal { E } _ { a v a i l }$ to ${ \mathcal { E } } _ { a l l }$ , so long as the learned model $f$ is invariant, i.e. $\mathcal { V } ^ { \mathrm { s u p } } ( h , \mathcal { E } _ { a v a i l } )$ is small. When $s ( \cdot )$ is fixed, a model with smaller $\mathcal { V } ^ { \mathrm { s u p } } ( h , \mathcal { E } _ { a v a i l } )$ results in a smaller gap, which matches our understanding that invariant features in $\mathcal { E } _ { a v a i l }$ are somehow invariant in ${ \mathcal { E } } _ { a l l }$ . When $\mathcal { V } ^ { \mathrm { s u p } } ( h , \mathcal { E } _ { a v a i l } )$ is fixed, more difficult generalization will generate a larger expansion function, which leads to a larger gap. For the Gaussian class with bounded mean and variance, $\alpha \gg d$ and the convergent rate is almost linear.
|
| 161 |
+
|
| 162 |
+
However, without any constraint to $g$ , the convergent rate might be small. Theorem 4.2 then offers a generalization bound with a linear convergent rate under mild assumptions when $g$ is linear, which is common in reality. It relaxes the concentration assumption (Formula 4) and asks only for the integrability of the density. The convergent rate is identical to the convergent rate of the expansion function, showing that $s ( \cdot )$ captures the generalization quite well.
|
| 163 |
+
|
| 164 |
+
Proof Sketch of Theorem 4.1. The proof of the main result, Theorem 4.1, is decomposed into the following steps. First, we transform $\operatorname { e r r } ( f )$ into the Total Variation of joint distributions of features in different domains (Step 1). To bound the Total Variation, it is sufficient to bound the distance of the corresponding Fourier transform, and further, it is equivalent to bound the Radon transform of joint distributions (Step 2). Eventually, we show that $\mathcal { V } ^ { \mathrm { s u p } } ( \beta ^ { \top } h , \mathcal { E } _ { a v a i l } )$ can be used to bound the Radon transform, which finishes the proof (Step 3).
|
| 165 |
+
|
| 166 |
+
Step 1. The OOD generalization error can be bounded as:
|
| 167 |
+
|
| 168 |
+
$$
|
| 169 |
+
\mathrm { e r r } ( f ) \le \operatorname* { s u p } _ { ( e , e ^ { \prime } ) \in ( \mathcal { E } _ { a v a i l } , \mathcal { E } _ { a l l } ) } \frac { C } { K } \sum _ { y \in \mathcal { Y } } \int _ { h \in \mathbb { R } ^ { d } } \big | p _ { h ^ { e } | Y ^ { e } } ( h | y ) - p _ { h ^ { e ^ { \prime } } | Y ^ { e ^ { \prime } } } ( h | y ) ) \big | \mathrm { d } h .
|
| 170 |
+
$$
|
| 171 |
+
|
| 172 |
+
Step 2. According to the assumption (4), the dominant term in (7) is
|
| 173 |
+
|
| 174 |
+
$$
|
| 175 |
+
\int _ { | h | \leq r _ { 1 } } \Big | \int _ { | t | \leq r _ { 2 } } e ^ { - i \langle h , t \rangle } \big ( \hat { p } _ { h ^ { e } | Y ^ { e } } ( t | y ) - \hat { p } _ { h ^ { e ^ { \prime } } | Y ^ { e ^ { \prime } } } ( t | y ) \big ) \big ) \mathrm { d } t \Big | \mathrm { d } t ,
|
| 176 |
+
$$
|
| 177 |
+
|
| 178 |
+
where $r _ { 1 }$ and $r _ { 2 }$ are well-selected scalars that depend on $s \big ( \mathcal { V } _ { \rho } ^ { \mathrm { s u p } } ( h , \mathcal { E } _ { a v a i l } ) \big )$ . By the Projection Theorem [31, 42] and the Fourier Inversion Formula, (8) is bounded above by
|
| 179 |
+
|
| 180 |
+
$$
|
| 181 |
+
O ( r _ { 1 } ^ { d } r _ { 2 } ^ { d } ) \times \int _ { u \in \mathbb { R } } \big | \mathscr { R } _ { e ^ { \prime } } ( \beta , u ) - \mathscr { R } _ { e } ( \beta , u ) \big | \mathrm { d } u ,
|
| 182 |
+
$$
|
| 183 |
+
|
| 184 |
+
where $\mathcal { R } _ { e } ( \beta , u )$ is the Radon transform of $p _ { h ^ { e } | Y ^ { e } } ( t | y )$ .
|
| 185 |
+
|
| 186 |
+
Step 3. The right-hand side of Formula 8 can be bounded by $O \big ( r _ { 1 } ^ { d } r _ { 2 } ^ { d } s \big ( \mathcal { V } _ { \rho } ^ { \mathrm { s u p } } ( h , \mathcal { E } _ { a v a i l } ) \big ) \big )$ . We finish the proof by selecting appropriate $r _ { 1 }$ and $r _ { 2 }$ to balance the rate of the dominant term and other minor terms. For more details, please see Appendix 2 for the complete proofs.
|
| 187 |
+
|
| 188 |
+
Now we turn to the lower bound of $\operatorname { e r r } ( f )$
|
| 189 |
+
|
| 190 |
+
Theorem 4.3 (Lower Bound). Consider 0-1 loss: $\ell ( \hat { y } , y ) = \mathbb { I } ( \hat { y } \neq y )$ . For any $\delta > 0$ and any exps.t. $k x \leq s ( x ) < + \infty , x \in [ 0 , t ]$ $\begin{array} { r } { s _ { + } ^ { \prime } ( 0 ) \triangleq \operatorname* { l i m } _ { x \to 0 ^ { + } } \frac { s ( x ) - s ( 0 ) } { x } \in ( 1 , + \infty ) } \end{array}$ s(x)−s(0) ∈ (1, +∞); 2) exists k > 1, t > 0, $C _ { 0 }$ $O O D$ generaliz $( \mathcal { E } _ { a v a i l } , \mathcal { E } _ { a l l } )$ that is $( s ( \cdot ) , \delta )$ -learnable under linear feature space $\Phi$ w.r.t symmetric $K L$ -divergence $\rho$ , s.t. $\forall \varepsilon \ \in \ [ 0 , \frac { t } { 2 } ] .$ , the optimal classifier $f$ satisfying $\mathcal { V } ^ { s u p } ( h , \mathcal { E } _ { a v a i l } ) = \varepsilon$ will have the OOD generalization error lower bounded by
|
| 191 |
+
|
| 192 |
+
$$
|
| 193 |
+
\mathrm { e r r } ( f ) \geq C _ { 0 } \cdot s ( \mathcal { V } ^ { s u p } ( h , \mathcal { E } _ { a v a i l } ) ) .
|
| 194 |
+
$$
|
| 195 |
+
|
| 196 |
+
Theorem 4.3 shows that $\operatorname { e r r } ( f )$ of optimal classifier $f$ is lower bounded by its variation. Here “optimal” means the classifier that minimize $\mathcal { L } ( f , \mathcal { E } _ { a v a i l } )$ . Altogether, the above three theorems offer a bidirectional control of OOD generalization error, showing that our formulation can offer a fine-grained description of most OOD generalization problem in a theoretical way. To pursue a good OOD performance, OOD algorithm should focus on improving predictive performance on $\mathcal { E } _ { a v a i l }$ and controlling the variation $\mathcal { V } ^ { \mathrm { s u p } } ( h , \mathcal { E } _ { a v a i l } )$ simultaneously. Note that this bound starts from population error, and we call for future works to combine our generalization bound and traditional bound from data samples to population error, giving a more complete characterization of the problem.
|
| 197 |
+
|
| 198 |
+
# 5 Variation as a Factor of Model Selection Criterion
|
| 199 |
+
|
| 200 |
+
As is pointed out in [21], model selection has a significant effect on domain generalization, and any OOD algorithm without a model selection criterion is not complete. [21] trained more than 45,900 models with different algorithms, and results show that when traditional selection methods are applied, none of OOD algorithms can outperform ERM [58] by a significant margin. This result is not strange, since traditional selection methods focus mainly on (validation) accuracy, which is biased in OOD generalization [21, 63]. A very typical example is Colored MNIST [5], where the image is colored according to the label, but the relationship varies across domains. As explained in [5], ERM principle will only capture this spurious feature (color) and performs badly in ${ \mathcal { E } } _ { a l l }$ . Since ERM is exactly minimizing loss in $\mathcal { E } _ { a v a i l }$ , any model selection method using validation accuracy alone is likely to choose ERM rather than any other OOD algorithm [63]. Thus no algorithm will have a significant improvement compared to ERM.
|
| 201 |
+
|
| 202 |
+
A natural question arises: what else can we use, in addition to accuracy? Theorem 4.1 points out that, learning feature with small variation across $\mathcal { E } _ { a v a i l }$ is important for decreasing OOD generalization error. Once a model $f$ achieves a small $\mathcal { V } ^ { \mathrm { s u p } } ( h , \mathcal { E } _ { a v a i l } )$ , then $\operatorname { e r r } ( f )$ will be small. If the validation accuracy is also high, we shall know that the OOD accuracy will remain high. To this end, we propose our heuristic selection criterion (Algorithm 1). Instead of considering validation accuracy alone, we combine it with feature variation and select the model with high validation accuracy as well as low variation.
|
| 203 |
+
|
| 204 |
+
# Algorithm 1: Model Selection
|
| 205 |
+
|
| 206 |
+
Input: available dataset $\mathcal { X } _ { a v a i l } = ( \mathcal { X } _ { t r a i n } , \mathcal { X } _ { v a l } )$ , candidate models set $\mathcal { M }$ , var_acc_rate $r _ { 0 }$ .
|
| 207 |
+
for $f = g \circ h$ in $\mathcal { M }$ do for $i$ in $[ d ]$ do $\hat { \mathcal { V } } _ { i } \gets \operatorname* { m a x } _ { y \in \mathcal { V } , \mathcal { X } ^ { e } \neq \mathcal { X } ^ { e ^ { \prime } } \in \mathcal { X } _ { a v a i l } }$ Total Variation $( \mathbb { P } ( \phi _ { i } ^ { e } | y ) , \mathbb { P } ( \phi _ { i } ^ { e ^ { \prime } } | y ) )$ ; .Use GPU KDE end $\mathcal { V } _ { f } \gets \mathrm { m e a n } _ { i \in [ d ] } \hat { \mathcal { V } } _ { i }$ $\operatorname { A c c } _ { f } $ compute validation accuracy of $f$ using $\mathcal { X } _ { v a l }$
|
| 208 |
+
end
|
| 209 |
+
Retur ${ \mathfrak { n } } \operatorname { a r g m a x } _ { f \in { \mathcal { M } } } ( \operatorname { A c c } _ { f } - r _ { 0 } \mathcal { V } _ { f } )$
|
| 210 |
+
|
| 211 |
+
We briefly explain Algorithm 1 here. For each candidate model, we calculate its variation using the average of each feature’s variation, i.e., $\begin{array} { r } { \frac { 1 } { d } \sum _ { i \in [ d ] } \mathcal { V } ( \phi _ { i } , \mathcal { X } _ { a v a i l } ) } \end{array}$ . When deriving the bounds, we use $\mathcal { V } ^ { \mathrm { s u p } }$ instead of their average because we need to consider the worst case, i.e., the worst top model. In practice, we find out that the average of $\mathcal { V } ( \phi _ { i } , \mathcal { X } _ { a v a i l } )$ is enough to improve selection.
|
| 212 |
+
|
| 213 |
+
Our criterion of model selection is
|
| 214 |
+
|
| 215 |
+
$$
|
| 216 |
+
\operatorname { A c c } _ { f } { - r _ { 0 } \gamma _ { f } } ,
|
| 217 |
+
$$
|
| 218 |
+
|
| 219 |
+
i.e., we select a model with high validation accuracy and low variation simultaneously. Here $r _ { 0 }$ is a hyper-parameter representing the concrete relationship between $\operatorname { e r r } ( f )$ and $\mathcal { V } _ { f }$ . Although we have already used one hyper-parameter to help select multiple hyper-parameter combinations, it is natural to ask whether we can further get rid of the selection of $r _ { 0 }$ . Since $r _ { 0 }$ represents the relationship between variation and accuracy, which is actually determined by the unknown expansion function, explicitly calculating $r _ { 0 }$ is not possible. However, we can empirically estimate $r _ { 0 }$ using $\begin{array} { r } { r _ { 0 } = \frac { \mathrm { S t d } _ { f \in \hat { \mathcal { M } } } \mathrm { A c c } _ { f } } { \mathrm { S t d } _ { f \in \hat { \mathcal { M } } } \mathcal { V } _ { f } } } \end{array}$ where $\hat { \mathcal { M } } \subset \mathcal { M }$ is the model with not bad validation accuracy. We do not use the whole set $\mathcal { M }$ because some OOD algorithms will perform extremely bad when the penalty is huge, and these models will influence our estimation of the ratio. Since high validation means large informativeness in learned features, the use of $\hat { \mathcal { M } }$ is an implicit application of informative assumption.
|
| 220 |
+
|
| 221 |
+
As shown in Section 6.1, our method can select models with higher OOD accuracy in various OOD datasets. We also explain in Appendix 3 why our method can outperform the traditional method in Color MNIST, where the dataset is hand-make and simple enough to calculate the expansion function.
|
| 222 |
+
|
| 223 |
+
# 6 Experiments
|
| 224 |
+
|
| 225 |
+
In this section, we conduct experiments to compare our model selection criterion (Section 5) with the baseline method5 [21]. Since both the variation and informativeness in Definition 3.1 are based on one-dimensional features, we can directly estimate these quantities feature-by-feature and design model selection method based on them. To verify the existence of the expansion function and to see what it’s like in a real-world dataset, we plot nearly 2 million features trained in a common-used OOD dataset and compute their variation and informativeness. We then draw the expansion function for this problem.
|
| 226 |
+
|
| 227 |
+
# 6.1 Experiments on Model Selection
|
| 228 |
+
|
| 229 |
+
In this section, we conduct experiments to compare the performance of models selected by our method and by validation accuracy. We train models on different datasets, different $\mathcal { E } _ { a v a i l }$ , and select models according to a different selection criteria. We then compare the OOD accuracy of selected models.
|
| 230 |
+
|
| 231 |
+
Settings We train our model on three benchmark OOD datasets (PACS [34], OfficeHome [59], VLCS [57]) and consider all possible selections of $( \mathcal { E } _ { a v a i l } , \mathcal { E } _ { a l l } )$ . We choose ResNet–50 as our network architecture. We use ERM [58] and four common-used OOD algorithms (CORAL [55], Inter-domain Mixup [62], Group DRO [51], and IRM [5]). For each environment setup, we train 200 models using different algorithms, penalties, learning rates, and epoch. After training, we employ different selection methods and compare the OOD accuracy of the selected models. As stated in Section 5, we use the standard deviation of $\nu$ and validation accuracy in $\hat { \mathcal { M } }$ to estimate $r _ { 0 }$ , where ${ \hat { \mathcal { M } } } = \{ f \in { \mathcal { M } } : \operatorname { A c c } _ { f } \geq \operatorname* { m a x } _ { \hat { f } } \operatorname { A c c } _ { \hat { f } } - 0 . 1 \}$ . Note that calculating $\mathcal { V } ( \phi _ { i } , \mathcal { X } _ { a v a i l } )$ takes calculus many times, so we design a parallel GPU kernel density estimation to speed up the whole process a hundred times and manage to finish one model in seconds. For more details about the experiments, see Appendix 4.
|
| 232 |
+
|
| 233 |
+
Table 1: Model Selection Result. “Env” denotes the unseen domain during training. “Val” denotes the OOD accuracy of model selected by validation accuracy.
|
| 234 |
+
|
| 235 |
+
<table><tr><td rowspan="3">PACS</td><td>Env</td><td>A</td><td>C</td><td>P</td><td>S</td><td>avg</td><td>acc inc</td></tr><tr><td>Val</td><td>85.20%</td><td>80.42%</td><td>96.17%</td><td>77.86%</td><td>84.91%</td><td>1</td></tr><tr><td>Ours</td><td>88.72%</td><td>81.74%</td><td>96.83%</td><td>79.00%</td><td>86.57%</td><td>1.66%↑</td></tr><tr><td rowspan="3">OfficeHome</td><td>Env</td><td>A</td><td>C</td><td>P</td><td>R</td><td>avg</td><td>acc inc</td></tr><tr><td>Val</td><td>61.85%</td><td>55.56%</td><td>74.72%</td><td>76.25%</td><td>67.09%</td><td>-</td></tr><tr><td>Ours</td><td>65.76%</td><td>55.07%</td><td>75.20%</td><td>76.31%</td><td>68.09%</td><td>1.00%↑</td></tr><tr><td rowspan="3">VLCS</td><td>Env</td><td>C</td><td>L</td><td>S</td><td>V</td><td>avg</td><td>acc inc</td></tr><tr><td>Val</td><td>97.46%</td><td>64.83%</td><td>69.50%6</td><td>70.97%</td><td>75.69%</td><td>1</td></tr><tr><td>Ours</td><td>97.81%</td><td>66.98%</td><td>69.50%</td><td>70.97%</td><td>76.32%</td><td>0.63%↑</td></tr></table>
|
| 236 |
+
|
| 237 |
+
Result We summarize our experimental results in Table 1. For each environment setup, we select the best model according to Algorithm 1 and validation accuracy. The results show that on all datasets, our selection criterion significantly outperforms the validation accuracy in average OOD accuracy. For a more detailed comparison, our method improves the OOD accuracy in most of the 12 setups. Our experiments demonstrate that our criterion can help select models with higher OOD accuracy.
|
| 238 |
+
|
| 239 |
+

|
| 240 |
+
Figure 1: The expansion function of the OOD generalization problem on Office-Home. The $\mathbf { X } ^ { } -$ -axis stands for $\mathcal { V } ( \phi , \mathcal { E } _ { a v a i l } )$ and the y-axis for $\mathcal { V } ( \phi , \mathcal { E } _ { a l l } )$ . There are approximately 2 million points in each image, with each point representing a feature, and its color represents its informativeness. The solid red line stands for the expansion function under the corresponding $\delta$ . When $\delta$ increases, the expansion function decreases. When $\delta = 0$ , no expansion function can make it learnable.
|
| 241 |
+
|
| 242 |
+
One may wonder if the expansion function really exists and what it will look like for a real-world OOD generalization task. In this section, we consider the OOD dataset Office-Home [59]. We explicitly plot millions of features’ $\mathcal { V } _ { \rho } \big ( \phi , \mathcal { E } _ { a v a i l } \big )$ and $\mathcal { V } _ { \rho } \big ( \phi , \mathcal { E } _ { a l l } \big )$ with Total Variation $\rho$ to see what the expansion function is like in this task. We take the architecture as ResNet-50 [23], and we trained thousands of models with more than five algorithms, obtaining about 2 million features. The results are in Figure 1.
|
| 243 |
+
|
| 244 |
+
Existence of $s ( \cdot )$ . When $\delta = 0$ , some non-informative features are nearly 0-invariant across $\mathcal { E } _ { a v a i l }$ but are varying across ${ \mathcal { E } } _ { a l l }$ , so no expansion function can make this task learnable, i.e., this task is NOT $( s ( \cdot ) , 0 )$ for any expansion function. But as $\delta$ increases, only informative features are left, and now we can find appropriate $s ( \cdot )$ to make it learnable. We can clearly realize from the figure that $s ( \cdot )$ do exist when $\delta \geq 0 . 1 5$ .
|
| 245 |
+
|
| 246 |
+
Trade-off between $s ( \cdot )$ and $\delta$ . The second phenomenon is that the slope of $s ( \cdot )$ decreases as $\delta$ increases, showing a trade-off between $s ( \cdot )$ and $\delta$ . Although this trade-off comes naturally from the definition of learnability, it has a deep meaning. As is shown in Section 4, $\operatorname { e r r } ( f )$ is bounded by $O ( s ( \varepsilon ) )$ where $\varepsilon$ is the variation of the model. To make the bound tighter, a natural idea is to choose a flatter $s ( \cdot )$ . However, a flatter $s ( \cdot )$ corresponds to a larger $\delta$ . Typically, learning a model to meet this higher informativeness requirement is more difficult, and it is possible that the algorithm achieves this by capturing more domain-specific features, which will therefore increase the variation of the model, $\varepsilon$ . As a result, we are not sure whether $s ( \varepsilon )$ will increase or decrease. We believe this is also the essence of model selection: i.e., to trade-off between the variation and informativeness of a model, which is done in Formula 11.
|
| 247 |
+
|
| 248 |
+
# 7 More Related Works
|
| 249 |
+
|
| 250 |
+
Domain generalization [12, 39], or OOD generalization, has drawn much attention recently [21, 30]. The goal is to learn a model from several training domains and expect good performance on unseen test domains. [60, 64] offer a comprehensive survey. A popular solution is to extract domain-invariant feature representation. [45] and [49] proved that when the model is linear, the invariance under training domains can help discover invariant features on test domains. [5] introduces the invariant prediction into neural networks and proposes a practical objective function. After that, a lot of works arise from the view of causal discovery, distributional robustness and conditional independence [1, 7, 16, 15, 26, 32, 33, 43, 51, 61]. On the other hand, some works point out the weakness of existing methods from the theoretical and experimental perspectives [2, 21, 29, 41, 50].
|
| 251 |
+
|
| 252 |
+
The OOD generalization requires restrictions on how the target domains may differ. A straightforward approach is to define a set of test domains around the training domain using some distribution distance measure [6, 13, 19, 25, 51, 53, 54, 61]. Another feasible route is the causal framework which is robust to the test distributions caused by interventions[44, 46] on variables, e.g., [5, 24, 36, 37, 40, 47, 49, 52]. The principle of these methods is that a causal model is invariant and can achieve the minimal worstcase risk [4, 22, 44, 49]. Since the test distribution is unknown, additional assumptions are required for generalization analysis. [12, 18, 39] assume that the domains are generated from a hyper-distribution and measures the average risk estimation error bound. [3] derives a risk bound for any linear combination of training domains. For more related results in domain adaptation, a closed field where the test domains can be seen but are unlabeled, please see [9, 10, 28].
|
| 253 |
+
|
| 254 |
+
# 8 Conclusion
|
| 255 |
+
|
| 256 |
+
In this paper, we take the first step towards a rigorous theoretical framework of OOD generalization. We propose a mathematical formulation to characterize the learnability of OOD generalization problem. Based on our framework, we prove generalization bounds and give guarantees for OOD generalization error. Inspired by our bound, we design a model selection criterion to check the model’s variation and validation accuracy simultaneously. Experiments show that our metric has a significant advantage over the traditional selection method.
|
| 257 |
+
|
| 258 |
+
# Acknowledgments and Disclosure of Funding
|
| 259 |
+
|
| 260 |
+
Authors are thankful to the anonymous reviewers for their helpful and constructive feedback.
|
| 261 |
+
|
| 262 |
+
# References
|
| 263 |
+
|
| 264 |
+
[1] Kartik Ahuja, Karthikeyan Shanmugam, Kush Varshney, and Amit Dhurandhar. Invariant risk minimization games. arXiv preprint arXiv:2002.04692, 2020.
|
| 265 |
+
[2] Kartik Ahuja, Jun Wang, Amit Dhurandhar, Karthikeyan Shanmugam, and Kush R Varshney. Empirical or invariant risk minimization? a sample complexity perspective. arXiv preprint arXiv:2010.16412, 2020.
|
| 266 |
+
[3] Isabela Albuquerque, João Monteiro, Tiago H Falk, and Ioannis Mitliagkas. Adversarial target-invariant representation learning for domain generalization. arXiv preprint arXiv:1911.00804, 2019.
|
| 267 |
+
[4] John Aldrich. Autonomy. Oxford Economic Papers, 41(1):15–34, 1989.
|
| 268 |
+
[5] Martin Arjovsky, Léon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization. arXiv preprint arXiv:1907.02893, 2019.
|
| 269 |
+
[6] J Andrew Bagnell. Robust supervised learning. In Proceedings of the national conference on artificial intelligence, volume 20, page 714. Menlo Park, CA; Cambridge, MA; London; AAAI Press; MIT Press; 1999, 2005.
|
| 270 |
+
[7] Haoyue Bai, Rui Sun, Lanqing Hong, Fengwei Zhou, Nanyang Ye, Han-Jia Ye, S-H Gary Chan, and Zhenguo Li. Decaug: Out-of-distribution generalization via decomposed feature representation and semantic augmentation. arXiv preprint arXiv:2012.09382, 2020.
|
| 271 |
+
[8] Sara Beery, Grant Van Horn, and Pietro Perona. Recognition in terra incognita. In Proceedings of the European Conference on Computer Vision (ECCV), September 2018.
|
| 272 |
+
[9] Shai Ben-David, John Blitzer, Koby Crammer, Fernando Pereira, et al. Analysis of representations for domain adaptation. Advances in neural information processing systems, 19:137, 2007.
|
| 273 |
+
[10] Shai Ben-David, John Blitzer, Koby Crammer, Alex Kulesza, Fernando Pereira, and Jennifer Wortman Vaughan. A theory of learning from different domains. Machine learning, 79(1):151–175, 2010.
|
| 274 |
+
[11] Yoshua Bengio, Tristan Deleu, Nasim Rahaman, Nan Rosemary Ke, Sebastien Lachapelle, Olexa Bilaniuk, Anirudh Goyal, and Christopher Pal. A meta-transfer objective for learning to disentangle causal mechanisms. In International Conference on Learning Representations, 2019.
|
| 275 |
+
[12] Gilles Blanchard, Gyemin Lee, and Clayton Scott. Generalizing from several related classification tasks to a new unlabeled sample. Advances in neural information processing systems, 24:2178–2186, 2011.
|
| 276 |
+
[13] Jose Blanchet, Yang Kang, Karthyek Murthy, and Fan Zhang. Data-driven optimal transport cost selection for distributionally robust optimization. In 2019 Winter Simulation Conference (WSC), pages 3740–3751. IEEE, 2019.
|
| 277 |
+
[14] Laurent Cavalier. Efficient estimation of a density in a problem of tomography. Annals of Statistics, pages 630–647, 2000.
|
| 278 |
+
[15] Shiyu Chang, Yang Zhang, Mo Yu, and Tommi Jaakkola. Invariant rationalization. In International Conference on Machine Learning, pages 1448–1458. PMLR, 2020.
|
| 279 |
+
[16] Elliot Creager, Joern-Henrik Jacobsen, and Richard Zemel. Exchanging lessons between algorithmic fairness and domain generalization, 2021. URL https://openreview.net/forum?id=DC1Im3MkGG.
|
| 280 |
+
[17] Alex J DeGrave, Joseph D Janizek, and Su-In Lee. Ai for radiographic covid-19 detection selects shortcuts over signal. medRxiv, 2020.
|
| 281 |
+
[18] Aniket Anand Deshmukh, Yunwen Lei, Srinagesh Sharma, Urun Dogan, James W Cutler, and Clayton Scott. A generalization error bound for multi-class domain generalization. arXiv preprint arXiv:1905.10392, 2019.
|
| 282 |
+
[19] Peyman Mohajerin Esfahani and Daniel Kuhn. Data-driven distributionally robust optimization using the wasserstein metric: Performance guarantees and tractable reformulations. Mathematical Programming, 171(1-2):115–166, 2018.
|
| 283 |
+
[20] Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. The journal of machine learning research, 17(1):2096–2030, 2016.
|
| 284 |
+
[21] Ishaan Gulrajani and David Lopez-Paz. In search of lost domain generalization. arXiv preprint arXiv:2007.01434, 2020.
|
| 285 |
+
[22] Trygve Haavelmo. The probability approach in econometrics. Econometrica: Journal of the Econometric Society, pages iii–115, 1944.
|
| 286 |
+
[23] 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 (CVPR), June 2016.
|
| 287 |
+
[24] Christina Heinze-Deml and Nicolai Meinshausen. Conditional variance penalties and domain shift robustness. Machine Learning, 110(2):303–348, 2021.
|
| 288 |
+
[25] Zhaolin Hu and L Jeff Hong. Kullback-leibler divergence constrained distributionally robust optimization. Available at Optimization Online, 2013.
|
| 289 |
+
[26] Wengong Jin, Regina Barzilay, and Tommi Jaakkola. Domain extrapolation via regret minimization. arXiv preprint arXiv:2006.03908, 2020.
|
| 290 |
+
[27] Wengong Jin, Regina Barzilay, and Tommi S. Jaakkola. Enforcing predictive invariance across structured biomedical domains, 2021. URL https://openreview.net/forum?id $=$ JywMsiz_NtO.
|
| 291 |
+
[28] Fredrik D Johansson, David Sontag, and Rajesh Ranganath. Support and invertibility in domain-invariant representations. In The 22nd International Conference on Artificial Intelligence and Statistics, pages 527–536. PMLR, 2019.
|
| 292 |
+
[29] Pritish Kamath, Akilesh Tangella, Danica J Sutherland, and Nathan Srebro. Does invariant risk minimization capture invariance? arXiv preprint arXiv:2101.01134, 2021.
|
| 293 |
+
[30] Pang Wei Koh, Shiori Sagawa, Henrik Marklund, Sang Michael Xie, Marvin Zhang, Akshay Balsubramani, Weihua Hu, Michihiro Yasunaga, Richard Lanas Phillips, Sara Beery, et al. Wilds: A benchmark of in-the-wild distribution shifts. arXiv preprint arXiv:2012.07421, 2020.
|
| 294 |
+
[31] Aleksandr Petrovich Korostelev and Alexandre B Tsybakov. Minimax theory of image reconstruction, volume 82. Springer Science & Business Media, 2012.
|
| 295 |
+
[32] Masanori Koyama and Shoichiro Yamaguchi. Out-of-distribution generalization with maximal invariant predictor. arXiv preprint arXiv:2008.01883, 2020.
|
| 296 |
+
[33] David Krueger, Ethan Caballero, Joern-Henrik Jacobsen, Amy Zhang, Jonathan Binas, Remi Le Priol, and Aaron Courville. Out-of-distribution generalization via risk extrapolation (rex). arXiv preprint arXiv:2003.00688, 2020.
|
| 297 |
+
[34] Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy M Hospedales. Deeper, broader and artier domain generalization. In Proceedings of the IEEE international conference on computer vision, pages 5542–5550, 2017.
|
| 298 |
+
[35] Haoliang Li, Sinno Jialin Pan, Shiqi Wang, and Alex C Kot. Domain generalization with adversarial feature learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5400–5409, 2018.
|
| 299 |
+
[36] Sara Magliacane, Thijs van Ommen, Tom Claassen, Stephan Bongers, Philip Versteeg, and Joris M Mooij. Domain adaptation by using causal inference to predict invariant conditional distributions. arXiv preprint arXiv:1707.06422, 2017.
|
| 300 |
+
[37] Nicolai Meinshausen. Causality from a distributional robustness point of view. In 2018 IEEE Data Science Workshop (DSW), pages 6–10. IEEE, 2018.
|
| 301 |
+
[38] Jose G Moreno-Torres, Troy Raeder, Rocío Alaiz-Rodríguez, Nitesh V Chawla, and Francisco Herrera. A unifying view on dataset shift in classification. Pattern recognition, 45(1):521–530, 2012.
|
| 302 |
+
[39] Krikamol Muandet, David Balduzzi, and Bernhard Schölkopf. Domain generalization via invariant feature representation. In International Conference on Machine Learning, pages 10–18, 2013.
|
| 303 |
+
[40] Jens Müller, Robert Schmier, Lynton Ardizzone, Carsten Rother, and Ullrich Köthe. Learning robust models using the principle of independent causal mechanisms. arXiv preprint arXiv:2010.07167, 2020.
|
| 304 |
+
[41] Vaishnavh Nagarajan, Anders Andreassen, and Behnam Neyshabur. Understanding the failure modes of out-of-distribution generalization. arXiv preprint arXiv:2010.15775, 2020.
|
| 305 |
+
[42] Frank Natterer. The mathematics of computerized tomography. SIAM, 2001.
|
| 306 |
+
[43] Giambattista Parascandolo, Alexander Neitz, Antonio Orvieto, Luigi Gresele, and Bernhard Schölkopf. Learning explanations that are hard to vary. arXiv preprint arXiv:2009.00329, 2020.
|
| 307 |
+
[44] Judea Pearl. Causality. Cambridge university press, 2009.
|
| 308 |
+
[45] Jonas Peters, Peter Bühlmann, and Nicolai Meinshausen. Causal inference by using invariant prediction: identification and confidence intervals. Journal of the Royal Statistical Society. Series B (Statistical Methodology), pages 947–1012, 2016.
|
| 309 |
+
[46] Jonas Peters, Dominik Janzing, and Bernhard Schölkopf. Elements of causal inference: foundations and learning algorithms. The MIT Press, 2017.
|
| 310 |
+
[47] Niklas Pfister, Evan G Williams, Jonas Peters, Ruedi Aebersold, and Peter Bühlmann. Stabilizing variable selection and regression. arXiv preprint arXiv:1911.01850, 2019.
|
| 311 |
+
[48] Benjamin Recht, Rebecca Roelofs, Ludwig Schmidt, and Vaishaal Shankar. Do imagenet classifiers generalize to imagenet? In International Conference on Machine Learning, pages 5389–5400. PMLR, 2019.
|
| 312 |
+
[49] Mateo Rojas-Carulla, Bernhard Schölkopf, Richard Turner, and Jonas Peters. Invariant models for causal transfer learning. The Journal of Machine Learning Research, 19(1):1309–1342, 2018.
|
| 313 |
+
[50] Elan Rosenfeld, Pradeep Ravikumar, and Andrej Risteski. The risks of invariant risk minimization. arXiv preprint arXiv:2010.05761, 2020.
|
| 314 |
+
[51] Shiori Sagawa, Pang Wei Koh, Tatsunori B Hashimoto, and Percy Liang. Distributionally robust neural networks. In International Conference on Learning Representations, 2019.
|
| 315 |
+
[52] Bernhard Schölkopf, Dominik Janzing, Jonas Peters, Eleni Sgouritsa, Kun Zhang, and Joris Mooij. On causal and anticausal learning. arXiv preprint arXiv:1206.6471, 2012.
|
| 316 |
+
[53] Soroosh Shafieezadeh Abadeh, Peyman M Mohajerin Esfahani, and Daniel Kuhn. Distributionally robust logistic regression. Advances in Neural Information Processing Systems, 28:1576–1584, 2015.
|
| 317 |
+
[54] Aman Sinha, Hongseok Namkoong, and John Duchi. Certifying some distributional robustness with principled adversarial training. In International Conference on Learning Representations, 2018.
|
| 318 |
+
[55] Baochen Sun and Kate Saenko. Deep coral: Correlation alignment for deep domain adaptation. In European conference on computer vision, pages 443–450. Springer, 2016.
|
| 319 |
+
[56] Rohan Taori, Achal Dave, Vaishaal Shankar, Nicholas Carlini, Benjamin Recht, and Ludwig Schmidt. Measuring robustness to natural distribution shifts in image classification. Advances in Neural Information Processing Systems, 33, 2020.
|
| 320 |
+
[57] Antonio Torralba and Alexei A Efros. Unbiased look at dataset bias. In CVPR 2011, pages 1521–1528. IEEE, 2011.
|
| 321 |
+
[58] Vladimir Vapnik. Principles of risk minimization for learning theory. In Advances in neural information processing systems, pages 831–838, 1992.
|
| 322 |
+
[59] Hemanth Venkateswara, Jose Eusebio, Shayok Chakraborty, and Sethuraman Panchanathan. Deep hashing network for unsupervised domain adaptation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5018–5027, 2017.
|
| 323 |
+
[60] Jindong Wang, Cuiling Lan, Chang Liu, Yidong Ouyang, Wenjun Zeng, and Tao Qin. Generalizing to unseen domains: A survey on domain generalization. arXiv preprint arXiv:2103.03097, 2021.
|
| 324 |
+
[61] Chuanlong Xie, Fei Chen, Yue Liu, and Zhenguo Li. Risk variance penalization. arXiv preprint arXiv:2006.07544, 2020.
|
| 325 |
+
[62] Shen Yan, Huan Song, Nanxiang Li, Lincan Zou, and Liu Ren. Improve unsupervised domain adaptation with mixup training. arXiv preprint arXiv:2001.00677, 2020.
|
| 326 |
+
[63] Haotian Ye, Chuanlong Xie, Yue Liu, and Zhenguo Li. Out-of-distribution generalization analysis via influence function. arXiv preprint arXiv:2101.08521, 2021.
|
| 327 |
+
[64] Kaiyang Zhou, Ziwei Liu, Yu Qiao, Tao Xiang, and Chen Change Loy. Domain generalization: A survey. arXiv preprint arXiv:2103.02503, 2021.
|
| 328 |
+
|
| 329 |
+
# Checklist
|
| 330 |
+
|
| 331 |
+
1. For all authors...
|
| 332 |
+
|
| 333 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 334 |
+
(b) Did you describe the limitations of your work? [Yes] See Section 5.
|
| 335 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A]
|
| 336 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 337 |
+
|
| 338 |
+
2. If you are including theoretical results...
|
| 339 |
+
|
| 340 |
+
(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]
|
| 341 |
+
|
| 342 |
+
3. If you ran experiments...
|
| 343 |
+
|
| 344 |
+
(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]
|
| 345 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] In the appendix.
|
| 346 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [N/A]
|
| 347 |
+
(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]
|
| 348 |
+
|
| 349 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 350 |
+
|
| 351 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] We use [21] and we cite it in Section 6.
|
| 352 |
+
(b) Did you mention the license of the assets? [N/A]
|
| 353 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [No]
|
| 354 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [Yes]
|
| 355 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 356 |
+
|
| 357 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 358 |
+
|
| 359 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 360 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 361 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/BJOFETxR-/BJOFETxR-.md
ADDED
|
@@ -0,0 +1,320 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING TO REPRESENT PROGRAMS WITH GRAPHS
|
| 2 |
+
|
| 3 |
+
Miltiadis Allamanis
|
| 4 |
+
Microsoft Research
|
| 5 |
+
Cambridge, UK
|
| 6 |
+
miallama@microsoft.com
|
| 7 |
+
Marc Brockschmidt
|
| 8 |
+
Microsoft Research
|
| 9 |
+
Cambridge, UK
|
| 10 |
+
mabrocks@microsoft.com
|
| 11 |
+
|
| 12 |
+
Mahmoud Khademi∗ Simon Fraser University Burnaby, BC, Canada mkhademi@sfu.ca
|
| 13 |
+
|
| 14 |
+
# ABSTRACT
|
| 15 |
+
|
| 16 |
+
Learning tasks on source code (i.e., formal languages) have been considered recently, but most work has tried to transfer natural language methods and does not capitalize on the unique opportunities offered by code’s known sematics. For example, long-range dependencies induced by using the same variable or function in distant locations are often not considered. We propose to use graphs to represent both the syntactic and semantic structure of code and use graph-based deep learning methods to learn to reason over program structures.
|
| 17 |
+
|
| 18 |
+
In this work, we present how to construct graphs from source code and how to scale Gated Graph Neural Networks training to such large graphs. We evaluate our method on two tasks: VARNAMING, in which a network attempts to predict the name of a variable given its usage, and VARMISUSE, in which the network learns to reason about selecting the correct variable that should be used at a given program location. Our comparison to methods that use less structured program representations shows the advantages of modeling known structure, and suggests that our models learn to infer meaningful names and to solve the VARMISUSE task in many cases. Additionally, our testing showed that VARMISUSE identifies a number of bugs in mature open-source projects.
|
| 19 |
+
|
| 20 |
+
# 1 INTRODUCTION
|
| 21 |
+
|
| 22 |
+
The advent of large repositories of source code as well as scalable machine learning methods naturally leads to the idea of “big code”, i.e., largely unsupervised methods that support software engineers by generalizing from existing source code (Allamanis et al., 2017). Currently, existing deep learning models of source code capture its shallow, textual structure, e.g. as a sequence of tokens (Hindle et al., 2012; Raychev et al., 2014; Allamanis et al., 2016), as parse trees (Maddison & Tarlow, 2014; Bielik et al., 2016), or as a flat dependency networks of variables (Raychev et al., 2015). Such models miss out on the opportunity to capitalize on the rich and well-defined semantics of source code. In this work, we take a step to alleviate this by including two additional signal sources in source code: data flow and type hierarchies. We do this by encoding programs as graphs, in which edges represent syntactic relationships (e.g. “token before/after”) as well as semantic relationships (“variable last used/written here”, “formal parameter for argument is called stream”, etc.). Our key insight is that exposing these semantics explicitly as structured input to a machine learning model lessens the requirements on amounts of training data, model capacity and training regime and allows us to solve tasks that are beyond the current state of the art.
|
| 23 |
+
|
| 24 |
+
We explore two tasks to illustrate the advantages of exposing more semantic structure of programs. First, we consider the VARNAMING task (Allamanis et al., 2014; Raychev et al., 2015), in which given some source code, the “correct” variable name is inferred as a sequence of subtokens. This requires some understanding of how a variable is used, i.e., requires reasoning about lines of code far apart in the source file. Secondly, we introduce the variable misuse prediction task (VARMISUSE), in which the network aims to infer which variable should be used in a program location. To illustrate the task, Figure 1 shows a slightly simplified snippet of a bug our model detected in a popular open-source project. Specifically, instead of the variable clazz, variable first should have been used in the yellow highlighted slot. Existing static analysis methods cannot detect such issues, even though a software engineer would easily identify this as an error from experience.
|
| 25 |
+
|
| 26 |
+

|
| 27 |
+
Figure 1: A snippet of a detected bug in RavenDB an open-source C# project. The code has been slightly simplified. Our model detects correctly that the variable used in the highlighted (yellow) slot is incorrect. Instead, first should have been placed at the slot. We reported this problem which was fixed in PR 4138.
|
| 28 |
+
|
| 29 |
+
To achieve high accuracy on these tasks, we need to learn representations of program semantics. For both tasks, we need to learn the semantic role of a variable (e.g., “is it a counter?”, “is it a filename?”). Additionally, for VARMISUSE, learning variable usage semantics (e.g., “a filename is needed here”) is required. This “fill the blank element” task is related to methods for learning distributed representations of natural language words, such as Word2Vec (Mikolov et al., 2013) and GLoVe (Pennington et al., 2014). However, we can learn from a much richer structure such as data flow information. This work is a step towards learning program representations, and we expect them to be valuable in a wide range of other tasks, such as code completion (“this is the variable you are looking for”) and more advanced bug finding (“you should lock before using this object”).
|
| 30 |
+
|
| 31 |
+
To summarize, our contributions are: (i) We define the VARMISUSE task as a challenge for machine learning modeling of source code, that requires to learn (some) semantics of programs (cf. section 3). (ii) We present deep learning models for solving the VARNAMING and VARMISUSE tasks by modeling the code’s graph structure and learning program representations over those graphs (cf. section 4). (iii) We evaluate our models on a large dataset of 2.9 million lines of real-world source code, showing that our best model achieves $3 2 . 9 \%$ accuracy on the VARNAMING task and $8 5 . 5 \%$ accuracy on the VARMISUSE task, beating simpler baselines (cf. section 5). (iv) We document practical relevance of VARMISUSE by summarizing some bugs that we found in mature open-source software projects $( c f .$ subsection 5.3). Our implementation of graph neural networks (on a simpler task) can be found at https://github.com/Microsoft/gated-graph-neural-network-samples and the dataset can be found at https://aka.ms/iclr18-prog-graphs-dataset.
|
| 32 |
+
|
| 33 |
+
# 2 RELATED WORK
|
| 34 |
+
|
| 35 |
+
Our work builds upon the recent field of using machine learning for source code artifacts (Allamanis et al., 2017). For example, Hindle et al. (2012); Bhoopchand et al. (2016) model the code as a sequence of tokens, while Maddison & Tarlow (2014); Raychev et al. (2016) model the syntax tree structure of code. All works on language models of code find that predicting variable and method identifiers is one of biggest challenges in the task.
|
| 36 |
+
|
| 37 |
+
Closest to our work is the work of Allamanis et al. (2015) who learn distributed representations of variables using all their usages to predict their names. However, they do not use data flow information and we are not aware of any model that does so. Raychev et al. (2015) and Bichsel et al. (2016) use conditional random fields to model a variety of relationships between variables, AST elements and types to predict variable names and types (resp. to deobfuscate Android apps), but without considering the flow of data explicitly. In these works, all variable usages are deterministically known beforehand (as the code is complete and remains unmodified), as in Allamanis et al. (2014; 2015).
|
| 38 |
+
|
| 39 |
+
Our work is remotely related to work on program synthesis using sketches (Solar-Lezama, 2008) and automated code transplantation (Barr et al., 2015). However, these approaches require a set of specifications (e.g. input-output examples, test suites) to complete the gaps, rather than statistics learned from big code. These approaches can be thought as complementary to ours, since we learn to statistically complete the gaps without any need for specifications, by learning common variable usage patterns from code.
|
| 40 |
+
|
| 41 |
+
Neural networks on graphs (Gori et al., 2005; Li et al., 2015; Defferrard et al., 2016; Kipf & Welling, 2016; Gilmer et al., 2017) adapt a variety of deep learning methods to graph-structured input. They have been used in a series of applications, such as link prediction and classification (Grover & Leskovec, 2016) and semantic role labeling in NLP (Marcheggiani & Titov, 2017). Somewhat related to source code is the work of Wang et al. (2017) who learn graph-based representations of mathematical formulas for premise selection in theorem proving.
|
| 42 |
+
|
| 43 |
+
# 3 THE VARMISUSE TASK
|
| 44 |
+
|
| 45 |
+
Detecting variable misuses in code is a task that requires understanding and reasoning about program semantics. To successfully tackle the task one needs to infer the role and function of the program elements and understand how they relate. For example, given a program such as Fig. 1, the task is to automatically detect that the marked use of $\mathtt { C 1 a z z }$ is a mistake and that first should be used instead. While this task resembles standard code completion, it differs significantly in its scope and purpose, by considering only variable identifiers and a mostly complete program.
|
| 46 |
+
|
| 47 |
+
Task Description We view a source code file as a sequence of tokens $t _ { 0 } \ldots t _ { N } = \mathcal { T }$ , in which some tokens $t _ { \lambda _ { 0 } } , t _ { \lambda _ { 1 } } \ldots$ are variables. Furthermore, let $\mathbb { V } _ { t } \subset \mathbb { V }$ refer to the set of all type-correct variables in scope at the location of $t$ , i.e., those variables that can be used at $t$ without raising a compiler error. We call a token $t o k _ { \lambda }$ where we want to predict the correct variable usage a slot. We define a separate task for each slot $t _ { \lambda }$ : Given $t _ { 0 } \ldots t _ { \lambda - 1 }$ and $t _ { \lambda + 1 } , \dots , t _ { N }$ , correctly select $t _ { \lambda }$ from $\mathbb { V } _ { t _ { \lambda } }$ . For training and evaluation purposes, a correct solution is one that simply matches the ground truth, but note that in practice, several possible assignments could be considered correct (i.e., when several variables refer to the same value in memory).
|
| 48 |
+
|
| 49 |
+
# 4 MODEL: PROGRAMS AS GRAPHS
|
| 50 |
+
|
| 51 |
+
In this section, we discuss how to transform program source code into program graphs and learn representations over them. These program graphs not only encode the program text but also the semantic information that can be obtained using standard compiler tools.
|
| 52 |
+
|
| 53 |
+
Gated Graph Neural Networks Our work builds on Gated Graph Neural Networks (Li et al., 2015) (GGNN) and we summarize them here. A graph $\mathcal { G } = ( \nu , \pmb { \varepsilon } , \pmb { X } )$ is composed of a set of nodes $\nu$ , node features $\boldsymbol { X }$ , and a list of directed edge sets $\pmb { \mathcal { E } } = ( \mathcal { E } _ { 1 } , \ldots , \mathcal { E } _ { K } )$ where $K$ is the number of edge types. We annotate each $v \in \mathcal V$ with a real-valued vector $\pmb { x } ^ { ( v ) } \in \mathbb { R } ^ { D }$ representing the features of the node (e.g., the embedding of a string label of that node).
|
| 54 |
+
|
| 55 |
+
We associate every node $v$ with a state vector $\mathbf { \Omega } _ { h } ( v )$ , initialized from the node label $\pmb { x } ^ { ( v ) }$ . The sizes of the state vector and feature vector are typically the same, but we can use larger state vectors through padding of node features. To propagate information throughout the graph, “messages” of type $k$ are sent from each $v$ to its neighbors, where each message is computed from its current state vector as m(vk $m _ { k } ^ { ( v ) } = f _ { k } ( { \pmb h } ^ { ( v ) } )$ . Here, $f _ { k }$ can be an arbitrary function; we choose a linear layer in our case. By computing messages for all graph edges at the same time, all states can be updated at the same time. In particular, a new state for a node $v$ is computed by aggregating all incoming messages as $\tilde { m } ^ { ( v ) } = g ( \{ m _ { k } ^ { ( u ) } \ |$ there is an edge of type $k$ from $u$ to $v \}$ ). $g$ is an aggregation function, which we implement as elementwise summation. Given the aggregated message $\tilde { m } ^ { ( v ) }$ and the current state vector $\mathbf { \Omega } _ { h } ( v )$ of node $v$ , the state of the next time step $\boldsymbol { h ^ { \prime } } ^ { ( v ) }$ is computed as $\pmb { h } ^ { \prime ( v ) } = \mathbf { G } \mathbf { R } \mathbf { U } ( \tilde { \pmb { m } } ^ { ( v ) } , \pmb { h } ^ { ( v ) } )$ , where GRU is the recurrent cell function of gated recurrent unit (GRU) (Cho et al., 2014). The
|
| 56 |
+
|
| 57 |
+
(a) Simplified syntax graph for line 2 of Fig. 1, where blue rounded boxes are syntax nodes, black rectangular boxes syntax tokens, blue edges Child edges and double black edges NextToken edges.
|
| 58 |
+
|
| 59 |
+

|
| 60 |
+
Figure 2: Examples of graph edges used in program representation.
|
| 61 |
+
|
| 62 |
+

|
| 63 |
+
|
| 64 |
+
(b) Data flow edges for $\begin{array} { r l r } { ( \overline { { \bf x } } ) ^ { 1 } , \overline { { \boldsymbol { \mathbf { y } } } } } & { { } = } & { \bf F o o ( \begin{array} { l } { ) } \ ; } \end{array} \end{array}$ while $\left. \overline { { \mathbf { x } } } \right. ^ { 3 } \ > \ \mathsf { 0 } .$ ) $\underline { { \nabla } } \mathbf { \Sigma } ^ { 4 } \mathbf { \Sigma } = \underline { { \nabla } } \mathbf { \bar { x } } \mathbf { \Sigma } ^ { 5 } \mathbf { \Sigma } ^ { \subset } \mathbf { \Sigma } \boxed { \nabla } \mathbf { \bar { y } } \mathbf { \Sigma } ^ { 6 }$ (indices added for clarity), with red dotted LastUse edges, green dashed LastWrite edges and dashdotted purple ComputedFrom edges.
|
| 65 |
+
|
| 66 |
+
dynamics defined by the above equations are repeated for a fixed number of time steps. Then, we use the state vectors from the last time step as the node representations.1
|
| 67 |
+
|
| 68 |
+
Program Graphs We represent program source code as graphs and use different edge types to model syntactic and semantic relationships between different tokens. The backbone of a program graph is the program’s abstract syntax tree (AST), consisting of syntax nodes (corresponding to nonterminals in the programming language’s grammar) and syntax tokens (corresponding to terminals). We label syntax nodes with the name of the nonterminal from the program’s grammar, whereas syntax tokens are labeled with the string that they represent. We use Child edges to connect nodes according to the AST. As this does not induce an order on children of a syntax node, we additionally add NextToken edges connecting each syntax token to its successor. An example of this is shown in Fig. 2a.
|
| 69 |
+
|
| 70 |
+
To capture the flow of control and data through a program, we add additional edges connecting different uses and updates of syntax tokens corresponding to variables. For such a token $v$ , let $\mathcal { D } ^ { R } ( v )$ be the set of syntax tokens at which the variable could have been used last. This set may contain several nodes (for example, when using a variable after a conditional in which it was used in both branches), and even syntax tokens that follow in the program code (in the case of loops). Similarly, let $\mathcal { D } ^ { W } ( v )$ be the set of syntax tokens at which the variable was last written to. Using these, we add LastRead (resp. LastWrite) edges connecting $v$ to all elements of $\mathcal { D } ^ { R } ( v )$ (resp. $\tilde { \mathcal { D } } ^ { W } ( v ) )$ . Additionally, whenever we observe an assignment $v = e x p r$ , we connect $v$ to all variable tokens occurring in expr using ComputedFrom edges. An example of such semantic edges is shown in Fig. 2b.
|
| 71 |
+
|
| 72 |
+
We extend the graph to chain all uses of the same variable using LastLexicalUse edges (independent of data flow, i.e., in if (...) { ... v ...} else { ... v ...}, we link the two occurrences of $v$ ). We also connect return tokens to the method declaration using ReturnsTo edges (this creates a “shortcut” to its name and type). Inspired by Rice et al. (2017), we connect arguments in method calls to the formal parameters that they are matched to with FormalArgName edges, i.e., if we observe a call Foo(bar) and a method declaration Foo(InputStream stream), we connect the bar token to the stream token. Finally, we connect every token corresponding to a variable to enclosing guard expressions that use the variable with GuardedBy and GuardedByNegation edges. For example, in if ( $\mathrm { ~ \bf ~ \cdot ~ x ~ } > \mathrm { ~ \bf ~ y ~ }$ ) { ... x ...} else $\{ \ \begin{array} { r l } { \mathrm { ~ \texttt ~ { ~ . ~ . ~ } ~ } \underline { { \mathrm { ~ y ~ } } } \mathrm { ~ . ~ . ~ . ~ } \} } \end{array}$ , we add a GuardedBy edge from $\underline { { \boldsymbol { \mathrm { X } } } }$ (resp. a GuardedByNegation edge from y) to the AST node corresponding to $\mathrm { ~ ~ { ~ x ~ } ~ } > \mathrm { ~ ~ { ~ y ~ } ~ }$ .
|
| 73 |
+
|
| 74 |
+
Finally, for all types of edges we introduce their respective backwards edges (transposing the adjacency matrix), doubling the number of edges and edge types. Backwards edges help with propagating information faster across the GGNN and make the model more expressive.
|
| 75 |
+
|
| 76 |
+
Leveraging Variable Type Information We assume a statically typed language and that the source code can be compiled, and thus each variable has a (known) type $\tau ( v )$ . To use it, we define a learnable embedding function $\mathbf { r } ( \tau )$ for known types and additionally define an “UNKTYPE” for all unknown/unrepresented types. We also leverage the rich type hierarchy that is available in many object-oriented languages. For this, we map a variable’s type $\tau ( v )$ to the set of its supertypes, i.e. $\tau ^ { * } \bar { ( } v ) = \{ \tau : \tau ( v ) \quad$ implements type $\tau \} \cup \{ \bar { \tau } ( v ) \}$ . We then compute the type representation $\mathbf { r } ^ { * } ( v )$ of a variable $v$ as the element-wise maximum of $\{ \mathbf { r } ( \tau ) : \tau \in \tau ^ { * } ( v ) \}$ . We chose the maximum here, as it is a natural pooling operation for representing partial ordering relations (such as type lattices). Using all types in $\tau ^ { * } ( v )$ allows us to generalize to unseen types that implement common supertypes or interfaces. For example, List ${ \tt < K > }$ has multiple concrete types (e.g. List<int>, List<string>). Nevertheless, these types implement a common interface (IList) and share common characteristics. During training, we randomly select a non-empty subset of $\tau ^ { * } ( v )$ which ensures training of all known types in the lattice. This acts both like a dropout mechanism and allows us to learn a good representation for all types in the type lattice.
|
| 77 |
+
|
| 78 |
+
Initial Node Representation To compute the initial node state, we combine information from the textual representation of the token and its type. Concretely, we split the name of a node representing a token into subtokens (e.g. classTypes will be split into two subtokens class and types) on camelCase and pascal_case. We then average the embeddings of all subtokens to retrieve an embedding for the node name. Finally, we concatenate the learned type representation $\mathbf { r } ^ { * } ( v )$ , computed as discussed earlier, with the node name representation, and pass it through a linear layer to obtain the initial representations for each node in the graph.
|
| 79 |
+
|
| 80 |
+
Programs Graphs for VARNAMING Given a program and an existing variable $v$ , we build a program graph as discussed above and then replace the variable name in all corresponding variable tokens by a special ${ < } S \mathrm { L O T } >$ token. To predict a name, we use the initial node labels computed as the concatenation of learnable token embeddings and type embeddings as discussed above, run GGNN propagation for 8 time steps2 and then compute a variable usage representation by averaging the representations for all ${ < } S \mathrm { L O T } >$ tokens. This representation is then used as the initial state of a one-layer GRU, which predicts the target name as a sequence of subtokens (e.g., the name inputStreamBuffer is treated as the sequence [input, stream, buffer]). We train this graph2seq architecture using a maximum likelihood objective. In section 5, we report the accuracy for predicting the exact name and the F1 score for predicting its subtokens.
|
| 81 |
+
|
| 82 |
+
Program Graphs for VARMISUSE To model VARMISUSE with program graphs we need to modify the graph. First, to compute a context representation $\mathbf { } c ( t )$ for a slot $t$ where we want to predict the used variable, we insert a new node $v _ { < S \tt L O T > }$ at the position of $t$ , corresponding to a “hole” at this point, and connect it to the remaining graph using all applicable edges that do not depend on the chosen variable at the slot (i.e., everything but LastUse, LastWrite, LastLexicalUse, and GuardedBy edges). Then, to compute the usage representation $\mathbf { u } ( t , v )$ of each candidate variable $v$ at the target slot, we insert a “candidate” node $v _ { t , v }$ for all $v$ in $\mathbb { V } _ { t }$ , and connect it to the graph by inserting the LastUse, LastWrite and LastLexicalUse edges that would be used if the variable were to be used at this slot. Each of these candidate nodes represents the speculative placement of the variable within the scope.
|
| 83 |
+
|
| 84 |
+
Using the initial node representations, concatenated with an extra bit that is set to one for the candidate nodes $v _ { t , v }$ , we run GGNN propagation for 8 time steps.2 The context and usage representation are then the final node states of the nodes, i.e., $\pmb { c } ( t ) = \pmb { h } ^ { ( v _ { < \mathrm { S L O T } > } ) }$ and $\mathbf { u } ( t , v ) = h ^ { ( v _ { t , v } ) }$ . Finally, the correct variable usage at the location is computed as arg $\textstyle \operatorname* { m a x } _ { v } W [ c ( t ) , \mathbf { u } ( t , v ) ]$ where $W$ is a linear layer that uses the concatenation of $\mathbf { } c ( t )$ and $\mathbf { u } ( t , v )$ . We train using a max-margin objective.
|
| 85 |
+
|
| 86 |
+
# 4.1 IMPLEMENTATION
|
| 87 |
+
|
| 88 |
+
Using GGNNs for sets of large, diverse graphs requires some engineering effort, as efficient batching is hard in the presence of diverse shapes. An important observation is that large graphs are normally very sparse, and thus a representation of edges as an adjacency list would usually be advantageous to reduce memory consumption. In our case, this can be easily implemented using a sparse tensor representation, allowing large batch sizes that exploit the parallelism of modern GPUs efficiently. A second key insight is to represent a batch of graphs as one large graph with many disconnected components. This just requires appropriate pre-processing to make node identities unique. As this makes batch construction somewhat CPU-intensive, we found it useful to prepare minibatches on a separate thread. Our TensorFlow (Abadi et al., 2016) implementation scales to 55 graphs per second during training and 219 graphs per second during test-time using a single NVidia GeForce GTX Titan X with graphs having on average 2,228 (median 936) nodes and 8,350 (median 3,274) edges and 8 GGNN unrolling iterations, all 20 edge types (forward and backward edges for 10 original edge types) and the size of the hidden layer set to 64. The number of types of edges in the GGNN contributes proportionally to the running time. For example, a GGNN run for our ablation study using only the two most common edge types (NextToken, Child) achieves 105 graphs/second during training and 419 graphs/second at test time with the same hyperparameters. Our (generic) implementation of GGNNs is available at https://github.com/Microsoft/ gated-graph-neural-network-samples, using a simpler demonstration task.
|
| 89 |
+
|
| 90 |
+
# 5 EVALUATION
|
| 91 |
+
|
| 92 |
+
Dataset We collected a dataset for the VARMISUSE task from open source $C ^ { \# }$ projects on GitHub. To select projects, we picked the top-starred (non-fork) projects in GitHub. We then filtered out projects that we could not (easily) compile in full using Roslyn3, as we require a compilation to extract precise type information for the code (including those types present in external libraries). Our final dataset contains 29 projects from a diverse set of domains (compilers, databases, . . . ) with about 2.9 million non-empty lines of code. A full table is shown in Appendix D.
|
| 93 |
+
|
| 94 |
+
For the task of detecting variable misuses, we collect data from all projects by selecting all variable usage locations, filtering out variable declarations, where at least one other type-compatible replacement variable is in scope. The task is then to infer the correct variable that originally existed in that location. Thus, by construction there is at least one type-correct replacement variable, i.e. picking it would not raise an error during type checking. In our test datasets, at each slot there are on average 3.8 type-correct alternative variables (median 3, $\sigma = 2 . 6$ ).
|
| 95 |
+
|
| 96 |
+
From our dataset, we selected two projects as our development set. From the rest of the projects, we selected three projects for UNSEENPROJTEST to allow testing on projects with completely unknown structure and types. We split the remaining 23 projects into train/validation/test sets in the proportion 60-10-30, splitting along files (i.e., all examples from one source file are in the same set). We call the test set obtained like this SEENPROJTEST.
|
| 97 |
+
|
| 98 |
+
Baselines For VARMISUSE, we consider two bidirectional RNN-based baselines. The local model (LOC) is a simple two-layer bidirectional GRU run over the tokens before and after the target location. For this baseline, $\mathbf { } c ( t )$ is set to the slot representation computed by the RNN, and the usage context of each variable $\mathbf { u } ( t , v )$ is the embedding of the name and type of the variable, computed in the same way as the initial node labels in the GGNN. This baseline allows us to evaluate how important the usage context information is for this task. The flat dataflow model (AVGBIRNN) is an extension to LOC, where the usage representation $\mathbf { u } ( t , v )$ is computed using another two-layer bidirectional RNN run over the tokens before/after each usage, and then averaging over the computed representations at the variable token $v$ . The local context, $\mathbf { } c ( t )$ , is identical to LOC. AVGBIRNN is a significantly stronger baseline that already takes some structural information into account, as the averaging over all variables usages helps with long-range dependencies. Both models pick the variable that maximizes $\boldsymbol { c } ( t ) ^ { T } \mathbf { u } ( t , v )$ .
|
| 99 |
+
|
| 100 |
+
For VARNAMING, we replace LOC by AVGLBL, which uses a log-bilinear model for 4 left and 4 right context tokens of each variable usage, and then averages over these context representations (this corresponds to the model in Allamanis et al. (2015)). We also test AVGBIRNN on VARNAMING, which essentially replaces the log-bilinear context model by a bidirectional RNN.
|
| 101 |
+
|
| 102 |
+
Table 1: Evaluation of models. SEENPROJTEST refers to the test set containing projects that have files in the training set, UNSEENPROJTEST refers to projects that have no files in the training data. Results averaged over two runs.
|
| 103 |
+
|
| 104 |
+
<table><tr><td></td><td colspan="4">SEENPROJTEST</td><td colspan="4">UNSEENPROJTEST</td></tr><tr><td></td><td>Loc</td><td>AVGLBL</td><td>AVGBIRNN</td><td>GGNN</td><td>Loc</td><td>AVGLBL</td><td>AVGBIRNN</td><td>GGNN</td></tr><tr><td>VARMISUSE</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Accuracy (%)</td><td>50.0</td><td>二</td><td>73.7</td><td>85.5</td><td>28.9</td><td></td><td>60.2</td><td>78.2</td></tr><tr><td>PR AUC</td><td>0.788</td><td></td><td>0.941</td><td>0.980</td><td>0.611</td><td></td><td>0.895</td><td>0.958</td></tr><tr><td>VARNAMING Accuracy (%)</td><td></td><td>36.1</td><td>42.9</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td>53.6</td><td></td><td>22.7</td><td>23.4</td><td>44.0</td></tr><tr><td>F1 (%)</td><td></td><td>44.0</td><td>50.1</td><td>65.8</td><td></td><td>30.6</td><td>32.0</td><td>62.0</td></tr></table>
|
| 105 |
+
|
| 106 |
+
Table 2: Ablation study for the GGNN model on SEENPROJTEST for the two tasks.
|
| 107 |
+
|
| 108 |
+
<table><tr><td>Ablation Description</td><td colspan="2">Accuracy (%) VARMISUSE</td></tr><tr><td></td><td></td><td>VARNAMING</td></tr><tr><td>Standard Model (reported in Table 1)</td><td>85.5</td><td>53.6</td></tr><tr><td>Only NextToken, Child, LastUse_LastWrite edges</td><td>80.6</td><td>31.2</td></tr><tr><td>Only semantic edges (all but NextToken, Child) Only syntax edges (NextToken, Child)</td><td>78.4 55.3</td><td>52.9 34.3</td></tr><tr><td>Node Labels: Tokens instead of subtokens</td><td></td><td></td></tr><tr><td>Node Labels:Disabled</td><td>85.6 84.3</td><td>34.5</td></tr><tr><td></td><td></td><td>31.8</td></tr></table>
|
| 109 |
+
|
| 110 |
+
# 5.1 QUANTITATIVE EVALUATION
|
| 111 |
+
|
| 112 |
+
Table 1 shows the evaluation results of the models for both tasks.4 As LOC captures very little information, it performs relatively badly. AVGLBL and AVGBIRNN, which capture information from many variable usage sites, but do not explicitly encode the rich structure of the problem, still lag behind the GGNN by a wide margin. The performance difference is larger for VARMISUSE, since the structure and the semantics of code are far more important within this setting.
|
| 113 |
+
|
| 114 |
+
Generalization to new projects Generalizing across a diverse set of source code projects with different domains is an important challenge in machine learning. We repeat the evaluation using the UNSEENPROJTEST set stemming from projects that have no files in the training set. The right side of Table 1 shows that our models still achieve good performance, although it is slightly lower compared to SEENPROJTEST. This is expected since the type lattice is mostly unknown in UNSEENPROJTEST.
|
| 115 |
+
|
| 116 |
+
We believe that the dominant problem in applying a trained model to an unknown project (i.e., domain) is the fact that its type hierarchy is unknown and the used vocabulary (e.g. in variables, method and class names, etc.) can differ substantially.
|
| 117 |
+
|
| 118 |
+
Ablation Study To study the effect of some of the design choices for our models, we have run some additional experiments and show their results in Table 2. First, we varied the edges used in the program graph. We find that restricting the model to syntactic information has a large impact on performance on both tasks, whereas restricting it to semantic edges seems to mostly impact performance on VARMISUSE. Similarly, the ComputedFrom, FormalArgName and ReturnsTo edges give a small boost on VARMISUSE, but greatly improve performance on VARNAMING. As evidenced by the experiments with the node label representation, syntax node and token names seem to matter little for VARMISUSE, but naturally have a great impact on VARNAMING.
|
| 119 |
+
|
| 120 |
+
# 5.2 QUALITATIVE EVALUATION
|
| 121 |
+
|
| 122 |
+
Figure 3 illustrates the predictions that GGNN makes on a sample test snippet. The snippet recursively searches for the global directives file by gradually descending into the root folder. Reasoning about the correct variable usages is hard, even for humans, but the GGNN correctly predicts the variable usages at all locations except two (slot 1 and 8). As a software engineer is writing the code, it is imaginable that she may make a mistake misusing one variable in the place of another. Since all variables are string variables, no type errors will be raised. As the probabilities in Fig. 3 suggest most potential variable misuses can be flagged by the model yielding valuable warnings to software engineers. Additional samples with comments can be found in Appendix B.
|
| 123 |
+
|
| 124 |
+

|
| 125 |
+
Figure 3: VARMISUSE predictions on slots within a snippet of the SEENPROJTEST set for the ServiceStack project. Additional visualizations are available in Appendix B. The underlined tokens are the correct tokens. The model has to select among a number of string variables at each slot, where all of them represent some kind of path. The GGNN accurately predicts the correct variable usage in 11 out of the 13 slots reasoning about the complex ways the variables interact among them.
|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
Figure 4: A bug found (yellow) in RavenDB open-source project. The code unnecessarily ensures that the buffer is of size length rather than size (which our model predicts as the correct variable here).
|
| 129 |
+
|
| 130 |
+
Furthermore, Appendix C shows samples of pairs of code snippets that share similar representations as computed by the cosine similarity of the usage representation $\mathbf { u } ( t , v )$ of GGNN. The reader can notice that the network learns to group variable usages that share semantic similarities together. For example, checking for null before the use of a variable yields similar distributed representations across code segments (Sample 1 in Appendix C).
|
| 131 |
+
|
| 132 |
+
# 5.3 DISCOVERED VARIABLE MISUSE BUGS
|
| 133 |
+
|
| 134 |
+
We have used our VARMISUSE model to identify likely locations of bugs in RavenDB (a document database) and Roslyn (Microsoft’s $C ^ { \# }$ compiler framework). For this, we manually reviewed a sample of the top 500 locations in both projects where our model was most confident about a choosing a variable differing from the ground truth, and found three bugs in each of the projects.
|
| 135 |
+
|
| 136 |
+
Figs. 1,4,5 show the issues discovered in RavenDB. The bug in Fig. 1 was possibly caused by copy-pasting, and cannot be easily caught by traditional methods. A compiler will not warn about unused variables (since first is used) and virtually nobody would write a test testing another test. Fig. 4 shows an issue that, although not critical, can lead to increased memory consumption. Fig. 5 shows another issue arising from a non-informative error message. We privately reported three additional bugs to the Roslyn developers, who have fixed the issues in the meantime (cf. https://github.com/dotnet/roslyn/pull/23437). One of the reported bugs could cause a crash in Visual Studio when using certain Roslyn features.
|
| 137 |
+
|
| 138 |
+

|
| 139 |
+
Figure 5: A bug found (yellow) in the RavenDB open-source project. Although backupFilename is found to be invalid by IsValidBackup, the user is notified that backupLocation is invalid instead.
|
| 140 |
+
|
| 141 |
+
Finding these issues in widely released and tested code suggests that our model can be useful during the software development process, complementing classic program analysis tools. For example, one usage scenario would be to guide the code reviewing process to locations a VARMISUSE model has identified as unusual, or use it as a prior to focus testing or expensive code analysis efforts.
|
| 142 |
+
|
| 143 |
+
# 6 DISCUSSION & CONCLUSIONS
|
| 144 |
+
|
| 145 |
+
Although source code is well understood and studied within other disciplines such as programming language research, it is a relatively new domain for deep learning. It presents novel opportunities compared to textual or perceptual data, as its (local) semantics are well-defined and rich additional information can be extracted using well-known, efficient program analyses. On the other hand, integrating this wealth of structured information poses an interesting challenge. Our VARMISUSE task exposes these opportunities, going beyond simpler tasks such as code completion. We consider it as a first proxy for the core challenge of learning the meaning of source code, as it requires to probabilistically refine standard information included in type systems.
|
| 146 |
+
|
| 147 |
+
# REFERENCES
|
| 148 |
+
|
| 149 |
+
Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, et al. Tensorflow: Large-scale machine learning on heterogeneous distributed systems. arXiv preprint arXiv:1603.04467, 2016.
|
| 150 |
+
Miltiadis Allamanis, Earl T Barr, Christian Bird, and Charles Sutton. Learning natural coding conventions. In Foundations of Software Engineering (FSE), 2014.
|
| 151 |
+
Miltiadis Allamanis, Earl T Barr, Christian Bird, and Charles Sutton. Suggesting accurate method and class names. In Foundations of Software Engineering (FSE), 2015.
|
| 152 |
+
Miltiadis Allamanis, Hao Peng, and Charles Sutton. A convolutional attention network for extreme summarization of source code. In International Conference on Machine Learning (ICML), pp. 2091–2100, 2016.
|
| 153 |
+
Miltiadis Allamanis, Earl T Barr, Premkumar Devanbu, and Charles Sutton. A survey of machine learning for big code and naturalness. arXiv preprint arXiv:1709.06182, 2017.
|
| 154 |
+
Earl T Barr, Mark Harman, Yue Jia, Alexandru Marginean, and Justyna Petke. Automated software transplantation. In International Symposium on Software Testing and Analysis (ISSTA), 2015.
|
| 155 |
+
Al Bessey, Ken Block, Ben Chelf, Andy Chou, Bryan Fulton, Seth Hallem, Charles Henri-Gros, Asya Kamsky, Scott McPeak, and Dawson Engler. A few billion lines of code later: using static analysis to find bugs in the real world. Communications of the ACM, 53(2):66–75, 2010.
|
| 156 |
+
Avishkar Bhoopchand, Tim Rocktäschel, Earl Barr, and Sebastian Riedel. Learning Python code suggestion with a sparse pointer network. arXiv preprint arXiv:1611.08307, 2016.
|
| 157 |
+
|
| 158 |
+
Benjamin Bichsel, Veselin Raychev, Petar Tsankov, and Martin Vechev. Statistical deobfuscation of android applications. In Conference on Computer and Communications Security (CCS), 2016.
|
| 159 |
+
|
| 160 |
+
Pavol Bielik, Veselin Raychev, and Martin Vechev. PHOG: probabilistic model for code. In International Conference on Machine Learning (ICML), 2016.
|
| 161 |
+
|
| 162 |
+
Kyunghyun Cho, Bart van Merriënboer, Dzmitry Bahdanau, and Yoshua Bengio. On the properties of neural machine translation: Encoder–decoder approaches. Syntax, Semantics and Structure in Statistical Translation, 2014.
|
| 163 |
+
|
| 164 |
+
Michaël Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. In Neural Information Processing Systems (NIPS), pp. 3844–3852, 2016.
|
| 165 |
+
|
| 166 |
+
Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. Neural message passing for quantum chemistry. arXiv preprint arXiv:1704.01212, 2017.
|
| 167 |
+
|
| 168 |
+
Marco Gori, Gabriele Monfardini, and Franco Scarselli. A new model for learning in graph domains. In IEEE International Joint Conference Neural Networks (IJCNN). IEEE, 2005.
|
| 169 |
+
|
| 170 |
+
Aditya Grover and Jure Leskovec. node2vec: Scalable feature learning for networks. In International Conference on Knowledge Discovery and Data Mining (SIGKDD), pp. 855–864. ACM, 2016.
|
| 171 |
+
|
| 172 |
+
Abram Hindle, Earl T Barr, Zhendong Su, Mark Gabel, and Premkumar Devanbu. On the naturalness of software. In International Conference on Software Engineering (ICSE), 2012.
|
| 173 |
+
|
| 174 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016.
|
| 175 |
+
|
| 176 |
+
Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard Zemel. Gated graph sequence neural networks. In International Conference on Learning Representations (ICLR), 2015.
|
| 177 |
+
|
| 178 |
+
Chris J Maddison and Daniel Tarlow. Structured generative models of natural source code. In International Conference on Machine Learning (ICML), 2014.
|
| 179 |
+
|
| 180 |
+
Diego Marcheggiani and Ivan Titov. Encoding sentences with graph convolutional networks for semantic role labeling. In ACL, 2017.
|
| 181 |
+
|
| 182 |
+
Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Neural Information Processing Systems (NIPS), 2013.
|
| 183 |
+
|
| 184 |
+
Jeffrey Pennington, Richard Socher, and Christopher D Manning. GloVe: Global vectors for word representation. In EMNLP, 2014.
|
| 185 |
+
|
| 186 |
+
Veselin Raychev, Martin Vechev, and Eran Yahav. Code completion with statistical language models. In Programming Languages Design and Implementation (PLDI), pp. 419–428, 2014.
|
| 187 |
+
|
| 188 |
+
Veselin Raychev, Martin Vechev, and Andreas Krause. Predicting program properties from Big Code. In Principles of Programming Languages (POPL), 2015.
|
| 189 |
+
|
| 190 |
+
Veselin Raychev, Pavol Bielik, and Martin Vechev. Probabilistic model for code with decision trees. In Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), 2016.
|
| 191 |
+
|
| 192 |
+
Andrew Rice, Edward Aftandilian, Ciera Jaspan, Emily Johnston, Michael Pradel, and Yulissa Arroyo-Paredes. Detecting argument selection defects. Proceedings of the ACM on Programming Languages, 1(OOPSLA):104, 2017.
|
| 193 |
+
|
| 194 |
+
Michael Schlichtkrull, Thomas N. Kipf, Peter Bloem, Rianne van den Berg, Ivan Titov, and Max Welling. Modeling relational data with graph convolutional network. arXiv preprint arXiv:1703.06103, 2017.
|
| 195 |
+
|
| 196 |
+
Armando Solar-Lezama. Program synthesis by sketching. University of California, Berkeley, 2008.
|
| 197 |
+
|
| 198 |
+
Mingzhe Wang, Yihe Tang, Jian Wang, and Jia Deng. Premise selection for theorem proving by deep graph embedding. In Advances in Neural Information Processing Systems, pp. 2783–2793, 2017.
|
| 199 |
+
|
| 200 |
+

|
| 201 |
+
Figure 6: Precision-Recall and ROC curves for the GGNN model on VARMISUSE. Note that the $y$ axis starts from $50 \%$ .
|
| 202 |
+
|
| 203 |
+
Table 3: Performance of GGNN model on VARMISUSE per number of type-correct, in-scope candidate variables. Here we compute the performance of the full GGNN model that uses subtokens.
|
| 204 |
+
|
| 205 |
+
<table><tr><td># of candidates</td><td>2</td><td>3</td><td>4</td><td></td><td>6or7</td><td>8+</td></tr><tr><td>Accuracy On SEENPROJTEST (%)</td><td>91.6</td><td>84.5</td><td>81.8</td><td>78.6</td><td>75.1</td><td>77.5</td></tr><tr><td>Accuracy On UNSEENPROJTEST (%)</td><td>85.7</td><td>77.1</td><td>75.7</td><td>69.0</td><td>71.5</td><td>62.4</td></tr></table>
|
| 206 |
+
|
| 207 |
+
# A PERFORMANCE CURVES
|
| 208 |
+
|
| 209 |
+
Figure 6 shows the ROC and precision-recall curves for the GGNN model. As the reader may observe, setting a false positive rate to $10 \%$ we get a true positive rate5 of $73 \%$ for the SEENPROJTEST and $69 \%$ for the unseen test. This suggests that this model can be practically used at a high precision setting with acceptable performance.
|
| 210 |
+
|
| 211 |
+
# B VARMISUSE PREDICTION SAMPLES
|
| 212 |
+
|
| 213 |
+
Below we list a set of samples from our SEENPROJTEST projects with comments about the model performance. Code comments and formatting may have been altered for typesetting reasons. The ground truth choice is underlined.
|
| 214 |
+
|
| 215 |
+
# Sample 1
|
| 216 |
+
|
| 217 |
+

|
| 218 |
+
|
| 219 |
+
. The model correctly predicts all variables in the loop.
|
| 220 |
+
|
| 221 |
+
# Sample 2
|
| 222 |
+
|
| 223 |
+

|
| 224 |
+
|
| 225 |
+
#1 name: $86 \%$ , DIR_PATH: $14 \%$ #2 path: $90 \%$ , name: $8 \%$ , DIR_PATH: $2 \%$ #3 path: $76 \%$ , name: $16 \%$ , DIR_PATH: $8 \%$
|
| 226 |
+
|
| 227 |
+
$\triangleright$ String variables are not confused their semantic role is inferred correctly.
|
| 228 |
+
|
| 229 |
+
# Sample 3
|
| 230 |
+
|
| 231 |
+
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
| 232 |
+
public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag $=$ input.ReadTag()) $\ ! = ~ 0$ ) { switch(tag) { default: input.SkipLastField(); break; case 10: { #1 .AddEntriesFrom(input, _repeated_payload_codec); break; } }
|
| 233 |
+
}
|
| 234 |
+
|
| 235 |
+
#1 Payload: $66 \%$ , payload_: $44 \%$
|
| 236 |
+
|
| 237 |
+
$\triangleright$ The model is commonly confused by aliases, i.e. variables that point to the same location in memory.
|
| 238 |
+
In this sample, either choice would have yielded identical behavior.
|
| 239 |
+
|
| 240 |
+
# Sample 4
|
| 241 |
+
|
| 242 |
+

|
| 243 |
+
|
| 244 |
+
#1 gate: $9 9 \%$ , _observers: $1 \%$ #2 _isDisposed: $90 \%$ , _isStopped: $8 \%$ , HasObservers: $2 \%$
|
| 245 |
+
|
| 246 |
+
. The ReturnsTo edge can help predict variables that otherwise would have been impossible.
|
| 247 |
+
|
| 248 |
+
# Sample 5
|
| 249 |
+
|
| 250 |
+

|
| 251 |
+
|
| 252 |
+
#1 error: $93 \%$ , _exception: $7 \%$
|
| 253 |
+
#2 error: $98 \%$ , _exception: $2 \%$
|
| 254 |
+
#3 _gate: $100 \%$ , _observers: $0 \%$
|
| 255 |
+
#4 isStopped: $86 \%$ , _isDisposed: $13 \%$ , HasObservers: $1 \%$
|
| 256 |
+
#5 isStopped: $91 \%$ , _isDisposed: $9 \%$ , HasObservers: $0 \%$
|
| 257 |
+
#6 _exception: $100 \%$ , error: $0 \%$
|
| 258 |
+
#7 error: $98 \%$ , _exception: $2 \%$
|
| 259 |
+
#8 _exception: $9 9 \%$ , error: $1 \%$
|
| 260 |
+
|
| 261 |
+
$\triangleright$ The model predicts the correct variables from all slots apart from the last. Reasoning about the last one, requires interprocedural understanding of the code across the class file.
|
| 262 |
+
|
| 263 |
+
# Sample 6
|
| 264 |
+
|
| 265 |
+
private bool BecomingCommand(object message) if (ReceiveCommand #1 return true; if #2 .ToString() $= =$ #3 #4 .Tell #5 else return false; return true;
|
| 266 |
+
}
|
| 267 |
+
|
| 268 |
+
#1 message: $100 \%$ , Response: $0 \%$ , Message: $0 \%$ #2 message: $100 \%$ , Response: $0 \%$ , Message: $0 \%$ #3 Response: $91 \%$ , Message: $9 \%$ #4 Probe: $98 \%$ , AskedForDelete: $2 \%$ #5 Response: $98 \%$ , Message: $2 \%$
|
| 269 |
+
|
| 270 |
+
. The model predicts correctly all usages except from the one in slot #3. Reasoning about this snippet requires additional semantic information about the intent of the code.
|
| 271 |
+
|
| 272 |
+
# Sample 7
|
| 273 |
+
|
| 274 |
+
var response $=$ ResultsFilter(typeof(TResponse), #1 #2 , request);
|
| 275 |
+
|
| 276 |
+
#1 httpMethod: $9 9 \%$ , absoluteUrl: $1 \%$ , UserName: $0 \%$ , UserAgent: $0 \%$ #2 absoluteUrl: $9 9 \%$ , httpMethod: $1 \%$ , UserName: $0 \%$ , UserAgent: $0 \%$
|
| 277 |
+
|
| 278 |
+
$\triangleright$ The model knows about selecting the correct string parameters because it matches them to the formal parameter names.
|
| 279 |
+
|
| 280 |
+
# Sample 8
|
| 281 |
+
|
| 282 |
+
if #1 $> =$ #2 ) throw new InvalidOperationException(Strings_Core.FAILED_CLOCK_MONITORING)
|
| 283 |
+
|
| 284 |
+
#1 n: $100 \%$ , MAXERROR: $0 \%$ , SYNC_MAXRETRIES: $0 \%$ #2 MAXERROR: $62 \%$ , SYNC_MAXRETRIES: $22 \%$ , n: $16 \%$
|
| 285 |
+
|
| 286 |
+
$\triangleright$ It is hard for the model to reason about conditionals, especially with rare constants as in slot #2.
|
| 287 |
+
|
| 288 |
+
# C NEAREST NEIGHBOR OF GGNN USAGE REPRESENTATIONS
|
| 289 |
+
|
| 290 |
+
Here we show pairs of nearest neighbors based on the cosine similarity of the learned representations $\mathbf { u } ( t , v )$ . Each slot $t$ is marked in dark blue and all usages of $v$ are marked in yellow (i.e. variableName ). This is a set of hand-picked examples showing good and bad examples. A brief description follows after each pair.
|
| 291 |
+
|
| 292 |
+
# Sample 1
|
| 293 |
+
|
| 294 |
+

|
| 295 |
+
|
| 296 |
+
$\triangleright$ Slots that are checked for null-ness have similar representations.
|
| 297 |
+
|
| 298 |
+
# Sample 2
|
| 299 |
+
|
| 300 |
+

|
| 301 |
+
|
| 302 |
+
$\triangleright$ Slots that follow similar API protocols have similar representations. Note that the function HasAddress is a local function, seen only in the testset.
|
| 303 |
+
|
| 304 |
+
# Sample 3
|
| 305 |
+
|
| 306 |
+

|
| 307 |
+
|
| 308 |
+
$\triangleright$ Adding elements to a collection-like object yields similar representations.
|
| 309 |
+
|
| 310 |
+
# D DATASET
|
| 311 |
+
|
| 312 |
+
The collected dataset and its characteristics are listed in Table 4. The full dataset as a set of projects and its parsed JSON will become available online.
|
| 313 |
+
|
| 314 |
+
Table 4: Projects in our dataset. Ordered alphabetically. kLOC measures the number of non-empty lines of C# code. Projects marked with Devwere used as a development set. Projects marked with †were in the test-only dataset. The rest of the projects were split into train-validation-test. The dataset contains in total about 2.9MLOC.
|
| 315 |
+
|
| 316 |
+
<table><tr><td>Name</td><td>Git SHA</td><td>kLOCs</td><td>Slots</td><td>Vars</td><td>Description</td></tr><tr><td>Akka.NET</td><td>719335a1</td><td>240</td><td>51.3k</td><td>51.2k</td><td>Actor-based Concurrent &Distributed Framework</td></tr><tr><td>AutoMapper</td><td>2ca7c2b5</td><td>46</td><td>3.7k</td><td>10.7k</td><td>Object-to-Object Mapping Library</td></tr><tr><td>BenchmarkDotNet</td><td>1670ca34</td><td>28</td><td>5.1k</td><td>6.1k</td><td>Benchmarking Library</td></tr><tr><td>BotBuilder</td><td>190117c3</td><td>44</td><td>6.4k</td><td>8.7k</td><td>SDK for Building Bots</td></tr><tr><td>choco</td><td>93985688</td><td>36</td><td>3.8k</td><td>5.2k</td><td>Windows Package Manager</td></tr><tr><td>commandline†</td><td>09677b16</td><td>11</td><td>1.1k</td><td>2.3k</td><td>Command Line Parser</td></tr><tr><td>CommonMark.NETDev</td><td>f3d54530</td><td>14</td><td>2.6k</td><td>1.4k</td><td>Markdown Parser</td></tr><tr><td>Dapper</td><td>931c700d</td><td>18</td><td>3.3k</td><td>4.7k</td><td>Object Mapper Library</td></tr><tr><td>EntityFramework</td><td>fa0b7ec8</td><td>263</td><td>33.4k</td><td>39.3k</td><td>Object-Relational Mapper</td></tr><tr><td>Hangfire</td><td>ffc4912f</td><td>33</td><td>3.6k</td><td>6.1k</td><td>Background Job Processing Library</td></tr><tr><td>Humanizert</td><td>cclla77e</td><td>27</td><td>2.4k</td><td>4.4k</td><td>String Manipulation and Formatting</td></tr><tr><td>Lean†</td><td>f574bfd7</td><td>190</td><td>26.4k</td><td>28.3k</td><td>Algorithmic Trading Engine</td></tr><tr><td>Nancy</td><td>72elf614</td><td>70</td><td>7.5k</td><td>15.7</td><td>HTTP Service Framework</td></tr><tr><td>Newtonsoft.Json</td><td>6057d9b8</td><td>123</td><td>14.9k</td><td>16.1k</td><td> JSON Library</td></tr><tr><td>Ninject</td><td>7006297f</td><td>13</td><td>0.7k</td><td>2.1k</td><td>Code Injection Library</td></tr><tr><td>NLog</td><td>643e326a</td><td>75</td><td>8.3k</td><td>11.0k</td><td>Logging Library</td></tr><tr><td>Opserver</td><td>51b032e7</td><td>24</td><td>3.7k</td><td>4.5k</td><td>Monitoring System</td></tr><tr><td>OptiKey</td><td>7d35c718</td><td>34</td><td>6.1k</td><td>3.9k</td><td>Assistive On-Screen Keyboard</td></tr><tr><td>orleans Polly</td><td>e0d6a150 0afdbc32</td><td>300 32</td><td>30.7k 3.8k</td><td>35.6k 9.1k</td><td>Distributed Virtual Actor Model</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>Resilience & Transient Fault Handling Library</td></tr><tr><td>quartznet</td><td>b33e6f86</td><td>49</td><td>9.6k</td><td>9.8k</td><td>Scheduler</td></tr><tr><td>ravendbDev</td><td>55230922</td><td>647</td><td>78.0k</td><td>82.7k</td><td>Document Database</td></tr><tr><td>RestSharp</td><td>70de357b</td><td>20</td><td>4.0k</td><td>4.5k</td><td>REST and HTTP API Client Library</td></tr><tr><td>Rx.NET</td><td>2d146fe5</td><td>180</td><td>14.0k</td><td>21.9k</td><td>Reactive Language Extensions</td></tr><tr><td>scriptcs</td><td>f3cc8bcb</td><td>18</td><td>2.7k</td><td>4.3k</td><td>C# Text Editor</td></tr><tr><td>ServiceStack</td><td>6d59da75</td><td>231</td><td>38.0k</td><td>46.2k</td><td>Web Framework</td></tr><tr><td>ShareX</td><td>718dd711</td><td>125</td><td>22.3k</td><td>18.1k</td><td>Sharing Application</td></tr><tr><td>SignalR</td><td>fa88089e</td><td>53</td><td>6.5k</td><td>10.5k</td><td>Push Notification Framework</td></tr><tr><td>Wox</td><td>cdaf6272</td><td>13</td><td>2.0k</td><td>2.1k</td><td>Application Launcher</td></tr></table>
|
| 317 |
+
|
| 318 |
+
For this work, we released a large portion of the data, with the exception of projects with a GPL license. The data can be found at https://aka.ms/iclr18-prog-graphs-dataset. Since we are excluding some projects from the data, below we report the results, averaged over three runs, on the published dataset:
|
| 319 |
+
|
| 320 |
+
<table><tr><td></td><td>Accuracy (%)</td><td>PR AUC</td></tr><tr><td>SEENPROJTEST</td><td>84.0</td><td>0.976</td></tr><tr><td>UNSEENPROJTEST</td><td>74.1</td><td>0.934</td></tr></table>
|
md/train/BJk7Gf-CZ/BJk7Gf-CZ.md
ADDED
|
@@ -0,0 +1,688 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GLOBAL OPTIMALITY CONDITIONS FOR DEEP NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Chulhee Yun, Suvrit Sra & Ali Jadbabaie Massachusetts Institute of Technology Cambridge, MA 02139, USA {chulheey,suvrit,jadbabai}@mit.edu
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We study the error landscape of deep linear and nonlinear neural networks with the squared error loss. Minimizing the loss of a deep linear neural network is a nonconvex problem, and despite recent progress, our understanding of this loss surface is still incomplete. For deep linear networks, we present necessary and sufficient conditions for a critical point of the risk function to be a global minimum. Surprisingly, our conditions provide an efficiently checkable test for global optimality, while such tests are typically intractable in nonconvex optimization. We further extend these results to deep nonlinear neural networks and prove similar sufficient conditions for global optimality, albeit in a more limited function space setting.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Since the advent of AlexNet (Krizhevsky et al., 2012), deep neural networks have surged in popularity, and have redefined the state-of-the-art across many application areas of machine learning and artificial intelligence, such as computer vision, speech recognition, and natural language processing. However, a concrete theoretical understanding of why deep neural networks work well in practice remains elusive. From the perspective of optimization, a significant barrier is imposed by the nonconvexity of training neural networks. Moreover, it was proved by Blum & Rivest (1988) that training even a 3-node neural network to global optimality is NP-Hard in the worst case, so there is little hope that neural networks have properties that make global optimization tractable.
|
| 12 |
+
|
| 13 |
+
Despite the difficulties of optimizing weights in neural networks, the empirical successes suggest that the local minima of their loss surfaces could be close to global minima; and several papers have recently appeared in the literature attempting to provide a theoretical justification for the success of these models. For example, by relating neural networks to spherical spin-glass models from statistical physics, Choromanska et al. (2015) provided some empirical evidence that the increase of size of neural networks makes local minima close to global minima.
|
| 14 |
+
|
| 15 |
+
Another line of results (Yu & Chen, 1995; Soudry & Carmon, 2016; Xie et al., 2016; Nguyen & Hein, 2017) provides conditions under which a critical point of the empirical risk is a global minimum. Such results roughly involve proving that if full rank conditions of certain matrices (as well as some additional technical conditions) are satisfied, derivative of the risk being zero implies loss being zero. However, these results are obtained under restrictive assumptions; for example, Nguyen & Hein (2017) require the width of one of the hidden layers to be as large as the number of training examples. Soudry & Carmon (2016) and Xie et al. (2016) require the product of widths of two adjacent layers to be at least as large as the number of training examples, meaning that the number of parameters in the model must grow rapidly as we have more training data available. Another recent paper (Haeffele & Vidal, 2017) provides a sufficient condition for global optimality when the neural network is composed of subnetworks with identical architectures connected in parallel and a regularizer is designed to control the number of parallel architectures.
|
| 16 |
+
|
| 17 |
+
Towards obtaining a more precise characterization of the loss-surfaces, a valuable conceptual simplification of deep nonlinear networks is deep linear neural networks, in which all activation functions are linear and the output of the entire network is a chained product of weight matrices with the input vector. Although at first sight a deep linear model may appear overly simplistic, even its optimization is nonconvex, and only recently theoretical results on this problem have started emerging. Interestingly, already in 1989, Baldi & Hornik (1989) showed that some shallow linear neural networks have no local minima. More recently, Kawaguchi (2016) extended this result to deep linear networks and proved that any local minimum is also global while any other critical point is a saddle point. Subsequently, Lu & Kawaguchi (2017) provided a simpler proof that any local minimum is also global, with fewer assumptions than (Kawaguchi, 2016). Motivated by the success of deep residual networks (He et al., 2016a;b), Hardt & Ma (2017) investigated loss surfaces of deep linear residual networks and showed every critical point is a global minimum in a near-identity region; subsequently, Bartlett et al. (2017) extended this result to a nonlinear function space setting.
|
| 18 |
+
|
| 19 |
+
# 1.1 OUR CONTRIBUTIONS
|
| 20 |
+
|
| 21 |
+
Inspired by this recent line of work, we study deep linear and nonlinear networks, in settings either similar to or more general than existing work. We summarize our main contributions below.
|
| 22 |
+
|
| 23 |
+
• We provide both necessary and sufficient conditions for a critical point of the empirical risk to be a global minimum. Specifically, Theorem 2.1 shows that if the hidden layers are wide enough, then a critical point of the risk function is a global minimum if and only if the product of all parameter matrices is full-rank. In Theorem 2.2, we consider the case where some hidden layers have smaller width than both the input and output layers, and again provide necessary and sufficient conditions for global optimality. In comparison, Kawaguchi (2016) only proves that every critical point of the risk is either a global minimum or a saddle; it is an “existence” result without any computational implication. In contrast, we present efficiently checkable conditions for distinguishing the two different types of critical points; we can even use these conditions while running optimization to test whether the critical points we encounter are saddle points or not, if desired. It is also worth noting that such tests are intractable for general nonconvex optimization (Murty & Kabadi, 1987). Under the same assumption as (Hardt & Ma, 2017) on the data distribution, namely, a linear model with Gaussian noise, we can modify Theorem 2.1 to handle the population risk. As a corollary, we not only recover Theorem 2.2 in (Hardt & Ma, 2017), but also extend it to a strictly larger set, while removing their assumption that the true underlying linear model has a positive determinant. • Motivated by (Bartlett et al., 2017), we extend our results on deep linear networks to obtain sufficient conditions for global optimality in deep nonlinear networks, although only via a function space view; these are presented in Theorems 4.1 and 4.2.
|
| 24 |
+
|
| 25 |
+
# 2 GLOBAL OPTIMALITY CONDITIONS FOR DEEP LINEAR NEURAL NETWORKS
|
| 26 |
+
|
| 27 |
+
In this section, we describe the problem formulation and notations for deep linear neural networks, state main results (Theorems 2.1 and 2.2), and explain their implication.
|
| 28 |
+
|
| 29 |
+
# 2.1 PROBLEM FORMULATION AND NOTATION
|
| 30 |
+
|
| 31 |
+
Suppose we have $m$ input-output pairs, where the inputs are of dimension $d _ { x }$ and outputs of dimension $d _ { y }$ . Let $\boldsymbol { X } \in \mathbb { R } ^ { d _ { \boldsymbol { x } } \times m }$ be the data matrix and $\bar { Y } \in \mathbb { R } ^ { d _ { y } \times m }$ be the output matrix. Suppose we have $H$ hidden layers in the network, each having width $d _ { 1 } , \dots , d _ { H }$ . For notational simplicity we let $d _ { 0 } = d _ { x }$ and $d _ { H + 1 } = d _ { y }$ . The weights between adjacent layers can be represented as matrices $W _ { k } \in \mathbb { R } ^ { d _ { k } \times d _ { k - 1 } }$ , for $k = 1 , \ldots , H + 1$ , and the output of the network can be written as the product of weight matrices $W _ { H + 1 } , \dots , W _ { 1 }$ and data matrix $X$ : $W _ { H + 1 } W _ { H } \cdot \cdot \cdot W _ { 1 } X$ . We consider minimizing the summation of squared error loss over all data points (i.e. empirical risk),
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
\begin{array} { r } { \mathrm { m i n i m i z e } \quad L ( W ) : = \frac { 1 } { 2 } \left\| W _ { H + 1 } W _ { H } \cdot \cdot \cdot W _ { 1 } X - Y \right\| _ { \mathrm { F } } ^ { 2 } , } \end{array}
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
where $W$ is a shorthand notation for the tuple $( W _ { 1 } , \dots , W _ { H + 1 } )$ .
|
| 38 |
+
|
| 39 |
+
Assumptions. We assume that $d _ { x } \leq m$ and $d _ { y } \leq m$ , and that $X X ^ { T }$ and $Y X ^ { T }$ have full ranks. These assumptions are common when we consider supervised learning problems with deep neural networks (e.g. Kawaguchi (2016)). We also assume that the singular values of $Y X ^ { T } ( X X ^ { T } ) ^ { - 1 } X$ are all distinct, which is made for notational simplicity and can be relaxed without too much difficulty.
|
| 40 |
+
|
| 41 |
+
Notation. Given a matrix $A$ , let $\sigma _ { \mathrm { m a x } } ( A )$ and $\sigma _ { \mathrm { m i n } } ( A )$ denote the largest and smallest singular values of A, respectively. Let row $( A )$ , $\operatorname { c o l } ( A )$ , $\operatorname { n u l l } ( A )$ , $\operatorname { r a n k } ( A )$ , and $\Vert A \Vert _ { \mathrm { F } }$ be respectively the row space, column space, null space, rank, and Frobenius norm of matrix $A$ . Given a subspace $V$ of $\mathbb { R } ^ { n }$ , we denote $V ^ { \perp }$ as its orthogonal complement. Given a set $\nu$ , let $\mathcal { V } ^ { c }$ denote the complement of $\nu$ .
|
| 42 |
+
|
| 43 |
+
Let us denote $k : = \mathrm { m i n } _ { i \in \{ 0 , \dots , H + 1 \} } d _ { i }$ , and define $p \in { \mathrm { ~ a r g m i n } } _ { i \in \{ 0 , . . . , H + 1 \} } d _ { i }$ . That is, $p$ is any layer with the smallest width, and $k = d _ { p }$ is the width of that layer. Here, $p$ might not be unique, but our results hold for any layer $p$ with smallest width. Notice also that the product $W _ { H + 1 } \cdots W _ { 1 }$ can have rank at most $k$ . Let $\mathbf { \dot { \boldsymbol { Y } } } \bar { X ^ { T } } ( \bar { X } \bar { X ^ { T } } ) ^ { - 1 } \boldsymbol { X } = \boldsymbol { U } \Sigma \boldsymbol { V } ^ { T }$ be the singular value decomposition of $Y X ^ { T } ( X X ^ { T } ) ^ { - 1 } X \in \mathbb { R } ^ { d _ { y } \times d _ { x } }$ . Let $\hat { U } \in \mathbb { R } ^ { d _ { y } \times k }$ be a matrix consisting of the first $k$ columns of $U$ .
|
| 44 |
+
|
| 45 |
+
# 2.2 NECESSARY AND SUFFICIENT CONDITIONS FOR GLOBAL OPTIMALITY
|
| 46 |
+
|
| 47 |
+
We now present two main theorems for deep linear neural networks. The theorems describe two sets, one for the case $k = \operatorname* { m i n } \{ d _ { x } , d _ { y } \}$ and the other for $k < \operatorname* { m i n } \{ d _ { x } , d _ { y } \}$ , inside which every critical point of $L ( W )$ is a global minimum. Moreover, the sets have another remarkable property that every critical point outside of these sets is a saddle point. Previous works (Kawaguchi, 2016; Lu & Kawaguchi, 2017) showed that any critical point is either a global minimum or a saddle point, without providing any condition to distinguish between the two; here, we take a step further and partition the domain of $L ( W )$ into two sets clearly delineating one set which only contains global minima and the other set with only saddle points.
|
| 48 |
+
|
| 49 |
+
Theorem 2.1. If $k = \operatorname* { m i n } \{ d _ { x } , d _ { y } \}$ , define the following set
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
\mathcal { V } _ { 1 } : = \left\{ ( W _ { 1 } , \ldots , W _ { H + 1 } ) : \operatorname { r a n k } ( W _ { H + 1 } \cdot \cdot \cdot W _ { 1 } ) = k \right\} .
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
Then, every critical point of $L ( W )$ in $\mathcal { V } _ { 1 }$ is a global minimum. Moreover, every critical point of $L ( W )$ in $\mathcal { V } _ { 1 } ^ { c }$ is a saddle point.
|
| 56 |
+
|
| 57 |
+
Theorem 2.2. If $k < \operatorname* { m i n } \{ d _ { x } , d _ { y } \}$ , define the following set
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\mathcal { V } _ { 2 } : = \Big \{ ( W _ { 1 } , \ldots , W _ { H + 1 } ) : \mathrm { r a n k } \big ( W _ { H + 1 } \cdot \cdot \cdot W _ { 1 } \big ) = k , \mathrm { c o l } \big ( W _ { H + 1 } \cdot \cdot \cdot W _ { p + 1 } \big ) = \mathrm { c o l } ( \hat { U } ) \Big \} .
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
Then, every critical point of $L ( W )$ in $\nu _ { 2 }$ is a global minimum. Moreover, every critical point of $L ( W )$ in $\mathcal { V } _ { 2 } ^ { c }$ is a saddle point.
|
| 64 |
+
|
| 65 |
+
Theorems 2.1 and 2.2 provide necessary and sufficient conditions for a critical point of $L ( W )$ to be globally optimal. From an algorithmic perspective, they provide easily checkable conditions, which we can use to determine if the critical point the algorithm encountered is a global optimum or not. Given that $L ( W )$ is nonconvex, it is interesting to have such efficient tests for global optimality, which is not possible in general (Murty & Kabadi, 1987).
|
| 66 |
+
|
| 67 |
+
In Hardt & Ma (2017), the authors consider minimizing population risk of linear residual networks:
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\begin{array} { r l } { \mathrm { m i n i m i z e } } & { { } \frac { 1 } { 2 } \mathbb { E } _ { \boldsymbol { x } , \boldsymbol { y } } \left[ \| ( I + W _ { H + 1 } ) \cdot \cdot \cdot ( I + W _ { 1 } ) \boldsymbol { x } - \boldsymbol { y } \| _ { \mathrm { F } } ^ { 2 } \right] , } \end{array}
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
where $d _ { x } = d _ { 1 } = \cdot \cdot \cdot = d _ { H } = d _ { y } = d$ . They assume that $x$ is drawn from a zero-mean distribution with a fixed covariance matrix, and $y = R x + \xi$ where $\xi$ is iid standard Gaussian noise and $R$ is the true underlying matrix with $\operatorname* { d e t } ( R ) > 0$ . With these assumptions they prove that whenever $\sigma _ { \operatorname* { m a x } } ( W _ { i } ) < 1$ for all $i$ , any critical point is a global minimum (Hardt & Ma, 2017, Theorem 2.2).
|
| 74 |
+
|
| 75 |
+
Under the same assumptions on data distribution, we can slightly modify Theorem 2.1 to derive a population risk counterpart, and in fact notice that the result proved in Hardt & Ma (2017) is a corollary of this modification because having $\sigma _ { \operatorname* { m a x } } ( W _ { i } ) < 1$ for all $i$ is a sufficient condition for $( I + W _ { H + 1 } ) \cdot \cdot \cdot ( I + W _ { 1 } )$ having full rank. Moreover, notice that we can remove the assumption $\operatorname* { d e t } ( R ) > 0$ which was required by Hardt & Ma (2017). We state this special case as a corollary:
|
| 76 |
+
|
| 77 |
+
Corollary 2.3 (Theorem 2.2 of Hardt & Ma (2017)). Under assumptions on data distribution as described above, any critical point of $\begin{array} { r } { \frac { 1 } { 2 } \mathbb { E } _ { x , y } \left[ \left\| ( I + W _ { H + 1 } ) \cdot \cdot \cdot ( I + W _ { 1 } ) x - y \right\| _ { \mathrm { F } } ^ { 2 } \right] } \end{array}$ is a global minimum if $\sigma _ { \operatorname* { m a x } } ( W _ { i } ) < 1$ for all $i$ .
|
| 78 |
+
|
| 79 |
+
We also note in passing that the classical problem of matrix factorization $\begin{array} { r } { \operatorname* { m i n } _ { U , V } \left\| U V ^ { T } - Y \right\| _ { \mathrm { F } } ^ { 2 } } \end{array}$ is a special case of deep linear neural networks, so our theorems can also be directly applied.
|
| 80 |
+
|
| 81 |
+
Remarks. The previous result (Kawaguchi, 2016) assumed $d _ { y } \leq d _ { x }$ and showed that: 1) every local minimum is a global minimum, and 2) any other critical point is a saddle point. A subsequent paper by Lu & Kawaguchi (2017) proved 1) without the assumption $d _ { y } \ \leq \ d _ { x }$ , but as far as we know there is no result showing 2) in the case of $d _ { y } \ > \ d _ { x }$ . We provide the proof for this case in Lemma B.1. In fact, we propose an alternative proof technique for handling degenerate critical points, which is much simpler than the technique presented by Kawaguchi (2016).
|
| 82 |
+
|
| 83 |
+
# 3 ANALYSIS OF DEEP LINEAR NETWORKS
|
| 84 |
+
|
| 85 |
+
In this section, we provide proofs for Theorems 2.1 and 2.2.
|
| 86 |
+
|
| 87 |
+
# 3.1 SOLUTIONS OF THE RELAXED PROBLEM
|
| 88 |
+
|
| 89 |
+
We first analyze the globally optimal solution of a “relaxation” of $L ( W )$ , which turns out to be very useful while proving Theorems 2.1 and 2.2. Consider the relaxed risk function
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
L _ { 0 } ( R ) = { \frac { 1 } { 2 } } \left\| R X - Y \right\| _ { \mathrm { F } } ^ { 2 } ,
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
where $R \in \mathbb { R } ^ { d _ { y } \times d _ { x } }$ and $\operatorname { r a n k } ( R ) \leq k$ . For any $W$ , the product $W _ { H + 1 } W _ { H } \cdot \cdot \cdot W _ { 1 }$ has rank at most $k$ and setting $R$ to be this product gives the same loss values: $L _ { 0 } ( W _ { H + 1 } W _ { H } \cdot \cdot \cdot W _ { 1 } ) = L ( W )$ . Therefore, $L _ { 0 }$ is a relaxation of $L$ and
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\operatorname* { i n f } _ { R : \operatorname { r a n k } ( R ) \leq k } L _ { 0 } ( R ) \leq \operatorname* { i n f } _ { W } L ( W ) .
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
This means that if there exists $W$ such that $L ( W ) = \operatorname* { i n f } _ { R : \operatorname { r a n k } ( R ) \leq k } L _ { 0 } ( R )$ , then $W$ is a global minimum of the function $L$ . This observation is very important in proofs; we will show that inside certain sets, any critical point $W$ of $L ( W )$ must satisfy $R ^ { * } = W _ { H + 1 } \cdot \cdot \cdot W _ { 1 }$ , where $R ^ { * }$ is a global optimum of $L _ { 0 } ( R )$ . This proves that $L ( W ) = L _ { 0 } ( R ^ { * } ) = \operatorname* { i n f } _ { R : \operatorname { r a n k } ( R ) \leq k } L _ { 0 } ( R )$ , thus showing that $W$ is a global minimum of $L$ .
|
| 102 |
+
|
| 103 |
+
By restating this observation as an optimization problem, the solution of problem in (1) is bounded below by the minimum value of the following:
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
\begin{array} { l l } { \mathrm { m i n i m i z e } } & { \frac { 1 } { 2 } \left\| R X - Y \right\| _ { \mathrm { F } } ^ { 2 } } \\ { \mathrm { s u b j e c t ~ t o } } & { \mathrm { r a n k } ( R ) \leq k . } \end{array}
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
In case where $k = \operatorname* { m i n } \{ d _ { x } , d _ { y } \}$ , (2) is actually an unconstrained optimization problem. Note that $L _ { 0 }$ is a convex function of $R$ , so any critical point is a global minimum. By differentiating and setting the derivative to zero, we can easily get the unique globally optimal solution
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
R ^ { * } = Y X ^ { T } ( X X ^ { T } ) ^ { - 1 } .
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
In case of $k < \operatorname* { m i n } \{ d _ { x } , d _ { y } \}$ , the problem becomes non-convex because of the rank constraint, but its exact solution can still be computed easily. We present the solution of this case as a proposition and defer the proof to Appendix C due to its technicalities.
|
| 116 |
+
|
| 117 |
+
Proposition 3.1. Suppose $k < \operatorname* { m i n } \{ d _ { x } , d _ { y } \}$ . Then the optimal solution to (2) is
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
R ^ { * } = \hat { U } \hat { U } ^ { T } Y X ^ { T } ( X X ^ { T } ) ^ { - 1 } ,
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
which is the orthogonal projection of $Y X ^ { T } ( X X ^ { T } ) ^ { - 1 }$ onto the column space of $\hat { U }$
|
| 124 |
+
|
| 125 |
+
# 3.2 PARTIAL DERIVATIVES OF $L ( W )$
|
| 126 |
+
|
| 127 |
+
By simple matrix calculus, we can calculate the derivatives of $L ( W )$ with respect to $W _ { i }$ , for $i =$ $1 , \ldots , H + 1$ . We present the result as the following lemma, and defer the details to Appendix C.
|
| 128 |
+
|
| 129 |
+
Lemma 3.2. The partial derivative of $L ( W )$ with respect to $W _ { i }$ is given as
|
| 130 |
+
|
| 131 |
+
$$
|
| 132 |
+
\frac { \partial L } { \partial W _ { i } } = W _ { i + 1 } ^ { T } \cdot \cdot \cdot W _ { H + 1 } ^ { T } ( W _ { H + 1 } W _ { H } \cdot \cdot \cdot W _ { 1 } X - Y ) X ^ { T } W _ { 1 } ^ { T } \cdot \cdot \cdot W _ { i - 1 } ^ { T } ,
|
| 133 |
+
$$
|
| 134 |
+
|
| 135 |
+
for $i = 1 , \ldots , H + 1$
|
| 136 |
+
|
| 137 |
+
This result will be used throughout the proof of Theorems 2.1 and 2.2. For clarity in notation, note $i = 1$ $W _ { 1 } ^ { T } \cdots W _ { 0 } ^ { \breve { T } }$ is just an matrix in matrix in . $\mathbb { R } ^ { d _ { x } \times d _ { x } }$ . Similarly, when $i = H + 1$ $W _ { H + 2 } ^ { T } \cdot \cdot \cdot W _ { H + 1 } ^ { T }$ $\mathbb { R } ^ { d _ { y } \times d _ { y } ^ { * } }$
|
| 138 |
+
|
| 139 |
+
We also state an elementary lemma which proves useful in our proofs, whose proof we defer to Appendix C.
|
| 140 |
+
|
| 141 |
+
Lemma 3.3. 1. For any $A \in \mathbb { R } ^ { m \times n }$ and $\boldsymbol { B } \in \mathbb { R } ^ { n \times l }$ where $m \geq n ,$ ,
|
| 142 |
+
|
| 143 |
+
$$
|
| 144 |
+
\left\| A B \right\| _ { \mathrm { F } } ^ { 2 } \geq \sigma _ { \operatorname* { m i n } } ^ { 2 } ( A ) \left\| B \right\| _ { \mathrm { F } } ^ { 2 } .
|
| 145 |
+
$$
|
| 146 |
+
|
| 147 |
+
2. For any $A \in \mathbb { R } ^ { m \times n }$ and $\boldsymbol { B } \in \mathbb { R } ^ { n \times l }$ where $n \leq l$
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
\left\| A B \right\| _ { \mathrm { F } } ^ { 2 } \geq \sigma _ { \operatorname* { m i n } } ^ { 2 } ( B ) \left\| A \right\| _ { \mathrm { F } } ^ { 2 } .
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
# 3.3 PROOF OF THEOREM 2.1
|
| 154 |
+
|
| 155 |
+
We prove Theorem 2.1, which addresses the case $k = \operatorname* { m i n } \{ d _ { x } , d _ { y } \}$ . First, recall that the set defined in Theorem 2.1 is
|
| 156 |
+
|
| 157 |
+
$$
|
| 158 |
+
\mathcal { V } _ { 1 } : = \left\{ ( W _ { 1 } , \ldots , W _ { H + 1 } ) : \operatorname { r a n k } ( W _ { H + 1 } \cdot \cdot \cdot W _ { 1 } ) = k \right\} .
|
| 159 |
+
$$
|
| 160 |
+
|
| 161 |
+
As seen in (3), the unique minimum point of $L _ { 0 }$ has rank $k$ . So, no point $W \in \mathcal { V } _ { 1 } ^ { c }$ can be a global minimum of $L$ . Therefore, by Kawaguchi (2016, Theorem 2.3.(iii)) and Lemma B.1, any critical point in $\mathcal { V } _ { 1 } ^ { c }$ must be a saddle point.
|
| 162 |
+
|
| 163 |
+
For the rest of our proof, we need to consider two cases: $d _ { y } \leq d _ { x }$ and $d _ { x } \leq d _ { y }$ . If $d _ { x } = d _ { y }$ , both cases work. The outline of the proof is as follows: we define a new set $\mathcal { W } _ { \epsilon }$ , show that any critical point in the set $\mathcal { W } _ { \epsilon }$ is a global minimum, and then show that every $W \in \mathcal { V } _ { 1 }$ is also in $\mathcal { W } _ { \epsilon }$ for some $\epsilon > 0$ . This proves that any critical point of $L ( W )$ in $\nu _ { 1 }$ is also a critical point in $\mathcal { W } _ { \epsilon }$ for some $\epsilon > 0$ , hence a global minimum.
|
| 164 |
+
|
| 165 |
+
The following proposition proves the first step:
|
| 166 |
+
|
| 167 |
+
Proposition 3.4. Assume that $k = \operatorname* { m i n } \{ d _ { x } , d _ { y } \}$ . For any $\epsilon > 0$ , define the following set:
|
| 168 |
+
|
| 169 |
+
$$
|
| 170 |
+
\mathcal { W } _ { \epsilon } : = \left\{ \begin{array} { l l } { \{ ( W _ { 1 } , \dots , W _ { H + 1 } ) : \sigma _ { \operatorname* { m i n } } ( W _ { H + 1 } \cdot \cdot \cdot W _ { 2 } ) \geq \epsilon \} , } & { \mathrm { i f ~ } d _ { y } \leq d _ { x } , } \\ { \{ ( W _ { 1 } , \dots , W _ { H + 1 } ) : \sigma _ { \operatorname* { m i n } } ( W _ { H } \cdot \cdot \cdot W _ { 1 } ) \geq \epsilon \} , } & { \mathrm { i f ~ } d _ { x } \leq d _ { y } . } \end{array} \right.
|
| 171 |
+
$$
|
| 172 |
+
|
| 173 |
+
Then any critical point of $L ( W )$ in $\mathcal { W } _ { \epsilon }$ is a global minimum point.
|
| 174 |
+
|
| 175 |
+
Proof. (If $d _ { y } \leq d _ { x } ,$ ) Consider (5) in the case of $i = 1$ . We can observe that $W _ { 2 } ^ { T } \cdot \cdot \cdot W _ { H + 1 } ^ { T } \in \mathbb { R } ^ { d _ { 1 } \times d _ { y } }$ and that $d _ { 1 } \geq d _ { y }$ . Then by Lemma 3.3.1,
|
| 176 |
+
|
| 177 |
+
$$
|
| 178 |
+
\begin{array} { r l } { { \| \frac { \partial L } { \partial W _ { 1 } } \| _ { \mathrm { F } } ^ { 2 } \geq \sigma _ { \operatorname* { m i n } } ^ { 2 } ( W _ { H + 1 } \cdot \cdot \cdot W _ { 2 } ) \| ( W _ { H + 1 } W _ { H } \cdot \cdot \cdot W _ { 1 } X - Y ) X ^ { T } \| _ { \mathrm { F } } ^ { 2 } } } \\ & { \geq \epsilon ^ { 2 } \| ( W _ { H + 1 } W _ { H } \cdot \cdot \cdot W _ { 1 } X - Y ) X ^ { T } \| _ { \mathrm { F } } ^ { 2 } . } \end{array}
|
| 179 |
+
$$
|
| 180 |
+
|
| 181 |
+
By the above inequality, any critical point in $\mathcal { W }$ satisfies
|
| 182 |
+
|
| 183 |
+
$$
|
| 184 |
+
\forall i , \frac { \partial L } { \partial W _ { i } } = 0 \Rightarrow ( W _ { H + 1 } W _ { H } \cdot \cdot \cdot W _ { 1 } X - Y ) X ^ { T } = 0 ,
|
| 185 |
+
$$
|
| 186 |
+
|
| 187 |
+
which means that $W _ { H + 1 } W _ { H } \cdot \cdot \cdot W _ { 1 } = Y X ^ { T } ( X X ^ { T } ) ^ { - 1 }$ . The product is the unique globally optimal solution (3) of the relaxed problem in (2), so $W$ is a global minimum point of $L$ .
|
| 188 |
+
|
| 189 |
+
(If $d _ { x } \leq d _ { y } ,$ ) Consider (5) for $i = H + 1$ . We can observe that $W _ { 1 } ^ { T } \cdot \cdot \cdot W _ { H } ^ { T } \in \mathbb { R } ^ { d _ { x } \times d _ { H } }$ and that $d _ { x } \leq d _ { H }$ . Then by Lemma 3.3.2,
|
| 190 |
+
|
| 191 |
+
$$
|
| 192 |
+
\left\| \frac { \partial \cal { L } } { \partial W _ { H + 1 } } \right\| _ { \mathrm { F } } ^ { 2 } \geq \epsilon ^ { 2 } \left\| ( W _ { H + 1 } W _ { H } \cdot \cdot \cdot W _ { 1 } X - Y ) X ^ { T } \right\| _ { \mathrm { F } } ^ { 2 } ,
|
| 193 |
+
$$
|
| 194 |
+
|
| 195 |
+
and the rest of the proof flows in a similar way as the previous case.
|
| 196 |
+
|
| 197 |
+
The next proposition proves the theorem:
|
| 198 |
+
|
| 199 |
+
Proposition 3.5. For any point $W \in \nu _ { 1 }$ , there exists an $\epsilon > 0$ such that $W \in \mathcal { W } _ { \epsilon }$
|
| 200 |
+
|
| 201 |
+
Proof. Define a new set $\mathcal { W }$ , a “limit” version (as $\epsilon 0$ ) of $\mathcal { W } _ { \epsilon }$ , as
|
| 202 |
+
|
| 203 |
+
$$
|
| 204 |
+
\begin{array} { r } { \mathcal { W } : = \{ \{ ( W _ { 1 } , \ldots , W _ { H + 1 } ) : \mathrm { r a n k } ( W _ { H + 1 } \cdot \cdot \cdot W _ { 2 } ) = d _ { y } \} , \mathrm { i f } \ d _ { y } \leq d _ { x } , } \\ { \{ ( W _ { 1 } , \ldots , W _ { H + 1 } ) : \mathrm { r a n k } ( W _ { H } \cdot \cdot \cdot W _ { 1 } ) = d _ { x } \} , \mathrm { i f } \ d _ { x } \leq d _ { y } . } \end{array}
|
| 205 |
+
$$
|
| 206 |
+
|
| 207 |
+
We show that $\nu _ { 1 } \subset \mathcal { W }$ by showing that $\mathcal { W } ^ { c } \subset \mathcal { V } _ { 1 } ^ { c }$ . Consider
|
| 208 |
+
|
| 209 |
+
$$
|
| 210 |
+
\mathcal { W } ^ { c } = \left\{ \begin{array} { l l } { \{ ( W _ { 1 } , \ldots , W _ { H + 1 } ) : \operatorname { r a n k } ( W _ { H + 1 } \cdot \cdot \cdot W _ { 2 } ) < d _ { y } \} , } & { \mathrm { i f ~ } d _ { y } \leq d _ { x } , } \\ { \{ ( W _ { 1 } , \ldots , W _ { H + 1 } ) : \operatorname { r a n k } ( W _ { H } \cdot \cdot \cdot W _ { 1 } ) < d _ { x } \} , } & { \mathrm { i f ~ } d _ { x } \leq d _ { y } . } \end{array} \right.
|
| 211 |
+
$$
|
| 212 |
+
|
| 213 |
+
Then any $W \in \mathcal { W } ^ { c }$ must have $\mathrm { r a n k } ( W _ { H + 1 } \cdot \cdot \cdot W _ { 1 } ) < \mathrm { m i n } \{ d _ { x } , d _ { y } \} = k$ , so $W \in \mathcal { V } _ { 1 } ^ { c }$ . Thus, any $W \in \nu _ { 1 }$ is also in $\mathcal { W }$ , so either $\operatorname { r a n k } ( W _ { H + 1 } \cdot \cdot \cdot W _ { 2 } ) = d _ { y }$ or $\operatorname { r a n k } ( W _ { H } \cdot \cdot \cdot W _ { 1 } ) = d _ { x }$ , depending on the cases. Then, we can set
|
| 214 |
+
|
| 215 |
+
$$
|
| 216 |
+
\epsilon = \left\{ \begin{array} { l l } { \sigma _ { \operatorname* { m i n } } ( W _ { H + 1 } \cdot \cdot \cdot W _ { 2 } ) , } & { \mathrm { i f ~ } d _ { y } \leq d _ { x } , } \\ { \sigma _ { \operatorname* { m i n } } ( W _ { H } \cdot \cdot \cdot W _ { 1 } ) , } & { \mathrm { i f ~ } d _ { x } \leq d _ { y } . } \end{array} \right.
|
| 217 |
+
$$
|
| 218 |
+
|
| 219 |
+
We always have $\epsilon > 0$ because the matrices are full rank, and we can see that $W \in \mathcal { W } _ { \epsilon }$
|
| 220 |
+
|
| 221 |
+
# 3.4 PROOF OF THEOREM 2.2
|
| 222 |
+
|
| 223 |
+
In this section we prove Theorem 2.2, which tackles the case $k < \operatorname* { m i n } \{ d _ { x } , d _ { y } \}$ . Note that this assumption also implies that $1 \leq p \leq H$ .
|
| 224 |
+
|
| 225 |
+
As for the proof of Theorem 2.1, define
|
| 226 |
+
|
| 227 |
+
$$
|
| 228 |
+
\mathcal { V } _ { 1 } : = \left\{ ( W _ { 1 } , \ldots , W _ { H + 1 } ) : \operatorname { r a n k } ( W _ { H + 1 } \cdot \cdot \cdot W _ { 1 } ) = k \right\} .
|
| 229 |
+
$$
|
| 230 |
+
|
| 231 |
+
The globally optimal point of the relaxed problem (2) has rank $k$ , as seen in (4). Thus, any point outside of $\nu _ { 1 }$ cannot be a global minimum. Then, by Kawaguchi (2016, Theorem 2.3.(iii)) and Lemma B.1, it follows that any critical point in $\mathcal { V } _ { 1 } ^ { c }$ must be a saddle point. The remaining proof considers points in $\mathcal { V } _ { 1 }$ .
|
| 232 |
+
|
| 233 |
+
For this section, let us introduce some additional notations to ease presentation. Define
|
| 234 |
+
|
| 235 |
+
$$
|
| 236 |
+
\begin{array} { r l } & { E : = ( W _ { H + 1 } \cdot \cdot \cdot W _ { 1 } X - Y ) X ^ { T } \in \mathbb { R } ^ { d _ { y } \times d _ { x } } , } \\ & { A _ { i } : = W _ { i + 1 } ^ { T } \cdot \cdot \cdot W _ { H + 1 } ^ { T } \in \mathbb { R } ^ { d _ { i } \times d _ { y } } , \ B _ { i } : = W _ { 1 } ^ { T } \cdot \cdot \cdot W _ { i - 1 } ^ { T } \in \mathbb { R } ^ { d _ { x } \times d _ { i - 1 } } , \ i = 1 , \dots , H + 1 , } \end{array}
|
| 237 |
+
$$
|
| 238 |
+
|
| 239 |
+
so that $\begin{array} { r } { \frac { \partial L } { \partial W _ { i } } = A _ { i } E B _ { i } } \end{array}$ . Notice that $A _ { H + 1 }$ and $B _ { 1 }$ are identity matrices.
|
| 240 |
+
|
| 241 |
+
Now consider any tuple $W \in \mathcal { V } _ { 1 }$ . Since the full product $W _ { H + 1 } \cdots W _ { 1 }$ has rank $k$ , any partial products $A _ { i }$ and $B _ { i }$ must have $\operatorname { r a n k } ( A _ { i } ) \geq k$ and $\operatorname { r a n k } ( B _ { i } ) \geq k$ , for all $i$ . Then, consider $A _ { p } \in$ $\mathbb { R } ^ { k \times d _ { y } }$ and $B _ { p + 1 } \in \mathbb { R } ^ { d _ { x } \times k }$ . Since $\operatorname { r a n k } ( A _ { p } ) \leq k$ and $\operatorname { r a n k } ( B _ { p + 1 } ) \leq k$ , we can see that ra $\operatorname { l k } ( A _ { p } ) =$ $\mathrm { r a n k } ( B _ { p + 1 } ) \dot { = } k$ . Also, notice that $A _ { i } = W _ { i + 1 } A _ { i + 1 }$ and $B _ { i + 1 } = B _ { i } W _ { i }$ , so that
|
| 242 |
+
|
| 243 |
+
$$
|
| 244 |
+
\operatorname { r a n k } ( A _ { 1 } ) \leq \operatorname { r a n k } ( A _ { 2 } ) \leq \cdots \leq \operatorname { r a n k } ( A _ { p } ) { \mathrm { ~ a n d ~ } } \operatorname { r a n k } ( B _ { H + 1 } ) \leq \operatorname { r a n k } ( B _ { H } ) \leq \cdots \leq \operatorname { r a n k } ( B _ { p + 1 } ) .
|
| 245 |
+
$$
|
| 246 |
+
|
| 247 |
+
However, we have $k \leq \mathrm { r a n k } ( A _ { 1 } )$ and $k \leq \mathrm { r a n k } ( B _ { H + 1 } )$ , so the ranks are all identically $k$ . Also,
|
| 248 |
+
|
| 249 |
+
$$
|
| 250 |
+
\operatorname { r o w } ( A _ { 1 } ) \subset \operatorname { r o w } ( A _ { 2 } ) \subset \cdots \subset \operatorname { r o w } ( A _ { p } ) { \mathrm { ~ a n d ~ } } \operatorname { c o l } ( B _ { H + 1 } ) \subset \operatorname { c o l } ( B _ { H } ) \subset \cdots \subset \operatorname { c o l } ( B _ { p + 1 } ) ,
|
| 251 |
+
$$
|
| 252 |
+
|
| 253 |
+
ut it was just shown that the these spaces have the same dimensions, which equals $k$ , meaning
|
| 254 |
+
|
| 255 |
+
$$
|
| 256 |
+
\operatorname { r o w } ( A _ { 1 } ) = \operatorname { r o w } ( A _ { 2 } ) = \cdots = \operatorname { r o w } ( A _ { p } ) { \mathrm { ~ a n d ~ } } \operatorname { c o l } ( B _ { H + 1 } ) = \operatorname { c o l } ( B _ { H } ) = \cdots = \operatorname { c o l } ( B _ { p + 1 } ) .
|
| 257 |
+
$$
|
| 258 |
+
|
| 259 |
+
Using this observation, we can now state a proposition showing necessary and sufficient conditions for a tuple $W \in \mathcal { V } _ { 1 }$ to be a critical point of $L ( W )$ .
|
| 260 |
+
|
| 261 |
+
Proposition 3.6. A tuple $W \in \nu _ { 1 }$ is a critical point of $L$ if and only if $A _ { p } E = 0$ and $E B _ { p + 1 } = 0$ .
|
| 262 |
+
|
| 263 |
+
Proof. (If part) $A _ { p } E = 0$ implies that $\operatorname { c o l } ( E ) \subset \operatorname { r o w } ( A _ { p } ) ^ { \perp } = \cdot \cdot \cdot = \operatorname { r o w } ( A _ { 1 } ) ^ { \perp }$ , so $\begin{array} { r } { \frac { \partial L } { \partial W _ { i } } \ = } \end{array}$ $A _ { i } E B _ { i } = 0 \cdot B _ { i } = 0 .$ , for $i = 1 , \ldots , p$ . Similarly, $E B _ { p + 1 } = 0$ implies $\operatorname { r o w } ( E ) \subset \operatorname { c o l } ( B _ { p + 1 } ) ^ { \perp } =$ $\cdot \cdot \cdot = \mathrm { c o l } ( B _ { H + 1 } ) ^ { \perp }$ , so $\begin{array} { r } { \frac { \partial L } { \partial W _ { i } } = A _ { i } E B _ { i } = A _ { i } \cdot 0 = 0 } \end{array}$ for $i = p + 1 , \ldots , H + 1$ .
|
| 264 |
+
|
| 265 |
+
(Only if part) We have $\begin{array} { r } { \frac { \partial L } { \partial W _ { i } } = A _ { i } E B _ { i } = 0 } \end{array}$ for all $i$ . This means that
|
| 266 |
+
|
| 267 |
+
$$
|
| 268 |
+
\begin{array} { r l } & { \quad \mathrm { c o l } ( E B _ { i } ) \subset \mathrm { r o w } ( A _ { i } ) ^ { \perp } = \mathrm { r o w } ( A _ { p } ) ^ { \perp } \mathrm { f o r } i = 1 , \ldots , p } \\ & { \quad \mathrm { r o w } ( A _ { i } E ) \subset \mathrm { c o l } ( B _ { i } ) ^ { \perp } = \mathrm { c o l } ( B _ { p + 1 } ) ^ { \perp } \mathrm { f o r } i = p + 1 , \ldots , H + 1 . } \end{array}
|
| 269 |
+
$$
|
| 270 |
+
|
| 271 |
+
Now recall that $B _ { 1 }$ and $A _ { H + 1 }$ are identity matrices, so $\mathrm { c o l } ( E ) \subset \mathrm { r o w } ( A _ { p } ) ^ { \perp }$ and $\operatorname { r o w } ( E ) ~ \subset$ $\mathrm { c o l } ( B _ { p + 1 } ) ^ { \perp }$ , which proves $A _ { p } E = 0$ and $E B _ { p + 1 } = 0$ .
|
| 272 |
+
|
| 273 |
+
Now we present a proposition that specifies the necessary and sufficient condition in which a critical point of $L ( W )$ in $\nu _ { 1 }$ is a global minimum. Recall that when we take the SVD ${ \cal Y } X ^ { T } ( X X ^ { T } ) ^ { - 1 } X =$ $U { \boldsymbol { \Sigma } } V ^ { T }$ , $\hat { U } \in \mathbb { R } ^ { d _ { y } \times k }$ is defined to be a matrix consisting of the first $k$ columns of $U$ .
|
| 274 |
+
|
| 275 |
+
Proposition 3.7. A critical point $W \in \mathsf { V } _ { 1 }$ of $L ( W )$ is a global minimum point if and only $i f$ $\operatorname { c o l } ( W _ { H + 1 } \cdot \cdot \cdot W _ { p + 1 } ) = \operatorname { r o w } ( A _ { p } ) = \operatorname { c o l } ( { \hat { U } } )$ .
|
| 276 |
+
|
| 277 |
+
Proof. Since $W$ is a critical point, by Proposition 3.6 we have $A _ { p } E = 0$ . Also note from the definitions of $A _ { i }$ ’s and $B _ { i }$ ’s that $W _ { H + 1 } \cdot \cdot \cdot W _ { 1 } = A _ { p } ^ { T } B _ { p + 1 } ^ { T }$ , so
|
| 278 |
+
|
| 279 |
+
$$
|
| 280 |
+
A _ { p } E = A _ { p } ( A _ { p } ^ { T } B _ { p + 1 } ^ { T } X - Y ) X ^ { T } = A _ { p } A _ { p } ^ { T } B _ { p + 1 } ^ { T } X X ^ { T } - A _ { p } Y X ^ { T } = 0 .
|
| 281 |
+
$$
|
| 282 |
+
|
| 283 |
+
Because $\operatorname { r a n k } ( A _ { p } ) = k$ , and $A _ { p } A _ { p } ^ { T } \in \mathbb { R } ^ { k \times k }$ is invertible, so $B _ { p + 1 }$ is determined uniquely as
|
| 284 |
+
|
| 285 |
+
$$
|
| 286 |
+
B _ { p + 1 } ^ { T } = ( A _ { p } A _ { p } ^ { T } ) ^ { - 1 } A _ { p } Y X ^ { T } ( X X ^ { T } ) ^ { - 1 } ,
|
| 287 |
+
$$
|
| 288 |
+
|
| 289 |
+
thus
|
| 290 |
+
|
| 291 |
+
$$
|
| 292 |
+
W _ { H + 1 } \cdot \cdot \cdot W _ { 1 } = A _ { p } ^ { T } B _ { p + 1 } ^ { T } = A _ { p } ^ { T } ( A _ { p } A _ { p } ^ { T } ) ^ { - 1 } A _ { p } Y X ^ { T } ( X X ^ { T } ) ^ { - 1 } .
|
| 293 |
+
$$
|
| 294 |
+
|
| 295 |
+
Comparing this with (4), $W$ is a global minimum solution if and only if
|
| 296 |
+
|
| 297 |
+
$$
|
| 298 |
+
\hat { U } \hat { U } ^ { T } Y X ^ { T } ( X X ^ { T } ) ^ { - 1 } = W _ { H + 1 } \cdot \cdot \cdot W _ { 1 } = A _ { p } ^ { T } ( A _ { p } A _ { p } ^ { T } ) ^ { - 1 } A _ { p } Y X ^ { T } ( X X ^ { T } ) ^ { - 1 } .
|
| 299 |
+
$$
|
| 300 |
+
|
| 301 |
+
This equation holds if and only if $A _ { p } ^ { T } ( A _ { p } A _ { p } ^ { T } ) ^ { - 1 } A _ { p } \ = \ \hat { U } \hat { U } ^ { T }$ , meaning that they are projecting $Y X ^ { T } ( X X ^ { T } ) ^ { - 1 }$ onto the same subspace. The projection matrix $A _ { p } ^ { T } ( A _ { p } A _ { p } ^ { T } ) ^ { - 1 } A _ { p }$ is onto $\operatorname { r o w } ( A _ { p } )$ , while $\hat { U } \hat { U } ^ { T }$ is onto $\mathrm { c o l } ( { \hat { U } } )$ . From this, we conclude that $W$ is a global minimum point if and only if $\operatorname { r o w } ( A _ { p } ) = \operatorname { c o l } ( \hat { U } )$ . □
|
| 302 |
+
|
| 303 |
+
From Proposition 3.7, we can define the set $\nu _ { 2 }$ that appeared in Theorem 2.2, and conclude that every critical point of $L ( W )$ in $\nu _ { 2 }$ is a global minimum, and any other critical points are saddle points.
|
| 304 |
+
|
| 305 |
+
# 4 EXTENSION TO DEEP NONLINEAR NEURAL NETWORKS
|
| 306 |
+
|
| 307 |
+
In this section, we present some sufficient conditions for global optimality for deep nonlinear neural networks via a function space view. Given a smooth nonlinear function $h ^ { * }$ that maps input to output, Bartlett et al. (2017) described a method to decompose it into a number of smooth nonlinear functions $h ^ { * } = h _ { H + 1 } \circ \cdot \cdot \cdot \circ h _ { 1 }$ where $h _ { i }$ ’s are close to identity. Using Frechet derivatives of the ´ population risk with respect to each function $h _ { i }$ , they showed that when all $h _ { i }$ ’s are close to identity, any critical point of the population risk is a global minimum. One can see that these results are direct generalization of Theorems 2.1 and 2.2 of Hardt & Ma (2017) to nonlinear networks and utilize the classical “small gain” arguments often used in nonlinear analysis and control (Khalil, 1996; Zames, 1966). Motivated by this result, we extended Theorem 2.1 to deep nonlinear neural networks and obtained sufficient conditions for global optimality in function space.
|
| 308 |
+
|
| 309 |
+
# 4.1 PROBLEM FORMULATION AND NOTATION
|
| 310 |
+
|
| 311 |
+
Suppose the data $X \in \mathbb { R } ^ { d _ { x } }$ and its corresponding label $Y \in \mathbb { R } ^ { d _ { y } }$ are drawn from some distribution. Notice that in this section, $X$ and $Y$ are random vectors instead of matrices. We want to predict $Y$ given $X$ with a deep nonlinear neural network that has $H$ hidden layers. We express each layer of the network as functions $h _ { i } : \mathbb { R } ^ { d _ { i - 1 } } \mathbb { R } ^ { d _ { i } }$ , so the entire network can be expressed as a composition of functions: $h _ { H + 1 } \circ h _ { H } \circ \cdot \cdot \cdot \circ h _ { 1 }$ . Our goal is to obtain functions $h _ { 1 } , \ldots , h _ { H + 1 }$ that minimize the population risk functional:
|
| 312 |
+
|
| 313 |
+
$$
|
| 314 |
+
L ( h ) = L ( h _ { 1 } , \dots , h _ { H + 1 } ) : = { \frac { 1 } { 2 } } \mathbb { E } \left[ \left\| h _ { H + 1 } \circ \cdot \cdot \cdot \circ h _ { 1 } ( X ) - Y \right\| _ { 2 } ^ { 2 } \right] ,
|
| 315 |
+
$$
|
| 316 |
+
|
| 317 |
+
where $h$ is a shorthand notation for $\left( h _ { 1 } , \ldots , h _ { H + 1 } \right)$ . It is well-known that the minimizer of squared error risk is the conditional expectation of $Y$ given $X$ , which we will denote $h ^ { * } ( x ) = \mathbb { E } [ Y \mid X = x ]$ . With this, we can separate the risk functional into two terms
|
| 318 |
+
|
| 319 |
+
$$
|
| 320 |
+
L ( h ) = \frac { 1 } { 2 } \mathbb { E } \left[ \| h _ { H + 1 } \circ \cdot \cdot \cdot \circ h _ { 1 } ( X ) - h ^ { * } ( X ) \| _ { 2 } ^ { 2 } \right] + C ,
|
| 321 |
+
$$
|
| 322 |
+
|
| 323 |
+
where the constant $C$ denotes the variance that is independent of $h _ { 1 } , \ldots , h _ { H + 1 }$ . Note that if $h _ { H + 1 } \circ$ $\cdots \circ h _ { 1 } = h ^ { * }$ almost surely, the first term in $L ( h )$ vanishes and the optimal value $L ^ { * }$ of $L ( h )$ is $C$ .
|
| 324 |
+
|
| 325 |
+
Assumptions. Define the function spaces as the following:
|
| 326 |
+
|
| 327 |
+
$$
|
| 328 |
+
\begin{array} { r l } & { \mathcal { F } : = \{ h : \mathbb { R } ^ { d _ { x } } \mathbb { R } ^ { d _ { y } } \ | \ h \mathrm { ~ i s ~ d i f f e r e n t i a b l e } , h ( 0 ) = 0 , \ \mathrm { a n d ~ } \underset { x } { \operatorname* { s u p } } \ \frac { \| h ( x ) \| _ { 2 } } { \| x \| _ { 2 } } < \infty \} , } \\ & { \mathcal { F } _ { i } : = \{ h : \mathbb { R } ^ { d _ { i } - 1 } \mathbb { R } ^ { d _ { i } } \ | \ h \mathrm { ~ i s ~ d i f f e r e n t i a b l e } , h ( 0 ) = 0 , \ \mathrm { a n d ~ } \underset { x } { \operatorname* { s u p } } \ \frac { \| h ( x ) \| _ { 2 } } { \| x \| _ { 2 } } < \infty \} , } \end{array}
|
| 329 |
+
$$
|
| 330 |
+
|
| 331 |
+
where ${ \mathcal { F } } _ { i }$ are defined for all $i = 1 , \ldots , H + 1$ . Assume that $h ^ { \ast } \in \mathcal { F }$ , and that we are optimizing $L ( h )$ with $h _ { 1 } \in \mathcal { F } _ { 1 } , \ldots , h _ { H + 1 } \in \mathcal { F } _ { H + 1 }$ . In other words, the functions in $\mathcal { F } , \mathcal { F } _ { 1 } , \ldots , \mathcal { F } _ { H + 1 }$ are differentiable and show sublinear growth starting from 0. Notice that $h _ { H + 1 } \circ \cdot \cdot \cdot \circ h _ { 1 } \in \mathcal { F }$ , because a composition of differentiable functions is also differentiable, and a composition of sublinear functions is also sublinear. We also assume that $d _ { i } \geq \operatorname* { m i n } \{ d _ { x } , d _ { y } \}$ for all $i = 1 , \ldots , H + 1$ , which is identical to the assumption $k = \operatorname* { m i n } \{ d _ { x } , d _ { y } \}$ in Theorem 2.1.
|
| 332 |
+
|
| 333 |
+
Notation. To simplify multiple composition of functions, we denote $h _ { i : j } = h _ { i } \circ h _ { i - 1 } \circ \cdot \cdot \cdot \circ h _ { j + 1 } \circ$ $h _ { j }$ . As in the matrix case, $h _ { 0 : 1 }$ and $h _ { H + 1 : H + 2 }$ mean identity maps in $\mathbb { R } ^ { d _ { x } }$ and $\mathbb { R } ^ { d _ { y } }$ , respectively. Given a function $f$ , let $J [ f ] ( x )$ be the Jacobian matrix of function $f$ evaluated at $x$ . Let $D _ { h _ { i } } [ L ( h ) ]$ be the Frechet derivative of ´ $L ( h )$ with respect to $h _ { i }$ evaluated at $h$ . The Frechet derivative ´ $D _ { h _ { i } } [ L ( h ) ]$ is a linear functional that maps a function (direction) $\eta \in \mathcal { F } _ { i }$ to a real number (directional derivative).
|
| 334 |
+
|
| 335 |
+
# 4.2 SUFFICIENT CONDITIONS FOR GLOBAL OPTIMALITY
|
| 336 |
+
|
| 337 |
+
Here, we present two theorems which give sufficient conditions for a critical point $( D _ { h _ { i } } [ L ( h ) ] = 0$ for all $i$ ) in the function space to be a global optimum. The proofs are deferred to Appendix A.
|
| 338 |
+
|
| 339 |
+
Theorem 4.1. Consider the case $d _ { x } \geq d _ { y }$ . If there exists $\epsilon > 0$ such that
|
| 340 |
+
|
| 341 |
+
1. $J [ h _ { H + 1 : 2 } ] ( z ) \in \mathbb { R } ^ { d _ { y } \times d _ { 1 } }$ has $\sigma _ { \operatorname* { m i n } } ( J [ h _ { H + 1 : 2 } ] ( z ) ) \geq \epsilon f o r \ : a l l \ : z \in \mathbb { R } ^ { d _ { 1 } } ,$
|
| 342 |
+
2. $h _ { H + 1 : 2 } ( z )$ is twice-differentiable,
|
| 343 |
+
|
| 344 |
+
then any critical point of $L ( h )$ , in terms of $D _ { h _ { 1 } } [ L ( h ) ] , \ldots , D _ { h _ { H + 1 } } [ L ( h ) ] ,$ , is a global minimum.
|
| 345 |
+
|
| 346 |
+
Theorem 4.2. Consider the case $d _ { x } \leq d _ { y }$ . Assume that there exists some $j \in \{ 1 , \dots , H + 1 \}$ such that $d _ { x } = d _ { j - 1 }$ and $d _ { y } \leq d _ { j }$ . If there exist $\epsilon _ { 1 } , \epsilon _ { 2 } > 0$ such that
|
| 347 |
+
|
| 348 |
+
1. $h _ { j - 1 : 1 } : \mathbb { R } ^ { d _ { x } } \mathbb { R } ^ { d _ { j - 1 } } = \mathbb { R } ^ { d _ { x } }$ is invertible,
|
| 349 |
+
|
| 350 |
+
2. $h _ { j - 1 : 1 }$ satisfies $\left\| h _ { j - 1 : 1 } ( u ) \right\| _ { 2 } \geq \epsilon _ { 1 } \left\| u \right\| _ { 2 }$ for all $u \in \mathbb { R } ^ { d _ { x } }$ ,
|
| 351 |
+
|
| 352 |
+
3. $J [ h _ { H + 1 : j + 1 } ] ( z ) \in \mathbb { R } ^ { d _ { y } \times d _ { j } }$ has $\sigma _ { \mathrm { m i n } } ( J [ h _ { H + 1 : j + 1 } ] ( z ) ) \geq \epsilon _ { 2 }$ for all $z \in \mathbb { R } ^ { d _ { j } }$
|
| 353 |
+
|
| 354 |
+
4. $h _ { H + 1 : j + 1 } ( z )$ is twice-differentiable,
|
| 355 |
+
|
| 356 |
+
then any critical point of $L ( h )$ , in terms of $D _ { h _ { 1 } } [ L ( h ) ] , \ldots , D _ { h _ { H + 1 } } [ L ( h ) ] ,$ , is a global minimum.
|
| 357 |
+
|
| 358 |
+
Note that these theorems give sufficient conditions, whereas Theorems 2.1 and 2.2 provide necessary and sufficient conditions. So, if the sets we are describing in Theorems 4.1 and $4 . 2 \ \mathrm { d o }$ not contain any critical point, the claims would be vacuous. We ensure that there are critical points in the sets, by presenting the following proposition, whose proof is also deferred to Appendix A.
|
| 359 |
+
|
| 360 |
+
Proposition 4.3. For each of Theorems 4.1 and 4.2, there exists at least one global minimum solution of $L ( h )$ satisfying the conditions of the theorem.
|
| 361 |
+
|
| 362 |
+
Discussion and Future work. Theorems 4.1 and 4.2 state that in certain sets of $\left( h _ { 1 } , \ldots , h _ { H + 1 } \right)$ , any critical point in function space a global minimum. However, this does not imply that any critical point for a fixed sigmoid or arctan network is a global minimum. As noted in (Bartlett et al., 2017), there is a downhill direction in function space at any suboptimal point, but this direction might be orthogonal to the function space represented by a fixed network, and may hence result in local minima in the parameter space of the fixed architecture.
|
| 363 |
+
|
| 364 |
+
Understanding the connection between the function space and parameter space of commonly used architectures is an open direction for future research, and we believe that these results can be good initial steps from the theoretical point of view. For example, we can see that one of the sufficient conditions for global optimality is the Jacobian matrix being full rank. Given that a nonlinear function can locally be linearly approximated using Jacobians, this connection is already interesting. An extension of the function space viewpoint to cover different architectures or design new architectures (that have “better” properties when viewed via the function space view) should also be possible and worth studying.
|
| 365 |
+
|
| 366 |
+
# ACKNOWLEDGMENTS
|
| 367 |
+
|
| 368 |
+
This research project was supported in parts by DARPA DSO’s Fundamental Limits of Learning program.
|
| 369 |
+
|
| 370 |
+
# REFERENCES
|
| 371 |
+
|
| 372 |
+
Pierre Baldi and Kurt Hornik. Neural networks and principal component analysis: Learning from examples without local minima. Neural networks, 2(1):53–58, 1989.
|
| 373 |
+
|
| 374 |
+
Peter Bartlett, Steve Evans, and Phil Long. Deep residual networks: Representation and optimization properties, 2017. Talk by Peter Bartlett at the Computational Challenges in Machine Learning Workshop at Simons Institute for the Theory of Computing, Berkeley, CA, USA.
|
| 375 |
+
|
| 376 |
+
Avrim Blum and Ronald L Rivest. Training a 3-node neural network is NP-complete. In Proceedings of the 1st International Conference on Neural Information Processing Systems, pp. 494–501. MIT Press, 1988.
|
| 377 |
+
|
| 378 |
+
Anna Choromanska, Mikael Henaff, Michael Mathieu, Gerard Ben Arous, and Yann LeCun. The ´ loss surfaces of multilayer networks. In Artificial Intelligence and Statistics, pp. 192–204, 2015.
|
| 379 |
+
|
| 380 |
+
Benjamin D Haeffele and Rene Vidal. Global optimality in neural network training. In ´ Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7331–7339, 2017.
|
| 381 |
+
|
| 382 |
+
Moritz Hardt and Tengyu Ma. Identity matters in deep learning. In International Conference on Learning Representations, 2017.
|
| 383 |
+
|
| 384 |
+
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, 2016a.
|
| 385 |
+
|
| 386 |
+
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.
|
| 387 |
+
|
| 388 |
+
Kenji Kawaguchi. Deep learning without poor local minima. In Advances in Neural Information Processing Systems, pp. 586–594, 2016.
|
| 389 |
+
|
| 390 |
+
Hassan K Khalil. Noninear Systems. Prentice-Hall, New Jersey, 1996.
|
| 391 |
+
|
| 392 |
+
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.
|
| 393 |
+
|
| 394 |
+
Haihao Lu and Kenji Kawaguchi. Depth creates no bad local minima. arXiv preprint arXiv:1702.08580, 2017.
|
| 395 |
+
|
| 396 |
+
Katta G Murty and Santosh N Kabadi. Some NP-complete problems in quadratic and nonlinear programming. Mathematical programming, 39(2):117–129, 1987.
|
| 397 |
+
|
| 398 |
+
Quynh Nguyen and Matthias Hein. The loss surface of deep and wide neural networks. In Proceedings of the 34th International Conference on Machine Learning, volume 70, pp. 2603–2612, 2017.
|
| 399 |
+
|
| 400 |
+
Daniel Soudry and Yair Carmon. No bad local minima: Data independent training error guarantees for multilayer neural networks. arXiv preprint arXiv:1605.08361, 2016.
|
| 401 |
+
|
| 402 |
+
Bo Xie, Yingyu Liang, and Le Song. Diverse neural network learns true target functions. arXiv preprint arXiv:1611.03131, 2016.
|
| 403 |
+
|
| 404 |
+
Xiao-Hu Yu and Guo-An Chen. On the local minima free condition of backpropagation learning. IEEE Transactions on Neural Networks, 6(5):1300–1303, 1995.
|
| 405 |
+
|
| 406 |
+
George Zames. On the input-output stability of time-varying nonlinear feedback systems part one: Conditions derived using concepts of loop gain, conicity, and positivity. IEEE transactions on automatic control, 11(2):228–238, 1966.
|
| 407 |
+
|
| 408 |
+
# A ANALYSIS OF DEEP NONLINEAR NETWORKS
|
| 409 |
+
|
| 410 |
+
# A.1 NOTATION
|
| 411 |
+
|
| 412 |
+
In this section, we introduce additional notation that is used in the proofs. To emphasize that the Frechet derivative ´ $D _ { h _ { i } } [ L ( h ) ]$ is a linear functional that outputs a real number, we will write $D _ { h _ { i } } [ L ( h ) ] ( \eta )$ in an inner-product form $\langle D _ { h _ { i } } [ L ( h ) ] , \eta \rangle$ . This notation also helps avoiding confusion coming from multiple parentheses and square brackets.
|
| 413 |
+
|
| 414 |
+
There are many different kinds of norms that appear in the proofs. Given a finite-dimensional real vector $v$ , $\lVert \boldsymbol { v } \rVert _ { 2 }$ denotes its $\ell _ { 2 }$ norm. For a matrix $A$ , its operator norm is defined as $\| A \| _ { \mathrm { o p } } =$ $\operatorname* { s u p } _ { x } { \frac { \| A x \| _ { 2 } } { \| x \| _ { 2 } } }$ . Let $h \in { \mathcal { F } }$ . Then define a “generalized” induced norm for nonlinear functions with sublinear growth: khknl = supx $\begin{array} { r } { \| h \| _ { \mathrm { n l } } = \operatorname* { s u p } _ { x } \frac { \| h ( x ) \| _ { 2 } } { \| x \| _ { 2 } } } \end{array}$ kh(x)k2kxk , where the subscript nl is used to emphasize that this norm is for nonlinear functions. The norm $\lVert \cdot \rVert _ { \mathrm { n l } }$ is defined in the same way for ${ \mathcal { F } } _ { i }$ ’s. Now, given a linear functional $G$ that maps a function $f \in \mathcal { F } _ { i }$ to a real number $\langle G , f \rangle$ , define the operator norm kGkop = supf∈Fi kfknl .
|
| 415 |
+
|
| 416 |
+
# A.2 FRECHET ´ DERIVATIVES
|
| 417 |
+
|
| 418 |
+
By definition of Frechet derivatives, we have ´
|
| 419 |
+
|
| 420 |
+
$$
|
| 421 |
+
\langle D _ { h _ { i } } [ L ( h ) ] , \eta \rangle = \operatorname* { l i m } _ { \epsilon \to 0 } \frac { L ( h _ { 1 } , \dots , h _ { i } + \epsilon \eta , \dots , h _ { H + 1 } ) - L ( h ) } { \epsilon } ,
|
| 422 |
+
$$
|
| 423 |
+
|
| 424 |
+
where $\eta \in \mathcal { F } _ { i }$ is the direction of perturbation and $\langle D _ { h _ { i } } [ L ( h ) ] , \eta \rangle$ is the directional derivative along that direction $\eta$ . From the definition of $L ( h )$ ,
|
| 425 |
+
|
| 426 |
+
$$
|
| 427 |
+
\begin{array} { l } { { \displaystyle { \cal L } ( h _ { 1 } , \ldots , h _ { i } + \epsilon \eta , \ldots , h _ { H + 1 } ) } } \\ { { \displaystyle = \frac { 1 } { 2 } \mathbb { E } [ \| h _ { H + 1 : i + 1 } \circ ( h _ { i } + \epsilon \eta ) \circ h _ { i - 1 : 1 } ( X ) - h ^ { * } ( X ) \| _ { 2 } ^ { 2 } ] + C } } \\ { { \displaystyle = \frac { 1 } { 2 } \mathbb { E } [ \| h _ { H + 1 : i + 1 } ( h _ { i : 1 } ( X ) + \epsilon \eta ( h _ { i - 1 : 1 } ( X ) ) ) - h ^ { * } ( X ) \| _ { 2 } ^ { 2 } ] + C } } \\ { { \displaystyle = \frac { 1 } { 2 } \mathbb { E } [ \| h _ { H + 1 : 1 } ( X ) + \epsilon J [ h _ { H + 1 : i + 1 } ] ( h _ { i : 1 } ( X ) ) \eta ( h _ { i - 1 : 1 } ( X ) ) + O ( \epsilon ^ { 2 } ) - h ^ { * } ( X ) \| _ { 2 } ^ { 2 } ] + C } } \\ { { \displaystyle = { \cal L } ( h ) + \epsilon \mathbb { E } [ ( h _ { H + 1 : 1 } ( X ) - h ^ { * } ( X ) ) ^ { T } J [ h _ { H + 1 : i + 1 } ] ( h _ { i : 1 } ( X ) ) \eta ( h _ { i - 1 : 1 } ( X ) ) ] + O ( \epsilon ^ { 2 } ) } } \end{array}
|
| 428 |
+
$$
|
| 429 |
+
|
| 430 |
+
Therefore,
|
| 431 |
+
|
| 432 |
+
$$
|
| 433 |
+
\langle D _ { h _ { i } } [ L ( h ) ] , \eta \rangle = \mathbb { E } \left[ ( h _ { H + 1 : 1 } ( X ) - h ^ { * } ( X ) ) ^ { T } J [ h _ { H + 1 : i + 1 } ] ( h _ { i : 1 } ( X ) ) \eta ( h _ { i - 1 : 1 } ( X ) ) \right] .
|
| 434 |
+
$$
|
| 435 |
+
|
| 436 |
+
This equation (6) will be used in the proof of Theorems 4.1 and 4.2.
|
| 437 |
+
|
| 438 |
+
# A.3 PROOF OF THEOREM 4.1
|
| 439 |
+
|
| 440 |
+
From (6), consider $D _ { h _ { 1 } } [ L ( h ) ]$ . For any $\eta \in \mathcal { F } _ { 1 }$
|
| 441 |
+
|
| 442 |
+
$$
|
| 443 |
+
\langle D _ { h _ { 1 } } [ L ( h ) ] , \eta \rangle = \mathbb { E } \left[ ( h _ { H + 1 : 1 } ( X ) - h ^ { * } ( X ) ) ^ { T } J [ h _ { H + 1 : 2 } ] ( h _ { 1 } ( X ) ) \eta ( X ) \right] .
|
| 444 |
+
$$
|
| 445 |
+
|
| 446 |
+
Let $A ( X ) = J [ h _ { H + 1 : 2 } ] ( h _ { 1 } ( X ) )$ . Since $A ( X )$ has full row rank by assumption, $A ( X ) A ( X ) ^ { T }$ is invertible. Then define a particular direction
|
| 447 |
+
|
| 448 |
+
$$
|
| 449 |
+
\tilde { \eta } ( X ) = A ( X ) ^ { T } ( A ( X ) A ( X ) ^ { T } ) ^ { - 1 } ( h _ { H + 1 : 1 } ( X ) - h ^ { * } ( X ) ) ,
|
| 450 |
+
$$
|
| 451 |
+
|
| 452 |
+
so that
|
| 453 |
+
|
| 454 |
+
$$
|
| 455 |
+
\begin{array} { r } { \langle D _ { h _ { 1 } } [ L ( h ) ] , \tilde { \eta } \rangle = \mathbb { E } \left[ \| h _ { H + 1 : 1 } ( X ) - h ^ { * } ( X ) \| _ { 2 } ^ { 2 } \right] . } \end{array}
|
| 456 |
+
$$
|
| 457 |
+
|
| 458 |
+
It remains to check if $\tilde { \eta } \in \mathcal { F } _ { 1 }$ . It is easily checked that $\tilde { \eta } ( 0 ) = 0$ because $h _ { H + 1 : 1 } ( 0 ) - h ^ { * } ( 0 ) = \underline { { 0 } }$ . Since $J [ h _ { H + 1 : 2 } ]$ is differentiable by assumption and $h _ { 1 } \in \mathcal { F } _ { 1 }$ , $A ( X )$ is differentiable and ${ \dot { A ( X ) } } ^ { T }$ , $( A ( X ) \bar { A } ( X ) ^ { T } ) ^ { \bar { - } 1 }$ are differentiable functions. Also, $h _ { H + 1 : 1 } - h ^ { * } \in \mathcal { F }$ , so we can conclude that $\tilde { \eta }$ is differentiable.
|
| 459 |
+
|
| 460 |
+
Moreover, if we decompose $A ( X )$ with SVD, $A ( X ) = U \Sigma V ^ { T }$ , $\Sigma$ is of the form $\Sigma = [ \Sigma _ { 1 } \ : 0 ]$ and
|
| 461 |
+
|
| 462 |
+
$$
|
| 463 |
+
\begin{array} { r l } & { A ( X ) ^ { T } ( A ( X ) A ( X ) ^ { T } ) ^ { - 1 } = V \Sigma ^ { T } U ^ { T } ( U \Sigma V ^ { T } V \Sigma ^ { T } U ^ { T } ) ^ { - 1 } = V \Sigma ^ { T } U ^ { T } ( U \Sigma _ { 1 } ^ { 2 } U ^ { T } ) ^ { - 1 } } \\ & { \qquad = V \Sigma ^ { T } U ^ { T } U \Sigma _ { 1 } ^ { - 2 } U ^ { T } = V \left[ \Sigma _ { 0 } ^ { - 1 } \right] U ^ { T } , } \end{array}
|
| 464 |
+
$$
|
| 465 |
+
|
| 466 |
+
from which we can see that
|
| 467 |
+
|
| 468 |
+
$$
|
| 469 |
+
\begin{array} { r } { \big \| { A ( X ) } ^ { T } ( A ( X ) { A ( X ) } ^ { T } ) ^ { - 1 } \big \| _ { \mathrm { o p } } = \sigma _ { \operatorname* { m a x } } ( { A ( X ) } ^ { T } ( A ( X ) { A ( X ) } ^ { T } ) ^ { - 1 } ) \leq 1 / \epsilon , } \end{array}
|
| 470 |
+
$$
|
| 471 |
+
|
| 472 |
+
by our assumption. Note that, for any $X \in \mathbb { R } ^ { d _ { x } }$ ,
|
| 473 |
+
|
| 474 |
+
$$
|
| 475 |
+
\begin{array} { r l } & { \| \tilde { \eta } ( X ) \| _ { 2 } = \left\| A ( X ) ^ { T } ( A ( X ) A ( X ) ^ { T } ) ^ { - 1 } ( h _ { H + 1 : 1 } ( X ) - h ^ { * } ( X ) ) \right\| _ { 2 } } \\ & { \qquad \leq \left\| A ( X ) ^ { T } ( A ( X ) A ( X ) ^ { T } ) ^ { - 1 } \right\| _ { \mathrm { o p } } \left\| h _ { H + 1 : 1 } ( X ) - h ^ { * } ( X ) \right\| _ { 2 } } \\ & { \qquad \leq \left\| A ( X ) ^ { T } ( A ( X ) A ( X ) ^ { T } ) ^ { - 1 } \right\| _ { \mathrm { o p } } \left\| h _ { H + 1 : 1 } - h ^ { * } \right\| _ { \mathrm { n l } } \left\| X \right\| _ { 2 } . } \end{array}
|
| 476 |
+
$$
|
| 477 |
+
|
| 478 |
+
Since this holds for any $X$ , we have
|
| 479 |
+
|
| 480 |
+
$$
|
| 481 |
+
\begin{array} { r } { \| \tilde { \eta } \| _ { \mathrm { n l } } \leq \| A ( X ) ^ { T } ( A ( X ) A ( X ) ^ { T } ) ^ { - 1 } \| _ { \mathrm { o p } } \| h _ { H + 1 : 1 } - h ^ { * } \| _ { \mathrm { n l } } \leq \frac { \| h _ { H + 1 : 1 } - h ^ { * } \| _ { \mathrm { n l } } } { \epsilon } , } \end{array}
|
| 482 |
+
$$
|
| 483 |
+
|
| 484 |
+
which ensures that $\tilde { \eta } \in \mathcal { F } _ { 1 }$ . Finally,
|
| 485 |
+
|
| 486 |
+
$$
|
| 487 |
+
\| D _ { h _ { 1 } } [ L ( h ) ] \| _ { \mathrm { o p } } \ge \frac { \langle D _ { h _ { 1 } } [ L ( h ) ] , \tilde { \eta } \rangle } { \| \tilde { \eta } \| _ { \mathrm { n l } } } \ge \frac { \epsilon \mathbb { E } \left[ \| h _ { H + 1 : 1 } ( X ) - h ^ { * } ( X ) \| _ { 2 } ^ { 2 } \right] } { \| h _ { H + 1 : 1 } - h ^ { * } \| _ { \mathrm { n l } } } = \frac { \epsilon ( L ( h ) - L ^ { * } ) } { \| h _ { H + 1 : 1 } - h ^ { * } \| _ { \mathrm { n l } } } ,
|
| 488 |
+
$$
|
| 489 |
+
|
| 490 |
+
which yields
|
| 491 |
+
|
| 492 |
+
$$
|
| 493 |
+
\begin{array} { r } { \| D _ { h _ { 1 } } [ L ( h ) ] \| _ { \mathrm { o p } } \| h _ { H + 1 : 1 } - h ^ { * } \| _ { \mathrm { n l } } \ge \epsilon ( L ( h ) - L ^ { * } ) . } \end{array}
|
| 494 |
+
$$
|
| 495 |
+
|
| 496 |
+
From this we can see that if we have a critical point of $L ( h )$ , then $\| D _ { h _ { 1 } } [ L ( h ) ] \| _ { \mathrm { o p } } = 0$ implies $L ( h ) = L ^ { * }$ , which means that the critical point is a global minimum of $L ( h )$ .
|
| 497 |
+
|
| 498 |
+
# A.4 PROOF OF THEOREM 4.2
|
| 499 |
+
|
| 500 |
+
Recall that by assumption we have $j \in \{ 1 , \dots , H + 1 \}$ such that $d _ { x } = d _ { j - 1 }$ and $d _ { y } \leq d _ { j }$ . Consider $D _ { h _ { j } } [ L ( h ) ]$ , then for any $\eta \in \mathcal { F } _ { j }$ ,
|
| 501 |
+
|
| 502 |
+
$$
|
| 503 |
+
\left. D _ { h _ { j } } [ L ( h ) ] , \eta \right. = \mathbb { E } \left[ \left( h _ { H + 1 : 1 } ( X ) - h ^ { * } ( X ) \right) ^ { T } J [ h _ { H + 1 : j + 1 } ] ( h _ { j : 1 } ( X ) ) \eta ( h _ { j - 1 : 1 } ( X ) ) \right] .
|
| 504 |
+
$$
|
| 505 |
+
|
| 506 |
+
As done in the previous theorem, for any $w \in \mathbb { R } ^ { d _ { j - 1 } }$ , let $A ( w ) = J [ h _ { H + 1 : j + 1 } ] ( h _ { j } ( w ) )$ . Since $A ( w )$ has full row rank by assumption, $A ( w ) A ( w ) ^ { T }$ is invertible. Then define
|
| 507 |
+
|
| 508 |
+
$$
|
| 509 |
+
\tilde { \eta } ( w ) = A ( w ) ^ { T } ( A ( w ) A ( w ) ^ { T } ) ^ { - 1 } ( h _ { H + 1 : 1 } - h ^ { * } ) \circ h _ { j - 1 : 1 } ^ { - 1 } ( w ) ,
|
| 510 |
+
$$
|
| 511 |
+
|
| 512 |
+
so that
|
| 513 |
+
|
| 514 |
+
$$
|
| 515 |
+
\begin{array} { r } { \left. D _ { h _ { j } } [ L ( h ) ] , \tilde { \eta } \right. = \mathbb { E } \left[ \left\| h _ { H + 1 : 1 } ( X ) - h ^ { * } ( X ) \right\| _ { 2 } ^ { 2 } \right] . } \end{array}
|
| 516 |
+
$$
|
| 517 |
+
|
| 518 |
+
We need to check if $\tilde { \eta } \in \mathcal { F } _ { j }$ . It is easily checked that $\tilde { \eta } ( 0 ) = 0$ . Since $J [ h _ { H + 1 : j + 1 } ]$ is differentiable by assumption and $h _ { j } \in { \mathcal { F } } _ { j }$ , $A ( w )$ is differentiable, and so are $A ( w ) ^ { T }$ and $( \dot { A ( w ) } \dot { A ( w ) } ^ { T } ) ^ { - 1 }$ . The inverse function of a differentiable and invertible function is also differentiable, so $\left( h _ { H + 1 : 1 } - h ^ { * } \right) \circ$ $h _ { j - 1 : 1 } ^ { - 1 }$ is differentiable. Hence, we can conclude that $\tilde { \eta }$ is differentiable.
|
| 519 |
+
|
| 520 |
+
As seen in the previous section,
|
| 521 |
+
|
| 522 |
+
$$
|
| 523 |
+
\begin{array} { r } { \left\| \boldsymbol A ( \boldsymbol w ) ^ { T } ( \boldsymbol A ( \boldsymbol w ) \boldsymbol A ( \boldsymbol w ) ^ { T } ) ^ { - 1 } \right\| _ { \mathrm { o p } } = \sigma _ { \mathrm { m a x } } ( \boldsymbol A ( \boldsymbol w ) ^ { T } ( \boldsymbol A ( \boldsymbol w ) \boldsymbol A ( \boldsymbol w ) ^ { T } ) ^ { - 1 } ) \le 1 / \epsilon _ { 2 } . } \end{array}
|
| 524 |
+
$$
|
| 525 |
+
|
| 526 |
+
By the assumption that $h _ { j - 1 : 1 }$ is invertible and $\left\| h _ { j - 1 : 1 } ( u ) \right\| _ { 2 } \geq \epsilon _ { 1 } \left\| u \right\| _ { 2 }$ ,
|
| 527 |
+
|
| 528 |
+
$$
|
| 529 |
+
\left\| v \right\| _ { 2 } \geq \epsilon _ { 1 } \left\| h _ { j - 1 : 1 } ^ { - 1 } ( v ) \right\| _ { 2 } ,
|
| 530 |
+
$$
|
| 531 |
+
|
| 532 |
+
for all $v \in \mathbb { R } ^ { d _ { j - 1 } }$ . From this, we can see that $\| h _ { j - 1 : 1 } ^ { - 1 } \| _ { \mathrm { n l } } \leq 1 / \epsilon _ { 1 }$ . For any $w \in \mathbb { R } ^ { d _ { j - 1 } }$
|
| 533 |
+
|
| 534 |
+
$$
|
| 535 |
+
\begin{array} { r l } & { \left. \tilde { \eta } ( w ) \right. _ { 2 } = \left. A ( w ) ^ { T } ( A ( w ) A ( w ) ^ { T } ) ^ { - 1 } ( h _ { H + 1 : 1 } - h ^ { * } ) \circ h _ { j - 1 : 1 } ^ { - 1 } ( w ) \right. _ { 2 } } \\ & { \qquad \leq \left. A ( w ) ^ { T } ( A ( w ) A ( w ) ^ { T } ) ^ { - 1 } \right. _ { \mathrm { o p } } \left. \left( h _ { H + 1 : 1 } - h ^ { * } \right) \circ h _ { j - 1 : 1 } ^ { - 1 } ( w ) \right. _ { 2 } } \\ & { \qquad \leq \left. A ( w ) ^ { T } ( A ( w ) A ( w ) ^ { T } ) ^ { - 1 } \right. _ { \mathrm { o p } } \left. h _ { H + 1 : 1 } - h ^ { * } \right. _ { \mathrm { n l } } \left. h _ { j - 1 : 1 } ^ { - 1 } ( w ) \right. _ { 2 } } \\ & { \qquad \leq \left. A ( w ) ^ { T } ( A ( w ) A ( w ) ^ { T } ) ^ { - 1 } \right. _ { \mathrm { o p } } \left. h _ { H + 1 : 1 } - h ^ { * } \right. _ { \mathrm { n l } } \left. h _ { j - 1 : 1 } ^ { - 1 } \right. _ { \mathrm { n l } } \left. w \right. _ { 2 } . } \end{array}
|
| 536 |
+
$$
|
| 537 |
+
|
| 538 |
+
From this, we have
|
| 539 |
+
|
| 540 |
+
$$
|
| 541 |
+
\begin{array} { r } { \| \tilde { \eta } \| _ { \mathrm { n l } } \leq \| A ( w ) ^ { T } ( A ( w ) A ( w ) ^ { T } ) ^ { - 1 } \| _ { \mathrm { o p } } \| h _ { H + 1 : 1 } - h ^ { * } \| _ { \mathrm { n l } } \left\| h _ { j - 1 : 1 } ^ { - 1 } \right\| _ { \mathrm { n l } } \leq \frac { \| h _ { H + 1 : 1 } - h ^ { * } \| _ { \mathrm { n l } } } { \epsilon _ { 1 } \epsilon _ { 2 } } . } \end{array}
|
| 542 |
+
$$
|
| 543 |
+
|
| 544 |
+
Finally,
|
| 545 |
+
|
| 546 |
+
$$
|
| 547 |
+
\left\| \boldsymbol { D } _ { h _ { j } } [ L ( h ) ] \right\| _ { \mathrm { o p } } \ge \frac { \left. \boldsymbol { D } _ { h _ { j } } [ L ( h ) ] , \tilde { \eta } \right. } { \| \tilde { \eta } \| _ { \mathrm { n l } } } \ge \frac { \epsilon _ { 1 } \epsilon _ { 2 } \mathbb { E } \left[ \| h _ { H + 1 : 1 } ( \boldsymbol { X } ) - h ^ { * } ( \boldsymbol { X } ) \| _ { 2 } ^ { 2 } \right] } { \| h _ { H + 1 : 1 } - h ^ { * } \| _ { \mathrm { n l } } } = \frac { \epsilon _ { 1 } \epsilon _ { 2 } \left( L ( h ) - L ^ { * } \right) } { \left\| h _ { H + 1 : 1 } - h ^ { * } \right\| _ { \mathrm { n l } } } ,
|
| 548 |
+
$$
|
| 549 |
+
|
| 550 |
+
which yields
|
| 551 |
+
|
| 552 |
+
$$
|
| 553 |
+
\begin{array} { r } { \left\| D _ { h _ { j } } [ L ( h ) ] \right\| _ { \mathrm { o p } } \| h _ { H + 1 : 1 } - h ^ { * } \| _ { \mathrm { n l } } \geq \epsilon _ { 1 } \epsilon _ { 2 } ( L ( h ) - L ^ { * } ) . } \end{array}
|
| 554 |
+
$$
|
| 555 |
+
|
| 556 |
+
# A.5 PROOF OF PROPOSITION 4.3
|
| 557 |
+
|
| 558 |
+
(Theorem 4.1) By assumption, we have $d _ { 1 } \geq d _ { y }$ . Set $h _ { 1 } ( x ) = ( h ^ { * } ( x ) , 0 , \ldots , 0 )$ where for every $x \in \mathbb { R } ^ { d _ { x } }$ , the first $d _ { y }$ components of $h _ { 1 } ( x )$ are identical to $h ^ { \ast } ( x )$ , and all other components are zero. For the rest of $h _ { i }$ ’s, define $h _ { i } : \mathbb { R } ^ { d _ { i - 1 } } \mathbb { R } ^ { d _ { i } }$ to be
|
| 559 |
+
|
| 560 |
+
$$
|
| 561 |
+
h _ { i } ( w ) = \left\{ \begin{array} { l l } { ( w _ { 1 } , \ldots , w _ { d _ { i } } ) , } & { \mathrm { i f ~ } d _ { i } \leq d _ { i - 1 } , } \\ { ( w _ { 1 } , \ldots , w _ { d _ { i - 1 } } , 0 , \ldots , 0 ) , } & { \mathrm { i f ~ } d _ { i } > d _ { i - 1 } , } \end{array} \right.
|
| 562 |
+
$$
|
| 563 |
+
|
| 564 |
+
for all $w \in \mathbb { R } ^ { d _ { i - 1 } }$ . Since $d _ { i } \geq d _ { y }$ for all $i$ , we can check that $h _ { H + 1 } \circ \cdot \cdot \cdot \circ h _ { 1 } = h ^ { * }$ , and $h _ { i } \in$ ${ \mathcal { F } } _ { i }$ for all $i$ . Moreover, for all $z ~ \in ~ \mathbb { R } ^ { d _ { 1 } }$ , $J [ h _ { H + 1 : 2 } ] ( z )$ is all 0 except 1’s in diagonal entries, so $\sigma _ { \operatorname* { m i n } } ( J [ h _ { H + 1 : 2 } ] ( z ) ) \geq 1$ and $h _ { H + 1 : 2 } ( z )$ is twice-differentiable.
|
| 565 |
+
|
| 566 |
+
(Theorem 4.2) It is given that we have $j \in \{ 1 , \dots , H + 1 \}$ such that $d _ { x } = d _ { j - 1 }$ and $d _ { y } \leq d _ { j }$ . Set $h _ { j } ( x ) = ( h ^ { * } ( x ) , 0 , \ldots , 0 )$ , where the first $d _ { y }$ components are $h ^ { \ast } ( x )$ and the rest are zero. All the rest of $h _ { i }$ are set as in (7). Then, it can be easily checked that $h _ { i } \in { \mathcal { F } } _ { i }$ for all $i$ and all the conditions of the theorem are satisfied.
|
| 567 |
+
|
| 568 |
+
# B DEFERRED LEMMA
|
| 569 |
+
|
| 570 |
+
Lemma B.1. Suppose we are given a data matrix $X \in \mathbb { R } ^ { d _ { x } \times m }$ and an output matrix $Y \in \mathbb { R } ^ { d _ { y } \times m }$ , where $d _ { x } \ < \ d _ { y }$ . Assume $X \breve { X } ^ { T }$ and $Y X ^ { T }$ have full ranks. Consider minimizing the empirical squared error risk:
|
| 571 |
+
|
| 572 |
+
$$
|
| 573 |
+
L ( W _ { 1 } , \dots , W _ { H + 1 } ) : = \frac { 1 } { 2 } \left\| W _ { H + 1 } W _ { H } \cdot \cdot \cdot W _ { 1 } X - Y \right\| _ { \mathrm { F } } ^ { 2 } ,
|
| 574 |
+
$$
|
| 575 |
+
|
| 576 |
+
where $W _ { k } \in \mathbb { R } ^ { d _ { k } \times d _ { k - 1 } }$ , $k = 1 , \ldots , H + 1$ are weight matrices of the linear neural network, and $d _ { 0 } = d _ { x }$ and $d _ { H + 1 } = d _ { y }$ for simplicity in notation. Also let $W$ denote the tuple $( W _ { 1 } , \dots , W _ { H + 1 } )$ . Then, any critical point of $L ( W )$ that is not a local minimum is a saddle point.
|
| 577 |
+
|
| 578 |
+
Proof. For this lemma, we separate the proof into two cases: $W _ { H } \cdot \cdot \cdot W _ { 1 } \neq 0$ and $W _ { H } \cdot \cdot \cdot W _ { 1 } = 0$ . The crux of the proof is to show that any critical point cannot be a local maximum. Then, any critical point is either a local minimum or a saddle point, so the conclusion of this lemma follows.
|
| 579 |
+
|
| 580 |
+
In case of $W _ { H } \cdot \cdot \cdot W _ { 1 } \neq 0$ , we use some of the results in Kawaguchi (2016) and examine the Hessian of $L ( W )$ with respect to $\mathrm { v e c } ( W _ { H + 1 } ^ { T } )$ , where $\operatorname { v e c } ( A )$ denotes vectorization of matrix $A$ .
|
| 581 |
+
|
| 582 |
+
Let $D _ { \mathrm { v e c } ( W _ { H + 1 } ^ { T } ) } L ( W )$ be the partial derivative of $L ( W )$ with respect to $\mathrm { v e c } ( W _ { H + 1 } ^ { T } )$ in numerator layout. It was shown by Kawaguchi (2016, Lemma 4.3) that the Hessian matrix
|
| 583 |
+
|
| 584 |
+
$$
|
| 585 |
+
\begin{array} { r l r } & { } & { \mathcal { H } ( W ) = D _ { \mathrm { v e c } ( W _ { H + 1 } ^ { T } ) } \left( D _ { \mathrm { v e c } ( W _ { H + 1 } ^ { T } ) } L ( W ) \right) ^ { T } = \left( I \otimes ( W _ { H } \cdot \cdot \cdot W _ { 1 } X ) ( W _ { H } \cdot \cdot \cdot W _ { 1 } X ) ^ { T } \right) } \\ & { } & { \quad = \left( I \otimes W _ { H } \cdot \cdot \cdot W _ { 1 } X X ^ { T } W _ { 1 } ^ { T } \cdot \cdot \cdot W _ { H } ^ { T } \right) , } \end{array}
|
| 586 |
+
$$
|
| 587 |
+
|
| 588 |
+
where $\otimes$ denotes the Kronecker product of two matrices. Notice that $\mathcal { H } ( W )$ is positive semidefinite. Since $X X ^ { T }$ is full rank, whenever $W _ { H } \cdot \cdot \cdot W _ { 1 } \neq 0$ there exists a strictly positive eigenvalue in $\mathcal { H } ( W )$ , which means that there exists an increasing direction. So $W$ cannot be a local maximum.
|
| 589 |
+
|
| 590 |
+
The case where $W _ { H } \cdot \cdot \cdot W _ { 1 } = 0$ requires a bit more careful treatment. Note that this case corresponds to where we have degenerate critical points, which are in many cases much harder to handle.
|
| 591 |
+
|
| 592 |
+
For any arbitrary $\epsilon > 0$ , we describe a procedure that perturbs the matrices $W _ { 1 } , \dots , W _ { H + 1 }$ by perturbations sampled from Frobenius norm balls of radius $\epsilon$ centered at 0, which we will denote as $\bar { \boldsymbol { B } } _ { i } ( \epsilon )$ , $i = 1 , \ldots , H + 1$ . Let $\mathcal { U } ( B _ { i } ( \epsilon ) )$ be the uniform distribution over the ball $B _ { i } ( \epsilon )$ . The algorithm goes as the following:
|
| 593 |
+
|
| 594 |
+
1. For $i \in \{ 1 , \ldots , H + 1 \}$
|
| 595 |
+
|
| 596 |
+
1.1. Sample $\Delta _ { i } \sim \mathcal { U } ( B _ { i } ( \epsilon ) )$ , and define $V _ { i } = W _ { i } + \Delta _ { i }$
|
| 597 |
+
|
| 598 |
+
1.2. If $W _ { H + 1 } \cdot \cdot \cdot W _ { i + 1 } V _ { i } \cdot \cdot \cdot V _ { 1 } \neq 0$ , stop and return $i ^ { * } = i$ .
|
| 599 |
+
|
| 600 |
+
First, recall that the set of rank-deficient matrices have Lebesgue measure zero, so for any sample $\Delta _ { i } \sim \mathcal { U } ( B _ { i } ( \epsilon ) )$ , $V _ { i } = W _ { i } + \Delta _ { i }$ has full rank with probability 1. If we proceed the for loop until $i = H + 1$ , we have a full-rank $V _ { H + 1 } \cdots V _ { 1 }$ with probability 1, which means that the algorithm must return $i ^ { * } \in \{ 1 , \ldots , H + 1 \}$ with probability 1. Notice that before and after the $i ^ { * }$ -th iteration, we have
|
| 601 |
+
|
| 602 |
+
$$
|
| 603 |
+
\begin{array} { r l } & { W _ { H + 1 } \cdots W _ { i ^ { * } } V _ { i ^ { * } - 1 } \cdots V _ { 1 } = 0 , } \\ & { W _ { H + 1 } \cdots W _ { i ^ { * } + 1 } V _ { i ^ { * } } \cdots V _ { 1 } = W _ { H + 1 } \cdot \cdot \cdot W _ { i ^ { * } + 1 } ( W _ { i ^ { * } } + \Delta _ { i ^ { * } } ) V _ { i ^ { * } - 1 } \cdot \cdot \cdot V _ { 1 } \not = 0 . } \end{array}
|
| 604 |
+
$$
|
| 605 |
+
|
| 606 |
+
This means that if we define $\hat { \Delta } = { \cal W } _ { H + 1 } \cdot \cdot \cdot { \cal W } _ { i ^ { * } + 1 } \Delta _ { i ^ { * } } V _ { i ^ { * } - 1 } \cdot \cdot \cdot V _ { 1 }$ , then $\hat { \Delta } \neq 0$ . Also, notice that
|
| 607 |
+
|
| 608 |
+
$$
|
| 609 |
+
W _ { H + 1 } \cdot \cdot \cdot W _ { i ^ { * } + 1 } ( W _ { i ^ { * } } - \Delta _ { i ^ { * } } ) V _ { i ^ { * } - 1 } \cdot \cdot \cdot V _ { 1 } = - \hat { \Delta } .
|
| 610 |
+
$$
|
| 611 |
+
|
| 612 |
+
Now, define two points
|
| 613 |
+
|
| 614 |
+
$$
|
| 615 |
+
\begin{array} { r l } & { U ^ { ( 1 ) } = ( V _ { 1 } , \ldots , V _ { i ^ { * } - 1 } , W _ { i ^ { * } } + \Delta _ { i ^ { * } } , W _ { i ^ { * } + 1 } , \ldots , W _ { H + 1 } ) , } \\ & { U ^ { ( 2 ) } = ( V _ { 1 } , \ldots , V _ { i ^ { * } - 1 } , W _ { i ^ { * } } - \Delta _ { i ^ { * } } , W _ { i ^ { * } + 1 } , \ldots , W _ { H + 1 } ) , } \end{array}
|
| 616 |
+
$$
|
| 617 |
+
|
| 618 |
+
and notice that they are all in the neighborhood of $W$ , that is, the Cartesian product of $\epsilon$ -radius balls centered at $W _ { 1 } , \dots , W _ { H + 1 }$ . Moreover, we have
|
| 619 |
+
|
| 620 |
+
$$
|
| 621 |
+
\begin{array} { l } { \displaystyle { L ( W ) = \frac { 1 } { 2 } \left\| 0 \cdot X - Y \right\| _ { \mathrm { F } } ^ { 2 } = \frac { 1 } { 2 } \left\| Y \right\| _ { \mathrm { F } } ^ { 2 } , } } \\ { \displaystyle { L ( U ^ { ( 1 ) } ) = \frac { 1 } { 2 } \left\| \hat { \Delta } X - Y \right\| _ { \mathrm { F } } ^ { 2 } = \frac { 1 } { 2 } \left\| Y \right\| _ { \mathrm { F } } ^ { 2 } + \frac { 1 } { 2 } \left\| \hat { \Delta } X \right\| _ { \mathrm { F } } ^ { 2 } - \left. \hat { \Delta } X , Y \right. , } } \\ { \displaystyle { L ( U ^ { ( 2 ) } ) = \frac { 1 } { 2 } \left\| - \hat { \Delta } X - Y \right\| _ { \mathrm { F } } ^ { 2 } = \frac { 1 } { 2 } \left\| Y \right\| _ { \mathrm { F } } ^ { 2 } + \frac { 1 } { 2 } \left\| \hat { \Delta } X \right\| _ { \mathrm { F } } ^ { 2 } + \left. \hat { \Delta } X , Y \right. , } } \end{array}
|
| 622 |
+
$$
|
| 623 |
+
|
| 624 |
+
from which we can see that at least one of $L ( W ) < L ( U ^ { ( 1 ) } )$ or $L ( W ) < L ( U ^ { ( 2 ) } )$ must hold. This shows that for any $\epsilon > 0$ , there is a point $U$ in $\epsilon$ -neighborhood of $W$ with a strictly greater function value $L ( U )$ . This proves that $W$ cannot be a local maximum. □
|
| 625 |
+
|
| 626 |
+
# C DEFERRED PROOFS
|
| 627 |
+
|
| 628 |
+
# C.1 PROOF OF PROPOSITION 3.1
|
| 629 |
+
|
| 630 |
+
In case of $k < \operatorname* { m i n } \{ d _ { x } , d _ { y } \}$ , we can decompose the loss function in the following way:
|
| 631 |
+
|
| 632 |
+
$$
|
| 633 |
+
\begin{array} { r l } & { \left\| R X - Y \right\| _ { \mathrm { F } } ^ { 2 } = \left\| R X - Y X ^ { T } ( X X ^ { T } ) ^ { - 1 } X + Y X ^ { T } ( X X ^ { T } ) ^ { - 1 } X - Y \right\| _ { \mathrm { F } } ^ { 2 } } \\ & { \qquad = \left\| R X - Y X ^ { T } ( X X ^ { T } ) ^ { - 1 } X \right\| _ { \mathrm { F } } ^ { 2 } + \left\| Y X ^ { T } ( X X ^ { T } ) ^ { - 1 } X - Y \right\| _ { \mathrm { F } } ^ { 2 } } \\ & { \qquad + 2 \operatorname { t r } ( ( Y X ^ { T } ( X X ^ { T } ) ^ { - 1 } X - Y ) ( R X - Y X ^ { T } ( X X ^ { T } ) ^ { - 1 } X ) ^ { T } ) . } \end{array}
|
| 634 |
+
$$
|
| 635 |
+
|
| 636 |
+
Let us take a close look into the last term in the RHS. Note that $Y X ^ { T } ( X X ^ { T } ) ^ { - 1 } X$ is the orthogonal projection of $Y$ onto row $( X )$ , so each row of $Y X ^ { T } ( X X ^ { T } ) ^ { - 1 } X - Y$ must be in $\operatorname { n u l l } ( X )$ . Also,
|
| 637 |
+
|
| 638 |
+
$$
|
| 639 |
+
( R X - Y X ^ { T } ( X X ^ { T } ) ^ { - 1 } X ) ^ { T } = X ^ { T } ( R ^ { T } - ( X X ^ { T } ) ^ { - 1 } X Y ^ { T } ) .
|
| 640 |
+
$$
|
| 641 |
+
|
| 642 |
+
It is $X ^ { T }$ right-multiplied with some matrix, so its columns must lie in $\operatorname { c o l } ( X ^ { T } ) = \operatorname { r o w } ( X )$ . By the fact that $\mathrm { n u l l } ( X ) ^ { \perp } \overset { \cdot } { = } \operatorname { r o w } ( X )$ ,
|
| 643 |
+
|
| 644 |
+
$$
|
| 645 |
+
( Y X ^ { T } ( X X ^ { T } ) ^ { - 1 } X - Y ) ( R X - Y X ^ { T } ( X X ^ { T } ) ^ { - 1 } X ) ^ { T } = 0 .
|
| 646 |
+
$$
|
| 647 |
+
|
| 648 |
+
thus
|
| 649 |
+
|
| 650 |
+
$$
|
| 651 |
+
L _ { 0 } ( R ) = { \frac { 1 } { 2 } } \left\| R X - Y X ^ { T } ( X X ^ { T } ) ^ { - 1 } X \right\| _ { \mathrm { F } } ^ { 2 } + { \frac { 1 } { 2 } } \left\| Y X ^ { T } ( X X ^ { T } ) ^ { - 1 } X - Y \right\| _ { \mathrm { F } } ^ { 2 }
|
| 652 |
+
$$
|
| 653 |
+
|
| 654 |
+
holds.
|
| 655 |
+
|
| 656 |
+
Now, (2) becomes a problem of minimizing $\begin{array} { r } { \left\| R X - Y X ^ { T } ( X X ^ { T } ) ^ { - 1 } X \right\| _ { \mathrm { F } } ^ { 2 } } \end{array}$ subject to the rank constraint $\mathrm { r a n k } ( R ) \leq k$ . The optimal solution for this is obtained when $R X$ is the $k$ -rank approximation of $\overset { \cdot } { Y X ^ { T } } ( X X ^ { T } ) ^ { - 1 } X$ . Then, $k$ -rank approximation of $Y X ^ { T } ( X X ^ { T } ) ^ { - 1 } X$ can be expressed as $\hat { U } \hat { U } ^ { T } Y X ^ { T } ( X X ^ { T } ) ^ { - 1 } X$ , where $\hat { U }$ is unique due to our assumption that all singular values are distinct. Therefore,
|
| 657 |
+
|
| 658 |
+
$$
|
| 659 |
+
R ^ { * } = \hat { U } \hat { U } ^ { T } Y X ^ { T } ( X X ^ { T } ) ^ { - 1 }
|
| 660 |
+
$$
|
| 661 |
+
|
| 662 |
+
is the unique global minimum solution of (2) when $k < \operatorname* { m i n } \{ d _ { x } , d _ { y } \}$
|
| 663 |
+
|
| 664 |
+
# C.2 PROOF OF LEMMA 3.2
|
| 665 |
+
|
| 666 |
+
$$
|
| 667 |
+
\begin{array} { l } { { \displaystyle \begin{array} { l } { { \displaystyle L ( W _ { 1 } , \ldots , W _ { i - 1 } , W _ { i } + \Delta _ { i } , W _ { i + 1 } , \ldots , W _ { H + 1 } ) } } \\ { { \displaystyle = \frac { 1 } { 2 } \| W _ { H + 1 } \cdot \cdot \cdot W _ { i + 1 } ( W _ { i } + \Delta _ { i } ) W _ { i - 1 } \cdot \cdot \cdot W _ { 1 } X - Y \| _ { \mathrm { F } } ^ { 2 } } } \\ { { \displaystyle = \frac { 1 } { 2 } \| W _ { H + 1 } \cdot \cdot \cdot W _ { 1 } X - Y + W _ { H + 1 } \cdot \cdot \cdot W _ { i + 1 } \Delta _ { i } W _ { i - 1 } \cdot \cdot \cdot W _ { 1 } X \| _ { \mathrm { F } } ^ { 2 } } } \\ { { \displaystyle = L ( W ) + \mathrm { t r } ( ( W _ { H + 1 } \cdot \cdot \cdot W _ { i + 1 } \Delta _ { i } W _ { i - 1 } \cdot \cdot \cdot W _ { 1 } X ) ^ { T } ( W _ { H + 1 } \cdot \cdot \cdot W _ { 1 } X - Y ) ) + O ( \| \Delta _ { i } \| _ { \mathrm { F } } ^ { 2 } ) } } \end{array} } } \\ { { \displaystyle = L ( W ) + \mathrm { t r } ( W _ { i + 1 } ^ { T } \cdot \cdot \cdot W _ { H + 1 } ^ { T } ( W _ { H + 1 } \cdot \cdot \cdot W _ { 1 } X - Y ) X ^ { T } W _ { 1 } ^ { T } \cdot \cdot \cdot W _ { i - 1 } ^ { T } \Delta _ { i } ^ { T } ) + O ( \| \Delta _ { i } \| _ { \mathrm { F } } ^ { 2 } ) . } } \end{array}
|
| 668 |
+
$$
|
| 669 |
+
|
| 670 |
+
From this, we can conclude that
|
| 671 |
+
|
| 672 |
+
$$
|
| 673 |
+
\frac { \partial L } { \partial W _ { i } } = W _ { i + 1 } ^ { T } \cdot \cdot \cdot W _ { H + 1 } ^ { T } ( W _ { H + 1 } \cdot \cdot \cdot W _ { 1 } X - Y ) X ^ { T } W _ { 1 } ^ { T } \cdot \cdot \cdot W _ { i - 1 } ^ { T } .
|
| 674 |
+
$$
|
| 675 |
+
|
| 676 |
+
# C.3 PROOF OF LEMMA 3.3
|
| 677 |
+
|
| 678 |
+
1. Since $A ^ { T } A \succeq \sigma _ { \operatorname* { m i n } } ^ { 2 } ( A ) I , B ^ { T } A ^ { T } A B \succeq \sigma _ { \operatorname* { m i n } } ^ { 2 } ( A ) B ^ { T } B$ . Then
|
| 679 |
+
|
| 680 |
+
$$
|
| 681 |
+
\left\| A B \right\| _ { \mathrm { F } } ^ { 2 } = \mathrm { t r } ( B ^ { T } A ^ { T } A B ) \geq \sigma _ { \operatorname* { m i n } } ^ { 2 } ( A ) \mathrm { t r } ( B ^ { T } B ) = \sigma _ { \operatorname* { m i n } } ^ { 2 } ( A ) \left\| B \right\| _ { \mathrm { F } } ^ { 2 } .
|
| 682 |
+
$$
|
| 683 |
+
|
| 684 |
+
2. Since $B B ^ { T } \succeq \sigma _ { \operatorname* { m i n } } ^ { 2 } ( B ) I , A B B ^ { T } A ^ { T } \succeq \sigma _ { \operatorname* { m i n } } ^ { 2 } ( B ) A A ^ { T }$ . Then
|
| 685 |
+
|
| 686 |
+
$$
|
| 687 |
+
\left\| A B \right\| _ { \mathrm { F } } ^ { 2 } = \operatorname { t r } ( B ^ { T } A ^ { T } A B ) = \operatorname { t r } ( A B B ^ { T } A ^ { T } ) \geq \sigma _ { \operatorname* { m i n } } ^ { 2 } ( B ) \operatorname { t r } ( A A ^ { T } ) = \sigma _ { \operatorname* { m i n } } ^ { 2 } ( B ) \left\| A \right\| _ { \mathrm { F } } ^ { 2 } .
|
| 688 |
+
$$
|
md/train/BJlnmgrFvS/BJlnmgrFvS.md
ADDED
|
@@ -0,0 +1,373 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# BAIL: BEST-ACTION IMITATION LEARNING FOR BATCH DEEP REINFORCEMENT LEARNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
The field of Deep Reinforcement Learning (DRL) has recently seen a surge in research in batch reinforcement learning, which aims for sample-efficient learning from a given data set without additional interactions with the environment. In the batch DRL setting, commonly employed off-policy DRL algorithms can perform poorly and sometimes even fail to learn altogether. In this paper we propose a new algorithm, Best-Action Imitation Learning (BAIL), which unlike many offpolicy DRL algorithms does not involve maximizing Q functions over the action space. Striving for simplicity as well as performance, BAIL first selects from the batch the actions it believes to be high-performing actions for their corresponding states; it then uses those state-action pairs to train a policy network using imitation learning. Although BAIL is simple, we demonstrate that BAIL achieves state of the art performance on the Mujoco benchmark.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The field of Deep Reinforcement Learning (DRL) has recently seen a surge in research in batch reinforcement learning, which is the problem of sample-efficient learning from a given data set without additional interactions with the environment. Batch reinforcement learning is appealing because it dis-entangles policy optimization (exploitation) from data collection (exploration). This enables reusing the data collected by a policy to possibly improve the policy without further interactions with the environment. Furthermore, a batch learning reinforcement learning algorithm can potentially be deployed as part of a growing-batch algorithm, where the batch algorithm seeks a high-performing exploitation policy using the data in an experience replay buffer, combines this policy with exploration to add fresh data to the buffer, and then repeats the whole process (Lange et al., 2012).
|
| 12 |
+
|
| 13 |
+
Fujimoto et al. (2018a) recently made the critical observation that commonly employed off-policy algorithms based on Deep Q-Learning (DQL) often perform poorly and sometimes even fail to learn altogether. Indeed, off-policy DRL algorithms typically involve maximizing an approximate Qfunction over the action space (Lillicrap et al., 2015; Fujimoto et al., 2018b; Haarnoja et al., 2018a), leading to an extrapolation error, particularly for state-action pairs that are not in the batch distribution. Batch-Constrained deep Q-learning (BCQ), which obtains good performance for many of the Mujoco environments (Todorov et al., 2012), avoids the extrapolation error problem by constraining the set of actions over which the approximate Q-function is optimized (Fujimoto et al., 2018a).
|
| 14 |
+
|
| 15 |
+
We propose a new algorithm, Best-Action Imitation Learning (BAIL), which strives for both simplicity and performance. BAIL does not suffer from the extrapolation error problem since it does not maximize over the action space in any step of the algorithm. BAIL is simple, thereby satisfying the principle of Occam’s razor.
|
| 16 |
+
|
| 17 |
+
The BAIL algorithm has two steps. In the first step, it selects from the batch a subset of state-action pairs for which the actions are believed to be good actions for their corresponding states. In the second step, it simply trains a policy network with imitation learning using the selected actions from the first step. To find the best actions, we train a neural network to obtain the “upper envelope” of the Monte Carlo returns in the batch data, and then we select from the batch the state-action pairs that are near the upper envelope. We believe the concept of the upper-envelope of a data set is also novel and interesting in its own right.
|
| 18 |
+
|
| 19 |
+
Because the BCQ code is publicly available, we are able to make a careful comparison of the performance of BAIL and BCQ. We do this for batches generated by training DDPG (Lillicrap et al., 2015) for the Half-Cheetah, Walker, and Hopper environments, and for batches generated by training Soft Actor Critic (SAC) for the Ant environment (Haarnoja et al., 2018a;b). Although BAIL is simple, we demonstrate that BAIL achieves state of the art performance on the Mujoco benchmark, often outperforming Batch Constrained deep Q-Learning (BCQ) by a wide-margin. We also provide anonymized code for reproducibility1.
|
| 20 |
+
|
| 21 |
+
# 2 RELATED WORK
|
| 22 |
+
|
| 23 |
+
Batch reinforcement learning in both the tabular and functional approximator settings has long been studied (Lange et al., 2012; Strehl et al., 2010) and continues to be a highly active area of research (Swaminathan & Joachims, 2015; Jiang & Li, 2015; Thomas & Brunskill, 2016; Farajtabar et al., 2018; Irpan et al., 2019; Jaques et al., 2019). Imitation learning is also a well-studied problem (Schaal, 1999; Argall et al., 2009; Hussein et al., 2017) and also continues to be a highly active area of research (Kim et al., 2013; Piot et al., 2014; Chemali & Lazaric, 2015; Hester et al., 2018; Ho et al., 2016; Sun et al., 2017; 2018; Cheng et al., 2018; Gao et al., 2018).
|
| 24 |
+
|
| 25 |
+
This paper relates most closely to (Fujimoto et al., 2018a), which made the critical observation that when conventional DQL-based algorithms are employed for batch reinforcement learning, performance can be very poor, with the algorithm possibly not learning at all. Off-policy DRL algorithms involve maximizing an approximate action-value function $Q ( s , a )$ over all actions in the action space. (Or over the actions in the manifold of the parameterized policy.) The approximate action-value function can be very inaccurate, particularly for state-action pairs that are not in the state-action distribution of the batch (Fujimoto et al., 2018a). Due to this extrapolation error, poorperforming actions can be chosen when optimizing $Q ( s , a )$ over all actions. With traditional offpolicy DRL algorithms (such as DDPG (Lillicrap et al., 2015), TD3 (Fujimoto et al., 2018b) and SAC (Haarnoja et al., 2018a)), if the action-value function over-estimates a state-action pair, the policy will subsequently collect new data in the over-estimated region, and the estimate will get corrected. In the batch setting, however, where there is no further interaction with the environment, the extrapolation error is not corrected, and the poor choice of action persists in the policy (Fujimoto et al., 2018a).
|
| 26 |
+
|
| 27 |
+
Batch-Constrained deep Q-learning (BCQ) avoids the extrapolation error problem by constraining the set of actions over which the approximate Q-function is optimized (Fujimoto et al., 2018a). More specifically, BCQ first trains a state-dependent Variational Auto Encoder (VAE) using the state action pairs in the batch data. When optimizing the approximate Q-function over actions, instead of optimizing over all actions, it optimizes over a subset of actions generated by the VAE. The BCQ algorithm is further complicated by introducing a perturbation model, which employs an additional neural network that outputs an adjustment to an action. BCQ additionally employs a modified version of clipped-Double Q-Learning to obtain satisfactory performance. We show experimentally that our much simpler BAIL algorithm typically performs better than BCQ by a wide margin.
|
| 28 |
+
|
| 29 |
+
Kumar et al. (2019) recently proposed BEAR for batch DRL. BEAR is also complex, employing Maximum Mean Discrepancy (Gretton et al., 2012), kernel selection, a parametric model that fits a tanh-Gaussian distribution, and a test policy that is different from the learned actor policy. In this paper we do not experimentally compare BAIL with BEAR since the code for BEAR is not publicly available at the time of writing.
|
| 30 |
+
|
| 31 |
+
Agarwal et al. (2019) recently proposed another algorithm for batch DRL called Random Ensemble Mixture (REM), an ensembling scheme which enforces optimal Bellman consistency on random convex combinations of the Q-heads of a multi-headed Q-network. For the Atari 2600 games, batch REM can out-perform the policies used to collect the data. REM and BAIL are orthogonal, and it may be possible to combine them in the future to achieve even higher performance. No experimental results are provided for REM applied to the Mujoco benchmark (Agarwal et al., 2019).
|
| 32 |
+
|
| 33 |
+
# 3 BATCH DEEP REINFORCEMENT LEARNING
|
| 34 |
+
|
| 35 |
+
We represent the environment with a Markov Decision Process (MDP) defined by a tuple $( S , { \mathcal { A } } , g , r , \rho , \gamma )$ , where $s$ is the state space, $\mathcal { A }$ is the action space, $\rho$ is the initial state distribution, and $\gamma$ is the discount factor. The functions $g ( s , a )$ and $r ( s , a )$ represent the dynamics and reward function, respectively. In this paper we assume that the dynamics of the environment are deterministic, that is, there are real-valued functions $g ( s , a )$ and $r ( s , a )$ such that when in state $s$ and action $a$ is chosen, then the next state is $s ^ { \prime } = g ( s , a )$ and the reward received is $r ( s , a )$ . We note that all the simulated robotic locomotion environments in the Mujoco benchmark are deterministic, and many robotic tasks are expected to be deterministic environments. Furthermore, many of the Atari game environments are deterministic (Bellemare et al., 2013). Thus, from an applications perspective, the class of deterministic environments is a large and important class. Although we assume that the environment is deterministic, as is typically the case with reinforcement learning, we do not assume the functions $g ( s , a )$ and $r ( s , a )$ are known.
|
| 36 |
+
|
| 37 |
+
In batch reinforcement learning, we are provided a batch of $m$ data points $\begin{array} { r } { B = \{ ( s _ { i } , a _ { i } , r _ { i } , s _ { i } ^ { \prime } ) , i = } \end{array}$ $1 , . . . , m \}$ . We assume $\boldsymbol { B }$ is fixed and given, and there is no further interaction with the environment. Often the batch $\boldsymbol { B }$ is training data, generated in some episodic fashion. However, in the batch reinforcement learning problem, we do not have knowledge of the algorithm, models, or seeds that were used to generate the episodes in the batch $\boldsymbol { B }$ .
|
| 38 |
+
|
| 39 |
+
Typically the batch data is generated during training with a non-stationary DRL policy. After training, the original DRL algorithm produces a final-DRL policy, with exploration turned off. In our numerical experiments, we will compare the performance of policies obtained by batch algorithms with the performance of the final-DRL policy. Ideally, we would like the performance of the batchderived policy to be as good or better than the final-DRL policy.
|
| 40 |
+
|
| 41 |
+
The case where batch data is generated from a non-stationary training policy is of particular interest because it is typically a rich data set from which it may be possible to derive high-performing policies. Furthermore, a batch learning algorithm can potentially be deployed as part of a growingbatch algorithm, where the batch algorithm seeks a high-performing exploitation policy using the current data in an experience replay buffer, combines this policy with exploration to add fresh data to the buffer, and then repeats the whole process (Lange et al., 2012).
|
| 42 |
+
|
| 43 |
+
# 4 BEST-ACTION IMITATION LEARNING (BAIL)
|
| 44 |
+
|
| 45 |
+
In this paper we present BAIL, an algorithm that not only performs well on simulated robotic locomotion tasks, but is also conceptually and algorithmically simple. BAIL has two steps. In the first step, it selects from the batch data $\boldsymbol { B }$ the state-action pairs for which the actions are believed to be good actions for their corresponding states. In the second step, we simply train a policy network with imitation learning using the selected actions from the first step.
|
| 46 |
+
|
| 47 |
+
Many approaches could be employed to select the best actions. In this paper we propose training a single neural network to create an upper envelope of the Monte Carlo returns, and then selecting the state-action pairs in the batch $\boldsymbol { B }$ that have returns near the upper envelope.
|
| 48 |
+
|
| 49 |
+
# 4.1 UPPER ENVELOPE
|
| 50 |
+
|
| 51 |
+
We first define a $\lambda$ -smooth upper envelope, and then provide an algorithm for finding it. To the best of our knowledge, the notion of the upper envelope of a data set is novel.
|
| 52 |
+
|
| 53 |
+
Recall that we have a batch of data $\boldsymbol { B } = \{ ( s _ { i } , a _ { i } , r _ { i } , s _ { i } ^ { \prime } ) , i = 1 , . . . , m \}$ . Although we do not assume we know what algorithm was used to generate the batch, we make the natural assumption that the data in the batch was generated in an episodic fashion, and that the data in the batch is ordered accordingly. For each data point $i \in \{ 1 , \ldots , m \}$ , we calculate an approximate Monte Carlo return $G _ { i }$ as the sum of the discounted returns from state $s _ { i }$ to the end of the episode:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
G _ { i } = \sum _ { t = i } ^ { T _ { i } } \gamma ^ { t - i } r _ { t }
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
where $T _ { i }$ denotes the time at which the episode ends for the data point $s _ { i }$ . The Mujoco environments are naturally infinite-horizon non-episodic continuing-task environments (Sutton & Barto, 2018). During training, however, researchers typically create artificial episodes of length 1000 time steps; after 1000 time steps, a random initial state is chosen and a new episode begins. Because the Mujoco environments are continuing tasks, it is desirable to approximate the return over the infinite horizon, particularly for $i$ values that are close to the (artificial) end of an episode. To do this, we note that the data-generation policy from one episode to the next typically changes slowly. We therefore apply a simple augmentation heuristic of concatenating the subsequent episode to the current episode, and running the sum in (1) to infinity. (In practice, we end the sum when the discounting reduces the contribution of the rewards to a negligible amount.) Our ablation study in the Appendix shows that this simple heuristic can significantly improve performance. Note this approach also obviates the need for knowing when new episodes begin in the data set $\boldsymbol { B }$ .
|
| 60 |
+
|
| 61 |
+
Having defined the return for each data point in the batch, we now seek an upper-envelope $V ( s )$ for the data $\mathcal { G } : = \{ ( s _ { i } , G _ { i } ) , i = 1 , . . . , m \}$ . Let $V _ { \phi } ( s )$ be a neural network with parameters $\phi$ that takes as input a state $s$ and outputs a real number. We say that $V _ { \phi ^ { * } } ( s )$ is a $\lambda$ -smooth upper envelope for $\mathcal { G }$ if it has the following properties:
|
| 62 |
+
|
| 63 |
+
1. $V _ { \phi ^ { * } } ( s _ { i } ) \geq G _ { i }$ for all $i = 1 , \ldots , m$
|
| 64 |
+
|
| 65 |
+
2. Among all the parameterized functions $V _ { \phi } ( s )$ satisfying condition 1, it minimizes:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
L ( \phi ) = \sum _ { i = 1 } ^ { m } [ V _ { \phi } ( s _ { i } ) - G _ { i } ] ^ { 2 } + \lambda | | \phi | | ^ { 2 }
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
where $\lambda$ is a non-negative constant. An upper-envelope is thus a smooth function that lies above all the data points, but is nevertheless close to the data points.
|
| 72 |
+
|
| 73 |
+
Theorem 4.1. Suppose that $V _ { \phi ^ { * } } ( s )$ is a $\lambda$ -smooth upper envelope for $\mathcal { G }$ . Then,
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
V _ { \phi ^ { * } } ( s ) = \operatorname* { m a x } \{ G _ { i } : i = 1 , 2 , \ldots , m \} a s \lambda \infty .
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
(2) If there is sufficient capacity in the network and $\lambda = 0$ , then the $V _ { \phi ^ { * } }$ interpolates the data in $\mathcal { G }$ . For example, if $\lambda = 0$ and $V _ { \phi } ( s )$ is a neural network with ReLU activation functions with at least $2 m + d$ weights and two layers, where $d$ is the dimension of the state space $s$ , then $V _ { \phi ^ { * } } ( s _ { i } ) = G _ { i }$ for all $i = 1 , 2 , \dots , m$ .
|
| 80 |
+
|
| 81 |
+
From the above theorem, we see that when $\lambda$ is very small, the upper envelope aims to interpolate the data, and when $\lambda$ is large, the upper envelope approaches a constant going through the highest data point. Just as in classical regression, there is a sweet-spot for $\lambda$ , the one that provides the best generalization.
|
| 82 |
+
|
| 83 |
+
We note that there are other natural approaches for defining an upper-envelope, some based on alternative loss functions, others based on data clustering without making use of function approximators. Also, it may be possible to combine episodes to generate improved upper envelopes. These are all questions for future research.
|
| 84 |
+
|
| 85 |
+
To obtain an approximate upper envelope of the data $\mathcal { G }$ , we employ classic regression with a modified loss function, namely,
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
L ( \phi ) = \sum _ { i = 1 } ^ { m } ( V _ { \phi } ( s _ { i } ) - G _ { i } ) ^ { 2 } \{ \mathbb { 1 } _ { ( V _ { \phi } ( s _ { i } ) > G _ { i } ) } + K \mathbb { 1 } _ { ( V _ { \phi } ( s _ { i } ) < G _ { i } ) } \} + \lambda \| \phi \| ^ { 2 }
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
where $K > > 1$ and $\mathbb { 1 } _ { ( \cdot ) }$ is the indicator function.
|
| 92 |
+
|
| 93 |
+
For a finite $K$ value, the above loss function will only produce an approximate upper envelope, since it is possible $V ( s _ { i } )$ may be slightly less than $G _ { i }$ for a few data points. In practice, we find $K = 1 0 , 0 0 0$ works well for all environments tested. When $K \infty$ , the approximation becomes exact, as stated in the following:
|
| 94 |
+
|
| 95 |
+
Theorem 4.2. Let $\phi ^ { * }$ be an optimal solution that minimizes $L ( \phi )$ . Then, when $K \infty$ , $V _ { \phi ^ { * } } ( s )$ will be an exact $\lambda$ -smooth upper envelope.
|
| 96 |
+
|
| 97 |
+
Also, instead of L2 regularization, in practice we employ the simpler early-stopping regularization, thereby obviating a search for the parameter $\lambda$ . We also clip the upper envelope at values near $\operatorname* { m a x } _ { i } G _ { i }$ , as described in the appendix, which can potentially provide further gains in performance.
|
| 98 |
+
|
| 99 |
+
# 4.2 SELECTING THE BEST ACTIONS
|
| 100 |
+
|
| 101 |
+
The BAIL algorithm employs the upper envelope to select the best $( s , a )$ pairs from the batch data $\boldsymbol { B }$ . It then uses ordinary imitation learning (behavioral cloning) to train a policy network using the selected actions. Let $V ( s )$ denote the upper envelope obtained from minimizing the loss function (3) for a fixed value of $K$ .
|
| 102 |
+
|
| 103 |
+
We consider two approaches for selecting the best actions. In the first approach, which we call BAIL-border, we choose all $( s _ { i } , a _ { i } )$ pairs from the batch data set $\boldsymbol { B }$ such that
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
G _ { i } > x V ( s _ { i } )
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
We set $x$ such that $p \%$ of the data points are selected, where $p$ is a hyper-parameter. In this paper we use $p = 2 5$ for all environments and batches. Thus BAIL-border chooses state-action pairs whose returns are near the upper envelope. The pseudo-code for the Bail-border algorithm is given in the appendix.
|
| 110 |
+
|
| 111 |
+
In the second approach, which we refer to as BAIL-TD, we select a pair $( s _ { i } , a _ { i } )$ if
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
r _ { i } + \gamma V ( s _ { i } ^ { \prime } ) > x V ( s _ { i } )
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
where $x$ is a hyper-parameter close to 1. Thus BAIL-TD chooses state-action pairs for which backedup estimated return $r _ { i } + \gamma V ( s _ { i } ^ { \prime } )$ is close to the upper envelope value $V ( s _ { i } )$ .
|
| 118 |
+
|
| 119 |
+
In summary, BAIL employs two neural networks. The first neural network is used to approximate a value function based on the data in the batch $\boldsymbol { B }$ . The second neural network is the policy network, which is trained with imitation learning. This simple approach does not suffer from extrapolation error since it does not perform any optimization over the action space. An algorithmic description of BAIL is given in Algorithm 1.
|
| 120 |
+
|
| 121 |
+
# Algorithm 1 BAIL
|
| 122 |
+
|
| 123 |
+
1: Initialize upper envelope parameter2: Compute return for each data point $\phi$ $\theta$ , obtain batch data $\boldsymbol { B }$ .
|
| 124 |
+
$i$ $\begin{array} { r } { \dot { G _ { i } } = \dot { \sum _ { t = i } ^ { T _ { i } } } \gamma ^ { t - i } r _ { t } } \end{array}$
|
| 125 |
+
3: Obtain upper envelope by minimizing the loss:
|
| 126 |
+
4: for $j = 1 , \dots , J$ do
|
| 127 |
+
5: sample a minibatch of data B from the batch $\boldsymbol { B }$
|
| 128 |
+
6: minimize over $\phi$ : $\begin{array} { r } { L ( \phi ) = \sum _ { i = 1 } ^ { | B | } ( V _ { \phi } ( s _ { i } ) - G _ { i } ) ^ { 2 } \{ \mathbb { 1 } _ { ( V _ { \phi } ( s _ { i } ) > G _ { i } ) } + K \mathbb { 1 } _ { ( V _ { \phi } ( s _ { i } ) < G _ { i } ) } \} + \lambda \| \phi \| ^ { 2 } } \end{array}$
|
| 129 |
+
7: Select data $i$ for $G _ { i } > x V _ { \phi } ( s _ { i } )$ , select $x$ so that $p \%$ data in $\boldsymbol { B }$ are selected, let $\mathcal { U }$ be set of selected
|
| 130 |
+
data
|
| 131 |
+
8: for $l = 1 , \ldots , L$ do
|
| 132 |
+
9: sample a minibatch $U$ of data from $\mathcal { U }$
|
| 133 |
+
10: minimize over $\theta$ : $\begin{array} { r } { L ( \theta ) = \sum _ { i = 1 } ^ { | U | } ( \pi _ { \theta } ( s _ { i } ) - a _ { i } ) ^ { 2 } } \end{array}$
|
| 134 |
+
|
| 135 |
+
# 5 EXPERIMENTAL RESULTS
|
| 136 |
+
|
| 137 |
+
We carried out experiments with four of the most challenging environments in the Mujoco benchmark (Todorov et al., 2012) of OpenAI Gym. For the environments Hopper-v2, Walker-v2 and HalfCheetah-v2, we used the “Final Buffer” batch exactly as described in Fujimoto et al. (2018a) to allow for a fair comparison with BCQ. Specifically, we trained DDPG for one million time steps with $\sigma = 0 . 5$ to generate a batch. For the environment Ant-v2, we trained adaptive SAC (Haarnoja et al., 2018b) again for one million time steps to generate a batch.
|
| 138 |
+
|
| 139 |
+
In our experiments, we found that different batches generated with different seeds but with the same algorithm in the same environment can lead to surprisingly different results for batch DRL algorithms. To address this, for each of the environments we generated four batches, giving a total of 16 data sets.
|
| 140 |
+
|
| 141 |
+
Figure 1 provides visualizations of 4 of the 16 upper envelopes, one for each of the 4 environments. In each visualization, the data points in the corresponding batch are ordered according to their upperenvelope values $V ( s _ { i } )$ . With this new ordering, the figure plots $( s _ { i } , G _ { i } )$ for each of the one million data points. The monotonically increasing blue line is the the upper envelope obtained by minimizing $V ( s )$ . Note that in all of the figures, a small fraction of the data points are above upper envelopes due to the finite value of $K = 1 0$ , 000. But also note that the upper envelope mostly hugs the data. The constant black line is the clipping value. The final upper envelope is the minimum of the blue and black lines. All 16 upper envelopes are shown in the appendix.
|
| 142 |
+
|
| 143 |
+

|
| 144 |
+
Figure 1: Five illustrative upper envelopes trained from data with adaptive clipping
|
| 145 |
+
|
| 146 |
+
Figure 2 compares the performance of BAIL, BCQ, Behavioral Cloning (BC), and the final DDPG/SAC policy for the four environments. When training with BCQ, we used the code provided by the authors (Fujimoto et al., 2018a). Because at the time of writing the code for BEAR was not available, we do not compare our results with BEAR (Kumar et al., 2019). Also, all the results presented in this section are for BAIL-border, which we simply refer to as BAIL. In the appendix we provide results for BAIL-TD. The x-axis is the number of parameter updates and the y-axis is the test return averaged over 10 episodes. BAIL, BCQ, and BC are each trained with five seeds. The figure shows the mean and standard deviation confidence intervals for these values. The figure also shows test result of the final-DDPG/SAC policy. This value is obtained by averaging test results from the last 100,000 timesteps (of one million time steps). During this period, test performance of SAC and particularly DDPG can greatly fluctuate with relatively small improvement on average. We calculate the mean and standard deviation of the test results over this period, plot the mean as a straight line, and use the transparent green background to show the confidence intervals. This enables us to fairly compare the performance of the final test policy obtained with the behavioral algorithm with the test policies from the batch algorithms.
|
| 147 |
+
|
| 148 |
+
We make the following observations. For Hopper, Walker and Ant, BAIL always beats BCQ usually by a wide margin. For HalfCheetah, BAIL does better than BCQ for half of the batches. In almost all of the curves, BAIL has a much lower confidence interval than BCQ. Perhaps more importantly, BAIL’s performance is stable over training, whereas BCQ can vary dramatically. (This is a serious issue for batch reinforcement learning, since it cannot interact with the environment to find the best stopping point.) Importantly, BAIL also performs as well or better than the Final-DDPG/SAC policy in all but of the 16 batches. This gives promise that BAIL, or a future variation of BAIL, could also be employed within a growing-batch algorithm.
|
| 149 |
+
|
| 150 |
+
Table 1: Performance comparison at one million samples (mean and std over batches and random seeds). Last column shows percentage improvement of BAIL over BCQ.
|
| 151 |
+
|
| 152 |
+
<table><tr><td>Environment</td><td>Final-DDPG/S AC</td><td>BCQ</td><td>BAIL</td><td>Improvement</td></tr><tr><td>Hopper-v2</td><td>2547.7 ± 750.4</td><td>1468.9 ± 552.6</td><td>2437.5 ± 489.7</td><td>65.9%</td></tr><tr><td>Walker2d-v2</td><td>1742.1 ± 656.3</td><td>2020.2 ± 699.3</td><td>2496.7 ± 409.9</td><td>23.6%</td></tr><tr><td>HalfCheetah-v2</td><td>2612.4±342.2</td><td>2449.7 ± 267.7</td><td>2660.0± 77.7</td><td>8.6%</td></tr><tr><td>Ant-v2</td><td>4506.0 ± 483.6</td><td>4315.6 ± 416.4</td><td>4630.7 ± 310.9</td><td>7.3%</td></tr></table>
|
| 153 |
+
|
| 154 |
+
We also summarize the results in Table 1. For this table, we average the performance of each algorithm over four batches, using the performance values at one million updates. Table 1 shows that BAIL’s performance is better than that of BCQ for all four environments, with a $66 \%$ and $23 \%$ average improvement for Hopper and Walker, respectively. BAIL also beats the Final-DDPG/SAC policies in three of the environments, and has significantly lower variance.
|
| 155 |
+
|
| 156 |
+

|
| 157 |
+
Figure 2: Performance comparison of BAIL, BCQ, BC and Final-DDPG/SAC
|
| 158 |
+
|
| 159 |
+
In the appendix we also provide experimental results for DDPG batches generated with $\sigma = 0 . 1$ , which is similar to the “Concurrent” dataset in Fujimoto et al. (2018a). For this low noise level 0.1, BAIL continues to beat BCQ by a wide margin for Hopper and Walker, and continues to beat Final-DDPG for half of the batches. However, in the low noise case for HalfCheetah, BCQ beats BAIL for 3 of the 4 batches.
|
| 160 |
+
|
| 161 |
+
# 5.1 ABLATION STUDY
|
| 162 |
+
|
| 163 |
+
BAIL uses an upper envelope to select the “best” data points for training a policy network with imitation learning. We have shown that BAIL typcially beats ordinary behavioral cloning and BCQ by a wide margin, and often performs better than the Final-DDPG and Final-SAC policies. But it is natural to ask how BAIL performs when using more naive approaches for selecting the best actions. We consider two naive approaches. The first approach, “Highest Returns,” is to select from the batch the $2 5 \%$ of data points that have the highest $G _ { i }$ values. The second approach, “Recent Data,” is to select the last $2 5 \%$ data points from the batch. Figure (3) shows the results for all four environments. We see that for each environment, the upper envelope approach is the winner for most of the batches: for Hopper, the upper envelope wins for all four batches by a wide margin; for Walker the upper-envelope approach wins by a wide margin for two batches, and ties Highest Returns for two batches; for HalfCheetah, the upper-envelope approach wins for three batches and ties Highest Returns for one batch; and for Ant, the upper-envelope approach wins for three batches and ties the other two approaches for the other batch. We conclude, for the environments and batch generation mechanisms considered in this paper, the upper envelope approach performs significantly better and is more robust than both naive approaches.
|
| 164 |
+
|
| 165 |
+

|
| 166 |
+
Figure 3: Comparison of BAIL scheme with Highest Returns and with Recent Samples schemes. All schemes use $2 5 \%$ of the data in the batch.
|
| 167 |
+
|
| 168 |
+
In the Appendix we provide additional ablation studies. Our experimental results show that modifying the returns to approximate infinite horizon returns is often useful for BAIL’s performance, and that clipping the upper envelope also provides gains although much more modest.
|
| 169 |
+
|
| 170 |
+
In summary, our experimental results show that BAIL achieves state-of-the-art performance, and often beats BCQ by a wide margin. Moreover, BAIL’s performance is stable over training, whereas BCQ typically varies dramatically over training. Finally, BAIL achieves this superior performance with an algorithm that is much simpler than BCQ.
|
| 171 |
+
|
| 172 |
+
# 6 CONCLUSION
|
| 173 |
+
|
| 174 |
+
Although BAIL as described in this paper is simple and gives state-of-the-art performance, there are several directions that could be explored in the future for extending BAIL. One avenue is generating multiple upper envelopes from the same batch, and then ensembling or using a heuristic to pick the upper envelope which we believe would give the best performance. A second avenue is to optimize the policy by modifying the best actions. A third avenue is to assign weights to the state-action pairs when training with imitation learning. And a fourth avenue is to explore designing a growing batch algorithm which uses BAIL as a subroutine for finding a high-performing exploitation policy for each batch iteration.
|
| 175 |
+
|
| 176 |
+
# REFERENCES
|
| 177 |
+
|
| 178 |
+
Josh Achiam. Openai spinning up documentation. https://spinningup.openai.com/ en/latest/index.html. Accessed: 2018-12-20.
|
| 179 |
+
|
| 180 |
+
Rishabh Agarwal, Dale Schuurmans, and Mohammad Norouzi. Striving for simplicity in off-policy deep reinforcement learning. arXiv preprint arXiv:1907.04543, 2019.
|
| 181 |
+
|
| 182 |
+
Brenna D Argall, Sonia Chernova, Manuela Veloso, and Brett Browning. A survey of robot learning from demonstration. Robotics and autonomous systems, 57(5):469–483, 2009.
|
| 183 |
+
|
| 184 |
+
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.
|
| 185 |
+
|
| 186 |
+
Jessica Chemali and Alessandro Lazaric. Direct policy iteration with demonstrations. In TwentyFourth International Joint Conference on Artificial Intelligence, 2015.
|
| 187 |
+
|
| 188 |
+
Ching-An Cheng, Xinyan Yan, Nolan Wagener, and Byron Boots. Fast policy learning through imitation and reinforcement. arXiv preprint arXiv:1805.10413, 2018.
|
| 189 |
+
|
| 190 |
+
Mehrdad Farajtabar, Yinlam Chow, and Mohammad Ghavamzadeh. More robust doubly robust off-policy evaluation. arXiv preprint arXiv:1802.03493, 2018.
|
| 191 |
+
|
| 192 |
+
Scott Fujimoto, David Meger, and Doina Precup. Off-policy deep reinforcement learning without exploration. arXiv preprint arXiv:1812.02900, 2018a.
|
| 193 |
+
|
| 194 |
+
Scott Fujimoto, Herke van Hoof, and Dave Meger. Addressing function approximation error in actor-critic methods. arXiv preprint arXiv:1802.09477, 2018b.
|
| 195 |
+
|
| 196 |
+
Yang Gao, Ji Lin, Fisher Yu, Sergey Levine, Trevor Darrell, et al. Reinforcement learning from imperfect demonstrations. arXiv preprint arXiv:1802.05313, 2018.
|
| 197 |
+
|
| 198 |
+
Arthur Gretton, Karsten M Borgwardt, Malte J Rasch, Bernhard Scholkopf, and Alexander Smola.¨ A kernel two-sample test. Journal of Machine Learning Research, 13(Mar):723–773, 2012.
|
| 199 |
+
|
| 200 |
+
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, 2018a.
|
| 201 |
+
|
| 202 |
+
Tuomas Haarnoja, Aurick Zhou, Kristian Hartikainen, George Tucker, Sehoon Ha, Jie Tan, Vikash Kumar, Henry Zhu, Abhishek Gupta, Pieter Abbeel, et al. Soft actor-critic algorithms and applications. arXiv preprint arXiv:1812.05905, 2018b.
|
| 203 |
+
|
| 204 |
+
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.
|
| 205 |
+
|
| 206 |
+
Jonathan Ho, Jayesh Gupta, and Stefano Ermon. Model-free imitation learning with policy optimization. In International Conference on Machine Learning, pp. 2760–2769, 2016.
|
| 207 |
+
|
| 208 |
+
Ahmed Hussein, Mohamed Medhat Gaber, Eyad Elyan, and Chrisina Jayne. Imitation learning: A survey of learning methods. ACM Computing Surveys (CSUR), 50(2):21, 2017.
|
| 209 |
+
|
| 210 |
+
Alex Irpan, Kanishka Rao, Konstantinos Bousmalis, Chris Harris, Julian Ibarz, and Sergey Levine. Off-policy evaluation via off-policy classification. arXiv preprint arXiv:1906.01624, 2019.
|
| 211 |
+
|
| 212 |
+
Natasha Jaques, Asma Ghandeharioun, Judy Hanwen Shen, Craig Ferguson, Agata Lapedriza, Noah Jones, Shixiang Gu, and Rosalind Picard. Way off-policy batch deep reinforcement learning of implicit human preferences in dialog. arXiv preprint arXiv:1907.00456, 2019.
|
| 213 |
+
|
| 214 |
+
Nan Jiang and Lihong Li. Doubly robust off-policy value evaluation for reinforcement learning. arXiv preprint arXiv:1511.03722, 2015.
|
| 215 |
+
|
| 216 |
+
Beomjoon Kim, Amir-massoud Farahmand, Joelle Pineau, and Doina Precup. Learning from limited demonstrations. In Advances in Neural Information Processing Systems, pp. 2859–2867, 2013.
|
| 217 |
+
|
| 218 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 219 |
+
|
| 220 |
+
Aviral Kumar, Justin Fu, George Tucker, and Sergey Levine. Stabilizing off-policy q-learning via bootstrapping error reduction. arXiv preprint arXiv:1906.00949, 2019.
|
| 221 |
+
|
| 222 |
+
Sascha Lange, Thomas Gabel, and Martin Riedmiller. Batch reinforcement learning. In Reinforcement learning, pp. 45–73. Springer, 2012.
|
| 223 |
+
|
| 224 |
+
Timothy P Lillicrap, Jonathan J Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning. arXiv preprint arXiv:1509.02971, 2015.
|
| 225 |
+
|
| 226 |
+
Bilal Piot, Matthieu Geist, and Olivier Pietquin. Boosted bellman residual minimization handling expert demonstrations. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 549–564. Springer, 2014.
|
| 227 |
+
|
| 228 |
+
Stefan Schaal. Is imitation learning the route to humanoid robots? Trends in cognitive sciences, 3 (6):233–242, 1999.
|
| 229 |
+
|
| 230 |
+
Alex Strehl, John Langford, Lihong Li, and Sham M Kakade. Learning from logged implicit exploration data. In Advances in Neural Information Processing Systems, pp. 2217–2225, 2010.
|
| 231 |
+
|
| 232 |
+
Wen Sun, Arun Venkatraman, Geoffrey J Gordon, Byron Boots, and J Andrew Bagnell. Deeply aggrevated: Differentiable imitation learning for sequential prediction. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 3309–3318. JMLR. org, 2017.
|
| 233 |
+
|
| 234 |
+
Wen Sun, J Andrew Bagnell, and Byron Boots. Truncated horizon policy search: Combining reinforcement learning & imitation learning. arXiv preprint arXiv:1805.11240, 2018.
|
| 235 |
+
|
| 236 |
+
Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, 2018.
|
| 237 |
+
|
| 238 |
+
Adith Swaminathan and Thorsten Joachims. Batch learning from logged bandit feedback through counterfactual risk minimization. Journal of Machine Learning Research, 16(1):1731–1755, 2015.
|
| 239 |
+
|
| 240 |
+
Philip Thomas and Emma Brunskill. Data-efficient off-policy policy evaluation for reinforcement learning. In International Conference on Machine Learning, pp. 2139–2148, 2016.
|
| 241 |
+
|
| 242 |
+
Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In Intelligent Robots and Systems (IROS), 2012 IEEE/RSJ International Conference on, pp. 5026– 5033. IEEE, 2012.
|
| 243 |
+
|
| 244 |
+
Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. ICLR, 2017.
|
| 245 |
+
|
| 246 |
+
# A PROOFS
|
| 247 |
+
|
| 248 |
+
# A. Proof of Theorem 4.1
|
| 249 |
+
|
| 250 |
+
Proof. First, let us consider the case when $\lambda \to + \infty$ . We can re-write the definition of the upper envelope as a constrained optimization problem:
|
| 251 |
+
|
| 252 |
+
$$
|
| 253 |
+
\operatorname* { m i n } _ { \phi } \sum _ { i = 1 } ^ { m } [ V _ { \phi } ( s _ { i } ) - G _ { i } ] ^ { 2 } + \lambda \| \phi \| ^ { 2 }
|
| 254 |
+
$$
|
| 255 |
+
|
| 256 |
+
$$
|
| 257 |
+
s . t . \qquad G _ { i } - V _ { \phi } ( s _ { i } ) \leq 0 , \qquad i = 1 , 2 \dots , m
|
| 258 |
+
$$
|
| 259 |
+
|
| 260 |
+
where $V _ { \phi ^ { * } }$ is the optimal solution to the above optimization problem. We write the Lagrangian function:
|
| 261 |
+
|
| 262 |
+
$$
|
| 263 |
+
L ( \phi , \mu ) = \sum _ { i = 1 } ^ { m } [ V _ { \phi } ( s _ { i } ) - G _ { i } ] ^ { 2 } + \lambda \| \phi \| ^ { 2 } + \sum _ { i = 1 } ^ { m } \mu _ { i } [ G _ { i } - V _ { \phi } ( s _ { i } ) ]
|
| 264 |
+
$$
|
| 265 |
+
|
| 266 |
+
As the optimal solution, $V _ { \phi ^ { * } }$ must satisfy the KKT conditions specified below:
|
| 267 |
+
|
| 268 |
+
$$
|
| 269 |
+
\left\{ \begin{array} { c } { \frac { \mathrm { d } L ( \phi , \mu ) } { \mathrm { d } \phi } | _ { \phi = \phi ^ { * } } = 0 } \\ { \mu _ { i } [ G _ { i } - V _ { \phi ^ { * } } ( s _ { i } ) ] = 0 , i = 1 , 2 , . . . , m } \\ { \mu _ { i } \geq 0 , i = 1 , 2 , . . . , m } \end{array} \right.
|
| 270 |
+
$$
|
| 271 |
+
|
| 272 |
+
Suppose $\phi = ( \phi _ { 1 } , \ldots , \phi _ { n } )$ , by the first KKT condition, we have
|
| 273 |
+
|
| 274 |
+
$$
|
| 275 |
+
\frac { \partial } { \partial \phi _ { j } } \sum _ { i = 1 } ^ { m } [ V _ { \phi } ( s _ { i } ) - G _ { i } ] ^ { 2 } | _ { \phi _ { j } = \phi _ { j } ^ { * } } + 2 \lambda \phi _ { j } ^ { * } + \frac { \partial } { \partial \phi _ { j } } \sum _ { i = 1 } ^ { m } \mu _ { i } [ G _ { i } - V _ { \phi } ( s _ { i } ) ] | _ { \phi _ { j } = \phi _ { j } ^ { * } } = 0 , \qquad j = 1 , 2 , \ldots , n .
|
| 276 |
+
$$
|
| 277 |
+
|
| 278 |
+
So we have:
|
| 279 |
+
|
| 280 |
+
$$
|
| 281 |
+
\nu _ { j } ^ { * } = - \frac { 1 } { 2 \lambda } \frac { \partial } { \partial \phi _ { j } } \sum _ { i = 1 } ^ { m } [ V _ { \phi } ( s _ { i } ) - G _ { i } ] ^ { 2 } | _ { \phi _ { j } = \phi _ { j } ^ { * } } - \frac { 1 } { 2 \lambda } \frac { \partial } { \partial \phi _ { j } } \sum _ { i = 1 } ^ { m } \mu _ { i } [ G _ { i } - V _ { \phi } ( s _ { i } ) ] | _ { \phi _ { j } = \phi _ { j } ^ { * } } , \qquad j = 1 , 2 , \ldots , n .
|
| 282 |
+
$$
|
| 283 |
+
|
| 284 |
+
When $\lambda \infty$ , we have $\phi ^ { * } = 0$ . In this case, it follows that $V _ { \phi ^ { * } } = C$ for some constant $C$ . As $V _ { \phi ^ { * } } ( s _ { i } ) \geq G _ { i }$ , in order to minimize (3) we must have $C = \operatorname* { m a x } \{ G _ { i } , \ i = 1 , 2 , \ldots , m \}$ .
|
| 285 |
+
|
| 286 |
+
For the case of $\lambda = 0$ , notice that we only have finitely many input $s _ { i }$ to be the input of the neural network. Therefore, this is a typical problem regarding the finite-sample expressivity of the neural networks, and the proof directly follows from the work done by Zhang et al. (Zhang et al., 2017).
|
| 287 |
+
|
| 288 |
+
# B. Proof of Theorem 4.2
|
| 289 |
+
|
| 290 |
+
Proof. Let $\phi ^ { * }$ be the optimal value that minimizes $L ( \phi )$ . Let’s proceed by contradiction and assume that there exists some $k$ such that
|
| 291 |
+
|
| 292 |
+
$$
|
| 293 |
+
V _ { \phi ^ { * } } ( s _ { k } ) < G _ { k }
|
| 294 |
+
$$
|
| 295 |
+
|
| 296 |
+
Let $\phi ^ { \prime }$ be an arbitrary given value such that $V _ { \phi ^ { \prime } } ( s _ { i } ) \geq G _ { i }$ for all $i \in \{ 1 , 2 , \dots , m \}$ . Then we have
|
| 297 |
+
|
| 298 |
+
$$
|
| 299 |
+
\begin{array} { c } { { \displaystyle \sum _ { i = 1 } ^ { m } ( V _ { \phi ^ { * } } ( s _ { i } ) - G _ { i } ) ^ { 2 } \mathbb { 1 } _ { ( V _ { \phi ^ { * } } ( s _ { i } ) > G _ { i } ) } + K ( V _ { \phi ^ { * } } ( s _ { k } ) - G _ { k } ) ^ { 2 } + \lambda \| \phi ^ { * } \| ^ { 2 } \leq L ( \phi ^ { * } ) } } \\ { { \displaystyle L ( \phi ^ { * } ) \leq L ( \phi ^ { \prime } ) = \sum _ { i = 1 } ^ { m } ( V _ { \phi ^ { \prime } } ( s _ { i } ) - G _ { i } ) ^ { 2 } + \| \phi ^ { \prime } \| ^ { 2 } } } \end{array}
|
| 300 |
+
$$
|
| 301 |
+
|
| 302 |
+
This implies that
|
| 303 |
+
|
| 304 |
+
$\displaystyle \sum _ { = 1 } ^ { m } ( V _ { \phi ^ { * } } ( s _ { i } ) - G _ { i } ) ^ { 2 } \mathbb { 1 } _ { ( V _ { \phi ^ { * } } ( s _ { i } ) > G _ { i } ) } + K ( V _ { \phi ^ { * } } ( s _ { k } ) - G _ { k } ) ^ { 2 } + \lambda \| \phi ^ { * } \| ^ { 2 } \leq \displaystyle \sum _ { i = 1 } ^ { m } ( V _ { \phi ^ { \prime } } ( s _ { i } ) - G _ { i } ) ^ { 2 } + \| \phi ^ { \prime } \| ^ { 2 }$ i
|
| 305 |
+
which is impossible when $K \infty$ . Therefore, we must have $V _ { \phi ^ { * } } ( s _ { i } ) \geq G _ { i }$ for all $i \in \{ 1 , 2 , \dots , m \}$ as $K \infty$ . In this way, when $K \infty$ , $\phi ^ { * }$ actually minimizes
|
| 306 |
+
|
| 307 |
+
$$
|
| 308 |
+
L ( \phi ) = \sum _ { i = 1 } ^ { m } ( V _ { \phi } ( s _ { i } ) - G _ { i } ) ^ { 2 } + \| \phi \| ^ { 2 }
|
| 309 |
+
$$
|
| 310 |
+
|
| 311 |
+
which completes the proof.
|
| 312 |
+
|
| 313 |
+
# B IMPLEMENTATION DETAILS AND HYPERPARAMETERS
|
| 314 |
+
|
| 315 |
+
B.1 IMPLEMENTATION OF BAIL ALGORITHM
|
| 316 |
+
|
| 317 |
+
Table 2: Upper Envelope Hyperparameters
|
| 318 |
+
|
| 319 |
+
<table><tr><td>Parameter</td><td>Value</td></tr><tr><td></td><td>Adam (Kingma & Ba,2014)</td></tr><tr><td>optimizer learning rate</td><td>3.10-3</td></tr><tr><td>discount (γ)</td><td>0.99</td></tr><tr><td>regularization constant 入</td><td>2.10-2</td></tr><tr><td>K</td><td>10,000</td></tr><tr><td>number of hidden units</td><td>128 ×128</td></tr></table>
|
| 320 |
+
|
| 321 |
+
Table 3: BAIL Hyperparameters
|
| 322 |
+
|
| 323 |
+
<table><tr><td>Parameter</td><td>Value</td></tr><tr><td>data in batch</td><td>106</td></tr><tr><td>optimizer</td><td>Adam (Kingma & Ba,2014)</td></tr><tr><td>learning rate</td><td>10-3</td></tr><tr><td>regularization constant 入</td><td>0</td></tr><tr><td>mini-batch size</td><td>100</td></tr><tr><td>BAIL-border p%</td><td>25%</td></tr><tr><td>BAIL-TD x</td><td>0.96</td></tr><tr><td>number of hidden units</td><td>400 × 300</td></tr></table>
|
| 324 |
+
|
| 325 |
+
# B.2 IMPLEMENTATION OF COMPETING ALGORITHMS
|
| 326 |
+
|
| 327 |
+
For the behavioral DDPG algorithm, we used the implementation of Fujimoto et al. (2018b). For the behavioral SAC algorithm, we implemented it in Pytorch, mainly following the pseudocode provided by (Achiam), and used hyperparameters in Haarnoja et al. (2018b). For the BCQ algorithm, we used the authors’ implementation (Fujimoto et al., 2018a). For behavioral cloning and its variants in the ablation study section, the network structure, learning rate, mini-batch size, and so on are identical to those in Table 3 for BAIL.
|
| 328 |
+
|
| 329 |
+
For the upper envelope network, our network has two hidden layers as does the Q network in BCQ and SAC. However, the number of hidden units in our network is less than those used in BCQ $( 4 0 0 \times 3 0 0 )$ and SAC $( 2 5 6 \times 2 5 6 )$ . In future work we will see if we can obtain further improvements with BAIL using larger networks for the upper envelope.
|
| 330 |
+
|
| 331 |
+
# B.3 CLIPPING HEURISTICS
|
| 332 |
+
|
| 333 |
+
As is shown in Figure 1, in practice the trained upper envelope does not always fit well the data points on the right side of the plots, where the upper envelope can become very large. In that region, the data points with the highest returns will not be selected as “best actions” and therefore not used for imitation learning step. We observe that if we plot the upper envelope values for all the states in the buffer in ascending order as is shown in Figure 1, the upper envelope value $V ( s _ { i } )$ starts to deviate from the Monte Carlo return $G _ { i }$ at a point where $V ( s _ { i } ) \approx \operatorname* { m a x } \{ G _ { i } \}$ . We therefore use the following heuristic. We say that the upper envelope value begins to deviate from the Monte Carlo return at state $s _ { i }$ if $V ( s _ { j } ) > G _ { j }$ for $i \leq j < i + 1 0 0 0 0$ . We set the clipping value $C = V ( s ^ { \prime } )$ where $s ^ { \prime }$ is the starting point of this deviation. Then the actual UE values used to select data is $\operatorname* { m i n } \{ V ( s ) , C \}$ . In practice, the clipping heuristic gives a small boost in performance as is shown in Figure 5.
|
| 334 |
+
|
| 335 |
+
# C ADDITIONAL EXPERIMENTAL RESULTS
|
| 336 |
+
|
| 337 |
+
# C.1 EXPERIMENTS ON BAIL-TD
|
| 338 |
+
|
| 339 |
+
We present some of the experimental results for BAIL-TD in this subsection. Figure 4 shows that the performance of BAIL-TD is similar to the performance of naive Behavioral Cloning in Hopperv2 and Walker2d-v2 environments. The result implies that the BAIL-TD approach is limited in the ability to distinguish between good data points and the bad ones. This is possibly due to the inaccuracy of the trained upper envelope. Recall that in BAIL-TD algorithm, we select state action pairs based on the difference between the values of $r + V ( s _ { i } ^ { \prime } )$ and $V ( s _ { i } )$ . Since we only use one-step Monte Carlo return, and the value of $r$ is very small compared with the value of $v ( s _ { i } )$ , the selection is very sensitive to the accuracy of $V ( s _ { i } )$ .
|
| 340 |
+
|
| 341 |
+

|
| 342 |
+
Figure 4: Performance comparison of BAIL-border, BAIL-TD, BCQ, BC and Behavioral Policy (DDPG)
|
| 343 |
+
|
| 344 |
+
# C.2 ABLATION STUDY FOR BAIL
|
| 345 |
+
|
| 346 |
+
We do additional ablation studies for BAIL, where we focus on two heuristic features in the BAIL algorithm: clipping of upper envelope, and return augmentation to approximate non-episodic continuous tasks. We removed each of these features one at a time from the BAIL algorithm and compare with the original BAIL algorithm. Each performance curve is again averaged over 5 independent runs.
|
| 347 |
+
|
| 348 |
+

|
| 349 |
+
Figure 5: Ablation of BAIL without Upper Envelope clipping
|
| 350 |
+
|
| 351 |
+
We found that clipping often, but not always, gives a small boost in performance. As for return augmentation, we found it does not harm the performance of BAIL, and sometimes gives a considerable improvement, particularly for Hopper.
|
| 352 |
+
|
| 353 |
+

|
| 354 |
+
Figure 6: Ablation of BAIL without return augmentation
|
| 355 |
+
|
| 356 |
+
# C.3 BAIL FOR LOW NOISE-LEVEL DATA
|
| 357 |
+
|
| 358 |
+
In the main body of the paper we present BAIL in the ”Final Buffer” case as described in Fujimoto et al. (2018a), where the exploration noise $\sigma = 0 . 5$ added to behavior policy is relatively large. In this section we examine the performance of BAIL in a low-noise scenario. To this end, we set $\sigma = 0 . 1$ and do a similar experiments as were done $\sigma = 0 . 5$ for the Hopper, Walker and HalfCheetah environments. (Recall that for Ant we used adaptive SAC, which does not have an explicit noise parameter.)
|
| 359 |
+
|
| 360 |
+
The results are shown in Figure 7. We see that even in this low-noise scenario, BAIL out-performs BCQ by a wide margin for Hopper and Walker, and BAIL continues to out-perform the Final-DDPG policy in most batches. For HalfCheetah, where the Final-DDPG policy gives greatly different results depending on the batch, BAIL’s performance is stable and typically near that of the of FinalDDPG policy. After sufficient training, however, BCQ can often do better than the Final-DDPG policy in this environment.
|
| 361 |
+
|
| 362 |
+

|
| 363 |
+
Figure 7: Performance comparison of BAIL, BCQ, BC and Final-DDPG with noise level $\sigma = 0 . 1$
|
| 364 |
+
|
| 365 |
+
# C.4 VISUALIZATION OF UPPER ENVELOPES USED
|
| 366 |
+
|
| 367 |
+
In this section we present the upper envelopes used in the training of BAIL in Figure 2.
|
| 368 |
+
|
| 369 |
+

|
| 370 |
+
Figure 8: Upper Envelopes of BAIL (DDPG data)
|
| 371 |
+
|
| 372 |
+

|
| 373 |
+
Figure 9: Upper Envelopes of BAIL (SAC data)
|
md/train/BkUHlMZ0b/BkUHlMZ0b.md
ADDED
|
@@ -0,0 +1,393 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# EVALUATING THE ROBUSTNESS OF NEURAL NETWORKS: AN EXTREME VALUE THEORY APPROACH
|
| 2 |
+
|
| 3 |
+
Tsui-Wei Weng1∗, Huan Zhang2∗, Pin-Yu Chen3, Jinfeng $\mathbf { Y _ { i } ^ { * } }$ , Dong $\mathbf { S } \mathbf { u } ^ { 3 }$ , Yupeng $\mathbf { G a o } ^ { 3 }$ , Cho-Jui Hsieh2, Luca Daniel1
|
| 4 |
+
|
| 5 |
+
1Massachusetts Institute of Technology, Cambridge, MA 02139
|
| 6 |
+
2University of California, Davis, CA 95616
|
| 7 |
+
3IBM Research AI, Yorktown Heights, NY 10598
|
| 8 |
+
4Tencent AI Lab, Bellevue, WA 98004
|
| 9 |
+
twweng@mit.edu, ecezhang@ucdavis.edu,
|
| 10 |
+
pin-yu.chen@ibm.com, jinfengyi.ustc@gmail.com,
|
| 11 |
+
{dong.su,yupeng.gao}@ibm.com, chohsieh@ucdavis.edu, dluca@mit.edu
|
| 12 |
+
|
| 13 |
+
# ABSTRACT
|
| 14 |
+
|
| 15 |
+
The robustness of neural networks to adversarial examples has received great attention due to security implications. Despite various attack approaches to crafting visually imperceptible adversarial examples, little has been developed towards a comprehensive measure of robustness. In this paper, we provide a theoretical justification for converting robustness analysis into a local Lipschitz constant estimation problem, and propose to use the Extreme Value Theory for efficient evaluation. Our analysis yields a novel robustness metric called CLEVER, which is short for Cross Lipschitz Extreme Value for nEtwork Robustness. The proposed CLEVER score is attack-agnostic and computationally feasible for large neural networks. Experimental results on various networks, including ResNet, Inceptionv3 and MobileNet, show that (i) CLEVER is aligned with the robustness indication measured by the $\ell _ { 2 }$ and $\ell _ { \infty }$ norms of adversarial examples from powerful attacks, and (ii) defended networks using defensive distillation or bounded ReLU indeed achieve better CLEVER scores. To the best of our knowledge, CLEVER is the first attack-independent robustness metric that can be applied to any neural network classifier.
|
| 16 |
+
|
| 17 |
+
# 1 INTRODUCTION
|
| 18 |
+
|
| 19 |
+
Recent studies have highlighted the lack of robustness in state-of-the-art neural network models, e.g., a visually imperceptible adversarial image can be easily crafted to mislead a well-trained network (Szegedy et al., 2013; Goodfellow et al., 2015; Chen et al., 2017a). Even worse, researchers have identified that these adversarial examples are not only valid in the digital space but also plausible in the physical world (Kurakin et al., 2016a; Evtimov et al., 2017). The vulnerability to adversarial examples calls into question safety-critical applications and services deployed by neural networks, including autonomous driving systems and malware detection protocols, among others.
|
| 20 |
+
|
| 21 |
+
In the literature, studying adversarial examples of neural networks has twofold purposes: (i) security implications: devising effective attack algorithms for crafting adversarial examples, and (ii) robustness analysis: evaluating the intrinsic model robustness to adversarial perturbations to normal examples. Although in principle the means of tackling these two problems are expected to be independent, that is, the evaluation of a neural network’s intrinsic robustness should be agnostic to attack methods, and vice versa, existing approaches extensively use different attack results as a measure of robustness of a target neural network. Specifically, given a set of normal examples, the attack success rate and distortion of the corresponding adversarial examples crafted from a particular attack algorithm are treated as robustness metrics. Consequently, the network robustness is entangled with the attack algorithms used for evaluation and the analysis is limited by the attack capabilities. More importantly, the dependency between robustness evaluation and attack approaches can cause biased analysis. For example, adversarial training is a commonly used technique for improving the robustness of a neural network, accomplished by generating adversarial examples and retraining the network with corrected labels. However, while such an adversarially trained network is made robust to attacks used to craft adversarial examples for training, it can still be vulnerable to unseen attacks.
|
| 22 |
+
|
| 23 |
+
Motivated by the evaluation criterion for assessing the quality of text and image generation that is completely independent of the underlying generative processes, such as the BLEU score for texts (Papineni et al., 2002) and the INCEPTION score for images (Salimans et al., 2016), we aim to propose a comprehensive and attack-agnostic robustness metric for neural networks. Stemming from a perturbation analysis of an arbitrary neural network classifier, we derive a universal lower bound on the minimal distortion required to craft an adversarial example from an original one, where the lower bound applies to any attack algorithm and any $\ell _ { p }$ norm for $p \geq 1$ . We show that this lower bound associates with the maximum norm of the local gradients with respect to the original example, and therefore robustness evaluation becomes a local Lipschitz constant estimation problem. To efficiently and reliably estimate the local Lipschitz constant, we propose to use extreme value theory (De Haan & Ferreira, 2007) for robustness evaluation. In this context, the extreme value corresponds to the local Lipschitz constant of our interest, which can be inferred by a set of independently and identically sampled local gradients.With the aid of extreme value theory, we propose a robustness metric called CLEVER, which is short for Cross Lipschitz Extreme Value for nEtwork Robustness. We note that CLEVER is an attack-independent robustness metric that applies to any neural network classifier. In contrast, the robustness metric proposed in Hein & Andriushchenko (2017), albeit attack-agnostic, only applies to a neural network classifier with one hidden layer.
|
| 24 |
+
|
| 25 |
+
We highlight the main contributions of this paper as follows:
|
| 26 |
+
|
| 27 |
+
We propose a novel robustness metric called CLEVER, which is short for Cross Lipschitz Extreme Value for nEtwork Robustness. To the best of our knowledge, CLEVER is the first robustness metric that is attack-independent and can be applied to any arbitrary neural network classifier and scales to large networks for ImageNet. The proposed CLEVER score is well supported by our theoretical analysis on formal robustness guarantees and the use of extreme value theory. Our robustness analysis extends the results in Hein & Andriushchenko (2017) from continuously differentiable functions to a special class of non-differentiable functions – neural+ networks with ReLU activations. We corroborate the effectiveness of CLEVER by conducting experiments on state-of-theart models for ImageNet, including ResNet (He et al., 2016), Inception-v3 (Szegedy et al., 2016) and MobileNet (Howard et al., 2017). We also use CLEVER to investigate defended networks against adversarial examples, including the use of defensive distillation (Papernot et al., 2016) and bounded ReLU (Zantedeschi et al., 2017). Experimental results show that our CLEVER score well aligns with the attack-specific robustness indicated by the $\ell _ { 2 }$ and $\ell _ { \infty }$ distortions of adversarial examples.
|
| 28 |
+
|
| 29 |
+
# 2 BACKGROUND AND RELATED WORK
|
| 30 |
+
|
| 31 |
+
# 2.1 ATTACKING NEURAL NETWORKS USING ADVERSARIAL EXAMPLES
|
| 32 |
+
|
| 33 |
+
One of the most popular formulations found in literature for crafting adversarial examples to mislead a neural network is to formulate it as a minimization problem, where the variable $\pmb { \delta } \in \mathbb { R } ^ { d }$ to be optimized refers to the perturbation to the original example, and the objective function takes into account unsuccessful adversarial perturbations as well as a specific norm on $\delta$ for assuring similarity. For instance, the success of adversarial examples can be evaluated by their cross-entropy loss (Szegedy et al., 2013; Goodfellow et al., 2015) or model prediction (Carlini & Wagner, 2017b). The norm constraint on $\delta$ can be implemented in a clipping manner (Kurakin et al., 2016b) or treated as a penalty for any (Carlini & Wagner, 2017b). The , is often used for crafting adve $\ell _ { p }$ norm of rial exa $\pmb { \delta }$ , defined as ples. In pa $\begin{array} { r } { \| \pmb { \delta } \| _ { p } = ( \sum _ { i = 1 } ^ { d } | \pmb { \delta } _ { i } | ^ { p } ) ^ { 1 / p } } \end{array}$ $p \geq 1$ $p ~ = ~ \infty$ $\lVert \delta \rVert _ { \infty } = \mathrm { m a x } _ { i \in \{ 1 , \ldots , d \} } | \delta _ { i } |$ measures the maximal variation among all dimensions in $\delta$ . When $p = 2$ , $\lVert \delta \rVert _ { 2 }$ becomes the Euclidean norm of $\pmb { \delta }$ . When $p = 1$ , $\begin{array} { r } { \| \pmb { \delta } \| _ { 1 } = \sum _ { i = 1 } ^ { p } | \pmb { \delta } _ { i } | } \end{array}$ measures the total variation of $\delta$ . The state-of-the-art attack methods for $\ell _ { \infty }$ , $\ell _ { 2 }$ and $\ell _ { 1 }$ norms are the iterative fast gradient sign method (I-FGSM) (Goodfellow et al., 2015; Kurakin et al., 2016b), Carlini and Wagner’s attack (CW attack) (Carlini & Wagner, 2017b), and elastic-net attacks to deep neural networks (EAD) (Chen et al., 2017b), respectively. These attacks fall into the category of white-box attacks since the network model is assumed to be transparent to an attacker. Adversarial examples can also be crafted from a black-box network model using an ensemble approach (Liu et al., 2016), training a substitute model (Papernot et al., 2017), or employing zeroth-order optimization based attacks (Chen et al., 2017c).
|
| 34 |
+
|
| 35 |
+
# 2.2 EXISTING DEFENSE METHODS
|
| 36 |
+
|
| 37 |
+
Since the discovery of vulnerability to adversarial examples (Szegedy et al., 2013), various defense methods have been proposed to improve the robustness of neural networks. The rationale for defense is to make a neural network more resilient to adversarial perturbations, while ensuring the resulting defended model still attains similar test accuracy as the original undefended network. Papernot et al. proposed defensive distillation (Papernot et al., 2016), which uses the distillation technique (Hinton et al., 2015) and a modified softmax function at the final layer to retrain the network parameters with the prediction probabilities (i.e., soft labels) from the original network. Zantedeschi et al. (2017) showed that by changing the ReLU function to a bounded ReLU function, a neural network can be made more resilient. Another popular defense approach is adversarial training, which generates and augments adversarial examples with the original training data during the network training stage. On MNIST, the adversarially trained model proposed by Madry et al. (2017) can successfully defend a majority of adversarial examples at the price of increased network capacity. Model ensemble has also been discussed to increase the robustness to adversarial examples (Tramer et al. \` , 2017; Liu et al., 2017). In addition, detection methods such as feature squeezing (Xu et al., 2017) and example reforming (Meng & Chen, 2017) can also be used to identify adversarial examples. However, the CW attack is shown to be able to bypass 10 different detection methods (Carlini & Wagner, 2017a). In this paper, we focus on evaluating the intrinsic robustness of a neural network model to adversarial examples. The effect of detection methods is beyond our scope.
|
| 38 |
+
|
| 39 |
+
# 2.3 THEORETICAL ROBUSTNESS GUARANTEES FOR NEURAL NETWORKS
|
| 40 |
+
|
| 41 |
+
Szegedy et al. (2013) compute global Lipschitz constant for each layer and use their product to explain the robustness issue in neural networks, but the global Lipschitz constant often gives a very loose bound. Hein & Andriushchenko (2017) gave a robustness lower bound using a local Lipschitz continuous condition and derived a closed-form bound for a multi-layer perceptron (MLP) with a single hidden layer and softplus activation. Nevertheless, a closed-form bound is hard to derive for a neural network with more than one hidden layer. Wang et al. (2016) utilized terminologies from topology to study robustness. However, no robustness bounds or estimates were provided for neural networks. On the other hand, works done by Ehlers (2017); Katz et al. (2017a;b); Huang et al. (2017) focus on formally verifying the viability of certain properties in neural networks for any possible input, and transform this formal verification problem into satisfiability modulo theory (SMT) and large-scale linear programming (LP) problems. These SMT or LP based approaches have high computational complexity and are only plausible for very small networks.
|
| 42 |
+
|
| 43 |
+
Intuitively, we can use the distortion of adversarial examples found by a certain attack algorithm as a robustness metric. For example, Bastani et al. (2016) proposed a linear programming (LP) formulation to find adversarial examples and use the distortions as the robustness metric. They observe that the LP formulation can find adversarial examples with smaller distortions than other gradient-based attacks like L-BFGS (Szegedy et al., 2013). However, the distortion found by these algorithms is an upper bound of the true minimum distortion and depends on specific attack algorithms. These methods differ from our proposed robustness measure CLEVER, because CLEVER is an estimation of the lower bound of the minimum distortion and is independent of attack algorithms. Additionally, unlike LP-based approaches which are impractical for large networks, CLEVER is computationally feasible for large networks like Inception-v3. The concept of minimum distortion and upper/lower bound will be formally defined in Section 3.
|
| 44 |
+
|
| 45 |
+
# 3 ANALYSIS OF FORMAL ROBUSTNESS GUARANTEES FOR A CLASSIFIER
|
| 46 |
+
|
| 47 |
+
In this section, we provide formal robustness guarantees of a classifier in Theorem 3.2. Our robustness guarantees are general since they only require a mild assumption on Lipschitz continuity of the classification function. For differentiable classification functions, our results are consistent with the main theorem in (Hein & Andriushchenko, 2017) but are obtained by a much simpler and more intuitive manner1. Furthermore, our robustness analysis can be easily extended to non-differentiable classification functions (e.g. neural networks with ReLU) as in Lemma 3.3, whereas the analysis in Hein & Andriushchenko (2017) is restricted to differentiable functions. Specifically, Corollary 3.2.1 shows that the robustness analysis in (Hein & Andriushchenko, 2017) is in fact a special case of our analysis. We start our analysis by defining the notion of adversarial examples, minimum $\ell _ { p }$ distortions, and lower/upper bounds. All the notations are summarized in Table 1.
|
| 48 |
+
|
| 49 |
+
Table 1: Table of Notation
|
| 50 |
+
|
| 51 |
+
<table><tr><td>Notation d δ∈Rd p</td><td>Definition dimensionality of the input vector number of output classes</td><td>Notation △p,min</td><td>Definition minimum lp distortion of xo lower bound of minimum distortion</td></tr><tr><td>K f:Rd→RK</td><td>adversarial example distortion := xa -xo Bp(xo,R)</td><td>βL</td><td></td></tr><tr><td>xo∈Rd x∈Rd</td><td>neural network classifier original input vector</td><td>βu L</td><td>upper bound of minimum distortion Lipschitz constant local Lipschitz constant</td></tr></table>
|
| 52 |
+
|
| 53 |
+
Definition 3.1 (perturbed example and adversarial example). Let $\pmb { x _ { 0 } } ~ \in ~ \mathbb { R } ^ { d }$ be an input vector of a $K$ -class classification function $f ~ : ~ \mathbb { R } ^ { d } ~ \to ~ \mathbb { R } ^ { K }$ and the prediction is given as $c ( \pmb { x _ { 0 } } ) \ =$ $\operatorname { a r g m a x } _ { 1 \leq i \leq K } f _ { i } ( { \pmb x } _ { 0 } )$ . Given $\scriptstyle { \mathbf { x _ { 0 } } }$ , we say $\scriptstyle { \mathbf { { \mathit { x } } } } _ { a }$ is a perturbed example of $\scriptstyle { \mathbf { { \vec { x } } } } _ { \mathbf { 0 } }$ with noise $\pmb { \delta } \in \mathbb { R } ^ { d }$ and $\ell _ { p }$ -distortion $\Delta _ { p }$ if ${ \pmb x } _ { \pmb a } = { \pmb x } _ { \mathbf 0 } + \delta$ and $\Delta _ { p } = \| \delta \| _ { p }$ . An adversarial example is a perturbed example $\scriptstyle { \mathbf { { \mathit { x } } } } _ { a }$ that changes $c ( \pmb { x _ { 0 } } )$ . A successful untargeted attack is to find a $\scriptstyle { \mathbf { { \mathit { x } } } } _ { a }$ such that $c ( \pmb { x _ { a } } ) \neq c ( \pmb { x _ { 0 } } )$ while a successful targeted attack is to find a $\scriptstyle { \mathbf { { \mathit { x } } } } _ { a }$ such that $c ( { \pmb x } _ { \pmb a } ) = t$ given a target class $t \neq c ( \pmb { x _ { 0 } } )$ .
|
| 54 |
+
|
| 55 |
+
Definition 3.2 (minimum adversarial distortion $\Delta _ { p , \mathrm { { m i n } } } ,$ ). Given an input vector $\scriptstyle { \mathbf { { \vec { x } } } } _ { \mathbf { 0 } }$ of a classifier $f$ , the minimum $\ell _ { p }$ adversarial distortion of $\scriptstyle { \mathbf { x _ { 0 } } }$ , denoted as $\Delta _ { p , \mathrm { { m i n } } }$ , is defined as the smallest $\Delta _ { p }$ over all adversarial examples of $\scriptstyle { \mathbf { x _ { 0 } } }$ .
|
| 56 |
+
|
| 57 |
+
Definition 3.3 (lower bound of $\Delta _ { p , \mathrm { { m i n } } } ,$ ). Suppose $\Delta _ { p , \mathrm { { m i n } } }$ is the minimum adversarial distortion of $\scriptstyle { \mathbf { x _ { 0 } } }$ . A lower bound of $\Delta _ { p , \mathrm { { m i n } } }$ , denoted by $\beta _ { L }$ where $\beta _ { L } \le \Delta _ { p , \mathrm { { m i n } } }$ , is defined such that any perturbed examples of $\scriptstyle { \mathbf { { \vec { x } } } } _ { \mathbf { 0 } }$ with $\| \pmb { \delta } \| _ { p } \leq \beta _ { L }$ are not adversarial examples.
|
| 58 |
+
|
| 59 |
+
Definition 3.4 (upper bound of $\Delta _ { p , \mathrm { { m i n } } } .$ ). Suppose $\Delta _ { p , \mathrm { { m i n } } }$ is the minimum adversarial distortion of $\scriptstyle { \mathbf { x _ { 0 } } }$ . An upper bound of $\Delta _ { p , \mathrm { { m i n } } }$ , denoted by $\beta _ { U }$ where $\dot { \beta } _ { U } \ge \Delta _ { p , \mathrm { { m i n } } }$ , is defined such that there exists an adversarial example of $\scriptstyle { \mathbf { { \mathit { x } } } } _ { \mathbf { 0 } }$ with $\| \delta \| _ { p } \ge \beta _ { U }$ .
|
| 60 |
+
|
| 61 |
+
The lower and upper bounds are instance-specific because they depend on the input $\scriptstyle { \mathbf { { \mathit { x } } } } _ { \mathbf { 0 } }$ . While $\beta _ { U }$ can be easily given by finding an adversarial example of $\scriptstyle { \mathbf { x _ { 0 } } }$ using any attack method, $\beta _ { L }$ is not easy to find. $\beta _ { L }$ guarantees that the classifier is robust to any perturbations with $\| \delta \| _ { p } \le \beta _ { L }$ , certifying the robustness of the classifier. Below we show how to derive a formal robustness guarantee of a classifier with Lipschitz continuity assumption. Specifically, our analysis obtains a lower bound of $\ell _ { p }$ minimum adversarial distortion $\begin{array} { r } { \beta _ { L } = \operatorname* { m i n } _ { j \neq c } \frac { \bar { f } _ { c } ( \pmb { x _ { 0 } } ) - f _ { j } \bar { ( \pmb { x _ { 0 } } ) } } { L _ { q } ^ { j } } } \end{array}$ .
|
| 62 |
+
|
| 63 |
+
Lemma 3.1 (Lipschitz continuity and its relationship with gradient norm (Paulavicius & ˇ Zilinskas ˇ , 2006)). Let $\dot { S } \subset \mathbb { R } ^ { d }$ be a convex bounded closed set and let $h ( \pmb { x } ) : S \mathbb { R }$ be a continuously differentiable function on an open set containing $S$ . Then, $h ( { \pmb x } )$ is a Lipschitz function with Lipschitz constant $L _ { q }$ if the following inequality holds for any $\mathbf { \Delta } _ { \pmb { x } , \pmb { y } } \in S$ :
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
| h ( \pmb { x } ) - h ( \pmb { y } ) | \leq L _ { q } \| \pmb { x } - \pmb { y } \| _ { p } ,
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where $\begin{array} { r } { L _ { q } = \operatorname* { m a x } \{ \| \nabla h ( \pmb { x } ) \| _ { q } : \pmb { x } \in S \} , \nabla h ( \pmb { x } ) = ( \frac { \partial h ( \pmb { x } ) } { \partial x _ { 1 } } , \cdot \cdot \cdot , \frac { \partial h ( \pmb { x } ) } { \partial x _ { d } } ) ^ { \top } \ \xi } \end{array}$ , ∂h(x) )> is the gradient of h(x), and $\begin{array} { r } { \frac { 1 } { p } + \frac { 1 } { q } = 1 , 1 \leq p , q \leq \infty } \end{array}$ .
|
| 70 |
+
|
| 71 |
+
Given Lemma 3.1, we then provide a formal guarantee to the lower bound $\beta _ { L }$ .
|
| 72 |
+
|
| 73 |
+
Theorem 3.2 (Formal guarantee on lower bound $\beta _ { L }$ for untargeted attack). Let $\pmb { x _ { 0 } } ~ \in ~ \mathbb { R } ^ { d }$ and $f : \mathbb { R } ^ { d } \mathbb { R } ^ { K }$ be a multi-class classifier with continuously differentiable components $f _ { i }$ and let $c = \operatorname { a r g m a x } _ { 1 \leq i \leq K } f _ { i } ( \pmb { x _ { 0 } } )$ be the class which $f$ predicts for $\scriptstyle { \mathbf { x _ { 0 } } }$ . For all $\pmb { \delta } \in \mathbb { R } ^ { d }$ with
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\| \pmb { \delta } \| _ { p } \leq \operatorname* { m i n } _ { j \neq c } \frac { f _ { c } ( \pmb { x _ { 0 } } ) - f _ { j } ( \pmb { x _ { 0 } } ) } { L _ { q } ^ { j } } ,
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
$\operatorname { a r g m a x } _ { 1 \leq i \leq K } f _ { i } ( x _ { 0 } + \delta ) = c$ holds with $\textstyle { \frac { 1 } { p } } + { \frac { 1 } { q } } = 1 , 1 \leq p , q \leq \infty$ and $L _ { q } ^ { j }$ is the Lipschitz constant for the function $f _ { c } ( { \pmb x } ) - f _ { j } ( { \pmb x } )$ in $\ell _ { p }$ norm. In other words, $\begin{array} { r } { \beta _ { L } = \operatorname* { m i n } _ { j \neq c } \frac { f _ { c } ( \pmb { x _ { 0 } } ) - f _ { j } ( \pmb { x _ { 0 } } ) } { L _ { q } ^ { j } } } \end{array}$ fc(x0)−fj (x0) is a lower bound of minimum distortion.
|
| 80 |
+
|
| 81 |
+
The intuitions behind Theorem 3.2 is shown in Figure 1 with an one-dimensional example. The function value $g ( x ) = f _ { c } ( x ) - f _ { j } ( x )$ near point $x _ { 0 }$ is inside a double cone formed by two lines passing $( x _ { 0 } , g ( x _ { 0 } ) )$ and with slopes equal to $\pm L _ { q }$ , where $L _ { q }$ is the (local) Lipschitz constant of $g ( x )$ near $x _ { 0 }$ . In other words, the function value of $g ( x )$ around $x _ { 0 }$ , i.e. $g ( x _ { 0 } + \delta )$ can be bounded by $g ( x _ { 0 } )$ , $\delta$ and the Lipschitz constant $L _ { q }$ . When $g ( x _ { 0 } + \delta )$ is decreased to 0, an adversarial example is found and the minimal change of $\delta$ is $\frac { g ( x _ { 0 } ) } { L _ { q } }$ . The complete proof is deferred to Appendix A.
|
| 82 |
+
|
| 83 |
+

|
| 84 |
+
Figure 1: Intuitions behind Theorem 3.2.
|
| 85 |
+
|
| 86 |
+
Remark 1. $L _ { q } ^ { j }$ is the Lipschitz constant of the function involving cross terms: $f _ { c } ( { \pmb x } ) - f _ { j } ( { \pmb x } )$ , hence we also call it cross Lipschitz constant following (Hein & Andriushchenko, 2017).
|
| 87 |
+
|
| 88 |
+
To distinguish our analysis from (Hein & Andriushchenko, 2017), we show in Corollary 3.2.1 that we can obtain the same result in (Hein & Andriushchenko, 2017) by Theorem 3.2. In fact, the analysis in (Hein & Andriushchenko, 2017) is a special case of our analysis because the authors implicitly assume Lipschitz continuity on $f _ { i } ( { \pmb x } )$ when requiring $f _ { i } ( { \pmb x } )$ to be continuously differentiable. They use local Lipschitz constant $( L _ { q , x _ { 0 } } )$ instead of global Lipschitz constant $( L _ { q } )$ to obtain a tighter bound in the adversarial perturbation $\delta$ .
|
| 89 |
+
|
| 90 |
+
Corollary 3.2.1 (Formal guarantee on $\beta _ { L }$ for untargeted attack). 2 Let $L _ { q , x _ { 0 } } ^ { j }$ be local Lipschitz constant of function $f _ { c } ( { \pmb x } ) - f _ { j } ( { \pmb x } )$ at $\scriptstyle { \mathbf { { \mathit { x } } } } _ { \mathbf { 0 } }$ over some fixed ball $B _ { p } ( \pmb { x _ { 0 } } , R ) : = \{ \pmb { x } \in \mathbb { R } ^ { d } \ | \ \| \pmb { x } - \pmb { x _ { 0 } } \| _ { p } \ \leq$ $R \}$ and let $\pmb { \delta } \in B _ { p } ( \mathbf { 0 } , R )$ . By Theorem 3.2, we obtain the bound in (Hein & Andriushchenko, 2017):
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
\| \pmb { \delta } \| _ { p } \leq \operatorname* { m i n } \bigg \{ \operatorname* { m i n } _ { j \neq c } \frac { f _ { c } ( \pmb { x _ { 0 } } ) - f _ { j } ( \pmb { x _ { 0 } } ) } { L _ { q , x _ { 0 } } ^ { j } } , R \bigg \} .
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
An important use case of Theorem 3.2 and Corollary 3.2.1 is the bound for targeted attack:
|
| 97 |
+
|
| 98 |
+
Corollary 3.2.2 (Formal guarantee on $\beta _ { L }$ for targeted attack). Assume the same notation as in Theorem 3.2 and Corollary 3.2.1. For a specified target class $j$ , we have $\begin{array} { r l } { \| \delta \| _ { p } } & { { } \leq } \end{array}$ $\begin{array} { r } { \operatorname* { m i n } \left\{ \frac { f _ { c } ( \pmb { x _ { 0 } } ) - f _ { j } ( \pmb { x _ { 0 } } ) } { L _ { q , x _ { 0 } } ^ { j } } , R \right\} } \end{array}$
|
| 99 |
+
|
| 100 |
+
In addition, we further extend Theorem 3.2 to a special case of non-differentiable functions – neural networks with ReLU activations. In this case the Lipchitz constant used in Lemma 3.1 can be replaced by the maximum norm of directional derivative, and our analysis above will go through.
|
| 101 |
+
|
| 102 |
+
Lemma 3.3 (Formal guarantee on $\beta _ { L }$ for ReLU networks). 3 Let $h ( \cdot )$ be a $l$ -layer ReLU neural network with $W _ { i }$ as the weights for layer $i$ . We ignore bias terms as they don’t contribute to gradient.
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
h ( \pmb { x } ) = \sigma ( W _ { l } \sigma ( W _ { l - 1 } \dots \sigma ( W _ { 1 } \pmb { x } ) ) )
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
where $\sigma ( u ) = \operatorname* { m a x } ( 0 , u )$ . Let $S \subset \mathbb { R } ^ { d }$ be a convex bounded closed set, then equation (1) holds with $\begin{array} { r } { L _ { q } = \operatorname* { s u p } _ { \pmb { x } \in S } \{ | \operatorname* { s u p } _ { \| \pmb { d } \| _ { p } = 1 } D ^ { + } h ( \pmb { x } ; \pmb { d } ) | \} } \end{array}$ where $\begin{array} { r } { D ^ { + } h ( { \pmb x } ; { \pmb d } ) : = \operatorname* { l i m } _ { t 0 ^ { + } } \frac { h ( { \pmb x } + t { \pmb d } ) - h ( { \pmb x } ) } { t } } \end{array}$ h(x+td)−h(x) is the one-sided directional direvative, then Theorem 3.2, Corollary 3.2.1 and Corollary 3.2.2 still hold.
|
| 109 |
+
|
| 110 |
+
# 4 THE CLEVER ROBUSTNESS METRIC VIA EXTREME VALUE THEORY
|
| 111 |
+
|
| 112 |
+
In this section, we provide an algorithm to compute the robustness metric CLEVER with the aid of extreme value theory, where CLEVER can be viewed as an efficient estimator of the lower bound $\beta _ { L }$ and is the first attack-agnostic score that applies to any neural network classifiers. Recall in Section 3 we show that the lower bound of network robustness is associated with $g ( x _ { 0 } )$ and its cross Lipschitz constant $L _ { q , x _ { 0 } } ^ { j }$ , where $g ( \pmb { x _ { 0 } } ) = f _ { c } ( \pmb { x _ { 0 } } ) - f _ { j } ( \pmb { x _ { 0 } } )$ is readily available at the output of a classifier and $L _ { q , x _ { 0 } } ^ { j }$ is defined as $\mathrm { m a x } _ { \pmb { x } \in B _ { p } ( { \pmb x } _ { 0 } , R ) } \| \nabla g ( { \pmb x } ) \| _ { q }$ . Although $\nabla g ( { \pmb x } )$ can be calculated easily via back propagation, computing $L _ { q , x _ { 0 } } ^ { j }$ is more involved because it requires to obtain the maximum value of $\| \nabla g ( \pmb { x } ) \| _ { q }$ in a ball. Exhaustive search on low dimensional $_ { \textbf { \em x } }$ in $B _ { p } ( { \pmb x } _ { 0 } , R )$ seems already infeasible, not to mention the image classifiers with large feature dimensions of our interest. For instance, the feature dimension $d = 7 8 4 , 3 0 7 2 , 1 5 0 5 2 8$ for MNIST, CIFAR and ImageNet respectively.
|
| 113 |
+
|
| 114 |
+
One approach to compute $L _ { q , x _ { 0 } } ^ { j }$ is through sampling a set of points $\pmb { x } ^ { ( i ) }$ in a ball $B _ { p } ( { \pmb x } _ { 0 } , R )$ around $\scriptstyle { \mathbf { { \mathit { x } } } } _ { 0 }$ and taking the maximum value of $\| \nabla g ( \pmb { x } ^ { ( i ) } ) \| _ { q }$ . However, a significant amount of samples might be needed to obtain a good estimate of max $| | \vec { \nabla } \dot { g } ( { \pmb x } ) | | _ { q }$ and it is unknown how good the estimate is compared to the true maximum. Fortunately, Extreme Value Theory ensures that the maximum value of random variables can only follow one of the three extreme value distributions, which is useful to estimate max $\| \nabla g ( { \pmb x } ) \| _ { q }$ with only a tractable number of samples.
|
| 115 |
+
|
| 116 |
+
It is worth noting that although Wood & Zhang (1996) also applied extreme value theory to estimate the Lipschitz constant. However, there are two main differences between their work and this paper. First of all, the sampling methodology is entirely different. Wood & Zhang (1996) calculates the slopes between pairs of sample points whereas we directly take samples on the norm of gradient as in Lemma 3.1. Secondly, the functions considered in Wood & Zhang (1996) are only one-dimensional as opposed to the high-dimensional classification functions considered in this paper. For comparison, we show in our experiment that the approach in Wood & Zhang (1996), denoted as SLOPE in Table 3 and Figure 4, perform poorly for high-dimensional classifiers such as deep neural networks.
|
| 117 |
+
|
| 118 |
+
# 4.1 ESTIMATE $L _ { q , x _ { 0 } } ^ { j }$ VIA EXTREME VALUE THEORY
|
| 119 |
+
|
| 120 |
+
When sampling a point $_ { \textbf { \em x } }$ uniformly in $B _ { p } ( { \pmb x } _ { 0 } , R )$ , $\| \nabla g ( { \pmb x } ) \| _ { q }$ can be viewed as a random variable characterized by a cumulative distribution function (CDF). For the purpose of illustration, we derived the CDF for a 2-layer neural network in Theorem D.1.4 For any neural networks, suppose we have $n$ samples $\{ \| \nabla g ( \pmb { x } ^ { ( i ) } ) \| _ { q } \}$ , and denote them as a sequence of independent and identically distributed (iid) random variables $Y _ { 1 } , Y _ { 2 } , \cdots , Y _ { n }$ , each with CDF $F _ { Y } ( y )$ . The CDF of $\operatorname* { m a x } \{ Y _ { 1 } , \cdot \cdot \cdot , Y _ { n } \}$ , denoted as $F _ { Y } ^ { n } ( y )$ , is called the limit distribution of $F _ { Y } ( y )$ . Fisher-TippettGnedenko theorem says that $F _ { Y } ^ { n } ( y )$ , if exists, can only be one of the three family of extreme value distributions – the Gumbel class, the Frechet class and the reverse Weibull class. ´
|
| 121 |
+
|
| 122 |
+
Theorem 4.1 (Fisher-Tippett-Gnedenko Theorem). If there exists a sequence of pairs of real numbers $\left( a _ { n } , b _ { n } \right)$ such that $a _ { n } > 0$ and $\begin{array} { r } { \operatorname* { l i m } _ { n \to \infty } F _ { Y } ^ { n } ( a _ { n } y + b _ { n } ) = G ( y ) } \end{array}$ , where $G$ is a non-degenerate distribution function, then $G$ belongs to either the Gumbel class (Type $I )$ , the Frechet class (Type II) ´ or the Reverse Weibull class (Type III) with their CDFs as follows:
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
\begin{array} { r l r } & { } & { \mathrm { G u m b e l ~ c l a s s ~ ( T y p e ~ I ) } ; \quad G ( y ) = \exp \big \{ - \exp \big [ - \frac { y - a _ { W } } { b _ { W } } \big ] \big \} , \quad y \in \mathbb { R } , } \\ & { } & { \mathrm { F r } { \ ' e c h e t ~ c l a s s ~ ( T y p e ~ I I ) } ; \quad G ( y ) = \Big \{ \begin{array} { l l } { 0 , } & { \mathrm { ~ i f ~ } y < a _ { W } , } \\ { \exp \{ - \big ( \frac { y - a _ { W } } { b _ { W } } \big ) ^ { - c _ { w } } \} , } & { \mathrm { ~ i f ~ } y \geq a _ { W } , } \end{array} } \\ & { } & { \mathrm { \it ~ r e r s e ~ W e i b u l l ~ c l a s s ~ ( T y p e ~ I I I ) } ; \quad G ( y ) = \Big \{ \begin{array} { l l } { \exp \{ - \big ( \frac { a _ { W } - y } { b _ { W } } \big ) ^ { c _ { w } } \} , } & { \mathrm { ~ i f ~ } y < a _ { W } , } \\ { 1 , } & { \mathrm { ~ i f ~ } y \geq a _ { W } , } \end{array} \Big \} , } \\ & { } & { \mathrm { \it ~ i f ~ } y \geq a _ { W } , } \end{array}
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
where $a _ { W } \in \mathbb { R } ,$ $b _ { W } > 0$ and $c _ { W } > 0$ are the location, scale and shape parameters, respectively. Theorem 4.1 implies that the maximum values of the samples follow one of the three families of distributions. If $g ( { \pmb x } )$ has a bounded Lipschitz constant, $\| \nabla g ( \pmb { x } ^ { ( i ) } ) \| _ { q }$ is also bounded, thus its limit distribution must have a finite right end-point. We are particularly interested in the reverse Weibull class, as its CDF has a finite right end-point (denoted as $a w$ ). The right end-point reveals the upper limit of the distribution, cross Lipschitz constant $L _ { q , \pmb { x } _ { 0 } } ^ { j }$ as the extreme value. The extreme value is exactly thewe would like to estimate in this paper. To estimate Ljq,x0 own local, we first generate $N _ { s }$ samples of $\mathbf { \boldsymbol { x } } ^ { ( i ) }$ over a fixed ball $B _ { p } ( { \pmb x } _ { \mathbf { 0 } } , R )$ uniformly and independently in each batch with a total of $N _ { b }$ batches. We then compute $\| \nabla g ( \pmb { x } ^ { ( i ) } ) \| _ { q }$ and store the maximum values of each batch in set $S$ . Next, with samples in $S$ , we perform a maximum likelihood estimation of reverse Weibull distribution parameters, and the location estimate $\hat { a } _ { W }$ is used as an estimate of $L _ { q , \pmb { x } _ { 0 } } ^ { j }$ .
|
| 129 |
+
|
| 130 |
+
Given an instance $\scriptstyle { \mathbf { { \mathit { x } } } } _ { \mathbf { 0 } }$ , its classifier $f ( x _ { 0 } )$ and a target class $j$ , a targeted CLEVER score of the classifier’s robustness can be computed via $g ( x _ { 0 } )$ and $L _ { q , x _ { 0 } } ^ { j }$ . Similarly, untargeted CLEVER scores can be computed. With the proposed procedure of estimating $L _ { q , x _ { 0 } } ^ { j }$ described in Section 4.1, we summarize the flow of computing CLEVER score for both targeted attacks and un-targeted attacks in Algorithm 1 and 2, respectively.
|
| 131 |
+
|
| 132 |
+
# Algorithm 1: CLEVER-t, compute CLEVER score for targeted attack
|
| 133 |
+
|
| 134 |
+
Input: a $K$ -class classifier $f ( { \pmb x } )$ , data example $\scriptstyle { \mathbf { { \mathit { x } } } } _ { \mathbf { 0 } }$ with predicted class $c$ , target class $j$ , batch size $N _ { b }$ , number of samples per batch $N _ { s }$ , perturbation norm $p$ , maximum perturbation $R$ Result: CLEVER Score $\mu \in \mathbb { R } _ { + }$ for target class $j$ 1 $S \gets \{ \emptyset \}$ $\begin{array} { r } { \cdot \{ \emptyset \} , g ( { \pmb x } ) f _ { c } ( { \pmb x } ) - f _ { j } ( { \pmb x } ) , q \frac { p } { p - 1 } , } \end{array}$ . 2 for $i \gets 1$ to $N _ { b }$ do 3 for $k \gets 1$ to $N _ { s }$ do 4 randomly select a point $\pmb { x } ^ { ( i , k ) } \in B _ { p } ( \pmb { x } _ { 0 } , R )$ 5 compute $b _ { i k } \| \nabla g ( \pmb { x } ^ { ( i , k ) } ) \| _ { q }$ via back propagation 6 end 7 $S \gets S \cup \{ \operatorname* { m a x } _ { k } \{ b _ { i k } \} \}$ 8 end 9 $\hat { a } _ { W } \gets \mathbf { M } \mathbf { L } \mathbf { E }$ of location parameter of reverse Weibull distribution on $S$ 10 $\begin{array} { r } { \mu \operatorname* { m i n } ( \frac { g ( \pmb { x _ { 0 } } ) } { \hat { a } } , R ) } \end{array}$
|
| 135 |
+
|
| 136 |
+
# Algorithm 2: CLEVER-u, compute CLEVER score for un-targeted attack
|
| 137 |
+
|
| 138 |
+
Input: Same as Algorithm 1, but without a target class $j$ Result: CLEVER score $\nu \in \mathbb { R } _ { + }$ for un-targeted attack 1 for $j 1$ to $K$ , $j \neq c$ do 2 $| \quad \mu _ { j } \gets \mathrm { C L E V E R - t } ( f , \boldsymbol { x } _ { 0 } , c , j , N _ { b } , N _ { s } , p , R )$ 3 end 4 $\nu \gets \operatorname* { m i n } _ { j } \{ \mu _ { j } \}$
|
| 139 |
+
|
| 140 |
+
# 5 EXPERIMENTAL RESULTS
|
| 141 |
+
|
| 142 |
+
# 5.1 NETWORKS AND PARAMETER SETUP
|
| 143 |
+
|
| 144 |
+
We conduct experiments on CIFAR-10 (CIFAR for short), MNIST, and ImageNet data sets. For the former two smaller datasets CIFAR and MNIST, we evaluate CLEVER scores on four relatively small networks: a single hidden layer MLP with softplus activation (with the same number of hidden units as in (Hein & Andriushchenko, 2017)), a 7-layer AlexNet-like CNN (with the same structure as in (Carlini & Wagner, 2017b)), and the 7-layer CNN with defensive distillation (Papernot et al., 2016) (DD) and bounded ReLU (Zantedeschi et al., 2017) (BReLU) defense techniques employed.
|
| 145 |
+
|
| 146 |
+
For ImageNet data set, we use three popular deep network architectures: a 50-layer Residual Network (He et al., 2016) (ResNet-50), Inception-v3 (Szegedy et al., 2016) and MobileNet (Howard et al., 2017). They were chosen for the following reasons: (i) they all yield (close to) state-of-theart performance among equal-sized networks; and (ii) their architectures are significantly different with unique building blocks, i.e., residual block in ResNet, inception module in Inception net, and depthwise separable convolution in MobileNet. Therefore, their diversity in network architectures is appropriate to test our robustness metric. For MobileNet, we set the width multiplier to 1.0, achieving a ${ \bar { 7 } } 0 . 6 \%$ accuracy on ImageNet. We used public pretrained weights for all ImageNet models5.
|
| 147 |
+
|
| 148 |
+
In all our experiments, we set the sampling parameters $N _ { b } = 5 0 0$ , $N _ { s } = 1 0 2 4$ and $R = 5$ . For targeted attacks, we use 500 test-set images for CIFAR and MNIST and use 100 test-set images for ImageNet; for each image, we evaluate its targeted CLEVER score for three targets: a random target class, a least likely class (the class with lowest probability when predicting the original example), and the top-2 class (the class with largest probability except for the true class, which is usually the easiest target to attack). We also conduct untargeted attacks on MNIST and CIFAR for 100 test-set images, and evaluate their untargeted CLEVER scores. Our experiment code is publicly available6.
|
| 149 |
+
|
| 150 |
+
5.2 FITTING GRADIENT NORM SAMPLES WITH REVERSE WEIBULL DISTRIBUTIONS
|
| 151 |
+
|
| 152 |
+
We fit the cross Lipschitz constant samples in $S$ (see Algorithm 1) with reverse Weibull class distribution to obtain the maximum likelihood estimate of the location parameter $\hat { a } _ { W }$ , scale parameter $\hat { b } _ { W }$ and shape parameter $\hat { c } _ { W }$ , as introduced in Theorem 4.1. To validate that reverse Weibull distribution is a good fit to the empirical distribution of the cross Lipschitz constant samples, we conduct Kolmogorov-Smirnov goodness-of-fit test (a.k.a. K-S test) to calculate the K-S test statistics $D$ and corresponding $p$ -values. The null hypothesis is that samples $S$ follow a reverse Weibull distribution.
|
| 153 |
+
|
| 154 |
+
Figure 2 plots the probability distribution function of the cross Lipschitz constant samples and the fitted Reverse Weibull distribution for images from various data sets and network architectures. The estimated MLE parameters, $p$ -values, and the K-S test statistics $D$ are also shown. We also calculate the percentage of examples whose estimation have $p$ -values greater than 0.05, as illustrated in Figure 3. If the $p$ -value is greater than 0.05, the null hypothesis cannot be rejected, meaning that the underlying data samples fit a reverse Weibull distribution well. Figure 3 shows that all numbers are close to $100 \%$ , validating the use of reverse Weibull distribution as an underlying distribution of gradient norm samples empirically. Therefore, the fitted location parameter of reverse Weibull distribution (i.e., the extreme value), $\hat { a } _ { W }$ , can be used as a good estimation of local cross Lipschitz constant to calculate the CLEVER score. The exact numbers are shown in Table 5 in Appendix E.
|
| 155 |
+
|
| 156 |
+

|
| 157 |
+
Figure 2: The cross Lipschitz constant samples for three images from CIFAR, MNIST and ImageNet datasets, and their fitted Reverse Weibull distributions with the corresponding MLE estimates of location, scale and shape parameters $\left( a _ { W } , b _ { W } , c _ { W } \right)$ shown on the top of each plot. The $D$ -statistics of K-S test and p-values are denoted as $k s$ and pval. With small $k s$ and high p-value, the hypothesized reverse Weibull distribution fits the empirical distribution of cross Lipschitz constant samples well.
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 3: The percentage of examples whose null hypothesis (the samples $S$ follow a reverse Weibull distribution) cannot be rejected by K-S test with a significance level of 0.05 for $p = 2$ and $p = \infty$ . All numbers for each model are close to $100 \%$ , indicating $S$ fits reverse Weibull distributions well.
|
| 161 |
+
|
| 162 |
+
# 5.3 COMPARING CLEVER SCORE WITH ATTACK-SPECIFIC NETWORK ROBUSTNESS
|
| 163 |
+
|
| 164 |
+
We apply the state-of-the-art white-box attack methods, iterative fast gradient sign method (IFGSM) (Goodfellow et al., 2015; Kurakin et al., 2016b) and Carlini and Wagner’s attack (CW) (Carlini & Wagner, 2017b), to find adversarial examples for 11 networks, including 4 networks trained on CIFAR, 4 networks trained on MNIST, and 3 networks trained on ImageNet. For CW attack, we run 1000 iterations for ImageNet and CIFAR, and 2000 iterations for MNIST, as MNIST has shown to be more difficult to attack (Chen et al., 2017b). Attack learning rate is individually tuned for each model: 0.001 for Inception-v3 and ResNet-50, 0.0005 for MobileNet and 0.01 for all other networks. For I-FGSM, we run 50 iterations and choose the optimal $\epsilon \in \{ 0 . 0 1 , 0 . 0 2 5 , 0 . 0 5 , 0 . 1 , 0 . 3 , 0 . 5 , 0 . 8 , 1 . 0 \}$ to achieve the smallest $\ell _ { \infty }$ distortion for each individual image. For defensively distilled (DD) networks, 50 iterations of I-FGSM are not sufficient; we use 250 iterations for CIFAR-DD and 500 iterations for MNIST-DD to achieve a $100 \%$ success rate. For the problem to be non-trivial, images that are classified incorrectly are skipped. We report $100 \%$ attack success rates for all the networks, and thus the average distortion of adversarial examples can indicate the attack-specific robustness of each network. For comparison, we compute the CLEVER scores for the same set of images and attack targets. To the best of our knowledge, CLEVER is the first attack-independent robustness score that is capable of handling the large networks studied in this paper, so we directly compare it with the attack-induced distortion metrics in our study.
|
| 165 |
+
|
| 166 |
+
We evaluate the effectiveness of our CLEVER score by comparing the upper bound $\beta _ { U }$ (found by attacks) and CLEVER score, where CLEVER serves as an estimated lower bound, $\beta _ { L }$ . Table 3 compares the average $\ell _ { 2 }$ and $\ell _ { \infty }$ distortions of adversarial examples found by targeted CW and I-FGSM attacks and the corresponding average targeted CLEVER scores for $\ell _ { 2 }$ and $\ell _ { \infty }$ norms, and Figure 4 visualizes the results for $\ell _ { \infty }$ norm. Similarly, Table 2 compares untargeted CW and I-FGSM attacks with untargeted CLEVER scores. As expected, CLEVER is smaller than the distortions of adversarial images in most cases. More importantly, since CLEVER is independent of attack algorithms, the reported CLEVER scores can roughly indicate the distortion of the best possible attack in terms of a specific $\ell _ { p }$ distortion. The average $\ell _ { 2 }$ distortion found by CW attack is close to the $\ell _ { 2 }$ CLEVER score, indicating CW is a strong $\ell _ { 2 }$ attack. In addition, when a defense mechanism (Defensive Distillation or Bounded ReLU) is used, the corresponding CLEVER scores are consistently increased (except for CIFAR-BReLU), indicating that the network is indeed made more resilient to adversarial perturbations. For CIFAR-BReLU, both CLEVER scores and $\ell _ { p }$ norm of adversarial examples found by CW attack decrease, implying that bound ReLU is an ineffective defense for CIFAR. CLEVER scores can be seen as a security checkpoint for unseen attacks. For example, if there is a substantial gap in distortion between the CLEVER score and the considered attack algorithms, it may suggest the existence of a more effective attack that can close the gap.
|
| 167 |
+
|
| 168 |
+
Since CLEVER score is derived from an estimation of the robustness lower bound, we further verify the viability of CLEVER per each example, i.e., whether it is usually smaller than the upper bound found by attacks. Table 4 shows the percentage of inaccurate estimations where the CLEVER score is larger than the distortion of adversarial examples found by CW and I-FGSM attacks in three ImageNet networks. We found that CLEVER score provides an accurate estimation for most of the examples. For MobileNet and Resnet-50, our CLEVER score is a strict lower bound of these two attacks for more than $96 \%$ of tested examples. For Inception-v3, the condition of strict lower bound
|
| 169 |
+
|
| 170 |
+
Table 2: Comparison between the average untargeted CLEVER score and distortion found by CW and I-FGSM untargeted attacks. DD and BReLU represent Defensive Distillation and Bounded ReLU defending methods applied to the baseline CNN network.
|
| 171 |
+
|
| 172 |
+
<table><tr><td></td><td colspan="2">CW</td><td colspan="2">I-FGSM</td><td colspan="2">CLEVER</td></tr><tr><td></td><td>l2</td><td>lo</td><td>l2</td><td>lo</td><td>l2</td><td>l</td></tr><tr><td>MNIST-MLP</td><td>1.113</td><td>0.215</td><td>3.564</td><td>0.178</td><td>0.819</td><td>0.041</td></tr><tr><td>MNIST-CNN</td><td>1.500</td><td>0.455</td><td>4.439</td><td>0.288</td><td>0.721</td><td>0.057</td></tr><tr><td>MNIST-DD</td><td>1.548</td><td>0.409</td><td>5.617</td><td>0.283</td><td>0.865</td><td>0.063</td></tr><tr><td>MNIST-BReLU</td><td>1.337</td><td>0.433</td><td>3.851</td><td>0.285</td><td>0.833</td><td>0.065</td></tr><tr><td>CIFAR-MLP</td><td>0.253</td><td>0.018</td><td>0.885</td><td>0.016</td><td>0.219</td><td>0.005</td></tr><tr><td>CIFAR-CNN</td><td>0.195</td><td>0.023</td><td>0.721</td><td>0.018</td><td>0.072</td><td>0.002</td></tr><tr><td>CIFAR-DD</td><td>0.285</td><td>0.032</td><td>1.136</td><td>0.024</td><td>0.130</td><td>0.004</td></tr><tr><td>CIFAR-BReLU</td><td>0.159</td><td>0.019</td><td>0.519</td><td>0.013</td><td>0.045</td><td>0.001</td></tr></table>
|
| 173 |
+
|
| 174 |
+
Table 3: Comparison of the average targeted CLEVER scores with average $\ell _ { \infty }$ and $\ell _ { 2 }$ distortions found by CW, I-FSGM attacks, and the average scores calculated by using the algorithm in Wood & Zhang (1996) (denoted as SLOPE) to estimate Lipschitz constant. DD and BReLU denote Defensive Distillation and Bounded ReLU defending methods applied to the CNN network. We did not include SLOPE in ImageNet networks because it has been shown to be ineffective even for smaller networks.
|
| 175 |
+
|
| 176 |
+
(a) avergage $\ell _ { \infty }$ distortion of CW and I-FGSM targeted attacks, and CLEVER and SLOPE estimation. Some very large SLOPE estimates (in parentheses) exceeding the maximum possible $\ell _ { \infty }$ distortion are reported as 1.
|
| 177 |
+
|
| 178 |
+
<table><tr><td rowspan="2"></td><td colspan="4">LeastLikely Target</td><td colspan="4">Random Target</td><td colspan="4">Top-2 Target</td></tr><tr><td>CW</td><td>I-FGSM</td><td>CLEVER</td><td>SLOPE</td><td>CW</td><td>I-FGSM</td><td>CLEVER</td><td>SLOPE</td><td>CW</td><td>I-FGSM</td><td>CLEVER</td><td>SLOPE</td></tr><tr><td>MNIST-MLP</td><td>0.475</td><td>0.223</td><td>0.071</td><td>0.808</td><td>0.337</td><td>0.173</td><td>0.072</td><td>0.813</td><td>0.218</td><td>0.119</td><td>0.069</td><td>0.786</td></tr><tr><td>MNIST-CNN</td><td>0.601</td><td>0.313</td><td>0.090</td><td>0.996</td><td>0.550</td><td>0.264</td><td>0.088</td><td>0.982</td><td>0.451</td><td>0.211</td><td>0.070</td><td>0.826</td></tr><tr><td>MNIST-DD</td><td>0.578</td><td>0.283</td><td>0.103</td><td>1 (1.090)</td><td>0.531</td><td>0.238</td><td>0.091</td><td>0.953</td><td>0.412</td><td>0.165</td><td>0.091</td><td>0.984</td></tr><tr><td>MNIST-BReLU</td><td>0.601</td><td>0.276</td><td>0.257</td><td>1 (5.327)</td><td>0.544</td><td>0.238</td><td>0.187</td><td>3.907</td><td>0.442</td><td>0.196</td><td>0.117</td><td>1 (2.470)</td></tr><tr><td>CIFAR-MLP</td><td>0.086</td><td>0.039</td><td>0.014</td><td>0.294</td><td>0.051</td><td>0.024</td><td>0.014</td><td>0.284</td><td>0.019</td><td>0.013</td><td>0.014</td><td>0.286</td></tr><tr><td>CIFAR-CNN</td><td>0.053</td><td>0.033</td><td>0.005</td><td>0.153</td><td>0.042</td><td>0.023</td><td>0.005</td><td>0.148</td><td>0.022</td><td>0.013</td><td>0.004</td><td>0.129</td></tr><tr><td>CIFAR-DD</td><td>0.091</td><td>0.053</td><td>0.011</td><td>0.278</td><td>0.066</td><td>0.032</td><td>0.010</td><td>0.255</td><td>0.033</td><td>0.014</td><td>0.007</td><td>0.184</td></tr><tr><td>CIFAR-BReLU</td><td>0.045</td><td>0.030</td><td>0.004</td><td>0.250</td><td>0.034</td><td>0.022</td><td>0.003</td><td>0.173</td><td>0.018</td><td>0.012</td><td>0.002</td><td>0.095</td></tr><tr><td>Inception-v3</td><td>0.023</td><td>0.011</td><td>0.002</td><td>-</td><td>0.021</td><td>0.012</td><td>0.002</td><td>-</td><td>0.010</td><td>0.011</td><td>0.001</td><td>-</td></tr><tr><td>Resnet-50</td><td>0.031</td><td>0.015</td><td>0.002</td><td>-</td><td>0.025</td><td>0.012</td><td>0.002</td><td>-</td><td>0.010</td><td>0.010</td><td>0.001</td><td>-</td></tr><tr><td>MobileNet</td><td>0.025</td><td>0.010</td><td>0.003</td><td>-</td><td>0.018</td><td>0.010</td><td>0.002</td><td>-</td><td>0.006</td><td>0.010</td><td>0.001</td><td>=</td></tr></table>
|
| 179 |
+
|
| 180 |
+
(b) average $\ell _ { 2 }$ distortion of CW and I-FGSM targeted attacks, and CLEVER and SLOPE estimation. Some very large SLOPE estimates (in parentheses) exceeding the sampling radius $R = 5$ are reported as 5.
|
| 181 |
+
|
| 182 |
+
<table><tr><td rowspan="2"></td><td colspan="4">LeastLikely Target</td><td colspan="4">Random Target</td><td colspan="4">Top-2 Target</td></tr><tr><td>CW</td><td>I-FGSM</td><td>CLEVER</td><td>SLOPE</td><td>CW</td><td>I-FGSM</td><td>CLEVER</td><td>SLOPE</td><td>CW</td><td>I-FGSM</td><td>CLEVER</td><td>SLOPE</td></tr><tr><td>MNIST-MLP</td><td>2.575</td><td>4.273</td><td>1.409</td><td>5(8.028)</td><td>1.833</td><td>3.369</td><td>1.432</td><td>5(8.102)</td><td>1.128</td><td>2.374</td><td>1.383</td><td>5(7.853)</td></tr><tr><td>MNIST-CNN</td><td>2.377</td><td>4.417</td><td>1.257</td><td>5 (9.947)</td><td>2.005</td><td>3.902</td><td>1.227</td><td>5 (9.619)</td><td>1.504</td><td>3.242</td><td>0.987</td><td>5 (7.921)</td></tr><tr><td>MNIST-DD</td><td>2.644</td><td>4.957</td><td>1.532</td><td>5 (10.628)</td><td>2.240</td><td>4.253</td><td>1.340</td><td>5 (9.493)</td><td>1.542</td><td>3.010</td><td>1.330</td><td>5 (9.646)</td></tr><tr><td>MNIST-BReLU</td><td>2.349</td><td>5.170</td><td>3.312</td><td>5(52.058)</td><td>1.923</td><td>4.544</td><td>2.565</td><td>5 (37.531)</td><td>1.404</td><td>3.778</td><td>1.583</td><td>5(23.548)</td></tr><tr><td>CIFAR-MLP</td><td>1.123</td><td>1.896</td><td>0.620</td><td>5 (5.013)</td><td>0.673</td><td>1.214</td><td>0.597</td><td>4.806</td><td>0.262</td><td>0.689</td><td>0.599</td><td>4.949</td></tr><tr><td>CIFAR-CNN</td><td>0.836</td><td>1.067</td><td>0.156</td><td>2.630</td><td>0.372</td><td>0.837</td><td>0.146</td><td>2.497</td><td>0.188</td><td>0.552</td><td>0.123</td><td>2.195</td></tr><tr><td>CIFAR-DD</td><td>2.065</td><td>1.540</td><td>0.347</td><td>4.735</td><td>0.624</td><td>1.097</td><td>0.307</td><td>4.279</td><td>0.296</td><td>0.582</td><td>0.220</td><td>3.083</td></tr><tr><td>CIFAR-BReLU</td><td>0.407</td><td>0.928</td><td>0.140</td><td>4.125</td><td>0.303</td><td>0.732</td><td>0.103</td><td>2.944</td><td>0.152</td><td>0.494</td><td>0.052</td><td>1.564</td></tr><tr><td>Inception-v3</td><td>0.628</td><td>2.244</td><td>0.524</td><td>-</td><td>0.595</td><td>2.261</td><td>0.466</td><td>-</td><td>0.287</td><td>2.073</td><td>0.234</td><td>-</td></tr><tr><td>Resnet-50</td><td>0.767</td><td>2.410</td><td>0.357</td><td>=</td><td>0.647</td><td>2.098</td><td>0.299</td><td>·</td><td>0.212</td><td>1.682</td><td>0.134</td><td>=</td></tr><tr><td>MobileNet</td><td>0.837</td><td>2.195</td><td>0.617</td><td>-</td><td>0.603</td><td>2.066</td><td>0.439</td><td>=</td><td>0.190</td><td>1.771</td><td>0.144</td><td>=</td></tr></table>
|
| 183 |
+
|
| 184 |
+

|
| 185 |
+
Figure 4: Comparison of $\ell _ { \infty }$ distortion obtained by CW and I-FGSM attacks, CLEVER score and the slope based Lipschitz constant estimation (SLOPE) by Wood & Zhang (1996). SLOPE significantly exceeds the distortions found by attacks, thus it is an inappropriate estimation of lower bound $\beta _ { L }$ .
|
| 186 |
+
|
| 187 |
+
is worse (still more than $7 5 \%$ ), but we found that in these cases the attack distortion only differs from our CLEVER score by a fairly small amount. In Figure 5 we show the empirical CDF of the gap between CLEVER score and the $\ell _ { 2 }$ norm of adversarial distortion generated by CW attack for the same set of images in Table 4. In Figure 6, we plot the $\ell _ { 2 }$ distortion and CLEVER scores for each individual image. A positive gap indicates that CLEVER (estimated lower bound) is indeed less than the upper bound found by CW attack. Most images have a small positive gap, which signifies the near-optimality of CW attack in terms of $\ell _ { 2 }$ distortion, as CLEVER suffices for an estimated capacity of the best possible attack.
|
| 188 |
+
|
| 189 |
+

|
| 190 |
+
Figure 5: The empirical CDF of the gap between CLEVER score and the $\ell _ { 2 }$ norm of adversarial distortion generated by CW attack with random targets for 100 images on 3 ImageNet networks.
|
| 191 |
+
|
| 192 |
+

|
| 193 |
+
Figure 6: Comparison of the CLEVER scores (circle) and the $\ell _ { 2 }$ norm of adversarial distortion generated by CW attack (triangle) with random targets for 100 images. The x-axis is image ID and the y-axis is the $\ell _ { 2 }$ distortion metric.
|
| 194 |
+
|
| 195 |
+

|
| 196 |
+
Figure 7: Comparison of the CLEVER score calculated by $N _ { b } = \{ 5 0 , 1 0 0 , 2 5 0 , 5 0 0 \}$ and the $\ell _ { 2 }$ norm of adversarial distortion found by CW attack (CW) on 3 ImageNet models and 3 target types.
|
| 197 |
+
|
| 198 |
+
# 5.4 TIME V.S. ESTIMATION ACCURACY
|
| 199 |
+
|
| 200 |
+
In Figure 7, we vary the number of samples $( N _ { b } = 5 0 , 1 0 0 , 2 5 0 , 5 0 0 )$ and compute the $\ell _ { 2 }$ CLEVER scores for three large ImageNet models, Inception-v3, ResNet-50 and MobileNet. We observe that
|
| 201 |
+
|
| 202 |
+
50 or 100 samples are usually sufficient to obtain a reasonably accurate robustness estimation despite using a smaller number of samples. On a single GTX 1080 Ti GPU, the cost of 1 sample (with $N _ { s } = 1 0 2 4 )$ is measured as $2 . 9 \ : \mathrm { s }$ for MobileNet, 5.0 s for ResNet-50 and $8 . 9 \ : \mathrm { s }$ for Inception-v3, thus the computational cost of CLEVER is feasible for state-of-the-art large-scale deep neural networks. Additional figures for MNIST and CIFAR datasets are given in Appendix E.
|
| 203 |
+
|
| 204 |
+
# 6 CONCLUSION
|
| 205 |
+
|
| 206 |
+
In this paper, we propose the CLEVER score, a novel and generic metric to evaluate the robustness of a target neural network classifier to adversarial examples. Compared to the existing robustness evaluation approaches, our metric has the following advantages: (i) attack-agnostic; (ii) applicable to any neural network classifier; (iii) comes with strong theoretical guarantees; and (iv) is computationally feasible for large neural networks. Our extensive experiments show that the CLEVER score well matches the practical robustness indication of a wide range of natural and defended networks.
|
| 207 |
+
|
| 208 |
+
Acknowledgment. Luca Daniel and Tsui-Wei Weng are partially supported by MIT-Skoltech program and MIT-IBM Watson AI Lab. Cho-Jui Hsieh and Huan Zhang acknowledge the support of NSF via IIS-1719097.
|
| 209 |
+
|
| 210 |
+
# REFERENCES
|
| 211 |
+
|
| 212 |
+
Osbert Bastani, Yani Ioannou, Leonidas Lampropoulos, Dimitrios Vytiniotis, Aditya Nori, and Antonio Criminisi. Measuring neural net robustness with constraints. In Advances in Neural Information Processing Systems, pp. 2613–2621, 2016.
|
| 213 |
+
|
| 214 |
+
Nicholas Carlini and David Wagner. Adversarial examples are not easily detected: Bypassing ten detection methods. arXiv preprint arXiv:1705.07263, 2017a.
|
| 215 |
+
|
| 216 |
+
Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In IEEE Symposium on Security and Privacy (SP), pp. 39–57, 2017b.
|
| 217 |
+
|
| 218 |
+
Hongge Chen, Huan Zhang, Pin-Yu Chen, Jinfeng Yi, and Cho-Jui Hsieh. Show-and-fool: Crafting adversarial examples for neural image captioning. CoRR, abs/1712.02051, 2017a.
|
| 219 |
+
|
| 220 |
+
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, 2017b.
|
| 221 |
+
|
| 222 |
+
Pin-Yu Chen, Huan Zhang, Yash Sharma, Jinfeng Yi, and Cho-Jui Hsieh. Zoo: Zeroth order optimization based black-box attacks to deep neural networks without training substitute models. arXiv preprint arXiv:1708.03999, 2017c.
|
| 223 |
+
|
| 224 |
+
Laurens De Haan and Ana Ferreira. Extreme value theory: an introduction. Springer Science & Business Media, 2007.
|
| 225 |
+
|
| 226 |
+
Ruediger Ehlers. Formal verification of piece-wise linear feed-forward neural networks. arXiv preprint arXiv:1705.01320, 2017.
|
| 227 |
+
|
| 228 |
+
Ivan Evtimov, Kevin Eykholt, Earlence Fernandes, Tadayoshi Kohno, Bo Li, Atul Prakash, Amir Rahmati, and Dawn Song. Robust physical-world attacks on machine learning models. arXiv preprint arXiv:1707.08945, 2017.
|
| 229 |
+
|
| 230 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. ICLR’15; arXiv preprint arXiv:1412.6572, 2015.
|
| 231 |
+
|
| 232 |
+
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.
|
| 233 |
+
|
| 234 |
+
Matthias Hein and Maksym Andriushchenko. Formal guarantees on the robustness of a classifier against adversarial manipulation. arXiv preprint arXiv:1705.08475, 2017.
|
| 235 |
+
|
| 236 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
|
| 237 |
+
|
| 238 |
+
Andrew G Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017.
|
| 239 |
+
|
| 240 |
+
Xiaowei Huang, Marta Kwiatkowska, Sen Wang, and Min Wu. Safety verification of deep neural networks. In International Conference on Computer Aided Verification, pp. 3–29. Springer, 2017.
|
| 241 |
+
|
| 242 |
+
Guy Katz, Clark Barrett, David Dill, Kyle Julian, and Mykel Kochenderfer. Reluplex: An efficient smt solver for verifying deep neural networks. arXiv preprint arXiv:1702.01135, 2017a.
|
| 243 |
+
|
| 244 |
+
Guy Katz, Clark Barrett, David L Dill, Kyle Julian, and Mykel J Kochenderfer. Towards proving the adversarial robustness of deep neural networks. arXiv preprint arXiv:1709.02802, 2017b.
|
| 245 |
+
|
| 246 |
+
Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. arXiv preprint arXiv:1607.02533, 2016a.
|
| 247 |
+
|
| 248 |
+
Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial machine learning at scale. ICLR’17; arXiv preprint arXiv:1611.01236, 2016b.
|
| 249 |
+
|
| 250 |
+
Xuanqing Liu, Minhao Cheng, Huan Zhang, and Cho-Jui Hsieh. Towards robust neural networks via random self-ensemble. arXiv preprint arXiv:1712.00673, 2017.
|
| 251 |
+
|
| 252 |
+
Yanpei Liu, Xinyun Chen, Chang Liu, and Dawn Song. Delving into transferable adversarial examples and black-box attacks. arXiv preprint arXiv:1611.02770, 2016.
|
| 253 |
+
|
| 254 |
+
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.
|
| 255 |
+
|
| 256 |
+
Dongyu Meng and Hao Chen. Magnet: a two-pronged defense against adversarial examples. arXiv preprint arXiv:1705.09064, 2017.
|
| 257 |
+
|
| 258 |
+
Nicolas Papernot, Patrick McDaniel, Xi Wu, Somesh Jha, and Ananthram Swami. Distillation as a defense to adversarial perturbations against deep neural networks. In IEEE Symposium on Security and Privacy (SP), pp. 582–597, 2016.
|
| 259 |
+
|
| 260 |
+
Nicolas Papernot, Patrick McDaniel, Ian Goodfellow, Somesh Jha, Z Berkay Celik, and Ananthram Swami. Practical black-box attacks against machine learning. In ACM Asia Conference on Computer and Communications Security, pp. 506–519, 2017.
|
| 261 |
+
|
| 262 |
+
Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting on association for computational linguistics, pp. 311–318. Association for Computational Linguistics, 2002.
|
| 263 |
+
|
| 264 |
+
Remigijus Paulavicius and Julius ˇ Zilinskas. Analysis of different norms and corresponding lipschitz ˇ constants for global optimization. Technological and Economic Development of Economy, 12(4): 301–306, 2006.
|
| 265 |
+
|
| 266 |
+
Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. In Advances in Neural Information Processing Systems, pp. 2234–2242, 2016.
|
| 267 |
+
|
| 268 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199, 2013.
|
| 269 |
+
|
| 270 |
+
Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2818–2826, 2016.
|
| 271 |
+
|
| 272 |
+
Florian Tramer, Alexey Kurakin, Nicolas Papernot, Dan Boneh, and Patrick McDaniel. Ensemble \` adversarial training: Attacks and defenses. arXiv preprint arXiv:1705.07204, 2017.
|
| 273 |
+
|
| 274 |
+
Beilun Wang, Ji Gao, and Yanjun Qi. A theoretical framework for robustness of (deep) classifiers under adversarial noise. arXiv preprint arXiv:1612.00334, 2016.
|
| 275 |
+
GR Wood and BP Zhang. Estimation of the lipschitz constant of a function. Journal of Global Optimization, 8(1):91–103, 1996.
|
| 276 |
+
Weilin Xu, David Evans, and Yanjun Qi. Feature squeezing: Detecting adversarial examples in deep neural networks. arXiv preprint arXiv:1704.01155, 2017.
|
| 277 |
+
Valentina Zantedeschi, Maria-Irina Nicolae, and Ambrish Rawat. Efficient defenses against adversarial attacks. arXiv preprint arXiv:1707.06728, 2017.
|
| 278 |
+
|
| 279 |
+
# APPENDIX
|
| 280 |
+
|
| 281 |
+
A PROOF OF THEOREM 3.2
|
| 282 |
+
|
| 283 |
+
Proof. According to Lemma 3.1, the assumption that $g ( { \pmb x } ) : = f _ { c } ( { \pmb x } ) - f _ { j } ( { \pmb x } )$ is Lipschitz continuous with Lipschitz constant $L _ { q } ^ { j }$ gives
|
| 284 |
+
|
| 285 |
+
$$
|
| 286 |
+
| g ( \pmb { x } ) - g ( \pmb { y } ) | \leq L _ { q } ^ { j } \| \pmb { x } - \pmb { y } \| _ { p } .
|
| 287 |
+
$$
|
| 288 |
+
|
| 289 |
+
Let ${ \pmb x } = { \pmb x } _ { \mathbf { 0 } } + \delta$ and $\mathbf { \mu } _ { y } = \mathbf { \mathcal { x } } _ { \mathbf { 0 } }$ in (4), we get
|
| 290 |
+
|
| 291 |
+
$$
|
| 292 |
+
| g ( \pmb { x _ { 0 } } + \pmb { \delta } ) - g ( \pmb { x _ { 0 } } ) | \leq L _ { q } ^ { j } \| \pmb { \delta } \| _ { p } ,
|
| 293 |
+
$$
|
| 294 |
+
|
| 295 |
+
which can be rearranged into the following form
|
| 296 |
+
|
| 297 |
+
$$
|
| 298 |
+
g ( { \pmb x _ { 0 } } ) - L _ { q } ^ { j } \| \pmb \delta \| _ { p } \leq g ( { \pmb x _ { 0 } } + { \pmb \delta } ) \leq g ( { \pmb x _ { 0 } } ) + L _ { q } ^ { j } \| \pmb \delta \| _ { p } .
|
| 299 |
+
$$
|
| 300 |
+
|
| 301 |
+
When $g ( \pmb { x _ { 0 } } + \pmb { \delta } ) = 0$ , an adversarial example is found. As indicated by (5), $g ( \pmb { x _ { 0 } } + \pmb { \delta } )$ is lower bounded by $g ( \pmb { x _ { 0 } } ) - L _ { q } ^ { j } \| \delta \| _ { p }$ . If $\| \delta \| _ { p }$ is small enough such that $g ( \pmb { x _ { 0 } } ) - L _ { q } ^ { j } \| \pmb { \delta } \| _ { p } \geq 0$ , no adversarial examples can be found:
|
| 302 |
+
|
| 303 |
+
$$
|
| 304 |
+
g ( { \pmb x _ { 0 } } ) - L _ { q } ^ { j } \| \delta \| _ { p } \geq 0 \Rightarrow \| \delta \| _ { p } \leq \frac { g ( { \pmb x _ { 0 } } ) } { L _ { q } ^ { j } } \Rightarrow \| \delta \| _ { p } \leq \frac { f _ { c } ( { \pmb x _ { 0 } } ) - f _ { j } ( { \pmb x _ { 0 } } ) } { L _ { q } ^ { j } } ,
|
| 305 |
+
$$
|
| 306 |
+
|
| 307 |
+
Finally, to achieve $\begin{array} { r } { \mathrm { a r g m a x } _ { 1 \le i \le K } f _ { i } ( { \pmb x } _ { 0 } + { \pmb \delta } ) = c } \end{array}$ , we take the minimum of the bound on $\| \delta \| _ { p }$ in (A) over $j \neq c$ . I.e. if
|
| 308 |
+
|
| 309 |
+
$$
|
| 310 |
+
\| \pmb { \delta } \| _ { p } \leq \operatorname* { m i n } _ { j \neq c } \frac { f _ { c } ( \pmb { x _ { 0 } } ) - f _ { j } ( \pmb { x _ { 0 } } ) } { L _ { q } ^ { j } } ,
|
| 311 |
+
$$
|
| 312 |
+
|
| 313 |
+
the classifier decision can never be changed and the attack will never succeed.
|
| 314 |
+
|
| 315 |
+
# B PROOF OF COROLLARY 3.2.1
|
| 316 |
+
|
| 317 |
+
Proof. By Lemma 3.1 and let $\mathit { \Pi } _ { g } ~ = ~ f _ { c } - f _ { j }$ , we get $\begin{array} { r } { L _ { q , x _ { 0 } } ^ { j } \ = \ \operatorname* { m a x } _ { y \in B _ { p } ( x _ { 0 } , R ) } \| \nabla g ( y ) \| _ { q } \ = \ } \end{array}$ $\begin{array} { r } { \operatorname* { m a x } _ { y \in B _ { p } ( x _ { 0 } , R ) } \| \nabla f _ { j } ( y ) - \nabla f _ { c } ( y ) \| _ { q } } \end{array}$ , which then gives the bound in Theorem 2.1 of (Hein & Andriushchenko, 2017).
|
| 318 |
+
|
| 319 |
+
# C PROOF OF LEMMA 3.3
|
| 320 |
+
|
| 321 |
+
Proof. For any $\mathbf { \nabla } _ { \mathbf { x } , \mathbf { y } }$ , let $\begin{array} { r } { \pmb { d } = \frac { \pmb { y } - \pmb { x } } { \Vert \pmb { y } - \pmb { x } \Vert _ { p } } } \end{array}$ be the unit vector pointing from $_ { \textbf { \em x } }$ to $\textbf { { y } }$ and $r = \| \pmb { y } - \pmb { x } \| _ { p }$ . Define uni-variate function $u ( z ) = \dot { h } ( \pmb { x } + z \pmb { d } )$ , then $u ( 0 ) = h ( \pmb { x } )$ and $u ( r ) = h ( \pmb { y } )$ and observe that $D ^ { + } h ( { \pmb x } + z d ; d )$ and $D ^ { + } h ( { \pmb x } + z { \pmb d } ; - { \pmb d } )$ are the right-hand and left-hand derivatives of $u ( z )$ , we have
|
| 322 |
+
|
| 323 |
+
$$
|
| 324 |
+
u ^ { \prime } ( z ) = { \left\{ \begin{array} { l l } { D ^ { + } h ( { \boldsymbol { x } } + { \boldsymbol { z } } d ; d ) \leq L _ { q } } & { { \mathrm { ~ i f ~ } } D ^ { + } h ( { \boldsymbol { x } } + { \boldsymbol { z } } d ; d ) = D ^ { + } h ( { \boldsymbol { x } } + { \boldsymbol { z } } d ; - d ) } \\ { { \mathrm { u n d e f i n e d } } } & { { \mathrm { ~ i f ~ } } D ^ { + } h ( { \boldsymbol { x } } + { \boldsymbol { z } } d ; d ) \neq D ^ { + } h ( { \boldsymbol { x } } + { \boldsymbol { z } } d ; - d ) } \end{array} \right. }
|
| 325 |
+
$$
|
| 326 |
+
|
| 327 |
+
For ReLU network, there can be at most finite number of points in $z \in ( 0 , r )$ such that $g ^ { \prime } ( z )$ does not exist. This can be shown because each discontinuous $z$ is caused by some ReLU activation, and there are only finite combinations. Let $0 = z _ { 0 } < z _ { 1 } < \dots < z _ { k - 1 } < z _ { k } = 1$ be those points. Then, using the fundamental theorem of calculus on each interval separately, there exists $\bar { z } _ { i } \in \mathsf { \Gamma } ( z _ { i } , z _ { i - 1 } )$ for each $i$ such that
|
| 328 |
+
|
| 329 |
+
$$
|
| 330 |
+
\begin{array} { l } { \displaystyle u ( r ) - u ( 0 ) \le \sum _ { i = 1 } ^ { k } | u ( z _ { i } ) - u ( z _ { i - 1 } ) | } \\ { \displaystyle \le \sum _ { i = 1 } ^ { k } | u ^ { \prime } ( \bar { z } _ { i } ) ( z _ { i } - z _ { i - 1 } ) | } \\ { \displaystyle \le \sum _ { i = 1 } ^ { k } L _ { q } | z _ { i } - z _ { i - 1 } | _ { p } } \\ { \displaystyle = L _ { q } | | x - y | | _ { p } . } \end{array}
|
| 331 |
+
$$
|
| 332 |
+
|
| 333 |
+
(Mean value theorem)
|
| 334 |
+
|
| 335 |
+
Theorem 3.2 and its corollaries remain valid after replacing Lemma 3.1 with Lemma 3.3.
|
| 336 |
+
|
| 337 |
+
# D THEOREM D.1 AND ITS PROOF
|
| 338 |
+
|
| 339 |
+
Theorem D.1 $( F _ { Y } ( y )$ of one-hidden-layer neural network). Consider a neural network $f : \mathbb { R } ^ { d } $ $\mathbb { R } ^ { K }$ with input $\pmb { x _ { 0 } } \in \mathbb { R } ^ { d }$ , a hidden layer with $U$ hidden neurons, and rectified linear unit (ReLU) activation function. If we sample uniformly in a ball $B _ { p } ( { \pmb x } _ { \mathbf { 0 } } , R )$ , then the cumulative distribution function of $\| \nabla g ( { \pmb x } ) \| _ { q }$ , denoted as $F _ { Y } ( y )$ , is piece-wise linear with at most $\begin{array} { r } { M = \sum _ { i = 0 } ^ { d } \binom { U } { i } } \end{array}$ pieces, where $g ( { \pmb x } ) = f _ { c } ( { \pmb x } ) - f _ { j } ( { \pmb x } )$ for some given $c$ and $j$ , and $\begin{array} { r } { \frac { 1 } { p } + \frac { 1 } { q } = 1 , 1 \leq p , q \leq \infty } \end{array}$ .
|
| 340 |
+
|
| 341 |
+
Proof. The $j _ { \mathrm { t h } }$ output of a one-hidden-layer neural network can be written as
|
| 342 |
+
|
| 343 |
+
$$
|
| 344 |
+
f _ { j } ( \pmb { x } ) = \sum _ { r = 1 } ^ { U } V _ { j r } \cdot \sigma \left( \sum _ { i = 1 } ^ { d } W _ { r i } \cdot x _ { i } + b _ { r } \right) = \sum _ { r = 1 } ^ { U } V _ { j r } \cdot \sigma \left( { \pmb { w } } _ { r } { \pmb { x } } + b _ { r } \right) ,
|
| 345 |
+
$$
|
| 346 |
+
|
| 347 |
+
where $\sigma ( z ) = \operatorname* { m a x } ( z , 0 )$ is ReLU activation function, $W$ and $V$ are the weight matrices of the first and second layer respectively, and ${ \pmb w } _ { r }$ is the $r _ { \mathrm { t h } }$ row of $W$ . Thus, we can compute $g ( { \pmb x } )$ and $\| \nabla g ( { \pmb x } ) \| _ { q }$ below:
|
| 348 |
+
|
| 349 |
+
$$
|
| 350 |
+
\begin{array} { l } { { \displaystyle g ( { \pmb x } ) = f _ { c } ( { \pmb x } ) - f _ { j } ( { \pmb x } ) = \sum _ { r = 1 } ^ { U } V _ { c r } \cdot \sigma \left( { \pmb w } _ { r } { \pmb x } + b _ { r } \right) - \sum _ { r = 1 } ^ { U } V _ { j r } \cdot \sigma \left( { \pmb w } _ { r } { \pmb x } + b _ { r } \right) } } \\ { { \displaystyle ~ = \sum _ { r = 1 } ^ { U } ( V _ { c r } - V _ { j r } ) \cdot \sigma \left( { \pmb w } _ { r } { \pmb x } + b _ { r } \right) } } \end{array}
|
| 351 |
+
$$
|
| 352 |
+
|
| 353 |
+
and
|
| 354 |
+
|
| 355 |
+
$$
|
| 356 |
+
\| \nabla g ( \pmb { x } ) \| _ { q } = \left\| \sum _ { r = 1 } ^ { U } \mathbb { I } ( \pmb { w } _ { r } \pmb { x } + b _ { r } ) ( \pmb { V } _ { c r } - \pmb { V } _ { j r } ) \pmb { w } _ { r } ^ { \top } \right\| _ { q } ,
|
| 357 |
+
$$
|
| 358 |
+
|
| 359 |
+
where $\mathbb { I } ( z )$ is an univariate indicator function:
|
| 360 |
+
|
| 361 |
+
$$
|
| 362 |
+
\mathbb { I } ( z ) = { \left\{ \begin{array} { l l } { 1 , } & { { \mathrm { ~ i f ~ } } z > 0 , } \\ { 0 , } & { { \mathrm { ~ i f ~ } } z \leq 0 . } \end{array} \right. }
|
| 363 |
+
$$
|
| 364 |
+
|
| 365 |
+

|
| 366 |
+
Figure 8: Illustration of Theorem D.1 with $d = 2$ , $q = 2$ and $U = 3$ . The three hyperplanes ${ \pmb w } _ { i } { \pmb x } + b _ { i } = 0$ divide the space into seven regions (with different colors). The red dash line encloses the ball $B _ { 2 } ( { \pmb x } _ { \mathbf 0 } , R _ { 1 } )$ and the blue dash line encloses a larger ball $B _ { 2 } ( { \pmb x } _ { \mathbf 0 } , R _ { 2 } )$ . If we draw samples uniformly within the balls, the probability of $\| \nabla g ( { \pmb x } ) \| _ { 2 } = y$ is proportional to the intersected volumes of the ball and the regions with $\| \nabla g ( { \pmb x } ) \| _ { 2 } = y$ .
|
| 367 |
+
|
| 368 |
+
As illustrated in Figure 8, the hyperplanes ${ \pmb w } _ { r } { \pmb x } + b _ { r } = 0 , r \in \{ 1 , . . . , U \}$ divide the $d$ dimensional spaces $\mathbb { R } ^ { d }$ into different regions, with the interior of each region satisfying a different set of inequality constraints, e.g. ${ \pmb w } _ { r _ { + } } { \pmb x } + b _ { r _ { + } } > 0$ and ${ \pmb w } _ { r _ { - } } { \pmb x } + b _ { r _ { - } } < 0$ . Given $_ { \textbf { \em x } }$ , we can identify which region it belongs to by checking the sign of ${ \pmb w } _ { r } { \pmb x } + b _ { r }$ for each $r$ . Notice that the gradient norm is the same for all the points in the same region, i.e. for any $\scriptstyle { \mathbf { { \vec { x } } } } _ { 1 }$ , $\mathbf { \boldsymbol { x } } _ { 2 }$ satisfying $\mathbb { I } ( \pmb { w } _ { r } \pmb { x } _ { 1 } + b _ { r } ) = \mathbb { I } ( \pmb { w } _ { r } \pmb { x } _ { 2 } + b _ { r } ) \ \forall r$ , we hfor a e -d $\| \nabla g ( \pmb { x } _ { 1 } ) \| _ { q } = \| \nabla g ( \pmb { x } _ { 2 } ) \| _ { q }$ . Since theperplanes, t most can ta $\begin{array} { r } { M = \sum _ { i = 0 } ^ { d } \binom { U } { i } } \end{array}$ different regionserent values. $d$ $U$ $\| \nabla g ( { \pmb x } ) \| _ { q }$ $M$
|
| 369 |
+
|
| 370 |
+
Therefore, if we perform uniform sampling in a ball $B _ { p } ( { \pmb x } _ { 0 } , R )$ centered at $\scriptstyle { \mathbf { { \mathit { x } } } } _ { \mathbf { 0 } }$ with radius $R$ and denote $\| \nabla g ( { \pmb x } ) \| _ { q }$ as a random variable $Y$ , the probability distribution of $Y$ is discrete and its CDF is piece-wise constant with at most $M$ pieces. Without loss of generality, assume there are $M _ { 0 } \leq M$ distinct values for $Y$ and denote them as ${ \mathfrak { m } } _ { ( 1 ) } , { \mathfrak { m } } _ { ( 2 ) } , \ldots , { \mathfrak { m } } _ { ( M _ { 0 } ) }$ in an increasing order, the CDF of $Y$ , denoted as $F _ { Y } ( y )$ , is the following:
|
| 371 |
+
|
| 372 |
+
$$
|
| 373 |
+
F _ { Y } ( m _ { ( i ) } ) = F _ { Y } ( m _ { ( i - 1 ) } ) + \frac { \mathbb { V } _ { d } ( \{ x \mid \| \nabla g ( x ) \| _ { q } = m _ { ( i ) } \} ) \cap \mathbb { V } _ { d } ( B _ { p } ( x _ { 0 } , R ) ) ) } { \mathbb { V } _ { d } ( B _ { p } ( x _ { 0 } , R ) ) } , i = 1 , \ldots , M _ { 0 } ,
|
| 374 |
+
$$
|
| 375 |
+
|
| 376 |
+
where $F _ { Y } ( m _ { ( 0 ) } ) = 0$ with $m _ { ( 0 ) } < m _ { ( 1 ) } , \mathbb { V } _ { d } ( E )$ is the volume of $E$ in a $d$ dimensional space.
|
| 377 |
+
|
| 378 |
+
# E ADDITIONAL EXPERIMENTAL RESULTS
|
| 379 |
+
|
| 380 |
+
# E.1 PERCENTAGE OF EXAMPLES HAVING P VALUE $> 0 . 0 5$
|
| 381 |
+
|
| 382 |
+
Table 5 shows the percentage of examples where the null hypothesis cannot be rejected by K-S test, indicating that the maximum gradient norm samples fit reverse Weibull distribution well.
|
| 383 |
+
|
| 384 |
+
Table 5: Percentage of estimations where the null hypothesis cannot be rejected by K-S test for a significance level of 0.05. The bar plots of this table are illustrated in Figure 3.
|
| 385 |
+
|
| 386 |
+
<table><tr><td rowspan="2"></td><td colspan="2">Least Likely</td><td colspan="2">Random</td><td colspan="2">Top-2</td></tr><tr><td>L2</td><td>L8</td><td>L2</td><td>Lo</td><td>L2</td><td>L8</td></tr><tr><td>MNIST-MLP</td><td>100.0</td><td>100.0</td><td>100.0</td><td>100.0</td><td>100.0</td><td>100.0</td></tr><tr><td>MNIST-CNN</td><td>99.6</td><td>99.8</td><td>99.2</td><td>100.0</td><td>99.4</td><td>100.0</td></tr><tr><td>MNIST-DD</td><td>99.8</td><td>100.0</td><td>99.6</td><td>99.8</td><td>99.8</td><td>99.8</td></tr><tr><td>MNIST-BReLU</td><td>93.3</td><td>95.4</td><td>96.8</td><td>96.8</td><td>97.6</td><td>98.2</td></tr><tr><td>CIFAR-MLP</td><td>100.0</td><td>100.0</td><td>100.0</td><td>100.0</td><td>100.0</td><td>100.0</td></tr><tr><td>CIFAR-CNN</td><td>100.0</td><td>100.0</td><td>100.0</td><td>100.0</td><td>100.0</td><td>100.0</td></tr><tr><td>CIFAR-DD</td><td>99.7</td><td>99.5</td><td>100.0</td><td>100.0</td><td>99.7</td><td>99.7</td></tr><tr><td>CIFAR-BReLU</td><td>99.5</td><td>99.2</td><td>100.0</td><td>100.0</td><td>99.7</td><td>99.7</td></tr><tr><td>Inception-v3</td><td>100.0</td><td>100.0</td><td>100.0</td><td>100.0</td><td>100.0</td><td>100.0</td></tr><tr><td>Resnet-50</td><td>99.0</td><td>100.0</td><td>100.0</td><td>100.0</td><td>100.0</td><td>100.0</td></tr><tr><td>MobileNet</td><td>100.0</td><td>100.0</td><td>100.0</td><td>100.0</td><td>98.0</td><td>99.0</td></tr></table>
|
| 387 |
+
|
| 388 |
+
# E.2 CLEVER V.S. NUMBER OF SAMPLES
|
| 389 |
+
|
| 390 |
+
Figure 9 shows the $\ell _ { 2 }$ CLEVER score with different number of samples $( N _ { b } = 5 0 , 1 0 0 , 2 5 0 , 5 0 0 )$ for MNIST and CIFAR models. For most models except MNIST-BReLU, reducing the number of samples only change CLEVER scores very slightly. For MNIST-BReLU, increasing the number of samples improves the estimated lower bound, suggesting that a larger number of samples is preferred. In practice, we can start with a relatively small $N _ { b } = a$ , and also try $2 a , 4 a , \cdots$ samples to see if CLEVER scores change significantly. If CLEVER scores stay roughly the same despite increasing $N _ { b }$ , we can conclude that using $N _ { b } = a$ is sufficient.
|
| 391 |
+
|
| 392 |
+

|
| 393 |
+
Figure 9: Comparison of the CLEVER score calculated by $N _ { b } = \{ 5 0 , 1 0 0 , 2 5 0 , 5 0 0 \}$ and the $\ell _ { 2 }$ norm of adversarial distortion found by CW attack (CW) on MNIST and CIFAR models with 3 target types.
|
md/train/Bke6vTVYwH/Bke6vTVYwH.md
ADDED
|
@@ -0,0 +1,291 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GRAPH CONVOLUTIONAL NETWORKS FOR LEARNING WITH FEW CLEAN AND MANY NOISY LABELS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
In this work we consider the problem of learning a classifier from noisy labels when a few clean labeled examples are given. The structure of clean and noisy data is modeled by a graph per class and Graph Convolutional Networks (GCN) are used to predict class relevance of noisy examples. For each class, the GCN is treated as a binary classifier learning to discriminate clean from noisy examples using a weighted binary cross-entropy loss function, and then the GCN-inferred “clean” probability is exploited as a relevance measure. Each noisy example is weighted by its relevance when learning a classifier for the end task. We evaluate our method on an extended version of a few-shot learning problem, where the few clean examples of novel classes are supplemented with additional noisy data. Experimental results show that our GCN-based cleaning process significantly improves the classification accuracy over not cleaning the noisy data and standard few-shot classification where only few clean examples are used. The proposed GCN-based method outperforms the transductive approach (Douze et al., 2018) that is using the same additional data without labels.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
State-of-the-art deep learning methods require a large amount of manually labeled data. The need for supervision may be reduced by decoupling representation learning from the end task and/or using additional training data that are unlabeled, weakly labeled (with noisy labels), or belong to different domains or classes. Example approaches are transfer learning (Wang & Gupta, 2015), unsupervised representation learning (Wang & Gupta, 2015), semi-supervised learning (Weston et al., 2008), learning from noisy labels (Joulin et al., 2016) and few-shot learning (Snell et al., 2017).
|
| 12 |
+
|
| 13 |
+
Learning from noisy labels allows using large-scale data and labels from the web without human annotation effort. Most work focuses on learning the representation jointly with the end task, assuming there is still a considerable amount of clean labeled data (Patrini et al., 2017; Lee et al., 2018; Li et al., 2017). However, for a number of classes only very few or even no clean labeled examples might be available at the representation learning stage. Few-shot learning limits the labeled data to very few on the end task, while the representation is learned on a large training set of different classes (Hariharan & Girshick, 2017; Snell et al., 2017; Vinyals et al., 2016). Nevertheless, in many situations, more data with noisy labels are available or can be acquired for the end task.
|
| 14 |
+
|
| 15 |
+
One interesting mix of few-shot learning with additional large-scale data is the work of Douze et al. (2018), where labels are propagated from few clean labeled examples to a large-scale collection. This collection is unlabeled and actually contains data of many more classes than the end task. Their method overall improves the classification accuracy, but at an additional computational cost; it is a transductive method, i.e., instead of learning a parametric classifier, the large-scale collection is still necessary at inference.
|
| 16 |
+
|
| 17 |
+
In this work, we learn a classifier from few clean labeled examples and additional weakly labeled data, while the representation is learned on different classes, as in few-shot learning. We assume the class names are known, and we use them to search an existing large collection of images with textual description. The result is a set of images with potentially relevant, but noisy labels. As shown in Figure 1, we clean this data using a graph convolutional network (GCN) (Kipf & Welling, 2017), which learns to predict a class relevance score per image based on the source (clean vs. noisy) of its connections in the graph. Both the clean and the noisy images are then used to learn a classifier, where the noisy examples are weighted by relevance. Unlike most existing work, our method operates independently per class and applies when clean labeled examples are few or even one per class.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Overview of our cleaning approach for 1-shot learning with noisy examples. We use the class name admiral to crawl noisy images from web and create an adjacency graph based on visual similarity. We then assign a relevance score to each noisy example with a graph convolutional network (GCN). Relevance scores are displayed next to the images.
|
| 21 |
+
|
| 22 |
+
We make the following contributions:
|
| 23 |
+
|
| 24 |
+
• We learn a classifier on a large-scale weakly-labeled collection jointly with only few clean labeled examples.
|
| 25 |
+
• To our knowledge, we are the first to use a GCN to clean noisy data: we cast a GCN as a binary classifier learning to discriminate clean from noisy data, and we use its inferred probabilities for the “clean” class as a relevance score per example.
|
| 26 |
+
We apply our method to a few-shot learning benchmark and show significant improvement in accuracy, while outperforming the method by Douze et al. (2018) using the same large-scale collection of data.
|
| 27 |
+
|
| 28 |
+
# 2 RELATED WORK
|
| 29 |
+
|
| 30 |
+
Learning with noisy labels is often concerned with estimating or learning a transition matrix (Natarajan et al., 2013; Patrini et al., 2017; Sukhbaatar et al., 2014) or knowledge graph (Li et al., 2017) between labels and correcting the loss function, which does not apply in our case since the classes in the noisy data are unknown. Most recent work on learning from large-scale weakly-labeled data focuses on learning the representation e.g. by metric learning (Lee et al., 2018; Wang et al., 2018a), bootstrapping (Reed et al., 2015), or distillation (Li et al., 2017). In our case however, since the clean labeled examples are few, we need to keep the representation mostly fixed.
|
| 31 |
+
|
| 32 |
+
Dealing with the noise, e.g. by thresholding (Lee et al., 2018), outlier detection (Wang et al., 2018a) or reweighting (Liu & Tao, 2015), is applicable while the representation is learned, based e.g. on the gradient of the loss (Ren et al., 2018b). In contrast, the relatively-shallow GCN that we propose effectively decouples reweighting from both representation learning and classifier learning. Learning to clean the noisy labels (Veit et al., 2017) typically assumes adequate human verified labels for training, which again is not the case in this work.
|
| 33 |
+
|
| 34 |
+
Few-shot learning. Meta-learning (Vilalta & Drissi, 2002) refers to learning at two levels, where generic knowledge is acquired before adapting to more specific tasks. In few-shot learning, this translates to learning on a set of base classes how to learn from few examples on a distinct set of novel classes without overfitting. For instance, optimization meta-learning (Finn et al., 2017; 2018; Ravi & Larochelle, 2017) amounts to learning a model that is easy to fine-tune in few steps. In our work, we study an extension of few-shot learning where more data are available on novel classes, reducing the risk of overfitting when fine-tuning the model. Metric learning approaches learn how to compare queries for instance to few examples (Vinyals et al., 2016) or to the corresponding class prototypes (Snell et al., 2017). Hariharan & Girshick (2017) and Wang et al. (2018b) learn how to generate novel-class examples, which is not needed when more data are actually available.
|
| 35 |
+
|
| 36 |
+
Gidaris & Komodakis (2018) learn on base classes a simpler cosine similarity-based parametric classifier, or simply cosine classifier, without meta-learning. The same classifier has been introduced independently by Qi et al. (2018), who further fine-tune the network, assuming access to the base class training set. A recent survey (Chen et al., 2019) confirms the superiority of the cosine classifier to previous work including meta-learning (Finn et al., 2017). We use the cosine classifier in this work, both for base and novel classes. All of the above use only the few labeled examples of the novel classes.
|
| 37 |
+
|
| 38 |
+
Making use of unlabeled data has been little explored in few-shot learning until recently. Ren et al. (2018a) introduce a semi-supervised few-shot classification task, where some labels are unknown. Liu et al. (2019) follow the same semi-supervised setup, but use graph-based label propagation (LP) (Zhou et al., 2003a) for classification and consider jointly all test images. These methods assume a meta-learning scenario, where only small-scale data is available at each training episode; arguably, such a small amount of data limits the representation adaptation and generalization to unseen data. Similarly, Rohrbach et al. (2013) use label propagation in a transductive setting, but at a larger scale assuming that all examples come from a set of known classes. Douze et al. (2018) extend to even larger scale, leveraging 100M unlabeled images in a graph without using additional text information. We focus on the latter large-scale scenario using the same 100M dataset. However, we filter by text to obtain noisy labels and follow an inductive approach by training a classifier for novel classes, such that the 100M collection is not needed at inference.
|
| 39 |
+
|
| 40 |
+
Graph neural networks are generalizations of convolutional networks to non-Euclidean spaces (Bronstein et al., 2017). Early spectral methods (Bruna et al., 2014; Henaff et al., 2015) have been succeeded by Chebyshev polynomial approximations (Defferrard et al., 2016), which avoid the high computational cost of computing eigenvectors. Graph convolutional networks (GCN) (Kipf & Welling, 2017) provide a further simplification by a first-order approximation of graph filtering and are applied to semi-supervised (Kipf & Welling, 2017) and subsequently to few-shot learning (Garcia & Bruna, 2018). In Kipf & Welling (2017), the loss function is applied to labeled examples to make predictions on unlabeled ones. Similarly in Garcia & Bruna (2018), GCNs make predictions on novel class examples. Gidaris & Komodakis (2019) use Graph Neural Networks as denoising autoencoders to generate class weights for novel classes. In contrast, we cast GCNs as binary classifiers discriminating clean from noisy examples: we apply a loss function to all examples, and then use the inferred probabilities as a class relevance measure, effectively cleaning the data.
|
| 41 |
+
|
| 42 |
+
Our counter-intuitive objective of treating all noisy examples as negative can be compared to treating each example as a different class in instance-level discrimination (Wu et al., 2018). In fact, our loss function is similar to noise-contrastive estimation (NCE) (Gutmann & Hyvärinen, 2010) used in that work. According to our experiments, our GCN-based classifier outperforms classical LP (Zhou et al., 2003a) used for a similar purpose by Rohrbach et al. (2013).
|
| 43 |
+
|
| 44 |
+
# 3 PROBLEM FORMULATION
|
| 45 |
+
|
| 46 |
+
We consider a space $\mathcal { X }$ of examples. We are given a set $X _ { \mathcal { L } } \subset \mathcal { X }$ of examples, each having a clean (manually verified) label in a set $C _ { \mathcal { L } }$ of classes with $| C _ { \mathcal { L } } | = K _ { \mathcal { L } }$ . For any set $X \subset { \mathcal { X } }$ , we denote by $X ^ { c }$ its subset of examples having a label in class $c$ . We assume that the number $| X _ { \mathcal { L } } ^ { c } |$ of examples labeled in each class $c \in C _ { \mathcal { L } }$ is only $k$ , typically in $\{ 1 , 2 , 5 , 1 0 , 2 0 \}$ . We are also given an additional set $X _ { \mathcal { Z } } ^ { c }$ of examples, each with a set of noisy labels in $C _ { \mathcal { L } }$ . The extended set of examples for class $c$ is now $X _ { \mathcal { E } } ^ { c } = X _ { \mathcal { L } } ^ { c } \cup X _ { \mathcal { Z } } ^ { c }$ . Examples or sets of examples having clean (noisy) labels are referred to as clean (noisy) as well. The goal is to train a classifier, using the additional noisy set in order to improve the accuracy compared to only using the small clean set.
|
| 47 |
+
|
| 48 |
+
We assume that we are given a feature extractor $g _ { \theta } : \mathcal { X } \mathbb { R } ^ { d }$ , mapping an example to a $d .$ -dimensional vector. For instance, when examples are images, the feature extractor is typically a convolutional neural network (CNN) and $\theta$ are the parameters of all layers.
|
| 49 |
+
|
| 50 |
+
In this work, we assume that the noisy set $X z$ is collected via web crawling with examples that are images accompanied with free-form text description and/or user tags originating from community photo collections. To make use of text data, we assume that the names of classes in $C _ { \mathcal { L } }$ are given. An example in $X z$ is given a label in class $c \in C _ { \mathcal { L } }$ if its textual information contains the name of class $c$ ; it may then have none, one or more labels. In this way, we automatically infer labels for $X z$ without human effort, which are however noisy.
|
| 51 |
+
|
| 52 |
+
We perform cleaning by predicting a class relevance measure for each noisy example in $X _ { \mathcal { Z } } ^ { c }$ , independently per class $c \in C _ { \mathcal { L } }$ . To simplify notation, we drop superscript $c$ where possible in this subsection and we denote $X _ { \mathcal { E } } ^ { c }$ by $\left\{ x _ { 1 } , \ldots , x _ { k } , x _ { k + 1 } , \ldots , x _ { N } \right\}$ , where $X _ { \mathcal { L } } ^ { c } ~ = ~ \{ \bar { x _ { 1 } } , \ldots , x _ { k } \}$ and $X _ { \mathcal { Z } } ^ { c } = \{ x _ { k + 1 } , \ldots , x _ { N } \}$ . The features of these examples are similarly represented by matrix $V = [ \ b { \mathrm { v } } _ { 1 } , \ b { \mathrm { ~ . ~ . ~ . ~ } } , \ b { \mathrm { v } } _ { k } , \ b { \mathrm { v } } _ { k + 1 } , \ b { \mathrm { ~ . ~ . ~ . ~ } } , \ b { \mathrm { v } } _ { N } ] \in \mathbb { R } ^ { d \times N }$ , where $\mathbf { v } _ { i } = g _ { \theta } ( x _ { i } )$ for $i = 1 , \ldots , N$ .
|
| 53 |
+
|
| 54 |
+
We construct an affinity matrix $A \in \mathbb { R } ^ { N \times N }$ with elements $a _ { i j } = [ \mathbf { v } _ { i } ^ { \top } \mathbf { v } _ { j } ] _ { + }$ if examples $\mathbf { v } _ { i }$ and $\mathbf { v } _ { j }$ are reciprocal nearest neighbors in $X _ { \mathcal { E } } ^ { c }$ and 0 otherwise. Matrix $A$ has zero diagonal, but self-connections are added and then $A$ is normalized as $\tilde { A } = D ^ { - 1 } ( A + I )$ with $D = \mathrm { d i a g } ( ( A + I ) \mathbf { 1 } )$ being the degree matrix of $A + I$ and 1 the all-ones vector.
|
| 55 |
+
|
| 56 |
+
Graph convolutional networks (GCNs) (Kipf & Welling, 2017) are formed by a sequence of layers. Each layer is a function $f _ { \Theta } : \mathbb { R } ^ { \hat { N } \times N } \times \mathbb { R } ^ { l \times \hat { N } } \mathbb { R } ^ { n \times \hat { N } }$ of the form
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
f _ { \Theta } ( \tilde { A } , Z ) = h ( \Theta ^ { \top } Z \tilde { A } ) ,
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
where $Z \in \mathbb { R } ^ { l \times N }$ represents the input features, $\boldsymbol { \Theta } \in \mathbb { R } ^ { l \times n }$ holds the parameters of the layer to be learned, and $h$ is a nonlinear activation function. Function $f _ { \Theta }$ maps $l$ -dimensional input features to $n$ -dimensional output features.
|
| 63 |
+
|
| 64 |
+
In this work we consider a two layer GCN with a scalar output per example. This network is a function $F _ { \Theta } : \mathbb { R } ^ { N \times N } \times \mathbb { R } ^ { d \times N } \bar { \mathbb { R } } ^ { N }$ given by
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
F _ { \Theta } ( \tilde { A } , V ) = \sigma ( \Theta _ { 2 } ^ { \top } [ \Theta _ { 1 } ^ { \top } V \tilde { A } ] _ { + } \tilde { A } ) ,
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where $\Theta = \{ \Theta _ { 1 } , \Theta _ { 2 } \}$ , $\Theta _ { 1 } \in \mathbb { R } ^ { d \times m }$ , $\Theta _ { 2 } \in \mathbb { R } ^ { m \times 1 }$ , $[ \cdot ] _ { + }$ is the positive part or ReLU function (Nair & Hinton, 2010) and $\bar { \sigma ( } x ) = ( 1 + e ^ { - x } ) ^ { - 1 }$ for $x \in \mathbb { R }$ is the sigmoid function. Function $F _ { \Theta }$ performs feature propagation through the affinity matrix in an analogy to classical graph-based propagation methods for classification (Zhou et al., 2003a) or search (Zhou et al., 2003b).
|
| 71 |
+
|
| 72 |
+
The output $F _ { \Theta } ( \tilde { A } , V )$ is a vector of length $N$ , with element $F _ { \Theta } ( { \tilde { A } } , V ) _ { i }$ in $[ 0 , 1 ]$ representing a relevance value of example $x _ { i }$ for class $c$ . To learn the parameters $\Theta$ , we treat the GCN as a binary classifier where target output 1 corresponds to clean examples and 0 to noisy. In particular, we minimize the loss function
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
L _ { \mathcal { G } } ( V , \tilde { A } ; \Theta ) = - \frac { 1 } { k } \sum _ { i = 1 } ^ { k } \log \left( F _ { \Theta } ( \tilde { A } , V ) _ { i } \right) - \frac { \lambda } { N - k } \sum _ { i = k + 1 } ^ { N } \log \left( 1 - F _ { \Theta } ( \tilde { A } , V ) _ { i } \right) .
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
This is a binary cross-entropy loss function where noisy examples are given an importance weight $\lambda$ . Given the propagation on the nearest neighbor graph, and depending on the relative importance $\lambda$ of the second term, noisy examples that are strongly connected to clean ones are still expected to receive high class relevance, while noisy examples that are not relevant to the current class are expected to get a class relevance near zero.
|
| 79 |
+
|
| 80 |
+
The impact of parameter $\lambda$ is validated in Section 6, where we show that the fewer the available clean images are (smaller $k$ ) the smaller the importance weight should be. As is standard practice for GCNs in classification (Kipf & Welling, 2017), training is performed in batches of size $N$ , that is the entire set of features.
|
| 81 |
+
|
| 82 |
+
Figure 2 shows examples of clean images, corresponding noisy ones and the predicted relevance. Thanks to the visual similarity to the clean image, we can use relevance to resolve cases of polysemy, e.g. black widow (spider) vs. black widow (superhero), or cases like pineapple vs. pineapple juice.
|
| 83 |
+
|
| 84 |
+
Discussion. Loss function (3) is similar to noise-contrastive estimation (NCE) (Gutmann & Hyvärinen, 2010) as used by Wu et al. (2018) for instance-level discrimination, whereas we discriminate clean from noisy examples. The semi-supervised learning setup of GCNs (Kipf & Welling, 2017) uses a loss function that applies only to the labeled examples, and makes discrete predictions on unlabeled examples. In our case, all examples contribute to the loss but with different importance, while we infer real-valued class relevance for the noisy examples, to be used for subsequent learning.
|
| 85 |
+
|
| 86 |
+
Function $F _ { \Theta }$ in (2) reduces to a Multi-Layer Perceptron (MLP) when the affinity matrix $A$ is zero, in which case all examples are disconnected. Using an MLP to perform cleaning would take each example into account independently of the others, while the GCN considers the collection of examples as a whole. MLP training is performed identically to GCN by minimizing (3). We compare the two alternatives in our experiments.
|
| 87 |
+
|
| 88 |
+

|
| 89 |
+
Figure 2: Examples of clean images (left) for 1-shot classification, cumulative histogram of the predicted relevance for noisy images (middle), and representative noisy images (right), each having its position in the (descending) ranked list according to relevance and relevance value reported below. Test accuracy without and with additional data using class prototypes (6) is shown next to class names.
|
| 90 |
+
|
| 91 |
+
# 5 LEARNING A CLASSIFIER WITH FEW CLEAN AND MANY NOISY EXAMPLES
|
| 92 |
+
|
| 93 |
+
Our cleaning process applies when the clean labeled examples are few, but assumes a feature extractor $g _ { \theta }$ . That is, representation learning, label cleaning and classifier learning are decoupled. We follow few-shot learning in that we learn the representation by supervised classification on a set of base classes, obtaining $g _ { \theta }$ , and then solving new classification tasks on a distinct set of novel classes. In these new tasks, we assume few clean and many noisy labels as specified in Section 3, perform GCN-based cleaning as described in Section 4, and learn a classifier by weighing examples according to class relevance. Representation and classifier learning are described below.
|
| 94 |
+
|
| 95 |
+
# 5.1 COSINE-SIMILARITY BASED CLASSIFIER
|
| 96 |
+
|
| 97 |
+
We use a cosine-similarity based classifier (Gidaris & Komodakis, 2018; Qi et al., 2018), or cosine classifier for short. Given classes $C$ with $| C | = K$ , each class $c \in C$ is represented by a learnable parameter $\mathbf { w } _ { c } \in \mathbb { R } ^ { d }$ . The prediction of example $x \in \mathcal { X }$ is the class $c$ of maximum cosine similarity $\hat { \mathbf { w } } _ { c } ^ { \top } \hat { g } _ { \boldsymbol { \theta } } ( x ) ^ { 1 }$
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\pi _ { \boldsymbol { \theta } , W } ( x ) = \arg \operatorname* { m a x } _ { c } \hat { \mathbf { w } } _ { c } ^ { \top } \hat { g } _ { \boldsymbol { \theta } } ( x ) ,
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
where $W = [ \mathbf { w } _ { 1 } , \ j . . . , \mathbf { w } _ { K } ] \in \mathbb { R } ^ { d \times K }$ .
|
| 104 |
+
|
| 105 |
+
# 5.2 REPRESENTATION LEARNING: BASE CLASSES
|
| 106 |
+
|
| 107 |
+
We are given a set $X _ { B } \subset { \mathcal { X } }$ of examples, each having a clean label in a set of base classes $C _ { B }$ with $| C _ { B } | = K _ { B }$ . These data are used to learn a feature representation, i.e. a feature extractor $g _ { \theta }$ , by learning a $K _ { B }$ -way base-class classifier for unseen data in $\mathcal { X }$ . The parameters $\theta$ of the feature extractor and $W _ { B }$ of the classifier are jointly learned by minimizing the cross entropy loss
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
{ \cal L } _ { \mathcal B } ( C _ { \mathcal B } , X _ { \mathcal B } ; \boldsymbol { \theta } , W _ { \mathcal B } ) = - \sum _ { c \in C _ { \mathcal B } } \frac { 1 } { | X _ { \mathcal B } ^ { c } | } \sum _ { x \in X _ { \mathcal B } ^ { c } } \log ( \sigma ( s \hat { W } _ { \mathcal B } ^ { \top } \hat { g } _ { \boldsymbol \theta } ( x ) ) _ { c } ) ,
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
where $\sigma : \mathbb { R } ^ { K } \mathbb { R } ^ { K }$ is the softmax function with $\pmb { \sigma } ( \mathbf { a } ) _ { c } = e ^ { a _ { c } } / \sum _ { j \in C } e ^ { a _ { j } }$ for $\mathbf { a } \in \mathbb { R } ^ { K }$ , $s$ is a learnable scale parameter and $\hat { W } _ { \mathcal { B } } = [ \hat { \mathbf { w } } _ { 1 } , \hdots , \hat { \mathbf { w } } _ { K _ { \mathcal { B } } } ] \in \mathbb { R } ^ { d \times K _ { \mathcal { B } } }$ . Learning and inference are
|
| 114 |
+
|
| 115 |
+
performed on base classes by $L _ { B } ( C _ { B } , X _ { B } ; \theta , W _ { B } )$ (5) and $\pi _ { \boldsymbol { \theta } , W _ { B } }$ (4), respectively. As a result, learned feature extractor parameters $\theta$ are used for base or novel classes, while the classifier parameters $W _ { B }$ can be used for base class or all-class classification, as discussed below.
|
| 116 |
+
|
| 117 |
+
# 5.3 NEW CLASSIFICATION TASKS: NOVEL OR ALL CLASSES
|
| 118 |
+
|
| 119 |
+
Each new task is related to a set of novel classes $C _ { \mathcal { L } }$ , disjoint from $C _ { B }$ . The goal is to learn a $K _ { \mathcal { L } }$ -way novel-class classifier or a $K _ { A }$ -way classifier on all classes $C _ { A } = C _ { B } \cup C _ { \mathcal { L } }$ for unseen data in $\mathcal { X }$ , where $K _ { \mathcal { A } } = K _ { B } + K _ { \mathcal { L } }$ . Unlike the typical few-shot learning task, each novel class contains few clean and many noise examples.
|
| 120 |
+
|
| 121 |
+
Prior to learning classifiers for novel classes, training examples $x _ { i } \in X _ { \mathcal { Z } } ^ { c }$ are weighted by their relevance $r ( x _ { i } )$ to class $c$ . For a noisy example $x _ { i } \in X _ { \mathcal { E } } ^ { c }$ , we define $r ( x _ { i } ) = F _ { \Theta } ( \tilde { A } , V ) _ { i }$ where $F _ { \Theta } ( \tilde { A } , V )$ is the output vector of the GCN, while for a clean example $x _ { i } \in X _ { \mathcal { L } } ^ { c }$ we fix $r ( x _ { i } ) = 1$ Note that optimizing (3) does not guarantee $F _ { \Theta } ( \tilde { A } , V ) _ { i } = 1$ for clean examples $x _ { i } \in X _ { \mathcal { L } } ^ { c }$ . We define $\textstyle r ( X ) = \sum _ { x \in X } r ( x )$ for any set $X \subset { \mathcal { X } }$ .
|
| 122 |
+
|
| 123 |
+
We first assume that we no longer have access to examples of base classes in new classification tasks and consider two different classifiers, class prototypes and cosine-similarity based classifier. Then, this assumption is dropped and the classifier and feature representation are learned jointly by fine-tuning the entire network.
|
| 124 |
+
|
| 125 |
+
Class prototypes. For each novel class $c \in C _ { \mathcal { L } }$ , we define prototype ${ \bf w } _ { c }$ by
|
| 126 |
+
|
| 127 |
+
$$
|
| 128 |
+
\mathbf { w } _ { c } = \frac { 1 } { r ( X _ { \mathcal { E } } ^ { c } ) } \sum _ { x \in X _ { \mathcal { E } } ^ { c } } r ( x ) g _ { \theta } ( x ) .
|
| 129 |
+
$$
|
| 130 |
+
|
| 131 |
+
Prototypes are fixed vectors, not learnable parameters. Collecting them into matrix $\begin{array} { r l } { W _ { \mathcal { L } } } & { { } = } \end{array}$ $[ \mathbf { w } _ { 1 } , \dots , \mathbf { w } _ { K _ { \mathcal { L } } } ] \in \mathbb { R } ^ { d \times K _ { \mathcal { L } } }$ , $K _ { \mathcal { L } }$ -way prediction on novel classes is made by classifier $\pi _ { \boldsymbol { \theta } , W _ { \mathcal { L } } }$ (4), while $K _ { A }$ -way prediction on all (base and novel) classes by $\pi _ { \boldsymbol { \theta } , W _ { A } }$ , where $W _ { \mathcal { A } } = [ W _ { B } , W _ { \mathcal { L } } ]$ and $W _ { B }$ is learned according to $L _ { B } ( C _ { B } , X _ { B } ; \theta , W _ { B } )$ (5) and then kept fixed.
|
| 132 |
+
|
| 133 |
+
Cosine classifier learning. Similarly to Section 5.2, given clean and noisy novel-class examples $X _ { \mathcal { E } }$ , we learn a parametric cosine classifier with parameters $W _ { \mathcal { L } } = [ \mathbf { w } _ { 1 } , \dots , \mathbf { w } _ { K _ { \mathcal { L } } } ] \in \mathbb { R } ^ { d \times K _ { \mathcal { L } } }$ by minimizing the weighted cross entropy loss $L _ { \mathcal { L } } ( C _ { \mathcal { L } } , X _ { \mathcal { E } } ; \theta , W _ { \mathcal { L } } )$ over $W _ { \mathcal { L } }$ , where
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
L _ { \mathcal { L } } ( C _ { \mathcal { L } } , X _ { \mathcal { E } } ; \theta , W _ { \mathcal { L } } ) = - \sum _ { c \in C _ { \mathcal { L } } } \frac { 1 } { r ( X _ { \mathcal { E } } ^ { c } ) } \sum _ { x \in X _ { \mathcal { E } } ^ { c } } r ( x ) \log ( \sigma ( s \hat { W } _ { \mathcal { L } } ^ { \top } \hat { g } _ { \theta } ( x ) ) _ { c } ) ,
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
while the parameters $\theta$ of the feature extractor are fixed. The scale parameter $s$ is also fixed to the value obtained during base class learning. Prediction on novel only or all classes is then made as in the previous case.
|
| 140 |
+
|
| 141 |
+
Deep network fine-tuning. We now drop the assumption that base class examples are not accessible and, given all examples $X _ { \mathcal { A } } = X _ { \mathcal { B } } \cup X _ { \mathcal { E } }$ , we jointly learn the parameters $\theta$ of the feature extractor and $W _ { \mathcal { A } } = ( W _ { B } , W _ { \mathcal { L } } )$ of the $K _ { A }$ -way cosine classifier for all classes by minimizing loss function
|
| 142 |
+
|
| 143 |
+
$$
|
| 144 |
+
L _ { A } ( C _ { A } , X _ { A } ; \theta , W _ { A } ) = L _ { B } ( C _ { B } , X _ { B } ; \theta , W _ { B } ) + L _ { \mathcal { L } } ( C _ { \mathcal { L } } , X _ { \mathcal { E } } ; \theta , W _ { \mathcal { L } } ) .
|
| 145 |
+
$$
|
| 146 |
+
|
| 147 |
+
Note that, due to overfitting on the few available examples, such learning is avoided in a few-shot learning setup. In a few cases, it takes the form of fine-tuning including all base class data (Qi et al., 2018), or only lasts for a few iterations when the base class data is not accessible (Finn et al., 2017).
|
| 148 |
+
|
| 149 |
+
# 6 EXPERIMENTS
|
| 150 |
+
|
| 151 |
+
# 6.1 EXPERIMENTAL SETUP
|
| 152 |
+
|
| 153 |
+
Datasets and task setup. We extend the Low-Shot ImageNet benchmark introduced by Hariharan & Girshick (2017) by assuming many noisy examples for novel classes, in addition to the few clean ones. In this benchmark, the 1000 ImageNet classes (Russakovsky et al., 2015) are split into 389 base classes and 611 novel classes. The validation set contains 193 base and 300 novel classes, and the test set the remaining 196 base and 311 novel classes. The standard benchmark includes $k$ -shot classification, i.e. classification on $k$ clean examples per class, which we extend to $k$ clean and many noisy examples per class, with $k \in \{ 1 , 2 , 5 , 1 0 , 2 0 \}$ . Similar to Hariharan & Girshick (2017) we perform 5 tasks, each drawing a subset of $k$ clean examples per class. We report the average top-5 accuracy over the 5 tasks on novel or all classes of the test set.
|
| 154 |
+
|
| 155 |
+
We use the YFCC100M dataset (Thomee et al., 2016) as a source for additional data with noisy labels. It contains approximatively 100M images collected from Flickr. Each image comes with a text description obtained from the user title and caption. We use the text description to obtain images with noisy labels. as discussed in Section 3. This process results in very different numbers of additional examples per class, with a minimum of zero for classes maillot and missile, and a maximum of 620,142 for class church/church building.
|
| 156 |
+
|
| 157 |
+
Representation and classifier learning. In most experiments, we use ResNet-10 (He et al., 2016) as feature extractor as in Gidaris & Komodakis (2018). Classification for novel classes is performed with class prototypes (6), cosine classifier learning (7) or deep network fine-tuning (8). Hyper-parameters such as batch size and number of epochs, are tuned on the validation set. Possible values are 2048, 4096, and 8192 for batchsize and 10, 30 and 50 for number of epochs. The learning rate starts from 0.1 and is reduced to 0.001 at the end of training with cosine annealing (Loshchilov & Hutter, 2017).
|
| 158 |
+
|
| 159 |
+
We handle the imbalance of the noisy set by normalizing by $r ( X _ { c } )$ in (7). Prototypes (6) are used to initialize $W _ { \mathcal { L } }$ of cosine classifier in (7), and the learned $W _ { \mathcal { L } }$ is used to initialize the corresponding part of $W _ { A }$ when fine-tuning the network by (8). In the latter case, we train all layers for 10 epochs with learning rate 0.01. We ignore examples $x _ { i }$ with relevance $r ( x _ { i } ) < 0 . 1$ to reduce the complexity when fine-tuning the network.
|
| 160 |
+
|
| 161 |
+
We also report results with ResNet-50 as feature extractor, using the model trained on base classes by Hariharan & Girshick (2017). Following Douze et al. (2018), we apply PCA to the features to reduce their dimensionality to 256. Base classes are represented by class prototypes (6) in this case.
|
| 162 |
+
|
| 163 |
+
GCN training is performed with Adam optimizer and a learning rate of 0.1 for 100 iterations. We use dropout with probability 0.5. The dimensionality of the input descriptors is $d = 5 1 2$ for ResNet-10 and $d = 2 5 6$ for ResNet-50 (after PCA). Dimensionality of the internal representation in (1) is $m = 1 6$ . The affinity matrix is constructed with reciprocal top-50 nearest neighbors.
|
| 164 |
+
|
| 165 |
+
Baselines. We implement and evaluate several baseline methods. $\beta$ -cleaning assigns $r ( x _ { i } ) = \beta$ to all additional examples. We report results for $\beta = 1 . 0$ (unit relevance score) and $\beta ^ { * }$ , the optimal $\beta$ for all $k$ obtained on the validation set. $M L P$ , discussed in Section 4, learns a nonlinear mapping to assign relevance, but does not propagate over the graph. Label Propagation (LP) (Zhou et al., 2003a) propagates information by a linear operation. It solves the linear system $( I - \alpha D ^ { - 1 / 2 } A D ^ { - 1 / 2 } ) \mathbf { r } _ { c } =$ $\mathbf { y } _ { c }$ (Iscen et al., 2017) for each class $c$ , where $D$ is the degree matrix of $A$ , $\alpha = 0 . 9$ and $\mathbf { y } _ { c } \in \mathbb { R } ^ { N }$ is a $k$ -hot binary vector indicating the labeled examples of class $c$ . Relevance $r ( x _ { i } )$ is then the $i$ -th element $( \mathbf { r } _ { c } ) _ { i }$ of the solution.
|
| 166 |
+
|
| 167 |
+
# 6.2 EXPERIMENTAL RESULTS
|
| 168 |
+
|
| 169 |
+
The impact of importance weight $\lambda$ is measured on the validation set and the best performing value is used on the test set for each value of $k$ . Results are shown in Appendix A. The larger the value of $\lambda$ , the more the loss encourages noisy examples to be classified as negatives. As a consequence, large (small) $\lambda$ results in smaller (larger) relevance, on average, for noisy examples. The optimal $\lambda$ per value of $k$ suggests that the fewer the clean examples the larger the need for additional ones.
|
| 170 |
+
|
| 171 |
+
Comparison with baselines using additional data is presented in Table 1. The use of additional data is mostly harmful for $\beta$ -weighting except for 1 and 2-shot. MLP offers improvements in most cases, implying that it manages to appropriately downweigh irrelevant examples. The consistent improvement of our method compared to MLP, especially large for small $k$ , suggests that it is beneficial to incorporate relations, with the affinity matrix $A$ modeling the structure of the feature space. LP is a classic approach that also uses $A$ but is a linear operation with no parameters, and is inferior to our method. The gain of cleaning ( $\beta = 1$ vs. ours) ranges from $11 \%$ to $20 \%$ .
|
| 172 |
+
|
| 173 |
+
Table 1: Comparison with baselines using noisy examples. We report top-5 accuracy on novel classes with classification by class prototypes (6).
|
| 174 |
+
|
| 175 |
+
<table><tr><td>Method</td><td>k=1</td><td>2</td><td>5</td><td>10</td><td>20</td></tr><tr><td colspan="6">FEW CLEAN EXAMPLES</td></tr><tr><td>Class proto.Gidaris & Komodakis (2018)</td><td>45.3±0.65</td><td>57.1±0.37</td><td>69.3±0.32</td><td>74.8±0.20</td><td>77.8±0.24</td></tr><tr><td colspan="6">FEW CLEAN & MANY NOISY EXAMPLES</td></tr><tr><td>β-weighting,β=1</td><td>56.1±0.06</td><td>56.4±0.08</td><td>57.1±0.05</td><td>57.7±0.08</td><td>58.7±0.06</td></tr><tr><td>β-weighting,β*</td><td>55.6±0.24</td><td>58.3±0.14</td><td>63.4±0.25</td><td>67.5±0.34</td><td>71.0±0.22</td></tr><tr><td>Label Propagation Zhou et al. (2003a)</td><td>62.6±0.35</td><td>67.0±0.41</td><td>74.6±0.30</td><td>76.3±0.23</td><td>77.7±0.18</td></tr><tr><td>MLP</td><td>63.6±0.41</td><td>68.8±0.42</td><td>73.9±0.25</td><td>75.6±0.21</td><td>77.6±0.21</td></tr><tr><td>Ours</td><td>67.8±0.10</td><td>70.9±0.30</td><td>73.7±0.17</td><td>76.1±0.12</td><td>78.2±0.14</td></tr></table>
|
| 176 |
+
|
| 177 |
+
<table><tr><td>METHOD</td><td colspan="4">NoVEL CLASSES</td><td colspan="5">ALL CLASSES</td></tr><tr><td>k=1</td><td>2</td><td>5</td><td>10</td><td>20</td><td>k=1</td><td>2</td><td>5</td><td>10</td><td>20</td></tr><tr><td colspan="10">RESNET-10 -FEW CLEAN EXAMPLES</td></tr><tr><td>Proto.-Nets (Snell et al., 2017)</td><td>39.3</td><td>54.4 66.3</td><td>71.2</td><td>73.9</td><td>49.5</td><td>61.0</td><td>69.7</td><td>72.9</td><td>74.6</td></tr><tr><td>Logistic reg.w/H(Wang et al.,2018b)</td><td>40.7</td><td>50.8 62.0</td><td>69.3</td><td>76.5</td><td>52.2</td><td>59.4</td><td>67.6</td><td>72.8</td><td>76.9</td></tr><tr><td>PMN w/H(Wang et al., 2018b)</td><td>45.8</td><td>57.8 69.0</td><td>74.3</td><td>77.4</td><td>57.6</td><td>64.7</td><td>71.9</td><td>75.2</td><td>77.5</td></tr><tr><td>Class proto.(Gidaris & Komodakis,2018)</td><td></td><td></td><td>45.3±0.6557.1±0.37 69.3±0.32 74.8±0.20 77.8±0.24</td><td></td><td></td><td></td><td></td><td></td><td>57.0±0.3664.7±0.1672.5±0.1875.8±0.1677.4±0.19 58.1±0.4865.2±0.15 72.9±0.25 76.6±0.18 78.8±0.16</td></tr><tr><td colspan="10">Class proto.w/At.(Gidaris& Komodakis,2018) 45.8±0.74 57.4±0.38 69.6±0.27 75.0±0.29 78.2±0.23</td></tr><tr><td></td><td></td><td></td><td>RESNET-1O -FEW CLEAN& MANY NOISY EXAMPLES</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Ours -class proto.(6) Ours-cosine (7)</td><td></td><td></td><td>67.8±0.10 70.9±0.30 73.7±0.20 76.1±0.16 78.2±0.14</td><td></td><td></td><td></td><td></td><td></td><td>70.3±0.05 72.1±0.18 74.1±0.12 75.6±0.13 76.9±0.09</td></tr><tr><td>Ours - fine-tune (8)</td><td></td><td>73.2±0.14 75.3±0.25 75.6±0.24 78.5±0.32 80.7±0.26 74.6±0.13 76.6±0.26 78.2±0.23 80.9±0.34 82.9±0.20</td><td></td><td></td><td></td><td></td><td></td><td></td><td>71.9±0.0774.0±0.2376.5±0.1678.3±0.2380.2±0.18 76.0±0.1077.3±0.1378.7±0.1980.7±0.2582.2±0.14</td></tr><tr><td colspan="10">RESNET-50 - FEW CLEAN EXAMPLES</td></tr><tr><td>Proto.-Nets (Snell et al., 2017)</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>PMN w/H(Wang et al.,2018b)</td><td>49.6 64.0 54.7 66.8</td><td>74.4 77.4</td><td>78.1 81.4</td><td>80.0 83.8</td><td>61.4 65.7</td><td>71.4 73.5</td><td>78.0 80.2</td><td>80.0 82.8</td><td>81.1 84.5</td></tr><tr><td colspan="10">RESNET-5O-FEW CLEAN&MANYUNLABELED EXAMPLES</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Diffusion (Douze et al., 2018) Diffusion -logistic (Douze et al.,2018)</td><td></td><td></td><td>63.6±0.61 69.5±0.60 75.2±0.40 78.5±0.34 80.8±0.18</td><td></td><td></td><td>=</td><td>-</td><td></td><td></td></tr><tr><td colspan="10">64.0±0.7071.1±0.82 79.7±0.3883.9±0.10 86.3±0.17 RESNET-5O-FEWCLEAN&MANY NOISY EXAMPLES</td></tr><tr><td>Ours - class proto.(6)</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Ours - cosine (7)</td><td></td><td>78.0±0.38 80.2±0.3380.9±0.17 83.7±0.1985.7±0.11</td><td>69.7±0.44 73.7±0.56 77.0±0.20 79.9±0.30 81.9±0.29</td><td></td><td></td><td>77.6±0.26 79.1±0.20 79.9±0.09 82.1±0.22 83.8±0.11</td><td></td><td></td><td>73.8±0.33 76.6±0.36 78.9±0.19 80.8±0.21 82.2±0.14</td></tr><tr><td>Ours - fine-tune (8)</td><td>80.8±0.25 83.0±0.23 83.8±0.39 86.4±0.23 88.5±0.20</td><td></td><td></td><td></td><td></td><td>81.6±0.20 83.2±0.16 84.3±0.23 86.2±0.17 87.8±0.03</td><td></td><td></td><td></td></tr></table>
|
| 178 |
+
|
| 179 |
+
Table 2: Comparison to the state of the art on the Low-shot ImageNet benchmark. We report top-5 accuracy on novel and all classes. We use class prototypes (6), cosine classifier learning (7) and deep network fine-tuning (8) for classification with our GCN-based data addition method.
|
| 180 |
+
|
| 181 |
+
Comparison with the state of the art is presented in Table 2. We significantly improve the performance by using additional data and cleaning compared to a number of different approaches, including the work by Gidaris & Komodakis (2018), which is our starting point. As expected, the gain is more pronounced for small $k$ , reaching more than $20 \%$ improvement for 1-shot novel accuracy.
|
| 182 |
+
|
| 183 |
+
Closest to ours is the work of Douze et al. (2018), who use the same experimental setup and the same additional data, but without filtering by text and using noisy labels. We outperform their approach in all cases, while requiring much less computation: offline, we construct a separate small graph per class rather than a single graph over the entire 100M collection; online, we perform inference by cosine similarity to one prototype per class or a learned classifier rather than iterative diffusion on the entire collection. Note that by ignoring examples that are not given any noisy label, we are only using a tiny fraction of the 100M collection: in particular, only 3,744,994 images for the 311-class test split of the Low-shot ImageNet benchmark. In contrast to Douze et al. (2018), additional data brings improvement even at 20-shot with classifier learning or network fine-tuning. Most importantly, our approach does not require the entire 100M collection at inference.
|
| 184 |
+
|
| 185 |
+
# 7 CONCLUSIONS
|
| 186 |
+
|
| 187 |
+
In this paper we have introduced a new method for assigning class relevance to noisy images obtained by textual queries with class names. Our approach leverages one or a few labeled images per class and relies on a graph convolutional network (GCN) to propagate visual information from the labeled images to the noisy ones. The GCN is a binary classifier discriminating clean from noisy examples using a weighted binary cross-entropy loss function and inferring “clean” probability as a relevance measure for that class. Experimental results show that using noisy images weighted by this relevance measure significantly improves the classification accuracy.
|
| 188 |
+
|
| 189 |
+
# REFERENCES
|
| 190 |
+
|
| 191 |
+
Michael M Bronstein, Joan Bruna, Yann LeCun, Arthur Szlam, and Pierre Vandergheynst. Geometric deep learning: going beyond euclidean data. IEEE Signal Processing Magazine, 34(4):18–42, 2017.
|
| 192 |
+
|
| 193 |
+
Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann Lecun. Spectral networks and locally connected networks on graphs. In ICLR, 2014.
|
| 194 |
+
|
| 195 |
+
Wei-Yu Chen, Yen-Cheng Liu, Zsolt Kira, Yu-Chiang Frank Wang, and Jia-Bin Huang. A closer look at few-shot classification. ICLR, 2019.
|
| 196 |
+
|
| 197 |
+
Michaël Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. In NeurIPS, 2016.
|
| 198 |
+
|
| 199 |
+
Matthijs Douze, Arthur Szlam, Bharath Hariharan, and Hervé Jégou. Low-shot learning with large-scale diffusion. In CVPR, 2018.
|
| 200 |
+
|
| 201 |
+
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In ICML, 2017.
|
| 202 |
+
|
| 203 |
+
Chelsea Finn, Kelvin Xu, and Sergey Levine. Probabilistic model-agnostic meta-learning. In NeurIPS, 2018.
|
| 204 |
+
|
| 205 |
+
Victor Garcia and Joan Bruna. Few-shot learning with graph neural networks. In ICLR, 2018.
|
| 206 |
+
|
| 207 |
+
Spyros Gidaris and Nikos Komodakis. Dynamic few-shot visual learning without forgetting. In CVPR, 2018.
|
| 208 |
+
|
| 209 |
+
Spyros Gidaris and Nikos Komodakis. Generating classification weights with gnn denoising autoencoders for few-shot learning. In CVPR, 2019.
|
| 210 |
+
|
| 211 |
+
Michael Gutmann and Aapo Hyvärinen. Noise-contrastive estimation: A new estimation principle for unnormalized statistical models. In International Conference on Artificial Intelligence and Statistics, 2010.
|
| 212 |
+
|
| 213 |
+
Bharath Hariharan and Ross Girshick. Low-shot visual recognition by shrinking and hallucinating features. In CVPR, 2017.
|
| 214 |
+
|
| 215 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 216 |
+
|
| 217 |
+
Mikael Henaff, Joan Bruna, and Yann LeCun. Deep convolutional networks on graph-structured data. arXiv preprint arXiv:1506.05163, 2015.
|
| 218 |
+
|
| 219 |
+
Ahmet Iscen, Giorgos Tolias, Yannis Avrithis, Teddy Furon, and Ondrej Chum. Efficient diffusion on region manifolds: Recovering small objects with compact cnn representations. In CVPR, 2017.
|
| 220 |
+
|
| 221 |
+
Armand Joulin, Laurens van der Maaten, Allan Jabri, and Nicolas Vasilache. Learning visual features from large weakly supervised data. In ECCV, 2016.
|
| 222 |
+
|
| 223 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In ICLR, 2017.
|
| 224 |
+
|
| 225 |
+
Kuang-Huei Lee, Xiaodong He, Lei Zhang, and Linjun Yang. CleanNet: Transfer learning for scalable image classifier training with label noise. In CVPR, 2018.
|
| 226 |
+
|
| 227 |
+
Yuncheng Li, Jianchao Yang, Yale Song, Liangliang Cao, Jiebo Luo, and Li-Jia Li. Learning from noisy labels with distillation. In ICCV, 2017.
|
| 228 |
+
|
| 229 |
+
Tongliang Liu and Dacheng Tao. Classification with noisy labels by importance reweighting. IEEE Trans. PAMI, 38(3), 2015.
|
| 230 |
+
|
| 231 |
+
Yanbin Liu, Juho Lee, Minseop Park, Saehoon Kim, Eunho Yang, Sung Ju Hwang, and Yi Yang. Learning to propagate labels: Transductive propagation network for few-shot learning. In ICLR, 2019.
|
| 232 |
+
|
| 233 |
+
Ilya Loshchilov and Frank Hutter. Sgdr: Stochastic gradient descent with warm restarts. ICLR, 2017.
|
| 234 |
+
|
| 235 |
+
Vinod Nair and Geoffrey E Hinton. Rectified linear units improve restricted boltzmann machines. In ICML, 2010.
|
| 236 |
+
|
| 237 |
+
Nagarajan Natarajan, Inderjit S Dhillon, Pradeep K Ravikumar, and Ambuj Tewari. Learning with noisy labels. In NeurIPS, 2013.
|
| 238 |
+
|
| 239 |
+
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.
|
| 240 |
+
|
| 241 |
+
Hang Qi, Matthew Brown, and David G. Lowe. Low-shot learning with imprinted weights. In CVPR, June 2018.
|
| 242 |
+
|
| 243 |
+
Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. In ICLR, 2017.
|
| 244 |
+
|
| 245 |
+
Scott Reed, Honglak Lee, Dragomir Anguelov, Christian Szegedy, Dumitru Erhan, and Andrew Rabinovich. Training deep neural networks on noisy labels with bootstrapping. ICLR, 2015.
|
| 246 |
+
|
| 247 |
+
Mengye Ren, Sachin Ravi, Eleni Triantafillou, Jake Snell, Kevin Swersky, Josh B. Tenenbaum, Hugo Larochelle, and Richard S. Zemel. Meta-learning for semi-supervised few-shot classification. In ICLR, 2018a.
|
| 248 |
+
|
| 249 |
+
Mengye Ren, Wenyuan Zeng, Bin Yang, and Raquel Urtasun. Learning to reweight examples for robust deep learning. In ICML, 2018b.
|
| 250 |
+
|
| 251 |
+
Marcus Rohrbach, Sandra Ebert, and Bernt Schiele. Transfer learning in a transductive setting. In NeurIPS, 2013.
|
| 252 |
+
|
| 253 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. IJCV, 115(3), 2015.
|
| 254 |
+
|
| 255 |
+
Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. In NeurIPS, 2017.
|
| 256 |
+
|
| 257 |
+
Sainbayar Sukhbaatar, Joan Bruna, Manohar Paluri, Lubomir Bourdev, and Rob Fergus. Training convolutional networks with noisy labels. arXiv preprint arXiv:1406.2080, 2014.
|
| 258 |
+
|
| 259 |
+
Bart Thomee, David A. Shamma, Gerald Friedland, Benjamin Elizalde, Karl Ni, Douglas Poland, Damian Borth, and Li-Jia Li. Yfcc $1 0 0 \mathrm { m }$ : The new data in multimedia research. Commun. ACM, 59(2), 2016.
|
| 260 |
+
|
| 261 |
+
Andreas Veit, Neil Alldrin, Gal Chechik, Ivan Krasin, Abhinav Gupta, and Serge Belongie. Learning from noisy large-scale datasets with minimal supervision. In CVPR, July 2017.
|
| 262 |
+
|
| 263 |
+
Ricardo Vilalta and Youssef Drissi. A perspective view and survey of meta-learning. Artificial intelligence review, 18(2):77–95, 2002.
|
| 264 |
+
|
| 265 |
+
Oriol Vinyals, Charles Blundell, Tim Lillicrap, Daan Wierstra, et al. Matching networks for one shot learning. In NeurIPS, 2016.
|
| 266 |
+
|
| 267 |
+
Xiaolong Wang and Abhinav Gupta. Unsupervised learning of visual representations using videos. In CVPR, 2015.
|
| 268 |
+
|
| 269 |
+
Yisen Wang, Weiyang Liu, Xingjun Ma, James Bailey, Hongyuan Zha, Le Song, and Shu-Tao Xia. Iterative learning with open-set noisy labels. In CVPR, 2018a.
|
| 270 |
+
|
| 271 |
+
Yu-Xiong Wang, Ross Girshick, Martial Hebert, and Bharath Hariharan. Low-shot learning from imaginary data. In CVPR, 2018b.
|
| 272 |
+
|
| 273 |
+
Jason Weston, Frédéric Ratle, and Ronan Collobert. Deep learning via semi-supervised embedding. In ICML, 2008.
|
| 274 |
+
|
| 275 |
+
Zhirong Wu, Yuanjun Xiong, Stella Yu, and Dahua Lin. Unsupervised feature learning via non-parametric instance-level discrimination. CVPR, 2018.
|
| 276 |
+
|
| 277 |
+
Dengyong Zhou, Olivier Bousquet, Thomas Navin Lal, Jason Weston, and Bernhard Schölkopf. Learning with local and global consistency. In NeurIPS, 2003a.
|
| 278 |
+
|
| 279 |
+
Dengyong Zhou, Jason Weston, Arthur Gretton, Olivier Bousquet, and Bernhard Schölkopf. Ranking on data manifolds. In NeurIPS, 2003b.
|
| 280 |
+
|
| 281 |
+

|
| 282 |
+
Figure 3: (a) Number of additional images per class $c$ sampled from YFCC-100M for all novel classes of Low-Shot ImageNet. (b) Number of classes per group, when $| X _ { \mathcal { Z } } ^ { c } |$ is sampled logarithmically into groups. (c) Accuracy improvement $\Delta$ Acc (difference of accuracy between our method with noisy examples and the baseline without noisy examples) for prototype classifier, for same groups as in (b).
|
| 283 |
+
|
| 284 |
+
# A APPENDIX
|
| 285 |
+
|
| 286 |
+
Noisy data statistics. We present statistics about the noisy examples of novel classes and the improvements of our method per class. Figure 3 (a) shows that the noisy examples for novel classes are long tailed (in log scale). There is a significant number of classes where we end up with less than 1000 extra examples, but we improve nevertheless; see Figure 3 (c). A small exception is 4 very rare classes out of 311, with around 3 additional images per class (leftmost bin in Figure 3 (b) and (c)). Note that in real world applications, one could use more resources like web queries for additional data.
|
| 287 |
+
|
| 288 |
+
Impact of importance weight $\lambda ,$ . We present the impact of $\lambda$ (3) for different values of $k$ in the validation set of the extended Low-shot ImageNet benchmark in Figure 4.
|
| 289 |
+
|
| 290 |
+

|
| 291 |
+
Figure 4: Impact of $\lambda$ on the validation set of the extended Low-shot ImageNet benchmark with YFCC-100M for noisy examples using class prototypes (6).
|
md/train/ByxQB1BKwH/ByxQB1BKwH.md
ADDED
|
@@ -0,0 +1,313 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ABSTRACT DIAGRAMMATIC REASONING WITH MULTIPLEX GRAPH NETWORKS
|
| 2 |
+
|
| 3 |
+
Duo Wang ∗& Mateja Jamnik & Pietro Lio
|
| 4 |
+
|
| 5 |
+
Department of Computer Science and Technology
|
| 6 |
+
University of Cambridge
|
| 7 |
+
Cambridge, United Kingdom
|
| 8 |
+
{Duo.Wang,Mateja.Jamnik,Pietro.Lio}@cl.cam.ac.uk
|
| 9 |
+
|
| 10 |
+
# ABSTRACT
|
| 11 |
+
|
| 12 |
+
Abstract reasoning, particularly in the visual domain, is a complex human ability, but it remains a challenging problem for artificial neural learning systems. In this work we propose MXGNet, a multilayer graph neural network for multi-panel diagrammatic reasoning tasks. MXGNet combines three powerful concepts, namely, object-level representation, graph neural networks and multiplex graphs, for solving visual reasoning tasks. MXGNet first extracts object-level representations for each element in all panels of the diagrams, and then forms a multi-layer multiplex graph capturing multiple relations between objects across different diagram panels. MXGNet summarises the multiple graphs extracted from the diagrams of the task, and uses this summarisation to pick the most probable answer from the given candidates. We have tested MXGNet on two types of diagrammatic reasoning tasks, namely Diagram Syllogisms and Raven Progressive Matrices (RPM). For an Euler Diagram Syllogism task MXGNet achieves state-of-the-art accuracy of $9 9 . 8 \%$ . For PGM and RAVEN, two comprehensive datasets for RPM reasoning, MXGNet outperforms the state-of-the-art models by a considerable margin.
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
Abstract reasoning has long been thought of as a key part of human intelligence, and a necessary component towards Artificial General Intelligence. When presented in complex scenes, humans can quickly identify elements across different scenes and infer relations between them. For example, when you are using a pile of different types of LEGO bricks to assemble a spaceship, you are actively inferring relations between each LEGO brick, such as in what ways they can fit together. This type of abstract reasoning, particularly in the visual domain, is a crucial key to human ability to build complex things.
|
| 17 |
+
|
| 18 |
+
Many tests have been proposed to measure human ability for abstract reasoning. The most popular test in the visual domain is the Raven Progressive Matrices (RPM) test (Raven (2000)). In the RPM test, the participants are asked to view a sequence of contextual diagrams, usually given as a $3 \times 3$ matrices of diagrams with the bottom-right diagram left blank. Participants should infer abstract relationships in rows or columns of the diagram, and pick from a set of candidate answers the correct one to fill in the blank. Figures 1 (a) shows an example of RPM tasks containing XOR relations across diagrams in rows. More examples can be found in Appendix C. Another widely used test for measuring reasoning in psychology is Diagram Syllogism task (Sato et al. (2015)), where participants need to infer conclusions based on 2 given premises. Figure 1c shows an example of Euler Diagram Syllogism task.
|
| 19 |
+
|
| 20 |
+
Barrett et al. (2018) recently published a large and comprehensive RPM-style dataset named Procedurally Generated Matrices ‘PGM’, and proposed Wild Relation Network (WReN), a state-of-the-art neural net for
|
| 21 |
+
|
| 22 |
+

|
| 23 |
+
Figure 1: (a) shows an example of RPM tasks containing XOR relations across diagrams in rows and the overview of MXGNet architecture. Here $F _ { \rho }$ is object representation module, $E _ { \gamma }$ is edge embeddings module, $G _ { \phi }$ is graph summarization module and $R _ { \theta }$ is reasoning network. (b) shows an example of a multilayer graph formed from objects in the first row of diagrams in the example. (c) An example of syllogism represented in Euler diagrams.
|
| 24 |
+
|
| 25 |
+
RPM-style tasks. While WReN outperforms other state-of-the-art vision models such as Residual Network He et al. (2016), the performance is still far from deep neural nets’ performance on other vision or natural language processing tasks. Recently, there has been a focus on object-level representations (Yi et al. (2018); Hu et al. (2017); Hudson & Manning (2018); Mao et al. (2019); Teney et al. (2017); Zellers et al. (2018)) for visual reasoning tasks, which enable the use of inductive-biased architectures such as symbolic programs and scene graphs to directly capture relations between objects. For RPM-style tasks, symbolic programs are less suitable as these programs are generated from given questions in the Visual-Question Answering setting. In RPM-style tasks there are no explicit questions. Encoding RPM tasks into graphs is a more natural choice. However, previous works on scene graphs (Teney et al. (2017); Zellers et al. (2018)) model a single image as graphs, which is not suitable for RPM tasks as there are many different layers of relations across different subsets of diagrams in a single task.
|
| 26 |
+
|
| 27 |
+
In this paper we introduce MXGNet, a multi-layer multiplex graph neural net architecture for abstract diagram reasoning. Here ’Multi-layer’ means the graphs are built across different diagram panels, where each diagram is a layer. ‘Multiplex’ means that edges of the graphs encode multiple relations between different element attributes, such as colour, shape and position. Multiplex networks are discussed in detail by Kao & Porter (2018). We first tested the application of multiplex graph on a Diagram Syllogism dataset (Wang et al. (2018a)), and confirmed that multiplex graph improves performance on the original model. For RPM task, MXGNet encodes subsets of diagram panels into multi-layer multiplex graphs, and combines summarisation of several graphs to predict the correct candidate answer. With a hierarchical summarisation scheme, each graph is summarised into feature embeddings representing relationships in the subset. These relation embeddings are then combined to predict the correct answer.
|
| 28 |
+
|
| 29 |
+
For PGM dataset (Barrett et al. (2018)), MXGNet outperforms WReN, the previous state-of-the-art model, by a considerable margin. For ‘neutral’ split of the dataset, MXGNet achieves $8 9 . 6 \%$ test accuracy, $1 2 . 7 \%$ higher than WReN’s $7 6 . 9 \%$ . For other splits MXGNet consistently performs better with smaller margins. For the RAVEN dataset (Zhang et al. (2019)), MXGNet, without any auxiliary training with additional labels, achieves $8 3 . 9 1 \%$ test accuracy, outperforming $5 9 . 5 6 \%$ accuracy by the best model with auxiliary training for the RAVEN dataset. We also show that MXGNet is robust to variations in forms of object-level representations. Both variants of MXGNet achieve higher test accuracies than existing best models for the two datasets.
|
| 30 |
+
|
| 31 |
+
# 2 RELATED WORK
|
| 32 |
+
|
| 33 |
+
Raven Progressive Matrices: Hoshen & Werman (2017) proposed a neural network model on Raven-style reasoning tasks that are a subset of complete RPM problems. Their model is based on Convolutional Network, and is demonstrated to be ineffective in complete RPM tasks (Barrett et al. (2018)). Mandziuk & Zychowski also experimented with an auto-encoder based neural net on simple single-shape RPM tasks. Barrett et al. (2018) built PGM, a complete RPM dataset, and proposed WReN, a neural network architecture based on Relation Network (Santoro et al. (2017)).Steenbrugge et al. (2018) replace CNN part of WReN with a pre-trained Variational Auto Encoder and slightly improved performance. Zhang et al. (2019) built RAVEN, a RPM-style dataset with structured labels of elements in the diagrams in the form of parsing trees, and proposed Dynamic Residual Trees, a simple tree neural network for learning with these additional structures. Anonymous (2020) applies Multi-head attention (Vaswani et al. (2017)), originally developed for Language model, on RPM tasks.
|
| 34 |
+
|
| 35 |
+
Visual Reasoning: RPM test falls in the broader category of visual reasoning. One widely explored task of visual reasoning is Visual Question Answering(VQA). Johnson et al. (2017) built CLEVR dataset, a VQA dataset that focuses on visual reasoning instead of information retrieval in traditional VQA datasets. Current leading approaches (Yi et al. (2018); Mao et al. (2019)) on CLEVR dataset generate synthetic programs using questions in the VQA setting, and use these programs to process object-level representations extracted with objection detection models (Ren et al. (2015)). This approach is not applicable to RPM-style problems as there is no explicit question present for program synthesis.
|
| 36 |
+
|
| 37 |
+
Graph Neural Networks: Recently there has been a surge of interest in applying Graph Neural Networks (GNN) for datasets that are inherently structured as graphs, such as social networks. Many variants of GNNs (Li et al. (2015); Hamilton et al. (2017); Kipf & Welling (2016); Velickovi ˇ c et al. (2017)) have been ´ proposed, which are all based on the same principle of learning feature representations of nodes by recursively aggregating information from neighbour nodes and edges. Recent methods (Teney et al. (2017); Zellers et al. (2018)) extract graph structures from visual scenes for visual question answering. These methods build scene graphs in which nodes represent parts of the scene, and edges capture relations between these parts. Such methods are only applied to scenes of a single image. For multi-image tasks such as video classification, Wang et al. (2018b) proposed non-local neural networks, which extract dense graphs where pixels in feature maps are connected to all other feature map pixels in the space-time dimensions.
|
| 38 |
+
|
| 39 |
+
# 3 REASONING TASKS
|
| 40 |
+
|
| 41 |
+
# 3.1 DIAGRAM SYLLOGISM
|
| 42 |
+
|
| 43 |
+
Syllogism is a reasoning task where conclusion is drawn from two given assumed propositions (premises). One well-known example is ’Socrates is a man, all man will die, therefore Socrates will die’. Syllogism can be conveniently represented using many types of diagrams (Al-Fedaghi (2017)) such as Euler diagrams and Venn diagrams. Figure 1 (c) shows an example of Euler diagram syllogism. Wang et al. (2018a) developed Euler-Net, a neural net architecture that tackles Euler diagram syllogism tasks. However Euler-Net is just a simple Siamese Conv-Net, which does not guarantee scalability to more entities in diagrams. We show that the addition of multiplex graph both improves performance and scalability to more entities.
|
| 44 |
+
|
| 45 |
+
# 3.2 RAVEN PROGRESSIVE MATRICES
|
| 46 |
+
|
| 47 |
+
In this section we briefly describe Raven Progressive Matrices (RPM) in the context of the PGM dataset (Barrett et al. (2018)) and the RAVEN dataset (Zhang et al. (2019)). RPM tasks usually have 8 context diagrams and 8 answer candidates. The context diagrams are laid out in a $3 \times 3$ matrix $\mathbf { C }$ where $c _ { 1 , 1 } , . . c _ { 3 , 2 }$ are context diagrams and $^ { c _ { 3 , 3 } }$ is a blank diagram to be filled with 1 of the 8 answer candidates $\mathbf { A } = \{ a _ { 1 } , \ldots , a _ { 8 } \}$ One or more relations are present in rows or/and columns of the matrix. For example, in Figure 1 (a), there is $X O R$ relation of positions of objects in rows of diagrams. With the correct answer filled in, the third row and column must satisfy all relations present in the first 2 rows and columns (in the RAVEN dataset, relations are only present in rows). In addition to labels of correct candidate choice, both datasets also provide labels of meta-targets for auxiliary training. The meta-target of a task is a multi-hot vector encoding tuples of $( r , o , a )$ where $r$ is the type of a relation present, $o$ is the object type and $a$ is the attribute. For example, the meta-target for Figure 1 (a) encodes $( X O R , S h a p e , P o s i t i o n )$ . The RAVEN dataset also provides additional structured labels of relations in the diagram. However, we found that structured labels do not improve results, and therefore did not use them in our implementation.
|
| 48 |
+
|
| 49 |
+
# 4 METHOD
|
| 50 |
+
|
| 51 |
+
MXGNet is comprised of three main components: an object-level representation module, a graph processing module and a reasoning module. Figure 1a shows an overview of the MXGNet architecture. The object-level representation module $F _ { \rho }$ , as the name suggests, extracts representations of objects in the diagrams as nodes in a graph. For each diagram $d _ { i } \subset \mathbf { C } \cup \mathbf { A }$ , a set of nodes $v _ { i , j } ; i = 1 \ldots L , j = 1 \ldots N$ is extracted where $L$ is the number of layers and $N$ is the number of nodes per layer. We experimented with both fixed and dynamically learnt $N$ values. We also experimented with an additional ‘background’ encoder that encodes background lines (See Appendix C for an example containing background lines) into a single vector, which can be considered as a single node. The multiplex graph module $G _ { \phi }$ , for a subset of diagrams, learns the multiplex edges capturing multiple parallel relations between nodes in a multi-layer graph where each layer corresponds to one diagram in the subset, as illustrated in Figure 1 (c). In MXGNet, we consider a subset of cardinality 3 for $3 \times 3$ diagram matrices. While prior knowledge of RPM rules allows us to naturally treat rows and columns in RPM as subsets, this prior does not generalise to other types of visual reasoning problems. Considering all possible diagram combinations as subsets is computationally expensive. To tackle this, we developed a relatively quick pre-training method to greatly reduce the search space of subsets, as described below.
|
| 52 |
+
|
| 53 |
+
Search Space Reduction: We can consider each diagram as node $v _ { i } ^ { d }$ in a graph, where relations between adjacent diagrams are embedded as edges $e _ { i j } ^ { d }$ . Note here we are considering the graph of ’diagrams’, which is different from the graph of ’objects’ in the graph processing modules. Each subset of 3 diagrams in this case can be considered as subset of 2 edges. We here make weak assumptions that edges exist between adjacent diagrams (including vertical, horizontal and diagonal direction) and edges in the same subset must be adjacent (defined as two edges linking the same node), which are often used in other visual reasoning problems. We denote the subset of edges as $\{ e _ { i j } ^ { d } , e _ { j k } ^ { d } \}$ . We use 3 neural nets to embed nodes, edges and subsets. We use CNNs to embed diagram nodes into feature vectors, and MLPs to embed edges based on node embeddings and subsets based on edge embeddings. While it is possible to include graph architectures for better accuracy, we found that simple combinations of CNNs and MLPs train faster while still achieving the search space reduction results. This architecture first embeds nodes, then embeds edges based on node embedding, and finally embed subsets based on edge embedding. The subset embeddings are summed and passed through a reasoning network to predict answer probability, similar to WReN (Barrett et al. (2018)). For the exact configuration of the architecture used please refer to Appendix A. For each subset $\{ e _ { i j } ^ { d } , e _ { j k } ^ { d } \}$ we define a gating variable $G _ { i j k }$ , controlling how much does each subset contributes to the final result. In practice we use tanh function, which allows a subset to contribute both positively and negatively to the final summed embeddings. In training we put L1 regularization constraint on the gating variables to suppress $G _ { i j k }$ of non-contributing subsets close to zero. This architecture can quickly discover rows and columns as contributing subsets while leaving gating variables of other subsets not activated. We describe the experiment results in section 5.1. While this method is developed for discovering reasoning rules for RPM task, it can be readily applied to any other multi-frame reasoning task for search space reduction. In the rest of the paper, we hard-gate subsets by rounding the gating variables, thereby reducing subset space to only treat rows and columns as valid subsets.
|
| 54 |
+
|
| 55 |
+
We treat the first 2 rows and columns as contextual subsets $c _ { i , j }$ where $i$ and $j$ are row and column indices. For the last row and column, where the answers should be filled in, we fill in each of the 8 answer candidates, and make 8 row subsets $a _ { i } , i \subset [ 1 , 8 ]$ and 8 column subsets $a _ { i } , i \subset [ 1 , 8 ]$ .
|
| 56 |
+
|
| 57 |
+
The graph module then summarises the graph of objects in a subset into embeddings representing relations present in the subset. The reasoning module $R _ { \theta }$ takes embeddings from context rows/columns and last rows/columns with different candidate answers filled in, and produce normalised probability of each answer being true. It also predicts meta-target for auxiliary training using context rows/columns. Next, we describe each module in detail.
|
| 58 |
+
|
| 59 |
+
# 4.1 OBJECT-LEVEL REPRESENTATION
|
| 60 |
+
|
| 61 |
+
In the PGM dataset there are two types of objects, namely ‘shapes’ and background ‘lines’. While it is a natural choice to use object-level representation on shapes as they are varying in many attributes such as position and size, it is less efficient on background lines as they only vary in colour intensity. In this section we first describe object-level representation applied to ‘shapes’ objects, and then discuss object-level representation on ’lines’ and an alternative background encoder which performs better.
|
| 62 |
+
|
| 63 |
+
In MXGNet we experiment with two types of object-level representations for ‘shapes’, namely CNN grid features and representation obtained with spatial attention. For CNN grid features, we use each spatial location in the final CNN feature map as the object feature vector. Thus for each feature maps of width $W$ and height $H$ , $N = W \times H$ object representations are extracted. This type of representation is used widely, such as in Relation Network (Santoro et al. (2017)) and VQ-VAE (van den Oord et al. (2017)). For representation obtained with attention, we use spatial attention to attend to locations of objects, and extract representations for each object attended. This is similar to objection detection models such as faster R-CNN (Ren et al. (2015)), which use a Region Proposal Network to propose bounding boxes of objects in the input image. For each attended location a presence variable $z _ { p r e s }$ is predicted by attention module indicating whether an object exists in the location. Thus the total number of objects $N$ can vary depending on the sum of $z _ { p r e s }$ variables. As object-level representation is not the main innovation of this paper, we leave exact details for Appendix A.1.
|
| 64 |
+
|
| 65 |
+
For background ‘lines’ objects, which are not varying in position and size, spatial attention is not needed. We experimented with a recurrent encoder with Long-Short Term Memory (Hochreiter & Schmidhuber (1997)) on the output feature map of CNN, outputting $M$ number of feature vectors. However, in the experiment we found that this performs less well than just feature map embeddings produced by feed-forward conv-net encoder.
|
| 66 |
+
|
| 67 |
+

|
| 68 |
+
Figure 2: Illustration of multiplex edge embeddings and cross-gating function. Each edge contains a set of different sub-connections (colored differently). Multiplex edges connecting to each node in the last layer are aggregated according to its originating layer. Aggregated embeddings are then passed to a gating function $G$ , which outputs gating variables from each aggregated embeddings.
|
| 69 |
+
|
| 70 |
+
# 4.2 MULTIPLEX GRAPH NETWORK
|
| 71 |
+
|
| 72 |
+
Multiplex Edge Embedding:The object-level representation module outputs a set of representations $v _ { i , j } ; i \subset$ $[ 1 , L ] , j \subset [ 1 , N ]$ for ‘shapes’ objects, where $L$ is the number of layers (cardinality of subset of diagrams) and $N$ is the number of nodes per layer. MXGNet uses an multiplex edge-embedding network $E _ { \gamma }$ to generate edge embeddings encoding multiple parallel relation embeddings:
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
e _ { ( i , j ) , ( l , k ) } ^ { t } = E _ { \gamma } ^ { t } ( P ^ { k } ( v _ { i , j } , v _ { l , k } ) ) ; i \neq l , t = 1 \dots T
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
Here $P ^ { t }$ is a projection layer projecting concatenated node embeddings to $T$ different embeddings. $E ^ { t }$ is a small neural net processing $\mathbf { \chi } _ { t ^ { t h } } ^ { * }$ projections to produce the $t ^ { t h }$ sub-layer of edge embeddings. Here, we restricted the edges to be inter-layer only, as we found using intra-layer edges does not improve performance but increases computational costs. Figure 2 illustrates these multiplex edge embeddings between nodes of different layers. We hypothesise that different layers of the edge embeddings encode similarities/differences in different feature spaces. Such embeddings of similarities/differences are useful in comparing nodes for subsequent reasoning tasks. For example,for P rogessive relation of object sizes, part of embeddings encoding size differences can be utilized to check if nodes in later layers are larger in size. This is similar to Mixture of Experts layers (Eigen et al. (2013); Shazeer et al. (2017)) introduced in Neural Machine Translation tasks. However, in this work we developed a new cross-multiplexing gating function at the node message aggregation stage, which is described below.
|
| 79 |
+
|
| 80 |
+
Graph Summarisation: After edge embeddings are generated, the graph module then summarises the graph into a feature embedding representing relations present in the subset of diagrams. We aggregate information in the graph to nodes of the last layer corresponding to the third diagram in a row or column, because in RPM tasks the relations are in the form $D i a g r a m 3 = F u n c t i o n ( D i a g r a m 1 , D i a g r a m 2 )$ ). All edges connecting nodes in a particular layer $v _ { i , j } ; i \ne L$ , to a node $v _ { L , k }$ in the last layer $L$ are aggregated by a function $F _ { a g }$ composed of four different types of set operations, namely max, min, sum and mean:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
f v _ { i , k } = F _ { a g } ( e _ { ( i , 1 ) , ( L , k ) } \cdot \cdot \cdot e _ { ( i , 1 ) , ( L , k ) } ) ; F _ { a g } = c o n c a t ( m a x ( ) , m i n ( ) , s u m ( ) , m e a n ( ) )
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
We use multiple aggregation functions together because different sub-tasks in reasoning may require different types of summarization. For example, counting number of objects is better suited for sum while checking if there is a object with the same size is better suited for max. The aggregated node information from each layer is then combined with a cross-multiplexing gating function. It is named ’cross-multiplexing’ because each embeddings in the set are ’multiplexing’ other embeddings in the set with gating variables that regulate which stream of information pass through. This gating function accepts a set of summarised node embeddings $\{ f v _ { 1 , k } \ldots f v _ { N , k } \}$ as input, and output gating variables for each layer of node embeddings in the set:
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\mathbf { g } _ { 1 , k } \ldots \mathbf { g } _ { N , k } = G ( f v _ { 1 , k } \ldots f v _ { N , k } ) ; \mathbf { g } _ { i , k } = \{ g _ { i , k } ^ { 1 } \ldots g _ { i , k } ^ { T } \}
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
In practice $G$ is implemented as an MLP with multi-head outputs for different embeddings, and Sigmoid activation which constrains gating variable $g$ within the range of 0 to 1. The node embeddings of different layers are then multiplied with the gating variables, concatenated and passed through a small MLP to produce the final node embeddings: $f v _ { k } = M \bar { L } P ( c o n c a t ( \{ f v _ { i , k } \times g _ { ( } i , k ) | \bar { i } = 1 \ldots N \} )$ ). Node embeddings and background embeddings are then concatenated and processed by a residual neural block to produce final relation feature embeddings $r$ of the diagram subset.
|
| 93 |
+
|
| 94 |
+
# 4.3 REASONING NETWORK
|
| 95 |
+
|
| 96 |
+
The reasoning network takes relation feature embeddings $r$ from all graphs, and infers the correct answer based on these relation embeddings. We denote the relation embeddings for context rows as $r _ { i } ^ { c r } ; i = 1 , 2$ and context columns as $r _ { i } ^ { c c } ; i = 1 , 2$ . The last row and column filled with each answer candidate $a _ { i }$ are denoted $r _ { i } ^ { a r } ; i = 1 , . . . , 8$ and $r _ { i } ^ { a c } ; i = 1 , \ldots , 8$ . For the RAVEN dataset, only row relation embeddings $r ^ { c r }$ and $r ^ { a r }$ are used, as discussed in Section 3.2. The reasoning network $R _ { \theta }$ is a multi-layer residual neural net with a softmax output activation that processes concatenated relation embeddings and outputs class probabilities for each answer candidate. The exact configuration of the reasoning network can be found in Appendix A.3.
|
| 97 |
+
|
| 98 |
+
For meta-target prediction, all relation information is contained in the context rows and columns of the RPM task. Therefore, we apply a meta-predicting network $R _ { m e t a }$ with Sigmoid output activation to all context rows and columns to obtain probabilities of each meta-target categories:
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
p _ { m e t a } = R _ { m e t a } ( r _ { 1 } ^ { c r } + r _ { 2 } ^ { c r } + r _ { 1 } ^ { c c } + r _ { 2 } ^ { c c } )
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
# 4.4 TRAINING
|
| 105 |
+
|
| 106 |
+
The full pipeline of MXGNet is end-to-end trainable with any gradient descent optimiser. In practice, we used RAdam optimiser (Liu et al. (2019)) for its fast convergence and robustness to learning rate differences. The loss function for the PGM dataset is the same as used in WReN (Barrett et al. (2018)): $\mathcal { L } = \mathcal { L } _ { a n s } + \beta \mathcal { L } _ { m e t a - t a r g e t }$ where $\beta$ balances the training between answer prediction and meta-target prediction. For the RAVEN dataset, while the loss function can include auxiliary meta-target and structured labels as $\mathcal { L } = \mathcal { L } _ { a n s } + \alpha \mathcal { L } _ { s t r u c t } + \beta \mathcal { L } _ { m e t a - t a r g e t }$ , we found that both auxiliary targets do not improve performance, and thus set $\alpha$ and $\beta$ to 0.
|
| 107 |
+
|
| 108 |
+
# 5 EXPERIMENTS
|
| 109 |
+
|
| 110 |
+
# 5.1 SEARCH SPACE REDUCTION
|
| 111 |
+
|
| 112 |
+
The Search Space Reduction model is applied on both PGM and RAVEN dataset to reduce the subset space. After 10 epochs, only gating variables of rows and columns subset for PGM and of rows for RAVEN have value larger than 0.5. The Gating variables for three rows are 0.884, 0.812 and 0.832. The gating variables for three columns are 0.901, 0.845 and 0.854. All other gating variables are below the threshold value of 0.5. Interestingly all activated (absolute value $> 0 . 5$ ) gating variables are positive. This is possibly because it is easier for the neural net to learn an aggregation function than a comparator function. Exact experiment statistics can be found in Appendix D.
|
| 113 |
+
|
| 114 |
+
# 5.2 DIAGRAM SYLLOGISM PERFORMANCE
|
| 115 |
+
|
| 116 |
+
We first test how well can the multiplex graph network capture relations for the simple Diagram Syllogism task. We simply add the multiplex graph to the original Conv-Net used in (Wang et al. (2018a)). MXGNet achieved $9 9 . 8 \%$ accuracy on both 2-contour and 3-contour tasks, higher than the original paper’s $9 9 . 5 \%$ and $9 9 . 4 \%$ accuracies. The same performance on 2-contour and 3-contour tasks also show that MXGNet scales better for more entities in the diagram. For more details please refer to Appendix E.
|
| 117 |
+
|
| 118 |
+
# 5.3 RPM TASK PERFORMANCES
|
| 119 |
+
|
| 120 |
+
In this section we compare all variants of MXGNet against the state-of-the-art models for the PGM and the RAVEN datasets. For the PGM dataset, we tested against results of WReN (Barrett et al. (2018)) in the auxiliary training setting with $\beta$ value of 10. In addition, we also compared MXGNet with VAE-WReN (Steenbrugge et al. (2018))’s result without auxiliary training. For the RAVEN dataset, we compared with WReN and ResNet model’s performance as reported in the original paper (Zhang et al. (2019)). We evaluated MXGNet with different object-level representations (Section 4.1) on the test data in the ‘neutral’ split of the PGM dataset.
|
| 121 |
+
|
| 122 |
+
Table 1 (a) shows test accuracies of model variants compared with WReN and VAE-WReN for the case without auxiliary training $( \beta = 0$ ) and with auxiliary training ( $\beta = 1 0$ ) for the PGM dataset. Both model variants of MXGNet outperform other models by a considerable margin, showing that the multi-layer graph is indeed a more suitable way to capture relations in the reasoning task. Model variants using grid features from the CNN feature maps slightly outperform model using spatial-attention-based object representations for both with and without auxiliary training settings. This is possibly because the increased number of parameters for the spatial attention variant leads to over-fitting, as the training losses of both model variants are very close. In our following experiments for PGM we will use model variants using CNN features to report performances.
|
| 123 |
+
|
| 124 |
+
Table 1 (b) shows test accuracies of model variants compared with $\mathrm { W R e N }$ the best performing ResNet models for RAVEN dataset. WReN surprisingly only achieves $1 4 . 6 9 \%$ as tested by Zhang et al. (2019). We include results of the ResNet model with or without Dynamic Residual Trees (DRT) which utilise additional structure labels of relations. We found that for the RAVEN dataset, auxiliary training of MXGNet with meta-target or structure labels does not improve performance. Therefore, we report test accuracies of models trained only with the target-prediction objective. Both variants of MXGNet significantly outperform the ResNet models. Models with spatial attention object-level representations under-perform simpler CNN features slightly, most probably due to overfitting, as the observed training losses of spatial attention models are in fact lower than CNN feature models.
|
| 125 |
+
|
| 126 |
+
# 5.4 GENERALISATION EVALUATION FOR PGM
|
| 127 |
+
|
| 128 |
+
In the PGM dataset, other than the neutral data regime in which test dataset’s sampling space is the same as the training dataset, there are also other data regimes which restrict the sampling space of training or test data to evaluate the generalisation capability of a neural network. In the main paper, due to space limitations, we selected 2 representative regimes, the ‘interpolation’ regime and the ‘extrapolation’ regime to report results. For results of other data splits of PGM, please refer to Appendix G. For ‘interpolation’ regime, in the training dataset, when attribute $a = c o l o r$ and $a = s i z e$ , the values of $a$ are restricted to even-indexed values in the spectrum of $a$ values. This tests how well can a model ‘interpolate’ for missing values. For ‘Extrapolation’ regime, in the training dataset, the value of $a$ is restricted to be the lower half of the value spectrum. This tests how well can a model ‘extrapolate’ outside of the value range in the training dataset. Table 2 shows validation and test accuracies for all three data regimes with and without auxiliary training. In addition, differences between validation and test accuracies are also presented to show how well can models generalise. MXGNet models consistently perform better than WReN for all regimes tested. Interesting for ’Interpolation’ regime, while validation accuracy of MXGNet is lower than WReN, the test accuracy is higher. In addition, for regime
|
| 129 |
+
|
| 130 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>WReNBarrett et al.(2018)</td><td rowspan=1 colspan=1>VAE-WReNSteenbrugge et al.(2018)</td><td rowspan=1 colspan=1>ARNeAnonymous (2020)</td><td rowspan=1 colspan=1>MXGNetCNN Sp-Attn</td></tr><tr><td rowspan=1 colspan=1>acc.(%)β= 10</td><td rowspan=1 colspan=1>76.9</td><td rowspan=1 colspan=1>N/A</td><td rowspan=1 colspan=1>88.2</td><td rowspan=1 colspan=1>89.6 88.8</td></tr><tr><td rowspan=1 colspan=1>acc.(%)β= 0</td><td rowspan=1 colspan=1>62.6</td><td rowspan=1 colspan=1>64.2</td><td rowspan=1 colspan=1>N/A</td><td rowspan=1 colspan=1>66.7 66.1</td></tr></table>
|
| 131 |
+
|
| 132 |
+
(a) PGM
|
| 133 |
+
(b) RAVEN
|
| 134 |
+
|
| 135 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>WReNZhang et al. (2019)</td><td rowspan=1 colspan=1>ResNetZhang et al. (2019)</td><td rowspan=1 colspan=1>ResNet+DRTZhang et al. (2019)</td><td rowspan=1 colspan=1>ARNeAnonymous (2020)</td><td rowspan=1 colspan=1>MXGNetCNN Sp-Attn</td></tr><tr><td rowspan=1 colspan=1>acc. (%)</td><td rowspan=1 colspan=1>14.69</td><td rowspan=1 colspan=1>53.43</td><td rowspan=1 colspan=1>59.56</td><td rowspan=1 colspan=1>19.67</td><td rowspan=1 colspan=1>83.91 82.61</td></tr></table>
|
| 136 |
+
|
| 137 |
+
Table 1: (a) shows results comparing MXGNet model variants against $\mathrm { W R e N }$ for the PGM dataset. (b) shows results comparing MXGNet model variants against ResNet models for the RAVEN dataset. The object-level representation has two variations which are (o1) CNN features and (o2) Spatial Attention features (Section 4.1).
|
| 138 |
+
‘Interpolation’ and ‘Extrapolation’, MXGNet also shows a smaller difference between validation and test accuracy. These results show that MXGNet has better capability of generalising outside of the training space.
|
| 139 |
+
|
| 140 |
+
<table><tr><td rowspan="2">Model</td><td rowspan="2">Regime</td><td colspan="3">β=0</td><td colspan="3">β=10</td></tr><tr><td>Val.(%)</td><td> test%</td><td>Diff.</td><td>Val.(%)</td><td> test%</td><td>Diff.</td></tr><tr><td rowspan="3">WReN</td><td>Neutral</td><td>63.0</td><td>62.6</td><td>-0.4</td><td>77.2</td><td>76.9</td><td>-0.3</td></tr><tr><td>Interpolation</td><td>79.0</td><td>64.4</td><td>-14.6</td><td>92.3</td><td>67.4</td><td>-24.9</td></tr><tr><td>Extrapolation</td><td>69.3</td><td>17.2</td><td>-52.1</td><td>93.6</td><td>15.5</td><td>-79.1</td></tr><tr><td rowspan="3">MXGNet</td><td>Neutral</td><td>67.1</td><td>66.7</td><td>-0.4</td><td>89.9</td><td>89.6</td><td>-0.3</td></tr><tr><td>Interpolation</td><td>74.2</td><td>65.4</td><td>-8.8</td><td>91.5</td><td>84.6</td><td>-6.9</td></tr><tr><td>Extrapolation</td><td>69.1</td><td>18.9</td><td>-50.2</td><td>94.3</td><td>18.4</td><td>-75.9</td></tr></table>
|
| 141 |
+
|
| 142 |
+
Table 2: Generalisation performance comparing MXGNet model variants against WReN. ‘Diff.’ is the difference between the test and the validation performances.
|
| 143 |
+
|
| 144 |
+
# 6 DISCUSSION AND CONCLUSION
|
| 145 |
+
|
| 146 |
+
We presented MXGNet, a new graph-based approach to diagrammatic reasoning problems in the style of Raven Progressive Matrices (RPM). MXGNet combines three powerful ideas, namely, object-level representation, graph neural networks and multiplex graphs, to capture relations present in the reasoning task. Through experiments we showed that MXGNet performs better than previous models on two RPM datasets. We also showed that MXGNet has better generalisation performance.
|
| 147 |
+
|
| 148 |
+
One important direction for future work is to make MXGNet interpretable, and thereby extract logic rules from MXGNet. Currently, the learnt representations in MXGNet are still entangled, providing little in the way of understanding its mechanism of reasoning. Rule extraction can provide people with better understanding of the reasoning problem, and may allow neural networks to work seamlessly with more programmable traditional logic engines.
|
| 149 |
+
|
| 150 |
+
While the multi-layer multiplex graph neural network is designed for RPM style reasoning task, it can be readily extended to other diagrammatic reasoning tasks where relations are present between multiple elements across different diagrams. One example of a real-world application scenario is robots assembling parts of an object into a whole, such as building a LEGO model from a room of LEGO blocks. MXGNet provides a suitable way of capturing relations between parts, such as ways of piecing and locking two parts together.
|
| 151 |
+
|
| 152 |
+
# REFERENCES
|
| 153 |
+
|
| 154 |
+
Sabah Al-Fedaghi. Logic representation: Aristotelian syllogism by diagram. In Applied Computing and Information Technology/ Intl Conf on Computational Science/intelligence and Applied Informatics/ Intl Conf on Big Data, Cloud Computing, Data Science and Engineering, 2017.
|
| 155 |
+
|
| 156 |
+
Anonymous. Attention on abstract visual reasoning. In Submitted to International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ Bkel1krKPS. under review.
|
| 157 |
+
|
| 158 |
+
David Barrett, Felix Hill, Adam Santoro, Ari Morcos, and Timothy Lillicrap. Measuring abstract reasoning in neural networks. In International Conference on Machine Learning, pp. 511–520, 2018.
|
| 159 |
+
|
| 160 |
+
David Eigen, Marc’Aurelio Ranzato, and Ilya Sutskever. Learning factored representations in a deep mixture of experts. arXiv preprint arXiv:1312.4314, 2013.
|
| 161 |
+
|
| 162 |
+
Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Advances in Neural Information Processing Systems, pp. 1024–1034, 2017.
|
| 163 |
+
|
| 164 |
+
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.
|
| 165 |
+
|
| 166 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8):1735–1780, 1997.
|
| 167 |
+
|
| 168 |
+
Dokhyam Hoshen and Michael Werman. Iq of neural networks. arXiv preprint arXiv:1710.01692, 2017.
|
| 169 |
+
|
| 170 |
+
Ronghang Hu, Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Kate Saenko. Learning to reason: End-to-end module networks for visual question answering. In Proceedings of the IEEE International Conference on Computer Vision, pp. 804–813, 2017.
|
| 171 |
+
|
| 172 |
+
Drew A Hudson and Christopher D Manning. Compositional attention networks for machine reasoning. arXiv preprint arXiv:1803.03067, 2018.
|
| 173 |
+
|
| 174 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
|
| 175 |
+
|
| 176 |
+
Max Jaderberg, Karen Simonyan, Andrew Zisserman, et al. Spatial transformer networks. In Advances in neural information processing systems, pp. 2017–2025, 2015.
|
| 177 |
+
|
| 178 |
+
Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.01144, 2016.
|
| 179 |
+
|
| 180 |
+
Justin Johnson, Bharath Hariharan, Laurens van der Maaten, Li Fei-Fei, C Lawrence Zitnick, and Ross Girshick. Clevr: A diagnostic dataset for compositional language and elementary visual reasoning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2901–2910, 2017.
|
| 181 |
+
|
| 182 |
+
Ta-Chu Kao and Mason A Porter. Layer communities in multiplex networks. Journal of Statistical Physics, 173(3-4):1286–1302, 2018.
|
| 183 |
+
|
| 184 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016.
|
| 185 |
+
|
| 186 |
+
Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard Zemel. Gated graph sequence neural networks. arXiv preprint arXiv:1511.05493, 2015.
|
| 187 |
+
|
| 188 |
+
Liyuan Liu, Haoming Jiang, Pengcheng He, Weizhu Chen, Xiaodong Liu, Jianfeng Gao, and Jiawei Han. On the variance of the adaptive learning rate and beyond. arXiv preprint arXiv:1908.03265, 2019.
|
| 189 |
+
|
| 190 |
+
Chris J Maddison, Andriy Mnih, and Yee Whye Teh. The concrete distribution: A continuous relaxation of discrete random variables. arXiv preprint arXiv:1611.00712, 2016.
|
| 191 |
+
|
| 192 |
+
Jacek Mandziuk and Adam Zychowski. Deepiq: A human-inspired ai system for solving iq test problems.
|
| 193 |
+
|
| 194 |
+
Jiayuan Mao, Chuang Gan, Pushmeet Kohli, Joshua B Tenenbaum, and Jiajun Wu. The neuro-symbolic concept learner: Interpreting scenes, words, and sentences from natural supervision. arXiv preprint arXiv:1904.12584, 2019.
|
| 195 |
+
|
| 196 |
+
John Raven. The raven’s progressive matrices: change and stability over culture and time. Cognitive psychology, 41(1):1–48, 2000.
|
| 197 |
+
|
| 198 |
+
Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In Advances in neural information processing systems, pp. 91–99, 2015.
|
| 199 |
+
|
| 200 |
+
Adam Santoro, David Raposo, David G Barrett, Mateusz Malinowski, Razvan Pascanu, Peter Battaglia, and Timothy Lillicrap. A simple neural network module for relational reasoning. In Advances in neural information processing systems, pp. 4967–4976, 2017.
|
| 201 |
+
|
| 202 |
+
Yuri Sato, Sayako Masuda, Yoshiaki Someya, Takeo Tsujii, and Shigeru Watanabe. An fmri analysis of the efficacy of euler diagrams in logical reasoning. In Visual Languages and Human-Centric Computing (VL/HCC), 2015 IEEE Symposium on, pp. 143–151. IEEE, 2015.
|
| 203 |
+
|
| 204 |
+
Noam Shazeer, Azalia Mirhoseini, Krzysztof Maziarz, Andy Davis, Quoc Le, Geoffrey Hinton, and Jeff Dean. Outrageously large neural networks: The sparsely-gated mixture-of-experts layer. arXiv preprint arXiv:1701.06538, 2017.
|
| 205 |
+
|
| 206 |
+
Xander Steenbrugge, Sam Leroux, Tim Verbelen, and Bart Dhoedt. Improving generalization for abstract reasoning tasks using disentangled feature representations. arXiv preprint arXiv:1811.04784, 2018.
|
| 207 |
+
|
| 208 |
+
Damien Teney, Lingqiao Liu, and Anton van den Hengel. Graph-structured representations for visual question answering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1–9, 2017.
|
| 209 |
+
|
| 210 |
+
Aaron van den Oord, Oriol Vinyals, et al. Neural discrete representation learning. In Advances in Neural Information Processing Systems, pp. 6306–6315, 2017.
|
| 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 Advances in neural information processing systems, pp. 5998–6008, 2017.
|
| 213 |
+
|
| 214 |
+
Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. ´ Graph attention networks. arXiv preprint arXiv:1710.10903, 2017.
|
| 215 |
+
|
| 216 |
+
Duo Wang, Mateja Jamnik, and Pietro Li. Investigating diagrammatic reasoning with deep neural networks. In International Conference on Theory and Application of Diagrams, 2018a.
|
| 217 |
+
|
| 218 |
+
Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7794–7803, 2018b.
|
| 219 |
+
|
| 220 |
+
Kexin Yi, Jiajun Wu, Chuang Gan, Antonio Torralba, Pushmeet Kohli, and Josh Tenenbaum. Neural-symbolic vqa: Disentangling reasoning from vision and language understanding. In Advances in Neural Information Processing Systems, pp. 1031–1042, 2018.
|
| 221 |
+
|
| 222 |
+
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.
|
| 223 |
+
|
| 224 |
+
Chi Zhang, Feng Gao, Baoxiong Jia, Yixin Zhu, and Song-Chun Zhu. Raven: A dataset for relational and analogical visual reasoning. arXiv preprint arXiv:1903.02741, 2019.
|
| 225 |
+
|
| 226 |
+
# A ARCHITECTURE
|
| 227 |
+
|
| 228 |
+
In this section we present exact configurations of all model variants of MXGNet. Due to the complexity of architectures, we will describe each modules in sequence. The object-level representation has two variations which are (o1) CNN features and (o2) Spatial Attention features. Also the models for PGM and RAVEN dataset differ in details. Unless otherwise stated, in all layers we apply Batch Normalization Ioffe & Szegedy (2015) and use Rectified Linear Unit as activation function.
|
| 229 |
+
|
| 230 |
+
# A.1 OBJECT-LEVEL REPRESENTATION ARCHITECTURE
|
| 231 |
+
|
| 232 |
+
CNN features: The first approach applies a CNN on the input image and use each spatial location in the final CNN feature map as the object feature vector. This type of representation is used widely, such as in Relation Network Santoro et al. (2017) and VQ-VAE van den Oord et al. (2017). Formally, the output of a CNN is a feature map tensor of dimension $H \times W \times D$ where $H$ , $W$ and $D$ are respectively height, width and depth of the feature map. At each $H$ and $W$ location, an object vector is extracted. This type of object representation is simple and fast, but does not guarantee that the receptive field at each feature map location fully bounds objects in the image.
|
| 233 |
+
|
| 234 |
+
We use a residual module He et al. (2016) with two residual blocks to extract CNN features, as shown in figure 4.This is because Residual connections show better performance in experiments. The structure of a single Residual Convolution Block is shown in figure 3.Unless otherwise stated, convolutional layer in residual blocks has kernel size of $3 \times 3$ . The output feature map processed by another residual block is treated as background encoding because we found that convolutional background encoding gives better results than feature vectors.
|
| 235 |
+
|
| 236 |
+

|
| 237 |
+
Figure 3: Architecture of a single Residual Convolution Block.
|
| 238 |
+
|
| 239 |
+
Spatial Attention Object-level representation: The second approach is to use spatial attention to attend to locations of objects, and extract representations for each object attended. This is similar to object detection models such as faster R-CNN Ren et al. (2015), which use a Region Proposal Network to propose bounding boxes of objects in the input image. In practice, we use Spatial Transformer Jaderberg et al. (2015) as our spatial attention module. Figure 5 shows the architecture used for extracting object-level representation using spatial attention. A CNN composed of 1 conv layr and 2 residual blocks is first applied to the input image, and the last layer feature map is extracted. This part is the same as CNN grid feature module. A spatial attention network composed of 2 conv layer then processes information at each spatial location on the feature map, and outputs $k$ numbers of $z = ( \dot { z } ^ { p r e s } , z ^ { w \hat { h } e r e } )$ , corresponding to $k$ possible objects at each location. Here, $z ^ { p r e s }$ is a binary value indicating if an object exists in this location, and $z ^ { w h e r \bar { e } }$ is an affine transformation matrix specifying a sampling region on the feature maps. $z ^ { p r e s }$ , the binary variable, is sampled from Gumbel-Sigmoid distribution Maddison et al. (2016); Jang et al. (2016), which approximates the Bernoulli distribution. We set Gumbel temperature to 0.7 throughout the experiments. For the PGM dataset we restricted $k$ to be 1 and $z ^ { w h e r e }$ to be a translation and scaling matrix as ‘shapes’ objects do not overlap and do not have affine transformation attributes other than scaling and translation. For all $z _ { i } ; i \subset [ 1 , H \times \bar { W } ]$ , if $z _ { i } ^ { p r e s }$ is 1, an object encoder network samples a patch from location specified by $z _ { i } ^ { w h e r e }$ using a grid sampler with a fixed window size of pixels. More details of the grid sampler can be found in Jaderberg et al. (2015). The sampled patches are then processed by a conv-layer to generate object embeddings.
|
| 240 |
+
|
| 241 |
+

|
| 242 |
+
Figure 4: CNN feature object-level representation module. ’Conv’ is convolution layers, ’Max-Pooling’ is max-pooling layer and ’ResConv Block’ is Residual Convolutional Block.
|
| 243 |
+
|
| 244 |
+

|
| 245 |
+
Figure 5: Spatial attention based feature object-level representation module. ’Conv’ is convolution layers, ’Max-Pooling’ is max-pooling layer and ’ResConv Block’ is Residual Convolutional Block. $z$ is the spatial attention variable $( z ^ { p r e \bar { s } } , z ^ { w h \bar { e } r e } )$ . Sampler is a grid sampler which samples grid of points from given feature maps.
|
| 246 |
+
|
| 247 |
+
# A.2 GRAPH NETWORKS
|
| 248 |
+
|
| 249 |
+
Multiplex Edge Embeddings:Figure 2 in the main paper shows an overview of the multiplex graph architecture. While motivation and overview of architecture is explained in section 4.2 of the main paper, in this section we provide exact configurations for each part of the model. Each sub-layer of the multiplex edge is embedded by a small MLP. For PGM dataset, we use 6 parallel layers for each multiplex edge embeddings , with each layer having 32 hidden units and 8 output units. For RAVEN dataset we use 4 layers with 16 hidden units and 8 output units because RAVEN dataset contains fewer relations types than PGM dataset. Gating function is implemented as one Sigmoid fully connected layer with hidden size equal to the length of concatenated aggregated embeddings. Gating variables are element-wise multiplied with concatenated embeddings for gating effects. Gated embeddings are then processed with a final fully connected layer with hidden size 64.
|
| 250 |
+
|
| 251 |
+
Graph Summarization: This module summarizes all node summary embeddings and background embeddings to produce a diagram subset embedding representing relations present in the set of diagrams. We experimented with various approaches and found that keeping embeddings as feature maps and processing them with residual blocks yields the best results. Background feature map embeddings are generated with one additional residual block of 48 on top of lower layer feature-extracting resnet. For object representations obtained from CNN-grid features, we can simply reshape node embeddings into a feature map, and process it with additional conv-nets to generate a feature map embeddings of the same dimension to background feature map embeddings. For object representations with spatial attention, we can use another Spatial Transformer to write node summary embeddings to its corresponding locations on a canvas feature map. Finally we concatenate node summary embeddings and background embeddings and process it with 2 residual blocks of size 64 to produce the relation embeddings.
|
| 252 |
+
|
| 253 |
+
# A.3 REASONING NETWORK
|
| 254 |
+
|
| 255 |
+
Figure 6 shows the reasoning network configuration for RPM tasks. We experimented with the approach introduced in Barrett et al. (2018), which compute scores for each answer candidates and finally normalize the scores. We found this approach leads to severe overfitting on the RAVEN dataset, and therefore used a simpler approach to just concatenate all relation embeddings and process them with a neural net. In practice we used two residual blocks of size 128 and 256, and a final fully connected layer with 8 units corresponding to 8 answer candidates. The output is normalized with softmax layer. For Meta-target prediction, all context relation embeddings (context rows and columns for PGM while only rows for RAVEN dataset) are summed and fed into a fully connected prediction layer with Sigmoid activation. For PGM there are 12 different meta-targets while for RAVEN there are 9.
|
| 256 |
+
|
| 257 |
+

|
| 258 |
+
Figure 6: Architecture overview of reasoning module. ’RelEmbed’ is relation embeddings, ’Concat’ is concatenation layer. ’ResBlock’ is Residual Convolutional Block. ’FC’ is fully connected layer.
|
| 259 |
+
|
| 260 |
+
# B TRAINING DETAILS
|
| 261 |
+
|
| 262 |
+
The architecture is implemented in Pytorch framework. During training, we used RAdam optimizer Liu et al. (2019) with learning rate 0.0001, $\beta _ { 1 } = 0 . 9 , \beta _ { 2 } = 0 . 9 9 9 .$ We used batch size of 64, and distributed the training across 2 Nvidia Geforce Titan X GPUs. We early-stop training when validation accuracy stops increasing.
|
| 263 |
+
|
| 264 |
+
# C MORE DETAILS OF RPM DATASETS
|
| 265 |
+
|
| 266 |
+
In PGM dataset there are two types of elements present in the diagram, namely shapes and lines. These elements have different attributes such as colour and size. In the PGM dataset, five types of relations can be present in the task: $\{ P r o g r e s s i o n , A N D , O R , X O R , C o n s i s t e n t U n i o n \}$ . The RAVEN dataset, compared to PGM, does not have logic relations $A N D , O R , X O R$ , but has additional relations Arithmetic, Constant. In addition RAVEN dataset only allow relations to be present in rows.
|
| 267 |
+
|
| 268 |
+
Figure 7a and 7b show two examples from the PGM dataset(Image courtesy Barrett et al. (2018)). The first example contains a ’Progression’ relation of the number of objects across diagrams in columns. The second examples contains a ’XOR’ relation of position of objects across diagrams in rows.
|
| 269 |
+
|
| 270 |
+
In addition to shape objects, diagrams in the PGM dataset can also contain background line objects that appear at fixed locations. Figure 8a and 8b show two examples of PGM tasks containing line objects.
|
| 271 |
+
|
| 272 |
+
# D MORE DETAILS ON SEARCH SPACE REDUCTION
|
| 273 |
+
|
| 274 |
+
In this section we provide detailed architecture used for Search Space reduction, and present additional experimental results.
|
| 275 |
+
|
| 276 |
+
The node embeddings are generated by applying a Conv-Net of 4 convolutional layer (32 filters in each layer) of kernel size 3, and a fully connected layer mapping flattened final-layer feature maps to a feature vector of size 256. Edge embeddings are generated by a 3-layer MLP of $5 1 2 - 5 1 2 - 2 5 6$ hidden units. Subset embeddings are generated by a fully connected layer of 512 units. The subset embeddings are gated with the gating variables and summed into a feature vector, which is then feed into the reasoning net, a 3-layer MLP with $2 5 6 - 2 5 6 - 1 3$ . The output layer contains 13 units. The first unit gives probability of currently combined answer choice being true. The rest 12 units give meta-target prediction probabilities. This is the same as Barrett et al. (2018). The training loss function is:
|
| 277 |
+
|
| 278 |
+
$$
|
| 279 |
+
\mathcal { L } = \mathcal { L } _ { a n s } + \beta \mathcal { L } _ { m e t a - t a r g e t } + \lambda \left\| \sum _ { ( i , j , k ) \subset S } G _ { i , j , k } \right\| _ { L 1 }
|
| 280 |
+
$$
|
| 281 |
+
|
| 282 |
+
In our experiment we have tested various values of $\lambda$ , and found 0.01 to be the best. This model is trained with RAdam optimizer with learning rate of 0.0001 and batch size of 64. After 10 epochs of training, only gating variables of subsets that are rows and columns are above the 0.5 threshold. The Gating variables for three rows are 0.884, 0.812 and 0.832. The gating variables for three columns are 0.901, 0.845 and 0.854. All other gating variables are below 0.5. Among these, the one with highest absolute value is 0.411. Table 3 shows the top-16 ranked subsets, with each subset indexed by 2 connecting edges in the subset. Figure 9 illustrates this way of indexing the subset. For example, the first column with red inter-connecting arrows is indexed as 0-3-6. This indicates that there two edges, one connecting diagram 0 and 3, and the other connecting diagram 3-6. Similarly the subset connected by blue arrows is indexed as 1-2-5. Note that 1-2-5 and 2-1-5 is different because the 1-2-5 contains edge 1-2 and 2-5 while 2-1-5 contains edges 1-2 and 1-5.
|
| 283 |
+
|
| 284 |
+

|
| 285 |
+
Figure 7: Two examples in PGM dataset. (a) task contains a ’Progression’ relation of the number of objects across diagrams in columns while (b) contains a ’XOR’ relation of position of objects across diagrams in rows.
|
| 286 |
+
|
| 287 |
+
# E MORE DETAILS ON EULER DIAGRAM SYLLOGISM
|
| 288 |
+
|
| 289 |
+
The original model in Wang et al. (2018a) uses a Siamese Conv-Net model to process two input premise diagrams and output all consistent conclusions. Convolutional layers with shared weights are first applied to two input diagrams. The top layer feature maps are then flattened and fed into a reasoning network to make predictions. We simply use CNN grid features of the top layer feature maps as object-level representations, and use the multi-layer multiplex graph to capture object relations between the two input premise diagrams. We use a multiplex edge embeddings of 4 layers, with each layer of dimension 32. The cross-multiplexing here becomes self-multiplexing as there are only 2 diagrams (Only 1 embedding of node summary for edges from first diagram to second diagram). Final node embeddings are processed by a convolutional layer to produce the final embedding, which is also fed into the reasoning network along with the conv-net embeddings.
|
| 290 |
+
|
| 291 |
+

|
| 292 |
+
Figure 8: Two examples in PGM dataset containing background line objects.
|
| 293 |
+
|
| 294 |
+
# F ABLATION STUDY
|
| 295 |
+
|
| 296 |
+
We performed ablation study experiments to test how much does the multiplex edges affects performance. We have tested two model variants, one without any graph modules, and the other model graphs using vanilla edge embeddings produced by MLPs, on PGM dataset. We found that without graph modules, the model only achieved $8 3 . 2 \%$ test accuracy. While this is lower than MXGNet’s $8 9 . 6 \%$ , it is still higher than WReN’s $7 6 . 9 \%$ . This is possibly because the search space reduction, by trimming away non-contributing subsets, allow the model to learn more efficiently. The graph model with vanilla edge embeddings achieves $8 8 . 3 \%$ accuracy, only slightly lower than MXGNet with multiplex edge embeddings. This shows that while general graph neural network is a suitable model for capturing relations between objects, the multiplex edge embedding does so more efficiently by allowing parallel relation multiplexing.
|
| 297 |
+
|
| 298 |
+
# G ADDITIONAL GENERALIZATION PERFORMANCE ON PGM DATASET
|
| 299 |
+
|
| 300 |
+
Table 4 shows performance of MXGNet on other splits of PGM dataset. MXGNet consistently outperforms WReN for test accuracy, except for H.O. Triple Pairs and H.O. shape-color in the case $\beta = 0$ Additionally
|
| 301 |
+
|
| 302 |
+

|
| 303 |
+
Figure 9: Illustration of diagram ordering in the matrix and numbered representation of subsets.
|
| 304 |
+
|
| 305 |
+
<table><tr><td rowspan=2 colspan=1>Rank1</td><td rowspan=1 colspan=1>Diagram subsets</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>GatingVariablel</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>0-3-6</td><td rowspan=1 colspan=2>0.901</td><td rowspan=2 colspan=1></td></tr><tr><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>0-1-2</td><td rowspan=1 colspan=2>0.884</td></tr><tr><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>2-5-8</td><td rowspan=1 colspan=2>0.854</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>1-4-7</td><td rowspan=1 colspan=2>0.845</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>6-7-8</td><td rowspan=1 colspan=2>0.832</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>6</td><td rowspan=1 colspan=1>3-4-5</td><td rowspan=2 colspan=3>0.8120.411</td></tr><tr><td rowspan=1 colspan=1>7</td><td rowspan=1 colspan=1>1-2-5</td></tr><tr><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>2-1-5</td><td rowspan=1 colspan=3>0.384</td></tr><tr><td rowspan=1 colspan=1>9</td><td rowspan=1 colspan=1>3-6-7</td><td rowspan=1 colspan=3>0.381</td></tr><tr><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>3-7-4</td><td rowspan=1 colspan=3>0.364</td></tr><tr><td rowspan=1 colspan=1>11</td><td rowspan=1 colspan=1>6-3-7</td><td rowspan=1 colspan=3>0.360</td></tr><tr><td rowspan=1 colspan=1>12</td><td rowspan=1 colspan=1>1-5-4</td><td rowspan=1 colspan=3>0.357</td></tr><tr><td rowspan=1 colspan=1>13</td><td rowspan=1 colspan=1>0-4-6</td><td rowspan=1 colspan=3>0.285</td></tr><tr><td rowspan=1 colspan=1>14</td><td rowspan=1 colspan=1>3-4-7</td><td rowspan=1 colspan=3>0.282</td></tr><tr><td rowspan=1 colspan=1>15</td><td rowspan=1 colspan=1>1-3-4</td><td rowspan=2 colspan=3>0.2730.271</td></tr><tr><td rowspan=1 colspan=1>16</td><td rowspan=1 colspan=1>1-4-5</td></tr></table>
|
| 306 |
+
|
| 307 |
+
Table 3: All subsets ranked by the absolute value of their corresponding gating variables.
|
| 308 |
+
|
| 309 |
+
here we provide the analysis according to Sec 4.2 and Sec 4.6 in Barrett et al. (2018). unfortunately sec 4.3 of this paper, namely the analysis of distractors, cannot be performed as the publicly available dataset does not include any ground truth labels about distractors, nor any labels of present objects that can be used to synthesize distractor labels. For Meta-target prediction, MXG-Net achieves $8 4 . 1 \%$ accuracy. When Metatarget is correctly predicted, the model’s target prediction accuracy increases to $9 2 . 4 \%$ . When Meta-target is incorrectly predicted, the model only has $7 5 . 6 \%$ accuracy. For three logical relations the model performs best for $O R$ relation $( 9 5 . 3 \% )$ , and worst for $X O R$ relation $( 9 2 . 6 \% )$ . Accuracy for line-type tasks $( 8 6 . 5 \% )$ is only slightly better than for shape tasks $( 8 0 . 1 \% )$ , showing that object representation with graph modeling does improve on relations between shapes. The type of relation with worst performance is ConsistentU nion, with only $7 5 . 1 \%$ accuracy. This is expected as ConsistentUnion is in fact a memory task instead of relational reasoning task.
|
| 310 |
+
|
| 311 |
+
<table><tr><td rowspan="2">Model</td><td rowspan="2">Regime</td><td colspan="3">β=0</td><td colspan="3">β=10</td></tr><tr><td>Val.(%)</td><td>test%</td><td>Diff.</td><td>Val.(%)</td><td>test%</td><td>Diff.</td></tr><tr><td rowspan="5">WReN</td><td>H.O.Attribute Pairs</td><td>46.7</td><td>27.2</td><td>-19.5</td><td>73.4</td><td>51.7</td><td>-21.7</td></tr><tr><td>H.O. Triple Pairs</td><td>63.9</td><td>41.9</td><td>-22.0</td><td>74.5</td><td>56.3</td><td>-18.2</td></tr><tr><td>H.O. Triples</td><td>63.4</td><td>19.0</td><td>-44.4</td><td>80.0</td><td>20.1</td><td>-59.9</td></tr><tr><td>H.O.line-type</td><td>59.5</td><td>14.4</td><td>-45.1</td><td>78.1</td><td>16.4</td><td>-61.7</td></tr><tr><td>H.O. shape-color</td><td>69.3</td><td>17.2</td><td>-52.1</td><td>93.6</td><td>15.5</td><td>-78.1</td></tr><tr><td rowspan="5">MXGNet</td><td>H.O.Attribute Pairs</td><td>68.3</td><td>33.6</td><td>-34.7</td><td>81.9</td><td>69.3</td><td>-12.6</td></tr><tr><td>H.O. Triple Pairs</td><td>67.1</td><td>43.3</td><td>-23.8</td><td>78.1</td><td>64.2</td><td>-13.9</td></tr><tr><td>H.O. Triples</td><td>63.7</td><td>19.9</td><td>-43.8</td><td>80.5</td><td>20.2</td><td>-60.3</td></tr><tr><td>H.0.line-type</td><td>60.1</td><td>16.7</td><td>-43.4</td><td>85.2</td><td>16.8</td><td>-61.5</td></tr><tr><td>H.O. shape-color</td><td>68.5</td><td>16.6</td><td>-51.9</td><td>89.2</td><td>15.6</td><td>-73.6</td></tr></table>
|
| 312 |
+
|
| 313 |
+
Table 4: Generalisation performance comparing MXGNet model variants against $\mathrm { W R e N }$ . ‘Diff.’ is the difference between the test and the validation performances.
|
md/train/H1eH4n09KX/H1eH4n09KX.md
ADDED
|
@@ -0,0 +1,268 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ADVERSARIAL AUDIO SUPER-RESOLUTION WITH UNSUPERVISED FEATURE LOSSES
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Neural network-based methods have recently demonstrated state-of-the-art results on image synthesis and super-resolution tasks, in particular by using variants of generative adversarial networks (GANs) with supervised feature losses. Nevertheless, previous feature loss formulations rely on the availability of large auxiliary classifier networks, and labeled datasets that enable such classifiers to be trained. Furthermore, there has been comparatively little work to explore the applicability of GAN-based methods to domains other than images and video. In this work we explore a GAN-based method for audio processing, and develop a convolutional neural network architecture to perform audio super-resolution. In addition to several new architectural building blocks for audio processing, a key component of our approach is the use of an autoencoder-based loss that enables training in the GAN framework, with feature losses derived from unlabeled data. We explore the impact of our architectural choices, and demonstrate significant improvements over previous works in terms of both objective and perceptual quality.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep convolutional neural networks (CNNs) have become a cornerstone in modern solutions for image and audio analysis. Such networks have excelled at supervised discrimination tasks, for instance on ImageNet (Deng et al., 2009; Simonyan & Zisserman, 2014), where image classifier networks are trained on a large corpus of labeled data. More recently, CNNs have successfully been applied to data synthesis problems in the context of generative adversarial networks (GANs) (Goodfellow et al., 2014). In the GAN framework, a neural network is used to synthesize new instances from a modeled distribution, or resolve missing details given lossy observations. In the latter case, the GANs have been shown to greatly improve reconstruction of fine texture details for images, compared to standalone sample-space losses that result in overly smoothed outputs (Dosovitskiy & Brox, 2016; Isola et al., 2017; Ledig et al., 2017). However, GANs are notoriously hard to train, and the use of conventional sample-space objectives in conjunction with an adversarial loss either de-stabilizes training, or results in outputs with significant artifacts (Figure 1).
|
| 12 |
+
|
| 13 |
+
To address the smoothness problem described above, previous works typically augment or replace conventional sample-space losses with a feature loss (also called a perceptual loss) (Dosovitskiy & Brox, 2016; Ledig et al., 2017; Johnson et al., 2016). Instead of distance in raw sample-space, such feature losses reflect distance in terms of the feature maps of an auxiliary neural network. While classifier-based feature losses are effective, they require either a pre-trained neural network that is applicable to the problem domain (e.g., synthesizing images of cats), or a labeled dataset that is amenable to training a relevant classifier. Training new classifiers for use in a feature loss can be non-trivial for numerous reasons. Besides the difficulty of training large classifiers that are commonly used for feature losses, such as VGG (Simonyan & Zisserman, 2014), creating a labeled dataset that is sufficiently large and diverse is often infeasible.
|
| 14 |
+
|
| 15 |
+
In this work, we sidestep the difficulty of training auxiliary classifiers by developing a feature loss that is unsupervised. In particular, we focus on an audio modeling task called super-resolution, where the goal is to generate high-quality audio given down-sampled, low-resolution input. Inspired by previous work on audio and image super-resolution, we develop a neural network architecture for end-to-end super-resolution that operates on raw audio. In addition to providing new algorithms to model audio, our work suggests new techniques to improve GAN-based methods in other domains such as images and video. Specifically, our contributions are as follows:
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: (a) High-resolution, (b) low-resolution, (c) and super-resolution spectrograms. The superresolution spectrogram corresponds to audio generated by the GAN described in Section 3, trained only with an adversarial loss and conventional $L 2$ loss. Training tends to either diverge, or results in audio with persistent high-frequency tones and alias-like artifacts.
|
| 19 |
+
|
| 20 |
+
1. We formulate a new, general-purpose feature loss that is fully unsupervised and circumvents the need for problematic classifier-based models.
|
| 21 |
+
2. We successfully adapt the adversarial framework for audio processing, and provide solutions to previously unsolved problems associated with the application of GANs to audio.
|
| 22 |
+
3. We demonstrate our methods in an end-to-end architecture for audio super-resolution, with stateof-the-art results on both speech and music tasks.
|
| 23 |
+
4. We analyze important architectural parameters of our model, and in particular discover previously-unobserved behavior with effective receptive field sizes.
|
| 24 |
+
|
| 25 |
+
# 2 BACKGROUND & RELATED WORK
|
| 26 |
+
|
| 27 |
+
Audio super-resolution Audio super-resolution is the task of constructing a high-resolution audio signal from a low-resolution signal that contains a fraction of the original samples. Concretely, given a low-resolution sequence of audio samples $x _ { l } \ = \ ( x _ { 1 / R _ { l } } , \ldots , x _ { R _ { l } T / R _ { l } } )$ , we wish to synthesize a high-resolution audio signal $x _ { h } = ( x _ { 1 / R _ { h } } , \ldots , x _ { R _ { h } T / R _ { h } } )$ , where $R _ { l }$ and $R _ { h }$ are the sampling rates of the low and high-resolution signals, respectively. We denote $R = { { R } _ { h } } / { { R } _ { l } }$ as the upsampling ratio, which ranges from 2 to 6 in this work. Thus, the audio super-resolution problem is equivalent to reconstructing the missing frequency content between frequencies $R _ { l } / 2$ and $R _ { h } / 2$ .
|
| 28 |
+
|
| 29 |
+
There is a vast body of prior work on audio super-resolution in the signal and audio processing communities under the term artificial bandwidth extension (Larsen & Aarts, 2004). Neural networkbased methods in this domain generally apply a DNN on top of hand-crafted features as part of complex bandwidth extension systems (Liu et al., 2015; Abel & Fingscheidt, 2018). Gaussian mixture and hidden Markov models have also been used (Bachhav et al., 2017; Tokuda et al., 2013), but these methods generally perform worse compared to neural networks (Abel & Fingscheidt, 2018). In contrast with the works above, our method does not rely on hand-crafted features (e.g., transformations or cepstrum coefficients), and is not specific to problems in speech modeling.
|
| 30 |
+
|
| 31 |
+
Audio modeling with neural networks Learning-based approaches for audio have also been explored in the largely in the context of representation learning, generative modeling, and text-tospeech (TTS) systems. Unsupervised methods such as convolutional deep belief networks (Lee et al., 2009) and bottleneck CNNs (Aytar et al., 2016) have been shown to learn useful representations from audio, such as phonemes and sound textures. Stacked autoencoders (Vincent et al., 2010) and variational autoencoders (Kingma & Welling, 2014; Sonderby et al., 2016) have been used for denoising, image generation, and music synthesis (Sarroff & Casey, 2014). Bottleneck-like CNNs have also demonstrated significant improvements for audio super-resolution in supervised settings compared to previous DNN and spline-based methods (Kuleshov et al., 2017). Donahue et al. (2018) is among the first to develop methods for raw audio synthesis with GANs. Notably, Donahue et al.
|
| 32 |
+
|
| 33 |
+
(2018) show that non-trivial modifications of GAN architectures are required to generative diverse and plausible audio outputs. We build on the works above by developing a GAN framework for audio super-resolution with an improved bottleneck-style generator, and show that leveraging representations learned from unsupervised training greatly aid the super-resolution task. Autoregressive probabilistic models have recently demonstrated state-of-the-art results for generation of music (Engel et al., 2017), general audio (van den Oord et al., 2016; Mehri et al., 2017), and for parametric TTS systems (Sotelo et al., 2017). Several works have leveraged model distillation (van den Oord et al., 2018; ClariNet, 2019)1 to mitigate the overhead of autoregressive methods, making them feasible for real-time audio generation. In general, our work can be used to augment existing speech synthesis systems, including those that employ autoregressive methods. For instance, the unsupervised feature loss proposed in our work could be used as a drop-in replacement for the classifier-based feature loss used by van den Oord et al. (2018). While we are not aware of any efforts that explore autoregressive modeling for audio super-resolution, we believe it may be a promising future direction.
|
| 34 |
+
|
| 35 |
+
Generative adversarial networks for images Generative methods have been extensively explored for image generation and super-resolution. Building upon the original formulation of Goodfellow et al. (2014), GANs have been continuously improved to generate plausible, high-fidelity images (Radford et al., 2015; Denton et al., 2015; Berthelot et al., 2017; Karras et al., 2018). GAN variants conditioned on class labels or object sketches have also demonstrated promising results on tasks such as in-painting and style transfer (Mirza & Osindero, 2014; Isola et al., 2017).
|
| 36 |
+
|
| 37 |
+
# 3 METHOD
|
| 38 |
+
|
| 39 |
+
GANs for Super-Resolution GANs developed for super-resolution tasks have several important differences compared to the original formulation of Goodfellow et al. (2014). When used to generate new instances from a data distribution $p _ { \mathrm { d a t a } }$ , the generator $( G )$ parameterized by $\theta _ { G }$ learns the mapping to data space as $G ( z ; \theta _ { G } )$ , where $_ { z }$ is a latent noise prior. The discriminator $( D )$ parameterized by $\theta _ { D }$ then estimates the probability that $G ( z ; \theta _ { G } )$ was drawn from $p _ { \mathrm { d a t a } }$ rather than the generator distribution $p _ { g }$ . In contrast, for super-resolution, $G$ is no longer conditioned on noise and learns the mapping to high-resolution data space $p _ { h }$ as $G ( \pmb { x } \imath ; \theta _ { G } )$ , where $_ { x \iota }$ is drawn from the low-resolution data distribution $p _ { l }$ . The task of $D$ is to discriminate between samples from the high-resolution and super-resolution (generator) distributions $p _ { h }$ and $p _ { g }$ , respectively. Since low-resolution data $_ { x \iota }$ corresponds directly to a downsampled version of $\scriptstyle { \mathbf { 2 } } ( { \mathbf { 2 } } )$ during training, we expect ${ \cal G } ( { \pmb x } _ { l } ; \theta _ { G } ) \approx { \pmb x } _ { h }$ . $G$ and $D$ are optimized according to the two-player minimax problem:
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\operatorname* { m i n } _ { \theta _ { G } } \operatorname* { m a x } _ { \theta _ { D } } \mathbb { E } _ { { \mathbf { x } } _ { h } \sim p _ { h } ( { \mathbf { x } } _ { h } ) } \left[ \log D \left( { \mathbf { x } } _ { h } ; \theta _ { D } \right) \right] + \mathbb { E } _ { { \mathbf { x } } _ { l } \sim p _ { l } ( { \mathbf { x } } _ { l } ) } \left[ \log \left( 1 - D \left( G \left( { \mathbf { x } } _ { l } ; \theta _ { G } \right) \right) \right) \right]
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
This framework enables the joint optimization of two neural networks - $G$ generates super-resolution data with the goal of fooling $D$ , and $D$ is trained to distinguish between real and super-resolved data. Thus, the GAN approach encourages $G$ to learn solutions that are hard to distinguish from real, highresolution datum.
|
| 46 |
+
|
| 47 |
+
Architecture overview MU-GAN (Multiscale U-net GAN) is composed of three models that all operate on raw audio2 - a generator $( G )$ , discriminator $( D )$ , and convolutional autoencoder $( A )$ (Figure 2). The generator’s task is to learn the mapping between the low and high-resolution data spaces, corresponding to signals $_ { x \iota }$ and $\scriptstyle { \mathbf { \mathcal { X } } } _ { h }$ , respectively. The discriminator’s task is then to classify whether presented data instances are real, or produced by the generator. In addition to $G$ and $D$ , the autoencoder extracts perceptually-relevant features from both real and super-resolved data for use in feature-space loss functions. The use of $A$ is crucial in the GAN framework, as generators trained solely on L2 or other sample-space losses suffer from training instability or output artifacts (Ledig et al., 2017).
|
| 48 |
+
|
| 49 |
+
Multiscale convolutional layers In comparison to images, audio signals are inherently periodic with time-scales on the order of 10’s to 100’s of samples. As a consequence, filters with very large
|
| 50 |
+
|
| 51 |
+

|
| 52 |
+
Figure 2: Overview of the model architecture and corresponding loss terms.
|
| 53 |
+
|
| 54 |
+

|
| 55 |
+
Figure 3: Subpixel and superpixel layers for increasing and decreasing spatial resolution, respectively.
|
| 56 |
+
|
| 57 |
+
# Generator
|
| 58 |
+
|
| 59 |
+

|
| 60 |
+
Figure 4: Generator and discriminator models.
|
| 61 |
+
|
| 62 |
+
receptive fields are required to create high quality raw audio (Donahue et al., 2018; van den Oord et al., 2016). Previous work with classifier models also suggests that varying the filter size within a network helps capture information at multiple scales (Szegedy et al., 2015). Leveraging these observations, we use a multiscale convolutional building block composed of concatenated 3x1, 9x1, $2 7 \mathrm { x } 1$ , and $8 1 \mathbf { x } 1$ filters. In practice, and with a fixed number of parameters for a given layer, we found that filters larger than 81x1 provided no additional benefit, while omitting large filter sizes resulted in significantly degraded audio quality. We interpret the poor performance of small filters as being a byproduct of their frequency selectivity; it is well known from signal processing theory that the resolution of an FIR filter’s frequency response is proportional to the length of the filter.
|
| 63 |
+
|
| 64 |
+
Superpixel layers Recently, it has been shown that pooling and strided convolutions tend to induce periodic “checkerboard” artifacts (Odena et al., 2016; Donahue et al., 2018). Shi et al. (2016) developed a subpixel layer to increase spatial resolution, and showed that it is less prone to checkerboard artifacts. While the subpixel layer was subsequently adopted by several works (Kuleshov et al., 2017), no efforts have evaluated the performance of the inverse operation for decreasing spatial resolution. Concretely, the inverse subpixel operator interleaves samples from the time dimension into the channel dimension, and thus reduces the spatial resolution by an integer factor. We refer to this simple inverse operation as a superpixel layer (Figure 3), and use it as a drop-in replacement for strided convolution and pooling layers.
|
| 65 |
+
|
| 66 |
+
Generator network The high-level architecture for the generator network (Figure 4, top) is inspired by autoencoder-like U-net models (Ronneberger et al., 2015; Isola et al., 2017; Kuleshov et al., 2017). In a U-net-style model, the first half of the network consists of $B$ downsampling blocks (D-blocks) that perform feature extraction at multiple scales and resolutions 3. The second half the model consists of $B$ upsampling blocks (U-blocks), which successively increase the spatial resolution of the signal. We use multi-scale convolutional layers throughput the generator network, and replace all strided convolutions with superpixel layers.
|
| 67 |
+
|
| 68 |
+
Discriminator network The discriminator (Figure 4, bottom) is used during training to differentiate between real, high-resolution audio and super-resolved signals produced by the generator. Our design is loosely based on the recommendations of Radford et al. (2015), and the image discriminator from Ledig et al. (2017). All discriminator activations are LeakyReLU (Maas et al., 2013) with $\alpha = 0 . 2$ . As with the generator, we use multi-scale convolutions, and the superpixel layer described above instead of strided convolutions to minimize artifacts in the loss gradients (Odena et al., 2016).
|
| 69 |
+
|
| 70 |
+
Autoencoder network The autoencoder $A$ is used to extract perceptually relevant features from the low and high-resolution signals. The features extracted by $A$ are incorporated in the generator’s feature loss $\mathcal { L } _ { f }$ , which is described in more detail in following sections. For the specific implementation of $A$ , we use a modified version of the generator model that excludes all additive and stacking skip connections. Hence, the model for $A$ is a convolutional autoencoder, augmented with multiscale convolutional layers, and super/subpixel layers for down/up-sampling.
|
| 71 |
+
|
| 72 |
+
Loss functions MU-GAN incorporates several loss terms for training the generator and discriminator. The first term in the generator loss is the sample-space L2 loss, given by4
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\mathcal { L } _ { L 2 } = \frac { 1 } { W } \sum _ { i = 1 } ^ { W } \left. \pmb { x } _ { h , i } - G ( \pmb { x } _ { l } ) _ { i } \right. _ { 2 } ^ { 2 } .
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
We found that using only the sample-space and adversarial losses either resulted in little to no improvement over the baseline non-GAN model, or introduced persistent audible artifacts (e.g., high-frequency tones, Figure 1). These findings are in line with those of Ledig et al. (2017), who experience similar issues with images 5. As described in Section 2, the use of a feature loss with GAN training encourages the generator to learn solutions that incorporate perceptually relevant texture details. Given the autoencoder $A$ , we denote the output feature tensor at the bottleneck of the autoencoder as $\phi$ . The feature loss $\mathcal { L } _ { f }$ is then given by
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\mathcal { L } _ { f } = \frac { 1 } { C _ { f } W _ { f } } \sum _ { c = 1 } ^ { C _ { f } } \sum _ { i = 1 } ^ { W _ { f } } \left. \phi ( \pmb { x _ { h } } ) _ { i , c } - \phi ( G ( \pmb { x _ { l } } ) ) _ { i , c } \right. _ { 2 } ^ { 2 } ,
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
where $W _ { f }$ and $C _ { f }$ denote the width and channel dimensions for the feature maps of autoencoder bottleneck. The adversarial loss $\mathcal { L } _ { a d v }$ is determined by discriminator’s ability to discern whether data produced by the generator is real or fake. We use the gradient-friendly formulation originally posed in Goodfellow et al. (2014), given by
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\mathcal { L } _ { a d v } = - \log D ( G ( \pmb { x } \imath ) ) .
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
The composite loss $\mathcal { L } _ { G }$ for the generator is then given by the sum of the losses above, and the discriminator loss $\mathcal { L } _ { D }$ derives directly from the GAN optimization objective in Equation 1, i.e.,
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
\mathcal { L } _ { G } = \mathcal { L } _ { L 2 } + \lambda _ { f } \mathcal { L } _ { f } + \lambda _ { a d v } \mathcal { L } _ { a d v } ,
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\mathcal { L } _ { D } = - \left[ \log D ( \pmb { x } _ { h } ) + \log ( 1 - D ( G ( \pmb { x } _ { l } ) ) \right] ,
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
where $\lambda _ { f }$ and $\lambda _ { a d v }$ are constant scaling factors.
|
| 101 |
+
|
| 102 |
+
# 4 EXPERIMENTS
|
| 103 |
+
|
| 104 |
+
Datasets We evaluate our methods on three super-resolution tasks derived from the VCTK Corpus (Yamagishi), and the non-vocal music dataset from Mehri et al. (2017). For speech from VCTK, we compose a dataset with recordings from a single speaker (the Speaker1 task), and a dataset with recordings from multiple speakers (the Speaker99 task). Speaker1 consists of the first 223 recordings from VCTK speaker 225 for training, and the final 8 recordings for testing. Speaker99 uses all recordings from the first 99 VCTK speakers for training, and recordings from the last 10 speakers for testing. Piano uses the standard $8 8 \% - 6 \% - 6 \%$ train/validation/test split. For all tasks, the dataset is created by first applying an anti-aliasing lowpass filter, and then sampling random patches of fixed length from the resulting audio. Note that for the sake of direct comparison, the datasets above are the same as those used in Kuleshov et al. (2017).
|
| 105 |
+
|
| 106 |
+
Training methodology For Speaker1, we instantiate variants of MU-GAN and train for 400 epochs. For the larger datasets Speaker99 and Piano, models are trained for 150 epochs. The epoch number is empirically selected based on observed convergence, and performance saturation on the validation set. For all models, we use the ADAM optimizer with learning rate 1e-4, $\beta _ { 1 } = 0 . 9$ , $\beta _ { 2 } ~ = ~ 0 . 9 9 9$ , and a batch size of 32. For the autoencoder feature losses, we instantiate a model with $L = 4$ , and train for 400 epochs on the same dataset as its associated GAN model. The loss scaling factors $\lambda _ { f }$ and $\lambda _ { a d v }$ are fixed at 1.0 and 0.001, respectively. Additional details on model hyperparameters can be found in Appendix A.1.
|
| 107 |
+
|
| 108 |
+
Performance metrics We use three metrics to assess the quality of super-resolved audio: (1) signal-to-noise ratio (SNR), (2) log-spectral distance (LSD), and (3) mean opinion score (MOS). The SNR is a standard metric in signal processing communities, defined as
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
\begin{array} { r } { \mathrm { S N R } \left( x , x _ { r e f } \right) = 1 0 \log _ { 1 0 } \frac { \left\| x _ { r e f } \right\| _ { 2 } ^ { 2 } } { \left\| x - x _ { r e f } \right\| _ { 2 } ^ { 2 } } , } \end{array}
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
where $x$ is an approximation of reference signal $x _ { r e f }$ . LSD (Gray & Markel, 1976) measures differences between signal frequencies, and has better correlation with perceptual quality compared to SNR (Jie et al., 2014; Kuleshov et al., 2017). Given short-time discrete Fourier transforms $X$ and $X _ { r e f }$ , the LSD is given by
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\begin{array} { r } { \mathrm { L S D } \left( X , X _ { r e f } \right) = \frac { 1 } { W } \sum _ { w = 1 } ^ { W } \sqrt { \frac { 1 } { K } \sum _ { k = 1 } ^ { N } \left( \log _ { 1 0 } \frac { | X ( w , k ) | ^ { 2 } } { | X _ { r e f } ( w , k ) | ^ { 2 } } \right) ^ { 2 } } , } \end{array}
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
where $w$ and $k$ are the window and frequency bin indices, respectively6. Perceptual evaluation of speech quality (PESQ) (ITU-T, 2001) is an industry-standard methodology for the assessment of speech communication systems. Given reference and degraded audio signals, PESQ models the mean opinion score (MOS) of a group of listeners. Specifically, we use PESQ to produce MOS-LQO (listening quality objective) scores (ITU-T, 2003), which range from 1 to 5.
|
| 121 |
+
|
| 122 |
+
Impact of superpixel layers We find that the use of superpixel layers results in ${\sim } 1 4 \%$ improvement in training time across model sizes, with insignificant differences in terms of objective quality metrics. Differences in audio produced by the two methods were also imperceptible in informal selfblinded listening tests. This indicates that superpixel layers may be a suitable replacement for conventional strided convolutions, while offering improvements in training time without performance loss. Additional details are provided in Appendix A.2.
|
| 123 |
+
|
| 124 |
+
Objective performance evaluation Table 1 shows the quantitative performance of MU-GAN against other recent works. We denote MU-GAN8 as an instance of MU-GAN with a depth parameter of $L = 8$ , i.e., with 8 downsampling and 8 upsampling blocks. $U _ { ☉ }$ -net4 is the model with $L = 4$ from Kuleshov et al. (2017). To eliminate depth as a factor in the performance comparison, we reimplement the architecture from Kuleshov et al. (2017) with $L = 8$ , denoted as $U$ -net8.
|
| 125 |
+
|
| 126 |
+
Table 1 shows that MU-GAN8 often performs worse in terms of SNR compared to the baseline models, but has lower LSD and higher MOS-LQO. This indicates that while MU-GAN8 produces reconstructions with lower SNR, deviating in terms of sample-wise distance results in synthesis of more perceptually-relevant frequency content. The exception is with the Piano task, where MUGAN8 performs orders of magnitude better than the U-net baseline in terms of SNR. In general, we also find that performance on the speech tasks generally saturates at $R = 2$ for both $U$ -net8 and $M U .$ GAN8. Informal listening tests confirm that there are minimal differences at $R = 2$ , indicating that more difficult up-sampling ratios (i.e., $R = 4$ , 6) are better suited for grounds of further comparison.
|
| 127 |
+
|
| 128 |
+
Table 1: Objective comparison with baseline super-resolution networks†.
|
| 129 |
+
|
| 130 |
+
<table><tr><td rowspan="2" colspan="2"></td><td colspan="3">Up. Ratio R=2</td><td colspan="3">Up. Ratio R =4</td><td colspan="3">Up. Ratio R = 6</td></tr><tr><td>U-net4</td><td>U-net8</td><td>MU-GAN8</td><td>U-net4</td><td>U-net8</td><td>MU-GAN8</td><td>U-net4</td><td>U-net8</td><td>MU-GAN8</td></tr><tr><td rowspan="3">Speaker1</td><td>SNR</td><td>21.1</td><td>21.94</td><td>21.40</td><td>17.1</td><td>18.68</td><td>17.72</td><td>14.4</td><td>14.85</td><td>13.98</td></tr><tr><td>LSD</td><td>3.2</td><td>2.24</td><td>1.63</td><td>3.6</td><td>2.34</td><td>1.92</td><td>3.4</td><td>2.92</td><td>1.95</td></tr><tr><td>MOS-LQO</td><td>1</td><td>4.54</td><td>4.54</td><td>-</td><td>3.81</td><td>3.79</td><td>-</td><td>2.97</td><td>3.21</td></tr><tr><td rowspan="3">Speaker99</td><td>SNR</td><td>20.7</td><td>20.05</td><td>20.01</td><td>16.1</td><td>14.30</td><td>14.03</td><td>10.0</td><td>11.11</td><td>10.92</td></tr><tr><td>LSD</td><td>3.1</td><td>2.22</td><td>2.14</td><td>3.5</td><td>2.92</td><td>2.72</td><td>3.7</td><td>3.23</td><td>2.97</td></tr><tr><td>MOS-LQ0</td><td>1</td><td>3.68</td><td>3.75</td><td>-</td><td>2.68</td><td>2.93</td><td>1</td><td>2.44</td><td>2.69</td></tr><tr><td rowspan="2">Piano</td><td>SNR</td><td>30.1</td><td>44.98</td><td>52.03</td><td>23.5</td><td>31.71</td><td>32.28</td><td>16.1</td><td>22.53</td><td>24.71</td></tr><tr><td>LSD</td><td>3.4</td><td>1.12</td><td>0.90</td><td>3.6</td><td>1.35</td><td>1.30</td><td>4.4</td><td>1.53</td><td>1.41</td></tr></table>
|
| 131 |
+
|
| 132 |
+
† Metrics for $U$ -net4 are taken directly from Kuleshov et al. (2017); those for $U$ -net8 are from our reimplementation.
|
| 133 |
+
|
| 134 |
+
Table 2: A/B test user study scores.
|
| 135 |
+
|
| 136 |
+
<table><tr><td></td><td colspan="2">Piano</td><td colspan="4">Speaker99</td></tr><tr><td></td><td>#1</td><td>#2</td><td>#1</td><td>#2</td><td>#3</td><td>#4</td></tr><tr><td>MU-GAN8</td><td>9</td><td>15</td><td>14</td><td>11</td><td>15</td><td>10</td></tr><tr><td>U-net8 (baseline)</td><td>5</td><td>3</td><td>4</td><td>6</td><td>4</td><td>8</td></tr><tr><td>No preference</td><td>8</td><td>4</td><td>4</td><td>5</td><td>3</td><td>4</td></tr><tr><td colspan="7">R=4:Piano #1,Speaker99 #1,#3 R = 6: Piano #2,Speaker99 #2,#4</td></tr></table>
|
| 137 |
+
|
| 138 |
+
Table 3: Speaker1 objective metrics for $M U .$ - GAN8 trained with the speech classifierbased loss, and proposed loss $( \mathcal { L } _ { f , S V } , \mathcal { L } _ { f } )$ .
|
| 139 |
+
|
| 140 |
+
<table><tr><td></td><td colspan="2">R=2</td><td colspan="2">R=4</td><td colspan="2">R=6</td></tr><tr><td></td><td>Lf,sV</td><td>Lf</td><td>Lf.sv</td><td>Lf</td><td>Lf.sv</td><td>Lf</td></tr><tr><td>SNR</td><td>21.28</td><td>21.40</td><td>17.57</td><td>17.72</td><td>13.85</td><td>13.98</td></tr><tr><td>LSD</td><td>1.65</td><td>1.63</td><td>1.92</td><td>1.92</td><td>1.99</td><td>1.95</td></tr><tr><td>MOS-LQO</td><td>4.54</td><td>4.54</td><td>3.67</td><td>3.79</td><td>3.24</td><td>3.21</td></tr></table>
|
| 141 |
+
|
| 142 |
+
Subjective quality analysis To evaluate the performance of $M U – G A N$ with real listeners, we perform a randomized, single-blinded user study with 22 participants (Table 2). The study presents pairs of audio clips produced by MU-GAN8 and the best baseline model $U _ { ☉ }$ -net8, and asks participants to select a preferred clip, or “No preference.” We present two clips from Piano, and four sonically diverse clips from Speaker99. Table 2 shows that in all cases, listeners prefer audio produced by MU-GAN8 over the baseline method.
|
| 143 |
+
|
| 144 |
+
In general, we observe that audio produced by MU-GAN has greater clarity compared to audio produced by the baseline networks. The quality difference is most apparent during consonant sounds, which have more high-frequency content compared to typical vowel sounds. For instance, in the phrase “Ask her to bring these things from the store,” (Figure 5, bottom row) the consonant sounds in ‘Ask,’ ‘things,’ and ‘store’ have noticeably better articulation. In contrast, audio from the best baseline, $U _ { ☉ }$ -net8, sounds relatively dull and “muffled” in comparison. Note that on some audio clips super-resolved at $R = 4 , 6$ , we observe intermittent, audible noise that is not present in the baseline reconstructions. To ensure a fair analysis, we include audio clips in the user study where this noise is apparent. Additional comments on spurious noise can be found in Appendix A.3.
|
| 145 |
+
|
| 146 |
+
Comparison with classifier-based feature loss We compare the proposed unsupervised feature loss with the classifier-based loss from Germain et al. (2018) 7. Germain et al. (2018) use a VGGbased (Simonyan & Zisserman, 2014) network as a feature loss for speech denoising, and train the loss network on classification and audio tagging tasks from DCASE 2016 (Mesaros et al., 2018). Table 3 shows objective results obtained using the proposed loss $\mathcal { L } _ { f }$ and the classifier-based loss $\mathcal { L } _ { f , S V }$ on the Speaker1 task. Across all up-sampling ratios, the proposed unsupervised method performs on-par (and slightly better in some cases) compared to the classifier-based loss. Thus, our results suggest that using a domain-specific classifier-based loss may not provide any advantage in terms of performance. Given the issues related to training classifier models on general audio (Section 1), our method may be an attractive solution that does not compromise audio quality.
|
| 147 |
+
|
| 148 |
+

|
| 149 |
+
Figure 5: Spectrograms from the Speaker1 task at $R = 2$ (top row, Speaker 225), and Speaker99 task at $R = 4$ (bottom row, Speaker 360). (a-d) high-resolution, (b-e) super-resolved with $U _ { ☉ }$ -net8, and (c-f) super-resolved with MU-GAN8. Increased synthesis of high-frequency content by MU-GAN8 becomes more pronounced at difficult up-sampling ratios.
|
| 150 |
+
|
| 151 |
+
Table 4: MOS-LQO for ablated models on the Speaker1 task.
|
| 152 |
+
|
| 153 |
+
<table><tr><td rowspan="2"></td><td colspan="6">Configuration</td></tr><tr><td>MU-GAN4 Up. Ratio -Lf-Ladu</td><td>MU-GAN4 -Ladu(+Lf)</td><td>MU-GAN4 (+Ladu+Lf)</td><td>MU-GAN8 -Lf-Ladu</td><td>MU-GAN8 -Ladu(+Lf)</td><td>MU-GAN8 (+Ladv+Lf)</td></tr><tr><td>R=2</td><td>3.53</td><td>4.54</td><td>4.54</td><td>4.54</td><td>4.54</td><td>4.54</td></tr><tr><td>R=4</td><td>3.15</td><td>3.55</td><td>3.62</td><td>3.74</td><td>3.79</td><td>3.79</td></tr><tr><td>R=6</td><td>2.78</td><td>3.07</td><td>3.12</td><td>3.15</td><td>3.17</td><td>3.21</td></tr></table>
|
| 154 |
+
|
| 155 |
+
Ablation Analysis Table 4 shows the MOS-LQO metrics for the MU-GAN architecture with ablated model parameters. While almost all variations perform similarly well at $R = 2$ , adding depth (i.e., from $L = 4$ to $L = 8$ ) and additional loss terms improves performance on harder up-sampling ratios. Furthermore, adding the adversarial loss and unsupervised feature loss terms improve MOSLQO monotonically. For MU-GAN8, we see diminishing returns from adding the additional loss terms; much of the improvement over MU-GAN4 appears to come from the additional depth. On the other hand, adding the $\mathcal { L } _ { f }$ and $\mathcal { L } _ { a d v }$ losses to the MU-GAN4 variant yields significant benefits, such that its performance is comparable to that of MU-GAN8. This indicates that the feature and adversarial losses may be particularly useful to mitigate underfitting, or to decrease model size iso-performance.
|
| 156 |
+
|
| 157 |
+
Receptive Field Analysis While previous works have stressed the importance of large receptive fields (van den Oord et al., 2016; Luo et al., 2016; Yu & Koltun, 2016), little work exists to quantify receptive field sizes on practical problems. We use the methods of Luo et al. (2016) to measure the effective receptive field (ERF)8 of our model on different tasks with varying architectural hyperparameters. Notably, we find that while the theoretical receptive field of our network is on the order of hundreds of milliseconds (thousands of samples), measured ERF’s are generally no wider than 100 samples. Furthermore, we find that ERF size is strongly correlated with problem difficulty, rather than architectural hyperparameters such as depth and specific loss terms. While Luo et al. (2016) found that ERF size always increased compared to the ERF at initialization, we find that ERF decreases in many cases (Figure 6). Our findings imply that there may be subtle but important tradeoffs involved with receptive field size (for instance, ERF size versus noise rejection), and suggest promising avenues for deeper investigation of architectures that rely on large receptive fields.
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 6: Measured gradient magnitude at the model input and associated Gaussian fit with $M U .$ GAN4 for (a-c) $R = 2$ , 4, 6, respectively. (d) $2 \sigma$ ERF trend, compared to ERF at initialization.
|
| 161 |
+
|
| 162 |
+
# 5 CONCLUSION
|
| 163 |
+
|
| 164 |
+
In this work we develop methods to enable the application of GANs to audio processing, in particular with classifier-free feature losses. In addition to several new model building blocks, we show that a convolutional autoencoder can be used to implement a high-performance feature loss in the context of audio super-resolution. Demonstrated on several speech and music super-resolution tasks, we show that our architecture achieves state-of-the-art performance in both objective and subjective metrics. We perform a detailed analysis of our model, and also show that effective receptive field size may be an important property that is not well-explored. Finally, our work raises new possibilities for the design and analysis of neural network-based synthesis methods in important problem domains beyond audio processing.
|
| 165 |
+
|
| 166 |
+
# REFERENCES
|
| 167 |
+
|
| 168 |
+
Johannes Abel and Tim Fingscheidt. Artificial speech bandwidth extension using deep neural networks for wideband spectral envelope estimation. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 26(1):71–83, 2018.
|
| 169 |
+
Yusuf Aytar, Carl Vondrick, and Antonio Torralba. Soundnet: Learning sound representations from unlabeled video. In NIPS, 2016.
|
| 170 |
+
Pramod Bachhav, Massimiliano Todisco, Moctar Mossi, Christophe Beaugeant, and Nicholas Evans. Artificial bandwidth extension using the constant q transform. In IEEE International Conference on Acoustics, Speech and Signal Processing, pp. 5550–5554, 2017.
|
| 171 |
+
David Berthelot, Tom Schumm, and Luke Metz. BEGAN: boundary equilibrium generative adversarial networks. CoRR, abs/1703.10717, 2017.
|
| 172 |
+
ClariNet. Clarinet: Parallel wave generation in end-to-end text-to-speech. In Submitted to International Conference on Learning Representations, 2019. URL https://openreview.net/ forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ HklY120cYm. under review.
|
| 173 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. ImageNet: A Large-Scale Hierarchical Image Database. In CVPR, 2009.
|
| 174 |
+
Emily L Denton, Soumith Chintala, Arthur Szlam, and Rob Fergus. Deep generative image models using a laplacian pyramid of adversarial networks. In NIPS, pp. 1486–1494. 2015.
|
| 175 |
+
Chris Donahue, Julian McAuley, and Miller Puckette. Synthesizing audio with generative adversarial networks. CoRR, abs/1802.04208, 2018.
|
| 176 |
+
Alexey Dosovitskiy and Thomas Brox. Generating images with perceptual similarity metrics based on deep networks. In NIPS, pp. 658–666. 2016.
|
| 177 |
+
Jesse Engel, Cinjon Resnick, Adam Roberts, Sander Dieleman, Douglas Eck, Karen Simonyan, and Mohammad Norouzi. Neural audio synthesis of musical notes with wavenet autoencoders. CoRR, abs/1704.01279, 2017.
|
| 178 |
+
|
| 179 |
+
Francois G Germain, Qifeng Chen, and Vladlen Koltun. Speech denoising with deep feature losses. CoRR, 2018.
|
| 180 |
+
|
| 181 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In NIPS, pp. 2672–2680. 2014.
|
| 182 |
+
|
| 183 |
+
Augustine Gray and John Markel. Distance measures for speech processing. IEEE Transactions on Acoustics, Speech, and Signal Processing, 24(5):380–391, 1976.
|
| 184 |
+
|
| 185 |
+
Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. In CVPR, pp. 5967–5976, 2017.
|
| 186 |
+
|
| 187 |
+
ITU-T. Perceptual evaluation of speech quality, an objective method for end-to-end speech quality assessment of narrowband telephone networks and speech codecs. ITU-T Rec. P.862, 2001.
|
| 188 |
+
|
| 189 |
+
ITU-T. Mapping function for transforming p.862 raw result scores to MOS-LQO. ITU-T Rec. P.862.1, 2003.
|
| 190 |
+
|
| 191 |
+
Zhang Jie, Xiaoqun Zhao, Jingyun Xu, and Zhang Yang. Suitability of speech quality evaluation measures in speech enhancement. In International Conference on Audio, Language and Image Processing, pp. 22–26, 2014.
|
| 192 |
+
|
| 193 |
+
Justin Johnson, Alexandre Alahi, and Fei-Fei Li. Perceptual losses for real-time style transfer and super-resolution. CoRR, abs/1603.08155, 2016.
|
| 194 |
+
|
| 195 |
+
Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of gans for improved quality, stability, and variation. International Conference on Representation Learning, abs/1710.10196, 2018.
|
| 196 |
+
|
| 197 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. ICLR, 2014.
|
| 198 |
+
|
| 199 |
+
Volodymyr Kuleshov, S. Zayd Enam, and Stefano Ermon. Audio super resolution using neural networks. ICLR, abs/1708.00853, 2017.
|
| 200 |
+
|
| 201 |
+
Erik R. Larsen and Ronald M. Aarts. Audio Bandwidth Extension: Application of Psychoacoustics, Signal Processing and Loudspeaker Design. John Wiley & Sons, Inc., 2004. ISBN 0470858648.
|
| 202 |
+
|
| 203 |
+
Christian Ledig, Lucas Theis, Ferenc Huszar, Jose Caballero, Andrew Cunningham, Alejandro Acosta, Andrew P. Aitken, Alykhan Tejani, Johannes Totz, Zehan Wang, and Wenzhe Shi. Photorealistic single image super-resolution using a generative adversarial network. In CVPR, pp. 105–114, 2017.
|
| 204 |
+
|
| 205 |
+
Honglak Lee, Peter Pham, Yan Largman, and Andrew Y. Ng. Unsupervised feature learning for audio classification using convolutional deep belief networks. In NIPS, pp. 1096–1104. 2009.
|
| 206 |
+
|
| 207 |
+
Bin Liu, Jianhua Tao, Zhengqi Wen, Ya Li, and Danish Bukhari. A novel method of artificial bandwidth extension using deep architecture. In INTERSPEECH, 2015.
|
| 208 |
+
|
| 209 |
+
Wenjie Luo, Yujia Li, Raquel Urtasun, and Richard Zemel. Understanding the effective receptive field in deep convolutional neural networks. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett (eds.), NIPS, pp. 4898–4906. 2016.
|
| 210 |
+
|
| 211 |
+
Andrew L Maas, Awni Y Hannun, and Andrew Y Ng. Rectifier nonlinearities improve neural network acoustic models. In ICML, volume 30, pp. 3, 2013.
|
| 212 |
+
|
| 213 |
+
Soroush Mehri, Kundan Kumar, Ishaan Gulrajani, Rithesh Kumar, Shubham Jain, Jose Sotelo, Aaron C. Courville, and Yoshua Bengio. Samplernn: An unconditional end-to-end neural audio generation model. ICLR, 2017.
|
| 214 |
+
|
| 215 |
+
Annamaria Mesaros, Toni Heittola, Emmanouil Benetos, Peter Foster, Mathieu Lagrange, Tuomos Virtanen, and Mark D. Plumbley. Detection and classification of acoustic scenes and events: Outcome of the dcase 2016 challenge. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 26(2):379–393, 2018.
|
| 216 |
+
|
| 217 |
+
Mehdi Mirza and Simon Osindero. Conditional generative adversarial nets. CoRR, abs/1411.1784, 2014.
|
| 218 |
+
|
| 219 |
+
Augustus Odena, Vincent Dumoulin, and Chris Olah. Deconvolution and checkerboard artifacts. Distill, 2016. URL http://distill.pub/2016/deconv-checkerboard.
|
| 220 |
+
|
| 221 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. ICLR, 2015.
|
| 222 |
+
|
| 223 |
+
Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In Medical Image Computing and Computer-Assisted Intervention, pp. 234–241, 2015.
|
| 224 |
+
|
| 225 |
+
Andy M Sarroff and Michael A Casey. Musical audio synthesis using autoencoding neural nets. In International Computer Music Conference, 2014.
|
| 226 |
+
|
| 227 |
+
Wenzhe Shi, Jose Caballero, Ferenc Huszar, Johannes Totz, Andrew P. Aitken, Rob Bishop, Daniel ´ Rueckert, and Zehan Wang. Real-time single image and video super-resolution using an efficient sub-pixel convolutional neural network. In CVPR, pp. 1874–1883, 2016.
|
| 228 |
+
|
| 229 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. CoRR, abs/1409.1556, 2014.
|
| 230 |
+
|
| 231 |
+
Casper Kaae Sonderby, Tapani Raiko, Lars Maaloe, Soren Kaae Sonderby, and Ole Winther. Ladder variational autoencoders. In NIPS, pp. 3738–3746. 2016.
|
| 232 |
+
|
| 233 |
+
Jose Sotelo, Soroush Mehri, Kundan Kumar, Joo F. Santos, Kyle Kastner, Aaron Courville, and Yoshua Bengio. Char2Wav: End-to-end speech synthesis. In ICLR, 2017.
|
| 234 |
+
|
| 235 |
+
Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In CVPR, pp. 1–9, 2015.
|
| 236 |
+
|
| 237 |
+
Keiichi Tokuda, Yoshihiko Nankaku, Tomoki Toda, Heiga Zen, Junichi Yamagishi, and Keiichiro Oura. Speech synthesis based on hidden markov models. Proceedings of the IEEE, 101(5): 1234–1252, 2013.
|
| 238 |
+
|
| 239 |
+
Aaron van den Oord, Sander Dieleman, Heiga Zen, Karen Simonyan, Oriol Vinyals, Alex Graves, ¨ Nal Kalchbrenner, Andrew W. Senior, and Koray Kavukcuoglu. Wavenet: A generative model for raw audio. CoRR, abs/1609.03499, 2016.
|
| 240 |
+
|
| 241 |
+
Aaron van den Oord, Yazhe Li, Igor Babuschkin, Karen Simonyan, Oriol Vinyals, Koray Kavukcuoglu, George van den Driessche, Edward Lockhart, Luis Cobo, Florian Stimberg, Norman Casagrande, Dominik Grewe, Seb Noury, Sander Dieleman, Erich Elsen, Nal Kalchbrenner, Heiga Zen, Alex Graves, Helen King, Tom Walters, Dan Belov, and Demis Hassabis. Parallel WaveNet: Fast high-fidelity speech synthesis. In ICML, volume 80, pp. 3918–3926, 2018.
|
| 242 |
+
|
| 243 |
+
Pascal Vincent, Hugo Larochelle, Isabelle Lajoie, Yoshua Bengio, and Pierre-Antoine Manzagol. Stacked denoising autoencoders: Learning useful representations in a deep network with a local denoising criterion. JMLR, 11:3371–3408, 2010.
|
| 244 |
+
|
| 245 |
+
Junichi Yamagishi. CSTR VCTK corpus. http://homepages.inf.ed.ac.uk/ jyamagis/page3/page58/page58.html.
|
| 246 |
+
|
| 247 |
+
Fisher Yu and Vladlen Koltun. Multi-scale context aggregation by dilated convolutions. ICLR, abs/1511.07122, 2016.
|
| 248 |
+
|
| 249 |
+
# A APPENDIX
|
| 250 |
+
|
| 251 |
+
A.1 MODEL PARAMETERS
|
| 252 |
+
|
| 253 |
+
# A.2 EVALUATION OF SUPERPIXEL LAYERS
|
| 254 |
+
|
| 255 |
+
We evaluate the impact of the superpixel layer proposed in Section 3 by comparing a baseline multiscale U-net with strided convolutions (Strided) against a multiscale U-net with superpixel layers (Super). We halve the number of convolutional kernels in each downsampling layer for Super such that the output feature map dimensions at each downsampling and upsampling layer are identical to those in Strided. Both model types are trained with the baseline $L 2$ loss for 400 epochs on the Speaker1 task.
|
| 256 |
+
|
| 257 |
+
Table 5: Comparison of superpixel and strided convolutional layers.
|
| 258 |
+
(b) Quality metrics
|
| 259 |
+
|
| 260 |
+
<table><tr><td rowspan="2"></td><td rowspan="2"></td><td colspan="3">Upsampling I Ratio</td></tr><tr><td>R=2</td><td>R=4</td><td>R=6</td></tr><tr><td rowspan="2">SNR</td><td>Strided</td><td>21.67</td><td>18.45</td><td>14.91</td></tr><tr><td>Super</td><td>21.75</td><td>18.41</td><td>14.89</td></tr><tr><td rowspan="2">LSD</td><td>Strided</td><td>1.67</td><td>2.20</td><td>2.73</td></tr><tr><td>Super</td><td>1.70</td><td>2.08</td><td>2.39</td></tr><tr><td rowspan="2">MOS-LQ0</td><td>Strided</td><td>3.57</td><td>3.13</td><td>2.71</td></tr><tr><td>Super</td><td>3.53</td><td>3.15</td><td>2.78</td></tr></table>
|
| 261 |
+
|
| 262 |
+
(a) Training time per minibatch
|
| 263 |
+
|
| 264 |
+
<table><tr><td rowspan="2"></td><td colspan="2">Depth Parameter</td></tr><tr><td>L=4</td><td>L=8</td></tr><tr><td>Strided</td><td>149.8 s</td><td>195.1 s</td></tr><tr><td>Super</td><td>128.1 s</td><td>168.0 s</td></tr><tr><td>Speedup</td><td>14.5%</td><td>13.8%</td></tr></table>
|
| 265 |
+
|
| 266 |
+
# A.3 NOTE ON INTERMITTENT SPURIOUS NOISE
|
| 267 |
+
|
| 268 |
+
As described in Section 4, some audio clips super-resolved at $R = 4 , 6$ exhibit intermittent, audible noise that is not present in the baseline reconstructions. We find that this noise is not inherent to our specific feature loss, and is present if we replace the unsupervised feature loss with a classifierbased feature loss. The spurious noise is also unrelated to the use of $\mathcal { L } _ { a d v }$ , as it is present in audio generated by models trained only with $\mathcal { L } _ { f }$ . While a deeper investigation is planned for future work, we hypothesize that such noise stems from phase ambiguity in missing high-frequency content.
|
md/train/H1lS8oA5YQ/H1lS8oA5YQ.md
ADDED
|
@@ -0,0 +1,393 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FEATURE ATTRIBUTION AS FEATURE SELECTION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Feature attribution methods identify “relevant” features as an explanation of a complex machine learning model. Several feature attribution methods have been proposed; however, only a few studies have attempted to define the “relevance” of each feature mathematically. In this study, we formalize the feature attribution problem as a feature selection problem. In our proposed formalization, there arise two possible definitions of relevance. We name the feature attribution problems based on these two relevances as Exclusive Feature Selection (EFS) and Inclusive Feature Selection (IFS). We show that several existing feature attribution methods can be interpreted as approximation algorithms for EFS and IFS. Moreover, through exhaustive experiments, we show that IFS is better suited as the formalization for the feature attribution problem than EFS.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Feature attribution methods (Simonyan et al., 2013; Springenberg et al., 2014), or saliency maps, are one of the most popular approaches for explaining the decisions of complex machine learning models such as deep neural networks. In feature attribution, for each given instance, the feature attribution methods score how strongly each feature is relevant to the model’s decision. An informal definition of the feature attribution problem can be described as follows. We note that this definition is incomplete because the “relevance” of each feature is not defined.
|
| 12 |
+
|
| 13 |
+
Feature Attribution Problem Given the model $f$ and the target input $x \in \mathbb { R } ^ { d }$ to be explained, score $s _ { i } \in \mathbb { R }$ to each feature $x _ { i }$ $( i = 1 , 2 , \ldots , d )$ so that $s _ { i } \geq s _ { j }$ if the feature $x _ { i }$ is more relevant to the model’s decision than the feature $x _ { j }$ .
|
| 14 |
+
|
| 15 |
+
With feature attribution methods, the relevant features can be obtained as explanations why the models made certain decisions. For example, in image recognition, feature attribution methods highlight pixels which the models have focused on, by scoring the relevance of each pixel (Simonyan et al., 2013; Springenberg et al., 2014; Bach et al., 2015; Smilkov et al., 2017), and in text classification, they detect the set of words or sentences relevant to the model’s decision by scoring each word or sentence (Ding et al., 2017; Chen et al., 2018).
|
| 16 |
+
|
| 17 |
+
The major approaches for feature attribution are based on gradient and its modifications (Simonyan et al., 2013; Springenberg et al., 2014; Bach et al., 2015; Smilkov et al., 2017; Shrikumar et al., 2017) and feature occlusions (Zeiler & Fergus, 2014; Zhou et al., 2014).
|
| 18 |
+
|
| 19 |
+
Most of the studies proposed computational algorithms without defining the “relevance” mathematically (except for some axiomatic approaches (Sundararajan et al., 2017; Lundberg & Lee, 2017)). This means that it is not clear what these algorithm outputs, and we cannot compare these outputs rigorously. To clarify the situation and to establish solid feature attribution methods, we pose the following research questions: (Q1) how can we define relevance? (Q2) is there a general framework for the relevance that induces existing feature attribution methods? and (Q3) what is an appropriate definition of relevance?
|
| 20 |
+
|
| 21 |
+
In this study, we formalize the feature attribution problem as feature selection problem, and thereby answer questions (Q1)–(Q3). In our proposed formalization, there arise two possible definitions of relevance. We name the feature attribution problems based on these two relevances as Exclusive Feature Selection (EFS) and Inclusive Feature Selection (IFS).
|
| 22 |
+
|
| 23 |
+
Below, we summarize our contributions.
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: Reorganizing feature attribution methods as Exclusive Feature Selection (EFS) and Inclusive Feature Selection (IFS). See the references for the details of each method: Grad (Simonyan et al., 2013), Grad $. \times$ Input (Shrikumar et al., 2016), IntGrad (Sundararajan et al., 2017), SmoothGrad (Smilkov et al., 2017; Hooker et al., 2018), LIME (Ribeiro et al., 2016), SHAP (Lundberg & Lee, 2017), GuidedBP (Springenberg et al., 2014), ExciteBP (Zhang et al., 2016), LRP (Bach et al., 2015), DeepTaylor (Montavon et al., 2017), DeepLIFT (Shrikumar et al., 2017), Occlusion (Zeiler & Fergus, 2014), Detector (Zhou et al., 2014), Anchor (Ribeiro et al., 2018), Meaningful Perturbation (Fong & Vedaldi, 2017), and PertMap (Hara et al., 2018; Ikeno & Hara, 2018)
|
| 27 |
+
|
| 28 |
+
Answer to Q1: We introduce two formalizations, namely EFS and IFS (Section 2). We formalize the feature attribution problem as feature selection problem, because the goal of feature attribution is to identify the relevant features to the model’s decision. Here, we point out that there are two possible approaches for characterizing the relevance of the features. In the first approach, EFS, we exclude some features from the model, and if the model’s decision changes by the exclusion, we infer the excluded features are relevant since they have certain impacts to the decision. In the second approach, IFS, we include some features to the model, and if the model’s decision remains unchanged after the inclusion, we infer the included features are relevant since they are essential to the decision.
|
| 29 |
+
|
| 30 |
+
Answer to Q2: The existing methods are based on the relevances of EFS and IFS (Section 3). We show that several existing feature attribution methods can be interpreted as approximation algorithms for EFS or IFS, as summarized in Figure 1. For example, the gradient-based methods are one-step gradient descent for the continuous relaxation of EFS and IFS.
|
| 31 |
+
|
| 32 |
+
Answer to Q3: The relevance based on IFS is better suited for the feature attribution problem (Section 5). We observe that IFS is better suited as the formalization for the feature attribution problem than EFS. Through exhaustive experiments, we found two crucial properties of EFS. First, the optimal solution to EFS is very similar to adversarial example (Szegedy et al., 2013). As adversarial examples generally provide seemingly meaningless attributions, they are not appropriate for the purpose of explanation. Second, we empirically observe that even a random attribution can perform comparably well with some of the existing feature attribution methods under the evaluation based on EFS. This observation indicates that there are only subtle differences between good attributions and random attributions under EFS. In contrast, unlike EFS, IFS has no trivial drawbacks, and we argue that IFS would be an appropriate formalization for the feature attribution problem.
|
| 33 |
+
|
| 34 |
+
In this paper, we use the following notation, and consider the problem setting as follows.
|
| 35 |
+
|
| 36 |
+
Notation For any positive integer $d , \ [ d ]$ denotes the set $[ d ] ~ = ~ \{ 1 , 2 , \ldots , d \}$ . We denote $d$ - dimensional vectors with all zeros as $0 _ { d }$ . For a proposition $a$ , $\mathbb { I } ( a )$ denotes the indicator of $a$ , i.e., $\mathbb { I } ( a ) = 1$ if $a$ is true, and $\mathbb { I } ( a ) = 0$ if $a$ is false.
|
| 37 |
+
|
| 38 |
+
Settings In this paper, we consider the classification model $f$ for $C$ categories that return an output $y \in \breve { \mathbb { R } } ^ { C }$ for a given data $\boldsymbol { x } ~ \in ~ \mathbb { R } ^ { d }$ , i.e., $y \ = \ f ( x )$ . The classification result is determined by $c = \operatorname { a r g m a x } _ { j } y _ { j }$ where $y _ { j } = f _ { j } ( x )$ is the $j$ -th element of the output. We assume that the model $f$ is differentiable with respect to the input $x$ : the target models therefore include linear models, kernel models with differentiable kernels, and deep neural networks. We assume that the model $f$ and the target input $x$ to be explained are given and fixed.
|
| 39 |
+
|
| 40 |
+
# 2 FEATURE ATTRIBUTION AS FEATURE SELECTION
|
| 41 |
+
|
| 42 |
+
(Q1) How can we define the relevance?
|
| 43 |
+
|
| 44 |
+
As an answer to this question, we formalize the feature attribution problem as feature selection problem, and introduce two definitions of relevance.
|
| 45 |
+
|
| 46 |
+
Before formalizing the problem, we introduce the idea of data corruption (Samek et al., 2017; Fong & Vedaldi, 2017), which plays an important role in this study. Here, we consider corrupting the input data $x$ by overlaying partial features with a noise $r \in \mathbb { R } ^ { d }$ , as follows.
|
| 47 |
+
|
| 48 |
+
Definition 2.1 (Data Corruption). For a vector $x \in \mathbb { R } ^ { d }$ , the corruption of $x$ with the set $S \subseteq [ d ]$ and the vector $r \in { \mathbb { R } ^ { d } }$ is given by $x _ { S , r }$ , which is defined below.
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
( x _ { S , r } ) _ { i } = \left\{ { r _ { i } \mathrm { \quad ~ i f ~ } i \in S } , \right.
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
We refer to the set $S$ as corrupted features.
|
| 55 |
+
|
| 56 |
+
Here, we assume that the noise $r$ follows a distribution $p ( r )$ . In Section 5, we introduce two types of noises $r$ for the images; we overlay the image to be explained with random noises and random real images.
|
| 57 |
+
|
| 58 |
+
We now consider the problem formalization. Recall that the objective of feature attribution is to provide high scores to relevant features to the model’s decision and low scores to irrelevant features. Our idea is to define the relevance and irrelevance using data corruption. Specifically, in this study, we consider two types of feature selection problems based on data corruption. We name those two problems as Exclusive Feature Selection (EFS) and Inclusive Feature Selection (IFS).
|
| 59 |
+
|
| 60 |
+
# 2.1 EXCLUSIVE FEATURE SELECTION (EFS)
|
| 61 |
+
|
| 62 |
+
One way of measuring the relevance of features is to corrupt some of the features by overlaying with uninformative values and observe how the model’s decision changes. If the corruption of certain features leads to a decision change, such features can be considered as “relevant”. We note that corrupting many features easily leads to a decision change. Therefore, our focus is mainly on a small number of crucial features that can change the decision. We formalize this idea as Exclusive Feature Selection (EFS). In EFS, we aim at changing the decision of the model $f$ to a class different from $c$ by corrupting only a small number of features. See Figure 2 for the idea of EFS. The idea of EFS was originally proposed for measuring the performance of feature attribution methods (Samek et al., 2017). Here, we define EFS as follows.
|
| 63 |
+
|
| 64 |
+
Definition 2.2 (Exclusive Feature Selection (EFS)). Find the feature corruption $S \subseteq [ d ]$ such that (i) the number of corrupted features $| S |$ is small, and (ii) the corrupted data $x _ { S , r }$ has small intensity at class $c$ , i.e. $f _ { c } ( x _ { S , r } )$ is small, so that the corrupted data is classified into a different class.
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\begin{array} { r } { S _ { \mathrm { E F S } } : = \mathrm { a r g m i n } _ { S \subseteq [ d ] } | S | + \lambda \mathbb { E } _ { r } [ f _ { c } ( x _ { S , r } ) ] , } \end{array}
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where $\mathbb { E } _ { r }$ denotes the expectation over the noise $r$ , and $\lambda > 0$ is a weight parameter determined by the user.
|
| 71 |
+
|
| 72 |
+
In this definition, we consider the expected intensity $\mathbb { E } _ { r } [ f _ { c } ( x _ { S , r } ) ]$ over the noise $r$ so to avoid the corruption to overfit a specific realization of the noise $r$ .
|
| 73 |
+
|
| 74 |
+
By using the solution of EFS, we can define relevance as a binary score as follows. That is, in EFS, the relevant features are the ones when excluded from the data lead to the model’s decision change.
|
| 75 |
+
|
| 76 |
+
Definition 2.3 (EFS-Relevance). The relevance of each feature $x _ { i }$ is defined by $s _ { i } : = \mathbb { I } ( i \in S _ { \mathrm { E F S } } )$
|
| 77 |
+
|
| 78 |
+

|
| 79 |
+
Figure 2: The idea of EFS: Within the trade-off between intensity $\mathbb { E } _ { r } [ f _ { c } ( x _ { S , r } ) ]$ and the number of corrupted features $| S |$ , find $S$ that minimizes the intensity and its size. The red pixels indicate the corrupted features $S$ . The corrupted features $S$ in the second image is optimal in this curve.
|
| 80 |
+
|
| 81 |
+

|
| 82 |
+
Figure 3: The idea of IFS: Within the trade-off between intensity $\mathbb { E } _ { r } [ f _ { c } ( x _ { S , r } ) ]$ and the number of corrupted features $| S |$ , find $S$ that maximizes the intensity and its size. The red pixels indicate the corrupted features $S$ . The corrupted features $S$ in the fourth image is optimal in this curve.
|
| 83 |
+
|
| 84 |
+
# 2.2 INCLUSIVE FEATURE SELECTION (IFS)
|
| 85 |
+
|
| 86 |
+
Data corruption can be used for measuring the relevance of features in a way different from that of EFS. If the corruption of certain features does not change the model’s decision, such features can be considered as “irrelevant”. We note that zero corruption trivially keeps the decision unchanged. Therefore, our focus is mainly on a small number of crucial features that have to be kept to maintain the decision. Therefore, in Inclusive Feature Selection, we aim at maintaining the decision of the model $f$ in the class $c$ while corrupting as many features as possible. See Figure 3 for the idea of IFS. Here, we formally define IFS as follows.
|
| 87 |
+
|
| 88 |
+
Definition 2.4 (Inclusive Feature Selection (IFS)). Find the feature corruption $S \subseteq [ d ]$ such that (i) the number of corrupted features $| S |$ is large, and (ii) the corrupted data $x _ { S , r }$ has high intensity at class $c$ , i.e. $f _ { c } ( x _ { S , r } )$ is large, so that the corrupted data is classified to the class $c$ .
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\begin{array} { r } { S _ { \mathrm { I F S } } : = \mathrm { a r g m a x } _ { S \subseteq [ d ] } | S | + \lambda \mathbb { E } _ { r } [ f _ { c } ( x _ { S , r } ) ] . } \end{array}
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
By using the solution of IFS, we can define relevance as follows. In IFS, the relevant features are the ones that when included in the data keep the model’s decision unchanged.
|
| 95 |
+
|
| 96 |
+
Definition 2.5 (IFS-Relevance). The relevance of each feature $x _ { i }$ is defined by $s _ { i } : = \mathbb { I } ( i \notin S _ { \mathrm { I F S } } )$ .
|
| 97 |
+
|
| 98 |
+
# 3 FEATURE ATTRIBUTION METHODS AS EFS AND IFS
|
| 99 |
+
|
| 100 |
+
(Q2) Is there a general framework for the relevance that induces existing feature attribution methods?
|
| 101 |
+
|
| 102 |
+
As an answer to this question, we show that the existing feature attribution methods can be interpreted as approximation algorithms for EFS or IFS. Thus, the relevances considered in the existing methods are approximated versions of EFS-Relevance and IFS-Relevance. To show this, we classify the existing methods into three types of approaches for solving EFS and IFS: occlusion-based, optimization-based, and gradient-based. See Figure 1 for the overview.
|
| 103 |
+
|
| 104 |
+
# 3.1 OCCLUSION-BASED APPROACHES
|
| 105 |
+
|
| 106 |
+
Occlusion-based feature attribution methods (Zeiler & Fergus, 2014; Zhou et al., 2014; Ribeiro et al., 2018) measure the relevance by partially masking features. In those methods, the features are masked by sliding windows or patches, and the change of the output $f _ { c }$ is computed. This can be interpreted as an approximation algorithm for solving the problems (2.2) and (2.3). Instead of searching over exponentially large solution candidates $S \subseteq [ d ]$ , those methods search only over the subset of the solution candidates. For example, one prepares a set of feature subsets $\{ S _ { m } : S _ { m } \subseteq$ $[ d ] \} _ { m = 1 } ^ { M }$ , and searches for an optimal combination of the subsets by using a greedy algorithm (Zhou14) or by a bandit algorithm (Ribeiro et al., 2018).
|
| 107 |
+
|
| 108 |
+
# 3.2 OPTIMIZATION-BASED APPROACHES
|
| 109 |
+
|
| 110 |
+
In order to introduce the optimization-based feature attribution methods, we consider the continuous relaxation of EFS and IFS, as follows.
|
| 111 |
+
|
| 112 |
+
Definition 3.1 (Continuous Corruption). For a vector $x \in \mathbb { R } ^ { d }$ , the continuous corruption of $x$ with the vector $w \in [ 0 , 1 ] ^ { d }$ and the vector $r \in \mathbb { R } ^ { d }$ is given by $\bar { x } _ { w , r }$ , which is defined below.
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
( \bar { x } _ { w , r } ) _ { i } = ( 1 - w _ { i } ) x _ { i } + w _ { i } r _ { i } .
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
Here, the vector $w$ can be interpreted as the continuous relaxation of the indicator of the set $S$ .
|
| 119 |
+
|
| 120 |
+
Definition 3.2 (Continuous EFS (C-EFS)). Find the vector $w \in [ 0 , 1 ] ^ { d }$ such that (i) the amount of corruption $\textstyle \sum _ { i = 1 } ^ { d } w _ { i }$ is small, and (ii) the corrupted data $\bar { x } _ { w , r }$ has small intensity at class $c$ :
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\begin{array} { r } { w _ { \mathrm { E F S } } : = \operatorname * { a r g m i n } _ { w \in [ 0 , 1 ] ^ { d } } \sum _ { i = 1 } ^ { d } w _ { i } + \lambda \mathbb { E } _ { r } [ f _ { c } ( \bar { x } _ { w , r } ) ] . } \end{array}
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
Definition 3.3 (Continuous IFS (C-IFS)). Find the vector $w \in [ 0 , 1 ] ^ { d }$ such that (i) the amount of corruption $\textstyle \sum _ { i = 1 } ^ { d } w _ { i }$ is large, and (ii) the corrupted data $\bar { x } _ { w , r }$ has large intensity at class $c$ :
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
\begin{array} { r } { w _ { \mathrm { I F S } } : = \operatorname * { a r g m a x } _ { w \in [ 0 , 1 ] ^ { d } } \sum _ { i = 1 } ^ { d } w _ { i } + \lambda \mathbb { E } _ { r } [ f _ { c } ( \bar { x } _ { w , r } ) ] . } \end{array}
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+
For C-EFS and C-IFS, the feature attribution scores can be defined as $s _ { i } = w _ { \mathrm { E F S } , i }$ and $s _ { i } = 1 -$ $w _ { \mathrm { I F S } , i }$ , respectively. We note that, for a differentiable model $f$ , the objective functions of C-EFS (3.2) and C-IFS (3.3) are differentiable. Therefore, these problems can be solved using gradientbased optimization methods such as SGD and Adam (Kingma & Ba, 2014).
|
| 133 |
+
|
| 134 |
+
Fong & Vedaldi (2017) first introduced the formulation of C-EFS, and they proposed Meaningful Perturbation by adding a smoothness penalty term to C-EFS. PertMap (Hara et al., 2018; Ikeno & Hara, 2018), another optimization-based method, can be interpreted as a variant of C-IFS. PertMap is equivalent to C-IFS with the term $\mathbb { E } _ { r } [ f _ { c } ( \bar { x } _ { w , r } ) ]$ replaced with the hinge penalty term $\begin{array} { r } { \sum _ { j \neq c } \bar { \mathbb { E } } _ { r } [ \operatorname* { m i n } ( 0 , f _ { c } ( \bar { x } _ { w , r } ) - f _ { j } ( \bar { x } _ { w , r } ) ) ] } \end{array}$ that penalizes $w$ only when the corrupted data is classified into other classes. See Appendix A for the detail.
|
| 135 |
+
|
| 136 |
+
# 3.3 GRADIENT-BASED APPROACHES
|
| 137 |
+
|
| 138 |
+
Many feature attribution methods are based on the gradient of the model’s output ∂fc(x) . ∂xi Here, we point out that those gradient-based feature attribution methods can be interpreted as one-step gradient descent/ascent approximations for C-EFS and C-IFS. If we consider solving the problems (3.2) and (3.3) using gradient descent/ascent with the initial $w$ set to zeros, i.e. $w = 0 _ { d }$ , then, the first step of the optimization can be expressed as $\begin{array} { r } { w _ { i } 0 \pm \eta \{ \mathbb { E } _ { r } [ \frac { \partial f _ { c } ( \bar { x } _ { w , r } ) } { \partial w _ { i } } \Big | _ { w = 0 _ { d } } ] + \lambda \} \propto } \end{array}$ $\begin{array} { r } { \frac { \partial f _ { c } ( x ) } { \partial x _ { i } } ( \mu _ { i } - x _ { i } ) + \lambda } \end{array}$ , where $\eta > 0$ is the step size and $\mu _ { i } : = \mathbb { E } _ { r } [ r _ { i } ]$ . Here, because the penalty $\lambda$ and the step size $\eta$ are common across all the features, ${ \frac { \partial f _ { c } ( x ) } { \partial x _ { i } } } ( \mu _ { i } - x _ { i } )$ is the essential term that determines the size of $w _ { i }$ . This finding naturally connects EFS/IFS and the gradient-based feature attribution methods. See Appendix $\mathbf { B }$ for the details.
|
| 139 |
+
|
| 140 |
+
# 4 EFS AND IFS AS EVALUATION METRIC
|
| 141 |
+
|
| 142 |
+
The ideas of EFS and IFS can be used as metrics for evaluating the performance of feature attribution methods. Suppose that the feature attribution score $s \in \mathbb { R } ^ { d }$ is given.
|
| 143 |
+
|
| 144 |
+
EFS-based Metric The principle of EFS is that “crucial attribution should change the model’s decision by corrupting only a small number of relevant features”. For $q \in [ 0 , 1 ]$ , let the set of the top- $100 q \%$ relevant features be $S _ { q } : = \{ i : s _ { i } \geq t _ { q } \}$ , where $t _ { q }$ is the $1 0 0 q$ -th largest percentile in $s$ so that $| S _ { q } | = q d$ . Then, we can draw a curve showing the trade-off between the ratio of corrupted relevant features and the degree of the output change (Samek et al., 2017). For example, as the degree of the output changes, we can use the expected difference in intensity: $g _ { c } ^ { \mathrm { i n t e n s i t y } } ( \bar { S _ { q } } ) : = \mathbb { E } _ { r } [ f _ { c } ( \bar { x } ) -$ $f _ { c } ( x _ { S _ { q } , r } ) ]$ , and the probability of label mismatch: $g _ { c } ^ { \mathrm { l a b e l } } ( S _ { q } ) : = \mathbb { E } _ { r } [ \mathbb { I } ( c \neq \operatorname { a r g m a x } _ { j } f _ { j } ( x _ { S _ { q } , r } ) ) ]$ . The trade-off curve usually shows an increasing trend, and the area under the curve can be used as a measure of how quickly the output changes with an increase in the ratio of corrupted features (see Figure 4). In this paper, we refer to this area as Area Under the EFS-Curve (AUEC).
|
| 145 |
+
|
| 146 |
+
IFS-based Metric The principle of IFS is that “crucial attribution should maintain the model’s output even if many irrelevant features are corrupted”. Similar to EFS, we can construct an IFSbased metric based on this principle. Let $S _ { q } : = \{ i : s _ { i } \geq t _ { q } \}$ be the top- $100 q \%$ relevant features, as defined above. We then corrupt irrelevant features other than $S _ { q }$ , i.e. $\bar { S } _ { q } : = [ d ] \setminus S _ { q }$ . We can then draw a curve showing the trade-off between the ratio of corrupted irrelevant features and the degree of the output change such as $g _ { c } ^ { \mathrm { i n t e n s i t y } } \left( \bar { S } _ { q } \right)$ and $g _ { c } ^ { \mathrm { l a b e l } } ( \bar { S } _ { q } )$ . The trade-off curve usually shows an increasing trend with an increase in the ratio of corrupted features (see Figure 4). Therefore, the area over the curve can be used as a measure of how resistant the model’s decision is against the feature corruption. In this paper, we refer to this area as Area Over the IFS-Curve (AOIC).
|
| 147 |
+
|
| 148 |
+
# 5 EFS VS. IFS
|
| 149 |
+
|
| 150 |
+
# (Q3) What is an appropriate definition of relevance?
|
| 151 |
+
|
| 152 |
+
To answer this question, we compare EFS and IFS through exhaustive experiments. Our results indicate that EFS has several drawbacks, and we therefore argue that IFS-Relevance is better suited for the feature attribution problem.
|
| 153 |
+
|
| 154 |
+
# 5.1 EXPERIMENTAL SETUP
|
| 155 |
+
|
| 156 |
+
Models and Data As the target model $f$ to be explained, we adopted three pre-trained models, namely VGG16 (Simonyan & Zisserman, 2014), ResNet V2 with depth 152 (He et al., 2016), and Inception V3 (Szegedy et al., 2016), which were distributed at the Tensorflow repository1. As the target data $x$ to be explained, we selected 200 images from the validation set at ILSVRC2014 (Russakovsky et al., 2014) which were correctly classified by the three models.
|
| 157 |
+
|
| 158 |
+
Feature Attribution Methods In the experiments, we adopted several feature attribution methods for comparison: Grad (Simonyan et al., 2013), Grad $\times$ Input (Shrikumar et al., 2016), GuidedBP (Springenberg et al., 2014), SmoothGrad (Smilkov et al., 2017; Hooker et al., 2018), IntGrad (Sundararajan et al., 2017), LRP (Bach et al., 2015), DeepLIFT (Shrikumar et al., 2017), Occlusion (Zeiler & Fergus, 2014), and PertMap (Hara et al., 2018; Ikeno & Hara, 2018). Grad,
|
| 159 |
+
|
| 160 |
+
Grad $\times$ Input, GuidedBP, SmoothGrad, and IntGrad were implemented using saliency2 with default settings, and LRP, DeepLIFT, and Occlusion were implemented using DeepExplain3, where we set the mask size for Occlusion as $6 4 \times 6 4$ with the stride set to 16. We implemented PertMap based on the sample code4. We also adopted random attribution as the baseline where the score for each feature was generated uniformly random over $[ 0 , 1 ]$ .
|
| 161 |
+
|
| 162 |
+
In addition to the existing feature attribution methods, we implemented the following EFS-based and IFS-based methods: Greedy-EFS, which solves the problem (2.2) using a greedy algorithm; GradEFS, which solves the problem (3.2) using gradient descent; Greedy-IFS, which solves the problem (2.3) using a greedy algorithm; and Grad-IFS, which solves the problem (3.3) using gradient ascent. The details of these methods can be found in Appendix C.
|
| 163 |
+
|
| 164 |
+
Evaluation For evaluating AUEC and AOIC, we prepared two noise distributions $p ( r )$ . The first distribution is a uniform distribution: each $r$ is independently sampled from the uniform distribution over $[ 0 , 1 ] ^ { d }$ . The second distribution is a distribution over real images. We selected 100 images from the validation set at ILSVRC2014, with no overlap with the 200 images to be explained. Then, from those 100 images, we randomly selected an image as the noise $r$ . To compute AUEC and AOIC, we varied the percentile $q$ from zero to one, and for each $q$ , we computed the difference scores $g _ { c } ^ { \mathrm { l a b e l } } ( S _ { q } )$ and ${ \dot { g } } _ { c } ^ { \mathrm { l a b e l } } ( { \bar { S } } _ { q } )$ using empirical averages under those two noise distributions.
|
| 165 |
+
|
| 166 |
+
# 5.2 RESULTS
|
| 167 |
+
|
| 168 |
+
For each model, we computed the attribution scores for all 200 images using each of the 14 feature attribution methods. We then computed AUEC and AOIC under the two noise distributions.
|
| 169 |
+
|
| 170 |
+
Our main result is summarized in Table 1. Table 1 shows the AUEC and AOIC for VGG16 for the 200 images under uniform noise. We moved the results for the other models and the corruption with real images to Appendix D, as those results are similar. Here, we point out that there are three important observations in the table.
|
| 171 |
+
|
| 172 |
+
EFS found adversarial example. Grad-EFS attained the highest AUEC. This indicates that GradEFS is nearly optimal under the principle of EFS: Grad-EFS can change the model’s decision by corrupting only a small number of relevant features. Indeed, as shown in Figure 4, Grad-EFS has a sharp increase in the EFS-Curve 5. Specifically, it shows that Grad-EFS successfully changed the model’s decision for more than $80 \%$ of the data by corrupting only a few percent of the pixels. Similar tendencies were also observed for ResNet V2 and Inception V3 (see Appendix D).
|
| 173 |
+
|
| 174 |
+
An important observation is that the heatmap of Grad-EFS is just a shot noise, as shown in Figure 5. This is because EFS is very similar to adversarial example (Szegedy et al., 2013). In adversarial example, one seeks the minimum data perturbation that changes the model’s output. In EFS (2.2), instead of the data perturbation, one searches for a small number of corrupted features that reduces the class intensity. Similarly, C-EFS (3.2) searches for a continuous corruption with the minimum $\ell _ { 1 }$ norm.
|
| 175 |
+
|
| 176 |
+
Random attribution performed comparably well with existing methods. The random attribution attained AUEC similar to that of methods such as Grad $\times$ Input, IntGrad, LRP, and Occlusion, especially for VGG16. Indeed, as shown in Figure 4, the EFS-Curve of random attribution is close to those methods. It is a bit surprising to observe that we can attain a good trade-off in EFS just by randomly scoring each feature without looking at the images. This observation indicates that there are only subtle differences between good attributions and random attributions under EFS, especially for VGG16.
|
| 177 |
+
|
| 178 |
+
Grad-IFS significantly outperformed the other methods. On AOIC, Grad-IFS significantly outperformed the other methods, and PertMap attained the second best result. As shown in Figure 4, Grad-IFS is very resistant against the corruption of irrelevant features. Indeed, even if $80 \%$ of the pixels are corrupted, the model’s decision is kept unchanged for more than $80 \%$ of the images. This means that Grad-IFS is capable of identifying irrelevant features better than any other methods. Another interesting point that can be seen in Figure 4 is that, the IFS-Curves vary significantly across different methods. More importantly, unlike EFS, the IFS-Curve can distinguish random attributions and other attributions well.
|
| 179 |
+
|
| 180 |
+
Table 1: Average AUEC and AOIC under the uniform noise. The top-three scores are highlighted as ${ 1 } \mathrm { s t } ^ { * }$ , $2 \mathrm { n d } ^ { \ast \ast }$ , and $3 \mathrm { r d } ^ { * * * }$ .
|
| 181 |
+
|
| 182 |
+
<table><tr><td colspan="2">VGG16</td></tr><tr><td></td><td>AUEC AOIC 0.366</td></tr><tr><td>Greedy-EFS</td><td>0.844 0.946*</td></tr><tr><td>Grad-EFS</td><td>0.195</td></tr><tr><td>Greedy-IFS</td><td>0.746 0.622***</td></tr><tr><td>Grad-IFS</td><td>0.873 0.876*</td></tr><tr><td>Grad</td><td>0.867 0.341</td></tr><tr><td>Grad×Input</td><td>0.823 0.318</td></tr><tr><td>SmoothGrad</td><td>0.882 0.593</td></tr><tr><td>GuidedBP</td><td>0.918** 0.455</td></tr><tr><td>IntGrad</td><td>0.837 0.346</td></tr><tr><td>LRP</td><td>0.823 0.318</td></tr><tr><td>DeepLIFT</td><td>0.862 0.435</td></tr><tr><td>Occlusion</td><td>0.811 0.559</td></tr><tr><td>PertMap</td><td>0.886*** 0.780**</td></tr><tr><td>Random</td><td>0.839 0.160</td></tr></table>
|
| 183 |
+
|
| 184 |
+

|
| 185 |
+
Figure 4: Average EFS-Curve and IFS-Curve.
|
| 186 |
+
|
| 187 |
+

|
| 188 |
+
Figure 5: Attributions on VGG16: The red colored pixels are found to be strongly relevant with each method.
|
| 189 |
+
|
| 190 |
+
Figure 5 shows the examples of the attributions obtained by each method. It is important to note that the top-three AOIC methods, namely Grad-IFS, PertMap, and SmoothGrad, have highlighted only the dog face. The high AOICs on these methods indicate that the model has made the decision based on the dog face. In contrast, the other methods tend to generate noisy attributions over the entire body of the dog, which are false explanations from the perspective of IFS because their AOICs are far smaller than that of Grad-IFS: the noisy attributions failed to capture essential pixels in the image.
|
| 191 |
+
|
| 192 |
+
# 6 CONCLUSION
|
| 193 |
+
|
| 194 |
+
In this study, we formalized the feature attribution problem as two types of feature selection problems, which we named as EFS and IFS. Based on EFS and IFS, we clarified that the existing feature attribution methods can be interpreted as approximation algorithms for EFS and IFS. Then, through exhaustive experiments, we clarified that IFS is better suited as the formalization for the feature attribution problem; we observed that EFS has several unfavorable properties and concluded that EFS is not an appropriate formalization.
|
| 195 |
+
|
| 196 |
+
# REFERENCES
|
| 197 |
+
|
| 198 |
+
Sebastian Bach, Alexander Binder, Gregoire Montavon, Frederick Klauschen, Klaus-Robert M ´ uller, ¨ and Wojciech Samek. On pixel-wise explanations for non-linear classifier decisions by layer-wise relevance propagation. PloS ONE, 10(7):e0130140, 2015.
|
| 199 |
+
|
| 200 |
+
Jianbo Chen, Le Song, Martin Wainwright, and Michael Jordan. Learning to explain: An information-theoretic perspective on model interpretation. In Proceedings of the 35th International Conference on Machine Learning, pp. 882–891, 2018.
|
| 201 |
+
|
| 202 |
+
Yanzhuo Ding, Yang Liu, Huanbo Luan, and Maosong Sun. Visualizing and understanding neural machine translation. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics, pp. 1150–1159, 2017.
|
| 203 |
+
|
| 204 |
+
Ruth C Fong and Andrea Vedaldi. Interpretable explanations of black boxes by meaningful perturbation. In Proceeding of the IEEE International Conference on Computer Vision, pp. 3449 – 3457, 2017.
|
| 205 |
+
|
| 206 |
+
Satoshi Hara, Kouichi Ikeno, Tasuku Soma, and Takanori Maehara. Maximally invariant data perturbation as explanation. arXiv:1806.07004, 2018.
|
| 207 |
+
|
| 208 |
+
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.
|
| 209 |
+
|
| 210 |
+
Sara Hooker, Dumitru Erhan, Pieter-Jan Kindermans, and Been Kim. Evaluating feature importance estimates. arXiv:1806.10758, 2018.
|
| 211 |
+
|
| 212 |
+
Kouichi Ikeno and Satoshi Hara. Maximizing invariant data perturbation with stochastic optimization. arXiv:1807.05077, 2018.
|
| 213 |
+
|
| 214 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv:1412.6980, 2014.
|
| 215 |
+
|
| 216 |
+
Scott M Lundberg and Su-In Lee. A unified approach to interpreting model predictions. In Proceedings of Advances in Neural Information Processing Systems, pp. 4765–4774, 2017.
|
| 217 |
+
|
| 218 |
+
Gregoire Montavon, Sebastian Lapuschkin, Alexander Binder, Wojciech Samek, and Klaus-Robert ´ Muller. Explaining nonlinear classification decisions with deep taylor decomposition. ¨ Pattern Recognition, 65:211–222, 2017.
|
| 219 |
+
|
| 220 |
+
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.
|
| 221 |
+
|
| 222 |
+
Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. Anchors: High-precision model-agnostic explanations. In Proceedings of the 32nd AAAI Conference on Artificial Intelligence, pp. 1527– 1535, 2018.
|
| 223 |
+
|
| 224 |
+
Olga Russakovsky, Sanjeev Satheesh, Jia Deng, Sean Ma, Hao Su, Zhiheng Huang, Jonathan Krause, Andrej Karpathy, Alexander C Berg, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. Technical report, 2014.
|
| 225 |
+
|
| 226 |
+
Wojciech Samek, Alexander Binder, Gregoire Montavon, Sebastian Lapuschkin, and Klaus-Robert ´ Muller. Evaluating the visualization of what a deep neural network has learned. ¨ IEEE transactions on neural networks and learning systems, 28(11):2660–2673, 2017.
|
| 227 |
+
|
| 228 |
+
Avanti Shrikumar, Peyton Greenside, Anna Shcherbina, and Anshul Kundaje. Not just a black box: Learning important features through propagating activation differences. arXiv:1605.1713, 2016.
|
| 229 |
+
|
| 230 |
+
Avanti Shrikumar, Peyton Greenside, and Anshul Kundaje. Learning important features through propagating activation differences. In Proceedings of International Conference on Machine Learning, pp. 3145–3153, 2017.
|
| 231 |
+
|
| 232 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv:1409.1556, 2014.
|
| 233 |
+
|
| 234 |
+
Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Deep inside convolutional networks: Visualising image classification models and saliency maps. arXiv:1312.6034, 2013.
|
| 235 |
+
Daniel Smilkov, Nikhil Thorat, Been Kim, Fernanda Viegas, and Martin Wattenberg. Smoothgrad: ´ removing noise by adding noise. arXiv:1706.03825, 2017.
|
| 236 |
+
Jost Tobias Springenberg, Alexey Dosovitskiy, Thomas Brox, and Martin Riedmiller. Striving for simplicity: The all convolutional net. arXiv:1412.6806, 2014.
|
| 237 |
+
Mukund Sundararajan, Ankur Taly, and Qiqi Yan. Axiomatic attribution for deep networks. arXiv:1703.01365, 2017.
|
| 238 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. arXiv:1312.6199, 2013.
|
| 239 |
+
Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2818–2826, 2016.
|
| 240 |
+
Matthew D Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In Proceedings of European Conference on Computer Vision, pp. 818–833. Springer, 2014.
|
| 241 |
+
Jianming Zhang, Zhe Lin, Jonathan Brandt, Xiaohui Shen, and Stan Sclaroff. Top-down neural attention by excitation backprop. In Proceedings of European Conference on Computer Vision, pp. 543–559. Springer, 2016.
|
| 242 |
+
Bolei Zhou, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba. Object detectors emerge in deep scene cnns. arXiv:1412.6856, 2014.
|
| 243 |
+
|
| 244 |
+
# SUPPLEMENTARY MATERIAL FOR “FEATURE ATTRIBUTION AS FEATURE SELECTION”
|
| 245 |
+
|
| 246 |
+
Preliminaries We define the data-dependent noise by $r _ { x }$ as follows:
|
| 247 |
+
|
| 248 |
+
$$
|
| 249 |
+
r _ { x } : = x + u ,
|
| 250 |
+
$$
|
| 251 |
+
|
| 252 |
+
where we assume that the perturbation $u$ follows a distribution $p ( u )$ with $\mathbb { E } _ { u } [ u ] = 0$ . The continuous corruption with the noise $r _ { x }$ is then expressed as
|
| 253 |
+
|
| 254 |
+
$$
|
| 255 |
+
( \bar { x } _ { w , r _ { x } } ) _ { i } = ( 1 - w _ { i } ) x _ { i } + w _ { i } r _ { x , i } = x _ { i } + w _ { i } u _ { i } .
|
| 256 |
+
$$
|
| 257 |
+
|
| 258 |
+
That is, the continuous corruption $\hat { x } _ { w , r _ { x } }$ is centered at the data $x$ . Moreover, $\hat { x } _ { w , r _ { x } }$ distributes around $x$ with the magnitude $w$ . The data-dependent noise and this continuous corruption plays an important role when interpreting some of the existing feature attribution methods as EFS and IFS.
|
| 259 |
+
|
| 260 |
+
# A OPTIMIZATION-BASED FEATURE ATTRIBUTION METHODS AS EFS/IFS
|
| 261 |
+
|
| 262 |
+
Meaningful Perturbation (Fong & Vedaldi, 2017) is a variant of C-EFS defined below:
|
| 263 |
+
|
| 264 |
+
$$
|
| 265 |
+
\operatorname* { m i n } _ { w \in [ 0 , 1 ] ^ { d } } \sum _ { i = 1 } ^ { d } w _ { i } + \lambda f _ { c } ( \bar { x } _ { w , r } ) + \phi _ { \mathrm { s m o o t h } } ( w ) .
|
| 266 |
+
$$
|
| 267 |
+
|
| 268 |
+
The differences from C-EFS (3.2) are (i) it uses a fixed noise $r$ instead of the expectation, and (ii) the additional penalty term $\phi _ { \mathrm { s m o o t h } } ( w )$ is added so that $w$ to be smooth. Here, the smoothness penalty is essential for Meaningful Perturbation. Fong $\&$ Vedaldi (2017) have reported that the solution to the problem (A.1) without the smoothness penalty tends to be seemingly meaningless attributions. This is because C-EFS is very similar to the $\ell _ { 1 }$ penalized adversarial example, as we have discussed in Section 5. Therefore, we need to design an appropriate penalty term $\phi _ { \mathrm { s m o o t h } }$ to obtain reasonable attributions using Meaningful Perturbation.
|
| 269 |
+
|
| 270 |
+
PertMap (Hara et al., 2018; Ikeno & Hara, 2018) can be interpreted as a variant of C-IFS. PertMap finds irrelevant features by maximizing the data perturbation. Let $\hat { x } _ { w , r _ { x } }$ be the continuous corruption of the data $x$ with a data-dependent noise $r _ { x }$ , where the parameter $w$ determine the magnitude of the data perturbation. In PertMap, one seeks for the maximum data perturbation that maintains the classification result unchanged from the original class $c$ . The optimization problem of $w$ is defined as follows (Ikeno & Hara, 2018):
|
| 271 |
+
|
| 272 |
+
$$
|
| 273 |
+
\operatorname* { m a x } _ { w \in [ 0 , 1 ] ^ { d } } \sum _ { i = 1 } ^ { d } w _ { i } + \lambda \sum _ { j \neq c } \mathbb { E } _ { r } [ \operatorname* { m i n } ( 0 , f _ { c } ( \bar { x } _ { w , r } ) - f _ { j } ( \bar { x } _ { w , r } ) ) ] .
|
| 274 |
+
$$
|
| 275 |
+
|
| 276 |
+
This problem is equivalent to C-EFS except for the term $\mathbb { E } _ { r } [ f _ { c } ( \bar { x } _ { w , r } ) ]$ replaced with the hinge penalty term $\begin{array} { r } { \sum _ { j \neq c } \tilde { \mathbb { E } } _ { r } [ \operatorname* { m i n } ( 0 , f _ { c } ( \bar { x } _ { w , r } ) - f _ { j } ( \bar { x } _ { w , r } ) ) ] } \end{array}$ that penalizes $w$ only when the corrupted data is classified into other classes.
|
| 277 |
+
|
| 278 |
+
# B GRADIENT-BASED FEATURE ATTRIBUTION METHODS AS EFS/IFS
|
| 279 |
+
|
| 280 |
+
Many feature attribution methods are based on the gradient of the model’s output ∂fc(x) . Here, we show that those gradient-based feature attribution methods can be interpreted as one-step gradient descent/ascent approximations to C-EFS and C-IFS. If we consider solving the problems (3.2) and (3.3) using gradient descent/ascent with the initial $w$ set to zeros, i.e. $w = 0 _ { d }$ , then, the first step of the optimization can be expressed as
|
| 281 |
+
|
| 282 |
+
$$
|
| 283 |
+
w _ { i } 0 \pm \eta \{ \mathbb { E } _ { r } [ \frac { \partial f _ { c } ( \bar { x } _ { w , r } ) } { \partial w _ { i } } | _ { w = 0 _ { d } } ] + \lambda \} \propto \frac { \partial f _ { c } ( \boldsymbol { x } ) } { \partial x _ { i } } ( \mu _ { i } - x _ { i } ) + \lambda ,
|
| 284 |
+
$$
|
| 285 |
+
|
| 286 |
+
where $\eta > 0$ is the step size and $\mu _ { i } : = \mathbb { E } _ { r } [ r _ { i } ]$ . Here, because the penalty $\lambda$ and the step size $\eta$ are common across all the features, $\frac { \partial f _ { c } ( x ) } { \partial x _ { i } } ( \mu _ { i } - x _ { i } )$ is the essential term that determines the size of $w _ { i }$ . We therefore ignore the terms $\lambda$ and $\eta$ for simplicity. Then, the relationship between EFS/IFS and the gradient-based feature attribution methods can be summarized as follows.
|
| 287 |
+
|
| 288 |
+
Grad (Simonyan et al., 2013) Assuming $\mu _ { i } - x _ { i }$ to be constant across the features, $w _ { i }$ is equivalent to $\frac { \partial f _ { c } ( x ) } { \partial x _ { i } }$ up to the scaling factor $\mu _ { i } - x _ { i }$ .
|
| 289 |
+
|
| 290 |
+
Grad $\times$ Input (Shrikumar et al., 2016) Assuming $\mu _ { i }$ to be sufficiently small $( \mu _ { i } \to 0 )$ ), $w _ { i }$ is equivalent to $\frac { \partial f _ { c } ( x ) } { \partial x _ { i } } x _ { i }$
|
| 291 |
+
|
| 292 |
+
Linear Approximation (Bach et al., 2015; Sundararajan et al., 2017; Shrikumar et al., 2017; Montavon et al., 2017; Ribeiro et al., 2016; Lundberg $\pmb { \& }$ Lee, 2017) Several methods consider the linear approximation of the model $f$ in the neighborhood of the input $x$ . Specifically, they consider the linear model
|
| 293 |
+
|
| 294 |
+
$$
|
| 295 |
+
f _ { c } ( r ) = f _ { c } ( x ) + \langle w , r - x \rangle ,
|
| 296 |
+
$$
|
| 297 |
+
|
| 298 |
+
and uses the coefficient $w$ as the attribution score. Here, let us assume that the noise $r$ belongs to the $\epsilon$ -ball around $x$ , i.e. $r \in R ( x ; \epsilon ) : = \{ r : \| r - x \| \le \epsilon \}$ . For differentiable models, we can consider the first-order Taylor expansion within $R ( x ; \epsilon )$ :
|
| 299 |
+
|
| 300 |
+
$$
|
| 301 |
+
f _ { c } ( r ) = f _ { c } ( \boldsymbol { x } ) + \langle \nabla f _ { c } ( \boldsymbol { x } ) , r - \boldsymbol { x } \rangle + O ( \epsilon ^ { 2 } ) .
|
| 302 |
+
$$
|
| 303 |
+
|
| 304 |
+
Thus, in a rough sense, by ignoring the $O ( \epsilon ^ { 2 } )$ term, the coefficient $w _ { i }$ computed by those linear approximation methods is essentially equivalent to the gradient ∂fc(x) . Technically, those linear approximation methods consider further improvements over the pure gradient, so that the linear approximation to be valid not only in the infinitesimally small neighborhood of $x$ , but in a finite range from $x$ . Thus, the computed coefficient $w _ { i }$ can slightly differ from the gradient, nevertheless, those methods can be still classified as approximations of the gradient.
|
| 305 |
+
|
| 306 |
+
SmoothGrad (Smilkov et al., 2017; Hooker et al., 2018) In SmoothGrad, the attribution score is defined as the expectation of the squared gradient over perturbed inputs. Recall that the perturbed data can be expressed as $\hat { x } _ { w , r _ { x } }$ using the data-dependent noise $r _ { x }$ . Given the perturbation magnitude $w _ { 0 } > 0$ , the attribution score is defined as follows (Smilkov et al., 2017; Hooker et al., 2018):
|
| 307 |
+
|
| 308 |
+
$$
|
| 309 |
+
\mathrm { s c o r e s g } : = \mathbb { E } _ { r } \left[ \left( \frac { \partial f _ { c } ( \bar { x } _ { w _ { 0 } , r _ { x } } ) } { \partial ( \bar { x } _ { w _ { 0 } , r _ { x } } ) _ { i } } \right) ^ { 2 } \right]
|
| 310 |
+
$$
|
| 311 |
+
|
| 312 |
+
Here, we show that this score can be also interpreted as one-step gradient descent/ascent approximation to C-EFS and C-IFS. If we set the initial $w$ as $w _ { i } = w _ { 0 }$ , the first step of the optimization can be expressed as
|
| 313 |
+
|
| 314 |
+
$$
|
| 315 |
+
\begin{array} { r l } & { w _ { i } \gets w _ { 0 } \pm \eta \left\{ \mathbb { E } _ { r } \left[ \left. \frac { \partial f _ { c } ( \bar { x } _ { w , r _ { x } } ) } { \partial w _ { i } } \right| _ { w = w _ { 0 } } \right] + \lambda \right\} } \\ & { \quad = \pm \eta \mathbb { E } _ { r } \left[ \left. \frac { \partial f _ { c } ( \bar { x } _ { w , r _ { x } } ) } { \partial w _ { i } } \right| _ { w = w _ { 0 } } \right] + ( w _ { 0 } \pm \eta \lambda ) } \\ & { \quad = \pm \eta \mathbb { E } _ { u } \left[ \left. \frac { \partial f _ { c } ( \bar { x } _ { w , x + u } ) } { \partial ( \bar { x } _ { w , x + u } ) _ { i } } \right| _ { w = w _ { 0 } } u _ { i } \right] + ( w _ { 0 } \pm \eta \lambda ) , } \end{array}
|
| 316 |
+
$$
|
| 317 |
+
|
| 318 |
+
where we used the definition $r _ { x } = x + u$ in the last equality. Because $w _ { 0 } , \eta$ , and $\lambda$ are constants, the first term determines $w _ { i }$ . Moreover, by applying the Cauchy-Schwartz inequality, we obtain
|
| 319 |
+
|
| 320 |
+
$$
|
| 321 |
+
\left( \mathbb E _ { u } \left[ \left. \frac { \partial f _ { c } ( \bar { x } _ { w _ { 0 } , x + u } ) } { \partial ( \bar { x } _ { w _ { 0 } , x + u } ) _ { i } } \right| _ { w = w _ { 0 } } u _ { i } \right] \right) ^ { 2 } \leq \mathbb E _ { r } \left[ \left( \frac { \partial f _ { c } ( \bar { x } _ { w _ { 0 } , r _ { x } } ) } { \partial ( \bar { x } _ { w _ { 0 } , r _ { x } } ) _ { i } } \right) ^ { 2 } \right] \mathbb E _ { u } [ u _ { i } ^ { 2 } ] .
|
| 322 |
+
$$
|
| 323 |
+
|
| 324 |
+
If we selected the perturbation $u$ to have a common variance across the features, i.e. $\mathbb { E } _ { u } [ u _ { i } ^ { 2 } ] = \sigma ^ { 2 }$ for all $i \in [ d ]$ , we can conclude that $\mathbb { E } _ { r } \left[ \left( \frac { \partial f _ { c } ( \bar { x } _ { w _ { 0 } , r _ { x } } ) } { \partial ( \bar { x } _ { w _ { 0 } , r _ { x } } ) _ { i } } \right) ^ { 2 } \right]$ is the essential term determining $w$ , which is equivalent to (B.4).
|
| 325 |
+
|
| 326 |
+
Here, we note out our analysis can explain the success of SmoothGrad. Some studies (Smilkov et al., 2017; Hooker et al., 2018) have reported that SmoothGrad performs better than other gradient-based feature attribution methods in practice. As one-step gradient descent/ascent approximation to C-EFS and C-IFS, SmoothGrad starts the optimization from the non-zero point $w = w _ { 0 }$ while the other methods starts the optimization from zero $w = 0 _ { d }$ . If the initial point $w _ { 0 }$ is carefully chosen, it is apparent that one-step gradient descent/ascent from $w _ { 0 }$ can get closer to the solution than starting the optimization from zero.
|
| 327 |
+
|
| 328 |
+
# C IMPLEMENTATIONS OF EFS/IFS-BASED METHODS
|
| 329 |
+
|
| 330 |
+
In Section 5, we adopted the EFS-based and IFS-based methods: Greedy-EFS, which solves the problem (2.2) using a greedy algorithm; Grad-EFS, which solves the problem (3.2) using gradient descent; Greedy-IFS, which solves the problem (2.3) using a greedy algorithm; and Grad- $I F S$ , which solves the problem (3.3) using gradient ascent. Each method is implemented as follows.
|
| 331 |
+
|
| 332 |
+
Greedy-EFS In Greedy-EFS, we first prepared the feature subsets $S : = \{ S _ { m } \subseteq [ d ] \} _ { m = 1 } ^ { M }$ , where each subset $S _ { m }$ is constructed by sliding the window over the image. In our implementation, we set the window size as $6 4 \times 6 4$ and the stride set to 16. We started the greedy algorithm from $S = \emptyset$ , and iterated the following steps.
|
| 333 |
+
|
| 334 |
+
We repeated those steps ten times, and obtained $S$ as an approximation of $S _ { \mathrm { E F S } }$ . We used a gray background as the noise $r$ , i.e. $p ( r ) = \delta ( r = \mathrm { g r a y } )$ .
|
| 335 |
+
|
| 336 |
+
Greedy-IFS In Greedy-IFS, we prepared the feature subsets $S : = \{ S _ { m } \subseteq [ d ] \} _ { m = 1 } ^ { M }$ in the same way as Greedy-EFS. We started the greedy algorithm from $S = [ d ]$ , and iterated the following steps.
|
| 337 |
+
|
| 338 |
+
We repeated those steps ten times, and obtained $S$ as an approximation of $S _ { \mathrm { I F S } }$ . We used a gray background as the noise $r$ , i.e. $p ( r ) = \delta ( r = \mathrm { g r a y } )$ . We note that Greedy-IFS is essentially the same as the greedy method proposed by Zhou et al. (2014).
|
| 339 |
+
|
| 340 |
+
Grad-EFS In Grad-EFS, we used the data-dependent noise $r _ { x }$ , where we set the distribution $p ( u )$ to be uniform over $[ - 1 , 1 ] ^ { d }$ . In each step of the gradient descent, we approximated the gradient of C-EFS (3.2) using a batch of random realizations of $r _ { x }$ . In our implementation, we set the penalty weight $\lambda = 1 0 d$ and the batch size in each gradient approximation to be 32. As the optimization algorithm, we used Adam (Kingma & Ba, 2014) with the step size set to 0.5 and the remaining parameters set to default values. We run Adam for 200 steps, and obtained $w$ . We note that GradEFS is essentially the same as Meaningful Perturbation (Fong & Vedaldi, 2017) except that the smoothness penalty term is removed.
|
| 341 |
+
|
| 342 |
+
Grad-IFS In Grad-IFS, we used the data-dependent noise $r _ { x }$ , where we set the distribution $p ( u )$ to be uniform over $[ - 1 , 1 ] ^ { d }$ . In each step of the gradient ascent, we approximated the gradient of C-IFS (3.3) using a batch of random realizations of $r _ { x }$ . In our implementation, we set the penalty weight $\lambda = d$ and the batch size in each gradient approximation to be 32. As the optimization algorithm, we used Adam (Kingma & Ba, 2014) with the step size set to 0.03 and the remaining parameters set to default values. We run Adam for 1000 steps. In Grad-IFS, we used the averaged parameter over 1000 steps 11000 P t=1 $\textstyle { \frac { 1 } { 1 0 0 0 } } \sum _ { t = 1 } ^ { 1 0 0 0 } w ^ { ( t ) }$ as $w$ . This is a common technique to improve the quality of the solution obtained from stochastic optimization algorithms with convex objective functions. We found that this technique is helpful also for Grad-IFS. We also applied the same averaging technique to PertMap (Ikeno & Hara, 2018).
|
| 343 |
+
|
| 344 |
+
# D EXPERIMENTAL RESULTS
|
| 345 |
+
|
| 346 |
+
Here, we present all the results that are omitted from Section 5 due to the space limitation.
|
| 347 |
+
|
| 348 |
+
# D.1 AUEC AND AOIC
|
| 349 |
+
|
| 350 |
+
Table 2 and Table 3 show average AUEC and AOIC evaluated with uniform noises and random images, respectively. There are three important observations in these tables.
|
| 351 |
+
|
| 352 |
+
First, Grad-EFS attained the highest AUEC for VGG16 and Inception V3, and the second highest AUEC for ResNet V2. This indicates that Grad-EFS is nearly optimal under the principle of EFS: Grad-EFS can change the model’s decision by corrupting only a small number of relevant features. Indeed, as shown in Figure 6 and Figure 7, Grad-EFS has a sharp increase in the EFS-Curves. This is a natural consequence from the fact that EFS is very similar to adversarial example, as we discussed in Section 5.
|
| 353 |
+
|
| 354 |
+
Second, especially for VGG16, the random attribution attained AUEC similar to some of the methods such as Grad $\times$ Input, IntGrad, LRP, and Occlusion. Indeed, as in Figure 6 and Figure 7, the EFS-Curves of the random attribution are close to those methods. It is a bit surprising to observe that we can attain a good trade-off in EFS just by randomly scoring each feature without looking at the images. This observation indicates that there are only subtle differences between good attributions and random attributions under EFS, especially for VGG16.
|
| 355 |
+
|
| 356 |
+
Third, on AOIC, Grad-IFS consistently outperformed the other methods, and PertMap attained the second best result. As shown in Figure 6 and Figure 7, Grad-IFS is very resistant against the corruption of irrelevant features. This means that Grad-IFS is capable of identifying irrelevant features better than any other methods. Another important point that can be seen in Figure 6 and Figure 7 is that, the IFS-Curves vary significantly across different methods. More importantly, unlike EFS, the IFS-Curve can distinguish random attributions and other attributions well.
|
| 357 |
+
|
| 358 |
+
Table 2: Average AUEC and AOIC under the uniform noise. The top-three scores are highlighted as ${ 1 } \mathrm { s t } ^ { * }$ , 2nd∗∗, and $3 \mathrm { r d } ^ { * * * }$ .
|
| 359 |
+
|
| 360 |
+
<table><tr><td rowspan="2"></td><td colspan="2">VGG16</td><td colspan="2">ResNet V2</td><td colspan="2">Inception V3</td></tr><tr><td>AUEC</td><td>AOIC</td><td>AUEC</td><td>AOIC</td><td>AUEC</td><td>AOIC</td></tr><tr><td>Greedy-EFS</td><td>0.844</td><td>0.366</td><td>0.858**</td><td>0.391</td><td>0.837***</td><td>0.445</td></tr><tr><td>Grad-EFS</td><td>0.946*</td><td>0.195</td><td>0.858**</td><td>0.369</td><td>0.927*</td><td>0.394</td></tr><tr><td>Greedy-IFS</td><td>0.746</td><td>0.622</td><td>0.745</td><td>0.709***</td><td>0.715</td><td>0.685</td></tr><tr><td>Grad-IFS</td><td>0.873</td><td>0.876*</td><td>0.814</td><td>0.829*</td><td>0.817</td><td>0.868*</td></tr><tr><td>Grad</td><td>0.867</td><td>0.341</td><td>0.797</td><td>0.416</td><td>0.799</td><td>0.475</td></tr><tr><td>Grad×Input</td><td>0.823</td><td>0.318</td><td>0.750</td><td>0.404</td><td>0.748</td><td>0.441</td></tr><tr><td>SmoothGrad</td><td>0.882</td><td>0.593***</td><td>0.840</td><td>0.707</td><td>0.829</td><td>0.744***</td></tr><tr><td>GuidedBP</td><td>0.918**</td><td>0.455</td><td>0.874*</td><td>0.595</td><td>0.826</td><td>0.555</td></tr><tr><td>IntGrad</td><td>0.837</td><td>0.346</td><td>0.781</td><td>0.438</td><td>0.775</td><td>0.482</td></tr><tr><td>LRP</td><td>0.823</td><td>0.318</td><td>0.750</td><td>0.404</td><td>0.748</td><td>0.441</td></tr><tr><td>DeepLIFT</td><td>0.862</td><td>0.435</td><td>0.811</td><td>0.518</td><td>0.788</td><td>0.539</td></tr><tr><td>Occlusion</td><td>0.811</td><td>0.559</td><td>0.767</td><td>0.595</td><td>0.709</td><td>0.664</td></tr><tr><td>PertMap</td><td>0.886***</td><td>0.780**</td><td>0.828</td><td>0.765**</td><td>0.846**</td><td>0.817**</td></tr><tr><td>Random</td><td>0.839</td><td>0.160</td><td>0.691</td><td>0.308</td><td>0.714</td><td>0.290</td></tr></table>
|
| 361 |
+
|
| 362 |
+
Table 3: Average AUEC and AOIC under random images. The top-three scores are highlighted as ${ 1 } \mathrm { s t } ^ { * }$ , $2 \mathrm { n d } ^ { \ast \ast }$ , and $3 \mathrm { r d } ^ { * * * }$ .
|
| 363 |
+
|
| 364 |
+
<table><tr><td rowspan="2"></td><td colspan="2">VGG16</td><td colspan="2">ResNet V2</td><td colspan="2">Inception V3</td></tr><tr><td>AUEC</td><td>AOIC</td><td>AUEC</td><td>AOIC</td><td>AUEC</td><td>AOIC</td></tr><tr><td>Greedy-EFS</td><td>0.842</td><td>0.319</td><td>0.857***</td><td>0.388</td><td>0.857***</td><td>0.397</td></tr><tr><td>Grad-EFS</td><td>0.926*</td><td>0.179</td><td>0.861**</td><td>0.275</td><td>0.893*</td><td>0.293</td></tr><tr><td>Greedy-IFS</td><td>0.766</td><td>0.524***</td><td>0.763</td><td>0.589</td><td>0.760</td><td>0.521</td></tr><tr><td>Grad-IFS</td><td>0.858</td><td>0.630*</td><td>0.826</td><td>0.688*</td><td>0.844</td><td>0.705*</td></tr><tr><td>Grad</td><td>0.865</td><td>0.290</td><td>0.800</td><td>0.375</td><td>0.826</td><td>0.393</td></tr><tr><td>Grad×Input</td><td>0.835</td><td>0.296</td><td>0.775</td><td>0.384</td><td>0.789</td><td>0.396</td></tr><tr><td>SmoothGrad</td><td>0.880</td><td>0.486</td><td>0.846</td><td>0.647***</td><td>0.860</td><td>0.650***</td></tr><tr><td>GuidedBP</td><td>0.905**</td><td>0.416</td><td>0.876*</td><td>0.568</td><td>0.839</td><td>0.502</td></tr><tr><td>IntGrad</td><td>0.847</td><td>0.318</td><td>0.807</td><td>0.418</td><td>0.815</td><td>0.435</td></tr><tr><td>LRP</td><td>0.835</td><td>0.296</td><td>0.775</td><td>0.384</td><td>0.789</td><td>0.397</td></tr><tr><td>DeepLIFT</td><td>0.868</td><td>0.378</td><td>0.836</td><td>0.480</td><td>0.826</td><td>0.471</td></tr><tr><td>Occlusion</td><td>0.840</td><td>0.487</td><td>0.787</td><td>0.544</td><td>0.769</td><td>0.553</td></tr><tr><td>PertMap</td><td>0.876***</td><td>0.553**</td><td>0.833</td><td>0.660**</td><td>0.861**</td><td>0.661**</td></tr><tr><td>Random</td><td>0.842</td><td>0.160</td><td>0.760</td><td>0.237</td><td>0.767</td><td>0.234</td></tr></table>
|
| 365 |
+
|
| 366 |
+

|
| 367 |
+
Figure 6: Average EFS-Curve and IFS-Curve evaluated with uniform noises.
|
| 368 |
+
|
| 369 |
+

|
| 370 |
+
Figure 7: Average EFS-Curve and IFS-Curve evaluated with random images.
|
| 371 |
+
|
| 372 |
+
# D.2 EXAMPLE HEATMAPS
|
| 373 |
+
|
| 374 |
+
Figures 8–12 show examples of the heatmaps obtained by several feature attribution methods. There are two important observations in the figures.
|
| 375 |
+
|
| 376 |
+
First, the heatmaps of Grad-EFS are mostly shot noises, which are visibly meaningless. These are natural consequences from the fact that EFS is very similar to adversarial example, as we have discussed in Section 5.
|
| 377 |
+
|
| 378 |
+
Second, the high AOIC methods in Table 2 and Table 3, namely Grad-IFS, PertMap, and SmoothGrad, have highlighted mostly the faces of the animals. The high AOICs on these methods indicate that the model has made the decision based mostly on the animal face. In contrast, the other methods tend to generate noisy attributions over the entire body of the animals, which are false explanations from the perspective of IFS because their AOICs are far smaller than that of Grad-IFS: the noisy attributions failed to capture essential pixels in the images.
|
| 379 |
+
|
| 380 |
+

|
| 381 |
+
Figure 8: Example Heatmaps: The red colored pixels are found to be strongly relevant with each method.
|
| 382 |
+
|
| 383 |
+

|
| 384 |
+
Figure 9: Example Heatmaps: The red colored pixels are found to be strongly relevant with each method.
|
| 385 |
+
|
| 386 |
+

|
| 387 |
+
Figure 10: Example Heatmaps: The red colored pixels are found to be strongly relevant with each method.
|
| 388 |
+
|
| 389 |
+

|
| 390 |
+
Figure 11: Example Heatmaps: The red colored pixels are found to be strongly relevant with each method.
|
| 391 |
+
|
| 392 |
+

|
| 393 |
+
Figure 12: Example Heatmaps: The red colored pixels are found to be strongly relevant with each method.
|
md/train/HyeaSkrYPH/HyeaSkrYPH.md
ADDED
|
@@ -0,0 +1,356 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CERTIFIED DEFENSES FOR ADVERSARIAL PATCHES∗
|
| 2 |
+
|
| 3 |
+
Ping-yeh Chiang†, Renkun Ni†, Ahmed Abdelkader, Chen Zhu University of Maryland, College Park {pchiang,rn9zm,akader,chenzhu}@cs.umd.edu
|
| 4 |
+
|
| 5 |
+
Christoph Studer Cornell University studer@cornell.edu
|
| 6 |
+
|
| 7 |
+
Tom Goldstein
|
| 8 |
+
University of Maryland, College Park
|
| 9 |
+
tomg@cs.umd.edu
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
Adversarial patch attacks are among one of the most practical threat models against real-world computer vision systems. This paper studies certified and empirical defenses against patch attacks. We begin with a set of experiments showing that most existing defenses, which work by pre-processing input images to mitigate adversarial patches, are easily broken by simple white-box adversaries. Motivated by this finding, we propose the first certified defense against patch attacks, and propose faster methods for its training. Furthermore, we experiment with different patch shapes for testing, obtaining surprisingly good robustness transfer across shapes, and present preliminary results on certified defense against sparse attacks. Our complete implementation can be found on: https://github.com/Ping-C/certifiedpatchdefense.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Despite the great success of neural networks for vision problems, they are easily fooled by adversarial attacks in which the input to a machine learning model is modified with the goal of manipulating its output. Research in this area is largely focused on norm-bounded attack (Madry et al., 2017; Tramer\` & Boneh, 2019; Shafahi et al., 2019), where the adversary is allowed to perturb all pixels in an image provided that the $\ell _ { p }$ -norm of the perturbation is within prescribed bounds. Other adversarial models were also proposed, such as functional (Laidlaw & Feizi, 2019), rotation/translation (Engstrom et al., 2017), and Wasserstein (Wong et al., 2019), all of which allow modification to all pixels.
|
| 18 |
+
|
| 19 |
+
Whole-image perturbations are unrealistic for modeling ”physical-world” attacks, in which a realworld object is modified to evade detection. A physical adversary usually modifies an object using stickers or paint. Because this object may only occupy a small portion of an image, the adversary can only manipulate a limited number of pixels. As such, the more practical patch attack model was proposed (Brown et al., 2017). In a patch attack, the adversary may only change the pixels in a confined region, but is otherwise free to choose the values yielding the strongest attack. The threat to real-world computer vision systems is well-demonstrated in recent literature where carefully crafted patches can fool a classifier with high reliability (Brown et al., 2017; Karmon et al., 2018), make objects invisible to an object detector (Wu et al., 2019; Lee & Kolter, 2019), or fool a face recognition system (Sharif et al., 2017). In light of such effective physical-world patch attacks, very few defenses are known to date.
|
| 20 |
+
|
| 21 |
+
In this paper, we study principled defenses against patch attacks. We begin by looking at existing defenses in the literature that claim to be effective against patch attacks, including Local Gradient Smoothing (LGS) (Naseer et al., 2019) and Digital Watermarking (DW) (Hayes, 2018). Similar to what has been observed for whole-image attacks by (Athalye et al., 2018), we show that these patch defenses are easily broken by stronger adversaries. Concretely, we demonstrate successful white-box attacks, where the adversary designs an attack against a known model, including any pre-processing steps. To cope with such potentially stronger adversaries, we train a robust model that produces a lower-bound on adversarial accuracy. In particular, we propose the first certifiable defense against patch attacks by extending interval bound propagation (IBP) defenses (Gowal et al., 2018; Mirman et al., 2018). We also propose modifications to IBP training to make it faster in the patch setting. Furthermore, we study the generalization of certified patch defenses to patches of different shapes, and observe that robustness transfers well across different patch types. We also present preliminary results on certified defense against the stronger sparse attack model, where a fixed number of possibly non-adjacent pixels can be arbitrarily modified (Modas et al., 2019).
|
| 22 |
+
|
| 23 |
+
# 2 PROBLEM SETUP
|
| 24 |
+
|
| 25 |
+
We consider a white-box adversary that is allowed to choose the location of the patch (chosen from a set $\mathbb { L }$ of possible locations) and can modify pixels within the particular patch (chosen from the set $\mathbb { P }$ ) similar to (Karmon et al., 2018). An attack is successful if the adversary changes the classification of the network to a wrong label. In this paper, we are primarily interested in the patch attack robust accuracy (adversarial accuracy for short) as defined by
|
| 26 |
+
|
| 27 |
+
$$
|
| 28 |
+
\underset { x \sim X } { \mathbb { E } } \operatorname* { m i n } _ { p \in \mathbb { P } , l \in \mathbb { L } } \mathcal { X } [ f ( A ( x , p , l ) ; \theta ) = y ] ,
|
| 29 |
+
$$
|
| 30 |
+
|
| 31 |
+
where the operator $A$ places the adversarial patch p on a given image $\mathbf { X }$ at location $l$ , f is a neural network with parameter $\theta$ , $X$ is a distribution of images, and $\mathcal { X }$ is a characteristic function that takes value 1 if its argument is true, and 0 otherwise.
|
| 32 |
+
|
| 33 |
+
In this model, the strength of the adversary can vary depending on the set of possible patches allowed, and the type of perturbation allowed within the patch. In what follows, we assume the standard setup in which the adversary is allowed any perturbation that maintains pixel intensities in the range $[ 0 , 1 ]$ . Unless otherwise noted, we also assume the patch is restricted to a square of prescribed size. We consider two different options for the set $\mathbb { L }$ of possible patch locations. First, we consider a weak adversary that can only place patches at the corner of an image. We find that even this weak model is enough to break existing patch defenses. Then, we consider a stronger adversary with no restrictions on patch location, and use this model to evaluate our proposed defenses. Note that an adversary, when restricted to modify only a square patch at location $l$ in the image, has the freedom to modify any non-square subset of these pixels. In other words, a certified defense against square patch attacks also provably subverts any non-square patch attack that fits inside a small enough square.
|
| 34 |
+
|
| 35 |
+
In general, calculating the adversarial accuracy (1) is intractable due to non-convexity. Common approaches try to approximate it by solving the inner minimization using a gradient-based method. However, in Section 3, we show that depending on how the minimization is solved, the upper bound could be very loose: a model may appear to be very robust, but fail when faced with a stronger attack. To side-step the arms race between attacks and defenses, in Section 4, we extend the work of (Gowal et al., 2018) and (Mirman et al., 2018) to train a network that produces a lower bound on adversarial accuracy. We will refer to approximations of the upper bound as empirical adversarial accuracy and the lower bound as certified accuracy.
|
| 36 |
+
|
| 37 |
+
# 3 VULNERABILITY OF EXISTING DEFENSES
|
| 38 |
+
|
| 39 |
+
We start by examining existing defense strategies that claim to be effective against patch attacks. Similar to what has been observed for whole-image attacks by Athalye et al. (2018), we show that these patch defenses can easily be broken by white-box attacks, where the adversary optimizes against a given model including any pre-processing steps.
|
| 40 |
+
|
| 41 |
+
# 3.1 EXISTING DEFENSES
|
| 42 |
+
|
| 43 |
+
Under our threat model, two defenses have been proposed that each use input transformations to detect and remove adversarial patches.
|
| 44 |
+
|
| 45 |
+
The first defense is based on the observation that the gradient of the loss with respect to the input image often exhibits large values near the perturbed pixels. In (Hayes, 2018), the proposed digital watermarking (DW) approach exploits this behavior to detect unusually dense regions of large gradient entries using saliency maps, before masking them out in the image. Despite a $1 2 \%$ drop in accuracy on clean (non-adversarial) images, this defense method supposedly achieves an empirical adversarial accuracy of $6 3 \%$ for non-targeted patch attacks of size $4 2 \times 4 2$ ( $\dot { 2 } \%$ of the image pixels), using 400 randomly picked images from ImageNet (Deng et al., 2009) on VGG19 (Simonyan & Zisserman, 2014).
|
| 46 |
+
|
| 47 |
+
Table 1: Empirical adversarial accuracy of ImageNet classifiers defended with Local Gradient Smoothing and Digital Watermarking. We consider two types of adversaries, one that takes the defense into account during backpropagation and one that does not
|
| 48 |
+
|
| 49 |
+
<table><tr><td colspan="2"></td><td colspan="3">Patch Size</td></tr><tr><td>Attack</td><td>Defense</td><td>42 × 42</td><td>52 × 52</td><td>60 ×60</td></tr><tr><td>IFGSM</td><td>LGS</td><td>78%</td><td>75%</td><td>71%</td></tr><tr><td>IFGSM+LGS</td><td>LGS</td><td>14%</td><td>5%</td><td>3%</td></tr><tr><td>IFGSM</td><td>DW</td><td>56%</td><td>49%</td><td>45%</td></tr><tr><td>IFGSM+DW</td><td>DW</td><td>13%</td><td>8%</td><td>5%</td></tr></table>
|
| 50 |
+
|
| 51 |
+
The second defense, Local Gradient Smoothing (LGS) by Naseer et al. (2019) is based on the empirical observation that pixel values tend to change sharply within these adversarial patches. In other words, the image gradients tend to be large within these adversarial patches. Note that the image gradient here differs from the gradient in Hayes (2018), the former is with respect the changes of adjacent pixel values and the later is with respect to the classification loss. Naseer et al. (2019) propose suppressing this adversarial noise by multiplying each pixel with one minus its image gradient as in (2). To make their methods more effective, Naseer et al. (2019) also pre-process the image gradient with a normalization and a thresholding step.
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
{ \hat { x } } = x \odot ( 1 - \lambda g ( x ) ) .
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
The $\lambda$ here is a smoothing hyper-parameter. Naseer et al. (2019) claim the best adversarial accuracy on ImageNet with respect to patch attacks among all of the defenses we studied. They also claim that their defense is resilient to Backward Pass Differential Approximation (BPDA) from Athalye et al. (2018), one of the most effective methods to attack models that include a non-differentiable operator as a pre-processing step.
|
| 58 |
+
|
| 59 |
+
# 3.2 BREAKING EXISTING DEFENSES
|
| 60 |
+
|
| 61 |
+
Using a similar setup as in (Hayes, 2018; Naseer et al., 2019), we are able to mostly replicate the reported empirical adversarial accuracy for Iterative Fast Gradient Sign Method (IFGSM), a common gradient based attack, but we show that when the pre-processing step is taken into account, the empirical adversarial accuracy on ImageNet quickly drops from $\bar { \sim } 7 0 \% ( \sim 5 0 \% )$ for LGS(DW) to levels around $\sim 1 0 \%$ as shown in Table 1.
|
| 62 |
+
|
| 63 |
+
Specifically, we break DW (Hayes, 2018) by applying BPDA, in which the non-differentiable operator is approximated with an identity mapping during the backward pass. We break LGS (Naseer et al., 2019) by directly incorporating the smoothing step during backpropagation. Even though the windowing and thresholding steps are non-differentiable, the smoothing operator provides enough gradient information for the attack to be effective.
|
| 64 |
+
|
| 65 |
+
To make sure that our evaluation is fair, we used the exact same models as Hayes (2018) (VGG19) and Szegedy et al. (2016) (Inception V3). We also consider a weaker set of attackers that can only attack the corners, the same as their setting. Further, we ensure that we were able to replicate their reported result under similar setting.
|
| 66 |
+
|
| 67 |
+
# 4 CERTIFIED DEFENSES
|
| 68 |
+
|
| 69 |
+
Given the ease with which these supposedly strong defenses are broken, it is natural to seek methods that can rigorously guarantee robustness of a given model to patch attacks. With such certifiable guarantees in hand, we need not worry about an adversary with a stronger optimizer, or a more clever algorithm for choosing patch locations.
|
| 70 |
+
|
| 71 |
+
# 4.1 BACKGROUND ON CERTIFIED DEFENSES
|
| 72 |
+
|
| 73 |
+
Certified defenses have been intensely studied with respect to norm-bounded attacks (Cohen et al., 2019; Wong & Kolter, 2017; Gowal et al., 2018; Mirman et al., 2018; Zhang et al., 2019b). In all of these methods, in addition to the prediction model, there is also a verifier. Given a model and an input, the verifier outputs a certificate if it is guaranteed that the image can not be adversarially perturbed. This is done by checking whether there exists any nearby image (within a prescribed $\ell _ { p }$ distance) with a different label than the image being classified. While theoretical bounds exist on the size of this distance that hold for any classifier (Shafahi et al., 2018), exactly computing bounds for a specific classifier and test image is hard. Alternatively, the verifier may output a lower bound on the distance to the nearest image of a different label. This latter distance is referred to as the certifiable radius. Most of these verifiers provide a rather loose bound on the certifiable radius. However, if the verifier is differentiable, then the network can be trained with a loss that promotes tightness of this bound. We use the term certificate training to refer to the process of training with a loss that promotes strong certificates. Interval bound propagation (IBP) (Mirman et al., 2018; Gowal et al., 2018) is a very simple verifier that uses layer-wise interval arithmetic to produce a certificate. Even though the IBP certificate is generally loose, after certificate training, it yields state-of-the-art certifiably-robust models for $l _ { \infty }$ -norm bounded attacks (Gowal et al., 2018; Zhang et al., 2019b). In this paper, we extend IBP to train certifiably-robust networks resilient to patch attacks. We first introduce some notation and basic algorithms for IBP training.
|
| 74 |
+
|
| 75 |
+
Notation We represent a neural network with a series of transformations $h ^ { ( k ) }$ for each of its $k$ layers. We use $z ^ { ( k ) } \in \bar { \mathbb { R } } ^ { n _ { k } }$ to denote the output of layer $k$ , where $n _ { k }$ is the number of units in the $k ^ { t h }$ layer and $z ^ { ( 0 ) }$ stands for the input. Specifically, the network computes
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
z ^ { ( k ) } = h ^ { ( k - 1 ) } ( z ^ { ( k - 1 ) } ) \forall k = 1 , \dots , K .
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
Certification Problem To produce a certificate for an input $x _ { 0 }$ , we want to verify that the following condition is true with respect to all possible labels $y$ :
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
( e _ { y _ { t r u e } } - e _ { y } ) ^ { T } z ^ { ( K ) } = { \bf m } _ { y } \geq 0 \qquad \forall z ^ { ( 0 ) } \in \mathbb { B } ( x _ { 0 } ) \qquad \forall y .
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
Here, $e _ { i }$ is the $i ^ { t h }$ basis vector, and $\mathbf { m } _ { y }$ is called the margin following Wong & Kolter (2017). Note that $\mathbf { m } _ { y _ { t r u e } }$ is always equal to 0. The vector $\mathbf { m }$ contains all margins corresponding to all labels. $\mathbb { B } ( x _ { 0 } )$ is the constraint set over which the adversarial input image may range. In a conventional setting, this is an $\ell _ { \infty }$ ball around $x _ { 0 }$ . In the case of patch attack, the constraint set contains all images formed by applying a patch to $x _ { 0 }$ ;
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\mathbb { B } ( x _ { 0 } ) = \{ A ( x _ { 0 } , p , l ) | p \in \mathbb { P } { \mathrm { ~ a n d ~ } } l \in \mathbb { L } \} .
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
The Basics of Interval Bound Propagation (IBP) We now describe how to produce certificates using interval bound propagation as in (Gowal et al., 2018). Suppose that for each component in $z ^ { ( k - \bar { 1 } ) }$ we have an interval containing all the values which this component reaches as $z ^ { ( 0 ) }$ ranges over the ball $\mathbb { B } ( x _ { 0 } )$ . If $z ^ { ( k ) } = h ^ { ( k ) } ( z ^ { \top } )$ is a linear (or convolutional) layer of the form ${ z } ^ { ( k ) ^ { - } } =$ $W ^ { ( k ) } z ^ { ( k - 1 ) } + b ^ { ( k ) }$ , then we can get an outer approximation of the reachable interval range of activations by the next layer $z ^ { ( k ) }$ using the formulas below
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\begin{array} { r l } & { \overline { { z } } ^ { ( k ) } = W ^ { ( k ) } \frac { \overline { { z } } ^ { ( k - 1 ) } + \underline { { z } } ^ { ( k - 1 ) } } { 2 } + | W ^ { ( k ) } | \frac { \overline { { z } } ^ { ( k - 1 ) } - \underline { { z } } ^ { ( k - 1 ) } } { 2 } + b ^ { ( k ) } , } \\ & { \underline { { z } } ^ { ( k ) } = W ^ { ( k ) } \frac { \overline { { z } } ^ { ( k - 1 ) } + \underline { { z } } ^ { ( k - 1 ) } } { 2 } - | W ^ { ( k ) } | \frac { \overline { { z } } ^ { ( k - 1 ) } - \underline { { z } } ^ { ( k - 1 ) } } { 2 } + b ^ { ( k ) } . } \end{array}
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
Here $\overline { { z } } ^ { ( k - 1 ) }$ denotes the upper bound of each interval, $\underline { z } ^ { ( k - 1 ) }$ the lower bound, and $| W ^ { ( k ) } |$ the element-wise absolute value. Alternatively, if $h ^ { ( k ) } ( z ^ { ( k - 1 ) } )$ is an element-wise monotonic activation (e.g., a ReLU), then we can calculate the outer approximation of the reachable interval range of the next layer using the formulas below.
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\begin{array} { r } { \overline { z } ^ { ( k ) } = h ^ { ( k ) } ( \overline { z } ^ { ( k - 1 ) } ) } \\ { \underline { z } ^ { ( k ) } = h ^ { ( k ) } ( \underline { z } ^ { ( k - 1 ) } ) . } \end{array}
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
When the feasible set $\mathbb { B } ( x _ { 0 } )$ represents a simple $\ell _ { \infty }$ attack, the range of possible $z ^ { ( 0 ) }$ values is trivially characterized by an interval bound $\overline { { z } } ^ { ( 0 ) }$ and $\underline { z } ^ { ( 0 ) }$ . Then, by iteratively applying the above rules, we can propagate intervals through the network and eventually get $\overline { { z } } ^ { ( K ) }$ and $\smash { \mathcal { Z } ^ { ( K ) } }$ . A certificate can then be given if we can show that (3) is always true for outputs in the range $\overline { { z } } ^ { ( K ) }$ and $\smash { \boldsymbol { \mathcal { Z } } ^ { ( K ) } }$ with respect to all possible labels. More specifically, we can check that the following holds for all $y$
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\begin{array} { r } { \underline { { \mathbf { m } } } _ { y } = e _ { y _ { t r u e } } ^ { T } \underline { { z } } ^ { ( K ) } - e _ { y } ^ { T } \overline { { z } } ^ { ( K ) } = \underline { { z } } _ { y _ { t r u e } } ^ { ( K ) } - \overline { { z } } _ { y } ^ { ( K ) } \geq 0 \quad \forall y . } \end{array}
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
Training for Interval Bound Propagation To train a network to produce accurate interval bounds, we simply replace standard logits with the $- \mathbf { m }$ vector in (3). Note that all elements of $\mathbf { m }$ need to be larger than zero to satisfy the conditions in (3), and mytrue is always equal to zero. Put simply, we would like mytrue to be the least of all margins. We can promote this condition by training with the loss function
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
\mathrm { C e r t i f i c a t e \ L o s s } = \mathrm { C r o s s \ E n t r o p y \ L o s s } ( - \mathbf { m } , y ) .
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
Unlike regular neural network training, stochastic gradient descent for minimizing equation 10 is unstable, and a range of tricks are necessary to stabilize IBP training (Gowal et al., 2018). The first trick is merging the last linear weight matrix with $( e _ { y } - e _ { y _ { t r u e } } )$ before calculating $- { \underline { { \mathbf { m } } } } _ { y }$ . This allows a tighter characterization of the interval bound that noticeably improves results. The second trick uses an “epsilon schedule” in which training begins with a perturbation radius of zero, and this radius is slowly increased over time until a sentinel value is reached. Finally, a mixed loss function containing both a standard natural loss and an IBP loss is used.
|
| 118 |
+
|
| 119 |
+
In all of our experiments, we use the merging technique and the epsilon schedule, but we do not use a mixed loss function containing a natural loss as it does not increase our certificate performance.
|
| 120 |
+
|
| 121 |
+
# 4.2 CERTIFYING AGAINST PATCH ATTACKS
|
| 122 |
+
|
| 123 |
+
We can now describe the extension of IBP to patches. If we specify the patch location, one can represent the feasible set of images with a simple interval bound: for pixels within the patch, the upper and lower bound is equal to 1 and 0. For pixels outside of the patch, the upper and lower bounds are both equal to the original pixel value. By passing this bound through the network, we would be able to get msingle location and verify that they satisfy the conditions in (3).
|
| 124 |
+
|
| 125 |
+
However, we have to consider not just a single location, but all possible locations $\mathbb { L }$ to give a certificate. To adapt the bound to all possible location, we pass each of the possible patches through the network, and take the worst case margin. More specifically,
|
| 126 |
+
|
| 127 |
+
$$
|
| 128 |
+
\mathbf { m } ^ { \mathrm { e s } } ( \mathbb { L } ) _ { y } = \operatorname* { m i n } _ { l \in \mathbb { L } } \mathbf { m } ^ { \mathrm { s i n g l e ~ p a t c h } } ( l ) _ { y } \forall y .
|
| 129 |
+
$$
|
| 130 |
+
|
| 131 |
+
Similar to regular IBP training, we simply use $\underline { { \mathbf { m } } } ^ { \mathrm { e s } } ( \mathbb { L } )$ to calculate the cross entropy loss for training and backpropagation,
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
\operatorname { C e r t i f i c a t e \operatorname { L o s s } } = \operatorname { C r o s s \operatorname { E n t r o p y \operatorname { L o s s } } } ( - \underline { { \mathbf { m } } } ^ { \mathrm { e s } } ( \mathbb { L } ) , y ) .
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
Unfortunately, the cost of producing this na¨ıve certificate increases quadratically with image size. Consider that a CIFAR-10 image is of size $3 2 \times 3 2$ , requiring over a thousand interval bounds, one for each possible patch location. To alleviate this problem, we propose two certificate training methods: Random Patch and Guided Patch, so that the number of forward passes does not scale with the dimension of the inputs.
|
| 138 |
+
|
| 139 |
+
Random Patch Certificate Training In this method, we simply select a random set of patches out of the possible patches and pass them forward. A level of robustness is achieved even though a very small number of random patches are selected compared to the total number of possible patches
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
\underline { { \mathbf { m } } } ^ { \mathrm { r a n d o m \ p a t c h e s } } ( \mathbb { L } ) _ { y } = \underline { { \mathbf { m } } } ^ { \mathrm { e s } } ( S ) _ { y }
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
where $S$ is a random subset of $\mathbb { L }$ . Similarly, the random patch certificate loss is calculated as below.
|
| 146 |
+
|
| 147 |
+
$$
|
| 148 |
+
\mathrm { R a n d o m ~ P a t c h ~ C e r t i f i c a t e ~ L o s s } = \mathrm { C r o s s ~ E n t r o p y ~ L o s s } ( - \underline { { \mathbf { m } } } ^ { \mathrm { r a n d o m ~ p a t c h e s } } ( \mathbb { L } ) , y )
|
| 149 |
+
$$
|
| 150 |
+
|
| 151 |
+
Guided Patch Certificate Training In this method, we propose using a U-net (Ronneberger et al., 2015) to predict msingle patch, and then randomly select a couple of locations based on the predicted $\mathbf { m } ^ { \mathrm { s i n g l e } \mathrm { p a t c h } }$ so that fewer patches need to be passed forward.
|
| 152 |
+
|
| 153 |
+
Note that very few patches contribute to the worst case bound $\underline { { \mathbf { m } } } ^ { \mathrm { e s } }$ in (11). In fact, the number of patches that yield the worst case margins will be no more than the number of labels. If we know the worst-case patches beforehand, then we can simply select the few worst-case patches during training.
|
| 154 |
+
|
| 155 |
+
We propose to use U-net as the number of locations and margins is very large. For a square patch of size $n \times n$ and an image of size $m \times m$ , the total number of possible locations is $( m - n + \mathbf { \hat { 1 } } ) ^ { 2 }$ , and for each location the number of margins is equal to the number of possible labels.
|
| 156 |
+
|
| 157 |
+
$$
|
| 158 |
+
\begin{array} { l } { { \bf { m } } ^ { \mathrm { { p r e d } } } = { \bf { U } } { \mathrm { - n e t } } ( \mathrm { i m a g e } ) } \\ { { \bf { d i m } } ( { \bf { m } } ^ { \mathrm { { p r e d } } } ) = ( m - n + 1 , m - n + 1 , \# \mathrm { o f } \mathrm { l a b e l s } ) . } \end{array}
|
| 159 |
+
$$
|
| 160 |
+
|
| 161 |
+
Given the U-net prediction of $\underline { { \mathbf { m } } } ^ { \mathrm { p r e d } }$ , we then randomly select a single patch for each label based on the softmax of the predicted $\underline { { \mathbf { m } } } ^ { \mathrm { p r e d } }$ . The number of selected patches is equal to the number of labels. After these patches are passed forward, the U-net is then updated with a mean-squared-error loss between the predicted margins $\underline { { \mathbf { m } } } ^ { \mathrm { p r e d } }$ and the actual margins $\underline { { \mathbf { m } } } ^ { \mathrm { a c t u a l } }$ . Note that only a few patches are selected at a time, so that the mean-squared-error only passes through the selected patches.
|
| 162 |
+
|
| 163 |
+
$$
|
| 164 |
+
\mathrm { U } \mathrm { - n e t } \mathrm { L o s s } = \mathbf { M } \mathrm { S E } ( \mathbf { \underline { { m } } } ^ { \mathrm { p r e d } } , \mathbf { \underline { { m } } } ^ { \mathrm { a c t u a l } } ) .
|
| 165 |
+
$$
|
| 166 |
+
|
| 167 |
+
The network is trained with the following loss:
|
| 168 |
+
|
| 169 |
+
Guided Patch Certificate $\operatorname { L o s s } = \operatorname { C r o s s } \operatorname { E n t r o p y } \operatorname { L o s s } ( - \underline { { \mathbf { m } } } ^ { \mathrm { g u i d e d } \mathrm { p a t c h e s } } ( \mathbb { L } ) , y ) .$
|
| 170 |
+
|
| 171 |
+
Certification Process In all our experiments, we check that equation (3) is satisfied by iterating over all possible patches and forward-passing the interval bounds generated for each patch; this overhead is tolerable at evaluation time.
|
| 172 |
+
|
| 173 |
+
# 4.3 CERTIFYING AGAINST SPARSE ATTACKS
|
| 174 |
+
|
| 175 |
+
IBP can also be adapted to defend against sparse attack where the attacker is allowed to modify a fixed number $( k )$ of pixels that may not be adjacent to each other (Modas et al., 2019). The only modification is that we have to change the bound calculated from the first layer to
|
| 176 |
+
|
| 177 |
+
$$
|
| 178 |
+
\overline { { { z } } } _ { i } ^ { ( 1 ) } = W _ { i , : } ^ { ( 1 ) } z ^ { ( 0 ) } + | W _ { i , : } ^ { ( 1 ) } | _ { t o p _ { k } } ~ z _ { i } ^ { ( 1 ) } = W _ { i , : } ^ { ( 1 ) } z ^ { ( 0 ) } - | W _ { i , : } ^ { ( 1 ) } | _ { t o p _ { k } } ~ \forall i
|
| 179 |
+
$$
|
| 180 |
+
|
| 181 |
+
and apply equation (5) and (6) for the subsequent layers. Here, $( . ) _ { t o p _ { k } }$ is the sum of the largest $k$ elements in the vector.
|
| 182 |
+
|
| 183 |
+
# 5 EXPERIMENTS
|
| 184 |
+
|
| 185 |
+
In this section, we compare our certified defenses with exiting algorithms on two datasets and three model architectures of varying complexity. We consider a strong attack setting in which adversarial patches can appear anywhere in the image. Different training strategies for the certified defense are also compared, which shows a trade-off between performance and training efficiency. Furthermore, we evaluate the transferability of a model trained using square patches to other adversarial shapes, including shapes that do not fit in any certified square. The training and architectural details can be found in Appendix A.1. We also present preliminary results on certified defense against sparse attacks.
|
| 186 |
+
|
| 187 |
+
# 5.1 COMPARISON AGAINST EXISTING DEFENSES
|
| 188 |
+
|
| 189 |
+
In this section, we study the effectiveness of our proposed IBP certified models against an adversary that is allowed to place patches anywhere in the image, even on top of the salient object. If the patch is sufficiently small, and does not cover a large portion of the salient object, then the model should still classify correctly, and defense against the perturbation should be possible.
|
| 190 |
+
|
| 191 |
+
In the best case, our IBP certified model is able to achieve $9 1 . 6 \%$ certified (Table 2) with respect to a $2 \times 2$ patch $( \sim . 5 \%$ of image pixels) adversary on MNIST. For more challenging cases, such as a 5 $\times 5$ ( $\sim 2 . 5 \%$ of image pixels) patch adversary on CIFAR-10, the certified adversarial accuracy is only $2 4 . 9 \%$ (Table 2). Even though these existing defenses appear to achieve better or comparable adversarial accuracy as our IBP certified model when faced with a weak adversary, when faced with a stronger adversary their adversarial accuracy dropped to levels below our certified accuracy for all cases that we analyzed.
|
| 192 |
+
|
| 193 |
+
When evaluating existing defenses, we only report cases where non-trivial adversarial accuracy is achieved against a weaker adversary. We do not explore cases where LGS and DW perform so poorly that no meaningful comparison can be done. LGS and DW are highly dependent on hyperparameters to work effectively against naive attacks, and yet neither Naseer et al. (2019) nor Hayes (2018) proposed a way to learn these hyperparameters. By trial and error, we were able to increase the adversarial accuracy against a weaker adversary for some settings, but not all. In addition, we also notice a peculiar feature of DW: when we increase the adversarial accuracy, the clean accuracy degrades, sometimes so much that it is even lower than the empirical adversarial accuracy. This happens because DW always removes a patch from the prediction. When an adversarial patch is detected, it is likely to be removed, enabling correct prediction. On the other hand, when there are no adversarial patches, DW removes actual salient information, resulting in lower clean accuracy.
|
| 194 |
+
|
| 195 |
+
Here we did not compare our results with adversarial training, because even though it produces some of the most adversarially robust models, it does not offer any guarantees on the empirical robust accuracy, and could still be decreased further with stronger attacks. For example, Wang et al. (2019) proposed a stronger attack that could find $47 \%$ more adversarial examples compared to gradient based method. Further, adversarial training on all possible patches would be even more expensive compared to certificate training, and is slightly beyond our computational budget.
|
| 196 |
+
|
| 197 |
+
Compared to state-of-the-art certified models for CIFAR with $L _ { \infty }$ -perturbation, where Zhang et al. (2019a) proposed a deterministic algorithm that achieves clean accuracy of $3 4 . 0 \%$ , our clean accuracy for our most robust CIFAR $5 \times 5$ model is $4 7 . 8 \%$ when using a large model (Table 2).
|
| 198 |
+
|
| 199 |
+
Table 2: Comparison of our IBP certified patch defense against existing defenses. Empirical adversarial accuracy is calculated for 400 random images in both datasets. All results are averaged over three different models.
|
| 200 |
+
|
| 201 |
+
<table><tr><td>Dataset</td><td>Patch Size</td><td>Adversary</td><td>Defense</td><td>Clean Accuracy</td><td>Accuracy</td><td>Empirical Certified Adversarial Accuracy</td></tr><tr><td rowspan="5">MNIST</td><td>2×2</td><td>IFGSM</td><td>None</td><td>98.4%</td><td>80.1%</td><td></td></tr><tr><td>2×2</td><td>IFGSM</td><td>LGS</td><td>97.4%</td><td>90.0%</td><td></td></tr><tr><td>2×2</td><td>IFGSM+LGS</td><td>LGS</td><td>97.4%</td><td>60.7%</td><td></td></tr><tr><td>2×2</td><td>IFGSM</td><td>IBP</td><td>98.5%</td><td>93.9%</td><td>91.6%</td></tr><tr><td>5×5</td><td>IFGSM</td><td>None</td><td>98.5%</td><td>3.3%</td><td></td></tr><tr><td rowspan="10">CIFAR</td><td>5×5</td><td>IFGSM</td><td>IBP</td><td>92.9%</td><td>66.1%</td><td>62.0%</td></tr><tr><td>2×2</td><td>IFGSM</td><td>None</td><td>66.3%</td><td>25.4%</td><td>1</td></tr><tr><td>2×2</td><td>IFGSM</td><td>LGS</td><td>64.9%</td><td>31.3%</td><td></td></tr><tr><td>2×2</td><td>IFGSM+LGS</td><td>LGS</td><td>64.9%</td><td>24.2%</td><td></td></tr><tr><td>2×2</td><td>IFGSM</td><td>DW</td><td>47.1%</td><td>43.3%</td><td></td></tr><tr><td>2×2</td><td>IFGSM+DW</td><td>DW</td><td>47.1%</td><td>20.2%</td><td>=</td></tr><tr><td>2×2</td><td>IFGSM</td><td>IBP</td><td>48.6%</td><td>45.2%</td><td>41.6%</td></tr><tr><td>5×5</td><td>IFGSM</td><td>None</td><td>66.5%</td><td>0.4%</td><td></td></tr><tr><td>5×5</td><td>IFGSM</td><td>LGS</td><td>51.2% 51.2%</td><td>22.11%</td><td></td></tr><tr><td>5×5</td><td>IFGSM +LGS</td><td>LGS DW</td><td>45.3%</td><td>0.5% 59.3%</td><td></td></tr><tr><td>5×5</td><td></td><td>IFGSM</td><td></td><td></td><td></td></tr><tr><td>5×5</td><td>IFGSM+DW</td><td>DW</td><td>45.3%</td><td>15.6%</td><td></td></tr><tr><td>5×5</td><td>IFGSM</td><td>IBP</td><td>33.9%</td><td>29.1%</td><td>24.9%</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 202 |
+
|
| 203 |
+
# 5.2 COMPARISON OF TRAINING STRATEGIES
|
| 204 |
+
|
| 205 |
+
We find that given a fixed architecture all-patch certificate training achieves the best certified accuracy. However, given a fixed computational budget, random and guided training significantly outperform all-patch training. Finally, guided-patch certificate training consistently outperforms random-patch certificate training by a slim margin, indicating that the U-net is learning how to predict the minimum margin m.
|
| 206 |
+
|
| 207 |
+
In Table 3, we see that given a fixed architecture all-patch certificate training significantly outperforms both random-patch certificate training and guided-patch certificate training in terms of certified accuracy, outperforming the second best certified defenses in each task by $2 . 6 \%$ (MNIST, $2 \times 2$ ), $7 . 3 \%$ (MNIST, $5 \times 5$ ), $3 . 9 \%$ (CIFAR-10, $2 \times 2 )$ ), and $3 . 4 \%$ (CIFAR-10, $5 \times 5$ ). However, all-patch certificate training is very expensive, taking on average 4 to 15 times longer than guided-patch certificate training and over 30 to 70 times longer than random-patch certificate training.
|
| 208 |
+
|
| 209 |
+
On the other hand, given a limited computational budget, random-patch and guided-patch training significantly outperforms all-patch training. Due to the efficiency of random-patch and guided-patch training, they scale much better to large architectures. By switching to a large architecture (5 layer wide convolutional network), we are able to boost the certified accuracy by over $10 \%$ compared to the best performing all-patch small model (Table 2). Note that we are unable to all-patch train the same architecture as it will take almost 15 days to complete, and is out of our computational budget.
|
| 210 |
+
|
| 211 |
+
Guided-patch certificate training is slightly more expensive compared to random patch, due to overhead from the U-net architecture. However, given the 10 patches picked, guided-patch certificate training consistently outperforms random-patch certificate training, indicating that the U-net is learning how to predict the minimum margin m.
|
| 212 |
+
|
| 213 |
+
Table 3: Trade-off between certified accuracy and training time for different strategies. The numbers next to training strategies indicate the number of patches used for estimating the lower bound during training. Most training times are measured on a single 2080Ti GPU, with the exception of all-patch training which is run on four 2080Ti GPUs. For that specific case, the training time is multiplied by 4 for fair comparison. See Appendix A.6 for more detailed statistics. \*indicates the performance of the best performing large model trained with either random or guided patch. Detailed performance of the large models can be found in Appendix A.5
|
| 214 |
+
|
| 215 |
+
<table><tr><td colspan="2"></td><td colspan="3">2×2</td><td colspan="3">5×5</td></tr><tr><td>Dataset</td><td>Training Strategy</td><td>Clean Accuracy</td><td>Certified Accuracy</td><td>Training Time(h)</td><td>Clean Accuracy</td><td>Certified Accuracy</td><td>Training Time(h)</td></tr><tr><td rowspan="4">MNIST</td><td>AllPatch</td><td>98.5%</td><td>91.5%</td><td>9.3</td><td>92.0%</td><td>60.4%</td><td>8.4</td></tr><tr><td>Random(1)</td><td>98.5%</td><td>82.9%</td><td>0.2</td><td>96.9%</td><td>24.1%</td><td>0.4</td></tr><tr><td>Random(5)</td><td>98.6%</td><td>86.6%</td><td>0.3</td><td>95.8%</td><td>42.1%</td><td>0.3</td></tr><tr><td>Random(10)</td><td>98.6%</td><td>87.7%</td><td>0.3</td><td>95.6%</td><td>49.6%</td><td>0.3</td></tr><tr><td rowspan="6">CIFAR</td><td>Guided(10) All Patch</td><td>98.6% 50.9%</td><td>88.9% 39.9%</td><td>2.2 56.4</td><td>95.0% 33.5%</td><td>53.1% 22.0%</td><td>2.6 45.8</td></tr><tr><td>Random(1)</td><td>53.6%</td><td>21.6%</td><td>0.6</td><td>43.6%</td><td>6.1%</td><td>0.6</td></tr><tr><td>Random(5)</td><td>52.9%</td><td>32.3%</td><td>0.7</td><td>39.0%</td><td>14.6%</td><td>0.7</td></tr><tr><td>Random(10)</td><td>51.9%</td><td>35.6%</td><td>0.8</td><td>38.8%</td><td>18.6%</td><td></td></tr><tr><td>Guided(10)</td><td>52.4%</td><td>36.0%</td><td>3.7</td><td>37.9%</td><td>18.8%</td><td>0.8 3.7</td></tr><tr><td>Large Model*</td><td>65.8%</td><td>51.9%</td><td>22.4</td><td>47.8%</td><td>30.3%</td><td>15.4</td></tr></table>
|
| 216 |
+
|
| 217 |
+
# 5.3 EFFECTIVENESS AGAINST SPARSE ATTACK
|
| 218 |
+
|
| 219 |
+
The IBP based method can also be used to defend against sparse attack, see Section 4.3. Its performance is reasonable compared to patch defense (e.g. $9 1 . 5 \%$ certified accuracy for $2 \times 2$ patch vs $9 0 . 8 \%$ for $\mathrm { k } { = } 4$ ), even though the sparse attack model is much stronger. For convolutional networks, we increase the size of the first convolutional layer (i.e. from $3 \times 3$ to $1 1 \times 1 1$ ) so the interval bounds calculated are tighter. However, despite the change, fully-connected network still performs much better. For example, the certified accuracy drops from $2 5 . 6 \%$ to $1 3 . 8 \%$ when we switch from fully-connected to convolutional network for CIFAR10 and drops from $9 0 . 8 \%$ to $7 5 . 9 \%$ for MNIST respectively. Detailed results are shown in the Appendix A.4 Table 7.
|
| 220 |
+
|
| 221 |
+
Table 4 compares our approach with the state-of-the-art certified sparse defense (Random Ablation) Levine & Feizi (2019). We use their best model with the largest medium radii to certify against various levels of sparsity. As shown in the table, our method achieves higher certified accuracy on the MNIST dataset over all the sparse radii, but lower on CIFAR-10. It is worth noting that we are using a much smaller and simpler model (a fully-connected network) compared to Random Ablation, which uses ResNet-50.
|
| 222 |
+
|
| 223 |
+
Table 4: Certified accuracy for sparse defenses with IBP and Random Ablation.
|
| 224 |
+
|
| 225 |
+
<table><tr><td>Dataset</td><td>Sparsity (k)</td><td>Model</td><td>Clean Accuracy</td><td>Certified Accuracy</td></tr><tr><td rowspan="6">MNIST</td><td>1</td><td>IBP-sparse</td><td>98.4%</td><td>96.0%</td></tr><tr><td>4</td><td>IBP-sparse</td><td>97.8%</td><td>90.8%</td></tr><tr><td>10</td><td>IBP-sparse</td><td>95.2%</td><td>86.8%</td></tr><tr><td>1</td><td>Random Ablation</td><td>96.7%</td><td>90.3%</td></tr><tr><td>4</td><td>Random Ablation</td><td>96.7%</td><td>79.1%</td></tr><tr><td>10</td><td>Random Ablation</td><td>96.7%</td><td>29.2%</td></tr><tr><td rowspan="6">CIFAR</td><td>1</td><td>IBP-sparse</td><td>48.4%</td><td>40.0%</td></tr><tr><td>4</td><td>IBP-sparse</td><td>42.2%</td><td>31.2%</td></tr><tr><td>10</td><td>IBP-sparse</td><td>37.0%</td><td>25.6%</td></tr><tr><td>1</td><td>Random Ablation</td><td>78.3%</td><td>68.6%</td></tr><tr><td>4</td><td>Random Ablation</td><td>78.3%</td><td>61.3%</td></tr><tr><td>10</td><td>Random Ablation</td><td>78.3%</td><td>45.0%</td></tr></table>
|
| 226 |
+
|
| 227 |
+
# 5.4 TRANSFERABILITY TO PATCHES OF DIFFERENT SHAPES
|
| 228 |
+
|
| 229 |
+
Since real-world adversarial patches may not always be square, the robust transferability of the model to shapes other than the square is important.
|
| 230 |
+
|
| 231 |
+
Therefore, we evaluate the robustness of the square-patch-trained model to adversarial patches of different shapes while fixing the number of pixels. In all these experiments, we evaluate the certified accuracy for our largest model, on both MNIST and CIFAR datasets. We evaluate the transferability to various shapes including rectangle, line, parallelogram, and diamond. With the exception of rectangles, all the shapes have the exact same pixel count as the patches used for training. For rectangles, we use multiple choices of width and length, obtaining some combinations with slightly more pixels, and the worst accuracy is reported in Table 5. The exact shapes used can be found in Appendix A.2.
|
| 232 |
+
|
| 233 |
+
The certified accuracy of our models generalize surprisingly well to other shapes, losing no more than than $5 \%$ in most cases for MNIST and no more than $6 \%$ for CIFAR-10 (Table 5). The largest degradation of accuracy happens for rectangles and lines, and it is mostly because the rectangle considered has more pixels compared to the square, and the line has less overlaps. However, it is still interesting that the certificate even generalizes to a straight line, even though the model was never trained to be robust to lines. In the case of MNIST with small patch size, the certified accuracy even improves when transferred to lines.
|
| 234 |
+
|
| 235 |
+
Table 5: Certified accuracy for square-patch trained model for different shapes
|
| 236 |
+
|
| 237 |
+
<table><tr><td>Dataset</td><td>Pixel Count</td><td>Square</td><td>Rectangle</td><td>Line</td><td>Diamond</td><td>Parallelogram</td></tr><tr><td>MNIST</td><td>4</td><td>91.6%</td><td>=</td><td>92.5%</td><td>91.6%</td><td>92.3%</td></tr><tr><td rowspan="5">CIFAR</td><td>16</td><td>69.4%</td><td>55.4%</td><td>46.7%</td><td>68.13%</td><td>70.2%</td></tr><tr><td>25</td><td>59.7%</td><td>50.9%</td><td>32.4%</td><td>53.6%</td><td>55.2%</td></tr><tr><td>4</td><td>50.8%</td><td>=</td><td>46.1%</td><td>48.6%</td><td>49.8%</td></tr><tr><td>16</td><td>36.9%</td><td>29.0%</td><td>32.1%</td><td>35.7%</td><td>36.3%</td></tr><tr><td>25</td><td>30.3%</td><td>25.1%</td><td>29.0%</td><td>30.1%</td><td>30.7%</td></tr></table>
|
| 238 |
+
|
| 239 |
+
# 6 CONCLUSION AND FUTURE WORK
|
| 240 |
+
|
| 241 |
+
After establishing the weakness of known defenses to patch attacks, we proposed the first certified defense against this model. We demonstrated the effectiveness of our defense on two datasets, and proposed strategies to speed up robust training. Finally, we established the robust transferability of trained certified models to different shapes. In its current form, the proposed certified defense is unlikely to scale to ImageNet, and we hope the presented experiments will encourage further work along this direction.
|
| 242 |
+
|
| 243 |
+
# REFERENCES
|
| 244 |
+
|
| 245 |
+
Anish Athalye, Nicholas Carlini, and David Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. arXiv preprint arXiv:1802.00420, 2018.
|
| 246 |
+
|
| 247 |
+
Tom B Brown, Dandelion Mane, Aurko Roy, Mart ´ ´ın Abadi, and Justin Gilmer. Adversarial patch. arXiv preprint arXiv:1712.09665, 2017.
|
| 248 |
+
|
| 249 |
+
Jeremy M Cohen, Elan Rosenfeld, and J Zico Kolter. Certified adversarial robustness via randomized smoothing. arXiv preprint arXiv:1902.02918, 2019.
|
| 250 |
+
|
| 251 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248–255. Ieee, 2009.
|
| 252 |
+
|
| 253 |
+
Logan Engstrom, Brandon Tran, Dimitris Tsipras, Ludwig Schmidt, and Aleksander Madry. A rotation and a translation suffice: Fooling cnns with simple transformations. arXiv preprint arXiv:1712.02779, 2017.
|
| 254 |
+
|
| 255 |
+
Sven Gowal, Krishnamurthy Dvijotham, Robert Stanforth, Rudy Bunel, Chongli Qin, Jonathan Uesato, Timothy Mann, and Pushmeet Kohli. On the effectiveness of interval bound propagation for training verifiably robust models. arXiv preprint arXiv:1810.12715, 2018.
|
| 256 |
+
|
| 257 |
+
Jamie Hayes. On visible adversarial perturbations & digital watermarking. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pp. 1597–1604, 2018.
|
| 258 |
+
|
| 259 |
+
Danny Karmon, Daniel Zoran, and Yoav Goldberg. Lavan: Localized and visible adversarial noise. arXiv preprint arXiv:1801.02608, 2018.
|
| 260 |
+
|
| 261 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 262 |
+
|
| 263 |
+
Cassidy Laidlaw and Soheil Feizi. Functional adversarial attacks, 2019.
|
| 264 |
+
|
| 265 |
+
Mark Lee and Zico Kolter. On physical adversarial patches for object detection, 2019.
|
| 266 |
+
|
| 267 |
+
Alexander Levine and Soheil Feizi. Robustness certificates for sparse adversarial attacks by randomized ablation. arXiv preprint arXiv:1911.09272, 2019.
|
| 268 |
+
|
| 269 |
+
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.
|
| 270 |
+
|
| 271 |
+
Matthew Mirman, Timon Gehr, and Martin Vechev. Differentiable abstract interpretation for provably robust neural networks. In International Conference on Machine Learning, pp. 3575–3583, 2018.
|
| 272 |
+
|
| 273 |
+
Apostolos Modas, Seyed-Mohsen Moosavi-Dezfooli, and Pascal Frossard. Sparsefool: a few pixels make a big difference. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 9087–9096, 2019.
|
| 274 |
+
|
| 275 |
+
Muzammal Naseer, Salman Khan, and Fatih Porikli. Local gradients smoothing: Defense against localized adversarial attacks. In 2019 IEEE Winter Conference on Applications of Computer Vision (WACV), pp. 1300–1307. IEEE, 2019.
|
| 276 |
+
|
| 277 |
+
Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computerassisted intervention, pp. 234–241. Springer, 2015.
|
| 278 |
+
|
| 279 |
+
Ali Shafahi, W Ronny Huang, Christoph Studer, Soheil Feizi, and Tom Goldstein. Are adversarial examples inevitable? arXiv preprint arXiv:1809.02104, 2018.
|
| 280 |
+
|
| 281 |
+
Ali Shafahi, Mahyar Najibi, Amin Ghiasi, Zheng Xu, John Dickerson, Christoph Studer, Larry S Davis, Gavin Taylor, and Tom Goldstein. Adversarial training for free! arXiv preprint arXiv:1904.12843, 2019.
|
| 282 |
+
|
| 283 |
+
Mahmood Sharif, Sruti Bhagavatula, Lujo Bauer, and Michael K Reiter. Adversarial generative nets: Neural network attacks on state-of-the-art face recognition. arXiv preprint arXiv:1801.00349, 2017.
|
| 284 |
+
|
| 285 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 286 |
+
|
| 287 |
+
Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2818–2826, 2016.
|
| 288 |
+
|
| 289 |
+
Florian Tramer and Dan Boneh. Adversarial training and robustness for multiple perturbations. \` arXiv preprint arXiv:1904.13000, 2019.
|
| 290 |
+
|
| 291 |
+
Shiqi Wang, Yizheng Chen, Ahmed Abdou, and Suman Jana. Enhancing gradient-based attacks with symbolic intervals, 2019.
|
| 292 |
+
|
| 293 |
+
Eric Wong and J Zico Kolter. Provable defenses against adversarial examples via the convex outer adversarial polytope. arXiv preprint arXiv:1711.00851, 2017.
|
| 294 |
+
|
| 295 |
+
Eric Wong, Frank R Schmidt, and J Zico Kolter. Wasserstein adversarial examples via projected sinkhorn iterations. arXiv preprint arXiv:1902.07906, 2019.
|
| 296 |
+
|
| 297 |
+
Zuxuan Wu, Ser-Nam Lim, Larry Davis, and Tom Goldstein. Making an invisibility cloak: Real world adversarial attacks on object detectors. arXiv preprint arXiv:1910.14667, 2019.
|
| 298 |
+
|
| 299 |
+
Huan Zhang, Hongge Chen, Chaowei Xiao, Bo Li, Duane Boning, and Cho-Jui Hsieh. Towards stable and efficient training of verifiably robust neural networks, 2019a.
|
| 300 |
+
|
| 301 |
+
Huan Zhang, Hongge Chen, Chaowei Xiao, Bo Li, Duane Boning, and Cho-Jui Hsieh. Towards stable and efficient training of verifiably robust neural networks. arXiv preprint arXiv:1906.06316, 2019b.
|
| 302 |
+
|
| 303 |
+
# A APPENDIX
|
| 304 |
+
|
| 305 |
+
# A.1 EXPERIMENTAL SETTINGS AND NETWORK STRUCTURE
|
| 306 |
+
|
| 307 |
+
We evaluate the proposed certified patch defense on three neural networks: a multilayer perceptron (MLP) with one 255-neuron hidden layer, and two convolutional neural networks (CNN) with different depths. The small CNN has two convolutional layers (kernel size 4, stride 2) of 4 and 8 output channels each, and a fully connected layer with 256 neurons. The large CNN has four convolutional layers with kernel size (3, 4, 3, 4), stride (1, 2, 1, 2), output channels (4, 4, 8 ,8), and two fully connected layer with 256 neurons. We run experiments on two datasets, MNIST and CIFAR10, with two different patch sizes $2 \times 2$ and $5 \times 5$ . For all experiments, we are using Adam (Kingma & Ba, 2014) with a learning rate of $5 e - 4$ for MNIST and $1 e - 3$ for CIFAR10, and with no weight decay. We also adopt a warm-up schedule in all experiments like (Zhang et al., 2019b), where the input interval bounds start at zero and grow to [-1,1] after 61/121 epochs for MNIST/CIFAR10 respectively. We train the models for a total of 100/200 epochs for MNIST/CIFAR10, where in the first 61/121 epochs the learning rate is fixed and in the following epochs, we reduce the learning rate by one half every 10 epochs.
|
| 308 |
+
|
| 309 |
+
In addition, following (Gowal et al., 2018), we further evaluate the CIFAR10 on a larger model which has 5 convolutional layers with kernel size 3 and a fully connected layer with 512 neurons. This deeper and wider model achieves the clean accuracy around $8 9 \%$ , and has 17M parameters in total. Table 8 in Appendix A.5 describes the full certified patch results for this large model.
|
| 310 |
+
|
| 311 |
+
# A.2 SAMPLE SHAPES FOR GENERALIZATION EXPERIMENTS
|
| 312 |
+
|
| 313 |
+
We demonstrate generalization to other patch shapes that were not considered in training, obtaining surprisingly good transfer in robust accuracy; see the figure below and the results in Table 5.
|
| 314 |
+
|
| 315 |
+

|
| 316 |
+
Figure 1: Examples of shapes with pixels number 4 and 25. From left to right are square, parallelogram, diamond and rectangle (line) respectively.
|
| 317 |
+
|
| 318 |
+
# A.3 BOUND POOLING
|
| 319 |
+
|
| 320 |
+
Besides random-patch certificate training and guided-patch certificate training, we also experimented with the idea of bound pooling. All-patch training is very expensive as bounds generated by each potential patch has to be forward passed through the complete network. Bound pooling partially relieves the problem be pooling the interval bounds in intermediate layers thus reducing the forward pass in subsequent layers.
|
| 321 |
+
|
| 322 |
+
Specifically, given a set of patches $\mathbb { P }$ , the interval bounds in the ith layer are $\bar { Z } ^ { ( i ) } ( \mathbb { P } ) = \{ \bar { z } ^ { ( i ) } ( p ) : p \in$ $\mathbb { P } \}$ and $\underline { { Z } } ^ { ( i ) } \mathbb { P } = \{ \underline { { z } } ^ { ( i ) } ( p ) : p \in \mathbb { P } \}$ . We can reduce the number of interval bounds by partitioning $\mathbb { P }$ into $n$ subsets $\{ \mathbb { S } ^ { 1 } , . . . , \mathbb { S } ^ { n } \}$ and calculate a new set of bounds $\begin{array} { r } { \bar { Z } _ { p o o l } ^ { ( i ) } ( \mathbb { P } ) = \{ \operatorname* { m a x } _ { p \in \mathbb { S } _ { i } } \bar { z } ^ { ( i ) } ( p ) : i \in [ n ] \} } \end{array}$ and Z(i) ( $\begin{array} { r } { \underline { { Z } } _ { p o o l } ^ { ( i ) } ( \mathbb { P } ) = \{ \operatorname* { m i n } _ { p \in \mathbb { S } _ { i } } \underline { { z } } ^ { ( i ) } ( p ) : i \in [ n ] \} } \end{array}$ . Depending on how $\mathbb { P }$ is partitioned, the bound pooling would work differently. In our experiments, we always select adjacent patches for each $\mathbb { S } _ { i }$ with the assumption that adjacent patches tend to generate similar bounds thus resulting in tighter certificate.
|
| 323 |
+
|
| 324 |
+
Bound pooling, similar to random- and guided- patch training, trades performance for efficiency compared to all-patch certificate training. However, the trade off is not as favorable compared to random-patch and guided-patch training. For example, in Table 6, Pooling 16 $( 4 \times 4 )$ patches in the first layer reduces training time by $3 5 \%$ while loosing $0 . 7 \%$ in performance (on MNIST $2 \times 2$ ), but a similar level of performance can be achieved with guided-patch training with almost $90 \%$ reduction in training time. The trade off becomes greater when the model becomes larger. Overall, bound pooling is still quite expensive, and cannot scale to larger models like random-patch or guided-patch training.
|
| 325 |
+
|
| 326 |
+
Table 6: Comparing bound pooling with the guided-patch and random-patch training. Pool 4 means that the adjacent $4 \times 4$ patches (16 patches) are pooled together in the first layer. Pool 2-2 means that the adjacent $2 \times 2$ bounds are pooled together in the first layer and then another $2 \times 2$ bound pooling happens at the second layer. This is similar to $4 \times 4$ pooling except the pooling operation is distributed between the first and second layer. All experiments are performed on a 4-layer convolutional network.
|
| 327 |
+
|
| 328 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>2×2</td><td rowspan=1 colspan=1>5×5</td></tr><tr><td rowspan=2 colspan=1>Dataset TrainingStrategy</td><td rowspan=1 colspan=1>Clean Certified Training</td><td rowspan=1 colspan=1>Clean Certified Training</td></tr><tr><td rowspan=1 colspan=1>Accuracy Accuracy Time(h)</td><td rowspan=1 colspan=1>Accuracy Accuracy Time(h)</td></tr><tr><td rowspan=1 colspan=1>MNIST All Patch</td><td rowspan=1 colspan=1>98.5% 91.6% 20.1</td><td rowspan=1 colspan=1>90.0% 59.7% 16.3</td></tr><tr><td rowspan=6 colspan=1>Pool 2Pool 4Random(1)Random(5)Random(10)Guided(10)</td><td rowspan=1 colspan=1>98.0% 91.1% 15.8</td><td rowspan=1 colspan=1>85.2% 54.2% 11.6</td></tr><tr><td rowspan=1 colspan=1>97.2% 89.9% 13.2</td><td rowspan=1 colspan=1>70.4% 38.3% 10.2</td></tr><tr><td rowspan=1 colspan=1>98.5% 81.9% 0.3</td><td rowspan=1 colspan=1>96.8% 24.8% 0.4</td></tr><tr><td rowspan=1 colspan=1>98.6% 86.5% 0.3</td><td rowspan=1 colspan=1>94.9% 42.0% 0.5</td></tr><tr><td rowspan=1 colspan=1>98.6% 87.5% 0.5</td><td rowspan=1 colspan=1>94.7% 50.4% 0.6</td></tr><tr><td rowspan=1 colspan=1>98.7% 88.9% 2.2</td><td rowspan=1 colspan=1>94.0% 53.2% 3.4</td></tr><tr><td rowspan=1 colspan=1>CIFAR All Patch</td><td rowspan=1 colspan=1>49.6% 41.6% 22.5</td><td rowspan=1 colspan=1>34.0% 25.0% 18.6</td></tr><tr><td rowspan=2 colspan=1>Pool 2Pool4</td><td rowspan=1 colspan=1>48.1% 39.4% 17.3</td><td rowspan=1 colspan=1>32.4% 24.2% 14.5</td></tr><tr><td rowspan=2 colspan=1>Pool4Pool 2-2</td><td rowspan=1 colspan=1>44.9% 37.1% 16.3</td><td rowspan=1 colspan=1>28.3% 20.6% 13.6</td></tr><tr><td rowspan=1 colspan=1>45.0% 37.4% 16.5</td><td rowspan=1 colspan=1>25.3% 19.1% 13.8</td></tr><tr><td rowspan=1 colspan=1>Random(1)</td><td rowspan=1 colspan=1>53.2% 32.4% 0.6</td><td rowspan=1 colspan=1>42.7% 11.0% 0.6</td></tr><tr><td rowspan=2 colspan=1>Random(5)Random(10)</td><td rowspan=1 colspan=1>52.2% 39.5% 0.9</td><td rowspan=1 colspan=1>37.8% 19.6% 0.9</td></tr><tr><td rowspan=1 colspan=1>50.8% 38.6% 1.0</td><td rowspan=1 colspan=1>38.4% 21.9% 1.0</td></tr><tr><td rowspan=1 colspan=1>Guided(10)</td><td rowspan=1 colspan=1>53.0% 39.8% 4.0</td><td rowspan=1 colspan=1>36.1% 23.0% 3.9</td></tr></table>
|
| 329 |
+
|
| 330 |
+
# A.4 MULTI-PATCH SPARSE TRAINING
|
| 331 |
+
|
| 332 |
+
Here we list the detailed certified accuracy for various sparsity levels and model architectures.
|
| 333 |
+
|
| 334 |
+
Table 7: Certified accuracy for sparse defenses with varying sparsity $k$ and models on both MNIST and CIFAR10, where “Conv $c \times c ^ { \prime \prime }$ represents for the convolutional network with first layer kernel size c.
|
| 335 |
+
|
| 336 |
+
<table><tr><td>Dataset</td><td>Sparsity (k)</td><td>Model</td><td>Clean Accuracy</td><td>Certified Accuracy</td></tr><tr><td rowspan="4">MNIST</td><td>1</td><td>mlp</td><td>98.4%</td><td>96.0%</td></tr><tr><td>4</td><td>mlp</td><td>97.8%</td><td>90.8%</td></tr><tr><td>10</td><td>mlp</td><td>95.2%</td><td>86.8%</td></tr><tr><td>1</td><td>Conv3x3</td><td>97.0%</td><td>88.3%</td></tr><tr><td rowspan="8">CIFAR</td><td>4</td><td>Conv3x3</td><td>92.7%</td><td>75.9%</td></tr><tr><td>1</td><td>mlp</td><td>48.4%</td><td>40.0%</td></tr><tr><td>4</td><td>mlp</td><td>42.2%</td><td>31.2%</td></tr><tr><td>10</td><td>mlp</td><td>37.0%</td><td>25.6%</td></tr><tr><td>1</td><td>Conv11x11</td><td>34.8%</td><td>27.4%</td></tr><tr><td>4</td><td>Conv11x11</td><td>25.1%</td><td>18.3%</td></tr><tr><td>10</td><td>Conv11x11</td><td>17.2%</td><td>13.8%</td></tr><tr><td>1</td><td>Conv13x13</td><td>38.6%</td><td>29.7%</td></tr><tr><td></td><td>4</td><td>Conv13x13</td><td>28.1%</td><td>19.6%</td></tr><tr><td></td><td>10</td><td>Conv13x13</td><td>22.4%</td><td>15.3%</td></tr></table>
|
| 337 |
+
|
| 338 |
+
# A.5 TRAINING WITH LARGER MODELS
|
| 339 |
+
|
| 340 |
+
Recall that all-patch training considers all possible patches during training, which can be too expensive for larger models and/or images. The proposed random- and guided-patch training methods aim to reduce the training cost by considering only a subset of patches; please see Section 4.2 for more details.
|
| 341 |
+
|
| 342 |
+
Table 8: The random and guided training strategy could yield significantly stronger model compared to all-patch training given a fixed computational budget. The random and guided training strategy allows us to train a larger model that would be infeasible to train otherwise. The guided-patch large model is able to boost the certified accuracy by over $10 \%$ compared to the best performing all-patch small model.
|
| 343 |
+
|
| 344 |
+
<table><tr><td>Dataset</td><td>Patch Size</td><td>Training Strategy</td><td>Model</td><td>Clean Accuracy</td><td>Certified Accuracy</td><td>Training Time(h)</td></tr><tr><td rowspan="5">CIFAR</td><td rowspan="5">2×2</td><td>All Patch</td><td>mlp</td><td>50.8%</td><td>35.5%</td><td>9.1</td></tr><tr><td></td><td>2 layer conv</td><td>52.4%</td><td>42.6%</td><td>10.7</td></tr><tr><td></td><td> 4 layer conv</td><td>49.6%</td><td>41.6%</td><td>22.5</td></tr><tr><td></td><td>5 layer conv (wide)</td><td>1</td><td>-</td><td>~360.0</td></tr><tr><td>Random(10) Random(20)</td><td>5 layer conv (wide) 5 layer conv (wide)</td><td>64.7% 64.4%</td><td>49.0%</td><td>9.5</td></tr><tr><td rowspan="6">CIFAR 5×5</td><td>Guided(10)</td><td>5 layer conv (wide)</td><td>66.5%</td><td>50.8% 49.2%</td><td></td><td>15.8 12.2</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Guided(20) All Patch</td><td>5 layer conv (wide)</td><td>65.8%</td><td>51.9%</td><td></td><td>22.4</td></tr><tr><td></td><td>mlp</td><td></td><td>31.1%</td><td>18.8%</td><td>7.1</td></tr><tr><td></td><td>2 layer conv</td><td>35.5%</td><td></td><td>22.3%</td><td>8.7</td></tr><tr><td></td><td></td><td>4 layer conv.</td><td>34.0%</td><td>25.0%</td><td></td><td>18.6</td></tr><tr><td></td><td></td><td></td><td>5 layer conv (wide)</td><td>1</td><td>、</td><td>~360.0</td></tr><tr><td></td><td></td><td>Random(10) Random(20)</td><td>5 layer conv (wide)</td><td>48.6%</td><td>29.9%</td><td>9.4</td></tr><tr><td></td><td></td><td></td><td>5 layer conv (wide)</td><td>47.8%</td><td>30.3%</td><td>15.4</td></tr><tr><td></td><td>Guided(10)</td><td>5 layer conv (wide)</td><td></td><td>48.4%</td><td>29.0%</td><td>12.4</td></tr><tr><td></td><td></td><td>Guided(20)</td><td>5 layer conv (wide)</td><td>47.6%</td><td>29.6%</td><td>23.8</td></tr></table>
|
| 345 |
+
|
| 346 |
+
# A.6 DETAILED STATISTICS ON TRAINING STRATEGIES
|
| 347 |
+
|
| 348 |
+
Here we list the detailed statistics for each training strategies for Table 3
|
| 349 |
+
|
| 350 |
+
Table 9: Detailed statistics for the comparison of training strategies - $2 \times 2$
|
| 351 |
+
|
| 352 |
+
<table><tr><td>Dataset</td><td>Training Strategies</td><td>Model Architecture</td><td>Clean Accuracy</td><td>Certified Accuracy</td><td>Training Time</td></tr><tr><td>MNIST</td><td>All Patch</td><td>2 layer convolution</td><td>98.63/%</td><td>91.38%</td><td>21.0</td></tr><tr><td rowspan="10"></td><td rowspan="4">Random (1)</td><td>4 layer convolution</td><td>98.48%</td><td>91.63%</td><td>80.3</td></tr><tr><td>fully connected (255,10)</td><td>98.46%</td><td>91.47%</td><td>9.8</td></tr><tr><td>2 layer convolution</td><td>98.69%</td><td>82.57%</td><td>0.2</td></tr><tr><td>4 layer convolution</td><td>98.45%</td><td>81.87%</td><td>0.3</td></tr><tr><td rowspan="3">Random (5)</td><td>fully connected (255,10)</td><td>98.48%</td><td>84.32%</td><td>0.2</td></tr><tr><td>2 layer convolution</td><td>98.75%</td><td>85.87%</td><td>0.3</td></tr><tr><td>4 layer convolution</td><td>98.57%</td><td>86.50%</td><td>0.3</td></tr><tr><td rowspan="3">Random (10)</td><td>fully connected (255,10)</td><td>98.62%</td><td>87.32%</td><td>0.2</td></tr><tr><td>2 layer convolution</td><td>98.73%</td><td>87.31%</td><td>0.3</td></tr><tr><td>4 layer convolution</td><td>98.63%</td><td>87.54%</td><td>0.5</td></tr><tr><td rowspan="3">Guided (10)</td><td>fully connected (255,10)</td><td>98.49%</td><td>88.13%</td><td>0.2</td></tr><tr><td>2 layer convolution</td><td>98.60%</td><td>88.49%</td><td>2.3</td></tr><tr><td>4 layer convolution</td><td>98.70%</td><td>88.85%</td><td>2.2</td></tr><tr><td rowspan="3">CIFAR All Patch</td><td>fully connected (255,10)</td><td>98.63%</td><td>89.44%</td><td>2.2</td></tr><tr><td>2 layer convolution</td><td>52.42%</td><td>42.57%</td><td>42.6</td></tr><tr><td>4 layer convolution</td><td>49.58%</td><td>41.57%</td><td>89.8</td></tr><tr><td rowspan="3">Random (1)</td><td>fully connected (255,10)</td><td>50.83%</td><td>35.49%</td><td>36.6</td></tr><tr><td>2 layer convolution</td><td>54.93%</td><td>29.13%</td><td>0.6</td></tr><tr><td>4 layer convolution</td><td>53.22%</td><td>32.35%</td><td>0.6</td></tr><tr><td rowspan="3">Random (5)</td><td>fully connected (255,10)</td><td>52.76%</td><td>03.21%</td><td>0.5</td></tr><tr><td>2 layer convolution</td><td>54.15%</td><td>37.30%</td><td>0.6</td></tr><tr><td>4 layer convolution</td><td>52.19%</td><td>39.45%</td><td>0.9</td></tr><tr><td rowspan="3">Random (10)</td><td>fully connected (255,10)</td><td>52.38%</td><td>20.17%</td><td>0.6</td></tr><tr><td>2 layer convolution</td><td>53.08%</td><td>39.32%</td><td>0.7</td></tr><tr><td>4 layer convolution</td><td>50.80%</td><td>38.57%</td><td>1.0</td></tr><tr><td rowspan="4">Guided (10)</td><td>fully connected (255,10)</td><td>51.90%</td><td>28.97%</td><td>0.6</td></tr><tr><td>2 layer convolution</td><td>53.04%</td><td>38.81%</td><td>3.7</td></tr><tr><td>4 layer convolution</td><td>52.97%</td><td>39.84%</td><td>4.0</td></tr><tr><td>fully connected (255,10)</td><td>51.32%</td><td>29.44%</td><td>3.6</td></tr></table>
|
| 353 |
+
|
| 354 |
+
Table 10: Detailed statistics for the comparison of training strategies - $5 \times 5$
|
| 355 |
+
|
| 356 |
+
<table><tr><td>Dataset</td><td>Training Strategies</td><td>Model Architecture</td><td>Clean Accuracy</td><td>Certified Accuracy</td><td>Training Time</td></tr><tr><td>MNIST</td><td>All Patch</td><td>2 layer convolution</td><td>91.88%</td><td>59.59%</td><td>28.4</td></tr><tr><td rowspan="10"></td><td></td><td>4 layer convolution</td><td>90.03%</td><td>59.72%</td><td>65.2</td></tr><tr><td>Random (1)</td><td>fully connected (255,10)</td><td>93.96%</td><td>61.97%</td><td>7.2</td></tr><tr><td></td><td>2 layer convolution</td><td>96.27%</td><td>18.57%</td><td>0.2</td></tr><tr><td></td><td>4 layer convolution</td><td>96.83%</td><td>24.79%</td><td>0.4</td></tr><tr><td>Random (5)</td><td>fully connected (255,10)</td><td>97.60%</td><td>29.04%</td><td>0.2</td></tr><tr><td></td><td>2 layer convolution</td><td>95.82%</td><td>38.47%</td><td>0.2</td></tr><tr><td></td><td>4 layer convolution</td><td>94.85%</td><td>42.02%</td><td>0.5</td></tr><tr><td>Random (10)</td><td>fully connected (255,10)</td><td>96.73%</td><td>45.89%</td><td>0.2</td></tr><tr><td></td><td>2 layer convolution</td><td>95.55%</td><td>46.13%</td><td>0.3</td></tr><tr><td></td><td>4 layer convolution fully connected (255,10)</td><td>94.76% 96.40%</td><td>50.43% 52.30%</td><td>0.6</td></tr><tr><td>Guided (10)</td><td>2 layer convolution</td><td>95.28%</td><td>50.28%</td><td>0.2 2.3</td></tr><tr><td rowspan="3"></td><td></td><td>93.98%</td><td>53.17%</td><td>3.4</td></tr><tr><td>4 layer convolution</td><td>95.82%</td><td>55.89%</td><td>2.2</td></tr><tr><td>fully connected (255,10)</td><td>35.48%</td><td></td><td></td></tr><tr><td rowspan="3">CIFAR All Patch Random (1)</td><td>2 layer convolution</td><td>33.95%</td><td>22.31% 24.96%</td><td>34.8</td></tr><tr><td>4 layer convolution fully connected (255,10)</td><td>31.05%</td><td>18.78%</td><td>74.4 28.4</td></tr><tr><td></td><td>45.71%</td><td>07.14%</td><td>0.6</td></tr><tr><td rowspan="3"></td><td>2 layer convolution</td><td>42.65%</td><td>10.99%</td><td></td></tr><tr><td>4 layer convolution</td><td>42.34%</td><td></td><td>0.6</td></tr><tr><td>fully connected (255,10)</td><td></td><td>00.10%</td><td>0.5</td></tr><tr><td rowspan="3">Random (5)</td><td>2 layer convolution</td><td>42.85%</td><td>17.29%</td><td>0.6</td></tr><tr><td>4 layer convolution</td><td>37.80%</td><td>19.63%</td><td>0.9</td></tr><tr><td>fully connected (255,10)</td><td>36.23%</td><td>06.99%</td><td>0.6</td></tr><tr><td rowspan="4">Random (10)</td><td>2 layer convolution</td><td>41.90%</td><td>21.40%</td><td>0.7</td></tr><tr><td>4 layer convolution</td><td>38.41%</td><td>21.90%</td><td>1.0</td></tr><tr><td>fully connected (255,10) Guided (10)</td><td>36.04%</td><td>12.46%</td><td>0.6</td></tr><tr><td>2 layer convolution</td><td>42.08%</td><td>20.77%</td><td>3.6</td></tr><tr><td></td><td>4 layer convolution fully connected (255,10)</td><td>36.08% 35.51%</td><td>23.01% 12.56%</td><td>3.9 3.5</td></tr></table>
|
md/train/LLoe0U9ShkN/LLoe0U9ShkN.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/N51zJ7F3mw/N51zJ7F3mw.md
ADDED
|
@@ -0,0 +1,292 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Dissecting the Diffusion Process in Linear Graph Convolutional Networks
|
| 2 |
+
|
| 3 |
+
Yifei Wang1 Yisen Wang2,3∗ Jiansheng Yang1 Zhouchen Lin2,3,4 1 School of Mathematical Sciences, Peking University, Beijing, China 2 Key Lab. of Machine Perception, School of Artificial Intelligence, Peking University, Beijing, China 3 Institute for Artificial Intelligence, Peking University, Beijing, China 4 Pazhou Lab, Guangzhou, China yifei_wang@pku.edu.cn, yisen.wang@pku.edu.cn yjs@math.pku.edu.cn, zlin@pku.edu.cn
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Graph Convolutional Networks (GCNs) have attracted more and more attentions in recent years. A typical GCN layer consists of a linear feature propagation step and a nonlinear transformation step. Recent works show that a linear GCN can achieve comparable performance to the original non-linear GCN while being much more computationally efficient. In this paper, we dissect the feature propagation steps of linear GCNs from a perspective of continuous graph diffusion, and analyze why linear GCNs fail to benefit from more propagation steps. Following that, we propose Decoupled Graph Convolution (DGC) that decouples the terminal time and the feature propagation steps, making it more flexible and capable of exploiting a very large number of feature propagation steps. Experiments demonstrate that our proposed DGC improves linear GCNs by a large margin and makes them competitive with many modern variants of non-linear GCNs. Code is available at https://github.com/yifeiwang77/DGC.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Recently, Graph Convolutional Networks (GCNs) have successfully extended the powerful representation learning ability of modern Convolutional Neural Networks (CNNs) to the graph data [7]. A graph convolutional layer typically consists of two stages: linear feature propagation and nonlinear feature transformation. Simple Graph Convolution (SGC) [21] simplifies GCNs by removing the nonlinearities between GCN layers and collapsing the resulting function into a single linear transformation, which is followed by a single linear classification layer and then becomes a linear GCN. SGC can achieve comparable performance to canonical GCNs while being much more computationally efficient and using significantly fewer parameters. Thus, we mainly focus on linear GCNs in this paper.
|
| 12 |
+
|
| 13 |
+
Although being comparable to canonical GCNs, SGC still suffers from a similar issue as non-linear GCNs, that is, more (linear) feature propagation steps $K$ will degrade the performance catastrophically. This issue is widely characterized as the “over-smoothing” phenomenon. Namely, node features become smoothed out and indistinguishable after too many feature propagation steps [10].
|
| 14 |
+
|
| 15 |
+
In this work, through a dissection of the diffusion process of linear GCNs, we characterize a fundamental limitation of SGC. Specifically, we point out that its feature propagation step amounts to a very coarse finite difference with a fixed step size $\Delta t = 1$ , which results in a large numerical error.
|
| 16 |
+
|
| 17 |
+
And because the step size is fixed, more feature propagation steps will inevitably lead to a large terminal time $T = K \cdot \Delta t \to \infty$ that over-smooths the node features.
|
| 18 |
+
|
| 19 |
+
To address these issues, we propose Decoupled Graph Convolution (DGC) by decoupling the terminal time $T$ and propagation steps $K$ . In particular, we can flexibly choose a continuous terminal time $T$ for the optimal tradeoff between under-smoothing and over-smoothing, and then fix the terminal time while adopting more propagation steps $K$ . In this way, different from SGC that over-smooths with more propagation steps, our proposed DGC can obtain a more fine-grained finite difference approximation with more propagation steps, which contributes to the final performance both theoretically and empirically. Extensive experiments show that DGC (as a linear GCN) improves over SGC significantly and obtains state-of-the-art results that are comparable to many modern non-linear GCNs. Our main contributions are summarized as follows:
|
| 20 |
+
|
| 21 |
+
• We investigate SGC by dissecting its diffusion process from a continuous perspective, and characterize why it cannot benefit from more propagation steps. • We propose Decoupled Graph Convolution (DGC) that decouples the terminal time $T$ and the propagation steps $K$ , which enables us to choose a continuous terminal time flexibly while benefiting from more propagation steps from both theoretical and empirical aspects. • Experiments show that DGC outperforms canonical GCNs significantly and obtains stateof-the-art (SOTA) results among linear GCNs, which is even comparable to many competitive non-linear GCNs. We think DGC can serve as a strong baseline for the future research.
|
| 22 |
+
|
| 23 |
+
# 2 Related Work
|
| 24 |
+
|
| 25 |
+
Graph convolutional networks (GCNs). To deal with non-Euclidean graph data, GCNs are proposed for direct convolution operation over graph, and have drawn interests from various domains. GCN is firstly introduced for a spectral perspective [26, 7], but soon it becomes popular as a general message passing algorithm in the spatial domain. Many variants have been proposed to improve its performance, such as GraphSAGE [5] with LSTM and GAT with attention mechanism [19].
|
| 26 |
+
|
| 27 |
+
Over-smoothing issue. GCNs face a fundamental problem compared to standard CNNs, i.e., the over-smoothing problem. Li et al. [10] offer a theoretical characterization of over-smoothing based on linear feature propagation. After that, many researchers have tried to incorporate effective mechanisms in CNNs to alleviate over-smoothing. DeepGCNs [9] shows that residual connection and dilated convolution can make GCNs go as deep as CNNs, although increased depth does not contribute much. Methods like APPNP [8] and JKNet [25] avoid over-smoothing by aggregating multiscale information from the first hidden layer. DropEdge [16] applies dropout to graph edges and find it enables training GCNs with more layers. PairNorm [27] regularizes the feature distance to be close to the input distance, which will not fail catastrophically but still decrease with more layers.
|
| 28 |
+
|
| 29 |
+
Continuous GCNs. Deep CNNs have been widely interpreted from a continuous perspective, e.g., ResNet [6] as the Euler discretization of Neural ODEs [11, 3]. This viewpoint has recently been borrowed to understand and improve GCNs. GCDE [15] directly extends GCNs to a Neural ODE, while CGNN [22] devises a GCN variant inspired by a new continuous diffusion. Our method is also inspired by the connection between discrete and continuous graph diffusion, but alternatively, we focus on their numerical gap and characterize how it affects the final performance.
|
| 30 |
+
|
| 31 |
+
Linear GCNs. SGC [21] simplifies and separates the two stages of GCNs: feature propagation and (non-linear) feature transformation. It finds that utilizing only a simple logistic regression after feature propagation (removing the non-linearities), which makes it a linear GCN, can obtain comparable performance to canonical GCNs. In this paper, we further show that a properly designed linear GCN (DGC) can be on-par with state-of-the-art non-linear GCNs while possessing many desirable properties. For example, as a linear model, DGC requires much fewer parameters than non-linear GCNs, which makes it very memory efficient, and meanwhile, its training is also much faster $( \sim 1 0 0 \times )$ than non-linear models as it could preprocess all features before training.
|
| 32 |
+
|
| 33 |
+
# 3 Dissecting Linear GCNs from Continuous Dynamics
|
| 34 |
+
|
| 35 |
+
In this section, we make a brief review of SGC [21] in the context of semi-supervised node classifi cation task, and further point out its fundamental limitations.
|
| 36 |
+
|
| 37 |
+
# 3.1 Review of Simple Graph Convolution (SGC)
|
| 38 |
+
|
| 39 |
+
Define a graph as $\mathcal { G } = ( \gamma , \mathbf { A } )$ , where $\mathcal { V } = \{ v _ { 1 } , \ldots , v _ { n } \}$ denotes the vertex set of $n$ nodes, and $\mathbf { A } \in \mathbb { R } ^ { n \times n }$ is an adjacency matrix where $a _ { i j }$ denotes the edge weight between node $v _ { i }$ and $v _ { j }$ . The degree matrix $\mathbf { D } = \mathrm { d i a g } ( d _ { 1 } , \ldots , d _ { n } )$ of $\mathbf { A }$ is a diagonal matrix with its $i$ -th diagonal entry as $\begin{array} { r } { d _ { i } = \sum _ { j } a _ { i j } } \end{array}$ . Each node $v _ { i }$ is represented by a $d$ -dimensional feature vector $\mathbf { x } _ { i } \in \mathbb { R } ^ { d }$ , and we denote the feature matrix as $\mathbf { X } \in \mathbb { R } ^ { n \times d } = [ \mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { n } ]$ . Each node belongs to one out of $C$ classes, denoted by a one-hot vector $\mathbf { y } _ { i } \in \{ 0 , 1 \} ^ { C }$ . In node classification problems, only a subset of nodes $\nu _ { l } \subset \nu$ is labeled and we want to predict the labels of the rest nodes $\mathcal { V } _ { u } = \mathcal { V } \backslash \mathcal { V } _ { l }$ .
|
| 40 |
+
|
| 41 |
+
SGC shows that we can obtain similar performance with a simplified GCN,
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
\begin{array} { r } { \hat { \mathbf { Y } } _ { \mathrm { S G C } } = \operatorname { s o f t m a x } \left( \mathbf { S } ^ { K } \mathbf { X } \mathbf { \Theta } \right) , } \end{array}
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
which pre-processes the node features $\mathbf { X }$ with $K$ linear propagation steps, and then applies a linear classifier with parameter $\Theta$ . Specifically, at the step $k$ , each feature $\mathbf { x } _ { i }$ is computed by aggregating features in its local neighborhood, which can be done in parallel over the whole graph for $K$ steps,
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\mathbf { X } ^ { ( k ) } \longleftarrow \mathbf { S } \mathbf { X } ^ { ( k - 1 ) } , \mathrm { ~ w h e r e ~ } \mathbf { S } = \widetilde { \mathbf { D } } ^ { - \frac { 1 } { 2 } } \widetilde { \mathbf { A } } \widetilde { \mathbf { D } } ^ { - \frac { 1 } { 2 } } \quad \Longrightarrow \quad \mathbf { X } ^ { ( K ) } = \mathbf { S } ^ { K } \mathbf { X } .
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
Here $\widetilde { \mathbf { A } } = \mathbf { A } + \mathbf { I }$ is the adjacency matrix augmented with the self-loop I, $\widetilde { \bf D }$ is the degree matrix of $\widetilde { \bf A }$ , and S denotes the symmetrically normalized adjacency matrix. This step exploits the local graph structure to smooth out the noise in each node.
|
| 54 |
+
|
| 55 |
+
At last, SGC applies a multinomial logistic regression (a.k.a. softmax regression) with parameter $\Theta$ to predict the node labels $\hat { \mathbf { Y } } _ { \mathrm { S G C } }$ from the node features of the last propagation step $\mathbf { X } ^ { ( K ) }$ :
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
\hat { \mathbf { Y } } _ { \mathrm { S G C } } = \mathrm { s o f t m a x } \left( \mathbf { X } ^ { ( K ) } \Theta \right) .
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
Because both the feature propagation $( \mathbf { S } ^ { K } \mathbf { X } )$ and classification $( \mathbf { X } ^ { ( K ) } \mathbf { \Theta } _ { \mathbf { \Theta } } ^ { } )$ steps are linear, SGC is essentially a linear version of GCN that only relies on linear features from the input.
|
| 62 |
+
|
| 63 |
+
# 3.2 Equivalence between SGC and Graph Heat Equation
|
| 64 |
+
|
| 65 |
+
Previous analysis of linear GCNs focuses on their asymptotic behavior as propagation steps $K \infty$ (discrete), known as the over-smoothing phenomenon [10]. In this work, we instead provide a novel non-asymptotic characterization of linear GCNs from the corresponding continuous dynamics, graph heat equation [4]. A key insight is that we notice that the propagation of SGC can be seen equivalently as a (coarse) numerical discretization of the graph diffusion equation, as we show below.
|
| 66 |
+
|
| 67 |
+
Graph Heat Equation (GHE) is a well-known generalization of the heat equation on graph data, which is widely used to model graph dynamics with applications in spectral graph theory [4], time series [12], combinational problems [13], etc. In general, GHE can be formulated as follows:
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\left\{ \begin{array} { l l } { \frac { d \mathbf { X } _ { t } } { d t } } & { = - \mathbf { L } \mathbf { X } _ { t } , } \\ { \mathbf { X } _ { 0 } } & { = \mathbf { X } , } \end{array} \right.
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
where $\mathbf { X } _ { t }$ ( $t \geq 0 \}$ ) refers to the evolved input features at time $t$ , and $\mathbf { L }$ refers to the graph Laplacian matrix. Here, for the brevity of analysis, we take the symmetrically normalized graph Laplacian for the augmented adjacency $\widetilde { \bf A }$ and overload the notation as $\mathbf { L } = \widetilde { \mathbf { D } } ^ { - \frac { 1 } { 2 } } \left( \widetilde { \mathbf { D } } - \widetilde { \mathbf { A } } \right) \bar { \widetilde { \mathbf { D } } } ^ { - \frac { 1 } { 2 } } = \bar { \mathbf { I } } - \mathbf { S }$ .
|
| 74 |
+
|
| 75 |
+
As GHE is a continuous dynamics, in practice we need to rely on numerical methods to solve it. We find that SGC can be seen as a coarse finite difference of GHE. Specifically, we apply the forward Euler method to Eq. (4) with an interval $\Delta t$ :
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\hat { \mathbf { X } } _ { t + \Delta t } = \hat { \mathbf { X } } _ { t } - \Delta t \mathbf { L } \hat { \mathbf { X } } _ { t } = \hat { \mathbf { X } } _ { t } - \Delta t ( \mathbf { I } - \mathbf { S } ) \hat { \mathbf { X } } _ { t } = \left[ ( 1 - \Delta t ) \mathbf { I } + \Delta t \mathbf { S } \right] \hat { \mathbf { X } } _ { t } .
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
By involving the update rule for $K$ forward steps, we will get the final features $\hat { \mathbf { X } } _ { T }$ at the terminal time $T = K \cdot \Delta t$ :
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\begin{array} { r } { \hat { \mathbf { X } } _ { T } = [ \mathbf { S } ^ { ( \Delta t ) } ] ^ { K } \mathbf { X } , \mathrm { w h e r e } \mathbf { S } ^ { ( \Delta t ) } = ( 1 - \Delta t ) \mathbf { I } + \Delta t \mathbf { S } . } \end{array}
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
Comparing to Eq. (2), we can see that the Euler discretization of GHE becomes SGC when the step size $\Delta t = 1$ . Specifically, the diffusion matrix $\mathbf { S } ^ { ( \Delta t ) }$ reduces to the SGC diffusion matrix S and the final node features, $\hat { \mathbf { X } } _ { T }$ and $\mathbf { X } ^ { ( K ) }$ , become equivalent. Therefore, SGC with $K$ propagation steps is essentially a finite difference approximation to GHE with $K$ forward steps (step size $\Delta t = 1$ and terminal time $T = K$ ).
|
| 88 |
+
|
| 89 |
+
# 3.3 Revealing the Fundamental Limitations of SGC
|
| 90 |
+
|
| 91 |
+
Based on the above analysis, we theoretically characterize several fundamental limitations of SGC: feature over-smoothing, large numerical errors and large learning risks. Proofs are in Appendix B.
|
| 92 |
+
|
| 93 |
+
Theorem 1 (Oversmoothing from a spectral view). Assume that the eigendecomposition of the Laplacian matrix as $\begin{array} { r } { { \bf L } = \breve { \sum _ { i = 1 } ^ { n } \lambda _ { i } } { \bf u } _ { i } \mathbf { \bar { u } } _ { i } ^ { \top } } \end{array}$ , with eigenvalues $\lambda _ { i }$ and eigenvectors $\mathbf { u } _ { i }$ . Then, the heat equation (Eq. (4)) admits a closed-form solution at time $t$ , known as the heat kernel $\mathbf { H } _ { t } = e ^ { - t \mathbf { L } } =$ ${ \bar { \sum _ { i = 1 } ^ { n } } } e ^ { - \lambda _ { i } t } \mathbf { \bar { u } } _ { i } \mathbf { u } _ { i } ^ { \top }$ . As $t \infty$ , $\mathbf { H } _ { t }$ asymptotically converges to a non-informative equilibrium as $t \to \infty$ , due to the non-trivial (i.e., positive) eigenvalues vanishing:
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\operatorname * { l i m } _ { t \to \infty } e ^ { - \lambda _ { i } t } = \left\{ { 0 , \quad i f \lambda _ { i } > 0 } , i = 1 , \ldots , n . \right.
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
Remark 1. In SGC, $T = K \cdot \Delta t = K$ . Thus, according to Theorem 1, a large number of propagation steps $K \infty$ will inevitably lead to over-smoothed non-informative features.
|
| 100 |
+
|
| 101 |
+
Theorem 2 (Numerical errors). For the initial value problem in Eq. (4) with finite terminal time $T$ , the numerical error of the forward Euler method in Eq. (5) with $K$ steps can be upper bounded by
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\left\| \mathbf { e } _ { T } ^ { ( K ) } \right\| \leq \frac { T \| \mathbf { L } \| \| \mathbf { X } _ { 0 } \| } { 2 K } \left( e ^ { T \| \mathbf { L } \| } - 1 \right) .
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
Remark 2. Since $T = K$ in SGC, the upper bound reduces to $c \cdot \left( e ^ { T \| \mathbf { L } \| } - 1 \right)$ ( $c$ is a constant). We can see that the numerical error will increase exponentially with more propagation steps.
|
| 108 |
+
|
| 109 |
+
Theorem 3 (Learning risks). Consider a simple linear regression problem $( \mathbf { X } , \mathbf { Y } )$ on graph, where the observed input features $\mathbf { X }$ are generated by corrupting the ground truth features $\mathbf { X } _ { c }$ with the following inverse graph diffusion with time $T ^ { * }$ :
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\frac { d \widetilde { \mathbf { X } } _ { t } } { d t } = \mathbf { L } \widetilde { \mathbf { X } } _ { t } , \ w h e r e \ \widetilde { \mathbf { X } } _ { 0 } = \mathbf { X } _ { c } \ a n d \ \widetilde { \mathbf { X } } _ { T ^ { * } } = \mathbf { X } .
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
Denote the population risk with ground truth features as $R ( \mathbf { W } ) = \mathbb { E } \left\| \mathbf { Y } - \mathbf { X } _ { c } \mathbf { W } \right\| ^ { 2 }$ and that of Euler method applied input $\mathbf { X }$ (Eq. (5)) as $\hat { R } ( \mathbf { W } ) = \mathbb { E } \left\| \mathbf { Y } - \left[ \mathbf { S } ^ { ( \Delta t ) } \right] ^ { K } \mathbf { X } \mathbf { W } \right\| ^ { 2 }$ . Supposing that $\mathbb { E } \| \mathbf { X } _ { c } \| ^ { 2 } = M < \infty$ , we have the following upper bound:
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
\hat { R } ( \mathbf { W } ) < R ( \mathbf { W } ) + 2 \| \mathbf { W } \| ^ { 2 } \left( \mathbb { E } \left\| \mathbf { e } _ { \hat { T } } ^ { ( K ) } \right\| ^ { 2 } + M \left\| e ^ { T ^ { \star } \mathbf { L } } \right\| ^ { 2 } \cdot \left\| e ^ { - T ^ { \star } \mathbf { L } } - e ^ { - \hat { T } \mathbf { L } } \right\| ^ { 2 } \right) .
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
Remark 3. Following Theorem 3, we can see that the upper bound can be minimized by finding an optimal terminal time such that $\hat { T } = T ^ { \star }$ and minimizing the numerical error $\left\| \mathbf { e } _ { \hat { T } } ^ { ( K ) } \right\|$ While SGC fixes the step size $\Delta t = 1$ , thus $T$ and $K$ are coupled together, which makes it less flexible to minimize the risk in Eq. (10).
|
| 122 |
+
|
| 123 |
+
# 4 The Proposed Decoupled Graph Convolution (DGC)
|
| 124 |
+
|
| 125 |
+
In this section, we introduce our proposed Decoupled Graph Convolution (DGC) and discuss how it overcomes the above limitations of SGC.
|
| 126 |
+
|
| 127 |
+
# 4.1 Formulation
|
| 128 |
+
|
| 129 |
+
Based on the analysis in Section 3.3, we need to resolve the coupling between propagation steps $K$ and terminal time $T$ caused by the fixed time interval $\Delta t = 1$ . Therefore, we regard the terminal time $T$ and the propagation steps $K$ as two free hyperparameters in the numerical integration via a flexible time interval. In this way, the two parameters can play different roles and cooperate together to attain better results: 1) we can flexibly choose $T$ to tradeoff between under-smoothing and oversmoothing to find a sweet spot for each dataset; and 2) given an optimal terminal time $T$ , we can also flexibly increase the propagation steps $K$ for better numerical precision with $\Delta t = T / K \to 0$ .
|
| 130 |
+
|
| 131 |
+

|
| 132 |
+
Figure 1: t-SNE input feature visualization and the corresponding test accuracy $( \% )$ under different terminal time $( T )$ and different number of propagation steps $( K )$ . Experiments are conducted with ours DGC-Euler model on the Cora dataset. Each point represents a node in the graph and its color denotes the class of the node.
|
| 133 |
+
|
| 134 |
+
In practice, a moderate number of steps is sufficient to attain the best classification accuracy, hence we can also choose a minimal $K$ among the best for computation efficiency.
|
| 135 |
+
|
| 136 |
+
Formally, we propose our Decoupled Graph Convolution (DGC) as follows:
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\hat { \mathbf { Y } } _ { \mathrm { D G C } } = \mathrm { s o f t m a x } \left( \hat { \mathbf { X } } _ { T } \mathbf { \Theta } \right) , \mathrm { w h e r e } \hat { \mathbf { X } } _ { T } = \mathrm { o d e } \_ { \mathrm { i n t } } ( \mathbf { X } , \Delta t , K ) .
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
Here ode_ $\mathbf { i n t } ( \mathbf { X } , \Delta t , K )$ refers to the numerical integration of the graph heat equation that starts from $\mathbf { X }$ and runs for $K$ steps with step size $\Delta t$ . Here, we consider two numerical schemes: the forward Euler method and the Runge-Kutta (RK) method.
|
| 143 |
+
|
| 144 |
+
DGC-Euler. As discussed previously, the forward Euler gives an update rule as in Eq. (5). With terminal time $T$ and step size $\Delta t = T / K$ , we can obtain $\hat { \mathbf { X } } _ { T }$ after $K$ propagation steps:
|
| 145 |
+
|
| 146 |
+
$$
|
| 147 |
+
\hat { \mathbf { X } } _ { T } = \left[ \mathbf { S } ^ { ( T / K ) } \right] ^ { K } \mathbf { X } , \mathrm { w h e r e } \mathbf { S } ^ { ( T / K ) } = \left( 1 - T / K \right) \cdot \mathbf { I } + \left( T / K \right) \cdot \mathbf { S } .
|
| 148 |
+
$$
|
| 149 |
+
|
| 150 |
+
DGC-RK. Alternatively, we can apply higher-order finite difference methods to achieve better numerical precision, at the cost of more function evaluations at intermediate points. One classical method is the 4th-order Runge-Kutta (RK) method, which proceeds with
|
| 151 |
+
|
| 152 |
+
$$
|
| 153 |
+
\hat { \mathbf { X } } _ { t + \Delta t } = \hat { \mathbf { X } } _ { t } + \frac { 1 } { 6 } \Delta t \left( \mathbf { R } _ { 1 } + 2 \mathbf { R } _ { 2 } + 2 \mathbf { R } _ { 3 } + \mathbf { R } _ { 4 } \right) \overset { \Delta } { = } \mathbf { S } _ { \mathrm { R K } } ^ { ( \Delta t ) } \hat { \mathbf { X } } _ { t } ,
|
| 154 |
+
$$
|
| 155 |
+
|
| 156 |
+
where
|
| 157 |
+
|
| 158 |
+
$$
|
| 159 |
+
\mathbf { R } _ { 1 } = \hat { \mathbf { X } } _ { k } , \ \mathbf { R } _ { 2 } = \hat { \mathbf { X } } _ { k } - \frac { 1 } { 2 } \Delta t \mathbf { L } \mathbf { R } _ { 1 } , \ \mathbf { R } _ { 3 } = \hat { \mathbf { X } } _ { k } - \frac { 1 } { 2 } \Delta t \mathbf { L } \mathbf { R } _ { 2 } , \ \mathbf { R } _ { 4 } = \hat { \mathbf { X } } _ { k } - \Delta t \mathbf { L } \mathbf { R } _ { 3 } .
|
| 160 |
+
$$
|
| 161 |
+
|
| 162 |
+
Replacing the propagation matrix $\mathbf { S } ^ { ( T / K ) }$ in DGC-Euler with the RK-matrix ${ \bf S } _ { \mathrm { R K } } ^ { ( T / K ) }$ , we can get a 4th-order model, namely DGC-RK, whose numerical error can be reduced to $O ( 1 / K ^ { 4 } )$ order.
|
| 163 |
+
|
| 164 |
+
Remark. In GCN [7], a self-loop I is heuristically introduced in the adjacency matrix $\widetilde { \mathbf { A } } = \mathbf { A } + \mathbf { I }$ to prevent numerical instability with more steps $K$ . Here, we notice that the DGC-Euler diffusion matrix $\mathbf { S } ^ { ( \Delta t ) } = ( 1 - \Delta t ) \mathbf { I } + \Delta t \mathbf { S }$ naturally incorporates the self-loop I into the diffusion process as a momentum term, where $\Delta t$ flexibly tradeoffs information from the self-loop and the neighborhood. Therefore, in DGC, we can also remove the self-loop from $\widetilde { \bf A }$ and increasing $K$ is still numerically stable with fixed $T$ . We name the resulting model as DGC-sym with symmetrically normalized adjacency matrix $\mathbf { S } _ { \mathrm { s y m } } = \mathbf { D } ^ { - \frac { 1 } { 2 } } \mathbf { A } \mathbf { D } ^ { - \frac { 1 } { 2 } }$ , which aligns with the canonical normalized graph Laplacian $\mathbf { L } _ { \mathrm { s y m } } = \mathbf { D } ^ { - { \frac { 1 } { 2 } } } \left( \mathbf { D } - \mathbf { A } \right) \mathbf { D } ^ { - { \frac { 1 } { 2 } } } = \mathbf { I } - \mathbf { S } _ { \mathrm { s y m } }$ in the spectral graph theory [4]. Comparing the two Laplacians from a spectral perspective, $\dot { \bf L } = { \bf I } - { \bf S }$ has a smaller spectral range than $\mathbf { L } _ { \mathrm { s y m } }$ [21]. According to Theorem 2, $\mathbf { L }$ will have a faster convergence rate of numerical error.
|
| 165 |
+
|
| 166 |
+
Table 1: A comparison of propagation rules. Here $\mathbf { X } ^ { ( k ) } \in \mathcal { X }$ represents input features after $k$ feature propagation steps and $\mathbf { X } ^ { ( 0 ) } = \bar { \mathbf { X } }$ ; $\mathbf { H } ^ { ( k ) }$ denotes the hidden features of non-linear GCNs at layer $k$ ; W denotes the weight matrix; $\sigma$ refers to a activation function; $\alpha , \beta$ are coefficients.
|
| 167 |
+
|
| 168 |
+
<table><tr><td>Method</td><td>Type</td><td>Propagation rule</td></tr><tr><td>GCN[7]</td><td>Non-linear</td><td>H(k)= σ (SH(k-1)W(k-1))</td></tr><tr><td>APPNP [8]</td><td>Non-linear</td><td>H(k)= (1-α)SH(𝑘-1) +aH(0)</td></tr><tr><td>CGNN [22]</td><td>Non-linear</td><td>H(k)= (1-α)SH(k-1)W+H(0)</td></tr><tr><td>SGC [21]</td><td>Linear</td><td>X(k)= SX(k-1))</td></tr><tr><td>DGC-Euler (ours)</td><td>Linear</td><td>X(k) =(1-T/K)·X(k-1) +(T/K)·SX(k-1)</td></tr></table>
|
| 169 |
+
|
| 170 |
+
# 4.2 Verifying the Benefits of DGC
|
| 171 |
+
|
| 172 |
+
Here we demonstrate the advantages of DGC both theoretically and empirically.
|
| 173 |
+
|
| 174 |
+
Theoretical benefits. Revisiting Section 3.3, DGC can easily alleviate the limitations of existing linear GCNs shown in Remarks 1, 2, 3 by decoupling $T$ and $K$ .
|
| 175 |
+
|
| 176 |
+
• For Theorem 1, by choosing a fixed terminal time $T$ with optimal tradeoff, increasing the propagation steps $K$ in DGC will not lead to over-smoothing as in SGC; • For Theorem 2, with $T$ is fixed, using more propagation steps ( $K \infty$ ) in DGC will help minimize the numerical error $\left\| \mathbf { e } _ { T } ^ { ( K ) } \right\|$ with a smaller step size $\Delta t = T / K \to 0$ ; • For Theorem 3, by combining a flexibly chosen optimal terminal time $T ^ { * }$ and minimal numerical error with a large number of steps $K$ , we can get minimal learning risks.
|
| 177 |
+
|
| 178 |
+
Empirical evidence. To further provide an intuitive understanding of DGC, we visualize the propagated input features of our proposed DGC-Euler on the Cora dataset in Figure 1. The first row shows that there exists an optimal terminal time $T ^ { * }$ for each dataset with the best feature separability (e.g., 5.3 for Cora). Either a smaller $T$ (under-smooth) or a larger $T$ (over-smooth) will mix the features up and make them more indistinguishable, which eventually leads to lower accuracy. From the second row, we can see that, with fixed optimal $T$ , too large step size $\Delta t$ (i.e., too small propagation steps $K$ ) will lead to feature collapse, while gradually increasing the propagation steps $K$ makes the nodes of different classes more separable and improve the overall accuracy.
|
| 179 |
+
|
| 180 |
+
# 4.3 Discussions
|
| 181 |
+
|
| 182 |
+
To highlight the difference of DGC to previous methods, we summarize their propagation rules in Table 1. For non-linear methods, GCN [7] uses the canonical propagation rule which has the oversmoothing issue, while APPNP [8] and CGNN [22] address it by further aggregating the initial hidden state $\bar { \mathbf { H } } ^ { ( 0 ) }$ repeatedly at each step. In particular, we emphasize that our DGC-Euler is different from APPNP in terms of the following aspects: 1) DGC-Euler is a linear model and propagates on the input features $\mathbf { X } ^ { ( k - 1 ) }$ , while APPNP is non-linear and propagates on non-linear embedding $\mathbf { H } ^ { ( k - 1 ) }$ ; 2) at each step, APPNP aggregates features from the initial step $\mathbf { H } ^ { ( 0 ) }$ , while DGC-Euler aggregates features from the last step $\bar { \mathbf { X } } ^ { ( k - 1 ) }$ ; 3) APPNP aggregates a large amount $( 1 - \alpha )$ of the propagated features $\mathbf { S H } ^ { ( k - 1 ) }$ while DGC-Euler only takes a small step $\Delta t \left( T / K \right)$ towards the new features $\mathbf { S X } ^ { ( k - 1 ) }$ . For linear methods, SGC has several fundamental limitations as analyzed in Section 3.3, while DGC addresses them by flexible and fine-grained numerical integration of the propagation process.
|
| 183 |
+
|
| 184 |
+
Our dissection of linear GCNs also suggests a different understanding of the over-smoothing problem. As shown in Theorem 1, over-smoothing is an inevitable phenomenon of (canonical) GCNs, while we can find a terminal time to achieve an optimal tradeoff between under-smoothing and oversmoothing. However, we cannot expect more layers can bring more profit if the terminal time goes to infinity, that is, the benefits of more layers can only be obtained under a proper terminal time.
|
| 185 |
+
|
| 186 |
+
Table 2: Test accuracy $( \% )$ of semi-supervised node classification on citation networks.
|
| 187 |
+
|
| 188 |
+
<table><tr><td>Type</td><td>Method</td><td>Cora</td><td>Citeseer</td><td>Pubmed</td></tr><tr><td rowspan="7">Non-linear</td><td>GCN[7]</td><td>81.5</td><td>70.3</td><td>79.0</td></tr><tr><td>GAT[19]</td><td>83.0 ± 0.7</td><td>72.5 ± 0.7</td><td>79.0 ± 0.3</td></tr><tr><td>GraphSAGE[5]</td><td>82.2</td><td>71.4</td><td>75.8</td></tr><tr><td>JKNet [25]</td><td>81.1</td><td>69.8</td><td>78.1</td></tr><tr><td>APPNP[8]</td><td>83.3</td><td>71.8</td><td>80.1</td></tr><tr><td>GWWN [24]</td><td>82.8</td><td>71.7</td><td>79.1</td></tr><tr><td>GraphHeat [23] CGNN [22]</td><td>83.7</td><td>72.5</td><td>80.5</td></tr><tr><td>GCDE [15]</td><td>84.2 ± 0.6 83.8 ± 0.5</td><td>71.8 ± 0.7 72.5 ± 0.5</td><td>76.8 ± 0.6 79.9 ± 0.3</td></tr><tr><td rowspan="6">Linear</td><td></td><td>45.3</td><td></td><td></td></tr><tr><td>Label Propagation [28]</td><td></td><td>68.0</td><td>63.0</td></tr><tr><td>DeepWalk [14] SGC [21]</td><td>70.7 ± 0.6</td><td>51.4 ± 0.5</td><td>76.8 ± 0.6</td></tr><tr><td>SGC-PairNorm [27]</td><td>81.0 ± 0.0</td><td>71.9 ± 0.1</td><td>78.9 ± 0.0</td></tr><tr><td>SIGN-linear [17]</td><td>81.1</td><td>70.6</td><td>78.2</td></tr><tr><td>DGC (ours)</td><td>81.7 83.3 ± 0.0</td><td>72.4 73.3 ± 0.1</td><td>78.6 80.3 ± 0.1</td></tr></table>
|
| 189 |
+
|
| 190 |
+
# 5 Experiments
|
| 191 |
+
|
| 192 |
+
In this section, we conduct a comprehensive analysis on DGC and compare it against both linear and non-linear GCN variants on a collection of benchmark datasets.
|
| 193 |
+
|
| 194 |
+
# 5.1 Performance on Semi-supervised Node Classification
|
| 195 |
+
|
| 196 |
+
Setup. For semi-supervised node classification, we use three standard citation networks, Cora, Citeseer, and Pubmed [18] and adopt the standard data split as in [7, 19, 24, 23, 15]. Here, we compare our DGC against several representative non-linear and linear methods that also adopts the standard data split. For non-linear GCNs, we include 1) classical baselines like GCN [7], GAT [20], GraphSAGE [5], APPNP [8] and JKNet [25]; 2) spectral methods using graph heat kernel [24, 23]; and 3) continuous GCNs [15, 22]. For linear methods, we present the results of Label Propagation [28], DeepWalk [14], SGC (linear GCN) [21] as well as its regularized version SGC-PairNorm [27]. We also consider a linear version of SIGN [17], SIGN-linear, which extends SGC by aggregating features from multiple propagation stages $( K = 1 , 2 , \dots )$ ). For DGC, we adopt the Euler scheme, i.e., DGC-Euler (Eq. (12)) by default for simplicity. We report results averaged over 10 random runs. Data statistics and training details are in Appendix A.
|
| 197 |
+
|
| 198 |
+
We compare DGC against both linear and non-linear baselines for the semi-supervised node classification task, and the results are shown in Table 2.
|
| 199 |
+
|
| 200 |
+
DGC v.s. linear methods. We can see that DGC shows significant improvement over previous linear methods across three datasets. In particular, compared to SGC (previous SOTA methods), DGC obtains $8 3 . 3 ~ \nu . s . ~ 8 1 . 0$ on Cora, $7 3 . 3 ~ \nu . s . ~ 7 1 . 9$ on Citeseer and $8 0 . 3 ~ \nu . s . ~ 7 8 . 9$ on Pubmed. This shows that in real-world datasets, a flexible and fine-grained integration by decoupling $T$ and $K$ indeed helps improve the classification accuracy of SGC by a large margin. Besides, DGC also outperforms the multiscale SGC, SIGN-linear, suggesting that multiscale techniques cannot fully solve the limitations of SGC, while DGC can overcome these limitations by decoupling $T$ and $K$ . As discussed in Appendix C, DGC still shows clear advantages over SIGN when controlling the terminal time $T$ while being more computationally efficient, which indicates that the advantage of DGC is not only a real-valued $T$ , but also the improved numerical precision by adopting a large $K$ .
|
| 201 |
+
|
| 202 |
+
DGC v.s. non-linear models. Table 2 further shows that DGC, as a linear model, even outperforms many non-linear GCNs on semi-supervised tasks. First, DGC improves over classical GCNs like GCN [7], GAT [19] and GraphSAGE [5] by a large margin. Also, DGC is comparable to, and sometimes outperforms, many modern non-linear GCNs. For example, DGC shows a clear advantage over multiscale methods like JKNet [25] and APPNP [8]. DGC is also comparable to spectral methods based on graph heat kernel, e.g., GWWN [24], GraphHeat [23], while being much more efficient as a simple linear model. Besides, compared to non-linear continuous models like GCDE [15] and CGNN [22], DGC also achieves comparable accuracy only using a simple linear dynamic.
|
| 203 |
+
|
| 204 |
+
Table 3: Test accuracy $( \% )$ of fully-supervised node classification on citation networks.
|
| 205 |
+
|
| 206 |
+
<table><tr><td>Type</td><td>Method</td><td>Cora</td><td>Citeseer</td><td>Pubmed</td></tr><tr><td rowspan="6">Non-linear</td><td>GCN[7]</td><td>85.8</td><td>73.6</td><td>88.1</td></tr><tr><td>GAT[19]</td><td>86.4</td><td>74.3</td><td>87.6</td></tr><tr><td>JK-MaxPool [25]</td><td>89.6</td><td>77.7</td><td>-</td></tr><tr><td>JK-Concat [25]</td><td>89.1</td><td>78.3</td><td>-</td></tr><tr><td>JK-LSTM [25]</td><td>85.8</td><td>74.7</td><td>-</td></tr><tr><td>APPNP [8]</td><td>90.2</td><td>79.8</td><td>86.3</td></tr><tr><td rowspan="2">Linear</td><td>SGC [21]</td><td>85.8</td><td>78.1</td><td>83.3</td></tr><tr><td>DGC (ours)</td><td>88.2 ± 0.0</td><td>78.7 ± 0.0</td><td>89.4 ± 0.0</td></tr></table>
|
| 207 |
+
|
| 208 |
+
# 5.2 Performance on Fully-supervised Node Classification
|
| 209 |
+
|
| 210 |
+
Setup. For fully-supervised node classification, we also use the three citation networks, Cora, Citeseer and Pubmed, but instead randomly split the nodes in three citation networks into $60 \%$ , $20 \%$ and $20 \%$ for training, validation and testing, following the previous practice in [25]. Here, we include the baselines that also have reported results in the fully supervised setting, such as GCN [7], GAT [19] (reported baselines in [25]), and the three variants of JK-Net: JK-MaxPool, JK-Concat and JK-LSTM [25]. Besides, we also reproduce the result of APPNP [8] for a fair comparison. Dataset statistics and training details are described in Appendix.
|
| 211 |
+
|
| 212 |
+
Results. The results of the fully-supervised semi-classification task are basically consistent with the semi-supervised setting. As a linear method, DGC not only improves the state-of-the-art linear GCNs by a large margin, but also outperforms GCN [7], GAT [19] significantly. Besides, DGC is also comparable to multiscale methods like JKNet [25] and APPNP [8], showing that a good linear model like DGC is also competitive for fully-supervised tasks.
|
| 213 |
+
|
| 214 |
+
# 5.3 Performance on Large Scale Datasets
|
| 215 |
+
|
| 216 |
+
Setup. More rigorously, we also conduct the comparison on a large-scale node classification dataset, the Reddit networks [5]. Following SGC [21], we adopt the inductive setting, where we use the subgraph of training nodes as training data and use the whole graph for the validation/testing data. For a fair comparison, we use the same training configurations as SGC [21] and include its reported baselines, such as GCN [7], FastGCN [2], three variants of GraphSAGE [5], and RandDGI (DGI with randomly initialized encoder) [20]. We also include APPNP [8] for a comprehensive comparison.
|
| 217 |
+
|
| 218 |
+
Results. We can see DGC still achieves the best accuracy among linear methods and improve $0 . 9 \%$ accuracy over SGC. Meanwhile, it is superior to the three variants of GraphSAGE as well as APPNP. Thus, DGC is still the stateof-the-art linear GCNs and competitive against nonlinear GCNs on large scale datasets.
|
| 219 |
+
|
| 220 |
+
Table 4: Test accuracy $( \% )$ comparison with inductive methods on on a large scale dataset, Reddit. Reported results are averaged over 10 runs. OOM: out of memory.
|
| 221 |
+
|
| 222 |
+
<table><tr><td>Type</td><td>Method</td><td>Acc.</td></tr><tr><td rowspan="3">Non-linear</td><td>GCN [7] FastGCN [2]</td><td rowspan="3">OOM 93.7 93.0 95.0</td></tr><tr><td>GraphSAGE-GCN [5]</td></tr><tr><td>GraphSAGE-mean [5] GraphSAGE-LSTM[5] 95.4 APPNP [8] 95.0</td></tr><tr><td rowspan="3">Linear</td><td>RandDGI [20]</td><td>93.3</td></tr><tr><td>SGC [21]</td><td>94.9</td></tr><tr><td>DGC (ours)</td><td>95.8</td></tr></table>
|
| 223 |
+
|
| 224 |
+

|
| 225 |
+
Figure 2: Left: test accuracy $( \% )$ with increasing feature propagation steps on Cora. Middle: comparison of robustness under different noise scales $\sigma$ on three citation networks. Right: a comparison of relative total training time for 100 epochs on the Pubmed dataset.
|
| 226 |
+
|
| 227 |
+
Table 5: Comparison of explicit computation time of different training stages on the Pubmed dataset with a single NVIDIA GeForce RTX 3090 GPU.
|
| 228 |
+
|
| 229 |
+
<table><tr><td>Type</td><td>Method</td><td>Preprocessing Time</td><td>Training Time</td><td>Total Time</td></tr><tr><td rowspan="3">Linear</td><td>SGC(K = 2) [21]</td><td>3.8 ms</td><td>61.5 ms</td><td>65.3 ms</td></tr><tr><td>DGC(K: (= 2) (ours)</td><td>3.8 ms</td><td>61.5 ms</td><td>65.3 ms</td></tr><tr><td>DGC (K = 100) (ours)</td><td>169.2 ms</td><td>55.8 ms</td><td>225.0 ms</td></tr><tr><td>Nonlinear</td><td>GCN [7]</td><td>0</td><td>17.0 s</td><td>17.0 s</td></tr></table>
|
| 230 |
+
|
| 231 |
+
# 5.4 Empirical Understandings of DGC
|
| 232 |
+
|
| 233 |
+
Setup. Here we further provide a comprehensive analysis of DGC. First, we compare its oversmoothing behavior and computation time against previous methods. Then we analyze several factors that affect the performance of DGC, including the Laplacian matrix L, the numerical schemes and the terminal time $T$ . Experiments are conducted on the semi-supervised learning tasks, and we adopt DGC-Euler with the default hyperparameters unless specified.
|
| 234 |
+
|
| 235 |
+
Non-over-smoothing with increasing steps. In the left plot of Figure 2, we compare different GCNs with increasing model depth (non-linear GCNs) or propagation steps (linear GCNs) from 2 to 1000. Baselines include SGC [21], GCN [7], and our DGC with three different terminal time $T$ (1, 5.3, 10). First, we notice that SGC and GCN fail catastrophically when increasing the depth, which is consistent with the previously observed over-smoothing phenomenon. Instead, all three DGC variants can benefit from increased steps. Nevertheless, the final performance will degrade if the terminal time is either too small $T = 1$ , under-smoothing) or too large $T = 1 0$ , over-smoothing). DGC enables us to flexibly find the optimal terminal time $T = 5 . 3 $ ). Thus, we can obtain the optimal accuracy with an optimal tradeoff between under-smoothing and over-smoothing.
|
| 236 |
+
|
| 237 |
+
Robustness to feature noise. In real-world applications, there are plenty of noise in the collected node attributes, thus it is crucial for GCNs to be robust to input noise [1]. Therefore, we compare the robustness of SGC and DGC against Gaussian noise added to the input features, where $\sigma$ stands for the standard deviation of the noise. Figure 2 (middle) shows that DGC is significantly more robust than SGC across three citation networks, and the advantage is clearer on larger noise scales. As discussed in Theorem 3, the diffusion process in DGC can be seen as a denoising procedure, and consequently, DGC’s robustness to feature noise can be contributed to the optimal tradeoff between over-smoothing and under-smoothing with a flexible choice of $T$ and $K$ . In comparison, SGC is not as good as DGC because it cannot find such a sweet spot accurately.
|
| 238 |
+
|
| 239 |
+
Computation time. In practice, linear GCNs can accelerate training by pre-processing features with all propagation steps and storing them for the later model training. Since pre-processing costs much fewer time than training ${ < } 5 \%$ in SGC), linear GCNs could be much faster than non-linear ones. As shown in Figure 2 (right), DGC is slightly slower $( 3 \times )$ than SGC, but DGC achieves much higher accuracy. Even so, DGC is still much faster than non-linear GCNs $( > 1 0 0 \times )$ . Indeed, as further shown in Table 5, the computation overhead of DGC over SGC mainly lies in the preprocessing stage, which is very small in SGC and only leads to around twice longer total time. Instead, GCN is much slower as it involves propagation in each training loop, leading to much slower training.
|
| 240 |
+
|
| 241 |
+

|
| 242 |
+
Figure 3: Algorithmic analysis of our proposed DGC. Left: test accuracy $( \% )$ of two kinds of Laplacian, ${ \bf L } = { \bf I } - { \bf S }$ (with self-loop) and ${ \bf L } _ { \mathrm { s y m } } = { \bf I } - { \bf S } _ { \mathrm { s y m } }$ (without self-loop), with increasing steps $K$ and fixed time $T$ on Cora. Middle: test accuracy $( \% )$ of two numerical schemes, Euler and Runge-Kutta, with increasing steps $K$ and fixed $T$ under fixed terminal time on Cora. Right: test accuracy $( \% )$ with varying terminal time $T$ and fixed steps $K$ on Cora.
|
| 243 |
+
|
| 244 |
+
Graph Laplacian. As shown in Figure 3 (left), in DGC, both the two Laplacians, $\mathbf { L }$ (with self-loop) and $\mathbf { L } _ { \mathrm { s y m } }$ (without self-loop), can consistently benefit from more propagation steps without leading to numerical issues. Further comparing the two Laplacians, we can see that the augmented Laplacian $\mathbf { L }$ obtains higher test accuracy than the canonical Laplacian $\mathbf { L } _ { \mathrm { s y m } }$ and requires fewer propagation steps $K$ to obtain good results, which could also be understood from our analysis in Section 3.3.
|
| 245 |
+
|
| 246 |
+
Numerical scheme. By comparing different numerical schemes in Figure 3 (middle), we find that the Runge-Kutta method demonstrates better accuracy than the Euler method with a small $K$ . Nevertheless, as $K$ increases, the difference gradually vanishes. Thus, the Euler method is sufficient for DGC to achieve good performance, and it is more desirable in terms of its simplicity and efficiency.
|
| 247 |
+
|
| 248 |
+
Terminal time $T$ . In Figure 3 (right), we compare the test accuracy with different terminal time $T$ . We show that indeed, in real-world datasets, there exists a sweet spot that achieves the optimal tradeoff between under-smoothing and over-smoothing. In Table 6, we list the best terminal time that we find on two large graph datasets, Pubmed and Reddit. We can see that $T$ is almost consistent across different Laplacians on each dataset, which suggests that the optimal terminal time $T ^ { * }$ is an intrinsic property of the dataset.
|
| 249 |
+
|
| 250 |
+
Table 6: Optimal terminal time $T ^ { * }$ on the transductive task, Pubmed, and the inductive task, Reddit, with different Laplacians.
|
| 251 |
+
|
| 252 |
+
<table><tr><td>Dataset</td><td>Laplacian</td><td>T*</td><td>Acc</td></tr><tr><td rowspan="2">Pubmed</td><td>I-S</td><td>6.0</td><td>80.3</td></tr><tr><td>I-Ssym</td><td>6.0</td><td>79.8</td></tr><tr><td rowspan="2">Reddit</td><td>I-S</td><td>2.7</td><td>95.5</td></tr><tr><td>I-Ssym</td><td>2.6</td><td>95.8</td></tr></table>
|
| 253 |
+
|
| 254 |
+
# 6 Conclusions
|
| 255 |
+
|
| 256 |
+
In this paper, we have proposed Decoupled Graph Convolution (DGC), which improves significantly over previous linear GCNs through decoupling the terminal time and feature propagation steps from a continuous perspective. Experiments show that our DGC is competitive with many modern variants of non-linear GCNs while being much more computationally efficient with much fewer parameters to learn.
|
| 257 |
+
|
| 258 |
+
Our findings suggest that, unfortunately, current GCN variants still have not shown significant advantages over a properly designed linear GCN. We believe that this would attract the attention of the community to reconsider the actual representation ability of current nonlinear GCNs and propose new alternatives that can truly benefit from nonlinear architectures.
|
| 259 |
+
|
| 260 |
+
# Acknowledgement
|
| 261 |
+
|
| 262 |
+
Yisen Wang is partially supported by the National Natural Science Foundation of China under Grant 62006153, and Project 2020BD006 supported by PKU-Baidu Fund. Jiansheng Yang is supported by the National Science Foundation of China under Grant No. 11961141007. Zhouchen Lin was supported by the NSF China (No.s 61625301 and 61731018), NSFC Tianyuan Fund for Mathematics (No. 12026606) and Project 2020BD006 supported by PKU-Baidu Fund.
|
| 263 |
+
|
| 264 |
+
References
|
| 265 |
+
[1] Aleksandar Bojchevski and Stephan Günnemann. Certifiable robustness to graph perturbations. NeurIPS, 2019. 9
|
| 266 |
+
[2] Jie Chen, Tengfei Ma, and Cao Xiao. FastGCN: fast learning with graph convolutional networks via importance sampling. ICLR, 2018. 8
|
| 267 |
+
[3] Ricky TQ Chen, Yulia Rubanova, Jesse Bettencourt, and David K Duvenaud. Neural ordinary differential equations. NeurIPS, 2018. 2
|
| 268 |
+
[4] Fan RK Chung and Fan Chung Graham. Spectral graph theory. American Mathematical Society, 1997. 3, 5
|
| 269 |
+
[5] Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. NeurIPS, 2017. 2, 7, 8
|
| 270 |
+
[6] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. CVPR, 2016. 2
|
| 271 |
+
[7] Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. ICLR, 2017. 1, 2, 5, 6, 7, 8, 9
|
| 272 |
+
[8] Johannes Klicpera, Aleksandar Bojchevski, and Stephan Günnemann. Predict then propagate: Graph neural networks meet personalized pagerank. ICLR, 2019. 2, 6, 7, 8
|
| 273 |
+
[9] Guohao Li, Matthias Muller, Ali Thabet, and Bernard Ghanem. DeepGCNs: Can gcns go as deep as cnns? CVPR, 2019. 2
|
| 274 |
+
[10] Qimai Li, Zhichao Han, and Xiao-Ming Wu. Deeper insights into graph convolutional networks for semi-supervised learning. AAAI, 2018. 1, 2, 3
|
| 275 |
+
[11] Yiping Lu, Aoxiao Zhong, Quanzheng Li, and Bin Dong. Beyond finite layer neural networks: Bridging deep architectures and numerical differential equations. ICML, 2018. 2
|
| 276 |
+
[12] Georgi S Medvedev. Stochastic stability of continuous time consensus protocols. SIAM Journal on Control and Optimization, 50(4):1859–1885, 2012. 3
|
| 277 |
+
[13] Georgi S Medvedev. The nonlinear heat equation on dense graphs and graph limits. SIAM Journal on Mathematical Analysis, 46(4):2743–2766, 2014. 3
|
| 278 |
+
[14] Bryan Perozzi, Rami Al-Rfou, and Steven Skiena. DeepWalk: Online learning of social representations. SIGKDD, 2014. 7
|
| 279 |
+
[15] Michael Poli, Stefano Massaroli, Junyoung Park, Atsushi Yamashita, Hajime Asama, and Jinkyoo Park. Graph neural ordinary differential equations. arXiv preprint arXiv:1911.07532, 2019. 2, 7, 8
|
| 280 |
+
[16] Yu Rong, Wenbing Huang, Tingyang Xu, and Junzhou Huang. DropEdge: Towards deep graph convolutional networks on node classification. ICLR, 2019. 2
|
| 281 |
+
[17] Emanuele Rossi, Fabrizio Frasca, Ben Chamberlain, Davide Eynard, Michael Bronstein, and Federico Monti. SIGN: Scalable inception graph neural networks. arXiv preprint arXiv:2004.11198, 2020. 7
|
| 282 |
+
[18] 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. 7
|
| 283 |
+
[19] Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and ´ Yoshua Bengio. Graph attention networks. ICLR, 2018. 2, 7, 8
|
| 284 |
+
[20] Petar Velickovic, William Fedus, William L Hamilton, Pietro Liò, Yoshua Bengio, and R Devon Hjelm. Deep graph infomax. ICLR, 2019. 7, 8
|
| 285 |
+
[21] Felix Wu, Tianyi Zhang, Amauri Holanda de Souza Jr, Christopher Fifty, Tao Yu, and Kilian Q Weinberger. Simplifying graph convolutional networks. ICML, 2019. 1, 2, 5, 6, 7, 8, 9
|
| 286 |
+
[22] Louis-Pascal Xhonneux, Meng Qu, and Jian Tang. Continuous graph neural networks. ICML, 2020. 2, 6, 7, 8
|
| 287 |
+
[23] Bingbing Xu, Huawei Shen, Qi Cao, Keting Cen, and Xueqi Cheng. Graph convolutional networks using heat kernel for semi-supervised learning. arXiv preprint arXiv:2007.16002, 2020. 7
|
| 288 |
+
[24] Bingbing Xu, Huawei Shen, Qi Cao, Yunqi Qiu, and Xueqi Cheng. Graph wavelet neural network. ICLR, 2019. 7
|
| 289 |
+
[25] Keyulu Xu, Chengtao Li, Yonglong Tian, Tomohiro Sonobe, Ken-ichi Kawarabayashi, and Stefanie Jegelka. Representation learning on graphs with jumping knowledge networks. ICML, 2018. 2, 7, 8
|
| 290 |
+
[26] Zhilin Yang, William Cohen, and Ruslan Salakhudinov. Revisiting semi-supervised learning with graph embeddings. ICML, 2016. 2
|
| 291 |
+
[27] Lingxiao Zhao and Leman Akoglu. PairNorm: Tackling oversmoothing in gnns. ICLR, 2020. 2, 7
|
| 292 |
+
[28] Xiaojin Zhu, Zoubin Ghahramani, and John D Lafferty. Semi-supervised learning using gaussian fields and harmonic functions. ICML, 2003. 7
|
md/train/NSBrFgJAHg/NSBrFgJAHg.md
ADDED
|
@@ -0,0 +1,424 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DEGREE-QUANT: QUANTIZATION-AWARE TRAINING FOR GRAPH NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Shyam A. Tailor∗
|
| 4 |
+
Department of Computer Science & Technology
|
| 5 |
+
University of Cambridge
|
| 6 |
+
|
| 7 |
+
Javier Fernandez-Marques\* Department of Computer Science University of Oxford
|
| 8 |
+
|
| 9 |
+
Nicholas D. Lane
|
| 10 |
+
Department of Computer Science and Technology
|
| 11 |
+
University of Cambridge
|
| 12 |
+
& Samsung AI Center
|
| 13 |
+
|
| 14 |
+
# ABSTRACT
|
| 15 |
+
|
| 16 |
+
Graph neural networks (GNNs) have demonstrated strong performance on a wide variety of tasks due to their ability to model non-uniform structured data. Despite their promise, there exists little research exploring methods to make them more efficient at inference time. In this work, we explore the viability of training quantized GNNs, enabling the usage of low precision integer arithmetic during inference. For GNNs seemingly unimportant choices in quantization implementation cause dramatic changes in performance. We identify the sources of error that uniquely arise when attempting to quantize GNNs, and propose an architecturally-agnostic and stable method, Degree-Quant, to improve performance over existing quantizationaware training baselines commonly used on other architectures, such as CNNs. We validate our method on six datasets and show, unlike previous attempts, that models generalize to unseen graphs. Models trained with Degree-Quant for INT8 quantization perform as well as FP32 models in most cases; for INT4 models, we obtain up to $26 \%$ gains over the baselines. Our work enables up to $4 . 7 \times$ speedups on CPU when using INT8 arithmetic.
|
| 17 |
+
|
| 18 |
+
# 1 INTRODUCTION
|
| 19 |
+
|
| 20 |
+
GNNs have received substantial attention in recent years due to their ability to model irregularly structured data. As a result, they are extensively used for applications as diverse as molecular interactions (Duvenaud et al., 2015; Wu et al., 2017), social networks (Hamilton et al., 2017), recommendation systems (van den Berg et al., 2017) or program understanding (Allamanis et al., 2018). Recent advancements have centered around building more sophisticated models including new types of layers (Kipf & Welling, 2017; Velickovic et al., 2018; Xu et al., 2019) and better aggregation functions (Corso et al., 2020). However, despite GNNs having few model parameters, the compute required for each application remains tightly coupled to the input graph size. A 2-layer Graph Convolutional Network (GCN) model with 32 hidden units would result in a model size of just 81KB but requires 19 GigaOPs to process the entire Reddit graph. We illustrate this growth in fig. 1.
|
| 21 |
+
|
| 22 |
+
One major challenge with graph architectures is therefore performing inference efficiently, which limits the applications they can be deployed for. For example, GNNs have been combined with CNNs for SLAM feature matching (Sarlin et al., 2019), however it is not trivial to deploy this technique on smartphones, or even smaller devices, whose neural network accelerators often do not implement floating point arithmetic, and instead favour more efficient integer arithmetic. Integer quantization is one way to lower the compute, memory and energy budget required to perform inference, without requiring modifications to the model architecture; this is also useful for model serving in data centers.
|
| 23 |
+
|
| 24 |
+
Although quantization has been well studied for CNNs and language models (Jacob et al., 2017; Wang et al., 2018; Zafrir et al., 2019; Prato et al., 2019), there remains relatively little work addressing
|
| 25 |
+
|
| 26 |
+

|
| 27 |
+
Figure 1: Despite GNN model sizes rarely exceeding 1MB, the OPs needed for inference grows at least linearly with the size of the dataset and node features. GNNs with models sizes $1 0 0 \times$ smaller than popular CNNs require many more OPs to process large graphs.
|
| 28 |
+
|
| 29 |
+

|
| 30 |
+
Figure 2: While CNNs operate on regular grids, GNNs operate on graphs with varying topology. A node’s neighborhood size and ordering varies for GNNs. Both architectures use weight sharing.
|
| 31 |
+
|
| 32 |
+
GNN efficiency (Mukkara et al., 2018; Jia et al., 2020; Zeng & Prasanna, 2020; Yan et al., 2020). To the best of our knowledge, there is no work explicitly characterising the issues that arise when quantizing GNNs or showing latency benefits of using low-precision arithmetic. The recent work of Wang et al. (2020) explores only binarized embeddings of a single graph type (citation networks). In Feng et al. (2020) a heterogeneous quantization framework assigns different bits to embedding and attention coefficients in each layer while maintaining the weights at full precision (FP32). Due to the mismatch in operands’ bit-width the majority of the operations are performed at FP32 after data casting, making it impractical to use in general purpose hardware such as CPUs or GPUs. In addition they do not demonstrate how to train networks which generalize to unseen input graphs. Our framework relies upon uniform quantization applied to all elements in the network and uses bit-widths (8-bit and 4-bit) that are supported by off-the-shelf hardware such as CPUs and GPU for which efficient low-level operators for common operations found in GNNs exists.
|
| 33 |
+
|
| 34 |
+
This work considers the motivations and problems associated with quantization of graph architectures, and provides the following contributions:
|
| 35 |
+
|
| 36 |
+
• The explanation of the sources of degradation in GNNs when using lower precision arithmetic. We show how the choice of straight-through estimator (STE) implementation, node degree, and method for tracking quantization statistics significantly impacts performance. • An architecture-agnostic method for quantization-aware training on graphs, Degree-Quant (DQ), which results in INT8 models often performing as well as their FP32 counterparts. At INT4, models trained with DQ typically outperform quantized baselines by over $20 \%$ . We show, unlike previous work, that models trained with DQ generalize to unseen graphs. We provide code at this URL: https://github.com/camlsys/degree-quant. • We show that quantized networks achieve up to $4 . 7 \times$ speedups on CPU with INT8 arithmetic, relative to full precision floating point, with $4 { - } 8 \times$ reductions in runtime memory usage.
|
| 37 |
+
|
| 38 |
+
# 2 BACKGROUND
|
| 39 |
+
|
| 40 |
+
# 2.1 MESSAGE PASSING NEURAL NETWORKS (MPNNS)
|
| 41 |
+
|
| 42 |
+
Many popular GNN architectures may be viewed as generalizations of CNN architectures to an irregular domain: at a high level, graph architectures attempt to build representations based on a node’s neighborhood (see fig. 2). Unlike CNNs, however, this neighborhood does not have a fixed ordering or size. This work considers GNN architectures conforming to the MPNN paradigm (Gilmer et al., 2017). A graph $\mathcal { G } = ( V , E )$ has node features $\mathbf { X } \in \mathbb { R } ^ { N \times F }$ , an incidence matrix $\mathbf { I } \in \breve { \mathbb { N } } ^ { 2 \times E }$ , and optionally $D$ dimensional edge features $\mathbf { E } \in \mathbb { R } ^ { E \times D }$ . The forward pass through an MPNN layer consists of message passing, aggregation and update phases: $\mathbf h _ { l + 1 } ^ { ( i ) } = \gamma ( \bar { \mathbf h _ { l } ^ { ( i ) } } , \bigwedge _ { j \in \mathcal { N } ( i ) } [ \phi ( \mathbf h _ { l } ^ { ( j ) } , \mathbf h _ { l } ^ { ( i ) } , \mathbf e _ { i j } ) ] )$ . Messages from node $u$ to node $v$ are calculated using function $\phi$ , and are aggregated using a permutation-invariant function $\Lambda$ . The features at $v$ are subsequently updated using $\gamma$ .
|
| 43 |
+
|
| 44 |
+
We focus on three architectures with corresponding update rules:
|
| 45 |
+
|
| 46 |
+
1. Graph Convolution Network (GCN): $\begin{array} { r } { \mathbf { h } _ { l + 1 } ^ { ( i ) } = \sum _ { j \in \mathcal { N } ( i ) \cup \{ i \} } ( \frac { 1 } { \sqrt { d _ { i } d _ { j } } } \mathbf { W } \mathbf { h } _ { l } ^ { ( j ) } ) } \end{array}$ Wh(j)l ) (Kipf & Welling, 2017), where $d _ { i }$ refers to the degree of node $i$ .
|
| 47 |
+
2. Graph Attention Network (GAT): $\begin{array} { r } { \mathbf { h } _ { l + 1 } ^ { ( i ) } = \alpha _ { i , i } \mathbf { W } \mathbf { h } _ { l } ^ { ( i ) } + \sum _ { j \in \mathcal { N } ( i ) } ( \alpha _ { i , j } \mathbf { W } \mathbf { h } _ { l } ^ { ( j ) } ) } \end{array}$ , where $\alpha$ represent attention coefficients (Velickovic et al., 2018).
|
| 48 |
+
3. Graph Isomorphism Network (GIN): $\begin{array} { r } { \mathbf { h } _ { l + 1 } ^ { ( i ) } = f _ { \Theta } [ ( 1 + \epsilon ) \mathbf { h } _ { l } ^ { ( i ) } + \sum _ { j \in \mathcal { N } ( i ) } \mathbf { h } _ { l } ^ { ( j ) } ] } \end{array}$ , where $f$ is a learnable function (e.g. a MLP) and $\epsilon$ is a learnable constant ( $\mathrm { { X u } }$ et al., 2019).
|
| 49 |
+
|
| 50 |
+
# 2.2 QUANTIZATION FOR NON-GRAPH NEURAL NETWORKS
|
| 51 |
+
|
| 52 |
+
Quantization allows for model size reduction and inference speedup without changing the model architecture. While there exists extensive studies of the impact of quantization at different bitwidths (Courbariaux et al., 2015; Han et al., 2015; Louizos et al., 2017) and data formats (Micikevicius et al., 2017; Carmichael et al., 2018; Kalamkar et al., 2019), it is 8-bit integer (INT8) quantization that has attracted the most attention. This is due to INT8 models reaching comparable accuracy levels to FP32 models (Krishnamoorthi, 2018; Jacob et al., 2017), offer a $4 \times$ model compression, and result in inference speedups on off-the-shelf hardware as 8-bit arithmetic is widely supported.
|
| 53 |
+
|
| 54 |
+
Quantization-aware training (QAT) has become the de facto approach towards designing robust quantized models with low error (Wang et al., 2018; Zafrir et al., 2019; Wang et al., 2018). In their simplest forms, QAT schemes involve exposing the numerical errors introduced by quantization by simulating it on the forward pass Jacob et al. (2017) and make use of STE (Bengio et al., 2013) to compute the gradients—as if no quantization had been applied. For integer QAT, the quantization of a tensor $x$ during the forward pass is often implemented as: $x _ { q } = \operatorname* { m i n } ( q _ { \mathrm { m a x } } , \operatorname* { m a x } ( q _ { \mathrm { m i n } } , \lfloor x / s + z \rfloor ) )$ , where $q _ { \mathrm { m i n } }$ and $q _ { \mathrm { m a x } }$ are the minimum and maximum representable values at a given bit-width and signedness, $s$ is the scaling factor making $x$ span the $[ q _ { \mathrm { m i n } } , q _ { \mathrm { m a x } } ]$ range and, $z$ is the zero-point, which allows for the real value 0 to be representable in $x _ { q }$ . Both $s$ and $z$ are scalars obtained at training time. hen, the tensor is dequantized as: $\hat { x } = ( x _ { q } - \overset { \cdot } { z } ) s$ , where the resulting tensor $\hat { x } \sim x$ for a high enough bit-width. This similarity degrades at lower bit-widths. Other variants of integer QAT are presented in Jacob et al. (2017) and Krishnamoorthi (2018).
|
| 55 |
+
|
| 56 |
+
To reach performance comparable to FP32 models, QAT schemes often rely on other techniques such as gradient clipping, to mask gradient updates based on the largest representable value at a given bit-width; stochastic, or noisy, QAT, which stochastically applies QAT to a portion of the weights at each training step (Fan et al., 2020; Dong et al., 2017); or the re-ordering of layers (Sheng et al., 2018; Alizadeh et al., 2019).
|
| 57 |
+
|
| 58 |
+
# 3 QUANTIZATION FOR GNNS
|
| 59 |
+
|
| 60 |
+
In this section, we build an intuition for why GNNs would fail with low precision arithmetic by identifying the sources of error that will disproportionately affect the accuracy of a low precision model. Using this insight, we propose our technique for QAT with GNNs, Degree-Quant. Our analysis focuses on three models: GCN, GAT and GIN. This choice was made as we believe that these are among the most popular graph architectures, with strong performance on a variety of tasks (Dwivedi et al., 2020), while also being representative of different trends in the literature.
|
| 61 |
+
|
| 62 |
+
# 3.1 SOURCES OF ERROR
|
| 63 |
+
|
| 64 |
+
QAT relies upon the STE to make an estimate of the gradient despite the non-differentiable rounding operation in the forward pass. If this approximation is inaccurate, however, then poor performance will be obtained. In GNN layers, we identify the aggregation phase, where nodes combine messages from a varying number of neighbors in a permutation-invariant fashion, as a source of substantial numerical error, especially at nodes with high in-degree. Outputs from aggregation have magnitudes that vary significantly depending on a node’s in-degree: as it increases, the variance of aggregation values will increase.1 Over the course of training $q _ { \mathrm { m i n } }$ and $q _ { \mathrm { m a x } }$ , the quantization range statistics, become severely distorted by infrequent outliers, reducing the resolution for the vast majority of values observed. This reults in increased rounding error for nodes with smaller in-degrees. Controlling $q _ { \mathrm { m i n } }$ and $q _ { \mathrm { m a x } }$ hence becomes a trade-off balancing truncation error and rounding error.
|
| 65 |
+
|
| 66 |
+

|
| 67 |
+
Figure 3: Analysis of values collected immediately after aggregation at the final layer of FP32 GNNs trained on Cora. Generated using channel data collected from 100 runs for each architecture. As in-degree grows, so does the mean and variance of channel values after aggregation.
|
| 68 |
+
|
| 69 |
+
We can derive how the mean and variance of the aggregation output values vary as node in-degree, $n$ , increases for each of the three GNN layers. Suppose we model incoming message values for a single output dimension with random variables $X _ { i }$ , without making assumptions on their exact distribution or independence. Further, we use after the aggregation step. With $Y _ { n }$ as the random va layers, we have $\begin{array} { r } { Y _ { n } = ( \bar { 1 } + \epsilon ) X _ { 0 } \bar { + } \sum _ { i = 1 } ^ { n } X _ { i } } \end{array}$ of node output. It is trivial to prove that $\mathbb { E } ( Y _ { n } ) = { \mathcal { O } } ( n )$ . The variance of the aggregation output is also ${ \mathcal { O } } ( n )$ in the case that that $\begin{array} { r } { \sum _ { i \neq j } \operatorname { C o v } ( X _ { i } , X _ { j } ) \ll \sum _ { i } \operatorname { V a r } ( X _ { i } ) } \end{array}$ . We note that if $\textstyle \sum _ { i \neq j } \mathbf { C o { \bar { v } } } ( X _ { i } , X _ { j } )$ is large then it implies that the network has learned highly redundant features, and may be a sign of over-fitting. Similar arguments can be made for GCN and GAT layers; we would expect GCN aggregation values to grow√ like $\mathcal { O } ( \sqrt { n } )$ , and GAT aggregation values to remain constant $( \mathcal { O } ( 1 ) )$ ) due to the attention coefficients.
|
| 70 |
+
|
| 71 |
+
We empirically validate these predictions on GNNs trained on Cora; results are plotted in fig. 3. We see that the aggregation values do follow the trends predicted, and that for the values of in-degree in the plot (up to 168) the covariance terms can be neglected. As expected, the variance and mean of the aggregated output grow fastest for GIN, and are roughly constant for GAT as in-degree increases. From this empirical evidence, it would be expected that GIN layers are most affected by quantization.
|
| 72 |
+
|
| 73 |
+
By using GIN and GCN as examples, we can see how aggregation error causes error in weight updates. Suppose we consider a GIN layer incorporating one weight matrix in the update function i.e. $\mathcal { N } ( i )$ $\mathbf { h } _ { l + 1 } ^ { ( i ) } = \bar { f } ( \mathbf { W } \mathbf { y } _ { \mathrm { G I N } } ^ { ( i ) } )$ l+1 GIN denotes the in-neighbors of node , where is an activation function, $i$ . Writing $\begin{array} { r } { \mathbf { y } _ { \mathrm { G C N } } ^ { ( i ) } = \sum _ { k \in \mathcal { N } ( i ) } ( \frac { 1 } { \sqrt { d _ { i } d _ { k } } } \mathbf { W } \mathbf { h } _ { l } ^ { ( j ) } ) } \end{array}$ $\begin{array} { r } { \mathbf { y } _ { \mathrm { G I N } } ^ { ( i ) } = ( 1 + \epsilon ) \mathbf { h } _ { l } ^ { ( i ) } + \sum _ { j \in \mathcal { N } ( i ) } \mathbf { h } _ { l } ^ { ( j ) } } \end{array}$ (i) + Pj∈N (i) h(j)l , and , we see that the derivatives of the loss with respect to the weights for GCN and GIN are:
|
| 74 |
+
|
| 75 |
+
# GIN
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\frac { \partial \mathcal { L } } { \partial \mathbf { W } } = \sum _ { i = 1 } ^ { | V | } \left( \frac { \partial \mathcal { L } } { \partial \mathbf { h } _ { l + 1 } ^ { ( i ) } } \circ f ^ { \prime } ( \mathbf { W } \mathbf { y } _ { \mathrm { G I N } } ^ { ( i ) } ) \right) \mathbf { y } _ { \mathrm { G I N } } ^ { ( i ) ^ { \top } } \qquad \frac { \partial \mathcal { L } } { \partial \mathbf { W } } = \sum _ { i = 1 } ^ { | V | } \sum _ { j \in N ( i ) } \frac { 1 } { \sqrt { d _ { i } d _ { j } } } \left( \frac { \partial \mathcal { L } } { \partial \mathbf { h } _ { l + 1 } ^ { ( i ) } } \circ f ^ { \prime } ( \mathbf { y } _ { \mathrm { G C N } } ^ { ( i ) } ) \right) \mathbf { h } _ { l } ^ { ( j ) ^ { \top } }
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
The larger the error in y(i)GIN— caused by aggregation error—the greater the error in the weight gradients for GIN, which results in poorly performing models being obtained. The same argument applies to GCN, with the h(j)l and $\mathbf { y } _ { \mathrm { G C N } } ^ { ( i ) }$ terms introducing aggregation error into the weight updates.
|
| 82 |
+
|
| 83 |
+
# 3.2 OUR METHOD: DEGREE-QUANT
|
| 84 |
+
|
| 85 |
+
To address these sources of error we propose Degree-Quant (DQ), a method for QAT with GNNs.
|
| 86 |
+
We consider both inaccurate weight updates and unrepresentative quantization ranges.
|
| 87 |
+
|
| 88 |
+

|
| 89 |
+
Figure 4: High-level view of the stochastic element of Degree-Quant. Protected (high in-degree) nodes, in blue, operate at full precision, while unprotected nodes (red) operate at reduced precision. High in-degree nodes contribute most to poor gradient estimates, hence they are stochastically protected from quantization more often.
|
| 90 |
+
|
| 91 |
+
<table><tr><td>Algorithm 1 Degree-Quant (DQ). Functions accepting a protective mask m perform only the masked computa- tions at full precision: intermediate tensors are not quantized.At test time protective masking is disabled.In fig.11 (in the Appendix) we show with a diagram how a GCN layers makes use of DQ.</td></tr><tr><td>1: :procedure TRAINFORWARDPASS(G, p) 2: > Calculate mask and quantized weights,O',which all operations share</td></tr><tr><td>3: m ←BERNOULLI(p)</td></tr><tr><td>4: Θ'←QUANTIZE(Θ)</td></tr><tr><td>5: Messages with masked sources are at full precision (excluding weights) 6: M←MESSAGECALCULATE(G,Θ',m) 7: X ←QUANTIZE(AGGREGATE(M,Θ',m), m) >No quantization for masked nodes</td></tr></table>
|
| 92 |
+
|
| 93 |
+
Stochastic Protection from Quantization to Improve Weight Update Accuracy. DQ aims to encourage more accurate weight updates by stochastically protecting nodes in the network from quantization. At each layer a protective node mask is generated; all masked nodes have the phases of the message passing, aggregation and update performed at full precision. This includes messages sent by protected nodes to other nodes, as shown in fig. 4 (a detailed diagram is shown in fig. 11). It is also important to note that the weights used at all nodes are the same quantized weights; this is motivated by the fact that our method is used to encourage more accurate gradients to flow back to the weights through high in-degree nodes. At test time protection is disabled: all nodes operate at low precision.
|
| 94 |
+
|
| 95 |
+
To generate the mask, we pre-process each graph before training and create a vector of probabilities p with length equal to the number of nodes. At training time, mask $\mathbf { m }$ is generated by sampling using the Bernoulli distribution: $\mathbf { m } \sim$ Bernoulli $\mathbf { \tau } ( \mathbf { p } )$ . In our scheme $p _ { i }$ is higher if the in-degree of node $i$ is large, as we find empirically that high in-degree nodes contribute most towards error in weight updates. We use a scheme with two hyperparameters, $p _ { \mathrm { m i n } }$ and $p _ { \mathrm { m a x } }$ ; nodes with the maximum in-degree are assigned $p _ { \mathrm { m a x } }$ as their masking probability, with all other nodes assigned a probability calculated by interpolating between $p _ { \mathrm { m i n } }$ and $p _ { \mathrm { m a x } }$ based on their in-degree ranking in the graph.
|
| 96 |
+
|
| 97 |
+
Percentile Tracking of Quantization Ranges. Figure 3 demonstrates large fluctuations in the variance of the aggregation output as in-degree increases. Since these can disproportionately affect the ranges found by using min-max or momentum-based quantization, we propose using percentiles. While percentiles have been used for post-training quantization (Wu et al., 2020), we are the first (to the best of our knowledge) to propose making it a core part of QAT; we find it to be a key contributor to achieving consistent results with graphs. Using percentiles involves ordering the values in the tensor and clipping a fraction of the values at both ends of the distribution. The fraction to clip is a hyperparameter. We are more aggressive than existing literature on the quantity we discard: we clip the top and bottom $0 . 1 \%$ , rather than $0 . 0 1 \%$ , as we observe the fluctuations to be a larger issue with GNNs than with CNNs or DNNs. Quantization ranges are more representative of the vast majority of values in this scheme, resulting in less rounding error.
|
| 98 |
+
|
| 99 |
+
We emphasize that a core contribution of DQ is that it is architecture-agnostic. Our method enables a wide variety of architectures to use low precision arithmetic at inference time. Our method is also orthogonal—and complementary—to other techniques for decreasing GNN computation requirements, such as sampling based methods which are used to reduce memory consumption (Zeng et al., 2020), or weight pruning (Blalock et al., 2020) approaches to achieve further model compression.
|
| 100 |
+
|
| 101 |
+
<table><tr><td rowspan="3">Dataset</td><td rowspan="3">Model</td><td colspan="4">vanilla STE</td><td colspan="4">STE with Gradient Clipping</td></tr><tr><td colspan="2">min/max W8A8</td><td colspan="2">momentum</td><td colspan="2">min/max</td><td colspan="2">momentum</td></tr><tr><td>Arch.</td><td>W4A4</td><td>W8A8</td><td>W4A4</td><td>W8A8</td><td>W4A4</td><td>W8A8</td><td>W4A4</td></tr><tr><td rowspan="4">Cora (Acc.%)↑</td><td>GCN</td><td>81.0±0.7</td><td>65.3± 4.9</td><td>42.3 ± 11.1</td><td>49.4±8.8</td><td>80.8±0.8</td><td>62.3±5.2</td><td>66.9± 18.2</td><td>77.2±2.5</td></tr><tr><td>GAT</td><td>76.0± 2.2</td><td>16.8 ± 8.5</td><td>81.7 ± 1.3</td><td>51.7±5.8</td><td>76.4 ± 2.6</td><td>15.4 ± 8.1</td><td>81.9±0.7</td><td>47.4± 5.0</td></tr><tr><td>GIN</td><td>69.9 ± 1.9</td><td>25.9 ±2.6</td><td>49.2 ± 10.2</td><td>42.8±4.0</td><td>69.2 ± 2.3</td><td>29.5 ± 3.5</td><td>75.1 ±1.1</td><td>40.5 ± 5.0</td></tr><tr><td>GCN</td><td>90.4±0.2</td><td>51.3± 7.5</td><td>90.1±0.5</td><td>70.6±2.4</td><td>90.4±0.3</td><td>54.8 ± 1.5</td><td>90.2±0.4</td><td>10.3±0.0</td></tr><tr><td rowspan="3">MNIST (Acc.%)↑</td><td>GAT</td><td>95.8 ± 0.1</td><td>20.1± 3.3</td><td>95.7 ± 0.3</td><td>67.4±3.2</td><td>95.7 ±0.1</td><td>30.2 ± 7.4</td><td>95.7 ± 0.3</td><td>76.3 ±1.2</td></tr><tr><td>GIN</td><td>96.5±0.3</td><td>62.4 ± 21.8</td><td>96.7±0.2</td><td>91.0 ±0.6</td><td>96.4 ±0.4</td><td>19.5 ± 2.1</td><td>75.3 ± 18.1</td><td>10.8±0.9</td></tr><tr><td>GCN</td><td>0.486 ± 0.01</td><td>0.747± 0.02</td><td>0.509 ±0.01</td><td>0.710±0.05</td><td>0.495 ± 0.01</td><td>0.766±0.02</td><td>0.483 ±0.01</td><td>0.692 ±0.01</td></tr><tr><td rowspan="2">ZINC (Loss)↓</td><td>GAT</td><td>0.471 ± 0.01</td><td>0.740± 0.02</td><td>0.571 ± 0.03</td><td>0.692 ±0.06</td><td>0.466 ± 0.01</td><td>0.759 ± 0.04</td><td>0.463 ± 0.01</td><td>0.717±0.03</td></tr><tr><td>GIN</td><td>0.393±0.02</td><td>1.206 ± 0.27</td><td>0.386 ±0.03</td><td>0.572 ±0.02</td><td>0.390±0.02</td><td>1.669 ± 0.10</td><td>0.388±0.02</td><td>0.973± 0.24</td></tr></table>
|
| 102 |
+
|
| 103 |
+
Table 1: Impact on performance of four typical quantization implementations for INT8 and INT4. The configuration that resulted in best performing models for each dataset-model pair is bolded. Hyperparameters for each experiment were fine-tuned independently. As expected, adding clipping does not change performance with min/max but does with momentum. A major contribution of this work is identifying that seemingly unimportant choices in quantization implementation cause dramatic changes in performance.
|
| 104 |
+
|
| 105 |
+
# 4 EXPERIMENTS
|
| 106 |
+
|
| 107 |
+
In this section we first analyse how the choice of quantization implementation affects performance of GNNs. We subsequently evaluate Degree-Quant against the strong baselines of: FP32, INT8-QAT and, INT8-QAT with stochastic masking of weights (Fan et al., 2020). We refer to this last approach as noisy QAT or nQAT. To make explicit that we are quantizing both weights and activations, we use the notation W8A8. We repeat the experiments at INT4. Our study evaluates performance on six datasets and includes both node-level and graph-level tasks. The datasets used were Cora, CiteSeer, ZINC, MNIST and CIFAR10 superpixels, and REDDIT-BINARY. Across all datasets INT8 models trained with Degree-Quant manage to recover most of the accuracy lost as a result of quantization. In some instances, DQ-INT8 outperform the extensively tuned FP32 baselines. For INT4, DQ outperforms all QAT baselines and results in double digits improvements over QAT-INT4 in some settings. Details about each dataset and our experimental setup can be found in appendix A.1.
|
| 108 |
+
|
| 109 |
+
# 4.1 IMPACT OF QUANTIZATION GRADIENT ESTIMATOR ON CONVERGENCE
|
| 110 |
+
|
| 111 |
+
The STE is a workaround for when the forward pass contains non-differentiable operations (e.g. rounding in QAT) that has been widely adopted in practice. While the choice of STE implementation generally results in marginal differences for CNNs—even for binary networks (Alizadeh et al., 2019)—it is unclear whether only marginal differences will also be observed for GNNs. Motivated by this, we study the impact of four off-the-shelve quantization procedures on the three architectures evaluated for each type of dataset; the implementation details of each one is described in appendix A.3. We perform this experiment to ensure that we have the strongest possible QAT baselines. Results are shown in table 1. We found the choice quantization implementation to be highly dependent on the model architecture and type of problem to be solved: we see a much larger variance than is observed with CNNs; this is an important discovery for future work building on our study.
|
| 112 |
+
|
| 113 |
+
We observe a general trend in all INT4 experiments benefiting from momentum as it helps smoothing out the quantization statistics for the inherently noisy training stage at low bitwidths. This trend applies as well for the majority of INT8 experiments, while exhibiting little impact on MNIST. For INT8 Cora-GCN, large gradient norm values in the early stages of training (see fig. 5) mean that these models not benefit from momentum as quantization ranges fail to keep up with the rate of changes in tensor values; higher momentum can help but also leads to instability. In contrast, GAT has stable initial training dynamics, and hence obtains better results with momentum. For the molecules dataset ZINC, we consistently obtained lower regression loss when using momentum. We note that GIN models often suffer from higher performance degradation (as was first noted in fig. 3), specially at W4A4. This is not the case however for image datasets using superpixels. We believe that datasets with Gaussian-like node degree distributions (see fig. 9) are more tolerant of the imprecision introduced by quantization, compared to datasets with tailed distributions. We leave more in-depth analysis of how graph topology affects quantization as future work.
|
| 114 |
+
|
| 115 |
+
Table 2: This table is divided into three sets of rows with FP32 baselines at the top. We provide two baselines for INT8 and INT4: standard QAT and stochastic QAT (nQAT). Both are informed by the analysis in 4.1, with nQAT achieving better performance in some cases. Models trained with Degree-Quant (DQ) are always comparable to baselines, and usually substantially better, especially for INT4. DQ is a stable method which requires little tuning to obtain excellent results across a variety of architectures and datasets.
|
| 116 |
+
|
| 117 |
+
<table><tr><td rowspan="2">Quant. Scheme</td><td rowspan="2">Model Arch.</td><td colspan="2">Node Classification (Accuracy %)</td><td colspan="2">Graph Classification (Accuracy %)</td><td rowspan="2">Graph Regression (Loss) ZINC↓</td></tr><tr><td>Cora↑</td><td>Citeseer↑</td><td>MNIST↑</td><td>CIFAR-10个</td></tr><tr><td rowspan="3">Ref. (FP32)</td><td>GCN</td><td>81.4± 0.7</td><td>71.1 ± 0.7</td><td>90.0±0.2</td><td>54.5 ±0.1</td><td>0.469 ±0.002</td></tr><tr><td>GAT</td><td>83.1 ± 0.4</td><td>72.5 ±0.7</td><td>95.6 ±0.1</td><td>65.4 ± 0.4</td><td>0.463 ± 0.002</td></tr><tr><td>GIN</td><td>77.6 ± 1.1</td><td>66.1±0.9</td><td>93.9±0.6</td><td>53.3 ±3.7</td><td>0.414 ± 0.009</td></tr><tr><td rowspan="3">Ours (FP32)</td><td>GCN</td><td>81.2 ±0.6</td><td>71.4 ± 0.9</td><td>90.9 ± 0.4</td><td>58.4± 0.5</td><td>0.450 ±0.008</td></tr><tr><td>GAT</td><td>83.2±0.3</td><td>72.4±0.8</td><td>95.8±0.4</td><td>65.1±0.8</td><td>0.455 ± 0.006</td></tr><tr><td>GIN</td><td>77.9 ± 1.1</td><td>65.8 ± 1.5</td><td>96.4±0.4</td><td>57.4±0.7</td><td>0.334 ± 0.024</td></tr><tr><td rowspan="3">QAT (W8A8)</td><td>GCN</td><td>81.0±0.7</td><td>71.3 ± 1.0</td><td>90.9 ±0.2</td><td>56.4± 0.5</td><td>0.481 ± 0.029</td></tr><tr><td>GAT</td><td>81.9 ±0.7</td><td>71.2 ± 1.0</td><td>95.8 ±0.3</td><td>66.3±0.4</td><td>0.460 ± 0.005</td></tr><tr><td>GIN</td><td>75.6 ±1.2</td><td>63.0±2.6</td><td>96.7±0.2</td><td>52.4 ± 1.2</td><td>0.386 ±0.025</td></tr><tr><td rowspan="3">nQAT (W8A8)</td><td>GCN</td><td>81.0±0.8</td><td>70.7 ±0.8</td><td>91.1 ± 0.1</td><td>56.2 ± 0.5</td><td>0.472 ± 0.015</td></tr><tr><td>GAT</td><td>82.5±0.5</td><td>71.2± 0.7</td><td>96.0 ±0.1</td><td>66.7 ± 0.2</td><td>0.459 ± 0.007</td></tr><tr><td>GIN</td><td>77.4 ± 1.3</td><td>65.1 ± 1.4</td><td>96.4±0.3</td><td>52.7 ±1.4</td><td>0.405 ± 0.016</td></tr><tr><td rowspan="3">DQ (W8A8)</td><td>GCN</td><td>81.7 ± 0.7 (+0.7)</td><td>71.0 ± 0.9 (-0.3)</td><td>90.9 ± 0.2 (-0.2)</td><td>56.3 ± 0.1 (-0.1)</td><td>0.434 ± 0.009 (+9.8)</td></tr><tr><td>GAT</td><td>82.7 ± 0.7 (+0.2)</td><td>71.6 ± 1.0 (+0.4)</td><td>95.8 ± 0.4(-0.2)</td><td>67.7 ± 0.5 (+1.0)</td><td>0.456 ± 0.005 (+0.9)</td></tr><tr><td>GIN</td><td>78.7 ± 1.4(+1.3)</td><td>67.5 ± 1.4 (+2.4)</td><td>96.6 ± 0.1 (-0.1)</td><td>55.5 ± 0.6(+2.8)</td><td>0.357 ± 0.014 (+7.5)</td></tr><tr><td rowspan="3">QAT (W4A4)</td><td>GCN</td><td>77.2 ±2.5</td><td>64.1 ± 4.1</td><td>70.6 ±2.4</td><td>38.1 ± 1.6</td><td>0.692 ± 0.013</td></tr><tr><td>GAT</td><td>55.6 ± 5.4</td><td>65.3±1.9</td><td>76.3 ± 1.2</td><td>41.0 ± 1.1</td><td>0.655 ± 0.032</td></tr><tr><td>GIN</td><td>42.5± 4.5</td><td>18.6±2.9</td><td>91.0 ±0.6</td><td>45.6±3.6</td><td>0.572 ±0.02</td></tr><tr><td rowspan="3">nQAT (W4A4)</td><td>GCN</td><td></td><td>65.8±2.6</td><td></td><td></td><td></td></tr><tr><td>GAT</td><td>78.1 ± 1.5 54.9 ± 5.6</td><td></td><td>70.9 ±1.5</td><td>40.1 ±0.7</td><td>0.669 ± 0.128</td></tr><tr><td>GIN</td><td>45.0±5.0</td><td>65.5 ± 1.7 34.6 ±3.8</td><td>78.4 ± 1.5 91.3 ±0.5</td><td>41.0 ± 0.6 48.7 ±1.7</td><td>0.637 ± 0.012 0.561 ± 0.068</td></tr><tr><td rowspan="3">DQ (W4A4)</td><td>GCN</td><td>78.3 ± 1.7 (+0.2)</td><td>66.9 ± 2.4 (+1.1)</td><td>84.4 ± 1.3(+13.5)</td><td></td><td></td></tr><tr><td>GAT</td><td>71.2 ± 2.9 (+16.3)</td><td>67.6 ± 1.5 (+2.1)</td><td>93.1 ± 0.3(+14.7)</td><td>51.1 ± 0.7(+11.0) 56.5 ± 0.6(+15.5)</td><td>0.536 ± 0.011 (+26.2) 0.520 ± 0.021 (+20.6)</td></tr><tr><td>GIN</td><td>69.9 ± 3.4 (+24.9)</td><td>60.8 ± 2.1(+26.2)</td><td>95.5 ± 0.4(+4.2)</td><td>50.7 ± 1.6 (+2.0)</td><td>0.431 ± 0.012 (+23.2)</td></tr></table>
|
| 118 |
+
|
| 119 |
+
# 4.2 OBTAINING QUANTIZATION BASELINES
|
| 120 |
+
|
| 121 |
+
Our FP32 results, which we obtain after extensive hyperparameter tuning, and those from the baselines are shown at the top of table 2. We observed large gains on MNIST, CIFAR10 and, ZINC.
|
| 122 |
+
|
| 123 |
+
For our QAT-INT8 and QAT-INT4 baselines, we use the quantization configurations informed by our analysis in section 4.1. For Citeseer we use the best resulting setup analysed for Cora, and for CIFAR10 that from MNIST. Then, the hyperparameters for each experiment were fine tuned individually, including noise rate $n \in [ 0 . 5 , 0 . 9 5 ]$ for nQAT experiments. QAT-INT8 and QAT-INT4 results in table 2 and QAT-INT4, with the exception of MNIST (an easy to classify dataset), corroborate our hypothesis that GIN layers are less resilient to quantization. This was first observed in fig. 3. In the case of ZINC, while all models results in noticeable degradation, GIN sees a more severe $1 6 \%$ increase of regression loss compared to our FP32 baseline. For QAT W4A4 an accuracy drop of over $3 5 \%$ and $4 7 \%$ is observed for Cora and Citeseer respectively. The stochasticity induced by nQAT helped in recovering some of the accuracy lost as a result of quantization for citation networks (both INT8 and INT4) but had little impact on other datasets and harmed performance in some cases.
|
| 124 |
+
|
| 125 |
+
# 4.3 COMPARISONS OF DEGREE-QUANT WITH EXISTING QUANTIZATION APPROACHES
|
| 126 |
+
|
| 127 |
+
Degree-Quant provides superior quantization for all GNN datasets and architectures. Our results with DQ are highlighted in gray in table 2 and table 3. Citation networks trained with DQ for W8A8 manage to recover most of the accuracy lost as a result of QAT and outperform most of nQAT baselines. In some instances DQ-W8A8 models outperform the reference FP32 baselines. At 4-bits, DQ results in even larger gains compared to W4A4 baselines. We see DQ being more effective for GIN layers, outperforming INT4 baselines for Cora $( + 2 4 . 9 \% )$ ), Citeseer $( + 2 6 . 2 \% )$ and REDDITBINARY $( + 2 3 . 0 \% )$ by large margins. Models trained with DQ at W4A4 for graph classification and graph regression also exhibit large performance gains (of over $1 0 \%$ ) in most cases. For ZINC, all models achieve over $2 0 \%$ lower regression loss. Among the top performing models using DQ, ratios of $p _ { \mathrm { m i n } }$ and $p _ { \mathrm { m a x } }$ in [0.0, 0.2] were the most common. Figure 10 in the appendix shows validation loss curves for GIN models trained using different DQ probabilities on the REDDIT-BINARY dataset.
|
| 128 |
+
|
| 129 |
+
Table 3: Results for DQ-INT8 GIN models perform nearly as well as at FP32. For INT4, DQ offers a significant increase in accuracy.
|
| 130 |
+
|
| 131 |
+
<table><tr><td>Quantization</td><td>Model</td><td>REDDIT-BIN (Acc.%)↑</td></tr><tr><td>Ref. (FP32)</td><td>GIN</td><td>92.2±2.3</td></tr><tr><td>Ours (FP32)</td><td>GIN</td><td>92.0 ±1.5</td></tr><tr><td>QAT-W8A8</td><td>GIN</td><td>76.1 ± 7.5</td></tr><tr><td>nQAT-W8A8</td><td>GIN</td><td>77.5±3.4</td></tr><tr><td>DQ-W8A8</td><td>GIN</td><td>91.8 ± 2.3 (+14.3)</td></tr><tr><td>QAT-W4A4</td><td>GIN</td><td>54.4± 6.6</td></tr><tr><td>nQAT-W4A4</td><td>GIN</td><td>58.0±6.3</td></tr><tr><td>DQ-W4A4</td><td>GIN</td><td>81.3 ± 4.4(+23.0)</td></tr></table>
|
| 132 |
+
|
| 133 |
+
Table 4: INT8 latency results run on a 22 core 2.1GHz Intel Xeon Gold 6152 and, on a GTX 1080Ti GPU. Quantization provides large speedups on a variety of graphs for CPU and non-negligible speedups with unoptimized INT8 GPU kernels.
|
| 134 |
+
|
| 135 |
+
<table><tr><td rowspan="2">Device</td><td rowspan="2">Arch.</td><td colspan="3">Zinc (Batch=10K)</td><td colspan="3">Reddit</td></tr><tr><td>FP32</td><td>W8A8</td><td>Speedup</td><td>FP32</td><td>W8A8</td><td>Speedup</td></tr><tr><td rowspan="4">CPU</td><td>GCN</td><td>181ms</td><td>42ms</td><td>4.3×</td><td>13.1s</td><td>3.1s</td><td>4.2×</td></tr><tr><td>GAT</td><td>190ms</td><td>50ms</td><td>3.8×</td><td>13.1s</td><td>2.8s</td><td>4.7×</td></tr><tr><td>GIN</td><td>182ms</td><td>43ms</td><td>4.2×</td><td>13.1s</td><td>3.1s</td><td>4.2×</td></tr><tr><td>GCN</td><td>39ms</td><td>31ms</td><td>1.3×</td><td>191ms</td><td></td><td>1.1×</td></tr><tr><td rowspan="3">GPU</td><td>GAT</td><td>17ms</td><td>15ms</td><td>1.1×</td><td>OOM</td><td>176ms OOM</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>-</td></tr><tr><td>GIN</td><td>39ms</td><td>31ms</td><td>1.3×</td><td>191ms</td><td>176ms</td><td>1.1×</td></tr></table>
|
| 136 |
+
|
| 137 |
+
# 5 DISCUSSION
|
| 138 |
+
|
| 139 |
+
Latency and Memory Implications. In addition to offering significantly lower memory usage $4 \times$ with INT8), quantization can reduce latency—especially on CPUs. We found that with INT8 arithmetic we could accelerate inference by up to $4 . 7 \times$ . We note that the latency benefit depends on the graph topology and feature dimension, therefore we ran benchmarks on a variety of graph datasets, including Reddit2, Zinc, Cora, Citeseer, and CIFAR-10; Zinc and Reddit results are shown in table 4, with further results given in the appendix. For a GCN layer with in- and out-dimension of 128, we get speed-ups of: $4 . 3 \times$ on Reddit, $2 . 5 \times$ on Zinc, $1 . 3 \times$ on Cora, $1 . 3 \times$ on Citeseer and, $2 . 1 \times$ on CIFAR-10. It is also worth emphasizing that quantized networks are necessary to efficiently use accelerators deployed in smartphones and smaller devices as they primarily accelerate integer arithmetic, and that CPUs remain a common choice for model serving on servers. The decrease in latency on CPUs is due to improved cache performance for the sparse operations; GPUs, however, see less benefit due to their massively-parallel nature which relies on mechanisms other than caching to hide slow random memory accesses, which are unavoidable in this application.
|
| 140 |
+
|
| 141 |
+

|
| 142 |
+
Figure 5: $q _ { \mathrm { m a x } }$ with absolute min/max and percentile ranges, applied to INT8 GCN training on Cora. We observe that the percentile max is half that of the absolute, doubling resolution for the majority of values.
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 6: Analysis of how INT8 GAT performance degrades on Cora as individual elements are reduced to 4-bit precision without $D Q$ . For GAT the message elements are crucial to classification performance.
|
| 146 |
+
|
| 147 |
+
Ablation Study: Benefits of Percentile Ranges. Figure 5 shows the value of percentiles during training. We see that when using absolute min/max the upper range grows to over double the range required for $9 9 . 9 \%$ of values, effectively halving the resolution of the quantized values. DQ is more stable, and we obtained strong results with an order of magnitude less tuning relative to the baselines.
|
| 148 |
+
|
| 149 |
+
Ablation Study: Source of Degradation at INT4. Figure 6 assesses how INT8 GAT (without DQ) degrades as single elements are converted to INT4, in order to understand the precipitous drop in accuracy in the INT4 baselines; further plots for GCN and GIN are included in the appendix. We observe that most elements cause only modest performance losses relative to a full INT8 model. DQ is most important to apply to elements which are constrained by numerical precision, such as the aggregation and message elements in GAT. Weight elements, however, are consistently unaffected.
|
| 150 |
+
|
| 151 |
+
Ablation Study: Effect of Stochastic Element in Degree-Quant. We observe that the stochastic protective masking in DQ alone often achieves most of the performance gain over the QAT baseline; results are given in table 9 in the appendix. The benefit of the percentile-based quantization ranges is stability, although it can yield some performance gains. The full DQ method provides consistently good results on all architectures and datasets, without requiring an extensive analysis as in 4.1.
|
| 152 |
+
|
| 153 |
+
# 6 CONCLUSION
|
| 154 |
+
|
| 155 |
+
This work has presented Degree-Quant, an architecture-agnostic and stable method for training quantized GNN models that can be accelerated using off-the-shelf hardware. With 4-bit weights and activations we achieve $8 \times$ compression while surpassing strong baselines by margins regularly exceeding $20 \%$ . At 8-bits, models trained with DQ perform on par or better than the baselines while achieving up to $4 . 7 \times$ lower latency than FP32 models. Our work offers a comprehensive foundation for future work in this area and is a first step towards enabling GNNs to be deployed more widely, including to resource constrained devices such as smartphones.
|
| 156 |
+
|
| 157 |
+
# ACKNOWLEDGEMENTS
|
| 158 |
+
|
| 159 |
+
This work was supported by Samsung AI and by the UK’s Engineering and Physical Sciences Research Council (EPSRC) with grants EP/M50659X/1 and EP/S001530/1 (the MOA project) and the European Research Council via the REDIAL project.
|
| 160 |
+
|
| 161 |
+
# REFERENCES
|
| 162 |
+
|
| 163 |
+
R. Achanta, A. Shaji, K. Smith, A. Lucchi, P. Fua, and S. Süsstrunk. Slic superpixels compared to state-of-the-art superpixel methods. IEEE Transactions on Pattern Analysis and Machine Intelligence, 34(11):2274–2282, 2012.
|
| 164 |
+
Milad Alizadeh, Javier Fernández-Marqués, Nicholas D. Lane, and Yarin Gal. A empirical study of binary neural networks’ optimisation. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id $=$ rJfUCoR5KX.
|
| 165 |
+
Milad Alizadeh, Arash Behboodi, Mart van Baalen, Christos Louizos, Tijmen Blankevoort, and Max Welling. Gradient $\ell _ { 1 }$ regularization for quantization robustness. arXiv preprint arXiv:2002.07520, 2020.
|
| 166 |
+
Miltiadis Allamanis, Marc Brockschmidt, and Mahmoud Khademi. Learning to represent programs with graphs. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net, 2018. URL https://openreview. net/forum?id $\equiv$ BJOFETxR-.
|
| 167 |
+
Yoshua Bengio, Nicholas Léonard, and Aaron Courville. Estimating or propagating gradients through stochastic neurons for conditional computation, 2013.
|
| 168 |
+
Davis Blalock, Jose Javier Gonzalez Ortiz, Jonathan Frankle, and John Guttag. What is the state of neural network pruning?, 2020.
|
| 169 |
+
Zachariah Carmichael, Hamed F. Langroudi, Char Khazanov, Jeffrey Lillie, John L. Gustafson, and Dhireesha Kudithipudi. Deep positron: A deep neural network using the posit number system, 2018.
|
| 170 |
+
Gabriele Corso, Luca Cavalleri, Dominique Beaini, Pietro Liò, and Petar Velickovi ˇ c. Principal neighbourhood ´ aggregation for graph nets, 2020.
|
| 171 |
+
Matthieu Courbariaux, Yoshua Bengio, and Jean-Pierre David. Binaryconnect: Training deep neural networks with binary weights during propagations, 2015.
|
| 172 |
+
Yinpeng Dong, Renkun Ni, Jianguo Li, Yurong Chen, Jun Zhu, and Hang Su. Learning accurate low-bit deep neural networks with stochastic quantization, 2017.
|
| 173 |
+
|
| 174 |
+
David K Duvenaud, Dougal Maclaurin, Jorge Iparraguirre, Rafael Bombarell, Timothy Hirzel, Alán AspuruGuzik, and Ryan P Adams. Convolutional networks on graphs for learning molecular fingerprints. In Advances in neural information processing systems, pp. 2224–2232, 2015.
|
| 175 |
+
|
| 176 |
+
Vijay Prakash Dwivedi, Chaitanya K. Joshi, Thomas Laurent, Yoshua Bengio, and Xavier Bresson. Benchmarking graph neural networks, 2020.
|
| 177 |
+
|
| 178 |
+
Steven K. Esser, Jeffrey L. McKinstry, Deepika Bablani, Rathinakumar Appuswamy, and Dharmendra S. Modha. Learned step size quantization. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id $=$ rkgO66VKDS.
|
| 179 |
+
|
| 180 |
+
Angela Fan, Pierre Stock, Benjamin Graham, Edouard Grave, Remi Gribonval, Herve Jegou, and Armand Joulin. Training with quantization noise for extreme model compression, 2020.
|
| 181 |
+
|
| 182 |
+
Boyuan Feng, Yuke Wang, Xu Li, Shu Yang, Xueqiao Peng, and Yufei Ding. Sgquant: Squeezing the last bit on graph neural networks with specialized quantization, 2020.
|
| 183 |
+
|
| 184 |
+
Matthias Fey and Jan Eric Lenssen. Fast graph representation learning with pytorch geometric, 2019.
|
| 185 |
+
|
| 186 |
+
Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. Neural message passing for quantum chemistry. CoRR, abs/1704.01212, 2017. URL http://arxiv.org/abs/1704. 01212.
|
| 187 |
+
|
| 188 |
+
William L. Hamilton, Rex Ying, and Jure Leskovec. Inductive representation learning on large graphs, 2017.
|
| 189 |
+
|
| 190 |
+
Song Han, Huizi Mao, and William J. Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding, 2015.
|
| 191 |
+
|
| 192 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift, 2015.
|
| 193 |
+
|
| 194 |
+
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, 2017.
|
| 195 |
+
|
| 196 |
+
Zhihao Jia, Sina Lin, Mingyu Gao, Matei Zaharia, and Alex Aiken. Improving the accuracy, scalability, and performance of graph neural networks with roc. In Proceedings of Machine Learning and Systems 2020, pp. 187–198. 2020.
|
| 197 |
+
|
| 198 |
+
Wengong Jin, Regina Barzilay, and Tommi Jaakkola. Junction tree variational autoencoder for molecular graph generation, 2018.
|
| 199 |
+
|
| 200 |
+
Dhiraj Kalamkar, Dheevatsa Mudigere, Naveen Mellempudi, Dipankar Das, Kunal Banerjee, Sasikanth Avancha, Dharma Teja Vooturi, Nataraj Jammalamadaka, Jianyu Huang, Hector Yuen, Jiyan Yang, Jongsoo Park, Alexander Heinecke, Evangelos Georganas, Sudarshan Srinivasan, Abhisek Kundu, Misha Smelyanskiy, Bharat Kaul, and Pradeep Dubey. A study of bfloat16 for deep learning training, 2019.
|
| 201 |
+
|
| 202 |
+
Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. 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=SJU4ayYgl.
|
| 203 |
+
|
| 204 |
+
Raghuraman Krishnamoorthi. Quantizing deep convolutional networks for efficient inference: A whitepaper, 2018.
|
| 205 |
+
|
| 206 |
+
Liam Li, Kevin Jamieson, Afshin Rostamizadeh, Ekaterina Gonina, Jonathan Ben-tzur, Moritz Hardt, Benjamin Recht, and Ameet Talwalkar. A system for massively parallel hyperparameter tuning. In Proceedings of Machine Learning and Systems 2020, pp. 230–246. 2020.
|
| 207 |
+
|
| 208 |
+
Christos Louizos, Karen Ullrich, and Max Welling. Bayesian compression for deep learning, 2017.
|
| 209 |
+
|
| 210 |
+
Paulius Micikevicius, Sharan Narang, Jonah Alben, Gregory Diamos, Erich Elsen, David Garcia, Boris Ginsburg, Michael Houston, Oleksii Kuchaiev, Ganesh Venkatesh, and Hao Wu. Mixed precision training, 2017.
|
| 211 |
+
|
| 212 |
+
Anurag Mukkara, Nathan Beckmann, Maleen Abeydeera, Xiaosong Ma, and Daniel Sanchez. Exploiting locality in graph analytics through hardware-accelerated traversal scheduling. In Proceedings of the 51st Annual IEEE/ACM International Symposium on Microarchitecture, MICRO-51, pp. 1–14. IEEE Press, 2018. ISBN 9781538662403. doi: 10.1109/MICRO.2018.00010. URL https://doi.org/10.1109/MICRO. 2018.00010.
|
| 213 |
+
|
| 214 |
+
Gabriele Prato, Ella Charlaix, and Mehdi Rezagholizadeh. Fully quantized transformer for machine translation, 2019.
|
| 215 |
+
|
| 216 |
+
Yu Rong, Wenbing Huang, Tingyang Xu, and Junzhou Huang. Dropedge: Towards deep graph convolutional networks on node classification. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id $=$ Hkx1qkrKPr.
|
| 217 |
+
|
| 218 |
+
Paul-Edouard Sarlin, Daniel DeTone, Tomasz Malisiewicz, and Andrew Rabinovich. Superglue: Learning feature matching with graph neural networks. arXiv preprint arXiv:1911.11763, 2019.
|
| 219 |
+
|
| 220 |
+
Tao Sheng, Chen Feng, Shaojie Zhuo, Xiaopeng Zhang, Liang Shen, and Mickey Aleksic. A quantizationfriendly separable convolution for mobilenets. 2018 1st Workshop on Energy Efficient Machine Learning and Cognitive Computing for Embedded Applications (EMC2), Mar 2018. doi: 10.1109/emc2.2018.00011. URL http://dx.doi.org/10.1109/emc2.2018.00011.
|
| 221 |
+
|
| 222 |
+
Moran Shkolnik, Brian Chmiel, Ron Banner, Gil Shomron, Yuri Nahshan, Alex Bronstein, and Uri Weiser. Robust quantization: One model to rule them all. arXiv preprint arXiv:2002.07686, 2020.
|
| 223 |
+
|
| 224 |
+
Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. The journal of machine learning research, 15(1): 1929–1958, 2014.
|
| 225 |
+
|
| 226 |
+
Rianne van den Berg, Thomas N. Kipf, and Max Welling. Graph convolutional matrix completion, 2017.
|
| 227 |
+
|
| 228 |
+
Petar Velickovic, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Liò, and Yoshua Bengio. Graph attention networks. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net, 2018. URL https://openreview.net/forum?id $=$ rJXMpikCZ.
|
| 229 |
+
|
| 230 |
+
Hanchen Wang, Defu Lian, Ying Zhang, Lu Qin, Xiangjian He, Yiguang Lin, and Xuemin Lin. Binarized graph neural network, 2020.
|
| 231 |
+
|
| 232 |
+
Kuan Wang, Zhijian Liu, Yujun Lin, Ji Lin, and Song Han. Haq: Hardware-aware automated quantization with mixed precision, 2018.
|
| 233 |
+
|
| 234 |
+
Hao Wu, Patrick Judd, Xiaojie Zhang, Mikhail Isaev, and Paulius Micikevicius. Integer quantization for deep learning inference: Principles and empirical evaluation, 2020.
|
| 235 |
+
|
| 236 |
+
Zhenqin Wu, Bharath Ramsundar, Evan N. Feinberg, Joseph Gomes, Caleb Geniesse, Aneesh S. Pappu, Karl Leswing, and Vijay Pande. Moleculenet: A benchmark for molecular machine learning, 2017.
|
| 237 |
+
|
| 238 |
+
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019. URL https://openreview.net/forum?id $\equiv$ ryGs6iA5Km.
|
| 239 |
+
|
| 240 |
+
Bencheng Yan, Chaokun Wang, Gaoyang Guo, and Yunkai Lou. Tinygnn: Learning efficient graph neural networks. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’20, pp. 1848–1856, New York, NY, USA, 2020. Association for Computing Machinery. ISBN 9781450379984. doi: 10.1145/3394486.3403236. URL https://doi.org/10. 1145/3394486.3403236.
|
| 241 |
+
|
| 242 |
+
Ofir Zafrir, Guy Boudoukh, Peter Izsak, and Moshe Wasserblat. Q8bert: Quantized 8bit bert, 2019.
|
| 243 |
+
|
| 244 |
+
Hanqing Zeng and Viktor Prasanna. Graphact. The 2020 ACM/SIGDA International Symposium on FieldProgrammable Gate Arrays, Feb 2020. doi: 10.1145/3373087.3375312. URL http://dx.doi.org/10. 1145/3373087.3375312.
|
| 245 |
+
|
| 246 |
+
Hanqing Zeng, Hongkuan Zhou, Ajitesh Srivastava, Rajgopal Kannan, and Viktor Prasanna. Graphsaint: Graph sampling based inductive learning method, 2020.
|
| 247 |
+
|
| 248 |
+
# A APPENDIX
|
| 249 |
+
|
| 250 |
+
Readers seeking advice on implementation will find appendix A.5 especially useful. We provide significant advice surrounding best practices on quantization for GNNs, along with techniques which we believe can boost our methods beyond the performance described in this paper, but for which we did not have time to fully evaluate.
|
| 251 |
+
|
| 252 |
+
# A.1 EXPERIMENTAL SETUP
|
| 253 |
+
|
| 254 |
+
As baselines we use the architectures and results reported by Fey & Lenssen (2019) for citation networks, Dwivedi et al. (2020) for MNIST, CIFAR-10 and ZINC and, Xu et al. (2019) for REDDITBINARY. We re-implemented the architectures and datasets used in these publications and replicated the results reported at FP32. Models using GIN layers learn parameter . These models are often referred to as GIN-. The high-level description of these architectures is shown in table 5. The number of parameters for each architecture-dataset in this work are shown in table 6.
|
| 255 |
+
|
| 256 |
+
Our infrastructure was implemented using PyTorch Geometric (PyG) (Fey & Lenssen, 2019). We generate candidate hyperparameters using random search, and prune trials using the asynchronous hyperband algorithm (Li et al., 2020). Hyperparameters searched over were learning rate, weight decay, and dropout (Srivastava et al., 2014) and drop-edge (Rong et al., 2020) probabilities. The search ranges were initialized centered at the values used in the reference implementations of the baselines. Degree-Quant requires searching for two additional hyperparameters, $p _ { \mathrm { m i n } }$ and $p _ { \mathrm { m a x } }$ these were tuned in a grid-search fashion. We report our results using the hyperparameters which achieved the best validation loss over 100 runs on the Cora and Citeseer datasets, 10 runs for MNIST, CIFAR-10 and ZINC, and 10-fold cross-validation for REDDIT-BINARY.
|
| 257 |
+
|
| 258 |
+
We generally used fewer hyperparameter runs for our DQ runs than we did for baselines—even ignoring the searches over the various STE configs. As our method is more stable, finding a reasonable set of parameters was easier than before. As is usual with quantization experiments, we found it useful to decrease the learning rate relative to the FP32 baseline.
|
| 259 |
+
|
| 260 |
+
Our experiments ran on several machines in our SLURM cluster using Intel CPUs and NVIDIA GPUs. Each machine was running Ubuntu 18.04. The GPU models in our cluster were: V100, RTX 2080Ti and GTX 1080Ti.
|
| 261 |
+
|
| 262 |
+
Table 5: High level description of the architectures evaluated for citation networks (Cit), MNIST (M), CIFAR-10 (C), ZINC (Z) and REDDIT-BINARY (R). We relied on Adam optimizer for all experiments. For all batched experiments, we used 128 batch-sizes. All GAT models used 8 attention heads. All GIN architectures used 2-layer MLPs, except those for citation networks which used a single linear layer.
|
| 263 |
+
|
| 264 |
+
<table><tr><td rowspan="2">Model Arch.</td><td colspan="5">#Layers</td><td colspan="5"># Hidden Units</td><td colspan="5">Residual</td><td colspan="5">Output MLP</td></tr><tr><td>Cit</td><td>M</td><td>C</td><td>Z</td><td>R</td><td>Cit</td><td>M</td><td>C</td><td>Z</td><td>R</td><td>Cit</td><td>M</td><td>C</td><td>Z</td><td>R 1</td><td>Cit</td><td>M</td><td>C</td><td>Z</td><td>R</td></tr><tr><td>GCN</td><td>2</td><td>4</td><td>4</td><td>4</td><td>-</td><td>16</td><td>146</td><td>146</td><td>145</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>GAT</td><td>2</td><td>4</td><td>4</td><td>4</td><td>-</td><td>8</td><td>19</td><td>19</td><td>18</td><td>1</td><td>×</td><td>√</td><td>√</td><td>√</td><td>1</td><td>×</td><td>√</td><td>√</td><td>√</td><td>-</td></tr><tr><td>GIN</td><td>2</td><td>4</td><td>4</td><td>4</td><td>5</td><td>16</td><td>110</td><td>110</td><td>110</td><td>64</td><td>×</td><td>√</td><td>√</td><td>√</td><td>×</td><td>×</td><td>√</td><td>√</td><td>√</td><td>√</td></tr></table>
|
| 265 |
+
|
| 266 |
+
Table 6: Number of parameters for each of the evaluated architectures
|
| 267 |
+
|
| 268 |
+
<table><tr><td rowspan="2">Model Arch.</td><td colspan="2">Node Classification</td><td colspan="3">Graph Classification</td><td rowspan="2">Graph Regression ZINC</td></tr><tr><td>Cora</td><td>Citeseer</td><td>MNIST</td><td>CIFAR-10</td><td>REDDIT-BIN</td></tr><tr><td>GCN</td><td>23063</td><td>59366</td><td>103889</td><td>104181</td><td>=</td><td>105454</td></tr><tr><td>GAT</td><td>92373</td><td>237586</td><td>113706</td><td>114010</td><td>1</td><td>105044</td></tr><tr><td>GIN</td><td>23216</td><td>59536</td><td>104554</td><td>104774</td><td>42503</td><td>102088</td></tr></table>
|
| 269 |
+
|
| 270 |
+
For QAT experiments, all elements of each network are quantized: inputs to each layer, the weights, the messages sent between nodes, the inputs to aggregation stage and its outputs and, the outputs of the update stage (which are the outputs of the GNN layer before activation). In this way, all intermediate tensors in GNNs are quantized with the exception of the attention mechanism in GAT; we do not quantize after the softmax calculation, due to the numerical precision required at this stage. With the exception of Cora and Citeseer, the models evaluated in this work make use of Batch Normalization (Ioffe & Szegedy, 2015). For deployments of quantized models, Batch Normalization layers are often folded with the weights (Krishnamoorthi, 2018). This is to ensure the input to the next layer is within the expected $[ q _ { \mathrm { m i n } } , q _ { \mathrm { m a x } } ]$ ranges. In this work, for both QAT baselines and $\mathrm { Q A T + D Q }$ we left BN layers unfolded but ensure the inputs and outputs were quantized to the appropriate number of bits (i.e. INT8 or INT4) before getting multiplied with the layer weights. We leave as future work proposing a BN folding mechanism applicable for GNNs and studying its impact for deployments of quantized GNNs.
|
| 271 |
+
|
| 272 |
+
The GIN models evaluated on REDDIT-BINARY used QAT for all layers with the exception of the input layer of the MLP in the first GIN layer. This compromise was needed to overcome the severe degradation introduced by quantization when operating on nodes with a single scalar as feature.
|
| 273 |
+
|
| 274 |
+
# A.2 DATASETS
|
| 275 |
+
|
| 276 |
+
We show in Table 7 the statistics for each dataset either used or referred to in this work. For Cora and Citeseer datasets, nodes correspond to documents and edges to citations between these. Node features are a bag-of-words representation of the document. The task is to classify each node in the graph (i.e. each document) correctly. The MNIST and CIFAR-10 datasets (commonly used for image classification) are transformed using SLIC (Achanta et al., 2012) into graphs where each node represents a cluster of perceptually similar pixels or superpixels. The task is to classify each image using their superpixels graph representation. The ZINC dataset contains graphs representing molecules, were each node is an atom. The task is to regress a molecular property (constrained solubility (Jin et al., 2018)) given the graph representation of the molecule. Nodes in graphs of the REDDIT-BINARY dataset represent users of a Reddit thread with edges drawn between a pair of nodes if these interacted. This dataset contains graphs of two types of communities: question-answer threads and discussion threads. The task is to determine if a given graph is from a question-answer thread or a discussion thread.
|
| 277 |
+
|
| 278 |
+
We use standard splits for MNIST, CIFAR-10 and ZINC. For citation datasets (Cora and Citeseer), we use the splits used by Kipf & Welling (2017). For REDDIT-BINARY we use 10-fold cross validation.
|
| 279 |
+
Table 7: Statistics for each dataset used in the paper. Some datasets are only referred to in fig. 1
|
| 280 |
+
|
| 281 |
+
<table><tr><td>Dataset</td><td>Graphs</td><td>Nodes</td><td>Edges</td><td>Features</td><td>Labels</td></tr><tr><td>Cora</td><td>1</td><td>2,708</td><td>5,278</td><td>1,433</td><td>7</td></tr><tr><td>Citeseer</td><td>1</td><td>3,327</td><td>4,552</td><td>3,703</td><td>6</td></tr><tr><td>Pubmed</td><td>1</td><td>19,717</td><td>44,324</td><td>500</td><td>3</td></tr><tr><td>MNIST</td><td>70K</td><td>40-75</td><td>564.53 (avg)</td><td>3</td><td>10</td></tr><tr><td>CIFAR10</td><td>60K</td><td>85-150</td><td>941.07 (avg)</td><td>5</td><td>10</td></tr><tr><td>ZINC</td><td>12K</td><td>9-37</td><td>49.83 (avg)</td><td>28</td><td>1</td></tr><tr><td>REDDIT-BINARY</td><td>2K</td><td>429.63 (avg)</td><td>497.75 (avg)</td><td>1</td><td>2</td></tr><tr><td>Reddit</td><td>1</td><td>232.965</td><td>114,848,857</td><td>602</td><td>41</td></tr><tr><td>Amazon</td><td>1</td><td>9,430,088</td><td>231,594,310</td><td>300</td><td>24</td></tr></table>
|
| 282 |
+
|
| 283 |
+
# A.3 QUANTIZATION IMPLEMENTATIONS
|
| 284 |
+
|
| 285 |
+
In section 4.1 we analyse different readily available quantization implementations and how they impact in QAT results. First, vanilla STE, which is the reference STE (Bengio et al., 2013) that lets the gradients pass unchanged; and gradient clipping (GC), which clips the gradients based on the maximum representable value for a given quantization level. Or in other words, GC limits gradients if the tensor’s magnitudes are outside the $[ q _ { \mathrm { m i n } } , q _ { \mathrm { m a x } } ]$ range.
|
| 286 |
+
|
| 287 |
+
$$
|
| 288 |
+
x _ { \mathrm { m i n } } = { \left\{ \begin{array} { l l } { \operatorname* { m i n } ( X ) } & { { \mathrm { i f ~ } } \operatorname { s t e p } = 0 } \\ { \operatorname* { m i n } ( x _ { \mathrm { m i n } } , X ) } & { { \mathrm { o t h e r w i s e } } } \end{array} \right. }
|
| 289 |
+
$$
|
| 290 |
+
|
| 291 |
+
$$
|
| 292 |
+
x _ { \mathrm { m i n } } = { \left\{ \begin{array} { l l } { \operatorname* { m i n } ( X ) } & { { \mathrm { i f ~ s t e p ~ } } = 0 } \\ { ( 1 - c ) x _ { \mathrm { m i n } } + c \operatorname* { m i n } ( X ) } & { { \mathrm { o t h e r w i s e } } } \end{array} \right. }
|
| 293 |
+
$$
|
| 294 |
+
|
| 295 |
+
The quantization modules keep track of the input tensor’s min and max values, $x _ { \mathrm { m i n } }$ and $x _ { \mathrm { m a x } }$ , which are then used to compute $q _ { \mathrm { m i n } }$ , $q _ { \mathrm { m a x } }$ , zero-point and scale parameters. For both vanilla STE and GC, we study two popular ways of keeping track of these statistics: min/max, which tracks the $\operatorname* { m i n } / \operatorname* { m a x }$ tensor values observed over the course of training; and momentum, which computes the moving averages of those statistic during training. The update rules for $x _ { \mathrm { m i n } }$ for STE min/max and STE momentum are presented in eq. (1) and eq. (2) respectively, where $X$ is the tensor to be quantized and $c$ is the momentum hyperparameter, which in all our experiments is set to its default 0.01. Equivalent rules apply when updating $x _ { \mathrm { m a x } }$ (omitted).
|
| 296 |
+
|
| 297 |
+
For stochastic QAT we followed the implementation described in Fan et al. (2020), where at each training step a binary mask sampled from a Bernoulli distribution is used to specify which elements of the weight tensor will be quantized and which will be left at full precision. We experimented with block sizes larger than one (i.e. a single scalar) but often resulted in a sever drop in performance. All the reported results use block size of one.
|
| 298 |
+
|
| 299 |
+
# A.4 DEGREE-QUANT AND GRAPH LEVEL SUMMARIZATION
|
| 300 |
+
|
| 301 |
+
The percentile operation in our quantization scheme remains important for summarizing the graph when doing graph-level tasks, such as graph regression (Zinc) or graph classification (MNIST, CIFAR10 and REDDIT-BINARY). Since the number of nodes in each input graph is not constant, this can cause the summarized representation produced from the final graph layer to have a more tailed distribution than would be seen with other types of architectures (e.g. CNN). Adding the percentile operation reduces the impact of these extreme tails in the fully connected graph-summarization layers, thereby increasing overall performance. The arguments regarding weight update accuracy also still apply, as the $\frac { \partial \mathcal { L } ^ { \mathbf { \omega } } } { \partial \mathbf { h } _ { l + 1 } ^ { ( i ) } }$ term in the equations for the GCN and GIN should be more accurate compared to when the activations are always quantized before the summarization. This phenomenon is also noted by Fan et al. (2020).
|
| 302 |
+
|
| 303 |
+
# A.5 IMPLEMENTATION ADVICE
|
| 304 |
+
|
| 305 |
+
We provide details that will be useful for others working in the area, including suggestions that should boost the performance of our results and accelerate training. We release code on GitHub; this code is a clean implementation of the paper, suitable for users in downstream works.
|
| 306 |
+
|
| 307 |
+
# A.5.1 QUANTIZATION SETUP
|
| 308 |
+
|
| 309 |
+
As our work studies the pitfalls of quantization for GNNs, we were more aggressive in our implementation than is absolutely necessary: everything (where reasonably possible) in our networks is quantized. In practice, this leaves low-hanging fruit for improvements in accuracy:
|
| 310 |
+
|
| 311 |
+
• Not quantizing the final layer (as is common practice for CNNs and Transformers) helps with accuracy, especially at INT4. A similar practice at the first layer will also be useful.
|
| 312 |
+
• Using higher precision for the “summarization” stages of the model, which contributes little towards the runtime in most cases.
|
| 313 |
+
• Taking advantage of mixed precision: since the benefits of quantization are primarily in the message passing phase (discussed below), one technique to boost accuracy is to only make the messages low precision.
|
| 314 |
+
|
| 315 |
+
We advise choosing a more realistic (less aggressive) convention than used in this work. The first two items would be appropriate.
|
| 316 |
+
|
| 317 |
+
# A.5.2 RELATIVE VALUE OF PERCENTILES COMPARED TO PROTECTIVE MASKING
|
| 318 |
+
|
| 319 |
+
There are two components to our proposed technique: stochastic, topology-aware, masking and percentile-based range observers for quantizers. We believe that percentiles provide more immediate value, especially at INT4. We find that they are useful purely from the perspective of stabilizing the optimization and reducing the sensitivity to hyperparameters.
|
| 320 |
+
|
| 321 |
+
However, adding the masking does improve performance further. This is evident from table 9. In fact, performance may be degraded slightly when percentiles are also applied: this can be observed by comparing table 9 to the main results in the paper, table 2.
|
| 322 |
+
|
| 323 |
+
# A.5.3 PERCENTILES
|
| 324 |
+
|
| 325 |
+
The key downside with applying percentiles for range observers is that the operation can take significant time. Training with DQ is slower than before—however, since there is less sensitivity to hyperparameters, fewer runs end up being needed. We are confident that an effective way to speed up this operation is to use sampling. We expect $10 \%$ of the data should be adequate, however we believe that even $1 \%$ of the data may be sufficient (dataset and model dependent). However, we have not evaluated this setup in the paper; it is provided in the code release for experimentation.
|
| 326 |
+
|
| 327 |
+
# A.5.4 IMPROVING ON PERCENTILES
|
| 328 |
+
|
| 329 |
+
We believe that it is possible to significantly boost the performance of GNN quantization by employing a learned step size approach. Although we used percentiles in this paper to illustrate the rangeprecision trade-off for GNNs, we expect that learning the ranges will lead to better results. This approach, pioneered by works such as Esser et al. (2020), has been highly effective on CNNs even down to 2 bit quantization.
|
| 330 |
+
|
| 331 |
+
Another approach would be to use robust quantization: the ideas in these works are to reduce the impact of changing quantization ranges i.e. making the architecture more robust to quantization. Works in this area include Alizadeh et al. (2020) and Shkolnik et al. (2020).
|
| 332 |
+
|
| 333 |
+
# A.5.5 IMPROVING LATENCY
|
| 334 |
+
|
| 335 |
+
The slowest step of GNN inference is typically the sparse operations. It is therefore best to minimize the sizes of the messages between nodes i.e. quantize the message phase most aggressively. This makes the biggest impact on CPUs which are dependent on caches to obtain good performance.
|
| 336 |
+
|
| 337 |
+
We evaluated our code on CPU using Numpy and Scipy routines. For the GPU, we used implementations from PyTorch and PyTorch Geometric and lightly modified them to support INT8 where necessary. These results, while useful for illustrating the benefits of quantization, are by no means optimal: we did not devote significant time to improving latency. We believe better results can be obtained by taking advantage of techniques such as cache blocking or kernel fusion.
|
| 338 |
+
|
| 339 |
+
# A.5.6 PITFALLS
|
| 340 |
+
|
| 341 |
+
Training these models can be highly unstable: some experiments in the paper had standard deviations as large as $18 \%$ . We observed this to affect citation network experiments to the extent that they would not converge on GPUs: all these experiments had to be run on CPUs.
|
| 342 |
+
|
| 343 |
+
# A.6 DEGRADATION STUDIES
|
| 344 |
+
|
| 345 |
+
Figures 7 and 8 show the results of the ablation study conducted in section 5 for GCN and GIN. We observe that GCN is more tolerant to INT4 quantization than other architectures. GIN, however, requires accurate representations after the update stage, and heavily suffers from further quantization like GAT. The idea of performing different stages of inference at different precisions has been proposed, although it is uncommon (Wang et al., 2018).
|
| 346 |
+
|
| 347 |
+

|
| 348 |
+
Figure 7: Degradation of INT8 GCN on Cora as individual elements are converted to INT4 without DegreeQuant.
|
| 349 |
+
|
| 350 |
+

|
| 351 |
+
Figure 8: Degradation of INT8 GIN on Cora as individual elements are converted to INT4 without DegreeQuant.
|
| 352 |
+
|
| 353 |
+

|
| 354 |
+
Figure 9: In-degree distribution for each of the six datasets assessed. Note that a log $_ y$ -axis is used for all datasets except for MNIST and CIFAR-10.
|
| 355 |
+
|
| 356 |
+

|
| 357 |
+
Figure 10: Validation loss curves for GIN models evaluated on REDDIT-BINARY. Results averaged across 10-fold crossvalidation. We show four DQ-INT8 experiments each with a different values for $( p _ { \mathrm { m i n } } , p _ { \mathrm { m a x } } )$ and our FP32 baseline.
|
| 358 |
+
|
| 359 |
+
Table 8: Final test accuracies for FP32 and DQ-INT8 models whose validation loss curves are shown in fig. 10
|
| 360 |
+
|
| 361 |
+
<table><tr><td>Quantization</td><td>Model</td><td>REDDIT-BIN 个</td></tr><tr><td>Ref. (FP32)</td><td>GIN</td><td>92.2 ± 2.3</td></tr><tr><td>Ours (FP32)</td><td>GIN</td><td>92.0 ± 1.5</td></tr><tr><td>DQ-INT8 (0.0, 0.1)</td><td>GIN</td><td>91.8 ± 2.3</td></tr><tr><td>DQ-INT8 (0.1, 0.2)</td><td>GIN</td><td>90.1 ± 2.5</td></tr><tr><td>DQ-INT8 (0.2, 0.2)</td><td>GIN</td><td>89.0±3.0</td></tr><tr><td>DQ-INT8 (0.2, 0.3)</td><td>GIN</td><td>88.1 ±3.0</td></tr></table>
|
| 362 |
+
|
| 363 |
+
Table 9: Ablation study against the two elements of Degree-Quant (DQ). The first two rows of results are obtained with only the stochastic element of Degree-Quant enabled for INT8 and INT4. Percentile-based quantization ranges are disabled in these experiments. The bottom row of results were obtained with noisy quantization (nQAT) at INT4 with the use of percentiles. DQ masking alone is often sufficient to achieve excellent results, but the addition of percentile-based range tracking can be beneficial to increase stability. We can see that using nQAT with percentiles is not sufficient to achieve results of the quality DQ provides.
|
| 364 |
+
|
| 365 |
+
<table><tr><td>Quantization Scheme</td><td>Model Arch.</td><td colspan="2">Node Classification Cora↑ Citeseer ↑</td><td>Graph Regression ZINC↓</td></tr><tr><td rowspan="3">QAT-INT8 + DQ Masking</td><td>GCN</td><td>81.1±0.6</td><td>71.0±0.7</td><td>0.468 ± 0.014</td></tr><tr><td>GAT</td><td>82.1±0.1</td><td>71.4 ±0.8</td><td>0.462 ± 0.005</td></tr><tr><td>GIN</td><td>78.9±1.2</td><td>67.1 ± 1.7</td><td>0.347 ±0.028</td></tr><tr><td rowspan="3">QAT-INT4 + DQ Masking</td><td>GCN</td><td>78.5 ± 1.4</td><td>62.8±8.5</td><td>0.599 ± 0.015</td></tr><tr><td>GAT</td><td>64.4±9.3</td><td>68.9 ±1.2</td><td>0.529 ±0.008</td></tr><tr><td>GIN</td><td>71.2 ± 2.9</td><td>56.7±3.8</td><td>0.427 ± 0.010</td></tr><tr><td rowspan="3">nQAT-INT4 + Percentile</td><td>GCN</td><td>75.6± 2.5</td><td>64.8±3.8</td><td>0.633 ± 0.012</td></tr><tr><td>GAT</td><td>70.1 ± 2.8</td><td>51.4± 3.4</td><td>0.596 ±0.008</td></tr><tr><td>GIN</td><td>63.5± 2.0</td><td>46.3 ± 4.1</td><td>0.771 ±0.058</td></tr></table>
|
| 366 |
+
|
| 367 |
+
<table><tr><td rowspan="2">Device</td><td rowspan="2">Arch.</td><td colspan="3">CIFAR-10</td><td colspan="3">Cora</td><td colspan="3">Citeseer</td></tr><tr><td>FP32</td><td>W8A8</td><td>Speedup</td><td>FP32</td><td>W8A8</td><td>Speedup</td><td>FP32</td><td>W8A8</td><td>Speedup</td></tr><tr><td rowspan="3">CPU</td><td>GCN</td><td>182ms</td><td>88ms</td><td>2.1×</td><td>0.94ms</td><td>0.74ms</td><td>1.3×</td><td>0.97ms</td><td>0.76ms</td><td>1.3×</td></tr><tr><td>GAT</td><td>500ms</td><td>496ms</td><td>1.0×</td><td>0.86ms</td><td>0.78ms</td><td>1.1×</td><td>0.99ms</td><td>0.88ms</td><td>1.1×</td></tr><tr><td>GIN</td><td>144ms</td><td>44ms</td><td>3.3×</td><td>0.85ms</td><td>0.68ms</td><td>1.3×</td><td>0.95ms</td><td>0.55ms</td><td>1.7×</td></tr><tr><td rowspan="3">GPU</td><td>GCN</td><td>2.1ms</td><td>1.6ms</td><td>1.3×</td><td>0.08ms</td><td>0.09ms</td><td>0.9×</td><td>0.09ms</td><td>0.09ms</td><td>1.0×</td></tr><tr><td>GAT</td><td>30.0ms</td><td>27.1ms</td><td>1.1×</td><td>0.57ms</td><td>0.64ms</td><td>0.9×</td><td>0.56ms</td><td>0.64ms</td><td>0.9×</td></tr><tr><td>GIN</td><td>20.9ms</td><td>16.2ms</td><td>1.2×</td><td>0.09ms</td><td>0.07ms</td><td>1.3×</td><td>0.09ms</td><td>0.07ms</td><td>1.3×</td></tr></table>
|
| 368 |
+
|
| 369 |
+
Table 10: INT8 latency results run on a 22 core 2.1GHz Intel Xeon Gold 6152 and, on a GTX 1080Ti GPU. All layers have $1 2 8 \ \mathrm { i n }$ /out features. For CIFAR-10 we used batch size of 1K graphs.
|
| 370 |
+
|
| 371 |
+

|
| 372 |
+
Figure 11: Diagram representing how DQ makes use of a topology-aware quantization strategy that is better suited for GNNs. The diagram illustrates this for a GCN layer. At every training stage, a degree-based mask is generated. This mask is used in all quantization layers located after each of the stages in the message-passing pipeline. By retaining at FP32 nodes with higher-degree more often, the noisy updates during training have a lesser impact and therefore models perform better, even at INT4.
|
| 373 |
+
|
| 374 |
+

|
| 375 |
+
Figure 12: Diagram representing how nQAT is implemented for GNNs. The diagram illustrates this for a GCN layer. The stochastic stage only takes place when quantizing the weights, the remaining of the quantization modules happen following a standard QAT strategy. A QAT diagram would be similar to this one but fully quantizing the weights.
|
| 376 |
+
|
| 377 |
+

|
| 378 |
+
Figure 13: Diagrams representing how the output graph-summarization stages for graph-level tasks (e.g. graph classification, graph regression) are implemented when making use of DQ (left) and nQAT (right). GNNs making use of DQ during the node-aggregation stages (see fig. 11), do not use the stochastic element of DQ in the output MLP layers but still make use of percentiles. For models making use of nQAT, the final MLP still makes use of stochastic quantization of weights.
|
| 379 |
+
|
| 380 |
+
# B CODE LISTINGS
|
| 381 |
+
|
| 382 |
+
Our code depends on PyTorch Geometric (Fey & Lenssen, 2019). These snippets should be compatible with Python 3.7 and PyTorch Geometric version 1.4.3. You can see the full code on GitHub: https://github.com/camlsys/degree-quant.
|
| 383 |
+
|
| 384 |
+
# B.1 MASK GENERATION
|
| 385 |
+
|
| 386 |
+

|
| 387 |
+
|
| 388 |
+
def evaluate_prob_mask(data):return torch.bernoulli(data.prob_mask).to(torch.bool)
|
| 389 |
+
|
| 390 |
+
# B.2 MESSAGE PASSING WITH DEGREE-QUANT
|
| 391 |
+
|
| 392 |
+
Here we provide code to implement the layers as used by our proposal. These are heavily based off of the classes provided by PyTorch Geometric, with only minor modifications to insert the quantization steps where necessary. The normal quantized versions are similar, except without any concept of high/low masking.
|
| 393 |
+
|
| 394 |
+

|
| 395 |
+
|
| 396 |
+
aggrs $\underline { { \underline { { \mathbf { \Pi } } } } }$ self.aggregate(out, \*\*aggr_kwargs)
|
| 397 |
+
if self.training: out $=$ torch.empty_like(aggrs) out[mask] $=$ self.mp_quantizers["aggregate_high"](aggrs[mask]) out[\~mask] $=$ self.mp_quantizers["aggregate_low"](aggrs[\~mask])
|
| 398 |
+
else: out $\underline { { \underline { { \mathbf { \Pi } } } } }$ self.mp_quantizers["aggregate_low"](aggrs)
|
| 399 |
+
update_kwargs $=$ self.__distribute__(self.__update_params__, kwargs)
|
| 400 |
+
updates $\underline { { \underline { { \mathbf { \Pi } } } } }$ self.update(out, \*\*update_kwargs)
|
| 401 |
+
if self.training: out $\underline { { \underline { { \mathbf { \Pi } } } } }$ torch.empty_like(updates) out[mask] $=$ self.mp_quantizers["update_high"](updates[mask]) out[\~mask] $\underline { { \underline { { \mathbf { \Pi } } } } }$ self.mp_quantizers["update_low"](updates[\~mask])
|
| 402 |
+
else: out $=$ self.mp_quantizers["update_low"](updates)
|
| 403 |
+
|
| 404 |
+
# B.2.1 GCN
|
| 405 |
+
|
| 406 |
+
class GCNConvMultiQuant(MessagePassingMultiQuant): # Some methods missed... def forward(self, x, edge_index, mask, edge_weight=None):
|
| 407 |
+
|
| 408 |
+
# quantizing input
|
| 409 |
+
if self.training: x_q $=$ torch.empty_like(x) x_q[mask] $=$ self.layer_quantizers["inputs_high"](x[mask]) x_q[\~mask] $=$ self.layer_quantizers["inputs_low"](x[\~mask])
|
| 410 |
+
|
| 411 |
+
else: x_q $=$ self.layer_quantizers["inputs_low"](x)
|
| 412 |
+
|
| 413 |
+
# quantizing layer weights
|
| 414 |
+
|
| 415 |
+
w_q $\underline { { \underline { { \mathbf { \Pi } } } } }$ self.layer_quantizers["weights_low"](self.weight)
|
| 416 |
+
|
| 417 |
+
if self.training: $\mathrm { ~ x ~ } =$ torch.empty((x_q.shape[0], w_q.shape[1])).to(x_q.device) x_tmp $=$ torch.matmul(x_q, w_q) x[mask] $\underline { { \underline { { \mathbf { \Pi } } } } }$ self.layer_quantizers["features_high"](x_tmp[mask]) x[\~mask] $=$ self.layer_quantizers["features_low"](x_tmp[\~mask])
|
| 418 |
+
|
| 419 |
+
$\mathrm { ~ x ~ } =$ self.layer_quantizers["features_low"](torch.matmul(x_q, w_q))
|
| 420 |
+
|
| 421 |
+
if self.normalize: edge_index, norm $\underline { { \underline { { \mathbf { \Pi } } } } }$ self.norm( edge_index, x.size(self.node_dim), edge_weight, self.improved, x.dtype, )
|
| 422 |
+
else: norm $\underline { { \underline { { \mathbf { \Pi } } } } }$ edge_weight
|
| 423 |
+
norm $\underline { { \underline { { \mathbf { \Pi } } } } }$ self.layer_quantizers["norm"](norm)
|
| 424 |
+
return self.propagate(edge_index, $\mathrm { x } = \mathrm { x }$ , norm $! =$ norm, mask=mask)
|
md/train/SyzVb3CcFX/SyzVb3CcFX.md
ADDED
|
@@ -0,0 +1,390 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TIME-AGNOSTIC PREDICTION: PREDICTING PREDICTABLE VIDEO FRAMES
|
| 2 |
+
|
| 3 |
+
Dinesh Jayaraman UC Berkeley
|
| 4 |
+
|
| 5 |
+
Frederik Ebert UC Berkeley
|
| 6 |
+
|
| 7 |
+
Alyosha Efros UC Berkeley
|
| 8 |
+
|
| 9 |
+
Sergey Levine UC Berkeley
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
Prediction is arguably one of the most basic functions of an intelligent system. In general, the problem of predicting events in the future or between two waypoints is exceedingly difficult. However, most phenomena naturally pass through relatively predictable bottlenecks—while we cannot predict the precise trajectory of a robot arm between being at rest and holding an object up, we can be certain that it must have picked the object up. To exploit this, we decouple visual prediction from a rigid notion of time. While conventional approaches predict frames at regularly spaced temporal intervals, our time-agnostic predictors (TAP) are not tied to specific times so that they may instead discover predictable “bottleneck” frames no matter when they occur. We evaluate our approach for future and intermediate frame prediction across three robotic manipulation tasks. Our predictions are not only of higher visual quality, but also correspond to coherent semantic subgoals in temporally extended tasks.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Imagine taking a bottle of water and laying it on its side. Consider what happens to the surface of the water as you do this: which times can you confidently make predictions about? The surface is initially flat, then becomes turbulent, until it is flat again, as shown in Fig 1. Predicting the exact shape of the turbulent liquid is extremely hard, but its easy to say that it will eventually settle down.
|
| 18 |
+
|
| 19 |
+
Prediction is thought to be fundamental to intelligence (Bar, 2009; Clark, 2013; Hohwy, 2013). If an agent can learn to predict the future, it can take anticipatory actions, plan through its predictions, and use prediction as a proxy for representation learning. The key difficulty in prediction is uncertainty. Visual prediction approaches attempt to mitigate uncertainty by predicting iteratively in heuristically chosen small timesteps, such as, say, $0 . 1 s$ . In the bottle-tilting case, such approaches generate blurry images of the chaotic states at $t = 0 . 1 s , 0 . 2 s , . . . ,$ , and this blurriness compounds to make predictions unusable within a few steps. Sophisticated probabilistic approaches have been proposed to better handle this uncertainty (Babaeizadeh et al., 2018; Lee et al., 2018; Denton & Fergus, 2018; Xue et al., 2016).
|
| 20 |
+
|
| 21 |
+
What if we instead change the goal of our prediction models? Fixed time intervals in prediction are in many ways an artifact of the fact that cameras and monitors record and display video at fixed frequencies. Rather than requiring predictions at regularly spaced future frames, we ask: if a frame prediction is treated as a bet on that frame occurring at some future point, what should we predict? Such time-agnostic prediction (TAP) has two immediate effects: (i) the predictor may skip more uncertain states in favor of less uncertain ones, and (ii) while in the standard approach, a prediction is wrong if it occurs at $t \pm \epsilon$ rather than at $t$ , our formulation considers such predictions equally correct.
|
| 22 |
+
|
| 23 |
+
Recall the bottle-tilting uncertainty profile. Fig 1 depicts uncertainty profiles for several other prediction settings, including both forward/future prediction (given a start frame) and intermediate prediction (given start and end frames). Our time-agnostic reframing of the prediction problem targets the minima of these profiles, where prediction is intuitively easiest. We refer to these minima states as “bottlenecks.”
|
| 24 |
+
|
| 25 |
+
At this point, one might ask: are these “easy” bottlenecks actually useful to predict? Intuitively, bottlenecks naturally correspond to reliable subgoals—an agent hoping to solve the maze in Fig 1 (e) would do well to target its bottlenecks as subgoals. In our experiments, we evaluate the usefulness of our predictions as subgoals in simulated robotic manipulation tasks.
|
| 26 |
+
|
| 27 |
+

|
| 28 |
+
Figure 1: (a) Over time as the bottle is tilted, the uncertainty first rises and then falls as the bottle is held steady after tilting. (b)-(e) Similar uncertainty profiles corresponding to various scenarios—a ball rolling down the side of a bowl, a car driving on a highway with an exit $1 0 0 \mathrm { m }$ away, an iron pellet tossed in the direction of a magnet, and intermediate frame prediction in a maze traversal given start and end states. The red asterisks along the $\mathbf { X } ^ { } -$ -axis correspond to the asterisks in the maze—these “bottleneck” states must occur in any successful traversal.
|
| 29 |
+
|
| 30 |
+
Our main contributions are: (i) we reframe the video prediction problem to be time-agnostic, (ii) we propose a novel technical approach to solve this problem, (iii) we show that our approach effectively identifies “bottleneck states” across several tasks, and (iv) we show that these bottlenecks correspond to subgoals that aid in planning towards complex end goals.
|
| 31 |
+
|
| 32 |
+
# 2 RELATED WORK
|
| 33 |
+
|
| 34 |
+
Visual prediction approaches. Prior visual prediction approaches regress directly to future video frames in the pixel space (Ranzato et al., 2014; Oh et al., 2015) or in a learned feature space (Hadsell et al., 2006; Mobahi et al., 2009; Jayaraman & Grauman, 2015; Wang et al., 2016; Vondrick et al., 2016b; Kitani et al., 2012). The success of generative adversarial networks (GANs) (Goodfellow et al., 2014; Mirza & Osindero, 2014; Radford et al., 2015; Isola et al., 2017) has inspired many video prediction approaches (Mathieu et al., 2015; Vondrick et al., 2016a; Finn & Levine, 2017; Xue et al., 2016; Oh et al., 2015; Ebert et al., 2017; Finn et al., 2016; Larsen et al., 2016; Lee et al., 2018). While adversarial losses aid in producing photorealistic image patches, prediction has to contend with a more fundamental problem: uncertainty. Several approaches (Walker et al., 2016; Xue et al., 2016; Denton & Fergus, 2018; Lee et al., 2018; Larsen et al., 2016; Babaeizadeh et al., 2018) exploit conditional variational autoencoders (VAE) (Kingma & Welling, 2013) to train latent variable models for video prediction. Pixel-autoregression (Oord et al., 2016; van den Oord et al., 2016; Kalchbrenner et al., 2016) explicitly factorizes the joint distribution over all pixels to model uncertainty, at a high computational cost.
|
| 35 |
+
|
| 36 |
+
Like these prior approaches, we too address the uncertainty problem in video prediction. We propose a general time-agnostic prediction (TAP) framework for prediction tasks. While all prior work predicts at fixed time intervals, we aim to identify inherently low-uncertainty bottleneck frames with no associated timestamp. We show how TAP may be combined with conditional GANs as well as VAEs, to handle the residual uncertainty in its predictions.
|
| 37 |
+
|
| 38 |
+
Bottlenecks. In hierarchical reinforcement learning, bottlenecks are proposed for discovery of options (Sutton et al., 1999) in low-dimensional state spaces in (McGovern & Barto, 2001; S¸ ims¸ek & Barto, 2009; Bacon, 2013; Metzen, 2013). Most approaches (S¸ims¸ek & Barto, 2009; Bacon, 2013; Metzen, 2013) construct full transition graphs and apply notions of graph centrality to locate bottlenecks. A multi-instance learning approach is applied in (McGovern & Barto, 2001) to mine states that occur in successful trajectories but not in others. We consider the use of our bottleneck predictions as subgoals for a hierarchical planner, which is loosely related to options in that both aim to break down temporally extended trajectories into more manageable chunks. Unlike these prior works, we use predictability to identify bottlenecks, and apply this to unlabeled high-dimensional visual state trajectories.
|
| 39 |
+
|
| 40 |
+
Concurrently with us, Neitz et al. (2018) also propose a similar idea that allows a predictor to select when to predict, and their experiments demonstrate its advantages in specially constructed tasks with clear bottlenecks. In comparison, we propose not just the basic time-agnostic loss (Sec 3.1), but also improvements in Sec 3.2 through 3.5 that allow time-agnostic prediction to work in more general tasks such as synthetic and real videos of robotic object manipulation. Our experiments also test the quality of discovered bottlenecks in these scenarios and their usefulness as subgoals for hierarchical planning.
|
| 41 |
+
|
| 42 |
+
# 3 TIME-AGNOSTIC PREDICTION OF BOTTLENECK FRAMES
|
| 43 |
+
|
| 44 |
+
In visual prediction, the goal is to predict a set of unobserved target video frames given some observed context frames. In forward prediction, the context is the first frame, and the target is all future frames. In the bidirectionally conditioned prediction case, the context is the first and the last frame, and the frames in between are the target. In Fig 1, we may wish to predict future images of the tilting bottle, or intermediate images of an agent who traverses the maze successfully.
|
| 45 |
+
|
| 46 |
+
# 3.1 MINIMUM-OVER-TIME LOSS
|
| 47 |
+
|
| 48 |
+
In standard fixed-time video prediction models (Ranzato et al., 2014; Oh et al., 2015; Mathieu et al., 2015; Vondrick et al., 2016a; Walker et al., 2016; Finn & Levine, 2017; Xue et al., 2016; Oh et al., 2015; Ebert et al., 2017; Finn et al., 2016; Lee et al., 2018; Denton & Fergus, 2018), a frame $x _ { \tau }$ (video frame at time $\tau$ ) is selected in advance to be the training target for some given input frames $c$ . For instance, in a
|
| 49 |
+
|
| 50 |
+

|
| 51 |
+
Figure 2: The TAP minimum-over time loss.
|
| 52 |
+
|
| 53 |
+
typical forward prediction setup, the input may be $c = x _ { 0 }$ , and the target frame may be set to $x _ { \tau } = x _ { 1 }$ A predictor $G$ takes context frames $c$ as input and produces a single frame $G ( c )$ . $G$ is trained as:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
G ^ { * } = \underset { G } { \arg \operatorname* { m i n } } \mathcal { L } _ { 0 } ( G ) = \underset { G } { \arg \operatorname* { m i n } } \mathcal { E } ( G ( c ) , x _ { \tau } ) ,
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
where $\mathcal { E }$ is a measure of prediction error, such as $\| G ( c ) - x _ { \tau } \| _ { 1 }$ .1 This predictor may be applied recursively at test time to generate more predictions as ${ \dot { G } } ( G ( c ) ) , G ( G ( G ( c ) ) )$ , and so on.
|
| 60 |
+
|
| 61 |
+
We propose to depart from this fixed-time paradigm by decoupling prediction from a rigid notion of time. Instead of predicting the video frame at a specified time $\tau$ , we propose to predict predictable bottleneck video frames through a time-agnostic predictor (TAP), as motivated in Sec 1. To train this predictor, we minimize the following “minimum-over-time” loss:
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
G ^ { * } = \underset { G } { \arg \operatorname* { m i n } } \ : \mathcal { L } ( G ) = \underset { G } { \arg \operatorname* { m i n } } \ : \underset { t \in \mathrm { T } } { \operatorname* { m i n } } \ : \mathcal { E } ( G ( c ) , x _ { t } ) ,
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
where the key difference from $\mathrm { E q ~ } 1$ is that the loss is now a minimum over target times of a timeindexed error $\mathcal { E } _ { t } = \mathcal { E } ( \cdot , x _ { t } )$ . The target times are defined by a set of time indices T. For forward prediction starting from input $c = x _ { 0 }$ , we may set targets to $\mathrm { T } = \{ 1 , 2 , \ldots \}$ . Fig 2 depicts this idea schematically. Intuitively, the penalty for a prediction is determined based on the closest matching ground truth target frame. This loss incentivizes the model to latch on to “bottleneck” states in the video, i.e., those with low uncertainty. In the bottle-tilting example, this would mean producing an image of the bottle after the water has come to rest.
|
| 68 |
+
|
| 69 |
+
One immediate concern with this minimum-over-time TAP loss might be that it could produce degenerate predictions very close to the input conditioning frames $c$ . However, as in the tilting bottle and other cases in Fig 1, uncertainty is not always lowest closest to the observed frames. Moreover, target frame indices $\mathrm { T }$ are always disjoint from the input context frames, so the model’s prediction must be different from input frames by at least one step, which is no worse than the one-step-forward prediction of Eq 1. In our experiments, we show cases where the minimum-over-time loss above captures natural bottlenecks successfully. Further, Sec 3.2 shows how it is also possible to explicitly penalize predictions near input frames $c$ .
|
| 70 |
+
|
| 71 |
+
This minimum loss may be viewed as adaptively learning the time offset $\tau$ , but in fact, the predictor’s task is even simpler since it is not required to provide a timestamp accompanying its prediction. For example, in Fig 1(e), it need only specify which points in the maze the agent will go through; it need not specify when. Lifting the requirement of a timestamped prediction relieves TAP approaches of a significant implicit burden.
|
| 72 |
+
|
| 73 |
+
Recursive TAP. TAP models may also be trained for recursive prediction, by minimizing the following loss:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
G ^ { * } = \underset { G } { \arg \operatorname* { m i n } } \mathcal L _ { \mathrm { r e c } } ( G ) = \underset { G } { \arg \operatorname* { m i n } } \sum _ { r } \underset { t \in \mathrm { T } ( r ) } { \min } \mathcal { E } ( G ( c ( r ) ) , x _ { t } ) ,
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
where $c ( r )$ and $\mathrm { T } ( r )$ are the input and target set at recursion level $r$ , both dynamically adapted based on the previous prediction. The input $c ( r )$ may be set to the previous prediction $G ( c ( r - 1 ) )$ , so that the sequence of predictions is $( G ( c ( 0 ) ) , G ( G ( c ( 0 ) ) ) , \dots )$ . $\mathrm { T } ( r )$ is set to target all times after the last prediction. In other words, if the prediction at $r = 0$ was closest to frame $x _ { 5 }$ , the targets for $r = 1$ are set to $\mathrm { T } ( 1 ) = \{ 6 , 7 , \ldots \}$ . While we also test recursive TAP in Sec 4, in the rest of this section, we discuss the non-recursive formulation, building on $\operatorname { E q } 2$ , for simplicity.
|
| 80 |
+
|
| 81 |
+
Bidirectional TAP. Finally, while the above description of TAP has focused on forward prediction, the TAP loss of Eq 2 easily generalizes to bidirectional prediction. Given input frames $c = ( x _ { 0 } , x _ { \mathrm { l a s t } } )$ , fixed-time bidirectional predictors might target, say, the middle frame $x _ { \tau } = x _ { \mathrm { l a s t / 2 } }$ . Instead, bidirectional TAP models target all intermediate frames, i.e., $\mathrm { T } = \{ 1 , 2 , . . . , \mathrm { l a s t } - 1 \}$ in Eq 2. As in forward prediction, the model has incentive to predict predictable frames. In the maze example from Fig 1, this would mean producing an image of the agent at one of the asterisks.
|
| 82 |
+
|
| 83 |
+
# 3.2 FROM MINIMUM TO GENERALIZED MINIMUM TAP LOSS
|
| 84 |
+
|
| 85 |
+
Within the time-agnostic prediction paradigm, we may still want to specify preferences for some times over others, or for some visual properties of the predictions. Consider the minimum-over-time loss $\mathcal { L }$ in Eq 2. Taking the minimum inside, this may be rewritten as:
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
{ \mathcal { L } } ( G ) = \operatorname* { m i n } _ { t \in T } { \mathcal { E } } _ { t } = { \mathcal { E } } _ { \arg \operatorname* { m i n } _ { t \in T } { \mathcal { E } } _ { t } } ,
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
where we use the time-indexed error $\mathcal { E } _ { t }$ as shorthand for $\mathcal { E } ( . , x _ { t } )$ . We may now extend this to the following “generalized minimum” loss, where the outer and inner errors are decoupled:
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\begin{array} { r } { \mathcal { L } ^ { \prime } ( G ) = \mathcal { E } _ { \mathrm { a r g m i n } _ { t \in T } } \mathcal { E } _ { t } ^ { \prime } . } \end{array}
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
Now, $\mathcal { E } _ { t } ^ { \prime }$ , over which the minimum is computed, could be designed to express preferences about which frames to predict. In the simplest case, $\mathcal { E } _ { t } ^ { \prime } = \mathcal { E } _ { t }$ , and the loss reduces to $\operatorname { E q } 2$ . Instead, suppose that predictions at some times are preferred over others. Let $w ( t )$ express the preference value for all target times $t \in T$ , so that higher $w ( t )$ indicates higher preference. Then we may set $\mathcal { E } _ { t } ^ { \prime } = \mathcal { E } _ { t } / w ( t )$ so that times $t$ with higher $w ( t )$ are preferred in the arg min. In our experiments, we set $w ( t )$ to linearly increase with time during forward prediction and to a truncated discrete Gaussian centered at the midpoint in bidirectional prediction.
|
| 98 |
+
|
| 99 |
+
At this point, one might ask: could we not directly incorporate preferences into the outer error? For instance, why not simply optimize $\mathrm { m i n } _ { t } \mathcal { E } _ { t } / w ( t ) ^ { \star }$ ? Unfortunately, that would have the sideeffect of downweighting the errors computed against frames with higher preferences $w ( t )$ , which is counterproductive. Decoupling the outer and inner errors instead, as in $\operatorname { E q } 5$ , allows applying preferences $w ( t )$ only to select the target frame to compute the outer loss against; the outer loss itself penalizes prediction errors equally regardless of which frame was selected.
|
| 100 |
+
|
| 101 |
+
The generalized minimum formulation may be used to express other kinds of preferences too. For instance, when using predictions as subgoals in a planner, perhaps some states are more expensive to reach than others. We also use the generalized minimum to select frames using different criteria than the prediction penalty itself, as we will discuss in Sec 3.5.
|
| 102 |
+
|
| 103 |
+
# 3.3 TIME-AGNOSTIC CONDITIONAL GANS
|
| 104 |
+
|
| 105 |
+
TAP is not limited to simple losses such as $\ell _ { 1 }$ or $\ell _ { 2 }$ errors; it can be extended to handle expressive GAN losses to improve perceptual quality. A standard conditional GAN (CGAN) in fixed-time video prediction targeting time $\tau$ works as follows: given a “discriminator” $D$ that outputs 0 for input-prediction tuples and 1 for input-ground truth tuples, the generator $G$ is trained to fool the discriminator. The discriminator in turn is trained adversarially using a binary cross-entropy loss. The CGAN objective is written as:
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\begin{array} { r l } & { G ^ { * } = \underset { G } { \arg \operatorname* { m i n } } \ \underset { D } { \operatorname* { m a x } } \mathcal { L } _ { \mathrm { c g a n } } ( G , D ) , } \\ & { } \\ & { \mathcal { L } _ { \mathrm { c g a n } } ( G , D ) = \log ( D ( c , x _ { \tau } ) ) + \log ( 1 - D ( c , G ( c ) ) } \end{array}
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
To make this compatible with TAP, we train $| \mathrm { T } |$ discriminators $\{ D _ { t } \}$ , one per timestep. Then, analogous to $\operatorname { E q } 2$ , we may define a time-agnostic CGAN loss:
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
\begin{array} { r l } & { G ^ { * } = \underset { G } { \arg \operatorname* { m i n } } \underset { t \in T } { \operatorname* { m i n } } \underset { D _ { t } } { \operatorname* { m a x } } \mathcal { L } _ { \mathrm { c g a n } } ^ { t } ( G , D _ { t } ) , } \\ & { \mathcal { L } _ { \mathrm { c g a n } } ^ { t } ( G , D _ { t } ) = \log D _ { t } ( c , x _ { t } ) + \log ( 1 - D _ { t } ( c , G ( c ) ) ) + \underset { t ^ { \prime } \neq t } { \sum } \log ( 1 - D _ { t } ( c , x _ { t ^ { \prime } } ) ) , } \end{array}
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
Like $\mathrm { E q } 6 , \mathrm { E q } 7$ defines a cross-entropy loss. The first two terms are analogous to $\operatorname { E q } 6$ — for the $t$ -th discriminator, the $t$ -th frame provides a positive, and the generated frame provides a negative instance. The third term treats ground truth video frames occurring at other times $x _ { t ^ { \prime } \neq t }$ as negatives. In practice, we train a single discriminator network with $| T |$ outputs that serve as $\{ D _ { t } \}$ . Further, for computational efficiency, we approximate the summation over $t ^ { \prime } \neq t$ by sampling a single frame at random for each training video at each iteration. Appendix A provides additional details.
|
| 118 |
+
|
| 119 |
+
# 3.4 TIME-AGNOSTIC CONDITIONAL VAES
|
| 120 |
+
|
| 121 |
+
While TAP targets low-uncertainty bottleneck states, it may be integrated with a conditional variational autoencoder (CVAE) to handle residual uncertainty at these bottlenecks. In typical fixed-time CVAE predictors targeting time $\tau$ , variations in a latent code $z$ input to a generator $G ( c , z )$ must capture stochasticity in $x _ { \tau }$ . At training time, $z$ is sampled from a posterior distribution $q _ { \phi } ( z | x _ { \tau } )$ with parameters $\phi$ , represented by a neural network. At test time, $z$ is sampled from a prior $p ( z )$ . The training loss combines a log-likelihood term with a KL-divergence from the prior:
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
\begin{array} { r } { \mathcal { L } _ { \mathrm { c v a e } } ( G , \phi ) = D _ { K L } ( q _ { \phi } ( z | x _ { \tau } ) , p ( z ) ) - \mathbb { E } _ { z \sim q _ { \phi } ( z | x _ { \tau } ) } \ln p _ { G } ( x _ { \tau } | c , z ) , } \end{array}
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
where we might set $p _ { G }$ to a Laplacian distribution such that the second term reduces to a $l 1$ - reconstruction loss $- \ln p _ { G } ( x _ { \tau } | \bar { c , { z } } ) = \| \boldsymbol { G } ( c , { z } ) - \boldsymbol { x } _ { \tau } \| _ { 1 }$ . In a time-agnostic CVAE, rather than capturing stochasticity at a fixed time $\tau$ , $z$ must now capture stochasticity at bottlenecks: e.g., when the agent crosses one of the asterisks in the maze of $\mathrm { F i g ~ 1 }$ , which pose is it in? The bottleneck’s time index varies and is not known in advance. For computational reasons (see Appendix B), we pass the entire video $X$ into the inference network $q _ { \phi }$ , similar to Babaeizadeh et al. (2018). The negative log-likelihood term is adapted to be a minimum-over-time:
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
\mathcal { L } _ { \mathrm { c v a e } } ( G , \phi ) = D _ { K L } ( q _ { \phi } ( z | X ) , p ( z ) ) + \operatorname* { m i n } _ { t \in \mathbb { T } } \mathbb { E } _ { z \sim q _ { \phi } ( z | X ) } \left[ - \ln p _ { G } ( x _ { t } | c , z ) \right] .
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
# 3.5 COMBINED LOSS, NETWORK ARCHITECTURE, AND TRAINING
|
| 134 |
+
|
| 135 |
+
We train time-agnostic CVAE-GANs with the following combination of a generalized minimum loss (Sec 3.2) and the CVAE KL divergence loss (Sec 3.4):
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
\begin{array} { r l } & { G ^ { * } = \underset { G } { \arg \operatorname* { m i n } } \underset { \phi } { \operatorname* { m i n } } \left[ D _ { K L } ( q _ { \phi } ( \boldsymbol { z } | \boldsymbol { X } ) , p ( \boldsymbol { z } ) ) + \mathcal { E } _ { \mathrm { a r g } \operatorname* { m i n } _ { t \in \mathbb { T } } } \varepsilon _ { t } ^ { \prime } \right] , } \\ & { \mathcal { E } _ { t } = \underset { D , D ^ { \prime } } { \operatorname* { m a x } } \mathcal { L } _ { \mathrm { c g a n } } ^ { t } ( G , D _ { t } ) + \mathcal { L } _ { \mathrm { c v a e - g a n } } ^ { t } ( G , D _ { t } ^ { \prime } ) + \| G ( \boldsymbol { c } , \boldsymbol { z } ) - x _ { t } \| _ { 1 } , } \\ & { \mathcal { E } _ { t } ^ { \prime } = \| G ( \boldsymbol { c } , \boldsymbol { z } ) - x _ { t } \| _ { 1 } / w ( t ) . } \end{array}
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
The outer error $\mathcal { E } _ { t }$ absorbs the CGAN discriminator errors (Sec 3.3), while the inner error $\mathcal { E } _ { t } ^ { \prime }$ is a simple $\ell _ { 1 }$ error, weighted by user-specified time preferences $w ( t )$ (Sec 3.2). Omitting GAN error terms in $\mathcal { E } _ { t } ^ { \prime }$ helps stabilize training, since learned errors may not always be meaningful especially includesthe prior early on in training. As in VAE-GANs (Larsen et al., 2016; Lee et al., 2018), the training objective w term , while $\mathcal { L } _ { \mathrm { c v a e - g a n } } ^ { t }$ , analogous to instead sample $\mathcal { L } _ { \mathrm { c g a n } } ^ { t }$ (Eq 7). We set om the posterior $\mathcal { L } _ { \mathrm { c g a n } } ^ { t }$ to use samples , and employs s $z$ fromarate $p ( z )$ $\mathcal { L } _ { \mathrm { c v a e - g a n } } ^ { t }$ $z$ $q _ { \phi } ( z | X )$ discriminators $\{ D _ { t } ^ { \prime } \}$ . The $\ell _ { 1 }$ loss also samples $z$ from the posterior. We omit expectations over the VAE latent $z$ to keep notation simple.
|
| 142 |
+
|
| 143 |
+
Frame generation in the predictor involves first generating appearance flow-transformed input frames (Zhou et al., 2016) and a frame with new uncopied pixels. These frames are masked and averaged to produce the output. Full architecture and training details are in Appendix C.
|
| 144 |
+
|
| 145 |
+

|
| 146 |
+
Figure 3: (Best seen in pdf) One sample episode each for grasping, pick-andplace, and pushing. Time overlaid on each frame.
|
| 147 |
+
|
| 148 |
+

|
| 149 |
+
Figure 4: Forward prediction $\ell _ { 1 }$ error for grasping. TAP methods (red) perform better than fixedtime predictors over all time steps.
|
| 150 |
+
|
| 151 |
+
# 4 EXPERIMENTS
|
| 152 |
+
|
| 153 |
+
We have proposed a time-agnostic prediction (TAP) paradigm that is different from the fixed-time paradigm followed in prior prediction work. In our experiments, we focus on comparing TAP against a representative fixed-time prediction model, keeping network architectures fixed. We use three simulated robot manipulation settings: object grasping ( $5 0 \mathrm { k }$ episodes), pick-and-place $7 5 \mathrm { k }$ episodes), and multi-object pushing (55k episodes). Example episodes from each task are shown in Fig 3 (videos in Supp). $5 \%$ of the data is set aside for testing. We use $6 4 \times 6 4$ images.
|
| 154 |
+
|
| 155 |
+
For grasping (15 frames per episode), the arm moves to a single object on a table, selects a grasp, and lifts it vertically. For pick-and-place (20 frames), the arm additionally places the lifted object at a new position before performing a random walk. For pushing (40 frames), two objects are initialized at random locations and pushed to random final positions. Object shapes and colors in all three settings are randomly generated. Fig 3 shows example episodes.
|
| 156 |
+
|
| 157 |
+
Forward prediction. First, we evaluate our approach for forward prediction on grasping. The first frame (“start”) is provided as input. We train fixed-time baselines (architecture same as ours, using $\ell _ { 1 }$ and GAN losses same as MIN and GENMIN) that target predictions at exactly 0.25, 0.50, 0.75, 1.0 fraction of the episode length (FIX0.25,. . . , FIX1.00). MIN and GENMIN are TAP with/without the generalized minimum of ${ \tt S e c 3 . 2 }$ . For GENMIN, we evaluate different choices of the time preference vector $w ( t )$ (Sec 3.2). We set $w ( t ) = \beta + t / 1 5$ , so that our preference increases linearly from $\beta$ to $\beta + 1$ . Since $w ( t )$ applies multiplicatively, low $\beta$ corresponds to high disparity in preferences $\beta = \infty$ reduces to MIN, i.e., no time preference). GENMIN2 is our approach with $\beta = 2$ and so on.
|
| 158 |
+
|
| 159 |
+
Fig 5 shows example predictions from all methods for the grasping task. In terms of visual quality of predictions and finding a semantically coherent bottleneck, GENMIN2, GENMIN4, and GENMIN7 perform best—they reliably produce a grasp on the object while it is still on the table. With little or no time preferences, MIN and GENMIN10 produce images very close to the start, while GENMIN0.5 places too high a value on predictions farther away, and produces blurry images of the object after lifting.
|
| 160 |
+
|
| 161 |
+
Quantitatively, for each method, we report the min and arg min index of the $\ell _ { 1 }$ distance to all frames in the video, as “min $\ell _ { 1 }$ err” and “match-step” (“which future ground truth frame is the prediction closest to?”). Fig 4 shows a scatter plot, where each dot or square is one model. TAP (various models with varying $\beta$ ) produces an even larger variation in stepsizes than fixed-time methods explicitly targeting the entire video $\mathrm { ' } _ { \mathrm { F I X 0 . 7 5 } }$ and $\mathrm { F I X } 1 . 0$ fall short of producing predictions at 0.75 and 1.0 fraction of the episode length). TAP also produces higher quality predictions (lower error) over that entire range. From these quantitative and qualitative results, we see that TAP not only successfully encourages semantically coherent bottleneck predictions, it also produces higher quality predictions than fixed-time prediction over a range of time offsets.
|
| 162 |
+
|
| 163 |
+
Intermediate frame prediction. Next, we evaluate our approaches for bidirectionally conditioned prediction in all three settings. Initial and final frames are provided as input, and the method is trained to generate an intermediate frame. The FIX baseline now targets the middle frame. As before, MIN and GENMIN are our TAP models. The GENMIN time preference $w ( t )$ is bell-shaped and varies from 2/3 at the ends to 1 at the middle frame (see Appendix E).
|
| 164 |
+
|
| 165 |
+
Figs 6 and 9 show examples from the three settings. TAP approaches successfully discover interesting bottlenecks in each setting. For grasping (Fig 6 (left)), both MIN and GENMIN consistently produce clear images of the arm at the point at which it picks up the object. Pick-and-place (Fig 6, right) is harder because it is more temporally extended, and the goal image does not specify how to grasp the object. FIX struggles to produce any coherent predictions, but GENMIN once again identifies bottlenecks reliably—in examples #3 and #1, it predicts the “pick” and the “place” respectively. For the pushing setting (Fig 9 (left)), GENMIN frequently produces images with one object moved and the other object fixed in place, which again is a semantically coherent bottleneck for this task. In row #1, it moves the correct object first to generate the subgoal, so that objects do not collide.
|
| 166 |
+
|
| 167 |
+

|
| 168 |
+
|
| 169 |
+

|
| 170 |
+
Figure 5: (Best seen in pdf) Forward prediction results on grasping comparing fixed-time predictors and our approach. Each row is a separate example. First column is the input. Thereafter, each column corresponds to the output of a different model per the column title. More in Appendix Fig 17.
|
| 171 |
+
Figure 6: (Best seen in pdf) Bidirectional prediction results comparing fixed-time prediction and our approach. (Left) Grasping results. First two columns are inputs (start and goal). Thereafter, each column corresponds to the output of a different model per the column title. “match” is the ground truth image closest to the GENMIN prediction. More in Appendix Fig 13. (Right) Similar results for pick-and-place. More in Appendix Fig 14.
|
| 172 |
+
|
| 173 |
+
Table 1 shows quantitative results over the full test set. As in forward prediction, we report min $\ell _ { 1 }$ error and the best-matching frame index (“match-step”) for all methods. MIN and GENMIN consistently yield higher quality predictions (lower error) than FIX at similar times on average. As an example, GENMIN reduces FIX errors by $21 \%$ , $2 6 . 5 \%$ , and $5 3 . 2 \%$ on the three tasks—these are consistent and large gains that increase with increasing task complexity/duration. Additionally, while all foregoing results were reported without the CVAE approach of Sec 3.4, Table 1 shows results for GENMIN+VAE, and Fig 9 shows example predictions for pick-and-place. In our models, individual stochastic predictions from GENMIN $^ +$ VAE produce higher $\ell _ { 1 }$ errors than GENMIN. However, the CVAE helps capture meaningful sources of stochasticity at the bottlenecks—in Fig 9 (right), it produces different grasp configurations to pick up the object in each case. To measure this, we evaluate the best of 100 stochastic predictions from GENMIN $^ +$ VAE in Table 1 (GENMIN $^ +$ VAE BEST-OF-100). On pick-and-place and pushing, the best VAE results are significantly better than any of the deterministic methods. Table 1 also shows results for our method without the GAN (GENMIN W/O GAN)—while its $\ell _ { 1 }$ errors are comparable, we observed a drop in visual quality.
|
| 174 |
+
|
| 175 |
+
Table 1: Bidirectional frame prediction performance on: grasping, pick-and-place, and two-object pushing. Lower min $\ell _ { 1 }$ err is better. match-step denotes which times are being predicted, out of $T$ steps. It is clear that TAP methods make better predictions than fixed-time prediction at the same time offsets.
|
| 176 |
+
|
| 177 |
+
<table><tr><td>Setting→ Method↓</td><td>Grasping (T=15 steps) min lierr</td><td>match-step/T</td><td>Pick-and-place (T=20 steps) min l1 err</td><td>match-step/T</td><td>Pushing (T=30 steps) min l1 err</td><td>match-step/T</td></tr><tr><td>fix</td><td>0.0153</td><td>0.51±0.17</td><td>0.0366</td><td>0.53±0.24</td><td>0.0722</td><td>0.36±0.19</td></tr><tr><td>MIN (ours)</td><td>0.0104</td><td>0.49±0.18</td><td>0.0256</td><td>0.41±0.30</td><td>0.0365</td><td>0.35±0.22</td></tr><tr><td>GENMIN (ours)</td><td>0.0121</td><td>0.45±0.16</td><td>0.0269</td><td>0.42±0.23</td><td>0.0338</td><td>0.36±0.19</td></tr><tr><td>GENMIN W/O GAN (Ours)</td><td>0.0117</td><td>0.45±0.16</td><td>0.0235</td><td>0.46±0.25</td><td>0.0411</td><td>0.37±0.19</td></tr><tr><td>GENMIN + VAE (Ours)</td><td>0.0156</td><td>0.47±0.18</td><td>0.0432</td><td>0.31±0.24</td><td>0.0447</td><td>0.37±0.21</td></tr><tr><td>GENMIN + VAE BEST-OF-10O (Ours)</td><td>0.0121</td><td>-</td><td>0.0196</td><td>-</td><td>0.0236</td><td>-</td></tr></table>
|
| 178 |
+
|
| 179 |
+

|
| 180 |
+
Figure 9: (Best seen in pdf) (Left) Bidirectional prediction results on two-object pushing. More in Appendix Fig 15. (Right) When used with a VAE (Sec 3.4), our approach captures residual stochasticity at the bottleneck. In these results from the pick-and-place task, GENMIN $^ +$ VAE produces images that are all of the arm in contact with the object on the table, but at different points on the object, and with different arm/gripper poses.
|
| 181 |
+
|
| 182 |
+
As indicated in ${ \mathrm { S e c } } 3 . 1$ and Eq 3, TAP may also be applied recursively. Fig 7 compares consecutive subgoals for the pick-and-place task produced by recursive TAP versus a recursive fixed-time model. Recursion level $r = 1$ refers to the first subgoal, and $r = 2$ refers to the subgoal generated when the first subgoal is provided as the goal input (start input is unchanged). In example #1, FIX struggles while “ours” identifies the “place” bottleneck at $r = 1$ , and subsequently the “pick” botleneck at $r = 2$ .
|
| 183 |
+
|
| 184 |
+

|
| 185 |
+
Figure 7: Recursive bidirectional prediction on pickand-place. $r = 2$ is earlier in time than $r = 2$ .
|
| 186 |
+
|
| 187 |
+
Finally, we test on “BAIR pushing” (Ebert et al., 2017), a real-world dataset that is commonly used in visual prediction tasks. The data consists of 30-frame clips of random motions of a Sawyer arm tabletop. While this dataset does not have natural bottlenecks like in grasping, TAP (min $\ell _ { 1 }$ error 0.046 at match-step 15.42) still performs better than FIX (0.059 at 15.29). Qualitatively, as Fig 8 shows, even though BAIR pushing contains incoherent random arm motions, TAP consistently produces predictions that plausibly lie on the path from start to goal image. In example #1, given a start and goal image with one object displaced, “ours” correctly moves the arm to the object before displacement, whereas FIX struggles.
|
| 188 |
+
|
| 189 |
+

|
| 190 |
+
Figure 8: Bidirectional prediction results on BAIR pushing data. The first two columns are the inputs, and the next two correspond to FIX and GENMIN.
|
| 191 |
+
|
| 192 |
+
Bottleneck discovery frequency. We have thus far relied on qualitative results to assess how often our approach finds coherent bottlenecks. For pushing, we test bottleneck discovery frequency more quantitatively. We make the reasonable assumption that bottlenecks in 2-object pushing correspond to states where one object is pushed and the other is in place. Our metric exploits knowledge of true object positions at start and goal states. First, for this evaluation, we restrict both GENMIN and FIX to synthesize predictions purely by warping and masking inputs. Thus, we can track where the pixels at ground truth object locations in start and goal images end up in the prediction, i.e., where did each object move? We then compute a score that may be thresholded to detect when only one object moves (details in Appendix F). As an intuitive example, suppose that the two objects are displaced by $1 0 \mathrm { c m }$ and $1 5 \mathrm { { c m } }$ respectively between start and goal frames. Suppose further that our predictor predicts the start frame as its output. Then its distance score would be computed to be 10 cm. For all values of threshold below $1 0 \mathrm { c m }$ , this would be counted as a bottleneck discovery failure.
|
| 193 |
+
|
| 194 |
+

|
| 195 |
+
Figure 10: Bottleneck frequency vs. score threshold
|
| 196 |
+
|
| 197 |
+
As Fig 10 shows, GENMIN predicts bottlenecks much more frequently $\sim 6 0 \%$ of the time) than FIX. As hypothesized, our time-agnostic approach does indeed identify and latch on to low-uncertainty states to improve its predictions.
|
| 198 |
+
|
| 199 |
+
Hierarchical planning evaluation. Finally, we discuss experiments directly evaluating our intermediate predictions as visual subgoals for hierarchical planning for pushing tasks. A forward Visual MPC planner (Ebert et al., 2017) accepts the subgoal object positions (computed as above for evaluating bottlenecks). Start and goal object positions are also known. Internally, Visual MPC makes action-conditioned fixed-time forward predictions of future object positions to find an action sequence that reaches the subgoal object
|
| 200 |
+
|
| 201 |
+
<table><tr><td></td><td>2-object</td><td>3-object</td></tr><tr><td>direct</td><td>12.9±0.6</td><td>15.8±0.6</td></tr><tr><td>FIX</td><td>12.5±0.5</td><td>17.6±0.6</td></tr><tr><td>GENMIN</td><td>11.9±0.6</td><td>12.9±0.7</td></tr></table>
|
| 202 |
+
|
| 203 |
+
Table 2: Multi-object pushing errors (in cm).
|
| 204 |
+
|
| 205 |
+
positions, with a planning horizon of 15. Additional implementation details are in Appendix G.
|
| 206 |
+
|
| 207 |
+
Given start and goal images, our model produces a subgoal. Visual MPC plans towards this subgoal for half the episode length, then switches to the final goal. We compare this scheme against (i) “direct”: planning directly towards the final goal for the entire episode length, and (ii) FIX: subgoals from a center-frame predictor. The error measure is the mean of object distances to goal states (lower is better). As an upper bound, single-object pushing with the planner yields ${ \sim } 5 \mathrm { c m }$ error. Results for two-object and three-object pushing are shown in Table 2. GENMIN does best on both, but especially on the more complex three-object task. Since Visual MPC has thus far been demonstrated to work only on pushing tasks, our hierarchical planning evaluation is also limited to this task. Going forward, we plan to adapt Visual MPC to allow testing TAP on more complex temporally extended tasks like block-stacking, where direct planning breaks down and subgoals offer greater value.
|
| 208 |
+
|
| 209 |
+
# 5 CONCLUSIONS
|
| 210 |
+
|
| 211 |
+
The standard paradigm for prediction tasks demands that a predictor not only make good predictions, but that it make them on a set schedule. We have argued for redefining the prediction task so that the predictor need only care that its prediction occur at some time, rather than that it occur at a specific scheduled time. We define this time-agnostic prediction task and propose novel technical approaches to solve it, that require relatively small changes to standard prediction methods. Our results show that reframing prediction objectives in this way yields higher quality predictions that are also semantically coherent—unattached to a rigid schedule of regularly specified timestamps, model predictions instead naturally attach to specific semantic “bottleneck” events, like a grasp. In our preliminary experiments with a hierarchical visual planner, our results suggest that such predictions could serve as useful subgoals for complex tasks.
|
| 212 |
+
|
| 213 |
+
In future work, we would like to address some limitations of our TAP formulation, of which we will mention two here. First, TAP currently benefits not only from selecting which times to predict, but also from not having to provide timestamps attached to its predictions. We would like to study: could we retain the benefits of time-agnostic prediction while also providing timestamps for when each predicted state will occur? Second, our current TAP formulation may not generalize to prediction problems in all settings of interest. As an example, for videos of juggling or waving, which involve repeated frames, TAP might collapse to predicting the input state repeatedly. We would like to investigate more general TAP formulations: for example, rather than choosing $\mathcal { E } _ { t } ^ { \prime }$ in Eq 5 to encourage predicting farther away times, we could conceivably penalize predictions that look too similar to the input context frames. More broadly, we believe that our results thus far hold great promise for many applications of prediction including hierarchical planning and model-based reinforcement learning, and we hope to build further on these results.
|
| 214 |
+
|
| 215 |
+
Acknowledgements. We thank Alex Lee and Chelsea Finn for helpful discussions and Sudeep Dasari for help with the simulation framework and for generating the simulated data used in this work. We thank Kate Rakelly, Kyle Hsu, and Allan Jabri for feedback on early drafts. This work was supported by Berkeley DeepDrive, NSF IIS-1614653, NSF IIS-1633310, and an Office of Naval Research Young Investigator Program award. The NVIDIA DGX-1 used for this research was donated by the NVIDIA Corporation.
|
| 216 |
+
|
| 217 |
+
# REFERENCES
|
| 218 |
+
|
| 219 |
+
Mohammad Babaeizadeh, Chelsea Finn, Dumitru Erhan, Roy H Campbell, and Sergey Levine. Stochastic variational video prediction. ICLR, 2018.
|
| 220 |
+
|
| 221 |
+
Pierre-Luc Bacon. On the bottleneck concept for options discovery. M.S. Thesis, McGill University, 2013.
|
| 222 |
+
|
| 223 |
+
Moshe Bar. The proactive brain: memory for predictions. Philosophical Transactions of the Royal Society B: Biological Sciences, 364(1521):1235–1243, 2009.
|
| 224 |
+
|
| 225 |
+
Andy Clark. Whatever next? predictive brains, situated agents, and the future of cognitive science. Behavioral and brain sciences, 36(3):181–204, 2013.
|
| 226 |
+
|
| 227 |
+
Emily Denton and Rob Fergus. Stochastic video generation with a learned prior. arXiv preprint arXiv:1802.07687, 2018.
|
| 228 |
+
|
| 229 |
+
Frederik Ebert, Chelsea Finn, Alex X. Lee, and Sergey Levine. Self-supervised visual planning with temporal skip connections. CORL, 2017.
|
| 230 |
+
|
| 231 |
+
Chelsea Finn and Sergey Levine. Deep visual foresight for planning robot motion. In International Conference on Robotics and Automation (ICRA), 2017.
|
| 232 |
+
|
| 233 |
+
Chelsea Finn, Ian Goodfellow, and Sergey Levine. Unsupervised learning for physical interaction through video prediction. In Neural Information Processing Systems (NIPS), 2016.
|
| 234 |
+
|
| 235 |
+
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.
|
| 236 |
+
|
| 237 |
+
Raia Hadsell, Sumit Chopra, and Yann LeCun. Dimensionality reduction by learning an invariant mapping. In Computer vision and pattern recognition, 2006 IEEE computer society conference on, volume 2, pp. 1735–1742. IEEE, 2006.
|
| 238 |
+
|
| 239 |
+
Jakob Hohwy. The predictive mind. Oxford University Press, 2013.
|
| 240 |
+
|
| 241 |
+
Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. CVPR, 2017.
|
| 242 |
+
|
| 243 |
+
Dinesh Jayaraman and Kristen Grauman. Learning image representations tied to ego-motion. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1413–1421, 2015.
|
| 244 |
+
|
| 245 |
+
Nal Kalchbrenner, Aaron van den Oord, Karen Simonyan, Ivo Danihelka, Oriol Vinyals, Alex Graves, and Koray Kavukcuoglu. Video pixel networks. arXiv preprint arXiv:1610.00527, 2016.
|
| 246 |
+
|
| 247 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 248 |
+
|
| 249 |
+
Kris M Kitani, Brian D Ziebart, James Andrew Bagnell, and Martial Hebert. Activity forecasting. In European Conference on Computer Vision, pp. 201–214. Springer, 2012.
|
| 250 |
+
|
| 251 |
+
Dirk P Kroese, Reuven Y Rubinstein, Izack Cohen, Sergey Porotsky, and Thomas Taimre. Crossentropy method. In Encyclopedia of Operations Research and Management Science, pp. 326–333. Springer, 2013.
|
| 252 |
+
|
| 253 |
+
Anders Boesen Lindbo Larsen, Søren Kaae Sønderby, Hugo Larochelle, and Ole Winther. Autoencoding beyond pixels using a learned similarity metric. ICML, 2016.
|
| 254 |
+
|
| 255 |
+
Alex X Lee, Richard Zhang, Frederik Ebert, Pieter Abbeel, Chelsea Finn, and Sergey Levine. Stochastic adversarial video prediction. arXiv preprint arXiv:1804.01523, 2018.
|
| 256 |
+
|
| 257 |
+
Michael Mathieu, Camille Couprie, and Yann LeCun. Deep multi-scale video prediction beyond mean square error. arXiv preprint arXiv:1511.05440, 2015.
|
| 258 |
+
|
| 259 |
+
Amy McGovern and Andrew G Barto. Automatic discovery of subgoals in reinforcement learning using diverse density. In ICML, 2001.
|
| 260 |
+
|
| 261 |
+
Jan Hendrik Metzen. Online skill discovery using graph-based clustering. In European Workshop on Reinforcement Learning, pp. 77–88, 2013.
|
| 262 |
+
|
| 263 |
+
Mehdi Mirza and Simon Osindero. Conditional generative adversarial nets. arXiv preprint arXiv:1411.1784, 2014.
|
| 264 |
+
|
| 265 |
+
Hossein Mobahi, Ronan Collobert, and Jason Weston. Deep learning from temporal coherence in video. In Proceedings of the 26th Annual International Conference on Machine Learning, pp. 737–744. ACM, 2009.
|
| 266 |
+
|
| 267 |
+
Alexander Neitz, Giambattista Parascandolo, Stefan Bauer, and Bernhard Schlkopf. Adaptive skip intervals: Temporal abstraction for recurrent dynamical models. NIPS, 2018.
|
| 268 |
+
|
| 269 |
+
Augustus Odena, Vincent Dumoulin, and Chris Olah. Deconvolution and checkerboard artifacts. Distill, 2016. doi: 10.23915/distill.00003. URL http://distill.pub/2016/ deconv-checkerboard.
|
| 270 |
+
|
| 271 |
+
Junhyuk Oh, Xiaoxiao Guo, Honglak Lee, Richard L Lewis, and Satinder Singh. Action-conditional video prediction using deep networks in atari games. In Advances in Neural Information Processing Systems, 2015.
|
| 272 |
+
|
| 273 |
+
Aaron van den Oord, Nal Kalchbrenner, and Koray Kavukcuoglu. Pixel recurrent neural networks. arXiv preprint arXiv:1601.06759, 2016.
|
| 274 |
+
|
| 275 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
|
| 276 |
+
|
| 277 |
+
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.
|
| 278 |
+
|
| 279 |
+
Ozg ¨ ur¨ S¸ims¸ek and Andrew G Barto. Skill characterization based on betweenness. In Advances in neural information processing systems, pp. 1497–1504, 2009.
|
| 280 |
+
|
| 281 |
+
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.
|
| 282 |
+
|
| 283 |
+
Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In Intelligent Robots and Systems (IROS), 2012 IEEE/RSJ International Conference on, pp. 5026–5033. IEEE, 2012.
|
| 284 |
+
|
| 285 |
+
Aaron van den Oord, Nal Kalchbrenner, Lasse Espeholt, Oriol Vinyals, Alex Graves, et al. Conditional image generation with pixelcnn decoders. In Advances in Neural Information Processing Systems, pp. 4790–4798, 2016.
|
| 286 |
+
|
| 287 |
+
Carl Vondrick, Hamed Pirsiavash, and Antonio Torralba. Generating videos with scene dynamics. In Advances In Neural Information Processing Systems, pp. 613–621, 2016a.
|
| 288 |
+
|
| 289 |
+
Carl Vondrick, Hamed Pirsiavash, and Antonio Torralba. Anticipating visual representations from unlabeled video. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 98–106, 2016b.
|
| 290 |
+
|
| 291 |
+
Jacob Walker, Carl Doersch, Abhinav Gupta, and Martial Hebert. An uncertain future: Forecasting from static images using variational autoencoders. In European Conference on Computer Vision, pp. 835–851. Springer, 2016.
|
| 292 |
+
|
| 293 |
+
Xiaolong Wang, Ali Farhadi, and Abhinav Gupta. Actions˜ transformations. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pp. 2658–2667, 2016.
|
| 294 |
+
|
| 295 |
+
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, pp. 91–99, 2016.
|
| 296 |
+
|
| 297 |
+
Tinghui Zhou, Shubham Tulsiani, Weilun Sun, Jitendra Malik, and Alexei A Efros. View synthesis by appearance flow. In European conference on computer vision, pp. 286–301. Springer, 2016.
|
| 298 |
+
|
| 299 |
+

|
| 300 |
+
Figure 11: Training time network schematic. At test time, only the predictor $G$ is used, and $z \sim \mathcal { N } ( 0 , \mathcal { Z } )$ . Loss terms (as used in Eq 10) are in red.
|
| 301 |
+
|
| 302 |
+
In these appendices, we provide details omitted in the main text for space. Note that more supplementary material, such as video examples, is hosted at: https://sites.google.com/view/ ta-pred
|
| 303 |
+
|
| 304 |
+
# A LABEL SMOOTHING FOR TIME-AGNOSTIC CONDITIONAL GANS
|
| 305 |
+
|
| 306 |
+
In $\operatorname { E q } 7$ , we defined a time-agnostic CGAN loss that trained $\mathrm { T }$ discriminators, one corresponding to each target time $t \in \mathrm { T }$ . In Eq 7, the only positives for the $t$ -th discriminator $D _ { t }$ were ground truth frames that occured precisely at time $t$ relative to the input $c$ , i.e., discriminators are trained so that $D _ { t } ( c , x _ { t } )$ would be 1, and $D _ { t } ( c , x _ { t ^ { \prime } \neq t } )$ and $D _ { t } ( c , G ( c ) )$ would both be 0. However, in practice, we use the following slightly different loss:
|
| 307 |
+
|
| 308 |
+
$$
|
| 309 |
+
\begin{array} { r l } & { G ^ { * } = \underset { G } { \arg \operatorname* { m i n } } \underset { t \in \mathcal { T } } { \min } \underset { D _ { t } } { \operatorname* { m a x } } \mathcal { L } _ { \mathrm { c g a n } } ^ { t } ( G , D _ { t } ) , } \\ & { \mathcal { L } _ { \mathrm { c g a n } } ^ { t } ( G , D _ { t } ) = \log D _ { t } ( c , x _ { t } ) + \log ( 1 - D _ { t } ( c , G ( c ) ) ) + } \\ & { \qquad \quad \sum _ { t ^ { \prime } \not = t } [ l _ { t , t ^ { \prime } } \log D _ { t } ( c , x _ { t ^ { \prime } } ) + ( 1 - l _ { t , t ^ { \prime } } ) \log ( 1 - D _ { t } ( c , x _ { t ^ { \prime } } ) ) ] , } \end{array}
|
| 310 |
+
$$
|
| 311 |
+
|
| 312 |
+
where we set $l _ { t , t ^ { \prime } } = \operatorname* { m a x } ( 0 , 1 - \alpha | t - t ^ { \prime } | )$ with $\alpha = 0 . 2 5$ . The first two terms are the same as $\mathrm { E q } ~ 7$ — for the $t$ -th discriminator, the $t$ -th frame provides a positive, and the generated frame provides a negative instance. The third term defines the loss for frames $x _ { t ^ { \prime } \neq t }$ : frames close to time $t$ are partial positives $( 0 < l _ { t , t ^ { \prime } } < 1 )$ , and others are negatives $( l _ { t , t ^ { \prime } } = 0 )$ . This label smoothing stabilizes training and ensures enough positives for each discriminator $D _ { t }$ .
|
| 313 |
+
|
| 314 |
+
# B TIME-AGNOSTIC CONDITIONAL VAES
|
| 315 |
+
|
| 316 |
+
Here, we discuss one alternative to the TAP CVAE formulation of $\operatorname { E q } 9$ in Sec 3.4. Rather than restricting the minimum-over-time to be over the log-likelihood term alone, why not take the minimumover-time over the whole loss? In other words, the inference network would still have to only see one frame as input, and this version of the TAP CVAE loss would be:
|
| 317 |
+
|
| 318 |
+
$$
|
| 319 |
+
\mathcal { L } _ { \mathrm { c v a e } } ( G , \phi ) = \operatorname* { m i n } _ { t \in \mathbb { T } } \left[ D _ { K L } ( q _ { \phi } ( z | x _ { t } ) , p ( z ) ) - \mathbb { E } _ { z \sim q _ { \phi } ( z | x _ { t } ) } \ln p _ { G } ( x _ { t } | c , z ) \right] .
|
| 320 |
+
$$
|
| 321 |
+
|
| 322 |
+
Unfortunately, this would be computationally very expensive to train. Both the inference network $q _ { \phi }$ and the generator $G$ would have to process $| \mathrm { T } |$ frames. In comparison, the formulation of $\operatorname { E q } 9$ allows $q _ { \phi }$ and $G$ to process just one frame, and only error computation must be done $\mathrm { T }$ times, once with each target frame $x _ { t }$ for $t \in \mathrm { T }$ .
|
| 323 |
+
|
| 324 |
+
# C ARCHITECTURE AND TRAINING DETAILS
|
| 325 |
+
|
| 326 |
+
Predictor architecture. As indicated in Fig 11, the predictor $G$ has an encoder-decoder architecture. When our approach is used together with the conditional VAE (Sec 3.4), the conditional latent $z$ is appended at the bottleneck between the encoder and the decoder. The encoder produces a 128- dimensional code, and the VAE latent code $z$ is 32-dimensional, so the overall size of the input to the decoder is 160 when the VAE is used.
|
| 327 |
+
|
| 328 |
+

|
| 329 |
+
Figure 12: The predictor produces an appearance flowfield which is used to produce flow-warped input frames, which together with a frame of new pixels are masked and averaged to produce the output frame.
|
| 330 |
+
|
| 331 |
+
The encoder inside the predictor uses a series of 4x4convolution-batchnorm-LeakyReLU(0.2) blocks to reduce the 64x64 input image as $3 \mathrm { x 6 4 \mathrm { x 6 4 } } { } 3 2 \mathrm { x } 3 2 \mathrm { x } 3 2 { } 6 4 \mathrm { x } 1 6 \mathrm { x } 1 6 { } 1 2 8 \mathrm { x } 8 \mathrm { x } 8 { } 2 5 6 \mathrm { x } 4 \mathrm { x } 4$ . For bidirectional prediction, this is repeated for both images and concatenated to produce a $5 1 2 \mathrm { x } 4 \mathrm { x } 4$ feature map. Finally, a small convolution-ReLU-convolution head reduces this to a 128-dimensional vector. Except for this last head subnetwork, this architecture is identical to the DCGAN discriminator (Radford et al., 2015).
|
| 332 |
+
|
| 333 |
+
The decoder inside the predictor uses a DCGAN-based architecture (Radford et al., 2015). The input vector is reshaped by a transposed convolution into 256 $4 \times 4$ maps. This is subsequently processed a series of bilinear upsampling-5x5convolution-batchnorm-ReLU blocks as $2 5 6 \times 4 \times 4 - 1 2 8 \times 8 \times 8 6 4 \mathrm { x } 3 2 \mathrm { x } 3 2 3 \mathrm { x } 6 4 \mathrm { x } \bar { 6 } 4$ . For the last block, a Tanh activation is used in place of ReLU to keep outputs in [-1,1]. Compared to (Radford et al., 2015), the main difference is that transposed convolutions are replaced by upsampling-5x5 convolution blocks, which aids in faster learning with fewer image artifacts (Odena et al., 2016).
|
| 334 |
+
|
| 335 |
+
As shown in $\mathrm { F i g } 1 2$ , our predictor produces three sets of outputs: (a) one frame of new pixels, (b) “appearance flow” (Zhou et al., 2016) maps that warp the $| C |$ input image(s), and (c) $| C | + 1$ masks (summing to 1 at each pixel) that combine the warped input images and the new pixels frame to produce the final output. To produce these three outputs, we use three decoders that all have the same architecture as above, except that the final output is shaped appropriately—the appearance flow decoder produces $\vert C \vert \mathrm { x 6 4 x 6 4 }$ flowfields, and the masks decoder produces $( | C | + 1 ) \mathrm { x } 6 4 \mathrm { x } 6 4$ masks.
|
| 336 |
+
|
| 337 |
+
Discriminator and Recognition Network The VAE recognition network and the discriminator both use similar architectures to the predictor encoder above. Only the input layer and the output layer are changed as follows: (a) The discriminator accepts $| C | + 1$ images as input and the recognition network accepts $| C | + | T |$ images (the full video) as input. (b) The discriminator head produces $| T |$ logits (one corresponding to each target time), and the recognition network produces a 32-dimensional conditional latent.
|
| 338 |
+
|
| 339 |
+
Training. We found it beneficial to initialize the decoder by training it first as an unconditional frame generator on frames from the training videos. For this pretraining, we use learning rate 0.0001 for 10 epochs with batch size 64 and Adam optimizer. Thereafter, for training, we use learning rate 0.0001 for 200 epochs with batch size 64 and Adam optimizer.
|
| 340 |
+
|
| 341 |
+
# D DATA GENERATION
|
| 342 |
+
|
| 343 |
+
To generate the data, we use a cross-entropy method (CEM)-based planner (Kroese et al., 2013; Ebert et al., 2017) in the MuJoCo (Todorov et al., 2012) environment with access to the physics engine, which produces non-deterministic trajectories. The planner plans towards randomly provided goals, but we use both successful and failed trajectories. Sample videos of episodes are shown at: https://sites.google.com/view/ta-pred
|
| 344 |
+
|
| 345 |
+
# E GENERALIZED MINIMUM WEIGHTS FOR INTERMEDIATE PREDICTION
|
| 346 |
+
|
| 347 |
+
In Sec 4, we briefly mentioned that the time preference $w ( t )$ for the generalized minimum loss during intermediate frame prediction was set to 2/3 at the ends to 1 at the middle frame. In our experiments, we set these weights heuristically as follows: $w ( t )$ rises linearly from $\kappa = 0 . 6 6$ at $t = 1$ to 1.0 at the $t = 5$ , then stay at 1.0 for $T - 1 0$ frames. Then, starting from the $( T - 5 )$ -th frame, it would drop linearly to $\kappa$ once more at $t = T$ . The only hyperparameter we tuned was $\kappa$ (search over $2 / 3$ and $1 / 3$ ).
|
| 348 |
+
|
| 349 |
+
# F BOTTLENECK DISCOVERY FREQUENCY SCORE
|
| 350 |
+
|
| 351 |
+
In Sec 4, we mentioned a bottleneck discovery frequency measure in the paragraph titled “Bottleneck discovery frequency metric.” We now provide further details.
|
| 352 |
+
|
| 353 |
+
Our proposed metric for two-object pushing quantifies how reliably the network is able to generate a bottleneck state with one object being moved and the other being at its original position. The reason that this state is of interest is that in two-object pushing, this may be reasonably assumed to be the natural bottleneck, so we call this metric the bottleneck frequency. Even without this assumption though, the metric quantifies the ability of our approach to generate predictions attached to this consistent semantically coherent bidirectional state.
|
| 354 |
+
|
| 355 |
+
To measure bottleneck frequency, we use a technique similar to the approach proposed in (Ebert et al., 2017) for planning with a visual predictor. First, we train versions of “genmin” and “fix” that synthesize predictions purely by appearance-flow-warping and masking inputs (as shown in the scheme of Fig 12, but without pixel generation). Next, recall that we have access to the starting and goal positions of objects since our dataset is synthetically generated. Thus, we can exploit this and track where the pixels at ground truth object locations in start and goal images end up in the prediction, i.e., where did each object move? This works as follows: we take the appearance flow transformations and masks generated by the model internally (for application to input images to generate prediction) and apply them instead to one-hot object location maps—these maps have value one at the ground truth origin of the the objects and zero elsewhere. The output of this operation is a probability map for each object indicating where it is located in the predictor’s bidirectional prediction output.
|
| 356 |
+
|
| 357 |
+
To compute the score, we then calculate the expected distance in pixels between the predicted positions of each object and the bottleneck state. There are actually two possible candidates for this bottleneck state: object 1 is moved first, or object 2 is moved first. We compute the expected distances to both these bottleneck candidates and take the lower distance to be the score. This score does not evaluate whether the semantically correct bottleneck was predicted (in cases where one object must always be moved first to avoid collision, such as Fig 9 (left) example #1).
|
| 358 |
+
|
| 359 |
+
The lower this distance score, the higher the likelihood that the predicted output is actually a bottleneck (“bottleneck frequency”). Fig 10 shows what happens when the threshold over the score is varied, for our approach and the fixed-time baseline. Higher bottleneck frequency at lower threshold is desirable. As the figure shows, at a low threshold distance score $\approx 2$ pixels), our approach gets to about $58 \%$ bottleneck frequency while the fixed-time predictor gets about $0 \%$ frequency at this threshold. This verifies that our approach produces predictions attached to semantically coherent low-uncertainty bottleneck events.
|
| 360 |
+
|
| 361 |
+
# G HIERARCHICAL PLANNING EVALUTION METHOD
|
| 362 |
+
|
| 363 |
+
In Sec 4, we described a hierarchical planning approach using our predictions in the paragraph titled “Hierarchical planning evaluation.” We describe this method in more detail here.
|
| 364 |
+
|
| 365 |
+
We test the usefulness of the generated predictions as subgoals for planning multi-object pushing. Given a start and goal image, we produce an bidirectional prediction using our time-agnostic predictor and feed it to a low-level planner that plans towards this prediction as its subgoal. For the low-level planner we use the visual model-predictive control algorithm (“Visual MPC”) (Ebert et al., 2017) which internally uses a fixed-time forward prediction model and sampling-based planning to solve short-term and medium duration tasks. A more detailed description of this process follows.
|
| 366 |
+
|
| 367 |
+
Visual MPC requires start and goal locations of objects to plan. When used in conjunction with our method, we first compute the locations of objects at the bidirectional predictions and feed this in place of the final goal object locations, so that Visual MPC may plan to first reach the bidirectional prediction as a subgoal/stepping stone towards the final goal. Once the subgoal is reached, Visual MPC is fed the final goal. To compute subgoal object locations, we use the same technique as in Appendix F above—one-hot maps of object locations are transformed by the appearance flow maps and masks computed internally by our predictor. This produces a probability map $p _ { g }$ over object locations at the prediction, which is passed to Visual MPC.
|
| 368 |
+
|
| 369 |
+
Internally, the Visual MPC planner makes fixed-time forward predictions for the object locations starting from the initial distribution $p _ { s }$ given a randomly sampled action sequence of length $h = 1 5$ (the “planning horizon”). Out of all the action sequences, it selects the sequence that brings the distribution closest to $p _ { g }$ within $h = 1 5$ steps $h$ is the “planning horizon”). In practice, we use 200 random action sequences and perform three iterations of CEM search (Kroese et al., 2013) to find the the best sequence. Once an action sequence is selected, the first action in the sequence is executed, and the initial object distribution is updated. New candidate action sequences are now generated starting from this updated object distribution and the process repeats.
|
| 370 |
+
|
| 371 |
+
In our experiments, we use a time budget $B$ of 40 steps for 2-object pushing, and 75 steps for 3-object pushing. In both cases, we feed Visual MPC the subgoal (bidirectional prediction object locations) for the first $B / 2$ timesteps, and then feed the final goal location for the last $B / 2$ steps. The “direct” planning baseline instead receives the final goal location for all $B$ steps. As shown by the results in the paper, our subgoal predictions aid in performing these multi-stage pushing tasks better than with the direct planning baseline.
|
| 372 |
+
|
| 373 |
+
# H SUPPLEMENTARY PREDICTION EXAMPLES
|
| 374 |
+
|
| 375 |
+
We now show more prediction results from various settings in Figs 13, 14, 15, 16, and 17, to supplement those in Sec 4.
|
| 376 |
+
|
| 377 |
+

|
| 378 |
+
Figure 13: (Same format as Fig 6). Supplementary bidirectional prediction results comparing fixed-time prediction and our approach on grasping. First two columns are inputs (start and goal). Thereafter, each column corresponds to the output of a different model per the column title. “match” is the ground truth image closest to the GENMIN prediction.
|
| 379 |
+
|
| 380 |
+

|
| 381 |
+
Figure 14: (Same format as Fig 6). Supplementary bidirectional prediction results comparing fixed-time prediction and our approach on pick-and-place. First two columns are inputs (start and goal). Thereafter, each column corresponds to the output of a different model per the column title. “match” is the ground truth image closest to the GENMIN prediction.
|
| 382 |
+
|
| 383 |
+

|
| 384 |
+
Figure 15: Supplementary bidirectional prediction results on pushing. Four columns for each method correspond to masked warped start frame, masked warped goal frame, masked new pixels, and final output respectively. See Appendix C and Fig 12 for the synthesis scheme with masks and warps.
|
| 385 |
+
|
| 386 |
+

|
| 387 |
+
Figure 16: Supplementary bidirectional prediction examples for pick-and-place with GENMIN $^ +$ VAE. Same format as Fig 9. Each row is a separate example. First column is the input. GENMIN $^ +$ VAE captures residual stochasticity at the bottleneck. GENMIN $^ +$ VAE produces images that are most all of the arm in contact with the object on the table, but at different points on the object, and with different arm/gripper poses.
|
| 388 |
+
|
| 389 |
+

|
| 390 |
+
Figure 17: Supplementary forward prediction examples for grasping, comparing fixed-time predictors and our approach. Same format as Fig 5. Each row is a separate example. First column is the input. Thereafter, each column corresponds to the output of a different model per the column title.
|
md/train/Uwh-v1HSw-x/Uwh-v1HSw-x.md
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Training Neural Networks with Fixed Sparse Masks
|
| 2 |
+
|
| 3 |
+
Yi-Lin Sung∗ UNC Chapel Hill ylsung@cs.unc.edu
|
| 4 |
+
|
| 5 |
+
Varun Nair∗ Duke University vn40@duke.edu
|
| 6 |
+
|
| 7 |
+
Colin Raffel UNC Chapel Hill craffel@gmail.com
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
During typical gradient-based training of deep neural networks, all of the model’s parameters are updated at each iteration. Recent work has shown that it is possible to update only a small subset of the model’s parameters during training, which can alleviate storage and communication requirements. In this paper, we show that it is possible to induce a fixed sparse mask on the model’s parameters that selects a subset to update over many iterations. Our method constructs the mask out of the $k$ parameters with the largest Fisher information as a simple approximation as to which parameters are most important for the task at hand. In experiments on parameter-efficient transfer learning and distributed training, we show that our approach matches or exceeds the performance of other methods for training with sparse updates while being more efficient in terms of memory usage and communication costs. We release our code publicly to promote further applications of our approach.2
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
Stochastic gradient descent (SGD) is a vital component of the modern pipeline for training deep neural networks. Along with the back-propagation algorithm, gradient descent allows for the efficient minimization of a loss function by gradually updating a model’s parameters. SGD minimizes the loss over a small random subset of the dataset at each training iteration, which allows training over large datasets. In practice, minimizing a large neural network’s training loss using SGD often results in models that generalize well to new data [3, 17, 27], making SGD an invaluable tool.
|
| 16 |
+
|
| 17 |
+
While effective, standard SGD requires that all model parameters are updated at every iteration of training. As a result, communicating changes to the model requires communicating the updated value of every parameter. Since modern neural networks often have millions or billions of parameters [9, 7, 40], this communication can become excessively expensive. A concrete example of the negative impacts of these costs arises in the setting of transfer learning. In transfer learning, a model’s parameters are initialized from an existing pre-trained model before being fine-tuned (i.e. trained) on a task of interest. Pre-trained models can be fine-tuned a huge number of times – for example, the Hugging Face model repository3 has thousands of fine-tuned variants of the BERT model [12]. Each of these fine-tuned variants requires a unique copy of the model’s parameters, each of which takes up around 500MB of disk space. Relatedly, in distributed training [11] and federated learning [35], workers compute updates for a centralized model in parallel on different subsets of data. After a certain number of updates, the workers each communicate the newly-computed parameter values back to the centralized model. The communication step can cause a significant amount of overhead (particularly when the model is large) since the workers must communicate the updated values of all parameters when using standard SGD.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Diagram comparing our proposed method to standard SGD. In traditional gradient-based training (left), all of a model’s parameters are updated at every iteration. We propose FISH Mask, a method for precomputing a sparse subset of parameters to update over many subsequent training iterations. To construct the FISH Mask, we find the $k$ parameters with the largest Fisher information (right, top). Then, we train the model with traditional gradient descent, but only update those parameters chosen by the mask (right, bottom).
|
| 21 |
+
|
| 22 |
+
These issues could be mitigated if it was possible to only update a few parameters during training while still maintaining performance close to that of training all parameters. This has led to various work on parameter-efficient training of neural networks. For example, Adapters [19, 41, 5] introduce additional parameters into a pre-trained model in the form of small task-specific modules that are fine-tuned while the rest of the model’s parameters are kept fixed. Diff Pruning [16] and BitFit [6] demonstrate that it is possible to fine-tune a model while only updating a small subset of the existing parameters. In distributed and federated learning settings, Aji and Heafield [2] and Konecnˇ y\` et al. [23] have shown that it is possible for each worker to only update a sparse subset of a model’s parameters, thereby reducing communication costs.
|
| 23 |
+
|
| 24 |
+
Existing methods for training with sparse updates typically work in one of three ways: they either add parameters to the model (Adapters), choose a hand-defined and heuristically-motivated subset of parameters (BitFit), or allow the subset of parameters to change over the course of training (Diff Pruning and methods in distributed and federated training). In this paper, we argue for pre-computing a sparse subset of existing parameters to update and keeping the subset fixed over many iterations of training. This approach yields various benefits: First, by updating a subset of existing parameters instead of adding parameters (as is done in Adapters), we avoid any increase in the total size of the model. Second, by avoiding hand-defining the mask, we can ensure that our procedure is modelagnostic. Third, by pre-computing a mask, we avoid the computational and memory overhead that are apparent when updating the mask over the course of training. It also allows workers in the distributed training setup to operate on strictly complementary subsets of parameters. Finally, keeping the mask fixed over many iterations, we can ensure that only a specific fixed number of parameters are updated. We are not aware of any existing techniques that satisfy these desiderata.
|
| 25 |
+
|
| 26 |
+
Motivated by these benefits, we introduce a new method for pre-computing fixed sparse masks. Our approach first estimates the importance of each parameter using an empirical approximation of its Fisher information. Then, we construct the mask by choosing the $k$ parameters with the largest Fisher information. The resulting mask, which we deem a “FISH (Fisher-Induced Sparse uncHanging) mask”, can be re-used for many subsequent training iterations. We demonstrate the effectiveness of using a FISH Mask in a wide variety of settings, including parameter-efficient transfer learning, distributed training with long delays across workers, and reducing checkpoint size. Broadly speaking, FISH Mask training can dramatically reduce storage and communication requirements, while sacrificing minimal performance compared to standard gradient descent and outperforming relevant prior methods for training with sparse updates.
|
| 27 |
+
|
| 28 |
+
# 2 The Fisher-Induced Sparse uncHanging (FISH) Mask
|
| 29 |
+
|
| 30 |
+
The main contribution of this paper is a method for pre-computing a sparse subset of a model’s parameters to update over many subsequent training iterations. To construct such a subset, we use an approximation of each parameter’s Fisher information as a signal of how important the parameter is for a given task. We refer to the resulting mask (i.e. binary array indicating which parameters are included in the subset) as a FISH (Fisher-Induced Sparse uncHanging) mask. In this section, we provide the necessary background and detail the steps necessary for computing a FISH Mask. This process is diagrammed in fig. 1.
|
| 31 |
+
|
| 32 |
+
# 2.1 Fisher Information
|
| 33 |
+
|
| 34 |
+
Our goal is to select the subset of parameters that are (in some sense) the most important to update. One way to measure a parameter’s importance is to consider how much changing the parameter will change the model’s output. We denote $p _ { \theta } ( y | x )$ as the output distribution over $y$ produced by a model with parameter vector $\theta \in \mathbb { R } ^ { | \theta | }$ given input $x$ . One way to measure how much a change in parameters would change a model’s prediction would be to compute $\mathrm { D } _ { \mathrm { K L } } ( p _ { \boldsymbol { \theta } } ( \boldsymbol { y } | \boldsymbol { x } ) | | p _ { \boldsymbol { \theta } + \delta } ( \boldsymbol { y } | \boldsymbol { x } ) )$ , where $\delta \in \mathbb { R } ^ { | \theta | }$ is a small perturbation. It can be shown [34, 37] that as $\delta 0$ , to second order,
|
| 35 |
+
|
| 36 |
+
$$
|
| 37 |
+
\mathbb { E } _ { x } \mathrm { D } _ { \mathrm { K L } } \big ( p _ { \theta } ( y | x ) \ | | \ p _ { \theta + \delta } ( y | x ) \big ) = \delta ^ { \mathrm { T } } F _ { \theta } \delta + O ( \delta ^ { 3 } )
|
| 38 |
+
$$
|
| 39 |
+
|
| 40 |
+
where $F _ { \theta } \in \mathbb { R } ^ { | \theta | \times | \theta | }$ is the Fisher information matrix [14, 4], defined as
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
F _ { \theta } = \mathbb { E } _ { x \sim p ( x ) } \left[ \mathbb { E } _ { y \sim p _ { \theta } ( y \vert x ) } \nabla _ { \theta } \log p _ { \theta } ( y \vert x ) \nabla _ { \theta } \log p _ { \theta } ( y \vert x ) ^ { \mathrm { T } } \right]
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
Given this relation, it can be seen that the Fisher information matrix is closely connected to how much each parameter affects the model’s predictions. Indeed, this has led the Fisher information matrix to be widely used in modern machine learning, e.g. as a measure of parameter importance [21], as a preconditioner in gradient descent [4, 37, 34], as a way to measure the amount of “information” in each parameter of a neural network [1], or as a way to decide which parameters to prune when performing model compression [43, 10, 47].
|
| 47 |
+
|
| 48 |
+
When applied to large neural networks, the $\left| \theta \right| \times \left| \theta \right|$ size of the Fisher information matrix makes it intractable to compute. Prior work therefore frequently approximates $F _ { \theta }$ as a diagonal matrix, or equivalently, as a vector in $\mathbb { R } ^ { | \theta | }$ . Separately, when training machine learning models we seldom have the ability to draw samples $x \sim p ( x )$ ; instead, we are given a finite training set of such samples. Furthermore, it is rarely necessary to compute the expectation over $x$ in eq. (2) over the full training set; instead, it can often be well-approximated over $N$ samples $x _ { 1 } , \ldots , x _ { N }$ . These constraints result in the following common approximation:
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
\hat { F _ { \theta } } = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \mathbb { E } _ { y \sim p _ { \theta } ( y | x _ { i } ) } ( \nabla _ { \theta } \log p _ { \theta } ( y | x _ { i } ) ) ^ { 2 }
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
where $\hat { F } _ { \theta } \in \mathbb { R } ^ { | \theta | }$ . This approximation also has an intuitive interpretation: A given entry in $\hat { F } _ { \theta }$ relates to the average of the square gradient of the model’s output with respect to a given parameter. If a given parameter heavily affects the model’s output, then its corresponding entry in $\hat { F } _ { \theta }$ will be large, so we can reasonably treat $\hat { F } _ { \theta }$ as an approximation of the importance of each parameter.
|
| 55 |
+
|
| 56 |
+
Note that both eq. (2) and eq. (3) include an expectation over $y \sim p _ { \theta } ( y | x )$ . When the number of classes is small, this expectation can be computed exactly. For tasks with many possible classes, it is common to approximate the expectation with a few samples from $p _ { \theta } ( y | x )$ . In supervised learning settings, we have access to the ground-truth label $y _ { i }$ for each sample $x _ { i }$ in our training set. This leads to the possibility of replacing $\mathbb { E } _ { y \sim p _ { \theta } ( y | x _ { i } ) } ( \nabla _ { \theta } \log p _ { \theta } ( y | x _ { i } ) ) ^ { 2 }$ in eq. (3) with $( \nabla _ { \theta } \mathbf { \bar { l } } _ { 0 } \mathrm { { g } } p _ { \theta } ( y _ { i } | x _ { i } ) ) ^ { 2 }$ Performing this approximation is referred to as the “empirical Fisher”. It has been shown that using the empirical Fisher can lead to degenerate behavior when used as a preconditioner in an optimizer [34, 26]. Since our use of the Fisher information is largely based on a heuristically-motivated notion of parameter importance, we experimented with both the empirical and standard (eq. (3)) Fisher approximations and found that they produced similar performance. Furthermore, the Empirical Fisher is faster to compute than the standard Fisher as long as more than one sample is used to approximate the expectation $\mathbb { E } _ { y \sim p _ { \theta } ( y | x _ { i } ) }$ . We discuss this further in section 4.4.1.
|
| 57 |
+
|
| 58 |
+
# 2.2 Computing Fixed Sparse Masks
|
| 59 |
+
|
| 60 |
+
Recall that our goal is to select a subset of parameters (or, equivalently, a sparse mask over parameters) to update over many iterations of training while keeping the remainder of the parameters fixed. Having established the Fisher information as a useful tool for estimating the importance of a given parameter, we therefore first compute the approximate Fisher information (as described in the previous section)
|
| 61 |
+
|
| 62 |
+
for all of a model’s parameters. Then, to construct the FISH Mask, we simply choose the $k$ parameters with the largest Fisher information, where $k$ is set according to the desired mask sparsity level.4 Specifically, a FISH Mask comprises the parameters $\{ \theta _ { i } \mid \hat { F } _ { \theta _ { i } } \geq \mathsf { s o r t } ( \hat { F } _ { \theta } ) _ { k } \}$ . Computing the FISH Mask is cheap because $\hat { F } _ { \theta }$ can be computed efficiently using backpropagation, and (as we will show in section 4.4.2) we can obtain a reliable mask for relatively small values of $N$ . Further, the fact that we re-use the mask for many iterations prevents us from having to compute $\hat { F } _ { \theta }$ frequently. As we will show in section 4, we find that this simple procedure is sufficient to produce a mask that can be reused for many iterations (over 100,000 iterations in some cases) in a wide variety of settings without sacrificing substantial performance compared to standard gradient-based training.
|
| 63 |
+
|
| 64 |
+
Note that in some applications of transfer learning, a new linear classifier layer must be added to the model to make it applicable to the downstream task. Since the FISH Mask depends on $p _ { \theta } ( y | x )$ and is computed before training begins, this means that we must compute the FISH Mask using the randomly-initialized classifier before any training has begun. We find that computing the Fisher information through the randomly-initialized classifier layer still provides a good signal of parameter importance. When applying FISH Mask in transfer learning settings where a new classifier layer is added, we always include the parameters of the classifier in the mask.
|
| 65 |
+
|
| 66 |
+
# 3 Related Work
|
| 67 |
+
|
| 68 |
+
Our approach bears similarity and takes inspiration from existing approaches for parameter-efficient transfer learning and distributed training of machine learning models. In this section, we outline related methods, some of which we will compare to directly in section 4. We also briefly describe how our work is related to and differs from work in network pruning.
|
| 69 |
+
|
| 70 |
+
# 3.1 Parameter-Efficient Transfer Learning
|
| 71 |
+
|
| 72 |
+
Transfer learning [36], where a model is initialized from a pre-trained checkpoint before being finetuned on a related downstream task, can dramatically improve performance and speed up convergence on the downstream task [12, 8, 40]. Standard practice is to update all of the model’s parameters during fine-tuning, though in some cases reasonable performance can be attained by only fine-tuning the output layer of the model [20, 8, 38]. Training only the output layer has the benefit that adapting a given pre-trained model to a downstream task only requires adding a relatively small number of new parameters, but typically results in worse performance compared to training the full model [38, 24].
|
| 73 |
+
|
| 74 |
+
Various methods have been proposed that endeavor to match the performance of fine-tuning the full model while only updating or adding a small amount of parameters. Adapters [19, 41, 5] are small subnetworks that are added between a pre-trained neural networks layers. Various works [19, 33, 32] have shown that, when appropriately designed, updating only the parameters in the adapters and the output layer can approach the performance of fine-tuning all parameters. For example, Houlsby et al. [19] add on average $3 . 6 \%$ more parameters to adapt a pre-trained BERT model [12] to tasks in the GLUE benchmark [48]. Concurrent work by Mahabadi et al. [33] improves the efficiency of Adapters by generating the weights of task-specific adapters via a hypernetwork. A second concurrent approach by Mahabadi et al. [32] introduces COMPACTER, which utilizes matrix decomposition and low-rank parameterization for the adapters’ weights. COMPACTER is shown to achieve the same performance as standard fine-tuning of the T5 models [40] while only adding $0 . 0 4 7 \%$ as many parameters as the original model. Finally, very recent work has shown that it is possible to train language models to perform a task by only optimizing the parameters of a "prompt" that is injected into the input of the model’s layers [29, 28]. This can yield extremely parameter-efficient results (as low as $0 . 0 1 \%$ task-specific parameters [28]) but this class of methods is only applicable to next-step-prediction language models. The main drawback of all Adapter-style methods is that they increase the parameter count and computational cost of the model. This makes them inapplicable to the distributed training and efficient checkpointing settings consider in this paper. We therefore only compare directly to other methods that do not add any parameters.
|
| 75 |
+
|
| 76 |
+
More closely related to our approach are methods for choosing a small subset of the model’s existing parameters to update. In an extreme case, Zhao et al. [50] find a sparse mask to multiply against pre-trained parameters (which are not otherwise updated). That is, instead of fine-tuning the models, a binary mask is learned that marks which parameters should be zeroed out. The resulting performance degrades heavily when the mask is made very sparse, suggesting that it is likely beneficial to update parameters. More recently, Guo et al. [16] propose “Diff Pruning”, where a sparse binary mask is found over the course of training that denotes which parameters should be updated or fixed at the value from the pre-trained model. Mask sparsity in the binary mask is enforced through a smooth approximation of the $L _ { 0 }$ norm introduced by Louizos et al. [31]. Guo et al. [16] also show improved performance by imposing a structure on the mask according to which parameters correspond to a particular weight matrix or bias vector. Ultimately, Diff Pruning is shown to both be more parameterefficient and outperform Adapters when applied to fine-tuning BERT on the GLUE benchmark. However, using Diff Pruning requires significantly more memory during training in order to store and update the mask. Another recent result by Ben-Zaken et al. [6] demonstrated that simply updating the bias parameters in BERT can attain competitive performance with Diff Pruning. While this provides a simple and strong baseline, it is not universally applicable – for example, the pre-trained T5 model [40] does not have any bias vectors. In section 4, we show that using a FISH Mask outperforms all of these approaches in parameter-efficient fine-tuning of BERT on GLUE.
|
| 77 |
+
|
| 78 |
+
# 3.2 Distributed Training
|
| 79 |
+
|
| 80 |
+
As models and datasets grow, it becomes inefficient or impossible to train a model on a single machine. This has motivated the need for distributed training strategies where computation for training a model is shared across many machines (called workers) [11]. A major consideration in distributed training are communication costs, since workers need to regularly communicate parameter updates with one another. To minimize communication costs, workers can compute multiple updates on their copy of the model before communicating their changes, but this gives rise to the “stale gradient” problem where workers are operating on an out-of-date copy of the model. The standard and straightforward approach to dealing with stale gradients it to simply apply updates in the “wrong” order, which can be effective in practice [11, 42]. An orthogonal approach to reducing communication costs is to have workers only update a small subset of the model’s parameters [2, 13, 44, 45]. For example, Aji and Heafield [2] simply have workers communicate only those updates corresponding to the gradients with top- $k$ largest magnitude at each step. This bears a similar motivation to FISH Mask, but results in a “mask” that changes at every iteration and therefore requires workers communicate after each update. In contrast, pre-computing a FISH Mask allows workers to perform multiple iterations before communicating their updates, thereby further reducing communication costs.
|
| 81 |
+
|
| 82 |
+
An extreme variant of distributed training is federated learning [22, 35]. In federated learning, asynchronous workers perform many updates on private data before communicating the changes back to a centralized model. The training involves one server and multiple clients, and the server model’s gradient is the combination of the workers’ gradients. As with any form of asynchronous training, communication costs and stale gradients are significant issues. McMahan et al. [35] demonstrated that averaging the updates computed by individual workers is an effective approach to dealing with stale gradients and Konecnˇ y et al. \` [23] investigated techniques for significantly reducing communication costs. Our method is complementary to the techniques for reducing communication proposed by Konecnˇ y et al. [23].\`
|
| 83 |
+
|
| 84 |
+
# 3.3 Network Pruning
|
| 85 |
+
|
| 86 |
+
Past work in network pruning has also explored techniques for sparsifying neural networks (i.e. zeroing out many parameters for compression purposes) while sacrificing minimal performance. Most relevant to our work, Theis et al. [46] propose utilizing the Fisher to prune and decrease the overall number of parameters for gaze prediction, and Liu et al. [30] also use the Fisher to discover groups of parameters to prune from common backbone architectures. Critically, these works differ from our work in that we do not train neural networks with sparse weights. Instead, we focus on using the Fisher to inform the selection of a fixed sparse subset of weights in a non-sparse network to update over the course of training.
|
| 87 |
+
|
| 88 |
+
# 4 Experiments
|
| 89 |
+
|
| 90 |
+
We evaluate the efficacy of the FISH Mask in three settings: parameter-efficient transfer learning, distributed training, and training with efficient checkpointing. For parameter-efficient transfer learning, we demonstrate that our approach matches the performance of standard gradient-based training on the GLUE benchmark [48] while updating only $0 . 5 \%$ of the model’s parameters per task. For distributed training, we evaluate FISH Mask training for both transfer learning on GLUE and training from scratch on CIFAR-10 [25]. In both settings, we find that we can dramatically reduce communication without sacrificing significant performance, though from-scratch training on CIFAR-10 requires a higher mask sparsity level than fine-tuning on GLUE. Finally, we demonstrate a novel application of training with sparse updates: Minimizing the size of checkpoints over training. We show that using a FISH Mask while training on CIFAR-10 with a mask sparsity level of $10 \%$ can shrink checkpoint size on disk by a factor of 5 while sacrificing only a small amount of accuracy. Throughout our experiments, we report results with varying mask sparsity to get a sense of the savings induced by the FISH Mask. For ease of comparison, we report mask sparsity in terms of the total percentage of parameters that are updated. This percentage can be converted to a value of $k$ used for the top- $k$ operation when constructing the mask simply by multiplying it against the total number of parameters in the model.
|
| 91 |
+
|
| 92 |
+
We also include ablation studies to measure the impact of the number of samples used to estimate the Fisher information as well as the choice of true or empirical Fisher. All experiments for GLUE are run with the BERTLARGE variant of BERT, which contains 16 attention heads, 24 layers, and 330 million parameters in total [12], and most experiments are run on a RTX 3090 GPU. For experiments on CIFAR-10, we use a ResNet-34 [18] with various optimizations for fast convergence.5 We report the average performance across 5 seeds for all experiments.
|
| 93 |
+
|
| 94 |
+
# 4.1 Parameter-Efficient Transfer Learning
|
| 95 |
+
|
| 96 |
+
In parameter-efficient transfer learning, the goal is to fine-tune a pre-trained model while updating as few parameters as possible. We focus on fine-tuning $\mathbf { B E R T _ { L A R G E } }$ on the GLUE benchmark [48], which is the primary setting used for evaluation in prior work. For all experiments, we fine-tune for 7 epochs and perform a hyper-parameter search across learning rate $\in \{ 1 \stackrel { \cdot } { \times } 1 0 ^ { - 4 } , 5 \times 1 0 ^ { - 5 } , 1 \times 1 0 ^ { - 5 } \}$ and batch si $\mathsf { z e } \in \{ 8 , 1 6 \}$ for each GLUE task. We find the learning rate of $5 \times 1 0 ^ { - 5 }$ and batch size of 16 to be effective for most tasks, with the exception of batch $\mathrm { s i z e } = 8$ used for RTE. Additional hyper-parameters, such as choice of optimizer, sequence length, and others, follow from the default configuration for BERTLARGE presented in the Hugging Face library [49]. Test set results are reported by submitting to the GLUE benchmark using the final model checkpoint following a hyper-parameter search on validation results, unless otherwise noted.
|
| 97 |
+
|
| 98 |
+
Baselines We compare GLUE task performance of the FISH Mask to several other baselines and methods focused on parameter-efficient transfer learning. In Dense Fine-tuning, we fine-tune all parameters of a pre-trained model, as is typical in standard transfer learning. In the Random Mask baseline, we randomly select and fix $k$ parameters to update at the start of training. To compare to prior work, we reproduce Bit-Fit [6], in which only the bias parameters of the BERT model are updated across training. Our reproduction follows the original paper and performs a hyper-parameter search with learning rates in the $[ 1 \times 1 0 ^ { - 3 } , 1 \times 1 0 ^ { - 4 } ]$ range. We also reproduce results from Diff Pruning [16], which updates the sparse mask over the course of training. Our reproduction of Diff Pruning at $0 . 5 \%$ mask sparsity follows the paper’s code-base6 and training settings, and reports the GLUE test set results using the best validation checkpoint. Due to restrictions on the number of permissible submissions to the GLUE test server, we are only able to report results with a mask sparsity of $0 . 5 \%$ for those methods where we can control the mask sparsity level. We therefore include additional validation set results for varying mask sparsity levels when using a FISH Mask.
|
| 99 |
+
|
| 100 |
+
Results Our results on parameter-efficient transfer learning with the FISH Mask can be seen in table 1. FISH Mask training results in effectively the same performance $( 8 2 . 6 \% )$ as standard “dense” fine-tuning $( 8 2 . 5 \% )$ , despite updating just $0 . 5 \%$ of BERTLARGE parameters. The Random Mask baseline achieves a significantly lower average GLUE score, which demonstrates the value of using
|
| 101 |
+
|
| 102 |
+
<table><tr><td>Method</td><td>Updated Params/Task</td><td>QNLI</td><td>SST-2</td><td>MNLIm</td><td>MNLImm</td><td>CoLA</td><td>MRPC</td><td>STS-B</td><td>RTE</td><td>QQP</td><td>AVG</td></tr><tr><td>Dense Fine-tuning</td><td>100%</td><td>93.4</td><td>94.9</td><td>87.0</td><td>86.1</td><td>61.0</td><td>86.6</td><td>86.5</td><td>70.9</td><td>80.5</td><td>82.5</td></tr><tr><td>Random Mask</td><td>0.50%</td><td>89.8</td><td>93.4</td><td>83.7</td><td>84.0</td><td>43.2</td><td>77.8</td><td>87.7</td><td>61.3</td><td>77.2</td><td>76.8</td></tr><tr><td>Bit-Fit [6]</td><td>0.08%</td><td>90.4</td><td>94.5</td><td>85.0</td><td>84.8</td><td>60.3</td><td>86.3</td><td>85.0</td><td>69.6</td><td>78.5</td><td>81.2</td></tr><tr><td>Diff Pruning [16]</td><td>0.50%</td><td>91.9</td><td>93.8</td><td>86.0</td><td>85.5</td><td>61.0</td><td>86.2</td><td>85.6</td><td>67.5</td><td>80.1</td><td>81.5</td></tr><tr><td>FISHMask</td><td>0.08%</td><td>93.3</td><td>94.0</td><td>85.3</td><td>84.9</td><td>56.4</td><td>86.2</td><td>85.7</td><td>70.2</td><td>79.3</td><td>81.3</td></tr><tr><td>FISHMask</td><td>0.50%</td><td>93.1</td><td>94.7</td><td>86.5</td><td>85.9</td><td>61.6</td><td>87.1</td><td>86.5</td><td>71.2</td><td>80.2</td><td>82.6</td></tr></table>
|
| 103 |
+
|
| 104 |
+
Table 1: GLUE test server evaluation results with BERTLARGE. MRPC and QQP are reported as an average of F1-score and accuracy, and STS-B is reported as an average of Pearson and Spearman correlation. Accuracy is reported for all other tasks. All results are reproduced experimentally. Training with the FISH surpasses (82.6) other methods and equals dense fine-tuning performance (82.5) whilst updating only $0 . 5 \%$ of model parameters.
|
| 105 |
+
|
| 106 |
+

|
| 107 |
+
Figure 2: (Left) GLUE validation performance of a randomly selected mask and the FISH Mask at varying levels of mask sparsity. Compared to the densely fine-tuned baseline score of $85 \%$ , training with the FISH Mask is competitive at $0 . 5 \%$ mask sparsity. (Right) GLUE validation performance at varying levels of dataset samples used to compute the FISH Mask. Few samples are needed to effectively compute the FISH Mask and obtain good performance. Results in both (Left) and (Right) are averaged over 5 seeds.
|
| 108 |
+
|
| 109 |
+
the Fisher information in selecting parameters to update. Finally, FISH Mask training is competitive with all other parameter-efficient transfer learning approaches; the next-best score of $8 1 . 5 \%$ is achieved by Diff Pruning [16]. As mentioned in section 3, we do not include a direct comparison to Adapter-based methods since they add parameters to the model, though we note that our method is able to match BERTLARGE’s performance using a significantly lower mask sparsity level $0 . 5 \%$ vs. $3 . 6 \%$ ) than the method proposed by Houlsby et al. [19].
|
| 110 |
+
|
| 111 |
+
Figure 2 shows the change in performance on the GLUE validation set as we change the mask sparsity level for both a random mask and a FISH Mask. We find that the FISH Mask consistently outperforms the random mask baseline and is still strong even at a lower mask sparsity level of $0 . 1 \%$ . These results demonstrate that the FISH Mask can be a useful tool in mitigating the storage costs of saving many fine-tuned models since it only requires that the updated parameters and their respective indices are saved.
|
| 112 |
+
|
| 113 |
+
# 4.2 Distributed Training
|
| 114 |
+
|
| 115 |
+
Now, we turn to using FISH Mask to reduce communication costs in distributed training settings. We consider the setting where distributed workers compute many subsequent updates to a local copy of the model before transmitting their changes back to a central server. In our experiments, we assume all workers sample data i.i.d. from the same dataset and that all workers compute the same number of updates between each communication step, though our results could carry over to settings where workers use different datasets and varying amounts of updates (e.g. in Federated Learning [35]).
|
| 116 |
+
|
| 117 |
+
Let $\theta$ denote the parameter vector stored on the central server and $\delta _ { i }$ represent the update computed by worker $i$ . After each update/communication step, the server must transmit the updated $\theta$ back to all workers. When standard gradient-based training is used, all parameters are updated, so $| \delta _ { i } | = | \theta |$ . If there are $M$ workers, the communication costs for normal training are then $M | \delta _ { i } | = M | \ddot { \theta } |$ for workerto-server communication and $M | \theta |$ for server-to-worker communication, for a total communication cost of $2 M | \theta |$ .
|
| 118 |
+
|
| 119 |
+
Using a sparse mask will effectively reduce the size of each $\delta _ { i }$ to $k$ . Without loss of generality, we assume that $| \delta _ { i } |$ is the same across all workers. Furthermore, assuming updates are aggregated on the central server by summing them together, the server can either communicate the full updated parameter vector back to all workers, or the server can communicate all other workers’ updates to a given worker. These two options amount to server-to-worker communication costs of either $M | \theta |$ or $M ( M - \underline { { { 1 } } } ) \lVert \delta _ { i } \rVert \approx M ^ { 2 } | \dot { \delta } _ { i } |$ . In general, we expect $M$ to be small and $| \theta |$ to be large, so we typically have $M ^ { 2 } | \delta _ { i } | < M | \theta |$ . Therefore, we can achieve significant communication savings by using sparse updates. For simplicity, we set $M = 2$ in all of our experiments; this makes the savings in communication equal to the mask sparsity level. To apply FISH in distributed training, the central server computes $\hat { F } _ { \theta }$ and a single FISH Mask which is shared across all workers.
|
| 120 |
+
|
| 121 |
+
Baselines For distributed training experiments, we compare FISH Mask training to three baselines: First, in standard training, we tune all the parameters in a single machine (i.e. standard, nondistributed training). This provides an upper bound on performance for distributed training techniques. Second, in densely-updated distributed training, workers use standard gradient descent to compute updates over all parameters, and all of the worker’s updates are added together on the centralized server. Third, in random mask distributed training, we randomly select a subset of parameters to update for workers. For a fair comparison, we keep the overall training batches the same for all methods, so the training iterations of a worker are half of that of the single-machine baseline.
|
| 122 |
+
|
| 123 |
+
Experimental setting In preliminary experiments on the GLUE benchmark (described in appendix A), we found that densely-updated distributed training saw no real degradation in performance even for long communication delays. This suggests that stale gradients could be less of an issue in transfer learning settings. We therefore instead focused on from-scratch training of a ResNet-34 on CIFAR-10. We train the model for 100 total epochs, with 50 epochs performed by each of the two workers. Notably, we found that the performance of sparse update methods was poor for fromscratch training unless we performed 5 epochs of standard training as “warmup” before beginning distributed training. Beyond this change, all the models and hyper-parameters follow those mentioned in section 4.1. We searched for the best initial learning rate in {0.4, 0.2, 0.08, 0.04, 0.02}. We measure performance using a varying number of parameter updates between each worker-server communication step. We report performance in terms of the accuracy achieved under a certain communication budget, where the communication cost is measured in terms of the equivalent number of full model parameter updates. For example, a method that updates $10 \%$ of the model’s parameters and performs 5 communication steps over the course of training has the same cost as a method that communicates all of a model’s parameters once (since we must transmit both the updated parameters and their locations; more details are in section 4.3).
|
| 124 |
+
|
| 125 |
+
Results Results from training a ResNet-34 on CIFAR-10 are shown in fig. 3. As in section 4.1, using a FISH Mask works better than using a random mask for all communication costs. Furthermore, we generally find that using FISH Mask with a sparsity level of $10 \%$ attains a better commnication/performance trade-off than densely-updated distributed training. For example, FISH Mask training attains comparable performance to standard training when only communicating two copies of the model, whereas densely-updated training performs significantly worse at this communication amount. Notably, performance was relatively poor when only updating $2 \%$ of the model’s parameters with FISH Mask, suggesting there is a lower bound under which it is difficult to attain reasonable results. As a whole, our results show significant promise for dramatically reducing computational costs in distributed training settings.
|
| 126 |
+
|
| 127 |
+
# 4.3 Efficient Checkpointing
|
| 128 |
+
|
| 129 |
+
Over the course of training a machine learning model, it is common to save intermediate checkpoint files that store the model’s parameter values. These checkpoints can be useful for restarting training from a given iteration rather than starting from scratch in the event that the training job crashes or is otherwise stopped. They are also commonly used for post-hoc analysis, for example for evaluating a model’s performance on new datasets or metrics over the course of training. Since checkpoints store a full copy of the model’s parameters, they can take up a significant amount of space on disk.
|
| 130 |
+
|
| 131 |
+

|
| 132 |
+
Figure 3: CIFAR-10 validation set accuracy achieved by a ResNet-34 through distributed training at different communication costs. $\mathrm { X }$ -axis refers to the total number of model communications required for a single worker. Standard (non-distributed) training achieves an accuracy of $9 3 . 9 \%$ .
|
| 133 |
+
|
| 134 |
+
Furthermore, depending on the checkpointing frequency, hundreds of checkpoints are often written to disk over the course of a training run. The development cycle of a machine learning model can result in hundreds of different model variants being trained. Combining these factors with the on-disk space needed to store the parameters of modern models (around 1 GB for BERTLARGE) results in potentially massive storage costs.
|
| 135 |
+
|
| 136 |
+
Training with sparse updates can significantly reduce these storage costs. Specifically, if only a small subset of the parameters are updated between checkpoint saves, then the checkpoint only needs to store the updated parameter values and indices denoting the position of the updated parameters’ values. Assuming that the storage costs for a parameter value and index is the same (e.g. using a 32-bit float for parameter values and a 32-bit integer for indices), using a sparse mask will reduce storage cost when the mask sparsity level is less than $50 \%$ . Note that this setting allows the “mask” to change over the course of training, and is therefore a relaxation of the setting in section 4.1, where the requirement is that the same subset of parameters is updated over the entire fine-tuning run. It follows from our results in section 4.1 that FISH Mask training could be readily applied to reducing checkpoint size in parameter-efficient transfer learning. However, we found that the strict requirement of fixing the mask over an entire from-scratch training run on CIFAR-10 resulted in a significant degradation in performance. This is in line with past work demonstrating the difficulty of identifying fixed sparse subnetworks to train before training begins [15]. We therefore focus on from-scratch training on CIFAR-10 and allow the mask to change every time a checkpoint is written, which does not increase storage requirements over using the same fixed mask from the start of training.
|
| 137 |
+
|
| 138 |
+
Table 2: CIFAR-10 validation set accuracy when using the FISH Mask and the Random Mask to reduce checkpoint sizes. “Epoch” refers to allowing the mask to change each epoch, and the number is how many epochs we update masks. Standard training achieves an accuracy of 93.9 $( \pm 0 . 1 ) \%$ .
|
| 139 |
+
|
| 140 |
+
Overall, we use the same experimental setup as in section 4.2. We measure performance when updating the mask every epoch (which is a common choice in practice), every 2 epochs, every 4 epochs, and leaving the mask fixed over the course of training. We performed a new search over learning rates in $\{ 0 . 4 , 0 . 2 , 0 . 0 8 , 0 . 0 4 , 0 . 0 2 \}$ We compare to baselines of standard training (which to serve as an upper bound on the performance of using a FISH Mask) and using a random mask.
|
| 141 |
+
|
| 142 |
+
<table><tr><td rowspan="2"></td><td colspan="3">Mask sparsity level</td></tr><tr><td>0.5%</td><td>2%</td><td>10%</td></tr><tr><td>Random Mask(1 Epoch)</td><td>74.80.6</td><td>84.40.2</td><td>90.00.2</td></tr><tr><td>FISH Mask (1 Epoch)</td><td>90.50.3</td><td>93.00.3</td><td>93.90.1</td></tr><tr><td>FISH Mask (2 Epochs)</td><td>90.30.5</td><td>92.50.1</td><td>93.70.2</td></tr><tr><td>FISH Mask (4 Epochs)</td><td>89.40.6</td><td>92.10.3</td><td>93.40.2</td></tr><tr><td>FISHMask (Fixed)</td><td>78.50.7</td><td>90.60.2</td><td>93.00.2</td></tr></table>
|
| 143 |
+
|
| 144 |
+
Results In table 2, we show the results of FISH Mask training when keeping the mask fixed over the course of training or updating it at each epoch. We find that updating the FISH Mask every epoch can match the performance of normal training $9 3 . 9 \%$ accuracy) at a mask sparsity level of $10 \%$ , which would reduce storage requirements by a factor of 5. At lower mask sparsity levels, we see some degradation in performance. We find that accuracy tends to decrease as we decrease the frequency of updating the mask, but this effect is relatively small. As mentioned earlier, we also found that using a fixed mask significantly degraded performance, though only by a few percent at a mask sparsity level of $10 \%$ . This suggests that the FISH Mask could also be useful for identifying sparse subnetworks to train before training begins, as conjectured by the Lottery Ticket Hypothesis [15]. We leave the exploration of this possibility for future work. Lastly, the FISH Mask’s performance is unanimously better than the Random Mask across the three mask sparsity levels.
|
| 145 |
+
|
| 146 |
+
# 4.4 Ablations
|
| 147 |
+
|
| 148 |
+
Having established the effectiveness of training with a FISH mask, we now ablate a few design choices to help demonstrate the robustness of our approach. We perform all ablation experiments in the parameter-efficient transfer learning setup described in section 4.1.
|
| 149 |
+
|
| 150 |
+
# 4.4.1 True Fisher vs. Empirical Fisher
|
| 151 |
+
|
| 152 |
+
In section 2, we note that past work has approximated the Fisher information matrix (eq. (3)) using either the expectation over $y \sim p _ { \theta } ( y | x )$ (“true Fisher”) or ground-truth labels (“empirical Fisher”). While past work has shown that using the empirical Fisher can be detrimental in optimization settings [34, 26], we mainly use the Fisher information as a signal of parameter importance. The empirical Fisher also has the benefit that it avoids marginalizing over or sampling from $p _ { \theta } ( y | x )$ and only requires computing the gradient for a single value of $y$ . When comparing the performance of using the true or empirical Fisher to compute a $0 . 5 \%$ -sparse FISH Mask for parameter-efficient transfer learning, we observe that both methods achieve near-identical performance with an average validation-set GLUE score of 82.5 in both cases. Since computing the empirical Fisher can be more computationally efficient, we used the empirical Fisher for all experiments.
|
| 153 |
+
|
| 154 |
+
# 4.4.2 Sample Ablation
|
| 155 |
+
|
| 156 |
+
We also ablate the number of samples, $N$ , used to compute the FISH Mask to study if more samples are beneficial. The results for parameter-efficient transfer learning on GLUE are shown in fig. 2, right. At a sample count of 0, the FISH Mask is equivalent to the Random Mask baseline presented in section 4.1 in which parameters to update are selected at random instead of informed by the Fisher information. We observe that FISH Mask performance on the GLUE validation set is surprisingly stable across many values of samples, with just 32 samples needed to achieve the highest-possible performance. These suggest that using the approximate Fisher information is a data-efficient approach of computing parameter importance, and we therefore ran all experiments with a sample count $N = 1 0 2 4$ , except in distributed training we use $N = 2 5 6$ for efficiency.
|
| 157 |
+
|
| 158 |
+
# 5 Conclusion
|
| 159 |
+
|
| 160 |
+
In this work, we proposed FISH Mask training as a novel method for pre-computing fixed sparse masks of a model’s parameters to update over many subsequent iterations. The FISH Mask estimates the importance of each of a model’s parameters by first approximating the Fisher information of each parameter and then selecting the $k$ parameters with the largest Fisher information to include in the mask. We demonstrate the usefulness of FISH Mask training in several settings, including parameter-efficient transfer learning, distributed training, and reducing storage requirements of model checkpoints. In future work, we hope to explore methods for improving the performance of FISH Mask training at lower mask sparsity levels, possibly by considering other measures of parameter importance. We also hope to further demonstrate the efficacy of FISH Mask in real-world settings where the benefits of sparse parameter updating are even more pronounced, such as in Federated Learning. The integration of FISH Masks across tasks and sharing amongst practitioners could also be a useful line of inquiry, as recent frameworks such as AdapterHub [39] have enabled for Adapter modules [19].
|
| 161 |
+
|
| 162 |
+
# Acknowledgments and Disclosure of Funding
|
| 163 |
+
|
| 164 |
+
We thank Yoon Kim, Michael Matena, and Demi Guo for helpful discussions.
|
| 165 |
+
|
| 166 |
+
References
|
| 167 |
+
[1] Alessandro Achille, Giovanni Paolini, and Stefano Soatto. Where is the information in a deep neural network? arXiv preprint arXiv:1905.12213, 2019.
|
| 168 |
+
[2] Alham Fikri Aji and Kenneth Heafield. Sparse communication for distributed gradient descent. arXiv preprint arXiv:1704.05021, 2017.
|
| 169 |
+
[3] Zeyuan Allen-Zhu, Yuanzhi Li, and Yingyu Liang. Learning and generalization in overparameterized neural networks, going beyond two layers. CoRR, abs/1811.04918, 2018. URL http://arxiv.org/abs/1811.04918.
|
| 170 |
+
[4] SI Amari. Neural learning in structured parameter spaces-natural riemannian gradient. Advances in neural information processing systems, pages 127–133, 1997.
|
| 171 |
+
[5] Ankur Bapna, Naveen Arivazhagan, and Orhan Firat. Simple, scalable adaptation for neural machine translation. arXiv preprint arXiv:1909.08478, 2019.
|
| 172 |
+
[6] Elad Ben-Zaken, Shauli Ravfogel, and Yoav Goldberg. BitFit: Simple parameter-efficient fine-tuning for transformer-based masked language models. 2021.
|
| 173 |
+
[7] Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. CoRR, abs/2005.14165, 2020. URL https://arxiv.org/abs/2005.14165.
|
| 174 |
+
[8] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey E. Hinton. A simple framework for contrastive learning of visual representations. CoRR, abs/2002.05709, 2020. URL https: //arxiv.org/abs/2002.05709.
|
| 175 |
+
[9] Ting Chen, Simon Kornblith, Kevin Swersky, Mohammad Norouzi, and Geoffrey E. Hinton. Big self-supervised models are strong semi-supervised learners. CoRR, abs/2006.10029, 2020. URL https://arxiv.org/abs/2006.10029.
|
| 176 |
+
[10] Elliot J. Crowley, Jack Turner, Amos Storkey, and Michael O’Boyle. Pruning neural networks: is it time to nip it in the bud? 2018.
|
| 177 |
+
[11] J. Dean, G. Corrado, Rajat Monga, Kai Chen, M. Devin, Quoc V. Le, Mark Z. Mao, Marc’Aurelio Ranzato, A. Senior, P. Tucker, K. Yang, and A. Ng. Large scale distributed deep networks. In NIPS, 2012.
|
| 178 |
+
[12] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 4171–4186, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1423. URL https://www.aclweb.org/anthology/N19-1423.
|
| 179 |
+
[13] Nikoli Dryden, Tim Moon, Sam Ade Jacobs, and Brian Van Essen. Communication quantization for data-parallel training of deep neural networks. In 2nd Workshop on Machine Learning in HPC Environments (MLHPC), 2016.
|
| 180 |
+
[14] Ronald A Fisher. On the mathematical foundations of theoretical statistics. Philosophical Transactions of the Royal Society of London. Series A, Containing Papers of a Mathematical or Physical Character, 222(594-604):309–368, 1922.
|
| 181 |
+
[15] Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. arXiv preprint arXiv:1803.03635, 2018.
|
| 182 |
+
[16] Demi Guo, Alexander M. Rush, and Yoon Kim. Parameter-efficient transfer learning with diff pruning. CoRR, abs/2012.07463, 2020. URL https://arxiv.org/abs/2012.07463.
|
| 183 |
+
[17] Moritz Hardt, Ben Recht, and Yoram Singer. Train faster, generalize better: Stability of stochastic gradient descent. In International Conference on Machine Learning, 2016.
|
| 184 |
+
[18] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. CoRR, abs/1512.03385, 2015. URL http://arxiv.org/abs/1512.03385.
|
| 185 |
+
[19] Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin de Laroussilhe, Andrea Gesmundo, Mona Attariyan, and Sylvain Gelly. Parameter-efficient transfer learning for NLP. CoRR, abs/1902.00751, 2019. URL http://arxiv.org/abs/1902.00751.
|
| 186 |
+
[20] Jeremy Howard and Sebastian Ruder. Universal language model fine-tuning for text classification. CoRR, abs/1801.06146, 2018. URL http://arxiv.org/abs/1801.06146.
|
| 187 |
+
[21] James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, et al. Overcoming catastrophic forgetting in neural networks. Proceedings of the national academy of sciences, 114(13), 2017.
|
| 188 |
+
[22] Jakub Konecnˇ y, H Brendan McMahan, Daniel Ramage, and Peter Richtárik. Federated optimiza- \` tion: Distributed machine learning for on-device intelligence. arXiv preprint arXiv:1610.02527, 2016.
|
| 189 |
+
[23] Jakub Konecnˇ y, H Brendan McMahan, Felix X Yu, Peter Richtárik, Ananda Theertha Suresh, \` and Dave Bacon. Federated learning: Strategies for improving communication efficiency. arXiv preprint arXiv:1610.05492, 2016.
|
| 190 |
+
[24] Simon Kornblith, Jonathon Shlens, and Quoc V Le. Do better imagenet models transfer better? In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2019.
|
| 191 |
+
[25] A. Krizhevsky. Learning multiple layers of features from tiny images. 2009.
|
| 192 |
+
[26] Frederik Kunstner, Lukas Balles, and Philipp Hennig. Limitations of the empirical fisher approximation for natural gradient descent. arXiv preprint arXiv:1905.12558, 2019.
|
| 193 |
+
[27] Yann A LeCun, Léon Bottou, Genevieve B Orr, and Klaus-Robert Müller. Efficient backprop. In Neural networks: Tricks of the trade, pages 9–48. Springer, 2012.
|
| 194 |
+
[28] Brian Lester, Rami Al-Rfou, and Noah Constant. The power of scale for parameter-efficient prompt tuning. arXiv preprint arXiv:2104.08691, 2021.
|
| 195 |
+
[29] Xiang Lisa Li and Percy Liang. Prefix-tuning: Optimizing continuous prompts for generation. arXiv preprint arXiv:2101.00190, 2021.
|
| 196 |
+
[30] Liyang Liu, Shilong Zhang, Zhanghui Kuang, Aojun Zhou, Jing-Hao Xue, Xinjiang Wang, Yimin Chen, Wenming Yang, Qingmin Liao, and Wayne Zhang. Group fisher pruning for practical network compression. 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 7021–7032. PMLR, 18–24 Jul 2021. URL https://proceedings. mlr.press/v139/liu21ab.html.
|
| 197 |
+
[31] Christos Louizos, Max Welling, and Diederik P. Kingma. Learning sparse neural networks through l_0 regularization. arXiv preprint arXiv:1712.01312, 2017.
|
| 198 |
+
[32] Rabeeh Karimi Mahabadi, James Henderson, and Sebastian Ruder. Compacter: Efficient low-rank hypercomplex adapter layers, 2021.
|
| 199 |
+
[33] Rabeeh Karimi Mahabadi, Sebastian Ruder, Mostafa Dehghani, and James Henderson. Parameter-efficient multi-task fine-tuning for transformers via shared hypernetworks, 2021.
|
| 200 |
+
|
| 201 |
+
[34] James Martens. New insights and perspectives on the natural gradient method. arXiv preprint arXiv:1412.1193, 2014.
|
| 202 |
+
|
| 203 |
+
[35] H. Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Agüera y Arcas. Communication-efficient learning of deep networks from decentralized data, 2017.
|
| 204 |
+
|
| 205 |
+
[36] Sinno Jialin Pan and Qiang Yang. A survey on transfer learning. IEEE Transactions on knowledge and data engineering, 22(10):1345–1359, 2009.
|
| 206 |
+
|
| 207 |
+
[37] Razvan Pascanu and Yoshua Bengio. Revisiting natural gradient for deep networks. arXiv preprint arXiv:1301.3584, 2013.
|
| 208 |
+
|
| 209 |
+
[38] Matthew E. Peters, Sebastian Ruder, and Noah A. Smith. To tune or not to tune? adapting pretrained representations to diverse tasks. arXiv preprint arXiv:1903.05987, 2019.
|
| 210 |
+
|
| 211 |
+
[39] Jonas Pfeiffer, Andreas Rücklé, Clifton Poth, Aishwarya Kamath, Ivan Vulic, Sebastian Ruder, Kyunghyun Cho, and Iryna Gurevych. Adapterhub: A framework for adapting transformers. CoRR, abs/2007.07779, 2020. URL https://arxiv.org/abs/2007.07779.
|
| 212 |
+
|
| 213 |
+
[40] 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. Journal of Machine Learning Research, 21, 2020.
|
| 214 |
+
|
| 215 |
+
[41] Sylvestre-Alvise Rebuffi, Hakan Bilen, and Andrea Vedaldi. Learning multiple visual domains with residual adapters. arXiv preprint arXiv:1705.08045, 2017.
|
| 216 |
+
|
| 217 |
+
[42] Benjamin Recht, Christopher Re, Stephen Wright, and Feng Niu. Hogwild!: A lock-free approach to parallelizing stochastic gradient descent. In J. Shawe-Taylor, R. Zemel, P. Bartlett, F. Pereira, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems, volume 24. Curran Associates, Inc., 2011. URL https://proceedings.neurips.cc/ paper/2011/file/218a0aefd1d1a4be65601cc6ddc1520e-Paper.pdf.
|
| 218 |
+
|
| 219 |
+
[43] Sidak Pal Singh and Dan Alistarh. Woodfisher: Efficient second-order approximation for neural network compression. Advances in Neural Information Processing Systems, 2020.
|
| 220 |
+
|
| 221 |
+
[44] Nikko Strom. Scalable distributed dnn training using commodity gpu cloud computing. In Sixteenth Annual Conference of the International Speech Communication Association, 2015.
|
| 222 |
+
|
| 223 |
+
[45] Zeyi Tao and Qun Li. esgd: Communication efficient distributed deep learning on the edge. In {USENIX} Workshop on Hot Topics in Edge Computing (HotEdge 18), 2018.
|
| 224 |
+
|
| 225 |
+
[46] Lucas Theis, Iryna Korshunova, Alykhan Tejani, and Ferenc Huszár. Faster gaze prediction with dense networks and fisher pruning. CoRR, abs/1801.05787, 2018. URL http://arxiv. org/abs/1801.05787.
|
| 226 |
+
|
| 227 |
+
[47] 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.
|
| 228 |
+
|
| 229 |
+
[48] 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. CoRR, abs/1804.07461, 2018. URL http://arxiv.org/abs/1804.07461.
|
| 230 |
+
|
| 231 |
+
[49] Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Rémi Louf, Morgan Funtowicz, et al. Huggingface’s transformers: State-of-the-art natural language processing. arXiv preprint arXiv:1910.03771, 2019.
|
| 232 |
+
|
| 233 |
+
[50] Mengjie Zhao, Tao Lin, Martin Jaggi, and Hinrich Schütze. Masking as an efficient alternative to finetuning for pretrained language models. CoRR, abs/2004.12406, 2020. URL https: //arxiv.org/abs/2004.12406.
|
md/train/Wga_hrCa3P3/Wga_hrCa3P3.md
ADDED
|
@@ -0,0 +1,615 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CONTRASTIVE LEARNING WITH ADVERSARIAL PERTURBATIONS FOR CONDITIONAL TEXT GENERATION
|
| 2 |
+
|
| 3 |
+
Seanie Lee1∗, Dong Bok Lee1∗, Sung Ju Hwang1,2 KAIST1, AITRICS2, South Korea {lsnfamily02, markhi, sjhwang82}@kaist.ac.kr
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Recently, sequence-to-sequence (seq2seq) models with the Transformer architecture have achieved remarkable performance on various conditional text generation tasks, such as machine translation. However, most of them are trained with teacher forcing with the ground truth label given at each time step, without being exposed to incorrectly generated tokens during training, which hurts its generalization to unseen inputs, that is known as the “exposure bias” problem. In this work, we propose to mitigate the conditional text generation problem by contrasting positive pairs with negative pairs, such that the model is exposed to various valid or incorrect perturbations of the inputs, for improved generalization. However, training the model with na¨ıve contrastive learning framework using random non-target sequences as negative examples is suboptimal, since they are easily distinguishable from the correct output, especially so with models pretrained with large text corpora. Also, generating positive examples requires domain-specific augmentation heuristics which may not generalize over diverse domains. To tackle this problem, we propose a principled method to generate positive and negative samples for contrastive learning of seq2seq models. Specifically, we generate negative examples by adding small perturbations to the input sequence to minimize its conditional likelihood, and positive examples by adding large perturbations while enforcing it to have a high conditional likelihood. Such “hard” positive and negative pairs generated using our method guides the model to better distinguish correct outputs from incorrect ones. We empirically show that our proposed method significantly improves the generalization of the seq2seq on three text generation tasks — machine translation, text summarization, and question generation.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The sequence-to-sequence (seq2seq) models (Sutskever et al., 2014), which learn to map an arbitrary-length input sequence to another arbitrary-length output sequence, have successfully tackled a wide range of language generation tasks. Early seq2seq models have used recurrent neural networks to encode and decode sequences, leveraging attention mechanism (Bahdanau et al., 2015) that allows the decoder to attend to a specific token in the input sequence to capture long-term dependencies between the source and target sequences. Recently, the Transformer (Vaswani et al., 2017), which is an all-attention model that effectively captures long-term relationships between tokens in the input sequence as well as across input and output sequences, has become the de facto standard for most of the text generation tasks due to its impressive performance. Moreover, Transformerbased language models trained on large text corpora (Dong et al., 2019; Raffel et al., 2020; Lewis et al., 2020) have shown to significantly improve the model performance on text generation tasks.
|
| 12 |
+
|
| 13 |
+
However, a crucial limitation of seq2seq models is that they are mostly trained only with teacher forcing, where ground truth is provided at each time step and thus never exposed to incorrectly generated tokens during training (Fig. 1-(a)), which hurts its generalization. This problem is known as the “exposure bias” problem (Ranzato et al., 2016) and often results in the generation of lowquality texts on unseen inputs. Several prior works tackle the problem, such as using reinforcement learning (RL) to maximize non-differentiable reward (Bahdanau et al., 2017; Paulus et al., 2018).
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Concept. (a) Training seq2seq with teacher forcing. (b) Na¨ıve contrastive learning with randomly sampled negative examples. (c) Our method, CLAPS, which generates hard negative and positive examples.
|
| 17 |
+
|
| 18 |
+
Another approach is to use RL or gumbel softmax (Jang et al., 2017) to match the distribution of generated sentences to that of the ground truth, in which case the reward is the discriminator output from a Generative Adversarial Network (GAN) (Zhang et al., 2018; 2017; Yu et al., 2017). Although the aforementioned approaches improve the performance of the seq2seq models on text generation tasks, they either require a vast amount of effort in tuning hyperparameters or stabilize training.
|
| 19 |
+
|
| 20 |
+
In this work, we propose to mitigate the exposure bias problem with a simple yet effective approach, in which we contrast a positive pair of input and output sequence to negative pairs, to expose the model to various valid or incorrect sentences. Na¨ıvely, we can construct negative pairs by simply using random nontarget sequences from the batch (Chen et al., 2020). However, such a na¨ıve construction yields meaningless negative examples that are already well-discriminated in the embedding space (Fig. 1-(b)), which we highlight as the reason why existing methods (Chen et al., 2020) require large batch size. This is clearly shown in Fig. 2, where a large portion of positive-negative pairs can be easily discriminated without any training, which gets worse as the batch size decreases as it will reduce the chance to have meaningfully difficult examples in the batch. Moreover, discriminating positive and na¨ıve negative pairs becomes even more easier for models pretrained on large text corpora.
|
| 21 |
+
|
| 22 |
+

|
| 23 |
+
Figure 2: Accuracy of classifying a positive pair from negative pairs varying batch size without any training.
|
| 24 |
+
|
| 25 |
+
To resolve this issue, we propose principled approaches to automatically generate negative and positive pairs for constrastive learning, which we refer to as Contrastive Learning with Adversarial Perturbation for Seq2seq learning (CLAPS). Specifically, we generate a negative example by adding a small perturbation to the hidden representation of the target sequence, such that its conditional likelihood is minimized (Denoted as the red circle in Fig. 1-(c)). Conversely, we construct an additional positive example (Denoted as green circle in Fig. 1-(c)) by adding a large amount of perturbation to the hidden representation of target sequence such that the perturbed sample is far away from the source sequence in the embedding space, while enforcing it to have high conditional likelihood by minimizing Kullback-Leibler (KL) divergence between the original conditional distribution and perturbed conditional distribution. This will yield a negative example that is very close to the original representation of target sequence in the embedding space but is largely dissimilar in the semantics, while the generated positive example is far away from the original input sequence but has the same semantic as the target sequence. This will generate difficult examples that the model fails to correctly discriminate (Fig. 1-(c), Fig.2), helping it learn with more meaningful pairs.
|
| 26 |
+
|
| 27 |
+
To verify the efficacy of our method, we empirically show that it significantly improves the performance of seq2seq model on three conditional text generation tasks, namely machine translation, text summarization and question generation. Our contribution in this work is threefold:
|
| 28 |
+
|
| 29 |
+
• To mitigate the exposure bias problem, we propose a contrastive learning framework for conditional sequence generation, which contrasts a positive pair of source and target sentence to negative pairs in the latent embedding space, to expose the model to various valid or incorrect outputs. • To tackle the ineffectiveness of conventional approach for constructing negative and positive examples for contrastive learning, we propose a principled method to automatically generate negative and positive pairs, that are more difficult and allows to learn more meaningful representations.
|
| 30 |
+
|
| 31 |
+
• We show that our proposed method, CLAPS, significantly improves the performance of seq2seq model on three different tasks: machine translation, text summarization, and question generation.
|
| 32 |
+
|
| 33 |
+
# 2 RELATED WORK
|
| 34 |
+
|
| 35 |
+
Exposure Bias There are several prior works to tackle the exposure bias (Ranzato et al., 2016). Bengio et al. (2015) introduce scheduled sampling where the model is initially guided with the true previous tokens but uses the tokens generated by the seq2seq model as the conditional input for the next token, as training goes on. Paulus et al. (2018); Bahdanau et al. (2017) leverage RL to maximize non-differentiable rewards, so it enables to penalize the model for incorrectly generated sentences. Another works (Zhang et al., 2017; 2018; Yu et al., 2017) train GANs to match the distribution of generated sequences to that of ground truth. Since sampling tokens from the generator is not differentiable, they resort RL or gumbel-softmax to train the networks in end-to-end fashion. However, they require either a large amount of effort to tune hyperparameters or stabilize training. However, Choshen et al. (2020) show that RL for machine translation does not optimize the expected reward and the performance gain is attributed to the unrelated effects such as increasing the peakiness of the output distribution. Moreover, (Caccia et al., 2019) show that by tuning the temperature parameter, the language models trained with MLE can be tuned to outperform GAN-based text generation models.
|
| 36 |
+
|
| 37 |
+
Adversarial Perturbation Many existing works, such as (Madry et al., 2018), address the robustness of neural networks to adversarial examples, which are generated by applying a small perturbations to the input samples. While adversarial robustness has been mostly explored in image domains, Miyato et al. (2017) adopted adversarial training to text domains. However instead of targeting robustness to perturbed samples, they utilize the adversarial examples as augmented data, and enforce consistency across the predictions across original unlabeled example and its perturbation, for semisupervised learning. Recently Zhu et al. (2019) and Jiang et al. (2020) leverage adversarial training to induce the smoothness of text classifiers, to prevent overfitting to training samples. While they are relevant to ours, these methods do not have the notion of positive and negative examples as they do not consider contrastive learning, and only target text classification. Moreover, they are computationally prohibitive since they use PGD for adversarial training, which requires iterative optimization for each individual sample. Recently, Aghajanyan et al. (2020) propose a simpler yet effective method based on Gaussian noise perturbation to regularize neural networks without expensive PGD steps, which is shown to outperform methods from Zhu et al. (2019) and Jiang et al. (2020). Although our work is similar to these prior works in that we add perturbations to the text embeddings, note that we used the adversarially-generated samples as negative examples of our contrastive learning framework rather than trying to learn the model to be robust to them.
|
| 38 |
+
|
| 39 |
+
Contrastive Learning Contrastive learning has been widely used. It is to learn a representation by contrasting positive pairs and negative pairs. Chopra et al. (2005); Weinberger & Saul (2009); Schroff et al. (2015) leverage a triplet loss to separate positive examples from negative examples in metric learning. Chen et al. (2020) show that contrastive learning can boost the performance of selfsupervised and semi-supervised learning in computer vison tasks. In natural language processing (NLP), contrastive learning has been widely used. In Word2Vec (Mikolov et al., 2013), neighbouring words are predicted from context with noise-contrastive estimation (Gutmann & Hyvarinen, 2012). ¨ Beyond word representation, Logeswaran & Lee (2018) sample two contiguous sentences for positive pairs and the sentences from other document as negative pairs. They constrast positive and negative pairs to learn sentence representation. Moreover, contrastive learning has been investigated in various NLP tasks — language modeling (Huang et al., 2018), unsupervised word alignment (Liu & Sun, 2015), caption generation (Mao et al., 2016; Vedantam et al., 2017), and machine translation (Yang et al., 2019).
|
| 40 |
+
|
| 41 |
+
# 3 METHOD
|
| 42 |
+
|
| 43 |
+
# 3.1 BACKGROUND: CONDITIONAL TEXT GENERATION
|
| 44 |
+
|
| 45 |
+
The goal of conditional text generation with a seq2seq model is to generate an output text sequence $\mathbf { y } ^ { ( i ) } = ( y _ { 1 } ^ { ( i ) } , \dots , y _ { T } ^ { ( i ) } )$ with length $T$ conditioned on the input text sequence $\mathbf { x } ^ { ( i ) } \stackrel { - } { = } ( x _ { 1 } ^ { ( i ) } , \cdot \cdot \cdot , x _ { L } ^ { ( i ) } )$
|
| 46 |
+
|
| 47 |
+
with length $L$ . A typical approach to the conditional text generation is to leverage the encoderdecoder architecture to parameterize the conditional distribution. We maximize the conditional log likelihood $\log p _ { \theta } ( \mathbf { y } | \mathbf { x } )$ for a given $N$ observations $\{ ( \mathbf { x } ^ { ( i ) } , \mathbf { y } ^ { ( i ) } ) \} _ { i = 1 } ^ { N }$ as follows:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\begin{array} { c } { { \displaystyle \mathcal { L } _ { M L E } ( \theta ) = \sum _ { i = 1 } ^ { N } \log p _ { \theta } ( \mathbf { y } ^ { ( i ) } | \mathbf { x } ^ { ( i ) } ) } } \\ { { { } } } \\ { { \displaystyle p _ { \theta } ( y _ { 1 } ^ { ( i ) } , \dots , y _ { T } ^ { ( i ) } | \mathbf { x } ^ { ( i ) } ) = \prod _ { t = 1 } ^ { T } p _ { \theta } ( y _ { t } ^ { ( i ) } | \mathbf { y } _ { < t } ^ { ( i ) } , \mathbf { x } ^ { ( i ) } ) } } \\ { { { } } } \\ { { \displaystyle p _ { \theta } ( y _ { t } ^ { ( i ) } | \mathbf { y } _ { < t } ^ { ( i ) } , \mathbf { x } ^ { ( i ) } ) = \mathrm { s o f t m a x } ( \mathbf { W h } _ { t } ^ { ( i ) } + \mathbf { b } ) } } \\ { { { } } } \\ { { { \mathbf { h } } _ { t } ^ { ( i ) } = g ( y _ { t - 1 } ^ { ( i ) } , \mathbf { M } ^ { ( i ) } ; \theta ) , ~ \mathbf { M } ^ { ( i ) } = f ( \mathbf { x } ^ { ( i ) } ; \theta ) } } \end{array}
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
where $f , g$ denote the encoder and the decoder respectively and $\mathbf { M } ^ { ( i ) } = [ \mathbf { m } _ { 1 } ^ { ( i ) } \cdot \cdot \cdot \mathbf { m } _ { L } ^ { ( i ) } ] \in \mathbb { R } ^ { d \times L }$ is the concatenation of the hidden representations of the source tokens $\mathbf { x } ^ { ( i ) }$ .
|
| 54 |
+
|
| 55 |
+
# 3.2 CONTRASTIVE LEARNING WITH ADVERSARIAL PERTURBATIONS FOR SEQ2SEQ
|
| 56 |
+
|
| 57 |
+
Since most of the seq2seq models are trained with teacher forcing where the ground truth tokens are provided to maximize Eq. 1, they are never exposed to incorrectly generated tokens during training, which is known as the “expousre bias” problem. In order to tackle the problem, we propose a contrastive learning framework to expose the model to various valid or incorrect output sequences for a given input sentence. Following the contrastive learning framework (Chen et al., 2020), we can train the model to learn the representations of the ground truth sentence by contrasting the positive pairs with the negative pairs, where we select the negative pairs as a random non-target output sequence from the same batch. As shown in Fig. 3-(a), we project the source and target text sequences onto the latent embedding space. Then we maximize the similarity between the pair of source and target sequence, while minimizing the similarity between the negative pairs as follows:
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\begin{array} { r l } & { \mathcal { L } _ { c o n t } ( \theta ) = \displaystyle \sum _ { i = 1 } ^ { N } \log \frac { \exp \left( \sin ( \mathbf { z } _ { \mathbf { x } } ^ { ( i ) } , \mathbf { z } _ { \mathbf { y } } ^ { ( i ) } ) / \tau \right) } { \sum _ { \mathbf { z } _ { \mathbf { y } } ^ { ( j ) } \in S } \exp \left( \sin ( \mathbf { z } _ { \mathbf { x } } ^ { ( i ) } , \mathbf { z } _ { \mathbf { y } } ^ { ( j ) } ) / \tau \right) } } \\ & { \qquad \mathbf { z } _ { \mathbf { x } } ^ { ( i ) } = \xi ( \mathbf { M } ^ { ( i ) } ; \theta ) , \mathbf { z } _ { \mathbf { y } } ^ { ( i ) } = \xi ( \mathbf { H } ^ { ( i ) } ; \theta ) } \\ & { \mathbf { \cdot } _ { 1 } \cdot \cdot \mathbf { \cdot v } _ { T } ] ; \theta ) : = \mathbf { A } \mathrm { v g P o o l } ( [ \mathbf { u } _ { 1 } \cdot \cdot \cdot \mathbf { u } _ { T } ] ) , \mathrm { w h e r e } \mathbf { u } _ { t } = \mathrm { R e L U } ( \mathbf { W } ^ { ( 1 ) } \mathbf { v } _ { t } + \mathbf { b } ^ { ( 1 ) } ) } \end{array}
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
where $\xi$ denotes the composition of affine transformation with the ReLU (Nair & Hinton, 2010) and average pooling to compute the fixed sized representation of a sentence $\textbf { z } \in \ \mathbb { R } ^ { d }$ , $\begin{array} { r l } { \mathbf { H } ^ { ( i ) } } & { { } = } \end{array}$ $[ { \bf h } _ { 1 } ^ { ( i ) } \cdot \cdot \cdot { \bf h } _ { T } ^ { \bar { ( i ) } } ] \in \mathbb { R } ^ { \bar { d } \times T }$ is a concatenation of the decoder hidden states of the target sentence $\mathbf { y } ^ { ( i ) }$ across all the time steps. Furthermore, $S = \{ \mathbf { z } _ { \mathbf { y } } ^ { ( j ) } : j \neq i \}$ is a set of hidden representations of target sentences (the objects other than circles in Fig. 3-(a)) that are randomly sampled and not paired with the source sentence $\mathbf { x } ^ { ( i ) }$ , and $\sin ( \cdot , \cdot )$ is a cosine similarity function.
|
| 64 |
+
|
| 65 |
+
However, training the model with na¨ıve contrastive learning framework using random non-target sequences as negative examples is highly suboptimal, as described in the introduction and shown in Fig. 1. Many of such na¨ıve negative examples are often located far away from the positive examples in the embedding space from the beginning, when using the pretrained language model. Therefore, simply using the examples from the same batch as done in Chen et al. (2020) will result in trivial negative examples and require very large batch size to enable sampling meaningful negative pairs within the same batch. Moreover, generating positive examples for text sequences is not a trivial problem either since for text domains, we do not have a well-defined set of augmentation methods that preserves the input semantics, unlike with the image domains. To tackle such difficulties, we propose a principled method to automatically construct the adversarial negative and positive examples, such that the samples are difficult for the model to classify correctly. These adversarial positive/negative pairs can guide the model to learn a more accurate representation of the target text sequence, by identifying which features make the output positive or negative (See Fig. 1-(c)).
|
| 66 |
+
|
| 67 |
+

|
| 68 |
+
Figure 3: Generation of imposters and distant-targets with perturbation. (a) We add small perturbation $\delta _ { t }$ to $\mathbf { h } _ { t }$ for $\tilde { \mathbf { z } } _ { \mathbf { y } }$ so that its conditional likelihood is minimized to generate an invalid sentence. (b) We add large perturbation $\zeta _ { t }$ to $\mathbf { h } _ { t }$ for $\hat { \mathbf { z } } _ { \mathbf { y } }$ by maximizing the distance from $\mathbf { z _ { x } }$ , the representation of source sentence but enforcing its likelihood high to preserve the original semantics.
|
| 69 |
+
|
| 70 |
+
# 3.3 GENERATION OF IMPOSTERS
|
| 71 |
+
|
| 72 |
+
As shown in Fig. 3-(b), to generate a negative example, we add a small perturbation $\begin{array} { r l } { \delta ^ { ( i ) } = } \end{array}$ $[ \delta _ { 1 } ^ { ( i ) } \cdot \cdot \cdot \delta _ { T } ^ { ( i ) } ] \in \mathbb { R } ^ { d \times T }$ to the $\mathbf { H } ^ { ( i ) }$ , which is the hidden representation of target sequence $\mathbf { y } ^ { ( i ) }$ , such that its conditional likelihood is minimized as follows:
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
p _ { \theta } ( \mathbf { y } ^ { ( i ) } | \mathbf { x } ^ { ( i ) } ; \mathbf { H } ^ { ( i ) } + \delta ) = \prod _ { t = 1 } ^ { T } p _ { \theta } ( y _ { t } ^ { ( i ) } | \mathbf { y } _ { < t } ^ { ( i ) } , \mathbf { x } ^ { ( i ) } ; \mathbf { h } _ { t } ^ { ( i ) } + \delta _ { t } )
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
$p _ { \theta } ( y _ { t } ^ { ( i ) } | \mathbf { y } _ { < t } ^ { ( i ) } , \mathbf { x } ^ { ( i ) } ; \mathbf { h } _ { t } ^ { ( i ) } + \delta _ { t } ) = \mathrm { s o f t m a x } \{ \mathbf { W } ( \mathbf { h } _ { t } ^ { ( i ) } + \delta _ { t } ) + \mathbf { b } \}$ where $\delta _ { t } \in \mathbb { R } ^ { d }$
|
| 79 |
+
|
| 80 |
+
The exact minimization of the conditional log likelihood with respect to $\delta$ is intractable for deep neural networks. Following Goodfellow et al. (2015), we approximate it by linearizing $\log p _ { \theta } ( \mathbf { y } ^ { ( i ) } | \mathbf { x } ^ { ( i ) } )$ around $\mathbf { H } ^ { ( i ) }$ as follows:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\tilde { \mathbf { H } } ^ { ( i ) } = \mathbf { H } ^ { ( i ) } - \epsilon \frac { g } { | | g | | _ { 2 } } , \mathrm { w h e r e } g = \nabla _ { \mathbf { H } ^ { ( i ) } } \log p _ { \theta } ( \mathbf { y } ^ { ( i ) } | \mathbf { x } ^ { ( i ) } )
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
We add small perturbation to the hidden representation of each token of target sentence $\mathbf { y } ^ { ( i ) }$ such that its conditional likelihood is minimized. Thus, the perturbed $\tilde { \mathbf { H } } ^ { ( i ) }$ , which we call an imposter (inspired by Weinberger & Saul (2009)), is semantically very dissimilar to $\mathbf { y } ^ { ( i ) }$ , but very close to the hidden representation $\mathbf { H } ^ { ( i ) }$ in the embedding space (Fig. 3-(a)). This will make it non-trivial for the sequence-to-sequence model to distinguish it from the representation of true target sequence $\mathbf { y } ^ { ( i ) }$ . Please note while adversarial perturbations are generated similarly as in Miyato et al. (2017), we use them in a completely different way. While they train the model to be invariant to adversarial samples within the $\epsilon$ -ball, we push them far away from the source sentence while pulling the ground truth target sentence to the input sentence. In other words, we use the perturbed representation as an additional negative sample for contrastive learning as follows:
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\mathcal { L } _ { c o n t - n e g } ( \theta ) = \sum _ { i = 1 } ^ { N } \log \frac { \exp ( \sin ( \mathbf { z } _ { \mathbf { x } } ^ { ( i ) } , \mathbf { z } _ { \mathbf { y } } ^ { ( i ) } ) / \tau ) } { \sum _ { \mathbf { z } _ { \mathbf { y } } ^ { ( k ) } \in S \cup \{ \bar { \mathbf { z } } _ { \mathbf { y } } ^ { ( i ) } \} } \exp ( \sin ( \mathbf { z } _ { \mathbf { x } } ^ { ( i ) } , \mathbf { z } _ { \mathbf { y } } ^ { ( k ) } ) / \tau ) } , \mathrm { w h e r e ~ } \tilde { \mathbf { z } } _ { \mathbf { y } } ^ { ( i ) } = \xi ( \tilde { \mathbf { H } } ^ { ( i ) } ; \theta _ { \mathbf { z } _ { \mathbf { x } } } ^ { ( i ) } ) ,
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
Alternatively, we can generate an imposter by perturbing the hidden representation of target sentence $\mathbf { y }$ so that its conditional likelihood is minimized but very close to the source sentence $\mathbf { x }$ in the embedding space. However, we empirically find that such a variation yields less performance gain.
|
| 93 |
+
|
| 94 |
+
# 3.4 GENERATION OF DISTANT-TARGETS
|
| 95 |
+
|
| 96 |
+
Moreover, as shown in Fig. 3-(c), we construct an additional positive pair of source sequence $\mathbf { x } ^ { ( i ) }$ by adding large perturbation $\boldsymbol { \zeta } ^ { ( i ) } = [ \zeta _ { 1 } ^ { ( i ) } \cdot \cdot \cdot \zeta _ { T } ^ { ( i ) } ] \in \mathbb { R } ^ { d \times T }$ to $\mathbf { H } ^ { ( i ) }$ the hidden state of target sequence $\mathbf { y } ^ { ( i ) }$ , such that cosine similarity from $\mathbf { z } _ { \mathbf { x } } ^ { ( i ) }$ is minimized, but the conditional likelihood is enforced to remain high. However, the exact computation of $\zeta ^ { ( i ) }$ with such constraints is intractable. We approximate it with the following two separate stages. First, we add perturbation to $\mathbf { H } ^ { ( i ) }$ such that it minimizes the contrastive learning objective $\mathcal { L } _ { c o n t } ( \theta )$ as shown in Eq. 6. Then we add another perturbation to minimize the KL divergence between perturbed conditional distribution $p _ { \theta } ( \hat { y } _ { t } ^ { ( i ) } | \hat { \mathbf { y } } _ { < t } ^ { ( i ) } , \mathbf { x } ^ { ( i ) } )$ and the original conditional distribution $p _ { \theta } ( y _ { t } ^ { ( i ) } | \mathbf { y } _ { < t } ^ { ( i ) } , \mathbf { x } ^ { ( i ) } )$ as shown in Eq. 7, where $\overline { { \mathbf { H } } } = [ \overline { { \mathbf { h } } } _ { 1 } \cdot \cdot \cdot \overline { { \mathbf { h } } } _ { T } ] \in \mathbb { R } ^ { d \times T }$ , $\hat { \mathbf { H } } = [ \hat { \mathbf { h } } _ { 1 } \cdot \cdot \cdot \hat { \mathbf { h } } _ { T } ] \in \mathbb { R } ^ { d \times T }$ , and $\eta \in \mathbb { R }$ . Note that $\theta ^ { * }$ denotes the copied of the model parameter $\theta$ and is considered to be constant to prevent it from being updated through back-propagation.
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\begin{array} { l } { { \displaystyle { \overline { { { \bf { H } } } } } ^ { ( i ) } = { \bf { H } } ^ { ( i ) } - \eta \frac { { \bf { g } } } { | | { \bf { g } } | | _ { 2 } } } \mathrm { { w h e r e } ~ } { \bf { g } } = \nabla _ { { \bf { H } } ^ { ( i ) } } \mathcal { L } _ { c o n t } ( \theta ) } \\ { { p _ { \theta } } ( \hat { y } _ { t } ^ { ( i ) } | \hat { \bf { y } } _ { < t } ^ { ( i ) } , { \bf { x } } ^ { ( i ) } ) = \mathrm { s o f t m a x } ( \mathbf { W } { \bf { \overline { { { h } } } } } _ { t } ^ { ( i ) } + { \bf { b } } ) } \\ { \mathcal { L } _ { K L } ( \theta ) = \displaystyle { \sum _ { i = 1 } ^ { N } \sum _ { t = 1 } ^ { T } D _ { K L } \big ( p _ { \theta ^ { * } } ( y _ { t } ^ { ( i ) } | \mathbf { y } _ { < t } ^ { ( i ) } , { \bf { x } } ^ { ( i ) } ) | | p _ { \theta } ( \hat { y } _ { t } ^ { ( i ) } | \hat { \bf { y } } _ { < t } ^ { ( i ) } , { \bf { x } } ^ { ( i ) } ) } \\ { \hat { \bf { H } } ^ { ( i ) } = { \bf { \overline { { { H } } } } } ^ { ( i ) } - \eta \frac { { \bf { f } } } { | | { \bf { f } } | | _ { 2 } } } , \mathrm { { w h e r e } ~ } { \bf { f } } = \nabla _ { { \bf { \overline { { { H } } } } } _ { 1 } ^ { ( i ) } } \mathcal { L } _ { K L } ( \theta ) } \end{array}
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
We consider the perturbed hidden state $\hat { \mathbf { H } } ^ { ( i ) }$ as an additional positive example for source sequence $\mathbf { x } ^ { ( i ) }$ , which we refer to as a distant-target. We can use a distant-target to augment contrastive learning and minimize ${ \mathcal { L } } _ { K L } ( \theta )$ as follows:
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\mathcal { L } _ { c o n t - p o s } ( \theta ) = \sum _ { i = 1 } ^ { N } \log \frac { \exp ( \sin ( \mathbf { z } _ { \mathbf { x } } ^ { ( i ) } , \hat { \mathbf { z } } _ { \mathbf { y } } ^ { ( i ) } ) / \tau ) } { \sum _ { \mathbf { z } _ { \mathbf { y } } ^ { ( k ) } \in S \cup \{ \hat { \mathbf { z } } _ { \mathbf { y } } ^ { ( i ) } \} } \exp ( \sin ( \mathbf { z } _ { \mathbf { x } } ^ { ( i ) } , \mathbf { z } _ { \mathbf { y } } ^ { ( k ) } ) / \tau ) } , \mathrm { w h e r e ~ } \hat { \mathbf { z } } _ { \mathbf { y } } ^ { ( i ) } = \xi ( \hat { \mathbf { H } } ^ { ( i ) } ; \theta )
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
CLAPS objective Incorporating the loss on the imposter and the distant target introduced above, we estimate the parameters of the seq2seq model $\theta$ by maximizing the following objective, where $\alpha , \beta$ are hyperparameters which control the importance of contrastive learning and KL divergence:
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
\displaystyle \operatorname* { m a x } _ { \theta } \mathcal { L } _ { M L E } ( \theta ) - \alpha \mathcal { L } _ { K L } ( \theta ) + \beta \{ \mathcal { L } _ { c o n t - n e g } ( \theta ) + \mathcal { L } _ { c o n t - p o s } ( \theta ) \}
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
For all the experiments, we set $\alpha$ and $\beta$ as 1, which we search through cross-validation. Note that after training is done, we remove the pooling layer $\xi$ and generate text with the decoder $g$ , given an input encoded with the encoder $f$ .
|
| 115 |
+
|
| 116 |
+
# 4 EXPERIMENT
|
| 117 |
+
|
| 118 |
+
We validate our method on benchmark datasets on three conditional text generation tasks.
|
| 119 |
+
|
| 120 |
+
# 4.1 TASKS
|
| 121 |
+
|
| 122 |
+
Machine Translation (MT) For machine translation, we use WMT16 Romanian-English parallel corpus (WMT’16 RO-EN) to train the model. We tokenize the pairs of source and target sequences with the same tokenizer as Raffel et al. (2020). We finetune the pretrained T5-small model for 20 epochs with the batch size of 128 and Adafactor (Shazeer & Stern, 2018). For contrastive learning, we set the norm of perturbation, $\eta$ and $\epsilon$ as 3.0.
|
| 123 |
+
|
| 124 |
+
Text Summarization (Sum.) For text summarization, we use XSum dataset (Narayan et al., 2018) of which summaries are highly abstractive, thus extractive summarization models under-perform abstractive models. We follow the most of the experimental settings for machine translation as described above, except that we set the norm of perturbation, $\eta$ and $\epsilon$ as 1.0 and 1.0, respectively.
|
| 125 |
+
|
| 126 |
+
Question Generation (QG) For question generation, we aim to generate a question from a given answer and paragraph, i.e., we model conditional distribution $p _ { \theta } ( \mathbf { y } | \mathbf { x } , \mathbf { a } )$ where $\mathbf x , \mathbf y$ , a denote a paragraph, question and answer, respectively. We concatenate the answer and paragraph with special tokens to generate the question conditioned on both of the answer and paragraph. As the previous experimental settings, we finetune T5-small model on SQuAD dataset (Rajpurkar et al., 2016) for 20 epochs with batch size 128 and set the norm of perturbation, $\eta$ as 3.0 and $\epsilon$ as 1.0. Since the test set of $\mathrm { S Q u A D }$ is only accessible via leader board, we randomly split the validation set into a validation set and a test set.
|
| 127 |
+
|
| 128 |
+
<table><tr><td>Method</td><td>Aug.</td><td>BLEU-1</td><td>BLEU-2</td><td>BLEU-3</td><td>BLEU-4</td><td>BLEU</td><td>F1/EM</td></tr><tr><td colspan="8">Question Generation - SQuAD</td></tr><tr><td>Harvesting-QG</td><td></td><td></td><td>=</td><td>20.90</td><td>15.16</td><td>=</td><td>66.05/54.62</td></tr><tr><td>T5-MLE</td><td></td><td>41.26</td><td>30.30</td><td>23.38</td><td>18.54</td><td>21.00</td><td>67.64/55.91</td></tr><tr><td>α-T5-MLE(α=0.7)</td><td></td><td>40.82</td><td>29.79</td><td>22.84</td><td>17.99</td><td>20.50</td><td>68.04/56.30</td></tr><tr><td>α-T5-MLE(α= 2.0)</td><td></td><td>37.35</td><td>27.20</td><td>20.79</td><td>16.36</td><td>18.41</td><td>65.74/54.76</td></tr><tr><td>T5-SSMBA</td><td>Pos.</td><td>41.67</td><td>30.59</td><td>23.53</td><td>18.57</td><td>21.07</td><td>68.47/56.37</td></tr><tr><td>T5-WordDropout Contrastive</td><td>Neg.</td><td>41.37</td><td>30.50</td><td>23.58</td><td>18.71</td><td>21.19</td><td>68.16/56.41</td></tr><tr><td>R3F</td><td>-</td><td>41.00</td><td>30.15</td><td>23.26</td><td>18.44</td><td>20.97</td><td>65.84/54.10</td></tr><tr><td>T5-MLE-contrastive</td><td>-</td><td>41.23</td><td>30.28</td><td>23.33</td><td>18.45</td><td>20.91</td><td>67.32/55.25</td></tr><tr><td>T5-CLAPS w/o negative</td><td>Pos.</td><td>41.87</td><td>30.93</td><td>23.90</td><td>18.92</td><td>21.38</td><td></td></tr><tr><td>T5-CLAPS w/o positive</td><td>Neg.</td><td>41.65</td><td>30.69</td><td>23.71</td><td>18.81</td><td>21.25</td><td>68.26/56.41</td></tr><tr><td>T5-CLAPS</td><td>Pos.+Neg.</td><td>42.33</td><td>31.29</td><td>24.22</td><td>19.19</td><td>21.55</td><td>69.01/57.06</td></tr><tr><td>ERNIE-GEN (Xiao et al.,2020)</td><td></td><td></td><td></td><td>=</td><td>26.95</td><td>=</td><td></td></tr><tr><td>Info-HCVAE (Lee et al.,2020)</td><td></td><td>-</td><td>=</td><td>=</td><td>-</td><td>=</td><td>81.51/71.18</td></tr><tr><td colspan="8">MachineTranslation-WMT'16RO-EN</td></tr><tr><td>Transformer</td><td></td><td>50.36</td><td>37.18</td><td>28.42</td><td>22.21</td><td>26.17</td><td></td></tr><tr><td>Scratch-T5-MLE</td><td></td><td>51.62</td><td>37.22</td><td>27.26</td><td>21.13</td><td>25.34</td><td></td></tr><tr><td>Scratch-CLAPS</td><td>Pos.+Neg.</td><td>53.42</td><td>39.57</td><td>30.24</td><td>23.59</td><td>27.61</td><td></td></tr><tr><td>T5-MLE</td><td></td><td>57.76</td><td>44.45</td><td>35.12</td><td>28.21</td><td>32.43</td><td></td></tr><tr><td>α-T5-MLE(α = 0.7)</td><td></td><td>57.63</td><td>44.23</td><td>33.84</td><td>27.90</td><td>32.14</td><td></td></tr><tr><td>α-T5-MLE(α = 2.0)</td><td>-</td><td>56.03</td><td>42.59</td><td>33.29</td><td>26.45</td><td>30.72</td><td></td></tr><tr><td>T5-SSMBA</td><td>Pos.</td><td>58.23</td><td>44.87</td><td>35.50</td><td>28.48</td><td>32.81</td><td></td></tr><tr><td>T5-WordDropout Contrastive</td><td>Neg.</td><td>57.77</td><td>44.45</td><td>35.12</td><td>28.21</td><td>32.44</td><td></td></tr><tr><td>R3F</td><td>-</td><td>58.07</td><td>44.86</td><td>35.57</td><td>28.66</td><td>32.99</td><td></td></tr><tr><td>T5-MLE-contrastive</td><td>-</td><td>57.64</td><td>44.12</td><td>34.74</td><td>27.79</td><td>32.03</td><td></td></tr><tr><td>T5-CLAPS w/o negative</td><td>Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>T5-CLAPS w/o positive</td><td>Neg.</td><td>58.81 57.90</td><td>45.52 44.60</td><td>36.20 35.27</td><td>29.23 28.34</td><td>33.50</td><td></td></tr><tr><td>T5-CLAPS</td><td>Pos.+Neg.</td><td>58.98</td><td>45.72</td><td>36.39</td><td>29.41</td><td>32.55 33.96</td><td></td></tr><tr><td>Conneau & Lample (2019)</td><td>1</td><td>-</td><td>-</td><td>-</td><td>-</td><td>38.5</td><td></td></tr></table>
|
| 129 |
+
|
| 130 |
+
Table 1: BLEU scores on WMT’16 RO-EN and SQuAD for machine translation and question generation. EM/F1 scores with BERT-base QA model for question generation.
|
| 131 |
+
|
| 132 |
+
# 4.2 EXPERIMENTAL SETUPS
|
| 133 |
+
|
| 134 |
+
Implementation Details For the encoder $f$ , and decoder $g$ , we use T5-small model, which is based on transformer with the hidden dimension, $d = 5 1 2$ . We set the temperature, $\tau$ as 0.1 for all the experiments. At test time, we use beam search of width 4 to generate the target sequences. Common Baselines We compare our method against relevant baselines.
|
| 135 |
+
|
| 136 |
+
1. T5-MLE: A pretrained T5 model fine-tuned to maximize $\mathcal { L } _ { M L E } ( \theta )$ .
|
| 137 |
+
2. Scratch-T5-MLE: A random initialized Transformer model that has the identical architecture to T5, trained by maximizing $\mathcal { L } _ { M L E } ( \theta )$ .
|
| 138 |
+
3. $\alpha$ -T5-MLE: T5 model trained with MLE, with varying temperature $\alpha$ in the softmax function when decoding the target sentences, as done in Caccia et al. (2019)
|
| 139 |
+
4. T5-SSMBA: This is the T5 model trained to maximize $\mathcal { L } _ { M L E } ( \theta )$ , with additional examples generated by the technique proposed in $\mathrm { N g }$ et al. (2020). which are generated by corrupting the target sequences and reconstructs them using a masked language model, BERT.
|
| 140 |
+
5. T5-WordDropout Contrastive: This is a T5 model trained with the contrastive learning framework proposed in Yang et al. (2019), which heuristically generates negative examples by removing the most frequent word from the target sequence. We pretrain T5-small to maximize $\mathcal { L } _ { M L E } ( \theta )$ and further train the model to assign higher probability to the ground truth target sentence than a negative example with max-margin loss.
|
| 141 |
+
6. R3F: This is a T5 model that minimizes the negative log likelihood and symmetric KL-divergence between original conditional log likelihood $p _ { \boldsymbol { \theta } } ( \mathbf { y } | \mathbf { x } )$ and $p _ { \boldsymbol { \theta } } ( \mathbf { y } | \tilde { \mathbf { x } } )$ to enforce the function to be smooth, where $\tilde { \mathbf { x } } =$ WordEmbedding $\mathbf { \Phi } _ { \cdot } ( \mathbf { x } ) + \mathbf { z } , \mathbf { z } = ( z _ { 1 } , \dots , z _ { L } ) , z _ { i } \overset { i . i . d } { \sim } \mathcal { N } ( \mathbf { 0 } , \mathrm { d i a g } ( \sigma _ { 1 } , \dots , \sigma _ { d } ) )$ .
|
| 142 |
+
7. T5-MLE-contrastive: This is a naive constrastive learning framework with positive/negative pairs, which maximizes the contrastive learning objective from Eq. 2.
|
| 143 |
+
8. T5-CLAPS w/o positive (negative): Our proposed model which jointly maximizes the log likelihood and the contrastive learning objective with imposters but does not use any distant-targets or imposters.
|
| 144 |
+
|
| 145 |
+
Table 2: Rouge and Meteor on Xsum test set for text summarization.
|
| 146 |
+
|
| 147 |
+
<table><tr><td>Method</td><td>Aug.</td><td>Rouge-1</td><td>Rouge-2</td><td>Rouge-L</td><td>METEOR</td></tr><tr><td colspan="6">Text Summarization - XSum</td></tr><tr><td>PTGEN-COVG</td><td>一</td><td>28.10</td><td>8.02</td><td>21.72</td><td>12.46</td></tr><tr><td>CONVS2S</td><td></td><td>31.89</td><td>11.54</td><td>25.75</td><td>13.20</td></tr><tr><td>Scratch-T5-MLE</td><td></td><td>31.44</td><td>11.07</td><td>25.18</td><td>13.01</td></tr><tr><td>Stcratch-CLAPS</td><td>Pos.+Neg.</td><td>33.52</td><td>12.59</td><td>26.91</td><td>14.18</td></tr><tr><td>T5-MLE</td><td></td><td>36.10</td><td>14.72</td><td>29.16</td><td>15.78</td></tr><tr><td>α-T5-MLE(α= 0.7)</td><td>=</td><td>36.68</td><td>15.10</td><td>29.72</td><td>15.78</td></tr><tr><td>α-T5-MLE (α= 2.0)</td><td>=</td><td>34.18</td><td>13.53</td><td>27.35</td><td>14.51</td></tr><tr><td>T5-SSMBA</td><td>Pos.</td><td>36.58</td><td>14.81</td><td>29.68</td><td>15.38</td></tr><tr><td>T5-WordDropout Contrastive</td><td>Neg.</td><td>36.88</td><td>15.11</td><td>29.79</td><td>15.77</td></tr><tr><td>R3F</td><td>-</td><td>36.96</td><td>15.12</td><td>29.76</td><td>15.68</td></tr><tr><td>T5-MLE-contrastive</td><td>-</td><td>36.34</td><td>14.81</td><td>29.41</td><td>15.85</td></tr><tr><td>T5-CLAPS w/o negative</td><td>Pos.</td><td>37.49</td><td>15.31</td><td>30.42</td><td>16.36</td></tr><tr><td>T5-CLAPS w/o positive</td><td>Neg.</td><td>37.72</td><td>15.49</td><td>30.74</td><td>16.06</td></tr><tr><td>T5-CLAPS</td><td>Pos.+Neg.</td><td>37.89</td><td>15.78</td><td>30.59</td><td>16.38</td></tr><tr><td>PEGASUS (Zhang et al.,2020)</td><td>=</td><td>47.21</td><td>24.56</td><td>39.25</td><td>-</td></tr></table>
|
| 148 |
+
|
| 149 |
+
9. T5-CLAPS: Our full model which jointly maximizes the log likelihood, contrastive learning objective, and KL-divergence as described in the Eq. 9.
|
| 150 |
+
|
| 151 |
+
10. Scratch-CLAPS: Our full model as T5-CLAPS but with randomly initialized T5 architecture.
|
| 152 |
+
|
| 153 |
+
Task specific baselines For machine translation, we use the Transformer (Vaswani et al., 2017) which consists of 6 layers of self-attention layer with 8 multi-head attention and 512 dimension, as an additional baseline. For QG, we additionally compare our models against Harvesting-QG (Du & Cardie, 2018), which is a LSTM model with copy mechanism. For text summarization, we use PTGEN-COVG (See et al., 2017) as a baseline, which uses copy mechanism and coverage to handle out of vocabulary word and prevent word repetition, and CONVS2S (Narayan et al., 2018) which uses convolutional networks as the encoder and decoder.
|
| 154 |
+
|
| 155 |
+
Evaluation Metric Following the conventional evaluation metrics, we adopt n-gram BLEU and BLEU (Papineni et al., 2002) for MT and QG. For text summarization, we use Rouge (Lin & Hovy, 2002) and Meteor (Banerjee & Lavie, 2005). As an additional performance measure for question generation, we evaluate a BERT QA model on the SQuAD test set, where the QA model is trained with the questions generated by each QG methods from the contexts and answers of HarvestingQA dataset (Du & Cardie, 2018), and report the F1 and Exact Match (EM).
|
| 156 |
+
|
| 157 |
+
# 4.3 EXPERIMENTAL RESULTS
|
| 158 |
+
|
| 159 |
+
Quantitative Results We compare our model with the baseline models on WMT’16 RO-En, XSum, SQuAD dataset for machine translation, text summarization and question generation, respectively. Table 1 shows that our proposed method CLAPS significantly outperforms the other baseline, with the performance gain of more than $1 \%$ on all tasks according to the BLEU scores. Moreover our proposed method improves the performance of the randomly initialized T5 model (Scratch-CLAPS). For question generation, our proposed method also improves F1/EM as well as BLEU scores. It shows that our proposed model is able to generate semantically valid questions that are beneficial for training the QA model. Note that naively constructing the negative examples for contrastive learning on the both tasks, by randomly shuffling the association of $\displaystyle ( \mathbf { x } , \mathbf { y } )$ from a given mini-batch, degrades the performance. Increasing the batch size to a large value, using larger memory, may increase its performance as observed in SimCLR (Chen et al., 2020). However, such an approach will be highly sample-inefficient. On the contrary, our model outperforms all the other baseline models on Xsum dataset for text summarization, as shown in Table 2. For summarization, we observe that contrastive learning with imposters alone can improve the performance by a large margin.
|
| 160 |
+
|
| 161 |
+
Visualization To examine our model with proposed contrastive learning framework learns meaningful representation of sentences, we encode a pair of sequences $\displaystyle ( \mathbf { x } , \mathbf { y } )$ into M, H with encoder $f$ and decoder $g$ . Then, we add perturbations to $\mathbf { H }$ to construct an imposter $\tilde { \bf H }$ and an additional positive
|
| 162 |
+
|
| 163 |
+

|
| 164 |
+
Figure 4: Visualization. (a) Embedding space without contrastive learning. (b) Embedding space with our proposed contrastive learning, CLAPS.
|
| 165 |
+
|
| 166 |
+
<table><tr><td>(MT) Lupta lui Hilary a fost mai atractiva. =>(GT): Hillary's struggle was more attractive =>(Dist.): Hilary's fight was more attractive =>(Imp.): Thearies'batle fight has attractive appealing</td></tr><tr><td>(QG)...Von Miller... recording five solo tackles,.. =>(GT): How many solo tackles did Von Miler make at Super Bowl 50? =>(Dist.): How many solo tackles did Von Miller record at Super Bowl 50? =>(Imp.):What much tackle did was Miller record at Super Bowl 50?</td></tr><tr><td>(Sum.) Pieces from the board game...have been found in... China.... =>(GT): An ancient board game has been found in a Chinese Tomb. =>(Dist.):An ancient board game has been discovered in a Chinese Tomb. =>(Imp.):America's gained vast Africa most well geographical countries, 22</td></tr></table>
|
| 167 |
+
|
| 168 |
+
Table 3: Greedy decoding from hidden representation of imposters and distant-targets. The answer span is highlighted for QG.
|
| 169 |
+
|
| 170 |
+
example $\hat { \bf H }$ as shown in Eq. 3 and 6, 7. We apply average pooling to $\mathbf { M } , \mathbf { H } , \tilde { \mathbf { H } }$ , and $\hat { \bf H }$ and project them onto two dimensional space with t-SNE (Maaten & Hinton, 2008). As shown in Fig. 4-(b), the model pushes away the imposter from the embedding of target sequence and pulls the embedding of the distant-targets to the embedding of the source sequence. For the model without contrastive learning, however, the embeddings of both target sequences and distant targets are far away from those of source sequences and the imposters are very close to them as shown in Fig. 4-(a).
|
| 171 |
+
|
| 172 |
+
Qualitative Examples For qualitative analysis, we examine the texts that are represented by the distant-target and imposter from our method, CLAPS. To decode them into output sequences, we apply affine transformation and softmax to $\tilde { \bf H }$ and $\hat { \bf H }$ and select the most likely token at each time step. As shown in Table 3, the distant-target example (Dist.), preserves the semantic of the original target sequence (GT) with a single word replaced by a synonym (colored in green). However, the imposters (Imp.) have completely different semantics, and often are gramatically incorrect (colored in red). This shows that the model are exposed to those various valid or incorrect sentences with our proposed contrastive learning framework with adversarial perturbations.
|
| 173 |
+
|
| 174 |
+
Human Evaluation We further conduct a human evaluation of the 20 summaries and 20 questions generated by our CLAPS and T5-MLE trained for text summarization and QG task. Specifically, 20 human judges perform blind quality assessment of two sentences generated by the two models, that are presented in a random order. For text summarization, $70 \%$ of the human annotators chose the sentences generated by our model as better than the baseline, and for QG, $85 \%$ favored the sentences generated by our model over that of the baseline.
|
| 175 |
+
|
| 176 |
+
# 5 CONCLUSION
|
| 177 |
+
|
| 178 |
+
To mitigate the exposure bias problem in sequence-to-sequence learning, we proposed a contrastive learning framework which maximizes the similarity between ground truth input and output sequence, and minimize the similarity between the input and an incorrect output sequence. Moreover, since conventional approach to sample random non-target examples from the batch as negative examples for contrastive learning results in trivial pairs that are well-discriminated from the beginning, we propose a new principled approach to automatically construct “hard” negative and positive examples, where the former is semantically dissimilar but close to the input embedding, and the latter is far from the input embedding but semantically similar. This adversarial learning enables the model to learn both the correct and incorrect variations of the input, and generalize better to unseen inputs. We empirically showed that our method improved the performance of seq2seq model on machine translation, question generation, and text summarization tasks. While we specifically targeted the exposure bias problem with seq2seq models for conditional text generation, our method may be applicable to seq2seq learning for tasks from other domains, such as automatic speech recognition, text-to-speech generation, or video captioning.
|
| 179 |
+
|
| 180 |
+
Acknowledgements This work was supported by Institute of Information & communications Technology Planning & Evaluation (IITP) grant funded by the Korea government (MSIT) (No.2020- 0-00153), Samsung Advanced Institute of Technology (SAIT), Samsung Electronics (IO201214- 08145-01), Institute of Information & communications Technology Planning & Evaluation (IITP) grant funded by the Korea government (MSIT) (No.2019-0-00075, Artificial Intelligence Graduate School Program (KAIST)), and the Engineering Research Center Program through the National Research Foundation of Korea (NRF) funded by the Korean Government MSIT (NRF2018R1A5A1059921).
|
| 181 |
+
|
| 182 |
+
# REFERENCES
|
| 183 |
+
|
| 184 |
+
Armen Aghajanyan, Akshat Shrivastava, Anchit Gupta, Naman Goyal, Luke Zettlemoyer, and Sonal Gupta. Better fine-tuning by reducing representational collapse. arXiv preprint arXiv:2008.03156, 2020.
|
| 185 |
+
|
| 186 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. International Conference on Learning Representations, ICLR, 2015.
|
| 187 |
+
|
| 188 |
+
Dzmitry Bahdanau, Philemon Brakel, Kelvin Xu, Anirudh Goyal, Ryan Lowe, Joelle Pineau, Aaron C. Courville, and Yoshua Bengio. An actor-critic algorithm for sequence prediction. International Conference on Learning Representations, ICLR, 2017.
|
| 189 |
+
|
| 190 |
+
Satanjeev Banerjee and Alon Lavie. Meteor: An automatic metric for mt evaluation with improved correlation with human judgments. Proceedings of the acl workshop on intrinsic and extrinsic evaluation measures for machine translation and/or summarization, 2005.
|
| 191 |
+
|
| 192 |
+
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.
|
| 193 |
+
|
| 194 |
+
Massimo Caccia, Lucas Caccia, William Fedus, Hugo Larochelle, Joelle Pineau, and Laurent Charlin. Language gans falling short. In International Conference on Learning Representations, 2019.
|
| 195 |
+
|
| 196 |
+
Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. International Conference on Machine Learning, ICML, 2020.
|
| 197 |
+
|
| 198 |
+
Sumit Chopra, Raia Hadsell, and Yann LeCun. Learning a similarity metric discriminatively, with application to face verification. 2005 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR’05), 2005.
|
| 199 |
+
|
| 200 |
+
Leshem Choshen, Lior Fox, Zohar Aizenbud, and Omri Abend. On the weaknesses of reinforcement learning for neural machine translation. International Conference on Learning Representations, ICLR, 2020.
|
| 201 |
+
|
| 202 |
+
Alexis Conneau and Guillaume Lample. Cross-lingual language model pretraining. In Advances in Neural Information Processing Systems, pp. 7059–7069, 2019.
|
| 203 |
+
|
| 204 |
+
Li Dong, Nan Yang, Wenhui Wang, Furu Wei, Xiaodong Liu, Yu Wang, Jianfeng Gao, Ming Zhou, and Hsiao-Wuen Hon. Unified language model pre-training for natural language understanding and generation. Advances in Neural Information Processing Systems, 2019.
|
| 205 |
+
|
| 206 |
+
Xinya Du and Claire Cardie. Harvesting paragraph-level question-answer pairs from wikipedia. Annual Meeting of the Association for Computational Linguistics, ACL, 2018.
|
| 207 |
+
|
| 208 |
+
Ian J. Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. International Conference on Learning Representations, ICLR, 2015.
|
| 209 |
+
|
| 210 |
+
Michael U Gutmann and Aapo Hyvarinen. Noise-contrastive estimation of unnormalized statistical ¨ models, with applications to natural image statistics. The journal of machine learning research, 2012.
|
| 211 |
+
|
| 212 |
+
Jiaji Huang, Yi Li, Wei Ping, and Liang Huang. Large margin neural language model. Empirical Methods in Natural Language Processing, EMNLP, 2018.
|
| 213 |
+
|
| 214 |
+
Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. International Conference on Learning Representations, ICLR, 2017.
|
| 215 |
+
|
| 216 |
+
Haoming Jiang, Pengcheng He, Weizhu Chen, Xiaodong Liu, Jianfeng Gao, and Tuo Zhao. Smart: Robust and efficient fine-tuning for pre-trained natural language models through principled regularized optimization. ACL, 2020.
|
| 217 |
+
|
| 218 |
+
Dong Bok Lee, Seanie Lee, Woo Tae Jeong, Donghwan Kim, and Sung Ju Hwang. Generating diverse and consistent QA pairs from contexts with information-maximizing hierarchical conditional vaes. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, ACL 2020, Online, July 5-10, 2020, pp. 208–224. Association for Computational Linguistics, 2020.
|
| 219 |
+
|
| 220 |
+
Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. BART: denoising sequence-to-sequence pretraining for natural language generation, translation, and comprehension. Annual Meeting of the Association for Computational Linguistics, ACL, 2020.
|
| 221 |
+
|
| 222 |
+
Chin-Yew Lin and Eduard Hovy. Manual and automatic evaluation of summaries. ACL Workshop on Automatic Summarization, 2002.
|
| 223 |
+
|
| 224 |
+
Yang Liu and Maosong Sun. Contrastive unsupervised word alignment with non-local features. Proceedings of the Twenty-Ninth AAAI Conference on Artificial Intelligence,, 2015.
|
| 225 |
+
|
| 226 |
+
Lajanugen Logeswaran and Honglak Lee. An efficient framework for learning sentence representations. International Conference on Learning Representations, 2018.
|
| 227 |
+
|
| 228 |
+
Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 2008.
|
| 229 |
+
|
| 230 |
+
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.
|
| 231 |
+
|
| 232 |
+
Junhua Mao, Jonathan Huang, Alexander Toshev, Oana Camburu, Alan L. Yuille, and Kevin Murphy. Generation and comprehension of unambiguous object descriptions. 2016 IEEE Conference on Computer Vision and Pattern Recognition, CVPR, 2016.
|
| 233 |
+
|
| 234 |
+
Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. Advances in neural information processing systems, 2013.
|
| 235 |
+
|
| 236 |
+
Takeru Miyato, Andrew M. Dai, and Ian J. Goodfellow. Adversarial training methods for semisupervised text classification. International Conference on Learning Representations, ICLR, 2017.
|
| 237 |
+
|
| 238 |
+
Vinod Nair and Geoffrey E Hinton. Rectified linear units improve restricted boltzmann machines. ICML, 2010.
|
| 239 |
+
|
| 240 |
+
Shashi Narayan, Shay B Cohen, and Mirella Lapata. Don’t give me the details, just the summary! topic-aware convolutional neural networks for extreme summarization. Empirical Methods in Natural Language Processing, EMNLP, 2018.
|
| 241 |
+
|
| 242 |
+
Nathan Ng, Kyunghyun Cho, and Marzyeh Ghassemi. Ssmba: Self-supervised manifold based data augmentation for improving out-of-domain robustness. Empirical Methods in Natural Language Processing, EMNLP, 2020.
|
| 243 |
+
|
| 244 |
+
Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a method for automatic evaluation of machine translation. Proceedings of the 40th Annual Meeting of the Association for Computational Linguistics, ACL 2002, 2002.
|
| 245 |
+
|
| 246 |
+
Romain Paulus, Caiming Xiong, and Richard Socher. A deep reinforced model for abstractive summarization. International Conference on Learning Representations, ICLR, 2018.
|
| 247 |
+
|
| 248 |
+
Matt Post. A call for clarity in reporting bleu scores. Proceedings of the Third Conference on Machine Translation: Research Papers, 2018.
|
| 249 |
+
|
| 250 |
+
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. Journal of Machine Learning Research, 2020.
|
| 251 |
+
|
| 252 |
+
Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: $^ { 1 0 0 , 0 0 0 + }$ questions for machine comprehension of text. Empirical Methods in Natural Language Processing, EMNLP, 2016.
|
| 253 |
+
|
| 254 |
+
Marc’Aurelio Ranzato, Sumit Chopra, Michael Auli, and Wojciech Zaremba. Sequence level training with recurrent neural networks. nternational Conference on Learning Representations, ICLR, 2016.
|
| 255 |
+
|
| 256 |
+
Florian Schroff, Dmitry Kalenichenko, and James Philbin. Facenet: A unified embedding for face recognition and clustering. Proceedings of the IEEE conference on computer vision and pattern recognition, 2015.
|
| 257 |
+
|
| 258 |
+
Abigail See, Peter J Liu, and Christopher D Manning. Get to the point: Summarization with pointergenerator networks. Annual Meeting of the Association for Computational Linguistics, ACL, 2017.
|
| 259 |
+
|
| 260 |
+
Shikhar Sharma, Layla El Asri, Hannes Schulz, and Jeremie Zumer. Relevance of unsupervised metrics in task-oriented dialogue for evaluating natural language generation. CoRR, 2017.
|
| 261 |
+
|
| 262 |
+
Noam Shazeer and Mitchell Stern. Adafactor: Adaptive learning rates with sublinear memory cost. arXiv preprint arXiv:1804.04235, 2018.
|
| 263 |
+
|
| 264 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. Advances in neural information processing systems, 2014.
|
| 265 |
+
|
| 266 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural information processing systems, 2017.
|
| 267 |
+
|
| 268 |
+
Ramakrishna Vedantam, Samy Bengio, Kevin Murphy, Devi Parikh, and Gal Chechik. Contextaware captions from context-agnostic supervision. IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2017, 2017.
|
| 269 |
+
|
| 270 |
+
Kilian Q Weinberger and Lawrence K Saul. Distance metric learning for large margin nearest neighbor classification. Journal of Machine Learning Research, 2009.
|
| 271 |
+
|
| 272 |
+
Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Remi Louf, Morgan Funtowicz, Joe Davison, Sam Shleifer, Patrick ´ von Platen, Clara Ma, Yacine Jernite, Julien Plu, Canwen Xu, Teven Le Scao, Sylvain Gugger, Mariama Drame, Quentin Lhoest, and Alexander M. Rush. Huggingface’s transformers: Stateof-the-art natural language processing. ArXiv, abs/1910.03771, 2019.
|
| 273 |
+
|
| 274 |
+
Dongling Xiao, Han Zhang, Yukun Li, Yu Sun, Hao Tian, Hua Wu, and Haifeng Wang. Ernie-gen: An enhanced multi-flow pre-training and fine-tuning framework for natural language generation. IJCAI, 2020.
|
| 275 |
+
|
| 276 |
+
Zonghan Yang, Yong Cheng, Yang Liu, and Maosong Sun. Reducing word omission errors in neural machine translation: A contrastive learning approach. Annual Meeting of the Association for Computational Linguistics, ACL, 2019.
|
| 277 |
+
|
| 278 |
+
Lantao Yu, Weinan Zhang, Jun Wang, and Yong Yu. Seqgan: sequence generative adversarial nets with policy gradient. Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence, 2017.
|
| 279 |
+
|
| 280 |
+
Jingqing Zhang, Yao Zhao, Mohammad Saleh, and Peter J Liu. Pegasus: Pre-training with extracted gap-sentences for abstractive summarization. ICML, 2020.
|
| 281 |
+
|
| 282 |
+
Yizhe Zhang, Zhe Gan, Kai Fan, Zhi Chen, Ricardo Henao, Dinghan Shen, and Lawrence Carin. Adversarial feature matching for text generation. International Conference on Machine Learning, ICML, 2017.
|
| 283 |
+
|
| 284 |
+
Yizhe Zhang, Michel Galley, Jianfeng Gao, Zhe Gan, Xiujun Li, Chris Brockett, and Bill Dolan. Generating informative and diverse conversational responses via adversarial information maximization. Advances in Neural Information Processing Systems, 2018.
|
| 285 |
+
|
| 286 |
+
Chen Zhu, Yu Cheng, Zhe Gan, Siqi Sun, Tom Goldstein, and Jingjing Liu. Freelb: Enhanced adversarial training for natural language understanding. In International Conference on Learning Representations, 2019.
|
| 287 |
+
|
| 288 |
+
Table 4: The statistics and the data source of WMT’16 RO-EN, Xsum, and SQuAD.
|
| 289 |
+
|
| 290 |
+
<table><tr><td>Datasets</td><td>Train (#)</td><td>Valid (#)</td><td>Test (#)</td><td>Source</td></tr><tr><td>WMT'16 RO-EN</td><td>610,320</td><td>1,999</td><td>1,999</td><td>Romanian-English Parallel corpus.</td></tr><tr><td>Xsum</td><td>204,045</td><td>11,332</td><td>11,334</td><td>One-sentence summary of BBC news articles.</td></tr><tr><td>SQuAD</td><td>86.588</td><td>5,192</td><td>5,378</td><td>Crowd-sourced questions from Wikipedia paragraph</td></tr></table>
|
| 291 |
+
|
| 292 |
+
# A EXPERIMENTAL DETAILS
|
| 293 |
+
|
| 294 |
+
Dataset For machine translation, text summarization, and question generation, we use WMT’16 RO-EN, Xsum, SQuAD dataset, for each task. The number of train/validation/test set and its source is shown in Table 4. Note that the number of validation and test set for SQuAD is different from the original dataset. Since the original test set is only accessible via the leader board of $\mathrm { S Q u A D ^ { 1 } }$ , we split the original validation set into our new validation and test set, following the conventions of question generation communities.
|
| 295 |
+
|
| 296 |
+
Preprocessing For machine translation, we download the raw text2, not the tokenized text, and use the same T5-tokenizer as Raffel et al. (2020) to tokenize both Romanian and English sentences. We limit the input and output length to 128 tokens. For text summarization, we also use the T5-tokenizer as before, and limit the input length to 512 tokens and output length to 128 tokens. For question generation, we set the maximum length of question as 64 tokens and input which is concatenation of answer and context as 384 tokens.
|
| 297 |
+
|
| 298 |
+
Implementation We finetune the pretrained T5-small model provided from the transformers library (Wolf et al., 2019)3 with Adafactor optimizer. We set the batch size 128 and follow the default setting of Adafactor optimizer to finetune the T5-small models. However, the number of negative examples from the batch is 16 or 32 (total batch size divided by the number of GPUs), because we split the batch into smaller batches and distribute them to each GPU machines. We use 8 GPUs for text summarization, and 4 GPUs for machine translation and question generation. The dimension of hidden state of T5 model, $d$ is 512, so we set the hidden size of $\mathbf { z }$ as the same.
|
| 299 |
+
|
| 300 |
+
Evaluation We use beam search with beam width 4 to generate the target sentences from the source sentences of the test set. Some of the examples are shown in Table 5,6,A. After the generation, we convert the tokens into the raw texts and compare them to the raw text of ground truth target sentences with the automatic evaluation metrics. For n-gram BLEU and Meteor, we use the implementation by Sharma et al. $( 2 0 1 7 ) ^ { 4 }$ . For BLEU score, we adopt the implementation by Post $( 2 0 1 8 ) ^ { 5 }$ .
|
| 301 |
+
|
| 302 |
+
Article: The US military says a strike targeting Taliban in the northern city of Kunduz may have caused ”collateral damage”. Offering his ”deepest condolences”, Mr Obama said he expected a ”full accounting of the facts” and would then make a definitive judgement. . . .
|
| 303 |
+
|
| 304 |
+
GT: President Barack Obama says the US has launched a ”full investigation” into air strikes that killed 19 people at an MSF-run Afghan hospital on Saturday.
|
| 305 |
+
|
| 306 |
+
CLAPS: US President Barack Obama has called for an inquiry into air strikes in Afghanistan that killed dozens of medical workers.
|
| 307 |
+
|
| 308 |
+
Article: Forecasts were for quarterly growth of between $0 . 5 \%$ and $0 . 7 \%$ . Official statistics also showed that household consumption expenditure boosted the quarterly growth numbers. But economist Shane Oliver told the BBC the numbers were “well below potential”. On an annual basis the economy expanded $2 . 3 \%$ , beating expectations for $2 . 1 \%$ . Economic growth in the March quarter of 2014 was $2 . 9 \%$ . “The March quarter GDP [gross domestic product] growth was far better than feared just a few days ago,” said Mr Oliver, who is chief economist with AMP Capital in Sydney. “However, Australia is still not out of the woods, as annual growth at $2 . 3 \%$ is well below potential, and a full $0 . 8 \%$ percentage points of the $0 . 9 \%$ growth came from higher inventories and trade.” He said domestic demand remained “very weak with consumer spending and home construction only just offsetting the ongoing slump in mining investment”. ...
|
| 309 |
+
|
| 310 |
+
GT: Australia’s economy grew at a better-than-expected $0 . 9 \%$ in the first quarter of 2015, compared to the previous quarter, boosted by mining together with financial and insurance services.
|
| 311 |
+
|
| 312 |
+
CLAPS: Australia’s economy grew faster than expected in the first three months of the year, according to official figures.
|
| 313 |
+
|
| 314 |
+
Article: After the problems last week, many doubt the system will cope.
|
| 315 |
+
Transport for London (TfL) remains confident, although it admits there will be breakdowns.
|
| 316 |
+
The trick will be in getting the system back up and running quickly. So here’s some friendly advice for tourists and Olympic visitors to try and make the transport experience as easy as possible.
|
| 317 |
+
If anyone thinks of any more please post below.
|
| 318 |
+
|
| 319 |
+
GT: The busiest summer ever looms for London’s transport system.
|
| 320 |
+
|
| 321 |
+
CLAPS: London’s transport system has been a pretty busy week.
|
| 322 |
+
|
| 323 |
+
Article: The outgoing vice-president spoke during a state dinner and took the opportunity to praise America’s northern neighbour. ”The world is going to spend a lot of time looking to you, Mr Prime Minister”, he told the Canadian leader. Mr Biden has been highly critical of US President-elect Donald Trump. ”Vive le Canada because we need you very, very badly,” he told the dinner guests. He went on to describe the self-doubt that liberal leaders across the world are currently experiencing after several political defeats. But he praised ”genuine leaders” including German Chancellor Angela Merkel, saying such statesmen and women are in short supply. Mr Trudeau reportedly became emotional during Mr Biden’s remarks when the American spoke of his late father, former Prime Minister Pierre Trudeau. ”You’re a successful father when your children turn out better than you,” Mr Biden said. ...
|
| 324 |
+
|
| 325 |
+
GT: US Vice-President Joe Biden told an audience in Ottawa that the world needs ”genuine leaders” such as Canadian Prime Minister Justin Trudeau.
|
| 326 |
+
|
| 327 |
+
CLAPS: Vice-President Joe Biden has praised Canadian Prime Minister Vive le Canada for his visit to the country.
|
| 328 |
+
|
| 329 |
+
Article: The Swedish giant asked customers who bought
|
| 330 |
+
any model of the Mysingso chair to return it for a full refund.
|
| 331 |
+
The global recall comes after Ikea received reports from
|
| 332 |
+
Finland, Germany, the US, Denmark and Australia
|
| 333 |
+
that users had received injuries to their fingers that needed medical treatment.
|
| 334 |
+
Ikea’s statement said the chair had a ”risk of falling or finger entrapment”.
|
| 335 |
+
It said: ”After washing the fabric seat it is possible to re-assemble the chair incorrectly leading to risks of falls or finger entrapments.
|
| 336 |
+
”Ikea has received five incident reports in which a Mysingso beach chair collapsed during use due to incorrect re-assembly.
|
| 337 |
+
All five reports included injuries to fingers and required medical attention.
|
| 338 |
+
It added that a full investigation had led to an improved design
|
| 339 |
+
”to further mitigate the risks of incorrect re-assembly and injuries”
|
| 340 |
+
and the updated chair would be available from next month.
|
| 341 |
+
Ikea has more than 300 stores in 27 countries.
|
| 342 |
+
|
| 343 |
+
GT: Ikea is recalling a beach chair sold in the UK after reports that it can collapse and cause injury.
|
| 344 |
+
|
| 345 |
+
CLAPS: Ikea is recalling a popular beach chair that collapsed during use because of incorrect re-assemblies.
|
| 346 |
+
|
| 347 |
+
<table><tr><td>Article: Spending on the NHS should also be paid for by a dedicated tax marked on every payslip,the former health minister suggested. Under Mr Lamb's plan,taxes would not be increased as the new levy would be offset by deductions to income tax or national insurance. He has warned the NHS faces collapse without an urgent cash injection. The plans are not yet party policy and will not be put to this year's conference in Bournemouth.But Mr Lamb,the party's health spokesman, told party members he was "very interested in the idea of a dedicated NH S and care contribution - separating it out from the rest of taxation, clearly identified on your payslip."And Iam really interested in the idea of the right for local areas to raise additional funds for the NHS and care if theychoose.’The Lib Dems say he would like to implement the ideas across theUK,although,as health and social care are devolved, it is unclear how this would be enforced. Mr Lamb - who lost out to Tim Farron in a leadership election in July - proposes a cross-party commission to explore the ideas. Heintends to consult health bodies and professionals, patients,trade unions and academics.Ministers have pledged f2bn in this financial year for the NHS,and an extra f8bn by 2020. But MrLamb told the BBC that this was insuffcient and, having "seen the books”as a minister in the last government, he feared the NHS could face a funding shortfall of f3Obn by 2020. "The bottom line is with rising demand because of an ageing population we need more investment,” he said.MrLamb also warned that the social care system was "on its knees" and could collapse without a cash injection of f5bn. "I've been in the department. Ihave seen the books and Iam deeply concerned. If we carry on regardless, the system will crash." Taxpayers are already shown how much they have contributed to the health service in annual personal tax statements.An attempt to establish a cross-party commission on social care before the 2O1O election -led in part by MrLamb -collapsed in acrimony.</td></tr></table>
|
| 348 |
+
|
| 349 |
+
GT: English councils should be allowed to put up taxes to fund the NHS, Norman Lamb has told the Lib Dem conference.
|
| 350 |
+
|
| 351 |
+
CLAPS:A new levy on the NHS and social care should be introduced by the Liberal Democrats, Norman Lamb has said.
|
| 352 |
+
|
| 353 |
+
Article: Yorkshire, Lancashire and Derbyshire have been worst affected,
|
| 354 |
+
after $2 { \cdot } 5 \mathrm { c m }$ fell overnight, with $1 0 \mathrm { c m }$ reported on higher ground.
|
| 355 |
+
Passengers waiting to depart Manchester Airport have reported
|
| 356 |
+
being stuck on the runway for hours due to a lack of de-icers.
|
| 357 |
+
Leeds Bradford Airport suspended all morning flights but has since reopened.
|
| 358 |
+
Manchester Airport reported ”minor delays to departing aircraft”
|
| 359 |
+
- but passengers told the BBC they had been stuck on board outbound flights.
|
| 360 |
+
Shirley Hale said her Jet2 flight to Tenerife
|
| 361 |
+
had been waiting to depart for over four hours.
|
| 362 |
+
”We have been told that there are not enough de-icers at the airport,”
|
| 363 |
+
she said. The airport apologised and said de-icing was the responsibility of
|
| 364 |
+
airlines and their ground teams. More than 100 schools were closed across East Lancashire and Oldham, with 80 shut in West Yorkshire.
|
| 365 |
+
BBC Weather said Buxton in Derbyshire saw up to $1 7 \mathrm { c m }$ of snow,
|
| 366 |
+
the deepest measured on Friday. The avalanche risk in the Peak District was
|
| 367 |
+
currently extremely high, Buxton Mountain Rescue Team said.
|
| 368 |
+
Parts of Staffordshire have been affected, with several centimetres of
|
| 369 |
+
snow reported in Flash, England’s highest village.
|
| 370 |
+
Commuters have been urged to allow extra journey time,
|
| 371 |
+
and the Met Office has issued snow and ice warnings.
|
| 372 |
+
More on the snow and other stories in West Yorkshire Weather
|
| 373 |
+
updates for Lancashire and Greater Manchester BBC Weather
|
| 374 |
+
presenter Kay Crewdson said conditions were due to slowly
|
| 375 |
+
improve into Saturday. Molly Greenwood reported $1 0 \mathrm { c m }$ of snow
|
| 376 |
+
in the Huddersfield area. ”Don’t think I’m going anywhere,” she said.
|
| 377 |
+
Zulfi Hussain said the snow was causing ”traffic chaos” in Woodhall Road,
|
| 378 |
+
Calverley, near Leeds. Elliott Hudson, another West Yorkshire resident,
|
| 379 |
+
said: ”Looks like I have woken up in Narnia.”
|
| 380 |
+
West Yorkshire’s Liversedge FC, who have had to cancel every home
|
| 381 |
+
game for the last four months due to bad weather,
|
| 382 |
+
tweeted a picture of snow with the caption:
|
| 383 |
+
”It’s not looking good for Liversedge FC’s home game with Worksop Town tomorrow.” The A628 Woodhead, A57 Snake Pass and A537 Cat and
|
| 384 |
+
Fiddle roads are all affected, with delays reported on
|
| 385 |
+
the M65 motorway. Highways England said the A57 eastbound
|
| 386 |
+
in Great Manchester is closed between M67/A560 and B6174
|
| 387 |
+
due to severe weather conditions. It said teams were working
|
| 388 |
+
to clear the road. Tony Hallwood, from Leeds Bradford Airport,
|
| 389 |
+
said it reopened at about 09:00 GMT after crews used ploughs
|
| 390 |
+
to clear snow from the runway. He said: ”We are asking passengers
|
| 391 |
+
to make their way to the airport as early as they can given the difficult
|
| 392 |
+
conditions.” Bus operators are also reporting delays to all services
|
| 393 |
+
across West Yorkshire. Oldham Council has said 48 schools had closed
|
| 394 |
+
this morning as a result of the snow and severe weather.
|
| 395 |
+
Drivers are also being asked to take extra care after snow
|
| 396 |
+
fell overnight in some parts of Northern Ireland.
|
| 397 |
+
A Met Office yellow warning for ice and snow in
|
| 398 |
+
northern England and Wales ended at 15:00.
|
| 399 |
+
|
| 400 |
+
GT: Heavy snowfall has caused travel disruption in parts of northern England.
|
| 401 |
+
|
| 402 |
+
CLAPS: Flights have been disrupted after a large avalanche hit parts of England.
|
| 403 |
+
|
| 404 |
+
Article: But once the votes are counted, what can residents expect to pay in co Below are the figures for a Band D property for every council area
|
| 405 |
+
in Wales for the current financial year of 2017/18,
|
| 406 |
+
how much that has gone up by for the current year,
|
| 407 |
+
and what the average property in the area actually pays.
|
| 408 |
+
They are grouped here by police force region -
|
| 409 |
+
council tax includes the police precept which is added to
|
| 410 |
+
the overall bill paid by homes. Local government is not fully
|
| 411 |
+
funded by council tax. Much of the funding for councils comes
|
| 412 |
+
in the form of grants from the Welsh Government,
|
| 413 |
+
which in turn gets its funding from the UK government in London.
|
| 414 |
+
In 2017/18 a total of $\pm 4 . 1$ bn is being divided among Wales’ 22 councils. The lions share of council cash goes on schools
|
| 415 |
+
- with social services following behind, as shown in the graph above.
|
| 416 |
+
Residents pay council tax based on which band their property is in,
|
| 417 |
+
based on its worth. Band D has historically been used as
|
| 418 |
+
the standard for comparing council tax levels between and across local
|
| 419 |
+
authorities. It is used to charge tax to a property that, in Wales,
|
| 420 |
+
was worth between $\varepsilon 9 1 \mathrm { , 0 0 1 }$ to $\mathcal { L } 1 2 3 \mathrm { , 0 0 0 }$ on April 2003 values.
|
| 421 |
+
Council tax gets lower the cheaper a property is,
|
| 422 |
+
and higher the more expensive a property is.
|
| 423 |
+
Council tax figures source: Welsh Government
|
| 424 |
+
|
| 425 |
+
GT: Voters will go to the polls on Thursday to determine who will represent them on local councils.
|
| 426 |
+
|
| 427 |
+
CLAPS: The people of Wales are voting in a referendum on whether or not to pay council tax.
|
| 428 |
+
|
| 429 |
+
Article: The side’s appearance in France will be its first at a major tournament since the 1958 World Cup. Players and coaches left their base at the Vale Resort, Vale of Glamorgan, on Saturday and headed to Cardiff Airport. After a send-off from pupils from Ysgol Treganna, Cardiff, the team took off for a friendly in Sweden on Sunday. They will then head to France ahead of the team’s first game of the tournament against Slovakia on 11 June.
|
| 430 |
+
|
| 431 |
+
GT: Wales’ football team has departed the country as their Euro 2016 preparations reach a climax.
|
| 432 |
+
|
| 433 |
+
CLAPS: Wales’ Euro 2016 squad have arrived in France for the first time since 1958.
|
| 434 |
+
|
| 435 |
+
Article: The 40-year-old, from the South Bank area of Teesside, was discovered on the A66 in the early hours ”in a distressed state” with wounds to his groin after the attack. The road, from Greystones Roundabout to Church Lane in Middlesbrough, was shut earlier while searches of the area were carried out. It has now reopened. A 22-year-old man was arrested on suspicion of assault and later bailed. Cleveland Police said the injured man had been placed in an induced coma in hospital. The force said in a statement: ”Police can confirm that the man found this morning on the A66 had wounds to his groin area. ”Officers are continuing to investigate and are appealing for anyone with information to contact them.”
|
| 436 |
+
|
| 437 |
+
GT: A man has been found by the side of a road with his penis cut off.
|
| 438 |
+
|
| 439 |
+
CLAPS: A man is in an induced coma after being found with serious injuries on a Teesside road.
|
| 440 |
+
|
| 441 |
+
<table><tr><td>Article:In July,a majorbugwas discovered in the software that could let hijackers access data on up to a billion phones. Manufacturers have been slow to roll out a fix because many variations of Android are widely used. One Android expert said it was "about time" phone makers issued security fixes more quickly. Android has been working to patch a vulnerability,known as Stagefright, which could let hackers access a phone's data simply by sending somebody a video message."My guess is that this is the single largest software update the world has ever seen,”said Adrian Ludwig, Android's lead engineer for security,at hacking conference Black Hat. LG,Samsung and Google have all said a number of their handsets will get the fix,with further updates every month. Android is an open source operating system,with the software freelyavailable for phone manufacturers to modify and use on their handsets. The Google-led project does provide security fixes for the software, but phone manufacturers are responsible for sending the updates to their devices. Some phones running old versions of Android are no longer updated by the manufacturer. Many companies also deploy customised versions of Android which take time to rebuild with the security changes. Apple and BlackBerry can patch security problems more quickly because they develop both the software and the hardware for their devices. BlackBerry's software is reviewed by mobile networks before being sent to handsets,while Apple can push updates to its phones whenever it wants. "The very nature of Android is that manufacturers add their own software on top,so there have been delays in software roll-outs,”said Jack Parsons,editor of Android Magazine. "In the US it's even worse because mobile carriers often add their own software too,adding another layer of bureaucracy holding up security fixes. "There's no real villain here,that's just how the system works. But there will always be security concerns with software,</td><td>so it's right that some of the manufacturers are stepping up to deal with this now."</td></tr></table>
|
| 442 |
+
|
| 443 |
+
GT: Samsung, LG and Google have pledged to provide monthly security updates for smartphones running the Android operating system.
|
| 444 |
+
|
| 445 |
+
CLAPS: The world’s largest software update is to be issued by Google-led Android.
|
| 446 |
+
|
| 447 |
+
Article: The move follows a claim by Crossmaglen Rangers player Aaron Cunningham that he was the victim of verbal abuse during the 2 December Ulster football final. The Ulster Council carried out an investigation and BBC Sport understands one Kilcoo player is to be banned for six months and another for four months. Kilcoo said they had not been notified, and the players could appeal. The two suspensions have yet to be officially confirmed by the Ulster Council. It is believed the case was the first time an allegation of racial abuse had been lodged with the provincial governing body. When an investigation was announced, Ulster GAA president Aogan O Fearghail, said anyone found ´ guilty of racism would be dealt with severely. Kilcoo released a statement saying the club condemned abuse and would co-operate with the Ulster Council’s investigation. The Gaelic Athletic Association, which governs the sport in Ireland, is to discuss how to deal with racism at its annual congress in March.
|
| 448 |
+
|
| 449 |
+
GT: Two Kilcoo players are to be suspended by Ulster GAA chiefs following allegations of racial abuse.
|
| 450 |
+
|
| 451 |
+
CLAPS: Two Kilcoo players have been suspended by the Ulster GAA for alleged racial abuse.
|
| 452 |
+
|
| 453 |
+
Table 6: Generated Questions by CLAPS from SQuAD. Answer spans are highlighted.
|
| 454 |
+
|
| 455 |
+
Context: ... The Broncos finished the regular season with a 12-4 record, and denied the New England Patriots a chance to defend their title from Super Bowl XLIX by defeating them 20-18 in the AFC Championship Game. They joined the Patriots, Dallas Cowboys, and Pittsburgh Steelers as one of four teams that have made eight appearances in the Super Bowl.
|
| 456 |
+
|
| 457 |
+
GT: How many appearances have the Denver Broncos made in the Super Bowl?
|
| 458 |
+
|
| 459 |
+
CLAPS: How many Super Bowl appearances have the Broncos made?
|
| 460 |
+
|
| 461 |
+
Context: In late November 2015, reports surfaced stating that “multiple acts” would perform during the halftime show. On December 3, the league confirmed that the show would be headlined by the British rock group Coldplay. On January 7, 2016, Pepsi confirmed to the Associated Press that Beyonce, who headlined the Super Bowl XLVII halftime show and ´ collaborated with Coldplay on the single “Hymn for the Weekend”, would be making an appearance. Bruno Mars, who headlined the Super Bowl XLVIII halftime show, and Mark Ronson also performed.
|
| 462 |
+
|
| 463 |
+
GT: What nationality is the band Coldplay?
|
| 464 |
+
|
| 465 |
+
CLAPS: What nationality was Coldplay?
|
| 466 |
+
|
| 467 |
+
Context: There are 13 natural reserves in Warsaw - among others, Bielany Forest, Kabaty Woods, Czerniakow Lake. About 15 kilometres (9 miles) from Warsaw, the Vistula river’s environment ´ changes strikingly and features a perfectly preserved ecosystem, with a habitat of animals that includes the otter, beaver and hundreds of bird species. There are also several lakes in Warsaw - mainly the oxbow lakes, like Czerniakow Lake, the lakes in the Łazienki or Wilan ´ ow Parks, ´ Kamionek Lake. There are lot of small lakes in the parks, but only a few are permanent - the majority are emptied before winter to clean them of plants and sediments.
|
| 468 |
+
|
| 469 |
+
GT: What animals does the Vistula river’s ecosystem include?
|
| 470 |
+
|
| 471 |
+
CLAPS: What animals are included in the Vistula river’s habitat?
|
| 472 |
+
|
| 473 |
+
Context: ”The FSO Car Factory was established in 1951. A number of vehicles have been assembled there over the decades, including the Warszawa, Syrena, Fiat 125p (under license from Fiat, later renamed FSO $1 2 5 \mathrm { p }$ when the license expired) and the Polonez. The last two models listed were also sent abroad and assembled in a number of other countries, including Egypt and Colombia. In 1995 the factory was purchased by the South Korean car manufacturer Daewoo, which assembled the Tico, Espero,Nubia, Tacuma, Leganza, Lanos and Matiz there for the European market. In 2005 the factory was sold to AvtoZAZ, a Ukrainian car manufacturer which assembled there the Chevrolet Aveo. The license for the production of the Aveo expired in February 2011 and has since not been renewed. Currently the company is defunct.”
|
| 474 |
+
|
| 475 |
+
GT: Who bought the factory in 2005?
|
| 476 |
+
|
| 477 |
+
CLAPS: To whom was the factory sold in 2005?
|
| 478 |
+
|
| 479 |
+
<table><tr><td>Context: The Scotland Act 1998,which was passed by the Parliament of the United Kingdom and given royal assent by Queen Elizabeth II on 19 November 1998, governs the functions and role of the Scottish Parliament and delimits its legislative competence. The Scotland Act 2O12 extends the devolved competencies. For the purposes of parliamentary sovereignty, the Parliament of the United Kingdom at Westminster continues to constitute the supreme legislature of Scotland. However, under the terms of the Scotland Act, Westminster agreed to devolve some of its responsibilities over Scottish domestic policy to the Scottish Parliament. Such devolved mattersinclude education, health,agriculture and justice.</td></tr></table>
|
| 480 |
+
|
| 481 |
+
GT: What does the Scotland Act of 2012 extend?
|
| 482 |
+
|
| 483 |
+
CLAPS: What does the Scotland Act 2012 extend?
|
| 484 |
+
|
| 485 |
+
Context: Stage 1 is the first, or introductory stage of the bill,
|
| 486 |
+
where the minister or member in charge of the bill will formally introduce it to Parliament together with its accompanying documents-Explanatory Notes, a Policy Memorandum
|
| 487 |
+
setting out the policy underlying the bill,
|
| 488 |
+
and a Financial Memorandum setting out the costs and savings associated with it.
|
| 489 |
+
Statements from the Presiding Officer and
|
| 490 |
+
the member in charge of the bill are also lodged indicating whether the bill is
|
| 491 |
+
within the legislative competence of the Parliament.
|
| 492 |
+
Stage 1 usually takes place, initially, in the relevant committee or committees
|
| 493 |
+
and is then submitted to the whole Parliament
|
| 494 |
+
for a full debate in the chamber on the general principles of the bill.
|
| 495 |
+
If the whole Parliament agrees in a vote to the general principles of the bill, it then proceeds to Stage 2.
|
| 496 |
+
|
| 497 |
+
GT: Where are bills typically gestated in Stage 1?
|
| 498 |
+
|
| 499 |
+
CLAPS: Where does Stage 1 usually take place?
|
| 500 |
+
|
| 501 |
+
Context: Moderate and reformist Islamists who accept and
|
| 502 |
+
work within the democratic process include parties like the Tunisian Ennahda Movement. Jamaat-e-Islami of Pakistan is basically a socio-political
|
| 503 |
+
and democratic Vanguard party but has also gained political influence
|
| 504 |
+
through military coup d’etat in past. ´
|
| 505 |
+
The Islamist groups like Hezbollah in Lebanon and Hamas in Palestine participate in democratic and political process as well as armed attacks,
|
| 506 |
+
seeking to abolish the state of Israel.
|
| 507 |
+
Radical Islamist organizations like al-Qaeda and the Egyptian Islamic Jihad,
|
| 508 |
+
and groups such as the Taliban, entirely reject democracy,
|
| 509 |
+
often declaring as kuffar those Muslims who support it (see takfirism),
|
| 510 |
+
as well as calling for violent/offensive jihad
|
| 511 |
+
or urging and conducting attacks on a religious basis.
|
| 512 |
+
|
| 513 |
+
GT: Where does Hamas originate?
|
| 514 |
+
|
| 515 |
+
CLAPS: Where are Hamas located?
|
| 516 |
+
|
| 517 |
+
Context: Sayyid Abul Ala Maududi was an important early twentieth-century figure
|
| 518 |
+
in the Islamic revival in India, and then after independence from Britain, in Pakistan.
|
| 519 |
+
Trained as a lawyer he chose the profession of journalism,
|
| 520 |
+
and wrote about contemporary issues and most importantly about Islam and Islamic law.
|
| 521 |
+
Maududi founded the Jamaat-e-Islami party in 1941 and remained its leader until 1972.
|
| 522 |
+
However, Maududi had much more impact through his writing
|
| 523 |
+
than through his political organising. His extremely influential books (translated into many languages) placed Islam in a modern context, and influenced not only conservative ulema
|
| 524 |
+
but liberal modernizer Islamists such as al-Faruqi,
|
| 525 |
+
whose ¨Islamization of Knowledgecarried forward some of Maududi’s key principles. ¨
|
| 526 |
+
|
| 527 |
+
GT: Where did Maududi exert the most impact?
|
| 528 |
+
|
| 529 |
+
CLAPS: How did Maududi have more impact on Islam than his political organising?
|
| 530 |
+
|
| 531 |
+
<table><tr><td>Context: ByLike many other mainline Protestant denominations in the United States, the United Methodist Church has experienced significant membership losses in recent decades. At the time of its formation,the UMC had about 11 million members in nearly 42.000 congregations. In 1975,membership dropped below 1O million for the first time. In 2005,there were about 8 million members in over 34,OoO congregations. Membership is concentrated primarily in the Midwest and in the South. Texas has the largest number of members,with about 1 million.</td></tr></table>
|
| 532 |
+
|
| 533 |
+
Context: Celoron’s expedition force consisted of about 200 Troupes de la marine and 30 Indians. The expedition covered about 3,000 miles $( 4 , 8 0 0 \mathrm { k m } )$ between June and November 1749.
|
| 534 |
+
It went up the St. Lawrence, continued along the northern shore of Lake Ontario,
|
| 535 |
+
crossed the portage at Niagara, and followed the southern shore of Lake Erie.
|
| 536 |
+
At the Chautauqua Portage (near present-day Barcelona, New York),
|
| 537 |
+
the expedition moved inland to the Allegheny River, which it followed to the site of present-day Pittsburgh. There Celoron buried lead plates engraved with the French claim to the Ohio Country. ´
|
| 538 |
+
Whenever he encountered British merchants or fur-traders,
|
| 539 |
+
Celoron informed them of the French claims on the territory and told them to leave.
|
| 540 |
+
|
| 541 |
+
GT: How did Celeron handle business on trip?
|
| 542 |
+
|
| 543 |
+
CLAPS: What did Celoron do when he encountered the British?
|
| 544 |
+
|
| 545 |
+
Context: Like many cities in Central and Eastern Europe, infrastructure in Warsaw suffered considerably during its time as an Eastern Bloc economy - though it is worth mentioning that the initial Three-Year Plan to rebuild Poland (especially Warsaw) was a major success, but what followed was very much the opposite. However, over the past decade Warsaw has seen many improvements due to solid economic growth, an increase in foreign investment as well as funding from the European Union. In particular, the city’s metro, roads, sidewalks, health care facilities and sanitation facilities have improved markedly. answer:improved markedly
|
| 546 |
+
|
| 547 |
+
GT: Warsaw’s sidewalks and sanitation facilities are some examples of things which have what?
|
| 548 |
+
|
| 549 |
+
CLAPS: What has happened to Warsaw’s infrastructure in the past decade?
|
| 550 |
+
|
| 551 |
+
Context: Several commemorative events take place every year.
|
| 552 |
+
Gatherings of thousands of people on the banks of the Vistula
|
| 553 |
+
on Midsummer’s Night for a festival called Wianki (Polish for Wreaths) have become a tradition and a yearly event in the programme of cultural events in Warsaw. The festival traces its roots to a peaceful pagan ritual
|
| 554 |
+
where maidens would float their wreaths of herbs on the water to predict when they would be married, and to whom.
|
| 555 |
+
By the 19th century this tradition had become a festive event,
|
| 556 |
+
and it continues today. The city council organize concerts and other events. Each Midsummer’s Eve, apart from the official floating of wreaths,
|
| 557 |
+
jumping over fires, looking for the fern flower,
|
| 558 |
+
there are musical performances, dignitaries’ speeches, fairs
|
| 559 |
+
and fireworks by the river bank.
|
| 560 |
+
|
| 561 |
+
GT: How man people gather along the banks of the Vistula for the Wianki festival?
|
| 562 |
+
|
| 563 |
+
CLAPS: How many people gather on the banks of the Vistula on Midsummer’s Night for a festival called Wianki?
|
| 564 |
+
|
| 565 |
+
Context: The origin of the legendary figure is not fully known. The best-known legend, by Artur Oppman, is that long ago two of Triton’s daughters set out on a journey through the depths of the oceans and seas. One of them decided to stay on the coast of Denmark and can be seen sitting at the entrance to the port of Copenhagen. The second mermaid reached the mouth of the Vistula River and plunged into its waters. She stopped to rest on a sandy beach by the village of Warszowa, where fishermen came to admire her beauty and listen to her beautiful voice. A greedy merchant also heard her songs; he followed the fishermen and captured the mermaid.
|
| 566 |
+
|
| 567 |
+
GT: What did a greedy merchant do to the mermaid?
|
| 568 |
+
|
| 569 |
+
CLAPS: What did Oppman do to the mermaid?
|
| 570 |
+
|
| 571 |
+
Context: Warsaw remained the capital of the Polish-Lithuanian
|
| 572 |
+
Commonwealth until 1796, when it was annexed by the Kingdom of Prussia to become the capital of the province of South Prussia.
|
| 573 |
+
Liberated by Napoleon’s army in 1806, Warsaw was made
|
| 574 |
+
the capital of the newly created Duchy of Warsaw.
|
| 575 |
+
Following the Congress of Vienna of 1815, Warsaw became the centre of the Congress Poland, a constitutional monarchy under a personal union
|
| 576 |
+
with Imperial Russia. The Royal University of Warsaw was established in 1816.
|
| 577 |
+
|
| 578 |
+
GT: How long was Warsaw the capital of the Polish-Lithuanian Commonwealth?
|
| 579 |
+
|
| 580 |
+
CLAPS: How long did Warsaw remain the capital of the Polish-Lithuanian Commonwealth?
|
| 581 |
+
|
| 582 |
+
Context: John Paul II’s visits to his native country in 1979 and 1983 brought support to the budding solidarity movement and encouraged the growing anti-communist fervor there. In 1979, less than a year after becoming pope, John Paul celebrated Mass in Victory Square in Warsaw and ended his sermon with a call to ”renew the face” of Poland: Let Thy Spirit descend! Let Thy Spirit descend and renew the face of the land! This land! These words were very meaningful for the Polish citizens who understood them as the incentive for the democratic changes. GT: What is St. John’s Cathedral an example of, stylistically?
|
| 583 |
+
|
| 584 |
+
CLAPS: St. John’s Cathedral is a typical example of what style?
|
| 585 |
+
|
| 586 |
+
Context: Gothic architecture is represented in the majestic churches
|
| 587 |
+
but also at the burgher houses and fortifications.
|
| 588 |
+
The most significant buildings are St. John’s Cathedral (14th century),
|
| 589 |
+
the temple is a typical example of the so-called Masovian gothic style,
|
| 590 |
+
St. Mary’s Church (1411), a town house of Burbach family (14th century),
|
| 591 |
+
Gunpowder Tower (after 1379) and the Royal Castle Curia Maior (140720131410). ˘ The most notable examples of Renaissance architecture in the city
|
| 592 |
+
are the house of Baryczko merchant family (1562), building called ”The Negro” (early 17th century) and Salwator tenement (1632). The most interesting examples of mannerist architecture are the Royal Castle (159620131619) and ˘
|
| 593 |
+
the Jesuit Church (160920131626) at Old Town. ˘
|
| 594 |
+
Among the first structures of the early baroque the most important
|
| 595 |
+
are St. Hyacinth’s Church (1603-1639) and Sigismund’s Column (1644).
|
| 596 |
+
|
| 597 |
+
GT: What is St. John’s Cathedral an example of, stylistically?
|
| 598 |
+
|
| 599 |
+
CLAPS: St. John’s Cathedral is a typical example of what style?
|
| 600 |
+
|
| 601 |
+
Table 7: Translation of Romanian by CLAPS from WMT’16 RO-EN.
|
| 602 |
+
|
| 603 |
+
<table><tr><td>RO: De partea cealalta, 47% dintre alegatoriirepublicani afirma ca ar fi,nemultumiti” sau ,suparati” daca favoritul Jeb Bush castigä cursa pentru nominalizare.</td></tr><tr><td>GT: On the flip side,47 percent of Republican Voters say they would be "dissatisfied" or "upset"if establishment favorite Jeb Bush becomes the nominee.</td></tr><tr><td>CLAPS: On the other hand,47% of Republican voters say they would be "unsatisfied"or "uneasy" if the winer</td></tr><tr><td>Jeb Bush wins the nomination race. RO:Datoria va deveni o problema importanta.</td></tr><tr><td>GT: Debt will become a big issue.</td></tr><tr><td>CLAPS: Debt will become an important issue.</td></tr><tr><td>RO: Se pare ca Moreno a avut noroc si a scapat de cartonasul rosu si de concesia unei lovituri de pedeapsa.</td></tr><tr><td>GT: Moreno appeared fortunate to escape a red card and the concession of a spot-kick.</td></tr><tr><td> CLAPS: It seems that Moreno has been lucky and escaped the red card and the concession of a penalty kick.</td></tr><tr><td>RO: Astfel de decizii nu se iau niciodata usor.</td></tr><tr><td>GT: Such decisions are never taken lightly.</td></tr><tr><td>CLAPS: Such decisions are never made easily.</td></tr><tr><td>RO: Toate astea au cu certitudine un cost.</td></tr><tr><td>GT: All that stuff sure does take a toll.</td></tr><tr><td>CLAPS: All of this certainly has a cost.</td></tr><tr><td>RO:Astfel de decizii nu se iau niciodata usor.</td></tr><tr><td>GT: Such decisions are never taken lightly.</td></tr><tr><td>CLAPS: Such decisions are never made easily. RO:Deci, nu am mai gasit niciun sens de a continua pe acest drum.</td></tr><tr><td>GT: So,I had no reason to continue on this path.</td></tr><tr><td>CLAPS: So there is no point in continuing on this road.</td></tr><tr><td>RO: Profitul a crescut cu 5%, pana la 12,3 miliarde dolari.</td></tr><tr><td>GT: Revenue rose 5 percent, to $12.3 billion.</td></tr><tr><td>CLAPS: Profit has increased by between 5% and $12.3 billion.</td></tr><tr><td>RO:,Este imposibil ca toata lumea sa vina in Europa”- Dalai Lama - RT news</td></tr><tr><td>GT: "It is impossible for everyone to come to Europe" - Dalai Lama - RT News</td></tr><tr><td>CLAPS: "It is impossible for everyone to come to Europe" - the Dalai Lama - RT news</td></tr><tr><td>RO: Spune povestea detinutului asa cum isi doreste acesta,obtine acces.</td></tr><tr><td>GT: Tellthe inmate's story the way he likes it, get access.</td></tr><tr><td>CLAPS: It tells the detainee's story as he wants, it gets acess.</td></tr><tr><td>RO: Peter Moody a afirmat cä stewarzii Racing Victoria sau incercat sa infiltreze un spion la grajdurile sale anul trecut si a amenintat cä se retrage imediat din curse.</td></tr><tr><td>GT: Peter Moody has alleged Racing Victoria stewards attmpted to plant a spy in his stables last year and threatened to quit racing immediately.</td></tr><tr><td>CLAPS: Peter Moody said stewarzia Racing Victoria or tried to infiltrate a spy at her track last year and</td></tr></table>
|
| 604 |
+
|
| 605 |
+
RO: Corbyn, Tsipras și Syriza în Grecia, Podemos în Spania, chiar Bernie Sanders în Statele Unite își alimentează retorica populistă din frustrările acumulate în societățile oocidentale.
|
| 606 |
+
|
| 607 |
+
GT: Corbyn, Tsipras and Syriza in Greece, Podemos in Spain, even Bernie Sanders in the United States feed their populist rhetoric with the frustrations accumulated in the Western world.
|
| 608 |
+
|
| 609 |
+
CLAPS: Corbyn, Tsipras and Syriza in Greece, Podemos in Spain, even Bernie Sanders in the United States are fuelling their populist rhetoric from the frustrations gained in the occident societies.
|
| 610 |
+
|
| 611 |
+
RO: Pentru România, chiar și cota voluntară propusă de București, în cuantum de circa 1500 de suflete, ne depășește cu mult bunele intenții de solidaritate cu Uniunea Europeană exprimate în ultimele luni.
|
| 612 |
+
|
| 613 |
+
GT: For Romania, even the voluntary quota proposed by Bucharest, amounting to about 1,500 souls, surpasses by
|
| 614 |
+
|
| 615 |
+
<table><tr><td>far our good intentions of solidarity with the European Union expressed in recent months.</td></tr><tr><td>CLAPS: For Romania, even Bucharest's proposed voluntary quota,amounting to around 1 50O souls,goes far beyond our good intentions of solidarity with the European Union expressed in recent months.</td></tr><tr><td>RO: 7.0oo de euro pe an pentru a inchiria Clubul Pogor.</td></tr><tr><td>GT: 7,00o Euro per year to rent Pogor Club.</td></tr><tr><td> CLAPS: 7,0o0 euros per year to rent the Pogor Club.</td></tr><tr><td>RO: Crina a fost internata impreuna cubunicaei la spitalul municipal din Pascani,iar tot atunci tatal fetei, Costica Balcan, a plecat la munca in orasul Alexandria, judetul Teleorman.</td></tr><tr><td>GT: Crina and her grandmother were admited to the hospital of the municipalityof Pascani,and on the same day her father, Costica Balcan went to work in the city of Alexandria, Teleorman County.</td></tr><tr><td>CLAPS:The crisis was admited with her grandmother to the municipal hospital in Pascani,and the girl's father, Costica Balcan, also went to work in the town of Alexandria, Teleorman County.</td></tr><tr><td>RO: In tara, parintii Crinei, Alina si Costica,au continuat separat cautarile, fiecare pe unde a putut.</td></tr><tr><td>GT: I was just a little girl when I found out.</td></tr><tr><td>CLAPS:Iwas small when I found out.</td></tr><tr><td>RO: Cu o saptamana inainte de intalnire nici nu prea mai putea sä doarma.</td></tr><tr><td>GT: A week before the meeting he hadn't really been able to sleep.</td></tr><tr><td>CLAPS: A week before the meeting, we could not even sleep much longer.</td></tr><tr><td>RO: "Casa iti vezi copilul dupa atatia ani,esteceva",ne spune onepoata,venita si eacu Costica de la Ruginoasa. GT: "It's something extraordinary to see your baby after so many years",says a niece who came with Costica from</td></tr><tr><td>Ruginoasa. CLAPS: "To see your child after so many years,it is something," says a litle girl, who also comes with Costica</td></tr><tr><td>from Ruginoasa.</td></tr><tr><td>RO: In Piata Uniri, subcerul inceputului de toamna,familia din Ruginoasa isiuneste din nou destinul cu fata lor din Palermo. GT: In Piata Uniri,beneath the autumn sky,the family from Ruginoasa joins theirdestiny with their daughter in</td></tr><tr><td>Palermo. CLAPS: In the Square of the Union,under the skies ofthe early autumn,the family of Ruginoasa is once again</td></tr><tr><td>uniting their destiny with their mother in Palermo.</td></tr><tr><td>RO: "Sper sa am o amintire frumoasa cu ei, pentru ca acum sunt atat de multe lucruri de spus", ne marturiseste Crina. GT: "I hope to gain a beautiful memory after meting them, because now there are so many things to say,"</td></tr><tr><td>confesses Crina. CLAPS: "Ihope to have a nice memory with them,because there is so much to say now," Crina tels us.</td></tr><tr><td>RO: In weekendul care a trecut,Alina si Costica si-au vazut pentru prima data fata pierduta pe holurile spitalului</td></tr><tr><td>din Iasi,in urma cu 20 ani. GT: Last weekend,Alina and Costica saw the girl who was lost on thehals of the hospitalin Iasi for the first time</td></tr><tr><td>in 20 years. CLAPS: Forthe firsttime in the weekend,Alina and Costica saw their girllostin hospital rooms in Jasmine 20</td></tr><tr><td>yearsago. RO: "A durat pana la urma cam oluna de zile pana sa il gasim pe tatal biologic al fetei", ne explica comisarul sef</td></tr><tr><td>Romica Ichim. GT: Then they gave me some pointers,only to find that the person I was directed to wasn't he person I was looking for.</td></tr></table>
|
md/train/Wi5KUNlqWty/Wi5KUNlqWty.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/hhU9TEvB6AF/hhU9TEvB6AF.md
ADDED
|
@@ -0,0 +1,273 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Meta Learning Backpropagation And Improving It
|
| 2 |
+
|
| 3 |
+
Louis Kirsch1, Jürgen Schmidhuber1,2
|
| 4 |
+
1The Swiss AI Lab IDSIA, University of Lugano (USI) & SUPSI, Lugano, Switzerland
|
| 5 |
+
2King Abdullah University of Science and Technology (KAUST), Thuwal, Saudi Arabia {louis, juergen}@idsia.ch
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Many concepts have been proposed for meta learning with neural networks (NNs), e.g., NNs that learn to reprogram fast weights, Hebbian plasticity, learned learning rules, and meta recurrent NNs. Our Variable Shared Meta Learning (VSML) unifies the above and demonstrates that simple weight-sharing and sparsity in an NN is sufficient to express powerful learning algorithms (LAs) in a reusable fashion. A simple implementation of VSML where the weights of a neural network are replaced by tiny LSTMs allows for implementing the backpropagation LA solely by running in forward-mode. It can even meta learn new LAs that differ from online backpropagation and generalize to datasets outside of the meta training distribution without explicit gradient calculation. Introspection reveals that our meta learned LAs learn through fast association in a way that is qualitatively different from gradient descent.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
The shift from standard machine learning to meta learning involves learning the learning algorithm (LA) itself, reducing the burden on the human designer to craft useful learning algorithms [43]. Recent meta learning has primarily focused on generalization from training tasks to similar test tasks, e.g., few-shot learning [11], or from training environments to similar test environments [17]. This contrasts human-engineered LAs that generalize across a wide range of datasets or environments. Without such generalization, meta learned LAs can not entirely replace human-engineered variants. Recent work demonstrated that meta learning can also successfully generate more general LAs that generalize across wide spectra of environments [20, 1, 31], e.g., from toy environments to Mujoco and Atari. Unfortunately, however, many recent approaches still rely on a large number of human-designed and unmodifiable inner-loop components such as backpropagation.
|
| 14 |
+
|
| 15 |
+
Is it possible to implement modifiable versions of backpropagation or related algorithms as part of the end-to-end differentiable activation dynamics of a neural net (NN), instead of inserting them as separate fixed routines? Here we propose the Variable Shared Meta Learning (VSML) principle for this purpose. It introduces a novel way of using sparsity and weight-sharing in NNs for meta learning. We build on the arguably simplest neural meta learner, the meta recurrent neural network (Meta RNN) [16, 10, 56], by replacing the weights of a neural network with tiny LSTMs. The resulting system can be viewed as many RNNs passing messages to each other, or as one big RNN with a sparse shared weight matrix, or as a system learning each neuron’s functionality and its LA. VSML generalizes the principle behind end-to-end differentiable fast weight programmers [45, 46, 3, 41], hyper networks [14], learned learning rules [4, 13, 33], and hebbian-like synaptic plasticity [44, 46, 25, 26, 30]. Our mechanism, VSML, can implement backpropagation solely in the forward-dynamics of an RNN. Consequently, it enables meta-optimization of backproplike algorithms. We envision a future where novel methods of credit assignment can be meta learned while still generalizing across vastly different tasks. This may lead to improvements in sample efficiency, memory efficiency, continual learning, and others. As a first step, our system meta learns online LAs from scratch that frequently learn faster than gradient descent and generalize to datasets outside of the meta training distribution (e.g., from MNIST to Fashion MNIST). Our VSML RNN is the first neural meta learner without hard-coded backpropagation that shows such strong generalization.
|
| 16 |
+
|
| 17 |
+
# 2 Background
|
| 18 |
+
|
| 19 |
+
Deep learning-based meta learning that does not rely on fixed gradient descent in the inner loop has historically fallen into two categories, 1) Learnable weight update mechanisms that allow for changing the parameters of an NN to implement a learning rule (FWPs / LLRs), and 2) Learning algorithms implemented in black-box models such as recurrent neural networks (Meta RNNs).
|
| 20 |
+
|
| 21 |
+
Fast weight programmers & Learned learning rules (FWPs / LLRs) In a standard NN, the weights are updated by a fixed LA. This framework can be extended to meta learning by defining an explicit architecture that allows for modifying these weights. This weight-update architecture augments a standard NN architecture. NNs that generate or change the weights of another or the same NN are known as fast weight programmers (FWPs) [44, 45, 46, 3, 41], hypernetworks [14], NNs with synaptic plasticity [25, 26, 30] or learned learning rules [4, 13, 33]. Often these architectures make use of local Hebbian-like update rules or outer-products, and we summarize this category as FWPs / LLRs. In FWPs / LLRs the variables $V _ { L }$ that are subject to learning are the weights of the network, whereas the meta-variables $V _ { M }$ that implement the LA are defined by the weight-update architecture. Note that the dimensionality of $V _ { L }$ and $V _ { M }$ can be defined independently of each other and often $V _ { M }$ are reused in a coordinate-wise fashion for $V _ { L }$ resulting in $| V _ { L } | \gg | V _ { M } |$ , where $| \cdot |$ is the number of elements.
|
| 22 |
+
|
| 23 |
+
Black-box learning in activations (Meta RNNs) It was shown that an RNN such as LSTM can learn to implement an LA [16] when the reward or error is given as an input [47]. After meta training, the LA is encoded in the weights of this RNN and determines learning during meta testing. The activations serve as the memory used for the LA solution. We refer to this as Meta RNNs [16, 10, 56] (Also sometimes referred to as memory-based meta learning.). They are conceptually simpler than FWPs / LLRs as no additional weight-update rules with many degrees of freedom need to be defined. In Meta RNNs $V _ { L }$ are the RNN activations and $V _ { M }$ are the parameters for the RNN. Note that an RNN with $N$ neurons will yield $| V _ { L } | = O ( N )$ and $| V _ { M } | = \stackrel { \cdot } { O } ( N ^ { 2 } )$ [46]. This means that the LA is largely overparameterized whereas the available memory for learning is very small, making this approach prone to overfitting [20]. As a result, the RNN parameters often encode task-specific solutions instead of generic LAs. Meta learning a simple and generalizing LA would benefit from $| V _ { L } | \gg | V _ { M } |$ . Previous approaches have tried to mend this issue by adding architectural complexity through additional memory mechanisms [53, 29, 40, 27, 42].
|
| 24 |
+
|
| 25 |
+
# 3 Variable Shared Meta Learning (VSML)
|
| 26 |
+
|
| 27 |
+
In VSML we build on the simplicity of Meta RNNs while retaining $| V _ { L } | \gg | V _ { M } |$ from FWPs / LLRs. We do this by reusing the same few parameters $V _ { M }$ many times in an RNN (via variable sharing) and introducing sparsity in the connectivity. This yields several interpretations for VSML:
|
| 28 |
+
|
| 29 |
+
$\textcircled{8}$ VSML as a single Meta RNN with a sparse shared weight matrix (Figure 1a). The most general description.
|
| 30 |
+
$\textcircled{8}$ VSML as message passing between RNNs (Figure 1b). We choose a simple sharing and sparsity scheme for the weight matrix such that it corresponds to multiple RNNs with shared parameters that exchange information.
|
| 31 |
+
$©$ VSML as complex neurons with learned updates (Figure 1c). When choosing a specific connectivity between RNNs, states / activations $V _ { L }$ of these RNNs can be interpreted as the weights of a conventional NN, consequently blurring the distinction between a weight and an activation.
|
| 32 |
+
|
| 33 |
+
Introducing variable sharing to Meta RNNs We begin by formalizing Meta RNNs which often use multiplicative gates such as the LSTM [12, 15] or its variant GRU [6]. For notational simplicity, we consider a vanilla RNN. Let $s \in \mathbb { R } ^ { N }$ be the hidden state of an RNN. The update for an element $j \in \{ 1 , \ldots , N \}$ is given by
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
Figure 1: Different perspectives on VSML: (a) A single Meta RNN [16] where entries in the weight matrix are shared or zero. (a) VSML consists of many sub-RNNs with shared parameters $V _ { M }$ passing messages between each other. (c) VSML implements an NN with complex neurons (here 2 neurons). $V _ { M }$ determines the nature of weights, how these are used in the neural computation, and the LA by which those are updated. Each weight $w _ { a b } \in \mathbb { R }$ is represented by the multi-dimensional RNN state ${ s _ { a b } } \in \mathbb { R } ^ { N }$ . Neuron activations correspond to messages $\overrightarrow { m }$ passed between sub-RNNs.
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
s _ { j } \gets f _ { \mathrm { R N N } } ( s ) _ { j } = \sigma ( \sum _ { i } s _ { i } W _ { i j } ) ,
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
where $\sigma$ is a non-linear activation function, $W \in \mathbb { R } ^ { N \times N }$ , and the bias is omitted for simplicity. We also omit inputs by assuming a subset of $s$ to be externally provided. Each application of Equation 1 reflects a single time tick in the RNN.
|
| 43 |
+
|
| 44 |
+
We now introduce variable sharing (reusing $W$ ) into the RNN by duplicating the computation along two axes of size $A , B$ (here $A = B$ , which will later be relaxed) giving $\bar { s } \in \mathbb { R } ^ { A \times B \times N }$ . For $a \in \{ 1 , \dotsc , A \} , b \in \{ 1 , \dotsc , B \}$ we have
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
s _ { a b j } \gets f _ { \mathrm { R N N } } ( s _ { a b } ) _ { j } = \sigma ( \sum _ { i } s _ { a b i } W _ { i j } ) .
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
This can be viewed as multiple RNNs arranged on a 2-dimensional grid, with shared parameters that update independent states. Here, we chose a particular arrangement (two axes) that will facilitate the interpretation $©$ of RNNs as weights.
|
| 51 |
+
|
| 52 |
+
VSML as message passing between RNNs The computation so far describes $A \cdot B$ independent RNNs. We connect those by passing messages (interpretation $\textcircled{8}$ )
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
s _ { a b } \gets f _ { \mathrm { R N N } } ( s _ { a b } , \overrightarrow { m } _ { a } ) ,
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
where the message $\begin{array} { r } { \vec { m } _ { b } = \sum _ { a ^ { \prime } } f _ { \vec { m } } ( s _ { a ^ { \prime } b } ) } \end{array}$ with $b \in \{ 1 , \dots , A = B \}$ , $f _ { \overrightarrow { m } } : \mathbb { R } ^ { N } \mathbb { R } ^ { N ^ { \prime } }$ is fed as an additional input to each RNN. This is related to Graph Neural Networks [51, 58]. Summing over the axis $A$ (elements $a ^ { \prime }$ ) corresponds to an RNN connectivity mimicking those of weights in an NN (to facilitate interpretation $©$ . We emphasise that other schemes based on different kinds of message passing and graph connectivity are possible. For a simple $f _ { \overrightarrow { m } }$ defined by the matrix $C \in \mathbb { R } ^ { N \times N }$ , we may equivalently write
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
s _ { a b j } \gets \sigma ( \sum _ { i } s _ { a b i } W _ { i j } + \sum _ { a ^ { \prime } } f _ { \overrightarrow { m } } ( s _ { a ^ { \prime } a } ) ) = \sigma ( \sum _ { i } s _ { a b i } W _ { i j } + \sum _ { a ^ { \prime } , i } s _ { a ^ { \prime } a i } C _ { i j } ) .
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
This constitutes the minimal version of VSML with $V _ { M } : = ( W , C )$ and is visualized in Figure 1b.
|
| 65 |
+
|
| 66 |
+
VSML as a Meta RNN with a sparse shared weight matrix It is trivial to see that with $A = 1$ and $B = 1$ we obtain a single RNN and Equation 4 recovers the original Meta RNN Equation 1. In the general case, we can derive an equivalent formulation that corresponds to a single standard RNN with a single matrix $\tilde { W }$ that has entries of zero and shared entries
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
s _ { a b j } \gets \sigma ( \sum _ { c , d , i } s _ { c d i } \tilde { W } _ { c d i a b j } ) ,
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
where the six axes can be flattened to obtain the two axes. For Equation 4 and Equation 5 to be equivalent, $\tilde { W }$ must satisfy (derivation in Appendix A)
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\tilde { W } _ { c d i a b j } = \left\{ \begin{array} { l l } { C _ { i j } , } & { \mathrm { i f ~ } d = a \wedge ( d \neq b \vee c \neq a ) . } \\ { W _ { i j } , } & { \mathrm { i f ~ } d \neq a \wedge d = b \wedge c = a . } \\ { C _ { i j } + W _ { i j } , } & { \mathrm { i f ~ } d = a \wedge d = b \wedge c = a . } \\ { 0 , } & { \mathrm { o t h e r w i s e . } } \end{array} \right.
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
This corresponds to interpretation $\textcircled{8}$ with the weight matrix visualized in Figure 1a. To distinguish between the single sparse shared RNN and the connected RNNs, we now call the latter sub-RNNs.
|
| 79 |
+
|
| 80 |
+
VSML as complex neurons with learned updates The arrangement and connectivity of the subRNNs as described in the previous paragraphs corresponds to that of weights in a standard NN. Thus, in interpretation $@$ , VSML can be viewed as defining complex neurons where each sub-RNN corresponds to a weight in a standard NN as visualized in Figure 1c. All these sub-RNNs share the same parameters but have distinct states. The current formulation corresponds to a single NN layer that is run recurrently. We will generalize this to other architectures in the next section. A corresponds to the dimensionality of the inputs and $B$ to that of the outputs in that layer.
|
| 81 |
+
|
| 82 |
+
The role of weights in a standard neural network is now assigned to the states of RNNs. This allows these RNNs to define both the neural forward computation as well as the learning algorithm that determines how the network is updated (where the mechanism is shared across the network). In the case of backpropagation, this would correspond to the forward and backward passes being implemented purely in the recurrent dynamics. We will demonstrate the practical feasibility of this in Section 3.2. The emergence of
|
| 83 |
+
|
| 84 |
+

|
| 85 |
+
Figure 2: The neural interpretation of VSML replaces all weights of a standard NN with tiny LSTMs using shared parameters (resembling complex neurons). This allows these LSTMs to define both the neural forward computation as well as the learning algorithm that determines how the network is updated. Information flows forward and backward in the network through multi-dimensional messages $\overrightarrow { m }$ and $\scriptstyle { \overleftarrow { m } }$ , generalizing the dynamics of an NN trained using backpropagation.
|
| 86 |
+
|
| 87 |
+
RNN states as weights quickly leads to confusing terminology when RNNs have ‘meta weights’.
|
| 88 |
+
Instead, we simply refer to meta variables $V _ { M }$ and learned variables $V _ { L }$ .
|
| 89 |
+
|
| 90 |
+
With this interpretation, VSML can be seen as a generalization of learned learning rules [4, 13, 33] and Hebbian-like differentiable mechanisms or fast weights more generally [44, 46, 25, 26] where RNNs replace explicit weight updates. In standard NNs, weights and activations have multiplicative interactions. For VSML RNNs to mimic such computation we require multiplicative interactions between parts of the state $s$ . Fortunately, LSTMs already incorporate this through gating and can be directly used in place of RNNs.
|
| 91 |
+
|
| 92 |
+
Stacking VSML RNNs and feeding inputs To get a structure similar to one of the non-recurrent deep feed-forward architectures (FNNs), we stack multiple VSML RNNs where their states are untied and their parameters are tied.1 This is visualized with two layers in Figure 2 where the states $s ^ { ( 2 ) }$ of the second column of sub-RNNs are distinct from the first column $\mathbf { \boldsymbol { s } } ^ { ( 1 ) }$ . The parameters $A ^ { ( k ) }$ and $B ^ { ( k ) }$ describing layer sizes can then be varied for each layer $k \in \{ 1 , \ldots , K \}$ constrained by $A ^ { ( k ) } ~ = ~ B ^ { ( k - 1 ) }$ . The updated Equation 3 with distinct layers $k$ is given by $s _ { a b } ^ { ( k ) } f _ { \mathrm { R N N } } ( s _ { a b } ^ { ( k ) } , \overrightarrow { m } _ { a } ^ { ( k ) } )$ where $\begin{array} { r } { \vec { m } _ { b } ^ { ( k + 1 ) } : = \sum _ { a ^ { \prime } } \bar { f } _ { \vec { m } } ( s _ { a ^ { \prime } b } ^ { ( k ) } ) } \end{array}$ with $b \in \{ 1 , \ldots , B ^ { ( k ) } = A ^ { ( k + 1 ) } \}$
|
| 93 |
+
|
| 94 |
+
To prevent information from flowing only forward in the network, we use an additional backward message
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
s _ { a b } ^ { ( k ) } \gets f _ { R N N } \big ( s _ { a b } ^ { ( k ) } , \overrightarrow { m } _ { a } ^ { ( k ) } , \overleftarrow { m } _ { b } ^ { ( k ) } \big ) ,
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
where $\begin{array} { r } { \overleftarrow { m } _ { a } ^ { ( k - 1 ) } : = \sum _ { b ^ { \prime } } f _ { \overleftarrow { m } } ( s _ { a b ^ { \prime } } ^ { ( k ) } ) } \end{array}$ with $a \in$ $\{ 1 , . . . , A ^ { ( k ) } = B ^ { ( k - 1 ) } \}$ (visualized in Figure 3). The backward transformation is given by f←−m : RN → RN 00 .
|
| 101 |
+
|
| 102 |
+
Similarly, other neural architectures can be explicitly constructed (e.g. convolutional NNs, Section B.2). Some architectures may be learned implicitly if positional information is fed into each sub-RNN (Appendix C). We then update all states $s ^ { ( k ) }$ in sequence $1 , \ldots , K$ to mimic sequential layer execution. We may also apply multiple RNN ticks for each layer $k$ .
|
| 103 |
+
|
| 104 |
+

|
| 105 |
+
Figure 3: VSML with forward messages $\overrightarrow { m }$ and backward messages $\scriptstyle { \overleftarrow { m } }$ to form a two-layer NN with shared LSTM parameters but distinct states.
|
| 106 |
+
|
| 107 |
+
To provide the VSML RNN with data, each time we execute the operations of the first layer, a single new datum $x \in \mathbb { R } ^ { A ( 1 ) }$ (e.g. one flattened image) is distributed across all sub-RNNs. In our present experiments, we match the axis $A ( 1 )$ to the input datum dimensionality such that each dimension (e.g., pixel) is fed to different RNNs. This corresponds to initializing the forward message $\vec { m } _ { a 1 } ^ { ( 1 ) } : = \boldsymbol { x } _ { a }$ dding . Fina $\overrightarrow { m }$ with zeros if nece we feed the error larly, we read the outpuat the output such that $\boldsymbol { \hat { y } } \in \mathbb { R } ^ { B ( K ) }$ from. See $\hat { y } _ { a } : = \overrightarrow { m } _ { a 1 } ^ { ( K + 1 ) }$ $e \in \mathbb { R } ^ { B ( K ) }$ $ _ { b 1 } : = e _ { b }$ Figure 2 for a visualization. Alternatively, multiple input or output dimensions could be patched together and fed into fewer sub-RNNs.
|
| 108 |
+
|
| 109 |
+
# 3.1 Meta learning general-purpose learning algorithms from scratch
|
| 110 |
+
|
| 111 |
+
Having formalized VSML, we can now use end-to-end meta learning to create LAs from scratch in Algorithm 1. We simply optimize the LSTM parameters $V _ { M }$ to minimize the sum of prediction losses over many time steps starting with random states $V _ { L } : = \{ s _ { a b } ^ { ( k ) } \}$ . We focus on meta learning online LAs where one example is fed at a time as done in Meta RNNs [16, 56, 10]. Meta training may be performed using end-to-end gradient descent or gradient-free optimization such as evolutionary strategies [57, 38]. The latter is significantly more efficient on VSML compared to standard NNs due to the small parameter space $V _ { M }$ . Crucially, during meta testing, no explicit gradient descent is used.
|
| 112 |
+
|
| 113 |
+
# Algorithm 1 VSML: Meta Training
|
| 114 |
+
|
| 115 |
+
Require: Dataset(s) $D = \{ ( x _ { i } , y _ { i } ) \}$ $V _ { M } \gets$ initialize LSTM parameters while meta loss has not converged do . Outer loop in parallel over datasets $D$ ${ \cal V } _ { L } = \{ s _ { a b } ^ { ( k ) } \} $ initialize LSTM states $\forall a , b , k$ for $( x , y ) ^ { \top } \in \{ ( x _ { 1 } , y _ { 1 } ) , \dotsc , ( x _ { T } , y _ { T } ) \} \subset D$ do $\triangleright$ Inner loop over $T$ examples $ { \vec { m } } _ { a 1 } ^ { ( 1 ) } : = x _ { a }$ ∀a $\triangleright$ Initialize from input image $\mathbf { X }$ for $\bar { k } \in \{ 1 , \ldots , K \}$ do $\triangleright$ Iterating over $K$ layers $s _ { a b } ^ { ( k ) } \gets f _ { R N N } \big ( s _ { a b } ^ { ( k ) } , \overrightarrow { m } _ { a } ^ { ( k ) } , \overleftarrow { m } _ { b } ^ { ( k ) } \big ) \quad \forall a , b$ . Equation 7 ←−m m (k+1)b := Pa0 f−→m (s(k)a0b) (k−1)a := Pb0 f←−m (s(k)ab0 ) ∀a ∀b . Create backward message . Create forward message yˆa := −→m(K+1)a1 ∀a $\triangleright$ Read output e := ∇yˆL(ˆy, y) . Compute error at outputs using loss $L$ ←−m(K)b1 := eb ∀b $\triangleright$ Input errors $\begin{array} { r } { V _ { M } \gets V _ { M } - \alpha \nabla _ { V _ { M } } \sum _ { t = 1 } ^ { T } L ( \hat { y } ( t ) , y ( t ) ) } \end{array}$ , obtaining $\nabla _ { V _ { M } }$ either by • back-propagation through the inner loop • evolution strategies, using a search distribution $p ( V _ { M } )$
|
| 116 |
+
|
| 117 |
+
# 3.2 Learning to implement backpropagation in RNNs
|
| 118 |
+
|
| 119 |
+

|
| 120 |
+
Figure 4: To implement backpropagation we optimize the VSML RNN to use and update weights $w$ and biases $b$ as part of the state $s _ { a b }$ in each subRNN. Inputs are pre-synaptic $x$ and error $e$ . Outputs are post-synaptic $\hat { y }$ and error $\cdot$ .
|
| 121 |
+
|
| 122 |
+
An alternative to end-to-end meta learning is to first investigate whether the VSML RNN can implement backpropagation. Due to the algorithm’s ubiquitous use, it seems desirable to be able to meta learn backpropagation-like algorithms. Here we investigate how VSML RNNs can learn to implement backpropagation purely in their recurrent dynamics. We do this by optimizing $V _ { M }$ to (1) store a weight $w$ and bias $b$ as a subset of each state $s _ { a b }$ , (2) compute $y = \operatorname { t a n h } ( x ) w + b$ to implement neural forward computation, and (3) update $w$ and $b$ according to the backpropagation algorithm [23]. We call this process learning algorithm cloning and it is visualized in Figure 4.
|
| 123 |
+
|
| 124 |
+
We designate an element of each message $\vec { m } _ { a } ^ { ( k ) }$ , $\{ \overline { { m } } _ { b } ^ { ( k ) }$ , $f _ { \vec { m } } ( s _ { a b } ^ { ( k ) } )$ $f _ { \overleftarrow { m } } ( s _ { a b } ^ { ( k ) } )$ as the input $x$ , error $e$ , and output $\hat { y }$ and error $\hat { e } ^ { \prime }$ . Similarly, we set $w : = s _ { a b 1 }$ and $b : = s _ { a b 2 }$ . We then optimize $V _ { M }$ via gradient descent to regress $\hat { y }$ , $\Delta w$ , $\Delta b$ , and $\hat { e } ^ { \prime }$ toward their respective targets. We can either generate the training dataset $D : = \{ ( x , \bar { w } , b , y , e , \bar { e ^ { \prime } } ) _ { i } \}$ randomly or run a ‘shadow’ NN on some supervised problem and fit the VSML RNN to its activations and parameter updates. Multiple iterations in the VSML RNN would then correspond to evaluating the network and updating it via backpropagation. The activations from the forward pass necessary for credit assignment could be memorized as part of the state $s$ or be explicitly stored and fed back. For simplicity, we chose the latter to clone backpropagation. We continuously run the VSML RNN forward, alternately running the layers in order $1 , \ldots , K$ and in reverse order $K , \ldots , 1$ .2
|
| 125 |
+
|
| 126 |
+
# 4 Experiments
|
| 127 |
+
|
| 128 |
+
First, we demonstrate the capabilities of the VSML RNN by showing that it can implement neural forward computation and backpropagation in its recurrent dynamics on the MNIST [21] and Fashion MNIST [59] dataset. Then, we show how we can meta learn an LA from scratch on one set of datasets and then successfully apply it to another (out of distribution). Such generalization is enabled by extensive variable sharing where we have very few meta variables $| V _ { M } | ~ \approx ~ 2 , 4 0 0$ and many learned variables $| V _ { L } | \approx 2 5 7 , 2 0 0$ . We also investigate the robustness of the discovered LA. Finally, we introspect the meta learned LA and compare it to gradient descent.
|
| 129 |
+
|
| 130 |
+

|
| 131 |
+
Figure 5: The VSML RNN is optimized to implement backpropagation in its recurrent dynamics on MNIST, then tested both on MNIST and Fashion MNIST where it performs learning purely by unrolling the LSTM. We test on shallow and deep architectures (single hidden layer of 32 units). Standard deviations are over 6 seeds.
|
| 132 |
+
|
| 133 |
+
Our implementation uses LSTMs and the message interpretation from Equation 7. Hyperparameters, training details, and additional experiments can be found in the appendix.
|
| 134 |
+
|
| 135 |
+
# 4.1 VSML RNNs can implement backpropagation
|
| 136 |
+
|
| 137 |
+
As described in Section 3.2, we optimize the VSML RNN to implement backpropagation. We structure the sub-RNNs to mimic a feed-forward NN with either one hidden layer or no hidden layers. To obtain training targets, we instantiate a standard NN, the shadow network, and feed it MNIST data. After cloning, we then run the LA encoded in the VSML RNN on the MNIST and Fashion MNIST dataset and observe that it performs learning purely in its recurrent dynamics, making explicit gradient calculations unnecessary. Figure 5 shows the learning curve on these two datasets. Notably, learning works both on MNIST (within distribution) and on Fashion MNIST (out of distribution). We observe that the loss is decently minimized, albeit regular gradient descent still outperforms our cloned backpropagation. This may be due to non-zero errors during learning algorithm cloning, in particular when these errors accumulate in the deeper architecture. It is also possible that the VSML states (‘weights’) deviate too far from ranges seen during cloning, in particular in the deep case when the loss starts increasing. We obtain $87 \%$ (deep) and $90 \%$ (shallow) test accuracy on MNIST and $76 \%$ (deep) and $80 \%$ (shallow) on Fashion MNIST (focusing on successful cloning over performance).
|
| 138 |
+
|
| 139 |
+
# 4.2 Meta learning supervised learning from scratch
|
| 140 |
+
|
| 141 |
+
In the previous experiments, we have established that VSML is expressive enough to metaoptimize backpropagation-like algorithms. Instead of cloning an LA, we now meta learn from scratch as described in Section 3.1. Here, we use a single layer ( $K = 1$ ) from input to output dimension and run it for two ticks per image with $N = 1 6$ and $N ^ { \prime } = N ^ { \prime \prime } = 8$ . First, the VSML RNN is meta trained end-to-end using evolutionary strategies (ES) [38] on MNIST to minimize the sum of cross-entropies over 500 data points starting from random state initializations. As each image is unique and $V _ { M }$ can not memorize the data, we are implicitly optimizing the VSML RNN to generalize to future inputs given all inputs it has seen so far. We do not pre-train $V _ { M }$ with a human-engineered LA.
|
| 142 |
+
|
| 143 |
+

|
| 144 |
+
Figure 6: The VSML RNN can be directly meta trained on MNIST to minimize the sum of errors when classifying online starting from a random state initialization. This allows for faster learning during meta testing compared to online gradient descent with Adam on the same dataset and even generalizes to a different dataset (Fashion MNIST). In comparison, a standard Meta RNN [16] strongly overfits in the same setting. Standard deviations are over 128 seeds.
|
| 145 |
+
|
| 146 |
+
During meta testing on MNIST (Figure 6) we plot the cumulativputs on the y axis $\textstyle { \bigl ( } { \frac { 1 } { T } } \sum _ { t = 1 } ^ { T } c _ { t }$ n all previous after example $T$
|
| 147 |
+
|
| 148 |
+
indicating prediction correctness). For each example, the prediction when this example was fed to the RNN is used, thus measuring sample efficient learning. This evaluation protocol is similar to the one used in Meta RNNs [56, 10]. We observe that learning is considerably faster compared to the baseline of online gradient descent (no mini batching, the learning rate appropriately tuned). One possibility is that VSML simply overfits to the training distribution. We reject this possibility by meta testing the same unmodified RNN on a different dataset, here Fashion MNIST. Learning still works well, meaning we have meta learned a fairly general LA (although performance at convergence still lacks behind a little). This generalization is achieved without using any hardcoded gradients during meta testing purely by running the RNN forward. In comparison to VSML, a Meta RNN heavily overfits.
|
| 149 |
+
|
| 150 |
+
# 4.3 Robustness to varying inputs and outputs
|
| 151 |
+
|
| 152 |
+
A defining property of VSML is that the same parameters $V _ { M }$ can be used to learn on varying input and output sizes. Further, the architecture and thus the meta learned LA is invariant to the order of inputs and outputs. In this experiment, we investigate how robust we are to such changes. We meta train across MNIST with 3, 4, 6, and 7 classes. Likewise, we train across rescaled versions with 14x14, $2 8 \mathbf { x } 2 8$ , and $3 2 \mathrm { x } 3 2$ pixels. We also randomly project all inputs using a linear transformation, with the transforma
|
| 153 |
+
|
| 154 |
+

|
| 155 |
+
Figure 7: The meta learned learning algorithm is robust to permutations and size changes in the inputs and outputs. All six configurations have not been seen during training and perform comparable to the unchanged reference. Standard deviations are over 32 seeds.
|
| 156 |
+
|
| 157 |
+
tion fixed for all inner learning steps. In Figure 7 we meta test on 6 configurations that were not seen during meta training. Performance on all of these configurations is comparable to the unchanged reference from the previous section. In particular, the invariance to random projections suggests that we have meta learned a learning algorithm beyond transferring learned representations [compare 11, 54, 55].
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 8: Online learning on various datasets. Cumulative accuracy in $\%$ after having seen $2 \mathrm { k }$ training examples evaluated after each prediction starting with random states (VSML, Meta RNN, HebbianFW, FWMemory) or random parameters (SGD). Standard deviations are over 32 meta test training runs. Meta testing is done on the official test set of each dataset. Meta training is on subsets of datasets excluding the Sum Sign dataset. Unseen tasks, most relevant from a general-purpose LA perspective, are opaque.
|
| 161 |
+
|
| 162 |
+
# 4.4 Varying datasets
|
| 163 |
+
|
| 164 |
+
To better understand how different meta training distributions and meta test datasets affect VSML RNNs and our baselines, we present several different combinations in Figure 8. The opaque bars represent tasks that were not seen during meta training and are thus most relevant for this analysis. This includes four additional datasets: (1) Kuzushiji MNIST [7] with 10 classes, (2) EMNIST [9] with 62 classes, (3) A randomly generated classification dataset (Random) with 20 data points that changes with each step in the outer loop, and (4) Sum Sign which generates random inputs and requires classifying the sign of the sum of all inputs. Meta training is done over 500 randomly drawn samples per outer iteration. Each algorithm is meta trained for $1 0 \mathrm { k }$ outer iterations. Inputs are randomly projected as in Section 4.3 (for VSML; the baselines did not benefit from these augmentations). We again report the cumulative accuracy on all data seen since the beginning of meta test training. We compare to SGD with a single layer, matching the architecture of VSML, and a hidden layer, matching the number of weights to the size of $V _ { L }$ in VSML. We also have included a Hebbian fast weight baseline [25] and an external (fast weight) memory approach [42].
|
| 165 |
+
|
| 166 |
+
We observe that VSML generalizes much better than Meta RNNs, Hebbian fast weights, and the external memory. These baselines overfit to the training environments. Notably, VSML even generalizes to the unseen tasks Random and Sum Sign which have no shared structure with the other datasets. In many cases VSML’s performance is similar to SGD but a little more sample efficient in the beginning of training (learning curves in Appendix B). This suggests that our meta learned LAs are good at quickly associating new inputs with their labels. We further investigate this in the next Section 5.
|
| 167 |
+
|
| 168 |
+
# 5 Analysis
|
| 169 |
+
|
| 170 |
+
Given that VSML seems to learn faster than online gradient descent in many cases we would like to qualitatively investigate how learning differs. We first meta train on the full MNIST dataset as before. During meta testing, we plot the output probabilities for each digit against the number of samples seen in Figure 9. We highlight the ground truth input class $\boxed { \begin{array} { r l } \end{array} }$ as well as the predicted class $\bigcirc$ . In this case, our meta test dataset consists of MNIST digits with two examples of each type. The same digit is always repeated twice. This allows us to observe and visualize the effect with only a few examples. We have done the same introspection with the full dataset in Appendix B.
|
| 171 |
+
|
| 172 |
+
We observe that in VSML almost all failed predictions are followed by the correct prediction with high certainty. In contrast, SGD
|
| 173 |
+
|
| 174 |
+

|
| 175 |
+
Figure 9: Introspection of how output probabilities change after observing an input and the prediction error when meta testing on MNIST with two examples for each type. We highlight the ground truth class $\boxed { \begin{array} { r l } \end{array} }$ as well as the predicted class $\bigcirc$ . The top plot shows VSML quickly associating the input images with the right label, almost always making the right prediction the second time with high confidence. The bottom plot shows the same dataset processed by SGD with Adam which fails to learn quickly.
|
| 176 |
+
|
| 177 |
+
makes many incorrect predictions and fails to adapt correctly in only 20 steps. It seems that SGD learns qualitatively different from VSML. The VSML RNN meta learns to quickly associate new inputs with their class whereas SGD fails to do so. We tried several different SGD learning rates and considered multiple steps on the same input. In both cases, SGD does not behave similar to VSML, either learning much slower or forgetting previous examples. As evident from high accuracies in Figure 8, VSML does not only memorize inputs using this strategy of fast association, but the associations generalize to future unseen inputs.
|
| 178 |
+
|
| 179 |
+
# 6 Related Work
|
| 180 |
+
|
| 181 |
+
Memory based meta learning (Meta RNNs) Memory-based meta learning in RNNs [16, 10, 56] is a simple neural meta learner (see Section 2). Unfortunately, the LA encoded in the RNN parameters is largely overparameterized which leads to overfitting. VSML demonstrates that weight sharing can address this issue resulting in more general-purpose LAs.
|
| 182 |
+
|
| 183 |
+
Learned Learning Rules / Fast Weights NNs that generate or change the weights of another or the same NN are known as fast weight programmers [44], hypernetworks [14], NNs with synaptic plasticity [25] or learned learning rules [4] (see Section 2). In VSML we do not require explicit architectures for weight updates as weights are emergent from RNN state updates. In addition to the learning rule, we implicitly learn how the neural forward computation is defined. Concurrent to this work, fast weights have also been used to meta learn more general LAs [39].
|
| 184 |
+
|
| 185 |
+
Learned gradient-based optimizers Meta learning has been used to find optimizers that update the parameters of a model by taking the loss and gradient with respect to these parameters as an input [34, 2, 22, 24]. In this work, we are interested in meta learning that does not rely on fixed gradient calculation in the inner loop.
|
| 186 |
+
|
| 187 |
+
Discrete program search An interesting alternative to distributed variable updates in VSML is meta learning via discrete program search [48, 35]. In this paradigm, a separate programming language needs to be defined that gives rise to neural computation when its instructions are combined. This led to the automated rediscovery of backpropagation [35]. In VSML we demonstrate that a symbolic programming language is not required and general-purpose LAs can be discovered and encoded in variable-shared RNNs. Search over neural network parameters is usually easier compared to symbolic program search due to smoothness in the loss landscape.
|
| 188 |
+
|
| 189 |
+
Multi-agent systems In the reinforcement learning setting multiple agents can be modeled with shared parameters [50, 32, 18], also in the context of meta learning [36]. This is related to the variable sharing in VSML depending on how the agent-environment boundary is drawn. Unlike these works, we demonstrate the advantage of variable sharing in meta learning more general-purpose LAs and present a weight update interpretation.
|
| 190 |
+
|
| 191 |
+
# 7 Discussion and Limitations
|
| 192 |
+
|
| 193 |
+
The research community has perfected the art of leveraging backpropagation for learning for a long time. At the same time, there are open questions such as how to minimize memory requirements, effectively learn online and continually, learn sample efficiently, learn without separate backward phases, and others. VSML suggests that instead of building on top of backpropagation as a fixed routine, meta learning offers an alternative to discover general-purpose LAs. Nevertheless, this paper is only a proof of concept—until now we have only investigated small-scale problems and performance does not yet quite match the mini-batched setting with large quantities of data. In particular, we observed premature convergence of the solution at meta test time which calls for further investigations. Scaling our system to harder problems and larger meta task distributions will be important future work.
|
| 194 |
+
|
| 195 |
+
The computational cost of the current VSML variant is also larger than the one of standard backpropagation. If we run a sub-RNN for each weight in a standard NN with $W$ weights, the cost is in $O ( W N ^ { 2 } )$ , where $N$ is the state size of a sub-RNN. If $N$ is small enough, and our experiments suggest small $N$ may be feasible, this may be an acceptable cost. However, VSML is not bound to the interpretation of a sub-RNN as one weight. Future work may relax this particular choice.
|
| 196 |
+
|
| 197 |
+
Meta optimization is also prone to local minima. In particular, when the number of ticks between input and feedback increases (e.g. deeper architectures), credit assignment becomes harder. Early experiments suggest that diverse meta task distributions can help mitigate these issues. Additionally, learning horizons are limited when using backprop-based meta optimization. Using ES allowed for training across longer horizons and more stable optimization.
|
| 198 |
+
|
| 199 |
+
VSML can also be viewed as regularizing the NN weights that encode the LA through a representational bottleneck. It is conceivable that LA generalization as obtained by VSML can also be achieved through other regularization techniques. Unlike most regularizers, VSML also introduces substantial reuse of the same learning principle and permutation invariance through variable sharing.
|
| 200 |
+
|
| 201 |
+
# 8 Conclusion
|
| 202 |
+
|
| 203 |
+
We introduced Variable Shared Meta Learning (VSML), a simple principle of weight sharing and sparsity for meta learning powerful learning algorithms (LAs). Our implementation replaces the weights of a neural network with tiny LSTMs that share parameters. We discuss connections to meta recurrent neural networks, fast weight generators (hyper networks), and learned learning rules.
|
| 204 |
+
|
| 205 |
+
Using learning algorithm cloning, VSML RNNs can learn to implement the backpropagation algorithm and its parameter updates encoded implicitly in the recurrent dynamics. On MNIST it learns to predict well without any human-designed explicit computational graph for gradient calculation.
|
| 206 |
+
|
| 207 |
+
VSML can meta learn from scratch supervised LAs that do not explicitly rely on gradient computation and that generalize to unseen datasets. Introspection reveals that VSML LAs learn by fast association in a way that is qualitatively different from stochastic gradient descent. This leads to gains in sample efficiency. Future work will focus on reinforcement learning settings, improvements of meta learning, larger task distributions, and learning over longer horizons.
|
| 208 |
+
|
| 209 |
+
# Acknowledgements
|
| 210 |
+
|
| 211 |
+
We thank Sjoerd van Steenkiste, Imanol Schlag, Kazuki Irie, and the anonymous reviewers for their comments and feedback. This work was supported by the ERC Advanced Grant (no: 742870) and computational resources by the Swiss National Supercomputing Centre (CSCS, projects $s 9 7 8$ and s1041). We also thank NVIDIA Corporation for donating several DGX machines as part of the Pioneers of AI Research Award, IBM for donating a Minsky machine, and weights & biases [5] for their great experiment tracking software and support.
|
| 212 |
+
|
| 213 |
+
# References
|
| 214 |
+
|
| 215 |
+
[1] F. Alet, M. F. Schneider, T. Lozano-Perez, and L. P. Kaelbling. Meta-learning curiosity algorithms. In International Conference on Learning Representations, 2020.
|
| 216 |
+
[2] M. Andrychowicz, M. Denil, S. G. Colmenarejo, M. W. Hoffman, D. Pfau, T. Schaul, B. Shillingford, and N. De Freitas. Learning to learn by gradient descent by gradient descent. In Advances in Neural Information Processing Systems, pages 3988–3996, 6 2016.
|
| 217 |
+
[3] J. Ba, G. Hinton, V. Mnih, J. Z. Leibo, and C. Ionescu. Using Fast Weights to Attend to the Recent Past. In Advances in Neural Information Processing Systems, pages 4331–4339, 2016.
|
| 218 |
+
[4] S. Bengio, Y. Bengio, J. Cloutier, and J. Gecsei. On the optimization of a synaptic learning rule. In Preprints Conf. Optimality in Artificial and Biological Neural Networks, pages 6–8, 1992.
|
| 219 |
+
[5] L. Biewald. Experiment Tracking with Weights and Biases, 2020. URL https://www.wandb. com/.
|
| 220 |
+
[6] K. Cho, B. van Merrienboer, C. Gulcehre, D. Bahdanau, F. Bougares, H. Schwenk, and Y. Bengio. Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation. Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1724–1734, 6 2014.
|
| 221 |
+
[7] T. Clanuwat, M. Bober-Irizar, A. Kitamoto, A. Lamb, K. Yamamoto, and D. Ha. Deep Learning for Classical Japanese Literature, 2018.
|
| 222 |
+
[8] E. F. Codd. Cellular automata. Academic press, 2014.
|
| 223 |
+
[9] G. Cohen, S. Afshar, J. Tapson, and A. V. Schaik. EMNIST: Extending MNIST to handwritten letters. 2017 International Joint Conference on Neural Networks (IJCNN), 2017. doi: 10.1109/ ijcnn.2017.7966217.
|
| 224 |
+
[10] Y. Duan, J. Schulman, X. Chen, P. L. Bartlett, I. Sutskever, and P. Abbeel. RLˆ2: Fast Reinforcement Learning via Slow Reinforcement Learning. arXiv preprint arXiv:1611.02779, 2016.
|
| 225 |
+
[11] C. Finn, P. Abbeel, and S. Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 1126–1135, 2017.
|
| 226 |
+
[12] F. A. Gers, J. Schmidhuber, and F. Cummins. Learning to Forget: Continual Prediction with LSTM. Neural Computation, 12(10):2451–2471, 2000.
|
| 227 |
+
[13] K. Gregor. Finding online neural update rules by learning to remember. arXiv preprint arXiv:2003.03124, 3 2020.
|
| 228 |
+
[14] D. Ha, A. Dai, and Q. V. Le. HyperNetworks. In International Conference on Learning Representations, 2016.
|
| 229 |
+
[15] S. Hochreiter and J. Schmidhuber. Long Short-Term Memory. Neural Computation, 9(8): 1735–1780, 1997.
|
| 230 |
+
[16] S. Hochreiter, A. S. Younger, and P. R. Conwell. Learning to learn using gradient descent. In International Conference on Artificial Neural Networks, 2001.
|
| 231 |
+
[17] R. Houthooft, R. Y. Chen, P. Isola, B. C. Stadie, F. Wolski, J. Ho, and P. Abbeel. Evolved Policy Gradients. In Advances in Neural Information Processing Systems, pages 5400–5409, 2018.
|
| 232 |
+
[18] W. Huang, I. Mordatch, and D. Pathak. One Policy to Control Them All: Shared Modular Policies for Agent-Agnostic Control. In International Conference on Machine Learning, 2020.
|
| 233 |
+
[19] L. Kirsch, J. Kunze, and D. Barber. Modular Networks: Learning to Decompose Neural Computation. Advances in Neural Information Processing Systems, 2018.
|
| 234 |
+
[20] L. Kirsch, S. van Steenkiste, and J. Schmidhuber. Improving Generalization in Meta Reinforcement Learning using Learned Objectives. In International Conference on Learning Representations, 2020.
|
| 235 |
+
[21] Y. LeCun, C. Cortes, and C. J. Burges. MNIST handwritten digit database. ATT Labs [Online]. Available: http://yann.lecun.com/exdb/mnist, 2, 2010.
|
| 236 |
+
[22] K. Li and J. Malik. Learning to Optimize. arXiv preprint arXiv:1606.01885, 2016.
|
| 237 |
+
[23] S. Linnainmaa. The representation of the cumulative rounding error of an algorithm as a Taylor expansion of the local rounding errors. PhD thesis, Univ. Helsinki, 1970.
|
| 238 |
+
[24] L. Metz, N. Maheswaranathan, C. D. Freeman, B. Poole, and J. Sohl-Dickstein. Tasks, stability, architecture, and compute: Training more effective learned optimizers, and using them to train themselves. arXiv preprint arXiv:2009.11243, 9 2020.
|
| 239 |
+
[25] T. Miconi, J. Clune, and K. O. Stanley. Differentiable plasticity: training plastic neural networks with backpropagation. In International Conference on Machine Learning, 2018.
|
| 240 |
+
[26] T. Miconi, A. Rawal, J. Clune, and K. O. Stanley. Backpropamine: training self-modifying neural networks with differentiable neuromodulated plasticity. In International Conference on Learning Representations, 2019.
|
| 241 |
+
[27] N. Mishra, M. Rohaninejad, and X. U. Chen Pieter Abbeel Berkeley. A Simple Neural Attentive Meta-Learner. In International Conference on Learning Representations, 2018.
|
| 242 |
+
[28] A. Mordvintsev, E. Randazzo, E. Niklasson, and M. Levin. Growing neural cellular automata. Distill, 5(2):e23, 2020.
|
| 243 |
+
[29] M. C. Mozer and S. Das. A connectionist symbol manipulator that discovers the structure of context-free languages. In Advances in neural information processing systems, pages 863–870, 1993.
|
| 244 |
+
[30] E. Najarro and S. Risi. Meta-Learning through Hebbian Plasticity in Random Networks. Advances in Neural Information Processing Systems, 2020.
|
| 245 |
+
[31] J. Oh, M. Hessel, W. M. Czarnecki, Z. Xu, H. van Hasselt, S. Singh, and D. Silver. Discovering Reinforcement Learning Algorithms. arXiv preprint arXiv:2007.08794, 2020.
|
| 246 |
+
[32] D. Pathak, C. Lu, T. Darrell, P. Isola, and A. A. Efros. Learning to Control Self-Assembling Morphologies: A Study of Generalization via Modularity. In Advances in Neural Information Processing Systems, 2019.
|
| 247 |
+
[33] E. Randazzo, E. Niklasson, and A. Mordvintsev. MPLP: Learning a Message Passing Learning Protocol. arXiv preprint arXiv:2007.00970, 2020.
|
| 248 |
+
[34] S. Ravi and H. Larochelle. Optimization as a model for few-shot learning. In International Conference on Learning Representations, 2016.
|
| 249 |
+
[35] E. Real, C. Liang, D. R. So, and Q. V. Le. AutoML-Zero: Evolving Machine Learning Algorithms From Scratch. In International Conference on Machine Learning, pages 8007–8019, 2020.
|
| 250 |
+
[36] M. Rosa, O. Afanasjeva, S. Andersson, J. Davidson, N. Guttenberg, P. Hlubucek, M. Poliak, ˇ J. Vítku, and J. Feyereisl. BADGER: Learning to (Learn [Learning Algorithms] through Multi-Agent Communication). arXiv preprint arXiv:1912.01513, 2019.
|
| 251 |
+
[37] C. Rosenbaum, T. Klinger, and M. Riemer. Routing Networks: Adaptive Selection of NonLinear Functions for Multi-Task Learning. In International Conference on Learning Representations, 2018.
|
| 252 |
+
[38] T. Salimans, J. Ho, X. Chen, S. Sidor, and I. Sutskever. Evolution Strategies as a Scalable Alternative to Reinforcement Learning. arXiv preprint arXiv:1703.03864, 3 2017. ISSN ISSN 0302-9743. doi: 10.1.1.51.6328.
|
| 253 |
+
[39] M. Sandler, M. Vladymyrov, A. Zhmoginov, N. Miller, A. Jackson, T. Madams, and others. Meta-Learning Bidirectional Update Rules. arXiv preprint arXiv:2104.04657, 2021.
|
| 254 |
+
[40] A. Santoro, S. Bartunov, M. Botvinick, D. Wierstra, and T. Lillicrap. Meta-Learning with Memory-Augmented Neural Networks. In International conference on machine learning, pages 1842–1850, 2016.
|
| 255 |
+
[41] I. Schlag and J. Schmidhuber. Gated Fast Weights for On-The-Fly Neural Program Generation. In NIPS Metalearning Workshop, 2017.
|
| 256 |
+
[42] I. Schlag, T. Munkhdalai, and J. Schmidhuber. Learning Associative Inference Using Fast Weight Memory. In International Conference on Learning Representations, 2021.
|
| 257 |
+
[43] J. Schmidhuber. Evolutionary principles in self-referential learning. Diploma thesis, Institut für Informatik, Technische Universität München, 1987.
|
| 258 |
+
[44] J. Schmidhuber. Learning to Control Fast-Weight Memories: An Alternative to Recurrent Nets. Technical Report FKI-147-91, Institut für Informatik, Technische Universität München, 3 1991.
|
| 259 |
+
[45] J. Schmidhuber. Learning to Control Fast-Weight Memories: An Alternative to Dynamic Recurrent Networks. Neural Computation, 4(1):131–139, 1992. ISSN 0899-7667. doi: 10.1162/neco.1992.4.1.131.
|
| 260 |
+
[46] J. Schmidhuber. Reducing the ratio between learning complexity and number of time varying variables in fully recurrent nets. In International Conference on Artificial Neural Networks, pages 460–463. Springer, 1993.
|
| 261 |
+
[47] J. Schmidhuber. A self-referential weight matrix. In Proceedings of the International Conference on Artificial Neural Networks, Amsterdam, pages 446–451. Springer, 1993.
|
| 262 |
+
[48] J. Schmidhuber. Discovering Problem Solutions with Low Kolmogorov Complexity and High Generalization Capability. Technical Report FKI-194-94, Fakultät für Informatik, Technische Universität München, 1994.
|
| 263 |
+
[49] N. Shazeer, A. Mirhoseini, K. Maziarz, A. Davis, Q. Le, G. Hinton, and J. Dean. Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer. arXiv preprint arXiv:1701.06538, 2017.
|
| 264 |
+
[50] Sims, Karl. Evolving Virtual Creatures. ACM SIGGRAPH, 1994.
|
| 265 |
+
[51] A. Sperduti. Encoding labeled graphs by labeling raam. Advances in Neural Information Processing Systems, pages 1125–1125, 1994.
|
| 266 |
+
[52] S. Sudhakaran, D. Grbic, S. Li, A. Katona, E. Najarro, C. Glanois, and S. Risi. Growing 3d artefacts and functional machines with neural cellular automata. arXiv preprint arXiv:2103.08737, 2021.
|
| 267 |
+
[53] G. Z. Sun. Neural networks with external memeory stack that learn context-free grammars from examples. In Proceedings of the Conference on Information Science and Systems, 1991, pages 649–653. Princeton University, 1991.
|
| 268 |
+
[54] E. Triantafillou, T. Zhu, V. Dumoulin, P. Lamblin, U. Evci, K. Xu, R. Goroshin, C. Gelada, K. Swersky, P.-A. Manzagol, and H. Larochelle. Meta-Dataset: A Dataset of Datasets for Learning to Learn from Few Examples. 3 2019.
|
| 269 |
+
[55] H.-Y. Tseng, H.-Y. Lee, J.-B. Huang, and M.-H. Yang. Cross-domain few-shot classification via learned feature-wise transformation. arXiv preprint arXiv:2001.08735, 2020.
|
| 270 |
+
[56] J. X. Wang, Z. Kurth-Nelson, D. Tirumala, H. Soyer, J. Z. Leibo, R. Munos, C. Blundell, D. Kumaran, and M. Botvinick. Learning to reinforcement learn. arXiv preprint arXiv:1611.05763, 2016.
|
| 271 |
+
[57] D. Wierstra, T. Schaul, J. Peters, and J. Schmidhuber. Natural Evolution Strategies. In 2008 IEEE Congress on Evolutionary Computation (IEEE World Congress on Computational Intelligence), pages 3381–3387, 2008.
|
| 272 |
+
[58] Z. Wu, S. Pan, F. Chen, G. Long, C. Zhang, and S. Y. Philip. A comprehensive survey on graph neural networks. IEEE Transactions on Neural Networks and Learning Systems, 2020.
|
| 273 |
+
[59] H. Xiao, K. Rasul, and R. Vollgraf. Fashion-MNIST: a Novel Image Dataset for Benchmarking Machine Learning Algorithms. CoRR, abs/1708.0, 2017.
|
md/train/jfPU-u_52Tx/jfPU-u_52Tx.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/z-l1kpDXs88/z-l1kpDXs88.md
ADDED
|
@@ -0,0 +1,253 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TokenLearner: Adaptive Space-Time Tokenization for Videos
|
| 2 |
+
|
| 3 |
+
Michael S. Ryoo1,2, AJ Piergiovanni1, Anurag Arnab1, Mostafa Dehghani1, Anelia Angelova1
|
| 4 |
+
|
| 5 |
+
1Google Research 2Stony Brook University {mryoo,ajpiergi,aarnab,dehghani,anelia}@google.com
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
In this paper, we introduce a novel visual representation learning which relies on a handful of adaptively learned tokens, and which is applicable to both image and video understanding tasks. Instead of relying on hand-designed splitting strategies to obtain visual tokens and processing a large number of densely sampled patches for attention, our approach learns to mine important tokens in visual data. This results in efficiently and effectively finding a few important visual tokens and enables modeling of pairwise attention between such tokens, over a longer temporal horizon for videos, or the spatial content in image frames. Our experiments demonstrate strong performance on several challenging benchmarks for video recognition tasks. Importantly, due to our tokens being adaptive, we accomplish competitive results at significantly reduced computational cost. We establish new state-of-the-arts on multiple video datasets, including Kinetics-400, Kinetics-600, Charades, and AViD.
|
| 10 |
+
|
| 11 |
+
The code will be available at: https://github.com/google-research/ scenic/tree/main/scenic/projects/token_learner
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
Videos provide an abundance of visual information. Video understanding particularly requires employing effective spatial-temporal processing of frames to capture long-range interactions [5, 37, 21, 17, 24, 12, 34, 20, 25, 1]. An important aspect of this understanding is how to quickly learn which parts of the input video stream are important, both spatially and temporally, and to focus computational resources on them. But what basic processing mechanism are able to do so successfully?
|
| 16 |
+
|
| 17 |
+
Recent advancements in Transformers demonstrate improved accuracy on vision classification tasks. For example, departing from standard convolutional approaches, the Vision Transformer (ViT) [9] treats the image as a sequence of patches, utilizing the Transformer architecture [39] similar to text understanding. Standard approaches for video recognition take videos as stacked images (i.e., a spacetime volume) and tend to extend 2D neural architectures to 3D (e.g., 3D-ResNets [17, 5, 38, 11]). Motivated by ViT, recent approaches [2, 3] also extend Transformers for videos by creating 3D ‘tubelet’ video tokens with regular 3D-grids, which often result in computationally heavy models. There are often too many tokens to process, especially for longer videos.
|
| 18 |
+
|
| 19 |
+
The main question addressed in this work is how to adaptively learn the representation from visual inputs to most effectively capture the spatial information for image frames and spatio-temporal interactions for videos. Here are our main ideas:
|
| 20 |
+
|
| 21 |
+
The first key observation is we are able to learn to represent visual data by learning to ‘tokenize’ the representations. This is in contrast to previous approaches which used densely sampled tokens e.g., 16x16 or $3 2 \mathrm { x } 3 2$ over a series of attention layers [9, 3].
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: Visual illustration of the TokenLearner module, applied to a single image frame. TokenLearner learns to spatially attend over a subset of tensor pixels (i.e., from intermediate spatial representations), and generates a set of token vectors adaptive to the input.
|
| 25 |
+
|
| 26 |
+
Specifically, we can learn to compute important regions in the input image/video, making the tokens adapt to the input data. We compute multiple spatial weight maps per frame with a spatial attention mechanism, and use it for the tokenization. The goal of these maps is to learn which areas are of importance. Here, each spatial weight map is multiplied with the input to form a ‘token’, to be processed by the subsequent learning modules.
|
| 27 |
+
|
| 28 |
+
Furthermore, we find that very few tokens may be sufficient for a visual understanding task. More specifically, we show that one can significantly reduce the computational budget of video Transformers, by utilizing 8-16 tokens as an intermediate frame representation (instead of keeping $2 0 0 { \sim } 5 0 0 $ ). Our TokenLearner is able to reduce the number of total FLOPS by half, while maintaining or even increasing the classification accuracy.
|
| 29 |
+
|
| 30 |
+
The approach is simple, efficient, and, as shown by the results, outperforms methods including both convolutional methods and previous space-time Transformer ones from prior art. In video understanding tasks, we establish new state-of-the-art numbers on Kinetics-400, Kinetics-600, Charades, and AViD datasets by outperforming prior models.
|
| 31 |
+
|
| 32 |
+
# 2 TokenLearner Modules for Adaptive Tokenization
|
| 33 |
+
|
| 34 |
+
In visual Transformer architectures such as ViT [9], an input image is first tokenized by splitting it into small (e.g., 16x16) spatial patches, which are used as input to the model. Similarly, in recent video Transformer architectures, such as ViViT [2] and TimeSformer [3], the video is tokenized by cutting the video into 2d spatial or 3d spatio-temporal cubes on a regular grid.
|
| 35 |
+
|
| 36 |
+
Instead of processing fixed, tokenized inputs, our attention module learns the tokens that are to be used for the recognition task. We gain several important properties by doing so: (1) We enable the adaptive tokenization so that the tokens can be dynamically selected conditioned on the input. (2) This also effectively reduces the total number of tokens for the transformer, which is particularly beneficial considering that there are many tokens in videos (e.g., $1 4 \times 1 4 \times 6 4 \times$ and the computation is quadratic to the number of tokens. (3) Finally, we provide an ability for each subsequent layer to learn to rely on different space-time tokenizations, potentially allowing different layers to capture different aspects of the video. These dynamically and adaptively generated tokens can be used in standard transformer architectures such as ViT for images and ViViT for videos.
|
| 37 |
+
|
| 38 |
+
# 2.1 TokenLearner
|
| 39 |
+
|
| 40 |
+
Let $X$ be an input tensor with a space-time shape: $X \in \mathbb { R } ^ { T \times H \times W \times C }$ where $H \times W$ corresponds to the spatial dimension of the input, $T$ is the temporal dimension (i.e., number of frames), and $C$ is the number of channels. Let $X _ { t }$ be a temporal slice of it, corresponding to the frame $t$ : $X _ { t } \in \mathbb { R } ^ { H \times W \times C }$
|
| 41 |
+
|
| 42 |
+
In the case of an image input, $T = 1$ and $X = X _ { t }$ . Note that $X$ could also be an intermediate representation within a network, and $X _ { t }$ will be its slice in such case.
|
| 43 |
+
|
| 44 |
+
For every time frame $t$ , we learn to generate a series of $S$ tokens, $Z _ { t } = [ z _ { i } ] _ { i = 1 } ^ { S }$ , from the input frame $X _ { t }$ . Specifically, we formulate a tokenizer function, $z _ { i } = A _ { i } ( X _ { t } )$ , which maps the input frame $X _ { t }$ to a token vector $z _ { i }$ : $\mathbb { R } ^ { H \times W \times C } \mapsto \mathbb { R } ^ { C }$ . The idea is to learn our tokenizer function $A _ { i }$ to adaptively select an informative combination of pixels (or spatial locations) in $X _ { t }$ , and we have $S$ number of such functions. This way, our tokens will not be fixed splits of the input tensor, but a set of adaptively changing spatial selections. Different tokens will be mined per frame, allowing us to model their space-time relations/interactions in case of videos. We also set $S$ to be smaller than $H \times W$ (e.g., $S = 8$ and $H \times W = 1 4 \times 1 4$ ), enabling the model to significantly reduce the computations needed for the layers following this module.
|
| 45 |
+
|
| 46 |
+
Here, our tokenizer $z _ { i } = A _ { i } ( X _ { t } )$ is implemented with a spatial attention mechanism: i.e., the model learns to compute a weight map (of size $H \times W$ ) conditioned on the input $X _ { t }$ , and is multiplied with $X _ { t }$ itself. More specifically, let $\alpha _ { i } ( X _ { t } )$ be a function generating the spatial $H \times W \times 1$ weight map. Each token $z _ { i }$ is generated by
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
z _ { i } = A _ { i } ( X _ { t } ) = \rho ( X _ { t } \odot A _ { i w } ) = \rho ( X _ { t } \odot \gamma ( \alpha _ { i } ( X _ { t } ) ) ) ,
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
where $\odot$ is the Hadamard product (i.e., element-wise multiplication) and $A _ { i w } \in \mathbb { R } ^ { H \times W \times C }$ is an intermediate weight tensor computed with the function $\alpha _ { i } ( X _ { t } )$ and the broadcasting function $\gamma ( \cdot )$ . Finally, spatial global average pooling $\rho ( \cdot )$ is applied on top of them to reduce the dimensionality to $\mathbb { R } ^ { C }$ . The resulting tokens are gathered to form the output tensor: $Z _ { t } = [ z _ { i } ] _ { i = 1 } ^ { S } \in \mathbb { R } ^ { S \times C }$ .
|
| 53 |
+
|
| 54 |
+
The overall process has a form of an element-wise spatial self-attention. In our version, $\{ \alpha _ { i } ( \cdot ) \} _ { i = 1 } ^ { S }$ are implemented together as a single or a series of convolutional layers (with the channel size $S$ ) followed by a sigmoid function, although this could be extended with other implementations. In case of an image, $Z = Z _ { t }$ . In the case of a video, the tokens $Z _ { t }$ from all the frames are collected to form the final output token tensor Z ∈ RST ×C .
|
| 55 |
+
|
| 56 |
+
We specifically name our token learning module as “TokenLeaner”. Figure 1 visually summarizes the TokenLearner module.
|
| 57 |
+
|
| 58 |
+
Compute reduction in Transformers: The learned tokens (i.e., the outputs of the TokenLearner $Z$ ) are provided to the subsequent layers for the visual representation learning, such as multi-head selfattention (MHSA) used in Vision Transformer and ViViT. With the TokenLearner, these subsequent layers only need to process a small number of tokens (e.g., 8 instead of 1024 per frame) and this significantly reduces the computations, as they are quadratic to the number of tokens. Figure 4 (a) shows a basic architecture inserting the TokenLearner module within ViViT. It could be added at any location within the network, and the relative compute of the Transformer layers after the TokenLearner become almost negligible due to the huge difference in the number of tokens.
|
| 59 |
+
|
| 60 |
+
# 2.2 TokenFuser
|
| 61 |
+
|
| 62 |
+
After the TokenLearner generates tokens and its subsequent Transformer layer (e.g., MHSA) processes them, the “TokenFuser” could be used to further (1) fuse information across the tokens and (2) remap the representation back to its original spatial resolution. This enables the model to capture spatial (or spatio-temporal) ‘patterns’ formulated by the tokens, and recover the original input tensor shape when necessary.
|
| 63 |
+
|
| 64 |
+

|
| 65 |
+
Figure 2: Visual illustration of the TokenFuser module, applied to each image frame individually.
|
| 66 |
+
|
| 67 |
+

|
| 68 |
+
Figure 3: TokenLearner, Transformer, and TokenFuser combined for video representation learning. TokenLearner first learns to generate a set of token vectors, Transformer (e.g., MHSA) models their space-time relations, and TokenFuser combines them. $S$ is the number of tokens we learn per frame, and $T$ is the number of frames. Note that this combination can serve as a ‘module’ itself, and one may stack such module multiple times within the network. TokenFuser could be dropped.
|
| 69 |
+
|
| 70 |
+
First, given the token tensor $Y \in \mathbb { R } ^ { S T \times C }$ from a Transformer layer, we apply a linear layer (i.e., a fully connected MLP layer) over the tokens, not channels. That is, we learn a linear function of $\mathbb { R } ^ { S T } \overset { \cdot } { \mapsto } \mathbb { R } ^ { S T }$ where $S$ is the number of our tokens mined per frame and $T$ is temporal size of the input tensor, and apply it to every channel independently. That is, we update $\boldsymbol { Y } = \bar { ( } \boldsymbol { Y } ^ { T } \boldsymbol { M } ) ^ { T }$ where $M$ is a learnable weight matrix with size $S T \times S T$ . The result of such operation maintains the tensor size of $S T \times C$ . We believe this also has a connection to the observations from the concurrent work, MLPMixer [36], that token-wise linear layers are beneficial.
|
| 71 |
+
|
| 72 |
+
Next, the TokenFuser processes each temporal slice $Y _ { t } \in \mathbb { R } ^ { S \times C }$ individually, and remaps the token tensor of size $S \times C$ back to $H \times W \times C$ , by learning to combine the tokens for each spatial location in $H \times W$ differently.
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
X _ { t } ^ { j + 1 } = B ( Y _ { t } , X _ { t } ^ { j } ) = B _ { w } Y _ { t } + X _ { t } ^ { j } = \beta _ { i } ( X _ { t } ^ { j } ) Y _ { t } + X _ { t } ^ { j }
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
where $X _ { t } ^ { j }$ is the residual input to the previous TokenLearner module, $Y _ { t }$ is the processed tokens in the TokenFuser module, and $X _ { t } ^ { j + 1 }$ is the output. $B _ { w } \in \mathbb { R } ^ { H W \times S }$ is an intermediate weight tensor computed with the function $\beta _ { i } ( X _ { t } )$ . The function $\beta _ { i } ( X _ { t } )$ is implemented with a simple linear layer followed by a sigmoid function.
|
| 79 |
+
|
| 80 |
+
Figure 2 illustrates the overall process of the TokenFuser (the token-wise linear layer is omitted).
|
| 81 |
+
|
| 82 |
+
# 2.3 Video architecture overview
|
| 83 |
+
|
| 84 |
+
Here, we provide an overview of video representation architecture with TokenLearner. The TokenLearner and TokenFuser modules introduced in Section 2 are directly applicable for video representation learning. TokenLearner generates multiple $Z _ { t }$ for frames in videos and they are stacked to form $Z$ . Once $Z$ is generated, any standard Transformer layers could be used to parse them jointly.
|
| 85 |
+
|
| 86 |
+
Figure 3 provides an overview of the combined architecture for video representation, which is to be repeated over multiple layers. TokenLearner first extracts $S$ number of tokens per frame, resulting in a total of $S T$ tokens where $T$ is the number of frames. Once TokenLearner generates these adaptively learned tokens, they are provided to the subsequent Transformer layer to capture the global space-time patterns. Finally (and optionally depending on the architecture), TokenFuser applies a linear layer over the token axis and remaps the tensor shape back, as discussed in Subsection 2.2. Following Eq. 2, TokenFuser is applied for per-frame representation $Y _ { t }$ . This results in a lightweight approach, which brings forth an efficient video representation by capturing long-range visual patterns.
|
| 87 |
+
|
| 88 |
+
# 3 Experiments: TokenLearner with Video Vision Transformer
|
| 89 |
+
|
| 90 |
+
# 3.1 Network architecture implementation
|
| 91 |
+
|
| 92 |
+
In this experiment, we use the Video Vision Transformer (ViViT) architecture [2], following its detailed settings and implementation [7]. ViViT is a direct extension of ViT [9] for videos, which uses spatiotemporal tubelets from videos as its tokens. The size of the space-time tubelets are typically 16x16x2, which are given to the Transformer layers.
|
| 93 |
+
|
| 94 |
+
We use ViViT-L/16 as our backbone, while also applying the TokenLearner to backbones with more initial tokens such as L/14 and L/10. ViViT-L models have 24 transformer layers. Following the setting of [2], we used the input resolution of $2 2 4 \mathbf { x } 2 2 4$ , extracting tubelets, and attaching positional encodings.
|
| 95 |
+
|
| 96 |
+
Figure 4 (a) and (b) show two different architectures incorporating TokenLearner. (a) is formed by inserting TokenLearner in the middle of the network such as after the 12th layer among 24, while (b) uses both TokenLearner and TokenFuser. In particular, our model (b) is formed by replacing conventional Transformer layers with a series of TokenLearnerTransformer-TokenFuser. Similar to (a), such replacement is done only for the layers after a certain point. For instance, we keep twelve of the standard Transformer MHSA layers in the beginning, and replaces the remaining twelve layers with our TokenLearner-Transformer-TokenFuser modules repeated twelve times. We also modified L/14 and L/10 models to have more transformer layers (e.g., 35 instead of 24). Note that the computation increase caused by the transformer layers added after TokenLearner module is relatively very small, as the number of tokens are few: 8 or 16 per frame.
|
| 97 |
+
|
| 98 |
+

|
| 99 |
+
Figure 4: Our models following the ViViT architecture. (a) with TokenLearner and (b) with both TokenLearner and TokenFuser.
|
| 100 |
+
|
| 101 |
+
We tried various number of tokens including $S = 8 , 1 6 , 3 2$ , and use $S = 8$ and 16 as our default settings. That is, the TokenLearner is learning to abstract an image frame into 8 (or 16) tokens. The spatial attention function $( \alpha )$ in TokenLearner is implemented with four 3x3 conv. layers (with gelu in between), whose channel size is identical to the number of tokens (e.g., $S = 8$ ).
|
| 102 |
+
|
| 103 |
+
# 3.2 Datasets and training
|
| 104 |
+
|
| 105 |
+
We use the Kinetics datasets, which are video classification datasets with relatively short video clips ${ \sim } 1 0$ seconds). We train and evaluate on both Kinetics-400 and Kinetics-600 datasets, which have about $2 4 0 \mathrm { k }$ and 390k training samples. We follow the standard settings used in previous papers and report accuracy on the validation set [5, 12].
|
| 106 |
+
|
| 107 |
+
Following ViViT [2], we first pretrain models on JFT [35] to obtain initial weights. The weights of the initial convolutional layers to handle image patches (e.g., 16x16) are processed to handle 16x16x2 video patches by following ViViT’s 3D initialization strategy, and the weights of the Transformer and the TokenLearner layers are directly inherited.
|
| 108 |
+
|
| 109 |
+
# 3.3 Results
|
| 110 |
+
|
| 111 |
+
We evaluate various versions of the ViT-L models incorporating the TokenLearner module. As mentioned above, all of the models are pre-trained on JFT and finetuned on Kinetics. We use the standard L/16 models $^ +$ TokenLearner, as well as L/14 and $\mathrm { L } / 1 0 . \mathrm { L } / 1 4$ and $\mathrm { L } / 1 0$ use 11 additional layers compared to the standard ViT L/16, but as also described in the above subsections, the computation increase caused by them are minimal due to the number of tokens being much smaller, 8 or 16 per frame, in the added layers. We report both their classification accuracies and FLOPS.
|
| 112 |
+
|
| 113 |
+
Table 1 compares the accuracies of the base ViViT models against our ViViT $^ +$ TokenLearner models on Kinetics-400. These models are directly comparable as they follow the exact same setting and the pre-train dataset. “TokenLearner 16at12” means that we have the TokenLearner layer learning 16 tokens, after the 12th Transformer layer. We are able to observe that the use of TokenLearner enables better classification while also reducing the compute. In particular, inserting TokenLearner in the middle of the network (at 12) achieves better accuracy than the base mode, while cutting the computation by (almost) half. In addition, having the TokenLearner at the later layer (at 18) achieves even superior accuracy while still performing faster, thanks to its adaptiveness.
|
| 114 |
+
|
| 115 |
+
Table 1: Comparison of ViViT models with and without TokenLearner on Kinetics-400. GLOPS are per view. The difference in the number of parameters between the TokenLearner models comes from the different number of layers used after the TokenLearner module.
|
| 116 |
+
|
| 117 |
+
<table><tr><td>Method</td><td>Top-1 accuracy</td><td>Top-5 accuracy</td><td># params.</td><td>GFLOPS</td></tr><tr><td>ViViT-L/16 [2]</td><td>82.8</td><td>95.5</td><td>308M</td><td>1446</td></tr><tr><td>ViViT-L/16 320 [2]</td><td>83.5</td><td>95.5</td><td>308M</td><td>3992</td></tr><tr><td>ViViT-H/14 [2]</td><td>84.8</td><td>95.8</td><td>654M</td><td>3981</td></tr><tr><td>ViViT-L/16 (our run)</td><td>83.4</td><td>95.6</td><td>308M</td><td>1446</td></tr><tr><td>TokenLearner 16at12 + L/16</td><td>83.5</td><td>95.6</td><td>308M</td><td>766</td></tr><tr><td>TokenLearner 8at18 +L/16</td><td>84.5</td><td>96.1</td><td>383M</td><td>1105</td></tr><tr><td>TokenLearner 16at18+ L/14</td><td>84.7</td><td>96.1</td><td>447M</td><td>1621</td></tr><tr><td>TokenLearner 16at18+ L/10</td><td>85.4</td><td>96.3</td><td>450M</td><td>4076</td></tr></table>
|
| 118 |
+
|
| 119 |
+
Table 2: ViViT $^ +$ TokenLearner on Kinetics-400, compared to the state-of-the-art models. Different approaches rely on different pre-training datasets, such as ImageNet-21K (for TimeSformer and Swin) and JFT (for ViViT and TokenLearner). The multiplication in GFLOPS correponds to the number of views used for the inference, such as $4 \mathbf { X } 3 = 1 2$ .
|
| 120 |
+
|
| 121 |
+
<table><tr><td>Method</td><td>Top-1 accuracy</td><td>Total GFLOPS</td></tr><tr><td>R(2+1)D [38]</td><td>73.9</td><td>304 × 115</td></tr><tr><td>SlowFast 16x8,R101+NL [12]</td><td>79.8</td><td>234×30</td></tr><tr><td>TimeSformer-L [3]</td><td>80.7</td><td>2380 ×3</td></tr><tr><td>ViViT-L/16 [2]</td><td>82.8</td><td>1446 × 12</td></tr><tr><td>ViViT-H/14 [2]</td><td>84.8</td><td>3981 × 12</td></tr><tr><td>Swin-L [23]</td><td>83.1</td><td>604 ×12</td></tr><tr><td>Swin-L (384) [23]</td><td>84.6</td><td>2107×12</td></tr><tr><td>Swin-L (384) [23]</td><td>84.9</td><td>2107 × 50</td></tr><tr><td>TokenLearner 16at12 (L/16)</td><td>82.1</td><td>766×6</td></tr><tr><td>TokenLearner 8at18 (L/16)</td><td>83.2</td><td>1105 × 6</td></tr><tr><td>TokenLearner 16at12 (L/16)</td><td>83.5</td><td>766 × 12</td></tr><tr><td>TokenLearner 8at18 (L/16)</td><td>84.5</td><td>1105 × 12</td></tr><tr><td>TokenLearner 16at18 (L/14)</td><td>84.7</td><td></td></tr><tr><td>TokenLearner 16at18 (L/10)</td><td>85.4</td><td>1621 × 12 4076 × 12</td></tr></table>
|
| 122 |
+
|
| 123 |
+
Table 2 compares the TokenLearner accuracy against the state-of-the-arts models. Note that these approaches follow slightly different settings and pretrain datasets (e.g., the use of ImageNet-21K instead of JFT like ours). We believe the accuracy of 85.4 is the highest that has been reported so far, and we believe it is meaningful. Table 3 compares the results on Kinetics-600. Similar to our results on Kinetics-400, we are able to observe that our proposed approach extends the state-of-the-arts while also being computationally efficient.
|
| 124 |
+
|
| 125 |
+
# 4 Experiments: TokenLearner with Bottleneck Transformer
|
| 126 |
+
|
| 127 |
+
# 4.1 Network architecture implementation
|
| 128 |
+
|
| 129 |
+
In this experiment, we follow the Bottleneck Transformer [33] network style, while taking advantage of X3D [11] as the backbone. This is motivated by the successful usage of X3D on Charades.
|
| 130 |
+
|
| 131 |
+
Table 3: ViViT $^ +$ TokenLearner on Kinetics-600. The multiplication in GFLOPS correponds to the number of views used for the inference, such as $4 \mathbf { X } 3 = 1 2$ .
|
| 132 |
+
|
| 133 |
+
<table><tr><td>Method</td><td>Top-1</td><td>Total GFLOPS</td></tr><tr><td>SlowFast 16x8,R101+NL [12]</td><td>81.8</td><td>234× 30</td></tr><tr><td>X3D-XL [11]</td><td>81.9</td><td>48×30</td></tr><tr><td>TimeSformer-HR [3]</td><td>82.4</td><td>1703×3</td></tr><tr><td>ViViT-L/16 [2]</td><td>84.3</td><td>1446 × 12</td></tr><tr><td>ViViT-H/14 [2]</td><td>85.8</td><td>3981 × 12</td></tr><tr><td>Swin-B [23]</td><td>84.0</td><td>282×12</td></tr><tr><td>Swin-L (384) [23]</td><td>85.9</td><td>2107 × 12</td></tr><tr><td>Swin-L (384) [23]</td><td>86.1</td><td>2107 × 50</td></tr><tr><td>TokenLearner 16at12 (L/16)</td><td>84.4</td><td>766×12</td></tr><tr><td>TokenLearner 8at18 (L/16)</td><td>86.0</td><td>1105×12</td></tr><tr><td>TokenLearner 16at18 (L/10)</td><td>86.1</td><td>4076 ×12</td></tr><tr><td>TokenLearner 16at18 w. Fuser (L/10)</td><td>86.3</td><td>4100 ×12</td></tr></table>
|
| 134 |
+
|
| 135 |
+
Specifically, we modified X3D to be more computationally efficient by (1) replacing its 3D XYT convolutional layers with a pair of 2D conv. layer and 1D conv. layer, and (2) removing Squeeze-and-Excitation layers [18] and swish activations. Our backbone could be viewed as ${ \mathrm { X } } ( 2 { + } 1 ) { \mathrm { D } }$ . We use the channel sizes and the number of layers identical to X3D-M, which is an efficient model.
|
| 136 |
+
|
| 137 |
+
Based on such ${ \mathrm { X } } ( 2 { + } 1 ) { \mathrm { D } }$ architecture, and following the Bottleneck Transformer concept, we replace the space-time convolution layers in the last block with our transformers. Figure 5 illustrates the residual module architecture, which is repeated multiple times in the block. TokenLearner, Transformer, TokenFuser are applied in a sequence, with an optional 2D $3 \times 3$ convolution layer before them. The spatial attention function (i.e., $\alpha ( \cdot ) )$ in TokenLearner is implemented with a single conv2d layer.
|
| 138 |
+
|
| 139 |
+
Here, we used a Vector Transformer instead of MHSA as our Transformer layer, which could be also viewed as the MHSA with the number of heads being identical to the number of channels. We provide more details in Appendix.
|
| 140 |
+
|
| 141 |
+
We use $2 2 4 \times 2 2 4 \times 6 4$ videos for training and $2 5 6 \times 2 5 6 \times 6 4$ videos for testing. After the 3rd residual block, the input tensor has the shape of $8 \times 8 \times 6 4$ , and this becomes the input to the TokenLearner. For an efficient implementation the intermediate channel size of TokenLearner was set identical to the output channel size, $d = 4 3 2$ . Notice that 64 frames were used to best capture longer-term temporal information. $S = 8$ number of tokens were used.
|
| 142 |
+
|
| 143 |
+

|
| 144 |
+
Figure 5: Our network module following the bottleneck transformer, with ${ \mathrm { X } } ( 2 { + } 1 ) { \mathrm { D } }$ backbone. It is an inverted bottleneck.
|
| 145 |
+
|
| 146 |
+
# 4.1.1 Datasets
|
| 147 |
+
|
| 148 |
+
Charades dataset: The Charades dataset [31] is a dataset collected by assigning activity tasks which people in various environments are acting out, by performing a sequence of actions which involve interaction with objects. For example, sitting on the couch and reading a book, closing the book, standing up and speaking on the phone. It comprises 8000 training and 1686 validation videos with an average duration of 30 seconds. It has 157 activity classes. This dataset is very challenging as it is a multi-class, multi-label video dataset, that is, more than one activity can occur at the same time, and it includes fine grained motions or interactions with small objects in real-world environments. We follow the standard evaluation protocols, reporting the mean Average Precision (mAP) $\%$ (v1 classification setting of the dataset). We used the frame rate of 6 fps and 12 fps to obtain the training/testing videos. The dataset has a Non-Commercial Use license.
|
| 149 |
+
|
| 150 |
+
Table 4: Performance on the Charades multi-label classification task. 12 fps setting. Performance is measured using the Mean Average Precision (mAP) since more than one ground truth action is possible. Methods with RGB and optical flow input modalities are listed.
|
| 151 |
+
|
| 152 |
+
<table><tr><td>Method</td><td>Input</td><td>Pre-train</td><td>mAP</td></tr><tr><td>I3D [5]</td><td>RGB</td><td>Kinetics</td><td>32.9</td></tr><tr><td>I3D from [40]</td><td>RGB</td><td>Kinetics</td><td>35.5</td></tr><tr><td>I3D + Non-local [40]</td><td>RGB</td><td>Kinetics</td><td>37.5</td></tr><tr><td>EvaNet [26]</td><td>RGB</td><td>Kinetics</td><td>38.1</td></tr><tr><td>STRG [41]</td><td>RGB</td><td>Kinetics</td><td>39.7</td></tr><tr><td>LFB-101 [43]</td><td>RGB</td><td>Kinetics</td><td>42.5</td></tr><tr><td>SGFB-101[19]</td><td>RGB</td><td>Kinetics</td><td>44.3</td></tr><tr><td>SlowFast-101[12]</td><td>RGB+RGB</td><td>Kinetics</td><td>45.2</td></tr><tr><td>AssembleNet-50 [30]</td><td>RGB+Flow</td><td>None</td><td>47.0</td></tr><tr><td>Multiscale ViT[10]</td><td>RGB</td><td>Kinetics</td><td>47.7</td></tr><tr><td>AssembleNet-101 [30]</td><td>RGB+Flow</td><td>Kinetics</td><td>58.6</td></tr><tr><td>AssembleNet++ [29](w/o object)</td><td>RGB+Flow</td><td>None</td><td>55.0</td></tr><tr><td>MoViNets [22]</td><td>RGB</td><td>None</td><td>63.2</td></tr><tr><td>Backbone (X(2+1)D-M)</td><td>RGB</td><td>None</td><td>62.7</td></tr><tr><td>Ours</td><td>RGB</td><td>None</td><td>66.3</td></tr></table>
|
| 153 |
+
|
| 154 |
+
Table 5: Performance on the Anonymized Videos from Diverse countries (AViD) dataset. Performance in terms of mean accuracy is shown in $\%$ averaged over 887 classes. Previous approaches results are reported from [27], all based on training from scratch with RGB-only inputs.
|
| 155 |
+
|
| 156 |
+
<table><tr><td>Method</td><td>Accuracy</td><td>total GFLOPS</td></tr><tr><td>I3D [5]</td><td>46.5</td><td>108× N/A</td></tr><tr><td>(2+1)D ResNet-50</td><td>46.7</td><td>152 × 115</td></tr><tr><td>3D ResNet-50</td><td>47.9</td><td>N/A</td></tr><tr><td>SlowFast-50 8x8 [12]</td><td>50.2</td><td>65.7 × 30</td></tr><tr><td>SlowFast-101 16x4[12]</td><td>50.8</td><td>213×30</td></tr><tr><td rowspan="2">Backbone (X(2+1)D-M) X(2+1)D-M w/ disjoint space+time Transformer (like [3])</td><td>48.6</td><td>532×1</td></tr><tr><td>50.6</td><td>493×1</td></tr><tr><td>Ours</td><td>53.8</td><td>487×1</td></tr></table>
|
| 157 |
+
|
| 158 |
+
AViD dataset: The Anonymized Videos from Diverse countries (AViD) dataset [27] is a unique dataset which is representative of the world’s population video content generation. It is collected from videos uploaded from multiple countries across six continents and demonstrates higher diversity compared to other video datasets such as Kinetics in its concepts, actions and visual representations. For example a ‘greeting’ in certain countries involves a handshake, in some a kiss, but in others a slight bow. The dataset is explicitly designed to contain less bias, encourage diversity, while respecting privacy and licenses. The AViD dataset contains 887 classes and 450k videos (410k training $4 0 \mathrm { k }$ testing) and is of comparable size to Kinetics-400 and Kinetics-600 datasets with 400 and 600 classes respectively, also containing variable duration videos $3 - 1 5 s$ . We report classification accuracy over the 887 classes. All the videos in this dataset have the Creative Commons License.
|
| 159 |
+
|
| 160 |
+
# 4.2 Results
|
| 161 |
+
|
| 162 |
+
Charades dataset results: In Table 4 we compare the proposed TokenLearner to the state-of-the-art methods. Our approach outperforms these, including several recent works. The mAP of $6 6 . 3 \%$ on Charades classification establishes the new state-of-the-art.
|
| 163 |
+
|
| 164 |
+
AViD results: Table 5 shows the results on the AViD dataset. As seen, our approach outperforms prior work on this challenging dataset too. We also compared ours to the reimplementation of TimeSformer module [3] applied to the same backbone as ours. This uses disjoint spatial and temporal transformer modules, which was also tested in [2]. We are able to observe that we establish the new state-of-the-arts on this dataset, while also being more computationally efficient.
|
| 165 |
+
|
| 166 |
+
Table 6: Comparison between TokenLearner and the joint space-time transformer modules similar to [2], applied to our backbone. They use the ${ \mathrm { X } } ( 2 { + } 1 ) { \mathrm { D } }$ backbone, tested on Charades with the 6 fps setting, Charades 12 fps setting, and AViD dataset. GFLOPs and $\#$ params are of each module (with 64 frame inputs), not the entire network.
|
| 167 |
+
|
| 168 |
+
<table><tr><td>Module</td><td>Char-6fps</td><td>Char-12fps</td><td>AViD</td><td>GFLOPs</td><td># params</td></tr><tr><td>Joint space-time MHSA</td><td>57.9</td><td>64.0</td><td>53.3</td><td>22.0</td><td>0.30M</td></tr><tr><td>Conv2D + Joint space-time MHSA</td><td>58.6</td><td>62.5</td><td>52.5</td><td>35.8</td><td>1.98M</td></tr><tr><td>Ours (TokenLearner)</td><td>58.8</td><td>63.4</td><td>53.8</td><td>3.4</td><td>0.81M</td></tr><tr><td>Ours (Conv2D + TokenLearner)</td><td>59.6</td><td>66.3</td><td>53.7</td><td>17.2</td><td>2.49M</td></tr></table>
|
| 169 |
+
|
| 170 |
+
# 4.3 Ablations
|
| 171 |
+
|
| 172 |
+
Comparison against different tokenizations: Here, we compare the model with TokenLearner against space-time transformer modules with the standard tokenization. More specifically, we compare the use of TokenLearner $^ +$ Vector Transformer $^ +$ TokenFuser against the full joint space-time transformer module (advocated in [2] and also mentioned in [3]), without token learning. The full joint space-time transformer module is a transformer layer on space-time tokens similar to ours, but it relies only on the hand-designed tokenization. Compared to TokenLearner which generates $S \times T$ number of tokens, the full joint space-time transformer uses $H \times W \times T$ number of tokens. In our bottleneck implementation, it uses ${ \sim } 8$ times more tokens (i.e., $8 ^ { * } 6 4$ vs. $8 ^ { * } 8 ^ { * } 6 4$ ). For the joint space-time transformer modules, the standard multi-head self-attention (MHSA) with 8 heads is used.
|
| 173 |
+
|
| 174 |
+
Table 6 shows the results. Interestingly, despite the heavier computation of the full joint spacetime transformer, it performed slightly worse to the TokenLearner modules. We believe this shows the advantage of the ‘adaptiveness’ of the tokens in the TokenLearner and shows that the standard transformers might be suffering from the tokens irrelevant to the actions serving as noise or distractors.
|
| 175 |
+
|
| 176 |
+
We also report the amount of computation and the number of parameters of each module in these models. This depends on the input size and the hyper parameter setting, and our measurement is based on the input size (i.e., $T \times H \times W \times C )$ of $8 \times 8 \times 6 4 \times 4 9 2$ . Note that this is the measurement of modules, not the entire network.
|
| 177 |
+
|
| 178 |
+
Comparison between multiple space-time layer combinations. As also suggested in previous literature, it is a common strategy for video representations to pair a layer focusing on spatial information with a layer focusing on temporal information (e.g., $\mathrm { R } ( 2 { + } 1 ) \mathrm { D }$ [38] and TimeSformer [3]). Table 7 shows the results of this ablation. For spatial and temporal transformer implementations, the standard multi-head self-attention was used, as was done in [2, 3]. The result shows that the proposed TokenLearner is more accurate than other popular combinations. The modules based on TokenLearner also effectively only uses a fraction of the Tokens per frame (i.e., 8) as opposed to other methods which use $1 6 \times 1 6$ or $3 2 \times 3 2$ tokens.
|
| 179 |
+
|
| 180 |
+
One of the main benefits of the TokenLearner (in addition to the adaptive tokenization of the input and that we explicitly fuse the tokens to capture their spatio-temporal patterns) is that, unlike the disjoint space/time transformers used in this ablation study, it is a joint space-time transformer. Simultaneously, it still manages its computation to be much more tractable (as shown in Tables 6 and 7): A naive full version of the space-time transformer would require consideration of $8 { \times } 8 { \times } 6 4 = 4 0 9 6$ tokens in our case, building and multiply the attention tensor of size $4 0 9 6 \times 4 0 9 6$ . On the other hand, the TokenLearner learns to consider $8 \times 6 4 = 5 1 2$ tokens jointly.
|
| 181 |
+
|
| 182 |
+
More TokenLearner alternatives. We also compared our spatial attention-based token learning with alternative approaches: (1) using a fixed grid to split each frame into the same number of tokens (i.e., 8 tokens), (2) the approach of directly generating tokens using a fully connected layer, and (3) the approach of spatially average pooling the entire frame pixels and using fully connected layers to generate multiple tokens per frame. In the second approach, we directly model $z _ { i } = A _ { i } ( x )$ as a dense layer, producing $T \times S \times C$ tensor based on the $T \times H \times W \times C$ input. The third approach is similar, except that we apply spatial global average pooling per frame and then use MLP to generate tokens.
|
| 183 |
+
|
| 184 |
+
Table 7: Comparison between different space-time transformer modules. They were all applied to the same backbone architecture (i.e., the Bottleneck Transformer-style with $\mathbf { X } ( 2 { + } 1 ) \mathbf { D } )$ . The Charades-6fps is used in this experiment. FLOPS are estimated with 64-frame settings, per module.
|
| 185 |
+
|
| 186 |
+
<table><tr><td>Module</td><td>Charades-6fps (%)</td><td>GFLOPs</td><td># params</td></tr><tr><td>Conv2D + Conv1D</td><td>56.6</td><td>18.3</td><td>2.24M</td></tr><tr><td>Conv2D+MLPMixer [36]</td><td>57.0</td><td>13.8</td><td>2.06M</td></tr><tr><td>Conv2D + Temporal transformer</td><td>58.4</td><td>16.5</td><td>1.98M</td></tr><tr><td>Spatial + Temporal transformer</td><td>58.8</td><td>5.5</td><td>0.59M</td></tr><tr><td>Conv2D + Spatial + Temporal transformer</td><td>58.0</td><td>19.2</td><td>2.27M</td></tr><tr><td>Ours (TokenLearner)</td><td>58.8</td><td>3.4</td><td>0.81M</td></tr><tr><td>Ours (SpatialT + TokenLearner)</td><td>58.9</td><td>6.2</td><td>1.11M</td></tr><tr><td>Ours (Conv2D + TokenLearner)</td><td>59.6</td><td>17.2</td><td>2.49M</td></tr></table>
|
| 187 |
+
|
| 188 |
+
The fixed split tokenization method (1) provided us the accuracy of 58.8 on Charades, as opposed to 59.6 of ours. The direct token generation method (2) provided the accuracy of 56.6 on Charades, failing to obtain better tokens. Pooling and generation method (3) gave us the accuracy of 58.6. These results suggest the importance of spatial attention for the token learning, our TokenLearner. The same vector transformer and TokenFuser (from Section 2) were used for this ablation.
|
| 189 |
+
|
| 190 |
+
# 5 Related work
|
| 191 |
+
|
| 192 |
+
Video understanding relies on both the spatial and the temporal information in the video. In order to adequately capture both motion and appearance information in videos, full 3D space-time convolutional layers as well as $( 2 + 1 ) \mathrm { D }$ convolutional layers have been used [37, 5, 38, 44]. More advanced network designs have also been extremely popular in video CNNs particularly two-stream ones [32, 13, 14, 15, 8, 12] and, recently, architecture searched ones [11, 30, 26].
|
| 193 |
+
|
| 194 |
+
Attention-based architectures, e.g., the Transformer [39] have shown remarkable success in both Natural Language processing (NLP) and computer vision. Most adaptations of the Transformer architectures to computer vision, have been slow, although some optimizations, have been successful e.g., for image classification, [4, 45, 6, 28] and for video generation [42].
|
| 195 |
+
|
| 196 |
+
Applying attention-based architectures to video presents a definite challenge as the model needs to learn dependencies across both the spatial and temporal domains. The Vision Transformer [9] demonstrated how the NLP-specific Transformer architecture can elegantly work for images, by subdividing the input image into non-overlapping patches on a regular grid and feeding them as token embeddings to the Trasnformer, where $O ( \bar { N } ^ { 2 } )$ tokens are used or order of 256 or 1024. [16] relied on the region proposal network to use the detected human and object candidates as tokens, showing that it could be combined with CNNs.
|
| 197 |
+
|
| 198 |
+
A couple of recent work [2, 3], in the spirit of the Vision Transformer, subdivided the video into token in a 3D grid to capture the video input. This leads to $O ( N ^ { 3 } )$ increase in the number of tokens required for learning (typically $\sim 2 5 \mathrm { k }$ tokens for 96-frame model). Our work, in contrast, learns the tokens from data which results in a significantly fewer tokens, and more efficient approach. We see that even ${ } ^ { 8 \mathrm { { X } } }$ times fewer tokens (e.g., 512 vs 4096), when learned, are able to capture successfully the information needed for video representation learning.
|
| 199 |
+
|
| 200 |
+
# 6 Conclusions
|
| 201 |
+
|
| 202 |
+
We have presented TokenLearner, a novel approach for visual representation learning, which adaptively tokenizes the representations. The goal is to learn to extract important tokens in image frames and videos for the recognition tasks at hand. Our approach is more efficient, than contemporary work, by finding few important space-time tokens which can model visual representations of images and videos. We observe improved accuracies across challenging video understanding tasks, and outperformed prior approaches in many datasets. One of the remaining challenges is in learning full spatio-temporal tokens. The current TokenLearner focuses on finding spatial tokens over a sequence of frames, and it could be extended to directly mine tokens over space-time volumes.
|
| 203 |
+
|
| 204 |
+
# Acknowledgement
|
| 205 |
+
|
| 206 |
+
We thank Dmitry Kalashnikov, Andy Zeng, and Robotics at Google NYC team members for valuable discussions on attention mechanisms.
|
| 207 |
+
|
| 208 |
+
# References
|
| 209 |
+
|
| 210 |
+
[1] J.-B. Alayrac, A. Recasens, R. Schneider, R. Arandjelovic, J. Ramapuram, J. D. Fauw, L. Smaira, S. Diele- ´ man, and A. Zisserman. Self-supervised multimodal versatile networks. In Advances in Neural Information Processing Systems (NeurIPS), 2020.
|
| 211 |
+
[2] A. Arnab, M. Dehghani, G. Heigold, C. Sun, M. Luciˇ c, and C. Schmid. ViViT: A video vision transformer. ´ In Proceedings of the IEEE International Conference on Computer Vision (ICCV), 2021.
|
| 212 |
+
[3] G. Bertasius, H. Wang, and L. Torresani. Is space-time attention all you need for video understanding? In International Conference on Machine Learning (ICML), 2021. [4] N. Carion, F. Massa, G. Synnaeve, N. Usunier, A. Kirillov, and S. Zagoruyko. End-to-end object detection with transformers. In Proceedings of European Conference on Computer Vision (ECCV), 2020.
|
| 213 |
+
[5] J. Carreira and A. Zisserman. Quo vadis, action recognition? a new model and the kinetics dataset. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017.
|
| 214 |
+
[6] J. Cordonnier, A. Loukas, and M. Jaggi. On the relationship between self-attention and convolutional layers. In International Conference on Learning Representations (ICLR), 2020.
|
| 215 |
+
[7] M. Dehghani, A. Gritsenko, A. Arnab, M. Minderer, and Y. Tay. Scenic: A JAX library for computer vision research and beyond. arXiv preprint arXiv:2110.11403, 2021.
|
| 216 |
+
[8] A. Diba, M. Fayyaz, V. Sharma, M. Paluri, J. Gall, , R. Stiefelhagen, and L. V. Gool. Holistic large scale video understanding. arXiv preprint arXiv:1904.114511, 2019.
|
| 217 |
+
[9] A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly, J. Uszkoreit, and N. Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
|
| 218 |
+
[10] H. Fan, B. Xiong, K. Mangalam, Y. Li, Z. Yan, J. Malik, and C. Feichtenhofer. Multiscale vision transformers. arXiv preprint arXiv:2104.11227, 2021.
|
| 219 |
+
[11] C. Feichtenhofer. X3D: expanding architectures for efficient video recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2020.
|
| 220 |
+
[12] C. Feichtenhofer, H. Fan, J. Malik, and K. He. Slowfast networks for video recognition. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), 2019.
|
| 221 |
+
[13] C. Feichtenhofer, A. Pinz, and R. Wildes. Spatiotemporal residual networks for video action recognition. In Advances in Neural Information Processing Systems (NeurIPS), pages 3468–3476, 2016.
|
| 222 |
+
[14] C. Feichtenhofer, A. Pinz, and R. P. Wildes. Spatiotemporal multiplier networks for video action recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 4768– 4777, 2017.
|
| 223 |
+
[15] C. Feichtenhofer, A. Pinz, and A. Zisserman. Convolutional two-stream network fusion for video action recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 1933–1941, 2016.
|
| 224 |
+
[16] R. Girdhar, J. Carreira, C. Doersch, and A. Zisserman. Video action transformer network. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019.
|
| 225 |
+
[17] K. Hara, H. Kataoka, and Y. Satoh. Learning spatio-temporal features with 3d residual networks for action recognition. In Proceedings of the ICCV Workshop on Action, Gesture, and Emotion Recognition, 2017.
|
| 226 |
+
[18] J. Hu, L. Shen, S. Albanie, G. Sun, and E. Wu. Squeeze-and-excitation networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018.
|
| 227 |
+
[19] J. Ji, R. Krishna, L. Fei-Fei, and J. C. Niebles. Action genome: Actions as composition of spatio-temporal scene graphs. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020.
|
| 228 |
+
[20] S. Ji, W. Xu, M. Yang, and K. Yu. 3d convolutional neural networks for human action recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, 35(1):221–231, 2013.
|
| 229 |
+
[21] W. Kay, J. Carreira, K. Simonyan, B. Zhang, C. Hillier, S. Vijayanarasimhan, F. Viola, T. Green, T. Back, P. Natsev, et al. The kinetics human action video dataset. arXiv preprint arXiv:1705.06950, 2017.
|
| 230 |
+
[22] D. Kondratyuk, L. Yuan, Y. Li, L. Zhang, M. Tan, M. Brown, and B. Gong. Movinets: Mobile video networks for efficient video recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2021.
|
| 231 |
+
[23] Z. Liu, J. Ning, Y. Cao, Y. Wei, Z. Zhang, S. Lin, and H. Hu. Video swin transformer. arXiv preprint arXiv:2106.13230, 2021.
|
| 232 |
+
[24] M. Monfort, A. Andonian, B. Zhou, K. Ramakrishnan, S. A. Bargal, T. Yan, L. Brown, Q. Fan, D. Gutfruend, C. Vondrick, et al. Moments in time dataset: one million videos for event understanding. arXiv preprint arXiv:1801.03150, 2018.
|
| 233 |
+
[25] A. Piergiovanni, A. Angelova, and M. S. Ryoo. Evolving losses for unsupervised video representation learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020.
|
| 234 |
+
[26] A. Piergiovanni, A. Angelova, A. Toshev, and M. S. Ryoo. Evolving space-time neural architectures for videos. Proceedings of the IEEE International Conference on Computer Vision (ICCV), 2019.
|
| 235 |
+
[27] A. Piergiovanni and M. S. Ryoo. AViD dataset: Anonymized videos from diverse countries. In Advances in Neural Information Processing Systems (NeurIPS), 2020.
|
| 236 |
+
[28] P. Ramachandran, N. Parmar, A. Vaswani, I. Bello, A. Levskaya, and J. Shlens. Stand-alone self-attention in vision models. In Advances in Neural Information Processing Systems (NeurIPS), 2019.
|
| 237 |
+
[29] M. S. Ryoo, A. Piergiovanni, J. Kangaspunta, and A. Angelova. AssembleNet++: Assembling modality representations via attention connections. In Proceedings of European Conference on Computer Vision (ECCV), 2020.
|
| 238 |
+
[30] M. S. Ryoo, A. Piergiovanni, M. Tan, and A. Angelova. AssembleNet: Searching for multi-stream neural connectivity in video architectures. In International Conference on Learning Representations (ICLR), 2020.
|
| 239 |
+
[31] G. A. Sigurdsson, G. Varol, X. Wang, A. Farhadi, I. Laptev, and A. Gupta. Hollywood in homes: Crowdsourcing data collection for activity understanding. In Proceedings of European Conference on Computer Vision (ECCV), 2016.
|
| 240 |
+
[32] K. Simonyan and A. Zisserman. Two-stream convolutional networks for action recognition in videos. In Advances in Neural Information Processing Systems (NeurIPS), pages 568–576, 2014.
|
| 241 |
+
[33] A. Srinivas, T. Lin, N. Parmar, J. Shlens, P. Abbeel, and A. Vaswani. Bottleneck transformers for visual recognition. arXiv preprint arXiv:2101.11605, 2021.
|
| 242 |
+
[34] J. C. Stroud, D. A. Ross, C. Sun, J. Deng, and R. Sukthankar. D3D: Distilled 3d networks for video action recognition. arXiv preprint arXiv:1812.08249, 2018.
|
| 243 |
+
[35] C. Sun, A. Shrivastava, S. Singh, and A. Gupta. Revisiting unreasonable effectiveness of data in deep learning era. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), 2017.
|
| 244 |
+
[36] I. Tolstikhin, N. Houlsby, A. Kolesnikov, L. Beyer, X. Zhai, T. Unterthiner, J. Yung, A. Steiner, D. Keysers, J. Uszkoreit, M. Lucic, and A. Dosovitskiy. Mlp-mixer: An all-mlp architecture for vision. arXiv preprint arXiv:2105.01601, 2021.
|
| 245 |
+
[37] D. Tran, L. D. Bourdev, R. Fergus, L. Torresani, and M. Paluri. C3d: generic features for video analysis. CoRR, abs/1412.0767, 2(7):8, 2014.
|
| 246 |
+
[38] D. Tran, H. Wang, L. Torresani, J. Ray, Y. LeCun, and M. Paluri. A closer look at spatiotemporal convolutions for action recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 6450–6459, 2018.
|
| 247 |
+
[39] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and I. Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems (NeurIPS), 2017.
|
| 248 |
+
[40] 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 (CVPR), pages 7794–7803, 2018.
|
| 249 |
+
[41] X. Wang and A. Gupta. Videos as space-time region graphs. In Proceedings of European Conference on Computer Vision (ECCV), pages 399–417, 2018.
|
| 250 |
+
[42] D. Weissenborn, O. Täckström, and J. Uszkoreit. Scaling autoregressive video models. In International Conference on Learning Representations (ICLR), 2020.
|
| 251 |
+
[43] C.-Y. Wu, C. Feichtenhofer, H. Fan, K. He, P. Krähenbühl, and R. Girshick. Long-term feature banks for detailed video understanding. arXiv preprint arXiv:1812.05038, 2018.
|
| 252 |
+
[44] S. Xie, C. Sun, J. Huang, Z. Tu, and K. Murphy. Rethinking spatiotemporal feature learning: Speedaccuracy trade-offs in video classification. In Proceedings of European Conference on Computer Vision (ECCV), pages 305–321, 2018.
|
| 253 |
+
[45] H. Zhao, J. Jia, and V. Koltun. Exploring self-attention for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2020.
|