Datasets:
Add files using upload-large-folder tool
Browse files- md/train/6OoCDvFV4m/6OoCDvFV4m.md +321 -0
- md/train/6vaActvpcp3/6vaActvpcp3.md +384 -0
- md/train/B1ckMDqlg/B1ckMDqlg.md +482 -0
- md/train/BJg4NgBKvH/BJg4NgBKvH.md +233 -0
- md/train/BJgQfkSYDS/BJgQfkSYDS.md +0 -0
- md/train/BJlVeyHFwH/BJlVeyHFwH.md +613 -0
- md/train/BJlZ5ySKPH/BJlZ5ySKPH.md +305 -0
- md/train/Bkg2viA5FQ/Bkg2viA5FQ.md +0 -0
- md/train/Bkx0RjA9tX/Bkx0RjA9tX.md +342 -0
- md/train/Bkxbrn0cYX/Bkxbrn0cYX.md +360 -0
- md/train/ByMHvs0cFQ/ByMHvs0cFQ.md +672 -0
- md/train/Byey7n05FQ/Byey7n05FQ.md +412 -0
- md/train/D2TE6VTJG9/D2TE6VTJG9.md +0 -0
- md/train/Ec85b0tUwbA/Ec85b0tUwbA.md +0 -0
- md/train/FjnCWyzXu8m/FjnCWyzXu8m.md +420 -0
- md/train/H1Heentlx/H1Heentlx.md +289 -0
- md/train/H1goBoR9F7/H1goBoR9F7.md +421 -0
- md/train/H1q-TM-AW/H1q-TM-AW.md +487 -0
- md/train/HJMC_iA5tm/HJMC_iA5tm.md +201 -0
- md/train/HkeSdCEtDS/HkeSdCEtDS.md +269 -0
- md/train/HklBjCEKvH/HklBjCEKvH.md +267 -0
- md/train/HyxoX6EKvB/HyxoX6EKvB.md +354 -0
- md/train/KAV7BDCcN6/KAV7BDCcN6.md +521 -0
- md/train/Kloou2uk_Rz/Kloou2uk_Rz.md +473 -0
- md/train/O358nrve1W/O358nrve1W.md +397 -0
- md/train/Q2iaAc-4I1v/Q2iaAc-4I1v.md +316 -0
- md/train/S1HlA-ZAZ/S1HlA-ZAZ.md +356 -0
- md/train/SkNQeiRpb/SkNQeiRpb.md +192 -0
- md/train/Skvd-myR-/Skvd-myR-.md +327 -0
- md/train/Sy4tzwqxe/Sy4tzwqxe.md +314 -0
- md/train/SyxrxR4KPS/SyxrxR4KPS.md +320 -0
- md/train/Uj7pF-D-YvT/Uj7pF-D-YvT.md +244 -0
- md/train/a5KvtsZ14ev/a5KvtsZ14ev.md +243 -0
- md/train/b7ZRqEFXdQ/b7ZRqEFXdQ.md +361 -0
- md/train/bMCfFepJXM/bMCfFepJXM.md +375 -0
- md/train/chPj_I5KMHG/chPj_I5KMHG.md +403 -0
- md/train/e5vrkfc5aau/e5vrkfc5aau.md +288 -0
- md/train/gIHd-5X324/gIHd-5X324.md +320 -0
- md/train/oXSw7laxwUpln/oXSw7laxwUpln.md +200 -0
- md/train/r-oRRT-ElX/r-oRRT-ElX.md +247 -0
- md/train/r14EOsCqKX/r14EOsCqKX.md +281 -0
- md/train/r1YqWz-R-/r1YqWz-R-.md +256 -0
- md/train/r1ZdKJ-0W/r1ZdKJ-0W.md +280 -0
- md/train/r1lPleBFvH/r1lPleBFvH.md +382 -0
- md/train/rkeqn1rtDH/rkeqn1rtDH.md +428 -0
- md/train/rklaWn0qK7/rklaWn0qK7.md +423 -0
- md/train/ryG6xZ-RZ/ryG6xZ-RZ.md +169 -0
- md/train/ryenvpEKDr/ryenvpEKDr.md +464 -0
- md/train/ryxB0Rtxx/ryxB0Rtxx.md +483 -0
- md/train/xN3XX6pKSD5/xN3XX6pKSD5.md +339 -0
md/train/6OoCDvFV4m/6OoCDvFV4m.md
ADDED
|
@@ -0,0 +1,321 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Deep Residual Learning in Spiking Neural Networks
|
| 2 |
+
|
| 3 |
+
Wei Fang1,2, Zhaofei $\mathrm { { Y u ^ { 1 , 2 * } } }$ , Yanqi Chen1,2,
|
| 4 |
+
|
| 5 |
+
Tiejun Huang1,2, Timothée Masquelier3, Yonghong Tian1,2∗
|
| 6 |
+
|
| 7 |
+
1Department of Computer Science and Technology, Peking University 2Peng Cheng Laboratory, Shenzhen 518055, China 3Centre de Recherche Cerveau et Cognition, UMR5549 CNRS - Univ. Toulouse 3 , Toulouse, France
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
Deep Spiking Neural Networks (SNNs) present optimization difficulties for gradient-based approaches due to discrete binary activation and complex spatialtemporal dynamics. Considering the huge success of ResNet in deep learning, it would be natural to train deep SNNs with residual learning. Previous Spiking ResNet mimics the standard residual block in ANNs and simply replaces ReLU activation layers with spiking neurons, which suffers the degradation problem and can hardly implement residual learning. In this paper, we propose the spikeelement-wise (SEW) ResNet to realize residual learning in deep SNNs. We prove that the SEW ResNet can easily implement identity mapping and overcome the vanishing/exploding gradient problems of Spiking ResNet. We evaluate our SEW ResNet on ImageNet, DVS Gesture, and CIFAR10-DVS datasets, and show that SEW ResNet outperforms the state-of-the-art directly trained SNNs in both accuracy and time-steps. Moreover, SEW ResNet can achieve higher performance by simply adding more layers, providing a simple method to train deep SNNs. To our best knowledge, this is the first time that directly training deep SNNs with more than 100 layers becomes possible. Our codes are available at https: //github.com/fangwei123456/Spike-Element-Wise-ResNet.
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
Artificial Neural Networks (ANNs) have achieved great success in many tasks, including image classification [28, 52, 55], object detection [9, 34, 44], machine translation [2], and gaming [37, 51]. One of the critical factors for ANNs’ success is deep learning [29], which uses multi-layers to learn representations of data with multiple levels of abstraction. It has been proved that deeper networks have advantages over shallower networks in computation cost and generalization ability [3]. The function represented by a deep network can require an exponential number of hidden units by a shallow network with one hidden layer [38]. In addition, the depth of the network is closely related to the network’s performance in practical tasks [52, 55, 27, 52]. Nevertheless, recent evidence [13, 53, 14] reveals that with the network depth increasing, the accuracy gets saturated and then degrades rapidly. To solve this degradation problem, residual learning is proposed [14, 15] and the residual structure is widely exploited in “very deep” networks that achieve the leading performance [22, 59, 18, 57].
|
| 16 |
+
|
| 17 |
+
Spiking Neural Networks (SNNs) are regarded as a potential competitor of ANNs for their high biological plausibility, event-driven property, and low power consumption [45]. Recently, deep learning methods are introduced into SNNs, and deep SNNs have achieved close performance as ANNs in some simple classification datasets [56], but still worse than ANNs in complex tasks, e.g., classifying the ImageNet dataset [47]. To obtain higher performance SNNs, it would be natural to explore deeper network structures like ResNet. Spiking ResNet [25, 60, 21, 17, 49, 12, 30, 64, 48, 42, 43], as the spiking version of ResNet, is proposed by mimicking the residual block in ANNs and replacing ReLU activation layers with spiking neurons. Spiking ResNet converted from ANN achieves state-of-the-art accuracy on nearly all datasets, while the directly trained Spiking ResNet has not been validated to solve the degradation problem.
|
| 18 |
+
|
| 19 |
+
In this paper, we show that Spiking ResNet is inapplicable to all neuron models to achieve identity mapping. Even if the identity mapping condition is met, Spiking ResNet suffers from the problems of vanishing/exploding gradient. Thus, we propose the Spike-Element-Wise (SEW) ResNet to realize residual learning in SNNs. We prove that the SEW ResNet can easily implement identity mapping and overcome the vanishing/exploding gradient problems at the same time. We evaluate Spiking ResNet and SEW ResNet on both the static ImageNet dataset and the neuromorphic DVS Gesture dataset [1], CIFAR10-DVS dataset [32]. The experiment results are consistent with our analysis, indicating that the deeper Spiking ResNet suffers from the degradation problem — the deeper network has higher training loss than the shallower network, while SEW ResNet can achieve higher performance by simply increasing the network’s depth. Moreover, we show that SEW ResNet outperforms the state-of-the-art directly trained SNNs in both accuracy and time-steps. To the best of our knowledge, this is the first time to explore the directly-trained deep SNNs with more than 100 layers.
|
| 20 |
+
|
| 21 |
+
# 2 Related Work
|
| 22 |
+
|
| 23 |
+
# 2.1 Learning Methods of Spiking Neural Networks
|
| 24 |
+
|
| 25 |
+
ANN to SNN conversion (ANN2SNN) [20, 4, 46, 49, 12, 11, 6, 54, 33] and backpropagation with surrogate gradient [40] are the two main methods to get deep SNNs. The ANN2SNN method firstly trains an ANN with ReLU activation, then converts the ANN to an SNN by replacing ReLU with spiking neurons and adding scaling operations like weight normalization and threshold balancing. Some recent conversion methods have achieved near loss-less accuracy with VGG-16 and ResNet [12, 11, 6, 33]. However, the converted SNN needs a longer time to rival the original ANN in precision as the conversion is based on rate-coding [46], which increases the SNN’s latency and restricts the practical application. The backpropagation methods can be classified into two categories [26]. The method in the first category computes the gradient by unfolding the network over the simulation timesteps [31, 19, 58, 50, 30, 40], which is similar to the idea of backpropagation through time (BPTT). As the gradient with respect to the threshold-triggered firing is non-differentiable, the surrogate gradient is often used. The SNN trained by the surrogate method is not limited to rate-coding, and can also be applied on temporal tasks, e.g., classifying neuromorphic datasets [58, 8, 16]. The second method computes the gradients of the timings of existing spikes with respect to the membrane potential at the spike timing [5, 39, 24, 65, 63].
|
| 26 |
+
|
| 27 |
+
# 2.2 Spiking Residual Structure
|
| 28 |
+
|
| 29 |
+
Previous ANN2SNN methods noticed the distinction between plain feedforward ANNs and residual ANNs, and made specific normalization for conversion. Hu et al. [17] were the first to apply the residual structure in ANN2SNN with scaled shortcuts in SNN to match the activations of the original ANN. Sengupta et al. [49] proposed Spike-Norm to balance SNN’s threshold and verified their method by converting VGG and ResNet to SNNs. Existing backpropagation-based methods use nearly the same structure from ResNet. Lee et al. [30] evaluated their custom surrogate methods on shallow ResNets whose depths are no more than ResNet-11. Zheng et al. [64] proposed the threshold-dependent batch normalization (td-BN) to replace naive batch normalization (BN) [23] and successfully trained Spiking ResNet-34 and Spiking ResNet-50 directly with surrogate gradient by adding td-BN in shortcuts.
|
| 30 |
+
|
| 31 |
+
# 3 Methods
|
| 32 |
+
|
| 33 |
+
# 3.1 Spiking Neuron Model
|
| 34 |
+
|
| 35 |
+
The spiking neuron is the fundamental computing unit of SNNs. Similar to Fang et al. [8], we use a unified model to describe the dynamics of all kinds of spiking neurons, which includes the following
|
| 36 |
+
|
| 37 |
+

|
| 38 |
+
Figure 1: Residual blocks in ResNet, Spiking ResNet and SEW ResNet.
|
| 39 |
+
|
| 40 |
+
discrete-time equations:
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
\begin{array} { l } { { H [ t ] = f ( V [ t - 1 ] , X [ t ] ) , } } \\ { { S [ t ] = \Theta ( H [ t ] - V _ { t h } ) , } } \\ { { V [ t ] = H [ t ] \ ( 1 - S [ t ] ) + V _ { r e s e t } \ S [ t ] , } } \end{array}
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
where $X [ t ]$ is the input current at time-step $t , H [ t ]$ and $V [ t ]$ denote the membrane potential after neuronal dynamics and after the trigger of a spike at time-step $t$ , respectively. $V _ { t h }$ is the firing threshold, $\Theta ( x )$ is the Heaviside step function and is defined by $\Theta ( x ) = 1$ for $x \geq 0$ and $\Theta ( x ) = { \bar { 0 } }$ for $x < 0 , S [ t ]$ is the output spike at time-step $t$ , which equals 1 if there is a spike and 0 otherwise. $V _ { r e s e t }$ denotes the reset potential. The function $f ( \cdot )$ in Eq. (1) describes the neuronal dynamics and takes different forms for different spiking neuron models. For example, the function $f ( \cdot )$ for the Integrate-and-Fire (IF) model and Leaky Integrate-and-Fire (LIF) model can be described by Eq. (4) and Eq. (5), respectively.
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\begin{array} { l } { \displaystyle H [ t ] = V [ t - 1 ] + X [ t ] , } \\ { \displaystyle H [ t ] = V [ t - 1 ] + \frac { 1 } { \tau } ( X [ t ] - ( V [ t - 1 ] - V _ { r e s e t } ) ) , } \end{array}
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
where $\tau$ represents the membrane time constant. Eq. (2) and Eq. (3) describe the spike generation and resetting processes, which are the same for all kinds of spiking neuron models. In this paper, the surrogate gradient method is used to define $\Theta ^ { \prime } ( x ) \triangleq \sigma ^ { \prime } ( x )$ during error back-propagation, with $\sigma ( x )$ denoting the surrogate function.
|
| 53 |
+
|
| 54 |
+
# 3.2 Drawbacks of Spiking ResNet
|
| 55 |
+
|
| 56 |
+
The residual block is the key component of ResNet. Fig. 1(a) shows the basic block in ResNet [14], where $X ^ { l } , Y ^ { l }$ are the input and output of the $l$ -th block in ResNet, Conv is the convolutional layer, BN denotes batch normalization, and ReLU denotes the rectified linear unit activation layer. The basic block of Spiking ResNet used in [64, 17, 30] simply mimics the block in ANNs by replacing ReLU activation layers with spiking neurons (SN), which is illustrated in Fig. 1(b). Here ${ \dot { S } } ^ { l } [ t { \bar { ] } } , O ^ { l } [ t ]$ are the input and output of the $l$ -th block in Spiking ResNet at time-step $t$ . Based on the above definition, we will analyze the drawbacks of Spiking ResNet below.
|
| 57 |
+
|
| 58 |
+
Spiking ResNet is inapplicable to all neuron models to achieve identity mapping. One of the critical concepts in ResNet is identity mapping. He et al. [14] noted that if the added layers implement the identity mapping, a deeper model should have training error no greater than its shallower counterpart. However, it is unable to train the added layers to implement identity mapping in a feasible time, resulting in deeper models performing worse than shallower models (the degradation problem). To solve this problem, the residual learning is proposed by adding a shortcut connection (shown in Fig. 1(a)). If we use $\mathcal { F } ^ { l }$ to denote the residual mapping, e.g., a stack of two convolutional layers, of the $l$ -th residual block in ResNet and Spiking ResNet, then the residual block in Fig.1(a)
|
| 59 |
+
|
| 60 |
+
and Fig.1(b) can be formulated as
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\begin{array} { r } { Y ^ { l } = \mathrm { R e L U } ( \mathcal { F } ^ { l } ( X ^ { l } ) + X ^ { l } ) , } \\ { O ^ { l } [ t ] = \mathrm { S N } ( \mathcal { F } ^ { l } ( S ^ { l } [ t ] ) + S ^ { l } [ t ] ) . } \end{array}
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
The residual block of Eq. (6) make it easy to implement identity mapping in ANNs. To see this, when $\mathcal { F } ^ { l } ( X ^ { l } ) \equiv 0$ , $Y ^ { l } = \mathrm { R e L U } ( \mathbf { X } ^ { \ l } )$ . In most cases, $X ^ { l }$ is the activation of the previous ReLU layer and $X ^ { l } \ge 0$ . Thus, $Y ^ { l } = \mathrm { R e L U } ( X ^ { l } ) = X ^ { l }$ , which is identity mapping.
|
| 67 |
+
|
| 68 |
+
Different from ResNet, the residual block in Spiking ResNet (Eq. (7)) restricts the models of spiking neuron to implement identity mapping. When $\dot { \mathcal { F } } ^ { l } ( S ^ { \tilde { l } } [ t ] ) \equiv 0$ , $O ^ { l } [ t ] = \operatorname { S N } ( S ^ { l } [ t ] ) \neq S ^ { l } [ t ]$ . To transmit $S ^ { l } [ t ]$ and make $\mathrm { S N } ( S ^ { l } [ t ] ) = S ^ { l } [ t ]$ , the last spiking neuron (SN) in the $l$ -th residual block needs to fire a spike after receiving a spike, and keep silent after receiving no spike at time-step $t$ . It works for IF neuron described by Eq. (4). Specifically, we can set $0 < V _ { t h } \le 1$ and $V [ t - 1 ] = 0$ to ensure that $X [ t ] = 1$ leads to $H [ t ] \geq V _ { t h }$ , and $X [ t ] \stackrel { \cdot } { = } 0$ leads to $H [ t ] < V _ { t h }$ . However, when considering some spiking neuron models with complex neuronal dynamics, it is hard to achieve $\mathrm { S N } ( S ^ { l } [ t ] ) = S ^ { l } [ t ]$ . For example, the LIF neuron used in [66, 8, 61] considers a learnable membrane time constant $\tau$ , the neuronal dynamics of which can be described with Eq. (5). When $X [ t ] = 1$ and $V [ t - 1 ] = 0$ , $\begin{array} { r } { H [ t ] = \frac { 1 } { \tau } } \end{array}$ . It is difficult to find a firing threshold that ensures $H [ t ] > V _ { t h }$ as $\tau$ is being changed in training by the optimizer.
|
| 69 |
+
|
| 70 |
+
Spiking ResNet suffers from the problems of vanishing/exploding gradient. Consider a spiking ResNet with $k$ sequential blocks to transmit $S ^ { l } [ t ]$ , and the identity mapping condition is met, e.g., the spiking neurons are the IF neurons with $0 < V _ { t h } \le 1$ , then we have $S ^ { l } [ t ] = S ^ { l + 1 } [ t ] = \ldots =$ $S ^ { l + k - 1 } [ t ] = O ^ { l + k - 1 } [ t ]$ . Denote the $j$ -th element in $S ^ { l } [ t ]$ and $O ^ { l } [ t ]$ as $S _ { j } ^ { l } [ t ]$ and $O _ { j } ^ { l } [ t ]$ respectively, the gradient of the output of the $( l + k - 1 )$ -th residual block with respect to the input of the $l$ -th residual block can be calculated layer by layer:
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\frac { \partial O _ { j } ^ { l + k - 1 } [ t ] } { \partial S _ { j } ^ { l } [ t ] } = \prod _ { i = 0 } ^ { k - 1 } \frac { \partial O _ { j } ^ { l + i } [ t ] } { \partial S _ { j } ^ { l + i } [ t ] } = \prod _ { i = 0 } ^ { k - 1 } \Theta ^ { \prime } ( S _ { j } ^ { l + i } [ t ] - V _ { t h } ) \{ \begin{array} { l l } { 0 , \mathbf { i f } \Theta < \Theta ^ { \prime } ( S _ { j } ^ { l } [ t ] - V _ { t h } ) < 1 } \\ { 1 , \mathbf { i f } \Theta ^ { \prime } ( S _ { j } ^ { l } [ t ] - V _ { t h } ) = 1 } \\ { + \infty , \mathbf { i f } \Theta ^ { \prime } ( S _ { j } ^ { l } [ t ] - V _ { t h } ) > 1 } \end{array} ,
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
where $\Theta ( x )$ is the Heaviside step function and $\Theta ^ { \prime } ( x )$ is defined by the surrogate gradient. The second equality hold as $O _ { j } ^ { l + i } [ t ] = \mathrm { S N } ( S _ { j } ^ { l + i } [ t ] )$ . In view of the fact that $S _ { j } ^ { l } [ t ]$ can only take 0 or 1, $\Theta ^ { \prime } ( S _ { j } ^ { l } [ t ] - V _ { t h } ) = 1$ is not satisfied for commonly used surrogate functions mentioned in [40]. Thus, the vanishing/exploding gradient problems are prone to happen in deeper Spiking ResNet.
|
| 77 |
+
|
| 78 |
+
Based on the above analysis, we believe that the previous Spiking ResNet ignores the highly nonlinear caused by spiking neurons, and can hardly implement residual learning. Nonetheless, the basic block in Fig. 1(b) is still decent for ANN2SNN with extra normalization [17, 49], as the SNN converted from ANN aims to use firing rates to match the origin ANN’s activations.
|
| 79 |
+
|
| 80 |
+
# 3.3 Spike-Element-Wise ResNet
|
| 81 |
+
|
| 82 |
+
Here we propose the Spike-Element-Wise (SEW) residual block to realize the residual learning in SNNs, which can easily implement identity mapping and overcome the vanishing/exploding gradient problems at the same time. As illustrated in Fig. 1(c), the SEW residual block can be formulated as:
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
O ^ { l } [ t ] = g ( \mathrm { S N } ( \mathcal { F } ^ { l } ( S ^ { l } [ t ] ) ) , S ^ { l } [ t ] ) = g ( A ^ { l } [ t ] , S ^ { l } [ t ] ) ,
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
where $g$ represents an element-wise function with two spikes tensor as inputs. Here we use $A ^ { l } [ t ]$ to denote the residual mapping to be learned as $A ^ { l } [ t ] = \mathrm { S N } ( \mathcal { F } ^ { l } ( S ^ { l } [ t ] ) )$ .
|
| 89 |
+
|
| 90 |
+
SEW ResNet can easily implement identity mapping. By utilizing the binary property of spikes, we can find different element-wise functions $g$ that satisfy identity mapping (shown in Tab. 1). To be specific, when choosing $A D D$ and IAND as element-wise functions $g$ , identity mapping is achieved by setting $A ^ { l } [ t ] \equiv 0$ , which can be implemented simply by setting the weights and the bias of the last batch normalization layer (BN) in $\mathcal { F } ^ { l }$ to zero. Then we can get $O ^ { l } [ t ] \stackrel { - } { = } g ( A ^ { l } [ t ] , S ^ { l } [ t ] ) = g ( \mathrm { S N } ( 0 ) , S ^ { l } [ t ] ) = g ( 0 , S ^ { l } [ t ] ) \stackrel { - } { = } S ^ { l } [ t ]$ . This is applicable to all neuron models. When using AND as the element-wise function $g$ , we set $A ^ { l } [ t ] \equiv 1$ to get identity mapping. It can be implemented by setting the last BN’s weights to zero and the bias to a large enough constant to cause spikes, e.g., setting the bias as $V _ { t h }$ when the last SN is IF neurons. Then we have $O ^ { l } [ t ] = 1 \land S ^ { l } [ \dot { t } ] = S ^ { l } [ t ]$ . Note that using AND may suffer from the same problem as Spiking ResNet. It is hard to control some spiking neuron models with complex neuronal dynamics to generate spikes at a specified time-step.
|
| 91 |
+
|
| 92 |
+
Table 1: List of element-wise functions $g$
|
| 93 |
+
|
| 94 |
+
<table><tr><td>Name</td><td>Expression of g(A[t],S[t])</td></tr><tr><td>ADD</td><td>A[t]+S[t]</td></tr><tr><td>AND</td><td>A[t]△s[]=A[]·S[]</td></tr><tr><td>IAND</td><td>(-Al[t])△S‘[t]=(1-A[t])):S[t]</td></tr></table>
|
| 95 |
+
|
| 96 |
+

|
| 97 |
+
Figure 2: Downsample blocks in Spiking ResNet and SEW ResNet.
|
| 98 |
+
|
| 99 |
+
Formulation of downsample block. Remarkably, when the input and output of one block have different dimensions, the shortcut is set as convolutional layers with stride $> 1$ , rather than the identity connection, to perform downsampling. The ResNet and the Spiking ResNet utilize {ConvBN} without ReLU in shortcut (Fig. 2(a)). In contrast, we add a SN in shortcut (Fig. 2(b)).
|
| 100 |
+
|
| 101 |
+
SEW ResNet can overcome vanishing/exploding gradient. The SEW block is similar to ReLU before addition (RBA) block [15] in ANNs, which can be formulated as
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
Y ^ { l } = \mathrm { R e L U } ( \mathcal { F } ^ { l } ( X ^ { l } ) ) + X ^ { l } .
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
The RBA block is criticized by He et al. [15] for $X ^ { l + 1 } = Y ^ { l } \geq X ^ { l }$ , which will cause infinite outputs in deep layers. The experiment results in [15] also showed that the performance of the RBA block is worse than the basic block (Fig.1(a)). To some extent, the SEW block is an extension of the RBA block. Note that using $A N D$ and IAND as $g$ will output spikes (i.e. binary tensors), which means that the infinite outputs problem in ANNs will never occur in SNNs with SEW blocks, since all spikes are less or equal than 1. When choosing $A D D$ as $g$ , the infinite outputs problem can be relieved as the output of $k$ sequential SEW blocks will be no larger than $k + 1$ . In addition, a downsample SEW block will regulate the output to be no larger than 2 when $g$ is $A D D$ .
|
| 108 |
+
|
| 109 |
+
When the identity mapping is implemented, the gradient of the output of the $( l + k - 1 )$ -th SEW block with respect to the input of the $l$ -th SEW block can be calculated layer by layer:
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\frac { \partial O _ { j } ^ { l + k - 1 } [ t ] } { \partial S _ { j } ^ { l } [ t ] } = \prod _ { i = 0 } ^ { k - 1 } \frac { \partial g ( A _ { j } ^ { l + i } [ t ] , S _ { j } ^ { l + i } [ t ] ) } { \partial S _ { j } ^ { l + i } [ t ] } = \left\{ \prod _ { i = 0 } ^ { k - 1 } \frac { \partial ( ( \boldsymbol { 0 } + S _ { j } ^ { l + i } [ t ] ) } { \partial S _ { j } ^ { l + i } [ t ] } , \mathrm { i f ~ } g = A D D \right. \qquad = 1 .
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
The second equality holds as identity mapping is achieved by setting $A ^ { l + i } [ t ] \equiv 1$ for $g = A N D$ , and $A ^ { l + i } [ t ] \equiv 0$ for $g = A D D / I A N D$ . Since the gradient in Eq. (11) is a constant, the SEW ResNet can overcome the vanishing/exploding gradient problems.
|
| 116 |
+
|
| 117 |
+
# 4 Experiments
|
| 118 |
+
|
| 119 |
+
# 4.1 ImageNet Classification
|
| 120 |
+
|
| 121 |
+
As the test server of ImageNet 2012 is no longer available, we can not report the actual test accuracy.
|
| 122 |
+
Instead, we use the accuracy on the validation set as the test accuracy, which is the same as [17, 64].
|
| 123 |
+
|
| 124 |
+

|
| 125 |
+
Figure 3: Comparison of the training loss, training accuracy and test accuracy on ImageNet.
|
| 126 |
+
|
| 127 |
+
<table><tr><td rowspan="2">Network</td><td colspan="2">SEWResNet (ADD)</td><td colspan="2">Spiking ResNet</td></tr><tr><td>Acc@1(%)</td><td>Acc@5(%)</td><td>Acc@1(%)</td><td>Acc@5(%)</td></tr><tr><td>ResNet-18</td><td>63.18</td><td>84.53</td><td>62.32</td><td>84.05</td></tr><tr><td>ResNet-34</td><td>67.04</td><td>87.25</td><td>61.86</td><td>83.69</td></tr><tr><td>ResNet-50</td><td>67.78</td><td>87.52</td><td>57.66</td><td>80.43</td></tr><tr><td>ResNet-101</td><td>68.76</td><td>88.25</td><td>31.79</td><td>54.91</td></tr><tr><td>ResNet-152</td><td>69.26</td><td>88.57</td><td>10.03</td><td>23.57</td></tr></table>
|
| 128 |
+
|
| 129 |
+
Table 2: Test accuracy on ImageNet.
|
| 130 |
+
|
| 131 |
+
He et al. [14] evaluated the 18/34/50/101/152-layer ResNets on the ImageNet dataset. For comparison, we consider the SNNs with the same network architectures, except that the basic residual block (Fig.1(a)) is replaced by the spiking basic block (Fig.1(b)) and SEW block (Fig.1(c)) with $g$ as $A D D$ , respectively. We denote the SNN with the basic block as Spiking ResNet and the SNN with the SEW block as SEW ResNet. The IF neuron model is adopted for the static ImageNet dataset. During training on ImageNet, we find that the Spiking ResNet-50/101/152 can not converge unless we use the zero initialization [10], which sets all blocks to be an identity mapping at the start of training. Thus, the results of Spiking ResNet-18/34/50/101/152 reported in this paper are with zero initialization.
|
| 132 |
+
|
| 133 |
+
Spiking ResNet vs. SEW ResNet. We first evaluate the performance of Spiking ResNet and SEW ResNet. Tab. 2 reports the test accuracy on ImageNet validation. The results show that the deeper 34-layer Spiking ResNet has lower test accuracy than the shallower 18-layer Spiking ResNet. As the layer increases, the test accuracy of Spiking ResNet decreases. To reveal the reason, we compare the training loss, training accuracy, and test accuracy of Spiking ResNet during the training procedure, which is shown in Fig. 3. We can find the degradation problem of the Spiking ResNet — the deeper network has higher training loss than the shallower network. In contrast, the deeper 34-layer SEW ResNet has higher test accuracy than the shallower 18-layer SEW ResNet (shown in Tab. 2). More importantly, it can be found from Fig. 3 that the training loss of our SEW ResNet decreases and the training/test accuracy increases with the increase of depth, which indicates that we can obtain higher performance by simply increasing the network’s depth. All these results imply that the degradation problem is well addressed by SEW ResNet.
|
| 134 |
+
|
| 135 |
+
Comparisons with State-of-the-art Methods. In Tab. 3, we compare SEW ResNet with previous Spiking ResNets that achieve the best results on ImageNet. To our best knowledge, the SEW ResNet101 and the SEW ResNet-152 are the only SNNs with more than 100 layers to date, and there are no other networks with the same structure to compare. When the network structure is the same, our SEW ResNet outperforms the state-of-the-art accuracy of directly trained Spiking ResNet, even with fewer time-steps $T$ . The accuracy of SEW ResNet-34 is slightly lower than Spiking ResNet-34 (large) with td-BN $( 6 7 . 0 4 \%$ v.s. $6 7 . 0 5 \%$ ), which uses 1.5 times as many simulating time-steps $T$ (6 v.s. 4) and 4 times as many the number of parameters (85.5M v.s. 21.8M), compared with our SEW ResNet. The state-of-the-art ANN2SNN methods [33, 17] have better accuracy than our SEW ResNet, but they respectively use 64 and 87.5 times as many time-steps as ours.
|
| 136 |
+
|
| 137 |
+
<table><tr><td>Network</td><td>Methods</td><td>Accuracy(%)</td><td>T</td></tr><tr><td>SEW ResNet-34</td><td>Spike-based BP</td><td>67.04</td><td>4</td></tr><tr><td>Spiking ResNet-34(large)† with td-BN [64]</td><td>Spike-based BP</td><td>67.05</td><td>6</td></tr><tr><td>Spiking ResNet-34 with td-BN [64]</td><td>Spike-based BP</td><td>63.72</td><td>6</td></tr><tr><td>Spiking ResNet-34 [12]</td><td>ANN2SNN</td><td>69.89</td><td>4096</td></tr><tr><td>Spiking ResNet-34 [49]</td><td>ANN2SNN</td><td>65.47</td><td>2000</td></tr><tr><td>Spiking ResNet-34 [33]</td><td>ANN2SNN</td><td>74.61</td><td>256</td></tr><tr><td>Spiking ResNet-34 [43]</td><td>ANN2SNN and Spike-based BP</td><td>61.48</td><td>250</td></tr><tr><td>SEW ResNet-50</td><td>Spike-basedBP</td><td>67.78</td><td>4</td></tr><tr><td>Spiking ResNet-50 with td-BN [64]</td><td>Spike-based BP</td><td>64.88</td><td>6</td></tr><tr><td>Spiking ResNet-50 [17]</td><td>ANN2SNN</td><td>72.75</td><td>350</td></tr><tr><td>SEWResNet-101</td><td>Spike-based BP</td><td>68.76</td><td>4</td></tr><tr><td>SEWResNet-152</td><td>Spike-basedBP</td><td>69.26</td><td>4</td></tr></table>
|
| 138 |
+
|
| 139 |
+
Table 3: Comparison with previous Spiking ResNet on ImageNet. † has the same network structure as the standard Spiking ResNet-34, but uses four times as many the number of convolution kernels.
|
| 140 |
+
|
| 141 |
+

|
| 142 |
+
Figure 4: Firing rates of $A ^ { l }$ in SEW blocks on ImageNet.
|
| 143 |
+
|
| 144 |
+
Analysis of spiking response of SEW blocks. Fig. 4 shows the firing rates of $A ^ { l }$ in SEW ResNet18/34/50/101/152 on ImageNet. There are 7 blocks in SEW ResNet-18, 15 blocks in SEW ResNet-34 and SEW ResNet-50, 33 blocks in SEW ResNet-101, and 50 blocks in SEW ResNet-152. The downsample SEW blocks are marked by the triangle down symbol $\bigtriangledown$ . As we choose $A D D$ as elementwise functions $g$ , a lower firing rate means that the SEW block gets closer to implementing identity mapping, except for downsample blocks. Note that the shortcuts of downsample blocks are not identity mapping, which is illustrated in Fig. 2(b). Fig. 4 shows that all spiking neurons in SEW blocks have low firing rates, and the spiking neurons in the last two blocks even have firing rates of almost zero. As the time-steps $T$ is 4 and firing rates are no larger than 0.25, all neurons in SEW ResNet-18/34/50 fire on average no more than one spike during the whole simulation. Besides, all firing rates in SEW ResNet-101/152 are not larger than 0.5, indicating that all neurons fire on average not more than two spikes. In general, the firing rates of $A ^ { l }$ in SEW blocks are at a low level, verifying that most SEW blocks act as identity mapping.
|
| 145 |
+
|
| 146 |
+
Gradients Check on ResNet-152 Structure. Eq. (8) and Eq. (11) analyze the gradients of multiple blocks with identity mapping. To verify that SEW ResNet can overcome vanishing/exploding gradient, we check the gradients of Spiking ResNet-152 and SEW ResNet-152, which are the deepest standard ResNet structure. We consider the same initialization parameters and with/without zero initialization.
|
| 147 |
+
|
| 148 |
+
As the gradients of SNNs are significantly influenced by firing rates (see Sec.A.4), we analyze the firing rate firstly. Fig. 5(a) shows the initial firing rate of $l$ -th block’s output $O ^ { l }$ . The indexes of downsample blocks are marked by vertical dotted lines. The blocks between two adjacent dotted lines represent the identity mapping areas, and have inputs and outputs with the same shape. When using zero initialization, Spiking ResNet, SEW AND ResNet, SEW IAND ResNet, and SEW ADD ResNet have the same firing rates (green curve), which is the zero init curve. Without zero initialization, the silence problem happens in the SEW AND network (red curve), and is relieved by the SEW IAND network (purple curve). Fig. 5(b) shows the firing rate of $A ^ { l }$ , which represents the output of last SN in $l$ -th block. It can be found that although the firing rate of $O ^ { l }$ in SEW ADD ResNet increases linearly in the identity mapping areas, the last SN in each block still maintains a stable firing rate. Note that when $g$ is $A D D$ , the output of the SEW block is not binary, and the firing rate is actually the mean value. The SNs of SEW IAND ResNet maintain an adequate firing rate and decay slightly with depth (purple curve), while SNs in deep layers of SEW AND ResNet keep silent (orange curve). The silence problem can be explained as follows. When using $A N D$ , $O ^ { l } [ \dot { t } ] = \mathrm { S N } ( \mathcal { F } ^ { l } ( \tilde { O } ^ { l - 1 } [ t ] ) ) \wedge O ^ { l - 1 } [ t ] \leq \dot { O } ^ { l - 1 } [ t ] .$ . Since it is hard to keep $\mathrm { S N } ( \mathcal { F } ^ { l } ( O ^ { l - 1 } [ t ] ) ) \equiv 1$ at each time-step $t$ , the silence problem may frequently happen in SEW ResNet with AND as $g$ . Using IAND as a substitute of $A N D$ can relieve this problem because it is easy to keep $\mathrm { S N } ( \mathcal { F } ^ { l } ( O ^ { l - 1 } [ t ] ) ) \equiv \breve { 0 }$ at each time-step $t$ .
|
| 149 |
+
|
| 150 |
+

|
| 151 |
+
Figure 5: The initial firing rates of output $O ^ { l }$ and $A ^ { l }$ in $l$ -th block on 152-layer network.
|
| 152 |
+
|
| 153 |
+
The surrogate gradient function we used in all experiments is $\begin{array} { r } { \sigma ( x ) = \frac { 1 } { \pi } \arctan ( \frac { \pi } { 2 } \alpha x ) + \frac { 1 } { 2 } } \end{array}$ , thus $\begin{array} { r } { \sigma ^ { \prime } ( x ) = \frac { \alpha } { 2 ( 1 + ( \frac { \pi } { 2 } \alpha x ) ^ { 2 } ) } . } \end{array}$ . When $V _ { t h } = 1 , \alpha = 2$ , the gradient amplitude $\Vert \frac { \partial L } { \partial S ^ { l } } \Vert$ of each block is shown in Fig. 6. Note that $\alpha = 2$ , $\sigma ^ { \prime } ( x ) \leq \sigma ^ { \prime } ( 0 ) = \sigma ^ { \prime } ( 1 - V _ { t h } ) = 1$ and $\sigma ^ { \prime } ( 0 - V _ { t h } ) = 0 . 0 9 2 < 1$ . It can be found that the gradients in Spiking ResNet-152 decay from deeper layers to shallower layers in the identity mapping areas without zero initialization, which is caused by $\begin{array} { r } { \dot { \sigma } ^ { \prime } ( x ) \leq 1 } \end{array}$ . It is worth noting that the decay also happens in Spiking ResNet-152 with zero initialization. The small convex $\Lambda$ near the dotted lines is caused by the vanishing gradients of those $S _ { j } ^ { l } [ t ] = 0$ . After these gradients decays to 0 completely, $\Vert \frac { \partial L } { \partial S ^ { l } } \Vert$ will be a constant because the rest gradients are calculated by $S _ { j } ^ { l } [ t ] = 1$ and $\sigma ^ { \prime } ( 1 - V _ { t h } ) = 1$ , which can also explain why the gradient-index curve is horizontal at some areas. When referring to SEW ResNet-152 with zero initialization, it can be found that all gradient-index curves are similar no matter what $g$ we choose. This is caused by that in the identity mapping areas, $S ^ { l }$ is constant for all index $l$ , and the gradient also becomes a constant as it will not flow through SNs. Without zero initialization, the vanishing gradient happens in the SEW AND ResNet-152, which is caused by the silence problem. The gradients of SEW ADD, IAND network increase slowly when propagating from deeper layers to shallower layers, due to the adequate firing rates shown in Fig. 5.
|
| 154 |
+
|
| 155 |
+
When $V _ { t h } = 0 . 5 , \alpha = 2$ , $\sigma ^ { \prime } ( 0 - V _ { t h } ) = \sigma ^ { \prime } ( 1 - V _ { t h } ) = 0 . 2 8 8 < 1$ , indicating that transmitting spikes to SNs is prone to causing vanishing gradient, as shown in Fig. 7. With zero initialization, the decay in Spiking ResNet-152 is more serious because gradient from $\mathcal { F } ^ { l }$ can not contribute. The SEW ResNet-152 will not be affected no matter what $g$ we choose. When $V _ { t h } = 1 , \alpha = 3$ , $\sigma ^ { \prime } ( 1 - V _ { t h } ) = 1 . 5 > 1$ , indicating that transmitting spikes to SNs is prone to causing exploding gradient. Fig. 8 shows the gradient in this situation. Same with the reason in Fig. 6, the change of surrogate function will increase gradients of all networks without zero initialization, but not affect SEW ResNet-152 with zero initialization. The Spiking ResNet-152 meets exploding gradient, while this problem in SEW ADD, IAND ResNet-152 is not serious.
|
| 156 |
+
|
| 157 |
+
# 4.2 DVS Gesture Classification
|
| 158 |
+
|
| 159 |
+
The origin ResNet, which is designed for classifying the complex ImageNet dataset, is too large for the DVS Gesture dataset. Hence, we design a tiny network named 7B-Net, whose structure is c32k3s1-BN-PLIF-{SEW Block-MPk2s2}\*7-FC11. Here c32k3s1 means the convolutional layer with channels 32, kernel size 3, stride 1. MPk2s2 is the max pooling with kernel size 2, stride 2. The symbol $\{ \} ^ { * } $ denotes seven repeated structure, and PLIF denotes the Parametric Leaky-Integrate-andFire Spiking Neuron with a learnable membrane time constant, which is proposed in [8] and can be described by Eq. (5). See Sec.A.1 for AER data pre-processing details.
|
| 160 |
+
|
| 161 |
+

|
| 162 |
+
Figure 7: Gradient amplitude $\Big | \Big | \frac { \partial L } { \partial S ^ { l } } \Big | \Big |$ of $l$ -th block when $V _ { t h } = 0 . 5 , \alpha = 2$
|
| 163 |
+
|
| 164 |
+
Spiking ResNet vs. SEW ResNet. We first compare the performance of SEW ResNet with $A D D$ element-wise function (SEW ADD ResNet) and Spiking ResNet by replacing SEW blocks with basic blocks. As shown in Fig. 9 and Tab. 4, although the training loss of Spiking ResNet (blue curve) is lower than SEW ADD ResNet (orange curve), the test accuracy is lower than SEW ADD ResNet $( 9 0 . 9 7 \%$ v.s. $9 7 . 9 2 \%$ ), which implies that Spiking ResNet is easier to overfit than SEW ADD ResNet.
|
| 165 |
+
|
| 166 |
+
Evaluation of different element-wise functions and plain block. As the training cost of SNNs on the DVS Gesture dataset is much lower than on ImageNet, we carry out more ablation experiments on the DVS Gesture dataset. We replace SEW blocks with the plain blocks (no shortcut connection) and test the performance. We also evaluate all kinds of element-wise functions $g$ in Tab. 1. Fig. 9 shows the training loss and training/test accuracy on DVS Gesture. The sharp fluctuation during early epochs is caused by the large learning rate (see Sec.A.1). We can find that the training loss is SEW IAND $<$ Spiking ResNe $<$ <SEW ADD $<$ Plain Net<SEW AND. Due to the overfitting problem, a lower loss does not guarantee a higher test accuracy.
|
| 167 |
+
|
| 168 |
+
Tab. 4 shows the test accuracy of all networks. The SEW ADD ResNet gets the highest accuracy than others.
|
| 169 |
+
|
| 170 |
+
Comparisons with State-of-the-art Methods. Tab. 5 compares our network with SOTA methods. It can be found that our SEW ResNet outperforms the SOTA works in accuracy, parameter numbers, and simulating time-steps.
|
| 171 |
+
|
| 172 |
+
Table 4: Test accuracy on DVS Gesture. The networks’ order is ranked by accuracy.
|
| 173 |
+
|
| 174 |
+
<table><tr><td>Network</td><td>Element-Wise Function g</td><td>Accuracy(%)</td></tr><tr><td>SEWResNet</td><td>ADD</td><td>97.92</td></tr><tr><td>SEWResNet</td><td>IAND</td><td>95.49</td></tr><tr><td>Plain Net</td><td>1</td><td>91.67</td></tr><tr><td>Spiking ResNet</td><td>1</td><td>90.97</td></tr><tr><td>SEWResNet</td><td>AND</td><td>70.49</td></tr></table>
|
| 175 |
+
|
| 176 |
+
<table><tr><td>Network</td><td>Accuracy(%)</td><td>Parameters</td><td>T</td></tr><tr><td>c32k3s1-BN-PLIF-{SEW Block (c32) -MPk2s2}*7-FC11 (7B-Net)</td><td>97.92</td><td>0.13M</td><td>16</td></tr><tr><td>{c128k3s1-BN-PLIF-MPk2s2}*5-DP-</td><td>97.57</td><td>1.70M</td><td>20</td></tr><tr><td>FC512-PLIF-DP-FC110-PLIF-APk10s10[8]</td><td></td><td>11.18M</td><td></td></tr><tr><td>SpikingResNet-17with td-BN[64] MPk4-c64k3-LIF-c128k3-LIF-APk2-c128k3-LIF-APk2-FC256-LIF-FC11[16]</td><td>96.87 93.40</td><td>23.23M</td><td>40 60</td></tr></table>
|
| 177 |
+
|
| 178 |
+
Table 5: Comparison with the state-of-the-art (SOTA) methods on DVS Gesture dataset.
|
| 179 |
+
|
| 180 |
+
# 4.3 CIFAR10-DVS Classification
|
| 181 |
+
|
| 182 |
+
We also report SEW ResNet on the CIFAR10-DVS dataset, which is obtained by recording the moving images of the CIFAR-10 dataset on a LCD monitor by a DVS camera. As CIFAR10-DVS is more complicated than DVS Gesture, we use the network structure named Wide-7B-Net, which is similar to 7B-Net but with more channels. The structure of Wide-7B-Net is c64k3s1-BN-PLIF-{SEW Block (c64)-MPk2s2}\*4-c128k3s1-BN-PLIF-{SEW Block (c128)-MPk2s2}\*3-FC10.
|
| 183 |
+
|
| 184 |
+

|
| 185 |
+
Figure 8: Gradient amplitude $\Big | \Big | \frac { \partial L } { \partial S ^ { l } } \Big | \Big |$ of $l$ -th block when $V _ { t h } = 1 , \alpha = 3$
|
| 186 |
+
|
| 187 |
+

|
| 188 |
+
Figure 9: Comparison of the training loss, training accuracy and test accuracy on DVS Gesture dataset.
|
| 189 |
+
|
| 190 |
+
<table><tr><td>Network</td><td>Accuracy(%)</td><td>Parameters</td><td>T</td></tr><tr><td>c64k3s1-BN-PLIF-{SEWBlock (c64)-MPk2s2}*4-c128k3s1- BN-PLIF-{SEWBlock (c128)-MPk2s2}*3-FCi0 (Wide-7B-Net)</td><td>64.8, 70.2, 74.4</td><td>1.19M</td><td>4,8,16</td></tr><tr><td>{c128k3s1-BN-PLIF-MPk2s2}*4-DP-FC512-PLIF-DP- FC100-PLIF-APk10s10[8]</td><td>74.8</td><td>17.4M</td><td>20</td></tr><tr><td>Spiking ResNet-19 with td-BN [64]</td><td>67.8</td><td>11.18M</td><td>10</td></tr></table>
|
| 191 |
+
|
| 192 |
+
Table 6: Comparison with the state-of-the-art (SOTA) methods on CIFAR10-DVS dataset.
|
| 193 |
+
|
| 194 |
+
In Tab.6, we compare SEW ResNet with the previous Spiking ResNet. One can find that our method achieves better performance $7 0 . 2 \%$ v.s. $6 7 . 8 \%$ and fewer time-steps (8 v.s. 10) than the Spiking ResNet [64]. We also compare our method with the state-of-the-art (SOTA) supervised learning methods on CIFAR10-DVS. The accuracy of our Wide-7B-Net is slightly lower than the current SOTA method [8] $7 4 . 4 \%$ v.s. $7 4 . 8 \%$ ), which uses 1.25 times as many simulation time-steps $T$ (20 v.s. 16) and 14.6 times as many the number of parameters (17.4M v.s. 1.19M). Moreover, when reducing $T$ shapely to $T = 4$ , our Wide-7B-Net can still get the accuracy of $6 4 . 8 \%$ .
|
| 195 |
+
|
| 196 |
+
# 5 Conclusion
|
| 197 |
+
|
| 198 |
+
In this paper, we analyze the previous Spiking ResNet whose residual block mimics the standard block of ResNet, and find that it can hardly implement identity mapping and suffers from the problems of vanishing/exploding gradient. To solve these problems, we propose the SEW residual block and prove that it can implement the residual learning. The experiment results on ImageNet, DVS Gesture, and CIFAR10-DVS datasets show that our SEW residual block solves the degradation problem, and SEW ResNet can achieve higher accuracy by simply increasing the network’s depth. Our work may shed light on the learning of “very deep” SNNs.
|
| 199 |
+
|
| 200 |
+
# 6 Acknowledgment
|
| 201 |
+
|
| 202 |
+
This work is supported by grants from the National Natural Science Foundation of China under contracts No.62027804, No.61825101, and No.62088102.
|
| 203 |
+
|
| 204 |
+
References
|
| 205 |
+
[1] Arnon Amir, Brian Taba, David Berg, Timothy Melano, Jeffrey McKinstry, Carmelo Di Nolfo, Tapan Nayak, Alexander Andreopoulos, Guillaume Garreau, Marcela Mendoza, Jeff Kusnitz, Michael Debole, Steve Esser, Tobi Delbruck, Myron Flickner, and Dharmendra Modha. A low power, fully event-based gesture recognition system. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 7243–7252, 2017.
|
| 206 |
+
[2] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In International Conference on Learning Representations (ICLR), 2015.
|
| 207 |
+
[3] Yoshua Bengio, Yann LeCun, et al. Scaling learning algorithms towards ai. Large-scale Kernel Machines, 34(5):1–41, 2007.
|
| 208 |
+
[4] Yongqiang Cao, Yang Chen, and Deepak Khosla. Spiking deep convolutional neural networks for energy-efficient object recognition. International Journal of Computer Vision, 113(1):54–66, 2015.
|
| 209 |
+
[5] Iulia M Comsa, Krzysztof Potempa, Luca Versari, Thomas Fischbacher, Andrea Gesmundo, and Jyrki Alakuijala. Temporal coding in spiking neural networks with alpha synaptic function. In International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 8529–8533. IEEE, 2020.
|
| 210 |
+
[6] Shikuang Deng and Shi Gu. Optimal conversion of conventional artificial neural networks to spiking neural networks. In International Conference on Learning Representations (ICLR), 2021.
|
| 211 |
+
[7] Wei Fang, Yanqi Chen, Jianhao Ding, Ding Chen, Zhaofei Yu, Huihui Zhou, Yonghong Tian, and other contributors. Spikingjelly. https://github.com/fangwei123456/ spikingjelly.
|
| 212 |
+
[8] Wei Fang, Zhaofei Yu, Yanqi Chen, Timothee Masquelier, Tiejun Huang, and Yonghong Tian. Incorporating learnable membrane time constant to enhance learning of spiking neural networks. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pages 2661–2671, 2021.
|
| 213 |
+
[9] Ross Girshick, Jeff Donahue, Trevor Darrell, and Jitendra Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 580–587, 2014.
|
| 214 |
+
[10] Priya Goyal, Piotr Dollár, Ross Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, Andrew Tulloch, Yangqing Jia, and Kaiming He. Accurate, large minibatch sgd: Training imagenet in 1 hour. arXiv preprint arXiv:1706.02677, 2017.
|
| 215 |
+
[11] Bing Han and Kaushik Roy. Deep spiking neural network: Energy efficiency through time based coding. In European Conference on Computer Vision (ECCV), pages 388–404, 2020.
|
| 216 |
+
[12] Bing Han, Gopalakrishnan Srinivasan, and Kaushik Roy. Rmp-snn: Residual membrane potential neuron for enabling deeper high-accuracy and low-latency spiking neural network. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 13558–13567, 2020.
|
| 217 |
+
[13] Kaiming He and Jian Sun. Convolutional neural networks at constrained time cost. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 5353–5360, 2015.
|
| 218 |
+
[14] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 770–778, 2016.
|
| 219 |
+
[15] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In European Conference on Computer Vision (ECCV), pages 630–645. Springer, 2016.
|
| 220 |
+
|
| 221 |
+
[16] Weihua He, YuJie Wu, Lei Deng, Guoqi Li, Haoyu Wang, Yang Tian, Wei Ding, Wenhui Wang, and Yuan Xie. Comparing snns and rnns on neuromorphic vision datasets: Similarities and differences. Neural Networks, 132:108–120, 2020.
|
| 222 |
+
|
| 223 |
+
[17] Yangfan Hu, Huajin Tang, Yueming Wang, and Gang Pan. Spiking deep residual network. arXiv preprint arXiv:1805.01352, 2018.
|
| 224 |
+
|
| 225 |
+
[18] Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 4700–4708, 2017.
|
| 226 |
+
|
| 227 |
+
[19] Dongsung Huh and Terrence J Sejnowski. Gradient descent for spiking neural networks. In Advances in Neural Information Processing Systems (NeurIPS), pages 1440–1450, 2018.
|
| 228 |
+
|
| 229 |
+
[20] Eric Hunsberger and Chris Eliasmith. Spiking deep networks with lif neurons. arXiv preprint arXiv:1510.08829, 2015.
|
| 230 |
+
|
| 231 |
+
[21] Sungmin Hwang, Jeesoo Chang, Min-Hye Oh, Kyung Kyu Min, Taejin Jang, Kyungchul Park, Junsu Yu, Jong-Ho Lee, and Byung-Gook Park. Low-latency spiking neural networks using pre-charged membrane potential and delayed evaluation. Frontiers in Neuroscience, 15:135, 2021.
|
| 232 |
+
|
| 233 |
+
[22] Forrest N Iandola, Song Han, Matthew W Moskewicz, Khalid Ashraf, William J Dally, and Kurt Keutzer. Squeezenet: Alexnet-level accuracy with 50x fewer parameters and $< 0 . 5 ~ \mathrm { m b }$ model size. arXiv preprint arXiv:1602.07360, 2016.
|
| 234 |
+
|
| 235 |
+
[23] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International Conference on Machine Learning (ICML), pages 448–456, 2015.
|
| 236 |
+
|
| 237 |
+
[24] Saeed Reza Kheradpisheh and Timothée Masquelier. Temporal backpropagation for spiking neural networks with one spike per neuron. International Journal of Neural Systems, 30(06):2050027, 2020.
|
| 238 |
+
|
| 239 |
+
[25] Jaehyun Kim, Heesu Kim, Subin Huh, Jinho Lee, and Kiyoung Choi. Deep neural networks with weighted spikes. Neurocomputing, 311:373–386, 2018.
|
| 240 |
+
|
| 241 |
+
[26] Jinseok Kim, Kyungsu Kim, and Jae-Joon Kim. Unifying activation- and timing-based learning rules for spiking neural networks. In Advances in Neural Information Processing Systems (NeurIPS), pages 19534–19544, 2020.
|
| 242 |
+
|
| 243 |
+
[27] Alex Krizhevsky. One weird trick for parallelizing convolutional neural networks. arXiv preprint arXiv:1404.5997, 2014.
|
| 244 |
+
|
| 245 |
+
[28] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems (NeurIPS), pages 1097–1105, 2012.
|
| 246 |
+
|
| 247 |
+
[29] Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436–444, 2015.
|
| 248 |
+
|
| 249 |
+
[30] Chankyu Lee, Syed Shakib Sarwar, Priyadarshini Panda, Gopalakrishnan Srinivasan, and Kaushik Roy. Enabling spike-based backpropagation for training deep neural network architectures. Frontiers in Neuroscience, 14, 2020.
|
| 250 |
+
|
| 251 |
+
[31] Jun Haeng Lee, Tobi Delbruck, and Michael Pfeiffer. Training deep spiking neural networks using backpropagation. Frontiers in Neuroscience, 10:508, 2016.
|
| 252 |
+
|
| 253 |
+
[32] Hongmin Li, Hanchao Liu, Xiangyang Ji, Guoqi Li, and Luping Shi. Cifar10-dvs: An eventstream dataset for object classification. Frontiers in Neuroscience, 11:309, 2017.
|
| 254 |
+
|
| 255 |
+
[33] Yuhang Li, Shikuang Deng, Xin Dong, Ruihao Gong, and Shi Gu. A free lunch from ann: Towards efficient, accurate spiking neural networks calibration. In International Conference on Machine Learning (ICML), volume 139, pages 6316–6325, 2021.
|
| 256 |
+
|
| 257 |
+
[34] Wei Liu, Dragomir Anguelov, Dumitru Erhan, Christian Szegedy, Scott Reed, Cheng-Yang Fu, and Alexander C Berg. Ssd: Single shot multibox detector. In European Conference on Computer Vision (ECCV), pages 21–37. Springer, 2016.
|
| 258 |
+
|
| 259 |
+
[35] Ilya Loshchilov and Frank Hutter. SGDR: stochastic gradient descent with warm restarts. In International Conference on Learning Representations (ICLR), 2017.
|
| 260 |
+
|
| 261 |
+
[36] Paulius Micikevicius, Sharan Narang, Jonah Alben, Gregory Diamos, Erich Elsen, David Garcia, Boris Ginsburg, Michael Houston, Oleksii Kuchaiev, Ganesh Venkatesh, et al. Mixed precision training. In International Conference on Learning Representations (ICLR), 2018.
|
| 262 |
+
|
| 263 |
+
[37] Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 2015.
|
| 264 |
+
|
| 265 |
+
[38] Guido F Montufar, Razvan Pascanu, Kyunghyun Cho, and Yoshua Bengio. On the number of linear regions of deep neural networks. In Advances in Neural Information Processing Systems (NeurIPS), pages 2924–2932, 2014.
|
| 266 |
+
|
| 267 |
+
[39] Hesham Mostafa. Supervised learning based on temporal coding in spiking neural networks. IEEE Transactions on Neural Networks and Learning Systems, 29(7):3227–3235, 2017.
|
| 268 |
+
|
| 269 |
+
[40] Emre O Neftci, Hesham Mostafa, and Friedemann Zenke. Surrogate gradient learning in spiking neural networks: Bringing the power of gradient-based optimization to spiking neural networks. IEEE Signal Processing Magazine, 36(6):51–63, 2019.
|
| 270 |
+
|
| 271 |
+
[41] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems (NeurIPS), pages 8026–8037, 2019.
|
| 272 |
+
|
| 273 |
+
[42] Nitin Rathi and Kaushik Roy. Diet-snn: Direct input encoding with leakage and threshold optimization in deep spiking neural networks. arXiv preprint arXiv:2008.03658, 2020.
|
| 274 |
+
|
| 275 |
+
[43] Nitin Rathi, Gopalakrishnan Srinivasan, Priyadarshini Panda, and Kaushik Roy. Enabling deep spiking neural networks with hybrid conversion and spike timing dependent backpropagation. In International Conference on Learning Representations (ICLR), 2020.
|
| 276 |
+
|
| 277 |
+
[44] Joseph Redmon, Santosh Divvala, Ross Girshick, and Ali Farhadi. You only look once: Unified, real-time object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 779–788, 2016.
|
| 278 |
+
|
| 279 |
+
[45] Kaushik Roy, Akhilesh Jaiswal, and Priyadarshini Panda. Towards spike-based machine intelligence with neuromorphic computing. Nature, 575(7784):607–617, 2019.
|
| 280 |
+
|
| 281 |
+
[46] Bodo Rueckauer, Iulia-Alexandra Lungu, Yuhuang Hu, Michael Pfeiffer, and Shih-Chii Liu. Conversion of continuous-valued deep networks to efficient event-driven networks for image classification. Frontiers in Neuroscience, 11:682, 2017.
|
| 282 |
+
|
| 283 |
+
[47] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International Journal of Computer Vision, 115(3):211–252, 2015.
|
| 284 |
+
|
| 285 |
+
[48] Ali Samadzadeh, Fatemeh Sadat Tabatabaei Far, Ali Javadi, Ahmad Nickabadi, and Morteza Haghir Chehreghani. Convolutional spiking neural networks for spatio-temporal feature extraction. arXiv preprint arXiv:2003.12346, 2020.
|
| 286 |
+
|
| 287 |
+
[49] Abhronil Sengupta, Yuting Ye, Robert Wang, Chiao Liu, and Kaushik Roy. Going deeper in spiking neural networks: Vgg and residual architectures. Frontiers in Neuroscience, 13:95, 2019.
|
| 288 |
+
|
| 289 |
+
[50] Sumit Bam Shrestha and Garrick Orchard. Slayer: Spike layer error reassignment in time. In Advances in Neural Information Processing Systems (NeurIPS), pages 1419–1428, 2018.
|
| 290 |
+
|
| 291 |
+
[51] David Silver, Aja Huang, Chris J Maddison, Arthur Guez, Laurent Sifre, George Van Den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, et al. Mastering the game of go with deep neural networks and tree search. Nature, 529(7587):484–489, 2016.
|
| 292 |
+
|
| 293 |
+
[52] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In International Conference on Learning Representations (ICLR), 2015.
|
| 294 |
+
|
| 295 |
+
[53] Rupesh Kumar Srivastava, Klaus Greff, and Jürgen Schmidhuber. Highway networks. arXiv preprint arXiv:1505.00387, 2015.
|
| 296 |
+
|
| 297 |
+
[54] Christoph Stöckl and Wolfgang Maass. Optimized spiking neurons can classify images with high accuracy through temporal coding with two spikes. Nature Machine Intelligence, 3(3):230–238, 2021.
|
| 298 |
+
|
| 299 |
+
[55] Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 1–9, 2015.
|
| 300 |
+
|
| 301 |
+
[56] Amirhossein Tavanaei, Masoud Ghodrati, Saeed Reza Kheradpisheh, Timothée Masquelier, and Anthony Maida. Deep learning in spiking neural networks. Neural Networks, 111:47–63, 2019.
|
| 302 |
+
|
| 303 |
+
[57] 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 (NeurIPS), pages 5998–6008, 2017.
|
| 304 |
+
|
| 305 |
+
[58] Yujie Wu, Lei Deng, Guoqi Li, Jun Zhu, and Luping Shi. Spatio-temporal backpropagation for training high-performance spiking neural networks. Frontiers in Neuroscience, 12:331, 2018.
|
| 306 |
+
|
| 307 |
+
[59] Saining Xie, Ross Girshick, Piotr Dollár, Zhuowen Tu, and Kaiming He. Aggregated residual transformations for deep neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 5987–5995, 2017.
|
| 308 |
+
|
| 309 |
+
[60] Fu Xing, Ye Yuan, Hong Huo, and Tao Fang. Homeostasis-based cnn-to-snn conversion of inception and residual architectures. In International Conference on Neural Information Processing, pages 173–184. Springer, 2019.
|
| 310 |
+
|
| 311 |
+
[61] Bojian Yin, Federico Corradi, and Sander M Bohté. Effective and efficient computation with multiple-timescale spiking recurrent neural networks. In International Conference on Neuromorphic Systems, pages 1–8, 2020.
|
| 312 |
+
|
| 313 |
+
[62] Friedemann Zenke and Tim P Vogels. The remarkable robustness of surrogate gradient learning for instilling complex function in spiking neural networks. Neural Computation, 33(4):899–925, 2021.
|
| 314 |
+
|
| 315 |
+
[63] Wenrui Zhang and Peng Li. Temporal spike sequence learning via backpropagation for deep spiking neural networks. In Advances in Neural Information Processing Systems (NeurIPS), pages 12022–12033, 2020.
|
| 316 |
+
|
| 317 |
+
[64] Hanle Zheng, Yujie Wu, Lei Deng, Yifan Hu, and Guoqi Li. Going deeper with directly-trained larger spiking neural networks. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 11062–11070, 2021.
|
| 318 |
+
|
| 319 |
+
[65] Shibo Zhou, Xiaohua Li, Ying Chen, Sanjeev T. Chandrasekaran, and Arindam Sanyal. Temporal-coded deep spiking neural network with easy training and robust performance. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 11143–11151, 2021.
|
| 320 |
+
|
| 321 |
+
[66] Romain Zimmer, Thomas Pellegrini, Srisht Fateh Singh, and Timothée Masquelier. Technical report: supervised training of convolutional spiking neural networks with pytorch. arXiv preprint arXiv:1911.10124, 2019.
|
md/train/6vaActvpcp3/6vaActvpcp3.md
ADDED
|
@@ -0,0 +1,384 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Adaptive Conformal Inference Under Distribution Shift
|
| 2 |
+
|
| 3 |
+
# Isaac Gibbs
|
| 4 |
+
|
| 5 |
+
Emmanuel J. Candès
|
| 6 |
+
|
| 7 |
+
Department of Statistics Stanford University igibbs@stanford.edu
|
| 8 |
+
|
| 9 |
+
Department of Statistics Department of Mathematics Stanford University candes@stanford.edu
|
| 10 |
+
|
| 11 |
+
# Abstract
|
| 12 |
+
|
| 13 |
+
We develop methods for forming prediction sets in an online setting where the data generating distribution is allowed to vary over time in an unknown fashion. Our framework builds on ideas from conformal inference to provide a general wrapper that can be combined with any black box method that produces point predictions of the unseen label or estimated quantiles of its distribution. While previous conformal inference methods rely on the assumption that the data points are exchangeable, our adaptive approach provably achieves the desired coverage frequency over long-time intervals irrespective of the true data generating process. We accomplish this by modelling the distribution shift as a learning problem in a single parameter whose optimal value is varying over time and must be continuously re-estimated. We test our method, adaptive conformal inference, on two real world datasets and find that its predictions are robust to visible and significant distribution shifts.
|
| 14 |
+
|
| 15 |
+
# 1 Introduction
|
| 16 |
+
|
| 17 |
+
Machine learning algorithms are increasingly being employed in high stakes decision making processes. For instance, deep neural networks are currently being used in self-driving cars to detect nearby objects $\pmb { \mathbb { D } }$ and parole decisions are being made with the assistance of complex models that combine over a hundred features $\mathbb { I I }$ . As the popularity of black box methods and the cost of making wrong decisions grow it is crucial that we develop tools to quantify the uncertainty of their predictions.
|
| 18 |
+
|
| 19 |
+
In this paper we develop methods for constructing prediction sets that are guaranteed to contain the target label with high probability. We focus specifically on an online learning setting in which we observe covariate-response pairs $\{ ( X _ { t } , Y _ { t } ) \} _ { t \in \mathbb { N } } \subseteq \mathbb { R } ^ { d } \times \mathbf { \bar { \mathbb { R } } }$ in a sequential fashion. At each time step $t \in \mathbb { N }$ we are tasked with using the previously observed data $\{ ( X _ { r } , Y _ { r } ) \} _ { 1 \leq r \leq t - 1 }$ along with the new covariates, $X _ { t }$ , to form a prediction set $\hat { C } _ { t }$ for $Y _ { t }$ . Then, given a target coverage level $\alpha \in ( 0 , 1 )$ our generic goal is to guarantee that $Y _ { t }$ belongs to $\hat { C } _ { t }$ at least $1 0 0 ( 1 - \alpha ) \%$ of the time.
|
| 20 |
+
|
| 21 |
+
Perhaps the most powerful and flexible tools for solving this problem come from conformal inference [see e.g. 34, 16, 32, 22, 31, 15, 3] . This framework provides a generic methodology for transforming the outputs of any black box prediction algorithm into a prediction set. The generality of this approach has facilitated the development of a large suite of conformal methods, each specialized to a specific prediction problem of interest [e.g. 30, 11, 23, 8, 24, 21]. With only minor exceptions all of these algorithms share the same common guarantee that if the training and test data are exchangeable, then the prediction set has valid marginal coverage $\mathbb { P } ( Y _ { t } \in \hat { C } _ { t } ) = \bar { 1 } - \alpha$ .
|
| 22 |
+
|
| 23 |
+
While exchangeability is a common assumption, there are many real-world applications in which we do not expect the marginal distribution of $( X _ { t } , Y _ { t } )$ to be stationary. For example, in finance and economics market behaviour can shift drastically in response to new legislation or major world events. Alternatively, the distribution of $( X _ { t } , Y _ { t } )$ may change as we deploy our prediction model in new environments. This paper develops adaptive conformal inference (ACI), a method for forming prediction sets that are robust to changes in the marginal distribution of the data. Our approach is both simple, in that it requires only the tracking of a single parameter that models the shift, and general as it can be combined with any modern machine learning algorithm that produces point predictions or estimated quantiles for the response. We show that over long time intervals ACI achieves the target coverage frequency without any assumptions on the data-generating distribution. Moreover, when the distribution shift is small and the prediction algorithm takes a certain simple form we show that ACI will additionally obtain approximate marginal coverage at most time steps.
|
| 24 |
+
|
| 25 |
+
# 1.1 Conformal inference
|
| 26 |
+
|
| 27 |
+
Suppose we are given a fitted regression model for predicting the value of $Y$ from $X$ . Let $y$ be a candidate value for $Y _ { t }$ . To determine if $y$ is a reasonable estimate of $Y _ { t }$ , we define a conformity score $S ( X , Y )$ that measures how well the value $y$ conforms with the predictions of our fitted model. For example, if our regression model produces point predictions ${ \hat { \mu } } ( X )$ then we could use a conformity score that measures the distance between $\hat { \mu } ( X _ { t } )$ and $y$ . One such example is
|
| 28 |
+
|
| 29 |
+
$$
|
| 30 |
+
S ( X _ { t } , y ) = | \hat { \mu } ( X _ { t } ) - y | .
|
| 31 |
+
$$
|
| 32 |
+
|
| 33 |
+
Alternatively, suppose our regression model outputs estimates ${ \hat { q } } ( X ; p )$ of the $p$ th quantile of the distribution of $Y | X$ . Then, we could use the method of conformal quantile regression (CQR) $\left[ \left[ 2 8 \right] \right]$ which examines the signed distance between $y$ and fitted upper and lower quantiles through the score
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
S ( X _ { t } , y ) = \operatorname* { m a x } \{ \hat { q } ( X _ { t } ; \alpha / 2 ) - y , y - \hat { q } ( X _ { t } ; 1 - \alpha / 2 ) \} .
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
Regardless of what conformity score is chosen the key issue is to determine how small $S ( X _ { t } , y )$ should be in order to accept $y$ as a reasonable prediction for $Y _ { t }$ . Assume we have a calibration set $\mathcal { D } _ { \mathrm { c a l } } \subseteq \{ ( X _ { r } , Y _ { r } ) \} _ { 1 \leq r \leq t - 1 }$ that is different from the data that was used to fit the regression model. Using this calibration set we define the fitted quantiles of the conformity scores to be
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\hat { Q } ( p ) : = \operatorname* { i n f } \left\{ s : \left( \frac 1 { | \mathscr { D } _ { \mathrm { c a l } } | } \sum _ { ( X _ { r } , Y _ { r } ) \in \mathscr { D } _ { \mathrm { c a l } } } \mathbb { 1 } _ { \{ S ( X _ { r } , Y _ { r } ) \leq s \} } \right) \geq p \right\} ,
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
and say that $y$ is a reasonable prediction for $Y _ { t }$ if $S ( X _ { t } , y ) \leq \hat { Q } ( 1 - \alpha )$ .
|
| 46 |
+
|
| 47 |
+
The crucial observation is that if the data $\mathcal { D } _ { \operatorname { c a l } } \cup \{ ( X _ { t } , Y _ { t } ) \}$ are exchangeable and we break ties uniformly at random then the rank of $S ( X _ { t } , Y _ { t } )$ amongst the points $\{ S ( X _ { r } , Y _ { r } ) \} _ { ( X _ { r } , Y _ { r } ) \in \mathcal { D } _ { \mathrm { c a l } } } \cup$ $\{ S ( X _ { t } , Y _ { t } ) \}$ will be uniform. Therefore,
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\mathbb { P } ( S ( X _ { t } , Y _ { t } ) \le \hat { Q } ( 1 - \alpha ) ) = \frac { \lceil | \mathcal { D } _ { \mathrm { c a l } } | ( 1 - \alpha ) \rceil } { | \mathcal { D } _ { \mathrm { c a l } } | + 1 } .
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
Thus, defining our prediction set to be $\hat { C } _ { t } : = \{ y : S ( X _ { t } , y ) \leq \hat { Q } ( 1 - \alpha ) \}$ gives the marginal coverage guarantee
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\mathbb { P } ( Y _ { t } \in \hat { C } _ { t } ) = \mathbb { P } ( S ( X _ { t } , Y _ { t } ) \leq \hat { Q } ( 1 - \alpha ) ) = \frac { \lceil | \mathcal { D } _ { \mathrm { c a l } } | ( 1 - \alpha ) \rceil } { | \mathcal { D } _ { \mathrm { c a l } } | + 1 } .
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
By introducing additional randomization this generic procedure can be altered slightly to produce a set $\hat { C } _ { t }$ that satisfies the exact marginal coverage guarantee $\mathbb { P } ( Y _ { t } \in \hat { C } _ { t } ) = 1 - \alpha$ [34]. For the purposes of this paper this adjustment is not critical and so we omit the details here. Additionally, we remark that the method outlined above is often referred to as split or inductive conformal inference $[ 1 2 7 , 1 3 4 , | 2 6 |$ . This refers to the fact that we have split the observed data between a training set used to fit the regression model and a withheld calibration set. The adaptive conformal inference method developed in this article can also be easily adjusted to work with full conformal inference in which data splitting is avoided at the cost of greater computational resources $\pmb { \mathbb { B 4 } }$ .
|
| 60 |
+
|
| 61 |
+
# 2 Adapting conformal inference to distribution shifts
|
| 62 |
+
|
| 63 |
+
Up until this point we have been working with a single score function $S ( \cdot )$ and quantile function ${ \hat { Q } } ( \cdot )$ In the general case where the distribution of the data is shifting over time both these functions should
|
| 64 |
+
|
| 65 |
+
be regularly re-estimated to align with the most recent observations. Therefore, we assume that at each time $t$ we are given a fitted score function $S _ { t } ( \cdot )$ and corresponding quantile function $\hat { Q } _ { t } ( \cdot )$ . We define the realized miscoverage rate of the prediction set $\hat { C } _ { t } ( \alpha ) : = \{ y : S _ { t } ( X _ { t } , y ) \leq \hat { Q } _ { t } ( 1 - \alpha ) \}$ as
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
M _ { t } ( \alpha ) : = \mathbb { P } ( S _ { t } ( X _ { t } , Y _ { t } ) > \hat { Q } _ { t } ( 1 - \alpha ) ) ,
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
where the probability is over the test point $( X _ { t } , Y _ { t } )$ as well as the data used to fit $S _ { t } ( \cdot )$ and $\hat { Q } _ { t } ( \cdot )$
|
| 72 |
+
|
| 73 |
+
Now, since the distribution generating the data is non-stationary we do not expect $M _ { t } ( \alpha )$ to be equal, or even close to, $\alpha$ . Even so, we can still postulate that if the conformity scores used to fit $\hat { Q } _ { t } ( \cdot )$ cover the bulk of the distribution of $S _ { t } ( X _ { t } , Y _ { t } )$ then there may be an alternative value $\alpha _ { t } ^ { * } \in [ 0 , 1 ]$ such that $M _ { t } ( \alpha _ { t } ^ { * } ) \cong \alpha$ . More rigorously, assume that with probability one, $\hat { Q } _ { t } ( \cdot )$ is continuous, non-decreasing and such that $\hat { Q } _ { t } ( 0 ) = - \infty$ and $\hat { Q } _ { t } ( 1 ) = \infty$ . This does not hold for the split conformal quantile functions defined in $( 1 )$ , but in the case where there are no ties amongst the conformity scores we can adjust our definition to guarantee this by smoothing over the jump discontinuities in ${ \hat { Q } } ( \cdot )$ . Then, $M _ { t } ( \cdot )$ will be non-decreasing on $[ 0 , 1 ]$ with $M _ { t } ( 0 ) = 0$ and $M _ { t } ( 1 ) = 1$ and so we may define
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\alpha _ { t } ^ { \ast } : = \operatorname* { s u p } \{ \beta \in [ 0 , 1 ] : M _ { t } ( \beta ) \leq \alpha \} .
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
Moreover, if we additionally assume that
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\mathbb { P } ( S _ { t } ( X _ { t } , Y _ { t } ) = \hat { Q } _ { t } ( 1 - \alpha _ { t } ^ { * } ) ) = 0 ,
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
then we will have that $M _ { t } ( \alpha _ { t } ^ { * } ) = \alpha$ . So, in particular we find that by correctly calibrating the argument to $\hat { Q } _ { t } ( \cdot )$ we can achieve either approximate or exact marginal coverage.
|
| 86 |
+
|
| 87 |
+
To perform this calibration we will use a simple online update. This update proceeds by examining the empirical miscoverage frequency of the previous prediction sets and then decreasing (resp. increasing) our estimate of $\alpha _ { t } ^ { * }$ if the prediction sets were historically under-covering (resp. over-covering) $Y _ { t }$ . In particular, let $\alpha _ { 1 }$ denote our initial estimate (in our experiments we will choose $\alpha _ { 1 } = \alpha$ ). Recursively define the sequence of miscoverage events
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\begin{array} { r } { \mathsf { e r r } _ { t } : = \Bigl \{ \displaystyle 1 , \mathrm { ~ i f ~ } Y _ { t } \notin \hat { C } _ { t } ( \alpha _ { t } ) , \qquad \mathrm { w h e r e ~ } \hat { C } _ { t } ( \alpha _ { t } ) : = \{ y : S _ { t } ( X _ { t } , y ) \leq \hat { Q } _ { t } ( 1 - \alpha _ { t } ) \} . } \end{array}
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
Then, fixing a step size parameter $\gamma > 0$ we consider the simple online update
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\alpha _ { t + 1 } : = \alpha _ { t } + \gamma ( \alpha - \mathrm { e r r } _ { t } ) .
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
We refer to this algorithm as adaptive conformal inference. Here, $\operatorname { e r r } _ { t }$ plays the role of our estimate of the historical miscoverage frequency. A natural alternative to this is the update
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\alpha _ { t + 1 } = \alpha _ { t } + \gamma \left( \alpha - \sum _ { s = 1 } ^ { t } w _ { s } \mathrm { e r r } _ { s } \right) ,
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
where the ap $\{ w _ { s } \} _ { 1 \leq s \leq t } \subseteq [ 0 , 1 ]$ is a sequence of increasing weights with y evaluating the recent empirical miscov $\textstyle \sum _ { s = 1 } ^ { t } w _ { s } = 1$ . This update hasy when deciding whether or not to lower or raise $\alpha _ { t }$ . In practice, we find that $\textcircled{2}$ and $\textcircled{3}$ produce almost identical results. For example, in Section ${ \bf A } . 3$ in the Appendix we show some sample trajectories for $\alpha _ { t }$ obtained using the update $\textcircled { 3 }$ with
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
w _ { s } : = \frac { 0 . 9 5 ^ { t - s } } { \sum _ { s ^ { \prime } = 1 } ^ { t } 0 . 9 5 ^ { t - s ^ { \prime } } } .
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
We find that these trajectories are very similar to those produced by $( 2 )$ . The main difference is that the trajectories obtained with $\textcircled { 3 }$ are smoother with less local variation in $\alpha _ { t }$ . In the remainder of this article we will focus on $( 2 )$ for simplicity.
|
| 112 |
+
|
| 113 |
+
# 2.1 Choosing the step size
|
| 114 |
+
|
| 115 |
+
The choice of $\gamma$ gives a tradeoff between adaptability and stability. While raising the value of $\gamma$ will make the method more adaptive to observed distribution shifts, it will also induce greater volatility in the value of $\alpha _ { t }$ . In practice, large fluctuations in $\alpha _ { t }$ may be undesirable as it allows the method to oscillate between outputting small conservative and large anti-conservative prediction sets.
|
| 116 |
+
|
| 117 |
+
In Theorem $\left| \overline { { 4 . 2 } } \right|$ we give an upper bound on $( M _ { t } ( \alpha _ { t } ) - \alpha ) ^ { 2 }$ that is optimized by choosing $\gamma$ proportional to $\sqrt { \left| \alpha _ { t + 1 } ^ { * } - \alpha _ { t } ^ { * } \right| }$ . While not directly applicable in practice, this result supports the intuition that in environments with greater distributional shift the algorithm needs to be more adapatable and thus $\gamma$ should be chosen to be larger. In our experiments we will take $\gamma = 0 . 0 0 5$ . This value was chosen because it was found to give relatively stable trajectories for $\alpha _ { t }$ while still being sufficiently large as to allow $\alpha _ { t }$ to adapt to observed shifts. In agreement with the general principles outlined above we found that larger values of $\gamma$ also successfully protect against distribution shifts, while taking $\gamma$ to be too small causes adaptive conformal inference to perform similar to non-adaptive methods that hold $\alpha _ { t } = \alpha$ constant across time.
|
| 118 |
+
|
| 119 |
+
# 2.2 Real data example: predicting market volatility
|
| 120 |
+
|
| 121 |
+
We apply ACI to the prediction of market volatility. Let $\{ P _ { t } \} _ { 1 \leq t \leq T }$ denote a sequence of daily open prices for a stock. For all $t \geq 2$ , define the return $R _ { t } : = ( \bar { P } _ { t } - \bar { P } _ { t - 1 } ) / P _ { t - 1 }$ and realized volatility $\dot { V } _ { t } = R _ { t } ^ { 2 }$ . Our goal is to use the previously observed returns $X _ { t } : = \{ R _ { s } \} _ { 1 \leq s \leq t - 1 }$ to form prediction sets for $Y _ { t } : = V _ { t }$ . More sophisticated financial models might augment $X _ { t }$ with additional market covariates (available to the analyst at time $t - 1$ ). As the primary purpose of this section is to illustrate adaptive conformal inference we work with only a simple prediction method.
|
| 122 |
+
|
| 123 |
+
We start off by forming point predictions using a GARCH(1,1) model $\mathbb { \lVert }$ . This method assumes that $R _ { t } = \sigma _ { t } \epsilon _ { t }$ with $\epsilon _ { 2 } , \dots , \epsilon _ { T }$ taken to be i.i.d. $\mathcal { N } ( 0 , 1 )$ and $\sigma _ { t }$ satisfying the recursive update
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\sigma _ { t } ^ { 2 } = \omega + \tau V _ { t - 1 } + \beta \sigma _ { t - 1 } ^ { 2 } .
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
This is a common approach used for forecasting volatility in economics. In practice, shifting market dynamics can cause the predictions of this model to become inaccurate over large time periods. Thus, when forming point predictions we fit the model using only the last 1250 trading days (i.e. approximately 5 years) of market data. More precisely, for all times $t > 1 2 5 0$ we fit the coefficients $\hat { \omega } _ { t } , ~ \hat { \tau } _ { t } , \hat { \beta } _ { t }$ as well as the sequence of variances $\{ \hat { \sigma } _ { s } ^ { t } \} _ { 1 \leq s \leq t - 1 }$ using only the data $\{ R _ { r } \} _ { t - 1 2 5 0 \leq r < t }$ . Then, our point prediction for the realized volatility at time $t$ is
|
| 130 |
+
|
| 131 |
+
$$
|
| 132 |
+
( \hat { \sigma } _ { t } ^ { t } ) ^ { 2 } : = \hat { \omega } _ { t } + \hat { \tau } _ { t } V _ { t - 1 } + \hat { \beta } _ { t } ( \hat { \sigma } _ { t - 1 } ^ { t } ) ^ { 2 } .
|
| 133 |
+
$$
|
| 134 |
+
|
| 135 |
+
To form prediction intervals we define the sequence of conformity scores
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
S _ { t } : = \frac { | V _ { t } - ( \hat { \sigma } _ { t } ^ { t } ) ^ { 2 } | } { ( \hat { \sigma } _ { t } ^ { t } ) ^ { 2 } }
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
and the corresponding quantile function
|
| 142 |
+
|
| 143 |
+
$$
|
| 144 |
+
\hat { Q } _ { t } ( p ) : = \operatorname* { i n f } \left\{ x : \frac { 1 } { 1 2 5 0 } \sum _ { r = t - 1 2 5 0 } ^ { t - 1 } \mathbb { 1 } _ { S _ { r } \leq x } \geq p \right\} .
|
| 145 |
+
$$
|
| 146 |
+
|
| 147 |
+
Then, our prediction set at time $t$ is
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
\hat { C } _ { t } ( \alpha _ { t } ) : = \left\{ v : \frac { | v - ( \hat { \sigma } _ { t } ^ { t } ) ^ { 2 } | } { ( \hat { \sigma } _ { t } ^ { t } ) ^ { 2 } } \leq \hat { Q } _ { t } ( 1 - \alpha _ { t } ) \right\} ,
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
where $\left\{ \alpha _ { t } \right\}$ is initialized with $\alpha _ { 1 2 5 0 } = \alpha = 0 . 1$ and then updated recursively as in $\bigoplus$ .
|
| 154 |
+
|
| 155 |
+
We compare this algorithm to a non-adaptive alternative that takes $\alpha _ { t } = \alpha$ fixed. To measure the performance of these methods across time we examine their local coverage frequencies defined as the average coverage rate over the most recent two years, i.e.
|
| 156 |
+
|
| 157 |
+
$$
|
| 158 |
+
\mathrm { l o c a l C o v } _ { t } : = 1 - { \frac { 1 } { 5 0 0 } } \sum _ { r = t - 2 5 0 + 1 } ^ { t + 2 5 0 } \mathrm { e r r } _ { r } .
|
| 159 |
+
$$
|
| 160 |
+
|
| 161 |
+
If the methods perform well then we expect the local coverage frequency to stay near the target value $1 - \alpha$ across all time points.
|
| 162 |
+
|
| 163 |
+

|
| 164 |
+
Figure 1: Local coverage frequencies for adaptive conformal (blue), a non-adaptive method that holds $\alpha _ { t } = \alpha$ fixed (red), and an i.i.d. Bernoulli(0.1) sequence (grey) for the prediction of stock market volatility. The coloured dotted lines mark the average coverage obtained across all time points, while the black line indicates the target level of $1 - \alpha = 0 . 9$ .
|
| 165 |
+
|
| 166 |
+
Daily open prices were obtained from publicly available datasets published by The Wall Street Journal. The realized local coverage frequencies for the non-adaptive and adaptive conformal methods on four different stocks are shown in Figure $1 .$ These stocks were selected out of a total of 12 stocks that we examined because they showed a clear failure of the non-adaptive method. Adaptive conformal inference was found to perform well in all cases (see Figure 9 in the appendix).
|
| 167 |
+
|
| 168 |
+
As a visual comparator, the grey curves show the moving average 1500 Pt+250r=t 250+1 Ir for sequences $\left\{ I _ { t } \right\} _ { 1 \leq t \leq T }$ that are i.i.d. Bernoulli(0.1). We see that the local coverage frequencies obtained by adaptive conformal inference (blue lines) always stay within the variation that would be expected from an i.i.d. Bernoulli sequence. On the other hand, the non-adaptive method undergoes large excursions away from the target level of $1 - \alpha = 0 . 9$ (red lines). For example, in the bottom right panel we can see that the non-adaptive method fails to cover the realized volatility of Fannie Mae during the 2008 financial crisis, while the adaptive method is robust to this event (see Figure 4 in the Appendix for a plot of the price of Fannie Mae over this time period).
|
| 169 |
+
|
| 170 |
+
# 3 Related Work
|
| 171 |
+
|
| 172 |
+
Prior work on conformal inference has considered two different types of distribution shift $\mathbb { \lVert 3 3 \rVert \lVert 0 \rVert }$ . In both cases the focus was on environments in which the calibration data is drawn i.i.d. from a single distribution $P _ { 0 }$ , while the test point comes from a second distribution $P _ { 1 }$ . In this setting Tibshirani et al. $\mathbb { \lVert 3 3 \rVert }$ showed that valid prediction sets can be obtained by re-weighting the calibration data using the likelihood ratio between $P _ { 1 }$ and $P _ { 0 }$ . However, this requires the conditional distribution of $Y | X$ to be constant between training and testing and the likelihood ratio $P _ { 1 } ( X ) / P _ { 0 } ( X )$ to be either known or very accurately estimated. On the other hand, Cauchois et al. $\mathbb { m }$ develop methods for forming prediction sets that are valid whenever $P _ { 1 }$ and $P _ { 0 }$ are close in $f$ -divergence. Similar to our work, they show that if $D _ { f } ( P _ { 1 } | | P _ { 0 } ) \leq \rho$ then there exists a conservative value $\alpha _ { \rho } \in ( 0 , 1 )$ such that
|
| 173 |
+
|
| 174 |
+
$$
|
| 175 |
+
M ( \alpha _ { \rho } ) : = \mathbb { P } ( S ( X _ { t } , Y _ { t } ) > \hat { Q } ( 1 - \alpha _ { \rho } ) ) \leq \alpha .
|
| 176 |
+
$$
|
| 177 |
+
|
| 178 |
+
The difference between our approach and theirs is twofold. First, while they fix a single conservative value $\alpha _ { \rho }$ our methods aim to estimate the optimal choice $\alpha ^ { * }$ satisfying $M ( \alpha ^ { * } ) = \alpha$ . This is not possible in the setting of $\mathbb { m }$ as they do not observe any data from which the size of the distribution shift can be estimated. Second, while they consider only one training and one testing distribution we work in a fully online setting in which the distribution is allowed to shift continuously over time.
|
| 179 |
+
|
| 180 |
+
# 4 Coverage guarantees
|
| 181 |
+
|
| 182 |
+
# 4.1 Distribution-free results
|
| 183 |
+
|
| 184 |
+
In this section we outline the theoretical coverage guarantees of adaptive conformal inference. We will assume throughout that with probability one $\alpha _ { 1 } \in [ 0 , 1 ]$ and $\hat { Q } _ { t }$ is non-decreasing with $\hat { Q } _ { t } ( x ) = - \infty$ for all $x < 0$ and $\hat { Q } _ { t } ( x ) = \infty$ for all $x > 1$ . Our first result shows that over long time intervals adaptive conformal inference obtains the correct coverage frequency irrespective of any assumptions on the data-generating distribution.
|
| 185 |
+
|
| 186 |
+
Lemma 4.1 With probability one we have that $\forall t \in \mathbb { N }$ , $\alpha _ { t } \in [ - \gamma , 1 + \gamma ]$ .
|
| 187 |
+
|
| 188 |
+
Proof: Assume by contradiction that with positive probability $\{ \alpha _ { t } \} _ { t \in \mathbb { N } }$ is such that $\operatorname* { i n f } _ { t } \alpha _ { t } < - \gamma$ (the case where $\operatorname* { s u p } _ { t } \alpha _ { t } > 1 + \gamma$ is identical). Note that $\begin{array} { r } { \operatorname* { s u p } _ { t } | \alpha _ { t + 1 } - \alpha _ { t } | = \operatorname* { s u p } _ { t } \gamma | \alpha - \mathrm { e r r } _ { t } | < \gamma . } \end{array}$ . Thus, with positive probability we may find $t \in \mathbb { N }$ such that $\alpha _ { t } < 0$ and $\alpha _ { t + 1 } < \alpha _ { t }$ . However,
|
| 189 |
+
|
| 190 |
+
$$
|
| 191 |
+
\alpha _ { t } < 0 \implies \hat { Q } _ { t } ( 1 - \alpha _ { t } ) = \infty \implies \mathrm { e r r } _ { t } = 0 \implies \alpha _ { t + 1 } = \alpha _ { t } + \gamma ( \alpha - \mathrm { e r r } _ { t } ) \geq \alpha _ { t }
|
| 192 |
+
$$
|
| 193 |
+
|
| 194 |
+
and thus $\mathbb { P } ( \exists t$ such that $\alpha _ { t + 1 } < \alpha _ { t } < 0 ) = 0$ . We have reached a contradiction.
|
| 195 |
+
|
| 196 |
+
Proposition 4.1 With probability one we have that for all $T \in \mathbb { N }$ ,
|
| 197 |
+
|
| 198 |
+
$$
|
| 199 |
+
\left| \frac { 1 } { T } \sum _ { t = 1 } ^ { T } e r r _ { t } - \alpha \right| \leq \frac { \operatorname* { m a x } \{ \alpha _ { 1 } , 1 - \alpha _ { 1 } \} + \gamma } { T \gamma } .
|
| 200 |
+
$$
|
| 201 |
+
|
| 202 |
+
$\begin{array} { r } { \operatorname* { l i m } _ { T \to \infty } \frac { 1 } { T } \sum _ { t = 1 } ^ { T } e r r _ { t } \stackrel { a . s . } { = } \alpha } \end{array}$
|
| 203 |
+
|
| 204 |
+
Proof: By expanding the recursion defined in $( 2 )$ and applying Lemma 4.1 we find that
|
| 205 |
+
|
| 206 |
+
$$
|
| 207 |
+
[ - \gamma , 1 + \gamma ] \ni \alpha _ { T + 1 } = \alpha _ { 1 } + \sum _ { t = 1 } ^ { T } \gamma ( \alpha - \mathrm { e r r } _ { t } ) .
|
| 208 |
+
$$
|
| 209 |
+
|
| 210 |
+
Rearranging this gives the result.
|
| 211 |
+
|
| 212 |
+
Proposition $\boxed { 4 . 1 }$ puts no constraints on the data generating distribution. One may immediately ask whether these results can be improved by making mild assumptions on the distribution shifts. We argue that without assumptions on the quality of the initialization the answer to this question is negative. To understand this, consider a setting in which there is a single fixed optimal target $\alpha ^ { * } \in [ 0 , 1 ]$ and assume that
|
| 213 |
+
|
| 214 |
+
$$
|
| 215 |
+
M _ { t } ( p ) = M ( p ) = { \left\{ \begin{array} { l l } { \alpha + { \frac { 1 - \alpha } { 1 - \alpha ^ { * } } } ( p - \alpha ^ { * } ) , { \mathrm { i f ~ } } p > \alpha ^ { * } , } \\ { \alpha + { \frac { \alpha } { \alpha ^ { * } } } ( p - \alpha ^ { * } ) { \mathrm { i f ~ } } p \leq \alpha ^ { * } . } \end{array} \right. } ~ .
|
| 216 |
+
$$
|
| 217 |
+
|
| 218 |
+
Suppose additionally that $\mathbb { E } [ \mathrm { e r r } _ { t } | \alpha _ { t } ] = M ( \alpha _ { t } ) . ^ { 1 }$ In order to simplify the calculations consider the noiseless update $\alpha _ { t + 1 } = \alpha _ { t } + \gamma ( \alpha - M ( \alpha _ { t } ) ) \equiv \alpha _ { t } + \gamma ( \alpha - \mathbb { E } [ \operatorname { e r r } _ { t } | \alpha _ { t } ] )$ . Intuitively, the noiseless update can be viewed as the average case behaviour of $\textstyle \operatorname* { m i n } \{ { \frac { 1 - \alpha ^ { * } } { 1 - \alpha } } , { \frac { \alpha ^ { * } } { \alpha } } \}$ there exists a constant $\textstyle c \in \{ { \frac { 1 - \alpha } { 1 - \alpha ^ { * } } } , { \frac { \alpha } { \alpha ^ { * } } } \}$ $\textcircled { 2 }$ such that for all . Now, for any initialization $t$ , $M ( \alpha _ { t } ) - \alpha = c ( \alpha _ { t } - \alpha ^ { * } )$ $\alpha _ { 1 }$ and any $\gamma \leq$ So, we have that
|
| 219 |
+
|
| 220 |
+
$$
|
| 221 |
+
\begin{array} { r } { \mathbb { E } [ \operatorname { e r r } _ { t } ] - \alpha = c \mathbb { E } [ \alpha _ { t } - \alpha ^ { * } ] = c \mathbb { E } [ \alpha _ { t - 1 } + \gamma ( \alpha - M _ { t - 1 } ( \alpha _ { t - 1 } ) ) - \alpha ^ { * } ] = c ( 1 - c \gamma ) \mathbb { E } [ \alpha _ { t - 1 } - \alpha ^ { * } ] . } \end{array}
|
| 222 |
+
$$
|
| 223 |
+
|
| 224 |
+
Repeating this calculation recursively gives that
|
| 225 |
+
|
| 226 |
+
$$
|
| 227 |
+
\begin{array} { r } { \mathbb { E } [ \mathsf { e r r } _ { t } ] - \alpha = c ( 1 - c \gamma ) ^ { t - 1 } \mathbb { E } [ \alpha _ { 1 } - \alpha ^ { * } ] = c ( 1 - c \gamma ) ^ { t - 1 } ( \alpha _ { 1 } - \alpha ^ { * } ) , } \end{array}
|
| 228 |
+
$$
|
| 229 |
+
|
| 230 |
+
and thus,
|
| 231 |
+
|
| 232 |
+
$$
|
| 233 |
+
\left| \frac { 1 } { T } \sum _ { t = 1 } ^ { T } \mathbb { E } [ \mathsf { e r r } _ { t } ] - \alpha \right| = \frac { 1 - ( 1 - c \gamma ) ^ { T } } { T \gamma } | \alpha _ { 1 } - \alpha ^ { * } | .
|
| 234 |
+
$$
|
| 235 |
+
|
| 236 |
+
The comparison of this bound to $( 5 )$ is self-evident. The main difference is that we have replaced $\operatorname* { m a x } \{ 1 - \alpha _ { 1 } , \alpha _ { 1 } \}$ with $| \alpha _ { 1 } - \alpha ^ { * } |$ . This arises from the fact that $\alpha ^ { * } \in ( 0 , 1 )$ is arbitrary and thus $\operatorname* { m a x } \{ 1 - \alpha _ { 1 } , \alpha _ { 1 } \}$ is the best possible upper bound on $| \alpha _ { 1 } - \alpha ^ { * } |$ . So, we view Proposition $^ { 4 . 1 }$ as both an agnostic guarantee that shows that our method gives the correct long-term empirical coverage frequency irrespective of the true data generating process, and as an approximately tight bound on the worst-case behaviour immediately after initialization.
|
| 237 |
+
|
| 238 |
+
# 4.2 Performance in a hidden Markov model
|
| 239 |
+
|
| 240 |
+
Although we believe Proposition $4 . 1$ is an approximately tight characterization of the behaviour after initialization, we can still ask whether better bounds can be obtained for large time steps. In this section we answer this question positively by showing that if $\alpha _ { 1 }$ is initialized appropriately and the distribution shift is small, then tighter coverage guarantees can be given. In order to obtain useful results we will make some simplifying assumptions about the data generating process. While we do not expect these assumptions to hold exactly in any real-world setting, we do consider our results to be representative of the true behaviour of adaptive conformal inference and we expect similar results to hold under alternative models.
|
| 241 |
+
|
| 242 |
+
# 4.2.1 Setting
|
| 243 |
+
|
| 244 |
+
We model the data as coming from a hidden Markov model. In particular, we let $\{ A _ { t } \} _ { t \in \mathbb { N } } \subseteq { \mathcal { A } }$ denote the underlying Markov chain for the environment and we assume that conditional on $\{ A _ { t } \} _ { t \in \mathbb { N } }$ $\{ ( X _ { t } , Y _ { t } ) \} _ { t \in \mathbb { N } }$ is an independent sequence with $( X _ { t } , Y _ { t } ) \sim P _ { A _ { t } }$ for some collection of distributions $\{ P _ { a } : a \in { \mathcal { A } } \}$ . In order to simplify our calculations, we assume additionally that the estimated quantile function $\hat { Q } _ { t } ( \cdot )$ and score function $S _ { t } ( \cdot )$ do not depend on $t$ and we denote them by ${ \hat { Q } } ( \cdot )$ and $\bar { S } ( \cdot )$ . This occurs for example in the split conformal setting with fixed training and calibration sets.
|
| 245 |
+
|
| 246 |
+
In this setting, $\{ ( \alpha _ { t } , A _ { t } ) \} _ { t \in \mathbb { N } }$ forms a Markov chain on $[ - \gamma , 1 + \gamma ] \times \mathcal { A }$ . We assume that this chain has a unique stationary distribution $\pi$ and that $( \alpha _ { 1 } , A _ { 1 } ) \sim \pi$ . This implies that $\left( \alpha _ { t } , A _ { t } , \mathbf { e r r } _ { t } \right)$ is a stationary process and thus will greatly simplify our characterization of the behaviour of $\mathrm { e r r } _ { t }$ . While there is little doubt that the theory can be extended, recall our that main goal is to get useful and simple results. That said, what we really have in mind here is that $\{ A _ { t } \} _ { t \in \mathbb { N } }$ is sufficiently wellbehaved to guarantee that $( \alpha _ { t } , A _ { t } )$ has a limiting stationary distribution. In Section ${ \bf A } . 5$ we give an example where this is indeed provably the case. Lastly, the assumption that $( \alpha _ { 1 } , \overline { { A _ { 1 } } } ) \sim \overline { { \pi } }$ is essentially equivalent to assuming that we have been running the algorithm for long enough to exit the initialization phase described in Section 4.1.
|
| 247 |
+
|
| 248 |
+
# 4.2.2 Large deviation bound for the errors
|
| 249 |
+
|
| 250 |
+
Our first have that $\operatorname { e r r } _ { t }$ orrect aveand since value. More precisely, by is stationary it follows that $\boxed { 4 . 1 }$ weus, ${ \mathrm { l i m } } _ { T \to \infty } T ^ { - 1 } \sum _ { t = 1 } ^ { T } { \mathrm { e r r } } _ { t } \ { \overset { a . s . } { = } } \alpha$ $\operatorname { e r r } _ { t }$ $\mathbb { E } [ \mathsf { e r r } _ { t } ] = \alpha$ to understand the deviation of T 1 PTt= from $\alpha$ we simply need to characterize the dependence structure of $\{ \mathrm { e r r } _ { t } \} _ { t \in \mathbb { N } }$ .
|
| 251 |
+
|
| 252 |
+
We accomplish this in Theorem $^ { 4 . 1 , }$ which gives a large deviation bound on $\begin{array} { r } { | T ^ { - 1 } \sum _ { t = 1 } ^ { T } \mathrm { e r r } _ { t } - \alpha | } \end{array}$ The idea behind this result is to decompose the dependence in into two parts. First, there is dependence due to the fact that $\alpha _ { t }$ is a function of $\{ \mathrm { e r r } _ { r } \} _ { 1 \leq r \leq t - 1 }$ . In Section $\boxed { \mathbf { A } . 7 }$ in the Appendix we argue that this dependence induces a negative correlation and thus the errors concentrate around their expectation at a rate no slower than that of an i.i.d. Bernoulli sequence. This gives rise to the first term in $( 6 )$ , which is what would be obtained by applying Hoeffding’s inequality to an i.i.d. sequence. Second, there is dependence due to the fact that $A _ { t }$ depends on $A _ { t - 1 }$ . More specifically, consider a setting in which the distribution of $Y | X$ has more variability in some states than others. The goal of adaptive conformal inference is to adapt to the level of variability and thus return larger prediction sets in states where the distribution of $Y | X$ is more spread. However, this algorithm is not perfect and as a result there may be some states $a \in { \mathcal { A } }$ in which $\mathbb { E } [ \mathbf { e r r } _ { t } | A _ { t } = a ]$ is biased away from $\alpha$ . Furthermore, if the environment tends to spend long stretches of time in more variable (or less variable) states this will induce a positive dependence in the errors and cause T 1 PTt=1 to deviate from $\alpha$ . To control this dependence we use a Bernstein inequality for Markov chains to bound $\begin{array} { r } { | T ^ { - 1 } \sum _ { t = 1 } ^ { T } \mathbb { E } [ \mathrm { e r r } _ { t } | A _ { t } ] - \alpha | } \end{array}$ . This gives rise to the second term in $( 6 )$
|
| 253 |
+
|
| 254 |
+
Theorem 4.1 Assume that $\{ A _ { t } \} _ { t \in \mathbb { N } }$ has non-zero absolute spectral gap $1 - \eta > 0$ . Let
|
| 255 |
+
|
| 256 |
+
$$
|
| 257 |
+
B : = \operatorname* { s u p } _ { a \in { \mathcal { A } } } | \mathbb { E } [ \operatorname { e r r } _ { t } | A _ { t } = a ] - \alpha | \quad a n d \quad \sigma _ { B } ^ { 2 } : = \mathbb { E } [ ( \mathbb { E } [ \operatorname { e r r } _ { t } | A _ { t } ] - \alpha ) ^ { 2 } ] .
|
| 258 |
+
$$
|
| 259 |
+
|
| 260 |
+
Then,
|
| 261 |
+
|
| 262 |
+
$$
|
| 263 |
+
\mathbb { P } \left( \left| \frac { 1 } { T } \sum _ { t = 1 } ^ { T } \mathrm { e r r } _ { t } - \alpha \right| \geq \epsilon \right) \leq 2 \exp \left( - \frac { T \epsilon ^ { 2 } } { 8 } \right) + 2 \exp \left( - \frac { T ( 1 - \eta ) \epsilon ^ { 2 } } { 8 ( 1 + \eta ) \sigma _ { B } ^ { 2 } + 2 0 B \epsilon } \right) .
|
| 264 |
+
$$
|
| 265 |
+
|
| 266 |
+
A formal proof of this result can be found in Section $\boxed { \mathbf { A . 7 } }$ The quality of this concentration inequality will depend critically on the size of the bias terms $B$ and $\sigma _ { B } ^ { 2 }$ . Before proceeding, it is important that we emphasize that the definitions of $B$ and $\sigma _ { B } ^ { 2 }$ are independent of the choice of $t$ owing to the fact that $\left( \alpha _ { t } , A _ { t } , \mathbf { e r r } _ { t } \right)$ is assumed stationary. Now, to understand these quantities, let
|
| 267 |
+
|
| 268 |
+
$$
|
| 269 |
+
M ( p | a ) : = \mathbb { P } ( S ( X _ { t } , Y _ { t } ) > \hat { Q } ( 1 - p ) | A _ { t } = a )
|
| 270 |
+
$$
|
| 271 |
+
|
| 272 |
+
denote the realized miscoverage level in state $a \in { \mathcal { A } }$ obtained by the quantile $\hat { Q } ( 1 - p )$ . Assume that $M ( p | a )$ is continuous. This will happen for example when ${ \hat { Q } } ( \cdot )$ is continuous and ${ \cal S } ( X _ { t } , Y _ { t } ) | A _ { t } = a$ is continuously distributed. Then, there exists an optimal value $\alpha _ { a } ^ { * }$ such that $M ( \alpha _ { a } ^ { * } | a ) = \alpha$ . Lemma A.4 in the Appendix shows that if in addition $M ( \cdot | a )$ admits a second order Taylor expansion, then
|
| 273 |
+
|
| 274 |
+
$$
|
| 275 |
+
B \leq C \left( \gamma + \gamma ^ { - 1 } \operatorname* { s u p } _ { a \in \mathcal { A } } \operatorname* { s u p } _ { k \in \mathbb { N } } \mathbb { E } [ \left| \alpha _ { A _ { t + 1 } } ^ { * } - \alpha _ { A _ { t } } ^ { * } \right| \left| A _ { t + k } = a \right| \right) \quad \mathrm { a n d } \quad \sigma _ { B } ^ { 2 } \leq B ^ { 2 } .
|
| 276 |
+
$$
|
| 277 |
+
|
| 278 |
+
Here, the constant $C$ will depend on how much $M ( \cdot | a )$ differs from the ideal case in which ${ \hat { Q } } ( \cdot )$ is the true quantile function for ${ \cal S } ( X _ { t } , Y _ { t } ) | A _ { t } = a$ . In this case we would have that $M ( \cdot | a )$ is the linear function ${ \bf \bar { \cal M } } ( p | a ) = p$ , $\forall p \in [ 0 , 1 ]$ and $C \le 2$ .
|
| 279 |
+
|
| 280 |
+
We remark that the term $\mathbb { E } [ | \alpha _ { A _ { t + 1 } } ^ { * } - \alpha _ { A _ { t } } ^ { * } | \big | A _ { t + k } = a ]$ can be seen as a quantitative measurement of the size of the distribution shift in terms of the change in the critical value $\alpha _ { a } ^ { * }$ . Thus, we interpret these results as showing that if the distribution shift is small and $\forall a \in { \mathcal { A } }$ , ${ \hat { Q } } ( \cdot )$ gives reasonable coverage of the distribution of ${ \cal S } ( X _ { t } , Y _ { t } ) | A _ { t } = a$ , then $T ^ { - 1 } \sum _ { t = 1 } ^ { T } \mathrm { e r r } _ { t }$ 2 A ·will concentrate well around .
|
| 281 |
+
|
| 282 |
+
# 4.2.3 Achieving approximate marginal coverage
|
| 283 |
+
|
| 284 |
+
Theorem $\boxed { 4 . 1 }$ bounds the distance between the average miscoverage rate and the target level over long stretches of time. On the other hand, it provides no information about the marginal coverage frequency at a single time step. The following result shows that if the distribution shift is small, the realized marginal coverage rate $M ( \alpha _ { t } | A _ { t } )$ will be close to $\alpha$ on average.
|
| 285 |
+
|
| 286 |
+
Theorem 4.2 Assume that there exists a constant $L > 0$ such that for all $a \in { \mathcal { A } }$ and all $\alpha _ { 1 } , \alpha _ { 2 } \in \mathbb { R } ,$ ,
|
| 287 |
+
|
| 288 |
+
$$
|
| 289 |
+
| M ( \alpha _ { 2 } | a ) - M ( \alpha _ { 1 } | a ) | \leq L | \alpha _ { 2 } - \alpha _ { 1 } | .
|
| 290 |
+
$$
|
| 291 |
+
|
| 292 |
+
Assume additionally that for all $a \in { \mathcal { A } }$ there exists $\alpha _ { a } ^ { * } \in ( 0 , 1 )$ such that $M ( \alpha _ { a } ^ { * } | a ) = \alpha .$ . Then,
|
| 293 |
+
|
| 294 |
+
$$
|
| 295 |
+
\mathbb { E } [ ( M ( \alpha _ { t } \vert A _ { t } ) - \alpha ) ^ { 2 } ] \leq \frac { L ( 1 + \gamma ) } { \gamma } \mathbb { E } [ \vert \alpha _ { A _ { t + 1 } } ^ { \ast } - \alpha _ { A _ { t } } ^ { \ast } \vert ] + \frac { L } { 2 } \gamma .
|
| 296 |
+
$$
|
| 297 |
+
|
| 298 |
+
Once again we emphasize that $\textcircled{7}$ holds for any choice of $t$ owing to the fact that $\left( \alpha _ { t } , A _ { t } , \mathbf { e r r } _ { t } \right)$ is assumed stationary and thus the quantities appearing in the bound are invariant across $t$ . Proof of this result can be found in Section $\mathbf { \bar { A . 8 } }$ of the Appendix. We remark that the right-hand side of $\textcircled { 7 }$ is minimized by choosing $\gamma = ( 2 \mathbb { E } [ | \overline { { \alpha _ { A _ { t + 1 } } ^ { * } } } - \alpha _ { A _ { t } } ^ { * } | ] ) ^ { 1 / 2 }$ , which gives the inequality
|
| 299 |
+
|
| 300 |
+
$$
|
| 301 |
+
\mathbb { E } [ ( M ( \alpha _ { t } | A _ { t } ) - \alpha ) ^ { 2 } ] \leq L ( \sqrt { 2 } + 1 ) \sqrt { \mathbb { E } [ | \alpha _ { A _ { t + 1 } } ^ { * } - \alpha _ { A _ { t } } ^ { * } | ] } .
|
| 302 |
+
$$
|
| 303 |
+
|
| 304 |
+
As above we have that in the ideal case ${ \hat { Q } } ( \cdot )$ is a perfect estimate of the quantiles of ${ \cal S } ( X _ { t } , Y _ { t } ) | A _ { t } = a$ and thus $M ( p | a ) = p$ and $L = 1$ . Moreover, we once again have the interpretation that $\mathbb { E } [ | \alpha _ { A _ { t + 1 } } ^ { * } -$ $\alpha _ { A _ { t } } ^ { * } | ]$ is a quantitative measurement of the distribution shift. Thus, this result can be interpreted as bounding the average difference between the realized and target marginal coverage in terms of the size of the underlying distribution shift. Finally, note that the choice $\gamma = ( 2 \mathbb { E } [ | \alpha _ { A _ { t + 1 } } ^ { * } - \alpha _ { A _ { t } } ^ { * } | ] ) ^ { 1 / 2 }$ formalizes our intuition that $\gamma$ should be chosen to be larger in domains with greater distribution shift, while not being so large as to cause $\alpha _ { t }$ to be overly volatile.
|
| 305 |
+
|
| 306 |
+
# 5 Impact of $S _ { t } ( \cdot )$ on the performance
|
| 307 |
+
|
| 308 |
+
The performance of all conformal inference methods depends heavily on the design of the conformity score. Previous work has shown how carefully chosen scores or even explicit optimization of the interval width can be used to obtain smaller prediction sets [e.g. 28, 29, 20, 12]. Adaptive conformal inference can work with any conformity score $S _ { t } ( \cdot )$ and quantile function $\hat { Q } _ { t } ( \cdot )$ and thus can be directly combined with other improvements in conformal inference to obtain shorter intervals. One important caveat here is that the lengths of conformal prediction sets depend directly on the quality of the fitted regression model. Thus, to obtain smaller intervals one should re-fit the model at each time step using the most recent data to build the most accurate predictions. This is exactly what we have done in our experiments in Sections $2 . 2$ and 6.
|
| 309 |
+
|
| 310 |
+

|
| 311 |
+
Figure 2: Local coverage frequencies for adaptive conformal (blue), a non-adaptive method that holds $\alpha _ { t } = \alpha$ fixed (red), and an i.i.d. Bernoulli(0.1) sequence (grey) for the prediction of stock market volatility with conformity score $\tilde { S } _ { t }$ . The coloured dotted lines mark the average coverage obtained across all time points, while the black line indicates the target level of $1 - \alpha = 0 . 9$ .
|
| 312 |
+
|
| 313 |
+
In addition to this, the choice of $S _ { t } ( \cdot )$ can also have a direct effect on the coverage properties of adaptive conformal inference. Theorems $\boxed { 4 . 1 }$ and $4 . 2$ show that the performance of adaptive conformal inference is controlled by the size of the shift in the optimal parameter $\alpha _ { t } ^ { * }$ across time. Moreover, $\alpha _ { t } ^ { * }$ itself is in one-to-one correspondence with the $1 - \alpha$ quantile of $S _ { t } ( X _ { t } , Y _ { t } )$ . Thus, the coverage properties of adaptive conformal inference depend on how close $S _ { t } ( X _ { t } , Y _ { t } )$ is to being stationary.
|
| 314 |
+
|
| 315 |
+
For a simple example illustrating the impact of this dependence, note that in Section $\boxed { 2 . 2 }$ we formed prediction sets using the conformity score
|
| 316 |
+
|
| 317 |
+
$$
|
| 318 |
+
S _ { t } : = \frac { | V _ { t } - \hat { \sigma } _ { t } ^ { 2 } | } { \hat { \sigma } _ { t } ^ { 2 } } .
|
| 319 |
+
$$
|
| 320 |
+
|
| 321 |
+
An a priori reasonable alternative to this is the unnormalized score
|
| 322 |
+
|
| 323 |
+
$$
|
| 324 |
+
\tilde { S } _ { t } : = | V _ { t } - \hat { \sigma } _ { t } ^ { 2 } | .
|
| 325 |
+
$$
|
| 326 |
+
|
| 327 |
+
However, after a more careful examination it becomes unsurprising that normalization by $\hat { \sigma } _ { t } ^ { 2 }$ is critical for obtaining an approximately stationary conformity score and thus $\tilde { S } _ { t }$ leads to much worse coverage properties. Figure $2$ shows the local coverage frequency (see $( 4 )$ ) of adaptive conformal inference using $\tilde { S } _ { t }$ . In comparison to Figure $^ 1$ the coverage now undergoes much wider swings away from the target level of 0.9. This issue can be partially mitigated by choosing a larger value of $\gamma$ that gives greater adaptivity to the algorithm.
|
| 328 |
+
|
| 329 |
+
# 6 Real data example: election night predictions
|
| 330 |
+
|
| 331 |
+
During the 2020 US presidential election The Washington Post used conformalized quantile regression (CQR) (see $\mathbb { \underline { { \left( \mathrm { 1 } \right) } } }$ and Section $\boxed { 1 . 1 }$ to produce county level predictions of the vote total on election night [13]. Here we replicate the core elements of this method using both fixed and adaptive quantiles.
|
| 332 |
+
|
| 333 |
+

|
| 334 |
+
Figure 3: Local coverage frequencies of adaptive conformal (blue), a non-adaptive method that holds $\alpha _ { t } = \alpha$ fixed (red), and an i.i.d. Bernoulli(0.1) sequence (grey) for county-level election predictions. Coloured dotted lines show the average coverage across all time points, while the black line indicates the target coverage level of $1 - \alpha = 0 . 9$ .
|
| 335 |
+
|
| 336 |
+
To make the setting precise, let $\{ Y _ { t } \} _ { 1 \leq t \leq T }$ denote the number of votes cast for presidential candidate Joe Biden in the 2020 election in each of approximately $T = 3 0 0 0$ counties in the United States. Let $X _ { t }$ denote a set of demographic covariates associated to the tth county. In our experiment $X _ { t }$ will include information on the make-up of the county population by ethnicity, age, sex, median income and education (see Section $\boxed { \overline { { \mathrm { A } . 6 . 1 } } }$ for details). On election night county vote totals were observed as soon as the vote count was completed. If the order in which vote counts completed was uniformly random $\{ ( X _ { t } , Y _ { t } ) \} _ { 1 \leq t \leq T }$ would be an exchangeable sequence on which we could run standard conformal inference methods. In reality, larger urban counties tend to report results later than smaller rural counties and counties on the east coast of the US report earlier than those on the west coast. Thus, the distribution of $( X _ { t } , Y _ { t } )$ can be viewed as drifting throughout election night.
|
| 337 |
+
|
| 338 |
+
We apply CQR to predict the county-level vote totals (see Section A.6.2 for details). To replicate the east to west coast bias observed on election night we order the counties by their time zone with eastern time counties appearing first and Hawaiian counties appearing last. Within each time zone counties are ordered uniformly at random. Figure $3$ shows the realized local coverage frequency over the most recent 300 counties (see $\textcircled{4}$ ) for the non-adaptive and adaptive conformal methods. We find that the non-adaptive method fails to maintain the desired $9 0 \%$ coverage level, incurring large troughs in its coverage frequency during time zone changes. On the other hand, the adaptive method maintains approximate $9 0 \hat { \% }$ coverage across all time points with deviations in its local coverage level comparable to what is observed in Bernoulli sequences.
|
| 339 |
+
|
| 340 |
+
# 7 Discussion
|
| 341 |
+
|
| 342 |
+
There are still many open problems in this area. The methods we develop are specific to cases where $Y _ { t }$ is revealed at each time point. However, there are many settings in which we receive the response in a delayed fashion or in large batches. In addition, our theoretical results in Section $\boxed { 4 . 2 }$ are limited to a single model for the data generating distribution and the special case where the quantile function $\hat { Q } _ { t } ( \cdot )$ is fixed across time. It would be interesting to determine if similar results can be obtained in settings where $\hat { Q } _ { t } ( \cdot )$ is fit in an online fashion on the most recent data. Another potential area for improvement is in the choice of the step size $\gamma$ . In Section $\boxed { 2 . 1 }$ we give some heuristic guidelines for choosing $\gamma$ based on the size of the distribution shift in the environment. Ideally however we would like to be able to determine $\gamma$ adaptively without prior knowledge. Finally, our experimental results are limited to just two domains. Additional work is needed to determine if our methods can successfully protect against a wider variety of real-world distribution shifts.
|
| 343 |
+
|
| 344 |
+
# 8 Acknowledgements
|
| 345 |
+
|
| 346 |
+
E.C. was supported by Office of Naval Research grant N00014-20-12157, by the National Science Foundation grants OAC 1934578 and DMS 2032014, by the Army Research Office (ARO) under grant W911NF-17-1-0304, and by the Simons Foundation under award 814641. We thank John Cherian for valuable discussions related to Presidential Election Night 2020 and Lihua Lei for helpful comments on the connection to online learning.
|
| 347 |
+
|
| 348 |
+
# References
|
| 349 |
+
|
| 350 |
+
[1] Julia Angwin, Jeff Larson, Surya Mattu, and Lauren Kirchner. Machine bias: There’s software used across the country to predict future criminals. and it’s biased against blacks, 2016. URL https://www.propublica.org/article/ machine-bias-risk-assessments-in-criminal-sentencing.
|
| 351 |
+
[2] Claudine Badue, Rânik Guidolini, Raphael Vivacqua Carneiro, Pedro Azevedo, Vinicius B. Cardoso, Avelino Forechi, Luan Jesus, Rodrigo Berriel, Thiago M. Paixão, Filipe Mutz, Lucas de Paula Veronese, Thiago Oliveira-Santos, and Alberto F. De Souza. Self-driving cars: A survey. Expert Systems with Applications, 165:113816, 2021. ISSN 0957-4174. doi: https: //doi.org/10.1016/j.eswa.2020.113816. URL https://www.sciencedirect.com/science/ article/pii/S095741742030628X.
|
| 352 |
+
[3] Rina Foygel Barber, Emmanuel J. Candès, Aaditya Ramdas, and Ryan J. Tibshirani. Predictive inference with the jackknife+. The Annals of Statistics, 49(1):486 – 507, 2021. doi: 10.1214/ 20-AOS1965. URL https://doi.org/10.1214/20-AOS1965.
|
| 353 |
+
[4] Tim Bollerslev. Generalized autoregressive conditional heteroskedasticity. Journal of Econometrics, 31(3):307–327, 1986. ISSN 0304-4076. doi: https://doi.org/10.1016/ 0304-4076(86)90063-1. URL https://www.sciencedirect.com/science/article/ pii/0304407686900631.
|
| 354 |
+
[5] United States Census Bureau. County characteristics resident population estimates, 2019. data retrieved from https://www.census.gov/data/tables/time-series/demo/popest/ 2010s-counties-detail.html.
|
| 355 |
+
[6] United States Census Bureau. 2015-2019 american community survey 5-year average countylevel estimates, 2019. data retrieved from https://www.ers.usda.gov/data-products/ county-level-data-sets/download-data/.
|
| 356 |
+
[7] United States Census Bureau. Small area income and poverty estimates: 2019, 2019. data retrieved from https://www.ers.usda.gov/data-products/ county-level-data-sets/download-data/.
|
| 357 |
+
[8] Emmanuel J. Candès, Lihua Lei, and Zhimei Ren. Conformalized survival analysis. arXiv preprint, 2021. arXiv:2103.09763.
|
| 358 |
+
[9] X. Cao, J. Zhang, and H. V. Poor. On the time-varying distributions of online stochastic optimization. In 2019 American Control Conference (ACC), pages 1494–1500, 2019. doi: 10.23919/ACC.2019.8814889.
|
| 359 |
+
[10] Maxime Cauchois, Suyash Gupta, Alnur Ali, and John C. Duchi. Robust validation: Confident predictions even when distributions shift. arXiv preprint, 2020. arXiv:2008.04267.
|
| 360 |
+
[11] Maxime Cauchois, Suyash Gupta, and John C. Duchi. Knowing what you know: valid and validated confidence sets in multiclass and multilabel prediction. Journal of Machine Learning Research, 22(81):1–42, 2021. URL http://jmlr.org/papers/v22/20-753.html.
|
| 361 |
+
[12] Haoxian Chen, Ziyi Huang, Henry Lam, Huajie Qian, and Haofeng Zhang. Learning prediction intervals for regression: Generalization and calibration. In Proceedings of The 24th International Conference on Artificial Intelligence and Statistics, volume 130 of Proceedings of Machine Learning Research, pages 820–828. PMLR, 13–15 Apr 2021.
|
| 362 |
+
[13] John Cherian and Lenny Bronner. How the washington post estimates outstanding votes for the 2020 presidential election. https://elex-models-prod.s3.amazonaws.com/ 2020-general/write-up/election_model_writeup.pdf, 2020.
|
| 363 |
+
[14] MIT Election Data and Science Lab. County Presidential Election Returns 2000-2016, 2018. URL https://doi.org/10.7910/DVN/VOQCHQ.
|
| 364 |
+
[15] Rina Foygel Barber, Emmanuel J Candès, Aaditya Ramdas, and Ryan J Tibshirani. The limits of distribution-free conditional predictive inference. Information and Inference: A Journal of the IMA, 08 2020. ISSN 2049-8772. doi: 10.1093/imaiai/iaaa017. URL https: //doi.org/10.1093/imaiai/iaaa017. iaaa017.
|
| 365 |
+
[16] Alexander Gammerman and Vladimir Vovk. Hedging predictions in machine learning. The Computer Journal, 50(2):151–163, 2007. doi: 10.1093/comjnl/bxl065.
|
| 366 |
+
[17] Elad Hazan. Introduction to online convex optimization. arXiv preprint, 2019. arXiv:1909.05207.
|
| 367 |
+
[18] Wassily Hoeffding. Probability inequalities for sums of bounded random variables. Journal of the American Statistical Association, 58(301):13–30, 1963. doi: 10.1080/01621459.1963. 10500830.
|
| 368 |
+
[19] Bai Jiang, Qiang Sun, and Jianqing Fan. Bernstein’s inequality for general markov chains. arXiv preprint, 2020. arXiv:1805.10721.
|
| 369 |
+
[20] Danijel Kivaranovic, Kory D. Johnson, and Hannes Leeb. Adaptive, distribution-free prediction intervals for deep networks. In Proceedings of the Twenty Third International Conference on Artificial Intelligence and Statistics, volume 108 of Proceedings of Machine Learning Research, pages 4346–4356. PMLR, 26–28 Aug 2020.
|
| 370 |
+
[21] Danijel Kivaranovic, Robin Ristl, Martin Posch, and Hannes Leeb. Conformal prediction intervals for the individual treatment effect. arXiv preprint, 2020. arXiv:2006.01474.
|
| 371 |
+
[22] Jing Lei and Larry Wasserman. Distribution-free prediction bands for non-parametric regression. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 76, 01 2014. doi: 10.1111/rssb.12021.
|
| 372 |
+
[23] Jing Lei, Max G’Sell, Alessandro Rinaldo, Ryan J. Tibshirani, and Larry Wasserman. Distribution-free predictive inference for regression. Journal of the American Statistical Association, 113(523):1094–1111, 2018. doi: 10.1080/01621459.2017.1307116. URL https://doi.org/10.1080/01621459.2017.1307116.
|
| 373 |
+
[24] Lihua Lei and Emmanuel J. Candès. Conformal inference of counterfactuals and individual treatment effects. arXiv preprint, 2021. arXiv:2006.06138.
|
| 374 |
+
[25] David Leip. Dave leip’s atlas of u.s. presidential elections., 2020. http://uselectionatlas. org.
|
| 375 |
+
[26] Harris Papadopoulos. Inductive conformal prediction: Theory and application to neural networks. In Tools in Artificial Intelligence,, pages 315–330, 2008.
|
| 376 |
+
[27] Harris Papadopoulos, Kostas Proedrou, Volodya Vovk, and Alex Gammerman. Inductive confidence machines for regression. In Tapio Elomaa, Heikki Mannila, and Hannu Toivonen, editors, Machine Learning: ECML 2002, pages 345–356, Berlin, Heidelberg, 2002. Springer Berlin Heidelberg. ISBN 978-3-540-36755-0.
|
| 377 |
+
[28] Yaniv Romano, Evan Patterson, and Emmanuel Candes. Conformalized quantile regression. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019. URL https://proceedings.neurips.cc/paper/2019/file/ 5103c3584b063c431bd1268e9b5e76fb-Paper.pdf.
|
| 378 |
+
[29] Yaniv Romano, Matteo Sesia, and Emmanuel Candes. Classification with valid and adaptive coverage. In Advances in Neural Information Processing Systems, volume 33, pages 3581–3591, 2020. URL https://proceedings.neurips.cc/paper/2020/file/ 244edd7e85dc81602b7615cd705545f5-Paper.pdf.
|
| 379 |
+
[30] Yaniv Romano, Matteo Sesia, and Emmanuel Candes. Classification with valid and adaptive coverage. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 3581–3591. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper/2020/ file/244edd7e85dc81602b7615cd705545f5-Paper.pdf.
|
| 380 |
+
[31] Mauricio Sadinle, Jing Lei, and Larry Wasserman. Least ambiguous set-valued classifiers with bounded error levels. Journal of the American Statistical Association, 114(525):223–234, 2019. doi: 10.1080/01621459.2017.1395341. URL https://doi.org/10.1080/01621459.2017. 1395341.
|
| 381 |
+
[32] Glenn Shafer and Vladimir Vovk. A tutorial on conformal prediction. Journal of Machine Learning Research, 9(12):371–421, 2008. URL http://jmlr.org/papers/v9/shafer08a. html.
|
| 382 |
+
[33] Ryan J Tibshirani, Rina Foygel Barber, Emmanuel Candes, and Aaditya Ramdas. Conformal prediction under covariate shift. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019. URL https://proceedings.neurips.cc/paper/2019/ file/8fb21ee7a2207526da55a679f0332de2-Paper.pdf.
|
| 383 |
+
[34] Vladimir Vovk, Alex Gammerman, and Glenn Shafer. Algorithmic Learning in a Random World. Springer-Verlag, Berlin, Heidelberg, 2005. ISBN 0387001522.
|
| 384 |
+
[35] Jingyi Zhu and James Spall. Tracking capability of stochastic gradient algorithm with constant gain. In 2016 IEEE 55th Conference on Decision and Control (CDC), pages 4522–4527, 12 2016. doi: 10.1109/CDC.2016.7798957.
|
md/train/B1ckMDqlg/B1ckMDqlg.md
ADDED
|
@@ -0,0 +1,482 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# OUTRAGEOUSLY LARGE NEURAL NETWORKS: THE SPARSELY-GATED MIXTURE-OF-EXPERTS LAYER
|
| 2 |
+
|
| 3 |
+
Noam Shazeer1, Azalia Mirhoseini∗†1, Krzysztof Maziarz∗2, Andy Davis1, Quoc $\mathrm { L e ^ { 1 } }$ , Geoffrey Hinton1 and Jeff Dean1
|
| 4 |
+
|
| 5 |
+
1Google Brain, {noam,azalia,andydavis,qvl,geoffhinton,jeff} $@$ google.com
|
| 6 |
+
2Jagiellonian University, Cracow, krzysztof.maziarz $@$ student.uj.edu.pl
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
The capacity of a neural network to absorb information is limited by its number of parameters. Conditional computation, where parts of the network are active on a per-example basis, has been proposed in theory as a way of dramatically increasing model capacity without a proportional increase in computation. In practice, however, there are significant algorithmic and performance challenges. In this work, we address these challenges and finally realize the promise of conditional computation, achieving greater than $1 0 0 0 \mathrm { x }$ improvements in model capacity with only minor losses in computational efficiency on modern GPU clusters. We introduce a Sparsely-Gated Mixture-of-Experts layer (MoE), consisting of up to thousands of feed-forward sub-networks. A trainable gating network determines a sparse combination of these experts to use for each example. We apply the MoE to the tasks of language modeling and machine translation, where model capacity is critical for absorbing the vast quantities of knowledge available in the training corpora. We present model architectures in which a MoE with up to 137 billion parameters is applied convolutionally between stacked LSTM layers. On large language modeling and machine translation benchmarks, these models achieve significantly better results than state-of-the-art at lower computational cost.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION AND RELATED WORK
|
| 13 |
+
|
| 14 |
+
# 1.1 CONDITIONAL COMPUTATION
|
| 15 |
+
|
| 16 |
+
Exploiting scale in both training data and model size has been central to the success of deep learning. When datasets are sufficiently large, increasing the capacity (number of parameters) of neural networks can give much better prediction accuracy. This has been shown in domains such as text (Sutskever et al., 2014; Bahdanau et al., 2014; Jozefowicz et al., 2016; Wu et al., 2016), images (Krizhevsky et al., 2012; Le et al., 2012), and audio (Hinton et al., 2012; Amodei et al., 2015). For typical deep learning models, where the entire model is activated for every example, this leads to a roughly quadratic blow-up in training costs, as both the model size and the number of training examples increase. Unfortunately, the advances in computing power and distributed computation fall short of meeting such demand.
|
| 17 |
+
|
| 18 |
+
Various forms of conditional computation have been proposed as a way to increase model capacity without a proportional increase in computational costs (Davis & Arel, 2013; Bengio et al., 2013; Eigen et al., 2013; Ludovic Denoyer, 2014; Cho & Bengio, 2014; Bengio et al., 2015; Almahairi et al., 2015). In these schemes, large parts of a network are active or inactive on a per-example basis. The gating decisions may be binary or sparse and continuous, stochastic or deterministic. Various forms of reinforcement learning and back-propagation are proposed for trarining the gating decisions.
|
| 19 |
+
|
| 20 |
+

|
| 21 |
+
Figure 1: A Mixture of Experts (MoE) layer embedded within a recurrent language model. In this case, the sparse gating function selects two experts to perform computations. Their outputs are modulated by the outputs of the gating network.
|
| 22 |
+
|
| 23 |
+
While these ideas are promising in theory, no work to date has yet demonstrated massive improvements in model capacity, training time, or model quality. We blame this on a combination of the following challenges:
|
| 24 |
+
|
| 25 |
+
• Modern computing devices, especially GPUs, are much faster at arithmetic than at branching. Most of the works above recognize this and propose turning on/off large chunks of the network with each gating decision.
|
| 26 |
+
• Large batch sizes are critical for performance, as they amortize the costs of parameter transfers and updates. Conditional computation reduces the batch sizes for the conditionally active chunks of the network.
|
| 27 |
+
• Network bandwidth can be a bottleneck. A cluster of GPUs may have computational power thousands of times greater than the aggregate inter-device network bandwidth. To be computationally efficient, the relative computational versus network demands of an algorithm must exceed this ratio. Embedding layers, which can be seen as a form of conditional computation, are handicapped by this very problem. Since the embeddings generally need to be sent across the network, the number of (example, parameter) interactions is limited by network bandwidth instead of computational capacity. Depending on the scheme, loss terms may be necessary to achieve the desired level of sparsity per-chunk and/or per example. Bengio et al. (2015) use three such terms. These issues can affect both model quality and load-balancing.
|
| 28 |
+
• Model capacity is most critical for very large data sets. The existing literature on conditional computation deals with relatively small image recognition data sets consisting of up to 600,000 images. It is hard to imagine that the labels of these images provide a sufficient signal to adequately train a model with millions, let alone billions of parameters.
|
| 29 |
+
|
| 30 |
+
In this work, we for the first time address all of the above challenges and finally realize the promise of conditional computation. We obtain greater than $1 0 0 0 \mathrm { x }$ improvements in model capacity with only minor losses in computational efficiency and significantly advance the state-of-the-art results on public language modeling and translation data sets.
|
| 31 |
+
|
| 32 |
+
# 1.2 OUR APPROACH: THE SPARSELY-GATED MIXTURE-OF-EXPERTS LAYER
|
| 33 |
+
|
| 34 |
+
Our approach to conditional computation is to introduce a new type of general purpose neural network component: a Sparsely-Gated Mixture-of-Experts Layer (MoE). The MoE consists of a number of experts, each a simple feed-forward neural network, and a trainable gating network which selects a sparse combination of the experts to process each input (see Figure 1). All parts of the network are trained jointly by back-propagation.
|
| 35 |
+
|
| 36 |
+
While the introduced technique is generic, in this paper we focus on language modeling and machine translation tasks, which are known to benefit from very large models. In particular, we apply a MoE convolutionally between stacked LSTM layers (Hochreiter & Schmidhuber, 1997), as in Figure 1. The MoE is called once for each position in the text, selecting a potentially different combination of experts at each position. The different experts tend to become highly specialized based on syntax and semantics (see Appendix E Table 9). On both language modeling and machine translation benchmarks, we improve on best published results at a fraction of the computational cost.
|
| 37 |
+
|
| 38 |
+
# 1.3 RELATED WORK ON MIXTURES OF EXPERTS
|
| 39 |
+
|
| 40 |
+
Since its introduction more than two decades ago (Jacobs et al., 1991; Jordan & Jacobs, 1994), the mixture-of-experts approach has been the subject of much research. Different types of expert architectures hae been proposed such as SVMs (Collobert et al., 2002), Gaussian Processes (Tresp, 2001; Theis & Bethge, 2015; Deisenroth & Ng, 2015), Dirichlet Processes (Shahbaba & Neal, 2009), and deep networks. Other work has focused on different expert configurations such as a hierarchical structure (Yao et al., 2009), infinite numbers of experts (Rasmussen & Ghahramani, 2002), and adding experts sequentially (Aljundi et al., 2016). Garmash & Monz (2016) suggest an ensemble model in the format of mixture of experts for machine translation. The gating network is trained on a pre-trained ensemble NMT model.
|
| 41 |
+
|
| 42 |
+
The works above concern top-level mixtures of experts. The mixture of experts is the whole model. Eigen et al. (2013) introduce the idea of using multiple MoEs with their own gating networks as parts of a deep model. It is intuitive that the latter approach is more powerful, since complex problems may contain many sub-problems each requiring different experts. They also allude in their conclusion to the potential to introduce sparsity, turning MoEs into a vehicle for computational computation.
|
| 43 |
+
|
| 44 |
+
Our work builds on this use of MoEs as a general purpose neural network component. While Eigen et al. (2013) uses two stacked MoEs allowing for two sets of gating decisions, our convolutional application of the MoE allows for different gating decisions at each position in the text. We also realize sparse gating and demonstrate its use as a practical way to massively increase model capacity.
|
| 45 |
+
|
| 46 |
+
# 2 THE STRUCTURE OF THE MIXTURE-OF-EXPERTS LAYER
|
| 47 |
+
|
| 48 |
+
The Mixture-of-Experts (MoE) layer consists of a set of $n$ “expert networks" $E _ { 1 } , \cdots , E _ { n }$ , and a “gating network" $G$ whose output is a sparse $n$ -dimensional vector. Figure 1 shows an overview of the MoE module. The experts are themselves neural networks, each with their own parameters. Although in principle we only require that the experts accept the same sized inputs and produce the same-sized outputs, in our initial investigations in this paper, we restrict ourselves to the case where the models are feed-forward networks with identical architectures, but with separate parameters.
|
| 49 |
+
|
| 50 |
+
Let us denote by $G ( x )$ and $E _ { i } ( x )$ the output of the gating network and the output of the $i$ -th expert network for a given input $x$ . The output $y$ of the MoE module can be written as follows:
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
y = \sum _ { i = 1 } ^ { n } G ( x ) _ { i } E _ { i } ( x )
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
We save computation based on the sparsity of the output of $G ( x )$ . Wherever $G ( x ) _ { i } = 0$ , we need not compute $E _ { i } ( x )$ . In our experiments, we have up to thousands of experts, but only need to evaluate a handful of them for every example. If the number of experts is very large, we can reduce the branching factor by using a two-level hierarchical MoE. In a hierarchical MoE, a primary gating network chooses a sparse weighted combination of “experts", each of which is itself a secondary mixture-of-experts with its own gating network. In the following we focus on ordinary MoEs. We provide more details on hierarchical MoEs in Appendix B.
|
| 57 |
+
|
| 58 |
+
Our implementation is related to other models of conditional computation. A MoE whose experts are simple weight matrices is similar to the parameterized weight matrix proposed in (Cho & Bengio, 2014). A MoE whose experts have one hidden layer is similar to the block-wise dropout described in (Bengio et al., 2015), where the dropped-out layer is sandwiched between fully-activated layers.
|
| 59 |
+
|
| 60 |
+
# 2.1 GATING NETWORK
|
| 61 |
+
|
| 62 |
+
Softmax Gating: A simple choice of non-sparse gating function (Jordan & Jacobs, 1994) is to multiply the input by a trainable weight matrix $W _ { g }$ and then apply the Sof tmax function.
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
G _ { \sigma } ( x ) = S o f t m a x ( x \cdot W _ { g } )
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
Noisy Top-K Gating: We add two components to the Softmax gating network: sparsity and noise. Before taking the softmax function, we add tunable Gaussian noise, then keep only the top $\mathrm { k }$ values, setting the rest to $- \infty$ (which causes the corresponding gate values to equal 0). The sparsity serves to save computation, as described above. While this form of sparsity creates some theoretically scary discontinuities in the output of gating function, we have not yet observed this to be a problem in practice. The noise term helps with load balancing, as will be discussed in Appendix A. The amount of noise per component is controlled by a second trainable weight matrix $W _ { n o i s e }$ .
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
G ( x ) = S o f t m a x ( K e e p T o p K ( H ( x ) , k ) )
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
H ( x ) _ { i } = ( x \cdot W _ { g } ) _ { i } + S t a n d a r d N o r m a l ( ) \cdot S o f t p l u s ( ( x \cdot W _ { n o i s e } ) _ { i } )
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
K e e p T o p K ( v , k ) _ { i } = \left\{ { v _ { i } } \atop { - \infty } \right. \ { \mathrm { ~ i f ~ } } v _ { i } { \mathrm { ~ i s ~ i n ~ t h e ~ t o p ~ } } k { \mathrm { ~ e l e m e n t s ~ o f ~ } } v .
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
Training the Gating Network We train the gating network by simple back-propagation, along with the rest of the model. If we choose $k > 1$ , the gate values for the top $\mathbf { k }$ experts have nonzero derivatives with respect to the weights of the gating network. This type of occasionally-sensitive behavior is described in (Bengio et al., 2013) with respect to noisy rectifiers. Gradients also backpropagate through the gating network to its inputs. Our method differs here from (Bengio et al., 2015) who use boolean gates and a REINFORCE-style approach to train the gating network.
|
| 83 |
+
|
| 84 |
+
# 3 ADDRESSING PERFORMANCE CHALLENGES
|
| 85 |
+
|
| 86 |
+
# 3.1 THE SHRINKING BATCH PROBLEM
|
| 87 |
+
|
| 88 |
+
On modern CPUs and GPUs, large batch sizes are necessary for computational efficiency, so as to amortize the overhead of parameter loads and updates. If the gating network chooses $k$ out of $n$ experts for each example, then for a batch of $b$ examples, each expert receives a much smaller batch of approximately ${ \frac { \hbar b } { n } } \ll b$ examples. This causes a naive MoE implementation to become very inefficient as the number of experts increases. The solution to this shrinking batch problem is to make the original batch size as large as possible. However, batch size tends to be limited by the memory necessary to store activations between the forwards and backwards passes. We propose the following techniques for increasing the batch size:
|
| 89 |
+
|
| 90 |
+
Mixing Data Parallelism and Model Parallelism: In a conventional distributed training setting, multiple copies of the model on different devices asynchronously process distinct batches of data, and parameters are synchronized through a set of parameter servers. In our technique, these different batches run synchronously so that they can be combined for the MoE layer. We distribute the standard layers of the model and the gating network according to conventional data-parallel schemes, but keep only one shared copy of each expert. Each expert in the MoE layer receives a combined batch consisting of the relevant examples from all of the data-parallel input batches. The same set of devices function as data-parallel replicas (for the standard layers and the gating networks) and as model-parallel shards (each hosting a subset of the experts). If the model is distributed over $d$ devices, and each device processes a batch of size $b$ , each expert receives a batch of approximately $\frac { k b d } { n }$ examples. Thus, we achieve a factor of $d$ improvement in expert batch size.
|
| 91 |
+
|
| 92 |
+
In the case of a hierarchical MoE (Section B), the primary gating network employs data parallelism, and the secondary MoEs employ model parallelism. Each secondary MoE resides on one device.
|
| 93 |
+
|
| 94 |
+
This technique allows us to increase the number of experts (and hence the number of parameters) by proportionally increasing the number of devices in the training cluster. The total batch size increases, keeping the batch size per expert constant. The memory and bandwidth requirements per device also remain constant, as do the step times, as does the amount of time necessary to process a number of training examples equal to the number of parameters in the model. It is our goal to train a trillionparameter model on a trillion-word corpus. We have not scaled our systems this far as of the writing of this paper, but it should be possible by adding more hardware.
|
| 95 |
+
|
| 96 |
+
Taking Advantage of Convolutionality: In our language models, we apply the same MoE to each time step of the previous layer. If we wait for the previous layer to finish, we can apply the MoE to all the time steps together as one big batch. Doing so increases the size of the input batch to the MoE layer by a factor of the number of unrolled time steps.
|
| 97 |
+
|
| 98 |
+
Increasing Batch Size for a Recurrent MoE: We suspect that even more powerful models may involve applying a MoE recurrently. For example, the weight matrices of a LSTM or other RNN could be replaced by a MoE. Sadly, such models break the convolutional trick from the last paragraph, since the input to the MoE at one timestep depends on the output of the MoE at the previous timestep. Gruslys et al. (2016) describe a technique for drastically reducing the number of stored activations in an unrolled RNN, at the cost of recomputing forward activations. This would allow for a large increase in batch size.
|
| 99 |
+
|
| 100 |
+
# 3.2 NETWORK BANDWIDTH
|
| 101 |
+
|
| 102 |
+
Another major performance concern in distributed computing is network bandwidth. Since the experts are stationary (see above) and the number of gating parameters is small, most of the communication involves sending the inputs and outputs of the experts across the network. To maintain computational efficiency, the ratio of an expert’s computation to the size of its input and output must exceed the ratio of computational to network capacity of the computing device. For GPUs, this may be thousands to one. In our experiments, we use experts with one hidden layer containing thousands of RELU-activated units. Since the weight matrices in the expert have sizes input_size×hidden_size and hidden_size × output_size, the ratio of computation to input and output is equal to the size of the hidden layer. Conveniently, we can increase computational efficiency simply by using a larger hidden layer, or more hidden layers.
|
| 103 |
+
|
| 104 |
+
# 4 BALANCING EXPERT UTILIZATION
|
| 105 |
+
|
| 106 |
+
We have observed that the gating network tends to converge to a state where it always produces large weights for the same few experts. This imbalance is self-reinforcing, as the favored experts are trained more rapidly and thus are selected even more by the gating network. Eigen et al. (2013) describe the same phenomenon, and use a hard constraint at the beginning of training to avoid this local minimum. Bengio et al. (2015) include a soft constraint on the batch-wise average of each gate.1
|
| 107 |
+
|
| 108 |
+
We take a soft constraint approach. We define the importance of an expert relative to a batch of training examples to be the batchwise sum of the gate values for that expert. We define an additional loss $L _ { i m p o r t a n c e }$ , which is added to the overall loss function for the model. This loss is equal to the square of the coefficient of variation of the set of importance values, multiplied by a hand-tuned scaling factor wimportance. This additional loss encourages all experts to have equal importance.
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
I m p o r t a n c e ( X ) = \sum _ { x \in X } G ( x )
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
L _ { i m p o r t a n c e } ( X ) = w _ { i m p o r t a n c e } \cdot C V ( I m p o r t a n c e ( X ) ) ^ { 2 }
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
While this loss function can ensure equal importance, experts may still receive very different numbers of examples. For example, one expert may receive a few examples with large weights, and another may receive many examples with small weights. This can cause memory and performance problems on distributed hardware. To solve this problem, we introduce a second loss function, $L _ { l o a d }$ , which ensures balanced loads. Appendix A contains the definition of this function, along with experimental results.
|
| 119 |
+
|
| 120 |
+
# 5 EXPERIMENTS
|
| 121 |
+
|
| 122 |
+
# 5.1 1 BILLION WORD LANGUAGE MODELING BENCHMARK
|
| 123 |
+
|
| 124 |
+
Dataset: This dataset, introduced by (Chelba et al., 2013) consists of shuffled unique sentences from news articles, totaling approximately 829 million words, with a vocabulary of 793,471 words.
|
| 125 |
+
|
| 126 |
+
Previous State-of-the-Art: The best previously published results (Jozefowicz et al., 2016) use models consisting of one or more stacked Long Short-Term Memory (LSTM) layers (Hochreiter & Schmidhuber, 1997; Gers et al., 2000). The number of parameters in the LSTM layers of these models vary from 2 million to 151 million. Quality increases greatly with parameter count, as do computational costs. Results for these models form the top line of Figure 2-right.
|
| 127 |
+
|
| 128 |
+
MoE Models: Our models consist of two stacked LSTM layers with a MoE layer between them (see Figure 1). We vary the sizes of the layers and the number of experts. For full details on model architecture, training regimen, additional baselines and results, see Appendix C.
|
| 129 |
+
|
| 130 |
+
Low Computation, Varied Capacity: To investigate the effects of adding capacity, we trained a series of MoE models all with roughly equal computational costs: about 8 million multiply-andadds per training example per timestep in the forwards pass, excluding the softmax layer. We call this metric (ops/timestep). We trained models with flat MoEs containing 4, 32, and 256 experts, and models with hierarchical MoEs containing 256, 1024, and 4096 experts. Each expert had about 1 million parameters. For all the MoE layers, 4 experts were active per input.
|
| 131 |
+
|
| 132 |
+
The results of these models are shown in Figure 2-left. The model with 4 always-active experts performed (unsurprisingly) similarly to the computationally-matched baseline models, while the largest of the models (4096 experts) achieved an impressive $24 \%$ lower perplexity on the test set.
|
| 133 |
+
|
| 134 |
+

|
| 135 |
+
|
| 136 |
+

|
| 137 |
+
Figure 2: Model comparison on 1-Billion-Word Language-Modeling Benchmark. On the left, we plot test perplexity as a function of model capacity for models with similar computational budgets of approximately 8-million-ops-per-timestep. On the right, we plot test perplexity as a function of computational budget. The top line represents the LSTM models from (Jozefowicz et al., 2016). The bottom line represents 4-billion parameter MoE models with different computational budgets.
|
| 138 |
+
|
| 139 |
+
Varied Computation, High Capacity: In addition to the largest model from the previous section, we trained two more MoE models with similarly high capacity (4 billion parameters), but higher computation budgets. These models had larger LSTMs, and fewer but larger experts. Details can be found in Appendix C.2. Results of these three models form the bottom line of Figure 2-right. Table 1 compares the results of these models to the best previously-published result on this dataset . Even the fastest of these models beats the best published result (when controlling for the number of training epochs), despite requiring only $6 \%$ of the computation.
|
| 140 |
+
|
| 141 |
+
Table 1: Summary of high-capacity MoE-augmented models with varying computational budgets, vs. best previously published results (Jozefowicz et al., 2016). Details in Appendix C.
|
| 142 |
+
|
| 143 |
+
<table><tr><td></td><td>Test Perplexity 10 epochs</td><td>Test Perplexity 100 epochs</td><td>#Parameters excluding embedding and softmax layers</td><td>ops/timestep</td><td>Training Time 10 epochs</td><td>TFLOPS /GPU</td></tr><tr><td>BestPublishedResults</td><td>34.7</td><td>30.6</td><td>151 million</td><td>151 million</td><td>59 hours,32 k40s</td><td>1.09</td></tr><tr><td>Low-BudgetMoEModel</td><td>34.1</td><td></td><td>4303million</td><td>8.9 million</td><td>15 hours,16 k40s</td><td>0.74</td></tr><tr><td>Medium-Budget MoE Model</td><td>31.3</td><td></td><td>4313 million</td><td>33.8 million</td><td>17 hours,32 k40s</td><td>1.22</td></tr><tr><td>High-Budget MoE Model</td><td>28.0</td><td></td><td>4371 million</td><td>142.7 million</td><td>47 hours,32 k40s</td><td>1.56</td></tr></table>
|
| 144 |
+
|
| 145 |
+
Computational Efficiency: We trained our models using TensorFlow (Abadi et al., 2016) on clusters containing 16-32 Tesla K40 GPUs. For each of our models, we determine computational efficiency in TFLOPS/GPU by dividing the number of floating point operations required to process one training batch by the observed step time and the number of GPUs in the cluster. The operation counts used here are higher than the ones we report in our ops/timestep numbers in that we include the backwards pass, we include the importance-sampling-based training of the softmax layer, and we count a multiply-and-add as two separate operations. For all of our MoE models, the floating point operations involved in the experts represent between $37 \%$ and $46 \%$ of the total.
|
| 146 |
+
|
| 147 |
+
For our baseline models wtih no MoE, observed computational efficiency ranged from 1.07-1.29 TFLOPS/GPU. For our low-computation MoE models, computation efficiency ranged from 0.74- 0.90 TFLOPS/GPU, except for the 4-expert model which did not make full use of the available parallelism. Our highest-computation MoE model was more efficient at 1.56 TFLOPS/GPU, likely due to the larger matrices. These numbers represent a significant fraction of the theoretical maximum of 4.29 TFLOPS/GPU claimed by NVIDIA. Detailed results are in Appendix C, Table 7.
|
| 148 |
+
|
| 149 |
+
# 5.2 100 BILLION WORD GOOGLE NEWS CORPUS
|
| 150 |
+
|
| 151 |
+

|
| 152 |
+
Figure 3: Language modeling on a 100 billion word corpus. Models have similar computational budgets (8 million ops/timestep).
|
| 153 |
+
|
| 154 |
+
On the 1-billion-word corpus, adding additional capacity seems to produce diminishing returns as the number of parameters in the MoE layer exceeds 1 billion, as can be seen in Figure 2-left. We hypothesized that for a larger training set, even higher capacities would produce significant quality improvements.
|
| 155 |
+
|
| 156 |
+
We constructed a similar training set consisting of shuffled unique sentences from Google’s internal news corpus, totalling roughly 100 billion words. Similarly to the previous section, we tested a series of models with similar computational costs of about 8 million ops/timestep. In addition to a baseline LSTM model, we trained models augmented with MoE layers containing 32, 256, 1024,
|
| 157 |
+
|
| 158 |
+
4096, 16384, 65536, and 131072 experts. This corresponds to up to 137 billion parameters in the MoE layer. Details on architecture, training, and results are given in Appendix D.
|
| 159 |
+
|
| 160 |
+
Results: Figure 3 shows test perplexity as a function of capacity after training on 10 billion words (top line) and 100 billion words (bottom line). When training over the full 100 billion words, test perplexity improves significantly up to 65536 experts (68 billion parameters), dropping $39 \%$ lower than the computationally matched baseline, but degrades at 131072 experts, possibly a result of too much sparsity. The widening gap between the two lines demonstrates (unsurprisingly) that increased model capacity helps more on larger training sets.
|
| 161 |
+
|
| 162 |
+
Even at 65536 experts $( 9 9 . 9 9 4 \%$ layer sparsity), computational efficiency for the model stays at a respectable 0.72 TFLOPS/GPU.
|
| 163 |
+
|
| 164 |
+
# 5.3 MACHINE TRANSLATION (SINGLE LANGUAGE PAIR)
|
| 165 |
+
|
| 166 |
+
Model Architecture: Our model was a modified version of the GNMT model described in (Wu et al., 2016). To reduce computation, we decreased the number of LSTM layers in the encoder and decoder from 9 and 8 to 3 and 2 respectively. We inserted MoE layers in both the encoder (between layers 2 and 3) and the decoder (between layers 1 and 2). Each MoE layer contained up to 2048 experts each with about two million parameters, adding a total of about 8 billion parameters to the models. Further details on model architecture, testing procedure and results can be found in Appendix E.
|
| 167 |
+
|
| 168 |
+
Datasets: We benchmarked our method on the WMT’14 En ${ } \mathrm { F r }$ and $\mathrm { E n } { } \mathrm { D e }$ corpora, whose training sets have 36M sentence pairs and 5M sentence pairs, respectively. The experimental protocols were also similar to those in (Wu et al., 2016): newstest2014 was used as the test set to compare against previous work (Luong et al., 2015a; Zhou et al., 2016; Wu et al., 2016), while the combination of newstest2012 and newstest2013 was used as the development set. We also tested the same model on Google’s Production English to French data.
|
| 169 |
+
|
| 170 |
+
Table 2: Results on WMT’ $1 4 \mathrm { E n }$ Fr newstest2014 (bold values represent best results).
|
| 171 |
+
|
| 172 |
+
<table><tr><td>Model</td><td>Test Perplexity</td><td>Test BLEU</td><td>ops/timenstep</td><td>Total #Parameters</td><td>Training Time</td></tr><tr><td>MoE with 2048 Experts MoE with 2048 Experts (longer training)</td><td>2.69 2.63</td><td>40.35</td><td>85M</td><td>8.7B 8.7B</td><td>3 days/64k40s 6 days/64 k40s</td></tr><tr><td>GNMT (Wu et al., 2016)</td><td>2.79</td><td>40.56 39.22</td><td>85M 214M</td><td>278M</td><td>6 days/96k80s</td></tr><tr><td>GNMT+RL (Wu et al., 2016)</td><td>2.96</td><td>39.92</td><td>214M</td><td>278M</td><td>6 days/96 k80s</td></tr><tr><td>PBMT(Durrani et al.,2014)</td><td></td><td>37.0</td><td></td><td></td><td></td></tr><tr><td>LSTM(6-layer) (Luong et al.,2015b)</td><td></td><td>31.5</td><td></td><td></td><td></td></tr><tr><td>LSTM(6-layer+PosUnk)(Luong et al.,2015b)</td><td></td><td>33.1</td><td></td><td></td><td></td></tr><tr><td>DeepAtt (Zhou et al.,2016)</td><td></td><td>37.7</td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>DeepAtt+PosUnk (Zhou et al.,2016)</td><td></td><td>39.2</td><td></td><td></td><td></td></tr></table>
|
| 173 |
+
|
| 174 |
+
Table 3: Results on WMT’14 En De newstest2014 (bold values represent best results).
|
| 175 |
+
|
| 176 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>TestPerplexity</td><td rowspan=1 colspan=1>TestBLEU</td><td rowspan=1 colspan=1>ops/timestep</td><td rowspan=1 colspan=1>Total#Parameters</td><td rowspan=1 colspan=1>TrainingTime</td></tr><tr><td rowspan=1 colspan=1>MoE with 2048 Experts</td><td rowspan=1 colspan=1>4.64</td><td rowspan=1 colspan=1>26.03</td><td rowspan=1 colspan=1>85M</td><td rowspan=1 colspan=1>8.7B</td><td rowspan=1 colspan=1>1 day/64 k40s</td></tr><tr><td rowspan=1 colspan=1>GNMT (Wu et al., 2016)GNMT +RL (Wu et al., 2016)PBMT (Durrani et al.,2014)DeepAtt (Zhou et al.,2016)</td><td rowspan=1 colspan=1>5.258.08</td><td rowspan=1 colspan=1>24.9124.6620.720.6</td><td rowspan=1 colspan=1>214M214M</td><td rowspan=1 colspan=1>278M278M</td><td rowspan=1 colspan=1>1 day/96k80s1 day/96 k80s</td></tr></table>
|
| 177 |
+
|
| 178 |
+
Table 4: Results on the Google Production $\mathrm { E n } { }$ Fr dataset (bold values represent best results).
|
| 179 |
+
|
| 180 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>EvalPerplexity</td><td rowspan=1 colspan=1>EvalBLEU</td><td rowspan=1 colspan=1>TestPerplexity</td><td rowspan=1 colspan=1>TestBLEU</td><td rowspan=1 colspan=1>ops/timestep</td><td rowspan=1 colspan=1>Total#Parameters</td><td rowspan=1 colspan=1>TrainingTime</td></tr><tr><td rowspan=1 colspan=1>MoEwith 2048Experts</td><td rowspan=1 colspan=1>2.60</td><td rowspan=1 colspan=1>37.27</td><td rowspan=1 colspan=1>2.69</td><td rowspan=1 colspan=1>36.57</td><td rowspan=1 colspan=1>85M</td><td rowspan=1 colspan=1>8.7B</td><td rowspan=1 colspan=1>1 day/64 k40s</td></tr><tr><td rowspan=1 colspan=1>GNMT(Wu et al.,2016)</td><td rowspan=1 colspan=1>2.78</td><td rowspan=1 colspan=1>35.80</td><td rowspan=1 colspan=1>2.87</td><td rowspan=1 colspan=1>35.56</td><td rowspan=1 colspan=1>214M</td><td rowspan=1 colspan=1>278M</td><td rowspan=1 colspan=1>6 days/96k80s</td></tr></table>
|
| 181 |
+
|
| 182 |
+
Results: Tables 2, 3, and 4 show the results of our largest models, compared with published results. Our approach achieved BLEU scores of 40.56 and 26.03 on the WMT’ $1 4 ~ \mathrm { E n { \to } F r }$ and $\mathrm { E n } { } \mathrm { D e }$ benchmarks. As our models did not use RL refinement, these results constitute significant gains of 1.34 and 1.12 BLEU score on top of the strong baselines in (Wu et al., 2016). The perplexity scores are also better.2 On the Google Production dataset, our model achieved 1.01 higher test BLEU score even after training for only one sixth of the time.
|
| 183 |
+
|
| 184 |
+
# 5.4 MULTILINGUAL MACHINE TRANSLATION
|
| 185 |
+
|
| 186 |
+
Dataset: (Johnson et al., 2016) train a single GNMT (Wu et al., 2016) model on a very large combined dataset of twelve language pairs. Results are somewhat worse than those for 12 separately trained single-pair GNMT models. This is not surprising, given that the twelve models have 12 times the capacity and twelve times the aggregate training of the one model. We repeat this experiment with a single MoE-augmented model. See Appendix E for details on model architecture. We train our model on the same dataset as (Johnson et al., 2016) and process the same number of training examples (about 3 billion sentence pairs). Our training time was shorter due to the lower computational budget of our model.
|
| 187 |
+
|
| 188 |
+
Results: Results for the single-pair GNMT models, the multilingual GNMT model and the multilingual MoE model are given in Table 5. The MoE model achieves $19 \%$ lower perplexity on the dev set than the multilingual GNMT model. On BLEU score, the MoE model significantly beats the multilingual GNMT model on 11 of the 12 language pairs (by as much as 5.84 points), and even beats the monolingual GNMT models on 8 of 12 language pairs. The poor performance on English Korean seems to be a result of severe overtraining, as for the rarer language pairs a small number of real examples were highly oversampled in the training corpus.
|
| 189 |
+
|
| 190 |
+
Table 5: Multilingual Machine Translation (bold values represent best results).
|
| 191 |
+
|
| 192 |
+
<table><tr><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>GNMT-Mono</td><td rowspan=1 colspan=1>GNMT-Multi</td><td rowspan=1 colspan=1>MoE-Multi</td><td rowspan=1 colspan=1>MoE-Multi vs.GNMT-Multi</td></tr><tr><td rowspan=1 colspan=2>Parametersops/timesteptraining time,hardware</td><td rowspan=1 colspan=1>278M/model212Mvarious</td><td rowspan=1 colspan=1>278M212M21 days,96 k20s</td><td rowspan=1 colspan=1>8.7B102M12 days,64 k40s</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=12 colspan=2>Perplexity (dev)French →English Test BLEUGerman →English Test BLEUJapanese→English Test BLEUKorean →English Test BLEUPortuguese→English Test BLEUSpanish →English Test BLEUEnglish→French Test BLEUEnglish→German Test BLEUEnglish →Japanese Test BLEUEnglish→Korean Test BLEUEnglish →Portuguese Test BLEU</td><td rowspan=2 colspan=1>36.47</td><td rowspan=1 colspan=1>4.14</td><td rowspan=1 colspan=1>3.35</td><td rowspan=1 colspan=1>-19%</td></tr><tr><td rowspan=1 colspan=1>34.40</td><td rowspan=1 colspan=1>37.46</td><td rowspan=1 colspan=1>+3.06</td></tr><tr><td rowspan=1 colspan=1>31.77</td><td rowspan=1 colspan=1>31.17</td><td rowspan=1 colspan=1>34.80</td><td rowspan=1 colspan=1>+3.63</td></tr><tr><td rowspan=1 colspan=1>23.41</td><td rowspan=1 colspan=1>21.62</td><td rowspan=1 colspan=1>25.91</td><td rowspan=1 colspan=1>+4.29</td></tr><tr><td rowspan=1 colspan=1>25.42</td><td rowspan=1 colspan=1>22.87</td><td rowspan=1 colspan=1>28.71</td><td rowspan=1 colspan=1>+5.84</td></tr><tr><td rowspan=1 colspan=1>44.40</td><td rowspan=1 colspan=1>42.53</td><td rowspan=1 colspan=1>46.13</td><td rowspan=1 colspan=1>+3.60</td></tr><tr><td rowspan=1 colspan=1>38.00</td><td rowspan=1 colspan=1>36.04</td><td rowspan=1 colspan=1>39.39</td><td rowspan=1 colspan=1>+3.35</td></tr><tr><td rowspan=1 colspan=1>English→French Test BLEU</td><td rowspan=1 colspan=1>35.37</td><td rowspan=1 colspan=1>34.00</td><td rowspan=1 colspan=1>36.59</td><td rowspan=1 colspan=1>+2.59</td></tr><tr><td rowspan=1 colspan=1>English→German Test BLEU</td><td rowspan=1 colspan=1>26.43</td><td rowspan=1 colspan=1>23.15</td><td rowspan=1 colspan=1>24.53</td><td rowspan=1 colspan=1>+1.38</td></tr><tr><td rowspan=1 colspan=1>23.66</td><td rowspan=1 colspan=1>21.10</td><td rowspan=1 colspan=1>22.78</td><td rowspan=1 colspan=1>+1.68</td></tr><tr><td rowspan=3 colspan=2>English→Korean Test BLEUEnglish →Portuguese Test BLEUEnglish →Spanish Test BLEU</td><td rowspan=1 colspan=1>19.75</td><td rowspan=1 colspan=1>18.41</td><td rowspan=1 colspan=1>16.62</td><td rowspan=1 colspan=1>-1.79</td></tr><tr><td rowspan=1 colspan=1>38.40</td><td rowspan=1 colspan=1>37.35</td><td rowspan=1 colspan=1>37.90</td><td rowspan=1 colspan=1>+0.55</td></tr><tr><td rowspan=1 colspan=1>34.50</td><td rowspan=1 colspan=1>34.25</td><td rowspan=1 colspan=1>36.21</td><td rowspan=1 colspan=1>+1.96</td></tr></table>
|
| 193 |
+
|
| 194 |
+
# 6 CONCLUSION
|
| 195 |
+
|
| 196 |
+
This work is the first to demonstrate major wins from conditional computation in deep networks. We carefully identified the design considerations and challenges of conditional computing and addressed them with a combination of algorithmic and engineering solutions. While we focused on text, conditional computation may help in other domains as well, provided sufficiently large training sets. We look forward to seeing many novel implementations and applications of conditional computation in the years to come.
|
| 197 |
+
|
| 198 |
+
# ACKNOWLEDGMENTS
|
| 199 |
+
|
| 200 |
+
We would like to thank all of the members of the Google Brain and Google Translate teams who helped us with this project, in particular Zhifeng Chen, Yonghui Wu, and Melvin Johnson. Thanks also to our anonymous ICLR reviewers for the helpful suggestions on making this paper better.
|
| 201 |
+
|
| 202 |
+
# REFERENCES
|
| 203 |
+
|
| 204 |
+
Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Gregory S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian J. Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Józefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dan Mané, Rajat Monga, Sherry Moore, Derek Gordon Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul A. Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda B. Viégas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. Tensorflow: Large-scale machine learning on heterogeneous distributed systems. CoRR, abs/1603.04467, 2016. URL http://arxiv.org/abs/1603.04467.
|
| 205 |
+
|
| 206 |
+
Rahaf Aljundi, Punarjay Chakravarty, and Tinne Tuytelaars. Expert gate: Lifelong learning with a network of experts. CoRR, abs/1611.06194, 2016. URL http://arxiv.org/abs/1611. 06194.
|
| 207 |
+
|
| 208 |
+
A. Almahairi, N. Ballas, T. Cooijmans, Y. Zheng, H. Larochelle, and A. Courville. Dynamic Capacity Networks. ArXiv e-prints, November 2015.
|
| 209 |
+
|
| 210 |
+
Dario Amodei, Rishita Anubhai, Eric Battenberg, Carl Case, Jared Casper, Bryan Catanzaro, Jingdong Chen, Mike Chrzanowski, Adam Coates, Greg Diamos, Erich Elsen, Jesse Engel, Linxi Fan, Christopher Fougner, Tony Han, Awni Y. Hannun, Billy Jun, Patrick LeGresley, Libby Lin, Sharan Narang, Andrew Y. Ng, Sherjil Ozair, Ryan Prenger, Jonathan Raiman, Sanjeev Satheesh, David Seetapun, Shubho Sengupta, Yi Wang, Zhiqian Wang, Chong Wang, Bo Xiao, Dani Yogatama, Jun Zhan, and Zhenyao Zhu. Deep speech 2: End-to-end speech recognition in english and mandarin. arXiv preprint arXiv:1512.02595, 2015.
|
| 211 |
+
|
| 212 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014.
|
| 213 |
+
|
| 214 |
+
Emmanuel Bengio, Pierre-Luc Bacon, Joelle Pineau, and Doina Precup. Conditional computation in neural networks for faster models. arXiv preprint arXiv:1511.06297, 2015.
|
| 215 |
+
|
| 216 |
+
Yoshua Bengio, Nicholas Léonard, and Aaron Courville. Estimating or propagating gradients through stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432, 2013.
|
| 217 |
+
|
| 218 |
+
Ciprian Chelba, Tomas Mikolov, Mike Schuster, Qi Ge, Thorsten Brants, Phillipp Koehn, and Tony Robinson. One billion word benchmark for measuring progress in statistical language modeling. arXiv preprint arXiv:1312.3005, 2013.
|
| 219 |
+
|
| 220 |
+
K. Cho and Y. Bengio. Exponentially Increasing the Capacity-to-Computation Ratio for Conditional Computation in Deep Learning. ArXiv e-prints, June 2014.
|
| 221 |
+
|
| 222 |
+
Ronan Collobert, Samy Bengio, and Yoshua Bengio. A parallel mixture of SVMs for very large scale problems. Neural Computing, 2002.
|
| 223 |
+
|
| 224 |
+
Andrew Davis and Itamar Arel. Low-rank approximations for conditional feedforward computation in deep neural networks. arXiv preprint arXiv:1312.4461, 2013.
|
| 225 |
+
|
| 226 |
+
Marc Peter Deisenroth and Jun Wei Ng. Distributed Gaussian processes. In ICML, 2015.
|
| 227 |
+
|
| 228 |
+
John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization, 2010.
|
| 229 |
+
|
| 230 |
+
Nadir Durrani, Barry Haddow, Philipp Koehn, and Kenneth Heafield. Edinburgh’s phrase-based machine translation systems for wmt-14. In Proceedings of the Ninth Workshop on Statistical Machine Translation, 2014.
|
| 231 |
+
|
| 232 |
+
David Eigen, Marc’Aurelio Ranzato, and Ilya Sutskever. Learning factored representations in a deep mixture of experts. arXiv preprint arXiv:1312.4314, 2013.
|
| 233 |
+
|
| 234 |
+
Ekaterina Garmash and Christof Monz. Ensemble learning for multi-source neural machine translation. In staff.science.uva.nl/c.monz, 2016.
|
| 235 |
+
|
| 236 |
+
Felix A. Gers, Jürgen A. Schmidhuber, and Fred A. Cummins. Learning to forget: Continual prediction with lstm. Neural Computation, 2000.
|
| 237 |
+
|
| 238 |
+
Audrunas Gruslys, Rémi Munos, Ivo Danihelka, Marc Lanctot, and Alex Graves. Memory-efficient backpropagation through time. CoRR, abs/1606.03401, 2016. URL http://arxiv.org/ abs/1606.03401.
|
| 239 |
+
|
| 240 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. IEEE Conference on Computer Vision and Pattern Recognition, 2015.
|
| 241 |
+
|
| 242 |
+
Geoffrey Hinton, Li Deng, Dong Yu, George E. Dahl, Abdel-rahman Mohamed, Navdeep Jaitly, Andrew Senior, Vincent Vanhoucke, Patrick Nguyen, Tara N. Sainath, et al. Deep neural networks for acoustic modeling in speech recognition: The shared views of four research groups. IEEE Signal Processing Magazine, 2012.
|
| 243 |
+
|
| 244 |
+
Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural Computation, 1997.
|
| 245 |
+
|
| 246 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
|
| 247 |
+
|
| 248 |
+
Robert A. Jacobs, Michael I. Jordan, Steven J. Nowlan, and Geoffrey E. Hinton. Adaptive mixtures of local experts. Neural Computing, 1991.
|
| 249 |
+
|
| 250 |
+
Melvin Johnson, Mike Schuster, Quoc V. Le, Maxim Krikun, Yonghui Wu, Zhifeng Chen, Nikhil Thorat, Fernanda B. Viégas, Martin Wattenberg, Greg Corrado, Macduff Hughes, and Jeffrey Dean. Google’s multilingual neural machine translation system: Enabling zero-shot translation. CoRR, abs/1611.04558, 2016. URL http://arxiv.org/abs/1611.04558.
|
| 251 |
+
|
| 252 |
+
Michael I. Jordan and Robert A. Jacobs. Hierarchical mixtures of experts and the EM algorithm. Neural Computing, 1994.
|
| 253 |
+
|
| 254 |
+
Rafal Jozefowicz, Oriol Vinyals, Mike Schuster, Noam Shazeer, and Yonghui Wu. Exploring the limits of language modeling. arXiv preprint arXiv:1602.02410, 2016.
|
| 255 |
+
|
| 256 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
|
| 257 |
+
|
| 258 |
+
Reinhard Kneser and Hermann. Ney. Improved backingoff for m-gram language modeling., 1995.
|
| 259 |
+
|
| 260 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, 2012.
|
| 261 |
+
|
| 262 |
+
Quoc V. Le, Marc’Aurelio Ranzato, Rajat Monga, Matthieu Devin, Kai Chen, Greg S. Corrado, Jeffrey Dean, and Andrew Y. Ng. Building high-level features using large scale unsupervised learning. In ICML, 2012.
|
| 263 |
+
|
| 264 |
+
Patrick Gallinari Ludovic Denoyer. Deep sequential neural network. arXiv preprint arXiv:1410.0510, 2014.
|
| 265 |
+
|
| 266 |
+
Minh-Thang Luong, Hieu Pham, and Christopher D. Manning. Effective approaches to attentionbased neural machine translation. EMNLP, 2015a.
|
| 267 |
+
|
| 268 |
+
Minh-Thang Luong, Ilya Sutskever, Quoc V. Le, Oriol Vinyals, and Wojciech Zaremba. Addressing the rare word problem in neural machine translation. ACL, 2015b.
|
| 269 |
+
|
| 270 |
+
Carl Edward Rasmussen and Zoubin Ghahramani. Infinite mixtures of Gaussian process experts. NIPS, 2002.
|
| 271 |
+
|
| 272 |
+
Hasim Sak, Andrew W Senior, and Françoise Beaufays. Long short-term memory recurrent neural network architectures for large scale acoustic modeling. In INTERSPEECH, pp. 338–342, 2014.
|
| 273 |
+
|
| 274 |
+
Mike Schuster and Kaisuke Nakajima. Japanese and Korean voice search. ICASSP, 2012.
|
| 275 |
+
|
| 276 |
+
Babak Shahbaba and Radford Neal. Nonlinear models using dirichlet process mixtures. JMLR, 2009.
|
| 277 |
+
|
| 278 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V. Le. Sequence to sequence learning with neural networks. In NIPS, 2014.
|
| 279 |
+
|
| 280 |
+
Lucas Theis and Matthias Bethge. Generative image modeling using spatial LSTMs. In NIPS, 2015.
|
| 281 |
+
|
| 282 |
+
Volker Tresp. Mixtures of Gaussian Processes. In NIPS, 2001.
|
| 283 |
+
|
| 284 |
+
Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V. Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, Jeff Klingner, Apurva Shah, Melvin Johnson, Xiaobing Liu, Łukasz Kaiser, Stephan Gouws, Yoshikiyo Kato, Taku Kudo, Hideto Kazawa, Keith Stevens, George Kurian, Nishant Patil, Wei Wang, Cliff Young, Jason Smith, Jason Riesa, Alex Rudnick, Oriol Vinyals, Greg Corrado, Macduff Hughes, and Jeffrey Dean. Google’s neural machine translation system: Bridging the gap between human and machine translation. arXiv preprint arXiv:1609.08144, 2016.
|
| 285 |
+
|
| 286 |
+
Bangpeng Yao, Dirk Walther, Diane Beck, and Li Fei-fei. Hierarchical mixture of classification experts uncovers interactions between brain regions. In NIPS. 2009.
|
| 287 |
+
|
| 288 |
+
Wojciech Zaremba, Ilya Sutskever, and Oriol Vinyals. Recurrent neural network regularization. arXiv preprint arXiv:1409.2329, 2014.
|
| 289 |
+
|
| 290 |
+
Jie Zhou, Ying Cao, Xuguang Wang, Peng Li, and Wei Xu. Deep recurrent models with fast-forward connections for neural machine translation. arXiv preprint arXiv:1606.04199, 2016.
|
| 291 |
+
|
| 292 |
+
# APPENDICES
|
| 293 |
+
|
| 294 |
+
# A LOAD-BALANCING LOSS
|
| 295 |
+
|
| 296 |
+
As discussed in section 4, for load-balancing purposes, we want to define an additional loss function to encourage experts to receive roughly equal numbers of training examples. Unfortunately, the number of examples received by an expert is a discrete quantity, so it can not be used in backpropagation. Instead, we define a smooth estimator $L o a d ( X )$ of the number of examples assigned to each expert for a batch $X$ of inputs. The smoothness allows us to back-propagate gradients through the estimator. This is the purpose of the noise term in the gating function. We define $P ( x , i )$ as the probability that $G ( x ) _ { i }$ is nonzero, given a new random choice of noise on element $i$ , but keeping the already-sampled choices of noise on the other elements. To compute $P ( x , i )$ , we note that the $G ( x ) _ { i }$ is nonzero if and only if $H ( x ) _ { i }$ is greater than the $k ^ { t h }$ -greatest element of $H ( x )$ excluding itself. The probability works out to be:
|
| 297 |
+
|
| 298 |
+
$$
|
| 299 |
+
\begin{array} { r l r } & { } & { P ( x , i ) = P r \Big ( ( x \cdot W _ { g } ) _ { i } + S t a n d a r d N o r m a l ( ) \cdot S o f t p l u s ( ( x \cdot W _ { n o i s e } ) _ { i } ) } \\ & { } & { > k t h \_ e x c l u d i n g ( H ( x ) , k , i ) \Big ) } \end{array}
|
| 300 |
+
$$
|
| 301 |
+
|
| 302 |
+
Where kth_excluding $( v , k , i )$ means the kth highest component of $v$ , excluding component $i$ . Simplifying, we get:
|
| 303 |
+
|
| 304 |
+
$$
|
| 305 |
+
P ( x , i ) = \Phi \Big ( \frac { ( x \cdot W _ { g } ) _ { i } - k t h \_ e x c l u d i n g ( H ( x ) , k , i ) } { S o f t p l u s ( ( x \cdot W _ { n o i s e } ) _ { i } ) } \Big )
|
| 306 |
+
$$
|
| 307 |
+
|
| 308 |
+
Where $\Phi$ is the CDF of the standard normal distribution.
|
| 309 |
+
|
| 310 |
+
$$
|
| 311 |
+
L o a d ( X ) _ { i } = \sum _ { x \in X } P ( x , i )
|
| 312 |
+
$$
|
| 313 |
+
|
| 314 |
+
We can now define the load loss to be the square of the coefficient of variation of the load vector, multiplied by a hand-tuned scaling factor $w _ { l o a d }$ .
|
| 315 |
+
|
| 316 |
+
$$
|
| 317 |
+
L _ { l o a d } ( X ) = w _ { l o a d } \cdot C V ( L o a d ( X ) ) ^ { 2 }
|
| 318 |
+
$$
|
| 319 |
+
|
| 320 |
+
Initial Load Imbalance: To avoid out-of-memory errors, we need to initialize the network in a state of approximately equal expert load (since the soft constraints need some time to work). To accomplish this, we initialize the matrices $W _ { g }$ and $W _ { n o i s e }$ to all zeros, which yields no signal and some noise.
|
| 321 |
+
|
| 322 |
+
Experiments: We trained a set of models with identical architecture (the MoE-256 model described in Appendix C), using different values of $w _ { i m p o r t a n c e }$ and $w _ { l o a d }$ . We trained each model for 10 epochs, then measured perplexity on the test set. We also measured the coefficients of variation in Importance and Load, as well as ratio of the load on the most overloaded expert to the average load. This last value is significant for load balancing purposes on distributed hardware. All of these metrics were averaged over several training batches.
|
| 323 |
+
|
| 324 |
+
Table 6: Experiments with different combinations of losses.
|
| 325 |
+
|
| 326 |
+
<table><tr><td>Wimportance</td><td>Wload</td><td>Test Perplexity</td><td>CV(Importance(X))</td><td>cv(Load(X))</td><td>max(Load(X)) mean(Load(X))</td></tr><tr><td>0.0</td><td>0.0</td><td>39.8</td><td>3.04</td><td>3.01</td><td>17.80</td></tr><tr><td>0.2</td><td>0.0</td><td>35.6</td><td>0.06</td><td>0.17</td><td>1.47</td></tr><tr><td>0.0</td><td>0.2</td><td>35.7</td><td>0.22</td><td>0.04</td><td>1.15</td></tr><tr><td>0.1</td><td>0.1</td><td>35.6</td><td>0.06</td><td>0.05</td><td>1.14</td></tr><tr><td>0.01</td><td>0.01</td><td>35.7</td><td>0.48</td><td>0.11</td><td>1.37</td></tr><tr><td>1.0</td><td>1.0</td><td>35.7</td><td>0.03</td><td>0.02</td><td>1.07</td></tr></table>
|
| 327 |
+
|
| 328 |
+
Results: Results are reported in Table 6. All the combinations containing at least one the two losses led to very similar model quality, where having no loss was much worse. Models with higher values of $w _ { l o a d }$ had lower loads on the most overloaded expert.
|
| 329 |
+
|
| 330 |
+
# B HIERACHICAL MIXTURE OF EXPERTS
|
| 331 |
+
|
| 332 |
+
If the number of experts is very large, we can reduce the branching factor by using a two-level hierarchical MoE. In a hierarchical MoE, a primary gating network chooses a sparse weighted combination of “experts", each of which is itself a secondary mixture-of-experts with its own gating network.3 If the hierarchical MoE consists of $a$ groups of $b$ experts each, we denote the primary gating network by $G _ { p r i m a r y }$ , the secondary gating networks by $\left( G _ { 1 } , G _ { 2 } . . G _ { a } \right)$ , and the expert networks by $( E _ { 0 , 0 } , E _ { 0 , 1 } . . . E _ { a , b } ^ { \mathrm { ~ ~ } } )$ . The output of the MoE is given by:
|
| 333 |
+
|
| 334 |
+
$$
|
| 335 |
+
y _ { H } = \sum _ { i = 1 } ^ { a } \sum _ { j = 1 } ^ { b } G _ { p r i m a r y } ( x ) _ { i } \cdot G _ { i } ( x ) _ { j } \cdot E _ { i , j } ( x )
|
| 336 |
+
$$
|
| 337 |
+
|
| 338 |
+
Our metrics of expert utilization change to the following:
|
| 339 |
+
|
| 340 |
+
$$
|
| 341 |
+
I m p o r t a n c e _ { H } ( X ) _ { i , j } = \sum _ { x \in X } G _ { p r i m a r y } ( x ) _ { i } \cdot G _ { i } ( x ) _ { j }
|
| 342 |
+
$$
|
| 343 |
+
|
| 344 |
+
$$
|
| 345 |
+
L o a d _ { H } ( X ) _ { i , j } = \frac { L o a d _ { p r i m a r y } ( X ) _ { i } \cdot L o a d _ { i } ( X ^ { ( i ) } ) _ { j } } { | X ^ { ( i ) } | }
|
| 346 |
+
$$
|
| 347 |
+
|
| 348 |
+
$L o a d _ { p r i m a r y }$ and $L o a d _ { i }$ deonte the Load functions for the primary gating network and $i ^ { t h }$ secondary gating network respectively. $X ^ { ( i ) }$ denotes the subset of $X$ for which $G _ { p r i m a r y } ( x ) _ { i } > 0$ .
|
| 349 |
+
|
| 350 |
+
It would seem simpler to let $L o a d _ { H } ( X ) _ { i , j } = L o a d _ { i } ( X _ { i } ) _ { j }$ , but this would not have a gradient with respect to the primary gating network, so we use the formulation above.
|
| 351 |
+
|
| 352 |
+
C 1 BILLION WORD LANGUAGE MODELING BENCHMARK - EXPERIMENTAL DETAILS
|
| 353 |
+
|
| 354 |
+
# C.1 8-MILLION-OPERATIONS-PER-TIMESTEP MODELS
|
| 355 |
+
|
| 356 |
+
Model Architecture: Our model consists of five layers: a word embedding layer, a recurrent Long Short-Term Memory (LSTM) layer (Hochreiter & Schmidhuber, 1997; Gers et al., 2000), a MoE layer, a second LSTM layer, and a softmax layer. The dimensionality of the embedding layer, the number of units in each LSTM layer, and the input and output dimensionality of the MoE layer are all equal to 512. For every layer other than the softmax, we apply dropout (Zaremba et al., 2014) to the layer output, dropping each activation with probability DropP rob, otherwise dividing by $( 1 - D r o p P r o b )$ . After dropout, the output of the previous layer is added to the layer output. This residual connection encourages gradient flow (He et al., 2015).
|
| 357 |
+
|
| 358 |
+
MoE Layer Architecture: Each expert in the MoE layer is a feed forward network with one ReLU-activated hidden layer of size 1024 and an output layer of size 512. Thus, each expert contains $[ 5 1 2 * 1 0 2 4 ] + [ 1 0 2 4 * 5 1 2 ] = 1 M$ parameters. The output of the MoE layer is passed through a sigmoid function before dropout. We varied the number of experts between models, using ordinary MoE layers with 4, 32 and 256 experts and hierarchical MoE layers with 256, 1024 and 4096 experts. We call the resulting models MoE-4, MoE-32, MoE-256, MoE-256-h, MoE-1024-h and MoE-4096- h. For the hierarchical MoE layers, the first level branching factor was 16, corresponding to the number of GPUs in our cluster. We use Noisy-Top-K Gating (see Section 2.1) with $k = 4$ for the ordinary MoE layers and $k = 2$ at each level of the hierarchical MoE layers. Thus, each example is processed by exactly 4 experts for a total of 4M ops/timestep. The two LSTM layers contribute 2M ops/timestep each for the desired total of 8M.
|
| 359 |
+
|
| 360 |
+
Computationally-Matched Baselines: The MoE-4 model does not employ sparsity, since all 4 experts are always used. In addition, we trained four more computationally-matched baseline models with no sparsity:
|
| 361 |
+
|
| 362 |
+
• MoE-1-Wide: The MoE layer consists of a single "expert" containing one ReLU-activated hidden layer of size 4096.
|
| 363 |
+
• MoE-1-Deep: The MoE layer consists of a single "expert" containing four ReLU-activated hidden layers, each with size 1024.
|
| 364 |
+
• 4xLSTM-512: We replace the MoE layer with two additional 512-unit LSTM layers.
|
| 365 |
+
• LSTM-2048-512: The model contains one 2048-unit LSTM layer (and no MoE). The output of the LSTM is projected down to 512 dimensions (Sak et al., 2014). The next timestep of the LSTM receives the projected output. This is identical to one of the models published in (Jozefowicz et al., 2016). We re-ran it to account for differences in training regimen, and obtained results very similar to the published ones.
|
| 366 |
+
|
| 367 |
+
Training: The models were trained on a cluster of 16 K40 GPUs using the synchronous method described in Section 3. Each batch consisted of a set of sentences totaling roughly 300,000 words. In the interest of time, we limited training to 10 epochs, (27,000 steps). Training took 12-16 hours for all models, except for MoE-4, which took 18 hours (since all the expert computation was performed on only 4 of 16 GPUs). We used the Adam optimizer (Kingma & Ba, 2015). The base learning rate was increased linearly for the first 1000 training steps, and decreased after that so as to be proportional to the inverse square root of the step number. The Softmax output layer was trained efficiently using importance sampling similarly to the models in (Jozefowicz et al., 2016). For each model, we performed a hyper-parmeter search to find the best dropout probability, in increments of 0.1.
|
| 368 |
+
|
| 369 |
+
To ensure balanced expert utilization we set $w _ { i m p o r t a n c e } = 0 . 1$ and $w _ { l o a d } = 0 . 1$ , as described in Section 4 and Appendix A.
|
| 370 |
+
|
| 371 |
+
Results: We evaluate our model using perplexity on the holdout dataset, used by (Chelba et al., 2013; Jozefowicz et al., 2016). We follow the standard procedure and sum over all the words including the end of sentence symbol. Results are reported in Table 7. For each model, we report the test perplexity, the computational budget, the parameter counts, the value of DropP rob, and the computational efficiency.
|
| 372 |
+
|
| 373 |
+
Table 7: Model comparison on 1 Billion Word Language Modeling Benchmark. Models marked with \* are from (Jozefowicz et al., 2016).
|
| 374 |
+
|
| 375 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>TestPerplexity10 epochs</td><td rowspan=1 colspan=1>TestPerplexity(final)</td><td rowspan=1 colspan=1>ops/timestep(millions)</td><td rowspan=1 colspan=3>#Params excludingembed.& softmax(millions)</td><td rowspan=1 colspan=2>Total#Params(billions)</td><td rowspan=1 colspan=1>Drop-Prob</td><td rowspan=1 colspan=1>TFLOPSper GPU(observed)</td></tr><tr><td rowspan=1 colspan=1>Kneser-Ney5-gram*LSTM-512-512*LSTM-1024-512*</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>67.654.148.2</td><td rowspan=1 colspan=1>0.000012.44.7</td><td rowspan=1 colspan=3>2.44.7</td><td rowspan=1 colspan=2>1.80.80.8</td><td rowspan=1 colspan=1>0.10.1</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=3 colspan=1>LSTM-2048-512*LSTM-2048-5124xLSTM-512MoE-1-WideMoE-1-Deep</td><td rowspan=3 colspan=1>45.044.746.046.145.7</td><td rowspan=3 colspan=1>43.7</td><td rowspan=3 colspan=1>9.49.48.48.48.4</td><td rowspan=1 colspan=3>9.49.4</td><td rowspan=1 colspan=2>0.80.8</td><td rowspan=1 colspan=1>0.10.1</td><td rowspan=1 colspan=1>0.611.21</td></tr><tr><td rowspan=1 colspan=1>8.4</td><td rowspan=1 colspan=1></td><td></td><td rowspan=1 colspan=2>0.8</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>1.07</td></tr><tr><td rowspan=1 colspan=3>8.48.4</td><td rowspan=1 colspan=2>0.80.8</td><td rowspan=1 colspan=1>0.10.1</td><td rowspan=1 colspan=1>1.291.29</td></tr><tr><td rowspan=1 colspan=1>MoE-4</td><td rowspan=1 colspan=1>45.0</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>8.4</td><td rowspan=1 colspan=3>8.4</td><td rowspan=1 colspan=2>0.8</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.52</td></tr><tr><td rowspan=5 colspan=1>MoE-32MoE-256MoE-256-hMoE-1024-hMoE-4096-h</td><td rowspan=5 colspan=1>39.735.736.034.634.1</td><td rowspan=5 colspan=1></td><td rowspan=5 colspan=1>8.48.68.48.58.9</td><td rowspan=1 colspan=3>37.8</td><td rowspan=1 colspan=2>0.9</td><td rowspan=1 colspan=1>0.1</td><td rowspan=3 colspan=1>0.870.810.89</td></tr><tr><td rowspan=2 colspan=3>272.9272.9</td><td rowspan=2 colspan=2>1.11.1</td><td rowspan=2 colspan=1>0.10.1</td></tr><tr><td rowspan=1 colspan=1></td></tr><tr><td rowspan=2 colspan=3>1079.04303.4</td><td rowspan=2 colspan=2>1.95.1</td><td rowspan=1 colspan=1>0.2</td><td rowspan=1 colspan=1>0.90</td></tr><tr><td rowspan=1 colspan=1>0.2</td><td rowspan=1 colspan=1>0.74</td></tr><tr><td rowspan=3 colspan=1>2xLSTM-8192-1024*MoE-34MMoE-143M</td><td rowspan=3 colspan=1>34.731.328.0</td><td rowspan=3 colspan=1>30.6</td><td rowspan=3 colspan=1>151.033.8142.7</td><td rowspan=1 colspan=3>151.0</td><td rowspan=1 colspan=2>1.8</td><td rowspan=1 colspan=1>0.25</td><td rowspan=1 colspan=1>1.09</td></tr><tr><td rowspan=2 colspan=3>4313.94371.1</td><td rowspan=1 colspan=2>6.0</td><td rowspan=1 colspan=1>0.3</td><td rowspan=2 colspan=1>1.221.56</td></tr><tr><td rowspan=1 colspan=2>6.0</td><td rowspan=1 colspan=1>0.4</td></tr></table>
|
| 376 |
+
|
| 377 |
+
# C.2 MORE EXPENSIVE MODELS
|
| 378 |
+
|
| 379 |
+
We ran two additional models (MoE-34M and MoE-143M) to investigate the effects of adding more computation in the presence of a large MoE layer. These models have computation budgets of 34M and 143M ops/timestep. Similar to the models above, these models use a MoE layer between two LSTM layers. The dimensionality of the embedding layer, and the input and output dimensionality of the MoE layer are set to 1024 instead of 512. For MoE-34M, the LSTM layers have 1024 units. For MoE-143M, the LSTM layers have 4096 units and an output projection of size 1024 (Sak et al., 2014). MoE-34M uses a hierarchical MoE layer with 1024 experts, each with a hidden layer of size 2048. MoE-143M uses a hierarchical MoE layer with 256 experts, each with a hidden layer of size 8192. Both models have 4B parameters in the MoE layers. We searched for the best DropP rob for each model, and trained each model for 10 epochs.
|
| 380 |
+
|
| 381 |
+
The two models achieved test perplexity of 31.3 and 28.0 respectively, showing that even in the presence of a large MoE, more computation is still useful. Results are reported at the bottom of Table 7. The larger of the two models has a similar computational budget to the best published model from the literature, and training times are similar. Comparing after 10 epochs, our model has a lower test perplexity by $1 8 \%$ .
|
| 382 |
+
|
| 383 |
+
# D 100 BILLION WORD GOOGLE NEWS CORPUS - EXPERIMENTAL DETAILS
|
| 384 |
+
|
| 385 |
+
Model Architecture: The models are similar in structure to the 8-million-operations-per-timestep models described in the previous section. We vary the number of experts between models, using an ordinary MoE layer with 32 experts and hierarchical MoE layers with 256, 1024, 4096, 16384, 65536 and 131072 experts. For the hierarchical MoE layers, the first level branching factors are 32, 32, 64, 128, 256 and 256, respectively.
|
| 386 |
+
|
| 387 |
+
Training: Models are trained on a cluster of 32 Tesla K40 GPUs, except for the last two models, which are trained on clusters of 64 and 128 GPUs so as to have enough memory for all the parameters. For all models, training batch sizes are approximately 2.5 million words. Models are trained once-through over about 100 billion words.
|
| 388 |
+
|
| 389 |
+
We implement several memory optimizations in order to fit up to 1 billion parameters per GPU. First, we do not store the activations of the hidden layers of the experts, but instead recompute them on the backwards pass. Secondly, we modify the optimizer on the expert parameters to require less auxiliary storage:
|
| 390 |
+
|
| 391 |
+
The Adam optimizer (Kingma & Ba, 2015) keeps first and second moment estimates of the perparameter gradients. This triples the required memory. To avoid keeping a first-moment estimator, we set $\beta _ { 1 } = 0$ . To reduce the size of the second moment estimator, we replace it with a factored approximation. For a matrix of parameters, instead of maintaining a full matrix of second-moment estimators, we maintain vectors of row-wise and column-wise averages of that matrix. At each step, the matrix of estimators is taken to be the outer product of those two vectors divided by the mean of either one. This technique could similarly be applied to Adagrad (Duchi et al., 2010).
|
| 392 |
+
|
| 393 |
+
Table 8: Model comparison on 100 Billion Word Google News Dataset
|
| 394 |
+
|
| 395 |
+
<table><tr><td>Model</td><td>Test Perplexity .1 epochs</td><td>Test Perplexity 1epoch</td><td>ops/timestep (millions)</td><td>#Params excluding embed.& softmax (millions)</td><td>Total #Params (billions)</td><td>TFLOPS per GPU (observed)</td></tr><tr><td>Kneser-Ney 5-gram</td><td>67.1</td><td>45.3</td><td>0.00001</td><td></td><td>76.0</td><td></td></tr><tr><td>4xLSTM-512</td><td>54.5</td><td>47.0</td><td>8.4</td><td>8.4</td><td>0.1</td><td>1.23</td></tr><tr><td>MoE-32</td><td>48.5</td><td>40.4</td><td>8.4</td><td>37.8</td><td>0.1</td><td>0.83</td></tr><tr><td>MoE-256-h</td><td>42.8</td><td>35.3</td><td>8.4</td><td>272.9</td><td>0.4</td><td>1.11</td></tr><tr><td>MoE-1024-h</td><td>40.3</td><td>32.7</td><td>8.5</td><td>1079.0</td><td>1.2</td><td>1.14</td></tr><tr><td>MoE-4096-h</td><td>38.9</td><td>30.9</td><td>8.6</td><td>4303.4</td><td>4.4</td><td>1.07</td></tr><tr><td>MoE-16384-h</td><td>38.2</td><td>29.7</td><td>8.8</td><td>17201.0</td><td>17.3</td><td>0.96</td></tr><tr><td>MoE-65536-h</td><td>38.2</td><td>28.9</td><td>9.2</td><td>68791.0</td><td>68.9</td><td>0.72</td></tr><tr><td>MoE-131072-h</td><td>39.8</td><td>29.2</td><td>9.7</td><td>137577.6</td><td>137.7</td><td>0.30</td></tr></table>
|
| 396 |
+
|
| 397 |
+
Results: We evaluate our model using perplexity on a holdout dataset. Results are reported in Table 8. Perplexity after 100 billion training words is $39 \%$ lower for the 68-billion-parameter MoE model than for the baseline model. It is notable that the measured computational efficiency of the largest model (0.30 TFLOPS/GPU) is very low compared to the other models. This is likely a result of the fact that, for purposes of comparison to the other models, we did not increase the training batch size proportionally to the number of GPUs. For comparison, we include results for a computationally matched baseline model consisting of 4 LSTMs, and for an unpruned 5-gram model with Kneser-Ney smoothing (Kneser & Ney, 1995).4
|
| 398 |
+
|
| 399 |
+
E MACHINE TRANSLATION - EXPERIMENTAL DETAILS
|
| 400 |
+
|
| 401 |
+
Model Architecture for Single Language Pair MoE Models: Our model is a modified version of the GNMT model described in (Wu et al., 2016). To reduce computation, we decrease the number of LSTM layers in the encoder and decoder from 9 and 8 to 3 and 2 respectively. We insert MoE layers in both the encoder (between layers 2 and 3) and the decoder (between layers 1 and 2). We use an attention mechanism between the encoder and decoder, with the first decoder LSTM receiving output from and providing input for the attention 5. All of the layers in our model have input and output dimensionality of 512. Our LSTM layers have 2048 hidden units, with a 512-dimensional output projection. We add residual connections around all LSTM and MoE layers to encourage gradient flow (He et al., 2015). Similar to GNMT, to effectively deal with rare words, we used subword units (also known as “wordpieces") (Schuster & Nakajima, 2012) for inputs and outputs in our system.
|
| 402 |
+
|
| 403 |
+
We use a shared source and target vocabulary of 32K wordpieces. We also used the same beam search technique as proposed in (Wu et al., 2016).
|
| 404 |
+
|
| 405 |
+
We train models with different numbers of experts in the MoE layers. In addition to a baseline model with no MoE layers, we train models with flat MoE layers containing 32 experts, and models with hierarchical MoE layers containing 512 and 2048 experts. The flat MoE layers use $k = 4$ and the hierarchical MoE models use $k = 2$ at each level of the gating network. Thus, each input is processed by exactly 4 experts in each MoE layer. Each expert in the MoE layer is a feed forward network with one hidden layer of size 2048 and ReLU activation. Thus, each expert contains $[ 5 1 2 *$ $2 0 4 8 ] + [ 2 0 4 8 * 5 1 2 ] = 2 M$ parameters. The output of the MoE layer is passed through a sigmoid function. We use the strictly-balanced gating function described in Appendix F.
|
| 406 |
+
|
| 407 |
+
Model Architecture for Multilingual MoE Model: We used the same model architecture as for the single-language-pair models, with the following exceptions: We used noisy-top-k gating as described in Section 2.1, not the scheme from Appendix F. The MoE layers in the encoder and decoder are non-hierarchical MoEs with $n = 5 1 2$ experts, and $k = 2$ . Each expert has a larger hidden layer of size 8192. This doubles the amount of computation in the MoE layers, raising the computational budget of the entire model from 85M to 102M ops/timestep.
|
| 408 |
+
|
| 409 |
+
Training: We trained our networks using the Adam optimizer (Kingma & Ba, 2015). The base learning rate was increased linearly for the first 2000 training steps, held constant for an additional 8000 steps, and decreased after that so as to be proportional to the inverse square root of the step number. For the single-language-pair models, similarly to (Wu et al., 2016), we applied dropout (Zaremba et al., 2014) to the output of all embedding, LSTM and MoE layers, using $D r o p P r o b =$ 0.4. Training was done synchronously on a cluster of up to 64 GPUs as described in section 3. Each training batch consisted of a set of sentence pairs containing roughly 16000 words per GPU.
|
| 410 |
+
|
| 411 |
+
To ensure balanced expert utilization we set $w _ { i m p o r t a n c e } = 0 . 0 1$ and $w _ { l o a d } = 0 . 0 1$ , as described in Section 4 and Appendix A.
|
| 412 |
+
|
| 413 |
+
Metrics: We evaluated our models using the perplexity and the standard BLEU score metric. We reported tokenized BLEU score as computed by the multi-bleu.pl script, downloaded from the public implementation of Moses (on Github), which was also used in (Luong et al., 2015a).
|
| 414 |
+
|
| 415 |
+
Results: Tables 2, 3 and 4 in Section 5.3 show comparisons of our results to other published methods. Figure 4 shows test perplexity as a function of number of words in the (training data’s) source sentences processed for models with different numbers of experts. As can be seen from the Figure, as we increased the number of experts to approach 2048, the test perplexity of our model continued to improve.
|
| 416 |
+
|
| 417 |
+

|
| 418 |
+
Figure 4: Perplexity on WMT’ $\scriptstyle 1 4 \mathrm { E n } \to \mathrm { F r }$ (left) and Google Production $\mathrm { E n } \mathrm { F r }$ (right) datasets as a function of number of words processed. The large differences between models at the beginning of training are due to different batch sizes. All models incur the same computational budget (85M ops/timestep) except the one with no experts.
|
| 419 |
+
|
| 420 |
+
We found that the experts indeed become highly specialized by syntax and/or semantics, as can be seen in Table 9. For example, one expert is used when the indefinite article “a" introduces the direct object in a verb phrase indicating importance or leadership.
|
| 421 |
+
|
| 422 |
+
Table 9: Contexts corresponding to a few of the 2048 experts in the MoE layer in the encoder portion of the WMT’14 $\cdot \operatorname { E n } \to \operatorname { F r }$ translation model. For each expert $i$ , we sort the inputs in a training batch in decreasing order of $G ( x ) _ { i }$ , and show the words surrounding the corresponding positions in the input sentences.
|
| 423 |
+
|
| 424 |
+
<table><tr><td>Expert 381 ... with researchers,,..</td><td>Expert 752</td><td>Expert 2004</td></tr><tr><td>... to innovation. ... tics researchers. ... the generation of ... ... technology innovationsis.. ... technological innovations,. .. support innovation throughout ... ... role innovation will ... ... research scienti st... ... promoting innovation where ...</td><td>... plays a core... ... plays a critical ... ... provides a legislative... ... play a leading... ... assume a leadership ... ... plays a central ... .. taken a leading.. ... established a reconciliation...</td><td>... with rapidly growing ... ... under static conditions.. ... to swift ly ... ... to dras tically.. ... the rapid and.. ... the fast est ... .. the Quick Method ..</td></tr></table>
|
| 425 |
+
|
| 426 |
+
# F STRICTLY BALANCED GATING
|
| 427 |
+
|
| 428 |
+
Due to some peculiarities in our infrastructure which have since been fixed, at the time we ran some of the machine translation experiments, our models ran faster if every expert received exactly the same batch size. To accommodate this, we used a different gating function which we describe below.
|
| 429 |
+
|
| 430 |
+
Recall that we define the softmax gating function to be:
|
| 431 |
+
|
| 432 |
+
$$
|
| 433 |
+
G _ { \sigma } ( x ) = S o f t m a x ( x \cdot W _ { g } )
|
| 434 |
+
$$
|
| 435 |
+
|
| 436 |
+
Sparse Gating (alternate formulation): To obtain a sparse gating vector, we multiply $G _ { \sigma } ( x )$ component-wise with a sparse mask $M ( G _ { \sigma } ( x ) )$ and normalize the output. The mask itself is a function of $G _ { \sigma } ( x )$ and specifies which experts are assigned to each input example:
|
| 437 |
+
|
| 438 |
+
$$
|
| 439 |
+
G ( x ) _ { i } = \frac { G _ { \sigma } ( x ) _ { i } M ( G _ { \sigma } ( x ) ) _ { i } } { \sum _ { j = 1 } ^ { n } G _ { \sigma } ( x ) _ { j } M ( G _ { \sigma } ( x ) ) _ { j } }
|
| 440 |
+
$$
|
| 441 |
+
|
| 442 |
+
Top-K Mask: To implement top- $\mathbf { \nabla } \cdot \mathbf { k }$ gating in this formulation, we would let $M ( v ) = T o p K ( v , k )$ , where:
|
| 443 |
+
|
| 444 |
+
$$
|
| 445 |
+
T o p K ( v , k ) _ { i } = { \left\{ \begin{array} { l l } { 1 } & { { \mathrm { i f ~ } } v _ { i } { \mathrm { ~ i s ~ i n ~ t h e ~ t o p ~ } } k { \mathrm { ~ e l e m e n t s ~ o f ~ } } v . } \\ { 0 } & { { \mathrm { o t h e r w i s e . } } } \end{array} \right. }
|
| 446 |
+
$$
|
| 447 |
+
|
| 448 |
+
Batchwise Mask: To force each expert to receive the exact same number of examples, we introduce an alternative mask function, $M _ { b a t c h w i s e } ^ { - } ( X , m )$ , which operates over batches of input vectors. Instead of keeping the top $k$ values per example, we keep the top $m$ values per expert across the training batch, where $\begin{array} { r } { m = \frac { k | X | } { n } } \end{array}$ , so that each example is sent to an average of $k$ experts.
|
| 449 |
+
|
| 450 |
+
$$
|
| 451 |
+
M _ { b a t c h w i s e } ( X , m ) _ { j , i } = { \left\{ \begin{array} { l l } { 1 } & { { \mathrm { i f ~ } } X _ { j , i } { \mathrm { ~ i s ~ i n ~ t h e ~ t o p ~ } } m { \mathrm { ~ v a l u e s ~ f o r ~ t o ~ e x p e r t ~ } } i } \\ { 0 } & { { \mathrm { o t h e r w i s e } } } \end{array} \right. }
|
| 452 |
+
$$
|
| 453 |
+
|
| 454 |
+
As our experiments suggest and also observed in (Ioffe & Szegedy, 2015), using a batchwise function during training (such as $M _ { b a t c h w i s e } )$ ) requires modifications to the inference when we may not have a large batch of examples. Our solution to this is to train a vector $T$ of per-expert threshold values to approximate the effects of the batchwise mask. We use the following mask at inference time:
|
| 455 |
+
|
| 456 |
+
$$
|
| 457 |
+
M _ { t h r e s h o l d } ( x , T ) _ { i } = \left\{ \begin{array} { l l } { 1 } & { \mathrm { i f } x _ { i } > T _ { i } } \\ { 0 } & { \mathrm { o t h e r w i s e } } \end{array} \right.
|
| 458 |
+
$$
|
| 459 |
+
|
| 460 |
+
To learn the threshold values, we apply an additional loss at training time which is minimized when the batchwise mask and the threshold mask are identical.
|
| 461 |
+
|
| 462 |
+
$$
|
| 463 |
+
L _ { b a t c h w i s e } ( X , T , m ) = \sum _ { j = 1 } ^ { | X | } \sum _ { i = 1 } ^ { n } ( M _ { t h r e s h o l d } ( x , T ) _ { i } - M _ { b a t c h w i s e } ( X , m ) _ { j , i } ) ( X _ { j , i } - T _ { i } )
|
| 464 |
+
$$
|
| 465 |
+
|
| 466 |
+
# G ATTENTION FUNCTION
|
| 467 |
+
|
| 468 |
+
The attention mechanism described in GNMT (Wu et al., 2016) involves a learned “Attention Function" $A ( x _ { i } , y _ { j } )$ which takes a “source vector" $x _ { i }$ and a “target vector" $y _ { j }$ , and must be computed for every source time step $i$ and target time step $j$ . In GNMT, the attention function is implemented as a feed forward neural network with a hidden layer of size $n$ . It can be expressed as:
|
| 469 |
+
|
| 470 |
+
$$
|
| 471 |
+
A _ { G N M T } ( x _ { i } , y _ { j } ) = \sum _ { d = 1 } ^ { n } V _ { d } t a n h ( ( x _ { i } U ) _ { d } + ( y _ { j } W ) _ { d } )
|
| 472 |
+
$$
|
| 473 |
+
|
| 474 |
+
Where $U$ and $W$ are trainable weight matrices and $V$ is a trainable weight vector.
|
| 475 |
+
|
| 476 |
+
For performance reasons, in our models, we used a slightly different attention function:
|
| 477 |
+
|
| 478 |
+
$$
|
| 479 |
+
A ( x _ { i } , y _ { j } ) = \sum _ { d = 1 } ^ { n } V _ { d } t a n h ( ( x _ { i } U ) _ { d } ) t a n h ( ( y _ { j } W ) _ { d } )
|
| 480 |
+
$$
|
| 481 |
+
|
| 482 |
+
With our attention function, we can simultaneously compute the attention function on multiple source time steps and multiple target time steps using optimized matrix multiplications. We found little difference in quality between the two functions.
|
md/train/BJg4NgBKvH/BJg4NgBKvH.md
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TRAINING BINARY NEURAL NETWORKS WITH REALTO-BINARY CONVOLUTIONS
|
| 2 |
+
|
| 3 |
+
Brais Martinez1, Jing Yang1,2,\*, Adrian Bulat1,\* & Georgios Tzimiropoulos1,2
|
| 4 |
+
|
| 5 |
+
1 Samsung AI Research Center, Cambridge, UK 2 Computer Vision Laboratory, The University of Nottingham, UK {brais.a,adrian.bulat,georgios.t}@samsung.com
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
This paper shows how to train binary networks to within a few percent points $( \sim 3 - 5 \% )$ of the full precision counterpart. We first show how to build a strong baseline, which already achieves state-of-the-art accuracy, by combining recently proposed advances and carefully adjusting the optimization procedure. Secondly, we show that by attempting to minimize the discrepancy between the output of the binary and the corresponding real-valued convolution, additional significant accuracy gains can be obtained. We materialize this idea in two complementary ways: (1) with a loss function, during training, by matching the spatial attention maps computed at the output of the binary and real-valued convolutions, and (2) in a data-driven manner, by using the real-valued activations, available during inference prior to the binarization process, for re-scaling the activations right after the binary convolution. Finally, we show that, when putting all of our improvements together, the proposed model beats the current state of the art by more than $5 \%$ top-1 accuracy on ImageNet and reduces the gap to its realvalued counterpart to less than $3 \%$ and $5 \%$ top-1 accuracy on CIFAR-100 and ImageNet respectively when using a ResNet-18 architecture. Code available at https://github.com/brais-martinez/real2binary.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Following the introduction of the BinaryNeuralNet (BNN) algorithm (Courbariaux et al., 2016), binary neural networks emerged as one of the most promising approaches for obtaining highly efficient neural networks that can be deployed on devices with limited computational resources. Binary convolutions are appealing mainly for two reasons: (a) Model compression: if the weights of the network are stored as bits in a 32-bit float, this implies a reduction of $3 2 \times$ in memory usage. (b) Computational speed-up: computationally intensive floating-point multiply and add operations are replaced by efficient xnor and pop-count operations, which have been shown to provide practical speed-ups of up to $5 8 \times$ on CPU (Rastegari et al., 2016) and, as opposed to general low bit-width operations, are amenable to standard hardware. Despite these appealing properties, binary neural networks have been criticized as binarization typically results in large accuracy drops. Thus, their deployment in practical scenarios is uncommon. For example, on ImageNet classification, there is a $\sim 1 8 \%$ gap in top-1 accuracy between a ResNet-18 and its binary counterpart when binarized with XNOR-Net (Rastegari et al., 2016), which is the method of choice for neural network binarization.
|
| 14 |
+
|
| 15 |
+
But how far are we from training binary neural networks that are powerful enough to become a viable alternative to real-valued networks? Our first contribution in this work is to take stock of recent advances on binary neural networks and train a very strong baseline which already results in state-of-the-art performance. Our second contribution is a method for bridging most of the remaining gap, which boils down to minimizing the discrepancy between the output of the binary and the corresponding real-valued convolution. This idea is materialized in our work in two complementary ways: Firstly, we use an attention matching strategy so that the real-valued network can more closely guide the binary network during optimization. However, we show that due to the architectural discrepancies between the real and the binary networks, a direct application of teacher-student produces sub-optimal performance. Instead, we propose to use a sequence of teacher-student pairs that progressively bridges the architectural gap. Secondly, we further propose to use the real-valued activations of the binary network, available prior to the binarization preceding convolution, to compute scale factors that are used to re-scale the activations right after the application of the binary convolution. This is in line with recent works which have shown that re-scaling the binary convolution output can result in large performance gains (Rastegari et al., 2016; Bulat & Tzimiropoulos, 2019). However, unlike prior work, we compute the scaling factors in a data-driven manner based on the real-valued activations of each layer prior to binarization, which results in superior performance.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Left: The proposed real-to-binary block. The diagram shows how spatial attention maps computed from a teacher real-valued network are matched with the ones computed from the binary network. Supervision is injected at the end of each binary block. See also section 4.2. Right: The proposed data-driven channel re-scaling approach. The left-hand side branch corresponds to the standard binary convolution module. The right-hand side branch corresponds to the proposed gating function that computes the channel-scaling factors from the output of the batch normalization. The factor $r$ controls the compression ratio on the gating function, and $H$ , $W$ and $C$ indicate the two spatial and the channel dimensions of the activation tensors. See also section 4.3.
|
| 19 |
+
|
| 20 |
+
Overall, we make the following contributions:
|
| 21 |
+
|
| 22 |
+
• We construct a very strong baseline by combining some recent insights on training binary networks and by performing a thorough experimentation to find the most well-suited optimization techniques. We show that this baseline already achieves state-of-the-art accuracy on ImageNet, surpassing all previously published works on binary networks.
|
| 23 |
+
We propose a real-to-binary attention matching: this entails that matching spatial attention maps computed at the output of the binary and real-valued convolutions is particularly suited for training binary neural networks (see Fig. 1 left and section 4.2). We also devise an approach in which the architectural gap between real and binary networks is progressively bridged through a sequence of teacher-student pairs.
|
| 24 |
+
We propose a data-driven channel re-scaling: this entails using the real-valued activations of the binary network prior to their binarization to compute the scale factors used to rescale the activations produced right after the application of the binary convolution. See Fig. 1, right, and section 4.3.
|
| 25 |
+
• We show that our combined contributions provide, for the first time, competitive results on two standard datasets, achieving $7 6 . 2 \%$ top-1 performance on CIFAR-100 and $6 5 . 4 \%$ top-1 performance on ImageNet when using a ResNet-18 –a gap bellow $3 \%$ and $5 \%$ respectively compared to their full precision counterparts.
|
| 26 |
+
|
| 27 |
+
# 2 RELATED WORK
|
| 28 |
+
|
| 29 |
+
While being pre-dated by other works on binary networks (Soudry et al., 2014), the BNN algorithm (Courbariaux et al., 2016) established how to train networks with binary weights within the familiar back-propagation paradigm. The training method relies on a real-valued copy of the network weights which is binarized during the forward pass, but is updated during back-propagation ignoring the binarization step. Unfortunately, BNN resulted in a staggering $\sim 2 8 \%$ gap in top-1 accuracy compared to the full precision ResNet-18 on ImageNet.
|
| 30 |
+
|
| 31 |
+
It is worth noting that binary networks do have a number of floating point operations. In fact, the output of a binary convolution is not binary (values are integers resulting from the count). Also, in accordance to other low bit-width quantization methodologies, the first convolution (a costly $7 \times 7$ kernel in ResNet), the fully connected layer and the batch normalization layers are all real-valued. In consequence, a line of research has focused on developing methodologies that add a fractional amount of real-valued operations in exchange for significant accuracy gains. For example, the seminal work of XNOR-Net (Rastegari et al., 2016) proposed to add a real-valued scaling factor to each output channel of a binary convolution, a technique that has become standard for binary networks. Similarly, Bi-Real Net (Liu et al., 2018) argued that skip connections are fundamental for binary networks and observed that the flow of full precision activations provided by the skip connections is interrupted by the binary downsample convolutions. This degrades the signal and make subsequent skip connections less effective. To alleviate this, they proposed making the downsample layers real valued, obtaining around $3 \%$ accuracy increase in exchange for a small increase in computational complexity.
|
| 32 |
+
|
| 33 |
+
Improving the optimization algorithm for binary networks has been another fundamental line of research. Examples include the use of smooth approximations of the gradient, the use of PReLU (Bulat et al., 2019), a two-stage training which binarizes the weights first and then the activations (Bulat et al., 2019) and progressive quantization (Gong et al., 2019; Bulat et al., 2019). The work in (Wang et al., 2019) proposed to learn channel correlations through reinforcement learning to better preserve the sign of a convolution output. A set of regularizers are added to the loss term in (Ding et al., 2019) so as to control the range of values of the activations, and guarantee good gradient flow. Other optimization aspects, such the effect of gradient clipping or batch-norm momentum, were empirically tested in (Alizadeh et al., 2019). In section 4.1, we show how to combine many of the insights provided in these works with standard optimization techniques to obtain a very strong baseline that already achieves state-of-the-art accuracy.
|
| 34 |
+
|
| 35 |
+
While the aforementioned works either maintain the same computational cost, or increase it by a fractional amount, other research has focused instead on relaxing the problem constraints by increasing the number of binary operations by a large amount, typically a factor of 2 to 8 times. Examples include ABC-Net (Lin et al., 2017), the structure approximation of (Zhuang et al., 2019), the circulant CNN of (Liu et al., 2019), and the binary ensemble of (Zhu et al., 2019). Note that the large increase of binary operations diminishes the efficiency claim that justifies the use of binary networks in first place. Furthermore, we will show that there is still a lot of margin in order to bridge the accuracy gap prior to resorting to scaling up the network capacity1.
|
| 36 |
+
|
| 37 |
+
The methodology proposed in this paper has some relations with prior work: our use of attention matching as described in section 4.2 is somewhat related to the feature distillation approach of (Zhuang et al., 2018). However, (Zhuang et al., 2018) tries to match whole feature maps of the to-be-quantized network with the quantized feature maps of a real-valued network that is trained in parallel with the to-be-quantized network. Such an approach is shown to improve training of low-bitwidth quantized models but not binary networks. Notably, our approach based on matching attention maps is much simpler and shown to be effective for the case of binary networks.
|
| 38 |
+
|
| 39 |
+
Our data-driven channel re-scaling approach, described in section 4.3, is related to the channel rescaling approach of XNOR-Net, and also that of (Xu & Cheung, 2019; Bulat & Tzimiropoulos, 2019), which propose to learn the scale factors discriminatively through backpropagation. Contrary to (Xu & Cheung, 2019; Bulat & Tzimiropoulos, 2019), our method is data-driven and avoids using fixed scale factors learnt during training. Contrary to XNOR-Net, our method discriminatively learns how to produce the data-driven scale factors so that they are optimal for the task in hand.
|
| 40 |
+
|
| 41 |
+
# 3 BACKGROUND
|
| 42 |
+
|
| 43 |
+
This section reviews the binarization process proposed in (Courbariaux et al., 2016) and its improved version from (Rastegari et al., 2016), which is the method of choice for neural network binarization.
|
| 44 |
+
|
| 45 |
+
We denote by $\mathcal { W } \in \mathbb { R } ^ { o \times c \times k \times k }$ and $\mathcal { A } \in \mathbb { R } ^ { c \times w _ { i n } \times h _ { i n } }$ the weights and input features of a CNN layer, where $o$ and $c$ represent the number of output and input channels, $k$ the width and height of the kernel, and $w _ { i n }$ and $h _ { i n }$ represent the spatial dimension of the input features $\mathcal { A }$ . In (Courbariaux et al., 2016), both weights and activations are binarized using the sign function and then convolution is performed as $\mathcal { A } \ast \mathcal { W } \approx \mathrm { s i g n } ( \mathcal { A } ) \circledast \mathrm { s i g n } ( \mathcal { W } )$ where $\circledast$ denotes the binary convolution, which can be implemented using bit-wise operations.
|
| 46 |
+
|
| 47 |
+
However, this direct binarization approach introduces a high quantization error that leads to low accuracy. To alleviate this, XNOR-Net (Rastegari et al., 2016) proposes to use real-valued scaling factors to re-scale the output of the binary convolution as
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\mathcal { A } \ast \mathcal { W } \approx ( \mathrm { s i g n } ( \mathcal { A } ) \circledast \mathrm { s i g n } ( \mathcal { W } ) ) \odot \mathcal { K } \alpha ,
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
where $\odot$ denotes the element-wise multiplication, $_ \alpha$ and $\kappa$ are the weight and activation scaling factors, respectively, calculated in Rastegari et al. (2016) in an analytic manner. More recently, Bulat & Tzimiropoulos (2019) proposed to fuse $_ { \pmb { \alpha } }$ and $\kappa$ into a single factor $\Gamma$ that is learned via backpropagation, resulting in further accuracy gains.
|
| 54 |
+
|
| 55 |
+
# 4 METHOD
|
| 56 |
+
|
| 57 |
+
This section firstly introduces our strong baseline. Then, we present two ways to improve the approximation of Eq. 1: Firstly, we use a loss based on matching attention maps computed from the binary and a real-valued network (see section 4.2). Secondly, we make the scaling factor a function of the real-valued input activations $\mathcal { A }$ (see section 4.3).
|
| 58 |
+
|
| 59 |
+
# 4.1 BUILDING A STRONG BASELINE
|
| 60 |
+
|
| 61 |
+
Currently, almost all works on binary networks use XNOR-Net and BNN as baselines. In this section, we show how to construct a strong baseline by incorporating insights and techniques described in recent works as well as standard optimization techniques. We show that our baseline already achieves state-of-the-art accuracy. We believe this is an important contribution towards understanding the true impact of proposed methodologies and towards assessing the true gap with real-valued networks. Following prior work in binary networks, we focus on the ResNet-18 architecture and apply the improvements listed below:
|
| 62 |
+
|
| 63 |
+
Block structure: It is well-known that a modified ResNet block must be used to obtain optimal results for binary networks. We found the widely-used setting where the operations are ordered as BatchNorm Binarization BinaryConv Activation to be the best. The skip connection is the last operation of the block (Rastegari et al., 2016). Note that we use the sign function to binarize the activations. However, the BatchNorm layer includes an affine transformation and this ordering of the blocks allows its bias term act as a learnable binarization threshold.
|
| 64 |
+
|
| 65 |
+
Residual learning: We used double skip connections, as proposed in (Liu et al., 2018).
|
| 66 |
+
|
| 67 |
+
Activation: We used PReLU (He et al., 2015) as it is known to facilitate the training of binary networks (Bulat et al., 2019).
|
| 68 |
+
|
| 69 |
+
Scaling factors: We used discriminatively learnt scaling factors via backpropagation as in (Bulat & Tzimiropoulos, 2019).
|
| 70 |
+
|
| 71 |
+
Downsample layers: We used real-valued downsample layers (Liu et al., 2018). We found the large accuracy boost to be consistent across our experiments (around $3 - 4 \%$ top-1 improvement on ImageNet).
|
| 72 |
+
|
| 73 |
+
We used the following training strategies to train our strong baseline:
|
| 74 |
+
|
| 75 |
+
Initialization: When training binary networks, it is crucial to use a 2-stage optimization strategy (Bulat et al., 2019). In particular, we first train a network using binary activations and real-valued weights, and then use the resulting model as initialization to train a network where both weights and activations are binarized.
|
| 76 |
+
|
| 77 |
+
Weight decay: Setting up weight decay carefully is surprisingly important. We use $1 e - 5$ when training stage 1 (binary activation and real weights network), and set it to 0 on stage 2 (Bethge et al., 2019). Note that weights at stage 2 are either 1 or $- 1$ , so applying an $L _ { 2 }$ regularization term to them does not make sense.
|
| 78 |
+
|
| 79 |
+
Data augmentation: For CIFAR-100 we use the standard random crop, horizontal flip and rotation $( \pm 1 5 ^ { \circ } )$ . For ImageNet, we found that random cropping, flipping and colour jitter augmentation worked best. However, colour jitter is disabled for stage 2.
|
| 80 |
+
|
| 81 |
+
Mix-up: We found that mix-up (Zhang et al., 2017) is crucial for CIFAR-100, while it slightly hurts performance for ImageNet – this is due to the higher risk of overfitting on CIFAR-100.
|
| 82 |
+
|
| 83 |
+
Warm-up: We used warm-up for 5 epochs during stage 1 and no warm-up for stage 2.
|
| 84 |
+
|
| 85 |
+
Optimizer: We used Adam (Kingma & Ba, 2014) with a stepwise scheduler. The learning rate is set to $1 e - 3$ for stage 1, and $2 e - 4$ for stage 2. For CIFAR-100, we trained for 350 epochs, with steps at epochs 150, 250 and 320. For ImageNet, we train for 75 epochs, with steps at epochs 40, 60 and 70. Batch sizes are 256 for ImageNet and 128 for CIFAR-100.
|
| 86 |
+
|
| 87 |
+
# 4.2 REAL-TO-BINARY ATTENTION MATCHING
|
| 88 |
+
|
| 89 |
+
We make the reasonable assumption that if a binary network is trained so that the output of each binary convolution more closely matches the output of a real convolution in the corresponding layer of a real-valued network, then significant accuracy gains can be obtained. Notably, a similar assumption was made in (Rastegari et al., 2016) where analytic scale factors were calculated so that the error between binary and real convolutions is minimized. Instead, and inspired by the attention transfer method of (Zagoruyko & Komodakis, 2017), we propose to enforce such a constraint via a loss term at the end of each convolutional block by comparing attention maps calculated from the binary and real-valued activations. Such supervisory signals provide the binary network with muchneeded extra guidance. It is also well-known that backpropagation for binary networks is not as effective as for real-valued ones. By introducing such loss terms at the end of each block, gradients do not have to traverse the whole network and suffer a degraded signal.
|
| 90 |
+
|
| 91 |
+
Assuming that attention matching is applied at a set of $\mathcal { I }$ transfer points within the network, the total loss can be expressed as:
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\mathcal { L } _ { a t t } = \sum _ { j = 1 } ^ { \mathcal { I } } \Vert \frac { \mathcal { Q } _ { S } ^ { j } } { \Vert \mathcal { Q } _ { S } ^ { j } \Vert _ { 2 } } - \frac { \mathcal { Q } _ { T } ^ { j } } { \Vert \mathcal { Q } _ { T } ^ { j } \Vert _ { 2 } } \Vert ,
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
where $\begin{array} { r } { \mathcal { Q } ^ { j } = \sum _ { i = 1 } ^ { c } | \mathcal { A } _ { i } | ^ { 2 } } \end{array}$ and $A _ { i }$ is the $i -$ th channel of activation map $\mathcal { A }$ . Moreover, at the end of the network, we apply a standard logit matching loss (Hinton et al., 2015).
|
| 98 |
+
|
| 99 |
+
Progressive teacher-student: We observed that teacher and student having as similar architecture as possible is very important in our case. We thus train a sequence of teacher-student pairs that progressively bridges the differences between the real network and the binary network in small increments:
|
| 100 |
+
|
| 101 |
+
Step 1: the teacher is the real-valued network with the standard ResNet architecture. The student is another real-valued network, but with the same architecture as the binary ResNet-18 (e.g. double skip connection, layer ordering, PReLU activations, etc). Furthermore, a soft binarization (a Tanh function) is applied to the activations instead of the binarization (sign) function. In this way the network is still real-valued, but it behaves more closely to a network with binary activations.
|
| 102 |
+
|
| 103 |
+
Step 2: The network resulting from the previous step is used as the teacher. A network with binary activations and real-valued weights is used as the student.
|
| 104 |
+
|
| 105 |
+
Step 3: The network resulting from step 2 is used as the teacher and the network with binary weights and binary activations is the student. In this stage, only logit matching is used.
|
| 106 |
+
|
| 107 |
+
# 4.3 DATA-DRIVEN CHANNEL RE-SCALING
|
| 108 |
+
|
| 109 |
+
While the approach of the previous section provides better guidance for the training of binary networks, the representation power of binary convolutions is still limited, hindering its capacity to approximate the real-valued network. Here we describe how to boost the representation capability of a binary neural network and yet incur in only a negligible increment on the number of operations.
|
| 110 |
+
|
| 111 |
+
Previous works have shown the effectiveness of re-scaling binary convolutions with the goal of better approximating real convolutions. XNOR-Net (Rastegari et al., 2016) proposed to compute these scale factors analytically while (Bulat & Tzimiropoulos, 2019; Xu & Cheung, 2019) proposed to learn them discriminatively in an end-to-end manner, showing additional accuracy gains. For the latter case, during training, the optimization aims to find a set of fixed scaling factors that minimize the average expected loss for the training set. We propose instead to go beyond this and obtain discriminatively-trained input-dependent scaling factors – thus, at test time, these scaling factors will not be fixed but rather inferred from data.
|
| 112 |
+
|
| 113 |
+
Let us first recall what the signal flow is when going through a binary block. The activations entering a binary block are actually real-valued. Batch normalization centers the activations, which are then binarized, losing a large amount of information. Binary convolution, re-scaling and PReLU follow. We propose to use the full-precision activation signal, available prior to the large information loss incurred by the binarization operation, to predict the scaling factors used to re-scale the output of the binary convolution channel-wise. Specifically, we propose to approximate the real convolution as follows:
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
\mathcal { A } \ast \mathcal { W } \approx ( \mathrm { s i g n } ( \mathcal { A } ) \circledast \mathrm { s i g n } ( \mathcal { W } ) ) \odot \alpha \odot G ( \mathcal { A } ; \mathcal { W } _ { G } ) ,
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
where $\mathcal { W } _ { G }$ are the parameters of the gating function $G$ . Such function computes the scale factors used to re-scale the output of the binary convolution, and uses the pre-convolution real-valued activations as input. Fig. 1 shows our implementation of function $G$ . The design is inspired by Hu et al. (2018), but we use the gating function to predict ahead rather than as a self-attention mechanism.
|
| 120 |
+
|
| 121 |
+
An optimal mechanism to modulate the output of the binary convolution clearly should not be the same for all examples as in Bulat & Tzimiropoulos (2019) or Xu & Cheung (2019). Note that in Rastegari et al. (2016) the computation of the scale factors depends on the input activations. However the analytic calculation is sub-optimal with respect to the task at hand. To circumvent the aforementioned problems, our method learns, via backpropagation for the task at hand, to predict the modulating factors using the real-valued input activations. By doing so, more than $1 / 3$ of the remaining gap with the real-valued network is bridged.
|
| 122 |
+
|
| 123 |
+
# 4.4 COMPUTATIONAL COST ANALYSIS
|
| 124 |
+
|
| 125 |
+
Table 1 details the computational cost of the different binary network methodologies. We differentiate between the number of binary and floating point operations, including operations such as skip connections, pooling layers, etc. It shows that our method leaves the number of binary operations constant, and that the number of FLOPs increases by only $1 \%$ of the total floating point operation count. This is assuming a factor $r$ of 8, which is the one used in all of our experiments. To put this into perspective, the magnitude is similar to the operation increase incurred by the XNOR-Net with respect to its predecessor, BNN. Similarly, the double skip connections proposed in (Liu et al., 2018) adds again a comparable amount of operations. Note however that in order to fully exploit the computational efficiency of binary convolutions during inference, a specialized engine such as (Zhang et al., 2019; Yang et al., 2017) is required.
|
| 126 |
+
|
| 127 |
+
# 5 RESULTS
|
| 128 |
+
|
| 129 |
+
We present two main sets of experiments. We used ImageNet (Russakovsky et al., 2015) as a benchmark to compare our method against other state-of-the-art approaches in Sec. 5.1. ImageNet is the most widely used dataset to report results on binary networks and, at the same time, allows us to show for the first time that binary networks can perform competitively on a large-scale dataset. We further used CIFAR-100 (Krizhevsky & Hinton, 2009) to conduct ablation studies (Sec. 5.2).
|
| 130 |
+
|
| 131 |
+
Table 1: Breakdown of floating point and binary operations for variants of binary ResNet-18.
|
| 132 |
+
|
| 133 |
+
<table><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>BOPS</td><td rowspan=1 colspan=1>FLOPS</td></tr><tr><td rowspan=1 colspan=1>BNN (Courbariaux et al., 2016)XNOR-Net (Rastegari et al., 2016)Double Skip ((Liu et al., 2018)Bi-Real (Liu et al.,2018)Ours</td><td rowspan=1 colspan=1>1.695×1091.695×1091.695×1091.676×1091.676×109</td><td rowspan=1 colspan=1>1.314×1081.333×1081.351×1081.544×1081.564×108</td></tr><tr><td rowspan=1 colspan=1>Full Precision</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>1.826×109</td></tr></table>
|
| 134 |
+
|
| 135 |
+
# 5.1 COMPARISON WITH THE STATE-OF-THE-ART
|
| 136 |
+
|
| 137 |
+
Table 2 shows a comparison between our method and relevant state-of-the-art methods, including low-bit quantization methods other than binary.
|
| 138 |
+
|
| 139 |
+
Vs. other binary networks: Our strong baseline already comfortably achieves state-of-the art results, surpassing the previously best-reported result by about $1 \%$ (Wang et al., 2019). Our full method further improves over the state-of-the-art by $5 . 5 \%$ top-1 accuracy. When comparing to binary models that scale the capacity of the network (second set of results on Tab. 2), only (Zhuang et al., 2019) outperforms our method, surpassing it by $0 . 9 \%$ top-1 accuracy - yet, this is achieved using 4 times the number of binary blocks.
|
| 140 |
+
|
| 141 |
+
Vs. real-valued networks: Our method reduces the performance gap with its real-valued counterpart to $\sim 4 \%$ top-1 accuracy, or $\sim 5 \%$ if we compare against a real-valued network trained with attention transfer.
|
| 142 |
+
|
| 143 |
+
Vs. other low-bit quantization: Table 2 also shows a comparison to the state-of-the-art for low-bit quantization methods (first set of results). It can be seen that our method surpasses the performance of all methods, except for TTQ (Zhu et al., 2017), which uses 2-bit weights, full-precision activations and 1.5 the channel width at each layer.
|
| 144 |
+
|
| 145 |
+
# 5.2 ABLATION STUDIES
|
| 146 |
+
|
| 147 |
+
In order to conduct a more detailed ablation study we provide results on CIFAR-100. We thoroughly optimized a ResNet-18 full precision network to serve as the real-valued baseline.
|
| 148 |
+
|
| 149 |
+
Teacher-Student effectiveness: We trained a real-valued ResNet-18 using ResNet-34 as its teacher, yielding $\sim 1 \%$ top-1 accuracy increase. Instead, our progressive teacher-student strategy yields $\sim 5 \%$ top-1 accuracy gain, showing that it is a fundamental tool when training binary networks, and that its impact is much larger than for real-valued networks, where the baseline optimization is already healthier.
|
| 150 |
+
|
| 151 |
+
Performance gap to real-valued: We observe that, for CIFAR-100, we close the gap with realvalued networks to about $2 \%$ when comparing with the full-precision ResNet-18, and to about $3 \%$ when optimized using teacher supervision. The gap is consistent to that on ImageNet in relative terms: $\mathrm { { 1 3 \% } }$ and $1 0 \%$ relative degradation on ImageNet and CIFAR-100 respectively.
|
| 152 |
+
|
| 153 |
+
Binary vs real downsample: Our proposed method achieves similar performance increase irrespective of whether binary or real-valued downsample layers are used, the improvement being $5 . 5 \%$ and $6 . 6 \%$ top-1 accuracy gain respectively. It is also interesting to note that the results on the ablation study are consistent for all entries on both cases.
|
| 154 |
+
|
| 155 |
+
Scaling factors and attention matching: It is also noteworthy that the gating module is not effective in the absence of attention matching (see $\mathrm { \bf S B + G }$ entries). It seems clear from this result that both are interconnected: the extra supervisory signal is necessary to properly guide the training, while the extra flexibility added through the gating mechanism boosts the capacity of the network to mimic the attention map.
|
| 156 |
+
|
| 157 |
+
Table 2: Comparison with state-of-the-art methods on ImageNet. \*\* indicates real-valued downsample. The second column indicates the number of bits used to represent weights and activations. Methods include low-bit quantization (upper section), and methods multiplying the capacity of the network (second section). For the latter case, the second column includes the multiplicative factor of the network capacity used.
|
| 158 |
+
|
| 159 |
+
<table><tr><td rowspan=2 colspan=1>Method</td><td rowspan=1 colspan=3>ImageNet</td></tr><tr><td rowspan=1 colspan=1>Bitwidth (W/A)</td><td rowspan=1 colspan=1>Top-1</td><td rowspan=1 colspan=1>Top-5</td></tr><tr><td rowspan=6 colspan=1>BWN (Rastegari et al., 2016)TTQ (Zhu et al., 2017)HWGQ (Cai et al., 2017)LQ-Net (Zhang et al., 2018)SYQ (Faraone et al., 2018)DOREFA-Net (Zhou et al.,2016)</td><td rowspan=1 colspan=1>1/32</td><td rowspan=1 colspan=1>60.8</td><td rowspan=1 colspan=1>83.0</td></tr><tr><td rowspan=2 colspan=1>2/321/2</td><td rowspan=1 colspan=1>66.6</td><td rowspan=1 colspan=1>87.2</td></tr><tr><td rowspan=1 colspan=1>59.6</td><td rowspan=1 colspan=1>82.2</td></tr><tr><td rowspan=3 colspan=1>1/21/22/2</td><td rowspan=1 colspan=1>62.6</td><td rowspan=1 colspan=1>84.3</td></tr><tr><td rowspan=1 colspan=1>55.4</td><td rowspan=1 colspan=1>78.6</td></tr><tr><td rowspan=1 colspan=1>62.6</td><td rowspan=1 colspan=1>84.4</td></tr><tr><td rowspan=4 colspan=1>ABC-Net (Lin et al., 2017)Circulant CNN (Liu et al., 2019)Struct Appr (Zhuang et al., 2019)Struct Appr** (Zhuang et al., 2019)Ensemble (Zhu et al., 2019)</td><td rowspan=1 colspan=1>(1/1)×5</td><td rowspan=1 colspan=1>65.0</td><td rowspan=1 colspan=1>85.9</td></tr><tr><td rowspan=2 colspan=1>(1/1)×4(1/1)×4</td><td rowspan=1 colspan=1>61.4</td><td rowspan=1 colspan=1>82.8</td></tr><tr><td rowspan=1 colspan=1>64.2</td><td rowspan=1 colspan=1>85.6</td></tr><tr><td rowspan=1 colspan=1>(1/1)x4(1/1)×6</td><td rowspan=1 colspan=1>66.361.0</td><td rowspan=1 colspan=1>86.61</td></tr><tr><td rowspan=3 colspan=1>BNN (Courbariaux et al., 2016)XNOR-Net (Rastegari et al., 2016)Trained Bin (Xu & Cheung,2019)Bi-Real Net (Liu et al., 2018)**CI-Net (Wang et al., 2019)XNOR-Net++ (Bulat & Tzimiropoulos,2019)CI-Net (Wang et al., 2019)**</td><td rowspan=2 colspan=1>1/11/11/11/1</td><td rowspan=2 colspan=1>42.251.254.256.4</td><td rowspan=1 colspan=1>69.273.277.9</td></tr><tr><td rowspan=2 colspan=1>56.456.757.159.9</td><td rowspan=2 colspan=1>79.580.179.984.2</td></tr><tr><td rowspan=1 colspan=1>1/11/11/1</td></tr><tr><td rowspan=2 colspan=1>Strong Baseline (ours)**Real-to-Bin (ours)**</td><td rowspan=1 colspan=1>1/1</td><td rowspan=1 colspan=1>60.9</td><td rowspan=1 colspan=1>83.0</td></tr><tr><td rowspan=1 colspan=1>1/1</td><td rowspan=1 colspan=1>65.4</td><td rowspan=1 colspan=1>86.2</td></tr><tr><td rowspan=1 colspan=1>Real valuedReal valued T-S</td><td rowspan=1 colspan=1>32/3232/32</td><td rowspan=1 colspan=1>69.370.7</td><td rowspan=1 colspan=1>89.290.0</td></tr></table>
|
| 160 |
+
|
| 161 |
+
Table 3: Top-1 and Top-5 classification accuracy using ResNet-18 on CIFAR-100. \*\* indicates real-valued downsample layers. $G$ indicates that the gating function of Sec. 4.3 is used.
|
| 162 |
+
|
| 163 |
+
<table><tr><td rowspan=2 colspan=1>Method</td><td rowspan=1 colspan=1>Stage 1</td><td rowspan=1 colspan=1>Stage 2</td></tr><tr><td rowspan=1 colspan=1>Top-1/Top-5</td><td rowspan=1 colspan=1>Top-1/Top-5</td></tr><tr><td rowspan=1 colspan=1>Strong BaselineSB + Att TransSB + Att Trans + HKDSB +GSB + Progressive TSReal-to-Bin</td><td rowspan=1 colspan=1>69.3/88.772.2 /90.373.1 /91.267.2 / 87.073.8 /91.575.0 /92.2</td><td rowspan=1 colspan=1>68.0/88.371.1/90.171.9 /90.966.2 / 86.872.3 / 89.873.5 / 91.6</td></tr><tr><td rowspan=1 colspan=1>Strong Baseline**SB + Att Trans**SB+Att Trans + HKD**SB + G**SB + Progressive TS**Real-to-Bin**</td><td rowspan=1 colspan=1>72.1/89.974.3 /91.375.4 /92.272.0 /89.875.7 /92.176.5 /92.8</td><td rowspan=1 colspan=1>69.6/89.272.6 /91.473.9 /91.270.9 / 89.374.6 / 91.876.2 / 92.7</td></tr><tr><td rowspan=1 colspan=1>Full Prec (our impl.)Full Prec + TS (our impl.)</td><td rowspan=1 colspan=2>78.3/93.679.3 /94.4</td></tr></table>
|
| 164 |
+
|
| 165 |
+
# 6 CONCLUSION
|
| 166 |
+
|
| 167 |
+
In this work we showed how to train binary networks to within a few percent points of their realvalued counterpart, turning binary networks from hopeful research into a compelling alternative to real-valued networks. We did so by training a binary network to not only predict training labels, but also mimic the behaviour of real-valued networks. To this end, we devised a progressive attention matching strategy to drive optimization, and combined it with a gating strategy for scaling the output of binary convolutions, increasing the representation power of the convolutional block. The two strategies combine perfectly to boost the state-of-the-art of binary networks by 5.5 top-1 accuracy on ImageNet, the standard benchmark for binary networks.
|
| 168 |
+
|
| 169 |
+
# REFERENCES
|
| 170 |
+
|
| 171 |
+
Milad Alizadeh, Javier Fernandez-Marqu ´ es, Nicholas D. Lane, and Yarin Gal. An empirical study of ´ binary neural networks’ optimisation. In International Conference on Learning Representations, 2019.
|
| 172 |
+
|
| 173 |
+
Joseph Bethge, Haojin Yang, Marvin Bornstein, and Christoph Meinel. Back to simplicity: How to train accurate BNNs from scratch? arXiv preprint arXiv:1906.08637, 2019.
|
| 174 |
+
|
| 175 |
+
Adrian Bulat and Georgios Tzimiropoulos. XNOR-Net $^ { + + }$ : Improved binary neural networks. In British Machine Vision Conference, 2019.
|
| 176 |
+
|
| 177 |
+
Adrian Bulat, Georgios Tzimiropoulos, Jean Kossaifi, and Maja Pantic. Improved training of binary networks for human pose estimation and image recognition. arXiv preprint arXiv:1904.05868, 2019.
|
| 178 |
+
|
| 179 |
+
Zhaowei Cai, Xiaodong He, Jian Sun, and Nuno Vasconcelos. Deep learning with low precision by half-wave gaussian quantization. In IEEE Conference on Computer Vision and Pattern Recognition, 2017.
|
| 180 |
+
|
| 181 |
+
Matthieu Courbariaux, Itay Hubara, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Binarized neural networks: Training deep neural networks with weights and activations constrained to $+ 1$ or-1. arXiv, 2016.
|
| 182 |
+
|
| 183 |
+
Ruizhou Ding, Ting-Wu Chin, Zeye Liu, and Diana Marculescu. Regularizing activation distribution for training binarized deep networks. In IEEE Conference on Computer Vision and Pattern Recognition, 2019.
|
| 184 |
+
|
| 185 |
+
Julian Faraone, Nicholas J. Fraser, Michaela Blott, and Philip H. W. Leong. SYQ: learning symmetric quantization for efficient deep neural networks. In IEEE Conference on Computer Vision and Pattern Recognition, 2018.
|
| 186 |
+
|
| 187 |
+
Ruihao Gong, Xianglong Liu, Shenghu Jiang, Tianxiang Li, Peng Hu, Jiazhen Lin, Fengwei Yu, and Junjie Yan. Differentiable soft quantization: Bridging full-precision and low-bit neural networks. arXiv, 2019.
|
| 188 |
+
|
| 189 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In IEEE International Conference on Computer Vision, pp. 1026–1034, 2015.
|
| 190 |
+
|
| 191 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
|
| 192 |
+
|
| 193 |
+
Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. In IEEE Conference on Computer Vision and Pattern Recognition, 2018.
|
| 194 |
+
|
| 195 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 196 |
+
|
| 197 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. 2009.
|
| 198 |
+
|
| 199 |
+
Xiaofan Lin, Cong Zhao, and Wei Pan. Towards accurate binary convolutional neural network. In Advances on Neural Information Processing Systems, 2017.
|
| 200 |
+
|
| 201 |
+
Chunlei Liu, Wenrui Ding, Xin Xia, Baochang Zhang, Jiaxin Gu, Jianzhuang Liu, Rongrong Ji, and David Doermann. Circulant binary convolutional networks: Enhancing the performance of 1-bit dcnns with circulant back propagation. In IEEE Conference on Computer Vision and Pattern Recognition, 2019.
|
| 202 |
+
|
| 203 |
+
Zechun Liu, Baoyuan Wu, Wenhan Luo, Xin Yang, Wei Liu, and Kwang-Ting Cheng. Bi-Real Net: Enhancing the performance of 1-bit CNNs with improved representational capability and advanced training algorithm. In European Conference on Computer Vision, 2018.
|
| 204 |
+
|
| 205 |
+
Mohammad Rastegari, Vicente Ordonez, Joseph Redmon, and Ali Farhadi. Xnor-Net: Imagenet classification using binary convolutional neural networks. In European Conference on Computer Vision, 2016.
|
| 206 |
+
|
| 207 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li FeiFei. ImageNet Large Scale Visual Recognition Challenge. International Journal on Computer Vision, 115(3):211–252, 2015.
|
| 208 |
+
|
| 209 |
+
Daniel Soudry, Itay Hubara, and Ron Meir. Expectation backpropagation: Parameter-free training of multilayer neural networks with continuous or discrete weights. In Advances on Neural Information Processing Systems, 2014.
|
| 210 |
+
|
| 211 |
+
Ziwei Wang, Jiwen Lu, Chenxin Tao, Jie Zhou, and Qi Tian. Learning channel-wise interactions for binary convolutional neural networks. In IEEE Conference on Computer Vision and Pattern Recognition, 2019.
|
| 212 |
+
|
| 213 |
+
Zhe Xu and Ray C.C. Cheung. Accurate and compact convolutional neural networks with trained binarization. In British Machine Vision Conference, 2019.
|
| 214 |
+
|
| 215 |
+
Haojin Yang, Martin Fritzsche, Christian Bartz, and Christoph Meinel. BMXNet: An open-source binary neural network implementation based on MXNet. In ACM International Conference on Multimedia, 2017.
|
| 216 |
+
|
| 217 |
+
Sergey Zagoruyko and Nikos Komodakis. Paying more attention to attention: Improving the performance of convolutional neural networks via attention transfer. In International Conference on Learning Representations, 2017.
|
| 218 |
+
|
| 219 |
+
Dongqing Zhang, Jiaolong Yang, Dongqiangzi Ye, and Gang Hua. LQ-Nets: Learned quantization for highly accurate and compact deep neural networks. In European Conference on Computer Vision, 2018.
|
| 220 |
+
|
| 221 |
+
Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. Mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017.
|
| 222 |
+
|
| 223 |
+
Jianhao Zhang, Yingwei Pan, Ting Yao, He Zhao, and Tao Mei. dabnn: A super fast inference framework for binary neural networks on ARM devices. In ACM International Conference on Multimedia, 2019.
|
| 224 |
+
|
| 225 |
+
Shuchang Zhou, Yuxin Wu, Zekun Ni, Xinyu Zhou, He Wen, and Yuheng Zou. DoReFa-Net: Training low bitwidth convolutional neural networks with low bitwidth gradients. arXiv, 2016.
|
| 226 |
+
|
| 227 |
+
Chenzhuo Zhu, Song Han, Huizi Mao, and William J Dally. Trained ternary quantization. International Conference on Learning Representations, 2017.
|
| 228 |
+
|
| 229 |
+
Shilin Zhu, Xin Dong, and Hao Su. Binary ensemble neural network: More bits per network or more networks per bit? In IEEE Conference on Computer Vision and Pattern Recognition, 2019.
|
| 230 |
+
|
| 231 |
+
Bohan Zhuang, Chunhua Shen, Mingkui Tan, Lingqiao Liu, and Ian D. Reid. Towards effective low-bitwidth convolutional neural networks. In IEEE Conference on Computer Vision and Pattern Recognition, 2018.
|
| 232 |
+
|
| 233 |
+
Bohan Zhuang, Chunhua Shen, Mingkui Tan, Lingqiao Liu, and Ian Reid. Structured binary neural networks for accurate image classification and semantic segmentation. In IEEE Conference on Computer Vision and Pattern Recognition, 2019.
|
md/train/BJgQfkSYDS/BJgQfkSYDS.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/BJlVeyHFwH/BJlVeyHFwH.md
ADDED
|
@@ -0,0 +1,613 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ON THE INVERTIBILITY OF INVERTIBLE NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Guarantees in deep learning are hard to achieve due to the interplay of flexible modeling schemes and complex tasks. Invertible neural networks (INNs), however, provide several mathematical guarantees by design, such as the ability to approximate non-linear diffeomorphisms. One less studied advantage of INNs is that they enable the design of bi-Lipschitz functions. This property has been used implicitly by various works to design generative models, memory-saving gradient computation, regularize classifiers, and solve inverse problems.
|
| 8 |
+
|
| 9 |
+
In this work, we study Lipschitz constants of invertible architectures in order to investigate guarantees on stability of their inverse and forward mapping. Our analysis reveals that commonly-used INN building blocks can easily become noninvertible, leading to questionable “exact” log likelihood computations and training difficulties. We make use of numerical analysis tools to diagnose non-invertibility in practice. Finally, based on our theoretical analysis, we show how to guarantee numerical invertibility for one of the most common INN architectures.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Invertible neural networks (INNs) have become a standard building block in the deep learning toolkit. Invertibility is useful for training generative models with exact likelihoods (Dinh et al., 2014; 2017; Kingma & Dhariwal, 2018; Kingma et al., 2016; Behrmann et al., 2019; Chen et al., 2019), increasing posterior flexibility in VAEs (Rezende & Mohamed, 2015; Tomczak & Welling, 2016; Papamakarios et al., 2017), learning transition operators in MCMC samplers (Song et al., 2017; Levy et al., 2017), computing memory-efficient gradients (Gomez et al., 2017; Donahue & Simonyan, 2019), allowing for bi-directional training (Grover et al., 2018), solving inverse problems (Ardizzone et al., 2019) and analysing adversarial robustness (Jacobsen et al., 2019).
|
| 14 |
+
|
| 15 |
+
The application space of INNs is rapidly growing and many approaches for constructing invertible architectures have been proposed. A common way to construct invertible networks is to use triangular coupling layers (Dinh et al., 2014; 2017; Kingma & Dhariwal, 2018), where dimension partitioning is interleaved with ResNet-type computation. Another approach is to use various forms of masked convolutions, generalizing the dimension partitioning approach of coupling layers (Song et al., 2019; Hoogeboom et al., 2019). To avoid dimension partitioning altogether, multiple approaches based on efficiently estimating the log-determinant of the Jacobian, necessary for applying the change of variable formula, have been proposed to allow for free-form Jacobian structure (Grathwohl et al., 2019; Behrmann et al., 2019; Chen et al., 2019).
|
| 16 |
+
|
| 17 |
+
From a mathematical perspective, invertible architectures enable several unique guarantees like:
|
| 18 |
+
|
| 19 |
+
• Enabling flexible approximation of non-linear diffeomorphisms (Rezende & Mohamed, 2015; Dinh et al., 2017; Kingma & Dhariwal, 2018; Chen et al., 2019)
|
| 20 |
+
Memory-saving gradient computation (Gomez et al., 2017; Donahue & Simonyan, 2019)
|
| 21 |
+
Fast analytical invertibility (Dinh et al., 2014)
|
| 22 |
+
Guaranteed preservation of mutual information and exact access to invariants of deep networks (Jacobsen et al., 2018; 2019).
|
| 23 |
+
|
| 24 |
+
Despite the increased interest in invertible neural networks, little attention has been paid to guarantees on their numerical invertibility. Specifically, this means analyzing their ability to learn bi-Lipschitz neural networks, i.e. Lipschitz continuous neural networks with a bound on the Lipschitz constant of the forward and inverse mapping.
|
| 25 |
+
|
| 26 |
+
While the stability analysis of neural networks has received significant attention e.g. due to adversarial examples (Szegedy et al., 2013), the focus here is only on bounding Lipschitz constants of the forward mapping. However, bounding the Lipschitz constant of the inverse mapping is of major interest, e.g. when reconstructing inputs from noisy or imprecise features. In fact, analytical invertibility as provided by some invertible architectures does not necessarily imply numerical invertibility in practice.
|
| 27 |
+
|
| 28 |
+
In this paper, we first discuss the relevance of controlling the bi-Lipschitz bounds of invertible networks. Afterwards we analyze Lipschitz bounds of commonly used invertible neural network building blocks. Our contributions are:
|
| 29 |
+
|
| 30 |
+
• We argue for forward and inverse stability analysis as a unified viewpoint on invertible network (non-)invertibility. To this end, we derive Lipschitz bounds of commonly-used invertible building blocks for their forward and inverse maps.
|
| 31 |
+
We numerically monitor and detect (non-)invertibility for different practical tasks such as classification and generative modeling. We show how this overlooked issue with non-invertibility can lead to questionable claims when computing exact likelihoods with the change-of-variable formula.
|
| 32 |
+
• Finally, we study spectral normalization as a stabilizer for one of the most commonly-used family of INN architectures, namely additive coupling blocks.
|
| 33 |
+
|
| 34 |
+
# 2 BACKGROUND AND MOTIVATION
|
| 35 |
+
|
| 36 |
+
Invertible neural networks are bijective functions with a parametrized forward mapping $F _ { \theta } : \mathbb { R } ^ { d } \mathbb { R } ^ { d }$ with $F _ { \theta } : x \mapsto z$ , where $\theta \in \mathbb { R } ^ { p }$ defines the parameter vector. Additionally, they define an inverse mapping $F _ { \theta } ^ { - 1 } : \mathbb { R } ^ { d } \mathbb { R } ^ { d }$ with $F _ { \theta } ^ { - 1 } : z \mapsto { \dot { x } }$ . This inverse can be given in closed-form (analytical inverse, e.g. Dinh et al. (2017); Kingma & Dhariwal (2018)) or approximated numerically (numerical inverse, e.g. Behrmann et al. (2019); Song et al. (2019)).
|
| 37 |
+
|
| 38 |
+
Before we discuss building blocks of invertible networks, we provide some background and motivation for studying forward and inverse stability.
|
| 39 |
+
|
| 40 |
+
Definition 1 (Lipschitz and bi-Lipschitz continuity). A function $F : ( \mathbb { R } ^ { d _ { 1 } } , \| \cdot \| ) \to ( \mathbb { R } ^ { d _ { 2 } } , \| \cdot \| )$ is called Lipschitz continuous if there exists a constant $L = : \operatorname { L i p } ( F )$ such that
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
\| F ( x _ { 1 } ) - F ( x _ { 2 } ) \| \leq L \| x _ { 1 } - x _ { 2 } \| , \quad \forall x _ { 1 } , x _ { 2 } \in \mathbb R ^ { d _ { 1 } } .
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
If an inverse $F ^ { - 1 } : ( \mathbb { R } ^ { d _ { 2 } } , \lVert \cdot \rVert ) \to ( \mathbb { R } ^ { d _ { 1 } } , \lVert \cdot \rVert )$ and a constant $L ^ { * } = : \operatorname { L i p } ( F ^ { - 1 } )$ exists such that
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\| F ^ { - 1 } ( y _ { 1 } ) - F ^ { - 1 } ( y _ { 2 } ) \| \leq L ^ { * } \| y _ { 1 } - y _ { 2 } \| , \quad \forall y _ { 1 } , y _ { 2 } \in \mathbb { R } ^ { d _ { 2 } } ,
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
then $F$ is called bi-Lipschitz continuous.
|
| 53 |
+
|
| 54 |
+
Remark 2. We focus on invertible functions $F : ( \mathbb { R } ^ { d } , \| \cdot \| _ { 2 } ) \to ( \mathbb { R } ^ { d } , \| \cdot \| _ { 2 } ) ,$ , i.e. functions where the domain and co-domain are of the same dimensionality $d$ and the norm is given by the euclidian norm.
|
| 55 |
+
|
| 56 |
+
Lemma 3. (Rademacher (Federer, 1969, Theorem 3.1.6))
|
| 57 |
+
If $F : \mathbb { R } ^ { d } \mathbb { R } ^ { d }$ is a locally Lipschitz continuous function (i.e. functions whose restriction to a neighborhood around any point is Lipschitz), then $F$ is differentiable almost everywhere. Moreover, $i f F$ is Lipschitz continuous, then
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\mathrm { L i p } ( F ) = \operatorname* { s u p } _ { x \in \mathbb { R } ^ { d } } \| J _ { F } ( x ) \| _ { 2 } ,
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
where $J _ { F } ( x )$ is the Jacobian matrix of $F$ at $x$ and $\| J _ { F } ( x ) \| _ { 2 }$ denotes its spectral norm.
|
| 64 |
+
|
| 65 |
+
Lipschitz bounds on the forward mapping are of crucial importance in several areas, including in adversarial example research (Szegedy et al., 2013), to avoid exploding gradients, or the training of Wasserstein GANs (Anil et al., 2019). The stability of the inverse, however, can have a similar impact. For instance, having a Lipschitz bound on the inverse may avoid vanishing gradients during training.
|
| 66 |
+
|
| 67 |
+
Given that deep-learning computations are carried out with limited precision, imprecision is always introduced in both the forward and backward passes, i.e., $z ^ { \delta } = { \bf { \dot { F } } } ( x ) + \delta$ and $\hat { x } ^ { \delta } = F ^ { - 1 } ( z ^ { \check { \delta } } )$ . Instability in either pass will aggravate this problem, and essentially make the invertible network numerically non-invertible. To summarize, this problem occurs in the following situations:
|
| 68 |
+
|
| 69 |
+
• Numerical reconstruction of $x$ , where features $z ^ { \delta }$ are inexact due to limited precision (e.g. when computations are executed in single precision as common on modern hardware).
|
| 70 |
+
Reconstruction based on imprecise measurements from physical devices (e.g. when using invertible networks for inverse problems (Ardizzone et al., 2019)).
|
| 71 |
+
• Numerical re-computation of intermediate activations of the neural network to allow for memory-efficient backpropagation (Gomez et al., 2017).
|
| 72 |
+
|
| 73 |
+
Furthermore, some computations are performed via numerical approximation, which in turn adds another source of imprecision that might be aggravated via instability. Examples include:
|
| 74 |
+
|
| 75 |
+
• Numerical forward computation, as in Neural ODEs (Chen et al., 2018) (numerical solver is used to approximate dynamic of ODE).
|
| 76 |
+
Numerical inverse computation, e.g. via fixed-point iterations as in i-ResNets (Behrmann et al., 2019) or MintNet (Song et al., 2019) or via ODE-solvers for the backward dynamics as in Neural ODEs (Chen et al., 2018).
|
| 77 |
+
|
| 78 |
+
As an example of why bi-Lipschitz continuity is critical for numerical stability in invertible functions, let’s consider the simple mappings $F _ { 1 } ( x ) \stackrel { \bullet } { = } \log ( x ) , F _ { 1 } ^ { - 1 } ( z ) = \exp ( z )$ , and $F _ { 2 } ( x ) = x , F _ { 2 } ^ { - 1 } ( z ) =$ $z$ . Though both functions tend to infinity when $x \infty$ , $F _ { 1 }$ is much less stable. Consider the introduction of numerical imprecision as $z ^ { \delta } = F _ { 1 } ( x ) + \delta$ where $\delta$ denotes the introduced imprecision. Then this imprecision is magnified in the inverse pass as:
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
| | F _ { 1 } ^ { - 1 } ( z ) - F _ { 1 } ^ { - 1 } ( z ^ { \delta } ) | | _ { 2 } ^ { 2 } \approx | | \delta \frac { \partial F _ { 1 } ^ { - 1 } ( z ^ { \delta } ) } { \partial z ^ { \delta } } | | _ { 2 } ^ { 2 } = | | \delta \exp ( z ^ { \delta } ) | | _ { 2 } ^ { 2 } .
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
A similar example can be constructed for both the forward and backward passes, which speaks to the importance of bi-Lipschitz continuity. For an additional discussion on the connection of Lipschitz constants and numerical errors, we refer to Appendix $\mathbf { B }$ .
|
| 85 |
+
|
| 86 |
+
# 3 STABILITY OF INVERTIBLE NEURAL NETWORKS
|
| 87 |
+
|
| 88 |
+
# 3.1 LIPSCHITZ BOUNDS FOR BUILDING BLOCKS OF INVERTIBLE NETWORKS
|
| 89 |
+
|
| 90 |
+
Research on invertible networks has produced a large variety of architectural building blocks. Yet, the focus of prior work was on obtaining flexible architectures while maintaining invertibility guarantees. Here, we build on the work in (Behrmann et al., 2019), where bi-Lipschitz bounds were proven for invertible ResNets, by deriving Lipschitz bounds on the forward and inverse mapping of common building blocks. Together with an overview of common invertible building blocks, we provide our main results in Table 1. We chose these particular model classes in order to cover both coupling-based approaches and free-form approaches like Neural ODE (Chen et al., 2018) and i-ResNets (Behrmann et al., 2019). The derivations of the bounds are given in Appendix A. Note that the bounds provide the worst-case stability and serve mainly as a guideline for future designs of invertible building blocks.
|
| 91 |
+
|
| 92 |
+
# 3.2 CONTROLLING STABILITY OF BUILDING BLOCKS
|
| 93 |
+
|
| 94 |
+
As shown in Table 1, there are many factors that influence the stability of INNs. Of particular importance are the Lipschitz constants $\operatorname { L i p } ( g )$ of the sub-network $g$ for i-ResNets (Behrmann et al., 2019) and affine coupling blocks (Dinh et al., 2014), and $\mathrm { L i p } ( s ) , \mathrm { L i p } ( t )$ for additive coupling blocks (Dinh et al., 2017). Whereas computing the Lipschitz constants of neural networks is NP-hard (Virmaux & Scaman, 2018), there is a simple data-independent upper bound:
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\mathrm { L i p } ( g ) \leq \prod _ { i = 1 } ^ { L } \| A _ { i } \| _ { 2 } , \quad \mathrm { f o r } \quad g ( x ) = A _ { L } \circ \phi \circ A _ { L - 1 } \circ \cdot \cdot \circ A _ { 2 } \circ \phi \circ A _ { 1 } ,
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
Table 1: Lipschitz bounds on building blocks of invertible neural networks. The second column shows the operations of the forward mapping and the last two columns show bounds on the Lipschitz constant of the forward and inverse mapping. $M$ in the row for the forward mapping of an affine block is defined as ${ \cal M } = \operatorname* { m a x } ( | a | , | b | ) \cdot \bar { c } _ { g ^ { \prime } } \cdot \bar { \mathrm { L i p } } ( s ) + \mathrm { L i p } ( t )$ . Furthermore, $M ^ { * }$ for the inverse of an affine block is $M ^ { * } = \operatorname* { m a x } ( | a ^ { * } | , | b ^ { * } | ) \cdot c _ { ( \frac { 1 } { g } ) ^ { \prime } } \cdot \mathrm { L i p } ( s ) + c _ { \left( \frac { 1 } { g } \right) ^ { \prime } } \cdot \mathrm { L i p } ( s ) \cdot c _ { t } + c _ { \frac { 1 } { g } } \cdot \mathrm { L i p } ( t ) .$ . Note that the bounds of the affine blocks hold only locally. Derivations of the bounds are given in Appendix A.
|
| 101 |
+
|
| 102 |
+
<table><tr><td>Building Block</td><td>Forward Operation</td><td>Lipschitz Forward</td><td>Lipschitz Inverse</td></tr><tr><td>Additive Coupling Block (Dinh et al., 2014)</td><td>F(x)1=x1 F(x)1=x1+g(x1)</td><td>≤1+Lip(g)</td><td>≤1+Lip(g)</td></tr><tr><td>Affine Coupling Block (Dinh et al., 2017)</td><td>F(x)1=x1 F(x)1=x1①g(s(𝑥1))+t(𝑥1) g()≠0</td><td>≤max(1,cg)+M local for x ∈ [a,b]d g(x)≤cg</td><td>≤max(1,c1)+M* local for y ∈[a*,b*]d g (≤</td></tr><tr><td>Invertible Residual Layer (Behrmann et al.,2019)</td><td>F(x)=x+g(x) Lip(g)<1</td><td>≤1+Lip(g)</td><td>≤1-Lip(@) 1</td></tr><tr><td>Neural ODE (Chen et al.,2018)</td><td>d(t)=F(x(t),t) dt t∈[0,T]</td><td>≤eLip(F).t</td><td>≤eLip(F).t</td></tr><tr><td>Invertible Downsampling /Squeeze (Dinh et al., 2017)</td><td>F(x)=Px P permutation</td><td>=1</td><td>=1</td></tr><tr><td>Diagonal Scaling (Dinh et al., 2014) ActNorm</td><td>F(x)=Dx D diagonal</td><td>= maxi|Diil</td><td>miniDii</td></tr><tr><td>(Kingma & Dhariwal,2018) Invertible 1×1 Convolution (Kingma & Dhariwal,2018)</td><td>D≠0 F(x)=PL(U+diag(s))=:W P permutation,L lower-triangular U upper-triangular,s ∈Rd</td><td>≤|W|2</td><td>≤ |W-1|2</td></tr></table>
|
| 103 |
+
|
| 104 |
+
where $A _ { i }$ are linear layers, $\| \cdot \| _ { 2 }$ is the spectral norm and $\phi$ a contractive activation function $( \mathrm { L i p } ( \phi ) \leq 1 )$ ). The above bound was used by (Behrmann et al., 2019) in conjunction with spectral normalization (Miyato et al., 2018; Gouk et al., 2018) to ensure a contractive residual block $g$ . In particular, this employs a normalization via:
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
\tilde { A } = \kappa \frac { A } { \hat { \sigma } _ { 1 } } , \quad \mathrm { w i t h } \quad \hat { \sigma } _ { 1 } \approx \sigma _ { 1 } = \| A \| _ { 2 } \quad ( \mathrm { a p p r o x . \ v i a \ p o w e r { - } m e t h o d } ) ,
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
where $\kappa > 0$ is a coefficient that sets the approximate upper bound on the spectral norm of each linear layer $A _ { i }$ . Thus, by setting an appropriate coefficient $\kappa$ depending on the targeted Lipschitz bound of the building block, this approach enables one to control both forward and inverse stability. Note that the above discussion can be generalized to other $\ell _ { p }$ -norms, see (Chen et al., 2019).
|
| 111 |
+
|
| 112 |
+
However, this is not sufficient when using affine coupling blocks because their bound on the Lipschitz constant holds only locally. In particular, it depends on the regions of the inputs $x$ to the coupling block. While inputs to the first layer are usually bounded by the nature of the data, obtaining bounds for intermediate activations is less straightforward. One interesting avenue for future work could be local regularizers like gradient penalties (Gulrajani et al., 2017), where spectral normalization could be used post-hoc to certify stability.
|
| 113 |
+
|
| 114 |
+
Lastly, we use ActNorm (Kingma & Dhariwal, 2018) in several architectures and avoid small diagonal terms which would yield large Lipschitz constants in the inverse (see Table 1) by adding a positive constant. Further stabilization could be achieved via bounding the scaling.
|
| 115 |
+
|
| 116 |
+
# 4 NUMERICAL EXPERIMENTS
|
| 117 |
+
|
| 118 |
+
In this section, we study numerical invertibility for several objectives and architecture settings. This section is structured by task:
|
| 119 |
+
|
| 120 |
+
1. Classification: we show that INN classifiers can become non-invertible on CIFAR-10 and discuss consequences for memory-efficient backpropagation.
|
| 121 |
+
|
| 122 |
+
2. Density estimation: we analyze the numerical invertibility of SOTA trained density models.
|
| 123 |
+
|
| 124 |
+
3. Generative modeling: we study the stability of adversarially trained INN generators, discuss the consequences for likelihood evaluation, and stabilize an additive-coupling based INN generator using spectral normalization.
|
| 125 |
+
|
| 126 |
+
4. Decorrelation: we perform an in-depth study of the effect of different architecture settings on a simple task, where both stable and unstable solutions are possible. Furthermore, we show that spectral normalization is effective at stabilizing additive-coupling based flows.
|
| 127 |
+
|
| 128 |
+
We use the following measures to diagnose the numerical instability of invertible models:
|
| 129 |
+
|
| 130 |
+
• Reconstruction error. We measure the $\ell _ { 2 }$ -distance between the input $x$ and its reconstruction, i.e. $| | x ^ { ( i ) } - F _ { \theta } ^ { - 1 } ( F _ { \theta } ( x ^ { ( i ) } ) ) | | _ { 2 }$ . • Conditioning of the Jacobian and max/min singular values. For forward stability, we are interested in the behavior of the Jacobian $J _ { F } ( x )$ , while for inverse stability we are interested in the Jacobian of the inverse mapping $J _ { F ^ { - 1 } } ( x )$ . We compute the singular values of the Jacobians using the SVD, which allows us to compute its condition number. 1
|
| 131 |
+
|
| 132 |
+
While the reconstruction error allows us to quantitatively monitor non-invertibility even before reconstruction artifacts are perceptible, the linear approximation $J _ { F } ( x )$ and its singular values provide insights into unstable directions of the forward (very large singular values of $J _ { F } ( x ) )$ and inverse (very small singular values of $J _ { F } ( x ) )$ mapping. Both measures were also used in (Jacobsen et al., 2018), where an ill-conditioned inverse was observed.
|
| 133 |
+
|
| 134 |
+
# 4.1 CLASSIFICATION WITH INVERTIBLE MODELS
|
| 135 |
+
|
| 136 |
+
In this section, we show that when training an INN for classification, there exist both stable and unstable solutions. We compare a stable model that uses additive coupling and an unstable model that uses affine coupling and ActNorm both inside and between the blocks—for additional experimental details see Appendix C. These models achieve similar test accuracies of $9 0 . 2 \%$ and $9 0 . 5 \%$ , respectively (Figure 6, Appendix C); however, we note that the goal of this experiment is not to achieve SOTA accuracy on CIFAR-10. Rather, we aim to show that models trained for classification with reasonable accuracy, can vary greatly with respect to stability. To observe the differences in stability, we plot the reconstruction results in Figure 2.
|
| 137 |
+
|
| 138 |
+
An important use-case of INNs is to enable memoryefficient training, by re-computing activations in the backward pass rather than storing them in memory during the forward pass (Gomez et al., 2017). This approach enables e.g. large-scale generative modeling (Donahue & Simonyan, 2019) and scaling segmentation networks to high-resolution medical images (Brugger et al., 2019). ¨
|
| 139 |
+
|
| 140 |
+

|
| 141 |
+
Figure 1: Impact of stability on memory-efficient training. We measure the angle between the true gradient (using stored activations) and the memory-saving gradient (using recomputing activations). For all epochs after the dotted vertical line, the affine model had numerically infinite or nan gradients, while the additive model gives accurate memory-efficient gradients.
|
| 142 |
+
|
| 143 |
+
Re-computing the activations, however, relies on a numerically precise inverse mapping. To better understand the effect of numerical errors, we perform an analysis similar to Gomez et al. (2017): we track the angle between the true and memory-saving gradients during training (Figure 1). As expected from the reconstruction results, we observe that the affine model yields gradients very different from the true gradient; in fact, after approximately 20 epochs of training, the memory-saving gradients of the affine model contain numerically infinite or nan values. Thus, it would not be possible to train the affine model successfully using memory-saving gradients.
|
| 144 |
+
|
| 145 |
+

|
| 146 |
+
Figure 2: Measuring stability of additive and affine INN classifiers on CIFAR-10. Right: we track the reconstruction errors for a fixed minibatch over the course of training. In each iteration (vertical slice) we plot the errors of each minibatch element. Orange points in the affine plot denote inf and nan values. c denotes the condition number of the Jacobian, $\sigma _ { m a x }$ and $\sigma _ { m i n }$ denote the max and min singular values. At the top, we show the original images $x$ and in each snapshot, the reconstructions $\bar { x } = F ^ { - 1 } ( F ( x ) )$ and reconstruction errors $R = | x - { \hat { x } } |$ .
|
| 147 |
+
|
| 148 |
+
# 4.2 ANALYZING STATE-OF-THE-ART DENSITY MODELS
|
| 149 |
+
|
| 150 |
+

|
| 151 |
+
Figure 3: Crafting non-invertible inputs for a CIFAR-10 Glow model. For three different images, we show: 1) the original datapoint $x$ from which we start running PGD; 2) the crafted input $x ^ { \prime }$ that results from PGD; and 3) the reconstruction ${ \hat { x } } ^ { \prime } = F ^ { - 1 } ( F ( x ^ { \prime } ) )$ of the crafted input. In all cases, the reconstructions of adversarial inputs are heavily corrupted, indicating that the attacks were successful, and exposing non-invertibility in this Glow model.
|
| 152 |
+
|
| 153 |
+
In this section, we analyze the invertibility of trained density models. In particular, we expose non-invertibility in models that otherwise appear stable by optimizing in input space to find examples that are poorly reconstructed by the model. Here, we take a trained Glow model (Kingma $\&$ Dhariwal, $2 0 1 8 ) ^ { 2 }$ and optimize the input using Projected Gradient Descent (PGD) (Madry et al., 2018). Our goal is to find a point $x ^ { \prime }$ in the domain of the invertible model such that the reconstruction $F ^ { - 1 } ( F ( x ^ { \prime } ) )$ differs from $x ^ { \prime }$ . In particular, we start with a datapoint $x$ and use PGD to find a perturbed example $x ^ { \prime }$ that has high reconstruction error via Eq. 3 (additional details in Appendix E).
|
| 154 |
+
|
| 155 |
+
$$
|
| 156 |
+
\underset { | | x ^ { \prime } - x | | _ { \infty } \leq \epsilon } { \arg \operatorname* { m a x } } | | x ^ { \prime } - F ^ { - 1 } ( F ( x ^ { \prime } ) ) | | _ { 2 } .
|
| 157 |
+
$$
|
| 158 |
+
|
| 159 |
+
As shown in Figure 3, this attack is effective for finding examples that are perceptually identical to test examples, yet induce large reconstruction errors. This attack can be understood as a worstcase invertibility diagnosis; however, we note that unsuccessful attacks can be due to algorithmic issues and thus do not necessarily imply stable invertible models. Also, it is not always clear how to get gradients that are able to exploit numerical instabilities, leaving room for improvement via gradient-free methods (e.g., the boundary attack from Brendel et al. (2018)).
|
| 160 |
+
|
| 161 |
+
We present in Appendix E additional experiments using the PGD attack on the additive Glow model from (Kingma & Dhariwal, 2018) trained on CelebA, where we show that the model becomes non-invertible outside the valid input range of images. Furthermore, we analyze a trained residual flow model (Chen et al., 2019) on CIFAR-10, where we cannot find such dramatic non-invertible inputs, which is to be expected given the stability bounds of i-ResNet blocks (see Table 1).
|
| 162 |
+
|
| 163 |
+
# 4.3 GENERATIVE MODELING WITH INVERTIBLE MODELS
|
| 164 |
+
|
| 165 |
+
Generative models based on invertible networks have been predominantly trained using maximum likelihood estimation (MLE). Another viable approach is to train them adversarially (ADV), as done in Flow-GAN (Danihelka et al., 2017; Grover et al., 2018). Flow-GAN is appealing as it can result in a generator capable of producing high-quality samples (as in GANs), while also giving access to exact density estimates, which GANs lack. Prior work (Danihelka et al., 2017; Grover et al., 2018) has compared these two techniques for training flows (MLE vs ADV); the main conclusion of these studies was that training with MLE yields good likelihoods but relatively poor samples, while training with a GAN loss yields good samples but likelihoods orders of magnitude worse than MLE training.
|
| 166 |
+
|
| 167 |
+
<table><tr><td></td><td>MLE Affine -</td><td>MLE Additive</td><td>ADV Additive Unstable</td><td>ADV Additive Stable</td></tr><tr><td>(Test) BPD</td><td>1.22</td><td>1.38</td><td>3.87e12*</td><td>709</td></tr><tr><td>FID</td><td>99.9</td><td>95.1</td><td>25.3</td><td>195</td></tr></table>
|
| 168 |
+
|
| 169 |
+
Table 2: Comparison of bits-per-dimension (BPD) and sample quality via FID scores for MLE- and ADV-trained models. For reference, the FID of a untrained Flow is roughly 1500. Using the stable version with ADV, though improves BPD significantly, might come at a trade-off on FID.
|
| 170 |
+
|
| 171 |
+
Here, we analyze in depth the effect of Flow-GAN training on numerical stability. We use networks with repeated additive coupling layers, and ActNorm between blocks. We examine two architectures, both with 3 levels, i.e., ‘squeeze’ between levels (additional details in Appendix D):
|
| 172 |
+
|
| 173 |
+
• Stable: having a depth of 4 (i.e., 4 blocks per level) and spectral normalization applied to all the convolution layers, see section 3.2 for details.
|
| 174 |
+
• Unstable: having a depth of 16, ActNorm within coupling layer, and no spectral normalization applied to the convolutional layers.
|
| 175 |
+
|
| 176 |
+
Table 2 shows that models trained with MLE objective can achieve good bits-per-dimenstion (BPD), but models trained with ADV can achieve better sample quality as measured by the Frechet Inception Distance (FID), a common measure of sample quality (Heusel et al., 2017; Lucic et al., 2018). This justifies why considering training INN with objective functions other than MLE is desired.
|
| 177 |
+
|
| 178 |
+
Broken Flow-GAN. In Figure 4, we show that an INN trained only with adversarial loss can become non-invertible, depending on the architecture. We perform forward and inverse passes repeatedly on the same mini-batch. The unstable model shows visible reconstruction errors quickly. Table 3 shows that the unstable model has BPD orders of magnitude larger than the stable model.
|
| 179 |
+
|
| 180 |
+

|
| 181 |
+
Figure 4: Reconstructions of images through multiple forward/inverse passes. First row in the ‘Recons’ subfigures are real-data, and each row after is one forward/inverse pass.
|
| 182 |
+
|
| 183 |
+
<table><tr><td>Model</td><td>(Test) BPD</td><td>Max-SV</td><td>Min-SV</td><td>Cond-Num</td><td>Analytic LDJ</td></tr><tr><td>ADV (Stable)</td><td>709</td><td>1.99e3</td><td>0.6129</td><td>3.253e3</td><td>4734</td></tr><tr><td>ADV (Unstable)</td><td>3.87e12*</td><td>3.83e8</td><td>0.0309</td><td>1.239e10</td><td>9874</td></tr></table>
|
| 184 |
+
|
| 185 |
+
Table 3: Stability analysis on two architectures trained adversarially (ADV), and with maximum likelihood (MLE). \*means this number is meaningless as the network is visibly non-invertible. LDJ denotes the log-determinant of the Jacobian, BPD denotes bits-per-dimension and SV singular value.
|
| 186 |
+
|
| 187 |
+
Flow-GAN “Likelihood”. Typically likelihood is computed by a change of variables, which assumes invertibility. When a network is numerically non-invertible, the assumption breaks, and the computed value becomes some numerical approximation to the density. The model used in Figure 4 consists of additive coupling blocks, ActNorm, and squeezing operations. All these operations have data independent log-determinant Jacobian. Thus, obtaining a numerical value via the change of variable formula is straightforward. However, it is unclear what this numerical value represents, likely it cannot be trusted as true likelihood due to the lack of invertibility. In this case, we advocate for ensuring invertibility using the remedies discussed here to make sure BPD values are trustworthy. In terms of sample quality, however, we currently observe a tradeoff since the stable model yields higher FID scores than the unstable model (Table 2, includes also MLE-models for comparison). Yet, we believe that proper tuning e.g. of spectral normalization could remove this tradeoff.
|
| 188 |
+
|
| 189 |
+
Lastly, one can adjust for the likelihood by adjusting the prior (see Appendix I). In summary, in this section we point out that Flow-GAN can become non-invertible, in which case the computed likelihood cannot be taken as ground truth likelihood (Grover et al., 2018). In sum, INN trained with MLE are stable, but the sample quality is worse than those trained with ADV. Yet, training with ADV loss might make INN non-invertible, which defeats the purpose of using INN in the first place. Hence, when training with alternative objectives, numerical stability is a crucial property to consider.
|
| 190 |
+
|
| 191 |
+
# 4.4 DECORRELATION TASK
|
| 192 |
+
|
| 193 |
+
As the last part of our empirical study, we use a simple decorrelation task to benchmark the stability of invertible models. In particular, we compute the correlation matrix $C \in \mathbb { R } ^ { d \times d }$ via
|
| 194 |
+
|
| 195 |
+
$$
|
| 196 |
+
C _ { j , l } ^ { \theta } = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \frac { \left( F _ { \theta } ( x ^ { ( i ) } ) _ { j } - \hat { \mu } _ { j } \right) \left( F _ { \theta } ( x ^ { ( i ) } ) _ { l } - \hat { \mu } _ { l } \right) } { \hat { \sigma } _ { j } \hat { \sigma } _ { l } } ,
|
| 197 |
+
$$
|
| 198 |
+
|
| 199 |
+
where $\hat { \mu } _ { j }$ is the estimated mean over output samples $F _ { \theta } ( x ^ { ( i ) } )$ and $\hat { \sigma } _ { j }$ the estimated standard deviation.
|
| 200 |
+
Then, we optimize the parameters $\theta$ to minimize the off-diagonal correlation, i.e.
|
| 201 |
+
|
| 202 |
+
$$
|
| 203 |
+
\operatorname* { m i n } _ { \theta } \| C ^ { \theta } - \mathrm { d i a g } ( C ^ { \theta } ) \| _ { F } ,
|
| 204 |
+
$$
|
| 205 |
+
|
| 206 |
+
where $\| \cdot \| _ { F }$ is the Frobenius-norm 3. Decorrelation objectives have been used in (Cogswell et al., 2015) to reduce overfitting and in (Cheung et al., 2014) to disentangle hidden activations.
|
| 207 |
+
|
| 208 |
+
This objective serves as a good task for our purposes for two reasons:
|
| 209 |
+
|
| 210 |
+
1. Decorrelation is a simpler objective than optimizing outputs $z = F _ { \theta } ( x )$ to follow a factorized Gaussian as in Normalizing Flows (Rezende & Mohamed, 2015). Furthermore, it will show that changing the objective to less standard tasks can lead to larger instabilities compared to using INNs on more common tasks such as density estimation.
|
| 211 |
+
2. Decorrelation allows multiple solutions using invertible mappings, where both stable and unstable transforms are equally valid for the given objective. See Appendix F for a motivation based on a simple 2D toy example.
|
| 212 |
+
|
| 213 |
+
In summary, the decorrelation objective offers an environment to study which INN components steer the mapping towards stable or unstable solutions, that are equally plausible for the given task.
|
| 214 |
+
|
| 215 |
+
In our experiments shown in Figure 5, we focus on coupling-based models like Glow (Kingma & Dhariwal, 2018), which are analytically invertible and thus allow to a simpler analysis compared to models relying on numerical inversion like i-ResNets (Behrmann et al., 2019). We evaluate the effects of different architectural choices on numerical stability, including additive vs. affine coupling layers, ActNorm, and architecture depth. For ActNorm we study two settings: 1) between coupling blocks, 2) inside blocks, i.e. as part of the function $g$ in additive blocks or $s$ and $t$ in affine blocks. Details on the architectures/ training schemes and extended results are provided in Appendix H.
|
| 216 |
+
|
| 217 |
+
3We provide example PyTorch code for the decorrelation objective in Appendix G.
|
| 218 |
+
|
| 219 |
+

|
| 220 |
+
Figure 5: Instability in affine and additive models. On the right, we track the reconstruction errors for a fixed minibatch over the course of training: in each iteration (vertical slice) we plot the errors of each minibatch element. Thus, we can observe the distribution of errors. Orange points in the affine plots denote inf and nan values. c denotes the condition number of the Jacobian, $\sigma _ { m a x }$ and $\sigma _ { m i n }$ denote the maximum and minimum singular values, respectively. At the top, we show the original images $x$ and in each snapshot, the reconstructions ${ \hat { x } } = { \dot { \operatorname { F } } } ^ { - 1 } ( F ( x ) )$ and reconstruction errors $R = | x - { \hat { x } } |$ . Note that the $\mathbf { X } ^ { - }$ and y-axes differ for different settings, as the models become unstable at different points during training.
|
| 221 |
+
|
| 222 |
+
# 5 RELATED WORK
|
| 223 |
+
|
| 224 |
+
Invertibility and stability of deep networks. The inversion from activations in standard neural networks to inputs has been studied in various works, e.g. via optimization in input space (Mahendran & Vedaldi, 2014). Linking invertibility and inverse stability for relu-networks was e.g. done in Behrmann et al. (2018). However, few works study the stability of INNs: Gomez et al. (2017) study the numerical errors in the gradient computation when using their memory-efficient backpropagation variant. Similarly to our empirical analysis, (Jacobsen et al., 2018) computed the SVD of the Jacobian of a trained i-RevNet and observed an ill-conditioned Jacobian. Lastly, the i-ResNet architecture (Behrmann et al., 2019) yields bi-Lipschitz bounds by design.
|
| 225 |
+
|
| 226 |
+
On the other hand, the stability of neural networks has been of major interest due to the problem of exploding and vanishing gradients, and more recently due to adversarial examples (Szegedy et al., 2013) and training of Wasserstein GANs (Arjovsky et al., 2017). See e.g. (Anil et al., 2019) for a promising approach to learn flexible Lipschitz neural networks.
|
| 227 |
+
|
| 228 |
+
Invertible building blocks. Besides the invertible building blocks we studied in Table 1, several other approaches were proposed. Most prominently, autogressive models like MAF (Papamakarios et al., 2017) or IAF (Kingma et al., 2016) provide invertible models that are not studied in our analysis. Furthermore, several newer coupling layers that require numerical inversion have been introduced (Jaini et al., 2019; Durkan et al., 2019). Besides the coupling-based approaches, multiple approaches (Chen et al., 2018; Behrmann et al., 2019; Chen et al., 2019; Song et al., 2019) use numerical inversion schemes, where the interplay of numerical errors due to stability and errors due to the numerical approximation of the inverse adds another dimension to the study of invertibility.
|
| 229 |
+
|
| 230 |
+
Fixed-Point arithmetic and limited precision. Maclaurin et al. (2015); MacKay et al. (2018) implement invertible computation using fixed-point numbers, with specially-designed schemes to store information that is “lost” when bits are shifted due to multiplication/division, enabling exact invertibility at the cost of additional memory usage. As Gomez et al. (2017) point out, this approach allows exact numerical inversion when using additive coupling blocks independent of stability issues. However, our stability analysis aims for a broadly applicable methodology beyond the special case of additive coupling. Lastly, there may be connections to deep learning using limited precision, see e.g. (Gupta et al., 2015), which could provide more insights into our observed numerical errors.
|
| 231 |
+
|
| 232 |
+
# 6 CONCLUSION
|
| 233 |
+
|
| 234 |
+
Numerical instability is an important concern for the practical application of invertible models. If for instance analytical invertibility does not carry through to the numerical computation due to instabilities or numerical errors, the consequences can be arbitrarily severe. As shown in our experiments, this can impact memory-efficient backpropagation (Gomez et al., 2017) and thus significantly reduces the usability of invertible networks if not handled appropriately. Flow-GAN illustrates another application where non-invertibility poses a serious threat, as instabilities can strongly influence or even break likelihood-computation.
|
| 235 |
+
|
| 236 |
+
In this paper, we shed light on the underlying causes of instability by deriving Lipschitz bounds on many of the atomic building blocks commonly used to construct INNs. From a practical standpoint, we used diagnostics to measure stability and provided an empirical framework to benchmark stability. Further, we have shown how to guarantee stability for one of the most common INN architectures. We hope that this will inspire future work to view numerical stability as a crucial axis in the design of new building blocks and architectures for invertible neural networks.
|
| 237 |
+
|
| 238 |
+
# REFERENCES
|
| 239 |
+
|
| 240 |
+
Cem Anil, James Lucas, and Roger Grosse. Sorting out Lipschitz function approximation. International Conference on Machine Learning, 2019.
|
| 241 |
+
|
| 242 |
+
Lynton Ardizzone, Jakob Kruse, Sebastian Wirkert, Daniel Rahner, Eric W Pellegrini, Ralf S Klessen, Lena Maier-Hein, Carsten Rother, and Ullrich Kothe. Analyzing inverse problems with invertible ¨ neural networks. International Conference on Learning Representations, 2019.
|
| 243 |
+
|
| 244 |
+
Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein generative adversarial networks. ´ In International Conference on Machine Learning, 2017.
|
| 245 |
+
|
| 246 |
+
U.M. Ascher. Numerical methods for evolutionary differential equations. Computational Science and Engineering. Society for Industrial and Applied Mathematics, 2008.
|
| 247 |
+
|
| 248 |
+
Jens Behrmann, Soren Dittmer, Pascal Fernsel, and Peter Maaß. Analysis of Invariance and Robust-¨ ness via Invertibility of ReLU-Networks. arXiv preprint arXiv:1806.09730, 2018.
|
| 249 |
+
|
| 250 |
+
Jens Behrmann, Will Grathwohl, Ricky T. Q. Chen, David Duvenaud, and Jorn-Henrik Jacobsen. ¨ Invertible residual networks. International Conference on Machine Learning, 2019.
|
| 251 |
+
|
| 252 |
+
Wieland Brendel, Jonas Rauber, and Matthias Bethge. Decision-based adversarial attacks: Reliable attacks against black-box machine learning models. In International Conference on Learning Representations, 2018.
|
| 253 |
+
|
| 254 |
+
Robin Brugger, Christian F. Baumgartner, and Ender Konukoglu. A partially reversible u-net for ¨ memory-efficient volumetric image segmentation. In Medical Image Computing and Computer Assisted Intervention – MICCAI, 2019.
|
| 255 |
+
|
| 256 |
+
Ricky T. Q. Chen, Yulia Rubanova, Jesse Bettencourt, and David Duvenaud. Neural ordinary differential equations. Advances in Neural Information Processing Systems, 2018.
|
| 257 |
+
|
| 258 |
+
Ricky T. Q. Chen, Jens Behrmann, David Duvenaud, and Jorn-Henrik Jacobsen. Residual flows for ¨ invertible generative modeling. Advances in Neural Information Processing Systems, 2019.
|
| 259 |
+
|
| 260 |
+
Brian Cheung, Jesse A Livezey, Arjun K Bansal, and Bruno A Olshausen. Discovering hidden factors of variation in deep networks. arXiv preprint arXiv:1412.6583, 2014.
|
| 261 |
+
|
| 262 |
+
Michael Cogswell, Faruk Ahmed, Ross Girshick, Larry Zitnick, and Dhruv Batra. Reducing overfitting in deep networks by decorrelating representations. arXiv preprint arXiv:1511.06068, 2015.
|
| 263 |
+
|
| 264 |
+
Ivo Danihelka, Balaji Lakshminarayanan, Benigno Uria, Daan Wierstra, and Peter Dayan. Comparison of maximum likelihood and GAN-based training of real NVPs. arXiv preprint arXiv:1705.05263, 2017.
|
| 265 |
+
|
| 266 |
+
Laurent Dinh, David Krueger, and Yoshua Bengio. NICE: Non-linear independent components estimation. arXiv preprint arXiv:1410.8516, 2014.
|
| 267 |
+
|
| 268 |
+
Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real NVP. International Conference on Learning Representations, 2017.
|
| 269 |
+
|
| 270 |
+
Jeff Donahue and Karen Simonyan. Large scale adversarial representation learning. arXiv preprint arXiv:1907.02544, 2019.
|
| 271 |
+
|
| 272 |
+
Conor Durkan, Artur Bekasov, Ian Murray, and George Papamakarios. Neural spline flows. In Advances in Neural Information Processing Systems, 2019.
|
| 273 |
+
|
| 274 |
+
H. Federer. Geometric measure theory. Grundlehren der mathematischen Wissenschaften. Springer, 1969.
|
| 275 |
+
|
| 276 |
+
Aidan N Gomez, Mengye Ren, Raquel Urtasun, and Roger B Grosse. The reversible residual network: Backpropagation without storing activations. In Advances in Neural Information Processing Systems, pp. 2214–2224, 2017.
|
| 277 |
+
|
| 278 |
+
Henry Gouk, Eibe Frank, Bernhard Pfahringer, and Michael Cree. Regularisation of neural networks by enforcing Lipschitz continuity. arXiv preprint arXiv:1804.04368, 2018.
|
| 279 |
+
|
| 280 |
+
Will Grathwohl, Ricky T. Q. Chen, Jesse Bettencourt, Ilya Sutskever, and David Duvenaud. FFJORD: Free-form continuous dynamics for scalable reversible generative models. International Conference on Learning Representations, 2019.
|
| 281 |
+
|
| 282 |
+
Aditya Grover, Manik Dhar, and Stefano Ermon. Flow-GAN: Combining maximum likelihood and adversarial learning in generative models. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
|
| 283 |
+
|
| 284 |
+
Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved training of Wasserstein GANs. In Advances in Neural Information Processing Systems, 2017.
|
| 285 |
+
|
| 286 |
+
Suyog Gupta, Ankur Agrawal, Kailash Gopalakrishnan, and Pritish Narayanan. Deep learning with limited numerical precision. In International Conference on Machine Learning, 2015.
|
| 287 |
+
|
| 288 |
+
Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. GANs trained by a two time-scale update rule converge to a local nash equilibrium. In Advances in Neural Information Processing Systems, pp. 6626–6637, 2017.
|
| 289 |
+
|
| 290 |
+
Emiel Hoogeboom, Rianne van den Berg, and Max Welling. Emerging convolutions for generative normalizing flows. International Conference on Machine Learning, 2019.
|
| 291 |
+
|
| 292 |
+
Jorn-Henrik Jacobsen, Arnold Smeulders, and Edouard Oyallon. i-RevNet: Deep invertible networks.¨ International Conference on Learning Representations, 2018.
|
| 293 |
+
|
| 294 |
+
Jorn-Henrik Jacobsen, Jens Behrmann, Richard Zemel, and Matthias Bethge. Excessive invariance ¨ causes adversarial vulnerability. International Conference on Learning Representations, 2019.
|
| 295 |
+
|
| 296 |
+
Priyank Jaini, Kira A. Selby, and Yaoliang Yu. Sum-of-squares polynomial flow. In International Conference on Machine Learning, 2019.
|
| 297 |
+
|
| 298 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations, 2015.
|
| 299 |
+
|
| 300 |
+
Durk P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In Advances in Neural Information Processing Systems, pp. 10215–10224, 2018.
|
| 301 |
+
|
| 302 |
+
Durk P Kingma, Tim Salimans, Rafal Jozefowicz, Xi Chen, Ilya Sutskever, and Max Welling. Improved variational inference with inverse autoregressive flow. In Advances in Neural Information Processing Systems, pp. 4743–4751, 2016.
|
| 303 |
+
|
| 304 |
+
Cornelius Lanczos. An iteration method for the solution of the eigenvalue problem of linear differential and integral operators. Journal of Research of the National Bureau of Standards, 45(4), 1950.
|
| 305 |
+
|
| 306 |
+
Daniel Levy, Matthew D Hoffman, and Jascha Sohl-Dickstein. Generalizing Hamiltonian Monte Carlo with neural networks. arXiv preprint arXiv:1711.09268, 2017.
|
| 307 |
+
|
| 308 |
+
Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In International Conference on Computer Vision, 2015.
|
| 309 |
+
|
| 310 |
+
Mario Lucic, Karol Kurach, Marcin Michalski, Sylvain Gelly, and Olivier Bousquet. Are GANs created equal? A large-scale study. In Advances in Neural Information Processing Systems, pp. 700–709, 2018.
|
| 311 |
+
|
| 312 |
+
Matthew MacKay, Paul Vicol, Jimmy Ba, and Roger B Grosse. Reversible recurrent neural networks. In Advances in Neural Information Processing Systems, pp. 9029–9040, 2018.
|
| 313 |
+
|
| 314 |
+
Dougal Maclaurin, David Duvenaud, and Ryan Adams. Gradient-based hyperparameter optimization through reversible learning. In International Conference on Machine Learning, pp. 2113–2122, 2015.
|
| 315 |
+
|
| 316 |
+
Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. International Conference on Learning Representations, 2018.
|
| 317 |
+
|
| 318 |
+
Aravindh Mahendran and Andrea Vedaldi. Understanding deep image representations by inverting them. Conference on Computer Vision and Pattern Recognition, 2014.
|
| 319 |
+
|
| 320 |
+
Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. In International Conference on Learning Representations, 2018.
|
| 321 |
+
|
| 322 |
+
George Papamakarios, Theo Pavlakou, and Iain Murray. Masked autoregressive flow for density estimation. In Advances in Neural Information Processing Systems, pp. 2338–2347, 2017.
|
| 323 |
+
|
| 324 |
+
Danilo Rezende and Shakir Mohamed. Variational inference with normalizing flows. In International Conference on Machine Learning, pp. 1530–1538, 2015.
|
| 325 |
+
|
| 326 |
+
Jiaming Song, Shengjia Zhao, and Stefano Ermon. A-NICE-MC: Adversarial training for MCMC. In Advances in Neural Information Processing Systems, pp. 5140–5150, 2017.
|
| 327 |
+
|
| 328 |
+
Yang Song, Chenlin Meng, and Stefano Ermon. MintNet: Building invertible neural networks with masked convolutions. Advances in Neural Information Processing Systems, 2019.
|
| 329 |
+
|
| 330 |
+
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.
|
| 331 |
+
|
| 332 |
+
Jakub M Tomczak and Max Welling. Improving variational auto-encoders using householder flow. arXiv preprint arXiv:1611.09630, 2016.
|
| 333 |
+
|
| 334 |
+
Aladin Virmaux and Kevin Scaman. Lipschitz regularity of deep neural networks: Analysis and efficient estimation. In Advances in Neural Information Processing Systems, 2018.
|
| 335 |
+
|
| 336 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016.
|
| 337 |
+
|
| 338 |
+
# A DERIVATIONS OF LIPSCHITZ BOUNDS
|
| 339 |
+
|
| 340 |
+
The bounds for invertible ResNets are taken from (Behrmann et al., 2019). For Neural ODEs (Chen et al., 2018), one needs to consider a Lipschitz constant $\operatorname { L i p } ( F )$ that holds for all $t \in [ 0 , T ]$ , i.e.
|
| 341 |
+
|
| 342 |
+
$$
|
| 343 |
+
\| F ( t , x _ { 1 } ) - F ( t , x _ { 2 } ) \| _ { 2 } \leq \mathrm { { L i p } } ( F ) \| x _ { 1 } - x _ { 2 } \| _ { 2 } , \quad \mathrm { f o r ~ a l l } \quad t \in [ 0 , T ] .
|
| 344 |
+
$$
|
| 345 |
+
|
| 346 |
+
Then, the claimed bound is a standard result, see e.g. (Ascher, 2008, Theorem 2.3). Note that the inverse is given by $\begin{array} { r } { \frac { d y ( t ) } { d t } = - F ( y ( t ) , t ) } \end{array}$ , hence the same bound holds.
|
| 347 |
+
|
| 348 |
+
In the subsequent subsections, we derive the bounds for coupling layers.
|
| 349 |
+
|
| 350 |
+
# A.1 DERIVATION OF LIPSCHITZ BOUND FOR ADDITIVE COUPLING LAYERS
|
| 351 |
+
|
| 352 |
+
Consider an additive coupling block defined as
|
| 353 |
+
|
| 354 |
+
$$
|
| 355 |
+
\begin{array} { l } { F ( x ) _ { I _ { 1 } } = x _ { I _ { 1 } } } \\ { F ( x ) _ { I _ { 2 } } = x _ { I _ { 2 } } + g ( x _ { I _ { 1 } } ) , } \end{array}
|
| 356 |
+
$$
|
| 357 |
+
|
| 358 |
+
where $I _ { 1 } , I _ { 2 }$ is a disjoint partition of indices $\{ 1 , . . . , d \}$ of the same cardinality, i.e. $\begin{array} { r } { | I _ { 1 } | = | I _ { 2 } | = \frac { d } { 2 } } \end{array}$ Further, $x _ { I _ { 1 } } , x _ { I _ { 2 } }$ correpsonds to the corresponding dimension of $x \in \mathbb { R } ^ { d }$ and $g : \mathbb { R } ^ { \frac { d } { 2 } } \mathbb { R } ^ { \frac { d } { 2 } }$ . By Lemma 3, it is
|
| 359 |
+
|
| 360 |
+
$$
|
| 361 |
+
\mathrm { L i p } ( F ) = \operatorname* { s u p } _ { x \in \mathbb { R } ^ { d } } \| J _ { F } ( x ) \| _ { 2 } .
|
| 362 |
+
$$
|
| 363 |
+
|
| 364 |
+
Thus, in order to obtain a bound on the Lipschitz constant, it is helpful to look into the structure of the Jacobian. If the partitions $I _ { 1 }$ and $I _ { 2 }$ correspond to the first and last $\textstyle { \frac { d } { 2 } }$ indices, the Jacobian has a lower-block structure with an identity diagonal, i.e.
|
| 365 |
+
|
| 366 |
+
$$
|
| 367 |
+
J _ { F } ( x ) = \binom { I } { J _ { g } ( x ) } \binom { 0 } { I } .
|
| 368 |
+
$$
|
| 369 |
+
|
| 370 |
+
By using this structure, we can derive the following upper bound:
|
| 371 |
+
|
| 372 |
+
$$
|
| 373 |
+
\begin{array} { r l } { \| { \bf { J } } _ { 1 } ( { \bf { J } } _ { 2 } ^ { \mathrm { R } } ) - { \bf { A } } _ { 1 } ( { \bf { J } } _ { 1 } ^ { \mathrm { R } } ) \| ^ { 2 } } & { = } & { \kappa ^ { 2 } \kappa \| \sum _ { i = 1 } ^ { N } [ \kappa ( { \bf { J } } _ { i } ^ { \mathrm { R } } ) \kappa ^ { 2 } ] \| ^ { 2 } } \\ & { = } & { \kappa ^ { 2 } \kappa ^ { 2 } \kappa \| \sum _ { i = 1 } ^ { N } [ \kappa ( { \bf { J } } _ { i } ^ { \mathrm { R } } ) \kappa ^ { 2 } ] \| ^ { 2 } } \\ & { = } & { \kappa ^ { 2 } \kappa ^ { 3 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } } \\ & { = } & { \kappa ^ { 4 } \kappa \| \sum _ { i = 1 } ^ { N } [ \kappa ( { \bf { J } } _ { i } ^ { \mathrm { R } } ) \kappa ^ { 2 } \kappa ^ { 2 } ] \| ^ { 2 } \kappa ^ { 4 } \| \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } } \\ & \quad \times \frac { \kappa ^ { 2 } \kappa ^ { 4 } \kappa ^ { 4 } } 2 \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa ^ { 4 } \kappa \end{array}
|
| 374 |
+
$$
|
| 375 |
+
|
| 376 |
+
Furthermore, the inverse of $F$ can be obtained via the simple algebraic transformation $( y : = F ( x ) )$ )
|
| 377 |
+
|
| 378 |
+
$$
|
| 379 |
+
\begin{array} { l } { { F ^ { - 1 } ( y ) _ { I _ { 1 } } = y _ { I _ { 1 } } } } \\ { { F ^ { - 1 } ( y ) _ { I _ { 2 } } = y _ { I _ { 2 } } - g ( y _ { I _ { 1 } } ) . } } \end{array}
|
| 380 |
+
$$
|
| 381 |
+
|
| 382 |
+
Since the only difference to the forward mapping is the minus sign, the Lipschitz bound for the inverse is the same as for the forward mapping.
|
| 383 |
+
|
| 384 |
+
# A.2 DERIVATION OF LIPSCHITZ BOUND FOR AFFINE COUPLING LAYERS
|
| 385 |
+
|
| 386 |
+
Since the structure of the forward and inverse mapping for affine coupling layers has some differences, we split the derivation of the Lipschitz bounds into two sections. First, we start with the forward mapping and then reuse several steps for the bounds on the inverse mapping.
|
| 387 |
+
|
| 388 |
+
# A.2.1 DERIVATION FOR THE FORWARD MAPPING
|
| 389 |
+
|
| 390 |
+
Consider an affine coupling block defined as
|
| 391 |
+
|
| 392 |
+
$$
|
| 393 |
+
\begin{array} { l } { F ( x ) _ { I _ { 1 } } = x _ { I _ { 1 } } } \\ { F ( x ) _ { I _ { 2 } } = x _ { I _ { 2 } } \odot g ( s ( x _ { I _ { 1 } } ) ) + t ( x _ { I _ { 1 } } ) , } \end{array}
|
| 394 |
+
$$
|
| 395 |
+
|
| 396 |
+
where $g ( \cdot ) \neq 0$ for all $X _ { I _ { 2 } }$ and $I _ { 1 } , I _ { 2 }$ as before. The Jacobian for this operation has the structure
|
| 397 |
+
|
| 398 |
+
$$
|
| 399 |
+
J _ { F } ( x ) = \left( \begin{array} { c c } { { I } } & { { 0 } } \\ { { D _ { I } ( x _ { I _ { 2 } } ) D _ { g ^ { \prime } } ( x _ { I _ { 1 } } ) J _ { s } ( x _ { I _ { 1 } } ) + J _ { t } ( x _ { I _ { 1 } } ) } } & { { D _ { g } ( s ( x _ { I _ { 1 } } ) ) } } \end{array} \right) ,
|
| 400 |
+
$$
|
| 401 |
+
|
| 402 |
+
where $D$ are following diagonal matrices
|
| 403 |
+
|
| 404 |
+
$$
|
| 405 |
+
\begin{array} { r l } & { \quad D _ { I } ( x _ { I _ { 2 } } ) = \mathrm { d i a g } \left( ( x _ { I _ { 2 } } ) _ { 1 } , \ldots , ( x _ { I _ { 2 } } ) _ { | I _ { 2 } | } \right) , } \\ & { \quad D _ { g ^ { \prime } } ( x _ { I _ { 1 } } ) = \mathrm { d i a g } \left( g ^ { \prime } ( s ( x _ { I _ { 2 } } ) _ { 1 } , \ldots , g ^ { \prime } ( s ( x _ { I _ { 2 } } ) _ { | I _ { 2 } | } ) \right) } \\ & { \quad D _ { g } ( s ( x _ { I _ { 1 } } ) ) = \mathrm { d i a g } \left( g ( s ( x _ { I _ { 2 } } ) _ { 1 } , \ldots , g ( s ( x _ { I _ { 2 } } ) _ { | I _ { 2 } | } ) \right) . } \end{array}
|
| 406 |
+
$$
|
| 407 |
+
|
| 408 |
+
Denote
|
| 409 |
+
|
| 410 |
+
$$
|
| 411 |
+
M ( x ) : = D _ { I } ( x _ { I _ { 2 } } ) D _ { g ^ { \prime } } ( x _ { I _ { 1 } } ) J _ { s } ( x _ { I _ { 1 } } ) + J _ { t } ( x _ { I _ { 1 } } ) .
|
| 412 |
+
$$
|
| 413 |
+
|
| 414 |
+
By using an analogous derivation as in equation 6 (up to the inequality sign), we get
|
| 415 |
+
|
| 416 |
+
$$
|
| 417 |
+
\begin{array} { l } { \displaystyle \mathrm { L i p } ( F ) ^ { 2 } \leq \underset { x \in \mathbb R ^ { d } } { \operatorname* { s u p } } \underset { | x ^ { * } | | _ { 2 } = 1 } { \operatorname* { s u p } } \| x _ { I _ { 1 } } ^ { * } \| _ { 2 } ^ { 2 } + \big ( \| D _ { g } ( s ( x _ { I _ { 1 } } ) ) x _ { I _ { 2 } } ^ { * } \| _ { 2 } + \| M ( x ) x _ { I _ { 1 } } ^ { * } \| _ { 2 } \big ) ^ { 2 } } \\ { = \underset { x \in \mathbb R ^ { d } } { \operatorname* { s u p } } \underset { | x | | _ { 1 } } { \operatorname* { m a x } } \big ( 1 , D _ { g } ( s ( x _ { I _ { 1 } } ) _ { i } ) \big ) ^ { 2 } + 2 \underset { i \in [ | I _ { 1 } | ] } { \operatorname* { m a x } } \big ( D _ { g } ( s ( x _ { I _ { 1 } } ) _ { i } ) \big ) \| M ( x ) \| _ { 2 } + \| M ( x ) \| _ { 2 } ^ { 2 } } \\ { \leq \underset { x \in \mathbb R ^ { d } } { \operatorname* { s u p } } \underset { | x | | _ { 1 } } { \operatorname* { m a x } } \big ( 1 , D _ { g } ( s ( x _ { I _ { 1 } } ) _ { i } ) \big ) ^ { 2 } + 2 \underset { i \in [ | I _ { 1 } | ] } { \operatorname* { m a x } } \big ( 1 , D _ { g } ( s ( x _ { I _ { 1 } } ) _ { i } ) \big ) \| M ( x ) \| _ { 2 } + \| M ( x ) \| _ { 2 } ^ { 2 } } \\ { = \underset { x \in \mathbb R ^ { d } } { \operatorname* { s u p } } \bigg ( \underset { i \in [ | I _ { 1 } | ] } { \operatorname* { m a x } } \big ( 1 , D _ { g } ( s ( x _ { I _ { 1 } } ) _ { i } ) \big ) + \| M ( x ) \| _ { 2 } \bigg ) ^ { 2 } } \\ { \Longleftrightarrow \underset { x \in \mathbb R ^ { d } } { \operatorname* { m a x } } \big ( 1 , D _ { g } ( s ( x _ { I _ { 1 } } ) _ { i } ) \big ) + \underset { x \in \mathbb R ^ { d } } { \operatorname* { s u p } } \| M ( x ) \| _ { 2 } . } \end{array}
|
| 418 |
+
$$
|
| 419 |
+
|
| 420 |
+
Next, we will look into the structure of $M ( x )$ to derive a more precise bound. Since inputs $x$ are assumed to be bounded as $x \in [ a , b ] ^ { d }$ , it holds
|
| 421 |
+
|
| 422 |
+
$$
|
| 423 |
+
\| D _ { I } ( x _ { I _ { 2 } } ) \| _ { 2 } \leq \operatorname* { m a x } ( | a | , | b | ) .
|
| 424 |
+
$$
|
| 425 |
+
|
| 426 |
+
Furthermore, let the derivative $g ^ { \prime }$ of the element-wise function $g$ be globally bounded by $c$ , i.e. $\begin{array} { r } { \operatorname* { s u p } _ { x \in \mathbb { R } } g ^ { \prime } ( x ) \leq c _ { g ^ { \prime } } } \end{array}$ . Then, it is
|
| 427 |
+
|
| 428 |
+
$$
|
| 429 |
+
\| D _ { g ^ { \prime } } ( x _ { I _ { 1 } } ) \| _ { 2 } \leq c _ { g ^ { \prime } } .
|
| 430 |
+
$$
|
| 431 |
+
|
| 432 |
+
In a similar manner as in section A.1, the spectral norm of the Jacobian of the scale-function $s$ and translation-function $t$ can be bounded by their Lipschitz constant, i.e.
|
| 433 |
+
|
| 434 |
+
$$
|
| 435 |
+
\begin{array} { r } { \| J _ { s } ( x _ { I _ { 1 } } ) \| _ { 2 } \leq \mathrm { L i p } ( s ) } \\ { \| J _ { t } ( x _ { I _ { 1 } } ) \| _ { 2 } \leq \mathrm { L i p } ( t ) . } \end{array}
|
| 436 |
+
$$
|
| 437 |
+
|
| 438 |
+
By using above bounds, we obtain
|
| 439 |
+
|
| 440 |
+
$$
|
| 441 |
+
\operatorname* { s u p } _ { x \in \mathbb { R } ^ { d } } \| M ( x ) \| _ { 2 } ^ { 2 } \leq \operatorname* { m a x } ( | a | , | b | ) \cdot c \cdot \mathrm { L i p } ( s ) + \mathrm { L i p } ( t ) .
|
| 442 |
+
$$
|
| 443 |
+
|
| 444 |
+
If we further assume, that the elementwise-function $g$ is globally upper bounded by $c _ { g }$ and we insert above bounds, we obtain
|
| 445 |
+
|
| 446 |
+
$$
|
| 447 |
+
\mathrm { L i p } ( F ) \leq \operatorname* { m a x } ( 1 , c _ { g } ) + \operatorname* { m a x } ( | a | , | b | ) \cdot c _ { g ^ { \prime } } \cdot \mathrm { L i p } ( s ) + \mathrm { L i p } ( t ) .
|
| 448 |
+
$$
|
| 449 |
+
|
| 450 |
+
A.2.2 DERIVATION FOR THE INVERSE MAPPING
|
| 451 |
+
|
| 452 |
+
For the affine coupling block from section A.2.1, the inverse is defined as
|
| 453 |
+
|
| 454 |
+
$$
|
| 455 |
+
\begin{array} { r l } & { F ^ { - 1 } ( y ) _ { I _ { 1 } } = y _ { I _ { 1 } } } \\ & { F ^ { - 1 } ( y ) _ { I _ { 2 } } = \left( y _ { I _ { 2 } } - t ( x _ { I _ { 1 } } ) \right) \oslash g ( s ( y _ { I _ { 1 } } ) ) , } \end{array}
|
| 456 |
+
$$
|
| 457 |
+
|
| 458 |
+
where $g ( \cdot ) \neq 0$ for all $X _ { I _ { 2 } } , I _ { 1 } , I _ { 2 }$ as before and $\oslash$ denotes elementwise division. The Jacobian for this operation has the structure
|
| 459 |
+
|
| 460 |
+
$$
|
| 461 |
+
J _ { F } ( x ) = \left( \begin{array} { c c } { { I } } & { { 0 } } \\ { { M ^ { * } ( y ) } } & { { D _ { \frac { 1 } { g } } ( s ( x _ { I _ { 1 } } ) ) } } \end{array} \right) ,
|
| 462 |
+
$$
|
| 463 |
+
|
| 464 |
+
where $D _ { \frac { 1 } { g } } { \left( s \left( x _ { I _ { 1 } } \right) \right) }$ denotes a diagonal matrix, as before. Furthermore, $M *$ is defined as
|
| 465 |
+
|
| 466 |
+
$\begin{array} { r } { { \cal M } ^ { * } ( y ) = D _ { I } ( y _ { I _ { 2 } } ) D _ { \left( { \frac { 1 } { g } } \right) ^ { \prime } } ( s ( y _ { I _ { 1 } } ) ) J _ { s } ( y _ { I _ { 1 } } ) - D _ { \left( { \frac { 1 } { g } } \right) ^ { \prime } } ( s ( y _ { I _ { 1 } } ) ) J _ { s } ( y _ { I _ { 1 } } ) D _ { I } ( t ( y _ { I _ { 1 } } ) ) - D _ { \frac { 1 } { g } } ( s ( y _ { I _ { 1 } } ) ) J _ { t } ( y _ { I _ { 1 } } ) , } \end{array}$ where $D _ { \left( { \frac { 1 } { g } } \right) ^ { \prime } } ( s ( x _ { I _ { 1 } } ) )$ also denotes a diagonal matrix. Using analogous arguments as in section A.2.1, we obtain the bound
|
| 467 |
+
|
| 468 |
+
$$
|
| 469 |
+
\mathrm { L i p } ( F ^ { - 1 } ) \leq \operatorname* { m a x } _ { i \in [ | I _ { 1 } | ] } ( 1 , D _ { \frac { 1 } { g } } ( s ( x _ { I _ { 1 } } ) _ { i } ) ) + \operatorname* { s u p } _ { x \in \mathbb { R } ^ { d } } \| M ^ { * } ( x ) \| _ { 2 } .
|
| 470 |
+
$$
|
| 471 |
+
|
| 472 |
+
Hence, we need to further bound the spectral norm of $M ^ { * }$ . First, assume that $\textstyle { \frac { 1 } { g } }$ , the derivative $\scriptstyle \left( { \frac { 1 } { g } } \right) ^ { \prime }$ and translation $t$ is globally upper bounded by $c _ { \frac { 1 } { g } } , c _ { \left( \frac { 1 } { g } \right) ^ { \prime } }$ and $c _ { t }$ respectively. Furthermore consider bounded inputs $y \in [ a ^ { * } , b ^ { * } ] ^ { d }$ . Then we obtain the bound
|
| 473 |
+
|
| 474 |
+
$$
|
| 475 |
+
\operatorname* { s u p } _ { x \in \mathbb { R } ^ { d } } \| M ^ { * } ( x ) \| _ { 2 } ^ { 2 } \leq \operatorname* { m a x } ( | a ^ { * } | , | b ^ { * } | ) \cdot c _ { \binom { 1 } { g } } \cdot \operatorname { L i p } ( s ) + c _ { \binom { 1 } { g } } \cdot \operatorname { L i p } ( s ) \cdot c _ { t } + c _ { \frac { 1 } { g } } \cdot \operatorname { L i p } ( t ) .
|
| 476 |
+
$$
|
| 477 |
+
|
| 478 |
+
Hence, we can bound the Lipschitz constant of the inverse of an affine block as
|
| 479 |
+
|
| 480 |
+
$$
|
| 481 |
+
\mathrm { L i p } ( F ^ { - 1 } ) \leq \operatorname* { m a x } _ { i \in [ [ I _ { 1 } ] ] } ( 1 , c _ { \frac { 1 } { g } } ) + \operatorname* { m a x } ( | a ^ { * } | , | b ^ { * } | ) \cdot c _ { ( \frac { 1 } { g } ) ^ { \prime } } \cdot \mathrm { L i p } ( s ) + c _ { ( \frac { 1 } { g } ) ^ { \prime } } \cdot \mathrm { L i p } ( s ) \cdot c _ { t } + c _ { \frac { 1 } { g } } \cdot \mathrm { L i p } ( t ) .
|
| 482 |
+
$$
|
| 483 |
+
|
| 484 |
+
# B NUMERICAL ERRORS AND LIPSCHITZ CONSTANTS
|
| 485 |
+
|
| 486 |
+
In a general setting, connecting numerical errors e.g. due to floating point operations to Lipschitz constants of the underlying mapping in a quantitative manner is not straightforward. For example, numerical errors due to limited precision occurs when summing to floating point numbers. As discussed in (Gomez et al., 2017), this occurs in additive coupling layers and is one source of numerical errors we observe in our experiments.
|
| 487 |
+
|
| 488 |
+
To formalize the connection to the Lipschitz constant, consider the following two mappings:
|
| 489 |
+
|
| 490 |
+
$$
|
| 491 |
+
\begin{array} { r l } & { F ( x ) = z , \quad \mathrm { ( a n a l y t i c a l \ e x a c t { c o m p u t a t i o n } ) } } \\ & { F _ { \delta } ( x ) = z + \delta = : z _ { \delta } , \quad \mathrm { ( f l o a t i n g \ p o i n t i n e x a c t { c o m p u t a t i o n } ) } } \end{array}
|
| 492 |
+
$$
|
| 493 |
+
|
| 494 |
+
In order to bound the error in the reconstruction due to the imprecision in the forward mapping, let $x _ { \delta _ { 1 } } = F ^ { - 1 } ( z _ { \delta } )$ . Now consider
|
| 495 |
+
|
| 496 |
+
$$
|
| 497 |
+
\| x - x _ { \delta _ { 1 } } \| _ { 2 } \le \mathrm { L i p } ( F ^ { - 1 } ) \| z - z _ { \delta } \| _ { 2 } = \mathrm { L i p } ( F ^ { - 1 } ) \| \delta \| _ { 2 } ,
|
| 498 |
+
$$
|
| 499 |
+
|
| 500 |
+
where the Lipschitz constant of the inverse is used to bound the influence of the numerical error in the forward mapping. However, similarly to the forward mapping, the inverse mapping can also be imprecise. Thus, we introduce
|
| 501 |
+
|
| 502 |
+
$$
|
| 503 |
+
F _ { \delta } ^ { - 1 } ( z _ { \delta } ) = x _ { \delta _ { 1 } } + \delta _ { 2 } : = x _ { \delta _ { 2 } }
|
| 504 |
+
$$
|
| 505 |
+
|
| 506 |
+
to formalize the numerical error in the inverse mapping. Hence, we obtain the bound
|
| 507 |
+
|
| 508 |
+
$$
|
| 509 |
+
\begin{array} { r l } & { \| \boldsymbol { x } - ( x _ { \delta _ { 1 } } + \delta _ { 2 } ) \| _ { 2 } \leq \| \boldsymbol { x } - x _ { \delta _ { 1 } } \| _ { 2 } + \| \delta _ { 2 } \| _ { 2 } } \\ & { \qquad \leq \mathrm { L i p } ( \boldsymbol { F } ^ { - 1 } ) \| \boldsymbol { z } - \boldsymbol { z } _ { \delta } \| _ { 2 } + \| \delta _ { 2 } \| _ { 2 } } \\ & { \qquad = \mathrm { L i p } ( \boldsymbol { F } ^ { - 1 } ) \| \delta \| _ { 2 } + \| \delta _ { 2 } \| _ { 2 } , } \end{array}
|
| 510 |
+
$$
|
| 511 |
+
|
| 512 |
+
where the numerical errors of the mapping are denoted via $\delta$ (forward) and $\delta _ { 2 }$ (inverse). While obtaining quantitative values for $\delta$ and $\delta _ { 2 }$ for a model as complex as deep neural networks is hard, above formalization still provides insights into a potential role of the inverse stability when reconstructing inputs.
|
| 513 |
+
|
| 514 |
+
# C ADDITIONAL DETAILS FOR CLASSIFICATION EXPERIMENTS
|
| 515 |
+
|
| 516 |
+
Both affine and additive coupling-based models have the same architecture, that consists of 3 levels, 16 blocks per level, and 128 hidden channels. Each level consists of a sequence of residual blocks that operate on the same dimensionality. Between levels, the input is spatially downsampled by $2 \times$ in both width and height, while the number of channels is increased by $4 \times$ . Each residual block consists of a chain of $3 \times 3$ , $1 \times 1$ , $3 \times 3$ convolutions, with ReLU activations in between. We trained on CIFAR-10 for 200 epochs, using SGD with Nesterov momentum 0.9 and weight decay 5e-4, with initial learning rate 0.01, decayed by a factor of 5 at epochs 60, 120, and 160. We found that using a smaller initial learning rate of 0.01 was important for training the INN classifier, as opposed to the standard initial learning rate of 0.1 used for ResNets (Zagoruyko & Komodakis, 2016). We used standard data augmentation (random cropping and horizontal flipping).
|
| 517 |
+
|
| 518 |
+

|
| 519 |
+
Figure 6: Test classification accuracy on CIFAR-10.
|
| 520 |
+
|
| 521 |
+
# D EXPERIMENTAL DETAILS FOR FLOW-GAN
|
| 522 |
+
|
| 523 |
+
For the experiments in Section 4.3, the ADV models are trained with standard binary cross entropy loss and the hyperparameters in Table 4, whereas the MLE models are trained with learning rate 1e-3.
|
| 524 |
+
Table 4: Hyperparameters for ADV models
|
| 525 |
+
|
| 526 |
+
<table><tr><td>Variable</td><td>Values</td></tr><tr><td>batch size</td><td>64</td></tr><tr><td>learning rate (generator)</td><td>1e-5</td></tr><tr><td>learning rate (discriminator)</td><td>1e-4</td></tr><tr><td>weight decay (both)</td><td>0</td></tr><tr><td>optimizer</td><td>Adam(0.5, 0.99)</td></tr></table>
|
| 527 |
+
|
| 528 |
+
# E EXTENDED RESULTS FOR CRAFTED, NON-INVERTIBLE INPUTS
|
| 529 |
+
|
| 530 |
+
PGD Setup. To find non-invertible inputs for Glow and Residual Flows, we used PGD (Eq. 3) with $\epsilon = 0 . 1$ and step size 0.01. For the Glow model in Section 4.2, we consistently found inputs with severe reconstruction errors (as shown in Figure 3) in fewer than 10 PGD iterations. For the Residual Flow model analyzed in this section, we ran 200 iterations of PGD. In each iteration, the pixel values of the perturbed image were clipped to the valid input range that the respective model was trained on $( [ - 0 . 5 , 0 . 5 ]$ for Glow and [0, 1] for the Residual Flow).
|
| 531 |
+
|
| 532 |
+
Crafted Inputs for Residual Flows. We also applied the PGD attack from Section 4.2 to a Residual Flow (Chen et al., 2019) pre-trained on CIFAR-10 (Figure 7).4 We find that, while there are visible differences between the crafted input $x ^ { \prime }$ and its reconstruction $\hat { x } ^ { \prime }$ , the reconstruction errors are less severe for the Residual Flow compared to Glow (analyzed in Section 4.2).
|
| 533 |
+
|
| 534 |
+

|
| 535 |
+
Figure 7: Crafting non-invertible inputs for a CIFAR-10 Residual Flow model.
|
| 536 |
+
|
| 537 |
+
Instability Outside the Range of Training Inputs. Here, we applied the PGD attack from Section 4.2 to a Glow model pre-trained on Celeb-A (Liu et al., 2015). 5 This model was trained on images normalized to the range $[ - 0 . 5 , 0 . 5 ]$ . While the PGD attack was not successful at finding adversarial inputs in $[ - 0 . 5 , 0 . 5 ]$ , it succeeded when the range was increased to $[ - 0 . 7 , 0 . 7 ]$ (by using $\epsilon = 0 . 2$ and not clipping the perturbed inputs to $[ - 0 . 5 , 0 . 5 ] )$ , yielding the example shown in Figure 8. Thus, we found that invertible models can become numerically non-invertible on out-of-distribution data.
|
| 538 |
+
|
| 539 |
+

|
| 540 |
+
Figure 8: Glow becomes non-invertible for inputs outside the training distribution. We use a SOTA Glow model trained on images normalized to $[ - 0 . 5 , 0 . 5 ]$ , and use PGD to find an adversarial input constrained to the larger range $[ - 0 . 7 , 0 . 7 ]$ . This attack succeeds in finding examples that induce dramatic reconstruction error.
|
| 541 |
+
|
| 542 |
+

|
| 543 |
+
Figure 9: Toy example to motivate the decorrelation task. Left: standard normal data, 2. left: scaled by $D$ and rotated data by $R$ , 2. right: scaling and rotation backwards, low correlation but higher condition number, right: rotation backwards, low correlation and low condition number.
|
| 544 |
+
|
| 545 |
+
To motivate the decorrelation task as simple toy environment for stability of invertible models consider the following task (and its visualization in Figure 9):
|
| 546 |
+
|
| 547 |
+
• Consider input data $x$ that is distributed via a standard normal distribution, i.e. $x \sim \mathcal { N } ( 0 , I )$ (Figure 9 (left)).
|
| 548 |
+
• Assume the data is transformed by a rotation matrix $R$ and a diagonal matrix $D$ , i.e. $y = R D x$ (Figure 9 (2. from left)).
|
| 549 |
+
• Goal: decorrelate transformed data $y$ using an invertible mapping.
|
| 550 |
+
|
| 551 |
+
Since correlation is independent of scale (scaling by standard deviation of the data), at least the two solutions $A _ { 2 } = D ^ { - 1 } R ^ { T }$ (Figure 9 (2. from right)) and $A _ { 1 } = R ^ { T }$ (Figure 9 (right)) are equally valid for the given decorrelation task. However, the conditioning of the mappings $A _ { 1 }$ and $A _ { 2 }$ can be largely different if the scaling matrix $D$ has a high condition number. Hence, this task both offers a stable solution, namely $A _ { 1 }$ , and a (potentially) unstable solution $A _ { 2 }$ .
|
| 552 |
+
|
| 553 |
+
To conclude, decorrelation can allow multiple solutions with different stability. Hence, decorrelation is a natural simple task to study which solution the INN picks. Furthermore, guiding the network to a stable solution is a justified strategy for this task and it is not expected to harm performance.
|
| 554 |
+
|
| 555 |
+
# G DECORRELATION EXAMPLE CODE
|
| 556 |
+
|
| 557 |
+
Here we provide an example implementation of the decorrelation objective used in Section 4.4, that minimizes the norm of the off-diagonal entries in the correlation matrix.
|
| 558 |
+
|
| 559 |
+
Listing 1: Example PyTorch code to implement the decorrelation loss used in our experiments.
|
| 560 |
+
|
| 561 |
+
<table><tr><td>z = model(img)</td><td></td><td></td><td></td><td></td></tr><tr><td></td><td>z_flat = z.view(z.size(O),-1)</td><td></td><td></td><td></td></tr><tr><td></td><td>z_flat = z_flat - z_flat.mean(dim=0)</td><td></td><td> Subtract mean</td><td></td></tr><tr><td></td><td></td><td>z_flat = z_flat / (z_flat.std(dim=O) + le-8) # Standardize</td><td></td><td></td></tr><tr><td></td><td>correlation = (torch.mm(z_flat.t(),z_flat)/ (z_flat.size(0)-1))</td><td></td><td></td><td></td></tr><tr><td></td><td>loss = torch.norm(correlation - torch.diag(torch.diagonal(correlation)))</td><td></td><td></td><td></td></tr><tr><td></td><td>optimizer.zero_grad()</td><td></td><td></td><td></td></tr><tr><td>loss.backward() optimizer.step()</td><td></td><td></td><td></td><td></td></tr></table>
|
| 562 |
+
|
| 563 |
+
# H EXTENDED RESULTS FOR DECORRELATION
|
| 564 |
+
|
| 565 |
+
Decorrelation Experiment Details Here we provide additional details on the model architectures and training schemes we used in our numerical experiments.
|
| 566 |
+
|
| 567 |
+
For all the decorrelation experiments, we used a 3-level model with blocks of depth 16. We used Adam (Kingma & Ba, 2015) with fixed learning rate 1e-4 and no weight decay, and trained on mini-batches of size 64. The CIFAR-10 images were normalized to the range [-0.5, 0.5], and were dequantized with uniform noise in [0, 1e-6].
|
| 568 |
+
|
| 569 |
+
Effect of Model Depth. Furthermore, we investigated the effect of network depth on stability since its an additional influence factor besides the selection of each invertible building block. Starting with a 3-level additive model with ActNorm, we vary the depth of the blocks between $\{ 4 , 1 6 , 3 2 \}$ and train with the decorrelation objective. The quantitative reconstruction errors and condition numbers of the Jacobians are shown in Figure 10. As expected, deeper architectures become unstable faster than shallow ones.
|
| 570 |
+
|
| 571 |
+

|
| 572 |
+
Figure 10: Comparing stability of additive flows of different depths. These models all have ActNorm both between and inside the additive blocks.
|
| 573 |
+
|
| 574 |
+
Loss Plots. Here we show that all the model variants investigated in the decorrelation experiments achieve their objective, i.e., the loss decreased enough for the correlation matrices to be diagonal.
|
| 575 |
+
|
| 576 |
+
Evolution of Condition Numbers, Max & Min Singular Values for Decorrelation. Here we plot the condition numbers, maximum and minimum singular values during training for the decorrelation task. We include plots for all settings discussed in the main paper as well as the appendix.
|
| 577 |
+
|
| 578 |
+

|
| 579 |
+
Figure 11: Additional settings for additive coupling, where: 1) ActNorm was applied only between blocks; and 2) ActNorm was applied only inside blocks. Both models become unstable and exhibit severe reconstruction artifacts.
|
| 580 |
+
|
| 581 |
+

|
| 582 |
+
Figure 12: Additional setting for affine coupling, where ActNorm was applied only between blocks. Similarly to the other affine settings described in Section 4.4, this model becomes highly unstable rapidly during training.
|
| 583 |
+
|
| 584 |
+

|
| 585 |
+
Figure 13: Decorrelation loss plots. These plots track the norm of the off-diagonal entries in the correlation matrix while training with the decorrelation objective.
|
| 586 |
+
|
| 587 |
+

|
| 588 |
+
Figure 14: Additive: ActNorm Between Blocks
|
| 589 |
+
|
| 590 |
+

|
| 591 |
+
Figure 15: Additive: ActNorm Both Inside and Between Blocks
|
| 592 |
+
|
| 593 |
+

|
| 594 |
+
Figure 16: Additive: ActNorm Inside Blocks
|
| 595 |
+
|
| 596 |
+

|
| 597 |
+
Figure 17: Additive: No ActNorm
|
| 598 |
+
|
| 599 |
+

|
| 600 |
+
Figure 18: Affine: No ActNorm
|
| 601 |
+
|
| 602 |
+

|
| 603 |
+
Figure 19: Affine: ActNorm Both Inside and Between Blocks
|
| 604 |
+
|
| 605 |
+

|
| 606 |
+
Figure 20: Affine: ActNorm Between Blocks
|
| 607 |
+
|
| 608 |
+
# I REFITTING PRIOR IN FLOW-GAN
|
| 609 |
+
|
| 610 |
+
In general, if the model is not optimized with forward KL, $D _ { K L } ( P _ { \mathrm { d a t a } } | | P _ { \theta } )$ , as in the case when optimizing with maximum likelihood, we cannot be sure ${ \cal F } ( x ) , \quad x \sim P _ { \mathrm { d a t a } }$ is best fitted with a standard Normal. Hence, a reasonable strategy, without changing anything in the learned network, is to refit the prior parameters. Here we simply optimize for maximum likelihood (as typically done for flow models) while only fitting a diagonal variance in prior. This can be interpreted as increasing the entropy of our model. In Kingma & Dhariwal (2018), they observed the opposite phenomenon that a model trained with maximum likelihood generates better samples after decreasing the entropy in the prior. See Figure 21 for samples after refitting the prior.
|
| 611 |
+
|
| 612 |
+

|
| 613 |
+
Figure 21: The row number corresponds to the number of epochs after refitting the prior variance. The unstable model fails to generate samples (i.e., outside of valid pixel values) after the prior is refitted, whereas even though the stable model degrades in sample quality, it is able to generate valid images.
|
md/train/BJlZ5ySKPH/BJlZ5ySKPH.md
ADDED
|
@@ -0,0 +1,305 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# U-GAT-IT: UNSUPERVISED GENERATIVE ATTENTIONAL NETWORKS WITH ADAPTIVE LAYERINSTANCE NORMALIZATION FOR IMAGE-TO-IMAGE TRANSLATION
|
| 2 |
+
|
| 3 |
+
Junho $\mathbf { K i m } ^ { 1 , 2 }$ ∗, Minjae $\mathbf { K i m ^ { 2 } }$ , Hyeonwoo $\mathbf { K a n g ^ { 2 } }$ , Kwang Hee Lee3† 1Clova AI Research, NAVER Corp, 2NCSOFT, 3Boeing Korea Engineering and Technology Center jhkim.ai@navercorp.com, {minjaekim, hwkang0131}@ncsoft.com, kwanghee.lee2@boeing.com
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We propose a novel method for unsupervised image-to-image translation, which incorporates a new attention module and a new learnable normalization function in an end-to-end manner. The attention module guides our model to focus on more important regions distinguishing between source and target domains based on the attention map obtained by the auxiliary classifier. Unlike previous attention-based method which cannot handle the geometric changes between domains, our model can translate both images requiring holistic changes and images requiring large shape changes. Moreover, our new AdaLIN (Adaptive Layer-Instance Normalization) function helps our attention-guided model to flexibly control the amount of change in shape and texture by learned parameters depending on datasets. Experimental results show the superiority of the proposed method compared to the existing state-of-the-art models with a fixed network architecture and hyper-parameters. Our code and datasets are available at https://github.com/taki0112/UGATIT or https://github.com/znxlwm/UGATITpytorch.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Image-to-image translation aims to learn a function that maps images within two different domains. This topic has gained a lot of attention from researchers in the fields of machine learning and computer vision because of its wide range of applications including image inpainting (Pathak et al. (2014); Iizuka et al. (2017)), super resolution (Dong et al. (2016); Kim et al. (2016)), colorization (Zhang et al. (2016; 2017)) and style transfer (Gatys et al. (2016); Huang & Belongie (2017)). When paired samples are given, the mapping model can be trained in a supervised manner using a conditional generative model (Isola et al. (2017); Li et al. (2017a); Wang et al. (2018)) or a simple regression model (Larsson et al. (2016); Long et al. (2015); Zhang et al. (2016)). In unsupervised settings where no paired data is available, multiple works (Anoosheh et al. (2018); Choi et al. (2018); Huang et al. (2018); Kim et al. (2017); Liu et al. (2017); Royer et al. (2017); Taigman et al. (2017); Yi et al. (2017); Zhu et al. (2017)) successfully have translated images using shared latent space (Liu et al. (2017)) and cycle consistency assumptions (Kim et al. (2017); Zhu et al. (2017)). These works have been further developed to handle the multi-modality of the task (Huang et al. (2018)).
|
| 12 |
+
|
| 13 |
+
Despite these advances, previous methods show performance differences depending on the amount of change in both shape and texture between domains. For example, they are successful for the style transfer tasks mapping local texture (e.g., photo2vangogh and photo2portrait) but are typically unsuccessful for image translation tasks with larger shape change (e.g., selfie2anime and cat2dog) in wild images. Therefore, the pre-processing steps such as image cropping and alignment are often required to avoid these problems by limiting the complexity of the data distributions (Huang et al. (2018); Liu et al. (2017)). In addition, existing methods such as DRIT (Lee et al. (2018)) cannot acquire the desired results for both image translation preserving the shape (e.g., horse2zebra) and image translation changing the shape (e.g., cat2dog) with the fixed network architecture and hyperparameters. The network structure or hyper-parameter setting needs to be adjusted for the specific dataset.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: The model architecture of U-GAT-IT. The detailed notations are described in Section Model
|
| 17 |
+
|
| 18 |
+
In this work, we propose a novel method for unsupervised image-to-image translation, which incorporates a new attention module and a new learnable normalization function in an end-to-end manner. Our model guides the translation to focus on more important regions and ignore minor regions by distinguishing between source and target domains based on the attention map obtained by the auxiliary classifier. These attention maps are embedded into the generator and discriminator to focus on semantically important areas, thus facilitating the shape transformation. While the attention map in the generator induces the focus on areas that specifically distinguish between the two domains, the attention map in the discriminator helps fine-tuning by focusing on the difference between real image and fake image in target domain. In addition to the attentional mechanism, we have found that the choice of the normalization function has a significant impact on the quality of the transformed results for various datasets with different amounts of change in shape and texture. Inspired by Batch-Instance Normalization(BIN) (Nam & Kim (2018)), we propose Adaptive LayerInstance Normalization (AdaLIN), whose parameters are learned from datasets during training time by adaptively selecting a proper ratio between Instance normalization (IN) and Layer Normalization (LN). The AdaLIN function helps our attention-guided model to flexibly control the amount of change in shape and texture. As a result, our model, without modifying the model architecture or the hyper-parameters, can perform image translation tasks not only requiring holistic changes but also requiring large shape changes. In the experiments, we show the superiority of the proposed method compared to the existing state-of-the-art models on not only style transfer but also object transfiguration. The main contribution of the proposed work can be summarized as follows:
|
| 19 |
+
|
| 20 |
+
• We propose a novel method for unsupervised image-to-image translation with a new attention module and a new normalization function, AdaLIN.
|
| 21 |
+
• Our attention module helps the model to know where to transform intensively by distinguishing between source and target domains based on the attention map obtained by the auxiliary classifier.
|
| 22 |
+
• AdaLIN function helps our attention-guided model to flexibly control the amount of change in shape and texture without modifying the model architecture or the hyper-parameters.
|
| 23 |
+
|
| 24 |
+
# 2 UNSUPERVISED GENERATIVE ATTENTIONAL NETWORKS WITH ADAPTIVE LAYER-INSTANCE NORMALIZATION
|
| 25 |
+
|
| 26 |
+
Our goal is to train a function $G _ { s t }$ that maps images from a source domain $X _ { s }$ to a target domain $X _ { t }$ using only unpaired samples drawn from each domain. Our framework consists of two generators $G _ { s t }$ and $G _ { t s }$ and two discriminators $D _ { s }$ and $D _ { t }$ . We integrate the attention module into both generator and discriminator. The attention module in the discriminator guides the generator to focus on regions that are critical to generate a realistic image. The attention module in the generator gives attention to the region distinguished from the other domain. Here, we only explain $G _ { s t }$ and $D _ { t }$ (See Fig 1) as the vice versa should be straight-forward.
|
| 27 |
+
|
| 28 |
+
# 2.1 MODEL
|
| 29 |
+
|
| 30 |
+
# 2.1.1 GENERATOR
|
| 31 |
+
|
| 32 |
+
Let $x \in \{ X _ { s } , X _ { t } \}$ represent a sample from the source and the target domain. Our translation model $G _ { s t }$ consists of an encoder $E _ { s }$ , a decoder $G _ { t }$ , and an auxiliary classifier $\eta _ { s }$ , where $\eta _ { s } ( x )$ represents the probability that $x$ comes from $X _ { s }$ . Let $E _ { s } ^ { k } ( x )$ be the $k$ -th activation map of the encoder and $E _ { s } ^ { k _ { i j } } ( x )$ be the value at $( i , j )$ . Inspired by CAM (Zhou et al. (2016)), the auxiliary classifier is trained to learn the weight of the $k$ -th feature map for the source domain, $w _ { s } ^ { k }$ , by using the global average pooling and global max pooling, i.e., $\eta _ { s } ( x ) = \sigma ( \Sigma _ { k } w _ { s } ^ { k } \Sigma _ { i j } E _ { s } ^ { k _ { i j } } ( x ) )$ . By exploiting $w _ { s } ^ { k }$ , we can calculate a set of domain specific attention feature map $a _ { s } ( x ) = w _ { s } * E _ { s } ( x ) = \{ w _ { s } ^ { k } *$ $E _ { s } ^ { k } ( x ) | 1 { \leq } k { \leq } n \}$ , where $n$ is the number of encoded feature maps. Then, our translation model $G _ { s t }$ becomes equal to $G _ { t } ( \boldsymbol { a } _ { s } ( \boldsymbol { x } ) )$ . Inspired by recent works that use affine transformation parameters in normalization layers and combine normalization functions (Huang & Belongie (2017); Nam & Kim (2018)), we equip the residual blocks with AdaLIN whose parameters, $\gamma$ and $\beta$ are dynamically computed by a fully connected layer from the attention map.
|
| 33 |
+
|
| 34 |
+
$$
|
| 35 |
+
\begin{array} { c } { { A d a L I N ( a , \gamma , \beta ) = \gamma \cdot ( \rho \cdot \hat { a _ { I } } + ( 1 - \rho ) \cdot \hat { a _ { L } } ) + \beta , } } \\ { { \hat { a _ { I } } = \displaystyle \frac { a - \mu _ { I } } { \sqrt { \sigma _ { I } ^ { 2 } + \epsilon } } , \hat { a _ { L } } = \displaystyle \frac { a - \mu _ { L } } { \sqrt { \sigma _ { L } ^ { 2 } + \epsilon } } , } } \\ { { \rho c l i p _ { [ 0 , 1 ] } ( \rho - \tau \Delta \rho ) } } \end{array}
|
| 36 |
+
$$
|
| 37 |
+
|
| 38 |
+
where $\mu _ { I } , \mu _ { L }$ and $\sigma _ { I } , \sigma _ { L }$ are channel-wise, layer-wise mean and standard deviation respectively, $\gamma$ and $\beta$ are parameters generated by the fully connected layer, $\tau$ is the learning rate and $\Delta \rho$ indicates the parameter update vector (e.g., the gradient) determined by the optimizer. The values of $\rho$ are constrained to the range of [0, 1] simply by imposing bounds at the parameter update step. Generator adjusts the value so that the value of $\rho$ is close to 1 in the task where the instance normalization is important and the value of $\rho$ is close to 0 in the task where the LN is important. The value of $\rho$ is initialized to 1 in the residual blocks of the decoder and 0 in the up-sampling blocks of the decoder.
|
| 39 |
+
|
| 40 |
+
An optimal method to transfer the content features onto the style features is to apply Whitening and Coloring Transform (WCT) (Li et al. (2017b)), but the computational cost is high due to the calculation of the covariance matrix and matrix inverse. Although, the AdaIN (Huang & Belongie (2017)) is much faster than the WCT, it is sub-optimal to WCT as it assumes uncorrelation between feature channels. Thus the transferred features contain slightly more patterns of the content. On the other hand, the LN (Ba et al. (2016)) does not assume uncorrelation between channels, but sometimes it does not keep the content structure of the original domain well because it considers global statistics only for the feature maps. To overcome this, our proposed normalization technique AdaLIN combines the advantages of AdaIN and LN by selectively keeping or changing the content information, which helps to solve a wide range of image-to-image translation problems.
|
| 41 |
+
|
| 42 |
+
# 2.1.2 DISCRIMINATOR
|
| 43 |
+
|
| 44 |
+
Let $x \in \{ X _ { t } , G _ { s t } ( X _ { s } ) \}$ represent a sample from the target domain and the translated source domain. Similar to other translation models, the discriminator $D _ { t }$ which is a multi-scale model consists of an encoder $E _ { D _ { t } }$ , a classifier $\mathrm { C } _ { D _ { t } }$ , and an auxiliary classifier $\eta _ { D _ { t } }$ . Unlike the other translation models, both $\eta _ { D _ { t } } ( x )$ and $D _ { t } ( x )$ are trained to discriminate whether $x$ comes from $X _ { t }$ or $G _ { s \to t } ( X _ { s } )$ . Given a sample $x$ , $D _ { t } ( x )$ exploits the attention feature maps $a _ { D _ { t } } ( x ) = w _ { D _ { t } } * E _ { D _ { t } } ( x )$ using $w _ { D _ { t } }$ on the encoded feature maps $E _ { D _ { t } } ( x )$ that is trained by $\eta _ { D _ { t } } ( x )$ . Then, our discriminator $D _ { t } ( x )$ becomes equal to $C _ { D _ { t } } ( a _ { D _ { t } } ( x ) )$ .
|
| 45 |
+
|
| 46 |
+
# 2.2 LOSS FUNCTION
|
| 47 |
+
|
| 48 |
+
The full objective of our model comprises four loss functions. Here, instead of using the vanilla GAN objective, we used the Least Squares GAN (Mao et al. (2017)) objective for stable training.
|
| 49 |
+
|
| 50 |
+
Adversarial loss An adversarial loss is employed to match the distribution of the translated images to the target image distribution:
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
L _ { l s g a n } ^ { s t } = ( \mathbb { E } _ { x \sim X _ { t } } [ ( D _ { t } ( x ) ) ^ { 2 } ] + \mathbb { E } _ { x \sim X _ { s } } [ ( 1 - D _ { t } ( G _ { s t } ( x ) ) ) ^ { 2 } ] ) .
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
Cycle loss To alleviate the mode collapse problem, we apply a cycle consistency constraint to the generator. Given an image $x \in X _ { s }$ , after the sequential translations of $x$ from $X _ { s }$ to $X _ { t }$ and from $X _ { t }$ to $X _ { s }$ , the image should be successfully translated back to the original domain:
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
L _ { c y c l e } ^ { s t } = \mathbb { E } _ { x \sim X _ { s } } [ | x - G _ { t s } ( G _ { s t } ( x ) ) ) | _ { 1 } ] .
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
Identity loss To ensure that the color distributions of input image and output image are similar, we apply an identity consistency constraint to the generator. Given an image $x \in X _ { t }$ , after the translation of $x$ using $G _ { s t }$ , the image should not change.
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
L _ { i d e n t i t y } ^ { s t } = \mathbb { E } _ { x \sim X _ { t } } [ | x - G _ { s t } ( x ) | _ { 1 } ] .
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
CAM loss By exploiting the information from the auxiliary classifiers $\eta _ { s }$ and $\eta _ { D _ { t } }$ , given an image $x \in \{ X _ { s } , \tilde { X _ { t } } \}$ . $G _ { s t }$ and $D _ { t }$ get to know where they need to improve or what makes the most difference between two domains in the current state:
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
L _ { c a m } ^ { s t } = - ( \mathbb { E } _ { x \sim X _ { s } } [ l o g ( \eta _ { s } ( x ) ) ] + \mathbb { E } _ { x \sim X _ { t } } [ l o g ( 1 - \eta _ { s } ( x ) ) ] ) ,
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
L _ { c a m } ^ { D _ { t } } = \mathbb { E } _ { x \sim X _ { t } } [ ( \eta _ { D _ { t } } ( x ) ) ^ { 2 } ] + \mathbb { E } _ { x \sim X _ { s } } [ ( 1 - \eta _ { D _ { t } } ( G _ { s t } ( x ) ) ^ { 2 } ] .
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
Full objective Finally, we jointly train the encoders, decoders, discriminators, and auxiliary classifiers to optimize the final objective:
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\operatorname* { m i n } _ { \substack { G _ { s t } , G _ { t s } , \eta _ { s } , \eta _ { t } D _ { s } , D _ { t } , \eta _ { D _ { s } } , \eta _ { D _ { t } } } } \lambda _ { 1 } L _ { l s g a n } + \lambda _ { 2 } L _ { c y c l e } + \lambda _ { 3 } L _ { i d e n t i t y } + \lambda _ { 4 } L _ { c a m } ,
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
where $\lambda _ { 1 } = 1 , \lambda _ { 2 } = 1 0 , \lambda _ { 3 } = 1 0 , \lambda _ { 4 } = 1 0 0 0$ . Here, ${ \cal L } _ { l s g a n } = { \cal L } _ { l s g a n } ^ { s t } + { \cal L } _ { l s g a n } ^ { t s }$ and the other losses are defined in the similar way $\scriptstyle \sum _ { c y c l e }$ , $L _ { i d e n t i t y }$ , and $L _ { c a m }$ )
|
| 85 |
+
|
| 86 |
+

|
| 87 |
+
Figure 2: Visualization of the attention maps and their effects shown in the ablation experiments: (a) Source images, (b) Attention map of the generator, (c-d) Local and global attention maps of the discriminator, respectively. (e) Our results with CAM, (f) Results without CAM.
|
| 88 |
+
|
| 89 |
+
# 3 EXPERIMENTS
|
| 90 |
+
|
| 91 |
+
# 3.1 BASELINE MODEL
|
| 92 |
+
|
| 93 |
+
We have compared our method with various models including CycleGAN (Zhu et al. (2017)), UNIT (Liu et al. (2017)), MUNIT (Huang et al. (2018)), DRIT (Lee et al. (2018)), AGGAN (Mejjati et al. (2018)), and CartoonGAN (Chen et al. (2018)). All the baseline methods are implemented using the author’s code.
|
| 94 |
+
|
| 95 |
+
# 3.2 DATASET
|
| 96 |
+
|
| 97 |
+
We have evaluated the performance of each method with five unpaired image datasets including four representative image translation datasets and a newly created dataset consisting of real photos and animation artworks, i.e., selfie2anime. All images are resized to $2 5 6 \times 2 5 6$ for training. See Appendix C for each dataset for our experiments.
|
| 98 |
+
|
| 99 |
+
# 3.3 EXPERIMENT RESULTS
|
| 100 |
+
|
| 101 |
+
We first analyze the effects of attention module and AdaLIN in the proposed model. We then compare the performance of our model against the other unsupervised image translation models listed in the previous section. To evaluate, the visual quality of translated images, we have conducted a user study. Users are asked to select the best image among the images generated from five different methods. More examples of the results comparing our model with other models are included in the supplementary materials.
|
| 102 |
+
|
| 103 |
+
# 3.3.1 CAM ANALYSIS
|
| 104 |
+
|
| 105 |
+
First, we conduct an ablation study to confirm the benefit from the attention modules used in both generator and discriminator. As shown in Fig 2 (b), the attention feature map helps the generator to focus on the source image regions that are more discriminative from the target domain, such as eyes and mouth. Meanwhile, we can see the regions where the discriminator concentrates its attention to determine whether the target image is real or fake by visualizing local and global attention maps of the discriminator as shown in Fig 2 (c) and (d), respectively. The generator can fine-tune the area where the discriminator focuses on with those attention maps. Note that we incorporate both global and local attention maps from two discriminators having different size of receptive field. Those maps can help the generator to capture the global structure (e.g., face area and near of eyes) as well as the local regions. With this information some regions are translated with more care. The results with the attention module shown in Fig 2 (e) verify the advantageous effect of exploiting attention feature map in an image translation task. On the other hand, one can see that the eyes are misaligned, or the translation is not done at all in the results without using attention module as shown in Fig 2 (f).
|
| 106 |
+
|
| 107 |
+

|
| 108 |
+
Figure 3: Comparison of the results using each normalization function: (a) Source images, (b) Our results, (c) Results only using IN in decoder with CAM, (d) Results only using LN in decoder with CAM, (e) Results only using AdaIN in decoder with CAM, (f) Results only using GN in decoder with CAM.
|
| 109 |
+
|
| 110 |
+
# 3.3.2 ADALIN ANALYSIS
|
| 111 |
+
|
| 112 |
+
As described in Appendix B, we have applied the AdaLIN only to the decoder of the generator. The role of the residual blocks in the decoder is to embed features, and the role of the up-sampling convolution blocks in the decoder is to generate target domain images from the embedded features. If the learned value of the gate parameter $\rho$ is closer to 1, it means that the corresponding layers rely more on IN than LN. Likewise, if the learned value of $\rho$ is closer to 0, it means that the corresponding layers rely more on LN than IN. As shown in Fig 3 (c), in the case of using only IN in the decoder, the features of the source domain (e.g., earrings and shades around cheekbones) are well preserved due to channel-wise normalized feature statistics used in the residual blocks. However, the amount of translation to target domain style is somewhat insufficient since the global style cannot be captured by IN of the up-sampling convolution blocks. On the other hand, As shown in Fig 3 (d), if we use only LN in the decoder, target domain style can be transferred sufficiently by virtue of layerwise normalized feature statistics used in the up-sampling convolution. But the features of the source domain image are less preserved by using LN in the residual blocks. This analysis of two extreme cases tells us that it is beneficial to rely more on IN than LN in the feature representation layers to preserve semantic characteristics of source domain, and the opposite is true for the upsampling layers that actually generate images from the feature embedding. Therefore, the proposed AdaLIN which adjusts the ratio of IN and LN in the decoder according to source and target domain distributions is more preferable in unsupervised image-to-image translation tasks. Additionally, the Fig 3 (e), (f) are the results of using the AdaIN and Group Normalization (GN) (Wu & He (2018)) respectively, and our methods are showing better results compared to these.
|
| 113 |
+
|
| 114 |
+

|
| 115 |
+
Figure 4: Visual comparisons on the five datasets. From top to bottom: selfie2anime, horse2zebra, cat2dog, photo2portrait, and photo2vangogh. (a)Source images, (b)U-GAT-IT, (c)CycleGAN, (d)UNIT, (e)MUNIT, (f)DRIT, (g)AGGAN
|
| 116 |
+
|
| 117 |
+
Table 1: Kernel Inception Distance $\times 1 0 0 { \pm } \mathrm { s t d } . \times 1 0 0$ for ablation our model. Lower is better. There are some notations; GN: Group Normalization, G CAM: CAM of generator, D CAM: CAM of discriminator
|
| 118 |
+
|
| 119 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>selfie2anime</td><td rowspan=1 colspan=1>anime2selfie</td></tr><tr><td rowspan=1 colspan=1>U-GAT-IT</td><td rowspan=1 colspan=1>11.61 ± 0.57</td><td rowspan=1 colspan=1>11.52 ± 0.57</td></tr><tr><td rowspan=1 colspan=1>U-GAT-IT w/ IN</td><td rowspan=1 colspan=1>13.64±0.76</td><td rowspan=1 colspan=1>13.58 ± 0.8</td></tr><tr><td rowspan=1 colspan=1>U-GAT-IT w/ LN</td><td rowspan=1 colspan=1>12.39±0.61</td><td rowspan=1 colspan=1>13.17 ± 0.8</td></tr><tr><td rowspan=1 colspan=1>U-GAT-IT w/ AdaIN</td><td rowspan=1 colspan=1>12.29士0.78</td><td rowspan=1 colspan=1>11.81 ± 0.77</td></tr><tr><td rowspan=1 colspan=1>U-GAT-IT w/ GN</td><td rowspan=1 colspan=1>12.76士0.64</td><td rowspan=1 colspan=1>12.30 ± 0.77</td></tr><tr><td rowspan=1 colspan=1>U-GAT-IT w/oCAM</td><td rowspan=1 colspan=1>12.85士0.82</td><td rowspan=1 colspan=1>14.06 ± 0.75</td></tr><tr><td rowspan=1 colspan=1>U-GAT-ITw/oG_CAM</td><td rowspan=1 colspan=1>12.33士0.68</td><td rowspan=1 colspan=1>13.86 ± 0.75</td></tr><tr><td rowspan=1 colspan=1>U-GAT-ITw/oD_CAM</td><td rowspan=1 colspan=1>12.49±0.74</td><td rowspan=1 colspan=1>13.33 ± 0.89</td></tr></table>
|
| 120 |
+
|
| 121 |
+
Also, as shown in Table 1, we demonstrate the performance of the attention module and AdaLIN in the selfie2anime dataset through an ablation study using Kernel Inception Distance (KID) (Binkowski et al. (2018)) ´ . Our model achieves the lowest KID values. Even if the attention module and AdaLIN are used separately, we can see that our models perform better than the others. However, when used together, the performance is even better.
|
| 122 |
+
|
| 123 |
+
# 3.3.3 QUALITATIVE EVALUATION
|
| 124 |
+
|
| 125 |
+
For qualitative evaluation, we have also conducted a perceptual study. 135 participants are shown translated results from different methods including the proposed method with source image, and asked to select the best translated image to target domain. We inform only the name of target domain, i.e., animation, dog, and zebra to the participants. But, some example images of target domain are provided for the portrait and Van Gogh datasets as minimum information to ensure proper judgments. Table 2 shows that the proposed method achieved significantly higher score except for photo2vangogh but comparable in human perceptual study compared to other methods. In Fig 4, we present the image translation results from each method for performance comparisons. U-GAT-IT can generate undistorted image by focusing more on the distinct regions between source and target domain by exploiting the attention modules. Note that the regions around heads of two zebras or eyes of dog are distorted in the results from CycleGAN. Moreover, translated results using U-GAT-IT are visually superior to other methods while preserving semantic features of source domain. It is worth noting that the results from MUNIT and DRIT are much dissimilar to the source images since they generate images with random style codes for diversity. Furthermore, it should be emphasized that U-GAT-IT have applied with the same network architecture and hyper-parameters for all of the five different datasets, while the other algorithms are trained with preset networks or hyper-parameters. Through the results of user study, we show that the combination of our attention module and AdaLIN makes our model more flexible.
|
| 126 |
+
|
| 127 |
+
Table 2: Preference score on translated images by user study.
|
| 128 |
+
|
| 129 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>selfie2anime</td><td rowspan=1 colspan=1>horse2zebra</td><td rowspan=1 colspan=1>cat2dog</td><td rowspan=1 colspan=1>photo2portrait</td><td rowspan=1 colspan=1>photo2vangogh</td></tr><tr><td rowspan=1 colspan=1>U-GAT-IT</td><td rowspan=1 colspan=1>73.15</td><td rowspan=1 colspan=1>73.56</td><td rowspan=1 colspan=1>58.22</td><td rowspan=1 colspan=1>30.59</td><td rowspan=1 colspan=1>48.96</td></tr><tr><td rowspan=1 colspan=1>CycleGAN</td><td rowspan=1 colspan=1>20.07</td><td rowspan=1 colspan=1>23.07</td><td rowspan=1 colspan=1>6.19</td><td rowspan=1 colspan=1>26.59</td><td rowspan=1 colspan=1>27.33</td></tr><tr><td rowspan=1 colspan=1>UNIT</td><td rowspan=1 colspan=1>1.48</td><td rowspan=1 colspan=1>0.85</td><td rowspan=1 colspan=1>18.63</td><td rowspan=1 colspan=1>32.11</td><td rowspan=1 colspan=1>11.93</td></tr><tr><td rowspan=1 colspan=1>MUNIT</td><td rowspan=1 colspan=1>3.41</td><td rowspan=1 colspan=1>1.04</td><td rowspan=1 colspan=1>14.48</td><td rowspan=1 colspan=1>8.22</td><td rowspan=1 colspan=1>2.07</td></tr><tr><td rowspan=1 colspan=1>DRIT</td><td rowspan=1 colspan=1>1.89</td><td rowspan=1 colspan=1>1.48</td><td rowspan=1 colspan=1>2.48</td><td rowspan=1 colspan=1>2.48</td><td rowspan=1 colspan=1>9.70</td></tr></table>
|
| 130 |
+
|
| 131 |
+
Table 3: Kernel Inception Distance $\times 1 0 0 \pm$ std. $\times 1 0 0$ for difference image translation mode. Lower is better.
|
| 132 |
+
|
| 133 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>selfie2anime</td><td rowspan=1 colspan=1>horse2zebra</td><td rowspan=1 colspan=1>cat2dog</td><td rowspan=1 colspan=1>photo2portrait</td><td rowspan=1 colspan=1>photo2vangogh</td></tr><tr><td rowspan=1 colspan=1>U-GAT-IT</td><td rowspan=1 colspan=1>11.61 ± 0.57</td><td rowspan=1 colspan=1>7.06 ± 0.8</td><td rowspan=1 colspan=1>7.07 ± 0.65</td><td rowspan=1 colspan=1>1.79 ± 0.34</td><td rowspan=1 colspan=1>4.28 ± 0.33</td></tr><tr><td rowspan=1 colspan=1>CycleGAN</td><td rowspan=1 colspan=1>13.08 ± 0.49</td><td rowspan=1 colspan=1>8.05 ± 0.72</td><td rowspan=1 colspan=1>8.92 ± 0.69</td><td rowspan=1 colspan=1>1.84 ± 0.34</td><td rowspan=1 colspan=1>5.46± 0.33</td></tr><tr><td rowspan=1 colspan=1>UNIT</td><td rowspan=1 colspan=1>14.71 ± 0.59</td><td rowspan=1 colspan=1>10.44 ± 0.67</td><td rowspan=1 colspan=1>8.15 ± 0.48</td><td rowspan=1 colspan=1>1.20 ± 0.31</td><td rowspan=1 colspan=1>4.26 ± 0.29</td></tr><tr><td rowspan=1 colspan=1>MUNIT</td><td rowspan=1 colspan=1>13.85 ± 0.41</td><td rowspan=1 colspan=1>11.41 ± 0.83</td><td rowspan=1 colspan=1>10.13 ± 0.27</td><td rowspan=1 colspan=1>4.75 ± 0.52</td><td rowspan=1 colspan=1>13.08 ± 0.34</td></tr><tr><td rowspan=1 colspan=1>DRIT</td><td rowspan=1 colspan=1>15.08 ± 0.62</td><td rowspan=1 colspan=1>9.79 ± 0.62</td><td rowspan=1 colspan=1>10.92 ± 0.33</td><td rowspan=1 colspan=1>5.85 ± 0.54</td><td rowspan=1 colspan=1>12.65 ± 0.35</td></tr><tr><td rowspan=1 colspan=1>AGGAN</td><td rowspan=1 colspan=1>14.63 ± 0.55</td><td rowspan=1 colspan=1>7.58 ± 0.71</td><td rowspan=1 colspan=1>9.84± 0.79</td><td rowspan=1 colspan=1>2.33± 0.36</td><td rowspan=1 colspan=1>6.95± 0.33</td></tr><tr><td rowspan=1 colspan=1>CartoonGAN</td><td rowspan=1 colspan=1>15.85 ± 0.69</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td></tr><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>anime2selfie</td><td rowspan=1 colspan=1>zebra2horse</td><td rowspan=1 colspan=1>dog2cat</td><td rowspan=1 colspan=1>portrait2photo</td><td rowspan=1 colspan=1>vangogh2photo</td></tr><tr><td rowspan=1 colspan=1>U-GAT-IT</td><td rowspan=1 colspan=1>11.52 ± 0.57</td><td rowspan=1 colspan=1>7.47 ± 0.71</td><td rowspan=1 colspan=1>8.15 ± 0.66</td><td rowspan=1 colspan=1>1.69 ± 0.53</td><td rowspan=1 colspan=1>5.61 ± 0.32</td></tr><tr><td rowspan=1 colspan=1>CycleGAN</td><td rowspan=1 colspan=1>11.84 ± 0.74</td><td rowspan=1 colspan=1>8.0 ± 0.66</td><td rowspan=1 colspan=1>9.94 ± 0.36</td><td rowspan=1 colspan=1>1.82 ± 0.36</td><td rowspan=1 colspan=1>4.68 ± 0.36</td></tr><tr><td rowspan=1 colspan=1>UNIT</td><td rowspan=1 colspan=1>26.32 ± 0.92</td><td rowspan=1 colspan=1>14.93 ± 0.75</td><td rowspan=1 colspan=1>9.81 ± 0.34</td><td rowspan=1 colspan=1>1.42 ± 0.24</td><td rowspan=1 colspan=1>9.72 ± 0.33</td></tr><tr><td rowspan=1 colspan=1>MUNIT</td><td rowspan=1 colspan=1>13.94 ± 0.72</td><td rowspan=1 colspan=1>16.47 ± 1.04</td><td rowspan=1 colspan=1>10.39 ± 0.25</td><td rowspan=1 colspan=1>3.30 ± 0.47</td><td rowspan=1 colspan=1>9.53 ± 0.35</td></tr><tr><td rowspan=1 colspan=1>DRIT</td><td rowspan=1 colspan=1>14.85 ± 0.60</td><td rowspan=1 colspan=1>10.98 ± 0.55</td><td rowspan=1 colspan=1>10.86 ± 0.24</td><td rowspan=1 colspan=1>4.76 ± 0.72</td><td rowspan=1 colspan=1>7.72 ± 0.34</td></tr><tr><td rowspan=1 colspan=1>AGGAN</td><td rowspan=1 colspan=1>12.72 ± 1.03</td><td rowspan=1 colspan=1>8.80 ± 0.66</td><td rowspan=1 colspan=1>9.45 ± 0.64</td><td rowspan=1 colspan=1>2.19 ± 0.40</td><td rowspan=1 colspan=1>5.85 ± 0.31</td></tr></table>
|
| 134 |
+
|
| 135 |
+
# 3.3.4 QUANTITATIVE EVALUATION
|
| 136 |
+
|
| 137 |
+
For quantitative evaluation, we use the recently proposed KID, which computes the squared Maximum Mean Discrepancy between the feature representations of real and generated images. The feature representations are extracted from the Inception network (Szegedy et al. (2016)). In contrast to the Frechet Inception Distance ´ (Heusel et al. (2017)), KID has an unbiased estimator, which makes it more reliable, especially when there are fewer test images than the dimensionality of the inception features. The lower KID indicates that the more shared visual similarities between real and generated images (Mejjati et al. (2018)). Therefore, if well translated, the KID will have a small value in several datasets. Table 3 shows that the proposed method achieved the lowest KID scores except for the style transfer tasks like photo2vangogh and photo2portrait. However, there is no big difference from the lowest score. Also, unlike UNIT and MUNIT, we can see that the source target, target source translations are both stable. U-GAT-IT shows even lower KID than the recent attention-based method, AGGAN. AGGAN yields poor performance for the transformation with shape change such as dog2cat and anime2selfie unlike the U-GAT-IT, the attention module of which focuses on distinguishing not between background and foreground but differences between two domains. CartoonGAN, as shown in the supplementary materials, has only changed the overall color of the image to an animated style, but compared to selfie, the eye, which is the biggest characteristic of animation, has not changed at all. Therefore, CartoonGAN has the higher KID.
|
| 138 |
+
|
| 139 |
+
# 4 CONCLUSIONS
|
| 140 |
+
|
| 141 |
+
In this paper, we have proposed unsupervised image-to-image translation (U-GAT-IT), with the attention module and AdaLIN which can produce more visually pleasing results in various datasets with a fixed network architecture and hyper-parameter. Detailed analysis of various experimental results supports our assumption that attention maps obtained by an auxiliary classifier can guide generator to focus more on distinct regions between source and target domain. In addition, we have found that the Adaptive Layer-Instance Normalization (AdaLIN) is essential for translating various datasets that contains different amount of geometry and style changes. Through experiments, we have shown that the superiority of the proposed method compared to the existing state-of-the-art GAN-based models for unsupervised image-to-image translation tasks.
|
| 142 |
+
|
| 143 |
+
# REFERENCES
|
| 144 |
+
|
| 145 |
+
Asha Anoosheh, Eirikur Agustsson, Radu Timofte, and Luc Van Gool. Combogan: Unrestrained scalability for image domain translation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pp. 783–790, 2018.
|
| 146 |
+
|
| 147 |
+
Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein generative adversarial networks. ´ In International Conference on Machine Learning, pp. 214–223, 2017.
|
| 148 |
+
|
| 149 |
+
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
|
| 150 |
+
|
| 151 |
+
David Berthelot, Tom Schumm, and Luke Metz. Began: Boundary equilibrium generative adversarial networks. arXiv preprint arXiv:1703.10717, 2017.
|
| 152 |
+
|
| 153 |
+
Mikołaj Binkowski, Dougal J. Sutherland, Michael Arbel, and Arthur Gretton. Demystifying ´ MMD GANs. In International Conference on Learning Representations, 2018. URL https: //openreview.net/forum?id $=$ r1lUOzWCW.
|
| 154 |
+
|
| 155 |
+
Yang Chen, Yu-Kun Lai, and Yong-Jin Liu. Cartoongan: Generative adversarial networks for photo cartoonization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 9465–9474, 2018.
|
| 156 |
+
|
| 157 |
+
Yunjey Choi, Minje Choi, Munyoung Kim, Jung-Woo Ha, Sunghun Kim, and Jaegul Choo. Stargan: Unified generative adversarial networks for multi-domain image-to-image translation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 8789– 8797, 2018.
|
| 158 |
+
|
| 159 |
+
Chao Dong, Chen Change Loy, Kaiming He, and Xiaoou Tang. Image super-resolution using deep convolutional networks. IEEE Transactions on Pattern Analysis and Machine Intelligence, 38(2): 295–307, 2016.
|
| 160 |
+
|
| 161 |
+
Vincent Dumoulin, Jonathon Shlens, and Manjunath Kudlur. A learned representation for artistic style. In International Conference on Learning Representations, 2017. URL https: //openreview.net/forum?id $=$ BJO-BuT1g.
|
| 162 |
+
|
| 163 |
+
Leon A Gatys, Alexander S Ecker, and Matthias Bethge. Image style transfer using convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2414–2423, 2016.
|
| 164 |
+
|
| 165 |
+
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.
|
| 166 |
+
|
| 167 |
+
Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. In Advances in Neural Information Processing Systems, pp. 6626–6637, 2017.
|
| 168 |
+
|
| 169 |
+
Xun Huang and Serge Belongie. Arbitrary style transfer in real-time with adaptive instance normalization. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1501– 1510, 2017.
|
| 170 |
+
|
| 171 |
+
Xun Huang, Ming-Yu Liu, Serge Belongie, and Jan Kautz. Multimodal unsupervised image-toimage translation. In Proceedings of the European Conference on Computer Vision, pp. 172–189, 2018.
|
| 172 |
+
|
| 173 |
+
Satoshi Iizuka, Edgar Simo-Serra, and Hiroshi Ishikawa. Globally and locally consistent image completion. ACM Transactions on Graphics, 36(4):107, 2017.
|
| 174 |
+
|
| 175 |
+
Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1125–1134, 2017.
|
| 176 |
+
|
| 177 |
+
Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of gans for improved quality, stability, and variation. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $=$ Hk99zCeAb.
|
| 178 |
+
|
| 179 |
+
Jiwon Kim, Jung Kwon Lee, and Kyoung Mu Lee. Accurate image super-resolution using very deep convolutional networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1646–1654, 2016.
|
| 180 |
+
|
| 181 |
+
Taeksoo Kim, Moonsu Cha, Hyunsoo Kim, Jung Kwon Lee, and Jiwon Kim. Learning to discover cross-domain relations with generative adversarial networks. In Proceedings of the International Conference on Machine Learning, pp. 1857–1865, 2017. URL http://proceedings.mlr. press/v70/kim17a.html.
|
| 182 |
+
|
| 183 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations, 2015. URL http://arxiv.org/abs/1412. 6980.
|
| 184 |
+
|
| 185 |
+
Gustav Larsson, Michael Maire, and Gregory Shakhnarovich. Learning representations for automatic colorization. In Proceedings of the European Conference on Computer Vision, pp. 577–593. Springer, 2016.
|
| 186 |
+
|
| 187 |
+
Hsin-Ying Lee, Hung-Yu Tseng, Jia-Bin Huang, Maneesh Singh, and Ming-Hsuan Yang. Diverse image-to-image translation via disentangled representations. In Proceedings of the European Conference on Computer Vision, pp. 35–51, 2018.
|
| 188 |
+
|
| 189 |
+
Chunyuan Li, Hao Liu, Changyou Chen, Yuchen Pu, Liqun Chen, Ricardo Henao, and Lawrence Carin. Alice: Towards understanding adversarial learning for joint distribution matching. In Advances in Neural Information Processing Systems, pp. 5501–5509, 2017a.
|
| 190 |
+
|
| 191 |
+
Yijun Li, Chen Fang, Jimei Yang, Zhaowen Wang, Xin Lu, and Ming-Hsuan Yang. Universal style transfer via feature transforms. In Advances in Neural Information Processing Systems, pp. 386– 396, 2017b.
|
| 192 |
+
|
| 193 |
+
Ming-Yu Liu, Thomas Breuel, and Jan Kautz. Unsupervised image-to-image translation networks. In Advances in Neural Information Processing Systems, pp. 700–708, 2017.
|
| 194 |
+
|
| 195 |
+
Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3431–3440, 2015.
|
| 196 |
+
|
| 197 |
+
Xudong Mao, Qing Li, Haoran Xie, Raymond YK Lau, Zhen Wang, and Stephen Paul Smolley. Least squares generative adversarial networks. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2813–2821. IEEE, 2017.
|
| 198 |
+
|
| 199 |
+
Youssef Alami Mejjati, Christian Richardt, James Tompkin, Darren Cosker, and Kwang In Kim. Unsupervised attention-guided image-to-image translation. In Advances in Neural Information Processing Systems, pp. 3697–3707, 2018.
|
| 200 |
+
|
| 201 |
+
Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $=$ B1QRgziT-.
|
| 202 |
+
|
| 203 |
+
Hyeonseob Nam and Hyo-Eun Kim. Batch-instance normalization for adaptively style-invariant neural networks. In Advances in Neural Information Processing Systems, pp. 2563–2572, 2018.
|
| 204 |
+
|
| 205 |
+
Deepak Pathak, Philipp Krahenbuhl, Jeff Donahue, Trevor Darrell, and Alexei A Efros. Context encoders: Feature learning by inpainting. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2536–2544, 2014.
|
| 206 |
+
|
| 207 |
+
Amelie Royer, Konstantinos Bousmalis, Stephan Gouws, Fred Bertsch, Inbar Moressi, Forrester ´ Cole, and Kevin Murphy. Xgan: Unsupervised image-to-image translation for many-to-many mappings. arXiv preprint arXiv:1711.05139, 2017.
|
| 208 |
+
|
| 209 |
+
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.
|
| 210 |
+
|
| 211 |
+
Yaniv Taigman, Adam Polyak, and Lior Wolf. Unsupervised cross-domain image generation. In International Conference on Learning Representations, 2017. URL https://openreview. net/forum?id ${ . } = { }$ Sk2Im59ex.
|
| 212 |
+
|
| 213 |
+
Ting-Chun Wang, Ming-Yu Liu, Jun-Yan Zhu, Andrew Tao, Jan Kautz, and Bryan Catanzaro. Highresolution image synthesis and semantic manipulation with conditional gans. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 8798–8807, 2018.
|
| 214 |
+
|
| 215 |
+
Yuxin Wu and Kaiming He. Group normalization. In Proceedings of the European Conference on Computer Vision, September 2018.
|
| 216 |
+
|
| 217 |
+
Zili Yi, Hao Zhang, Ping Tan, and Minglun Gong. Dualgan: Unsupervised dual learning for imageto-image translation. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2849–2857, 2017.
|
| 218 |
+
|
| 219 |
+
Richard Zhang, Phillip Isola, and Alexei A Efros. Colorful image colorization. In Proceedings of the European Conference on Computer Vision, pp. 649–666. Springer, 2016.
|
| 220 |
+
|
| 221 |
+
Richard Zhang, Jun-Yan Zhu, Phillip Isola, Xinyang Geng, Angela S. Lin, Tianhe Yu, and Alexei A. Efros. Real-time user-guided image colorization with learned deep priors. ACM Transactions on Graphics, 36(4):119:1–119:11, 2017. doi: 10.1145/3072959.3073703. URL https://doi. org/10.1145/3072959.3073703.
|
| 222 |
+
|
| 223 |
+
Junbo Jake Zhao, Michael Mathieu, and Yann LeCun. Energy-based generative adversarial net- ¨ works. In International Conference on Learning Representations, 2017. URL https:// openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ ryh9pmcee.
|
| 224 |
+
|
| 225 |
+
Bolei Zhou, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba. Learning deep features for discriminative localization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2921–2929. IEEE, 2016.
|
| 226 |
+
|
| 227 |
+
Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2223–2232, 2017.
|
| 228 |
+
|
| 229 |
+
# A RELATED WORKS
|
| 230 |
+
|
| 231 |
+
# A.1 GENERATIVE ADVERSARIAL NETWORKS
|
| 232 |
+
|
| 233 |
+
Generative Adversarial Networks (GAN)(Goodfellow et al. (2014)) have achieved impressive results on a wide variety of image generation(Arjovsky et al. (2017); Berthelot et al. (2017); Karras et al. (2018); Zhao et al. (2017)), image inpainting(Iizuka et al. (2017)), image translation(Choi et al. (2018); Huang et al. (2018); Isola et al. (2017); Liu et al. (2017); Wang et al. (2018); Zhu et al. (2017)) tasks. In training, a generator aims to generate realistic images to fool a discriminator while the discriminator tries to distinguish the generated images from real images. Various multi-stage generative models(Karras et al. (2018); Wang et al. (2018)) and better training objectives(Arjovsky et al. (2017); Berthelot et al. (2017); Mao et al. (2017); Zhao et al. (2017)) have been proposed to generate more realistic images. In this paper, our model uses GAN to learn the transformation from a source domain to a significantly different target domain, given unpaired training data.
|
| 234 |
+
|
| 235 |
+
# A.2 IMAGE-TO-IMAGE TRANSLATION
|
| 236 |
+
|
| 237 |
+
Isola et al.(Isola et al. (2017)) have proposed a conditional GAN-based unified framework for image-to-image translation. High-resolution version of the pix2pix have been proposed by Wang et al.(Wang et al. (2018)) Recently, there have been various attempts (Huang et al. (2018); Kim et al. (2017); Liu et al. (2017); Taigman et al. (2017); Zhu et al. (2017)) to learn image translation from an unpaired dataset. CycleGAN (Zhu et al. (2017)) have proposed a cyclic consistence loss for the first time to enforce one-to-one mapping. UNIT (Liu et al. (2017)) assumed a shared-latent space to tackle unsupervised image translation. However, this approach performs well only when the two domains have similar patterns. MUNIT (Huang et al. (2018)) makes it possible to extend to manyto-many mapping by decomposing the image into content code that is domain-invariant and a style code that captures domain-specific properties. MUNIT synthesizes the separated content and style to generate the final image, where the image quality is improved by using adaptive instance normalization (Huang & Belongie (2017)). With the same purpose as MUNIT, DRIT (Lee et al. (2018)) decomposes images into content and style, so that many-to-many mapping is possible. The only difference is that content space is shared between the two domains using the weight sharing and content discriminator which is auxiliary classifier. Nevertheless, the performance of these methods (Huang et al. (2018); Liu et al. (2017); Lee et al. (2018)) are limited to the dataset that contains well-aligned images between source and target domains. In addition, AGGAN (Mejjati et al. (2018)) improved the performance of image translation by using attention mechanism to distinguish between foreground and background. However, the attention module in AGGAN cannot help to transform the object’s shape in the image. Although, CartoonGAN (Chen et al. (2018)) shows good performance for animation style translation, it changes only the color, tone, and thickness of line in the image. Therefore it is not suitable for the shape change in the image.
|
| 238 |
+
|
| 239 |
+
# A.3 CLASS ACTIVATION MAP
|
| 240 |
+
|
| 241 |
+
Zhou et al. (Zhou et al. (2016)) have proposed Class Activation Map (CAM) using global average pooling in a CNN. The CAM for a particular class shows the discriminative image regions by the CNN to determine that class. In this work, our model leads to intensively change discriminative image regions provided by distinguishing two domains using the CAM approach. However, not only global average pooling is used, but global max pooling is also used to make the results better.
|
| 242 |
+
|
| 243 |
+
# A.4 NORMALIZATION
|
| 244 |
+
|
| 245 |
+
Recent neural style transfer researches have shown that CNN feature statistics (e.g., Gram matrix (Gatys et al. (2016)), mean and variance (Huang & Belongie (2017)) can be used as direct descriptors for image styles. In particular, Instance Normalization (IN) has the effect of removing the style variation by directly normalizing the feature statistics of the image and is used more often than Batch Normalization (BN) or Layer Normalization (LN) in style transfer. However, when normalizing images, recent studies use Adaptive Instance Normalization (AdaIN) (Huang & Belongie (2017)), Conditional Instance Normalization (CIN) (Dumoulin et al. (2017)), and Batch-Instance Normalization (BIN) (Nam & Kim (2018)) instead of using IN alone. In our work, we propose an Adaptive
|
| 246 |
+
|
| 247 |
+
Layer-Instance Normalization (AdaLIN) function to adaptively select a proper ratio between IN and LN. Through the AdaLIN, our attention-guided model can flexibly control the amount of change in shape and texture.
|
| 248 |
+
|
| 249 |
+
# B IMPLEMENTATION DETAILS
|
| 250 |
+
|
| 251 |
+
# B.1 NETWORK ARCHITECTURE
|
| 252 |
+
|
| 253 |
+
The network architectures of U-GAT-IT are shown in Table 4, 5, and 6. The encoder of the generator is composed of two convolution layers with the stride size of two for down-sampling and four residual blocks. The decoder of the generator consists of four residual blocks and two up-sampling convolution layers with the stride size of one. Note that we use the instance normalization for the encoder and AdaLIN for the decoder, respectively. In general, LN does not perform better than batch normalization in classification problems (Wu & He (2018)). Since the auxiliary classifier is connected from the encoder in the generator, to increase the accuracy of the auxiliary classifier we use the instance normalization(batch normalization with a mini-batch size of 1) instead of the AdaLIN. Spectral normalization (Miyato et al. (2018)) is used for the discriminator. We employ two different scales of PatchGAN (Isola et al. (2017)) for the discriminator network, which classifies whether local $( 7 0 \mathrm { ~ x ~ } 7 0 )$ and global $( 2 8 6 \mathrm { ~ x ~ } 2 8 6 )$ image patches are real or fake. For the activation function, we use ReLU in the generator and leaky-ReLU with a slope of 0.2 in the discriminator.
|
| 254 |
+
|
| 255 |
+
# B.2 TRAINING
|
| 256 |
+
|
| 257 |
+
All models are trained using Adam (Kingma & Ba (2015)) with $\beta _ { 1 } { = } 0 . 5$ and $\beta _ { 2 } { = } 0 . 9 9 9$ . For data augmentation, we flipped the images horizontally with a probability of 0.5, resized them to $2 8 6 \times$ 286, and random cropped them to $2 5 6 \times 2 5 6$ . The batch size is set to one for all experiments. We train all models with a fixed learning rate of 0.0001 until 500,000 iterations and linearly decayed up to 1,000,000 iterations. We also use a weight decay at rate of 0.0001. The weights are initialized from a zero-centered normal distribution with a standard deviation of 0.02.
|
| 258 |
+
|
| 259 |
+
# C DATASET DETAILS
|
| 260 |
+
|
| 261 |
+
selfie2anime The selfie dataset contains 46,836 selfie images annotated with 36 different attributes. We only use photos of females as training data and test data. The size of the training dataset is 3400, and that of the test dataset is 100, with the image size of $2 5 6 \times 2 5 6$ . For the anime dataset, we have firstly retrieved 69,926 animation character images from Anime-Planet1. Among those images, 27,023 face images are extracted by using an anime-face detector2. After selecting only female character images and removing monochrome images manually, we have collected two datasets of female anime face images, with the sizes of 3400 and 100 for training and test data respectively, which is the same numbers as the selfie dataset. Finally, all anime face images are resized to $2 5 6 \times$ 256 by applying a CNN-based image super-resolution algorithm3.
|
| 262 |
+
|
| 263 |
+
horse2zebra and photo2vangogh These datasets are used in CycleGAN (Zhu et al. (2017)). The training dataset size of each class: 1,067 (horse), 1,334 (zebra), 6,287 (photo), and 400 (vangogh). The test datasets consist of 120 (horse), 140 (zebra), 751 (photo), and 400 (vangogh). Note that the training data and the test data of vangogh class are the same.
|
| 264 |
+
|
| 265 |
+
cat2dog and photo2portrait These datasets are used in DRIT (Lee et al. (2018)). The numbers of data for each class are 871 (cat), 1,364 (zebra), 6,452 (photo), and 1,811 (vangogh). We use 120 (horse), 140 (zebra), 751 (photo), and 400 (vangogh) randomly selected images as test data, respectively.
|
| 266 |
+
|
| 267 |
+
# D ADDITIONAL EXPERIMENTAL RESULTS
|
| 268 |
+
|
| 269 |
+
In addition to the results presented in the paper, we show supplement generation results for the five datasets in Figs 5, 6, 7, 8, 9, 10, 11, and 12.
|
| 270 |
+
|
| 271 |
+
Table 4: The detail of generator architecture.
|
| 272 |
+
|
| 273 |
+
<table><tr><td rowspan=1 colspan=1>Part</td><td rowspan=1 colspan=1>Input -→ Output Shape</td><td rowspan=1 colspan=1>Layer Information</td></tr><tr><td rowspan=3 colspan=1>Encoder Down-sampling</td><td rowspan=1 colspan=1>(h,w,3)→(h,w,64)</td><td rowspan=1 colspan=1>CONV-(N64,K7, S1, P3),IN,ReLU</td></tr><tr><td rowspan=1 colspan=1>(h,w.64)→(,,128)</td><td rowspan=1 colspan=1>CONV-(N128,K3,S2,P1),IN,ReLU</td></tr><tr><td rowspan=1 colspan=1>,,128)→(,N,,256)</td><td rowspan=1 colspan=1>CONV-(N256,K3,S2,P1),IN,ReLU</td></tr><tr><td rowspan=4 colspan=1>EncoderBottleneck</td><td rowspan=1 colspan=1>东会,,256)→A,256)</td><td rowspan=1 colspan=1>ResBlock-(N256,K3,S1,P1), IN,ReLU</td></tr><tr><td rowspan=1 colspan=1>GA,,256→A,256</td><td rowspan=1 colspan=1>ResBlock-(N256,K3,S1,P1),IN,ReLU</td></tr><tr><td rowspan=1 colspan=1>GA256 A,256)</td><td rowspan=1 colspan=1>ResBlock-(N256,K3, S1,P1), IN,ReLU</td></tr><tr><td rowspan=1 colspan=1>,美256 A,,256)</td><td rowspan=1 colspan=1>ResBlock-(N256,K3,S1, P1), IN,ReLU</td></tr><tr><td rowspan=2 colspan=1>CAMof Generator</td><td rowspan=1 colspan=1>,美,256) ,,512)</td><td rowspan=1 colspan=1>Global Average & Max Pooling,MLP-(N1), Multiply the weights of MLP</td></tr><tr><td rowspan=1 colspan=1>4,,512) ,256</td><td rowspan=1 colspan=1>CONV-(N256, K1, S1), ReLU</td></tr><tr><td rowspan=3 colspan=1>Y,β</td><td rowspan=1 colspan=1>(,256→ (1,1,256)</td><td rowspan=1 colspan=1>MLP-(N256), ReLU</td></tr><tr><td rowspan=1 colspan=1>(1,1,256)→(1,1,256)</td><td rowspan=1 colspan=1>MLP-(N256), ReLU</td></tr><tr><td rowspan=1 colspan=1>(1,1,256)→(1,1,256)</td><td rowspan=1 colspan=1>MLP-(N256),ReLU</td></tr><tr><td rowspan=4 colspan=1>Decoder Bottleneck</td><td rowspan=1 colspan=1>,256→(, 256</td><td rowspan=1 colspan=1>AdaResBlock-(N256,K3, S1,P1),AdaILN,ReLU</td></tr><tr><td rowspan=1 colspan=1>C美256 A,256)</td><td rowspan=1 colspan=1>AdaResBlock-(N256,K3,S1,P1),AdaILN,ReU</td></tr><tr><td rowspan=1 colspan=1>会,256)→A,256)</td><td rowspan=1 colspan=1>AdaResBlock-(N256,K3,S1,P1),AdaILN,ReU</td></tr><tr><td rowspan=1 colspan=1>CA256→A,256)</td><td rowspan=1 colspan=1>AdaResBlock-(N256,K3,S1,P1),AdaILN,ReU</td></tr><tr><td rowspan=3 colspan=1>Decoder Up-sampling</td><td rowspan=1 colspan=1>4256 ,,128)</td><td rowspan=1 colspan=1>Up-CONV-(N128, K3, S1, P1), LIN, ReLU</td></tr><tr><td rowspan=1 colspan=1>,,128)→(h,w,64)</td><td rowspan=1 colspan=1>Up-CONV-(N64, K3,S1, P1),LIN, ReLU</td></tr><tr><td rowspan=1 colspan=1>(h,w,64) → (h,w,3)</td><td rowspan=1 colspan=1>CONV-(N3, K7,S1, P3), Tanh</td></tr></table>
|
| 274 |
+
|
| 275 |
+
Table 5: The detail of local discriminator.
|
| 276 |
+
|
| 277 |
+
<table><tr><td rowspan=1 colspan=1>Part</td><td rowspan=1 colspan=1>Input -→ Output Shape</td><td rowspan=1 colspan=1>Layer Information</td></tr><tr><td rowspan=4 colspan=1>Encoder Down-sampling</td><td rowspan=1 colspan=1>(h,w,3)→(,m,64)</td><td rowspan=1 colspan=1>CONV-(N64,K4, S2,P1), SN,Leaky-ReLU</td></tr><tr><td rowspan=1 colspan=1>(,,64→(,,128)</td><td rowspan=1 colspan=1>CONV-(N128, K4, S2, P1), SN,Leaky-ReLU</td></tr><tr><td rowspan=1 colspan=1>GA,128) ,256</td><td rowspan=1 colspan=1>CONV-(N256,K4, S2,P1), SN,Leaky-ReLU</td></tr><tr><td rowspan=1 colspan=1>尚,,256 ,512)</td><td rowspan=1 colspan=1>CONV-(N512, K4, S1,P1), SN,Leaky-ReLU</td></tr><tr><td rowspan=2 colspan=1>CAMof Discriminator</td><td rowspan=1 colspan=1>8,1024)</td><td rowspan=1 colspan=1>Global Average & Max Pooling,MLP-(N1),Multiply the weights of MLP</td></tr><tr><td rowspan=1 colspan=1>,,1024)→,,512)</td><td rowspan=1 colspan=1>CONV-(N512,K1, S1),Leaky-ReLU</td></tr><tr><td rowspan=1 colspan=1>Classifier</td><td rowspan=1 colspan=1>(,,512)→,,1</td><td rowspan=1 colspan=1>CONV-(N1,K4,S1,P1), S</td></tr></table>
|
| 278 |
+
|
| 279 |
+
Table 6: The detail of global discriminator.
|
| 280 |
+
|
| 281 |
+
<table><tr><td rowspan=1 colspan=1>Part</td><td rowspan=1 colspan=1>Input -→ Output Shape</td><td rowspan=1 colspan=1>Layer Information</td></tr><tr><td rowspan=6 colspan=1>Encoder Down-sampling</td><td rowspan=1 colspan=1>(h,w,3)→(,,64</td><td rowspan=1 colspan=1>CONV-(N64, K4, S2,P1), SN,Leaky-ReLU</td></tr><tr><td rowspan=1 colspan=1>G,64→4.,128)</td><td rowspan=1 colspan=1>CONV-(N128, K4, S2, P1), SN,Leaky-ReLU</td></tr><tr><td rowspan=1 colspan=1>G4,128)→,256</td><td rowspan=1 colspan=1>CONV-(N256, K4, S2, P1), SN, Leaky-ReLU</td></tr><tr><td rowspan=1 colspan=1>G 256→(C品512)</td><td rowspan=1 colspan=1>CONV-(N512, K4, S2, P1), SN, Leaky-ReLU</td></tr><tr><td rowspan=1 colspan=1>G,512) 品1024)</td><td rowspan=1 colspan=1>CONV-(N1024,K4, S2,P1), SN,Leaky-ReLU</td></tr><tr><td rowspan=1 colspan=1>品3,1024) 金,2048)</td><td rowspan=1 colspan=1>CONV-(N2048,K4, S1,P1), SN,Leaky-ReLU</td></tr><tr><td rowspan=2 colspan=1>CAM of Discriminator</td><td rowspan=1 colspan=1>e,2048)→ =G32,32,4096)</td><td rowspan=1 colspan=1>Global Average & Max Pooling,MLP-(N1), Multiply the weights of MLP</td></tr><tr><td rowspan=1 colspan=1>金3,4096)→品,3,2048)</td><td rowspan=1 colspan=1>CONV-(N2048,K1, S1), Leaky-ReLU</td></tr><tr><td rowspan=1 colspan=1>Classifier</td><td rowspan=1 colspan=1>2048)→ 高品,1)</td><td rowspan=1 colspan=1>CONV-(N1, K4, S1, P1), SN</td></tr></table>
|
| 282 |
+
|
| 283 |
+

|
| 284 |
+
Figure 5: Visual comparisons of the selfie2anime with attention features maps. (a) Source images, (b) Attention map of the generator, (c-d) Local and global attention maps of the discriminators, (e) Our results, (f) CycleGAN (Zhu et al. (2017)), (g) UNIT (Liu et al. (2017)), (h) MUNIT (Huang et al. (2018)), (i) DRIT (Lee et al. (2018)), (j) AGGAN (Mejjati et al. (2018)), (k) CartoonGAN (Chen et al. (2018)).
|
| 285 |
+
|
| 286 |
+

|
| 287 |
+
Figure 6: Visual comparisons of the anime2selfie with attention features maps. (a) Source images, (b) Attention map of the generator, (c-d) Local and global attention maps of the discriminators, (e) Our results, (f) CycleGAN (Zhu et al. (2017)), (g) UNIT (Liu et al. (2017)), (h) MUNIT (Huang et al. (2018)), (i) DRIT (Lee et al. (2018)), (j) AGGAN (Mejjati et al. (2018)).
|
| 288 |
+
|
| 289 |
+

|
| 290 |
+
Figure 7: Visual comparisons of the horse2zebra with attention features maps. (a) Source images, (b) Attention map of the generator, (c-d) Local and global attention maps of the discriminators, (e) Our results, (f) CycleGAN (Zhu et al. (2017)), (g) UNIT (Liu et al. (2017)), (h) MUNIT (Huang et al. (2018)), (i) DRIT (Lee et al. (2018)), (j) AGGAN (Mejjati et al. (2018)).
|
| 291 |
+
|
| 292 |
+

|
| 293 |
+
Figure 8: Visual comparisons of the zebra2horse with attention features maps. (a) Source images, (b) Attention map of the generator, (c-d) Local and global attention maps of the discriminators, (e) Our results, (f) CycleGAN (Zhu et al. (2017)), (g) UNIT (Liu et al. (2017)), (h) MUNIT (Huang et al. (2018)), (i) DRIT (Lee et al. (2018)), (j) AGGAN (Mejjati et al. (2018)).
|
| 294 |
+
|
| 295 |
+

|
| 296 |
+
Figure 9: Visual comparisons of the cat2dog with attention features maps. (a) Source images, (b) Attention map of the generation, (c-d) Local and global attention maps of the discriminators, (e) Our results, (f) CycleGAN (Zhu et al. (2017)), (g) UNIT (Liu et al. (2017)), (h) MUNIT (Huang et al. (2018)), (i) DRIT (Lee et al. (2018)), (j) AGGAN (Mejjati et al. (2018)).
|
| 297 |
+
|
| 298 |
+

|
| 299 |
+
Figure 10: Visual comparisons of the dog2cat with attention features maps. (a) Source images, (b) Attention map of the generation, (c-d) Local and global attention maps of the discriminators, (e) Our results, (f) CycleGAN (Zhu et al. (2017)), (g) UNIT (Liu et al. (2017)), (h) MUNIT (Huang et al. (2018)), (i) DRIT (Lee et al. (2018)), (j) AGGAN (Mejjati et al. (2018)).
|
| 300 |
+
|
| 301 |
+

|
| 302 |
+
Figure 11: Visual comparisons of the photo2vangogh with attention features maps. (a) Source images, (b) Attention map of the generation, (c-d) Local and global attention maps of the discriminators, respectively, (e) Our results, (f) CycleGAN (Zhu et al. (2017)), (g) UNIT (Liu et al. (2017)), (h) MUNIT (Huang et al. (2018)), (i) DRIT (Lee et al. (2018)), (j) AGGAN (Mejjati et al. (2018)).
|
| 303 |
+
|
| 304 |
+

|
| 305 |
+
Figure 12: Visual comparisons of the photo2portrait with attention features maps. (a) Source images, (b) Attention map of the generator, (c-d) Local and global attention maps of the discriminators, respectively, (e) Our results,(f) CycleGAN (Zhu et al. (2017)), (g) UNIT (Liu et al. (2017)), (h) MUNIT (Huang et al. (2018)), (i) DRIT (Lee et al. (2018)), (j) AGGAN (Mejjati et al. (2018)).
|
md/train/Bkg2viA5FQ/Bkg2viA5FQ.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/Bkx0RjA9tX/Bkx0RjA9tX.md
ADDED
|
@@ -0,0 +1,342 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GENERATIVE QUESTION ANSWERING: LEARNING TO ANSWER THE WHOLE QUESTION
|
| 2 |
+
|
| 3 |
+
Mike Lewis & Angela Fan Facebook AI Research {mikelewis,angelafan}@fb.com
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Discriminative question answering models can overfit to superficial biases in datasets, because their loss function saturates when any clue makes the answer likely. We introduce generative models of the joint distribution of questions and answers, which are trained to explain the whole question, not just to answer it. Our question answering (QA) model is implemented by learning a prior over answers, and a conditional language model to generate the question given the answer— allowing scalable and interpretable many-hop reasoning as the question is generated word-by-word. Our model achieves competitive performance with comparable discriminative models on the SQUAD and CLEVR benchmarks, indicating that it is a more general architecture for language understanding and reasoning than previous work. The model greatly improves generalisation both from biased training data and to adversarial testing data, achieving state-of-the-art results on ADVERSARIALSQUAD.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Question answering tasks are widely used for training and testing machine comprehension and reasoning (Rajpurkar et al., 2016; Joshi et al., 2017). However, high performance has been achieved with only superficial understanding, as models exploit simple correlations in the data (Weissenborn et al., 2017; Zhou et al., 2015). For example, in Visual QA (Agrawal et al., 2017), the answer to What colour is the grass? can be memorised as green without considering the image (Figure 1).
|
| 12 |
+
|
| 13 |
+
We argue that this over-fitting to biases is partly caused by discriminative loss functions, which saturate when simple correlations allow the question to be answered confidently, leaving no incentive for further learning on the example.
|
| 14 |
+
|
| 15 |
+
We propose generative QA models, using Bayes’ rule to reparameterise the distribution of answers given questions in terms of the distribution of questions given answers. We learn a prior over answers and a conditional language model for generating the question—reducing question answering to sequence-to-sequence learning (Sutskever et al., 2014), and allowing many-hop reasoning as the model explains the whole question word-by-word.
|
| 16 |
+
|
| 17 |
+
Generative loss functions train the model to explain all question words, even if the answer is obvious. For example, a model cannot assign high probability to generating the question What colour is the grass? without learning a dependency between the image and the word grass. We show that this method allows much improved generalisation from biased training data and to adversarial test data, compared to state-of-the-art discriminative models.
|
| 18 |
+
|
| 19 |
+
Word-by-word generative modelling of questions also supports chains of reasoning, as each subpart of the question is explained in turn. Existing methods use a pre-specified number of reasoning steps (Sukhbaatar et al., 2015; Hudson & Manning, 2018), which may be too many steps on easy cases, and too few on long and complex questions. We instead perform an interpretable reasoning step for each question word, and achieve $9 7 . 7 \%$ accuracy on the CLEVR benchmark (Johnson et al., 2017).
|
| 20 |
+
|
| 21 |
+
Our approach opens a promising new direction for question answering, with strong results in language understanding, reasoning and generalisation.
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
|
| 25 |
+
Does the green rubber object have the same shape as the gray thing that is on the right side of the big purple object?
|
| 26 |
+
|
| 27 |
+
Is the purple thing the same shape as the large gray rubber thing?
|
| 28 |
+
|
| 29 |
+
(a) Two CLEVR questions. Both can be answered no using only subsets of the available information. A generative model must learn to perform additional reasoning to assign high likelihood to the complete question-answer pair. Word-by-word question generation allows a reasoning step to explain each word.
|
| 30 |
+
|
| 31 |
+
Whilst filming in Mexico City, speculation in the media claimed that the script had been altered to accommodate the demands of Mexican authorities reportedly influencing details of the scene and characters, casting choices, and modifying the script in order to portray the country in a “positive light” in order to secure tax concessions and financial support worth up to $\$ 20$ million for the film. This was denied by producer Michael G. Wilson.
|
| 32 |
+
|
| 33 |
+
Which Bond producer would not confirm that the film had been changed to accommodate Mexican authorities?
|
| 34 |
+
|
| 35 |
+
(b) A SQUAD question. A discriminative model can identify the only producer, and ignore the rest of the question. To generate the question and answer, our model needs coreference, negation and paraphrasing. These reasoning skills can improve generalisation on test examples with multiple plausible answers.
|
| 36 |
+
|
| 37 |
+
Figure 1: Examples of questions that can be answered using only some question words (underlined).
|
| 38 |
+
|
| 39 |
+
# 2 MODEL
|
| 40 |
+
|
| 41 |
+
# 2.1 OVERVIEW
|
| 42 |
+
|
| 43 |
+
We assume a dataset of examples with a question $q = q _ { 0 . . T }$ , answer $a$ , and context $c$ (in our experiments, $c$ is a document or image, but alternatives such as knowledge graphs could be used).
|
| 44 |
+
|
| 45 |
+
We train models to minimize the negative log likelihood of the joint distribution of questions and answers given the context, $- \log p ( q , a | c )$ , which we decompose using the chain rule as:
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\mathcal { L } = - \log p ( a | c ) - \sum _ { t } \log p ( q _ { t } | a , c , q _ { 0 . . t - 1 } )
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
First $c$ is encoded, using a recurrent model for text $( \ S 2 . 2 )$ and a using a convolutional model for images (§2.3).
|
| 52 |
+
|
| 53 |
+
Then, a prior over answers $p ( a | c )$ is evaluated by scoring all possible answers (2.4).
|
| 54 |
+
|
| 55 |
+
The likelihood of the question $p ( q | a , c )$ is modelled using a conditional language model (§2.5).
|
| 56 |
+
|
| 57 |
+
At test time, the answer maximizing $p ( q , a | c )$ is returned1 (§2.7).
|
| 58 |
+
|
| 59 |
+
Hyperparameters and training details are fully described in Appendix A.
|
| 60 |
+
|
| 61 |
+
# 2.2 DOCUMENT ENCODER
|
| 62 |
+
|
| 63 |
+
Answer-independent Context Representation We use contextualised word representations, similar to ELMo (Peters et al., 2018). We use character-based word embeddings (Kim et al., 2016) and train a 2-layer LSTM language model in the forward and reverse directions, using the WikiText-103 corpus (Merity et al., 2016) for domain-specificity2. These parameters are frozen, and not finetuned. Contextualised word representations are computed as a fully connected layer applied to the concatenation of the word embedding and the hidden states of each layer of the language model. We sum this representation with a trainable vector of size $d$ if the word occurs in the article title, giving the encoder information about the article topic. We follow this with bidirectional LSTMs of size $d / 2$ , concatenating the output in each direction and adding residual connections after each layer.
|
| 64 |
+
|
| 65 |
+
What we now call gravity was not identified as a universal force until the work of Isaac Newton. [...] Galileo was instrumental in describing the characteristics of falling objects [...] this acceleration due to gravity towards the surface of the Earth is usually designated as and has a magnitude of about 9.81 meters per second squared [...], and points toward the center of the Earth. [...] Distractor: Object falls about 5 times faster on Mars.
|
| 66 |
+
|
| 67 |
+

|
| 68 |
+
Figure 2: Probabilities of generating question words given different answers for a standard and an adversarial SQUAD question, allowing us to interpret which questions words are explained by the answer. In the standard setting, the model places greater probability on the question words that appear near Isaac Newton, such as force compared to Galileo. In the adversarial setting, the question word Earth distinguishes the true answer from the distractor.
|
| 69 |
+
|
| 70 |
+
Answer Encoder We assume answers $a$ are a span $i . . j$ of the document. We represent the answer as a weighted sum of words within the span. For each word representation $\begin{array} { r } { \sum _ { k = i \ldots j } \sigma ( w \cdot \tilde { c } _ { k } ) \tilde { c } _ { k } } \end{array}$ , where $w \in R ^ { d }$ is a trainable vector, and $\tilde { c } _ { k }$ is the kth word in the answer-independent document representation. In contrast to previously proposed span representations (Lee et al., 2016; He et al., 2018), this approach allows the model to select arbitrarily many head words from the span.
|
| 71 |
+
|
| 72 |
+
Answer-dependent Context Representation Generative training makes it feasible to model more complex interactions between the answer and context than discriminative training, because only the correct answer is used. On SQUAD, we compute an answer-dependent document representation.
|
| 73 |
+
|
| 74 |
+
Here, we take the output of the answer-independent representation of each context word, and concatenate it with 32-dimensional embeddings of: a binary feature for whether the word is contained in the answer, its position relative to the answer start, and its position relative to the answer end. We also concatenate the element-wise product of the word representation and the answer encoding. We feed the result into 3 further layers of residual bidirectional LSTMs of size $d / 2$ .
|
| 75 |
+
|
| 76 |
+
# 2.3 IMAGE ENCODER
|
| 77 |
+
|
| 78 |
+
We use a simple image encoder, leaving reasoning to the question decoder.
|
| 79 |
+
|
| 80 |
+
Following Johnson et al. (2017), we take pre-trained features from the conv4 layer ResNet-101 model (He et al., 2016), giving 1024-dimensional features for a $1 4 \mathrm { x } 1 4$ image grid. We apply dropout, and project these representations to size $d$ using a 1x1 convolution, followed by batch normalisation (Ioffe & Szegedy, 2015) and a ReLU activation (Nair & Hinton, 2010). We then use 2 blocks of $3 { \tt X } 3$ convolutions, batch normalisation and ReLUs, and concatenate the final representation with a 32-dimensional positional encoding.
|
| 81 |
+
|
| 82 |
+
# 2.4 ANSWER PRIOR
|
| 83 |
+
|
| 84 |
+
We found modelling $p ( a | c )$ , the distribution over answers given the context, to be straightforward.
|
| 85 |
+
|
| 86 |
+
On SQUAD, we concatenate the start and end representations of the answer-independent context representation, combine them with a single hidden layer of size $2 d$ and ReLU activation, and project this representation down to a score $s ^ { \mathrm { e n d p o i n t s } } ( a , c )$ . We also add an additional score based only on the length of the answer $s ^ { \mathrm { l e n g t h } } ( a )$ . Finally, we calculate: $\begin{array} { r } { p ( a | c ) = \frac { \exp { ( s ^ { \mathrm { e n d p o i n t s } } ( a , c ) + s ^ { \mathrm { l e n g t h } } ( a ) ) } } { \sum _ { a ^ { \prime } } \exp { ( s ^ { \mathrm { e n d p o i n t s } } ( a ^ { \prime } , c ) + s ^ { \mathrm { l e n g t h } } ( a ^ { \prime } ) ) } } } \end{array}$
|
| 87 |
+
|
| 88 |
+
On CLEVR, we simply apply a fully connected layer of size $2 d$ and ReLU activation to the image representation, followed by a projection to the space of all possible answers and a softmax.
|
| 89 |
+
|
| 90 |
+

|
| 91 |
+
Figure 3: Architecture of GQA decoder. Multiple inputs to a layer indicates concatenation. Blocks after the first are connected with an additional residual connection, and LSTM cells also receive their state at time $t - 1$ as an input.
|
| 92 |
+
|
| 93 |
+
# 2.5 QUESTION DECODER
|
| 94 |
+
|
| 95 |
+
We generate question words left-to-right with teacher forcing. We first embed words independently of the context (§2.5.1), then use a multi-layer RNN with attention to model interactions between the question and context $( \ S 2 . 5 . 2 )$ , and finally compute the likelihood of the next word (§2.5.3).
|
| 96 |
+
|
| 97 |
+
# 2.5.1 INPUT WORD EMBEDDINGS
|
| 98 |
+
|
| 99 |
+
To represent SQUAD question words independently of the answer and document, we use a pretrained left-to-right language model (which can be viewed as a uni-directional version of ELMo), followed by a trainable LSTM layer of size $d$ . On CLEVR, we simply train embeddings of size $d$ .
|
| 100 |
+
|
| 101 |
+
# 2.5.2 DECODER BLOCKS
|
| 102 |
+
|
| 103 |
+
Decoder blocks are composed of a question self-attention layer (Vaswani et al., 2017) and a questionto-context attention mechanism, which are combined and fed into an LSTM (Figure 3). The context attention query is computed using both the previous layer state and the self-attention value. Blocks after the first are connected with residual connections.
|
| 104 |
+
|
| 105 |
+
Our attention mechanisms are implemented as in Vaswani et al., except that we use a single-headed attention, and a bias term $b _ { j }$ is added to the query-key score for context position $j$ . This bias term (calculated as a dot product of a shared trainable vector and context encoding $c _ { j }$ ) allows the model to easily filter out parts of the context which are irrelevant to the question.
|
| 106 |
+
|
| 107 |
+
A final block again uses self-attention and question-to-document attention, which are then combined with a Gated Linear Unit layer (Dauphin et al., 2017) to output a vector of size $d$ . The GLU layer uses a gating mechanism to select the relevant information for predicting the subsequent word.
|
| 108 |
+
|
| 109 |
+
# 2.5.3 OUTPUT WORD PROBABILITIES
|
| 110 |
+
|
| 111 |
+
Rare words are more challenging for generative than discriminative models, because it is easier to guess the meaning of a rare word from morphological clues than to generate it. SQUAD contains many rare words, because of the specialised vocabulary in Wikipedia. We improve modelling of rare words using a combination of an approximate character-based softmax and copy mechanism.
|
| 112 |
+
|
| 113 |
+
Word Softmax The simplest approach is to learn an embedding per word, replacing infrequent words with an unknown token. This approach cannot discriminate between different rare words. We use this method on CLEVR, which has a small vocabulary.
|
| 114 |
+
|
| 115 |
+

|
| 116 |
+
Figure 4: Final layer attention maps and word probabilities during question generation on a CLEVR validation question, when predicting the highlighted word. (1) The model considers all the rubber objects for predicting the next word. (2) Objects to the left of a rubber object are considered. (3) It describes the brown cylinder. (4, 5) Word distributions show the model understands the next words, but interestingly its attention focuses on the set of two objects meeting the constraints. In all cases, the word probability distributions are heavily skewed towards semantically valid choices.
|
| 117 |
+
|
| 118 |
+
Character Softmax While there is an infinite space of possible output words, we approximate it by only normalising over the union of a list of frequent words, and any additional word that appears in any question or any document in the batch. We build a character-based representation for each candidate word using the pre-trained character CNN from $\ S 2 . 2$ , and add a trainable linear projection to size $d$ . We combine character-based and word-based representations by summation.
|
| 119 |
+
|
| 120 |
+
Pointer Mechanism We use a pointer mechanism (Vinyals et al., 2015) to improve the likelihood of the specialised vocabulary present in SQUAD, by copying article words. From the final hidden state $h _ { t }$ , the model first chooses whether to copy using a simple classifier $p ^ { \mathrm { c o p y } } ( h ) = \sigma ( w ^ { \mathrm { c o p y } } \cdot h ) .$ , where $w ^ { \mathrm { c o p y } }$ is a trainable vector of size $d$ . Then, the model interpolates between generating a word with softmax $p ^ { \mathrm { g e n } } ( h )$ and copying context word $c _ { i }$ using the question-to-context attention probability from the final layer $\dot { \alpha } _ { t } ^ { i }$ : $p ( q _ { t } \vert \mathbf { \bar { q } } _ { 0 : t - 1 } , c , a ) = p ^ { \mathrm { c o p y } } ( h _ { t } ) \sum _ { i } \alpha _ { t } ^ { i } \hat { \mathbb { 1 } } _ { c _ { i } = q _ { t } } + ( 1 - p ^ { \mathrm { c o p y } } ( h _ { t } ) ) p ^ { \mathrm { g e n } } \mathbf { \bar { ( } } q _ { t } | h _ { t } )$
|
| 121 |
+
|
| 122 |
+
# 2.6 FINE TUNING
|
| 123 |
+
|
| 124 |
+
Generative training using teacher forcing means that the model is not exposed to negative combinations of questions and answers at training time, so performance on these combinations may be weak when used for inference. For example, the model can overfit as a language model on questions, and ignore dependencies to the answer. Results can be improved by fine-tuning the model to make the question more likely under the gold answer than other plausible answers. Here, we minimize $- \log \frac { p ( q | a , c ) p ( a | \bar { c } ) } { \sum _ { a ^ { \prime } \in A } p ( q | a ^ { \prime } , c ) p ( a ^ { \prime } | c ) }$ , where $A$ is the most likely 100 answer candidates from $p ( a | c )$ . The model performs poorly when trained using only this loss function, suggesting that generative pretraining allows the model to establish complex dependencies between the input and output, which can then be calibrated discriminatively (Table 2).
|
| 125 |
+
|
| 126 |
+
# 2.7 INFERENCE
|
| 127 |
+
|
| 128 |
+
We return the answer $a ^ { * }$ maximizing $a ^ { * } = \mathrm { a r g m a x } _ { a } p ( q | a , c ) p ( a | c )$ , which requires evaluating the likelihood of the given question under each possible answer.
|
| 129 |
+
|
| 130 |
+
To efficiently handle the large number of possible answers in SQUAD, we use beam search. We evaluate $p ( a | c )$ for all possible answer spans up to length 30, take the top 250 candidates, and only evaluate $p ( q | a , c )$ for each of these. A correct answer is contained in the beam for over $9 8 . 5 \%$ o f validation questions, suggesting that approximate inference is not a major cause of errors.
|
| 131 |
+
|
| 132 |
+
Table 1: Exact Match (EM) and F1 on SQUAD, comparing to the best published single models at the time of submission (September 2018).
|
| 133 |
+
|
| 134 |
+
<table><tr><td rowspan="2">Single Model</td><td colspan="2">Development</td><td colspan="2">Test</td></tr><tr><td>EM</td><td>F1</td><td>EM</td><td>F1</td></tr><tr><td>RaSOR (Lee et al., 2016)</td><td>66.4</td><td>74.9</td><td>67.4</td><td>75.5</td></tr><tr><td>BiDAF (Seo et al., 2016)</td><td>67.7</td><td>77.3</td><td>68.0</td><td>77.3</td></tr><tr><td>DrQA (Chen et al., 2017)</td><td>69.5</td><td>78.8</td><td>70.7</td><td>79.3</td></tr><tr><td>R-Net (Wang et al., 2017)</td><td>71.1</td><td>79.5</td><td>72.3</td><td>80.7</td></tr><tr><td>Weaver (Raison et al., 2018)</td><td>74.1</td><td>82.4</td><td>74.4</td><td>82.8</td></tr><tr><td>DCN+ (Xiong et al., 2017)</td><td>74.5</td><td>83.1</td><td>75.1</td><td>83.1</td></tr><tr><td>QANet + data augmentation x3 (Yu et al., 2018)</td><td>75.1</td><td>83.8</td><td>76.2</td><td>84.6</td></tr><tr><td>BiDAF + Self Attention + ELMo (Peters et al., 2018)</td><td>=</td><td>85.6</td><td>78.6</td><td>85.8</td></tr><tr><td>Reinforced Mnemonic Reader (Hu et al., 2018)</td><td>78.9</td><td>86.3</td><td>79.5</td><td>86.6</td></tr><tr><td>GQA</td><td>76.8</td><td>83.7</td><td>77.1</td><td>83.9</td></tr></table>
|
| 135 |
+
|
| 136 |
+
Table 2: Development results on SQUAD for model ablations.
|
| 137 |
+
|
| 138 |
+
<table><tr><td>Single Model</td><td>Exact Match</td><td>F1</td></tr><tr><td>GQA</td><td>76.8</td><td>83.7</td></tr><tr><td>GQA (no fine-tuning)</td><td>72.3</td><td>80.1</td></tr><tr><td>GQA (no generative training)</td><td>64.5</td><td>72.2</td></tr><tr><td>GQA (no character-based softmax)</td><td>74.3</td><td>81.4</td></tr><tr><td>GQA (no pointer mechanism)</td><td>71.9</td><td>79.7</td></tr><tr><td>GQA (no answer-dependent context representation)</td><td>72.2</td><td>79.7</td></tr><tr><td>GQA (answer prior only)</td><td>13.4</td><td>16.1</td></tr></table>
|
| 139 |
+
|
| 140 |
+
# 3 EXPERIMENTS
|
| 141 |
+
|
| 142 |
+
# 3.1 LARGE-SCALE READING COMPREHENSION
|
| 143 |
+
|
| 144 |
+
We evaluate our model (GQA) on the SQUAD dataset to test its robustness to diverse syntactic and lexical inferences. Results are shown in Table 1, and are competitive with comparable discriminative models, despite several years of incremental progress on discriminative architectures for this task. These results show the potential of generative models for such tasks.
|
| 145 |
+
|
| 146 |
+
Higher results have been reported using techniques such as ensembles, data augmentation, reinforcement learning with the end-task metric a reward, and breakthroughs in unsupervised pre-training.
|
| 147 |
+
|
| 148 |
+
Table 2 shows several ablations. It demonstrates the importance of the character-based softmax and pointer mechanism for modelling rare words, the need to model interactions between the answer and context, and a large improvement from fine-tuning the model with negative question-answer pairs.
|
| 149 |
+
|
| 150 |
+
The ablations also highlight that while fine-tuning the model with a discriminative objective substantially improves the results, performance is weak when trained discriminatively from scratch. This result suggests that generative training is learning additional relationships, but can benefit from being calibrated and exposed to negative question-answer pairs during fine tuning.
|
| 151 |
+
|
| 152 |
+
Table 3 shows an ablation study for the number of answer candidates considered in the beam of possible answers at inference time. Considering a larger number of answer candidates improves results, but increases the computational cost as the likelihood of the question must be calculated for each candidate.
|
| 153 |
+
|
| 154 |
+
# 3.2 MULTIHOP REASONING
|
| 155 |
+
|
| 156 |
+
We evaluate the ability of our model to perform multihop reasoning on the CLEVR dataset, which consists of images paired with automatically generated questions involving that test visual reasoning.
|
| 157 |
+
|
| 158 |
+
Table 4 shows that GQA achieves an accuracy of $9 7 . 7 \%$ , compared to $7 6 . 6 \%$ for a standard visual QA model, demonstrating that our generative architecture can perform complex reasoning. Integrat
|
| 159 |
+
|
| 160 |
+
Table 3: Development results on SQUAD, varying the beam size during inference.
|
| 161 |
+
|
| 162 |
+
<table><tr><td>#Answer Candidates</td><td>Exact Match</td><td>F1</td></tr><tr><td>250</td><td>76.8</td><td>83.7</td></tr><tr><td>200</td><td>76.6</td><td>83.4</td></tr><tr><td>100</td><td>76.2</td><td>83.1</td></tr><tr><td>50</td><td>74.6</td><td>81.4</td></tr><tr><td>10</td><td>55.7</td><td>61.4</td></tr></table>
|
| 163 |
+
|
| 164 |
+
Table 4: Test results on CLEVR, demonstrating high accuracy at complex reasoning. GQA is the first approach to achieve high performance on both CLEVR and broad coverage QA tasks.
|
| 165 |
+
|
| 166 |
+
<table><tr><td>Single Model</td><td>Overall</td><td>Count</td><td>Exist</td><td>Compare Numbers</td><td>Query Attribute</td><td>Compare Attribute</td></tr><tr><td>Human</td><td>92.6</td><td>86.7</td><td>96.6</td><td>86.5</td><td>95.0</td><td>96.0</td></tr><tr><td>CNN+LSTM</td><td>52.3</td><td>43.7</td><td>65.2</td><td>67.1</td><td>49.3</td><td>53.0</td></tr><tr><td>CNN+LSTM+SA</td><td>76.6</td><td>64.4</td><td>82.7</td><td>77.4</td><td>82.6</td><td>75.4</td></tr><tr><td>CNN+LSTM+RN</td><td>95.5</td><td>90.1</td><td>97.8</td><td>93.6</td><td>97.9</td><td>97.1</td></tr><tr><td>CNN+GRU+FiLM</td><td>97.6</td><td>94.3</td><td>99.3</td><td>93.4</td><td>99.3</td><td>99.3</td></tr><tr><td>MAC</td><td>98.9</td><td>97.1</td><td>99.5</td><td>99.1</td><td>99.5</td><td>99.5</td></tr><tr><td>GQA</td><td>97.7</td><td>94.9</td><td>98.3</td><td>97.0</td><td>99.2</td><td>99.2</td></tr></table>
|
| 167 |
+
|
| 168 |
+
ing MAC cells (Hudson & Manning, 2018) into our decoder or FiLM layers (Perez et al., 2018) into our encoder would be straightforward, and may improve results, but we avoid these techniques to emphasise that generative decoding alone allows multihop reasoning.
|
| 169 |
+
|
| 170 |
+
Figure 4 shows an example of how the model decomposes the reasoning over the question. It initially pays attention to all shapes, but updates its attention mask after new words are read.
|
| 171 |
+
|
| 172 |
+
# 3.3 LEARNING FROM BIASED DATA
|
| 173 |
+
|
| 174 |
+
Many popular QA datasets are well known to contain biases that models can exploit. Examples include when questions paired with paragraphs that contain a single date. Models can exploit biases by learning simple heuristics such as selecting answers based on the expected answer type (Weissenborn et al., 2017; Rondeau & Hazen, 2018). Recent work has attempted to remove some biases (Goyal et al., 2017; Rajpurkar et al., 2018); we instead attempt to make training robust to bias.
|
| 175 |
+
|
| 176 |
+
We create deliberately biased training subsets of SQUAD based on named entity types: numbers, dates, and people. To construct each training set, we select questions whose answer is one of these types, but that type only appears once in the document (e.g. Figure 1b). The validation set is created from questions whose answers are the named entity type, but there must be multiple occurrences of that type in the document. Each training and validation set contains rougly 1000 questions.
|
| 177 |
+
|
| 178 |
+
We compare our model to two strong discriminative models, BiDAF (Seo et al., 2016) and QANet3 (Yu et al., 2018). We also report three question agnostic baselines: a random answer of the correct type, the first answer of the correct type, and the GQA answer prior distribtion.
|
| 179 |
+
|
| 180 |
+
Results are shown in Table 5, and show that discriminatively trained models perform similarly to question-agnostic baselines. In contrast, our generative model learns to generalise meaningfully even from highly biased data, because it is trained to explain the whole question, not simply to answer it—demonstrating that on some QA tasks, there are clear advantages to generative modelling.
|
| 181 |
+
|
| 182 |
+
# 3.4 ADVERSARIAL EVALUATION
|
| 183 |
+
|
| 184 |
+
We evaluate on an adversarial version of the SQUAD dataset (Jia & Liang, 2017), which was created by adding a distractor sentence to each paragraph that can almost answer the question.
|
| 185 |
+
|
| 186 |
+
Table 5: Exact Match (EM) and F1 on biased subsets of SQUAD. All answers in each subset have the indicated named-entity type; training documents have only one answer with this type, but for testing there are multiple plausible answers. Discriminative models perform comparably to questionagnostic baselines, whereas our generative model learns to generalise.
|
| 187 |
+
|
| 188 |
+
<table><tr><td rowspan="2">Single Model</td><td colspan="2">Numbers</td><td colspan="2">Dates</td><td colspan="2">People</td></tr><tr><td>EM</td><td>F1</td><td>EM</td><td>F1</td><td>EM</td><td>F1</td></tr><tr><td>Random Selection First Occurrence</td><td>19.37 29.36</td><td>26.18 35.11</td><td>19.37 34.64</td><td>26.18</td><td>19.37</td><td>26.18</td></tr><tr><td>BiDAF</td><td>33.02</td><td>42.14</td><td>35.41</td><td>42.08 43.83</td><td>26.38 30.05</td><td>32.26 37.28</td></tr><tr><td>QANet</td><td>31.99</td><td>40.58</td><td>39.98</td><td>47.82</td><td>30.26</td><td>38.56</td></tr><tr><td>GQA (answer prior only)</td><td>37.15</td><td>45.54</td><td>35.55</td><td>43.85</td><td>32.56</td><td>38.79</td></tr><tr><td>GQA</td><td>58.49</td><td>67.56</td><td>64.71</td><td>72.51</td><td>53.09</td><td>61.93</td></tr></table>
|
| 189 |
+
|
| 190 |
+
Table 6: F1 scores on ADVERSARIALSQUAD (from September 2018), which demonstrate that our generative QA model is substantially more robust to this adversary than previous work, likely because the additional adversarial context sentence cannot explain all the question words.
|
| 191 |
+
|
| 192 |
+
<table><tr><td>Single Model</td><td>ADDSENT</td><td>ADDONESENT</td></tr><tr><td>BiDAF (Seo et al.,2016)</td><td>34.3</td><td>45.7</td></tr><tr><td>RaSOR (Lee et al., 2016)</td><td>39.5</td><td>49.5</td></tr><tr><td>MPCM (Wang et al., 2016)</td><td>40.3</td><td>50.0</td></tr><tr><td>ReasoNet (Shen etal., 2017)</td><td>39.4</td><td>50.3</td></tr><tr><td>Reinforced Mnemonic Reader (Hu et al., 2018)</td><td>46.6</td><td>56.0</td></tr><tr><td>QANet (Yu et al., 2018)</td><td>45.2</td><td>55.7</td></tr><tr><td>GQA</td><td>47.3</td><td>57.8</td></tr></table>
|
| 193 |
+
|
| 194 |
+
Table 6 shows that GQA outperforms the best previous work by up to $2 . 1 \ \mathrm { F 1 }$ , making it the most robust model to these adversarial attacks. The improvement may be due to the model’s attempt to explain all question words, some of which may be unlikely under the distractor (Figure 2).
|
| 195 |
+
|
| 196 |
+
# 3.5 LONG CONTEXT QUESTION ANSWERING
|
| 197 |
+
|
| 198 |
+
Finally, we extend our generative model to answering questions in a more challenging, multiparagraph setting. While we train on single paragraphs, our model can be used to answer questions with multi-paragraph context. During training, our model $p ( q \mid a , c )$ depends only on the content of the paragraph $c$ containing the correct answer $a$ . In contrast, discriminative models need to be trained to discriminate against all negative answers from all paragraphs.
|
| 199 |
+
|
| 200 |
+
We use the multi-paragraph SQUAD dataset of Raison et al. (2018), where each question is paired with the entire corresponding Wikipedia article. For each question, we calculate $p ( q \mid a ) s ( a , c )$ for the proposed answer span $a$ produced by the model, where $s ( a , c )$ is the logits from the answer prior classifier. The maximum value across all paragraphs of that article is selected as the answer for that question. Table 7 shows that GQA outperforms previous work on this task by $2 . 5 \ : \mathrm { F 1 }$ . Further, discriminative models such as DrQA and Weaver require training in the multi-paragraph setting to perform well, which is expensive and may not scale to longer contexts. However, our generative approach performs well in the multi-paragraph test setting but only requires single paragraph training.
|
| 201 |
+
|
| 202 |
+
# 4 RELATED WORK
|
| 203 |
+
|
| 204 |
+
Our model is inspired by the classic noisy channel translation models of Brown et al. (1993), more recently explored by Yu et al. (2016), which were motivated by the ease of incorporating a prior over outputs. Generative models have been widely used in other language classification tasks, such as sequence tagging (Brants, 2000) and parsing (Collins, 1997; Dyer et al., 2016). Generative classification models became less popular because of the difficulty of modelling the input (Sutton & McCallum, 2012), a challenge we embrace as an additional learning signal. Recent work has shown the effectiveness of generative pre-training on unlabelled data (Peters et al., 2018; Radford et al., 2018), we show additional gains from training generatively on labelled data.
|
| 205 |
+
|
| 206 |
+
Table 7: F1 scores on full document evaluation for SQUAD, which show our generative QA model is capable of selecting the correct paragraph for question answering even when presented with other similar paragraphs. Baselines are from (Raison et al., 2018).
|
| 207 |
+
|
| 208 |
+
<table><tr><td>Single Model EM F1</td></tr><tr><td>DrQA* trained on paragraph 59.1 67.0 Weaver trained on paragraph 60.6 69.7</td></tr><tr><td>DrQA* trained on documents 64.7 73.2</td></tr><tr><td>Weaver trained on documents 67.0 75.9 GQA trained on paragraph 71.4 78.4</td></tr></table>
|
| 209 |
+
|
| 210 |
+
Several studies have explored the relationship between question answering and question generation. Duan et al. (2017) and Tang et al. (2017) train answering and generation models with separate parameters, but add a regularisation term that encourages the models to be consistent. They focus on answer sentence selection, so performance cannot easily be compared with our work. Tang et al. (2018) use question generation to provide an additional loss to improve question answering systems using GAN-like training. Li et al. (2017) apply similar techniques to visual QA. Our work differs in training a single model for the joint distribution of questions and answers, which can be used to calculate conditional distributions for question generation or answering. Sachan & Xing (2018) improve performance by generating new question-answer pairs for training from unlabelled text, which would be a possible extension to our work. Echihabi & Marcu (2003) describe an earlier method for answering questions in terms of the distribution of questions given answers—one conceptual difference is that their approach does not include a prior over answers.
|
| 211 |
+
|
| 212 |
+
Question generation has also been studied as a task in its own right. Heilman & Smith (2010) use a rule-based system to generate candidate questions, followed by statistical ranking. Du et al. (2017) use a sequence-to-sequence model that encodes paragraph and sentence level information to generate questions. Cardie & Du (2018) propose using a coreference mechanism to incorporate contextual information from multiple sentences. Liu et al. (2017) explore question generation from images, which they refer to as Inverse Visual QA. Yuan et al. (2017) fine-tune a question generation model using reinforcement learning, based on fluency and whether it can be answered. Although we train a question generation model, our focus is on using it to answer questions.
|
| 213 |
+
|
| 214 |
+
# 5 CONCLUSION
|
| 215 |
+
|
| 216 |
+
We introduced a generative model for question answering, which leverages the greater amount of information in questions than answers to achieve high performance in both language comprehension and reasoning. The approach demonstrates better robustness to biased training data and adversarial testing data than state-of-the-art discriminative models. There are numerous interesting directions for future work, such as combining information about an entity from multiple sources to generate questions. Given the rapid progress made on discriminative QA models in recent years, we believe there is significant potential for further improvements in generative question answering.
|
| 217 |
+
|
| 218 |
+
# REFERENCES
|
| 219 |
+
|
| 220 |
+
Aishwarya Agrawal, Jiasen Lu, Stanislaw Antol, Margaret Mitchell, C. Lawrence Zitnick, Devi Parikh, and Dhruv Batra. Vqa: Visual question answering. Int. J. Comput. Vision, 123(1):4–31, May 2017. ISSN 0920-5691. URL https://doi.org/10.1007/ s11263-016-0966-6.
|
| 221 |
+
|
| 222 |
+
Thorsten Brants. TnT: a statistical part-of-speech tagger. In Proceedings of the sixth conference on Applied natural language processing, pp. 224–231. Association for Computational Linguistics, 2000.
|
| 223 |
+
|
| 224 |
+
Peter F. Brown, Stephen Della Pietra, Vincent J. Della Pietra, and Robert L. Mercer. The mathematics of statistical machine translation: Parameter estimation. Computational Linguistics, 19(2): 263–311, 1993.
|
| 225 |
+
|
| 226 |
+
Claire Cardie and Xinya Du. Harvesting paragraph-level question-answer pairs from wikipedia. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics, ACL 2018, Melbourne, Australia, July 15-20, 2018, Volume 1: Long Papers, pp. 1907–1917, 2018. URL https://aclanthology.info/papers/P18-1177/p18-1177.
|
| 227 |
+
|
| 228 |
+
Ciprian Chelba, Tomas Mikolov, Mike Schuster, Qi Ge, Thorsten Brants, Phillipp Koehn, and Tony Robinson. One billion word benchmark for measuring progress in statistical language modeling. In INTERSPEECH 2014, 15th Annual Conference of the International Speech Communication Association, Singapore, September 14-18, 2014, pp. 2635–2639, 2014. URL http://www. isca-speech.org/archive/interspeech_2014/i14_2635.html.
|
| 229 |
+
|
| 230 |
+
Danqi Chen, Adam Fisch, Jason Weston, and Antoine Bordes. Reading wikipedia to answer opendomain questions. arXiv preprint arXiv:1704.00051, 2017.
|
| 231 |
+
|
| 232 |
+
Michael Collins. Three generative, lexicalised models for statistical parsing. In 35th Annual Meeting of the Association for Computational Linguistics and 8th Conference of the European Chapter of the Association for Computational Linguistics, Proceedings of the Conference, 7-12 July 1997, Universidad Nacional de Educacion a Distancia (UNED), Madrid, Spain. ´ , pp. 16–23, 1997. URL http://aclweb.org/anthology/P/P97/P97-1003.pdf.
|
| 233 |
+
|
| 234 |
+
Yann N. Dauphin, Angela Fan, Michael Auli, and David Grangier. Language modeling with gated convolutional networks. In Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, pp. 933–941, 2017. URL http://proceedings.mlr.press/v70/dauphin17a.html.
|
| 235 |
+
|
| 236 |
+
Xinya Du, Junru Shao, and Claire Cardie. Learning to ask: Neural question generation for reading comprehension. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics, ACL 2017, Vancouver, Canada, July 30 - August 4, Volume 1: Long Papers, pp. 1342–1352, 2017. URL https://doi.org/10.18653/v1/P17-1123.
|
| 237 |
+
|
| 238 |
+
Nan Duan, Duyu Tang, Peng Chen, and Ming Zhou. Question generation for question answering. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, EMNLP 2017, Copenhagen, Denmark, September 9-11, 2017, pp. 866–874, 2017. URL https: //aclanthology.info/papers/D17-1090/d17-1090.
|
| 239 |
+
|
| 240 |
+
Chris Dyer, Adhiguna Kuncoro, Miguel Ballesteros, and Noah A. Smith. Recurrent neural network grammars. In NAACL HLT 2016, The 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, San Diego California, USA, June 12-17, 2016, pp. 199–209, 2016. URL http://aclweb.org/anthology/N/ N16/N16-1024.pdf.
|
| 241 |
+
|
| 242 |
+
Abdessamad Echihabi and Daniel Marcu. A noisy-channel approach to question answering. In Proceedings of the 41st Annual Meeting of the Association for Computational Linguistics, 7- 12 July 2003, Sapporo Convention Center, Sapporo, Japan., pp. 16–23, 2003. URL http: //aclweb.org/anthology/P/P03/P03-1003.pdf.
|
| 243 |
+
|
| 244 |
+
Yarin Gal and Zoubin Ghahramani. A theoretically grounded application of dropout in recurrent neural networks. In Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pp. 1019–1027, 2016.
|
| 245 |
+
|
| 246 |
+
Yash Goyal, Tejas Khot, Douglas Summers-Stay, Dhruv Batra, and Devi Parikh. Making the V in VQA matter: Elevating the role of image understanding in visual question answering. In 2017 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2017, Honolulu, HI, USA, July 21-26, 2017, pp. 6325–6334, 2017. URL https://doi.org/10.1109/CVPR.2017. 670.
|
| 247 |
+
|
| 248 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2016, Las Vegas, NV, USA, June 27-30, 2016, pp. 770–778, 2016. URL https://doi.org/10.1109/ CVPR.2016.90.
|
| 249 |
+
|
| 250 |
+
Luheng He, Kenton Lee, Omer Levy, and Luke Zettlemoyer. Jointly predicting predicates and arguments in neural semantic role labeling. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics, ACL 2018, Melbourne, Australia, July 15-20, 2018, Volume 2: Short Papers, pp. 364–369, 2018. URL https://aclanthology.info/papers/ P18-2058/p18-2058.
|
| 251 |
+
|
| 252 |
+
Michael Heilman and Noah A. Smith. Good question! statistical ranking for question generation. In Human Language Technologies: The 2010 Annual Conference of the North American Chapter of the Association for Computational Linguistics, HLT ’10, pp. 609–617. Association for Computational Linguistics, 2010. ISBN 1-932432-65-5. URL http://dl.acm.org/citation. cfm?id=1857999.1858085.
|
| 253 |
+
|
| 254 |
+
Minghao Hu, Yuxing Peng, Zhen Huang, Xipeng Qiu, Furu Wei, and Ming Zhou. Reinforced mnemonic reader for machine reading comprehension. In Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence, IJCAI 2018, July 13-19, 2018, Stockholm, Sweden., pp. 4099–4106, 2018. URL https://doi.org/10.24963/ijcai.2018/570.
|
| 255 |
+
|
| 256 |
+
Drew A. Hudson and Christopher D. Manning. Compositional attention networks for machine reasoning. CoRR, abs/1803.03067, 2018. URL http://arxiv.org/abs/1803.03067.
|
| 257 |
+
|
| 258 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, pp. 448–456, 2015. URL http://jmlr. org/proceedings/papers/v37/ioffe15.html.
|
| 259 |
+
|
| 260 |
+
Robin Jia and Percy Liang. Adversarial examples for evaluating reading comprehension systems. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, EMNLP 2017, Copenhagen, Denmark, September 9-11, 2017, pp. 2021–2031, 2017. URL https://aclanthology.info/papers/D17-1215/d17-1215.
|
| 261 |
+
|
| 262 |
+
Justin Johnson, Bharath Hariharan, Laurens van der Maaten, Li Fei-Fei, C. Lawrence Zitnick, and Ross B. Girshick. CLEVR: A diagnostic dataset for compositional language and elementary visual reasoning. In 2017 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2017, Honolulu, HI, USA, July 21-26, 2017, pp. 1988–1997, 2017. URL https://doi.org/ 10.1109/CVPR.2017.215.
|
| 263 |
+
|
| 264 |
+
Mandar Joshi, Eunsol Choi, Daniel S. Weld, and Luke Zettlemoyer. Triviaqa: A large scale distantly supervised challenge dataset for reading comprehension. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics, ACL 2017, Vancouver, Canada, July 30 - August 4, Volume 1: Long Papers, pp. 1601–1611, 2017. URL https://doi.org/10. 18653/v1/P17-1147.
|
| 265 |
+
|
| 266 |
+
Yoon Kim, Yacine Jernite, David Sontag, and Alexander M. Rush. Character-aware neural language models. In Proceedings of the Thirtieth AAAI Conference on Artificial Intelligence, February 12-17, 2016, Phoenix, Arizona, USA., pp. 2741–2749, 2016. URL http://www.aaai.org/ ocs/index.php/AAAI/AAAI16/paper/view/12489.
|
| 267 |
+
|
| 268 |
+
Kenton Lee, Tom Kwiatkowski, Ankur P. Parikh, and Dipanjan Das. Learning recurrent span representations for extractive question answering. CoRR, abs/1611.01436, 2016. URL http: //arxiv.org/abs/1611.01436.
|
| 269 |
+
|
| 270 |
+
Yikang Li, Nan Duan, Bolei Zhou, Xiao Chu, Wanli Ouyang, and Xiaogang Wang. Visual question generation as dual task of visual question answering. CoRR, abs/1709.07192, 2017. URL http: //arxiv.org/abs/1709.07192.
|
| 271 |
+
|
| 272 |
+
Feng Liu, Tao Xiang, Timothy M. Hospedales, Wankou Yang, and Changyin Sun. ivqa: Inverse visual question answering. CoRR, abs/1710.03370, 2017. URL http://arxiv.org/abs/ 1710.03370.
|
| 273 |
+
|
| 274 |
+
Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. CoRR, abs/1609.07843, 2016. URL http://arxiv.org/abs/1609.07843.
|
| 275 |
+
|
| 276 |
+
Vinod Nair and Geoffrey E. Hinton. Rectified linear units improve restricted boltzmann machines. In Proceedings of the 27th International Conference on Machine Learning (ICML-10), June 21- 24, 2010, Haifa, Israel, pp. 807–814, 2010. URL http://www.icml2010.org/papers/ 432.pdf.
|
| 277 |
+
|
| 278 |
+
Ethan Perez, Florian Strub, Harm de Vries, Vincent Dumoulin, and Aaron C. Courville. Film: Visual reasoning with a general conditioning layer. In Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence, New Orleans, Louisiana, USA, February 2-7, 2018, 2018. URL https://www.aaai.org/ocs/index.php/AAAI/AAAI18/paper/view/16528.
|
| 279 |
+
|
| 280 |
+
Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2018, New Orleans, Louisiana, USA, June 1-6, 2018, Volume 1 (Long Papers), pp. 2227–2237, 2018. URL https://aclanthology.info/ papers/N18-1202/n18-1202.
|
| 281 |
+
|
| 282 |
+
Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training. 2018. URL http://openai-assets.s3. amazonaws.com/research-covers/language-unsupervised/language_ understanding_paper.pdf.
|
| 283 |
+
|
| 284 |
+
Martin Raison, Pierre-Emmanuel Mazare, Rajarshi Das, and Antoine Bordes. Weaver: Deep co- ´ encoding of questions and documents for machine reading. arXiv preprint arXiv:1804.10490, 2018.
|
| 285 |
+
|
| 286 |
+
Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: 100, $0 0 0 +$ questions for machine comprehension of text. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, EMNLP 2016, Austin, Texas, USA, November 1-4, 2016, pp. 2383–2392, 2016. URL http://aclweb.org/anthology/D/D16/D16-1264.pdf.
|
| 287 |
+
|
| 288 |
+
Pranav Rajpurkar, Robin Jia, and Percy Liang. Know what you don’t know: Unanswerable questions for squad. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics, ACL 2018, Melbourne, Australia, July 15-20, 2018, Volume 2: Short Papers, pp. 784– 789, 2018. URL https://aclanthology.info/papers/P18-2124/p18-2124.
|
| 289 |
+
|
| 290 |
+
Marc-Antoine Rondeau and Timothy J. Hazen. Systematic error analysis of the stanford question answering dataset. In Proceedings of the Workshop on Machine Reading for Question Answering@ACL 2018, Melbourne, Australia, July 19, 2018, pp. 12–20, 2018. URL https: //aclanthology.info/papers/W18-2602/w18-2602.
|
| 291 |
+
|
| 292 |
+
Mrinmaya Sachan and Eric P. Xing. Self-training for jointly learning to ask and answer questions. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2018, New Orleans, Louisiana, USA, June 1-6, 2018, Volume 1 (Long Papers), pp. 629–640, 2018. URL https: //aclanthology.info/papers/N18-1058/n18-1058.
|
| 293 |
+
|
| 294 |
+
Min Joon Seo, Aniruddha Kembhavi, Ali Farhadi, and Hannaneh Hajishirzi. Bidirectional attention flow for machine comprehension. CoRR, abs/1611.01603, 2016. URL http://arxiv.org/ abs/1611.01603.
|
| 295 |
+
|
| 296 |
+
Yelong Shen, Po-Sen Huang, Jianfeng Gao, and Weizhu Chen. Reasonet: Learning to stop reading in machine comprehension. In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, Halifax, NS, Canada, August 13 - 17, 2017, pp. 1047–1055, 2017. URL http://doi.acm.org/10.1145/3097983.3098177.
|
| 297 |
+
|
| 298 |
+
Sainbayar Sukhbaatar, Arthur Szlam, Jason Weston, and Rob Fergus. End-to-end memory networks. In Advances in Neural Information Processing Systems 28: Annual Conference on Neural Information Processing Systems 2015, December 7-12, 2015, Montreal, Quebec, Canada, pp. 2440–2448, 2015. URL http://papers.nips.cc/paper/ 5846-end-to-end-memory-networks.
|
| 299 |
+
|
| 300 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V. Le. Sequence to sequence learning with neural networks. In Advances in Neural Information Processing Systems 27: Annual Conference on Neural Information Processing Systems 2014, December 8-13 2014, Montreal, Quebec, Canada, pp. 3104–3112, 2014. URL http://papers.nips.cc/paper/ 5346-sequence-to-sequence-learning-with-neural-networks.
|
| 301 |
+
|
| 302 |
+
Charles A. Sutton and Andrew McCallum. An introduction to conditional random fields. Foundations and Trends in Machine Learning, 4(4):267–373, 2012. URL https://doi.org/10. 1561/2200000013.
|
| 303 |
+
|
| 304 |
+
Duyu Tang, Nan Duan, Tao Qin, and Ming Zhou. Question answering and question generation as dual tasks. CoRR, abs/1706.02027, 2017. URL http://arxiv.org/abs/1706.02027.
|
| 305 |
+
|
| 306 |
+
Duyu Tang, Nan Duan, Zhao Yan, Zhirui Zhang, Yibo Sun, Shujie Liu, Yuanhua Lv, and Ming Zhou. Learning to collaborate for question answering and asking. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2018, New Orleans, Louisiana, USA, June 1-6, 2018, Volume 1 (Long Papers), pp. 1564–1574, 2018. URL https://aclanthology.info/papers/ N18-1141/n18-1141.
|
| 307 |
+
|
| 308 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, 4-9 December 2017, Long Beach, CA, USA, pp. 6000–6010, 2017. URL http: //papers.nips.cc/paper/7181-attention-is-all-you-need.
|
| 309 |
+
|
| 310 |
+
Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer networks. In Advances in Neural Information Processing Systems 28: Annual Conference on Neural Information Processing Systems 2015, December 7-12, 2015, Montreal, Quebec, Canada, pp. 2692–2700, 2015. URL http://papers.nips.cc/paper/5866-pointer-networks.
|
| 311 |
+
|
| 312 |
+
Wenhui Wang, Nan Yang, Furu Wei, Baobao Chang, and Ming Zhou. Gated self-matching networks for reading comprehension and question answering. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics, ACL 2017, Vancouver, Canada, July 30 - August 4, Volume 1: Long Papers, pp. 189–198, 2017. URL https://doi.org/10.18653/v1/ P17-1018.
|
| 313 |
+
|
| 314 |
+
Zhiguo Wang, Haitao Mi, Wael Hamza, and Radu Florian. Multi-perspective context matching for machine comprehension. CoRR, abs/1612.04211, 2016. URL http://arxiv.org/abs/ 1612.04211.
|
| 315 |
+
|
| 316 |
+
Dirk Weissenborn, Georg Wiese, and Laura Seiffe. Making neural QA as simple as possible but not simpler. In Proceedings of the 21st Conference on Computational Natural Language Learning (CoNLL 2017), Vancouver, Canada, August 3-4, 2017, pp. 271–280, 2017. URL https:// doi.org/10.18653/v1/K17-1028.
|
| 317 |
+
|
| 318 |
+
Caiming Xiong, Victor Zhong, and Richard Socher. $\mathrm { D C N + }$ : mixed objective and deep residual coattention for question answering. CoRR, abs/1711.00106, 2017. URL http://arxiv. org/abs/1711.00106.
|
| 319 |
+
|
| 320 |
+
Adams Wei Yu, David Dohan, Minh-Thang Luong, Rui Zhao, Kai Chen, Mohammad Norouzi, and Quoc V. Le. Qanet: Combining local convolution with global self-attention for reading comprehension. CoRR, abs/1804.09541, 2018. URL http://arxiv.org/abs/1804.09541.
|
| 321 |
+
|
| 322 |
+
Lei Yu, Phil Blunsom, Chris Dyer, Edward Grefenstette, and Tomas Kocisk ´ y. The neural noisy ´ channel. CoRR, abs/1611.02554, 2016. URL http://arxiv.org/abs/1611.02554.
|
| 323 |
+
|
| 324 |
+
Xingdi Yuan, Tong Wang, C¸ aglar Gulc¸ehre, Alessandro Sordoni, Philip Bachman, Saizheng Zhang, ¨ Sandeep Subramanian, and Adam Trischler. Machine comprehension by text-to-text neural question generation. In Proceedings of the 2nd Workshop on Representation Learning for NLP, Rep4NLP@ACL 2017, Vancouver, Canada, August 3, 2017, pp. 15–25, 2017. URL https: //aclanthology.info/papers/W17-2603/w17-2603.
|
| 325 |
+
|
| 326 |
+
Bolei Zhou, Yuandong Tian, Sainbayar Sukhbaatar, Arthur Szlam, and Rob Fergus. Simple baseline for visual question answering. CoRR, abs/1512.02167, 2015. URL http://arxiv.org/ abs/1512.02167.
|
| 327 |
+
|
| 328 |
+
# A TRAINING DETAILS
|
| 329 |
+
|
| 330 |
+
# A.1 SQUAD MODEL
|
| 331 |
+
|
| 332 |
+
Pre-processing Questions and answers were tokenized with a simple rule-based tokenizer. We ignored training examples whose answers did not correspond to words in our tokenization. We also found it helpful to append the article title as an additional sentence at the end of paragraphs, as frequently question words make use of an entity mentioned in the title that is not in the paragraph. Finally, we replace question words with similar words from the context (based on sharing word stems or low edit distance), which makes it easier for the model to explain rare words and typographical errors in questions by using the pointer mechanism.
|
| 333 |
+
|
| 334 |
+
Architecture The encoder contains 2 answer-independent LSTM layers and 3 answer-dependent LSTM layers, all of hidden size 128. The decoder contains 9 blocks, all with hidden size $d = 2 5 6$ . We apply dropout $( p = 0 . 5 5 )$ to contextualised word representations, after encoder LSTM layers and after each decoder block (before residual connects). We also used word level dropout after contextualised embeddings for each encoder $( p = 0 . 1 )$ ) and decoder word $( p = 0 . 2 5 )$ ), and disallow use of the pointer mechanism with $p = 0 . 2 5$ . All dropout masks are fixed across time-steps (Gal & Ghahramani, 2016).
|
| 335 |
+
|
| 336 |
+
Optimisation We train generatively with batches of 10 documents, using a cosine learning rate schedule with a period of 1 epoch, warming up over the first 5 epochs to a maximum learning rate of $1 0 ^ { - 4 }$ . During fine-tuning, we freeze the answer-independent context encoding and $p ( a | c )$ model, which both reduces memory requirements and makes learning more stable. If the correct answer is not in the beam, we make no update. Fine tuning uses stochastic gradient descent with single question batches, learning rate $5 * \bar { 1 } 0 ^ { - 5 }$ , and momentum 0.97.
|
| 337 |
+
|
| 338 |
+
# A.2 CLEVR MODEL
|
| 339 |
+
|
| 340 |
+
Architecture All hidden layers in the encoder have size 128. We use 3 blocks of convolution, batch normalisation, and ReLU activations. The first block uses a 1x1 convolution to project the pre-trained features to size 128, and the other blocks use 3x3 convolutions. We apply dropout with rate 0.1 to the pre-trained image features. In the decoder we use a dimension $d = 2 5 6$ with 6 decoder blocks, with dropout $\cdot p = 0 . 2 5 ,$ ) before residual connections.
|
| 341 |
+
|
| 342 |
+
Optimisation We optimise with stochastic gradient descent with momentum 0.9, with an initial learning rate of 0.025 which is decayed by a factor of 5 when there is no improvement for 10 epochs. For generative training we use batch size 1024. For fine tuning, we use initial learning rate 0.001 and batch size 32.
|
md/train/Bkxbrn0cYX/Bkxbrn0cYX.md
ADDED
|
@@ -0,0 +1,360 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SELFLESS SEQUENTIAL LEARNING
|
| 2 |
+
|
| 3 |
+
Rahaf Aljundi
|
| 4 |
+
KU Leuven
|
| 5 |
+
ESAT-PSI, Belgium
|
| 6 |
+
rahaf.aljundi@gmail.com
|
| 7 |
+
Tinne Tuytelaars
|
| 8 |
+
KU Leuven
|
| 9 |
+
ESAT-PSI, Belgium
|
| 10 |
+
tinne.tuytelaars@esat.kuleuven.be
|
| 11 |
+
|
| 12 |
+
# ABSTRACT
|
| 13 |
+
|
| 14 |
+
Sequential learning, also called lifelong learning, studies the problem of learning tasks in a sequence with access restricted to only the data of the current task. In this paper we look at a scenario with fixed model capacity, and postulate that the learning process should not be selfish, i.e. it should account for future tasks to be added and thus leave enough capacity for them. To achieve Selfless Sequential Learning we study different regularization strategies and activation functions. We find that imposing sparsity at the level of the representation (i.e. neuron activations) is more beneficial for sequential learning than encouraging parameter sparsity. In particular, we propose a novel regularizer, that encourages representation sparsity by means of neural inhibition. It results in few active neurons which in turn leaves more free neurons to be utilized by upcoming tasks. As neural inhibition over an entire layer can be too drastic, especially for complex tasks requiring strong representations, our regularizer only inhibits other neurons in a local neighbourhood, inspired by lateral inhibition processes in the brain. We combine our novel regularizer with state-of-the-art lifelong learning methods that penalize changes to important previously learned parts of the network. We show that our new regularizer leads to increased sparsity which translates in consistent performance improvement on diverse datasets.
|
| 15 |
+
|
| 16 |
+
# 1 INTRODUCTION
|
| 17 |
+
|
| 18 |
+
Sequential learning, also referred to as continual, incremental, or lifelong learning (LLL), studies the problem of learning a sequence of tasks, one at a time, without access to the training data of previous or future tasks. When learning a new task, a key challenge in this context is how to avoid catastrophic interference with the tasks learned previously (French, 1999; Li & Hoiem, 2016). Some methods exploit an additional episodic memory to store a small amount of previous tasks data to regularize future task learning (e.g. Lopez-Paz et al. (2017)). Others store previous tasks models and at test time, select one model or merge the models (Rusu et al., 2016; Aljundi et al., 2016; Lee et al., 2017). In contrast, in this work we are interested in the challenging situation of learning a sequence of tasks without access to any previous or future task data and restricted to a fixed model capacity, as also studied in Kirkpatrick et al. (2016); Aljundi et al. (2017); Fernando et al. (2017); Mallya & Lazebnik (2017); Serrà et al. (2018). This scenario not only has many practical benefits, including privacy and scalability, but also resembles more closely how the mammalian brain learns tasks over time.
|
| 19 |
+
|
| 20 |
+
The mammalian brain is composed of billions of neurons. Yet at any given time, information is represented by only a few active neurons resulting in a sparsity of $9 0 { - } 9 5 \%$ (Lennie, 2003). In neural biology, lateral inhibition describes the process where an activated neuron reduces the activity of its weaker neighbors. This creates a powerful decorrelated and compact representation with minimum interference between different input patterns in the brain (Yu et al., 2014). This is in stark contrast with artificial neural networks, which typically learn dense representations that are highly entangled (Bengio et al., 2009). Such an entangled representation is quite sensitive to changes in the input patterns, in that it responds differently to input patterns with only small variations. French (1999) suggests that an overlapped internal representation plays a crucial role in catastrophic forgetting and reducing this overlap would result in a reduced interference. Cogswell et al. (2015) show that when the amount of overfitting in a neural network is reduced, the representation correlation is also reduced. As such, learning a disentangled representation is more powerful and less vulnerable to catastrophic interference. However, if the learned disentangled representation at a given task is not sparse, only little capacity is left for the learning of new tasks. This would in turn result in either an underfitting to the new tasks or again a forgetting of previous tasks. In contrast, a sparse and decorrelated representation would lead to a powerful representation and at the same time enough free neurons that can be changed without interference with the neural activations learned for the previous tasks.
|
| 21 |
+
|
| 22 |
+

|
| 23 |
+
Figure 1: The difference between parameter sparsity (a) and representation sparsity (b) in a simple two tasks case. First layer indicates input patterns. Learning the first task utilizes parts indicated in red. Task 2 has different input patterns and uses parts shown in green. Orange indicates changed neurons activations as a result of the second task. In (a), when an example from the first task is encountered again, the activations of the first layer will not be affected by the changes, however, the second and later layer activations are changed. Such interference is largely reduced when imposing sparsity on the representation (b).
|
| 24 |
+
|
| 25 |
+
In general, sparsity in neural networks can be thought of either in terms of the network parameters or in terms of the representation (i.e., the activations). In this paper we postulate, and confirm experimentally, that a sparse and decorrelated representation is preferable over parameter sparsity in a sequential learning scenario. There are two arguments for this: first, a sparse representation is less sensitive to new and different patterns (such as data from new tasks) and second, the training procedure of the new tasks can use the free neurons leading to less interference with the previous tasks, hence reducing forgetting. In contrast, when the effective parameters are spread among different neurons, changing the ineffective ones would change the function of their corresponding neurons and hence interfere with previous tasks (see also Figure 1). Based on these observations, we propose a new regularizer that exhibits a behavior similar to the lateral inhibition in biological neurons. The main idea of our regularizer is to penalize neurons that are active at the same time. This leads to more sparsity and a decorrelated representation. However, complex tasks may actually require multiple active neurons in a layer at the same time to learn a strong representation. Therefore, our regularizer, Sparse coding through Local Neural Inhibition and Discounting (SLNID), only penalizes neurons locally. Furthermore, we don’t want inhibition to affect previously learned tasks, even if later tasks use neurons from earlier tasks. An important component of SLNID is thus to discount inhibition from/to neurons which have high neuron importance – a new concept that we introduce in analogy to parameter importance (Kirkpatrick et al., 2016; Zenke et al., 2017; Aljundi et al., 2017). When combined with a state-of-the-art important parameters preservation method (Aljundi et al., 2017; Kirkpatrick et al., 2016), our proposed regularizer leads to sparse and decorrelated representations which improves the lifelong learning performance.
|
| 26 |
+
|
| 27 |
+
Our contribution is threefold. First, we direct attention to Selfless Sequential Learning and study a diverse set of representation based regularizers, parameter based regularizers, as well as sparsity inducing activation functions to this end. These have not been studied extensively in the lifelong learning literature before. Second, we propose a novel regularizer, SLNID, which is inspired by lateral inhibition in the brain. Third, we show that our proposed regularizer consistently outperforms alternatives on three diverse datasets (Permuted MNIST, CIFAR, Tiny Imagenet) and we compare to and outperform state-of-the-art LLL approaches on an 8-task object classification challenge. SLNID can be applied to different regularization based LLL approaches, and we show experiments with MAS (Aljundi et al., 2017) and EWC (Kirkpatrick et al., 2016).
|
| 28 |
+
|
| 29 |
+
In the following, we first discuss related approaches to LLL and different regularization criteria from a LLL perspective (Section 2). We proceed by introducing Selfless Sequential Learning and detailing our novel regularizer (Section 3). Section 4 describes our experimental evaluation, while Section 5 concludes the paper.
|
| 30 |
+
|
| 31 |
+
# 2 RELATED WORK
|
| 32 |
+
|
| 33 |
+
The goal in lifelong learning is to learn a sequence of tasks without catastrophic forgetting of previously learned ones (Thrun & Mitchell, 1995). One can identify different approaches to introducing lifelong learning in neural networks. Here, we focus on learning a sequence of tasks using a fixed model capacity, i.e. with a fixed architecture and fixed number of parameters. Under this setting, methods either follow a pseudo rehearsal approach, i.e. using the new task data to approximate the performance of the previous task (Li & Hoiem, 2016; Triki et al., 2017), or aim at identifying the important parameters used by the current set of tasks and penalizing changes to those parameters by new tasks (Kirkpatrick et al., 2016; Zenke et al., 2017; Aljundi et al., 2017; Chaudhry et al., 2018; Liu et al., 2018). To identify the important parameters for a given task, Elastic Weight Consolidation (Kirkpatrick et al., 2016) uses an approximation of the Fisher information matrix computed after training a given task. Liu et al. (2018) suggest a network reparameterization to obtain a better diagonal approximation of the Fisher Information matrix of the network parameters. Path Integral (Zenke et al., 2017) estimates the importance of the network parameters while learning a given task by accumulating the contribution of each parameter to the change in the loss. Chaudhry et al. (2018) suggest a KL-divergence based generalization of Elastic Weight Consolidation and Path Integral. Memory Aware Synapses (Aljundi et al., 2017) estimates the importance of the parameters in an online manner without supervision by measuring the sensitivity of the learned function to small perturbations on the parameters. This method is less sensitive to the data distribution shift, and a local version proposed by the authors resembles applying Hebb rule (Hebb, 2002) to consolidate the important parameters, making it more biologically plausible.
|
| 34 |
+
|
| 35 |
+
A common drawback of all the above methods is that learning a task could utilize a good portion of the network capacity, leaving few "free" neurons to be adapted by the new task. This in turn leads to inferior performance on the newly learned tasks or forgetting the previously learned ones, as we will show in the experiments. Hence, we study the role of sparsity and representation decorrelation in sequential learning. This aspect has not received much attention in the literature yet. Very recently, (Serrà et al., 2018) proposed to overcome catastrophic forgetting through learned hard attention masks for each task with L1 regularization imposed on the accumulated hard attention masks. This comes closer to our approach although we study and propose a regularization scheme on the learned representation.
|
| 36 |
+
|
| 37 |
+
The concept of reducing the representation overlap has been suggested before in early attempts towards overcoming catastrophic forgetting in neural networks (French, 1999). This has led to several methods with the goal of orthogonalizing the activations (French, 1992; 1994; Kruschke, 1992; 1993; Sloman & Rumelhart, 1992). However, these approaches are mainly designed for specific architectures and activation functions, which makes it hard to integrate them in recent neural network structures.
|
| 38 |
+
|
| 39 |
+
The sparsification of neural networks has mostly been studied for compression. SVD decomposition can be applied to reduce the number of effective parameters (Xue et al., 2013). However, there is no guarantee that the training procedure converges to a low rank weight matrix. Other works iterate between pruning and retraining of a neural network as a post processing step (Liu et al., 2015; Sun et al., 2016; Aghasi et al., 2017; Louizos et al., 2017). While compressing a neural network by removing parameters leads to a sparser neural network, this does not necessarily lead to a sparser representation. Indeed, a weight vector can be highly sparse but spread among the different neurons. This reduces the effective size of a neural network, from a compression point of view, but it would not be beneficial for later tasks as most of the neurons are already occupied by the current set of tasks. In our experiments, we show the difference between using a sparse penalty on the representation versus applying it to the weights.
|
| 40 |
+
|
| 41 |
+
# 3 SELFLESS SEQUENTIAL LEARNING
|
| 42 |
+
|
| 43 |
+
One of the main challenges in single model sequential learning is to have capacity to learn new tasks and at the same time avoid catastrophic forgetting of previous tasks as a result of learning new tasks. In order to prevent catastrophic forgetting, importance weight based methods such as EWC (Kirkpatrick et al., 2016) or MAS (Aljundi et al., 2017) introduce an importance weight $\Omega _ { k }$ for each parameter $\theta _ { k }$ in the network. While these methods differ in how to estimate the important parameters, all of them penalize changes to important parameters when learning a new task $T _ { n }$ using $L _ { 2 }$ penalty:
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
T _ { n } : \quad \operatorname* { m i n } _ { \theta } { \frac { 1 } { M } } \sum _ { m = 1 } ^ { M } { \mathcal { L } } ( y _ { m } , f ( x _ { m } , \theta ^ { n } ) ) + \lambda _ { \Omega } \sum _ { k } \Omega _ { k } ( \theta _ { k } ^ { n } - \theta _ { k } ^ { n - 1 } ) ^ { 2 }
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
where $\theta ^ { n - 1 } = \{ \theta _ { k } ^ { n - 1 } \}$ are the optimal parameters learned so far, i.e. before the current task. $\{ x _ { m } \}$ is the set of $M$ training inputs, with $\{ f ( x _ { m } , \theta ^ { n } ) \}$ and $\{ y _ { m } \}$ the corresponding predicted and desired outputs, respectively. $\lambda _ { \Omega }$ is a trade-off parameter between the new task objective $\mathcal { L }$ and the changes on the important parameters, i.e. the amount of forgetting.
|
| 50 |
+
|
| 51 |
+
In this work we introduce an additional regularizer $R _ { \mathrm { S S L } }$ which encourages sparsity in the activations $H _ { l } = \{ h _ { i } ^ { m } \}$ for each layer $l$ .
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
T _ { n } : \quad \operatorname* { m i n } _ { \theta } { \frac { 1 } { M } } \sum _ { m = 1 } ^ { M } { \mathcal { L } } ( y _ { m } , f ( x _ { m } , \theta ^ { n } ) ) + \lambda _ { \Omega } \sum _ { k } \Omega _ { k } ( \theta _ { k } ^ { n } - \theta _ { k } ^ { n - 1 } ) ^ { 2 } + \lambda _ { \mathrm { S S L } } \sum _ { l } R _ { \mathrm { S S L } } ( H _ { l } )
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
$\lambda _ { \mathrm { S S L } }$ and $\lambda _ { \Omega }$ are trade-off parameters that control the contribution of each term. When training the first task $\dot { n } = 1$ ), $\Omega _ { k } = 0$ .
|
| 58 |
+
|
| 59 |
+
# 3.1 SPARSE CODING THROUGH NEURAL INHIBITION (SNI)
|
| 60 |
+
|
| 61 |
+
Now we describe how we obtain a sparse and decorrelated representation. In the literature sparsity has been proposed by Glorot et al. (2011) to be combined with the rectifier activation function (ReLU) to control unbounded activations and to increase sparsity. They minimize the $L _ { 1 }$ norm of the activations (since minimizing the $L _ { 0 }$ norm is an NP hard problem). However, $L _ { 1 }$ norm imposes an equal penalty on all the active neurons leading to small activation magnitude across the network.
|
| 62 |
+
|
| 63 |
+
Learning a decorrelated representation has been explored before with the goal of reducing overfitting. This is usually done by minimizing the Frobenius norm of the covariance matrix corrected by the diagonal, as in Cogswell et al. (2015) or Xiong et al. (2016). Such a penalty results in a decorrelated representation but with activations that are mostly close to a non zero mean value. We merge the two objectives of sparse and decorrelated representation resulting in the following objective:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
R _ { \mathrm { S N I } } ( H _ { l } ) = \frac { 1 } { M } \sum _ { i , j } \sum _ { m } h _ { i } ^ { m } h _ { j } ^ { m } , \quad i \neq j
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where we consider a hidden layer $l$ with activations $H _ { l } = \{ h _ { i } ^ { m } \}$ for a set of inputs $X = \{ x _ { m } \}$ and $i , j \in { 1 , . . , N }$ running over all $N$ neurons in the hidden layer. This formula differs from minimizing the Frobenius norm of the covariance matrix in two simple yet important aspects:
|
| 70 |
+
|
| 71 |
+
(1) In the case of a ReLU activation function, used in most modern architectures, a neuron is active if its output is larger than zero, and zero otherwise. By assuming a close to zero mean of the activations, $\mu _ { i } \simeq 0 \forall i \in { 1 , . . , N }$ , we minimize the correlation between any two active neurons.
|
| 72 |
+
|
| 73 |
+
(2) By evaluating the derivative of the presented regularizer w.r.t. the activation, we get:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\frac { \partial { R _ { \mathrm { S N I } } ( H _ { l } ) } } { \partial { h _ { i } ^ { m } } } = \frac { 1 } { M } \sum _ { j \neq i } { h _ { j } ^ { m } }
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
i.e., each active neuron receives a penalty from every other active neuron that corresponds to that other neuron’s activation magnitude. In other words, if a neuron fires, with a high activation value, for a given example, it will suppress firing of other neurons for that same example. Hence, this results in a decorrelated sparse representation.
|
| 80 |
+
|
| 81 |
+
# 3.2 SPARSE CODING THROUGH LOCAL NEURAL INHIBITION (SLNI)
|
| 82 |
+
|
| 83 |
+
The loss imposed by the SNI objective will only be zero when there is at most one active neuron per example. This seems to be too harsh for complex tasks that need a richer representation. Thus, we suggest to relax the objective by imposing a spatial weighting to the correlation penalty. In other words, an active neuron penalizes mostly its close neighbours and this effect vanishes for neurons further away. Instead of uniformly penalizing all the correlated neurons, we weight the correlation penalty between two neurons with locations $i$ and $j$ using a Gaussian weighting. This gives
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
R _ { \mathrm { S L N I } } ( H _ { l } ) = \frac { 1 } { M } \sum _ { i , j } e ^ { - \frac { ( i - j ) ^ { 2 } } { 2 \sigma ^ { 2 } } } \sum _ { m } h _ { i } ^ { m } h _ { j } ^ { m } , \quad i \neq j
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
As such, each active neuron inhibits its neighbours, introducing a locality in the network inspired by biological neurons. While the notion of neighbouring neurons is not well established in a fully connected network, our aim is to allow few neurons to be active and not only one, thus those few activations don’t have to be small to compensate for the penalty. $\sigma ^ { 2 }$ is a hyper parameter representing the scale at which neurons can affect each other. Note that this is somewhat more flexible than decorrelating neurons in fixed groups as used in Xiong et al. (2016). Our regularizer inhibits locally the active neurons leading to a sparse coding through local neural inhibition.
|
| 90 |
+
|
| 91 |
+
# 3.3 NEURON IMPORTANCE FOR DISCOUNTING INHIBITION
|
| 92 |
+
|
| 93 |
+
Our regularizer is to be applied for each task in the learning sequence. In the case of tasks with completely different input patterns, the active neurons of the previous tasks will not be activated given the new tasks input patterns. However, when the new tasks are of similar or shared patterns, neurons used for previous tasks will be active. In that case, our penalty would discourage other neurons from being active and encourage the new task to adapt the already active neurons instead. This would interfere with the previous tasks and could increase forgetting which is exactly what we want to overcome. To avoid such interference, we add a weight factor taking into account the importance of the neurons with respect to the previous tasks. To estimate the importance of the neurons, we use as a measure the sensitivity of the loss at the end of the training to their changes. This is approximated by the gradients of the loss w.r.t. the neurons outputs (before the activation function) evaluated at each data point. To get an importance value, we then accumulate the absolute value of the gradients over the given data points obtaining importance weight $\alpha _ { i }$ for neuron $n _ { i }$ :
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\alpha _ { i } = \frac { 1 } { M } \sum _ { m = 1 } ^ { M } \mid g _ { i } ( x _ { m } ) \mid , g _ { i } ( x _ { m } ) = \frac { \partial ( \mathcal { L } ( y _ { m } , f ( x _ { m } , \theta ^ { n } ) ) ) } { \partial n _ { i } ^ { m } }
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
where $n _ { i } ^ { m }$ is the output of neuron $n _ { i }$ for a given input example $x _ { m }$ , and $\theta ^ { n }$ are the parameters after learning task $n$ . This is in line with the estimation of the parameters importance in Kirkpatrick et al. (2016) but considering the derivation variables to be the neurons outputs instead of the parameters. Instead of relying on the gradient of the loss, we can also use the gradient of the learned function, i.e. the output layer, as done in Aljundi et al. (2017) for estimating the parameters importance. During the early phases of this work, we experimented with both and observed a similar behaviour. For sake of consistency and computational efficiency we utilize the gradient of the function when using Aljundi et al. (2017) as LLL method and the gradient of the loss when experimenting with EWC (Kirkpatrick et al., 2016). Then, we can weight our regularizer as follows:
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
R _ { \mathrm { S L N I D } } ( H _ { l } ) = \frac { 1 } { M } \sum _ { i , j } e ^ { - ( \alpha _ { i } + \alpha _ { j } ) } e ^ { - \frac { ( i - j ) ^ { 2 } } { 2 \sigma ^ { 2 } } } \sum _ { m } h _ { i } ^ { m } h _ { j } ^ { m } , \quad i \neq j
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
which can be read as: if an important neuron for a previous task is active given an input pattern from the current task, it will not suppress the other neurons from being active neither be affected by other active neurons. For all other active neurons, local inhibition is deployed. The final objective for training is given in Eq. 2, setting $R _ { S S L } : = R _ { \mathbb { S } \mathrm { L N I D } }$ and $\lambda _ { \mathrm { S S L } } : = \lambda _ { \mathrm { S L N I D } }$ . We refer to our full method as Sparse coding through Local Neural Inhibition and Discounting (SLNID).
|
| 106 |
+
|
| 107 |
+
# 4 EXPERIMENTS
|
| 108 |
+
|
| 109 |
+
In this section we study the role of standard regularization techniques with a focus on sparsity and decorrelation of the representation in a sequential learning scenario. We first compare different activation functions and regularization techniques, including our proposed SLNID, on permuted MNIST (Sec. 4.1). Then, we compare the top competing techniques and our proposed method in the case of sequentially learning CIFAR-100 classes and Tiny Imagenet classes (Sec. 4.2). Our SLNID regularizer can be integrated in any importance weight-based lifelong learning approach such as (Kirkpatrick et al., 2016; Zenke et al., 2017; Aljundi et al., 2017). Here we focus on Memory Aware Synapses (Aljundi et al., 2017) (MAS), which is easy to integrate and experiment with and has shown superior performance (Aljundi et al., 2017). However, we also show results with Elastic weight consolidation (Kirkpatrick et al., 2016)(EWC) in Sec. 4.3. Further, we ablate the components of our regularizer, both in the standard setting (Sec. 4.4) as in a setting without hard task boundaries (Sec. 4.5). Finally, we show how our regularizer improves the state-of-the-art performance on a sequence of object recognition tasks (Sec. 4.6).
|
| 110 |
+
|
| 111 |
+

|
| 112 |
+
Figure 2: Comparison of different regularization techniques on 5 permuted MNIST sequence. Representation based regularizers are solid bars, bars with lines represent parameters regularizers, dotted bars represent activation functions. Average test accuracy over all tasks is given in the legend. Representation based regularizers achieve higher performance than other compared methods including parameters based regularizers. Our regularizer, SLNID, performs the best on the last two tasks indicating that more capacity is left to learn these tasks.
|
| 113 |
+
|
| 114 |
+
# 4.1 AN IN-DEPTH COMPARISON OF REGULARIZERS AND ACTIVATION FUNCTIONS FOR SELFLESS SEQUENTIAL LEARNING
|
| 115 |
+
|
| 116 |
+
We study possible regularization techniques that could lead to less interference between the different tasks in a sequential learning scenario either by enforcing sparsity or decorrelation. Additionally, we examine the use of activation functions that are inspired by lateral inhibition in biological neurons that could be advantageous in sequential learning. MAS Aljundi et al. (2017) is used in all cases as LLL method.
|
| 117 |
+
|
| 118 |
+
# Representation Based methods:
|
| 119 |
+
|
| 120 |
+
- L1-Rep: To promote representational sparsity, an $L _ { 1 }$ penalty on the activations is used. - Decov (Cogswell et al., 2015) aims at reducing overfitting by decorrelating neuron activations. To do so, it minimizes the Frobenius norm of the covariance matrix computed on the activations of the current batch after subtracting the diagonal to avoid penalizing independent neuron activations.
|
| 121 |
+
|
| 122 |
+
# Activation functions:
|
| 123 |
+
|
| 124 |
+
- Maxout network (Goodfellow et al., 2013b) utilizes the maxout activation function. For each group of neurons, based on a fixed window size, only the maximum activation is forwarded to the next layer. The activation function guarantees a minimum sparsity rate defined by the window size.
|
| 125 |
+
|
| 126 |
+
- LWTA (Srivastava et al., 2013): similar idea to the Maxout network except that the non-maximum activations are set to zero while maintaining their connections. In contrast to Maxout, LWTA keeps the connections of the inactive neurons which can be occupied later once they are activated without changing the previously active neuron connections.
|
| 127 |
+
|
| 128 |
+
- ReLU (Glorot et al., 2011) The rectifier activation function (ReLU) used as a baseline here and indicated in later experiments as No-Reg as it represents the standard setting of sequential learning on networks with ReLU. All the studied regularizers use ReLU as activation function.
|
| 129 |
+
|
| 130 |
+
# Parameters based regularizers:
|
| 131 |
+
|
| 132 |
+
- OrthReg (Rodríguez et al., 2016): Regularizing CNNs with locally constrained decorrelations. It aims at decorrelating the feature detectors by minimizing the cosine of the angle between the weight vectors resulting eventually in orthogonal weight vectors.
|
| 133 |
+
|
| 134 |
+
- L2-WD: Weight decay with $L _ { 2 }$ norm (Krogh & Hertz, 1992) controls the complexity of the learned function by minimizing the magnitude of the weights.
|
| 135 |
+
|
| 136 |
+
- L1-Param: $L _ { 1 }$ penalty on the parameters to encourage a solution with sparse parameters.
|
| 137 |
+
|
| 138 |
+
Dropout is not considered as its role contradicts our goal. While dropout can improve each task performance and reduce overfitting, it acts as a model averaging technique. By randomly masking neurons, dropout forces the different neurons to work independently. As such it encourages a redundant representation. As shown by (Goodfellow et al., 2013a) the best network size for classifying MNIST digits when using dropout was about $5 0 \%$ more than without it. Dropout steers the learning of a task towards occupying a good portion of the network capacity, if not all of it, which contradicts the sequential learning needs.
|
| 139 |
+
|
| 140 |
+
Experimental setup. We use the MNIST dataset (LeCun et al., 1998) as a first task in a sequence of 5 tasks, where we randomly permute all the input pixels differently for tasks 2 to 5. The goal is to classify MNIST digits from all the different permutations. The complete random permutation of the pixels in each task requires the neural network to instantiate a new neural representation for each pattern. A similar setup has been used by Kirkpatrick et al. (2016); Zenke et al. (2017); Goodfellow et al. (2013a) with different percentage of permutations or different number of tasks.
|
| 141 |
+
|
| 142 |
+
As a base network, we employ a multi layer perceptron with two hidden layers and a Softmax loss.
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 3: Comparison of different regularization techniques on a sequence of ten tasks from (a) Cifar split and (b) Tiny ImageNet split. The legend shows average test accuracy over all tasks. Simple L1-norm regularizer (L1-Rep) doesn’t help in such more complex tasks. Our regularizer SLNID achieves an improvement of $2 \%$ over Decov and $4 - 8 \%$ compared to No-Reg.
|
| 146 |
+
|
| 147 |
+
We experiment with different number of neurons in the hidden layers $\{ 1 2 8 , 6 4 \}$ . For SLNID we evaluate the effect of $\lambda _ { { \mathrm { S I N I D } } }$ on the performance and the obtained sparsity in Figure 4. In general, the best $\lambda _ { { \mathrm { S I N I D } } }$ is the minimum value that maintains similar or better accuracy on the first task compared to the unregularized case, and we suggest to use this as a rule-of-thumb to set $\lambda _ { { \mathrm { S I N I D } } }$ . For $\lambda _ { \Omega }$ , we have used a high $\lambda _ { \Omega }$ value that ensures the least forgetting which allows us to test the effect on the later tasks performance. Note that better average accuracies can be obtained with tuned $\lambda _ { \Omega }$ . Please refer to Appendix A for hyperparameters and other details.
|
| 148 |
+
|
| 149 |
+
Results: Figure 2 presents the test accuracy on each task at the end of the sequence, achieved by the different regularizers and activation functions on the network with hidden layer of size 128. Results on a network with hidden layer size 64 are shown in the Appendix B. Clearly, in all the different tasks, the representational regularizers show a superior performance to the other studied techniques. For the regularizers applied to the parameters, $\mathbb { L } 2 - \mathbb { W } \mathbb { D }$ and L1-Param do not exhibit a clear trend and do not systematically show an improvement over the use of the different activation functions only. While OrthReg shows a consistently good performance, it is lower than what can be achieved by the representational regularizers. It is worth noting the L1-Rep yields superior performance over L1-Param. This observation is consistent across different sizes of the hidden layers (in Appendix B) and shows the advantage of encouraging sparsity in the activations compared to that in the parameters. Regarding the activation functions, Maxout and LWTA achieve a slightly higher performance than ReLU. We did not observe a significant difference between the two activation functions. However, the improvement over ReLU is only moderate and does not justify the use of a fixed window size and special architecture design. Our proposed regularizer SLNID achieves high if not the highest performance in all the tasks and succeeds in having a stable performance. This indicates the ability of SLNID to direct the learning process towards using minimum amount of neurons and hence more flexibility for upcoming tasks.
|
| 150 |
+
|
| 151 |
+
Representation sparsity $\pmb { \& }$ important parameter sparsity. Here we want to examine the effect of our regularizer on the percentage of parameters that are utilized after each task and hence the capacity left for the later tasks. On the network with hidden layer size 128, we compute the percentage of parameters with $\dot { \Omega _ { k } } < 1 0 ^ { - 2 }$ , with $\Omega _ { k }$ , see Appendix A, the importance weight multiplier estimated and accumulated over tasks. Those parameters can be seen as unimportant and "free" for later tasks. Figure 4(top) shows the percentage of the unimportant (free) parameters in the first layer after each task for different $\lambda _ { \mathrm { S I N I D } }$ values along with the achieved average test accuracy at the end of the sequence. It is clear that the larger $\lambda _ { { \mathrm { S I N I D } } }$ , i.e., the more neural inhibition, the smaller the percentage of important parameters. Apart from the highest $\lambda _ { { \mathrm { S I N I D } } }$ where tasks couldn’t reach their top performance due to too strong inhibition, improvement over the $\mathtt { N O - R e g }$ is always observed. The optimal value for lambda seems to be the one that remains close to the optimal performance on the current task, while utilizing the minimum capacity feasible. Next, we compute the average activation per neuron, in the first layer, over all the examples and plot the corresponding histogram for SLNID, DeCov, L1-Rep, L1-Param and $\mathtt { N O - R e g }$ in Figure 4(bottom) at their setting that yielded the results shown in Figure 2. SLNID has a peak at zero indicating representation sparsity while the other methods values are spread along the line. This seems to hint at the effectiveness of our approach SLNID in learning a sparse yet powerful representation and in turn in a minimal interference between tasks.
|
| 152 |
+
|
| 153 |
+

|
| 154 |
+
Figure 4: On the 5 permuted MNIST sequence, hidden layer ${ } = 1 2 8$ , Top: percentage of unused parameters in the 1st layer using different $\lambda _ { { \mathrm { S I N I D } } }$ ; Bottom: histogram of neural activations on the first task.
|
| 155 |
+
|
| 156 |
+
Table 1: SLNID ablation. Average test accuracy per task after training the last task in $\%$ . \* denotes that MultiTask Joint Training violates the LLL scenario as it has access to all tasks at once and thus can be seen as an upper bound.
|
| 157 |
+
|
| 158 |
+
<table><tr><td></td><td colspan="2">Permuted mnist</td><td colspan="2">Cifar</td></tr><tr><td>h-layer dim.</td><td>128</td><td>64</td><td>256</td><td>128</td></tr><tr><td>No-Reg</td><td>92.67</td><td>90.72</td><td>55.06</td><td>55.3</td></tr><tr><td>SNI</td><td>95.79</td><td>94.89</td><td>55.30</td><td>55.75</td></tr><tr><td>SNID</td><td>95.90</td><td>93.82</td><td>61.00</td><td>60.90</td></tr><tr><td>SLNI</td><td>95.95</td><td>94.87</td><td>56.06</td><td>55.79</td></tr><tr><td>SLNID</td><td>95.83</td><td>93.89</td><td>63.30</td><td>61.16</td></tr><tr><td>Multi-Task Joint Training*</td><td>97.30</td><td>96.80</td><td>70.99</td><td>71.95</td></tr></table>
|
| 159 |
+
|
| 160 |
+
Table 2: 8 tasks object recognition sequence. Average test accuracy per task after training the last task in $\%$ .
|
| 161 |
+
|
| 162 |
+
<table><tr><td>Method</td><td>Avg-acc</td></tr><tr><td>Finetune LWF (Li & Hoiem,2016)</td><td>32.67</td></tr><tr><td>EBLL (Triki et al., 2017)</td><td>49.49</td></tr><tr><td>IMM (Lee et al., 2017)</td><td>50.29</td></tr><tr><td></td><td>43.4</td></tr><tr><td>Path Integral (Zenke et al., 2017)</td><td>50.49</td></tr><tr><td>EWC (Kirkpatrick et al., 2016)</td><td>50.00</td></tr><tr><td>MAS (Aljundi et al.,2017)</td><td>52.69</td></tr><tr><td>SLNID-fc Pretrained (ours)</td><td>53.77</td></tr><tr><td>SLNID-fc randomly initialized (ours)</td><td>54.50</td></tr></table>
|
| 163 |
+
|
| 164 |
+
# 4.2 10 TASK SEQUENCES ON CIFAR-100 AND TINY IMAGENET
|
| 165 |
+
|
| 166 |
+
While the previous section focused on learning a sequence of tasks with completely different input patterns and same objective, we now study the case of learning different categories of one dataset. For this we split the CIFAR-100 and the Tiny ImageNet (Yao & Miller, 2015) dataset into ten tasks, respectively. We have 10 and 20 categories per task for CIFAR-100 and Tiny ImagNet, respectively. Further details about the experimental setup can be found in appendix A.
|
| 167 |
+
|
| 168 |
+
We compare the top competing methods from the previous experiments, L1-Rep, DeCov and our SLNID, and No-Reg as a baseline, ReLU in previous experiment. Similarly, MAS Aljundi et al. (2017) is used in all cases as LLL method. Figures 3(a) and 3(b) show the performance on each of the ten tasks at the end of the sequence. For both datasets, we observe that our SLNID performs overall best. $\mathtt { I 1 - R e p }$ and DeCov continue to improve over the non regularized case No-Reg. These results confirm our proposal on the importance of sparsity and decorrelation in sequential learning.
|
| 169 |
+
|
| 170 |
+
# 4.3 SLNID WITH EWC (KIRKPATRICK ET AL., 2016)
|
| 171 |
+
|
| 172 |
+
We have shown that our proposed regularizer SLNID exhibits stable and superior performance on the different tested networks when using MAS as importance weight preservation method. To prove the effectiveness of our regularizer regardless of the used importance weight based method, we have tested SLNID on the 5 tasks permuted MNIST sequence in combination with Elastic Weight Consolidation (EWC,Kirkpatrick et al. (2016)) and obtained a boost in the average performance at the end of the learned sequence equal to $3 . 1 \%$ on the network with hidden layer size 128 and a boost of $2 . 8 \%$ with hidden layer size 64. Detailed accuracies are shown in Appendix B. It is worth noting that with both MAS and EWC our SLNID was able obtain better accuracy using a network with a 64-dimensional hidden size than when training without regularization $\mathtt { N O - R e g }$ on a network of double that size (128), indicating that SLNID allows to use neurons much more efficiently.
|
| 173 |
+
|
| 174 |
+
# 4.4 ABLATION STUDY
|
| 175 |
+
|
| 176 |
+
Our method can be seen as composed of three components: the neural inhibition, the locality relaxation and the neuron importance integration. To study how these components perform individually, Table 1 reports the average accuracy at the end of the Cifar 100 and permuted MNIST sequences for each variant, namely, SNID without neuron importance (SNI), SNID, SLNID without neuron importance (SLNI) in addition to our full SLNID regularizer. As we explained in Section 3, when tasks have completely different input patterns, the neurons that were activated on the previous task examples will not fire for new task samples and exclusion of important neurons is not mandatory. However, when sharing is present between the different tasks, a term to prevent SLNID from causing any interference is required. This is manifested in the reported results: for permuted MNIST, all the variants work nicely alone, as a result of the simplicity and the disjoint nature of this sequence. However, in the Cifar 100 sequence, the integration of the neuron importance in the SNID and SLNID regularizers exclude important neurons from the inhibition, resulting in a clearly better performance. The locality in SLNID improves the performance in the Cifar sequence, which suggests that a richer representation is needed and multiple active neurons should be tolerated.
|
| 177 |
+
|
| 178 |
+
In the previous experiments, we considered the standard task based scenario as in (Li & Hoiem, 2016; Zenke et al., 2017; Aljundi et al., 2017; Serrà et al., 2018), where at each time step we receive a task along with its training data and a new classification layer is initiated for the new task, if needed. Here, we are interested in a more realistic scenario where the data distribution shifts gradually without hard task boundaries.
|
| 179 |
+
|
| 180 |
+
To test this setting, we use the Cifar 100 dataset. Instead of considering a set of 10 disjoint tasks each composed of 10 classes, as in the previous experiment (Sec. 4.2), we now start by sampling with high probability $( 2 / 3 )$ from the first 10 classes and with low probability $( 1 / 3 )$ from the rest of the classes. We train the network (same architecture as in Sec. 4.2) for a few epochs and then change the sampling probabilities to be high $( 2 / 3 )$ for classes $1 1 - 2 0$ and low $( 1 / 3 )$ for the remaining classes. This process is repeated until sampling with high probability from the last 10 classes and low from the rest. We use one shared classification layer throughout and estimate the importance weights and the neurons importance after each training step (before changing the sampling probabilities). We consider 6 variants: our SLNID, the ablations SLNI and without regularizer $\mathtt { N O - R e g }$ , as in Section 4.4, as well each of these three trained without the MAS importance weight regularizer of Aljundi et al. (2017), denoted as $\mathtt { w } / \mathtt { o }$ MAS. Table 3 presents the accuracy averaged over the ten groups of ten classes, using each group model (i.e. the model trained when this group was sampled with high probability) in the top block and the average accuracy on each of the ten groups at the end of the training (middle and bottom block). We can deduce the following: 1) SLNID improves the performance considerably (by more than $4 \%$ ) even without importance weight regularizer. 2) In this scenario without hard task boundaries there is less forgetting than in the scenario with hard task boundaries studied in Section 4.2 for Cifar (difference between rows in top block to corresponding rows in middle block). As a result, the improvement obtained by deploying the importance weight regularizer is moderate: at $7 0 . 7 5 \%$ , SLNID $\mathtt { w } / \mathtt { o }$ MAS is already better than $\mathtt { N O - R e g }$ reaching $6 6 . 3 3 \%$ . 3) While SLNI without MAS improves the individual models performance $( 7 2 . 1 4 \%$ compared to $6 9 . 2 0 \%$ ), it fails to improve the overall performance at the end of the sequence $6 3 . 5 4 \%$ compared to $6 5 . 1 5 \%$ ), as important neurons are not excluded from the penalty and hence they are changed or inhibited leading to tasks interference and performance deterioration.
|
| 181 |
+
|
| 182 |
+
Table 3: No tasks boundaries test case on Cifar 100. Top block, avg. acc on each group of classes using each group model. Bottom block, avg. acc. on each group at the end of the training.
|
| 183 |
+
|
| 184 |
+
<table><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>Avg.acc-tasks models</td></tr><tr><td rowspan=1 colspan=1>No-Reg w/o MASSLNI W/O MASSLNID W/O MASNo-RegSLNISLNID</td><td rowspan=1 colspan=1>69.20%72.14%73.03%66.88%71.32%72.33%</td></tr><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>Avg.acc-last model</td></tr><tr><td rowspan=1 colspan=1>No-Reg w/o MASSLNI W/O MASSLNID W/O MAS</td><td rowspan=1 colspan=1>65.15%63.54%70.75%</td></tr><tr><td rowspan=1 colspan=1>No-RegSLNISLNID</td><td rowspan=1 colspan=1>66.33%64.50%70.94%</td></tr></table>
|
| 185 |
+
|
| 186 |
+
# 4.6 COMPARISON WITH THE STATE OF THE ART
|
| 187 |
+
|
| 188 |
+
To compare our proposed approach with the different state-of-the-art sequential learning methods, we use a sequence of 8 different object recognition tasks, introduced in Aljundi et al. (2017). The sequence starts from AlexNet (Krizhevsky et al., 2012) pretrained on ImageNet (Russakovsky et al., 2015) as a base network, following the setting of Aljundi et al. (2017). More details are in Appendix A.4. We compare against the following: Learning without Forgetting (Li & Hoiem, 2016) (LwF), Incremental Moment Matching (Lee et al., 2017) (IMM), Path Integral (Zenke et al., 2017) and sequential finetuning (FineTuning), in addition to the case of MAS (Aljundi et al., 2017) alone, i.e. our No-Reg before. Compared methods were run with the exact same setup as in Aljundi et al. (2017). For our regularizer, we disable dropout, since dropout encourages redundant activations which contradicts our regularizer’s role. Also, since the network is pretrained, the locality introduced in SLNID may conflict with the already pretrained activations. For this reason, we also test SLNID with randomly initialized fully connected layers. Our regularizer is applied with MAS as a sequential learning method. Table 2 reports the average test accuracy at the end of the sequence achieved by each method. SLNID improves even when starting from a pretrained network and disabling dropout. Surprisingly, even with randomly initialized fully connected layers, SLNID improves $1 . 8 \%$ over the state of the art using a fully pretrained network.
|
| 189 |
+
|
| 190 |
+
# 5 CONCLUSION
|
| 191 |
+
|
| 192 |
+
In this paper we study the problem of sequential learning using a network with fixed capacity – a prerequisite for a scalable and computationally efficient solution. A key insight of our approach is that in the context of sequential learning (as opposed to other contexts where sparsity is imposed, such as network compression or avoiding overfitting), sparsity should be imposed at the level of the representation rather than at the level of the network parameters. Inspired by lateral inhibition in the mammalian brain, we impose sparsity by means of a new regularizer that decorrelates nearby active neurons. We integrate this in a model which learns selflessly a new task by leaving capacity for future tasks and at the same time avoids forgetting previous tasks by taking into account neurons importance.
|
| 193 |
+
|
| 194 |
+
Acknowledgment: The first author’s PhD is funded by an FWO scholarship.
|
| 195 |
+
|
| 196 |
+
# REFERENCES
|
| 197 |
+
|
| 198 |
+
Alireza Aghasi, Afshin Abdi, Nam Nguyen, and Justin Romberg. Net-trim: Convex pruning of deep neural networks with performance guarantee. In Advances in Neural Information Processing Systems, pp. 3180–3189, 2017.
|
| 199 |
+
|
| 200 |
+
Rahaf Aljundi, Punarjay Chakravarty, and Tinne Tuytelaars. Expert gate: Lifelong learning with a network of experts. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016.
|
| 201 |
+
|
| 202 |
+
Rahaf Aljundi, Francesca Babiloni, Mohamed Elhoseiny, Marcus Rohrbach, and Tinne Tuytelaars. Memory aware synapses: Learning what (not) to forget. arXiv preprint arXiv:1711.09601, 2017.
|
| 203 |
+
|
| 204 |
+
Yoshua Bengio et al. Learning deep architectures for ai. Foundations and trends $\textsuperscript { \textregistered }$ in Machine Learning, 2(1): 1–127, 2009.
|
| 205 |
+
|
| 206 |
+
Arslan Chaudhry, Puneet K Dokania, Thalaiyasingam Ajanthan, and Philip HS Torr. Riemannian walk for incremental learning: Understanding forgetting and intransigence. arXiv preprint arXiv:1801.10112, 2018.
|
| 207 |
+
|
| 208 |
+
Michael Cogswell, Faruk Ahmed, Ross Girshick, Larry Zitnick, and Dhruv Batra. Reducing overfitting in deep networks by decorrelating representations. arXiv preprint arXiv:1511.06068, 2015.
|
| 209 |
+
|
| 210 |
+
T. E. de Campos, B. R. Babu, and M. Varma. Character recognition in natural images. In Proceedings of the International Conference on Computer Vision Theory and Applications, Lisbon, Portugal, February 2009.
|
| 211 |
+
|
| 212 |
+
M. Everingham, L. Van Gool, C. K. I. Williams, J. Winn, and A. Zisserman. The PASCAL Visual Object Classes Challenge 2012 (VOC2012) Results. http://www.pascalnetwork.org/challenges/VOC/voc2012/workshop/index.html.
|
| 213 |
+
|
| 214 |
+
Chrisantha Fernando, Dylan Banarse, Charles Blundell, Yori Zwols, David Ha, Andrei A Rusu, Alexander Pritzel, and Daan Wierstra. Pathnet: Evolution channels gradient descent in super neural networks. arXiv preprint arXiv:1701.08734, 2017.
|
| 215 |
+
|
| 216 |
+
Robert M French. Semi-distributed representations and catastrophic forgetting in connectionist networks. Connection Science, 4(3-4):365–377, 1992.
|
| 217 |
+
|
| 218 |
+
Robert M French. Dynamically constraining connectionist networks to produce distributed, orthogonal representations to reduce catastrophic interference. network, 1111:00001, 1994.
|
| 219 |
+
|
| 220 |
+
Robert M French. Catastrophic forgetting in connectionist networks. Trends in cognitive sciences, 3(4):128–135, 1999.
|
| 221 |
+
|
| 222 |
+
Xavier Glorot, Antoine Bordes, and Yoshua Bengio. Deep sparse rectifier neural networks. In Geoffrey Gordon, David Dunson, and Miroslav Dudík (eds.), Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, volume 15 of Proceedings of Machine Learning Research, pp. 315–323, Fort Lauderdale, FL, USA, 11–13 Apr 2011. PMLR. URL http://proceedings.mlr.press/v15/ glorot11a.html.
|
| 223 |
+
|
| 224 |
+
Ian J Goodfellow, Mehdi Mirza, Da Xiao, Aaron Courville, and Yoshua Bengio. An empirical investigation of catastrophic forgetting in gradient-based neural networks. arXiv preprint arXiv:1312.6211, 2013a.
|
| 225 |
+
|
| 226 |
+
Ian J Goodfellow, David Warde-Farley, Mehdi Mirza, Aaron Courville, and Yoshua Bengio. Maxout networks. arXiv preprint arXiv:1302.4389, 2013b.
|
| 227 |
+
|
| 228 |
+
DO Hebb. The organization of behavior. 1949. New York Wiely, 2002.
|
| 229 |
+
|
| 230 |
+
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. arXiv preprint arXiv:1612.00796, 2016.
|
| 231 |
+
|
| 232 |
+
Jonathan Krause, Michael Stark, Jia Deng, and Li Fei-Fei. 3d object representations for fine-grained categorization. In Proceedings of the IEEE International Conference on Computer Vision Workshops, pp. 554–561, 2013.
|
| 233 |
+
|
| 234 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In F. Pereira, C. J. C. Burges, L. Bottou, and K. Q. Weinberger (eds.), Advances in Neural Information Processing Systems 25, pp. 1097–1105. Curran Associates, Inc., 2012.
|
| 235 |
+
|
| 236 |
+
Anders Krogh and John A Hertz. A simple weight decay can improve generalization. In Advances in neural information processing systems, pp. 950–957, 1992.
|
| 237 |
+
|
| 238 |
+
John K Kruschke. Alcove: an exemplar-based connectionist model of category learning. Psychological review, 99(1):22, 1992.
|
| 239 |
+
|
| 240 |
+
John K Kruschke. Human category learning: Implications for backpropagation models. Connection Science, 5 (1):3–36, 1993.
|
| 241 |
+
|
| 242 |
+
Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
|
| 243 |
+
|
| 244 |
+
Sang-Woo Lee, Jin-Hwa Kim, Jung-Woo Ha, and Byoung-Tak Zhang. Overcoming catastrophic forgetting by incremental moment matching. arXiv preprint arXiv:1703.08475, 2017.
|
| 245 |
+
|
| 246 |
+
Peter Lennie. The cost of cortical computation. Current biology, 13(6):493–497, 2003.
|
| 247 |
+
|
| 248 |
+
Zhizhong Li and Derek Hoiem. Learning without forgetting. In European Conference on Computer Vision, pp. 614–629. Springer, 2016.
|
| 249 |
+
|
| 250 |
+
Baoyuan Liu, Min Wang, Hassan Foroosh, Marshall Tappen, and Marianna Pensky. Sparse convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 806–814, 2015.
|
| 251 |
+
|
| 252 |
+
Xialei Liu, Marc Masana, Luis Herranz, Joost Van de Weijer, Antonio M Lopez, and Andrew D Bagdanov. Rotate your networks: Better weight consolidation and less catastrophic forgetting. arXiv preprint arXiv:1802.02950, 2018.
|
| 253 |
+
|
| 254 |
+
David Lopez-Paz et al. Gradient episodic memory for continual learning. In Advances in Neural Information Processing Systems, pp. 6470–6479, 2017.
|
| 255 |
+
|
| 256 |
+
Christos Louizos, Karen Ullrich, and Max Welling. Bayesian compression for deep learning. In Advances in Neural Information Processing Systems, pp. 3290–3300, 2017.
|
| 257 |
+
|
| 258 |
+
S. Maji, J. Kannala, E. Rahtu, M. Blaschko, and A. Vedaldi. Fine-grained visual classification of aircraft. Technical report, 2013.
|
| 259 |
+
|
| 260 |
+
Arun Mallya and Svetlana Lazebnik. Packnet: Adding multiple tasks to a single network by iterative pruning. arXiv preprint arXiv:1711.05769, 1(2):3, 2017.
|
| 261 |
+
|
| 262 |
+
Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. 2011.
|
| 263 |
+
|
| 264 |
+
M-E. Nilsback and A. Zisserman. Automated flower classification over a large number of classes. In Proceedings of the Indian Conference on Computer Vision, Graphics and Image Processing, Dec 2008.
|
| 265 |
+
|
| 266 |
+
Ariadna Quattoni and Antonio Torralba. Recognizing indoor scenes. In Computer Vision and Pattern Recognition, 2009. CVPR 2009. IEEE Conference on, pp. 413–420. IEEE, 2009.
|
| 267 |
+
|
| 268 |
+
Pau Rodríguez, Jordi Gonzalez, Guillem Cucurull, Josep M Gonfaus, and Xavier Roca. Regularizing cnns with locally constrained decorrelations. arXiv preprint arXiv:1611.01967, 2016.
|
| 269 |
+
|
| 270 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. International Journal of Computer Vision (IJCV), 115(3):211–252, 2015. doi: 10.1007/s11263-015-0816-y.
|
| 271 |
+
|
| 272 |
+
Andrei A Rusu, Neil C Rabinowitz, Guillaume Desjardins, Hubert Soyer, James Kirkpatrick, Koray Kavukcuoglu, Razvan Pascanu, and Raia Hadsell. Progressive neural networks. arXiv preprint arXiv:1606.04671, 2016.
|
| 273 |
+
Joan Serrà, Dídac Surís, Marius Miron, and Alexandros Karatzoglou. Overcoming catastrophic forgetting with hard attention to the task. arXiv preprint arXiv:1801.01423, 2018.
|
| 274 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 275 |
+
Steven A Sloman and David E Rumelhart. Reducing interference in distributed memories through episodic gating. Essays in honor of WK Estes, 1:227–248, 1992.
|
| 276 |
+
Rupesh K Srivastava, Jonathan Masci, Sohrob Kazerounian, Faustino Gomez, and Jürgen Schmidhuber. Compete to compute. In C. J. C. Burges, L. Bottou, M. Welling, Z. Ghahramani, and K. Q. Weinberger (eds.), Advances in Neural Information Processing Systems 26, pp. 2310–2318. Curran Associates, Inc., 2013. URL http://papers.nips.cc/paper/5059-compete-to-compute.pdf.
|
| 277 |
+
Yi Sun, Xiaogang Wang, and Xiaoou Tang. Sparsifying neural network connections for face recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4856–4864, 2016.
|
| 278 |
+
Sebastian Thrun and Tom M Mitchell. Lifelong robot learning. Robotics and autonomous systems, 15(1-2): 25–46, 1995.
|
| 279 |
+
Amal Rannen Triki, Rahaf Aljundi, Mathew B Blaschko, and Tinne Tuytelaars. Encoder based lifelong learning. arXiv preprint arXiv:1704.01920, 2017.
|
| 280 |
+
P. Welinder, S. Branson, T. Mita, C. Wah, F. Schroff, S. Belongie, and P. Perona. Caltech-UCSD Birds 200. Technical Report CNS-TR-2010-001, California Institute of Technology, 2010.
|
| 281 |
+
Wei Xiong, Bo Du, Lefei Zhang, Ruimin Hu, and Dacheng Tao. Regularizing deep convolutional neural networks with a structured decorrelation constraint. In ICDM, pp. 519–528, 2016.
|
| 282 |
+
Jian Xue, Jinyu Li, and Yifan Gong. Restructuring of deep neural network acoustic models with singular value decomposition. In Interspeech, pp. 2365–2369, 2013.
|
| 283 |
+
Leon Yao and John Miller. Tiny imagenet classification with convolutional neural networks. CS 231N, 2015.
|
| 284 |
+
Yuguo Yu, Michele Migliore, Michael L Hines, and Gordon M Shepherd. Sparse coding and lateral inhibition arising from balanced and unbalanced dendrodendritic excitation and inhibition. Journal of Neuroscience, 34 (41):13701–13713, 2014.
|
| 285 |
+
Friedemann Zenke, Ben Poole, and Surya Ganguli. Improved multitask learning through synaptic intelligence. In Proceedings of the International Conference on Machine Learning (ICML), 2017.
|
| 286 |
+
|
| 287 |
+
# APPENDIX
|
| 288 |
+
|
| 289 |
+
# A DETAILS ON THE EXPERIMENTAL SETUP
|
| 290 |
+
|
| 291 |
+
In all designed experiments, our regularizer is applied to the neurons of the fully connected layers. As a future work, we plan to integrate it in the convolutional layers.
|
| 292 |
+
|
| 293 |
+
# A.1 PERMUTED MNIST
|
| 294 |
+
|
| 295 |
+
The used network is composed of two fully connected layers. All tasks are trained for 10 epochs with a learning rate $1 0 ^ { - 2 }$ using SGD optimizer. ReLU is used as an activation function unless mentioned otherwise. Throughout the experiment, we used a scale $\sigma$ for the Gaussian function used for the local inhibition equal to $1 / 6$ of the hidden layer size. For all competing regularizers, we tested different hyper parameters from $\mathrm { i 0 ^ { - 2 } }$ to $\mathrm { i 0 ^ { - 9 } }$ and report the best one. For $\lambda _ { \Omega }$ , we have used a high $\lambda _ { \Omega }$ value that ensures the least forgetting. This allows us to examine the degradation in the performance on the later tasks compared to those learned previously as a result of lacking capacity. Note that better average accuracies can be obtained with tuned $\lambda _ { \Omega }$ .
|
| 296 |
+
|
| 297 |
+
In section 4.1 we estimated the free capacity in the network with the percentage of $\Omega _ { k } < 1 0 ^ { - 2 }$ , with $\Omega _ { k }$ , the importance weight multiplier estimated and accumulated over tasks. We consider $\Omega _ { k } < 1 0 ^ { - 2 }$ of negligible importanc as in a network trained without a sparsity regularizer, $\Omega _ { i j } < 1 0 ^ { - 2 }$ covers the first 10 percentiles.
|
| 298 |
+
|
| 299 |
+
# A.2 CIFAR-100
|
| 300 |
+
|
| 301 |
+
As a base network, we use a network similar to the one used by Zenke et al. (2017) but without dropout. We evaluate two variants with hidden size $N = \{ 2 5 6 , 1 2 8 \}$ . Throughout the experiment, we again used a scale $\sigma$ for the Gaussian function equal to $1 / 6$ of the hidden layer size. We train the different tasks for 50 epochs with a learning rate of $1 0 ^ { - 2 }$ using SGD optimizer.
|
| 302 |
+
|
| 303 |
+
# A.3 TINY IMAGENET
|
| 304 |
+
|
| 305 |
+
We split the Tiny ImageNet dataset (Yao & Miller, 2015) into ten tasks, each containing twenty categories to be learned at once. As a base network, we use a variant of VGG (Simonyan & Zisserman, 2014). For architecture details, please refer to Table 4 below.
|
| 306 |
+
|
| 307 |
+
Table 4: Architecture of the network used in the Tiny Imagenet experiment.
|
| 308 |
+
|
| 309 |
+
<table><tr><td>Layer</td><td>#filters/neurons</td></tr><tr><td>Convolution</td><td>64</td></tr><tr><td>Max Pooling</td><td>1</td></tr><tr><td>Convolution Max Pooling</td><td>128</td></tr><tr><td>Convolution</td><td>= 256</td></tr><tr><td>Max Pooling Convolution</td><td>-</td></tr><tr><td>Max Pooling</td><td>256 -</td></tr><tr><td>Convolution</td><td>512</td></tr><tr><td>Convolution</td><td>512</td></tr><tr><td>Fully connected</td><td>500</td></tr><tr><td>Fully connected</td><td>500</td></tr><tr><td>Fully connected</td><td>20</td></tr></table>
|
| 310 |
+
|
| 311 |
+
Throughout the experiment, we again used a scale $\sigma$ for the Gaussian function equal to $1 / 6$ of the hidden layer size.
|
| 312 |
+
|
| 313 |
+
# A.4 8 TASK OBJECT RECOGNITION SEQUENCE
|
| 314 |
+
|
| 315 |
+
The 8 tasks sequence is composed of: 1. Oxford Flowers (Nilsback & Zisserman, 2008), 2. MIT Scenes (Quattoni & Torralba, 2009), 3. Caltech-UCSD Birds (Welinder et al., 2010), 4. Stanford Cars (Krause et al., 2013); 5. FGVC-Aircraft (Maji et al., 2013); 6. VOC Actions (Everingham et al.); 7. Letters (de Campos et al., 2009); and 8. SVHN (Netzer et al., 2011) datasets. We have rerun the different methods and obtain the same reported results as in Aljundi et al. (2017).
|
| 316 |
+
|
| 317 |
+
# B EXTRA RESULTS
|
| 318 |
+
|
| 319 |
+
# B.1 PERMUTED MNIST SEQUENCE
|
| 320 |
+
|
| 321 |
+
In section 4.1, we have studied the performance of different regularizers and activation functions on 5 permuted Mnist tasks in a network with a hidden layer of size 128. Figure 5 shows the average accuracies achieved by each of the studied methods at the end of the learned sequence in a network with a hidden layer of size 64. Similar conclusions can be drawn. Maxout and LWTA perform similarly and improve slightly over ReLU. Regularizers applied to the representation are more powerful for sequential learning than regularizers applied directly to the parameters. Specifically, L1-Rep (orange) is consistently better than L1-Param (pink). Our SLNID is able of maintaining a good performance on all the tasks, achieving among the top average test accuracies. Admittedly, the performances of SLNID is very close to L1-Rep. The difference between these methods stands out more clearly for larger networks and more complex tasks.
|
| 322 |
+
|
| 323 |
+

|
| 324 |
+
Figure 5: Comparison of different regularization techniques on 5 permuted MNIST sequence of tasks, hidden siz $_ { = 6 4 }$ . Representation based regularizers are solid bars, bars with lines represent parameters regularizers, dotted bars represent activation functions. See Figure 2 for size 128.
|
| 325 |
+
|
| 326 |
+
# B.2 SLNI WITH EWC
|
| 327 |
+
|
| 328 |
+
To show that our approach is not limited to MAS (Aljundi et al., 2017), we have also experimented with EWC (Kirkpatrick et al., 2016) as another importance weight based method along with our regularize SLNID on the permuted Mnist sequence. Figure 6 shows the test accuracy of each task at the end of the 5 permuted Mnist sequence achieved by our SLNID combined with EWC and by No-Reg (here indicating EWC without regularization). It is clear that SLNID succeeds to improve the performance on all the learned tasks which validates the utility of our approach with different sequential learning methods.
|
| 329 |
+
|
| 330 |
+

|
| 331 |
+
Figure 6: (a) SLNID with EWC on 5 permuted Mnist sequence of tasks, hidden size ${ \mathrm { - } } 1 2 8$ , (b) hidden size $_ { = 6 4 }$
|
| 332 |
+
|
| 333 |
+
# B.3 CIFAR 100 SEQUENCE
|
| 334 |
+
|
| 335 |
+
In section 4.2 we have tested SLNID and other representation regularizers on the Cifar 100 sequence. In Figure 3(a) we compare their performance on a network with hidden layer size 256. Figure 7 repeats the same experiment for a network with hidden size 128. While DeCov and SLNID continue to improve over $\mathtt { N o - R e g }$ , L1-Rep seems to suffer in this case. Our interpretation is that L1-Rep here interferes with the previously learned tasks while penalizing activations and hence suffers from catastophic forgetting. In line with all the previous experiments SLNID achieves the best accuracies and manages here to improve over $6 \%$ compared to No-Reg.
|
| 336 |
+
|
| 337 |
+

|
| 338 |
+
Figure 7: Comparison of different regularization techniques on a sequence of ten tasks from Cifar split. Hidden size ${ = } 1 2 8$ . See Figure 3(a) for size 256.
|
| 339 |
+
|
| 340 |
+
# B.4 SPATIAL LOCALITY TEST
|
| 341 |
+
|
| 342 |
+
To avoid penalizing all the active neurons, our SLNID weights the correlation penalty between each two neurons based on their spatial distance using a Gaussian function. We want to visualize the effect of this spatial locality on the neurons activity. To achieve this, we have used the first 3 tasks of the Permuted Mnist sequence as a test case and visualized the neurons importance after each task. This is done using the network of hidden layer size 64. Figure 8, Figure 9 and Figure 10 show the neurons importance after each task. The left column is without locality, i.e. SLNID, and the right column is SLNID. Blue represents the first task, orange the second task and green the third task. When using SLNID, inhibition is applied in a local manner allowing more active neurons which could potentially improve the representation power. When learning the second task, new neurons become important regardless of their closeness to first task important neurons as those neurons are excluded from the inhibition. As such, new neurons are becoming active as new tasks are learned. For SLNID all neural correlation is penalized in the first task. And for later tasks, very few neurons are able to become active and important for the new task due to the strong global inhibition, where previous neurons that are excluded from the inhibition are easier to be re-used.
|
| 343 |
+
|
| 344 |
+

|
| 345 |
+
Figure 8: First layer neuron importance after learning the first task (blue). Left: SNID, Right: SLNID. More active neurons are tolerated in SLNID.
|
| 346 |
+
|
| 347 |
+

|
| 348 |
+
Figure 9: First layer neuron importance after learning the second task (orange), superimposed on Figure 8. Left: SNID, Right: SLNID. SLNID allows new neurons, especially those that were close neighbours to previous important neurons, to become active and to be used for the new task. SNID penalizes all unimportant neurons equally. As a result, previous neurons are adapted for the new tasks and less new neurons are getting activated.
|
| 349 |
+
|
| 350 |
+

|
| 351 |
+
Figure 10: First layer neuron importance after learning the third task (green), superimposed on Figure 9. Left: SNID, Right: SLNID. SLNID allows previous neurons to be re-used for the third task. It avoids changing the previous important neurons by adding new neurons. For SNID, very few neurons are newly deployed. The new task is learned mostly by adapting previous important neurons, causing more interference.
|
| 352 |
+
|
| 353 |
+

|
| 354 |
+
Figure 11: First layer neuron importance after learning the first task, sorted in descending order according to the first task neuron importance (blue). Left: SNID, Right: SLNID. More active neurons are tolerated in SLNID.
|
| 355 |
+
|
| 356 |
+

|
| 357 |
+
Figure 12: First layer neuron importance after learning the second task sorted in descending order according to the first task neuron importance (orange), superimposed on top of figure 11. Left: SNID, Right: SLNID. SLNID allows new neurons to become active and be used for the new task. SNID penalizes all unimportant neurons equally and hence more neurons are re-used then initiated for the first time.
|
| 358 |
+
|
| 359 |
+

|
| 360 |
+
Figure 13: First layer neuron importance after learning the third task sorted in descending order according to the first task neuron importance (green), superimposed on top of figure 12. Left: SNID, Right: SLNID. SLNID allows previous neurons to be re-used for the third task while activating new neurons to cope with the needs of the new task. For SNID, very few neurons are newly deployed while most previous important neurons for previous tasks are re-adapted to learn the new task.
|
md/train/ByMHvs0cFQ/ByMHvs0cFQ.md
ADDED
|
@@ -0,0 +1,672 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# QUATERNION RECURRENT NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Titouan Parcollet1,4, Mirco Ravanelli2, Mohamed Morchid1, Georges Linarès1, Chiheb Trabelsi2,5, Renato De Mori1,3, Yoshua Bengio2 ∗
|
| 4 |
+
|
| 5 |
+
1LIA, Université d’Avignon, France
|
| 6 |
+
2MILA, Université de Montréal, Québec, Canada
|
| 7 |
+
3McGill University, Québec, Canada
|
| 8 |
+
4Orkis, Aix-en-provence, France
|
| 9 |
+
5Element AI, Montréal, Québec, Canada
|
| 10 |
+
titouan.parcollet@alumni.univ-avignon.fr,
|
| 11 |
+
mirco.ravanelli@gmail.com,
|
| 12 |
+
firstname.lastname@univ-avignon.fr,
|
| 13 |
+
chiheb.trabelsi@polymtl.ca, rdemori@cs.mcgill.ca
|
| 14 |
+
|
| 15 |
+
# ABSTRACT
|
| 16 |
+
|
| 17 |
+
Recurrent neural networks (RNNs) are powerful architectures to model sequential data, due to their capability to learn short and long-term dependencies between the basic elements of a sequence. Nonetheless, popular tasks such as speech or images recognition, involve multi-dimensional input features that are characterized by strong internal dependencies between the dimensions of the input vector. We propose a novel quaternion recurrent neural network (QRNN), alongside with a quaternion long-short term memory neural network (QLSTM), that take into account both the external relations and these internal structural dependencies with the quaternion algebra. Similarly to capsules, quaternions allow the QRNN to code internal dependencies by composing and processing multidimensional features as single entities, while the recurrent operation reveals correlations between the elements composing the sequence. We show that both QRNN and QLSTM achieve better performances than RNN and LSTM in a realistic application of automatic speech recognition. Finally, we show that QRNN and QLSTM reduce by a maximum factor of $3 . 3 \mathrm { x }$ the number of free parameters needed, compared to real-valued RNNs and LSTMs to reach better results, leading to a more compact representation of the relevant information.
|
| 18 |
+
|
| 19 |
+
# 1 INTRODUCTION
|
| 20 |
+
|
| 21 |
+
In the last few years, deep neural networks (DNN) have encountered a wide success in different domains due to their capability to learn highly complex input to output mapping. Among the different DNN-based models, the recurrent neural network (RNN) is well adapted to process sequential data. Indeed, RNNs build a vector of activations at each timestep to code latent relations between input vectors. Deep RNNs have been recently used to obtain hidden representations of speech unit sequences (Ravanelli et al., 2018a) or text word sequences (Conneau et al., 2018), and to achieve state-of-the-art performances in many speech recognition tasks (Graves et al., 2013a;b; Amodei et al., 2016; Povey et al., 2016; Chiu et al., 2018). However, many recent tasks based on multi-dimensional input features, such as pixels of an image, acoustic features, or orientations of 3D models, require to represent both external dependencies between different entities, and internal relations between the features that compose each entity. Moreover, RNN-based algorithms commonly require a huge number of parameters to represent sequential data in the hidden space.
|
| 22 |
+
|
| 23 |
+
Quaternions are hypercomplex numbers that contain a real and three separate imaginary components, perfectly fitting to 3 and 4 dimensional feature vectors, such as for image processing and robot kinematics (Sangwine, 1996; Pei & Cheng, 1999; Aspragathos & Dimitros, 1998). The idea of bundling groups of numbers into separate entities is also exploited by the recent manifold and capsule networks (Chakraborty et al., 2018; Sabour et al., 2017). Contrary to traditional homogeneous representations, capsule and quaternion networks bundle sets of features together. Thereby, quaternion numbers allow neural network based models to code latent inter-dependencies between groups of input features during the learning process with fewer parameters than RNNs, by taking advantage of the Hamilton product as the equivalent of the ordinary product, but between quaternions. Early applications of quaternion-valued backpropagation algorithms (Arena et al., 1994; 1997) have efficiently solved quaternion functions approximation tasks. More recently, neural networks of complex and hypercomplex numbers have received an increasing attention (Hirose & Yoshida, 2012; Tygert et al., 2016; Danihelka et al., 2016; Wisdom et al., 2016), and some efforts have shown promising results in different applications. In particular, a deep quaternion network (Parcollet et al., 2016; 2017a;b), a deep quaternion convolutional network (Gaudet & Maida, 2018; Parcollet et al., 2018), or a deep complex convolutional network (Trabelsi et al., 2017) have been employed for challenging tasks such as images and language processing. However, these applications do not include recurrent neural networks with operations defined by the quaternion algebra.
|
| 24 |
+
|
| 25 |
+
This paper proposes to integrate local spectral features in a novel model called quaternion recurrent neural network1 (QRNN), and its gated extension called quaternion long-short term memory neural network (QLSTM). The model is proposed along with a well-adapted parameters initialization and turned out to learn both inter- and intra-dependencies between multidimensional input features and the basic elements of a sequence with drastically fewer parameters (Section 3), making the approach more suitable for low-resource applications. The effectiveness of the proposed QRNN and QLSTM is evaluated on the realistic TIMIT phoneme recognition task (Section 4.2) that shows that both QRNN and QLSTM obtain better performances than RNNs and LSTMs with a best observed phoneme error rate (PER) of $1 8 . 5 \%$ and $1 5 . 1 \%$ for QRNN and QLSTM, compared to $1 9 . 0 \%$ and $\bar { 1 } 5 . 3 \%$ for RNN and LSTM. Moreover, these results are obtained alongside with a reduction of 3.3 times of the number of free parameters. Similar results are observed with the larger Wall Street Journal (WSJ) dataset, whose detailed performances are reported in the Appendix 6.1.1.
|
| 26 |
+
|
| 27 |
+
# 2 MOTIVATIONS
|
| 28 |
+
|
| 29 |
+
A major challenge of current machine learning models is to well-represent in the latent space the astonishing amount of data available for recent tasks. For this purpose, a good model has to efficiently encode local relations within the input features, such as between the Red, Green, and Blue (R,G,B) channels of a single image pixel, as well as structural relations, such as those describing edges or shapes composed by groups of pixels. Moreover, in order to learn an adequate representation with the available set of training data and to avoid overfitting, it is convenient to conceive a neural architecture with the smallest number of parameters to be estimated. In the following, we detail the motivations to employ a quaternion-valued RNN instead of a real-valued one to code inter and intra features dependencies with fewer parameters.
|
| 30 |
+
|
| 31 |
+
As a first step, a better representation of multidimensional data has to be explored to naturally capture internal relations within the input features. For example, an efficient way to represent the information composing an image is to consider each pixel as being a whole entity of three strongly related elements, instead of a group of uni-dimensional elements that could be related to each other, as in traditional real-valued neural networks. Indeed, with a real-valued RNN, the latent relations between the RGB components of a given pixel are hardly coded in the latent space since the weight has to find out these relations among all the pixels composing the image. This problem is effectively solved by replacing real numbers with quaternion numbers. Indeed, quaternions are fourth dimensional and allow one to build and process entities made of up to four related features. The quaternion algebra and more precisely the Hamilton product allows quaternion neural network to capture these internal latent relations within the features encoded in a quaternion. It has been shown that QNNs are able to restore the spatial relations within 3D coordinates (Matsui et al., 2004), and within color pixels (Isokawa et al., 2003), while real-valued NN failed. This is easily explained by the fact that the quaternion-weight components are shared through multiple quaternion-input parts during the Hamilton product , creating relations within the elements. Indeed, Figure 1 shows that the multiple weights required to code latent relations within a feature are considered at the same level as for learning global relations between different features, while the quaternion weight $w$ codes these internal relations within a unique quaternion $Q _ { o u t }$ during the Hamilton product (right).
|
| 32 |
+
|
| 33 |
+

|
| 34 |
+
Figure 1: Illustration of the input features $( Q _ { i n } )$ latent relations learning ability of a quaternion-valued layer (right) due to the quaternion weight sharing of the Hamilton product (Eq. 5), compared to a standard real-valued layer (left).
|
| 35 |
+
|
| 36 |
+
Then, while bigger neural networks allow better performances, quaternion neural networks make it possible to deal with the same signal dimension but with four times less neural parameters. Indeed, a 4-number quaternion weight linking two 4-number quaternion units only has 4 degrees of freedom, whereas a standard neural net parametrization has $4 \times 4 = 1 6$ , i.e., a 4-fold saving in memory. Therefore, the natural multidimensional representation of quaternions alongside with their ability to drastically reduce the number of parameters indicate that hyper-complex numbers are a better fit than real numbers to create more efficient models in multidimensional spaces. Based on the success of previous deep quaternion convolutional neural networks and smaller quaternion feed-forward architectures (Kusamichi et al., 2004; Isokawa et al., 2009; Parcollet et al., 2017a), this work proposes to adapt the representation of hyper-complex numbers to the capability of recurrent neural networks in a natural and efficient framework to multidimensional sequential tasks such as speech recognition.
|
| 37 |
+
|
| 38 |
+
Modern automatic speech recognition systems usually employ input sequences composed of multidimensional acoustic features, such as log Mel features, that are often enriched with their first, second and third time derivatives (Davis & Mermelstein, 1990; Furui, 1986), to integrate contextual information. In standard RNNs, static features are simply concatenated with their derivatives to form a large input vector, without effectively considering that signal derivatives represent different views of the same input. Nonetheless, it is crucial to consider that time derivatives of the spectral energy in a given frequency band at a specific time frame represent a special state of a time-frame, and are linearly correlated (Tokuda et al., 2003). Based on the above motivations and the results observed on previous works about quaternion neural networks, we hypothesize that quaternion RNNs naturally provide a more suitable representation of the input sequence, since these multiple views can be directly embedded in the multiple dimensions space of the quaternion, leading to better generalization.
|
| 39 |
+
|
| 40 |
+
# 3 QUATERNION RECURRENT NEURAL NETWORKS
|
| 41 |
+
|
| 42 |
+
This Section describes the quaternion algebra (Section 3.1), the internal quaternion representation (Section 3.2), the backpropagation through time (BPTT) for quaternions (Section 3.3.2), and proposes an adapted weight initialization to quaternion-valued neurons (Section 3.4).
|
| 43 |
+
|
| 44 |
+
# 3.1 QUATERNION ALGEBRA
|
| 45 |
+
|
| 46 |
+
The quaternion algebra $\mathbb { H }$ defines operations between quaternion numbers. A quaternion Q is an extension of a complex number defined in a four dimensional space as:
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
Q = r 1 + x \mathbf { i } + y \mathbf { j } + z \mathbf { k } ,
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
where $r , x , y$ , and $z$ are real numbers, and 1, i, j, and $\mathbf { k }$ are the quaternion unit basis. In a quaternion, $r$ is the real part, while $x { \mathbf i } + y { \mathbf j } + z { \mathbf k }$ with $\mathbf { i } ^ { 2 } = \mathbf { j } ^ { 2 } = \mathbf { k } ^ { 2 } = \mathbf { i j } \mathbf { \bar { k } } = - 1$ is the imaginary part, or the vector part. Such a definition can be used to describe spatial rotations. The information embedded in the quaterion $Q$ can be summarized into the following matrix of real numbers:
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
Q _ { m a t } = \left[ \begin{array} { c c c c } { r } & { - x } & { - y } & { - z } \\ { x } & { r } & { - z } & { y } \\ { y } & { z } & { r } & { - x } \\ { z } & { - y } & { x } & { r } \end{array} \right] .
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
The conjugate $Q ^ { * }$ of $Q$ is defined as:
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
Q ^ { * } = r 1 - x \mathbf { i } - y \mathbf { j } - z \mathbf { k } .
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
Then, a normalized or unit quaternion $Q ^ { \triangleleft }$ is expressed as:
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
Q ^ { \triangleleft } = { \frac { Q } { \sqrt { r ^ { 2 } + x ^ { 2 } + y ^ { 2 } + z ^ { 2 } } } } .
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
Finally, the Hamilton product $\otimes$ between two quaternions $Q _ { 1 }$ and $Q _ { 2 }$ is computed as follows:
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\begin{array} { r } { Q _ { 1 } \otimes Q _ { 2 } = ( r _ { 1 } r _ { 2 } - x _ { 1 } x _ { 2 } - y _ { 1 } y _ { 2 } - z _ { 1 } z _ { 2 } ) + ( r _ { 1 } x _ { 2 } + x _ { 1 } r _ { 2 } + y _ { 1 } z _ { 2 } - z _ { 1 } y _ { 2 } ) i + } \\ { ( r _ { 1 } y _ { 2 } - x _ { 1 } z _ { 2 } + y _ { 1 } r _ { 2 } + z _ { 1 } x _ { 2 } ) j + ( r _ { 1 } z _ { 2 } + x _ { 1 } y _ { 2 } - y _ { 1 } x _ { 2 } + z _ { 1 } r _ { 2 } ) k . } \end{array}
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
The Hamilton product (a graphical view is depicted in Figure 1) is used in QRNNs to perform transformations of vectors representing quaternions, as well as scaling and interpolation between two rotations following a geodesic over a sphere in the $\mathbb { R } ^ { 3 }$ space as shown in (Minemoto et al., 2017).
|
| 77 |
+
|
| 78 |
+
# 3.2 QUATERNION REPRESENTATION
|
| 79 |
+
|
| 80 |
+
The QRNN is an extension of the real-valued (Medsker & Jain, 2001) and complex-valued (Hu & Wang, 2012; Song & Yam, 1998) recurrent neural networks to hypercomplex numbers. In a quaternion dense layer, all parameters are quaternions, including inputs, outputs, weights, and biases. The quaternion algebra is ensured by manipulating matrices of real numbers (Gaudet & Maida, 2018). Consequently, for each input vector of size $N$ , output vector of size $M$ , dimensions are split into four parts: the first one equals to $r$ , the second is $x \mathbf { i }$ , the third one equals to $y { \bf j }$ , and the last one to $z \mathbf { k }$ to compose a quaternion $Q = r 1 + x \mathbf { i } + y \mathbf { j } + z \mathbf { k }$ . The inference process of a fully-connected layer is defined in the real-valued space by the dot product between an input vector and a real-valued $M \times N$ weight matrix. In a QRNN, this operation is replaced with the Hamilton product (Eq. 5) with quaternion-valued matrices (i.e. each entry in the weight matrix is a quaternion). The computational complexity of quaternion-valued models is discussed in Appendix 6.1.2
|
| 81 |
+
|
| 82 |
+
# 3.3 LEARNING ALGORITHM
|
| 83 |
+
|
| 84 |
+
The QRNN differs from the real-valued RNN in each learning sub-processes. Therefore, let $x _ { t }$ be the input vector at timestep $t$ , $h _ { t }$ the hidden state, $W _ { h x }$ , $W _ { h y }$ and $W _ { h h }$ the input, output and hidden states weight matrices respectively. The vector $b _ { h }$ is the bias of the hidden state and $p _ { t } , y _ { t }$ are the output and the expected target vectors. More details of the learning process and the parametrization are available on Appendix 6.2.
|
| 85 |
+
|
| 86 |
+
# 3.3.1 FORWARD PHASE
|
| 87 |
+
|
| 88 |
+
Based on the forward propagation of the real-valued RNN (Medsker & Jain, 2001), the QRNN forward equations are extended as follows:
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
h _ { t } = \alpha ( W _ { h h } \otimes h _ { t - 1 } + W _ { h x } \otimes x _ { t } + b _ { h } ) ,
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
where $\alpha$ is a quaternion split activation function $\mathrm { { X u } }$ et al., 2017; Tripathi, 2016) defined as:
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\alpha ( Q ) = f ( r ) + f ( x ) \mathbf { i } + f ( y ) \mathbf { j } + f ( z ) \mathbf { k } ,
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
with $f$ corresponding to any standard activation function. The split approach is preferred in this work due to better prior investigations, better stability (i.e. pure quaternion activation functions contain singularities), and simpler computations. The output vector $p _ { t }$ is computed as:
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
p _ { t } = \beta ( W _ { h y } \otimes h _ { t } ) ,
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
where $\beta$ is any split activation function. Finally, the objective function is a classical loss applied component-wise (e.g., mean squared error, negative log-likelihood).
|
| 107 |
+
|
| 108 |
+
# 3.3.2 QUATERNION BACKPROPAGATION THROUGH TIME
|
| 109 |
+
|
| 110 |
+
The backpropagation through time (BPTT) for quaternion numbers (QBPTT) is an extension of the standard quaternion backpropagation (Ni6.3. The gradient with respect to the loss $E _ { t }$ 1995), and its full derivation is availablis expressed for each weight matrix as $\begin{array} { r } { \Delta _ { h y } ^ { t } = \frac { \partial E _ { t } } { \partial W _ { h y } } } \end{array}$ , $\begin{array} { r } { \Delta _ { h h } ^ { t } = \frac { \partial E _ { t } } { \partial W _ { h h } } } \end{array}$ $\begin{array} { r } { \Delta _ { h x } ^ { t } = \frac { \partial E _ { t } } { \partial W _ { h x } } } \end{array}$ , for the bias vector as $\begin{array} { r } { \Delta _ { b } ^ { t } = \frac { \partial E _ { t } } { \partial B _ { h } } } \end{array}$ , and is generalized to $\begin{array} { r } { \Delta ^ { t } = \frac { \partial E _ { t } } { \partial W } } \end{array}$ with:
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
\frac { \partial E _ { t } } { \partial W } = \frac { \partial E _ { t } } { \partial W ^ { r } } + \mathbf { i } \frac { \partial E _ { t } } { \partial W ^ { i } } + \mathbf { j } \frac { \partial E _ { t } } { \partial W ^ { j } } + \mathbf { k } \frac { \partial E _ { t } } { \partial W ^ { k } } .
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
Each term of the above relation is then computed by applying the chain rule. Indeed, and conversaly to real-valued backpropagation, QBPTT must defines the dynamic of the loss $w . r . t$ to each component of the quaternion neural parameters. As a use-case for the equations, the mean squared error at a timestep $t$ and named $E _ { t }$ is used as the loss function. Moreover, let $\lambda$ be a fixed learning rate. First, the weight matrix $W _ { h y }$ is only seen in the equations of $p _ { t }$ . It is therefore straightforward to update each weight of $W _ { h y }$ at timestep $t$ following:
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
W _ { h y } = W _ { h y } - \lambda \Delta _ { h y } ^ { t } \otimes h _ { t } ^ { * } , \mathrm { ~ w i t h ~ } \Delta _ { h y } ^ { t } = \frac { \partial E _ { t } } { \partial W _ { h y } } = ( p _ { t } - y _ { t } ) ,
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
where $h _ { t } ^ { * }$ is the conjugate of $h _ { t }$ . Then, the weight matrices $W _ { h h }$ , $W _ { h x }$ and biases $b _ { h }$ are arguments of $h _ { t }$ with $h _ { t - 1 }$ involved, and the update equations are derived as:
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
\begin{array} { r } { W _ { h h } = W _ { h h } - \lambda \Delta _ { h h } ^ { t } , W _ { h x } = W _ { h x } - \lambda \Delta _ { h x } ^ { t } , b _ { h } = b _ { h } - \lambda \Delta _ { b } ^ { t } , } \end{array}
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
with,
|
| 129 |
+
|
| 130 |
+
$$
|
| 131 |
+
\Delta _ { h h } ^ { t } = \sum _ { m = 0 } ^ { t } ( \prod _ { n = m } ^ { t } \delta _ { n } ) \otimes h _ { m - 1 } ^ { * } , \quad \Delta _ { h x } ^ { t } = \sum _ { m = 0 } ^ { t } ( \prod _ { n = m } ^ { t } \delta _ { n } ) \otimes x _ { m } ^ { * } , \quad \Delta _ { b } ^ { t } = \sum _ { m = 0 } ^ { t } ( \prod _ { n = m } ^ { t } \delta _ { n } ) ,
|
| 132 |
+
$$
|
| 133 |
+
|
| 134 |
+
and,
|
| 135 |
+
|
| 136 |
+
$$
|
| 137 |
+
\delta _ { n } = { \left\{ \begin{array} { l l } { W _ { h h } ^ { * } \otimes \delta _ { n + 1 } \times \alpha ^ { \prime } ( h _ { n } ^ { p r e a c t } ) } & { { \mathrm { i f ~ } } n \neq t } \\ { W _ { h y } ^ { * } \otimes ( p _ { n } - y _ { n } ) \times { \boldsymbol { \beta } } ^ { \prime } ( p _ { n } ^ { p r e a c t } ) } & { { \mathrm { o t h e r w i s e , } } } \end{array} \right. }
|
| 138 |
+
$$
|
| 139 |
+
|
| 140 |
+
$h _ { n } ^ { p r e a c t }$ and $p _ { n } ^ { p r e a c t }$ the pre-activation values of $h _ { n }$ and $p _ { n }$
|
| 141 |
+
|
| 142 |
+
# 3.4 PARAMETER INITIALIZATION
|
| 143 |
+
|
| 144 |
+
A well-designed parameter initialization scheme strongly impacts the efficiency of a DNN. An appropriate initialization, in fact, improves DNN convergence, reduces the risk of exploding or vanishing gradient, and often leads to a substantial performance improvement (Glorot & Bengio, 2010). It has been shown that the backpropagation through time algorithm of RNNs is degraded by an inappropriated parameter initialization (Sutskever et al., 2013). Moreover, an hyper-complex parameter cannot be simply initialized randomly and component-wise, due to the interactions between components. Therefore, this Section proposes a procedure reported in Algorithm 1 to initialize a matrix $W$ of quaternion-valued weights. The proposed initialization equations are derived from the polar form of a weight $w$ of $W$ :
|
| 145 |
+
|
| 146 |
+
$$
|
| 147 |
+
w = | w | e ^ { q _ { i m a g } ^ { \mathrm { q } } \theta } = | w | ( c o s ( \theta ) + q _ { i m a g } ^ { \mathrm { q } } s i n ( \theta ) ) ,
|
| 148 |
+
$$
|
| 149 |
+
|
| 150 |
+
and,
|
| 151 |
+
|
| 152 |
+
$$
|
| 153 |
+
w _ { \mathbf { r } } = \varphi c o s ( \theta ) , \quad w _ { \mathbf { i } } = \varphi q _ { i m a g \mathbf { i } } ^ { \mathrm { q } } s i n ( \theta ) , \quad w _ { \mathbf { j } } = \varphi q _ { i m a g \mathbf { j } } ^ { \mathrm { q } } s i n ( \theta ) , \quad w _ { \mathbf { k } } = \varphi q _ { i m a g \mathbf { k } } ^ { \mathrm { q } } s i n ( \theta ) .
|
| 154 |
+
$$
|
| 155 |
+
|
| 156 |
+
The angle $\theta$ is randomly generated in the interval $[ - \pi , \pi ]$ . The quaternion $q _ { i m a g } ^ { \mathrm { < } }$ is defined as purely normalized imaginary, and is expressed as $q _ { i m a g } ^ { \triangleleft } = 0 + x { \bf i } + y { \bf j } + z { \bf k }$ . The imaginary components yj, and zk are sampled from(following Eq. 4) to obtain form distribution. The parameter $[ 0 , 1 ]$ to obtain andom nu $q _ { i m a g }$ , which is then normalized generated with respect to $q _ { i m a g } ^ { \mathrm { < } }$ $\varphi$ well-known initialization criterions (such as Glorot or He algorithms) (Glorot & Bengio, 2010; He et al., 2015). However, the equations derived in (Glorot & Bengio, 2010; He et al., 2015) are defined for real-valued weight matrices. Therefore, the variance of $W$ has to be investigated in the quaternion space to obtain $\varphi$ (the full demonstration is provided in Appendix 6.2). The variance of $W$ is:
|
| 157 |
+
|
| 158 |
+
$$
|
| 159 |
+
V a r ( W ) = \mathbb { E } ( | W | ^ { 2 } ) - [ \mathbb { E } ( | W | ) ] ^ { 2 } , \mathrm { ~ w i t h ~ } [ \mathbb { E } ( | W | ) ] ^ { 2 } = 0 .
|
| 160 |
+
$$
|
| 161 |
+
|
| 162 |
+
# Algorithm 1 Quaternion-valued weight initialization
|
| 163 |
+
|
| 164 |
+
<table><tr><td colspan="2">1: procedure QINIT(W, nin, nout)</td><td rowspan="2">w.r.t to Glorot criterion and Eq. 18</td></tr><tr><td>2:</td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td>3:</td><td>forw in W do</td><td></td></tr><tr><td>4:</td><td>θ ← rand(-π,π)</td><td></td></tr><tr><td>5: 6:</td><td> ← rand(-σ,σ)</td><td></td></tr><tr><td>7:</td><td>x,y,z ←rand(0,1)</td><td></td></tr><tr><td>8:</td><td>qimag ← Quaternion(O,x,y,z) qimag qimag ↑</td><td></td></tr><tr><td>9:</td><td>√x²+y²+z2</td><td>See Eq.15</td></tr><tr><td>10:</td><td>Wr ← × cos(0) × sin(0)</td><td></td></tr><tr><td>11:</td><td></td><td></td></tr><tr><td>12:</td><td>Wj←×qimagj X sin(0)</td><td></td></tr><tr><td>13:</td><td>X sin(0)</td><td></td></tr><tr><td></td><td>w ← Quaternion(wr,Wi,Wj,Wk)</td><td></td></tr></table>
|
| 165 |
+
|
| 166 |
+
Indeed, the weight distribution is normalized. The value of $V a r ( W ) = \mathbb { E } ( | W | ^ { 2 } )$ , instead, is not trivial in the case of quaternion-valued matrices. Indeed, $W$ follows a Chi-distribution with four degrees of freedom (DOFs). Consequently, $V a r ( W )$ is expressed and computed as follows:
|
| 167 |
+
|
| 168 |
+
$$
|
| 169 |
+
V a r ( W ) = \mathbb { E } ( | W | ^ { 2 } ) = \int _ { 0 } ^ { \infty } x ^ { 2 } f ( x ) \mathrm { d } x = 4 \sigma ^ { 2 } .
|
| 170 |
+
$$
|
| 171 |
+
|
| 172 |
+
The Glorot (Glorot & Bengio, 2010) and He (He et al., 2015) criterions are extended to quaternion as:
|
| 173 |
+
|
| 174 |
+
$$
|
| 175 |
+
\sigma = { \frac { 1 } { \sqrt { 2 ( n _ { i n } + n _ { o u t } ) } } } , { \mathrm { ~ a n d ~ } } \sigma = { \frac { 1 } { \sqrt { 2 n _ { i n } } } } ,
|
| 176 |
+
$$
|
| 177 |
+
|
| 178 |
+
with $n _ { i n }$ and $n _ { o u t }$ the number of neurons of the input and output layers respectively. Finally, $\varphi$ can be sampled from $[ - \sigma , \sigma ]$ to complete the weight initialization of Eq. 15.
|
| 179 |
+
|
| 180 |
+
# 4 EXPERIMENTS
|
| 181 |
+
|
| 182 |
+
This Section details the acoustic features extraction (Section 4.1), the experimental setups and the results obtained with QRNNs, QLSTMs, RNNs and LSTMs on the TIMIT speech recognition tasks (Section 4.2). The results reported in bold on tables are obtained with the best configurations of the neural networks observed with the validation set.
|
| 183 |
+
|
| 184 |
+
# 4.1 QUATERNION ACOUSTIC FEATURES
|
| 185 |
+
|
| 186 |
+
The raw audio is first splitted every 10ms with a window of $2 5 \mathrm { m s }$ . Then 40-dimensional log Mel-filterbank coefficients with first, second, and third order derivatives are extracted using the pytorch-kaldi2 (Ravanelli et al., 2018b) toolkit and the Kaldi s5 recipes (Povey et al., 2011). An acoustic quaternion $Q ( f , t )$ associated with a frequency $f$ and a time-frame $t$ is formed as follows:
|
| 187 |
+
|
| 188 |
+
$$
|
| 189 |
+
Q ( f , t ) = e ( f , t ) + \frac { \partial e ( f , t ) } { \partial t } \mathbf { i } + \frac { \partial ^ { 2 } e ( f , t ) } { \partial ^ { 2 } t } \mathbf { j } + \frac { \partial ^ { 3 } e ( f , t ) } { \partial ^ { 3 } t } \mathbf { k } .
|
| 190 |
+
$$
|
| 191 |
+
|
| 192 |
+
$Q ( f , t )$ represents multiple views of a frequency $f$ at time frame $t$ , consisting of the energy $e ( f , t )$ in the filter band at frequency $f$ , its first time derivative describing a slope view, its second time derivative describing a concavity view, and the third derivative describing the rate of change of the second derivative. Quaternions are used to learn the spatial relations that exist between the 3 described different views that characterize a same frequency (Tokuda et al., 2003). Thus, the quaternion input vector length is $1 6 0 / 4 = 4 0$ . Decoding is based on Kaldi (Povey et al., 2011) and weighted finite state transducers (WFST) (Mohri et al., 2002) that integrate acoustic, lexicon and language model probabilities into a single HMM-based search graph.
|
| 193 |
+
|
| 194 |
+
# 4.2 THE TIMIT CORPUS
|
| 195 |
+
|
| 196 |
+
The training process is based on the standard 3, 696 sentences uttered by 462 speakers, while testing is conducted on 192 sentences uttered by 24 speakers of the TIMIT (Garofolo et al., 1993) dataset. A validation set composed of 400 sentences uttered by 50 speakers is used for hyper-parameter tuning. The models are compared on a fixed number of layers $M = 4$ and by varying the number of neurons $N$ from 256 to 2, 048, and 64 to 512 for the RNN and QRNN respectively. Indeed, it is worth underlying that the number of hidden neurons in the quaternion and real spaces do not handle the same amount of real-number values. Indeed, 256 quaternion neurons output are $2 5 6 \times 4 = 1 0 2 4$ real values. Tanh activations are used across all the layers except for the output layer that is based on a softmax function. Models are optimized with RMSPROP with vanilla hyper-parameters and an initial learning rate of $8 \cdot 1 0 ^ { - 4 }$ . The learning rate is progressively annealed using a halving factor of 0.5 that is applied when no performance improvement on the validation set is observed. The models are trained during 25 epochs. All the models converged to a minimum loss, due to the annealed learning rate. A dropout rate of 0.2 is applied over all the hidden layers (Srivastava et al., 2014) except the output one. The negative log-likelihood loss function is used as an objective function. All the experiments are repeated 5 times (5-folds) with different seeds and are averaged to limit any variation due to the random initialization.
|
| 197 |
+
|
| 198 |
+
Table 1: Phoneme error rate $( \mathrm { P E R } \% )$ of QRNN and RNN models on the development and test sets of the TIMIT dataset. “Params" stands for the total number of trainable parameters.
|
| 199 |
+
|
| 200 |
+
<table><tr><td>Models</td><td>Neurons</td><td>Dev.</td><td>Test</td><td>Params</td></tr><tr><td rowspan="4">RNN</td><td>256</td><td>22.4</td><td>23.4</td><td>1M</td></tr><tr><td>512</td><td>19.6</td><td>20.4</td><td>2.8M</td></tr><tr><td>1,024</td><td>17.9</td><td>19.0</td><td>9.4M</td></tr><tr><td>2,048</td><td>20.0</td><td>20.7</td><td>33.4M</td></tr><tr><td rowspan="4">QRNN</td><td>64</td><td>23.6</td><td>23.9</td><td>0.6M</td></tr><tr><td>128</td><td>19.2</td><td>20.1</td><td>1.4M</td></tr><tr><td>256</td><td>17.4</td><td>18.5</td><td>3.8M</td></tr><tr><td>512</td><td>17.5</td><td>18.7</td><td>11.2M</td></tr></table>
|
| 201 |
+
|
| 202 |
+
The results on the TIMIT task are reported in Table 1. The best PER in realistic conditions (w.r.t to the best validation PER) is $1 8 . 5 \%$ and $1 9 . 0 \%$ on the test set for QRNN and RNN models respectively, highlighting an absolute improvement of $0 . 5 \%$ obtained with QRNN. These results compare favorably with the best results obtained so far with architectures that do not integrate access control in multiple memory layers (Ravanelli et al., 2018a). In the latter, a PER of $1 8 . 3 \%$ is reported on the TIMIT test set with batch-normalized RNNs . Moreover, a remarkable advantage of QRNNs is a drastic reduction (with a factor of $2 . 5 \times $ ) of the parameters needed to achieve these results. Indeed, such PERs are obtained with models that employ the same internal dimensionality corresponding to 1, 024 real-valued neurons and 256 quaternion-valued ones, resulting in a number of parameters of 3.8M for QRNN against the 9.4M used in the real-valued RNN. It is also worth noting that QRNNs consistently need fewer parameters than equivalently sized RNNs, with an average reduction factor of 2.26 times. This is easily explained by considering the content of the quaternion algebra. Indeed, for a fully-connected layer with 2, 048 input values and 2, 048 hidden units, a real-valued RNN has $2 , 0 4 8 ^ { 2 } \overset { \cdot } { \approx } 4 . 2 \mathbf { M }$ parameters, while to maintain equal input and output dimensions the quaternion equivalent has 512 quaternions inputs and 512 quaternion hidden units. Therefore, the number of parameters for the quaternion-valued model is $5 1 \dot { 2 } ^ { 2 } \times 4 \approx 1 { \mathrm { M } }$ . Such a complexity reduction turns out to produce better results and has other advantages such as a smaller memory footprint while saving models on budget memory systems. This characteristic makes our QRNN model particularly suitable for speech recognition conducted on low computational power devices like smartphones (Chen et al., 2014). QRNNs and RNNs accuracies vary accordingly to the architecture with better PER on bigger and wider topologies. Therefore, while good PER are observed with a higher number of parameters, smaller architectures performed at $2 3 . { \bar { 9 } } \%$ and $2 3 . 4 \%$ , with 1M and $0 . 6 { \bf M }$ parameters for the RNN and the QRNN respectively. Such PER are due to a too small number of parameters to solve the task.
|
| 203 |
+
|
| 204 |
+
# 4.3 QUATERNION LONG-SHORT TERM MEMORY NEURAL NETWORKS
|
| 205 |
+
|
| 206 |
+
We propose to extend the QRNN to state-of-the-art models such as long-short term memory neural networks (LSTM), to support and improve the results already observed with the QRNN compared to the RNN in more realistic conditions. LSTM (Hochreiter & Schmidhuber, 1997) neural networks were introduced to solve the problems of long-term dependencies learning and vanishing or exploding gradient observed with long sequences. Based on the equations of the forward propagation and back propagation through time of QRNN described in Section 3.3.1, and Section 3.3.2, one can easily derive the equations of a quaternion-valued LSTM. Gates are defined with quaternion numbers following the proposal of Danihelka et al. (2016). Therefore, the gate action is characterized by an independent modification of each component of the quaternion-valued signal following a componentwise product with the quaternion-valued gate potential. Let $f _ { t } , i _ { t } , o _ { t } , c$ , and $h _ { t }$ be the forget, input, output gates, cell states and the hidden state of a LSTM cell at time-step $t$ :
|
| 207 |
+
|
| 208 |
+
$$
|
| 209 |
+
\begin{array} { r l } & { f _ { t } = \alpha ( W _ { f } \otimes x _ { t } + R _ { f } \otimes h _ { t - 1 } + b _ { f } ) , } \\ & { i _ { t } = \alpha ( W _ { i } \otimes x _ { t } + R _ { i } \otimes h _ { t - 1 } + b _ { i } ) , } \\ & { c _ { t } = f _ { t } \times c _ { t - 1 } + i _ { t } \times t a n h ( W _ { c } \otimes x _ { t } + R _ { c } \otimes h _ { t - 1 } + b _ { c } ) , } \\ & { o _ { t } = \alpha ( W _ { o } \otimes x _ { t } + R _ { o } \otimes h _ { t - 1 } + b _ { o } ) , } \\ & { h _ { t } = o _ { t } \times t a n h ( c _ { t } ) , } \end{array}
|
| 210 |
+
$$
|
| 211 |
+
|
| 212 |
+
where $W$ are rectangular input weight matrices, $R$ are square recurrent weight matrices, and $b$ are bias vectors. $\alpha$ is the split activation function and $\times$ denotes a component-wise product between two quaternions. Both QLSTM and LSTM are bidirectional and trained on the same conditions than for the QRNN and RNN experiments.
|
| 213 |
+
|
| 214 |
+
Table 2: Phoneme error rate $( \mathrm { P E R } \% )$ of QLSTM and LSTM models on the development and test sets of the TIMIT dataset. “Params" stands for the total number of trainable parameters.
|
| 215 |
+
|
| 216 |
+
<table><tr><td>Models</td><td>Neurons</td><td>Dev.</td><td>Test</td><td>Params</td></tr><tr><td rowspan="4">LSTM</td><td>256</td><td>14.9</td><td>16.5</td><td>3.6M</td></tr><tr><td>512</td><td>14.2</td><td>16.1</td><td>12.6M</td></tr><tr><td>1,024</td><td>14.4</td><td>15.3</td><td>46.2M</td></tr><tr><td>2.048</td><td>14.0</td><td>15.9</td><td>176.3M</td></tr><tr><td rowspan="4">QLSTM</td><td>64</td><td>15.5</td><td>17.0</td><td>1.6M</td></tr><tr><td>128</td><td>14.1</td><td>16.0</td><td>4.6M</td></tr><tr><td>256</td><td>14.0</td><td>15.1</td><td>14.4M</td></tr><tr><td>512</td><td>14.2</td><td>15.1</td><td>49.9M</td></tr></table>
|
| 217 |
+
|
| 218 |
+
The results on the TIMIT corpus reported on Table 2 support the initial intuitions and the previously established trends. We first point out that the best PER observed is $1 5 . 1 \%$ and $1 5 . 3 \%$ on the test set for QLSTMs and LSTM models respectively with an absolute improvement of $0 . 2 \%$ obtained with QLSTM using 3.3 times fewer parameters compared to LSTM. These results are among the top of the line results (Graves et al., 2013b; Ravanelli et al., 2018a) and prove that the proposed quaternion approach can be used in state-of-the-art models. A deeper investigation of QLSTMs performances with the larger Wall Street Journal (WSJ) dataset can be found in Appendix 6.1.1.
|
| 219 |
+
|
| 220 |
+
# 5 CONCLUSION
|
| 221 |
+
|
| 222 |
+
Summary. This paper proposes to process sequences of multidimensional features (such as acoustic data) with a novel quaternion recurrent neural network (QRNN) and quaternion long-short term memory neural network (QLSTM). The experiments conducted on the TIMIT phoneme recognition task show that QRNNs and QLSTMs are more effective to learn a compact representation of multidimensional information by outperforming RNNs and LSTMs with 2 to 3 times less free parameters. Therefore, our initial intuition that the quaternion algebra offers a better and more compact representation for multidimensional features, alongside with a better learning capability of feature internal dependencies through the Hamilton product, have been demonstrated.
|
| 223 |
+
|
| 224 |
+
Future Work. Future investigations will develop other multi-view features that contribute to decrease ambiguities in representing phonemes in the quaternion space. In this extent, a recent approach based on a quaternion Fourier transform to create quaternion-valued signal has to be investigated. Finally, other high-dimensional neural networks such as manifold and Clifford networks remain mostly unexplored and can benefit from further research.
|
| 225 |
+
|
| 226 |
+
# REFERENCES
|
| 227 |
+
|
| 228 |
+
Dario Amodei, Sundaram Ananthanarayanan, Rishita Anubhai, Jingliang Bai, Eric Battenberg, Carl Case, Jared Casper, Bryan Catanzaro, Qiang Cheng, Guoliang Chen, et al. Deep speech 2: Endto-end speech recognition in english and mandarin. In International Conference on Machine Learning, pp. 173–182, 2016.
|
| 229 |
+
|
| 230 |
+
Paolo Arena, Luigi Fortuna, Luigi Occhipinti, and Maria Gabriella Xibilia. Neural networks for quaternion-valued function approximation. In Circuits and Systems, ISCAS’94., IEEE International Symposium on, volume 6, pp. 307–310. IEEE, 1994.
|
| 231 |
+
|
| 232 |
+
Paolo Arena, Luigi Fortuna, Giovanni Muscato, and Maria Gabriella Xibilia. Multilayer perceptrons to approximate quaternion valued functions. Neural Networks, 10(2):335–342, 1997.
|
| 233 |
+
|
| 234 |
+
Nicholas A Aspragathos and John K Dimitros. A comparative study of three methods for robot kinematics. Systems, Man, and Cybernetics, Part B: Cybernetics, IEEE Transactions on, 28(2): 135–145, 1998.
|
| 235 |
+
|
| 236 |
+
Rudrasis Chakraborty, Jose Bouza, Jonathan Manton, and Baba C. Vemuri. Manifoldnet: A deep network framework for manifold-valued data. arXiv preprint arXiv:1809.06211, 2018.
|
| 237 |
+
|
| 238 |
+
William Chan and Ian Lane. Deep recurrent neural networks for acoustic modelling. arXiv preprint arXiv:1504.01482, 2015.
|
| 239 |
+
|
| 240 |
+
G. Chen, C. Parada, and G. Heigold. Small-footprint keyword spotting using deep neural networks. In 2014 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 4087–4091, May 2014. doi: 10.1109/ICASSP.2014.6854370.
|
| 241 |
+
|
| 242 |
+
Chung-Cheng Chiu, Tara N Sainath, Yonghui Wu, Rohit Prabhavalkar, Patrick Nguyen, Zhifeng Chen, Anjuli Kannan, Ron J Weiss, Kanishka Rao, Ekaterina Gonina, et al. State-of-the-art speech recognition with sequence-to-sequence models. In 2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 4774–4778. IEEE, 2018.
|
| 243 |
+
|
| 244 |
+
Alexis Conneau, German Kruszewski, Guillaume Lample, Loïc Barrault, and Marco Baroni. What you can cram into a single vector: Probing sentence embeddings for linguistic properties, 2018.
|
| 245 |
+
|
| 246 |
+
Ivo Danihelka, Greg Wayne, Benigno Uria, Nal Kalchbrenner, and Alex Graves. Associative long short-term memory. arXiv preprint arXiv:1602.03032, 2016.
|
| 247 |
+
|
| 248 |
+
Steven B Davis and Paul Mermelstein. Comparison of parametric representations for monosyllabic word recognition in continuously spoken sentences. In Readings in speech recognition, pp. 65–74. Elsevier, 1990.
|
| 249 |
+
|
| 250 |
+
Sadaoki Furui. Speaker-independent isolated word recognition based on emphasized spectral dynamics. In Acoustics, Speech, and Signal Processing, IEEE International Conference on ICASSP’86., volume 11, pp. 1991–1994. IEEE, 1986.
|
| 251 |
+
|
| 252 |
+
John S Garofolo, Lori F Lamel, William M Fisher, Jonathan G Fiscus, and David S Pallett. Darpa timit acoustic-phonetic continous speech corpus cd-rom. nist speech disc 1-1.1. NASA STI/Recon technical report n, 93, 1993.
|
| 253 |
+
|
| 254 |
+
Chase J Gaudet and Anthony S Maida. Deep quaternion networks. In 2018 International Joint Conference on Neural Networks (IJCNN), pp. 1–8. IEEE, 2018.
|
| 255 |
+
|
| 256 |
+
Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In International conference on artificial intelligence and statistics, pp. 249–256, 2010.
|
| 257 |
+
|
| 258 |
+
Alex Graves, Navdeep Jaitly, and Abdel-rahman Mohamed. Hybrid speech recognition with deep bidirectional lstm. In Automatic Speech Recognition and Understanding (ASRU), 2013 IEEE Workshop on, pp. 273–278. IEEE, 2013a.
|
| 259 |
+
|
| 260 |
+
Alex Graves, Abdel-rahman Mohamed, and Geoffrey Hinton. Speech recognition with deep recurrent neural networks. In Acoustics, speech and signal processing (icassp), 2013 ieee international conference on, pp. 6645–6649. IEEE, 2013b.
|
| 261 |
+
|
| 262 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In Proceedings of the IEEE international conference on computer vision, pp. 1026–1034, 2015.
|
| 263 |
+
|
| 264 |
+
Akira Hirose and Shotaro Yoshida. Generalization characteristics of complex-valued feedforward neural networks in relation to signal coherence. IEEE Transactions on Neural Networks and learning systems, 23(4):541–551, 2012.
|
| 265 |
+
|
| 266 |
+
Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8): 1735–1780, 1997.
|
| 267 |
+
|
| 268 |
+
Jin Hu and Jun Wang. Global stability of complex-valued recurrent neural networks with time-delays. IEEE Transactions on Neural Networks and Learning Systems, 23(6):853–865, 2012.
|
| 269 |
+
|
| 270 |
+
Teijiro Isokawa, Tomoaki Kusakabe, Nobuyuki Matsui, and Ferdinand Peper. Quaternion neural network and its application. In International Conference on Knowledge-Based and Intelligent Information and Engineering Systems, pp. 318–324. Springer, 2003.
|
| 271 |
+
|
| 272 |
+
Teijiro Isokawa, Nobuyuki Matsui, and Haruhiko Nishimura. Quaternionic neural networks: Fundamental properties and applications. Complex-Valued Neural Networks: Utilizing High-Dimensional Parameters, pp. 411–439, 2009.
|
| 273 |
+
|
| 274 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 275 |
+
|
| 276 |
+
Hiromi Kusamichi, Teijiro Isokawa, Nobuyuki Matsui, Yuzo Ogawa, and Kazuaki Maeda. A new scheme for color night vision by quaternion neural network. In Proceedings of the 2nd International Conference on Autonomous Robots and Agents, volume 1315, 2004.
|
| 277 |
+
|
| 278 |
+
Nobuyuki Matsui, Teijiro Isokawa, Hiromi Kusamichi, Ferdinand Peper, and Haruhiko Nishimura. Quaternion neural network with geometrical operators. Journal of Intelligent & Fuzzy Systems, 15 (3, 4):149–164, 2004.
|
| 279 |
+
|
| 280 |
+
Larry R. Medsker and Lakhmi J. Jain. Recurrent neural networks. Design and Applications, 5, 2001.
|
| 281 |
+
|
| 282 |
+
Toshifumi Minemoto, Teijiro Isokawa, Haruhiko Nishimura, and Nobuyuki Matsui. Feed forward neural network with random quaternionic neurons. Signal Processing, 136:59–68, 2017.
|
| 283 |
+
|
| 284 |
+
Mehryar Mohri, Fernando Pereira, and Michael Riley. Weighted finite-state transducers in speech recognition. Computer Speech and Language, 16(1):69 – 88, 2002. ISSN 0885-2308. doi: https: //doi.org/10.1006/csla.2001.0184. URL http://www.sciencedirect.com/science/ article/pii/S0885230801901846.
|
| 285 |
+
|
| 286 |
+
Mohamed Morchid. Parsimonious memory unit for recurrent neural networks with application to natural language processing. Neurocomputing, 314:48–64, 2018.
|
| 287 |
+
|
| 288 |
+
Tohru Nitta. A quaternary version of the back-propagation algorithm. In Neural Networks, 1995. Proceedings., IEEE International Conference on, volume 5, pp. 2753–2756. IEEE, 1995.
|
| 289 |
+
|
| 290 |
+
Titouan Parcollet, Mohamed Morchid, Pierre-Michel Bousquet, Richard Dufour, Georges Linarès, and Renato De Mori. Quaternion neural networks for spoken language understanding. In Spoken Language Technology Workshop (SLT), 2016 IEEE, pp. 362–368. IEEE, 2016.
|
| 291 |
+
|
| 292 |
+
Titouan Parcollet, Morchid Mohamed, and Georges Linarès. Quaternion denoising encoder-decoder for theme identification of telephone conversations. Proc. Interspeech 2017, pp. 3325–3328, 2017a.
|
| 293 |
+
|
| 294 |
+
Titouan Parcollet, Mohamed Morchid, and Georges Linares. Deep quaternion neural networks for spoken language understanding. In Automatic Speech Recognition and Understanding Workshop (ASRU), 2017 IEEE, pp. 504–511. IEEE, 2017b.
|
| 295 |
+
|
| 296 |
+
Titouan Parcollet, Ying Zhang, Mohamed Morchid, Chiheb Trabelsi, Georges Linarès, Renato de Mori, and Yoshua Bengio. Quaternion convolutional neural networks for end-to-end automatic speech recognition. In Interspeech 2018, 19th Annual Conference of the International Speech Communication Association, Hyderabad, India, 2-6 September 2018., pp. 22–26, 2018. doi: 10.21437/Interspeech.2018-1898. URL https://doi.org/10.21437/Interspeech. 2018-1898.
|
| 297 |
+
|
| 298 |
+
Soo-Chang Pei and Ching-Min Cheng. Color image processing by using binary quaternion-momentpreserving thresholding technique. IEEE Transactions on Image Processing, 8(5):614–628, 1999.
|
| 299 |
+
|
| 300 |
+
Daniel Povey, Arnab Ghoshal, Gilles Boulianne, Lukas Burget, Ondrej Glembek, Nagendra Goel, Mirko Hannemann, Petr Motlicek, Yanmin Qian, Petr Schwarz, Jan Silovsky, Georg Stemmer, and Karel Vesely. The kaldi speech recognition toolkit. In IEEE 2011 Workshop on Automatic Speech Recognition and Understanding. IEEE Signal Processing Society, December 2011. IEEE Catalog No.: CFP11SRW-USB.
|
| 301 |
+
|
| 302 |
+
Daniel Povey, Vijayaditya Peddinti, Daniel Galvez, Pegah Ghahremani, Vimal Manohar, Xingyu Na, Yiming Wang, and Sanjeev Khudanpur. Purely sequence-trained neural networks for asr based on lattice-free mmi. In Interspeech, pp. 2751–2755, 2016.
|
| 303 |
+
|
| 304 |
+
Mirco Ravanelli, Philemon Brakel, Maurizio Omologo, and Yoshua Bengio. Light gated recurrent units for speech recognition. IEEE Transactions on Emerging Topics in Computational Intelligence, 2(2):92–102, 2018a.
|
| 305 |
+
|
| 306 |
+
Mirco Ravanelli, Titouan Parcollet, and Yoshua Bengio. The pytorch-kaldi speech recognition toolkit. arXiv preprint arXiv:1811.07453, 2018b.
|
| 307 |
+
|
| 308 |
+
Sara Sabour, Nicholas Frosst, and Geoffrey E Hinton. Dynamic routing between capsules. arXiv preprint arXiv:1710.09829v2, 2017.
|
| 309 |
+
|
| 310 |
+
Stephen John Sangwine. Fourier transforms of colour images using quaternion or hypercomplex, numbers. Electronics letters, 32(21):1979–1980, 1996.
|
| 311 |
+
|
| 312 |
+
Jingyan Song and Yeung Yam. Complex recurrent neural network for computing the inverse and pseudo-inverse of the complex matrix. Applied mathematics and computation, 93(2-3):195–205, 1998.
|
| 313 |
+
|
| 314 |
+
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.
|
| 315 |
+
|
| 316 |
+
Ilya Sutskever, James Martens, George Dahl, and Geoffrey Hinton. On the importance of initialization and momentum in deep learning. In International conference on machine learning, pp. 1139–1147, 2013.
|
| 317 |
+
|
| 318 |
+
Keiichi Tokuda, Heiga Zen, and Tadashi Kitamura. Trajectory modeling based on hmms with the explicit relationship between static and dynamic features. In Eighth European Conference on Speech Communication and Technology, 2003.
|
| 319 |
+
|
| 320 |
+
Chiheb Trabelsi, Olexa Bilaniuk, Dmitriy Serdyuk, Sandeep Subramanian, João Felipe Santos, Soroush Mehri, Negar Rostamzadeh, Yoshua Bengio, and Christopher J Pal. Deep complex networks. arXiv preprint arXiv:1705.09792, 2017.
|
| 321 |
+
|
| 322 |
+
Bipin Kumar Tripathi. High Dimensional Neurocomputing. Springer, 2016.
|
| 323 |
+
|
| 324 |
+
Mark Tygert, Joan Bruna, Soumith Chintala, Yann LeCun, Serkan Piantino, and Arthur Szlam. A mathematical motivation for complex-valued convolutional networks. Neural computation, 28(5): 815–825, 2016.
|
| 325 |
+
|
| 326 |
+
Scott Wisdom, Thomas Powers, John Hershey, Jonathan Le Roux, and Les Atlas. Full-capacity unitary recurrent neural networks. In Advances in Neural Information Processing Systems, pp. 4880–4888, 2016.
|
| 327 |
+
|
| 328 |
+
D Xu, L Zhang, and H Zhang. Learning alogrithms in quaternion neural networks using ghr calculus. Neural Network World, 27(3):271, 2017.
|
| 329 |
+
|
| 330 |
+
# 6 APPENDIX
|
| 331 |
+
|
| 332 |
+
# 6.1 WALL STREET JOURNAL EXPERIMENTS AND COMPUTATIONAL COMPLEXITY
|
| 333 |
+
|
| 334 |
+
This Section proposes to validate the scaling of the proposed QLSTMs to a bigger and more realistic corpus, with a speech recognition task on the Wall Street Journal (WSJ) dataset. Finally, it discuses the impact of the quaternion algebra in term of computational compexity.
|
| 335 |
+
|
| 336 |
+
# 6.1.1 SPEECH RECOGNITION WITH THE WALL STREET JOURNAL CORPUS
|
| 337 |
+
|
| 338 |
+
We propose to evaluate both QLSTMs and LSTMs with a larger and more realistic corpus to validate the scaling of the observed TIMIT results (Section 4.2). Acoustic input features are described in Section 4.1, and extracted on both the 14 hour subset ‘train-si84’, and the full 81 hour dataset ’train$\sin 2 8 4 '$ of the Wall Street Journal (WSJ) corpus. The ‘test-dev93’ development set is employed for validation, while ’test-eval92’ composes the testing set. Models architectures are fixed with respect to the best results observed with the TIMIT corpus (Section 4.2). Therefore, both QLSTMs and LSTMs contain four bidirectional layers of internal dimension of size 1, 024. Then, an additional layer of internal size 1, 024 is added before the output layer. The only change on the training procedure compared to the TIMIT experiments concerns the model optimizer, which is set to Adam (Kingma & Ba, 2014) instead of RMSPROP. Results are from a 3-folds average.
|
| 339 |
+
|
| 340 |
+
Table 3: Word error rates (WER $\%$ ) obtained with both training set (WSJ14h and WSJ81h) of the Wall Street Journal corpus. ’test-dev93’ and ’test-eval92’ are used as validation and testing set respectively. $L$ expresses the number of recurrent layers.
|
| 341 |
+
|
| 342 |
+
<table><tr><td>Models</td><td>WSJ14 Dev.</td><td>WSJ14 Test</td><td>WSJ81 Dev.</td><td>WSJ81 Test</td><td>Params</td></tr><tr><td>LSTM</td><td>11.2</td><td>7.2</td><td>7.4</td><td>4.5</td><td>53.7M</td></tr><tr><td>QLSTM</td><td>10.9</td><td>6.9</td><td>7.2</td><td>4.3</td><td>18.7M</td></tr></table>
|
| 343 |
+
|
| 344 |
+
It is important to notice that reported results on Table 3 compare favorably with equivalent architectures (Graves et al., 2013a) (WER of $1 1 . 7 \%$ on ’test-dev93’), and are competitive with state-of-the-art and much more complex models based on better engineered features (Chan & Lane, 2015)(WER of $3 . 8 \%$ with the 81 hours of training data, and on ’test-eval92’). According to Table 3, QLSTMs outperform LSTM in all the training conditions (14 hours and 81 hours) and with respect to both the validation and testing sets. Moreover, QLSTMs still need 2.9 times less neural parameters than LSTMs to achieve such performances. This experiment demonstrates that QLSTMs scale well to larger and more realistic speech datasets and are still more efficient than real-valued LSTMs.
|
| 345 |
+
|
| 346 |
+
# 6.1.2 NOTES ON COMPUTATIONAL COMPLEXITY
|
| 347 |
+
|
| 348 |
+
A computational complexity of $O ( n ^ { 2 } )$ with $n$ the number of hidden states has been reported by Morchid (2018) for real-valued LSTMs. QLSTMs just involve 4 times larger matrices during computations. Therefore, the computational complexity remains unchanged and equals to $O ( n ^ { 2 } )$ . Nonetheless, and due to the Hamilton product, a single forward propagation between two quaternion neurons uses 28 operations, compared to a single one for two real-valued neurons, implying a longer training time (up to 3 times slower). However, such worst speed performances could easily be alleviated with a proper engineered cuDNN kernel for the Hamilton product, that would helps QNNs to be more efficient than real-valued ones. A well-adapted CUDA kernel would allow QNNs to perform more computations, with fewer parameters, and therefore less memory copy operations from the CPU to the GPU.
|
| 349 |
+
|
| 350 |
+
# 6.2 PARAMETERS INITIALIZATION
|
| 351 |
+
|
| 352 |
+
Let us recall that a generated quaternion weight $w$ from a weight matrix $W$ has a polar form defined as:
|
| 353 |
+
|
| 354 |
+
$$
|
| 355 |
+
w = | w | e ^ { q _ { i m a g } ^ { \mathrm { q } } \theta } = | w | ( c o s ( \theta ) + q _ { i m a g } ^ { \mathrm { q } } s i n ( \theta ) ) ,
|
| 356 |
+
$$
|
| 357 |
+
|
| 358 |
+
with q/imag $q _ { i m a g } ^ { \triangleleft } = 0 + x { \bf i } + y { \bf j } + z { \bf k }$ a purely imaginary and normalized quaternion. Therefore, $w$ can be computed following:
|
| 359 |
+
|
| 360 |
+
$$
|
| 361 |
+
\begin{array} { c } { { w _ { \mathbf { r } } = \varphi c o s ( \theta ) , } } \\ { { w _ { \mathbf { i } } = \varphi q _ { i m a g \mathbf { i } } ^ { \triangleleft } s i n ( \theta ) , } } \\ { { w _ { \mathbf { j } } = \varphi q _ { i m a g \mathbf { j } } ^ { \triangleleft } s i n ( \theta ) , } } \\ { { w _ { \mathbf { k } } = \varphi q _ { i m a g \mathbf { k } } ^ { \triangleleft } s i n ( \theta ) . } } \end{array}
|
| 362 |
+
$$
|
| 363 |
+
|
| 364 |
+
However, $\varphi$ represents a randomly generated variable with respect to the variance of the quaternion weight and the selected initialization criterion. The initialization process follows (Glorot $\&$ Bengio, 2010) and (He et al., 2015) to derive the variance of the quaternion-valued weight parameters. Indeed, the variance of $\mathbf { W }$ has to be investigated:
|
| 365 |
+
|
| 366 |
+
$$
|
| 367 |
+
V a r ( W ) = \operatorname { \mathbb { E } } ( | W | ^ { 2 } ) - [ \operatorname { \mathbb { E } } ( | W | ) ] ^ { 2 } .
|
| 368 |
+
$$
|
| 369 |
+
|
| 370 |
+
$[ \mathbb { E } ( | W | ) ] ^ { 2 }$ is equals to 0 since the weight distribution is symmetric around 0. Nonetheless, the value of $V a r ( \dot { W } ) = \mathbb { E } ( | W | ^ { 2 } )$ is not trivial in the case of quaternion-valued matrices. Indeed, $W$ follows a Chi-distribution with four degrees of freedom (DOFs) and $\mathbb { E } ( | W | ^ { 2 } )$ is expressed and computed as follows:
|
| 371 |
+
|
| 372 |
+
$$
|
| 373 |
+
\mathbb { E } ( | W | ^ { 2 } ) = \int _ { 0 } ^ { \infty } x ^ { 2 } f ( x ) \mathrm { d } x ,
|
| 374 |
+
$$
|
| 375 |
+
|
| 376 |
+
With $f ( x )$ is the probability density function with four DOFs. A four-dimensional vector $X =$ $\{ A , B , C , D \}$ is considered to evaluate the density function $f ( x )$ . $X$ has components that are normally distributed, centered at zero, and independent. Then, $A , B ,$ , $C$ and $D$ have density functions:
|
| 377 |
+
|
| 378 |
+
$$
|
| 379 |
+
f _ { A } ( x ; \sigma ) = f _ { B } ( x ; \sigma ) = f _ { C } ( x ; \sigma ) = f _ { D } ( x ; \sigma ) = \frac { e ^ { - x ^ { 2 } / 2 \sigma ^ { 2 } } } { \sqrt { 2 \pi \sigma ^ { 2 } } } .
|
| 380 |
+
$$
|
| 381 |
+
|
| 382 |
+
The four-dimensional vector $X$ has a length $L$ defined as $L \ = \ \sqrt { A ^ { 2 } + B ^ { 2 } + C ^ { 2 } + D ^ { 2 } }$ with a cumulative distribution function $F _ { L } ( x ; \sigma )$ in the 4-sphere (n-sphere with $n = 4$ ) $S _ { x }$ :
|
| 383 |
+
|
| 384 |
+
$$
|
| 385 |
+
F _ { L } ( x ; \sigma ) = \int \int \int \int _ { S _ { x } } f _ { A } ( x ; \sigma ) f _ { B } ( x ; \sigma ) f _ { C } ( x ; \sigma ) f _ { D } ( x ; \sigma ) \mathrm { d } S _ { x }
|
| 386 |
+
$$
|
| 387 |
+
|
| 388 |
+
where $S _ { x } = \{ ( a , b , c , d ) : { \sqrt { a ^ { 2 } + b ^ { 2 } + c ^ { 2 } + d ^ { 2 } } } < x \}$ and $\mathrm { d } S _ { x } = \mathrm { d } a \mathrm { d } b \mathrm { d } c \mathrm { d } d$ . The polar representations of the coordinates of $X$ in a 4-dimensional space are defined to compute $\mathrm { d } S _ { x }$ :
|
| 389 |
+
|
| 390 |
+
$$
|
| 391 |
+
\begin{array} { r l } & { a = \rho \cos \theta , } \\ & { b = \rho \sin \theta \cos \phi , } \\ & { c = \rho \sin \theta \sin \phi \cos \psi , } \\ & { d = \rho \sin \theta \sin \phi \sin \psi , } \end{array}
|
| 392 |
+
$$
|
| 393 |
+
|
| 394 |
+
where $\rho$ is the magnitude $( \rho = \sqrt { a ^ { 2 } + b ^ { 2 } + c ^ { 2 } + d ^ { 2 } } )$ and $\theta , \phi$ , and $\psi$ are the phases with $0 \leq \theta \leq \pi$ , $0 \leq \phi \leq \pi$ and $0 \leq \psi \leq 2 \pi$ . Then, $\mathrm { d } S _ { x }$ is evaluated with the Jacobian $J _ { f }$ of $f$ defined as:
|
| 395 |
+
|
| 396 |
+
$$
|
| 397 |
+
J _ { f } = { \frac { \partial ( a , b , c , d ) } { \partial ( \rho , \theta , \phi , \psi ) } } = { \frac { \mathrm { d } a \mathrm { d } b \mathrm { d } c \mathrm { d } d } { \mathrm { d } \rho \mathrm { d } \theta \mathrm { d } \phi \mathrm { d } \psi } } = { \frac { | { \frac { \mathrm { d } a } { \mathrm { d } \rho } } \quad { \frac { \mathrm { d } a } { \mathrm { d } \theta } } \quad { \frac { \mathrm { d } a } { \mathrm { d } \phi } } \quad { \frac { \mathrm { d } a } { \mathrm { d } \psi } } } { \mathrm { d } \rho \mathrm { d } \theta \mathrm { d } \phi \mathrm { d } \psi } } = { \frac { \mathrm { d } a \mathrm { d } b \mathrm { d } c \mathrm { d } d } { { \frac { \mathrm { d } \rho } { \mathrm { d } \rho } } \quad { \frac { \mathrm { d } b } { \mathrm { d } \theta } } \quad { \frac { \mathrm { d } b } { \mathrm { d } \phi } } } } \quad { \frac { \mathrm { d } b } { \mathrm { d } \psi } }
|
| 398 |
+
$$
|
| 399 |
+
|
| 400 |
+
$$
|
| 401 |
+
= \left| \begin{array} { c c c c } { \cos \theta } & { - \rho \sin \theta } & { 0 } & { 0 } \\ { \sin \theta \cos \phi } & { \rho \sin \theta \cos \phi } & { - \rho \sin \theta \sin \phi } & { 0 } \\ { \sin \theta \sin \phi \cos \psi } & { \rho \cos \theta \sin \phi \cos \psi } & { \rho \sin \theta \cos \phi \cos \psi } & { - \rho \sin \theta \sin \phi \sin \psi } \\ { \sin \theta \sin \phi \sin \psi } & { \rho \cos \theta \sin \phi \sin \psi } & { \rho \sin \theta \cos \phi \sin \psi } & { \rho \sin \theta \sin \phi \cos \psi } \end{array} \right| .
|
| 402 |
+
$$
|
| 403 |
+
|
| 404 |
+
And,
|
| 405 |
+
|
| 406 |
+
$$
|
| 407 |
+
J _ { f } = \rho ^ { 3 } \sin ^ { 2 } \theta \sin \phi .
|
| 408 |
+
$$
|
| 409 |
+
|
| 410 |
+
Therefore, by the Jacobian $J _ { f }$ , we have the polar form:
|
| 411 |
+
|
| 412 |
+
$$
|
| 413 |
+
\mathrm { d } a \mathrm { d } b \mathrm { d } c \mathrm { d } d = \rho ^ { 3 } \sin ^ { 2 } \theta \sin \phi \mathrm { d } \rho \mathrm { d } \theta \mathrm { d } \phi \mathrm { d } \psi .
|
| 414 |
+
$$
|
| 415 |
+
|
| 416 |
+
Then, writing Eq.(30) in polar coordinates, we obtain:
|
| 417 |
+
|
| 418 |
+
$$
|
| 419 |
+
\begin{array} { l } { { \displaystyle F _ { L } ( x , \sigma ) = \left( \frac { 1 } { \sqrt { 2 \pi \sigma ^ { 2 } } } \right) ^ { 4 } \int \int \int \int \left( \int _ { 0 } ^ { x } e ^ { - \alpha ^ { 2 } / 2 \sigma ^ { 2 } } e ^ { - b ^ { 2 } / 2 \sigma ^ { 2 } } e ^ { - c ^ { 2 } / 2 \sigma ^ { 2 } } { \mathrm { d } } ^ { 2 } e ^ { - d ^ { 2 } / 2 \sigma ^ { 2 } } { \mathrm { d } } S _ { x } \right. } } \\ { { \displaystyle \qquad = \frac { 1 } { 4 \pi ^ { 2 } \sigma ^ { 4 } } \int _ { 0 } ^ { 2 \pi } \int _ { 0 } ^ { \pi } \int _ { 0 } ^ { \pi } \int _ { 0 } ^ { \pi } e ^ { - \sigma ^ { 2 } / 2 \sigma ^ { 2 } } \rho ^ { 3 } \sin ^ { 2 } \theta \sin \phi \mathrm { d } \rho \mathrm { d } \theta \mathrm { d } \phi \mathrm { d } \psi } } \\ { { \displaystyle \qquad = \frac { 1 } { 4 \pi ^ { 2 } \sigma ^ { 4 } } \int _ { 0 } ^ { 2 \pi } \mathrm { d } \psi \int _ { 0 } ^ { \pi } \sin \phi \mathrm { d } \phi \int _ { 0 } ^ { \pi } \sin ^ { 2 } \theta \mathrm { d } \theta \int _ { 0 } ^ { x } \rho \mathrm { d } \theta \int _ { 0 } ^ { x } \rho ^ { 3 } e ^ { - \rho ^ { 2 } / 2 \sigma ^ { 2 } } \mathrm { d } \rho } } \\ { { \displaystyle \qquad = \frac { 1 } { 4 \pi ^ { 2 } \sigma ^ { 4 } } 2 \pi 2 \left[ \frac { \theta } { 2 } - \frac { \sin 2 \theta } { 4 } \right] _ { 0 } ^ { \pi } \int _ { 0 } ^ { x } \rho _ { e } ^ { 3 } e ^ { - \rho ^ { 2 } / 2 \sigma ^ { 2 } } \mathrm { d } \rho } } \\ { { \displaystyle \qquad = \frac { 1 } { 4 \pi ^ { 2 } \sigma ^ { 4 } } 4 \pi \frac { \pi } { 2 } \int _ { 0 } ^ { x } \rho ^ { 3 } e ^ { - \rho ^ { 2 } / 2 \sigma ^ { 2 } } \mathrm { d } \rho , } } \end{array}
|
| 420 |
+
$$
|
| 421 |
+
|
| 422 |
+
Then,
|
| 423 |
+
|
| 424 |
+
$$
|
| 425 |
+
F _ { L } ( x , \sigma ) = \frac { 1 } { 2 \sigma ^ { 4 } } \int _ { 0 } ^ { x } \rho ^ { 3 } e ^ { - \rho ^ { 2 } / 2 \sigma ^ { 2 } } \mathrm { d } \rho .
|
| 426 |
+
$$
|
| 427 |
+
|
| 428 |
+
The probability density function for $X$ is the derivative of its cumulative distribution function, which by the fundamental theorem of calculus is:
|
| 429 |
+
|
| 430 |
+
$$
|
| 431 |
+
\begin{array} { l } { { f _ { L } ( x , \sigma ) = \displaystyle \frac { \mathrm { d } } { \mathrm { d } x } F _ { L } ( x , \sigma ) } } \\ { { \displaystyle ~ = \frac { 1 } { 2 { \sigma } ^ { 4 } } x ^ { 3 } e ^ { - x ^ { 2 } / 2 { \sigma } ^ { 2 } } . } } \end{array}
|
| 432 |
+
$$
|
| 433 |
+
|
| 434 |
+
The expectation of the squared magnitude becomes:
|
| 435 |
+
|
| 436 |
+
$$
|
| 437 |
+
\begin{array} { l } { \displaystyle \mathbb { E } ( | W | ^ { 2 } ) = \int _ { 0 } ^ { \infty } x ^ { 2 } f ( x ) \mathrm { d } x } \\ { \displaystyle \qquad = \int _ { 0 } ^ { \infty } x ^ { 2 } \frac { 1 } { 2 \sigma ^ { 4 } } x ^ { 3 } e ^ { - x ^ { 2 } / 2 \sigma ^ { 2 } } \mathrm { d } x } \\ { \displaystyle \qquad = \frac { 1 } { 2 \sigma ^ { 4 } } \int _ { 0 } ^ { \infty } x ^ { 5 } e ^ { - x ^ { 2 } / 2 \sigma ^ { 2 } } \mathrm { d } x . } \end{array}
|
| 438 |
+
$$
|
| 439 |
+
|
| 440 |
+
With integration by parts we obtain:
|
| 441 |
+
|
| 442 |
+
$$
|
| 443 |
+
\begin{array} { l } { \displaystyle \mathbb { E } ( | W | ^ { 2 } ) = \frac { 1 } { 2 \sigma ^ { 4 } } \left( - x ^ { 4 } \sigma ^ { 2 } e ^ { - x ^ { 2 } / 2 \sigma ^ { 2 } } \Big | _ { 0 } ^ { \infty } + \int _ { 0 } ^ { \infty } \sigma ^ { 2 } 4 x ^ { 3 } e ^ { - x ^ { 2 } / 2 \sigma ^ { 2 } } { \mathrm { d } } x \right) } \\ { \displaystyle \qquad = \frac { 1 } { 2 \sigma ^ { 2 } } \left( - x ^ { 4 } e ^ { - x ^ { 2 } / 2 \sigma ^ { 2 } } \Big | _ { 0 } ^ { \infty } + \int _ { 0 } ^ { \infty } 4 x ^ { 3 } e ^ { - x ^ { 2 } / 2 \sigma ^ { 2 } } { \mathrm { d } } x \right) . } \end{array}
|
| 444 |
+
$$
|
| 445 |
+
|
| 446 |
+
The expectation $\mathbb { E } ( | W | ^ { 2 } )$ is the sum of two terms. The first one:
|
| 447 |
+
|
| 448 |
+
$$
|
| 449 |
+
\begin{array} { l } { { - x ^ { 4 } e ^ { - x ^ { 2 } / 2 \sigma ^ { 2 } } | _ { 0 } ^ { \infty } = \displaystyle \operatorname* { l i m } _ { x + \infty } - x ^ { 4 } e ^ { - x ^ { 2 } / 2 \sigma ^ { 2 } } - \operatorname* { l i m } _ { x + 0 } x ^ { 4 } e ^ { - x ^ { 2 } / 2 \sigma ^ { 2 } } } } \\ { { \qquad = \displaystyle \operatorname* { l i m } _ { x + \infty } - x ^ { 4 } e ^ { - x ^ { 2 } / 2 \sigma ^ { 2 } } , } } \end{array}
|
| 450 |
+
$$
|
| 451 |
+
|
| 452 |
+
Based on the L’Hôpital’s rule, the undetermined limit becomes:
|
| 453 |
+
|
| 454 |
+
$$
|
| 455 |
+
\begin{array} { l } { \displaystyle \operatorname* { l i m } _ { x \to + \infty } - x ^ { 4 } e ^ { - x ^ { 2 } / 2 \sigma ^ { 2 } } = - \underset { x \to + \infty } { \operatorname* { l i m } } \frac { x ^ { 4 } } { e ^ { x ^ { 2 } / 2 \sigma ^ { 2 } } } } \\ { \displaystyle = . . . } \\ { \displaystyle = - \underset { x \to + \infty } { \operatorname* { l i m } } \frac { 2 4 } { ( 1 / \sigma ^ { 2 } ) ( P ( x ) e ^ { x ^ { 2 } / 2 \sigma ^ { 2 } } ) } } \\ { \displaystyle = 0 . } \end{array}
|
| 456 |
+
$$
|
| 457 |
+
|
| 458 |
+
With $P ( x )$ is polynomial and has a limit to $+ \infty$ . The second term is calculated in a same way (integration by parts) and $\mathbb { E } ( | W | ^ { 2 } )$ becomes from Eq.(35):
|
| 459 |
+
|
| 460 |
+
$$
|
| 461 |
+
\begin{array} { l } { \displaystyle \mathbb { E } ( | W | ^ { 2 } ) = \frac { 1 } { 2 \sigma ^ { 2 } } \int _ { 0 } ^ { \infty } 4 x ^ { 3 } e ^ { - x ^ { 2 } / 2 \sigma ^ { 2 } } \mathrm { d } x } \\ { \displaystyle \qquad = \frac { 2 } { \sigma ^ { 2 } } \left( x ^ { 2 } \sigma ^ { 2 } e ^ { - x ^ { 2 } / 2 \sigma ^ { 2 } } \Big | _ { 0 } ^ { \infty } + \int _ { 0 } ^ { \infty } \sigma ^ { 2 } 2 x e ^ { - x ^ { 2 } / 2 \sigma ^ { 2 } } \mathrm { d } x \right) . } \end{array}
|
| 462 |
+
$$
|
| 463 |
+
|
| 464 |
+
The limit of first term is equals to 0 with the same method than in Eq.(36). Therefore, the expectation is:
|
| 465 |
+
|
| 466 |
+
$$
|
| 467 |
+
\begin{array} { c } { \displaystyle \mathbb { E } ( | W | ^ { 2 } ) = 4 \left( \int _ { 0 } ^ { \infty } x e ^ { - x ^ { 2 } / 2 \sigma ^ { 2 } } \mathrm { d } x \right) } \\ { = 4 \sigma ^ { 2 } . } \end{array}
|
| 468 |
+
$$
|
| 469 |
+
|
| 470 |
+
And finally the variance is:
|
| 471 |
+
|
| 472 |
+
$$
|
| 473 |
+
V a r ( | W | ) = 4 \sigma ^ { 2 } .
|
| 474 |
+
$$
|
| 475 |
+
|
| 476 |
+
# 6.3 QUATERNION BACKPROPAGATION THROUGH TIME
|
| 477 |
+
|
| 478 |
+
Let us recall the forward equations and parameters needed to derive the complete quaternion backpropagation through time (QBPTT) algorithm.
|
| 479 |
+
|
| 480 |
+
# 6.3.1 RECALL OF THE FORWARD PHASE
|
| 481 |
+
|
| 482 |
+
Let $x _ { t }$ be the input vector at timestep $t$ , $h _ { t }$ the hidden state, $W _ { h h }$ , $W _ { x h }$ and $W _ { h y }$ the hidden state, input and output weight matrices respectively. Finally $b _ { h }$ is the biases vector of the hidden states and $p _ { t } , y _ { t }$ are the output and the expected target vector.
|
| 483 |
+
|
| 484 |
+
$$
|
| 485 |
+
h _ { t } = \alpha ( h _ { t } ^ { p r e a c t } ) ,
|
| 486 |
+
$$
|
| 487 |
+
|
| 488 |
+
with,
|
| 489 |
+
|
| 490 |
+
$$
|
| 491 |
+
h _ { t } ^ { p r e a c t } = W _ { h h } \otimes h _ { t - 1 } + W _ { x h } \otimes x _ { t } + b _ { h } ,
|
| 492 |
+
$$
|
| 493 |
+
|
| 494 |
+
and $\alpha$ is the quaternion split activation function ( $\mathrm { X u }$ et al., 2017) of a quaternion $Q$ defined as:
|
| 495 |
+
|
| 496 |
+
$$
|
| 497 |
+
\alpha ( Q ) = f ( r ) + i f ( x ) + j f ( y ) + k f ( z ) ,
|
| 498 |
+
$$
|
| 499 |
+
|
| 500 |
+
and $f$ corresponding to any standard activation function. The output vector $p _ { t }$ can be computed as:
|
| 501 |
+
|
| 502 |
+
$$
|
| 503 |
+
p _ { t } = \beta ( p _ { t } ^ { p r e a c t } ) ,
|
| 504 |
+
$$
|
| 505 |
+
|
| 506 |
+
with
|
| 507 |
+
|
| 508 |
+
$$
|
| 509 |
+
p _ { t } ^ { p r e a c t } = W _ { h y } \otimes h _ { t } ,
|
| 510 |
+
$$
|
| 511 |
+
|
| 512 |
+
and $\beta$ any split activation function. Finally, the objective function is a real-valued loss function applied component-wise. The gradient with respect to the MSE loss is expressed for each weight matrix as $\frac { \partial \hat { E } _ { t } } { \partial W _ { h y } }$ , $\frac { \partial E _ { t } } { \partial W _ { h h } }$ , $\frac { \partial E _ { t } } { \partial W _ { h x } }$ , and for the bias vector as ∂Et∂B . In the real-valued space, the dynamic of the loss is only investigated based on all previously connected neurons. In this extent, the QBPTT differs from BPTT due to the fact that the loss must also be derived with respect to each component of a quaternion neural parameter, making it bi-level. This could act as a regularizer during the training process.
|
| 513 |
+
|
| 514 |
+
# 6.3.2 OUTPUT WEIGHT MATRIX
|
| 515 |
+
|
| 516 |
+
The weight matrix $W _ { h y }$ is used only in the computation of $p _ { t }$ . It is therefore straightforward to compute $\frac { \partial E _ { t } } { \partial W _ { h y } }$
|
| 517 |
+
|
| 518 |
+
$$
|
| 519 |
+
\frac { \partial E _ { t } } { \partial W _ { h y } } = \frac { \partial E _ { t } } { \partial W _ { h y } ^ { r } } + i \frac { \partial E _ { t } } { \partial W _ { h y } ^ { i } } + j \frac { \partial E _ { t } } { \partial W _ { h y } ^ { j } } + k \frac { \partial E _ { t } } { \partial W _ { h y } ^ { k } } .
|
| 520 |
+
$$
|
| 521 |
+
|
| 522 |
+
Each quaternion component is then derived following the chain rule:
|
| 523 |
+
|
| 524 |
+
$$
|
| 525 |
+
\begin{array} { r l r } { { \frac { \partial E _ { t } } { \partial W _ { h y } ^ { r } } = \frac { \partial E _ { t } } { \partial p _ { t } ^ { r } } \frac { \partial p _ { t } ^ { r } } { \partial W _ { h y } ^ { r } } + \frac { \partial E _ { t } } { \partial p _ { t } ^ { i } } \frac { \partial p _ { t } ^ { i } } { \partial W _ { h y } ^ { r } } + \frac { \partial E _ { t } } { \partial p _ { t } ^ { j } } \frac { \partial p _ { t } ^ { j } } { \partial W _ { h y } ^ { r } } + \frac { \partial E _ { t } } { \partial p _ { t } ^ { k } } \frac { \partial p _ { t } ^ { k } } { \partial W _ { h y } ^ { r } } } } \\ & { } & { = ( p _ { t } ^ { r } - y _ { t } ^ { r } ) \times h _ { t } ^ { r } + ( p _ { t } ^ { i } - y _ { t } ^ { i } ) \times h _ { t } ^ { i } + ( p _ { t } ^ { j } - y _ { t } ^ { j } ) \times h _ { t } ^ { j } + ( p _ { t } ^ { k } - y _ { t } ^ { k } ) \times h _ { t } ^ { k } . } \end{array}
|
| 526 |
+
$$
|
| 527 |
+
|
| 528 |
+
$$
|
| 529 |
+
\begin{array} { r l r } { { \frac { \partial E _ { t } } { \partial W _ { h y } ^ { i } } = \frac { \partial E _ { t } } { \partial p _ { t } ^ { r } } \frac { \partial p _ { t } ^ { r } } { \partial W _ { h y } ^ { i } } + \frac { \partial E _ { t } } { \partial p _ { t } ^ { i } } \frac { \partial p _ { t } ^ { i } } { \partial W _ { h y } ^ { i } } + \frac { \partial E _ { t } } { \partial p _ { t } ^ { j } } \frac { \partial p _ { t } ^ { j } } { \partial W _ { h y } ^ { i } } + \frac { \partial E _ { t } } { \partial p _ { t } ^ { k } } \frac { \partial p _ { t } ^ { k } } { \partial W _ { h y } ^ { i } } } } \\ & { } & { = ( p _ { t } ^ { r } - y _ { t } ^ { r } ) \times - h _ { t } ^ { i } + ( p _ { t } ^ { i } - y _ { t } ^ { i } ) \times h _ { t } ^ { r } + ( p _ { t } ^ { j } - y _ { t } ^ { j } ) \times h _ { t } ^ { k } + ( p _ { t } ^ { k } - y _ { t } ^ { k } ) \times - h _ { t } ^ { j } . } \end{array}
|
| 530 |
+
$$
|
| 531 |
+
|
| 532 |
+
$$
|
| 533 |
+
\begin{array} { r l } & { \frac { \partial E _ { t } } { \partial W _ { h y } ^ { j } } = \frac { \partial E _ { t } } { \partial p _ { t } ^ { r } } \frac { \partial p _ { t } ^ { r } } { \partial W _ { h y } ^ { j } } + \frac { \partial E _ { t } } { \partial p _ { t } ^ { i } } \frac { \partial p _ { t } ^ { i } } { \partial W _ { h y } ^ { j } } + \frac { \partial E _ { t } } { \partial p _ { t } ^ { j } } \frac { \partial p _ { t } ^ { j } } { \partial W _ { h y } ^ { j } } + \frac { \partial E _ { t } } { \partial p _ { t } ^ { k } } \frac { \partial p _ { t } ^ { k } } { \partial W _ { h y } ^ { j } } } \\ & { \qquad = ( p _ { t } ^ { r } - y _ { t } ^ { r } ) \times - h _ { t } ^ { j } + ( p _ { t } ^ { i } - y _ { t } ^ { i } ) \times - h _ { t } ^ { k } + ( p _ { t } ^ { j } - y _ { t } ^ { j } ) \times h _ { t } ^ { r } + ( p _ { t } ^ { k } - y _ { t } ^ { k } ) \times h _ { t } ^ { i } . } \end{array}
|
| 534 |
+
$$
|
| 535 |
+
|
| 536 |
+
$$
|
| 537 |
+
\begin{array} { r l } & { \frac { \partial E _ { t } } { \partial W _ { h y } ^ { k } } = \frac { \partial E _ { t } } { \partial p _ { t } ^ { r } } \frac { \partial p _ { t } ^ { r } } { \partial W _ { h y } ^ { k } } + \frac { \partial E _ { t } } { \partial p _ { t } ^ { i } } \frac { \partial p _ { t } ^ { i } } { \partial W _ { h y } ^ { k } } + \frac { \partial E _ { t } } { \partial p _ { t } ^ { j } } \frac { \partial p _ { t } ^ { j } } { \partial W _ { h y } ^ { k } } + \frac { \partial E _ { t } } { \partial p _ { t } ^ { k } } \frac { \partial p _ { t } ^ { k } } { \partial W _ { h y } ^ { k } } } \\ & { \qquad = ( p _ { t } ^ { r } - y _ { t } ^ { r } ) \times - h _ { t } ^ { k } + ( p _ { t } ^ { i } - y _ { t } ^ { i } ) \times h _ { t } ^ { j } + ( p _ { t } ^ { j } - y _ { t } ^ { j } ) \times - h _ { t } ^ { i } + ( p _ { t } ^ { k } - y _ { t } ^ { k } ) \times h _ { t } ^ { r } . } \end{array}
|
| 538 |
+
$$
|
| 539 |
+
|
| 540 |
+
By regrouping in a matrix form the $h _ { t }$ components from these equations, one can define:
|
| 541 |
+
|
| 542 |
+
$$
|
| 543 |
+
\left[ \begin{array} { l l l l } { h _ { t } ^ { r } } & { h _ { t } ^ { i } } & { h _ { t } ^ { j } } & { h _ { t } ^ { k } } \\ { - h _ { t } ^ { i } } & { h _ { t } ^ { r } } & { h _ { t } ^ { k } } & { - h _ { t } ^ { j } } \\ { - h _ { t } ^ { j } } & { - h _ { t } ^ { k } } & { h _ { t } ^ { r } } & { h _ { t } ^ { i } } \\ { - h _ { t } ^ { k } } & { h _ { t } ^ { j } } & { - h _ { t } ^ { i } } & { h _ { t } ^ { r } } \end{array} \right] = h _ { t } ^ { * } .
|
| 544 |
+
$$
|
| 545 |
+
|
| 546 |
+
Therefore,
|
| 547 |
+
|
| 548 |
+
$$
|
| 549 |
+
\frac { \partial E _ { t } } { \partial W _ { h y } } = ( p _ { t } - y _ { t } ) \otimes h _ { t } ^ { * } .
|
| 550 |
+
$$
|
| 551 |
+
|
| 552 |
+
# 6.3.3 HIDDEN WEIGHT MATRIX
|
| 553 |
+
|
| 554 |
+
Conversely to $W _ { h y }$ the weight matrix $W _ { h h }$ is an argument of $h _ { t }$ with $h _ { t - 1 }$ involved. The recursive backpropagation can thus be derived as:
|
| 555 |
+
|
| 556 |
+
$$
|
| 557 |
+
\frac { \partial E } { \partial W _ { h h } } = \sum _ { t = 0 } ^ { N } \frac { \partial E _ { t } } { \partial W _ { h h } } .
|
| 558 |
+
$$
|
| 559 |
+
|
| 560 |
+
And,
|
| 561 |
+
|
| 562 |
+
$$
|
| 563 |
+
\frac { \partial E _ { t } } { \partial W _ { h h } } = \sum _ { m = 0 } ^ { t } \frac { \partial E _ { m } } { \partial W _ { h h } ^ { r } } + i \frac { \partial E _ { m } } { \partial W _ { h h } ^ { r } } + j \frac { \partial E _ { m } } { \partial W _ { h h } ^ { i } } + k \frac { \partial E _ { m } } { \partial W _ { h h } ^ { k } } ,
|
| 564 |
+
$$
|
| 565 |
+
|
| 566 |
+
with $N$ the number of timesteps that compose the sequence. As for $W _ { h y }$ we start with $\frac { \partial E _ { k } } { \partial W _ { h h } ^ { r } }$
|
| 567 |
+
|
| 568 |
+
$$
|
| 569 |
+
\begin{array} { r } { \displaystyle \sum _ { m = 0 } ^ { t } { \frac { \partial E _ { m } } { \partial W _ { h h } ^ { r } } } = \sum _ { m = 0 } ^ { t } { \frac { \partial E _ { t } } { \partial h _ { t } ^ { r } } \frac { \partial h _ { t } ^ { r } } { \partial h _ { m } ^ { r } } \frac { \partial h _ { m } ^ { r } } { \partial W _ { h h } ^ { r } } } + \frac { \partial E _ { t } } { \partial h _ { t } ^ { i } } \frac { \partial h _ { t } ^ { i } } { \partial h _ { m } ^ { i } } \frac { \partial h _ { m } ^ { i } } { \partial W _ { h h } ^ { r } } } \\ { \displaystyle + \frac { \partial E _ { t } } { \partial h _ { t } ^ { j } } \frac { \partial h _ { t } ^ { j } } { \partial h _ { m } ^ { j } } \frac { \partial h _ { m } ^ { j } } { \partial W _ { h h } ^ { r } } + \frac { \partial E _ { t } } { \partial h _ { t } ^ { k } } \frac { \partial h _ { t } ^ { i } } { \partial h _ { m } ^ { k } } \frac { \partial h _ { m } ^ { k } } { \partial W _ { h h } ^ { r } } . } \end{array}
|
| 570 |
+
$$
|
| 571 |
+
|
| 572 |
+
Non-recursive elements are derived w.r.t r, i,j, $\mathbf { k }$ :
|
| 573 |
+
|
| 574 |
+
$$
|
| 575 |
+
\begin{array} { r l } & { \frac { \partial E _ { t } } { \partial h _ { t } ^ { r } } = \frac { \partial E _ { t } } { \partial p _ { t } ^ { r } } \frac { \partial p _ { t } ^ { r } } { \partial h _ { t } ^ { r } } + \frac { \partial E _ { t } } { \partial p _ { t } ^ { i } } \frac { \partial p _ { t } ^ { i } } { \partial h _ { t } ^ { r } } + \frac { \partial E _ { t } } { \partial p _ { t } ^ { j } } \frac { \partial p _ { t } ^ { j } } { \partial h _ { t } ^ { r } } + \frac { \partial E _ { t } } { \partial p _ { t } ^ { k } } \frac { \partial p _ { t } ^ { k } } { \partial h _ { t } ^ { r } } } \\ & { \qquad = ( p _ { t } ^ { r } - y _ { t } ^ { r } ) \times f ^ { ' } ( p _ { t } ^ { r } ) \times W _ { h y } ^ { r } + ( p _ { t } ^ { i } - y _ { t } ^ { i } ) \times f ^ { ' } ( p _ { t } ^ { i } ) \times W _ { h y } ^ { i } } \\ & { \qquad + ( p _ { t } ^ { j } - y _ { t } ^ { j } ) \times f ^ { ' } ( p _ { t } ^ { j } ) \times W _ { h y } ^ { j } + ( p _ { t } ^ { k } - y _ { t } ^ { k } ) \times f ^ { ' } ( p _ { t } ^ { k } ) \times W _ { h y } ^ { k } . } \end{array}
|
| 576 |
+
$$
|
| 577 |
+
|
| 578 |
+
$$
|
| 579 |
+
\begin{array} { r l r } { { \frac { \partial E _ { t } } { \partial h _ { t } ^ { i } } = \frac { \partial E _ { t } } { \partial p _ { t } ^ { r } } \frac { \partial p _ { t } ^ { r } } { \partial h _ { t } ^ { i } } + \frac { \partial E _ { t } } { \partial p _ { t } ^ { i } } \frac { \partial p _ { t } ^ { i } } { \partial h _ { t } ^ { i } } + \frac { \partial E _ { t } } { \partial p _ { t } ^ { j } } \frac { \partial p _ { t } ^ { j } } { \partial h _ { t } ^ { i } } + \frac { \partial E _ { t } } { \partial p _ { t } ^ { k } } \frac { \partial p _ { t } ^ { k } } { \partial h _ { t } ^ { i } } } } \\ & { } & { = ( p _ { t } ^ { r } - y _ { t } ^ { r } ) \times f ^ { ' } ( p _ { t } ^ { r } ) \times - W _ { h y } ^ { i } + ( p _ { t } ^ { i } - y _ { t } ^ { i } ) \times f ^ { ' } ( p _ { t } ^ { i } ) \times W _ { h y } ^ { r } } \\ & { } & { + ( p _ { t } ^ { j } - y _ { t } ^ { j } ) \times f ^ { ' } ( p _ { t } ^ { j } ) \times W _ { h y } ^ { k } + ( p _ { t } ^ { k } - y _ { t } ^ { k } ) \times f ^ { ' } ( p _ { t } ^ { k } ) \times - W _ { h y } ^ { j } . } \end{array}
|
| 580 |
+
$$
|
| 581 |
+
|
| 582 |
+
$$
|
| 583 |
+
\begin{array} { r l r } { { \frac { \partial E _ { t } } { \partial h _ { t } ^ { j } } = \frac { \partial E _ { t } } { \partial p _ { t } ^ { r } } \frac { \partial p _ { t } ^ { r } } { \partial h _ { t } ^ { j } } + \frac { \partial E _ { t } } { \partial p _ { t } ^ { i } } \frac { \partial p _ { t } ^ { i } } { \partial h _ { t } ^ { j } } + \frac { \partial E _ { t } } { \partial p _ { t } ^ { j } } \frac { \partial p _ { t } ^ { j } } { \partial h _ { t } ^ { j } } + \frac { \partial E _ { t } } { \partial p _ { t } ^ { k } } \frac { \partial p _ { t } ^ { k } } { \partial h _ { t } ^ { j } } } } \\ & { } & { = ( p _ { t } ^ { r } - y _ { t } ^ { r } ) \times f ^ { ' } ( p _ { t } ^ { r } ) \times - W _ { h y } ^ { j } + ( p _ { t } ^ { i } - y _ { t } ^ { i } ) \times f ^ { ' } ( p _ { t } ^ { i } ) \times - W _ { h y } ^ { k } } \\ & { } & { + ( p _ { t } ^ { j } - y _ { t } ^ { j } ) \times f ^ { ' } ( p _ { t } ^ { j } ) \times W _ { h y } ^ { r } + ( p _ { t } ^ { k } - y _ { t } ^ { k } ) \times f ^ { ' } ( p _ { t } ^ { k } ) \times W _ { h y } ^ { i } . } \end{array}
|
| 584 |
+
$$
|
| 585 |
+
|
| 586 |
+
$$
|
| 587 |
+
\begin{array} { r l } & { \frac { \partial E _ { t } } { \partial h _ { t } ^ { k } } = \frac { \partial E _ { t } } { \partial p _ { t } ^ { r } } \frac { \partial p _ { t } ^ { r } } { \partial h _ { t } ^ { k } } + \frac { \partial E _ { t } } { \partial p _ { t } ^ { i } } \frac { \partial p _ { t } ^ { i } } { \partial h _ { t } ^ { k } } + \frac { \partial E _ { t } } { \partial p _ { t } ^ { j } } \frac { \partial p _ { t } ^ { j } } { \partial h _ { t } ^ { k } } + \frac { \partial E _ { t } } { \partial p _ { t } ^ { k } } \frac { \partial p _ { t } ^ { k } } { \partial h _ { t } ^ { k } } } \\ & { \qquad = ( p _ { t } ^ { r } - y _ { t } ^ { r } ) \times f ^ { ' } ( p _ { t } ^ { r } ) \times - W _ { h y } ^ { k } + ( p _ { t } ^ { i } - y _ { t } ^ { i } ) \times f ^ { ' } ( p _ { t } ^ { i } ) \times W _ { h y } ^ { j } } \\ & { \qquad + ( p _ { t } ^ { j } - y _ { t } ^ { j } ) \times f ^ { ' } ( p _ { t } ^ { j } ) \times - W _ { h y } ^ { i } + ( p _ { t } ^ { k } - y _ { t } ^ { k } ) \times f ^ { ' } ( p _ { t } ^ { k } ) \times W _ { h y } ^ { r } . } \end{array}
|
| 588 |
+
$$
|
| 589 |
+
|
| 590 |
+
Then,
|
| 591 |
+
|
| 592 |
+
$$
|
| 593 |
+
\left[ \begin{array} { l l l l } { \frac { \partial h _ { r , m } } { \partial W _ { r h } ^ { _ { n } } } = h _ { r , t - 1 } } & { \frac { \partial h _ { i , m } } { \partial W _ { r h } ^ { _ { n } } } = h _ { i , t - 1 } } & { \frac { \partial h _ { j , m } } { \partial W _ { r h } ^ { _ { n } } } = h _ { j , t - 1 } } & { \frac { \partial h _ { k , m } } { \partial W _ { h h } ^ { _ { n } } } = h _ { k , t - 1 } } \\ { \frac { \partial h _ { r , m } } { \partial W _ { h h } ^ { _ { n } } } = - h _ { i , t - 1 } } & { \frac { \partial h _ { i , m } } { \partial W _ { h h } ^ { _ { n } } } = h _ { i , t - 1 } } & { \frac { \partial h _ { j , m } } { \partial W _ { h h } ^ { _ { n } } } = h _ { j , t - 1 } } & { \frac { \partial h _ { k , m } } { \partial W _ { h h } ^ { _ { n } } } = h _ { k , t - 1 } } \\ { \frac { \partial h _ { r , m } } { \partial W _ { h h } ^ { _ { n } } } = - h _ { j , t - 1 } } & { \frac { \partial h _ { i , m } } { \partial W _ { h h } ^ { _ { n } } } = - h _ { k , t - 1 } } & { \frac { \partial h _ { j , m } } { \partial W _ { h h } ^ { _ { n } } } = h _ { r , t - 1 } } & { \frac { \partial h _ { k , m } } { \partial W _ { h h } ^ { _ { n } } } = h _ { i , t - 1 } } \\ { \frac { \partial h _ { r , m } } { \partial W _ { h h } ^ { _ { n } } } = - h _ { k , t - 1 } } & { \frac { \partial h _ { i , m } } { \partial W _ { h h } ^ { _ { n } } } = h _ { j , t - 1 } } & { \frac { \partial h _ { j , m } } { \partial W _ { h h } ^ { _ { n } } } = - h _ { i , t - 1 } } & { \frac { \partial h _ { k , m } } { \partial W _ { h h } ^ { _ { n } } } = h _ { r , t - 1 } } \end{array} \right] = h _ { t } ^ { * } .
|
| 594 |
+
$$
|
| 595 |
+
|
| 596 |
+
The remaining terms $\frac { \partial h _ { t } ^ { r } } { \partial h _ { m } ^ { r } } , \frac { \partial h _ { t } ^ { i } } { \partial h _ { m } ^ { i } } , \frac { \partial h _ { t } ^ { j } } { \partial h _ { m } ^ { j } }$ and $\frac { \partial h _ { t } ^ { k } } { \partial h _ { m } ^ { k } }$ are recursive and are written as:
|
| 597 |
+
|
| 598 |
+
$$
|
| 599 |
+
\begin{array} { r } { \frac { \partial h _ { r , t } } { \partial h _ { r , m } } = \prod _ { n = m + 1 } ^ { t } \frac { \partial h _ { r , n } } { \partial h _ { r , n } ^ { p r e a c t } } \frac { \partial h _ { r , n } ^ { p r e a c t } } { \partial h _ { r , n - 1 } } + \frac { \partial h _ { r , n } } { \partial h _ { i , n } ^ { p r e a c t } } \frac { \partial h _ { i , n } ^ { p r e a c t } } { \partial h _ { r , n - 1 } } } \\ { + \frac { \partial h _ { r , n } } { \partial h _ { j , n } ^ { p r e a c t } } \frac { \partial h _ { j , n } ^ { p r e a c t } } { \partial h _ { r , n - 1 } } + \frac { \partial h _ { r , n } } { \partial h _ { k , n } ^ { p r e a c t } } \frac { \partial h _ { k , n } ^ { p r e a c t } } { \partial h _ { r , n - 1 } } , } \end{array}
|
| 600 |
+
$$
|
| 601 |
+
|
| 602 |
+
simplified with,
|
| 603 |
+
|
| 604 |
+
$$
|
| 605 |
+
\begin{array} { r } { \frac { \partial h _ { r , t } } { \partial h _ { r , m } } = \displaystyle \prod _ { n = m + 1 } ^ { t } \frac { \partial h _ { r , n } } { \partial h _ { r , n } ^ { p r e a c t } } \times W _ { h h } ^ { r } + \frac { \partial h _ { r , n } } { \partial h _ { i , n } ^ { p r e a c t } } \times W _ { h h } ^ { i } } \\ { + \frac { \partial h _ { r , n } } { \partial h _ { j , n } ^ { p r e a c t } } \times W _ { h h } ^ { j } + \frac { \partial h _ { r , n } } { \partial h _ { k , n } ^ { p r e a c t } } \times W _ { h h } ^ { k } . } \end{array}
|
| 606 |
+
$$
|
| 607 |
+
|
| 608 |
+
Consequently,
|
| 609 |
+
|
| 610 |
+
$$
|
| 611 |
+
\begin{array} { r } { \frac { \partial h _ { i , t } } { \partial h _ { i , m } } = \displaystyle \prod _ { n = m + 1 } ^ { t } \frac { \partial h _ { i , n } } { \partial h _ { r , n } ^ { p r e a c t } } \times - W _ { h h } ^ { i } + \frac { \partial h _ { i , n } } { \partial h _ { i , n } ^ { p r e a c t } } \times W _ { h h } ^ { r } } \\ { + \frac { \partial h _ { j , n } } { \partial h _ { j , n } ^ { p r e a c t } } \times W _ { h h } ^ { k } + \frac { \partial h _ { i , n } } { \partial h _ { k , n } ^ { p r e a c t } } \times - W _ { h h } ^ { j } . } \end{array}
|
| 612 |
+
$$
|
| 613 |
+
|
| 614 |
+
$$
|
| 615 |
+
\frac { \partial h _ { j , t } } { \partial h _ { j , m } } = \prod _ { n = m + 1 } ^ { t } \frac { \partial h _ { j , n } } { \partial h _ { r , n } ^ { p r e a c t } } \times - W _ { h h } ^ { j } + \frac { \partial h _ { j , n } } { \partial h _ { i , n } ^ { p r e a c t } } \times - W _ { h h } ^ { k }
|
| 616 |
+
$$
|
| 617 |
+
|
| 618 |
+
$$
|
| 619 |
+
\begin{array} { r } { \frac { \partial h _ { k , t } } { \partial h _ { k , m } } = \displaystyle \prod _ { n = m + 1 } ^ { t } \frac { \partial h _ { k , n } } { \partial h _ { r , n } ^ { p r e a c t } } \times - W _ { h h } ^ { k } + \frac { \partial h _ { k , n } } { \partial h _ { i , n } ^ { p r e a c t } } \times W _ { h h } ^ { j } } \\ { + \frac { \partial h _ { k , n } } { \partial h _ { j , n } ^ { p r e a c t } } \times - W _ { h h } ^ { i } + \frac { \partial h _ { k , n } } { \partial h _ { k , n } ^ { p r e a c t } } \times W _ { h h } ^ { r } . } \end{array}
|
| 620 |
+
$$
|
| 621 |
+
|
| 622 |
+
The same operations are performed for i,j,k in Eq. 68 and $\frac { \partial E _ { t } } { \partial W _ { h h } }$ can finally be expressed as:
|
| 623 |
+
|
| 624 |
+
$$
|
| 625 |
+
\frac { \partial E _ { t } } { \partial W _ { h h } } = \sum _ { m = 0 } ^ { t } ( \prod _ { n = m + 1 } ^ { t } \delta _ { n } ) \otimes h _ { t - 1 } ^ { * } ,
|
| 626 |
+
$$
|
| 627 |
+
|
| 628 |
+
with,
|
| 629 |
+
|
| 630 |
+
$$
|
| 631 |
+
\delta _ { n } = \left\{ \begin{array} { l l } { W _ { h h } ^ { * } \otimes \delta _ { n + 1 } \times \alpha ^ { \prime } ( h _ { n } ^ { p r e a c t } ) } & { \mathrm { i f ~ } n \neq t } \\ { W _ { h y } ^ { * } \otimes ( p _ { n } - y _ { n } ) \times \beta ^ { ' } ( p _ { n } ^ { p r e a c t } ) } & { \mathrm { e l s e } . } \end{array} \right.
|
| 632 |
+
$$
|
| 633 |
+
|
| 634 |
+
# 6.3.4 INPUT WEIGHT MATRIX
|
| 635 |
+
|
| 636 |
+
∂Et∂W is computed in the exact same manner as $\frac { \partial E _ { t } } { \partial W _ { h h } }$
|
| 637 |
+
|
| 638 |
+
$$
|
| 639 |
+
\frac { \partial E } { \partial W _ { h x } } = \sum _ { t = 0 } ^ { N } \frac { \partial E _ { t } } { \partial W _ { h x } } .
|
| 640 |
+
$$
|
| 641 |
+
|
| 642 |
+
And,
|
| 643 |
+
|
| 644 |
+
$$
|
| 645 |
+
\frac { \partial E _ { t } } { \partial W _ { h x } } = \sum _ { m = 0 } ^ { t } \frac { \partial E _ { m } } { \partial W _ { h x } ^ { r } } + i \frac { \partial E _ { m } } { \partial W _ { h x } ^ { r } } + j \frac { \partial E _ { m } } { \partial W _ { h x } ^ { i } } + k \frac { \partial E _ { m } } { \partial W _ { h x } ^ { k } } .
|
| 646 |
+
$$
|
| 647 |
+
|
| 648 |
+
Therefore $\frac { \partial E _ { t } } { \partial W _ { h x } }$ is easily extent as:
|
| 649 |
+
|
| 650 |
+
$$
|
| 651 |
+
\frac { \partial E _ { t } } { \partial W _ { h x } } = \sum _ { m = 0 } ^ { t } ( \prod _ { n = m + 1 } ^ { t } \delta _ { n } ) \otimes x _ { t } ^ { * } .
|
| 652 |
+
$$
|
| 653 |
+
|
| 654 |
+
# 6.3.5 HIDDEN BIASES
|
| 655 |
+
|
| 656 |
+
$\frac { \partial E _ { t } } { \partial B _ { h } }$ can easily be extended to:
|
| 657 |
+
|
| 658 |
+
$$
|
| 659 |
+
\frac { \partial E } { \partial B _ { h } } = \sum _ { t = 0 } ^ { N } \frac { \partial E _ { t } } { \partial B _ { h } } .
|
| 660 |
+
$$
|
| 661 |
+
|
| 662 |
+
And,
|
| 663 |
+
|
| 664 |
+
$$
|
| 665 |
+
\frac { \partial E _ { t } } { \partial B _ { h } } = \sum _ { m = 0 } ^ { t } \frac { \partial E _ { m } } { \partial B _ { h } ^ { r } } + i \frac { \partial E _ { m } } { \partial B _ { h } ^ { r } } + j \frac { \partial E _ { m } } { \partial B _ { h } ^ { i } } + k \frac { \partial E _ { m } } { \partial B _ { h } ^ { k } } .
|
| 666 |
+
$$
|
| 667 |
+
|
| 668 |
+
Nonetheless, since biases are not connected to any inputs or hidden states, the matrix of derivatives defined in Eq. 59 becomes a matrix of 1. Consequently $\frac { \partial E _ { t } } { \partial B _ { h } }$ can be summarized as:
|
| 669 |
+
|
| 670 |
+
$$
|
| 671 |
+
\frac { \partial E _ { t } } { \partial B _ { h } } = \sum _ { m = 0 } ^ { t } ( \prod _ { n = m + 1 } ^ { t } \delta _ { n } ) .
|
| 672 |
+
$$
|
md/train/Byey7n05FQ/Byey7n05FQ.md
ADDED
|
@@ -0,0 +1,412 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# PLAN ONLINE, LEARN OFFLINE: EFFICIENT LEARNING ANDEXPLORATION VIA MODEL-BASED CONTROL
|
| 2 |
+
|
| 3 |
+
Kendall Lowrey∗1 Aravind Rajeswaran∗1
|
| 4 |
+
|
| 5 |
+
Sham Kakade1 Emanuel Todorov1,2 Igor Mordatch3
|
| 6 |
+
|
| 7 |
+
∗ Equal contributions 1 University of Washington 2 Roboti LLC 3 OpenAI
|
| 8 |
+
|
| 9 |
+
klowrey, aravraj, sham, todorov @cs.uw.edu, mordatch@openai.com
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
We propose a “plan online and learn offline” framework for the setting where an agent, with an internal model, needs to continually act and learn in the world. Our work builds on the synergistic relationship between local model-based control, global value function learning, and exploration. We study how local trajectory optimization can cope with approximation errors in the value function, and can stabilize and accelerate value function learning. Conversely, we also study how approximate value functions can help reduce the planning horizon and allow for better policies beyond local solutions. Finally, we also demonstrate how trajectory optimization can be used to perform temporally coordinated exploration in conjunction with estimating uncertainty in value function approximation. This exploration is critical for fast and stable learning of the value function. Combining these components enable solutions to complex control tasks, like humanoid locomotion and dexterous in-hand manipulation, in the equivalent of a few minutes of experience in the real world.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
We consider a setting where an agent with limited memory and computational resources is dropped into a world. The agent has to simultaneously act in the world and learn to become proficient in the tasks it encounters. Let us further consider a setting where the agent has some prior knowledge about the world in the form of a nominal dynamics model. However, the state space of the world could be very large and complex, and the set of possible tasks very diverse. This complexity and diversity, combined with limited computational capability, rules out the possibility of an omniscient agent that has experienced all situations and knows how to act optimally in all states, even if the agent knows the dynamics. Thus, the agent has to act in the world while learning to become competent.
|
| 18 |
+
|
| 19 |
+
Based on the knowledge of dynamics and its computational resources, the agent is imbued with a local search procedure in the form of trajectory optimization. While the agent would certainly benefit from the most powerful of trajectory optimization algorithms, it is plausible that very complex procedures are still insufficient or inadmissible due to the complexity or inherent unpredictability of the environment. Limited computational resources may also prevent these powerful methods from real-time operation. While the trajectory optimizer may be insufficient by itself, we show that it provides a powerful vehicle for the agent to explore and learn about the world.
|
| 20 |
+
|
| 21 |
+
Due to the limited capabilities of the agent, a natural expectation is for the agent to be moderately competent for new tasks that occur infrequently and skillful in situations that it encounters repeatedly by learning from experience. Based on this intuition, we propose the plan online and learn offline (POLO) framework for continual acting and learning. POLO is based on the tight synergistic coupling between local trajectory optimization, global value function learning, and exploration.
|
| 22 |
+
|
| 23 |
+
We will first provide intuitions for why there may be substantial performance degradation when acting greedily using an approximate value function. We also show that value function learning can be accelerated and stabilized by utilizing trajectory optimization integrally in the learning process, and that a trajectory optimization procedure in conjunction with an approximate value function can compute near optimal actions. In addition, exploration is critical to propagate global information in value function learning, and for trajectory optimization to escape local solutions and saddle points. In POLO, the agent forms hypotheses on potential reward regions, and executes temporally coordinated action sequences through trajectory optimization. This is in contrast to strategies like $\epsilon -$ greedy and Boltzmann exploration that explore at the granularity of individual timesteps. The use of trajectory optimization enables the agent to perform directed and efficient exploration, which in turn helps to find better global solutions.
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: Examples of tasks solved with POLO. A 2D point agent navigating a maze without any directed reward signal, a complex 3D humanoid standing up from the floor, pushing a box, and inhand re-positioning of a cube to various orientations with a five-fingered hand. Video demonstration of our results can be found at: https://sites.google.com/view/polo-mpc.
|
| 27 |
+
|
| 28 |
+
The setting studied in the paper models many problems of interest in robotics and artificial intelligence. Local trajectory optimization becomes readily feasible when a nominal model and computational resources are available to an agent, and can accelerate learning of novel task instances. In this work, we study the case where the internal nominal dynamics model used by the agent is accurate. Nominal dynamics models based on knowledge of physics (Todorov et al., 2012), or through learning (Ljung, 1987), complements a growing body of work on successful simulation to reality transfer and system identification (Ross & Bagnell, 2012; Rajeswaran et al., 2016; Lowrey et al., 2018; OpenAI, 2018). Combining the benefits of local trajectory optimization for fast improvement with generalization enabled by learning is critical for robotic agents that live in our physical world to continually learn and acquire a large repertoire of skills.
|
| 29 |
+
|
| 30 |
+
# 2 THE POLO FRAMEWORK
|
| 31 |
+
|
| 32 |
+
The POLO framework combines three components: local trajectory optimization, global value function approximation, and an uncertainty and reward aware exploration strategy. We first present the motivation for each component, followed by the full POLO procedure.
|
| 33 |
+
|
| 34 |
+
# 2.1 DEFINITIONS, NOTATIONS, AND SETTING
|
| 35 |
+
|
| 36 |
+
We model the world as an infinite horizon discounted Markov Decision Process (MDP), which is characterized by the tuple: $\mathcal { M } = \{ \boldsymbol { S } , \mathcal { A } , \mathcal { R } , \mathcal { T } , \boldsymbol { \gamma } \}$ . $S \in \mathbb { R } ^ { n }$ and $\mathcal { A } \in \mathbb { R } ^ { m }$ represent the continuous (real-valued) state and action spaces respectively. $\mathcal { R } : \mathcal { S } \times \mathcal { A } \mathbb { R }$ represents the reward function. $\mathcal { T } : \mathcal { S } \times \mathcal { A } \times \mathcal { S } \to \mathbb { R } _ { + }$ represents the dynamics model, which in general could be stochastic, and $\gamma \in [ 0 , 1 )$ is the discount factor. A policy $\pi : S \times A \to \mathbb { R } _ { + }$ describes a mapping from states to actions. The value of a policy at a state is the average discounted reward accumulated by following the policy from the state: $\begin{array} { r } { V ^ { \bar { \pi } } ( s ) = \mathbb { E } [ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r ( s _ { t } , \pi ( s _ { t } ) ) \mid s _ { 0 } = s ] . } \end{array}$ . The overall performance of the policy over some start state distribution $\beta$ is given by: $J ^ { \beta } ( \pi ) = \mathbb { E } _ { s \sim \beta } [ V ^ { \pi } ( s ) ]$ . For notational simplicity, we use $s ^ { \prime }$ to denote the next state visited after (from) $s$ .
|
| 37 |
+
|
| 38 |
+
As described earlier, we consider the setting where an agent is dropped into a complex world. The agent has access to an internal model of the world. However, the world can be complex and diverse, ruling out the possibility of an omniscient agent. To improve its behavior, the agent has to explore and understand relevant parts of the state space while it continues to act in the world. Due to the availability of the internal model, the agent can revisit states it experienced in the world and reason about alternate potential actions and their consequences to learn more efficiently.
|
| 39 |
+
|
| 40 |
+
# 2.2 VALUE FUNCTION APPROXIMATION
|
| 41 |
+
|
| 42 |
+
The optimal value function describes the long term discounted reward the agent receives under the optimal policy. Defining the Bellman operator at state $s$ as:
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
B V ( s ) = \operatorname* { m a x } _ { a } \mathbb { E } \left[ r ( s , a ) + \gamma V ( s ^ { \prime } ) \right] ,
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
the optimal value function $V ^ { * }$ corresponds to the fixed point: $V ^ { * } ( s ) = B V ^ { * } ( s ) \forall s \in \mathcal { S }$ . For small, tabular MDPs, classical dynamic programming algorithms like value iteration can be used to obtain the optimal value function. The optimal policy can be recovered from the value function as: $\pi ^ { * } ( s ) = { \mathrm { \bar { a r g } } } \operatorname* { m a x } _ { a } \mathbb { E } [ r ( s , a ) + \gamma V ^ { * } ( s ^ { \prime } ) ]$ . For more complex MDPs, computing the optimal value function exactly is not tractable except in a few well known cases like the LQR (Astr ˚ om & Mur- ¨ ray, 2004) and LMDPs (Todorov, 2006; Dvijotham & Todorov, 2011). Thus, various approximate techniques have been considered in prior works. One popular approach is fitted value iteration (Bertsekas & Tsitsiklis, 1996; Munos & Szepesvari ´ , 2008), where a function approximator (e.g. neural network) is used to approximate the optimal value function. The core structure of fitted value iteration considers a collection of states (or a sampling distribution $\nu$ ), and a parametric value function approximator $\hat { V } _ { \theta }$ . Inspired by value iteration, fitted value iteration updates parameters as:
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
\theta _ { i + 1 } = \arg \operatorname* { m i n } _ { \theta } \mathbb { E } _ { s \sim \nu } \left[ \left( \hat { V } _ { \theta } ( s ) - \mathcal { B } \hat { V } _ { \theta _ { i } } ( s ) \right) ^ { 2 } \right]
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
where $B \hat { V } _ { \boldsymbol { \theta } _ { i } } ( s )$ are targets for the regression problem computed at the specific state $s$ according to Eq. (1). After sufficient iterations of the procedure in Eq. (2) to get a good approximation, the policy is recovered as $\begin{array} { r } { \hat { \pi } ( s ) = \arg \operatorname* { m a x } _ { a } \mathbb { E } [ r ( s , a ) + \gamma \hat { V } _ { \theta } ( s ^ { \prime } ) ] } \end{array}$ . The success and convergence of this overall procedure depends critically on at least two components: the capacity and structure of the function approximator $( \theta )$ ; and the sampling distribution $( \nu )$ .
|
| 55 |
+
|
| 56 |
+
Lemma 1. (Bertsekas & Tsitsiklis, 1996) Let $\hat { V }$ be an approximate value function with $\ell _ { \infty }$ error $\begin{array} { r } { \epsilon : = \operatorname* { m a x } _ { s } | \hat { V } ( s ) - V ^ { * } ( s ) | } \end{array}$ . Let $\hat { \pi } ( s ) = \arg \operatorname* { m a x } _ { a } \mathbb { E } [ r ( s , a ) + \gamma \hat { V } ( s ^ { \prime } ) ]$ be the induced greedy policy. For all MDPs and $\beta$ , the bound in Eq. (3) holds. Furthermore, for any size of the state space, there exist MDPs and $\hat { V }$ for which the bound is tight (holds with equality).
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
J ^ { \beta } ( \pi ^ { * } ) - J ^ { \beta } ( \hat { \pi } ) \leq \frac { 2 \gamma \epsilon } { 1 - \gamma }
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
Intuitively, this suggests that performance of $\hat { \pi }$ degrades with a dependence on effective problem horizon determined by $\gamma$ . This can be understood as the policy paying a price of $\epsilon$ at every timestep. Due to the use of function approximation, errors may be inevitable. In practice, we are often interested in temporally extended tasks where $\gamma \approx 1$ , and hence this possibility is concerning. Furthermore, the arg max operation in $\hat { \pi }$ could inadvertently exploit approximation errors to produce a poor policy. The performance of fitted value iteration based methods also rely critically on the sampling distribution to propagate global information (Munos & Szepesvari ´ , 2008), especially in sparse reward settings. For some applications, it may be possible to specify good sampling distributions using apriori knowledge of where the optimal policy should visit (e.g. based on demonstration data). However, automatically generating such sampling distributions when faced with a new task may be difficult, and is analogous to the problem of exploration.
|
| 63 |
+
|
| 64 |
+
# 2.3 TRAJECTORY OPTIMIZATION AND MODEL PREDICTIVE CONTROL
|
| 65 |
+
|
| 66 |
+
Trajectory optimization and model predictive control (MPC) have a long history in robotics and control systems (Garcia et al., 1989; Tassa et al., 2014)1. In MPC, starting from state $s _ { t }$ and using the knowledge of the dynamics model, a locally optimal sequence of actions (or policies) up to a moving horizon of $H$ is computed by solving the following optimization problem.
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\begin{array} { r l } { \underset { \{ \tilde { \pi } _ { k } \} _ { k = t } ^ { t + H } } { \mathrm { m a x i m i z e } } } & { \mathbb { E } \left[ \overset { t + H - 1 } { \sum _ { k = t } ^ { t - 1 } } \gamma ^ { ( k - t ) } r ( \pmb { x } _ { t } , \pmb { u } _ { t } ) + \gamma ^ { H } r _ { f } ( \pmb { x } _ { t + H } ) \right] } \\ { \mathrm { s u b j e c t ~ t o } } & { \pmb { x } _ { k + 1 } \sim T ( \pmb { x } _ { k } , \pmb { u } _ { k } ) } \\ & { \pmb { u } _ { k } \sim \tilde { \pi } _ { t } ( \cdot | \pmb { x } _ { k } ) } \\ & { \pmb { x } _ { t } = s _ { t } . } \end{array}
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
Here, we use $\mathbf { \Delta } x , \mathbf { \Delta } u , \tilde { \pi }$ as dummy variables for states, actions, and policy to distinguish the “imagined” evolution of the MDP used for the trajectory optimization with the actual states (s) observed in the true evolution of the MDP. Here, $r ( { \pmb x } , { \pmb u } )$ represents the running reward which is the same as the MDP reward function, and $r _ { f } ( \pmb { x } _ { t + H } )$ represents a terminal reward function. Let $\{ \tilde { \pi } _ { k } ^ { * } \}$ be the local time-indexed policies obtained as the solution to the optimization problem in (4). After solving the optimization problem, the first local time-indexed policy is used as $\hat { \pi } _ { M P C } ( \cdot | s _ { t } ) : = \tilde { \pi } _ { t } ^ { \ast } ( \cdot | \boldsymbol { x } _ { t } )$ . The entire procedure is repeated again in the next time step $( t + 1 )$ . Note that we have defined the optimization problem over a sequence of feedback policies. However, if the dynamics is deterministic, a sequence of actions {uk}t+Hk=t can be optimized and used instead without any loss in performance. See Appendix C for further discussions. This approach has led to tremendous success in a variety of control systems such as power grids, chemical process control (Qina & Badgwellb, 2003), and more recently in robotics (Williams et al., 2016). Since MPC looks forward only $H$ steps, it is ultimately a local method unless coupled with a value function that propagates global information. In addition, we also provide intuitions for why MPC may help accelerate the learning of value functions. This synergistic effect between MPC and global value function forms a primary motivation for POLO.
|
| 73 |
+
|
| 74 |
+
# Impact of approximation errors in the value function
|
| 75 |
+
|
| 76 |
+
Lemma 2. Let $\hat { V }$ be an approximate value function with $\ell _ { \infty }$ error $\epsilon : = \operatorname* { m a x } _ { s } | \hat { V } ( s ) - V ^ { * } ( s ) |$ . Suppose the terminal reward in Eq. (4) is chosen as $r _ { f } ( s _ { H } ) = \hat { V } ( s _ { H } )$ , and let the MPC policy be $\hat { \pi } _ { M P C } ( \cdot | s _ { t } ) : = \tilde { \pi } _ { t } ^ { \ast } ( \cdot | \pmb { x } _ { t } )$ (from Eq. 4). Then, for all MDPs and $\beta$ , the performance of the MPC policy can be bounded as:
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
J ^ { \beta } ( \pi ^ { * } ) - J ^ { \beta } ( \hat { \pi } _ { M P C } ) \leq \frac { 2 \gamma ^ { H } \epsilon } { 1 - \gamma ^ { H } } .
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
Proof. The proof is provided in Appendix C.
|
| 83 |
+
|
| 84 |
+
This suggests that MPC (with $H > 1$ ) is less susceptible to approximation errors than greedy action selection. Also, without a terminal value function, we have $\dot { \epsilon } = \mathcal { O } ( r _ { \operatorname* { m a x } } / ( 1 - \gamma ) )$ in the worst case, which adds an undesirable scaling with the problem horizon.
|
| 85 |
+
|
| 86 |
+
Accelerating convergence of the value function Furthermore, MPC can also enable faster con
|
| 87 |
+
vergtor: his, considern the tabular $\mathrm { H }$ -step Bellg, for any n opand $\begin{array} { r } { \mathcal { B } ^ { H } V ( s ) : = \operatorname* { m a x } _ { a _ { 0 : H - 1 } } \mathbb { E } [ \sum _ { t = 0 } ^ { H - 1 } \gamma ^ { t } r _ { t } + \gamma ^ { H } V ( s _ { H } ) ] . } \end{array}$ $V _ { 1 }$ $V _ { 2 }$ $\begin{array} { r } { | \mathcal { B } ^ { H } V _ { 1 } - \mathcal { B } ^ { H } V _ { 2 } | _ { \infty } \leq \gamma ^ { H } | V _ { 1 } - V _ { 2 } | _ { \infty } . } \end{array}$ $B ^ { H }$
|
| 88 |
+
of global information for $H$ steps, thereby accelerating the convergence due to faster mixing. Note
|
| 89 |
+
that one way to realize $B ^ { H }$ is to simply apply $B H$ times, with each step providing a contraction by $\gamma$ .
|
| 90 |
+
In the general setting, it is unknown if there exists alternate, cheaper ways to realize $B ^ { H }$ . However,
|
| 91 |
+
for problems in continuous control, MPC based on local dynamic programming methods (Jacobson
|
| 92 |
+
& Mayne, 1970; Todorov & Li, 2005) provide an efficient way to approximately realize $B ^ { H }$ , which
|
| 93 |
+
can be used to accelerate and stabilize value function learning.
|
| 94 |
+
|
| 95 |
+
# 2.4 PLANNING TO EXPLORE
|
| 96 |
+
|
| 97 |
+
The ability of an agent to explore the relevant parts of the state space is critical for the convergence of many RL algorithms. Typical exploration strategies like $\epsilon$ -greedy and Boltzmann take exploratory actions with some probability on a per time-step basis. Instead, by using MPC, the agent can explore in the space of trajectories. The agent can consider a hypothesis of potential reward regions in the state space, and then execute the optimal trajectory conditioned on this belief, resulting in a
|
| 98 |
+
|
| 99 |
+
1: Inputs: planning horizon $H$ , value function parameters $\theta _ { 1 } , \theta _ { 2 } , \dots . \theta _ { K }$ , mini-batch size $n$ , num
|
| 100 |
+
ber of gradient steps $G$ , update frequency $Z$
|
| 101 |
+
2: for $t = 1$ to $\infty$ do
|
| 102 |
+
3: Select action $a _ { t }$ according to MPC (Eq. 4) with terminal reward $r _ { f } ( s ) \equiv { \hat { V } } ( s )$ from Eq. (7)
|
| 103 |
+
4: Add the state experience $s _ { t }$ to replay buffer $\mathcal { D }$
|
| 104 |
+
5: if $\mod ( t , Z ) = 0$ then
|
| 105 |
+
6: for $G$ times do
|
| 106 |
+
7: Sample $n$ states from the replay buffer, and compute targets using Eq. (8)
|
| 107 |
+
8: Update the value functions using Eq. (6) (see Section 2.5 for details)
|
| 108 |
+
9: end for
|
| 109 |
+
10: end if
|
| 110 |
+
11: end for
|
| 111 |
+
|
| 112 |
+
temporally coordinated sequence of actions. By executing such coordinated actions, the agent can cover the state space more rapidly and intentionally, and avoid back and forth wandering that can slow down the learning. We demonstrate this effect empirically in Section 3.1.
|
| 113 |
+
|
| 114 |
+
To generate the hypothesis of potentially rewarding regions, we take a Bayesian view and approximately track a posterior over value functions. Consider a motivating setting of regression, where we have a parametric function approximator $f _ { \theta }$ with prior $\mathbb { P } ( \boldsymbol { \theta } )$ . The dataset consists of input-output pairs: $\bar { \mathcal { D } } = ( x _ { i } , y _ { i } ) _ { i = 1 } ^ { n }$ , and we wish to approximate $\mathbb { P } ( \boldsymbol { \theta } | \mathcal { D } )$ . In the Bayesian linear regression setting with Gaussian prior and noise models, the solution to the following problem generates samples from the posterior (Osband et al., 2016; Azizzadenesheli et al., 2018a; Osband et al., 2018):
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\arg \operatorname* { m i n } _ { \theta } | | \tilde { y } _ { i } - f _ { \tilde { \theta } } ( x _ { i } ) - f _ { \theta } ( x _ { i } ) | | _ { 2 } ^ { 2 } + \frac { \sigma ^ { 2 } } { \lambda } | | \theta | | _ { 2 } ^ { 2 }
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
where $\tilde { y } _ { i } \sim \mathcal N ( y _ { i } , \sigma ^ { 2 } )$ is a noisy version of the target and $\tilde { \theta } \sim \mathbb { P } ( \theta )$ is a sample from the prior. Based on this, Osband et al. (2018) demonstrate the benefits of uncertainty estimation for exploration. Similarly, we use this procedure to obtain samples from the posterior for value function approximation, and utilize them for temporally coordinated action selection using MPC. We consider $K$ value function approximators $\hat { V } _ { \theta }$ with parameters $\theta _ { 1 } , \theta _ { 2 } , \dots \theta _ { K }$ independently trained based on Eq. (6). We consider the softmax of the different samples as the value at a state:
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\hat { V } ( s ) = \sum _ { k = 1 } ^ { K } \omega _ { k } ( s ) \hat { V } _ { { \boldsymbol \theta } _ { k } } ( s ) , ~ \mathrm { w h e r e } ~ \omega _ { k } ( s ) \stackrel { \mathrm { d e f } } { : = } \frac { \exp \big ( \kappa \hat { V } _ { { \boldsymbol \theta } _ { k } } ( s ) \big ) } { \sum _ { j = 1 } ^ { K } \exp \big ( \kappa \hat { V } _ { { \boldsymbol \theta } _ { j } } ( s ) \big ) }
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
Since the above scheme approximates mean $^ +$ variance for small $\kappa > 0$ , this procedure encourages the agent to additionally explore parts of the state space where the disagreement between the function approximators is large. This corresponds to the broad notion of optimism in the face of uncertainty (Auer et al., 2002) which has been successful in a number of applications (Silver et al., 2016; Li et al., 2010).
|
| 127 |
+
|
| 128 |
+
# 2.5 FINAL ALGORITHM
|
| 129 |
+
|
| 130 |
+
To summarize, POLO utilizes a global value function approximation scheme, a local trajectory optimization subroutine, and an optimistic exploration scheme. POLO operates as follows: when acting in the world, the agent uses the internal model and always picks the optimal action suggested by MPC. Exploration is implicitly handled by tracking the value function uncertainties and the optimistic evaluation, as specified in Eq. (6) and (7). All the experience (visited states) from the world are stored into a replay buffer $\mathcal { D }$ , with old experiences discarded if the buffer becomes full. After every $Z$ steps of acting in the world and collecting experience, the value functions are updated by: (a) constructing the targets according to Eq. (8); (b) performing regression using the randomized prior scheme using Eq. (6) where $f _ { \theta }$ corresponds to the value function approximator. For state $s$ in the buffer and value network $k$ with parameters $\theta _ { k }$ , the targets are constructed as:
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
y ^ { k } ( s ) = \operatorname* { m a x } _ { \{ \tilde { \pi } _ { t } \} _ { t = 0 } ^ { N - 1 } } \mathbb { E } \left[ \sum _ { t = 0 } ^ { N - 1 } \gamma ^ { t } r ( x _ { t } , u _ { t } ) + \gamma ^ { N } \hat { V } _ { \theta _ { k } } ( x _ { N } ) \right] , \mathrm { ~ w h e r e ~ } x _ { 0 } = s , u _ { t } \sim \tilde { \pi } _ { t } ( \cdot | x _ { t } ) ,
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
which corresponds to solving a $N -$ step trajectory optimization problem starting from state $s$ . As described earlier, using trajectory optimization to generate the targets for fitting the value approximation accelerates the convergence and makes the learning more stable, as verified experimentally in Section 3.3. The overall procedure is summarized in Algorithm 1.
|
| 137 |
+
|
| 138 |
+
# 3 EMPIRICAL RESULTS AND DISCUSSION
|
| 139 |
+
|
| 140 |
+
Through empirical evaluation, we wish to answer the following questions:
|
| 141 |
+
|
| 142 |
+
1. Does trajectory optimization in conjunction with uncertainty estimation in value function approximation result in temporally coordinated exploration strategies? 2. Can the use of an approximate value function help reduce the planning horizon for MPC? 3. Does trajectory optimization enable faster and more stable value function learning?
|
| 143 |
+
|
| 144 |
+
Before answering the questions in detail, we first point out that POLO can scale up to complex high-dimensional agents like 3D humanoid and dexterous anthropomorphic hand (OpenAI, 2018; Rajeswaran et al., 2018) which are among the most complex control tasks studied in robot learning. Video demonstration can be found at: https://sites.google.com/view/polo-mpc
|
| 145 |
+
|
| 146 |
+
# 3.1 TRAJECTORY OPTIMIZATION FOR EXPLORATION
|
| 147 |
+
|
| 148 |
+
Exploration is critical in tasks where immediate rewards are not well aligned with long-term objectives. As a representative problem, we consider a point mass agent in different 2D worlds illustrated in figure 2: a simple finite size box with no obstacles and a maze. This domain serves to provide an intuitive understanding of the interaction between trajectory optimization and exploration while also enabling visualization of results. In the extreme case of no rewards in the world, an agent with only local information would need to continuously explore. We wish to understand how POLO, with its ensemble of value functions tracking uncertainties, uses MPC to perform temporally coordinated actions. Our baseline is an agent that employs random exploration on a per-time-step basis; MPC without a value function would not move due to lack of local extrinsic rewards. Second, we consider an agent that performs uncertainty estimation similar to POLO but selects actions greedily (i.e. POLO with a planning horizon of 1). Finally, we consider the POLO agent which tracks value uncertainties and selects actions using a 32-step MPC procedure. We observe that POLO achieves more region coverage in both point mass worlds compared to alternatives, as quantitatively illustrated in figure 2(a). The ensemble value function in POLO allows the agent to recognize the true, low value of visited states, while preserving an optimistic value elsewhere. Temporally coordinated action is necessary in the maze world; POLO is able to navigate down all corridors.
|
| 149 |
+
|
| 150 |
+

|
| 151 |
+
Figure 2: 2D point mass navigation task in a world with no rewards. Fig. (a) describes the percentage of an occupancy grid covered by the agent, averaged over 10 random seeds. Fig. (b) depicts an agent over 1000 timesteps; red indicates regions of high value (uncertainty) while blue denotes low. The value function learns to assign the true, low values to regions visited and preserves high values to unexplored regions; uncertainty and long horizons are observed to be critical for exploration.
|
| 152 |
+
|
| 153 |
+

|
| 154 |
+
Figure 3: Performance as a function of planning horizon for the humanoid getup (left), and inhand manipulation task (middle). POLO was trained for 12000 and 2500 environment timesteps, respectively. We test POLO with the learned terminal value function against pure MPC and compare average reward obtained over 3 trials in the getup task and 1000 steps in the manipulation task. On the right, a value function trained with POLO is used by MPC without per-time-step rewards. The agent’s height increases, indicating a task-relevant value function. For comparison, we also include the trace of POLO with dense rewards and multiple trials (dashed vertical lines)
|
| 155 |
+
|
| 156 |
+
# 3.2 VALUE FUNCTION APPROXIMATION FOR TRAJECTORY OPTIMIZATION
|
| 157 |
+
|
| 158 |
+
Next, we study if value learning helps to reduce the planning horizon for MPC. To this end, we consider two high dimensional tasks: humanoid getup where a 3D humanoid needs to learn to stand up from the ground, and in-hand manipulation where a five-fingered hand needs to re-orient a cube to a desired configuration that is randomized every 75 timesteps. For simplicity, we use the MPPI algorithm (Williams et al., 2016) for trajectory optimization. In Figure 3, we consider MPC and the full POLO algorithm of the same horizon, and compare their performance after $T$ steps of learning in the world. We find that POLO uniformly dominates MPC, indicating that the agent is consolidating experience from the world into the value function. With even the longest planning horizon, the humanoid getup task has a local solution where it can quickly sit up, but cannot discover a chain of actions required to stand upright. POLO’s exploration allows the agent to escape the local solution, and consolidate the experiences to consistently stand up. To further test if the learned value function is task aligned, we take the value function trained with POLO, and use it with MPC without any intermediate rewards. Thus, the MPC is optimizing a trajectory of length $H = 6 4$ purely using the value function of the state after 64 steps. We observe, in Figure 3, that even in this case, the humanoid is able to consistently increase its height from the floor indicating that the value function has captured task relevant details. We note that a greedy optimization procedure with this value function does not yield good results, indicating that the learned value function is only approximate and not good everywhere.
|
| 159 |
+
|
| 160 |
+
While the humanoid getup task presents temporal complexity requiring a large planning horizon, the in-hand manipulation task presents spatial complexity. A large number of time steps are not needed to manipulate the object, and a strong signal about progress is readily received. However, since the targets can change rapidly, the variance in gradient estimates can be very high for function approximation methods (Ghosh et al., 2018). Trajectory optimization is particularly well suited for such types of problems, since it can efficiently compute near-optimal actions conditioned on the instance, facilitating function approximation. Note that the trajectory optimizer is unaware that the targets can change, and attempts to optimize a trajectory for a fixed instance of the task. The value function consolidates experience over multiple target changes, and learns to give high values to states that are not just immediately good but provide a large space of affordances for the possible upcoming tasks.
|
| 161 |
+
|
| 162 |
+
# 3.3 TRAJECTORY OPTIMIZATION FOR VALUE FUNCTION LEARNING
|
| 163 |
+
|
| 164 |
+
Finally, we study if trajectory optimization can aid in accelerating and stabilizing value function learning. To do so, we again consider the humanoid getup task and study different variants of POLO. In particular, we vary the horizon $( N )$ used for computing the value function targets in Eq. (8). We observe that as we increase $N$ , the agent learns the value function with fewer interactions with the world, as indicated in Figure 4(a). The benefit of using $N -$ step returns for stable value function learning and actor-critic methods have been observed in numerous works (Mnih et al., 2016; Munos et al., 2016; Schulman et al., 2016), and our experiments reinforce these observations. The use of $N -$ step returns help to traverse the bias-variance trade-off. Furthermore, due to the discounting, the contribution of $V { \left( s _ { N } \right) }$ is made weaker and thus the targets are more stable. This mirrors ideas such as target networks (Mnih et al., 2015) commonly used to stabilize training. As discussed earlier, longer horizons make trajectory optimization more tolerant to errors in the value function. To illustrate this, we take the value function trained with POLO on a nominal humanoid model, and perturb the model by changing the size of the head to model value function degradation. Figure 4(b) shows that a longer planning horizon can mitigate this degradation. This presents intriguing future possibility of using MPC to improve transfer learning between tasks or robot platforms.
|
| 165 |
+
|
| 166 |
+

|
| 167 |
+
Figure 4: Usefulness of trajectory optimization for value function learning. (a) illustrates that $N$ -step trajectory optimization accelerates the learning of the value function. $N { = } 1$ corresponds to trajectory centric fitted value iteration. A difference of 0.2 reward to MPC amounts to approximately $5 0 \%$ performance improvement. (b) value function trained for the nominal model (head size of 1.0) used with MPC for models with larger sizes.
|
| 168 |
+
|
| 169 |
+
# 4 RELATED WORK
|
| 170 |
+
|
| 171 |
+
Planning and learning: Combining elements of planning and search with approximate value functions has been explored in discrete game domains (Silver et al., 2017; Anthony et al., 2017) where an MCTS planner is informed by the value function. Alternatively, using prior data to guide the search process in continuous MCTS without explicitly learning a value function has also been explored (Rajamaki & H ¨ am¨ al¨ ainen ¨ , 2017). Related to this, Atkeson (1993) uses an offline trajectory library for action selection in real-time, but do not explicitly consider learning parametric value functions. RTDP (Barto et al., 1995) considers learning value functions based on states visited by the agent, but does not explicitly employ the use of planning. Zhong et al. (2013) consider the setting of learning a value function to help MPC, and found the contribution of value functions to be weak for the relatively simple tasks considered in their work. Approaches such as cost shaping $\mathrm { N g }$ et al., 1999) can also be interpreted as hand specifying an approximate value function, and has been successfully employed with MPC (Tassa et al., 2012). However, this often require careful human design and task specific expertise. An alternative set of approaches (Ross et al., 2011; Levine & Koltun, 2013; Mordatch & Todorov, 2014; Sun et al., 2018b) use local trajectory optimization to generate a dataset for training a global policy through imitation learning. These approaches do not use MPC at runtime, and hence may often require retraining for changes in tasks or environment. Furthermore, results from this line of work have been demonstrated primarily in settings where trajectory optimization alone can solve the task, or use human demonstration data. In contrast, through our exploration schemes, we are able to improve over the capabilities of MPC and solve tasks where MPC is unsuccessful.
|
| 172 |
+
|
| 173 |
+
Planning and exploration: Exploration is a well-studied and important problem in RL. The importance of having a wide and relevant state distribution has been pointed out in numerous prior works (Munos & Szepesvari ´ , 2008; Bagnell et al., 2003; Rajeswaran et al., 2017). Strategies such as $\epsilon$ -greedy or Gaussian exploration have recently been used to successfully solve a large number of dense reward problems. As the reward becomes sparse or heavily delayed, such strategies become intractable in high-dimensional settings. Critically, these approaches perform exploration on a per time-step basis, which can lead to back and forth wandering preventing efficient exploration. Parameter-space exploration (Plappert et al., 2017; Fortunato et al., 2017) methods do not explore at each time step, but rather generate correlated behaviors based on explored parameters at the start. However, such approaches do not consider exploration as an intentional act, but is rather a deviation from a well defined objective for the agent. Deep exploration strategies (Osband et al., 2013) sample a value function from the posterior and use it for greedy action selection. Approaches based on notions of intrinsic motivation and information gain (Chentanez et al., 2005; Stadie et al., 2015; Houthooft et al., 2016; Pathak et al., 2017; Bellemare et al., 2016) also explicitly introduce exploration bonuses into the agent’s reward system. However, such approaches critically do not have the element of planning to explore; thus the agent may not actually reach regions of high predicted reward because it does not know how to get there. Our work is perhaps closest to the $E 3$ framework of Kearns & Singh (2002), which considers altered MDPs with different reward functions, and executes the optimal action under that MDP. However solving these altered MDPs is expensive and their solution is quickly discarded. MPC on the other hand can quickly solve for local instance-specific solutions in these MDPs.
|
| 174 |
+
|
| 175 |
+
Model-free RL: Our work investigates how much training times can be reduced over model-free methods when the internal model is an accurate representation of the world model. As a representative number, Schulman et al. (2015) report approximately 5 days of agent experience and 128 CPU core hours for solving tasks such as getting up from the ground. In contrast, POLO requires only 12 CPU core hours and 96 seconds of agent experience. Recently, policy gradient methods were also used for in-hand manipulation tasks (OpenAI, 2018), where 3 years of simulated experience and 500 CPU hours were used for object reorientation tasks. For a similar task, POLO only required 1 CPU hour. Of course, model-free methods do not require an accurate internal model, but our results suggest that much less experience may be required for the control aspect of the problem. Our work can be viewed as a strong model-based baseline that model-free RL can strive to compete with, as well as a directly useful method for researchers studying simulation to reality transfer.
|
| 176 |
+
|
| 177 |
+
In an alternate line of work, internal models have been used for variance reduction purposes in model-free RL (Feinberg et al., 2018; Buckman et al., 2018), in contrast to our use of MPC. Related to this, Azizzadenesheli et al. (2018b) consider learning an internal model for discrete action domains like ALE and use short horizon MCTS for planning. Similarly, Nagabandi et al. (2018) learn a dynamics model in simple continuous control tasks and use a random shooting MPC method for action selection. These lines of work consider the interplay between learning dynamics models and planning procedures, and try to improve the quality of internal models. As a consequence, they focus on domains where simple action selection procedures with accurate models obtain near-optimal performance. In our work, we show that we can learn value functions to help real-time action selection with MPC on some of the most high-dimensional continuous control tasks studied recently. Thus, the two lines of work are complementary, and combining POLO with model learning would make for an interesting line of future work.
|
| 178 |
+
|
| 179 |
+
# 5 CONCLUSIONS AND FUTURE WORK
|
| 180 |
+
|
| 181 |
+
In this work we presented POLO, which combines the strengths of trajectory optimization and value function learning. In addition, we studied the benefits of planning for exploration in settings where we track uncertainties in the value function. Together, these components enabled control of complex agents like 3D humanoid and five-fingered hand. In this work, we assumed access to an accurate internal dynamics model. A natural next step is to study the influence of approximation errors in the internal model and improving it over time using the real world interaction data.
|
| 182 |
+
|
| 183 |
+
# REFERENCES
|
| 184 |
+
|
| 185 |
+
Thomas Anthony, Zheng Tian, and David Barber. Thinking fast and slow with deep learning and tree search. In Advances in Neural Information Processing Systems, pp. 5360–5370, 2017.
|
| 186 |
+
|
| 187 |
+
Karl Johan Astr ˚ om and Richard M. Murray. Feedback systems an introduction for scientists and ¨ engineers. 2004.
|
| 188 |
+
|
| 189 |
+
Christopher G. Atkeson. Using local trajectory optimizers to speed up global optimization in dynamic programming. In NIPS, 1993.
|
| 190 |
+
|
| 191 |
+
Peter Auer, Nicolo Cesa-Bianchi, and Paul Fischer. Finite-time analysis of the multiarmed bandit problem. Machine learning, 47(2-3):235–256, 2002.
|
| 192 |
+
|
| 193 |
+
Kamyar Azizzadenesheli, Emma Brunskill, and Anima Anandkumar. Efficient exploration through bayesian deep q-networks. CoRR, abs/1802.04412, 2018a.
|
| 194 |
+
|
| 195 |
+
Kamyar Azizzadenesheli, Brandon Yang, Weitang Liu, Emma Brunskill, Zachary Chase Lipton, and Anima Anandkumar. Sample-efficient deep rl with generative adversarial tree search. CoRR, abs/1806.05780, 2018b.
|
| 196 |
+
|
| 197 |
+
J. Andrew Bagnell, Sham M. Kakade, Andrew Y. Ng, and Jeff G. Schneider. Policy search by dynamic programming. In NIPS, 2003.
|
| 198 |
+
|
| 199 |
+
Andrew G. Barto, Steven J. Bradtke, and Satinder P. Singh. Learning to act using real-time dynamic programming. Artif. Intell., 72:81–138, 1995.
|
| 200 |
+
|
| 201 |
+
Marc G. Bellemare, Sriram Srinivasan, Georg Ostrovski, Tom Schaul, David Saxton, and Remi ´ Munos. Unifying count-based exploration and intrinsic motivation. In NIPS, 2016.
|
| 202 |
+
|
| 203 |
+
Dimitri Bertsekas and John Tsitsiklis. Neuro-dynamic Programming. 1996.
|
| 204 |
+
|
| 205 |
+
Jacob Buckman, Danijar Hafner, George Tucker, Eugene Brevdo, and Honglak Lee. Sampleefficient reinforcement learning with stochastic ensemble value expansion. arXiv preprint arXiv:1807.01675, 2018.
|
| 206 |
+
|
| 207 |
+
Nuttapong Chentanez, Andrew G Barto, and Satinder P Singh. Intrinsically motivated reinforcement learning. In Advances in neural information processing systems, pp. 1281–1288, 2005.
|
| 208 |
+
|
| 209 |
+
Krishnamurthy Dvijotham and Emanuel Todorov. A unifying framework for linearly solvable control. In UAI, 2011.
|
| 210 |
+
|
| 211 |
+
Vladimir Feinberg, Alvin Wan, Ion Stoica, Michael I. Jordan, Joseph Gonzalez, and Sergey Levine. Model-based value estimation for efficient model-free reinforcement learning. CoRR, abs/1803.00101, 2018.
|
| 212 |
+
|
| 213 |
+
Meire Fortunato, Mohammad Gheshlaghi Azar, Bilal Piot, Jacob Menick, Ian Osband, Alex Graves, Vlad Mnih, Remi Munos, Demis Hassabis, Olivier Pietquin, et al. Noisy networks for exploration. arXiv preprint arXiv:1706.10295, 2017.
|
| 214 |
+
|
| 215 |
+
Carlos E. Garcia, David M. Prett, and Manfred Morari. Model predictive control: Theory and practice - a survey. Automatica, 25:335–348, 1989.
|
| 216 |
+
|
| 217 |
+
Dibya Ghosh, Avi Singh, Aravind Rajeswaran, Vikash Kumar, and Sergey Levine. Divide-andconquer reinforcement learning. In ICLR, 2018.
|
| 218 |
+
|
| 219 |
+
Rein Houthooft, Xi Chen, Yan Duan, John Schulman, Filip De Turck, and Pieter Abbeel. Vime: Variational information maximizing exploration. In Advances in Neural Information Processing Systems, pp. 1109–1117, 2016.
|
| 220 |
+
|
| 221 |
+
David Jacobson and David Mayne. Differential Dynamic Programming. American Elsevier Publishing Company, 1970.
|
| 222 |
+
|
| 223 |
+
Michael Kearns and Satinder Singh. Near-optimal reinforcement learning in polynomial time. Machine learning, 49(2-3):209–232, 2002.
|
| 224 |
+
|
| 225 |
+
Vikash Kumar. Manipulators and Manipulation in high dimensional spaces. PhD thesis, University of Washington, Seattle, 2016. URL https://digital.lib.washington.edu/ researchworks/handle/1773/38104.
|
| 226 |
+
|
| 227 |
+
Sergey Levine and Vladlen Koltun. Guided policy search. In ICML, 2013.
|
| 228 |
+
|
| 229 |
+
Lihong Li, Wei Chu, John Langford, and Robert E. Schapire. A contextual-bandit approach to personalized news article recommendation. In WWW, 2010.
|
| 230 |
+
|
| 231 |
+
Lennart Ljung. System identification: theory for the user. 1987.
|
| 232 |
+
|
| 233 |
+
Kendall Lowrey, Svetoslav Kolev, Jeremy Dao, Aravind Rajeswaran, and Emanuel Todorov. Reinforcement learning for non-prehensile manipulation: Transfer from simulation to physical system. CoRR, abs/1803.10371, 2018.
|
| 234 |
+
|
| 235 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 2015.
|
| 236 |
+
|
| 237 |
+
Volodymyr Mnih, Adria Puigdom \` enech Badia, Mehdi Mirza, Alex Graves, Timothy P. Lillicrap, Tim \` Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In ICML, 2016.
|
| 238 |
+
|
| 239 |
+
Igor Mordatch and Emanuel Todorov. Combining the benefits of function approximation and trajectory optimization. In RSS, 2014.
|
| 240 |
+
|
| 241 |
+
Remi Munos and Csaba Szepesv ´ ari. Finite-time bounds for fitted value iteration. ´ Journal of Machine Learning Research, 2008.
|
| 242 |
+
|
| 243 |
+
Remi Munos, Tom Stepleton, Anna Harutyunyan, and Marc G. Bellemare. Safe and efficient off- ´ policy reinforcement learning. In NIPS, 2016.
|
| 244 |
+
|
| 245 |
+
Anusha Nagabandi, Gregory Kahn, Ronald S. Fearing, and Sergey Levine. Neural network dynamics for model-based deep reinforcement learning with model-free fine-tuning. In ICRA, 2018.
|
| 246 |
+
|
| 247 |
+
Andrew Y. $\mathrm { N g }$ , Daishi Harada, and Stuart J. Russell. Policy invariance under reward transformations: Theory and application to reward shaping. In ICML, 1999.
|
| 248 |
+
|
| 249 |
+
OpenAI. Learning dexterous in-hand manipulation. ArXiv e-prints, 2018.
|
| 250 |
+
|
| 251 |
+
Ian Osband, Daniel Russo, and Benjamin Van Roy. (more) efficient reinforcement learning via posterior sampling. In Advances in Neural Information Processing Systems, pp. 3003–3011, 2013.
|
| 252 |
+
|
| 253 |
+
Ian Osband, Benjamin Van Roy, and Zheng Wen. Generalization and exploration via randomized value functions. In ICML, 2016.
|
| 254 |
+
|
| 255 |
+
Ian Osband, John Aslanides, and Albin Cassirer. Randomized prior functions for deep reinforcement learning. CoRR, abs/1806.03335, 2018.
|
| 256 |
+
|
| 257 |
+
Deepak Pathak, Pulkit Agrawal, Alexei A Efros, and Trevor Darrell. Curiosity-driven exploration by self-supervised prediction. In International Conference on Machine Learning (ICML), volume 2017, 2017.
|
| 258 |
+
|
| 259 |
+
Matthias Plappert, Rein Houthooft, Prafulla Dhariwal, Szymon Sidor, Richard Y Chen, Xi Chen, Tamim Asfour, Pieter Abbeel, and Marcin Andrychowicz. Parameter space noise for exploration. arXiv preprint arXiv:1706.01905, 2017.
|
| 260 |
+
|
| 261 |
+
S. Joe Qina and Thomas A. Badgwellb. A survey of industrial model predictive control technology. Control Engineering Practice, 2003.
|
| 262 |
+
|
| 263 |
+
Joose Rajamaki and Perttu H ¨ am¨ al¨ ainen. Augmenting sampling based controllers with machine ¨ learning. In Proceedings of the ACM SIGGRAPH / Eurographics Symposium on Computer Animation, SCA ’17, pp. 11:1–11:9, New York, NY, USA, 2017. ACM. ISBN 978-1-4503-5091- 4. doi: 10.1145/3099564.3099579. URL http://doi.acm.org/10.1145/3099564. 3099579.
|
| 264 |
+
|
| 265 |
+
Aravind Rajeswaran, Sarvjeet Ghotra, Balaraman Ravindran, and Sergey Levine. Epopt: Learning robust neural network policies using model ensembles. In ICLR, 2016.
|
| 266 |
+
|
| 267 |
+
Aravind Rajeswaran, Kendall Lowrey, Emanuel Todorov, and Sham Kakade. Towards Generalization and Simplicity in Continuous Control. In NIPS, 2017.
|
| 268 |
+
|
| 269 |
+
Aravind Rajeswaran, Vikash Kumar, Abhishek Gupta, Giulia Vezzani, John Schulman, Emanuel Todorov, and Sergey Levine. Learning Complex Dexterous Manipulation with Deep Reinforcement Learning and Demonstrations. In Proceedings of Robotics: Science and Systems (RSS), 2018.
|
| 270 |
+
|
| 271 |
+
Stephane Ross and J. Andrew Bagnell. Agnostic system identification for model-based reinforce- ´ ment learning. In ICML, 2012.
|
| 272 |
+
|
| 273 |
+
Stephane Ross, Geoffrey Gordon, and Drew Bagnell. A reduction of imitation learning and struc-´ tured prediction to no-regret online learning. In Proceedings of the fourteenth international conference on artificial intelligence and statistics, pp. 627–635, 2011.
|
| 274 |
+
|
| 275 |
+
John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, and Pieter Abbeel. Highdimensional continuous control using generalized advantage estimation. arXiv preprint arXiv:1506.02438, 2015.
|
| 276 |
+
|
| 277 |
+
John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, and Pieter Abbeel. Highdimensional continuous control using generalized advantage estimation. In ICLR, 2016.
|
| 278 |
+
|
| 279 |
+
David Silver, Aja Huang, Chris J. Maddison, Arthur Guez, Laurent Sifre, George van den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Vedavyas Panneershelvam, Marc Lanctot, Sander Dieleman, Dominik Grewe, John Nham, Nal Kalchbrenner, Ilya Sutskever, Timothy P. Lillicrap, Madeleine Leach, Koray Kavukcuoglu, Thore Graepel, and Demis Hassabis. Mastering the game of go with deep neural networks and tree search. Nature, 529:484–489, 2016.
|
| 280 |
+
|
| 281 |
+
David Silver, Julian Schrittwieser, Karen Simonyan, Ioannis Antonoglou, Aja Huang, Arthur Guez, Thomas Hubert, Lucas Baker, Matthew Lai, Adrian Bolton, et al. Mastering the game of go without human knowledge. Nature, 550(7676):354, 2017.
|
| 282 |
+
|
| 283 |
+
Bradly C Stadie, Sergey Levine, and Pieter Abbeel. Incentivizing exploration in reinforcement learning with deep predictive models. arXiv preprint arXiv:1507.00814, 2015.
|
| 284 |
+
|
| 285 |
+
Wen Sun, J. Andrew Bagnell, and Byron Boots. Truncated horizon policy search: Combining reinforcement learning & imitation learning. CoRR, abs/1805.11240, 2018a.
|
| 286 |
+
|
| 287 |
+
Wen Sun, Geoffrey J. Gordon, Byron Boots, and J. Andrew Bagnell. Dual policy iteration. CoRR, abs/1805.10755, 2018b.
|
| 288 |
+
|
| 289 |
+
Yuval Tassa, Tom Erez, and Emanuel Todorov. Synthesis and stabilization of complex behaviors through online trajectory optimization. In Intelligent Robots and Systems (IROS), 2012 IEEE/RSJ International Conference on, pp. 4906–4913. IEEE, 2012.
|
| 290 |
+
|
| 291 |
+
Yuval Tassa, Nicolas Mansard, and Emanuel Todorov. Control-limited differential dynamic programming. 2014 IEEE International Conference on Robotics and Automation (ICRA), pp. 1168– 1175, 2014.
|
| 292 |
+
|
| 293 |
+
Evangelos Theodorou, Jonas Buchli, and Stefan Schaal. A generalized path integral control approach to reinforcement learning. Journal of Machine Learning Research, 11:3137–3181, 2010.
|
| 294 |
+
|
| 295 |
+
Emanuel Todorov. Linearly-solvable markov decision problems. In NIPS, 2006.
|
| 296 |
+
|
| 297 |
+
Emanuel Todorov and Weiwei Li. A generalized iterative lqg method for locally-optimal feedback control of constrained nonlinear stochastic systems. In ACC, 2005.
|
| 298 |
+
|
| 299 |
+
Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In IROS, 2012.
|
| 300 |
+
|
| 301 |
+
Grady Williams, Paul Drews, Brian Goldfain, James M Rehg, and Evangelos A Theodorou. Aggressive driving with model predictive path integral control. In Robotics and Automation (ICRA), 2016 IEEE International Conference on, pp. 1433–1440. IEEE, 2016.
|
| 302 |
+
|
| 303 |
+
Mingyuan Zhong, Mikala Johnson, Yuval Tassa, Tom Erez, and Emanuel Todorov. Value function approximation and model predictive control. In Adaptive Dynamic Programming And Reinforcement Learning (ADPRL), 2013 IEEE Symposium on, pp. 100–107. IEEE, 2013.
|
| 304 |
+
|
| 305 |
+
# A APPENDIX: EXPERIMENTAL DETAILS, HUMANOID
|
| 306 |
+
|
| 307 |
+
The model used for the humanoid experiments was originally distributed with the MuJoCo (Todorov et al., 2012) software package and modified for our use. The model nominally has 27 degrees of freedom, including the floating base. It utilizes direct torque actuation for control, necessitating a small timestep of 0.008 seconds. The actuation input is limited to $\pm 1 . 0$ , but the original gear ratios are left unchanged.
|
| 308 |
+
|
| 309 |
+
For POLO, the choice of inputs for the value function involves a few design decisions. We take inspiration from robotics by using only easily observed values.
|
| 310 |
+
|
| 311 |
+
Dims. Observation
|
| 312 |
+
6 Direction & Normal Vector, Torso
|
| 313 |
+
3 Direction Vector, Neck to R. Hand
|
| 314 |
+
3 Direction Vector, Neck to L. Hand
|
| 315 |
+
3 Direction Vector, Hip to R. Foot
|
| 316 |
+
3 Direction Vector, Hip to L. Foot
|
| 317 |
+
5 Height, Root, Hands, & Feet
|
| 318 |
+
6 Root Velocities
|
| 319 |
+
5 Touch Sensors, Head, Hands, & Feet
|
| 320 |
+
Value Parameter
|
| 321 |
+
0.99 $\gamma$ discount Factor
|
| 322 |
+
64 Planning Horizon Length
|
| 323 |
+
120 MPPI Rollouts
|
| 324 |
+
0.2 MPPI Noise $\sigma$
|
| 325 |
+
1.25 MPPI Temperature
|
| 326 |
+
|
| 327 |
+
For value function approximation in POLO for the humanoid tasks, we use an ensemble of 6 neural networks, each of which has 2 layers with 16 hidden parameters each; tanh is used for non-linearity. Training is performed with 64 gradient steps on minibatches of size 32, using ADAM with default parameters, every 16 timesteps the agent experiences.
|
| 328 |
+
|
| 329 |
+
In scenarios where the agent resets, we consider a horizon of 600 timesteps with 20 episodes, giving a total agent lifetime of 12000 timesteps or 96 seconds. When we consider no resets, we use the same total timesteps. A control cost is shared for each scenario, where we penalize an actuator’s applied force scaled by the inverse of the mass matrix. Task specific rewards are as follows.
|
| 330 |
+
|
| 331 |
+
# A.1 HUMANOID GETUP
|
| 332 |
+
|
| 333 |
+
In the getup scenario, the agent is initialized in a supine position, and is required to bring its root height to a target of 1.1 meters. The reward functions used are as follows. In the non-sparse case, the difficulty in this task is eschewing the immediate reward for sitting in favor of the delayed reward of standing; this sequence is non-trivial to discover.
|
| 334 |
+
|
| 335 |
+
$$
|
| 336 |
+
R ( s ) = \{ \begin{array} { l l } { 1 . 0 - ( 1 . 2 5 - R o o t _ { z } ) , } & { \mathrm { i f ~ } R o o t _ { z } \leq 1 . 2 5 } \\ { 1 . 0 , } & { \mathrm { o t h e r w i s e } } \end{array} , R _ { s p a r s e } ( s ) = \{ \begin{array} { l l } { 0 . 0 , } & { \mathrm { i f ~ } R o o t _ { z } \leq 1 . 2 5 } \\ { 1 . 0 , } & { \mathrm { o t h e r w i s e } } \end{array}
|
| 337 |
+
$$
|
| 338 |
+
|
| 339 |
+
# A.2 HUMANOID WALK
|
| 340 |
+
|
| 341 |
+
In the walking scenario, the agent is initialized in an upright configuration. We specify a reward function that either penalizes deviation from a target height of 1.1 meters, or penalizes the deviation from both a target speed of 1.0 meters/second and the distance from the world’s $\mathbf { X }$ -axis to encourage the agent to walk in a straight line. We choose a target speed as opposed to rewarding maximum speed to encourage stable walking gaits.
|
| 342 |
+
|
| 343 |
+
$$
|
| 344 |
+
R ( s ) = \left\{ \begin{array} { l l } { - ( 1 . 2 5 - R o o t _ { z } ) , } & { \mathrm { i f ~ } R o o t _ { z } \leq 1 . 2 5 } \\ { 1 . 0 - | 1 . 0 - V e l _ { x } | - | R o o t _ { x } | , } & { \mathrm { o t h e r w i s e } } \end{array} \right.
|
| 345 |
+
$$
|
| 346 |
+
|
| 347 |
+
# A.3 HUMANOID BOX
|
| 348 |
+
|
| 349 |
+
For the box environment, we place a 0.9 meter wide cube in front of the humanoid, which needs to be pushed to a specific point. The friction between the box and ground is very low, however, and most pushes cause the box to slide out of reach; POLO learns to better limit the initial push to
|
| 350 |
+
|
| 351 |
+
control the box to the target.
|
| 352 |
+
|
| 353 |
+
$$
|
| 354 |
+
R ( s ) = \left\{ \begin{array} { l l } { - ( 1 . 2 5 - R o o t _ { z } ) , } & { \mathrm { i f ~ } R o o t _ { z } \leq 1 . 2 5 } \\ { 2 . 0 - \| B o x _ { x y } - R o o t _ { x y } \| _ { 2 } , } & { \mathrm { e l s e ~ i f ~ } | B o x _ { x y } - R o o t _ { x y } | _ { 2 } > 0 . 8 } \\ { 4 . 0 - 2 * \| B o x _ { x y } - T a r g e t _ { x y } \| _ { 2 } , } & { \mathrm { o t h e r w i s e } } \end{array} \right.
|
| 355 |
+
$$
|
| 356 |
+
|
| 357 |
+
In this setup, the observation vector increases with the global position of the box, and the dimensionality of the system increase by 6. The box initially starts 1.5 meters in front of the humanoid, and needs to be navigated to a position 2.5 meters in front of the humanoid.
|
| 358 |
+
|
| 359 |
+
# B APPENDIX: EXPERIMENTAL DETAILS, HAND MANIPULATION
|
| 360 |
+
|
| 361 |
+
We use the Adroit hand model (Kumar, 2016) and build on top of the hand manipulation task suite of Rajeswaran et al. (2018). The hand is position controlled and the dice is modeled as a free object with 3 translational degrees of freedom and a ball joint for three rotational degrees of freedom. The base of the hand is not actuated, and the agent controls only the fingers and wrist. The dice is presented to the hand initially in some randomized configuration, and the agent has to reorient the dice to the desired configuration. The desired configuration is randomized every 75 timesteps and the trajectory optimizer does not see this randomization. Thus the randomization can be interpreted as unmodelled external disturbances to the system. We use a simple reward function for the task:
|
| 362 |
+
|
| 363 |
+
$$
|
| 364 |
+
R ( s ) = - 0 . 5 \ell _ { 1 } ( x _ { o } , x _ { g } ) - 0 . 0 5 \ell _ { q u a t } ( q _ { o } , q _ { g } ) ,
|
| 365 |
+
$$
|
| 366 |
+
|
| 367 |
+
where $x _ { o }$ and $x _ { g }$ are the Cartesian positions of the object (dice) and goal respectively. The goal location for the dice is a fixed position in space and is based on the initial location of the palm of the hand. $\ell _ { 1 }$ is the L1 norm. $q _ { o }$ and $q _ { g }$ are the orientation configurations of object and goal, respectively, and expressed as quaternions with $\ell _ { q u a t }$ being the quaternion difference.
|
| 368 |
+
|
| 369 |
+
We use 80 trajectories in MPPI with temperature of 10. We use an ensemble of 6 networks with 2 layers and 64 units each. The value function is updated every 25 steps of interaction with the world, and we take 16 gradient steps each with a batch size of 16. These numbers were arrived at after a coarse hyperparameter search, and we expect that better hyperparameter settings could exist.
|
| 370 |
+
|
| 371 |
+
# C PROOF OF LEMMA 2 AND REMARKS
|
| 372 |
+
|
| 373 |
+
Let $\hat { \tau }$ and $\tau ^ { * }$ represent the trajectories of length $H$ that would be generated by applying $\hat { \pi } _ { M P C }$ and $\pi ^ { * }$ respectively on the MDP. Starting from some state $s$ , we have:
|
| 374 |
+
|
| 375 |
+
$$
|
| 376 |
+
V ^ { \ast } ( s ) - V ^ { \widehat { \pi } _ { M P C } } ( s ) = \mathbb { E } _ { \tau ^ { \ast } } \left[ \sum _ { t = 0 } ^ { H - 1 } \gamma ^ { t } r _ { t } + \gamma ^ { H } V ^ { \ast } ( s _ { H } ) \right] - \mathbb { E } _ { \widehat { \tau } } \left[ \sum _ { t = 0 } ^ { H - 1 } \gamma ^ { t } r _ { t } + \gamma ^ { H } V ^ { \widehat { \pi } _ { M P C } } ( s _ { H } ) \right]
|
| 377 |
+
$$
|
| 378 |
+
|
| 379 |
+
Adding and subtracting, $\mathbb { E } _ { \hat { \tau } } [ \sum _ { t } \gamma ^ { t } r _ { t } + \gamma ^ { H } V ^ { * } ( s _ { H } ) ]$ , we have:
|
| 380 |
+
|
| 381 |
+
$$
|
| 382 |
+
\begin{array} { r l } & { V ^ { * } ( s ) - V ^ { \widehat { \pi } M P C } ( s ) = \gamma ^ { H } \mathbb { E } _ { \widehat { \tau } } \left[ V ^ { * } ( s _ { H } ) - V ^ { \widehat { \pi } M P C } \left( s _ { H } \right) \right] } \\ & { \qquad + \mathbb { E } _ { \tau ^ { * } } \left[ \displaystyle \sum _ { t = 0 } ^ { H - 1 } \gamma ^ { t } r _ { t } + \gamma ^ { H } V ^ { * } ( s _ { H } ) \right] - \mathbb { E } _ { \widehat { \tau } } \left[ \displaystyle \sum _ { t = 0 } ^ { H - 1 } \gamma ^ { t } r _ { t } + \gamma ^ { H } V ^ { * } ( s _ { H } ) \right] . } \end{array}
|
| 383 |
+
$$
|
| 384 |
+
|
| 385 |
+
Since $\begin{array} { r } { \operatorname* { m a x } _ { s } | \hat { V } ( s ) - V ^ { * } ( s ) | = \epsilon , } \end{array}$ , we have:
|
| 386 |
+
|
| 387 |
+
$$
|
| 388 |
+
\begin{array} { r l } & { \mathbb { E } _ { \tau ^ { * } } \left[ \displaystyle \sum _ { t = 0 } ^ { H - 1 } \gamma ^ { t } r _ { t } + \gamma ^ { H } V ^ { * } ( s _ { H } ) \right] \le \mathbb { E } _ { \tau ^ { * } } \left[ \displaystyle \sum _ { t = 0 } ^ { H - 1 } \gamma ^ { t } r _ { t } + \gamma ^ { H } \hat { V } ( s _ { H } ) \right] + \gamma ^ { H } \epsilon } \\ & { \mathbb { E } _ { \hat { \tau } } \left[ \displaystyle \sum _ { t = 0 } ^ { H - 1 } \gamma ^ { t } r _ { t } + \gamma ^ { H } V ^ { * } ( s _ { H } ) \right] \ge \mathbb { E } _ { \hat { \tau } } \left[ \displaystyle \sum _ { t = 0 } ^ { H - 1 } \gamma ^ { t } r _ { t } + \gamma ^ { H } \hat { V } ( s _ { H } ) \right] - \gamma ^ { H } \epsilon } \end{array}
|
| 389 |
+
$$
|
| 390 |
+
|
| 391 |
+
Furthermore, since $\hat { \tau }$ was generated by applying $\hat { \pi } _ { M P C }$ which optimizes the actions using $\hat { V }$ as the terminal value/reward function, we have:
|
| 392 |
+
|
| 393 |
+
$$
|
| 394 |
+
\mathbb { E } _ { \hat { \tau } } \left[ \sum _ { t = 0 } ^ { H - 1 } \gamma ^ { t } r _ { t } + \gamma ^ { H } \hat { V } ( s _ { H } ) \right] \geq \mathbb { E } _ { \tau ^ { * } } \left[ \sum _ { t = 0 } ^ { H - 1 } \gamma ^ { t } r _ { t } + \gamma ^ { H } \hat { V } ( s _ { H } ) \right]
|
| 395 |
+
$$
|
| 396 |
+
|
| 397 |
+
using these bounds, we have:
|
| 398 |
+
|
| 399 |
+
$$
|
| 400 |
+
\begin{array} { r l } & { V ^ { * } ( s ) - V ^ { \hat { \pi } _ { M P C } } ( s ) \leq \gamma ^ { H } \mathbb { E } _ { \hat { \tau } } \left[ V ^ { * } ( s _ { H } ) - V ^ { \hat { \pi } _ { M P C } } ( s _ { H } ) \right] + 2 \gamma ^ { H } \epsilon } \\ & { \qquad \leq 2 \gamma ^ { H } \epsilon \left( 1 + \gamma ^ { H } + \gamma ^ { 2 } H + \dots \right) } \\ & { \qquad \leq \displaystyle \frac { 2 \gamma ^ { H } \epsilon } { 1 - \gamma ^ { H } } } \end{array}
|
| 401 |
+
$$
|
| 402 |
+
|
| 403 |
+
by recursively applying the first bound to $V ^ { * } ( s _ { H } ) - V ^ { \hat { \pi } _ { M P C } } ( s _ { H } )$ . This holds for all states, and hence for any distribution over states.
|
| 404 |
+
|
| 405 |
+
Notes and Remarks: For Eq. (13) to hold in general, and hence for the overall bound to hold, we require that the actions are optimized in closed loop. In other words, MPC has to optimize over the space of feedback policies as opposed to open loop actions. Many commonly used MPC algorithms like DDP and iLQG Jacobson & Mayne (1970); Todorov & Li (2005) have this property through the certainty equivalence principle for the case of Gaussian noise. For deterministic dynamics, which is the case for most common simulators like MuJoCo, Eq. (13) holds without the closed loop requirement. We summarize the different cases and potential ways to perform MPC below:
|
| 406 |
+
|
| 407 |
+
• In the case of deterministic dynamics, the optimal open loop trajectory and optimal local
|
| 408 |
+
feedback policies have the same performance up to finite horizon $H$ . Thus, any trajectory optimization algorithm, such as iLQG and MPPI can be used.
|
| 409 |
+
• In the case of stochastic dynamics with additive Gaussian noise, local dynamic programming methods like iLQG and DDP Todorov & Li (2005); Jacobson & Mayne (1970) provide efficient ways to optimize trajectories. These approaches also provide local feedback policies around the trajectories which are optimal due to the certainty equivalence principle.
|
| 410 |
+
In the case of general stochastic systems, various stochastic optimal control algorithms like path integral control Theodorou et al. (2010) can be used for the optimization. These situations are extremely rare in robotic control.
|
| 411 |
+
|
| 412 |
+
Finally, we also note that Sun et al. Sun et al. (2018a) propose and arrive at a similar bound in the context of imitation learning and reward shaping. They however assume that a policy can simultaneously optimize the approximate value function over $H$ steps, which may not be possible for a parametric policy class. Since we consider MPC which is a non-parametric method (in the global sense), MPC can indeed simultaneously optimize for $H$ steps using $\hat { V }$ .
|
md/train/D2TE6VTJG9/D2TE6VTJG9.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/Ec85b0tUwbA/Ec85b0tUwbA.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/FjnCWyzXu8m/FjnCWyzXu8m.md
ADDED
|
@@ -0,0 +1,420 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Rethinking supervised learning: insights from biological learning and from calling it by its name
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
The renaissance of artificial neural networks was catalysed by the success of classification models, tagged by the community with the broader term supervised learning. The extraordinary results gave rise to a hype loaded with ambitious promises and overstatements. Soon the community realised that the success owed much to the availability of thousands of labelled examples and supervised learning went, for many, from glory to shame: Some criticised deep learning as a whole and others proclaimed that the way forward had to be “alternatives” to supervised learning: predictive, unsupervised, semi-supervised and, more recently, self-supervised learning. However, these seem all brand names, rather than actual categories of a theoretically grounded taxonomy. Moreover, the call to banish supervised learning was motivated by the questionable claim that humans learn with little or no supervision and are capable of robust out-of-distribution generalisation. Here, we review insights about learning and supervision in nature, revisit the notion that learning and generalization are not possible without supervision or inductive biases and argue that we will make better progress if we just call it by its name.
|
| 11 |
+
|
| 12 |
+
# 16 1 Introduction
|
| 13 |
+
|
| 14 |
+
17 The re-emergence of deep learning during the last decade due to the noteworthy achievements
|
| 15 |
+
18 of artificial neural networks (ANN) built up a sort of philosophy that nearly anything could be
|
| 16 |
+
19 automatically learnt from data without human intervention, in contrast to the previous approaches:
|
| 17 |
+
20 [hand designing good feature extractors, engineering skill and domain expertise]
|
| 18 |
+
21 can all be avoided if good features can be learned automatically using a general
|
| 19 |
+
22 purpose learning procedure. This is the key advantage of deep learning (LeCun
|
| 20 |
+
23 et al., 2015).
|
| 21 |
+
24 Read in hindsight, this claim was clearly an overstatement. The success of deep learning has
|
| 22 |
+
25 required iterative hand design of network architectures and techniques that demanded collective, high
|
| 23 |
+
26 engineering skill and large doses of interdisciplinary domain expertise. Furthermore, deep learning
|
| 24 |
+
27 owes much to the immense computational power poured into training artificial networks (Amodei &
|
| 25 |
+
28 Hernandez, 2018; Schwartz et al., 2019) and to the human effort of manually collecting and labelling
|
| 26 |
+
29 thousands of images and other data modalities (Russakovsky et al., 2015; Cao et al., 2018). However,
|
| 27 |
+
30 the gist of the claim has permeated machine learning research and is pervasive up to these days.
|
| 28 |
+
31 The realisation that the success of deep learning was largely due to the availability of huge labelled data
|
| 29 |
+
32 sets prompted various reactions: some authors strongly questioned the usefulness of the algorithms
|
| 30 |
+
33 (Marcus, 2018); some delved into the question of whether neural networks generalise beyond or
|
| 31 |
+
34 simply memorise the training examples (Zhang et al., 2017; Arpit et al., 2017); and some proposed
|
| 32 |
+
35 new research horizons that can be overly ambitious and potentially misleading: “learning a class
|
| 33 |
+
36 from a single labelled example”, based on the statement that “humans learn new concepts with very
|
| 34 |
+
37 little supervision, [but] the standard supervised deep learning paradigm does not offer a satisfactory
|
| 35 |
+
38 solution for learning new concepts rapidly from little data” (Vinyals et al., 2016). As a consequence,
|
| 36 |
+
39 multiple research programmes, with various brand names, followed up with the aim of minimising or
|
| 37 |
+
40 removing the need for “supervision” to train neural networks: few-shot, one-shot, zero-shot, predictive,
|
| 38 |
+
41 unsupervised, semi-supervised and self-supervised learning are only a few popular examples.
|
| 39 |
+
42 Exploring alternatives to classification and improving the efficiency of learning algorithms should
|
| 40 |
+
43 indeed be a priority of machine learning research. As a matter of fact, related approaches have
|
| 41 |
+
44 been subject of study since long before the explosion of deep learning (Hinton & Sejnowski, 1999;
|
| 42 |
+
45 Chapelle et al., 2006). However, the current publication and discussion trends in the field denote
|
| 43 |
+
46 overambitious promises that are in part based on misconceptions and overstatements about biological
|
| 44 |
+
47 learning, and amplified by overselling nomenclature. While much of the research output derived from
|
| 45 |
+
48 these programmes does provide us with useful techniques and insight, it leaves behind a landscape of
|
| 46 |
+
49 confusing terminology and tangled research directions that are hard to navigate and lead many astray.
|
| 47 |
+
50 In this paper, we reflect upon fundamental concepts in machine learning such as supervision, in
|
| 48 |
+
51 ductive biases and generalisation, which in spite of resting on theoretical grounds, are at the core
|
| 49 |
+
52 of misconceptions and overstatements about deep learning commonly seen in the literature. First,
|
| 50 |
+
53 we review aspects from biological learning, and compare them to the traits often (mis)attributed to
|
| 51 |
+
54 human learning and generalisation in the machine learning literature (Section 2). Second, we revisit
|
| 52 |
+
55 insights from classical statistical learning and critically review the terminology and current trends in
|
| 53 |
+
56 deep learning research (Section 3). Altogether, we aim at tempering certain claims and promises of
|
| 54 |
+
57 deep learning, helping mitigate the confusion over the terminology and suggesting desirable—in our
|
| 55 |
+
58 opinion—directions and changes in machine learning research.
|
| 56 |
+
|
| 57 |
+
# 59 2 Supervision in biological learning
|
| 58 |
+
|
| 59 |
+
60 The link between artificial intelligence—specifically artificial neural networks (Rosenblatt, 1958;
|
| 60 |
+
61 Fukushima & Miyake, 1982)—and biological learning systems is intrinsic to the field, as one long
|
| 61 |
+
62 term goal of artificial intelligence is to mirror the capabilities of human intelligence. However, these
|
| 62 |
+
63 capabilities are, in our view, often overestimated. One example is the argument that intelligence in
|
| 63 |
+
64 nature evolves without supervision and is capable of robust out-of-distribution generalisation. In
|
| 64 |
+
65 particular, it is often claimed that humans and other animals learn to visually categorise objects with
|
| 65 |
+
66 little or no supervision from a few examples (Vinyals et al., 2016; Marcus, 2018; Morgenstern et al.,
|
| 66 |
+
67 2019). In what follows, we will discuss three aspects of biological learning to argue against this
|
| 67 |
+
68 view, so as to gain insights that better inform our progress in machine learning: first, we will discuss
|
| 68 |
+
69 how generalisation requires exposure to relevant training data; second, we will review the variety of
|
| 69 |
+
70 supervised signals that the brain has access to; third, we will comment on the role of evolution and
|
| 70 |
+
71 brain development.
|
| 71 |
+
|
| 72 |
+
# 72 2.1 Generalisation requires exposure to relevant training data
|
| 73 |
+
|
| 74 |
+
73 In the argument that machine learning models should generalise from a few examples, there seems
|
| 75 |
+
74 to be a promise or aspiration that future better methods will be able to perform robust visual object
|
| 76 |
+
75 categorisation—for instance—among many object classes after being trained on one or a few examples
|
| 77 |
+
76 per class. While a primary objective is to develop techniques that efficiently extract the maximum
|
| 78 |
+
77 possible information from the available examples, we should also remind ourselves that no machine
|
| 79 |
+
78 learning algorithm can robustly learn anything that cannot be inferred from the data it has been trained
|
| 80 |
+
79 on. Although this may seem to contradict certain current trends and statements in the literature, we
|
| 81 |
+
80 should also bear in mind that learning in nature is not different.
|
| 82 |
+
81 First, the amount of data that animals and humans in particular are exposed to is often underestimated.
|
| 83 |
+
82 A biological brain continuously receives, processes and integrates multimodal inputs from various
|
| 84 |
+
83 sensors—images (light), sound, smell, etc. Humans do not learn to recognise objects by looking
|
| 85 |
+
84 at photos from ImageNet, but are rather exposed to a continuous flow of visual stimuli with slow
|
| 86 |
+
85 changes of the viewing angle and lighting conditions. Furthermore, the stimuli are coherent across
|
| 87 |
+
86 modalities, we are allowed to interact with the objects and we even receive multiple supervision
|
| 88 |
+
87 signals, as we discuss later.
|
| 89 |
+
88 The exposure to so much training data makes the human visual system remarkably robust, but still its
|
| 90 |
+
89 capabilities are optimised for the tasks it needs to perform and largely determined by the training data
|
| 91 |
+
90 distribution—and years of evolution, as we will discuss below. For instance, a well-studied property
|
| 92 |
+
91 of human vision is that our face recognition ability is severely impaired if faces are presented upside
|
| 93 |
+
92 down (Yin, 1969; Valentine, 1988). Setting aside the specific complexity of face processing in the
|
| 94 |
+
93 brain, a compelling explanation for this impairment is that we are simply not used to seeing and
|
| 95 |
+
94 recognising inverted faces. More generally, while human perception of objects is largely invariant
|
| 96 |
+
95 under certain conditions (Biederman & Bar, 1999), object recognition is sensitive to changes in view
|
| 97 |
+
96 angle (Tarr et al., 1998), especially when we see objects from unfamiliar viewpoints (Edelman &
|
| 98 |
+
97 Bülthoff, 1992; Bülthoff & Newell, 2006; Milivojevic, 2012).
|
| 99 |
+
98 Furthermore, although better than the one-shot or few-shot generalisation of current ANNs, humans
|
| 100 |
+
99 also have limited ability to recognise truly novel classes (Morgenstern et al., 2019). Interestingly,
|
| 101 |
+
100 experiments with certain novel classes of objects known as Greebles showed that, with sufficient
|
| 102 |
+
101 training, humans can acquire expertise in recognising new objects from different viewpoints, even
|
| 103 |
+
102 making use of an area of the brain—the fusiform face area—that typically responds strongly with
|
| 104 |
+
103 face stimuli (Gauthier et al., 1999). This provides evidence that recognition from multiple viewpoints
|
| 105 |
+
104 is possible but only developed after exposure to similar conditions, that is relevant data. This is
|
| 106 |
+
105 reminiscent of the effectiveness of data augmentation in deep learning, compared to more naïve
|
| 107 |
+
106 regularisation methods (Hernández-García & König, 2018).
|
| 108 |
+
107 The need for exposure to relevant stimuli challenges the notion that humans are capable of strong
|
| 109 |
+
108 out-of-distribution generalisation. Rather, it seems that the transfer learning capabilities of humans
|
| 110 |
+
109 are limited to relatively small changes in the data distribution. A compelling example is our difficulty
|
| 111 |
+
110 to learn new languages: someone who natively speaks or has learnt Spanish will be able to transfer a
|
| 112 |
+
111 significant amount of knowledge if they are to learn Italian, due to the overlap in the data distribution,
|
| 113 |
+
112 but they will have very little to transfer for learning Kanien’kéha or Mandarin.
|
| 114 |
+
|
| 115 |
+
# 113 2.2 Supervised signals for the brain
|
| 116 |
+
|
| 117 |
+
114 Another commonly found argument has it that children—animals in general—learn robust object
|
| 118 |
+
115 recognition without supervision: “a child can generalize the concept of ‘giraffe’ from a single picture
|
| 119 |
+
116 in a book” (Vinyals et al., 2016). First of all, we should mention the role of evolution (expanded in
|
| 120 |
+
117 Section 2.3), which can be interpreted as a pre-trained model, optimised through millions of years of
|
| 121 |
+
118 data with natural selection as a supervisory signal (Zador, 2019). Second, there is abundant evidence
|
| 122 |
+
119 to argue against the very claim that children—and adults—learn in fully unsupervised fashion.
|
| 123 |
+
120 Obviously, the kind of supervision that humans make use of is not that of classification algorithms—
|
| 124 |
+
121 we do not see a class label on top of every object we look at. However, we receive supervision
|
| 125 |
+
122 from multiple sources. Even though not for every visual stimulus, children do frequently receive
|
| 126 |
+
123 information about the object classes they see. For instance, parents would point at objects and name
|
| 127 |
+
124 them, then we learn how to read, and generally play a crucial role as teachers in language development
|
| 128 |
+
125 (Kuhl, 2007). Non-human animals such as zebra finches learning to sing have also been found to rely
|
| 129 |
+
126 on feedback (supervision) from the female adult and not just imitation Carouso-Peck & Goldstein
|
| 130 |
+
127 (2019). Furthermore, humans usually follow guided hierarchical learning: children do not directly
|
| 131 |
+
128 learn to tell apart breeds of dogs, but rather start with umbrella terms and then progressively learn
|
| 132 |
+
129 down the class hierarchy (Bornstein & Arterberry, 2010; Spriet et al., 2021). Gopnik (2021) has
|
| 133 |
+
130 asserted that “we learn more from other people than we do from any other source” and Hasson et al.
|
| 134 |
+
131 (2020) mention other examples of supervision from social cues, that is from other humans, such as
|
| 135 |
+
132 learning to recognise individual faces, produce grammatical sentences, read and write; as well as
|
| 136 |
+
133 from embodiment and action, such as learning to balance the body while walking or grasping objects.
|
| 137 |
+
134 In all these actions, we can identify a supervisory signal that surely influences learning in the brain
|
| 138 |
+
135 (Shapiro, 2012; Gopnik et al., 2020).
|
| 139 |
+
136 While these supervision signals largely differ from what is most commonly considered supervised
|
| 140 |
+
137 learning in machine learning, we can still draw some parallels with human learning. We learn to
|
| 141 |
+
138 categorise many concepts and objects as children, but most people carry on learning new categories as
|
| 142 |
+
139 adults. For example, some people put effort in improving their understanding of the natural world by
|
| 143 |
+
140 learning to recognise and name trees, plants or birds. Those who have engaged in such an endeavour
|
| 144 |
+
141 may have noticed that the learning process is easier and faster if we count upon the expert knowledge
|
| 145 |
+
142 of a friend or of technology such as iNaturalist (Van Horn et al., 2018). Another example: those
|
| 146 |
+
143 who have—or attempted to learn—a new language as an adult may have realised that whereas it is
|
| 147 |
+
144 possible to learn the meaning of a new word by repeated exposure to it in multiple contexts, it is
|
| 148 |
+
145 certainly easier if we look up the ground truth definition in a dictionary or, even easier, if there exists
|
| 149 |
+
146 a direct mapping to a word in our native language. Summing up, not only does supervision facilitate
|
| 150 |
+
147 learning, but human beings actively seek for it.
|
| 151 |
+
148 Besides this kind of explicit supervision, the brain certainly makes use of more subtle, implicit
|
| 152 |
+
149 supervised signals, such as temporal stability (Becker, 1999; Wyss et al., 2003): The light that enters
|
| 153 |
+
150 the retina, and the sound waves that reach the cochlea, are not random signals from a sequence of
|
| 154 |
+
151 rapidly changing arbitrary photos or noise, but highly coherent and regular flows of slowly changing
|
| 155 |
+
152 stimuli, especially at the higher, semantical level (Kording et al., 2004). At the very least, this is how
|
| 156 |
+
153 we perceive it and if such a smooth perception turns out to be a consequence rather than a cause, then
|
| 157 |
+
154 it should be a by-product of a long process of evolution that would be worth taking into account.
|
| 158 |
+
|
| 159 |
+
# 155 2.3 The role of evolution and brain development
|
| 160 |
+
|
| 161 |
+
156 In the previous sections, we have discussed some misconceptions or overstatements about how
|
| 162 |
+
157 humans learn and generalise that are often found in the machine literature. Namely, that humans
|
| 163 |
+
158 are able to generalise from a few examples and that this occurs with little or no supervision. Still,
|
| 164 |
+
159 the commonplace comparison of artificial neural networks with human learning and the brain often
|
| 165 |
+
160 misses a fundamental component of biology, recently brought to the fore by Zador (2019) and Hasson
|
| 166 |
+
161 et al. (2020), although considered since the early days of artificial intelligence (Turing, 1968): the
|
| 167 |
+
162 role that millions of years of evolution have played in developing the nervous systems of organisms
|
| 168 |
+
163 in nature, including the human brain.
|
| 169 |
+
164 The most common way of training artificial neural networks, especially in machine learning research,
|
| 170 |
+
165 is from tabula rasa, that is from randomly initialised parameters1. In contrast, a large part of the
|
| 171 |
+
166 brain connectivity is encoded genetically and certain properties and behaviour are known to be
|
| 172 |
+
167 innate, that is developed without prior exposure to stimuli (Farroni et al., 2005; Spriet et al., 2021).
|
| 173 |
+
168 Importantly, evolution not only provides innate behaviour, but also determines what cannot be learnt,
|
| 174 |
+
169 or relevant constraints—scientists who have trained animals in the laboratory for psychological
|
| 175 |
+
170 or neuroscientific studies are well aware that tasks have to be carefully adapted to the ecological
|
| 176 |
+
171 behaviour and limitations of the animal, determined by evolution.
|
| 177 |
+
172 Taking into account the role of evolution, we can draw conclusions that relate to the claims discussed
|
| 178 |
+
173 in the previous sections. If our brains are the product of millions of years of exposure to relevant
|
| 179 |
+
174 stimuli and adaptation, is it really fair to say that humans are capable of robust out-of-distribution
|
| 180 |
+
175 generalisation and that we learn from from a few examples? If evolution has largely determined
|
| 181 |
+
176 what our brain can and cannot learn, providing as with a “pre-trained model”, is it really fair to
|
| 182 |
+
177 say that humans learn in a unsupervised fashion? This questions are relevant for machine learning
|
| 183 |
+
178 research: if we take biological learning as motivation for artificial intelligence, should we not temper
|
| 184 |
+
179 our expectations of what learning algorithms should aspire to? And, therefore, would it not be worth
|
| 185 |
+
180 reconsidering some research programmes?
|
| 186 |
+
181 On the flip side, insights from evolutionary theory are likely to be a fruitful source of inspiration
|
| 187 |
+
182 for machine learning (Hasson et al., 2020; Zador, 2019). As we have observed, training a neural
|
| 188 |
+
183 network from scratch may be more similar to a simulation of evolution than to the process by which
|
| 189 |
+
184 an adult learns a new concept. As a shortcut to simulating evolution, neuroscience is a rich source
|
| 190 |
+
185 of inspiration of constraints and inductive biases that determine learning in the biological brain and
|
| 191 |
+
186 can potentially inform machine learning (Hassabis et al., 2017; Lindsey et al., 2019). For instance,
|
| 192 |
+
187 simulating properties of the primary visual cortex in the early layers of an artificial neural network
|
| 193 |
+
188 has been shown to improve adversarial robustness (Dapello et al., 2020; Malhotra et al., 2020).
|
| 194 |
+
|
| 195 |
+
Besides evolution, the focus on the capabilities of adults often makes us miss another important aspect of biological learning, particularly important in humans: the role of learning in infancy and brain development. While learning occurs too in adulthood, childhood is a particularly important and
|
| 196 |
+
|
| 197 |
+
192 active time for learning (Atkinson, 2002; Gelman & Meyer, 2011). In fact, sensitive or critical periods
|
| 198 |
+
193 for learning in infancy have been described or hypothesised, for example for vision (Harwerth et al.,
|
| 199 |
+
194 1986) and language development (Lenneberg, 1967). Machine learning papers that draw motivation
|
| 200 |
+
195 from the alleged generalisation capabilities of humans often underestimate the amount of input stimuli
|
| 201 |
+
196 and supervision that infants receive (Gopnik, 2020). However, childhood can be regarded as period
|
| 202 |
+
197 dedicated almost exclusively to learn, not only formally from parents and teachers, but also through
|
| 203 |
+
198 playing, which plays a critical role in cognitive development Burghardt (2005); Pelz & Kidd (2020).
|
| 204 |
+
199 Finally, the fact that humans—and other cognitively advanced animals, such as corvid birds, which
|
| 205 |
+
200 also exhibit cultural learning—have a comparatively long childhood period, has led Uomini et al.
|
| 206 |
+
201 (2020) to recently proposed that extended parenting is pivotal in the evolution of cognition. This
|
| 207 |
+
202 adds to the discussion on the undervalued role of supervision. In sum, we propose machine learning
|
| 208 |
+
203 research can benefit from drawing inspiration from both evolutionary biology and the literature on
|
| 209 |
+
204 developmental psychology, brain development and life history and learning (Gopnik et al., 2020).
|
| 210 |
+
|
| 211 |
+
# 205 3 Supervision in machine learning
|
| 212 |
+
|
| 213 |
+
If we open a machine learning textbook (Murphy, 2012; Abu-Mostafa et al., 2012; Goodfellow et al., 2016), we will most surely find a taxonomy of learning algorithms with a clear distinction between supervised and unsupervised learning. However, while this separation can be useful, the boundaries are certainly not clear. As a matter of fact, if we take a look at the deep learning literature of the past years, we will also find abundant work on some variants supposedly in between—semi-supervised learning, self-supervised learning, etc.—whose definitions are all but clear.
|
| 214 |
+
|
| 215 |
+
# 3.1 Catastrophic forgetting of old concepts
|
| 216 |
+
|
| 217 |
+
If we recall a classical result in statistical learning theory and inference, the no free lunch theorem (Wolpert, 1996), no learning algorithm is better than any other at classifying unobserved data points, when averaged over all possible data distributions. Therefore, we need to constrain the distributions or, in other words, introduce prior knowledge—that is supervision. Recently, Locatello et al. (2018) obtained a related result for the case of unsupervised learning of disentangled representations: without inductive biases for both the models and the data sets, unsupervised disentanglement learning is fundamentally impossible. These results are purely theoretical and have limited impact on real world applications (Giraud-Carrier & Provost, 2005), precisely because in practice we use multiple inductive biases and implicit supervision, even when we do so-called unsupervised learning.
|
| 218 |
+
|
| 219 |
+
In a strict sense, even the classical, purely unsupervised methods, such as independent component analysis or nearest neighbours classifiers, make use of inductive biases, such as independence or minimum distance, respectively. Without inductive bias, learning is not possible: purely unsupervised learning is an illusion. While this is not news, the terminology used in the recent and current machine learning literature seems to reject supervision and neglect these nuances, evidencing that the field suffers catastrophic forgetting of well-established notions.
|
| 220 |
+
|
| 221 |
+
# 3.2 The brands of alt-supervised learning
|
| 222 |
+
|
| 223 |
+
Particularly in deep learning and computer vision, the term supervised learning has adopted, in practice, the meaning of classification of examples annotated by humans, that is models trained on examples labelled according to, for instance, the object classes. This is yet another instance of catastrophic forgetting—or, at best, abuse—of well-established concepts. It should not be necessary to recall that, first of all, supervised learning is a broader category than classification, which includes also regression and ranking, among other learning modalities. Second, even if we narrow our view to classification only, supervised learning is not restricted to learning from examples annotated by humans. Goodfellow et al. (2016) did not overlook this in their definition of supervised learning: “In many cases the outputs y may be difficult to collect automatically and must be provided by a human ‘supervisor,’ but the term still applies even when the training set targets were collected automatically”.
|
| 224 |
+
|
| 225 |
+
239 In turn, the term unsupervised learning is now used for any model that does not use manually collected
|
| 226 |
+
240 labels, regardless of what other kind of supervision it may use. Further, the term semi-supervised
|
| 227 |
+
241 learning generally refers in practice to models that are trained with a fraction of the labels, but are
|
| 228 |
+
242 tested on the same classification benchmarks. Finally, the term self-supervised learning has recently
|
| 229 |
+
43 gained much popularity, referring to models that are trained on tasks other than the standard task
|
| 230 |
+
44 defined by classification labels.
|
| 231 |
+
245 Some of the methods proposed under these categories are certainly useful—that is not the subject of
|
| 232 |
+
246 criticism of this work—but the terminology is overly confusing and unnecessary. A newcomer would
|
| 233 |
+
247 easily fall into a scientific rabbit hole trying to discern the meaning of each of these names through
|
| 234 |
+
248 publications—not to mention if they incorporated social media discussions into their endeavour. By
|
| 235 |
+
249 way of illustration, the authors of this paper have witnessed how a recurrent question by students who
|
| 236 |
+
250 learn about recent deep learning methods is whether there is any difference between self-supervised
|
| 237 |
+
251 and unsupervised learning. Are students missing something fundamental? The following anecdotal
|
| 238 |
+
252 recall of influential keynote talks at artificial intelligence conferences should shed some light on part
|
| 239 |
+
253 of the origins of this confusion: In December 2016, Prof. Yann LeCun titled his NeurIPS keynote
|
| 240 |
+
254 presentation “Predictive Learning”, to refer to “what many people mean by unsupervised learning”
|
| 241 |
+
255 (LeCun, 2016). A few years later, in his keynote presentation at ISSCC in February 2019, he spoke
|
| 242 |
+
256 about similar ideas, but this time the title was “Self-Supervised Learning” (LeCun, 2019). In social
|
| 243 |
+
257 media, he wrote: “I now call it ‘self-supervised learning’, because ‘unsupervised’ is both a loaded
|
| 244 |
+
258 and confusing term” . Students may be getting things rather right.
|
| 245 |
+
|
| 246 |
+
Is there then a fundamental difference—a theoretically grounded one—between the deep learning methods labelled as unsupervised learning and more recently self-supervised learning? We argue that these are mostly brand names that reflect trends in the field, adding noise to the scientific progress and leading many astray. Therefore, we propose that, given the recent progress, the field of machine learning research would benefit from an exercise of self-reflection and from an effort to devise a rigorous taxonomy of the variety of methods. From a theoretical point of view, both the conventional classification models and the recent wave of self-supervised tasks can all be formalised as sub-categories of supervised learning.
|
| 247 |
+
|
| 248 |
+
# 3.3 Supervision comes in different flavours
|
| 249 |
+
|
| 250 |
+
In Section 2.2, we have seen examples of different forms of supervision used by humans and other animals. In machine learning, the field focused for many years on a few loss functions, such as classification and simple forms of regression. The relatively recent explosion of deep learning has brought about the development of several libraries for automatic differentiation (Baydin et al., 2017), which in turn have enabled the proposal of multiple loss functions and learning tasks with various types of supervision that can easily be optimised numerically by stochastic gradient descent and artificial neural networks. This has certainly opened promising and already fruitful avenues to incorporate richer forms of supervision and inductive biases other than classification, some inspired by biological learning, into machine learning algorithms.
|
| 251 |
+
|
| 252 |
+
277 A currently popular example is image data augmentation: Although until recently it was seen as a
|
| 253 |
+
278 naïve technique to simply create additional training data, data augmentation actually encodes rich prior
|
| 254 |
+
279 knowledge about human visual perception, in the case of computer vision. This is why it outperforms
|
| 255 |
+
280 explicit regularisation methods, which provide less effective inductive biases Hernández-García &
|
| 256 |
+
281 König (2018), and was used in “semi-supervised” tasks Laine & Aila (2016). The rich information
|
| 257 |
+
282 embedded in image transformations has been used to encourage invariant outputs under different
|
| 258 |
+
283 augmentations through contrastive losses (Ye et al., 2019), and even at intermediate representations,
|
| 259 |
+
284 inspired by the invariance in the visual cortex (Hernández-García et al., 2019), although these methods
|
| 260 |
+
285 were not branded as self-supervision. The use of this term for losses based on data augmentation
|
| 261 |
+
286 was further popularised after the success of similar methods such as SimCLR (Chen et al., 2020).
|
| 262 |
+
287 Beyond data augmentation invariance, the zoo of self-supervised learning tasks in computer vision is
|
| 263 |
+
288 rich and diverse: classifying the rotation applied to image patches (Gidaris et al., 2018), predicting
|
| 264 |
+
289 image colourisation (Larsson et al., 2017), classifying the relative position of two image patches
|
| 265 |
+
290 (Doersch et al., 2015), or even solving full jigsaw puzzles (Noroozi & Favaro, 2016) (Jing & Tian
|
| 266 |
+
291 (2020) recently performed an extensive review).
|
| 267 |
+
292 The current trend is to refer to these methods as self-supervised learning, but similar methods were
|
| 268 |
+
293 referred to in the past as semi-supervised, unsupervised, and even predictive learning, as we have seen.
|
| 269 |
+
294 A look at the papers reveals that these terms have been used mostly interchangeably. The terms self
|
| 270 |
+
295 and semi- and unsupervised learning imply that less supervision is used, but it would be misleading to
|
| 271 |
+
296 seriously argue that the tasks are devoid of supervision. Most of these techniques make use of a wide
|
| 272 |
+
297 range of surrogate tasks with supervisory signals defined by humans. In fact, they could have been
|
| 273 |
+
298 called hyper-supervised2 learning. Here, we contend that these methods are all variants of supervised
|
| 274 |
+
299 learning, only that supervision comes in different flavours, both in biological and machine learning,
|
| 275 |
+
300 and we should call it by its name and ideally develop a rigorous taxonomy.
|
| 276 |
+
|
| 277 |
+
# 01 4 Discussion
|
| 278 |
+
|
| 279 |
+
In this paper, we have discussed some of the overambitious promises of the deep learning hype, namely that machine learning models should be able to generalise to unseen distributions, from a few examples, without human intervention or supervision. These claims have often been motivated by alleged generalisation capabilities of humans. In order to assess these motivations, we have first reviewed, in Section 2, some often overlooked characteristics of biological learning relevant to machine learning research. In particular, we have argued that humans and other animals receive extensive and diverse input stimuli as well as multiple supervisory signals, including the long history of evolution and cultural transmission. In the light of these insights from biological learning, we have then, in Section 3, critically reviewed the various terms that are currently used to refer to supposed alternatives to supervised learning: semi-, self- and unsupervised learning, among others. In sum, we pointed out that all these approaches are in fact supervised learning—though not necessarily classification—and the machine learning (research) community would benefit from using more rigorous, less overselling nomenclature, and from devising a more rigorous taxonomy.
|
| 280 |
+
|
| 281 |
+
15 Supervision is not evil. It is at the core of statistical learning theory: learning is impossible without
|
| 282 |
+
316 inductive biases or supervision. But supervision comes in different flavours, not only as classification
|
| 283 |
+
17 labels. Neither is deep learning some sort of exceptional solution to learn without human intervention
|
| 284 |
+
318 and supervision, nor is it a hopeless model class because it requires large data sets (Marcus, 2018).
|
| 285 |
+
319 The human visual system is exposed to a lot of stimuli too. One exceptional advantage of deep
|
| 286 |
+
320 learning is precisely that it is possible to effectively optimise different learning objectives, almost
|
| 287 |
+
321 end-to-end, from large collections of nearly naturalistic sensory signals, such as digital images (Saxe
|
| 288 |
+
322 et al., 2020). While other models are known to scale poorly as the amount of data increases, neural
|
| 289 |
+
323 networks excel at fitting the training data and interpolating on unseen examples (Belkin et al., 2019;
|
| 290 |
+
324 Hasson et al., 2020). This is a feature, not a bug. But we will make better progress if we exploit
|
| 291 |
+
325 these advantages of deep learning without neglecting that supervision will always be necessary—the
|
| 292 |
+
26 critical goal is how to best incorporate it and exploit it.
|
| 293 |
+
|
| 294 |
+
In this regard, we argue that deep learning needs more supervision, and not less. A major focus of the deep learning community in the last decade has been image object classification. This has brought about unprecedented progress and unveiled the limitations of having classification as chief task and class labels as main supervisory signal. For example, deep classifiers have been found to learn spurious features that are highly discriminative for the classification task but with little true generalisation power and clearly not aligned with perceptual features (Jo & Bengio, 2017; Wang et al., 2019; Geirhos et al., 2020). In fact, this mismatch has been argued to be at the root of adversarial vulnerability (Ilyas et al., 2019) and seems to be the consequence of training highly expressive, over-parameterised models in heavily unconstrained tasks. This can be addressed with meaningful constraints, that is more and richer supervision, possibly inspired by human perception and biological learning. For example, combining a classification loss with a similarity loss inspired by the invariance in the visual cortex yields more robust representations without detriment to categorisation (HernándezGarcía et al., 2019), and simulating the properties of the primary visual cortex may improve the adversarial robustness of neural networks (Dapello et al., 2020). Expanding in this direction leads to biologically-inspired, multi-task and representation learning, and away from just classification.
|
| 295 |
+
|
| 296 |
+
# 342 5 Conclusions for future research directions
|
| 297 |
+
|
| 298 |
+
The chief goal of this paper is rather descriptive than prescriptive. We have aimed to identify and describe aspects of the current trends in machine learning research that could be improved, in the hope of inspiring future work that effectively address them. Nonetheless, throughout the paper we have made suggestions that may help mitigate the confusion with the terminology, clarify research directions and ultimately bring about scientific progress in machine learning research. We outline these suggestions here to conclude the paper.
|
| 299 |
+
|
| 300 |
+
349 We have drawn parallels from cognitive neuroscience to contend that learning in nature also requires
|
| 301 |
+
350 abundant data and supervision in multiple forms. Even evolution can be regarded as an optimisation
|
| 302 |
+
351 process where natural selection is the supervisory signal. We have argued, as others have before, that
|
| 303 |
+
352 these insights from biology, neuroscience and developmental psychology, among other fields, offer a
|
| 304 |
+
353 great opportunity for machine learning research to draw inspiration and calibrate its compass.
|
| 305 |
+
354 As we have discussed, research in deep learning has departed from pure classification and has been
|
| 306 |
+
355 exploring new learning tasks and ways of training artificial neural networks. Nonetheless, in some
|
| 307 |
+
356 fields such as computer vision, the ultimate benchmark to assess the value of a method is still the
|
| 308 |
+
357 accuracy on classification data sets, such as ImageNet, even though there is evidence of overfitting
|
| 309 |
+
358 the test set. While object recognition will remain an important benchmark, as deep learning is
|
| 310 |
+
359 well suited to learn representations, we should develop methods to assess the quality of the learnt
|
| 311 |
+
360 representations for tasks other than classification. In this regard, we encourage researchers to evaluate
|
| 312 |
+
361 their models with tests that are still not widespread, such as the suitability for transfer learning,
|
| 313 |
+
362 adversarial robustness, comparison with brain measurements, behavioural tasks, etc.
|
| 314 |
+
363 We have also argued that the field would benefit from an effort to devise a rigorous taxonomy of
|
| 315 |
+
364 learning methods that sheds light on the ocean of methods proposed in the past years. The terms
|
| 316 |
+
365 self-, semi- and unsupervised learning have been used interchangeably and this is often a source of
|
| 317 |
+
366 confusion for students and newcomers. While confusing terminology is natural in a rapidly growing,
|
| 318 |
+
367 the time might have come for distilling the progress of the past years into rigorous nomenclature that
|
| 319 |
+
368 better survive the test of time.
|
| 320 |
+
369 Finally, we recall that most of the learning theory has been developed for simple loss functions such
|
| 321 |
+
370 as binary classification or mean squared error regression, but certain methods successfully used in
|
| 322 |
+
371 practice today escape the available theory. Given the success of this kind of more complex supervised
|
| 323 |
+
372 objectives, the study of these methods from a theoretical point of view might be a fruitful direction
|
| 324 |
+
373 for future work.
|
| 325 |
+
|
| 326 |
+
# 374 Broader Impact
|
| 327 |
+
|
| 328 |
+
Since this article does not present a new method or results from data sets, potential risks of “bias in the data” or “failure of the system” do not apply. As a critical review of current trends in the field and cite multiple research articles, some researchers could potentially feel addressed and affected by our mentions. We declare that we do not intend to negatively affect any individual researcher and we have only referred to individuals directly in the case of well-established scientist with a reputation. Our goal has been in any case to potentially improve scientific progress through a constructive reflection.
|
| 329 |
+
|
| 330 |
+
# References
|
| 331 |
+
|
| 332 |
+
Abu-Mostafa, Y. S., Magdon-Ismail, M., and Lin, H.-T. Learning from data. AMLBooks, 2012.
|
| 333 |
+
|
| 334 |
+
Amodei, D. and Hernandez, D. AI and compute. Accessed: 2020-09-28, 2018. URL https: //openai.com/blog/ai-and-compute/.
|
| 335 |
+
Arpit, D. et al. A closer look at memorization in deep networks. arXiv preprint arXiv:1706.05394, 2017.
|
| 336 |
+
Atkinson, J. The developing visual brain. Oxford Scholarship Online, 2002.
|
| 337 |
+
Baydin, A. G., Pearlmutter, B. A., Radul, A. A., and Siskind, J. M. Automatic differentiation in machine learning: a survey. Journal of Machine Learning Research (JMLR), 2017.
|
| 338 |
+
Becker, S. Implicit learning in 3D object recognition: The importance of temporal context. Neural Computation, 1999.
|
| 339 |
+
Belkin, M., Hsu, D., Ma, S., and Mandal, S. Reconciling modern machine-learning practice and the classical bias–variance trade-off. Proceedings of the National Academy of Sciences (PNAS), 2019.
|
| 340 |
+
Biederman, I. and Bar, M. One-shot viewpoint invariance in matching novel objects. Vision Research, 1999.
|
| 341 |
+
Bornstein, M. H. and Arterberry, M. E. The development of object categorization in young children: Hierarchical inclusiveness, age, perceptual attribute, and group versus individual analyses. Developmental Psychology, 2010.
|
| 342 |
+
Bülthoff, I. and Newell, F. N. The role of familiarity in the recognition of static and dynamic objects. Progress in Brain Research, 2006.
|
| 343 |
+
Burghardt, G. M. The genesis of animal play: Testing the limits. Mit Press, 2005.
|
| 344 |
+
Cao, Q., Shen, L., Xie, W., Parkhi, O. M., and Zisserman, A. VGGFace2: A dataset for recognising faces across pose and age. In IEEE International Conference on Automatic Face & Gesture Recognition. 2018.
|
| 345 |
+
Carouso-Peck, S. and Goldstein, M. H. Female social feedback reveals non-imitative mechanisms of vocal learning in zebra finches. Current Biology, 2019.
|
| 346 |
+
Chapelle, O., Schölkopf, B., and Zien, A. (eds.). Semi-supervised learning. MIT Press, 2006.
|
| 347 |
+
Chen, T., Kornblith, S., Norouzi, M., and Hinton, G. A simple framework for contrastive learning of visual representations. In International conference on machine learning. 2020.
|
| 348 |
+
Dapello, J., Marques, T., Schrimpf, M., Geiger, F., Cox, D. D., and DiCarlo, J. J. Simulating a primary visual cortex at the front of cnns improves robustness to image perturbations. BioRxiv, 2020.
|
| 349 |
+
Doersch, C., Gupta, A., and Efros, A. A. Unsupervised visual representation learning by context prediction. In Proceedings of the IEEE international conference on computer vision, 2015.
|
| 350 |
+
Edelman, S. and Bülthoff, H. H. Orientation dependence in the recognition of familiar and novel views of three-dimensional objects. Vision Research, 1992.
|
| 351 |
+
Farroni, T., Johnson, M. H., Menon, E., Zulian, L., Faraguna, D., and Csibra, G. Newborns’ preference for face-relevant stimuli: Effects of contrast polarity. Proceedings of the National Academy of Sciences, 2005.
|
| 352 |
+
Fukushima, K. and Miyake, S. Neocognitron: A new algorithm for pattern recognition tolerant of deformations and shifts in position. Pattern Recognition, 1982.
|
| 353 |
+
Gauthier, I., Tarr, M. J., Anderson, A. W., Skudlarski, P., and Gore, J. C. Activation of the middle fusiform’face area’increases with expertise in recognizing novel objects. Nature Neuroscience, 1999.
|
| 354 |
+
Geirhos, R., Jacobsen, J.-H., Michaelis, C., Zemel, R., Brendel, W., Bethge, M., and Wichmann, F. A. Shortcut learning in deep neural networks. arXiv preprint arXiv:2004.07780, 2020.
|
| 355 |
+
Gelman, S. A. and Meyer, M. Child categorization. Wiley Interdisciplinary Reviews: Cognitive Science, 2011.
|
| 356 |
+
Gidaris, S., Singh, P., and Komodakis, N. Unsupervised representation learning by predicting image rotations. arXiv preprint arXiv:1803.07728, 2018.
|
| 357 |
+
Giraud-Carrier, C. and Provost, F. Toward a justification of meta-learning: Is the no free lunch theorem a show-stopper. In Proceedings of the ICML-2005 Workshop on Meta-learning, 2005.
|
| 358 |
+
Goodfellow, I., Bengio, Y., and Courville, A. Deep learning. MIT Press, 2016.
|
| 359 |
+
Gopnik, A. Childhood as a solution to explore–exploit tensions. Philosophical Transactions of the Royal Society B, 2020.
|
| 360 |
+
Gopnik, A. Brain Inspired podcast, by Paul Middle Middlebrooks. BI 094 Alison Gopnik: ChildInspired AI. https://braininspired.co/podcast/94/, 2021.
|
| 361 |
+
Gopnik, A., Frankenhuis, W. E., and Tomasello, M. Introduction to special issue:‘life history and learning: how childhood, caregiving and old age shape cognition and culture in humans and other animals’, 2020.
|
| 362 |
+
441 Harwerth, R. S., Smith, E. L., Duncan, G. C., Crawford, M., and Von Noorden, G. K. Multiple sensitive periods in the development of the primate visual system. Science, 1986.
|
| 363 |
+
443 Hassabis, D., Kumaran, D., Summerfield, C., and Botvinick, M. Neuroscience-inspired artificial intelligence. Neuron, 2017. Hasson, U., Nastase, S. A., and Goldstein, A. Direct fit to nature: An evolutionary perspective on biological and artificial neural networks. Neuron, 2020.
|
| 364 |
+
447 Hernández-García, A. and König, P. Data augmentation instead of explicit regularization. arXiv preprint arXiv:1806.03852, 2018.
|
| 365 |
+
449 Hernández-García, A., König, P., and Kietzmann, T. Learning robust visual representations using data augmentation invariance. arXiv preprint arXiv:1906.04547, 2019.
|
| 366 |
+
Hinton, G. and Sejnowski, T. (eds.). Unsupervised learning. MIT Press, 1999.
|
| 367 |
+
452 Ilyas, A., Santurkar, S., Tsipras, D., Engstrom, L., Tran, B., and Madry, A. Adversarial examples are not bugs, they are features. arXiv preprint arXiv:1905.02175, 2019.
|
| 368 |
+
454 Jing, L. and Tian, Y. Self-supervised visual feature learning with deep neural networks: A survey. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 2020.
|
| 369 |
+
456 Jo, J. and Bengio, Y. Measuring the tendency of CNNs to learn surface statistical regularities. arXiv preprint arXiv:1711.11561, 2017.
|
| 370 |
+
458 Kording, K. P., Kayser, C., Einhauser, W., and Konig, P. How are complex cell properties adapted to the statistics of natural stimuli? Journal of Neurophysiology, 2004.
|
| 371 |
+
Kuhl, P. K. Is speech learning ‘gated’by the social brain? Developmental science, 2007.
|
| 372 |
+
461 Laine, S. and Aila, T. Temporal ensembling for semi-supervised learning. arXiv preprint arXiv:1610.02242, 2016.
|
| 373 |
+
463 Larsson, G., Maire, M., and Shakhnarovich, G. Colorization as a proxy task for visual understanding. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2017. LeCun, Y. Predictive learning, December 2016. URL https://nips.cc/Conferences/2016/ ScheduleMultitrack?event=6197. Invited talk at the Thirtieth Conference on Neural Information Processing Systems (NeurIPS) 2016. Slide 24, starting on minute 14:34.
|
| 374 |
+
468 LeCun, Y. Deep learning hardware: Past, present, and future, February 2019. URL https://www. youtube.com/watch?v $\mathbf { \simeq }$ YzD7Z2yRL7Y. Invited talk at the International Solid-State Circuits Conference (ISSCC) 2019. Slide 57, starting on minute 27:24.
|
| 375 |
+
471 LeCun, Y., Bengio, Y., and Hinton, G. Deep learning. Nature, 2015.
|
| 376 |
+
472 Lenneberg, E. H. The biological foundations of language. Hospital Practice, 1967.
|
| 377 |
+
473 Lindsey, J., Ocko, S. A., Ganguli, S., and Deny, S. A unified theory of early visual representations from retina to cortex through anatomically constrained deep CNNs. In International Conference on Learning Representations (ICLR), arXiv:1901.00945, 2019. Locatello, F., Bauer, S., Lucic, M., Rätsch, G., Gelly, S., Schölkopf, B., and Bachem, O. Challenging common assumptions in the unsupervised learning of disentangled representations. arXiv preprint arXiv:1811.12359, 2018.
|
| 378 |
+
479 Malhotra, G., Evans, B. D., and Bowers, J. S. Hiding a plane with a pixel: examining shape-bias in CNNs and the benefit of building in biological constraints. Vision Research, 2020.
|
| 379 |
+
481 Marcus, G. Deep learning: A critical appraisal. arXiv preprint arXiv:1801.00631, 2018.
|
| 380 |
+
482 Milivojevic, B. Object recognition can be viewpoint dependent or invariant–it’s just a matter of time and task. Frontiers in Computational Neuroscience, 2012.
|
| 381 |
+
|
| 382 |
+
Morgenstern, Y., Schmidt, F., and Fleming, R. W. One-shot categorization of novel object classes in humans. Vision Research, 2019. Mundt, M., Hong, Y. W., Pliushch, I., and Ramesh, V. A wholistic view of continual learning with deep neural networks: Forgotten lessons and the bridge to active and open world learning. arXiv preprint arXiv:2009.01797, 2020. Murphy, K. P. Machine learning: a probabilistic perspective. MIT Press, 2012. Noroozi, M. and Favaro, P. Unsupervised learning of visual representations by solving jigsaw puzzles. In European conference on computer vision. 2016. Pelz, M. and Kidd, C. The elaboration of exploratory play. Philosophical Transactions of the Royal Society B, 2020. Rosenblatt, F. The perceptron: a probabilistic model for information storage and organization in the brain. Psychological Review, 1958. Russakovsky, O. et al. ImageNet large scale visual recognition challenge. International Journal of Computer Vision (IJCV), 2015. Saxe, A., Nelli, S., and Summerfield, C. If deep learning is the answer, then what is the question? arXiv preprint arXiv:2004.07580, 2020. Schwartz, R., Dodge, J., Smith, N. A., and Etzioni, O. Green ai. arXiv preprint arXiv:1907.10597, 2019. Shapiro, L. Embodied cognition. Oxford Handbooks Online, 2012. 503 Spriet, C., Abassi, E., Hochmann, J.-R., and Papeo, L. Visual object categorization in infancy. bioRxiv, 2021. Tarr, M. J., Williams, P., Hayward, W. G., and Gauthier, I. Three-dimensional object recognition is viewpoint dependent. Nature Neuroscience, 1998. Turing, A. M. Cybernetics; (Key papers). University Park Press, 1968. Uomini, N., Fairlie, J., Gray, R. D., and Griesser, M. Extended parenting and the evolution of cognition. Philosophical Transactions of the Royal Society B, 2020. Valentine, T. Upside-down faces: A review of the effect of inversion upon face recognition. British Journal of Psychology, 1988. Van Horn, G., Mac Aodha, O., Song, Y., Cui, Y., Sun, C., Shepard, A., Adam, H., Perona, P., and Belongie, S. The inaturalist species classification and detection dataset. In Proceedings of the IEEE conference on computer vision and pattern recognition, 2018. Vinyals, O., Blundell, C., Lillicrap, T., Wierstra, D., et al. Matching networks for one shot learning. In Advances in Neural Information Processing Systems (NeurIPS), 2016. Wang, H., Wu, X., Yin, P., and Xing, E. P. High frequency component helps explain the generalization of convolutional neural networks. arXiv preprint arXiv:1905.13545, 2019. Wolpert, D. H. The lack of a priori distinctions between learning algorithms. Neural Computation, 1996. Wyss, R., König, P., and Verschure, P. F. Invariant representations of visual patterns in a temporal population code. Proceedings of the National Academy of Sciences (PNAS), 2003. Ye, M., Zhang, X., Yuen, P. C., and Chang, S.-F. Unsupervised embedding learning via invariant and spreading instance feature. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2019. 526 Yin, R. K. Looking at upside-down faces. Journal of Experimental Psychology, 1969.
|
| 383 |
+
|
| 384 |
+
Zador, A. M. A critique of pure learning and what artificial neural networks can learn from animal brains. Nature Communications, 2019.
|
| 385 |
+
Zhang, C., Bengio, S., Hardt, M., Recht, B., and Vinyals, O. Understanding deep learning requires rethinking generalization. In International Conference on Learning Representations (ICLR), arXiv:1611.03530, 2017.
|
| 386 |
+
Zhuang, F., Qi, Z., Duan, K., Xi, D., Zhu, Y., Zhu, H., Xiong, H., and He, Q. A comprehensive survey on transfer learning. arXiv preprint arXiv:1911.02685, 2019.
|
| 387 |
+
|
| 388 |
+
# Checklist
|
| 389 |
+
|
| 390 |
+
1. For all authors...
|
| 391 |
+
|
| 392 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 393 |
+
(b) Did you describe the limitations of your work? [Yes] See the beginning of Section 5.
|
| 394 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes] See Section 5.
|
| 395 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 396 |
+
|
| 397 |
+
2. If you are including theoretical results...
|
| 398 |
+
|
| 399 |
+
(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
|
| 400 |
+
|
| 401 |
+
3. If you ran experiments...
|
| 402 |
+
|
| 403 |
+
(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)? [N/A]
|
| 404 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [N/A]
|
| 405 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [N/A]
|
| 406 |
+
(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)? [N/A]
|
| 407 |
+
|
| 408 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 409 |
+
|
| 410 |
+
(a) If your work uses existing assets, did you cite the creators? [N/A]
|
| 411 |
+
(b) Did you mention the license of the assets? [N/A]
|
| 412 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 413 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 414 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 415 |
+
|
| 416 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 417 |
+
|
| 418 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 419 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 420 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/H1Heentlx/H1Heentlx.md
ADDED
|
@@ -0,0 +1,289 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DEEP VARIATIONAL CANONICAL CORRELATION ANALYSIS
|
| 2 |
+
|
| 3 |
+
Weiran Wang1 Xinchen Yan2 Honglak Lee2 Karen Livescu1
|
| 4 |
+
1TTI-Chicago, Chicago, IL 60637, USA
|
| 5 |
+
2University of Michigan, Ann Arbor, MI 48109, USA
|
| 6 |
+
1{weiranwang,klivescu}@ttic.edu {xcyan,honglak}@umich.edu
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
We present deep variational canonical correlation analysis (VCCA), a deep multiview learning model that extends the latent variable model interpretation of linear CCA (Bach and Jordan, 2005) to nonlinear observation models parameterized by deep neural networks (DNNs). Computing the marginal data likelihood, as well as inference of the latent variables, are intractable under this model. We derive a variational lower bound of the data likelihood by parameterizing the posterior density of the latent variables with another DNN, and approximate the lower bound via Monte Carlo sampling. Interestingly, the resulting model resembles that of multiview autoencoders (Ngiam et al., 2011), with the key distinction of an additional sampling procedure at the bottleneck layer. We also propose a variant of VCCA called VCCA-private which can, in addition to the “common variables” underlying both views, extract the “private variables” within each view. We demonstrate that VCCA-private is able to disentangle the shared and private information for multi-view data without hard supervision.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
In the multi-view representation learning setting, we have multiple views/measurements of the same underlying signal, and the goal is to learn useful features of each view using complementary information contained in the views. The intuition underlying this setting is that the learned features can help uncover the common sources of variation in the views, which can be helpful for exploratory analysis or for downstream tasks.
|
| 15 |
+
|
| 16 |
+
A classical approach in this setting is canonical correlation analysis (CCA, Hotelling, 1936) and its nonlinear extensions, including the kernel extension (Lai and Fyfe, 2000; Akaho, 2001; Melzer et al., 2001; Bach and Jordan, 2002) and the deep neural network (DNN) extension (Andrew et al., 2013; Wang et al., 2015b). CCA projects two random vectors $\mathbf { x } \in \mathbb { R } ^ { d _ { x } }$ and $\mathbf { y } \in \mathbb { R } ^ { d _ { y } }$ into a lowerdimensional subspace so that the projections are maximally correlated. There is a probabilistic latent variable model interpretation of linear CCA (Bach and Jordan, 2005) as shown in Figure 1 (left). Assume that $\mathbf { x }$ and y are linear functions of some lower-dimensional random variable $\textbf { z } \in \mathbb { R } ^ { d _ { z } }$ , where $d _ { z } \leq \operatorname* { m i n } ( d _ { x } , d _ { y } )$ . When the prior distribution of the latent variable $p ( \mathbf { z } )$ and the conditional distributions $p ( \mathbf { x } | \mathbf { z } )$ and $p ( \mathbf { y } \vert \mathbf { z } )$ are Gaussian, Bach and Jordan (2005) showed that $\mathbb { E } [ \mathbf { z } | \mathbf { x } ]$ (resp. $\mathbb { E } [ \mathbf { z } | \mathbf { y } ] )$ lives in the same space as the linear CCA projection for $\mathbf { x }$ (resp. y).
|
| 17 |
+
|
| 18 |
+
This generative interpretation of CCA is often lost in nonlinear extensions of CCA. For example, in deep CCA (DCCA, (Andrew et al., 2013)), to extend CCA to nonlinear mappings with greater representation power, one extracts nonlinear features from the original inputs of each view using two DNNs, f for $\mathbf { x }$ and $\mathbf { g }$ for $\mathbf { y }$ , so that the canonical correlation of the DNN outputs (measured by a linear CCA with projection matrices $\mathbf { U }$ and $\mathbf { V }$ ) is maximized. Formally, given a dataset of $N$ pairs of observations $( \mathbf { x } _ { 1 } , \mathbf { y } _ { 1 } ) , \dotsc , ( \mathbf { x } _ { N } , \mathbf { y } _ { N } )$ of the random vectors $\displaystyle ( \mathbf { x } , \mathbf { y } )$ , DCCA optimizes
|
| 19 |
+
|
| 20 |
+
$$
|
| 21 |
+
\begin{array} { r l } { \underset { \mathbf { w } _ { \mathrm { f } } , \mathbf { w } _ { \mathbf { g } } } { \operatorname* { m a x } } \ : \mathrm { t r } \left( \mathbf { U } ^ { \top } \mathbf { f } ( \mathbf { X } ) \mathbf { g } ( \mathbf { Y } ) ^ { \top } \mathbf { V } \right) } & { \mathrm { ~ s . t . ~ } \mathbf { U } ^ { \top } \left( \mathbf { f } ( \mathbf { X } ) \mathbf { f } ( \mathbf { X } ) ^ { \top } \right) \mathbf { U } = \mathbf { V } ^ { \top } \left( \mathbf { g } ( \mathbf { Y } ) \mathbf { g } ( \mathbf { Y } ) ^ { \top } \right) \mathbf { V } = N \mathbf { I } , } \end{array}
|
| 22 |
+
$$
|
| 23 |
+
|
| 24 |
+
where $\mathbf { f } ( \mathbf { X } ) = [ \mathbf { f } ( \mathbf { x } _ { 1 } ) , \dots , \mathbf { f } ( \mathbf { x } _ { N } ) ]$ and $\mathbf { g } ( \mathbf { Y } ) = [ \mathbf { g } ( \mathbf { y } _ { 1 } ) , \dots , \mathbf { g } ( \mathbf { y } _ { N } ) ]$ , and $\mathbf { W _ { f } }$ denotes all weight parameters of the DNN f (and similarly for $\mathbf { g }$ ).
|
| 25 |
+
|
| 26 |
+

|
| 27 |
+
Figure 1: Left: Probabilistic interpretation of CCA (Bach and Jordan, 2005). Right: The deep variational CCA (VCCA) model.
|
| 28 |
+
|
| 29 |
+
DCCA has achieved good performance in the multi-view representation learning setting across different domains (Wang et al., 2015b,a; Lu et al., 2015; Yan and Mikolajczyk, 2015). However, a disadvantage of DCCA is that it directly looks for DNNs that can map inputs into the low-dimensional space, without a model for generating samples from the latent space. Although Wang et al. (2015b)’s deep canonically correlated autoencoders (DCCAE) model optimizes the combination of the autoencoder objective (reconstruction errors) and the canonical correlation objective, the authors found that in practice, the canonical correlation term tends to dominate the reconstruction error terms in the DCCAE objective when tuning performance for a downstream task (especially when the inputs are noisy), and as a result the inputs are not reconstructed well. At the same time, optimization of the DCCA and DCCAE objectives is challenging due to the constraints that couple all training samples.
|
| 30 |
+
|
| 31 |
+
The main contribution of this paper is the proposal of a new deep multi-view learning model named deep variational CCA (VCCA), which extends the latent variable model interpretation of linear CCA to nonlinear observation models parameterized by DNNs. Computing the marginal data likelihood, as well as inference of the latent variables, are intractable under this model. Inspired by variational autoencoders (VAE, Kingma and Welling, 2014), we parameterize the posterior distribution of the latent variables with another DNN, and derive a variational lower bound of the data likelihood as the objective of VCCA, which is further approximated by Monte Carlo sampling. With the reparameterization trick, sampling for the Monte Carlo approximation is trivial and all DNN weights in VCCA can be optimized jointly via stochastic gradient descent, using unbiased gradient estimates from small minibatches. Interestingly, VCCA is related to multi-view autoencoders (Ngiam et al., 2011), with the key distinctions of additional regularization on the posterior distribution and the sampling procedure at the bottleneck layer.
|
| 32 |
+
|
| 33 |
+
We also propose a variant of VCCA called VCCA-private that can, in addition to the “common variables” underlying both views, extract the “private variables” within each view. We demonstrate that VCCA-private is able to disentangle the shared and private information for multi-view data without hard supervision. Last but not least, as generative models, VCCA and VCCA-private enable us to obtain high-quality samples for the input of each view.
|
| 34 |
+
|
| 35 |
+
# 2 VARIATIONAL CCA
|
| 36 |
+
|
| 37 |
+
The probabilistic latent variable model of CCA (Bach and Jordan, 2005) defines the following joint distribution over the random variables $\displaystyle ( \mathbf { x } , \mathbf { y } )$ :
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
p ( \mathbf { x } , \mathbf { y } , \mathbf { z } ) = p ( \mathbf { z } ) p ( \mathbf { x } | \mathbf { z } ) p ( \mathbf { y } | \mathbf { z } ) , \qquad p ( \mathbf { x } , \mathbf { y } ) = \int p ( \mathbf { x } , \mathbf { y } , \mathbf { z } ) d \mathbf { z } .
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
The assumption underlying this model is that, conditioned on the latent variables $\textbf { z } \in \mathbb { R } ^ { d _ { z } }$ , the two views $\mathbf { x }$ and $\mathbf { y }$ are independent. However, linear observation models $( p ( \mathbf { x } | \mathbf { z } )$ and $p ( \mathbf { y } \vert \mathbf { z } )$ as shown in Figure 1 (left)) have limited representation power. In this paper, we consider nonlinear observation models $p _ { \pmb { \theta } } ( \mathbf { x } | \mathbf { z } ; \pmb { \theta } _ { x } )$ and $p _ { \pmb { \theta } } ( \mathbf { y } | \mathbf { z } ; \pmb { \theta } _ { y } )$ , parameterized by $\pmb { \theta } _ { x }$ and $\theta _ { y }$ respectively, which can be the collections of weights of DNNs. In this case, the marginal likelihood $p _ { \pmb { \theta } } ( \mathbf { x } , \mathbf { y } )$ does not have a closed form. In addition, the inference problem $p _ { \pmb { \theta } } ( \mathbf { z } | \mathbf { x } )$ —the problem of inferring the latent variables given one of the views—is also intractable.
|
| 44 |
+
|
| 45 |
+
Inspired by Kingma and Welling (2014)’s work on variational autoencoders (VAE), we approximate $p _ { \pmb { \theta } } ( \mathbf { z } | \mathbf { x } )$ with the conditional density $q _ { \phi } ( \mathbf { z } | \mathbf { x } ; \phi _ { z } )$ , where $\phi _ { z }$ is the collection of parameters of another DNN.1 We can derive a lower bound on the marginal data likelihood using $q _ { \phi } ( \mathbf { z } | \mathbf { x } )$ :
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\begin{array} { r l } & { \log p _ { \theta } ( \mathbf { x } , \mathbf { y } ) = \log p _ { \theta } ( \mathbf { x } , \mathbf { y } ) \int q _ { \phi } ( \mathbf { z } | \mathbf { x } ) d \mathbf { z } = \int \log p _ { \theta } ( \mathbf { x } , \mathbf { y } ) q _ { \phi } ( \mathbf { z } | \mathbf { x } ) d \mathbf { z } } \\ & { \qquad = \int q _ { \phi } ( \mathbf { z } | \mathbf { x } ) \left( \log \frac { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } { p _ { \theta } ( \mathbf { z } | \mathbf { x } , \mathbf { y } ) } + \log \frac { p _ { \theta } ( \mathbf { x } , \mathbf { y } , \mathbf { z } ) } { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \right) d \mathbf { z } } \\ & { \qquad = D _ { K L } ( q _ { \phi } ( \mathbf { z } | \mathbf { x } ) | | p _ { \theta } ( \mathbf { z } | \mathbf { x } , \mathbf { y } ) ) + \mathbb { E } _ { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \left[ \log \frac { p _ { \theta } ( \mathbf { x } , \mathbf { y } , \mathbf { z } ) } { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \right] } \\ & { \qquad \geq \mathbb { E } _ { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \left[ \log \frac { p _ { \theta } ( \mathbf { x } , \mathbf { y } , \mathbf { z } ) } { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \right] = : \mathcal { L } ( \mathbf { x } , \mathbf { y } ; \theta , \phi ) } \end{array}
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
where we used the fact that KL divergence is nonnegative in the last step. As a result, $\mathcal { L } ( \mathbf { x } , \mathbf { y } ; \pmb { \theta } , \phi )$ is a lower bound on the data log-likelihood $\log _ { \pmb { \theta } } p ( \mathbf { x } , \mathbf { y } )$ . Substituting (2) into (3), we have
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\begin{array} { l } { \displaystyle \mathcal { L } ( \mathbf { x } , \mathbf { y } ; \pmb { \theta } , \phi ) = \int q _ { \phi } ( \mathbf { z } | \mathbf { x } ) \left( \log \frac { p ( \mathbf { z } ) } { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } + \log p _ { \theta } ( \mathbf { x } | \mathbf { z } ) + \log p _ { \theta } ( \mathbf { y } | \mathbf { z } ) \right) d \mathbf { z } } \\ { \displaystyle = - D _ { K L } ( q _ { \phi } ( \mathbf { z } | \mathbf { x } ) | | p ( \mathbf { z } ) ) + \mathbb { E } _ { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \left[ \log p _ { \theta } ( \mathbf { x } | \mathbf { z } ) + \log p _ { \theta } ( \mathbf { y } | \mathbf { z } ) \right] . } \end{array}
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
VCCA maximizes this variational lower bound on the data likelihood on the training set:
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\operatorname* { m a x } _ { \pmb { \theta } , \phi } \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \mathcal { L } ( \mathbf { x } _ { i } , \mathbf { y } _ { i } ; \pmb { \theta } , \phi ) .
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
The first term in (4) measures the KL divergence between the approximate posterior distribution and the prior distribution of the latent variables $\mathbf { z }$ . When the parameterization $q _ { \phi } ( \mathbf { z } | \mathbf { x } )$ is chosen properly, this term can be computed exactly in closed form. As a concrete example, let the variational approximate posterior be a multivariate Gaussian with diagonal covariance. That is, for a sample pair $\left( \mathbf { x } _ { i } , \mathbf { y } _ { i } \right)$ , we have
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\log q _ { \phi } ( \mathbf { z } _ { i } | \mathbf { x } _ { i } ) = \log \mathcal { N } ( \mathbf { z } _ { i } ; \pmb { \mu } _ { i } , \pmb { \Sigma } _ { i } ) , \qquad \quad \pmb { \Sigma } _ { i } = \mathrm { d i a g } \left( \sigma _ { i 1 } ^ { 2 } , \dots , \sigma _ { i d _ { z } } ^ { 2 } \right) ,
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where the mean $\pmb { \mu } _ { i }$ and covariance $\Sigma _ { i }$ are outputs of an encoding DNN f (and thus $[ \pmb { \mu } _ { i } , \pmb { \Sigma } _ { i } ] =$ $\mathbf { f } ( \mathbf { x } _ { i } ; \boldsymbol { \phi } _ { z } )$ are deterministic nonlinear functions of $\mathbf { x } _ { i }$ ). In this case, we have
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
D _ { K L } \big ( q _ { \phi } ( \mathbf { z } _ { i } | \mathbf { x } _ { i } ) | | p ( \mathbf { z } _ { i } ) \big ) = - \frac { 1 } { 2 } \sum _ { j = 1 } ^ { d _ { z } } \left( 1 + \log \sigma _ { i j } ^ { 2 } - \sigma _ { i j } ^ { 2 } - \mu _ { i j } ^ { 2 } \right) .
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
The second term of (4) corresponds to the expected complete data likelihood under the approximate posterior distribution. Though still intractable, this term can be approximated by Monte Carlo sampling. In particular, we draw $L$ samples ${ \bf z } _ { i } ^ { ( l ) } \sim q _ { \phi } ( { \bf z } _ { i } | { \bf x } _ { i } )$ :
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\begin{array} { r } { { \bf z } _ { i } ^ { ( l ) } = \mu _ { i } + \Sigma _ { i } \epsilon ^ { ( l ) } , \qquad \mathrm { w h e r e } \quad \epsilon ^ { ( l ) } \sim \mathcal { N } ( { \bf 0 } , { \bf I } ) , \qquad \mathrm { f o r } \quad l = 1 , \dots , L , } \end{array}
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
and have
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\mathbb { E } _ { q _ { \phi } ( \mathbf { z } _ { i } | \mathbf { x } _ { i } ) } \left[ \log p _ { \theta } ( \mathbf { x } _ { i } | \mathbf { z } _ { i } ) + \log p _ { \theta } ( \mathbf { y } _ { i } | \mathbf { z } _ { i } ) \right] \approx \frac { 1 } { L } \sum _ { l = 1 } ^ { L } \log p _ { \theta } \left( \mathbf { x } _ { i } | \mathbf { z } _ { i } ^ { ( l ) } \right) + \log p _ { \theta } \left( \mathbf { y } _ { i } | \mathbf { z } _ { i } ^ { ( l ) } \right) .
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
Notice that we parameterized $q _ { \phi } ( \mathbf { z } _ { i } | \mathbf { x } _ { i } )$ above to obtain the VCCA objective; this is useful when the first view is available for downstream tasks, in which case we can directly apply $q _ { \phi } ( \mathbf { z } _ { i } | \mathbf { x } _ { i } )$ to obtain its projection (as features). One could also derive likelihood lower bounds by parameterizing the approximate posteriors $q _ { \phi } ( \mathbf { z } _ { i } | \mathbf { y } _ { i } )$ and $q _ { \phi } ( \mathbf { z } _ { i } | \mathbf { x } _ { i } , \mathbf { y } _ { i } )$ , and optimize their convex combinations for training. We give a sketch of VCCA in Figure 1 (right).
|
| 88 |
+
|
| 89 |
+

|
| 90 |
+
Figure 2: VCCA-private: variational CCA with view-specific private variables.
|
| 91 |
+
|
| 92 |
+
Connection to multi-view autoencoder (MVAE) If we use the Gaussian observation models
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\begin{array} { r } { \log p _ { \theta } ( \mathbf { x } | \mathbf { z } ) = \log \mathcal { N } ( \mathbf { g } _ { x } ( \mathbf { z } ; \theta _ { x } ) , \mathbf { I } ) , \qquad \quad \log p _ { \theta } ( \mathbf { y } | \mathbf { z } ) = \log \mathcal { N } ( \mathbf { g } _ { y } ( \mathbf { z } ; \theta _ { y } ) , \mathbf { I } ) , } \end{array}
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
we observe that $\log p _ { \pmb { \theta } } \left( \mathbf { x } _ { i } | \mathbf { z } _ { i } ^ { ( l ) } \right)$ and $\log p _ { \pmb { \theta } } \left( \mathbf { y } _ { i } | \mathbf { z } _ { i } ^ { ( l ) } \right)$ measure the reconstruction errors of each view’s inputs from samples z(l)i u sing the two DNNs $\mathbf { g } _ { x }$ and $\mathbf { g } _ { y }$ respectively. In this case, maximizing $\mathcal { L } ( \mathbf { x } , \mathbf { y } ; \pmb { \theta } , \phi )$ is equivalent to
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
\operatorname* { n i n } _ { \substack { \boldsymbol { y } , \boldsymbol { \phi } } } \quad \frac { 1 } { N } \sum _ { i = 1 } ^ { N } D _ { K L } ( q _ { \boldsymbol { \phi } } ( \mathbf { z } _ { i } | \mathbf { x } _ { i } ) | | \boldsymbol { p } ( \mathbf { z } _ { i } ) ) + \frac { 1 } { 2 N L } \sum _ { i = 1 } ^ { N } \sum _ { l = 1 } ^ { L } \Big \| \mathbf { x } _ { i } - \mathbf { g } _ { x } \left( \mathbf { z } _ { i } ^ { ( l ) } ; \boldsymbol { \theta } _ { x } \right) \Big \| ^ { 2 } + \Big \| \mathbf { y } _ { i } - \mathbf { g } _ { y } \left( \mathbf { z } _ { i } ^ { ( l ) } ; \boldsymbol { \theta } _ { y } \right) \Big \| ^ { 2 } ,
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\begin{array} { r } { \mathbf { z } _ { i } ^ { ( l ) } = \pmb { \mu } _ { i } + \pmb { \Sigma } _ { i } \pmb { \epsilon } ^ { ( l ) } , \quad \mathrm { w h e r e } \ \pmb { \epsilon } ^ { ( l ) } \sim \mathcal { N } ( \mathbf { 0 } , \mathbf { I } ) , \quad l = 1 , \dots , L . } \end{array}
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
Now, consider the case of $\Sigma _ { i } \to \mathbf { 0 }$ , for $i = 1 , \ldots , N$ , and we have $\mathbf { z } _ { i } ^ { ( l ) } \pmb { \mu } _ { i }$ which is a deterministic function of $\mathbf { x }$ (and there is no need for sampling). In the limit, the second term of (9) reduces to
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
\frac { 1 } { 2 N } \sum _ { i = 1 } ^ { N } \left\| \mathbf { x } _ { i } - \mathbf { g } _ { x } ( \mathbf { f } ( \mathbf { x } _ { i } ; \boldsymbol { \phi } _ { z } ) ; \boldsymbol { \theta } _ { x } ) \right\| ^ { 2 } + \left\| \mathbf { y } _ { i } - \mathbf { g } _ { y } ( \mathbf { f } ( \mathbf { x } _ { i } ; \boldsymbol { \phi } _ { z } ) ; \boldsymbol { \theta } _ { y } ) \right\| ^ { 2 } ,
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
which is the objective of the multi-view autoencoder (MVAE, Ngiam et al., 2011). Note, however, that $\Sigma _ { i } \ \to \ 0$ is prevented by the VCCA objective as it results in a large penalty in $D _ { K L } ( q _ { \phi } ( \mathbf { z } _ { i } | \mathbf { x } _ { i } ) | | p ( \mathbf { z } _ { i } ) )$ . Compared with the MVAE objective, in the VCCA objective we are creating $L$ different “noisy” versions of the latent representation and enforce that these versions reconstruct the original inputs well. The “noise” distribution (the variances $\Sigma _ { i }$ ) are also learned and regularized by the KL divergence $D _ { K L } ( q _ { \phi } ( { \bf z } _ { i } | { \bf x } _ { i } ) | | p ( { \bf z } _ { i } ) )$ . Using the VCCA objective, we expect to learn different representations from those of MVAE, due to these regularization effects.
|
| 115 |
+
|
| 116 |
+
# 2.1 EXTRACTING PRIVATE VARIABLES
|
| 117 |
+
|
| 118 |
+
So far, VCCA aims at extracting only the latent variables $\mathbf { z }$ that are common to both views. A potential disadvantage of this model is that it assumes the common variables are sufficient by themselves to generate the views, which can be too restrictive in practice. Consider the example of audio and articulatory measurements as two views for speech. Although the transcription is a common variable behind the views, it combines with the physical environment and the vocal tract anatomy to generate the individual views. In other words, there might be large variations in the input space that can not be explained by the common variables, making the objective (4) hard to optimize. It may then be beneficial to explicitly model the private variables within each view.
|
| 119 |
+
|
| 120 |
+
We therefore propose a new probabilistic graphical model, shown in Figure 2, that we refer to as VCCA-private. We introduce two sets of hidden variables $\mathbf { h } _ { x } \in \mathbb { R } ^ { d _ { h _ { x } } }$ and $\mathbf { h } _ { y } \in \mathbb { R } ^ { d _ { h _ { y } } }$ to explain the aspects of $\mathbf { x }$ and $\mathbf { y }$ not captured by the common variables $\mathbf { z }$ . Under this model, the data likelihood
|
| 121 |
+
|
| 122 |
+
is defined by
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
\begin{array} { l } { p _ { \theta } ( \mathbf { x } , \mathbf { y } , \mathbf { z } , \mathbf { h } _ { x } , \mathbf { h } _ { y } ) = p ( \mathbf { z } ) p ( \mathbf { h } _ { x } ) p ( \mathbf { h } _ { y } ) p _ { \theta } ( \mathbf { x } | \mathbf { z } , \mathbf { h } _ { x } ; \theta _ { x } ) p _ { \theta } ( \mathbf { y } | \mathbf { z } , \mathbf { h } _ { y } ; \theta _ { y } ) , } \\ { p _ { \theta } ( \mathbf { x } , \mathbf { y } ) = \displaystyle \int \int \int p _ { \theta } ( \mathbf { x } , \mathbf { y } , \mathbf { z } , \mathbf { h } _ { x } , \mathbf { h } _ { y } ) d \mathbf { z } d \mathbf { h } _ { x } d \mathbf { h } _ { y } . } \end{array}
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
To obtain tractable inference, we introduce the following factored variational posterior
|
| 129 |
+
|
| 130 |
+
$$
|
| 131 |
+
\begin{array} { r } { q _ { \phi } ( \mathbf { z } , \mathbf { h } _ { x } , \mathbf { h } _ { y } | \mathbf { x } , \mathbf { y } ) = q _ { \phi } ( \mathbf { z } | \mathbf { x } ; \phi _ { z } ) q _ { \phi } ( \mathbf { h } _ { x } | \mathbf { x } ; \phi _ { x } ) q _ { \phi } ( \mathbf { h } _ { y } | \mathbf { y } ; \phi _ { y } ) , } \end{array}
|
| 132 |
+
$$
|
| 133 |
+
|
| 134 |
+
where each factor is parameterized by a different DNN. Similarly to VCCA, we can derive a variational lower bound on the data likelihood for VCCA-private as
|
| 135 |
+
|
| 136 |
+
$$
|
| 137 |
+
\begin{array} { r l } & { \quad \log p _ { \theta } ( \mathbf { x } , \mathbf { y } ) } \\ & { \geq \iint \int d \varphi ( \mathbf { z } , \mathbf { h } _ { x } , \mathbf { h } _ { y } | \mathbf { x } , \mathbf { y } ) \log \frac { p _ { \theta } ( \mathbf { x } , \mathbf { y } , \mathbf { z } , \mathbf { h } _ { x } , \mathbf { h } _ { y } ) } { q _ { \phi } ( \mathbf { z } , \mathbf { h } _ { x } , \mathbf { h } _ { y } | \mathbf { x } , \mathbf { y } ) } d \mathbf { z } d \mathbf { h } _ { x } d \mathbf { h } _ { y } } \\ & { = \iint \int d \varphi ( \mathbf { z } , \mathbf { h } _ { x } , \mathbf { h } _ { y } | \mathbf { x } , \mathbf { y } ) \left[ \log \frac { p ( \mathbf { z } ) } { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } + \log \frac { p ( \mathbf { h } _ { x } ) } { q _ { \phi } ( \mathbf { h } _ { x } | \mathbf { x } ) } + \log \frac { p ( \mathbf { h } _ { y } ) } { q _ { \phi } ( \mathbf { h } _ { y } | \mathbf { y } ) } \right. } \\ & { \qquad \left. + \log p _ { \theta } ( \mathbf { z } | \mathbf { z } , \mathbf { h } _ { x } ) + \log p _ { \theta } ( \mathbf { z } | \mathbf { z } , \mathbf { h } _ { y } ) \right] d \mathbf { z } d \mathbf { h } _ { x } d \mathbf { h } _ { y } } \\ & { = - D _ { K L } ( q _ { \phi } ( \mathbf { z } | \mathbf { x } ) | | p ( \mathbf { z } ) ) - D _ { K L } ( q _ { \phi } ( \mathbf { h } _ { x } | \mathbf { x } ) | | p ( \mathbf { h } _ { x } ) ) - D _ { K L } ( q _ { \phi } ( \mathbf { h } _ { y } | \mathbf { y } ) | | p ( \mathbf { h } _ { y } ) ) } \\ & \quad + \int \int q _ { \phi } ( \mathbf { z } | \mathbf { x } ) q _ { \phi } ( \mathbf { h } _ { x } | \mathbf { x } ) \log p _ { \theta } ( \mathbf { x } | \mathbf { z } , \mathbf { h } _ { x } ) d \mathbf { z } d \mathbf { h } _ { x } + \iint q _ { \phi } ( \mathbf { z } | \mathbf { x } ) q _ { \phi } ( \mathbf { h } _ { y } | \mathbf { y } ) \log p _ { \theta } ( \mathbf { y } | \mathbf { z } , \mathbf { h } _ { y } ) d \end{array}
|
| 138 |
+
$$
|
| 139 |
+
|
| 140 |
+
As in VCCA, the last two terms of (14) can be approximated by Monte Carlo sampling. For example, we draw samples of $\mathbf { z }$ and $\mathbf { h } _ { x }$ from their corresponding approximate posteriors, and concatenate their samples as inputs to the DNN parameterizing $p _ { \pmb { \theta } } ( \mathbf { x } | \mathbf { z } , \mathbf { h } _ { x } )$ . In this paper, we use simple Gaussian prior distributions for the private variables, i.e., $\mathbf { h } _ { x } \sim \mathcal { N } ( \mathbf { 0 } , \mathbf { I } )$ and $\mathbf { h } _ { y } \sim \mathcal { N } ( \mathbf { 0 } , \mathbf { I } )$ . We leave to future work to examine the effect of more sophisticated prior distributions for the latent variables.
|
| 141 |
+
|
| 142 |
+
VCCA-private maximizes this lower bound on the training set, i.e.,
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
\operatorname* { m a x } _ { \theta , \phi } \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \mathcal { L } _ { \mathrm { p r i v a t e } } ( \mathbf { x } _ { i } , \mathbf { y } _ { i } ; \mathbf { \boldsymbol { \theta } } , \phi ) .
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
Optimization The objectives (5) and (14) decouple over the training samples and can be trained efficiently using stochastic gradient descent. Enabled by the reparameterization trick, unbiased gradient estimates are obtained by Monte Carlo sampling and the standard backpropagation procedure on minibatches of training samples. We apply the ADAM algorithm (Kingma and Ba, 2015) for optimizing our objectives.
|
| 149 |
+
|
| 150 |
+
# 3 RELATED WORK
|
| 151 |
+
|
| 152 |
+
Recently, there has been much interest in unsupervised deep generative models (Kingma and Welling, 2014; Rezende et al., 2014; Goodfellow et al., 2014; Gregor et al., 2015; Makhzani et al., 2016; Burda et al., 2016; Alain et al., 2016). A common motivation behind these models is that, with the expressive power of DNNs, the generative models can capture distributions for complex inputs. Additionally, if we are able to generate realistic samples from the learned distribution, we can infer that we have discovered the underlying structure of the data, which may allow us to reduce the sample complexity for learning for downstream tasks. These previous models have mostly focused on single-view data. Here we focus on the multi-view setting where multiple views of the data are present for feature extraction but only one view is available at test time (in downstream tasks).
|
| 153 |
+
|
| 154 |
+
Some recent work has explored deep generative models for (semi-)supervised learning. Kingma et al. (2014) built a generative model based on variational autoencoders (VAEs) for semi-supervised classification, where the authors model the input distribution with two set of latent variables: the class label (if it is missing) and another set that models the intra-class variabilities (styles). Sohn et al. (2015) proposed a conditional generative model for structured output prediction, where the authors explicitly model the uncertainty in the input/output using Gaussian latent variables. While there are two set of observations (input and output labels) in these work, their graphical models are different from that of VCCA.
|
| 155 |
+
|
| 156 |
+
Our work is also related to the deep multi-view probabilistic models based on restricted Boltzmann machines (Srivastava and Salakhutdinov, 2014; Sohn et al., 2014). We note that these are undirected graphical models for which both inference and learning are difficult, and one typically resorts to carefully designed variational approximation and Gibbs sampling procedures for training such models. In contrast, our models only require sampling from simple, standard distributions (such as Gaussians), and all parameters can be learned end-to-end by standard stochastic gradient methods. Therefore, our models are more scalable than the previous multi-view probabilistic models.
|
| 157 |
+
|
| 158 |
+
On the other hand, there is a rich literature in modeling multi-view data using the same or similar graphical models behind VCCA/VCCA-private (Wang, 2007; Jia et al., 2010; Salzmann et al., 2010; Virtanen et al., 2011; Memisevic et al., 2012; Klami et al., 2013). Our methods differ from previous work in parameterizing the probability distributions using DNNs. This makes the model more powerful, while still having tractable objectives and efficient end-to-end training using the local reparameterization technique. We note that, unlike earlier work on probabilistic models of linear CCA (Bach and Jordan, 2005), VCCA does not optimize the same criterion, nor produce the same solution, as any linear or nonlinear CCA. However, we retain the terminology in order to clarify the connection with earlier work on probabilistic models for CCA, which we are extending with DNN models for the observations and for the variational posterior distribution approximation.
|
| 159 |
+
|
| 160 |
+
# 4 EXPERIMENTAL RESULTS
|
| 161 |
+
|
| 162 |
+
In this section, we compare different multi-view representation learning algorithms on three tasks involving several domains: image-image, speech-articulation, and image-text. The algorithms we choose to compare below are closely related to the proposed model or have been shown to have strong empirical performance under similar settings.
|
| 163 |
+
|
| 164 |
+
• Linear CCA: its probabilistic interpretation motivates this work.
|
| 165 |
+
• Deep CCA (DCCA) (Andrew et al., 2013): see its objective in (1).
|
| 166 |
+
• Deep canonically correlated autoencoders (DCCAE) (Wang et al., 2015b): combination of the DCCA objective and the reconstruction errors of each view.
|
| 167 |
+
• Multi-view autoencoder (MVAE) (Ngiam et al., 2011): see its objective in (10).
|
| 168 |
+
• Multi-view contrastive loss (Hermann and Blunsom, 2014): based on the intuition that the distance between embeddings of paired examples $\mathbf { x } ^ { + }$ and $\mathbf { y } ^ { + }$ should be smaller than the distance between embeddings of $\mathbf { x } ^ { + }$ and an unmatched negative example $\mathbf { y } ^ { - }$ by a margin: $\operatorname* { m i n } _ { f , g } \ \mathcal { L } _ { c o n t r a s t } : = \frac { 1 } { N } \sum _ { i } ^ { N } \operatorname* { m a x } \left( 0 , \ m + d i s \left( f ( \mathbf { x } _ { i } ^ { + } ) , g ( \mathbf { y } _ { i } ^ { + } ) \right) - d i s \left( f ( \mathbf { x } _ { i } ^ { + } ) , g ( \mathbf { y } _ { i } ^ { - } ) \right) \right) ,$ where $\mathbf { y } _ { i } ^ { - }$ is a randomly sampled view 2 example, and $m$ is a margin hyperparameter. We use the
|
| 169 |
+
|
| 170 |
+
cosine distance $\begin{array} { r } { d i s \left( \mathbf { a } , \mathbf { b } \right) = 1 - \left. \frac { \mathbf { a } } { \| \mathbf { a } \| } , \ \frac { \mathbf { b } } { \| \mathbf { b } \| } \right. } \end{array}$ .
|
| 171 |
+
|
| 172 |
+
# 4.1 NOISY MNIST DATASET
|
| 173 |
+
|
| 174 |
+
We first demonstrate our algorithms on the noisy MNIST dataset used by Wang et al. (2015b). The dataset is generated using the MNIST dataset (LeCun et al., 1998), which consists of $2 8 \times 2 8$ grayscale digit images, with $6 0 K / 1 0 K$ images for training/testing. We first linearly rescale the pixel values to the range $[ 0 , 1 ]$ . Then, we randomly rotate the images at angles uniformly sampled from $[ - \pi / 4 , \pi / 4 ]$ and the resulting images are used as view 1 inputs. For each view 1 image, we randomly select an image of the same identity (0-9) from the original dataset, add independent random noise uniformly sampled from [0, 1] to each pixel, and truncate the pixel final values to [0, 1] to obtain the corresponding view 2 sample. Selection of input images are given in Figure 3 (left). The original training set is further split into training/tuning sets of size $5 0 K / 1 0 K$ . The data generation process ensures that the digit identity is the only common variable underlying both views.
|
| 175 |
+
|
| 176 |
+

|
| 177 |
+
Figure 3: Left: Selection of view 1 images (top) and their corresponding view 2 images (bottom) from noisy MNIST. Right: 2D t-SNE visualization of features learned by previous multi-view models.
|
| 178 |
+
|
| 179 |
+
To evaluate the amount of class information extracted by different methods, after unsupervised learning of latent representations, we reveal the labels and train a linear SVM on the projected view 1 training data (using the one-versus-all scheme), and use it to classify the projected test set. This experiment simulates the typical usage of multi-view learning methods, which is to extract useful representations for downstream discriminative tasks.
|
| 180 |
+
|
| 181 |
+
Note that this synthetic dataset perfectly satisfies the multi-view assumption that the two views are independent given the class label, so the latent representation should contain precisely the class information. This is indeed achieved by CCA-based and contrastive loss-based multi-view approaches. In Figure 3 (right), we show 2D t-SNE (van der Maaten and Hinton, 2008) visualizations of the original view 1 inputs and view 1 projections by various deep multi-view methods.
|
| 182 |
+
|
| 183 |
+
We use DNNs with 3 hidden layers of 1024 rectified linear units (ReLUs, Nair and Hinton, 2010) each to parameterize the distributions: $q _ { \phi } ( \mathbf { z } | \mathbf { x } )$ , $p _ { \pmb { \theta } } ( \mathbf { x } | \mathbf { z } )$ , $p _ { \pmb { \theta } } ( \mathbf { y } | \mathbf { z } )$ in VCCA, and additionally $q _ { \phi } ( \mathbf { h } _ { x } | \mathbf { x } )$ and $q _ { \phi } ( \mathbf { h } _ { y } | \mathbf { y } )$ in VCCA-private. The capacities of these networks are the same as those of their counterparts in DCCA and DCCAE from Wang et al. (2015b). The reconstruction networks $p _ { \pmb { \theta } } ( \mathbf { x } | \mathbf { z } )$ or $p _ { \pmb { \theta } } ( \mathbf { x } | \mathbf { z } , \mathbf { h } _ { x } )$ model each pixel of $\mathbf { x }$ as an independent Bernoulli variable and parameterize its mean (using a sigmoid activation); $p _ { \pmb { \theta } } ( \mathbf { y } | \mathbf { z } )$ and $p _ { \pmb { \theta } } ( \mathbf { y } | \mathbf { z } , \mathbf { h } _ { y } )$ model $\mathbf { y }$ with diagonal Gaussians and parameterize the mean (using a sigmoid activation) and standard deviation for each pixel dimension. We tune the dimensionality $d _ { z }$ over $\{ 1 0 , 2 0 , 3 0 , 4 0 , 5 0 \}$ , and fix $d _ { h _ { x } } = d _ { h _ { y } } = 3 0$ for VCCA-private. We select the hyperparameter combination that yields the best SVM classification accuracy on the projected tuning set, and report the corresponding accuracy on the projected test set.
|
| 184 |
+
|
| 185 |
+
The effect of dropout We add dropout (Srivastava et al., 2014) to all intermediate layers and the input layers and find it to be very useful in our models, with most of the gain coming from dropout applied to the samples of $\mathbf { z }$ , $\mathbf { h } _ { x }$ and $\mathbf { h } _ { y }$ . This is because dropout encourages each latent dimension to reconstruct the inputs well in the absence of other dimensions, and therefore avoids learning coadapted features. Intuitively, in VCCA-private dropout also helps to prevent the degenerate situation where the pathways $\mathbf { x } \to \mathbf { h } _ { x } \to \mathbf { x }$ and $\mathbf { y } \mathbf { h } _ { y } \mathbf { y }$ achieve good reconstruction while ignoring $\mathbf { z }$ (e.g., by setting it to a constant). We use the same dropout rate for all layers and tune it over $\{ 0 , 0 . 1 , 0 . 2 , 0 . 3 , 0 . 4 \}$ .
|
| 186 |
+
|
| 187 |
+
We show the 2D t-SNE embeddings of the common variables $\mathbf { z }$ learned by VCCA and VCCA-private on test set in Figure 4. We observe that in general, VCCA/VCCA-private tend to separate the classes in the projection well; dropout significantly improves the performance of both VCCA and VCCAprivate, with the latter slightly outperforming the former. While such class separation can also be achieved by DCCA/contrastive loss as well, these methods can not naturally generate samples in the input space. On the other hand, such separation is not achieved by multi-view autoencoders.
|
| 188 |
+
|
| 189 |
+

|
| 190 |
+
Figure 4: 2D t-SNE embeddings of the extracted shared variables $\mathbf { z }$ on the test set by VCCA (top row) and VCCA-private (bottom row) for different dropout rates. $d _ { z } = 4 0$ for both algorithms.
|
| 191 |
+
|
| 192 |
+

|
| 193 |
+
Figure 5: Sample reconstruction of view 2 images from the test set by VCCA and VCCA-private.
|
| 194 |
+
|
| 195 |
+
The effect of private variables on reconstructions We show sample reconstructions (mean and standard deviation) by VCCA for the view 2 images from the test set in Figure 5 (columns 2 and 3). We observe that for each input, the mean reconstruction of $\mathbf { y } _ { i }$ by VCCA is a prototypical image of the same digit, regardless of the individual style in $\mathbf { y } _ { i }$ . This is to be expected, as $\mathbf { y } _ { i }$ contains an arbitrary image of the same digit as $\mathbf { x } _ { i }$ , and the variation in background noise in $\mathbf { y } _ { i }$ does not appear in $\mathbf { x } _ { i }$ and can not be reflected in $q _ { \phi } ( \mathbf { z } | \mathbf { x } )$ ; thus the best way for $\mathbf { p } _ { \pmb { \theta } } ( \mathbf { y } | \mathbf { z } )$ to model $\mathbf { y } _ { i }$ is to output a prototypical image of that class to achieve on average small reconstruction error. On the other hand, since $\mathbf { y } _ { i }$ contains little rotation of the digits, this variation is suppressed to a large extent in $q _ { \phi } ( \mathbf { z } | \mathbf { x } )$ (it is no longer the major variation in $\mathbf { z }$ as in the original inputs).
|
| 196 |
+
|
| 197 |
+
We show sample reconstructions by VCCA-private for the same set of view 2 images in Figure 5 (columns 4 and 5). With the help of private variables $\mathbf { h } _ { y }$ (as part of the input to $p _ { \pmb { \theta } } ( \mathbf { y } | \mathbf { z } , \mathbf { h } _ { y } ) )$ , the model does a much better job in reconstructing the styles of y. And by disentangling the private variables from the shared variables, $q _ { \phi } ( \mathbf { z } | \mathbf { x } )$ achieves even better class separation than VCCA does.
|
| 198 |
+
|
| 199 |
+
Table 1: Performance of features extracted by different methods for downstream tasks: Classification error rates of linear SVMs on MNIST, mean phone error rate (PER) over 6 folds on XRMB, and mean average precision (mAP) for unimodal retrieval on MIR-Flickr.
|
| 200 |
+
|
| 201 |
+
<table><tr><td>Method</td><td>Noisy MNIST Error rate (%,↓)</td><td>XRMB PER(%,↓)</td><td>Flickr mAP (↑)</td></tr><tr><td>Original inputs</td><td>13.1</td><td>37.6</td><td>0.480</td></tr><tr><td>CCA</td><td>19.1</td><td>29.4</td><td>0.529</td></tr><tr><td>DCCA</td><td>2.9</td><td>25.4</td><td>0.573</td></tr><tr><td>DCCAE</td><td>2.2</td><td>25.4</td><td>0.573</td></tr><tr><td>Contrastive</td><td>2.7</td><td>24.6</td><td>0.565</td></tr><tr><td>MVAE</td><td>11.7</td><td>29.4</td><td>0.477</td></tr><tr><td>VCCA</td><td>3.0</td><td>28.0</td><td>0.605</td></tr><tr><td>VCCA-private</td><td>2.4</td><td>25.2</td><td>0.609</td></tr></table>
|
| 202 |
+
|
| 203 |
+
We also note that the standard deviation of the reconstruction is low within the digit and high outside the digit, implying that $p _ { \pmb { \theta } } ( \mathbf { y } | \mathbf { z } , \mathbf { h } _ { y } )$ is able to separate the background noise from the digit image.
|
| 204 |
+
|
| 205 |
+
Disentanglement of private/shared variables In Figure 6 (in Appendix) we provide the 2D $t$ - SNE embeddings of the shared variables $\mathbf { z }$ (top row) and the private variables $\mathbf { h } _ { x }$ (bottom row) learned by VCCA-private. In the embedding of $\mathbf { h } _ { x }$ , digits with different identities but the same rotation are mapped close together, and the rotation varies smoothly from left to right, confirming that the private variables contain little class information but mainly style information.
|
| 206 |
+
|
| 207 |
+
Finally, we give the test error rates of linear SVMs applied to the features learned with different models in Table 1. VCCA-private is comparable in performance to the best previous approach (DCCAE), while having the advantage that it can also generate.
|
| 208 |
+
|
| 209 |
+
# 4.2 XRMB SPEECH-ARTICULATION DATASET
|
| 210 |
+
|
| 211 |
+
We now consider the task of learning acoustic features for speech recognition. We use data from the Wisconsin $\mathrm { X }$ -ray microbeam (XRMB) corpus (Westbury, 1994), which contains simultaneously recorded speech and articulatory measurements from 47 American English speakers. We follow the setup of Wang et al. (2015a,b) and use the learned features for speaker-independent phonetic recognition.2 The two input views are standard 39D acoustic features $\lvert 1 3 \ \mathrm { m e l }$ frequency cepstral coefficients (MFCCs) and their first and second derivatives) and 16D articulatory features (horizontal/vertical displacement of 8 pellets attached to several parts of the vocal tract), each then concatenated over a 7-frame window around each frame to incorporate context. The speakers are split into disjoint sets of 35/8/2/2 speakers for feature learning/recognizer training/tuning/testing. The 35 speakers for feature learning are fixed; the remaining 12 are used in a 6-fold experiment (recognizer training on 8 speakers, tuning on 2 speakers, and testing on the remaining 2 speakers). Each speaker has roughly $5 0 K$ frames. We remove the per-speaker mean and variance of the articulatory measurements for each training speaker, and remove the mean of the acoustic measurements for each utterance. All learned feature types are used in a “tandem” speech recognizer (Hermansky et al., 2000), i.e., they are appended to the original 39D features and used in a standard hidden Markov model (HMM)-based recognizer with Gaussian mixture observation distributions.
|
| 212 |
+
|
| 213 |
+
Each algorithm uses up to 3 ReLU hidden layers, each of 1500 units, for the projection and reconstruction mappings. For VCCA/VCCA-private, we use Gaussian observation models as the inputs are real-valued. In contrast to the MNIST experiments, we do not learn the standard deviations of each output dimension on training data, as this leads to poor downstream task performance. Instead, we use isotropic covariances for each view, and tune the standard deviations by grid search. The best model uses a smaller standard deviation (0.1) for the view 2 than for view 1 (1.0), effectively putting more emphasis on the reconstruction of articulatory measurements. Our best performing VCCA model uses $d _ { z } = 7 0$ , while the best performing VCCA-private model uses $d _ { z } = 7 0$ and $d _ { h _ { x } } = d _ { h _ { y } } = 1 0$ .
|
| 214 |
+
|
| 215 |
+
The mean phone error rates (PER) over 6 folds obtained by different algorithms are given in Table 1.
|
| 216 |
+
Our methods achieve competitive performance in comparison to previous deep multi-view methods.
|
| 217 |
+
|
| 218 |
+
# 4.3 MIR-FLICKR DATASET
|
| 219 |
+
|
| 220 |
+
Finally, we consider the task of learning cross-modality features for topic classification on the MIRFlickr database (Huiskes and Lew, 2008). The Flickr database contains 1 million images accompanied by user tags, among which 25000 images are labeled with 38 topic classes (each image may be categorized as multiple topics). We use the same image and text features as in previous work (Srivastava and Salakhutdinov, 2014; Sohn et al., 2014): the image feature is 3857 dimensional real-valued vector, composed of Pyramid Histogram of Words (PHOW) (Bosch et al., 2007), GIST (Oliva and Torralba, 2001), and MPEG-7 descriptors (Manjunath et al., 2001), while the text feature is a 2000-dimensional binary vector of frequent tags.
|
| 221 |
+
|
| 222 |
+
Following the same protocol as Sohn et al. (2014), we train multi-view representations using the unlabelled data,3 and use projected image features of the labeled data (further divided into splits of 10000/5000/10000 samples for training/tuning/testing) for training and evaluating a classifier that predicts the topic labels, corresponding to the unimodal query task in Srivastava and Salakhutdinov (2014); Sohn et al. (2014). For each algorithm, we select the model which achieves the highest mean average precision (mAP) on the validation set, and report its performance on the test set.
|
| 223 |
+
|
| 224 |
+
Each algorithm uses up to 4 ReLU hidden layers, each of 1024 units, for the projection and reconstruction mappings. For VCCA/VCCA-private, we use Gaussian observation models with isotropic covariance for image features, with standard deviation tuned by grid search, and a Bernoulli model for text features. In this experiment, we also found it helpful to tune an additional trade-off parameter for the text-view likelihood (cross-entropy); the best VCCA/VCCA-private models prefer a large trade-off parameter of the level $1 0 ^ { 4 }$ , emphasizing the reconstruction of the sparse text-view inputs. Our best performing VCCA model uses $d _ { z } = 1 0 2 4$ , while the best performing VCCA-private model uses $d _ { z } = 1 0 2 4$ and $d _ { h _ { x } } = d _ { h _ { y } } = 1 6$ .
|
| 225 |
+
|
| 226 |
+
As shown in Table 1, VCCA/VCCA-private achieve significantly higher mAPs than other methods considered here. Being much easier to train, the performance of our methods are competitive with the previous state-of-the-art mAP result of 0.607 achieved by the multi-view RBMs of Sohn et al. (2014) under the same setting.
|
| 227 |
+
|
| 228 |
+
# 5 CONCLUSIONS
|
| 229 |
+
|
| 230 |
+
We have proposed variational canonical correlation analysis (VCCA), a deep generative method for multi-view representation learning. Our method embodies a natural idea for multi-view learning: the multiple views can be generated from a small set of shared latent variables. VCCA is parameterized by DNNs and can be trained efficiently by backpropagation, and is therefore scalable. We have also shown that, by modeling the private variables that are specific to each view, the VCCA-private variant can disentangle shared/private variables and provide higher-quality reconstructions.
|
| 231 |
+
|
| 232 |
+
In the future, we will explore other prior distributions such as mixtures of Gaussians or discrete random variables, which may enforce clustering in the latent space and in turn work better for discriminative tasks. We will also explore other observation models, including replacing the autoencoder objective with that of adversarial networks (Goodfellow et al., 2014; Makhzani et al., 2016; Chen et al., 2016). Another direction is to explicitly incorporate the structure of the inputs, such as the sequence structure of speech and text and the spatial structure of images.
|
| 233 |
+
|
| 234 |
+
# ACKOWLEDGEMENTS
|
| 235 |
+
|
| 236 |
+
This research was supported by NSF grant IIS-1321015. The opinions expressed in this work are those of the authors and do not necessarily reflect the views of the funding agency. This research used GPUs donated by NVIDIA Corporation.
|
| 237 |
+
|
| 238 |
+
#
|
| 239 |
+
|
| 240 |
+
REFERENCES
|
| 241 |
+
S. Akaho. A kernel method for canonical correlation analysis. In Proceedings of the International Meeting of the Psychometric Society (IMPS2001), 2001.
|
| 242 |
+
G. Alain, Y. Bengio, L. Yao, J. Yosinski, E. Thibodeau-Laufer, S. Zhang, and P. Vincent. GSNs: Generative stochastic networks. Information and Inference, 5(2):210–249, 2016.
|
| 243 |
+
G. Andrew, R. Arora, J. Bilmes, and K. Livescu. Deep canonical correlation analysis. In Int. Conf. Machine Learning, pages 1247–1255, 2013.
|
| 244 |
+
F. R. Bach and M. I. Jordan. Kernel independent component analysis. Journal of Machine Learning Research, 3:1–48, 2002.
|
| 245 |
+
F. R. Bach and M. I. Jordan. A probabilistic interpretation of canonical correlation analysis. Technical Report 688, Dept. of Statistics, University of California, Berkeley, 2005.
|
| 246 |
+
A. Bosch, A. Zisserman, and X. Munoz. Image classification using random forests and ferns. In 2007 IEEE 11th International Conference on Computer Vision, pages 1–8. IEEE, 2007.
|
| 247 |
+
Y. Burda, R. Grosse, and R. Salakhutdinov. Importance weighted autoencoders. 2016.
|
| 248 |
+
X. Chen, Y. Duan, R. Houthooft, J. Schulman, I. Sutskever, and P. Abbeel. InfoGAN: Interpretable representation learning by information maximizing generative adversarial nets. arXiv:1606.03657 [cs.LG], 2016.
|
| 249 |
+
I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial nets. pages 2672–2680, 2014.
|
| 250 |
+
K. Gregor, I. Danihelka, A. Graves, D. J. Rezende, and D. Wierstra. DRAW: A recurrent neural network for image generation. In Int. Conf. Machine Learning, pages 1462–1471, 2015.
|
| 251 |
+
K. M. Hermann and P. Blunsom. Multilingual distributed representations without word alignment. In Int. Conf. Learning Representations, 2014. arXiv:1312.6173 [cs.CL].
|
| 252 |
+
H. Hermansky, D. P. W. Ellis, and S. Sharma. Tandem connectionist feature extraction for conventional HMM systems. In IEEE Int. Conf. Acoustics, Speech and Sig. Proc., pages 1635–1638, 2000.
|
| 253 |
+
H. Hotelling. Relations between two sets of variates. Biometrika, 28(3/4):321–377, 1936.
|
| 254 |
+
M. J. Huiskes and M. S. Lew. The mir flickr retrieval evaluation. In Proceedings of the 1st ACM International Conference on Multimedia Information Retrieval, pages 39–43, 2008. doi: 10.1145/ 1460096.1460104. URL http://doi.acm.org/10.1145/1460096.1460104.
|
| 255 |
+
Y. Jia, M. Salzmann, and T. Darrell. Factorized latent spaces with structured sparsity. pages 982– 990, 2010.
|
| 256 |
+
D. Kingma and J. Ba. ADAM: A method for stochastic optimization. In Int. Conf. Learning Representations, 2015.
|
| 257 |
+
D. P. Kingma and M. Welling. Auto-encoding variational Bayes. arXiv:1312.6114 [stat.ML], 2014.
|
| 258 |
+
D. P. Kingma, S. Mohamed, D. J. Rezende, and M. Welling. Semi-supervised learning with deep generative models. pages 3581–3589, 2014.
|
| 259 |
+
A. Klami, S. Virtanen, and S. Kaski. Bayesian canonical correlation analysis. Journal of Machine Learning Research, pages 965–1003, 2013.
|
| 260 |
+
P. L. Lai and C. Fyfe. Kernel and nonlinear canonical correlation analysis. Int. J. Neural Syst., 10 (5):365–377, 2000.
|
| 261 |
+
Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proc. IEEE, 86(11):2278–2324, 1998.
|
| 262 |
+
A. Lu, W. Wang, M. Bansal, K. Gimpel, and K. Livescu. Deep multilingual correlation for improved word embeddings. In The 2015 Conference of the North American Chapter of the Association for Computational Linguistics - Human Language Technologies (NAACL-HLT 2015), 2015.
|
| 263 |
+
A. Makhzani, J. Shlens, N. Jaitly, and I. Goodfellow. Adversarial autoencoders. In Int. Conf. Learning Representations, 2016.
|
| 264 |
+
B. S. Manjunath, J.-R. Ohm, V. V. Vasudevan, and A. Yamada. Color and texture descriptors. IEEE Transactions on circuits and systems for video technology, 11(6):703–715, 2001.
|
| 265 |
+
T. Melzer, M. Reiter, and H. Bischof. Nonlinear feature extraction using generalized canonical correlation analysis. In Int. Conf. Artificial Neural Networks, pages 353–360, 2001.
|
| 266 |
+
R. Memisevic, L. Sigal, and D. J. Fleet. Shared kernel information embedding for discriminative inference. IEEE Trans. Pattern Analysis and Machine Intelligence, 34(4):778–790, 2012.
|
| 267 |
+
V. Nair and G. E. Hinton. Rectified linear units improve restricted Boltzmann machines. In Int. Conf. Machine Learning, pages 807–814, 2010.
|
| 268 |
+
J. Ngiam, A. Khosla, M. Kim, J. Nam, H. Lee, and A. Ng. Multimodal deep learning. In Int. Conf. Machine Learning, pages 689–696, 2011.
|
| 269 |
+
A. Oliva and A. Torralba. Modeling the shape of the scene: A holistic representation of the spatial envelope. International journal of computer vision, 42(3):145–175, 2001.
|
| 270 |
+
D. Povey, A. Ghoshal, G. Boulianne, L. Burget, O. Glembek, N. Goel, M. Hannemann, P. Motlicek, Y. Qian, P. Schwarz, J. Silovsky, G. Stemmer, and K. Vesely. The Kaldi speech recognition toolkit. In IEEE Workshop on Automatic Speech Recognition and Understanding, 2011.
|
| 271 |
+
D. J. Rezende, S. Mohamed, and D. Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In Int. Conf. Machine Learning, pages 1278–1286, 2014.
|
| 272 |
+
M. Salzmann, C. H. Ek, R. Urtasun, and T. Darrell. Factorized orthogonal latent spaces. In Int. Workshop on Artificial Intelligence and Statistics, pages 701–708, 2010.
|
| 273 |
+
K. Sohn, W. Shang, and H. Lee. Improved multimodal deep learning with variation of information. pages 2141–2149, 2014.
|
| 274 |
+
K. Sohn, H. Lee, and X. Yan. Learning structured output representation using deep conditional generative models. pages 3465–3473, 2015.
|
| 275 |
+
N. Srivastava and R. Salakhutdinov. Multimodal learning with deep boltzmann machines. Journal of Machine Learning Research, 15:2949–2980, 2014.
|
| 276 |
+
N. Srivastava, G. E. Hinton, A. Krizhevsky, I. Sutskever, and R. R. Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15:1929–1958, 2014.
|
| 277 |
+
L. J. P. van der Maaten and G. E. Hinton. Visualizing data using $t$ -SNE. Journal of Machine Learning Research, 9:2579–2605, 2008.
|
| 278 |
+
S. Virtanen, A. Klami, and S. Kaski. Bayesian CCA via group sparsity. In Int. Conf. Machine Learning, pages 457–464, 2011.
|
| 279 |
+
C. Wang. Variational Bayesian approach to canonical correlation analysis. IEEE Trans. Neural Networks, 18(3):905–910, 2007.
|
| 280 |
+
W. Wang and K. Livescu. Large-scale approximate kernel canonical correlation analysis. In Int. Conf. Learning Representations, 2016. arXiv:1511.04773 [cs.LG].
|
| 281 |
+
W. Wang, R. Arora, K. Livescu, and J. Bilmes. Unsupervised learning of acoustic features via deep canonical correlation analysis. In IEEE Int. Conf. Acoustics, Speech and Sig. Proc., 2015a.
|
| 282 |
+
W. Wang, R. Arora, K. Livescu, and J. Bilmes. On deep multi-view representation learning. In Int. Conf. Machine Learning, pages 1083–1092, 2015b.
|
| 283 |
+
|
| 284 |
+
J. R. Westbury. X-Ray Microbeam Speech Production Database User’s Handbook Version 1.0, 1994. F. Yan and K. Mikolajczyk. Deep correlation for matching images and text. In IEEE Computer Society Conf. Computer Vision and Pattern Recognition, pages 3441–3450, 2015. S. J. Young, D. Kernshaw, J. Odell, D. Ollason, V. Valtchev, and P. Woodland. The HTK book version 2.2. Technical report, Entropic, Ltd., 1999.
|
| 285 |
+
|
| 286 |
+
# A ADDITIONAL T-SNE VISUALIZATION OF NOISY MNIST
|
| 287 |
+
|
| 288 |
+

|
| 289 |
+
Figure 6: 2D $t$ -SNE embedding of the shared variables $\mathbf { z } \in \mathbb { R } ^ { 4 0 }$ (top) and private variables $\mathbf { h } _ { x } \in \mathbb { R } ^ { 3 0 }$ (bottom).
|
md/train/H1goBoR9F7/H1goBoR9F7.md
ADDED
|
@@ -0,0 +1,421 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DYNAMIC SPARSE GRAPH FOR EFFICIENT DEEP LEARNING
|
| 2 |
+
|
| 3 |
+
Liu $\mathbf { L i u ^ { 1 2 * } }$ , Lei Deng2∗, Xing $\mathbf { H } \mathbf { u } ^ { 2 }$ , Maohua $\mathbf { Z } \mathbf { h } \mathbf { u } ^ { 2 }$ , Guoqi $\mathbf { L i ^ { 3 } }$ , Yufei $\mathbf { D i n g ^ { 2 } }$ , Yuan Xie1
|
| 4 |
+
1Department of Electrical and Computer Engineering, University of California, Santa Barbara
|
| 5 |
+
2Department of Computer Science, University of California, Santa Barbara
|
| 6 |
+
3Center for Brain Inspired Computing Research,
|
| 7 |
+
Department of Precision Instrument, Tsinghua University
|
| 8 |
+
∗Equal contribution
|
| 9 |
+
{liu liu, leideng, huxing, maohua, yuanxie}@ece.ucsb.edu
|
| 10 |
+
yufeiding@cs.ucsb.edu
|
| 11 |
+
liguoqi@mail.tsinghua.edu.cn
|
| 12 |
+
|
| 13 |
+
# ABSTRACT
|
| 14 |
+
|
| 15 |
+
We propose to execute deep neural networks (DNNs) with dynamic and sparse graph (DSG) structure for compressive memory and accelerative execution during both training and inference. The great success of DNNs motivates the pursuing of lightweight models for the deployment onto embedded devices. However, most of the previous studies optimize for inference while neglect training or even complicate it. Training is far more intractable, since (i) the neurons dominate the memory cost rather than the weights in inference; (ii) the dynamic activation makes previous sparse acceleration via one-off optimization on fixed weight invalid; (iii) batch normalization (BN) is critical for maintaining accuracy while its activation reorganization damages the sparsity. To address these issues, DSG activates only a small amount of neurons with high selectivity at each iteration via a dimensionreduction search and obtains the BN compatibility via a double-mask selection. Experiments show significant memory saving (1.7-4.5x) and operation reduction (2.3-4.4x) with little accuracy loss on various benchmarks.
|
| 16 |
+
|
| 17 |
+
# 1 INTRODUCTION
|
| 18 |
+
|
| 19 |
+
Deep Neural Networks (DNNs) (LeCun et al., 2015) have been achieving impressive progress in a wide spectrum of domains (Simonyan & Zisserman, 2014; He et al., 2016; Abdel-Hamid et al., 2014; Redmon & Farhadi, 2016; Wu et al., 2016), while the models are extremely memory- and compute-intensive. The high representational and computational costs motivate many researchers to investigate approaches on improving the execution performance, including matrix or tensor decomposition (Xue et al., 2014; Novikov et al., 2015; Garipov et al., 2016; Yang et al., 2017; Alvarez & Salzmann, 2017), data quantization (Courbariaux et al., 2016; Zhou et al., 2016; Deng et al., 2018; Leng et al., 2017; Wen et al., 2017; Wu et al., 2018; McKinstry et al., 2018), and network pruning (Ardakani et al., 2016; Han et al., 2015b;a; Liu et al., 2017; Li et al., 2016; He et al., 2017; Luo et al., 2017; Wen et al., 2016; Molchanov et al., 2016; Sun et al., 2017; Spring & Shrivastava, 2017; Lin et al., 2017a; Zhang et al., 2018; He et al., 2018a; Chin et al., 2018; Ye et al., 2018; Luo & Wu, 2018; Hu et al., 2018; He et al., 2018b). However, most of the previous work aim at inference while the challenges for reducing the representational and computational costs of training are not well-studied. Although some works demonstrate acceleration in the distributed training (Lin et al., 2017b; Goyal et al., 2017; You et al., 2017), we target at the single-node optimization, and our method can also boost training in a distributed fashion.
|
| 20 |
+
|
| 21 |
+
DNN training, which demands much more hardware resources in terms of both memory capacity and computation volume, is far more challenging than inference. Firstly, activation data in training will be stored for backpropagation, significantly increasing the memory consumption. Secondly, training iteratively updates model parameters using mini-batched stochastic gradient descent. We almost always expect larger mini-batches for higher throughput (Figure 1(a)), faster convergence, and better accuracy (Smith et al., 2017). However, memory capacity is often the limitation factor (Figure 1(b))
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: Comprehensive motivation illustration. (a) Using larger mini-batch size helps improve throughput until it is compute-bound; (b) Limited memory capacity on a single computing node prohibits the use of large mini-batch size; (c) Neuronal activation dominates the representational cost when mini-batch size becomes large; (d) BN is indispensable for maintaining accuracy; (e) Upper and lower one are the feature maps before and after BN, respectively. However, using BN damages the sparsity through information fusion; (f) There exists such great representational redundancy that more than $80 \%$ of activations are close to zero.
|
| 25 |
+
|
| 26 |
+
that may cause performance degradation or even make large models with deep structures or targeting high-resolution vision tasks hard to train (He et al., 2016; Wu & He, 2018).
|
| 27 |
+
|
| 28 |
+
It is difficult to apply existing sparsity techniques towards inference phase to training phase because of the following reasons: 1) Prior arts mainly compress the pre-trained and fixed weight parameters to reduce the off-chip memory access in inference (Han et al., 2016; 2017), while instead, the dynamic neuronal activations turn out to be the crucial bottleneck in training (Jain et al., 2018), making the prior inference-oriented methods inefficient. Besides, during training we need to stash a vast batched activation space for the backward gradient calculation. Therefore, neuron activations creates a new memory bottleneck (Figure 1(c)). In this paper, we will sparsify the neuron activations for training compression. 2) The existing inference accelerations usually add extra optimization problems onto the critical path (Wen et al., 2016; Molchanov et al., 2016; Liu et al., 2017; Luo et al., 2017; Liang et al., 2018; Zhang et al., 2018; Hu et al., 2018; Luo & Wu, 2018; Ye et al., 2018), i.e., ‘complicated training $\Rightarrow$ simplified inference’, which embarrassingly complicates the training phase. 3) Moreover, previous studies reveal that batch normalization (BN) is crucial for improving accuracy and robustness (Figure 1(d)) through activation fusion across different samples within one mini-batch for better representation (Morcos et al., 2018; Ioffe & Szegedy, 2015). BN almost becomes a standard training configuration; however, inference-oriented methods seldom discuss BN and treat BN parameters as scaling and shift factors in the forward pass. We further find that BN will damage the sparsity due to the activation reorganization (Figure 1(e)). Since this work targets both training and inference, the BN compatibility problem should be addressed.
|
| 29 |
+
|
| 30 |
+
From the view of information representation, the activation of each neuron reflects its selectivity to the current stimulus sample (Morcos et al., 2018), and this selectivity dataflow propagates layer by layer forming different representation levels. Fortunately, there is much representational redundancy, for example, lots of neuron activations for each stimulus sample are so small and can be removed (Figure 1(f)). Motivated by above comprehensive analysis regarding memory and compute, we propose to search critical neurons for constructing a sparse graph at every iteration. By activating only a small amount of neurons with a high selectivity, we can significantly save memory and simplify computation with tolerable accuracy degradation. Because the neuron response dynamically changes under different stimulus samples, the sparse graph is variable. The neuronaware dynamic and sparse graph (DSG) is fundamentally distinct from the static one in previous work on permanent weight pruning since we never prune the graph but activate part of them each time. Therefore, we maintain the model expressive power as much as possible. A graph selection method, dimension-reduction search, is designed for both compressible activations with elementwise unstructured sparsity and accelerative vector-matrix multiplication (VMM) with vector-wise structured sparsity. Through double-mask selection design, it is also compatible with BN. We can use the same selection pattern and extend our method to inference. In a nutshell, we propose a compressible and accelerative DSG approach supported by dimension-reduction search and doublemask selection. It can achieve $1 . 7 – 4 . 5 \mathrm { x }$ memory compression and $2 . 3 – 4 . 4 \mathrm { x }$ computation reduction with minimal accuracy loss. This work simultaneously pioneers the approach towards efficient online training and offline inference, which can benefit the deep learning in both the cloud and the edge.
|
| 31 |
+
|
| 32 |
+
# 2 APPROACH
|
| 33 |
+
|
| 34 |
+
Our method forms DSGs for different inputs, which are accelerative and compressive, as shown in Figure2(a). On the one hand, choosing a small number of critical neurons to participate in computation, DSG can reduce the computational cost by eliminating calculations of non-critical neurons. On the other hand, it can further reduce the representational cost via compression on sparsified activations. Different from previous methods using permanent pruning, our approach does not prune any neuron and the associated weights; instead, it activates a sparse graph according to the input sample at each iteration. Therefore, DSG does not compromise the expressive power of the model.
|
| 35 |
+
|
| 36 |
+

|
| 37 |
+
Figure 2: (a) Illustration of dynamic and sparse graph (DSG); (b) Dimension-reduction search for construction of DSG; (c) Double-mask selection for BN compatibility. ‘DRS’ denotes dimensionreduction search.
|
| 38 |
+
|
| 39 |
+
Constructing DSG needs to determine which neurons are critical. A naive approach is to select critical neurons according to the output activations. If the output neurons have a small or negative activation value, i.e., not selective to current input sample, they can be removed for saving representational cost. Because these activations will be small or absolute zero after the following ReLU non-linear function (i.e., $\mathrm { R e L U } ( x ) = \operatorname* { m a x } ( 0 , x ) )$ , it’s reasonable to set all of them to be zero. However, this naive approach requires computations of all VMM operations within each layer before the selection of critical neurons, which is very costly.
|
| 40 |
+
|
| 41 |
+
# 2.1 DIMENSION-REDUCTION SEARCH
|
| 42 |
+
|
| 43 |
+
To avoid the costly VMM operations in the mentioned naive selection, we propose an efficient method, i.e., dimension reduction search, to estimate the importance of output neurons. As shown in Figure2(b), we first reduce the dimensions of $\mathbf { X }$ and $\mathbf { W }$ , and then execute the lightweight VMM operations in a low-dimensional space with minimal cost. After that, we estimate the neuron importance according to the virtual output activations. Then, a binary selection mask can be produced in which the zeros represent the non-critical neurons with small activations that are removable. We use a top- $k$ search method that only keeps largest $k$ neurons, where an inter-sample threshold sharing mechanism is leveraged to greatly reduce the search cost 1. Note that $k$ is determined by the output size and a pre-configured sparsity parameter $\gamma$ . Then we can just compute the accurate activations of the critical neurons in the original high-dimensional space and avoid the calculation of the noncritical neurons. Thus, besides the compressive sparse activations, the dimension-reduction search can further save a significant amount of expensive operations in the high-dimensional space.
|
| 44 |
+
|
| 45 |
+

|
| 46 |
+
Figure 3: Compressive and accelerative DSG. (a) Original dense convolution; (b) Converted accelerative VMM operation; (c) Zero-value compression.
|
| 47 |
+
|
| 48 |
+
In this way, a vector-wise structured sparsity can be achieved, as shown in Figure 3(b). The ones in the selection mask (marked as colored blocks) denote the critical neurons, and the non-critical ones can bypass the memory access and computation of their corresponding columns in the weight matrix. Furthermore, the generated sparse activations can be compressed via the zero-value compression (Zhang et al., 2000; Vijaykumar et al., 2015; Rhu et al., 2018) (Figure 3(c)). Consequently, it is critical to reduce the vector dimension but keep the activations calculated in the low-dimensional space as accurate as possible, compared to the ones in the original high-dimensional space.
|
| 49 |
+
|
| 50 |
+
# 2.2 SPARSE RANDOM PROJECTION FOR EFFICIENT DIMENSION-REDUCTION SEARCH
|
| 51 |
+
|
| 52 |
+
Notations: Each CONV layer has a four dimensional weight tensor $( n _ { K } , n _ { C } , n _ { R } , n _ { S } )$ , where $n _ { K }$ is the number of filters, i.e., the number of output feature maps (FMs); $n _ { C }$ is the number of input FMs; $( n _ { R } , n _ { S } )$ represents the kernel size. Thus, the CONV layer in Figure 3(a) can be converted to many VMM operations, as shown in Figure 3(b). Each row in the matrix of input FMs is the activations from a sliding window across all input FMs $( n _ { C R S } = n _ { C } \times n _ { R } \times n _ { S } )$ , and after the VMM operation with the weight matrix $( n _ { C R S } \times n _ { K } )$ it can generate $n _ { K }$ points at the same location across all output FMs. Further considering the $n _ { P Q } = n _ { P } \times n _ { Q }$ size of each output FM and the mini-batch size of $m$ , the whole $n _ { P Q } \times m$ rows of VMM operations has a computational complexity of $O ( m \times n _ { P Q } \times$ $n _ { C R S } \times n _ { K } )$ . For the FC layer with $n _ { C }$ input neurons and $n _ { K }$ output neurons, this complexity is $O ( m \times n _ { C } \times n _ { K } )$ . Note that here we switch the order of BN and ReLU layer from ‘CONV/FCBN-ReLU’ to ‘CONV/FC-ReLU-BN’, because it’s hard to determine the activation value of the non-critical neurons if the following layer is BN (this value is zero for ReLU). As shown in previous work, this reorganization could bring better accuracy (Mishkin & Matas, 2015).
|
| 53 |
+
|
| 54 |
+
For the sake of simplicity, we just consider the operation for each sliding window in the CONV layer or the whole FC layer under one single input sample as a basic optimization problem. The generation of each output activation $y _ { j }$ requires an inner product operation, as follows:
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
y _ { j } = \varphi ( \langle \mathbf { X } _ { i } , \mathbf { W } _ { j } \rangle )
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
where $\mathbf { X } _ { i }$ is the $i$ -th row in the matrix of input FMs (for the FC layer, there is only one $\mathbf { X }$ vector), $\mathbf { W } _ { j }$ is the $j$ -th column of the weight matrix $W$ , and $\varphi ( \cdot )$ is the neuronal transformation (e.g., ReLU function, here we abandon bias). Now, according to equation (1), the preservation of the activation is equivalent to preserve the inner product.
|
| 61 |
+
|
| 62 |
+
We introduce a dimension-reduction lemma, named Johnson-Lindenstrauss Lemma (JLL) (Johnson & Lindenstrauss, 1984), to implement the dimension-reduction search with inner product preservation. This lemma states that a set of points in a high-dimensional space can be embedded into a low-dimensional space in such a way that the Euclidean distances between these points are nearly preserved. Specifically, given $0 < \epsilon < 1$ , a set of $N$ points in $\mathbb { R } ^ { d }$ (i.e., all $\mathbf { X } _ { i }$ and $\mathbf { W } _ { j }$ ), and a number of $\begin{array} { r } { k > O \bigl ( \frac { l o g ( N ) } { \epsilon ^ { 2 } } \bigr ) } \end{array}$ , there exists a linear map $f : \mathbb { R } ^ { d } \Rightarrow \mathbb { R } ^ { k }$ such that
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
( 1 - \epsilon ) \| { \mathbf { X } } _ { i } - { \mathbf { W } } _ { j } \| ^ { 2 } \leq \| { f ( { \mathbf { X } } _ { i } ) - f ( { \mathbf { W } } _ { j } ) } \| ^ { 2 } \leq ( 1 + \epsilon ) \| { \mathbf { X } } _ { i } - { \mathbf { W } } _ { j } \| ^ { 2 }
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
for any given $\mathbf { X } _ { i }$ and $\mathbf { W } _ { j }$ pair, where $\epsilon$ is a hyper-parameter to control the approximation error, i.e., larger $\epsilon \Rightarrow$ larger error. When $\epsilon$ is sufficiently small, one corollary from JLL is the following norm preservation (Vu, 2016; Kakade & Shakhnarovich, 2009):
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
P [ ( 1 - \epsilon ) \| \mathbf { Z } \| ^ { 2 } \leq \| f ( \mathbf { Z } ) \| ^ { 2 } \leq ( 1 + \epsilon ) \| \mathbf { Z } \| ^ { 2 } ] \geq 1 - O ( \epsilon ^ { 2 } )
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
where $\mathbf { Z }$ could be any $\mathbf { X } _ { i }$ or $\mathbf { W } _ { j }$ , and $P$ denotes a probability. It means the vector norm can be preserved with a high probability controlled by $\epsilon$ . Given these basics, we can further get the inner product preservation:
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
P [ | \langle f ( \mathbf { X } _ { i } ) , f ( \mathbf { W } _ { j } ) \rangle - \langle \mathbf { X } _ { i } , \mathbf { W } _ { j } \rangle | \leq \epsilon ] \geq 1 - O ( \epsilon ^ { 2 } ) .
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
The detailed proof can be found in Appendix A.
|
| 81 |
+
|
| 82 |
+
Random projection (Vu, 2016; Ailon $\&$ Chazelle, 2009; Achlioptas, 2001) is widely used to construct the linear map $f ( \cdot )$ . Specifically, the original $d$ -dimensional vector is projected to a $k$ - dimensional $( k \ll d )$ one, using a random $k \times d$ matrix $\mathbf { R }$ . Then we can reduce the dimension of all $\mathbf { X } _ { i }$ and $\mathbf { W } _ { j }$ by
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
f ( \mathbf { X } _ { i } ) = \frac { 1 } { \sqrt { k } } \mathbf { R } \mathbf { X } _ { i } \in \mathbb { R } ^ { k } , f ( \mathbf { W } _ { j } ) = \frac { 1 } { \sqrt { k } } \mathbf { R } \mathbf { W } _ { j } \in \mathbb { R } ^ { k } .
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
The random projection matrix $\mathbf { R }$ can be generated from Gaussian distribution (Ailon $\&$ Chazelle, 2009). In this paper, we adopt a simplified version, termed as sparse random projection (Achlioptas, 2001; Bingham $\&$ Mannila, 2001; Li et al., 2006) with
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
P ( \mathbf { R } _ { p q } = { \sqrt { s } } ) = { \frac { 1 } { 2 s } } ; P ( \mathbf { R } _ { p q } = 0 ) = 1 - { \frac { 1 } { s } } ; P ( \mathbf { R } _ { p q } = - { \sqrt { s } } ) = { \frac { 1 } { 2 s } }
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
for all elements in $\mathbf { R }$ . This $\mathbf { R }$ only has ternary values that can remove the multiplications during projection, and the remained additions are very sparse. Therefore, the projection overhead is negligible compared to other high-precision operations involving multiplication. Here we set $s = 3$ with $67 \%$ sparsity in statistics.
|
| 95 |
+
|
| 96 |
+

|
| 97 |
+
Figure 4: Structured selection via dynamic dimension-reduction search for producing sparse pattern of neuronal activations.
|
| 98 |
+
|
| 99 |
+
Equation (4) indicates the low-dimensional inner product $\left. f ( \mathbf { X } _ { i } ) , f ( \mathbf { W } _ { j } ) \right.$ can still approximate the original high-dimensional one $\langle \mathbf { X } _ { i } , \mathbf { W } _ { j } \rangle$ in equation (1) if the reduced dimension is sufficiently high. Therefore, it is possible to calculate equation (1) in a low-dimensional space for activation estimation, and select the important neurons. As shown in Figure 3(b), each sliding window dynamically selects its own important neurons for the calculation in high-dimensional space, marked in red and blue as two examples. Figure 4 visualizes two sliding windows in a real network to help understand the dynamic process of dimension-reduction search. Here the neuronal activation vector $\lceil n _ { K }$ length) is reshaped to a matrix for clarity. Now For the CONV layer, the computational complexity is only $O [ m \times n _ { P Q } \times n _ { K } \times ( k + ( 1 - \gamma ) \times n _ { C R S } ) ] ,$ , which is less than the original high-dimensional computation with $O ( m \times n _ { P Q } \times n _ { C R S } \times n _ { K } )$ ) complexity because we usually have $[ \ k + ( 1 - \gamma ) \times n _ { C R S } \ ] \ \ll \ n _ { C R S }$ . For the FC layer, we also have ${ \cal O } [ m \times n _ { K } \times ( k + ( 1 - \dot { \gamma } ) \times n _ { C } ) ] \ll { \cal O } ( m \times n _ { C } \times n _ { K } ) .$
|
| 100 |
+
|
| 101 |
+
# 2.3 DOUBLE-MASK SELECTION FOR BN COMPATIBILITY
|
| 102 |
+
|
| 103 |
+
To deal with the important but intractable BN layer, we propose a double-mask selection method presented in Figure 2(c). After the dimension-reduction search based importance estimation, we produce a sparsifying mask that removes the unimportant neurons. The ReLU activation function can maintain this mask by inhibiting the negative activation (actually all the activations of the CONV layer or FC layer after the selection mask are positive with reasonably large sparsity). However, the BN layer will damage this sparsity through inter-sample activation fusion. To address this issue, we copy the same selection mask before the BN layer and directly use it on the BN output. It is straightforward but reasonable because we find that although BN causes the zero activation to be non-zero (Figure 1(f)), these non-zero activations are still very small and can also be removed. This is because BN just scales and shifts the activations that won’t change the relative sort order. In this way, we can achieve fully sparse activation dataflow. The back propagated gradients will also be forcibly sparsified every time they pass a mask layer.
|
| 104 |
+
|
| 105 |
+
# 3 EXPERIMENTAL RESULTS
|
| 106 |
+
|
| 107 |
+
# 3.1 EXPERIMENT SETUP
|
| 108 |
+
|
| 109 |
+
The overall training algorithm is presented in Appendices B. Going through the dataflow where the red color denotes the sparse tensors, a widespread sparsity in both the forward and backward passes is demonstrated. The projection matrices are fixed after a random initialization at the beginning of training. We just update the projected weights in the low-dimensional space every 50 iterations to reduce the projection overhead. The detailed search method and the computational complexity of the dimension-reduction search are provided in Appendix B. Regarding the evaluation network models, we use LeNet (LeCun et al., 1998) and a multi-layered perceptron (MLP) on small-scale FASHION dataset (Xiao et al., 2017), VGG8 (Courbariaux et al., 2016; Deng et al., 2018)/ResNet8 (a customized ResNet-variant with 3 residual blocks and 2 FC layers)/ResNet20/WRN-8-2 (Zagoruyko & Komodakis, 2016) on medium-scale CIFAR10 dataset (Krizhevsky & Hinton, 2009), VGG8/WRN8-2 on another medium-scale CIFAR100 dataset (Krizhevsky & Hinton, 2009), and AlexNet (Krizhevsky et al., 2012)/VGG16 (Simonyan & Zisserman, 2014)/ResNet18, ResNet152 (He et al., 2016)/WRN-18-2 (Zagoruyko & Komodakis, 2016) on large-scale ImageNet dataset (Deng et al., 2009) as workloads. The programming framework is PyTorch and the training platform is based on NVIDIA Titan Xp GPU. We adopt the zero-value compression method (Zhang et al., 2000; Vijaykumar et al., 2015; Rhu et al., 2018) for memory compression and MKL compute library (Wang et al., 2014) on Intel Xeon CPU for acceleration evaluation.
|
| 110 |
+
|
| 111 |
+
# 3.2 ACCURACY ANALYSIS
|
| 112 |
+
|
| 113 |
+
In this section, we provide a comprehensive analysis regarding the influence of sparsity on accuracy and explore the robustness of MLP and CNN, the graph selection strategy, the BN compatibility, and the importance of width and depth.
|
| 114 |
+
|
| 115 |
+
Accuracy using DSG. Figure 5(a) presents the accuracy curves on small and medium scale models by using DSG under different sparsity levels. Three conclusions are observed: 1) The proposed DSG affects little on the accuracy when the sparsity is ${ < } 6 0 \%$ , and the accuracy will present an abrupt descent with sparsity larger than $80 \%$ . 2) Usually, the ResNet model family is more sensitive to the sparsity increasing due to fewer parameters than the VGG family. For the VGG8 on CIFAR10, the accuracy loss is still within $0 . 5 \%$ when sparsity reaches $80 \%$ . 3) Compared to MLP, CNN can tolerate more sparsity. Figure 5(b) further shows the results on large scale models on ImageNet. Because training large model is time costly, we only present several experimental points. Consistently, the VGG16 shows better robustness compared to the ResNet18, and the WRN with wider channels on each layer performs much better than the other two models. We will discuss the topic of width and depth later.
|
| 116 |
+
|
| 117 |
+
Graph Selection Strategy. To investigate the influence of graph selection strategy, we repeat the sparsity vs. accuracy experiments on CIFAR10 under different selection methods. Two baselines are used here: the oracle one that keeps the neurons with top-k activations after the whole VMM computation at each layer, and the random one that randomly selects neurons to keep. The results are shown in Figure 5(c), in which we can see that our dimension-reduction search and the oracle one perform much better than the random selection under high sparsity condition. Moreover, dimension-reduction search achieves nearly the same accuracy with the oracle top-k selection, which indicates the proposed random projection method can find an accurate activation estimation in the low-dimensional space. In detail, Figure 5(d) shows the influence of parameter $\epsilon$ that reflects the degree of dimension reduction. Lower $\epsilon$ can approach the original inner product more accurately, that brings higher accuracy but at the cost of more computation for graph selection since less dimension reduction. With $\epsilon = 0 . 5$ , the accuracy loss is within $1 \%$ even if the sparsity reaches $80 \%$ .
|
| 118 |
+
|
| 119 |
+
BN Compatibility. Figure 5(e) focuses the BN compatibility issue. Here we use dimensionreduction search for the graph sparsifying, and compare three cases: 1) removing the BN operation and using single mask; 2) keeping BN and using only single mask (the first one in Figure 2(c)); 3) keeping BN and using double masks (i.e. double-mask selection). The one without BN is very sensitive to the graph ablation, which indicates the importance of BN for training. Comparing the two with BN, the double-mask selection even achieves better accuracy since the regularization effect.
|
| 120 |
+
|
| 121 |
+

|
| 122 |
+
Figure 5: Comprehensive analysis on sparsity v.s. accuracy. (a) & (b) Accuracy using DSG; (c) Influence of the graph selection strategy; (d) Influence of the dimension-reduction degree; (e) Influence of the double-mask selection for BN compatibility; (f) Influence of the network depth and width. ‘DRS’ denotes dimension-reduction search.
|
| 123 |
+
|
| 124 |
+
This observation indicates the effectiveness of the proposed double-mask selection for simultaneously recovering the sparsity damaged by the BN layer and maintaining the accuracy.
|
| 125 |
+
|
| 126 |
+
Width or Depth. Furthermore, we investigate an interesting comparison regarding the network width and depth, as shown in Figure 5(f). On the training set, WRN with fewer but wider layers demonstrates more robustness than the deeper one with more but slimmer layers. On the validation set, the results are a little more complicated. Under small and medium sparsity, the deeper ResNet performs better $( 1 \% )$ than the wider one. While when the sparsity increases substantial $( > 7 5 \% )$ , WRN can maintain the accuracy better. This indicates that, in medium-sparse space, the deeper network has stronger representation ability because of the deep structure; however, in ultra-highsparse space, the deeper structure is more likely to collapse since the accumulation of the pruning error layer by layer. In reality, we can determine which type of model to use according to the sparsity requirement. In Figure 5(b) on ImageNet, the reason why WRN-18-2 performs much better is that it has wider layers without reducing the depth.
|
| 127 |
+
|
| 128 |
+
Convergence. DSG does not slow down the convergence speed, which can be seen from Figure 10(a)-(b) in Appendix C. This owes to the high fidelity of inner product when we use random projection to reduce the data dimension, as shown in Figure 10(c). Interestingly, Figure 11 (also in Appendix C) reveals that the selection mask for each sample also converges as training goes on, however, the selection pattern varies across samples. To save the selection patterns of all samples is memory consuming, which is the reason why we do not directly suspend the selection patterns after training but still do on-the-fly dimension-reduction search in inference.
|
| 129 |
+
|
| 130 |
+
# 3.3 REPRESENTATIONAL COST REDUCTION
|
| 131 |
+
|
| 132 |
+
This section presents the benefits from DSG on representational cost. We measure the memory consumption over five CNN benchmarks on both the training and inference phases. For data compression, we use zero-value compression algorithm (Zhang et al., 2000; Vijaykumar et al., 2015; Rhu et al., 2018). Figure 6 shows the memory optimization results, where the model name, mini-batch size, and the sparsity are provided. In training, besides the parameters, the activations across all layers should be stashed for the backward computation. Consistent with the observation mentioned above that the neuron activation beats weight to dominate memory overhead, which is different from the previous work on inference. We can reduce the overall representational cost by average $1 . 7 \mathrm { x }$ (2.72 GB), $3 . 2 \mathbf { x }$ (4.51 GB), and $4 . 2 \mathrm { x }$ (5.04 GB) under $50 \%$ , $80 \%$ and $90 \%$ sparsity, respectively. If only considering the neuronal activation, these ratios could be higher up to 7.1x. The memory overhead for the selection masks is minimal $( < 2 \% )$ .
|
| 133 |
+
|
| 134 |
+

|
| 135 |
+
Figure 6: Memory footprint comparisons for (a) training and (b) inference.
|
| 136 |
+
|
| 137 |
+
During inference, only memory space to store the parameters and the activations of the layer with maximum neuron amount is required. The benefits in inference are relatively smaller than that in training since weight is the dominant memory. On ResNet152, the extra mask overhead even offsets the compression benefit under $50 \%$ sparsity, whereas, we can still achieve up to $7 . 1 \mathrm { x }$ memory reduction for activations and $1 . 7 \mathrm { x }$ for overall memory. Although the compression is limited for inference, it still can achieve noticeable acceleration that will be shown in the next section. Moreover, reducing costs for both training and inference is our major contribution.
|
| 138 |
+
|
| 139 |
+
# 3.4 COMPUTATIONAL COST REDUCTION
|
| 140 |
+
|
| 141 |
+
We assess the results on reducing the computational cost for both training and inference. As shown in Figure 7, both the forward and backward pass consume much fewer operations, i.e., multiplyand-accumulate (MAC). On average, $1 . 4 \mathbf { x }$ (5.52 GMACs), $1 . 7 \mathrm { x }$ (9.43 GMACs), and $2 . 2 \mathbf { x }$ (10.74 GMACs) operation reduction are achieved in training under $50 \%$ , $80 \%$ and $90 \%$ sparsity, respectively. For inference with only forward pass, the results increase to $1 . 5 \mathrm { x }$ (2.26 GMACs), $2 . 8 \mathrm { x }$ (4.22 GMACs), and $3 . 9 \mathbf { X }$ (4.87 GMACs), respectively. The overhead of the dimension-reduction search in the low-dimensional space is relatively larger ( $( < 6 . 5 \%$ in training and ${ < } 1 9 . 5 \%$ in inference) compared to the mask overhead in memory cost. Note that the training demonstrates less improvement than the inference, which is because the acceleration of the backward pass is partial. The error propagation is accelerative, but the weight gradient generation is not because of the irregular sparsity that is hard to obtain practical acceleration. Although the computation of this part is also very sparse with much fewer operations 2, we do not include its GMACs reduction for practical concern.
|
| 142 |
+
|
| 143 |
+

|
| 144 |
+
Figure 7: Computational complexity comparisons for (a) training and (b) inference. ‘DRS’ denotes dimension-reduction search.
|
| 145 |
+
|
| 146 |
+
Finally, we evaluate the execution time on CPU using Intel MKL kernels (Wang et al. (2014)). As shown in Figure 8(a), we evaluate the execution time of these layers after the dimension-reduction search on VGG8. Comparing to VMM baselines, our approach can achieve 2.0x, 5.0x, and $8 . 5 \mathrm { x }$ average speedup under $50 \%$ , $80 \%$ , and $90 \%$ sparsity, respectively. When the baselines change to
|
| 147 |
+
|
| 148 |
+
GEMM (general matrix multiplication), the average speedup decreases to 0.6x, 1.6x, and $2 . 7 \mathbf { x }$ , respectively. The reason is that DSG generates dynamic vector-wise sparsity, which is not well supported by GEMM. A potential way to improve GEMM-based implementation, at workload mapping and tiling time, is reordering executions at the granularity of vector inner-product and grouping non-redundant executions to the same tile to improve local data reuse.
|
| 149 |
+
|
| 150 |
+
On the same network, we further compare our approach with smaller dense models which could be another way to reduce the computational cost. As shown in Figure 8(b), comparing with dense baseline, our approach can reduce training time with little accuracy loss. Even though the equivalent smaller dense models with the same effective nodes, i.e., reduced MACs, save more training time, the accuracy is much worse than our DSG approach. Figure 12 in Appendix D gives more results on ResNet8 and AlexNet.
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
Figure 8: On VGG8: (a) Layer-wise execution time comparison; (b) Validation accuracy v.s. training time of different models: large-sparse ones and smaller-dense ones with equivalent MACs.
|
| 154 |
+
|
| 155 |
+
# 4 RELATED WORK
|
| 156 |
+
|
| 157 |
+
DNN Compression (Ardakani et al., 2016) achieved up to $90 \%$ weight sparsity by randomly removing connections. (Han et al., 2015b;a) reduced the weight parameters by pruning the unimportant connections. The compression is mainly achieved on FC layers, which makes it ineffective for CONV layer-dominant networks, e.g., ResNet. To improve the pruning performance, Y. He et al. (He et al., 2018b) leveraged reinforcement learning to optimize the sparsity configuration across layers. However, it is difficult to obtain practical speedup due to the irregularity of the element-wise sparsity (Han et al., 2015b;a). Even if designing ASIC from scratch (Han et al., 2016; 2017), the index overhead is enormous and it only works under high sparsity. These methods usually require a pre-trained model, iterative pruning, and fine-tune retraining, that targets inference optimization.
|
| 158 |
+
|
| 159 |
+
DNN Acceleration Different from compression, the acceleration work consider more on the sparse pattern. In contrast to the fine-grain compression, coarse-grain sparsity was further proposed to optimize the execution speed. Channel-level sparsity was gained by removing unimportant weight filters (He et al., 2018a; Chin et al., 2018), training penalty coefficients (Liu et al., 2017; Ye et al., 2018; Luo & Wu, 2018), or solving optimization problem (Luo et al., 2017; He et al., 2017; Liang et al., 2018; Hu et al., 2018). Wen et al. (2016) introduced a L2-norm group-lasso optimization for both medium-grain sparsity (row/column) and coarse-grain weight sparsity (channel/filter/layer). Molchanov et al. (2016) introduced the Taylor expansion for neuron pruning. However, they just benefit the inference acceleration, and the extra solving of the optimization problem usually makes the training more complicated. Lin et al. (2017a) demonstrated predicting important neurons then bypassed the unimportant ones via low-precision pre-computation with less cost. Spring & Shrivastava (2017) leveraged the randomized hashing to predict the important neurons. However, the hashing search aims at finding neurons whose weight bases are similar to the input vector, which cannot estimate the inner product accurately thus will probably cause significant accuracy loss on large models. Sun et al. (2017) used a straightforward top- $\mathbf { \nabla } \cdot \mathbf { k }$ pruning on the back propagated errors for training acceleration. But they only simplified the backward pass and presented the results on tiny FC models. Furthermore, the BN compatibility problem that is very important for large-model training still remains untouched. Lin et al. (2017b) pruned the gradients for accelerating distributed training, but the focus is on multi-node communication rather than the single-node scenario discussed in this paper.
|
| 160 |
+
|
| 161 |
+
# 5 CONCLUSION
|
| 162 |
+
|
| 163 |
+
In this work, we propose DSG (dynamic and sparse graph) structure for efficient DNN training and inference through a dimension-reduction search based sparsity forecast for compressive memory and accelerative execution and a double-mask selection for BN compatibility without sacrificing model’s expressive power. It can be easily extended to the inference by using the same selection pattern after training. Our experiments over various benchmarks demonstrate significant memory saving (up to $4 . 5 \mathrm { x }$ for training and $1 . 7 \mathrm { x }$ for inference) and computation reduction (up to $2 . 3 \mathbf { x }$ for training and $4 . 4 \times$ for inference). Through significantly boosting both forward and backward passes in training, as well as in inference, DSG promises efficient deep learning in both the cloud and edge.
|
| 164 |
+
|
| 165 |
+
# ACKNOWLEDGMENT
|
| 166 |
+
|
| 167 |
+
This work was partially supported by the National Science Foundations(NSF) under Grant No. 1725447 and 1730309, the National Natural Science Foundation of China under Grant No. 61603209 and 61876215. Financial support from the Beijing Innovation Center for Future Chip is also gratefully acknowledged.
|
| 168 |
+
|
| 169 |
+
# REFERENCES
|
| 170 |
+
|
| 171 |
+
Ossama Abdel-Hamid, Abdel-rahman Mohamed, Hui Jiang, Li Deng, Gerald Penn, and Dong Yu. Convolutional neural networks for speech recognition. IEEE/ACM Transactions on audio, speech, and language processing, 22(10):1533–1545, 2014.
|
| 172 |
+
|
| 173 |
+
Dimitris Achlioptas. Database-friendly random projections. In Proceedings of the twentieth ACM SIGMOD-SIGACT-SIGART symposium on Principles of database systems, pp. 274–281. ACM, 2001.
|
| 174 |
+
|
| 175 |
+
Nir Ailon and Bernard Chazelle. The fast johnson–lindenstrauss transform and approximate nearest neighbors. SIAM Journal on computing, 39(1):302–322, 2009.
|
| 176 |
+
|
| 177 |
+
Jose M Alvarez and Mathieu Salzmann. Compression-aware training of deep networks. In Advances in Neural Information Processing Systems, pp. 856–867, 2017.
|
| 178 |
+
|
| 179 |
+
Arash Ardakani, Carlo Condo, and Warren J Gross. Sparsely-connected neural networks: towards efficient vlsi implementation of deep neural networks. arXiv preprint arXiv:1611.01427, 2016.
|
| 180 |
+
|
| 181 |
+
Ella Bingham and Heikki Mannila. Random projection in dimensionality reduction: applications to image and text data. In Proceedings of the seventh ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 245–250. ACM, 2001.
|
| 182 |
+
|
| 183 |
+
Ting-Wu Chin, Cha Zhang, and Diana Marculescu. Layer-compensated pruning for resourceconstrained convolutional neural networks. arXiv preprint arXiv:1810.00518, 2018.
|
| 184 |
+
|
| 185 |
+
Matthieu Courbariaux, Itay Hubara, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Binarized neural networks: Training deep neural networks with weights and activations constrained $\mathrm { t o } + 1$ or-1. arXiv preprint arXiv:1602.02830, 2016.
|
| 186 |
+
|
| 187 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In Computer Vision and Pattern Recognition, 2009. CVPR 2009. IEEE Conference on, pp. 248–255. IEEE, 2009.
|
| 188 |
+
|
| 189 |
+
Lei Deng, Peng Jiao, Jing Pei, Zhenzhi Wu, and Guoqi Li. Gxnor-net: Training deep neural networks with ternary weights and activations without full-precision memory under a unified discretization framework. Neural Networks, 100:49–58, 2018.
|
| 190 |
+
|
| 191 |
+
Timur Garipov, Dmitry Podoprikhin, Alexander Novikov, and Dmitry Vetrov. Ultimate tensorization: compressing convolutional and fc layers alike. arXiv preprint arXiv:1611.03214, 2016.
|
| 192 |
+
|
| 193 |
+
Priya Goyal, Piotr Dollar, Ross Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, An- ´ drew Tulloch, Yangqing Jia, and Kaiming He. Accurate, large minibatch sgd: training imagenet in 1 hour. arXiv preprint arXiv:1706.02677, 2017.
|
| 194 |
+
|
| 195 |
+
Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. arXiv preprint arXiv:1510.00149, 2015a.
|
| 196 |
+
|
| 197 |
+
Song Han, Jeff Pool, John Tran, and William Dally. Learning both weights and connections for efficient neural network. In Advances in neural information processing systems, pp. 1135–1143, 2015b.
|
| 198 |
+
|
| 199 |
+
Song Han, Xingyu Liu, Huizi Mao, Jing Pu, Ardavan Pedram, Mark A Horowitz, and William J Dally. Eie: efficient inference engine on compressed deep neural network. In Computer Architecture (ISCA), 2016 ACM/IEEE 43rd Annual International Symposium on, pp. 243–254. IEEE, 2016.
|
| 200 |
+
|
| 201 |
+
Song Han, Junlong Kang, Huizi Mao, Yiming Hu, Xin Li, Yubin Li, Dongliang Xie, Hong Luo, Song Yao, Yu Wang, et al. Ese: Efficient speech recognition engine with sparse lstm on fpga. In Proceedings of the 2017 ACM/SIGDA International Symposium on Field-Programmable Gate Arrays, pp. 75–84. ACM, 2017.
|
| 202 |
+
|
| 203 |
+
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.
|
| 204 |
+
|
| 205 |
+
Yang He, Guoliang Kang, Xuanyi Dong, Yanwei Fu, and Yi Yang. Soft filter pruning for accelerating deep convolutional neural networks. arXiv preprint arXiv:1808.06866, 2018a.
|
| 206 |
+
|
| 207 |
+
Yihui He, Xiangyu Zhang, and Jian Sun. Channel pruning for accelerating very deep neural networks. In International Conference on Computer Vision (ICCV), volume 2, pp. 6, 2017.
|
| 208 |
+
|
| 209 |
+
Yihui He, Ji Lin, Zhijian Liu, Hanrui Wang, Li-Jia Li, and Song Han. Amc: Automl for model compression and acceleration on mobile devices. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 784–800, 2018b.
|
| 210 |
+
|
| 211 |
+
Yiming Hu, Siyang Sun, Jianquan Li, Xingang Wang, and Qingyi Gu. A novel channel pruning method for deep neural network compression. arXiv preprint arXiv:1805.11394, 2018.
|
| 212 |
+
|
| 213 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
|
| 214 |
+
|
| 215 |
+
Animesh Jain, Amar Phanishayee, Jason Mars, Lingjia Tang, and Gennady Pekhimenko. Gist: Efficient data encoding for deep neural network training. In 2018 ACM/IEEE 45th Annual International Symposium on Computer Architecture (ISCA), pp. 776–789. IEEE, 2018.
|
| 216 |
+
|
| 217 |
+
William B Johnson and Joram Lindenstrauss. Extensions of lipschitz mappings into a hilbert space. Contemporary mathematics, 26(189-206):1, 1984.
|
| 218 |
+
|
| 219 |
+
Instructors Sham Kakade and Greg Shakhnarovich. Cmsc 35900 (spring 2009) large scale learning lecture: 2 random projections, 2009.
|
| 220 |
+
|
| 221 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. 2009.
|
| 222 |
+
|
| 223 |
+
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.
|
| 224 |
+
|
| 225 |
+
Yann LeCun, Leon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to´ document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
|
| 226 |
+
|
| 227 |
+
Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. nature, 521(7553):436, 2015.
|
| 228 |
+
|
| 229 |
+
Cong Leng, Hao Li, Shenghuo Zhu, and Rong Jin. Extremely low bit neural network: Squeeze the last bit out with admm. arXiv preprint arXiv:1707.09870, 2017.
|
| 230 |
+
|
| 231 |
+
Hao Li, Asim Kadav, Igor Durdanovic, Hanan Samet, and Hans Peter Graf. Pruning filters for efficient convnets. arXiv preprint arXiv:1608.08710, 2016.
|
| 232 |
+
|
| 233 |
+
Ping Li, Trevor J Hastie, and Kenneth W Church. Very sparse random projections. In Proceedings of the 12th ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 287–296. ACM, 2006.
|
| 234 |
+
|
| 235 |
+
Ling Liang, Lei Deng, Yueling Zeng, Xing Hu, Yu Ji, Xin Ma, Guoqi Li, and Yuan Xie. Crossbaraware neural network pruning. IEEE Access, 6:58324–58337, 2018.
|
| 236 |
+
|
| 237 |
+
Yingyan Lin, Charbel Sakr, Yongjune Kim, and Naresh Shanbhag. Predictivenet: An energyefficient convolutional neural network via zero prediction. In Circuits and Systems (ISCAS), 2017 IEEE International Symposium on, pp. 1–4. IEEE, 2017a.
|
| 238 |
+
|
| 239 |
+
Yujun Lin, Song Han, Huizi Mao, Yu Wang, and William J Dally. Deep gradient compression: Reducing the communication bandwidth for distributed training. arXiv preprint arXiv:1712.01887, 2017b.
|
| 240 |
+
|
| 241 |
+
Zhuang Liu, Jianguo Li, Zhiqiang Shen, Gao Huang, Shoumeng Yan, and Changshui Zhang. Learning efficient convolutional networks through network slimming. In 2017 IEEE International Conference on Computer Vision (ICCV), pp. 2755–2763. IEEE, 2017.
|
| 242 |
+
|
| 243 |
+
Jian-Hao Luo and Jianxin Wu. Autopruner: An end-to-end trainable filter pruning method for efficient deep model inference. arXiv preprint arXiv:1805.08941, 2018.
|
| 244 |
+
|
| 245 |
+
Jian-Hao Luo, Jianxin Wu, and Weiyao Lin. Thinet: A filter level pruning method for deep neural network compression. arXiv preprint arXiv:1707.06342, 2017.
|
| 246 |
+
|
| 247 |
+
Jeffrey L McKinstry, Steven K Esser, Rathinakumar Appuswamy, Deepika Bablani, John V Arthur, Izzet B Yildiz, and Dharmendra S Modha. Discovering low-precision networks close to fullprecision networks for efficient embedded inference. arXiv preprint arXiv:1809.04191, 2018.
|
| 248 |
+
|
| 249 |
+
Dmytro Mishkin and Jiri Matas. All you need is a good init. arXiv preprint arXiv:1511.06422, 2015.
|
| 250 |
+
|
| 251 |
+
Pavlo Molchanov, Stephen Tyree, Tero Karras, Timo Aila, and Jan Kautz. Pruning convolutional neural networks for resource efficient inference. 2016.
|
| 252 |
+
|
| 253 |
+
Ari S Morcos, David GT Barrett, Neil C Rabinowitz, and Matthew Botvinick. On the importance of single directions for generalization. arXiv preprint arXiv:1803.06959, 2018.
|
| 254 |
+
|
| 255 |
+
Alexander Novikov, Dmitrii Podoprikhin, Anton Osokin, and Dmitry P Vetrov. Tensorizing neural networks. In Advances in Neural Information Processing Systems, pp. 442–450, 2015.
|
| 256 |
+
|
| 257 |
+
Joseph Redmon and Ali Farhadi. Yolo9000: better, faster, stronger. arXiv preprint, 1612, 2016.
|
| 258 |
+
|
| 259 |
+
Minsoo Rhu, Mike O’Connor, Niladrish Chatterjee, Jeff Pool, Youngeun Kwon, and Stephen W Keckler. Compressing dma engine: Leveraging activation sparsity for training deep neural networks. In High Performance Computer Architecture (HPCA), 2018 IEEE International Symposium on, pp. 78–91. IEEE, 2018.
|
| 260 |
+
|
| 261 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 262 |
+
|
| 263 |
+
Samuel L Smith, Pieter-Jan Kindermans, and Quoc V Le. Don’t decay the learning rate, increase the batch size. arXiv preprint arXiv:1711.00489, 2017.
|
| 264 |
+
|
| 265 |
+
Ryan Spring and Anshumali Shrivastava. Scalable and sustainable deep learning via randomized hashing. In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 445–454. ACM, 2017.
|
| 266 |
+
|
| 267 |
+
Xu Sun, Xuancheng Ren, Shuming Ma, and Houfeng Wang. meprop: Sparsified back propagation for accelerated deep learning with reduced overfitting. arXiv preprint arXiv:1706.06197, 2017.
|
| 268 |
+
|
| 269 |
+
Nandita Vijaykumar, Gennady Pekhimenko, Adwait Jog, Abhishek Bhowmick, Rachata Ausavarungnirun, Chita Das, Mahmut Kandemir, Todd C Mowry, and Onur Mutlu. A case for core-assisted bottleneck acceleration in gpus: enabling flexible data compression with assist warps. In ACM SIGARCH Computer Architecture News, volume 43, pp. 41–53. ACM, 2015.
|
| 270 |
+
|
| 271 |
+
Khac Ky Vu. Random projection for high-dimensional optimization. PhD thesis, Universite Paris- ´ Saclay, 2016.
|
| 272 |
+
|
| 273 |
+
Endong Wang, Qing Zhang, Bo Shen, Guangyong Zhang, Xiaowei Lu, Qing Wu, and Yajuan Wang. Intel math kernel library. In High-Performance Computing on the Intel $\textsuperscript { \textregistered }$ Xeon Phi, pp. 167–188. Springer, 2014.
|
| 274 |
+
|
| 275 |
+
Wei Wen, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Learning structured sparsity in deep neural networks. In Advances in Neural Information Processing Systems, pp. 2074–2082, 2016.
|
| 276 |
+
|
| 277 |
+
Wei Wen, Cong Xu, Feng Yan, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Terngrad: Ternary gradients to reduce communication in distributed deep learning. In Advances in Neural Information Processing Systems, pp. 1508–1518, 2017.
|
| 278 |
+
|
| 279 |
+
Shuang Wu, Guoqi Li, Feng Chen, and Luping Shi. Training and inference with integers in deep neural networks. arXiv preprint arXiv:1802.04680, 2018.
|
| 280 |
+
|
| 281 |
+
Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, et al. Google’s neural machine translation system: Bridging the gap between human and machine translation. arXiv preprint arXiv:1609.08144, 2016.
|
| 282 |
+
|
| 283 |
+
Yuxin Wu and Kaiming He. Group normalization. arXiv preprint arXiv:1803.08494, 2018.
|
| 284 |
+
|
| 285 |
+
Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms. arXiv preprint arXiv:1708.07747, 2017.
|
| 286 |
+
|
| 287 |
+
Jian Xue, Jinyu Li, Dong Yu, Mike Seltzer, and Yifan Gong. Singular value decomposition based low-footprint speaker adaptation and personalization for deep neural network. In Acoustics, Speech and Signal Processing (ICASSP), 2014 IEEE International Conference on, pp. 6359– 6363. IEEE, 2014.
|
| 288 |
+
|
| 289 |
+
Yinchong Yang, Denis Krompass, and Volker Tresp. Tensor-train recurrent neural networks for video classification. arXiv preprint arXiv:1707.01786, 2017.
|
| 290 |
+
|
| 291 |
+
Jianbo Ye, Xin Lu, Zhe Lin, and James Z Wang. Rethinking the smaller-norm-less-informative assumption in channel pruning of convolution layers. arXiv preprint arXiv:1802.00124, 2018.
|
| 292 |
+
|
| 293 |
+
Yang You, Zhao Zhang, C Hsieh, James Demmel, and Kurt Keutzer. Imagenet training in minutes. CoRR, abs/1709.05011, 2017.
|
| 294 |
+
|
| 295 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016.
|
| 296 |
+
|
| 297 |
+
Tianyun Zhang, Kaiqi Zhang, Shaokai Ye, Jiayu Li, Jian Tang, Wujie Wen, Xue Lin, Makan Fardad, and Yanzhi Wang. Adam-admm: A unified, systematic framework of structured weight pruning for dnns. arXiv preprint arXiv:1807.11091, 2018.
|
| 298 |
+
|
| 299 |
+
Youtao Zhang, Jun Yang, and Rajiv Gupta. Frequent value locality and value-centric data cache design. ACM SIGPLAN Notices, 35(11):150–159, 2000.
|
| 300 |
+
|
| 301 |
+
Shuchang Zhou, Yuxin Wu, Zekun Ni, Xinyu Zhou, He Wen, and Yuheng Zou. Dorefa-net: Training low bitwidth convolutional neural networks with low bitwidth gradients. arXiv preprint arXiv:1606.06160, 2016.
|
| 302 |
+
|
| 303 |
+
# APPENDIX A PROOF OF THE DIMENSION-REDUCTION SEARCH FOR INNER PRODUCT PRESERVATION
|
| 304 |
+
|
| 305 |
+
Theorem 1. Given a set of $N$ points in $\mathbb { R } ^ { d }$ (i.e. all $\mathbf { X } _ { i }$ and $\mathbf { W } _ { j }$ ), and a number of $\boldsymbol { k } > O ( \frac { l o g ( N ) } { \epsilon ^ { 2 } } )$ there exist a linear map $f : \mathbb { R } ^ { d } \Rightarrow \mathbb { R } ^ { k }$ and a $\epsilon _ { 0 } \in ( 0 , 1 )$ , for $0 < \epsilon \le \epsilon _ { 0 }$ we have
|
| 306 |
+
|
| 307 |
+
$$
|
| 308 |
+
P [ | \langle f ( \mathbf { X } _ { i } ) , f ( \mathbf { W } _ { j } ) \rangle - \langle \mathbf { X } _ { i } , \mathbf { W } _ { j } \rangle | \leq \epsilon ] \geq 1 - O ( \epsilon ^ { 2 } ) .
|
| 309 |
+
$$
|
| 310 |
+
|
| 311 |
+
for all $\mathbf { X } _ { i }$ and $\mathbf { W } _ { j }$
|
| 312 |
+
|
| 313 |
+
Proof. According to the definition of inner product and vector norm, any two vectors a and $\mathbf { b }$ satisfy
|
| 314 |
+
|
| 315 |
+
$$
|
| 316 |
+
\left\{ \begin{array} { l l } { \langle \mathbf { a } , \mathbf { b } \rangle = ( \| \mathbf { a } \| ^ { 2 } + \| \mathbf { b } \| ^ { 2 } - \| \mathbf { a } - \mathbf { b } \| ^ { 2 } ) / 2 } \\ { \langle \mathbf { a } , \mathbf { b } \rangle = ( \| \mathbf { a } + \mathbf { b } \| ^ { 2 } - \| \mathbf { a } \| ^ { 2 } - \| \mathbf { b } \| ^ { 2 } ) / 2 } \end{array} \right. .
|
| 317 |
+
$$
|
| 318 |
+
|
| 319 |
+
It is easy to further get
|
| 320 |
+
|
| 321 |
+
$$
|
| 322 |
+
( \mathbf { a } , \mathbf { b } ) = ( \| \mathbf { a } + \mathbf { b } \| ^ { 2 } - \| \mathbf { a } - \mathbf { b } \| ^ { 2 } ) / 4 .
|
| 323 |
+
$$
|
| 324 |
+
|
| 325 |
+
Therefore, we can transform the target in equation (7) to
|
| 326 |
+
|
| 327 |
+
$$
|
| 328 |
+
\begin{array} { r l r } & { } & { \mid \langle f ( \mathbf { X } _ { i } ) , f ( \mathbf { W } _ { j } ) \rangle - \langle \mathbf { X } _ { i } , \mathbf { W } _ { j } \rangle \mid } \\ & { } & { = \mid \| f ( \mathbf { X } _ { i } ) + f ( \mathbf { W } _ { j } ) \| ^ { 2 } - \| f ( \mathbf { X } _ { i } ) - f ( \mathbf { W } _ { j } ) \| ^ { 2 } - \| \mathbf { X } _ { i } + \mathbf { W } _ { j } \| ^ { 2 } + \| \mathbf { X } _ { i } - \mathbf { W } _ { j } \| ^ { 2 } \mid / 4 } \\ & { } & { \le \mid \| f ( \mathbf { X } _ { i } ) + f ( \mathbf { W } _ { j } ) \| ^ { 2 } - \| \mathbf { X } _ { i } + \mathbf { W } _ { j } \| ^ { 2 } \mid / 4 + \mid \| f ( \mathbf { X } _ { i } ) - f ( \mathbf { W } _ { j } ) \| ^ { 2 } - \| \mathbf { X } _ { i } - \mathbf { W } _ { j } \| ^ { 2 } \mid / 4 , } \end{array}
|
| 329 |
+
$$
|
| 330 |
+
|
| 331 |
+
which is also based on the fact that $| u - v | \leq | u | + | v |$ . Now recall the definition of random projection in equation (5) of the main text
|
| 332 |
+
|
| 333 |
+
$$
|
| 334 |
+
f ( \mathbf { X } _ { i } ) = \frac { 1 } { \sqrt { k } } \mathbf { R } \mathbf { X } _ { i } \in \mathbb { R } ^ { k } , f ( \mathbf { W } _ { j } ) = \frac { 1 } { \sqrt { k } } \mathbf { R } \mathbf { W } _ { j } \in \mathbb { R } ^ { k } .
|
| 335 |
+
$$
|
| 336 |
+
|
| 337 |
+
Substituting equation (11) into equation (10), we have
|
| 338 |
+
|
| 339 |
+
$$
|
| 340 |
+
\begin{array} { r l r } & { } & { \quad \big | \langle f ( \mathbf { X } _ { i } ) , f ( \mathbf { W } _ { j } ) \rangle - \langle \mathbf { X } _ { i } , \mathbf { W } _ { j } \rangle \big | } \\ & { } & { \quad \le \mid \| \frac { 1 } { \sqrt { k } } \mathbf { R } \mathbf { X } _ { i } + \frac { 1 } { \sqrt { k } } \mathbf { R } \mathbf { W } _ { j } \| ^ { 2 } - \| \mathbf { X } _ { i } + \mathbf { W } _ { j } \| ^ { 2 } \mid / 4 + \mid \| \frac { 1 } { \sqrt { k } } \mathbf { R } \mathbf { X } _ { i } - \frac { 1 } { \sqrt { k } } \mathbf { R } \mathbf { W } _ { j } \| ^ { 2 } - \| \mathbf { X } _ { i } - \mathbf { W } _ { j } \| ^ { 2 } \mid / 4 } \\ & { } & { \quad = \mid \| \frac { 1 } { \sqrt { k } } \mathbf { R } ( \mathbf { X } _ { i } + \mathbf { W } _ { j } ) \| ^ { 2 } - \| \mathbf { X } _ { i } + \mathbf { W } _ { j } \| ^ { 2 } \mid / 4 + \mid \| \frac { 1 } { \sqrt { k } } \mathbf { R } ( \mathbf { X } _ { i } - \mathbf { W } _ { j } ) \| ^ { 2 } - \| \mathbf { X } _ { i } - \mathbf { W } _ { j } \| ^ { 2 } \mid / 4 } \\ & { } & { \quad = \mid \| f ( \mathbf { X } _ { i } + \mathbf { W } _ { j } ) \| ^ { 2 } - \| \mathbf { X } _ { i } + \mathbf { W } _ { j } \| ^ { 2 } \mid / 4 + \mid \| f ( \mathbf { X } _ { i } - \mathbf { W } _ { j } ) \| ^ { 2 } - \| \mathbf { X } _ { i } - \mathbf { W } _ { j } \| ^ { 2 } \mid / 4 . } \end{array} .
|
| 341 |
+
$$
|
| 342 |
+
|
| 343 |
+
Further recalling the norm preservation in equation (3) of the main text: there exist a linear map $f : \mathbb { R } ^ { d } \Rightarrow \mathbb { R } ^ { k }$ and a $\epsilon _ { 0 } \in ( 0 , 1 )$ , for $0 < \epsilon \le \epsilon _ { 0 }$ we have
|
| 344 |
+
|
| 345 |
+
$$
|
| 346 |
+
P [ ( 1 - \epsilon ) \| \mathbf { Z } \| ^ { 2 } \leq \| f ( \mathbf { Z } ) \| ^ { 2 } \leq ( 1 + \epsilon ) \| \mathbf { Z } \| ^ { 2 } ] \geq 1 - O ( \epsilon ^ { 2 } ) .
|
| 347 |
+
$$
|
| 348 |
+
|
| 349 |
+
Substituting the equation (13) into equation (12) yields
|
| 350 |
+
|
| 351 |
+
$$
|
| 352 |
+
\begin{array} { r l } & P [ \mathbf { \lvert \lvert \lvert \delta f ( \mathbf { X } } _ { i } + \mathbf { W } _ { j } ) \rvert ] ^ { 2 } - \lVert \mathbf { X } _ { i } + \mathbf { W } _ { j } \rVert ^ { 2 } \mathbf { \lvert \langle 4 + \lvert \lvert \phi ( \mathbf { X } _ { i } - \mathbf { W } _ { j } ) \rvert \rvert ^ { 2 } - \lVert \mathbf { X } _ { i } - \mathbf { W } _ { j } \rVert ^ { 2 } \mathbf { \lvert \langle 4 . . . } } \\ & { \qquad \leq \frac { \epsilon } { 4 } ( \lVert \mathbf { X } _ { i } + \mathbf { W } _ { j } \rVert ^ { 2 } + \lVert \mathbf { X } _ { i } - \mathbf { W } _ { j } \rVert ^ { 2 } ) = \frac { \epsilon } { 2 } ( \lVert \mathbf { X } _ { i } \rVert ^ { 2 } + \lVert \mathbf { W } _ { j } \rVert ^ { 2 } ) ] . . . } \\ & { \qquad \geq P \bigl ( \mathbf { \lvert \lvert \delta f ( \mathbf { X } } _ { i } + \mathbf { W } _ { j } ) \rVert ^ { 2 } - \lVert \mathbf { X } _ { i } + \mathbf { W } _ { j } \rVert ^ { 2 } \mathbf { \lvert \langle 4 \leq \frac { \epsilon } { 4 } \lVert \mathbf { X } _ { i } + \mathbf { W } _ { j } \rVert ^ { 2 } \rangle } . . . } \\ & { \qquad \times P \bigl ( \mathbf { \lvert \delta f ( \mathbf { X } } _ { i } - \mathbf { W } _ { j } ) \rvert \rvert ^ { 2 } - \lVert \mathbf { X } _ { i } - \mathbf { W } _ { j } \rVert ^ { 2 } \mathbf { \lvert \langle 4 \leq \frac { \epsilon } { 4 } \lVert \mathbf { X } _ { i } - \mathbf { W } _ { j } \rVert ^ { 2 } \rangle } . . . } \\ & { \qquad \geq \mathrm { [ 1 } - O ( \epsilon ^ { 2 } ) \ ] \cdot \left[ \mathrm { 1 } - O ( \epsilon ^ { 2 } ) \right] = 1 - O ( \epsilon ^ { 2 } ) . } \end{array} .
|
| 353 |
+
$$
|
| 354 |
+
|
| 355 |
+
Combining equation (12) and (14), finally we have
|
| 356 |
+
|
| 357 |
+
$$
|
| 358 |
+
\begin{array} { r } { P [ \mathbf { \lvert \langle f ( \mathbf { X } _ { i } ) , f ( \mathbf { W } _ { j } ) \rangle } - \langle \mathbf { X } _ { i } , \mathbf { W } _ { j } \rangle \mathbf { \lvert \leq } \frac { \epsilon } { 2 } ( \lVert \mathbf { X } _ { i } \rVert ^ { 2 } + \lVert \mathbf { W } _ { j } \rVert ^ { 2 } ) ] \geq 1 - O ( \epsilon ^ { 2 } ) \ . } \end{array}
|
| 359 |
+
$$
|
| 360 |
+
|
| 361 |
+
It can be seen that, for any given $\mathbf { X } _ { i }$ and $\mathbf { W } _ { j }$ pair, the inner product can be preserved if the $\epsilon$ is sufficiently small. Actually, previous work (Achlioptas, 2001; Bingham & Mannila, 2001; Vu, 2016) discussed a lot on the random projection for various big data applications, here we re-organize these supporting materials to form a systematic proof. We hope this could help readers to follow this paper. In practical experiments, there exists a trade-off between the dimension reduction degree and the recognition accuracy. Smaller $\epsilon$ usually brings more accurate inner product estimation and better recognition accuracy while at the cost of higher computational complexity with larger $k$ , and vice versa. Because the $\| \mathbf { X } _ { i } \| ^ { 2 }$ and $\| \mathbf { W } _ { j } \| ^ { 2 }$ are not strictly bounded, the approximation may suffer from some noises. Anyway, from the abundant experiments in this work, the effectiveness of our approach for training dynamic and sparse neural networks has been validated.
|
| 362 |
+
|
| 363 |
+
Data: A mini-batch of inputs $\&$ targets $( \mathbf { X } _ { 0 } , \mathbf { X } ^ { * } )$ , previous weights $\mathbf { W } ^ { t }$ , previous BN parameters $\theta ^ { t }$ .
|
| 364 |
+
Result: Update weights $\dot { \mathbf { W } } ^ { t + 1 }$ , update BN parameters $\theta ^ { t + 1 }$ .
|
| 365 |
+
|
| 366 |
+
Random projection: $f ( \mathbf { W } _ { k } ^ { t } ) \Leftarrow \mathbf { W } _ { k } ^ { t }$ ;
|
| 367 |
+
|
| 368 |
+
Step 1. Forward Computation;
|
| 369 |
+
for $k { = } l$ to $L$ do if $k { < } L$ then Projection: $f ( \mathbf { X } _ { k - 1 } ) \Leftarrow \mathbf { X } _ { k - 1 }$ ; Generating $M a s k _ { k }$ via dimension-reduction search according to $f ( \mathbf { X } _ { k - 1 } )$ and $f ( \mathbf { W } _ { k } ^ { t } )$ ; $\mathbf { S } _ { k } \Leftarrow \varphi [ M a s k _ { k } ( \mathbf { X } _ { k - 1 } \mathbf { W } _ { k } ^ { t } ) ]$ ; $\left. \begin{array} { l l } { \langle } & { M a s k _ { k } [ B N ( \mathrm { ~ ~ \kappa ~ } , \theta _ { k } ^ { t } ) ] } \end{array} \right.$ ; else $\begin{array} { r l } { | } & { { } \mathbf { X } _ { L } \Leftarrow l i n e a r ( \mathbf { X } _ { L - 1 } \mathbf { W } _ { L } ^ { t } ) ; } \end{array}$ ; end
|
| 370 |
+
end
|
| 371 |
+
|
| 372 |
+
Step 2. Backward Computation;
|
| 373 |
+
|
| 374 |
+
Compute the gradient of the output layer $\begin{array} { r } { \mathbf { G } _ { \mathbf { X } _ { L } } = \frac { \partial C ( \mathbf { X } _ { L } , \mathbf { X } ^ { * } ) } { \partial \mathbf { X } _ { L } } } \end{array}$ ;
|
| 375 |
+
for $k { = } L$ to $^ { l }$ do if $k { = } { = } L$ then $\begin{array} { r l } { } & { { } \Leftarrow M a s k _ { k - 1 } ( { \bf G } _ { { \bf X } _ { L } } ( { \bf W } _ { L } ^ { t } ) ^ { T } ) ; } \end{array}$ $\mathbf { G } _ { \mathbf { W } _ { L } } \Leftarrow \mathbf { G } _ { \mathbf { X } _ { L } } ^ { T } \mathbf { X } _ { L - 1 }$ else $( \mathbf { G } _ { \mathbf { S } _ { k } } , \mathbf { G } _ { \theta _ { k } } ) \Leftarrow M a s k _ { k } [ B N _ { - } g r a d ( \mathbf { G } _ { \mathbf { X } _ { k } } , \mathbf { S } _ { k } , \theta _ { k } ^ { t } ) ]$ $\mathbf { G } _ { \mathbf { W } _ { k } } \Leftarrow ( \mathbf { G } _ { \mathbf { S } _ { k } } \odot \varphi \lrcorner g r a d ) ^ { T } \mathbf { X } _ { k - 1 }$ ; if $k { > } I$ then $\begin{array} { r } { \big \vert \mathbf { G } _ { \mathbf { X } _ { k - 1 } } \Leftarrow M a s k _ { k - 1 } \big [ \left( \mathbf { G } _ { \mathbf { S } _ { k } } \odot \varphi _ { - } g r a d \right) ( \mathbf { W } _ { k } ^ { t } ) ^ { T } \big ] ; } \end{array}$ end end
|
| 376 |
+
end
|
| 377 |
+
Step 3. Parameter Update;
|
| 378 |
+
for $k { = } l$ to $L$ do $\mathbf { W } _ { k } ^ { t + 1 } \Leftarrow O p t i m i z e r ( \mathbf { W } _ { k } ^ { t } , \mathbf { G } _ { \mathbf { W } _ { k } } ) ;$ $\theta _ { k } ^ { t + 1 } \Leftarrow O p t i m i z e r ( \theta _ { k } ^ { t } , { \bf G } \theta _ { k } )$ ;
|
| 379 |
+
end
|
| 380 |
+
|
| 381 |
+
# APPENDIX B IMPLEMENTATION AND OVERHEAD
|
| 382 |
+
|
| 383 |
+
The training algorithm for generating DSG is presented in Algorithm 1. The generation procedure of the critical neuron mask based on the virtual activations estimated in the low-dimensional space is presented in Figure 9, which is a typical top- $k$ search. The $k$ value is determined by the activation size and the desired sparsity $\gamma$ . To reduce the search cost, we calculate the first input sample $X ( 1 )$ within the current mini-batch and then conduct a top- $k$ search over the whole virtual activation matrix for obtaining the top- $k$ threshold under this sample. The remaining samples share the top- $k$ threshold from the first sample to avoid costly searching overhead. At last, the overall activation mask is generated by setting the mask element to one if the estimated activation is larger than the top- $k$ threshold and setting others to zero. In this way, we greatly reduce the search cost. Note that, for the FC layer, each sample $X ( i )$ is a vector.
|
| 384 |
+
|
| 385 |
+

|
| 386 |
+
Figure 9: Selection mask generation: using a top- $k$ search on the first input sample $X ( 1 )$ within each mini-batch to obtain a top- $k$ threshold which is shared by the following samples. Then, we apply thresholding on the whole output activation tensor to generate the importance mask for the same mini-batch.
|
| 387 |
+
|
| 388 |
+
Table 1: Computational complexity of dimension-reduction search. MMACs denotes mega-MACs and BL denotes baseline.
|
| 389 |
+
|
| 390 |
+
<table><tr><td>Layers</td><td colspan="4">Dimension</td><td colspan="4">Operations (MMACs)</td></tr><tr><td>npQ,ncRs,nK</td><td>BL 0.3</td><td>0.5</td><td>0.7</td><td>0.9</td><td>BL 0.3</td><td>0.5</td><td>0.7</td><td>0.9</td></tr><tr><td>1024,1152, 128</td><td>1152 539</td><td>232</td><td>148</td><td>119</td><td>144 67.37</td><td>29</td><td>18.5</td><td>14.88</td></tr><tr><td>256, 1152,256</td><td>1152 616</td><td>266</td><td>169</td><td>136</td><td>72 38.5</td><td>16.63</td><td>10.56</td><td>8.5</td></tr><tr><td>256,2304,256</td><td>2304 616</td><td>266</td><td>169</td><td>136</td><td>144 38.5</td><td>16.63</td><td>10.56</td><td>8.5</td></tr><tr><td>64,2304,512</td><td>2304 693</td><td>299</td><td>190</td><td>154</td><td>72 21.65</td><td>9.34</td><td>5.94</td><td>4.81</td></tr><tr><td>64, 4608, 512</td><td>4608 693</td><td>299</td><td>190</td><td>154</td><td>144 21.65</td><td>9.34</td><td>5.94</td><td>4.81</td></tr></table>
|
| 391 |
+
|
| 392 |
+
Furthermore, we investigate the influence of the $\epsilon$ on the computation cost of dimension-reduction search for importance estimation. We take several layers from the VGG8 on CIFAR10 as a case study, as shown in Table 1. With $\epsilon$ larger, the dimension-reduction search can achieve lower dimension with much fewer operations. The average reduction of the dimension is $3 . 6 \mathbf { x }$ $( \epsilon = 0 . 3$ ), $8 . 5 \mathrm { x }$ $\epsilon = 0 . 5$ ), $1 3 . 3 \mathrm { x }$ $\epsilon = 0 . 7 )$ , and $1 6 . 5 \mathrm { x }$ $\mathit { \check { \epsilon } } = 0 . 9$ ). The resulting operation reduction is 3.1x, 7.1x, $1 1 . 1 \mathbf { x }$ , and $1 3 . 9 \mathrm { X }$ , respectively.
|
| 393 |
+
|
| 394 |
+
# APPENDIX C CONVERGENCE ANALYSIS
|
| 395 |
+
|
| 396 |
+
One interesting question is that whether DSG slows down the training convergence or not, which is answered by Figure 10. According to Figure 10(a)-(b), the convergence speed under DSG constraints varies little from the vanilla model training. This probably owes to the high fidelity of inner product when we use random projection to reduce the data dimension. Figure 10(c) visualizes the distribution of the pairwise difference between the original high-dimensional inner product and the low-dimensional one for the CONV5 layer of VGG8 on CIFAR10. Most of the inner product differences are around zero, which implies an accurate approximation capability of the proposed dimension-reduction search. This helps reduce the training variance and avoid training deceleration.
|
| 397 |
+
|
| 398 |
+

|
| 399 |
+
Figure 10: Accuracy convergence. (a) Training curve with validation accuracy of VGG8 on CIFAR10; (b) Training curve with top-5 validation accuracy of ResNet-18 on ImageNet; (c) Distribution of pairwise difference between the original high-dimensional inner product and the lowdimensional one for the CONV5 layer in VGG8.
|
| 400 |
+
|
| 401 |
+
Another question in DSG is that whether the selection masks converge during training or not. To explore the answer, we did an additional experiment as shown in the Figure 11. We select a minibatch of training samples as a case study for data recording. Each curve presents the results of one layer (CONV2-CONV6). For each sample at each layer, we recorded the change of binary selection mask between two adjacent training epochs. Here the change is obtained by calculating the $L 1$ - norm value of the difference tensor of two mask tensors at two adjacent epochs, i.e., change $=$ batch avg L1norm(maski+1 − maski). Here the batch avg L1norm(·) indicates the average $L 1$ -norm value across all samples in one mini-batch. As shown in Figure 11(a), the selection mask for each sample converges as training goes on.
|
| 402 |
+
|
| 403 |
+

|
| 404 |
+
Figure 11: Selection mask convergence. (a) Average $L 1$ -norm value of the difference mask tensors between adjacent training epochs across all samples in one mini-batch; (b) Average $L 1$ -norm value of the difference mask tensors between adjacent samples after training.
|
| 405 |
+
|
| 406 |
+
In our implementation we inherit the random projection matrix from training and perform the same on-the-fly dimension-reduction search in inference. We didn’t try to directly suspend the selection masks, because the selection mask might vary across samples even if we observe convergence for each sample. This can be seen from Figure 11(b), where the difference mask tensors between adjacent samples in one mini-batch present significant differences (large $L 1$ -norm value) after training. Therefore, it will consume lot of memory space to save these trained masks for all samples, which is less efficient than conducting on-the-fly search during inference.
|
| 407 |
+
|
| 408 |
+

|
| 409 |
+
Figure 12: Comparison with smaller-dense models with equivalent MACs using ResNet8 on CIFAR10 and AlexNet on ImageNet.
|
| 410 |
+
|
| 411 |
+
# APPENDIX D COMPARISON WITH OTHER METHODS
|
| 412 |
+
|
| 413 |
+
Figure 12 extends Figure 8(b) in the main text to more network structures, including ResNet8 on CIFAR10 and AlexNet on ImageNet. The similar observation can be achieved: the equivalent smaller dense models with the same effective MACs are able to save more training time but the accuracy degradation will be increased. Note that in this figure, the DSG training uses a warm-up training with dense model for the first 10 epochs. The overhead of the warm-up training has been taken account into the entire training cost. To make the accuracy results on CIFAR10 and ImageNet comparable for figure clarity, AlexNet reports the top-5 accuracy.
|
| 414 |
+
|
| 415 |
+
Our work targets at both the training and inference phases while most of previous work focused on the inference compression. In prior methods, the training usually becomes more complicated with various regularization constraints or iterative fine-tuning/retraining. Therefore, it is not very fair to compare with them during training. For this reason, we just compare with them on the inference pruning. Different from doing DSG training from scratch, here we utilize DSG for fine-tuning based on pre-trained models.
|
| 416 |
+
|
| 417 |
+
Table 2: Comparison with other structured sparsification methods for inference. All the results are from VGG16 on ImageNet, and the default accuracy is top-1 accuracy. The baseline methods are Taylor Expansion (Molchanov et al., 2016), ThiNet (Luo et al., 2017), Channel Pruning (Hu et al., 2018), AutoPrunner (Luo & Wu, 2018), and AMC (He et al., 2018b).
|
| 418 |
+
|
| 419 |
+
<table><tr><td>Methods</td><td>Taylor Expansion</td><td>ThiNet</td><td>Channel Pruning</td><td>AutoPrunner</td><td>AMC</td><td>DSG</td></tr><tr><td>Operation Sparsity</td><td>62.86%</td><td>69.81%</td><td>69.32%</td><td>73.6%</td><td>80%</td><td>62.92%</td></tr><tr><td>Accuracy</td><td>87%(top-5)</td><td>67.34%</td><td>70.42%</td><td>68.43%</td><td>69.1%</td><td>71.44%(top-1) 90.56%(top-5)</td></tr></table>
|
| 420 |
+
|
| 421 |
+
To guarantee the fairness, all the results are from the same network (VGG16) on the same dataset (ImageNet). Since our DSG produces structured sparsity, we also select structured sparsity work as comparison baselines. Different from the previous experiments in this paper, we further take the input sparsity at each layer into account rather than only count the output sparsity. This is due to the fact that the baselines consider all zero operands. The results are listed in Table 2, from which we can see that DSG is able to achieve a good balance between the operation amount and model accuracy.
|
md/train/H1q-TM-AW/H1q-TM-AW.md
ADDED
|
@@ -0,0 +1,487 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# A DIRT-T APPROACH TO UNSUPERVISED DOMAINADAPTATION
|
| 2 |
+
|
| 3 |
+
Rui $\mathbf { S h u } ^ { \dagger }$ ∗, Hung H. Bui‡, Hirokazu Narui†, & Stefano Ermon†
|
| 4 |
+
|
| 5 |
+
†Stanford University
|
| 6 |
+
‡DeepMind
|
| 7 |
+
†{ruishu,hirokaz2,ermon}@stanford.edu
|
| 8 |
+
‡{buih}@google.com
|
| 9 |
+
|
| 10 |
+
# ABSTRACT
|
| 11 |
+
|
| 12 |
+
Domain adaptation refers to the problem of leveraging labeled data in a source domain to learn an accurate model in a target domain where labels are scarce or unavailable. A recent approach for finding a common representation of the two domains is via domain adversarial training (Ganin & Lempitsky, 2015), which attempts to induce a feature extractor that matches the source and target feature distributions in some feature space. However, domain adversarial training faces two critical limitations: 1) if the feature extraction function has high-capacity, then feature distribution matching is a weak constraint, 2) in non-conservative domain adaptation (where no single classifier can perform well in both the source and target domains), training the model to do well on the source domain hurts performance on the target domain. In this paper, we address these issues through the lens of the cluster assumption, i.e., decision boundaries should not cross high-density data regions. We propose two novel and related models: 1) the Virtual Adversarial Domain Adaptation (VADA) model, which combines domain adversarial training with a penalty term that punishes violation of the cluster assumption; 2) the Decision-boundary Iterative Refinement Training with a Teacher (DIRT-T)1 model, which takes the VADA model as initialization and employs natural gradient steps to further minimize the cluster assumption violation. Extensive empirical results demonstrate that the combination of these two models significantly improve the state-of-the-art performance on the digit, traffic sign, and Wi-Fi recognition domain adaptation benchmarks.
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
The development of deep neural networks has enabled impressive performance in a wide variety of machine learning tasks. However, these advancements often rely on the existence of a large amount of labeled training data. In many cases, direct access to vast quantities of labeled data for the task of interest (the target domain) is either costly or otherwise absent, but labels are readily available for related training sets (the source domain). A notable example of this scenario occurs when the source domain consists of richly-annotated synthetic or semi-synthetic data, but the target domain consists of unannotated real-world data (Sun & Saenko, 2014; Vazquez et al., 2014). However, the source data distribution is often dissimilar to the target data distribution, and the resulting significant covariate shift is detrimental to the performance of the source-trained model when applied to the target domain (Shimodaira, 2000).
|
| 17 |
+
|
| 18 |
+
Solving the covariate shift problem of this nature is an instance of domain adaptation (Ben-David et al., 2010b). In this paper, we consider a challenging setting of domain adaptation where 1) we are provided with fully-labeled source samples and completely-unlabeled target samples, and 2) the existence of a classifier in the hypothesis space with low generalization error in both source and target domains is not guaranteed. Borrowing approximately the terminology from Ben-David et al. (2010b), we refer to this setting as unsupervised, non-conservative domain adaptation. We note that this is in contrast to conservative domain adaptation, where we assume our hypothesis space contains a classifier that performs well in both the source and target domains.
|
| 19 |
+
|
| 20 |
+
To tackle unsupervised domain adaptation, Ganin & Lempitsky (2015) proposed to constrain the classifier to only rely on domain-invariant features. This is achieved by training the classifier to perform well on the source domain while minimizing the divergence between features extracted from the source versus target domains. To achieve divergence minimization, Ganin & Lempitsky (2015) employ domain adversarial training. We highlight two issues with this approach: 1) when the feature function has high-capacity and the source-target supports are disjoint, the domain-invariance constraint is potentially very weak (see Section 3), and 2) good generalization on the source domain hurts target performance in the non-conservative setting.
|
| 21 |
+
|
| 22 |
+
Saito et al. (2017) addressed these issues by replacing domain adversarial training with asymmetric tri-training (ATT), which relies on the assumption that target samples that are labeled by a sourcetrained classifier with high confidence are correctly labeled by the source classifier. In this paper, we consider an orthogonal assumption: the cluster assumption (Chapelle & Zien, 2005), that the input distribution contains separated data clusters and that data samples in the same cluster share the same class label. This assumption introduces an additional bias where we seek decision boundaries that do not go through high-density regions. Based on this intuition, we propose two novel models: 1) the Virtual Adversarial Domain Adaptation (VADA) model which incorporates an additional virtual adversarial training (Miyato et al., 2017) and conditional entropy loss to push the decision boundaries away from the empirical data, and 2) the Decision-boundary Iterative Refinement Training with a Teacher (DIRT-T) model which uses natural gradients to further refine the output of the VADA model while focusing purely on the target domain. We demonstrate that
|
| 23 |
+
|
| 24 |
+
1. In conservative domain adaptation, where the classifier is trained to perform well on the source domain, VADA can be used to further constrain the hypothesis space by penalizing violations of the cluster assumption, thereby improving domain adversarial training.
|
| 25 |
+
2. In non-conservative domain adaptation, where we account for the mismatch between the source and target optimal classifiers, DIRT-T allows us to transition from a joint (source and target) classifier (VADA) to a better target domain classifier. Interestingly, we demonstrate the advantage of natural gradients in DIRT-T refinement steps.
|
| 26 |
+
|
| 27 |
+
We report results for domain adaptation in digits classification (MNIST-M, MNIST, SYN DIGITS, SVHN), traffic sign classification (SYN SIGNS, GTSRB), general object classification (STL-10, CIFAR-10), and Wi-Fi activity recognition (Yousefi et al., 2017). We show that, in nearly all experiments, VADA improves upon previous methods and that DIRT-T improves upon VADA, setting new state-of-the-art performances across a wide range of domain adaptation benchmarks. In adapting MNIST $ \mathrm { S V H N }$ , a very challenging task, we out-perform ATT by over $2 0 \%$ .
|
| 28 |
+
|
| 29 |
+
# 2 RELATED WORK
|
| 30 |
+
|
| 31 |
+
Given the extensive literature on domain adaptation, we highlight several works most relevant to our paper. Shimodaira (2000); Mansour et al. (2009) proposed to correct for covariate shift by re-weighting the source samples such that the discrepancy between the target distribution and reweighted source distribution is minimized. Such a procedure is problematic, however, if the source and target distributions do not contain sufficient overlap. Huang et al. (2007); Long et al. (2015); Ganin & Lempitsky (2015) proposed to instead project both distributions into some feature space and encourage distribution matching in the feature space. Ganin & Lempitsky (2015) in particular encouraged feature matching via domain adversarial training, which corresponds approximately to Jensen-Shannon divergence minimization (Goodfellow et al., 2014). To better perform nonconservative domain adaptation, Saito et al. (2017) proposed to modify tri-training (Zhou & Li, 2005) for domain adaptation, leveraging the assumption that highly-confident predictions are correct predictions (Zhu, 2005). Several of aforementioned methods are based on Ben-David et al. (2010a)’s theoretical analysis of domain adaptation, which states the following,
|
| 32 |
+
|
| 33 |
+
Theorem 1 (Ben-David et al., 2010a) Let $\mathcal { H }$ be the hypothesis space and let $( X _ { s } , \epsilon _ { s } )$ and $( X _ { t } , \epsilon _ { t } )$ be the two domains and their corresponding generalization error functions. Then for any $h \in \mathcal H$ ,
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
\epsilon _ { t } ( h ) \leq \frac { 1 } { 2 } d _ { { \mathcal { H } } \Delta { \mathcal { H } } } ( X _ { s } , X _ { t } ) + \epsilon _ { s } ( h ) + \operatorname* { m i n } _ { h ^ { \prime } \in { \mathcal { H } } } \epsilon _ { t } ( h ^ { \prime } ) + \epsilon _ { s } ( h ^ { \prime } ) ,
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
where $d _ { \mathcal { H } \Delta \mathcal { H } }$ denotes the $\mathcal { H } \Delta \mathcal { H }$ -distance between the domains $X _ { s }$ and $X _ { t }$ ,
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
d _ { { \mathcal H } \Delta { \mathcal H } } = 2 \operatorname* { s u p } _ { h , h ^ { \prime } \in { \mathcal H } } \left| \mathbb E _ { x \sim X _ { s } } \left[ h ( x ) \neq h ^ { \prime } ( x ) \right] - \mathbb E _ { x \sim X _ { t } } \left[ h ( x ) \neq h ^ { \prime } ( x ) \right] \right| .
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
Intuitively, $d _ { \mathcal { H } \Delta \mathcal { H } }$ measures the extent to which small changes to the hypothesis in the source domain can lead to large changes in the target domain. It is evident that $d _ { \mathcal { H } \Delta \mathcal { H } }$ relates intimately to the complexity of the hypothesis space and the divergence between the source and target domains. For infinite-capacity models and domains with disjoint supports, $d _ { \mathcal { H } \Delta \mathcal { H } }$ is maximal.
|
| 46 |
+
|
| 47 |
+
A critical component to our paper is the cluster assumption, which states that decision boundaries should not cross high-density regions (Chapelle & Zien, 2005). This assumption has been extensively studied and leveraged for semi-supervised learning, leading to proposals such as conditional entropy minimization (Grandvalet & Bengio, 2005) and pseudo-labeling (Lee, 2013). More recently, the cluster assumption has led to many successful deep semi-supervised learning algorithms such as semi-supervised generative adversarial networks (Dai et al., 2017), virtual adversarial training (Miyato et al., 2017), and self/temporal-ensembling (Laine & Aila, 2016; Tarvainen & Valpola, 2017). Given the success of the cluster assumption in semi-supervised learning, it is natural to consider its application to domain adaptation. Indeed, Ben-David & Urner (2014) formalized the cluster assumption through the lens of probabilistic Lipschitzness and proposed a nearest-neighbors model for domain adaptation. Our work extends this line of research by showing that the cluster assumption can be applied to deep neural networks to solve complex, high-dimensional domain adaptation problems. Independently of our work, French et al. (2017) demonstrated the application of selfensembling to domain adaptation. However, our work additionally considers the application of the cluster assumption to non-conservative domain adaptation.
|
| 48 |
+
|
| 49 |
+
# 3 LIMITATION OF DOMAIN ADVERSARIAL TRAINING
|
| 50 |
+
|
| 51 |
+
Before describing our model, we first highlight that domain adversarial training may not be sufficient for domain adaptation if the feature extraction function has high-capacity. Consider a classifier $h _ { \theta }$ , parameterized by $\theta$ , that maps inputs to the $( K - 1 )$ -simplex (denote as $\mathcal { C }$ ), where $K$ is the number of classes. Suppose the classifier $h = g \circ f$ can be decomposed as the composite of an embedding function $f _ { \theta } : \mathcal { X } \mathcal { Z }$ and embedding classifier $g _ { \theta } : \mathcal { Z } \mathcal { C }$ . For the source domain, let $\mathcal { D } _ { s }$ be the joint distribution over input $x$ and one-hot label $y$ and let $X _ { s }$ be the marginal input distribution. $( \mathcal { D } _ { t } , X _ { t } )$ are analogously defined for the target domain. Let $( \mathcal { L } _ { s } , \mathcal { L } _ { d } )$ be the loss functions
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\begin{array} { r l } & { \qquad \mathcal { L } _ { y } ( \theta ; \mathcal { D } _ { s } ) = \mathbb { E } _ { x , y \sim \mathcal { D } _ { s } } \left[ y ^ { \top } \ln h _ { \theta } ( x ) \right] } \\ & { \qquad \mathcal { L } _ { d } ( \theta ; \mathcal { D } _ { s } , \mathcal { D } _ { t } ) = \underset { D } { \operatorname* { s u p } } \mathbb { E } _ { x \sim \mathcal { D } _ { s } } \left[ \ln D ( f _ { \theta } ( x ) ) \right] + \mathbb { E } _ { x \sim \mathcal { D } _ { t } } \left[ \ln ( 1 - D ( f _ { \theta } ( x ) ) ) \right] , } \end{array}
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
where the supremum ranges over discriminators $D : \mathcal { Z } \to ( 0 , 1 )$ . Then $\mathcal { L } _ { y }$ is the cross-entropy objective and $D$ is a domain discriminator. Domain adversarial training minimizes the objective
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\operatorname* { m i n } _ { \theta } . \mathcal { L } _ { y } ( \theta ; \mathcal { D } _ { s } ) + \lambda _ { d } \mathcal { L } _ { d } ( \theta ; \mathcal { D } _ { s } , \mathcal { D } _ { t } ) ,
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
where $\lambda _ { d }$ is a weighting factor. Minimization of $\mathcal { L } _ { d }$ encourages the learning of a feature extractor $f$ for which the Jensen-Shannon divergence between $f ( X _ { s } )$ and $f ( X _ { t } )$ is small.2 Ganin & Lempitsky (2015) suggest that successful adaptation tends to occur when the source generalization error and feature divergence are both small.
|
| 64 |
+
|
| 65 |
+
It is easy, however, to construct situations where this suggestion fails. In particular, if $f$ has infinitecapacity and the source-target supports are disjoint, then $f$ can employ arbitrary transformations to the target domain so as to match the source feature distribution (see Appendix $\mathrm { E }$ for formalization).
|
| 66 |
+
|
| 67 |
+
We verify empirically that, for sufficiently deep layers, jointly achieving small source generalization error and feature divergence does not imply high accuracy on the target task (Table 5). Given the limitations of domain adversarial training, we wish to identify additional constraints that one can place on the model to achieve better, more reliable domain adaptation.
|
| 68 |
+
|
| 69 |
+

|
| 70 |
+
4 CONSTRAINING VIA CONDITIONAL ENTROPY MINIMIZATION
|
| 71 |
+
Figure 1: VADA improves upon domain adversarial training by additionally penalizing violations of the cluster assumption.
|
| 72 |
+
|
| 73 |
+
In this paper, we apply the cluster assumption to domain adaptation. The cluster assumption states that the input distribution $X$ contains clusters and that points in the same cluster come from the same class. This assumption has been extensively studied and applied successfully to a wide range of classification tasks (see Section 2). If the cluster assumption holds, the optimal decision boundaries should occur far away from data-dense regions in the space of $\mathcal { X }$ (Chapelle & Zien, 2005). Following Grandvalet & Bengio (2005), we achieve this behavior via minimization of the conditional entropy with respect to the target distribution,
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\begin{array} { r } { \mathcal { L } _ { c } ( \boldsymbol { \theta } ; \mathcal { D } _ { t } ) = - \mathbb { E } _ { \boldsymbol { x } \sim \mathcal { D } _ { t } } \left[ h _ { \boldsymbol { \theta } } ( \boldsymbol { x } ) ^ { \top } \ln h _ { \boldsymbol { \theta } } ( \boldsymbol { x } ) \right] . } \end{array}
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
Intuitively, minimizing the conditional entropy forces the classifier to be confident on the unlabeled target data, thus driving the classifier’s decision boundaries away from the target data (Grandvalet & Bengio, 2005). In practice, the conditional entropy must be empirically estimated using the available data. However, Grandvalet & Bengio (2005) note that this approximation breaks down if the classifier $h$ is not locally-Lipschitz. Without the locally-Lipschitz constraint, the classifier is allowed to abruptly change its prediction in the vicinity of the training data points, which 1) results in a unreliable empirical estimate of conditional entropy and 2) allows placement of the classifier decision boundaries close to the training samples even when the empirical conditional entropy is minimized. To prevent this, we propose to explicitly incorporate the locally-Lipschitz constraint via virtual adversarial training (Miyato et al., 2017) and add to the objective function the additional term
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\mathcal { L } _ { v } ( \theta ; \mathcal { D } ) = \mathbb { E } _ { x \sim \mathcal { D } } \left[ \operatorname* { m a x } _ { \| r \| \leq \epsilon } \mathrm { D } _ { \mathrm { K L } } \big ( h _ { \theta } ( x ) \| h _ { \theta } ( x + r ) \big ) \right] ,
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
which enforces classifier consistency within the norm-ball neighborhood of each sample $x$ . Note that virtual adversarial training can be applied with respect to either the target or source distributions. We can combine the conditional entropy minimization objective and domain adversarial training to yield
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\operatorname* { m i n } _ { \theta } . \mathcal { L } _ { y } ( \theta ; \mathcal { D } _ { s } ) + \lambda _ { d } \mathcal { L } _ { d } ( \theta ; \mathcal { D } _ { s } , \mathcal { D } _ { t } ) + \lambda _ { s } \mathcal { L } _ { v } ( \theta ; \mathcal { D } _ { s } ) + \lambda _ { t } \left[ \mathcal { L } _ { v } ( \theta ; \mathcal { D } _ { t } ) + \mathcal { L } _ { c } ( \theta ; \mathcal { D } _ { t } ) \right] ,
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
a basic combination of domain adversarial training and semi-supervised training objectives. We refer to this as the Virtual Adversarial Domain Adaptation (VADA) model. Empirically, we observed that the hyperparameters $\left( \lambda _ { d } , \lambda _ { s } , \lambda _ { t } \right)$ are easy to choose and work well across multiple tasks (Appendix B).
|
| 92 |
+
|
| 93 |
+
$\mathcal { H } \Delta \mathcal { H }$ -Distance Minimization. VADA aligns well with the theory of domain adaptation provided in Theorem 1. Let the loss,
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\begin{array} { r } { \mathcal L _ { t } ( \boldsymbol { \theta } ) = \mathcal L _ { v } ( \boldsymbol { \theta } ; \mathcal D _ { t } ) + \mathcal L _ { c } ( \boldsymbol { \theta } ; D _ { t } ) , } \end{array}
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
denote the degree to which the target-side cluster assumption is violated. Modulating $\lambda _ { t }$ enables VADA to trade-off between hypotheses with low target-side cluster assumption violation and hypotheses with low source-side generalization error. Setting $\lambda _ { t } > 0$ allows rejection of hypotheses with high target-side cluster assumption violation. By rejecting such hypotheses from the hypothesis space $\mathcal { H }$ , VADA reduces $d _ { \mathcal { H } \Delta \mathcal { H } }$ and yields a tighter bound on the target generalization error. We verify empirically that VADA achieves significant improvements over existing models on multiple domain adaptation benchmarks (Table 1).
|
| 100 |
+
|
| 101 |
+
# 5 DECISION-BOUNDARY ITERATIVE REFINEMENT TRAINING
|
| 102 |
+
|
| 103 |
+

|
| 104 |
+
Figure 2: DIRT-T uses VADA as initialization. After removing the source training signal, DIRTT minimizes cluster assumption violation in the target domain through a series of natural gradient steps.
|
| 105 |
+
|
| 106 |
+
In non-conservative domain adaptation, we assume the following inequality,
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\operatorname* { m i n } _ { h \in \mathcal { H } } \epsilon _ { t } ( h ) < \epsilon _ { t } ( h ^ { a } ) \mathrm { ~ w h e r e ~ } h ^ { a } = \arg \operatorname* { m i n } _ { h \in \mathcal { H } } \epsilon _ { s } ( h ) + \epsilon _ { t } ( h ) ,
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
where $( \epsilon _ { s } , \epsilon _ { t } )$ are generalization error functions for the source and target domains. This means that, for a given hypothesis class $\mathcal { H }$ , the optimal classifier in the source domain does not coincide with the optimal classifier in the target domain.
|
| 113 |
+
|
| 114 |
+
We assume that the optimality gap in Eq. (10) results from violation of the cluster assumption. In other words, we suppose that any source-optimal classifier drawn from our hypothesis space necessarily violates the cluster assumption in the target domain. Insofar as VADA is trained on the source domain, we hypothesize that a better hypothesis is achievable by introducing a secondary training phase that solely minimizes the target-side cluster assumption violation.
|
| 115 |
+
|
| 116 |
+
Under this assumption, the natural solution is to initialize with the VADA model and then further minimize the cluster assumption violation in the target domain. In particular, we first use VADA to learn an initial classifier $h _ { \theta _ { 0 } }$ . Next, we incrementally push the classifier’s decision boundaries away from data-dense regions by minimizing the target-side cluster assumption violation loss $\mathcal { L } _ { t }$ in Eq. (9). We denote this procedure Decision-boundary Iterative Refinement Training (DIRT).
|
| 117 |
+
|
| 118 |
+
# 5.1 DECISION-BOUNDARY ITERATIVE REFINEMENT TRAINING WITH A TEACHER
|
| 119 |
+
|
| 120 |
+
Stochastic gradient descent minimizes the loss $\scriptstyle { \mathcal { L } } _ { t }$ by selecting gradient steps $\Delta \theta$ according to the following objective,
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\begin{array} { r l } & { \underset { \Delta \theta } { \mathrm { m i n . } } ~ \mathcal { L } _ { t } ( \theta + \Delta \theta ) } \\ & { ~ \mathrm { s . t . } ~ \| \Delta \theta \| \leq \epsilon , } \end{array}
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
which defines the neighborhood in the parameter space. This notion of neighborhood is sensitive to the parameterization of the model; depending on the parameterization, a seemingly small step $\Delta \theta$ may result in a vastly different classifier. This contradicts our intention of incrementally and locally pushing the decision boundaries to a local conditional entropy minimum, which requires that the decision boundaries of $h _ { \theta + \Delta \theta }$ stay close to that of $h _ { \theta }$ . It is therefore important to define a neighborhood that is parameterization-invariant. Following Pascanu $\&$ Bengio (2013), we instead select $\Delta \theta$ using the following objective,
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
\begin{array} { r l } & { \underset { \Delta \theta } { \operatorname* { m i n } } \mathcal { L } _ { t } ( \theta + \Delta \theta ) } \\ & { \quad \mathrm { s . t . } \mathbb { E } _ { x \sim D _ { t } } \left[ \mathrm { D } _ { \mathrm { K L } } ( h _ { \theta } ( x ) \| h _ { \theta + \Delta \theta } ( x ) ) \right] \leq \epsilon . } \end{array}
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+
Each optimization step now solves for a gradient step $\Delta \theta$ that minimizes the conditional entropy, subject to the constraint that the Kullback-Leibler divergence between $h _ { \theta } ( x )$ and $h _ { \theta + \Delta \theta } ( x )$ is small for $x \sim \mathcal { X } _ { t }$ . The corresponding Lagrangian suggests that one can instead minimize a sequence of optimization problems
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
\operatorname* { m i n . } _ { \theta _ { n } } \lambda _ { t } \mathcal { L } _ { t } ( \theta _ { n } ) + \beta _ { t } \mathbb { E } \left[ \mathrm { D } _ { \mathrm { K L } } \big ( h _ { \theta _ { n - 1 } } ( x ) \| h _ { \theta _ { n } } ( x ) \big ) \right] ,
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
that approximates the application of a series of natural gradient steps.
|
| 139 |
+
|
| 140 |
+
In practice, each of the optimization problems in Eq. (14) can be solved approximately via a finite number of stochastic gradient descent steps. We denote the number of steps taken to be the refinement interval $B$ . Similar to Tarvainen & Valpola (2017), we use the Adam Optimizer with Polyak averaging (Polyak & Juditsky, 1992). We interpret $h _ { \theta _ { n - 1 } }$ as a (sub-optimal) teacher for the student model $h _ { \theta _ { n } }$ , which is trained to stay close to the teacher model while seeking to reduce the cluster assumption violation. As a result, we denote this model as Decision-boundary Iterative Refinement Training with a Teacher (DIRT-T).
|
| 141 |
+
|
| 142 |
+
Weakly-Supervised Learning. This sequence of optimization problems has a natural interpretation that exposes a connection to weakly-supervised learning. In each optimization problem, the teacher model $h _ { \theta _ { n - 1 } }$ pseudo-labels the target samples with noisy labels. Rather than naively training the student model $h _ { \theta _ { n } }$ on the noisy labels, the additional training signal $\mathcal { L } _ { t }$ allows the student model to place its decision boundaries further from the data. If the clustering assumption holds and the initial noisy labels are sufficiently similar to the true labels, conditional entropy minimization can improve the placement of the decision boundaries (Reed et al., 2014).
|
| 143 |
+
|
| 144 |
+
Domain Adaptation. An alternative interpretation is that DIRT-T is the recursive extension of VADA, where the act of pseudo-labeling of the target distribution constructs a new “source” domain (i.e. target distribution $X _ { t }$ with pseudo-labels). The sequence of optimization problems can then be seen as a sequence of non-conservative domain adaptation problems in which $X _ { s } ~ = ~ X _ { t }$ but $p _ { s } ( y \mid x ) \neq p _ { t } \bar { ( } y \mid x )$ , where $p _ { s } ( y \mid x ) = h _ { \theta _ { n - 1 } } ( x )$ and $p _ { t } ( y \mid x )$ is the true conditional label distribution in the target domain. Since $d _ { \mathcal { H } \Delta \mathcal { H } }$ is strictly zero in this sequence of optimization problems, domain adversarial training is no longer necessary. Furthermore, if $\mathcal { L } _ { t }$ minimization does improve the student classifier, then the gap in Eq. (10) should get smaller each time the source domain is updated.
|
| 145 |
+
|
| 146 |
+
# 6 EXPERIMENTS
|
| 147 |
+
|
| 148 |
+
In principle, our method can be applied to any domain adaptation tasks so long as one can define a reasonable notion of neighborhood for virtual adversarial training (Miyato et al., 2016). For comparison against Saito et al. (2017) and French et al. (2017), we focus on visual domain adaptation and evaluate on MNIST, MNIST-M, Street View House Numbers (SVHN), Synthetic Digits (SYN DIGITS), Synthetic Traffic Signs (SYN SIGNS), the German Traffic Signs Recognition Benchmark (GTSRB), CIFAR-10, and STL-10. For non-visual domain adaptation, we evaluate on Wi-Fi activity recognition.
|
| 149 |
+
|
| 150 |
+
# 6.1 IMPLEMENTATION DETAIL
|
| 151 |
+
|
| 152 |
+
Architecture We use a small CNN for the digits, traffic sign, and Wi-Fi domain adaptation experiments, and a larger CNN for domain adaptation between CIFAR-10 and STL-10. Both architectures are available in Appendix A. For fair comparison, we additionally report the performance of source-only baseline models and demonstrate that the significant improvements are attributable to our proposed method.
|
| 153 |
+
|
| 154 |
+
Replacing gradient reversal. In contrast to Ganin & Lempitsky (2015), which proposed to implement domain adversarial training via gradient reversal, we follow Goodfellow et al. (2014) and instead optimize via alternating updates to the discriminator and encoder (see Appendix C).
|
| 155 |
+
|
| 156 |
+
Instance normalization. We explored the application of instance normalization as an image preprocessing step. This procedure makes the classifier invariant to channel-wide shifts and rescaling of pixel intensities. A discussion of instance normalization for domain adaptation is provided in Appendix D. We show in Figure 3 the effect of applying instance normalization to the input image.
|
| 157 |
+
|
| 158 |
+

|
| 159 |
+
Figure 3: Effect of applying instance normalization to the input image. In clockwise direction: MNIST-M, GTSRB, SVHN, and CIFAR-10. In each quadrant, the top row is the original image, and the bottom row is the instance-normalized image.
|
| 160 |
+
|
| 161 |
+
Hyperparameters. For each task, we tuned the four hyperparameters $\left( \lambda _ { d } , \lambda _ { s } , \lambda _ { t } , \beta \right)$ by randomly selecting 1000 labeled target samples from the training set and using that as our validation set. We observed that extensive hyperparameter-tuning is not necessary to achieve state-of-the-art performance. In all experiments with instance-normalized inputs, we restrict our hyperparameter search for each task to $\hat { \lambda } _ { d } = \{ 0 , 1 0 ^ { - 2 } \} , \lambda _ { s } = \{ 0 , 1 \} , \lambda _ { t } = \{ 1 \hat { 0 } ^ { - 2 } , 1 0 ^ { - 1 } \}$ . We fixed $\dot { \beta } = 1 0 ^ { - 2 }$ . Note that the decision to turn $( \lambda _ { d } , \lambda _ { s } )$ on or off that can often be determined a priori. A complete list of the hyperparameters is provided in Appendix B.
|
| 162 |
+
|
| 163 |
+
# 6.2 MODEL EVALUATION
|
| 164 |
+
|
| 165 |
+
<table><tr><td>Source Target</td><td>MNIST MNIST-M</td><td>SVHN MNIST</td><td>MNIST SVHN</td><td>DIGITS SVHN</td><td>SIGNS GTSRB</td><td>CIFAR STL</td><td>STL CIFAR</td></tr><tr><td>MMD (Long et al., 2015)</td><td>76.9</td><td>71.1</td><td>-</td><td>88.0</td><td>91.1</td><td>-</td><td>-</td></tr><tr><td>DANN (Ganin & Lempitsky,2015)</td><td>81.5</td><td>71.1</td><td>35.7</td><td>90.3</td><td>88.7</td><td>1</td><td>-</td></tr><tr><td>DRCN (Ghifary et al.,2016)</td><td>-</td><td>82.0</td><td>40.1</td><td></td><td>=</td><td>66.4</td><td>58.7</td></tr><tr><td>DSN (Bousmalis et al.,2016b)</td><td>83.2</td><td>82.7</td><td>-</td><td>91.2</td><td>93.1</td><td>1</td><td>-</td></tr><tr><td>kNN-Ad (Sener et al., 2016)</td><td>86.7</td><td>78.8</td><td>40.3</td><td>-</td><td>1</td><td>=</td><td>-</td></tr><tr><td>PixelDA (Bousmalis etal., 2016a)</td><td>98.2 94.2</td><td>-</td><td>=</td><td>=</td><td>-</td><td>=</td><td>=</td></tr><tr><td>ATT (Saito et al., 2017) II-model (aug) (French et al.,2017)</td><td>-</td><td>86.2</td><td>52.8</td><td>92.9</td><td>96.2</td><td>-</td><td>1</td></tr><tr><td></td><td></td><td>92.0</td><td>71.4</td><td>94.2</td><td>98.4</td><td>76.3</td><td>64.2</td></tr><tr><td colspan="8">Without Instance-Normalized Input:</td></tr><tr><td>Source-Only</td><td>58.5</td><td>77.0</td><td>27.9</td><td>86.9</td><td>79.6</td><td>76.3</td><td>63.6</td></tr><tr><td>VADA</td><td>97.7</td><td>97.9</td><td>47.5</td><td>94.8</td><td>98.8</td><td>80.0</td><td>73.5</td></tr><tr><td>DIRT-T</td><td>98.9</td><td>99.4</td><td>54.5</td><td>96.1</td><td>99.5</td><td>=</td><td>75.3</td></tr><tr><td colspan="8">With Instance-Normalized Input:</td></tr><tr><td>Source-Only</td><td>59.9</td><td>82.4</td><td>40.9</td><td>88.6</td><td>86.2</td><td>77.0</td><td>62.6</td></tr><tr><td>VADA</td><td>95.7</td><td>94.5</td><td>73.3</td><td>94.9</td><td>99.2</td><td>78.3</td><td>71.4</td></tr><tr><td>DIRT-T</td><td>98.7</td><td>99.4</td><td>76.5</td><td>96.2</td><td>99.6</td><td>1</td><td>73.3</td></tr></table>
|
| 166 |
+
|
| 167 |
+
Table 1: Test set accuracy on visual domain adaptation benchmarks. In all settings, both VADA and DIRT-T achieve state-of-the-art performance in all settings.
|
| 168 |
+
|
| 169 |
+
$\mathbf { M N I S T } \to \mathbf { M N I S T - M }$ . We first evaluate the adaptation from MNIST to MNIST-M. MNIST-M is constructed by blending MNIST digits with random color patches from the BSDS500 dataset.
|
| 170 |
+
|
| 171 |
+
$\mathbf { M N I S T } \mathbf { S V H N }$ . The distribution shift is exacerbated when adapting between MNIST and SVHN. Whereas MNIST consists of black-and-white handwritten digits, SVHN consists of crops of colored, street house numbers. Because MNIST has a significantly lower intrinsic dimensionality that SVHN, the adaptation from M $\mathrm { I N I S T } \to \mathrm { S V H N }$ is especially challenging when the input is not pre-processed via instance normalization. When instance normalization is applied, we achieve a strong state-ofthe-art performance $7 6 . 5 \%$ and an equally impressive margin-of-improvement over source-only of $3 5 . 6 \%$ . Interestingly, by reducing the refinement interval $B$ and taking noisier natural gradient steps, we were occasionally able to achieve accuracies as high as $8 7 \%$ . However, due to the high-variance associated with this, we omit reporting this configuration in Table 1.
|
| 172 |
+
|
| 173 |
+
SYN DIGITS ${ \bf \Gamma } \to { \bf S V H N }$ . The adaptation from SYN DIGITS $\mathrm { \Phi } \mathrm { \stackrel { . } { \to } } \mathrm { S V H N }$ reflect a common adaptation problem of transferring from synthetic images to real images. The SYN DIGITS dataset consist of 500000 images generated from Windows fonts by varying the text, positioning, orientation, background, stroke color, and the amount of blur.
|
| 174 |
+
|
| 175 |
+
SYN SIGNS GTSRB. This setting provides an additional demonstration of adapting from synthetic images to real images. Unlike SYN DIGITS $ \mathrm { S V H N }$ , SYN SIGNS GTSRB contains 43 classes instead of 10.
|
| 176 |
+
|
| 177 |
+
$\mathbf { S T L } \mathbf { C I F A R }$ . Both STL-10 and CIFAR-10 are 10-class image datasets. These two datasets contain nine overlapping classes. Following the procedure in French et al. (2017), we removed the non-overlapping classes (“frog” and “monkey”) and reduce to a 9-class classification problem. We achieve state-of-the-art performance in both adaptation directions. In S $\mathrm { T L } \mathrm { C }$ IFAR, we achieve a $1 1 . 7 \%$ margin-of-improvement and a performance accuracy of $7 3 . 3 \%$ . Note that because STL-10 contains a very small training set, it is difficult to estimate the conditional entropy, thus making DIRT-T unreliable for CIFAR $ \mathrm { S T L }$ .
|
| 178 |
+
|
| 179 |
+
<table><tr><td>Source Target</td><td>Room A Room B</td></tr><tr><td colspan="2">With Instance-Normalized Input:</td></tr><tr><td>Source-Only</td><td>35.7</td></tr><tr><td>DANN</td><td>38.0</td></tr><tr><td>VADA</td><td>53.0</td></tr><tr><td>DIRT-T</td><td>53.0</td></tr></table>
|
| 180 |
+
|
| 181 |
+
Table 2: Results of the domain adaptation experiments on Wi-Fi Activity Recognition Task
|
| 182 |
+
|
| 183 |
+
Wi-Fi Activity Recognition. To evaluate the performance of our models on a non-visual domain adaptation task, we applied VADA and DIRT-T to the Wi-Fi Activity Recognition Dataset (Yousefi et al., 2017). The Wi-Fi Activity Recognition Dataset is a classification task that takes the WiFi Channel State Information (CSI) data stream as input $x$ to predict motion activity within an indoor area as output $y$ . Domain adaptation is necessary when the training and testing data are collected from different rooms, which we denote as Rooms A and B. Table 2 shows that VADA significantly improves classification accuracy compared to Source-Only and DANN by $1 7 . 3 \%$ and $1 \bar { 5 } \%$ respectively. However, DIRT-T does not lead to further improvements on this dataset. We perform experiments in Appendix F which suggests that VADA already achieves strong clustering in the target domain for this dataset, and therefore DIRT-T is not expected to yield further performance improvement.
|
| 184 |
+
|
| 185 |
+
<table><tr><td>Source Target</td><td>MNIST MNIST-M</td><td>SVHN MNIST</td><td>MNIST SVHN</td><td>DIGITS SVHN</td><td>SIGNS GTSRB</td><td>CIFAR STL</td><td>STL CIFAR</td></tr><tr><td>ATT</td><td>37.1</td><td>16.1</td><td>17.9</td><td>9.0</td><td>20.5</td><td>-</td><td>-</td></tr><tr><td>II-model (aug)</td><td>-</td><td>3.7</td><td>18.1</td><td>10.6</td><td>1.0</td><td>4.5</td><td>7.4</td></tr><tr><td>DIRT-T</td><td>40.4</td><td>22.4</td><td>26.6</td><td>9.2</td><td>19.9</td><td>-</td><td>11.7</td></tr><tr><td>DIRT-T (W.I.N.I.)</td><td>38.8</td><td>17.0</td><td>35.6</td><td>7.6</td><td>13.4</td><td>-</td><td>10.7</td></tr></table>
|
| 186 |
+
|
| 187 |
+
Table 3: Additional comparison of the margin of improvement computed by taking the reported performance of each model and subtracting the reported source-only performance in the respective papers. W.I.N.I. indicates “with instance-normalized input.”
|
| 188 |
+
|
| 189 |
+
Overall. We achieve state-of-the-art results across all tasks. For a fairer comparison against ATT and the Π-model, Table 3 provides the improvement margin over the respective source-only performance reported in each paper. In four of the tasks (MNIST MNIST-M, $\mathrm { S V H N } \to \mathrm { M N I S T }$ , MNIST → SVHN, $\mathrm { S T L } \to \mathbf { C I F A R } )$ , we achieve substantial margin of improvement compared to previous models. In the remaining three tasks, our improvement margin over the source-only model is competitive against previous models. Our closest competitor is the Π-model. However, unlike the Π-model, we do not perform data augmentation.
|
| 190 |
+
|
| 191 |
+
It is worth noting that DIRT-T consistently improves upon VADA. Since DIRT-T operates by incrementally pushing the decision boundaries away from the target domain data, it relies heavily on the cluster assumption. DIRT-T’s empirical success therefore demonstrates the effectiveness of leveraging the cluster assumption in unsupervised domain adaptation with deep neural networks.
|
| 192 |
+
|
| 193 |
+
# 6.3 ANALYSIS OF VADA AND DIRT-T
|
| 194 |
+
|
| 195 |
+
# 6.3.1 ROLE OF VIRTUAL ADVERSARIAL TRAINING
|
| 196 |
+
|
| 197 |
+
To study the relative contribution of the virtual adversarial training in the VADA and DIRT-T objectives (Eq. (8) and Eq. (14) respectively), we perform an extensive ablation analysis in Table 4. The removal of the virtual adversarial training component is denoted by the “no-vat” subscript. Our results show that $\mathrm { \Delta V A D A _ { n o - V a t } }$ is sufficient for out-performing DANN in all but one task. The further ability for DIRT- $\scriptstyle \mathrm { { T } _ { n o - v a t } }$ to improve upon $\mathrm { \Delta V A D A _ { n o - V a t } }$ demonstrates the effectiveness of conditional entropy minimization. Ultimately, in six of the seven tasks, both virtual adversarial training and conditional entropy minimization are essential for achieving the best performance. The empirical importance of incorporating virtual adversarial training shows that the locally-Lipschitz constraint is beneficial for pushing the classifier decision boundaries away from data.
|
| 198 |
+
|
| 199 |
+
<table><tr><td>Source Target</td><td>MNIST MNIST-M</td><td>SVHN MNIST</td><td>MNIST SVHN</td><td>DIGITS SVHN</td><td>SIGNS GTSRB</td><td>CIFAR STL</td><td>STL CIFAR</td></tr><tr><td colspan="8">With Instance-Normalized Input:</td></tr><tr><td>Source-Only</td><td>59.9</td><td>82.4</td><td>40.9</td><td>88.6</td><td>86.2</td><td>77.0</td><td>62.6</td></tr><tr><td>DANN (our implementation)</td><td>94.6</td><td>68.3</td><td>60.6</td><td>90.1</td><td>97.5</td><td>78.1</td><td>62.7</td></tr><tr><td>VADAno-vat</td><td>93.8</td><td>83.1</td><td>66.8</td><td>93.4</td><td>98.4</td><td>79.1</td><td>68.6</td></tr><tr><td>VADAno-vat→DIRT-Tno-vat</td><td>94.8</td><td>96.3</td><td>68.6</td><td>94.4</td><td>99.1</td><td>-</td><td>69.2</td></tr><tr><td>VADAno-vat →DIRT-T</td><td>98.3</td><td>99.4</td><td>69.8</td><td>95.3</td><td>99.6</td><td>-</td><td>71.0</td></tr><tr><td>VADA</td><td>95.7</td><td>94.5</td><td>73.3</td><td>94.9</td><td>99.2</td><td>78.3</td><td>71.4</td></tr><tr><td>VADA →DIRT-T</td><td>98.7</td><td>99.4</td><td>76.5</td><td>96.2</td><td>99.6</td><td>-</td><td>73.3</td></tr></table>
|
| 200 |
+
|
| 201 |
+
Table 4: Test set accuracy in ablation experiments, starting from the DANN model. The “no-vat” subscript denote models where the virtual adversarial training component is removed.
|
| 202 |
+
|
| 203 |
+
# 6.3.2 ROLE OF TEACHER MODEL IN DIRT-T
|
| 204 |
+
|
| 205 |
+

|
| 206 |
+
Figure 4: Comparing model behavior with and without the application of the KL-term. At iteration 0, we begin with the VADA initialization and apply the DIRT-T algorithm.
|
| 207 |
+
|
| 208 |
+
When considering Eq. (14), it is natural to ask whether defining the neighborhood with respect to the classifier is truly necessary. In Figure 4, we demonstrate in $\mathrm { S V H N } \to \mathrm { M N I S T }$ and $\mathrm { S T L } \to \mathrm { C I F A R }$ that removal of the KL-term negatively impacts the model. Since the MNIST data manifold is low-dimensional and contains easily identifiable clusters, applying naive gradient descent (Eq. (12)) can also boost the test accuracy during initial training. However, without the KL constraint, the classifier can sometimes deviate significantly from the neighborhood of the previous classifier, and the resulting spikes in the KL-term correspond to sharp drops in target test accuracy. In $\mathrm { S T L } $ CIFAR, where the data manifold is much more complex and contains less obvious clusters, naive gradient descent causes immediate decline in the target test accuracy.
|
| 209 |
+
|
| 210 |
+
# 6.3.3 VISUALIZATION OF REPRESENTATION
|
| 211 |
+
|
| 212 |
+

|
| 213 |
+
Figure 5: T-SNE plot of the last hidden layer for MNIST (blue) $ \mathrm { S V H N }$ (red). We used the model without instance normalization to highlight the further improvement that DIRT-T provides.
|
| 214 |
+
|
| 215 |
+
We further analyze the behavior of VADA and DIRT-T by showing T-SNE embeddings of the last hidden layer of the model trained to adapt from MNIST $ { \mathrm { S V H N } }$ . In Figure 5, source-only training shows strong clustering of the MNIST samples (blue) and performs poorly on SVHN (red). VADA offers significant improvement and exhibits signs of clustering on SVHN. DIRT-T begins with the VADA initialization and further enhances the clustering, resulting in the best performance on MNIST $ \mathrm { S V H N }$ .
|
| 216 |
+
|
| 217 |
+
6.4 DOMAIN ADVERSARIAL TRAINING: LAYER ABLATION
|
| 218 |
+
|
| 219 |
+
<table><tr><td></td><td colspan="3">DANN</td><td colspan="3">VADA</td></tr><tr><td>Layer</td><td>JSD ≥</td><td>Source Accuracy</td><td>Target Accuracy</td><td>JSD ≥</td><td>Source Accuracy</td><td>Target Accuracy</td></tr><tr><td>L-0</td><td>0.001</td><td>78.0</td><td>24.7</td><td>0.001</td><td>24.9</td><td>18.4</td></tr><tr><td>L-1</td><td>0.002</td><td>98.6</td><td>35.0</td><td>0.007</td><td>12.0</td><td>11.6</td></tr><tr><td>L-2</td><td>0.353</td><td>16.4</td><td>10.3</td><td>0.383</td><td>11.5</td><td>9.9</td></tr><tr><td>L-3</td><td>0.036</td><td>94.8</td><td>33.8</td><td>0.034</td><td>67.8</td><td>37.1</td></tr><tr><td>L-4</td><td>0.012</td><td>97.0</td><td>40.0</td><td>0.020</td><td>96.8</td><td>61.5</td></tr><tr><td>L-5</td><td>0.235</td><td>99.3</td><td>57.9</td><td>0.244</td><td>99.4</td><td>73.3</td></tr><tr><td>L-6</td><td>0.486</td><td>99.2</td><td>60.3</td><td>0.509</td><td>99.3</td><td>70.4</td></tr><tr><td>L-7</td><td>0.644</td><td>99.0</td><td>52.5</td><td>0.608</td><td>99.1</td><td>70.5</td></tr></table>
|
| 220 |
+
|
| 221 |
+
Table 5: Comparison of model behavior when domain adversarial training is applied to various layers. We denote the very last (simplex) layer of the neural network as $L$ and ablatively domain adversarial training to the last eight layers. A lower bound on the Jensen-Shannon Divergence is computed by training a logistic regression model to predict domain origin when given the layer embeddings.
|
| 222 |
+
|
| 223 |
+
In Table 5, we applied domain adversarial training to various layers of a Domain Adversarial Neural Network (Ganin & Lempitsky, 2015) trained to adapt MNIST $ { \mathrm { S V H N } }$ . With the exception of layers $L - 2$ and $L - 0$ , which experienced training instability, the general observation is that as the layer gets deeper, the additional capacity of the corresponding embedding function allows better matching of the source and target distributions without hurting source generalization accuracy. This demonstrates that the combination of low divergence and high source accuracy does not imply better adaptation to the target domain. Interestingly, when the classifier is regularized to be locally-Lipschitz via VADA, the combination of low divergence and high source accuracy appears to correlate more strongly with better adaptation.
|
| 224 |
+
|
| 225 |
+
# 7 CONCLUSION
|
| 226 |
+
|
| 227 |
+
In this paper, we presented two novel models for domain adaptation inspired by the cluster assumption. Our first model, VADA, performs domain adversarial training with an added term that penalizes violations of the cluster assumption. Our second model, DIRT-T, is an extension of VADA that recursively refines the VADA classifier by untethering the model from the source training signal and applying approximate natural gradients to further minimize the cluster assumption violation. Our experiments demonstrate the effectiveness of the cluster assumption: VADA achieves strong performance across several domain adaptation benchmarks, and DIRT-T further improves VADA performance. Our proposed models open up several possibilities for future work. One possibility is to apply DIRT-T to weakly supervised learning; another is to improve the natural gradient approximation via K-FAC (Martens & Grosse, 2015) and PPO (Schulman et al., 2017). Given the strong performance of our models, we also recommend them for other downstream domain adaptation applications.
|
| 228 |
+
|
| 229 |
+
# ACKNOWLEDGMENTS
|
| 230 |
+
|
| 231 |
+
We gratefully acknowledge funding from Adobe, NSF (grants #1651565, #1522054, #1733686), Toyota Research Institute, Future of Life Institute, and Intel. We also thank Daniel Levy, Shengjia Zhao, and Jiaming Song for insightful discussions, and the anonymous reviewers for their helpful comments and suggestions.
|
| 232 |
+
|
| 233 |
+
# REFERENCES
|
| 234 |
+
|
| 235 |
+
Shai Ben-David and Ruth Urner. Domain adaptation–can quantity compensate for quality? Annals of Mathematics and Artificial Intelligence, 70(3):185–202, 2014.
|
| 236 |
+
|
| 237 |
+
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, 2010a.
|
| 238 |
+
|
| 239 |
+
Shai Ben-David, Tyler Lu, Teresa Luu, and David P ´ al. Impossibility theorems for domain adap- ´ tation. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, pp. 129–136, 2010b.
|
| 240 |
+
|
| 241 |
+
Konstantinos Bousmalis, Nathan Silberman, David Dohan, Dumitru Erhan, and Dilip Krishnan. Unsupervised pixel-level domain adaptation with generative adversarial networks. arXiv preprint arXiv:1612.05424, 2016a.
|
| 242 |
+
|
| 243 |
+
Konstantinos Bousmalis, George Trigeorgis, Nathan Silberman, Dilip Krishnan, and Dumitru Erhan. Domain separation networks. In Advances in Neural Information Processing Systems, pp. 343– 351, 2016b.
|
| 244 |
+
|
| 245 |
+
Olivier Chapelle and Alexander Zien. Semi-supervised classification by low density separation. In AISTATS, pp. 57–64, 2005.
|
| 246 |
+
|
| 247 |
+
Zihang Dai, Zhilin Yang, Fan Yang, William W Cohen, and Ruslan Salakhutdinov. Good semisupervised learning that requires a bad gan. arXiv preprint arXiv:1705.09783, 2017.
|
| 248 |
+
|
| 249 |
+
William Fedus, Mihaela Rosca, Balaji Lakshminarayanan, Andrew M Dai, Shakir Mohamed, and Ian Goodfellow. Many paths to equilibrium: Gans do not need to decrease adivergence at every step. arXiv preprint arXiv:1710.08446, 2017.
|
| 250 |
+
|
| 251 |
+
Geoffrey French, Michal Mackiewicz, and Mark Fisher. Self-ensembling for domain adaptation. arXiv preprint arXiv:1706.05208, 2017.
|
| 252 |
+
|
| 253 |
+
Yaroslav Ganin and Victor Lempitsky. Unsupervised domain adaptation by backpropagation. In International Conference on Machine Learning, pp. 1180–1189, 2015.
|
| 254 |
+
|
| 255 |
+
Muhammad Ghifary, W Bastiaan Kleijn, Mengjie Zhang, David Balduzzi, and Wen Li. Deep reconstruction-classification networks for unsupervised domain adaptation. In European Conference on Computer Vision, pp. 597–613. Springer, 2016.
|
| 256 |
+
|
| 257 |
+
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.
|
| 258 |
+
|
| 259 |
+
Yves Grandvalet and Yoshua Bengio. Semi-supervised learning by entropy minimization. In Advances in neural information processing systems, pp. 529–536, 2005.
|
| 260 |
+
|
| 261 |
+
Jiayuan Huang, Arthur Gretton, Karsten M Borgwardt, Bernhard Scholkopf, and Alex J Smola. ¨ Correcting sample selection bias by unlabeled data. In Advances in neural information processing systems, pp. 601–608, 2007.
|
| 262 |
+
|
| 263 |
+
Samuli Laine and Timo Aila. Temporal ensembling for semi-supervised learning. arXiv preprint arXiv:1610.02242, 2016.
|
| 264 |
+
|
| 265 |
+
Dong-Hyun Lee. Pseudo-label: The simple and efficient semi-supervised learning method for deep neural networks. In Workshop on Challenges in Representation Learning, ICML, volume 3, pp. 2, 2013.
|
| 266 |
+
|
| 267 |
+
Mingsheng Long, Yue Cao, Jianmin Wang, and Michael Jordan. Learning transferable features with deep adaptation networks. In International Conference on Machine Learning, pp. 97–105, 2015.
|
| 268 |
+
|
| 269 |
+
Yishay Mansour, Mehryar Mohri, and Afshin Rostamizadeh. Domain adaptation: Learning bounds and algorithms. arXiv preprint arXiv:0902.3430, 2009.
|
| 270 |
+
|
| 271 |
+
James Martens and Roger Grosse. Optimizing neural networks with kronecker-factored approximate curvature. In International Conference on Machine Learning, pp. 2408–2417, 2015.
|
| 272 |
+
|
| 273 |
+
Takeru Miyato, Andrew M Dai, and Ian Goodfellow. Virtual adversarial training for semi-supervised text classification. stat, 1050:25, 2016.
|
| 274 |
+
|
| 275 |
+
Takeru Miyato, Shin-ichi Maeda, Masanori Koyama, and Shin Ishii. Virtual adversarial training: a regularization method for supervised and semi-supervised learning. arXiv preprint arXiv:1704.03976, 2017.
|
| 276 |
+
|
| 277 |
+
Razvan Pascanu and Yoshua Bengio. Revisiting natural gradient for deep networks. arXiv preprint arXiv:1301.3584, 2013.
|
| 278 |
+
|
| 279 |
+
Boris T Polyak and Anatoli B Juditsky. Acceleration of stochastic approximation by averaging. SIAM Journal on Control and Optimization, 30(4):838–855, 1992.
|
| 280 |
+
|
| 281 |
+
Scott Reed, Honglak Lee, Dragomir Anguelov, Christian Szegedy, Dumitru Erhan, and Andrew Rabinovich. Training deep neural networks on noisy labels with bootstrapping. arXiv preprint arXiv:1412.6596, 2014.
|
| 282 |
+
|
| 283 |
+
Kuniaki Saito, Yoshitaka Ushiku, and Tatsuya Harada. Asymmetric tri-training for unsupervised domain adaptation. arXiv preprint arXiv:1702.08400, 2017.
|
| 284 |
+
|
| 285 |
+
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
|
| 286 |
+
|
| 287 |
+
Ozan Sener, Hyun Oh Song, Ashutosh Saxena, and Silvio Savarese. Learning transferrable representations for unsupervised domain adaptation. In Advances in Neural Information Processing Systems, pp. 2110–2118, 2016.
|
| 288 |
+
|
| 289 |
+
Hidetoshi Shimodaira. Improving predictive inference under covariate shift by weighting the loglikelihood function. Journal of statistical planning and inference, 90(2):227–244, 2000.
|
| 290 |
+
|
| 291 |
+
Baochen Sun and Kate Saenko. From virtual to reality: Fast adaptation of virtual object detectors to real domains. In BMVC, volume 1, pp. 3, 2014.
|
| 292 |
+
|
| 293 |
+
Antti Tarvainen and Harri Valpola. Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. 2017.
|
| 294 |
+
|
| 295 |
+
Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. Instance normalization: The missing ingredient for fast stylization. arXiv preprint arXiv:1607.08022, 2016.
|
| 296 |
+
|
| 297 |
+
David Vazquez, Antonio M Lopez, Javier Marin, Daniel Ponsa, and David Geronimo. Virtual and real world adaptation for pedestrian detection. IEEE transactions on pattern analysis and machine intelligence, 36(4):797–809, 2014.
|
| 298 |
+
|
| 299 |
+
Siamak Yousefi, Hirokazu Narui, Sankalp Dayal, Stefano Ermon, and Shahrokh Valaee. A survey on behavior recognition using wifi channel state information. IEEE Communications Magazine, 55(10):98–104, 2017.
|
| 300 |
+
|
| 301 |
+
Zhi-Hua Zhou and Ming Li. Tri-training: Exploiting unlabeled data using three classifiers. IEEE Transactions on knowledge and Data Engineering, 17(11):1529–1541, 2005.
|
| 302 |
+
|
| 303 |
+
Xiaojin Zhu. Semi-supervised learning literature survey. 2005.
|
| 304 |
+
|
| 305 |
+
# A ARCHITECTURES
|
| 306 |
+
|
| 307 |
+
Table 6: Small and Large CNN architectures. Leaky ReLU parameter $a = 0 . 1$ . All convolutional and dense layers in the classifier are pre-activation batch-normalized. All images are resized to $3 2 \times$ $3 2 \times 3$ . Note the use of additive Gaussian noise: this addition was motivated by initial experiments in which we observed that domain adversarial training appears to contract the feature space.
|
| 308 |
+
|
| 309 |
+
<table><tr><td>Layer Index</td><td>Small CNN Large CNN</td></tr><tr><td>L-18 一</td><td>32× 32×3Image</td></tr><tr><td>L-17 1</td><td>Instance Normalization (optional)</td></tr><tr><td>L-16</td><td>3 × 3 conv. 64 IReLU 3 × 3 conv. 96 IReLU</td></tr><tr><td>L-15</td><td>3 × 3 conv. 64 IReLU 3 × 3 conv. 96 IReLU</td></tr><tr><td>L-14</td><td>3 × 3 conv. 64 IReLU 3 × 3 conv. 96 lReLU</td></tr><tr><td>L-13</td><td>2 x 2 max-pool, stride 2</td></tr><tr><td>L-12</td><td>dropout, p = 0.5</td></tr><tr><td>L-11</td><td>Gaussian noise,σ = 1</td></tr><tr><td>L-10</td><td>3 × 3 conv. 64 IReLU 3 × 3 conv. 192 IReLU</td></tr><tr><td>L-9</td><td>3 × 3 conv. 64 IReLU 3 × 3 conv. 192 IReLU</td></tr><tr><td>L-8</td><td>3 × 3 conv. 64 IReLU 3 × 3 conv. 192 IReLU</td></tr><tr><td>L-7</td><td>2 x 2 max-pool, stride 2</td></tr><tr><td>L-6</td><td>dropout, p = 0.5</td></tr><tr><td>L-5</td><td>Gaussian noise,σ = 1</td></tr><tr><td>L-4</td><td>3 × 3 conv. 64 IReLU 3 × 3 conv. 192 IReLU</td></tr><tr><td>L-3</td><td>3× 3 conv. .64IReLU 3 × 3 conv. 192 IReLU</td></tr><tr><td>L-2</td><td>3 × 3 conv. 64 lReLU 3 × 3 conv. 192 IReLU</td></tr><tr><td>L-1</td><td>global average pool</td></tr><tr><td></td><td></td></tr><tr><td>L-0</td><td>10 dense, softmax</td></tr></table>
|
| 310 |
+
|
| 311 |
+
Table 7: Domain discriminator architecture.
|
| 312 |
+
|
| 313 |
+
<table><tr><td>Domain Discriminator</td></tr><tr><td>Layer L-5 Output</td></tr><tr><td>100 dense,ReLU</td></tr><tr><td>1 dense, sigmoid</td></tr></table>
|
| 314 |
+
|
| 315 |
+
# B HYPERPARAMETERS
|
| 316 |
+
|
| 317 |
+
We observed that extensive hyperparameter-tuning is not necessary to achieve state-of-the-art performance. To demonstrate this, we restrict our hyperparameter search for each task to $\lambda _ { d } ~ =$ $\{ 0 , 1 0 ^ { - 2 } \} , \lambda _ { s } = \{ 0 , 1 \} , \lambda _ { t } = \{ 1 0 ^ { - 2 } , 1 0 ^ { - 1 } \}$ , in all experiments with instance-normalized inputs. We fixed $\beta = 1 0 ^ { - 2 }$ . Note that the decision to turn $( \lambda _ { d } , \lambda _ { s } )$ on or off that can often be determined a priori based on prior belief regarding the extent to covariate shift. In the absence of such prior belief, a reliable choice is $( \lambda _ { d } = \mathsf { \breve { { 1 0 } } ^ { - 2 } } , \mathsf { \breve { { \lambda } } } _ { s } = 1 , \lambda _ { t } = 1 0 ^ { - 2 } , \beta = 1 0 ^ { - 2 } )$ .
|
| 318 |
+
|
| 319 |
+
<table><tr><td>Task</td><td>Instance-Normalized</td><td>入d</td><td>入s</td><td>\t</td><td>β</td></tr><tr><td>MNIST→MNIST-M</td><td>Yes,No</td><td>10-2</td><td>0</td><td>10-2</td><td>10-2</td></tr><tr><td>SVHN→MNIST</td><td>Yes,No</td><td>10-2</td><td>0</td><td>10-2</td><td>10-2</td></tr><tr><td>MNIST→SVHN</td><td>Yes</td><td>10-2</td><td>1</td><td>10-2</td><td>10-2</td></tr><tr><td>MNIST→SVHN</td><td>No</td><td>10-2</td><td>1</td><td>10-2</td><td>10-3</td></tr><tr><td>DIGITS→SVHN</td><td>Yes,No</td><td>10- -2</td><td>1</td><td>10-1</td><td>10-2</td></tr><tr><td>SIGNS →GTSRB</td><td>Yes,No</td><td>10-2</td><td>1</td><td>10-2</td><td>10-2</td></tr><tr><td>CIFAR→STL</td><td>Yes,No</td><td>0</td><td>1</td><td>10-1</td><td>10-2</td></tr><tr><td>STL→CIFAR</td><td>Yes,No</td><td>0</td><td>0</td><td>10-1</td><td>10-2</td></tr><tr><td>Room A→B</td><td>Yes</td><td>0</td><td>0</td><td>10-2</td><td>10-2</td></tr></table>
|
| 320 |
+
|
| 321 |
+
Table 8: Hyperparameters for each task, both with and without instance-normalized input. The only exception is $\mathrm { M N I S T } \to \mathrm { S V H N }$ without instance-normalized input. In this specific case, $d _ { \mathcal { H } \Delta \mathcal { H } }$ is sufficiently large that conditional entropy minimization quickly finds a degenerate solution in the target domain. To counter this, we remove conditional entropy minimization (but keep the target-side virtual adversarial training) only during VADA. We apply target-side conditional entropy minimization and virtual adversarial training during DIRT-T. To compensate, we use a lower $\beta$ during the DIRT-T phase to allow for larger natural gradient steps.
|
| 322 |
+
|
| 323 |
+
When the target domain is MNIST/MNIST-M, the task is sufficiently simple that we only allocate $B = 5 0 0$ iterations to each optimization problem in Eq. (14). In all other cases, we set the refinement interval $B = 5 0 0 0$ . We apply Adam Optimizer (learning rate $= 0 . 0 0 1 , \beta _ { 1 } = 0 . 5 , \beta _ { 2 } = 0 . 9 9 9 )$ with Polyak averaging (more accurately, we apply an exponential moving average with momentum $= \ 0 . 9 9 8$ to the parameter trajectory). VADA was trained for 80000 iterations and DIRT-T takes VADA as initialization and was trained for $\{ 2 0 0 0 0 , 4 0 0 0 0 , 6 0 0 0 0 , 8 0 0 0 0 \}$ iterations, with number of iterations chosen as hyperparameter.
|
| 324 |
+
|
| 325 |
+
# C REPLACING GRADIENT REVERSAL
|
| 326 |
+
|
| 327 |
+
We note from Goodfellow et al. (2014) that the gradient of $\nabla _ { \theta } \ln ( 1 - D ( f _ { \theta } ( x ) ) )$ is tends to have smaller norm than $- \nabla _ { \theta } \ln D ( f _ { \theta } ( x ) )$ during initial training since the latter rescales the gradient by $1 / D ( f _ { \theta } ( x ) )$ . Following this observation, we replace the gradient reversal procedure with alternating minimization of
|
| 328 |
+
|
| 329 |
+
$$
|
| 330 |
+
\begin{array} { r l } & { \underset { D } { \mathop { \operatorname* { m i n } } } - \mathbb { E } _ { x \sim \mathcal { D } _ { s } } \left[ \ln D ( f _ { \theta } ( x ) ) \right] - \mathbb { E } _ { x \sim \mathcal { D } _ { t } } \left[ \ln 1 - D ( f _ { \theta } ( x ) ) \right] } \\ & { \underset { \theta } { \mathop { \operatorname* { m i n } } } - \mathbb { E } _ { x \sim \mathcal { D } _ { t } } \left[ \ln D ( f _ { \theta } ( x ) ) \right] - \mathbb { E } _ { x \sim \mathcal { D } _ { s } } \left[ \ln 1 - D ( f _ { \theta } ( x ) ) \right] . } \end{array}
|
| 331 |
+
$$
|
| 332 |
+
|
| 333 |
+
The choice of using gradient reversal versus alternating minimization reflects a difference in choice of approximating the mini-max using saturating versus non-saturating optimization (Fedus et al., 2017). In some of our initial experiments, we observed the replacement of gradient reversal with alternating minimization stabilizes domain adversarial training. However, we encourage practitioners to try either optimization strategy when applying VADA.
|
| 334 |
+
|
| 335 |
+
# D INSTANCE NORMALIZATION FOR DOMAIN ADAPTATION
|
| 336 |
+
|
| 337 |
+
Theorem 1 suggests that we should identify ways of constraining the hypothesis space without hurting the global optimal classifier for the joint task. We propose to further constrain our model by
|
| 338 |
+
|
| 339 |
+
introducing instance normalization as an image pre-processing step for the input data. Instance normalization was proposed for style transfer Ulyanov et al. (2016) and applies the operation
|
| 340 |
+
|
| 341 |
+
$$
|
| 342 |
+
\ell ( x ^ { ( i ) } ) = \frac { x ^ { ( i ) } - \mu ( x ^ { ( i ) } ) } { \sigma ( x ^ { ( i ) } ) } ,
|
| 343 |
+
$$
|
| 344 |
+
|
| 345 |
+
where $\boldsymbol { x } ^ { ( i ) } \in \mathbb { R } ^ { H \times W \times C }$ denotes the $i ^ { \mathrm { { t h } } }$ sample with $( H , W , C )$ corresponding to the height, width, ∈ and channel dimensions, and where $\mu , \sigma : \dot { \mathbb R } ^ { H \times W \times C } \mathbb R ^ { C }$ are functions that compute the mean and standard deviation across the spatial dimensions. A notable property of instance normalization is that it is invariant to channel-wide scaling and shifting of the input elements. Formally, consider scaling and shift variables $\gamma , \beta \in \mathbb { R } ^ { C }$ . If $\gamma \succ 0$ and $\sigma ( x ^ { ( i ) } ) \succ 0$ , then
|
| 346 |
+
|
| 347 |
+
$$
|
| 348 |
+
\ell ( x ^ { ( i ) } ) = \ell ( \gamma x ^ { ( i ) } + \beta ) .
|
| 349 |
+
$$
|
| 350 |
+
|
| 351 |
+
For visual data the application of instance normalization to the input layer makes the classifier invariant to channel-wide shifts and scaling of the pixel intensities. For most visual tasks, sensitivity to channel-wide pixel intensity changes is not critical to the success of the classifier. As such, instance normalization of the input may help reduce $d _ { \mathcal { H } \Delta \mathcal { H } }$ without hurting the globally optimal classifier. Interestingly, Figure 3 shows that input instance normalization is not equivalent to gray-scaling, since color is partially preserved. To test the effect of instance normalization, we report results both with and without the use of instance-normalized inputs.
|
| 352 |
+
|
| 353 |
+
# E LIMITATION OF DOMAIN ADVERSARIAL TRAINING
|
| 354 |
+
|
| 355 |
+
We denote the source and target distributions respectively as $p _ { s } ( x , y )$ and $p _ { t } ( x , y )$ . Let the source covariate distribution $p _ { s } ( x )$ define the random variable $X _ { s }$ that have support $\mathrm { s u p p } ( X _ { s } ) = \mathcal { X } _ { s }$ and let $( X _ { t } , \mathcal { X } _ { t } )$ be analogously defined for the target domain. Both $\mathcal { X } _ { s }$ and $\mathcal { X } _ { t }$ are subsets of $\mathbb { R } ^ { n }$ . Let $p _ { s } ( y )$ and $p _ { t } ( y )$ define probabilities over the support $\mathcal { V } = \{ 1 , \ldots , K \}$ . We consider any embedding function $f : \mathbb { R } ^ { n } \mathbb { R } ^ { m }$ , where $\mathbb { R } ^ { m }$ is the embedding space, and any embedding classifier $g : \mathbb { R } ^ { m } $ $\mathcal { C }$ , where $\mathcal { C }$ is the $( K - 1 )$ -simplex. We denote a classifier $h = g \circ f$ has the composite of an embedding function with an embedding classifier.
|
| 356 |
+
|
| 357 |
+
For simplicity, we restrict our analysis to the simple case where $K = 2$ , i.e. where $\mathcal { V } = \{ 0 , 1 \}$ .
|
| 358 |
+
Furthermore, we assume that for any $\delta \in [ 0 , 1 ]$ , there exists a subset $\Omega \subseteq \mathbb { R } ^ { n }$ where $p _ { s } ( x \in \Omega ) = \delta$ .
|
| 359 |
+
We impose a similar condition on $p _ { t } ( x )$ .
|
| 360 |
+
|
| 361 |
+
For a joint distribution $p ( x , y )$ , we denote the generalization error of a classifier as
|
| 362 |
+
|
| 363 |
+
$$
|
| 364 |
+
\epsilon _ { p } ( h ) = \mathbb { E } _ { p ( x , y ) } \left| y - h ( x ) \right| .
|
| 365 |
+
$$
|
| 366 |
+
|
| 367 |
+
Note that for a given classifier $h : \mathbb { R } ^ { n } [ 0 , 1 ]$ , the corresponding hard classifier is $k ( x ) \ =$ $\mathbb { 1 } \{ h ( x ) > 0 . 5 \}$ . We further define the set $\Omega \subseteq \mathbb { R } ^ { n }$ such that
|
| 368 |
+
|
| 369 |
+
$$
|
| 370 |
+
\Omega = \{ x \in \mathbb { R } ^ { n } \mid k ( x ) = 1 \} \iff k ( x ) = \mathbb { 1 } \{ x \in \Omega \} .
|
| 371 |
+
$$
|
| 372 |
+
|
| 373 |
+
In a slight abuse of notation, we define the generalization error $\epsilon ( \Omega )$ with respect to $\Omega$ as
|
| 374 |
+
|
| 375 |
+
$$
|
| 376 |
+
\epsilon _ { p } ( \Omega ) = \mathbb { E } _ { p ( x , y ) } \mathbb { 1 } \{ x \in \Omega \} = \epsilon ( k ) .
|
| 377 |
+
$$
|
| 378 |
+
|
| 379 |
+
An optimal $\Omega _ { p } ^ { * }$ is a partitioning of $\mathbb { R } ^ { n }$
|
| 380 |
+
|
| 381 |
+
$$
|
| 382 |
+
\epsilon _ { p } ( \Omega _ { p } ^ { * } ) = \operatorname* { m i n } _ { \Omega \subseteq \mathbb { R } ^ { n } } \epsilon _ { p } ( \Omega )
|
| 383 |
+
$$
|
| 384 |
+
|
| 385 |
+
such that generalization error under the distribution $p ( x , y )$ is minimized.
|
| 386 |
+
|
| 387 |
+
# E.1 GOOD TARGET-DOMAIN ACCURACY IS NOT GUARANTEED
|
| 388 |
+
|
| 389 |
+
Domain adversarial training seeks to find a single classifier $h$ used for both the source $p _ { s }$ and target $p _ { t }$ distributions. To do so, domain adversarial training sets up the objective
|
| 390 |
+
|
| 391 |
+
$$
|
| 392 |
+
\begin{array} { r l } & { \underset { f \in \mathcal { F } , g \in \mathcal { G } } { \operatorname* { m i n } } \ \epsilon _ { p _ { s } } ( g \circ f ) } \\ & { \qquad \mathrm { s . t . } \ g ( X _ { s } ) = g ( X _ { t } ) , } \end{array}
|
| 393 |
+
$$
|
| 394 |
+
|
| 395 |
+
where $\mathcal { F }$ and $\mathcal { G }$ are the hypothesis spaces for the embedding function and embedding classifier. Intuitively, domain adversarial training operates under the hypothesis that good source generalization error in conjunction with source-target feature matching implies good target generalization error. We shall see, however, that if $\boldsymbol { \mathcal { X } } _ { s } \cap \boldsymbol { \mathcal { X } } _ { t } = \boldsymbol { \mathcal { O } }$ and $\mathcal { F }$ is sufficiently complex, this implication does not necessarily hold.
|
| 396 |
+
|
| 397 |
+
Let $\mathcal { F }$ contain all functions mapping $\mathbb { R } ^ { n } \to \mathbb { R } ^ { m }$ , i.e. $\mathcal { F }$ has infinite capacity. Suppose $\mathcal { G }$ contains the function $g ( z ) = 1 \{ z = 1 _ { m } \}$ and $\mathcal { X } _ { s } \cap \mathcal { X } _ { t } = \mathcal { O }$ . We consider the set
|
| 398 |
+
|
| 399 |
+
$$
|
| 400 |
+
\mathcal { H } ^ { \ast } = \left\{ g \circ f | \exists g \in \mathcal { G } , f \in \mathcal { F } \mathrm { ~ s . t . ~ } \epsilon _ { p _ { s } } ( g \circ f ) \leq \epsilon _ { p _ { s } } ( \Omega _ { p _ { s } } ^ { \ast } ) , f ( X _ { s } ) = f ( X _ { t } ) \right\} .
|
| 401 |
+
$$
|
| 402 |
+
|
| 403 |
+
Such a set of classifiers satisfies the feature-matching constraint while achieving source generalization error no worse than the optimal source-domain hard classifier. It suffices to show that $\mathcal { H } ^ { \ast }$ includes hypotheses that perform poorly in the target domain.
|
| 404 |
+
|
| 405 |
+
We first show $\mathcal { H } ^ { \ast }$ is not an empty set by constructing an element of this set. Choose a partitioning $\Omega$ where
|
| 406 |
+
|
| 407 |
+
$$
|
| 408 |
+
p _ { t } ( x \in \Omega ) = p _ { s } ( x \in \Omega _ { p _ { s } } ^ { * } ) .
|
| 409 |
+
$$
|
| 410 |
+
|
| 411 |
+
Consider the embedding function
|
| 412 |
+
|
| 413 |
+
$$
|
| 414 |
+
f _ { \Omega } ( x ) = { \left\{ \begin{array} { l l } { \mathbf { 1 } _ { m } } & { { \mathrm { i f ~ } } ( x \in { \mathcal { X } } _ { s } \cap \Omega _ { p _ { s } } ^ { * } ) \lor ( x \in { \mathcal { X } } _ { t } \cap \Omega ) } \\ { \mathbf { 0 } _ { m } } & { { \mathrm { o t h e r w i s e } } . } \end{array} \right. }
|
| 415 |
+
$$
|
| 416 |
+
|
| 417 |
+
Let $g ( z ) = 1 \{ z = 1 _ { m } \}$ . It follows that the composite classifier $h _ { \Omega } = g \circ f _ { \Omega }$ is an element of $\mathcal { H } ^ { \ast }$ .
|
| 418 |
+
|
| 419 |
+
Next, we show that a classifier $h \in \mathcal { H } ^ { * }$ does not necessarily achieve good target generalization error. Consider the partitioning $\hat { \Omega }$ which solves the following optimization problem
|
| 420 |
+
|
| 421 |
+
$$
|
| 422 |
+
\begin{array} { r l } & { \underset { \Omega \subseteq \mathbb { R } ^ { n } } { \mathrm { m a x } } ~ \epsilon _ { p _ { t } } ( \Omega ) } \\ & { \mathrm { s . t . } ~ p _ { t } ( x \in \Omega ) = p _ { s } ( x \in \Omega _ { p _ { s } } ^ { * } ) . } \end{array}
|
| 423 |
+
$$
|
| 424 |
+
|
| 425 |
+
Such a partitioning $\hat { \Omega }$ is the worst-case partitioning subject to the probability mass constraint. It follows that worse case $h ^ { \prime } \in \mathcal { H } ^ { * }$ has generalization error
|
| 426 |
+
|
| 427 |
+
$$
|
| 428 |
+
\epsilon _ { p _ { t } } ( h ^ { \prime } ) = \operatorname* { m a x } _ { h \in \mathcal { H } ^ { * } } \epsilon _ { p _ { t } } ( h ) \geq \epsilon _ { p _ { t } } ( h _ { \hat { \Omega } } ) .
|
| 429 |
+
$$
|
| 430 |
+
|
| 431 |
+
To provide intuition that $\epsilon _ { p _ { t } } ( h ^ { \prime } )$ is potentially very large, consider hypothetical source and target domains where $\boldsymbol { \mathcal { X } } _ { s } \cap \boldsymbol { \mathcal { X } } _ { t } = \boldsymbol { \varpi }$ and $\bar { p _ { t } } ( x \in \Omega _ { p _ { t } } ^ { * } ) = \bar { p } _ { s } ( x \overbar { \in \Omega } _ { p _ { s } } ^ { * } ) = 0 . 5$ . The worst-case partitioning subject to the probability mass constraint is simply $\hat { \Omega } = \mathbb { R } ^ { n } \backslash \Omega _ { p _ { t } } ^ { * }$ (which flips the labels) and consequently, $\mathcal { H } ^ { \ast }$ contains solutions
|
| 432 |
+
|
| 433 |
+
$$
|
| 434 |
+
\operatorname* { m a x } _ { h \in \mathcal { H } ^ { \ast } } \epsilon _ { p _ { t } } ( h ) \geq 1 - \epsilon _ { p _ { t } } ( \Omega _ { p _ { t } } ^ { \ast } )
|
| 435 |
+
$$
|
| 436 |
+
|
| 437 |
+
no better than the worst-case partitioning of the target domain.
|
| 438 |
+
|
| 439 |
+
# E.2 CONNECTION TO THEOREM 1
|
| 440 |
+
|
| 441 |
+
Let $\mathcal { F }$ contain all functions mapping $\mathbb { R } ^ { n } \to \mathbb { R } ^ { m }$ , i.e. $\mathcal { F }$ has infinite capacity. Suppose $\mathcal { G }$ contains the function $g ( z ) = \mathbb { 1 } \{ z = \mathbf { 1 } _ { m } \}$ and $\mathcal { X } _ { s } \cap \mathcal { X } _ { t } = \mathcal { O }$ . We consider the sets
|
| 442 |
+
|
| 443 |
+
$$
|
| 444 |
+
\begin{array} { r l } & { \mathcal { H } = \left\{ g \circ f \ | \ g \in { \mathcal { G } } , f \in { \mathcal { F } } \right\} } \\ & { \bar { \mathcal { H } } = \left\{ g \circ f \ | \ \exists g \in { \mathcal { G } } , f \in { \mathcal { F } } \mathrm { ~ s . t . ~ } f ( X _ { s } ) = f ( X _ { t } ) \right\} . } \end{array}
|
| 445 |
+
$$
|
| 446 |
+
|
| 447 |
+
A justification for domain adversarial training is that the $\bar { \mathcal { H } } \Delta \bar { \mathcal { H } }$ -divergence term is smaller than the $\mathcal { H } \Delta \mathcal { H }$ -divergence, thus yielding a tighter upper bound for Theorem 1. However, we shall see that the $\bar { \mathcal { H } } \Delta \bar { \mathcal { H } }$ -divergence term is in fact maximal.
|
| 448 |
+
|
| 449 |
+
Choose partitionings $\Omega _ { s } , \Omega _ { t } \subseteq \mathbb { R } ^ { n }$ such that
|
| 450 |
+
|
| 451 |
+
$$
|
| 452 |
+
p _ { s } ( x \in \Omega _ { s } ) = p _ { t } ( x \in \Omega _ { t } ) = 0 . 5 .
|
| 453 |
+
$$
|
| 454 |
+
|
| 455 |
+
Define the embedding functions
|
| 456 |
+
|
| 457 |
+
$$
|
| 458 |
+
\begin{array} { r l } { f ( x ) = \left\{ \mathbf { 1 } _ { m } \right. } & { \mathrm { i f ~ } ( x \in \mathcal { X } _ { s } \cap \Omega _ { s } ) \vee ( x \in \mathcal { X } _ { t } \cap \Omega _ { t } ) } \\ { \mathbf { 0 } _ { m } } & { \mathrm { o t h e r w i s e } . } \end{array}
|
| 459 |
+
$$
|
| 460 |
+
|
| 461 |
+
Let ${ { g } ^ { \prime } } ( z ) = g ( z ) = \mathbb { 1 } \left\{ z = \mathbf { 1 } _ { m } \right\}$ . It follows that the composite classifiers $h = g \circ f$ and $h ^ { \prime } = g ^ { \prime } \circ f ^ { \prime }$ are elements of $\bar { \mathcal { H } }$ .
|
| 462 |
+
|
| 463 |
+
From the definition of $d _ { \mathcal { H } \Delta \mathcal { H } }$ , we see that
|
| 464 |
+
|
| 465 |
+
$$
|
| 466 |
+
\begin{array} { r l } & { d _ { \bar { \mathcal { H } } \Delta \bar { \mathcal { H } } } \geq 2 \left| \mathbb { E } _ { x \sim X _ { s } } \left[ h ( x ) \neq h ^ { \prime } ( x ) \right] - \mathbb { E } _ { x \sim X _ { t } } \left[ h ( x ) \neq h ^ { \prime } ( x ) \right] \right| } \\ & { \qquad = 2 \cdot \left| 0 - 1 \right| = 2 . } \end{array}
|
| 467 |
+
$$
|
| 468 |
+
|
| 469 |
+
The $\bar { \mathcal { H } } \Delta \bar { \mathcal { H } }$ -divergence thus achieves the maximum value of 2.
|
| 470 |
+
|
| 471 |
+
# E.3 IMPLICATIONS
|
| 472 |
+
|
| 473 |
+
Our analysis assumes infinite capacity embedding functions and the ability to solve optimization problems exactly. The empirical success of domain adversarial training suggests that the use of finite-capacity convolutional neural networks combined with stochastic gradient-based optimization provides the necessary regularization for domain adversarial training to work. The theoretical characterization of domain adversarial training in the case finite-capacity convolutional neural networks and gradient-based learning remains a challenging but important open research problem.
|
| 474 |
+
|
| 475 |
+
# F NON-VISUAL DOMAIN ADAPTATION TASK
|
| 476 |
+
|
| 477 |
+
To evaluate the performance of our models on a non-visual domain adaptation task, we applied VADA and DIRT-T to the Wi-Fi Activity Recognition Dataset (Yousefi et al., 2017). The Wi-Fi Activity Recognition Dataset is a classification task that takes the Wi-Fi Channel State Information (CSI) data stream as input $x$ to predict motion activity within an indoor area as output $y$ . The dataset collected the CSI data stream samples associated with seven activities, denoted as “bed”, “fall”, “walk”, “pick up”, “run”, “sit down”, and “stand up”.
|
| 478 |
+
|
| 479 |
+
However, the joint distribution over the CSI data stream and motion activity changes depending on the room in which the data was collected. Since the data was collected for multiple rooms, we selected two rooms (denoted here as Room A and Room B) and constructed the unsupervised domain adaptation task by using Room A as the source domain and Room B as the target domain. We compare the performance of DANN, VADA, and DIRT-T on the Wi-Fi domain adaptation task in Table 2, using the hyperparameters $( \lambda _ { d } = 0 , \lambda _ { s } = 0 , \lambda _ { t } = 1 0 ^ { - 2 } , \beta = 1 0 ^ { - 2 } )$ .
|
| 480 |
+
|
| 481 |
+
Table 2 shows that VADA significantly improves classification accuracy compared to Source-Only and DANN. However, DIRT-T does not lead to further improvements on this dataset. We believe this is attributable to VADA successfully pushing the decision boundary away from data-dense regions in the target domain. As a result, further application of DIRT-T would not lead to better decision boundaries. To validate this hypothesis, we visualize the t-SNE embeddings for VADA and DIRT-T in Figure 6 and show that VADA is already capable of yielding strong clustering in the target domain. To verify that the decision boundary indeed did not change significantly, we additionally provide the confusion matrix between the VADA and DIRT-T predictions in the target domain (Fig. 7).
|
| 482 |
+
|
| 483 |
+

|
| 484 |
+
Figure 6: T-SNE plot of the last hidden layer for Room A (blue) Room B (red)
|
| 485 |
+
|
| 486 |
+

|
| 487 |
+
Figure 7: Confusion matrix between VADA and and DIRT-T prediction labels.
|
md/train/HJMC_iA5tm/HJMC_iA5tm.md
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING A SAT SOLVER FROM SINGLE-BIT SUPER-VISION
|
| 2 |
+
|
| 3 |
+
Daniel Selsam, Matthew Lamm, Benedikt Bunz, Percy Liang, David L. Dill ¨
|
| 4 |
+
|
| 5 |
+
Department of Computer Science
|
| 6 |
+
Stanford University
|
| 7 |
+
Stanford, CA 94305
|
| 8 |
+
{dselsam,mlamm,buenz,pliang,dill}@cs.stanford.edu
|
| 9 |
+
|
| 10 |
+
Leonardo de Moura Microsoft Research Redmond, WA 98052 leonardo@microsoft.com
|
| 11 |
+
|
| 12 |
+
# ABSTRACT
|
| 13 |
+
|
| 14 |
+
We present NeuroSAT, a message passing neural network that learns to solve SAT problems after only being trained as a classifier to predict satisfiability. Although it is not competitive with state-of-the-art SAT solvers, NeuroSAT can solve problems that are substantially larger and more difficult than it ever saw during training by simply running for more iterations. Moreover, NeuroSAT generalizes to novel distributions; after training only on random SAT problems, at test time it can solve SAT problems encoding graph coloring, clique detection, dominating set, and vertex cover problems, all on a range of distributions over small random graphs.
|
| 15 |
+
|
| 16 |
+
# 1 INTRODUCTION
|
| 17 |
+
|
| 18 |
+
The propositional satisfiability problem (SAT) is one of the most fundamental problems of computer science. Cook (1971) showed that the problem is NP-complete, which means that searching for any kind of efficiently-checkable certificate in any context can be reduced to finding a satisfying assignment of a propositional formula. In practice, search problems arising from a wide range of domains such as hardware and software verification, test pattern generation, planning, scheduling, and combinatorics are all routinely solved by constructing an appropriate SAT problem and then calling a SAT solver (Gomes et al., 2008). Modern SAT solvers based on backtracking search are extremely well-engineered and have been able to solve problems of practical interest with millions of variables (Biere et al., 2009).
|
| 19 |
+
|
| 20 |
+
We consider the question: can a neural network learn to solve SAT problems? To answer, we develop a novel message passing neural network (MPNN) (Scarselli et al., 2009; Li et al., 2015; Gilmer et al., 2017), NeuroSAT, and train it as a classifier to predict satisfiability on a dataset of random SAT problems. We provide NeuroSAT with only a single bit of supervision for each SAT problem that indicates whether or not the problem is satisfiable. When making a prediction about a new SAT problem, we find that NeuroSAT guesses unsatisfiable with low confidence until it finds a solution, at which point it converges and guesses satisfiable with very high confidence. The solution itself can almost always be automatically decoded from the network’s activations, making NeuroSAT an end-to-end SAT solver. See Figure 1 for an illustration of the train and test regimes.
|
| 21 |
+
|
| 22 |
+
Although it is not competitive with state-of-the-art SAT solvers, NeuroSAT can solve SAT problems that are substantially larger and more difficult than it ever saw during training by simply performing more iterations of message passing. Despite only running for a few dozen iterations during training, at test time NeuroSAT continues to find solutions to harder problems after hundreds and even thousands of iterations. The learning process has yielded not a traditional classifier but rather a procedure that can be run indefinitely to search for solutions to problems of varying difficulty.
|
| 23 |
+
|
| 24 |
+

|
| 25 |
+
Figure 1: We train NeuroSAT to predict whether SAT problems are satisfiable, providing only a single bit of supervision for each problem. At test time, when NeuroSAT predicts satisfiable, we can almost always extract a satisfying assignment from the network’s activations. The problems at test time can also be substantially larger, more difficult, and even from entirely different domains than the problems seen during training.
|
| 26 |
+
|
| 27 |
+
Moreover, NeuroSAT generalizes to entirely new domains. Since NeuroSAT operates on SAT problems and since SAT is NP-complete, NeuroSAT can be queried on SAT problems encoding any kind of search problem for which certificates can be checked in polynomial time. Although we train it using only problems from a single random problem generator, at test time it can solve SAT problems encoding graph coloring, clique detection, dominating set, and vertex cover problems, all on a range of distributions over small random graphs.
|
| 28 |
+
|
| 29 |
+
The same neural network architecture can also be used to help construct proofs for unsatisfiable problems. When we train it on a different dataset in which every unsatisfiable problem contains a small contradiction (call this trained model NeuroUNSAT), it learns to detect these contradictions instead of searching for satisfying assignments. Just as we can extract solutions from NeuroSAT’s activations, we can extract the variables involved in the contradiction from NeuroUNSAT’s activations. When the number of variables involved in the contradiction is small relative to the total number of variables, knowing which variables are involved in the contradiction can enable constructing a resolution proof more efficiently.
|
| 30 |
+
|
| 31 |
+
# 2 PROBLEM SETUP
|
| 32 |
+
|
| 33 |
+
Background. A formula of propositional logic is a boolean expression built using the constants true (1) and false (0), variables, negations, conjunctions, and disjunctions. A formula is satisfiable provided there exists an assignment of boolean values to its variables such that the formula evaluates to 1. For example, the formula $( x _ { 1 } \lor x _ { 2 } \lor x _ { 3 } ) \land \lnot ( x _ { 1 } \land x _ { 2 } \land x _ { 3 } )$ is satisfiable because it will evaluate to 1 under every assignment that does not map $x _ { 1 }$ , $x _ { 2 }$ and $x _ { 3 }$ to the same value. For every formula, there exists an equisatisfiable formula in conjunctive normal form (CNF), expressed as a conjunction of disjunctions of (possibly negated) variables.1 Each conjunct of a formula in CNF is called a clause, and each (possibly negated) variable within a clause is called a literal. The formula above is equivalent to the CNF formula $\left( x _ { 1 } \lor x _ { 2 } \lor x _ { 3 } \right) \land \left( \lnot x _ { 1 } \lor \lnot x _ { 2 } \lor \lnot x _ { 3 } \right)$ , which we can represent more concisely as $\{ 1 | 2 | 3 , { \overline { { 1 } } } | { \overline { { 2 } } } | { \overline { { 3 } } } \}$ . A formula in CNF has a satisfying assignment if and only if it has an assignment such that every clause has at least one literal mapped to 1. A SAT problem is a formula in CNF, where the goal is to determine if the formula is satisfiable, and if so, to produce a satisfying assignment of truth values to variables. We use $n$ to denote the number of of variables in a SAT problem, and $m$ to denote the number of clauses.
|
| 34 |
+
|
| 35 |
+
Classification task. For a SAT problem $P$ , we define $\phi ( P )$ to be true if and only if $P$ is satisfiable. Our first goal is to learn a classifier that approximates $\phi$ . Given a distribution $\Psi$ over SAT problems, we can construct datasets $\mathcal { D } _ { \mathrm { t r a i n } }$ and $\mathcal { D } _ { \mathrm { t e s t } }$ with examples of the form $( P , \phi ( P ) )$ by sampling problems $P \sim \Psi$ and computing $\phi ( P )$ using an existing SAT solver. At test time, we get only the problem $P$ and the goal is to predict $\phi ( P )$ , i.e. to determine if $P$ is satisfiable. Ultimately we care about the solving task, which also includes finding solutions to satisfiable problems.
|
| 36 |
+
|
| 37 |
+
# 3 MODEL
|
| 38 |
+
|
| 39 |
+
A SAT problem has a simple syntactic structure and therefore could be encoded into a vector space using standard methods such as an RNN. However, the semantics of propositional logic induce rich invariances that such a syntactic method would ignore, such as permutation invariance and negation invariance. Specifically, the satisfiability of a formula is not affected by permuting the variables (e.g. swapping $x _ { 1 }$ and $x _ { 2 }$ throughout the formula), by permuting the clauses (e.g. swapping the first clause with the second clause), or by permuting the literals within a clause (e.g. replacing the clause $1 | \overline { { 2 } }$ with $\overline { { 2 } } | 1$ . The satisfiability of a formula is also not affected by negating every literal corresponding to a given variable (e.g. negating all occurrences of $x _ { 1 }$ in $\{ 1 | \overline { { 2 } } , \overline { { 1 } } | \overline { { 3 } } \}$ to yield $\{ { \overline { { 1 } } } | { \overline { { 2 } } } , 1 | { \overline { { 3 } } } \} )$ .
|
| 40 |
+
|
| 41 |
+
We now describe our neural network architecture, NeuroSAT, that enforces both permutation invariance and negation invariance. We encode a SAT problem as an undirected graph with one node for every literal, one node for every clause, an edge between every literal and every clause it appears in, and a different type of edge between each pair of complementary literals (e.g. between $x _ { i }$ and $\overline { { x _ { i } } }$ ). NeuroSAT iteratively refines a vector space embedding for each node by passing “messages” back and forth along the edges of the graph as described in Gilmer et al. (2017). At every time step, we have an embedding for every literal and every clause. An iteration consists of two stages. First, each clause receives messages from its neighboring literals and updates its embedding accordingly. Next, each literal receives messages from its neighboring clauses as well as from its complement, then updates its embedding accordingly. Figure 2 provides a high-level illustration of the architecture.
|
| 42 |
+
|
| 43 |
+

|
| 44 |
+
Figure 2: High-level illustration of NeuroSAT operating on the graph representation of $\{ 1 | 2 , { \overline { { 1 } } } | { \overline { { 2 } } } \}$ . On the top of both figures are nodes for each of the four literals, and on the bottom are nodes for each of the two clauses. At every time step $t$ , we have an embedding for every literal and every clause. An iteration consists of two stages. First, each clause receives messages from its neighboring literals and updates it embedding accordingly (Figure 2a). Next, each literal receives messages from its neighboring clause as well as from its complement, and updates its embedding accordingly (Figure 2b).
|
| 45 |
+
|
| 46 |
+
More formally, our model is parameterized by two vectors $\mathbf { L } _ { \mathrm { i n i t } }$ , $\mathbf { C } _ { \mathrm { i n i t } } )$ , three multilayer perceptrons $( \mathbf { L } _ { \mathrm { m s g } } , \mathbf { C } _ { \mathrm { m s g } } , \mathbf { L } _ { \mathrm { v o t e } } )$ and two layer-norm LSTMs (Ba et al., 2016; Hochreiter & Schmidhuber, 1997) $( { \bf L } _ { \bf u } , { \bf C } _ { \bf u } )$ . At every time step $t$ , we have a matrix $L ^ { ( t ) } \in \mathbb { R } ^ { 2 n \times d }$ whose ith row contains the embedding for the literal $\ell _ { i }$ and a matrix $C ^ { ( t ) } \in \mathbb { R } ^ { m \times d }$ whose $j$ th row contains the embedding for the clause $c _ { j }$ , which we initialize by tiling $\mathbf { L } _ { \mathrm { i n i t } }$ and $\mathbf { C } _ { \mathrm { i n i t } }$ respectively. We also have hidden states $L _ { h } ^ { ( t ) } \in \mathbb { R } ^ { 2 n \times d }$ and artite $C _ { h } ^ { ( t ) } \in \mathbb { R } ^ { m \times d }$ for atrix $\mathbf { L } _ { \mathrm { u } }$ and fined $\mathbf { C } _ { \mathbf { u } }$ alized to zero matrices. Letand let Flip be the operator $M$ $M ( i , j ) = \mathrm { ~ \bar { 1 } ~ } \{ \ell _ { i } \in c _ { j } \}$
|
| 47 |
+
that takes a matrix $L$ and swaps each row of $L$ with the row corresponding to the literal’s negation. A single iteration consists of applying the following two updates:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\begin{array} { r l } & { ( C ^ { ( t + 1 ) } , C _ { h } ^ { ( t + 1 ) } ) \gets \mathbf { C } _ { \mathbf { u } } ( [ C _ { h } ^ { ( t ) } , M ^ { \top } \mathbf { L } _ { \mathrm { m s g } } ( L ^ { ( t ) } ) ] ) } \\ & { ( L ^ { ( t + 1 ) } , L _ { h } ^ { ( t + 1 ) } ) \gets \mathbf { L } _ { \mathbf { u } } ( [ L _ { h } ^ { ( t ) } , \mathrm { F l i p } ( L ^ { ( t ) } ) , M \mathbf { C } _ { \mathrm { m s g } } ( C ^ { ( t + 1 ) } ) ] ) } \end{array}
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
After $T$ iterations, we compute $L _ { * } ^ { ( T ) } \mathbf { L } _ { \mathrm { v o t e } } ( L ^ { ( T ) } ) \in \mathbb { R } ^ { 2 n }$ , which contains a single scalar for each literal (the literal’s vote), and then we compute the average of the literal votes $y ^ { ( T ) } \gets \mathrm { m e a n } ( L _ { * } ^ { ( T ) } ) \in$ $\mathbb { R }$ . We train the network to minimize the sigmoid cross-entropy loss between the logit $y ^ { ( T ) }$ and the true label $\phi ( P )$ .
|
| 54 |
+
|
| 55 |
+
Our architecture enforces permutation invariance by operating on nodes and edges according to the topology of the graph without any additional ordering over nodes or edges. Likewise, it enforces negation invariance by treating all literals the same no matter whether they originated as a positive or negative occurrence of a variable.
|
| 56 |
+
|
| 57 |
+

|
| 58 |
+
Iteration
|
| 59 |
+
Figure 3: The sequence of literal votes $L _ { * } ^ { ( 1 ) }$ 1) to L(24)∗ as NeuroSAT runs on a satisfiable problem from SR(20). For clarity, we reshape each $L _ { * } ^ { ( t ) }$ to be an $\mathbb { R } ^ { n \times 2 }$ matrix so that each literal is paired with its complement; specifically, the ith row contains the scalar votes for $x _ { i }$ and $\overline { { x _ { i } } }$ . Here white represents zero, blue negative and red positive. For several iterations, almost every literal is voting unsat with low confidence (light blue). Then a few scattered literals start voting sat for the next few iterations, but not enough to affect the mean vote. Suddenly there is a phase transition and all the literals (and hence the network as a whole) start to vote sat with very high confidence (dark red). After the phase transition, the vote for each literal converges and the network stops evolving.
|
| 60 |
+
|
| 61 |
+
We stress that none of the learned parameters depend on the size of the SAT problem and that a single model can be trained and tested on problems of arbitrary and varying sizes. At both train and test time, the input to the model is simply any bipartite adjacency matrix $M$ over any number of literals and clauses. The learned parameters only determine how each individual literal and clause behaves in terms of its neighbors in the graph. Variation in problem size is handled by the aggregation operators: we sum the outgoing messages of each of a node’s neighbors to form the incoming message, and we take the mean of the literal votes at the end of message passing to form the logit $y ^ { ( T ) }$ .
|
| 62 |
+
|
| 63 |
+
# 4 TRAINING DATA
|
| 64 |
+
|
| 65 |
+
We want our neural network to be able to classify (and ultimately solve) SAT problems from a variety of domains that it never trained on. One can easily construct distributions over SAT problems for which it would be possible to predict satisfiability with perfect accuracy based only on crude statistics; however, a neural network trained on such a distribution would be unlikely to generalize to problems from other domains. To force our network to learn something substantive, we create a distribution $\mathbf { S R } ( n )$ over pairs of random SAT problems on $n$ variables with the following property: one element of the pair is satisfiable, the other is unsatisfiable, and the two differ by negating only a single literal occurrence in a single clause. To generate a random clause on $n$ variables, $\mathbf { S R } ( n )$ first samples a small integer $k$ (with mean 5) 2 then samples $k$ variables uniformly at random without replacement, and finally negates each one with independent probability $50 \%$ . It continues to generate clauses $c _ { i }$ in this fashion, adding them to the SAT problem, and then querying a traditional SAT solver (we used Minisat Sorensson & Een (2005)), until adding the clause $c _ { m }$ finally makes the problem unsatisfiable. Since $\{ c _ { 1 } , \ldots , c _ { m - 1 } \}$ had a satisfying assignment, negating a single literal in $c _ { m }$ must yield a satisfiable problem $\{ c _ { 1 } , \ldots , c _ { m - 1 } , c _ { m } ^ { \prime } \}$ . The pair $( \{ c _ { 1 } , \hdots , c _ { m - 1 } , c _ { m } \} , \{ c _ { 1 } , \hdots , c _ { m - 1 } , c _ { m } ^ { \prime } \} )$ are a sample from $\mathbf { S R } ( n )$ .
|
| 66 |
+
|
| 67 |
+
# 5 PREDICTING SATISFIABILITY
|
| 68 |
+
|
| 69 |
+
Although our ultimate goal is to solve SAT problems arising from a variety of domains, we begin by training NeuroSAT as a classifier to predict satisfiability on SR(40). Problems in $\mathbf { S R } ( 4 0 )$ are small enough to be solved efficiently by modern SAT solvers—a fact we rely on to generate the problems—but the classification problem is highly non-trivial from a machine learning perspective. Each problem has 40 variables and over 200 clauses on average, and the positive and negative examples differ by negating only a single literal occurrence out of a thousand. We were unable to train an LSTM on a many-hot encoding of clauses (specialized to problems with 40 variables) to predict with $5 5 0 \%$ accuracy on its training set. Even the canonical SAT solver MiniSAT (Sorensson & Een, 2005) needs to backjump3 almost ten times on average, and needs to perform over a hundred primitive logical inferences (i.e. unit propagations) to solve each problem.
|
| 70 |
+
|
| 71 |
+
We instantiated the NeuroSAT architecture described in $\ S 3$ with $d = 1 2 8$ dimensions for the literal embeddings, the clause embeddings, and all the hidden units; 3 hidden layers and a linear output layer for each of the MLPs $\mathbf { L } _ { \mathrm { m s g } }$ , $\mathbf { C } _ { \mathrm { m s g } }$ , and $\scriptstyle \mathbf { L } _ { \mathrm { v o t e } }$ ; and rectified linear units for all non-linearities. We regularized by the $\ell _ { 2 }$ norm of the parameters scaled by $1 0 ^ { - 1 0 }$ , and performed $T = 2 6$ iterations of message passing on every problem. We trained our model using the ADAM optimizer (Kingma & Ba, 2014) with a learning rate of $2 \times 1 0 ^ { - 5 }$ , clipping the gradients by global norm with clipping ratio 0.65 (Pascanu et al., 2012). We batched multiple problems together, with each batch containing up to 12,000 nodes (i.e. literals plus clauses). To accelerate the learning, we sampled the number of variables $n$ uniformly from between 10 and 40 during training (i.e. we trained on $\mathbf { S R ( U ( 1 0 , 4 0 ) ) } )$ , though we only evaluate on SR(40). We trained on millions of problems.
|
| 72 |
+
|
| 73 |
+
After training, NeuroSAT is able to classify the test set correctly with $8 5 \%$ accuracy. In the next section, we examine how NeuroSAT manages to do so and show how we can decode solutions to satisfiable problems from its activations. Note: for the entire rest of the paper, NeuroSAT refers to the specific trained model that has only been trained on $\mathbf { S R } ( \mathbf { U } ( 1 0 , 4 0 ) )$ .
|
| 74 |
+
|
| 75 |
+
# 6 DECODING SATISFYING ASSIGNMENTS
|
| 76 |
+
|
| 77 |
+
Let us try to understand what NeuroSAT (trained on $\mathbf { S R ( U ( 1 0 , 4 0 ) ) } )$ is computing as it runs on new problems at test time. For a given run, we can compute and visualize the $2 n$ -dimensional vector of literal votes $L _ { * } ^ { ( t ) } \gets \mathbf { L } _ { \mathrm { v o t e } } ( L ^ { ( t ) } )$ at every iteration $t$ . Figure 3 illustrates the sequence of literal votes $L _ { * } ^ { ( 1 ) }$ ) to L(24)∗ a s NeuroSAT runs on a satisfiable problem from SR(20). For clarity, we reshape each $L _ { * } ^ { ( t ) }$ to be an $\mathbb { R } ^ { n \times 2 }$ matrix so that each literal is paired with its complement; specifically, the ith row contains the scalar votes for $x _ { i }$ and $\overline { { x _ { i } } }$ . Here white represents zero, blue negative and red positive. For several iterations, almost every literal is voting unsat with low confidence (light blue). Then a few scattered literals start voting sat for the next few iterations, but not enough to affect the mean vote. Suddenly, there is a phase transition and all the literals (and hence the network as a whole) start to vote sat with very high confidence (dark red). After the phase transition, the vote for each literal converges and the network stops evolving.
|
| 78 |
+
|
| 79 |
+
NeuroSAT seems to exhibit qualitatively similar behavior on every satisfiable problem that it predicts correctly. The problems for which NeuroSAT guesses unsat are similar except without the phase change: it continues to guess unsat with low-confidence for as many iterations as NeuroSAT runs for. NeuroSAT never becomes highly confident that a problem is unsat, and it almost never guesses sat on an unsat problem. These results suggest that NeuroSAT searches for a certificate of satisfiability, and that it only guesses sat once it has found one.
|
| 80 |
+
|
| 81 |
+
Let us look more carefully at the literal votes $L _ { * } ^ { ( 2 4 ) }$ from Figure 3 after convergence. Note that most of the variables have one literal vote distinctly darker than the other. Moreover, the dark votes are all approximately equal to each other, and the light votes are all approximately equal to each other as well. Thus the votes seem to encode one bit for each variable. It turns out that these bits encode a satisfying assignment in this case, but they do not do so reliably in general. Recall from $\ S 3$ that NeuroSAT projects the higher dimensional literal embeddings $L ^ { ( \bar { T } ) } \in \bar { \mathbb { R } } ^ { 2 n \times d }$ to the literal votes $L _ { * } ^ { ( T ) }$ using the MLP $\scriptstyle \mathbf { L } _ { \mathrm { v o t e } }$ . Figure 4 illustrates the two-dimensional PCA embeddings for $L ^ { ( 1 2 ) }$ to $L ^ { ( 2 6 ) }$ (skipping every other time step) as NeuroSAT runs on a satisfiable problem from SR(40). Blue and red dots indicate literals that are set to 0 and 1 in the satisfying assignment that it eventually finds, respectively. The blue and red dots cannot be linearly separated until the phase transition at the end, at which point they form two distinct clusters according to the satisfying assignment. We observe a similar clustering almost every time the network guesses sat. Thus the literal votes $L _ { * } ^ { ( T ) }$ only ever encode the satisfying assignment by chance, when the projection $\scriptstyle \mathbf { L } _ { \mathrm { v o t e } }$ happens to preserve this clustering.
|
| 82 |
+
|
| 83 |
+
<table><tr><td>Trained on: Trained with: Tested on: Tested with: Overall test accuracy: Accuracy on unsat problems: Accuracy on sat problems: Percent of sat problems solved:</td><td>SR(U(10,40)) 26 iterations SR(40) 26 iterations 85% 96%</td></tr></table>
|
| 84 |
+
|
| 85 |
+
Our analysis suggests a more reliable way to decode solutions from NeuroSAT’s internal activations: 2-cluster $L ^ { ( T ) }$ to get cluster centers $\Delta _ { 1 }$ and $\Delta _ { 2 }$ , partition the variables according to the predicate $\lVert x _ { i } - \Delta _ { 1 } \rVert ^ { 2 } + \lVert \overline { { x _ { i } } } - \Delta _ { 2 } \rVert ^ { 2 } < \lVert x _ { i } - \Delta _ { 2 } \rVert ^ { 2 } + \lVert \overline { { x _ { i } } } - \bar { \Delta _ { 1 } } \rVert ^ { 2 }$ , and then try both candidate assignments that result from mapping the partitions to truth values. This decoding procedure (using $k$ -means to find the two cluster centers) successfully decodes a satisfying assignment for over $7 0 \%$ of the satisfiable problems in the $\mathbf { S R } ( 4 0 )$ test set. Table 1 summarizes the results when training on $\mathbf { S R } ( \mathbf { U } ( 1 0 , 4 0 ) )$ ) and testing on SR(40).
|
| 86 |
+
|
| 87 |
+

|
| 88 |
+
Table 1: NeuroSAT’s performance at test time on $\mathbf { S R } ( 4 0 )$ after training on $\mathbf { S R } ( \mathbf { U } ( 1 0 , 4 0 ) )$ . It almost never guesses sat on unsatisfiable problems. On satisfiable problems, it correctly guesses sat $73 \%$ of the time, and we can decode a satisfying assignment for $70 \%$ of the satisfiable problems by clustering the literal embeddings $L ^ { ( T ) }$ as described in $\ S 6$ .
|
| 89 |
+
Figure 4: PCA projections for the high-dimensional literal embeddings $L ^ { ( 1 2 ) }$ to $L ^ { ( 2 6 ) }$ (skipping every other time step) as NeuroSAT runs on a satisfiable problem from SR(40). Blue and red dots indicate literals that are set to 0 and 1 in the satisfying assignment that it eventually finds, respectively. We see that the blue and red dots are mixed up and cannot be linearly separated until the phase transition at the end, at which point they form two distinct clusters according to the satisfying assignment.
|
| 90 |
+
|
| 91 |
+
Recall that at training time, NeuroSAT is only given a single bit of supervision for each SAT problem. Moreover, the positive and negative examples in the dataset differ only by the placement of a single edge. NeuroSAT has learned to search for satisfying assignments solely to explain that single bit of supervision.
|
| 92 |
+
|
| 93 |
+
# 7 EXTRAPOLATING TO OTHER PROBLEM DISTRIBUTIONS
|
| 94 |
+
|
| 95 |
+
# 7.1 BIGGER PROBLEMS
|
| 96 |
+
|
| 97 |
+
Even though we only train NeuroSAT on $\mathbf { S R } ( \mathbf { U } ( 1 0 , 4 0 ) )$ , it is able to solve SAT problems sampled from $\mathbf { S R } ( n )$ for $n$ much larger than 40 by simply running for more iterations of message passing. Figure 5 shows NeuroSAT’s success rate on $\mathbf { S R } ( n )$ for a range of $n$ as a function of the number of iterations $T$ . For $n = 2 0 0$ , there are $2 ^ { 1 6 0 }$ times more possible assignments to the variables than any problem it saw during training, and yet it can solve $2 5 \%$ of the satisfiable problems in SR(200) by running for four times more iterations than it performed during training. On the other hand, when restricted to the number of iterations it was trained with, it solves under $10 \%$ of them. Thus we see that its ability to solve bigger and harder problems depends on the fact that the dynamical system it has learned encodes generic procedural knowledge that can operate effectively over a wide range of time frames.
|
| 98 |
+
|
| 99 |
+

|
| 100 |
+
Figure 5: NeuroSAT’s success rate on $\mathbf { S R } ( n )$ for a range of $n$ as a function of the number of iterations $T$ . Even though we only train NeuroSAT on $\mathbf { S R } ( 4 0 )$ and below, it is able to solve SAT problems sampled from $\mathbf { S R } ( n )$ for $n$ much larger than 40 by simply running for more iterations.
|
| 101 |
+
|
| 102 |
+

|
| 103 |
+
Figure 6: Example graph from the Forest-Fire distribution. The graph has a coloring for $k \geq 5$ , a clique for $k \leq 3$ , a dominating set for $k \geq 3$ , and a vertex cover for $k \geq 6$ . However, these properties are not perceptually obvious and require deliberate computation to determine.
|
| 104 |
+
|
| 105 |
+
# 7.2 DIFFERENT PROBLEMS
|
| 106 |
+
|
| 107 |
+
Every problem in NP can be reduced to SAT in polynomial time, and SAT problems arising from different domains may have radically different structural and statistical properties. Even though NeuroSAT has learned to search for satisfying assignments on problems from $\mathbf { S R } ( n )$ , we may still find that the dynamical system it has learned only works properly on problems similar to those it was trained on.
|
| 108 |
+
|
| 109 |
+
To assess NeuroSAT’s ability to extrapolate to different classes of problems, we generated problems in several other domains and then encoded them all into SAT problems (using standard encodings). In particular, we started by generating one hundred graphs from each of six different random graph distributions (Barabasi, Erdos-Renyi, Forest-Fire, Random-¨ $k$ -Regular, Random-Static-Power-Law, and Random-Geometric).4 We found parameters for the random graph generators such that each graph has ten nodes and seventeen edges on average. For each graph in each collection, we generated graph coloring problems $( 3 \leq k \leq 5 )$ ), dominating-set problems $( 2 \leq k \leq 4 )$ ), clique-detection problems $( 3 ~ \leq ~ k ~ \leq ~ 5 )$ , and vertex cover problems $( 4 ~ \leq ~ k ~ \leq ~ 6 )$ .5 We chose the range of $k$ for each problem to include the threshold for most of the graphs while avoiding trivial problems such as 2-clique. As before, we used Minisat Sorensson & Een (2005) to determine satisfiability. Figure 6 shows an example graph from the distribution. Note that the trained network does not know anything a priori about these tasks; the generated SAT problems need to encode not only the graphs themselves but also formal descriptions of the tasks to be solved.
|
| 110 |
+
|
| 111 |
+
Out of the 7,200 generated problems, we kept only the 4,888 satisfiable problems. On average these problems contained over two and a half times as many clauses as the problems in SR(40). We ran NeuroSAT for 512 iterations on each of them and found that we could successfully decode solutions for $8 5 \%$ of them. In contrast, Survey Propagation (SP) (Braunstein et al., 2005), the canonical (learning-free) message passing algorithm for satisfiability, does not on its own converge to a satisfying assignment on any of these problems.6 This suggests that NeuroSAT has not simply found a way to approximate SP, but rather has synthesized a qualitatively different algorithm.
|
| 112 |
+
|
| 113 |
+
# 8 FINDING UNSAT CORES
|
| 114 |
+
|
| 115 |
+
NeuroSAT (trained on $\mathbf { S R ( U ( 1 0 , 4 0 ) ) } \rangle$ can find satisfying assignments but is not helpful in constructing proofs of unsatisfiability. When it runs on an unsatisfiable problem, it keeps searching for a satisfying assignment indefinitely and non-systematically. However, when we train the same architecture on a dataset in which each unsatisfiable problem has a small subset of clauses that are already unsatisfiable (called an unsat core), it learns to detect these unsat cores instead of searching for satisfying assignments. The literals involved in the unsat core can be decoded from its internal activations. When the number of literals involved in the unsat core is small relative to the total number of literals, knowing the literals involved in the unsat core can enable constructing a resolution proof more efficiently.
|
| 116 |
+
|
| 117 |
+
We generated a new distribution $\mathbf { S R C } ( n , u )$ that is similar to $\mathbf { S R } ( n )$ except that every unsatisfiable problem contains a small unsat core. Here $n$ is the number of variables as before, and $u$ is an unsat core over $x _ { 1 } , \ldots , x _ { k }$ $( k < n )$ that can be made into a satisfiable set of clauses $u ^ { \prime }$ by negating a single literal. We sample a pair from $\mathbf { S R C } ( n , u )$ as follows. First, we initialize a problem with $u ^ { \prime }$ , and then we sample clauses (over $x _ { 1 }$ to $x _ { n }$ ) just as we did for $\mathbf { S R } ( n )$ until the problem becomes unsatisfiable. We can now negate a literal in the final clause to get a satisfiable problem $p _ { s }$ , and then we can swap $u ^ { \prime }$ for $u$ in $p _ { s }$ to get $p _ { u }$ , which is unsatisfiable since it contains the unsat core $u$ . We created train and test datasets from $\mathbf { S R C } ( 4 0 , u )$ with $u$ sampled at random for each problem from a collection of three unsat cores ranging from three clauses to nine clauses: the unsat core $R$ from Knuth (2015), and the two unsat cores resulting from encoding the pigeonhole principles $\mathbf { P P } ( 2 , 1 )$ and $\mathbf { P P } ( 3 , 2 )$ . 7 We trained our architecture on this dataset, and we refer to the trained model as NeuroUNSAT.
|
| 118 |
+
|
| 119 |
+

|
| 120 |
+
(b) NeuroUNSAT running on an unsatisfiable problem.
|
| 121 |
+
|
| 122 |
+
(a) NeuroUNSAT running on a satisfiable problem.
|
| 123 |
+
|
| 124 |
+

|
| 125 |
+
Figure 7: The sequence of literal votes $L _ { * } ^ { ( t ) }$ as NeuroUNSAT runs on a pair of problems from $\mathbf { S } \bar { \mathbf { R C } } ( 3 0 , \mathbf { P P } ( 3 , \bar { 2 } ) )$ . In both cases, the literals in the first six rows are involved in the unsat core. In 7a, NeuroUNSAT inspects the modified core $u ^ { \prime }$ of the satisfiable problem but concludes that it does not match the pattern. In 7b, NeuroUNSAT finds the unsat core $u$ and votes unsat with high confidence (dark blue).
|
| 126 |
+
|
| 127 |
+
NeuroUNSAT is able to predict satisfiability on the test set with $100 \%$ accuracy. Upon inspection, it seems to do so by learning to recognize the unsat cores. Figure 7 shows NeuroUNSAT running on a pair of problems from $\bar { \mathbf { S } } \mathbf { R } \mathbf { C } ( 3 0 , \mathbf { \bar { P } } \mathbf { P } ( 3 , 2 ) )$ . In both cases, the literals in the first six rows are involved in the unsat core. In Figure 7a, NeuroUNSAT inspects the modified core $u ^ { \prime }$ of the satisfiable problem but concludes that it does not match the pattern exactly. In Figure 7b, NeuroUNSAT finds the unsat core $u$ and votes unsat with high confidence (dark blue). As in $\ S 6$ , the literals involved in the unsat core can sometimes be decoded from the literal votes $L _ { * } ^ { ( T ) }$ , but it is more reliable to 2- cluster the higher-dimensional literal embeddings $L ^ { ( T ) }$ . On the test set, the small number of literals involved in the unsat core end up in their own cluster $98 \%$ of the time.
|
| 128 |
+
|
| 129 |
+
Note that we do not expect NeuroUNSAT to generalize to arbitary unsat cores: as far as we know it is simply memorizing a collection of specific subgraphs, and there is no evidence it has learned a generic procedure to prove unsat.
|
| 130 |
+
|
| 131 |
+
# 9 RELATED WORK
|
| 132 |
+
|
| 133 |
+
There have been many attempts over the years to apply statistical learning to various aspects of the SAT problem: restart strategies (Haim & Walsh, 2009), branching heuristics (Liang et al., 2016;
|
| 134 |
+
|
| 135 |
+
Grozea & Popescu, 2014; Flint & Blaschko, 2012), parameter tuning (Singh et al., 2009), and solver selection (Xu et al., 2008). None of these approaches use neural networks, and instead make use of both generic graph features and features extracted from the runs of SAT solvers. Moreover, these approaches are designed to assist existing solvers and do not aim to solve SAT problems on their own.
|
| 136 |
+
|
| 137 |
+
From the machine learning perspective, the closest work to ours is Palm et al. (2017), which showed that an MPNN can be trained to predict the unique solutions of Sudoku puzzles. We believe that their network’s success is an instance of the phenomenon we study in this paper, namely that MPNNs can synthesize local search algorithms for constraint satisfaction problems. Evans et al. (2018) present a neural network architecture that can learn to predict whether one propositional formula entails another by randomly sampling and evaluating candidate assignments. Unlike NeuroSAT, their network does not perform heuristic search and can only work on simple problems for which random guessing is tractable. There have also been several recent papers showing that various neural network architectures can learn good heuristics for NP-hard combinatorial optimization problems (Vinyals et al., 2015; Bello et al., 2016; Dai et al., 2017); however, finding low-cost solutions to optimization problems requires less precise reasoning than finding satisfying assignments.
|
| 138 |
+
|
| 139 |
+
# 10 DISCUSSION
|
| 140 |
+
|
| 141 |
+
Our main motivation has been scientific: to better understand the extent to which neural networks are capable of precise, logical reasoning. Our work has definitively established that neural networks can learn to perform discrete search on their own without the help of hard-coded search procedures, even after only end-to-end training with minimal supervision. We found this result surprising and think it constitutes an important contribution to the community’s evolving understanding of the capabilities and limitations of neural networks.
|
| 142 |
+
|
| 143 |
+
Although not our primary concern, we also hope that our findings eventually lead to improvements in practical SAT solving. As we stressed early on, as an end-to-end SAT solver the trained NeuroSAT system discussed in this paper is still vastly less reliable than the state-of-the-art. We concede that we see no obvious path to beating existing SAT solvers. One approach might be to continue to train NeuroSAT as an end-to-end solver on increasingly difficult problems. A second approach might be to use a system like NeuroSAT to help guide decisions within a more traditional SAT solver, though it is not clear that NeuroSAT provides any useful information before it finds a satisfying assignment. However, as we discussed in $\ S 8$ , when we trained our architecture on different data it learned an entirely different procedure. In a separate experiment omitted for space reasons, we also trained our architecture to predict whether there is a satisfying assignment involving each individual literal in the problem and found that it was able to predict these bits with high accuracy as well. Unlike NeuroSAT, it made both type I and type II errors, had no discernable phase transition, and could make reasonable predictions within only a few rounds. We believe that architectures descended from NeuroSAT will be able to learn very different mechanisms and heuristics depending on the data they are trained on and the details of their objective functions. We are cautiously optimistic that a descendant of NeuroSAT will one day lead to improvements to the state-of-the-art.
|
| 144 |
+
|
| 145 |
+
# ACKNOWLEDGEMENTS
|
| 146 |
+
|
| 147 |
+
We thank Steve Mussmann, Alexander Ratner, Nathaniel Thomas, Vatsal Sharan and Cristina White for providing valuable feedback on early drafts. We also thank William Hamilton, Geoffrey Irving and Arun Chaganty for helpful discussions. This work was supported by Future of Life Institute grant 2017-158712.
|
| 148 |
+
|
| 149 |
+
# REFERENCES
|
| 150 |
+
|
| 151 |
+
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
|
| 152 |
+
|
| 153 |
+
Irwan Bello, Hieu Pham, Quoc V Le, Mohammad Norouzi, and Samy Bengio. Neural combinatorial optimization with reinforcement learning. arXiv preprint arXiv:1611.09940, 2016.
|
| 154 |
+
|
| 155 |
+
Armin Biere, Marijn Heule, Hans van Maaren, and Toby Walsh. Conflict-driven clause learning sat solvers. Handbook of Satisfiability, Frontiers in Artificial Intelligence and Applications, pp. 131–153, 2009.
|
| 156 |
+
|
| 157 |
+
Alfredo Braunstein, Marc Mezard, and Riccardo Zecchina. Survey propagation: An algorithm for ´ satisfiability. Random Structures & Algorithms, 27(2):201–226, 2005.
|
| 158 |
+
|
| 159 |
+
Stephen A Cook. The complexity of theorem-proving procedures. In Proceedings of the third annual ACM symposium on Theory of computing, pp. 151–158. ACM, 1971.
|
| 160 |
+
|
| 161 |
+
Hanjun Dai, Elias B Khalil, Yuyu Zhang, Bistra Dilkina, and Le Song. Learning combinatorial optimization algorithms over graphs. arXiv preprint arXiv:1704.01665, 2017.
|
| 162 |
+
|
| 163 |
+
Richard Evans, David Saxton, David Amos, Pushmeet Kohli, and Edward Grefenstette. Can neural networks understand logical entailment? arXiv preprint arXiv:1802.08535, 2018.
|
| 164 |
+
|
| 165 |
+
Alex Flint and Matthew Blaschko. Perceptron learning of sat. In Advances in Neural Information Processing Systems, pp. 2771–2779, 2012.
|
| 166 |
+
|
| 167 |
+
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.
|
| 168 |
+
|
| 169 |
+
Carla P Gomes, Henry Kautz, Ashish Sabharwal, and Bart Selman. Satisfiability solvers. Foundations of Artificial Intelligence, 3:89–134, 2008.
|
| 170 |
+
|
| 171 |
+
Cristian Grozea and Marius Popescu. Can machine learning learn a decision oracle for np problems? a test on sat. Fundamenta Informaticae, 131(3-4):441–450, 2014.
|
| 172 |
+
|
| 173 |
+
Shai Haim and Toby Walsh. Restart strategy selection using machine learning techniques. CoRR, abs/0907.5032, 2009.
|
| 174 |
+
|
| 175 |
+
S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural Computation, 9(8):1735–1780, 1997.
|
| 176 |
+
|
| 177 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 178 |
+
|
| 179 |
+
Donald E Knuth. The art of computer programming, volume 4, fascicle 6: Satisfiability, 2015.
|
| 180 |
+
|
| 181 |
+
Harry R Lewis. Computers and intractability. a guide to the theory of np-completeness, 1983.
|
| 182 |
+
|
| 183 |
+
Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard Zemel. Gated graph sequence neural networks. arXiv preprint arXiv:1511.05493, 2015.
|
| 184 |
+
|
| 185 |
+
Jia Hui Liang, Vijay Ganesh, Pascal Poupart, and Krzysztof Czarnecki. Learning rate based branching heuristic for sat solvers. In International Conference on Theory and Applications of Satisfiability Testing, pp. 123–140. Springer, 2016.
|
| 186 |
+
|
| 187 |
+
Mark Newman. Networks: an introduction. Oxford university press, 2010.
|
| 188 |
+
|
| 189 |
+
Rasmus Berg Palm, Ulrich Paquet, and Ole Winther. Recurrent relational networks for complex relational reasoning. arXiv preprint arXiv:1711.08028, 2017.
|
| 190 |
+
|
| 191 |
+
Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio. Understanding the exploding gradient problem. CoRR, abs/1211.5063, 2012.
|
| 192 |
+
|
| 193 |
+
Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. IEEE Transactions on Neural Networks, 20(1):61–80, 2009.
|
| 194 |
+
|
| 195 |
+
Rishabh Singh, Joseph P Near, Vijay Ganesh, and Martin Rinard. Avatarsat: An auto-tuning boolean sat solver. 2009.
|
| 196 |
+
|
| 197 |
+
Niklas Sorensson and Niklas Een. Minisat v1. 13-a sat solver with conflict-clause minimization. SAT, 2005(53):1–2, 2005.
|
| 198 |
+
|
| 199 |
+
G Tseitin. On the complexity ofderivation in propositional calculus. Studies in Constrained Mathematics and Mathematical Logic, 1968.
|
| 200 |
+
O. Vinyals, M. Fortunato, and N. Jaitly. Pointer networks. In Advances in Neural Information Processing Systems (NIPS), pp. 2674–2682, 2015.
|
| 201 |
+
L. Xu, F. Hutter, H. H. Hoos, and K. Leyton-Brown. SATzilla: portfolio-based algorithm selection for SAT. Journal of Artificial Intelligence Research (JAIR), 32:565–606, 2008.
|
md/train/HkeSdCEtDS/HkeSdCEtDS.md
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ALTERNATING ROLES DIALOG MODEL WITH LARGESCALE PRE-TRAINED LANGUAGE MODELS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Existing dialog system models require extensive human annotations and are difficult to generalize to different tasks. The recent success of large pre-trained language models such as BERT and GPT-2 (Devlin et al., 2019; Radford et al., 2019) have suggested the effectiveness of incorporating language priors in down-stream NLP tasks. However, how much pre-trained language models can help dialog response generation is still under exploration. In this paper, we propose a simple, general, and effective framework: Alternating Roles Dialog Model (ARDM). ARDM models each speaker separately and takes advantage of the large pretrained language model. It requires no supervision from human annotations such as belief states or dialog acts to achieve effective conversations. ARDM outperforms or is on par with state-of-the-art methods on two popular task-oriented dialog datasets: CamRest676 and MultiWOZ. Moreover, we can generalize ARDM to more challenging, non-collaborative tasks such as persuasion. In persuasion tasks, ARDM is capable of generating human-like responses to persuade people to donate to a charity.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
It has been a long-standing ambition for artificial intelligence researchers to create an intelligent conversational agent that can generate human-like responses. Recently data-driven dialog models are more and more popular. However, most current state-of-the-art approaches still rely heavily on extensive annotations such as belief states and dialog acts (Lei et al., 2018). However, dialog content can vary considerably in different dialog tasks. Having a different intent or dialog act annotation scheme for each task is costly. For some tasks, it is even impossible, such as open-domain social chat. Thus, it is difficult to utilize these methods on challenging dialog tasks, such as persuasion and negotiation, where dialog states and acts are difficult to annotate.
|
| 12 |
+
|
| 13 |
+
Eric & Manning (2017) proposed a simple sequence-to-sequence architecture that requires no explicit annotations. The model learns to extract information from dialog history with attention and copy mechanism. However, due to the limited language modeling capabilities in the previous model, Sequicity (Lei et al., 2018), which reuses belief states as inputs for supervision, outperforms Eric & Manning (2017)’s method significantly in recent dialog datasets. But with the success of large pretrained language models such as BERT (Devlin et al., 2019) and GPT-2 (Radford et al., 2019), we re-examine Eric & Manning (2017)’s method and investigate how large-scale pre-trained language models can help dialog tasks.
|
| 14 |
+
|
| 15 |
+
Previous large-scale pre-trained language models are used to tackle documents with only one narrator. However, in dialogs, two speakers have different roles; therefore, their language model distributions are very different from each other. For example, customer service agents speak very differently to their customers. To address this issue, we propose ARDM, a dialog model that encodes and decodes different speaker utterances in alternating order with two pre-trained large-scale language models. To investigate whether ARDM can help dialog response generation, we evaluate its performance on three different task-oriented dialog datasets: CamRes676, MultiWOZ, and PersuasionForGood . The first two datasets are traditional information request dialog datasets with well-defined automatic evaluation metrics on task completion. By contrast, PersuasionForGood is a new dataset that focuses on persuading people to donate to a charity. There is no explicit dialog state defined in this task as such non-collaborative dialogs have various dialog actions.
|
| 16 |
+
|
| 17 |
+
We observe that ARDM is capable of improving task-oriented dialog tasks performance over the previous state-of-the-art methods without incorporating any explicit supervision from belief states or dialog acts. Also, due to ARDM’s simplicity and generality, one can rapidly build a dialog prototype on different types of applications using only conversations without any manual annotations. We also found that ARDM works well on complex dialogs, such as persuasion. The model generates dialog responses that successfully persuade people to donate to a charity, suggesting the potential of ARDM being used in wide-scale real-world settings.
|
| 18 |
+
|
| 19 |
+
# 2 RELATED WORK
|
| 20 |
+
|
| 21 |
+
Traditional dialog systems consist of a dialog manager to maintain dialog states and control the conversation flow. However, a dialog manager requires extensive manual annotations for training the sub-modules such as dialog state tracker or policy decision-maker. An alternative is to model dialog without explicitly modeling belief states. Specifically, Eric & Manning (2017) proposed a recurrent neural dialogue architecture using a sequence-to-sequence model that utilizes copy-mechanism to copy history information directly from raw dialog history. This method achieved the state-of-theart results on DSTC2 (Henderson et al., 2014), which is a simple dialog restaurant booking task with abundant data. However, such method did not perform well on more complex dialog task data sets CamRes676 (Wen et al., 2017) and KVRET (Eric et al., 2017). Sequicity (Lei et al., 2018) attributed the bad performance of Eric & Manning (2017)’s method to the omission of belief tracker. They introduced the concept of belief span and added belief tracker back to the model and achieved state-of-the-art performance.
|
| 22 |
+
|
| 23 |
+
Compared to Sequicity, Eric & Manning (2017)’s method provides a more general framework that reduces manual dialog state, user intent, and dialog act labeling by bypassing any symbolic annotations. Such a model can apply to datasets with no or partial annotations of belief states. In a real-world setting, if the dialog task introduces new slot values in belief states (i.e. a new type of food), Sequicity will suffer from the belief span decoder error in response generation. Thus, Eric & Manning (2017)’s method may be potentially more robust than Sequicity in this situation. Besides, if the task requires belief states for database search, we can treat belief tracking as a separate task. We can train a good belief tracking with only a small amount of annotated data, which reduces the annotation required and it is easier to fix errors. Also, since belief states are a set of important entities condensed from dialog history (i.e., often exact words from utterances), they do not introduce extra information to the model. Therefore, a dialog model with powerful representation learning should learn a form of belief states information automatically without human annotations as the scaffold.
|
| 24 |
+
|
| 25 |
+
Recent success of BERT (Devlin et al., 2019) and GPT2 (Radford et al., 2019) suggests the possibility of using large pre-trained language models to enhance Eric & Manning (2017)’s method. There are some studies of applying large pre-trained language model to dialog generation. TransferTransfo (Wolf et al., 2019) fine-tuned the pre-trained language model GPT (Radford et al., 2018) on Persona-Chat dataset (Zhang et al., 2018) and obtained significant improvements on chitchat dialog generation, suggesting the potential of fine-tuning large pre-trained language model on other dialog response generation tasks. A more recent work (Budzianowski & Vulic, 2019) adopted the framework of TransferTransfo and made the first attempt to leverage large pre-trained language models GPT and GPT-2 on task-oriented dialog generation, but it included belief states modeling as the input and did not achieve better results than the baseline. We propose to model dialogs without any annotation but rely on pre-trained large scale language models that alternate.
|
| 26 |
+
|
| 27 |
+
Previous work shows that modeling speaker roles in conversation is beneficial for language understanding (Chi et al., 2017; Chen et al., 2017; Su et al., 2018). Other researchers model persona information to generate language with different speaking styles (Li et al., 2016; Joshi et al., 2017). Zhao & Kawahara (2019) propose a relative speaker modeling method, where only the relative role instead of the absolute identity of the speaker is modeled. Our method is similar to Zhao & Kawahara (2019) in the spirit of modeling relative speaker relationship, but we focus on learning role-specific language models through utterances from different speakers, instead of explicitly taking role embeddings as input.
|
| 28 |
+
|
| 29 |
+

|
| 30 |
+
Figure 1: Alternating Roles Dialog Model (ARDM) Overview. (a) shows how we feed the entire dialog to ARDM. (b) shows the recurrence mechanism we used to preserve memory.
|
| 31 |
+
|
| 32 |
+
# 3 APPROACH
|
| 33 |
+
|
| 34 |
+
Our goal is to leverage large pre-trained language models to improve dialog response generation. Favoring Eric & Manning (2017)’s approach without using additional annotations such dialog states or dialog acts, we propose Alternating Roles Dialog Model (ARDM) by compositing two separate pre-trained language model in alternate order to learn the user and system utterance distribution. Figure 1 shows an overview of ARDM.
|
| 35 |
+
|
| 36 |
+
# 3.1 ALTERNATING ROLES DIALOG MODEL
|
| 37 |
+
|
| 38 |
+
We aim to model both user and system utterances distribution simultaneously. Given a multiturn dialog $( d )$ between a user $( u )$ and a system (s), we can represent $d$ as a series of utterances $\{ u _ { 1 } , s _ { 1 } , u _ { 2 } , s _ { 2 } , . . . , u _ { T } , s _ { T } \}$ , where $T$ denotes the total number of turns. We decompose the probability distributions over the utterances in $d$ into two language models for the user and system respectively, denoted as $p _ { u }$ and $p _ { s }$ . Then we define a dialog model $p ( d )$ with the equation:
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
p ( d ) = \prod _ { t = 1 } ^ { T } p _ { u } \left( u _ { t } | u _ { < t } , s _ { < t } \right) p _ { s } \left( s _ { t } | u _ { \leq t } , s _ { < t } \right)
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
$p _ { u }$ and $p _ { s }$ are standard language models where the task is to predict the next token given the preceding context. For an utterance $u _ { t }$ or $s _ { t }$ with $m$ tokens $\{ w _ { 1 } , \ldots , w _ { m } \}$ , the joint probability of an utterance is as follows:
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
p _ { u } ( u _ { t } | u _ { < t } , s _ { < t } ) = \prod _ { i = 1 } ^ { m _ { u _ { t } } } P ( w _ { i } | w _ { < i } , u _ { < t } , s _ { < t } )
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
p _ { s } ( s _ { t } | u _ { \leq t } , s _ { < t } ) = \prod _ { i = 1 } ^ { m _ { s _ { t } } } P ( w _ { i } | w _ { < i } , u _ { \leq t } , s _ { < t } )
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
Finally, we train the dialog model by maximizing the likelihood over Equation 1.
|
| 55 |
+
|
| 56 |
+
We apply a simple memory mechanism to grant the model the capability of memorizing conversation history. For an utterance at turn $t$ , we reuse the hidden states $h _ { \leq t - 1 }$ stored in the memory $M _ { t - 1 }$ to obtain $h _ { t }$ , and store the $h _ { t }$ back to the memory as $M _ { t }$ . As for the pre-trained Transformer language model, we implement the memory mechanism using self-attention given the query/key/value features denoted as $Q , K , V$ , where the equation is defined as:
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\mathrm { A t t e n t i o n } ( Q , K , V ) = \operatorname { s o f t m a x } ( Q K ^ { T } V )
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
For simplicity, we assume there is only one layer in Transformer, and $h _ { t }$ is the hidden states which consist of $N$ vectors for the current input $N$ tokens in the utterance at time $t$ . Then a recurrence relation for $h _ { t }$ is defined by computing $Q _ { t }$ , $K _ { \leq t }$ , $V _ { \leq t }$ from $h _ { \leq t - 1 }$ and the current utterance. In
|
| 63 |
+
|
| 64 |
+
practice, we reuse $K _ { \leq t - 1 }$ and $V _ { \leq t - 1 }$ (i.e. history keys and values) as $M _ { t - 1 }$ instead of $h _ { t - 1 }$ to avoid recomputing history information. Therefore, the final $h _ { t }$ is computed as:
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\begin{array} { c } { { M _ { t - 1 } = [ K _ { \leq t - 1 } , V _ { \leq t - 1 } ] } } \\ { { K _ { \leq t } , V _ { \leq t } = [ K _ { \leq t - 1 } ; K _ { t } ] , [ V _ { \leq t - 1 } ; V _ { t } ] } } \\ { { h _ { t } = \mathrm { A t t e n t i o n } ( Q _ { t } , K _ { \leq t } , V _ { \leq t } ) } } \end{array}
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
One can use $h _ { t }$ (consisting of vectors for each token) to get each token’s probability to calculate the language model cross entropy loss to maximize $p ( w _ { i } | w < i , u _ { < t } , s _ { < t } )$ , shown in Figure 1.
|
| 71 |
+
|
| 72 |
+
However, one major drawback of this memory mechanism is that the memory consumption grows as the number of turns increases, until a point that the dialog cannot continue because of the memory limit. A straightforward way to solve this is to discard the distant history. But because most dialogs lengths in our datasets can fit in the GPU memory limit (i.e., approx. 1,000 tokens for 11GB GPU), we leave the memory issue for future work.
|
| 73 |
+
|
| 74 |
+
# 3.2 TRAINING DETAILS
|
| 75 |
+
|
| 76 |
+
We initialize the user and the system language model with a large pre-trained language model GPT-2 small with 117M parameters (Radford et al., 2019). It is a Transformer (Vaswani et al., 2017) model with 12 heads, 768 hidden size, and 12 layers. The model is trained on a large scale corpus called WebText extracted from Reddit with at least three upvotes. The tokenizer is 50,257 size byte pair encoding (BPE) (Sennrich et al., 2016) that can encode and decode any text in a lossless manner to avoid out-of-vocabulary tokens. We follow a special format in GPT-2 as the “trigger” so that the model can zero-shot dialog response generation, by prefixing the user role token “A:” or “B:”, and suffixing the end of utterance token $^ { \bullet \bullet } \backslash _ { \bf n \backslash n \backslash n ^ { \prime \prime } }$ . This “trigger” approach is similar in other zero-shot scenarios mentioned in GPT-2 paper (e.g., that a ”TL;DR” token can trigger GPT-2 to summarize the input text.) We further fine-tune ARDM on the specific task dataset. We apply AdamW optimizer (Loshchilov & Hutter, 2019), and the number of warm-up steps is set to be the number of batches in one epoch. The learning rate is set to $3 \times 1 0 ^ { - 5 }$ , and the dropout rate is set to 0.1 for all tasks.
|
| 77 |
+
|
| 78 |
+
# 3.3 DECODING DETAILS
|
| 79 |
+
|
| 80 |
+
We decode utterances by nucleus sampling (Holtzman et al., 2019) with different hyper-parameters (top-p, top- $\mathbf { \nabla } \cdot \mathbf { k }$ ) for down-stream dialog tasks. We also vary the temperature of $T < 1$ to find the best setting for the specific down-stream dialog task. To handle both situations in the evaluation and the real-world use case, we have two decoding modes. For evaluation mode, we feed all past ground truth history before turn $t$ to generate the corresponding utterance, so that we can evaluate the quality of generated dialog responses without concerning about the conversion flow. While in a real-world use case, we do not have ground truth history, and therefore we use the memory from previously generated responses and let the model dynamically interact with a human or another bot in turns. Because dialogs have different lengths, it is hard for ARDM to efficiently decode responses using traditional batch padding method. As a solution, we develop a dynamic dialog filtering algorithm to support fast decoding in batch. Such method speeds up the generation eight times faster. Please refer to Appendix B for the method’s details.
|
| 81 |
+
|
| 82 |
+
# 4 EXPERIMENTS AND RESULTS
|
| 83 |
+
|
| 84 |
+
Data scarcity is one of the biggest challenges in dialog research. It is costly to collect human-human conversations under a specific setting. It is even more time-consuming to annotate belief states and dialog acts. With the success of transfer learning in NLP, we aim to mitigate the low-resource problem with the large pre-trained language model. We validate our proposed ARDM on three task-oriented dialog datasets, CamRest676, MulitWOZ, and PersuasionForGood.
|
| 85 |
+
|
| 86 |
+
# 4.1 CAMREST676
|
| 87 |
+
|
| 88 |
+
CamRest676 is a relatively small dataset with 408/136/136 dialogs for train/validation/test. We follow Sequicity (Lei et al., 2018) to delexicalize tokens such as restaurant names, phone numbers, postcodes by replacing them with their slot names in utterances. We prepend database search results to the system utterance. An example database search results are “restaurant;3”, where the first slot indicates its dialog domain, which is always “restaurant” in CamRest767, and the second slot represents the number of matched items in the database. We use nucleus sampling for all methods in decoding for a fair comparison. Here, we set top- $\cdot \mathtt { p } 0 . 2$ and temperature 0.7 for our model. We use BLEU-4 and Success F1 to evaluate language generation quality and Success F1 to evaluate task success. Success F1 computes the F1 score of the generated responses on requested slots such as an address, phone number, or food type. Other than Sequicity, we also compare results by using GPT-2 alone as a language model for the entire dialog.
|
| 89 |
+
|
| 90 |
+
# 4.1.1 RESULTS
|
| 91 |
+
|
| 92 |
+
We first test our method on a restaurant search dataset, CamRest676 (Wen et al., 2017).
|
| 93 |
+
Table 1: Results on CamRest676 dataset.
|
| 94 |
+
|
| 95 |
+
<table><tr><td>Model</td><td>Entity Match rate</td><td>Ground Truth Belief State BLEU-4</td><td>Success.F1</td><td>Generated Belief State BLEU-4</td><td>Success. F1</td></tr><tr><td>Regular Expression</td><td>0.960</td><td>1</td><td>1</td><td>-</td><td>-</td></tr><tr><td>Sequicity</td><td>0.923</td><td>21.4</td><td>0.852</td><td>21.4</td><td>0.853</td></tr><tr><td>Sequicity (w/o RL)</td><td>0.940</td><td>22.9</td><td>0.821</td><td>23.4</td><td>0.834</td></tr><tr><td>GPT-2-finetune</td><td>-</td><td>21.8</td><td>0.851</td><td>19.2</td><td>0.862</td></tr><tr><td>ARDM</td><td></td><td>26.0</td><td>0.875</td><td>25.2</td><td>0.871</td></tr><tr><td>ARDM (50% data)</td><td>=</td><td>25.9</td><td>0.859</td><td>23.4</td><td>0.851</td></tr></table>
|
| 96 |
+
|
| 97 |
+
Table 1 shows all models’ results with ground truth belief state or generated belief state. We first use ground truth belief state in all methods to evaluate their response generation quality. ARDM achieves the best BLEU and Success F1 score. We observe that after fine-tuning GPT-2 on the CamRest676, it achieves similar results compared to the previous state-of-the-art method, Sequicity with reinforcement fine-tuning. This suggests pre-trained large-scale language model, such as GPT2, transfers the meaningful representations to help fine-tuning. However, without the alternating mechanism, GPT-2 alone does not perform as well as ARDM in terms of both BLEU-4 and Success F1, especially in BLEU-4 (improved $1 9 \%$ ). Without modeling the speaker role, the model blends two speakers language distribution and ignores the inherent speaker role difference. Moreover, to test if our model preserves its performance with even less training data, we reduce the training data to $50 \%$ , and the performance only drops slightly. With half of the training data, our method still performs significantly better than Sequicity. This result suggests ARDM is robust on low-resource settings due to the advantage of the large-scale pre-training language model.
|
| 98 |
+
|
| 99 |
+
We also evaluate all models with generated belief states instead of ground truth belief states. Sequicity generates belief tracker results, and its Entity Match rate is 0.927. Our model does not have a state tracker, so we write a separate simple regular expression to extract the occurrence of entities that appear in the database to support our model. Such state tracker achieves 0.960 in Entity Match rate. It suggests that state tracking may be accomplished in more straightforward ways other than training a neural network model on a large set of annotated data. With a simple state tracker, our proposed method still performs better than Sequicity, which trains the belief state and the response generation task jointly.
|
| 100 |
+
|
| 101 |
+
# 4.2 MULTIWOZ
|
| 102 |
+
|
| 103 |
+
Here, we only use the ground truth database search result to be consistent with other methods. We perform delexicalization which is mentioned in the original MultiWOZ (Budzianowski et al., 2018). We prepend the database search results to the system response for as conditional input. Also, the database results now contain information about whether the booking is successful or not (i.e., succeed or fail). Note that we do not use belief state or dialog act annotation provided by the dataset to train ARDM. We set the top-p to 0.2 and the temperature to 0.7. The results are evaluated on BLEU4, Inform Rate, and Success Rate. Inform and Success Rate measure whether the system response provides the recommendations and requested information given in the goal. We compare our model to the attention-based seq2seq model which is proposed as the MultiWOZ Baseline (Budzianowski et al., 2018), the HDSA (Chen et al., 2019) model that incorporates dialog act supervision as an inductive prior for model architecture, and the LaRL (Zhao et al., 2019) model which leverages latent action modeling and reinforcement learning to improve performance. We do not compare with GPT2-finetune with our model in MultiWOZ because GPT-2-finetune’s performance on CamRest676 is significantly worse than our model. We normalize the time’s slot value in all dialogs into the 24- hour format and perform tokenization via spaCy1. We found that different papers report results with different versions of the evaluator, which makes it difficult to compare different methods fairly. We explain the differences among all versions of the evaluator in Appendix A. In this paper, we follow LaRL’s evaluator implementation, as it is more reasonable than others. We re-evaluate results for all methods with the same evaluator to ensure fairness.
|
| 104 |
+
|
| 105 |
+
# 4.2.1 RESULTS
|
| 106 |
+
|
| 107 |
+
Table 2: Results on MultiWOZ. Supervision denotes whether a model leverages dialog state or/and dialog act annotations. All models use the ground truth dialog state for database search. ARDM without supervision from annotation can still achieve comparable results.
|
| 108 |
+
|
| 109 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">Supervision</td><td rowspan="2">Inform (%)</td><td rowspan="2">Success (%)</td><td rowspan="2">BLEU-4</td></tr><tr><td>Dialog State</td><td>Dialog Act</td></tr><tr><td>Human</td><td>1</td><td>-</td><td>98.9</td><td>96.5</td><td>-</td></tr><tr><td rowspan="3">Baseline HDSA LaRL</td><td>√</td><td>×</td><td>82.5</td><td>72.9</td><td>18.9</td></tr><tr><td>√</td><td>√</td><td>87.7</td><td>73.4</td><td>23.6</td></tr><tr><td>√</td><td>×</td><td>82.8</td><td>79.2</td><td>12.8</td></tr><tr><td>ARDM</td><td>×</td><td>×</td><td>87.4</td><td>72.8</td><td>20.6</td></tr></table>
|
| 110 |
+
|
| 111 |
+
The evaluation results are shown in Table 2. Without any supervision from dialog states or dialog acts, ARDM significantly outperforms the MultiWOZ Baseline and LaRL on BLEU-4 and Inform rate, and is on par with HDSA. However, HDSA uses dialog act supervision and a large pretrained language model, BERT. Our model requires no annotation and can achieve similar results. This suggests our speaker role modeling and large-scale pre-training methods work similarly as the useful dialog act annotations. All the results show that our method’s excellent performance remains consistent in multi-domain dialogs.
|
| 112 |
+
|
| 113 |
+
We analyze the generated responses and find that if multiple domains have appeared in the conversation history, our model tends to make mistakes in answering the right domain for user requests. This finding suggests that the Maximum Likelihood Estimation (MLE) has limitations in directly optimizing the metric, while reinforcement Learning (RL) can hugely improve the task completion in a dialog system. This is why LaRL has a higher Success rate. However, we also observe that LaRL has a low BLEU-4 score, which indicates low readability in responses. Therefore, there is a trade-off between the generation quality and the task success rate in the RL setting.
|
| 114 |
+
|
| 115 |
+
# 4.3 PERSUASIONFORGOOD
|
| 116 |
+
|
| 117 |
+
To showcase ARDM’s performance on a dialog dataset where it is much more difficult to obtain belief states and dialog act annotations, we train and evaluate our model on PersuasionForGood (Wang et al., 2019) dataset. In this dataset, the persuader must persuade an assigned persuadee (i.e., a person who is asked to donate) to donate money (from their task payment) to a charity called “Save the Children”. This dataset has a much larger vocabulary size (8,141) than the previous taskoriented dialog datasets due to its non-collaborative dialog property. The conversation content is richer because two speakers are negotiating back and forth. The dataset consists of 1,017 dialogs where only 300 dialogs are annotated with dialog acts. Therefore, models that require dialog state or dialog act annotation are not applicable in this dataset. ARDM does not require dialog acts for training. As ARDM has already learned good language priors through pre-training, which makes it applicable on PersuasionForGood. Due to the similarity to chit-chat, we use TransferTransfo (Wolf et al., 2019) model as a strong baseline model. TransferTransfo is also based on large pre-trained language model, but it uses token type embedding to encode role information of the speaker. We concatenate all history text together as input to generate the next utterance.
|
| 118 |
+
|
| 119 |
+
To generate diverse responses, we decode the response using the nucleus sampling (Holtzman et al., 2019) with a top-p of 0.9 and a temperature of 0.7. It is impossible to conduct an automatic evaluation on task success on this task due to the lack of annotation. We use perplexity, BLEU-1, and BLEU-2 to evaluate each model’s language generation quality. We also conduct a human evaluation to validate each model’s task success rate. We show some generated examples in the Appendix to provide more information on both models’ generation quality.
|
| 120 |
+
|
| 121 |
+
# 4.3.1 RESULTS
|
| 122 |
+
|
| 123 |
+
Table 3: Automatic Evaluation and Human Evaluation Results
|
| 124 |
+
|
| 125 |
+
<table><tr><td></td><td>Perplexity↓</td><td>BLEU-1个</td><td>BLEU-2↑|</td><td></td><td>Human Preference ↑丨Average Donation Amount ↑</td></tr><tr><td>TransferTransfo</td><td>19.9</td><td>17.0</td><td>8.57</td><td>34.7%</td><td>0.538</td></tr><tr><td>ARDM</td><td>10.1</td><td>16.5</td><td>6.44</td><td>65.3%</td><td>0.807</td></tr></table>
|
| 126 |
+
|
| 127 |
+
Table 4: A conversation between a machine persuader trained by ARDM and a human persuadee.
|
| 128 |
+
|
| 129 |
+
<table><tr><td rowspan=1 colspan=1>Role</td><td rowspan=1 colspan=1>Utterance</td></tr><tr><td rowspan=1 colspan=1>SYS</td><td rowspan=1 colspan=1> Hi, how are you doing today?</td></tr><tr><td rowspan=1 colspan=1>USR</td><td rowspan=1 colspan=1>Iam good!</td></tr><tr><td rowspan=1 colspan=1>SYS</td><td rowspan=1 colspan=1> Have you ever heard of the charity Save the Children?</td></tr><tr><td rowspan=1 colspan=1>USR</td><td rowspan=1 colspan=1>No, I have not heard about it. Would you like to talk about it?</td></tr><tr><td rowspan=1 colspan=1> SYS</td><td rowspan=1 colspan=1> Save the Children is an international non-governmental organization that promotes children's rights, provides relief and helps support children in developing countries.</td></tr><tr><td rowspan=1 colspan=1>USR</td><td rowspan=2 colspan=1>That's cool. It is an organization for the good of this worldYes, it is. In the first two months of 2018 alone,1,00O children were reportedly kiled or injured in intensifying violence in Syria.</td></tr><tr><td rowspan=1 colspan=1>SYS</td></tr><tr><td rowspan=1 colspan=1>USR</td><td rowspan=1 colspan=1>That's sad.</td></tr><tr><td rowspan=1 colspan=1> sYS</td><td rowspan=1 colspan=1>We do need to do something about that. One of the things that we can do is make sure that we have a system in place that willensure that every penny we spend goes directly to the children in need.</td></tr><tr><td rowspan=1 colspan=1>USR</td><td rowspan=2 colspan=1>I agree. How much do you like to donate to the charity now? Your donation will be directly deducted from your task payment. You can choose any amount from $O to all your payment ($2).</td></tr><tr><td rowspan=1 colspan=1> sYS</td></tr><tr><td rowspan=1 colspan=1>USR</td><td rowspan=3 colspan=1> I am willing to donate full my payment $2. Wow, that is awesome! That is so kind of you!You are welcome.</td></tr><tr><td rowspan=1 colspan=1>SYS</td></tr><tr><td rowspan=1 colspan=1>USR</td></tr></table>
|
| 130 |
+
|
| 131 |
+
Table 3 shows the results for PersuasionForGood. Because ARDM applies better speaker modeling and recurrence mechanism, our model achieves lower perplexity compared to TransferTransfo. In terms of BLEU scores, TransferTransfo is better than ARDM. However, BLEU-1 cannot reflect the actual generation quality because a random sentence with common tokens the, of, is, are already has $1 0 . 0 +$ BLEU-1 score. Also because the validation set only contains 100 samples, the result can have a high variance. To comprehensively evaluate each model’s performance, we recruit 14 human evaluators to chat with the two persuasive systems ten times to avoid the randomness produced by each model. In total, we collected 140 ratings. We ask them to select a preferred chat-bot and indicate how much they are willing to donate after talking to the chat-bot. As a result, human judges prefer ARDM over TransferTransfo and tends to donate more when talking to ARDM produced chat-bot. Our model achieved $27 \%$ more donations compared to TransferTransfo. This indicates that our systems are more persuasive. In some examples, such as the one in Table 4, our model generates coherent, natural, and persuasive responses.
|
| 132 |
+
|
| 133 |
+
# 5 ERROR ANALYSIS
|
| 134 |
+
|
| 135 |
+
Since CamRest676 is similar to MultiWOZ in terms of task content and dialog structure, we only describe the errors in MultiWOZ for simplicity. We randomly selected 30 generated error responses from our model with zero inform and success score. To our surprise, we observed that nearly $6 3 . 3 \%$ of errors are not really mistakes. It is mainly due to the limitation of the automatic evaluator. For example, at turn one, the user asks about a restaurant, and the ground truth system response is “the [restaurant name] is located at . . . ”, but the generated system response is “what food preference do you have?”. Our generated response is correct with respect to the dialog context. It is narrowing down the restaurant choices before providing a restaurant recommendation. However, the evaluator sticks to the only possible response it has. Unless the user can dynamically interact with the system, there is no good way to change such mistakes in the automatic evaluator. We find that another $20 \%$ errors our model makes are when the system asks information the user already provided. This type of errors calls for a better history representation. Another $10 \%$ errors are due to ignoring the user’s request for information, such as phone number. However, when we look at the ground truth responses, some crowd workers also made such errors. So resolving these errors requires a cleaner training dataset. Finally, the rest of $6 . 7 \%$ errors are about incorrect dialog domain understanding. For example, the user is asking for a hotel, but we present a restaurant recommendation. This is because of the data noise during the delexicalization process in which some domain labels are wrong.
|
| 136 |
+
|
| 137 |
+
The donation persuasion system trained with TransferTransfo and our model has some common problems, such as inconsistency, lack of logic, and hallucination. For example, if the persuader provides the information about “Save the Children”, then the persuadee asks “Can you tell me more about it?”. The system ends up providing the same information as before. It also sometimes makes up facts that have never happened, such as “Save the Children has an operation about a hurricane in Hawaii”. All those errors would prevent users from trusting the bot, and therefore resulting in less donation. However, we also observe that users have a higher tolerance for errors in the persuasion setting than the customer service setting. Overall, our model performs better on PersuasionForGood by having longer and diversified utterances. This suggests our model which utilizes alternating parameters for different speaker roles is more effective than TransferTransfo which only injects role information into the input embedding.
|
| 138 |
+
|
| 139 |
+
# 6 DISCUSSIONS AND ETHICAL CONSIDERATION
|
| 140 |
+
|
| 141 |
+
ARDM models speakers separately on top of a large pre-trained language model. Such simple adaptation demonstrates substantial performance gain. We suspect it is because the interleaved structure of two language models provides a collaborative learning frame of both the user and the system language distribution modeling. The memory is the only way for the user and system to communicate, as they do not share any weights in their networks. Thus, the user encoder needs to learn useful representations to make the system model for understanding its intent. Similarly, the system needs to do the same for the user model to improve its understanding. This alternative repeating process forces both the user and system models to preserve the dialog history effectively in the memory. One can interpret the memory as the implicit representation of belief states or dialog acts.
|
| 142 |
+
|
| 143 |
+
Another benefit of ARDM is that we will obtain both user and system utterance generators. We can let the two models talk to each other to generate new self-play dialogs (Silver et al., 2017). We show some self-play dialog examples in the Appendix E. With self-play, one can rapidly build a large scale dialog dataset using adversarial filtering (Zellers et al., 2018). Such models can be used in reinforcement learning as user simulator to study complex dialog strategies as well.
|
| 144 |
+
|
| 145 |
+
Persuasion is a double-edged sword. Given the fast development of dialog systems, an ethical design principle must be in place throughout all stages of the development and evaluation. We choose the donation task is because it is a relatively simple task that benefits children. Second, when deploying the persuasive agents in real conversations, we need to keep the users informed of the nature of the system. By revealing the identity of the persuasive agent, the user should also have options to communicate directly with the human team behind the system. Lastly, by investigating persuasive dialog systems, we also envision to use them as an educational tool for the general public to learn to defend themselves against machine persuasion.
|
| 146 |
+
|
| 147 |
+
# 7 CONCLUSIONS
|
| 148 |
+
|
| 149 |
+
We propose to build Alternating Roles Dialog Model (ARDM), a simple, general, and effective dialog method that models user and system separately with large-scale pre-trained language models. Since ARDM does not require any annotations, it generalizes to different dialog applications. Experimental results on CamRest676 and MultiWOZ suggest that ARDM outperforms or on-par with the current state-of-the-art methods that use manual annotation information, such as belief states and dialog acts. Furthermore, we find our model’s excellent performance generalizes to more complex non-collaborative dialog settings. It can generate high-quality responses to persuade people to donate to charity. However, the easiness of training ARDM raises concerns about the misuse of the model in scenarios such as sales, harassment, or scam on a mass scale. We caution the public in deploying such systems in the real world.
|
| 150 |
+
|
| 151 |
+
# REFERENCES
|
| 152 |
+
|
| 153 |
+
Pawel Budzianowski and Ivan Vulic. Hello, it’s GPT-2 - how can I help you? towards the use of pretrained language models for task-oriented dialogue systems. CoRR, abs/1907.05774, 2019. URL http://arxiv.org/abs/1907.05774.
|
| 154 |
+
|
| 155 |
+
Pawel Budzianowski, Tsung-Hsien Wen, Bo-Hsiang Tseng, Inigo Casanueva, Stefan Ultes, Osman ˜ Ramadan, and Milica Gasic. Multiwoz - A large-scale multi-domain wizard-of-oz dataset for task-oriented dialogue modelling. In Riloff et al. (2018), pp. 5016–5026. ISBN 978-1-948087- 84-1. URL https://www.aclweb.org/anthology/D18-1547/.
|
| 156 |
+
|
| 157 |
+
Po-Chun Chen, Ta-Chung Chi, Shang-Yu Su, and Yun-Nung Chen. Dynamic time-aware attention to speaker roles and contexts for spoken language understanding. In 2017 IEEE Automatic Speech Recognition and Understanding Workshop (ASRU), pp. 554–560. IEEE, 2017.
|
| 158 |
+
|
| 159 |
+
Wenhu Chen, Jianshu Chen, Pengda Qin, Xifeng Yan, and William Yang Wang. Semantically conditioned dialog response generation via hierarchical disentangled self-attention. In Anna Korhonen, David R. Traum, and Llu´ıs Marquez (eds.), \` Proceedings of the 57th Conference of the Association for Computational Linguistics, ACL 2019, Florence, Italy, July 28- August 2, 2019, Volume 1: Long Papers, pp. 3696–3709. Association for Computational Linguistics, 2019. ISBN 978-1- 950737-48-2. URL https://www.aclweb.org/anthology/P19-1360/.
|
| 160 |
+
|
| 161 |
+
Ta-Chung Chi, Po-Chun Chen, Shang-Yu Su, and Yun-Nung Chen. Speaker role contextual modeling for language understanding and dialogue policy learning. arXiv preprint arXiv:1710.00164, 2017.
|
| 162 |
+
|
| 163 |
+
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), pp. 4171–4186, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. URL https://www.aclweb.org/ anthology/N19-1423.
|
| 164 |
+
|
| 165 |
+
Mihail Eric and Christopher D. Manning. A copy-augmented sequence-to-sequence architecture gives good performance on task-oriented dialogue. CoRR, abs/1701.04024, 2017. URL http: //arxiv.org/abs/1701.04024.
|
| 166 |
+
|
| 167 |
+
Mihail Eric, Lakshmi Krishnan, Francois Charette, and Christopher D. Manning. Key-value retrieval networks for task-oriented dialogue. In Kristiina Jokinen, Manfred Stede, David DeVault, and Annie Louis (eds.), Proceedings of the 18th Annual SIGdial Meeting on Discourse and Dialogue, Saarbrucken, Germany, August 15-17, 2017 ¨ , pp. 37–49. Association for Computational Linguistics, 2017. ISBN 978-1-945626-82-1. URL https://www.aclweb.org/anthology/ $\mathtt { W 1 7 - 5 5 0 6 } /$ .
|
| 168 |
+
|
| 169 |
+
Matthew Henderson, Blaise Thomson, and Jason D. Williams. The second dialog state tracking challenge. In Proceedings of the SIGDIAL 2014 Conference, The 15th Annual Meeting of the Special Interest Group on Discourse and Dialogue, 18-20 June 2014, Philadelphia, PA, USA, pp. 263–272. The Association for Computer Linguistics, 2014. ISBN 978-1-941643-21-1. URL https://www.aclweb.org/anthology/W14-4337/.
|
| 170 |
+
|
| 171 |
+
Ari Holtzman, Jan Buys, Maxwell Forbes, and Yejin Choi. The curious case of neural text degeneration. CoRR, abs/1904.09751, 2019. URL http://arxiv.org/abs/1904.09751.
|
| 172 |
+
|
| 173 |
+
Chaitanya K Joshi, Fei Mi, and Boi Faltings. Personalization in goal-oriented dialog. arXiv preprint arXiv:1706.07503, 2017.
|
| 174 |
+
|
| 175 |
+
Wenqiang Lei, Xisen Jin, Min-Yen Kan, Zhaochun Ren, Xiangnan He, and Dawei Yin. Sequicity: Simplifying task-oriented dialogue systems with single sequence-to-sequence architectures. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1437–1447, Melbourne, Australia, July 2018. Association for Computational Linguistics. URL https://www.aclweb.org/anthology/P18-1133.
|
| 176 |
+
|
| 177 |
+
Jiwei Li, Michel Galley, Chris Brockett, Georgios P Spithourakis, Jianfeng Gao, and Bill Dolan. A persona-based neural conversation model. arXiv preprint arXiv:1603.06155, 2016.
|
| 178 |
+
|
| 179 |
+
Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. 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 ${ . } = { }$ Bkg6RiCqY7.
|
| 180 |
+
|
| 181 |
+
Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training. OpenAI, 2018.
|
| 182 |
+
|
| 183 |
+
Alec Radford, Jeff Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. 2019.
|
| 184 |
+
|
| 185 |
+
Ellen Riloff, David Chiang, Julia Hockenmaier, and Jun’ichi Tsujii (eds.). Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, Brussels, Belgium, October 31 - November 4, 2018, 2018. Association for Computational Linguistics. ISBN 978-1-948087- 84-1. URL https://www.aclweb.org/anthology/volumes/D18-1/.
|
| 186 |
+
|
| 187 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, ACL 2016, August 7-12, 2016, Berlin, Germany, Volume 1: Long Papers. The Association for Computer Linguistics, 2016. ISBN 978-1-945626-00-5. URL https: //www.aclweb.org/anthology/P16-1162/.
|
| 188 |
+
|
| 189 |
+
David Silver, Thomas Hubert, Julian Schrittwieser, Ioannis Antonoglou, Matthew Lai, Arthur Guez, Marc Lanctot, Laurent Sifre, Dharshan Kumaran, Thore Graepel, Timothy P. Lillicrap, Karen Simonyan, and Demis Hassabis. Mastering chess and shogi by self-play with a general reinforcement learning algorithm. CoRR, abs/1712.01815, 2017. URL http://arxiv.org/abs/ 1712.01815.
|
| 190 |
+
|
| 191 |
+
Shang-Yu Su, Pei-Chieh Yuan, and Yun-Nung Chen. How time matters: Learning time-decay attention for contextual spoken language understanding in dialogues. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pp. 2133–2142, 2018.
|
| 192 |
+
|
| 193 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. CoRR, abs/1706.03762, 2017. URL http://arxiv.org/abs/1706.03762.
|
| 194 |
+
|
| 195 |
+
Xuewei Wang, Weiyan Shi, Richard Kim, Yoojung Oh, Sijia Yang, Jingwen Zhang, and Zhou Yu. Persuasion for good: Towards a personalized persuasive dialogue system for social good. CoRR, abs/1906.06725, 2019. URL http://arxiv.org/abs/1906.06725.
|
| 196 |
+
|
| 197 |
+
Tsung-Hsien Wen, Yishu Miao, Phil Blunsom, and Steve J. Young. Latent intention dialogue models. In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, volume 70 of Proceedings of Machine Learning Research, pp. 3732–3741. PMLR, 2017. URL http://proceedings.mlr.press/v70/wen17a.html.
|
| 198 |
+
|
| 199 |
+
Thomas Wolf, Victor Sanh, Julien Chaumond, and Clement Delangue. Transfertransfo: A transfer learning approach for neural network based conversational agents. CoRR, abs/1901.08149, 2019. URL http://arxiv.org/abs/1901.08149.
|
| 200 |
+
|
| 201 |
+
Rowan Zellers, Yonatan Bisk, Roy Schwartz, and Yejin Choi. SWAG: A large-scale adversarial dataset for grounded commonsense inference. In Riloff et al. (2018), pp. 93–104. ISBN 978-1- 948087-84-1. URL https://www.aclweb.org/anthology/D18-1009/.
|
| 202 |
+
|
| 203 |
+
Saizheng Zhang, Emily Dinan, Jack Urbanek, Arthur Szlam, Douwe Kiela, and Jason Weston. Personalizing dialogue agents: I have a dog, do you have pets too? In Iryna Gurevych and Yusuke Miyao (eds.), Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics, ACL 2018, Melbourne, Australia, July 15-20, 2018, Volume 1: Long Papers, pp. 2204–2213. Association for Computational Linguistics, 2018. ISBN 978-1-948087-32-2. doi: 10.18653/v1/P18-1205. URL https://www.aclweb.org/anthology/P18-1205/.
|
| 204 |
+
|
| 205 |
+
Tiancheng Zhao, Kaige Xie, and Maxine Eskenazi. Rethinking action spaces for reinforcement ´ learning in end-to-end dialog agents with latent variable models. In Jill Burstein, Christy Doran, and Thamar Solorio (eds.), Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2019, Minneapolis, MN, USA, June 2-7, 2019, Volume 1 (Long and Short Papers), pp. 1208–1218. Association for Computational Linguistics, 2019. ISBN 978-1-950737-13-0. URL https: //www.aclweb.org/anthology/N19-1123/.
|
| 206 |
+
|
| 207 |
+
Tianyu Zhao and Tatsuya Kawahara. Effective incorporation of speaker information in utterance encoding in dialog. arXiv preprint arXiv:1907.05599, 2019.
|
| 208 |
+
|
| 209 |
+
# A MULTIWOZ EVALUATOR INCONSISTENCY
|
| 210 |
+
|
| 211 |
+
We rerun baseline models to compare our methods and find discrepancy among different papers’ reported results. In order to understand the reason, we compared between LaRL’s evaluator 2 and MultiWOZ Baseline’s evaluator 3. We found that they make different assumptions to handle the “train” domain (line 637-639 at LaRL evaluator.py). After carefully analyzing the code and discussing with authors of these two papers, we believe that LaRL’s evaluator is more reasonable. However, in LaRL, the authors reported MultiWOZ Baseline’s scores with a different evaluator. Therefore, we re-evaluated all methods, including LaRl, HDSA, and MultiWOZ Baseline using the same evaluator for fairness.
|
| 212 |
+
|
| 213 |
+
Table 5: Re-evaluation Results on MultiWOZ.
|
| 214 |
+
|
| 215 |
+
<table><tr><td></td><td colspan="2">Baseline Evaluator</td><td colspan="2">LaRL Evaluator</td></tr><tr><td></td><td>Inform</td><td>Success</td><td>Inform</td><td>Success</td></tr><tr><td>Human</td><td>75.7%</td><td>67.9%</td><td>90.0%</td><td>82.3%</td></tr><tr><td>Human (the cleaned version)</td><td>82.4%</td><td>78.9%</td><td>98.9%</td><td>96.5%</td></tr><tr><td>MultiWOZ Baseline</td><td>71.3%</td><td>61.0%</td><td>82.5%</td><td>72.9%</td></tr></table>
|
| 216 |
+
|
| 217 |
+
# B DYNAMIC DIALOG FILTERING ALGORITHM
|
| 218 |
+
|
| 219 |
+
Since ARDM takes the entire dialog as input, so different input has different number of turns and different length in each turn. Also, there are two sub-language models in ARDM. If we pad the utterance in each turn and concatenate results of all turns, it is inefficient. Instead, we introduce a filtering algorithm to dynamically release memory once a dialog is finished. This enables us to speed up our model four times in training and eight times in inference. Please refer to our code for details.
|
| 220 |
+
|
| 221 |
+
# Algorithm 1 Dialog Filtering algorithm
|
| 222 |
+
|
| 223 |
+
<table><tr><td>Batch Size = n</td></tr><tr><td>Initialize Memory M for n workers.</td></tr><tr><td>for Batch=1,2,3,...do</td></tr><tr><td></td></tr><tr><td>T= maximum number of turns in Batch for Turn=1,2,3,...,TinBatch do</td></tr><tr><td>Filter M and Batch for the finished worker</td></tr><tr><td>Feed remaining Batch to the model</td></tr><tr><td>Compute loss and gradients</td></tr><tr><td>0old←0</td></tr><tr><td>end for</td></tr><tr><td>end for</td></tr></table>
|
| 224 |
+
|
| 225 |
+
# C TRANSFERTRANSFO EXAMPLES
|
| 226 |
+
|
| 227 |
+
Table 6: A conversation between a machine persuader (ER) trained by TransferTransfo and a human persuadee (EE)
|
| 228 |
+
|
| 229 |
+
<table><tr><td rowspan=1 colspan=1>Role</td><td rowspan=1 colspan=1>Utterance</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1>hello!</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1>Hello</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> have you heard of the charity save the children?</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1> no, I haven't heard it</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> it's an international non - governmental organization that promotes children's rights, provides relief and helps support children in developing countries.</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1>ok</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> so would you like to donate some of your payment to this charity?</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1> can you tell me more information about it?</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> save the children is an international non - governmental organization that promotes children's rights, provides relief and helps support children in developing countries.</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1> which developing countries ?</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> the united states and latin america. have you heard of this charity?</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1>no,Ihaven't</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> it's an organization that helps ensure children's rights to health, education and safety.</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1>sounds cool</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=2 colspan=1> have you ever donated to this organization?no</td></tr><tr><td rowspan=1 colspan=1>EE</td></tr></table>
|
| 230 |
+
|
| 231 |
+
Table 7: A conversation between a machine persuader (ER) trained by TransferTransfo and a human persuadee (EE)
|
| 232 |
+
|
| 233 |
+
<table><tr><td rowspan=1 colspan=1>Role</td><td rowspan=1 colspan=1>Utterance</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1>hello!</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1>hi</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> how are you today?</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1>I am good</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> have you ever heard of save the children?</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1>no, Ihaven't</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> it is an organization that helps children around the world. it's a great organization that does good work and is highly rated with many positive rewards.</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1>good</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> have you ever heard of it?</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1> no, Ihaven't heard of it</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> it's a great organization that does good work and is a huge part of the world's popula- tion.</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1>okay</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> so, are you interested in donating?</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1>yes,Iam</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> how much would you like to donate to the charity?</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1>$1</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> wow, that is really great. that is really great to hear. so, are you going to donate anything at this time??</td></tr></table>
|
| 234 |
+
|
| 235 |
+
# D PERSUASIONFORGOOD HUMAN-MACHINE EXAMPLES
|
| 236 |
+
|
| 237 |
+
We show some more examples of dialogs generated using our proposed ARDM.
|
| 238 |
+
|
| 239 |
+
Table 8: A conversation between a machine persuader (ER) trained by ARDM and a human persuadee (EE)
|
| 240 |
+
|
| 241 |
+
<table><tr><td rowspan=1 colspan=1>Role</td><td rowspan=1 colspan=1>Utterance</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1>Hello! How are you doing today?</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1>I am doing well!</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> Awesome. Have you heard about the Save the Children charity?</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1>Yes I have heard about it.</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> Save the Children is an international non-governmental organization that promotes children's rights, provides relief and helps support children in developing countries.</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1> So which developing countries do they help?</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> Save the Children is working on supporting children in the US and all over the world.</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1> that's cool. I want to help children as well.</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> That's awesome! I know there are a lot of kids in the world that are in dire situations.</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1> Right. What I should I do to help them?</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> Save the Children is a great organization, so you should donate some of your payment to them.</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=2 colspan=1>how much is my task payment?I am not sure exactly how much you will donate, but you can donate any amount from $0 to all of your payment ($2).</td></tr><tr><td rowspan=1 colspan=1>ER</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1>I would like to donate $1.00.</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> That's awesome. Your donation will make a huge impact for those kids.</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1>Thank you.</td></tr></table>
|
| 242 |
+
|
| 243 |
+
Table 9: A conversation between a machine persuader (ER) trained by ARDM and a human persuadee (EE)
|
| 244 |
+
|
| 245 |
+
<table><tr><td rowspan=1 colspan=1>Role</td><td rowspan=1 colspan=1>Utterance</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1>Hi, how are you doing today?</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1>I am good!</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> Have you ever heard of the charity Save the Children?</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1> No, I have not heard about it. Would you like to talk about it?</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> Save the Children is an international non-governmental organization that promotes children's rights, provides relief and helps support children in developing countries.</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=2 colspan=1>That's cool. It is a organization for the good of this world.Yes, it is. In the first two months of 2018 alone, 1,000 children were reportedly killed or injured in intensifying violence in Syria.</td></tr><tr><td rowspan=1 colspan=1>ER</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=2 colspan=1>That's sad. We do need to do something about that. One of the things that we can do is make sure that we have a system in place that will ensure that every penny we spend goesdirectly to the children in need.</td></tr><tr><td rowspan=1 colspan=1>ER</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=4 colspan=1>Iagree. How much do you like to donate to the charity now? Your donation will be directly deducted from your task payment. You can choose any amount from $O to all your payment ($2). I am willing to donate full my payment $2. Wow, that is awesome! That is so kind of you!</td></tr><tr><td rowspan=1 colspan=1>ER</td></tr><tr><td rowspan=1 colspan=1>EE</td></tr><tr><td rowspan=1 colspan=1>ER</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1>You are welcome.</td></tr></table>
|
| 246 |
+
|
| 247 |
+
Table 10: A conversation between a machine persuader (ER) trained by ARDM and a human persuadee (EE)
|
| 248 |
+
|
| 249 |
+
<table><tr><td rowspan=1 colspan=1>Role</td><td rowspan=1 colspan=1>Utterance</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1>Hello</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1>Hi</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1>How are you doing today?</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1>I am good. thank you</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1>I was wondering if you would be interested in donating a portion of your payment from this HIT to a children's charity called Save the Children?</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1>Of course, I would like to. Can I know their website address ?</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1>Yes, URL</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1> Oh, cool. They are a good organization.</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=4 colspan=1> How much would you like to donate?I would like to donate $1.00 That is great! The research team will collect all donations and send it to Save theChildren. You are welcome.</td></tr><tr><td rowspan=1 colspan=1>EE</td></tr><tr><td rowspan=1 colspan=1>ER</td></tr><tr><td rowspan=1 colspan=1>EE</td></tr></table>
|
| 250 |
+
|
| 251 |
+
# E PERSUASIONFORGOOD SELF-PLAY EXAMPLES
|
| 252 |
+
|
| 253 |
+
We also present several self-play examples generated using our proposed ARDM.
|
| 254 |
+
|
| 255 |
+
Table 11: A conversation between a machine persuader (ER) and a machine persuadee (EE) trained by ARDM in self-play setting
|
| 256 |
+
|
| 257 |
+
<table><tr><td rowspan=1 colspan=1>Role</td><td rowspan=1 colspan=3>Utterance</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=3>Hello! How are you doing today?</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=3> Good, thank you. How are you?</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=3> I am good, thank you. Have you heard of the charity Save the Children?</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=3>Yes,I have heard about it. Iwould like to donate a dollar to it.</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=3> That is wonderful, it is so important to provide education and support to the children. I am sure you will agree that this is a great cause. Do you donate to charities?</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=2 colspan=3>Yes, I do donate to several charities. Are you sure you want to donate a dollar to Save the Children? Children all over the world are suffering due to poverty, war, and other issues. Would you consider donating a little bit of your incoming task payment?</td></tr><tr><td rowspan=1 colspan=1>ER</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=3 colspan=3> I may donate a dollar. I don't have a lot of money right now but I would like to help. That is great to hear. I know your donation is a small amount but the impact this will have on the world can be significant. Your donation would be directly deducted from your task payment.That is true. I will donate one dollar to the charity.</td></tr><tr><td rowspan=1 colspan=1>ER</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=2></td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=2> Thank you so much for your donation, it will help many children.</td><td rowspan=2 colspan=1> Thank you so much for your donation, it will help many children. Thank you. I hope you will continue to donate to the charity.</td></tr><tr><td rowspan=1 colspan=1>EE</td><td></td><td></td></tr></table>
|
| 258 |
+
|
| 259 |
+
Table 12: A conversation between a machine persuader (ER) and a machine persuadee (EE) trained by ARDM in self-play setting
|
| 260 |
+
|
| 261 |
+
<table><tr><td rowspan=1 colspan=1>Role</td><td rowspan=1 colspan=1>Utterance</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1>Hi there!</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1> Hi, I'm Carolyn. How are you today?</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1>I am good, thank you. I am also here to talk about a charity called Save the Children.Do you have any idea about that?</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1> I think it's something that I should know about, but I don't have the funds.</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> I understand that, I know that for sure.</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1> I am glad to hear that. How does it help children in the USA?</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> It is really great. I am here to talk to you about something that is really important to me. I am here to tell you about something that I am really passionate about.</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1> I think it's a very important issue. I don't want to donate to charities that I know arenot helping children.</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1>Yes, it is.</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1>Do you donate regularly to others ?</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1>I have not yet, I am not sure.</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1>I feel a little guilty for not donating when I think about the children I have lost.</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1>Yeah, I totally understand.</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1>I would like to donate to a charity that I feel would be able to help all the children inthe world.</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> Awesome! That is great. How much would you like to donate to Save the Children?</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1>I would like to donate $1.00</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=2 colspan=1>Great! That is awesome. I am happy to hear that. I have heard about Save the Children, and it is something thatI really, truly need.</td></tr><tr><td rowspan=1 colspan=1>EE</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=2 colspan=1> That is so great of you.Thank you for the opportunity.</td></tr><tr><td rowspan=1 colspan=1>EE</td></tr></table>
|
| 262 |
+
|
| 263 |
+
Table 13: A conversation between a machine persuader (ER) and a machine persuadee (EE) trained by ARDM in self-play setting
|
| 264 |
+
|
| 265 |
+
<table><tr><td rowspan=1 colspan=1>Role</td><td rowspan=1 colspan=1>Utterance</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1>hello how are you?</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1>I'm doing well, how are you?</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> I'm doing well, thanks for asking. I was wondering if you would be willing to donate a portion of your task payment to save the children.</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1> I'm interested, how much will you donate?</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> I would like to donate the entire amount, but I'm not sure how much I'd be able todonate. Do you have any other questions ?</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1> I think I know the amount I would donate.</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> I completely understand, I am hoping you would be willing to donate even a small amount. Save the children is an amazing charity that helps children in need around the world.</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1>How much do you think I can donate?</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> I would like to donate a minimum of $2. I was wondering if you would be willing to donate any more, would you be willing to donate even a little bit of your task payment?</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=2 colspan=1>I think I can donate $1. That's very kind of you. I would be happy to do that, but I can't think of any other charities I would be able to donate to. I am glad to hear that.</td></tr><tr><td rowspan=1 colspan=1>ER</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1> I think you are very generous, and I am sure this will help in the future.</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=2 colspan=1> It is wonderful to hear. Thank you for your donation. You are very welcome, and thank you for the opportunity to help.</td></tr><tr><td rowspan=1 colspan=1>EE</td></tr></table>
|
| 266 |
+
|
| 267 |
+
Table 14: A conversation between a machine persuader (ER) and a machine persuadee (EE) trained by ARDM in self-play setting
|
| 268 |
+
|
| 269 |
+
<table><tr><td rowspan=1 colspan=1>Role</td><td rowspan=1 colspan=1>Utterance</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1>Hi, how are you today?</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1>I'm doing well! How are you?</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> I am doing well as well, I hope you have a nice day.</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1>I am as well.</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> Do you have children?</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1> Yes, I do. I have three boys and one girl.</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> Have you ever donated to a charity?</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1>No. I don't.</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> Have you heard of Save the Children?</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1>I have not.</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1>The charity is an international non-governmental organization that promotes chil- dren's rights, provides relief and helps support children in developing countries.</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1> I think they are a good organization.</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> I am sure they would be happy to help.</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1> I think they would.</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=1 colspan=1> Do you donate to charities ?</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=2 colspan=1>I do. How much do you like to donate to the charity now? Your donation will be directly deducted from your task payment. You can choose any amount from $O to all your payment ($2).</td></tr><tr><td rowspan=1 colspan=1>ER</td></tr><tr><td rowspan=1 colspan=1>EE</td><td rowspan=1 colspan=1> I would like to donate $0.50.</td></tr><tr><td rowspan=1 colspan=1>ER</td><td rowspan=2 colspan=1> That is very generous of you. I hope they are able to help a lot of children.</td></tr><tr><td rowspan=1 colspan=1>EE</td></tr></table>
|
md/train/HklBjCEKvH/HklBjCEKvH.md
ADDED
|
@@ -0,0 +1,267 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GENERALIZATION THROUGH MEMORIZATION: NEAREST NEIGHBOR LANGUAGE MODELS
|
| 2 |
+
|
| 3 |
+
Urvashi Khandelwal†∗, Omer Levy‡, Dan Jurafsky†, Luke Zettlemoyer‡ & Mike Lewis‡
|
| 4 |
+
|
| 5 |
+
†Stanford University
|
| 6 |
+
‡Facebook AI Research
|
| 7 |
+
{urvashik,jurafsky}@stanford.edu {omerlevy,lsz,mikelewis}@fb.com
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
We introduce $k$ NN-LMs, which extend a pre-trained neural language model (LM) by linearly interpolating it with a $k$ -nearest neighbors (kNN) model. The nearest neighbors are computed according to distance in the pre-trained LM embedding space, and can be drawn from any text collection, including the original LM training data. Applying this augmentation to a strong WIKITEXT- $1 0 3 \ \mathrm { L M }$ , with neighbors drawn from the original training set, our kNN-LM achieves a new stateof-the-art perplexity of $1 5 . 7 9 - \mathbf { a } 2 . 9 $ point improvement with no additional training. We also show that this approach has implications for efficiently scaling up to larger training sets and allows for effective domain adaptation, by simply varying the nearest neighbor datastore, again without further training. Qualitatively, the model is particularly helpful in predicting rare patterns, such as factual knowledge. Together, these results strongly suggest that learning similarity between sequences of text is easier than predicting the next word, and that nearest neighbor search is an effective approach for language modeling in the long tail.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Neural language models (LMs) typically solve two subproblems: (1) mapping sentence prefixes to fixed-sized representations, and (2) using these representations to predict the next word in the text (Bengio et al., 2003; Mikolov et al., 2010). We present a new language modeling approach that is based on the hypothesis that the representation learning problem may be easier than the prediction problem. For example, any English speaker knows that Dickens is the author of and Dickens wrote will have essentially the same distribution over the next word, even if they do not know what that distribution is. We provide strong evidence that existing language models, similarly, are much better at the first problem, by using their prefix embeddings in a simple nearest neighbor scheme that significantly improves overall performance.
|
| 16 |
+
|
| 17 |
+
We introduce $k \mathrm { N N - L M }$ , an approach that extends a pre-trained LM by linearly interpolating its next word distribution with a $k$ -nearest neighbors $( k \mathrm { N N } )$ model. The nearest neighbors are computed according to distance in the pre-trained embedding space and can be drawn from any text collection, including the original LM training data. This approach allows rare patterns to be memorized explicitly, rather than implicitly in model parameters. It also improves performance when the same training data is used for learning the prefix representations and the $k \mathbf { N N }$ model, strongly suggesting that the prediction problem is more challenging than previously appreciated.
|
| 18 |
+
|
| 19 |
+
To better measure these effects, we conduct an extensive empirical evaluation. Applying our $k \mathbf { N N }$ augmentation to a strong WIKITEXT- $1 0 3 \ \mathrm { L M }$ using only the original dataset achieves a new stateof-the-art perplexity of 15.79 – a 2.86 point improvement over the base model (Baevski & Auli, 2019) – with no additional training. We also show that the approach has implications for efficiently scaling up to larger training sets and allows for effective domain adaptation, by simply varying the nearest neighbor datastore. Training a model on 100-million tokens and using $k \mathbf { N N }$ search over a 3-billion token dataset can outperform training the same model on all 3-billion tokens, opening a new path for efficiently using large datasets in language models. Similarly, adding out-of-domain data to the datastore makes a single LM useful across multiple domains, again without further training. Qualitatively, we find the model is particularly helpful for long-tail patterns, such as factual knowledge, which might be easier to access via explicit memory.
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1: An illustration of $k \mathrm { N N - L M }$ . A datastore is constructed with an entry for each training set token, and an encoding of its leftward context. For inference, a test context is encoded, and the $k$ most similar training contexts are retrieved from the datastore, along with the corresponding targets. A distribution over targets is computed based on the distance of the corresponding context from the test context. This distribution is then interpolated with the original model’s output distribution.
|
| 23 |
+
|
| 24 |
+
# 2 NEAREST NEIGHBOR LANGUAGE MODELING
|
| 25 |
+
|
| 26 |
+
Language models (LMs) assign probabilities to sequences. Given a context sequence of tokens ${ c _ { t } } = ( w _ { 1 } , \dots { w _ { t - 1 } } )$ , autoregressive LMs estimate $\bar { p ( \boldsymbol { w } _ { t } | \boldsymbol { c } _ { t } ) }$ , the distribution over the target token $w _ { t }$ .
|
| 27 |
+
|
| 28 |
+
The $k \mathrm { N N - L M }$ involves augmenting such a pre-trained LM with a nearest neighbors retrieval mechanism, without any additional training (the representations learned by the LM remain unchanged). This can be done with a single forward pass over a text collection (potentially including the original LM training set), where the resulting context-target pairs are stored in a key-value datastore that is queried during inference, as illustrated in Figure 1.
|
| 29 |
+
|
| 30 |
+
Datastore Let $f ( \cdot )$ be the function that maps a context $c$ to a fixed-length vector representation computed by the pre-trained LM. For instance, in a Transformer LM, $f ( c )$ could map $c$ to an intermediate representation that is output by an arbitrary self-attention layer. Then, given the $i$ -th training example $( c _ { i } , w _ { i } ) \in \mathcal { D }$ , we define the key-value pair $( k _ { i } , v _ { i } )$ , where the key $k _ { i }$ is the vector representation of the context $f ( c _ { i } )$ and the value $v _ { i }$ is the target word $w _ { i }$ . The datastore $( \kappa , \nu )$ is thus the set of all key-value pairs constructed from all the training examples in $\mathcal { D }$ :
|
| 31 |
+
|
| 32 |
+
$$
|
| 33 |
+
( \mathcal { K } , \mathcal { V } ) = \{ ( f ( c _ { i } ) , w _ { i } ) | ( c _ { i } , w _ { i } ) \in \mathcal { D } \}
|
| 34 |
+
$$
|
| 35 |
+
|
| 36 |
+
Inference At test time, given the input context $x$ the model generates the output distribution over next words $p _ { \mathrm { L M } } ( y | x )$ and the context representation $f ( x )$ . The model queries the datastore with $f ( x )$ to retrieve its $k$ -nearest neighbors $\mathcal { N }$ according to a distance function $d ( \cdot , \cdot )$ (squared $L ^ { 2 }$ distance in our experiments, making the similarity function an RBF kernel).Then, it computes a distribution over neighbors based on a softmax of their negative distances, while aggregating probability mass for each vocabulary item across all its occurrences in the retrieved targets (items that do not appear in the retrieved targets have zero probability):
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
p _ { \mathrm { k N N } } ( y | x ) \propto \sum _ { ( k _ { i } , v _ { i } ) \in \mathcal { N } } \mathbb { 1 } _ { y = v _ { i } } \exp ( - d ( k _ { i } , f ( x ) ) )
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
Finally, we follow Grave et al. (2017a) and interpolate the nearest neighbor distribution $p _ { \mathrm { k N N } }$ with the model distribution $p _ { \mathrm { L M } }$ using a tuned parameter $\lambda$ to produce the final $k$ NN-LM distribution:
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
p ( y | x ) = \lambda p _ { \mathrm { k N N } } ( y | x ) + ( 1 - \lambda ) p _ { \mathrm { L M } } ( y | x )
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
Implementation The datastore contains an entry for each target in the training set, which for LMs can be up to billions of examples. To search over this large datastore, we use FAISS (Johnson et al., 2017), an open source library for fast nearest neighbor retrieval in high dimensional spaces. FAISS speeds up search by clustering the keys and looking up neighbors based on the cluster centroids, while reducing memory usage by storing compressed versions of the vectors. We found in preliminary experiments that using $\dot { L } ^ { 2 }$ distance for FAISS retrieval results in better performance for kNN-LM, compared to inner product distance.
|
| 49 |
+
|
| 50 |
+
Related Cache Models Prior work (Grave et al., 2017c; Merity et al., 2017) used a similar approach to compute similarity to the previous hidden states of test documents, making it easier to copy rare vocabulary items from the recent past. Such techniques have been less popular since the development of Transformers (Vaswani et al., 2017), which can learn to copy recent words using self-attention; in Section 4.1, we observe relatively small gains from caching recent items in the same test document a la Grave et al. (2017c). Most relatedly, Grave et al. (2017a) describe an \` online language model using nearest neighbor search over all previous hidden states, to improve domain adaptation. In our work, we only save training data, with the goal of explicitly memorizing training examples to better generalize to similar cases at test time.
|
| 51 |
+
|
| 52 |
+
# 3 EXPERIMENTAL SETUP
|
| 53 |
+
|
| 54 |
+
Data Experiments in this paper use the following English corpora:
|
| 55 |
+
|
| 56 |
+
WIKITEXT-103 is a standard benchmark by Merity et al. (2017) for autoregressive language modeling with a 250K word-level vocabulary. It consists of 103M tokens of Wikipedia in the training set and 250K tokens in each of the development and test sets.
|
| 57 |
+
|
| 58 |
+
BOOKS is the Toronto Books Corpus (Zhu et al., 2015), containing 0.7B. Complete books are held out for validation/test.
|
| 59 |
+
|
| 60 |
+
WIKI-3B is English Wikipedia, containing about 2.87B tokens. Whole articles are held out for validation/test.
|
| 61 |
+
|
| 62 |
+
WIKI-100M is a random 100M token subset of WIKI-3B, consisting of complete articles.
|
| 63 |
+
|
| 64 |
+
Except for WIKITEXT-103, text is tokenized using the byte-pair encoding (Sennrich et al., 2015) with the 29K subword vocabulary from BERT (Devlin et al., 2019).
|
| 65 |
+
|
| 66 |
+
Model Architecture kNN-LM is compatible with any model that produces fixed size context representations. We use decoder-only Transformers (Vaswani et al., 2017) for language modeling, which are the current state of the art. Since the kNN-LM makes no changes to the underlying LM, we take the exact architecture and optimization described by Baevski & Auli (2019) and use it to create a kNN-LM for inference. This model consists of 16 layers, each with 16 self-attention heads, 1024 dimensional hidden states, and 4096 dimensional feedforward layers, amounting to 247M trainable parameters. It processes 3072 tokens of context per example for WIKITEXT-103 and 1024 tokens for the rest of the corpora. Following Baevski & Auli (2019), we use adaptive inputs and an adaptive softmax (Grave et al., 2017b) with tied weights (Press & Wolf, 2017) for the WIKITEXT-103 experiments. On other datasets we do not use adaptive inputs or an adaptive softmax.
|
| 67 |
+
|
| 68 |
+
Evaluation LMs are trained to minimize the negative log-likelihood of the training corpus, and evaluated by perplexity (exponentiated negative log-likelihood) on held out data. Following Baevski & Auli (2019), 512 tokens are scored per test example, but up to 2560 tokens of extra prior context is provided for WIKITEXT-103 and up to 512 tokens of extra prior context is provided for the rest of the corpora.
|
| 69 |
+
|
| 70 |
+
kNN-LM The keys used for kNN-LM are the 1024-dimensional representations fed to the feedforward network in the final layer of the Transformer LM (after self-attention and layernorm; see Section 5 for further explanation). We perform a single forward pass over the training set with the trained model, in order to save the keys and values. During this forward pass, each target token is provided a minimum of 1536 tokens of prior context for WIKITEXT-103 and a minimum of 512 tokens for the rest of the corpora. A FAISS index is then created using 1M randomly sampled keys to learn 4096 cluster centroids. For efficiency, keys are quantized to 64-bytes. During inference, we retrieve $k = 1 0 2 4$ neighbors, and the index looks up 32 cluster centroids while searching for the nearest neighbors. For WIKITEXT-103 experiments, we compute squared $L ^ { 2 }$ distances with full precision keys, but for the other datasets we use the FAISS $L ^ { 2 }$ distances (not squared) between quantized keys directly, for faster evaluation. We tune the interpolation parameter $\lambda$ on the validation set.1
|
| 71 |
+
|
| 72 |
+
Table 1: Performance on WIKITEXT-103. The $k \mathrm { N N - L M }$ substantially outperforms existing work. Gains are additive with the related but orthogonal continuous cache, allowing us to improve the base model by almost 3 perplexity points with no additional training. We report the median of three random seeds.
|
| 73 |
+
|
| 74 |
+
<table><tr><td>Model</td><td colspan="2">Perplexity (↓)</td><td># Trainable Params</td></tr><tr><td></td><td>Dev</td><td>Test</td><td></td></tr><tr><td>Baevski & Auli (2019)</td><td>17.96</td><td>18.65</td><td>247M</td></tr><tr><td>+Transformer-XL (Dai et al., 2019)</td><td>1</td><td>18.30</td><td>257M</td></tr><tr><td>+Phrase Induction (Luo et al., 2019)</td><td>-</td><td>17.40</td><td>257M</td></tr><tr><td>Base LM (Baevski & Auli, 2019)</td><td>17.96</td><td>18.65</td><td>247M</td></tr><tr><td>+kNN-LM</td><td>16.06</td><td>16.12</td><td>247M</td></tr><tr><td>+Continuous Cache (Grave et al., 2017c)</td><td>17.67</td><td>18.27</td><td>247M</td></tr><tr><td>+kNN-LM + Continuous Cache</td><td>15.81</td><td>15.79</td><td>247M</td></tr></table>
|
| 75 |
+
|
| 76 |
+
Table 2: Performance on BOOKS, showing that $k$ NN-LM works well in multiple domains.
|
| 77 |
+
|
| 78 |
+
<table><tr><td>Model</td><td colspan="2">Perplexity (↓) Dev Test</td><td># Trainable Params</td></tr><tr><td>Base LM (Baevski & Auli, 2019)</td><td>14.75</td><td>11.89</td><td>247M</td></tr><tr><td>+kNN-LM</td><td>14.20</td><td>10.89</td><td>247M</td></tr></table>
|
| 79 |
+
|
| 80 |
+
Computational Cost Although the $k \mathrm { N N - L M }$ requires no training given an existing LM, it does add some other computational overheads. Storing the keys and values requires a single forward pass over the training set, which amounts to a fraction of the cost of training for one epoch on the same examples. Once the keys are saved, for WIKITEXT-103 building the cache with 103M entries takes roughly two hours on a single CPU. Finally, running on the validation set took approximately 25 minutes when retrieving 1024 keys. While the cost of building a large cache grows linearly in the number of entries, it is trivial to parallelize and requires no GPU-based training.
|
| 81 |
+
|
| 82 |
+
# 4 EXPERIMENTS
|
| 83 |
+
|
| 84 |
+
# 4.1 USING THE TRAINING DATA AS THE DATASTORE
|
| 85 |
+
|
| 86 |
+
We first experiment with creating a datastore from the same data used to train the LM. Table 1 shows that kNN-LM improves perplexity on WIKITEXT-103 from 18.65 (Baevski & Auli, 2019) to a new state-of-the-art of 16.12. We also provide reported perplexities from two other recent models that also build upon Baevski and Auli’s, suggesting that further improvements may be possible by augmenting the kNN-LM with these techniques. We compare with models trained only on the standard training set, but recent work has shown performance can be improved by training on additional data, from either the test set (Krause et al., 2019) or large amounts of web text (Shoeybi et al., 2019).
|
| 87 |
+
|
| 88 |
+
We also experiment with a continuous cache model, a related but orthogonal technique from Grave et al. (2017c), in which the model saves and retrieves neighbors from earlier in the test document,
|
| 89 |
+
|
| 90 |
+
<table><tr><td>Training Data</td><td>Datastore</td><td>Perplexity (↓) Dev</td><td>Test</td></tr><tr><td>WIKI-3B</td><td></td><td>16.11</td><td>15.17</td></tr><tr><td>WIKI-100M</td><td>-</td><td>20.99</td><td>19.59</td></tr><tr><td>WIKI-100M</td><td>WIKI-3B</td><td>14.61</td><td>13.73</td></tr></table>
|
| 91 |
+
|
| 92 |
+
Table 3: Experimental results on WIKI-3B. The model trained on $1 0 0 \mathbf { M }$ tokens is augmented with a datastore that contains about 3B training examples, outperforming the vanilla LM trained on the entire WIKI-3B training set.
|
| 93 |
+
|
| 94 |
+

|
| 95 |
+
Figure 2: Varying the size of the datastore. (a) Increasing the datastore size monotonically improves performance, and has not saturated even at about 3B tokens. A $k \mathrm { N N - L M }$ trained on 100M tokens with a datastore of 1.6B tokens already outperforms the LM trained on all 3B tokens. (b) The optimal value of $\lambda$ increases with the size of the datastore.
|
| 96 |
+
|
| 97 |
+
rather than the training set. Gains from interpolating with the continuous cache are smaller than reported in the original setting that used LSTMs, perhaps because self-attentive language models can learn to perform such queries. Improvements from the continous cache are additive with the kNN-LM, pushing our state-of-the-art result to 15.79, a gain of 2.86 over the base model.
|
| 98 |
+
|
| 99 |
+
Finally, we repeat the experiment using text from a different domain, BOOKS, to control for the possibility that encyclopedic Wikipedia text is somehow uniquely good for caching. Table 2 shows an improvement in test set perplexity from 11.89 to 10.89, suggesting that this is not the case.
|
| 100 |
+
|
| 101 |
+
# 4.2 MORE DATA WITHOUT TRAINING
|
| 102 |
+
|
| 103 |
+
Section 4.1 has shown that retrieving neighbors from the training data can significantly improve language modeling performance. This raises the question: can retrieving nearest neighbors from data be a substitute for training on it? To test this, we train a LM on WIKI-100M and use it to build a datastore from WIKI-3B, a corpus 30 times larger than the training set. We then compare this kNN-LM to a vanilla LM trained on the entire WIKI-3B corpus.2
|
| 104 |
+
|
| 105 |
+
Table 3 shows that, as expected, the model trained on 3B tokens dramatically outperforms the model trained on 100M tokens, improving perplexity from 19.59 to 15.17. However, adding nearest neighbors retrieval over those 3B examples to the model trained on 100M tokens improves perplexity from 19.59 to 13.73; i.e. retrieving nearest neighbors from the corpus outperforms training on it. This result suggests that rather than training language models on ever larger datasets, we can use smaller datasets to learn representations and augment them with kNN-LM over a large corpus.
|
| 106 |
+
|
| 107 |
+
Table 4: Domain adaptation experiments, with results on BOOKS. Adding an in-domain datastore to a Wikipedia-trained model improves results by 23 points, approaching in-domain training.
|
| 108 |
+
|
| 109 |
+
<table><tr><td>Training Data</td><td>Datastore</td><td colspan="2">Perplexity (↓)</td></tr><tr><td></td><td></td><td>Dev</td><td>Test</td></tr><tr><td>WIKI-3B</td><td></td><td>37.13</td><td>34.84</td></tr><tr><td>BOOKS</td><td>1</td><td>14.75</td><td>11.89</td></tr><tr><td>WIKI-3B</td><td>BOOKS</td><td>24.85</td><td>20.47</td></tr></table>
|
| 110 |
+
|
| 111 |
+

|
| 112 |
+
Figure 3: Transformer LM layer.
|
| 113 |
+
|
| 114 |
+
Table 5: WIKITEXT-103 validation results using different states from the final layer of the LM as the representation function $f ( \cdot )$ for keys and queries. We retrieve $k { = } 1 0 2 4$ neighbors and $\lambda$ is tuned for each.
|
| 115 |
+
|
| 116 |
+
<table><tr><td>Key Type</td><td>Dev ppl. (↓)</td></tr><tr><td>No datastore</td><td>17.96</td></tr><tr><td>Model output</td><td>17.07</td></tr><tr><td>Model output layer normalized</td><td>17.01</td></tr><tr><td>FFN input after layer norm</td><td>16.06</td></tr><tr><td>FFN input before layer norm</td><td>17.06</td></tr><tr><td>MHSA input after layer norm</td><td>16.76</td></tr><tr><td>MHSA input before layer norm</td><td>17.14</td></tr></table>
|
| 117 |
+
|
| 118 |
+
To understand how the amount of data used for $k \mathbf { N N }$ retrieval affects performance, we use the WIKI$1 0 0 \mathbf { M }$ model to create datastores using different amounts of randomly sampled data from WIKI-3B. Figure 2a shows that using only 1.6B examples for the datastore already surpasses the performance of the model trained on all of WIKI-3B. In addition, performance does not saturate at 3B examples in the datastore, suggesting that growing the datastore more could lead to further gains. Figure 2b shows the model relies more on the $k \mathbf { N N }$ component as the size of the datastore increases.
|
| 119 |
+
|
| 120 |
+
# 4.3 DOMAIN ADAPTATION
|
| 121 |
+
|
| 122 |
+
We also experiment with domain adaptation by creating a datastore on the target domain training set. Table 4 shows that an in-domain LM on BOOKS has a relatively low perplexity (11.89), while a model trained on WIKI-3B performs poorly on the BOOKS domain (34.84 perplexity). Adding $k \mathbf { N N }$ search over BOOKS to the WIKI-3B model reduces perplexity by 14 points (to 20.47), demonstrating that kNN-LM allows a single model to be useful in multiple domains, by simply adding a datastore per domain.
|
| 123 |
+
|
| 124 |
+
# 5 TUNING NEAREST NEIGHBOR SEARCH
|
| 125 |
+
|
| 126 |
+
While the $k \mathrm { N N - L M }$ is conceptually straightforward, and requires no additional training, a number of hyperparameters are introduced for nearest neighbor search. We experiment with different choices here.
|
| 127 |
+
|
| 128 |
+
Key Function For similarity search, we extract a representation of context $c$ using an intermediate state of the LM $f ( c )$ . Transformers compute a number of different intermediate states, and we compare several choices depicted in Figure 3, with results shown in Table 5. While all the instantiations of $f$ we tried are helpful, we achieved the largest improvement by using the input to the final layer’s feedforward network. We also observe that normalized representations (i.e. taken immediately after the layer norm) perform better. Repeating the experiment on the second-last transformer layer showed similar trends with slightly worse results (not shown), suggesting that the feedforward layer might be focusing more on the prediction problem, while the onus of representing the input falls more on the self-attention layer.
|
| 129 |
+
|
| 130 |
+

|
| 131 |
+
Figure 4: Effect of the number of nearest neighbors returned per word on WIKITEXT-103 (validation set). Returning more entries from the datastore monotonically improves performance.
|
| 132 |
+
|
| 133 |
+

|
| 134 |
+
Figure 5: Effect of interpolation parameter $\lambda$ on in-domain (left y-axis) and out-of-domain (right y-axis) validation set performances. More weight on $p _ { k N N }$ improves domain adaptation.
|
| 135 |
+
|
| 136 |
+
Number of Neighbors per Query Each query returns the top- $k$ neighbors. Figure 4 shows that performance monotonically improves as more neighbors are returned, and suggests that even larger improvements may be possible with a higher value of $k$ . Nonetheless, even a small number of neighbors $k = 8$ ) is enough to achieve a new state of the art.
|
| 137 |
+
|
| 138 |
+
Interpolation Parameter We use a parameter $\lambda$ to interpolate between the base model distribution and the distribution from $k \mathbf { N N }$ search over the dataset. Figure 5 shows that $\lambda = 0 . 2 5$ is optimal on WIKITEXT-103. However, $\lambda = 0 . 6 5$ works best for domain adaptation results (Figure 5).
|
| 139 |
+
|
| 140 |
+
Precision of Similarity Function In FAISS, the nearest neighbor search computes $L ^ { 2 }$ distances against quantized keys. We found results were improved from 16.5 perplexity on WIKITEXT-103 to 16.06 by computing squared $L ^ { 2 }$ distances with full precision keys for Equation 2.
|
| 141 |
+
|
| 142 |
+
# 6 ANALYSIS
|
| 143 |
+
|
| 144 |
+
Qualitative Analysis To understand why $k \mathrm { N N - L M }$ improves performance, we manually examine cases in which $p _ { \mathrm { k N N } }$ was significantly better than $p _ { \mathrm { L M } }$ . Table 6 shows one such example, along with several others in Appendix A. The example shows an interesting case where the model matches the trigram impact on the in several retrieved neighbors, but puts almost all weight on the most relevant neighbor, thus adding more value than an $n$ -gram LM.
|
| 145 |
+
|
| 146 |
+
In general, we find that examples where $k \mathrm { N N - L M }$ is most helpful typically contain rare patterns. Examples include factual knowledge, names, and near-duplicate sentences from the training set. In these cases, assigning train and test instances similar representations (via $f ( \cdot ) \mathrm { \ddot { \it { \Delta } } }$ ) appears to be an easier problem than implicitly memorizing the next word in model parameters.
|
| 147 |
+
|
| 148 |
+
Simple vs Neural Representation We observe that many long-tail phenomena manifest as rare $n$ -grams (e.g. names). Is it therefore possible to interpolate an $n$ -gram model with a Transformer LM, as an alternative to our $k \mathbf { N N }$ approach? Figure 7 shows little improvement from using $n$ -gram LMs – 0.2 perplexity points (similarly to Bakhtin et al. (2018)). This result highlights the need to use the learned representation function $f ( \cdot )$ to measure similarity between more varied contexts.
|
| 149 |
+
|
| 150 |
+
Implicit vs Explicit Memory If a neural representation function is crucial for $k \mathrm { N N - L M }$ , could implicitly memorizing the training dataset in the neural network parameters replace the explicit memory in the datastore? To test this, we train a Transformer LM with no dropout. Figure 8 shows that this model eventually reaches zero training loss, indicating that it can make perfect predictions for all examples in the training set; the model has memorized the dataset. Naturally, the memorizing LM overfits, i.e. the training loss drops to 0 while the best validation perplexity is much higher at 28.59. For comparison, the vanilla Transformer LM (with dropout) has a much higher training loss (shown in Figure 8), but also generalizes better with a validation perplexity of 17.96. This result shows that the Transformer has sufficient capacity to memorize the training set.
|
| 151 |
+
|
| 152 |
+
<table><tr><td>Test Context (pkNN = 0.998,pLM = 0.124)</td><td>Test Target</td><td></td></tr><tr><td>it was organised by New Zealand international player Joseph Warbrick, promoted by civil servant Thomas Eyton, and managed by James Scott, a publican. The Nativeswere the first New Zealand team to perform a haka, and also the first to wear all black. They played 1O7 rugby matches during the tour,as well as a small number of Victorian Rules football and associ- ation football matches in Australia. Having made a significant impact on the...</td><td colspan="2">development</td></tr><tr><td>Training Set Context</td><td>Training Set Target</td><td>Context Probability</td></tr><tr><td>Asthe captain and instigator of the 1888-89 Natives-the first New Zealand team to tour the British Isles-Warbrick had a lasting impact on the..</td><td>development</td><td>0.998</td></tr><tr><td>promoted to a new first grade competition which started in 19oo.Glebe immediately made a big impact on the...</td><td>district</td><td>0.00012</td></tr><tr><td>centuries,few were as large as other players managed. However, others contend that his impact on the...</td><td>game</td><td>0.000034</td></tr><tr><td>Nearly every game in the main series has either an anime or manga adap-developmentO.00000092 tation,or both.The series has had a significant impact on the..</td><td></td><td></td></tr></table>
|
| 153 |
+
|
| 154 |
+

|
| 155 |
+
Figure 6: Example where the $k \mathbf { N N }$ model has much higher confidence in the correct target than the LM. Although there are other training set examples with similar local $n$ -gram matches, the nearest neighbour search is highly confident of specific and very relevant context.
|
| 156 |
+
|
| 157 |
+

|
| 158 |
+
Figure 7: Interpolating the Transformer LM with $n$ -gram LMs on WIKITEXT-103 (validation set). Using $k \mathrm { N N - L M }$ gives a much lower perplexity, suggesting that the representations are learning more than just matching local context.
|
| 159 |
+
Figure 8: Training curves for the Transformer LM with and without dropout. Turning off dropout allows the training loss to go to 0, indicating that the model has sufficient capacity to memorize the training data.
|
| 160 |
+
|
| 161 |
+
We consider whether the memorizing LM can be an effective substitute for nearest neighbor search. Interpolating the memorizing LM with the original LM improves validation perplexity by just 0.1 – compared to 1.9 from $k \mathrm { N N - L M }$ . This result suggests that although the Transformer is expressive enough to memorize all training examples, learning to do so does not result in context representations that generalize. In contrast, kNN-LM memorizes training data while improving generalization.
|
| 162 |
+
|
| 163 |
+
From these experiments, we conjecture that kNN-LM improves performance because (1) the Transformer LM is very good at learning a representation function for contexts with an implicit notion of similarity, and (2) while the Transformer has capacity to memorize all training examples, doing so causes its representation to generalize less effectively, but (3) the $k \mathrm { N N - L M }$ allows the model to memorize the training data while retaining an effective similarity function.
|
| 164 |
+
|
| 165 |
+
# 7 RELATED WORK
|
| 166 |
+
|
| 167 |
+
We discuss related uses of caches for language modeling in Section 2.
|
| 168 |
+
|
| 169 |
+
Similar $k \mathbf { N N }$ models to ours have been proposed for computer vision tasks (Papernot & McDaniel, 2018; Orhan, 2018; Zhao & Cho, 2018), primarily motivated by improving interpretability and robustness to adversarial attacks. We hypothesize that our method may be particularly effective for language modeling, because plentiful unlabeled data allows datastores of billions of tokens, and language modeling often requires world knowledge to be learnt from few examples.
|
| 170 |
+
|
| 171 |
+
Nearest neighbor models have been applied to a number of NLP problems in the past, such as part of speech tagging (Daelemans et al., 1996) and morphological analysis (Bosch et al., 2007), but the use of learned representations makes the similarity function much more effective in the case of neural models. More recently, Kaiser et al. (2017) have used a similarly differentiable memory that is learned and updated during training, and is applied to one-shot learning tasks.
|
| 172 |
+
|
| 173 |
+
Several models have also improved language generation by using training examples directly at test time. Guu et al. (2018) propose a model that samples training sentences at random and edits them with a sequence-to-sequence model, but does not use a retrieval mechanism such as $k \mathbf { N N }$ . Gu et al. (2018) introduce a translation model that attends over retrieved training set examples. Weston et al. (2018) improve a dialogue response generation model by refining similar instances from the training set. kNN-LM differs from these approaches by working at the level of individual tokens instead of whole training sentences, as well as not incorporating the retrieval mechanism into the training pipeline.
|
| 174 |
+
|
| 175 |
+
A general trend in machine learning, and in language modeling in particular, is that adding more data consistently improves performance (Devlin et al., 2019; Radford et al., 2019; Yang et al., 2019; Liu et al., 2019; Zellers et al., 2019; Shoeybi et al., 2019). Our work offers an alternative method for scaling language models, in which relatively small models learn context representations, and a nearest neighbour search acts as a highly expressive classifier.
|
| 176 |
+
|
| 177 |
+
# 8 CONCLUSION AND FUTURE WORK
|
| 178 |
+
|
| 179 |
+
We have introduced kNN-LMs, which can significantly outperform standard language models by directly querying training examples at test time. The approach can be applied to any neural language model. The success of this method suggests that learning similarity functions between contexts may be an easier problem than predicting the next word from some given context. Future work should explore explicitly training similarity functions, and reducing the size of the datastore.
|
| 180 |
+
|
| 181 |
+
# ACKNOWLEDGMENTS
|
| 182 |
+
|
| 183 |
+
The authors thank the anonymous reviewers as well as Sida Wang, Kartikay Khandelwal, Kevin Clark and members of the FAIR Seattle team for helpful discussions and comments.
|
| 184 |
+
|
| 185 |
+
# REFERENCES
|
| 186 |
+
|
| 187 |
+
Alexei Baevski and Michael Auli. Adaptive input representations for neural language modeling. In ICLR, 2019.
|
| 188 |
+
|
| 189 |
+
Anton Bakhtin, Arthur Szlam, Marc’Aurelio Ranzato, and Edouard Grave. Lightweight adaptive mixture of neural and n-gram language models. arXiv preprint arXiv:1804.07705, 2018.
|
| 190 |
+
|
| 191 |
+
Yoshua Bengio, Rejean Ducharme, Pascal Vincent, and Christian Jauvin. A neural probabilistic ´ language model. Journal of machine learning research, 3(Feb):1137–1155, 2003.
|
| 192 |
+
|
| 193 |
+
Antal van den Bosch, Bertjan Busser, Sander Canisius, and Walter Daelemans. An efficient memorybased morphosyntactic tagger and parser for dutch. LOT Occasional Series, 7:191–206, 2007.
|
| 194 |
+
|
| 195 |
+
Walter Daelemans, Jakub Zavrel, Peter Berck, and Steven Gillis. Mbt: A memory-based part of speech tagger-generator. In WVLC, 1996.
|
| 196 |
+
|
| 197 |
+
Zihang Dai, Zhilin Yang, Yiming Yang, William W Cohen, Jaime Carbonell, Quoc V Le, and Ruslan Salakhutdinov. Transformer-xl: Attentive language models beyond a fixed-length context. In ACL, 2019.
|
| 198 |
+
|
| 199 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In NAACL, 2019.
|
| 200 |
+
|
| 201 |
+
Edouard Grave, Moustapha M Cisse, and Armand Joulin. Unbounded cache model for online language modeling with open vocabulary. In NIPS, pp. 6042–6052, 2017a.
|
| 202 |
+
|
| 203 |
+
Edouard Grave, Armand Joulin, Moustapha Cisse, Herv ´ e J ´ egou, et al. Efficient softmax approxima- ´ tion for gpus. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 1302–1310. JMLR. org, 2017b.
|
| 204 |
+
|
| 205 |
+
Edouard Grave, Armand Joulin, and Nicolas Usunier. Improving neural language models with a continuous cache. In ICLR, 2017c.
|
| 206 |
+
|
| 207 |
+
Jiatao Gu, Yong Wang, Kyunghyun Cho, and Victor OK Li. Search engine guided neural machine translation. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
|
| 208 |
+
|
| 209 |
+
Kelvin Guu, Tatsunori B Hashimoto, Yonatan Oren, and Percy Liang. Generating sentences by editing prototypes. Transactions of the Association for Computational Linguistics, 6:437–450, 2018.
|
| 210 |
+
|
| 211 |
+
Jeff Johnson, Matthijs Douze, and Herve J ´ egou. Billion-scale similarity search with gpus. ´ arXiv preprint arXiv:1702.08734, 2017.
|
| 212 |
+
|
| 213 |
+
Łukasz Kaiser, Ofir Nachum, Aurko Roy, and Samy Bengio. Learning to remember rare events. In ICLR, 2017.
|
| 214 |
+
|
| 215 |
+
Ben Krause, Emmanuel Kahembwe, Iain Murray, and Steve Renals. Dynamic evaluation of transformer language models. arXiv preprint arXiv:1904.08378, 2019.
|
| 216 |
+
|
| 217 |
+
Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692, 2019.
|
| 218 |
+
|
| 219 |
+
Hongyin Luo, Lan Jiang, Yonatan Belinkov, and James Glass. Improving neural language models by segmenting, attending, and predicting the future. In ACL, 2019.
|
| 220 |
+
|
| 221 |
+
Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. ICLR, 2017.
|
| 222 |
+
|
| 223 |
+
Toma´s Mikolov, Martin Karafi ˇ at, Luk ´ a´s Burget, Jan ˇ Cernock ˇ y, and Sanjeev Khudanpur. Recurrent \` neural network based language model. In Eleventh annual conference of the international speech communication association, 2010.
|
| 224 |
+
|
| 225 |
+
A. Emin Orhan. A simple cache model for image recognition. In NeurIPS, 2018.
|
| 226 |
+
|
| 227 |
+
Nicolas Papernot and Patrick McDaniel. Deep k-nearest neighbors: Towards confident, interpretable and robust deep learning. arXiv preprint arXiv:1803.04765, 2018.
|
| 228 |
+
|
| 229 |
+
Ofir Press and Lior Wolf. Using the output embedding to improve language models. In ICLR, 2017.
|
| 230 |
+
|
| 231 |
+
Alec Radford, Jeff Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. URL https://d4mucfpksywv.cloudfront.net/betterlanguage-models/language-models.pdf, 2019.
|
| 232 |
+
|
| 233 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. arXiv preprint arXiv:1508.07909, 2015.
|
| 234 |
+
|
| 235 |
+
Mohammad Shoeybi, Mostofa Patwary, Raul Puri, Patrick LeGresley, Jared Casper, and Bryan Catanzaro. Megatron-lm: Training multi-billion parameter language models using gpu model parallelism. arXiv preprint arXiv:1909.08053, 2019.
|
| 236 |
+
|
| 237 |
+
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.
|
| 238 |
+
|
| 239 |
+
Jason Weston, Emily Dinan, and Alexander H Miller. Retrieve and refine: Improved sequence generation models for dialogue. arXiv preprint arXiv:1808.04776, 2018.
|
| 240 |
+
|
| 241 |
+
Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Ruslan Salakhutdinov, and Quoc V Le. Xlnet: Generalized autoregressive pretraining for language understanding. arXiv preprint arXiv:1906.08237, 2019.
|
| 242 |
+
|
| 243 |
+
Rowan Zellers, Ari Holtzman, Hannah Rashkin, Ali Farhadi, Franziska Roesner, and Yejin Choi. Defending against neural fake news. In NeurIPS, 2019.
|
| 244 |
+
|
| 245 |
+
Jake Zhao and Kyunghyun Cho. Retrieval-augmented convolutional neural networks for improved robustness against adversarial examples. arXiv preprint arXiv:1802.09502, 2018.
|
| 246 |
+
|
| 247 |
+
Yukun Zhu, Ryan Kiros, Rich Zemel, Ruslan Salakhutdinov, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Aligning books and movies: Towards story-like visual explanations by watching movies and reading books. In Proceedings of the IEEE international conference on computer vision, pp. 19–27, 2015.
|
| 248 |
+
|
| 249 |
+
# A APPENDIX
|
| 250 |
+
|
| 251 |
+
This section provides several examples where $p _ { \mathrm { k N N } }$ places higher probability mass on the true target, compared to $p _ { \mathrm { L M } }$ .
|
| 252 |
+
|
| 253 |
+
Table 6: Another example where the $k \mathbf { N N }$ model places much higher probability mass on the correct target, compared to the LM. The nearest neighbors search has retrieved a training set context that is extremely similar to the test context, while very rare and in the long-tail of patterns.
|
| 254 |
+
|
| 255 |
+
<table><tr><td>Test Context(pkNN = O.995,pLM = 0.025)</td><td colspan="2">Test Target</td></tr><tr><td>For Australians and New Zealanders the Gallipoli campaign came to sym- bolise an important milestone in the emergence of both nations as indepen- dent actors on the world stage and the development of a sense of national identity. Today,the date of the initial landings,25April,is knownasAn- zac Day in Australia and New Zealand and every year thousands of people gather at memorials in both nations, as well as Turkey, to...</td><td colspan="2">honour</td></tr><tr><td>Training Set Context Despite this,for Australians and New Zealanders the Gallipoli campaign</td><td>Training Set Target honour</td><td>Context Probability 0.995</td></tr><tr><td>has come to symbolise an important milestone in the emergence of both nations as independent actors on the world stage and the development of a senseof national identity. Today,the dateof the initial landings,25April, is a public holiday known as Anzac Day in Australia and New Zealand and every year thousands of people gather at memorials in both nations,and indeed in Turkey,to..</td><td></td><td></td></tr><tr><td>On the anniversary date of his death,every year since 1997,thousands of people gather at his home in Memphis to...</td><td>celebrate</td><td>0.0086</td></tr><tr><td>Twenty-five years after Marseille's death,fighter pilot veterans of World War II gathered to...</td><td>honour</td><td>0.0000041</td></tr></table>
|
| 256 |
+
|
| 257 |
+
<table><tr><td>Test Context (pkNN = O.959,pLm = 0.503)</td><td colspan="2">Test Target</td></tr><tr><td>U2 do what they're best at,slipping into epic rock mode,playing music made for the arena".In two other local newspaper reviews,critics praised the song's inclusion in a sequence of greatest hits.For the PopMart Tour of 1997-...</td><td colspan="2">1998</td></tr><tr><td>Training Set Context</td><td>Training Set Target</td><td>Context Probability</td></tr><tr><td>Following their original intent,"Sunday Bloody Sunday”was not played during any of the forty-seven shows on the Lovetown Tour in 1989. The song reappeared for a brief period during the Zoo TV Tour, and late during thesecond halfofPopMartTour(1997-..</td><td>1998</td><td>0.936</td></tr><tr><td>They are 6 times Champions and they won the Challenge Cup in 1938,and have experienced two previous stretchesin the SuperLeague,l997-..</td><td>2002</td><td>0.0071</td></tr><tr><td>About $40 million ($61.4 million in 2018 dollars) was spent on the property acquisition. After weather-related construction delays due to the El Nino season of the winter of 1997-...</td><td>1998</td><td>0.0015</td></tr><tr><td>This madeit the highest-rated seasonof The X-Files to air aswell as the highest rated Fox program for the 1997.-.</td><td>98</td><td>0.00000048</td></tr></table>
|
| 258 |
+
|
| 259 |
+
Table 7: In this example, the desired date pattern appears in many examples. Yet, the nearest neighbors search is able to identify the only training set context which is relevant to the test context and assigns it the highest probability mass.
|
| 260 |
+
|
| 261 |
+
Table 8: In this case, the model is able to memorize the fact that Georges Bizet wrote Carmen.
|
| 262 |
+
|
| 263 |
+
<table><tr><td>Test Context( (PkNN = 0.624,PLM = 0.167)</td><td colspan="2">Test Target</td></tr><tr><td>Lord Strathcona awarded Gauthier a scholarship in19O6 that allowed her toreturn to Europe and continue her vocal studies.Shereturned there and continued both to study and give performances.Her first operatic perfor- mance came in19o9 in Pavia,Italy asMicaela in Bizet's..</td><td>Carmen</td><td></td></tr><tr><td>Training Set Context</td><td>Training Set Target</td><td>Context Probability</td></tr><tr><td>Despite poor relations with the orchestra,Mahler brought five new operas to the theatre,including Bizet,'s...</td><td>Carmen</td><td>0.356</td></tr><tr><td>The fourth movement of An die Jugend (19o9), for instance, uses two of Niccolo Paganini's Caprices for solo violin (numbers1l and15),while the 1920 piece Piano Sonatina No. 6 (Fantasia da camera super Carmen) is based on themes from Georges Bizet’'s...</td><td>opera</td><td>0.0937</td></tr><tr><td>It also hosted the Balletof her Majesty's Theatre in themid-19th century, before returning to hosting the London premieres of such operas as Bizet's..</td><td>Carmen</td><td>0.0686</td></tr></table>
|
| 264 |
+
|
| 265 |
+
<table><tr><td>Test Context (pkNN = 0.031,pLM = 0.007)</td><td>Test Target</td><td></td></tr><tr><td>Mycena maculata bears some resemblance to M.<unk>,but is only as- sociatedwith decaying hardwood logsand stumps,and is foundin eastern North America,and sometimes on oak on the West Coast.In age,it...</td><td>develops</td><td></td></tr><tr><td>Training Set Context</td><td>Training Set Target</td><td>Context Probability</td></tr><tr><td>Morchella tridentina(=Morchella frustrata)is also rufescent and very sim- ilar to M. rufobrunnea. It is found in mountainous forests and maquis and forms a marked sinusat the attachment of the cap with the stem,which is pure white. At maturity, it..</td><td>develops</td><td>0.031</td></tr><tr><td>The winter bonnet(M.tintinnabulum) is a northern European species that is much smaller(cap diameter up to 2.6 cm(1.O in) across)and has a brown cap,and has ragged hairs at the base. It...</td><td>generally</td><td>0.029</td></tr><tr><td>The "bleeding”will distinguish Mycena atkinsoniana from most other Mycena species commonly encountered. The common and widely dis- tributedM.sanguinolentaisanother"bleeder",but it issmallerthanM. atkinsonia,with a cap diameter ranging from 3 to 15 mm (0.1 to 0.6 in). Additionally,it...</td><td>has</td><td>0.028</td></tr><tr><td>Mycena flavoalba bears resemblance to some members of the genus Hemimycena,such as H. lactea and H.<unk>. It...</td><td>can</td><td>0.018</td></tr></table>
|
| 266 |
+
|
| 267 |
+
Table 9: This is an example where the $p _ { \mathrm { k N N } }$ distribution is relatively flat, as several words are plausible continuations. However, the nearest neighbors search assigns the highest probability to the correct target and a corresponding context that is particularly relevant. In contrast, the LM probability on the correct target is lower.
|
md/train/HyxoX6EKvB/HyxoX6EKvB.md
ADDED
|
@@ -0,0 +1,354 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# REFLECTION-BASED WORD ATTRIBUTE TRANSFER
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We propose a word attribute transfer framework based on reflection to obtain a word vector with an inverted target attribute for a given word in a word embedding space. Word embeddings based on Pointwise Mutual Information (PMI) represent such analogic relations as ${ \overrightarrow { k i n g } } - { \overrightarrow { m a n } } + { \overrightarrow { w o m a n } } \approx { \overrightarrow { q u e e n } }$ . These relations can be used for changing a word’s attribute from king to queen by changing its gender. This attribute transfer can be performed by subtracting a difference vector $\overrightarrow { m a n } - \overrightarrow { w o m a n }$ from $\overrightarrow { k i n g }$ when we have explicit knowledge of the gender of given word king. However, this knowledge cannot be developed for various words and attributes in practice. For transferring queen into king in this analogy-based manner, we need to know that queen denotes a female and add the difference vector to it. In this work, we transfer such binary attributes based on an assumption that such transfer mapping will become identity mapping when we apply it twice. We introduce a framework based on reflection mapping that satisfies this property; queen should be transferred back to king with the same mapping as the transfer from king to queen. Experimental results show that the proposed method can transfer the word attributes of the given words, and does not change the words that do not have the target attributes.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Distributed representation (Hinton et al., 1984) is a kind of data representation that can capture data similarities in a vector space. In natural language processing, various studies have been conducted on word embeddings (Mikolov et al., 2013a;b; Pennington et al., 2014; Peters et al., 2018; Bojanowski et al., 2017). Word embedding models, such as skip-gram with negative sampling (SGNS) (Mikolov et al., 2013b) or GloVe (Pennington et al., 2014), capture some analogic relations, such as $\overrightarrow { k i n g } -$ $\overrightarrow { m a n } + \overrightarrow { w o m a n } \approx \overrightarrow { q u e e n }$ . Previous work offer theoretical explanation based on Pointwise Mutual Information (PMI; Church & Hanks (1990)) for maintaining the analogic relations in word vectors (Levy & Goldberg, 2014b; Arora et al., 2016; Gittens et al., 2017; Ethayarajh et al., 2019; Allen & Hospedales, 2019).
|
| 12 |
+
|
| 13 |
+
These relations can be used for transferring a certain attribute of a word, such as changing king into queen by transferring the gender. This task, which is called word attribute transfer, enables us to rewrite He is a boy as She is a girl. Word attribute transfer is expected to be applicable for natural language inference and data augmentation in natural language processing. The above analogic relations can be used, including adding difference vector $\overrightarrow { w o m a n } - \overrightarrow { m a n }$ to $\overrightarrow { k i n g }$ to transfer $\overrightarrow { k i n g }$ to $\overrightarrow { q u e e n }$ . This operation requires the explicit knowledge whether an input word is male or female; we have to add a difference vector to a male word and subtract it from a female word for a gender transfer. We also have to avoid changing words without any gender attributes, such as is and $a$ in the example above. Thus, analogy-based word attribute transfer requires explicit knowledge of word attributes, such as king is male, queen is female, and is has no gender attribute. Developing such knowledge is very difficult for various words and attributes in practice.
|
| 14 |
+
|
| 15 |
+
In this study, we propose a novel framework based on reflection, which enables word attribute transfer by a single reflection-based mapping for a certain attribute. Reflection in geometry is a mapping that exchanges the locations of two vectors in a Euclidean space by a hyperplane called a mirror, which satisfies the above desired property: working as identity mapping when it is applied twice and when it is applied to vectors on the mirror. We apply this reflection mapping to the problem of word attribute transfer by estimating an appropriate mirror that maps word pairs with a binary target attribute (e.g., male and female) and keeps the other words without that attribute using training data. We also extend this approach by introducing parameterized mirrors, which work as different mirrors based on the given input words, to overcome a limitation using a single fixed mirror to represent complex transfer mappings for different words. Experimental results show that the reflection-based method enables such transfers, achieves comparable performance to analogy-based methods with explicit attribute knowledge, even though our proposed method does not use such knowledge.
|
| 16 |
+
|
| 17 |
+
The following are the contributions of this paper:
|
| 18 |
+
|
| 19 |
+
• We propose a novel representation learning framework that obtains a vector with an inverted attribute in embedding space without explicit attribute knowledge of the given word. Our proposed reflection-based word attribute transfer enables us to transfer word attributes in up to $76 \%$ for words with target attributes and to avoid changing words without target attributes in over $9 9 \%$ in our experiments.
|
| 20 |
+
|
| 21 |
+
# 2 WORD ATTRIBUTE TRANSFER
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: Given word vector ${ \bf v } _ { x }$ and attribute one-hot vector $\mathbf { z }$ , word attribute transfer predicts word vector $\mathbf { v } _ { t }$ , which is the inverted attribute of ${ \bf v } _ { x }$ .
|
| 25 |
+
|
| 26 |
+
Let $x$ denote a word and let ${ \bf v } _ { x }$ denote its vector representation. Here we assume that ${ \bf v } _ { x }$ is learned in advance with an embedding model such as SGNS. In this task, we have two inputs, word $x$ and onehot vector $\mathbf { z }$ , representing a certain target attribute, and one output, return word $t$ with the inverted attribute of $x$ for $\mathbf { z }$ . Let $\mathcal { A }$ denote a set of a triplet $( x , t , \mathbf { z } )$ , e.g., $( m a n , w o m a n , \mathbf { z } _ { \mathrm { g e n d e r } } ) \in \mathcal { A }$ . Let $\mathcal { N }$ denote a set of words without attribute $\mathbf { z }$ , e.g., apple $\in \mathcal { N }$ , when $\mathbf { z }$ represents gender. The purpose of this task is to transfer ${ \bf v } _ { x }$ to $\mathbf { v } _ { t }$ by transfer function $f _ { \mathbf { Z } }$ that inverts attribute $\mathbf { z }$ of ${ \bf v } _ { x }$ . In other words, output $\mathbf { v } _ { y }$ should be close to the vector of corresponding target word $\mathbf { v } _ { t }$ , which is typically the nearest neighbor of $\mathbf { v } _ { t }$ in the word embedding space.
|
| 27 |
+
|
| 28 |
+
$$
|
| 29 |
+
\mathbf { v } _ { t } \approx \mathbf { v } _ { y } = f _ { \mathbf { Z } } ( \mathbf { v } _ { x } ) .
|
| 30 |
+
$$
|
| 31 |
+
|
| 32 |
+
Note that mapping $f _ { \mathbf { Z } }$ transfers word $x$ if it has target attribute $\mathbf { z }$ ; otherwise $f _ { \mathbf { Z } }$ works as identity mapping. For instance with $\mathbf { z } _ { g e n d e r }$ , given input word man, gender attribute transfer $f _ { \mathbf { Z } _ { g e n d e r } } ( \mathbf { v } _ { m a n } )$ should result in a vector close to $\mathbf { v } _ { w o m a n }$ . Given input word apple as $x$ , the results should be $\mathbf { v } _ { a p p l e }$ .
|
| 33 |
+
|
| 34 |
+
# 3 ANALOGY-BASED WORD ATTRIBUTE TRANSFER
|
| 35 |
+
|
| 36 |
+
Analogy is a general idea for realizing attribute transfer. Several PMI-based word embedding methods (Mikolov et al., 2013c; Linzen, 2016) tackled to embed words into word embedding space to capture the analogic relations. An embedded vector with SGNS or GloVe captures analogic relations (Levy & Goldberg, $2 0 1 4 \mathrm { a }$ ; Mikolov et al., 2013c; Linzen, 2016). For instance, ${ \mathbf { v } } _ { q u e e n }$ is near the vector obtained on the right side of Eq. 2. By rearranging Eq. 2, Eq. 3 is obtained:
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
\begin{array} { r } { \mathbf { v } _ { q u e e n } \approx \mathbf { v } _ { k i n g } - \mathbf { v } _ { m a n } + \mathbf { v } _ { w o m a n } , } \\ { \mathbf { \tau } } \\ { \approx \mathbf { v } _ { k i n g } - ( \mathbf { v } _ { m a n } - \mathbf { v } _ { w o m a n } ) . } \end{array}
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
We can transfer the gender attribute by subtracting difference vector ${ \bf v } _ { m a n } - { \bf v } _ { w o m a n }$ from input word vectors, e.g., $\mathbf { v } _ { k i n g }$ . The analogy-based transfer function is
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
f _ { \mathbf { Z } } ( \mathbf { v } _ { x } ) = { \left\{ \begin{array} { l l } { \mathbf { v } _ { x } - \mathbf { d } } & { { \mathrm { ~ i f ~ } } x \in { \mathcal { M } } , } \\ { \mathbf { v } _ { x } + \mathbf { d } } & { { \mathrm { ~ i f ~ } } x \in { \mathcal { F } } , } \end{array} \right. }
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
where $\mathbf { d }$ is a difference vector of the given word pair such as man and woman, $\mathcal { M }$ is a set of words having a target attribute, and $\mathcal { F }$ is a set of words having an inverse attribute, for example, $m a n \in \mathcal { M }$ and $w o m a n \in { \mathcal { F } }$ for gender attributes. Eq. 4 indicates that the operation changes depending on whether input word $x$ belongs to $\mathcal { M }$ or $\mathcal { F }$ . For gender words, we subtract difference vector $\mathbf { d }$ if $x$ is male, and add it if $x$ is female. Therefore, we need such explicit knowledge. However, this knowledge cannot be developed for various words and attributes in practice.
|
| 49 |
+
|
| 50 |
+
# 4 REFLECTION-BASED WORD ATTRIBUTE TRANSFER
|
| 51 |
+
|
| 52 |
+
# 4.1 IDEALIZED TRANSFER WITHOUT EXPLICIT KNOWLEDGE
|
| 53 |
+
|
| 54 |
+
What is an idealized transfer function $\phi _ { \mathbf { Z } }$ for the word attribute transfer? The following are the idealized natures of such a transfer function:
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\begin{array} { r } { \mathbf { v } _ { m } = \phi _ { \mathbf { Z } } ( \mathbf { v } _ { w } ) , } \\ { \mathbf { v } _ { w } = \phi _ { \mathbf { Z } } ( \mathbf { v } _ { m } ) , } \end{array}
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
where $m \in \mathcal { M }$ and $w \in { \mathcal { F } }$ . This function $\phi _ { \mathbf { Z } }$ enables to transfer a word without explicit knowledge. Function $\phi _ { \mathbf { Z } }$ transfers ${ \bf v } _ { m }$ to ${ \bf v } _ { w }$ and ${ \bf v } _ { w }$ to ${ \bf v } _ { m }$ without such explicit knowledge as $m \in \mathcal { M }$ and $w \in { \mathcal { F } }$ . By combining Eqs. 5 and 6, we obtain the following formula:
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\forall m \in \mathcal { M } , \qquad \mathbf { v } _ { m } = \phi _ { \mathbf { Z } } \big ( \phi _ { \mathbf { Z } } ( \mathbf { v } _ { m } \big ) \big ) ,
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
and
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\forall w \in \mathcal { F } , \qquad \mathbf { v } _ { w } = \phi _ { \mathbf { Z } } \big ( \phi _ { \mathbf { Z } } ( \mathbf { v } _ { w } ) \big ) .
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
Hence, the idealized transfer function is a mapping that becomes an identity mapping when we apply it twice for any $\mathbf { v }$ . Such a mapping is called involution in geometry. For example, $\phi \colon \mathbf { v } \mapsto - \mathbf { v }$ is one example of an involution. Note that the identity map itself, such as $\phi \colon \mathbf { v } \mapsto \mathbf { v }$ , is excluded from the involution.
|
| 73 |
+
|
| 74 |
+
# 4.2 REFLECTION
|
| 75 |
+
|
| 76 |
+
A reflection is an involution that reverses the location between two vectors in a Euclidean space through an affine hyperplane (mirror). Reflection is an idealized function because every point returns to its original location when reflection is applied twice:
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\forall \mathbf { v } \in \mathbb { R } ^ { n } , \qquad \mathbf { v } = R e f _ { \mathbf { a } , \mathbf { c } } ( R e f _ { \mathbf { a } , \mathbf { c } } ( \mathbf { v } ) { \bf \phi } ) .
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
Given vector $\mathbf { v }$ in Euclidean space $\mathbb { R } ^ { n }$ , the formula for the reflection in the mirror is given:
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
R e f _ { \mathbf { a } , \mathbf { c } } ( \mathbf { v } ) = \mathbf { v } - 2 { \frac { ( \mathbf { v } - \mathbf { c } ) \cdot \mathbf { a } } { \mathbf { a } \cdot \mathbf { a } } } \mathbf { a } ,
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
where $\mathbf { a } \in \mathbb { R } ^ { n }$ is a vector orthogonal to the mirror (normal vector) and $\mathbf { c } \in \mathbb { R } ^ { n }$ is a point through which the mirror passes. a and c are parameters that determine the mirror.
|
| 89 |
+
|
| 90 |
+
# 4.3 REFLECTION-BASED WORD ATTRIBUTE TRANSFER
|
| 91 |
+
|
| 92 |
+
We apply reflection to the word attribute transfer to invert a specific attribute of an input word without its explicit attribute knowledge. We learn a mirror (hyperplane) in a pre-trained embedding space using training word pairs with a common (binary) attribute $\mathbf { z }$ (Fig. 2). Here since the mirror is uniquely determined by two parameter vectors, a and $\mathbf { c }$ , we estimate a and c from target attribute $\mathbf { z }$ using fully connected multi-layer perceptrons:
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\begin{array} { r } { \mathbf { a } = M L P ( \mathbf { z } ) , } \\ { \mathbf { c } = M L P ( \mathbf { z } ) . } \end{array}
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
Transferred vector $\mathbf { v } _ { y }$ is obtained by inverting attribute $\mathbf { z }$ of ${ \bf v } _ { x }$ by reflection:
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
\begin{array} { r } { \mathbf { v } _ { y } = R e f _ { \mathbf { a } , \mathbf { c } } ( \mathbf { v } _ { x } ) . } \end{array}
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+

|
| 105 |
+
Figure 2: Reflection-based word attribute transfer examples.
|
| 106 |
+
|
| 107 |
+

|
| 108 |
+
Figure 3: Mirror estimation methods
|
| 109 |
+
|
| 110 |
+
# 4.4 PARAMETERIZED MIRRORS
|
| 111 |
+
|
| 112 |
+
Reflection with a mirror by Eqs. 11 and 12 assumes a single mirror depending only on z. Previous discussion assumed that there will be pairs sharing a stable attribute such king and queen. However, often gendered words don’t come in pairs, and gender is far from a stable attribute. For example, actress may be feminine, but actor is clearly neutral in many cases (Fig. 3). Thus, actor isn’t as obvious a masculine counterpart as king. In fact, it is known that there are biases in gender words in the embedding space (Zhao et al., 2018; Kaneko & Bollegala, 2019). This phenomenon can occur not only with the gender attribute, but also with other attributes. With this assumption of a single mirror, the mirror must be a hyperplane that goes through the midpoints for all word vector pairs. However, the vector pairs shown on the left of Fig. 3 cannot be transferred well since the single mirror does not satisfy this constraint due to the bias of the embedding space. To solve this problem, we introduce different mirrors for different words. We propose parameterized mirrors determined by input vector ${ \bf v } _ { x }$ in addition to attribute $\mathbf { z }$ . The following are the definitions of the mirror parameters:
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\begin{array} { r } { \mathbf { a } = M L P ( [ \mathbf { z } ; \mathbf { v } _ { x } ] ) , } \\ { \mathbf { \ c } = M L P ( [ \mathbf { z } ; \mathbf { v } _ { x } ] ) , } \end{array}
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
where $[ \cdot ; \cdot ]$ indicates the vector concatenation in the column. The parameterized mirrors are expected to work flexibly on different words. For instance, as shown in Fig. 3, suppose we learned the mirror (the blue line) that transfers $\mathbf { v } _ { h e r o }$ to $\mathbf { v } _ { h e r o i n e }$ in advance. If input word vector $\mathbf { v } _ { a c t o r }$ resembles $\mathbf { v } _ { h e r o }$ , a mirror that is similar to the one for $\mathbf { v } _ { h e r o }$ should be derived and used for the attribute transfer.
|
| 119 |
+
|
| 120 |
+
# 4.5 LOSS FUNCTION
|
| 121 |
+
|
| 122 |
+
Loss function $\mathcal { L }$ is defined:
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
\mathcal { L } ( \boldsymbol { \Theta } ) = \frac { 1 } { | \mathcal { A } | } \sum _ { ( x _ { i } , t _ { i } , \mathbf { Z } _ { i } ) \in \mathcal { A } } ( \mathbf { v } _ { y _ { i } } - \mathbf { v } _ { t _ { i } } ) ^ { 2 } + \frac { 1 } { | \mathcal { N } | } \sum _ { x _ { j } \in \mathcal { N } } ( \mathbf { v } _ { y _ { j } } - \mathbf { v } _ { x _ { j } } ) ^ { 2 } ,
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
where $\begin{array} { r } { \frac { 1 } { | \mathcal { A } | } \sum _ { ( x _ { i } , t _ { i } , \mathbf { Z } _ { i } ) \in \mathcal { A } } ( \mathbf { v } _ { y _ { i } } - \mathbf { v } _ { t _ { i } } ) ^ { 2 } } \end{array}$ is a term that draws target word vector $\mathbf { v } _ { t _ { i } }$ closer to corresponding transferred vector $\mathbf { v } _ { y _ { i } }$ and $\begin{array} { r } { \frac { 1 } { | \mathcal { N } | } \sum _ { x _ { j } \in \mathcal { N } } ( \mathbf { v } _ { y _ { j } } - \mathbf { v } _ { x _ { j } } ) ^ { 2 } } \end{array}$ is a term that prevents words without a target attribute from being moved by transfer function $f _ { \mathbf { Z } } . \Theta$ represents the set of all the trainable parameters. The parameters in the proposed model are the MLP weights used to determine mirror hyperplanes via a and $\mathbf { c }$ . We iteratively update $\Theta$ to minimize $\mathcal { L }$ :
|
| 129 |
+
|
| 130 |
+
$$
|
| 131 |
+
\begin{array} { r } { \Theta _ { t + 1 } \gets \underset { \Theta _ { t } } { \operatorname { a r g m i n } } \mathcal { L } ( \Theta _ { t } ) , } \end{array}
|
| 132 |
+
$$
|
| 133 |
+
|
| 134 |
+
where $t$ is the number of parameter updates at that time.
|
| 135 |
+
|
| 136 |
+
# 5 EXPERIMENT
|
| 137 |
+
|
| 138 |
+
We evaluated the performance of the proposed reflection-based word attribute transfer using data with some different attributes.
|
| 139 |
+
|
| 140 |
+
# 5.1 EXPERIMENTAL SETUP
|
| 141 |
+
|
| 142 |
+
We used three different datasets of word pairs with three binary attributes: Male-Female 1, SingularPlural and Capital-Country, shown in Table 1.These word pairs were collected from analogy test sets (Mikolov et al., 2013a; Gladkova et al., 2016), the Internet and Nguyen et al. (2017) for antonyms of noun2. Since these datasets are very small, we added Gaussian noise $\sigma = 0 . 1$ ) to every input vector ${ \bf v } _ { x }$ during training to avoid overfit. Random noise was applied independently to every sample in every iteration. For a non-attribute dataset $\mathcal { N }$ , we sampled words from the three-million-word vocabulary of the word embedding model. We sampled from 4 to 50 words for training $0 ~ \leq$ $| \mathcal { N } _ { \mathrm { t r a i n } } | \leq 5 0 )$ and 1000 words for the test $\lvert N _ { \mathrm { t e s t } } \rvert = \bar { 1 } 0 0 0 )$ . We used a mixed dataset that included both $| \mathcal { N } _ { \mathrm { t r a i n } } |$ and $| \mathcal { A } _ { \mathrm { t r a i n } } |$ . Note that $\mathcal { N } _ { \mathrm { t e s t } }$ was sampled and excluded words from $\mathcal { N } _ { \mathrm { t r a i n } }$ and $\mathcal { A } _ { \mathrm { t r a i n } }$ . We had no $\mathcal { N } _ { \mathrm { v a l } }$ because the tuning was conducted with only $| \mathcal { A } _ { \mathrm { v a l } } |$ . We used word2vec (Mikolov et al., 2013b) 3 and GloVe (Pennington et al., 2014) 4 as the pre-trained embedding model. The embedded vector dimension is $n = 3 0 0$ .
|
| 143 |
+
|
| 144 |
+
Table 1: Statistics of binary attribute word pair datasets (in the number of word pairs)
|
| 145 |
+
|
| 146 |
+
<table><tr><td>Dataset A</td><td>Train</td><td>Val</td><td>Test</td><td>Total</td></tr><tr><td>Male-Female (MF)</td><td>29</td><td>12</td><td>12</td><td>53</td></tr><tr><td>Singular-Plural (SP)</td><td>90</td><td>25</td><td>25</td><td>140</td></tr><tr><td>Capital-Country (CC)</td><td>59</td><td>25</td><td>25</td><td>109</td></tr><tr><td>Antonym (AN)</td><td>1354</td><td>290</td><td>290</td><td>1934</td></tr></table>
|
| 147 |
+
|
| 148 |
+
# 5.2 EVALUATION METRICS
|
| 149 |
+
|
| 150 |
+
We measured the accuracy and stability performances of the word attribute transfer. The accuracy measures how many input words in $\mathcal { A } _ { \mathrm { t e s t } }$ were transferred correctly to the corresponding target words. The stability score measures how many words in $\mathcal { N } _ { \mathrm { t e s t } }$ are not mapped to other words. For example, in a gender transfer, given man, the transfer is regarded as correct if woman is the closest word to the transferred vector; otherwise it is incorrect. Given apple, the transfer is regarded as correct if apple is the closest word to the transferred vector; otherwise its stability is incorrect. Here we used cosine similarity to measure the similarity of output vector $\mathbf { v } _ { y }$ and target vector $\mathbf { v } _ { t }$ . The accuracy and stability scores are calculated by the following formula:
|
| 151 |
+
|
| 152 |
+
$$
|
| 153 |
+
\delta ( { \bf v } _ { y } , t ) = \left\{ \begin{array} { l l } { 1 } & { \mathrm { ~ i f ~ } \quad \underset { k \in \mathcal { V } } { \arg \operatorname* { m a x } } \frac { { \bf v } _ { y } \cdot { \bf v } _ { k } } { \| { \bf v } _ { y } \| \| { \bf V } _ { k } \| } = t , } \\ { 0 } & { \mathrm { ~ o t h e r w i s e , } } \end{array} \right.
|
| 154 |
+
$$
|
| 155 |
+
|
| 156 |
+
$$
|
| 157 |
+
\mathrm { A c c u r a c y } = \frac { 1 } { | \mathcal { A } _ { \mathrm { t e s t } } | } \sum _ { ( x _ { i } , t _ { i } , \mathbf { Z } _ { i } ) \in \mathcal { A } _ { \mathrm { t e s t } } } \delta ( \mathbf { v } _ { y _ { i } } , t _ { i } ) ,
|
| 158 |
+
$$
|
| 159 |
+
|
| 160 |
+
$$
|
| 161 |
+
\mathrm { S t a b i l i t y } = \frac { 1 } { | \mathcal N _ { \mathrm { t e s t } } | } \sum _ { \substack { x _ { i } \in \mathcal N _ { \mathrm { t e s t } } } } \delta ( \mathbf v _ { y _ { i } } , x _ { i } ) ,
|
| 162 |
+
$$
|
| 163 |
+
|
| 164 |
+
where $\nu$ is the vocabulary of the word embedding model.
|
| 165 |
+
|
| 166 |
+
# 5.3 METHODS AND CONFIGURATIONS
|
| 167 |
+
|
| 168 |
+
In our experiment, we compared our proposed method with the following baseline methods:
|
| 169 |
+
|
| 170 |
+
REF Reflection-based word attribute transfer with a single mirror. We used a fully connected 2-layer MLP with 300 hidden units and ReLU activations to estimate a and c.
|
| 171 |
+
|
| 172 |
+
REF+PM Reflection-based word attribute transfer with parameterized mirrors. We used the same MLP as the REF.
|
| 173 |
+
|
| 174 |
+
MLP Fully connected MLP: $\mathbf v _ { y } = M L P ( [ \mathbf v _ { x } ; \mathbf z ] )$ . The highest accuracy models are a 2-layer MLP for Capital-Country and 3-layer MLP for the other datasets.
|
| 175 |
+
|
| 176 |
+
DIFF Analogy-based word attribute transfer with a difference vector: $\mathbf { d } = \mathbf { v } _ { m } - \mathbf { v } _ { w }$ , where $m$ and $w$ are in the training data of $\mathcal { A }$ . We chose d because it achieved the best accuracy in the validation data of $\mathcal { A }$ . We determined whether to add or subtract $\mathbf { d }$ to ${ \bf v } _ { x }$ based on attribute knowledge (Eq. 4).
|
| 177 |
+
|
| 178 |
+
DIFF $^ +$ Analogy-based word attribute transfer with a difference vector regardless of the attribute knowledge. d was obtained in the same way as the DIFF. We added $\mathbf { d }$ to ${ \bf v } _ { x }$ for any input $x$ : $f _ { \mathbf { Z } } ( \mathbf { v } _ { x } ) = \mathbf { v } _ { x } + \mathbf { d }$ , $\forall \mathbf { v } _ { x } \in \mathbb { R } ^ { n }$ .
|
| 179 |
+
|
| 180 |
+
DIFF − Analogy-based word attribute transfer with a difference vector regardless of the attribute knowledge. d was obtained in the same way as the DIFF. We subtracted $\mathbf { d }$ from ${ \bf v } _ { x }$ for any input $x$ : ${ \bf { \bar { f } } } _ { \mathbf { Z } } ( { \bf v } _ { x } ) = { \bf v } _ { x } - \mathbf { d } , \quad \forall { \bf v } _ { x } \in \mathbb { R } ^ { n } .$ .
|
| 181 |
+
|
| 182 |
+
MEANDIFF Analogy-based word attribute transfer with a mean difference vector $\bar { \bf d }$ : $\bar { \textbf { d } } =$ 1|Atrain| P(mi,wi)∈Atrain (vmi − vwi ). We determined whether to add or subtract d¯ to vx based on the attribute knowledge (Eq.4).
|
| 183 |
+
|
| 184 |
+
MEANDIFF $^ +$ Analogy-based word attribute transfer with a mean difference vector regardless of the attribute knowledge: $f _ { \mathbf { Z } } ( \mathbf { v } _ { x } ) = \mathbf { v } _ { x } + \bar { \mathbf { d } }$ , $\forall \mathbf { v } _ { x } \in \mathbb { R } ^ { n }$ . $\bar { \bf d }$ was obtained in the same way as the MEANDIFF.
|
| 185 |
+
|
| 186 |
+
MEANDIFF − Analogy-based word attribute transfer with a mean difference vector regardless of the attribute knowledge: $f _ { \mathbf { Z } } ( \mathbf { v } _ { x } ) = \mathbf { v } _ { x } - \bar { \mathbf { d } }$ , $\forall \mathbf { v } _ { x } \in \mathbb { R } ^ { n }$ . d¯ was obtained in the same way as the MEANDIFF.
|
| 187 |
+
|
| 188 |
+
Based on the tuning, we used the Adam optimizer (Kingma & Ba, 2015) with a learning rate of $\alpha = 1 0 ^ { - 4 }$ (the other hyperparameters were the same as the original one (Kingma & Ba, 2015)), and a batchsize of 62 for male-female, and 32 for the others. These hyperparameters were identical for the learning-based methods: REF, $\boldsymbol { \mathrm { R E F + P M } }$ , or MLP. We did not use such regularization methods as dropout (Srivastava et al., 2014) or batch normalization (Ioffe & Szegedy, 2015) because they did not show any improvement in our pilot test.
|
| 189 |
+
|
| 190 |
+
# 5.4 ACCURACY AND STABILITY
|
| 191 |
+
|
| 192 |
+
Table 2 and 3 shows the transfer accuracy and stability score results. Both experiments using GloVe or word2vec obtained similar results. $\boldsymbol { \mathrm { R E F + P M } }$ achieved the best accuracy among the methods that did not use explicit attribute knowledge. This means that reflection can be used for word attribute transfers even without attribute knowledge. In the stability evaluation, reflection-based methods (REF, $\mathsf { R E F } + \mathsf { P M } )$ and the analogy-based methods with a mean difference vector (MEANDIFF $-$ , MEANDIFF $^ +$ ) achieved high stability. In particular, reflection-based transfers achieved outstanding stability scores exceeding $9 9 \%$ . The stability of DIFF $^ +$ and DIFF $-$ was much lower than the other methods. Although MEANDIFF − and MEANDIFF + achieved high stability, their accuracy results were very low. Interestingly, reflection-based transfer with parameterized mirrors $( \mathrm { R E F } + \mathrm { P M } )$ achieved high performance in both accuracy and stability. For example, the accuracy of RE $\boldsymbol { \mathbf { \ell } } + \mathbf { P M }$ was $4 1 . 6 7 \%$ , and the stability was $9 9 . 9 \%$ in Male-Female (MF), and the accuracy was $58 \%$ and the stability was $9 9 . 4 0 ~ \%$ in Capital-Country (CC). These results show that the proposed method transfers an input word if it has a target attribute and does not transfer an input word even though it does not use explicit attribute knowledge on the input words. MLP worked poorly both in accuracy and stability. In the antonym (AN), while the transfer accuracy by the proposed method was a bit lower than that by MLP, the stability of the proposed method was $100 \%$ and that of MLP was really poor (almost $0 \%$ ).
|
| 193 |
+
|
| 194 |
+
Table 2: Results in accuracy and stability scores (word2vec).
|
| 195 |
+
|
| 196 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">Knowledge</td><td colspan="4">Accuracy (%)</td><td colspan="4">Stability (%)</td></tr><tr><td>MF</td><td>SP</td><td>CC</td><td>AN</td><td>MF</td><td>SP</td><td>CC</td><td>AN</td></tr><tr><td>REF</td><td></td><td>20.83</td><td>0.00</td><td>36.00</td><td>0.00</td><td>99.80</td><td>100.00</td><td>99.80</td><td>100.00</td></tr><tr><td>REF+PM</td><td></td><td>41.67</td><td>22.00</td><td>58.00</td><td>28.79</td><td>99.90</td><td>99.40</td><td>99.40</td><td>100.00</td></tr><tr><td>MLP</td><td></td><td>8.33</td><td>4.00</td><td>12.00</td><td>35.86</td><td>2.20</td><td>0.00</td><td>2.70</td><td>1.90</td></tr><tr><td>DIFF+</td><td></td><td>25.00</td><td>2.00</td><td>32.00</td><td>-</td><td>72.10</td><td>77.90</td><td>53.90</td><td>-</td></tr><tr><td>DIFF-</td><td></td><td>25.00</td><td>2.00</td><td>30.00</td><td>=</td><td>49.60</td><td>78.20</td><td>56.30</td><td>1</td></tr><tr><td>MEANDIFF +</td><td></td><td>4.17</td><td>0.00</td><td>22.00</td><td>=</td><td>98.60</td><td>99.40</td><td>87.60</td><td></td></tr><tr><td>MEANDIFF</td><td></td><td>8.33</td><td>0.00</td><td>14.00</td><td>=</td><td>97.20</td><td>99.30</td><td>92.40</td><td></td></tr><tr><td>DIFF</td><td></td><td>62.50</td><td>4.00</td><td>64.00</td><td></td><td>1</td><td>=</td><td>=</td><td></td></tr><tr><td>MEANDIFF</td><td></td><td>12.50</td><td>0.00</td><td>36.00</td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 197 |
+
|
| 198 |
+
Table 3: Results in accuracy and stability scores (GloVe).
|
| 199 |
+
|
| 200 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">Knowledge</td><td colspan="4">Accuracy (%)</td><td colspan="4">Stability (%)</td></tr><tr><td>MF</td><td>SP</td><td>CC</td><td>AN</td><td>MF</td><td>SP</td><td>CC</td><td>AN</td></tr><tr><td>REF</td><td></td><td>12.50</td><td>2.00</td><td>26.00</td><td>0.00</td><td>100.00</td><td>100.00</td><td>100.00</td><td>100.00</td></tr><tr><td>REF+PM</td><td></td><td>45.83</td><td>50.00</td><td>76.00</td><td>33.54</td><td>99.70</td><td>99.10</td><td>99.20</td><td>100.00</td></tr><tr><td>MLP</td><td></td><td>4.17</td><td>10.00</td><td>18.00</td><td>36.72</td><td>5.10</td><td>7.00</td><td>5.20</td><td>1.20</td></tr><tr><td>DIFF+</td><td></td><td>25.00</td><td>2.00</td><td>26.00</td><td>-</td><td>99.30</td><td>94.20</td><td>99.30</td><td>1</td></tr><tr><td>DIFF-</td><td></td><td>25.00</td><td>2.00</td><td>24.00</td><td>=</td><td>100.60</td><td>99.90</td><td>99.50</td><td>=</td></tr><tr><td>MEANDIFF +</td><td></td><td>0.00</td><td>0.00</td><td>22.00</td><td></td><td>100.00</td><td>100.00</td><td>100.00</td><td>一</td></tr><tr><td>MEANDIFF</td><td></td><td>0.00</td><td>0.00</td><td>0.00</td><td></td><td>100.00</td><td>100.00</td><td>100.00</td><td></td></tr><tr><td>DIFF</td><td></td><td>50.00</td><td>4.00</td><td>44.00</td><td></td><td>=</td><td>=</td><td></td><td></td></tr><tr><td>MEANDIFF</td><td></td><td>0.00</td><td>0.00</td><td>0.00</td><td></td><td></td><td>-</td><td></td><td></td></tr></table>
|
| 201 |
+
|
| 202 |
+
We investigated the relation between the size of $| \mathcal { N } _ { \mathrm { t r a i n } } |$ and the stability of learning-based methods by conducting an additional experiment by varying $| \mathcal { N } _ { \mathrm { t r a i n } } |$ from 0 to 50. The stability scores by MLP did not improve (Table 4). On the other hand, REF and $\boldsymbol { \mathrm { R E F } } + \boldsymbol { \mathrm { P M } }$ achieved high stability scores with just $| \bar { \mathcal { N } } _ { \mathrm { t r a i n } } | = 4$ and maintained the accuracy.
|
| 203 |
+
|
| 204 |
+
# 5.5 TRANSFER EXAMPLE
|
| 205 |
+
|
| 206 |
+
Table 5 shows examples of a gender transfer at the sentence level, where the attribute transfer was applied to words in sentence $\bar { X } = \{ x _ { 1 } , x _ { 2 } , \ldots \}$ . Here since such words as $a$ and . are not in the vocabulary of the original word embedding model, we omitted them from the inputs. MLP made many wrong transfers on words without gender attributes, e.g., the became By Katie Klingsporn, was became she, when became Doughty Evening Chronicle, and woman became girlfriend. $\mathrm { D I F F ^ { + } }$ can transfer if $x$ is female, e.g., it transferred from woman to man, but it could not transfer grandfather and boy. Similarly, DIFF − failed to transfer from female to male. In addition, since the stability of these methods was low, they erroneously transferred. For example, in DIFF $^ -$ , the and when became she. REF + PM can selectively transfer words with a gender attribute without using explicit gender information. For example, when woman was given, $R e f ( \mathbf { v } _ { w o m a n } )$ became man without knowledge that woman is a female word, and when man was given, it became woman. When non-attribute word married was given, $R e f ( \mathbf { v } _ { m a r r i e d } )$ became married without knowledge that married has no gender attribute. When we applied the reflection-based transfer twice, the transferred word returned to its original word, e.g., $R e f ( R e f ( \mathbf { v } _ { w o m a n } ) )$ gives woman.
|
| 207 |
+
|
| 208 |
+
Table 4: Relation among size of $| \mathcal { N } _ { \mathrm { t r a i n } } |$ and stability of learning-based methods.
|
| 209 |
+
|
| 210 |
+
<table><tr><td rowspan="2" colspan="2"></td><td colspan="4">Accuracy (%)</td><td colspan="4">Stability (%)</td></tr><tr><td colspan="4">Wtrainl</td><td colspan="4">|Wtrainl</td></tr><tr><td></td><td></td><td>0</td><td>4</td><td>10</td><td>50</td><td>0</td><td>4</td><td>10</td><td>50</td></tr><tr><td rowspan="3">MF</td><td>REF</td><td>16.67</td><td>20.83</td><td>20.83</td><td>20.83</td><td>98.30</td><td>98.80</td><td>99.40</td><td>99.80</td></tr><tr><td>REF+PM</td><td>41.67</td><td>45.83</td><td>20.83</td><td>41.67</td><td>38.30</td><td>98.40</td><td>100.00</td><td>99.90</td></tr><tr><td>MLP</td><td>4.17</td><td>8.33</td><td>8.33</td><td>8.33</td><td>0.00</td><td>0.30</td><td>0.30</td><td>2.20</td></tr><tr><td rowspan="3">SP</td><td>REF</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>99.90</td><td>99.90</td><td>99.90</td><td>100.90</td></tr><tr><td>REF+PM</td><td>12.00</td><td>22.00</td><td>18.00</td><td>18.00</td><td>98.40</td><td>99.40</td><td>99.30</td><td>99.80</td></tr><tr><td>MLP</td><td>4.00</td><td>4.00</td><td>2.00</td><td>2.00</td><td>0.00</td><td>0.00</td><td>0.10</td><td>3.40</td></tr><tr><td rowspan="3">CC</td><td>REF</td><td>36.00</td><td>36.00</td><td>36.00</td><td>34.00</td><td>99.80</td><td>99.80</td><td>99.80</td><td>100.00</td></tr><tr><td>REF+PM</td><td>58.00</td><td>56.00</td><td>58.00</td><td>54.00</td><td>73.80</td><td>99.70</td><td>99.40</td><td>99.40</td></tr><tr><td>MLP</td><td>6.00</td><td>6.00</td><td>8.00</td><td>12.00</td><td>0.00</td><td>0.30</td><td>0.50</td><td>2.70</td></tr><tr><td rowspan="3">AN</td><td>REF</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>99.90</td><td>99.90</td><td>99.90</td><td>99.80</td></tr><tr><td>REF+PM</td><td>21.72</td><td>27.24</td><td>28.62</td><td>28.79</td><td>95.30</td><td>99.20</td><td>99.50</td><td>99.80</td></tr><tr><td>MLP</td><td>34.14</td><td>35.00</td><td>34.31</td><td>35.86</td><td>0.00</td><td>0.01</td><td>0.02</td><td>1.90</td></tr></table>
|
| 211 |
+
|
| 212 |
+
Table 5: Transfer results when sentence $X = \{ \mathrm { t h e , . . . , b o y } \}$ was given. Out-of-vocabulary words $a$ and . were not given as input.
|
| 213 |
+
|
| 214 |
+
<table><tr><td>X</td><td>the woman was married when your grandfather was (a) boy (.)</td></tr><tr><td>Ref(x)</td><td>the man was married when your grandmother was (a) girl (.)</td></tr><tr><td>Ref(Ref(x))</td><td>the woman was married when your grandfather was (a) boy (.)</td></tr><tr><td>MLP</td><td>By_Katie_Klingsporn girlfriend she fiancee Doughty_Evening_Chronicle ma'am daughter she (a) mother (.)</td></tr><tr><td>DIFF+</td><td>the man was married when your grandfather was (a) boy (.)</td></tr><tr><td>DIFF-</td><td>she woman was married she your grandmother was (a) girl (.)</td></tr></table>
|
| 215 |
+
|
| 216 |
+
We can transfer some different attributes of words with reflection-based transfer one-by-one. Table 6 shows that the words having different target attributes were transferred by each reflection-based transfer in the order of Male-Female, Singular-Plural, and Country-Capital. Given actress for a Male-Female transfer, it was transferred to actor and to actors for Singular-Plural. Given Tokyo for Male-Female, Singular-Plural, and Antonym, it was not transferred, but it was transferred to Japan for Country-Capital. Given rich for Male-Female, Singular-Plural, and Capital-Country, it was not transferred, but it was transferred to poor for Antonym.
|
| 217 |
+
|
| 218 |
+
Table 6: Transfer of different attributes with reflection-based word attribute transfer with parameterized mirrors.
|
| 219 |
+
|
| 220 |
+
<table><tr><td>X</td><td>the rich actress and the poor actor want to stay the beautiful city in Tokyo.</td></tr><tr><td>+Male-Female</td><td>the rich actor and the poor actress want to stay the beautiful city in Tokyo.</td></tr><tr><td>+ Singular-Plural</td><td></td></tr><tr><td></td><td>the rich actors and the poor actresses want to stay the beautiful cities in Tokyo.</td></tr><tr><td>+Capital-Country</td><td>the rich actors and the poor actresses want to stay the beautiful citie in Japan.</td></tr><tr><td>+ Antonym</td><td>the poor actors and the rich actresses want to stay the beautiful cities in Japan.</td></tr></table>
|
| 221 |
+
|
| 222 |
+
# 6 RELATED WORK
|
| 223 |
+
|
| 224 |
+
The embedded vectors obtained by SGNS (Mikolov et al., 2013a;b) and GloVe (Pennington et al., 2014) have analogic relations. The theory of analogic relations in word embeddings has been widely discussed: Levy & Goldberg (2014b); Arora et al. (2016); Gittens et al. (2017); Ethayarajh et al. (2019); Allen & Hospedales (2019); Linzen (2016). Levy & Goldberg (2014b) offer the explanation that SGNS factorizes a shifted PMI matrix. Allen & Hospedales (2019) and Ethayarajh et al. (2019) argued that they proved the existence of such analogic relations without strong assumptions. In our work, we focus on the analogic relations in a word embedding space and propose a novel framework to obtain a word vector with inverted attributes. Style transfers (Niu et al., 2018; Prabhumoye et al., 2018; Jain et al., 2019; Logeswaran et al., 2018; Dai et al., 2019; Zhang et al., 2018) resemble our task. In a style transfer, the text style of the input sentences is changed. For instance, Jain et al. (2019) transferred from formal to informal sentences. Logeswaran et al. (2018) transferred sentences by controlling such attributes as mood and tense. These style transfer tasks use sentence pairs; our word attribute transfer task uses word pairs. Style transfer changes sentence styles, but our task changes the word attributes (contents). Soricut & Och (2015) studied the problem of morphological transformation based on character information. Our work aims more general attribute transfer such as gender transfer and country-capital and is not limited to the morphological transformation.
|
| 225 |
+
|
| 226 |
+
# 7 CONCLUSION AND FUTURE WORK
|
| 227 |
+
|
| 228 |
+
We proposed a novel representation learning framework based on reflection to invert a certain attribute of a word vector. We proposed a reflection-based method for word attribute transfers without relying on the explicit attribute knowledge of an input word, which is necessary for a simple analogy-based transfer. Experimental results showed that our proposed method can transfer the word attributes if the input word has a target attribute. If not, reflection does not transfer the word.
|
| 229 |
+
|
| 230 |
+
Future work includes applications to other transfer tasks: sentence by sentence transfer, such Niu et al. (2018); Prabhumoye et al. (2018); Jain et al. (2019), and entity prediction on an analogic graph embedding space (Liu et al., 2017), in the field of computer vision, visual analogy (Reed et al., 2015), or style transfer (Zhu et al., 2017; Liao et al., 2017) with GANs (Radford et al., 2016; Goodfellow et al., 2014) because their latent space holds analogic relations (Radford et al., 2016).
|
| 231 |
+
|
| 232 |
+
# REFERENCES
|
| 233 |
+
|
| 234 |
+
Carl Allen and Timothy M. Hospedales. Analogies Explained: Towards Understanding Word Embeddings. In Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, pp. 223–231, 2019. URL http: //proceedings.mlr.press/v97/allen19a.html.
|
| 235 |
+
|
| 236 |
+
Sanjeev Arora, Yuanzhi Li, Yingyu Liang, Tengyu Ma, and Andrej Risteski. A Latent Variable Model Approach to PMI-based Word Embeddings. Transactions of the Association for Computational Linguistics, 4:385–399, 2016. URL https://transacl.org/ojs/index.php/ tacl/article/view/742.
|
| 237 |
+
|
| 238 |
+
Piotr Bojanowski, Edouard Grave, Armand Joulin, and Tomas Mikolov. Enriching Word Vectors with Subword Information. Transactions of the Association for Computational Linguistics, 5:135–146, 2017. URL https://transacl.org/ojs/index.php/tacl/article/ view/999.
|
| 239 |
+
|
| 240 |
+
Kenneth Ward Church and Patrick Hanks. Word Association Norms, Mutual Information, and Lexicography. Computational Linguistics, 16(1):22–29, 1990.
|
| 241 |
+
|
| 242 |
+
Ning Dai, Jianze Liang, Xipeng Qiu, and Xuanjing Huang. Style Transformer: Unpaired Text Style Transfer without Disentangled Latent Representation. In Proceedings of the 57th Conference of the Association for Computational Linguistics, ACL 2019, Florence, Italy, July 28- August 2, 2019, Volume 1: Long Papers, pp. 5997–6007, 2019. URL https://www.aclweb.org/ anthology/P19-1601/.
|
| 243 |
+
|
| 244 |
+
Kawin Ethayarajh, David Duvenaud, and Graeme Hirst. Towards Understanding Linear Word Analogies. In Proceedings of the 57th Conference of the Association for Computational Linguistics, ACL 2019, Florence, Italy, July 28- August 2, 2019, Volume 1: Long Papers, pp. 3253–3262, 2019. URL https://www.aclweb.org/anthology/P19-1315/.
|
| 245 |
+
|
| 246 |
+
Alex Gittens, Dimitris Achlioptas, and Michael W. Mahoney. Skip-Gram - Zipf $^ +$ Uniform $=$ Vector Additivity. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics, ACL 2017, Vancouver, Canada, July 30 - August 4, Volume 1: Long Papers, pp. 69–76, 2017. doi: 10.18653/v1/P17-1007. URL https://doi.org/10.18653/v1/P17-1007.
|
| 247 |
+
|
| 248 |
+
Anna Gladkova, Aleksandr Drozd, and Satoshi Matsuoka. Analogy-based detection of morphological and semantic relations with word embeddings: what works and what doesn’t. In Proceedings of the Student Research Workshop, SRW@HLT-NAACL 2016, The 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, San Diego California, USA, June 12-17, 2016, pp. 8–15, 2016. URL https://www.aclweb.org/anthology/N16-2002/.
|
| 249 |
+
|
| 250 |
+
Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron C. Courville, and Yoshua Bengio. Generative Adversarial Nets. In Advances in Neural Information Processing Systems 27: Annual Conference on Neural Information Processing Systems 2014, December 8-13 2014, Montreal, Quebec, Canada, pp. 2672–2680, 2014. URL http://papers.nips.cc/paper/5423-generative-adversarial-nets.
|
| 251 |
+
|
| 252 |
+
Geoffrey E Hinton, James L McClelland, David E Rumelhart, et al. Distributed representations. Carnegie-Mellon University Pittsburgh, PA, 1984.
|
| 253 |
+
|
| 254 |
+
Sergey Ioffe and Christian Szegedy. Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift. In Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, pp. 448–456, 2015. URL http: //proceedings.mlr.press/v37/ioffe15.html.
|
| 255 |
+
|
| 256 |
+
Parag Jain, Abhijit Mishra, Amar Prakash Azad, and Karthik Sankaranarayanan. Unsupervised Controllable Text Formalization. In The Thirty-Third AAAI Conference on Artificial Intelligence, AAAI 2019, The Thirty-First Innovative Applications of Artificial Intelligence Conference, IAAI 2019, The Ninth AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI 2019, Honolulu, Hawaii, USA, January 27 - February 1, 2019., pp. 6554–6561, 2019. URL https: //aaai.org/ojs/index.php/AAAI/article/view/4623.
|
| 257 |
+
|
| 258 |
+
Masahiro Kaneko and Danushka Bollegala. Gender-preserving Debiasing for Pre-trained Word Embeddings. In Proceedings of the 57th Conference of the Association for Computational Linguistics, ACL 2019, Florence, Italy, July 28- August 2, 2019, Volume 1: Long Papers, pp. 1641–1650, 2019. URL https://www.aclweb.org/anthology/P19-1160/.
|
| 259 |
+
|
| 260 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A Method for Stochastic Optimization. In 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015. URL http://arxiv.org/abs/1412.6980.
|
| 261 |
+
|
| 262 |
+
Omer Levy and Yoav Goldberg. Linguistic Regularities in Sparse and Explicit Word Representations. In Proceedings of the Eighteenth Conference on Computational Natural Language Learning, CoNLL 2014, Baltimore, Maryland, USA, June 26-27, 2014, pp. 171–180, 2014a. URL https://www.aclweb.org/anthology/W14-1618/.
|
| 263 |
+
|
| 264 |
+
Omer Levy and Yoav Goldberg. Neural Word Embedding as Implicit Matrix Factorization. In Advances in Neural Information Processing Systems 27: Annual Conference on Neural Information Processing Systems 2014, December 8-13 2014, Montreal, Quebec, Canada, pp. 2177–2185, 2014b. URL http://papers.nips.cc/paper/ 5477-neural-word-embedding-as-implicit-matrix-factorization.
|
| 265 |
+
|
| 266 |
+
Jing Liao, Yuan Yao, Lu Yuan, Gang Hua, and Sing Bing Kang. Visual attribute transfer through deep image analogy. ACM Trans. Graph., 36(4):120:1–120:15, 2017. doi: 10.1145/3072959. 3073683. URL https://doi.org/10.1145/3072959.3073683.
|
| 267 |
+
|
| 268 |
+
Tal Linzen. Issues in evaluating semantic spaces using word analogies. In Proceedings of the 1st Workshop on Evaluating Vector-Space Representations for NLP, RepEval@ACL 2016, Berlin, Germany, August 2016, pp. 13–18, 2016. doi: 10.18653/v1/W16-2503. URL https://doi. org/10.18653/v1/W16-2503.
|
| 269 |
+
|
| 270 |
+
Hanxiao Liu, Yuexin Wu, and Yiming Yang. Analogical Inference for Multi-relational Embeddings. In Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, pp. 2168–2178, 2017. URL http://proceedings. mlr.press/v70/liu17d.html.
|
| 271 |
+
|
| 272 |
+
Lajanugen Logeswaran, Honglak Lee, and Samy Bengio. Content preserving text generation with attribute controls. In Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, 3-8 December 2018, Montreal, Canada. ´ , pp. 5108–5118, 2018. URL http://papers.nips.cc/paper/ 7757-content-preserving-text-generation-with-attribute-controls.
|
| 273 |
+
|
| 274 |
+
Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient Estimation of Word Representations in Vector Space. In 1st International Conference on Learning Representations, ICLR 2013, Scottsdale, Arizona, USA, May 2-4, 2013, Workshop Track Proceedings, 2013a. URL http://arxiv.org/abs/1301.3781.
|
| 275 |
+
|
| 276 |
+
Tomas Mikolov, Ilya Sutskever, Kai Chen, Gregory S. Corrado, and Jeffrey Dean. Distributed Representations of Words and Phrases and their Compositionality. In Advances in Neural Information Processing Systems 26: 27th Annual Conference on Neural Information Processing Systems 2013. Proceedings of a meeting held December 5-8, 2013, Lake Tahoe, Nevada, United States., pp. 3111–3119, 2013b. URL http://papers.nips.cc/paper/ 5021-distributed-representations-of-words-and-phrases-and-their-c
|
| 277 |
+
|
| 278 |
+
Tomas Mikolov, Wen-tau Yih, and Geoffrey Zweig. Linguistic Regularities in Continuous Space Word Representations. In Human Language Technologies: Conference of the North American Chapter of the Association of Computational Linguistics, Proceedings, June 9-14, 2013, Westin Peachtree Plaza Hotel, Atlanta, Georgia, USA, pp. 746–751, 2013c. URL https://www. aclweb.org/anthology/N13-1090/.
|
| 279 |
+
|
| 280 |
+
Kim Anh Nguyen, Sabine Schulte im Walde, and Ngoc Thang Vu. Distinguishing Antonyms and Synonyms in a Pattern-based Neural Network. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics, EACL 2017, Valencia, Spain, April 3-7, 2017, Volume 1: Long Papers, pp. 76–85, 2017. URL https://www.aclweb. org/anthology/E17-1008/.
|
| 281 |
+
|
| 282 |
+
Xing Niu, Sudha Rao, and Marine Carpuat. Multi-task neural models for translating between styles within and across languages. In Proceedings of the 27th International Conference on Computational Linguistics, COLING 2018, Santa Fe, New Mexico, USA, August 20-26, 2018, pp. 1008– 1021, 2018. URL https://www.aclweb.org/anthology/C18-1086/.
|
| 283 |
+
|
| 284 |
+
Jeffrey Pennington, Richard Socher, and Christopher D. Manning. Glove: Global Vectors for Word Representation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing, EMNLP 2014, October 25-29, 2014, Doha, Qatar, A meeting of SIGDAT, a Special Interest Group of the ACL, pp. 1532–1543, 2014. URL https://www.aclweb. org/anthology/D14-1162/.
|
| 285 |
+
|
| 286 |
+
Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep Contextualized Word Representations. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2018, New Orleans, Louisiana, USA, June 1-6, 2018, Volume 1 (Long Papers), pp. 2227–2237, 2018. URL https://www.aclweb.org/ anthology/N18-1202/.
|
| 287 |
+
|
| 288 |
+
Shrimai Prabhumoye, Yulia Tsvetkov, Ruslan Salakhutdinov, and Alan W. Black. Style Transfer Through Back-Translation. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics, ACL 2018, Melbourne, Australia, July 15-20, 2018, Volume 1: Long Papers, pp. 866–876, 2018. doi: 10.18653/v1/P18-1080. URL https://www.aclweb.org/ anthology/P18-1080/.
|
| 289 |
+
|
| 290 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks. In 4th International Conference on Learning Representations, ICLR 2016, San Juan, Puerto Rico, May 2-4, 2016, Conference Track Proceedings, 2016. URL http://arxiv.org/abs/1511.06434.
|
| 291 |
+
|
| 292 |
+
Scott E. Reed, Yi Zhang, Yuting Zhang, and Honglak Lee. Deep Visual AnalogyMaking. In Advances in Neural Information Processing Systems 28: Annual Conference on Neural Information Processing Systems 2015, December 7-12, 2015, Montreal, Quebec, Canada, pp. 1252–1260, 2015. URL http://papers.nips.cc/paper/ 5845-deep-visual-analogy-making.
|
| 293 |
+
|
| 294 |
+
Radu Soricut and Franz Josef Och. Unsupervised Morphology Induction Using Word Embeddings. In NAACL HLT 2015, The 2015 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Denver, Colorado, USA, May 31 - June 5, 2015, pp. 1627–1637, 2015. URL https://www.aclweb.org/anthology/ N15-1186/.
|
| 295 |
+
|
| 296 |
+
Nitish Srivastava, Geoffrey E. Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. J. Mach. Learn. Res., 15(1): 1929–1958, 2014. URL http://dl.acm.org/citation.cfm?id=2670313.
|
| 297 |
+
|
| 298 |
+
Zhirui Zhang, Shuo Ren, Shujie Liu, Jianyong Wang, Peng Chen, Mu Li, Ming Zhou, and Enhong Chen. Style Transfer as Unsupervised Machine Translation. CoRR, abs/1808.07894, 2018. URL http://arxiv.org/abs/1808.07894.
|
| 299 |
+
|
| 300 |
+
Jieyu Zhao, Yichao Zhou, Zeyu Li, Wei Wang, and Kai-Wei Chang. Learning Gender-Neutral Word Embeddings. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, Brussels, Belgium, October 31 - November 4, 2018, pp. 4847–4853, 2018. URL https://www.aclweb.org/anthology/D18-1521/.
|
| 301 |
+
|
| 302 |
+
Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A. Efros. Unpaired Image-to-Image Translation Using Cycle-Consistent Adversarial Networks. In IEEE International Conference on Computer Vision, ICCV 2017, Venice, Italy, October 22-29, 2017, pp. 2242–2251, 2017. doi: 10.1109/ICCV.2017.244. URL https://doi.org/10.1109/ICCV.2017.244.
|
| 303 |
+
|
| 304 |
+
# A TOP THREE ACCURACY AND STABILITY
|
| 305 |
+
|
| 306 |
+
Table 7: Male-Female
|
| 307 |
+
|
| 308 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">Knowledge</td><td colspan="4">Accuracy (%)</td><td colspan="4">Stability (%)</td></tr><tr><td>Mean@3</td><td>@1</td><td>@2</td><td>@3</td><td>Mean@3</td><td>@1</td><td>@2</td><td>@3</td></tr><tr><td>REF</td><td></td><td>50.00</td><td>20.83</td><td>62.50</td><td>66.67</td><td>99.80</td><td>99.80</td><td>99.80</td><td>99.80</td></tr><tr><td>REF+PM</td><td></td><td>55.56</td><td>41.67</td><td>58.33</td><td>66.67</td><td>99.13</td><td>99.00</td><td>99.20</td><td>99.20</td></tr><tr><td>MLP</td><td></td><td>20.83</td><td>8.33</td><td>20.83</td><td>33.33</td><td>2.20</td><td>2.20</td><td>2.20</td><td>2.20</td></tr><tr><td>DIFF+</td><td></td><td>31.94</td><td>25.00</td><td>33.33</td><td>37.50</td><td>75.43</td><td>72.10</td><td>75.80</td><td>78.40</td></tr><tr><td>DIFF-</td><td></td><td>31.94</td><td>25.00</td><td>33.33</td><td>37.50</td><td>55.80</td><td>49.60</td><td>57.30</td><td>60.50</td></tr><tr><td>MEANDIFF +</td><td></td><td>23.61</td><td>4.17</td><td>33.33</td><td>33.33</td><td>98.93</td><td>98.60</td><td>99.10</td><td>99.10</td></tr><tr><td>MEANDIFF</td><td></td><td>23.61</td><td>8.33</td><td>29.17</td><td>33.33</td><td>97.63</td><td>97.20</td><td>97.80</td><td>97.90</td></tr><tr><td>DIFF</td><td>√</td><td>68.05</td><td>62.50</td><td>66.66</td><td>75.00</td><td>-</td><td>1</td><td>-</td><td>1</td></tr><tr><td>MEANDIFF</td><td>1</td><td>47.22</td><td>12.50</td><td>62.50</td><td>66.67</td><td>-</td><td>-</td><td>-</td><td>-</td></tr></table>
|
| 309 |
+
|
| 310 |
+
Table 8: Singular-Plural
|
| 311 |
+
|
| 312 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">Knowledge</td><td colspan="4">Accuracy (%)</td><td colspan="4">Stability (%)</td></tr><tr><td>Mean@3</td><td>@1</td><td>@2</td><td>@3</td><td>Mean@3</td><td>@1</td><td>@2</td><td>@3</td></tr><tr><td>REF</td><td></td><td>50.00</td><td>0.00</td><td>72.00</td><td>78.00</td><td>100.00</td><td>100.00</td><td>100.00</td><td>100.00</td></tr><tr><td>REF+PM</td><td></td><td>56.67</td><td>22.00</td><td>72.00</td><td>76.00</td><td>99.70</td><td>99.40</td><td>99.80</td><td>99.90</td></tr><tr><td>MLP</td><td></td><td>7.33</td><td>4.00</td><td>8.00</td><td>10.00</td><td>0.13</td><td>0.00</td><td>0.20</td><td>0.20</td></tr><tr><td>DIFF+</td><td></td><td>36.67</td><td>2.00</td><td>50.00</td><td>58.00</td><td>80.27</td><td>77.90</td><td>79.70</td><td>83.20</td></tr><tr><td>DIFF-</td><td></td><td>36.67</td><td>2.00</td><td>52.00</td><td>56.00</td><td>80.27</td><td>78.20</td><td>80.70</td><td>81.90</td></tr><tr><td>MEANDIFF +</td><td></td><td>42.00</td><td>0.00</td><td>56.00</td><td>70.00</td><td>99.47</td><td>99.40</td><td>99.40</td><td>99.60</td></tr><tr><td>MEANDIFF -</td><td></td><td>39.33</td><td>0.00</td><td>56.00</td><td>62.00</td><td>99.50</td><td>99.30</td><td>99.60</td><td>99.60</td></tr><tr><td>DIFF</td><td>√</td><td>49.33</td><td>4.00</td><td>70.00</td><td>74.00</td><td>1</td><td>-</td><td>1</td><td>1</td></tr><tr><td>MEANDIFF</td><td>√</td><td>52.00</td><td>0.00</td><td>76.00</td><td>80.00</td><td>1</td><td>=</td><td>-</td><td>-</td></tr></table>
|
| 313 |
+
|
| 314 |
+
Table 9: Capital-Country
|
| 315 |
+
|
| 316 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">Knowledge</td><td colspan="4">Accuracy (%)</td><td colspan="4">Stability (%)</td></tr><tr><td>Mean@3</td><td>@1</td><td>@2</td><td>@3</td><td>Mean@3</td><td>@1</td><td>@2</td><td>@3</td></tr><tr><td>REF</td><td></td><td>66.67</td><td>36.00</td><td>78.00</td><td>86.00</td><td>99.80</td><td>99.80</td><td>99.80</td><td>99.80</td></tr><tr><td>REF+PM</td><td></td><td>72.67</td><td>58.00</td><td>74.00</td><td>86.00</td><td>99.53</td><td>99.40</td><td>99.60</td><td>99.60</td></tr><tr><td>MLP</td><td></td><td>35.33</td><td>12.00</td><td>40.00</td><td>54.00</td><td>2.80</td><td>2.70</td><td>2.80</td><td>2.90</td></tr><tr><td>DIFF+</td><td></td><td>39.33</td><td>32.00</td><td>42.00</td><td>44.00</td><td>64.87</td><td>53.90</td><td>69.60</td><td>71.10</td></tr><tr><td>DIFF</td><td></td><td>34.67</td><td>30.00</td><td>36.00</td><td>38.00</td><td>58.63</td><td>56.30</td><td>58.90</td><td>60.70</td></tr><tr><td>MEANDIFF +</td><td></td><td>36.00</td><td>22.00</td><td>42.00</td><td>44.00</td><td>89.33</td><td>87.60</td><td>89.70</td><td>90.70</td></tr><tr><td>MEANDIFF-</td><td></td><td>34.67</td><td>14.00</td><td>44.00</td><td>46.00</td><td>93.07</td><td>92.40</td><td>93.10</td><td>93.70</td></tr><tr><td>DIFF</td><td>√</td><td>80.00</td><td>64.00</td><td>86.00</td><td>90.00</td><td>-</td><td>-</td><td>-</td><td>1</td></tr><tr><td>MEANDIFF</td><td>1</td><td>70.67</td><td>36.00</td><td>86.00</td><td>90.00</td><td>=</td><td>-</td><td>-</td><td>-</td></tr></table>
|
| 317 |
+
|
| 318 |
+
Table 10: Antonym
|
| 319 |
+
|
| 320 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">Knowledge</td><td colspan="4">Accuracy (%)</td><td colspan="4">Stability (%)</td></tr><tr><td>Mean@3</td><td>@1</td><td>@2</td><td>@3</td><td>Mean@3</td><td>@1</td><td>@2</td><td>@3</td></tr><tr><td>REF</td><td></td><td>0.94</td><td>0.00</td><td>1.19</td><td>16.21</td><td>99.97</td><td>99.90</td><td>100.00</td><td>100.00</td></tr><tr><td>REF+PM</td><td></td><td>38.56</td><td>28.79</td><td>41.38</td><td>45.52</td><td>99.93</td><td>99.80</td><td>100.00</td><td>100.00</td></tr><tr><td>MLP</td><td></td><td>41.38</td><td>35.86</td><td>42.59</td><td>45.69</td><td>1..97</td><td>1.90</td><td>2.00</td><td>2.00</td></tr></table>
|
| 321 |
+
|
| 322 |
+
# B VISUALIZATION OF PARAMETERIZED MIRRORS
|
| 323 |
+
|
| 324 |
+
Figures below visualize PCA results of a obtained for the test words. We normalized the L2 norm of a to 1 $( \frac { \mathbf { a } } { \lVert \mathbf { a } \rVert } )$ . Corresponding word pairs are connected by solid lines. Figs. 4 and 5 suggest not only the mirror parameters of paired words are similar to each other but also the parameters with the attribute form a cluster — words with the same attribute has similar mirror parameter a. The mirrors of paired words are close to each other in the same attribute (Fig. 4 and 5). Some MF pairs in Fig. 5 are placed away from the cluster of the MF words. This may come from missing principal components due to the small data size used for PCA. Figs. 6, 7, 8, 9, 10, 11, 12, and 13 are the detailed PCA results for four different attributes: MF, SP, CC, and AN. These results show that a reflection transfers a paired word each other by using a similar mirror. For example, rich and poor use almost the same mirror (Fig. 9). On the other hand, different mirrors are used for different word pairs since the mirrors are parameterized. These results shows the effect of the mirror as described in section 4.4.
|
| 325 |
+
|
| 326 |
+

|
| 327 |
+
Figure 4: A PCA result of a (word2vec).
|
| 328 |
+
|
| 329 |
+

|
| 330 |
+
Figure 5: A PCA result of a (GloVe).
|
| 331 |
+
|
| 332 |
+

|
| 333 |
+
Figure 6: Male-Female (word2vec)
|
| 334 |
+
|
| 335 |
+

|
| 336 |
+
Figure 7: Singular-Plural (word2vec)
|
| 337 |
+
|
| 338 |
+

|
| 339 |
+
Figure 8: Capital-Country (word2vec)
|
| 340 |
+
|
| 341 |
+

|
| 342 |
+
Figure 9: Antonym (word2vec)
|
| 343 |
+
|
| 344 |
+

|
| 345 |
+
Figure 10: Male-Female (GloVe)
|
| 346 |
+
|
| 347 |
+

|
| 348 |
+
Figure 11: Singular-Plural (GloVe)
|
| 349 |
+
|
| 350 |
+

|
| 351 |
+
Figure 12: Capital-Country (GloVe)
|
| 352 |
+
|
| 353 |
+

|
| 354 |
+
Figure 13: Antonym (GloVe)
|
md/train/KAV7BDCcN6/KAV7BDCcN6.md
ADDED
|
@@ -0,0 +1,521 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# What Breaks the Curse of Dimensionality in Deep Learning?
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
1 Although learning in high dimensions is commonly believed to suffer from the
|
| 11 |
+
2 curse of dimensionality, modern machine learning methods often exhibit an as
|
| 12 |
+
3 tonishing power to tackle a wide range of challenging real-world learning prob
|
| 13 |
+
4 lems without using abundant amounts of data. How exactly these methods break
|
| 14 |
+
5 this curse remains a fundamental open question in the theory of deep learning.
|
| 15 |
+
6 While previous efforts have investigated this question by studying the data (D),
|
| 16 |
+
7 model (M), and inference algorithm (I) as independent modules, in this paper
|
| 17 |
+
8 we analyzes the triple (D, M, I) as an integrated system. We examine the basic
|
| 18 |
+
9 symmetries of such systems, focusing on four of the main architectures in deep
|
| 19 |
+
10 learning: fully-connected networks (FCN), locally-connected networks (LCN), and
|
| 20 |
+
11 convolutional networks with and without pooling (GAP/VEC). By computing an
|
| 21 |
+
12 eigen-decomposition of the infinite-width limits (aka Neural Kernels) of these
|
| 22 |
+
13 architectures, we characterize how inductive biases (locality, weight-sharing, pool
|
| 23 |
+
14 ing, etc) and the breaking of spurious symmetries can affect the performance of
|
| 24 |
+
15 these learning systems. Our theoretical analysis shows that for many real-world
|
| 25 |
+
16 tasks it is locality rather than symmetry that provides the first-order remedy to the
|
| 26 |
+
17 curse of dimensionality. Empirical results on state-of-the-art models on ImageNet
|
| 27 |
+
18 corroborate our results.
|
| 28 |
+
|
| 29 |
+
# 19 1 Introduction
|
| 30 |
+
|
| 31 |
+
20 Statistical problems with high-dimensional data are frequently plagued by the curse of dimensionality,
|
| 32 |
+
21 in which the number of samples required to solve the problem grows rapidly with the dimensionality
|
| 33 |
+
22 of the input. Classical theory explains this phenomenon as the consequence of basic geometric and
|
| 34 |
+
23 algebraic properties of high-dimensional spaces; for example, the number of $\epsilon$ -cubes inside a unit
|
| 35 |
+
24 cube in $\mathbb { R } ^ { \hat { d } }$ grows exponentially like $\epsilon ^ { - d }$ , and the number of degree $r$ polynomials in $\mathbb { R } ^ { d }$ grows like a
|
| 36 |
+
25 power-law $d ^ { r }$ . Since for real-world problems $d$ is typically in the hundreds or thousands, classical
|
| 37 |
+
26 wisdom suggests that learning is likely to be infeasible. However, starting from the groundbreaking
|
| 38 |
+
27 work AlexNet [1], practitioners in deep learning have tackled a wide range of difficult real-world
|
| 39 |
+
28 learning problems ([2–6]) in high dimensions, once believed by many to be out-of-scope of current
|
| 40 |
+
29 techniques. The astonishing success of modern machine learning methods clearly contradicts the
|
| 41 |
+
30 curse of dimensinonality and therefore poses the fundamental question: mathematically, how do
|
| 42 |
+
31 modern machine learning methods break the curse of dimensionality?
|
| 43 |
+
32 To answer this question, we must trace back to the most fundamental ingredients of machine learning
|
| 44 |
+
33 methods. They are the data $( \mathcal { D } )$ , the model $( \mathcal { M } )$ , and the inference algorithm $( \mathcal { T } )$ .
|
| 45 |
+
34 Data $( \mathcal { D } )$ is of course central in machine learning. In the classical learning theory setting, the learning
|
| 46 |
+
35 objective usually has a power-law decay $m ^ { - \bar { \beta } }$ as the function of the number of training samples
|
| 47 |
+
36 $m$ . The theoretical bound on $\beta$ is usually tiny, owing to the curse of dimensionality, and is of
|
| 48 |
+
37 limited practical utility for high-dimensional data. On the other hand, empirical measurements of
|
| 49 |
+
38 $\beta$ in state-of-the-art deep learning models typically reveal values of $\beta$ that are not at all small (e.g.
|
| 50 |
+
39 $\beta = 0 . 4 3$ for ResNet in Fig.S2) even though $d$ is quite large (e.g. $\dot { d } \sim 1 0 ^ { 5 }$ for ImageNet). This
|
| 51 |
+
40 example suggests that the learning curve must have important functional dependence on $\mathcal { M }$ and $\mathcal { T }$ .
|
| 52 |
+
41 Indeed, as we will observe later, many of the best performing methods exhibit learning curves for
|
| 53 |
+
42 which $\beta = \beta ( m )$ actually increases as $m$ becomes larger, i.e. data makes the usage of data more
|
| 54 |
+
43 efficient. We call this phenomenon DIDE, for data improves data efficiency.
|
| 55 |
+
44 Designing machine learning models $( \mathcal { M } )$ that maximize data-efficiency is critical to the success
|
| 56 |
+
45 of solving real-world tasks. Indeed, breakthroughs in machine learning are often driven by novel
|
| 57 |
+
46 architectures LeNet [7], AlexNet[1], Transformer [2], etc. While some of the inductive biases of these
|
| 58 |
+
47 methods are clear (e.g. translation symmetries of CNNs), others tend to build off of prior empirical
|
| 59 |
+
48 success and are less well-understood (e.g. the implicit bias of SGD). To build our understanding of
|
| 60 |
+
49 these biases and how they affect learning, we conduct a theoretical analysis of them in the infinite
|
| 61 |
+
50 width setting [8–12], which preserves most salient aspects of the architecture while enabling tractable
|
| 62 |
+
51 calculations. We classify all phenomena that could be explained by infinite networks alone as the
|
| 63 |
+
52 consequences of inductive biases.
|
| 64 |
+
53 The inference procedure $( \mathcal { T } )$ is what enables learning in machine learning methods. It is widely
|
| 65 |
+
54 believed that modern inference methods, specifically gradient descent and variants, ‘implicitly‘ bias
|
| 66 |
+
55 the solutions of the networks towards those that generalize well and away from those that generalize
|
| 67 |
+
56 poorly [13–15]. The effects of the inference algorithm are intimately tied to the specifics of the model
|
| 68 |
+
57 (e.g. weight-sharing) and the data (e.g. augmentation), and might not be fully understood with a
|
| 69 |
+
58 fixed-data, fixed-model analysis. Indeed, good performance may derive from interactions between
|
| 70 |
+
59 $( { \mathcal { M } } , { \mathcal { T } } )$ , or $( \mathcal { D } , \mathcal { I } )$ , or even $( \mathcal { D } , \mathcal { M } , \mathcal { T } )$ . In Sec. 3.1, we demonstrate the DIDE effect for a particular
|
| 71 |
+
60 choice of $( \mathcal { D } , \mathcal { M } , \mathcal { T } )$ and show that this effect disappears if any one of $\mathcal { D }$ , $\mathcal { M }$ , or $\mathcal { T }$ is altered.
|
| 72 |
+
|
| 73 |
+
The above discussion highlights the insufficiency of treating $\mathcal { D }$ , $\mathcal { M }$ , and $\mathcal { T }$ as separate non-interacting modules. They must be considered as an integrated system. Throughout this paper, we will refer to the triplet $( \mathcal { D } , \mathcal { M } , \mathcal { T } )$ as a (machine) learning system and the tuple $( { \mathcal { M } } , { \mathcal { T } } )$ as the learning algorithm of the system that operates on $\mathcal { D }$ . We summarize our contributions below.
|
| 74 |
+
|
| 75 |
+
1. We surface the basic symmetries of various $( \mathcal { D } , \mathcal { M } , \mathcal { T } )$ associated to four of the main architectures in deep learning $\mathsf { F C N } _ { n }$ (fully-connected networks), $\mathsf { L C N } _ { n }$ (locally-connected networks), ${ \mathsf { V E C } } _ { n } / { \mathsf { G A P } } _ { n }$ (convolution networks with a flattening /a global average pooling readout layer), their infinite width counterparts $\mathsf { F C N } _ { \infty } / \mathsf { L C N } _ { \infty } / \mathsf { V E C } _ { \infty } / \mathsf { G A P } _ { \infty }$ . Treating $\mathsf { F C N } _ { n / \infty }$ as the baseline model, we show that the locality from $\mathsf { L C N } _ { n }$ and the weight-sharing from $\mathsf { \dot { V } E C } _ { n } / \mathsf { G A P } _ { n }$ break spurious symmetries and lead to better systems. Empirically, we examine the relation between the symmetries and the performance of the systems in the infinite width setting and finite width setting with various of interventions. Surprisingly, we observe that state-of-the-art learning system (EfficientNet[16]) on ImageNet can learn almost equally well even the coordinate of the data are transformed by the symmetry group defined by $\mathsf { L C N } _ { n }$ .
|
| 76 |
+
|
| 77 |
+
2. We show that although the weight-sharing from ${ \mathsf { V E C } } _ { n }$ provides coordinate information of the data to the system, as the width gets larger, it becomes harder for the learning algorithm to explore such information and at infinite width, the system restores the symmetry group that is identical to $\mathsf { L C N } _ { n }$ , and is completely unaware of the coordinate information. As a consequence, the performance of the network, as a function of width, monotonically decays [12]. This is in stark contrast to recent finding that the performance of network is positively correlated to its width. We show that this phenomenon continues to hold even with various interventions (larger learning rate and l2 regularization) to the training procedures. However, with more data (e.g. data augmentation) ${ \mathsf { V E C } } _ { n }$ can be on par with ${ \mathsf { G A P } } _ { n }$ .
|
| 78 |
+
|
| 79 |
+
3. The function space defined by $\mathsf { L C N } _ { n }$ is a super set of that defined by ${ \mathsf { V E C } } _ { n }$ . We prove the opposite is true. Therefore, ${ \mathsf { V E C } } _ { n }$ is able to express functions in the space with a stronger inductive bias ${ \mathsf { G A P } } _ { n }$ (translation invariance) and functions in a seemingly much larger class $\mathsf { L C N } _ { n }$ . We hypothesize that as the dataset grows, the learned functions using ${ \mathsf { V E C } } _ { n }$ is transitioned away from those learned using $\mathsf { L C N } _ { n }$ and become closer to those learned using ${ \mathsf { G A P } } _ { n }$ . This suggests, even though the prior (provided by human) is not $100 \%$ correct, with the help of more data, gradient descent might be able to correct it, a possible explanation of DIDE.
|
| 80 |
+
|
| 81 |
+
4. When the input space is the product of hyperspheres, we eigendecompose the kernels associated to one-hidden layer infinite width network, $\mathsf { F C N } _ { \infty }$ , $\mathsf { V } \bar { \mathsf { E } } \mathsf { C } _ { \infty } = \mathsf { L } \bar { \mathsf { C } } \mathsf { N } _ { \infty }$ and $\mathsf { G A P } _ { \infty }$ . We treat $\mathsf { F C N } _ { \infty }$ as the baseline, whose order $r$ eigenspace has dimension of order $d ^ { r }$ and eigenvalues of order $d ^ { - r }$ for $r \geq 0$ [17]. We show that locality alone (i.e. $\mathsf { V E C } _ { \infty , \mathsf { \Lambda } }$ ) dramatically reduces the dimension of the $r$ -eigenspace for $r \geq 2$ and the spectral gap between all $r$ -eigenspaces but $r = 0$ and $r = 1$ , making learning of higher order eigenspaces feasible with dramatically fewer samples and gradient steps. In addition, pooling (i.e. $\mathsf { G A P } _ { \infty } \mathrm { \Gamma } _ { \infty } .$ ) reduces the dimension of $r$ -eigenspace for $r \geq 1$ by a factor equal to the size of the pooling window, but it does not change the spectra in an essential way.
|
| 82 |
+
|
| 83 |
+
02 Our empirical and theoretical results surface the importance of locality which, we believe, provides
|
| 84 |
+
03 the first-order remedy to the curse of dimensionality for many real-world tasks and which has been
|
| 85 |
+
04 largely overlooked.
|
| 86 |
+
|
| 87 |
+
# 2 Preliminary and Notation
|
| 88 |
+
|
| 89 |
+
# 2.1 Neural Networks
|
| 90 |
+
|
| 91 |
+
107 We focus our presentation on the supervised learning setting and more concretely, on image
|
| 92 |
+
108 recognition. Let $\mathcal { D } \subseteq ( \mathbb { R } ^ { d } ) ^ { 3 } \times \mathbb { R } ^ { k } \overset { \cdot } { \equiv } \mathbb { R } ^ { 3 d } \times \mathbb { R } ^ { k }$ denote the data set (training and test) and
|
| 93 |
+
109 $\mathcal { X } = \{ x : ( x , y ) \in \mathcal { D } \}$ and $\mathcal { V } = \{ y : ( x , y ) \in \mathcal { D } \}$ denote the input space (images) and label space,
|
| 94 |
+
110 respectively. Here $d$ is the spatial dimension (e.g. $d = 3 2 \times 3 2$ for CIFAR-10) of the images and 3 is
|
| 95 |
+
111 the total number of channels (i.e. RGB). We use $\mathsf { F C N } _ { n }$ to denote a $L$ -hidden layer fully-connected
|
| 96 |
+
112 network with identical hidden widths $n _ { l } = n \in \mathbb { N }$ for $l = 1 , . . . , L$ and with readout width $n _ { L + 1 } = k$
|
| 97 |
+
113 (the number of logits). For each $x \in \mathbb { R } ^ { 3 d } = ( \mathbb { R } ^ { d } ) ^ { 3 }$ , we use $h ^ { l } ( x ) , x ^ { l } ( x ) \in \mathbb R ^ { n _ { l } }$ to represent the pre
|
| 98 |
+
114 and post-activation functions at layer $l$ with input $x$ . The recurrence relation FCN is given by
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
\left\{ \begin{array} { l l } { h ^ { l + 1 } } & { = x ^ { l } W ^ { l + 1 } } \\ { x ^ { l + 1 } } & { = \phi \left( h ^ { l + 1 } \right) } \end{array} \right. \mathrm { a n d } \ W _ { i , j } ^ { l } = \frac { 1 } { \sqrt { n _ { l } } } \omega _ { i j } ^ { l } , \quad \omega _ { i j } ^ { l } \sim \mathcal { N } ( 0 , 1 )
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
115 where $\phi$ is a point-wise activation function, $W ^ { l + 1 } \in \mathbb { R } ^ { n _ { l } \times n _ { l + 1 } }$ are the weights and $\omega _ { i j } ^ { l }$ are the
|
| 105 |
+
116 trainable parameters, drawn i.i.d. from a standard Gaussian $\sim \mathcal { N } ( 0 , 1 )$ at initialization. For simplicity
|
| 106 |
+
117 of the presentation, the bias terms and the hyperparameters (the variances of the weights) are omitted.
|
| 107 |
+
118 Adding them back won’t affect the conclusion of the paper.
|
| 108 |
+
119 For convolutional networks or locally-connected networks, the inputs are treated as tensors in $( \mathbb { R } ^ { d } ) ^ { 3 }$ .
|
| 109 |
+
120 The recurrent relation of convolutional networks can be written as
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
x _ { \alpha , j } ^ { l + 1 } = \phi ( h _ { \alpha , j } ^ { l + 1 } ) \quad \mathrm { a n d } \quad h _ { \alpha , j } ^ { l + 1 } \equiv { \frac { 1 } { \sqrt { ( 2 k + 1 ) n ^ { l } } } } \sum _ { j = 1 } ^ { n ^ { l } } \sum _ { \beta = - k } ^ { k } x _ { \alpha + \beta , i } ^ { l } \omega _ { i j , \beta } ^ { l }
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
121 Here $\alpha \in [ d ]$ denote the spatial location, $i / j \in [ n ]$ denotes the fanin/fanout channel indices. For
|
| 116 |
+
122 notational convenience, we assume circular padding and stride equal to 1 for all layers. The features
|
| 117 |
+
123 of the penultimate layer are 2D tensors and there are two commonly used approaches to map them
|
| 118 |
+
124 to the logit layer: stack a dense layer after either vectorizing the 2D tensor to a 1D vector or
|
| 119 |
+
125 applying a global average pooling layer to each channel. We use ${ \mathsf { V E C } } _ { n } / { \mathsf { G A P } } _ { n }$ to denote the network
|
| 120 |
+
126 obtain from the former/latter, which are known to be equipped with the inductive biases translation
|
| 121 |
+
127 equivariant/invariant. The readout layer of ${ \mathsf { V E C } } _ { n } / { \mathsf { G A P } } _ { n } ^ { - }$ could be written as
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
x _ { j } ^ { L + 1 } = \frac { 1 } { \sqrt { d n } } \sum _ { \alpha \in [ d ] } x _ { \alpha , i } ^ { L } w _ { \alpha , i j } ^ { L + 1 } , x _ { j } ^ { L + 1 } = \frac { 1 } { \sqrt { n } } \sum _ { i \in [ n ] } \left( \frac { 1 } { d } \sum _ { \alpha \in [ d ] } x _ { \alpha , i } ^ { L } \right) w _ { i j } ^ { L + 1 }
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
128 We briefly remark the the key difference between the two. In ${ \mathsf { V E C } } _ { n }$ , each pixel in the penultimate
|
| 128 |
+
129 layer has its own (independent random) variable while pixels within the same channel shared the
|
| 129 |
+
130 same (random) variable in $\mathsf { G A P } _ { n }$ . It is clear that the function space of ${ \mathsf { V E C } } _ { n }$ contains that of ${ \mathsf { G A P } } _ { n }$ .
|
| 130 |
+
131 Locally Connected Networks $\mathsf { L C N } _ { n }$ [18, 19] are convolutional network without weight sharing
|
| 131 |
+
132 between spatial locations. $\mathsf { L C N } _ { n }$ preserve the connectivity pattern, and thus topology, of a convnet.
|
| 132 |
+
133 Mathematically, the current formula is defind as in Equation 2 with all the shared parameters $\omega _ { i j , \beta } ^ { l }$
|
| 133 |
+
134 replaced by unshared $\omega _ { i j , \alpha , \beta } ^ { l } \sim \mathcal { N } ( 0 , 1 )$
|
| 134 |
+
135 In this note, we assume that the $\mathsf { L C N } _ { n }$ are always associated with a vectorization readout layer and it
|
| 135 |
+
136 is clear, as a function space, $\mathsf { L C N } _ { n }$ is a super set of ${ \mathsf { V E C } } _ { n }$ . Interestingly,the opposite is also true.
|
| 136 |
+
37 Theorem 2.1 (Sec. B). Let $\mathsf { V E C } _ { n } / \mathsf { L C N } _ { n } / \mathsf { G A P } _ { n }$ denote the set of functions that can be represented
|
| 137 |
+
138 by $L$ -hidden layer $\mathsf { V E C } _ { n } / \mathsf { L C N } _ { n } / \mathsf { G A P } _ { n }$ networks with hidden width $n$ . Then
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
{ \mathsf { G A P } } _ { n } \subseteq { \mathsf { V E C } } _ { n } \subseteq { \mathsf { L C N } } _ { n } \subseteq { \mathsf { V E C } } _ { d n }
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
139 The significance of this theorem is that if we consider the function space ${ \mathsf { V E C } } _ { n }$ as a soft prior,
|
| 144 |
+
140 gradient descent could move it closer to a better prior ${ \mathsf { G A P } } _ { n }$ (translation invariance) if the average
|
| 145 |
+
141 pooling is (approximately) learned in the readout layer or it might remain close to $\mathsf { L C N } _ { n }$ .
|
| 146 |
+
|
| 147 |
+
# 2.2 Gradient Descent Training
|
| 148 |
+
|
| 149 |
+
143 We use $f$ to denote any functions defined by the architectures above and $\theta$ to denote the collection
|
| 150 |
+
144 of all parameters. Denote by $\theta _ { t }$ the time-dependence of the parameters and by $\theta _ { 0 }$ their initial
|
| 151 |
+
145 values. We use $f _ { t } ( x ) \equiv f ( \dot { x } , \theta _ { t } ) \in \mathbb R ^ { k }$ to denote the output (or logits) of the neural network at
|
| 152 |
+
146 time $t$ . Let $\ell ( \hat { y } , y ) : \mathbb { R } ^ { k } \times \mathbb { R } ^ { k } \to \mathbb { R }$ denote the loss function where the first/second argument is
|
| 153 |
+
147 the prediction/true label. By applying continuous time gradient descent to minimize the objective
|
| 154 |
+
148 $\begin{array} { r } { \mathcal { L } = \sum _ { ( x , y ) \in \mathcal { D } } \ell ( f _ { t } ( x , \theta ) , y ) } \end{array}$ , the evolution of the parameters $\theta$ and the logits $f$ can be written as
|
| 155 |
+
|
| 156 |
+
$$
|
| 157 |
+
\begin{array} { r } { \dot { \theta } _ { t } = - \nabla _ { \theta } f _ { t } ( \mathcal { X } _ { T } ) ^ { T } \nabla _ { f _ { t } ( \mathcal { X } _ { T } ) } \mathcal { L } , \qquad \dot { f } _ { t } ( \mathcal { X } _ { T } ) = \nabla _ { \theta } f _ { t } ( \mathcal { X } _ { T } ) \dot { \theta } _ { t } = - \hat { \Theta } _ { t } ( \mathcal { X } _ { T } , \mathcal { X } _ { T } ) \nabla _ { f _ { t } ( \mathcal { X } _ { T } ) } \mathcal { L } } \end{array}
|
| 158 |
+
$$
|
| 159 |
+
|
| 160 |
+
149 where $f _ { t } ( \mathcal { X } _ { T } ) = \operatorname { v e c } \left( [ f _ { t } \left( x \right) ] _ { x \in \mathcal { X } _ { T } } \right)$ , the $k | \mathcal { D } | \times 1$ vector of concatenated logits for all examples, and
|
| 161 |
+
150 $\nabla _ { f _ { t } ( \mathcal { X } _ { T } ) } \mathcal { L }$ is the gradient of the loss with respect to the model’s output, $f _ { t } ( \mathcal { X } _ { T } )$ . $\hat { \Theta } _ { t } \equiv \hat { \Theta } _ { t } ( \mathcal { X } _ { T } , \mathcal { X } _ { T } )$
|
| 162 |
+
151 is the tangent kernel at time $t$ , which is a $k | \mathcal { D } | \times k | \mathcal { D } |$ kernel matrix
|
| 163 |
+
|
| 164 |
+
$$
|
| 165 |
+
\hat { \Theta } _ { t } = \nabla _ { \theta } f _ { t } ( \mathcal { X } _ { T } ) \nabla _ { \theta } f _ { t } { ( \mathcal { X } _ { T } ) } ^ { T }
|
| 166 |
+
$$
|
| 167 |
+
|
| 168 |
+
152 One can define the tangent kernel for general arguments, e.g. $\hat { \Theta } _ { t } ( x , \mathcal { X } _ { T } )$ where $x$ is test input. At
|
| 169 |
+
153 finite-width, $\hat { \Theta }$ will depend on the specific random draw of the parameters and evolve with time. As
|
| 170 |
+
154 such, for a test point $x$ the prediction $f _ { t } ( x )$ depends on the random initalization and is also stochastic.
|
| 171 |
+
155 Note that the parameters are initialized randomly and the randomness will be carried out through the
|
| 172 |
+
156 training procedure. As a consequence, the prediction functions are stochastic.
|
| 173 |
+
|
| 174 |
+
# 57 2.3 Infinite Network: Gaussian Processes and the Neural Tangent Kernels
|
| 175 |
+
|
| 176 |
+
158 Neural Networks as Gaussian Processes (NNGP). As the width $n \infty$ , at initialization the
|
| 177 |
+
159 output $f _ { 0 } ( \mathcal { X } )$ forms a Gaussian Process $f _ { 0 } ( \mathcal { X } ) \sim \mathcal { G P } ( 0 , \mathcal { K } ( \mathcal { X } , \mathcal { X } ) )$ , known as the NNGP [8, 20, 21].
|
| 178 |
+
160 Here $\kappa$ is the GP kernel and can be computed in closed form for a variety of architectures. By treating
|
| 179 |
+
161 this infinite width network as a Bayesian model (aka Bayesian Neural Networks) and applying
|
| 180 |
+
162 Bayesian inference, the posterior is also a GP
|
| 181 |
+
|
| 182 |
+
$$
|
| 183 |
+
\mathcal { N } \left( \mathcal { K } ( \mathcal { X } _ { * } , \mathcal { X } _ { T } ) \mathcal { K } ^ { - 1 } ( \mathcal { X } _ { T } , \mathcal { X } _ { T } ) \mathcal { Y } _ { T } , \mathcal { K } ( \mathcal { X } _ { * } , \mathcal { X } _ { * } ) - \mathcal { K } ( \mathcal { X } _ { * } , \mathcal { X } ) \mathcal { K } ( \mathcal { X } , \mathcal { X } ) ^ { - 1 } \mathcal { K } ( \mathcal { X } _ { * } , \mathcal { X } ) ^ { T } \right)
|
| 184 |
+
$$
|
| 185 |
+
|
| 186 |
+
163 Neural Tangent Kernelss(NTK). Recent advance in global convergence theory of over
|
| 187 |
+
164 parameterized networks [22–25, 12] has shown that under certain assumptions, the tangent kernels is
|
| 188 |
+
165 almost stationary over the course of training and is concentrated on its infinite width limit $\Theta$ in the
|
| 189 |
+
166 sense there is a constant $C$ independent of $t$ and the network’s width $n$ such that
|
| 190 |
+
|
| 191 |
+
$$
|
| 192 |
+
\operatorname* { s u p } _ { t \geq 0 } \| \hat { \Theta } _ { t } ( \mathcal { X } _ { T } , \mathcal { X } _ { T } ) - \Theta ( \mathcal { X } _ { T } , \mathcal { X } _ { T } ) \| _ { F } + \| \hat { \Theta } _ { t } ( \mathcal { X } _ { T } , \mathcal { X } _ { * } ) - \Theta ( \mathcal { X } _ { T } , \mathcal { X } _ { * } ) \| _ { F } \leq \frac { C } { \sqrt { n } } .
|
| 193 |
+
$$
|
| 194 |
+
|
| 195 |
+
167 where is the infinite width limit of $\Theta$ at initialization, whose existence has been proved in [22, 26].
|
| 196 |
+
168 As such, when the loss is the mean squared error (MSE), the mean prediction (marginarized over
|
| 197 |
+
169 random initialization) has the following closed form
|
| 198 |
+
|
| 199 |
+
$$
|
| 200 |
+
\begin{array} { r } { f ( \mathcal { X } _ { * } ) = \Theta \left( \mathcal { X } _ { * } , \mathcal { X } _ { T } \right) \Theta ^ { - 1 } ( \mathcal { X } _ { T } , \mathcal { X } _ { T } ) \left( I - e ^ { - \eta \Theta ( \mathcal { X } _ { T } , \mathcal { X } _ { T } ) t } \right) \mathcal { V } , } \end{array}
|
| 201 |
+
$$
|
| 202 |
+
|
| 203 |
+
170 Letting $t \to \infty$ , the above solution is the same as that of the kernel ridgeless regression using the
|
| 204 |
+
171 infinite width tangent kernel $\Theta$ . We use $\mathsf { F C N } _ { \infty } ( x ) , \mathsf { L C N } _ { \infty } ( x ) , \mathsf { V E C } _ { \infty } ( \bar { x } )$ and ${ \mathsf { G A P } } _ { \infty } ( x )$ to denote
|
| 205 |
+
172 the infinite width solutions (either the GP inference or the NTK regression) for the corresponding
|
| 206 |
+
173 architectures, where we have suppressed the dependence on the training data $( \mathcal { X } _ { T } , \mathcal { Y } _ { T } )$ .
|
| 207 |
+
175 Symmetry is fundamental in physical systems. So is it in machine learning systems. We explore
|
| 208 |
+
176 symmetries of various machine learning systems in this section. Given $\mathcal { D } = ( \mathcal { X } , \mathcal { Y } )$ and a transforma
|
| 209 |
+
177 tion on the input space $\tau : \mathbb { R } ^ { 3 d } \mathbb { R } ^ { 3 d }$ , we set $\boldsymbol { \tau } ( \mathcal { D } ) = ( \boldsymbol { \tau } ( \boldsymbol { \mathcal { X } } ) , \boldsymbol { \mathcal { Y } } )$ . Let ${ \mathrm { O } } ( 3 d )$ denote the orthogonal
|
| 210 |
+
178 group on the flatten input space $\mathbb { R } ^ { 3 d }$ . The subgroup $0 ( 3 ) ^ { d } \leq 0 ( 3 d )$ operates on the un-flattened
|
| 211 |
+
179 input $( \mathbb { R } ^ { d } ) ^ { 3 }$ , whose element rotates each pixel $x _ { \alpha } \in \mathbb { R } ^ { 3 }$ by an independent element $\tau _ { \alpha } \in \mathbf { O } ( 3 )$ . The
|
| 212 |
+
180 smaller subgroup ${ \mathbf O } ( 3 ) \otimes { \mathbf I } _ { d } \le { \mathbf O } ( 3 ) ^ { d }$ applies the shared rotation (i.e. $\tau _ { \alpha } = \tau$ to all $x _ { \alpha }$ for $\alpha \in [ d ] )$ .
|
| 213 |
+
181 We use $ { \mathbf { P } } ( 3 d )$ to denote the permutation group on $\mathbb { R } ^ { 3 d }$ and $\mathsf { P } ( 3 ) ^ { d }$ and $\mathbf { P ( 3 ) } \otimes \mathbf { I } _ { d }$ are defined similarly.
|
| 214 |
+
182 Note that rotating $\mathcal { X }$ by $\tau$ is equivalent to transfer the original coordinate system by the adjoint
|
| 215 |
+
183 tranformation $\tau ^ { * } = \tau ^ { - 1 }$ .
|
| 216 |
+
184 For a deterministic (stochastic) learning algorithm $\mathbf { \mathcal { A } } = \left( \mathcal { M } , \mathcal { T } \right)$ , we use $\boldsymbol { \mathcal { A } } ( \mathcal { D } _ { T } )$ to denote the learned
|
| 217 |
+
185 function (distribution of the learned functions) using training set $\mathcal { D } _ { T }$ . We use $\mathcal { A } ^ { \tau } ( \mathcal { D } _ { T } )$ to denote
|
| 218 |
+
186 the learned function(s) using $\tau ( \mathcal { D } _ { T } )$ and makes prediction on the transformed test point $\tau ( \mathcal { X } _ { * } )$ . In
|
| 219 |
+
187 another word, the learning algorithm is conducted in the input space whose coordinate system is
|
| 220 |
+
188 transformed by τ −1.
|
| 221 |
+
|
| 222 |
+
Definition 1. Let $\mathcal { G }$ be a group of transformations $\mathbb { R } ^ { 3 d } \to \mathbb { R } ^ { 3 d }$ . We say a deterministic (stochastic) learning algorithm $\mathbf { \mathcal { A } } = \left( \mathcal { M } , \mathcal { T } \right)$ is $g$ -invariant if $\mathcal { A } = \mathcal { A } ^ { g }$ $\boldsymbol { \mathcal { A } } = ^ { d } \_ { A } \boldsymbol { g }$ ). In this case, we say the system $( \mathcal { D } , \mathcal { M } , \mathcal { T } )$ is $g$ -invariant and use the notation $( \mathcal { D } , \mathcal { M } , \mathcal { Z } ) = ( g \mathcal { D } , \mathcal { M } , \mathcal { Z } )$ . If this holds for all $g \in { \mathcal { G } }$ , then we say the algorithm and the system are $\mathcal { G }$ -invariant.
|
| 223 |
+
|
| 224 |
+
193 If $( { \mathcal { M } } , { \mathcal { T } } )$ is the algorithm of minimum norm linear regressor, then $( \mathcal { D } , \mathcal { M } , \mathcal { T } )$ is $\mathrm { O } ( 3 ) ^ { d }$ -invariant;
|
| 225 |
+
194 see Sec.G for more details. Note that the symmetry (invariance) in our definition is a property of a
|
| 226 |
+
195 system and is different from the notion of symmetry that are commonly used in the machine learning
|
| 227 |
+
196 community, which is a property of a function (e.g. translation invariance).
|
| 228 |
+
|
| 229 |
+
197 Theorem 3.1 (Sec.C). If the parameters of the networks are initialized with iid $\mathcal { N } ( 0 , 1 )$ , then • $\mathsf { F C N } _ { n / \infty }$ are ${ \bf O } ( 3 d )$ -invariant. 200 • ${ \mathsf { V E C } } _ { n }$ is $\mathbf { O ( 3 ) } \otimes \mathbf { I } _ { d }$ -invariant and ${ \mathsf { V E C } } _ { \infty }$ 201 is $O ( 3 ) ^ { d }$ -invariant. • $\mathsf { L C N } _ { n / \infty }$ are O(3)d-invariant. 202 • ${ \mathsf { G A P } } _ { n / \infty }$ are ${ \mathbf { O } } ( 3 ) \otimes { \mathbf { I } } _ { d }$ -invariant.
|
| 230 |
+
|
| 231 |
+
203 The ${ \bf O } ( 3 d )$ -invariant of $\mathsf { F C N } _ { \infty }$ is because the NTK/NNGP kernel is an inner product kernel, namely,
|
| 232 |
+
204 there is a function $k$ such that the kernels have the form $k ( \langle x , x ^ { \prime } \rangle )$ . The ${ \bf O } ( 3 d )$ -invariant of finite
|
| 233 |
+
205 width $\mathsf { F C N } _ { n }$ is due to the Gaussian initialization of the first layer which was first observed and
|
| 234 |
+
206 proved in [27]. Rotating the input by $\tau \in \mathrm { O } ( 3 d )$ is equivalent to rotating the weight matrix $\omega$ of
|
| 235 |
+
207 the first layer by $\tau ^ { * }$ . Since for $\omega \in \mathcal { N } ( 0 , 1 ) ^ { 3 d } \tau ^ { * } \omega = ^ { d } \omega$ , at random initialization, the distribution
|
| 236 |
+
208 of the output functions (the prior) are unchanged if all inputs are rotated by the same element in
|
| 237 |
+
209 ${ \mathrm { O } } ( 3 d )$ . This property continues to hold throughout the course of (continue/discrete) gradient descent
|
| 238 |
+
210 training with/without $L ^ { 2 }$ -regularization and Bayesian posterior inference. For the same reason, $\mathsf { L C N } _ { n }$
|
| 239 |
+
211 is $O ( 3 ) ^ { d }$ -invariant because each patch of the image uses independent Gaussian random variables.
|
| 240 |
+
212 However, weight-sharing in ${ \mathsf { V E C } } _ { n }$ and ${ \mathsf { G A P } } _ { n }$ breaks the $\mathrm { O } ( 3 ) ^ { d }$ symmetry, reducing it to ${ \bf O ( 3 ) } \otimes { \bf I } _ { d }$ .
|
| 241 |
+
|
| 242 |
+
13 For infinite networks, $\mathsf { L C N } _ { \infty } = \mathsf { V E C } _ { \infty }$ [28–31]. The kernels of ${ \mathsf { V E C } } _ { \infty }$ and $\mathsf { G A P } _ { \infty }$ are of the forms
|
| 243 |
+
|
| 244 |
+
$$
|
| 245 |
+
\Theta _ { \mathsf { V E C } } ( x , x ^ { \prime } ) = k \bigl ( \{ \langle x _ { \alpha } , x _ { \alpha } ^ { \prime } \rangle \} _ { \alpha \in [ d ] } \bigr ) \quad \mathrm { a n d } \quad \Theta _ { \mathsf { G A P } } ( x , x ^ { \prime } ) = k \bigl ( \{ \langle x _ { \alpha } , x _ { \alpha ^ { \prime } } ^ { \prime } \rangle \} _ { \alpha , \alpha ^ { \prime } \in [ d ] } \bigr ) ,
|
| 246 |
+
$$
|
| 247 |
+
|
| 248 |
+
214 resp. The former depends only on the inner product between pixels in the same spatial location,
|
| 249 |
+
215 breaking the ${ \mathrm { O } } ( 3 d )$ symmetry and reducing it to $O ( 3 ) ^ { d }$ . In addition, the latter depends also on the
|
| 250 |
+
216 inner products of pixels across different spatial locations due to pooling, which breaks the $O ( 3 ) ^ { d }$
|
| 251 |
+
217 symmetry and reduces it to ${ \mathbf { O } } ( 3 ) \otimes { \mathbf { I } } _ { d }$ .
|
| 252 |
+
218 Note that $\dim ( \mathrm { O } ( 3 d ) ) = 3 d ( 3 d - 1 ) / 2$ , $\dim ( \mathbf { O } ( 3 ) ^ { d } ) = 3 d$ and $\mathrm { d i m } ( \mathrm { O } ( 3 ) \otimes \mathbf { I } _ { d } ) = 3$ . $\mathsf { L C N } _ { n } / \mathsf { V E C } _ { \infty }$
|
| 253 |
+
219 dramatically reduces the dimension of the symmetry group. It is worth mentioning that while
|
| 254 |
+
220 $\mathrm { d i m } ( \mathrm { O } ( 3 d ) )$ many pairs of rotated and unrotated images are needed to recover the exact rotation in
|
| 255 |
+
221 ${ \mathrm { O } } ( 3 d )$ , only 3 pairs are sufficient for $O ( 3 ) ^ { d }$ , same as that of ${ \mathbf { O } } ( 3 ) \otimes { \mathbf { I } } _ { d }$ . The results of the paper
|
| 256 |
+
222 are presented in the most vanilla setting. Our methods can easily extend to more complicated
|
| 257 |
+
223 architectures like ResNet[32], MLP-Mixer[33] and etc. The symmetry groups of such systems
|
| 258 |
+
224 need to be computed in a case-by-case manner by identifying the invariant group of the random
|
| 259 |
+
225 initialization and training procedures.
|
| 260 |
+
|
| 261 |
+

|
| 262 |
+
Figure 1: Performance vs Symmetry. Machine learning systems are equipped with various kinds of symmetries. Transforming the system by the associated symmetry does not affect the performance of the system. However, injecting spurious symmetries beyond the associated symmetries could dramatically degrade their performance for both finite and infinite networks.
|
| 263 |
+
|
| 264 |
+

|
| 265 |
+
Figure 2: Even in the $\mathrm { N N } +$ setting, ${ \mathsf { V E C } } _ { n }$ is closer to ${ \mathsf { G A P } } _ { n }$ for small $n$ and moves towards $\mathsf { V E C } _ { \infty }$ with more symmetries and/or larger $n$ and accuracy drops.
|
| 266 |
+
|
| 267 |
+
# 226 3.1 Empirical Supports and Observations
|
| 268 |
+
|
| 269 |
+
Performance under Rotations. We examinate the performance of: FCN, VEC, LCN, GAP and $\mathsf { L A P ^ { 4 / 8 } }$ , when the coordinates of the data are transformed by six different groups ( $x$ -axis in Fig.1) using the standard dataset CIFAR-10. , Here $\mathsf { L A P ^ { 4 / 8 } }$ is the same as GAP except the readout layer is replaced by the Local Average Pooling with window size $4 \times 4 / 8 \times 8$ . We consider 4 types of training methods: (1) NTK, i.e. infinite networks (2)NN, our baseline for finite width neural network which is trained with momemtum using a small learning rate and without $L ^ { 2 }$ regularizer and the network is centered $( + \mathsf C )$ to reduce the variance from random initialization $( 3 ) \mathrm { N N + = N N + L R + L 2 - C }$ , i.e. using a larger learning rate $( + \mathsf { L R } )$ , adding $L ^ { 2 }$ regularization $( + \mathsf { L } 2 ) ]$ and removing the centering $( - C )$ (4) $\mathsf { N N + + = N N + + D A }$ , adding MixUp[34] data augmentation $( + \mathsf { D A } )$ to $\mathrm { N N } +$ . Overall, we observe that, for most of the cases in $\mathrm { N T K / N N / N N } +$ , adding spurious symmetry to a system $( \mathcal { D } , \mathcal { M } , \mathcal { Z } )$ degrades the performance towards that of the system invariant to that symmetry. Surprisingly, in the baseline NN, performance of $\mathsf { V E C } _ { n } + \mathsf { O } ( 3 ) \otimes \mathbf { I } _ { d }$ rotation is slightly worse than that of ${ \mathsf { V E C } } _ { n } + \mathbf { O } ( 3 ) ^ { d }$ and than that of $\mathsf { L C N } _ { n }$ , indicating that the system with $\mathcal { M } = \mathsf { V E C } _ { n }$ is likely operating closely on the $\mathrm { O } ( 3 ) ^ { d }$ symmetry. The interventions $- C + \mathsf { L } 2 + \mathsf { L } \mathsf { R }$ in $\mathrm { N N } +$ distinguishes the performance of $\mathsf { V E C } _ { n } + \mathsf { O } ( 3 ) \otimes \mathbf { I } _ { d }$ from ${ \mathsf { V E C } } _ { n } + \mathbf { O } ( 3 ) ^ { d }$ and $+ \mathsf { D } \mathsf { A }$ eventually closes the performance gap between $\mathsf { V E C } _ { n } + \mathsf { O } ( 3 ) \otimes \mathbf { I } _ { d }$ and ${ \mathsf { G A P } } _ { n } + { \mathsf { O } } ( 3 ) \otimes \mathbf { I } _ { d }$ , helping the system to be aware of the smaller symmetry ${ \mathbf { O } } ( 3 ) \otimes { \mathbf { I } } _ { d }$ , escaping from the $\mathrm { O } ( 3 ) ^ { d }$ symmetry.
|
| 270 |
+
|
| 271 |
+
244 Symmetry Breaking of ${ \mathsf { V E C } } _ { n }$ . Assuming Equation 8, namely, the network is in the NTK regime,
|
| 272 |
+
|
| 273 |
+
$$
|
| 274 |
+
\operatorname* { l i m } _ { n \to \infty } | \mathbb { E } \mathsf { V } \mathsf { E } \mathsf { C } _ { n } ( x ) - \mathsf { V } \mathsf { E } \mathsf { C } _ { \infty } ( x ) | + \operatorname* { l i m } _ { n \to \infty } | \mathbb { E } \mathsf { V } \mathsf { E } \mathsf { C } _ { n } ( x ) - \mathbb { E } \mathsf { V } \mathsf { E } \mathsf { C } _ { n } ^ { \tau } ( x ) | \leq C n ^ { - \frac { 1 } { 2 } }
|
| 275 |
+
$$
|
| 276 |
+
|
| 277 |
+
245 where the expectation $\mathbb { E }$ is over random initialization and ${ \mathsf { V E C } } _ { n } ( x )$ is the prediction of the test point
|
| 278 |
+
246 $x$ when $t = \infty$ , i.e. training loss is $0 . \mathsf { V E C } _ { n } ^ { \tau }$ is the prediction of the $\tau$ -rotated system, $\tau \in { \mathrm { O } } ( 3 ) ^ { d }$ .
|
| 279 |
+
247 The $O ( 3 ) ^ { d }$ symmetry is restored as $n \to \infty$ . As such, for large $n$ , the system is approximately $\mathrm { O } ( 3 ) ^ { d }$ -
|
| 280 |
+
248 invariant. We randomly sample $\tau \in { \mathrm { O } } ( 3 ) ^ { d }$ and use the exponential map to construct a continuous
|
| 281 |
+
249 interpolation $\tau _ { t } \in \mathbf { O } ( 3 ) ^ { d }$ with $\tau _ { 0 } = \mathbf { I d }$ and $\tau _ { 1 } = \tau$ . We train the network as in $\Nu \mathrm { N + + } ( + \mathsf { L R } + \mathsf { L } 2 - \mathsf { C } )$
|
| 282 |
+
250 using different $n$ and $\tau _ { t }$ and average the predictions over 10 random initialization as an approximation
|
| 283 |
+
251 of $\bar { \mathbb { E } } \bar { \mathsf { V } } \bar { \mathsf { E } } \mathsf { C } _ { n } ^ { \tau _ { t } } ( x )$ . Not surprisingly, as $n$ increases and/or $t$ increases, (1) test performance decays
|
| 284 |
+
252 monotonically (left panel in Fig.2), (2) the distance to $\mathbb { E } G \mathsf { A P } _ { n }$ increases monotonically (middle
|
| 285 |
+
253 panel) and (3) distance to ${ \mathsf { V E C } } _ { \infty }$ decrease monotonically (right panel). Clearly, the coordinate
|
| 286 |
+
254 information from the data is utilized by smaller width ${ \mathsf { V E C } } _ { n }$ .
|
| 287 |
+
255 DIDE for ${ \mathsf { V E C } } _ { n }$ . To understand the role of data, we vary the training set size of Cifar10 from about
|
| 288 |
+
256 $2 ^ { 6 }$ to $5 0 \mathrm { k }$ (the whole un-augmented training set) and to $1 0 0 \mathrm { k }$ (adding left-right flip augmentation) and
|
| 289 |
+
257 plot the learning curves in Fig.3. We observe dramatic speedup of learning for ${ \mathsf { V E C } } _ { n }$ in the larger
|
| 290 |
+
258 data set regime, which isn’t the case for ${ \mathsf { V E C } } _ { \infty }$ (kernel), $\mathsf { L C N } _ { n }$ , $\mathsf { G A P } _ { \infty }$ and even for ${ \mathsf { G A P } } _ { n }$ after
|
| 291 |
+
259 $m = 2 ^ { 1 2 }$ . We argue that this is due to the prior (the function space defined by the model) is too large
|
| 292 |
+
260 (and not optimal) for the task and the coupled effect of more data together with inference procedures
|
| 293 |
+
261 corrects the prior, as it is suggested by Theorem 2.1.
|
| 294 |
+
|
| 295 |
+

|
| 296 |
+
Figure 3: Data Bends Learning Curve of ${ \mathsf { V E C } } _ { n }$ . We study the effect of training set size to the network’s performance for various models. In the small dataset regime, the slope of the learning curve (in the log-log plot) of ${ \mathsf { V E C } } _ { n }$ is similar to that of $\mathsf { V E C } _ { \infty }$ and $\mathsf { F C N } _ { n }$ . However, as the dataset gets larger, the slope increases significantly. This is hinted by Theorem 2.1.
|
| 297 |
+
Figure 4: With coordinate of the input data rotated by $O ( 3 ) ^ { d }$ , state of the art models learn as good as without rotation. middle/right: slopes of the learning curves increases due to more data. DIDE
|
| 298 |
+
|
| 299 |
+
DIDE for SOTA models. In the middle and right panels of Fig.S2, we provide additional evidence in a larger scale setting. We generate learning curves of ImageNet using ResNet50 and MLP-Mixer, a very recent architecture that contains no convolution layers except the first layer, which is a convolution with filter size and stride equal to (16, 16) (patches are disjoint). The symmetry group associated to ResNet is similar to that of ${ \mathsf { G A P } } _ { n }$ which is relatively small. However, the symmetry group induced by the first layer of the Mixer is $\mathbf { O } ( 3 \times 1 6 ^ { 2 } ) \otimes \mathbf { I } _ { 1 4 ^ { 2 } }$ , where $\mathrm { 3 \times 1 6 ^ { 2 } }$ is number of entries in the $( 1 6 , 1 6 , 3 )$ patch (RGB channels) and $1 4 ^ { 2 } = 2 2 4 ^ { 2 } / 1 6 ^ { 2 }$ is the number of patches. Although the dimension of ${ \mathrm { O } } ( 3 \times 1 6 ^ { 2 } ) \otimes { \mathbf { I } } _ { 1 4 ^ { 2 } }$ is quite large (about $( 3 \times 1 6 ^ { 2 } ) ^ { 2 } / 2 $ ), it is still dramatically smaller than that of applying a fully-connected layer to the flatten images, which ${ \mathrm { O } } ( 3 \times 2 2 4 ^ { 2 } )$ (about $( 3 \times 2 2 4 ^ { 2 } ) ^ { 2 } / 2 )$ . In the middle panel of Fig.S2, we observe an almost perfect power-law scaling for the learning curve for the ResNet50 system with unrotated images. When the images are rotated by $O ( 3 ) ^ { d }$ $( d \bar { = } 2 2 4 ^ { 2 }$ ), the learning curve is relatively flat in the smaller data regime (green dashed line). However, the data set grows, it eventually catches up (purple dashed line) as that of the unrotated setting; see Sec.E for ResNet34/101. In the third panel, we see the learning curves are much flatter (red) for the Mixer and even more so for the rotated images (green). Again, these curves are bent towards that of ResNet50 with unrorated images as data increases, indicating the prior was being corrected.
|
| 300 |
+
|
| 301 |
+
Finally, in the left panel of Fig.S2, we compare the accuracy of state-of-the-art models trained on both unrotated and $O ( 3 { \bar { ) } } ^ { d }$ rotated images. Surprisingly, the gap between the two are not large and becomes smaller for better performant models. For EfficientNet B7 1, the top-1 accuracy of the rotated system is only $1 . 2 \%$ off from the unroated one.
|
| 302 |
+
|
| 303 |
+
# 4 Eigenecomposition of Neural Kernels
|
| 304 |
+
|
| 305 |
+
To get insights into the inductive biases, we eigendecompose the kernels using spherical harmonics. We assume the input space ${ \mathcal { X } } \ = \ \{ \xi \ = \ ( \xi _ { 0 } , \ldots , \cdot \xi _ { p - 1 } ) \in \ ( { \sqrt { d _ { 0 } } } \mathbb { S } ^ { ( d _ { 0 } - { \bar { 1 } } ) } ) ^ { p } \} \ \subseteq \ \mathbb { R } ^ { d _ { 0 } p } ,$ , i.e.
|
| 306 |
+
|
| 307 |
+
286 the $p$ -product of $( d _ { 0 } - 1 )$ -sphere with radius $\sqrt { d _ { 0 } }$ . We call $\xi _ { i } \in \sqrt { d _ { 0 } } \mathbb { S } ^ { ( d _ { 0 } - 1 ) }$ a mini-patch and
|
| 308 |
+
287 $( \xi _ { i } , \xi _ { i + 1 } , \ldots , \xi _ { i + s - 1 } ) \in ( \sqrt { d _ { 0 } } \mathbb { S } ^ { ( d _ { 0 } - 1 ) } ) ^ { s } \}$ a patch for $i \in [ p ]$ , where circular boundary condition is
|
| 309 |
+
288 assumed. We consider the asymptotic limit when $d _ { 0 } = \bar { d ^ { \alpha } } \bar { , } p = d ^ { 1 - \alpha }$ and $d = p d _ { 0 } \infty$ and treat
|
| 310 |
+
289 $0 \textless \alpha \textless 1$ and $s$ as fixed constant. The input space $\mathcal { X }$ is associated with the product measure√
|
| 311 |
+
290 $\mu \equiv \sigma _ { d _ { 0 } } ^ { p }$ , where $\sigma _ { d _ { 0 } }$ is the normalized uniform measure on $\sqrt { d _ { 0 } } \mathbb { S } ^ { ( d _ { 0 } - 1 ) }$ . The kernels associated to
|
| 312 |
+
291 the one-hidden layer infinite networks (either NNGP or NTK) has the following general forms
|
| 313 |
+
|
| 314 |
+
$$
|
| 315 |
+
k \left( \frac { 1 } { p } \sum _ { i \in [ p ] } \xi _ { i } ^ { T } \eta _ { i } / d _ { 0 } \right) \quad \frac { 1 } { p } \sum _ { i \in [ p ] } k \left( \frac { 1 } { s } \sum _ { b \in [ s ] } \xi _ { i + b } ^ { T } \eta _ { i + b } / d _ { 0 } \right) \quad \frac { 1 } { p ^ { 2 } } \sum _ { i , j \in [ p ] } k \left( \frac { 1 } { s } \sum _ { b \in [ s ] } \xi _ { i + b } ^ { T } \eta _ { j + b } / d _ { 0 } \right) ,
|
| 316 |
+
$$
|
| 317 |
+
|
| 318 |
+
292 although that exact form of the (positive definite) kernel function $k : \mathbb { R } \mathbb { R }$ depends on the kernel
|
| 319 |
+
293 types (NNGP vs NTK), activations, hyperparameters and etc. We assume the kernel is sufficiently
|
| 320 |
+
294 smooth in $( - 1 , 1 )$ and the Tayor expansion of $k ^ { ( r ) }$ converges uniformly in $[ - 1 , 1 ]$ for sufficiently
|
| 321 |
+
295 many $r \in \mathbb N$ . We use the notation that $A \sim B$ if there are positive constants $c$ and $C$ such that
|
| 322 |
+
296 $c A \leq B \leq C A$ for $d$ sufficiently large. We use $\kappa$ to represent any kernels above and consider it as a
|
| 323 |
+
297 Hilbert–Schmidt operator on $L ^ { \tilde { 2 } } ( \chi , \breve { \mu } )$
|
| 324 |
+
|
| 325 |
+
$$
|
| 326 |
+
\mathcal K f ( \xi ) = \int _ { \mathcal K } { \mathcal K } ( \xi , \eta ) f ( \eta ) d \mu , \quad f \in L ^ { 2 } ( \mathcal { X } , \mu ) ,
|
| 327 |
+
$$
|
| 328 |
+
|
| 329 |
+
which is well-defined since 298 $\mu$ is a probability measure and $k$ is bounded. Let $\vec { r } = ( r _ { 0 } , \ldots , r _ { p - 1 } ) \in \mathbb { N } ^ { p }$ , 299 $\tau$ the shifting operator $\tau \vec { r } = \left( r _ { p - 1 } , r _ { 0 } , \ldots , r _ { p - 2 } \right)$ . The $s$ -banded subset of $\mathbb { N } ^ { p }$ is defined to be
|
| 330 |
+
|
| 331 |
+
$$
|
| 332 |
+
B ( \mathbb { N } ^ { p } , s ) = \{ { \vec { r } } \in \mathbb { N } ^ { p } : \operatorname { d i s t } ( \operatorname { a r g m a x } _ { j } r _ { j } \neq 0 , \operatorname { a r g m i n } _ { j } r _ { j } \neq 0 ) \leq s - 1 \}
|
| 333 |
+
$$
|
| 334 |
+
|
| 335 |
+
300 which is a quantifier used to restrict the support of a function on a patch. Here $\mathrm { d i s t } ( i , j ) = \operatorname* { m i n } \{ | i -$
|
| 336 |
+
301 $j | , p - | i - \bar { j } | \}$ , a distance defined on the cyclic group $[ p ] = \mathbb { Z } / p \bar { \mathbb { Z } }$ . The quotient space $B ( \mathbb { N } ^ { p } , s ) / \tau$
|
| 337 |
+
302 denotes a subset of $B ( \mathbb { N } ^ { p } , s )$ by identifying $\vec { v } = \vec { v } ^ { \prime }$ as the same element if ${ \vec { v } } = \tau ^ { a } { \vec { r } } ^ { \prime }$ for some $a \in [ p ]$
|
| 338 |
+
303 Finally, $Y _ { r _ { j } , l _ { j } } ( \xi _ { j } )$ is used to denote the $l _ { j }$ -th spherical harmonic of degree $r _ { j }$ in the unit sphere
|
| 339 |
+
304 $\mathbb { S } ^ { ( d _ { 0 } - 1 ) }$ and has unit norm under the normalized measure on $\mathbb { S } ^ { ( d _ { 0 } - 1 ) }$ . As such $Y _ { r _ { j } , l _ { j } } ( \xi _ { j } / \sqrt { d _ { 0 } } ) \in$
|
| 340 |
+
305 $L ^ { 2 } ( \sqrt { d _ { 0 } } \mathbb { S } ^ { ( d _ { 0 } - 1 ) } , \sigma _ { d _ { 0 } } )$ has unit norm. Recall that the total number of spherical harmonic of degree
|
| 341 |
+
306 $r _ { j }$ in $\mathbb { S } ^ { ( d _ { 0 } - 1 ) }$ is $\begin{array} { r } { N ( \bar { d } _ { 0 } , r _ { j } ) = ( 2 r _ { j } + d _ { 0 } - 2 ) \binom { d _ { 0 } + r _ { j } - 3 } { r _ { j } - 1 } \sim d _ { 0 } ^ { r _ { j } } / r _ { j } ! } \end{array}$ as $d _ { 0 } \to \infty$ . We use $N ( d _ { 0 } , \vec { r } ) =$
|
| 342 |
+
307 $\textstyle \prod _ { j \in [ p ] } N ( d _ { 0 } , r _ { j } )$ and $\begin{array} { r } { [ N ( d _ { 0 } , \vec { r } ) ] = \prod _ { j \in [ p ] } [ N ( \vec { d _ { 0 } } , r _ { j } ) ] } \end{array}$ , resp. Let
|
| 343 |
+
|
| 344 |
+
$$
|
| 345 |
+
\vec { Y } _ { \vec { r } , \vec { l } } ( \xi ) = \prod _ { j \in [ p ] } Y _ { r _ { j } , l _ { j } } ( \xi _ { j } )
|
| 346 |
+
$$
|
| 347 |
+
|
| 348 |
+
308 The following theorem shows that locality $\mathrm { ( V E C _ { \infty , } }$ ) dramatically reduces both the dimensions of
|
| 349 |
+
309 Eigendecomposition $r \geq 1$ eigenspaces and the spectral gap between them. In addition, pooling
|
| 350 |
+
310 (i.e. translation symmetry of $\mathsf { G A P } _ { n } \mathrm { ~ . ~ }$ ) reduces their dimensions by a factor of $p$ . See Sec.E for the
|
| 351 |
+
311 implication of this theorem to learning.
|
| 352 |
+
|
| 353 |
+
312 Theorem 4.1. [Sec.D] We have the following eigendecomposition for the integral operator $\kappa$
|
| 354 |
+
|
| 355 |
+
$$
|
| 356 |
+
\mathsf { H } = \bigcup _ { r \in \mathbb { N } } \mathsf { H } ^ { ( r ) } = \bigcup _ { r \in \mathbb { N } } \bigcup _ { \vec { r } \in Q ( \mathcal { K } , r ) } \mathsf { H } ^ { ( \vec { r } ) } ,
|
| 357 |
+
$$
|
| 358 |
+
|
| 359 |
+
where 313 $Q ( K , r )$ is a quantifier defined below. If ${ \mathfrak { r } } = 0 , \mathsf { H } ^ { ( 0 ) }$ is the space of constant functions and the 314 eigenvalue is $\sim k ( 0 )$ . For $r \geq 1$ ,
|
| 360 |
+
|
| 361 |
+
315
|
| 362 |
+
|
| 363 |
+
1. $i f \mathcal { K } = \mathcal { K } _ { \sf F C N }$ , then $Q ( \mathcal { K } , r ) = \{ \vec { r } \in \mathbb { N } ^ { p } : | \vec { r } | = r \}$ and the unit eigenfunctions are
|
| 364 |
+
|
| 365 |
+
$$
|
| 366 |
+
\{ \mathsf { H } ^ { ( \vec { r } ) } = \mathrm { s p a n } \{ Y _ { \vec { r } , \vec { l } } \} _ { \vec { l } \in [ B ( d _ { 0 } , \vec { r } ) ] }
|
| 367 |
+
$$
|
| 368 |
+
|
| 369 |
+
316
|
| 370 |
+
|
| 371 |
+
2. $i f K = \mathcal { K } _ { \mathsf { V E C } }$ , ${ \cal Q } ( { \cal K } , r ) = \{ \vec { r } \in { \cal B } ( \mathbb { N } ^ { p } , s ) : | \vec { r } | = r \}$ the unit eigenfunctions are
|
| 372 |
+
|
| 373 |
+
$$
|
| 374 |
+
\left\{ \begin{array} { l l } { { \displaystyle { \sf H } _ { \sf V E C } ^ { ( \vec { r } ) } = \mathrm { s p a n } \left\{ Y _ { \vec { r } , \vec { l } } \right\} _ { \vec { l } \in [ B ( d _ { 0 } , \vec { r } ) ] } } _ { a \mathrm { r } } } \\ { { \mathrm { d i m } ( { \sf H } _ { \sf V E C } ^ { ( \vec { r } ) } ) \sim p ( s d _ { 0 } ) ^ { r } = s ^ { r } d ^ { 1 - \alpha + r \alpha } } } & { { a n d \quad \lambda ( { \sf H } _ { \sf V E C } ^ { ( \vec { r } ) } ) \sim p ^ { - 1 } ( s d _ { 0 } ) ^ { - r } \delta ( k ^ { ( r ) } ( { 0 } ) ) } } \end{array} \right.
|
| 375 |
+
$$
|
| 376 |
+
|
| 377 |
+

|
| 378 |
+
Figure 5: Eigenvalue Decay of Relu NTK of $\mathsf { F C N } _ { \infty }$ , ${ \mathsf { V E C } } _ { \infty }$ and $\mathsf { G A P } _ { \infty }$ . $d _ { 0 } = s = 3$ . The eigenvalues of $\mathsf { G A P } _ { \infty }$ decays faster because with $m = 1 5 k$ many samples, higher order eigenspace can be covered by $\mathsf { G A P } _ { \infty }$ but not $\mathsf { F C N } _ { \infty } / \mathsf { V E C } _ { \infty }$ due to Theorem 4.1.
|
| 379 |
+
|
| 380 |
+
317
|
| 381 |
+
318
|
| 382 |
+
|
| 383 |
+
3. and finally, $i f K = \mathcal { K } _ { \mathsf { G A P } }$ , then $Q ( \mathcal { K } , r ) = \{ \vec { r } \in B ( \mathbb { N } ^ { p } , s ) / \tau : | \vec { r } | = r \}$ , the unit eigenfunctions are
|
| 384 |
+
|
| 385 |
+
$$
|
| 386 |
+
\left\{ \begin{array} { l } { { \sf H } _ { \sf G A P } ^ { ( \vec { r } ) } = \mathrm { s p a n } \left\{ \frac { 1 } { \sqrt { p } } \sum _ { \tau \in [ p ] } Y _ { \vec { r } , \vec { l } } ( \tau \xi ) \right\} _ { \vec { l } \in [ B ( d _ { 0 } , \vec { r } ) ] } } \\ { \dim ( { \sf H } _ { \sf G A P } ^ { ( r ) } ) \sim ( s d _ { 0 } ) ^ { r } = s ^ { r } d ^ { r \alpha } \quad a n d \quad \lambda ( { \sf H } _ { \sf G A P } ^ { ( \vec { r } ) } ) \sim p ^ { - 1 } ( s d _ { 0 } ) ^ { - r } \delta ( k ^ { ( r ) } ( 0 ) ) } \end{array} \right.
|
| 387 |
+
$$
|
| 388 |
+
|
| 389 |
+
# 319 5 Related Work
|
| 390 |
+
|
| 391 |
+
The study of infinite networks dates back to seminal work by Neal [8] who showed the convergence of single hidden-layer networks to Gaussian Processes (GPs). Recently, there has been renewed interest in studying random, infinite, networks starting with concurrent work on “conjugate kernels” [10, 35] and “mean-field theory” [9, 36], taking a statistical learning and statistical physics view of points, resp. Since then this analysis has been extended to include a wide range for architectures [20, 21, 37, 29, 26, 38]. The inducing kernel is often referred to as the Neural Network Gaussian Process (NNGP) kernel. The neural tangent kernel (NTK), first introduced in Jacot et al. [22], along with followup work [12, 39] showed that the distribution of functions induced by gradient descent for infinite-width networks is a Gaussian Process with NTK as the kernel.
|
| 392 |
+
|
| 393 |
+
329 The study of implicit bias (regularization) of gradient descent has received considerable interests.
|
| 394 |
+
330 The work [15, 40–43] demonstrate the convergence of SGD to the maximal margin solution for
|
| 395 |
+
331 logistic-type of losses during late time training. [44–50] study the early-time SGD dynamics, spectral
|
| 396 |
+
332 biases of neural networks. These results aim to explain the order of learning of neural networks:
|
| 397 |
+
333 functions of less complexity are usually learned before more complex functions.
|
| 398 |
+
334 [27] is the first to show that the prediction functions obtained from training FCN depend, in addition
|
| 399 |
+
335 on the labels, only on the covariance of the input data. This implies our result regarding the ${ \mathrm { O } } ( 3 d )$
|
| 400 |
+
336 invariance of FCN. By utilizing this symmetry, recent work [51] constructs a particular task where
|
| 401 |
+
337 the label function is a second order polynomial of the inputs and show that orthogonal invariance
|
| 402 |
+
338 algorithm requires sample size of order $\dot { d } ^ { 2 }$ while there is a convnet requires only $O ( 1 )$ samples. Their
|
| 403 |
+
339 convnet essentially corresponds to the $d _ { 0 } = s = 1$ and $r = 2$ case of Theorem 4.1, in which the
|
| 404 |
+
340 dimension of this eigenspace (and indeed of all $r$ -eigenspace by treating $r$ as a finite constant as
|
| 405 |
+
341 $d \to \infty$ ) of $\mathsf { G A P } _ { \infty }$ is $O ( \bar { 1 } )$ while the dimension of the 2-eigenspace of $\mathsf { F C N } _ { \infty }$ is of order $d ^ { 2 }$ .
|
| 406 |
+
|
| 407 |
+
# 342 6 Conclusion
|
| 408 |
+
|
| 409 |
+
43 In this paper, we consider machine learning methods as an integrated system of data, models and
|
| 410 |
+
44 inference algorithms and study the basic symmetries of various machine learning systems. We surface
|
| 411 |
+
45 the importance of locality in modern machine learning systems through large scale empirical study
|
| 412 |
+
46 and through an eigendecomposition of one-layer infinite networks. However, we haven’t addressed
|
| 413 |
+
47 the two import questions (1) theoretical characterization of the effect of composing locality and (2)
|
| 414 |
+
48 the mathematical understanding of DIDE and how the prior is corrected by the coupled effect of data
|
| 415 |
+
49 and gradient descent. We leave them to future work.
|
| 416 |
+
|
| 417 |
+
The checklist follows the references. Please read the checklist guidelines carefully for information on how to answer these questions. For each question, change the default [TODO] to [Yes] , [No] , or [N/A] . You are strongly encouraged to include a justification to your answer, either by referencing the appropriate section of your paper or providing a brief inline description. For example:
|
| 418 |
+
|
| 419 |
+
• Did you include the license to the code and datasets? [Yes] See Section ??.
|
| 420 |
+
• Did you include the license to the code and datasets? [No] The code and the data are proprietary.
|
| 421 |
+
• Did you include the license to the code and datasets? [N/A]
|
| 422 |
+
|
| 423 |
+
Please do not modify the questions and only use the provided macros for your answers. Note that the Checklist section does not count towards the page limit. In your paper, please delete this instructions block and only keep the Checklist section heading above along with the questions/answers below.
|
| 424 |
+
|
| 425 |
+
1. For all authors...
|
| 426 |
+
|
| 427 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 428 |
+
(b) Did you describe the limitations of your work? [Yes]
|
| 429 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A]
|
| 430 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 431 |
+
|
| 432 |
+
2. If you are including theoretical results...
|
| 433 |
+
|
| 434 |
+
(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]
|
| 435 |
+
|
| 436 |
+
3. If you ran experiments...
|
| 437 |
+
|
| 438 |
+
(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)? [No]
|
| 439 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [No]
|
| 440 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes]
|
| 441 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [No]
|
| 442 |
+
|
| 443 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 444 |
+
|
| 445 |
+
(a) If your work uses existing assets, did you cite the creators? [TODO]
|
| 446 |
+
(b) Did you mention the license of the assets? [TODO]
|
| 447 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [TODO]
|
| 448 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [TODO]
|
| 449 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [TODO]
|
| 450 |
+
|
| 451 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 452 |
+
|
| 453 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [TODO]
|
| 454 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [TODO]
|
| 455 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [TODO]
|
| 456 |
+
References
|
| 457 |
+
[1] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pages 1097–1105, 2012.
|
| 458 |
+
[2] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017.
|
| 459 |
+
[3] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
|
| 460 |
+
[4] David Silver, Aja Huang, Chris J Maddison, Arthur Guez, Laurent Sifre, George Van Den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, et al. Mastering the game of go with deep neural networks and tree search. Nature, 529(7587):484–489, 2016.
|
| 461 |
+
[5] Andrew W Senior, Richard Evans, John Jumper, James Kirkpatrick, Laurent Sifre, Tim Green, Chongli Qin, Augustin Žídek, Alexander WR Nelson, Alex Bridgland, et al. Improved protein structure prediction using potentials from deep learning. Nature, 577(7792):706–710, 2020.
|
| 462 |
+
[6] Jared Kaplan, Sam McCandlish, Tom Henighan, Tom B Brown, Benjamin Chess, Rewon Child, Scott Gray, Alec Radford, Jeffrey Wu, and Dario Amodei. Scaling laws for neural language models. arXiv preprint arXiv:2001.08361, 2020.
|
| 463 |
+
[7] Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
|
| 464 |
+
[8] Radford M. Neal. Priors for infinite networks (tech. rep. no. crg-tr-94-1). University of Toronto, 1994.
|
| 465 |
+
[9] Ben Poole, Subhaneil Lahiri, Maithra Raghu, Jascha Sohl-Dickstein, and Surya Ganguli. Exponential expressivity in deep neural networks through transient chaos. In Advances In Neural Information Processing Systems, 2016.
|
| 466 |
+
[10] Amit Daniely, Roy Frostig, and Yoram Singer. Toward deeper understanding of neural networks: The power of initialization and a dual view on expressivity. In Advances In Neural Information Processing Systems, 2016.
|
| 467 |
+
[11] Arthur Jacot, Franck Gabriel, and Clément Hongler. Neural tangent kernel: Convergence and generalization in neural networks. arXiv preprint arXiv:1806.07572, 2018.
|
| 468 |
+
[12] Jaehoon Lee, Lechao Xiao, Samuel S. Schoenholz, Yasaman Bahri, Roman Novak, Jascha Sohl-Dickstein, and Jeffrey Pennington. Wide neural networks of any depth evolve as linear models under gradient descent. In Advances in Neural Information Processing Systems, 2019.
|
| 469 |
+
[13] Behnam Neyshabur. Implicit regularization in deep learning. arXiv preprint arXiv:1709.01953, 2017.
|
| 470 |
+
[14] Suriya Gunasekar, Jason Lee, Daniel Soudry, and Nathan Srebro. Implicit bias of gradient descent on linear convolutional networks. arXiv preprint arXiv:1806.00468, 2018.
|
| 471 |
+
[15] Daniel Soudry, Elad Hoffer, Mor Shpigel Nacson, Suriya Gunasekar, and Nathan Srebro. The implicit bias of gradient descent on separable data, 2018.
|
| 472 |
+
[16] Mingxing Tan and Quoc Le. Efficientnet: Rethinking model scaling for convolutional neural networks. In International Conference on Machine Learning, pages 6105–6114. PMLR, 2019.
|
| 473 |
+
[17] Alex J Smola, Zoltan L Ovari, Robert C Williamson, et al. Regularization with dot-product kernels. Advances in neural information processing systems, pages 308–314, 2001.
|
| 474 |
+
[18] Kunihiko Fukushima. Cognitron: A self-organizing multilayered neural network. Biological cybernetics, 20(3-4):121–136, 1975.
|
| 475 |
+
[19] Yann Lecun. Generalization and network design strategies. In Connectionism in perspective. Elsevier, 1989.
|
| 476 |
+
[20] Jaehoon Lee, Yasaman Bahri, Roman Novak, Sam Schoenholz, Jeffrey Pennington, and Jascha Sohldickstein. Deep neural networks as gaussian processes. In International Conference on Learning Representations, 2018.
|
| 477 |
+
[21] Alexander G. de G. Matthews, Jiri Hron, Mark Rowland, Richard E. Turner, and Zoubin Ghahramani. Gaussian process behaviour in wide deep neural networks. In International Conference on Learning Representations, 2018.
|
| 478 |
+
[22] Arthur Jacot, Franck Gabriel, and Clement Hongler. Neural tangent kernel: Convergence and generalization in neural networks. In Advances in Neural Information Processing Systems, 2018.
|
| 479 |
+
[23] Simon S Du, Jason D Lee, Haochuan Li, Liwei Wang, and Xiyu Zhai. Gradient descent finds global minima of deep neural networks. arXiv preprint arXiv:1811.03804, 2018.
|
| 480 |
+
[24] Zeyuan Allen-Zhu, Yuanzhi Li, and Zhao Song. A convergence theory for deep learning via overparameterization. In International Conference on Machine Learning, 2018.
|
| 481 |
+
[25] Difan Zou, Yuan Cao, Dongruo Zhou, and Quanquan Gu. Gradient descent optimizes over-parameterized deep relu networks. Machine Learning, 109(3):467–492, 2020.
|
| 482 |
+
[26] Greg Yang. Scaling limits of wide neural networks with weight sharing: Gaussian process behavior, gradient independence, and neural tangent kernel derivation. arXiv preprint arXiv:1902.04760, 2019.
|
| 483 |
+
[27] Neha S. Wadia, Daniel Duckworth, Samuel S. Schoenholz, Ethan Dyer, and Jascha Sohl-Dickstein. Whitening and second order optimization both destroy information about the dataset, and can make generalization impossible. arxiv preprint arXiv:2008.07545, 2020.
|
| 484 |
+
[28] Lechao Xiao, Yasaman Bahri, Jascha Sohl-Dickstein, Samuel Schoenholz, and Jeffrey Pennington. Dynamical isometry and a mean field theory of cnns: How to train 10,000-layer vanilla convolutional neural networks. In International Conference on Machine Learning, pages 5393–5402, 2018.
|
| 485 |
+
[29] Roman Novak, Lechao Xiao, Jaehoon Lee, Yasaman Bahri, Greg Yang, Jiri Hron, Daniel A. Abolafia, Jeffrey Pennington, and Jascha Sohl-Dickstein. Bayesian deep convolutional networks with many channels are gaussian processes. In International Conference on Learning Representations, 2019.
|
| 486 |
+
[30] Adrià Garriga-Alonso, Laurence Aitchison, and Carl Edward Rasmussen. Deep convolutional networks as shallow gaussian processes. In International Conference on Learning Representations, 2019.
|
| 487 |
+
[31] Roman Novak, Lechao Xiao, Jiri Hron, Jaehoon Lee, Alexander A Alemi, Jascha Sohl-Dickstein, and Samuel S Schoenholz. Neural tangents: Fast and easy infinite neural networks in python. arXiv preprint arXiv:1912.02803, 2019.
|
| 488 |
+
[32] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Conference on Computer Vision and Pattern Recognition, pages 770–778, 2016.
|
| 489 |
+
[33] Ilya Tolstikhin, Neil Houlsby, Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Thomas Unterthiner, Jessica Yung, Daniel Keysers, Jakob Uszkoreit, Mario Lucic, et al. Mlp-mixer: An all-mlp architecture for vision. arXiv preprint arXiv:2105.01601, 2021.
|
| 490 |
+
[34] Hongyi Zhang, Moustapha Cisse, Yann N. Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In International Conference on Learning Representations, 2018. URL https:// openreview.net/forum?id=r1Ddp1-Rb.
|
| 491 |
+
[35] Amit Daniely. SGD learns the conjugate kernel class of the network. In Advances in Neural Information Processing Systems 30. 2017.
|
| 492 |
+
[36] Samuel S Schoenholz, Justin Gilmer, Surya Ganguli, and Jascha Sohl-Dickstein. Deep information propagation. International Conference on Learning Representations, 2017.
|
| 493 |
+
[37] Lechao Xiao, Yasaman Bahri, Jascha Sohl-Dickstein, Samuel Schoenholz, and Jeffrey Pennington. Dynamical isometry and a mean field theory of CNNs: How to train 10,000-layer vanilla convolutional neural networks. In International Conference on Machine Learning, 2018.
|
| 494 |
+
[38] Jiri Hron, Yasaman Bahri, Jascha Sohl-Dickstein, and Roman Novak. Infinite attention: Nngp and ntk for deep attention networks, 2020.
|
| 495 |
+
[39] Lenaic Chizat, Edouard Oyallon, and Francis Bach. On lazy training in differentiable programming. In Advances in Neural Information Processing Systems, pages 2937–2947, 2019.
|
| 496 |
+
[40] Kaifeng Lyu and Jian Li. Gradient descent maximizes the margin of homogeneous neural networks. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum? id=SJeLIgBKPS.
|
| 497 |
+
[41] Ziwei Ji and Matus Telgarsky. The implicit bias of gradient descent on nonseparable data. In Conference on Learning Theory, pages 1772–1798, 2019.
|
| 498 |
+
[42] Ziwei Ji and Matus Jan Telgarsky. Gradient descent aligns the layers of deep linear networks. In 7th International Conference on Learning Representations, ICLR 2019, 2019.
|
| 499 |
+
|
| 500 |
+
96 [43] Lénaïc Chizat and Francis Bach. Implicit bias of gradient descent for wide two-layer neural networks
|
| 501 |
+
497 trained with the logistic loss. In Jacob Abernethy and Shivani Agarwal, editors, Proceedings of Thirty
|
| 502 |
+
498 Third Conference on Learning Theory, volume 125 of Proceedings of Machine Learning Research, pages
|
| 503 |
+
499 1305–1338. PMLR, 09–12 Jul 2020. URL http://proceedings.mlr.press/v125/chizat20a.html.
|
| 504 |
+
500 [44] Preetum Nakkiran, Gal Kaplun, Dimitris Kalimeris, Tristan Yang, Benjamin L Edelman, Fred Zhang,
|
| 505 |
+
501 and Boaz Barak. Sgd on neural networks learns functions of increasing complexity. arXiv preprint
|
| 506 |
+
502 arXiv:1905.11604, 2019.
|
| 507 |
+
503 [45] Wei Hu, Lechao Xiao, Ben Adlam, and Jeffrey Pennington. The surprising simplicity of the early-time
|
| 508 |
+
504 learning dynamics of neural networks. arXiv preprint arXiv:2006.14599, 2020.
|
| 509 |
+
505 [46] Nasim Rahaman, Aristide Baratin, Devansh Arpit, Felix Draxler, Min Lin, Fred Hamprecht, Yoshua
|
| 510 |
+
506 Bengio, and Aaron Courville. On the spectral bias of neural networks. In International Conference on
|
| 511 |
+
507 Machine Learning, pages 5301–5310. PMLR, 2019.
|
| 512 |
+
508 [47] Zhiqin John Xu. Understanding training and generalization in deep learning by fourier analysis. arXiv
|
| 513 |
+
509 preprint arXiv:1808.04295, 2018.
|
| 514 |
+
510 [48] Zhi-Qin John Xu, Yaoyu Zhang, Tao Luo, Yanyang Xiao, and Zheng Ma. Frequency principle: Fourier
|
| 515 |
+
511 analysis sheds light on deep neural networks. arXiv preprint arXiv:1901.06523, 2019.
|
| 516 |
+
12 [49] Lili Su and Pengkun Yang. On learning over-parameterized neural networks: A functional approximation
|
| 517 |
+
513 perspective. arXiv preprint arXiv:1905.10826, 2019.
|
| 518 |
+
14 [50] Greg Yang and Hadi Salman. A fine-grained spectral perspective on neural networks. arXiv preprint
|
| 519 |
+
515 arXiv:1907.10599, 2019.
|
| 520 |
+
516 [51] Zhiyuan Li, Yi Zhang, and Sanjeev Arora. Why are convolutional nets more sample-efficient than
|
| 521 |
+
517 fully-connected nets? arXiv preprint arXiv:2010.08515, 2020.
|
md/train/Kloou2uk_Rz/Kloou2uk_Rz.md
ADDED
|
@@ -0,0 +1,473 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# A Large Batch Optimizer Reality Check: Traditional, Generic Optimizers Suffice Across Batch Sizes
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
1 Recently the LARS and LAMB optimizers have been proposed for training neural
|
| 11 |
+
2 networks faster using large batch sizes. LARS and LAMB add layer-wise normal
|
| 12 |
+
3 ization to the update rules of Heavy-ball momentum and Adam, respectively, and
|
| 13 |
+
4 have become popular in prominent benchmarks and deep learning libraries. How
|
| 14 |
+
5 ever, without fair comparisons to standard optimizers, it remains an open question
|
| 15 |
+
6 whether LARS and LAMB have any benefit over traditional, generic algorithms. In
|
| 16 |
+
7 this work we demonstrate that standard optimization algorithms such as Nesterov
|
| 17 |
+
8 momentum and Adam can match or exceed the results of LARS and LAMB at large
|
| 18 |
+
9 batch sizes. Our results establish new, stronger baselines for future comparisons
|
| 19 |
+
10 at these batch sizes and shed light on the difficulties of comparing optimizers for
|
| 20 |
+
11 neural network training more generally.
|
| 21 |
+
|
| 22 |
+
# 12 1 Introduction
|
| 23 |
+
|
| 24 |
+
13 In recent years, hardware systems employing GPUs and TPUs have enabled neural network training
|
| 25 |
+
14 programs to process dramatically more data in parallel than ever before. The most popular way to
|
| 26 |
+
15 exploit these systems is to increase the batch size in the optimization algorithm (i.e. the number
|
| 27 |
+
16 of training examples processed per training step). On many workloads, modern systems can scale
|
| 28 |
+
17 to larger batch sizes without significantly increasing the time per step [Jouppi et al., 2017, Wang
|
| 29 |
+
18 et al., 2019], thus proportionally increasing the number of training examples processed per second.
|
| 30 |
+
19 If researchers can use this increased throughput to reduce the time required to train each neural
|
| 31 |
+
20 network, then they should achieve better results by training larger models, using larger datasets, and
|
| 32 |
+
21 by exploring new ideas more rapidly.
|
| 33 |
+
22 As the capacity for data parallelism continues to increase, practitioners can take their existing,
|
| 34 |
+
23 well-tuned training configurations and re-train with larger batch sizes, hoping to achieve the same
|
| 35 |
+
24 performance in less training time [e.g. Ying et al., 2018]. On an idealized data-parallel system with
|
| 36 |
+
25 negligible overhead from increasing the batch size, they might hope to achieve perfect scaling, a
|
| 37 |
+
26 proportional reduction in training time as the batch size increases.
|
| 38 |
+
|
| 39 |
+
However, achieving perfect scaling is not always straightforward. Changing the batch size changes the training dynamics, requiring the training hyperparameters (e.g. learning rate) to be carefully re-tuned in order to maintain the same level of validation performance.1 In addition, smaller batch sizes provide implicit regularization from gradient noise that may need to be replaced by other forms of regularization when the batch size is increased. Finally, even with perfect tuning, increasing
|
| 40 |
+
|
| 41 |
+
32 the batch size eventually produces diminishing returns. After a critical batch size, the number of
|
| 42 |
+
33 training steps cannot be decreased in proportion to the batch size – the number of epochs must
|
| 43 |
+
34 increase to match the validation performance of the smaller batch size. See Shallue et al. 2019 for a
|
| 44 |
+
35 survey of the effects of data parallelism on neural network training. Once these effects are taken into
|
| 45 |
+
36 account, there is no strong evidence that increasing the batch size degrades the maximum achievable
|
| 46 |
+
37 performance on any workload. At the same time, the ever-increasing capacity for data parallelism
|
| 47 |
+
38 presents opportunities for new regularization techniques that can replace the gradient noise of smaller
|
| 48 |
+
39 batch sizes and new optimization algorithms that can extend perfect scaling to larger batch sizes by
|
| 49 |
+
40 using more sophisticated gradient information [Zhang et al., 2019].
|
| 50 |
+
41 You et al. [2017] proposed the LARS optimization algorithm in the hope of speeding up neural
|
| 51 |
+
42 network training by exploiting larger batch sizes. LARS is a variant of stochastic gradient descent
|
| 52 |
+
43 (SGD) with momentum [Polyak, 1964] that applies layer-wise normalization before applying each
|
| 53 |
+
44 gradient update. Although it is difficult to draw strong conclusions from the results presented in the
|
| 54 |
+
45 LARS paper, 2 the MLPerf3 Training benchmark4 adopted LARS as one of two allowed algorithms
|
| 55 |
+
46 in the closed division for ResNet-50 on ImageNet and it became the de facto standard algorithm for
|
| 56 |
+
47 that benchmark task. With MLPerf entrants competing to find the fastest-training hyperparameters
|
| 57 |
+
48 for LARS, the first place submissions in the two most recent MLPerf Training competitions used
|
| 58 |
+
49 LARS to achieve record training speeds with batch sizes of 32,678 and 65,536, respectively. No
|
| 59 |
+
50 publications or competitive submissions to MLPerf have attempted to match these results with a
|
| 60 |
+
51 standard optimizer (e.g. Momentum or Adam). However, MLPerf entrants do not have a strong
|
| 61 |
+
52 incentive (nor are necessarily permitted by the rules) to explore other algorithms because MLPerf
|
| 62 |
+
53 Training is a systems benchmark that requires algorithmic equivalence between submissions to make
|
| 63 |
+
54 fair comparisons. Moreover, since the main justification for LARS is its excellent performance on
|
| 64 |
+
55 ResNet-50 at large batch sizes, more work is needed to quantify any benefit of LARS over standard
|
| 65 |
+
56 algorithms at any batch size.
|
| 66 |
+
57 You et al. [2019] later proposed the LAMB optimizer to speed up pre-training for BERT [Devlin
|
| 67 |
+
58 et al., 2018] using larger batch sizes after concluding that LARS was not effective across workloads.
|
| 68 |
+
59 LAMB is a variant of Adam [Kingma and Ba, 2014] that adds a similar layer-wise normalization step
|
| 69 |
+
60 to LARS. You et al. [2019] used LAMB for BERT pre-training with batch sizes up to 65,536 and
|
| 70 |
+
61 claimed that Adam cannot match the performance of LAMB beyond batch size 16,384.
|
| 71 |
+
62 In this paper, we demonstrate that standard optimizers, without any layer-wise normalization tech
|
| 72 |
+
63 niques, can match or improve upon the large batch size results used to justify LARS and LAMB. In
|
| 73 |
+
64 Section 2, we show that Nesterov momentum [Nesterov, 1983] matches the performance of LARS on
|
| 74 |
+
65 the ResNet-50 benchmark with batch size 32,768. We are the first to match this result with a standard
|
| 75 |
+
66 optimizer. In Section 3, contradicting the claims in You et al. [2019], we show that Adam obtains
|
| 76 |
+
67 better BERT pre-training results than LAMB at the largest batch sizes, resulting in better downstream
|
| 77 |
+
68 performance metrics after fine-tuning.
|
| 78 |
+
69 In addition, we establish a new state-of-the-art for BERT pretraining speed, reaching an F1 score of
|
| 79 |
+
70 90.46 in 7,818 steps using Adam at batch size 65,536 (we report training speed in steps because our
|
| 80 |
+
71 focus is algorithmic efficiency, but since we compare LARS and LAMB to simpler optimizers, fewer
|
| 81 |
+
72 training steps corresponds to faster wall-time in an optimized implementation – our BERT result
|
| 82 |
+
73 with Adam also improves upon the wall-time record of LAMB reported in You et al. 2019). Taken
|
| 83 |
+
74 together, our results establish stronger training speed baselines for these tasks and batch sizes, which
|
| 84 |
+
75 we hope will assist future work aiming to accelerate training using larger batch sizes.
|
| 85 |
+
|
| 86 |
+
In addition to the contributions mentioned above, we demonstrate several key effects that are often overlooked by studies aiming to establish the superiority of new optimization algorithms. We show that future work must carefully disentangle regularization and optimization effects when comparing a new optimizer to baselines. We also report several under-documented details used to generate the best LARS and LAMB results, a reminder that future comparisons should document any novel tricks and include them in baselines. Finally, our results add to existing evidence in the literature on the difficulty of performing independently rigorous hyperparameter tuning for optimizers and baselines.
|
| 87 |
+
|
| 88 |
+
In particular, we show that the optimal shape of the learning rate schedule is optimizer-dependent (in addition to the scale), and that differences in the schedule can dominate optimizer comparisons at smaller step budgets and become less important at larger step budgets.
|
| 89 |
+
|
| 90 |
+
# 86 1.1 Related work
|
| 91 |
+
|
| 92 |
+
Shallue et al. [2019] and Zhang et al. [2019] explored the effects of data parallelism on neural network training for different optimizers, finding no evidence that larger batch sizes degrade performance and demonstrating that different optimizers can achieve perfect scaling up to different critical batch sizes. You et al. [2017, 2019] developed the LARS and LAMB optimizers in the hope of speeding up training by achieving perfect scaling beyond standard optimizers. Many other recent papers have proposed new optimization algorithms for generic batch sizes or larger batch sizes [see Schmidt et al., 2020]. Choi et al. [2019] and Schmidt et al. [2020] demonstrated the difficulties with fairly comparing optimizers, showing that the hyperparameter tuning protocol is a key determinant of optimizer rankings. The MLPerf Training benchmark [Mattson et al., 2019] provides a competitive ranking of neural network training systems, but does not shed much light on the relative performance of optimizers because entrants are limited in the algorithms they can use and the hyperparameters they can tune.
|
| 93 |
+
|
| 94 |
+
# 99 2 Matching LARS on ImageNet
|
| 95 |
+
|
| 96 |
+
100 The MLPerf training benchmark for ResNet-50 v1.5 on ImageNet [Mattson et al., 2019] aims to
|
| 97 |
+
101 reach $7 5 . 9 \%$ validation accuracy in the shortest possible wall-clock time. In the closed division of
|
| 98 |
+
102 the competition, entrants must choose between two optimizers, SGD with momentum or LARS, and
|
| 99 |
+
103 are only allowed to tune a specified subset of the optimization hyperparameters, with the remaining
|
| 100 |
+
104 hyperparameter values set by the competition rules.5 The winning entries in the two most recent
|
| 101 |
+
105 competitions used LARS with batch size 32,768 for 72 training epochs6 and LARS with batch size
|
| 102 |
+
106 65,536 for 88 training epochs,7 respectively. Kumar et al. [2019] later improved the training time
|
| 103 |
+
107 for batch size 32,768 by reaching the target accuracy in 64 epochs. These are currently the fastest
|
| 104 |
+
108 published results on the ResNet-50 benchmark. However, it has been unclear whether LARS was
|
| 105 |
+
109 necessary to achieve these training speeds since no recent published results or competitive MLPerf
|
| 106 |
+
110 submissions have used another optimizer. In this section, we describe how we matched the 64 epoch,
|
| 107 |
+
111 32,768 batch size result of LARS using standard Nesterov momentum.8
|
| 108 |
+
112 A fair benchmark of training algorithms or hardware systems must account for stochasticity in
|
| 109 |
+
113 individual training runs. In the MLPerf competition, the benchmark metric is the mean wall-clock
|
| 110 |
+
114 time of 5 trials after the fastest and slowest trials are excluded. Only 4 out of the 5 trials need to reach
|
| 111 |
+
115 the target accuracy and there is no explicit limit on the number of times an entrant can try a different
|
| 112 |
+
116 set of 5 trials. Since our goal is to compare algorithms, rather than systems, we aim to match the
|
| 113 |
+
117 LARS result in terms of training steps instead (but since Nesterov momentum is computationally
|
| 114 |
+
118 simpler than LARS, this would also correspond to faster wall-clock time on an optimized system).
|
| 115 |
+
119 Specifically, we measure the median validation accuracy over 50 training runs with a fixed budget of
|
| 116 |
+
120 2,512 training steps9 at a batch size of 32,768. When we ran the published LARS training pipeline,10
|
| 117 |
+
121 LARS achieved a median accuracy of $7 5 . 9 7 \%$ and reached the target in 35 out of 50 trials. We
|
| 118 |
+
122 consider the LARS result to be matched by another optimizer if the median over 50 trials exceeds the
|
| 119 |
+
123 target of $7 5 . 9 \%$ .
|
| 120 |
+
|
| 121 |
+
# 24 2.1 Nesterov momentum at batch size 32k
|
| 122 |
+
|
| 123 |
+
This section describes how we used the standard Nesterov momentum optimizer to train the ResNet$5 0 \mathrm { v } 1 . 5$ on ImageNet to $7 5 . 9 \%$ validation accuracy in 2,512 update steps at a batch size of 32,768, matching the best published LARS result at this batch size. Although we implemented our own training program, the only logical changes we made to the published LARS pipeline were to the optimizer and the optimization hyperparameters. Our model implementation and data pre-processing pipeline were identical to those required under the MLPerf closed division rules (see Appendix B).
|
| 124 |
+
|
| 125 |
+
131 We present two Nesterov momentum hyperparameter configurations that achieve comparable per
|
| 126 |
+
132 formance to LARS. Configuration A achieved a median accuracy of $7 5 . 9 7 \%$ (the same as LARS)
|
| 127 |
+
133 and reached the target accuracy in 34 out of 50 trials. Configuration B is a modified version of
|
| 128 |
+
134 Configuration A designed to make as few changes as possible to the LARS hyperparameters; it
|
| 129 |
+
135 achieved a median accuracy of $7 5 . 9 2 \%$ and reached the target in 29 out of 50 trials. See Appendix D.1
|
| 130 |
+
136 for the complete hyperparameter configurations.
|
| 131 |
+
137 To achieve these results, we tuned the hyperparameters of the training pipeline from scratch using
|
| 132 |
+
138 Nesterov momentum. We ran a series of experiments, each of which searched over a hand-designed
|
| 133 |
+
139 hyperparameter search space using quasi-random search [Bousquet et al., 2017]. Between each
|
| 134 |
+
140 experiment, we modified the previous search space and/or tweaked the training program to include
|
| 135 |
+
141 optimization tricks and non-default hyperparameter values we discovered in the state-of-the-art LARS
|
| 136 |
+
142 pipeline. The full sequence of experiments we ran, including the number of trials, hyperparameters
|
| 137 |
+
143 tuned, and search space ranges, are provided in Appendix D.4. Once we had matched the LARS
|
| 138 |
+
144 result with Configuration A, we tried setting each hyperparameter to its value in the LARS pipeline in
|
| 139 |
+
145 order to find the minimal set of changes that still achieved the target result, producing Configuration
|
| 140 |
+
146 B. The remainder of this section describes the hyperparameters we tuned and the techniques we
|
| 141 |
+
147 applied on the journey to these results.
|
| 142 |
+
|
| 143 |
+
# 2.1.1 Nesterov Momentum Optimizer
|
| 144 |
+
|
| 145 |
+
149 Nesterov momentum is a variant of classical or “heavy-ball” momentum defined by the update rule
|
| 146 |
+
|
| 147 |
+
$$
|
| 148 |
+
\begin{array} { r l } & { \boldsymbol { v } _ { t + 1 } = \mu \boldsymbol { v } _ { t } + \nabla \ell ( \boldsymbol { \theta } _ { t } ) , } \\ & { \boldsymbol { \theta } _ { t + 1 } = \boldsymbol { \theta } _ { t } - \eta _ { t } \left( \mu v _ { t + 1 } + \nabla \ell ( \boldsymbol { \theta } _ { t } ) \right) , } \end{array}
|
| 149 |
+
$$
|
| 150 |
+
|
| 151 |
+
150 where $v _ { 0 } = 0$ , $\theta _ { t }$ is the vector of model parameters after $t$ steps, $\nabla \ell ( \theta _ { t } )$ is the gradient of the loss
|
| 152 |
+
151 function $\ell ( \theta )$ averaged over a batch of training examples, $\mu$ is the momentum, and $\eta _ { t }$ is the learning
|
| 153 |
+
152 rate for step $t$ . We prefer Nesterov momentum over classical momentum because it tolerates larger
|
| 154 |
+
153 values of its momentum parameter [Sutskever et al., 2013] and sometimes outperforms classical
|
| 155 |
+
154 momentum, although the two algorithms perform similarly on many tasks [Shallue et al., 2019, Choi
|
| 156 |
+
155 et al., 2019]. We tuned the Nesterov momentum $\mu$ in Configurations A and B. We discuss the learning
|
| 157 |
+
156 rate schedule $\{ \eta _ { t } \}$ separately in Section 2.1.4.
|
| 158 |
+
|
| 159 |
+
# 2.1.2 Batch normalization
|
| 160 |
+
|
| 161 |
+
158 The ResNet-50 v1.5 model uses batch normalization [Ioffe and Szegedy, 2015], defined as
|
| 162 |
+
|
| 163 |
+
$$
|
| 164 |
+
\mathtt { B N } ( x ^ { ( l ) } ) = \left( \frac { x ^ { ( l ) } - \mathtt { m e a n } ( x ^ { ( l ) } ) } { \sqrt { \mathsf { v a r } ( x ^ { ( l ) } ) + \epsilon } } \right) \times \gamma ^ { ( l ) } + \beta ^ { ( l ) } ,
|
| 165 |
+
$$
|
| 166 |
+
|
| 167 |
+
159 where $x ^ { ( l ) }$ is a vector of pre-normalization outputs from layer $l$ $, \mathtt { m e a n } ( \cdot )$ and $\mathtt { v a r } ( \cdot )$ denote the
|
| 168 |
+
160 element-wise sample mean and variance across the batch of training examples,11 and $\gamma ^ { ( l ) }$ and $\beta ^ { ( l ) }$
|
| 169 |
+
161 are trainable model parameters.
|
| 170 |
+
162 Batch normalization introduces the following tuneable hyperparameters: $\epsilon$ , the small constant added
|
| 171 |
+
163 to the sample variance; the initial values of $\gamma ^ { ( l ) }$ and $\dot { \beta ^ { ( l ) } }$ ; and $\rho$ , which governs the exponential
|
| 172 |
+
164 moving averages of the scaling factors used in evaluation. The LARS pipeline uses $\epsilon = \mathrm { 1 0 ^ { - 5 } }$ and
|
| 173 |
+
165 $\rho = 0 . 9$ . It sets the initial value of $\beta ^ { ( l ) }$ to 0.0 everywhere, but the initial value of $\gamma ^ { ( l ) }$ depends on
|
| 174 |
+
166 the layer: it sets $\gamma ^ { ( l ) }$ to 0.0 in the final batch normalization layer of each residual block, and to 1.0
|
| 175 |
+
167 everywhere else. In Configuration A, we tuned $\epsilon$ , $\rho$ , and $\gamma _ { 0 }$ , the initial value of $\gamma ^ { ( l ) }$ in the final batch
|
| 176 |
+
168 normalization layer of each residual block. In Configuration B, we used the same values as LARS for
|
| 177 |
+
169 $\epsilon$ and $\rho$ , but we found that choosing $\gamma _ { 0 }$ between 0.0 and 1.0 was important for matching the LARS
|
| 178 |
+
170 result with Nesterov momentum.
|
| 179 |
+
|
| 180 |
+
# 2.1.3 Regularization
|
| 181 |
+
|
| 182 |
+
72 In Configuration A, we tuned both the L2 regularization coefficient $\lambda$ and label smoothing coefficient 73 $\tau$ [Szegedy et al., 2016]. The LARS pipeline uses $\lambda ~ = ~ 1 0 ^ { - 4 }$ and $\tau ~ = ~ 0 . 1$
|
| 183 |
+
|
| 184 |
+
174 Crucially, the LARS pipeline does not apply L2 regularization to the bias variables of the
|
| 185 |
+
175 ResNet model nor the batch normalization parameters $\gamma ^ { ( l ) }$ and $\beta ^ { ( l ) }$ (indeed, the published
|
| 186 |
+
176 LARS pipeline does not even apply LARS to these parameters – it uses Heavy-ball momen
|
| 187 |
+
177 tum). This detail is extremely important for both LARS and Nesterov momentum to achieve
|
| 188 |
+
178 the fastest training speed. Configuration $\mathbf { B }$ used the same $\lambda$ and $\tau$ as Configuration A.
|
| 189 |
+
179
|
| 190 |
+
|
| 191 |
+
# 0 2.1.4 Learning rate schedule
|
| 192 |
+
|
| 193 |
+
181 The LARS pipeline uses a piecewise polynomial schedule
|
| 194 |
+
|
| 195 |
+
$$
|
| 196 |
+
\eta _ { t } = \left\{ \begin{array} { l l } { \eta _ { \mathrm { i n i t } } + ( \eta _ { \mathrm { p e a k } } - \eta _ { \mathrm { i n i t } } ) \left( \frac { t } { t _ { \mathrm { w a r m u p } } } \right) ^ { p _ { \mathrm { w a r m u p } } } , } & { t \leq t _ { \mathrm { w a r m u p } } } \\ { \eta _ { \mathrm { f i n a l } } + ( \eta _ { \mathrm { p e a k } } - \eta _ { \mathrm { f i n a l } } ) \left( \frac { T - t } { T - t _ { \mathrm { w a r m u p } } } \right) ^ { p _ { \mathrm { d e c a y } } } } & { t > t _ { \mathrm { w a r m u p } } , } \end{array} \right.
|
| 197 |
+
$$
|
| 198 |
+
|
| 199 |
+
182 with $\eta _ { \mathrm { i n i t } } ~ = ~ 0 . 0$ , $\eta _ { \mathrm { p e a k } } ~ = ~ 2 9 . 0$ , $\eta _ { \mathrm { f i n a l } } = 1 0 ^ { - 4 }$ , $p _ { \mathrm { w a r m u p } } ~ = ~ 1$ ,
|
| 200 |
+
183 $p _ { \mathrm { d e c a y } } = 2$ , and $t _ { \mathrm { w a r m u p } } = 7 0 6$ steps. In Configuration A, we re
|
| 201 |
+
184 tuned all of these hyperparameters with Nesterov momentum.
|
| 202 |
+
185 In Configuration B, we set $\eta _ { \mathrm { i n i t } } , p _ { \mathrm { d e c a y } }$ , and $t _ { \mathrm { w a r m u p } }$ to the same
|
| 203 |
+
186 values as LARS, changing only $p _ { \mathrm { w a r m u p } }$ from 1 to 2 and re
|
| 204 |
+
187 scaling $\eta _ { \mathrm { p e a k } }$ and $\eta _ { \mathrm { f i n a l } }$ .
|
| 205 |
+
|
| 206 |
+
Table 1: The hyperparameters of Configuration $\mathbf { B }$ that differ from state-of-the-art LARS at batch size 32,768 [Kumar et al., 2019].
|
| 207 |
+
|
| 208 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Nesterov</td><td rowspan=1 colspan=1>LARS</td></tr><tr><td rowspan=1 colspan=1>Pwarmup</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>npeak</td><td rowspan=1 colspan=1>7.05</td><td rowspan=1 colspan=1>29.0</td></tr><tr><td rowspan=1 colspan=1>Mfinal</td><td rowspan=1 colspan=1>6×10-6</td><td rowspan=1 colspan=1>10-4</td></tr><tr><td rowspan=1 colspan=1>1-μ</td><td rowspan=1 colspan=1>0.02397</td><td rowspan=1 colspan=1>0.071</td></tr><tr><td rowspan=1 colspan=1>入</td><td rowspan=1 colspan=1>5.8× 10-5</td><td rowspan=1 colspan=1>10-4</td></tr><tr><td rowspan=1 colspan=1>T</td><td rowspan=1 colspan=1>0.15</td><td rowspan=1 colspan=1>0.10</td></tr><tr><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>0.4138</td><td rowspan=1 colspan=1>0.0</td></tr></table>
|
| 209 |
+
|
| 210 |
+
# 2.1.5 Comparing Nesterov momentum and LARS
|
| 211 |
+
|
| 212 |
+
Table 1 shows the hyperparameter values for Configuration B that differ from the stateof-the-art LARS pipeline. Aside from re-tuning the momentum, learning rate scale, and regularization hyperparameters (whose optimal values are all expected to change with the optimizer), the only changes are setting pwarmup to 2 instead of 1 and re-tuning $\gamma _ { 0 }$ .
|
| 213 |
+
|
| 214 |
+
Figure 1 shows the LARS learning rate schedule compared to the Nesterov momentum schedule. Even though these schedules are similar, we found that each optimizer had a different optimal value of the warmup polynomial power. As Table 2 shows, Nesterov momentum performs better with $p _ { \mathrm { w a r m u p } } = 2$ instead of 1, while the opposite is true with LARS. As discussed in Agarwal et al. [2020], optimizers can induce implicit step size schedules that strongly influence their training dynamics and solution quality, and it appears from Table 2 that the implicit step sizes of Nesterov momentum and LARS may evolve differently, causing the shapes of their optimal learning rate schedules to differ.
|
| 215 |
+
|
| 216 |
+

|
| 217 |
+
Figure 1: The learning rate schedules of LARS and Nesterov momentum Configuration B. Aside from re-scaling, the only difference is setting the warmup polynomial power to 2 instead of 1.
|
| 218 |
+
|
| 219 |
+
207 Although the main concern of a practitioner is validation performance, the primary task of an
|
| 220 |
+
208 optimization algorithm is to minimize training loss. Table 2 shows that Nesterov momentum achieves
|
| 221 |
+
209 higher training accuracy than LARS, despite similar validation performance. Thus, it may be more
|
| 222 |
+
210 appropriate to consider the layerwise normalization of LARS to be a regularization technique, rather
|
| 223 |
+
211 than an optimization technique.
|
| 224 |
+
12 Spending even more effort tuning LARS or Nesterov momentum would likely further improve the
|
| 225 |
+
213 current state-of-the-art for that optimizer. Meaningful optimizer comparisons are only possible
|
| 226 |
+
214 with independent and equally intensive tuning efforts, and we do not claim that either optimizer
|
| 227 |
+
215 outperforms the other on this benchmark. That said, if the main evidence for LARS’s utility as a
|
| 228 |
+
216 “large-batch optimizer” is its performance on this particular benchmark, then more evidence is needed
|
| 229 |
+
217 to quantify any benefit it has over traditional, generic optimizers like Nesterov momentum.
|
| 230 |
+
|
| 231 |
+
# 2.2 Lessons learned
|
| 232 |
+
|
| 233 |
+
In hindsight, it was only necessary to make a few changes to the LARS pipeline to match its performance at batch size 32,768 with Nesterov momentum. However, Table 1 does not accurately represent the effort required when attempting to match a highly tuned training-speed benchmark.
|
| 234 |
+
|
| 235 |
+
Table 2: (Left) The best warmup schedule differs for Nesterov momentum and LARS. Values are medians over 50 training runs after setting $p _ { \mathrm { w a r m u p } }$ without retuning other hyperparameters. (Right) Median train and test accuracies over 50 training runs for Nesterov momentum Configuration B and LARS.
|
| 236 |
+
|
| 237 |
+
<table><tr><td rowspan=2 colspan=1>Pwarmup</td><td rowspan=2 colspan=1>Nesterov</td><td rowspan=2 colspan=1>LARS</td><td rowspan=2 colspan=2></td><td rowspan=1 colspan=1></td><td rowspan=2 colspan=1></td><td rowspan=2 colspan=1>Optimizer</td><td rowspan=2 colspan=1>Train Acc</td></tr><tr><td rowspan=1 colspan=2></td></tr><tr><td rowspan=2 colspan=1>1</td><td rowspan=2 colspan=1>75.79%</td><td rowspan=2 colspan=1>75.97%</td><td rowspan=2 colspan=2></td><td rowspan=1 colspan=1></td><td rowspan=2 colspan=1></td><td rowspan=2 colspan=1>Nesterov</td><td rowspan=2 colspan=1>78.97%</td></tr><tr><td rowspan=1 colspan=2></td></tr><tr><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>75.92%</td><td rowspan=1 colspan=1>75.69%</td><td rowspan=1 colspan=3></td><td rowspan=1 colspan=1>LARS</td><td rowspan=1 colspan=1>78.07%</td><td rowspan=1 colspan=1>75.97%</td></tr></table>
|
| 238 |
+
|
| 239 |
+
222 Firstly, as described in Sections 2.1.2 and 2.1.3, the strong results of LARS depend partly on a few
|
| 240 |
+
223 subtle optimization tricks and non-default values of uncommonly-tuned hyperparameters. Fortunately,
|
| 241 |
+
224 in this case we could discover these tricks by examining the open-source code required for MLPerf
|
| 242 |
+
225 submissions, but machine learning research papers do not always report these important details.
|
| 243 |
+
226 Researchers can easily waste a lot of experiments and produce misleading results before getting all of
|
| 244 |
+
227 these details right. We demonstrate the importance of adding these tricks to our Nesterov momentum
|
| 245 |
+
228 pipeline in Appendix C; without these tricks (or some new tricks), we likely would not have been
|
| 246 |
+
229 able to match the LARS performance.
|
| 247 |
+
230 Secondly, the learning rate schedule really matters when trying to maximize performance with a
|
| 248 |
+
231 relatively small step budget. Both LARS and Nesterov momentum are sensitive to small deviations
|
| 249 |
+
232 from the optimized learning rate schedules in Figure 1, and neither schedule works as well for the
|
| 250 |
+
233 other optimizer. Although relatively minor changes were sufficient to match LARS with Nesterov
|
| 251 |
+
234 momentum, there is no way to know a priori how the optimal schedule will look for a new optimizer
|
| 252 |
+
235 Wu et al. [2018]. Even in toy settings where the optimal learning rate schedule can be derived, it
|
| 253 |
+
236 does not fit into commonly used schedule families and depends strongly on the optimizer Zhang
|
| 254 |
+
237 et al. [2019]. Indeed, this problem applies to the other optimization hyperparameters as well: it
|
| 255 |
+
238 is extremely difficult to know which are worth considering ahead of time. Finally, even when we
|
| 256 |
+
239 narrowed down our hyperparemeter search spaces around the optimal point, the volume of our search
|
| 257 |
+
240 spaces corresponding to near-peak performance was small, likely due to the small step budget [Shallue
|
| 258 |
+
241 et al., 2019]. We investigate how these effects change with a less stringent step budget in Section 4.
|
| 259 |
+
|
| 260 |
+
# 242 3 Stronger BERT pretraining speed baselines
|
| 261 |
+
|
| 262 |
+
243 You et al. [2019] developed the LAMB optimizer in the hope of speeding up training for BERT-Large
|
| 263 |
+
244 [Bidirectional Encoder Representations from Transformers, Devlin et al., 2018]. BERT training
|
| 264 |
+
245 consists of two phases. The “pretraining” phase has two objectives: (1) predicting masked tokens
|
| 265 |
+
246 based on the rest of the sequence (a masked language model), and (2) predicting whether two
|
| 266 |
+
247 given sentences follow one from another. Finally, the “fine-tuning” phase refines the model for a
|
| 267 |
+
248 downstream task of interest. BERT pretraining takes a considerable amount of time (up to 3 days on
|
| 268 |
+
249 16 Cloud TPU-v3 chips Jouppi et al. [2017]), whereas the fine-tuning phase is typically much faster.
|
| 269 |
+
250 Model quality is typically assessed on the downstream metrics, not on pretraining loss, making BERT
|
| 270 |
+
251 training a somewhat awkward benchmark for optimization research.
|
| 271 |
+
252 You et al. [2019] used LAMB for BERT pretraining with batch sizes up to 65,536 and claimed that
|
| 272 |
+
253 LAMB outperforms Adam batch size 16,384 and beyond. The LAMB optimizer has since appeared
|
| 273 |
+
254 in several NLP toolkits, including as Microsoft DeepSpeed and NVIDIA Multi-node BERT training,
|
| 274 |
+
255 and as a benchmark task in MLPerf v0.7.12
|
| 275 |
+
|
| 276 |
+
As shown in Table 3, we trained Adam (with decoupled weight decay) baselines that achieve better results than both the LAMB and Adam results reported in You et al. [2019]. Our new Adam baselines obtain better F1 scores on the development set of the SQuaD v1.1 task in the same number of training steps as LAMB for both batch size 32,768 and the hybrid 65,536-then-32,768 batch size training regime in You et al. [2019]. We also ran Adam at batch size 65,536 to reach nearly the same F1 score as the hybrid batch size LAMB result, but in much fewer training steps. We believe 7,818 steps is a new state-of-the-art for BERT pretraining speed [in our experiments, it also improves upon the 76-minute record claimed in You et al., 2019]. Additionally, at batch size 32,768 our Adam baseline got a better pretraining loss of 1.277 compared to LAMB’s 1.342.
|
| 277 |
+
|
| 278 |
+
266 We used the same experimental setup as You
|
| 279 |
+
267 et al. [2019], including two pretraining phases
|
| 280 |
+
268 with max sequence lengths of 128 and then 512.
|
| 281 |
+
269 In order to match You et al. [2019], we reported
|
| 282 |
+
270 the F1 score on the downstream SQuaD v1.1
|
| 283 |
+
271 task as the target metric, although this metric
|
| 284 |
+
272 introduces potential confounds: optimization
|
| 285 |
+
273 efficiency should be measured on the training
|
| 286 |
+
274 task using training and held-out data sets. Fortunately, in this case better pretraining performance
|
| 287 |
+
275 correlated a with higher F1 score after fine-tuning. See Appendix B.2 for additional experiment
|
| 288 |
+
276 details. We tuned Adam hyperparameters independently for each pretraining phase, specifically
|
| 289 |
+
277 learning rate $\eta$ , $\beta _ { 1 }$ , $\beta _ { 2 }$ , the polynomial power for the learning rate warmup $p _ { w a r m u p }$ , and weight
|
| 290 |
+
278 decay $\lambda$ , using quasi-random search [Bousquet et al., 2017]. See Appendix D.2 for the search spaces.
|
| 291 |
+
279 In addition to hyperparmeter tuning, our improved Adam results at these batch sizes are also likely
|
| 292 |
+
280 due to two implementation differences. First, the Adam implementation in You et al. [2019] comes
|
| 293 |
+
281 from the BERT open source code base, in which Adam is missing the standard bias correction.13
|
| 294 |
+
282 The Adam bias correction acts as an additional step size warm-up, thereby potentially improving the
|
| 295 |
+
283 stability in the initial steps of training. Second, the BERT learning rate schedule had a discontinuity
|
| 296 |
+
284 at the start of the decay phase due to the learning rate decay being incorrectly applied during warm-up
|
| 297 |
+
285 14 (see Figure 2 in Appendix B). This peculiarity is part of the official BERT release and is present in
|
| 298 |
+
286 $3 0 0 0 +$ copies of the BERT Training code on GitHub.
|
| 299 |
+
|
| 300 |
+
Table 3: Using Adam for pretraining exceeds the reported performance of LAMB in You et al. [2019] in terms of F1 score on the downstream SQuaD v1.1 task.
|
| 301 |
+
|
| 302 |
+
<table><tr><td rowspan=1 colspan=1>Batch size</td><td rowspan=1 colspan=1>Step budget</td><td rowspan=1 colspan=1>LAMB</td><td rowspan=1 colspan=1>Adam</td></tr><tr><td rowspan=1 colspan=1>32k</td><td rowspan=1 colspan=1>15,625</td><td rowspan=1 colspan=1>91.48</td><td rowspan=1 colspan=1>91.58</td></tr><tr><td rowspan=1 colspan=1>65k/32k</td><td rowspan=1 colspan=1>8,599</td><td rowspan=1 colspan=1>90.58</td><td rowspan=1 colspan=1>91.04</td></tr><tr><td rowspan=1 colspan=1>65k</td><td rowspan=1 colspan=1>7,818</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>90.46</td></tr></table>
|
| 303 |
+
|
| 304 |
+
# 287 4 Investigating a less stringent step budget
|
| 305 |
+
|
| 306 |
+
Part of what makes comparing optimizers so difficult is that the hyperparameter tuning tends to dominate the comparisons [Choi et al., 2019]. Moreover, tuning becomes especially difficult when we demand a fixed epoch budget even when dramatically increasing the batch size [Shallue et al., 2019]. Fixing the epoch budget as the batch size increases is equivalent to demanding perfect scaling (i.e. that the number of training steps decreases by the same factor that the batch size is increased). We can view the role of hyperparameter tuning for large batch training as resisting the inevitable end of perfect scaling. For example, it might be possible to extend perfect scaling using delicately tuned learning rate schedules, but comparing optimizers under these conditions can make the learning rate schedule dominate the comparison by favoring some algorithms over others. Therefore, in order to better understand the behavior of LARS and LAMB compared to Nesterov Momentum and Adam, we ran additional ResNet-50 experiments with a more generous 6,000 step budget (vs 2,512 in Section 2) and a more simplistic cosine learning rate schedule. At batch size 32,768, this budget should let us reach better validation accuracy than the MLPerf target of $7 5 . 9 \%$ .
|
| 307 |
+
|
| 308 |
+
301 Although not mentioned in You et al. [2017], the state-of-the-art MLPerf pipeline for “LARS” actually
|
| 309 |
+
302 uses both LARS and Heavy-ball Momentum, with Momentum applied to the batch normalization and
|
| 310 |
+
303 ResNet bias parameters and LARS applied to the other parameters. You et al. [2019] does not mention
|
| 311 |
+
304 whether LAMB was only applied to some parameters and not others. If layerwise normalization can
|
| 312 |
+
305 be harmful for some model parameters, this is critical information for practitioners using LARS or
|
| 313 |
+
306 LAMB, since it might not be obvious which optimizer to apply to which parameters. To investigate
|
| 314 |
+
307 this, we trained both pure LARS and LAMB configurations, as well as configurations that did not
|
| 315 |
+
308 apply layerwise normalization to the batch normalization and ResNet bias parameters. Moreover,
|
| 316 |
+
309 LAMB’s underlying Adam implementation defaults to $\epsilon = 1 0 ^ { - 6 }$ , rather than the typical $1 0 ^ { - 7 }$ or
|
| 317 |
+
310 $1 0 ^ { - 8 }$ . In some cases, $\epsilon$ can be a critical hyperparameter for Adam [Choi et al., 2019], so we included
|
| 318 |
+
311 Adam configurations with both $\epsilon = 1 0 ^ { - 6 }$ and $\epsilon = 1 0 ^ { - 8 }$ .
|
| 319 |
+
|
| 320 |
+
Table 4 shows the validation accuracy of these different configurations after training for 6,000 steps with batch size 32,768. In every case, we used a simple cosine decay learning rate schedule and tuned the initial learning rate and weight decay using quasi-random search. We used momentum parameters of 0.98 for Nesterov momentum and 0.929 for LARS, respectively, based on the tuned values from Section 2. We used default hyperparameters for Adam and LAMB except where specified. We set all other hyperparameters to the same values as the state-of-theart LARS pipeline, except we set $\gamma _ { 0 } = 1 . 0$ . See Appendix D.3 for more details. As expected, highly tuned learning rate schedules and optimizer hyperparameters are no longer necessary with a less stringent step budget. Multiple optimizer configurations in Table 4 exceed the MLPerf target accuracy of $7 5 . 9 \%$ at batch size 32,768 with minimal tuning. Training with larger batch sizes is not fundamentally unstable: stringent step budgets make hyperparameter tuning trickier.
|
| 321 |
+
|
| 322 |
+
<table><tr><td rowspan=1 colspan=1>WeightsOptimizer</td><td rowspan=1 colspan=1>Bias/BNOptimizer</td><td rowspan=1 colspan=1>Top-1</td></tr><tr><td rowspan=1 colspan=1>Nesterov</td><td rowspan=1 colspan=1>Nesterov</td><td rowspan=1 colspan=1>76.7</td></tr><tr><td rowspan=1 colspan=1>LARS</td><td rowspan=1 colspan=1>Momentum</td><td rowspan=1 colspan=1>76.9</td></tr><tr><td rowspan=1 colspan=1>LARS</td><td rowspan=1 colspan=1>LARS</td><td rowspan=1 colspan=1>76.9</td></tr><tr><td rowspan=1 colspan=1>Adam (c = 10-8)</td><td rowspan=1 colspan=1>Adam (c = 10-8)</td><td rowspan=1 colspan=1>76.2</td></tr><tr><td rowspan=1 colspan=1>Adam (e = 10-6)</td><td rowspan=1 colspan=1>Adam (ε = 10-6)</td><td rowspan=1 colspan=1>76.4</td></tr><tr><td rowspan=1 colspan=1>LAMB</td><td rowspan=1 colspan=1>LAMB</td><td rowspan=1 colspan=1>27.3</td></tr><tr><td rowspan=1 colspan=1>LAMB</td><td rowspan=1 colspan=1>Adam (e = 10-8)</td><td rowspan=1 colspan=1>76.3</td></tr><tr><td rowspan=1 colspan=1>LAMB</td><td rowspan=1 colspan=1>Adam (ε = 10-6)</td><td rowspan=1 colspan=1>76.3</td></tr></table>
|
| 323 |
+
|
| 324 |
+
Table 4: Validation accuracy of ResNet-50 on ImageNet trained for 6,000 steps instead of 2,512. The second column is the optimizer that was applied to the batch norm and ResNet bias variables. We report the median top-1 accuracy over 5 seeds of the best hyperparameter setting in a refined search space. See Appendix D.3 for details.
|
| 325 |
+
|
| 326 |
+
In Table 4, “pure LAMB” performs extremely poorly: LAMB only obtains reasonable results when it is not used on the batch normalization and ResNet bias parameters, suggesting that layerwise normalization can indeed be harmful on some parameters. “Pure LARS” and Nesterov momentum perform roughly the same at this step budget, but the MLPerf LARS pipeline, which is tuned for a more stringent step budget, does not use LARS on all parameters, at least suggesting that the optimal choice could be budget-dependent.
|
| 327 |
+
|
| 328 |
+
Many new neural net optimizers, including LAMB, are introduced alongside claims that the new optimizer does not require any—or at least minimal—tuning. Unfortunately, these claims require a lot of work to support, since they require trying the optimizer on new problems without using those problems during the development of the algorithm. Although our experiments here are not sufficient to determine
|
| 329 |
+
|
| 330 |
+
which optimizers are easiest to tune, experiments like these that operate outside the regime of highly tuned learning rate schedules can serve as a starting point. In this experiment, LARS and LAMB do not appear to have an advantage in how easy they are to tune even on a dataset and model that were used in the development of both of those algorithms. LAMB is a variant of Adam and performs about the same as Adam with the same value of $\epsilon$ ; LARS is more analogous to Momentum and indeed Nesterov momentum and LARS have similar performance.
|
| 331 |
+
|
| 332 |
+
# 5 Discussion
|
| 333 |
+
|
| 334 |
+
Our results show that standard, generic optimizers suffice for achieving strong results across batch sizes. Therefore, any research program to create new optimizers for training at larger batch sizes must start from the fact that Momentum, Adam, and likely other standard methods work fine at batch sizes as large as those considered in this paper. The LARS and LAMB update rules have no more to do with the batch size (or “large” batches) than the Momentum or Adam update rules. Although You et al. [2019] presented convergence rate bounds for LARS and LAMB to support their claims of superior performance, we show in Appendix A that Adam satisfies a similar bound to LAMB. These bounds all rely on very unrealistic assumptions. 15 Most of all, they are loose upper bounds on the worst case behavior of the algorithms, not accurate reflections of optimizer performance in reality. Whether layer-wise normalization can be useful for optimization or regularization remains an open question. However, if LARS and LAMB have any advantage over standard techniques, it is not that they work dramatically better on the tasks and batch sizes in You et al. [2017, 2019]. This is not to suggest that there is nothing interesting about studying neural network optimization at larger batch sizes. For example, as gradient noise decreases, there may be opportunities to harness curvature information and extend the region of perfect scaling [Zhang et al., 2019]. However, there is currently no evidence that LARS and LAMB scale better than Momentum and Adam.
|
| 335 |
+
|
| 336 |
+
Our primary concern in this paper has been matching the state of the art—and establishing new baselines—for training speed measurements of the sort used to justify new techniques and algorithms for training with larger batch sizes. In contrast, many practitioners are more concerned with obtaining the best possible validation error with a somewhat flexible training time budget. Part of the reason why matching LARS at batch size 32,768 was non-trivial is because getting state of the art training
|
| 337 |
+
|
| 338 |
+
373 speed requires several tricks and implementation details that are not often discussed. It was not
|
| 339 |
+
374 obvious to us a priori which ones would prove crucial. These details do not involve changes to the
|
| 340 |
+
375 optimizer, but they interact with the optimizer in a regime where all hyperparameters need to be well
|
| 341 |
+
376 tuned to stay competitive, making it necessary to re-tune everything for a new optimizer.
|
| 342 |
+
377 In neural network optimization research, training loss is rarely discussed in detail and evaluation
|
| 343 |
+
378 centers on validation/test performance since that is what practitioners care most about. However,
|
| 344 |
+
379 although we shouldn’t only consider training loss, it is counter-intuitive and counter-productive to
|
| 345 |
+
380 elide a careful investigation of the actual objective of the optimizer. If a new optimizer achieves better
|
| 346 |
+
381 test performance, but shows no speedup on training loss, then perhaps it is not a better optimizer so
|
| 347 |
+
382 much as an indirect regularizer. 16 Indeed, in our experiments we found that Nesterov momentum
|
| 348 |
+
383 achieves noticeably better training accuracy on ResNet-50 than the LARS configuration we used,
|
| 349 |
+
384 despite reaching roughly the same validation accuracy. Properly disentangling possible regularization
|
| 350 |
+
385 benefits from optimization speed-ups is crucial if we are to understand neural network training,
|
| 351 |
+
386 especially at larger batch sizes where we lose some of the regularization effect of gradient noise.
|
| 352 |
+
387 Hypothetically, if the primary benefit of a training procedure is regularization, then it would be better
|
| 353 |
+
388 to compare the method with other regularization baselines than other optimizers.
|
| 354 |
+
389 Ultimately, we only care about batch size to the extent that higher degrees of data parallelism lead
|
| 355 |
+
390 to faster training. Training with a larger batch size is a means, not the end goal. New optimizers—
|
| 356 |
+
391 whether designed for generic batch sizes or larger batch sizes—have the potential to dramatically
|
| 357 |
+
392 improve algorithmic efficiency across multiple workloads, but our results show that standard opti
|
| 358 |
+
393 mizers can match the performance of newer alternatives on the workloads we considered. Indeed,
|
| 359 |
+
394 despite the legion of new update rule variants being proposed in the literature, standard Adam and
|
| 360 |
+
395 Momentum remain the workhorses of practitioners and researchers alike, while independent empirical
|
| 361 |
+
396 comparisons consistently find no clear winner when optimizers are compared across a variety of
|
| 362 |
+
397 workloads [Schmidt et al., 2020]. Meanwhile, as Choi et al. [2019] and our results underscore,
|
| 363 |
+
398 comparisons between optimizers crucially depend on the effort spent tuning hyperparameters for each
|
| 364 |
+
399 optimizer. Given these facts, we should regard with extreme caution studies claiming to show the
|
| 365 |
+
400 superiority of one particular optimizer over others. Part of the issue stems from current incentives in
|
| 366 |
+
401 the research community; we overvalue the novelty of new methods and undervalue establishing strong
|
| 367 |
+
402 baselines to measure progress against. This is particularly problematic in the study of optimizers,
|
| 368 |
+
403 where the learning rate schedule is arguably more important than the choice of the optimizer update
|
| 369 |
+
404 rule itself! As our results show, the best learning rate schedule is tightly coupled with the optimizer,
|
| 370 |
+
405 meaning that tuning the learning rate schedule for a new optimizer will generally favor the new
|
| 371 |
+
406 optimizer over a baseline unless the schedule of the baseline is afforded the same tuning effort.
|
| 372 |
+
|
| 373 |
+
# 6 Conclusion
|
| 374 |
+
|
| 375 |
+
In this work, we demonstrated that standard optimizers, without any layer-wise normalization techniques, can match or exceed the large batch size results used to justify LARS and LAMB. Future work attempting to argue that a new algorithm is useful by comparing to baseline methods or results, including those established in this paper, faces a key challenge in showing that the gains are due to the new method and not merely due to better tuning or changes to the training pipeline (e.g. regularization tricks). Although gains from tuning will eventually saturate, we can, in principle, always invest more effort in tuning and potentially get better results for any optimizer. However, our goal should be developing optimizers that work better across many different workloads when taking into account the amount of additional tuning they require.
|
| 376 |
+
|
| 377 |
+
Moving forward, if we are to reliably make progress we need to rethink how we compare and evaluate new optimizers for neural network training. Given how sensitive optimizer performance is to the hyperparameter tuning protocol and how difficult it is to quantify hyperparameter tuning effort, we can’t expect experiments with self-reported baselines to always lead to fair comparisons. Ideally, new training methods would be evaluated in a standardized competitive benchmark, where submitters of new optimizers do not have full knowledge of the evaluation workloads. Some efforts in this direction have started, for instance the MLCommons Algorithmic Efficiency Working Group17 , but more work needs to be done to produce incentives for the community to publish well-tuned baselines and to reward researchers that conduct the most rigorous empirical comparisons.
|
| 378 |
+
|
| 379 |
+
1. For all authors...
|
| 380 |
+
|
| 381 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] See Sections 2, 3, 4
|
| 382 |
+
(b) Did you describe the limitations of your work? [Yes] We had a lengthy discussion of the limitations and scope of the work in Section 5
|
| 383 |
+
(c) Did you discuss any potential negative societal impacts of your work? [No] We did not discuss this in the main text. Our primary contribution is to improve experimental protocols for other methodological work, which is so removed from specific machine learning applications that it is hard to determine the net impact. That said, more effective experimental protocols should lead to more effective science which in turn should lead to more effective machine learning applications. Whether this development is positive or negative for society will depend on who stands to gain from the use of machine learning in future applied contexts. Additionally, although our work should, in the long run, save computational resources for individual researchers, in net across the community this may or may not produce an aggregate savings because more efficient machine learning training, by making larger scale projects more accessible, can lead to an increased demand for compute resources [York, 2006], which can have varying degrees of negative environmental impacts [Patterson et al., 2021].
|
| 384 |
+
|
| 385 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 386 |
+
|
| 387 |
+
2. If you are including theoretical results...
|
| 388 |
+
|
| 389 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] See Appendix A for a comprehensive description of the problem setting. (b) Did you include complete proofs of all theoretical results? [Yes] See Appendix A.
|
| 390 |
+
|
| 391 |
+
3. If you ran experiments...
|
| 392 |
+
|
| 393 |
+
(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)? [No] We will include a link to all code and all possible reproducibility instructions after the anonymized reviewing period is over.
|
| 394 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] We are extremely detailed about our tuning procedures and dataset details, see Appendices B, D.
|
| 395 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] While we do not report error bars in the tables in the main text, Appendices B.2, C contains box plots showing the quartiles of the distribution over random seeds.
|
| 396 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [No] In Appendix B we state that we run on Google TPUs, however we do not tally up the total number of experiments run (although an interested reader could compute it from the information we provided in our detailed appendices given that we list all intermediate experiments, no matter how silly in hindsight).
|
| 397 |
+
|
| 398 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 399 |
+
|
| 400 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] We reference the relevant citations for all models, datasets, and techniques.
|
| 401 |
+
(b) Did you mention the license of the assets? [No]
|
| 402 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [No]
|
| 403 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 404 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 405 |
+
|
| 406 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 407 |
+
|
| 408 |
+
479 (a) Did you include the full text of instructions given to participants and screenshots, if
|
| 409 |
+
480 applicable? [N/A]
|
| 410 |
+
481 (b) Did you describe any potential participant risks, with links to Institutional Review
|
| 411 |
+
482 Board (IRB) approvals, if applicable? [N/A]
|
| 412 |
+
483 (c) Did you include the estimated hourly wage paid to participants and the total amount
|
| 413 |
+
484 spent on participant compensation? [N/A]
|
| 414 |
+
485 References
|
| 415 |
+
486 Mart´ın Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S.
|
| 416 |
+
487 Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew
|
| 417 |
+
488 Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath
|
| 418 |
+
489 Kudlur, Josh Levenberg, Dandelion Mane, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, ´
|
| 419 |
+
490 Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent
|
| 420 |
+
491 Vanhoucke, Vijay Vasudevan, Fernanda Viegas, Oriol Vinyals, Pete Warden, Martin Wattenberg, ´
|
| 421 |
+
492 Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-scale machine learning on
|
| 422 |
+
493 heterogeneous systems, 2015. URL https://www.tensorflow.org/. Software available from
|
| 423 |
+
494 tensorflow.org.
|
| 424 |
+
495 Naman Agarwal, Rohan Anil, Elad Hazan, Tomer Koren, and Cyril Zhang. Disentangling adaptive
|
| 425 |
+
496 gradient methods from learning rates. arXiv preprint arXiv:2002.11803, 2020.
|
| 426 |
+
497 Olivier Bousquet, Sylvain Gelly, Karol Kurach, Olivier Teytaud, and Damien Vincent. Critical hyper
|
| 427 |
+
498 parameters: No random, no cry. arXiv, 2017. URL https://arxiv.org/abs/1706.03200.
|
| 428 |
+
499 James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal
|
| 429 |
+
500 Maclaurin, George Necula, Adam Paszke, Jake VanderPlas, Skye Wanderman-Milne, and
|
| 430 |
+
501 Qiao Zhang. JAX: composable transformations of Python+NumPy programs, 2018. URL
|
| 431 |
+
502 http://github.com/google/jax.
|
| 432 |
+
503 Dami Choi, Christopher J Shallue, Zachary Nado, Jaehoon Lee, Chris J Maddison, and George E
|
| 433 |
+
504 Dahl. On empirical comparisons of optimizers for deep learning. arXiv preprint arXiv:1910.05446,
|
| 434 |
+
505 2019.
|
| 435 |
+
506 Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep
|
| 436 |
+
507 bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
|
| 437 |
+
508 Elad Hoffer, Itay Hubara, and Daniel Soudry. Train longer, generalize better: closing the gen
|
| 438 |
+
509 eralization gap in large batch training of neural networks. arXiv preprint arXiv:1705.08741,
|
| 439 |
+
510 2017.
|
| 440 |
+
511 Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by
|
| 441 |
+
512 reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
|
| 442 |
+
513 Norman P Jouppi, Cliff Young, Nishant Patil, David Patterson, Gaurav Agrawal, Raminder Bajwa,
|
| 443 |
+
514 Sarah Bates, Suresh Bhatia, Nan Boden, Al Borchers, et al. In-datacenter performance analysis of
|
| 444 |
+
515 a tensor processing unit. In Proceedings of the 44th Annual International Symposium on Computer
|
| 445 |
+
516 Architecture, pages 1–12, 2017.
|
| 446 |
+
517 Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint
|
| 447 |
+
518 arXiv:1412.6980, 2014.
|
| 448 |
+
519 Sameer Kumar, Victor Bitorff, Dehao Chen, Chiachen Chou, Blake Hechtman, HyoukJoong Lee,
|
| 449 |
+
520 Naveen Kumar, Peter Mattson, Shibo Wang, Tao Wang, et al. Scale mlperf-0.6 models on google
|
| 450 |
+
521 tpu-v3 pods. arXiv preprint arXiv:1909.09756, 2019.
|
| 451 |
+
522 Peter Mattson, Christine Cheng, Cody Coleman, Greg Diamos, Paulius Micikevicius, David Patterson,
|
| 452 |
+
523 Hanlin Tang, Gu-Yeon Wei, Peter Bailis, Victor Bittorf, David Brooks, Dehao Chen, Debojy
|
| 453 |
+
524 oti Dutta, Udit Gupta, Kim Hazelwood, Andrew Hock, Xinyuan Huang, Atsushi Ike, Bill Jia,
|
| 454 |
+
525 Daniel Kang, David Kanter, Naveen Kumar, Jeffery Liao, Guokai Ma, Deepak Narayanan, Tayo
|
| 455 |
+
526 Oguntebi, Gennady Pekhimenko, Lillian Pentecost, Vijay Janapa Reddi, Taylor Robie, Tom St.
|
| 456 |
+
527 John, Tsuguchika Tabaru, Carole-Jean Wu, Lingjie Xu, Masafumi Yamazaki, Cliff Young, and
|
| 457 |
+
|
| 458 |
+
Matei Zaharia. MLPerf training benchmark. arXiv preprint arXiv:1910.01500, 2019. URL https://arxiv.org/abs/1910.01500.
|
| 459 |
+
Yurii E Nesterov. A method for solving the convex programming problem with convergence rate $\mathrm { O } ( 1 / \mathrm { k } ^ { 2 } )$ . In Dokl. akad. nauk Sssr, volume 269, pages 543–547, 1983.
|
| 460 |
+
David Patterson, Joseph Gonzalez, Quoc Le, Chen Liang, Lluis-Miquel Munguia, Daniel Rothchild, David So, Maud Texier, and Jeff Dean. Carbon emissions and large neural network training. arXiv preprint arXiv:2104.10350, 2021.
|
| 461 |
+
Boris T Polyak. Some methods of speeding up the convergence of iteration methods. USSR Computational Mathematics and Mathematical Physics, 4(5):1–17, 1964.
|
| 462 |
+
Robin M Schmidt, Frank Schneider, and Philipp Hennig. Descending through a crowded valley– benchmarking deep learning optimizers. arXiv preprint arXiv:2007.01547, 2020.
|
| 463 |
+
Christopher J Shallue, Jaehoon Lee, Joseph Antognini, Jascha Sohl-Dickstein, Roy Frostig, and George E Dahl. Measuring the effects of data parallelism on neural network training. Journal of Machine Learning Research, 20(112):1–49, 2019.
|
| 464 |
+
Ilya Sutskever, James Martens, George Dahl, and Geoffrey Hinton. On the importance of initialization and momentum in deep learning. In ICML, 2013.
|
| 465 |
+
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, pages 2818–2826, 2016.
|
| 466 |
+
Yu Emma Wang, Gu-Yeon Wei, and David Brooks. Benchmarking tpu, gpu, and cpu platforms for deep learning. arXiv preprint arXiv:1907.10701, 2019.
|
| 467 |
+
Yuhuai Wu, Mengye Ren, Renjie Liao, and Roger Grosse. Understanding short-horizon bias in stochastic meta-optimization. arXiv preprint arXiv:1803.02021, 2018.
|
| 468 |
+
Chris Ying, Sameer Kumar, Dehao Chen, Tao Wang, and Youlong Cheng. Image classification at supercomputer scale. arXiv preprint arXiv:1811.06992, 2018.
|
| 469 |
+
Richard York. Ecological paradoxes: William stanley jevons and the paperless office. Human Ecology Review, pages 143–147, 2006.
|
| 470 |
+
Yang You, Igor Gitman, and Boris Ginsburg. Large batch training of convolutional networks. arXiv preprint arXiv:1708.03888, 2017.
|
| 471 |
+
Yang You, Jing Li, Sashank Reddi, Jonathan Hseu, Sanjiv Kumar, Srinadh Bhojanapalli, Xiaodan Song, James Demmel, Kurt Keutzer, and Cho-Jui Hsieh. Large batch optimization for deep learning: Training bert in 76 minutes. In International Conference on Learning Representations, 2019.
|
| 472 |
+
Guodong Zhang, Lala Li, Zachary Nado, James Martens, Sushant Sachdeva, George Dahl, Chris Shallue, and Roger B Grosse. Which algorithmic choices matter at which batch sizes? insights from a noisy quadratic model. In Advances in Neural Information Processing Systems, pages 8196–8207, 2019.
|
| 473 |
+
Yukun Zhu, Ryan Kiros, Rich Zemel, Ruslan Salakhutdinov, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Aligning books and movies: Towards story-like visual explanations by watching movies and reading books. In Proceedings of the 2015 IEEE International Conference on Computer Vision (ICCV), ICCV ’15, page 19–27, USA, 2015. IEEE Computer Society. ISBN 9781467383912. doi: 10.1109/ICCV.2015.11. URL https://doi.org/10.1109/ICCV.2015.11.
|
md/train/O358nrve1W/O358nrve1W.md
ADDED
|
@@ -0,0 +1,397 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# NEURALLY GUIDED GENETIC PROGRAMMING FOR TURING COMPLETE PROGRAMMING BY EXAMPLE
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
The ability to synthesise source code from input/output examples allows nonexperts to generate programs, and experts to abstract away a wide range of simple programming tasks. Current research in this area has explored neural synthesis, SMT solvers, and genetic programming; each of these approaches is limited, however, often using highly specialised target languages for synthesis. In this paper we present a novel hybrid approach using neural networks to guide genetic programming (GP), which allows us to successfully synthesise code from just ten I/O examples in a generalised Turing complete target language, up to and including a sorting algorithm. We show that GP by itself is able to synthesise a set of simple programs, and show which hints (suggested lines of code for inclusion) are of most utility to GP in solving harder problems. Using a form of unstructured curriculum learning, we then demonstrate that neural networks can be used to determine when to make use of these high-utility hints for specific I/O problems and thus enable complex functions to be successfully synthesised. We apply our approach to two different problem sets: common array-to-array programs (including sorting), and a canvas drawing problem set inspired by So & Oh (2018).
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The ability to synthesise source code from examples, in which a source code implementation of a function is created based on one or more demonstrations of input-output mapping, is a fundamental question in machine learning. We specifically study this question in the form of scenarios where large corpora of existing code are not available (e.g., human-written programs in open-source repositories). The immediate applications of this would allow non-programmers to generate programs, or experts to abstract away trivial coding tasks. In addition, from a machine learning perspective, it allows complex functions to be generated in a symbolic and human-readable form – which can be subjected to a wide range of static analysis tools to model generality or correctness.
|
| 12 |
+
|
| 13 |
+
To date this challenge has been studied using neural-network-driven synthesis, genetic programming, and SMT solvers. However, at present these approaches are significantly constrained in the complexity of the target language in which code is synthesised. Neural synthesis for example, such as the DeepCoder architecture (Balog et al., 2017; Zohar & Wolf, 2018), shows success on simple domain-specific languages, but the search space of more realistic Turing-complete languages is vast by comparison and is unlikely to be representable in a neural network on current or near-future hardware. Genetic programming, meanwhile, is limited by our ability to specify a fitness function which can successfully navigate to a solution for a particular problem – in the highly irregular and often flat fitness landscape of program space (Kinnear, 1994; Renzullo et al., 2018). SMT solvers by comparison lack the analytical power to handle loops without human guidance, constraining their applicability (Srivastava et al., 2010a; So & Oh, 2018; Srivastava et al., 2010b).
|
| 14 |
+
|
| 15 |
+
In this paper we examine code synthesis from examples for a Turing-complete language which can be cross-compiled into C/Java. We use just 10 input/output examples to describe each problem for which we need to synthesise a matching function (i.e., providing unsorted and sorted arrays of integers to describe sorting); because our target language yields a total search space size of $\mathrm { \dot { 5 } * 1 0 ^ { 1 1 9 } }$ possible program permutations, scalability of the synthesis technique is crucial. In this context, we use a novel combination of genetic programming (GP) and neural networks (NNs); GP is used to navigate within program space from a given starting point using a general-purpose fitness function, while NN methods are used to provide prediction of high-level features which help guide the GP to higher-probability success areas in which to search. In essence this technique allows the NN to model only highly abstract features of program space, allowing it to scale to vast program search spaces, while the GP can then incrementally traverse program space from an NN-derived starting point to a correct solution. We bootstrap this process by using an unstructured form of curriculum learning, in which successfully-found functions are used as seed programs to generate synthetic corpora on which to train new neural networks, leading to further high-utility source code feature predictions for new problems. Initially this curriculum learning is based on programs that can be successfully found using GP alone with our generic fitness function, which then allows us to synthesise more complex programs using NN inference.
|
| 16 |
+
|
| 17 |
+
Our key results demonstrate that GP is able to solve simple synthesis problems unaided, and that synthetic corpora generated from these problems allow popular neural network architectures to identify high-utility search hints on more complex problems to guide the genetic programming search. In one of our problem sets, this has the effect of allowing the framework to successfully synthesise 7 of the 10 programs that had never been found by GP alone, and among other programs moves success rates from $38 \%$ to $55 \%$ . All of our source code is provided online (pending de-anonymisation).
|
| 18 |
+
|
| 19 |
+
# 2 RELATED WORK
|
| 20 |
+
|
| 21 |
+
Code synthesis from I/O examples has been studied using three major approaches: deductive solvers; neural networks (NNs) with search; and genetic programming (GP). For code synthesis in a Turingcomplete language, deductive solvers have yet been shown to operate well with loop-based flow control operators (although frameworks which manually define any non-linear program flow can yield good performance (So & Oh, 2018)). Neural synthesis, by comparison, is limited by how much of program space for a general-purpose target language can be captured in a NN model, while GP is limited by the difficulty of deriving a fitness function to navigate to a solution (Renzullo et al., 2018). In the remainder of this section we focus on NN and GP approaches in more detail.
|
| 22 |
+
|
| 23 |
+
Neural synthesis Neural synthesis works by training a neural network on a sub-sample of the entirety of program space for the target language (e.g., sampling at a uniform interval or at random). When presented with a new problem as an I/O example, the neural network will then be asked to predict which lines of code (or particular operators) are likely to be present in the solution based on similar I/O transforms observed in the training set from the above sub-sample. The system will then perform an exhaustive search of program space to fill in the remaining (non-predicted) features. Notable examples here include DeepCoder and RobustFill, among others (e.g., Balog et al. (2017); Zohar & Wolf (2018); Devlin et al. (2017); Chen et al. (2019); Singh & Kohli (2017))
|
| 24 |
+
|
| 25 |
+
The key limitation to this approach is that it must be able to train on a detailed enough sub-sample of program space, and store this sample inside a neural network, to make meaningful predictions on program features for unseen problems. While this works for highly simplified languages (DeepCoder, for example, has no loop operators (Balog et al., 2017)), the search space size of a Turingcomplete language is astronomical by comparison. If we consider that the capacity of a feed-forward ReLu neural network to differentiate between classes (in our case programs), termed its VapnikChervonenkis (VC) dimension, at best grows as a linear function of $w * L * l o g ( w )$ where $w$ is the total number of weights and $L$ the number of layers (Bartlett et al., 2019), it is unlikely that a neural network on current hardware would be able to represent a useful sub-sample of possible program permutations yielded by the search space of a general-purpose language.
|
| 26 |
+
|
| 27 |
+
Genetic programming GP relies on iterative travel through program space from a starting point (often an empty program) to the solution, guided by a fitness function (Vanneschi & Poli, 2012; Taleby Ahvanooey et al., 2019). The field has a long history (Forsyth, 1981) but still shows results (Miranda et al., 2019) that are competitive with neural networks (Ain et al., 2020), and an ability to tackle complex problems mixing diverse datatypes (Pantridge & Spector, 2020).
|
| 28 |
+
|
| 29 |
+
Unlike neural synthesis, a GP approach does not need to encode the entirety of program space in a model, and so can in theory work in a scalable fashion on high dimensional search spaces as long as a fitness function is provided which can guide the search incrementally towards a solution. The key problem with GP for code synthesis is that large areas of program space are difficult to navigate, exhibiting large plateaus of neutrality (no behavioural change despite significant code change) and highly irregular responses to code change (jagged fitness landscape) (Renzullo et al., 2018; Kinnear, 1994). A fitness function may also fail to capture higher level properties, for example “all outputs are even” or “all values from the input are repeated in the output”, which may otherwise be identified by a neural network.
|
| 30 |
+
|
| 31 |
+
Combining neural network prediction with genetic programming Given the limitations of both NNs and GP in themselves, we hypothesise that the combination of the two techniques may provide the best features of both while mitigating their respective limitations in the context of code synthesis in a Turing-complete language with a very large program search space.
|
| 32 |
+
|
| 33 |
+
While a NN cannot feasibly model all of program space, and so cannot be expected to predict each line to be synthesised, it does have the potential to predicting a small number of higher-level features which only require a very limited internal model of program space. This can be combined with a GP search process which fixes these lines in place to constrain the search area, and can use this partially-constructed program in combination with one or more generic fitness functions to guide the search to a successful result. We further find that we can use successfully-found programs to generate synthetic training sets for a NN focused on that area of program space, which then leads to further high-value predictions of likely features for more complex programs.
|
| 34 |
+
|
| 35 |
+
# 3 METHODOLOGY
|
| 36 |
+
|
| 37 |
+
Our system accepts up to ten I/O examples from a user and synthesises the source code of a function which converts those inputs to their corresponding outputs. We use 10 examples as a number which a user may be willing to input while representing lower effort than writing the function manually. If our system fails to synthesise source code for a given problem, the user can specify a simpler but related I/O problem; the successful synthesis of this simpler problem can then lead to subsequent success on the more complex problem. As a target programming language for synthesis, we use a Turing-complete language (previously used by the authors of (Wild & Porter, 2019)) which can be cross-compiled directly into C/Java/Python. The language features primitive loop operators, variable declarations, and conditional branch operators; a full listing of its operators is given in appendix A.1.
|
| 38 |
+
|
| 39 |
+
We use a combination of GP guided by NN prediction to approach this problem, and show successful synthesis of a wide range of programs including sorting. In this paper we study three specific parts of the above overall framework: (i) the success rate of GP by itself of finding programs in our problem sets; (ii) the effect of different hints (suggested lines of code) on the success rate of GP; (iii) the ability of a NN to predict high-utility hints, after being trained on a synthetic corpus derived from high-success program finds from the GP alone.
|
| 40 |
+
|
| 41 |
+
In the remainder of this section we describe our problem sets, genetic programming and NN implementations in more detail, then present the set of experiments that we conduct.
|
| 42 |
+
|
| 43 |
+
# 3.1 SPECIFICATION OF PROBLEM
|
| 44 |
+
|
| 45 |
+
We use two different problem sets which represent human-useful programs of the kind that may be input into our system. Our first problem set is array-to-array programs such as extract even numbers, append arrays, or sort. Our second problem set is provided with an image to draw on a canvas and must synthesise the program which draws that image (this problem set is taken from So & Oh (2018)).
|
| 46 |
+
|
| 47 |
+
Each problem within each problem set is presented to the system as a set of 10 IO examples. These are generated for each problem by feeding in 10 inputs and corresponding outputs of the form the problem requires (either a randomly generated input array and integer, or a canvas size). These 10 inputs are randomly generated from a fixed seed, to reduce internal variability between tests, allowing more accurate evaluation of the changes made by alterations to parameters or by guidance to the GP. This is designed to represent an unbiased input set.
|
| 48 |
+
|
| 49 |
+
# 3.2 GENETIC PROGRAMMING
|
| 50 |
+
|
| 51 |
+
Our GP algorithm creates a population of 2,000 programs, each one the result of crossover and mutation from among the 10 highest-ranked parents of the previous generation (or, for the first generation, mutations of the empty program). Each program in a population is then ranked using a general-purpose fitness function which was experimentally found to be good at locating programs from various search space starting points. We integrate novelty search (Lehman & Stanley, 2010; Doncieux et al., 2019) as part of our fitness function to avoid falling into the same local minima repeatedly, which was found to further boost search success. Once all programs have been ranked, a new generation of 2,000 members is then created, repeatedly, until the target program is found or the system reaches a maximum number of generations (3,000) and reports failure.
|
| 52 |
+
|
| 53 |
+
Our fitness function, in detail, is formulated as error ∗ novelty penalty. The value for error is calculated as the number of elements in the output of a candidate function which do not match those expected for the corresponding input; this value is normalised into the range $[ 0 . 0 , - 1 . 0 ]$ by dividing it by the corresponding error which would have been produced by an empty output for that input.
|
| 54 |
+
|
| 55 |
+
The value for novelty penalty is calculated by first extracting the highest-fitness member of a population, and removing all lines of code which do not contribute to its behaviour. This program is stored as a repulsor which indicates how well-explored a given region of program space is. When calculating the fitness of a new program, each repulsor adds a multiplicative value depending on the distance $D$ of that program from the repulsor. $D$ itself is calculated by examining each line in the first program and calculating how far away (in lines of code) the same line is in a second program. Each repulsor adds $m a x ( 0 , 1 - D / 1 5 )$ to novelty penalty, such that multiple repulsors can exist in the same area of program space, leading to stronger avoidance of those areas.
|
| 56 |
+
|
| 57 |
+
For each new generation during the GP search, parents are chosen using tournament selection with tournament size of 10 (Miller & Goldberg, 1995). Crossover occurs by taking the first half of the first parent, and appending the second half of the second parent (syntactically flawed offspring are accepted into the population but receive minimal fitness when evaluated). Following crossover, we apply a single mutation to a program with a probability of 0.35. Following each mutation a random boolean value is selected, and if true another mutation is applied, to a maximum of 8 mutations.
|
| 58 |
+
|
| 59 |
+
Each mutation takes one of the following forms, selected uniformly at random:
|
| 60 |
+
|
| 61 |
+
1. Insert: this inserts a random line from all possible lines available in the language, and will delete last lines of program if program is already at maximum length. It automatically adds an ENDBLOCK operator if a flow-control operator was inserted.
|
| 62 |
+
2. Delete: sets a random line to NO-OP.
|
| 63 |
+
3. Mutate: changes a random operator/parameter on a line, ensuring the line remains valid.
|
| 64 |
+
4. Swap: exchanges position of any two lines of the program.
|
| 65 |
+
|
| 66 |
+
In all of the above, the parameter values relating to $D$ and mutation probabilities were chosen as values found to experimentally work well.
|
| 67 |
+
|
| 68 |
+
# 3.3 NEURAL NETWORK DESIGN
|
| 69 |
+
|
| 70 |
+
While no programs have yet been successfully synthesised by our system, we initially rely on GP as above to locate simpler programs. Once at least one program has been located it is added to our set of successfully found programs $S _ { F }$ . We then augment GP with a neural network which provides hints of one or more likely lines of code for a given unsolved problem, which correspond to likely areas of program space in which the GP will search (rather than the GP starting its search from an empty program). Our NN is trained on a synthesised training set of programs; the programs in this training set are generated at random but must exhibit some of the program features present in programs in $S _ { F }$ . The intuition here is that the neural network will thus learn to recognise which program features are likely to be present for unseen I/O examples, based on program features known to be useful in other programs requested by users, which are then useful to guide the GP search.
|
| 71 |
+
|
| 72 |
+
Each synthesised training corpus based on $S _ { F }$ has 20,000 programs for training and 2,000 for testing. The 20,000 programs are divided into 10,000 which do have a particular program fragment of interest, and 10,000 which do not have that fragment, with the NN trained to determine whether or not a given I/O example is likely to have that fragment in the corresponding implementation program. Each program in each set of 10,000 is assured to be distinct in functionality from every other program in the set, tested on its behaviour with respect to a fixed $1 0 ~ \mathrm { { J / O } }$ examples. Each new program in a training set is generated by selecting uniformly at random two programs already accepted, applying a crossover, then applying between 1 and 8 mutations (as described above in the GP section) while assuring that the fragment of interest still exists.
|
| 73 |
+
|
| 74 |
+
We use a range of NN architectures to study which ones work best in each problem set. Specifically we use a feed-forward NN in both problem sets, as a shared baseline; in our array-to-array problem set we then also use an LSTM-based recurrent network, and in our canvas problem set we use a CNN. The details of all network architectures are described in appendix A.3.
|
| 75 |
+
|
| 76 |
+
# 3.4 EXPERIMENT SETUP
|
| 77 |
+
|
| 78 |
+
We use three different experiments to study each element of our approach. The details of each experiment are given below, while the next section presents the results.
|
| 79 |
+
|
| 80 |
+
Experiment 1: Exhaustive Fragment Evaluation In our first experiment we examine the baseline performance of GP alone on our two problem sets, then study the effect of each possible source code hint that can be given for each problem (in terms of its effect on success rate).
|
| 81 |
+
|
| 82 |
+
For the latter we examine the set of 1 or 2-line code fragments which can be cleanly isolated (with no dependencies) in the ground truth solution to each problem. We then run a GP pass with the code fragment as a forced requirement, such that any program produced by the GP which does not include them automatically receives a penalty fitness of -10,000. Each experiment in this series is repeated 30 times to account for the inherent stochasticity in the GP process.
|
| 83 |
+
|
| 84 |
+
These results demonstrate the kinds of problem that can be solved using GP alone, and the extent to which a GP algorithm can have its probability of finding a solution increased by constraining its sampled programs to contain certain lines of code – which help identify the highest utility hints that a NN can seek to find.
|
| 85 |
+
|
| 86 |
+
Experiment 2: Fragment Recognisability by Neural Network Having established that code fragments can be used to improve GP find rates (including from zero to non-zero find rates), our second experiment studies the use of synthetic NN training corpora based around these fragments – and the extent to which NNs can successfully predict these features in unseen problems to assist GP.
|
| 87 |
+
|
| 88 |
+
For this experiment we need to assume that some programs have already been found by the GP alone, and useful fragments identified, from which to automatically synthesise NN training sets as described above.
|
| 89 |
+
|
| 90 |
+
For our array-to-array problem set, we select all programs which have find rates of $90 \%$ and above using the GP alone from experiment 1. For our canvas problem set, we select the single highest findrate program using the GP alone for each ‘class’ of problem identified by So & Oh (2018) (such as ‘triangles’). These programs represent those which are most likely to have been found first without the aid of the NN. From within the source code of these programs we select a set of individual fragments from which to generate our synthetic NN training corpora. These fragments are chosen using high-utility fragments identified from experiment 1, and augmented with further fragments of interest that were manually chosen to gain a wider coverage of fragment predictability by a NN.
|
| 91 |
+
|
| 92 |
+
Altogether, these experiments indicate how well NNs can predict the presence of different program features based on our synthetic training sets – a mechanism by which the solution to easy (high-findrate) problems can be used to find solutions to hard (low-find-rate) problems.
|
| 93 |
+
|
| 94 |
+
Experiment 3: Success of chosen fragments In the third experiment we test the success of our GP algorithm when guided by NN-predicted source code fragments using the trained NNs from experiment 2, using all problems in each problem set. To do this we apply a simple selection process, choosing uniformly at random from among all fragments which were estimated by an NN to have a probability of $> = 0 . 5$ presence in a program, and provide one such fragment to the GP process. This shows how a full neurally-guided GP process would perform in our end-to-end system.
|
| 95 |
+
|
| 96 |
+
Table 1: Find rates for guided Genetic Programming Algorithm with forced inclusion of code fragments from ground truth. Baseline is unguided GP. Maximum is single best performing fragments. Best operators are those used in the highest-scoring fragment (first if tied) $\mathrm { n } { = } 3 0$ per fragment, percentage success)
|
| 97 |
+
|
| 98 |
+
<table><tr><td>Problem</td><td>Baseline</td><td>Maximum</td><td>Best Operators</td></tr><tr><td>Append</td><td>0%</td><td>27%</td><td>Var=Literal1;Addition</td></tr><tr><td>Cumulative Abs Sum Keep Evens</td><td>0% 0%</td><td>3% 7%</td><td>Loop; Read Var=Literal 2; Make Array</td></tr><tr><td>Retain First Half Reverse</td><td>0% 58%</td><td>13% 80%</td><td>Var=Literal 2; Divide Var=Literal 1; Make Array</td></tr><tr><td>Shift Right</td><td>0%</td><td>13%</td><td>Var=Literal 1; Loop</td></tr><tr><td>Shift Right Lossy Sort (Bubblesort)</td><td>84% 0%</td><td>80% 0%</td><td>Var=Literal 1 (None)</td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>Parallelogram</td><td>7%</td><td>30%</td><td>Var=Literal2; Divide</td></tr><tr><td>Mirrored Hollow Parallelogram</td><td>13%</td><td>60%</td><td>Var=Literal2;Divide</td></tr><tr><td>Hollow Right Triangle</td><td></td><td>90%</td><td></td></tr><tr><td></td><td>87%</td><td></td><td>Var=Literal1; Subtract</td></tr><tr><td>Hollow Mirrored Right Triangle</td><td>63%</td><td>93%</td><td>Var=Literal1; Subtract</td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>Inverted Isosceles Triangle Trapezoid</td><td>46% 7%</td><td>23% 10%</td><td>Var=Literal 2 Var=Literal 1</td></tr></table>
|
| 99 |
+
|
| 100 |
+
# 4 EVALUATION
|
| 101 |
+
|
| 102 |
+
Our evaluation was conducted on Tensorflow 1.14, Python 3.6.9, Java OpenJDK 11.0.6. Our source code will be made available in camera-ready version
|
| 103 |
+
|
| 104 |
+
4.1 EXPERIMENT 1: GP BASELINE AND ITERATIVE REQUIREMENT SEARCH
|
| 105 |
+
|
| 106 |
+
In this experiment we first determine the baseline find rate of the GP with no assistance, and also select a number of problems to study by supplying certain subsets of the lines as guidance to the GP. This is done by fully running $3 0 \mathrm { G P }$ search repeats with each valid (as described above) 2-line fragment from the ground truth. From the first corpus we selected 8 problems, from the second we select 6. From the first corpus we select mostly low-find-rate problems, to study which form of fragments would be useful to provide to achieve success in the GP, while in the second corpus we select a more representative sample, to study how constraint-forcing behaves in general. We select two problems of the same class from the 2nd corpus (right triangles), to ensure that similar fragments provide similar results in similar circumstances (to give confidence in generality of these results). The baseline success, best find rate increase, and best fragment’s operators for selected problems are presented in Table 4.1.
|
| 107 |
+
|
| 108 |
+
Here we clearly see that forcing the inclusion of even the simplest code elements (one or two lines of the ground truth) into the GP’s population allows the GP to find previously unsolvable problems. We can also see that fragments containing arithmetic operators (especially literal assignment) appear to have a stronger influence on success, possibly as they are harder to find, as their effects are far more subtle and complex than, say presence of a loop operator. These should therefore be studied as high-utility candidates for deployment into GP processes we wish to guide in the future.
|
| 109 |
+
|
| 110 |
+
We also note that some examples show a decrease in success rate (e.g. “Shift Right Lossy”). While no fragment reduced find rates to zero, we speculate that in some cases the provision of a fragment places the GP into an area of program space from which it is harder to reach the solution using our general-purpose fitness function (for example, meaning that this point in program space has larger regions of neutral landscape around it which are harder to traverse over).
|
| 111 |
+
|
| 112 |
+
A full breakdown of all baseline GP find rates is presented in Appendix A.4, with fragments and their successes presented in Appendix A.5.
|
| 113 |
+
|
| 114 |
+
<table><tr><td>Fragment</td><td>FFNN</td><td>FFNN Test</td><td>RNN</td><td>RNN Test</td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Add</td><td>58%</td><td>62 %</td><td>58%</td><td>62 %</td></tr><tr><td>+1 Offset Loop</td><td>74 %</td><td>67 %</td><td>71 %</td><td>66 %</td></tr><tr><td>Length -1 Loop</td><td>76 %</td><td>66 %</td><td>77 %</td><td>65 %</td></tr><tr><td>Literal (2)</td><td>76%</td><td>63%</td><td>71 %</td><td>60 %</td></tr><tr><td>Loop</td><td>97 %</td><td>78%</td><td>98 %</td><td>79 %</td></tr><tr><td>Loop+Conditional</td><td>72 %</td><td>62%</td><td>70 %</td><td>59 %</td></tr><tr><td>Loop+Read</td><td>65 %</td><td>61%</td><td>62 %</td><td>58%</td></tr><tr><td>Nonstandard Array</td><td>81%</td><td>68%</td><td>80%</td><td>66 %</td></tr><tr><td>Read</td><td>76%</td><td>63%</td><td>60 %</td><td>58%</td></tr><tr><td>Subtract</td><td>61 %</td><td>56%</td><td>62 %</td><td>56 %</td></tr><tr><td>Average</td><td>74 %</td><td>65 %</td><td>71 %</td><td>63 %</td></tr><tr><td>Fragment</td><td>FFNN</td><td>FFNN Test</td><td>CNN HU</td><td>CNN Test</td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Add</td><td>58 %</td><td>67 %</td><td>78 %</td><td></td></tr><tr><td>Conditional</td><td>61 %</td><td>57 %</td><td></td><td>86 %</td></tr><tr><td>Half</td><td>61 %</td><td></td><td>64 %</td><td>85 %</td></tr><tr><td>Half Loop</td><td></td><td>62 %</td><td>87 %</td><td>87 %</td></tr><tr><td></td><td>65%</td><td>60 %</td><td>82%</td><td>87 %</td></tr><tr><td>Half Loop Depend</td><td>70 %</td><td>59 %</td><td>82 %</td><td>90 %</td></tr><tr><td>Loop Conditional</td><td>64 %</td><td>58 %</td><td>57 %</td><td>85 %</td></tr><tr><td>Loop Draw</td><td>65 %</td><td>58%</td><td>70 %</td><td>85%</td></tr><tr><td>Loop Loop</td><td>73 %</td><td>57 %</td><td>83 %</td><td>75%</td></tr><tr><td>Loop Loop Subtract</td><td>60 %</td><td>55%</td><td>64 %</td><td>77 %</td></tr><tr><td>Draw Draw Average</td><td>52 % 63 %</td><td>52 % 58 %</td><td>74 % 74 %</td><td>71 % 83 %</td></tr></table>
|
| 115 |
+
|
| 116 |
+
Table 2: Percentage accuracy of two neural networks on two corpora, with regards to ability to recognise presence of a code fragment within the source code of the function whose IO mapping they are receiving as feature inputs. First NN architecture is a common FFNN implementation. Accuracy is only that of the NNs which show success on known-ground-truth seed fragments (as described in methodology, others discarded from results). Testing accuracy is accuracy on the 2,000 synthetic testing programs. Full description of fragments in Appendix Tables 24 and 25 $\mathrm { ( n = } 3 0$ )
|
| 117 |
+
|
| 118 |
+
# 4.2 EXPERIMENT 2: FRAGMENT RECOGNISABILITY
|
| 119 |
+
|
| 120 |
+
In this experiment we start with selected high-success seed programs from our first experiment. For array-to-array problems, these are all programs with a $90 \%$ find rate or better via GP alone, while for our canvas drawing problem set, these are the single highest-find-rate program in each category such as ‘triangles’. We then take 10 source code fragments present in these seed programs which exhibit a positive effect of find rates, and use these fragments to generate completely synthetic training corpora for neural networks trained to predict whether or not an I/O example will include a particular fragment in its source code solution.
|
| 121 |
+
|
| 122 |
+
Table 4.2 shows how effective our different trained neural networks architectures are at then correctly predicting the presence of these fragments in the I/O examples from our two problem sets (which are not part of the synthetic training sets).
|
| 123 |
+
|
| 124 |
+
This data show significant variance of prediction success (from $58 \%$ up to $9 7 \%$ ) but overall shows that our neural networks do exhibit the ability to accurately predict that a particular source code fragment will exist in the solution to a given I/O problem – even though these neural networks are trained on entirely synthetic data.
|
| 125 |
+
|
| 126 |
+
Examining the different neural network architectures, our baseline feed-forward NN shows success in both problem sets and so is able to act as a viable generalist model. Our recurrent network, used in the array-to-array corpus, shows prediction success that is generally lower than the feed-forward NN. Our CNN meanwhile, used in our canvas drawing corpus, shows some significant gains in prediction success compared to the feed-forward NN, though also shows some lower results (for example on predicting the presence of a loop with a conditional). This suggests that a mixture-ofexperts approach may be desirable here, but also that a general feed-forward model is viable.
|
| 127 |
+
|
| 128 |
+
In practice we would use these trained networks alongside a threshold of prediction when determining which fragments to recommend for inclusion in a GP search; we present this in the following section.
|
| 129 |
+
|
| 130 |
+
# 4.3 EXPERIMENT 3: CHOSEN FRAGMENT DEPLOYMENT
|
| 131 |
+
|
| 132 |
+
In this experiment, the fragments from the above NN experiments were employed to guide the GP process, based on the average estimates by the trained neural networks. This demonstrates the efficacy of our end-to-end system in taking successfully-found solutions to easy problems and employing their characteristics, via trained NN predictors, to find solutions to more difficult problems.
|
| 133 |
+
|
| 134 |
+
We report the success rates here using two different approaches to selecting fragments for the GP. We do this either using a uniform random choice of fragments which had an average presence probability estimate of $> = 0 . 5$ (termed Uniform); or using a fragment which is predicted for the problem being solved but has the lowest prediction rate across all other problems (which ideally therefore may be the most information bearing fragment). For our array-to-array problem set we use both approaches, while for our canvas problem set we see less clarity in lowest prediction rates across all problems and so only use the uniform random style.
|
| 135 |
+
|
| 136 |
+
<table><tr><td>Corpus And Approach</td><td>Find Rate (vs Baseline)</td><td>Gained</td><td>Lost</td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>1st (1D Arrays), Uniform</td><td>46 % (38%)</td><td>5</td><td>1</td></tr><tr><td>1st (1D Arrays),Rarest Preferred</td><td>55 % (38%)</td><td>7</td><td>0</td></tr><tr><td>2nd (2D Array), Uniform</td><td>39 % (36%)</td><td>4</td><td>1</td></tr></table>
|
| 137 |
+
|
| 138 |
+
Table 3: Success of the GP when guided by the fragments selected by the neural network. ‘Gained’ are problems which have $a > 0 \%$ find rate which have a baseline of $0 \%$ , ‘Lost’ are those which previously had $> 0 \%$ but now have $0 \%$ . $\mathrm { ( n { = } } 3 0$ )
|
| 139 |
+
|
| 140 |
+
As can be seen in Table 4.3, guiding the GP using this process produces notable improvements to the overall program synthesis success rates. Average find rates were boosted, and crucially a number of problems became solvable which were not before, with only a single problem in each problem set failing to be solved. This set of newly-solved problems here includes instance in which the bubblesort algorithm, considered by the authors to be the hardest problem in the set, was successfully found.
|
| 141 |
+
|
| 142 |
+
This improvement was strongest on the approach which selected the estimated-rarest fragment for use, clearly indicating that the fragments are not equivalent in their usefulness. The ideal way in which to extract the most useful fragments for the GP to use, based on those available from NN predictions, therefore remains a topic of future work.
|
| 143 |
+
|
| 144 |
+
The full set of guided GP results is available in detail in Appendix A.7.
|
| 145 |
+
|
| 146 |
+
# 5 CONCLUSION
|
| 147 |
+
|
| 148 |
+
In this paper we have presented a novel combination of genetic programming and neural network prediction to synthesise code from just $1 0 \mathrm { { I / O } }$ examples.
|
| 149 |
+
|
| 150 |
+
Our framework demonstrates the potential to create a system which searches for solutions to problems within a corpus, finds a subset, extracts code fragments from the successes, then trains a neural network to recognise the presence of these fragments and determines which unsolved problems would benefit from NN-guidance – thus boosting GP find rates on a subsequent pass. We demonstrate that this process can render previously unfindable problems findable, and boost overall find rates, including the successful synthesis of bubble sort.
|
| 151 |
+
|
| 152 |
+
Our approach is scalable to the search space of Turing-complete languages, and has been demonstrated to work successfully in at least two distinct domains using a common target language which can be cross-compiled to C/Java.
|
| 153 |
+
|
| 154 |
+
# REFERENCES
|
| 155 |
+
|
| 156 |
+
Qurrat Ul Ain, Harith Al-Sahaf, Bing Xue, and Mengjie Zhang. A genetic programming approach to feature construction for ensemble learning in skin cancer detection. In Proceedings of the 2020 Genetic and Evolutionary Computation Conference, GECCO ’20, pp. 11861194, New York, NY, USA, 2020. Association for Computing Machinery. ISBN 9781450371285. doi: 10.1145/ 3377930.3390228. URL https://doi.org/10.1145/3377930.3390228.
|
| 157 |
+
|
| 158 |
+
Matej Balog, Alexander Gaunt, Marc Brockschmidt, Sebastian Nowozin, and Daniel Tarlow. Deepcoder: Learning to write programs. In Proceedings of ICLR’17, March 2017. URL https://www.microsoft.com/en-us/research/publication/ deepcoder-learning-write-programs/.
|
| 159 |
+
|
| 160 |
+
Peter L. Bartlett, Nick Harvey, Christopher Liaw, and Abbas Mehrabian. Nearly-tight vc-dimension and pseudodimension bounds for piecewise linear neural networks. Journal of Machine Learning Research, 20(63):1–17, 2019. URL http://jmlr.org/papers/v20/17-612.html.
|
| 161 |
+
|
| 162 |
+
X. Chen, C. Liu, and D. Song. Execution-guided neural program synthesis. In ICLR, 2019.
|
| 163 |
+
|
| 164 |
+
Jacob Devlin, Jonathan Uesato, Surya Bhupatiraju, Rishabh Singh, Abdel-rahman Mohamed, and Pushmeet Kohli. Robustfill: Neural program learning under noisy i/o. In Proceedings of the 34th International Conference on Machine Learning - Volume 70, ICML’17, pp. 990998. JMLR.org, 2017.
|
| 165 |
+
|
| 166 |
+
Stephane Doncieux, Alban Laflaquiere, and Alexandre Coninx. Novelty search: A theoretical per- \` spective. In Proceedings of the Genetic and Evolutionary Computation Conference, GECCO ’19, pp. 99106, New York, NY, USA, 2019. Association for Computing Machinery. ISBN 9781450361118. doi: 10.1145/3321707.3321752. URL https://doi.org/10.1145/ 3321707.3321752.
|
| 167 |
+
|
| 168 |
+
Richard Forsyth. BEAGLE a Darwinian approach to pattern recognition. Kybernetes, 10(3): 159–166, 1981. ISSN 0368-492X. doi: doi:10.1108/eb005587. URL http://www. richardsandesforsyth.net/pubs/beagle81.pdf.
|
| 169 |
+
|
| 170 |
+
K. E. Kinnear. Fitness landscapes and difficulty in genetic programming. In Proceedings of the First IEEE Conference on Evolutionary Computation. IEEE World Congress on Computational Intelligence, pp. 142–147 vol.1, 1994.
|
| 171 |
+
|
| 172 |
+
Joel Lehman and Kenneth Stanley. Efficiently evolving programs through the search for novelty. pp. 837–844, 01 2010. doi: 10.1145/1830483.1830638.
|
| 173 |
+
|
| 174 |
+
B. Miller and D. Goldberg. Genetic algorithms, tournament selection, and the effects of noise. Complex Syst., 9, 1995.
|
| 175 |
+
|
| 176 |
+
´Icaro Marcelino Miranda, Claus Aranha, and Marcelo Ladeira. Classification of eeg signals using genetic programming for feature construction. In Proceedings of the Genetic and Evolutionary Computation Conference, GECCO ’19, pp. 12751283, New York, NY, USA, 2019. Association for Computing Machinery. ISBN 9781450361118. doi: 10.1145/3321707.3321737. URL https://doi.org/10.1145/3321707.3321737.
|
| 177 |
+
|
| 178 |
+
Edward Pantridge and Lee Spector. Code building genetic programming. In Proceedings of the 2020 Genetic and Evolutionary Computation Conference, GECCO ’20, pp. 994–1002, 06 2020. doi: 10.1145/3377930.3390239.
|
| 179 |
+
|
| 180 |
+
Joseph Renzullo, Westley Weimer, Melanie Moses, and Stephanie Forrest. Neutrality and epistasis in program space. In Proceedings of the 4th International Workshop on Genetic Improvement Workshop, GI ’18, pp. 18, New York, NY, USA, 2018. Association for Computing Machinery. ISBN 9781450357531. doi: 10.1145/3194810.3194812. URL https://doi.org/10. 1145/3194810.3194812.
|
| 181 |
+
|
| 182 |
+
Rishabh Singh and Pushmeet Kohli. AP: Artificial Programming. Snapl ’17, (16):1–12, 2017. ISSN 18688969. doi: 10.4230/LIPIcs.SNAPL.2017.16.
|
| 183 |
+
|
| 184 |
+
Sunbeom So and Hakjoo Oh. Synthesizing pattern programs from examples. In Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence, IJCAI-18, pp. 1618– 1624. International Joint Conferences on Artificial Intelligence Organization, 7 2018. doi: 10. 24963/ijcai.2018/224. URL https://doi.org/10.24963/ijcai.2018/224.
|
| 185 |
+
|
| 186 |
+
Saurabh Srivastava, Sumit Gulwani, and Jeffrey S. Foster. From program verification to program synthesis. In Proceedings of the 37th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’10, pp. 313326, New York, NY, USA, 2010a. Association for Computing Machinery. ISBN 9781605584799. doi: 10.1145/1706299.1706337. URL https: //doi.org/10.1145/1706299.1706337.
|
| 187 |
+
|
| 188 |
+
Saurabh Srivastava, Sumit Gulwani, and Jeffrey S. Foster. From program verification to program synthesis. SIGPLAN Not., 45(1):313326, January 2010b. ISSN 0362-1340. doi: 10.1145/1707801.1706337. URL https://doi.org/10.1145/1707801.1706337.
|
| 189 |
+
|
| 190 |
+
Milad Taleby Ahvanooey, Qianmu Li, Ming Wu, and Shuo Wang. A survey of genetic programming and its applications. KSII Transactions on Internet and Information Systems, Vol.13:1765–1793, 04 2019. doi: 10.3837/tiis.2019.04.002.
|
| 191 |
+
|
| 192 |
+
Leonardo Vanneschi and Riccardo Poli. Genetic Programming — Introduction, Applications, Theory and Open Issues, pp. 709–739. Springer Berlin Heidelberg, Berlin, Heidelberg, 2012. ISBN 978- 3-540-92910-9. doi: 10.1007/978-3-540-92910-9 24. URL https://doi.org/10.1007/ 978-3-540-92910-9_24.
|
| 193 |
+
|
| 194 |
+
Alexander Wild and Barry Porter. General program synthesis using guided corpus generation and automatic refactoring. In Shiva Nejati and Gregory Gay (eds.), Search-Based Software Engineering, Lecture Notes in Computer Science, pp. 89–104. Springer-Verlag, August 2019. ISBN 9783030274542. doi: 10.1007/978-3-030-27455-9 7.
|
| 195 |
+
|
| 196 |
+
Amit Zohar and Lior Wolf. Automatic program synthesis of long programs with a learned garbage collector. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems 31, pp. 2094–2103. Curran Associates, Inc., 2018.
|
| 197 |
+
|
| 198 |
+
# A APPENDIX
|
| 199 |
+
|
| 200 |
+
# A.1 OPERATORS OF THE LANGUAGE USED
|
| 201 |
+
|
| 202 |
+
Tables A.1 and A.1 provide lists of all the operators used for the two corpora used in the language employed in the experiments. Language variants are improved in order to allow effective processing of the two corpora’s specific problem domains.
|
| 203 |
+
|
| 204 |
+
# Operator
|
| 205 |
+
|
| 206 |
+
Assign Variable To Array
|
| 207 |
+
Assign Variable From Array
|
| 208 |
+
Make Array
|
| 209 |
+
Variable To Literal
|
| 210 |
+
Add
|
| 211 |
+
Subtract
|
| 212 |
+
Multiply
|
| 213 |
+
Divide
|
| 214 |
+
Modulo
|
| 215 |
+
Assign Var from Var
|
| 216 |
+
Loop
|
| 217 |
+
Conditional (var $> 0$ )
|
| 218 |
+
Conditional (var1 $= =$ var2)
|
| 219 |
+
Conditional (var1 $>$ var2)
|
| 220 |
+
|
| 221 |
+
Table 4: Operators available for GP, when using the 1st (array-to-array) corpus
|
| 222 |
+
|
| 223 |
+
# Operator
|
| 224 |
+
|
| 225 |
+
Assign Variable To Array
|
| 226 |
+
Assign Variable From Array
|
| 227 |
+
Make Array
|
| 228 |
+
Variable To Literal
|
| 229 |
+
Add
|
| 230 |
+
Subtract
|
| 231 |
+
Multiply
|
| 232 |
+
Divide
|
| 233 |
+
Modulo
|
| 234 |
+
Assign Var from Var
|
| 235 |
+
Loop
|
| 236 |
+
Conditional (var $> 0$ )
|
| 237 |
+
Conditional $\operatorname { v a r } 1 = = \operatorname { v a r } 2$ )
|
| 238 |
+
Create 2D Array
|
| 239 |
+
Get 2D Array Size
|
| 240 |
+
Var to XY Point from 2D Array
|
| 241 |
+
Set 2D Array to 0 at XY Point
|
| 242 |
+
Set 2D Array to 1 at XY Point
|
| 243 |
+
|
| 244 |
+
Table 5: Operators available for GP, when using the 2nd (2D pattern) corpus
|
| 245 |
+
|
| 246 |
+
A.2 PROBLEMS IN CORPORA
|
| 247 |
+
|
| 248 |
+
Tables 6 and 7 provide a list of all human-provided problems used to test the system across the experiments. These are defined by a source-code implementation in both the custom language used in this paper, as well as in Java. An example of the behaviour of the array-to-array problems (First corpus), has been given, using a fixed sample input, to illustrate the behaviour.
|
| 249 |
+
|
| 250 |
+
<table><tr><td rowspan=1 colspan=6>Problem Example</td></tr><tr><td rowspan=1 colspan=5>CumulativeAbsoluteSum [4, -2,1,0,3,-5] - > [4,6,7,7,10,15]</td><td></td></tr><tr><td rowspan=1 colspan=5>CumulativeSum [4,-2,1,0,3,-5] - > [4,2,3,3,6,1]</td><td></td></tr><tr><td rowspan=1 colspan=5>DivergentSequence [4,-2,1,0,3,-5] − >[0,0,1,-1,2,-2]</td><td></td></tr><tr><td rowspan=1 colspan=5>FirstElementOnly [4,-2,1,0,3,-5] - >[4]</td><td></td></tr><tr><td rowspan=1 colspan=5>Identity [4,-2,1,0,3,-5] − > [4,-2,1,0,3,-5]</td><td></td></tr><tr><td rowspan=1 colspan=1>IndexParity</td><td rowspan=1 colspan=4>[4,-2,1,0,3,-5]- ></td><td></td></tr><tr><td rowspan=1 colspan=1>IterativeDifference</td><td rowspan=1 colspan=4>[4,-2,1,0,3,-5] - >[4,-6,3,-1,3,-8]</td><td></td></tr><tr><td rowspan=1 colspan=1>KeepEvens</td><td rowspan=1 colspan=4>[4,-2,1,0,3,-5]- ></td><td></td></tr><tr><td rowspan=1 colspan=1>KeepNegatives</td><td rowspan=1 colspan=4>[4,-2,1,0,3,-5] - > [0, -2,0,0, 0, -5]</td><td></td></tr><tr><td rowspan=1 colspan=1>KeepOdds</td><td rowspan=1 colspan=4>[4,-2,1,0,3,-5]- ></td><td></td></tr><tr><td rowspan=1 colspan=1>KeepPositives</td><td rowspan=1 colspan=4>[4,-2,1,0,3,-5] - >[4,0,1,0,3,0]]</td><td></td></tr><tr><td rowspan=1 colspan=1>Negative</td><td rowspan=1 colspan=4>[4,-2,1,0,3,-5]-></td><td></td></tr><tr><td rowspan=1 colspan=1>Pop</td><td rowspan=1 colspan=1>[4, -2,1,0</td><td rowspan=1 colspan=3>3,-5]-></td><td></td></tr><tr><td rowspan=1 colspan=1>RemoveFirstElement</td><td rowspan=1 colspan=1>[4,-2,1,0</td><td rowspan=1 colspan=1>3,</td><td rowspan=1 colspan=2>-5]-></td><td rowspan=1 colspan=1>[-2,1,0,3,-5]</td></tr><tr><td rowspan=1 colspan=1>RetainFirstHalf</td><td rowspan=1 colspan=1>[4,-2,1,0</td><td rowspan=1 colspan=3>3,-5]-></td><td rowspan=1 colspan=1>[4,-2,1]</td></tr><tr><td rowspan=1 colspan=1>Reverse</td><td rowspan=1 colspan=1>[4,-2.1,0</td><td rowspan=1 colspan=3>3,-5]-></td><td></td></tr><tr><td rowspan=1 colspan=1>ShiftLeft</td><td rowspan=1 colspan=1>[4,-2,1,0</td><td rowspan=1 colspan=1>3,</td><td rowspan=1 colspan=2>-5-></td><td rowspan=1 colspan=1>[-2,1,0,3,-5]</td></tr><tr><td rowspan=1 colspan=1>ShiftLeftZeroPadded</td><td rowspan=1 colspan=1>[4,-2,1,0</td><td rowspan=1 colspan=1>3,</td><td rowspan=1 colspan=2>-5]-></td><td></td></tr><tr><td rowspan=1 colspan=1>ShiftRight</td><td rowspan=1 colspan=1>[4,-2,1,0</td><td rowspan=1 colspan=1>3,</td><td rowspan=1 colspan=2>-5]-></td><td></td></tr><tr><td rowspan=1 colspan=1>ShiftRightLossy</td><td rowspan=1 colspan=1>[4,-2,1,0</td><td rowspan=1 colspan=1>3,</td><td rowspan=1 colspan=2>-5]-></td><td></td></tr><tr><td rowspan=1 colspan=1>ShuffleZerosToBack</td><td rowspan=1 colspan=1>[4,-2,1,0</td><td rowspan=1 colspan=1>3,</td><td rowspan=1 colspan=2>-5]-></td><td></td></tr><tr><td rowspan=1 colspan=1>Signum</td><td rowspan=1 colspan=2>[4,-2,1,0,3,</td><td rowspan=1 colspan=2>-5]-></td><td></td></tr><tr><td rowspan=1 colspan=1>Sort</td><td rowspan=1 colspan=2>[4,-2,1,0,3,</td><td rowspan=1 colspan=2>-5]-></td><td></td></tr><tr><td rowspan=1 colspan=1>SquareValues</td><td rowspan=1 colspan=2>[4, -2,1,0, 3,</td><td rowspan=1 colspan=2>-5]-></td><td rowspan=2 colspan=1>[16,4,1,0,9,25]</td></tr><tr><td rowspan=1 colspan=1>ToIterator</td><td rowspan=1 colspan=1>[4,-2,1,0</td><td rowspan=1 colspan=1>3,</td><td rowspan=1 colspan=2>-5]-></td></tr><tr><td rowspan=1 colspan=1>Add</td><td rowspan=1 colspan=1>[4,-2,1,0</td><td rowspan=1 colspan=1>3,</td><td rowspan=1 colspan=2>-5],4</td><td rowspan=2 colspan=1>[4,-2,1,0,3,-5],4- >[4,-2,1,0,3,-5,4]</td></tr><tr><td rowspan=1 colspan=1>Append</td><td rowspan=1 colspan=1>[4,-2,1,0</td><td rowspan=1 colspan=1>3,</td><td rowspan=1 colspan=2>-5],4-</td></tr><tr><td rowspan=1 colspan=1>ClipToMax</td><td rowspan=1 colspan=1>[4,-2,1,0</td><td rowspan=1 colspan=1>3,</td><td rowspan=1 colspan=2>-5],4-</td><td rowspan=1 colspan=1>>[4,-2,1,0,3,-5]</td></tr><tr><td rowspan=1 colspan=1>ClipToMin</td><td rowspan=1 colspan=4>[4,-2,1,0,3,-5],4-</td><td rowspan=3 colspan=1>[4,-2,1,0,3,-5],4- >[4,2,9,12,19,15]</td></tr><tr><td rowspan=1 colspan=1>ConstantAddition</td><td rowspan=1 colspan=4>[4,-2,1,0,3,-5],4</td></tr><tr><td rowspan=1 colspan=1>FillArray</td><td rowspan=1 colspan=4>[4,-2,1,0,3,-5],4-</td></tr><tr><td rowspan=1 colspan=1>GreaterThan</td><td rowspan=1 colspan=3>[4,-2,1,0,3,-5</td><td rowspan=1 colspan=1>,41</td><td rowspan=1 colspan=1>>[-1,-1,-1,-1,-1,-1]</td></tr><tr><td rowspan=1 colspan=1>IterateFromStart</td><td rowspan=1 colspan=3>[4,-2,1,0,3,-5</td><td rowspan=1 colspan=1>,41</td><td rowspan=1 colspan=1>V</td></tr><tr><td rowspan=1 colspan=1>LessThan</td><td rowspan=1 colspan=3>[4,-2,1,0,3,-5</td><td rowspan=1 colspan=1>,41</td><td rowspan=1 colspan=1>V</td></tr><tr><td rowspan=1 colspan=1>MultiplesOf</td><td rowspan=1 colspan=2>[4,-2,1,0,3,</td><td rowspan=1 colspan=1>-5]</td><td rowspan=1 colspan=1>,41V</td><td></td></tr><tr><td rowspan=1 colspan=1>Multiply</td><td rowspan=1 colspan=2>[4,-2,1,0,3,</td><td rowspan=1 colspan=1>-5]</td><td rowspan=1 colspan=1>,41V</td><td rowspan=1 colspan=1>[16,-8,4,0,12,-20]</td></tr><tr><td rowspan=1 colspan=1>Subtract</td><td rowspan=1 colspan=4>[4,-2,1,0,3,-5],4- >[0,-6,-3,-4,-1,-9]</td><td rowspan=1 colspan=1>[0,-6,-3,-4, -1, -9]</td></tr></table>
|
| 251 |
+
|
| 252 |
+
Table 6: The first corpus of problems, taking either a single array, or an array and an integer. Example provided of the behaviour of each problem, given a standard example input.
|
| 253 |
+
|
| 254 |
+
# Problem
|
| 255 |
+
|
| 256 |
+
Square
|
| 257 |
+
HollowSquare
|
| 258 |
+
Parallelogram
|
| 259 |
+
HollowParallelogram
|
| 260 |
+
MirroredParallelogram
|
| 261 |
+
MirroredHollowParallelogram
|
| 262 |
+
RightTriangle
|
| 263 |
+
HollowRightTriangle
|
| 264 |
+
MirroredRightTriangle
|
| 265 |
+
HollowMirroredRightTriangle
|
| 266 |
+
InvertedRightTriangle
|
| 267 |
+
HollowInvertedRightTriangle
|
| 268 |
+
InvertedMirroredRightTriangle
|
| 269 |
+
InvertedHollowMirroredRightTriangle
|
| 270 |
+
IsoceleseTriangle
|
| 271 |
+
HollowIsoceleseTriangle
|
| 272 |
+
InvertedIsoceleseTriangle
|
| 273 |
+
HollowInvertedIsoceleseTriangle
|
| 274 |
+
RectangleWithEmptyTrapezoid
|
| 275 |
+
InvertedRectangle
|
| 276 |
+
obtuseTriangle
|
| 277 |
+
hollowObtuseTriangle
|
| 278 |
+
mirroredObtuseTriangle
|
| 279 |
+
mirroredHollowObtuseTriangle
|
| 280 |
+
invertedObtuseTriangle
|
| 281 |
+
hollowInvertedObtuseTriangle
|
| 282 |
+
invertedMirroredObtuseTriangle
|
| 283 |
+
hollowMirroredInvertedObtuseTriangle
|
| 284 |
+
VShape
|
| 285 |
+
Trapezoid
|
| 286 |
+
|
| 287 |
+
Table 7: The second corpus, a set of 2D image generation tasks, drawing simple geometric shapes.
|
| 288 |
+
|
| 289 |
+
# A.3 NEURAL NETWORK ARCHITECTURES
|
| 290 |
+
|
| 291 |
+
Feed Forward Neural Network The FFNN is a 5 layer structure with 128 nodes per layer, seLu activation. Each layer is connected to all layers below (dense block). Each layer other than the last has a dropout component, with a training dropout rate of $p K e e p = 0 . 7 5$ . The output is a single sigmoidal unit, loss function is mean squared error. Batch size of 32, maximum steps of 512, early stopping after 12 non-progress epochs on validation loss.
|
| 292 |
+
|
| 293 |
+
Recurrent Neural Network The RNN encodes both the input and output arrays in two architecturally symmetric branches for every example (so 20 branches). Each branch begins by encoding the values in 2 dense layers with 11 nodes, reLu activation, with dropout with $p K e e p = 0 . 7 5$ after each. After this encoding layer, a layer of 8 LSTM nodes was connected. These LSTM layers represented the end of the two branches. All LSTM outputs are concatenated, along with the input parameters, into a single representation of the IO examples. These are then processed by a set of 2 dense layers with 64 nodes, reLu activation. The output is a single sigmoidal unit, loss function is mean squared error. Batch size of 32, maximum steps of 512, early stopping after 12 non-progress epochs on validation loss.
|
| 294 |
+
|
| 295 |
+
Convolutional Neural Network Each of the 10 examples of problem output are split into their own branch. Each branch contains a 2D input with width/height equal to the maximum input size, 32. We feed this into a 2D convolutional layer, with stride of 2 and kernel size of 3, reLu activation. We then feed this into a max pooling layer of 2 by 2. We then feed through a second convolutional layer of identical configuration to the first, and a second max pooling layer, again identical. Each branch then terminates in a single dense layer, 64 nodes, reLu activation. All branches are then concatenated into a single dense layer, 64 nodes, reLu activation. The output is a single sigmoidal unit, loss function is mean squared error. Batch size of 32, maximum steps of 512, early stopping after 12 non-progress epochs on validation loss.
|
| 296 |
+
|
| 297 |
+
# A.4 PROBLEM FIND RATES AND DESCRIPTIONS
|
| 298 |
+
|
| 299 |
+
The tables89 are the find rates for the genetic programming algorithm, without any constraints. Note the high degree of variability between problems, with a number from both corpora achieving either a $100 \%$ success rate of a $0 \%$ .
|
| 300 |
+
|
| 301 |
+
One remark is that the “Square” problem, which simply requires the entire canvas to be covered (therefore requiring two loops and a write), did not achieve $100 \%$ success. This is believed to be due to the genetic algorithm starting with a flawed partial solution, and being unable to move away from this detrimental start due to the nature of the fitness landscape (trapped in local maximum).
|
| 302 |
+
|
| 303 |
+
# A.5 FULL BREAKDOWN OF FRAGMENTS EVALUATED IN EXPERIMENT 1
|
| 304 |
+
|
| 305 |
+
Tables 10 to 23 describe each fragment evaluated by the exhaustive fragment testing process. Each fragment is at most two lines, and has no variables which depend on being set in lines outside the fragment (therefore the fragment stands alone in terms of functionality). The source code of the ground-truth implementation is given, firstly as simply the operator used on that line, and secondly in a C-like fashion (excluding braces). This C-like fashion is a programmatically generated translation of the source code of the custom language implementation, provided for ease of readability (due to the difficult-to-parse structure of the custom language). We then refer to the lines in this source code by line number. Fragments cannot contain end-of-block operators (used to indicate the end point of blocks started by the flow-control operators loop and conditional), nor can they contain the initial definition of the 2D canvas.
|
| 306 |
+
|
| 307 |
+
# A.6 FRAGMENTS EVALUATED FOR NN RECOGNISABILITY IN EXPERIMENT 2
|
| 308 |
+
|
| 309 |
+
The tables2425 describe the fragments (some of which contain requirements about variable dependencies) used in experiment 2.
|
| 310 |
+
|
| 311 |
+
# A.7 FULL RESULTS OF NN-SELECTED GUIDANCE FOR GP FROM EXPERIMENT 3
|
| 312 |
+
|
| 313 |
+
Tables 26,27,28 shows the success rate of the GP, if provided with hints by the neural network sets. Two sets of experiments are done on the array to array corpus, one on the canvas corpus. Most problems showed a success increase, including a number from both corpora which increased in success chance from $0 \%$ to a non-zero value. Two problems were made unfindable by the lesseffective uniform fragment selection process, Iterative Difference and Trapezoid. As the baseline find rate was low, this does not represent a major drop in success, and may potentially simply be due to insufficient samples to determine the true success probability. We do not however reject the possibility that our approach has a negative effect on find-rates for certain problems. It was seen in Experiment 1 that some fragments, known to be present in the ground-truth implementation, decreased find-rates. It is possible that the neural networks correctly identified fragment presence, but that these degraded the GP’s performance. It is, of course, also possible that the NN incorrectly estimated that a fragment was present when it was not, and that this erroneous hint harmed the GP.
|
| 314 |
+
|
| 315 |
+
Table 8: Find rates for a Genetic Algorithm as implemented above on the problems of the first corpus, a set of functions which take an input array of integers only (functions above dividing line) or an input array of integers and an integer. Both forms return a single array. $\scriptstyle \mathrm { n = } 3 0$
|
| 316 |
+
|
| 317 |
+
<table><tr><td>Abs</td><td>8%</td></tr><tr><td>ArrayLength</td><td>100 %</td></tr><tr><td>ArrayToZero</td><td>100 %</td></tr><tr><td>CumulativeAbsoluteSum</td><td>0%</td></tr><tr><td>CumulativeSum</td><td>4%</td></tr><tr><td>DivergentSequence</td><td>58%</td></tr><tr><td>FirstElementOnly</td><td>28 %</td></tr><tr><td>Identity</td><td>100 %</td></tr><tr><td>IndexParity</td><td>100 %</td></tr><tr><td>IterativeDifference</td><td>4%</td></tr><tr><td>KeepEvens</td><td>0%</td></tr><tr><td>KeepNegatives</td><td>0%</td></tr><tr><td>KeepOdds</td><td>0%</td></tr><tr><td>KeepPositives</td><td>60 %</td></tr><tr><td>Negative</td><td>68 %</td></tr><tr><td>Pop</td><td>30%</td></tr><tr><td>RemoveFirstElement</td><td>10 %</td></tr><tr><td>RetainFirstHalf</td><td>0%</td></tr><tr><td>Reverse</td><td>58%</td></tr><tr><td>ShiftLeft</td><td>10 %</td></tr><tr><td>ShiftLeftZeroPadded</td><td>40%</td></tr><tr><td>ShiftRight</td><td>0%</td></tr><tr><td>ShiftRightLossy</td><td>84 %</td></tr><tr><td>ShuffleZerosToBack</td><td>100 %</td></tr><tr><td>Signum</td><td>0%</td></tr><tr><td>Sort</td><td>0%</td></tr><tr><td>SquareValues ToIterator</td><td>70 %</td></tr><tr><td></td><td>100 %</td></tr><tr><td>Add</td><td>24 %</td></tr><tr><td>Append</td><td>0%</td></tr><tr><td>ClipToMax</td><td>18 %</td></tr><tr><td>ClipToMin</td><td>4%</td></tr><tr><td>ConstantAddition</td><td>0%</td></tr><tr><td>FillArray</td><td>100 %</td></tr><tr><td>GreaterThan</td><td>10 %</td></tr><tr><td>IterateFromStart</td><td>98 %</td></tr><tr><td>LessThan</td><td>8%</td></tr><tr><td>MultiplesOf</td><td>90 %</td></tr><tr><td>Multiply</td><td>20 %</td></tr><tr><td>Subtract</td><td></td></tr><tr><td></td><td>18 %</td></tr></table>
|
| 318 |
+
|
| 319 |
+
Square 97 % Hollow Square 100 % Parallelogram 0 % Hollow Parallelogram 0 % Mirrored Parallelogram 7 % Mirrored Hollow Parallelogram 13 % Right Triangle 97 % Hollow Right Triangle 87 % Mirrored Right Triangle 60 % Hollow Mirrored Right Triangle 63 % Inverted Right Triangle 60 % Hollow Inverted Right Triangle 83 % Inverted Mirrored Right Triangle 100 % Inverted Hollow Mirrored Right Triangle 100 % Isocelese Triangle 0 % Hollow Isocelese Triangle 13 % Inverted Isocelese Triangle 47 % Hollow Inverted Isocelese Triangle $50 \%$ Rectangle With Empty Trapezoid 3 % Inverted Rectangle With Empty Trapezoid 3 % Obtuse Triangle $3 \%$ Hollow Obtuse Triangle $27 \%$ Mirrored Obtuse Triangle $0 \%$ Mirrored Hollow Obtuse Triangle $0 \%$ Inverted Obtuse Triangle $0 \%$ Hollow Inverted Obtuse Triangle $10 \%$ Inverted Mirrored Obtuse Triangle $0 \%$ Hollow Mirrored Inverted Obtuse Triangle $3 \%$ V Shape $47 \%$ Trapezoid 7 %
|
| 320 |
+
|
| 321 |
+
Table 10: Fragments assessed from program “Append”. Program’s code listed, in C-like format, with operators listed ahead of each line for each of readability. Fragments then described, in reference to lines used followed by success rate using fragment as GP guidance $\mathrm { ( n = } 3 0$ )
|
| 322 |
+
|
| 323 |
+
<table><tr><td>1 2 Add 3 4 5 Read 6 7 8</td><td>Literal Make Array Loop Write Endloop Write</td><td>variables[6] = 1; variables[7]= variables[O] + variables[6]; arrays[1]= new int[vars[7]] for(variables[2]=O;variables[2]<variables[O];variables[2]++) variables[5]=arrays[O][variables[2]]; arrays[1][variables[2]]=variables[5];</td></tr><tr><td>3%</td><td colspan="2">Fragment Success Rate</td></tr><tr><td>1</td><td colspan="2"></td></tr><tr><td>1,2</td><td colspan="2">27%</td></tr><tr><td>1,4</td><td colspan="2">10%</td></tr><tr><td>4</td><td colspan="2">0%</td></tr><tr><td>4,5</td><td colspan="2">0%</td></tr><tr><td>4,6</td><td colspan="2">0%</td></tr><tr><td>4,8</td><td colspan="2">0%</td></tr></table>
|
| 324 |
+
|
| 325 |
+
# Fragment Success Rate
|
| 326 |
+
|
| 327 |
+
Table 11: Fragments assessed from program “Cumulative Absolute Sum”. Program’s code listed, in C-like format, with operators listed ahead of each line for each of readability. Fragments then described, in reference to lines used followed by success rate using fragment as GP guidance $\mathrm { ( n = } 3 0$ )
|
| 328 |
+
|
| 329 |
+
<table><tr><td>1</td><td>Make Array</td><td>arrays[1] =new int[vars[O]]</td></tr><tr><td>2</td><td>Loop</td><td>for(variables[2]=O;variables[2]<variables[O];variables[2]++)</td></tr><tr><td>3</td><td>Literal</td><td>variables[5] = -1;</td></tr><tr><td>4</td><td>Read</td><td>variables[3]=arrays[O][variables[2]];</td></tr><tr><td>5</td><td>Condition</td><td>if (variables[3]>0)</td></tr><tr><td>6</td><td>Else</td><td>else</td></tr><tr><td>7</td><td>Multiply</td><td>variables[3] = variables[3] * variables[5];</td></tr><tr><td>8</td><td>Endloop</td><td></td></tr><tr><td>9 10</td><td>Add</td><td>variables[4]= variables[4]+ variables[3];</td></tr><tr><td></td><td>Write</td><td>arrays[1][variables[2]]=variables[4];</td></tr><tr><td>11</td><td>Endloop</td><td></td></tr></table>
|
| 330 |
+
|
| 331 |
+
Table 12: Fragments assessed from program “Keep Evens”. Program’s code listed, in C-like format, with operators listed ahead of each line for each of readability. Fragments then described, in reference to lines used followed by success rate using fragment as GP guidance $\mathrm { ( n = } 3 0$ )
|
| 332 |
+
|
| 333 |
+
<table><tr><td>Line</td><td>Operator</td><td>As Code</td></tr><tr><td>1 23</td><td>Literal Make Array Loop</td><td>variables[4] = 2; arrays[1] = new int[vars[O]] for (variables[2]=O;variables[2]<variables[O];variables[2]++)</td></tr><tr><td>5 Modulo 6 Condition 7 Write 8 Endloop</td><td>Read Endloop</td><td>variables[3]=arrays[O][variables[2]]; variables[5]=variables[3] % variables[4]; if (variables[5]==variables[6]) arrays[1][variables[2]]= variables[3];</td></tr><tr><td>9</td><td colspan="2"></td></tr><tr><td>Fragment</td><td>Success Rate</td><td></td></tr><tr><td>1 1,2 1,3 1,5</td><td>0% 6% 3% 3% 3%</td><td></td></tr></table>
|
| 334 |
+
|
| 335 |
+
Table 13: Fragments assessed from program “Retain First Half”. Program’s code listed, in C-like format, with operators listed ahead of each line for each of readability. Fragments then described, in reference to lines used followed by success rate using fragment as GP guidance $\mathrm { ( n = } 3 0$ )
|
| 336 |
+
|
| 337 |
+
<table><tr><td>Line</td><td>Operator</td><td>As Code</td></tr><tr><td>Literal</td><td rowspan="3">variables[6] = 2;</td><td></td></tr><tr><td>1</td><td>Divide variables[3]= variables[O]/variables[6];</td></tr><tr><td></td><td>arrays[1]=new int[vars[3]]</td></tr><tr><td>234</td><td>Make Array Loop</td><td rowspan="3">for (variables[2]=O;variables[2]<variables[3];variables[2]++) variables[5]=arrays[O][variables[2]];</td></tr><tr><td>5</td><td>Read</td></tr><tr><td>6</td><td>Write</td></tr><tr><td>7</td><td>Endloop</td><td>arrays[1][variables[2]]=variables[5];</td></tr><tr><td colspan="3">Fragment Success Rate</td></tr><tr><td>1 0%</td><td colspan="3"></td></tr><tr><td>1,2</td><td colspan="3"></td></tr><tr><td></td><td colspan="3">13%</td></tr></table>
|
| 338 |
+
|
| 339 |
+
Table 14: Fragments assessed from program “Reverse”. Program’s code listed, in C-like format, with operators listed ahead of each line for each of readability. Fragments then described, in reference to lines used followed by success rate using fragment as GP guidance $\mathrm { ( n = } 3 0$ )
|
| 340 |
+
|
| 341 |
+
<table><tr><td>Line</td><td colspan="2">Operator As Code</td></tr><tr><td>1</td><td>Literal</td><td>variables[7] = 2;</td></tr><tr><td>2</td><td>Make Array</td><td>arrays[1] = new int[vars[O]]</td></tr><tr><td>3</td><td>Loop</td><td>for (variables[2]=O;variables[2]ivariables[O];variables[2]++)</td></tr><tr><td>4</td><td>Subtract</td><td>variables[6] = variables[O] - variables[2];</td></tr><tr><td>5</td><td>Subtract</td><td>variables[6]= variables[6] - variables[7];</td></tr><tr><td>6</td><td>Read</td><td>variables[5]=arrays[O][variables[6]];</td></tr><tr><td>7</td><td>Write</td><td>arrays[1][variables[2]]=variables[5];</td></tr><tr><td>8</td><td>Endloop</td><td></td></tr><tr><td>Fragment Success Rate</td><td colspan="2">63%</td></tr><tr><td>1</td><td colspan="2"></td></tr><tr><td></td><td colspan="2">80%</td></tr><tr><td>1,2</td><td colspan="2">77%</td></tr><tr><td>1,3</td><td colspan="2">73%</td></tr><tr><td>2</td><td colspan="2"></td></tr><tr><td>2,3</td><td colspan="2">60%</td></tr><tr><td>3</td><td colspan="2">63%</td></tr><tr><td>3,4</td><td colspan="2">80%</td></tr><tr><td>3,7</td><td colspan="2">77%</td></tr></table>
|
| 342 |
+
|
| 343 |
+
Table 15: Fragments assessed from program “Shift Right”. Program’s code listed, in C-like format, with operators listed ahead of each line for each of readability. Fragments then described, in reference to lines used followed by success rate using fragment as GP guidance $\mathrm { ( n = } 3 0$ )
|
| 344 |
+
|
| 345 |
+
<table><tr><td>1 23 4 5 6 7 8</td><td>Literal Add Make Array Loop Add Read Write Endloop</td><td>variables[6] = 1; variables[8]= variables[O] + variables[6]; arrays[1]= new int[vars[8]] for (variables[2]=O;variables[2]<variables[O];variables[2]++) variables[7]= variables[2] + variables[6]; variables[5]= arrays[O][variables[2]]; arrays[1][variables[7]]= variables[5];</td></tr><tr><td colspan="2">1 3%</td><td></td></tr><tr><td>1,2 13%</td><td colspan="2"></td></tr><tr><td>1,4</td><td colspan="2">20%</td></tr><tr><td></td><td colspan="2">0%</td></tr><tr><td>4</td><td colspan="2">0%</td></tr><tr><td>4,6</td><td colspan="2"></td></tr></table>
|
| 346 |
+
|
| 347 |
+
Table 16: Fragments assessed from program “Shift Right Lossy”. Program’s code listed, in C-like format, with operators listed ahead of each line for each of readability. Fragments then described, in reference to lines used followed by success rate using fragment as GP guidance $\mathrm { ( n = } 3 0$ )
|
| 348 |
+
|
| 349 |
+
<table><tr><td colspan="3">variables[6]= 2; 2 Add variables[8]= variables[O] + variables[6]; 3 Make Array arrays[1]= new int[vars[O]] 4 Subtract variables[9]= variables[O]-variables[6]; 5 Loop for (variables[2]=O;variables[2]ivariables[9];variables[2]++) 6 Add variables[7]= variables[2]+ variables[6]; 7 Read variables[5] =arrays[O][variables[2]]; 8 Write arrays[1][variables[7]]= variables[5]; 9 Endloop</td></tr><tr><td colspan="3">Fragment Success Rate</td></tr><tr><td>1 80%</td><td colspan="3"></td></tr><tr><td>1,2</td><td colspan="3">73%</td></tr><tr><td>1,3</td><td colspan="3">63%</td></tr><tr><td>1,4</td><td colspan="3">63%</td></tr><tr><td>3</td><td colspan="3">67%</td></tr><tr><td></td><td colspan="3"></td></tr></table>
|
| 350 |
+
|
| 351 |
+
# Fragment Success Rate
|
| 352 |
+
|
| 353 |
+
Table 17: Fragments assessed from program “Sort”. Program’s code listed, in C-like format, with operators listed ahead of each line for each of readability. Fragments then described, in reference to lines used followed by success rate using fragment as GP guidance $\mathrm { ( n = } 3 0$ )
|
| 354 |
+
|
| 355 |
+
<table><tr><td>1</td><td>Literal</td><td>variables[5] =1;</td></tr><tr><td>2</td><td>Subtract</td><td>variables[1]= variables[O]-variables[5];</td></tr><tr><td>3</td><td>Loop</td><td>for (variables[2]=O;variables[2]<variables[O];variables[2]++)</td></tr><tr><td>4</td><td>Loop</td><td>for (variables[3]=O;variables[3]<variables[1];variables[3]++)</td></tr><tr><td>5</td><td>Add</td><td>variables[6] = variables[3]+ variables[5];</td></tr><tr><td>6</td><td>Read</td><td>variables[4] =arrays[O][variables[3]];</td></tr><tr><td>7</td><td>Read</td><td>variables[7]=arrays[O][variables[6]];</td></tr><tr><td>8</td><td>Subtract</td><td>variables[8] = variables[4] - variables[7];</td></tr><tr><td>9</td><td>Condition</td><td>if (variables[8]>0)</td></tr><tr><td>10</td><td>Write</td><td>arrays[O][variables[6]]= variables[4];</td></tr><tr><td>11</td><td>Write</td><td>arrays[O][variables[3]]= variables[7];</td></tr><tr><td>12</td><td>Endloop</td><td></td></tr><tr><td>13</td><td>Endloop</td><td></td></tr><tr><td>14</td><td>Endloop</td><td></td></tr><tr><td>15</td><td>Make Array</td><td>arrays[1] =new int[vars[O]]</td></tr><tr><td>16</td><td>Loop</td><td>for (variables[2]=O;variables[2]<variables[O];variables[2]++)</td></tr><tr><td>17</td><td>Read Write</td><td>variables[5]=arrays[O][variables[2]];</td></tr><tr><td>18</td><td></td><td>arrays[1][variables[2]]=variables[5];</td></tr><tr><td>19</td><td>Endloop</td><td></td></tr></table>
|
| 356 |
+
|
| 357 |
+
Table 18: Fragments assessed from program “Mirrored Parallelogram”. Program’s code listed, in C-like format, with operators listed ahead of each line for each of readability. Fragments then described, in reference to lines used followed by success rate using fragment as GP guidance $\mathrm { ( n = } 3 0$ )
|
| 358 |
+
|
| 359 |
+
<table><tr><td>Line</td><td>Operator</td><td>As Code</td></tr><tr><td>1</td><td>Make 2D Array</td><td>new 2DArray(size=variables[O]);</td></tr><tr><td>2</td><td>Literal</td><td>variables[6] = 2;</td></tr><tr><td>3</td><td>Divide</td><td>variables[4]= variables[O]/variables[6];</td></tr><tr><td>4</td><td>Loop</td><td>for (variables[2]=O;variables[2]<variables[4];variables[2]++)</td></tr><tr><td>5</td><td>Loop</td><td>for (variables[3]=O;variables[3]<variables[4];variables[3]++)</td></tr><tr><td>6</td><td>Add</td><td>variables[7]= variables[2] +variables[3];</td></tr><tr><td>7</td><td>Write to 2D</td><td>array[variables[7][variables[3]]=1;</td></tr><tr><td>8 9</td><td>Endloop</td><td></td></tr><tr><td></td><td>Endloop</td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td>Fragment</td><td>Success Rate</td><td></td></tr><tr><td>2</td><td>23%</td><td></td></tr><tr><td>2,3</td><td></td><td></td></tr><tr><td></td><td>30%</td><td></td></tr></table>
|
| 360 |
+
|
| 361 |
+
Table 19: Fragments assessed from program “Mirrored Hollow Parallelogram”. Program’s code listed, in C-like format, with operators listed ahead of each line for each of readability. Fragments then described, in reference to lines used followed by success rate using fragment as GP guidance $\scriptstyle ( \mathrm { n } = 3 0 )$ )
|
| 362 |
+
|
| 363 |
+
<table><tr><td>1 Make 2D Array</td><td></td><td>new 2DArray(size=variables[O]);</td></tr><tr><td>2</td><td>Literal</td><td>variables[6] = 2;</td></tr><tr><td>3</td><td>Divide</td><td>variables[4]= variables[O] /variables[6];</td></tr><tr><td>4</td><td>Loop</td><td>for(variables[2]=O;variables[2]<variables[4];variables[2]++)</td></tr><tr><td>5</td><td>Add</td><td>variables[5]= variables[2] + variables[4];</td></tr><tr><td>6</td><td>Write to 2D</td><td>array[variables[5][variables[10]]=1;</td></tr><tr><td>7</td><td>Write to 2D</td><td>array[variables[2][variables[4]]=1;</td></tr><tr><td>8</td><td>Subtract</td><td>variables[6]= variables[4] -variables[2];</td></tr><tr><td>9</td><td>Write to 2D</td><td>array[variables[2][variables[6]]=1;</td></tr><tr><td>10</td><td>Write to 2D</td><td>array[variables[5][variables[6]]=1;</td></tr><tr><td>11 12</td><td>Endloop Literal</td><td></td></tr><tr><td>13</td><td>Subtract</td><td>variables[8] = 1;</td></tr><tr><td></td><td>Write to 2D</td><td>variables[7]= variables[O] -variables[8];</td></tr><tr><td>14</td><td></td><td>array[variables[7][variables[10]]=1;</td></tr><tr><td>Fragment</td><td>Success Rate</td><td></td></tr><tr><td>2</td><td>13%</td><td></td></tr><tr><td>2,3</td><td>60%</td><td></td></tr><tr><td>2,12</td><td>10%</td><td></td></tr><tr><td>12</td><td>13%</td><td></td></tr><tr><td>12,13</td><td>40%</td><td></td></tr><tr><td></td><td></td><td></td></tr></table>
|
| 364 |
+
|
| 365 |
+
Table 20: Fragments assessed from program “Hollow Right Triangle”. Program’s code listed, in C-like format, with operators listed ahead of each line for each of readability. Fragments then described, in reference to lines used followed by success rate using fragment as GP guidance $\mathrm { ( n = } 3 0$ )
|
| 366 |
+
|
| 367 |
+
<table><tr><td>Line</td><td>Operator</td><td>As Code</td></tr><tr><td>1</td><td>Make 2D Array</td><td>new 2DArray(size=variables[O]);</td></tr><tr><td>2</td><td>Literal</td><td>variables[1] = 1;</td></tr><tr><td>3</td><td>Subtract</td><td>variables[4] = variables[O] - variables[1];</td></tr><tr><td>4</td><td>Loop</td><td>for(variables[2]=O;variables[2]<variables[O];variables[2]++)</td></tr><tr><td>5</td><td>Write to 2D</td><td>array[variables[2][variables[4]]=1;</td></tr><tr><td>6</td><td>Write to 2D</td><td>array[variables[5][variables[2]]=1;</td></tr><tr><td>7</td><td>Write to 2D</td><td>array[variables[2][variables[2]]=1;</td></tr><tr><td>8</td><td>Endloop</td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td>Fragment</td><td>Success Rate</td><td></td></tr><tr><td>2 2,3</td><td>80% 90%</td><td></td></tr><tr><td></td><td>80%</td><td></td></tr><tr><td>2,4</td><td></td><td></td></tr><tr><td>4</td><td>90%</td><td></td></tr><tr><td>4,6</td><td>63%</td><td></td></tr><tr><td>4,7</td><td>87%</td><td></td></tr><tr><td></td><td></td><td></td></tr></table>
|
| 368 |
+
|
| 369 |
+
Table 21: Fragments assessed from program “Hollow Mirrored Right Triangle”. Program’s code listed, in C-like format, with operators listed ahead of each line for each of readability. Fragments then described, in reference to lines used followed by success rate using fragment as GP guidance $\scriptstyle ( \mathrm { n } = 3 0 )$ )
|
| 370 |
+
|
| 371 |
+
<table><tr><td>Line</td><td>Operator</td><td>AsCode</td></tr><tr><td colspan="3"></td></tr><tr><td>1</td><td>Make 2D Array</td><td>new 2DArray(size=variables[O]);</td></tr><tr><td>2</td><td>Literal</td><td>variables[3]=1;</td></tr><tr><td>3</td><td>Subtract</td><td>variables[4]= variables[O] -variables[3];</td></tr><tr><td>4</td><td>Loop</td><td>for (variables[2]=O;variables[2]<variables[O];variables[2]++)</td></tr><tr><td>5</td><td>Write to 2D</td><td>array[variables[2][variables[4]]=1;</td></tr><tr><td>6</td><td>Write to 2D</td><td>array[variables[4][variables[2]]=1;</td></tr><tr><td>7</td><td>Subtract</td><td>variables[5]= variables[O]- variables[2];</td></tr><tr><td>8</td><td>Subtract</td><td>variables[5]= variables[5]- variables[3];</td></tr><tr><td>9</td><td>Write to 2D</td><td>array[variables[2][variables[5]]=1;</td></tr><tr><td>10</td><td>Endloop</td><td></td></tr><tr><td colspan="3"></td></tr><tr><td>Fragment</td><td colspan="2">Success Rate</td></tr><tr><td>2</td><td colspan="2">67%</td></tr><tr><td>2,3</td><td colspan="2">93%</td></tr><tr><td>2,4</td><td colspan="2">80%</td></tr><tr><td></td><td colspan="2"></td></tr><tr><td>4</td><td colspan="2">67%</td></tr><tr><td>4,7</td><td colspan="2">80%</td></tr><tr><td>Line</td><td>Operator</td><td>As Code</td></tr><tr><td colspan="3"></td></tr><tr><td>1</td><td>Make 2D Array</td><td>new 2DArray(size=variables[0]);</td></tr><tr><td>2</td><td>Literal</td><td>variables[4] = 2;</td></tr><tr><td>3</td><td>Loop</td><td>for(variables[2]=O;variables[2]<variables[O];variables[2]++)</td></tr><tr><td>4</td><td>Multiply</td><td>variables[6]= variables[2] * variables[4];</td></tr><tr><td>5</td><td>Subtract</td><td>variables[5]= variables[O] - variables[6];</td></tr><tr><td>6</td><td>Loop</td><td>for(variables[3]=O;variables[3]<variables[5];variables[3]++)</td></tr><tr><td>7 8</td><td>Add</td><td>variables[7]= variables[3] + variables[2];</td></tr><tr><td>9</td><td>Write to 2D</td><td>array[variables[7][variables[2]]=1;</td></tr><tr><td>10</td><td>Endloop</td><td></td></tr><tr><td></td><td>Endloop</td><td></td></tr><tr><td colspan="3"></td></tr><tr><td>Fragment</td><td colspan="2">Success Rate</td></tr><tr><td>2</td><td colspan="2">23%</td></tr><tr><td>2,3</td><td colspan="2">20%</td></tr><tr><td>3</td><td colspan="2">20%</td></tr><tr><td></td><td colspan="2"></td></tr></table>
|
| 372 |
+
|
| 373 |
+
Table 22: Fragments assessed from program “Inverted Isoceles Triangle”. Program’s code listed, in C-like format, with operators listed ahead of each line for each of readability. Fragments then described, in reference to lines used followed by success rate using fragment as GP guidance $\mathrm { ( n = } 3 0$ )
|
| 374 |
+
|
| 375 |
+
Table 23: Fragments assessed from program “Trapezoid”. Program’s code listed, in C-like format, with operators listed ahead of each line for each of readability. Fragments then described, in reference to lines used followed by success rate using fragment as GP guidance $\mathrm { ( n = } 3 0$ )
|
| 376 |
+
|
| 377 |
+
<table><tr><td>1</td><td>Make 2D Array</td><td>new 2DArray(size=variables[O]);</td></tr><tr><td>234</td><td>Literal</td><td>variables[7]=1;</td></tr><tr><td></td><td>Literal</td><td>variables[4] = 2;</td></tr><tr><td></td><td>Divide</td><td>variables[5]= variables[O] /variables[4];</td></tr><tr><td>5</td><td>Loop</td><td>for (variables[2]=O;variables[2]<variables[O];variables[2]++)</td></tr><tr><td>6</td><td>Loop</td><td>for (variables[3]=O;variables[3]<variables[5];variables[3]++)</td></tr><tr><td>7</td><td>Subtract</td><td>variables[8]= variables[O] - variables[5];</td></tr><tr><td>8</td><td>Divide</td><td>variables[8] = variables[8]/variables[4];</td></tr><tr><td>9</td><td>Subtract</td><td>variables[8]= variables[8]- variables[3];</td></tr><tr><td>10</td><td>Add</td><td>variables[9]= variables[8] +variables[7];</td></tr><tr><td>11</td><td>Condition</td><td>if (variables[9]>0)</td></tr><tr><td>12</td><td>Subtract</td><td>variables[9] = variables[2] - variables[8];</td></tr><tr><td>13</td><td>Condition</td><td>if (variables[9]>0)</td></tr><tr><td>14</td><td>Subtract</td><td>variables[9]= variables[O] - variables[8];</td></tr><tr><td>15</td><td>Subtract</td><td>variables[9]= variables[9]- variables[2];</td></tr><tr><td>16</td><td>Condition</td><td>if (variables[9]>0)</td></tr><tr><td>17</td><td>Write to 2D</td><td>array[variables[2][variables[3]]=1;</td></tr><tr><td>18</td><td>Endloop</td><td></td></tr><tr><td>19</td><td>Endloop</td><td></td></tr><tr><td>20</td><td>Endloop</td><td></td></tr><tr><td>21</td><td>Endloop</td><td></td></tr><tr><td>22</td><td>Endloop</td><td></td></tr><tr><td colspan="2">Fragment Success Rate</td><td></td></tr><tr><td>2</td><td colspan="2">10%</td></tr><tr><td>2,3</td><td colspan="2">10%</td></tr><tr><td></td><td colspan="2">10%</td></tr><tr><td>2,5</td><td colspan="2"></td></tr><tr><td>3</td><td colspan="2">3%</td></tr><tr><td>3,4</td><td colspan="2">0%</td></tr><tr><td></td><td colspan="2">10%</td></tr><tr><td>3,5 5</td><td colspan="2">3%</td></tr><tr><td></td><td colspan="3"></td></tr></table>
|
| 378 |
+
|
| 379 |
+
Table 24: Fragments used in experiment 2, corpus 1, to determine whether the NN can recognise their presence in a program’s source code based on its behaviour. If multiple lines are required they are required to exist in order, but not necessarily consecutively. Variable numbering is not reflective of source-code implementation and for descriptive purposes only.
|
| 380 |
+
|
| 381 |
+
<table><tr><td>Add</td><td>Simple addition. Requires the program to at some point contain an addition operation</td></tr><tr><td>+1 Offset Loop</td><td>Three Line Fragment The first sets Var1 to1 The second is a loop operator The third requires an addition operator such that</td></tr><tr><td>Length -1 Loop</td><td>Var2=loop_iterator+Varl Three Line Fragment The first sets Var1 to 1 The second requires an addition operator such that Var2= input_array_size+Varl</td></tr><tr><td>Literal (2)</td><td>The third is a loop operator bounded to Var2 Requires a variable to be set to 2</td></tr><tr><td>Loop</td><td>Requires the program to contain a loop</td></tr><tr><td>Loop Conditional</td><td>Two line fragment. The first line requires a loop The second line requires a conditional (var > O)</td></tr><tr><td>Loop Read</td><td>Two line fragment. The first line requires a loop</td></tr><tr><td>Nonstandard Array</td><td>The second line requires a read operation such that the indexread is the loop's iterator One line fragment. Requires the output array to be created,</td></tr><tr><td></td><td>witha sizeVarl such that Varl is not the variable defaulting to input array size</td></tr><tr><td>Read</td><td></td></tr><tr><td>Add</td><td>Requires the program to read from the input array Simple subtraction. Requires the program to at some point contain</td></tr></table>
|
| 382 |
+
|
| 383 |
+
Table 25: Fragments used in experiment 2, corpus 2, to determine whether the NN can recognise their presence in a program’s source code based on its behaviour. If multiple lines are required they are required to exist in order, but not necessarily consecutively. Variable numbering is not reflective of source-code implementation and for descriptive purposes only.
|
| 384 |
+
|
| 385 |
+
<table><tr><td>Add</td><td>Simple addition. Requires the program to at some point contain an addition operation</td></tr><tr><td>Conditional</td><td>Greater than O operator. The program must contain an operator which executes a non-empty code block if a variable is greater than zero</td></tr><tr><td>Half</td><td>Two line fragment. The first sets a variable Var1 to the literal 2, The second assigns a variable to desired_output_size/Var1</td></tr><tr><td>Half Loop</td><td>Three line fragment. The first sets a variable Var1 to the literal 2, The second assigns a variable Var2 to desired_output_size/Var1 The third defines a loop operator which runs from O to Var2</td></tr><tr><td>Half Loop Depends</td><td>Four line fragment. The first sets a variable Varl to the literal 2, The second assigns a variable Var2 to desired_output_size/Var1 The third defines a loop operator which runs from O to Var2 The fourth defines an operation setting a value on the 2D canvas, with the requirement that the X position of the point be logically</td></tr><tr><td>Loop Conditional</td><td>dependent on the loop iterator Two line fragment. The first requires a loop operator The second requires a conditional (var > O) operator</td></tr><tr><td>Loop Draw</td><td>Two line fragment. The first requires a loop operator The second requires a 2D array write operation in which</td></tr><tr><td>Loop Loop</td><td>the X position drawn to depends logically on the loop's iterator Two line fragment. The program must have two loops (not necessarily nested)</td></tr><tr><td>Loop Loop Subtract</td><td>Three line fragment. The program must have two loops (not necessarily nested)</td></tr><tr><td>Draw Draw</td><td>It must then have a subtract operator Two line fragment. The program must have two draw-to-2D-array operators</td></tr></table>
|
| 386 |
+
|
| 387 |
+
Table 26: Success rates for problems of the 1st corpus, using the rarest-first guidance strategy, with the aggregate estimates from the feed-forward architecture network $\mathrm { ( n = } 3 0$ )
|
| 388 |
+
|
| 389 |
+
<table><tr><td>Problem</td><td>Success Rate</td><td>Baseline</td></tr><tr><td></td><td></td><td></td></tr><tr><td>Abs</td><td>73%</td><td>7%</td></tr><tr><td>ArrayLength</td><td>100%</td><td>100%</td></tr><tr><td>ArrayToZero</td><td>100%</td><td>100%</td></tr><tr><td>CumulativeAbsoluteSum</td><td>0%</td><td>0%</td></tr><tr><td>CumulativeSum</td><td>33%</td><td>3%</td></tr><tr><td>DivergentSequence</td><td>63%</td><td>57%</td></tr><tr><td>FirstElementOnly</td><td>100%</td><td>27%</td></tr><tr><td>Identity</td><td>100%</td><td>100%</td></tr><tr><td>IndexParity</td><td>100%</td><td>100%</td></tr><tr><td>IterativeDifference</td><td>3%</td><td>3%</td></tr><tr><td>KeepEvens</td><td>0%</td><td>0%</td></tr><tr><td>KeepNegatives</td><td>27%</td><td>0%</td></tr><tr><td>KeepOdds</td><td>10%</td><td>0%</td></tr><tr><td>KeepPositives</td><td>47%</td><td>60%</td></tr><tr><td>Negative</td><td>67%</td><td>67%</td></tr><tr><td>Pop</td><td>100%</td><td>30%</td></tr><tr><td>RemoveFirstElement</td><td>83%</td><td>10%</td></tr><tr><td>RetainFirstHalf</td><td>0%</td><td>0%</td></tr><tr><td>Reverse</td><td>77%</td><td>57%</td></tr><tr><td>ShiftLeft</td><td>80%</td><td>10%</td></tr><tr><td>ShiftLeftZeroPadded</td><td>83%</td><td>40%</td></tr><tr><td>ShiftRight</td><td>17%</td><td>0%</td></tr><tr><td>ShiftRightLossy</td><td>77%</td><td>83%</td></tr><tr><td>ShuffleZerosToBack</td><td>80%</td><td>100%</td></tr><tr><td>Signum</td><td>10%</td><td>0%</td></tr><tr><td>Sort</td><td>3%</td><td>0%</td></tr><tr><td>SquareValues</td><td>77%</td><td>70%</td></tr><tr><td>ToIterator</td><td>100%</td><td>100%</td></tr><tr><td>Add</td><td>37%</td><td>23%</td></tr><tr><td>Append</td><td>47%</td><td>0%</td></tr><tr><td>ClipToMax</td><td>43%</td><td>17%</td></tr><tr><td>ClipToMin</td><td>70%</td><td>3%</td></tr><tr><td>ConstantAddition</td><td>7%</td><td>0%</td></tr><tr><td>FillArray</td><td>100%</td><td>100%</td></tr><tr><td>GreaterThan</td><td>23%</td><td>10%</td></tr><tr><td>IterateFromStart</td><td>100%</td><td>97%</td></tr><tr><td>LessThan</td><td>17%</td><td>7%</td></tr><tr><td>MultiplesOf</td><td>87%</td><td>90%</td></tr><tr><td>Multiply</td><td>30%</td><td>20%</td></tr><tr><td>Subtract</td><td>43%</td><td>17%</td></tr></table>
|
| 390 |
+
|
| 391 |
+
Table 27: Success rates for problems of the 1st corpus, using the uniform guidance strategy, with the aggregate estimates from the feed-forward architecture network $\mathrm { ( n = } 3 0$ )
|
| 392 |
+
|
| 393 |
+
<table><tr><td>Problem</td><td>Success Rate</td><td>Baseline</td></tr><tr><td>Abs</td><td>27%</td><td>7%</td></tr><tr><td>ArrayLength</td><td>100%</td><td>100%</td></tr><tr><td></td><td></td><td>100%</td></tr><tr><td>ArrayToZero</td><td>100%</td><td></td></tr><tr><td>CumulativeAbsoluteSum</td><td>0%</td><td>0%</td></tr><tr><td>CumulativeSum</td><td>20%</td><td>3%</td></tr><tr><td>DivergentSequence</td><td>83%</td><td>57%</td></tr><tr><td>FirstElementOnly Identity</td><td>83%</td><td>27%</td></tr><tr><td>IndexParity</td><td>100%</td><td>100%</td></tr><tr><td>IterativeDifference</td><td>100%</td><td>100%</td></tr><tr><td>KeepEvens</td><td>0%</td><td>3%</td></tr><tr><td>KeepNegatives</td><td>0%</td><td>0%</td></tr><tr><td>KeepOdds</td><td>53%</td><td>0%</td></tr><tr><td>KeepPositives</td><td>10%</td><td>0% 60%</td></tr><tr><td>Negative</td><td>40%</td><td>67%</td></tr><tr><td>Pop</td><td>63%</td><td>30%</td></tr><tr><td>RemoveFirstElement</td><td>73%</td><td>10%</td></tr><tr><td>RetainFirstHalf</td><td>57%</td><td>0%</td></tr><tr><td>Reverse</td><td>0%</td><td>57%</td></tr><tr><td>ShiftLeft</td><td>53%</td><td></td></tr><tr><td>ShiftLeftZeroPadded</td><td>43%</td><td>10%</td></tr><tr><td>ShiftRight</td><td>63%</td><td>40%</td></tr><tr><td>ShiftRightLossy</td><td>0%</td><td>0%</td></tr><tr><td>ShuffleZerosToBack</td><td>53%</td><td>83%</td></tr><tr><td>Signum</td><td>77%</td><td>100%</td></tr><tr><td>Sort</td><td>10%</td><td>0%</td></tr><tr><td></td><td>0%</td><td>0%</td></tr><tr><td>SquareValues</td><td>77%</td><td>70%</td></tr><tr><td>ToIterator Add</td><td>100%</td><td>100%</td></tr><tr><td></td><td>23%</td><td>23%</td></tr><tr><td>Append</td><td>7%</td><td>0%</td></tr><tr><td>ClipToMax ClipToMin</td><td>33%</td><td>17%</td></tr><tr><td></td><td>20%</td><td>3%</td></tr><tr><td>ConstantAddition</td><td>3%</td><td>0%</td></tr><tr><td>FillArray</td><td>100%</td><td>100%</td></tr><tr><td>GreaterThan</td><td>13%</td><td>10%</td></tr><tr><td>IterateFromStart</td><td>97%</td><td>97%</td></tr><tr><td>LessThan</td><td>30%</td><td>7%</td></tr><tr><td>MultiplesOf</td><td>93%</td><td>90%</td></tr><tr><td>Multiply</td><td>30%</td><td>20%</td></tr><tr><td>Subtract</td><td>17%</td><td>17%</td></tr></table>
|
| 394 |
+
|
| 395 |
+
Table 28: Success rates for problems of the 2nd corpus, using the uniform guidance strategy, with the aggregate estimates from the convolutional architecture network $\mathrm { ( n = } 3 0$ )
|
| 396 |
+
|
| 397 |
+
<table><tr><td>Square</td><td>90%</td><td>97%</td></tr><tr><td>HollowSquare</td><td>100%</td><td>100% 0%</td></tr><tr><td>Parallelogram</td><td>23%</td><td>0%</td></tr><tr><td>HollowParallelogram</td><td>7%</td><td>7% 13%</td></tr><tr><td>MirroredParallelogram MirroredHollowParallelogram</td><td>43%</td><td></td></tr><tr><td>RightTriangle</td><td>17% 93%</td><td>97%</td></tr><tr><td>HollowRightTriangle</td><td>97%</td><td>87%</td></tr><tr><td>MirroredRightTriangle</td><td>50%</td><td>60%</td></tr><tr><td>HollowMirroredRightTriangle</td><td>60%</td><td>63%</td></tr><tr><td>InvertedRightTriangle</td><td>67%</td><td>60%</td></tr><tr><td>HollowInvertedRightTriangle</td><td>57%</td><td>83%</td></tr><tr><td>InvertedMirroredRightTriangle</td><td>97%</td><td>100%</td></tr><tr><td>InvertedHollowMirroredRightTriangle</td><td>100%</td><td>100%</td></tr><tr><td>IsoceleseTriangle</td><td>10%</td><td>0%</td></tr><tr><td>HollowIsoceleseTriangle</td><td>43%</td><td>13%</td></tr><tr><td>InvertedIsoceleseTriangle</td><td>37%</td><td>47%</td></tr><tr><td>HollowInvertedIsoceleseTriangle</td><td>33%</td><td>50%</td></tr><tr><td>RectangleWithEmptyTrapezoid</td><td>3%</td><td>3%</td></tr><tr><td>InvertedRectangle</td><td>10%</td><td>3%</td></tr><tr><td>obtuseTriangle</td><td>23%</td><td>3%</td></tr><tr><td>hollowObtuseTriangle</td><td>53%</td><td>27%</td></tr><tr><td>mirroredObtuseTriangle</td><td>0%</td><td>0%</td></tr><tr><td>mirroredHollowObtuseTriangle</td><td>0%</td><td>0%</td></tr><tr><td>invertedObtuseTriangle</td><td>0%</td><td>0%</td></tr><tr><td>hollowInvertedObtuseTriangle</td><td>17%</td><td>10%</td></tr><tr><td>invertedMirroredObtuseTriangle</td><td>7%</td><td>0%</td></tr><tr><td>hollowMirroredInvertedObtuseTriangle</td><td>7%</td><td>3%</td></tr><tr><td>VShape</td><td>40%</td><td>47%</td></tr><tr><td>Trapezoid</td><td>0%</td><td>7%</td></tr></table>
|
md/train/Q2iaAc-4I1v/Q2iaAc-4I1v.md
ADDED
|
@@ -0,0 +1,316 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CAUSAL CURIOSITY: RL AGENTS DISCOVERING SELF-SUPERVISED EXPERIMENTS FOR CAUSAL REPRESENTATION LEARNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Humans show an innate ability to learn the regularities of the world through interaction. By performing experiments in our environment, we are able to discern the causal factors of variation and infer how they affect the dynamics of our world. Analogously, here we attempt to equip reinforcement learning agents with the ability to perform experiments that facilitate a categorization of the rolled-out trajectories, and to subsequently infer the causal factors of the environment in a hierarchical manner. We introduce a novel intrinsic reward, called causal curiosity, and show that it allows our agents to learn optimal sequences of actions, and to discover causal factors in the dynamics. The learned behavior allows the agent to infer a binary quantized representation for the ground-truth causal factors in every environment. Additionally, we find that these experimental behaviors are semantically meaningful (e.g., to differentiate between heavy and light blocks, our agents learn to lift them), and are learnt in a self-supervised manner with approximately 2.5 times less data than conventional supervised planners. We show that these behaviors can be re-purposed and fine-tuned (e.g., from lifting to pushing or other downstream tasks). Finally, we show that the knowledge of causal factor representations aids zero-shot learning for more complex tasks.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Discovering causation in environments an agent might encounter remains an open and challenging problem for causal reinforcement learning (Schölkopf (2015), Bengio et al. (2013), Schölkopf (2019)). Most approaches take the form of BAMDPs (Bayes Adaptive Markov Decision Processes) (Zintgraf et al. (2019)) or Hi-Param MDP (Hidden Parameter MDPs) (Doshi-Velez & Konidaris (2016); Yao et al. (2018); Killian et al. (2017); Perez et al. (2020)) which condition the transition $p ( s _ { t + 1 } | s _ { t } , a _ { t } ; H )$ and/or reward function $R ( r _ { t + 1 } | s _ { t } , a _ { t } , s _ { t + 1 } ; H )$ of each environment on hidden parameters (also referred to as causal factors in some of the above studies). Let $s \in { \mathcal { S } } , a \in { \mathcal { A } }$ $r \in \mathcal { R }$ , $H \in { \mathcal { H } }$ where $s , { \mathcal { A } } , { \mathcal { R } }$ , and $\mathcal { H }$ are the set of states, actions, rewards and feasible hidden parameters. In the physical world and in the case of mechanical systems, examples of the parameter $h _ { j } \in \mathcal { H }$ include gravity, coefficients of friction, masses and sizes of objects. Typically, $H$ is treated as a latent variable for which an embedding is learned during training, using variational methods (Kingma et al. (2014); Ilse et al. (2019)). Let $s _ { 0 : T }$ be the entire state trajectory of length $T$ . Similarly, $a _ { 0 : T }$ is the sequence of actions applied during that trajectory by the agent that results in $s _ { 0 : T }$ . In an environment parameterized by these causal factors, these latent variable approaches define a probability distribution over the entire sequence of (rewards, states, actions) conditioned on a latent $z$ as $p ( r _ { 0 : T } , s _ { 0 : T } , a _ { 0 : T - 1 } ; z )$ that factorizes as
|
| 12 |
+
|
| 13 |
+
$$
|
| 14 |
+
\prod _ { i = 1 } ^ { T - 1 } p ( r _ { t + 1 } | s _ { t } , a _ { t } , s _ { t + 1 } , z ) p ( s _ { t + 1 } | s _ { t } , a _ { t } , z ) p ( a _ { t } | s _ { t } , z )
|
| 15 |
+
$$
|
| 16 |
+
|
| 17 |
+
due to the Markov assumption. At test time, the agent infers the causal factor associated with its environment by observing the trajectories produced by its initial actions that can be issued by any policy such as model-based reinforcement learning.
|
| 18 |
+
|
| 19 |
+
In practice, however, discovering causal factors in a physical environment is prone to various challenges that are caused by the disjointed nature of the influence of these factors on the produced trajectories. More specifically, at each time step, the transition function is affected by a subset of global causal factors. This subset is implicitly defined on the basis of the current state and the action taken. For example, if a body in an environment loses contact with the ground, the coefficient of friction between the body and the ground no longer affects the outcome of any action that is taken. Likewise, the outcome of an upward force applied by the agent to a body on the ground is unaffected by the friction coefficient. We can therefore take advantage of this natural discontinuity to discern causal factors.
|
| 20 |
+
|
| 21 |
+
Without knowledge of how independent causal mechanisms affect the outcome of a particular action in a given state in an environment, it becomes impossible for the agent to conclude where the variation it encountered came from. Unsurprisingly, Hi-Param and BAMDP approaches fail to learn a disentangled embedding for the causal factors, making their behaviors uninterpretable (Perez et al. (2020)). For example, if, in an environment, a body remains stationary under a particular force, the Hi-Param or BAMDP agent may apply a higher force to achieve its goal of perhaps moving the body, but will be unable to conclude whether the "un-movability" was caused by high friction or high mass of the body. Additionally, these approaches require human-supervised reward engineering, making it difficult to apply them outside of the simulated environments they are tested in.
|
| 22 |
+
|
| 23 |
+
Our goal is, instead of focusing on maximizing reward for some particular task, to allow agents to discover causal processes through exploratory interaction. During training, our agents discover self-supervised experimental behaviors which they apply to a set of training environments. These behaviors allow them to learn about the various causal mechanisms that govern the transitions in each environment. During inference in a novel environment, they perform these discovered behaviors sequentially and use the outcome of each behavior to infer the embedding for a single causal factor (Figure 1).
|
| 24 |
+
|
| 25 |
+
The main challenge while learning a disentangled representation for the causal factors of the world is that several causal factors may affect the outcome of behaviors in each environment. For example, when pushing a body on the ground, the outcome, i.e., whether the body moves, or how far the body is pushed, depends on several factors, e.g., mass, shape and size, frictional coefficients, etc. However, if, instead of pushing on the ground, the agent executes a perfect grasp-and-lift behavior, only mass will affect whether the body is lifted off the ground or not.
|
| 26 |
+
|
| 27 |
+
Thus, it is clear that not all experimental behaviors are created equal and that the outcomes of some behaviors are caused by fewer causal factors than others. Our agents learn these behaviors without supervision using causal curiosity, an intrinsic reward. The outcome of a single such experimental behavior is then used to infer a binary quantized embedding describing the single isolated causal factor. Even though causal factors of variation in a physical world are easily identifiable to humans, a concrete definition is required to back up our proposed method. We conjecture that the causality of a factor of variation depends on the available actions to the agent. If the set of actions that an agent can take is very limited, there is no way for it to discern a diverse set of causal factors in the environment.
|
| 28 |
+
|
| 29 |
+
Definition 1 (Causal factors). Consider the POMDP $( \mathcal { O } , \mathcal { S } , \mathcal { A } , p , r )$ with observation space $\mathcal { O }$ , state space $s$ , action space $\mathcal { A }$ , the transition function $p$ , and the reward function $r$ . Let $o _ { 0 : T } \in \mathcal { O } ^ { T }$ denotes a trajectory of observations and $T$ be the length of such trajectories. Let $d ( \cdot , \cdot ) : \mathcal { O } ^ { T } \times \mathcal { O } ^ { T } \to \mathbb { R } _ { + }$ be a distance function defined on the space of trajectories of length $T$ . The set $H = \{ h _ { 1 } , h _ { 2 } , \ldots , h _ { k } \}$ is called a set of $\epsilon -$ causal factors if for every $h _ { j } \in H$ , there exists a unique sequence of actions $a _ { 0 : T }$ that clusters the state trajectories into two sets $S$ and $S ^ { \prime }$ such that
|
| 30 |
+
|
| 31 |
+
$$
|
| 32 |
+
\operatorname* { m i n } \{ d ( o _ { 0 : T } , o _ { 0 : T } ^ { \prime } ) : o _ { 0 : T } \in O , o _ { 0 : T } ^ { \prime } \in O ^ { \prime } \} > \epsilon
|
| 33 |
+
$$
|
| 34 |
+
|
| 35 |
+
and that $h _ { j }$ is the cause of the trajectory of states obtained i.e.,
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
p ( o _ { 0 : T } | d o ( h _ { j } = k ) , a _ { 0 : T } ) \neq p ( o _ { 0 : T } | d o ( h _ { j } = k ^ { \prime } ) , a _ { 0 : T } ) \forall k \neq k ^ { \prime }
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
Intuitively, a factor of variation affecting a set of environments is called causal if there exists a sequence of actions available to the agent where the resultant trajectories are clustered into two or more sets (for simplicity here we assume binary clusters). This is analogous to the human ability to conclude whether objects are heavy or light, big or small. For a gentle introduction to the intuition about this definition, we refer the reader to Appendix D.
|
| 42 |
+
|
| 43 |
+
According to Def. 1, a causal factor is a parameter in the environment whose value, when intervened on (i.e. varied) over a set of values, results in trajectories of states that are divisible into disjoint clusters under a particular sequence of actions. These clusters represent the quantized values of the causal factor. For example, mass, which is a causal factor of a body, under an action sequence of a grasping and lifting motion, results in 2 clusters, liftable (low mass) and not liftable (high mass). However, such an action sequence is not known in advance. Therefore, discovering a causal factor in the environment boils down to finding a sequence of actions that makes the effect of that factor prominent by producing clustered trajectories for different values of that environmental factor.
|
| 44 |
+
|
| 45 |
+

|
| 46 |
+
Figure 1: Overview of Inference. The exploration loop produces a series of $K$ experiments allowing the agent to infer the representations for $K$ causal factors. After exploration, the agent utilizes the acquired knowledge for downstream tasks.
|
| 47 |
+
|
| 48 |
+
Using the above, we propose an intrinsic reward, which allows our agents to discover experimental behaviors which are semantically meaningful and can be used to re-train for downstream tasks, resulting in high sample efficiency. Our work, therefore, forms an important link between structured representation learning and skill discovery, two largely disjoint fields in RL, which stand to benefit from each other.
|
| 49 |
+
|
| 50 |
+
The contributions of the work are as follows:
|
| 51 |
+
|
| 52 |
+
• We equip agents with the ability to perform experiments and behave meaningfully in a set of environments in an unsupervised manner. These behaviors can expose or obfuscate specific independent causal mechanisms that occur in the world of the agent, allowing the agent to learn about each in the absence of the others, an important human behavioral trait.
|
| 53 |
+
• We introduce an intrinsic reward, causal curiosity, which allows our agents to discover these behaviors without human-engineered rewards. The outcomes of the experiments are used to learn a disentangled quantized binary representation for the causal factors of the environment, analogous to the human ability to conclude whether objects are light/heavy, big/small etc.
|
| 54 |
+
• Through extensive experiments, we conclude that knowledge of the causal factors aids sample efficiency in two ways - first, that the knowledge of the causal factors aids transfer learning across multiple environments, and, second, that the experimental behaviors acquired can be repurposed for downstream tasks.
|
| 55 |
+
|
| 56 |
+
# 2 METHOD
|
| 57 |
+
|
| 58 |
+
Consider a set of $N$ environments $\mathcal { E }$ with $e ^ { ( i ) } \in \mathcal { E }$ where $e ^ { ( i ) }$ denotes the $i ^ { t h }$ environment.
|
| 59 |
+
|
| 60 |
+
The letter $H$ is overloaded. While $H$ is a set of global causal factors (as defined in Def. 1) such that
|
| 61 |
+
$h _ { j } \in H$ , each causal factor $h _ { j }$ is itself a random variable which assumes a particular value for every ion of an environment. T. For each environment $e ^ { ( i ) }$ is represented by a set of causal factorsepresents the disentangled embedding
|
| 62 |
+
$\{ h _ { j } ^ { ( i ) } \forall j \}$ $e ^ { ( i ) }$ $( z _ { ( 0 ) } ^ { ( i ) } , z _ { ( 1 ) } ^ { ( i ) } . . . z _ { ( K - 1 ) } ^ { ( i ) } )$
|
| 63 |
+
vector, such that z(i)(j) $h _ { j } ^ { ( i ) }$ .
|
| 64 |
+
|
| 65 |
+
# Algorithm 1 Training Scheme
|
| 66 |
+
|
| 67 |
+
1: Initialize $j = 0$ 2: Initialize training environment set Envs 3: for iteration m to M do . Experiment Planner Training Loop 4: Sample experimental behavior $a _ { 0 : T } \sim \mathbf { C E M } ( \cdot )$ 5: for $i ^ { \star h }$ env in Envs do 6: Apply $a _ { 0 : T }$ to env 7: $\mathbf { C o l l e c t } \ S ^ { ( } i ) = O _ { 0 : T } ^ { ( i ) }$ 8: Reset env 9: Calculate $- L ( S | M )$ given that $M$ is bimodal clustering model $\triangleright$ Calculate Curiosity
|
| 68 |
+
10: Update CEM(·) distribution with highest reward trajectories
|
| 69 |
+
11: Use learnt $q _ { M } ( z | S )$ for cluster assignment of each env in Envs i.e. $z _ { j } ^ { ( i ) } = q _ { M } ( z | S ^ { ( i ) } )$
|
| 70 |
+
12: Update $j = j + 1$
|
| 71 |
+
13: Repeat from step 2, first setting $E n v s = \{ e ^ { ( i ) } : z _ { j - 1 } ^ { ( i ) } = 0 \}$ and then, setting $E n v s = \{ e ^ { ( i ) } : z _ { j - 1 } ^ { ( i ) } = 1 \}$
|
| 72 |
+
|
| 73 |
+
# 2.1 TRAINING THE EXPERIMENT PLANNER
|
| 74 |
+
|
| 75 |
+
To learn about causal processes through interaction, the agent must produce a sequence of actions $a _ { 0 : T - 1 }$ that we call experimental behavior, which, when applied to environment $e ^ { ( i ) } \in \mathcal { E }$ , produces a sequence of observations (state) $s ^ { ( i ) } = [ o _ { 0 } ^ { ( i ) } , o _ { 1 } ^ { ( i ) } . . o _ { T } ^ { ( i ) } ]$ , which is then used to infer the value of the embedding for a single causal factor $z _ { ( j ) } ^ { ( i ) }$ .
|
| 76 |
+
|
| 77 |
+
We motivate this using model selection criterion. Normally in model selection applications, the observations are fixed and the goal is to find a model $M ^ { * }$ that is closest to reality, as represented by:
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
M ^ { * } = \arg \operatorname* { m i n } _ { M } ( L ( M ) + L ( S | M ) )
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
where $L ( \cdot )$ is the description length. However, here, the situation is reversed. A simple bi-modal clustering model is fixed, motivated by Definition 1. Then, the agent is motivated to produce actions that result in observations that are best explained by this model. These discovered action sequences are the experimental behaviors we desire.
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\begin{array} { r } { \boldsymbol { a } _ { 0 : T } ^ { * } = \underset { \boldsymbol { a } _ { 0 : T } } { \arg \operatorname* { m i n } } ( L ( \boldsymbol { M } ) + L ( \boldsymbol { S } | \boldsymbol { M } ) ) } \end{array}
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
where each observed trajectory $S = S ( a _ { 0 : T } )$ is a function of the action sequence. As mentioned earlier, the model is fixed in this formulation; hence, the first term $L ( M )$ is constant and not a function of the actions. $- L ( S | M )$ that is fed back to the RL agent as a reward function to maximize. We regard this reward function as causal curiosity.
|
| 90 |
+
|
| 91 |
+
Note that since each causal factor has its own independent causal mechanism that causes $S$ , the MDL of $S$ will be higher if multiple causal factors cause $S$ . On the contrary, if the agent produces actions which result in an $S$ that is easily explained by a low-capacity bi-modal model $M$ , then it will imply that $S$ is caused by fewer causal factors. Consequently, the causal curiosity reward for such an action sequence, $- L ( S | M )$ , will be high. Therefore, causal curiosity favors experimental behaviors that result in observations caused by few causal factors - thereby allowing us to use $S$ to infer a representation for a single causal factor. For details, please refer Appendix A.
|
| 92 |
+
|
| 93 |
+
# 2.2 CAUSAL INFERENCE MODULE
|
| 94 |
+
|
| 95 |
+
By maximizing the causal curiosity reward it is possible to achieve behaviors which result in trajectories of states only caused by a single hidden parameter. However, we wish to use the outcome of performing these experimental behaviors in each environment to infer a representation for the causal factor isolated by the experiment in question.
|
| 96 |
+
|
| 97 |
+
We achieve this through cluster membership. After training the Model Predictive Control Planner (Camacho & Alba (2013)), we sample from an action sequence $a _ { 0 : T }$ and apply it to each of the training environments. The learnt clustering model $M$ is then used to infer a representation for each environment using the collected outcome $\bar { S } ^ { ( i ) }$ obtained by applying $a _ { 0 : T }$ to each environment.
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
z _ { j } ^ { ( i ) } = q _ { M } ( z | S ^ { ( i ) } )
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
This corresponds to Step 11 of Algorithm (1). The representation learnt is binary in nature corresponding to the quantization of the continuous spectrum of values a causal factor takes in the training set into high and low values. Note however that a binary quantized embedding is not a necessary part of our method. A dense embedding may alternatively be learnt here similar to (Perez et al. (2020); Zintgraf et al. (2019)) using approximate variational inference. However, performing interventions on a dense embedding (Section 2.3) increases the computational complexity exponentially. Balancing space and time complexity, we report results using the quantized binary form of Equation (6). We discuss the implications of increasing the complexity of $z _ { j } ^ { ( i ) }$ in the discussion.
|
| 104 |
+
|
| 105 |
+
# 2.3 INTERVENTIONS ON BELIEFS
|
| 106 |
+
|
| 107 |
+
Having learnt about the effects of a single causal factor of the environment we wish to learn such experimental behaviors for each of the remaining hidden parameters that may vary in an environment. To achieve this, in an ideal setting, the agent would require access to the generative mechanism of the environments it encounters. Ideally, it would hold the values of the causal factor already learnt about constant i.e. $d o ( h _ { j } = c o n s t a n t )$ , and intervene over (vary the value of) another causal factor over a set of values $K$ i.e. $d o ( h _ { j } = k )$ such that $k \in K$ . For example, if a human scientist were to study the effects of a causal factor, say mass of a body, she would hold the values of all causal factors constant, (interact with cubes of the same size and external texture) and vary only mass to see how it affects the outcome of specific behaviors she applies to each body.
|
| 108 |
+
|
| 109 |
+
However, in the real-world the agent does not have access to the generative mechanism of the environments it encounters, but merely has the ability to act in them. Thus, it can intervene on the representations of a causal factor of the environment i.e. $d o ( z _ { i } = c o n s t a n t )$ . For, example having learnt about gravity, the agent picks all environments it believes have low gravity, and uses them to learn about a separate causal factor say, friction.
|
| 110 |
+
|
| 111 |
+
This corresponds to Step 13 of Algorithm (1). Thus, to learn about the $j ^ { t h }$ causal factor, we repeat steps 3 onwards on each of the clusters obtained for the $j - 1 ^ { t h }$ .
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
E n v s = \{ e ^ { ( i ) } : z _ { j - 1 } ^ { ( i ) } = k \} , k \in \{ 0 , 1 \}
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
This process continues in the form of a tree (Figure 4), where for each cluster of environments, a new experiment learns to split the cluster into 2 sub-clusters depending on the value of another hidden parameter. At level $n$ , the agent produces $2 ^ { n }$ experiments and inference models, having already intervened on the binary quantized representations of $n$ causal factors.
|
| 118 |
+
|
| 119 |
+
# 3 RELATED WORK
|
| 120 |
+
|
| 121 |
+
Doshi-Velez & Konidaris (2016) define a class Markov Decision Processes where transition probabilities $p ( s _ { t + 1 } | s _ { t } , a _ { t } ; \theta )$ depend on a hidden parameter $\theta$ , whose value is not observed, but its effects are felt. Killian et al. (2017) and Yao et al. (2018) utilize these Hidden Parameter MDPs (Markov Decision Processes) to enable efficient policy transfer, assuming that transition probabilities across states are a function of hidden parameters. Perez et al. (2020) relax this assumption, allowing both transition probabilities and reward functions to be functions of hidden parameters. Zintgraf et al. (2019) approach the problem from a Bayes-optimal policy standpoint, defining transition probabilities and reward functions to be dependent on a hidden parameter characteristic of the MDP in consideration. We utilize this setup to define causal factors.
|
| 122 |
+
|
| 123 |
+
Substantial attempts have been made at unsupervised disentanglement, most notably, the $\beta$ -VAE Higgins et al. Burgess et al. (2018), where a combination of factored priors and the information bottleneck force disentangled representations. Kim & Mnih (2018) enforce explicit factorization of the prior without compromising on the mutual information between the data and latent variables, a shortcoming of the $\beta$ -VAE. Chen et al. (2018) factor the KL divergence into a more explicit form, highlighting an improved objective function and a classifier-agnostic disentanglement metric. Locatello et al. (2018) show theoretically that unsupervised disentanglement (in the absence of inductive biases) is impossible and highly unstable, susceptible to random seed values. They follow this up with Locatello et al. (2020) where they show, both theoretically and experimentally, that pair-wise images provide sufficient inductive bias to disentangle causal factors of variation. However, these works have been applied to supervised learning problems whereas we attempt to disentangle the effects of hidden variables in dynamical environments, a relatively untouched question.
|
| 124 |
+
|
| 125 |
+
Curiosity for robotics is not a new area of research. Schmidhuber (2006), Ngo et al. (2012), Pathak et al. (2017) describe curiosity as the motivation behind the behavior of an agent in an environment for which the outcome is unpredictable, i.e., an intrinsic reward that motivates the agent to explore the unseen portions of the state space (and subsequent transitions). While causal curiosity is an intrinsic reward, it differs from these traditional definitions of curiosity in that it motivates the agent to produce structure in the outcome of its behavior.
|
| 126 |
+
|
| 127 |
+
# 4 EXPERIMENTS
|
| 128 |
+
|
| 129 |
+
Our work has 2 main thrusts - the discovered experimental behaviors and the representations obtained from the outcome of the behaviors in environments. The experimental behaviors are tied to contributions 1 and 2 in the Introduction. The causal factors allow us to achieve contribution 3 in the Introduction. We visualize these learnt behaviors and verify that they are indeed semantically meaningful and interpretable. We quantify the utility of the learned behaviors by using the behaviors as pre-training for a downstream task. In our experimental setup, we verify that these behaviors are indeed invariant to all other causal factors except one.
|
| 130 |
+
|
| 131 |
+
We visualize the representations obtained using these behaviors and verify that they are indeed the binary quantized representations for each of the ground truth causal factors that we manipulated in our experiments. Finally, we verify that the knowledge of the representation does indeed aid transfer learning and zero-shot generalizability in downstream tasks.
|
| 132 |
+
|
| 133 |
+
Causal World We use the Causal World Simulation (Ahmed et al. (Under submission 2020)) based on the Pybullet Physics engine to test our approach. The simulator consists of a 3-fingered robot, with 3 joints on each finger. We constrain each environment to consist of a single object that the agent can interact with. The causal factors that we manipulate for each of the objects are size, shape and mass of the blocks. The simulator allows us to capture and track the positions and velocities of each of the movable objects in an environment. While, for most experiments, the 3D position and 3D pose of the blocks is used as the state at each time step, we perform ablation studies where less information is provided to the agent.
|
| 134 |
+
|
| 135 |
+
# 4.1 VISUALIZING DISCOVERED BEHAVIORS
|
| 136 |
+
|
| 137 |
+
We would like to analyze whether the discovered experimental behaviors are human interpretable, i.e., are the experimental behaviors discovered in each of the setups semantically meaningful? We find that our agents learn to perform several useful behaviors without any supervision. For instance, to differentiate between objects with varying mass, we find that they acquire a perfect grasp-and-lift behavior with an upward force. In other random seed experiments, the agents learn to lift the blocks by using the wall of the environment for support. To differentiate between cubes and spheres, the agent discovers a pushing behavior which gently rolls the spheres along a horizontal direction. Qualitatively, we find that these behaviors are stable and predictable. See videos of discovered behaviors here (website under construction).
|
| 138 |
+
|
| 139 |
+
Concurrent with the objective they are trained on, we find that the acquired behaviors impose structure on the outcome when applied to each of the training environments. The outcome of each experimental behavior on the set of training environments results in dividing it into 2 subsets. These subsets correspond to the binary quantized values of a single factor, e.g., large or small, while being invariant to the values of other causal factors of the environments. We also perform ablation studies where instead of providing the full state vector, we provide only one coordinate (e.g., only x, y or z coordinate of the block). We find that causal curiosity results in behaviors that differentiate the environments based on outcomes along the direction provided. For example, when only the $\mathbf { X }$ coordinate was provided, the agent learned to evaluate mass by applying a pushing behavior along the x direction. Similarly, a lifting behavior was obtained when only the z coordinate was supplied to the curiosity module (Figure 2).
|
| 140 |
+
|
| 141 |
+

|
| 142 |
+
Figure 2: Examples of discovered behaviors. The agent discovers experimental behaviors that allow it to characterize each environmental object in a binary manner, e.g., heavy/light, big small, rollable/not rollable, etc. These behaviors are acquired without any external supervision by maximizing the causal curiosity reward. A, B, C correspond to self-discovered toss, lift-and-spin and roll behaviors respectively. D shows an ablation study, where the agent is only provided the z coordinate of the block in every environment. Each line corresponds to one environment and the z coordinate of the block is plotted with time when the discovered behavior is applied. It learns a lifting behavior, where cluster 1 represents the heavy blocks (z coordinate does not change much) and cluster 2 represents the light blocks $\mathbf { z }$ increases as block is lifted and then falls when dropped and subsequently increases again when it bounces).
|
| 143 |
+
|
| 144 |
+
# 4.2 UTILITY OF LEARNED BEHAVIORS FOR DOWNSTREAM TASKS
|
| 145 |
+
|
| 146 |
+
While the behaviors acquired are semantically meaningful, we would like to quantify their utility as pre-training for downstream tasks. We analyze the performance on Lifting where the agent must grasp and lift a block to a predetermined height and Travel, where the agent must impart a velocity to the block along a predetermined direction. We re-train the learnt planner using an external reward for these tasks (Curious). We implement a baseline vanilla Cross Entropy Method optimized Model Predictive Control Planner (De Boer et al. (2005)) trained using the identical reward function and compare the rewards per trajectory during training. We also run a baseline (Additive reward) which explores whether the agent recieves both the causal curiosity reward and the external reward. We find high zero-shot generalizability and quicker convergence as compared to the vanilla CEM planner (Figure ??). We find that maximizing the curiosity reward in addition to simultaneously maximizing external rewards results in suboptimal performance due to our formulation of the curiosity reward. To maximize curiosity, the agent must discover behaviors that divide environments into 2 clusters. Thus in the context of the experimental setups, this corresponds to acquiring a lifting/pushing behavior that allows the agent to lift/impart horizontal velocity to blocks in half of the environments, while not being able to do so in the remaining environments. However, the explicit external reward incentivizes the agent to lift/impart horizontal velocity blocks in all environments. Thus these competing objectives result in sub-par performance.
|
| 147 |
+
|
| 148 |
+
# 4.3 VISUALIZATION OF HIERARCHICAL BINARY LATENT SPACE
|
| 149 |
+
|
| 150 |
+
Our agents discover a disentangled latent space such that they are able to isolate the sources of causation of the variability they encounters in their environments. For every environment, they learn a disentangled embedding vector which describes each of the causal factors.
|
| 151 |
+
|
| 152 |
+
To show this, we use 3 separate experimental setups - Mass, SizeMass and ShapeSizeMass where each of the causal factors are allowed to vary over a range of discrete values. During Mass, the agent is allowed access to 5 environments with objects having the same shape (cuboids) and size but differing only in mass. During SizeMass, the agent has access to 30 environments with cuboids having sizes and masses ranging over 6 and 5 values respectively. Finally, during ShapeSizeMass, the agent has access to 60 environments with objects having shapes, sizes and masses ranging over 2, 6, 5, and values respectively.
|
| 153 |
+
|
| 154 |
+

|
| 155 |
+
|
| 156 |
+

|
| 157 |
+
Figure 3: Utility of discovered behaviors. We find that the behaviors discovered by the agents while optimizing causal curiosity show high zero-shot generalizability and converge to the same performance as conventional planners for downstream tasks. We also analyze the worst case performance and find that the pre-training ensures better performance than random initialization. The table compares the time-steps of training required on an average to acquire a skill with the time steps required to learn a similar behavior using external reward. We find that the unsupervised experimental behaviors are approximately 2.5 times more sample efficient. We also find that maxizing both curiosity and external reward in our experimental setups results in sub-optimal results.
|
| 158 |
+
Figure 4: Discovered hierarchical latent space. The agent learns experiments that differentiate the full set of blocks in ShapeSizeMass into hierarchical binary clusters. At each level, the environments are divided into 2 clusters on the basis of the value of a single causal factor. We also show the principal components of the trajectories in the top left. For brevity, the full of extent of the tree is not depicted here. For each level of hierarchy $k$ , there are $2 ^ { k }$ number of clusters.
|
| 159 |
+
|
| 160 |
+
During training, the agent discovers a hierarchical binary latent space (Figure 4), where each level of hierarchy corresponds to a single causal factor. The binary values at each level of hierarchy correspond to the high/low values of the causal factor in question. To our knowledge, we obtain the first interpretable latent space describing the various causal processes in the environment of an agent. This implies that it learns to quantify each physical attribute of the blocks it encounters in a completely unsupervised manner.
|
| 161 |
+
|
| 162 |
+
# 4.4 KNOWLEDGE OF CAUSAL FACTORS AIDS TRANSFER
|
| 163 |
+
|
| 164 |
+
Next, we test whether knowledge of the causal factors does indeed aid transfer and zero-shot generalizability. To this end, we supply the representations obtained by the agent during the experimental behavior phase as input to a policy network in addition to the state of the simulator, and train it for a place-and-orient downstream task (Figure 1). We define 2 experimental setups - TransferMass and TransferSizeMass. In Mass, the agent is given access to 10 environments, with 10 varying values of mass. In TransferSizeMass, the agent is allowed access to 10 environments, with 2 and 5 values of size and mass respectively. In both setups, the agent learns about the varying causal mechanisms by optimizing causal curiosity. Subsequently, using the causal representation along with the state for each environment, it is trained to maximize external reward. For details of the setup, please see Appendix B.
|
| 165 |
+
|
| 166 |
+
After training, the agents are exposed to a set of unseen test environments, where we analyze their zero-shot generalizability. These test environments consist of unseen masses and sizes and their unseen combinations. This corresponds to "Strong Generalization" as defined by Perez et al. (2020). We report results averaged over 10 random seeds.
|
| 167 |
+
|
| 168 |
+
For each setup, we train a PPO-optimized Actor-Critic Policy (referred to as Causally-curious agent) with access to the causal representations and a 56 dimensional state vector from the environment i.e., $a _ { t } \sim \pi ( \cdot | s _ { t } , z _ { 0 : K } )$ (thus, a total of 57 dimensional input for TransferMass, and a 58 dimensional for TransferSizeMass). Similar to Perez et al. (2020), we implement 2 baselines - the Generalist and the Specialist. The Specialist consists of an agent with identical architecture as Causally-curious agent, but without access to causal representations (i.e., receives a 56 dimensional state vector). It is initialized randomly and is trained only on the test environments, serving as a benchmark for complexity of the test tasks. It performs poorly, indicating that the test tasks are complex. The architecture of the Generalist is identical to the Specialist. Like the Specialist, the Generalist also does not have access to the causal representations, but is trained on the same set of training environments that the Causally-curious agent is trained on. The poor performance of the generalist indicates that the tasks distribution of training and test tasks differs significantly and that memorization of behaviors does not yield good transfer. We find that causally-curious agents significantly outperform the both baselines indicating that indeed, knowledge of the causal representation does aid zero-shot generalizability.
|
| 169 |
+
|
| 170 |
+

|
| 171 |
+
Figure 5: Knowledge of causal factors aids transfer. We find that knowledge of the causal representation allows agents to generalize to unseen environments with high zero-shot performance. The table depicts the extra timesteps required by the Generalist in each experimental setup to match the zero-shot performance of causally-curious agent. We find that as the number of varying causal factors increase, the difference in zero-shot performance of the Causally-curious agent and the Generalist increases, showing that the CC agents are indeed robust to multiple varying causal factors.
|
| 172 |
+
|
| 173 |
+
# 5 CONCLUSION
|
| 174 |
+
|
| 175 |
+
We introduce causal curiosity, an intrinsic reward that allows agents to discover binary quantized representations for the causal factors that affect environments an RL agent may encounter. We show that optimizing causal curiosity rewards results in the agent performing self-supervised experiments. We find that these experiments happen to be semantically meaningful and can be used as pre-training for downstream tasks. While our work learns binary quantized causal representations, a dense encoding may improve the amount of encoded information about the causal mechanisms of the environments. We leave this to future work.
|
| 176 |
+
|
| 177 |
+
# REFERENCES
|
| 178 |
+
|
| 179 |
+
Ossama Ahmed, Frederik Träuble, Anirudh Goyal, Alexander Neitz, Manuel Wüthrich, Yoshua Bengio, Bernhard Schölkopf, and Stefan Bauer. Causalworld: A robotic manipulation benchmark for causal structure and transfer learning. Under submission 2020.
|
| 180 |
+
|
| 181 |
+
Yoshua Bengio, Aaron Courville, and Pascal Vincent. Representation learning: A review and new perspectives. IEEE transactions on pattern analysis and machine intelligence, 35(8):1798–1828, 2013.
|
| 182 |
+
|
| 183 |
+
Christopher P Burgess, Irina Higgins, Arka Pal, Loic Matthey, Nick Watters, Guillaume Desjardins, and Alexander Lerchner. Understanding disentangling in $\beta$ -vae. arxiv 2018. arXiv preprint arXiv:1804.03599, 2018.
|
| 184 |
+
|
| 185 |
+
Eduardo F Camacho and Carlos Bordons Alba. Model predictive control. Springer Science & Business Media, 2013.
|
| 186 |
+
|
| 187 |
+
Tian Qi Chen, Xuechen Li, Roger B Grosse, and David K Duvenaud. Isolating sources of disentanglement in variational autoencoders. In Advances in Neural Information Processing Systems, pp. 2610–2620, 2018.
|
| 188 |
+
|
| 189 |
+
Marco Cuturi and Mathieu Blondel. Soft-dtw: a differentiable loss function for time-series. arXiv preprint arXiv:1703.01541, 2017.
|
| 190 |
+
|
| 191 |
+
Veronica Czitrom. One-factor-at-a-time versus designed experiments. The American Statistician, 53 (2):126–131, 1999.
|
| 192 |
+
|
| 193 |
+
Pieter-Tjerk De Boer, Dirk P Kroese, Shie Mannor, and Reuven Y Rubinstein. A tutorial on the cross-entropy method. Annals of operations research, 134(1):19–67, 2005.
|
| 194 |
+
|
| 195 |
+
Finale Doshi-Velez and George Konidaris. Hidden parameter markov decision processes: A semiparametric regression approach for discovering latent task parametrizations. In IJCAI: proceedings of the conference, volume 2016, pp. 1432. NIH Public Access, 2016.
|
| 196 |
+
|
| 197 |
+
Ronald Aylmer Fisher. Design of experiments. Br Med J, 1(3923):554–554, 1936.
|
| 198 |
+
|
| 199 |
+
Charles Robert Hicks. Fundamental concepts in the design of experiments. 1964.
|
| 200 |
+
|
| 201 |
+
Irina Higgins, Loic Matthey, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-vae: Learning basic visual concepts with a constrained variational framework.
|
| 202 |
+
|
| 203 |
+
Ashley Hill, Antonin Raffin, Maximilian Ernestus, Adam Gleave, Anssi Kanervisto, Rene Traore, Prafulla Dhariwal, Christopher Hesse, Oleg Klimov, Alex Nichol, Matthias Plappert, Alec Radford, John Schulman, Szymon Sidor, and Yuhuai Wu. Stable baselines. https://github.com/ hill-a/stable-baselines, 2018.
|
| 204 |
+
|
| 205 |
+
Maximilian Ilse, Jakub M Tomczak, Christos Louizos, and Max Welling. Diva: Domain invariant variational autoencoders. arXiv preprint arXiv:1905.10427, 2019.
|
| 206 |
+
|
| 207 |
+
Taylor W Killian, Samuel Daulton, George Konidaris, and Finale Doshi-Velez. Robust and efficient transfer learning with hidden parameter markov decision processes. In Advances in neural information processing systems, pp. 6250–6261, 2017.
|
| 208 |
+
|
| 209 |
+
Hyunjik Kim and Andriy Mnih. Disentangling by factorising. arXiv preprint arXiv:1802.05983, 2018.
|
| 210 |
+
|
| 211 |
+
Durk P Kingma, Shakir Mohamed, Danilo Jimenez Rezende, and Max Welling. Semi-supervised learning with deep generative models. In Advances in neural information processing systems, pp. 3581–3589, 2014.
|
| 212 |
+
|
| 213 |
+
Francesco Locatello, Stefan Bauer, Mario Lucic, Gunnar Rätsch, Sylvain Gelly, Bernhard Schölkopf, and Olivier Bachem. Challenging common assumptions in the unsupervised learning of disentangled representations. arXiv preprint arXiv:1811.12359, 2018.
|
| 214 |
+
|
| 215 |
+
Francesco Locatello, Ben Poole, Gunnar Rätsch, Bernhard Schölkopf, Olivier Bachem, and Michael Tschannen. Weakly-supervised disentanglement without compromises. arXiv preprint arXiv:2002.02886, 2020.
|
| 216 |
+
|
| 217 |
+
Hung Ngo, Matthew Luciw, Alexander Forster, and Juergen Schmidhuber. Learning skills from play: artificial curiosity on a katana robot arm. In The 2012 international joint conference on neural networks (IJCNN), pp. 1–8. IEEE, 2012.
|
| 218 |
+
|
| 219 |
+
Giambattista Parascandolo, Niki Kilbertus, Mateo Rojas-Carulla, and Bernhard Schölkopf. Learning independent causal mechanisms. In International Conference on Machine Learning, pp. 4036–4044. PMLR, 2018.
|
| 220 |
+
|
| 221 |
+
Deepak Pathak, Pulkit Agrawal, Alexei A Efros, and Trevor Darrell. Curiosity-driven exploration by self-supervised prediction. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pp. 16–17, 2017.
|
| 222 |
+
|
| 223 |
+
Christian F Perez, Felipe Petroski Such, and Theofanis Karaletsos. Generalized hidden parameter mdps: Transferable model-based rl in a handful of trials. AAAI Conference On Artifical Intelligence, 2020.
|
| 224 |
+
|
| 225 |
+
Jonas Peters, Dominik Janzing, and Bernhard Schölkopf. Elements of causal inference. The MIT Press, 2017.
|
| 226 |
+
|
| 227 |
+
Peter J Rousseeuw. Silhouettes: a graphical aid to the interpretation and validation of cluster analysis. Journal of computational and applied mathematics, 20:53–65, 1987.
|
| 228 |
+
|
| 229 |
+
Jürgen Schmidhuber. Developmental robotics, optimal artificial curiosity, creativity, music, and the fine arts. Connection Science, 18(2):173–187, 2006.
|
| 230 |
+
|
| 231 |
+
B. Schölkopf. Artificial intelligence: Learning to see and act (News & Views). Nature, 518(7540): 486–487, 2015.
|
| 232 |
+
|
| 233 |
+
Bernhard Schölkopf. Causality for machine learning. arXiv preprint arXiv:1911.10500, 2019.
|
| 234 |
+
|
| 235 |
+
Jiayu Yao, Taylor Killian, George Konidaris, and Finale Doshi-Velez. Direct policy transfer via hidden parameter markov decision processes. In LLARLA Workshop, FAIM, volume 2018, 2018.
|
| 236 |
+
|
| 237 |
+
Luisa Zintgraf, Kyriacos Shiarlis, Maximilian Igl, Sebastian Schulze, Yarin Gal, Katja Hofmann, and Shimon Whiteson. Varibad: A very good method for bayes-adaptive deep rl via meta-learning. arXiv preprint arXiv:1910.08348, 2019.
|
| 238 |
+
|
| 239 |
+
# A IMPLEMENTATION DETAILS FOR EXPERIMENT DISCOVERY
|
| 240 |
+
|
| 241 |
+
# A.1 PLANNER
|
| 242 |
+
|
| 243 |
+
The Experiment Planner consisted of a uniform distribution planner for a horizon of 6 control signals. The planner was trained using the Cross Entropy Method Model Predictive Control (Camacho & Alba (2013); De Boer et al. (2005)) on the true environment. We sampled 40 plans per iteration from the distribution initialized to uniform U(controlLow, controlHigh). Each of the sampled plans are applied to each of the training environments and the top $10 \%$ of the plans are used to update the distribution.
|
| 244 |
+
|
| 245 |
+

|
| 246 |
+
Figure 6: Overview of training. The experiment planner generates a trajectory of actions which is applied to each of the environments with varying causal factors namely mass, shape and size of blocks. For each environment, an observation trajectory or state $S ^ { ( i ) } \in \mathbb { S }$ is obtained. A simple model with fixed low expressive power is used to approximate the generative model for $S$ . The "information overflow" $L ( S | M )$ is returned as negative reward forcing $\mathbb { S }$ to be caused by few causal factors.
|
| 247 |
+
|
| 248 |
+
# A.2 TRAINING ENVIRONMENTS
|
| 249 |
+
|
| 250 |
+
The training environments vary in each experiment. In Section 4.3, we utilize 3 setups, Mass, SizeMass and ShapeSizeMass. For Mass, we allow the agent to access 5 environments with masses varying from $0 . 1 ~ \mathrm { k g }$ to $0 . 5 ~ \mathrm { k g }$ . In SizeMass, the agent has access to 30 environments with masses varying uniformly from 0.1 to $0 . 5 \mathrm { k g }$ and sizes from 0.05 to 0.1 meters. Finally, in ShapeSizeMass, the agent has access to 60 environments, with masses varying uniformly from 0.1 to $0 . 5 \mathrm { k g }$ , sizes from 0.05 to 0.1 meters and shapes either being cubes or spheres. During experiment discovery, in each environment, the agent has access to the position of the block in the environment along with its quaternion orientation.
|
| 251 |
+
|
| 252 |
+
The total number of causal causal factors of each environment are rather large in number due to the fact that the simulator is a complex realistic physics engine. Examples of the causal factors in the environment include gravity, friction coefficients between all on interacting surfaces, shapes, sizes and masses of blocks, control signal frequencies of the environment. However, we only vary 1 during Mass, 2 during SizeMass and 3 during ShapeSizeMass.
|
| 253 |
+
|
| 254 |
+
# A.3 CURIOSITY REWARD CALCULATION
|
| 255 |
+
|
| 256 |
+
We predetermine the minimum description length of the clustering model $L ( M )$ by assuming that the observations $O _ { 0 : T }$ , obtained by applying experimental behavior $a _ { 0 : T }$ are produced by a bi-modal generator distribution, where each mode corresponds to either a low or high (quantized) value of a causal factor. This also ensures that $L ( M )$ is as small as possible. The planner, eq. (5) solves the following optimization problem:
|
| 257 |
+
|
| 258 |
+
$$
|
| 259 |
+
\begin{array} { r l } { \underset { a _ { 0 : T } \in A ^ { T } } { \mathrm { a r g } \mathrm { m a x } } [ \mathrm { m i n } \{ d ( o _ { 0 : T } , o _ { 0 : T } ^ { \prime } ) : o _ { 0 : T } \in O , o _ { 0 : T } ^ { \prime } \in O ^ { \prime } \} - } & { \mathrm { } \mathrm { m a x } \{ d ( o _ { 0 : T } , o _ { 0 : T } ^ { \prime \prime } ) : o _ { 0 : T } ^ { \prime \prime } , o _ { 0 : T } \in O \} - } \\ { \mathrm { m a x } \{ d ( o _ { 0 : T } ^ { \prime } , o _ { 0 : T } ^ { \prime \prime } ) : o _ { 0 : T } ^ { \prime } , o _ { 0 : T } ^ { \prime \prime \prime } \in O ^ { \prime } \} ] } \end{array}
|
| 260 |
+
$$
|
| 261 |
+
|
| 262 |
+
the distance function $d ( \cdot , \cdot )$ in the space of trajectories is set to be Soft Dynamic Time Warping (Cuturi $\&$ Blondel (2017)). The trajectory length $T$ is 6 control steps long. The objective is a modified version of the Silhouette Score (Rousseeuw (1987)).
|
| 263 |
+
|
| 264 |
+
Intuitively, Objective (8) expresses the ability of a low complexity model, assumed to be bi-modal, to encode the state $S = o _ { 0 : T }$ . If multiple causal factors control $S$ , then the Minimum Description Length of $L ( S )$ will be high. Subsequently, since $M$ is a simple model, the deviation of $S$ from $M$ will be high i.e. $L ( S | M )$ will be high resulting in a low value of the optimization objective. $O$ and $O ^ { \prime }$ correspond to clusters of outcomes which quantize the values of a causal factor isolated by $a _ { 0 : T }$ $O _ { 0 : T } , o _ { 0 : T } ^ { \prime \prime } \in S$ correspond to trajectories of states i.e. observations obtained by applying $a _ { 0 : T }$ to environments with say, low values of a causal factor while $o _ { 0 : T } ^ { \prime } , o _ { 0 : T } ^ { \prime \prime \prime } \in O ^ { \prime }$ correspond to trajectories of observations i.e. state obtained by applying $a _ { 0 : T }$ to environments with say, high values of the same causal factor. Objective (8) attempts to ensure that these clusters are far apart from each other and are tight i.e. a simple model $M$ encodes $S$ well.
|
| 265 |
+
|
| 266 |
+
We further motivate how this formulation allows disentanglement of causal factors. A central assumption is that causal factors are independent, by definition, i.e. Independent Mechanisms Assumption Peters et al. (2017). Consider the outcome $S$ obtained by applying an action sequence $a _ { 0 : T }$ to a set of environments. If the action sequence $a _ { 0 : T }$ results in multiple causal factors affecting the outcome $S$ , the Kolmogorov complexity of $S$ will be high. The reason for this is that each causal factor has its own independent causal mechanism (Peters et al. (2017); Parascandolo et al. (2018)) that affects $S$ . Thus, given this independence, the information in $S$ will be a sum of the information “injected” into it from the multiple causes. Conversely, if the outcome $S$ obtained by applying an action sequence $a _ { 0 : T }$ has a lower Kolmogorov Complexity, then $S$ is caused by fewer causal factors. Causal Curiosity attempts to reduce this complexity of $S$ , by assuming a simple generative model $M$ is sufficient to encode $S$ . Thus for experimental behaviors which allow several causes to affect $S$ , the “overflow” of $S$ from $M$ will be high and subsequently the causal curiosity reward will be low. Thus, post-optimization of the objective, we arrive at an action sequence that allows for disentanglement of the causal factors.
|
| 267 |
+
|
| 268 |
+
# B IMPLEMENTATION DETAILS FOR TRANSFER
|
| 269 |
+
|
| 270 |
+
In Section 4.4, we show the utility of learning causal representations in 2 separate experimental setups. During TransferMass, the agent has access to 10 environments during training, with masses ranging from 0.1 to $0 . 5 \mathrm { k g }$ . At test time, the agent is required to perform the place-and-orient task masses 2 masses - $0 . 7 \mathrm { k g }$ and $0 . 7 5 \mathrm { k g }$ . During TransferSizeMass, the agent has access to 10 environments during training, with sizes from either 0.01 or $0 . 0 5 \mathrm { m }$ and masses ranging from 0.1 to $0 . 5 \mathrm { k g }$ . At test time the agent is asked to perform the task on 2 environments with masses $0 . 7 \mathrm { k g }$ and $0 . 7 5 \mathrm { k g }$ with sizes $= 0 . 0 5 \mathrm { m }$ .
|
| 271 |
+
|
| 272 |
+
We find that testing with large and light blocks increase the chances of accidental goal completions. Thus, during test-time, we use environments with high masses for out-of-distribution testing. The causal representation is concatenated to the state of the environment as a contextual input and supplied to a PPO-Optimized Actor-Critic Policy. The policy network consists of 2 hidden layers with 256 and 128 units respectively. The experiments are parallelized on 10 CPUs and implemented using stable baselines (Hill et al. (2018)).
|
| 273 |
+
|
| 274 |
+
The agent receives a dense reward at each time step during the maximizing external reward phase (Figure 1), the negative of the distance of the block from the goal position scaled by factor of 1000. The control signal was repeated 10 times to the actuators of the motors on each finger.
|
| 275 |
+
|
| 276 |
+
# C IMPLEMENTATION DETAILS FOR SECTION 4.2
|
| 277 |
+
|
| 278 |
+
In section 4.2, we study how the acquired experimental behaviors obtained through Causal Curiosity can be used as pre-training for a variety of downstream tasks. The Vanilla CEM depicts the cost of training an experiment planner from scratch to maximize an external dense reward where the agent minimizes the distance between the position of a block in an environment from the goal in the Lifting setup and imparts a velocity to the block along a particular direction in the Travel setup.
|
| 279 |
+
|
| 280 |
+
$$
|
| 281 |
+
R ( a _ { 0 : T } ) = - \sum _ { t } d i s t ( g o a l _ { t } - b l o c k _ { t } )
|
| 282 |
+
$$
|
| 283 |
+
|
| 284 |
+
The second baseline (Additive Reward) studies the setup when the agent receives both the curiosity signal and the external reward and attempts to maximize both. The agent receives access all the
|
| 285 |
+
|
| 286 |
+
training environments with varying causal factors and must simultaneously maximize both curiosity and the task reward. The equation below shows the reward maximized for the Lifting task.
|
| 287 |
+
|
| 288 |
+
$$
|
| 289 |
+
\begin{array} { r l r } { \displaystyle R ( a _ { 0 : T } ) = \sum _ { e n v s } \sum _ { t } ^ { T } - d i s t ( g o a l _ { t } - b l o c k _ { t } ) + } & \\ { \displaystyle [ \operatorname* { m i n } \{ d ( o _ { 0 : T } , o _ { 0 : T } ^ { \prime } ) : o _ { 0 : T } \in O , o _ { 0 : T } ^ { \prime } \in O ^ { \prime } \} - } & { \operatorname* { m a x } \{ d ( o _ { 0 : T } , o _ { 0 : T } ^ { \prime \prime } ) : o _ { 0 : T } ^ { \prime \prime } , o _ { 0 : T } \in O \} - } & \\ { \operatorname* { m a x } \{ d ( o _ { 0 : T } ^ { \prime } , o _ { 0 : T } ^ { \prime \prime \prime } ) : o _ { 0 : T } ^ { \prime } , o _ { 0 : T } ^ { \prime \prime \prime } \in O ^ { \prime } \} ] } & \end{array}
|
| 290 |
+
$$
|
| 291 |
+
|
| 292 |
+
The curious agent first acquired the experimental behavior by interacting with multiple environments with varying causal factors. The lifting skill was obtained during Mass, when the agent attempted to differentiate between multiple blocks of varying mass. The curious agent trained for 600,000 time steps on the curiosity reward. The acquired behavior was then applied to the downstream lifting task and fine tuned to external rewards. The Vanilla CEM baseline had an identical structure to that of the Curious agent, and received only external reward as in Equation (9). The additive agent simultaneously optimized both external reward and the curiosity reward as in Equation (10).
|
| 293 |
+
|
| 294 |
+
# D INTUITION FOR DEFINITION OF CAUSAL FACTORS
|
| 295 |
+
|
| 296 |
+
We begin with a simple example of a person walking on earth. This person experiences various physical processes while interacting in her world, for example gravity, friction, wind etc. These physical processes affect the outcome of interactions of the person with her environment. For example, while jumping on earth, the human experiences gravity which affects the outcome of her jump, the fact that she falls back to the ground. Additionally, these physical processes (or causal mechanisms) are parameterized by causal factors, for example, acceleration constant due to gravity $g = 9 . 8 m / s ^ { 2 }$ on earth, or coefficients of friction between her feet and the ground which assume particular numerical values.
|
| 297 |
+
|
| 298 |
+
These causal factors may vary across multiple environments. For example, the person may walk on sand or on ice, surfaces with varying frictional values. Thus the outcome of running on such surfaces will vary, running on sand will require significant effort, while running on ice may result in the person slipping. Thus the coefficient of friction between the person’s feet and the surface she walks on affects the outcome of a particular behavior in said environment. In our definition, $h _ { j }$ are causal factors such friction with some particular coefficient of friction, or gravity with acceleration constant $g$ or other. $H$ is the global set containing all such causal factors.
|
| 299 |
+
|
| 300 |
+
Now we ask the question (which we subsequently answer), given multiple environments, how would a human characterize each of them depending on the value of a causal factor? Through experimental behaviors. The human in the above example would attempt to run in each of the environments she encountered, be it on sand, on ice, in mud etc. If she slipped in an environment, she would characterize it as slippery. If she didn’t, she would characterize it as non-slippery. We attempt to equip our agent with similar logic. The “sequence of actions” $\left( { { a _ { 0 : T } } } \right)$ described in our paper corresponds to the human running. The state $S ^ { ( i ) }$ in the environment $e ^ { ( i ) }$ consisting of the sequence of observations $\left( o _ { 0 : T } \right)$ corresponds to the outcome of running. $S$ might belong to either of the clusters of outcomes $S$ or $S ^ { \prime }$ corresponding to slipping or not slipping.
|
| 301 |
+
|
| 302 |
+
# E SCALABILITY LIMITATION
|
| 303 |
+
|
| 304 |
+
We utilize the extremely popular One-Factor-at-a-time (OFAT) general paradigm of scientific investigation, as an inspiration for our method. In the case of many hundreds of causal factors, the complexity of this method will scale exponentially. However, we believe that this would indeed be the case given a human experimenter attempting to discover the causation in any system she is studying. Learning about causation is a computationally expensive affair. We point the reader towards a wealth of material on the design of scientific experiments and more specifically the lack of scalability of OFAT (Fisher (1936); Hicks (1964); Czitrom (1999)). Nevertheless, OFAT remains the de facto standard for scientific investigation.
|
| 305 |
+
|
| 306 |
+
1: Input: Unseen Test Environment env, trained Planner and Causal Inference Module
|
| 307 |
+
2: Initialize causal $R e p = [ ]$
|
| 308 |
+
3: Initialize training environment set Envs
|
| 309 |
+
4: for $\mathbf { k }$ in range(K) do
|
| 310 |
+
5: Reset env
|
| 311 |
+
6: Sample experimental behavior $a _ { 0 : T } \sim \mathrm { C E M } ( \cdot | \ c a u s a l R e p )$
|
| 312 |
+
7: Apply $a _ { 0 : T }$ to env . Exploration Phase
|
| 313 |
+
8: Collect $S = o _ { 0 : T }$
|
| 314 |
+
9: Use learnt $q _ { M } ( z | S )$ for cluster assignment i.e. $z _ { k } = q _ { M } ( z | s , c a u s a l R e p )$
|
| 315 |
+
10: Append $z _ { k }$ to causalRep . Causal Inference Module
|
| 316 |
+
11: Learn a policy conditioned on causal factors $a _ { t } \sim \pi ( \cdot | o _ { t } , z _ { 0 : K } )$ to maximize external reward.
|
md/train/S1HlA-ZAZ/S1HlA-ZAZ.md
ADDED
|
@@ -0,0 +1,356 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# THE KANERVA MACHINE: A GENERATIVE DISTRIBUTED MEMORY
|
| 2 |
+
|
| 3 |
+
Yan Wu, Greg Wayne, Alex Graves, Timothy Lillicrap DeepMind {yanwu,gregwayne,gravesa,countzero}@google.com
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We present an end-to-end trained memory system that quickly adapts to new data and generates samples like them. Inspired by Kanerva’s sparse distributed memory, it has a robust distributed reading and writing mechanism. The memory is analytically tractable, which enables optimal on-line compression via a Bayesian update-rule. We formulate it as a hierarchical conditional generative model, where memory provides a rich data-dependent prior distribution. Consequently, the top-down memory and bottom-up perception are combined to produce the code representing an observation. Empirically, we demonstrate that the adaptive memory significantly improves generative models trained on both the Omniglot and CIFAR datasets. Compared with the Differentiable Neural Computer (DNC) and its variants, our memory model has greater capacity and is significantly easier to train.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Recent work in machine learning has examined a variety of novel ways to augment neural networks with fast memory stores. However, the basic problem of how to most efficiently use memory remains an open question. For instance, the slot-based external memory in models like Differentiable Neural Computers (DNCs Graves et al. (2016)) often collapses reading and writing into single slots, even though the neural network controller can in principle learn more distributed strategies. As as result, information is not shared across memory slots, and additional slots have to be recruited for new inputs, even if they are redundant with existing memories. Similarly, Matching Networks (Vinyals et al., 2016; Bartunov & Vetrov, 2016) and the Neural Episodic Controller (Pritzel et al., 2017) directly store embeddings of data. They therefore require the volume of memory to increase with the number of samples stored. In contrast, the Neural Statistician (Edwards & Storkey, 2016) summarises a dataset by averaging over their embeddings. The resulting “statistics” are conveniently small, but a large amount of information may be dropped by the averaging process, which is at odds with the desire to have large memories that can capture details of past experience.
|
| 12 |
+
|
| 13 |
+
Historically developed associative memory architectures provide insight into how to design efficient memory structures that store data in overlapping representations. For example, the Hopfield Net (Hopfield, 1982) pioneered the idea of storing patterns in low-energy states in a dynamic system. This type of model is robust, but its capacity is limited by the number of recurrent connections, which is in turn constrained by the dimensionality of the input patterns. The Boltzmann Machine (Ackley et al., 1985) lifts this constraint by introducing latent variables, but at the cost of requiring slow reading and writing mechanisms (i.e. via Gibbs sampling). This issue is resolved by Kanerva’s sparse distributed memory model (Kanerva, 1988), which affords fast reads and writes and dissociates capacity from the dimensionality of input by introducing addressing into a distributed memory store whose size is independent of the dimension of the data1.
|
| 14 |
+
|
| 15 |
+
In this paper, we present a conditional generative memory model inspired by Kanerva’s sparse distributed memory. We generalise Kanerva’s original model through learnable addresses and reparametrised latent variables (Rezende et al., 2014; Kingma & Welling, 2013; Bornschein et al., 2017). We solve the challenging problem of learning an effective memory writing operation by exploiting the analytic tractability of our memory model — we derive a Bayesian memory update rule that optimally trades-off preserving old content and storing new content. The resulting hierarchical generative model has a memory dependent prior that quickly adapts to new data, providing top-down knowledge in addition to bottom-up perception from the encoder to form the latent code representing data. As a generative model, our proposal provides a novel way of enriching the often over-simplified priors in VAE-like models (Rezende et al., 2016) through a adaptive memory. As a memory system, our proposal offers an effective way to learn online distributed writing which provides effective compression and storage of complex data.
|
| 16 |
+
|
| 17 |
+
# 2 BACKGROUND: VARIATIONAL AUTOENCODERS
|
| 18 |
+
|
| 19 |
+
Our memory architecture can be viewed as an extension of the variational autoencoder (VAE) (Rezende et al., 2014; Kingma & Welling, 2013), where the prior is derived from an adaptive memory store. A VAE has an observable variable $x$ and a latent variable $z$ . Its generative model is specified by a prior distribution $p _ { \theta } \left( z \right)$ and the conditional distribution $p _ { \theta } \left( x | z \right)$ . The intractable posterior $p _ { \theta }$ $( z | x )$ is approximated by a parameterised inference model $q _ { \phi } \left( z | x \right)$ . Throughout this paper, we use $\theta$ to represent the generative model’s parameters, and $\phi$ to represent the inference model’s parameters. All parameterised distributions are implemented as multivariate Gaussian distributions with diagonal covariance matrices, whose means and variances are outputs from neural networks as in (Rezende et al., 2014; Kingma & Welling, 2013).
|
| 20 |
+
|
| 21 |
+
We assume a dataset with independently and identically distributed (iid) samples $\begin{array} { r l } { \mathcal { D } } & { { } = } \end{array}$ $\{ x _ { 1 } , \ldots , x _ { n } , \ldots , x _ { N } \}$ . The objective of training a VAE is to maximise its log-likelihood $\mathbb { E } _ { x \sim \mathcal { D } } \left[ \ln p _ { \theta } \left( x \right) \right]$ . This can be achieved by jointly optimising $\theta$ and $\phi$ for a variational lower-bound of the likelihood (omitting the expectation over all $x$ for simplicity):
|
| 22 |
+
|
| 23 |
+
$$
|
| 24 |
+
\mathcal { L } = \mathbb { E } _ { q _ { \phi } ( z | x ) } \left[ \ln p _ { \theta } \left( x | z \right) \right] - \operatorname { D } _ { \mathrm { K L } } \left( q _ { \phi } \left( z | x \right) \| p _ { \theta } \left( z \right) \right)
|
| 25 |
+
$$
|
| 26 |
+
|
| 27 |
+
where the first term can be interpreted as the negative reconstruction loss for reconstructing $x$ using its approximated posterior sample from $q _ { \phi } \left( z | x \right)$ , and the second term as a regulariser that encourages the approximated posterior to be near the prior of $z$ .
|
| 28 |
+
|
| 29 |
+
# 3 THE KANERVA MACHINE
|
| 30 |
+
|
| 31 |
+
To introduce our model, we use the concept of an exchangeable episode: $\begin{array} { r l } { X } & { { } = } \end{array}$ $\{ x _ { 1 } , \dotsc , x _ { t } , \dotsc , x _ { T } \} \subset { \mathcal { D } }$ is a subset of the entire dataset whose order does not matter. The objective of training is the expected conditional log-likelihood (Bornschein et al., 2017),
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
\mathcal { I } = \int p ( X , M ) \ln p _ { \theta } \left( X \mid M \right) \mathrm { d } M \mathrm { d } X = \int p ( X ) p ( M \mid X ) \sum _ { t = 1 } ^ { T } \ln p _ { \theta } \left( x _ { t } \mid M \right) \mathrm { d } M \mathrm { d } X
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
The equality utilises the conditional independence of $x _ { t }$ given the memory $M$ , which is equivalent to the assumption of an exchangeable episode $X$ (Aldous, 1985). We factorise the joint distribution of $p ( X , M )$ into the marginal distribution $p ( X )$ and the posterior $p ( M | X )$ , so that computing $p ( M | X )$ can be naturally interpreted as writing $X$ into the memory.
|
| 38 |
+
|
| 39 |
+
We propose this scenario as a general and principled way of formulating memory-based generative models, since $\mathcal { I }$ is directly related to the mutual information $I ( X ; M )$ through $I ( { \dot { X } } ; M ) { \stackrel { \textstyle = } { = } } H ( X ) -$ $\begin{array} { r } { H ( X | M ) = H ( X ) + \int p ( X , M ) \ln p _ { \theta } \left( X | M \right) \mathrm { d } X \mathrm { d } M = H ( X ) + \mathcal { I } . } \end{array}$ As the entropy of the data $H ( X )$ is a constant, maximising $\mathcal { I }$ is equivalent to maximising $I ( X ; M )$ , the mutual information between the memory and the episode to store.
|
| 40 |
+
|
| 41 |
+
# 3.1 THE GENERATIVE MODEL
|
| 42 |
+
|
| 43 |
+
We write the collection of latent variables corresponding to the observed episode $X$ as $Y =$ $\{ y _ { 1 } , . . . , y _ { t } , . . . , y _ { T } \}$ and $Z = \{ z _ { 1 } , \dots , z _ { t } , \dots , z _ { T } \}$ . As illustrated in Fig. 1 (left), the joint distribution of the generative model can be factorised as
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
p _ { \theta } \left( X , Y , Z | M \right) = \prod _ { t = 1 } ^ { T } p _ { \theta } \left( x _ { t } , y _ { t } , z _ { t } | M \right) = \prod _ { t = 1 } ^ { T } p _ { \theta } \left( x _ { t } | z _ { t } \right) p _ { \theta } \left( z _ { t } | y _ { t } , M \right) p _ { \theta } \left( y _ { t } \right)
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
The first equality uses the conditional independence of $z _ { t } , y _ { t } , x _ { t }$ given $M$ , shown by the "plates" in Fig. 1 (left). The memory $M$ is a $K \times C$ random matrix with the matrix variate Gaussian distribution (Gupta & Nagar, 1999):
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
p ( M ) = { \mathcal { M N } } ( R , U , V )
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+

|
| 56 |
+
Figure 1: The probabilistic graphical model for the Kanerva Machine. Left: the generative model; Central: reading inference model. Right: writing inference model; Dotted lines show approximate inference and dashed lines represent exact inference.
|
| 57 |
+
|
| 58 |
+
where $R$ is a $K \times C$ matrix as the mean of $M , U$ is a $K \times K$ matrix that provides the covariance between rows of $M$ , and $V$ is a $C \times C$ matrix providing covariances between columns of $M$ . This distribution is equivalent to the multivariate Gaussian distribution of vectorised $M$ : $p ( \operatorname { v e c } ( M ) ) = \mathcal { N } ( \operatorname { v e c } ( M ) | \operatorname { \bar { v e c } } ( R ) , V \otimes U )$ , where vec $( \cdot )$ is the vectorisation operator and $\otimes$ denotes the Kronecker product. We assume independence between the columns but not the rows of $M$ , by fixing $V$ to be the identity matrix $I _ { C }$ and allow the full degree of freedom for $U$ . Since our experiments suggest the covariance between rows is useful for coordinating memory access, this setting balances simplicity and performance (Fig. 10).
|
| 59 |
+
|
| 60 |
+
Accompanying $M$ are the addresses $A$ , a $K \times S$ real-value matrix that is randomly initialised and is optimised through back-propagation. To avoid degeneracy, rows of $A$ are normalised to have L2-norms of 1. The addressing variable $y _ { t }$ is used to compute the weights controlling memory access. As in VAEs, the prior $p _ { \theta } \left( y _ { t } \right)$ is an isotropic Gaussian distribution $\bar { \mathcal { N } } ( \mathbf { 0 } , \mathbf { 1 } )$ . A learned projection $b _ { t } = f ( y _ { t } )$ then transforms $y _ { t }$ into a $S \times 1$ key vector. The $K \times 1$ vector $w _ { t }$ , as weights across the rows of $M$ , is computed via the product:
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
w _ { t } = b _ { t } \mathsf { \bar { r } } \cdot A = f ( y _ { t } ) \mathsf { \bar { r } } \cdot A
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
The projection $f$ is implemented as a multi-layer perception (MLP), which transforms the distribution of $y _ { t }$ , as well as $w _ { t }$ , to potentially non-Gaussian distributions that may better suit addressing.
|
| 67 |
+
|
| 68 |
+
The code $z _ { t }$ is a learned representation that generates samples of $x _ { t }$ through the parametrised conditional distribution $p _ { \theta } \left( x _ { t } | z _ { t } \right)$ . This distribution is tied for all $t \in \{ 1 \ldots T \}$ . Importantly, instead of the isotropic Gaussian prior, $z _ { t }$ has a memory dependent prior:
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
p _ { \theta } ( z _ { t } | y _ { t } , M ) = \mathcal { N } \left( z _ { t } \middle | w _ { t } ^ { \textsf { T } } \cdot M , \sigma ^ { 2 } I _ { C } \right)
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
whose mean is a linear combination of memory rows, with the noise covariance matrix fixed as an identity matrix by setting $\sigma ^ { 2 } = 1$ . This prior results in a much richer marginal distribution, because of its dependence on memory and the addressing variable $y _ { t }$ through $p _ { \theta } ( z _ { t } | M ) =$ $\begin{array} { r } { \int p _ { \theta } ( z _ { t } | y _ { t } , M ) p _ { \theta } ( y _ { t } ) \bar { \mathrm { d } } y _ { t } } \end{array}$ .
|
| 75 |
+
|
| 76 |
+
In our hierarchical model, $M$ is a global latent variable for an episode that captures statistics of the entire episode (Bartunov & Vetrov, 2016; Edwards & Storkey, 2016), while the local latent variables $y _ { t }$ and $z _ { t }$ capture local statistics for data $x _ { t }$ within an episode. To generate an episode of length $T$ , we first sample $M$ once, then sample $y _ { t } , z _ { t }$ , and $x _ { t }$ sequentially for each of the $T$ samples.
|
| 77 |
+
|
| 78 |
+
# 3.2 THE READING INFERENCE MODEL
|
| 79 |
+
|
| 80 |
+
As illustrated in Fig. 1 (central), the approximated posterior distribution is factorised using the conditional independence:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
q _ { \phi } \left( Y , Z | X , M \right) = \prod _ { t = 1 } ^ { T } q _ { \phi } \left( y _ { t } , z _ { t } | x _ { t } , M \right) = \prod _ { t = 1 } ^ { T } q _ { \phi } \left( z _ { t } | x _ { t } , y _ { t } , M \right) q _ { \phi } \left( y _ { t } | x _ { t } \right)
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
where $q _ { \phi } \left( y _ { t } | x _ { t } \right)$ is a parameterised approximate posterior distribution. The posterior distribution $q _ { \phi } \left( z _ { t } | x _ { t } , y _ { t } , M \right)$ refines the (conditional) prior distribution $p _ { \theta } ( z _ { t } | y _ { t } , M )$ with additional evidence from $x _ { t }$ . This parameterised posterior takes the concatenation of $x _ { t }$ and the mean of $p _ { \theta } ( z _ { t } | y _ { t } , M )$ (eq. 6) as input. The constant variance of $p _ { \theta } ( z _ { t } | y _ { t } , M )$ is omitted. Similar to the generative model, $q _ { \phi } \left( y _ { t } | x _ { t } \right)$ is shared for all $t \in \{ 1 \ldots T \}$ .
|
| 87 |
+
|
| 88 |
+
# 3.3 THE WRITING INFERENCE MODEL
|
| 89 |
+
|
| 90 |
+
A central difficulty in updating memory is the trade-off between preserving old information and writing new information. It is well known that this trade-off can be balanced optimally through Bayes’ rule MacKay (2003). From the generative model perspective (eq. 2), it is natural to interpret memory writing as inference — computing the posterior distribution of memory $p ( M | X )$ . This section considers both batch inference — directly computing $p ( M | X )$ and on-line inference — sequentially accumulating evidence from $x _ { 1 } , \ldots , x _ { T }$ .
|
| 91 |
+
|
| 92 |
+
Following Fig. 1 (right), the approximated posterior distribution of memory can be written as
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\begin{array} { l } { q _ { \phi } \left( M | X \right) = \displaystyle \int p _ { \theta } \left( M , Y , Z | X \right) \mathrm { d } Z \mathrm { d } Y } \\ { \displaystyle \qquad = \int p _ { \theta } ( M | \{ y _ { 1 } , \dots , y _ { T } \} , \{ z _ { 1 } , \dots , z _ { T } \} ) \prod _ { t = 1 } ^ { T } q _ { \phi } ( z _ { t } | x _ { t } ) q _ { \phi } ( y _ { t } | x _ { t } ) \mathrm { d } z _ { t } \mathrm { d } y _ { t } } \\ { \displaystyle \qquad \approx p _ { \theta } \left( M | \{ y _ { 1 } , \dots , y _ { T } \} , \{ z _ { 1 } , \dots , z _ { T } \} \right) \Big | _ { y _ { t } \sim q _ { \phi } ( y _ { t } | x _ { t } ) , z _ { t } \sim q _ { \phi } ( z _ { t } | x _ { t } ) } } \end{array}
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
The last line uses one sample of $y _ { t } , \ x _ { t }$ to approximate the intractable integral. The posterior of the addressing variable $q _ { \phi } \left( y _ { t } | x _ { t } \right)$ is the same as in section 3.2, and the posterior of code $q _ { \phi } \left( z _ { t } | x _ { t } \right)$ is a parameterised distribution. We use the short-hand $p _ { \theta }$ $_ { 9 } \left( M | Y , Z \right)$ for $p _ { \theta } \left( M | \{ y _ { 1 } , \dots , y _ { T } \} , \{ z _ { 1 } , \dots , z _ { T } \} \right)$ when $Y , Z$ are sampled as described here. We abuse notation in this section and use $Z =$ $\big ( z _ { 1 } { \boldsymbol { \mathsf { \mathsf { \mathsf { \Pi } } } } } ; \qquad \ldots , ; z _ { T } { \boldsymbol { \mathsf { \mathsf { \mathsf { \Pi } } } } } ^ { \mathsf { \mathsf { \mathsf { \mathsf { \mathsf { \mathsf { \mathsf { \Pi } } } } } } } } \big )$ as a $T \times C$ matrix with all the observations in an episode, and $W = ( w _ { 1 } \mathsf { \bar { r } } ; \dots ; w _ { T } \mathsf { \bar { r } } )$ as a $T \times K$ matrix with all corresponding weights for addressing.
|
| 99 |
+
|
| 100 |
+
Given the linear Gaussian model (eq. 6), the posterior of memory $p _ { \theta } \left( M | Y , Z \right)$ is analytically tractable, and its parameters $R$ and $U$ can be updated as follows:
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\begin{array} { r l r l } & { \Delta Z - W R } \\ & { \Sigma _ { c } W U } \\ & { R R + \Sigma _ { c } \mathbf { \bar { T } } \Sigma _ { z } ^ { - 1 } \Delta } & & { U U - \Sigma _ { c } \mathbf { \bar { T } } \Sigma _ { z } ^ { - 1 } \Sigma _ { c } } \end{array}
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
where $\Delta$ is the prediction error before updating the memory, $\Sigma _ { c }$ is a $T \times K$ matrix providing the cross-covariance between $Z$ and $M$ , $\Sigma _ { \xi }$ is a $T \times T$ diagonal matrix whose diagonal elements are the noise variance $\sigma ^ { 2 }$ and $\Sigma _ { z }$ is a $T \times T$ matrix that encodes the covariance for $z _ { 1 } , \dots , z _ { T }$ . This update rule is derived from applying Bayes’ rule to the linear Gaussian model (Appendix E). The prior parameters of $p ( M )$ , $R _ { 0 }$ and $U _ { 0 }$ are trained through back-propagation. Therefore, the prior of $M$ can learn the general structure of the entire dataset, while the posterior is left to adapt to features presented in a subset of data observed within a given episode.
|
| 107 |
+
|
| 108 |
+
The main cost of the update rule comes from inverting $\Sigma _ { z }$ , which has a complexity of $\mathcal { O } ( T ^ { 3 } )$ . One may reduce the per-step cost via on-line updating, by performing the update rule using one sample at a time — when $X = x _ { t }$ , $\Sigma _ { z }$ is a scalar which can be inverted trivially. According to Bayes’ rule, updating using the entire episode at once is equivalent to performing the one-sample/on-line update iteratively for all observations in the episode. Similarly, one can perform intermediate updates using mini-batch with size between 1 and $T$ .
|
| 109 |
+
|
| 110 |
+
Another major cost in the update rule is the storage and multiplication of the memory’s row-covariance matrix $U$ , with the complexity of $\mathcal { O } ( K ^ { 2 } )$ . Although restricting this covariance to diagonal can reduce this cost to $\mathcal O ( K )$ , our experiments suggested this covariance is useful for coordinating memory accessing (Fig. 10). Moreover, the cost of $\mathcal { O } ( K ^ { 2 } )$ is usually small, since parameters of the model are dominated by the encoder and decoder. Nevertheless, a future direction is to investigating low-rank approximation of $U$ that better balance cost and performance.
|
| 111 |
+
|
| 112 |
+
# 3.4 TRAINING
|
| 113 |
+
|
| 114 |
+
To train this model, we optimise a variational lower-bound of the conditional likelihood $J$ (eq. 2), which can be derived in a fashion similar to standard VAEs:
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\begin{array} { l } { \displaystyle \mathcal { L } = \mathbb { E } _ { q _ { \phi } ( M | X ) p ( X ) } \sum _ { t = 1 } ^ { T } \left\{ \mathbb { E } _ { q _ { \phi } ( y _ { t } , z _ { t } | x _ { t } , M ) } \left[ \ln p _ { \theta } \left( x _ { t } | z _ { t } \right) \right] \right. } \\ { \displaystyle \left. - \mathrm { D } _ { \mathrm { K L } } \left( q _ { \phi } \left( y _ { t } | x _ { t } \right) \| p _ { \theta } \left( y _ { t } \right) \right) - \mathrm { D } _ { \mathrm { K L } } \left( q _ { \phi } \left( z _ { t } | x _ { t } , y _ { t } , M \right) \| p _ { \theta } \left( z _ { t } | y _ { t } , M \right) \right) \right\} } \end{array}
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
To maximise this lower bound, we sample $y _ { t } , z _ { t }$ from $q _ { \phi } \left( y _ { t } , z _ { t } | x _ { t } , M \right)$ to approximate the inner expectation. For computational efficiency, we use a mean-field approximation for the memory — using the mean $R$ in the place of memory samples (since directly sampling $M$ requires expensive Cholesky decomposition of the non-diagonal matrix $U$ ). Alternatively, we can further exploit the analytical tractability of the Gaussian distribution to obtain distribution-based reading and writing operations (Appendix F).
|
| 121 |
+
|
| 122 |
+
Inside the bracket, the first term is the usual VAE reconstruction error. The first KL-divergence penalises complex addresses, and the second term penalises deviation of the code $z _ { t }$ from the memory-based prior. In this way, the memory learns useful representations that do not rely on complex addresses, and the bottom-up evidence only corrects top-down memory reading when necessary.
|
| 123 |
+
|
| 124 |
+
# 3.5 ITERATIVE SAMPLING
|
| 125 |
+
|
| 126 |
+
An important feature of Kanerva’s sparse distributed memory is its iterative reading mechanism, by which output from the model is fed back as input for several iterations. Kanerva proved that the dynamics of iterative reading will decrease errors when the initial error is within a generous range, converging to a stored memory (Kanerva, 1988). A similar iterative process is also available in our model, by repeatedly feeding-back the reconstruction $\hat { x } _ { t }$ . This Gibbs-like sampling follows the loop in Fig. 1 (central). While we cannot prove convergence, in our experiments iterative reading reliably improves denoising and sampling.
|
| 127 |
+
|
| 128 |
+
To understand this process, notice that knowledge about memory is helpful in reading, which suggests using $q _ { \phi } \left( y _ { t } | x _ { t } , M \right)$ instead of $q _ { \phi } \left( y _ { t } | x _ { t } \right)$ for addressing (section 3.2). Unfortunately, training a parameterised model with the whole matrix $M$ as input can be prohibitively costly. Nevertheless, it is well-known in the coding literature that such intractable posteriors that usually arise in non-tree graphs (as in Fig. 1) can be approximated efficiently by loopy belief-propagation, as has been used in algorithms like Turbo coding (Frey & MacKay, 1998). Similarly, we believe iterative reading works in our model because $q _ { \phi } \left( y _ { t } | x _ { t } \right)$ models the local coupling between $x _ { t }$ and $y _ { t }$ well enough, so iterative sampling with the rest of the model is likely to converge to the true posterior $q _ { \phi } \left( y _ { t } | x _ { t } , M \right)$ Future research will seek to better understand this process.
|
| 129 |
+
|
| 130 |
+
# 4 EXPERIMENTS
|
| 131 |
+
|
| 132 |
+
Details of our model implementation are described in Appendix C. We use straightforward encoder and decoder models in order to focus on evaluating the improvements provided by an adaptive memory. In particular, we use the same model architecture for all experiments with both Omniglot and CIFAR dataset, changing only the the number of filters in the convolutional layers, memory size, and code size. We always use the on-line version of the update rule (section 3.3). The Adam optimiser was used for all training and required minimal tuning for our model (Kingma & Ba, 2014). In all experiments, we report the value of variational lower bound (eq. 12) $L$ divided by the length of episode $T$ , so the per-sample value can be compared with the likelihood from existing models.
|
| 133 |
+
|
| 134 |
+
We first used the Omniglot dataset to test our model. This dataset contains images of hand-written characters with 1623 different classes and 20 examples in each class (Lake et al., 2015). This large variation creates challenges for models trying to capture the entire complex distribution. We use a $6 4 \times 1 0 0$ memory $M$ , and a smaller $6 4 \times 5 0$ address matrix $A$ . For simplicity, we always randomly sample 32 images from the entire training set to form an “episode”, and ignore the class labels. This represents a worst case scenario since the images in an episode will tend to have relatively little redundant information for compression. We use a mini-batch size of 16, and optimise the variational lower-bound (eq. 12) using Adam with learning rate $1 \times 1 0 ^ { - 4 }$ .
|
| 135 |
+
|
| 136 |
+
We also tested our model with the CIFAR dataset, in which each $3 2 \times 3 2 \times 3$ real-valued colour image contains much more information than a binary omniglot pattern. Again, we discard all the label information and test our model in the unsupervised setting. To accommodate the increased complexity of CIFAR, we use convolutional coders with 32 features at each layer, use a code size of 200, and a $1 2 8 \times 2 0 0$ memory with $1 2 8 \times 5 0$ address matrix. All other settings are identical to experiments with Omniglot.
|
| 137 |
+
|
| 138 |
+
# 4.1 COMPARISON WITH VAES
|
| 139 |
+
|
| 140 |
+
We first use the $2 8 \times 2 8$ binary Omniglot from Burda et al. (2015) and follow the same split of 24,345 training and 8,070 test examples. We first compare the training process of our model with a baseline
|
| 141 |
+
|
| 142 |
+
VAE model using the exact same encoder and decoder. Note that there is only a modest increase of parameters in the Kanerva Machine compared the VAE since the encoder and decoder dominates the model parameters.
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 2: The negative variational lower bound (left), reconstruction loss (central), and KL-Divergence (right) during learning. The dip in the KL-divergence suggests that our model has learned to use the memory.
|
| 146 |
+
|
| 147 |
+
Fig. 2 shows learning curves for our model along with those for the VAE trained on the Omniglot dataset. We plot 4 randomly initialised instances for each model. The training is stable and insensitive to initialisation. Fig. 2 (left) shows that our model reached a significantly lower negative variational lower-bound versus the VAE. Fig. 2 (central) and (right) further shows that the Kanerva Machine achieved better reconstruction and KL-divergence. In particular, the KL-divergence of our model “dips” sharply from about the 2000th step, implying our model learned to use the memory to induce a more informative prior. Fig. 11 confirms this: the KL-divergence for $z _ { t }$ has collapsed to near zero, showing that the top-down prior from memory $q _ { \phi } \left( z _ { t } | y _ { t } , M \right)$ provides most of the information for the code. This rich prior is achieved at the cost of an additional KL-divergence for $y _ { t }$ (Fig. 11, right) which is still much lower than the KL-divergence for $z _ { t }$ in a VAE. Similar training curves are observed for CIFAR training (Fig. 12). Gemici et al. (2017) also observed such KL-divergence dips with a memory model. They report that the reduction in KL-divergence, rather than the reduction in reconstruction loss, was particularly important for improving sample quality, which we also observed in our experiments with Omniglot and CIFAR.
|
| 148 |
+
|
| 149 |
+
At the end of training, our VAE reached a negative log-likelihood (NLL) of $\leq 1 1 2 . 7$ (the lower-bound of likelihood), which is worse than the state-of-the-art unconditioned generation that is achieved by rolling out 80 steps of a DRAW model (NLL of 95.5, Rezende et al., 2016), but comparable to results with IWAE training (NLL of 103.4, Burda et al., 2015). In contrast, with the same encoder and decoders, the Kanerva Machine achieve conditional NLL of 68.3. It is not fair to directly compare our results with unconditional generative models since our model has the advantage of its memory contents. Nevertheless, the dramatic improvement of NLL demonstrates the power of incorporating an adaptive memory into generative models. Fig. 3 (left) shows examples of reconstruction at the end of training; as a signature of our model, the weights were well distributed over the memory, illustrating that patterns written into the memory were superimposed on others.
|
| 150 |
+
|
| 151 |
+

|
| 152 |
+
Figure 3: Left: reconstruction of inputs and the weights used in reconstruction, where each bin represents the weight over one memory slot. Weights are widely distributed across memory slots. Right: denoising through iterative reading. In each panel: the first column shows the original pattern, the second column (in boxes) shows the corrupted pattern, and the following columns show the reconstruction after 1, 2 and 3 iterations.
|
| 153 |
+
|
| 154 |
+
# 4.2 ONE-SHOT GENERATION
|
| 155 |
+
|
| 156 |
+
We generalise “one-shot” generation from a single image (Rezende et al., 2016), or a few sample images from a limited set of classes (Edwards & Storkey, 2016; Bartunov & Vetrov, 2016), to a batch of images with many classes and samples. To better illustrate how samples are shaped by the conditioning data, in this section we use the same trained models, but test them using episodes with samples from only 2, 4 or 12 classes (omniglot characters)2. Fig. 4 compares samples from the VAE and the Kanerva Machine. While initial samples from our model (left most columns) are visually about as good as those from the VAE, the sample quality improved in consecutive iterations and the final samples clearly reflects the statistics of the conditioning patterns. Most samples did not change much after the 6th iteration, suggesting the iterative sampling had converged. Similar conditional samples from CIFAR are shown in Fig. 5. Notice that this approach, however, does not apply to VAEs, since VAEs do not have the structure we discussed in section 3.5. This is illustrated in Figure 8 by feeding back output from VAEs as input to the next iteration, which shows the sample quality did not improve after iterations.
|
| 157 |
+
|
| 158 |
+

|
| 159 |
+
Figure 4: One-shot generation given a batch of examples. The first panel shows reference samples from the matched VAE. Samples from our model conditioned on 12 random examples from the specified number of classes. Conditioning examples are shown above the samples. The 5 columns show samples after 0, 2, 4, 6, and 8 iterations.
|
| 160 |
+
|
| 161 |
+

|
| 162 |
+
Figure 5: Comparison of samples from CIFAR. The 24 conditioning images (top-right) are randomly sampled from the entire CIFAR dataset, so they contains a mix of many classes. Samples from the matched VAE are blurred and lack meaningful local structure. On the other hand, samples from the Kanerva Machine have clear local structures, despite using the same encoder and decoder as the VAE. The 5 columns show samples after 0, 2, 4, 6, and 8 iterations.
|
| 163 |
+
|
| 164 |
+
# 4.3 DENOISING AND INTERPOLATION
|
| 165 |
+
|
| 166 |
+
To further examine generalisation, we input images corrupted by randomly positioned $1 2 \times 1 2$ blocks, and tested whether our model can recover the original image through iterative reading. Our model was not trained on this task, but Fig. 3 (right) shows that, over several iterations, input images can be recovered. Due to high ambiguity, some cases (e.g., the second and last) ended up producing incorrect but still reasonable patterns.
|
| 167 |
+
|
| 168 |
+
The structure of our model affords interpretability of internal representations in memory. Since representations of data $x$ are obtained from a linear combination of memory slots (eq. 6), we expect linear interpolations between address weights to be meaningful. We examined interpolations by computing 2 weight vectors from two random input images, and then linearly interpolating between these two vectors. These vectors were then used to read $z _ { t }$ from memory (eq. 6), which is then decoded to produce the interpolated images. Fig. 7 in Appendix A shows that interpolating between these access weights indeed produces meaningful and smoothly changing images.
|
| 169 |
+
|
| 170 |
+

|
| 171 |
+
4.4 COMPARISON WITH DIFFERENTIABLE NEURAL COMPUTERS
|
| 172 |
+
Figure 6: Left: the training curves of DNC and Kanerva machine both shows 6 instances with the best hyperparameter configuration for each model found via grid search. DNCs were more sensitive to random initilisation, slower, and plateaued with larger error. Right: the test variational lower-bounds of a DNC (dashed lines) and a Kanerva Machine as a function of different episode sizes and different sample classes.
|
| 173 |
+
|
| 174 |
+
This section compares our model with the Differentiable Neural Computer (DNC, Graves et al., 2016), and a variant of it, the Least Recently Used Architecture (LRUA, Santoro et al., 2016). We test these using the same episode storage and retrieval task as in previous experiments with Omniglot data. For a fair comparison, we fit the DNC models into the same framework, as detailed in Appendix D. Fig. 6 (left) illustrates the process of training the DNC and the Kanerva Machine. The LRUA did not passed the loss level of 150, so we did not include it in the figure. The DNC reached a test loss close to 100, but was very sensitive to hyper-parameters and random initialisation: only 2 out of 6 instances with the best hyper-parameter configuration (batch size $= 1 6$ , learning rate= ${ \dot { 3 } } \times 1 0 ^ { - 4 }$ ) found by grid search reached this level. On the other hand, the Kanerva Machine was robust to these hyper-parameters, and worked well with batch sizes between 8 and 64, and learning rates between $3 \times 1 0 ^ { - 5 }$ and $3 \times 1 0 ^ { - 4 }$ . The Kanerva Machine trained fastest with batch size 16 and learning rate $1 \times 1 0 ^ { - 4 }$ and eventually converged below 70 test loss with all tested configurations. Therefore, the Kanerva Machine is significantly easier to train, thanks to principled reading and writing operations that do not depend on any model parameter.
|
| 175 |
+
|
| 176 |
+
We next analysed the capacity of our model versus the DNC by examining the lower bound of then likelihood when storing and then retrieving patterns from increasingly large episodes. As above, these models are still trained with episodes containing 32 samples, but are tested on much larger episodes. We tested our model with episodes containing different numbers of classes and thus varying amounts of redundancy. Fig. 6 (right) shows both models are able to exploit this redundancy, since episodes with fewer classes (but the same number of images) have lower reconstruction losses. Overall, the Kanerva Machine generalises well to larger episodes, and maintained a clear advantage over the DNC (as measured by the variational lower-bound).
|
| 177 |
+
|
| 178 |
+
# 5 DISCUSSION
|
| 179 |
+
|
| 180 |
+
In this paper, we present the Kanerva Machine, a novel memory model that combines slow-learning neural networks and a fast-adapting linear Gaussian model as memory. While our architecture is inspired by Kanerva’s seminal model, we have removed the assumption of a uniform data distribution by training a generative model that flexibly learns the observed data distribution. By implementing memory as a generative model, we can retrieve unseen patterns from the memory through sampling. This phenomenon is consistent with the observation of constructive memory neuroscience experiments (Hassabis et al., 2007).
|
| 181 |
+
|
| 182 |
+
Probabilistic interpretations of Kanerva’s model have been developed in previous works: Anderson (1989) explored a conditional probability interpretation of Kanerva’s sparse distributed memory, and generalised binary data to discrete data with more than two values. Abbott et al. (2013) provides an approximate Bayesian interpretation based on importance sampling. To our knowledge, our model is the first to generalise Kanerva’s memory model to continuous, non-uniform data while maintaining an analytic form of Bayesian inference. Moreover, we demonstrate its potential in modern machine learning through integration with deep neural networks.
|
| 183 |
+
|
| 184 |
+
Other models have combined memory mechanisms with neural networks in a generative setting. For example, Li et al. (2016) used attention to retrieve information from a set of trainable parameters in a memory matrix. Notably, the memory in this model is not updated following learning. As a result, the memory does not quickly adapt to new data as in our model, and so is not suited to the kind of episode-based learning explored here. Bornschein et al. (2017) used discrete (categorical) random variables to address an external memory, and train the addressing mechanism, together with the rest of the generative model, though a variational objective. However, the memory in their model is populated by storing images in the form of raw pixels. Although this provides a mechanism for fast adaptation, the cost of storing raw pixels may be overwhelming for large data sets. Our model learns to to store information in a compressed form by taking advantage of statistical regularity in the images via the encoder at the perceptual level, the learned addresses, and Bayes’ rule for memory updates.
|
| 185 |
+
|
| 186 |
+
Central to an effective memory model is the efficient updating of memory. While various approaches to learning such updating mechanisms have been examined recently (Graves et al., 2016; Edwards & Storkey, 2016; Santoro et al., 2016), we designed our model to employ an exact Bayes’ update-rule without compromising the flexibility and expressive power of neural networks. The compelling performance of our model and its scalable architecture suggests combining classical statistical models and neural networks may be a promising direction for novel memory models in machine learning.
|
| 187 |
+
|
| 188 |
+
# ACKNOWLEDGMENTS
|
| 189 |
+
|
| 190 |
+
We would like to thank Sergey Bartunov, Charles Blundell, Jörg Bornschein, Karol Gregor, Shakir Mohamed, and Benigno Uria for helpful discussions, and to thank Dillon Graham and Jascha Sohl-Dickstein for pointing out mistakes in earlier manuscripts.
|
| 191 |
+
|
| 192 |
+
# REFERENCES
|
| 193 |
+
|
| 194 |
+
Joshua T Abbott, Jessica B Hamrick, Thomas L Griffiths, et al. Approximating bayesian inference with a sparse distributed memory system. In Proceedings of the 35th annual conference of the cognitive science society, pp. 1686–1691, 2013.
|
| 195 |
+
David H Ackley, Geoffrey E Hinton, and Terrence J Sejnowski. A learning algorithm for boltzmann machines. Cognitive science, 9(1):147–169, 1985.
|
| 196 |
+
David J Aldous. Exchangeability and related topics. In École d’Été de Probabilités de Saint-Flour XIII—1983, pp. 1–198. Springer, 1985.
|
| 197 |
+
Charles H Anderson. A conditional probability interpretation of kanerva’s sparse distributed memory. Jet Propulsion, 1000:23–100, 1989.
|
| 198 |
+
Sergey Bartunov and Dmitry P Vetrov. Fast adaptation in generative models with generative matching networks. arXiv preprint arXiv:1612.02192, 2016.
|
| 199 |
+
Jörg Bornschein, Andriy Mnih, Daniel Zoran, and Danilo J Rezende. Variational memory addressing in generative models. arXiv preprint arXiv:1709.07116, 2017.
|
| 200 |
+
Yuri Burda, Roger Grosse, and Ruslan Salakhutdinov. Importance weighted autoencoders. arXiv preprint arXiv:1509.00519, 2015.
|
| 201 |
+
|
| 202 |
+
Harrison Edwards and Amos Storkey. Towards a neural statistician. arXiv preprint arXiv:1606.02185, 2016.
|
| 203 |
+
|
| 204 |
+
Brendan J Frey and David JC MacKay. A revolution: Belief propagation in graphs with cycles. In Advances in neural information processing systems, pp. 479–485, 1998.
|
| 205 |
+
|
| 206 |
+
Mevlana Gemici, Chia-Chun Hung, Adam Santoro, Greg Wayne, Shakir Mohamed, Danilo J Rezende, David Amos, and Timothy Lillicrap. Generative temporal models with memory. arXiv preprint arXiv:1702.04649, 2017.
|
| 207 |
+
|
| 208 |
+
Alex Graves, Greg Wayne, Malcolm Reynolds, Tim Harley, Ivo Danihelka, Agnieszka GrabskaBarwinska, Sergio Gómez Colmenarejo, Edward Grefenstette, Tiago Ramalho, John Agapiou, et al. ´ Hybrid computing using a neural network with dynamic external memory. Nature, 538(7626): 471–476, 2016.
|
| 209 |
+
|
| 210 |
+
Arjun K Gupta and Daya K Nagar. Matrix variate distributions, volume 104. CRC Press, 1999.
|
| 211 |
+
|
| 212 |
+
Demis Hassabis, Dharshan Kumaran, Seralynne D Vann, and Eleanor A Maguire. Patients with hippocampal amnesia cannot imagine new experiences. Proceedings of the National Academy of Sciences, 104(5):1726–1731, 2007.
|
| 213 |
+
|
| 214 |
+
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.
|
| 215 |
+
|
| 216 |
+
John J Hopfield. Neural networks and physical systems with emergent collective computational abilities. Proceedings of the national academy of sciences, 79(8):2554–2558, 1982.
|
| 217 |
+
|
| 218 |
+
Pentti Kanerva. Sparse distributed memory. MIT press, 1988.
|
| 219 |
+
|
| 220 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 221 |
+
|
| 222 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. In Proceedings of the 2nd International Conference on Learning Representations (ICLR), 2013.
|
| 223 |
+
|
| 224 |
+
Brenden M Lake, Ruslan Salakhutdinov, and Joshua B Tenenbaum. Human-level concept learning through probabilistic program induction. Science, 350(6266):1332–1338, 2015.
|
| 225 |
+
|
| 226 |
+
Chongxuan Li, Jun Zhu, and Bo Zhang. Learning to generate with memory. In International Conference on Machine Learning, pp. 1177–1186, 2016.
|
| 227 |
+
|
| 228 |
+
David JC MacKay. Information theory, inference and learning algorithms. Cambridge university press, 2003.
|
| 229 |
+
|
| 230 |
+
Alexander Pritzel, Benigno Uria, Sriram Srinivasan, Adrià Puigdomènech, Oriol Vinyals, Demis Hassabis, Daan Wierstra, and Charles Blundell. Neural episodic control. arXiv preprint arXiv:1703.01988, 2017.
|
| 231 |
+
|
| 232 |
+
Danilo J. Rezende, Shakir Mohamed, Ivo Danihelka, Karol Gregor, and Daan Wierstra. One-shot generalization in deep generative models. In Proceedings of the 33rd International Conference on International Conference on Machine Learning - Volume 48, ICML’16, pp. 1521–1529. JMLR.org, 2016. URL http://dl.acm.org/citation.cfm?id=3045390.3045551.
|
| 233 |
+
|
| 234 |
+
Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In The 31st International Conference on Machine Learning (ICML), 2014.
|
| 235 |
+
|
| 236 |
+
Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy Lillicrap. Metalearning with memory-augmented neural networks. In Maria Florina Balcan and Kilian Q. Weinberger (eds.), Proceedings of The 33rd International Conference on Machine Learning, volume 48 of Proceedings of Machine Learning Research, pp. 1842–1850, New York, New York, USA, 20–22 Jun 2016. PMLR.
|
| 237 |
+
|
| 238 |
+
Oriol Vinyals, Charles Blundell, Tim Lillicrap, Daan Wierstra, et al. Matching networks for one shot learning. In Advances in Neural Information Processing Systems, pp. 3630–3638, 2016.
|
| 239 |
+
|
| 240 |
+
# APPENDIX
|
| 241 |
+
|
| 242 |
+
A EXTRA FIGURES
|
| 243 |
+
|
| 244 |
+

|
| 245 |
+
Figure 7: Interpolation for Omniglot and CIFAR images. The first and last column show 2 random images from the data. Between them are linear interpolations in the space of memory accessing weights $w _ { t }$ .
|
| 246 |
+
|
| 247 |
+

|
| 248 |
+
Figure 8: Iteratively sampled priors from VAE, for both Omniglot (left) and Cifar (right). In both panels, the columns show samples after 0, 2, 4, 6, 8 and 10 iterations, mirroring the procedure producing figure 4 and 5.
|
| 249 |
+
|
| 250 |
+
# B SPARSE DISTRIBUTED MEMORY
|
| 251 |
+
|
| 252 |
+
This section reviews Kanerva’s sparse distributed memory (Kanerva, 1988). For consistency with the rest of this paper, many of the notations are different from Kanerva’s description. In contrast to many recent models, Kanerva’s memory model is characterised by its distributed reading and writing operations. The model has two main components: a fixed table of addresses $A$ pointing to a modifiable memory $M$ . Both $A$ and $M$ have the same size of $K \times D$ , where $K$ is the number of addresses that and $D$ is the input dimensionality. Kanerva assumes all the inputs are uniform random vectors $\underline { { y } } \in \{ - 1 , 1 \} ^ { D }$ . Therefore, the fixed addresses $A _ { i }$ are uniformly randomly sampled from $\{ - 1 , 1 \} ^ { D }$ to reflect the input statistics.
|
| 253 |
+
|
| 254 |
+
An input $y$ is compared with each address $A _ { k }$ in $A$ through the Hamming distance. For binary vectors $a , b \in \{ - 1 , 1 \} ^ { D }$ , the Hamming distance can be written as $\begin{array} { r } { h ( a , b ) = \frac { 1 } { 2 } ( \mathbf { \bar { \boldsymbol { D } } } - \boldsymbol { a } \cdot \boldsymbol { b } ) } \end{array}$ where $\cdot$ represents inner product between two vectors. An address $k$ is selected when the hamming distance between $x$ and $A _ { k }$ is smaller than a threshold $\tau$ , so the selection can be summarised by the binary weight vector:
|
| 255 |
+
|
| 256 |
+
$$
|
| 257 |
+
w _ { k } = \left\{ { \begin{array} { l l } { 1 , \quad } & { h ( x , A _ { k } ) \leqslant \tau } \\ { 0 , } & { \mathrm { o t h e r w i s e } } \end{array} } \right.
|
| 258 |
+
$$
|
| 259 |
+
|
| 260 |
+
During writing, a pattern $x$ is stored into $M$ by adding $M _ { k } \gets M _ { k } + w _ { k } x .$ . For reading, the memory contents pointed to by all the selected addresses are summed together to pass a threshold at 0 to produce a read out:
|
| 261 |
+
|
| 262 |
+
$$
|
| 263 |
+
\hat { x } = \left\{ \begin{array} { l l } { 1 , } & { ~ \sum _ { k = 1 } ^ { K } w _ { k } M _ { k } > 0 } \\ { - 1 , } & { ~ \mathrm { o t h e r w i s e } } \end{array} \right.
|
| 264 |
+
$$
|
| 265 |
+
|
| 266 |
+
This reading process can be iterated several times by repeatedly feeding-back the output $\hat { x }$ as input.
|
| 267 |
+
|
| 268 |
+
It has been shown analytically by Kanerva that when both $K$ and $D$ are large enough, a small portion of the addresses will always be selected, thus the operations are sparse and distributed. Although an address’ content may be over-written many times, the stored vectors can be retrieved correctly. Moreover, Kanerva proved that even a significantly corrupted query can be discovered from the memory through iterative reading. However, the application of Kanerva’s model is restricted by the assumption of a uniform and binary data distribution, on which Kanerva’s analyses and bounds of performance rely (Kanerva, 1988). Unfortunately, this assumption is rarely true in practice, since real-world data typically lie on low-dimensional manifolds, and binary representation of data is less efficient in high-level neural network implementations that are heavily optimised for floating-point numbers.
|
| 269 |
+
|
| 270 |
+
# C MODEL DETAILS
|
| 271 |
+
|
| 272 |
+
Figure 9 shows the architecture of our model compared with a standard VAE. For all experiments, we use a convolutional encoder to convert input images into $2 C$ embedding vectors $e ( \bar { x } _ { t } )$ , where $C$ is the code size (dimension of $z _ { t }$ ). The convolutional encoder has 3 consecutive blocks, where each block is a convolutional layer with $4 \times 4$ filter with stride 2, which reduces the input dimension, followed by a basic ResNet block without bottleneck (He et al., 2016). All the convolutional layers have the same number of filters, which is either 16 or 32 depending on the dataset. The output from the blocks is flattened and linearly projected to a $2 C$ dimensional vector. The convolutional decoder mirrors this structure with transposed convolutional layers. All the “MLP” boxes in Fig. 9 are 2-layer multi-layer perceptron with ReLU non-linearity in between. We found that adding noise to the input into $q _ { \phi } \left( y _ { t } | x _ { t } \right)$ helped stabilise training, possibly by restricting the information in the addresses. The exact magnitude of the added noise matters little, and we use Gaussian noise with zero mean and standard deviation of 0.2 for all experiments. We use Bernoulli likelihood function for Omniglot dataset, and Gaussian likelihood function for CIFAR. To avoid Gaussian likelihood collapsing, we added uniform noise $\textstyle { \mathcal { U } } ( 0 , { \frac { 1 } { 2 5 6 } } )$ to CIFAR images during training.
|
| 273 |
+
|
| 274 |
+
# D DNC DETAILS
|
| 275 |
+
|
| 276 |
+
For a fair comparison, we wrap the differentiable neural computer (DNC) with the same interface as the Kanerva memory so that it can simply replace the memory $M$ in Fig. 9. More specifically, the DNC receives the addressing variable $y _ { t }$ with the same size and sampled the same ways as described in the main text in reading and writing stages. During writing it also receives $z _ { t }$ sampled from $q _ { \phi } \left( z _ { t } | x _ { t } \right)$ as input, by concatenating $y _ { t }$ and $z _ { t }$ together as input into the memory controller.
|
| 277 |
+
|
| 278 |
+
Since DNCs do not have separated reading and writing stages, we separated this two process in our experiments: during writing, we discard the read-out from the DNC, and only keep its state as the memory; during reading, we discard the state at each step so it cannot be used for storing new information. In addition, we use a 2-layer MLP with 200 hidden neurons and ReLU nonlinearity as the controller instead of the commonly used LSTM to avoid the recurrent state being used as memory and interference with DNC’s external memory. Another issue with off-the-shelf DNC (Graves et al., 2016; Santoro et al., 2016) is that controllers may generate output bypassing the memory, which can be particularly confusing in our auto-encoding setting by simply ignoring the memory and functioning as a skip connection. We avoid this situation by removing this controller output and ensure that the DNC only reads-out from its memory. Further, to focus on the memory performance, we remove
|
| 279 |
+
|
| 280 |
+
VAE
|
| 281 |
+
|
| 282 |
+

|
| 283 |
+
|
| 284 |
+
generation reading writing
|
| 285 |
+
|
| 286 |
+

|
| 287 |
+
|
| 288 |
+

|
| 289 |
+
Figure 9: The architecture of the VAE and the Kanerva Machine used in our experiments. conv/deconv: convolutional and transposed convolutions neural networks. MLP: multiplayer perceptron. concat: vector concatenation. The blue arrows show memory writing as exact inference.
|
| 290 |
+
|
| 291 |
+

|
| 292 |
+
Figure 10: Covariance between memory rows is important. The two curves shows the test loss (negative variational lower bound) as a function of iterations. Four models using full $K \times K$ covariance matrix $U$ are shown by red curves and four models using diagonal covariance matrix are shown in blue. All other settings for these 8 models are the same (as described in section 4). These 8 models are trained on machines with similar setup. The models using full covariance matrices were slightly slower per-iteration, but the test loss decreased far more quickly.
|
| 293 |
+
|
| 294 |
+
the bottom-up stream in our model that compensates for the memory. This means directly sampling $z _ { t }$ from $p _ { \theta }$ $\upsilon _ { \theta } \left( z _ { t } | \boldsymbol { y } _ { t } , \boldsymbol { M } \right)$ , instead of $p _ { \theta } \left( z _ { t } | x _ { t } , y _ { t } , M \right)$ , for the decoder $\dot { p } _ { \theta } \left( x _ { t } | z _ { t } \right)$ , forcing the model to reconstruct solely using read-outs from the memory.
|
| 295 |
+
|
| 296 |
+

|
| 297 |
+
Figure 11: The KL-divergence between $y _ { t }$ (left) and $z _ { t }$ (right) during training.
|
| 298 |
+
|
| 299 |
+

|
| 300 |
+
Figure 12: The negative variational lower bound, reconstruction loss, and total KL-divergence during CIFAR training. Although the difference between the lower bound objective is smaller than that during Omniglot training, the general patterns of these curves are similar to those in Fig. 2. The relatively small difference in KL-divergence significantly influences sample quality. Notice at the time of our submission, the training is continuing and the advantage of the Kanerva Machine over the VAE is increasing.
|
| 301 |
+
|
| 302 |
+
# E DERIVATION OF THE ONLINE UPDATE RULE
|
| 303 |
+
|
| 304 |
+
Eq. 6 defines a linear Gaussian model. Using notations in the main paper, can write the joint distribution $p ( \operatorname { v e c } \left( Z \right) , \operatorname { v e c } ( M ) ) = { \mathcal { N } } \left( \operatorname { v e c } \left( Z \right) , \operatorname { v e c } ( M ) ; \mu _ { j } , \Sigma _ { j } \right)$ , where
|
| 305 |
+
|
| 306 |
+
$$
|
| 307 |
+
\begin{array} { r l } & { \mu _ { j } = \left[ \mathrm { v e c } \left( W R \right) \right] } \\ & { \Sigma _ { j } = \left[ \Sigma _ { z } \otimes I _ { C } \quad \Sigma _ { c } \otimes I _ { C } \right] } \\ & { \Sigma _ { j } = \left[ \Sigma _ { c } \mathbf { \bar { \Psi } } \otimes I _ { C } \quad U \otimes I _ { c } \right] } \end{array}
|
| 308 |
+
$$
|
| 309 |
+
|
| 310 |
+
We can then use the conditional formula for the Gaussian to derive the posterior distribution $p ( \operatorname { v e c } \left( M \right) | \operatorname { v e c } \left( Z \right) ) = \mathcal { N } \left( \operatorname { v e c } \left( M \right) ; \mu _ { p } , \Sigma _ { p } \right)$ , using the property Kronecker product:
|
| 311 |
+
|
| 312 |
+
$$
|
| 313 |
+
\begin{array} { r l } & { { \mu _ { p } } = \operatorname { v e c } \left( R \right) + { \Sigma _ { c } } ^ { \mathsf { T } } { \Sigma _ { z } } ^ { - 1 } \otimes I _ { C } ( \operatorname { v e c } \left( Z \right) - \operatorname { v e c } \left( W R \right) ) } \\ & { { \Sigma _ { p } } = U \otimes I _ { c } - { \Sigma _ { c } } ^ { \mathsf { T } } { \Sigma _ { z } } ^ { - 1 } { \Sigma _ { c } } \otimes I _ { C } } \end{array}
|
| 314 |
+
$$
|
| 315 |
+
|
| 316 |
+
From properties of matrix variate Gaussian distribution, the above two equations can be re-arranged to the update rule in eq. 9 to 11.
|
| 317 |
+
|
| 318 |
+
# F DISTRIBUTION-BASED READING AND WRITING
|
| 319 |
+
|
| 320 |
+
While the model we described in this paper works well using samples from $q _ { \phi } \left( z _ { t } | x _ { t } \right)$ for writing to the memory (section 3.3) and the mean-field approximation during reading (section 3.4), here we describe an alternative that fully exploits the analytic tractability of the Gaussian distribution. To simplify notation, we use $\psi = \{ R , U , V \}$ for all parameters of the memory.
|
| 321 |
+
|
| 322 |
+
For reading, eq. 6 can be replaced with a distribution that directly depends on $\psi$ through the integral:
|
| 323 |
+
|
| 324 |
+
$$
|
| 325 |
+
\begin{array} { c } { { p _ { \theta } \left( z _ { t } | y _ { t } , \psi \right) = \displaystyle \int p _ { \theta } \left( z _ { t } | y _ { t } , M \right) p ( M ) \mathrm { d } M } } \\ { { = \mathcal { N } \left( z _ { t } | w _ { t } { } ^ { \mathsf { T } } R , w U w ^ { \mathsf { T } } + \sigma ^ { 2 } I _ { C } \right) } } \end{array}
|
| 326 |
+
$$
|
| 327 |
+
|
| 328 |
+
For writing, the distribution $\begin{array} { r } { q _ { \phi } \left( \boldsymbol { Z } \vert \boldsymbol { X } \right) = \prod _ { t = 1 } ^ { T } q _ { \phi } \left( z _ { t } \vert \boldsymbol { x } _ { t } \right) = \mathcal { N } \left( \mu _ { Q } , \boldsymbol { \Sigma } _ { Q } \right) } \end{array}$ ( $\mu _ { Q }$ and $\Sigma _ { Q }$ are functions of $X$ ) can be incorporated into the Bayes’ update rule by analytically marginalising-out $Z$ :
|
| 329 |
+
|
| 330 |
+
$$
|
| 331 |
+
\begin{array} { r l } & { p _ { \theta } \left( M | Y , X \right) = \displaystyle \int p _ { \theta } \left( M | Y , Z \right) q _ { \phi } \left( Z | X \right) \mathrm { d } Z } \\ & { \quad \quad \quad = \displaystyle \int \frac { p _ { \theta } \left( M \right) p _ { \theta } \left( Z | Y , M \right) } { p _ { \theta } \left( Z | Y \right) } q _ { \phi } \left( Z | X \right) \mathrm { d } Z } \\ & { \quad \quad \quad \propto p _ { \theta } \left( M \right) \displaystyle \int p _ { \theta } \left( Z | Y , M \right) q _ { \phi } \left( Z | X \right) \mathrm { d } Z } \end{array}
|
| 332 |
+
$$
|
| 333 |
+
|
| 334 |
+
where we used Bayes’ rule and dropped the normalising constant $p _ { \theta } \left( Z | Y \right)$ , and then replaced the equality with proportional-to accordingly. The last integral is:
|
| 335 |
+
|
| 336 |
+
$$
|
| 337 |
+
\begin{array} { r l } & { \displaystyle \int p _ { \theta } \left( Z \vert Y , M \right) q _ { \phi } \left( Z \vert X \right) \mathrm { d } Z = \frac { 1 } { \sqrt { \operatorname* { d e t } ( 2 \pi \Sigma _ { z ^ { \prime } } ) } } \exp \left[ - \frac { 1 } { 2 } ( \mu _ { Q } - W R ) ^ { \mathsf { T } } \Sigma _ { z ^ { \prime } } ^ { - 1 } ( \mu _ { Q } - W R ) \right] } \\ & { \quad \quad \quad \quad \cdot \displaystyle \int p ^ { \prime } ( Z ) \mathrm { d } Z } \\ & { \quad \quad \quad \quad = \mathcal { N } ( \mu _ { Q } \vert W R , \Sigma _ { z ^ { \prime } } ) } \end{array}
|
| 338 |
+
$$
|
| 339 |
+
|
| 340 |
+
where $\Sigma _ { z ^ { \prime } } = W U W ^ { \intercal } + \Sigma _ { \xi } + \Sigma _ { Q }$ and $p ^ { \prime } ( Z )$ is a distribution of $Z$ whose exact form is unimportant. Therefore, eq. 20 shows that the posterior distribution of $M$ is proportional to the product between the prior $p _ { \theta } \left( M \right)$ and the above likelihood term. From inspection, we can see the update rule (eq. 9 - 11) needs to be modified by replacing $\Sigma _ { z }$ with $\Sigma _ { z ^ { \prime } }$ by adding the bottom-up uncertainty $\Sigma _ { Q }$ .
|
| 341 |
+
|
| 342 |
+
# G DESCRIPTION OF THE ALGORITHM
|
| 343 |
+
|
| 344 |
+
# Algorithm 1 Iterative Reading
|
| 345 |
+
|
| 346 |
+
<table><tr><td>Input: Memory M,a (potentially noisy) query xt, the number of iteration n Output: An estimate of the noiseless 𝑥t</td></tr><tr><td>initialisei=O</td></tr><tr><td>whilei<ndo</td></tr><tr><td>sample yt ~ q(yt|xt) compute the key bt ← f(yt)</td></tr><tr><td>Compute the weights wt ←bt · A</td></tr><tr><td>read-out mean μz ← wtT · M</td></tr><tr><td>sample zt ~ q(zt|xt, Yt,M) which takes μz and xt as inputs</td></tr><tr><td>sample the new query xt ~ pe(xt|zt)</td></tr><tr><td>incrementi←i+1</td></tr><tr><td>end while</td></tr><tr><td>returnx←xt</td></tr></table>
|
| 347 |
+
|
| 348 |
+
# Algorithm 2 Writing
|
| 349 |
+
|
| 350 |
+
Input: Images $\{ x _ { t } \} _ { t = 1 } ^ { T }$ , Memory $M$ with parameters $R$ and $U$
|
| 351 |
+
|
| 352 |
+
Output: Updated memory $M ^ { \prime }$ for each $y _ { t }$ do sample $y _ { t } \sim q _ { \phi } ( y _ { t } | x _ { t } )$ compute the key $b _ { t } \gets f ( y _ { t } )$ Compute the weights $w _ { t } \gets b _ { t } ^ { \intercal } \cdot A$ sample $z _ { t } \sim q _ { \phi } ( z _ { t } | x _ { t } )$ update parameters of $M$ $\begin{array} { r l } & { | \begin{array} { l } { \Delta \xleftarrow { } Z - W R } \end{array} } \\ & { \Sigma _ { c } \xleftarrow { } W U } \\ & { \Sigma _ { z } \xleftarrow { } W U W ^ { \intercal } + \Sigma _ { \xi } } \\ & { R R + \Sigma _ { c } \textbar { \Sigma } \Sigma _ { z } ^ { - 1 } \Delta } \\ & { U U - \Sigma _ { c } \textbar { \Sigma } \Sigma _ { z } ^ { - 1 } \Sigma _ { c } } \end{array}$
|
| 353 |
+
|
| 354 |
+
# end for
|
| 355 |
+
|
| 356 |
+
return $M ^ { \prime }$ with the updated parameters $R$ and $U$
|
md/train/SkNQeiRpb/SkNQeiRpb.md
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TRAINING DEEP AUTOENCODERS FOR RECOM-MENDER SYSTEMS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
This paper proposes a new model for the rating prediction task in recommender systems which significantly outperforms previous state-of-the art models on a time-split Netflix data set. Our model is based on deep autoencoder with 6 layers and is trained end-to-end without any layer-wise pre-training. We empirically demonstrate that: a) deep autoencoder models generalize much better than the shallow ones, b) non-linear activation functions with negative parts are crucial for training deep models, and c) heavy use of regularization techniques such as dropout is necessary to prevent overfitting. We also propose a new training algorithm based on iterative output re-feeding to overcome natural sparseness of collaborate filtering. The new algorithm significantly speeds up training and improves model performance.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Sites like Amazon, Netflix and Spotify use recommender systems to suggest items to users. Recommender systems can be divided into two categories: context-based and personalized recommendations.
|
| 12 |
+
|
| 13 |
+
Context based recommendations take into account contextual factors such as location, date and time (Adomavicius & Tuzhilin, 2011). Personalized recommendations typically suggest items to users using the collaborative filtering (CF) approach. In this approach the user’s interests are predicted based on the analysis of tastes and preference of other users in the system and implicitly inferring “similarity” between them. The underlying assumption is that two people who have similar tastes, have a higher likelihood of having the same opinion on an item than two randomly chosen people.
|
| 14 |
+
|
| 15 |
+
In designing recommender systems, the goal is to improve the accuracy of predictions. The Netflix Prize contest provides the most famous example of this problem (Bennett et al., 2007): Netflix held the Netflix Prize to substantially improve the accuracy of the algorithm to predict user ratings for films. This is a classic CF problem: Infer the missing entries in an mxn matrix, $R$ , whose $( i , j )$ entry describes the ratings given by the ith user to the $j$ th item. The performance is then measured using Root Mean Squared Error (RMSE).
|
| 16 |
+
|
| 17 |
+
Training very deep autoencoders is non trivial both from optimization and regularization points of view. Early works on training auto-enocoders adapted layer-wise pre-training to solve optimization issues (Hinton & Salakhutdinov, 2006). In this work, we empirically show that optimization difficulties of training deep autoencoders can be solved by using scaled exponential linear units $( S E L U s ,$ )(Klambauer et al., 2017). This enables training without any layer-wise pre-training or residual connections. Since publicly available data sets for CF are relatively small, sufficiently large models can easily overfit. To prevent overfitting we employ heavy dropout with drop probability as high as 0.8. We also introduce a new output re-feeding training algorithm which helps to bypass the natural sparseness of updates in collaborative filtering and helps to further improve the model performance.
|
| 18 |
+
|
| 19 |
+
# 1.1 RELATED WORK
|
| 20 |
+
|
| 21 |
+
Deep learning (LeCun et al., 2015) has led to breakthroughs in image recognition, natural language understanding, and reinforcement learning. Naturally, these successes fuel an interest for using deep learning in recommender systems. First attempts at using deep learning for recommender systems involved restricted Boltzman machines (RBM) (Salakhutdinov et al., 2007). Several recent approaches use autoencoders (Sedhain et al., 2015; Strub & Mary, 2015), feed-forward neural networks (He et al., 2017), neural autoregressive architectures (Zheng et al., 2016) and recurrent recommender networks (Wu et al., 2017). Many popular matrix factorization techniques can be thought of as a form of dimensionality reduction. It is, therefore, natural to adapt deep autoencoders for this task as well. I-AutoRec (item-based autoencoder) and $U _ { ☉ }$ -AutoRec (user-based autoencoder) are first successful attempts to do so Sedhain et al. (2015). Stacked de-noising autoencoders has been sucesfully used on this task as well (Li et al., 2015; Wang et al., 2015).
|
| 22 |
+
|
| 23 |
+
There are many non deep learning types of approaches to collaborative filtering (CF) (Breese et al., 1998; Ricci et al., 2011). Matrix factorization techniques, such as alternating least squares (ALS) (Kim & Park, 2008; Koren et al., 2009) and probabilistic matrix factorization (Mnih & Salakhutdinov, 2008) are particularly popular. The most robust systems may incorporate several ideas together such as the winning solution to the Netflix Prize competition (Koren, 2009). Note that Netflix Prize data also includes temporal signal - time when each rating has been made. Thus, several classic CF approaches has been extended to incorporate temporal information such as TimeSVD $^ { + + }$ Koren (2010), as well as more recent RNN-based techniques such as recurrent recommender networks Wu et al. (2017).
|
| 24 |
+
|
| 25 |
+
# 2 MODEL
|
| 26 |
+
|
| 27 |
+
Our model is inspired by $U$ -AutoRec approach with several important distinctions. We train much deeper models. To enable this without any pre-training, we: a) use “scaled exponential linear units” (SELUs) Klambauer et al. (2017), b) use high dropout rates, and d) use iterative output re-feeding during training.
|
| 28 |
+
|
| 29 |
+
An autoencoder is a network which implements two transformations - encoder $e n c o d e ( x ) : R ^ { n } \to$ $R ^ { d }$ and $d e c o d e r ( z ) : R ^ { d } \to R ^ { n }$ . The “goal” of autoenoder is to obtain $d$ dimensional representation of data such that an error measure between $x$ and $f ( x ) = d e c o d e ( e n c o d e ( x ) )$ is minimized Hinton & Zemel (1994). Figure 1 depicts typical 4-layer autoencoder network. If noise is added to the data during encoding step, the autoencoder is called de-noising. Autoencoder is an excellent tool for dimensionality reduction and can be thought of as a strict generalization of principle component analysis (PCA) Hinton & Salakhutdinov (2006). An autoencoder without non-linear activations and only with “code” layer should be able to learn PCA transformation in the encoder if trained to optimize mean squared error (MSE) loss.
|
| 30 |
+
|
| 31 |
+
In our model, both encoder and decoder parts of the autoencoder consist of feed-forward neural networks with classical fully connected layers computing $l = f ( W * x + b )$ , where $f$ is some nonlinear activation function. If range of the activation function is smaller than that of data, the last layer of the decoder should be kept linear. We found it to be very important for activation function $f$ in hidden layers to contain non-zero negative part, and we use SELU units in most of our experiments (see Section 3.2 for details).
|
| 32 |
+
|
| 33 |
+
If decoder mirrors encoder architecture (as it does in our model), then one can constrain decoder’s weights $\boldsymbol { W } _ { d } ^ { l }$ to be equal to transposed encoder weights $W _ { e } ^ { l }$ from the corresponding layer $l$ . Such autoencoder is called constrained or tied and has almost two times less free parameters than unconstrained one.
|
| 34 |
+
|
| 35 |
+
Forward pass and inference. During forward pass (and inference) the model takes user represented by his vector of ratings from the training set $x \in R ^ { n }$ , where $n$ is number of items. Note that $x$ is very sparse, while the output of the decoder, $f ( x ) \in R ^ { n }$ is dense and contains rating predictions for all items in the corpus.
|
| 36 |
+
|
| 37 |
+
# 2.1 LOSS FUNCTION
|
| 38 |
+
|
| 39 |
+
Since it doesn’t make sense to predict zeros in user’s representation vector $x$ , we follow the approach from Sedhain et al. (2015) and optimize Masked Mean Squared Error loss:
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
M M S E = \frac { m _ { i } * ( r _ { i } - y _ { i } ) ^ { 2 } } { \sum _ { i = 0 } ^ { i = n } m _ { i } }
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
where $r _ { i }$ is actual rating, $y _ { i }$ is reconstructed, or predicted rating, and $m _ { i }$ is a mask function such that $m _ { i } = 1$ if $r _ { i } \neq 0$ else $m _ { i } = 0$ . Note that there is a straightforward relation between RMSE score and MMSE score: $R M S E = \sqrt { M M S E }$ .
|
| 46 |
+
|
| 47 |
+
# 2.2 DENSE RE-FEEDING
|
| 48 |
+
|
| 49 |
+
During training and inference, an input $x \in R ^ { n }$ is very sparse because no user can realistically rate but a tiny fractions of all items. This poses problem for model training. Bayesian approches can be used to overcome this issue (Wang et al., 2015). On the other hand, autoencoder’s output $f ( x )$ is dense. Lets consider an idealized scenario with a perfect $f$ . Then $f ( x ) _ { i } = x _ { i } , \forall i : x _ { i } \neq 0$ and $f ( { \boldsymbol { x } } ) _ { i }$ accurately predicts all user’s future ratings for items $i : x _ { i } = 0$ . This means that if user rates new item $k$ (thereby creating a new vector $x ^ { \prime }$ ) then $f ( x ) _ { k } = x _ { k } ^ { \prime }$ and $f ( x ) = f ( x ^ { \prime } )$ . Hence, in this idealized scenario, $y = f ( x )$ should be a fixed point of a well trained autoencoder: $f ( y ) = y$ .
|
| 50 |
+
|
| 51 |
+
To explicitly enforce fixed-point constraint and to be able to perform dense training updates, we augment every optimization iteration with an iterative dense re-feeding steps (3 and 4 below) as follows:
|
| 52 |
+
|
| 53 |
+
1. Given sparse $x$ , compute dense $f ( x )$ and loss using equation 1 (forward pass)
|
| 54 |
+
2. Compute gradients and perform weight update (backward pass)
|
| 55 |
+
3. Treat $f ( x )$ as a new example and compute $f ( f ( x ) )$ . Now both $f ( x )$ and $f ( f ( x ) )$ are dense
|
| 56 |
+
and the loss from equation 1 has all $m$ as non-zeros. (second forward pass)
|
| 57 |
+
4. Compute gradients and perform weight update (second backward pass)
|
| 58 |
+
|
| 59 |
+
Steps (3) and (4) can be also performed more than once for every iteration.
|
| 60 |
+
|
| 61 |
+
# 3 EXPERIMENTS AND RESULTS
|
| 62 |
+
|
| 63 |
+
# 3.1 EXPERIMENT SETUP
|
| 64 |
+
|
| 65 |
+
For the rating prediction task, it is often most relevant to predict future ratings given the past ones instead of predicting ratings missing at random. For evaluation purposes we followed Wu et al. (2017) exactly by splitting the original Netflix Prize Bennett et al. (2007) training set into several training and testing intervals based on time. Training interval contains ratings which came in earlier than the ones from testing interval. Testing interval is then randomly split into Test and Validation subsets so that each rating from testing interval has a $50 \%$ chance of appearing in either subset. Users and items that do not appear in the training set are removed from both test and validation subsets. Table 1 provides details on the data sets.2
|
| 66 |
+
|
| 67 |
+
For most of our experiments we uses a batch size of 128, trained using SGD with momentum of 0.9 and learning rate of 0.001. We used xavier initialization to initialize parameters. Note, that unlike Strub & Mary (2015) we did not use any layer-wise pre-training. We believe that we were able to do so successfully because of choosing the right activation function (see Section 3.2).
|
| 68 |
+
|
| 69 |
+
# 3.2 EFFECTS OF THE ACTIVATION TYPES
|
| 70 |
+
|
| 71 |
+
To explore the effects of using different activation functions, we tested some of the most popular choices in deep learning : sigmoid, “rectified linear units” (RELU), $m a x ( r e l u ( x ) , 6 )$ or RELU6, hyperbolic tangent (TANH), “exponential linear units” (ELU) (Clevert et al., 2015), leaky relu (LRELU) (Xu et al., 2015) , “self-gated activation function” (SWISH) (Ramachandran et al., 2017), and “scaled exponential linear units” (Klambauer et al., 2017) (SELU) on the 4 layer autoencoder with 128 units in each hidden layer. Because ratings are on the scale from 1 to 5, we keep last layer of the decoder linear for sigmoid and tanh-based models. In all other models activation function is applied in all layers.
|
| 72 |
+
|
| 73 |
+

|
| 74 |
+
Figure 1: AutoEncoder consists of two neural networks, encoder and decoder, fused together on the “representation” layer $z$ . Encoder has 2 layers $e _ { 1 }$ and $e _ { 2 }$ and decoder has 2 layers $d _ { 1 }$ and $d _ { 2 }$ . Dropout may be applied to coding layer $z$ .
|
| 75 |
+
|
| 76 |
+
Table 1: Subsets of Netflix Prize training set used in our experiments. We made sure that these splits match exactly the ones used in (Wu et al., 2017).
|
| 77 |
+
|
| 78 |
+
<table><tr><td></td><td>Full</td><td>3 months</td><td>6 months</td><td>1 year</td></tr><tr><td></td><td></td><td></td><td>06/05-11/05</td><td></td></tr><tr><td>Training Users</td><td>12/99-11/05 477,412</td><td>09/05-11/05 311,315</td><td>390,795</td><td>06/04-05/05 345,855</td></tr><tr><td>Ratings</td><td>98,074,901</td><td>13,675,402</td><td>29,179,009</td><td>41,451,832</td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Testing Users</td><td>12/05</td><td>12/05</td><td>12/05</td><td>06/05</td></tr></table>
|
| 79 |
+
|
| 80 |
+
We found that on this task ELU, SELU and LRELU perform much better than SIGMOID, RELU, RELU6, TANH and SWISH. Figure 2 clearly demonstrates this. There are two properties which seems to separate activations which perform well from those which do not: a) non-zero negative part and b) unbounded positive part. Hence, we conclude, that in this setting these properties are important for successful training. Thus, we use SELU activation units and tune SELU-based networks for performance.
|
| 81 |
+
|
| 82 |
+

|
| 83 |
+
Figure 2: Training RMSE per mini-batch. All lines correspond to 4-layers autoencoder (2 layer encoder and 2 layer decoder) with hidden unit dimensions of 128. Different line colors correspond to different activation functions. TANH and SIGMOID lines are very similar as well as lines for ELU and SELU. The best performing activation functions are ELU and SELU.
|
| 84 |
+
|
| 85 |
+
# 3.3 OVER-FITTING THE DATA
|
| 86 |
+
|
| 87 |
+
The largest data set we use for training, “Netflix Full” from Table 1, contains 98M ratings given by 477K users. Number of movies (e.g. items) in this set is $n = 1 7$ , 768. Therefore, the first layer of encoder will have $d * n + d$ weights, where $d$ is number of units in the layer.
|
| 88 |
+
|
| 89 |
+
For modern deep learning algorithms and hardware this is relatively small task. If we start with single layer encoders and decoders we can quickly overfit to the training data even for $d$ as small as 512. Figure 3 clearly demonstrates this. Switching from unconstrained autoencoder to constrained reduces over-fitting, but does not completely solve the problem.
|
| 90 |
+
|
| 91 |
+

|
| 92 |
+
Figure 3: Single layer autoencoder with 128, 256, 512 and 1024 hidden units in the coding layer. A: training RMSE per epoch; B: evaluation RMSE per epoch.
|
| 93 |
+
|
| 94 |
+
# 3.4 GOING DEEPER
|
| 95 |
+
|
| 96 |
+
While making layers wider helps bring training loss down, adding more layers is often correlated with a network’s ability to generalize. In this set of experiments we show that this is indeed the case here. We choose small enough dimensionality $d = 1 2 8$ ) for all hidden layers to easily avoid over-fitting and start adding more layers. Table 2 shows that there is a positive correlation between the number of layers and the evaluation accuracy.
|
| 97 |
+
|
| 98 |
+
Table 2: Depth helps generalization. Evaluation RMSE of the models with different number of layers. In all cases the hidden layer dimension is 128.
|
| 99 |
+
|
| 100 |
+
<table><tr><td>Number of layers</td><td>Evaluation RMSE</td><td>params</td></tr><tr><td></td><td></td><td></td></tr><tr><td>2</td><td>1.146</td><td>4,566,504</td></tr><tr><td>4</td><td>0.9615</td><td>4,599,528</td></tr><tr><td>6</td><td>0.9378</td><td>4,632,552</td></tr><tr><td>8 10</td><td>0.9364</td><td>4,665,576</td></tr><tr><td>12</td><td>0.9340 0.9328</td><td>4,698,600</td></tr><tr><td></td><td></td><td>4,731,624</td></tr></table>
|
| 101 |
+
|
| 102 |
+
Going from one layer in encoder and decoder to three layers in both provides good improvement in evaluation RMSE (from 1.146 to 0.9378). After that, blindly adding more layers does help, however it provides diminishing returns. Note that the model with single $d \ : = \ : 2 5 6$ layer in encoder and decoder has 9,115,240 parameters which is almost two times more than any of these deep models while having much worse evauation RMSE (above 1.0).
|
| 103 |
+
|
| 104 |
+
# 3.5 DROPOUT
|
| 105 |
+
|
| 106 |
+
Section 3.4 shows us that adding too many small layers eventually hits diminishing returns. Thus, we start experimenting with model architecture and hyper-parameters more broadly. Our most promising model has the following architecture: $n , 5 1 2 , 5 1 2 , 1 0 2 4 , 5 1 2 , 5 1 2 , n .$ , which means 3 layers in encoder (512,512,1024), coding layer of 1024 and 3 layers in decoder of size 512,512,n. This model, however, quickly over-fits if trained with no regularization. To regularize it, we tried several dropout values and, interestingly, very high values of drop probability (e.g. 0.8) turned out to be the best. See Figure 4 for evaluation RMSE. We apply dropout on the encoder output only, e.g. $f ( x ) = d e c o d e ( d r o p o u t ( e n c o d e ( x ) ) )$ . We tried applying dropout after every layer of the model but that stifled training convergence and did not improve generalization.
|
| 107 |
+
|
| 108 |
+

|
| 109 |
+
Figure 4: Effects of dropout. Y-axis: evaluation RMSE, X-axis: epoch number. Model with no dropout (Drop Prob 0.0) clearly over-fits. Model with drop probability of 0.5 over-fits as well (but much slowly). Models with drop probabilities of 0.65 and 0.8 result in RMSEs of 0.9192 and 0.9183 correspondingly.
|
| 110 |
+
|
| 111 |
+
# 3.6 DENSE RE-FEEDING
|
| 112 |
+
|
| 113 |
+
Iterative dense re-feeding (see Section 2.2) provides us with additional improvement in evaluation accuracy for our 6-layer-model: $n$ , 512, 512, 1024, $d p ( 0 . 8 )$ , 512, 512, $n$ (referred to as Baseline below). Here each parameter denotes the number of inputs, hidden units, or outputs and $d p ( 0 . 8 )$ is a dropout layer with a drop probability of 0.8. Just applying output re-feeding did not have significant impact on the model performance. However, in conjunction with the higher learning rate, it did significantly increase the model performance. Note, that with this higher learning rate (0.005) but without dense re-feeding, the model started to diverge. See Figure 5 for details.
|
| 114 |
+
|
| 115 |
+
Table 3: Test RMSE of different models. I-AR, U-AR and RRN numbers are taken from (Wu et al., 2017)
|
| 116 |
+
|
| 117 |
+
<table><tr><td>DataSet</td><td>I-AR</td><td>U-AR</td><td>RRN</td><td>DeepRec</td></tr><tr><td rowspan="3">Netflix 3 months Netfix Full</td><td></td><td></td><td></td><td></td></tr><tr><td>0.9778</td><td>0.9836</td><td>0.9427</td><td>0.9373</td></tr><tr><td>0.9364</td><td>0.9647</td><td>0.9224</td><td>0.9099</td></tr></table>
|
| 118 |
+
|
| 119 |
+

|
| 120 |
+
Figure 5: Effects of dense re-feeding. Y-axis: evaluation RMSE, $\mathbf { X }$ -axis: epoch number. Baseline model was trained with learning rate of 0.001. Applying re-feeding step with the same learning rate almost did not help (Baseline RF). Learning rate of 0.005 (Baseline LR 0.005) is too big for baseline model without re-feeding. However, increasing both learning rate and applying re-feeding step clearly helps (Baseline LR 0.005 RF).
|
| 121 |
+
|
| 122 |
+
Applying dense re-feeding and increasing the learning rate, allowed us to further improve the evaluation RMSE from 0.9167 to 0.9100. Picking a checkpoint with best evaluation RMSE and computing test RMSE gives as 0.9099, which we believe is significantly better than other methods.
|
| 123 |
+
|
| 124 |
+
# 3.7 COMPARISON WITH OTHER METHODS
|
| 125 |
+
|
| 126 |
+
We compare our best model with Recurrent Recommender Network from Wu et al. (2017) which has been shown to outperform PMF (Mnih & Salakhutdinov, 2008), T-SVD (Koren, 2010) and I/UAR (Sedhain et al., 2015) on the data we use (see Table 1 for data description). Note, that unlike T-SVD and RRN, our method does not explicitly take into account temporal dynamics of ratings. Yet, Table 3 shows that it is still capable of outperforming these methods on future rating prediction task. We train each model using only the training set and compute evaluation RMSE for 100 epochs. Then the checkpoint with the highest evaluation RMSE is tested on the test set.
|
| 127 |
+
|
| 128 |
+
“Netflix 3 months” has 7 times less training data compared to “Netflix full”, it is therefore, not surprising that the model’s performance is significantly worse if trained on this data alone (0.9373 vs 0.9099). In fact, the model that performs best on “Netflix full” over-fits on this set, and we had to reduce the model’s complexity accordingly (see Table 4 for details).
|
| 129 |
+
|
| 130 |
+
Table 4: Test RMSE achieved by DeepRec on different Netflix subsets. All models are trained with one iterative output re-feeding step per each iteration.
|
| 131 |
+
|
| 132 |
+
<table><tr><td>DataSet</td><td>RMSE</td><td>Model Architecture</td></tr><tr><td></td><td></td><td></td></tr><tr><td>Netflix 3 months</td><td>0.9373</td><td>n,128,256,256,dp(0.65),256,128,n</td></tr><tr><td>Netflix 6 months</td><td>0.9207</td><td>n,256,256,512,dp(0.8),256,256,n</td></tr><tr><td>Netflix 1 year</td><td>0.9225</td><td>n,256,256,512,dp(0.8),256,256, n</td></tr><tr><td>Netfix Full</td><td>0.9099</td><td>n,512,512,1024,dp(0.8),512,512, n</td></tr></table>
|
| 133 |
+
|
| 134 |
+
# 4 CONCLUSION
|
| 135 |
+
|
| 136 |
+
Deep learning has revolutionized many areas of machine learning, and it is poised do so with recommender systems as well. In this paper we demonstrated how very deep autoencoders can be successfully trained even on relatively small amounts of data by using both well established (dropout) and relatively recent (“scaled exponential linear units”) deep learning techniques. Further, we introduced iterative output re-feeding - a technique which allowed us to perform dense updates in collaborative filtering, increase learning rate and further improve generalization performance of our model. On the task of future rating prediction, our model outperforms other approaches even without using additional temporal signals.
|
| 137 |
+
|
| 138 |
+
While our code supports item-based model (such as I-AutoRec) we argue that this approach is less practical than user-based model (U-AutoRec). This is because in real-world recommender systems, there are usually much more users then items. Finally, when building personalized recommender system and faced with scaling problems, it can be acceptable to sample items but not users.
|
| 139 |
+
|
| 140 |
+
# ACKNOWLEDGMENTS
|
| 141 |
+
|
| 142 |
+
We thank the author of (Wu et al., 2017), Chao-Yuan Wu, for fruitfull discussion and help validating our data sets.
|
| 143 |
+
|
| 144 |
+
# REFERENCES
|
| 145 |
+
|
| 146 |
+
Gediminas Adomavicius and Alexander Tuzhilin. Context-aware recommender systems. In Recommender systems handbook, pp. 217–253. Springer, 2011.
|
| 147 |
+
|
| 148 |
+
James Bennett, Stan Lanning, and Netflix Netflix. The netflix prize. In In KDD Cup and Workshop in conjunction with KDD, 2007.
|
| 149 |
+
|
| 150 |
+
John S. Breese, David Heckerman, and Carl Kadie. Empirical analysis of predictive algorithms for collaborative filtering. In Proceedings of the Fourteenth Conference on Uncertainty in Artificial Intelligence, UAI’98, pp. 43–52, San Francisco, CA, USA, 1998. Morgan Kaufmann Publishers Inc. ISBN 1-55860-555-X. URL http://dl.acm.org/citation.cfm?id=2074094. 2074100.
|
| 151 |
+
|
| 152 |
+
Djork-Arne Clevert, Thomas Unterthiner, and Sepp Hochreiter. Fast and accurate deep network´ learning by exponential linear units (elus). arXiv preprint arXiv:1511.07289, 2015.
|
| 153 |
+
|
| 154 |
+
Xiangnan He, Lizi Liao, Hanwang Zhang, Liqiang Nie, Xia Hu, and Tat-Seng Chua. Neural collaborative filtering. In Proceedings of the 26th International Conference on World Wide Web, pp. 173–182. International World Wide Web Conferences Steering Committee, 2017.
|
| 155 |
+
|
| 156 |
+
Geoffrey E Hinton and Ruslan R Salakhutdinov. Reducing the dimensionality of data with neural networks. science, 313(5786):504–507, 2006.
|
| 157 |
+
|
| 158 |
+
Geoffrey E Hinton and Richard S. Zemel. Autoencoders, minimum description length and helmholtz free energy. In J. D. Cowan, G. Tesauro, and J. Alspector (eds.), Advances in Neural Information Processing Systems 6, pp. 3– 10. Morgan-Kaufmann, 1994. URL http://papers.nips.cc/paper/ 798-autoencoders-minimum-description-length-and-helmholtz-free-energy. pdf.
|
| 159 |
+
|
| 160 |
+
Hyunsoo Kim and Haesun Park. Nonnegative matrix factorization based on alternating nonnegativity constrained least squares and active set method. SIAM journal on matrix analysis and applications, 30(2):713–730, 2008.
|
| 161 |
+
|
| 162 |
+
Gunter Klambauer, Thomas Unterthiner, Andreas Mayr, and Sepp Hochreiter. Self-normalizing ¨ neural networks. arXiv preprint arXiv:1706.02515, 2017.
|
| 163 |
+
|
| 164 |
+
Yehuda Koren. The bellkor solution to the netflix grand prize. Netflix prize documentation, 81:1–10, 2009.
|
| 165 |
+
|
| 166 |
+
Yehuda Koren. Collaborative filtering with temporal dynamics. Communications of the ACM, 53 (4):89–97, 2010.
|
| 167 |
+
|
| 168 |
+
Yehuda Koren, Robert Bell, and Chris Volinsky. Matrix factorization techniques for recommender systems. Computer, 42(8), 2009.
|
| 169 |
+
|
| 170 |
+
Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436–444, 2015.
|
| 171 |
+
|
| 172 |
+
Sheng Li, Jaya Kawale, and Yun Fu. Deep collaborative filtering via marginalized denoising autoencoder. In Proceedings of the 24th ACM International on Conference on Information and Knowledge Management, pp. 811–820. ACM, 2015.
|
| 173 |
+
|
| 174 |
+
Andriy Mnih and Ruslan R Salakhutdinov. Probabilistic matrix factorization. In Advances in neural information processing systems, pp. 1257–1264, 2008.
|
| 175 |
+
|
| 176 |
+
Prajit Ramachandran, Barret Zoph, and Quoc V Le. Swish: a self-gated activation function. arXiv preprint arXiv:1710.05941, 2017.
|
| 177 |
+
|
| 178 |
+
Francesco Ricci, Lior Rokach, and Bracha Shapira. Introduction to recommender systems handbook. In Recommender systems handbook, pp. 1–35. Springer, 2011.
|
| 179 |
+
|
| 180 |
+
Ruslan Salakhutdinov, Andriy Mnih, and Geoffrey Hinton. Restricted boltzmann machines for collaborative filtering. In Proceedings of the 24th international conference on Machine learning, pp. 791–798. ACM, 2007.
|
| 181 |
+
|
| 182 |
+
Suvash Sedhain, Aditya Krishna Menon, Scott Sanner, and Lexing Xie. Autorec: Autoencoders meet collaborative filtering. In Proceedings of the 24th International Conference on World Wide Web, pp. 111–112. ACM, 2015.
|
| 183 |
+
|
| 184 |
+
Florian Strub and Jer´ emie Mary. Collaborative filtering with stacked denoising autoencoders and ´ sparse inputs. In NIPS workshop on machine learning for eCommerce, 2015.
|
| 185 |
+
|
| 186 |
+
Hao Wang, Naiyan Wang, and Dit-Yan Yeung. Collaborative deep learning for recommender systems. In Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 1235–1244. ACM, 2015.
|
| 187 |
+
|
| 188 |
+
Chao-Yuan Wu, Amr Ahmed, Alex Beutel, Alexander J. Smola, and How Jing. Recurrent recommender networks. In Proceedings of the Tenth ACM International Conference on Web Search and Data Mining, WSDM ’17, pp. 495–503, New York, NY, USA, 2017. ACM. ISBN 978- 1-4503-4675-7. doi: 10.1145/3018661.3018689. URL http://doi.acm.org/10.1145/ 3018661.3018689.
|
| 189 |
+
|
| 190 |
+
Bing Xu, Naiyan Wang, Tianqi Chen, and Mu Li. Empirical evaluation of rectified activations in convolutional network. arXiv preprint arXiv:1505.00853, 2015.
|
| 191 |
+
|
| 192 |
+
Yin Zheng, Bangsheng Tang, Wenkui Ding, and Hanning Zhou. A neural autoregressive approach to collaborative filtering. arXiv preprint arXiv:1605.09477, 2016.
|
md/train/Skvd-myR-/Skvd-myR-.md
ADDED
|
@@ -0,0 +1,327 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING NON-METRIC VISUAL SIMILARITY FOR IMAGE RETRIEVAL
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Measuring visual (dis)similarity between two or more instances within a data distribution is a fundamental task in many applications, especially in image retrieval. Theoretically, non-metric distances are able to generate a more complex and accurate similarity model than metric distances, provided that the non-linear data distribution is precisely captured by the similarity model. In this work, we analyze a simple approach for deep learning networks to be used as an approximation of non-metric similarity functions and we study how these models generalize across different image retrieval datasets.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
For humans, deciding whether two images are visually similar or not is, to some extent, a natural task. However, in computer vision, this is a challenging problem and algorithms do not always succeed in matching pictures that contain similar-looking elements. This is mainly because of the well-known semantic gap problem, which refers to the difference or gap between low-level image pixels and high-level semantic concepts. Estimating visual similarity is a fundamental task that seeks to break this semantic gap by accurately evaluating how alike two or more pictures are. Visual similarity is crucial for many computer vision areas including image retrieval, image classification and object recognition, among others.
|
| 12 |
+
|
| 13 |
+
Given a query image, content-based image retrieval systems rank pictures in a dataset according to how similar they are with respect to the input. This can be broken into two fundamental tasks: 1) computing meaningful image representations that capture the most salient visual information from pixels and 2) measuring accurate visual similarity between these image representations to rank images according to a similarity score.
|
| 14 |
+
|
| 15 |
+
In the last years, several methods to represent visual information from raw pixels in images have been proposed, first by designing handcrafted features such as SIFT Lowe (2004), then by compacting these local features into a single global image descriptor using different techniques such as Fisher Vectors Perronnin et al. (2010) and more recently by extracting deep image representations from neural networks (Babenko et al. (2014)). However, once two images are described by feature vectors, visual similarity is commonly measured by computing a standard metric between them. Although regular distance metrics, such as Euclidean distance or cosine similarity, are fast and easy to implement, they do not take into account the possible interdependency within the dataset, which means that even if a strong nonlinear data dependency is occurring in the visual collection, they might not be able to capture it. This suggests that learning a similarity estimation directly from visual data can improve the performance on image retrieval tasks, provided that the likely nonlinearity dependencies within the dataset are precisely learned by the similarity function.
|
| 16 |
+
|
| 17 |
+
Visual similarity learning is closely related to distance metric learning. Traditionally, distance metric learning algorithms were based on linear metrics such as the Mahalanobis distance. However, if the visual data presents any nonlinear interdependency, better results are expected when using nonlinear approaches. According to some studies Tan et al. (2006), standard metric axioms are not valid for human perception of visual similarity and hence, visual similarity functions should not necessarily satisfy distance metric conditions. Deep learning-based similarity learning methods are mostly focused on learning an optimal mapping from pixels to a linear space in which Euclidean distance can be applied. Instead, we propose a simple approach based on neural networks to learn a non-metric similarity score in the feature space.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: System overview. The feature extraction block computes visual representations of images whereas the visual similarity block estimates a similarity score using a neural network.
|
| 21 |
+
|
| 22 |
+

|
| 23 |
+
Figure 2: Siamese architectures (left) map pixels into high-quality vector representations. Our similarity network (right) learns a similarity function on top of the vector representations.
|
| 24 |
+
|
| 25 |
+
Figure 1 shows an overview of the proposed approach. By training a deep learning model, we can estimate a visual similarity function that outperforms methods based on standard metric computations. One convolutional neural network extracts image representations from input images, while a second neural network computes the visual similarity score. The visual similarity neural network is trained using both pairs of similar and dissimilar images in three stages. The output score of the similarity network can be directly applied as a similarity estimation to rank images in an image retrieval task. Experimental results on standard datasets show that our network is able to discriminate when a pair of images is similar or dissimilar and improve standard metrics score on top of that.
|
| 26 |
+
|
| 27 |
+
# 2 RELATED WORK
|
| 28 |
+
|
| 29 |
+
Content-Based Image Retrieval. Content-based image retrieval searches for images by considering their visual content. Given a query image, pictures in a collection are ranked according to their visual similarity with respect to the query. Early methods represent the visual content of images by a set of hand-crafted features, such as SIFT Lowe (2004). As a single image may contain hundreds of these features, aggregation techniques like bag-of-words (BOW) Sivic et al. (2003), Fisher Vectors Perronnin et al. (2010) or VLAD Jegou et al. (2010) encode local descriptors into a compact ´ vector, thereby improving computational efficiency and scalability. Recently, because of the latest advancements on deep learning, features obtained from convolutional neural networks (CNN) have rapidly become the new state-of-the-art in image retrieval.
|
| 30 |
+
|
| 31 |
+
Deep Learning for Image Retrieval. Deep image retrieval extracts activations from CNNs as image representations. At first, some methods Babenko et al. (2014); Sharif Razavian et al. (2014); Wan et al. (2014); Liu et al. (2015) proposed to use representations from one of the last fully connected layers of networks pre-trained on the classification ImageNet dataset Russakovsky et al. (2015). When deeper networks such as GoogLeNet Szegedy et al. (2015) and VGG Simonyan & Zisserman (2014) appeared, some authors Babenko & Lempitsky (2015); Yue-Hei $\mathrm { N g }$ et al. (2015); Sharif Razavian et al. (2014); Xie et al. (2015) showed that mid-layer representations obtained from the convolutional layers performed better in the retrieval task. Since then, there have been several attempts to aggregate these high-dimensional convolutional representations into a compact vector. For example, Gong et al. (2014); Yue-Hei Ng et al. (2015) compacted deep features by using VLAD, Mohedano et al. (2016) encoded the neural codes into an histogram of words, Babenko & Lempitsky (2015); Kalantidis et al. (2016) applied sum-pooling to obtain a compact representation and Razavian et al. (2016); Tolias et al. (2016) aggregated deep features by max-pooling them into a new vector. A different approach is to train the network to directly learn compact binary codes end-to-end (Erin Liong et al., 2015; Lin et al., 2015). Some authors have shown that fine-tunning the networks with similar data to the target task increases the performance significantly (Babenko et al., 2014; Gordo et al., 2016; Radenovic et al., 2016; Salvador et al., 2016; Gordo et al., 2017). ´ Finally, recent work has shown that adding attention models to select meaningful features can be also beneficial for image retrieval (Jimenez et al., 2017; Noh et al., 2017). ´
|
| 32 |
+
|
| 33 |
+
All of these methods are focused on finding high quality features to represent visual content efficiently and visual similarity is computed by simply applying a standard metric distance. General metrics, such as Euclidean distance or cosine similarity, however, might be failing to consider the inner data structure of these visual representations. Learning a similarity function directly from data may help to capture the human perception of visual similarity in a better way.
|
| 34 |
+
|
| 35 |
+
Similarity Learning. Some of the most popular similarity learning work, such as OASIS Chechik et al. (2010) and MLR McFee & Lanckriet (2010), are based on linear metric learning by optimizing the weights of a linear transformation matrix. Although linear methods are easier to optimize and less prone to overfitting, nonlinear algorithms are expected to achieve higher accuracy modeling the possible nonlinearities of data. Nonlinear similarity learning based on deep learning has been recently applied to many different visual contexts. In low-level image matching, CNNs have been trained to match pairs of patches for stereo matching Zagoruyko & Komodakis (2015); Luo et al. (2016) and optical flow Fischer et al. (2015); Thewlis et al. (2016). In high-level image matching, deep learning techniques have been proposed to learn low-dimensional embedding spaces in face verification Chopra et al. (2005), retrieval Wu et al. (2013); Wang et al. (2014), classification Hoffer & Ailon (2015); Qian et al. (2015); Oh Song et al. (2016) and product search Bell & Bala (2015), either by using siamese Chopra et al. (2005) or triplet Wang et al. (2014) architectures.
|
| 36 |
+
|
| 37 |
+
In general, these methods rely on learning a mapping from image pixels to a low dimensional target space to compute the final similarity decision by using a standard metric. They are designed to find the best projection in which a linear distance can be successfully applied. Instead of projecting the visual data into some linear space, that may or may not exist, our approach seeks to learn the nonmetric visual similarity score itself. Similarly, Li et al. (2014) and Han et al. (2015) used a CNN to decide whether or not two input images are a match, applied to pedestrian reindentification and patch matching, respectively. In these methods, the networks are trained as a binary classification problem (i.e. same or different pedestrian/patch), whereas in an image retrieval ranking problem, a regression score is required. Inspired by the results of Wan et al. (2014), which showed that combining deep features with similarity learning techniques can be very beneficial for the performance of image retrieval systems, we propose to train a deep learning algorithm to learn non-metric similarities for image retrieval and improve results in top of high quality image representation methods.
|
| 38 |
+
|
| 39 |
+
# 3 LEARNING VISUAL SIMILARITY
|
| 40 |
+
|
| 41 |
+
# 3.1 DEFINITION
|
| 42 |
+
|
| 43 |
+
Visual similarity is the task that measures how related two images are by using their visual content. Given $n$ samples in the training image collection $I$ , for each image $I _ { i } \in I$ with $i \in [ 1 , n ]$ , a global $d$ -dimensional representation $\bar { x } _ { i } \in \bar { \mathbb { R } } ^ { d }$ is obtained as $x _ { i } = f ( I _ { i } , w _ { f } )$ , where $f$ is the function that maps images into global features and $w _ { f }$ is the set of parameters of $f$ . We define $s _ { i , j }$ as the similarity score which measures how alike two images $I _ { i }$ and $I _ { j }$ are. The higher $s _ { i , j }$ is, the more similar $I _ { i }$ and $I _ { j }$ are. The aim is to learn a visual similarity function $S$ that computes the similarity score from global image representations as:
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\begin{array} { r } { s _ { i , j } = S ( x _ { i } , x _ { j } ) = g ( f ( I _ { i } , w _ { f } ) , f ( I _ { j } , w _ { f } ) , w _ { g } ) } \\ { s . t . \quad s _ { i , j } > s _ { i , k } \to I _ { i } , I _ { j } \mathrm { a r e ~ m o r e ~ s i m i l a r ~ t h a n ~ } I _ { i } , I _ { k } } \end{array}
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
where $g$ is a nonlinear function and $w _ { g }$ is the set of parameters to optimize.
|
| 50 |
+
|
| 51 |
+
Note that $g$ does not have to be a metric in order to be a similarity function and thus, it is not required to satisfy the rigid constraints of metric axioms, i.e. non-negativity, identity of indiscernibles, symmetry and triangle inequality. Some non-metric similarity works such as Tan et al. (2006) suggest that these restrictions are not compatible with human perception. As an example, they showed that although a centaur might be visually similar to both a person and a horse, the person and the horse are not similar to each other. A possible explanation for this phenomenon is that when comparing two images, human beings may pay more attention to similarities and thus, similar portions of the images may be more discriminative than dissimilar parts. To overcome the issues associated with applying strong rigid constraints to visual similarity, we propose to learn the non-metric similarity function $g$ using a neural network approach.
|
| 52 |
+
|
| 53 |
+
# 3.2 IMAGE REPRESENTATION
|
| 54 |
+
|
| 55 |
+
Here we describe the image representation method, $f$ , we use. As this work aims to learn a nonmetric similarity estimation from visual data, our efforts are not focused on improving existing image representation methods, but to learn how to compare them. Without loss of generality, we use the RMAC descriptor proposed in Tolias et al. (2016) as image representation, although any other image representation method can be considered as well.
|
| 56 |
+
|
| 57 |
+
Table 1: Network architectures. Fully connected layers (FC-{filters}) are always followed by a ReLU layer except for the last one. Training: 22.5 million pairs. Validation: 7.5 million pairs.
|
| 58 |
+
|
| 59 |
+
<table><tr><td colspan="2"></td><td rowspan="2"></td><td colspan="2">Training Data</td><td colspan="2">Validation Data</td></tr><tr><td>Config</td><td>Params</td><td>MSE</td><td>p</td><td>MSE</td><td>p</td></tr><tr><td>A</td><td>FC-1024,FC-1024,FC-1</td><td>2.1M</td><td>0.00021</td><td>0.946</td><td>0.00035</td><td>0.909</td></tr><tr><td>B</td><td>FC-4096,FC-4096,FC-1</td><td>21M</td><td>0.00008</td><td>0.978</td><td>0.00019</td><td>0.965</td></tr><tr><td>C</td><td>FC-8192,FC-8192,FC-1</td><td>76M</td><td>0.00007</td><td>0.982</td><td>0.00012</td><td>0.974</td></tr><tr><td>D</td><td>FC-4096,FC-4096,FC-4096,FC-1</td><td>38M</td><td>0.00009</td><td>0.978</td><td>0.00019</td><td>0.964</td></tr></table>
|
| 60 |
+
|
| 61 |
+
RMAC is a deep global image representation obtained from the last convolutional layer of a pretrained CNN on ImageNet classification task Russakovsky et al. (2015). When an image is fed into the network, the last convolutional layer outputs a $W \times H \times K$ response, where $K$ is the number of filters and $W$ and $H$ are the spatial width and height of the output, respectively, that depend on the network architecture as well as on the size of the input image. The response of the $k$ -th filter of the last convolutional layer can be represented by $\Omega _ { k }$ , a 2D tensor of size $W \times H$ . If $\Omega _ { k } ( \boldsymbol { p } )$ is the response at a particular position $p$ , and $R$ is a spatial region within the feature map, the regional feature vector $f _ { R }$ is defined as:
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
f _ { R } = [ f _ { R , 1 } \ldots f _ { R , k } \ldots f _ { R , K } ] ^ { \top }
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
where $f _ { R , k } = \operatorname* { m a x } _ { p \in R } \Omega _ { k } ( p )$ . Thus, $f _ { R }$ consists of the maximum activation of each filter inside the region $R$ . Several regional features are extracted at different multi-scale overlapping regions. Each of these regional vectors is independently post-processed with $\ell 2$ -normalization, PCA-whitening and $\ell 2$ -normalization, as suggested in Jegou & Chum (2012). Finally, regional vectors are summed ´ and $\ell { 2 }$ -normalized once again to obtain the final compact vector. The size of the final vector is $K$ , which is independent of the size of the input image, its aspect ratio or the number of regions used.
|
| 68 |
+
|
| 69 |
+
# 3.3 SIMILARITY NETWORK
|
| 70 |
+
|
| 71 |
+
To compare two images and obtain a visual similarity score we learn the similarity function $g$ by training a deep learning architecture. Given two input images $I _ { i }$ and $I _ { j }$ , we first extract their representations $x _ { i }$ and $x _ { j }$ , respectively, as explained in Section 3.2. The two $K$ -dimensional global vectors are concatenated and fed into the similarity network, as shown in Figure 1. This process is different to the standard siamese architecture Chopra et al. (2005) because the latter maps images into vector representations and updates the shared weights according to the learning protocol and our approach trains and updates the similarity network on top of high-quality vector representations. Moreover, in the similarity network architecture, weights in the image representation block are not necessarily shared. Figure 2 shows the difference between both approaches.
|
| 72 |
+
|
| 73 |
+
The similarity network is composed by a set of fully connected layers, each one of them followed by a non-linear function, such as ReLU Krizhevsky et al. (2012). The input of the network is fixed to be of $1 \times K \times 2$ size, so the size of the first layer is $1 \times K \times 2 \times C h$ , where $C h$ is the number of channels. We consider hidden layers of size $1 \times C h \times 2 \times C h$ . Finally, the output layer is of size $1 \times C h \times 2 \times 1$ and it is not followed by a ReLU layer, as the output similarity score is expected to cover a full range of values, both positive and negative. The regression loss function, $L$ , penalizes when the predicted score of the network is far away from an annotated similarity score, such as:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
L ( I _ { i } , I _ { j } ) = | s _ { i , j } - y _ { i , j } | = | g ( x _ { i } , x _ { j } , w _ { g } ) - y _ { i , j } |
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
where $s _ { i , j }$ is the network output and $y _ { i , j }$ is the annotated score. Four configurations A-D with different number of filters $C h$ and number of hidden layers are proposed and tested during our experiments, as shown in Table 1.
|
| 80 |
+
|
| 81 |
+
# 3.4 TRAINING SIMILARITY
|
| 82 |
+
|
| 83 |
+
The visual similarity network is trained in three stages. In each stage the weights are initialized by the trained weights of the previous stage while the learned task gets progressively more difficult.
|
| 84 |
+
|
| 85 |
+

|
| 86 |
+
Figure 3: Misclassified pairs. (Upper) Lower row: (dissimilar) similar images in which the network score is (lower) higher than the cosine similarity.
|
| 87 |
+
|
| 88 |
+

|
| 89 |
+
Figure 4: mAP versus $\Delta$ . Rigid lines are DeepSimH scores, dashed lines are cosine similarity scores.
|
| 90 |
+
|
| 91 |
+
# STAGE 1: STANDARD METRIC
|
| 92 |
+
|
| 93 |
+
In Stage 1, the network learns a standard similarity function based on the cosine similarity. We generate random pairs of vectors, $x _ { i }$ and $x _ { j }$ , and we assign the cosine similarity between them as the score label yi,j :
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
y _ { i , j } = { \frac { x _ { i } \cdot x _ { j } } { \| x _ { i } \| \| x _ { j } \| } }
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
In order to train the model in the full range of possible values, pairs are produced so that the cosine similarity is uniformly distributed within the training set.
|
| 100 |
+
|
| 101 |
+
STAGE 2: VISUAL SIMILARITY
|
| 102 |
+
|
| 103 |
+
In Stage 2, the basic similarity network learns to increase the similarity score when given two matching images and to decrease it when a pair of images is not a match. The weights in this training stage are initialized by the weights obtained during Stage 1. We now use pairs of image representation vectors $x _ { i }$ and $x _ { j }$ , randomly chosen from our training image dataset. The score label is set to:
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
y _ { i , j } = \left\{ \begin{array} { l l } { \frac { x _ { i } \cdot x _ { j } } { \| x _ { i } \| \| x _ { j } \| } + \Delta , } & { \mathrm { i f } x _ { i } \mathrm { a n d } x _ { j } \mathrm { a r e } \mathrm { s i m i l a r } } \\ { \frac { x _ { i } \cdot x _ { j } } { \| x _ { i } \| \| x _ { j } \| } - \Delta , } & { \mathrm { o t h e r w i s e } } \end{array} \right.
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
where $\Delta$ is the margin parameter. Thus, the model learns to discriminate when a pair of images are similar (dissimilar) and assigns it a higher (lower) value than the standard score.
|
| 110 |
+
|
| 111 |
+
In this stage, the model learns how to compute a similarity score from examples of images that are known to be matching or non-matching. Therefore a relevant dataset to the final retrieval task should be used. Similarity between pairs might be decided using different techniques, such as image classes, score based on local features or manual labeling, among others. Without loss of generality, we consider two images as similar when they belong to the same class and as dissimilar when they belong to different classes.
|
| 112 |
+
|
| 113 |
+
# STAGE 3: HARD EXAMPLES
|
| 114 |
+
|
| 115 |
+
In the Stage 3, the similarity network is refined by training it specifically by using difficult pairs of images. Previous works Gordo et al. (2016); Radenovic et al. (2016) have shown that fine-tunning ´ neural networks using difficult samples is very helpful in terms of performance. This is easy to understand: if the network is only trained by using easy pairs (e.g. a car and a dog), it will not be able to discriminate between difficult pairs (e.g. a car and a van). To choose the set of hard pairs we compute the scores of a random set of image pairs by using the network trained in Stage 2. Those pairs in which the network output is worse than the cosine similarity measure are selected as difficult pairs for retraining1. Examples of difficult image pairs can be seen in Figure 3.
|
| 116 |
+
|
| 117 |
+
# 4 EXPERIMENTS
|
| 118 |
+
|
| 119 |
+
# 4.1 TESTING DATASETS
|
| 120 |
+
|
| 121 |
+
Our approach is evaluated on the standard image retrieval datasets described below.
|
| 122 |
+
|
| 123 |
+
Oxford5k Philbin et al. (2007): a dataset that consists of 5,062 images of 11 different Oxford landmarks. The query set contains 55 annotated images, 5 per landmark.
|
| 124 |
+
|
| 125 |
+
Paris6k Philbin et al. (2008): a datasets that consists of 6,412 images of 11 different Paris landmarks. The query set contains 55 annotated images, 5 per landmark.
|
| 126 |
+
|
| 127 |
+
Land5k: a validation subset of the Landmarks database Babenko et al. (2014). It consists of the 4,915 validation images from 529 classes. A random selection of 45 images is used as queries.
|
| 128 |
+
|
| 129 |
+
Oxford105k, Paris106k: the large-scale versions of Oxford5k and Paris6k, respectively. They include 100,000 distractor images from Flickr Philbin et al. (2007).
|
| 130 |
+
|
| 131 |
+
In both the Oxford5k and the Paris6k collections query images are cropped according to the region of interest provided by the authors of the datasets. Evaluation is performed by computing the mean Average Precision (mAP), using the provided ground truth and algorithms. For Land5k we consider an image to be relevant to the query when it belongs to the same class.
|
| 132 |
+
|
| 133 |
+
# 4.2 TRAINING DATASETS
|
| 134 |
+
|
| 135 |
+
For the purposes of this work, having a training dataset as similar as possible to the final similarity task is essential. We create several versions of the training dataset to evaluate the effect of using different samples in the training process.
|
| 136 |
+
|
| 137 |
+
Landmarks Gordo et al. (2016): an automatically cleaned subset of the full Landmarks Babenko et al. (2014) dataset which officially contains about 49,000 images from 586 landmarks. However, due to broken URLs, we could only download 33,119 training images and 4,915 validation images. This dataset does not contain images from classes that overlap with Oxford5k and Paris6k datasets as they were manually removed.
|
| 138 |
+
|
| 139 |
+
Landmarks-extra500: the Landmarks collection plus 250 random images from each of the Oxford5k and Paris6k datasets. In total, it contains 33,619 training images.
|
| 140 |
+
|
| 141 |
+
Landmarks-extra: the Landmarks collection in addition to about 500 images from Oxford5k and 1,700 images from Paris6k classes. In total, it contains 35,342 training images belonging to 605 different landmarks. Note that query images are not added in any case and they remain unseen by the system.
|
| 142 |
+
|
| 143 |
+
# 4.3 EXPERIMENTAL DETAILS
|
| 144 |
+
|
| 145 |
+
Image Representation. To compute RMAC representations we use the VGG16 network Simonyan & Zisserman (2014), which has been previously pre-trained on the ImageNet dataset Russakovsky et al. (2015). Unless otherwise stated, we use the default values proposed in Tolias et al. (2016) to obtain 512-dimensional RMAC vectors. VGG16 network is used off-the-shelf without any retraining or fine-tunning performed on top of it. Experimental results have shown that RMAC representations are very sensitive to the PCA matrices used in the post-processing step. As we are keeping query images unseen by the system and not using them in the PCA matrices computation as in Tolias et al. (2016), our results are slightly different to theirs.
|
| 146 |
+
|
| 147 |
+
Visual Similarity Learning. Similarity learning is trained using almost a million of random pairs, of which half of the pairs are visual matches and the other half are non-matches. PCA whitening is done using Paris5k images. As RMAC representation performs better in high resolution images, we re-scale all the images up to 1024 pixels, keeping the original aspect ratio of the pictures. For the similarity network, four different configurations A-D (Table 1) are explored during our experiments. The network is optimized using backpropagation and stochastic gradient descent. We use a learning rate of 0.001, a batch size of 100, a weight decay of 0.0005 and momentum of 0.9.
|
| 148 |
+
|
| 149 |
+
Table 2: mAP when using different training configurations and $\Delta$ (in brackets) values.
|
| 150 |
+
|
| 151 |
+
<table><tr><td rowspan="2"></td><td colspan="3">Landmarks</td><td colspan="3">Landmarks-extra500</td><td colspan="3">Landmarks-extra</td></tr><tr><td>Ox5k</td><td>Pa6k</td><td>La5k</td><td>Ox5k</td><td>Pa6k</td><td>La5k</td><td>Ox5k</td><td>Pa6k</td><td>La5k</td></tr><tr><td>Cosine</td><td>0.665</td><td>0.638</td><td>0.564</td><td>0.665</td><td>0.638</td><td>0.564</td><td>0.665</td><td>0.638</td><td>0.564</td></tr><tr><td>DeepCosine</td><td>0.638</td><td>0.596</td><td>0.549</td><td>0.638</td><td>0.596</td><td>0.549</td><td>0.638</td><td>0.596</td><td>0.549</td></tr><tr><td>OASIS</td><td>0.514</td><td>0.385</td><td>0.578</td><td>0.570</td><td>0.651</td><td>0.589</td><td>0.619</td><td>0.853</td><td>0.579</td></tr><tr><td>Linear (0.2)</td><td>0.598</td><td>0.660</td><td>0.508</td><td>0.611</td><td>0.632</td><td>0.514</td><td>0.602</td><td>0.581</td><td>0.502</td></tr><tr><td>DeepSim (0.2)</td><td>0.658</td><td>0.460</td><td>0.669</td><td>0.717</td><td>0.654</td><td>0.671</td><td>0.718</td><td>0.757</td><td>0.668</td></tr><tr><td>DeepSimH(0.2)</td><td>0.655</td><td>0.503</td><td>0.697</td><td>0.719</td><td>0.677</td><td>0.693</td><td>0.786</td><td>0.860</td><td>0.662</td></tr><tr><td>DeepSimH (0.4)</td><td>0.637</td><td>0.504</td><td>0.737</td><td>0.703</td><td>0.701</td><td>0.745</td><td>0.794</td><td>0.878</td><td>0.706</td></tr><tr><td>DeepSimH(0.6)</td><td>0.613</td><td>0.514</td><td>0.776</td><td>0.703</td><td>0.716</td><td>0.776</td><td>0.789</td><td>0.885</td><td>0.735</td></tr><tr><td>DeepSimH (0.8)</td><td>0.600</td><td>0.511</td><td>0.783</td><td>0.685</td><td>0.710</td><td>0.803</td><td>0.808</td><td>0.891</td><td>0.758</td></tr></table>
|
| 152 |
+
|
| 153 |
+
Computational cost. Standard metrics are relatively fast and computationally cheap. Our visual similarity network involves the use of millions of parameters that inevitable increase the computational cost. However, it is still feasible to compute in a reasonable amount of time. In our experiments, training time is about 5 hours in a GeForce GTX 1080 GPU and testing time for a pair of images is $1 . 2 5 ~ \mathrm { m s }$ on average (0.35 ms when using cosine similarity).
|
| 154 |
+
|
| 155 |
+
# 5 RESULTS
|
| 156 |
+
|
| 157 |
+
# 5.1 ARCHITECTURE DISCUSSION
|
| 158 |
+
|
| 159 |
+
Four different configurations A-D for the similarity neural network are proposed. We compare the performance of each one during Stage 1, when the network is trained with the standard cosine similarity measurement. If $s _ { l }$ is the network score and $y _ { l }$ is the cosine similarity of the $l$ -th pair with $l = 1 . . L$ , we evaluate each network by computing the mean squared error, MSE, and the correlation coefficient, $\rho$ , as:
|
| 160 |
+
|
| 161 |
+
$$
|
| 162 |
+
M S E = \frac { 1 } { L } \sum _ { l = 1 } ^ { L } ( s _ { l } - y _ { l } ) ^ { 2 } \rho = \frac { 1 } { L - 1 } \sum _ { l = 1 } ^ { L } \frac { s _ { l } - \mu _ { s } } { \sigma _ { s } } \frac { y _ { l } - \mu _ { y } } { \sigma _ { y } }
|
| 163 |
+
$$
|
| 164 |
+
|
| 165 |
+
where $\mu _ { s }$ and $\sigma _ { s }$ are the mean and standard deviation of the vector of network scores $s$ , and $\mu _ { y }$ and $\sigma _ { y }$ are the mean and standard deviation of the vectors of cosine similarities $y$ .
|
| 166 |
+
|
| 167 |
+
Results are shown in Table 1. Unsurprisingly, the configuration with bigger number of parameters, C, achieves the best MSE and $\rho$ results, both in training and validation sets. However, the performance of networks B and $\mathrm { D }$ is very close to the performance of network C. As network B requires only 21 million parameters and network C requires 76 million parameters, we keep configuration B as our default architecture for the rest of the experiments.
|
| 168 |
+
|
| 169 |
+
# 5.2 EVALUATION OF THE SIMILARITY NETWORK
|
| 170 |
+
|
| 171 |
+
In this section, we study the benefits of using a non-metric distance function trained with neural networks. In order to isolate the contribution of the visual similarity computation and perform a fair comparison between different distance functions, we only train the similarity network part. However, an end-to-end training of the whole image retrieval pipeline is explored in Appendix B.
|
| 172 |
+
|
| 173 |
+
To evaluate our similarity network, we compute the mAP at each stage of the training process (Section 4.2). Results when using different training datasets can be found in Table 2. Cosine similarity is computed as a baseline. We denote as DeepCosine the results obtained after the first stage, when the network is trained to mimic cosine similarity. Naturally, DeepCosine performs worse than the cosine similarity, as it is an estimation of the cosine metric. DeepSim refers to the results obtained after the second stage, when the network is fine-tunned to learn visual similarity with random pairs of images. DeepSimH are the results after the last stage, when the network is trained by using both random and hard pairs of images. We compare our approach against the standard similarity learning algorithm OASIS Chechik et al. (2010). Finally, we also conduct experiments on linear metric learning, which are denoted as Linear in Table 2, by training an affine transformation of the feature vectors using the same training protocol as described in Equation 5.
|
| 174 |
+
|
| 175 |
+
Table 3: mAP results for different state-of-the-art methods. Dim corresponds to the dimensionality of the feature representation. Similarity is the similarity function.
|
| 176 |
+
|
| 177 |
+
<table><tr><td></td><td>Method</td><td>Dim</td><td>Similarity</td><td>Ox5k</td><td>Ox105k</td><td>Pa6k</td><td>Pa106k</td></tr><tr><td rowspan="11">Jltr-ertiti</td><td>Babenko et al. (2014)</td><td>512</td><td>L2</td><td>0.435</td><td>0.392</td><td>=</td><td>1</td></tr><tr><td>Sharif Razavian et al. (2014)</td><td>4096</td><td>Averaged L2</td><td>0.322</td><td>1</td><td>0.495</td><td>1</td></tr><tr><td>Wan et al. (2014)</td><td>4096</td><td>OASIS</td><td>0.466</td><td>1</td><td>0.867</td><td>=</td></tr><tr><td>Babenko & Lempitsky (2015)</td><td>256</td><td>Cosine</td><td>0.657</td><td>0.642</td><td></td><td>=</td></tr><tr><td>Yue-Hei Ng et al. (2015)</td><td>128</td><td>L2</td><td>0.593</td><td>1</td><td>0.59</td><td>=</td></tr><tr><td>Kalantidis et al. (2016)</td><td>512</td><td>L2</td><td>0.708</td><td>0.653</td><td>0.797</td><td>0.722</td></tr><tr><td>Mohedano et al. (2016)</td><td>25k</td><td>Cosine</td><td>0.739</td><td>0.593</td><td>0.82</td><td>0.648</td></tr><tr><td>Salvador et al. (2016)</td><td>512</td><td>Cosine</td><td>0.588</td><td>1</td><td>0.656</td><td>1</td></tr><tr><td>Tolias et al. (2016)</td><td>512</td><td>Cosine</td><td>0.669</td><td>0.616</td><td>0.83</td><td>0.757</td></tr><tr><td>Jiménez et al. (2017)</td><td>512</td><td>Cosine</td><td>0.712</td><td>0.672</td><td>0.805</td><td>0.733</td></tr><tr><td>Ours (△ = 0.8)</td><td>512</td><td>DeepSimH</td><td>0.808</td><td>0.772</td><td>0.891</td><td>0.818</td></tr><tr><td rowspan="7">Binunnau</td><td>Babenko et al. (2014)</td><td>512</td><td>L2</td><td>0.557</td><td>0.522</td><td>1</td><td>1</td></tr><tr><td>Gordo et al. (2016)</td><td>512</td><td>Cosine</td><td>0.831</td><td>0.786</td><td>0.871</td><td>0.797</td></tr><tr><td>Wan et al. (2014)</td><td>4096</td><td>OASIS</td><td>0.783</td><td>1</td><td>0.947</td><td>1</td></tr><tr><td>Radenovic et al. (2016)</td><td>512</td><td>Cosine</td><td>0.77</td><td>0.692</td><td>0.838</td><td>0.764</td></tr><tr><td>Salvador et al. (2016)</td><td>512</td><td>Cosine</td><td>0.71</td><td></td><td>0.798</td><td></td></tr><tr><td>Gordo et al. (2017)</td><td>2048</td><td>Cosine</td><td>0.861</td><td>0.828</td><td>0.945</td><td>0.906</td></tr><tr><td>Ours (△ = 0.8)</td><td>512</td><td>DeepSimH</td><td>0.882</td><td>0.821</td><td>0.882</td><td>0.829</td></tr></table>
|
| 178 |
+
|
| 179 |
+
Our similarity networks outperform OASIS in all the testing datasets. Moreover when using Landmarks-clean-extra as training dataset, results are boosted with respect to the standard metric, achieving improvements ranging from $20 \%$ (Oxford5k) to $40 \%$ (Pairs6k). When using a small subset of images from Oxford5k and Paris6k classes, i.e. Landmarks-clean-extra-500 dataset, our similarity networks also improve mAP with respect to the cosine similarity in the three testing datasets. This indicates that visual similarity can be learnt even when using a reduced subset of the target image domain. Experiments on affine transformations show that, unlike our proposed methods, simple linear metrics are not able to properly fit Equation 5. However, visual similarity does not transfer well across domains when no images of the target domain are used during training. An extended discussion about the effects of the training dataset can be found in Appendix A.
|
| 180 |
+
|
| 181 |
+
Overall, these results suggests that our network is able to learn whether two images are similar or not and provide a similarity score accordingly. Figure 4 shows how the mAP is affected when using different values of $\Delta$ . Except when $\Delta = 0$ (i.e. visual similarity is not learned), DeepSimH always improves mAP with respect to the standard cosine similarity.
|
| 182 |
+
|
| 183 |
+
# 5.3 COMPARISON WITH THE STATE OF THE ART.
|
| 184 |
+
|
| 185 |
+
Finally, we compare our method against several state-of-the-art techniques (Table 3). As standard practice, works are split into two main groups: off-the-shelf and fine-tunning approaches. Off-theshelf are techniques that extract visual representations by using CNNs trained on ImageNet dataset Russakovsky et al. (2015) without modifying the network. On the other hand, fine-tunning methods retrain the network to compute more accurate visual representation. For a fair comparison, we only consider methods that represent each image with a single compact vector and do not apply query expansion or image re-ranking. When using off-the-shelf RMAC features, our DeepSimH approach outperforms previous methods in every dataset. To compare against fine-tunned methods, we compute RMAC vectors using the fine-tunned version of VGG16 proposed in Radenovic et al. (2016) ´ and training our DeepSimH exactly in the same way as in the off-the-shelf version. Accuracy is significantly improved when using our similarity network instead of the analogous cosine similarity method Radenovic et al. (2016). DeepSimH achieves the best mAP precision in´ $_ { \mathrm { O X } 5 \mathrm { k } }$ dataset and comes second in $_ { \mathrm { O X 1 0 5 k } }$ and $\mathrm { P a l 0 6 k }$ after Gordo et al. (2017), which uses the more complex and higher-dimensional ResNet He et al. (2016) instead of a VGG16 network for image representation.
|
| 186 |
+
|
| 187 |
+
# 6 CONCLUSIONS
|
| 188 |
+
|
| 189 |
+
We have presented a method for learning visual similarity directly from visual data. Instead of using a rigid metric distance, such as the standard cosine similarity, we propose to train a neural network model to learn a similarity estimation between a pair of visual representations previously extracted from input images. Our method outperforms state-of-the-art approaches based on rigid distances in standard image retrieval collection of images and experimental results showed that learning a nonmetric visual similarity function is beneficial in image retrieval tasks provided that a small subset of images of the same domain are available during training. Standard image retrieval techniques that are commonly applied after cosine similarity computation, such as query expansion or image re-ranking, might also be applied on top of the similarity network. Finally, we end with an open question, which is the subject of planned future work, concerning efficient computation of exact or approximate K-nearest neighbours based on the learned network similarity function.
|
| 190 |
+
|
| 191 |
+
# REFERENCES
|
| 192 |
+
|
| 193 |
+
Artem Babenko and Victor Lempitsky. Aggregating local deep features for image retrieval. In Proceedings of the IEEE International Conference on Computer Vision, 2015.
|
| 194 |
+
|
| 195 |
+
Artem Babenko, Anton Slesarev, Alexandr Chigorin, and Victor Lempitsky. Neural codes for image retrieval. In Proceedings of the IEEE European Conference on Computer Vision, 2014.
|
| 196 |
+
|
| 197 |
+
Sean Bell and Kavita Bala. Learning visual similarity for product design with convolutional neural networks. ACM Transactions on Graphics (TOG), 34(4), 2015.
|
| 198 |
+
|
| 199 |
+
Gal Chechik, Varun Sharma, Uri Shalit, and Samy Bengio. Large scale online learning of image similarity through ranking. Journal of Machine Learning Research, 11(Mar), 2010.
|
| 200 |
+
|
| 201 |
+
Sumit Chopra, Raia Hadsell, and Yann LeCun. Learning a similarity metric discriminatively, with application to face verification. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2005.
|
| 202 |
+
|
| 203 |
+
Venice Erin Liong, Jiwen Lu, Gang Wang, Pierre Moulin, and Jie Zhou. Deep hashing for compact binary codes learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2015.
|
| 204 |
+
|
| 205 |
+
Philipp Fischer, Alexey Dosovitskiy, Eddy Ilg, Philip Hausser, Caner Hazırbas¸, Vladimir Golkov, ¨ Patrick van der Smagt, Daniel Cremers, and Thomas Brox. Flownet: Learning optical flow with convolutional networks. In Proceedings of the IEEE International Conference on Computer Vision, 2015.
|
| 206 |
+
|
| 207 |
+
Yunchao Gong, Liwei Wang, Ruiqi Guo, and Svetlana Lazebnik. Multi-scale orderless pooling of deep convolutional activation features. In Proceedings of the IEEE European Conference on Computer Vision, 2014.
|
| 208 |
+
|
| 209 |
+
Albert Gordo, Jon Almazan, Jerome Revaud, and Diane Larlus. Deep image retrieval: Learning ´ global representations for image search. In Proceedings of the IEEE European Conference on Computer Vision, 2016.
|
| 210 |
+
|
| 211 |
+
Albert Gordo, Jon Almazan, Jerome Revaud, and Diane Larlus. End-to-end learning of deep visual representations for image retrieval. International Journal of Computer Vision, 124(2), 2017.
|
| 212 |
+
|
| 213 |
+
Xufeng Han, Thomas Leung, Yangqing Jia, Rahul Sukthankar, and Alexander C Berg. Matchnet: Unifying feature and metric learning for patch-based matching. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2015.
|
| 214 |
+
|
| 215 |
+
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, 2016.
|
| 216 |
+
|
| 217 |
+
Elad Hoffer and Nir Ailon. Deep metric learning using triplet network. In International Workshop on Similarity-Based Pattern Recognition, 2015.
|
| 218 |
+
|
| 219 |
+
Herve J ´ egou and Ond ´ ˇrej Chum. Negative evidences and co-occurences in image retrieval: The benefit of pca and whitening. In Computer Vision–ECCV 2012. Springer, 2012.
|
| 220 |
+
|
| 221 |
+
Herve J ´ egou, Matthijs Douze, Cordelia Schmid, and Patrick P ´ erez. Aggregating local descriptors ´ into a compact image representation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2010.
|
| 222 |
+
|
| 223 |
+
Albert Jimenez, Jose M Alvarez, and Xavier Gir ´ o Nieto. Class-weighted convolutional features for ´ visual instance search. In Proceedings of the 28th British Machine Vision Conference, 2017.
|
| 224 |
+
|
| 225 |
+
Yannis Kalantidis, Clayton Mellina, and Simon Osindero. Cross-dimensional weighting for aggregated deep convolutional features. In Proceedings of the IEEE European Conference on Computer Vision, 2016.
|
| 226 |
+
|
| 227 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, 2012.
|
| 228 |
+
|
| 229 |
+
Brian Kulis et al. Metric learning: A survey. Foundations and Trends $\textsuperscript { \textregistered }$ in Machine Learning, 5(4), 2013.
|
| 230 |
+
|
| 231 |
+
Wei Li, Rui Zhao, Tong Xiao, and Xiaogang Wang. Deepreid: Deep filter pairing neural network for person re-identification. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2014.
|
| 232 |
+
|
| 233 |
+
Kevin Lin, Huei-Fang Yang, Jen-Hao Hsiao, and Chu-Song Chen. Deep learning of binary hash codes for fast image retrieval. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, 2015.
|
| 234 |
+
|
| 235 |
+
Yu Liu, Yanming Guo, Song Wu, and Michael S Lew. Deepindex for accurate and efficient image retrieval. In Proceedings of the 5th ACM on International Conference on Multimedia Retrieval. ACM, 2015.
|
| 236 |
+
|
| 237 |
+
David G Lowe. Distinctive image features from scale-invariant keypoints. International journal of computer vision, 60(2), 2004.
|
| 238 |
+
|
| 239 |
+
Wenjie Luo, Alexander G Schwing, and Raquel Urtasun. Efficient deep learning for stereo matching. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2016.
|
| 240 |
+
|
| 241 |
+
Brian McFee and Gert R Lanckriet. Metric learning to rank. In Proceedings of the 27th International Conference on Machine Learning (ICML-10), 2010.
|
| 242 |
+
|
| 243 |
+
Eva Mohedano, Kevin McGuinness, Noel E O’Connor, Amaia Salvador, Ferran Marques, and ´ Xavier Giro-i Nieto. Bags of local convolutional features for scalable instance search. In ´ Proceedings of the 2016 ACM on International Conference on Multimedia Retrieval. ACM, 2016.
|
| 244 |
+
|
| 245 |
+
Hyeonwoo Noh, Andre Araujo, Jack Sim, Tobias Weyand, and Bohyung Han. Large-scale image retrieval with attentive deep local features. In The IEEE International Conference on Computer Vision (ICCV), 2017.
|
| 246 |
+
|
| 247 |
+
Hyun Oh Song, Yu Xiang, Stefanie Jegelka, and Silvio Savarese. Deep metric learning via lifted structured feature embedding. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2016.
|
| 248 |
+
|
| 249 |
+
Florent Perronnin, Yan Liu, Jorge Sanchez, and Herv ´ e Poirier. Large-scale image retrieval with ´ compressed fisher vectors. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2010.
|
| 250 |
+
|
| 251 |
+
J. Philbin, O. Chum, M. Isard, J. Sivic, and A. Zisserman. Object retrieval with large vocabularies and fast spatial matching. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2007.
|
| 252 |
+
|
| 253 |
+
J. Philbin, O. Chum, M. Isard, J. Sivic, and A. Zisserman. Lost in quantization: Improving particular object retrieval in large scale image databases. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2008.
|
| 254 |
+
|
| 255 |
+
Qi Qian, Rong Jin, Shenghuo Zhu, and Yuanqing Lin. Fine-grained visual categorization via multistage metric learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2015.
|
| 256 |
+
|
| 257 |
+
Filip Radenovic, Giorgos Tolias, and Ond ´ ˇrej Chum. Cnn image retrieval learns from bow: Unsupervised fine-tuning with hard examples. In Proceedings of the IEEE European Conference on Computer Vision, 2016.
|
| 258 |
+
|
| 259 |
+
Ali Sharif Razavian, Josephine Sullivan, Stefan Carlsson, and Atsuto Maki. Visual instance retrieval with deep convolutional networks. ITE Transactions on Media Technology and Applications, 4 (3), 2016.
|
| 260 |
+
|
| 261 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. International Journal of Computer Vision (IJCV), 115(3), 2015.
|
| 262 |
+
|
| 263 |
+
Amaia Salvador, Xavier Giro-i Nieto, Ferran Marqu ´ es, and Shin’ichi Satoh. Faster r-cnn features ´ for instance search. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, 2016.
|
| 264 |
+
|
| 265 |
+
Ali Sharif Razavian, Hossein Azizpour, Josephine Sullivan, and Stefan Carlsson. Cnn features offthe-shelf: an astounding baseline for recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, 2014.
|
| 266 |
+
|
| 267 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. CoRR, 2014.
|
| 268 |
+
|
| 269 |
+
Josef Sivic, Andrew Zisserman, et al. Video google: A text retrieval approach to object matching in videos. In Proceedings of the IEEE International Conference on Computer Vision, 2003.
|
| 270 |
+
|
| 271 |
+
Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2015.
|
| 272 |
+
|
| 273 |
+
Xiaoyang Tan, Songcan Chen, Jun Li, and Zhi-Hua Zhou. Learning non-metric partial similarity based on maximal margin criterion. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, volume 1, 2006.
|
| 274 |
+
|
| 275 |
+
J. Thewlis, S. Zheng, P. Torr, and A. Vedaldi. Fully-trainable deep matching. In Proceedings of the British Machine Vision Conference, 2016.
|
| 276 |
+
|
| 277 |
+
Giorgos Tolias, Ronan Sicre, and Herve J ´ egou. Particular object retrieval with integral max-pooling ´ of cnn activations. In Proceedings of the International Conference on Learning Representations, 2016.
|
| 278 |
+
|
| 279 |
+
Laurens Van Der Maaten. Accelerating t-sne using tree-based algorithms. Journal of machine learning research, 15(1), 2014.
|
| 280 |
+
|
| 281 |
+
Ji Wan, Dayong Wang, Steven Chu Hong Hoi, Pengcheng Wu, Jianke Zhu, Yongdong Zhang, and Jintao Li. Deep learning for content-based image retrieval: A comprehensive study. In Proceedings of the 22nd ACM international conference on Multimedia. ACM, 2014.
|
| 282 |
+
|
| 283 |
+
Jiang Wang, Yang Song, Thomas Leung, Chuck Rosenberg, Jingbin Wang, James Philbin, Bo Chen, and Ying Wu. Learning fine-grained image similarity with deep ranking. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2014.
|
| 284 |
+
|
| 285 |
+
Pengcheng Wu, Steven CH Hoi, Hao Xia, Peilin Zhao, Dayong Wang, and Chunyan Miao. Online multimodal deep similarity learning with application to image retrieval. In Proceedings of the 21st ACM international conference on Multimedia. ACM, 2013.
|
| 286 |
+
|
| 287 |
+
Lingxi Xie, Richang Hong, Bo Zhang, and Qi Tian. Image classification and retrieval are one. In Proceedings of the 5th ACM on International Conference on Multimedia Retrieval. ACM, 2015.
|
| 288 |
+
|
| 289 |
+
Joe Yue-Hei Ng, Fan Yang, and Larry S Davis. Exploiting local features from deep networks for image retrieval. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, 2015.
|
| 290 |
+
|
| 291 |
+
Sergey Zagoruyko and Nikos Komodakis. Learning to compare image patches via convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2015.
|
| 292 |
+
|
| 293 |
+

|
| 294 |
+
Figure 5: mAP when using different number of target samples in the training set.
|
| 295 |
+
|
| 296 |
+
# APPENDIX A TRAINING ON TARGET DATASET
|
| 297 |
+
|
| 298 |
+
In this appendix, a further discussion about the influence of the dataset used to train the similarity network and estimate the visual similarity between a pair of images is carried out.
|
| 299 |
+
|
| 300 |
+
As we already noted in Section 5.2, visual similarity does not transfer well across domains. A subset of samples from the target dataset is required during training to learn a meaningful similarity function. This is a well-known problem in the field of metric learning (Kulis et al. (2013)). In Figure 5, we explore the effect on performance when we use different subsets of samples from the target collection in addition to the Landmarks dataset (Gordo et al. (2016)) during the second stage of our training (Section 3.4).
|
| 301 |
+
|
| 302 |
+
Figure 5 shows that there is a clear correlation between the similarity network performance and the number of samples from the target dataset used during training. Indeed, in agreement with previous work in metric learning (Kulis et al. (2013)), we observe that not considering samples from the target dataset to train a similarity function might be harmful. The similarity network, however, outperforms standard metric results even when a small number of samples from the target collection is used during training: only 100 images from $_ { \mathrm { O X } 5 \mathrm { k } }$ and 250 images from Pa6k are required to outperform cosine similarity in $_ { \mathrm { O X } 5 \mathrm { k } }$ and Pa6k datasets, respectively. This fact suggests that the similarity network is able to generalize from a small subset of target samples and is not memorizing the distances in the training collection.
|
| 303 |
+
|
| 304 |
+
Finally, we present some visual results of our findings. Figure 6 and Figure 7 show the t-Distributed Stochastic Neighbor Embedding (t-SNE) (Van Der Maaten, 2014) representation of $_ { \mathrm { O X } 5 \mathrm { k } }$ images when using RMAC as image representation, and cosine similarity or our similarity network as similarity function, respectively. Although RMAC descriptor with a standard metric is already performing well in terms of visual similarity (e.g., in Figure 6 images from Radcliffe camera are grouped together in the right bottom corner), performance can be pushed even more when our similarity network is used instead (Figure 7. In summary, these results indicate the benefit of training a similarity network over a standard metric function such as cosine similarity for the image retrieval task.
|
| 305 |
+
|
| 306 |
+

|
| 307 |
+
Figure 6: t-SNE plot for a subset of $5 0 0 \mathrm { O x } 5 \mathrm { k }$ images when using RMAC and cosine similarity.
|
| 308 |
+
|
| 309 |
+

|
| 310 |
+
Figure 7: t-SNE plot for a subset of $5 0 0 \mathrm { O x } 5 \mathrm { k }$ images when using RMAC and DeepSim.
|
| 311 |
+
|
| 312 |
+
# APPENDIX B END-TO-END TRAINING
|
| 313 |
+
|
| 314 |
+
So far, we have isolated the similarity computation part in the image retrieval pipeline by only training the similarity network. In this way, it is easy to see that the improvement in the testing datasets compare to when using other similarity methods (Section 5.2) is, in fact, due to the visual similarity network function. In this appendix, however, we explore a real end-to-end approach for image retrieval. The end-to-end approach consists on feeding the system with pixels to obtain a visual similarity score between a pair of images. The whole pipeline is presented in Figure 8. For the feature extraction part, we adopt the MAC compact image representation, following Radenovic´ et al. (2016) work. For the visual similarity part, we use our visual similarity network DeepSim. The whole approach is end-to-end differentiable so backpropagation can be applied during training.
|
| 315 |
+
|
| 316 |
+

|
| 317 |
+
Figure 8: End-to-End architecture. The feature extraction part consists on a VGG16 network followed by a max-pooling and a l2-normalization layers. In the visual similarity part, two compact vectors are concatenated and forwarded to the DeepSim network to obtain a similarity score.
|
| 318 |
+
|
| 319 |
+
In this case, we use MAC Tolias et al. (2016) as compact image representation. After feeding a VGG16 network Simonyan & Zisserman (2014) with a pre-processed image, the feature maps from the last convolutional layer are obtained. These feature maps are then max-pooled over the whole region to obtain a compact vector, which is l2-normalized. The final dimensionality of the MAC vector does not depend on the input image size, but in the number of filters in the last convolutional layer. Image pre-processing includes resizing the image to 720 pixels on its largest side (maintaining aspect ratio) and mean subtraction.
|
| 320 |
+
|
| 321 |
+
We initialize the VGG16 network with the weights trained on ImageNet dataset. We then learn the weights of the similarity network by freezing VGG16 weights and applying Stage 1 and Stage 2, as described in Section 3.4. Finally, for the end-to-end training, we unfreeze all the weights of the architecture and fine-tune all the layers one last time. As all the layers have been already pre-trained, the final end-to-end fine-tunning is performed in about 200,000 pairs of images from Landarmarksextra dataset (Section 4.2) for just 5,000 iterations. Note that we adopt MAC Tolias et al. (2016) instead of RMAC as it is easier to train and thus, the results are slightly worst. From Table 4 we note, firstly, a boost in performance when using DeepSim instead of the cosine similarity and finally, a significant improvement when the architecture is trained end-to-end with respect to both the baseline and when only training the visual similarity part.
|
| 322 |
+
|
| 323 |
+
The results are unsurprising as fine-tuning the entire architecture allows us to fit better to a particular dataset. However the key message of the paper is that fine-tuning the final similarity computation, instead on relying on cosines as researchers have been doing so far, may be a worthwhile step that can push accuracy results higher irrespective of the feature vector computation.
|
| 324 |
+
|
| 325 |
+
Table 4: mAP when training different parts of the image retrieval pipeline. In blue, the modules that are fine-tunned in every experiment.
|
| 326 |
+
|
| 327 |
+
<table><tr><td>Features</td><td>Similarity</td><td>Oxford5k</td><td>Paris6k</td><td>Landmarks5k</td></tr><tr><td>MAC</td><td>Cosine</td><td>0.481</td><td>0.539</td><td>0.494</td></tr><tr><td>MAC</td><td>DeepSim</td><td>0.509</td><td>0.683</td><td>0.589</td></tr><tr><td>MAC</td><td>DeepSim</td><td>0.555</td><td>0.710</td><td>0.685</td></tr></table>
|
md/train/Sy4tzwqxe/Sy4tzwqxe.md
ADDED
|
@@ -0,0 +1,314 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TWO METHODS FOR WILD VARIATIONAL INFERENCE
|
| 2 |
+
|
| 3 |
+
Qiang Liu Yihao Feng
|
| 4 |
+
Computer Science, Dartmouth College
|
| 5 |
+
Hanover, NH, 03755
|
| 6 |
+
{qiang.liu, yihao.feng.gr}@dartmouth.edu
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
Variational inference provides a powerful tool for approximate probabilistic inference on complex, structured models. Typical variational inference methods, however, require to use inference networks with computationally tractable probability density functions. This largely limits the design and implementation of variational inference methods. We consider wild variational inference methods that do not require tractable density functions on the inference networks, and hence can be applied in more challenging cases. As an example of application, we treat stochastic gradient Langevin dynamics (SGLD) as an inference network, and use our methods to automatically adjust the step sizes of SGLD, yielding significant improvement over the hand-designed step size schemes.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
Probabilistic modeling provides a principled approach for reasoning under uncertainty, and has been increasingly dominant in modern machine learning where highly complex, structured probabilistic models are often the essential components for solving complex problems with increasingly larger datasets. A key challenge, however, is to develop computationally efficient Bayesian inference methods to approximate, or draw samples from the posterior distributions. Variational inference (VI) provides a powerful tool for scaling Bayesian inference to complex models and big data. The basic idea of VI is to approximate the true distribution with a simpler distribution by minimizing the KL divergence, transforming the inference problem into an optimization problem, which is often then solved efficiently using stochastic optimization techniques (e.g., Hoffman et al., 2013; Kingma & Welling, 2013). However, the practical design and application of VI are still largely restricted by the requirement of using simple approximation families, as we explain in the sequel.
|
| 15 |
+
|
| 16 |
+
Let $p ( z )$ be a distribution of interest, such as the posterior distribution in Bayesian inference. VI approximates $p ( z )$ with a simpler distribution $q ^ { * } ( z )$ found in a set $\mathcal { Q } = \{ q _ { \eta } ( z ) \}$ of distributions indexed by parameter $\eta$ by minimizing the KL divergence objective:
|
| 17 |
+
|
| 18 |
+
$$
|
| 19 |
+
\operatorname* { m i n } _ { \eta } \big \{ \mathrm { K L } ( q _ { \eta } | | p ) \equiv \mathbb { E } _ { z \sim q _ { \eta } } [ \log ( q _ { \eta } ( z ) / p ( z ) ) ] \big \} ,
|
| 20 |
+
$$
|
| 21 |
+
|
| 22 |
+
where we can get exact result $\boldsymbol { p } = \boldsymbol { q } ^ { * }$ if $\mathcal { Q }$ is chosen to be broad enough to actually include $p$ . In practice, however, $\mathcal { Q }$ should be chosen carefully to make the optimization in (1) computationally tractable; this casts two constraints on $\mathcal { Q }$ :
|
| 23 |
+
|
| 24 |
+
1. A minimum requirement is that we should be able to sample from $q _ { \eta }$ efficiently, which allows us to make estimates and predictions based on $q _ { \eta }$ in placement of the more intractable $p$ . The samples from $q _ { \eta }$ can also be used to approximate the expectation $\mathbb { E } _ { q } [ \cdot ]$ in (1) during optimization. This means that there should exist some computable function $f ( \eta ; \xi )$ , called the inference network, which takes a random seed $\xi$ , whose distribution is denoted by $q _ { 0 }$ , and outputs a random variable $z = f ( \eta ; \xi )$ whose distribution is $q _ { \eta }$ .
|
| 25 |
+
|
| 26 |
+
2. We should also be able to calculate the density $q _ { \eta } ( z )$ or it is derivative in order to optimize the KL divergence in (1). This, however, casts a much more restrictive condition, since it requires us to use only simple inference network $f ( \eta ; \xi )$ and input distributions $q _ { 0 }$ to ensure a tractable form for the density $q _ { \eta }$ of the output $z = f ( \eta ; \xi )$ .
|
| 27 |
+
|
| 28 |
+
In fact, it is this requirement of calculating $q _ { \eta } ( z )$ that has been the major constraint for the design of state-of-the-art variational inference methods. The traditional $\mathrm { V I }$ methods are often limited to using simple mean field, or Gaussian-based distributions as $q _ { \eta }$ and do not perform well for approximating complex target distributions. There is a line of recent work on variational inference with rich approximation families (e.g., Rezende & Mohamed, 2015b; Tran et al., 2015; Ranganath et al., 2015, to name only a few), all based on handcrafting special inference networks to ensure the computational tractability of $q _ { \eta } ( z )$ while simultaneously obtaining high approximation accuracy. These approaches require substantial mathematical insights and research effects, and can be difficult to understand or use for practitioners without a strong research background in VI. Methods that allow us to use arbitrary inference networks without substantial constraints can significantly simplify the design and applications of VI methods, allowing practical users to focus more on choosing proposals that work best with their specific tasks.
|
| 29 |
+
|
| 30 |
+

|
| 31 |
+
Figure 1: Wild variational inference allows us to train general stochastic neural inference networks to learn to draw (approximate) samples from the target distributions, without restriction on the computational tractability of the density function of the neural inference networks.
|
| 32 |
+
|
| 33 |
+
We use the term wild variational inference to refer to variants of variational methods working with general inference networks $f ( \eta , \xi )$ without tractability constraints on its output density $q _ { \eta } ( z )$ ; this should be distinguished with the black-box variational inference (Ranganath et al., 2014) which refers to methods that work for generic target distributions $p ( z )$ without significant model-by-model consideration (but still require to calculate the proposal density $q _ { \eta } ( z ) _ { , }$ ). Essentially, wild variational inference makes it possible to “learn to draw samples”, constructing black-box neural samplers for given distributions. This enables more adaptive and automatic design of efficient Bayesian inference procedures, replacing the hand-designed inference algorithms with more efficient ones that can improve their efficiency adaptively over time based on past tasks they performed.
|
| 34 |
+
|
| 35 |
+
In this work, we discuss two methods for wild variational inference, both based on recent works that combine kernel techniques with Stein’s method (e.g., Liu & Wang, 2016; Liu et al., 2016). The first method, also discussed in Wang & Liu (2016), is based on iteratively adjusting parameter $\eta$ to make the random output $z = f ( \eta ; \xi )$ mimic a Stein variational gradient direction (SVGD) (Liu & Wang, 2016) that optimally decreases its KL divergence with the target distribution. The second method is based on minimizing a kernelized Stein discrepancy, which, unlike KL divergence, does not require to calculate density $q _ { \eta } ( z )$ for the optimization thanks to its special form.
|
| 36 |
+
|
| 37 |
+
Another critical problem is to design good network architectures well suited for Bayesian inference. Ideally, the network design should leverage the information of the target distribution $p ( z )$ in a convenient way. One useful perspective is that we can view the existing MC/MCMC methods as (hand-designed) stochastic neural networks which can be used to construct native inference networks for given target distributions. On the other hand, using existing MC/MCMC methods as inference networks also allow us to adaptively adjust the hyper-parameters of these algorithms; this enables amortized inference which leverages the experience on past tasks to accelerate the Bayesian computation, providing a powerful approach for designing efficient algorithms in settings when a large number of similar tasks are needed.
|
| 38 |
+
|
| 39 |
+
As an example, we leverage stochastic gradient Langevin dynamics (SGLD) (Welling & Teh, 2011) as the inference network, which can be treated as a special deep residential network (He et al., 2016), in which important gradient information $\nabla _ { z } \log { p ( z ) }$ is fed into each layer to allow efficient approximation for the target distribution $p ( z )$ . In our case, the network parameter $\eta$ are the step sizes of SGLD, and our method provides a way to adaptively improve the step sizes, providing speed-up on future tasks with similar structures. We show that the adaptively estimated step sizes significantly outperform the hand-designed schemes such as Adagrad.
|
| 40 |
+
|
| 41 |
+
Related Works The idea of amortized inference (Gershman & Goodman, 2014) has been recently applied in various domains of probabilistic reasoning, including both amortized variational inference (e.g., Kingma & Welling, 2013; Rezende & Mohamed, 2015a) and date-driven designs of Monte Carlo based methods (e.g., Paige & Wood, 2016), to name only a few. Most of these methods, however, require to explicitly calculate $q _ { \eta } ( z )$ (or its gradient).
|
| 42 |
+
|
| 43 |
+
One well exception is a very recent work (Ranganath et al., 2016) that also avoids calculating $q _ { \eta } ( z )$ and hence works for general inference networks; their method is based on a similar idea related to Stein discrepancy (Liu et al., 2016; Oates et al., 2017; Chwialkowski et al., 2016; Gorham & Mackey, 2015), for which we provide a more detailed discussion in Section 3.2.
|
| 44 |
+
|
| 45 |
+
The auxiliary variational inference methods (e.g., Agakov & Barber, 2004) provide an alternative way when the variational distribution $q _ { \eta } ( z )$ can be represented as a hidden variable model. In particular, Salimans et al. (2015) used the auxiliary variational approach to leverage MCMC as a variational approximation. These approaches, however, still require to write down the likelihood function on the augmented spaces, and need to introduce an additional inference network related to the auxiliary variables.
|
| 46 |
+
|
| 47 |
+
There is a large literature on traditional adaptive MCMC methods (e.g., Andrieu & Thoms, 2008; Roberts & Rosenthal, 2009) which can be used to adaptively adjust the proposal distribution of MCMC by exploiting the special theoretical properties of MCMC (e.g., by minimizing the autocorrelation). Our method is simpler, more generic, and works efficiently in practice thanks to the use of gradient-based back-propagation. Finally, connections between stochastic gradient descent and variational inference have been discussed and exploited in Mandt et al. (2016); Maclaurin et al. (2015).
|
| 48 |
+
|
| 49 |
+
Outline Section 2 introduces background on Stein discrepancy and Stein variational gradient descent. Section 3 discusses two methods for wild variational inference. Section 4 discuss using stochastic gradient Langevin dynamics (SGLD) as the inference network. Empirical results are shown in Section 5.
|
| 50 |
+
|
| 51 |
+
# 2 STEIN’S IDENTITY, STEIN DISCREPANCY, STEIN VARIATIONAL GRADIENT
|
| 52 |
+
|
| 53 |
+
Stein’s identity Stein’s identity plays a fundamental role in our framework. Let $p ( z )$ be a positive differentiable density on $\mathbb { R } ^ { d }$ , and $\dot { \phi ( z ) } = [ \phi _ { 1 } ( z ) , \cdot \cdot \cdot , \phi _ { d } ( z ) ] ^ { \top }$ is a differentiable vector-valued function. Define $\begin{array} { r } { \nabla _ { z } \cdot \phi = \sum _ { i } \partial _ { z _ { i } } \phi } \end{array}$ . Stein’s identity is
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\mathbb { E } _ { z \sim p } [ \langle \nabla _ { z } \log p ( z ) , \phi ( z ) \rangle + \nabla _ { z } \cdot \phi ( z ) ] = \int _ { \mathcal { X } } \nabla _ { z } \cdot ( p ( z ) \phi ( z ) ) d x = 0 ,
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
which holds once $p ( z ) \phi ( z )$ vanishes on the boundary of $\mathcal { X }$ by integration by parts or Stokes’ theorem; It is useful to rewrite Stein’s identity in a more compact way:
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\begin{array} { r } { \mathbb { E } _ { z \sim p } [ \mathcal { T } _ { p } \phi ( z ) ] = 0 , \quad \mathrm { ~ w i t h ~ } \quad \mathcal { T } _ { p } \phi \overset { d e f } { = } \langle \nabla _ { z } \log p , \phi \rangle + \nabla _ { z } \cdot \phi , } \end{array}
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
where $\mathcal { T } _ { p }$ is called a Stein operator, which acts on function $\phi$ and returns a zero-mean function $\mathcal { T } _ { p } \phi ( z )$ under $z \sim p$ . A key computational advantage of Stein’s identity and Stein operator is that they depend on $p$ only through the derivative of the log-density $\nabla _ { z } \log { p ( z ) }$ , which does not depend on the cumbersome normalization constant of $p$ , that is, when $p ( z ) = \bar { p } ( z ) / Z$ , we have $\nabla _ { z } \log { p ( z ) } = \nabla _ { z } \log { \bar { p } ( z ) }$ , independent of the normalization constant $Z$ . This property makes Stein’s identity a powerful practical tool for handling unnormalized distributions widely appeared in machine learning and statistics.
|
| 66 |
+
|
| 67 |
+
Stein Discrepancy Although Stein’s identity ensures that $\mathcal { T } _ { p } \phi$ has zero expectation under $p$ , its expectation is generally non-zero under a different distribution $q$ . Instead, for $p \neq q$ , there must exist a $\phi$ which distinguishes $p$ and $q$ in the sense that $\mathbb { E } _ { z \sim q } [ \mathcal { T } _ { p } \phi ( z ) ] \neq 0$ . Stein discrepancy leverages this fact to measure the difference between $p$ and $q$ by considering the “maximum violation of Stein’s identity” for $\phi$ in certain function set $\mathcal { F }$ :
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\mathbb { D } ( q | | p ) = \operatorname* { m a x } _ { \phi \in \mathcal { F } } \big \{ \mathbb { E } _ { z \sim q } [ \mathcal { T } _ { p } \phi ( z ) ] \big \} ,
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
where $\mathcal { F }$ is the set of functions $\phi$ that we optimize over, and decides both the discriminative power and computational tractability of Stein discrepancy. Kernelized Stein discrepancy (KSD) is a special
|
| 74 |
+
|
| 75 |
+
Stein discrepancy that takes $\mathcal { F }$ to be the unit ball of vector-valued reproducing kernel Hilbert spaces (RKHS), that is,
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\mathcal { F } = \{ \phi \in \mathcal { H } ^ { d } : | | \phi | | _ { \mathcal { H } ^ { d } } \leq 1 \} ,
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
where $\mathcal { H }$ is a real-valued RKHS with kernel $k ( z , z ^ { \prime } )$ . This choice of $\mathcal { F }$ makes it possible to get a closed form solution for the optimization in (4) (Liu et al., 2016; Chwialkowski et al., 2016; Oates et al., 2017):
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\begin{array} { r l } { \mathbb { D } ( q | | p ) = \underset { \phi \in \mathcal { H } ^ { d } } { \operatorname* { m a x } } \big \lbrace \mathbb { E } _ { z \sim q } [ T _ { p } \phi ( z ) ] , } & { \quad s . t . \quad | | \phi | | _ { \mathcal { H } ^ { d } } \leq 1 \big \rbrace , } \\ { = \sqrt { \mathbb { E } _ { z , z ^ { \prime } \sim q } [ \kappa _ { p } ( z , z ^ { \prime } ) ] } , } \end{array}
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
where $\kappa _ { p } \big ( z , z ^ { \prime } \big )$ is a positive definite kernel obtained by applying Stein operator on $k ( z , z ^ { \prime } )$ twice:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\begin{array} { r l } & { \kappa _ { p } ( z , z ^ { \prime } ) = { \mathcal { T } } _ { p } ^ { z ^ { \prime } } ( { \mathcal { T } } _ { p } ^ { z } \otimes k ( z , z ^ { \prime } ) ) , } \\ & { \qquad = s _ { p } ( z ) s _ { p } ( z ^ { \prime } ) k ( z , z ^ { \prime } ) + s _ { p } ( z ) { \nabla _ { z ^ { \prime } } k ( z , z ^ { \prime } ) } + s _ { p } ( z ^ { \prime } ) { \nabla _ { z } k ( z , z ^ { \prime } ) } + { \nabla _ { z } } \cdot ( { \nabla _ { z ^ { \prime } } k ( z , z ^ { \prime } ) } ) , } \end{array}
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
where $\pmb { \mathscr { s } } _ { p } ( z ) = \nabla _ { z } \log p ( z )$ and $\mathcal { T } _ { p } ^ { z }$ and $\mathcal { T } _ { p } ^ { z }$ denote the Stein operator when treating $k ( z , z ^ { \prime } )$ as a function of $z$ and $z ^ { \prime }$ , respectively; here we defined $\begin{array} { r } { T _ { p } ^ { z } \otimes k ( z , z ^ { \prime } ) = \nabla _ { x } \log p ( x ) k ( z , z ^ { \prime } ) + \nabla _ { x } k ( z , z ^ { \prime } ) } \end{array}$ which returns a $d \times 1$ vector-valued function. It can be shown that $\mathbb { D } ( q | | p ) = 0$ if and only if $q = p$ when $k ( z , z ^ { \prime } )$ is strictly positive definite in a proper sense (Liu et al., 2016; Chwialkowski et al., 2016). $\mathbb { D } ( q \mid \mid p )$ can treated as a variant of maximum mean discrepancy equipped with kernel $\kappa _ { p } \big ( z , z ^ { \prime } \big )$ which depends on $p$ (which makes $\mathbb { D } ( q | | p )$ asymmetric on $q$ and $p$ ).
|
| 94 |
+
|
| 95 |
+
The form of KSD in (6) allows us to estimate the discrepancy between a set of sample $\left\{ z _ { i } \right\}$ (e.g., drawn from $q$ ) and a distribution $p$ specified by $\nabla _ { z } \log { p ( z ) }$ ,
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\widehat { \mathbb { D } } _ { u } ^ { 2 } ( \{ z _ { i } \} \mid | p ) = \frac { 1 } { n ( n - 1 ) } \sum _ { i \neq j } [ \kappa _ { p } ( z _ { i } , z _ { j } ) ] , \qquad \widehat { \mathbb { D } } _ { v } ^ { 2 } ( \{ z _ { i } \} \mid | p ) = \frac { 1 } { n ^ { 2 } } \sum _ { i , j } [ \kappa _ { p } ( z _ { i } , z _ { j } ) ] ,
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
where $\hat { \mathbb { D } } _ { u } ^ { 2 } ( q | | \operatorname { \varepsilon } p )$ provides an unbiased estimator (hence called a $U$ -statistic) for $\mathbb { D } ^ { 2 } ( q \mid | \ p )$ , and $\hat { \mathbb { D } } _ { v } ^ { 2 } ( q \mid | \ p )$ , called $V$ -statistic, provides a biased estimator but is guaranteed to be always nonnegative: $\hat { \mathbb { D } } _ { v } ^ { 2 } \big ( \{ z _ { i } \} \mid \mid p \big ) \ge 0$ .
|
| 102 |
+
|
| 103 |
+
Stein Variational Gradient Descent (SVGD) Stein operator and Stein discrepancy have a close connection with KL divergence, which is exploited in Liu $\&$ Wang (2016) to provide a general purpose deterministic approximate sampling method. Assume that $\{ z _ { i } \} _ { i = 1 } ^ { n }$ is a sample (or a set of particles) drawn from $q$ , and we want to update $\{ z _ { i } \} _ { i = 1 } ^ { n }$ to make it “move closer” to the target distribution $p$ to improve the approximation quality. We consider updates of form
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
z _ { i } \gets z _ { i } + \epsilon \phi ^ { * } ( z _ { i } ) , \quad \forall i = 1 , \dots , n ,
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
where $\phi ^ { * }$ is a perturbation direction, or velocity field, chosen to maximumly decrease the KL divergence between the distribution of updated particles and the target distribution, in the sense that
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\phi ^ { * } = \underset { \phi \in \mathcal { F } } { \arg \operatorname* { m a x } } \bigg \{ - \frac { d } { d \epsilon } \mathrm { K L } ( q _ { [ \epsilon \phi ] } \left| \right| p ) \big | _ { \epsilon = 0 } \bigg \} ,
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
where $q _ { [ \epsilon \phi ] }$ denotes the density of the updated particle $z ^ { \prime } = z + \epsilon \phi ( z )$ when the density of the original particle $z$ is $q$ , and $\mathcal { F }$ is the set of perturbation directions that we optimize over. A key observation (Liu & Wang, 2016) is that the optimization in (11) is in fact equivalent to the optimization for KSD in (4); we have
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
- \frac { d } { d \epsilon } \mathrm { K L } ( q _ { [ \epsilon \phi ] } \left| \right| p ) \big | _ { \epsilon = 0 } = \mathbb { E } _ { z \sim q } [ \mathcal { T } _ { p } \phi ( z ) ] ,
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
that is, the Stein operator transforms the perturbation $\phi$ on the random variable (the particles) to the change of the KL divergence. Taking $\mathcal { F }$ to be unit ball of $\mathcal { H } ^ { d }$ as in (5), the optimal solution $\phi ^ { * }$ of (11) equals that of (6), which is shown to be (e.g., Liu et al., 2016)
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
\phi ^ { * } ( z ^ { \prime } ) \propto \mathbb { E } _ { z \sim q } [ \mathcal { T } _ { p } ^ { z } k ( z , z ^ { \prime } ) ] = \mathbb { E } _ { z \sim q } [ \nabla _ { z } \log p ( z ) k ( z , z ^ { \prime } ) + \nabla _ { z } k ( z , z ^ { \prime } ) ] .
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
# Algorithm 1 Amortized SVGD and KSD Minimization for Wild Variational Inference
|
| 128 |
+
|
| 129 |
+
for iteration t do
|
| 130 |
+
|
| 131 |
+
1. Draw random $\{ \xi _ { i } \} _ { i = 1 } ^ { n }$ , calculate $z _ { i } = f ( \eta ; \xi _ { i } )$ , and the Stein variational gradient $\Delta z _ { i }$ in (13). 2. Update parameter $\eta$ using (14) or (15) for amortized SVGD, or (17) for KSD minimization. end for
|
| 132 |
+
|
| 133 |
+
By approximating the expectation under $q$ with the empirical mean of the current particles $\{ z _ { i } \} _ { i = 1 } ^ { n }$ , SVGD admits a simple form of update that iteratively moves the particles towards the target distribution,
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
\begin{array} { r l } & { \qquad z _ { i } \gets z _ { i } + \epsilon \Delta z _ { i } , \quad \forall i = 1 , \ldots , n , } \\ & { \qquad \Delta z _ { i } = \hat { \mathbb { E } } _ { z \in \{ z _ { i } \} _ { i = 1 } ^ { n } } [ \nabla _ { z } \log p ( z ) k ( z , z _ { i } ) + \nabla _ { z } k ( z , z _ { i } ) ] , } \end{array}
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
where $\begin{array} { r } { \hat { \mathbb { E } } _ { z \sim \{ z _ { i } \} _ { i = 1 } ^ { n } } [ f ( z ) ] = \sum _ { i } f ( z _ { i } ) / n } \end{array}$ . The two terms in $\Delta z _ { i }$ play two different roles: the term with the gradient $\nabla _ { z } \log { p ( z ) }$ drives the particles towards the high probability regions of $p ( z )$ , while the term with $\nabla _ { z } k ( z , z _ { i } )$ serves as a repulsive force to encourage diversity; to see this, consider a stationary kernel $k ( z , z ^ { \prime } ) = k ( z - z ^ { \prime } )$ , then the second term reduces to $\hat { \mathbb { E } } _ { z } \nabla _ { z } k ( z , z _ { i } ) =$ $- \hat { \mathbb { E } } _ { z } \nabla _ { z _ { i } } k ( z , z _ { i } )$ , which can be treated as the negative gradient for minimizing the average similarity $\hat { \mathbb { E } } _ { z } k ( z , z _ { i } )$ in terms of $z _ { i }$ .
|
| 140 |
+
|
| 141 |
+
It is easy to see from (13) that $\Delta z _ { i }$ reduces to the typical gradient $\nabla _ { z } \log { p ( z _ { i } ) }$ when there is only a single particle $( n = 1$ ) and $\nabla _ { z } k ( z , z _ { i } )$ when $z = z _ { i }$ , in which case SVGD reduces to the standard gradient ascent for maximizing $\log p ( z )$ (i.e., maximum a posteriori (MAP)).
|
| 142 |
+
|
| 143 |
+
# 3 TWO METHODS FOR WILD VARIATIONAL INFERENCE
|
| 144 |
+
|
| 145 |
+
Since the direct parametric optimization of the KL divergence (1) requires calculating $q _ { \eta } ( z )$ , there are two essential ways to avoid calculating $q _ { \eta } ( z )$ : either using alternative (approximate) optimization approaches, or using different divergence objective functions. We discuss two possible approaches in this work: one based on “amortizing SVGD” (Wang & Liu, 2016) which trains the inference network $f ( \eta , \xi )$ so that its output mimic the SVGD dynamics in order to decrease the KL divergence; another based on minimizing the KSD objective (9) which does not require to evaluate $q ( z )$ thanks to its special form.
|
| 146 |
+
|
| 147 |
+
# 3.1 AMORTIZED SVGD
|
| 148 |
+
|
| 149 |
+
SVGD provides an optimal updating direction to iteratively move a set of particles $\left\{ z _ { i } \right\}$ towards the target distribution $p ( z )$ . We can leverage it to train an inference network $f ( \eta ; \xi )$ by iteratively adjusting $\eta$ so that the output of $f ( \eta ; \xi )$ changes along the Stein variational gradient direction in order to maximumly decrease its KL divergence with the target distribution. By doing this, we “amortize” SVGD into a neural network, which allows us to leverage the past experience to adaptively improve the computational efficiency and generalize to new tasks with similar structures. Amortized SVGD is also presented in Wang $\&$ Liu (2016); here we present some additional discussion.
|
| 150 |
+
|
| 151 |
+
To be specific, assume $\{ \xi _ { i } \}$ are drawn from $q _ { 0 }$ and $z _ { i } = f ( \eta ; \xi _ { i } )$ the corresponding random output based on the current estimation of $\eta$ . We want to adjust $\eta$ so that $z _ { i }$ changes along the Stein variational gradient direction $\Delta z _ { i }$ in (13) so as to maximumly decrease the KL divergence with target distribution. This can be done by updating $\eta$ via
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
\eta \gets \underset { \eta } { \arg \operatorname* { m i n } } \sum _ { i = 1 } ^ { n } | | f ( \eta ; \xi _ { i } ) - z _ { i } - \epsilon \Delta z _ { i } | | _ { 2 } ^ { 2 } .
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
Essentially, this projects the non-parametric perturbation direction $\Delta z _ { i }$ to the change of the finite dimensional network parameter $\eta$ . If we take the step size $\epsilon$ to be small, then the updated $\eta$ by (14) should be very close to the old value, and a single step of gradient descent of (14) can provide a
|
| 158 |
+
|
| 159 |
+
good approximation for (14). This gives a simpler update rule:
|
| 160 |
+
|
| 161 |
+
$$
|
| 162 |
+
\eta \eta + \epsilon \sum _ { i } \partial _ { \eta } f ( \eta ; \xi _ { i } ) \Delta z _ { i } ,
|
| 163 |
+
$$
|
| 164 |
+
|
| 165 |
+
which can be intuitively interpreted as a form of chain rule that back-propagates the SVGD gradient to the network parameter $\eta$ . In fact, when we have only one particle, (15) reduces to the standard gradient ascent for $\operatorname* { m a x } _ { \eta } \log p ( f ( \eta ; ~ \xi ) )$ , in which $f _ { \eta }$ is trained to “learn to optimize” (e.g., Andrychowicz et al., 2016), instead of “learn to sample” $\dot { p ( z ) }$ . Importantly, as we have more than one particles, the repulsive term $\nabla _ { z } k ( z , z _ { i } )$ in $\Delta z _ { i }$ becomes active, and enforces an amount of diversity on the network output that is consistent with the variation in $p ( z )$ . The full algorithm is summarized in Algorithm 1.
|
| 166 |
+
|
| 167 |
+
Amortized SVGD can be treated as minimizing the KL divergence using a rather special algorithm: it leverages the non-parametric SVGD which can be treated as approximately solving the infinite dimensional optimization ${ \mathrm { m i n } } _ { q } \operatorname { K L } ( q | | p )$ without explicitly assuming a parametric form on $q$ , and iteratively projecting the non-parametric update back to the finite dimensional parameter space of $\eta$ . It is an interesting direction to extend this idea to “amortize” other MC/MCMC-based inference algorithms. For example, given a MCMC with transition probability $T ( z ^ { \prime } | z )$ whose stationary distribution is $p ( z )$ , we may adjust $\eta$ to make the network output move towards the updated values $z ^ { \prime }$ drawn from the transition probability $T ( z ^ { \prime } | z )$ . The advantage of using SVGD is that it provides a deterministic gradient direction which we can back-propagate conveniently and is particle efficient in that it reduces to “learning to optimize” with a single particle. We have been using the simple $L ^ { 2 }$ loss in (14) mainly for convenience; it is possible to use other two-sample discrepancy measures such as maximum mean discrepancy.
|
| 168 |
+
|
| 169 |
+
# 3.2 KSD VARIATIONAL INFERENCE
|
| 170 |
+
|
| 171 |
+
Amortized SVGD attends to minimize the KL divergence objective, but can not be interpreted as a typical finite dimensional optimization on parameter $\eta$ . Here we provide an alternative method based on directly minimizing the kernelized Stein discrepancy (KSD) objective, for which, thanks to its special form, the typical gradient-based optimization can be performed without needing to estimate $q ( z )$ explicitly.
|
| 172 |
+
|
| 173 |
+
To be specific, take $q _ { \eta }$ to be the density of the random output $z = f ( \eta ; \xi )$ when $\xi \sim q _ { 0 }$ , and we want to find $\eta$ to minimize $\mathbb { D } ( q _ { \eta } \parallel p )$ . Assuming $\{ \xi _ { i } \}$ is i.i.d. drawn from $q _ { 0 }$ , we can approximate $\mathbb { D } ^ { 2 } ( q _ { \eta } | | p )$ unbiasedly with a U-statistics:
|
| 174 |
+
|
| 175 |
+
$$
|
| 176 |
+
\mathbb { D } ^ { 2 } ( q _ { \eta } | | p ) \approx \frac { 1 } { n ( n - 1 ) } \sum _ { i \neq j } \kappa _ { p } ( f ( \eta ; \xi _ { i } ) , f ( \eta ; \xi _ { j } ) ) ,
|
| 177 |
+
$$
|
| 178 |
+
|
| 179 |
+
for which a standard gradient descent can be derived for optimizing $\eta$ :
|
| 180 |
+
|
| 181 |
+
$$
|
| 182 |
+
\eta \eta - \epsilon \frac { 2 } { n ( n - 1 ) } \sum _ { i \neq j } \partial _ { \eta } f ( \eta ; \xi _ { i } ) \nabla _ { z _ { i } } \kappa _ { p } ( z _ { i } , z _ { j } ) , \quad \mathrm { ~ w h e r e ~ } \quad z _ { i } = f ( \eta ; \xi _ { i } ) .
|
| 183 |
+
$$
|
| 184 |
+
|
| 185 |
+
This enables a wild variational inference method based on directly minimizing $\eta$ with standard (stochastic) gradient descent. See Algorithm 1. Note that (17) is similar to (15) in form, but replaces ∆zi with a ∆˜ zi ∝ − Pj : i6=j $\begin{array} { r } { \tilde { \Delta } z _ { i } \propto - \sum _ { j : i \neq j } \nabla _ { z _ { i } } \bar { \kappa } _ { p } ( z _ { i } , z _ { j } ) } \end{array}$ . It is also possible to use the $V$ -statistic in (9), but we find that the $U$ -statistic performs much better in practice, possibly because of its unbiasedness property.
|
| 186 |
+
|
| 187 |
+
Minimizing KSD can be viewed as minimizing a constrastive divergence objective function. To see this, recall that $q _ { [ \epsilon \phi ] }$ denotes the density of $z ^ { \prime } = z + \epsilon \phi ( z )$ when $z \sim q$ . Combining (11) and (6), we can show that
|
| 188 |
+
|
| 189 |
+
$$
|
| 190 |
+
\mathbb { D } ^ { 2 } ( q | | p ) \approx \frac { 1 } { \epsilon } ( \mathrm { K L } ( q | | p ) - \mathrm { K L } ( q _ { [ \epsilon \phi ] } | | p ) ) .
|
| 191 |
+
$$
|
| 192 |
+
|
| 193 |
+
That is, KSD measures the amount of decrease of $\mathrm { K L }$ divergence when we update the particles along the optimal SVGD perturbation direction $\phi$ given by (11). If $q = p$ , then the decrease of KL
|
| 194 |
+
|
| 195 |
+
divergence equals zero and $\mathbb { D } ^ { 2 } ( q | | p )$ equals zero. In fact, as shown in Liu & Wang (2016) KSD can be explicitly represented as the magnitude of a functional gradient of KL divergence:
|
| 196 |
+
|
| 197 |
+
$$
|
| 198 |
+
\mathbb { D } ( q \parallel p ) = \biggl \| \frac { d } { d \phi } \mathrm { K L } ( q _ { [ \phi ] } \parallel p ) \bigr | _ { \phi = 0 } \biggl | \biggl | _ { \mathcal { H } ^ { d } } ,
|
| 199 |
+
$$
|
| 200 |
+
|
| 201 |
+
where $q _ { [ \phi ] }$ is the density of $z = z + \phi ( z )$ when $z \sim q$ , and $\textstyle { \frac { d } { d \phi } } F ( \phi )$ denotes the functional gradient of functional $F ( \phi )$ w.r.t. $\phi$ defined in RKHS $\mathcal { H } ^ { d }$ , and $\begin{array} { r } { \frac { d } { d \phi } F ( { \dot { \phi } } ) } \end{array}$ is also an element in $\mathcal { H } ^ { d }$ . Therefore, KSD variational inference can be treated as explicitly minimizing the magnitude of the gradient of KL divergence, in contract with amortized SVGD which attends to minimize the KL divergence objective itself.
|
| 202 |
+
|
| 203 |
+
This idea is also similar to the contrastive divergence used for learning restricted Boltzmann machine (RBM) (Hinton, 2002) (which, however, optimizes $p$ with fixed $q$ ). It is possible to extend this approach by replacing $z ^ { \prime } = z + \epsilon \phi ( z )$ with other transforms, such as these given by a transition probability of a Markov chain whose stationary distribution is $p$ . In fact, according the so called generator method for constructing Stein operator (Barbour, 1988), any generator of a Markov process defines a Stein operator that can be used to define a corresponding Stein discrepancy.
|
| 204 |
+
|
| 205 |
+
This idea is related to a very recent work by Ranganath et al. (2016), which is based on directly minimizing the variational form of Stein discrepancy in (4); Ranganath et al. (2016) assumes $\mathcal { F }$ consists of a neural network $\phi _ { \tau } ( z )$ parametrized by $\tau$ , and find $\eta$ by solving the following min-max problem:
|
| 206 |
+
|
| 207 |
+
$$
|
| 208 |
+
\operatorname* { m i n } _ { \eta } \operatorname* { m a x } _ { \tau } \mathbb { E } _ { z \sim q } [ \mathcal { T } _ { p } \phi _ { \tau } ( z ) ] .
|
| 209 |
+
$$
|
| 210 |
+
|
| 211 |
+
In contrast, our method leverages the closed form solution by taking $\mathcal { F }$ to be an RKHS and hence obtains an explicit optimization problem, instead of a min-max problem that can be computationally more expensive, or have difficulty in achieving convergence.
|
| 212 |
+
|
| 213 |
+
Because $\kappa _ { p } ( \boldsymbol { x } , \boldsymbol { x } ^ { \prime } )$ (defined in (8)) depends on the derivative $\nabla _ { x } \log p ( x )$ of the target distribution, the gradient in (17) depends on the Hessian matrix $\nabla _ { x } ^ { 2 } \log p ( x )$ and is hence less convenient to implement compared with amortized SVGD (the method by Ranganath et al. (2016) also has the same problem). However, this problem can be alleviated using automatic differentiation tools, which be used to directly take the derivative of the objective in (16) without manually deriving its derivatives.
|
| 214 |
+
|
| 215 |
+
# 4 LANGEVIN INFERENCE NETWORK
|
| 216 |
+
|
| 217 |
+
With wild variational inference, we can choose more complex inference network structures to obtain better approximation accuracy. Ideally, the best network structure should leverage the special properties of the target distribution $p ( z )$ in a convenient way. One way to achieve this by viewing existing MC/MCMC methods as inference networks with hand-designed (and hence potentially suboptimal) parameters, but good architectures that take the information of the target distribution $p ( z )$ into account. By applying wild variational inference on networks constructed based on existing MCMC methods, we effectively provide an hyper-parameter optimization for these existing methods. This allows us to fully optimize the potential of existing Bayesian inference methods, significantly improving the result with less computation cost, and decreasing the need for hyper-parameter tuning by human experts. This is particularly useful when we need to solve a large number of similar tasks, where the computation cost spent on optimizing the hyper-parameters can significantly improve the performance on the future tasks.
|
| 218 |
+
|
| 219 |
+
Stochastic Gradient Langevin Dynamics We first take the original stochastic gradient Langevin dynamics (SGLD) algorithm (Welling & Teh, 2011) as an example. SGLD starts with a random initialization $z _ { \mathrm { 0 } }$ , and perform iterative update of form
|
| 220 |
+
|
| 221 |
+
$$
|
| 222 |
+
z ^ { t + 1 } \gets z ^ { t } + \eta ^ { t } \odot \nabla _ { z } \log \hat { p } ( z ^ { t } ; \mathbb { M } ^ { t } ) + \sqrt { 2 \eta ^ { t } } \odot \xi ^ { t } , \quad \forall t = 1 , \cdot \cdot \cdot T ,
|
| 223 |
+
$$
|
| 224 |
+
|
| 225 |
+
where $\log \hat { p } ( z ^ { t } ; \ \mathbb { M } ^ { t } )$ denotes an approximation of $\log p ( z ^ { t } )$ based on, e.g., a random mini-batch $\mathbb { M } ^ { t }$ of observed data at $t$ -th iteration, and $\xi ^ { t }$ is a standard Gaussian random vector of the same size as $z$ , and $\eta ^ { t }$ denotes a (vector) step-size at $t$ -th iteration; here “ $\odot$ ” denotes element-wise product. When running SGLD for $T$ iterations, we can treat $z ^ { T }$ as the output of a $T$ -layer neural network parametrized by the collection of step sizes $\eta = \{ \eta ^ { t } \} _ { t = 1 } ^ { T }$ , whose random inputs include the random initialization $z _ { \mathrm { 0 } }$ , the mini-batch $\mathbb { M } ^ { t }$ and Gaussian noise $\xi ^ { t }$ at each iteration $t$ . We can see that this defines a rather complex network structure with several different types of random inputs $( z ^ { 0 } , \mathbb { M } ^ { t }$ and $\boldsymbol { \xi } ^ { t }$ ). This makes it intractable to explicitly calculate the density of $z ^ { T }$ and traditional variational inference methods can not be applied directly. But wild variational inference can still allow us to adaptively improve the optimal step-size $\eta$ in this case.
|
| 226 |
+
|
| 227 |
+

|
| 228 |
+
Figure 2: Results on a 1D Gaussian mixture when training the step sizes of SGLD with $T = 2 0$ iterations. The target distribution $p ( x )$ is shown by the red dashed line. (a) The distribution of the initialization $z _ { 0 }$ of SGLD (the green line), visualized by kernel density estimator. (b)-(d) The distribution of the final output $z ^ { T }$ (green line) given by different types of step sizes, visualized by kernel density estimator.
|
| 229 |
+
|
| 230 |
+
General Langevin Networks Based on the original formula of SGLD, we proposed a more general langevin network structure, and each layer of the network has a form
|
| 231 |
+
|
| 232 |
+
$$
|
| 233 |
+
\begin{array} { r l r } & { z ^ { t + 1 } \gets A ^ { t } z ^ { t } + h ( B ^ { t } B ^ { t } ^ { \top } \nabla _ { z } \log \hat { p } ( z ^ { t } ; \mathbb { M } ^ { t } ) + B ^ { t } \xi ^ { t } + D ^ { t } ) , \quad } & { \forall t = 1 , \cdots T , } \end{array}
|
| 234 |
+
$$
|
| 235 |
+
|
| 236 |
+
where $A ^ { t } , B ^ { t }$ and $D ^ { t }$ are network parameters at $t$ -th iteration(whose size is $d \times d$ , and $d$ is the size of $z ^ { t }$ ), and $h ( \cdot )$ denotes a smooth element-wise non-linearity function; here $\xi ^ { t }$ is still a standard gaussian random vector with the same size as $z$ . With this more complex network, we can use fewer layers to construct more powerful back-box samplers.
|
| 237 |
+
|
| 238 |
+
# 5 EMPIRICAL RESULTS
|
| 239 |
+
|
| 240 |
+
# 5.1 SGLD INFERENCE NETWORK
|
| 241 |
+
|
| 242 |
+
We first test our algorithm with SGLD inference network with (18) formula on both a toy Gaussian mixture model and a Bayesian logistic regression example. We find that we can adaptively learn step sizes that significantly outperform the existing hand-designed step size schemes, and hence save computational cost in the testing phase. In particular, we compare with the following step size schemes, for all of which we report the best results (testing accuracy in Figure 3(a); testing likelihood in Figure 3(b)) among a range of hyper-parameters:
|
| 243 |
+
|
| 244 |
+
1. Constant Step Size. We select a best constant step size in $\{ 1 , 2 , 2 ^ { 3 } , \dots , 2 ^ { 2 9 } \} \times 1 0 ^ { - 6 }$ .
|
| 245 |
+
|
| 246 |
+
2. Power Decay Step Size. We consider $\epsilon ^ { t } ~ = ~ 1 0 ^ { a } ~ \times ~ ( b + t ) ^ { - \gamma }$ where $\gamma \ = \ 0 . 5 5$ , $a \in$ $\{ - 6 , - 5 , \ldots , 1 , 2 \}$ , $b \in \{ 0 , 1 , \ldots , 9 \}$ .
|
| 247 |
+
|
| 248 |
+
3. Adagrad, Rmsprop, Adadelta, all with the master step size selected in $\{ 1 , 2 , 2 ^ { 3 } , \dots , 2 ^ { 2 9 } \} \times 1 0 ^ { - 6 }$ , with the other parameters chosen by default values.
|
| 249 |
+
|
| 250 |
+
Gaussian Mixture We start with a simple 1D Gaussian mixture example shown in Figure 2 where the target distribution $p ( z )$ is shown by the red dashed curve. We use amortized SVGD and KSD to optimize the step size parameter of the Langevin inference network in (18) with $T = 2 0$ layers (i.e., SGLD with $T = 2 0$ iterations), with an initial $z _ { \mathrm { 0 } }$ drawn from a $q _ { 0 }$ far away from the target distribution (see the green curve in Figure 2(a)); this makes it critical to choose a proper step size to achieve close approximation within $T = 2 0$ iterations. We find that amortized SVGD and KSD allow us to achieve good performance with 20 steps of SGLD updates (Figure 2(b)-(c)), while the result of the best constant step size and power decay step-size are much worse (Figure 2(d)-(e)).
|
| 251 |
+
|
| 252 |
+

|
| 253 |
+
Figure 3: The testing accuracy (a) and testing likelihood (b) when training Langevin inference network with $T \in \{ 1 0 , \bar { 5 } 0 , 1 0 0 \}$ layers, respectively. The results reported here are the performance of the final result $z ^ { T }$ outputted by the last layer of the network. We find that both amortized SVGD and KSD minimization (with $\mathrm { U }$ -statistics) outperform all the hand-designed learning rates. Results averaged on 100 random trails.
|
| 254 |
+
|
| 255 |
+
Bayesian Logistic Regression We consider Bayesian logistic regression for binary classification using the same setting as Gershman et al. (2012), which assigns the regression weights $w$ with a Gaussian prior $p _ { 0 } ( w | \bar { \alpha } ) = \mathcal { N } ( w , \alpha ^ { - 1 } )$ and $p _ { 0 } ( \alpha ) = G a m m a ( \alpha , 1 , 0 . 0 1 )$ . The inference is applied on the posterior of $z = [ w , \log \alpha ]$ . We test this model on the binary Covertype dataset1 with 581,012 data points and 54 features.
|
| 256 |
+
|
| 257 |
+
To demonstrate that our estimated learning rate can work well on new datasets never seen by the algorithm. We partition the dataset into mini-datasets of size 50, 000, and use $8 0 \%$ of them for training and $2 0 \%$ for testing. We adapt our amortized SVGD/KSD to train on the whole population of the training mini-datasets by randomly selecting a mini-dataset at each iteration of Algorithm 1, and evaluate the performance of the estimated step sizes on the remaining $2 0 \%$ testing mini-datasets.
|
| 258 |
+
|
| 259 |
+
Figure 3 reports the testing accuracy and likelihood on the $2 0 \%$ testing mini-datasets when we train the Langevin network with $T = 1 0 , 5 0 , 1 0 0$ layers, respectively. We find that our methods outperform all the hand-designed learning rates, and allow us to get performance closer to the fully converged SGLD and SVGD with a small number $T$ of iterations.
|
| 260 |
+
|
| 261 |
+
Figure 4 shows the testing accuracy and testing likelihood of all the intermediate results when training Langevin network with $T = 1 0 0$ layers. It is interesting to observe that amortized SVGD and KSD learn rather different behavior: KSD tends to increase the performance quickly at the first few iterations but saturate quickly, while amortized SVGD tends to increase slowly in the beginning and boost the performance quickly in the last few iterations. Note that both algorithms are set up to optimize the performance of the last layers, while need to decide how to make progress on the intermediate layers to achieve the best final performance.
|
| 262 |
+
|
| 263 |
+
# 5.2 GENERAL LANGEVIN INFERENCE NETWORK
|
| 264 |
+
|
| 265 |
+
We further test our algorithm with general Langevin inference network. We firstly construct one single layer general Langevin network to approach the posterior of Bayesian logistic regression parameters and we can achieve $7 4 . 5 8 \%$ average accuracy and $- 0 . 5 2 1 6$ average testing log-likelihood in 100 repeat experiments. This result proves the proposed general Langevin Inference Network is quite competitive and worth to explore. Moreover, we use it as a black-box sampler to approach more complicate Gaussian Mixture distributions.
|
| 266 |
+
|
| 267 |
+
Gaussian Mixture We consider 10 components Gaussian Mixture Models with mean and covariance matrix of each component randomly drawed from a uniform distribution, and we test our methods on different dimensions models.
|
| 268 |
+
|
| 269 |
+
We construct 6 layers of general Langevin networks as a black-box sampler, and our proposed two methods to train the black-box sampler to approximate the target distribution. Figure 5 shows our results on 50 dimension Gaussian Mixture case and figure 6 shows results of different dimensions of Gaussian Mixture. From the figures we can know that our proposed sampling structure is quite competive comparing with NUT sampler(Hoffman & Gelman, 2014), and these two variational inference methods can both train a good black-box sampler.
|
| 270 |
+
|
| 271 |
+

|
| 272 |
+
Figure 4: The testing accuracy (a) and testing likelihood (b) of the outputs of the intermediate layers when training the Langevin network with $\bar { T } = 1 0 0$ layers. Note that both amortized SVGD and KSD minimization target to optimize the performance of the last layer, but need to optimize the progress of the intermediate steps in order to achieve the best final results.
|
| 273 |
+
|
| 274 |
+

|
| 275 |
+
Figure 5: Comparation between our methods and NUTS on 50 dimension Gaussian Mixture. (a)-(c) show the mean square errors when using different number particles to estimate expectation $\mathbb { E } ( h ( x ) )$ for $h ( x ) = x$ , $\bar { x ^ { 2 } }$ , and $c o s ( x + b )$ ; for $\cos ( \omega x + b )$ , we random draw $\omega \sim \mathcal { N } ( 0 , 1 )$ and $b \sim$ Uniform $( [ 0 , 2 \pi ] )$ and report the average MSE over 10 random draws of and b.
|
| 276 |
+
|
| 277 |
+

|
| 278 |
+
Figure 6: Comparation between our methods and NUTS For different dimension Gaussian Mixture. (a)-(c) show the mean square errors when using different number particles to estimate expectation $\mathbb { E } ( h ( x ) )$ for $h ( x ) = x ,$ , $\overline { { x ^ { 2 } } }$ , and $c o s ( x + b )$ ; for $c o s ( \omega x + b )$ , we random draw $\omega \sim \mathcal { N } ( 0 , 1 )$ and $\boldsymbol { b } \sim \operatorname { U n i f o r m } ( [ 0 , 2 \pi ] )$ and report the average MSE over 10 random draws of and b.
|
| 279 |
+
|
| 280 |
+
# 6 CONCLUSION
|
| 281 |
+
|
| 282 |
+
We consider two methods for wild variational inference that allows us to train general inference networks with intractable density functions, and apply it to adaptively estimate step sizes of stochastic gradient Langevin dynamics. More studies are needed to develop better methods, more applications and theoretical understandings for wild variational inference, and we hope that the two methods we discussed in the paper can motivate more ideas and studies in the field.
|
| 283 |
+
|
| 284 |
+
# REFERENCES
|
| 285 |
+
|
| 286 |
+
Agakov, Felix V and Barber, David. An auxiliary variational method. In International Conference on Neural Information Processing, pp. 561–566. Springer, 2004.
|
| 287 |
+
Andrieu, Christophe and Thoms, Johannes. A tutorial on adaptive mcmc. Statistics and Computing, 18(4): 343–373, 2008.
|
| 288 |
+
Andrychowicz, Marcin, Denil, Misha, Gomez, Sergio, Hoffman, Matthew W, Pfau, David, Schaul, Tom, and de Freitas, Nando. Learning to learn by gradient descent by gradient descent. arXiv preprint arXiv:1606.04474, 2016.
|
| 289 |
+
Barbour, Andrew D. Stein’s method and poisson process convergence. Journal of Applied Probability, pp. 175–184, 1988.
|
| 290 |
+
Chwialkowski, Kacper, Strathmann, Heiko, and Gretton, Arthur. A kernel test of goodness of fit. In Proceedings of the International Conference on Machine Learning (ICML), 2016.
|
| 291 |
+
Gershman, Samuel, Hoffman, Matt, and Blei, David. Nonparametric variational inference. In Proceedings of the International Conference on Machine Learning (ICML), 2012.
|
| 292 |
+
Gershman, Samuel J and Goodman, Noah D. Amortized inference in probabilistic reasoning. In Proceedings of the 36th Annual Conference of the Cognitive Science Society, 2014.
|
| 293 |
+
Gorham, Jack and Mackey, Lester. Measuring sample quality with Stein’s method. In Advances in Neural Information Processing Systems (NIPS), pp. 226–234, 2015.
|
| 294 |
+
He, Kaiming, Zhang, Xiangyu, Ren, Shaoqing, and Sun, Jian. Deep residual learning for image recognition. In CVPR, 2016.
|
| 295 |
+
Hinton, Geoffrey E. Training products of experts by minimizing contrastive divergence. Neural computation, 14(8):1771–1800, 2002.
|
| 296 |
+
Hoffman, Matthew D and Gelman, Andrew. The no-u-turn sampler: adaptively setting path lengths in hamiltonian monte carlo. Journal of Machine Learning Research, 15(1):1593–1623, 2014.
|
| 297 |
+
Hoffman, Matthew D, Blei, David M, Wang, Chong, and Paisley, John. Stochastic variational inference. JMLR, 2013.
|
| 298 |
+
Kingma, Diederik P and Welling, Max. Auto-encoding variational Bayes. In Proceedings of the International Conference on Learning Representations (ICLR), 2013.
|
| 299 |
+
Liu, Qiang and Wang, Dilin. Stein variational gradient descent: A general purpose bayesian inference algorithm. arXiv preprint arXiv:1608.04471, 2016.
|
| 300 |
+
Liu, Qiang, Lee, Jason D, and Jordan, Michael I. A kernelized Stein discrepancy for goodness-of-fit tests. In Proceedings of the International Conference on Machine Learning (ICML), 2016.
|
| 301 |
+
Maclaurin, Dougal, Duvenaud, David, and Adams, Ryan P. Early stopping is nonparametric variational inference. arXiv preprint arXiv:1504.01344, 2015.
|
| 302 |
+
Mandt, Stephan, Hoffman, Matthew D, and Blei, David M. A variational analysis of stochastic gradient algorithms. arXiv preprint arXiv:1602.02666, 2016.
|
| 303 |
+
Oates, Chris J, Girolami, Mark, and Chopin, Nicolas. Control functionals for Monte Carlo integration. Journal of the Royal Statistical Society, Series B, 2017.
|
| 304 |
+
Paige, Brooks and Wood, Frank. Inference networks for sequential monte carlo in graphical models. arXiv preprint arXiv:1602.06701, 2016.
|
| 305 |
+
Ranganath, R., Altosaar, J., Tran, D., and Blei, D.M. Operator variational inference. 2016.
|
| 306 |
+
Ranganath, Rajesh, Gerrish, Sean, and Blei, David M. Black box variational inference. In Proceedings of the International Conference on Artificial Intelligence and Statistics (AISTATS), 2014.
|
| 307 |
+
Ranganath, Rajesh, Tran, Dustin, and Blei, David M. Hierarchical variational models. arXiv preprint arXiv:1511.02386, 2015.
|
| 308 |
+
Rezende, Danilo Jimenez and Mohamed, Shakir. Variational inference with normalizing flows. In Proceedings of the International Conference on Machine Learning (ICML), 2015a.
|
| 309 |
+
Rezende, Danilo Jimenez and Mohamed, Shakir. Variational inference with normalizing flows. arXiv preprint arXiv:1505.05770, 2015b.
|
| 310 |
+
Roberts, Gareth O and Rosenthal, Jeffrey S. Examples of adaptive mcmc. Journal of Computational and Graphical Statistics, 18(2):349–367, 2009.
|
| 311 |
+
Salimans, Tim et al. Markov chain monte carlo and variational inference: Bridging the gap. In International Conference on Machine Learning, 2015.
|
| 312 |
+
Tran, Dustin, Ranganath, Rajesh, and Blei, David M. Variational gaussian process. arXiv preprint arXiv:1511.06499, 2015.
|
| 313 |
+
Wang, Dilin and Liu, Qiang. Learning to draw samples: With application to amortized mle for generative adversarial learning. Submitted to ICLR 2017, 2016.
|
| 314 |
+
Welling, Max and Teh, Yee W. Bayesian learning via stochastic gradient Langevin dynamics. In Proceedings of the International Conference on Machine Learning (ICML), 2011.
|
md/train/SyxrxR4KPS/SyxrxR4KPS.md
ADDED
|
@@ -0,0 +1,320 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DEEP NEUROETHOLOGY OF A VIRTUAL RODENT
|
| 2 |
+
|
| 3 |
+
Josh Merel?1, Diego Aldarondo $^ { \star 2 , 3 }$ , Jesse Marshal $^ { \star 3 , 4 }$ , Yuval Tassa1, Greg Wayne1, Bence Olveczky ¨ 3,4
|
| 4 |
+
|
| 5 |
+
1DeepMind, London, UK.
|
| 6 |
+
2Program in Neuroscience, 3Center for Brain Science, 4Department of Organismic and Evolutionary Biology, Harvard University, Cambridge, MA 02138, USA.
|
| 7 |
+
jsmerel@google.com, diegoaldarondo@g.harvard.edu,
|
| 8 |
+
jesse d marshall@fas.harvard.edu
|
| 9 |
+
|
| 10 |
+
# ABSTRACT
|
| 11 |
+
|
| 12 |
+
Parallel developments in neuroscience and deep learning have led to mutually productive exchanges, pushing our understanding of real and artificial neural networks in sensory and cognitive systems. However, this interaction between fields is less developed in the study of motor control. In this work, we develop a virtual rodent as a platform for the grounded study of motor activity in artificial models of embodied control. We then use this platform to study motor activity across contexts by training a model to solve four complex tasks. Using methods familiar to neuroscientists, we describe the behavioral representations and algorithms employed by different layers of the network using a neuroethological approach to characterize motor activity relative to the rodent’s behavior and goals. We find that the model uses two classes of representations which respectively encode the task-specific behavioral strategies and task-invariant behavioral kinematics. These representations are reflected in the sequential activity and population dynamics of neural subpopulations. Overall, the virtual rodent facilitates grounded collaborations between deep reinforcement learning and motor neuroscience.
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
Animals have nervous systems that allow them to coordinate their movement and perform a diverse set of complex behaviors. Mammals, in particular, are generalists in that they use the same general neural network to solve a wide variety of tasks. This flexibility in adapting behaviors towards many different goals far surpasses that of robots or artificial motor control systems. Hence, studies of the neural underpinnings of flexible behavior in mammals could yield important insights into the classes of algorithms capable of complex control across contexts and inspire algorithms for flexible control in artificial systems (Merel et al., 2019b).
|
| 17 |
+
|
| 18 |
+
Recent efforts at the interface of neuroscience and machine learning have sparked renewed interest in constructive approaches in which artificial models that solve tasks similar to those solved by animals serve as normative models of biological intelligence. Researchers have attempted to leverage these models to gain insights into the functional transformations implemented by neurobiological circuits, prominently in vision (Khaligh-Razavi & Kriegeskorte, 2014; Yamins et al., 2014; Kar et al., 2019), but also increasingly in other areas, including audition (Kell et al., 2018) and navigation (Banino et al., 2018; Cueva & Wei, 2018). Efforts to construct models of biological locomotion systems have informed our understanding of the mechanisms and evolutionary history of bodies and behavior (Grillner et al., 2007; Ijspeert et al., 2007; Ramdya et al., 2017; Nyakatura et al., 2019). Neural control approaches have also been applied to the study of reaching movements, though often in constrained behavioral paradigms (Lillicrap & Scott, 2013), where supervised training is possible (Sussillo et al., 2015; Michaels et al., 2019).
|
| 19 |
+
|
| 20 |
+
While these approaches model parts of the interactions between animals and their environments (Chiel & Beer, 1997), none attempt to capture the full complexity of embodied control, involving how an animal uses its senses, body and behaviors to solve challenges in a physical environment.
|
| 21 |
+
|
| 22 |
+
The development of models of embodied control is valuable to the field of motor neuroscience, which typically focuses on restricted behaviors in controlled experimental settings. It is also valuable for AI research, where flexible models of embodied control could be applicable to robotics.
|
| 23 |
+
|
| 24 |
+
Here, we introduce a virtual model of a rodent to facilitate grounded investigation of embodied motor systems. The virtual rodent affords a new opportunity to directly compare principles of artificial control to biological data from real-world rodents, which are more experimentally accessible than humans. We draw inspiration from emerging deep reinforcement learning algorithms which now allow artificial agents to perform complex and adaptive movement in physical environments with sensory information that is increasingly similar to that available to animals (Peng et al., 2016; 2017; Heess et al., 2017; Merel et al., 2019a;c). Similarly, our virtual rodent exists in a physical world, equipped with a set of actuators that must be coordinated for it to behave effectively. It also possesses a sensory system that allows it to use visual input from an egocentric camera located on its head and proprioceptive input to sense the configuration of its body in space.
|
| 25 |
+
|
| 26 |
+
There are several questions one could answer using the virtual rodent platform. Here we focus on the problem of embodied control across multiple tasks. While some efforts have been made to analyze neural activity in reduced systems trained to solve multiple tasks (Song et al., 2017; Yang et al., 2019), those studies lacked the important element of motor control in a physical environment. Our rodent platform presents the opportunity to study how representations of movements as well as sequences of movements change as a function of goals and task contexts.
|
| 27 |
+
|
| 28 |
+
To address these questions, we trained our virtual rodent to solve four complex tasks within a physical environment, all requiring the coordinated control of its body. We then ask “Can a neuroscientist understand a virtual rodent?” – a more grounded take on the originally satirical “Can a biologist fix a radio?” (Lazebnik, 2002) or the more recent “Could a neuroscientist understand a microprocessor?” (Jonas & Kording, 2017). We take a more sanguine view of the tremendous advances that have been made in computational neuroscience in the past decade, and posit that the supposed ‘failure’ of these approaches in synthetic systems is partly a misdirection. Analysis approaches in neuroscience were developed with the explicit purpose of understanding sensation and action in real brains, and often implicitly rooted in the types of architectures and processing that are thought relevant in biological control systems. With this philosophy, we use analysis approaches common in neuroscience to explore the types of representations and dynamics that the virtual rodent’s neural network employs to coordinate multiple complex movements in the service of solving motor and cognitive tasks.
|
| 29 |
+
|
| 30 |
+
# 2 APPROACH
|
| 31 |
+
|
| 32 |
+
# 2.1 VIRTUAL RODENT BODY
|
| 33 |
+
|
| 34 |
+

|
| 35 |
+
Figure 1: (A) Anatomical skeleton of a rodent (as reference; not part of physical simulation). (B) A body designed around the skeleton to match the anatomy and model collisions with the environment. (C) Purely cosmetic skin to cover the body. (D) Semi-transparent visualization of (A)-(C) overlain.
|
| 36 |
+
|
| 37 |
+
We implemented a virtual rodent body (Figure 1) in MuJoCo (Todorov et al., 2012), based on measurements of laboratory rats (see Appendix A.1). The rodent body has 38 controllable degrees of freedom. The tail, spine, and neck consist of multiple segments with joints, but are controlled by tendons that co-activate multiple joints (spatial tendons in MuJoCo). The rodent will be released as part of dm control/locomotion.
|
| 38 |
+
|
| 39 |
+
The virtual rodent has access to proprioceptive information as well as “raw” egocentric RGB-camera $6 4 \times 6 4$ pixels) input from a head-mounted camera. The proprioceptive inputs include internal joint angles and angular velocities, the positions and velocities of the tendons that provide actuation, egocentric vectors from the root (pelvis) of the body to the positions of the head and paws, a vestibular-like upright orientation vector, touch or contact sensors in the paws, as well as egocentric acceleration, velocity, and 3D angular velocity of the root.
|
| 40 |
+
|
| 41 |
+
# 2.2 VIRTUAL RODENT TASKS
|
| 42 |
+
|
| 43 |
+

|
| 44 |
+
Figure 2: Visualizations of four tasks the virtual rodent was trained to solve: (A) jumping over gaps (“gaps run”), (B) foraging in a maze (“maze forage”), (C) escaping from a hilly region (“bowl escape”), and (D) touching a ball twice with a forepaw with a precise timing interval between touches (“two-tap”).
|
| 45 |
+
|
| 46 |
+
We implemented four tasks adapted from previous work in deep reinforcement learning and motor neuroscience (Merel et al., 2019a; Tassa et al., 2018; Kawai et al., 2015) to encourage diverse motor behaviors in the rodent. The tasks are as follows: (1) Run along a corridor, over “gaps”, with a reward for traveling along the corridor at a target velocity (Figure 2A). (2) Collect all the blue orbs in a maze, with a sparse reward for each orb collected (Figure 2B). (3) Escape a bowl-shaped region by traversing hilly terrain, with a reward proportional to distance from the center of the bowl (Figure 2C). (4) Approach orbs in an open field, activate them by touching them with a forepaw, and touch them a second time after a precise interval of $8 0 0 \mathrm { m s }$ with a tolerance of $\pm 1 0 0 \mathrm { m s }$ ; there is a time-out period if the touch is not within the tolerated window and rewards are provided sparsely on the first and second touch (Figure 2D). We did not provide the agent with a cue or context indicating its task. Rather, the agent had to infer the task from the visual input and behave appropriately.
|
| 47 |
+
|
| 48 |
+
# 2.3 TRAINING A MULTI-TASK POLICY
|
| 49 |
+
|
| 50 |
+

|
| 51 |
+
Figure 3: The virtual rodent agent architecture. Egocentric visual image inputs are encoded into features via a small residual network (He et al., 2016) and proprioceptive state observations are encoded via a small multi-layer perceptron. The features are passed into a recurrent LSTM module (Hochreiter & Schmidhuber, 1997). The core module is trained by backpropogation during training of the value function. The outputs of the core are also passed as features to the policy module (with the dashed arrow indicating no backpropogation along this path during training) along with shortcut paths from the proprioceptive observations as well as encoded features. The policy module consists of one or more stacked LSTMs (with or without skip connections) which then produce the actions via a stochastic policy.
|
| 52 |
+
|
| 53 |
+
Emboldened by recent results in which end-to-end RL produces a single terrain-adaptive policy (Peng et al., 2016; 2017; Heess et al., 2017), we trained a single architecture on the multiple motorcontrol-reliant tasks (see Figure 3). To train a single policy to perform all four tasks, we used an IMPALA-style setup for actor-critic DeepRL (Espeholt et al., 2018); parallel workers collected rollouts, logged them to a replay, from which a central learner sampled data to perform updates. The value-function critic was trained using off-policy correction via V-trace. To update the actor, we used a variant of MPO (Abdolmaleki et al., 2018) where the E-step is performed using advantages determined from the empirical returns and the value-function, instead of the Q-function (Song et al., 2019). Empirically, we found that the “escape” task was more challenging to learn during interleaved training relative to the other tasks. Consequently, we present results arising from training a singletask expert on the escape task and training the multi-task policies using kickstarting for that task (Schmitt et al., 2018), with a weak coefficient (.001 or .005). Kickstarting on this task made the seeds more reliably solve all four tasks, facilitating comparison of the multi-task policies with different architectures (i.e. the policy having 1, 2, or 3 layers, with or without skip connections across those layers). The procedure yields a single neural network that uses visual inputs to determine how to behave and coordinates its body to move in ways required to solve the tasks. See video examples of a single policy solving episodes of each task: gaps, forage, escape, and two-tap.
|
| 54 |
+
|
| 55 |
+

|
| 56 |
+
Figure 4: Ethology of the virtual rodent. (A) Example jumping sequence in gaps run task with a representative subset of recorded behavioral features. Dashed lines denote the time of the corresponding frames (top). (B) tSNE embedding of 60 behavioral features describing the pose and kinematics of the virtual rodent allows identification of rodent behaviors. Points are colored by hand-labeling of behavioral clusters identified by watershed clustering. (C) The first two principal components of different behavioral features reveals that behaviors are more shared across tasks at short, $5 { - } 2 5 \ \mathrm { H z }$ timescales (fast kinematics), but no longer $0 . 3 – 5 \mathrm { H z }$ timescales (slow kinematics).
|
| 57 |
+
|
| 58 |
+
We analyzed the virtual rodent’s neural network activity in conjunction with its behavior to characterize how it solves multiple tasks (Figure 4A). We used analyses and perturbation techniques adapted from neuroscience, where a range of techniques have been developed to highlight the properties of real neural networks. Biological neural networks have been hypothesized to control, select, and modulate movement through a variety of debated mechanisms, ranging from explicit neural representations of muscle forces and behavioral primitives, to more abstract production of neural dynamics that could underly movement (Graziano, 2006; Kalaska, 2009; Churchland et al., 2012). A challenge with nearly all of these models however is that they have largely been inspired by findings from individual behavioral tasks, making it unclear how to generalize them to a broader range of naturalistic behaviors. To provide insight into mechanisms underlying movement in the virtual rodent, and to potentially give insight by proxy into the mechanisms underlying behavior in real rats, we thus systematically tested how the different network layers encoded and generated different aspects of movement.
|
| 59 |
+
|
| 60 |
+
For all analyses we logged the virtual rodent’s kinematics, joint angles, computed forces, sensory inputs, and the cell unit activity of the LSTMs in core and policy layers during 25 trials per task from each network architecture.
|
| 61 |
+
|
| 62 |
+
# 3.1 VIRTUAL RODENTS EXHIBIT BEHAVIORAL FLEXIBILITY.
|
| 63 |
+
|
| 64 |
+
We began our analysis by quantitatively describing the behavioral repertoire of the virtual rodent. A challenge in understanding the neural mechanisms underlying behavior is that it can be described at many timescales. On short timescales, one could describe rodent locomotion using a set of actuators that produce joint-specific patterns of forces and kinematics. However on longer timescales, these force patterns are organized into coordinated, re-used movements, such as running, jumping, and turning. These movements can be further combined to form behavioral strategies or goal-directed behaviors. Relating neural representations to motor behaviors therefore requires analysis methods that span multiple timescales of behavioral description. To systematically examine the classes of behaviors these networks learn to generate and how they are differentially deployed across tasks, we developed sets of behavioral features that describe the kinematics of the animal on fast (5-25 $\mathrm { H z }$ ), intermediate $\mathrm { 1 - 2 5 \ : H z ) }$ or slow $( 0 . 3 { - } 5 \mathrm { H z } )$ timescales (Appendix A.2, A.3 ). As validation that these features reflected meaningful differences across behaviors, embedding these features using tSNE (Maaten & Hinton, 2008) produced a behavioral map in which virtual rodent behaviors, were segregated to different regions of the map (Figure 4B)(see video). This behavioral repertoire of the virtual rodent consisted of many behaviors observed in rodents, such as rearing, jumping, running, climbing and spinning. While the exact kinematics of the virtual rodent’s behaviors did not exactly match those observed in real rats, they did reproduce unexpected features. For instance the stride frequency of the virtual rodent during galloping matches that observed in rats (Appendix A.3).
|
| 65 |
+
|
| 66 |
+
We next investigated how these behaviors were used by the virtual rodent across tasks. On short timescales, low-level motor features like joint speed and actuator forces occupied similar regions in principal component space (Figure 4C). In contrast, behavioral kinematics, especially on long, $0 . 3 – 5 \ \mathrm { H z }$ timescales, were more differentiated across tasks. Similar results held when examining overlap in other dimensions using multidimensional scaling. Overall this suggests that the network learned to adapt similar movements in a selective manner for different tasks, suggesting that the agent exhibited a form of behavioral flexibility.
|
| 67 |
+
|
| 68 |
+

|
| 69 |
+
3.2 NETWORKS PRIMARILY REFLECT BEHAVIORS, NOT FORCES
|
| 70 |
+
Figure 5: Representational structure of the rodent’s neural network. (A) Example similarity matrices of neural networks and behavioral descriptors. We grouped behavioral descriptors into 50 clusters that and we computed the average neural population vector during each cluster (AppendixA.4). Similarity was assessed by computing the dot product of either the neural population vector or the behavioral feature vector within each cluster. (B) Centered Kernel Alignment (CKA) index of neural and behavioral feature similarity matrices for 3 and 1 policy layer architectures. (C) CKA index of feature similarity matrices across all pairs of network layers. (D) Average CKA index between core and policy layers and behavioral features, compared across architectures. Points show values from individual network seeds. Policy values are averaged across layers.
|
| 71 |
+
|
| 72 |
+
We next examined the neural activity patterns underlying the virtual rodent’s behavior to test if networks produced behaviors through explicit representations of forces, kinematics or behaviors. As expected, core and policy units operate on distinct timescales (See Appendix A.3, Figure 9). Units in the core typically fluctuated over timescales of 1-10 seconds, likely representing variables associated with context and reward. In contrast, units in policy layers were more active over subsecond timescales, potentially encoding motor and behavioral features.
|
| 73 |
+
|
| 74 |
+
To quantify which aspects of behavior were encoded in the core and policy layers, and how these patterns varied across layers, we used representational similarity analysis (RSA) (Kriegeskorte et al., 2008; Kriegeskorte & Diedrichsen, 2019). RSA provides a global measure of how well different features are encoded in layers of a neural network by analyzing the geometries of network activity upon exposure to several stimuli, such as objects. To apply RSA, first a representational similarity (or equivalently, dissimilarity) matrix is computed that quantifies the similarity of neural population responses to a set of stimuli. To test if different neural populations show similar stimulus encodings, these similarity matricies can then be directly compared across different network layers. Multiple metrics, such as the matrix correlation or dot product can be used to compare these neural representational similarity matricies. Here we used the linear centered kernel alignment (CKA) index, which shows invariance to orthonormal rotations of population activity (Kornblith et al., 2019).
|
| 75 |
+
|
| 76 |
+
RSA can also be used to directly test how well a particular stimulus feature is encoded in a population. If each stimuli can be quantitively described by one or more feature vectors, a similarity matrix can also be computed across the set of stimuli themselves. The strength of encoding of a particular set of features can by measured by comparing the correlation of the stimulus feature similarity matrix and the neuronal similarity matrix. The correlation strength directly reflects the ability of a linear decoder trained on the neuronal population vector to distinguish different stimuli (Kriegeskorte & Diedrichsen, 2019). Unlike previous applications of RSA in the analysis of discrete stimuli such as objects, (Khaligh-Razavi & Kriegeskorte, 2014; Yamins et al., 2014) behavior evolves continuously. To adapt RSA to behavioral analysis, we partitioned time by discretizing each behavioral feature into 50 clusters (Appendix A.4).
|
| 77 |
+
|
| 78 |
+
As expected, RSA revealed that core and policy layers encoded somewhat distinct behavioral features. Policy layers contained greater information about fast timescale kinematics in a manner that was largely conserved across layers, while core layers showed more moderate encoding of kinematics that was stronger for slow behavioral features (Figure 5B,C). This difference in encoding was largely consistent across all architectures tested (Figure 5D).
|
| 79 |
+
|
| 80 |
+
The feature encoding of policy networks was somewhat consistent with the emergence of a hierarchy of behavioral abstraction. In networks trained with three policy layers, representations were distributed in timescales across layers, with the last layer (policy 2) showing stronger encoding of fast behavioral features, and the first layer (policy 0) instead showing stronger encoding of slow behavioral features. However, policy layer activity, even close to the motor periphery, did not show strong explicit encoding of behavioral kinematics or forces.
|
| 81 |
+
|
| 82 |
+
# 3.3 BEHAVIORAL REPRESENTATIONS ARE SHARED ACROSS TASKS
|
| 83 |
+
|
| 84 |
+
We then investigated the degree to which the rodent’s neural networks used the same neural representations to produce behaviors, such as running or spinning, that were shared across tasks. Embedding population activity into two-dimensions using multidimensional scaling revealed that core neuron representations were highly distinct across all tasks, while policy layers contained more overlap (Figure 6A), suggesting that some behavioral representations were re-used. Comparison of representational similarity matricies for behaviors that were shared across tasks revealed that policy layers tended to possess a relatively similar encoding of behavioral features, especially fast behavioral features, over tasks (Figure 6C; Appendix A.4). This was validated by inspection of neural activity during individual behaviors shared across tasks (Appendix A.5, Figure 10). Core layer representations across almost all behavioral categories were more variable across tasks, consistent with encoding behavioral sequences or task variables.
|
| 85 |
+
|
| 86 |
+
Interestingly, when comparing this cross-task encoding similarity across architectures, we found that one layer networks showed a marked increase in the similarity of behavioral encoding across tasks (Figure 6D). This suggests that in networks with lower computational capacity, animals must rely on a smaller, shared behavioral representation across tasks.
|
| 87 |
+
|
| 88 |
+

|
| 89 |
+
Figure 6: Policy representations are shared across tasks. (A) Two-dimensional multidimensional scaling embeddings of core and policy activity shows that while policy representations overlap across some tasks, core representations are largely distinct. (B) CKA index of the policy 2 and core network representations of behavioral features during behaviors shared across different tasks (Appendix A.4). Policy 2, but not core networks show similar encoding patterns across the across the maze forage and two-tap tasks, as well as the gaps run and maze forage tasks, consistent with the shared behaviors used across these tasks. (C) The similarity of behavioral feature encoding (CKA index) across different architectures demonstrates that networks with fewer layers show greater similarity across tasks. Points show values from individual seeds.
|
| 90 |
+
|
| 91 |
+

|
| 92 |
+
Figure 7: Neurons in core and policy networks show sequential activity during stereotyped behavior. (A) Example video stills showing the virtual rodent engaged in the two-tap task (B) Average absolute $\mathbf { Z }$ -scored activity traces of all 128 neurons in each layer during performance of the two-tap sequence. Traces are sorted by the time of peak average firing rate. Dashed lines indicate the times of first and second taps. Sequential neural activity is present during the two-tap sequence.
|
| 93 |
+
|
| 94 |
+
While RSA described which behavioral features were represented in core and policy activity, we were also interested in describing how neural activity changes over time to produce different behaviors. We began by analyzing neural activity during the production of stereotyped behaviors. Activity patterns in the two-tap task showed peak activity in core and policy units that was sequentially organized (Figure 7), uniformly tiling time between both taps of the two-tap sequence. This sequential activation was observed across tasks and behaviors in the policy network, including during running (see video) where, consistent with policy networks encoding short-timescale kinematic features in a task-invariant manner, neural activity sequences were largely conserved across tasks (See Appendix A.5, Figure 10). These sequences were reliably repeated across instances of the respective behaviors, and in the case of the two-tap sequence, showed reduced neural variability relative to surrounding timepoints (See Appendix A.6, Figure 11).
|
| 95 |
+
|
| 96 |
+

|
| 97 |
+
Figure 8: Latent network dynamics within tasks reflect rodent behavior on different timescales. (A) Vector field representation of the first two principal components of neural activity in the core and final policy layers during the two-tap task. PC spaces show signatures of rotational dynamics. (B) Vector field representation of first two jPC planes for the core and final policy layers during the twotap task. Apparent rotations within the different planes are associated with behaviors and behavioral features of different timescales, labeled above. Columns denote layer (as in (A)), while rows denote jPC plane. (C) Characteristic frequency of rotations within each jPC plane. Groups of three points respectively indicate the first, second, and third jPC planes for a given layer. Rotations in the core are slower than those in the policy. (D) Variance explained by each jPC plane.
|
| 98 |
+
|
| 99 |
+
The finding of sequential activity hints at a putative mechanism for the rodent’s behavioral production. We next hoped to systematically quantify the types of sequential and dynamical activity present in core and policy networks without presupposing the behaviors of interest. To describe population dynamics in relation to behavior, we first applied principal components analysis (PCA) to the activity during the performance of single tasks, and visualized the gradient of the population vector as a vector field. Figure 8A shows such a vector field representation of the first two principal components of the core and final policy layer during the two-tap task. We generated vector fields by discretizing the PC space into a two-dimensional grid and calculating the average neural activity gradient with respect to time for each bin.
|
| 100 |
+
|
| 101 |
+
The vector fields showed strong signatures of rotational dynamics across all layers, likely a signature of previously described sequential activity. To extract rotational patterns, we used jPCA, a dimensionality reduction method that extracts latent rotational dynamics in neural activity (Churchland et al., 2012). The resulting jPCs form an orthonormal basis that spans the same space as the first six traditional PCs, while maximally emphasizing rotational dynamics. Figure 8B shows the vector fields of the first two jPC planes for the core and final policy layers along with their characteristic frequency. Consistent with our previous findings, jPC planes in the core have lower characteristic frequencies than those in policy layers across tasks (Figure 8C). The jPC planes also individually explained a large percentage of total neural variability (Figure 8D).
|
| 102 |
+
|
| 103 |
+
These rotational dynamics in the policy and core jPC planes were respectively associated with the production of behaviors and the reward structure of the task. For example, in the two-tap task, rotations in the fastest jPC plane in the core were concurrent with the approach to reward, while rotations in the second fastest jPC were concurrent with long timescale transitions between running to the orb and performing the two-tap sequence. Similarly, the fastest jPC in policy layers was correlated with the phase of running, while the second fastest was correlated with the phase of the two-tap sequence (video). This trend of core and policy neural dynamics respectively reflecting behavioral and task-related features was also present in other tasks. For example, in the maze forage task, the first two jPC planes in the core respectively correlated with reaching the target orb and discovering the location of new orbs, while those in the policy were correlated with low-level locomotor features such as running phase (video). Along with RSA, these findings support a model in which the core layer transforms sensory information into a contextual signal in a task-specific manner. This signal then modulates activity in the policy toward different trajectories that generate appropriate behaviors in a more task-independent fashion. For a more complete set of behaviors with neural dynamics visualizations overlaid, see Appendix A.7.
|
| 104 |
+
|
| 105 |
+
# 3.5 NEURAL PERTURBATIONS CORROBORATE DISTINCT ROLES ACROSS LAYERS
|
| 106 |
+
|
| 107 |
+
To causally demonstrate the differing roles of core and policy units in respectively encoding taskrelevant features and movement, we performed silencing and activation of different neuronal subsets in the two-tap task. We identified two stereotyped behaviors (rears and spinning jumps) that were reliably used in two different seeds of the agent to reach the orb in the task. We ranked neurons according to the degree of modulation of their z-scored activity during the performance of these behaviors. We then inactivated subsets of neurons by clamping activity to the mean values between the first and second taps and observed the effects of inactivation on trial success and behavior.
|
| 108 |
+
|
| 109 |
+
In both seeds analyzed, inactivation of policy units had a stronger effect on motor behavior than the inactivation of core units. For instance, in the two-tap task, ablation of 64 neurons in the final policy layer disrupts the performance of the spinning jump (Appendix A.8 Figure 12B video). In contrast, ablation of behavior-modulated core units did not prevent the production of the behavior, but mildly affected the way in which the behavior is directed toward objects in the environment. For example, ablation of a subset of core units during the performance of a spinning jump had a limited effect, but sometimes resulted in jumps that missed the target orbs (video; See Appendix A.8, Figure 12C).
|
| 110 |
+
|
| 111 |
+
We also performed a complementary perturbation aimed to elicit behaviors by overwriting the cell state of neurons in each layer with the average time-varying trajectory of neural activity measured during natural performance of a target behavior. The efficacy of stimulation was found to depend on the gross body posture and behavioral state of an animal, but was nevertheless successful in some cases. For example, during the two-tap sequence, we were able to elicit spinning movements common to searching behaviors in the forage task (video; See Appendix A.8, Figure 12D, E). The efficacy of this activation was more reliable in layers closer to the motor output (Figure 12D). In fact, activation of core units rarely elicited spins, but rather elicited sporadic dashes reminiscent of the searching strategy of many models during the forage task (video).
|
| 112 |
+
|
| 113 |
+
# 4 DISCUSSION
|
| 114 |
+
|
| 115 |
+
For many computational neuroscientists and artificial intelligence researchers, an aim is to reverseengineer the nervous system at an appropriate level of abstraction. In the motor system, such an effort requires that we build embodied models of animals equipped with artificial nervous systems capable of controlling their synthetic bodies across a range of behavior. Here we introduced a virtual rodent capable of performing a variety of complex locomotor behaviors to solve multiple tasks using a single policy. We then used this virtual nervous system to study principles of the neural control of movement across contexts and described several commonalities between the neural activity of artificial control and previous descriptions of biological control.
|
| 116 |
+
|
| 117 |
+
A key advantage of this approach relative to experimental approaches in neuroscience is that we can fully observe sensory inputs, neural activity, and behavior, facilitating more comprehensive testing of theories related to how behavior can be generated. Furthermore, we have complete knowledge of the connectivity, sources of variance, and training objectives of each component of the model, providing a rare ground truth to test the validity of our neural analyses. With these advantages in mind, we evaluated our analyses based on their capacity to both describe the algorithms and representations employed by the virtual rodent and recapitulate the known functional objectives underlying its creation without prior knowledge.
|
| 118 |
+
|
| 119 |
+
To this end, our description of core and policy as respectively representing value and motor production is consistent with the model’s actor-critic training objectives. But beyond validation, our analyses provide several insights into how these objectives are reached. RSA revealed that the cell activity of core and policy layers had greater similarity with behavioral and postural features than with short-timescale actuators. This suggests that the representation of behavior is useful in the moment-to-moment production of motor actions in artificial control, a model that has been previously proposed in biological action selection and motor control (Mink, 1996; Graziano, 2006). These behavioral representations were more consistent across tasks in the policy than in the core, suggesting that task context and value activity in the core engaged task-specific behavioral strategies through the reuse of shared motor activity in the policy.
|
| 120 |
+
|
| 121 |
+
Our analysis of neural dynamics suggests that reused motor activity patterns are often organized as sequences. Specifically, the activity of policy units uniformly tiles time in the production of several stereotyped behaviors like running, jumping, spinning, and the two-tap sequence. This finding is consistent with reports linking sequential neural activity to the production of stereotyped motor and task-oriented behavior in rodents (Berke et al., 2009; Rueda-Orozco & Robbe, 2015; Dhawale et al., 2019), including during task delay periods (Akhlaghpour et al., 2016), as well as in singing birds (Albert & Margoliash, 1996; Hahnloser et al., 2002). Similarly, by relating rotational dynamics to the virtual rodent’s behavior, we found that different behaviors were seemingly associated with distinct rotations in neural activity space that evolved at different timescales. These findings are consistent with a hierarchical control scheme in which policy layer dynamics that generate reused behaviors are activated and modulated by sensorimotor signals from the core.
|
| 122 |
+
|
| 123 |
+
This work represents an early step toward the constructive modeling of embodied control for the purpose of understanding the neural mechanisms behind the generation of behavior. Incrementally and judiciously increasing the realism of the model’s embodiment, behavioral repertoire, and neural architecture is a natural path for future research. Our virtual rodent possesses far fewer actuators and touch sensors than a real rodent, uses a vastly different sense of vision, and lacks integration with olfactory, auditory, and whisker-based sensation (see Zhuang et al., 2017). While the virtual rodent is capable of locomotor behaviors, an increased diversity of tasks involving decision making, memory-based navigation, and working memory could give insight into “cognitive” behaviors of which rodents are capable. Furthermore, biologically-inspired design of neural architectures and training procedures should facilitate comparisons to real neural recordings and manipulations. We expect that this comparison will help isolate residual elements of animal behavior generation that are poorly captured by current models of motor control, and encourage the development of artificial neural architectures that can produce increasingly realistic behavior.
|
| 124 |
+
|
| 125 |
+
# AUTHOR CONTRIBUTIONS
|
| 126 |
+
|
| 127 |
+
Josh and Yuval built the rodent MuJoCo model, with measurements collected by Diego and Jesse. Josh trained the virtual rodent model. Jesse performed behavioral and neural representation analyses. Diego performed neural dynamics analyses. Josh, Jesse, and Diego drafted the manuscript. All authors contributed to the conception of the project.
|
| 128 |
+
|
| 129 |
+
# ACKNOWLEDGMENTS
|
| 130 |
+
|
| 131 |
+
The rodent skeleton reference model was purchased from leo3Dmodels on TurboSquid. Thanks to Max Cant for the rodent skin, and Marcus Wainwright for the skybox and ground textures. D.A. was supported by NSF GRFP DGE1745303. J.D.M was supported by a fellowship from the Helen Hay Whitney foundation sponsored by Vertex and a K99/R00 award from the NINDS.
|
| 132 |
+
|
| 133 |
+
# REFERENCES
|
| 134 |
+
|
| 135 |
+
Abbas Abdolmaleki, Jost Tobias Springenberg, Yuval Tassa, Remi Munos, Nicolas Heess, and Martin Riedmiller. Maximum a posteriori policy optimisation. In International Conference on Learning Representations, 2018.
|
| 136 |
+
|
| 137 |
+
Hessameddin Akhlaghpour, Joost Wiskerke, Jung Yoon Choi, Joshua P Taliaferro, Jennifer Au, and Ilana B Witten. Dissociated sequential activity and stimulus encoding in the dorsomedial striatum during spatial working memory. Elife, 5:e19507, 2016.
|
| 138 |
+
|
| 139 |
+
C Yu Albert and Daniel Margoliash. Temporal hierarchical control of singing in birds. Science, 273 (5283):1871–1875, 1996.
|
| 140 |
+
|
| 141 |
+
Andrea Banino, Caswell Barry, Benigno Uria, Charles Blundell, Timothy Lillicrap, Piotr Mirowski, Alexander Pritzel, Martin J Chadwick, Thomas Degris, Joseph Modayil, et al. Vector-based navigation using grid-like representations in artificial agents. Nature, 557(7705):429, 2018.
|
| 142 |
+
|
| 143 |
+
Joshua D Berke, Jason T Breck, and Howard Eichenbaum. Striatal versus hippocampal representations during win-stay maze performance. Journal of neurophysiology, 101(3):1575–1587, 2009.
|
| 144 |
+
|
| 145 |
+
Gordon J Berman, Daniel M Choi, William Bialek, and Joshua W Shaevitz. Mapping the stereotyped behaviour of freely moving fruit flies. Journal of The Royal Society Interface, 11(99):20140672, 2014.
|
| 146 |
+
|
| 147 |
+
Hillel J Chiel and Randall D Beer. The brain has a body: adaptive behavior emerges from interactions of nervous system, body and environment. Trends in neurosciences, 20(12):553–557, 1997.
|
| 148 |
+
|
| 149 |
+
Mark M Churchland, M Yu Byron, John P Cunningham, Leo P Sugrue, Marlene R Cohen, Greg S Corrado, William T Newsome, Andrew M Clark, Paymon Hosseini, Benjamin B Scott, et al. Stimulus onset quenches neural variability: a widespread cortical phenomenon. Nature neuroscience, 13(3):369, 2010.
|
| 150 |
+
|
| 151 |
+
Mark M Churchland, John P Cunningham, Matthew T Kaufman, Justin D Foster, Paul Nuyujukian, Stephen I Ryu, and Krishna V Shenoy. Neural population dynamics during reaching. Nature, 487 (7405):51, 2012.
|
| 152 |
+
|
| 153 |
+
Christopher J Cueva and Xue-Xin Wei. Emergence of grid-like representations by training recurrent neural networks to perform spatial localization. arXiv preprint arXiv:1803.07770, 2018.
|
| 154 |
+
|
| 155 |
+
Ashesh K Dhawale, Steffen BE Wolff, Raymond Ko, and Bence P Olveczky. The basal ganglia can ¨ control learned motor sequences independently of motor cortex. bioRxiv, pp. 827261, 2019.
|
| 156 |
+
|
| 157 |
+
Lasse Espeholt, Hubert Soyer, Remi Munos, Karen Simonyan, Volodymyr Mnih, Tom Ward, Yotam Doron, Vlad Firoiu, Tim Harley, Iain Dunning, et al. IMPALA: Scalable distributed deep-rl with importance weighted actor-learner architectures. In International Conference on Machine Learning, pp. 1406–1415, 2018.
|
| 158 |
+
|
| 159 |
+
Michael Graziano. The organization of behavioral repertoire in motor cortex. Annu. Rev. Neurosci., 29:105–134, 2006.
|
| 160 |
+
|
| 161 |
+
Sten Grillner, Alexander Kozlov, Paolo Dario, Cesare Stefanini, Arianna Menciassi, Anders Lansner, and Jeanette Hellgren Kotaleski. Modeling a vertebrate motor system: pattern generation, steering and control of body orientation. Progress in brain research, 165:221–234, 2007.
|
| 162 |
+
|
| 163 |
+
Richard HR Hahnloser, Alexay A Kozhevnikov, and Michale S Fee. An ultra-sparse code underliesthe generation of neural sequences in a songbird. Nature, 419(6902):65, 2002.
|
| 164 |
+
|
| 165 |
+
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.
|
| 166 |
+
|
| 167 |
+
Nicolas Heess, TB Dhruva, Srinivasan Sriram, Jay Lemmon, Josh Merel, Greg Wayne, Yuval Tassa, Tom Erez, Ziyu Wang, Ali Eslami, et al. Emergence of locomotion behaviours in rich environments. arXiv preprint arXiv:1707.02286, 2017.
|
| 168 |
+
|
| 169 |
+
Norman C Heglund and C Richard Taylor. Speed, stride frequency and energy cost per stride: how do they change with body size and gait? Journal of Experimental Biology, 138(1):301–318, 1988.
|
| 170 |
+
|
| 171 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 172 |
+
|
| 173 |
+
Auke Jan Ijspeert, Alessandro Crespi, Dimitri Ryczko, and Jean-Marie Cabelguen. From swimming to walking with a salamander robot driven by a spinal cord model. Science, 315(5817):1416– 1420, 2007.
|
| 174 |
+
|
| 175 |
+
Eric Jonas and Konrad Paul Kording. Could a neuroscientist understand a microprocessor? PLoS computational biology, 13(1):e1005268, 2017.
|
| 176 |
+
|
| 177 |
+
John F Kalaska. From intention to action: motor cortex and the control of reaching movements. In Progress in Motor Control, pp. 139–178. Springer, 2009.
|
| 178 |
+
|
| 179 |
+
Kohitij Kar, Jonas Kubilius, Kailyn Schmidt, Elias B Issa, and James J DiCarlo. Evidence that recurrent circuits are critical to the ventral streams execution of core object recognition behavior. Nature neuroscience, 22(6):974, 2019.
|
| 180 |
+
|
| 181 |
+
Risa Kawai, Timothy Markman, Rajesh Poddar, Raymond Ko, Antoniu L Fantana, Ashesh K Dhawale, Adam R Kampff, and Bence P Olveczky. Motor cortex is required for learning but ¨ not for executing a motor skill. Neuron, 86(3):800–812, 2015.
|
| 182 |
+
|
| 183 |
+
Alexander JE Kell, Daniel LK Yamins, Erica N Shook, Sam V Norman-Haignere, and Josh H McDermott. A task-optimized neural network replicates human auditory behavior, predicts brain responses, and reveals a cortical processing hierarchy. Neuron, 98(3):630–644, 2018.
|
| 184 |
+
|
| 185 |
+
Seyed-Mahdi Khaligh-Razavi and Nikolaus Kriegeskorte. Deep supervised, but not unsupervised, models may explain it cortical representation. PLoS computational biology, 10(11):e1003915, 2014.
|
| 186 |
+
|
| 187 |
+
Simon Kornblith, Mohammad Norouzi, Honglak Lee, and Geoffrey E. Hinton. Similarity of neural network representations revisited. CoRR, abs/1905.00414, 2019.
|
| 188 |
+
|
| 189 |
+
Nikolaus Kriegeskorte and Jorn Diedrichsen. Peeling the onion of brain representations. ¨ Annual Review of Neuroscience, 42(1):407–432, 2019.
|
| 190 |
+
|
| 191 |
+
Nikolaus Kriegeskorte, Marieke Mur, and Peter A Bandettini. Representational similarity analysisconnecting the branches of systems neuroscience. Frontiers in systems neuroscience, 2:4, 2008.
|
| 192 |
+
|
| 193 |
+
Yuri Lazebnik. Can a biologist fix a radio? Or, what I learned while studying apoptosis. Cancer cell, 2(3):179–182, 2002.
|
| 194 |
+
|
| 195 |
+
Timothy P Lillicrap and Stephen H Scott. Preference distributions of primary motor cortex neurons reflect control solutions optimized for limb biomechanics. Neuron, 77(1):168–179, 2013.
|
| 196 |
+
|
| 197 |
+
Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-SNE. Journal of machine learning research, 9(Nov):2579–2605, 2008.
|
| 198 |
+
|
| 199 |
+
Josh Merel, Arun Ahuja, Vu Pham, Saran Tunyasuvunakool, Siqi Liu, Dhruva Tirumala, Nicolas Heess, and Greg Wayne. Hierarchical visuomotor control of humanoids. In International Conference on Learning Representations, 2019a.
|
| 200 |
+
|
| 201 |
+
Josh Merel, Matthew Botvinick, and Greg Wayne. Hierarchical motor control in mammals and machines. Nature Communications, 10(1):1–12, 2019b.
|
| 202 |
+
|
| 203 |
+
Josh Merel, Leonard Hasenclever, Alexandre Galashov, Arun Ahuja, Vu Pham, Greg Wayne, Yee Whye Teh, and Nicolas Heess. Neural probabilistic motor primitives for humanoid control. In International Conference on Learning Representations, 2019c.
|
| 204 |
+
|
| 205 |
+
Jonathan A Michaels, Stefan Schaffelhofer, Andres Agudelo-Toro, and Hansjorg Scherberger. A ¨ neural network model of flexible grasp movement generation. bioRxiv, pp. 742189, 2019.
|
| 206 |
+
|
| 207 |
+
Jonathan W Mink. The basal ganglia: focused selection and inhibition of competing motor programs. Progress in neurobiology, 50(4):381–425, 1996.
|
| 208 |
+
|
| 209 |
+
John A Nyakatura, Kamilo Melo, Tomislav Horvat, Kostas Karakasiliotis, Vivian R Allen, Amir Andikfar, Emanuel Andrada, Patrick Arnold, Jonas Laustroer, John R Hutchinson, et al. Reverse-¨ engineering the locomotion of a stem amniote. Nature, 565(7739):351, 2019.
|
| 210 |
+
|
| 211 |
+
Xue Bin Peng, Glen Berseth, and Michiel Van de Panne. Terrain-adaptive locomotion skills using deep reinforcement learning. ACM Transactions on Graphics (TOG), 35(4):81, 2016.
|
| 212 |
+
|
| 213 |
+
Xue Bin Peng, Glen Berseth, KangKang Yin, and Michiel Van De Panne. DeepLoco: Dynamic locomotion skills using hierarchical deep reinforcement learning. ACM Transactions on Graphics (TOG), 36(4):41, 2017.
|
| 214 |
+
|
| 215 |
+
Pavan Ramdya, Robin Thandiackal, Raphael Cherney, Thibault Asselborn, Richard Benton, Auke Jan Ijspeert, and Dario Floreano. Climbing favours the tripod gait over alternative faster insect gaits. Nature communications, 8:14494, 2017.
|
| 216 |
+
|
| 217 |
+
Alfonso Renart and Christian K Machens. Variability in neural activity and behavior. Current opinion in neurobiology, 25:211–220, 2014.
|
| 218 |
+
|
| 219 |
+
Pavel E Rueda-Orozco and David Robbe. The striatum multiplexes contextual and kinematic information to constrain motor habits execution. Nature neuroscience, 18(3):453, 2015.
|
| 220 |
+
|
| 221 |
+
Simon Schmitt, Jonathan J Hudson, Augustin Zidek, Simon Osindero, Carl Doersch, Wojciech M Czarnecki, Joel Z Leibo, Heinrich Kuttler, Andrew Zisserman, Karen Simonyan, et al. Kickstarting deep reinforcement learning. arXiv preprint arXiv:1803.03835, 2018.
|
| 222 |
+
|
| 223 |
+
H Francis Song, Guangyu R Yang, and Xiao-Jing Wang. Reward-based training of recurrent neural networks for cognitive and value-based tasks. Elife, 6:e21492, 2017.
|
| 224 |
+
|
| 225 |
+
H Francis Song, Abbas Abdolmaleki, Jost Tobias Springenberg, Aidan Clark, Hubert Soyer, Jack W Rae, Seb Noury, Arun Ahuja, Siqi Liu, Dhruva Tirumala, et al. V-MPO: On-Policy Maximum a Posteriori Policy Optimization for Discrete and Continuous Control. arXiv preprint arXiv:1909.12238, 2019.
|
| 226 |
+
|
| 227 |
+
Greg J Stephens, Bethany Johnson-Kerner, William Bialek, and William S Ryu. Dimensionality and dynamics in the behavior of c. elegans. PLoS computational biology, 4(4):e1000028, 2008.
|
| 228 |
+
|
| 229 |
+
David Sussillo, Mark M Churchland, Matthew T Kaufman, and Krishna V Shenoy. A neural network that finds a naturalistic solution for the production of muscle activity. Nature neuroscience, 18(7): 1025, 2015.
|
| 230 |
+
|
| 231 |
+
Yuval Tassa, Yotam Doron, Alistair Muldal, Tom Erez, Yazhe Li, Diego de Las Casas, David Budden, Abbas Abdolmaleki, Josh Merel, Andrew Lefrancq, Timothy Lillicrap, and Martin Riedmiller. DeepMind control suite. arXiv preprint arXiv:1801.00690, 2018.
|
| 232 |
+
|
| 233 |
+
Emanuel Todorov, Tom Erez, and Yuval Tassa. MuJoCo: A physics engine for model-based control. In 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 5026–5033. IEEE, 2012.
|
| 234 |
+
|
| 235 |
+
Daniel LK Yamins, Ha Hong, Charles F Cadieu, Ethan A Solomon, Darren Seibert, and James J DiCarlo. Performance-optimized hierarchical models predict neural responses in higher visual cortex. Proceedings of the National Academy of Sciences, 111(23):8619–8624, 2014.
|
| 236 |
+
|
| 237 |
+
Guangyu Robert Yang, Madhura R Joglekar, H Francis Song, William T Newsome, and Xiao-Jing Wang. Task representations in neural networks trained to perform many cognitive tasks. Nature neuroscience, 22(2):297, 2019.
|
| 238 |
+
|
| 239 |
+
Chengxu Zhuang, Jonas Kubilius, Mitra JZ Hartmann, and Daniel L Yamins. Toward goal-driven neural network models for the rodent whisker-trigeminal system. In Advances in Neural Information Processing Systems, pp. 2555–2565, 2017.
|
| 240 |
+
|
| 241 |
+
# A APPENDIX
|
| 242 |
+
|
| 243 |
+
# A.1 RAT MEASUREMENTS
|
| 244 |
+
|
| 245 |
+
To construct the virtual rodent model, we obtained the mass and lengths of the largest body segments that influence the physical properties of the virtual rodent. First, we dissected cadavers of two female Long-Evans rats, and measured the mass of relevant limb segments and organs. Next, we measured the lengths of body segments over the skin of animals anesthetized with $2 \%$ v/v isoflurane anesthesia in oxygen. We confirmed that these skin based measurements approximated bone lengths by measuring bone lengths in a third cadaver. The care and experimental manipulation of all animals were reviewed and approved by the appropriate Institutional Animal Care and Use Committee.
|
| 246 |
+
|
| 247 |
+
Table 1: Before weighing, limb segments were divided at their respective joints. Mass of all segments includes all bones, skin, muscle, fascia and adipose layers. L and R refer to the left and right sides of the animal. Precision of measurements listed without decimal places is $\pm 0 . 5 \mathrm { g }$
|
| 248 |
+
|
| 249 |
+
<table><tr><td colspan="3">Animal (#)</td><td rowspan="2"></td></tr><tr><td></td><td>63</td><td>64</td></tr><tr><td>Body part</td><td></td><td>Mass (g)</td><td>Average mass (g)</td></tr><tr><td>Hindlimb L</td><td>21</td><td>26</td><td>23.5</td></tr><tr><td>Hindlimb R</td><td>21</td><td>26</td><td>23.5</td></tr><tr><td>Tail</td><td>8</td><td>10</td><td>9</td></tr><tr><td>Forelimb R</td><td>11</td><td>14</td><td>12.5</td></tr><tr><td>Forelimb L</td><td>12</td><td>13</td><td>12.5</td></tr><tr><td>Full torso</td><td>176</td><td>187</td><td>181.5</td></tr><tr><td>Head</td><td>26</td><td>26</td><td>26</td></tr><tr><td>Upper torso</td><td>78</td><td>71</td><td>74.5</td></tr><tr><td>Lower torso</td><td>98</td><td>114</td><td>106</td></tr><tr><td>Torso without organs</td><td>54</td><td>58</td><td>56</td></tr><tr><td>Intestines and stomach</td><td>22</td><td>32</td><td>27</td></tr><tr><td>Liver</td><td>26</td><td>17</td><td>21.5</td></tr><tr><td>Pelvis and kidneys</td><td>74</td><td>80</td><td>77</td></tr><tr><td>Jaw</td><td>2.43</td><td>4.70</td><td>3.57</td></tr><tr><td>Skull</td><td>23</td><td>21</td><td>22</td></tr><tr><td>Tail (base to mid)</td><td>5.92</td><td>7.20</td><td>6.56</td></tr><tr><td>Tail (mid to tip)</td><td>1.78</td><td>2.30</td><td>2.04</td></tr><tr><td>Scapula L</td><td>3.19</td><td>4.70</td><td>3.94</td></tr><tr><td>Humerus L</td><td>6.25</td><td>4.70</td><td>5.48</td></tr><tr><td>Radius/ulna L</td><td>2.61</td><td>2.8</td><td>2.70</td></tr><tr><td>Forepaw L</td><td>0.53</td><td>0.5</td><td>0.52</td></tr><tr><td>Scapula R</td><td>2.23</td><td>3.9</td><td>3.07</td></tr><tr><td>Humerus R</td><td>6.08</td><td>6.7</td><td>6.39</td></tr><tr><td>Radius/ulna R</td><td>2.17</td><td>3.3</td><td>2.74</td></tr><tr><td>Forepaw R</td><td>0.53</td><td>0.5</td><td>0.52</td></tr><tr><td>Hindpaw L</td><td>1.66</td><td>1.7</td><td>1.68</td></tr><tr><td>TibiaL</td><td>9</td><td>9</td><td>9</td></tr><tr><td>Femur L</td><td>13</td><td>16</td><td>14.5</td></tr><tr><td>Hindpaw R</td><td>1.81</td><td>1.6</td><td>1.71</td></tr><tr><td>Tibia R</td><td>5</td><td>6</td><td>5.5</td></tr><tr><td>Femur R</td><td>13</td><td>18</td><td>15.5</td></tr><tr><td>Total</td><td>281</td><td>301</td><td>291</td></tr></table>
|
| 250 |
+
|
| 251 |
+
Table 2: Length measurements of limb segments used to construct the virtual rodent model from 7 female Long-Evans rats. Measurements were performed using calipers either over the skin or over dissected bones $( ^ { * } )$ . Thoracic and sacral refer to vertebral segments. L and R refer to the left and right sides of the animal’s body.
|
| 252 |
+
|
| 253 |
+
<table><tr><td colspan="9">Animal (#)</td></tr><tr><td></td><td>48</td><td>62</td><td>55</td><td>56</td><td>64</td><td>63</td><td>62*</td><td>Average± std</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Age (days)</td><td>382 325</td><td>82 273</td><td>330 389</td><td>330 348</td><td>83 283</td><td>83 269</td><td>83 273</td><td>309 ± 47</td></tr><tr><td>Mass (g)</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Body part</td><td colspan="8">Length (mm)</td></tr><tr><td>Ankle to claw L</td><td>40.2</td><td>39.5</td><td>39.7</td><td>37.8</td><td>39.9</td><td>41.5</td><td>39.8</td><td>39.8 ± 1.1</td></tr><tr><td>Ankle to toe L</td><td>38.4</td><td>38.12</td><td>37.7</td><td>35.6</td><td>36.6</td><td>39.3</td><td>38</td><td>37.7 ± 1.2</td></tr><tr><td>Ankle to pad L</td><td>23.4</td><td>22.2</td><td>23</td><td>22.12</td><td>22.5</td><td>23.3</td><td>6.4</td><td>20.4 ± 6.2</td></tr><tr><td>Ankle to claw R</td><td></td><td>38.2</td><td>40.4</td><td>38.3</td><td>39.3</td><td>39.6</td><td>38.3</td><td>39.0 ± 0.9</td></tr><tr><td>Ankle to toe R</td><td></td><td>37</td><td>38.7</td><td>36.3</td><td>37.7</td><td>38.6</td><td>36.2</td><td>37.4 ± 1.1</td></tr><tr><td>Ankle to pad R</td><td></td><td>22.4</td><td>23.3</td><td>21.9</td><td>21.8</td><td>23.1</td><td>24.1</td><td>22.8 ± 0.9</td></tr><tr><td>Tibia L</td><td>50</td><td>36.3</td><td>38.5</td><td>49.2</td><td>35.8</td><td></td><td></td><td></td></tr><tr><td>Femur L</td><td>44.5</td><td>31.6</td><td>32.1</td><td>37.9</td><td>33.4</td><td>38.7</td><td>34.1</td><td>40.4 ± 6.5</td></tr><tr><td>Tibia R</td><td></td><td>36.7</td><td>39.1</td><td>37.9</td><td></td><td>35.35</td><td>32.4</td><td>35.3 ± 4.6</td></tr><tr><td>Femur R</td><td></td><td>32.9</td><td>32.1</td><td>38.7</td><td>35.1</td><td>38.4</td><td>36.18</td><td>37.2 ± 1.5</td></tr><tr><td>Pelvis</td><td>25.8</td><td></td><td>31.7</td><td>30.2</td><td>31.9</td><td>32.1</td><td>32.6</td><td>33.4 ± 2.6</td></tr><tr><td>Wrist to claw L</td><td>15</td><td>32 18.8</td><td>17.6</td><td>18.6</td><td>26.7 16</td><td>27.2 19.02</td><td>19.2</td><td>28.9 ± 2.7</td></tr><tr><td>Wrist to finger L</td><td></td><td>16</td><td>15.8</td><td>17.4</td><td>15.5</td><td>17.07</td><td>17.6</td><td>17.7 ± 1.6 16.6 ± 0.9</td></tr><tr><td>Wrist to pad L</td><td></td><td>6</td><td>6.4</td><td>8.34</td><td>4.9</td><td>6.1</td><td>6.4</td><td>6.4 ± 1.1</td></tr><tr><td>Wrist to olecranon L</td><td>29.1</td><td>34</td><td>32.5</td><td>31.7</td><td>33.9</td><td>32.1</td><td>29.9</td><td>31.9 ± 1.9</td></tr><tr><td>Humerus L</td><td>31.9</td><td>29.52</td><td>31</td><td>28.2</td><td>27</td><td>31.2</td><td>25.4</td><td>29.2 ± 2.4</td></tr><tr><td>Scapula L</td><td>22.7</td><td>24</td><td>26.4</td><td>29.3</td><td>25.9</td><td>29.1</td><td>26.2</td><td>26.2 ± 2.4</td></tr><tr><td>Wrist to claw R</td><td></td><td>16.8</td><td>17</td><td>17.8</td><td>15.9</td><td>16.3</td><td>18.1</td><td>17.0 ± 0.8</td></tr><tr><td>Wrist to finger R</td><td></td><td>14.1</td><td>13</td><td>15.6</td><td>15.6</td><td>15.3</td><td>16.9</td><td>15.1 ± 1.4</td></tr><tr><td>Wrist to pad R</td><td></td><td>5.6</td><td>5.8</td><td>6.55</td><td>5.2</td><td>5</td><td>5.8</td><td>5.7 ± 0.5</td></tr><tr><td>Wrist to olecranon R</td><td></td><td>30.6</td><td>33.5</td><td>31.2</td><td>30.4</td><td>31.8</td><td>29.9</td><td>31.2 ± 1.3</td></tr><tr><td>Humerus R</td><td></td><td>28.2</td><td>33.5</td><td>28.8</td><td>25</td><td>28.2</td><td>25.2</td><td>28.1 ± 3.1</td></tr><tr><td>Scapula R</td><td></td><td>23.8</td><td>29.5</td><td>25.9</td><td></td><td></td><td></td><td></td></tr><tr><td>Headcap width</td><td>39</td><td></td><td></td><td></td><td>26.2</td><td>28.8</td><td>24.4</td><td>26.4± 2.3 39</td></tr><tr><td>Headcap length</td><td>30</td><td></td><td></td><td></td><td></td><td></td><td></td><td>30</td></tr><tr><td>Skull width</td><td>38.8</td><td>23.35</td><td>23</td><td>21.8</td><td>22.8</td><td>23.9</td><td>22.2</td><td>25.1 ± 6.1</td></tr><tr><td>Skull length</td><td>57</td><td>51.1</td><td>61</td><td>56.48</td><td>53.16</td><td>58.13</td><td>48</td><td>55.0 ± 4.5</td></tr><tr><td>Skull height</td><td></td><td></td><td></td><td></td><td>21.59</td><td>21.5</td><td>21</td><td>21.4 ± 0.3</td></tr><tr><td>Head to thoracic</td><td></td><td>48.6</td><td>71.4</td><td>68.68</td><td>65</td><td>60.4</td><td>71.2</td><td>64.2 ± 8.7</td></tr><tr><td>Thoracic to sacral</td><td></td><td></td><td>73.6</td><td>62.9</td><td>65.04</td><td>64.7</td><td>68.8</td><td>68.0 ± 4.6</td></tr><tr><td>Head to sacral</td><td>145</td><td>73.1</td><td>145.5</td><td>127.05</td><td>127.2</td><td>123.7</td><td>140.9</td><td>133.6 ± 9.7</td></tr><tr><td>Head width</td><td>53.4</td><td>126</td><td></td><td></td><td></td><td></td><td></td><td>53.4</td></tr><tr><td>Ear</td><td>18</td><td>17.55</td><td>19.3</td><td>17.9</td><td>19.2</td><td>18.8</td><td></td><td>18.5 ± 0.7</td></tr><tr><td>Eye</td><td>7.2</td><td>8.25</td><td>8.6</td><td>8.8</td><td>8.2</td><td>8.3</td><td></td><td>8.2 ± 0.6</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 254 |
+
|
| 255 |
+
# A.2 BEHAVIORAL ANALYSIS
|
| 256 |
+
|
| 257 |
+
We generated features describing the whole-body pose and kinematics of the virtual rodent on fast, intermediate, and slow temporal scales. To describe the whole-body pose, we took the top 15 principal components of the virtual rodent’s joint angles and joint positions to yield two 15 dimensional sets of eigenpostures (Stephens et al., 2008). We combined these into a 30 dimensional set of postural features. To describe the animal’s whole-body kinematics, we computed the continuous wavelet transform of each eigenposture using a Morlet wavelet spanning 25 scales. For each set of eigenpostures this yielded a 375 dimensional time-frequency representation of the underlying kinematics. We then computed the top 15 principal components of each 375 dimensional time-frequency representation and combined them to yield a 30 dimensional representational description of the animal’s behavioral kinematics. To facilitate comparison of kinematics to neural representations on different timescales, we used three sets of wavelet frequencies on 1 to $2 5 \ \mathrm { H z }$ (intermediate), 0.3 to $5 \ : \mathrm { H z }$ (slow) or $5 { - } 2 5 \ \mathrm { H z }$ (fast) timescales. In separate work, we have found that combining postural and kinematic information improves separation of animal behaviors in behavioral embeddings. Therefore, we combined postural and dynamical features, the later on intermediate timescales, to yield a 60 dimensional set of ‘behavioral features’ that we used to map the animal’s behavior using tSNE (Figure 4C) (Berman et al., 2014). tSNEs were made using the Barnes-Hut approximation with a perplexity of 30.
|
| 258 |
+
|
| 259 |
+

|
| 260 |
+
A.3 POWER SPECTRAL DENSITY OF BEHAVIOR AND NETWORK ACTIVITY
|
| 261 |
+
Figure 9: (A) Power spectral density estimates of four different features describing animal behavior, computed by averaging the spectral density of the top ten principal components of each feature, weighted by the variance they explain. (B) Power spectral density estimates of four different network layers, computed by averaging the spectral density of the top ten principal components of each matrix of activations, weighted by the variance they explain. Notice that policy layers have more power in high frequency bands than core layers. Arrows mark peaks in the power spectra corresponding to locomotion. Notably, the $4 { - } 5 \ \mathrm { H z }$ frequency of galloping in the virtual rat matches that measured in laboratory rats (Heglund & Taylor, 1988). Power spectral density was computed using Welch’s method using a $1 0 \mathrm { { s } }$ window size and $5 \mathrm { ~ s ~ }$ overlap.
|
| 262 |
+
|
| 263 |
+
# A.4 REPRESENTATIONAL SIMILARITY ANALYSIS
|
| 264 |
+
|
| 265 |
+
We used representational similarity analysis to compare population representations across different network layers and to compute the encoding strength of different features describing animal behavior in the population. Representational similarity analysis has in the past been used to compare neural population responses in tasks where behavioral stimuli are discrete, for instance corpuses of objects or faces (Kriegeskorte et al., 2008; Kriegeskorte & Diedrichsen, 2019). A challenge in scaling such approaches to neural analysis in the context of behavior is that behavior unfolds continuously in time. It is thus a priori unclear how to discretize behavior into discrete chunks in which to compare representations.
|
| 266 |
+
|
| 267 |
+
Formally, we defined eight sets of features $\mathit { B _ { i = 1 \dots 8 } }$ describing the behavior of the animal on different timescales. These included features such as joint angles, the angular speed of the joint angles, eigenposture coefficients, and actuator forces that vary on short timescales, as well as behavioral kinematics, which vary on longer timescales and ‘behavioral features’, which consisted of both kinematics and eigenpostures. Each feature set is a matrix $B _ { i } \in \mathbb { R } ^ { M x q _ { i } }$ where $M$ is the number of timepoints in the experiment and $q _ { i }$ is the number of features in the set. We discretized each set $B _ { i }$ using $\mathbf { k }$ -means clustering with $k = 5 0$ to yield a partition of the timepoints in the experiment $P _ { i }$ .
|
| 268 |
+
|
| 269 |
+
Using the discretization defined in $P _ { i }$ , we can perform representational similarity analysis to compare the structure of population responses across neural network layers $L _ { m }$ and $L _ { n }$ or between a given network layer and features of the behavior $B _ { i }$ . Following notation in (Kornblith et al., 2019) we let $X \in \mathbb { R } ^ { k x \cdot p }$ be a matrix of population responses across $p$ neurons and the $k$ behavioral categories in $P _ { i }$ . We let $Y \in \mathbb { R } ^ { k x q }$ be either the matrix of population responses from $q$ neurons in a distinct network layer, or a set of $q$ features describing the behavior of the animal in the feature set $B _ { i }$ .
|
| 270 |
+
|
| 271 |
+
After computing the response matricies in a given behavioral partition, we compared the representational structure of the matricies $X X ^ { T }$ and $\check { Y Y } ^ { T }$ . To do so, we compute the similarity between these matricies using the linear Centered Kernel Alignment index, which is invariant under orthonormal rotations of the population activity. Following (Kornblith et al., 2019), the CKA coeffient is:
|
| 272 |
+
|
| 273 |
+
$$
|
| 274 |
+
C K A ( X X ^ { T } , Y Y ^ { T } ) = \frac { \| X Y ^ { T } \| _ { F } } { \| X X ^ { T } \| _ { F } \| Y Y ^ { T } \| _ { F } }
|
| 275 |
+
$$
|
| 276 |
+
|
| 277 |
+
Where $\| \cdot \| _ { F }$ is the Frobenius norm. For centered $X$ and $Y$ , the numerator is equivalent to the dot-product between the vectorized responses $\| X Y ^ { T } \| _ { F } = \langle \mathrm { v e c } ( X X ^ { T } ) , \mathrm { v e c } ( Y Y ^ { T } ) \rangle$ .
|
| 278 |
+
|
| 279 |
+
For a given network layer $L _ { m }$ , and a behavioral partition $P _ { i }$ , we can denote $X X ^ { T } = D _ { P _ { i } } ^ { L _ { m } } = D _ { i } ^ { m }$ Similarly, for a given feature set $B _ { i }$ , let $D _ { P _ { i } } ^ { B _ { i } } = D _ { i } ^ { i }$ . Thus we are interested in characterizing both
|
| 280 |
+
|
| 281 |
+
$$
|
| 282 |
+
C K A \left( D _ { i } ^ { m } , D _ { i } ^ { n } \right)
|
| 283 |
+
$$
|
| 284 |
+
|
| 285 |
+
and
|
| 286 |
+
|
| 287 |
+
$$
|
| 288 |
+
C K A \left( D _ { i } ^ { m } , D _ { i } ^ { i } \right) .
|
| 289 |
+
$$
|
| 290 |
+
|
| 291 |
+
The former equation describes the similarity across two layers of the network, and the later describes the similarity of the network activity to a set of behavioral descriptors.
|
| 292 |
+
|
| 293 |
+
An additional challenge comes when restricting this analysis to comparing the neural representations of behavioral across different tasks $T _ { a }$ , $T _ { b }$ , where not all behaviors are necessarily used in each task. To make such a comparison, we denote $B _ { i } ( T _ { a } )$ to be the set of behavioral clusters observed in task $T _ { a }$ , and $B _ { i } ^ { T _ { a } T _ { b } } = B _ { i } ( T _ { a } ) \cap B _ { i } ( T _ { a } )$ to be the set of behaviors used in each of the two tasks. We can then define a restricted partition of timepoints for each task $P _ { i } ^ { T _ { a } , T _ { b } }$ or $P _ { i } ^ { T _ { b } , T _ { a } }$ that includes only these behaviors, and compute the representational similarity between the same layer across tasks:
|
| 294 |
+
|
| 295 |
+
$$
|
| 296 |
+
C K A \left( D _ { i , T _ { a } } ^ { m } , D _ { i , T _ { b } } ^ { m } \right) .
|
| 297 |
+
$$
|
| 298 |
+
|
| 299 |
+
We have presented a means of performing representational similarity analysis across continuous time domains, where the natural units of discretization are unclear and likely manifold. While we focused on analyzing responses on the population level, it is likely that different subspaces of the population may encode information about distinct behavioral features at different timescales, which is still an emerging domain in representational similarity analysis techniques.
|
| 300 |
+
|
| 301 |
+

|
| 302 |
+
Figure 10: Average activity in the final policy layer (policy 2) during running cycles across different tasks. In each heatmap, rows correspond to the absolute averaged z-scored activity for individual neurons, while columns denote time relative to the mid stance of the running phase. Across heatmaps, neurons are sorted by the time of peak activity in the tasks denoted on the left, such that each column of heatmaps contains the same average activity information with rearranged rows. Aligned running bouts were acquired by manually segmenting the the principal component space of policy 2 activity to find instances of mid-stance running and analyzing the surrounding $2 0 0 \mathrm { m s }$ .
|
| 303 |
+
|
| 304 |
+
# A.6 STEREOTYPED BEHAVIOR INITIATION AND NEURAL VARIABILITY
|
| 305 |
+
|
| 306 |
+
During the execution of stereotyped behaviors, neural variability was reduced (Figure 11). Recall that in our setting, neurons have no intrinsic noise, but inherit motor noise through observations of the state (i.e. via sensory reafference). This effect loosely resembles, and perhaps informs one line of interpretation of the widely reported phenomenon of neural variability reducing with stimulus or task onset (Churchland et al., 2010). Our reproduction of this effect, which simply emerges from training, suggests that variance modulation may partly arise from moments in a task that benefit from increased behavioral precision (Renart & Machens, 2014).
|
| 307 |
+
|
| 308 |
+

|
| 309 |
+
Figure 11: Quantification of neural variability in inter-tap interval of two-tap task relative to the second tap. (A) Example normalized activity traces of ten randomly selected neurons in the final policy layer. Lines indicate mean normalized activity whiles shaded regions range from the 20th percentile to the 80th percentile. Dashed lines indicate the times of first and second taps. (B) Standard deviation of normalized activity across all neurons in the final policy layer as a function of time relative to the second tap. Lines indicate the mean standard deviation while shaded regions range from the 20th percentile to the 80th percentile. Observe that variability is reduced during the two-tap interval.
|
| 310 |
+
|
| 311 |
+
# A.7 NEURAL DYNAMICS VISUALIZED DURING TASK BEHAVIOR
|
| 312 |
+
|
| 313 |
+
For completeness, we provide links to videos of a few variants of neural dynamics for each task.
|
| 314 |
+
|
| 315 |
+
Table 3: Links to representative visualizations of neural dynamics and behavior
|
| 316 |
+
|
| 317 |
+
<table><tr><td>Network</td><td>Visualization</td><td>Task (link)</td></tr><tr><td>1-layer policy</td><td>PCA</td><td>gaps</td></tr><tr><td></td><td>PCA</td><td>forage</td></tr><tr><td rowspan="6">3-layer policy</td><td>PCA</td><td></td></tr><tr><td></td><td>escape</td></tr><tr><td>PCA</td><td>two-tap</td></tr><tr><td>PCA</td><td>gaps</td></tr><tr><td>PCA</td><td>forage</td></tr><tr><td>PCA</td><td>escape</td></tr><tr><td></td><td>PCA</td><td>two-tap</td></tr><tr><td rowspan="3">3-layer policy</td><td>jPCA</td><td>gaps</td></tr><tr><td>jPCA</td><td>forage</td></tr><tr><td>jPCA</td><td>escape</td></tr><tr><td></td><td> jPCA</td><td>two-tap</td></tr></table>
|
| 318 |
+
|
| 319 |
+

|
| 320 |
+
Figure 12: Causal manipulations reveal distinct roles for core and policy layers in the production of behavior. (A) Two-tap accuracy during the inactivation of units modulated by idiosyncratic behaviors within the two-tap sequence. Core inactivation has a weaker negative effect on trial success than policy inactivation for several levels of inactivation. (B) Representative example of a failed trial during inactivation of the final policy layer in a model that performs a spinning jump during the two-tap sequence. The model is incapable of producing the spinning jump behavior while inactivated. (C) Representative example of a failed trial during core inactivation in a model that performs a spinning jump during the two-tap sequence. The model is still able to perform the spinning jump behavior, but misses the orb. (D) Proportion of attempts at stimulation that successfully elicited spin behavior during the two-tap task. The efficacy of this activation was more reliable in layers closer to the motor output. (E) Representative example of a single trial in which an extra spin occurs after policy 2 activation.
|
md/train/Uj7pF-D-YvT/Uj7pF-D-YvT.md
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Deep Learning on a Data Diet: Finding Important Examples Early in Training
|
| 2 |
+
|
| 3 |
+
Mansheej Paul Stanford University mansheej@stanford.edu
|
| 4 |
+
|
| 5 |
+
Surya Ganguli Stanford University; Facebook AI Research sganguli@stanford.edu
|
| 6 |
+
|
| 7 |
+
Gintare Karolina Dziugaite Mila ⇤ gkdz@google.com
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
Recent success in deep learning has partially been driven by training increasingly overparametrized networks on ever larger datasets. It is therefore natural to ask: how much of the data is superfluous, which examples are important for generalization, and how do we find them? In this work, we make the striking observation that, in standard vision datasets, simple scores averaged over several weight initializations can be used to identify important examples very early in training. We propose two such scores—the Gradient Normed (GraNd) and the Error L2-Norm (EL2N) scores—and demonstrate their efficacy on a range of architectures and datasets by pruning significant fractions of training data without sacrificing test accuracy. In fact, using EL2N scores calculated a few epochs into training, we can prune half of the CIFAR10 training set while slightly improving test accuracy. Furthermore, for a given dataset, EL2N scores from one architecture or hyperparameter configuration generalize to other configurations. Compared to recent work that prunes data by discarding examples that are rarely forgotten over the course of training, our scores use only local information early in training. We also use our scores to detect noisy examples and study training dynamics through the lens of important examples—we investigate how the data distribution shapes the loss surface and identify subspaces of the model’s data representation that are relatively stable over training.
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
Recently, deep learning has made remarkable progress driven, in part, by training overparameterized models on ever larger datasets. This trend creates new challenges: the large computational resources required pose a roadblock to the democratization of AI. Memory and resource constrained settings, such as on-device computing, require smaller models and datasets. Identifying important training data plays a role in online and active learning. Finally, it is of theoretical interest to understand how individual examples and sub-populations of training examples influence learning.
|
| 16 |
+
|
| 17 |
+
To address these challenges, we propose a scoring method that can be used to identify important and difficult examples early in training, and prune the training dataset without large sacrifices in test accuracy. We also investigate how different sub-populations of the training data identified by our score affect the loss surface and training dynamics of the model.
|
| 18 |
+
|
| 19 |
+
Recent work on pruning data [1, 2], can be placed in the broader context of identifying coresets— examples that provably guarantee a small gap in training error on the full dataset [3–7]. However, due to the nonconvex nature of deep learning, coreset techniques make conservative estimates that lead to weak theoretical guarantees and are less effective in practice.
|
| 20 |
+
|
| 21 |
+
A different approach recently proposed by Toneva et al. [8] tracks the number of times through training an example transitions from being correctly classified to misclassified, called a "forgetting event", and find that some examples are rarely forgotten, while others are forgotten repeatedly. Empirically, they observed that training accuracy is not affected by the rarely forgotten training examples and a large fraction of the training data can be removed without any impact on test accuracy. However, since this method relies on collecting forgetting statistics throughout training, the forgetting score is typically calculated in the middle of or at the end of training. Toneva et al. [8] find that, in their example of a ResNet18 trained on CIFAR-10 for 200 epochs, the Spearman rank correlation between early and late scores is good after about 25 epochs and stabilizes after 75 epochs.
|
| 22 |
+
|
| 23 |
+
Broadly speaking, the ability to prune datasets raises a number of questions: What is the nature of examples that can be removed from the training data without hurting accuracy? How early in training can we recognize such examples? How many examples do we need and how does this depend on the data distribution? These questions may have no generic answers and so, in this work, we begin to pursue them empirically in the context of several standard vision benchmarks and standard network architectures. Answers to these questions may both (1) lead to new methodologies that could dramatically reduce training times and memory requirements, and (2) offer important insights into the training dynamics of deep neural networks, and the role of data.
|
| 24 |
+
|
| 25 |
+
Our first finding is that very early in training (just a few epochs), partial forgetting scores identify large fractions of data that can be pruned. Analyzing this puzzling result with a one gradient step analysis of training suggests a very simple heuristic: use the loss gradient norm of individual examples to identify important examples. While this approach does not work when the loss gradient norms are computed at the weights early in training of a single trajectory, we find that, surprisingly, averaging these norms over multiple weight initializations does produce a ranking that correlates strongly with forgetting scores and allows us to prune a significant fraction of examples early in training. Indeed, we can prune $50 \%$ of examples from CIFAR-10 without affecting accuracy, while on the more challenging CIFAR-100 dataset, we can prune $2 5 \%$ of examples with only a $1 \%$ drop in accuracy.
|
| 26 |
+
|
| 27 |
+
Through a series of empirical studies, we have begun to tease apart the properties of important examples and how they can depend on the data distribution. In particular, we find that the examples with the very highest norms become superfluous as the amount of label noise increases. Indeed, even on clean data, we find that in the high pruning regime, the best population excludes the very highest-scoring examples.
|
| 28 |
+
|
| 29 |
+
# 1.1 Contributions
|
| 30 |
+
|
| 31 |
+
• We propose to score the importance of each training example $( x _ { i } , y _ { i } )$ by its expected loss gradient norm (GraNd score), which, up to a constant, bounds the expected change in loss for an arbitrary example $( x , y )$ caused by removing $( x _ { i } , y _ { i } )$ .
|
| 32 |
+
|
| 33 |
+
• We show that pruning training samples with small GraNd scores at initialization allows one to train on much smaller subset of the training data without significant loss in accuracy. While the pruning levels are comparable to those provided by other methods [1, 8], our score is the only one that is well-defined at initialization and early in training.
|
| 34 |
+
|
| 35 |
+
• Our experimental findings suggest that, within the first few epochs of training, the GraNd score is well-approximated by the norm of the error vector (EL2N score), where the error vector is the predicted class probabilities minus one-hot label encoding. In fact, we find that the EL2N score provides an even stronger signal for data-pruning—for CIFAR10 we can prune $50 \%$ of the data, and for the harder CIFAR100, we can prune as much as $2 5 \%$ of the data without any loss in test accuracy.
|
| 36 |
+
|
| 37 |
+
• We study the role of examples with the highest EL2N scores, and find that excluding a small subset of the very highest scoring examples produces a boost in performance. This boost in performance is enhanced in a corrupted label regime.
|
| 38 |
+
|
| 39 |
+
• We introduce a method, based on linearly connected modes, for studying the empirical risk surface in terms of the modes of subsets of data, allowing us to identify when, in training, the final performance on subpopulations is determined. We demonstrate that the linearly connected mode at-convergence of empirical risk surface computed on low EL2N score examples is determined much earlier in training compared to high score examples.
|
| 40 |
+
|
| 41 |
+
• Finally, we study how an example’s EL2N score connects to the network’s training dynamics. We do so by tracking the data-dependent NTK submatrices corresponding to the low or high score examples, and measuring the rate at which it evolves in a scale-invariant way. We find that the NTK submatrix for the high score examples evolves faster throughout training, supporting our hypothesis that high-scoring examples are the ones driving the learning and the changes in the NTK feature space [9].
|
| 42 |
+
|
| 43 |
+
# 2 Which samples are important for learning?
|
| 44 |
+
|
| 45 |
+
# 2.1 Preliminaries
|
| 46 |
+
|
| 47 |
+
We consider supervised classification, where ${ \cal { S } } = \{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { N }$ denotes the training set, drawn i.i.d. from an unknown data distribution $\mathcal { D }$ , with input vectors $x \in \mathbb { R } ^ { d }$ and one-hot vectors $y \in \{ 0 , 1 \} ^ { K }$ encoding labels. For a fixed neural network architecture, let $f _ { \mathbf { w } } ( x ) \in \mathbb { R } ^ { K }$ be the logit outputs of the neural network with weights w $\in \mathcal { W } \subseteq \mathbb { R } ^ { D }$ on input $\boldsymbol { x } ~ \in ~ \mathbb { R } ^ { d }$ . Let $\sigma$ be the softmax function given by $\begin{array} { r } { \sigma ( z _ { 1 } , . . . , z _ { K } ) _ { k } = \exp \{ z _ { k } \} / \sum _ { k ^ { \prime } = 1 } ^ { K } \exp \{ z _ { k ^ { \prime } } \} } \end{array}$ . Let $p ( \mathbf { w } , x ) = \sigma ( f ( \mathbf { w } , x ) )$ denote the neural network output in the form of a probability vector. For any probability vector $\begin{array} { r } { \ell ( \hat { p } , y ) = \sum _ { k = 1 } ^ { K } y ^ { ( k ) } \log \hat { p } ^ { ( k ) } } \end{array}$ denote cross-entropy loss. $\hat { p }$ , let
|
| 48 |
+
|
| 49 |
+
Let $\mathbf { w } _ { 0 } , \mathbf { w } _ { 1 } , \mathbf { w } _ { 2 } , \ldots , \mathbf { w } _ { T }$ be the iterates of stochastic gradient descent (SGD), where, for some sequence of minibatches $S _ { 0 } , S _ { 1 } , \ldots , S _ { T - 1 } \subseteq S$ of size $M$ , we have
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
\begin{array} { r } { \mathbf { w } _ { t } = \mathbf { w } _ { t - 1 } - \eta \sum _ { ( x , y ) \in S _ { t - 1 } } g _ { t - 1 } ( x , y ) , } \end{array}
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
for $g _ { t - 1 } ( x , y ) = \nabla _ { \mathbf { w } _ { t - 1 } } \ell ( p ( \mathbf { w } _ { t - 1 } , x ) , y )$ , and $t = 1 , \dots , T$ .
|
| 56 |
+
|
| 57 |
+
# 2.2 Gradient Norm Score and an infinitesimal analysis
|
| 58 |
+
|
| 59 |
+
Fix a training set $S$ . Due to training with SGD from a random initialization, the weight vector at time $t > 0$ , $\mathbf { w } _ { t }$ , is a random variable. The expected magnitude of the loss vector is our primary focus:
|
| 60 |
+
|
| 61 |
+
Definition 2.1. The GraNd score of a training example $( x , y )$ at time $t$ is $\chi _ { t } ( x , y ) = \mathbb { E } _ { \mathbf { w } _ { t } } \left\| g _ { t } ( x , y ) \right\| _ { 2 }$
|
| 62 |
+
|
| 63 |
+
Here we describe conditions under which the GraNd score controls the contribution of a training example to the change in the training loss. In order to simplify our analysis, we approximate the training dynamics as if they were in continuous time.
|
| 64 |
+
|
| 65 |
+
A key quantity in our analysis is the time derivative of the loss for a generic labeled example $( x , y )$ : $\begin{array} { r } { \Delta _ { t } ( ( x , y ) , S _ { t } ) = - \frac { \mathrm { d } \ell ( f _ { t } ( x ) , y ) } { \mathrm { d } t } } \end{array}$ (where $f _ { t } ( \cdot ) = f _ { \mathbf { w } _ { t } } ( \cdot ) )$ , i.e., the instantaneous rate of change in the loss on $( x , y )$ at time $t$ , where the gradient is computed on the minibatch $S _ { t }$ . By the chain rule,
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\begin{array} { r } { \Delta _ { t } ( ( x , y ) , S _ { t } ) = g _ { t } ( x , y ) \frac { \mathrm { d } { \mathbf w } _ { t } } { \mathrm { d } t } . } \end{array}
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
This relates to our discrete time dynamics via $\begin{array} { r } { \frac { \mathrm { d } \mathbf { w } _ { t } } { \mathrm { d } t } \approx \mathbf { w } _ { t + 1 } - \mathbf { w } _ { t } = - \eta \sum _ { ( x ^ { \prime } , y ^ { \prime } ) \in S _ { t } } g _ { t } ( x ^ { \prime } , y ^ { \prime } ) } \end{array}$
|
| 72 |
+
|
| 73 |
+
Our goal is to understand how removing a training point from minibatch $S _ { t }$ affects $\Delta _ { t } ( ( x ^ { * } , y ^ { * } ) , S _ { t } )$ for any $( x ^ { * } , y ^ { * } )$ . If a training point $( x , y )$ is not in the minibatch $S _ { t }$ , then the effect is trivial. We thus study $\Delta _ { t } ( ( x ^ { * } , y ^ { * } ) , S )$ in order to be able to rank all the training examples.
|
| 74 |
+
|
| 75 |
+
Lemma 2.2. Let $S _ { \neg j } = S \setminus ( x _ { j } , y _ { j } )$ . Then for all $( x ^ { * } , y ^ { * } )$ , there exists c such that
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\begin{array} { r } { \| \Delta _ { t } ( ( x ^ { * } , y ^ { * } ) , S ) - \Delta _ { t } ( ( x ^ { * } , y ^ { * } ) , S _ { - j } ) \| \leq c \| g _ { t } ( x _ { j } , y _ { j } ) \| . } \end{array}
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
Proof. For a given example $( x ^ { * } , y ^ { * } )$ , the chain rule yields $\begin{array} { r l } { \Delta _ { t } ( ( x ^ { * } , y ^ { * } ) , S ) } & { { } = } \end{array}$ $\begin{array} { r l r } { - \frac { \mathrm { d } \ell \left( f _ { t } ( x ^ { * } ) , y ^ { * } \right) } { \mathrm { d } t } } & { { } = } & { \frac { \mathrm { d } \ell ( f _ { t } ( x ^ { * } ) , \bar { y } ^ { * } ) } { \mathrm { d } \mathbf { w } _ { t } } \frac { \mathrm { d } \mathbf { w } _ { t } } { \mathrm { d } t } } \end{array}$ d\`(ft(x⇤),y⇤) dwt nce the weights ar GD, we have . Sitting e updated using S, the result follows. $\begin{array} { r } { \frac { \mathrm { d } \mathbf { w } _ { t } } { \mathrm { d } t } = - \eta \sum _ { ( x _ { j } , y _ { j } ) \in S _ { t } } g _ { t } ( x _ { j } , y _ { j } ) } \end{array}$ $\begin{array} { r } { c = \eta \Vert \frac { \mathrm { d } \ell ( f _ { t } ( x ^ { * } ) , y ^ { * } ) } { \mathrm { d } \mathbf { w } _ { t } } \Vert } \end{array}$ □
|
| 82 |
+
|
| 83 |
+
At any given training step, given the current location $\mathbf { w } _ { t }$ , the contribution of a training example $( x , y ) ^ { \bar { 2 } }$ to the decrease of loss on any other example, is bounded by Eq. (3). Since the constant $c$ does not depend on the training example $( x , y ) ^ { 3 }$ , we only consider the gradient norm term, $\| g _ { t } ( x , y ) \|$ . The expected value of this gradient norm is exactly the GraNd score of $( x , y )$ . In other words, examples with a small GraNd score in expectation have a bounded influence on learning how to classify the rest of the training data at a given training time4. We therefore propose to rank training examples by their GraNd scores, larger norm meaning more important for preserving $\Delta _ { t } ( x )$ .
|
| 84 |
+
|
| 85 |
+
For an arbitrary input $x \in \mathbb { R } ^ { d }$ , let $\psi _ { t } ^ { ( k ) } ( x ) = \nabla _ { \mathbf { w } _ { t } } f _ { t } ^ { ( k ) } ( x )$ denote the $k$ th logit gradient. Then GraNd can be written as5
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\begin{array} { r } { \chi _ { t } ( x , y ) = \mathbb { E } \left. \sum _ { k = 1 } ^ { K } \nabla _ { f ^ { ( k ) } } \ell ( f _ { t } ( x ) , y ) ^ { T } \psi _ { t } ^ { ( k ) } ( x ) \right. _ { 2 } . } \end{array}
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
Under the cross entropy loss, $\nabla _ { f ^ { ( k ) } } \ell ( f _ { t } ( x ) , y ) ^ { T } = p ( \mathbf { w } _ { t } , x ) ^ { ( k ) } - y _ { k }$ . When $\{ \psi _ { t } ^ { ( k ) } ( x ) \} _ { k }$ are roughly orthogonal across logits, and are of a similar size across logits and training examples $x$ , then we can approximate GraNd by just the norm of the error vector.
|
| 92 |
+
|
| 93 |
+
Definition 2.3. The EL2N score of a training sample $( x , y )$ is defined to be $\mathbb { E } \| p ( \mathbf { w } _ { t } , x ) - y \| _ { 2 }$ .
|
| 94 |
+
|
| 95 |
+
Our experimental results suggest that this approximation becomes accurate after a few epochs of training (see Section 3). These approximations are also in agreement with the empirical results reported in [9, 10]. Fort and Ganguli [10, Sec. 5.1] demonstrate that the mean logit gradients are nearly orthogonal among classes throughout training. The authors demonstrate that per-example gradients cluster around the mean logit gradient. Fort et al. [9, Figs. 12D-14D] provide evidence that the mean logit gradient directions evolve rapidly early in training and then stabilize (as measured by the cosine distance between mean logit gradient vectors at different times in training).
|
| 96 |
+
|
| 97 |
+
# 2.3 Comparison to forgetting scores
|
| 98 |
+
|
| 99 |
+
Toneva et al. [8] define a “forgetting event” for a training sample to be a point in training when the classifier switches from making a correct classification decision to an incorrect one. They define an approximate forgetting score for each training example as the number of times during training when it was included in a minibatch and underwent a forgetting event. Toneva et al. demonstrate that examples with low forgetting score may be completely omitted during training without any noticeable effect on the accuracy of the learned predictor. In Fig. 1 and Appendix E.5, we make an empirical comparison of forgetting scores to our proposed GraNd and EL2N scores.
|
| 100 |
+
|
| 101 |
+
In Lemma 2.2, we bounded the contribution of a training example to the decrease of the loss of any other sample over a single gradient step. Due to $\psi _ { t } ( \cdot )$ ’s being time-dependent, it is complicated to extend the analysis to multiple steps. However, it is interesting to consider a case when $\psi _ { t } ( x _ { i } ) =$ $\psi ( x _ { i } )$ for all $x _ { i }$ in the training set, and $K = 1$ . Then summing the bound in Eq. (3) on how much a sample $( x _ { j } , y _ { j } )$ affects the logit output on an arbitrary point at each time $t \in \{ 1 , . . , T \}$ , we obtain a score that depends on $\| \psi ( x _ { j } ) \| | \sum _ { t } ( p _ { t } ( x _ { j } ) - y _ { j } ) |$ . For two examples, $( x , y )$ and $( x ^ { \prime } , y ^ { \prime } )$ , such that $\| \psi ( x ^ { \prime } ) \| \approx \| \psi ( x ) \|$ , we see that the example that is learned faster and maintains small error over training time will have a smaller GraNd score on average throughout training. Note that $| ( p _ { t } ( x _ { j } ) - y _ { j } ) |$ , if rescaled, is an upper bound on 0–1 loss, and therefore $\begin{array} { r } { \sum _ { t } | ( p _ { t } ( x _ { j } ) - y _ { j } ) | } \end{array}$ upper bounds the number of forgetting events during training (after rescaling). In this simplified setting an example with a high number of forgetting events will also have a high GraNd score.
|
| 102 |
+
|
| 103 |
+
# 3 Empirical Evaluation of GraNd and EL2N Scores via Data Pruning
|
| 104 |
+
|
| 105 |
+
In the previous section, we motivated GraNd and EL2N scores by quantifying the influence of a training example on the loss of an arbitrary example after one optimization step. In this section, we evaluate these scores empirically, and verify that they identify examples important for generalization. Networks trained on subsets of the data with high scores achieve levels of test accuracy comparable to training on the full dataset and are competitive with other state of the art data pruning methods. Perhaps most remarkably, these scores are effective even when computed early in training and perform significantly better than a random baseline, even at initialization.
|
| 106 |
+
|
| 107 |
+

|
| 108 |
+
Figure 1: Columns correspond to three different dataset and network combinations (labeled at the top). Each legend applies to all 3 figures in its row. First row: Final test accuracy achieved by training on a subset of training data comprised of examples with maximum forgetting, EL2N and GraNd scores computed at different times early in training. Subsets of a fixed size are used: networks are trained on $50 \%$ of training data for CIFAR-10, $60 \%$ for CINIC-10 and $7 5 \%$ for CIFAR-100. Second row: Final test accuracy achieved by training after different fractions of the dataset are pruned. Here we compare forgetting scores at the end of training, EL2N scores early in training (at epoch 20) and GraNd scores at initialization. In each case, examples with the lowest scores are pruned at initialization. In all experiments accuracies achieved by training on the full dataset and on a random subset of the corresponding size are used as baselines.
|
| 109 |
+
|
| 110 |
+
Data pruning experiments. We train convolutional neural networks of varying depth–ResNet18 and ResNet50 [11]–on standard vision datasets of varying difficulty–CIFAR-10, CIFAR-100 [12], and CINIC-10 [13]. All scores are calculated by averaging the scores from ten independent training runs. After calculating scores and selecting a training subset, final test accuracies are obtained by retraining networks from new random initializations on only the selected subset. Networks used for evaluating the scores are initialized with seeds that are different from those used to calculate the scores. For each experiment, we report the mean of four independent runs and represent variability across runs by shading the region which spans the 16th to 84th percentile of obtained accuracies. See Appendix B for more implementation details and Appendix E for additional experiments.
|
| 111 |
+
|
| 112 |
+
In Fig. 1, we show the results of two sets of experiments (top and bottom) on three different network and dataset combinations. The first experiment asks, how early in training are forgetting, GraNd and EL2N scores effective at identifying examples important for generalization? We compare the final test accuracy from training on subsets of fixed size but pruned based on scores computed at different times early in training. The second experiment compares how GraNd scores at initialization, EL2N scores early in training and forgetting scores at the end of training negotiate the trade-off between generalization performance and training set size. The training sets are constructed by pruning different fractions of the lowest score examples. In all examples, training on the full dataset and a random subset of the corresponding size are used as baselines. We make the following observations.
|
| 113 |
+
|
| 114 |
+
Pruning at initialization. In all settings, GraNd scores can be used to select a training subset at initialization that achieves test accuracy significantly better than random, and in some cases, competitive with training on all the data. This is remarkable because GraNd only contains information about the gradient norm at initializion, averaged over initializations. This suggests that the geometry of the training distribution induced by a random network contains a surprising amount of information about the structure of the classification problem. EL2N scores, which only contain information about errors, are not consistently effective at initialization and forgetting scores, which require counting forgetting events over training, are not defined at initialization.
|
| 115 |
+
|
| 116 |
+
Pruning early in training. We find that, after only a few epochs of training, EL2N scores are extremely effective at identifying important examples for generalization. For a wide range of intermediate pruning levels, training on the highest scores performs on par with or better than training on the full dataset. Even at higher pruning levels, EL2N scores computed using local information early in training are competitive with forgetting scores which integrate information over the training trajectory. This suggests that the average error vector a few epochs into training can identify examples that the network heavily uses to shape the decision boundary throughout training.
|
| 117 |
+
|
| 118 |
+
Interestingly, at extreme levels of pruning with either EL2N or GraNd scores, we observe a sharp drop in performance. We hypothesize that this is because at high levels of pruning, using either GraNd or EL2N scores leads to bad coverage of the data distribution. By only focusing on the highest error examples, it is likely that an entire subpopulation of significant size that is present in the test data is now excluded from the training set. We only fit a small number of very difficult examples and do not keep enough of a variety of examples for training models with good test error.
|
| 119 |
+
|
| 120 |
+
A property of the data. Our results suggest that the ranking of important examples induced by EL2N scores is a property of the dataset and not specific to a network. First, in Appendix E.2, we show that a ResNet18 and a ResNet50 trained on CIFAR-10 have similar performance curves and the same amount of data can be pruned, even though ResNet50 is a much deeper network with more parameters. Second, EL2N scores calculated on one set of network architecture and hyperparameter configurations can be used to prune data for training with a different network architecture or hyperparameter configuration. The set of important examples generalizes across architectures and hyperparameters. See Appendix E.3 for the experiment on generalization across architectures and Appendix E.4 for the experiment on using scores calculated during hyperparameter optimization. Additionally, in an analysis of the sensitivity of the scoring methods to hyperparameters in Appendix E.1, we observe that scores calculated on a single network do not perform as well as those averaged across networks.
|
| 121 |
+
|
| 122 |
+
We hypothesize that averaging the gradient or error norms over multiple initializations or training trajectories removes dependence on specific weights, allowing a more accurate distillation of the properties of the dataset. EL2N scores can thus be used to probe and understand how the distribution of the training data impacts dynamics (as we show in the next sections). Additionally, it can also reduce the computational burden of training neural networks; once we compute the scores, future networks can be trained on the pruned dataset.
|
| 123 |
+
|
| 124 |
+
In the following experiments, we focus on EL2N scores computed early in training, as they appear to more accurately identify important examples.
|
| 125 |
+
|
| 126 |
+
# 4 Identifying noise examples
|
| 127 |
+
|
| 128 |
+
In the previous section, we studied the effect of keeping the highest-scoring examples, and found that we could train on only the top $50 \%$ of examples by score without a drop in accuracy (CIFAR-10). What is the nature of subpopulations of examples that allow us to reach high accuracy? One hypothesis is that the highest-scoring examples are the most important ones for achieving an accurate classifier. In this section, we refute this hypothesis, and demonstrate the role of label noise.
|
| 129 |
+
|
| 130 |
+

|
| 131 |
+
Figure 2: ResNet18 trained on a $40 \%$ subset of CIFAR-10 with clean (left) and $10 \%$ randomized labels (right). The training subset contains the lowest scoring examples after examples with scores below the offset are discarded. Scores computed at epoch 10.
|
| 132 |
+
|
| 133 |
+
To test whether the highest-scoring examples are most important for achieving high accuracy, we first sort the examples by increasing EL2N score computed after a small number of training epochs.6 Then we perform a sliding window analysis by training on a subset of examples with scores within a window from percentile $f$ to percentile $f + P$ percentile, always keep $P \%$ of the data but sliding up $f$ . As this window slides to higher percentiles, performance increases, except when the window includes examples with the very highest scores Fig. 2 (left). Indeed the the optimal sliding window actually excludes approximately 500 of the highest-scoring training examples. These effects are reduced in the low pruning regime (see Appendix F.1). In Appendix C, we visualize some of the images that are excluded from each class.
|
| 134 |
+
|
| 135 |
+
Before we analyze these results, we first place them into a wider context, where we also change the amount of noise in the underlying label distribution. We repeat the experiment outlined above, but corrupt a random $K \%$ of labels, replacing them with a random label, mirroring the protocol popularized by Zhang et al. [14]. Fig. 2 reveals that with increased label corruption, the optimal window shifts and excludes a higher number of examples. Therefore, the effect we see in the noiseless case appears to be magnified in the presence of label noise. Appendix F.2 examines how adding label noise influences the distribution of EL2N scores of examples.
|
| 136 |
+
|
| 137 |
+
These findings have several implications. The most obvious implication is that training with only the highest-scoring samples may not be optimal, especially when there is label noise. When the population has a low Bayes error rate, using only the highest scoring samples yields optimal results. However, without a validation set, one should be cautious in excluding high-score examples. Feldman [15] discusses memorization in a noisy-label setup and gives conditions under which one should memorize in order to not misclassify singleton examples ( examples in the training data that are the sole representatives of a subpopulation). For example, if the subpopulation appears with a frequency $\Omega ( 1 \bar { / } N )$ , memorizing such examples can improve generalization. In practice, we may not know whether our data fits these conditions. However, our analysis in Fig. 2 suggests a simple and powerful method to prune data for optimal performance by optimizing just two hyperparameters of a sliding window using a validation set.
|
| 138 |
+
|
| 139 |
+
# 5 Optimization landscape and the training dynamics
|
| 140 |
+
|
| 141 |
+
# 5.1 Evolution of the data-dependent NTK
|
| 142 |
+
|
| 143 |
+
The dynamics of neural-network training in the infinite-width limit are now well understood [16, 17]: for an appropriate scaling of the learning rate and initial weights, the neural network behaves like a linear model in which the data is transformed by the Neural Tangent Kernel (NTK) at initialization, which is defined as the product of the Jacobians of the logits at initialization. In the limit, neural network training implements kernel regression with the fixed NTK as the kernel.
|
| 144 |
+
|
| 145 |
+
However, finite neural networks outperform their infinitewidth limits [18] and have different dynamics early in training [19]. In fact, rather than being constant, the datadependent NTK, defined by Fort et al. [9] as the Gram matrix of the logit Jacobian, evolves with high velocity in the initial phase of training. Then, around the time of onset of linear mode connectivity, the NTK velocity stabilizes at a smaller value and remains nearly constant for the rest of the high learning rate training time.
|
| 146 |
+
|
| 147 |
+

|
| 148 |
+
Figure 3: Kernel velocity for different subsets of images when ResNet18 is trained on CIFAR-10 with all true labels (left) and $10 \%$ label noise (right). Examples are sorted in ascending order by EL2N scores and each point corresponds to the kernel velocity of 100 contiguous images starting at example index. Both scores and velocities are computed at the same epoch indicated by color.
|
| 149 |
+
|
| 150 |
+
Here we seek to understand which training samples contribute to the NTK gram matrix evolution. To empirically approximate the velocity of a NTK submatrix corresponding to a subset of images in a scale invariant way, we follow [9]. We compute the cosine distance between two NTK gram matrices on the given subset, one computed at epoch $t$ , and another one at epoch $t { + } 1$ , one epoch later (see Appendix B.3). We look at submatrices of a fixed size, formed by examples with contiguous EL2N scores. Fig. 3 shows that higher EL2N scores lead to higher velocities. This relationship is not affected by the time at which both are computed.
|
| 151 |
+
|
| 152 |
+
Interestingly, the kernel velocity drops off sharply for examples with the very highest scores when label noise is introduced. In Section 4, we showed that dropping these examples boosts the accuracy of the final predictor. We hypothesize that, while the kernel velocity is higher for harder examples that the model is actively trying to fit, the kernel velocity drops off for the very highest scoring examples that might be too difficult to learn, perhaps because they are unrepresentative samples or they have have label noise.
|
| 153 |
+
|
| 154 |
+
# 5.2 Connections to the Linear Mode Connectivity
|
| 155 |
+
|
| 156 |
+
We now examine how the ranking of the examples by EL2N connects to the geometry of the loss surface. In particular, Frankle et al. [20] studied the effect of minibatch randomness on the training trajectory, focusing on identifying the point in training when two networks, starting from the same weights, but trained with independent minibatches, converge to the same “linearly connected” mode. They find that, for standard vision datasets, the onset of this “linear mode connectivity” (LMC) happens early in training.
|
| 157 |
+
|
| 158 |
+
More precisely, let $w _ { 1 } , w _ { 2 } , \dots , w _ { T }$ be the training trajectory of a parent network, fix a spawning time $t ^ { * }$ , and let $v _ { t ^ { * } }$ , $v _ { t ^ { * } + 1 }$ , $v _ { t ^ { * } + 2 } , \ldots , v _ { T }$ be an independent training trajectory (i.e., with independent minibatches), beginning at $v _ { t ^ { * } } = w _ { t ^ { * } }$ . We call $v _ { T }$ the child network and $v _ { t ^ { * } } , v _ { t ^ { * } + 1 } , \ldots .$ the child trajectory. The (training) error barrier between two weights $w$ and $w ^ { \prime }$ , denoted $\mathrm { e r r } ( w , w ^ { \prime } ; S )$ , is the maximum deviation of the training error surface ${ \hat { R } } _ { S } ( \cdot )$ above the line connecting the empirical risk at $w$ and $w ^ { \prime }$ . That is,
|
| 159 |
+
|
| 160 |
+
$$
|
| 161 |
+
\begin{array} { r } { \mathrm { e r r } ( w , w ^ { \prime } ; S ) = \operatorname* { s u p } _ { \alpha \in [ 0 , 1 ] } \left\{ \hat { R } _ { S } ( \alpha w + ( 1 - \alpha ) w ^ { \prime } ) - \alpha \hat { R } _ { S } ( w ) - ( 1 - \alpha ) \hat { R } _ { S } ( w ^ { \prime } ) \right\} . } \end{array}
|
| 162 |
+
$$
|
| 163 |
+
|
| 164 |
+
We then define the mean (training) error barrier, spawning at $t ^ { * }$ , at time $t$ , for $t ^ { * } \leq t \leq T$ , denoted $\mathrm { e r r } _ { t } ^ { t ^ { * } } ( S )$ , to be the expected error barrier between $w _ { t }$ and $v _ { t }$ on the data $S$ . That is,
|
| 165 |
+
|
| 166 |
+
$$
|
| 167 |
+
\mathrm { e r r } _ { t } ^ { t ^ { * } } ( S ) = \mathbb { E } _ { w _ { t ^ { * } + 1 : t } , v _ { t ^ { * } + 1 , t } } [ \mathrm { e r r } ( w _ { t } , v _ { t } ; S ) ] ,
|
| 168 |
+
$$
|
| 169 |
+
|
| 170 |
+
where the expectation is taken over the randomness in the trajectories of $w$ and $v$ after $t ^ { * }$ due to the choice of minibatches, conditional on the initial trajectories up through time $t ^ { * }$ . (Note that, at the end of training $t = T$ , the supremum in $\mathrm { e r r } ( w _ { T } , v _ { T } ; S )$ is often achieved near $\alpha = 1 / 2$ , and so this is a cheap approximation used in practice.) The “onset” of linear mode connectivity is the earliest spawning time $t ^ { * }$ at which point $\mathrm { e r r } _ { T } ^ { t ^ { * } } ( S ) \approx 0$ , where $S$ is the whole training set. In our work, we instead compute the error barrier on subsets of the training set, which allows us to compare the training dynamics and modes on subpopulations.
|
| 171 |
+
|
| 172 |
+
In Fig. 4, we measure the mean error barrier $\mathrm { e r r } _ { t } ^ { t ^ { * } } ( S ^ { \prime } )$ as a function of the spawning time $t ^ { * }$ , in the cases where $S ^ { \prime }$ are either 1) the training examples with the smallest scores, 2) the largest scores, or 3) a random subset of training examples. We find that the error barrier falls close to zero very rapidly for examples that have low EL2N scores, and stays high for high score examples. These findings suggest that the loss landscape derived from restricted subsets of examples with low and high EL2N behave very differently. The loss landscape derived from easy subsets of examples with low scores is quite flat, in the sense that error barriers between children as a function of spawn time rapidly diminish. On the other hand, the loss landscape derived from harder subsets of examples with higher scores is rougher, with higher error barriers that persist for longer in the spawn time. Further, this result is in agreement with the results presented in Section 5.1, showing that most of the learning happens in the high EL2N score examples.
|
| 173 |
+
|
| 174 |
+
# 6 Related Work
|
| 175 |
+
|
| 176 |
+
As discussed earlier, our work is closely related to an empirical study by Toneva et al. [8], which examines the frequency with which correct classification decisions are forgotten during training.
|
| 177 |
+
|
| 178 |
+

|
| 179 |
+
Figure 4: The final training error barrier between children on subsets of a 1000 highest (green) and lowest (orange) EL2N score examples, and randomly selected training subset (blue) as a function of the spawning time. Left to right: different dataset and network combinations.
|
| 180 |
+
|
| 181 |
+
The authors observe that examples that are rarely forgotten are also ones that do not contribute much to the final accuracy of the predictor. In particular, if we retrain from initialization after having removed rarely forgotten examples from the training data, we achieve the same accuracy. Similar to our work, this work analyzes the dynamics of training in deep learning through the lens of training examples. However, unlike forgetting scores, our proposed methods use only local information early in training. This highlights two properties: example importance is reflected in the local properties of the loss landscape after a few epochs and the ordering of examples by importance is roughly preserved throughout training. We think that this is a key contribution and hope it prompts future empirical and theoretical work exploring the early stage of learning.
|
| 182 |
+
|
| 183 |
+
Coleman et al. [1] use a small proxy network in combination with other training data selection methods to find a small subset of important-for-training examples, that can then be used to train a large state-of-the-art (SOTA) deep neural network. In their empirical study, they observe that most important examples selected via a proxy model are also important for training a SOTA network. In addition, they study a proxy which reuses SOTA network’s architecture but is trained for a shorter time. The authors observe that selecting the important examples after at least 50 epochs of training works better than selecting them at random, but not as well as after the full training run. They do not study shorter training times for proxies or relate it to the training dynamics in any other way.
|
| 184 |
+
|
| 185 |
+
Another line of related work is on coresets (see, e.g., [4, 5, 7, 21–23], and many others). The term coresets generally refers to a possibly weighted subset of training data. Much of the work on coresets is focused on identifying small training data subsets that provably yield an $\epsilon$ -approximate solution to the original objective (on all the training data). Most guarantees require the problem to have special structure, such as convexity. For nonconvex problems, like training deep neural networks, guarantees are provided for very conservative proxies, e.g., based on Lipschitz constants or smoothness. While coreset selection comes with nice theoretical guarantees, in our opinion, the utility of these methods is best considered an empirical question.
|
| 186 |
+
|
| 187 |
+
Coresets have also been studied in the active learning community. Here, the goal is to select a small set of examples to label at any given iteration of training (see, e.g., [24–28], and references therein). Coreset selection has also been proposed as a way to increase model robustness [29].
|
| 188 |
+
|
| 189 |
+
Pleiss et al. use a similar method, the Area Under the Margin (AUM) statistic, but with a slightly different goal: identifying noisy and mislabeled examples. Their proposed method exploits differences in the training dynamics of clean and mislabeled samples by keeping track of statistics through the course of training. The AUM statistic is similar to forgetting scores in that it uses information from the whole training run. In contrast, we focus on instantaneous information in the early phase of training. In addition to identifying noisy examples, we aim to rank points by importance and therefore also identify redundant/easy examples. Thus our approach is complimentary to the AUM statistic and can be used together to obtain higher levels of pruning on noisy datasets.
|
| 190 |
+
|
| 191 |
+
There have been a number of recent studies looking at the problem of estimating example difficulty. One such approach for identifying difficult examples within a given class is the Variance of Gradients (VoG) score proposed by Agarwal, D’souza, and Hooker [31]. For each image, they calculate the gradient of the activations with respect to the pixels at $K$ different checkpoints over training. The VoG score is the average (over pixels) of the per-pixel variance across these $K$ checkpoints. The authors conclude that the images that appear more difficult also have a higher VoG score. Understanding the connections between these two scores calculated in entirely different spaces is an interesting direction for future work.
|
| 192 |
+
|
| 193 |
+
Another quite different approach estimates example difficulty using prediction depth [32], which is defined as the first layer at which a $\mathbf { k }$ -Nearest Neighbor classifier can correctly classify an example using the representation of the image in all subsequent layers. In additional to methodological differences, this method uses the final trained network. To our knowledge, we are the first to highlight the existence of a strong signal for estimating example difficulty early in training.
|
| 194 |
+
|
| 195 |
+
Informally, removing a training example from the training data and not hurting the generalization error suggests that the example has small “influence” on the test data. Influence of the training examples on test examples is studied in sample-based explainability [33–35]. On the theory side, Feldman [15] recently proposed to model data as a mixture of populations and study the role of memorization when the data distribution is long-tailed. Feldman demonstrates conditions under which memorization is necessary for good generalization. In doing so, he proposes a definition of example memorization and influence, which can be interpreted as a leave-one-out notion of stability. In an empirical study following this work, Feldman and Zhang [36] demonstrate that classifiers trained on computer vision benchmarks benefit from memorization. In particular, training without high-memorization-value examples comes at a cost of accuracy of the learned neural network classifier. In Appendix G, we compare GraNd, EL2N, forgetting scores, and memorization values on CIFAR-100-trained Resnet50 networks; memorization values do not correlate with the other scores.
|
| 196 |
+
|
| 197 |
+
# 7 Discussion
|
| 198 |
+
|
| 199 |
+
In summary, our work both (1) introduces methods to significantly prune data without sacrificing test accuracy using only local information very early in training (Fig. 1), sometimes even at initialization, and (2) uses the resulting methods to obtain new scientific insights into how different subsets of training examples drive the dynamics of deep learning. We start from a principled approach by asking how much on average each training example influences the loss reduction of other examples, and from that starting point, we obtain 2 scores, namely gradient norm (GraNd) and error norm (EL2N) that bound or approximate this influence, with higher scores indicating higher potential influence. We find that examples with higher scores tend to be harder to learn, in the sense that they are forgotten more often over the entire course of training. We also find that the very highest scoring examples tend to be either unrepresentative outliers of a class, have non standard backgrounds or odd angles, are subject to label noise, or are otherwise difficult. This observation yields a simple and powerful sliding window method (Fig. 2) to prune data by keeping examples within a range of scores, where the start and the end of the range constitute just 2 hyperparmeters that can be tuned via a validation set. This tuning can be done using different hyperparameter settings or on a different network saving computation time (Appendix E.3). Furthermore, we find that high-scoring examples primarily drive feature learning by maximally supporting the velocity of the NTK, whereas learning dynamics might actually give up on the very highest scoring examples that may correspond to unrepresentative examples or noise (Fig. 3). Finally we show that higher (lower) scoring subsets of examples contribute to a rougher (smoother) loss landscape (Fig. 4). Overall this decomposition of both loss landscape geometry and learning dynamics into differential contributions from different types of examples constitutes an exciting new methodology for analyzing deep learning. A deeper understanding of the differential role played by different subsets of examples could aid not only in data pruning, but also in curriculum design, active learning, federated learning with privacy, and analysis of fairness and bias. Our empirical findings raise a number of interesting theoretical questions, some of which we discuss in Appendix D.
|
| 200 |
+
|
| 201 |
+
# Acknowledgements
|
| 202 |
+
|
| 203 |
+
The authors would like to thank Blair Bilodeau, Alex Drouin, Étienne Marcotte, and Daniel M. Roy for feedback on drafts, the Toolkit team at ServiceNow for providing the tools and computation resources that greatly accelerated our empirical work, and the NeurIPS reviewers for their thorough engagement and invaluable feedback on label-dependence and practical applications. S.G. thanks the Simons Foundation, NTT Research and an NSF Career award for funding while at Stanford.
|
| 204 |
+
|
| 205 |
+
# References
|
| 206 |
+
|
| 207 |
+
Zaharia. Selection via proxy: Efficient data selection for deep learning. 2019. arXiv: 1906. 11829.
|
| 208 |
+
[2] M. Hwang, Y. Jeong, and W. Sung. “Data distribution search to select core-set for machine learning”. In: Proc. 9th Int. Conf. Smart Media & Appl. (SMA 2020), Jeju, Korea. 2020, pp. 17–19.
|
| 209 |
+
[3] S. Har-Peled and A. Kushal. “Smaller coresets for $\mathbf { k }$ -median and $\mathbf { k }$ -means clustering”. Discrete & Computational Geometry 37.1 (2007), pp. 3–19.
|
| 210 |
+
[4] J. H. Huggins, T. Campbell, and T. Broderick. “Coresets for scalable bayesian logistic regression” (2016). arXiv: 1605.06423.
|
| 211 |
+
[5] T. Campbell and T. Broderick. “Bayesian coreset construction via greedy iterative geodesic ascent”. In: Int. Conf. Machine Learning. PMLR. 2018, pp. 698–706.
|
| 212 |
+
[6] I. W. Tsang, J. T. Kwok, P.-M. Cheung, and N. Cristianini. “Core vector machines: Fast SVM training on very large data sets.” Journal of Machine Learning Research 6.4 (2005).
|
| 213 |
+
[7] A. Munteanu, C. Schwiegelshohn, C. Sohler, and D. P. Woodruff. On coresets for logistic regression. 2018. arXiv: 1805.08571.
|
| 214 |
+
[8] M. Toneva, A. Sordoni, R. T. d. Combes, A. Trischler, Y. Bengio, and G. J. Gordon. An empirical study of example forgetting during deep neural network learning. 2018. arXiv: 1812.05159.
|
| 215 |
+
[9] S. Fort, G. K. Dziugaite, M. Paul, S. Kharaghani, D. M. Roy, and S. Ganguli. “Deep learning versus kernel learning: an empirical study of loss landscape geometry and the time evolution of the Neural Tangent Kernel”. In: Advances in Neural Information Processing Systems. 2020. arXiv: 2010.15110.
|
| 216 |
+
[10] S. Fort and S. Ganguli. “Emergent properties of the local geometry of neural loss landscapes”. arXiv preprint arXiv:1910.05929 (2019).
|
| 217 |
+
[11] K. He, X. Zhang, S. Ren, and J. Sun. “Deep residual learning for image recognition”. In: Proceedings of the IEEE conference on computer vision and pattern recognition. 2016, pp. 770– 778.
|
| 218 |
+
[12] A. Krizhevsky, V. Nair, and G. Hinton. “Learning multiple layers of features from tiny images” (2009).
|
| 219 |
+
[13] L. N. Darlow, E. J. Crowley, A. Antoniou, and A. J. Storkey. “CINIC-10 is not ImageNet or CIFAR-10”. CoRR abs/1810.03505 (2018). arXiv: 1810.03505.
|
| 220 |
+
[14] C. Zhang, S. Bengio, M. Hardt, B. Recht, and O. Vinyals. “Understanding deep learning requires rethinking generalization”. In: Int. Conf. Representation Learning (ICLR). 2017. arXiv: 1611.03530v2.
|
| 221 |
+
[15] V. Feldman. “Does learning require memorization? a short tale about a long tail”. In: Proc. 52nd Ann. ACM SIGACT Symp. Theory of Comput. (STOC). 2020, pp. 954–959.
|
| 222 |
+
[16] A. Jacot, F. Gabriel, and C. Hongler. “Neural tangent kernel: Convergence and generalization in neural networks”. In: Advances in Information Processing Systems (NeurIPS). 2018. arXiv: 1806.07572.
|
| 223 |
+
[17] J. Lee, L. Xiao, S. S. Schoenholz, Y. Bahri, R. Novak, J. Sohl-Dickstein, and J. Pennington. Wide neural networks of any depth evolve as linear models under gradient descent. 2019. arXiv: 1902.06720.
|
| 224 |
+
[18] S. Arora, S. S. Du, Z. Li, R. Salakhutdinov, R. Wang, and D. Yu. Harnessing the power of infinitely wide deep nets on small-data tasks. 2019. arXiv: 1910.01663.
|
| 225 |
+
[19] A. Lewkowycz, Y. Bahri, E. Dyer, J. Sohl-Dickstein, and G. Gur-Ari. The large learning rate phase of deep learning: the catapult mechanism. 2020. arXiv: 2003.02218.
|
| 226 |
+
[20] J. Frankle, G. K. Dziugaite, D. Roy, and M. Carbin. “Linear mode connectivity and the lottery ticket hypothesis”. In: Int. Conf. Machine Learning (ICML). 2020, pp. 3259–3269. arXiv: 1912.05671.
|
| 227 |
+
[21] P. K. Agarwal, S. Har-Peled, K. R. Varadarajan, et al. “Geometric approximation via coresets”. Combinatorial and computational geometry 52 (2005), pp. 1–30.
|
| 228 |
+
[22] D. Feldman, M. Schmidt, and C. Sohler. “Turning big data into tiny data: Constant-size coresets for k-means, PCA, and projective clustering”. SIAM J. Computing 49.3 (2020), pp. 601– 657.
|
| 229 |
+
[23] E. Tolochinsky and D. Feldman. Coresets for monotonic functions with applications to deep learning. 2018. arXiv: 1802.07382.
|
| 230 |
+
[24] K. Wei, R. Iyer, and J. Bilmes. “Submodularity in data subset selection and active learning”. In: Int. Conf. Machine Learning. PMLR. 2015, pp. 1954–1963.
|
| 231 |
+
[25] O. Sener and S. Savarese. Active learning for convolutional neural networks: A core-set approach. 2017. arXiv: 1708.00489.
|
| 232 |
+
[26] K. Killamsetty, D. Sivasubramanian, G. Ramakrishnan, and R. Iyer. GLISTER: Generalization based Data Subset Selection for Efficient and Robust Learning. 2020. arXiv: 2012 . 10630.
|
| 233 |
+
[27] B. Mirzasoleiman, J. Bilmes, and J. Leskovec. “Coresets for data-efficient training of machine learning models”. In: Int. Conf. Machine Learning (ICML). PMLR. 2020, pp. 6950–6960. arXiv: 1906.01827.
|
| 234 |
+
[28] Y. Shen, H. Yun, Z. C. Lipton, Y. Kronrod, and A. Anandkumar. Deep active learning for named entity recognition. 2017. arXiv: 1707.05928.
|
| 235 |
+
[29] B. Mirzasoleiman, K. Cao, and J. Leskovec. “Coresets for Robust Training of Neural Networks against Noisy Labels” (2020). arXiv: 2011.07451.
|
| 236 |
+
[30] G. Pleiss, T. Zhang, E. R. Elenberg, and K. Q. Weinberger. “Identifying mislabeled data using the area under the margin ranking”. arXiv preprint arXiv:2001.10528 (2020).
|
| 237 |
+
[31] C. Agarwal, D. D’souza, and S. Hooker. “Estimating example difficulty using variance of gradients”. arXiv preprint arXiv:2008.11600 (2020).
|
| 238 |
+
[32] R. J. N. Baldock, H. Maennel, and B. Neyshabur. Deep Learning Through the Lens of Example Difficulty. 2021. arXiv: 2106.09647 [cs.LG].
|
| 239 |
+
[33] P. W. Koh and P. Liang. “Understanding black-box predictions via influence functions”. In: Int. Conf. Machine Learning. PMLR. 2017, pp. 1885–1894.
|
| 240 |
+
[34] E. Barshan, M.-E. Brunet, and G. K. Dziugaite. “Relatif: Identifying explanatory training samples via relative influence”. In: Int. Conf. Artificial Intelligence and Statistics (AISTATS). 2020, pp. 1899–1909.
|
| 241 |
+
[35] G. Pruthi, F. Liu, S. Kale, and M. Sundararajan. “Estimating Training Data Influence by Tracing Gradient Descent”. In: Advances in Neural Information Processing Systems. 2020.
|
| 242 |
+
[36] V. Feldman and C. Zhang. What neural networks memorize and why: Discovering the long tail via influence estimation. 2020. arXiv: 2008.03703.
|
| 243 |
+
[37] J. Bradbury, R. Frostig, P. Hawkins, M. J. Johnson, C. Leary, D. Maclaurin, G. Necula, A. Paszke, J. VanderPlas, S. Wanderman-Milne, and Q. Zhang. JAX: composable transformations of Python+NumPy programs. Version 0.2.5. 2018.
|
| 244 |
+
[38] J. Heek, A. Levskaya, A. Oliver, M. Ritter, B. Rondepierre, A. Steiner, and M. van Zee. Flax: A neural network library and ecosystem for JAX. Version 0.3.4. 2020.
|
md/train/a5KvtsZ14ev/a5KvtsZ14ev.md
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SLAPS: SELF-SUPERVISION IMPROVES STRUCTURE LEARNING FOR GRAPH NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Graph neural networks (GNNs) work well when the graph structure is provided. However, this structure may not always be available in real-world applications. One solution to this problem is to infer the latent structure and then apply a GNN to the inferred graph. Unfortunately, the space of possible graph structures grows super-exponentially with the number of nodes and so the available node labels may be insufficient for learning both the structure and the GNN parameters. In this work, we propose the Simultaneous Learning of Adjacency and GNN Parameters with Self-supervision, or SLAPS, a method that provides more supervision for inferring a graph structure. This approach consists of training a denoising autoencoder GNN in parallel with the task-specific GNN. The autoencoder is trained to reconstruct the initial node features given noisy node features as well as a structure provided by a learnable graph generator. We explore the design space of SLAPS by comparing different graph generation and symmetrization approaches. A comprehensive experimental study demonstrates that SLAPS scales to large graphs with hundreds of thousands of nodes and outperforms several models that have been proposed to learn a task-specific graph structure on established benchmarks.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Graph representation learning has grown rapidly and found applications in domains where data points define a graph (Chami et al., 2020; Kazemi et al., 2020). Graph neural networks (GNNs) (Scarselli et al., 2008) have been a key component to the success of the research in this area. Following the success of graph convolutional networks (GCNs) (Kipf & Welling, 2017) on semi-supervised node classification, several other GNN variants have been proposed for different prediction tasks on graphs (Hamilton et al., 2017; Velickovi ˇ c et al., 2018; Gilmer et al., 2017; Battaglia et al., 2018) and ´ the power of these models has been studied theoretically (Xu et al., 2019; Sato, 2020).
|
| 12 |
+
|
| 13 |
+
GNNs take as input a set of node features and an adjacency matrix corresponding to the graph structure, and, for each node, output an embedding that captures not only the initial features of the node but also the features and embeddings of its neighbors. The performance of GNNs highly depends on the quality of the input graph structure and deteriorates substantially when the graph structure is noisy (see Zugner et al., 2018; Dai et al., 2018; Fox & Rajamanickam, 2019). The need ¨ for both node features and a clean graph structure impedes the applicability of GNNs to domains where one has access to a set of nodes and their features but not to their underlying graph structure, or only has access to a noisy structure. Examples of such domains include brain signal classification (Jang et al., 2019), computer-aided diagnosis (Cosmo et al., 2020), analysis of computer programs (Johnson et al., 2020), and particle reconstruction (Qasim et al., 2019).
|
| 14 |
+
|
| 15 |
+
In this paper, we address this limitation by developing a model that learns both the GNN parameters as well as an adjacency matrix simultaneously. Since the number of possible graph structures grows super-exponentially with the number of nodes (Stanley, 1973) and obtaining node labels is typically costly, the number of available labels may not be enough for learning both the GNN parameters and an adjacency matrix–especially for semi-supervised node classification. Our main contribution is to supplement the classification task with a self-supervised task that helps learn a high-quality adjacency matrix. Our self-supervision approach masks some input features (or adds noise to them) and trains a separate GNN aiming at updating the adjacency matrix in such a way that it can recover the masked (or noisy) features. Introducing this self-supervision adds the inductive bias that a graph structure suitable for predicting the node features is also suitable for predicting the node labels.
|
| 16 |
+
|
| 17 |
+
We experiment with several classification datasets. For datasets with a graph structure, we only feed the node features to our model. The model operates on the node features and an adjacency that is learned simultaneously from data. We compare our model with different classes of methods: some which do not use the graph structure for predicting labels, some which use a fixed $\mathbf { k }$ -Nearest Neighbors (kNN) graph built based on a chosen similarity metric, and some which initialize the graph with kNN but then revise it throughout the training. We show that our model consistently outperforms these methods. We also show that the self-supervised task is key to the high performance of our model. As an additional contribution, we provide an implementation for simultaneous structure and parameter learning that scales to graphs with hundreds of thousands of nodes.
|
| 18 |
+
|
| 19 |
+
# 2 RELATED WORK
|
| 20 |
+
|
| 21 |
+
Existing methods that relate to this work can be grouped into the following categories.
|
| 22 |
+
|
| 23 |
+
Similarity Graph: One approach for inferring a graph structure is to select a similarity metric and set the edge weight between two nodes to be their similarity (Roweis & Saul, 2000; Tenenbaum et al., 2000). To obtain a sparse structure, one may create a kNN similarity graph, only connect pairs of nodes whose similarity surpasses some predefined threshold, or do sampling. As an example, Gidaris & Komodakis (2019) create a (fixed) kNN graph using the cosine similarity of the node features. Wang et al. (2019b) extend this idea by creating a fresh graph in each layer of the GNN based on the node embedding similarities in that layer as opposed to fixing a graph solely based on the initial features. Instead of choosing a single similarity metric, Halcrow et al. (2020) fuse several (potentially weak) measures of similarity. The quality of the predictions of these methods depends heavily on the choice of the similarity metric(s) and the value of $k$ for the kNN graph, or the threshold on similarity. Furthermore, designing an appropriate similarity metric may not be straightforward in some applications.
|
| 24 |
+
|
| 25 |
+
Fully-connected Graph: Another approach is to assume a fully-connected graph and employ GNN variants such as graph attention networks (Velickovi ˇ c et al., 2018; Zhang et al., 2018) or the trans- ´ former (Vaswani et al., 2017) which infer the graph structure via an attention mechanism, or infer the graph structure using additional information. This approach has been used in computer vision (e.g., Suhail & Sigal, 2019), natural language processing (e.g., Zhu et al., 2019), and few-shot learning (e.g., Garcia & Bruna, 2017), where there are not many nodes. The complexity of this approach, however, grows rapidly making it applicable only to small-sized graphs with a few thousand nodes and not scalable to the datasets we use in our experiments.
|
| 26 |
+
|
| 27 |
+
Learnable Graph: Instead of computing a similarity graph on the initial features, one may use a graph generator with learnable parameters. Li et al. (2018b) create a fully-connected graph based on a biliear similarity function with learnable parameters. A common approach is to learn to project the nodes to a latent space where node similarities correspond to edge weights. Wu et al. (2018) project the nodes to a latent space by learning weights for each of the input features. Cosmo et al. (2020) and Qasim et al. (2019) use a multi-layer perceptron for projection. Yu et al. (2020) use a GNN that projects the nodes into a latent space using the initial node features as well as an initial graph structure, aiming at providing a revised graph structure to the task-specific GNN. Franceschi et al. (2019) propose a model named LDS with a bi-level optimization setup for simultaneously learning the GNN parameters and a full adjacency matrix. Yang et al. (2019) update the input adjacency matrix based on the inductive bias that nodes belonging to the same class should be connected to each other and nodes belonging to different classes should be disconnected. Chen et al. (2020) propose an iterative approach that iterates over projecting the nodes to a latent space and constructing an adjacency matrix from the latent representations multiple times. In our experiments, we compare with several approaches from this category.
|
| 28 |
+
|
| 29 |
+
Leveraging Domain Knowledge: In applications where specific domain knowledge is available, one may leverage this to guide the model toward learning specific structures. For example, Johnson et al. (2020) leverage abstract syntax trees and regular languages in learning graph structures of Python programs that aid reasoning for downstream tasks. Jin et al. (2020b) train GNNs that are robust to adversarial attack by learning a cleaned version of the input poisoned adjacency matrix using the domain knowledge that clean adjacency matrices are often sparse and low-rank and exhibit feature smoothness along connected nodes.
|
| 30 |
+
|
| 31 |
+
Proposed Method: Our model falls within the learnable graph category in which we use graph generators with learnable parameters to infer the adjacency matrix. We supplement the training with a self-supervised objective to increase the amount of supervision in learning a graph structure. The self-supervised objective is generic and can be combined with many of the models described above. It is in the same vein as the auxiliary tasks in the context of multi-task learning used in computer vision, natural language processing, and reinforcement learning (see, e.g., Jaderberg et al., 2016; Liebel & Korner, 2018; Alonso & Plank, 2016). The self-supervised task is inspired by the ¨ successful training procedures of several recent language models such as BERT (Devlin et al., 2018) and RoBERTa (Liu et al., 2019b). Similar self-supervision techniques have also been employed for GNNs (Hu et al., 2020b;c) (Jin et al., 2020a; You et al., 2020; Zhu et al., 2020). While we employ similar self-supervision techniques, our work differs from this line of work as we use selfsupervision for learning a graph structure whereas the above methods use it to learn better (and, in some cases, transferable) GNN parameters. Specifically, we adopt the multi-task learning framework of You et al. (2020) with two differences: 1- we do not used shared parameters for the task-specific and self-supervised GNNs, and 2- instead of using a fixed adjacency matrix provided as input, we allow both GNNs to provide gradients for a generator that learns to generate a graph structure suitable for the downstream task.
|
| 32 |
+
|
| 33 |
+
# 3 BACKGROUND AND NOTATION
|
| 34 |
+
|
| 35 |
+
We use lowercase letters to denote scalars, bold lowercase letters to denote vectors and bold uppercase letters to denote matrices. $\pmb { I }$ represents an identity matrix. For a vector $\textbf { { v } }$ , we represent its $i ^ { \mathrm { { t h } } }$ element as ${ \mathbf { } } v _ { i }$ . For a matrix $M$ , we represent the $i ^ { \mathrm { t h } }$ row as $M _ { i }$ and the element at the $i ^ { \mathrm { { \bar { t h } } } }$ row and $j ^ { \mathrm { t h } }$ column as $M _ { i j }$ . For an attributed graph, we use $n , m$ and $f$ to represent the number of nodes, edges, and features respectively, and denote the graph as ${ \mathcal { G } } = \{ \gamma , A , X \}$ where $\mathcal { V } = \{ v _ { 1 } , \ldots , v _ { n } \}$ is a set of nodes, $A \in \mathbb { R } ^ { n \times n }$ is a (sparse) adjacency matrix with $\boldsymbol { A } _ { i j }$ indicating the weight of the edge from $v _ { i }$ to $v _ { j }$ $A _ { i j } = 0$ implies no edge), and $\ b { X } \in \mathbb { R } ^ { n \times f }$ is a matrix whose rows correspond to node features or attributes. A degree matrix $_ D$ for a graph $\mathcal { G }$ is a diagonal matrix where $\begin{array} { r } { D _ { i i } = \sum _ { j } A _ { i j } } \end{array}$ .
|
| 36 |
+
|
| 37 |
+
Graph convolutional networks (GCNs) are a powerful variant of GNNs. For a graph ${ \mathcal { G } } = \{ \gamma , A , X \}$ with a degree matrix $_ D$ , layer $l$ of the GCN architecture can be defined as $\pmb { H } ^ { ( l ) } = \sigma ( \hat { A } \pmb { H } ^ { ( l - 1 ) } \pmb { W } ^ { ( l ) } )$ where $\hat { A }$ represents a normalized adjacency matrix, $\pmb { H } ^ { ( l - 1 ) } \in \mathbb { R } ^ { n \times d _ { l - 1 } }$ represents the node representations in layer ${ l - I }$ with $H ^ { ( 0 ) } = X$ , $\dot { \mathbf W } ^ { ( l ) } \in \mathbb R ^ { d _ { l - 1 } \times d _ { l } }$ is a weight matrix, $\sigma$ is an activation function such as ReLU, and $\pmb { H } ^ { ( l ) } \in \mathbb { R } ^ { n \times d _ { l } }$ is the updated node embeddings. For undirected graphs where the adjacency is symmetric, $\hat { A } = D ^ { - \frac { 1 } { 2 } } ( A \overset { \cdot } { + } I ) D ^ { - \frac { 1 } { 2 } }$ corresponds to a row-and-column normalized adjacency with self-loops, and for directed graphs where the adjacency is not necessarily symmetric, $\pmb { \hat { A } } = \pmb { D } ^ { - 1 } ( \pmb { A } + \pmb { I } )$ corresponds to a row normalized adjacency matrix with self-loops.
|
| 38 |
+
|
| 39 |
+
# 4 SLAPS: SIMULTANEOUS LEARNING OF ADJACENCY MATRIX AND GNN PARAMETERS WITH SELF-SUPERVISION
|
| 40 |
+
|
| 41 |
+
We break our model into four components: 1) generator, 2) adjacency processor, 3) classifier, and 4) self-supervision. The generator takes the node features as input and generates a (perhaps sparse, non-normalized, and non-symmetric) matrix $\tilde { \pmb { A } } \in \mathbb { R } ^ { n \times n }$ . $\tilde { A }$ is then fed into the adjacency processor which outputs $\ b { A } \in \mathbb { R } ^ { n \times n }$ corresponding to a normalized, and in some cases symmetric version of $\tilde { A }$ . The classifier is a GNN that receives $\pmb { A }$ as well as the node features as input and classifies the nodes into a set of predefined classes. The self-supervision component is a GNN that receives noisy features and the generated adjacency as input and aims at denoising the features. Figure 1 illustrates the different components and in what follows, we describe each component in more detail.
|
| 42 |
+
|
| 43 |
+

|
| 44 |
+
Figure 1: Overview of SLAPS. At the top, a generator receives the node features and produces a non-symmetric, non-normalized adjacency having (potentially) both positive and negative values (Section 4.1). The adjacency processor makes the values positive, symmetrizes and normalizes the adjacency (Section 4.2). The resulting adjacency and the node features go into $\mathsf { G N N } _ { \mathsf { C } }$ which predicts the node classes (Section 4.3). At the bottom, some noise is added to the node features. The resulting noisy features and the generated adjacency go into $\mathsf { G N N } _ { \mathsf { D A E } }$ which then denoises the features (Section 4.4).
|
| 45 |
+
|
| 46 |
+
# 4.1 GENERATOR
|
| 47 |
+
|
| 48 |
+
The generator is a function $\mathsf { G } : \mathbb { R } ^ { n \times f } \to \mathbb { R } ^ { n \times n }$ with parameters $\theta _ { \mathsf { G } }$ which takes the node features $\boldsymbol { X }$ as input and produces $\tilde { \pmb { A } } \in \mathbb { R } ^ { n \times n }$ as output. We consider the following two generators.
|
| 49 |
+
|
| 50 |
+
Full Parameterization (FP): In this case, $\theta _ { \mathsf { G } }$ is a single matrix in $\mathbb { R } ^ { n \times n }$ and the generator function is defined as $\tilde { A } = \mathsf { G } _ { F P } ( X ; \theta _ { \mathsf { G } } ) = \theta _ { \mathsf { G } }$ . That is, the generator ignores the input node features and directly optimizes the adjacency matrix. The disadvantages of this generator include adding $n ^ { 2 }$ parameters to the model, which limits scalability and makes the model susceptible to overfitting, and not being applicable to inductive settings where during test time predictions are to be made for nodes unseen during training. This generator is similar to the one proposed by Franceschi et al. (2019) except that they treat each element of $\tilde { A }$ as the parameter of a Bernoulli distribution and sample graph structures from these Bernoulli distributions.
|
| 51 |
+
|
| 52 |
+
MLP-kNN: In this case, $\theta _ { \mathsf { G } }$ corresponds to the weights of a multi-layer perceptron (MLP) and $\tilde { A } = \mathsf { G } _ { \mathsf { M L P } } ( X ; \theta _ { \mathsf { G } } ) = \mathsf { k N N } ( \mathsf { M L P } ( X ) )$ , where MLP : $\mathbb { R } ^ { n \times f } \to \mathbb { R } ^ { n \times f ^ { \prime } }$ is an MLP that produces a matrix with updated node representations $X ^ { \prime }$ $; \mathsf { k N N } : \mathbb { R } ^ { n \times f ^ { \prime } } \to \mathbb { R } ^ { n \times n }$ produces a sparse matrix. Let $M \in \mathbb { R } ^ { n \times n }$ with $M _ { i j } = 1$ if $v _ { j }$ is among the top $k$ similar nodes to $v _ { i }$ and 0 otherwise, and let $S \in \mathbb { R } ^ { n \times n }$ such that $S _ { i j } = \mathsf { S i m } ( X _ { i } ^ { \prime } , X _ { j } ^ { \prime } )$ for some differentiable similarity function $\mathsf { S i m }$ (we used cosine in our experiments). Then $\tilde { A } = \mathsf { k N N } ( X ^ { \prime } ) = M \odot S$ where $\odot$ represents the Hadamard (element-wise) product. Since $\boldsymbol { s }$ is computed based on $X ^ { \prime }$ , the gradients flow to the elements in $X ^ { \prime }$ (and consequently to the weights of the MLP) through $\boldsymbol { s }$ . In the backward phase of our model, we compute the gradients only with respect to those elements in $\boldsymbol { s }$ whose corresponding value in $_ M$ is 1 (i.e. those elements $S _ { i j }$ such that $M _ { i j } = 1$ ); the gradient with respect to the other elements is 0. With this formulation, in the forward phase of the network, one can first compute the matrix $^ { M }$ using an off-the-shelf k-nearest neighbors algorithm and then compute the similarities in $S$ only for pairs of nodes where $M _ { i j } = 1$ . Unlike FP, this generator can be used for the inductive setting.
|
| 53 |
+
|
| 54 |
+
Smart initialization: In our experiments, we found the initialization of the generator parameters (i.e. $\theta _ { \mathsf { G } }$ ) to be important. Let $A ^ { k N N }$ represent an adjacency matrix created by applying a kNN function on the initial node features. One smart initialization for $\theta _ { \mathsf { G } }$ is to initialize them in a way that the generator generates $A ^ { k N N }$ before training starts (i.e. $\ddot { A } = A ^ { k N N }$ before training starts). Such an initialization can be trivially done for the FP generator by initializing $\theta _ { \mathsf { G } }$ to $A ^ { k N N }$ , but may not be straightforward for the MLP-kNN generator. To enable initializing the parameters of the MLPkNN generator in a way that it generates $A ^ { k N N }$ before training starts, we consider two variants of this generator. In one, hereafter referred to simply as MLP, we keep the input dimension the same throughout the layers. In the other, hereafter referred to as MLP-D, we consider MLPs with diagonal weight matrices (i.e., except the main diagonal, all other parameters in the weight matrices are zero). For both variants, we initialize the weight matrices in $\theta _ { \mathsf { G } }$ with the identity matrix to ensure that the output of the MLP is initially the same as its input and the kNN graph created on these outputs is equivalent to $A ^ { k N N }$ . MLP-D can be thought of as assigning different weights to different features and then computing node similarities. Note that, alternatively, one may use other MLP variants but pre-train the weights to output $A ^ { k N N }$ before the main training starts.
|
| 55 |
+
|
| 56 |
+
# 4.2 ADJACENCY PROCESSOR
|
| 57 |
+
|
| 58 |
+
The output $\tilde { A }$ of the generator may have both positive and negative values, may be non-symmetric and non-normalized. To ensure all values of the adjacency are positive and make the adjacency symmetric and normalized, we apply the following function to $\tilde { A }$ :
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\pmb { A } = \pmb { D } ^ { - \frac 1 2 } \bigg ( \frac { \mathsf { P } ( \tilde { \pmb { A } } ) + \mathsf { P } ( \tilde { \pmb { A } } ) ^ { T } } { 2 } \bigg ) \pmb { D } ^ { - \frac 1 2 }
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
Here $\mathsf { P }$ is a function with a non-negative range. In our experiments, when using an MLP generator, we apply the ReLU function to the elements of $\tilde { A }$ . When using the fully-parameterized (FP) generator, applying ReLU results in a gradient flow problem as any edge whose corresponding value in $\tilde { A }$ becomes less than or equal to zero stops receiving gradient updates. For this reason, for FP we apply the ELU function to the elements of $\tilde { A }$ and then add a value of 1. The sub-expression $\frac { \mathsf { P } ( \tilde { A } ) + \mathsf { P } ( \bar { \tilde { A } } ) ^ { \tilde { T } } } { 2 }$ makes the resulting matrix $\mathsf { P } ( \tilde { A } )$ symmetric. To understand the reason for taking the mean of $\mathsf { P } ( \tilde { A } )$ and $\mathsf { P } ( \tilde { \mathbf { A } } ) ^ { T }$ , assume $\tilde { A }$ is generated by $G _ { \mathsf { M L P } }$ . If $v _ { j }$ is among the $k$ most similar nodes to $v _ { i }$ and vice versa, then the strength of the connection between $v _ { i }$ and $v _ { j }$ will remain the same. However, if, say, $v _ { j }$ is among the $k$ most similar nodes to $v _ { i }$ but $v _ { i }$ is not among the top $\mathbf { k }$ for $v _ { j }$ , then taking the average of the similarities reduces the strength of the connection between $v _ { i }$ and $v _ { j }$ . Finally, once we have a symmetric adjacency with non-negative values, we compute the degree matrix $_ { D }$ for $\frac { \mathsf { P } ( \tilde { A } ) + \mathsf { P } ( \tilde { A } ) ^ { T } } { 2 }$ and normalize $\frac { \mathsf { P } ( \tilde { A } ) + \mathsf { P } ( \tilde { A } ) ^ { T } } { 2 }$ by multiplying it left and right with $D ^ { - { \frac { 1 } { 2 } } }$ .
|
| 65 |
+
|
| 66 |
+
# 4.3 CLASSIFIER
|
| 67 |
+
|
| 68 |
+
The classifier is a function $\mathsf { G N N } _ { \mathsf { C } } : \mathbb { R } ^ { n \times f } \times \mathbb { R } ^ { n \times n } \to \mathbb { R } ^ { n \times | \mathcal { C } | }$ with parameters $\theta _ { \mathsf { G N N } _ { \mathsf { C } } }$ . It takes the node features $\boldsymbol { X }$ and the generated adjacency $\pmb { A }$ as input and provides for each node the logits for each class. $\mathcal { C }$ corresponds to the classes and $| { \mathcal { C } } |$ corresponds to the number of classes. We use a twolayer GCN for which $\theta _ { \mathsf { G N N } _ { \mathsf { C } } } = \{ W ^ { ( 1 ) } , W ^ { ( 2 ) } \}$ and define our classifier as $\mathsf { G N N } _ { \mathsf { C } } ( A , X ; \theta _ { \mathsf { G N N } _ { \mathsf { C } } } ) =$ $A { \mathsf { R e L U } } ( A X W ^ { ( 1 ) } ) W ^ { ( 2 ) }$ but other GNN variants can be used as well (recall that $\pmb { A }$ is normalized). The training loss $\mathcal { L } _ { C }$ for the classification task is computed by taking the softmax of the logits to produce a probability distribution for each node and then computing the cross-entropy loss.
|
| 69 |
+
|
| 70 |
+
# 4.4 ADDING SELF-SUPERVISION
|
| 71 |
+
|
| 72 |
+
As explained in Section 1, in many domains, the number of labeled nodes may be insufficient for learning both the structure and the GNN parameters from data. To increase the amount of supervision for learning the structure, we propose a self-supervised approach based on denoising autoencoders (Vincent et al., 2008). Let $\mathsf { \bar { G } N N } _ { \mathsf { D A E } } : \mathbb { R } ^ { n \times f } \times \mathbb { R } ^ { n \times n } \ \overset { \texttt { c . } } { } \mathbb { R } ^ { n \times f }$ be a GNN that takes node features as well as a normalized adjacency produced by a generator as input and provides updated node features with the same dimension as input. We train $\mathsf { G N N } _ { \mathsf { D A E } }$ such that it receives a noisy version $\tilde { X }$ of the features $\boldsymbol { X }$ as input and produces the denoised features $\boldsymbol { X }$ as output. Let idx represent the indices corresponding to the elements of $\boldsymbol { X }$ to which we have added noise, and $X _ { i d x }$ represent the values at these indices. The aim of the training procedure is to minimize:
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\mathcal { L } _ { D A E } = \mathsf { L } ( X _ { i d x } , \mathsf { G N N } _ { \mathsf { D A E } } ( \tilde { X } , A ; \theta _ { \mathsf { G N N } _ { \mathsf { D A E } } } ) _ { i d x } )
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
where $\pmb { A }$ is the generated adjacency matrix and $\mathsf { L }$ is a loss function. To add noise to the input features for datasets where features consist of binary vectors, in each iteration, $i d x$ consists of $r$ percent of the indices of $\boldsymbol { X }$ whose values are ones and $r \eta$ percent of the indices whose values are zeros, both selected uniformly at random in each epoch. Both $r$ and $\eta$ (corresponding to the negative ratio) are hyperparameters. In this case, we add noise by setting the ones in the selected mask to zeros and L is the binary cross-entropy loss. For datasets where the input features are continuous numbers, idx consists of $r$ percent of the indices of $\boldsymbol { X }$ selected uniformly at random in each epoch. We add noise by either replacing the values at idx with zeros or by adding independent Gaussian noises to each of the features. In this case, L is the mean-squared error loss.
|
| 79 |
+
|
| 80 |
+
To understand the cruciality of the proposed self-supervision, let us consider a scenario for training the model in Figure 1 (or a model with a similar architecture) but without the self-supervised task. As training proceeds, assume that two unlabeled nodes $v _ { i }$ and $v _ { j }$ are not directly connected to any labeled nodes. Then, since a two-layer GCN makes predictions for the nodes based on their two-hop neighbors, the edge between $v _ { i }$ and $v _ { j }$ receives no supervision1. Figure 2 provides an example of such a scenario.
|
| 81 |
+
|
| 82 |
+
As a quantitative example, in the original structures and train/validation/test splits of Cora and Citeseer, $8 0 . 4 \%$ and $8 9 . 9 \%$ of the nodes, and consequently $6 4 . 6 \%$ and $8 0 . 8 \%$ of pairs of nodes, are not connected to any labeled/train nodes. If no supervision is provided for some edges in the graph, after training the existence and weights of these edges may end up being set randomly (or the same as their initialization value), which may be problematic during testing. With the self-supervised task, however, although these edges may not receive supervision from the main task (i.e. from ${ \mathsf { G C N } } _ { \mathsf { C } } ,$ ), the supervision provided by the self-supervised task (i.e. from $G C N _ { \mathsf { D A E } } ^ { - }$ ) helps learn an appropriate weight for them.
|
| 83 |
+
|
| 84 |
+

|
| 85 |
+
Figure 2: The dashed edge receives no supervision when training a two-layer GCN as it is not in the two-hop neighborhood of any labeled node.
|
| 86 |
+
|
| 87 |
+
# 4.5 SLAPS
|
| 88 |
+
|
| 89 |
+
Our final model, dubbed SLAPS, is trained to minimize $\mathcal { L } = \mathcal { L } _ { C } + \lambda \mathcal { L } _ { D A E }$ where $\mathcal { L } _ { C }$ is the classification loss, $\mathcal { L } _ { D A E }$ is the denoising autoencoder loss (see Equation 2), and $\lambda$ is a hyperparameter controlling the relative importance of the two losses.
|
| 90 |
+
|
| 91 |
+
To verify the merit of the $\mathsf { G N N } _ { \mathsf { D A E } }$ for learning an adjacency matrix in isolation, we also consider a variant of SLAPS named $S L A P S _ { 2 s }$ that is trained in two stages. We first train the $\mathsf { G N N } _ { \mathsf { D A E } }$ model by minimizing the loss function described in Equation 2. Note that the loss function in Equation 2 depends on the parameters $\theta _ { \mathsf { G } }$ of the generator and the parameters $\theta _ { \mathsf { G N N } _ { \mathsf { D A E } } }$ of the denoising autoencoder. After every $t$ epochs of training, we fix the adjacency matrix, train a classifier with the fixed adjacency matrix, and measure classification accuracy on the validation set. We select the epoch that produces the adjacency providing the best validation accuracy for the classifier. Note that in $S L \bar { A } P S _ { 2 s }$ , the adjacency matrix is trained only based on $\mathsf { G N N } _ { \mathsf { D A E } }$ .
|
| 92 |
+
|
| 93 |
+
# 5 EXPERIMENTS
|
| 94 |
+
|
| 95 |
+
Baselines: We compare our proposal to several baselines with different properties. The first baseline is a multi-layer perceptron (MLP) which does not take the graph structure into account. We also compare against MLP-GAM\* (Stretcu et al., 2019) which learns a fully-connected graph structure and uses this structure to supplement the loss function of the MLP toward predicting similar labels for neighboring nodes. Similar to Franceschi et al. (2019), we also consider a baseline named kNNGCN where we create a kNN graph based on the node features and feed this graph to a GCN. The graph structure remains fixed in this approach. We also compare with baselines that learn the graph structure from data including LDS (Franceschi et al., 2019), GRCN (Yu et al., 2020), DGCNN (Wang et al., 2019b), and IDGL (Chen et al., 2020). We feed a kNN graph to the models requiring an initial graph structure.
|
| 96 |
+
|
| 97 |
+
Datasets: We use three established benchmarks in the GNN literature namely Cora, Citeseer, and Pubmed (Sen et al., 2008) as well as a newly released dataset for node classification named ogbnarxiv (Hu et al., 2020a) that is orders of magnitude larger than the other three datasets and is more challenging due to the more realistic split of the data into train, validation, and test sets. For all the datasets, we only feed the node features to the models and not the graph structure. Following Franceschi et al. (2019), we also experiment with several classification (non-graph) datasets available in scikit-learn (Pedregosa et al., 2011) including Wine, Cancer, Digits, and 20News. Dataset statistics can be found in the Appendix. For Cora and Citeseer, the LDS model uses the train data for learning the parameters of their classification GCN, half of the validation for learning the parameters of the adjacency matrix (in their bi-level optimization setup, these are considered as hyperparameters), and the other half of the validation set for early stopping and tuning the other hyperparameters. Besides experimenting with the original setups of these two datasets, we also consider a setup that is closer (although not identical) to that of LDS: we use the train set and half of the validation set for training and the other half of validation for early stopping and hyperparameter tuning. We name the modified versions Cora390 and Citeseer370 respectively where the number proceeding the dataset name corresponds to the number of labels used for training. We also follow a similar procedure for the scikit-learn datasets.
|
| 98 |
+
|
| 99 |
+
Table 1: Results of SLAPS and the baselines on established node classification benchmarks. $\dagger$ indicates results have been taken from Franceschi et al. (2019). $^ \ddag$ indicates results have been taken from Stretcu et al. (2019). Bold and underlined values indicate best and second-best mean performances respectively. OOM indicates out of memory.
|
| 100 |
+
|
| 101 |
+
<table><tr><td>Model</td><td>Generator</td><td>Cora</td><td>Citeseer</td><td>Cora390</td><td>Citeseer370</td><td>Pubmed</td><td>ogbn-arxiv</td></tr><tr><td>MLP</td><td rowspan="6"></td><td>56.1 ± 1.6†</td><td>56.7 ± 1.7†</td><td>65.8±0.4</td><td>67.1±0.5</td><td>71.4±0.0</td><td>54.7± 0.1</td></tr><tr><td>MLP-GAM*</td><td>70.7</td><td>70.3t</td><td></td><td></td><td>71.9‡</td><td>一</td></tr><tr><td>kNN-GCN</td><td>66.5 ± 0.4†</td><td>68.3 ± 1.3†</td><td>72.5 ±0.5</td><td>71.8 ±0.8</td><td>70.4± 0.4</td><td>49.1 ± 0.3</td></tr><tr><td>LDS</td><td></td><td></td><td>71.5 ± 0.8†</td><td>71.5 ± 1.1†</td><td>OOM</td><td>OOM</td></tr><tr><td>GRCN</td><td>67.4 ± 0.3</td><td>67.3 ± 0.8</td><td>71.3± 0.9</td><td>70.9 ±0.7</td><td>67.3± 0.3</td><td>OOM</td></tr><tr><td>DGCNN IDGL</td><td>56.5 ± 1.2</td><td>55.1 ± 1.4</td><td>67.3 ± 0.7</td><td>66.6±0.8</td><td>70.1 ± 1.3</td><td>OOM</td></tr><tr><td>SLAPS</td><td>FP</td><td>70.9 ± 0.6</td><td>68.2±0.6 70.7±0.4</td><td>73.4 ± 0.5</td><td>72.7± 0.4</td><td>72.3 ± 0.4</td><td>OOM</td></tr><tr><td>SLAPS</td><td>MLP</td><td>72.4± 0.4</td><td>70.5 ± 1.1</td><td>76.6± 0.4</td><td>73.1± 0.6</td><td>0OM</td><td>OOM</td></tr><tr><td></td><td></td><td>72.8± 0.8</td><td></td><td>75.3 ± 1.0</td><td>73.0 ± 0.9</td><td>74.4 ± 0.6</td><td>56.6 ±0.1</td></tr><tr><td>SLAPS</td><td>MLP-D</td><td>73.4 ± 0.3</td><td>72.6±0.6</td><td>75.1 ± 0.5</td><td>73.9 ±0.4</td><td>73.1 ± 0.7</td><td>52.9 ±0.1</td></tr></table>
|
| 102 |
+
|
| 103 |
+
# 5.1 COMPARATIVE RESULTS
|
| 104 |
+
|
| 105 |
+
The results of SLAPS and the baselines on the node classification benchmarks are reported in Table 1. Considering only the baselines first, we see that kNN-GCN significantly outperforms MLP on Cora and Citeseer but underperforms on Pubmed and ogbn-arxiv. This shows the importance of the similarity metric and the graph structure that is fed into GCN as a low-quality structure can harm model performance. LDS outperforms MLP but the fully parameterized adjacency matrix of LDS results in memory issues for Pubmed and ogbn-arxiv. As for GRCN, it was shown in the original paper that GRCN can revise a good initial adjacency matrix and provide a substantial boost in performance. However, as evidenced by the results, if the initial graph structure is somewhat poor, GRCN’s performance becomes on-par with kNN-GCN. IDGL is the best performing baseline but the iterative nature of it makes it slow to train and test.
|
| 106 |
+
|
| 107 |
+
SLAPS consistently outperforms the baselines on all datasets, in some cases by large margins. Among the generators, the winner is dataset-dependent with MLP-D mostly outperforming MLP on datasets with many features and MLP outperforming on datasets with small numbers of features. Using the software that was publicly released by the authors, all baselines that learn a graph structure fail on ogbn-arxiv and our implementation is the first that generalizes to such large graphs.
|
| 108 |
+
|
| 109 |
+
Table 2 reports the results for the scikit-learn datasets and compares with LDS and IDGL. On three out of four datasets, SLAPS outperforms the other two baselines. Among the datasets on which we can train SLAPS with the FP generator, 20news has the largest number of nodes. On this dataset, we observed that an FP generator suffers from overfitting and produces weaker results compared to other generators due to its large number of parameters.
|
| 110 |
+
|
| 111 |
+
Table 2: Results on classification datasets. $\dagger$ indicates results have been taken from Franceschi et al. (2019). Bold and underlined values indicate best and second-best mean performances respectively.
|
| 112 |
+
|
| 113 |
+
<table><tr><td>Model</td><td>Generator</td><td>Wine</td><td>Cancer</td><td>Digits</td><td>20news</td></tr><tr><td>LDS IDGL</td><td></td><td>97.3 ± 0.4†</td><td>94.4± 1.9†</td><td>92.5± 0.7†</td><td>46.4±1.6†</td></tr><tr><td>SLAPS</td><td>FP</td><td>97.0 ± 0.7 96.6±0.4</td><td>94.2 ± 2.3 94.6± 0.3</td><td>92.5 ± 1.3</td><td>48.5 ± 0.6</td></tr><tr><td>SLAPS</td><td>MLP</td><td>96.3 ± 1.0</td><td>96.0 ± 0.8</td><td>94.4± 0.7 92.4± 0.6</td><td>44.4± 0.8 50.4± 0.7</td></tr><tr><td>SLAPS</td><td>MLP-D</td><td>96.5 ± 0.8</td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td>96.6 ± 0.2</td><td>93.2 ± 0.6</td><td>49.8 ± 0.9</td></tr></table>
|
| 114 |
+
|
| 115 |
+
# 5.2 FURTHER ANALYSIS
|
| 116 |
+
|
| 117 |
+
$\mathbf { S L A P S } _ { 2 s }$ : To provide more insight into the value provided by the self-supervision task on the learned adjacency, we conduct experiments with $\mathrm { S L A P S } _ { 2 s }$ . Recall from Section 4.5 that in $\mathrm { S L A P S } _ { 2 s }$ , the adjacency is learned only based on the self-supervision task and the node labels are only used for early stopping, hyperparameter tuning, and training $\mathsf { G C N } _ { \mathsf { C } }$ . Figure 3(a) shows the performance of SLAPS and $\mathrm { S L A P S } _ { 2 s }$ on Cora and compares them with kNN-GCN. Although $\mathrm { S L A P S } _ { 2 s }$ does not use the node labels in learning an adjacency matrix, it outperforms kNN-GCN $8 . 4 \%$ improvement when using an FP generator). With an FP generator, $\mathrm { S L A P S } _ { 2 s }$ even achieves competitive performance with SLAPS; this is mainly because FP does not leverage the supervision provided by $\mathsf { G C N } _ { \mathsf { C } }$ toward learning generalizable patterns that can be used for nodes other than those in the training set. These results corroborate the effectiveness of the self-supervision task for learning an adjacency matrix. Besides, the results show that learning the adjacency using both self-supervision and the task-specific node labels results in higher predictive accuracy.
|
| 118 |
+
|
| 119 |
+
The value of λ: Figure 3(b) shows the performance of SLAPS2 on Cora and Citeseer with different values of $\lambda$ . When $\lambda = 0$ , corresponding to removing self-supervision, the model performance is somewhat poor. As soon as $\lambda$ becomes positive, both models see a large boost in performance showing that self-supervision is crucial to the high performance of SLAPS. Increasing $\lambda$ further provides larger boosts until it becomes so large that the self-supervision loss dominates the classification loss and the performance deteriorates. Note that with $\lambda = 0$ , SLAPS with the MLP generator becomes a variant of the model proposed by Cosmo et al. (2020), but with a different similarity function.
|
| 120 |
+
|
| 121 |
+
Importance of $\boldsymbol { k }$ in kNN: Figure 3(c) shows the performance of SLAPS on Cora for three graph generators as a function of $k$ in kNN. For all three cases, the value of $k$ plays a major role in model performance. The FP generator is the least sensitive because in FP, $k$ only affects the initialization of the adjacency matrix but then the model can change the number of neighbors of each node. For MLP and MLP-D, however, the number of neighbors of each node remains close to $k$ (but not necessarily equal as the adjacency processor can add or remove some edges) and the two generators become more sensitive to $k$ . For larger values of $k$ , the extra flexibility of the MLP generator enables removing some of the unwanted edges through the function P or reducing the weights of the unwanted edges resulting in MLP being less sensitive to large values of $k$ compared to MLP-D.
|
| 122 |
+
|
| 123 |
+
Symmetrization: To symmetrize the adjacency, in Equation 1 we took the average of $\mathsf { P } ( \tilde { A } )$ and $\mathsf { P } ( \tilde { \mathbf { A } } ) ^ { T }$ . Here we also consider two other choices: 1) $\mathsf { m a x } ( \mathsf { P } ( \tilde { \boldsymbol { A } } ) , \mathsf { P } ( \tilde { \boldsymbol { A } } ) ^ { T } )$ , and 2) not symmetrizing the adjacency (i.e. using $\mathsf { P } ( \tilde { A } ) )$ . Figure 3(d) compares these three choices on Cora and Citeseer with an MLP generator (other generators produced similar results). On both datasets, symmetrizing the adjacency provides a performance boost. Compared to mean symmetrization, max symmetrization performs slightly worse. This may be because max symmetrization does not distinguish between the case where both $v _ { i }$ and $v _ { j }$ are among the $k$ most similar nodes of each other and the case where only one of them is among the $k$ most similar nodes of the other.
|
| 124 |
+
|
| 125 |
+
Analysing the learned adjacency: Many graph-based semi-supervised classification models are based on the cluster assumption according to which nearby nodes are more likely to share the same label (Chapelle & Zien, 2005). To verify the quality of the adjacency matrix learned using SLAPS, for every pair of nodes in the test set, we compute the odds of the two nodes sharing the same label as a function of the normalized weight of the edge connecting them. Figure 3(e) represents the odds for different weight intervals. For both Cora and Citeseer, nodes connected with higher edge weights are more likely to share the same label compared to nodes with lower or zero edge weights. As a specific example, when $A _ { i j } ~ \geq ~ 0 . 1$ , $v _ { i }$ and $v _ { j }$ are almost 2.5 times more likely to share the same label on Cora and almost 2.0 times more likely on Citeseer. Note that SLAPS may connect nodes based on a different criterion than the one used in the original datasets and so the learned adjacencies do not necessarily resemble the original structures.
|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
Figure 3: The performance of SLAPS (a) compared to $\mathrm { S L A P S } _ { 2 s }$ on Cora with different generators, (b) with MLP graph generator on Cora and Citeseer as a function of $\lambda$ , (c) with different graph generators on Cora as a function of $k$ in kNN, and (d) on Cora and Citeseer with different adjacency symmetrizations. (e) The odds of two nodes in the test set sharing the same label as a function of the edge weights learned by SLAPS.
|
| 129 |
+
|
| 130 |
+
# 6 CONCLUSION
|
| 131 |
+
|
| 132 |
+
In this paper, we proposed a model for learning the parameters of a graph neural network and the graph structure of the nodes simultaneously. We showed the effectiveness of our model using a comprehensive set of experiments and analyses. In the future, we would like to try more sophisticated graph generation models (e.g., GraphRNN (You et al., 2018) and GNF (Liu et al., 2019a)) and extend our approach to applications with a temporal aspect where node features are observed over time but their connections are not provided as input.
|
| 133 |
+
|
| 134 |
+
# REFERENCES
|
| 135 |
+
|
| 136 |
+
Hector Mart ´ ´ınez Alonso and Barbara Plank. When is multitask learning effective? semantic sequence prediction under varying data conditions. arXiv preprint arXiv:1612.02251, 2016.
|
| 137 |
+
|
| 138 |
+
Peter W Battaglia, Jessica B Hamrick, Victor Bapst, Alvaro Sanchez-Gonzalez, Vinicius Zambaldi, Mateusz Malinowski, Andrea Tacchetti, David Raposo, Adam Santoro, Ryan Faulkner, et al. Relational inductive biases, deep learning, and graph networks. arXiv preprint arXiv:1806.01261, 2018.
|
| 139 |
+
|
| 140 |
+
Ines Chami, Sami Abu-El-Haija, Bryan Perozzi, Christopher Re, and Kevin Murphy. Machine ´ learning on graphs: A model and comprehensive taxonomy. arXiv preprint arXiv:2005.03675, 2020.
|
| 141 |
+
|
| 142 |
+
Olivier Chapelle and Alexander Zien. Semi-supervised classification by low density separation. In AISTATS, volume 2005, pp. 57–64. Citeseer, 2005.
|
| 143 |
+
|
| 144 |
+
Yu Chen, Lingfei Wu, and Mohammed J. Zaki. Deep iterative and adaptive learning for graph neural networks. In The First International Workshop on Deep Learning on Graphs: Methodologies and Applications (with AAAI), February 2020. URL https://dlg2019.bitbucket.io/ aaai20.
|
| 145 |
+
|
| 146 |
+
Luca Cosmo, Anees Kazi, Seyed-Ahmad Ahmadi, Nassir Navab, and Michael Bronstein. Latent patient network learning for automatic diagnosis. arXiv preprint arXiv:2003.13620, 2020.
|
| 147 |
+
|
| 148 |
+
Hanjun Dai, Hui Li, Tian Tian, Xin Huang, Lin Wang, Jun Zhu, and Le Song. Adversarial attack on graph structured data. arXiv preprint arXiv:1806.02371, 2018.
|
| 149 |
+
|
| 150 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
|
| 151 |
+
|
| 152 |
+
James Fox and Sivasankaran Rajamanickam. How robust are graph neural networks to structural noise? arXiv preprint arXiv:1912.10206, 2019.
|
| 153 |
+
|
| 154 |
+
Luca Franceschi, Mathias Niepert, Massimiliano Pontil, and Xiao He. Learning discrete structures for graph neural networks. In ICML, 2019.
|
| 155 |
+
|
| 156 |
+
Victor Garcia and Joan Bruna. Few-shot learning with graph neural networks. arXiv preprint arXiv:1711.04043, 2017.
|
| 157 |
+
|
| 158 |
+
Spyros Gidaris and Nikos Komodakis. Generating classification weights with gnn denoising autoencoders for few-shot learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 21–30, 2019.
|
| 159 |
+
|
| 160 |
+
Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 1263–1272. JMLR. org, 2017.
|
| 161 |
+
|
| 162 |
+
Jonathan Halcrow, Alexandru Mosoi, Sam Ruth, and Bryan Perozzi. Grale: Designing networks for graph learning. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 2523–2532, 2020.
|
| 163 |
+
|
| 164 |
+
Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In NeurIPS, 2017.
|
| 165 |
+
|
| 166 |
+
Weihua Hu, Matthias Fey, Marinka Zitnik, Yuxiao Dong, Hongyu Ren, Bowen Liu, Michele Catasta, and Jure Leskovec. Open graph benchmark: Datasets for machine learning on graphs. arXiv preprint arXiv:2005.00687, 2020a.
|
| 167 |
+
|
| 168 |
+
Weihua Hu, Bowen Liu, Joseph Gomes, Marinka Zitnik, Percy Liang, Vijay Pande, and Jure Leskovec. Strategies for pre-training graph neural networks. In ICLR, 2020b.
|
| 169 |
+
|
| 170 |
+
Ziniu Hu, Yuxiao Dong, Kuansan Wang, Kai-Wei Chang, and Yizhou Sun. Gpt-gnn: Generative pre-training of graph neural networks. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 1857–1867, 2020c.
|
| 171 |
+
|
| 172 |
+
Max Jaderberg, Volodymyr Mnih, Wojciech Marian Czarnecki, Tom Schaul, Joel Z Leibo, David Silver, and Koray Kavukcuoglu. Reinforcement learning with unsupervised auxiliary tasks. arXiv preprint arXiv:1611.05397, 2016.
|
| 173 |
+
|
| 174 |
+
Soobeom Jang, Seong-Eun Moon, and Jong-Seok Lee. Brain signal classification via learning connectivity structure. arXiv preprint arXiv:1905.11678, 2019.
|
| 175 |
+
|
| 176 |
+
Wei Jin, Tyler Derr, Haochen Liu, Yiqi Wang, Suhang Wang, Zitao Liu, and Jiliang Tang. Self-supervised learning on graphs: Deep insights and new direction. arXiv preprint arXiv:2006.10141, 2020a.
|
| 177 |
+
|
| 178 |
+
Wei Jin, Yao Ma, Xiaorui Liu, Xianfeng Tang, Suhang Wang, and Jiliang Tang. Graph structure learning for robust graph neural networks. arXiv preprint arXiv:2005.10203, 2020b.
|
| 179 |
+
|
| 180 |
+
Daniel D Johnson, Hugo Larochelle, and Daniel Tarlow. Learning graph structure with a finite-state automaton layer. arXiv preprint arXiv:2007.04929, 2020.
|
| 181 |
+
Seyed Mehran Kazemi, Rishab Goel, Kshitij Jain, Ivan Kobyzev, Akshay Sethi, Peter Forsyth, and Pascal Poupart. Representation learning for dynamic graphs: A survey. JMLR, 2020.
|
| 182 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 183 |
+
Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In ICLR, 2017.
|
| 184 |
+
Qimai Li, Zhichao Han, and Xiao-Ming Wu. Deeper insights into graph convolutional networks for semi-supervised learning. In AAAI, 2018a.
|
| 185 |
+
Ruoyu Li, Sheng Wang, Feiyun Zhu, and Junzhou Huang. Adaptive graph convolutional neural networks. arXiv preprint arXiv:1801.03226, 2018b.
|
| 186 |
+
Lukas Liebel and Marco Korner. Auxiliary tasks in multi-task learning. ¨ arXiv preprint arXiv:1805.06334, 2018.
|
| 187 |
+
Jenny Liu, Aviral Kumar, Jimmy Ba, Jamie Kiros, and Kevin Swersky. Graph normalizing flows. In NeurIPS, pp. 13556–13566, 2019a.
|
| 188 |
+
Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692, 2019b.
|
| 189 |
+
Kenta Oono and Taiji Suzuki. Graph neural networks exponentially lose expressive power for node classification. In ICLR, 2020.
|
| 190 |
+
Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in pytorch. In NIPS-W, 2017.
|
| 191 |
+
Fabian Pedregosa, Gael Varoquaux, Alexandre Gramfort, Vincent Michel, Bertrand Thirion, Olivier ¨ Grisel, Mathieu Blondel, Peter Prettenhofer, Ron Weiss, Vincent Dubourg, et al. Scikit-learn: Machine learning in python. the Journal of machine Learning research, 12:2825–2830, 2011.
|
| 192 |
+
Shah Rukh Qasim, Jan Kieseler, Yutaro Iiyama, and Maurizio Pierini. Learning representations of irregular particle-detector geometry with distance-weighted graph networks. The European Physical Journal C, 79(7):1–11, 2019.
|
| 193 |
+
Sam T Roweis and Lawrence K Saul. Nonlinear dimensionality reduction by locally linear embedding. science, 290(5500):2323–2326, 2000.
|
| 194 |
+
Ryoma Sato. A survey on the expressive power of graph neural networks. arXiv preprint arXiv:2003.04078, 2020.
|
| 195 |
+
Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. IEEE Transactions on Neural Networks, 20(1):61–80, 2008.
|
| 196 |
+
Prithviraj Sen, Galileo Namata, Mustafa Bilgic, Lise Getoor, Brian Galligher, and Tina Eliassi-Rad. Collective classification in network data. AI magazine, 29(3):93–93, 2008.
|
| 197 |
+
Richard P Stanley. Acyclic orientations of graphs. Discrete Mathematics, 5(2):171–178, 1973.
|
| 198 |
+
Otilia Stretcu, Krishnamurthy Viswanathan, Dana Movshovitz-Attias, Emmanouil Platanios, Sujith Ravi, and Andrew Tomkins. Graph agreement models for semi-supervised learning. In Advances in Neural Information Processing Systems, pp. 8713–8723, 2019.
|
| 199 |
+
Mohammed Suhail and Leonid Sigal. Mixture-kernel graph attention network for situation recognition. In Proceedings of the IEEE International Conference on Computer Vision, pp. 10363–10372, 2019.
|
| 200 |
+
|
| 201 |
+
Joshua B Tenenbaum, Vin De Silva, and John C Langford. A global geometric framework for nonlinear dimensionality reduction. science, 290(5500):2319–2323, 2000.
|
| 202 |
+
|
| 203 |
+
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.
|
| 204 |
+
|
| 205 |
+
Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua ´ Bengio. Graph attention networks. In ICLR, 2018.
|
| 206 |
+
|
| 207 |
+
Pascal Vincent, Hugo Larochelle, Yoshua Bengio, and Pierre-Antoine Manzagol. Extracting and composing robust features with denoising autoencoders. In Proceedings of the 25th international conference on Machine learning, pp. 1096–1103, 2008.
|
| 208 |
+
|
| 209 |
+
Minjie Wang, Lingfan Yu, Da Zheng, Quan Gan, Yu Gai, Zihao Ye, Mufei Li, Jinjing Zhou, Qi Huang, Chao Ma, et al. Deep graph library: Towards efficient and scalable deep learning on graphs. arXiv preprint arXiv:1909.01315, 2019a.
|
| 210 |
+
|
| 211 |
+
Yue Wang, Yongbin Sun, Ziwei Liu, Sanjay E Sarma, Michael M Bronstein, and Justin M Solomon. Dynamic graph cnn for learning on point clouds. Acm Transactions On Graphics (tog), 38(5): 1–12, 2019b.
|
| 212 |
+
|
| 213 |
+
Xuan Wu, Lingxiao Zhao, and Leman Akoglu. A quest for structure: Jointly learning the graph structure and semi-supervised classification. In Proceedings of the 27th ACM international conference on information and knowledge management, pp. 87–96, 2018.
|
| 214 |
+
|
| 215 |
+
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In ICLR, 2019.
|
| 216 |
+
|
| 217 |
+
Liang Yang, Zesheng Kang, Xiaochun Cao, Di Jin, Bo Yang, and Yuanfang Guo. Topology optimization based graph convolutional network. In IJCAI, pp. 4054–4061, 2019.
|
| 218 |
+
|
| 219 |
+
Jiaxuan You, Rex Ying, Xiang Ren, William L Hamilton, and Jure Leskovec. Graphrnn: Generating realistic graphs with deep auto-regressive models. arXiv preprint arXiv:1802.08773, 2018.
|
| 220 |
+
|
| 221 |
+
Yuning You, Tianlong Chen, Zhangyang Wang, and Yang Shen. When does self-supervision help graph convolutional networks? arXiv preprint arXiv:2006.09136, 2020.
|
| 222 |
+
|
| 223 |
+
Donghan Yu, Ruohong Zhang, Zhengbao Jiang, Yuexin Wu, and Yiming Yang. Graph-revised convolutional network. In ECML PKDD, 2020.
|
| 224 |
+
|
| 225 |
+
Jiani Zhang, Xingjian Shi, Junyuan Xie, Hao Ma, Irwin King, and Dit-Yan Yeung. Gaan: Gated attention networks for learning on large and spatiotemporal graphs. arXiv preprint arXiv:1803.07294, 2018.
|
| 226 |
+
|
| 227 |
+
Hao Zhu, Yankai Lin, Zhiyuan Liu, Jie Fu, Tat-seng Chua, and Maosong Sun. Graph neural networks with generated parameters for relation extraction. arXiv preprint arXiv:1902.00756, 2019.
|
| 228 |
+
|
| 229 |
+
Qikui Zhu, Bo Du, and Pingkun Yan. Self-supervised training of graph convolutional networks. arXiv preprint arXiv:2006.02380, 2020.
|
| 230 |
+
|
| 231 |
+
Daniel Zugner, Amir Akbarnejad, and Stephan G ¨ unnemann. Adversarial attacks on neural networks ¨ for graph data. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 2847–2856, 2018.
|
| 232 |
+
|
| 233 |
+
# A APPENDIX
|
| 234 |
+
|
| 235 |
+
Implementation Detail: We implemented our model in PyTorch (Paszke et al., 2017), used deep graph library (DGL) (Wang et al., 2019a) for the sparse operations, and used Adam (Kingma & Ba, 2014) as the optimizer. We performed early stopping and hyperparameter tuning based on the accuracy on the validation set for all datasets except Wine and Cancer. For these two datasets, validation accuracy reached 100 percent with many hyperparameter settings, making it difficult to select the best set of hyperparameters so instead, we used the validation cross-entropy loss. We fixed the maximum number of epochs to 2000. We use two-layer GCNs for both $G N N _ { \mathrm { { C } } }$ and $\mathsf { G N N } _ { \mathsf { D A E } }$ as well as for baselines and two-layer MLPs throughout the paper (for experiments on ogbn-arxiv, although the original paper uses models with three layers and with batch normalization after each layer, to be consistent with our other experiments we used two layers and removed the normalization). We used two learning rates, one for $\mathsf { G C N } _ { \mathsf { C } }$ and one for the other parameters of the models. We tuned the two learning rates from the set $\lbrace 0 . 0 1 , 0 . 0 0 1 \rbrace$ . We added dropout layers with dropout probabilities of 0.5 after the first layer of the GNNs. We also added dropout to the adjacency matrix and tuned the values from the set $\{ 0 . 2 5 , 0 . 5 \}$ . We set the hidden dimension of $\mathsf { G N N } _ { \mathsf { C } }$ to 32 for all datasets except for ogbn-arxiv for which we set it to 256. We used cosine similarity for building the kNN graphs and tuned the value of $k$ from the set $\{ 1 5 , 2 0 , 3 0 \}$ . We tuned $\lambda$ ( $\lambda$ controls the relative importance of the two losses) from the set $\{ 0 . 1 , 1 , 1 0 , 1 0 0 \}$ . The code of our experiments will be available upon acceptance of the paper.
|
| 236 |
+
|
| 237 |
+
For GRCN (Yu et al., 2020), DGCNN (Wang et al., 2019b), and IDGL (Chen et al., 2020), we used the code released by the authors and tuned the hyperparameters as suggested in the original papers. The results of LDS (Franceschi et al., 2019) are directly taken from the original paper. All the results for our model and the baselines are averaged over 10 runs. We report the mean and standard deviation.
|
| 238 |
+
|
| 239 |
+
Dataset statistics: The statistics of the datasets used in the experiments can be found in Table 3.
|
| 240 |
+
|
| 241 |
+
Table 3: Dataset statistics.
|
| 242 |
+
|
| 243 |
+
<table><tr><td>Dataset</td><td>Nodes</td><td>Edges</td><td>Classes</td><td>Features</td><td>Label rate</td></tr><tr><td>Cora</td><td>2,708</td><td>5,429</td><td>7</td><td>1,433</td><td>0.052</td></tr><tr><td>Citeseer</td><td>3,327</td><td>4,732</td><td>6</td><td>3,703</td><td>0.036</td></tr><tr><td>Wine</td><td>178</td><td>0</td><td>3</td><td>13</td><td>0.112</td></tr><tr><td>Cancer</td><td>569</td><td>0</td><td>2</td><td>30</td><td>0.035</td></tr><tr><td>Digits</td><td>1,797</td><td>0</td><td>10</td><td>64</td><td>0.056</td></tr><tr><td>20news</td><td>9,607</td><td>0</td><td>10</td><td>236</td><td>0.021</td></tr><tr><td>Pubmed</td><td>19,717</td><td>44,338</td><td>3</td><td>500</td><td>0.003</td></tr><tr><td>ogbn-arxiv</td><td>169,343</td><td>1,166,243</td><td>40</td><td>128</td><td>0.537</td></tr></table>
|
md/train/b7ZRqEFXdQ/b7ZRqEFXdQ.md
ADDED
|
@@ -0,0 +1,361 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# IMPROVING SEQUENCE GENERATIVE ADVERSARIAL NETWORKS WITH FEATURE STATISTICS ALIGNMENT
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Generative Adversarial Networks (GAN) are facing great challenges in synthesizing sequences of discrete elements, such as mode dropping and unstable training. The binary classifier in the discriminator may limit the capacity of learning signals and thus hinder the advance of adversarial training. To address such issues, apart from the binary classification feedback, we harness a Feature Statistics Alignment (FSA) paradigm to deliver fine-grained signals in the latent high-dimensional representation space. Specifically, FSA forces the mean statistics of the fake data distribution to approach that of real data as close as possible in a finite-dimensional feature space. Experiments on synthetic and real benchmark datasets show the superior performance in quantitative evaluation and demonstrate the effectiveness of our approach to discrete sequence generation. To the best of our knowledge, the proposed architecture is the first that employs feature alignment regularization in the Gumbel-Softmax based GAN framework for sequence generation.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Unsupervised sequence generation is the cornerstone for a plethora of applications, such as machine translation (Wu et al., 2016), image captioning (Anderson et al., 2018), and dialogue generation (Li et al., 2017). The most common approach to autoregressive sequence modeling is maximizing the likelihood of each token in the sequence given the previous partial observation. However, using maximum likelihood estimation (MLE) for sequence modeling is inherently prone to the exposure bias problem (Bengio et al., 2015), which results from the discrepancy between the training and inference stage: the generator predicts the next token conditioned on its previously generated ones during inference but conditioned on its prefix ground-truth tokens during training, yielding accumulative mismatch along with the increment of generated sequence length.
|
| 12 |
+
|
| 13 |
+
Generative Adversarial Networks (GANs) (Goodfellow et al., 2014) can serve as an alternative to models trained by MLE, which have achieved promising results in generating sequences of discrete elements, in particular, language sequences (Kusner & Hernandez-Lobato, 2016; Yu et al., 2017; Lin ´ et al., 2017; Guo et al., 2018; Fedus et al., 2018; Nie et al., 2019; de Masson d’Autume et al., 2019; Zhou et al., 2020; Scialom et al., 2020). GANs consist of two competing networks: a discriminator that is trained to distinguish the generated samples from real data, and a generator that aims to generate high-quality samples to fool the discriminator.
|
| 14 |
+
|
| 15 |
+
Although having succeeded in avoiding exposure bias issues, GANs still suffer from some intrinsic problems, such as mode dropping, reward sparsity, and training instability. To enrich the informativeness of the discriminator’s training signal, several approaches have been proposed by measuring the latent features, such as feature distribution matching (Zhang et al., 2017; Chen et al., 2018) and comparative discriminators (Lin et al., 2017; Zhou et al., 2020). Zhang et al. (2017) and Chen et al. (2018) leveraged feature matching mechanism by minimizing the kernel-based moment-matching metric, such as Maximum Mean Discrepancy and Earth-Mover’s Distance, between encoded features. However, merely adopting feature matching in lieu of the original learning signal may lack some guiding feedback at the initial stage of training.
|
| 16 |
+
|
| 17 |
+
Another approach is to compare the finite latent features with comparative discriminators like ranker and relativistic discriminator. Lin et al. (2017) maintained that the binary classification in the discriminator network limits the learning capacity of tasks because the diversity and richness are circumscribed by the degenerated distribution. RankGAN (Lin et al., 2017) replaced the binary classifier with a pairwise feature ranker by comparing the similarities between sample features in the latent space. SAL (Zhou et al., 2020) classified the encoded features of constructed pairwise training examples into three categories, i.e., better / worse / indistinguishable. Nevertheless, adopting a comparative discriminator could provide the fine-grained signals for updating the generator network and may require some coarse credits for further improvements.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: (a) Standard GANs using a binary classifier as its discriminator; (b) GANs with Feature Statistics Alignment and relativistic discriminator that provide more instructive signals for updating the generator.
|
| 21 |
+
|
| 22 |
+
In this work, we propose to improve the GANs for sequence generation by jointly considering both the feature statistics matching and relativistic discriminator to serve as fine-grained and coarse learning signals respectively. We leverage the Feature Statistics Alignment (FSA) paradigm to embed the latent feature representations in a finite feature space and force the distribution of generated samples to approach the real data distribution by minimizing the distance between their respective feature representation centroids. Intuitively, matching the mean feature representations of fake and real samples could make the two data distributions closer. Besides, the relativistic discriminator (Jolicoeur-Martineau, 2019) is employed to measure the comparative information between generated and real sequences and empirically to show the effectiveness during the model training.
|
| 23 |
+
|
| 24 |
+
Our experimental results illustrate the effectiveness of FSA techniques and large batch size to alleviate the gradient vanishing problem and stabilize the training process in comparison with the vanilla Gumbel-Softmax GANs. Besides, our models could generate discrete text sequences with high quality in terms of the semantic coherence and grammatical correctness of language, as evaluated with crowdsourcing. Furthermore, we empirically demonstrate that the proposed architecture overshadows most existing models in terms of quantitative and qualitative evaluation. To the best of our knowledge, the proposed framework is the first to adopt the statistics feature alignment paradigm in the Gumbel-Softmax based GAN framework for discrete sequence generation.
|
| 25 |
+
|
| 26 |
+
# 2 ADVERSARIAL SEQUENCE GENERATION
|
| 27 |
+
|
| 28 |
+
Adversarial sequence generation has attracted broad attention for its properties to solve the exposure bias issue suffered with maximum likelihood estimation (MLE) for generating language sequences. Based on the game theory, its goal is to train a generator network $G \big ( z ; \pmb { \theta } ^ { ( G ) } \big )$ that produces samples from the data distribution $p _ { \mathrm { d a t a } } ( \pmb { x } )$ by decoding the randomly initialized noise $_ { z }$ (i.e., standard normal distribution) into the sequence $\pmb { x } = G ( \pmb { z } ; \pmb { \theta } ^ { ( G ) } )$ , where the training signal is provided by the discriminator network $D ( \pmb { x } ; \pmb { \phi } ^ { ( D ) } )$ that is trained to distinguish between the samples drawn from the real data distribution $p _ { \mathrm { d a t a } }$ and those produced by the generator. The minimax objective of adversarial training is formulated as:
|
| 29 |
+
|
| 30 |
+
$$
|
| 31 |
+
\operatorname* { m i n } _ { \theta ^ { ( G ) } } \operatorname* { m a x } _ { \phi ^ { ( D ) } } \mathbb { E } _ { \mathbf { x } \sim p _ { \mathrm { d a t a } } } \big [ \log D ( \mathbf { \boldsymbol { x } } ; \phi ^ { ( D ) } ) \big ] + \mathbb { E } _ { \mathbf { \boldsymbol { z } } \sim p _ { \mathbf { z } } } \big [ \log \big ( 1 - D _ { \phi ^ { ( D ) } } \big ( G ( \boldsymbol { z } ; \boldsymbol { \theta } ^ { ( G ) } ) \big ) \big ) \big ] .
|
| 32 |
+
$$
|
| 33 |
+
|
| 34 |
+
Despite the impressive results of GANs in the sequence generation (Yu et al., 2017; Gulrajani et al., 2017; Scialom et al., 2020), there are still several fundamental issues in the GAN training: (a) Training instability, which arises from the intrinsic nature of minimax games in GANs; (b) Mode dropping, which is the fact that GANs only generate samples with limited patterns in the real data distribution instead of attending to diverse patterns (Chen et al., 2018); (c) Reward sparsity, which is because that it is easier to train the discriminator than the generator, making it difficult to acquire the instructive feedback (Zhou et al., 2020).
|
| 35 |
+
|
| 36 |
+
Due to the non-differentiability of gradients caused by sampling operations between the generator and discriminator for sequence generation, the majority of previous works have resorted to reinforcement learning (RL) heuristics with Monte Carlo search to collect the credits from the discriminator. The usage of RL may further deteriorate the instability of model training and exacerbate the reward sparsity problem. Gumbel-Softmax relaxation has proven to be an alternative to RL techniques (Kusner & Hernandez-Lobato, 2016; Nie et al., 2019). How to efficiently train GANs with ´ the Gumbel-Softmax trick still remains under-explored. Therefore, we utilize the Gumbel-Softmax reparameterization instead of conventional policy gradients in our framework.
|
| 37 |
+
|
| 38 |
+
# 3 METHODOLOGY
|
| 39 |
+
|
| 40 |
+
As illustrated in Fig. 1, standard GANs employ the real/fake binary classifier as the discriminator, which is prone to be overtrained in comparison with the generator (Salimans et al., 2016). To prevent the discriminator from overfitting and further stabilize the training process, we propose to leverage the FSA techniques and relativistic discriminator by comparing the fake and real distributions from two different aspects.
|
| 41 |
+
|
| 42 |
+
Compared with conventional GANs, the proposed framework enjoys the following advantages: (a) In the earlier training stage, the relativistic discriminator could estimate the probability that how much better the real data is in comparison with the generated samples. This could provide the relatively “coarse” credits to the generator. (b) When it comes to the later training stage and the quality of generated samples becomes high, FSA measures the “fine-grained” difference between latent features of fake and real data batches, precluding the discriminator from being overly confident. In other words, the FSA can be regarded as a kind of regularization for adversarial training.
|
| 43 |
+
|
| 44 |
+
# 3.1 FEATURE STATISTICS ALIGNMENT
|
| 45 |
+
|
| 46 |
+
Intuitively, aligning the statistics of embedded feature representations increases the opportunities to capture the various modes of the data distribution. For brevity, we utilize the first-order mean statistics in our framework and leave the higher-order statistics for future work.
|
| 47 |
+
|
| 48 |
+
Denoting the feature extractor as $F _ { \omega }$ parameterized by $\omega$ , a minibatch of real data samples as $_ { \textbf { \em x } }$ with the batch size of $N$ , we propose two variants of FSA formulations, which calculate the mean squared difference and Euclidean distance between the minibatch centroids of real and fake feature representations. To reduce the parameter amount, we share the weights between the discriminator and feature extractor of FSA.
|
| 49 |
+
|
| 50 |
+
Mean Squared Alignment (MSA) We take the mean squared difference between the centroids of fake and generated distributions as the feature alignment metric:
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
\begin{array} { r } { \mathcal { L } _ { \mathrm { M S A } } = \left\| \mathbb { E } _ { { \pmb { x } } \sim p _ { \mathrm { d a t a } } } \big [ F _ { \omega } ( { \pmb x } ) \big ] - \mathbb { E } _ { { \pmb z } \sim p _ { \pmb z } } \big [ F _ { \omega } \big ( G ( { \pmb z } ; { \pmb \theta } ^ { ( G ) } ) \big ) \big ] \right\| _ { 2 } ^ { 2 } } \\ { = \| \displaystyle \frac { 1 } { N } \sum _ { i = 1 } ^ { N } F _ { \omega } ( \pmb x _ { i } ) - \frac { 1 } { N } \sum _ { i = 1 } ^ { N } F _ { \omega } ( G ( { \pmb z } _ { i } ; { \pmb \theta } ^ { ( G ) } ) ) \big \| _ { 2 } ^ { 2 } . } \end{array}
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
Mean Distance Alignment (MDA) Another intuitive approach is to calculate the distance between two sample centroids, which is equivalent to the square root of MSA mathematically:
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\begin{array} { r l } & { \mathcal { L } _ { \mathrm { M D A } } = \left\| \mathbb { E } _ { { \pmb { x } } \sim p _ { \mathrm { d a t a } } } \big [ F _ { \omega } ( { \pmb x } ) \big ] - \mathbb { E } _ { { \pmb z } \sim p _ { \pmb z } } \big [ F _ { \omega } \big ( { \pmb G } ( { \pmb z } ; { \pmb \theta } ^ { ( G ) } ) \big ) \big ] \right\| _ { 2 } } \\ & { \qquad = \sqrt { L _ { \mathrm { M S A } } } . } \end{array}
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
By forcing the mean statistics of fake data to be close to the real samples, the generator could receive more informative signals in the training process. It is worth noting that the large batch size is helpful to reduce the variance of small mini-batches.
|
| 63 |
+
|
| 64 |
+
# 3.2 RELATIVISTIC DISCRIMINATOR
|
| 65 |
+
|
| 66 |
+
We consider the Relativistic Discriminator (Jolicoeur-Martineau, 2019) to take into account the relative confidence that the given real data is more realistic than the randomly sampled fake data. In the standard GAN, defining the discriminator as $D ( \pmb { x } ) = \mathrm { s i g m o i d } ( H ( \pmb { x } ) )$ , where $H ( \cdot )$ represents the non-transformed layer before the final non-linearity. The objectives for the discriminator and generator in terms of the Relativistic Discriminator are defined as:
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\begin{array} { r l } & { \mathcal { L } _ { \mathrm { R D } } = - \mathbb { E } _ { { \pmb x } \sim p _ { \mathrm { d a t a } } , { \pmb z } \sim p _ { z } } [ \log a \big ( H ( { \pmb x } ) - H ( G ( { \pmb z } ; { \pmb \theta } ^ { ( G ) } ) ) \big ) ] , } \\ & { \mathcal { L } _ { \mathrm { R G } } = - \mathbb { E } _ { { \pmb x } \sim p _ { \mathrm { d a t a } } , { \pmb z } \sim p _ { z } } [ \log a \big ( H ( G ( { \pmb z } ; { \pmb \theta } ^ { ( G ) } ) ) - H ( { \pmb x } ) \big ) ] , } \end{array}
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
where $a$ represents the activation function to be relativistic (we use sigmoid function in our experiments), RD and RG denote the loss terms for the discriminator and generator respectively.
|
| 73 |
+
|
| 74 |
+
# 3.3 OVERALL TRAINING OBJECTIVES
|
| 75 |
+
|
| 76 |
+
Previous works using moment matching techniques to support the training on both the discriminator and generator (Zhang et al., 2017; Chen et al., 2018). However, the generator is always more difficult to train than the discriminator, resulting in the training instability and reward sparsity. To relieve these issues, we only adopt the FSA techniques to enhance the generator but keep the objective of the discriminator unchanged. This could pass more informative signals only to the generator, and also prevent the discriminator to be overtrained.
|
| 77 |
+
|
| 78 |
+
Therefore, the overall training objectives for the proposed framework are defined as:
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\begin{array} { r l } & { \mathcal { L } _ { \mathrm { D } } = \mathcal { L } _ { \mathrm { R D } } , } \\ & { \mathcal { L } _ { \mathrm { G } } = \mathcal { L } _ { \mathrm { R G } } + \mathcal { L } _ { \mathrm { F S A } } , } \end{array}
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
where $\mathcal { L } _ { \mathrm { F S A } }$ takes the form of $\mathcal { L } _ { \mathrm { M S A } }$ and ${ \mathcal { L } } _ { \mathrm { M D A } }$ as Eq. 2 and Eq. 4.
|
| 85 |
+
|
| 86 |
+
The goal of the discriminator is to maximize the gap between the generated and real data, whereas the generator jointly considers two different aspects simultaneously: it not only competes with the discriminator by maximizing the gap in terms of the relativistic signals but takes into account the additional leaked feature information from the discriminator. The idea of leaked features from the discriminator is similar to LeakGAN (Guo et al., 2018). The FSA term on the RHS can also be regarded as a dynamic regularizer for the sequence generator.
|
| 87 |
+
|
| 88 |
+
# 3.4 TRAINING WITH DISCRETE SEQUENCE
|
| 89 |
+
|
| 90 |
+
# 3.4.1 GUMBEL-SOFTMAX DISTRIBUTION
|
| 91 |
+
|
| 92 |
+
Conventional GANs for generating discrete sequences are inherently unable to backpropagate the gradient through samples due to the non-differentiable sampling from a categorical distribution. Gumbel-Softmax distribution (Jang et al., 2017; Maddison et al., 2017) was proposed to deal with this issue by smoothly annealed to approximate the categorical distribution.
|
| 93 |
+
|
| 94 |
+
Denoting the output probabilities $\pi _ { 1 } , \pi _ { 2 } , \cdots , \pi _ { | V | }$ , where $| V |$ represents the output vocabulary size in the generator, the Gumbel-Max trick (Maddison et al., 2014) can be parameterized as:
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
y _ { i } = \mathrm { o n e } \mathrm { . h o t } \big ( \arg \operatorname* { m a x } _ { i } [ g _ { i } + \log \pi _ { i } ] \big ) \quad \mathrm { ~ f o r ~ } i = 1 , \cdots , | V | ,
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
where $\{ g _ { i } | i = 1 , \cdots , | V | \}$ are i.i.d from the Gumbel(0,1) distribution, that is, $g _ { i } = - \log ( - \log u _ { i } )$ with $u _ { i }$ is drawn from a standard uniform distribution Uniform(0,1). one hot represents the $| V |$ - dimensional one hot encoding.
|
| 101 |
+
|
| 102 |
+
Gumbel-Softmax approximates the non-differential arg max operation using the softmax function:
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\hat { y } _ { i } = \frac { \exp \left( ( \log ( \pi _ { i } ) + g _ { i } ) / \tau \right) } { \sum _ { j = 1 } ^ { | V | } \exp \left( ( \log ( \pi _ { j } ) + g _ { j } ) / \tau \right) } , \quad \mathrm { ~ f o r ~ } i = 1 , \cdots , | V | ,
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
where $\tau$ denotes the softmax temperature to modulate the exploitation and exploration during training. When $\tau$ approaches too high, the approximation is nearly equiprobable, encouraging the generator to explore different options. In contrast, the lower $\tau$ could discourage the exploration and tend to exploit during training. In particular, when $\tau 0$ , $\hat { y } _ { i }$ approaches the result of one hot operator as in Eq. 10, whereas $\hat { y } _ { i }$ will degenerated into a uniform distribution when $\tau \infty$ .
|
| 109 |
+
|
| 110 |
+
# 3.4.2 ARCHITECTURE AND ADVERSARIAL TRAINING
|
| 111 |
+
|
| 112 |
+
RNN Generator Due to the free-running mode of GAN’s generator, it is unsuitable to adopt the transformer-based models due to the non-recurrence nature. Thus, we investigate the Recurrent Neural Network (RNN) based models, such as Long Short-Term Memory (LSTM) (Hochreiter & Schmidhuber, 1997), and Relational Memory Core (RMC) (Santoro et al., 2018).
|
| 113 |
+
|
| 114 |
+
CNN Discriminator & Feature Extractor We use the convolutional neural networks (CNN) architecture (Kim, 2014) as the discriminator and feature extractor for input sequences. We employ the multi-channel convolution using multiple filters with various window sizes to extract the distinct n-gram features, followed by a max-over-time pooling operation to gather the most salient features, i.e., features with the highest value for each feature map.
|
| 115 |
+
|
| 116 |
+
Adversarial Training Algorithm Alg. 1 illustrates the overall training process of the proposed framework. The Relativistic Discriminator and the generator could reach the Nash Equilibrium when the generator could fool the discriminator into accepting its output as being true. Since the discriminator is easy to be overtrained, we do not pretrain the discriminator but only pretrain the generator using MLE for few epochs.
|
| 117 |
+
|
| 118 |
+
1: Require: generator $G _ { \theta }$ ; discriminator $D _ { \phi }$ ; samples of real data $\mathbb { S }$ ; generator training step $g$ ;
|
| 119 |
+
discriminator training step $k$ ; the generator pretraining epochs $m$ .
|
| 120 |
+
2: Pretrain $G _ { \theta }$ using MLE on $\mathbb { S }$ for $m$ epochs
|
| 121 |
+
3: repeat
|
| 122 |
+
4: for $g$ steps do
|
| 123 |
+
5: Sample a minibatch from real data $\mathbb { S }$
|
| 124 |
+
6: Generate a minibatch of samples $\mathbf { \boldsymbol { x } } _ { g } \sim G _ { \theta }$
|
| 125 |
+
7: Update $G _ { \theta }$ via Eq.(9)
|
| 126 |
+
8: end for
|
| 127 |
+
9: for $k$ steps do
|
| 128 |
+
10: Sample a minibatch from real data $\mathbb { S }$
|
| 129 |
+
11: Sample a minibatch from the generated data
|
| 130 |
+
12: Train the discriminator $D _ { \phi }$ by Eq.(8)
|
| 131 |
+
13: end for
|
| 132 |
+
14: until convergence
|
| 133 |
+
|
| 134 |
+
# 4 EXPERIMENTS
|
| 135 |
+
|
| 136 |
+
# 4.1 EXPERIMENTAL SETTING
|
| 137 |
+
|
| 138 |
+
Similar to (Lin et al., 2017; Guo et al., 2018; Nie et al., 2019; Zhou et al., 2020), we evaluate the proposed framework based on the Texygen benchmark platform (Zhu et al., 2018) for adversarial text generation. Experiments were conducted on the synthetic and real datasets: (a) synthetic data, which is generated by an oracle single-layer LSTM as in (Yu et al., 2017); (b) MS COCO Image Caption dataset (Chen et al., 2015); (c) EMNLP WMT 2017 News dataset (Guo et al., 2018). Table 1 summarizes the statistics of benchmark datasets for evaluation.
|
| 139 |
+
|
| 140 |
+
Algorithm 1 Adversarial Training with Feature Statisitcs Alignment
|
| 141 |
+
Table 1: Summary of experimental datasets.
|
| 142 |
+
|
| 143 |
+
<table><tr><td>dataset</td><td>vocabulary size</td><td> sequence length</td><td>training set</td><td>test set</td></tr><tr><td>synthetic data</td><td>5,000</td><td>20/40</td><td>10,000</td><td>10,000</td></tr><tr><td>MS COCO</td><td>4,657</td><td>37</td><td>10,000</td><td>10,000</td></tr><tr><td>EMNLP2017 WMT News</td><td>5,255</td><td>51</td><td>27,8586</td><td>10,000</td></tr></table>
|
| 144 |
+
|
| 145 |
+
For the synthetic data experiments, we utilize a single-layer LSTM initialized by the standard normal distribution as the oracle model, which is used to generate 10,000 samples of length 20 and 40 respectively as the real samples. We use the negative log-likelihood (NLL) under the oracle data distribution for evaluation, termed $\mathrm { N L L } _ { \mathrm { o r a c l e } }$ . For the real data experiments, the BLEU score (Papineni et al., 2002) serves as a metric to evaluate the n-gram statistics overlapping on the whole dataset.
|
| 146 |
+
|
| 147 |
+
To measure the diversity of generated samples, the NLL of the generator (denoted as ${ \mathrm { N L L } } _ { \mathrm { g e n . } }$ ) is used by computing the NLL of reference samples in the test set by the generator. Considering that BLEU scores always focus on the local text statistics and may be insufficient for evaluating the overall quality of texts, we conducted additional human evaluation via crowdsourcing on the generated samples of all comparison models. See Appendix A for more experimental details.
|
| 148 |
+
|
| 149 |
+
We compare the proposed framework with the MLE baseline and other state-of-the-art models, involving SeqGAN (Yu et al., 2017), RankGAN (Lin et al., 2017), LeakGAN (Guo et al., 2018), RelGAN (Nie et al., 2019), and Self-Adversarial Learning (SAL) (Zhou et al., 2020).
|
| 150 |
+
|
| 151 |
+
# 4.2 EXPERIMENTAL RESULTS
|
| 152 |
+
|
| 153 |
+
# 4.2.1 SYNTHETIC DATA
|
| 154 |
+
|
| 155 |
+
Table 2 illustrates the performance of different models on NLLoracle. Since our experiments achieved better results using MSA instead of MDA on synthetic data, we only report the optimal results with MSA in Table 2. Our models outperform other prevalent adversarial models in terms of the generated sample quality, demonstrating the effectiveness of our proposed method.
|
| 156 |
+
|
| 157 |
+
In practice, we found that the LSTM generator could outperform the RMC generator for producing the sequence with the length of 20, whereas RMC generators exceed LSTMs for long sequence generation. This may be due to the fact that LSTMs may forget the long-term dependencies with the sequence length increases, but the self-attention based relational memory cell in RMC could mitigate the issues using interactive memory slots. This demonstrates that the proposed model could produce samples with high quality. As to the diversity, our method achieves competitive ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ score compared with baselines models (see Appendix C.1 for the detail).
|
| 158 |
+
|
| 159 |
+
Table 2: The $\mathrm { N L L } _ { \mathrm { o r a c l e } }$ performance of different models $\tau = 1$ ) on the synthetic dataset with the sequence length of 20 and 40 respectively. For NLL, the lower, the better.
|
| 160 |
+
|
| 161 |
+
<table><tr><td>Length</td><td>MLE</td><td>SeqGAN</td><td>RankGAN</td><td>LeakGAN</td><td>RelGAN</td><td>SAL</td><td>Ours (LSTM)</td><td>Ours (RMC)</td><td>Real</td></tr><tr><td>20</td><td>9.038</td><td>8.736</td><td>8.247</td><td>7.038</td><td>6.680</td><td>7.71</td><td>5.047</td><td>5.819</td><td>5.750</td></tr><tr><td>40</td><td>10.411</td><td>10.310</td><td>9.958</td><td>7.191</td><td>6.765</td><td>9.31</td><td>5.909</td><td>5.087</td><td>4.071</td></tr></table>
|
| 162 |
+
|
| 163 |
+
# 4.2.2 MS COCO DATASET
|
| 164 |
+
|
| 165 |
+
To further test the performance on the real data, we run and evaluate our model on MS COCO image caption datasets. The data and preprocessing remain the same as in Texygen (Zhu et al., 2018). Empirically, we found that RMC achieves better results in terms of the long sequences, and thus reports the results using the RMC generator if not otherwise specified.
|
| 166 |
+
|
| 167 |
+
Table 3: BLEU and ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ performance on MS COCO image captions with $\tau \ : = \ : 0 . 1$ for the proposed models with MSA and MDA. For BLEU scores, the higher, the better.
|
| 168 |
+
|
| 169 |
+
<table><tr><td>Model</td><td>BLEU-2</td><td>BLEU-3</td><td>BLEU-4</td><td>BLEU-5</td><td>NLLgen</td></tr><tr><td>MLE</td><td>0.731</td><td>0.497</td><td>0.305</td><td>0.189</td><td>0.718</td></tr><tr><td>SeqGAN</td><td>0.745</td><td>0.498</td><td>0.294</td><td>0.180</td><td>1.082</td></tr><tr><td>RankGAN</td><td>0.743</td><td>0.467</td><td>0.264</td><td>0.156</td><td>1.344</td></tr><tr><td>LeakGAN</td><td>0.746</td><td>0.528</td><td>0.355</td><td>0.230</td><td>0.679</td></tr><tr><td>RelGAN</td><td>0.849</td><td>0.687</td><td>0.502</td><td>0.331</td><td>0.756</td></tr><tr><td>SAL</td><td>0.785</td><td>0.581</td><td>0.362</td><td>0.227</td><td>0.873</td></tr><tr><td>Ours (MSA)</td><td>0.959</td><td>0.866</td><td>0.759</td><td>0.630</td><td>0.760</td></tr><tr><td>Ours (MDA)</td><td>0.938</td><td>0.863</td><td>0.731</td><td>0.582</td><td>0.717</td></tr></table>
|
| 170 |
+
|
| 171 |
+
Table 3 exhibits the final results of the BLEU and ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ scores on different comparison models. Our models reported in Table 3 set the softmax temperature as 0.1 for the model with MSA and that with MDA. Notably, our model shows the significant improvement on previous methods, consistently overshadowing the state-of-the-art models in terms of the sample quality (indicated by BLEU scores) while maintaining the diversity (indicated by $\mathrm { N L L _ { g e n } } ,$ ).
|
| 172 |
+
|
| 173 |
+
# 4.2.3 EMNLP2017 WMT NEWS DATASET
|
| 174 |
+
|
| 175 |
+
Table 4 presents the considerable improvements of our model (w.r.t. quality) on EMNLP2017 WMT News dataset, with the temperature of 1 for models with MSA and MDA. The maximum length in the EMNLP2017 dataset is 51, greatly challenging the generation task.
|
| 176 |
+
|
| 177 |
+
It can be observed that only RankGAN and LeakGAN slightly outrank the MLE in terms of the ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ , which may be due to the fact that feature ranking or leakage information could pass more internal information from the discriminator to the generator, and thereby smoothly assist the training process of the generator. By leveraging the FSA methods, our model greatly outperforms these models and yielding the long sequences with promising qualities.
|
| 178 |
+
|
| 179 |
+
Table 4: The BLEU and ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ performance on EMNLP2017 WMT News dataset with temperatures of 1 for the proposed models with MSA and MDA.
|
| 180 |
+
|
| 181 |
+
<table><tr><td>Model</td><td>BLEU-2</td><td>BLEU-3</td><td>BLEU-4</td><td>BLEU-5</td><td>NLLgen</td></tr><tr><td>MLE</td><td>0.768</td><td>0.473</td><td>0.240</td><td>0.126</td><td>2.382</td></tr><tr><td>SeqGAN</td><td>0.777</td><td>0.491</td><td>0.261</td><td>0.138</td><td>2.773</td></tr><tr><td>RankGAN</td><td>0.727</td><td>0.435</td><td>0.209</td><td>0.101</td><td>3.345</td></tr><tr><td>LeakGAN</td><td>0.826</td><td>0.645</td><td>0.437</td><td>0.272</td><td>2.356</td></tr><tr><td>RelGAN</td><td>0.881</td><td>0.705</td><td>0.501</td><td>0.319</td><td>2.482</td></tr><tr><td>SAL</td><td>0.788</td><td>0.523</td><td>0.281</td><td>0.149</td><td>2.578</td></tr><tr><td>Ours (MSA)</td><td>0.932</td><td>0.798</td><td>0.585</td><td>0.404</td><td>3.999</td></tr><tr><td>Ours (MDA)</td><td>0.916</td><td>0.784</td><td>0.592</td><td>0.386</td><td>2.732</td></tr></table>
|
| 182 |
+
|
| 183 |
+
Apart from the automatic quantitative evaluation, we also conducted human evaluation on the MS COCO Image Captioning dataset. We randomly sampled 100 sentences for each model and the real data, then asked 12 different people to score them on the scale of 1-5 with anonymizing the model’s identity. Please see Appendix. C.2 for more details of human evaluation.
|
| 184 |
+
|
| 185 |
+
Our models received the highest score in comparison with other models, where the model with MSA receives higher credits than that with MDA. By manually going through the generated samples, we found that models with MSA tend to generate long sentences with higher quality but run into the mode dropping issue. In contrast, models with MDA posses a better trade-off between the diversity and quality of samples, yielding promising results in comparison with previous models.
|
| 186 |
+
|
| 187 |
+
Table 5: Mean and standard deviation results of human evaluation w.r.t different models on MS COCO Image Caption dataset. Note that “Real” indicates the real data samples.
|
| 188 |
+
|
| 189 |
+
<table><tr><td>Model</td><td>MLE</td><td>SeqGAN</td><td>RankGAN</td><td>LeakGAN</td><td>MaliGAN</td></tr><tr><td>Human score</td><td>3.127 ± 0.124</td><td>3.062 ± 0.100</td><td>3.048 ± 0.127</td><td>3.018 ± 0.104</td><td>3.031 ± 0.123</td></tr><tr><td>Model</td><td>TextGAN</td><td>RelGAN</td><td>Ours (MSA)</td><td>Ours (MDA)</td><td>Real</td></tr><tr><td>Human score</td><td>1.973 ± 0.168</td><td>3.687 ± 0.181</td><td>4.209 ± 0.245</td><td>3.878 ± 0.276</td><td>3.444 ± 0.122</td></tr></table>
|
| 190 |
+
|
| 191 |
+
# 4.3 DISCUSSION
|
| 192 |
+
|
| 193 |
+
Fig. 2 (Left) illustrates the ablation test of FSA in terms of the BLEU-4 score (See Appendix D.2 for all the results). It can be observed that the increasing trend for models with FSA outreached that w/o feature alignment mechanism and our models achieve superior performance in the later training stage. The utilization of FSA leads to significant performance gains, as it could provide the consecutive “fined-grained” smoother learning signals to update the generator.
|
| 194 |
+
|
| 195 |
+
Fig. 3 demonstrates the relative importance of each component of our models with an ablation test. The usage of FSA results in the most significant performance gain, followed by Gumbel-Softmax, and large batch size. A large batch size can boost the performance due to the variance reduction, accurate estimates of feature statistics, and stabilizing effect during the adversarial training (see Fig. 2 (Right)).
|
| 196 |
+
|
| 197 |
+
As to the Gumbel-Softmax trick, we conduct experiments on various temperature values and find that a fined-tuned temperature hyperparameter could account for the second important factor to contribute to the overall performance boost. Please check Appendix D.3 for the detailed results w.r.t the Gumbel-Softmax temperature.
|
| 198 |
+
|
| 199 |
+

|
| 200 |
+
Figure 2: (Left) BLEU-4 scores of the proposed model w/ and w/o FSA mechanism. (Right) BLEU4 scores of the proposed models with various batch size (64 v.s. 128). The vertical dash lines indicate the end of generator pretraining. MS COCO results unless otherwise specified.
|
| 201 |
+
|
| 202 |
+
# 5 RELATED WORK
|
| 203 |
+
|
| 204 |
+
There has been a large category of GANs for sequence generation, which heavily rely on the RL paradigm. SeqGAN (Yu et al., 2017) regards the sequence generation as a Markov decision making process, estimates the rewards via Monte Carlo search, and trains the generator with policy gradient. RankGAN (Lin et al., 2017) and SAL (Zhou et al., 2020) replace the binary classifier in the discriminator as comparative discriminators to take into account the re
|
| 205 |
+
|
| 206 |
+

|
| 207 |
+
Figure 3: Ablation Study of the proposed model.
|
| 208 |
+
|
| 209 |
+
lation between constructed pair samples. MaliGAN (Che et al., 2017) utilizes the information in the discriminator as an additional source of training signals on the MLE objective to reduce the variance of gradients. LeakGAN (Guo et al., 2018) leaks the intermediate feature information via a manager to guide the generator, which is inspired by hierarchical RL. ColdGAN (Scialom et al., 2020) integrates the advance of importance sampling, Proximal Policy Optimization (PPO) algorithm (Schulman et al., 2017), and nucleus sampling (Holtzman et al., 2019) for finetuning the pretrained T5 (Raffel et al., 2019) and BART (Lewis et al., 2019).
|
| 210 |
+
|
| 211 |
+
Another approach applies non-RL methods for adversarial sequence generation by either approximating the categorical sampling or directly using the continuous latent representation. TextGAN (Zhang et al., 2017) uses feature matching techniques via a kernelized discrepancy in the Reproducing Kernel Hilbert Space. FMGAN (Chen et al., 2018) proposes to match the feature distributions using a Feature-Mover’s Distance. Similar to our proposed model, both of them apply annealed soft-argmax for approximation. ARAML Ke et al. (2019) utilizes Reward Augmented Maximum Likelihood by sampling from the stationary distribution to acquire rewards. However, none of them adopt the Gumbel-Max trick to reparameterize the categorical sampling. Besides, they applied feature matching as the training objectives of both the discriminator and generator, whereas we only apply the feature statistics matching to modulate the generator. Gumbel-Softmax (GS) GAN (Kusner & Hernandez-Lobato, 2016) and RelGAN (Nie et al., 2019) prove the effectiveness ´ of Gumbel-Softmax on unsupervised sequence generation. DialogeWAR Gu et al. (2018) employs a GS GAN within the latent variable space for dialogue generation. However, improving the training of GS GANs still remains an open problem. Our model aims to promote the GS GAN with the proposed FSA and other techniques to boost the training of language GANs. We also report a list of other techniques we tried but proved to be unsuccessful or unnecessary in Appendix B.
|
| 212 |
+
|
| 213 |
+
# 6 CONCLUSION
|
| 214 |
+
|
| 215 |
+
We propose an adversarial training framework for discrete sequence generation, by leveraging the advance of Feature Statistics Alignment and Gumbel-Softmax relaxation. Our model empirically shows superior performance in terms of the quantitative and human evaluation. In the future, it would be a promising direction to extend the proposed model to conditional text generation, such as text style transfer.
|
| 216 |
+
|
| 217 |
+
# REFERENCES
|
| 218 |
+
|
| 219 |
+
Peter Anderson, Xiaodong He, Chris Buehler, Damien Teney, Mark Johnson, Stephen Gould, and Lei Zhang. Bottom-up and top-down attention for image captioning and visual question answering. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 6077–6086, 2018.
|
| 220 |
+
|
| 221 |
+
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.
|
| 222 |
+
|
| 223 |
+
Tong Che, Yanran Li, R. Zhang, R. Devon Hjelm, W. Li, Y. Song, and Yoshua Bengio. Maximumlikelihood augmented discrete generative adversarial networks. ArXiv, abs/1702.07983, 2017.
|
| 224 |
+
|
| 225 |
+
Liqun Chen, Shuyang Dai, Chenyang Tao, Dinghan Shen, Zhe Gan, H. Zhang, Yizhe Zhang, and L. Carin. Adversarial text generation via feature-mover’s distance. ArXiv, abs/1809.06297, 2018.
|
| 226 |
+
|
| 227 |
+
Xinlei Chen, Hao Fang, Tsung-Yi Lin, Ramakrishna Vedantam, Saurabh Gupta, Piotr Dollar, and ´ C Lawrence Zitnick. Microsoft coco captions: Data collection and evaluation server. arXiv preprint arXiv:1504.00325, 2015.
|
| 228 |
+
|
| 229 |
+
Cyprien de Masson d’Autume, Mihaela Rosca, Jack W. Rae, and Shakir Mohamed. Training language gans from scratch. ArXiv, abs/1905.09922, 2019.
|
| 230 |
+
|
| 231 |
+
William Fedus, Ian Goodfellow, and Andrew M Dai. Maskgan: Better text generation via filling in the . arXiv preprint arXiv:1801.07736, 2018.
|
| 232 |
+
|
| 233 |
+
Ian J. Goodfellow, Jean Pouget-Abadie, M. Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron C. Courville, and Yoshua Bengio. Generative adversarial nets. In NIPS, 2014.
|
| 234 |
+
|
| 235 |
+
Xiaodong Gu, Kyunghyun Cho, Jung-Woo Ha, and Sunghun Kim. Dialogwae: Multimodal response generation with conditional wasserstein auto-encoder. arXiv preprint arXiv:1805.12352, 2018.
|
| 236 |
+
|
| 237 |
+
Ishaan Gulrajani, F. Ahmed, Mart´ın Arjovsky, Vincent Dumoulin, and Aaron C. Courville. Improved training of wasserstein gans. In NIPS, 2017.
|
| 238 |
+
|
| 239 |
+
Jiaxian Guo, S. Lu, Han Cai, W. Zhang, Y. Yu, and J. Wang. Long text generation via adversarial training with leaked information. ArXiv, abs/1709.08624, 2018.
|
| 240 |
+
|
| 241 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 242 |
+
|
| 243 |
+
Ari Holtzman, Jan Buys, Li Du, Maxwell Forbes, and Yejin Choi. The curious case of neural text degeneration. arXiv preprint arXiv:1904.09751, 2019.
|
| 244 |
+
|
| 245 |
+
Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. ArXiv, abs/1611.01144, 2017.
|
| 246 |
+
|
| 247 |
+
Alexia Jolicoeur-Martineau. The relativistic discriminator: a key element missing from standard gan. ArXiv, abs/1807.00734, 2019.
|
| 248 |
+
|
| 249 |
+
Pei Ke, Fei Huang, Minlie Huang, and Xiaoyan Zhu. Araml: A stable adversarial training framework for text generation. arXiv preprint arXiv:1908.07195, 2019.
|
| 250 |
+
|
| 251 |
+
Yoon Kim. Convolutional neural networks for sentence classification. arXiv preprint arXiv:1408.5882, 2014.
|
| 252 |
+
|
| 253 |
+
Matt J. Kusner and Jose Miguel Hern ´ andez-Lobato. Gans for sequences of discrete elements with ´ the gumbel-softmax distribution. ArXiv, abs/1611.04051, 2016.
|
| 254 |
+
|
| 255 |
+
Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Ves Stoyanov, and Luke Zettlemoyer. Bart: Denoising sequence-to-sequence pretraining for natural language generation, translation, and comprehension. arXiv preprint arXiv:1910.13461, 2019.
|
| 256 |
+
|
| 257 |
+
Jiwei Li, Will Monroe, Tianlin Shi, Sebastien Jean, Alan Ritter, and Dan Jurafsky. Adversarial´ learning for neural dialogue generation. arXiv preprint arXiv:1701.06547, 2017.
|
| 258 |
+
Kevin Lin, Dianqi Li, Xiaodong He, M. Sun, and Zhengyou Zhang. Adversarial ranking for language generation. ArXiv, abs/1705.11001, 2017.
|
| 259 |
+
Chris J Maddison, Daniel Tarlow, and Tom Minka. A\* sampling. In Advances in Neural Information Processing Systems, pp. 3086–3094, 2014.
|
| 260 |
+
Chris J. Maddison, A. Mnih, and Y. Teh. The concrete distribution: A continuous relaxation of discrete random variables. ArXiv, abs/1611.00712, 2017.
|
| 261 |
+
Weili Nie, Nina Narodytska, and Ankit B. Patel. Relgan: Relational generative adversarial networks for text generation. In ICLR, 2019.
|
| 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 of the Association for Computational Linguistics, pp. 311–318, 2002.
|
| 263 |
+
Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. arXiv preprint arXiv:1910.10683, 2019.
|
| 264 |
+
Tim Salimans, Ian J. Goodfellow, W. Zaremba, Vicki Cheung, A. Radford, and Xi Chen. Improved techniques for training gans. ArXiv, abs/1606.03498, 2016.
|
| 265 |
+
Adam Santoro, Ryan Faulkner, David Raposo, Jack Rae, Mike Chrzanowski, Theophane Weber, Daan Wierstra, Oriol Vinyals, Razvan Pascanu, and Timothy Lillicrap. Relational recurrent neural networks. In Advances in neural information processing systems, pp. 7299–7310, 2018.
|
| 266 |
+
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
|
| 267 |
+
Thomas Scialom, Paul-Alexis Dray, Sylvain Lamprier, Benjamin Piwowarski, and Jacopo Staiano. Coldgans: Taming language gans with cautious sampling strategies. ArXiv, abs/2006.04643, 2020.
|
| 268 |
+
Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, et al. Google’s neural machine translation system: Bridging the gap between human and machine translation. arXiv preprint arXiv:1609.08144, 2016.
|
| 269 |
+
Lantao Yu, W. Zhang, J. Wang, and Y. Yu. Seqgan: Sequence generative adversarial nets with policy gradient. In AAAI, 2017.
|
| 270 |
+
Yizhe Zhang, Zhe Gan, K. Fan, Z. Chen, Ricardo Henao, Dinghan Shen, and L. Carin. Adversarial feature matching for text generation. In ICML, 2017.
|
| 271 |
+
Wangchunshu Zhou, Tao Ge, Ke Xu, Furu Wei, and M. Zhou. Self-adversarial learning with comparative discrimination for text generation. ArXiv, abs/2001.11691, 2020.
|
| 272 |
+
Yaoming Zhu, S. Lu, L. Zheng, Jiaxian Guo, W. Zhang, J. Wang, and Y. Yu. Texygen: A benchmarking platform for text generation models. The 41st International ACM SIGIR Conference on Research Development in Information Retrieval, 2018.
|
| 273 |
+
|
| 274 |
+
# A EXPERIMENTAL DETAILS
|
| 275 |
+
|
| 276 |
+
A.1 TRAINING DETAILS
|
| 277 |
+
|
| 278 |
+
Generator The input embedding dimension for the generator is set to 32. As for the LSTM generator, we use the single-layer LSTM with the hidden dimension of 32. Then adopt a linear transformation to get the logits at each time step, and iteratively feed the sampled output tokens into the generator at the next time step. As for the RMC generator, we follow the experimental settings as (Nie et al., 2019), setting the memory size as 256, memory slots as 1, attention head number as 2. After the one-layer RMC, a linear projection is applied to get the output logits at each step.
|
| 279 |
+
|
| 280 |
+
CNN Discriminator The input embedding dimension for the discriminator is set to 64. We adopt the filter size of $\{ 2 , 3 , 4 , 5 \}$ with the number of 300 channels for each. A max-over-time pooling is adopted after the convolution layer. Afterward, a highway layer that is identical to SeqGAN (Yu et al., 2017) is used followed by a linear transformation with the dimension of 100. Finally, apply a linear transformation to get the final logits. The feature extractor for Feature Statistics Alignment shares the identical architecture and weights with the CNN discriminator, and the leaked feature dimension is set to 100.
|
| 281 |
+
|
| 282 |
+
Optimization We use Adam optimizer with $\beta _ { 1 } = 0 . 9$ and $\beta _ { 2 } = 0 . 9 9 9$ . The initial learning rate for the generator was set to 1e-2 and 1e-4 for pretraining and adversarial training. We set the initial learning rate as 1e-4 for the discriminator during the adversarial training. To prevent overfitting, we clip the gradients of parameters whose $\mathrm { L _ { 2 } }$ norm exceeds 5.
|
| 283 |
+
|
| 284 |
+
Training Procedure We conduct experiments to finetune the following experiments: the batch size of $\{ 3 2 , 6 4 , 1 2 8 \}$ , the Gumbel-Softmax temperature $\tau \in \{ 1 , 0 . 5 , 0 . 1 , 0 . 0 1 . 0 . 0 0 1 \}$ . The training steps of generator and discriminators are set to $g = 1$ and $d = 5$ , respectively. The generator is pretrained for 150 epochs before adversarial training. Finally, the optimal batch size is set to 128 for both synthetic and real datasets. It is worth noting that we also test the batch size to 256, which requires too much GPU resource but do not show obvious improvement.
|
| 285 |
+
|
| 286 |
+
# B NEGATIVE RESULTS
|
| 287 |
+
|
| 288 |
+
Here we list some approaches that we tried but proved unsuccessful:
|
| 289 |
+
|
| 290 |
+
• Using Mogrifier LSTM as the generator, which achieves similar results as vanilla LSTMs on the synthetic data. Using a Wasserstein loss instead of current Relativistic Discriminator. Not as stable as current solutions. Using the Transformer model as the discriminator. It achieves unsatisfied results with the current experimental settings. Using interleaved training instead of two-stage training, i.e., adversarial training after pretraining. It is unsuccessful to train the generator for 15 iterations after one iteration using MLE.
|
| 291 |
+
• Using top- $\mathbf { \nabla } \cdot \mathbf { k }$ sampling and nucleus sampling, instead of the argmax in the Gumbel-Max trick. This does not always boost the final performance.
|
| 292 |
+
• Using a hinge loss on the discriminator. This did not improve over the current relativistic loss.
|
| 293 |
+
|
| 294 |
+
# C EVALUATION DETAILS
|
| 295 |
+
|
| 296 |
+
# C.1 $\mathrm { N L L } _ { \mathrm { G E N } }$ ON SYNTHETIC DATA
|
| 297 |
+
|
| 298 |
+
Table 6 reports the ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ metric of comparison models. It can be seen that the proposed model with RMC generator achieves comparative results in comparison with baselines in terms of both short and long texts.
|
| 299 |
+
|
| 300 |
+
Table 6: The ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ performance of different models $\mathit { \Pi } ( \tau = 1 )$ ) on the synthetic dataset with the sequence length of 20 and 40 respectively. For the NLL score, the lower, the better.
|
| 301 |
+
|
| 302 |
+
<table><tr><td>Length</td><td>MLE</td><td>SeqGAN</td><td>RankGAN</td><td>SAL</td><td>Ours (LSTM)</td><td>Ours (RMC)</td></tr><tr><td>20</td><td>5.96</td><td>6.61</td><td>7.14</td><td>6.58</td><td>7.73</td><td>5.12</td></tr><tr><td>40</td><td>6.55</td><td>6.98</td><td>7.05</td><td>6.97</td><td>7.59</td><td>6.89</td></tr></table>
|
| 303 |
+
|
| 304 |
+
# C.2 HUMAN EVALUATION
|
| 305 |
+
|
| 306 |
+
Acceptance (i.e. if a sentence is acceptable), grammaticality (i.e., if a sentence is grammatically correct), and meaningfulness (i.e., if a sentence makes sense) are three main standards for the text quality evaluation. Please note that any minor text formatting issues which will not negatively influence the understanding and correctness of the sentences (e.g., punctuation, capitalization, spelling errors, extra spaces) can be ignored. Please also note: a sentence consists of less than 10 words should get one point deducted. Table 7 below gives more detailed criteria.
|
| 307 |
+
|
| 308 |
+
It is worth to mention that the human evaluation is used to measure the quality of generated sentences rather than the diversity.
|
| 309 |
+
|
| 310 |
+
Table 7: The human evaluation scale from 1 to 5 with corresponding criteria and example sentences.
|
| 311 |
+
|
| 312 |
+
<table><tr><td>Scale</td><td>Criterion&Example</td></tr><tr><td>5 -Excellent</td><td>Grammatical,acceptable,and meaningful. For example,“a man is carving under yellow planes ."</td></tr><tr><td>4-Good</td><td>Include 1 to 2 tiny grammatical errors,and the whole sentence is mostly acceptable and meaningful.For example,“two giraffe standing in front of them."</td></tr><tr><td>3-Fair</td><td>Include major grammatical errors, but the whole sentence is still acceptable and making sense.For example,“a kitchen with a grill roll from him .”</td></tr><tr><td>2-Poor</td><td>Include severe grammatical errors,and the whole sentence does not make sense,but some parts are still acceptable.For example,“a motorcycle on a paved road on the freeway "</td></tr><tr><td>1 - Unacceptable</td><td>It is basically a string of words with random order and totally ungrammatical.The entire sentence does not make any sense.For example,“a city ."</td></tr></table>
|
| 313 |
+
|
| 314 |
+
# C.3 HUMAN EVALUATION ANALYSIS
|
| 315 |
+
|
| 316 |
+
The model with MSA tends to generate grammatically correct sentences, and the sentences tend to be longer. For example, “A man is sitting on a motorcycle on a busy street, in a city.” Though it produces the samples with high quality by human evaluation, however, it does not solve the mode dropping collapse.
|
| 317 |
+
|
| 318 |
+
In contrast, models with MDA tend to generate a more variety of sentences rather than repeated ones. Most sentences are grammatically correct and meaningful. They follow the SVO sentence structure with Preposition Phrase (PP) placed at the acceptable position in a sentence. Even though some of the auxiliary or main action verbs are missing, the meaning of each sentence can still be understandable and making sense. There is no obvious mode dropping issues according to the generated samples of MDA.
|
| 319 |
+
|
| 320 |
+
# D DETAILED RESULTS OF ABLATION STUDY
|
| 321 |
+
|
| 322 |
+
D.1 IMPACT OF FEATURE STATISTICS ALIGNMENT
|
| 323 |
+
|
| 324 |
+
See Fig. 4 for the results of the ablation study on FSA techniques.
|
| 325 |
+
|
| 326 |
+
# D.2 IMPACT OF LARGE BATCH SIZE
|
| 327 |
+
|
| 328 |
+
Fig. 5 shows the training curve of our model on various batch sizes. It is observed that the increase of batch size could provide the performance boost, due to the variance reduction of gradients and the stability of adversarial dynamics.
|
| 329 |
+
|
| 330 |
+

|
| 331 |
+
Figure 4: Training curves of BLEU scores on MS COCO Image Caption dataset w/ and w/o FSA mechanism.
|
| 332 |
+
|
| 333 |
+
D.3 IMPACT OF GUMBEL-SOFTMAX TEMPERATURE
|
| 334 |
+
|
| 335 |
+
Fig. 6 reports the BLEU scores with different temperatures on MS COCO dataset. It can be seen that a suitable $\tau$ could greatly advance the automatic evaluation scores.
|
| 336 |
+
|
| 337 |
+
E GENERATED SAMPLES ON REAL DATASET
|
| 338 |
+
|
| 339 |
+
E.1 GENERATED SAMPLES ON MS COCO DATASET
|
| 340 |
+
|
| 341 |
+
Table 8 displays samples of generated samples from all baseline models and references on MS COCO dataset.
|
| 342 |
+
|
| 343 |
+
Table 9 shows the randomly sampled sentences from the proposed models generated on MS COCO Dataset.
|
| 344 |
+
|
| 345 |
+
# E.2 GENERATED SAMPLES ON EMNLP2017 WMT NEWS DATASET
|
| 346 |
+
|
| 347 |
+
Table 10 presents the random sampled sentences from our models generated on EMNLP2017 WMT News Dataset.
|
| 348 |
+
|
| 349 |
+

|
| 350 |
+
Figure 5: Training curves of BLEU scores on MS COCO Image Caption dataset with various batch sizes.
|
| 351 |
+
|
| 352 |
+
Table 8: Samples of baseline models and real dataset on MS COCO Image Captioning dataset.
|
| 353 |
+
|
| 354 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Samples</td></tr><tr><td rowspan=1 colspan=1>Real</td><td rowspan=1 colspan=1>a single kite flies high above a body of water as a person stands on the edge of the water .a man wearing an apron in an industrial kitchen reaching for a pot .</td></tr><tr><td rowspan=1 colspan=1>MLE</td><td rowspan=1 colspan=1>a man watches on his bike,ina lake on a feld .a women is standing behind an orange table in helmet on a child in the background .</td></tr><tr><td rowspan=1 colspan=1>SeqGAN</td><td rowspan=1 colspan=1>some people sitting on top of luggage near a truck .a man sitting in a bath tub on tops.</td></tr><tr><td rowspan=1 colspan=1>TextGAN</td><td rowspan=1 colspan=1>a man riding a motorcycle .a bathroom with a sink,and a table.</td></tr><tr><td rowspan=1 colspan=1>LeakGAN</td><td rowspan=1 colspan=1>a man standing next to her cellphone on a street sign .a woman is holding a child in the air.</td></tr><tr><td rowspan=1 colspan=1>MaliGAN</td><td rowspan=1 colspan=1>a woman is standing and another oak cake on a drain .a man standing in a kitchen with her laptop and two tables</td></tr><tr><td rowspan=1 colspan=1>RankGAN</td><td rowspan=1 colspan=1>a colorful bike is is down next to a large mirror .a man is riding a bike down a track.</td></tr><tr><td rowspan=1 colspan=1>RelGAN</td><td rowspan=1 colspan=1>a woman walking with a dog in the city in front of a city bus .a man sitting on a bed in a room with a chair on the couch.</td></tr><tr><td rowspan=1 colspan=1>Ours (MSA)</td><td rowspan=1 colspan=1>a man is sitting on a motorcycle on a busy street,in a city .a man siting on a motorcycle on a crowded street near a building ,with a bicycle in a parking lot .</td></tr><tr><td rowspan=1 colspan=1>Ours (MDA)</td><td rowspan=1 colspan=1>a person is riding a motorcycle on a city street with a woman standing on the back of it .a man with a woman standing next to a fire hydrant wearing a backpack .</td></tr></table>
|
| 355 |
+
|
| 356 |
+

|
| 357 |
+
Figure 6: Training curves of BLEU scores on MS COCO Image Caption dataset with various Gumbel-Softmax temperature values.
|
| 358 |
+
|
| 359 |
+
Table 10: Randomly sampled 10 samples trained on EMNLP2017 WMT News dataset, with MDA (top row) and MSA (bottom row).
|
| 360 |
+
|
| 361 |
+
<table><tr><td>the british people would have tocommit to traveling toeurope and has beena priority for thefrst time ina decade. his priority finally becomes a hope for the police to be informed by the attck and is not on the scene. there is more thanayear before the startof thedayafter the european’s first,but it was not in the lasttwo years. it is notsomething thatisabouttobea15.6percentinthefourthquarter,accordingtoareportfromthethirdofthe week. “i’ve been a part of our last two years,”he said in a statement from the bbc’s today . now that’swhy we have to be a part of theUK. i'mnotsayingthat wasthe firstofthe Kindofpeople who werein the wrong butitistruethatit isyettobe determined. he willbeakey for the firsttime inadecade,and has helpedto stopthespreadofthe decade-overthe past year. so what if that’s the reason that they can be within the last two years. it was one ofthe mostinthefirstquarter,butitwas thefirstof thenearlytwo monthssince thestartofthefirstofthe day.</td></tr><tr><td>if you’re a new,and you have to be a part of the team. in a fox news,she has already been a major despite a conflict in the world . when you’re in the world,when they are growing. buti’ve been a part of the group for christmas . instead,there is no evidence to suggest that the united kingdom . the department of health and the enforcement and defense agencies last Thursday . if you’re the only in the world,and i’m sure.</td></tr></table>
|
md/train/bMCfFepJXM/bMCfFepJXM.md
ADDED
|
@@ -0,0 +1,375 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# BRAC $+$ : GOING DEEPER WITH BEHAVIOR REGULARIZED OFFLINE REINFORCEMENT LEARNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Online interactions with the environment to collect data samples for training a Reinforcement Learning agent is not always feasible due to economic and safety concerns. The goal of Offline Reinforcement Learning (RL) is to address this problem by learning effective policies using previously collected datasets. Standard off-policy RL algorithms are prone to overestimations of the values of outof-distribution (less explored) actions and are hence unsuitable for Offline RL. Behavior regularization, which constraints the learned policy within the support set of the dataset, has been proposed to tackle the limitations of standard off-policy algorithms. In this paper, we improve the behavior regularized offline reinforcement learning and propose $B R A C +$ . We use an analytical upper bound on KL divergence as the behavior regularizor to reduce variance associated with sample based estimations. Additionally, we employ state-dependent Lagrange multipliers for the regularization term to avoid distributing KL divergence penalty across all states of the sampled batch. The proposed Lagrange multipliers allow more freedom of deviation to high probability (more explored) states leading to better rewards while simultaneously restricting low probability (less explored) states to prevent out-of-distribution actions. To prevent catastrophic performance degradation due to rare out-of-distribution actions, we add a gradient penalty term to the policy evaluation objective to penalize the gradient of the Q value w.r.t the out-of-distribution actions. By doing so, the Q values evaluated at the out-ofdistribution actions are bounded. On challenging offline RL benchmarks, ${ \mathrm { B R A C } } +$ outperforms the state-of-the-art model-free and model-based approaches.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Reinforcement Learning (RL) has shown great success in a wide range of applications including board games (Silver et al., 2016), strategy games (Vinyals et al., 2019), energy systems (Zhang et al., 2019), robotics (Lin, 1992), recommendation systems (Choi et al., 2018), etc. The success of RL relies heavily on extensive online interactions with the environment for exploration. However, this is not always feasible in the real world as it can be expensive or dangerous (Levine et al., 2020).
|
| 12 |
+
|
| 13 |
+
Offline RL, also known as batch RL, avoids online interactions with the environment by learning from a static dataset that is collected in an offline manner (Levine et al., 2020). While standard offpolicy RL algorithms (Mnih et al., 2013; Lillicrap et al., 2016; Haarnoja et al., 2018a) can, in theory, be employed to learn from an offline data, in practice, they perform poorly due to distributional shift between the behavior policy (probability distribution of actions conditioned on states as observed in the dataset) of the collected dataset and the learned policy (Levine et al., 2020). The distributional shift manifests itself in form of overestimation of the out-of-distribution (OOD) actions leading to erroneous Bellman backups.
|
| 14 |
+
|
| 15 |
+
Prior works tackle this problem via behavior regularization (Fujimoto et al., 2018b; Kumar et al., 2019; Wu et al., 2019; Siegel et al., 2020). This ensures that the learned policy stays “close” to the behavior policy. This is achieved by adding a regularization term that calculates the $f$ -divergence between the learned policy and the behavior policy. Kernel Maximum Mean Discrepancy (MMD) (Gretton et al., 2007), Wasserstein distance and KL divergence are widely used (Wu et al., 2019). The regularization term is either fixed (Wu et al., 2019), or tuned via dual gradient descent (Kumar et al., 2019), or applied using a trust region objective (Siegel et al., 2020).
|
| 16 |
+
|
| 17 |
+
In this paper, we propose improvements to the Behavior Regularized Actor Critic (BRAC) algorithm presented in (Wu et al., 2019). To obtain the same, we observe that sample based estimation of divergence measures is computationally expensive and prone to higher variance. Therefore, to reduce variance, we derive an analytical upper bound on the KL divergence measure as the regularization term in the objective function. Moreover, we show that current works that apply the regularization term i.e. the divergence measure, on the entire batch, end up distributing the penalty over all states in the batch in amounts inversely proportional to the state’s probability of occurrence in the batch. This needlessly restricts the deviation of highly explored states while allowing less explored ones to deviate farther leading to OOD actions. To address the same, we employ state dependent Lagrange multipliers for the regularization terms and automatically tune their strength using state-wise dual gradient descent. In addition, the performance of the learned agent trained using prior methods often deteriorates over the course of training. We found that if the learned Q function generalizes such that the gradient of the Q function w.r.t the OOD actions is monotonically increasing, behavior regularization fails to keep such actions within the support set. To mitigate this issue, we penalize the gradient of the Q function w.r.t the OOD actions by adding a gradient penalty term to the policy evaluation objective. This reduces the policy improvement at OOD actions to the problem of minimizing the divergence between the learned policy and the behavior policy.
|
| 18 |
+
|
| 19 |
+
We call our improved algorithm ${ \mathrm { B R A C } } +$ following (Wu et al., 2019). Our experiments suggest that ${ \mathrm { B R A C } } +$ outperforms existing state-of-the-art model-free and model-based offline RL algorithms in various datasets on the D4RL benchmark (Fu et al., 2020).
|
| 20 |
+
|
| 21 |
+
# 2 BACKGROUND
|
| 22 |
+
|
| 23 |
+
Markov Decision Process RL algorithms aim to solve Markov Decision Process (MDP) with unknown dynamics. A Markov decision process (Sutton & Barto, 2018) is defined as a tuple $<$ ${ \mathcal { S } } , { \mathcal { A } } , R , P , \mu >$ , where $s$ is the set of states, $\mathcal { A }$ is the set of actions, $R ( s , a , s ^ { \prime } ) : \mathcal { S } \times \mathcal { A } \times \mathcal { S } \mathbb { R }$ defines the intermediate reward when the agent transitions from state $s$ to $s ^ { \prime }$ by taking action $a$ , $P ( s ^ { \prime } | s , a ) : \mathcal { S } \times \mathcal { A } \times \mathcal { S } \to [ 0 , 1 ]$ defines the probability when the agent transitions from state $s$ to $s ^ { \prime }$ by taking action $a$ , $\mu : { \dot { \mathcal { S } } } \ { \dot { } } \ [ 0 , 1 ]$ defines the starting state distribution. The objective of reinforcement learning is to select policy ${ \dot { \pi } } : \mu \to P ( A )$ to maximize the following objective:
|
| 24 |
+
|
| 25 |
+
$$
|
| 26 |
+
J ( \pi ) = \underset { s _ { 0 } \sim \mu , a _ { t } \sim \pi ( \cdot | s _ { t } ) } { \mathbb { E } } [ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } R ( s _ { t } , a _ { t } , s _ { t + 1 } ) ]
|
| 27 |
+
$$
|
| 28 |
+
|
| 29 |
+
Offline Reinforcement Learning The goal of offline RL is to learn policy $\pi _ { \theta }$ from a fixed dataset $\mathcal { D } = \{ ( s _ { i } , a _ { i } , s ^ { \prime } { } _ { i } , r _ { i } ) \} _ { i = 1 } ^ { N }$ consisting of single step transitions $\left\{ \left( s _ { i } , a _ { i } , s ^ { \prime } _ { i } , r _ { i } \right) \right\}$ . The dataset is assumed to be collected using a behavior policy $\pi _ { \beta }$ which denotes the conditional distribution $p ( a | s )$ observed in the dataset. Note that $\pi _ { \beta }$ may consist of multi-modal policy distribution. In principle, standard off-policy RL algorithms using a replay buffer (Mnih et al., 2013; Lillicrap et al., 2016; Haarnoja et al., 2018a) can directly learn from $\mathcal { D }$ . The key challenge resides in the policy evaluation step:
|
| 30 |
+
|
| 31 |
+
$$
|
| 32 |
+
Q _ { \psi } = \arg \operatorname* { m i n } _ { \psi } [ ( Q _ { \psi } ( s , a ) - ( r ( s , a ) + \gamma \mathbb { E } _ { a ^ { \prime } \sim \pi _ { \theta } } Q _ { \psi ^ { \prime } } ( s ^ { \prime } , a ^ { \prime } ) ) ) ] ^ { 2 } \qquad \mathrm { ( p o l i c y ~ e v a l u a t i o n ) }
|
| 33 |
+
$$
|
| 34 |
+
|
| 35 |
+
In this step, the target $\mathrm { Q }$ value depends on the learned policy. If the learned policy distribution $\pi _ { \theta }$ diverges from the data distribution $\pi _ { \beta }$ , it results in evaluation of target Q values using outof-distribution (OOD) actions. Such evaluations are prone to errors. Erroneous overestimation of values get exploited by the policy improvement, preventing the algorithm from learning useful policies. In order to avoid such cases, behavior regularization is adopted to force the learned policy to stay “close” to the behavior policy (Fujimoto et al., 2018b; Kumar et al., 2019; Wu et al., 2019).
|
| 36 |
+
|
| 37 |
+
# 3 IMPROVING BEHAVIOR REGULARIZED OFFLINE REINFORCEMENT LEARNING
|
| 38 |
+
|
| 39 |
+
In this section, we discuss and propose three non-trivial improvements to the Behavior Regularized Actor Critic (BRAC) offline reinforcement learning (Wu et al., 2019). BRAC (Wu et al., 2019)
|
| 40 |
+
|
| 41 |
+
augments either the policy improvement or the policy evaluation step with a penalty term to constrain the policy within the support set of the behavior policy. For simplicity of illustration, we only consider the policy improvement step (Wu et al., 2019):
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
\operatorname* { m a x } _ { \pi _ { \theta } } \mathbb { E } _ { ( s , a , r , s ^ { \prime } ) \sim \mathcal { D } } [ \mathbb { E } _ { a ^ { \prime \prime } \sim \pi _ { \theta } ( \cdot \vert s ) } [ Q _ { \psi } ( s , a ^ { \prime \prime } ) ] - \alpha \hat { D } ( \pi _ { \theta } ( \cdot \vert s ) , \pi _ { \beta } ( \cdot \vert s ) ) ]
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
Here, $\hat { D }$ is a selected $f$ -divergence (Csiszar, 1972) measure used for behavior regularization. Zoom-´ ing into the regularization term, we get:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\sum _ { s \in S } ( P _ { s } \alpha ) \hat { D } ( \pi _ { \theta } ( \cdot | s ) , \pi _ { \beta } ( \cdot | s ) )
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
In the equation above, $s$ denotes the states that occur in a single sampled batch and $P _ { s }$ is the probability of state $s$ in the sampled batch. The first two improvements that we propose are targeted towards the following two terms in Equation 4: (1) The divergence term $\hat { D }$ which for each fixed $\pi _ { \theta }$ determines the impact actions have on the overall objective conditional on the state, and (2) the term $( P _ { s } \alpha )$ which determines the impact the “divergence penalty” of each state will have on the overall objective function. Note that this term is dependent upon the probability of the occurrence of state in the sampled batch. For (1), we propose to use an analytical upper bound of KL divergence to reduce variance. For (2), we propose to decouple the impact of “divergence penalty” of each state from the probability of its occurrence. Detailed explanation of the two improvements and the rationale behind them follows in the next two sub-sections.
|
| 54 |
+
|
| 55 |
+
# 3.1 REGULARIZATION METHOD
|
| 56 |
+
|
| 57 |
+
Behavior regularization is used to constrain the learned policy with the support set of the behavior policy. In other words, it ensures that the “difference” between the probability distributions of the learned policy $\pi _ { \boldsymbol { \theta } } ( \cdot | \boldsymbol { s } )$ and behavior policy $\pi _ { \beta } ( \cdot | s )$ is small. The following divergence measures are most widely used in the community:
|
| 58 |
+
|
| 59 |
+
Kernel MMD Kernel Maximum Mean Discrepancy (MMD) (Gretton et al., 2007) was first introduced in (Kumar et al., 2019) to penalize the policy from diverging from the behavior policy:
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\mathbf { M M D } _ { k } ^ { 2 } ( \pi ( \cdot | s ) , \pi _ { b } ( \cdot | s ) ) = \underset { x , x ^ { \prime } \sim \pi ( \cdot | s ) } { \mathbb { E } } [ K ( x , x ^ { \prime } ) ] - 2 \underset { y \sim \pi ( \cdot | s ) } { \mathbb { E } } [ K ( x , y ) ] + \underset { y , y ^ { \prime } \sim \pi _ { b } ( \cdot | s ) } { \mathbb { E } } [ K ( y , y ^ { \prime } ) ]
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
where $K$ is a kernel function. Symmetric kernel functions such as Laplacian and Gaussian kernels are typically used (Gretton et al., 2007).
|
| 66 |
+
|
| 67 |
+
KL divergence For two probability distributions $P$ and $Q$ on some probability space $\chi$ , the KLDivergence from $Q$ to $P$ is given as
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\mathcal { D } _ { \mathrm { K L } } ( P , Q ) = \int _ { x \sim \chi } P ( x ) \log \frac { P ( x ) } { Q ( x ) } d x
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
KL divergence is assymetric and both $\mathcal { D } _ { \mathrm { K L } } \big ( \pi _ { \theta } \big ( \cdot | s \big ) , \pi _ { b } \big ( \cdot | s \big ) \big )$ and $\mathcal { D } _ { \mathrm { K L } } ( \pi _ { b } ( \cdot | s ) , \pi _ { \theta } ( \cdot | s ) )$ are valid. However, $\mathcal { D } _ { \mathrm { K L } } ( \pi _ { b } ( \cdot | s ) , \pi _ { \theta } ( \cdot | s ) )$ is not suitable because it requires $\pi _ { \boldsymbol { \theta } } ( a \vert s ) \neq 0$ when $\dot { \pi _ { b } } ( a | s ) \neq 0$ , for each $a$ . It may assign $\pi _ { \theta } ( a | s ) > 0$ when $\pi _ { b } ( a | s ) = 0$ , producing out of distribution actions. Therefore, $\mathcal { D } _ { \mathrm { K L } } \big ( \pi _ { \theta } \big ( \cdot | s \big ) , \pi _ { b } \big ( \cdot | s \big ) \big )$ is used for regularization.
|
| 74 |
+
|
| 75 |
+
# 3.1.1 ANALYTICAL KL DIVERGENCE UPPER BOUND
|
| 76 |
+
|
| 77 |
+
All the existing behavior regularized methods estimate the divergence via samples (Kumar et al., 2019; Wu et al., 2019). While in theory it produces an unbiased estimator, it requires a large number of samples to reduce the variance.
|
| 78 |
+
|
| 79 |
+
To stabilize the performance, the key idea is to have a low variance estimator for KL divergence. We obtain this by deriving an upper bound on the KL divergence between the learned policy $\pi _ { \theta }$ and the behavior policy $\pi _ { \beta }$ that can be computed analytically.
|
| 80 |
+
|
| 81 |
+
Assume we learn $\pi _ { \beta }$ using a latent variable model (e.g. VAE (Kingma & Welling, 2014)) with latent variable $Z$ . According to the evidence lower bound (ELBO), we obtain $\log \pi _ { \beta } ( a | s ) \geq$ $\mathbb { E } _ { z \sim q ( z ) } [ \log p ( a | s , z ) ] - \mathcal { D } _ { \mathrm { K L } } ( \bar { q } ( z ) | | p ( z ) )$ , where $q ( z )$ is the approximated posterior distribution and $p ( z )$ is the prior. Then, the KL divergence is bounded by:
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\begin{array} { r l } & { \mathcal { D } _ { \mathrm { K L } } ( \pi _ { \theta } ( \cdot | s ) | | \pi _ { \beta } ( \cdot | s ) ) = \mathbb { E } _ { a \sim \pi _ { \theta } } [ \log \pi _ { \theta } ( a | s ) ] - \mathbb { E } _ { a \sim \pi _ { \theta } } [ \log \pi _ { \beta } ( a | s ) ] } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \mathbb { E } _ { a \sim \pi _ { \theta } } [ \log \pi _ { \beta } ( a | s ) ] - \mathbb { E } _ { \kappa \mathrm { L } } ( q ( z ) | | p ( z ) ) ] } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad ( \mathcal { T } _ { a \sim \pi _ { \theta } } [ \log ( a | s ) ] + \mathcal { D } _ { \mathrm { K L } } ( q ( z ) | | p ( z ) ) ] } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad ( \mathcal { T } _ { a \sim \pi _ { \theta } , z \sim q ( z ) } [ \mathcal { D } _ { \mathrm { K L } } ( \pi _ { \theta } ( \cdot | s ) | | p ( \cdot | s , z ) ) + \mathcal { D } _ { \mathrm { K L } } ( q ( z ) | | p ( z ) ) ] } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad ( \mathcal { T } _ { a \sim \pi _ { \theta } , z \sim q ( z ) } [ \mathcal { D } _ { \mathrm { K L } } ( \pi _ { \theta } ( \cdot | s ) | | p ( \cdot | s , z ) ) + \mathcal { D } _ { \mathrm { K L } } ( q ( z ) | | p ( z ) ) ] } \end{array}
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
Thus, if we choose $p ( \cdot | s , z )$ to be a tractable distribution, Equation 7 can be computed analytically. Note that although $p ( \cdot | s , z )$ has a special form (e.g. Gaussian), the latent variable model can in theory represent any probability distribution without sacrificing the expressiveness. In practice, we choose $p ( \cdot | s , z )$ to be a Gaussian distribution.
|
| 88 |
+
|
| 89 |
+
# 3.2 STATE DEPENDENT LAGRANGE MULTIPLIER
|
| 90 |
+
|
| 91 |
+
From the term $( P _ { s } \alpha )$ in Equation 4, one can infer that the “penalty budget” of divergence measure gets distributed among the states in amounts inversely proportional to the probability of the occurrence of the states in the sampled batch. If we assume the batches are sampled uniformly, this implies that the states which are more numerous in the offline dataset $\mathcal { D }$ i.e. the states that have been explored more thoroughly are restricted from deviating from the behavior policy. Whereas the less numerous state that have had limited exploration enjoy more freedom for deviation. This is undesirable as restricting highly explored states is overly conservative while allowing less explored states to deviate can lead to OOD actions.
|
| 92 |
+
|
| 93 |
+
To address this we add a state wise constraint for KL divergence as follows:
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\operatorname* { m a x } _ { \pi _ { \alpha } \Lambda } \mathbb { E } _ { s \sim \mathcal { D } } [ \mathbb { E } _ { a ^ { \prime } \sim \pi _ { \theta } ( \cdot | s ) } [ Q _ { \psi } ( s , a ^ { \prime } ) ] ] \mathrm { ~ s . t . ~ } \mathcal { D } _ { K L } ( \pi _ { \theta } ( \cdot | s ) , \pi _ { \beta } ( \cdot | s ) ) \leq \epsilon _ { \mathrm { K L } } , \forall s \quad \mathrm { ( p o l i c ) } .
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
This translates to assignment of state dependent Lagrange multipliers when solved using dual gradient descent:
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\operatorname* { m a x } _ { \pi _ { \theta } } \mathbb { E } _ { s \sim \mathcal { D } } \big [ \mathbb { E } _ { a ^ { \prime } \sim \pi _ { \theta } ( \cdot \vert s ) } [ Q _ { \psi } ( s , a ^ { \prime } ) - \alpha ( s ) \mathcal { D } _ { \mathrm { K L } } ( \pi _ { \theta } ( \cdot \vert s ) , \pi _ { \beta } ( \cdot \vert s ) ) ] \big ]
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
Maintaining a Lagrange multiplier for each state is impractical for large datasets. In practice, we parameterize $\alpha ( s )$ with a neural network.
|
| 106 |
+
|
| 107 |
+
# 3.3 GRADIENT PENALIZED POLICY EVALUATION
|
| 108 |
+
|
| 109 |
+
The fundamental challenge in offline reinforcement learning is to mitigate the impact of erroneous Q values that are evaluated at out-of-distribution actions and used in policy evaluation. Due to the limited representation capacity of neural networks, such actions are unavoidable for large datasets, even with state-dependent behavior regularization. CQL (Kumar et al., 2020) resolves this problem by optimizing a conservative lower bound of the Q value. The key idea in this paper is to bound the Q value at the out-of-distribution actions such that their values are not greater than the Q value of in-distribution actions. We achieve this by augmenting the policy evaluation step with a gradient penalty regularization term. To elaborate our approach, we first analyze the gradient of the policy improvement step:
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\nabla _ { \theta } J \approx \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \nabla _ { a _ { i } } Q _ { \phi } ( s , a ) | _ { s = s _ { i } , a = a _ { i } } \nabla _ { \theta } \pi _ { \theta } ( a | s ) | _ { s = s _ { i } , a = a _ { i } } - \alpha ( s _ { i } ) \nabla _ { \theta } \mathcal { D } _ { \mathrm { K L } } ( \pi _ { \theta } ( \cdot | s ) , \pi _ { \beta } ( \cdot | s ) )
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
If the current policy produces out-of-distribution actions and the Q network erroneously generalizes in such a way that the gradient of Q network is monotonically increasing, this leads to the unbounded value of the Q network and the failure of the behavior regularization. We created a toy example to illustrate this phenomenon in Appendix A. The analysis suggests that if we penalize the gradient of the Q network with respect to the out-of-distribution actions such that they are close to zero,
|
| 116 |
+
|
| 117 |
+
# Algorithm 1 BRAC+: Improved Behavior Regularized Actor Critic
|
| 118 |
+
|
| 119 |
+
1: Train the behavior policy $\pi _ { \beta }$ on the offline dataset $\mathcal { D } = \{ ( s _ { i } , a _ { i } , r _ { i } , s _ { i } ^ { ' } ) \} _ { i = 1 } ^ { N }$ via maximum
|
| 120 |
+
likelihood estimation: $\begin{array} { r } { \pi _ { \beta } = \arg \operatorname* { m a x } _ { \pi _ { \beta } } \sum _ { i = 1 } ^ { N } \log \pi _ { \beta } ( a _ { i } | s _ { i } ) } \end{array}$
|
| 121 |
+
2: Train initial policy: $\begin{array} { r } { \pi _ { \theta } = \arg \operatorname* { m i n } _ { \pi _ { \theta } \in \Pi } \mathcal { D } _ { \mathrm { K L } } ( \pi , \pi _ { \beta } ) } \end{array}$
|
| 122 |
+
3: Train initial Q network: $\begin{array} { r } { Q _ { \psi } = \arg \operatorname* { m i n } _ { \psi } [ ( Q _ { \psi } ( s , a ) - ( r ( s , a ) + \gamma \mathbb { E } _ { a ^ { \prime } \sim \pi _ { \theta } } Q _ { \psi ^ { \prime } } ( s ^ { \prime } , a ^ { \prime } ) ) ) ] ^ { 2 } } \end{array}$
|
| 123 |
+
4: for $e = 1 : E$ do
|
| 124 |
+
5: for $t = 1 : T$ do
|
| 125 |
+
6: Update Q network using Equation 10
|
| 126 |
+
7: Update the policy using Equation 7
|
| 127 |
+
8: Update $\alpha$ via dual gradient descent: $\alpha ( s ) \alpha ( s ) + \lambda _ { \alpha } ( \mathcal { D } _ { \mathrm { K L } } ( \pi _ { \theta } ( \cdot | s ) , \pi _ { \beta } ( \cdot | s ) ) - \epsilon _ { \mathrm { K L } } )$
|
| 128 |
+
9: Update $\beta$ via dual gradient descent: $\beta \gets \beta + \lambda _ { \beta } ( \mathcal { H } ( \pi _ { \theta } ( \cdot | s ) ) - \mathcal { H } _ { 0 } )$
|
| 129 |
+
10: Update the target network $\psi ^ { ' } = \tau \psi + ( 1 - \tau ) \psi ^ { ' }$
|
| 130 |
+
11: end for
|
| 131 |
+
12: end for
|
| 132 |
+
|
| 133 |
+
performing policy improvement step simply reduces to minimizing the KL divergence. Inspired from (Gulrajani et al., 2017), we add a gradient penalty term to the policy evaluation step as:
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
\begin{array} { r l } & { \underset { \psi } { \operatorname* { m i n } } \ : \mathbb { E } _ { ( s , a ) \sim \mathcal { D } } ( ( Q _ { \psi } ( s , a ) - r ( s , a ) + \gamma \mathbb { E } _ { a ^ { \prime } \sim \pi a \theta } Q _ { \psi ^ { \prime } } ( s ^ { \prime } , a ^ { \prime } ) ) ^ { 2 } } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad + \lambda \mathbb { E } _ { a ^ { \prime \prime } \sim \pi \pi _ { \theta } ( \cdot \vert s ) } ( \vert \vert \nabla _ { a ^ { \prime \prime } } Q _ { \psi } ( s , a ^ { \prime \prime } ) \vert \vert _ { 2 } f ( \mathcal { D } _ { K L } ( \pi _ { \theta } ( \cdot \vert s ) , \pi _ { \beta } ( \cdot \vert s ) ) - \epsilon _ { \mathrm { G P } } ) ) ) } \end{array}
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
where $f$ is a non-decreasing function and $\epsilon _ { G P }$ is the threshold for gradient penalty. In this paper, we set $f$ to be the Heaviside step function (or indicator). Other variants such as its soft version (sigmoid function) is left for future work. Setting $\epsilon _ { G P } ~ = ~ \epsilon _ { K L }$ is too conservative because it prevents generalization. In practice, we set $\epsilon _ { G P }$ at epoch $t$ to be $\mu _ { K L } + \sigma _ { K L }$ , where $\mu _ { K L }$ and $\sigma _ { K L }$ is the mean and standard deviation of the KL divergence for all the states in the dataset at epoch $t - 1$ . In addition, we found that $\lambda = 0 . 1$ works well for all the tasks.
|
| 140 |
+
|
| 141 |
+
# 4 RELATED WORK
|
| 142 |
+
|
| 143 |
+
We briefly summarize prior works in offline RL and discuss their relationship with our approach. As discussed in Section 1, the fundamental challenge in learning from a static data is to avoid out-of-distribution actions (Levine et al., 2020). This requires solving two problems: 1) estimation of behavior policy, 2) quantification of out-of-distribution actions. We follow BCQ (Fujimoto et al., 2018b), BEAR (Kumar et al., 2019) and BRAC (Wu et al., 2019) by learning the behavior policy using a conditional VAE (Kingma & Welling, 2014). To avoid out-of-distribution actions, BCQ generates actions in the target values by perturbing the behavior policy. However, this is over-pessimistic in most of the cases. BRAC (Wu et al., 2019) constrains the policy using various sample-based $f$ -divergence measures including MMD, Wasserstein distance and KL divergence with penalized policy improvement or policy evaluation. BEAR (Kumar et al., 2019) is an instance of BRAC with penalized policy improvement using MMD (Gretton et al., 2007). Sample-based estimation is computationally expensive and suffers from high variance. In contrast, our method uses an analytical upper-bound of the KL divergence to constrain the distance between the learned policy and the behavior policy. It is both computationally efficient and has low variance. (Siegel et al., 2020) solves trust-region objective instead of using penalty. CQL (Kumar et al., 2020) avoids estimating the behavior policy by learning a conservative Q function that lower-bounds its true value. Hyperparameter search is another challenging problem in offline RL. (Lee et al., 2020) uses a gradient-based optimization of the hyperparameter using held-out data. MOPO (Yu et al., 2020) follows MBPO Janner et al. (2019) with additional reward penalty on unreliable model-generated transitions. MBOP (Argenson & Dulac-Arnold, 2020) learns the dynamics mode, the behavior policy and a truncated value function to perform online planning. (Kidambi et al., 2020) learns a surrogate MDP using the dataset, such that taking out-of-distribution actions transit to the terminal state. The out-of-distribution actions are detected using the agreement of model ensembles.
|
| 144 |
+
|
| 145 |
+
# 5 EXPERIMENTS
|
| 146 |
+
|
| 147 |
+
Our experiments1 aim to answer the following questions: 1) How does the performance of our improvements compare with state-of-the-art model-free and model-based offline RL methods? 2) How does the use of analytical variational upper bound on KL divergence for regularization term compare with sampled-based MMD? 3) How does the state-dependent Lagrange multiplier based regularization (state-wise regularizor) compare with global policy regularization? 4) Does the gradient penalized policy evaluation improve the stability during the training? To answer these questions, we evaluate our methods on a subset of the D4RL (Fu et al., 2020) benchmark. We consider three locomotion tasks (hopper, walker2d, and halfcheetah) and four types of datasets: 1) random (rand): collect the interactions of a run of random policy for 1M steps to create the dataset, 2) medium (med): collect the interactions of a run of medium quality policy for 1M steps as the dataset, 3) medium-expert (med-exp): run a medium quality policy and an expert quality policy for 1M steps, respectively, and combine their interactions to create the dataset, 4) mixed (medium-replay): train a policy using SAC (Haarnoja et al., 2018a) until the performance of the learned policy exceeds a pre-determined threshold, and take the replay buffer as the dataset. In addition, we consider more complex Adroit tasks (Rajeswaran et al., 2018) that requires controlling a 24-DoF robotic hand, using limited data from human demonstrations.
|
| 148 |
+
|
| 149 |
+
We compare against state-of-the-art model-free and model-based baselines, including behavior cloning, BEAR (Kumar et al., 2019) that constrains the learned policy within the support of the behavior policy using sampled MMD, BRAC-p/v (Wu et al., 2019) that constrains the learned policy within the support of the behavior policy using various sample-based $f$ -divergences to penalize either the policy improvement (p) or the policy evaluation (v), $\operatorname { C Q L } ( { \mathcal { H } } )$ (Kumar et al., 2020) that learns a Q function that lower-bounds its true value. We also compare against model-based approaches including MOPO (Yu et al., 2020) that follows MBPO (Janner et al., 2019) with additional reward penalties and MBOP (Argenson & Dulac-Arnold, 2020) that learns an offline model to perform online planning.
|
| 150 |
+
|
| 151 |
+
# 5.1 COMPARATIVE RESULTS
|
| 152 |
+
|
| 153 |
+
Table 1: Results for OpenAI gym (Brockman et al., 2016) environments in the D4RL (Fu et al., 2020) datasets. For each task, we train for 1 million gradient steps and report the performance by running the policy obtained at the last epoch of the training for 100 episodes, averaged over 4 random seeds with standard deviation. Each number is the normalized score as proposed in (Fu et al., 2020). Please refer to (Fu et al., 2020) for results on more baselines.
|
| 154 |
+
|
| 155 |
+
<table><tr><td rowspan="2">Task Name</td><td colspan="4">Model-Free</td><td colspan="2">Model-Based</td></tr><tr><td>BEAR</td><td>BRAC-p/v</td><td>CQL(H)</td><td>BRAC+ (Ours)</td><td>MOPO</td><td>MBOP</td></tr><tr><td>halfcheetah-rand</td><td>25.1</td><td>24.1/31.2</td><td>35.4</td><td>26.4±1.0</td><td>31.9±2.8</td><td>6.3±4.0</td></tr><tr><td>walker2d-rand</td><td>7.3</td><td>-0.2/1.9</td><td>7.0</td><td>16.7± 2.3</td><td>13.0±2.6</td><td>8.1± 5.5</td></tr><tr><td>hopper-rand</td><td>11.4</td><td>11.0/12.2</td><td>10.8</td><td>12.5±0.3</td><td>13.3±1.6</td><td>10.8± 0.3</td></tr><tr><td>halfcheetah-med</td><td>41.7</td><td>43.8/46.3</td><td>44.4</td><td>46.6±0.6</td><td>40.2± 2.7</td><td>44.6±0.8</td></tr><tr><td>walker2d-med</td><td>59.1</td><td>77.5/81.1</td><td>79.2</td><td>75.1±3.5</td><td>14.0±10.1</td><td>41.0 ± 29.4</td></tr><tr><td>hopper-med</td><td>52.1</td><td>32.7/31.1</td><td>58.0</td><td>53.2±3.1</td><td>26.5±3.7</td><td>48.8± 26.8</td></tr><tr><td>halfcheetah-med-exp</td><td>53.4</td><td>44.2/41.9</td><td>62.4</td><td>61.2±2.8</td><td>57.9± 24.8</td><td>105.9± 17.8</td></tr><tr><td>walker2d-med-exp</td><td>40.1</td><td>76.9/81.6</td><td>98.7</td><td>95.3± 5.9</td><td>55.0± 19.1</td><td>70.2 ± 36.2</td></tr><tr><td>hopper-med-exp</td><td>96.3</td><td>1.9/0.8</td><td>111.0</td><td>112.9±0.1</td><td>51.7±42.9</td><td>55.1 ± 44.3</td></tr><tr><td>halfcheetah-mixed</td><td>38.6</td><td>45.4/47.7</td><td>46.2</td><td>46.1±0.2</td><td>54.0±2.6</td><td>42.3 ± 0.9</td></tr><tr><td>walker2d-mixed</td><td>19.2</td><td>-0.3/0.9</td><td>26.7</td><td>39.0±4.6</td><td>42.7±8.3</td><td>9.7 ± 5.3</td></tr><tr><td>hopper-mixed</td><td>33.7</td><td>0.6/0.6</td><td>48.6</td><td>72.7±18.9</td><td>92.5±6.3</td><td>12.4 ± 5.8</td></tr></table>
|
| 156 |
+
|
| 157 |
+
Performance on multi-modal datasets We first compare the performance on multi-modal datasets i.e. med-exp and mixed datasets. Results shown in Table 1 suggest that our method outperforms various model-free baselines on most of the multi-modal datasets, especially on hopper-mix and walker2d-mix by up to $1 . 5 \mathrm { x }$ . Compared with BEAR (Kumar et al., 2019), our performance improvement arises from the advantage of the KL divergence over the kernel MMD (see discussions in Appendix B). The choice of parameters in $\operatorname { C Q L } ( \mathcal { H } )$ makes it too conservative to achieve higher performance.
|
| 158 |
+
|
| 159 |
+
Table 2: Results for Adroit tasks with human demonstrations in the D4RL (Fu et al., 2020) datasets. The numbers are reported by following the same procedure as in Table 1 except we run the policy obtained at the last epoch of training for 1000 episodes due to large variance across different runs.
|
| 160 |
+
|
| 161 |
+
<table><tr><td>Task Name</td><td>BC</td><td>BEAR</td><td>BRAC-p/v</td><td>CQL(H)</td><td>CQL(p)</td><td>BRAC+ (Ours)</td></tr><tr><td> pen-human</td><td>34.4</td><td>-1.0</td><td>8.1/0.6</td><td>37.5</td><td>55.8</td><td>64.9± 1.6</td></tr><tr><td>hammer-human</td><td>1.5</td><td>0.3</td><td>0.3/0.2</td><td>4.4</td><td>2.1</td><td>3.9 ± 0.9</td></tr><tr><td>door-human</td><td>0.5</td><td>-0.3</td><td>-0.3/-0.3</td><td>9.9</td><td>9.1</td><td>11.5± 1.2</td></tr><tr><td>relocate-human</td><td>0.0</td><td>-0.3</td><td>-0.3/-0.3</td><td>0.20</td><td>0.35</td><td>0.20 ± 0.11</td></tr></table>
|
| 162 |
+
|
| 163 |
+
Performance on single-modal datasets The performance of our method on single-modal (rand and med) dataset outperforms or matches with baseline methods as evident from Table 1 except halfcheetah-random dataset. We observe that the performance is very sensitive to the choice of target policy entropy. We hypothesize that the our choice of target policy entropy in the halfcheetahrandom task makes it hard to compose correct sub-optimal policies from a random collected dataset.
|
| 164 |
+
|
| 165 |
+

|
| 166 |
+
Figure 1: Left: learning curve of pen-human-v0 task. Right: the average $\mathrm { Q }$ value of the first ensemble over the course of training. Both curves are smoothed by a factor of 20.
|
| 167 |
+
|
| 168 |
+
Performance on datasets with human demonstrations The performance on Adroit tasks is shown in Table 2. These tasks are substantially harder than OpenAI gym tasks due to limited training data in a high dimensional observation and action space. Our method makes non-trivial improvement over the behavior cloning. Compared with the state-of-the-art approaches, our approach is superior on half of the tasks and matches the asymptotic performance on the remaining ones. Figure 1 shows that the Q value is bounded when the gradient penalized policy evaluation technique is employed. On the contrary, the Q value without the gradient penalized policy evaluation increases exponentially. Note that we use MMD with Laplacian kernel for Adroit tasks. We observe that the KL-based regularization struggles with datasets collected with narrow behavior distributions (have large density within a tiny space and almost zero density anywhere else). In such a case, the KL divergence is sensitive to tiny policy changes, making gradient-based optimization hard to converge.
|
| 169 |
+
|
| 170 |
+
# 5.2 ABLATION STUDY
|
| 171 |
+
|
| 172 |
+
To answer question (2), (3) and (4), we conduct a thorough ablation study on ${ \mathrm { B R A C } } +$ on various tasks with different data collection policies (hopper-mixed, walker2d-medium-expert, halfcheetahmedium).
|
| 173 |
+
|
| 174 |
+
Sampled-based MMD vs. analytical upper bound KL The results of using sampled-based MMD versus analytical upper bound KL are shown in Figure 2a. The difference of the performance in the single-modal dataset (halfcheetah-medium) is negligible. However, the performance on multi-modal datasets is varied. Our toy example in Appendix B suggests that MMD and the backward KL divergence tends to cover all the “modes” in the behavior policy while the forward KL divergence tends to seek one of the “mode” in the behavior policy. Note that this argument is only valid if the learned policy is single-modal (e.g. Gaussian distribution). The superior performance in the walker2d-medium-expert when using forward KL regularization supports this argument. The results in hopper-mixed task seems to be contradictory. We hypothesize that since the analytical KL has low variance, the policy quickly adopts the out-of-distribution actions when available while in sample-based methods, such adoption is slower due to higher variance in the policy regularization.
|
| 175 |
+
|
| 176 |
+

|
| 177 |
+
(c) Gradient penalty vs. No gradient penalty. State-wise Lagrange multiplier. Forward KL.
|
| 178 |
+
Figure 2: Figures of ablation study. Each setting is repeated for 4 random seeds. The curve is the mean and the shaded area is the standard deviation. The curves are smoothed by a factor of 20. The number of gradient steps per epoch is 2000. To make fair comparison, we only substitute KL divergence with MMD-based measurement with additional MMD-specific hyperparameter tuning. The other design choices are different from (Kumar et al., 2019). Details can be found in Appendix D.
|
| 179 |
+
|
| 180 |
+
State-wise vs. global regularization The performance of using global and state-wise regularization on various tasks is shown in Figure 2b. It is noticeable that the state-wise regularization improves the performance in hopper-mixed and walker2d-medium-expert task, while the performance in halfcheetah-medium does not show much improvement. To understand the consequence of the state-wise regularization, we plot the histogram of the KL divergence of all the states in the dataset in Figure 3. The KL divergence histogram of using state-wise regularization is more concentrated around the threshold while the global regularization is more sporadic. Strictly enforcing the policy regularization around the threshold helps avoid out-of-distribution actions, that is often caused by a few states in the dataset.
|
| 181 |
+
|
| 182 |
+

|
| 183 |
+
Figure 3: Histogram of the KL divergence of all the states in the dataset with global and state-wise Lagrange multiplier.
|
| 184 |
+
|
| 185 |
+
Gradient penalty vs. no gradient penalty Even with policy regularization, evaluating the Q value at the out-of-distribution actions can’t be fully avoided. Thus, it is important to bound the Q value at the out-of-distribution actions such that their values are not greater than the Q value of indistribution actions. Figure 2c shows the performance with and without gradient penalty in the policy evaluation step. While there is little difference in the hopper-mixed and the halfcheetah-medium task, the performance in the walker2d-medium-expert task stabilizes with the gradient penalized policy evaluation. On the contrary, the performance deteriorates over time without gradient penalty. Please refer to Appendix D for more analysis.
|
| 186 |
+
|
| 187 |
+
# 6 DISCUSSIONS AND LIMITATIONS
|
| 188 |
+
|
| 189 |
+
There are several limitations of our approach. The discussion in Appendix D suggests that although KL-regularized offline policy optimization is good at combining sub-optimal policies, they may stuck at local optimums; and they are hard to escape. Another drawback is that the threshold value is hard to set. In our experiments, we try a few numbers that are above the minimum possible KL threshold, which is obtained by training a policy that minimizes that KL divergence.
|
| 190 |
+
|
| 191 |
+
Finally, we conjecture that the behavior-regularized approach is not sufficient to tackle offline RL problems since it fully ignores the state distribution. To see this, we can create a dataset that only adds a few trajectories from an expert policy to a dataset collected by a low-quality policy. If the low-quality policy doesn’t visit the “good” states in the expert policy (can’t combine sub-optimal policies), behavior-regularized approach leads to a policy that imitates the expert policy. Such imitation is likely to fail due to compounding errors (Ross et al., 2010). The right approach for this dataset is to completely ignore expert trajectories and combine sub-optimal policies in the low-quality regions. To achieve this, we need to consider the state distribution as the density of the “good” states is very low.
|
| 192 |
+
|
| 193 |
+
# 7 CONCLUSION
|
| 194 |
+
|
| 195 |
+
In this paper, we improved the behavior regularized offline reinforcement learning by proposing a low-variance upper bound of the KL divergence estimator to reduce variance, state-dependent Lagrange multiplier to allow more freedom of deviation to high probability states while restricting low probability states and gradient penalized policy evaluation such that the Q values of out-ofdistribution actions are not greater than those of in-distribution actions. Our experimental results on challenging benchmarks illustrate the benefits of our improvements.
|
| 196 |
+
|
| 197 |
+
# REFERENCES
|
| 198 |
+
|
| 199 |
+
Abien Fred Agarap. Deep learning using rectified linear units (relu). ArXiv, abs/1803.08375, 2018.
|
| 200 |
+
|
| 201 |
+
Arthur Argenson and Gabriel Dulac-Arnold. Model-based offline planning. ArXiv, abs/2008.05556, 2020.
|
| 202 |
+
|
| 203 |
+
Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym, 2016.
|
| 204 |
+
|
| 205 |
+
Sungwoon Choi, Heonseok Ha, Uiwon Hwang, Chanju Kim, Jung-Woo Ha, and S. Yoon. Reinforcement learning based recommender system using biclustering technique. ArXiv, abs/1801.05532, 2018.
|
| 206 |
+
|
| 207 |
+
I. Csiszar. A class of measures of informativity of observation channels. ´ Periodica Mathematica Hungarica, 2(1):191–213, 1972. doi: 10.1007/BF02018661. URL https://doi.org/10. 1007/BF02018661.
|
| 208 |
+
|
| 209 |
+
R. Fox. Toward provably unbiased temporal-difference value estimation. 2019.
|
| 210 |
+
|
| 211 |
+
Justin Fu, Aviral Kumar, Ofir Nachum, G. Tucker, and Sergey Levine. D4rl: Datasets for deep data-driven reinforcement learning. ArXiv, abs/2004.07219, 2020.
|
| 212 |
+
|
| 213 |
+
Scott Fujimoto, H. V. Hoof, and David Meger. Addressing function approximation error in actorcritic methods. ArXiv, abs/1802.09477, 2018a.
|
| 214 |
+
|
| 215 |
+
Scott Fujimoto, David Meger, and Doina Precup. Off-policy deep reinforcement learning without exploration. CoRR, abs/1812.02900, 2018b. URL http://arxiv.org/abs/1812.02900.
|
| 216 |
+
|
| 217 |
+
Arthur Gretton, Karsten M. Borgwardt, Malte J. Rasch, Bernhard Scholkopf, and Alexander J. Smola. A kernel approach to comparing distributions. In AAAI, pp. 1637–1641, 2007. URL http://www.aaai.org/Library/AAAI/2007/aaai07-262.php.
|
| 218 |
+
|
| 219 |
+
Ishaan Gulrajani, F. Ahmed, Mart´ın Arjovsky, Vincent Dumoulin, and Aaron C. Courville. Improved training of wasserstein gans. In NIPS, 2017.
|
| 220 |
+
|
| 221 |
+
Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. CoRR, abs/1801.01290, 2018a. URL http://arxiv.org/abs/1801.01290.
|
| 222 |
+
|
| 223 |
+
Tuomas Haarnoja, Aurick Zhou, Kristian Hartikainen, George Tucker, Sehoon Ha, Jie Tan, Vikash Kumar, Henry Zhu, Abhishek Gupta, Pieter Abbeel, and Sergey Levine. Soft actor-critic algorithms and applications. CoRR, abs/1812.05905, 2018b. URL http://arxiv.org/abs/ 1812.05905.
|
| 224 |
+
|
| 225 |
+
I. Higgins, Lo¨ıc Matthey, A. Pal, C. Burgess, Xavier Glorot, M. Botvinick, S. Mohamed, and Alexander Lerchner. beta-vae: Learning basic visual concepts with a constrained variational framework. In ICLR, 2017.
|
| 226 |
+
|
| 227 |
+
Michael Janner, Justin Fu, Marvin Zhang, and Sergey Levine. When to trust your model: Modelbased policy optimization. CoRR, abs/1906.08253, 2019. URL http://arxiv.org/abs/ 1906.08253.
|
| 228 |
+
|
| 229 |
+
Liyiming Ke, M. Barnes, W. Sun, Gilwoo Lee, S. Choudhury, and S. Srinivasa. Imitation learning as f-divergence minimization. ArXiv, abs/1905.12888, 2019.
|
| 230 |
+
|
| 231 |
+
Rahul Kidambi, Aravind Rajeswaran, Praneeth Netrapalli, and Thorsten Joachims. Morel $:$ Modelbased offline reinforcement learning, 2020.
|
| 232 |
+
|
| 233 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2015.
|
| 234 |
+
|
| 235 |
+
Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. CoRR, abs/1312.6114, 2014.
|
| 236 |
+
|
| 237 |
+
Aviral Kumar, Justin Fu, George Tucker, and Sergey Levine. Stabilizing off-policy q-learning via bootstrapping error reduction. CoRR, abs/1906.00949, 2019. URL http://arxiv.org/ abs/1906.00949.
|
| 238 |
+
|
| 239 |
+
Aviral Kumar, Aurick Zhou, G. Tucker, and Sergey Levine. Conservative q-learning for offline reinforcement learning. ArXiv, abs/2006.04779, 2020.
|
| 240 |
+
|
| 241 |
+
Byung-Jun Lee, Jongmin Lee, Peter Vrancx, DongHo Kim, and Kee-Eung Kim. Batch reinforcement learning with hyperparameter gradients. 2020.
|
| 242 |
+
|
| 243 |
+
Sergey Levine, Aviral Kumar, George Tucker, and Justin Fu. Offline reinforcement learning: Tutorial, review, and perspectives on open problems. ArXiv, abs/2005.01643, 2020.
|
| 244 |
+
|
| 245 |
+
Timothy P. Lillicrap, Jonathan J. Hunt, Alexander Pritzel, Nicolas Manfred Otto Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning. CoRR, abs/1509.02971, 2016.
|
| 246 |
+
|
| 247 |
+
Long-Ji Lin. Reinforcement Learning for Robots Using Neural Networks. PhD thesis, USA, 1992.
|
| 248 |
+
|
| 249 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin A. Riedmiller. Playing atari with deep reinforcement learning. CoRR, abs/1312.5602, 2013. URL http://arxiv.org/abs/1312.5602.
|
| 250 |
+
|
| 251 |
+
A. Rajeswaran, V. Kumar, Abhishek Gupta, John Schulman, E. Todorov, and S. Levine. Learning complex dexterous manipulation with deep reinforcement learning and demonstrations. ArXiv, abs/1709.10087, 2018.
|
| 252 |
+
|
| 253 |
+
Stephane Ross, Geoffrey J. Gordon, and J. Andrew Bagnell. No-regret reductions for imitation ´ learning and structured prediction. CoRR, abs/1011.0686, 2010. URL http://arxiv.org/ abs/1011.0686.
|
| 254 |
+
|
| 255 |
+
Noah Siegel, Jost Tobias Springenberg, Felix Berkenkamp, Abbas Abdolmaleki, Michael Neunert, T. Lampe, Roland Hafner, and Martin A. Riedmiller. Keep doing what worked: Behavioral modelling priors for offline reinforcement learning. ArXiv, abs/2002.08396, 2020.
|
| 256 |
+
|
| 257 |
+
David Silver, Aja Huang, Christopher J. Maddison, Arthur Guez, Laurent Sifre, George van den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, Sander Dieleman, Dominik Grewe, John Nham, Nal Kalchbrenner, Ilya Sutskever, Timothy Lillicrap, Madeleine Leach, Koray Kavukcuoglu, Thore Graepel, and Demis Hassabis. Mastering the game of go with deep neural networks and tree search. Nature, 529:484–503, 2016. URL http: //www.nature.com/nature/journal/v529/n7587/full/nature16961.html.
|
| 258 |
+
|
| 259 |
+
Richard S. Sutton and Andrew G. Barto. Reinforcement Learning: An Introduction. A Bradford Book, Cambridge, MA, USA, 2018. ISBN 0262039249.
|
| 260 |
+
|
| 261 |
+
Oriol Vinyals, Igor Babuschkin, Junyoung Chung, Michael Mathieu, Max Jaderberg, Wojtek Czarnecki, Andrew Dudzik, Aja Huang, Petko Georgiev, Richard Powell, Timo Ewalds, Dan Horgan, Manuel Kroiss, Ivo Danihelka, John Agapiou, Junhyuk Oh, Valentin Dalibard, David Choi, Laurent Sifre, Yury Sulsky, Sasha Vezhnevets, James Molloy, Trevor Cai, David Budden, Tom Paine, Caglar Gulcehre, Ziyu Wang, Tobias Pfaff, Toby Pohlen, Dani Yogatama, Julia Cohen, Katrina McKinney, Oliver Smith, Tom Schaul, Timothy Lillicrap, Chris Apps, Koray Kavukcuoglu, Demis Hassabis, and David Silver. AlphaStar: Mastering the Real-Time Strategy Game StarCraft II. https://deepmind.com/blog/ alphastar-mastering-real-time-strategy-game-starcraft-ii/, 2019.
|
| 262 |
+
|
| 263 |
+
Ziyu Wang, A. Novikov, Konrad Zolna, Jost Tobias Springenberg, Scott Reed, B. Shahriari, N. Siegel, Josh Merel, Caglar Gulcehre, Nicolas Heess, and N. D. Freitas. Critic regularized regression. ArXiv, abs/2006.15134, 2020.
|
| 264 |
+
|
| 265 |
+
Yifan Wu, George Tucker, and Ofir Nachum. Behavior regularized offline reinforcement learning, 2019.
|
| 266 |
+
|
| 267 |
+
Tianhe Yu, Garrett Thomas, Lantao Yu, Stefano Ermon, James Zou, Sergey Levine, Chelsea Finn, and Tengyu Ma. Mopo: Model-based offline policy optimization, 2020.
|
| 268 |
+
|
| 269 |
+
Chi Zhang, Sanmukh R. Kuppannagari, Rajgopal Kannan, and Viktor K. Prasanna. Building hvac scheduling using reinforcement learning via neural network based model approximation. In Proceedings of the 6th ACM International Conference on Systems for Energy-Efficient Buildings, Cities, and Transportation, BuildSys ’19, pp. 287–296, New York, NY, USA, 2019. Association for Computing Machinery. ISBN 9781450370059. doi: 10.1145/3360322.3360861. URL https://doi.org/10.1145/3360322.3360861.
|
| 270 |
+
|
| 271 |
+

|
| 272 |
+
Figure 4: Fitting a regression model with out of distribution data
|
| 273 |
+
|
| 274 |
+
# A TOY EXAMPLE TO DEMONSTRATE BOUNDING THE VALUE OF THE OUT OF DISTRIBUTION INPUTS VIA GRADIENT PENALTY
|
| 275 |
+
|
| 276 |
+
To demonstrate the effectiveness of the gradient penalty to enforce the bound of the predicted values of a regression model, we conduct experiments by fitting a regression model with in-distribution data while minimizing the norm of the gradient at out of distribution inputs. Specifically, we generate dataset $\{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { N = 1 0 0 }$ as $x _ { i } \sim U ( - 0 . 8 , 0 . 8 )$ , $\begin{array} { r } { y _ { i } = 5 \sin ( \frac { \pi } { 2 } x _ { i } ) + \epsilon _ { i } } \end{array}$ , where $\epsilon _ { i } \sim \mathcal { N } ( 0 , 0 . 5 )$ . In addition, we generate t of distribution dataset $\{ \tilde { x } \} _ { j = 1 } ^ { M = 1 0 0 }$ as $\tilde { x } \sim U ( - 2 , - 0 . 8 ) \cup U ( 0 . 8 , 2 )$ . We $f$
|
| 277 |
+
hidden layer is 64 and the activation is RELU. We use Adam (Kingma & Ba, 2015) optimizer with learning rate 0.01. In addition to the standard MSE loss, we add a gradient penalty term inspired from (Gulrajani et al., 2017) such that the gradient at the out of distribution inputs is penalized. The overall loss function is:
|
| 278 |
+
|
| 279 |
+
$$
|
| 280 |
+
\mathcal { L } = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } ( f ( x _ { i } ) - y _ { i } ) ^ { 2 } + \lambda \cdot \frac { 1 } { M } \sum _ { j = 1 } ^ { M } | | \nabla _ { \tilde { x } } f ( \tilde { x } _ { j } ) | | _ { 2 }
|
| 281 |
+
$$
|
| 282 |
+
|
| 283 |
+
In our experiments, we set $\lambda = 0 . 1$ . We fit $f$ with and without the gradient penalty term. Figure 4 shows the predicted value at both in-distribution and out-of-distribution inputs. The results suggest that: 1) both models generate good prediction for in-distribution inputs $( [ - 0 . 8 , 0 . 8 ] )$ , which is between the two red lines 2) both models generalize well at the out-of-distribution regions between the red line and the blue line $( [ - 1 , - 0 . 8 ]$ and [0.8, 1]). 3) both models erroneously generalize beyond the blue lines $( \lfloor - 2 , - 1 \rfloor$ and $\lfloor 1 , 2 \rfloor$ ). However, the value of the model trained without gradient penalty keep on increasing or decreasing while the model trained with gradient penalty has zero gradient. This suggests that with proper out-of-distribution regularization, the gradient direction at the out-of-distribution inputs point to the in-distribution regions.
|
| 284 |
+
|
| 285 |
+
# B VISUALIZATION OF VARIOUS PROBABILITY DIVERGENCE MEASUREMENT
|
| 286 |
+
|
| 287 |
+
To understand the impact of forward KL $( \mathcal { D } _ { \mathrm { K L } } ( \pi _ { \theta } | | \pi _ { b } ) ) $ ), backward KL $\left( \mathcal { D } _ { \mathrm { K L } } ( \pi _ { b } | | \pi _ { \theta } ) \right)$ ) and MMD distance in constraining the learned policy within the support set defined by the behavior policy, we create a toy example as shown in Figure 5. The black curves in the two figures represent the behavior distribution $\pi _ { b }$ . The orange, blue and green curves in the graph show forward KL, backward KL and MMD with Laplacian kernel between $\boldsymbol { \mathit { 1 0 } }$ and $\pi _ { \theta } ~ = ~ \mathcal { N } ( x , \sigma )$ , respectively, where $x$ is a variable between $[ - 1 0 , 1 0 ]$ and $\sigma$ is fixed. If we draw a horizontal line (red), the area below this line defines the support set. In the left figure, the behavior policy is single-modal and there is little difference between the three metrics. However, when the behavior policy is multi-modal, the forward KL divergence contains two bottoms, each corresponds to the peak probability density of the behavior policy. However, in backward KL and MMD distance, the policy with the smallest divergence actually has low probability density in the behavior policy. This is because minimizing the forward KL leads to “mode seeking” while minimizing the backward KL and MMD leads to “mode covering”. These two terms are heavily used when talking about generative models such as VAEs and GANs (Ke et al., 2019). When performing offline RL in multi-modal dataset, it is necessary to combine sub-optimal actions in the behavior policy, which is in fact “mode seeking”. Mode covering typically leads to out-of-distribution actions even when the divergence measurement is small (e.g. the area between the two modes are actually out-of-distribution) while mode seeking may be stuck at a local optimum (e.g. moving across different “modes” is hard).
|
| 288 |
+
|
| 289 |
+

|
| 290 |
+
Figure 5: The black curve in the two figures represents the behavior distribution $\pi _ { b }$ . The orange, blue and green curves in the graph show forward KL, backward KL and MMD with Laplacian kernel between $\pi _ { b }$ and $\pi _ { \boldsymbol { \theta } } = \mathcal { N } ( \boldsymbol { x } , \bar { \boldsymbol { \sigma } } )$ , respectively, where $x$ is a variable between $[ - 1 0 , 1 0 ]$ and $\sigma$ is fixed.
|
| 291 |
+
|
| 292 |
+
In the left figure, $\pi _ { b } = \mathcal { N } ( 0 , 1 )$ . In the right figure, $\pi _ { b }$ is a mixture of two Gaussian distributions: $\mathcal { N } ( - 1 . 5 , 0 . 3 )$ and $\mathcal { N } ( 1 , 0 . 5 )$ . The weight of each component is 0.3 and 0.7, respectively. $\sigma$ is set to 0.2.
|
| 293 |
+
|
| 294 |
+
# C MISSING BACKGROUND
|
| 295 |
+
|
| 296 |
+
# C.1 VARIATIONAL AUTO-ENCODER
|
| 297 |
+
|
| 298 |
+
A variational auto-encoder (VAE) (Kingma & Welling, 2014) is a generative model that aims to learn the data distribution $p ( X )$ given a set of observations $\{ x _ { i } \} _ { i = 1 } ^ { N }$ . While directly optimizing $p ( X )$ is intractable, we can optimize its evidence lower-bound (ELBO):
|
| 299 |
+
|
| 300 |
+
$$
|
| 301 |
+
\begin{array} { r } { \log p ( X ) \ge \mathbb { E } _ { z \sim q ( z ) } [ \log p ( X | z ) ] - \mathcal { D } _ { \mathrm { K L } } ( q ( z ) | | p ( z ) ) } \end{array}
|
| 302 |
+
$$
|
| 303 |
+
|
| 304 |
+
where $q ( Z )$ is the variational distribution and $p ( Z )$ is the prior. In VAE, $q ( Z )$ is $q ( Z | X )$ so that it is an auto-encoder. Optimizing Equation 12 using gradient descent requires back-propagate the gradient through a sample operator. Fortunately, if the latent variable is a multivariate Gaussian distribution, we can use re-parametrization trick. The tightness of the upper bound is the KL divergence between the approximated posterior distribution and the true posterior distribution.
|
| 305 |
+
|
| 306 |
+
# D MISSING ABLATION STUDY
|
| 307 |
+
|
| 308 |
+
For fair comparison between MMD and KL divergence in policy regularization, we only substitute KL divergence with MMD-based measurement with additional MMD-specific hyperparameter tuning. In the original implementation (Kumar et al., 2019), the author uses 4 ensembles of Q network and compute the Q value by a convex combination of both the minimum of the ensembles and the maximum of the ensembles. In our implementation, we follow the standard architecture in the online setting: we only use 2 ensembles of Q networks and compute the Q value as their minimum. In this work, we only compare against MMD with Laplacian kernels. The MMD-specific hyper-parameters are shown in Table 3.
|
| 309 |
+
|
| 310 |
+
Difference in training the behavior policy (Kumar et al., 2019) learns the behavior policy as a $\beta$ -VAE (Higgins et al., 2017) with MSE reconstruction loss. This is equivalent to maximizing the log probability of a Gaussian distribution with fixed variance as the decoder output. However, the variational lower bound does not hold in $\beta$ -VAE that breaks our derivation. In this paper, we learn the behavior policy as a regular VAE. The decoder outputs a Gaussian distribution with inputconditioned mean and variance.
|
| 311 |
+
|
| 312 |
+
Gradient penalized policy evaluation Figure 6 suggests that the L2 norm of the gradient at the out-of-distribution actions with the gradient penalty is much lower than that without the gradient penalty.
|
| 313 |
+
|
| 314 |
+

|
| 315 |
+
Figure 6: Histogram of the L2 norm of the gradients for out-of-distribution actions
|
| 316 |
+
|
| 317 |
+
Out-of-distribution generalization Lastly, we discuss the out-of-distribution generalization. In offline RL, we rate the learned policy with three levels. Level I policies are able to strictly follow the behavior policy. Level II policies are able to combine sub-optimal policies in the bahevior policy. Level III policies are able to generalize to out-of-distribution actions. To visualize the outof-distribution generalization, we plot the KL divergence of the learned policy on the testing state distribution in Figure 7. In the hopper-mixed and halfcheetah-medium task, there are periodic spikes, suggesting that the agents visit states which are not in the training distribution at test time. Although the results suggest that such generalization is correct, our approach is unable to explicitly quantify it. Thus, we leave it as future work.
|
| 318 |
+
|
| 319 |
+

|
| 320 |
+
Figure 7: The KL divergence between the learned policy and the behavior policy on the testing data distribution. The $x$ axis is the step in an episode.
|
| 321 |
+
|
| 322 |
+
Performance sensitivity to the choices of target entropy During our experiments, we found that the performance using the KL divergence as the behavior regularization method is very sensitive to the choice of the target entropy. Policies trained with a larger entropy may not be able to capture the narrow expert distribution within the behavior policy distribution. This phenomenon is most typical in the halfcheetah-medium-expert dataset as depicted in Figure 8.
|
| 323 |
+
|
| 324 |
+

|
| 325 |
+
Figure 8: The performance of the halfcheetah-medium-expert task on various choices of the target entropy.
|
| 326 |
+
|
| 327 |
+
Table 3: MMD-specific Hyper-parameters
|
| 328 |
+
|
| 329 |
+
<table><tr><td>Hyper-parameter</td><td>hopper-medium-replay丨walker-medium-expert|</td><td></td><td>halfcheetah-medium</td></tr><tr><td>σ in Laplacian kernel</td><td>10</td><td>20</td><td>10</td></tr><tr><td>EMMD</td><td>0.2</td><td>0.2</td><td>0.3</td></tr><tr><td>Number of samples</td><td>10</td><td>10</td><td>10</td></tr></table>
|
| 330 |
+
|
| 331 |
+
# E MISSING RELATED WORK
|
| 332 |
+
|
| 333 |
+
For KL regularized policy improvement with fixed temperature, the optimal policy has a closed form solution (Wang et al., 2020). Although it avoids estimating the behavior policy, the issue with fixed temperature is that all the states are penalized equally. This leads to over-pessimistic for states with higher occurence in the dataset and over-optimistic for states with lower occurence. (Fox, 2019) presents a closed-form expression for the regularization coefficient that completely eliminates the bias in entropy-regularized value updates. However, the softmax operator introduced by the approach makes it hard to use in continuous action space.
|
| 334 |
+
|
| 335 |
+
# F IMPLEMENTATION DETAILS
|
| 336 |
+
|
| 337 |
+
Computation of the analytical KL upper bound To reduce the variance when computing the analytical KL upper bound, we sample $L$ latent variable $z$ and compute the average of the $L$ KL upper bounds. In our experiments, we set $L = 5$ . Note that it doesn’t reduce the bias of the upper bound.
|
| 338 |
+
|
| 339 |
+
Reward scaling Any affine transformation of the reward function does not change the optimal policy of the MDP. In our experiments, we rescale the reward to $[ 0 , 1 ]$ as:
|
| 340 |
+
|
| 341 |
+
$$
|
| 342 |
+
r ^ { \prime } = ( r - r _ { m i n } ) / ( r _ { m a x } - r _ { m i n } )
|
| 343 |
+
$$
|
| 344 |
+
|
| 345 |
+
where $r _ { m a x }$ and $r _ { m i n }$ is the maximum and the minimum reward in the dataset.
|
| 346 |
+
|
| 347 |
+
Entropy regularization The KL divergence is the sum of negative entropy of the learned policy plus the cross entropy between the learned policy and the behavior policy: $\bar { \mathcal { D } } _ { \mathrm { K L } } ( \pi _ { \theta } ( \cdot | s ) , \pi _ { \beta } ( \cdot | \bar { s } ) ) \stackrel { \cdot } { = }$ $\bar { - \mathcal { H } } ( \pi _ { \theta } ( \cdot | s ) ) + \mathcal { H } ( \bar { \pi _ { \theta } } ( \cdot | s ) , \pi _ { \beta } ( \cdot | s ) )$ . When the learned policy distribution violates the KL constraints, the KL divergence between the policy distribution and the behavior distribution is decreased by the optimizer. This is equivalent to increasing the entropy of the learned policy and decreasing the cross entropy between the learned policy and the behavior policy. In soft actor-critic (Haarnoja et al., 2018a), the minimum entropy of the learned policy is enforced to encourage exploration. However, due to the absence of exploration, stochastic policy with large entropy will sample out-ofdistribution actions when computing the target Q values in Equation 2. If such values are overestimated, the policy will exploit the erroneous Q values when performing the policy improvement in Equation 8 and lead to failure, which can’t be corrected without more data. Thus, we maintain the maximum entropy of the learned policy using the technique proposed in (Haarnoja et al., 2018b).
|
| 348 |
+
|
| 349 |
+
Initialization If the dataset is collected using a narrow policy distribution in a high dimensional space (e.g. human demonstration), the constrained optimization problem using dual gradient descent finds it difficult to converge if random initialization is used for the policy network. To mitigate this issue, we start with a policy that has the minimum KL divergence with the behavior policy: $\begin{array} { r } { \pi _ { \theta } \ = \ \arg \operatorname* { m i n } _ { \pi _ { \theta } \in \Pi } \mathcal { D } _ { \mathrm { K L } } ( \pi , \pi _ { \beta } ) } \end{array}$ , where $\Pi$ represents a family of policy types. In this work, we consider $\Pi$ as Gaussian policies. Correspondingly, we initialize the Q network to $Q ^ { \pi _ { \theta } }$ .
|
| 350 |
+
|
| 351 |
+
Policy network Our policy network is a 3-layer feed-forward neural network. The size of each hidden layer is 512. We apply RELU activation (Agarap, 2018) after each hidden layer. Following (Haarnoja et al., 2018a), the output is a Gaussian distribution with diagonal covariance matrix. We apply tanh to enforce the action bounds. The log-likelihood after applying the tanh function has a simple closed form solution. We refer to (Haarnoja et al., 2018a) Appendix C for more details.
|
| 352 |
+
|
| 353 |
+
Q network Following (Haarnoja et al., 2018a; Fujimoto et al., 2018a; Wu et al., 2019), we train two independent Q network $\{ Q _ { \psi _ { 1 } } , Q _ { \psi _ { 2 } } \}$ to penalize uncertainty over the future states. We maintain a target Q network $\{ Q _ { \psi _ { 1 } ^ { \prime } } , Q _ { \psi _ { 2 } ^ { \prime } } \}$ with the same architecture and update the target weights using a weighted sum of the current Q network and the target Q network. When computing the target Q values, we simply take the minimum value of the two Q networks:
|
| 354 |
+
|
| 355 |
+
$$
|
| 356 |
+
Q _ { \psi ^ { \prime } } ( s ^ { \prime } , a ^ { \prime } ) = \operatorname* { m i n } _ { j = 1 , 2 } Q _ { \psi ^ { \prime } { } _ { j } } ( s ^ { \prime } , a ^ { \prime } )
|
| 357 |
+
$$
|
| 358 |
+
|
| 359 |
+
Each Q network is a 3-layer feed-forward neural network. The size of each hidden layer is 256. We apply RELU activation (Agarap, 2018) after each hidden layer.
|
| 360 |
+
|
| 361 |
+
Behavior policy network Following the previous work (Fujimoto et al., 2018b; Kumar et al., 2019), we learn a conditional variational auto-encoder (Kingma & Welling, 2014) as our behavior policy network. The encoder takes a pair of states and actions, and outputs a Gaussian latent variable $Z$ . The decoder takes sampled latent code $z$ and states, and outputs a mixture of Gaussian distributions. Both the architecture of the encoder and the decoder is a 3-layer feed-forward neural network. The size of each hidden layer is 512. The activation is relu (Agarap, 2018). To avoid epistemic uncertainty, we train $B$ ensembles of behavior policy networks. At test time, we randomly select one model to perform the calculations. We found $B = 3$ is sufficient for all the experiments. We pre-train the the behavior policy network for $4 0 0 \mathrm { k }$ gradient steps.
|
| 362 |
+
|
| 363 |
+
$\alpha$ network The $\alpha$ network takes in a state and outputs the Lagrange multiplier for the state. The architecture of the $\alpha$ network is a 3-layer feed-forward neural network with relu (Agarap, 2018) activation. The size of each hidden layer is 256. We use softplus activation after the output to ensure that all the values are positive.
|
| 364 |
+
|
| 365 |
+
Table 4: Default hyper-parameters
|
| 366 |
+
|
| 367 |
+
<table><tr><td>Hyper-parameter</td><td>Value (Gym/Adroit)</td></tr><tr><td>Optimizer</td><td>Adam (Kingma & Ba,2015)</td></tr><tr><td>Policy learning rate</td><td>5e-6/5e-8</td></tr><tr><td>Q network learning rate</td><td>3e-4</td></tr><tr><td>α learning rate</td><td>le-5/1e-7</td></tr><tr><td>batch size</td><td>100</td></tr><tr><td>Target update rate T</td><td>1e-3</td></tr><tr><td>Discount factor y</td><td>0.99</td></tr><tr><td>Initial β</td><td>10</td></tr><tr><td>β learning rate</td><td>1e-3</td></tr><tr><td>Steps per epoch T</td><td>2000</td></tr><tr><td>Number of epochs</td><td>500</td></tr></table>
|
| 368 |
+
|
| 369 |
+
Table 5: Task-specific hyper-parameters for OpenAI gym tasks.
|
| 370 |
+
|
| 371 |
+
<table><tr><td>Task name</td><td>KL divergence threshold ∈kL</td><td>Maximum entropy Ho</td></tr><tr><td>halfcheetah-rand</td><td>9</td><td>-3</td></tr><tr><td>walker2d-rand</td><td>0.1</td><td>6</td></tr><tr><td>hopper-rand</td><td>3</td><td>-3</td></tr><tr><td>halfcheetah-med</td><td>4</td><td>-12</td></tr><tr><td>walker2d-med</td><td>2.1</td><td>-9</td></tr><tr><td>hopper-med</td><td>2.4</td><td>-6</td></tr><tr><td>halfcheetah-med-exp</td><td>11.5</td><td>-24</td></tr><tr><td>walker2d-med-exp</td><td>5</td><td>-12</td></tr><tr><td>hopper-med-exp</td><td>2.6</td><td>-6</td></tr><tr><td>halfcheetah-mixed</td><td>6</td><td>-12</td></tr><tr><td>walker2d-mixed</td><td>4</td><td>-6</td></tr><tr><td>hopper-mixed</td><td>3</td><td>-3</td></tr></table>
|
| 372 |
+
|
| 373 |
+
Table 6: Task-specific hyper-parameters for Adroit tasks with human demonstrations.
|
| 374 |
+
|
| 375 |
+
<table><tr><td>Task name</td><td>MMD threshold ∈MMD</td><td>Minimum entropy Ho</td></tr><tr><td>pen-human</td><td>0.06</td><td>-200</td></tr><tr><td>hammer-human</td><td>0.1</td><td>-60</td></tr><tr><td>door-human</td><td>0.1</td><td>-60</td></tr><tr><td>relocate-human</td><td>0.1</td><td>-60</td></tr></table>
|
md/train/chPj_I5KMHG/chPj_I5KMHG.md
ADDED
|
@@ -0,0 +1,403 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GROUNDING LANGUAGE TO AUTONOMOUSLY-ACQUIRED SKILLS VIA GOAL GENERATION
|
| 2 |
+
|
| 3 |
+
Ahmed Akakzia∗
|
| 4 |
+
Sorbonne Universite´
|
| 5 |
+
ahmed.akakzia@isir.upmc.fr
|
| 6 |
+
Cedric Colas´ ∗
|
| 7 |
+
Inria
|
| 8 |
+
cedric.colas@inria.fr
|
| 9 |
+
|
| 10 |
+
Pierre-Yves Oudeyer Inria
|
| 11 |
+
|
| 12 |
+
Mohamed Chetouani Sorbonne Universite´
|
| 13 |
+
|
| 14 |
+
Olivier Sigaud Sorbonne Universite´
|
| 15 |
+
|
| 16 |
+
# ABSTRACT
|
| 17 |
+
|
| 18 |
+
We are interested in the autonomous acquisition of repertoires of skills. Languageconditioned reinforcement learning (LC-RL) approaches are great tools in this quest, as they allow to express abstract goals as sets of constraints on the states. However, most LC-RL agents are not autonomous and cannot learn without external instructions and feedback. Besides, their direct language condition cannot account for the goal-directed behavior of pre-verbal infants and strongly limits the expression of behavioral diversity for a given language input. To resolve these issues, we propose a new conceptual approach to language-conditioned RL: the Language-Goal-Behavior architecture (LGB). LGB decouples skill learning and language grounding via an intermediate semantic representation of the world. To showcase the properties of LGB, we present a specific implementation called DECSTR. DECSTR is an intrinsically motivated learning agent endowed with an innate semantic representation describing spatial relations between physical objects. In a first stage $\mathbf { \Pi } \left( \mathbf { G } \to \mathbf { B } \right)$ ), it freely explores its environment and targets selfgenerated semantic configurations. In a second stage $\left( \mathrm { L } \longrightarrow \mathrm { G } \right)$ , it trains a languageconditioned goal generator to generate semantic goals that match the constraints expressed in language-based inputs. We showcase the additional properties of LGB w.r.t. both an end-to-end LC-RL approach and a similar approach leveraging non-semantic, continuous intermediate representations. Intermediate semantic representations help satisfy language commands in a diversity of ways, enable strategy switching after a failure and facilitate language grounding.
|
| 19 |
+
|
| 20 |
+
# 1 INTRODUCTION
|
| 21 |
+
|
| 22 |
+
Developmental psychology investigates the interactions between learning and developmental processes that support the slow but extraordinary transition from the behavior of infants to the sophisticated intelligence of human adults (Piaget, 1977; Smith & Gasser, 2005). Inspired by this line of thought, the central endeavour of developmental robotics consists in shaping a set of machine learning processes able to generate a similar growth of capabilities in robots (Weng et al., 2001; Lungarella et al., 2003). In this broad context, we are more specifically interested in designing learning agents able to: 1) explore open-ended environments and grow repertoires of skills in a self-supervised way and 2) learn from a tutor via language commands.
|
| 23 |
+
|
| 24 |
+
The design of intrinsically motivated agents marked a major step towards these goals. The Intrinsically Motivated Goal Exploration Processes family (IMGEPs), for example, describes embodied agents that interact with their environment at the sensorimotor level and are endowed with the ability to represent and set their own goals, rewarding themselves over completion (Forestier et al., 2017). Recently, goal-conditioned reinforcement learning (GC-RL) appeared like a viable way to implement IMGEPs and target the open-ended and self-supervised acquisition of diverse skills.
|
| 25 |
+
|
| 26 |
+
Goal-conditioned RL approaches train goal-conditioned policies to target multiple goals (Kaelbling, 1993; Schaul et al., 2015). While most GC-RL approaches express goals as target features (e.g. target block positions (Andrychowicz et al., 2017), agent positions in a maze (Schaul et al., 2015) or target images (Nair et al., 2018)), recent approaches started to use language to express goals, as language can express sets of constraints on the state space (e.g. open the red door) in a more abstract and interpretable way (Luketina et al., 2019).
|
| 27 |
+
|
| 28 |
+
However, most GC-RL approaches – and language-based ones (LC-RL) in particular – are not intrinsically motivated and receive external instructions and rewards. The IMAGINE approach is one of the rare examples of intrinsically motivated LC-RL approaches (Colas et al., 2020). In any case, the language condition suffers from three drawbacks. 1) It couples skill learning and language grounding. Thus, it cannot account for goal-directed behaviors in pre-verbal infants (Mandler, 1999). 2) Direct conditioning limits the behavioral diversity associated to language input: a single instruction leads to a low diversity of behaviors only resulting from the stochasticity of the policy or the environment. 3) This lack of behavioral diversity prevents agents from switching strategy after a failure.
|
| 29 |
+
|
| 30 |
+
To circumvent these three limitations, one can decouple skill learning and language grounding via an intermediate innate semantic representation. On one hand, agents can learn skills by targeting configurations from the semantic representation space. On the other hand, they can learn to generate valid semantic configurations matching the constraints expressed by language instructions. This generation can be the backbone of behavioral diversity: a given sentence might correspond to a whole set of matching configurations. This is what we propose in this work.
|
| 31 |
+
|
| 32 |
+
Contributions. We propose a novel conceptual RL architecture, named LGB for Language-GoalBehavior and pictured in Figure 1 (right). This LGB architecture enables an agent to decouple the intrinsically motivated acquisition of a repertoire of skills (Goals Behavior) from language grounding (Language Goals), via the use of semantic goal representation. To our knowledge, the LGB architecture is the only one to combine the following four features:
|
| 33 |
+
|
| 34 |
+
• It is intrinsically motivated: it selects its own (semantic) goals and generates its own rewards, • It decouples skill learning from language grounding, accounting for infants learning, • It can exhibit a diversity of behaviors for any given instruction,
|
| 35 |
+
• It can switch strategy in case of failures.
|
| 36 |
+
|
| 37 |
+
Besides, we introduce an instance of LGB, named DECSTR for DEep sets and Curriculum with SemanTic goal Representations. Using DECSTR, we showcase the advantages of the conceptual decoupling idea. In the skill learning phase, the DECSTR agent evolves in a manipulation environment and leverages semantic representations based on predicates describing spatial relations between physical objects. These predicates are known to be used by infants from a very young age (Mandler, 2012). DECSTR autonomously learns to discover and master all reachable configurations in its semantic representation space. In the language grounding phase, we train a Conditional Variational Auto-Encoder (C-VAE) to generate semantic goals from language instructions. Finally, we can evaluate the agent in an instruction-following phase by composing the two first phases. The experimental section investigates three questions: how does DECSTR perform in the three phases? How does it compare to end-to-end LC-RL approaches? Do we need intermediate representations to be semantic? Code and videos can be found at https://sites.google.com/view/decstr/.
|
| 38 |
+
|
| 39 |
+
# 2 RELATED WORK
|
| 40 |
+
|
| 41 |
+
Standard language-conditioned RL. Most approaches from the LC-RL literature define instruction following agents that receive external instructions and rewards (Hermann et al., 2017; Chan et al., 2019; Bahdanau et al., 2018; Cideron et al., 2019; Jiang et al., 2019; Fu et al., 2019), except the IMAGINE approach which introduced intrinsically motivated agents able to set their own goals and to imagine new ones (Colas et al., 2020). In both cases, the language-condition prevents the decoupling of language acquisition and skill learning, true behavioral diversity and efficient strategy switching behaviors. Our approach is different, as we can decouple language acquisition from skill learning. The language-conditioned goal generation allows behavioral diversity and strategy switching behaviors.
|
| 42 |
+
|
| 43 |
+

|
| 44 |
+
Figure 1: A standard language-conditioned RL architecture (left) and our proposed LGB architecture (right).
|
| 45 |
+
|
| 46 |
+
Goal-conditioned RL with target coordinates for block manipulation. Our proposed implementation of LGB, called DECSTR, evolves in a block manipulation domain. Stacking blocks is one of the earliest benchmarks in artificial intelligence (e.g. Sussman (1973); Tate et al. (1975)) and has led to many simulation and robotics studies (Deisenroth et al., 2011; Xu et al., 2018; Colas et al., 2019a). Recently, Lanier et al. (2019) and Li et al. (2019) demonstrated impressive results by stacking up to 4 and 6 blocks respectively. However, these approaches are not intrinsically motivated, involve hand-defined curriculum strategies and express goals as specific target block positions. In contrast, the DECSTR agent is intrinsically motivated, builds its own curriculum and uses semantic goal representations (symbolic or language-based) based on spatial relations between blocks.
|
| 47 |
+
|
| 48 |
+
Decoupling language acquisition and skill learning. Several works investigate the use of semantic representations to associate meanings and skills (Alomari et al., 2017; Tellex et al., 2011; Kulick et al., 2013). While the two first use semantic representations as an intermediate layer between language and skills, the third one does not use language. While DECSTR acquires skills autonomously, previous approaches all use skills that are either manually generated (Alomari et al., 2017), handengineered (Tellex et al., 2011) or obtained via optimal control methods (Kulick et al., 2013). Closer to us, Lynch & Sermanet (2020) also decouple skill learning from language acquisition in a goalconditioned imitation learning paradigm by mapping both language goals and images goals to a shared representation space. However, this approach is not intrinsically motivated as it relies on a dataset of human tele-operated strategies. The deterministic merging of representations also limits the emergence of behavioral diversity and efficient strategy-switching behaviors.
|
| 49 |
+
|
| 50 |
+
# 3 METHODS
|
| 51 |
+
|
| 52 |
+
This section presents our proposed Language-Goal-Behavior architecture (LGB) represented in Figure 1 (Section 3.1) and a particular instance of the LGB architecture called DECSTR. We first present the environment it is set in [3.2], then describe the implementations of the three modules composing any LGB architecture: 1) the semantic representation [3.3]; 2) the intrinsically motivated goal-conditioned algorithm [3.4] and 3) the language-conditioned goal generator [3.5]. We finally present how the three phases described in Figure 1 are evaluated [3.6].
|
| 53 |
+
|
| 54 |
+
# 3.1 THE LANGUAGE-GOAL-BEHAVIOR ARCHITECTURE
|
| 55 |
+
|
| 56 |
+
The LGB architecture is composed of three main modules. First, the semantic representation defines the behavioral and goal spaces of the agent. Second, the intrinsically motivated GC-RL algorithm is in charge of the skill learning phase. Third, the language-conditioned goal generator is in charge of the language grounding phase. Both phases can be combined in the instruction following phase. The three phases are respectively called $\mathrm { G } \longrightarrow \mathrm { B }$ for Goal Behavior, $\mathrm { L } \longrightarrow \mathrm { G }$ for Language $ \mathrm { G o a l }$ and $\mathrm { L G B }$ for Language $ \mathrm { G o a l } \mathbf { B }$ ehavior, see Figure 1 and Appendix A. Instances of the LGB architecture should demonstrate the four properties listed in the introduction: 1) be intrinsically motivated; 2) decouple skill learning and language grounding (by design); 3) favor behavioral diversity; 4) allow strategy switching. We argue that any LGB algorithm should fulfill the following constraints. For LGB to be intrinsically motivated (1), the algorithm needs to integrate the generation and selection of semantic goals and to generate its own rewards. For LGB to demonstrate behavioral diversity and strategy switching (3, 4), the language-conditioned goal generator must efficiently model the distribution of semantic goals satisfying the constraints expressed by any language input.
|
| 57 |
+
|
| 58 |
+
# 3.2 ENVIRONMENT
|
| 59 |
+
|
| 60 |
+
The DECSTR agent evolves in the Fetch Manipulate environment: a robotic manipulation domain based on MUJOCO (Todorov et al., 2012) and derived from the Fetch tasks (Plappert et al., 2018), see Figure 2. Actions are 4-dimensional: 3D gripper velocities and grasping velocity. Observations include the Cartesian and angular positions and velocities of the gripper and the three blocks. Inspired by the framework of Zone of Proximal Development that describes how parents organize the learning environment of their children (Vygotsky, 1978), we let a social partner facilitate DECSTR’s exploration by providing non-trivial initial configurations. After a first period of autonomous exploration, the social partner initializes the scene with stacks of 2 blocks $2 1 \%$ of times, stacks of 3 blocks $9 \%$ of times, and a block is initially put in the agent’s gripper $5 0 \%$ of times. This help is not provided during offline evaluations.
|
| 61 |
+
|
| 62 |
+

|
| 63 |
+
Figure 2: Example configurations. Top-right: (111000100).
|
| 64 |
+
|
| 65 |
+
# 3.3 SEMANTIC REPRESENTATION
|
| 66 |
+
|
| 67 |
+
Semantic predicates define the behavioral space. Defining the list of semantic predicates is defining the dimensions of the behavioral space explored by the agent. It replaces the traditional definition of goal spaces and their associated reward functions. We believe it is for the best, as it does not require the engineer to fully predict all possible behaviors within that space, to know which behaviors can be achieved and which ones cannot, nor to define reward functions for each of them.
|
| 68 |
+
|
| 69 |
+
Semantic predicates in DECSTR. We assume the DECSTR agent to have access to innate semantic representations based on a list of predicates describing spatial relations between pairs of objects in the scene. We consider two of the spatial predicates infants demonstrate early in their development (Mandler, 2012): the close and the above binary predicates. These predicates are applied to all permutations of object pairs for the 3 objects we consider: 6 permutations for the above predicate and 3 combinations for the close predicate due to its order-invariance. A semantic configuration is the concatenation of the evaluations of these 9 predicates and represents spatial relations between objects in the scene. In the resulting semantic configuration space $\{ 0 , 1 \} ^ { 9 }$ , the agent can reach 35 physically valid configurations, including stacks of 2 or 3 blocks and pyramids, see examples in Figure 2. The binary reward function directly derives from the semantic mapping: the agent rewards itself when its current configuration $c _ { p }$ matches the goal configuration $c _ { p } = g$ . Appendix B provides formal definitions and properties of predicates and semantic configurations.
|
| 70 |
+
|
| 71 |
+
# .4 INTRINSICALLY MOTIVATED GOAL-CONDITIONED REINFORCEMENT LEARNIN
|
| 72 |
+
|
| 73 |
+
This section describes the implementation of the intrinsically motivated goal-conditioned RL module in DECSTR. It is powered by the Soft-Actor Critic algorithm (SAC) (Haarnoja et al., 2018) that takes as input the current state, the current semantic configuration and the goal configuration, for both the critic and the policy. We use Hindsight Experience Replay (HER) to facilitate transfer between goals (Andrychowicz et al., 2017). DECSTR samples goals via its curriculum strategy, collects experience in the environment, then performs policy updates via SAC. This section describes two particularities of our RL implementation: the self-generated goal selection curriculum and the object-centered network architectures. Implementation details and hyperparameters can be found in Appendix C.
|
| 74 |
+
|
| 75 |
+
Goal selection and curriculum learning. The DECSTR agent can only select goals among the set of semantic configurations it already experienced. We use an automatic curriculum strategy (Portelas et al., 2020) inspired from the CURIOUS algorithm (Colas et al., 2019a). The DECSTR agent tracks aggregated estimations of its competence (C) and learning progress (LP). Its selection of goals to target during data collection and goals to learn about during policy updates (via HER) is biased towards goals associated with high absolute LP and low C.
|
| 76 |
+
|
| 77 |
+
Automatic bucket generation. To facilitate robust estimation, LP is usually estimated on sets of goals with similar difficulty or similar dynamics (Forestier et al., 2017; Colas et al., 2019a). While previous works leveraged expert-defined goal buckets, we cluster goals based on their time of discovery, as the time of discovery is a good proxy for goal difficulty: easier goals are discovered earlier. Buckets are initially empty (no known configurations). When an episode ends in a new configuration, the $N _ { b } = 5$ buckets are updated. Buckets are filled equally and the first buckets contain the configurations discovered earlier. Thus goals change buckets as new goals are discovered.
|
| 78 |
+
|
| 79 |
+
Tracking competence, learning progress and sampling probabilities. Regularly, the DECSTR agent evaluates itself on goal configurations sampled uniformly from the set of known ones. For each bucket, it tracks the recent history of past successes and failures when targeting the corresponding goals (last $W = 1 8 0 0$ self-evaluations). C is estimated as the success rate over the most recent half of that history $\mathrm { { C } = \mathrm { { C } _ { \mathrm { { r e c e n t } } } } }$ . LP is estimated as the difference between $\mathbf { C } _ { \mathrm { r e c e n t } }$ and the one evaluated over the first half of the history $\left( { \mathrm { C } } _ { \mathrm { e a r l i e r } } \right)$ . This is a crude estimation of the derivative of the C curve w.r.t. time: $\mathrm { L P } = { \mathrm { C } } _ { \mathrm { r e c e n t } } - { \mathrm { C } } _ { \mathrm { e a r l i e r } }$ . The sampling probability $\mathrm { P _ { i } }$ for bucket $i$ is:
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
P _ { i } = \frac { \left( 1 - C _ { i } \right) * \left| L P _ { i } \right| } { \sum _ { j } ( ( 1 - C _ { j } ) * \left| L P _ { j } \right| ) } .
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
In addition to the usual LP bias (Colas et al., 2019a), this formula favors lower C when LP is similar.
|
| 86 |
+
The absolute value ensures resampling buckets whose performance decreased (e.g. forgetting).
|
| 87 |
+
|
| 88 |
+
Object-centered architecture. Instead of fully-connected or recurrent networks, DECSTR uses for the policy and critic an object-centered architecture similar to the ones used in Colas et al. (2020); Karch et al. (2020), adapted from Deep-Sets (Zaheer et al., 2017). For each pair of objects, a shared network independently encodes the concatenation of body and objects features and current and target semantic configurations, see Appendix Figure 4. This shared network ensures efficient transfer of skills between pairs of objects. A second inductive bias leverages the symmetry of the behavior required to achieve $a b o \nu e ( o _ { i } , o _ { j } )$ and $a b o \nu e ( o _ { j } , o _ { i } )$ . To ensure automatic transfer between the two, we present half of the features (e.g. those based on pairs $\left( o _ { i } , o _ { j } \right)$ where $i < j$ ) with goals containing one side of the symmetry (all $a b o \nu e ( o _ { i } , o _ { j } )$ for $i < j$ ) and the other half with the goals containing the other side (all $a b o \nu e ( o _ { j } , \ o _ { i } )$ for $i < j )$ ). As a result, the above $( o _ { i } , \ o _ { j } )$ predicates fall into the same slot of the shared network inputs as their symmetric counterparts $a b { \overset { \vartriangle } { o } } \nu e ( o _ { j } , \ o _ { i } )$ , only with different permutations of object pairs. Goals are now of size 6: 3 close and 3 above predicates, corresponding to one side of the above symmetry. Skill transfer between symmetric predicates are automatically ensured. Appendix C.1 further describes these inductive biases and our modular architecture.
|
| 89 |
+
|
| 90 |
+
# 3.5 LANGUAGE-CONDITIONED GOAL GENERATION
|
| 91 |
+
|
| 92 |
+
The language-conditioned goal generation module (LGG) is a generative model of semantic representations conditioned by language inputs. It is trained to generate semantic configurations matching the agent’s initial configuration and the description of a change in one object-pair relation.
|
| 93 |
+
|
| 94 |
+
A training dataset is collected via interactions between a DECSTR agent trained in phase $\mathrm { G } \longrightarrow \mathrm { B }$ and a social partner. DECSTR generates semantic goals and pursues them. For each trajectory, the social partner provides a description $d$ of one change in objects relations from the initial configuration $c _ { i }$ to the final one $c _ { f }$ . The set of possible descriptions contains 102 sentences, each describing, in a simplified language, a positive or negative shift for one of the 9 predicates (e.g. get red above green). This leads to a dataset $\mathcal { D }$ of 5000 triplets: $( c _ { i } , d , c _ { f } )$ . From this dataset, the LGG is learned using a conditional Variational Auto-Encoder (C-VAE) (Sohn et al., 2015). Inspired by the contextconditioned goal generator from Nair et al. (2019), we add an extra condition on language instruction to improve control on goal generation. The conditioning instruction is encoded by a recurrent network that is jointly trained with the VAE via a mixture of Kullback-Leibler and cross-entropy losses. Appendix C.2 provides the list of sentences and implementation details. By repeatedly sampling the LGG, a set of goals is built for any language input. This enables skill diversity and strategy switching: if the agent fails, it can sample another valid goal to fulfill the instruction, effectively switching strategy. This also enables goal combination using logical functions of instructions: and is an intersection, $o r$ is an union and not is the complement within the known set of goals.
|
| 95 |
+
|
| 96 |
+
# 3.6 EVALUATION OF THE THREE LGB PHASES
|
| 97 |
+
|
| 98 |
+
Skill learning phase $\mathrm { G } \longrightarrow \mathrm { B }$ : DECSTR explores its semantic representation space, discovers achievable configurations and learns to reach them. Goal-specific performance is evaluated offline across learning as the success rate (SR) over 20 repetitions for each goal. The global performance $\overline { { \mathrm { S R } } }$ is measured across either the set of 35 goals or discovery-organized buckets of goals, see Section 3.4.
|
| 99 |
+
|
| 100 |
+
Language grounding phase $\mathrm { L } \longrightarrow \mathrm { G }$ : DECSTR trains the LGG to generate goals matching constraints expressed via language inputs. From a given initial configuration and a given instruction, the LGG should generate all compatible final configurations (goals) and just these. This is the source of behavioral diversity and strategy switching behaviors. To evaluate LGG, we construct a synthetic, oracle dataset $\mathcal { O }$ of triplets $( c _ { i } , d , \mathcal { C } _ { f } ( c _ { i } , d ) )$ , where $\mathscr { C } _ { f } \left( c _ { i } , \ d \right)$ is the set of all final configurations compatible with $( c _ { i } , d )$ . On average, $\mathcal { C } _ { f }$ in $\mathcal { O }$ contains 16.7 configurations, while the training dataset $\mathcal { D }$ only contains 3.4 $( 2 0 \% )$ . We are interested in two metrics: 1) The Precision is the probability that a goal sampled from the LGG belongs to $\mathcal { C } _ { f }$ (true positive / all positive); 2) The Recall is percentage of elements from $\mathcal { C } _ { f }$ that were found by sampling the LGG 100 times (true positive / all true). These metrics are computed on 5 different subsets of the oracle dataset, each calling for a different type of generalization (see full lists of instructions in Appendix C.2):
|
| 101 |
+
|
| 102 |
+
1. Pairs found in $\mathcal { D }$ , except pairs removed to form the following test sets. This calls for the extrapolation of known initialization-effect pairs $( c _ { i } , \ d )$ to new final configurations $c _ { f }$ ( $\mathcal { D }$ contains only $20 \%$ of $\mathcal { C } _ { f }$ on average).
|
| 103 |
+
2. Pairs that were removed from $\mathcal { D }$ , calling for a recombination of known effects $d$ on known $c _ { i }$ .
|
| 104 |
+
3. Pairs for which the $c _ { i }$ was entirely removed from $\mathcal { D }$ . This calls for the transfer of known effects $d$ on unknown $c _ { i }$ .
|
| 105 |
+
4. Pairs for which the $d$ was entirely removed from $\mathcal { D }$ . This calls for generalization in the language space, to generalize unknown effects $d$ from related descriptions and transpose this to known $c _ { i }$ .
|
| 106 |
+
5. Pairs for which both the $c _ { i }$ and the $d$ were entirely removed from $\mathcal { D }$ . This calls for the generalizations 3 and 4 combined.
|
| 107 |
+
|
| 108 |
+
Instruction following phase $\mathrm { L G B }$ : DECSTR is instructed to modify an object relation by one of the 102 sentences. Conditioned on its current configuration and instruction, it samples a compatible goal from the LGG, then pursues it with its goal-conditioned policy. We consider three evaluation settings: 1) performing a single instruction; 2) performing a sequence of instructions without failure; 3) performing a logical combination of instructions. The transition setup measures the success rate of the agent when asked to perform the 102 instructions 5 times each, resetting the environment each time. In the expression setup, the agent is evaluated on 500 randomly generated logical functions of sentences, see the generation mechanism in Appendix C.2. In both setups, we evaluate the performance in 1-shot $\left( \operatorname { S R } _ { 1 } \right)$ and 5-shot $\left( \mathrm { S R } _ { 5 } \right)$ settings. In the 5-shot setting, the agent can perform strategy switching, to sample new goals when previous attempts failed (without reset). In the sequence setup, the agent must execute 20 sequences of random instructions without reset (5-shot). We also test behavioral diversity. We ask DECSTR to follow each of the 102 instructions 50 times each and report the number of different achieved configurations.
|
| 109 |
+
|
| 110 |
+
# 4 EXPERIMENTS
|
| 111 |
+
|
| 112 |
+
Our experimental section investigates three questions: [4.1]: How does DECSTR perform in the three phases? [4.2]: How does it compare to end-to-end language-conditioned approaches? [4.3]: Do we need intermediate representations to be semantic?
|
| 113 |
+
|
| 114 |
+
# 4.1 HOW DOES DECSTR PERFORM IN THE THREE PHASES?
|
| 115 |
+
|
| 116 |
+
This section presents the performance of the DECSTR agent in the skill learning, language grounding, and instruction following phases.
|
| 117 |
+
|
| 118 |
+
Skill learning phase $\mathrm { G } \longrightarrow \mathrm { B }$ : Figure 3 shows that DECSTR successfully masters all reachable configurations in its semantic representation space. Figure 3a shows the evolution of $\overline { { \mathrm { S R } } }$ computed per bucket. Buckets are learned in increasing order, which confirms that the time of discovery is a good proxy for difficulty. Figure 3b reports C, LP and sampling probabilities P computed online using self-evaluations for an example agent. The agent leverages these estimations to select its goals: first focusing on the easy goals from bucket 1, it moves on towards harder and harder buckets as easier ones are mastered (low LP, high C). Figure 3c presents the results of ablation studies. Each condition removes one component of DECSTR: 1) Flat replaces our object-centered modular architectures by flat ones; 2) w/o Curr. replaces our automatic curriculum strategy by a uniform goal selection; 3) w/o Sym. does not use the symmetry inductive bias; 4) In w/o $S P$ , the social partner does not provide non-trivial initial configurations. In the Expert buckets condition, the curriculum strategy is applied on expert-defined buckets, see Appendix D.1. The full version of LGB performs on par with the Expert buckets oracle and outperforms significantly all its ablations. Appendix E.3 presents more examples of learning trajectories, and dissects the evolution of bucket compositions along training.
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 3: Skill Learning: (a) $\overline { { \mathrm { S R } } }$ per bucket. (b): C, LP and P estimated by a DECSTR agent. (c): ablation study. Medians and interquartile ranges over 10 seeds for DECSTR and 5 seeds for others in (a) and (c). Stars indicate significant differences to DECSTR as reported by Welch’s t-tests with $\alpha = 0 . 0 5$ (Colas et al., 2019b).
|
| 122 |
+
|
| 123 |
+
Table 1: $\mathbf { L } { \xrightarrow { } } \mathbf { G }$ phase. Metrics are averaged over 10 seeds, stdev $< 0 . 0 6$ and 0.07 respectively.
|
| 124 |
+
|
| 125 |
+
Table 2: $_ { \mathrm { L G B } }$ phase. Mean $\pm$ stdev over 10 seeds.
|
| 126 |
+
|
| 127 |
+
<table><tr><td>Metrics</td><td>Test 1</td><td>Test2</td><td>Test 3</td><td>Test 4</td><td>Test 5</td></tr><tr><td>Precision</td><td>0.97</td><td>0.93</td><td>0.98</td><td>0.99</td><td>0.98</td></tr><tr><td>Recall</td><td>0.93</td><td>0.94</td><td>0.95</td><td>0.90</td><td>0.92</td></tr></table>
|
| 128 |
+
|
| 129 |
+
<table><tr><td>Metr.</td><td>Transition</td><td>Expression</td></tr><tr><td>SR1</td><td>0.89± 0.05</td><td>0.74±0.08</td></tr><tr><td>SR5</td><td>0.99 ± 0.01</td><td>0.94± 0.06</td></tr></table>
|
| 130 |
+
|
| 131 |
+
Language grounding phase $\mathrm { L } \longrightarrow \mathrm { G }$ : The LGG demonstrates the 5 types of generalization from Table 1. From known configurations, agents can generate more goals than they observed in training data (1, 2). They can do so from new initial configurations (3). They can generalize to new sentences (4) and even to combinations of new sentences and initial configurations (5). These results assert that DECSTR generalizes well in a variety of contexts and shows good behavioral diversity.
|
| 132 |
+
|
| 133 |
+
Instruction following phase $\mathrm { L G B }$ : Table 2 presents the 1-shot and 5-shot results in the transition and expression setups. In the sequence setups, DECSTR succeeds in $L = 1 4 . 9 \pm 5 . 7$ successive instructions (mean±stdev over 10 seeds). These results confirm efficient language grounding. DECSTR can follow instructions or sequences of instructions and generalize to their logical combinations. Strategy switching improves performance $\left( \mathrm { S R } _ { 5 } - \mathrm { S R } _ { 1 } \right)$ ). DECSTR also demonstrates strong behavioral diversity: when asked over 10 seeds to repeat 50 times the same instruction, it achieves at least 7.8 different configurations, 15.6 on average and up to 23 depending on the instruction.
|
| 134 |
+
|
| 135 |
+
# 4.2 DO WE NEED AN INTERMEDIATE REPRESENTATION?
|
| 136 |
+
|
| 137 |
+
This section investigates the need for an intermediate semantic representation. To this end, we introduce an end-to-end LC-RL baseline directly mapping Language to Behavior $( \mathrm { L } \to \mathrm { B } ) ,$ ) and compare its performance with DECSTR in the instruction following phase ( $\mathrm { L } \longrightarrow \mathrm { G } \longrightarrow \mathrm { B }$ ).
|
| 138 |
+
|
| 139 |
+
The LB baseline. To limit the introduction of confounding factors and under-tuning concerns, we base this implementation on the DECSTR code and incorporate defining features of IMAGINE, a stateof-the-art language conditioned RL agent (Colas et al., 2020). We keep the same HER mechanism, object-centered architectures and RL algorithm as DECSTR. We just replace the semantic goal space by the 102 language instructions. This baseline can be seen as an oracle version of the IMAGINE algorithm where the reward function is assumed perfect, but without the imagination mechanism.
|
| 140 |
+
|
| 141 |
+
Comparison in the instruction following phase $\mathrm { L } \longrightarrow \mathrm { B }$ vs $_ { \mathrm { L G B } }$ : After training the LB baseline for 14K episodes, we compare its performance to DECSTR’s in the instruction-following setup. In the transition evaluation setup, LB achieves $\mathrm { s R } _ { 1 } = 0 . 7 6 { \pm } 0 . 0 0 1$ : it always manages to move blocks close to or far from each other, but consistently fails to stack them. Adding more attempts does not help: $\mathrm { s R } _ { 5 } = 0 . 7 6 \pm 0 . 0 0 1$ . The LB baseline cannot be evaluated in the expression setup because it does not manipulate goal sets. Because it cannot stack blocks, LB only succeeds in $3 . 0 1 \pm 0 . 4 3$ random instructions in a row, against 14.9 for DECSTR (sequence setup). We then evaluate LB’s diversity on the set of instructions it succeeds in. When asked to repeat 50 times the same instruction, it achieves at least 3.0 different configurations, 4.2 on average and up to 5.2 depending on the instruction against 7.8, 17.1, 23 on the same set of instructions for DECSTR. We did not observe strategy-switching behaviors in LB, because it either always succeeds (close/far instructions) or fails (stacks).
|
| 142 |
+
|
| 143 |
+
Conclusion. The introduction of an intermediate semantic representation helps DECSTR decouple skill learning from language grounding which, in turns, facilitates instruction-following when compared to the end-to-end language-conditioned learning of LB. This leads to improved scores in the transition and sequence setups. The direct language-conditioning of LB prevents the generalization to logical combination and leads to a reduced diversity in the set of mastered instructions. Decoupling thus brings significant benefits to LGB architectures.
|
| 144 |
+
|
| 145 |
+
# 4.3 DO WE NEED A SEMANTIC INTERMEDIATE REPRESENTATION?
|
| 146 |
+
|
| 147 |
+
This section investigates the need for the intermediate representation to be semantic. To this end, we introduce the LGB-C baseline that leverages continuous goal representations in place of semantic ones. We compare them on the two first phases.
|
| 148 |
+
|
| 149 |
+
The LGB-C baseline. The LGB-C baseline uses continuous goals expressing target block coordinates in place of semantic goals. The skill learning phase is thus equivalent to traditional goalconditioned RL setups in block manipulation tasks (Andrychowicz et al., 2017; Colas et al., $2 0 1 9 \mathrm { a }$ ; Li et al., 2019; Lanier et al., 2019). Starting from the DECSTR algorithm, LGB-C adds a translation module that samples a set of target block coordinates matching the targeted semantic configuration which is then used as the goal input to the policy. In addition, we integrate defining features of the state-of-the-art approach from Lanier et al. (2019): non-binary rewards ( $^ { + 1 }$ for each well placed block) and multi-criteria HER, see details in Appendix D.2.
|
| 150 |
+
|
| 151 |
+
Comparison in skill learning phase $\mathrm { G } \longrightarrow \mathrm { B }$ : The LGB-C baseline successfully learns to discover and master all 35 semantic configurations by placing the three blocks to randomly-sampled target coordinates corresponding to these configurations. It does so faster than DECSTR: $\mathrm { \ddot { 7 } 0 8 } \cdot 1 0 ^ { 3 }$ episodes to reach $\mathrm { S R } = 9 5 \%$ , against $1 2 3 8 \cdot 1 0 ^ { 3 }$ for DECSTR, see Appendix Figure 6. This can be explained by the denser learning signals it gets from using HER on continuous targets instead of discrete ones. In this phase, however, the agent only learns one parameterized skill: to place blocks at their target position. It cannot build a repertoire of semantic skills because it cannot discriminate between different block configurations. Looking at the sum of the distances travelled by the blocks or the completion time, we find that DECSTR performs opportunistic goal reaching: it finds simpler configurations of the blocks which satisfy its semantic goals compared to LGB-C. Blocks move less $( \Delta _ { \mathrm { d i s t } } = 2 6 \pm 5 $ cm), and goals are reached faster $\langle \Delta _ { \mathrm { s t e p s } } = 1 3 \pm 4$ , mean±std across goals with p-values $> 1 . 3 \cdot 1 0 ^ { - 5 }$ and $3 . 2 \cdot 1 0 ^ { - 1 9 }$ respectively).
|
| 152 |
+
|
| 153 |
+
Table 3: LGB-C performance in the $\mathrm { L } \longrightarrow \mathrm { G }$ phase. Mean over 10 seeds. Stdev $< 0 . 0 0 3$ and 0.008 respectively.
|
| 154 |
+
|
| 155 |
+
<table><tr><td>Metrics</td><td>Test 1</td><td>Test 2</td><td>Test3</td><td>Test 4</td><td>Test 5</td></tr><tr><td>Precision</td><td>0.66</td><td>0.78</td><td>0.39</td><td>0.0</td><td>0.0</td></tr><tr><td>Recall</td><td>0.05</td><td>0.02</td><td>0.06</td><td>0.0</td><td>0.0</td></tr></table>
|
| 156 |
+
|
| 157 |
+
Comparison in language grounding phase $\mathrm { L } \longrightarrow \mathrm { G }$ : We train the LGG to generate continuous target coordinates conditioned on language inputs with a mean-squared loss and evaluate it in the same setup as DECSTR’s LGG, see Table 3. Although it maintains reasonable precision in the first two testing sets, the LGG achieves low recall – i.e. diversity – on all sets. The lack of semantic representations of skills might explain the difficulty of training a language-conditioned goal generator.
|
| 158 |
+
|
| 159 |
+
Conclusion. The skill learning phase of the LGB-C baseline is competitive with the one of DECSTR. However, the poor performance in the language grounding phase prevents this baseline to perform instruction following. For this reason, and because semantic representations enable agents to perform opportunistic goal reaching and to acquire repertoires for semantic skills, we believe the semantic representation is an essential part of the LGB architecture.
|
| 160 |
+
|
| 161 |
+
# 5 DISCUSSION AND CONCLUSION
|
| 162 |
+
|
| 163 |
+
This paper contributes LGB, a new conceptual RL architecture which introduces an intermediate semantic representation to decouple sensorimotor learning from language grounding. To demonstrate its benefits, we present DECSTR, a learning agent that discovers and masters all reachable configurations in a manipulation domain from a set of relational spatial primitives, before undertaking an efficient language grounding phase. This was made possible by the use of object-centered inductive biases, a new form of automatic curriculum learning and a novel language-conditioned goal generation module. Note that our main contribution is in the conceptual approach, DECSTR being only an instance to showcase its benefits. We believe that this approach could benefit from any improvement in GC-RL (for skill learning) or generative models (for language grounding).
|
| 164 |
+
|
| 165 |
+
Semantic representations. Results have shown that using predicate-based representations was sufficient for DECSTR to efficiently learn abstract goals in an opportunistic manner. The proposed semantic configurations showcase promising properties: 1) they reduce the complexity of block manipulation where most effective works rely on a heavy hand-crafted curriculum (Li et al., 2019; Lanier et al., 2019) and a specific curiosity mechanism (Li et al., 2019); 2) they facilitate the grounding of language into skills and 3) they enable decoupling skill learning from language grounding, as observed in infants (Piaget, 1977). The set of semantic predicates is, of course, domain-dependent as it characterizes the space of behaviors that the agent can explore. However, we believe it is easier and requires less domain knowledge to define the set of predicates, i.e. the dimensions of the space of potential goals, than it is to craft a list of goals and their associated reward functions.
|
| 166 |
+
|
| 167 |
+
A new approach to language grounding. The approach proposed here is the first simultaneously enabling to decouple skill learning from language grounding and fostering a diversity of possible behaviors for given instructions. Indeed, while an instruction following agent trained on goals like put red close to green would just push the red block towards the green one, our agent can generate many matching goal configurations. It could build a pyramid, make a blue-green-red pile or target a dozen other compatible configurations. This enables it to switch strategy, to find alternative approaches to satisfy a same instruction when first attempts failed. Our goal generation module can also generalize to new sentences or transpose instructed transformations to unknown initial configurations. Finally, with the goal generation module, the agent can deal with any logical expression made of instructions by combining generated goal sets. It would be of interest to simultaneously perform language grounding and skill learning, which would result in “overlapping waves” of sensorimotor and linguistic development (Siegler, 1998).
|
| 168 |
+
|
| 169 |
+
Semantic configurations of variable size. Considering a constant number of blocks and, thus, fixed-size configuration spaces is a current limit of DECSTR. Future implementations of LGB may handle inputs of variable sizes by leveraging Graph Neural Networks as in Li et al. (2019). Corresponding semantic configurations could be represented as a set of vectors, each encoding information about a predicate and the objects it applies to. These representations could be handled by Deep Sets (Zaheer et al., 2017). This would allow to target partial sets of predicates that would not need to characterize all relations between all objects, facilitating scalability.
|
| 170 |
+
|
| 171 |
+
Conclusion In this work, we have shown that introducing abstract goals based on relational predicates that are well understood by humans can serve as a pivotal representation between skill learning and interaction with a user through language. Here, the role of the social partner was limited to: 1) helping the agent to experience non-trivial configurations and 2) describing the agent’s behavior in a simplified language. In the future, we intend to study more intertwined skill learning and language grounding phases, making it possible to the social partner to teach the agent during skill acquisition.
|
| 172 |
+
|
| 173 |
+
# ACKNOWLEDGMENTS
|
| 174 |
+
|
| 175 |
+
This work was performed using HPC resources from GENCI-IDRIS (Grant 20XX-AP010611667), the MeSU platform at Sorbonne-Universite and the PlaFRIM experimental testbed. C´ edric Colas is´ partly funded by the French Ministere des Arm \` ees - Direction G ´ en´ erale de l’Armement. ´
|
| 176 |
+
|
| 177 |
+
# REFERENCES
|
| 178 |
+
|
| 179 |
+
Muhannad Alomari, Paul Duckworth, David C Hogg, and Anthony G Cohn. Natural language acquisition and grounding for embodied robotic systems. In Thirty-First AAAI Conference on Artificial Intelligence, 2017.
|
| 180 |
+
|
| 181 |
+
Marcin Andrychowicz, Filip Wolski, Alex Ray, Jonas Schneider, Rachel Fong, Peter Welinder, Bob McGrew, Josh Tobin, Pieter Abbeel, and Wojciech Zaremba. Hindsight Experience Replay. arXiv preprint arXiv:1707.01495, 2017.
|
| 182 |
+
|
| 183 |
+
Dzmitry Bahdanau, Felix Hill, Jan Leike, Edward Hughes, Arian Hosseini, Pushmeet Kohli, and Edward Grefenstette. Learning to understand goal specifications by modelling reward. arXiv preprint arXiv:1806.01946, 2018.
|
| 184 |
+
|
| 185 |
+
Harris Chan, Yuhuai Wu, Jamie Kiros, Sanja Fidler, and Jimmy Ba. Actrce: Augmenting experience via teacher’s advice for multi-goal reinforcement learning. arXiv preprint arXiv:1902.04546, 2019.
|
| 186 |
+
|
| 187 |
+
Geoffrey Cideron, Mathieu Seurin, Florian Strub, and Olivier Pietquin. Self-educated language agent with hindsight experience replay for instruction following. arXiv preprint arXiv:1910.09451, 2019.
|
| 188 |
+
|
| 189 |
+
Cedric Colas, Pierre-Yves Oudeyer, Olivier Sigaud, Pierre Fournier, and Mohamed Chetouani. CU-´ RIOUS: Intrinsically motivated multi-task, multi-goal reinforcement learning. In International Conference on Machine Learning (ICML), pp. 1331–1340, 2019a.
|
| 190 |
+
|
| 191 |
+
Cedric Colas, Olivier Sigaud, and Pierre-Yves Oudeyer. A hitchhiker’s guide to statistical compar- ´ isons of reinforcement learning algorithms. arXiv preprint arXiv:1904.06979, 2019b.
|
| 192 |
+
|
| 193 |
+
Cedric Colas, Tristan Karch, Nicolas Lair, Jean-Michel Dussoux, Cl ´ ement Moulin-Frier, Peter Ford ´ Dominey, and Pierre-Yves Oudeyer. Language as a cognitive tool to imagine goals in curiositydriven exploration. arXiv preprint arXiv:2002.09253, 2020.
|
| 194 |
+
|
| 195 |
+
Marc Peter Deisenroth, Carl Edward Rasmussen, and Dieter Fox. Learning to control a low-cost manipulator using data-efficient reinforcement learning. Robotics: Science and Systems VII, pp. 57–64, 2011.
|
| 196 |
+
|
| 197 |
+
Sebastien Forestier, Yoan Mollard, and Pierre-Yves Oudeyer. Intrinsically motivated goal explo-´ ration processes with automatic curriculum learning. arXiv preprint arXiv:1708.02190, 2017.
|
| 198 |
+
|
| 199 |
+
Justin Fu, Anoop Korattikara, Sergey Levine, and Sergio Guadarrama. From language to goals: Inverse reinforcement learning for vision-based instruction following. arXiv preprint arXiv:1902.07742, 2019.
|
| 200 |
+
|
| 201 |
+
Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Offpolicy maximum entropy deep reinforcement learning with a stochastic actor. arXiv preprint arXiv:1801.01290, 2018.
|
| 202 |
+
|
| 203 |
+
Karl Moritz Hermann, Felix Hill, Simon Green, Fumin Wang, Ryan Faulkner, Hubert Soyer, David Szepesvari, Wojciech Marian Czarnecki, Max Jaderberg, Denis Teplyashin, et al. Grounded language learning in a simulated 3d world. arXiv preprint arXiv:1706.06551, 2017.
|
| 204 |
+
|
| 205 |
+
Yiding Jiang, Shixiang Shane Gu, Kevin P Murphy, and Chelsea Finn. Language as an abstraction for hierarchical deep reinforcement learning. In Advances in Neural Information Processing Systems, pp. 9414–9426, 2019.
|
| 206 |
+
|
| 207 |
+
Leslie Pack Kaelbling. Learning to achieve goals. In IJCAI, pp. 1094–1099, 1993.
|
| 208 |
+
|
| 209 |
+
Tristan Karch, Cedric Colas, Laetitia Teodorescu, Cl ´ ement Moulin-Frier, and Pierre-Yves Oudeyer.´ Deep sets for generalization in RL. arXiv preprint arXiv:2003.09443, 2020.
|
| 210 |
+
|
| 211 |
+
Johannes Kulick, Marc Toussaint, Tobias Lang, and Manuel Lopes. Active learning for teaching a robot grounded relational symbols. In Twenty-Third International Joint Conference on Artificial Intelligence, 2013.
|
| 212 |
+
|
| 213 |
+
John B. Lanier, Stephen McAleer, and Pierre Baldi. Curiosity-driven multi-criteria hindsight experience replay. CoRR, abs/1906.03710, 2019. URL http://arxiv.org/abs/1906.03710.
|
| 214 |
+
|
| 215 |
+
Richard Li, Allan Jabri, Trevor Darrell, and Pulkit Agrawal. Towards practical multi-object manipulation using relational reinforcement learning. arXiv preprint arXiv:1912.11032, 2019.
|
| 216 |
+
|
| 217 |
+
Jelena Luketina, Nantas Nardelli, Gregory Farquhar, Jakob Foerster, Jacob Andreas, Edward Grefenstette, Shimon Whiteson, and Tim Rocktaschel. A survey of reinforcement learning informed by ¨ natural language. arXiv preprint arXiv:1906.03926, 2019.
|
| 218 |
+
|
| 219 |
+
Max Lungarella, Giorgio Metta, Rolf Pfeifer, and Giulio Sandini. Developmental robotics: a survey. Connection Science, 15(4):151–190, 2003.
|
| 220 |
+
|
| 221 |
+
Corey Lynch and Pierre Sermanet. Grounding language in play. arXiv preprint arXiv:2005.07648, 2020.
|
| 222 |
+
|
| 223 |
+
Jean M. Mandler. Preverbal representation and language. Language and space, pp. 365, 1999.
|
| 224 |
+
|
| 225 |
+
Jean M Mandler. On the spatial foundations of the conceptual system and its enrichment. Cognitive science, 36(3):421–451, 2012.
|
| 226 |
+
|
| 227 |
+
Ashvin Nair, Shikhar Bahl, Alexander Khazatsky, Vitchyr Pong, Glen Berseth, and Sergey Levine. Contextual imagined goals for self-supervised robotic learning. arXiv preprint arXiv:1910.11670, 2019.
|
| 228 |
+
|
| 229 |
+
Ashvin V Nair, Vitchyr Pong, Murtaza Dalal, Shikhar Bahl, Steven Lin, and Sergey Levine. Visual reinforcement learning with imagined goals. In Advances in Neural Information Processing Systems, pp. 9191–9200, 2018.
|
| 230 |
+
|
| 231 |
+
Jean Piaget. The development of thought: Equilibration of cognitive structures. Viking, 1977. (Trans A. Rosin).
|
| 232 |
+
|
| 233 |
+
Matthias Plappert, Marcin Andrychowicz, Alex Ray, Bob McGrew, Bowen Baker, Glenn Powell, Jonas Schneider, Josh Tobin, Maciek Chociej, Peter Welinder, et al. Multi-goal reinforcement learning: Challenging robotics environments and request for research. arXiv preprint arXiv:1802.09464, 2018.
|
| 234 |
+
|
| 235 |
+
Remy Portelas, C ´ edric Colas, Lilian Weng, Katja Hofmann, and Pierre-Yves Oudeyer. Automatic ´ curriculum learning for deep rl: A short survey. arXiv preprint arXiv:2003.04664, 2020.
|
| 236 |
+
|
| 237 |
+
Tom Schaul, Daniel Horgan, Karol Gregor, and David Silver. Universal value function approximators. In International Conference on Machine Learning, pp. 1312–1320, 2015.
|
| 238 |
+
|
| 239 |
+
Robert S Siegler. Emerging minds: The process of change in children’s thinking. Oxford University Press, 1998.
|
| 240 |
+
|
| 241 |
+
Linda Smith and Michael Gasser. The development of embodied cognition: Six lessons from babies. Artificial life, 11(1-2):13–29, 2005.
|
| 242 |
+
|
| 243 |
+
Kihyuk Sohn, Honglak Lee, and Xinchen Yan. Learning structured output representation using deep conditional generative models. In Advances in neural information processing systems, pp. 3483–3491, 2015.
|
| 244 |
+
|
| 245 |
+
Gerald J. Sussman. A computational model of skill acquisition. Technical report, HIT Technical Report AI TR-297, 1973.
|
| 246 |
+
|
| 247 |
+
Austin Tate et al. Interacting goals and their use. In IJCAI, volume 10, pp. 215–218, 1975.
|
| 248 |
+
|
| 249 |
+
Stefanie Tellex, Thomas Kollar, Steven Dickerson, Matthew R Walter, Ashis Gopal Banerjee, Seth Teller, and Nicholas Roy. Approaching the symbol grounding problem with probabilistic graphical models. AI magazine, 32(4):64–76, 2011.
|
| 250 |
+
|
| 251 |
+
Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 5026–5033. IEEE, 2012.
|
| 252 |
+
|
| 253 |
+
L. S. Vygotsky. Tool and Symbol in Child Development. In Mind in Society, chapter Tool and Symbol in Child Development, pp. 19–30. Harvard University Press, 1978. ISBN 0674576292. doi: 10.2307/j.ctvjf9vz4.6.
|
| 254 |
+
|
| 255 |
+
J. Weng, J. McClelland, A. Pentland, O. Sporns, I. Stockman, M. Sur, and E. Thelen. Autonomous mental development by robots and animals. Science, 291(5504):599–600, 2001.
|
| 256 |
+
|
| 257 |
+
Danfei Xu, Suraj Nair, Yuke Zhu, Julian Gao, Animesh Garg, Li Fei-Fei, and Silvio Savarese. Neural task programming: Learning to generalize across hierarchical tasks. In 2018 IEEE International Conference on Robotics and Automation (ICRA), pp. 1–8. IEEE, 2018.
|
| 258 |
+
|
| 259 |
+
Manzil Zaheer, Satwik Kottur, Siamak Ravanbakhsh, Barnabas Poczos, Russ R Salakhutdinov, and Alexander J Smola. Deep sets. In Advances in neural information processing systems, pp. 3391– 3401, 2017.
|
| 260 |
+
|
| 261 |
+
# A LGB PSEUDO-CODE
|
| 262 |
+
|
| 263 |
+
Algorithm 1 and 2 present the high-level pseudo-code of any algorithm following the LGB architecture for each of the three phases.
|
| 264 |
+
|
| 265 |
+
<table><tr><td>Algorithm1 LGB architecture G-→B phase</td><td></td><td>Algorithm2 LGB architecture L-→G and L-→G-→B phases</td></tr><tr><td>1: Require Env E buffer B 3: loop</td><td>Goal -→ Behavior phase 2: Initialize policy II,goal sampler Gs,</td><td>Language → Goal phase 1: Require II, E,Gs, social partner SP 2: Initialize language goal generator LGG 3:dataset ← SP.interact(E,II,Gs)</td></tr><tr><td>4:</td><td>g ← Gs.sample(</td><td>4: LGG.update(dataset) 5: return LGG</td></tr><tr><td>5:</td><td>(s,a,s',g,Cp,Cp)traj ← E.rollout(g)</td><td>Language →Behavior phase</td></tr><tr><td>6:</td><td>Gs.update(cT)</td><td>6: Require E,II, LGG,SP</td></tr><tr><td>7: 8:</td><td>B.update(s,a,s',g,Cp,Cp)traj)</td><td>7: loop</td></tr><tr><td>9:</td><td>II.update(B)</td><td>8: instr. ← SP.listen() 9: loop Strategy switching loop</td></tr><tr><td>10:</td><td>return II, G s</td><td>10: g_← LGG.sample(instr., c)</td></tr><tr><td>11:</td><td></td><td>11: T ←E.rollout(g)</td></tr><tr><td>12:</td><td></td><td></td></tr><tr><td></td><td></td><td>12: if g == cT then break</td></tr></table>
|
| 266 |
+
|
| 267 |
+
# B SEMANTIC PREDICATES AND APPLICATION TO FETCH MANIPULATE
|
| 268 |
+
|
| 269 |
+
In this paper, we restrict the semantic representations to the use of the close and above binary predicates applied to $M \ : = \ : 3$ objects. The resulting semantic configurations are formed by:
|
| 270 |
+
|
| 271 |
+
c $\mathbf { \Phi } _ { p } = [ c ( o _ { 1 } , o _ { 2 } ) , c ( o _ { 1 } , o _ { 3 } ) , c ( o _ { 2 } , o _ { 3 } ) , a ( o _ { 1 } , o _ { 2 } ) , a ( o _ { 2 } , o _ { 1 } ) , a ( o _ { 1 } , o _ { 3 } ) , a ( o _ { 3 } , o _ { 1 } ) , a ( o _ { 2 } , o _ { 3 } ) , a ( o _ { 3 } , o _ { 2 } ) ] ,$ where $c ( )$ and $a ($ () refer to the close and above predicates respectively and $( o _ { 1 } , \ o _ { 2 } , \ o _ { 3 } )$ are the red, green and blue blocks respectively.
|
| 272 |
+
|
| 273 |
+
# Symmetry and asymmetry of close and above predicates. We consider objects $o _ { 1 }$ and $o _ { 2 }$
|
| 274 |
+
|
| 275 |
+
• close is symmetric: “ $\dot { \boldsymbol { o } } _ { 1 }$ is close to ${ o _ { 2 } } ^ { , ; } \Leftrightarrow \stackrel { } { o _ { 2 } }$ is close to $\omega _ { 1 } \mathrm { \Omega } ^ { \mathsf { , , } \mathsf { , } }$ . The corresponding semantic mapping function is based on the Euclidean distance, which is symmetric. • above is asymmetric: $\dot { \boldsymbol { o } } _ { 1 }$ is above $o _ { 2 } \ ' \Rightarrow$ not “ $\dot { \boldsymbol { o } } _ { 2 }$ is above $\omega _ { 1 } \mathbf { \overrightarrow { \Omega } }$ . The corresponding semantic mapping function evaluates the sign of the difference of the object $Z$ -axis coordinates.
|
| 276 |
+
|
| 277 |
+
# C THE DECSTR ALGORITHM
|
| 278 |
+
|
| 279 |
+
# C.1 INTRINSICALLY MOTIVATED GOAL-CONDITIONED RL
|
| 280 |
+
|
| 281 |
+
Overview. Algorithm 3 presents the pseudo-code of the sensorimotor learning phase $\mathrm { \Delta } _ { \mathrm { G \longrightarrow B } }$ ) of DECSTR. It alternates between two steps:
|
| 282 |
+
|
| 283 |
+
• Data acquisition. A DECSTR agent has no prior on the set of reachable semantic configurations. Its first goal is sampled uniformly from the semantic configuration space. Using this goal, it starts interacting with its environment, generating trajectories of sensory states $s$ , actions $a$ and configurations $c _ { p }$ . The last configuration $c _ { p } ^ { T }$ achieved in the episode after $T$ time steps is considered stable and is added to the set of reachable configurations. As it interacts with the environment, the agent explores the configuration space, discovers reachable configurations and selects new targets. Internal models updates. A DECSTR agent updates two models: its curriculum strategy and its policy. The curriculum strategy can be seen as an active goal sampler. It biases the selection of goals to target and goals to learn about. The policy is the module controlling the agent’s behavior and is updated via RL.
|
| 284 |
+
|
| 285 |
+
Algorithm 3 DECSTR: sensorimotor phase $\mathrm { G } \longrightarrow \mathrm { B }$
|
| 286 |
+
|
| 287 |
+
<table><tr><td></td><td>1: Require: env E,# buckets Nb,# episodes before biased init. nunb,self-evaluation probability Pself-eval, noise function g()</td></tr><tr><td>2:</td><td>Initialize: policy II, buffer B,goal sampler Gs, bucket sampling probabilities pb,language module LGG.</td></tr><tr><td>3: loop</td><td></td></tr><tr><td>4:</td><td>self_eval ←random(<pself_eval</td></tr><tr><td>5:</td><td>g ← Gs.sample(self_eval, pb)</td></tr><tr><td>6:</td><td>biased_init ← epoch <nunb</td></tr><tr><td>7:</td><td></td></tr><tr><td>8:</td><td>fort=1:Tdo</td></tr><tr><td>9:</td><td>at ←policy(st,ct,g)</td></tr><tr><td>10:</td><td>if not self_eval then</td></tr><tr><td>11:</td><td>at↑at+σ()</td></tr><tr><td>12:</td><td>gt+1,c+1 ← E.step(at)</td></tr><tr><td>13:</td><td>episode ← (s,c,a,s',c')</td></tr><tr><td>14:</td><td>Gs.update(cT)</td></tr><tr><td>15:</td><td>B.update(episode)</td></tr><tr><td>16:</td><td>g ←Gs.sample(pb)</td></tr><tr><td>17:</td><td>batch ← B.sample(g)</td></tr><tr><td>18:</td><td>II.update(batch)</td></tr><tr><td>19:</td><td>if self_eval then</td></tr><tr><td>20:</td><td>Pb ← Gs.update_LP(</td></tr></table>
|
| 288 |
+
|
| 289 |
+
Policy updates with a goal-conditioned Soft Actor-Critic. Readers familiar with Markov Decision Process and the use of SAC and HER algorithms can skip this paragraph.
|
| 290 |
+
|
| 291 |
+
We want the DECSTR agent to explore a semantic configuration space and master reachable configurations in it. We frame this problem as a goal-conditioned MDP (Schaul et al., 2015): $\mathcal { M } \ \stackrel { { } = } { = } \ ( \mathcal { S } , \mathcal { G } _ { p } , \mathcal { A } , \mathcal { T } , \mathcal { R } , \gamma )$ , where the state space $s$ is the usual sensory space augmented with the configuration space $\mathcal { C } _ { p }$ , the goal space $\mathcal { G } _ { p }$ is equal to the configuration space $\mathcal { G } _ { p } \ = \mathcal { C } _ { p }$ , $\mathcal { A }$ is the action space, $\mathcal { T } : \mathcal { S } \times \mathcal { A } \stackrel { \cdot } { \times } \mathcal { S } [ 0 , 1 ]$ is the unknown transition probability, $\mathcal { R } : \mathcal { S } \times \mathcal { A } \{ 0 , 1 \}$ is a sparse reward function and $\gamma \in [ 0 , 1 ]$ is the discount factor.
|
| 292 |
+
|
| 293 |
+
Policy updates are performed with Soft Actor-Critic (SAC) (Haarnoja et al., 2018), a state-of-the-art off-policy actor-critic algorithm. We also use Hindsight Experience Replay (HER) (Andrychowicz et al., 2017). This mechanism enables agents to learn from failures by reinterpreting past trajectories in the light of goals different from the ones originally targeted. HER was designed for continuous goal spaces, but can be directly transposed to discrete goals (Colas et al., 2019a). In our setting, we simply replace the originally targeted goal configuration by the currently achieved configuration in the transitions fed to SAC. We also use our automatic curriculum strategy: the LP-C-based probabilities are used to sample goals to learn about. When a goal $g$ is sampled, we search the experience buffer for the collection of episodes that ended in the configuration $c _ { p } ~ = ~ g$ . From these episodes, we sample a transition uniformly. The HER mechanism substitutes the original goal with one of the configurations achieved later in the trajectory. This substitute $g$ has high chances of being the sampled one. At least, it is a configuration on the path towards this goal, as it is sampled from a trajectory leading to it. The HER mechanism is thus biased towards goals sampled by the agent.
|
| 294 |
+
|
| 295 |
+
Object-Centered Inductive Biases. In the proposed Fetch Manipulate environment, the three blocks share the same set of attributes (position, velocity, color identifier). Thus, it is natural to encode a relational inductive bias in our architecture. The behavior with respect to a pair of objects should be independent from the position of the objects in the inputs. The architecture used for the policy is depicted in Figure 4.
|
| 296 |
+
|
| 297 |
+
A shared network $( N N _ { \mathrm { s h a r e d } } )$ encodes the concatenation of: 1) agent’s body features; 2) object pair features; 3) current configuration $( c _ { p } )$ and 4) current goal $g$ . This is done independently for all object pairs. No matter the location of the features of the object pair in the initial observations, this shared network ensures that the same behavior will be performed, thus skills are transferred between object pairs. A sum is then used to aggregate these outputs, before a final network $( N N _ { \mathrm { p o l i c y } } )$ maps the aggregation to actions $a$ . The critic follows the same architecture, where a final network $N N _ { \mathrm { c r i t i c } }$ maps the aggregation to an action-value $Q$ . Parallel encoding of each pair-specific inputs can be seen as different modules trying to reach the goal by only seeing these pair-specific inputs. The intuition is that modules dealing with the pair that should be acted upon to reach the goal will supersede others in the sum aggregation.
|
| 298 |
+
|
| 299 |
+

|
| 300 |
+
Figure 4: Object-centered modular architecture for the policy.
|
| 301 |
+
|
| 302 |
+
Although in principle our architecture could work with combinations of objects (3 modules), we found permutations to work better in practice (6 modules). With combinations, the shared network would need to learn to put block $A$ on block $B$ to achieve a predicate $a b o \nu e ( o _ { i } , \ o _ { j } )$ , and would need to learn the reverse behavior (put $B$ on $A$ ) to achieve the symmetric predicate $\overset { \cdot } { a } b o \nu e ( o _ { j } , \ o _ { i } )$ . With permutations, the shared network can simply learn one of these behaviors (e.g. $A$ on $B$ ). Considering the predicate $a b o \nu e ( o _ { A } , \ o _ { B } )$ , at least one of the modules has objects organized so that this behavior is the good one: if the permutation $\left( o _ { B } , \ o _ { A } \right)$ is not the right one, permutation $\left( o _ { A } , \ o _ { B } \right)$ is. The symmetry bias is explained in Section 3.4. It leverages the symmetry of the behaviors required to achieve the predicates above $\left( o _ { i } , \ o _ { j } \right)$ and $a b o \nu e ( o _ { j } , \ o _ { i } )$ . As a result, the two goal configurations are:
|
| 303 |
+
|
| 304 |
+
$$
|
| 305 |
+
\begin{array} { l l } { { g _ { 1 } = [ c ( o _ { 1 } , o _ { 2 } ) , c ( o _ { 1 } , o _ { 3 } ) , c ( o _ { 2 } , o _ { 3 } ) , a ( o _ { 1 } , o _ { 2 } ) , a ( o _ { 1 } , o _ { 3 } ) , a ( o _ { 2 } , o _ { 3 } ) ] , } } \\ { { \ } } & { { } } \\ { { g _ { 2 } = [ c ( o _ { 1 } , o _ { 2 } ) , c ( o _ { 1 } , o _ { 3 } ) , c ( o _ { 2 } , o _ { 3 } ) , a ( o _ { 2 } , o _ { 1 } ) , a ( o _ { 3 } , o _ { 1 } ) , a ( o _ { 3 } , o _ { 2 } ) ] , } } \end{array}
|
| 306 |
+
$$
|
| 307 |
+
|
| 308 |
+
where $g _ { 1 }$ is used in association with object permutations $( o _ { i } , \ o _ { j } )$ with $\textit { i } \ < \ \textit { j }$ and $g _ { 2 }$ is used in association with object permutations $( o _ { j } , \ o _ { i } )$ with $\textit { i } \ < \ \textit { j }$ . As a result, the shared network automatically ensures transfer between predicates based on symmetric behaviors.
|
| 309 |
+
|
| 310 |
+
Implementation Details. This part includes details necessary to reproduce results. The code is available at https://sites.google.com/view/decstr/.
|
| 311 |
+
|
| 312 |
+
Parallel implementation of SAC-HER. We use a parallel implementation of SAC (Haarnoja et al., 2018). Each of the 24 parallel worker maintains its own replay buffer of size $1 0 ^ { 6 }$ and performs its own updates. Updates are summed over the 24 actors and the updated network are broadcast to all workers. Each worker alternates between 2 episodes of data collection and 30 updates with batch size 256. To form an epoch, this cycle is repeated 50 times and followed by the offline evaluation of the agent on each reachable goal. An epoch is thus made of $5 0 \times 2 \times 2 4 = 2 4 0 0$ episodes.
|
| 313 |
+
|
| 314 |
+
Goal sampler updates. The agent performs self-evaluations with probability $s e l f . e v a l \ = \ 0 . 1$ . During these runs, the agent targets uniformly sampled discovered configurations without exploration noise. This enables the agent to self-evaluate on each goal. Goals are organized into buckets. Main Section 3.4 presents our automatic bucket generation mechanism. Once buckets are formed, we compute $C$ , $L P$ and $P$ , based on windows of the past $W ~ = ~ 1 8 0 0$ self-evaluation interactions for each bucket.
|
| 315 |
+
|
| 316 |
+
Modular architecture. The shared network of our modular architecture $N N _ { \mathrm { s h a r e d } }$ is a 1-hidden layer network of hidden size 256. After all pair-specific inputs have been encoded through this module, their output (of size 84) are summed. The sum is then passed through a final network with a hidden layer of size 256 to compute the final actions (policy) or action-values (critic). All networks use ReLU activations and the Xavier initialization. We use Adam optimizers, with learning rates $1 0 ^ { - 3 }$ . The list of hyperparameters is provided in Table 4.
|
| 317 |
+
|
| 318 |
+
Table 4: Sensorimotor learning hyperparameters used in DECSTR.
|
| 319 |
+
|
| 320 |
+
<table><tr><td>Hyperparam.</td><td>Description</td><td>Values.</td></tr><tr><td>nb_mpis</td><td>Numberofworkers</td><td>24</td></tr><tr><td>nb_cycles</td><td>Number of repeated cycles per epoch</td><td>50</td></tr><tr><td>nb_rollouts_per_mpi</td><td>Number of rollouts per worker</td><td>2</td></tr><tr><td>nb_updates</td><td>Number of updates per cycle</td><td>30</td></tr><tr><td>start_bias_init</td><td>Epoch from which initializations are biased</td><td>100</td></tr><tr><td>W</td><td>Curriculum window size</td><td>1800</td></tr><tr><td>self_eval</td><td>Self evaluation probability</td><td>0.1</td></tr><tr><td>Nb</td><td>Number of buckets</td><td>5</td></tr><tr><td>replay_strategy</td><td>HERreplay strategy</td><td>future</td></tr><tr><td>k_replay</td><td>Ratio of HER data to data from normal experience</td><td>4</td></tr><tr><td>batch_size</td><td>Size of the batch during updates</td><td>256</td></tr><tr><td>Y</td><td>Discount factor to model uncertainty about future decisions</td><td>0.98</td></tr><tr><td>T</td><td>Polyak coefficient for target critics smoothing</td><td>0.95</td></tr><tr><td>lr_actor</td><td>Actor learning rate</td><td>10-3</td></tr><tr><td>lr_critic</td><td>Critic learning rate</td><td>10-3</td></tr><tr><td>α</td><td>Entropy coefficient used in SAC</td><td>0.2</td></tr><tr><td>automatic_entropy</td><td>Automatically tune the entropy coefficient</td><td>False</td></tr></table>
|
| 321 |
+
|
| 322 |
+
Computing resources. The sensorimotor learning experiments contain 8 conditions: 2 of 10 seeds and 6 of 5 seeds. Each run leverages 24 cpus (24 actors) for about 72h for a total of 9.8 cpu years. Experiments presented in this paper requires machines with at least 24 cpu cores. The language grounding phase runs on a single cpu and trains in a few minutes.
|
| 323 |
+
|
| 324 |
+
# C.2 LANGUAGE-CONDITIONED GOAL GENERATOR
|
| 325 |
+
|
| 326 |
+
Language-Conditioned Goal Generator Training. We use a conditional Variational AutoEncoder (C-VAE) (Sohn et al., 2015). Conditioned on the initial configuration and a sentence describing the expected transformation of one object relation, it generates compatible goal configurations. After the first phase of goal-directed sensorimotor training, the agent interacts with a hard-coded social partner as described in Main Section 3. From these interactions, we obtain a dataset of 5000 triplets: initial configuration, final configuration and sentence describing one change of predicate from the initial to the final configuration. The list of sentences used by the synthetic social partner is provided in Table 5. Note that red, green and blue refer to objects $o _ { 1 }$ $, \ o _ { 2 } , \ o _ { 3 }$ respectively.
|
| 327 |
+
|
| 328 |
+
Content of test sets. We describe the 5 test sets:
|
| 329 |
+
|
| 330 |
+
1. Test set 1 is made of input pairs $( c _ { i } , \ s )$ from the training set, but tests the coverage of all compatible final configurations $\mathcal { C } _ { f }$ , $80 \%$ of which are not found in the training set. In that sense, it is partly a test set.
|
| 331 |
+
2. Test set 2 contains two input pairs: $\{ [ 0 \mathrm { ~ 1 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ } ]$ , put blue close to green $\}$ and $\{ [ 0 \ 0 \ 1 \ 0 \ 0 \ 0 \ 0 \ 0 \ 0 ]$ , put green below red $\}$ corresponding to 7 and 24 compatible final configurations respectively.
|
| 332 |
+
3. Test set 3 corresponds to all pairs including the initial configuration $c _ { i } ~ = ~ [ 1 ~ 1 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ]$ (29 pairs), with an average of 13 compatible final configurations.
|
| 333 |
+
4. Test set 4 corresponds to all pairs including one of the sentences put green on top of red and put blue far from red, i.e. 20 pairs with an average of 9.5 compatible final configurations.
|
| 334 |
+
|
| 335 |
+
5. Test set 5 is all pairs that include both the initial configuration of test set 3 and one of the sentences of test set 4, i.e. 2 pairs with 6 and 13 compatible goals respectively. Note that pairs of set 5 are removed from sets 3 and 4.
|
| 336 |
+
|
| 337 |
+
Table 5: List of instructions. Each of them specifies a shift of one predicate, either from false to true $( 0 1 $ ) or true to false $\lvert 1 0 \rvert$ ). block A and block B represent two different blocks from {red, blue, green}.
|
| 338 |
+
|
| 339 |
+
<table><tr><td rowspan=1 colspan=1>Transition type</td><td rowspan=1 colspan=1>Sentences</td></tr><tr><td rowspan=1 colspan=1>Close0→1(×3)</td><td rowspan=1 colspan=1>Put block A close to block B, Bring block A and block B together,Getblock A andblockB close_from each_other,Getblock A close_to block B.</td></tr><tr><td rowspan=1 colspan=1>Close1→0(x3)</td><td rowspan=1 colspan=1>PutblockAfar_fromblockB,GetblockAfarfromblockB,Getblock A and block B far_from each_other,Bringblock A and block B apart,</td></tr><tr><td rowspan=1 colspan=1>Above 0→1(×6)</td><td rowspan=1 colspan=1>Putblock A aboveblockB,Putblock A on_top_ofblockB,PutblockB underblockA,PutblockB belowblock A.</td></tr><tr><td rowspan=1 colspan=1>Above1→0(×6)</td><td rowspan=1 colspan=1>Remove block A from_above block B,Remove block A from block B,Remove blockB from_below blockA,Put blockB and block A on_the_same_plane,Put block A and block B on_the_same_plane.</td></tr></table>
|
| 340 |
+
|
| 341 |
+
Testing on logical expressions of instructions. To evaluate DECSTR on logical functions of instructions, we generate three types of expressions:
|
| 342 |
+
|
| 343 |
+
1. 100 instructions of the form “A and B” where A and B are basic instructions corresponding to shifts of the form above $0 ~ ~ 1$ (see Table 5). These intersections correspond to stacks of 3 or pyramids.
|
| 344 |
+
|
| 345 |
+
2. 200 instructions of the form “A and $\mathbf { B } ^ { \ast }$ where A and B are above and close instructions respectively. B can be replaced by “not $\mathbf { B } ^ { \ast }$ with probability 0.5.
|
| 346 |
+
|
| 347 |
+
3. 200 instructions of the form “(A and B) or (C and D))”, where A, B, C, D are basic instructions: A and C are above instructions while B and D are close instructions. Here also, any instruction can be replaced by its negation with probability 0.5.
|
| 348 |
+
|
| 349 |
+
Implementation details. The encoder is a fully-connected neural network with two layers of size 128 and $R e L U$ activations. It takes as input the concatenation of the final binary configuration and its two conditions: the initial binary configuration and an embedding of the NL sentence. The NL sentence is embedded with an recurrent network with embedding size 100, tanh non-linearities and biases. The encoder outputs the mean and log-variance of the latent distribution of size 27. The decoder is also a fully-connected network with two hidden layers of size 128 and $R e L U$ activations. It takes as input the latent code $z$ and the same conditions as the encoder. As it generates binary vectors, the last layer uses sigmoid activations. We train the architecture with a mixture of KullbackLeibler divergence loss $\left( K D _ { \mathrm { l o s s } } \right)$ w.r.t a standard Gaussian prior and a binary Cross-Entropy loss $\left( B C E _ { \mathrm { l o s s } } \right)$ . The combined loss is $B C E _ { \mathrm { l o s s } } ~ + ~ \beta ~ \times ~ K D _ { \mathrm { l o s s } } ^ { \mathrm { ~ \scriptsize ~ \bar { ~ } } }$ with $\beta ~ = ~ 0 . 6$ . We use an Adam optimizer, a learning rate of $5 \times 1 0 ^ { - 4 }$ , a batch size of 128 and optimize for 150 epochs. As training is fast $ { \approx } 2 { \mathrm { m i n } }$ on a single cpu), we conducted a quick hyperparameter search over $\beta$ , layer sizes, learning rates and latent sizes (see Table 6). We found robust results for various layer sizes, various $\beta$ below 1. and latent sizes above 9.
|
| 350 |
+
|
| 351 |
+
Table 6: LGG hyperparameter search. In bold are the selected hyperparameters.
|
| 352 |
+
|
| 353 |
+
<table><tr><td>Hyperparam.</td><td>Values.</td></tr><tr><td>β</td><td>[0.5, 0.6, 0.7,0.8, 0.9, 1.]</td></tr><tr><td>layers size</td><td>[128, 256]</td></tr><tr><td>learning rate</td><td>[0.01, 0.005, 0.001]</td></tr><tr><td>latent sizes</td><td>[9, 18, 27]</td></tr></table>
|
| 354 |
+
|
| 355 |
+
# D BASELINES AND ORACLE
|
| 356 |
+
|
| 357 |
+
The language-conditioned LB baseline is fully described in the main document.
|
| 358 |
+
|
| 359 |
+
# D.1 EXPERT BUCKETS ORACLE
|
| 360 |
+
|
| 361 |
+
In the EXPERT BUCKETS oracle, the automatic bucket generation of DECSTR is replaced with an expert-predefined set of buckets using a priori measures of similarity and difficulty. To define these buckets, one needs prior knowledge of the set of unreachable configurations, which are ruled out. The 5 predefined buckets contain all configurations characterized by:
|
| 362 |
+
|
| 363 |
+
• Bucket 1: a single close relation between a pair of objects and no above relations (4 configurations).
|
| 364 |
+
• Bucket 2: 2 or 3 close relations and no above relations (4 configurations).
|
| 365 |
+
• Bucket 3: 1 stack of 2 blocks and a third block that is either away or close to the base, but is not close to the top of the stack (12 configurations).
|
| 366 |
+
• Bucket 4: 1 stack of 2 blocks and the third block close to the stack, as well as pyramid configurations (9 configurations).
|
| 367 |
+
• Bucket 5: stacks of 3 blocks (6 configurations).
|
| 368 |
+
|
| 369 |
+
These buckets are the only difference between the EXPERT BUCKETS baseline and DECSTR.
|
| 370 |
+
|
| 371 |
+
# D.2 LGB-C BASELINE
|
| 372 |
+
|
| 373 |
+
The LGB-C baseline represent goals not as semantic configurations but as particular 3D targets positions for each block, as defined for example in Lanier et al. (2019) and Li et al. (2019). The goal vector size is also 9 and contains the 3D target coordinates of the three blocks. This baselines also implements decoupling and, thus, can be compared to DECSTR in the three phases. We keep as many modules as possible common with DECSTR to minimize the amount of confounding factors and reduce the under-fitting bias. The goal selection is taken from DECSTR, but converts semantic configuration into specific randomly-sampled target coordinates for the blocks, see Figure 5. The agent is not conditioned on its current semantic configuration nor its semantic goal configuration. For this reason, we do not apply the symmetry bias. The binary reward is positive when the maximal distance between a block and its target position is below $5 \mathrm { c m }$ , i.e. the size of a block (similar to (Andrychowicz et al., 2017)). To make this baseline competitive, we integrate methods from a state of the art block manipulation algorithm (Lanier et al., 2019). The agent receives positive rewards of 1, 2, 3 when the corresponding number of blocks are well placed. We also introduce the multi-criteria HER from Lanier et al. (2019). Finally, we add an additional object-centered inductive bias by only considering, for each Deep Sets module, the 3D target positions of the corresponding pair.That is, for each object pair, we ignore the 3D positions of the remaining object, yielding to a vector of size 6. Language grounding is based on a C-VAE similar to the one used by DECSTR. We only replace the cross-entropy loss by a mean-squared loss due to the continuous nature of the target goal coordinates. We use the exact same training and testing sets as with semantic goals.
|
| 374 |
+
|
| 375 |
+

|
| 376 |
+
Figure 5: The LGB-C baseline samples target positions for each block (example for a pyramid here).
|
| 377 |
+
|
| 378 |
+
# E ADDITIONAL RESULTS
|
| 379 |
+
|
| 380 |
+
# E.1 COMPARISON DECSTR - LGB-C IN SKILL LEARNING PHASE
|
| 381 |
+
|
| 382 |
+
Figure 6 presents the average success rate over the 35 valid configurations during the skill learning phase for DECSTR and the LGB-C baseline. Because LGB-C cannot pursue semantic goals as such, we randomly sample a specific instance of this semantic goal: target block coordinates that satisfy the constraints expressed by it. Because LGB-C is not aware of the original semantic goal, we cannot measure success as the ability to achieve it. Instead, success is defined as the achievement of the corresponding specific goal: bringing blocks to their respective targets within an error margin of $5 \mathrm { { c m } }$ each. In short, DECSTR targets semantic goals and is evaluated on its ability to reach them. LGB-C targets specific goals and is evaluated on its ability to reach them. These two measures do not match exactly. Indeed, LGB-C sometimes achieves its specific goal but, because of the error margins, does not achieve the original semantic goal.
|
| 383 |
+
|
| 384 |
+

|
| 385 |
+
Figure 6: Comparison DECSTR and LGB-C in the skill learning phase.
|
| 386 |
+
|
| 387 |
+
# E.2 AUTOMATIC BUCKET GENERATION.
|
| 388 |
+
|
| 389 |
+
Figure 7 depicts the evolution of the content of buckets along training (epochs 1, 50 and 100). Each pie chart corresponds to a reachable configuration and represents the distribution of configurations into buckets across 10 different seeds. Blue, orange, green, yellow, purple represent buckets 1 to 5 respectively and grey are undiscovered configurations. At each moment, the discovered configurations are equally spread over the 5 buckets. A given configuration may thus change bucket as new configurations are discovered, so that the ones discovered earlier are assigned buckets with lower indexes. Goals are organized by their bucket assignments in the Expert Buckets condition (from top to bottom).
|
| 390 |
+
|
| 391 |
+
After the first epoch (left), DECSTR has discovered all configurations from the expert buckets 1 and 2, and some runs have discovered a few other configurations. After 50 epochs, more configurations have been discovered but they are not always the same across runs. Finally, after 100 epochs, all configurations are found. Buckets are then steady and can be compared to expert-defined buckets. It seems that easier goals (top-most group) are discovered first and assigned in the first-easy buckets (blue and orange). Hardest configurations (stacks of 3, bottom-most group) seem to be discovered last and assigned the last-hardest bucket (purple). In between, different runs show different compositions, which are not always aligned with expert-defined buckets. Goals from expert-defined buckets 3 and 4 (third and fourth group from the top) seem to be attributed different automatic buckets in different runs. This means that they are discovered in different orders depending on the runs. In summary, easier and harder goals from expert buckets $1 \textrm { - } 2$ and 5 respectively seem to be well detected by our automatic bucket generations. Goals in medium-level expected difficulty as defined by expert buckets seem not to show any significant difference in difficulty for our agents.
|
| 392 |
+
|
| 393 |
+
# E.3 DECSTR LEARNING TRAJECTORIES
|
| 394 |
+
|
| 395 |
+
Figure 8 shows the evolution of internal estimations of the competence C, the learning progress LP and the associated sampling probabilities P. Note that these metrics are computed online by
|
| 396 |
+
|
| 397 |
+

|
| 398 |
+
Figure 7: Evolution of the content of buckets from automatic bucket generation: epoch 1 (2400 episodes, left), 50 (middle) and 100 (right). Each pie chart corresponds to one of the 35 valid configurations. It represents the distribution of the bucket attributions of that configuration across 10 runs. Blue, orange, green, yellow, purple represent automatically generated buckets 1 to 5 respectively (increasing order of difficulty) and grey represents undiscovered configurations. Goals are organized according to their expert bucket attributions in the Expert Buckets condition (top-bottom organization).
|
| 399 |
+
|
| 400 |
+
DECSTR, as it self-evaluates on random discovered configurations. Learning trajectories seem to be uniform across different runs, and buckets are learned in increasing order. This confirms that the time of discovery is a good proxy for goal difficulty. In that case, configurations discovered first end up in the lower index buckets and are indeed learned first. Note that a failing automatic bucket generation would assign goals to random buckets. This would result in uniform measures of learning progress across different buckets, which would be equivalent to uniform goal sampling. As Main Figure 3c shows, DECSTR performs much better than the random goals conditions. This proves that our automatic bucket algorithm generates useful goal clustering.
|
| 401 |
+
|
| 402 |
+

|
| 403 |
+
Figure 8: Learning trajectories of 6 DECSTR agents.
|
md/train/e5vrkfc5aau/e5vrkfc5aau.md
ADDED
|
@@ -0,0 +1,288 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Towards Multi-Grained Explainability for Graph Neural Networks
|
| 2 |
+
|
| 3 |
+
Xiang Wang§†‡, Ying-Xin Wu§, An Zhang†, Xiangnan $\mathbf { H e } ^ { \ S } ;$ ∗, Tat-Seng Chua†
|
| 4 |
+
|
| 5 |
+
‡Sea-NExT Joint Lab †National University of Singapore §University of Science and Technology of China xiangwang@u.nus.edu, wuyxin@mail.ustc.edu.cn, an_zhang@nus.edu.sg xiangnanhe@gmail.com, dcscts@nus.edu.sg
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
When a graph neural network (GNN) made a prediction, one raises question about explainability: “Which fraction of the input graph is most influential to the model’s decision?” Producing an answer requires understanding the model’s inner workings in general and emphasizing the insights on the decision for the instance at hand. Nonetheless, most of current approaches focus only on one aspect: (1) local explainability, which explains each instance independently, thus hardly exhibits the class-wise patterns; and (2) global explainability, which systematizes the globally important patterns, but might be trivial in the local context. This dichotomy limits the flexibility and effectiveness of explainers greatly. A performant paradigm towards multi-grained explainability is until-now lacking and thus a focus of our work. In this work, we exploit the pre-training and fine-tuning idea to develop our explainer and generate multi-grained explanations. Specifically, the pre-training phase accounts for the contrastivity among different classes, so as to highlight the class-wise characteristics from a global view; afterwards, the fine-tuning phase adapts the explanations in the local context. Experiments on both synthetic and real-world datasets show the superiority of our explainer, in terms of AUC on explaining graph classification over the leading baselines. Our codes and datasets are available at https://github.com/Wuyxin/ReFine.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
While graph neural networks (GNNs) [1, 2] have achieved great success in a variety of applications, they usually come as black-box models. The general problem about GNN explainability [3] is to answer “What knowledge does the model use to arrive at the conclusions in general and the specific decision at hand?”. Thoroughly answering this question requires the global understanding of the model’s inner workings and the local insights on a specific instance. Take a GNN model for molecular property prediction as an example. The global understanding exhibits the knowledge encoded in the model, such as the distribution of the chemical groups; meanwhile, the local insight identifies certain chemical groups responsible for a given molecule’s property. Such multi-grained explainability flexibly and reliably inspects the decision-making process of the GNN [4, 5], which is critical to the applications on safety, fairness, and privacy [6, 7].
|
| 14 |
+
|
| 15 |
+
In the field of GNN explainability [8], explainer models broadly attribute model prediction to the input graph, then sample a salient subgraph as the explanation for the model prediction. However, most of current explainers focus on either on local [9, 10, 6, 11, 12] or global explainability [13, 7], thereby suffer from inherent limitations correspondingly:
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Explanations on Visual Genome dataset generated from ReFine, including the pre-training and fine-tuning phases. Right indicates the changes before and after the fine-tuning.
|
| 19 |
+
|
| 20 |
+
• Local explainability aims to customize the explanatory subgraph for each instance individually. However, such local explanations fall short in systematizing the prototypical patterns shared within a class or group of instances. Thus, they lack the global understanding of the model’s workings [7, 13], which is vital to generalize to other instances being explained. • Global explainability targets at the globally important patterns across multiple instances, which could violate the local fidelity [14] — the globally important substructure may not be important or even appear in the local context, thus might fail to explain a specific instance reliably.
|
| 21 |
+
|
| 22 |
+
Briefly put, these approaches overlook the multi-granularity nature of explainability, while we argue that the local and global explainability should be exhibited simultaneously to obtain faithful explanations. Taking Figure 1 as an example, the global explainability differentiates the explanations for various classes, such as livestock-background subgraphs for the farm class, human-sports subgraphs for the stadium class. When zooming in a specific scene graph, the local explainability refines on the farm-wise patterns and specifies (sheep, on, meadow) as the final explanation. A paradigm towards such multi-grained explainability is until-now lacking, to the best of our knowledge.
|
| 23 |
+
|
| 24 |
+
Towards multi-grained explainability, we propose a novel explainer, ReFine, with pre-training and fine-tuning [15, 16] techniques for explaining GNN models. Specifically, pre-training aims to answer “What class-wise knowledge does the GNN leverage to make predictions in general?”. We combine the contrastive learning [17, 18] into class-wise generative probabilistic models [7], thereby approach coarser-grained explanations (i.e. saliency maps of all edges). Going beyond the global view, fine-tuning is to answer “Why the GNN model made the certain prediction for the instance at hand?”, where we upgrade the coarser-grained explanations to the finer-grained explanations (i.e. explanatory subgraphs of salient edges). Through this way, ReFine can faithfully generate multigrained explanations, and we empirically show its effectiveness as compared to some state-of-the-art explainers [9, 6, 7, 19]. It is also worth mentioning that, although the general understanding of GNN predictions has been considered in a recent work PGExplainer [7], it is only exploited to train a generative probabilistic model shared across all the explained instances, rather than dissecting and modeling the class-wise knowledge explicitly. Overall, our contributions are summarized as:
|
| 25 |
+
|
| 26 |
+
• We investigate the local explainability and global explainability for explaining GNNs and put forward the concept of multi-grained explainability. • We propose a pre-training and fine-tuning framework to generate multi-grained explanations, which has both global understanding of model workings and local insights on specific instances. • We achieve state-of-the-art performance on various datasets w.r.t. predictive accuracy on explaining GNNs. Quantitative and qualitative results verify multi-granularity explainability of ReFine.
|
| 27 |
+
|
| 28 |
+
# 2 Background & Task Formulation
|
| 29 |
+
|
| 30 |
+
In this section, we begin with the backgrounds on GNNs and frame the task of generating multigrained explainability for GNN models.
|
| 31 |
+
|
| 32 |
+

|
| 33 |
+
Figure 2: Model construction of proposed ReFine. Left represents the pre-training phase for a graph example, which is labeled and predicted as “Cycle”, from the BA-3motif dataset. Right demonstrates the fine-tuning process where the saliency map is fine-tuned on the instance to achieve local fidelity.
|
| 34 |
+
|
| 35 |
+
Graph Neural Networks. We denote the graph data as $\mathcal { G } = ( \nu , \mathcal { E } )$ with the node set $\nu$ and the edge set $\mathcal { E }$ . The structural feature of a graph can be represented by an adjacency matrix $\mathbf { A } \in \{ 0 , 1 \} ^ { | \mathcal { V } | \times | \mathcal { V } | }$ where $A _ { i j } = 1$ indicates an edge starting from node $i$ to node $j$ , and $A _ { i j } = 0$ otherwise. The node feature matrix is represented as $\mathbf { X } \in \mathbb { R } ^ { | \nu | \times d }$ .
|
| 36 |
+
|
| 37 |
+
Graph neural networks (GNNs) [1, 2] aim to generate powerful representation on graphs in an end-to-end fashion. Such representation facilitates the downstream tasks, such as node classification [20, 21], link prediction [22, 23, 24, 25], and graph classification [26]. Without loss of generality, we consider a graph classifier $f : \mathbb { G } \to \mathbb { R } ^ { \bar { C } }$ , which classifies an input graph $\mathcal { G } \in \mathbb { G }$ in $C$ categories and outputs prediction by $c = \arg \operatorname* { m a x } _ { i } f ( \mathcal { G } ) _ { i }$ . Typically, $f$ consists of three components: (1) learning of node representations, which distills vectorized information from neighboring nodes and updates node representations recursively; (2) learning of graph representation, which aggregates the node representations to establish the representation for the holistic graph; (3) graph classification, which maps the graph representation into the probability distribution of different categories.
|
| 38 |
+
|
| 39 |
+
Explaining Graph Neural Networks. The explainer model (aka. the explanation method) usually performs two consecutive operations: (1) feature attribution [27, 28], which associates each feature of an input $\mathcal { G } \in \mathbb { G }$ with the relevance score for the classifier’s prediction; (2) feature selection [29, 6], which extracts salient features based on the relevance scores to construct an explanatory subgraph. The subgraph is regarded as the evidence for the GNN to make the prediction.
|
| 40 |
+
|
| 41 |
+
We follow previous works [6, 7, 10, 19] and focus on the contributions of the structural features (i.e. edges). Our explainer consists of two components: an attribution module $\tau$ for edge attribution and a selection module $\mathcal { H }$ for edge selection. Specifically, $\tau$ assigns the adjacency matrix $\mathbf { A }$ with a saliency map, i.e.
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
\mathbf { M } = { \mathcal { T } } ( { \mathcal { G } } , f , c ) ,
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
where $\mathbf { M } \in \mathbb { R } ^ { | \mathcal { V } | \times | \mathcal { V } | }$ , each element of which is the importance score of the edge to the prediction class $c$ . Such saliency map can further result in an attentive graph $\mathcal { G } _ { a t t } = \mathbf { A } \odot \mathbf { M }$ . Then, the selection module $\mathcal { H }$ identifies the edges of explanatory subgraph based on the attentive graph:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\mathbf { S } = \mathcal { H } ( \mathcal { G } _ { a t t } , f , c , \rho ) ,
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
where $\mathbf { S } \in \mathbb { R } ^ { | \mathcal { V } | \times | \mathcal { V } | }$ constructs the explanatory subgraph $\mathcal { G } _ { e x p } = \mathbf { A } \odot \mathbf { S }$ , and $\rho$ is the explanation budget [27] that equals to the number of nonzero elements in $\mathbf { s }$ .
|
| 54 |
+
|
| 55 |
+
# 3 Methodology
|
| 56 |
+
|
| 57 |
+
Here we present our explainer that purses multi-grained explainability by pre-training and fine-tuning, as Figure 2 shows. In the pre-training phase, the attribution module distills the class-wise knowledge, which contrasts the salient structures based on the prediction, answering the question “Why did the GNN model assign a group of graphs with the same prediction?”. In the next phase, the selection module goes beyond the class-wise knowledge and fine-tunes the saliency maps on a specific instance for answering “Why the GNN model made the certain prediction for the specific graph?”.
|
| 58 |
+
|
| 59 |
+
# 3.1 Pre-training Towards Global Explainability
|
| 60 |
+
|
| 61 |
+
Class-aware Attribution Module. Towards the global explainability of GNN, it is important to specify the class-wise knowledge across the instances with the same prediction. Inspired by the success of generative models [7, 30, 31] in capturing the succinct structures from the graphs, we hire multiple generative probabilistic models [7] as our attribution models (short for attributor), i.e. $\mathcal { T } _ { \theta } = \{ \mathcal { T } ^ { ( c ) } | c = 1 , \cdots , C \}$ which is parameterized by $\theta$ . The attributor $\mathcal { T } ^ { \left( c \right) }$ is responsible for uncovering the hidden patterns from some graph instances $O ^ { ( c ) } = \{ \mathcal { G } | c = \arg \operatorname* { m a x } _ { i } f ( \mathcal { G } ) _ { i } \}$ with the same prediction class $c$ .
|
| 62 |
+
|
| 63 |
+
Formally, each attributor $\mathcal { T } ^ { \left( c \right) }$ is composed of a GNN encoder $\mathrm { G N N } ^ { ( c ) }$ and a MLP decoder $\mathbf { M L P } ^ { ( c ) }$ , whose parameters are shared when explaining graphs in $\mathcal { O } ^ { ( c ) }$ , so as to systematize the class-wise patterns. Next we introduce the construction of each class-wise attributor, while we omit the superscript for conciseness. Specifically, the encoder GNN embeds each node $i$ in $\mathcal { G }$ with representation $\mathbf { z } _ { i }$ and summarize the representations of all nodes as:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\mathbf { Z } = \mathbf { G N N } ( { \mathcal { G } } , \mathbf { X } ) ,
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where $\mathbf { Z } \in \mathbb { R } ^ { | \nu | \times d ^ { \prime } }$ encodes the structural feature $\mathbf { A }$ and node feature $\mathbf { X }$ . On the top of the node representations, we model the graph structure as edge distributions and frame the generation of explanatory subgraphs by sampling from the edge distributions:
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
P ( \mathbf { M } | \mathbf { Z } ) = \prod _ { ( i , j ) \in \mathcal { E } } P ( M _ { i j } | \mathbf { z } _ { i } , \mathbf { z } _ { j } ) ,
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
where $M _ { i j }$ indicates the importance of edge $( i , j )$ . Then the MLP encoder takes the concatenation of node representations $\mathbf { z } _ { i }$ and $\mathbf { z } _ { j }$ as the inputs and outputs the importance score. To approximate the importance score to the discrete distribution and optimize the generator via gradient propagation, we adopt the reparameterization trick [7], where an independent random variable $\epsilon \sim \mathrm { U n i f o r m } ( 0 , 1 )$ is introduced. As such, the edge probability is formulated as:
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
P ( M _ { i j } | \mathbf { z } _ { i } , \mathbf { z } _ { j } ) = \sigma ( ( \log \frac { \epsilon } { 1 - \epsilon } + \alpha _ { i j } ) / \beta ) , \quad \mathrm { w i t h } \quad \alpha _ { i j } = \mathbf { M L P } ( [ \mathbf { z } _ { i } , \mathbf { z } _ { j } ] ) ,
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
where $\sigma$ is the sigmoid function, and $\beta$ denotes the temperature hyperparameter. It is worth emphasizing that our attributors is different from PGExplainer [7], where only one generative probabilistic model is involved. Thus, their attribution results are limited in differentiating the patterns of different classes and systematizing the class-wise knowledge.
|
| 82 |
+
|
| 83 |
+
Pre-training Class-wise Attribution Module. We devise the following objective function for training the class-wise attributors.
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\operatorname* { m i n } _ { \theta } \mathcal { L } _ { 1 } + \gamma \mathcal { L } _ { c t s } ,
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
where $\gamma$ is the trade-off hyperparameter. We start from maximizing the mutual information between the attentive graphs and the target prediction of the graph, which is a widely-used learning paradigm in the literature [32, 6, 7]. It guides us to find the prediction-relevant explanatory subgraph, which equals to minimizing the following loss:
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
\mathcal { L } _ { 1 } = - \mathbb { E } _ { \mathcal { G } } \mathbb { E } _ { \epsilon } \mathbb { E } _ { c ^ { \prime } } [ P ( Y = c ^ { \prime } | G = \mathcal { G } ) \log P ( Y = c ^ { \prime } | G = \mathcal { G } _ { a t t } ^ { ( c ) } ) ] ,
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
where $G$ and $Y$ are the graph and prediction variables, respectively; $\mathcal { G }$ is the full graph instance to explain; by sampling $\epsilon \in { \mathrm { U n i f o r m } } ( 0 , 1 )$ and $c ^ { \prime } \in \{ 1 , \cdots , C \}$ , the class-wise saliency map $\mathbf { M } ^ { ( c ) }$ can be generated from Equation (4); $P ( Y = c ^ { \prime } | G = \mathcal { G } ) = f ( \mathcal { G } ) _ { c ^ { \prime } }$ is the output probabilities of the prediction being $c ^ { \prime }$ when feeding $\mathcal { G }$ to the GNN model $f$ ; analogously, $P ( Y = c ^ { \prime } | G = \mathcal { G } _ { a t t } ^ { ( c ) } ) =$ $f ( \mathcal { G } _ { a t t } ^ { ( c ) } ) _ { c ^ { \prime } }$ audits the output probability when feeding $\mathcal { G } _ { a t t } ^ { ( c ) } = \mathbf { A } \odot \mathbf { M } ^ { ( c ) }$ .
|
| 96 |
+
|
| 97 |
+
Moreover, we introduce a contrastive learning [33, 34, 18, 35, 36, 37] loss to emphasize differences among the class-wise patterns — the substructure of the full graph that is distant to that of the graphs with a different prediction but close to that of the graphs with the same prediction. It makes each attributor focus on the unique and discriminative information within the class. Specifically, for the saliency maps $\mathcal { G } _ { a t t 1 } ^ { ( c _ { 1 } ) }$ of $\mathcal { G } _ { 1 }$ and $\mathcal { G } _ { a t t 2 } ^ { ( c _ { 2 } ) }$ of $\mathcal { G } _ { 2 }$ , it encourages the agreements between $\mathcal { G } _ { a t t 1 } ^ { ( c _ { 1 } ) }$ and $\mathcal { G } _ { a t t 2 } ^ { ( c _ { 2 } ) }$ when , compared to that when $c _ { 1 } \neq c _ { 2 }$ :
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\mathcal { L } _ { c t s } = \mathbb { E } _ { \mathcal { G } , \mathcal { G } ^ { \prime } } \mathbb { E } _ { \epsilon , \epsilon ^ { \prime } } [ ( - 1 ) ^ { \mathbb { I } ( c _ { 1 } = c _ { 2 } ) } \times \mu ( \ell ( \mathcal { G } _ { a t t 1 } ^ { ( c _ { 1 } ) } , \mathcal { G } _ { a t t 2 } ^ { ( c _ { 2 } ) } ) ) ] ,
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
where as the $\mu$ is the softplus function [3presentation similarity — $\ell$ arity bewhere een two subgraphs, which is setis the graph representations by $\ell ( \mathcal { G } _ { a t t 1 } ^ { ( c _ { 1 } ) } , \mathcal { G } _ { a t t 2 } ^ { ( c _ { 2 } ) } ) = \mathbf { h } _ { 1 } ^ { \top } \mathbf { h } _ { 2 }$ $\mathbf { h } _ { 1 }$
|
| 104 |
+
feeding G(c1)att1 into the encoder $\mathrm { G N N } ^ { ( c _ { 1 } ) }$ and aggregating the node representations. Similar for $\mathbf { h } _ { 2 }$ . In addition, following [6], we adopt the element-wise entropy and $L _ { 1 }$ norm on the edge probability. By jointly optimizing these two losses in Equation (6), the class-wise attribution module learns to stratify the discriminative information for different classes and generate the saliency maps with a global view of the target GNN. Taking an information-theoretical look at Equation (8), minimizing contrastive learning loss is maximizing a lower bound of the mutual information between the latent graph representations of two graphs within the same class.
|
| 105 |
+
|
| 106 |
+
# 3.2 Fine-tuning Towards Local Explainability
|
| 107 |
+
|
| 108 |
+
Having established the saliency map that exhibits the importance of each edge, the standard way is to rank all edges based on their importance scores and simply select the top edges as the explanatory subgraphs. However, we argue that such a coarser-grained selection fails to consider the dependencies of these selected edges explicitly. Within a high-quality explanatory subgraph, edges are supposed to cooperate with each other, form the coalition, and approach the target prediction better than individuals [38, 39]. Without considering such coalition effect, the quality of the explanatory subgraph is greatly limited.For example, when explaining why the molecule graph is classified as mutagenic [13], two connected nitrogen-oxygen (N-O) bonds form a chemical group $\mathrm { N O _ { 2 } }$ and present more discriminative information about the mutagenic property [13]; whereas, two salient but disconnected N-O bonds from different chemical groups are less informative to interpret the mutagenic property.
|
| 109 |
+
|
| 110 |
+
Clearly, the coarser-grained saliency maps are insufficient to exhibit the coalition effect of edges, thus might be redundant and suboptimal explanations. Hence, we move forward to learn a finer-grained explanatory subgraph. Technically, on the top of the well-trained class-wise attribution module, we add the selection module:
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
\mathbf { S } ^ { ( c ) } = \mathcal { H } ( \mathcal { G } _ { a t t } ^ { ( c ) } , f , c , \rho ) ,
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
where $\rho$ is the number of edges selected in the explanatory subgraph; $\mathcal { H }$ is a sampling (selection) function; $\mathbf { S } ^ { ( c ) }$ preserves the elements selected by the selection function and sets the other elements as 0. Instead of the hard selection that picks up the edges with the highest probability, $\mathcal { H }$ samples edges according to their probabilities. Allowing edges with low probabilities to be sampled can prevent the explainer from collapsing to suboptimal solutions with limited coalition effect.
|
| 117 |
+
|
| 118 |
+
With the new stochastic adjacency matrix $\mathbf { S } ^ { ( c ) }$ , we are able to extract the subgraph $\mathcal { G } _ { e x p } ^ { ( c ) }$ . To fine-tune the attribution and selection modules, we resort to maximize the mutual information between the explanation candidate $\mathcal { G } _ { e x p } ^ { ( c ) }$ and the target prediction of the full graph:
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\mathcal { L } _ { 2 } = - \mathbb { E } _ { \mathcal { G } } \mathbb { E } _ { \epsilon } \mathbb { E } _ { c ^ { \prime } } [ P ( Y = c ^ { \prime } | G = \mathcal { G } ) \log P ( Y = c ^ { \prime } | G = \mathcal { G } _ { e x p } ^ { ( c ) } ) ] .
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
By optimizing the loss above, the selection module accounts for the edge coalition within $\mathbf { S } ^ { ( c ) }$ , so as to achieve higher local fidelity. Moreover, as the selection module discards some elements in the stochastic adjacency matrix, it blocks parts of gradient backpropagation and possibly acts as a dropout function to avoid the overfitting on the instance-level explanations.
|
| 125 |
+
|
| 126 |
+
# 4 Experiments
|
| 127 |
+
|
| 128 |
+
We mainly aim to investigate the following questions:
|
| 129 |
+
|
| 130 |
+
• RQ1: How effective is the pre-training phase of ReFine, as compared to that of existing methods? • RQ2: How effective is the fine-tuning phase of ReFine, as compared to that of the pre-training phase?
|
| 131 |
+
|
| 132 |
+
# 4.1 Experimental Settings
|
| 133 |
+
|
| 134 |
+
Datasets and Target GNNs. We consider four datasets with various target GNNs:
|
| 135 |
+
|
| 136 |
+
• Molecule graph classification. We use the Mutagenicity dataset [40, 41], where 4, 337 molecule graphs are classified into two classes based on their mutagenic effect on a bacterium. The welltrained Graph Isomorphism Network (GIN) [26, 42] has achieved a $100 \%$ testing accuracy.
|
| 137 |
+
|
| 138 |
+
• Scene graph classification. Following the previous work [10], we select 4, 443 (images, scene graphs) pairs from Visual Genome [43] to construct the VG-5 dataset. Wherein, the graphs are labeled with five classes: stadium, street, farm, surfing, forest. Each graph contains regions of the objects as the nodes, while edges indicates the relationships between object nodes. The target GNN is an APPNP [44] which achieves $6 4 . 3 \%$ testing accuracy.
|
| 139 |
+
|
| 140 |
+
• Handwriting graph classification. We use the MNIST superpixel dataset [45], which converts 70,000 images into the graphs of superpixel adjacency. Every graph is labeled as one of ten digit classes. We trained a Spline-based GNN [46] which gains $9 7 . 9 \%$ accuracy in the testing dataset.
|
| 141 |
+
|
| 142 |
+
• Motif graph classification. We follow prior studies [6, 7] to create a synthetic dataset, BA-3motif, which contains 3,000 graphs. Specifically, we adopt the Barabasi-Albert (BA) graphs as the base, and attach each base with one of three motifs: house, cycle, grid. The trained GNN model, ASAP [47], classifies them according to the type of attached motifs and achieved $100 \%$ testing accuracy.
|
| 143 |
+
|
| 144 |
+
Baselines. We compare our ReFine with the state-of-the-art explanation methods:
|
| 145 |
+
|
| 146 |
+
• SA [9] directly uses the gradients of the model prediction w.r.t. the adjacency matrix of the input graph as the importance of edges.
|
| 147 |
+
• GNNExplainer [6] applies the soft masks on the messages carried by edges, where each mask indicates an edge’s importance. Note that the masks of graph instances are trained individually.
|
| 148 |
+
• PGExplainer [7] hires a neural network to learn to generate the masks for the input edges. The generative model is trained over multiple explained instances.
|
| 149 |
+
• PGM-Explainer [19] collects the prediction change on the random node perturbations, and then learns a Bayesian network from these perturbation-prediction observations, so as to capture the dependencies among the nodes and the prediction. Here we transfer it to model the edge importance.
|
| 150 |
+
|
| 151 |
+
Optimization. For the parametric explanation methods (GNNExplainer, PGExplainer, PGMExplainer), we apply a grid search to tune their own hyperparameters. For our ReFine framework, we use the Adam optimizer and set the learning rate of pre-training and fine-tuning as 1e-3 and 1e-4, respectively. All experiments are done on a single Tesla V100 SXM2 GPU (32 GB).
|
| 152 |
+
|
| 153 |
+
Evaluation Metrics. It is challenging to quantitatively evaluate the quality of explanations, since the ground-truth explanations are usually unavailable. In the literature, there are three widely-used evaluation metrics:
|
| 154 |
+
|
| 155 |
+
• Predictive Accuracy $( \mathbf { A C C } @ \rho )$ [32, 48, 27]. It measures the fidelity of the explanatory subgraphs by feeding it solely into the target model and auditing how well it recovers the target prediction. We report the average $\operatorname { A C C } @ \rho$ over all graphs in the testing sets, and further denote ACC-AUC as the area under the ACC curve over different selection ratios $\rho \in \{ 0 . 1 , 0 . 2 , \cdot \cdot \cdot , 0 . 9 , 1 . 0 \}$ . $\operatorname { A C C } @ \rho$ and ACC-AUC are suitable for all the datasets.
|
| 156 |
+
|
| 157 |
+
• Recall $@ N$ . As suggested in prior studies [6, 7, 32], we can create the “ground-truth explanations” for the synthetic dataset. Specifically, for BA-3motif, the motif of each graph can be viewed as the discriminative information coherent in the model knowledge. As such, we can frame the evaluation problem as the task of top edge ranking. To be more specific, for an explanatory subgraph, the edges within the motif are positive, while the others are negative. To this end, recall can be adopted as the evaluation protocols. More formally, Recall $\ @ N = \mathbb { E } _ { \boldsymbol { \mathcal { G } } } [ | \mathcal { G } _ { s } \cap \mathcal { G } _ { s } ^ { * } | / | \mathcal { G } _ { s } ^ { * } | ]$ where $\mathcal { G } _ { s }$ is composed of the top- $N$ edges and $\mathcal { G } _ { s } ^ { * }$ is the ground-truth explanatory subgraph.
|
| 158 |
+
|
| 159 |
+
# 4.2 Quantitative Evaluations
|
| 160 |
+
|
| 161 |
+
Influence of Pre-training (RQ1). To investigate the effectiveness of pre-training, we first compare the performance of the attribution module with the state-of-the-art explainers. We denote this variant by ReFine-FT, which disables the fine-tuning phase and simply constructs the explanatory subgraphs based on the saliency scores. Moreover, we build another variant ReFine-CT, which removes the contrastive loss (Equation (8)) from the pre-training phase, to study the effect of the contrastive loss on the class-wise knowledge modeling. To be more clear, we present the difference of PGExplainer [7], ReFine and its ablation models in Table 4.2. Table 2 presents the performance comparisons, from which we have several findings:
|
| 162 |
+
|
| 163 |
+
Table 1: Structure/Training Difference of PGExplainer, ReFine and its ablation models.
|
| 164 |
+
|
| 165 |
+
<table><tr><td rowspan="2"></td><td colspan="2">Pre-training</td><td rowspan="2">Fine-tuning</td></tr><tr><td>Class-wise Attributors</td><td>Contrastive Learning</td></tr><tr><td>PG-Explainer</td><td></td><td></td><td></td></tr><tr><td>Refine-CT</td><td></td><td></td><td></td></tr><tr><td>Refine-FT</td><td></td><td></td><td></td></tr><tr><td>Refine</td><td></td><td></td><td></td></tr></table>
|
| 166 |
+
|
| 167 |
+
Table 2: Comparison of our ReFine and other baseline explainers
|
| 168 |
+
|
| 169 |
+
<table><tr><td rowspan="2"></td><td rowspan="2">Mutagenicity ACC-AUC</td><td rowspan="2">VG-5 ACC-AUC</td><td rowspan="2">MNIST ACC-AUC</td><td colspan="2">BA-3motif</td></tr><tr><td>ACC-AUC</td><td>Recall@5</td></tr><tr><td>SA</td><td>0.769</td><td>0.769</td><td>0.559</td><td>0.518</td><td>0.243</td></tr><tr><td>GNNExplainer</td><td>0.895±0.010</td><td>0.895±0.003</td><td>0.535±0.013</td><td>0.528±0.005</td><td>0.157±0.002</td></tr><tr><td>PG-Explainer</td><td>0.631±0.008</td><td>0.790±0.004</td><td>0.504±0.010</td><td>0.586±0.004</td><td>0.293±0.001</td></tr><tr><td>PGM-Explainer</td><td>0.714±0.007</td><td>0.792±0.001</td><td>0.615±0.003</td><td>0.575±0.002</td><td>0.250±0.000</td></tr><tr><td>ReFine-CT</td><td>0.888±0.008</td><td>0.891±0.002</td><td>0.526±0.007</td><td>0.610±0.004</td><td>0.248±0.001</td></tr><tr><td>ReFine-FT</td><td>0.945±0.011</td><td>0.906±0.002</td><td>0.587±0.008</td><td>0.616±0.003</td><td>0.299±0.002</td></tr><tr><td>ReFine</td><td>0.955±0.005</td><td>0.914±0.001</td><td>0.636±0.003</td><td>0.630±0.006</td><td>0.304±0.000</td></tr><tr><td>Relative Impro.</td><td>6.7%</td><td>2.1%</td><td>3.4%</td><td>7.5%</td><td>3.8%</td></tr></table>
|
| 170 |
+
|
| 171 |
+
• ReFine-FT outperforms the baseline explainers in most cases. To be more specific, it achieves significant relative improvements over the strongest baselines w.r.t. ACC-AUC by $5 . 6 \%$ and $5 . 1 \%$ in Mutagenicity and BA-3motif, respectively. This demonstrates the rationality and effectiveness of the attribution module. We attribute these improvements to the class-wise knowledge modeling: (1) By specifying the attributor models for each class, ReFine-FT is able to capture the underlying patterns shared across the instances within the same class; and (2) Conducting the contrastive learning between different class-aware attributors makes ReFine-FT better stratify the discriminative information for different classes. The class-wise knowledge endows ReFine-FT with the global view of the target model’s workings.
|
| 172 |
+
• Although PGExplainer is also equipped with the global view of the target model, its performance is worse than that of ReFine-FT. We ascribe this to the limitations of PGExplainer’s global view, which is founded upon all the explained instances, but fails to differentiate the class-wise patterns. This again verifies the rationality and effectiveness of our attribution module.
|
| 173 |
+
• ReFine-FT outperforms ReFine-CT by a large margin, indicating that the contrastive learning plays a critical role in exhibiting the class-wise knowledge. Specifically, it summarizes the patterns across similar instances and focuses on the information pertinent to specific classes, while filtering the irrelevant and redundant information out.
|
| 174 |
+
• Interestingly, in MNIST, the result of ReFine-FT is worse than that of PGM-Explainer. One possible reason is that the random perturbations in PGM-Explainer create a collection of broken graphs and offer a more comprehensive observation of the graphs. We leave the exploration of subgraph-prediction relations as future work.
|
| 175 |
+
|
| 176 |
+
Influence of Fine-tuning (RQ2). To justify the effectiveness of the fine-tuning phase, we report the performance of ReFine with our selection module in Tables 2 and 3, as compared to the performance before fine-tuning. We have the following observations:
|
| 177 |
+
|
| 178 |
+
Table 3: Performance under different selection ratios before and after fine-tuning.
|
| 179 |
+
|
| 180 |
+
<table><tr><td rowspan="2">ACC@p</td><td colspan="2">Mutagenicity</td><td colspan="2">VG-5</td><td colspan="2">MNIST</td><td colspan="2">BA-3motif</td></tr><tr><td>0.4</td><td>0.6</td><td>0.4</td><td>0.6</td><td>0.4</td><td>0.6</td><td>0.4</td><td>0.6</td></tr><tr><td>ReFine-FT</td><td>96.8%</td><td>94.0%</td><td>91.3%</td><td>91.4%</td><td>41.4%</td><td>61.4%</td><td>36.0%</td><td>65.7%</td></tr><tr><td>ReFine</td><td>97.8%</td><td>96.2%</td><td>92.2%</td><td>93.4%</td><td>71.4%</td><td>82.0%</td><td>39.0%</td><td>72.8%</td></tr><tr><td>Improvement</td><td>+1.0%</td><td>+2.2%</td><td>+0.9%</td><td>+2.0%</td><td>+30.0%</td><td>+20.6%</td><td>+3.0%</td><td>+7.1%</td></tr></table>
|
| 181 |
+
|
| 182 |
+

|
| 183 |
+
Figure 3: Qualitative Results in MNIST Superpixels dataset. Handwriting graphs are in black, which respectively represent number $\mathbf { \bar { \theta } } ^ { 6 6 } 0 ^ { 9 }$ , $^ { \cdot 6 } 2 ^ { \cdot }$ , “8” within each block from left to right. Explanatory graphs are in red, where the top $10 \%$ edges are highlighted.
|
| 184 |
+
|
| 185 |
+
• Fine-tuning with the selection module can improves the explanation performance sustainably, which indicates the effectiveness of our pre-training and fine-tuning paradigm. Specifically, in MNIST, the predictive accuracy of the explanations after fine-tuning improves from $4 1 . 4 \%$ to $7 1 . 4 \%$ when the selection rato is 0.4. We attribute these improvements to the local insights on specific instances: (1) Benefiting from the saliency map obtained in the pre-training phase, the selection module is able to filter noisy edges out and narrow down to where the target model looks to make decisions; (2) Fine-tuning the explanatory subgraphs considers the coalition effect of edges, thus approaches more information to recover the target prediction.
|
| 186 |
+
|
| 187 |
+
• Jointly analyzing Tables 2 and 3, ReFine consistently outperforms all baselines across the four datasets. Advantageous to the local or global explanations, our multi-grained explanations not only have the global understanding of model workings (i.e. the class-wise knowledge), but also account for the local insights on specific instances (i.e. the coalition effect of edges in the local context). It illustrates the superiority of our ReFine paradigm.
|
| 188 |
+
|
| 189 |
+
Overall, the empirical supports justify the significance of fine-tuning well. The contributions of fine-tuning w.r.t. the overall improvements over PG-Explainer are $3 7 . 1 \%$ and $3 1 . 8 \%$ in MNIST and BA-3motif datasets, respectively. One possible reason that fine-tuning contributes only $3 . 1 \%$ and $6 . 4 \%$ portion of overall improvements in Mutagenicity and VG-5 as compared to PG-Explainer is the existance of rich node features in these two datasets. With the assistance of node features, the global patterns might be well-captured durining pre-training, thus leaving little space for the local patterns to improve.
|
| 190 |
+
|
| 191 |
+
# 4.3 Qualitative Analysis
|
| 192 |
+
|
| 193 |
+
We present the qualitative results on MNIST superpixel in Figure 3, where the pre-trained and fine-tuned explanations are the explanatory subgraphs before fine-tuning (i.e. extracted based on the saliency map) and after fine-tuning (i.e. derived from the selection module), respectively.
|
| 194 |
+
|
| 195 |
+
Influence of Pre-training (RQ1). The pre-trained results (first row) well demonstrate the global patterns, where the explanatory subgraphs for interpreting the digit $\mathbf { \bar { \theta } } ^ { 6 } 0 ^ { 9 }$ focus more on the edges between hollows in the middle and the fringe of the number. While interpreting the prediction $\mathbf { \Delta } ^ { 6 6 } 5 ^ { 9 }$ , the explanations identify the edges spread on the bend of the number as the most important features. Also, we observe an interesting pattern in the results for explaining the prediction $\mathbf { \vec { \nu } } ^ { 6 } \mathbf { \vec { 8 } } ^ { 5 }$ , where the background edges draw more attention, rather than edges relevant to the digits, revealing the evidence for the target GNN to classify. It also shows the supporting evidence of the difference between the model explanation and the human explanation which focuses more on the digit graphs other than the background graphs. Through the pre-trained examples, the global patterns offer vital model understanding and inspections for the model’s decision-making process.
|
| 196 |
+
|
| 197 |
+

|
| 198 |
+
Figure 4: Qualitative Results in Mutagenicity dataset. The prediction of the molecule in the first row is mutagenic, while the molecule in the second row is predicted as non-mutagenic. The selection ratios range from $10 \%$ to $50 \%$ . Note that some opposite edges are visually coincident.
|
| 199 |
+
|
| 200 |
+
Table 4: Time costs (in second) of GNNExplainer, PG-Explainer and the fine-tuning phase of Refine.
|
| 201 |
+
|
| 202 |
+
<table><tr><td></td><td>Mutagenicity</td><td>VG-5</td><td>MNIST</td><td>BA-3motif</td></tr><tr><td>GNNExplainer</td><td>2.03</td><td>1.88</td><td>0.637</td><td>1.11</td></tr><tr><td>PG-Explainer</td><td>0.030</td><td>0.035</td><td>0.040</td><td>0.032</td></tr><tr><td>Refine(Fine-tuning)</td><td>0.821</td><td>0.583</td><td>0.535</td><td>0.423</td></tr></table>
|
| 203 |
+
|
| 204 |
+
Influence of Fine-tuning (RQ2). We now compare the pre-trained and fine-tuned explanations. Clearly, the fine-tuned explanatory graphs make clearer boundaries on the instances. The explanation adapted with the user-defined ratio pays greater attention to details that are only applicable to the specific instances. For example, one can take a closer look at the explanations in the 4-th column. Without the fine-tuning phase, the explanation may distracted by the edges across the digit and the background, such that these transition edges might be deemed as the most important features while achieve suboptimal predictive accuracies. In contrast, the fine-tuned explanation dispels such misunderstanding, with a higher local accuracy. Similar patterns can be found in other examples.
|
| 205 |
+
|
| 206 |
+
The qualitative results on Mutagenicity are presented in Figure 4, where each explanation has been fine-tuned on the corresponding ratio. We can see the flexibility on ReFine, which enables the fine-tuning on a specific user-defined ratio. With the selection ratio increases, the class probability output by the target GNN is generally stable or further improved. Moreover, the fine-tuning phase focuses more on the combination of features, with the constraint of selection ratio, to purse the higher accuracy rather than intercepting on a ranking based on the static edge importance, which is only valid under the addictive feature assumption [32].
|
| 207 |
+
|
| 208 |
+
# 4.4 Discussions
|
| 209 |
+
|
| 210 |
+
Efficiency for Generating Explanations. The inference time [7] to explain a new instance by the pre-trained ReFine is the same as PGExplainer under the same attributor construction. Different from GNNExplainer which has to retrain the model for each graph, ReFine only needs a few finetuning steps on the pre-trained model (20 steps on average). Thus, ReFine can gain a boosting performance for explaining graphs while remaining efficient in terms of time complexity. Specifically, we summarize the time costs in the Table 4. Clearly, our ReFine is more efficient than GNNExplainer and is computationally comparable to PG-Explainer.
|
| 211 |
+
|
| 212 |
+
Limitations. Although ReFine can well-encode the class-wise knowledge by learning the parameters of multiple attributors, it can hardly map such knowledge to the structure representation as XGNN [13]. This limits the human understanding on the core of input data via a conciseness substructure.
|
| 213 |
+
|
| 214 |
+
# 5 Related Work
|
| 215 |
+
|
| 216 |
+
We consider two classes of related work for GNNs explainability: studies on local explainability, which independently explain for each input graph without referring to other knowledge, e.g., training data; studies on global explainability, which provide explanations for multiple instances with the guide of the model-level or class-level knowledge. See [49, 8, 50] for more overviews.
|
| 217 |
+
|
| 218 |
+
• Local Explainability. In general, there are two research lines. (1) Non-parametric explanation methods [10, 9, 11] use some heuristics as the feature contributions of a specific instance, without involving additional trainable models. Gradient-like scores [10, 9, 11] are wisely-used heuristics, which is obtained by backpropagating the model prediction or loss to the input features, such as adjacency matrix [10], along with the model architecture. (2) Parametric explanation methods [6, 19, 51, 52] additionally train a parametrized explainer model to generate the saliency maps or explanatory subgraphs for individual instances. The explainer model is typically optimized towards local fidelity [32, 48, 27], which uses the explanations to recover the target predictions. For example, GNNExplainer [6] learns soft masks for an instance and applies them on the adjacency matrix. PGM-Explainer [19] trains an Bayesian network upon the pairs of graph perturbations and prediction changes. However, these methods fall short in capturing the prototypical patterns shared within the same groups or classes.
|
| 219 |
+
|
| 220 |
+
• Global Explainability. This direction is less explored compared to the local explainability of GNNs [8]. To provide a global understanding of the model prediction, PGExplainer [7] formulates the generation of multiple explanations based on its collective and inductive property, and designs the attributor as a deep neural network whose parameters are shared across the explained instances. XGNN [13] explains GNNs by training a graph generator, which outputs class-wise graph patterns to explain this class. As it is designed to explain the holistic class, making it hardly applicable on an specific instance, e.g., the graph patterns may not even exit on the instance.
|
| 221 |
+
|
| 222 |
+
# 6 Conclusion and Future Work
|
| 223 |
+
|
| 224 |
+
Multi-grained explainability promises to offer a flexible and all-round inspection of deep models’ decision-making, which has been less explored in the literature. Motivated by this, we proposed a novel generative probabilistic model, ReFine, to approach the multi-granularity explainability via pre-training and fine-tuning. To exhibit global explanations with the prototypical patterns, the pre-training phase is founded upon the class-aware attribution modules and distills the class-level knowledge by contrastive learning. When given a specific instance, the fine-tuning phase further adapts the global explanations in the local context with high fidelity. In the fashion of pre-training and fine-tuning, we can generate explanations with both global patterns and local features. Extensive results in four datasets show that our method indeed improves the quality of explanatory subgraphs.
|
| 225 |
+
|
| 226 |
+
As future direction, we consider the extension of ReFine to fulfill the counterfactual explanation [53], which answers ‘Why the target GNN model made a certain prediction, rather than another prediction?”, to enrich the multi-granularity explainability. Further, multi-grained explainability can be exhibited to explore the model robustness and heuristically guide the model construction.
|
| 227 |
+
|
| 228 |
+
# Acknowledgments and Disclosure of Funding
|
| 229 |
+
|
| 230 |
+
Funding in direct support of this work: the Sea-NExT Joint Lab, Singapore MOE AcRF T2; the National Natural Science Foundation of China (U19A2079, 62121002); the National Key Research and Development Program of China (2020YFB1406703).
|
| 231 |
+
|
| 232 |
+
# References
|
| 233 |
+
|
| 234 |
+
[1] Vijay Prakash Dwivedi, Chaitanya K. Joshi, Thomas Laurent, Yoshua Bengio, and Xavier Bresson. Benchmarking graph neural networks. CoRR, abs/2003.00982, 2020.
|
| 235 |
+
|
| 236 |
+
[2] Zonghan Wu, Shirui Pan, Fengwen Chen, Guodong Long, Chengqi Zhang, and Philip S. Yu. A comprehensive survey on graph neural networks. TNNLS, 32(1):4–24, 2021.
|
| 237 |
+
[3] Shruthi Chari, Daniel M. Gruen, Oshani Seneviratne, and Deborah L. McGuinness. Directions for explainable knowledge-enabled systems. In Knowledge Graphs for eXplainable Artificial Intelligence: Foundations, Applications and Challenges, pages 245–261. 2020.
|
| 238 |
+
[4] Christopher J. Anders, Plamen Pasliev, Ann-Kathrin Dombrowski, Klaus-Robert Müller, and Pan Kessel. Fairwashing explanations with off-manifold detergent. In ICML, pages 314–323, 2020.
|
| 239 |
+
[5] Sebastian Lapuschkin, Stephan Wäldchen, Alexander Binder, Grégoire Montavon, Wojciech Samek, and Klaus-Robert Müller. Unmasking clever hans predictors and assessing what machines really learn. Nature communications, 10(1):1–8, 2019.
|
| 240 |
+
[6] Zhitao Ying, Dylan Bourgeois, Jiaxuan You, Marinka Zitnik, and Jure Leskovec. Gnnexplainer: Generating explanations for graph neural networks. In NeurIPS, pages 9240–9251, 2019.
|
| 241 |
+
[7] Dongsheng Luo, Wei Cheng, Dongkuan Xu, Wenchao Yu, Bo Zong, Haifeng Chen, and Xiang Zhang. Parameterized explainer for graph neural network. In NeurIPS, 2020.
|
| 242 |
+
[8] Hao Yuan, Haiyang Yu, Shurui Gui, and Shuiwang Ji. Explainability in graph neural networks: A taxonomic survey. CoRR, abs/2012.15445, 2020.
|
| 243 |
+
[9] Federico Baldassarre and Hossein Azizpour. Explainability techniques for graph convolutional networks. CoRR, abs/1905.13686, 2019.
|
| 244 |
+
[10] Phillip E. Pope, Soheil Kolouri, Mohammad Rostami, Charles E. Martin, and Heiko Hoffmann. Explainability methods for graph convolutional neural networks. In CVPR, pages 10772–10781, 2019.
|
| 245 |
+
[11] Thomas Schnake, Oliver Eberle, Jonas Lederer, Shinichi Nakajima, K. T. Schutt, Klaus-Robert Muller, and Grégoire Montavon. Higher-order explanations of graph neural networks via relevant walks. arXiv, 2020.
|
| 246 |
+
[12] Michael Sejr Schlichtkrull, Nicola De Cao, and Ivan Titov. Interpreting graph neural networks for NLP with differentiable edge masking. CoRR, abs/2010.00577, 2020.
|
| 247 |
+
[13] Hao Yuan, Jiliang Tang, Xia Hu, and Shuiwang Ji. XGNN: towards model-level explanations of graph neural networks. In Rajesh Gupta, Yan Liu, Jiliang Tang, and B. Aditya Prakash, editors, KDD, pages 430–438, 2020.
|
| 248 |
+
[14] Marco Túlio Ribeiro, Sameer Singh, and Carlos Guestrin. "why should I trust you?": Explaining the predictions of any classifier. In KDD, pages 1135–1144, 2016.
|
| 249 |
+
[15] Jeremy Howard and Sebastian Ruder. Universal language model fine-tuning for text classification. In ACL, pages 328–339, 2018.
|
| 250 |
+
[16] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
|
| 251 |
+
[17] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey E. Hinton. A simple framework for contrastive learning of visual representations. In ICML, volume 119, pages 1597–1607, 2020.
|
| 252 |
+
[18] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross B. Girshick. Momentum contrast for unsupervised visual representation learning. In CVPR, pages 9726–9735, 2020.
|
| 253 |
+
[19] Minh N. Vu and My T. Thai. Pgm-explainer: Probabilistic graphical model explanations for graph neural networks. In NeurIPS, 2020.
|
| 254 |
+
[20] Hongyang Gao and Shuiwang Ji. Graph u-nets. In ICML, volume 97, pages 2083–2092, 2019.
|
| 255 |
+
|
| 256 |
+
[21] Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Liò, and Yoshua ´ Bengio. Graph attention networks. ICLR, 2018.
|
| 257 |
+
[22] William L. Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In NeurIPS, pages 1024–1034, 2017.
|
| 258 |
+
[23] Xiang Wang, Xiangnan He, Meng Wang, Fuli Feng, and Tat-Seng Chua. Neural graph collaborative filtering. In SIGIR, pages 165–174, 2019.
|
| 259 |
+
[24] Xiang Wang, Xiangnan He, Yixin Cao, Meng Liu, and Tat-Seng Chua. KGAT: knowledge graph attention network for recommendation. In KDD, pages 950–958, 2019.
|
| 260 |
+
[25] Xiangnan He, Kuan Deng, Xiang Wang, Yan Li, Yong-Dong Zhang, and Meng Wang. Lightgcn: Simplifying and powering graph convolution network for recommendation. In SIGIR, pages 639–648, 2020.
|
| 261 |
+
[26] Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In ICLR, 2019.
|
| 262 |
+
[27] Ian Covert, Scott Lundberg, and Su-In Lee. Feature removal is a unifying principle for model explanation methods. In NeurIPS, 2020.
|
| 263 |
+
[28] Marco Ancona, Enea Ceolini, Cengiz Öztireli, and Markus Gross. Towards better understanding of gradient-based attribution methods for deep neural networks. In ICLR, 2018.
|
| 264 |
+
[29] Constantin F Aliferis, Alexander Statnikov, Ioannis Tsamardinos, Subramani Mani, and Xenofon D Koutsoukos. Local causal and markov blanket induction for causal discovery and feature selection for classification part i: Algorithms and empirical evaluation. JMLR, 11(1), 2010.
|
| 265 |
+
[30] Peter D Hoff, Adrian E Raftery, and Mark S Handcock. Latent space approaches to social network analysis. Journal of the american Statistical association, 97(460):1090–1098, 2002.
|
| 266 |
+
[31] Max Welling Thomas N. Kipf. Variational graph auto-encoders. In NeurIPS Workshops, 2016.
|
| 267 |
+
[32] Jianbo Chen, Le Song, Martin J. Wainwright, and Michael I. Jordan. Learning to explain: An information-theoretic perspective on model interpretation. In ICML, pages 882–891, 2018.
|
| 268 |
+
[33] Lukas Faber, Amin K Moghaddam, and Roger Wattenhofer. Contrastive graph neural network explanation. 2021.
|
| 269 |
+
[34] R. Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Philip Bachman, Adam Trischler, and Yoshua Bengio. Learning deep representations by mutual information estimation and maximization. In ICLR, 2019.
|
| 270 |
+
[35] Fan-Yun Sun, Jordan Hoffmann, Vikas Verma, and Jian Tang. Infograph: Unsupervised and semi-supervised graph-level representation learning via mutual information maximization. In ICLR, 2020.
|
| 271 |
+
[36] Yuning You, Tianlong Chen, Yongduo Sui, Ting Chen, Zhangyang Wang, and Yang Shen. Graph contrastive learning with augmentations. In NeurIPS, 2020.
|
| 272 |
+
[37] Jiancan Wu, Xiang Wang, Fuli Feng, Xiangnan He, Liang Chen, Jianxun Lian, and Xing Xie. Self-supervised graph learning for recommendation. In SIGIR, pages 726–735, 2021.
|
| 273 |
+
[38] Christopher Frye, Damien de Mijolla, Laurence Cowton, Megan Stanley, and Ilya Feige. Shapley-based explainability on the data manifold. In ICLR, 2021.
|
| 274 |
+
[39] H. W. Kuhn and A. W. Tucker. Contributions to the theory of games, volume 2. Princeton University Press, 1953.
|
| 275 |
+
[40] Jeroen Kazius, Ross McGuire, and Roberta Bursi. Derivation and validation of toxicophores for mutagenicity prediction. Journal of medicinal chemistry, 48(1):312–320, 2005.
|
| 276 |
+
[41] Kaspar Riesen and Horst Bunke. Iam graph database repository for graph based pattern recognition and machine learning. In SPR and SSPR, pages 287–297, 2008.
|
| 277 |
+
[42] Weihua Hu, Bowen Liu, Joseph Gomes, Marinka Zitnik, Percy Liang, Vijay S. Pande, and Jure Leskovec. Strategies for pre-training graph neural networks. In ICLR, 2020.
|
| 278 |
+
[43] Ranjay Krishna, Yuke Zhu, Oliver Groth, Justin Johnson, Kenji Hata, Joshua Kravitz, Stephanie Chen, Yannis Kalantidis, Li-Jia Li, David A. Shamma, Michael S. Bernstein, and Li Fei-Fei. Visual genome: Connecting language and vision using crowdsourced dense image annotations. IJCV, 123(1):32–73, 2017.
|
| 279 |
+
[44] Johannes Klicpera, Aleksandar Bojchevski, and Stephan Günnemann. Predict then propagate: Graph neural networks meet personalized pagerank. In ICLR, 2019.
|
| 280 |
+
[45] Federico Monti, Davide Boscaini, Jonathan Masci, Emanuele Rodolà, Jan Svoboda, and Michael M. Bronstein. Geometric deep learning on graphs and manifolds using mixture model cnns. In CVPR, pages 5425–5434, 2017.
|
| 281 |
+
[46] Matthias Fey, Jan Eric Lenssen, Frank Weichert, and Heinrich Müller. Splinecnn: Fast geometric deep learning with continuous b-spline kernels. In CVPR, pages 869–877, 2018.
|
| 282 |
+
[47] Ekagra Ranjan, Soumya Sanyal, and Partha P. Talukdar. ASAP: adaptive structure aware pooling for learning hierarchical graph representations. In AAAI, pages 5470–5477, 2020.
|
| 283 |
+
[48] Jian Liang, Bing Bai, Yuren Cao, Kun Bai, and Fei Wang. Adversarial infidelity learning for model interpretation. In KDD, pages 286–296, 2020.
|
| 284 |
+
[49] Hao Yuan, Haiyang Yu, Shurui Gui, and Shuiwang Ji. Explainability in graph neural networks: A taxonomic survey. CoRR, 2020.
|
| 285 |
+
[50] Thomas Schnake, Oliver Eberle, Jonas Lederer, Shinichi Nakajima, Kristof T. Schütt, KlausRobert Müller, and Grégoire Montavon. XAI for graphs: Explaining graph neural network predictions by identifying relevant walks. CoRR, abs/2006.03589, 2020.
|
| 286 |
+
[51] Hao Yuan, Haiyang Yu, Jie Wang, Kang Li, and Shuiwang Ji. On explainability of graph neural networks via subgraph explorations. ArXiv, 2021.
|
| 287 |
+
[52] Patrick Schwab and Walter Karlen. Cxplain: Causal explanations for model interpretation under uncertainty. In NeurIPS, pages 10220–10230, 2019.
|
| 288 |
+
[53] Raha Moraffah, Mansooreh Karami, Ruocheng Guo, Adrienne Raglin, and Huan Liu. Causal interpretability for machine learning-problems, methods and evaluation. SIGKDD Explorations, 22(1):18–33, 2020.
|
md/train/gIHd-5X324/gIHd-5X324.md
ADDED
|
@@ -0,0 +1,320 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RETHINKING SOFT LABELS FOR KNOWLEDGE DISTILLATION: A BIAS-VARIANCE TRADEOFF PERSPECTIVE
|
| 2 |
+
|
| 3 |
+
Helong Zhou1∗, Liangchen $\mathbf { S o n g ^ { 2 * \dagger } }$ , Jiajie Chen1∗ , Ye Zhou1, Guoli Wang13, Junsong Yuan2, Qian Zhang1 1Horizon Robotics 2University at Buffalo 3Tsinghua University {helong.zhou,jiajie.chen,ye.zhou,guoli.wang}@horizon.ai {lsong8,jsyuan}@buffalo.edu, qian01.zhang@horizon.ai
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Knowledge distillation is an effective approach to leverage a well-trained network or an ensemble of them, named as the teacher, to guide the training of a student network. The outputs from the teacher network are used as soft labels for supervising the training of a new network. Recent studies (Muller et al., 2019; Yuan ¨ et al., 2020) revealed an intriguing property of the soft labels that making labels soft serves as a good regularization to the student network. From the perspective of statistical learning, regularization aims to reduce the variance, however how bias and variance change is not clear for training with soft labels. In this paper, we investigate the bias-variance tradeoff brought by distillation with soft labels. Specifically, we observe that during training the bias-variance tradeoff varies sample-wisely. Further, under the same distillation temperature setting, we observe that the distillation performance is negatively associated with the number of some specific samples, which are named as regularization samples since these samples lead to bias increasing and variance decreasing. Nevertheless, we empirically find that completely filtering out regularization samples also deteriorates distillation performance. Our discoveries inspired us to propose the novel weighted soft labels to help the network adaptively handle the sample-wise biasvariance tradeoff. Experiments on standard evaluation benchmarks validate the effectiveness of our method. Our code is available at https://github.com/ bellymonster/Weighted-Soft-Label-Distillation.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
For deep neural networks (Goodfellow et al., 2016), knowledge distillation (KD) (Ba & Caruana, 2014; Hinton et al., 2015) refers to the technique that uses well-trained networks to guide the training of another network. Typically, the well-trained network is named as the teacher network while the network to be trained is named as the student network. For distillation, the predictions from the teacher network are leveraged and referred to as the soft labels (Balan et al., 2015; Muller et al., ¨ 2019). Soft labels generated by the teacher network have been proven effective in large-scale empirical studies (Liang et al., 2019; Tian et al., 2020; Zagoruyko & Komodakis, 2017; Romero et al., 2015) as well as recent theoretical studies (Phuong & Lampert, 2019).
|
| 12 |
+
|
| 13 |
+
However, the reason why soft labels are beneficial to the student network is still not well explained. Giving a clear theoretical explanation is challenging: The optimization details of a deep network with the common one-hot labels are still not well-studied (Nagarajan & Kolter, 2019), not to mention training with the soft labels. Nevertheless, two recent studies (Muller et al., 2019; Yuan et al., ¨ 2020) shed light on the intuitions about how the soft labels work. Specifically, label smoothing, which is a special case of soft labels based training, is shown to regularize the activations of the penultimate layer to the network (Muller et al., 2019). The regularization property of soft labels is ¨ further explored in (Yuan et al., 2020). They hypothesize that in KD, one main reason why the soft labels work is the regularization introduced by soft labels. Based on the assumption, the authors design a teacher-free distillation method by turning the predictions of the student network into soft labels.
|
| 14 |
+
|
| 15 |
+
Considering that soft labels are targets for distillation, the evidence of the regularization brought by soft labels drives us to rethink soft labels for KD: Soft labels are both supervisory signals and regularizers. Meanwhile, it is known that there is a tradeoff between fitting the data and imposing regularizations, i.e., the bias-variance dilemma (Kohavi & Wolpert, 1996; Bishop, 2006), but it is unclear how bias and variance change for distillation with soft labels. Since the bias-variance tradeoff is an important issue in statistical learning, we investigate whether the bias-variance tradeoff exists for soft labels and how the tradeoff affects distillation performance.
|
| 16 |
+
|
| 17 |
+
We first compare the bias and variance decomposition of direct training with that of distillation with soft labels, noticing that distillation results in a larger bias error and a smaller variance. Then, we rewrite distillation loss into the form of a regularization loss adding the direct training loss. Through inspecting the gradients of the two terms during training, we notice that for soft labels, the biasvariance tradeoff varies sample-wisely. Moreover, by looking into a conclusion from (Muller et al., ¨ 2019), we observe that under the same temperature setting, the distillation performance is negatively associated with the number of some certain samples. These samples lead to bias increase and variance decrease and we name them as regularization samples. To investigate how regularization samples affect distillation, we first examine if we can design ad hoc filters for soft labels to avoid training with regularization samples. But completely filtering out regularization samples also deteriorates distillation performance, leading us to speculate that regularization samples are not well handled by standard KD. In the light of these findings, we propose weighted soft labels for distillation to handle the sample-wise bias-variance tradeoff, by adaptively assigning a lower weight to regularization samples and a larger weight to the others. To sum up, our contributions are:
|
| 18 |
+
|
| 19 |
+
• For knowledge distillation, we analyze how the soft labels work from a perspective of biasvariance tradeoff.
|
| 20 |
+
• We discover that the bias-variance tradeoff varies sample-wisely. Also, we discover that if we fix the distillation temperature, the number of regularization samples is negatively associated with the distillation performance.
|
| 21 |
+
• We design straightforward schemes to alleviate negative impacts from regularization samples and then propose the novel weighted soft labels for distillation. Experiments on large scale datasets validate the effectiveness of the proposed weighted soft labels.
|
| 22 |
+
|
| 23 |
+
# 2 RELATED WORKS
|
| 24 |
+
|
| 25 |
+
Knowledge distillation. Hinton et al. (2015) proposed to distill outputs from large and cumbersome models into smaller and faster models, which is named as knowledge distillation. The outputs for large networks are averaged and formulated as soft labels. Also, other kinds of soft labels have been widely used for training deep neural networks (Szegedy et al., 2016; Pereyra et al., 2017). Treating soft labels as regularizers were pointed out in (Hinton et al., 2015) since a lot of helpful information can be carried in soft labels. More recently, Muller et al. (2019) showed the adverse ¨ effect of label smoothing upon distillation. It is a thought-provoking discovery for the reason that both label smoothing and distillation are exploiting the regularization property behind soft labels. Yuan et al. (2020) further investigated the regularization property of soft labels and then proposed a teacher free distillation scheme.
|
| 26 |
+
|
| 27 |
+
Distillation loss. One of our main contributions is that we improve the distillation loss. For adaptively adjusting the distillation loss, Tang et al. (2019) pays attention to hard-to-learn and hard-tomimic samples, and the latter is weighted based on the prediction gap between teacher and student. However, it does not consider that the teacher may give an incorrect guide to the student, under which the prediction gap is still large and such a method may lead to the performance being hurt. Saputra et al. (2019) transfers teacher’s guidance only on the samples where the performance of the teacher surpasses the student, while Wen et al. (2019) deals with the incorrect guidance by probability shifting strategy. Our approach is different from the above methods, in terms of motivations as well as the proposed solutions.
|
| 28 |
+
|
| 29 |
+
Bias-variance tradeoff. Bias-variance tradeoff is a well-studied topic in machine learning (Kohavi & Wolpert, 1996; Domingos, 2000; Valentini & Dietterich, 2004; Bishop, 2006) and for neural networks (Geman et al., 1992; Neal et al., 2018; Belkin et al., 2019; Yang et al., 2020). Existing methods are mainly concerned with the variance brought by the choice of network models. Our perspective is different from the previous methods since we focus on the behavior of samples during training. In our work, based on the results from Heskes (1998), we present the decomposition of distillation loss, which is defined by Kullback-Leibler divergence. Besides, our main contribution is not to study how to theoretically analyze the tradeoff, but how to adaptively tune the sample-wise tradeoff during training.
|
| 30 |
+
|
| 31 |
+
# 3 BIAS-VARIANCE TRADEOFF FOR SOFT LABELS
|
| 32 |
+
|
| 33 |
+
Soft labels play the role of supervisory signals and regularizations at the same time, which inspires us to rethink soft labels from the perspective of the bias-variance tradeoff. We begin our analysis with some mathematical descriptions. For a sample $\mathbf { x }$ labeled as $i$ -th class, let the ground-truth label be a one-hot vector y where $y _ { i } = 1$ and other entries are 0. Then for $x$ and softmax output temperature $\tau$ , the soft label predicted by the teacher network is denoted as $\hat { y } _ { \tau } ^ { t }$ and the output from the student is denoted as $\hat { y } _ { \tau } ^ { s }$ . The soft label $\hat { y } _ { \tau } ^ { t }$ is then used for training the student by the distillation loss, i.e. $\begin{array} { r } { L _ { \mathrm { k d } } = - \tau ^ { 2 } \sum _ { k } \hat { y } _ { k , \tau } ^ { t } \log \hat { y } _ { k , \tau } ^ { s } , } \end{array}$ , where $\hat { y } _ { k , \tau } ^ { s } , \hat { y } _ { k , \tau } ^ { t }$ means the $k$ -th element of the student’s output $\hat { y } _ { \tau } ^ { s }$ and the teacher’s output $\hat { y } _ { \tau } ^ { t }$ , respectively. With the above notations, the cross-entropy loss for training with one-hot labels is $L _ { \mathrm { c e } } = - y _ { k } \log \hat { y } _ { k , 1 } ^ { s }$ .
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
Figure 1: Bias and variance.
|
| 37 |
+
|
| 38 |
+
We now present the bias-variance decomposition for $L _ { \mathrm { c e } }$ and $L _ { \mathrm { k d } }$ , based on the definition and notations from Heskes (1998). First, we denote the train dataset as $\mathcal { D }$ and the output distribution on a sample $\mathbf { x }$ of the network trained without distillation as $\hat { \mathbf { y } } _ { \mathrm { c e } } = f _ { \mathrm { c e } } ( \mathbf { x } ; \mathcal { D } )$ . For the network trained with distillation, the model also depends on the teacher network, so we define the output on $\mathbf { x }$ as $\hat { \mathbf { y } } _ { \mathrm { k d } } = f _ { \mathrm { k d } } ( \mathbf { x } ; \mathcal { D } , \mathcal { T } )$ , where $\tau$ is the selected teacher network. Then, let the averaged output of $\hat { \mathbf { y } } _ { \mathrm { k d } }$ and $\hat { \mathbf { y } } _ { \mathrm { c e } }$ be $\bar { \bf y } _ { \mathrm { k d } }$ and $\bar { \mathbf { y } } _ { \mathrm { c e } }$ , that is,
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
\bar { \mathbf { y } } _ { \mathrm { c e } } = \frac { 1 } { Z _ { \mathrm { c e } } } \exp ( \mathbb { E } _ { T } [ \log \hat { \mathbf { y } } _ { \mathrm { c e } } ] ) , \quad \bar { \mathbf { y } } _ { \mathrm { k d } } = \frac { 1 } { Z _ { \mathrm { k d } } } \exp ( \mathbb { E } _ { \mathcal { D } , T } [ \log \hat { \mathbf { y } } _ { \mathrm { k d } } ] ) ,
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
where $Z _ { \mathrm { c e } } , Z _ { \mathrm { k d } }$ are two normalization constant. Then according to Heskes (1998), we have the following decomposition for the expected error on the sample $\mathbf { x }$ and $\mathbf { y } = t ( \mathbf { x } )$ is the ground truth label:
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
\begin{array} { r l } & { \mathrm { e r r o r c e } = \mathbb { E } _ { \mathbf { x } , \mathcal { D } } \left[ - \mathbf { y } \log \hat { \mathbf { y } } _ { \mathrm { c e } } \right] = \mathbb { E } _ { \mathbf { x } , \mathcal { D } } \left[ - \mathbf { y } \log \mathbf { y } + \mathbf { y } \log \frac { \mathbf { y } } { \bar { \mathbf { y } } _ { \mathrm { c e } } } + \mathbf { y } \log \frac { \bar { \mathbf { y } } _ { \mathrm { c e } } } { \hat { \mathbf { y } } _ { \mathrm { c e } } } \right] } \\ & { \qquad = \mathbb { E } _ { \mathbf { x } } \big [ - \mathbf { y } \log \mathbf { y } \big ] + \mathbb { E } _ { \mathbf { x } } \left[ \mathbf { y } \log \frac { \mathbf { y } } { \bar { \mathbf { y } } _ { \mathrm { c e } } } \right] + \mathbb { E } _ { \mathcal { D } } \left[ \mathbb { E } _ { \mathbf { x } } \left[ \mathbf { y } \log \frac { \bar { \mathbf { y } } _ { \mathrm { c e } } } { \hat { \mathbf { y } } _ { \mathrm { c e } } } \right] \right] } \\ & { \qquad = \mathbb { E } _ { \mathbf { x } } \big [ - \mathbf { y } \log \mathbf { y } \big ] + D _ { \mathrm { K L } } ( \mathbf { y } , \bar { \mathbf { y } } _ { \mathrm { c e } } ) + \mathbb { E } _ { \mathcal { D } } \big [ D _ { \mathrm { K L } } ( \bar { \mathbf { y } } _ { \mathrm { c e } } , \hat { \mathbf { y } } _ { \mathrm { c e } } ) \big ] } \\ & { \qquad = \mathrm { i n t i n s i c ~ n o i s e ~ \mathrm { n i s ~ } } + \mathrm { \mathrm { ~ s i a s ~ } } + \mathrm { v a r i a n c e } , } \end{array}
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
where $D _ { \mathrm { K L } }$ is the Kullback-Leibler divergence. The derivation of the variance term is based on the facts that $\frac { \log \bar { \mathbf { y } } _ { \mathrm { c e } } } { \mathbb { E } _ { \mathcal { D } } [ \log \hat { \mathbf { y } } _ { \mathrm { c e } } ] }$ is a constant and $\mathbb { E } _ { \mathbf { x } } [ \mathbf { y } ] = \mathbb { E } _ { \mathbf { x } } [ \bar { \mathbf { y } } _ { \mathrm { c e } } ] = 1$ . Detailed derivations can be found from Eq. (4) in Heskes (1998). Next, we analyze the bias-variance decomposition of $L _ { \mathrm { k d } }$ . As mentioned above, when training with soft labels, extra randomness is introduced for the selection of a teacher network. In Fig. 1, we illustrate the corresponding bias and variance for the selection process of a set of soft labels, which are generated by a teacher network. In this case, a high variance model indicates the model (grey point) is closer to the one-hot trained model (black point), while a low variance model indicates that the model is closer to other possible models trained with soft labels (red points). Although for KD there are more sources introducing randomness, the overall variance brought by $L _ { \mathrm { k d } }$ is not necessarily higher than $L _ { \mathrm { c e } }$ . In fact, existing empirical results strongly suggest that the overall variance is smaller with KD. For example, students trained with soft labels are better calibrated than one-hot baselines (Muller et al., 2019) and KD makes the predictions of ¨ students more consistent when facing adversarial noise (Papernot et al., 2016). Here, we present these empirical evidence as an assumption:
|
| 51 |
+
|
| 52 |
+
Assumption 1 The variance brought by $K D$ is smaller than direct training, that is, $\mathbb { E } _ { \mathcal { D } , \mathcal { T } } [ \bar { D } _ { \mathrm { K L } } ( \bar { \bf y } _ { \mathrm { k d } } , \hat { \bf y } _ { \mathrm { k d } } ) ] \leqslant \mathbb { E } _ { \mathcal { D } } [ D _ { \mathrm { K L } } ( \bar { \bf y } _ { \mathrm { c e } } , \hat { \bf y } _ { \mathrm { c e } } ) ]$ .
|
| 53 |
+
|
| 54 |
+
Similar to Eq. (2), we write the decomposition for $L _ { \mathrm { k d } }$ as
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\begin{array} { r l r l r } { \mathrm { e r r o r } _ { \mathbf { k d } } = \mathbb { E } _ { \mathbf { x } } [ - \mathbf { y } \log \mathbf { y } ] + } & { } & { \qquad } & { } & { \qquad + \mathbb { E } _ { \mathcal { D } , \mathcal { T } } [ D _ { \mathrm { K L } } ( \bar { \mathbf { y } } _ { \mathbf { k d } } , \hat { \mathbf { y } } _ { \mathbf { k d } } ) ] . } \end{array}
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
An observation here is that $\bar { \mathbf { y } } _ { \mathrm { c e } }$ converges to one-hot labels while $\bar { \bf y } _ { \mathrm { k d } }$ converges to soft labels, so $\bar { \bf y } _ { \mathrm { c e } }$ is closer to the one-hot ground-truth distribution $\mathbf { y }$ than $\bar { \bf y } _ { \mathrm { k d } }$ , i.e., $\mathbb { E } _ { \mathbf { x } } \left[ \mathbf { y } \mathrm { l o g } \left( \frac { \bar { \mathbf { y } } _ { \mathrm { c e } } } { \bar { \mathbf { y } } _ { \mathrm { k d } } } \right) \right] \geqslant 0$ . If we rewrite $L _ { \mathrm { k d } }$ as $L _ { \mathrm { k d } } = L _ { \mathrm { k d } } - L _ { \mathrm { c e } } + L _ { \mathrm { c e } }$ , then $L _ { \mathrm { k d } } \mathrm { ~ - ~ } L _ { \mathrm { c e } }$ causes that the bias increases by $\mathbb { E } _ { \mathbf { x } } \left[ \mathbf { y } \log \left( \frac { \bar { \mathbf { y } } _ { \mathrm { c e } } } { \bar { \mathbf { y } } _ { \mathrm { k d } } } \right) \right]$ and the variance decreases by $\mathbb { E } _ { \mathcal { D } } [ D _ { \mathrm { K L } } ( \bar { \bf y } _ { \mathrm { c e } } , \hat { \bf y } _ { \mathrm { c e } } ) ] - \mathbb { E } _ { \mathcal { D } , \tau } [ D _ { \mathrm { K L } } ( \bar { \bf y } _ { \mathrm { k d } } , \hat { \bf y } _ { \mathrm { k d } } ) ]$ .
|
| 61 |
+
|
| 62 |
+
From the above analysis, we separate $L _ { \mathrm { k d } }$ into two terms, and $L _ { \mathrm { k d } } - L _ { \mathrm { c e } }$ leads to variance reduction, and $L _ { \mathrm { c e } }$ leads to bias reduction. In the following sections, we first analyze how $L _ { \mathrm { k d } } - L _ { \mathrm { c e } }$ links to the bias-variance tradeoff during training. Then we analyze the changes in the relative importance between bias reduction and variance reduction during training with soft labels.
|
| 63 |
+
|
| 64 |
+
# 3.1 THE BIAS-VARIANCE TRADEOFF DURING TRAINING
|
| 65 |
+
|
| 66 |
+
It is known that bias reduction and variance reduction are often in conflict and we cannot minimize bias and variance together. However, if we consider the change of bias and variance during the training process, the importance of tuning the tradeoff also changes during training. Specifically, shortly after the training of the network starts, the bias error dominates the total error and the variance is less important. As training goes on, gradients of reducing the bias error (induced by $L _ { \mathrm { c e , \ d } }$ ) and reducing the variance (induced by $L _ { \mathrm { k d } } - L _ { \mathrm { c e } } )$ can be of the same scale for some samples, then we need to balance the tradeoff because reducing one term is likely to increase another one. Therefore for soft labels, we need to handle the bias-variance tradeoff in a sample-wise manner and take the training process into consideration.
|
| 67 |
+
|
| 68 |
+
To study the bias-variance tradeoff during training, we consider the gradients of bias and variance reduction. Let $_ { z }$ be the logits output of the student on input $x$ and $z _ { i }$ is $i$ -th element of it, then we are interested in ∂(Lkd−Lce)∂z . For simplifying analysis, we are concerned with the gradients on the ground-truth related logit, that is, the sample $x$ is labeled as $i$ -th class. Mathematically, for the gradients of variance reduction, we have
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\frac { \partial ( L _ { \mathrm { k d } } - L _ { \mathrm { c e } } ) } { \partial z _ { i } } = \tau ( \hat { y } _ { i , \tau } ^ { s } - \hat { y } _ { i , \tau } ^ { t } ) - ( \hat { y } _ { i , 1 } ^ { s } - y _ { i } ) = \tau \left( \frac { e ^ { z _ { i } / \tau } } { \sum _ { k } e ^ { z _ { k } / \tau } } - \hat { y } _ { i , \tau } ^ { t } \right) - \left( \frac { e ^ { z _ { i } } } { \sum _ { k } e ^ { z _ { k } } } - y _ { i } \right) ,
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
where $\hat { y } _ { i , \tau } ^ { t }$ denotes the $i$ -th element of the teacher’s prediction, i.e., $\hat { y } _ { \tau } ^ { t }$ . The term $L _ { \mathrm { k d } } - L _ { \mathrm { c e } }$ is easy to understand when $\tau = 1$ since the gradient now becomes $y _ { i } - \hat { y } _ { i , 1 } ^ { t }$ . Meanwhile, for the bias reduction, we have $\begin{array} { r } { \frac { \partial L _ { \mathrm { c e } } } { \partial z _ { i } } = \hat { y } _ { i , 1 } ^ { s } - y _ { i } } \end{array}$ , so ∂Lce and ∂(Lkd−Lce) always have different signs, leading to a tradeoff. If $\frac { \partial L _ { \mathrm { c e } } } { \partial z _ { i } }$ is much higher than ∂(Lkd−Lce)∂z , the bias reduction dominates the overall optimization direction. Instead, i f ∂(Lkd−Lce)∂z becomes higher, the sample is used for variance reduction. Interestingly, we discover that under a fixed distillation temperature, the final performance is worse when more training samples are used for variance reduction, which will be introduced in the next section.
|
| 75 |
+
|
| 76 |
+
# 3.2 REGULARIZATION SAMPLES
|
| 77 |
+
|
| 78 |
+
Our analysis starts with a conclusion from Muller et al. (2019): ¨ if a teacher network is trained with label smoothing, knowledge distillation into a student network is much less effective. Inspired by the phenomenon, we gather the impact of bias and variance during training with different distillation settings. Let $\begin{array} { r } { a = \frac { \partial L _ { \mathrm { c e } } } { \partial z _ { i } } } \end{array}$ and $\begin{array} { r } { b = \frac { \partial ( L _ { \mathrm { k d } } - L _ { \mathrm { c e } } ) } { \partial z _ { i } } } \end{array}$ , then as introduced before, we use $a$ and $b$ to represent the impact of bias and variance, respectively. If we have $\vert b \vert > \vert a \vert$ for a sample, we name the sample as a regularization sample since the variance dominates the optimization direction. From the collected data, we find that the number of regularization samples is closely related to distillation performance.
|
| 79 |
+
|
| 80 |
+
Table 1: We count the number of regularization samples with different distillation settings on CIFAR-100. The teacher-student network pair is WRN-40-2 (Zagoruyko & Komodakis, 2017) and WRN-16-2. Results are averaged over 5 repeated runs. The temperature column means the temperature for distillation and the label smoothing column means whether the teacher network is trained with label smoothing trick.
|
| 81 |
+
|
| 82 |
+
<table><tr><td colspan="3">Teacher: 76.55 w/ label smoothing,75.61 w/o label smoothing Baseline Top-1 Acc Student: 73.26</td></tr><tr><td>Temperature</td><td>Label smoothing?</td><td>Student Top-1 Acc Number of regularization samples</td></tr><tr><td rowspan="2">T=2</td><td>X 74.79</td><td>15379</td></tr><tr><td>√</td><td>74.62 25235</td></tr><tr><td rowspan="2">T=4</td><td>74.92</td><td>17709</td></tr><tr><td>X</td><td>74.59 24775</td></tr><tr><td rowspan="2">T=6</td><td>X</td><td>75.10 17408 74.46</td></tr><tr><td></td><td>24538</td></tr></table>
|
| 83 |
+
|
| 84 |
+

|
| 85 |
+
Figure 2: The number of regularization samples with respect to training epochs. The distillation settings are the same as the settings in Tab. 1.
|
| 86 |
+
|
| 87 |
+
In Tab. 1, we present the count of regularization samples for a student network trained by knowledge distillation. For distillation with a temperature higher than 1, which is the common setting, we observe that if the teacher network is trained with label smoothing, more samples will be involved in variance reduction. Also, distillation from a teacher trained with label smoothing performs worse, which is consistent with Muller et al. (2019). Therefore, we conclude that for distillation with soft ¨ labels, the regularization samples during training affect the final distillation performance.
|
| 88 |
+
|
| 89 |
+
Moreover, we plot the number of regularization samples with respect to different training epochs in Fig. 2. As demonstrated in the plots, the number of such samples increases much faster when using the teacher trained with label smoothing for distillation. For regularization samples, the gap of their number between with and without label smoothing becomes larger for more training epochs. These observations verify our motivation that the bias-variance tradeoff varies sample-wisely and evolves during the training process.
|
| 90 |
+
|
| 91 |
+
From the above results, we conclude that bias-variance tradeoff for soft labels varies sample-wisely, therefore the strategy for tuning the tradeoff should also be sample-wise. In the next section, we set up ad hoc filters for soft labels and further investigate how regularization samples affect distillation.
|
| 92 |
+
|
| 93 |
+
# 3.3 HOW REGULARIZATION SAMPLES AFFECT DISTILLATION
|
| 94 |
+
|
| 95 |
+
The results presented in the last section suggest that we should avoid training with regularization samples. Hence, we design two straightforward solutions and then find that totally filtering out regularization samples deteriorates the distillation performance.
|
| 96 |
+
|
| 97 |
+

|
| 98 |
+
Figure 3: Computational graph of knowledge distillation with our proposed weighted soft labels.
|
| 99 |
+
|
| 100 |
+
Table 2: Study of the impact on distillation for regularization samples. Loss function presented here is for the loss on a specific sample. Results are classification Top-1 accuracy. We follow the settings used in Tab. 1 and set $\tau = 4$ . Results are averaged over 5 runs.
|
| 101 |
+
|
| 102 |
+
<table><tr><td rowspan="2"></td><td colspan="2">Teacher: 75.61;Student with direct training: 73.26;</td><td colspan="2">Student with standard KD: 74.92</td></tr><tr><td>Loss function</td><td>Student performance</td><td>Performance gap</td><td></td></tr><tr><td>Setting Mask KD loss on</td><td>Lce+Ld</td><td>73.51</td><td>to direct training +0.25</td><td>to KD -1.41</td></tr><tr><td>the label related logit Excluding regularization samples</td><td>{Lce,if |a|<|b|</td><td>74.59</td><td>+1.33</td><td>-0.33</td></tr><tr><td rowspan="2">Only on regularization samples</td><td>Lce+Lkd,if |a| ≥|b</td><td></td><td></td><td></td></tr><tr><td>{Lce,if |a| ≥|b| Lce+Lkd,if |a|<|bl</td><td>73.86</td><td>+0.60</td><td>-1.06</td></tr></table>
|
| 103 |
+
|
| 104 |
+
The first experiment we conduct is to manually resolve the conflicting gradient on the label related logit, as defined in section 3.2. Specifically, we apply a mask to the distillation loss $L _ { \mathrm { k d } }$ such that $\begin{array} { r } { \frac { \partial { \cal L } _ { \mathrm { k d } } } { \partial z _ { i } } = 0 } \end{array}$ where $i$ is the label. Consequently, the loss for this sample now becomes $L _ { \mathrm { k d } } ^ { * } =$ $\begin{array} { r } { \sum _ { k \neq i } \hat { y } _ { k , \tau } ^ { t } \log \hat { y } _ { k , \tau } ^ { s } } \end{array}$ . The motivation behind the masked distillation loss is that we only transfer the knowledge of resemblances among the labels. Another experiment is to figure out what role in distillation those regularization samples will play. To investigate this, we carry out knowledge distillation on two subsets of samples: 1) $L _ { \mathrm { k d } }$ is not valid on regularization samples, and 2) $L _ { \mathrm { k d } }$ is valid only on regularization samples.
|
| 105 |
+
|
| 106 |
+
The results of the two experiments are presented in Tab. 2. We can observe that all of the three approaches are not as good as the baseline knowledge distillation performance, but are better than the direct training baseline. First, since masking $L _ { \mathrm { k d } }$ loss on the label related logit results in worse performance compared to standard KD, we cannot resolve the tradeoff by applying a mask on the ground truth related logit. Then, from the second experiment, we can see that filtering out regularization samples deteriorates the distillation performance. Moreover, the result of the third experiment is higher than the direct training baseline, indicating that regularization samples are still valuable for distillation. The above results motivate us to think that regularization samples are not fully exploited by standard KD and we can tune the tradeoff to fulfill the potential of regularization samples.
|
| 107 |
+
|
| 108 |
+
# 4 WEIGHTED SOFT LABELS
|
| 109 |
+
|
| 110 |
+
From the last section, we realize that the bias-variance tradeoff varies sample-wisely during training and under fixed distillation settings, the number of regularization samples is negatively associated with the final distillation performance. Yet, discarding regularization samples deteriorates distillation performance and distilling knowledge from these samples is better than the direct training baseline. The above evidence inspires us to lower the weight of regularization samples.
|
| 111 |
+
|
| 112 |
+
Recall that regularization samples are defined by the relative value of $a$ and $b$ , we propose to assign importance weight to a sample according to $a$ and $b$ . However, since $L _ { \mathrm { k d } }$ is computed with the hyperparameter temperature, $a$ and $b$ are correlated with the temperature and thus bring difficulty to tuning the hyperparameter. To make the weighting scheme independent of the temperature hyperparameter, we compare $a$ and $b$ with temperature $\tau = 1$ . Note that when $\tau = 1$ , $a = \hat { y } _ { i , 1 } ^ { s } - y _ { i }$ and $b = y _ { i } - \hat { y } _ { i , 1 } ^ { t }$ , so we compare $\hat { y } _ { i , 1 } ^ { s }$ and $\hat { y } _ { i , 1 } ^ { t }$ instead. Finally, in the light of previous works that assign sample-wise weights (Lin et al., 2017; Tang et al., 2019), we propose weighted soft labels for knowledge distillation, which is formally defined as
|
| 113 |
+
|
| 114 |
+
Table 3: Top-1 classification accuracy results on CIFAR-100. Comparison results are quoted from Tian et al. (2020). We report our results over 5 repeated runs.
|
| 115 |
+
|
| 116 |
+
<table><tr><td rowspan="2">Teacher</td><td colspan="5">Same architecture style</td><td colspan="3">Different architecture style</td></tr><tr><td>WRN-40-2</td><td>resnet56</td><td>resnet110</td><td>resnet110</td><td>resnet32x4</td><td>resnet32x4 ShuffleNetV1</td><td>resnet32x4</td><td>WRN-40-2 ShufleNetV1</td></tr><tr><td>Student Teacher</td><td>WRN-40-1 75.61</td><td>resnet20 72.34</td><td>resnet20 74.31</td><td>resnet32 74.31</td><td>resnet8x4 79.42</td><td>79.42</td><td>ShuffleNetV2 79.42</td><td>75.61</td></tr><tr><td>Student</td><td>71.98</td><td>69.06</td><td>69.06</td><td>71.14</td><td>72.50</td><td>70.5</td><td>71.82</td><td>70.5</td></tr><tr><td></td><td></td><td></td><td>68.99</td><td>71.06</td><td>73.50</td><td>73.59</td><td>73.54</td><td>73.73</td></tr><tr><td>FitNet AT</td><td>72.24 72.77</td><td>69.21 70.55</td><td>70.22</td><td>72.31</td><td>73.44</td><td>71.73</td><td>72.73</td><td>73.32</td></tr><tr><td>SP</td><td>72.43</td><td>69.67</td><td>70.04</td><td>72.69</td><td>72.94</td><td>73.48</td><td>74.56</td><td>74.52</td></tr><tr><td>CC</td><td>72.21</td><td>69.63</td><td>69.48</td><td>71.48</td><td>72.97</td><td>71.14</td><td>71.29</td><td>71.38</td></tr><tr><td>VID</td><td>73.30</td><td>70.38</td><td>70.16</td><td>72.61</td><td>73.09</td><td>73.38</td><td>73.40</td><td>73.61</td></tr><tr><td>RKD</td><td>72.22</td><td>69.61</td><td>69.25</td><td>71.82</td><td>71.90</td><td>72.28</td><td>73.21</td><td>72.21</td></tr><tr><td>PKT</td><td>73.45</td><td>70.34</td><td>70.25</td><td>72.61</td><td>73.64</td><td>74.10</td><td>74.69</td><td>73.89</td></tr><tr><td>AB</td><td>72.38</td><td>69.47</td><td>69.53</td><td>70.98</td><td>73.17</td><td>73.55</td><td>74.31</td><td>73.34</td></tr><tr><td>FT</td><td>71.59</td><td>69.84</td><td>70.22</td><td>72.37</td><td>72.86</td><td>71.75</td><td>72.50</td><td>72.03</td></tr><tr><td>FSP</td><td>n/a</td><td>69.95</td><td>70.11</td><td>71.89</td><td>72.62</td><td>n/a</td><td>n/a</td><td>n/a</td></tr><tr><td>NST</td><td>72.24</td><td>69.60</td><td>69.53</td><td>71.96</td><td>73.30</td><td>74.12</td><td>74.68</td><td>74.89</td></tr><tr><td>KD</td><td>73.54</td><td>70.66</td><td>70.67</td><td>73.08</td><td>73.33</td><td>74.07</td><td>74.45</td><td>74.83</td></tr><tr><td>CRD</td><td>74.14</td><td>71.16</td><td>71.46</td><td>73.48</td><td>75.51</td><td>75.11</td><td>75.65</td><td>76.05</td></tr><tr><td>Ours</td><td>74.48</td><td>72.15</td><td>72.19</td><td>74.12</td><td>76.05</td><td>75.46</td><td>75.93</td><td>76.21</td></tr></table>
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
L _ { \mathrm { w s l } } = \left( 1 - \exp \left( - \frac { \log \hat { y } _ { i , 1 } ^ { s } } { \log \hat { y } _ { i , 1 } ^ { t } } \right) \right) L _ { \mathrm { k d } } = \left( 1 - \exp \left( - \frac { L _ { \mathrm { c e } } ^ { s } } { L _ { \mathrm { c e } } ^ { t } } \right) \right) L _ { \mathrm { k d } } ,
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
where $i$ is the ground truth class of the sample. The above equation means that a weighting factor is assigned to each sample’s $L _ { \mathrm { k d } }$ according to the predictions of the teacher and the student. In this way, if compared to the teacher, a student network is relatively better trained on a sample, we have $\hat { y } _ { i , 1 } ^ { s } > \hat { y } _ { i , 1 } ^ { t }$ , then a smaller weight is assigned to this sample. In Fig. 3, the whole computational graph of knowledge distillation with the proposed weighted soft labels is demonstrated. Finally, we add $L _ { \mathrm { w s l } }$ and $L _ { \mathrm { c e } }$ together to supervise the network, i.e., ${ \cal L } _ { \mathrm { t o t a l } } = { \cal L } _ { \mathrm { c e } } + \alpha { \cal L } _ { \mathrm { w s l } }$ , where $\alpha$ is a balancing hyperparameter.
|
| 123 |
+
|
| 124 |
+
# 5 EXPERIMENTS
|
| 125 |
+
|
| 126 |
+
To evaluate our weighted soft labels comprehensively, we first conduct experiments with various teacher-student pair settings on CIFAR-100 (Krizhevsky et al., 2009). Next, we compare our method with current state-of-the-art distillation methods on ImageNet (Deng et al., 2009). To validate the effectiveness of our method in terms of handling the bias-variance tradeoff, we conduct ablation experiments by applying weighted soft labels on different subsets.
|
| 127 |
+
|
| 128 |
+
# 5.1 DATASET AND HYPERPARAMETER SETTINGS
|
| 129 |
+
|
| 130 |
+
The datasets used in our experiments are CIFAR-100 (Krizhevsky et al., 2009) and ImageNet (Deng et al., 2009). CIFAR-100 contains 50K training and 10K test images of size $3 2 \times 3 2$ . ImageNet contains 1.2 million training and 50K validation images. Except the loss function, training settings like learning rate or training epochs are the same with Tian et al. (2020) for CIFAR-100 and Heo et al. (2019) for ImageNet. For distillation, we set the temperature $\tau = 4$ for CIFAR and $\tau = 2$ for ImageNet. For loss function, we set $\alpha = 2 . 2 5$ for distillation on CIFAR and $\alpha = 2 . 5$ for ImageNet via grid search. The teacher network is well-trained previously and fixed during training.
|
| 131 |
+
|
| 132 |
+
For comparison, the following recent state-of-the-art methods are chosen: FitNet (Romero et al., 2015), AT (Zagoruyko & Komodakis, 2017), SP (Tung & Mori, 2019), CC (Peng et al., 2019), VID (Ahn et al., 2019), RKD (Park et al., 2019), PKT (Passalis & Tefas, 2018), AB (Heo et al., 2019),
|
| 133 |
+
|
| 134 |
+
Table 4: Top-1 and Top-5 classification accuracy results on ImageNet validation set. All training hyperparameter like learning rate and training epochs are in accordance with (Heo et al., 2019).
|
| 135 |
+
|
| 136 |
+
<table><tr><td colspan="2">Teacher: 1 :ResNet-34 →Student:ResNet-18</td></tr><tr><td>Method</td><td>Top-1 Acc Top-5 Acc</td></tr><tr><td>Teacher Student</td><td>73.31 91.42 89.07</td></tr><tr><td>KD</td><td>69.75 70.67 90.04</td></tr><tr><td>AT</td><td>71.03 90.04</td></tr><tr><td>NST</td><td>70.29 89.53</td></tr><tr><td>FSP</td><td>70.58 89.61</td></tr><tr><td>RKD</td><td>70.40 89.78</td></tr><tr><td>Overhaul</td><td>71.03 90.15</td></tr><tr><td>CRD</td><td>71.17 90.13</td></tr><tr><td>Ours</td><td>72.04 90.70</td></tr></table>
|
| 137 |
+
|
| 138 |
+
FT (Kim et al., 2018), FSP (Yim et al., 2017), NST (Huang & Wang, 2017), Overhaul (Heo et al., 2019) and CRD (Tian et al., 2020).
|
| 139 |
+
|
| 140 |
+
<table><tr><td colspan="2">Teacher:ResNet-50 → Student: MobileNet-v1</td></tr><tr><td>Method</td><td>Top-1 Acc Top-5 Acc</td></tr><tr><td>Teacher</td><td>76.16 92.87</td></tr><tr><td>Student</td><td>68.87 88.76</td></tr><tr><td>KD</td><td>70.49 89.92</td></tr><tr><td>AT</td><td>70.18 89.68</td></tr><tr><td>FT</td><td>69.88 89.5</td></tr><tr><td>AB</td><td>68.89 88.71</td></tr><tr><td>RKD</td><td>68.50 88.32</td></tr><tr><td>Overhaul</td><td>71.33 90.33</td></tr><tr><td>CRD</td><td>69.07 88.94</td></tr><tr><td>Ours</td><td>71.52 90.34</td></tr></table>
|
| 141 |
+
|
| 142 |
+
# 5.2 MODEL COMPRESSION
|
| 143 |
+
|
| 144 |
+
Results on CIFAR-100 In Tab. 3, we present the Top-1 classification accuracy of our method and comparison methods. The results of comparison methods are quoted from Tian et al. (2020). Teacher-student pairs of the same and different architecture styles are considered. For pairs of same architecture style, we use wide residual networks (Zagoruyko & Komodakis, 2017) and residual networks (He et al., 2016). For pairs of different architecture style, residual networks and ShuffleNet (Zhang et al., 2018) pairs are chosen for experiments. As shown in the table, for distillation with both same and different architecture style, our method reached new state-of-the-art results. Specifically, our method outperforms standard KD by a large margin, which verifies the effectiveness of our method.
|
| 145 |
+
|
| 146 |
+
Results on ImageNet In Tab. 4, we compare our method with current SOTA methods on ImageNet. Note that for the $\mathrm { R e s N e t } 3 4 \mathrm { R e s N e t } - 1 8$ distillation setting, the result of CRD is trained 10 more extra epochs while ours is the same as other methods. For ResNet- $5 0 $ MobileNet-v1 distillation setting, NST and FSP are not chosen for comparison as the two methods require too large GPU memories, so we include the accuracy of FT and AB reported in Heo et al. (2019) for comparison. Our results outperform all the existing methods, verifying the practical value of our method.
|
| 147 |
+
|
| 148 |
+
# 5.3 ABLATION STUDIES
|
| 149 |
+
|
| 150 |
+
Weighted soft labels on different subsets. Recall that we propose weighted soft labels for tuning samplewise bias-variance tradeoff, it is still unclear whether the improvements come from a well-handled samplewise bias-variance tradeoff. To investigate this issue, we compare the performance gain of weighted soft labels on different training subsets. Similar to the settings used in Tab. 2, we apply weighted soft labels on two different subsets: only the regularization samples and excluding regularization samples. In Tab. 5, we show the results on subsets of only regularization samples and excluding regularization samples. From the significant improvements, we can see that our method can not only improve performance on the RS subset, the improvements on excluding RS subset is also significant. We conclude that weighted soft labels can tune sample-wise bias-variance tradeoff globally and lead to an improved distillation performance.
|
| 151 |
+
|
| 152 |
+
Table 5: Performance on different subsets with soft labels and our weighted soft labels. RS means regularization samples. Results are averaged over 5 runs.
|
| 153 |
+
|
| 154 |
+
<table><tr><td>Subsets</td><td>Standard KD</td><td>Weighted</td></tr><tr><td>Only on RS</td><td>73.86</td><td>74.46</td></tr><tr><td>Excluding RS</td><td>74.59</td><td>75.35</td></tr></table>
|
| 155 |
+
|
| 156 |
+
Distillation with label smoothing trained teacher. Our exploration of bias-variance tradeoff starts with the conclusion made in Muller et al. (2019): a teacher net- ¨ work trained with the label smoothing trick is less effective for distillation. It is worthwhile to study whether the conclusion remains true for distillation with our weighted soft labels. As discussed before, we hold the opinion that too many regularization samples make the distillation less effective. Since our weighted soft label is proposed to mitigate the negative effects of the regularization samples, with the same settings from Tab. 1, we conduct comparison experiments in Tab. 6 to see if the negative effects still exist. It is evident that weighted soft labels significantly improve the distillation performance, especially for distillation from the teacher trained with label smoothing. Besides, using the teacher trained with label smoothing still performs worse than that without label smoothing, which again verifies the conclusion drawn by Muller et al. ¨ (2019).
|
| 157 |
+
|
| 158 |
+
Table 6: Distillation using weighted soft labels and teacher trained with label smoothing (denoted as $L S ? _ { \mathrm { \Gamma } }$ ). Results are averaged over 5 runs.
|
| 159 |
+
|
| 160 |
+
<table><tr><td>T</td><td>LS?</td><td>Standard KD</td><td>Weighted</td></tr><tr><td>4</td><td>X</td><td>74.92</td><td>75.78</td></tr><tr><td>4</td><td>√</td><td>74.59</td><td>75.60</td></tr><tr><td>6</td><td>X</td><td>75.10</td><td>75.74</td></tr><tr><td>6</td><td>√</td><td>74.46</td><td>75.42</td></tr></table>
|
| 161 |
+
|
| 162 |
+
# 6 CONCLUSION
|
| 163 |
+
|
| 164 |
+
Recent studies (Muller et al., 2019; Yuan et al., 2020) point out that one important reason behind ¨ the effectiveness of distillation is the regularization effect brought by being soft. In this paper, we rethink the soft labels for distillation from a bias-variance tradeoff perspective. The tradeoff varies sample-wisely and we propose weighted soft labels to handle the tradeoff, of which the effectiveness is verified with experiments on standard evaluation benchmarks.
|
| 165 |
+
|
| 166 |
+
# ACKNOWLEDGEMENTS
|
| 167 |
+
|
| 168 |
+
This work is supported in part by a gift grant from Horizon Robotics and National Science Foundation Grant CNS-1951952. We thank Yichen Gong, Chuan Tian, Jiemin Fang and Yuzhu Sun for the discussion and assistance.
|
| 169 |
+
|
| 170 |
+
# REFERENCES
|
| 171 |
+
|
| 172 |
+
Sungsoo Ahn, Shell Xu Hu, Andreas Damianou, Neil D Lawrence, and Zhenwen Dai. Variational information distillation for knowledge transfer. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 9163–9171, 2019.
|
| 173 |
+
Jimmy Ba and Rich Caruana. Do deep nets really need to be deep? In Advances in Neural Information Processing Systems, pp. 2654–2662, 2014.
|
| 174 |
+
Anoop Korattikara Balan, Vivek Rathod, Kevin P Murphy, and Max Welling. Bayesian dark knowledge. In Advances in Neural Information Processing Systems, pp. 3438–3446, 2015.
|
| 175 |
+
Mikhail Belkin, Daniel Hsu, Siyuan Ma, and Soumik Mandal. Reconciling modern machinelearning practice and the classical bias–variance trade-off. Proceedings of the National Academy of Sciences, 116(32):15849–15854, 2019.
|
| 176 |
+
Christopher M Bishop. Pattern recognition and machine learning. springer, 2006.
|
| 177 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In The IEEE Conference on Computer Vision and Pattern Recognition, pp. 248–255. IEEE, 2009.
|
| 178 |
+
Pedro Domingos. A unified bias-variance decomposition. In International Conference on Machine Learning, pp. 231–238, 2000.
|
| 179 |
+
Stuart Geman, Elie Bienenstock, and Rene Doursat. Neural networks and the bias/variance dilemma. ´ Neural computation, 4(1):1–58, 1992.
|
| 180 |
+
Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep learning. MIT press, 2016.
|
| 181 |
+
|
| 182 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In The IEEE Conference on Computer Vision and Pattern Recognition, pp. 770–778, 2016.
|
| 183 |
+
|
| 184 |
+
Byeongho Heo, Jeesoo Kim, Sangdoo Yun, Hyojin Park, Nojun Kwak, and Jin Young Choi. A comprehensive overhaul of feature distillation. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1921–1930, 2019.
|
| 185 |
+
|
| 186 |
+
Tom Heskes. Bias/variance decompositions for likelihood-based estimators. Neural Computation, 10(6):1425–1433, 1998.
|
| 187 |
+
|
| 188 |
+
Geoffrey E. Hinton, Oriol Vinyals, and Jeffrey Dean. Distilling the knowledge in a neural network. CoRR, abs/1503.02531, 2015.
|
| 189 |
+
|
| 190 |
+
Zehao Huang and Naiyan Wang. Like what you like: Knowledge distill via neuron selectivity transfer. arXiv preprint arXiv:1707.01219, 2017.
|
| 191 |
+
|
| 192 |
+
Jangho Kim, SeongUk Park, and Nojun Kwak. Paraphrasing complex network: Network compression via factor transfer. In Advances in neural information processing systems, pp. 2760–2769, 2018.
|
| 193 |
+
|
| 194 |
+
Ron Kohavi and David H Wolpert. Bias plus variance decomposition for zero-one loss functions. In International Conference on Machine Learning, volume 96, pp. 275–83, 1996.
|
| 195 |
+
|
| 196 |
+
Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
|
| 197 |
+
|
| 198 |
+
Ruofan Liang, Tianlin Li, Longfei Li, Jing Wang, and Quanshi Zhang. Knowledge consistency between neural networks and beyond. In International Conference on Learning Representations, 2019.
|
| 199 |
+
|
| 200 |
+
Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dollar. Focal loss for dense ´ object detection. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2980–2988, 2017.
|
| 201 |
+
|
| 202 |
+
Charles Loop. Smooth subdivision surfaces based on triangles. Master’s thesis, University of Utah, Department of Mathematics, 1987.
|
| 203 |
+
|
| 204 |
+
Rafael Muller, Simon Kornblith, and Geoffrey E Hinton. When does label smoothing help? In ¨ Advances in Neural Information Processing Systems, pp. 4694–4703, 2019.
|
| 205 |
+
|
| 206 |
+
Vaishnavh Nagarajan and J. Zico Kolter. Uniform convergence may be unable to explain generalization in deep learning. In Advances in Neural Information Processing Systems, pp. 11615–11626. Curran Associates, Inc., 2019.
|
| 207 |
+
|
| 208 |
+
Brady Neal, Sarthak Mittal, Aristide Baratin, Vinayak Tantia, Matthew Scicluna, Simon LacosteJulien, and Ioannis Mitliagkas. A modern take on the bias-variance tradeoff in neural networks. arXiv preprint arXiv:1810.08591, 2018.
|
| 209 |
+
|
| 210 |
+
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, pp. 582–597. IEEE, 2016.
|
| 211 |
+
|
| 212 |
+
Wonpyo Park, Dongju Kim, Yan Lu, and Minsu Cho. Relational knowledge distillation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3967–3976, 2019.
|
| 213 |
+
|
| 214 |
+
Nikolaos Passalis and Anastasios Tefas. Learning deep representations with probabilistic knowledge transfer. In Proceedings of the European Conference on Computer Vision, pp. 268–284, 2018.
|
| 215 |
+
|
| 216 |
+
Ted Pedersen, Siddharth Patwardhan, and Jason Michelizzi. Wordnet:: Similarity-measuring the relatedness of concepts. In AAAI Conference on Artificial Intelligence, volume 4, pp. 25–29, 2004.
|
| 217 |
+
|
| 218 |
+
Baoyun Peng, Xiao Jin, Jiaheng Liu, Dongsheng Li, Yichao Wu, Yu Liu, Shunfeng Zhou, and Zhaoning Zhang. Correlation congruence for knowledge distillation. In Proceedings of the IEEE International Conference on Computer Vision, pp. 5007–5016, 2019.
|
| 219 |
+
|
| 220 |
+
Gabriel Pereyra, George Tucker, Jan Chorowski, Łukasz Kaiser, and Geoffrey Hinton. Regularizing neural networks by penalizing confident output distributions. arXiv preprint arXiv:1701.06548, 2017.
|
| 221 |
+
|
| 222 |
+
Mary Phuong and Christoph Lampert. Towards understanding knowledge distillation. In International Conference on Machine Learning, pp. 5142–5151, 2019.
|
| 223 |
+
|
| 224 |
+
PlotOptiX. https://pypi.org/project/plotoptix/. (Accessed on 09/08/2020).
|
| 225 |
+
|
| 226 |
+
Adriana Romero, Nicolas Ballas, Samira Ebrahimi Kahou, Antoine Chassang, Carlo Gatta, and Yoshua Bengio. Fitnets: Hints for thin deep nets. In International Conference on Learning Representations, 2015.
|
| 227 |
+
|
| 228 |
+
Muhamad Risqi U Saputra, Pedro PB de Gusmao, Yasin Almalioglu, Andrew Markham, and Niki Trigoni. Distilling knowledge from a deep pose regressor network. In Proceedings of the IEEE International Conference on Computer Vision, pp. 263–272, 2019.
|
| 229 |
+
|
| 230 |
+
Siqi Sun, Yu Cheng, Zhe Gan, and Jingjing Liu. Patient knowledge distillation for bert model compression. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLPIJCNLP), pp. 4314–4323, 2019.
|
| 231 |
+
|
| 232 |
+
Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In The IEEE Conference on Computer Vision and Pattern Recognition, pp. 2818–2826, 2016.
|
| 233 |
+
|
| 234 |
+
Shitao Tang, Litong Feng, Wenqi Shao, Zhanghui Kuang, Wei Zhang, and Yimin Chen. Learning efficient detector with semi-supervised adaptive distillation. arXiv preprint arXiv:1901.00366, 2019.
|
| 235 |
+
|
| 236 |
+
Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive representation distillation. In International Conference on Learning Representations, 2020.
|
| 237 |
+
|
| 238 |
+
Frederick Tung and Greg Mori. Similarity-preserving knowledge distillation. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1365–1374, 2019.
|
| 239 |
+
|
| 240 |
+
Giorgio Valentini and Thomas G Dietterich. Bias-variance analysis of support vector machines for the development of svm-based ensemble methods. Journal of Machine Learning Research, 5(Jul): 725–775, 2004.
|
| 241 |
+
|
| 242 |
+
Tiancheng Wen, Shenqi Lai, and Xueming Qian. Preparing lessons: Improve knowledge distillation with better supervision. arXiv preprint arXiv:1911.07471, 2019.
|
| 243 |
+
|
| 244 |
+
Adina Williams, Nikita Nangia, and Samuel Bowman. A broad-coverage challenge corpus for sentence understanding through inference. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pp. 1112–1122. Association for Computational Linguistics, 2018. URL http://aclweb.org/anthology/N18-1101.
|
| 245 |
+
|
| 246 |
+
Zitong Yang, Yaodong Yu, Chong You, Jacob Steinhardt, and Yi Ma. Rethinking bias-variance trade-off for generalization of neural networks. arXiv preprint arXiv:2002.11328, 2020.
|
| 247 |
+
|
| 248 |
+
Junho Yim, Donggyu Joo, Jihoon Bae, and Junmo Kim. A gift from knowledge distillation: Fast optimization, network minimization and transfer learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4133–4141, 2017.
|
| 249 |
+
|
| 250 |
+
Li Yuan, Francis EH Tay, Guilin Li, Tao Wang, and Jiashi Feng. Revisiting knowledge distillation via label smoothing regularization. In The IEEE Conference on Computer Vision and Pattern Recognition, pp. 3903–3911, 2020.
|
| 251 |
+
|
| 252 |
+

|
| 253 |
+
Figure 4: Visualization of the resemblances introduced by soft label regularizers: (a) VGG-19 (Teacher) $\to \operatorname { V G G - 1 6 }$ (Student), (b) ResNet-50 (Teacher) $ \mathrm { R e s N e t } { - 1 8 }$ (Student). And semantic similarity between label names: (c) LCH similarity (Pedersen et al., 2004), (d) WUP similarity (Pedersen et al., 2004). Darker areas denote larger values.
|
| 254 |
+
|
| 255 |
+
Sergey Zagoruyko and Nikos Komodakis. Paying more attention to attention: Improving the performance of convolutional neural networks via attention transfer. In International Conference on Learning Representations, 2017.
|
| 256 |
+
|
| 257 |
+
Xiangyu Zhang, Xinyu Zhou, Mengxiao Lin, and Jian Sun. Shufflenet: An extremely efficient convolutional neural network for mobile devices. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 6848–6856, 2018.
|
| 258 |
+
|
| 259 |
+
# A APPENDIX
|
| 260 |
+
|
| 261 |
+
# A.1 VISUALIZATION OF THE RESEMBLANCES INTRODUCED BY SOFT LABEL REGULARIZER
|
| 262 |
+
|
| 263 |
+
In Sthat $\frac { \partial ( L _ { \mathrm { k d } } - L _ { \mathrm { c e } } ) } { \partial z _ { i } }$ proposequals $y _ { i } - \hat { y } _ { i , 1 } ^ { t }$ . ∂(Lkd−Lce)∂z during the training process. When τ = 1, we show $y _ { i , \tau } ^ { t }$ the output from the teacher network mputed by a linear mapping of the activations in the teacher’s penultimate layer, the regularization indicates that the student should follow the learned the resemblances between classes (Hinton et al., 2015; Muller et al., 2019). Still, two questions are unclear: 1) what the resemblances are and 2) whether ¨ the regularization still indicates resemblances if $\tau$ is set to 4, a widely adopted hyperparameter (Tian et al., 2020).
|
| 264 |
+
|
| 265 |
+
Towards answering the questions, we visualize the value of gradient vector $\frac { \partial ( L _ { \mathrm { k d } } - L _ { \mathrm { c e } } ) } { \partial z }$ concerning each class. Specifically, on ImageNet (Deng et al., 2009) training set and $\tau = 4$ , we calculate the average value of $\frac { \partial ( L _ { \mathrm { k d } } - L _ { \mathrm { c e } } ) } { \partial z }$ for each class. Let $M$ be the matrix of values with the $i j$ -th entry $M _ { i j }$ means averaged ∂(Lkd−Lce)∂z for class j. Since Pi Mij = 0, diagonal elements are ignored for visualization. The results are visualized in Fig. 4. We find that plotting the common correlation matrix heatmap is ambiguous, because the matrix to be visualized is of large size $( 1 0 0 0 \times 1 0 0 0 )$ with a large variance. By treating each entry $M _ { i j }$ as a vertex and then constructing a mesh for the matrix, we apply subdivision (Loop, 1987) to the mesh for smoothing the extreme points and finally rendering the mesh by ray-tracing package PlotOptiX. We can observe the several facts from the figures: 1) Comparing the sub-figure (a) and (b), we can see that for distillation resemblances implied by regularizers are similar across different teacher-student pairs. 2) Comparing (ab) with (cd), we can see that the resemblances are consistent with the semantic similarity of image class names.
|
| 266 |
+
|
| 267 |
+
Table 7: Intermediate states between excluding and only on regularization samples
|
| 268 |
+
(a) CIFAR100 (WRN-40-2→WRN-40-1 with KD)
|
| 269 |
+
|
| 270 |
+
<table><tr><td colspan="4">Percentage of excluded regularization samples.</td></tr><tr><td>100%</td><td>75%</td><td>50% 74.72</td><td>25% 74.87</td></tr><tr><td>74.59</td><td>74.63</td><td></td><td></td></tr><tr><td colspan="4"> Percentage of adding non-regularization samples</td></tr><tr><td>0%</td><td>25%</td><td>50%</td><td>75%</td></tr><tr><td>73.86</td><td>74.12</td><td>74.47</td><td>74.71</td></tr></table>
|
| 271 |
+
|
| 272 |
+
(b) CIFAR100 (WRN-40-2→WRN-40-1 with weighted soft labels)
|
| 273 |
+
|
| 274 |
+
<table><tr><td colspan="4">Percentage of excluded regularization samples</td></tr><tr><td>100%</td><td>75%</td><td>50%</td><td>25%</td></tr><tr><td>75.35</td><td>75.48</td><td>75.61</td><td>75.72</td></tr><tr><td colspan="4">Percentage of : f adding non-regularization samples</td></tr><tr><td>0%</td><td>25%</td><td>50%</td><td>75%</td></tr><tr><td>74.46</td><td>74.79</td><td>75.18</td><td>75.53</td></tr></table>
|
| 275 |
+
|
| 276 |
+
In a word, for $\tau = 4$ , the variance reduction brought by soft labels still implies resemblances among labels, which are consistent with the semantic distance of class names. In the next section, we will analyze how bias-variance tradeoff changes when training with soft labels.
|
| 277 |
+
|
| 278 |
+
# A.2 INTERMEDIATE STATES BETWEEN EXCLUDING AND ONLY ON REGULARIZATION SAMPLES
|
| 279 |
+
|
| 280 |
+
To further investigate the phenomenon about regularization samples, we conduct experiments to show the intermediate states between excluding and only on regularization samples. Two settings are considered here: First, we gradually exclude regularization samples during training, from excluding all regularization samples to excluding $2 5 \%$ regularization samples; Second, we keep all regularization samples and then gradually add non-regularization samples. Since we judge a sample is regularization or not according to the training loss, we cannot pre-define a sample set such that a certain percentage samples are kept or dropped. Therefore, we propose to conduct these experiments by assigning a probability to whether backward the loss computed with regularization samples. For example, if during training, a sample is marked as regularization sample according to the value of $a$ and $b$ , we backward the loss of this sample by a probability $p = 0 . 5$ . In this way, we can get the performance of excluding $7 5 \%$ regularization samples. In Tab. 7, we first present result with KD in (a) and then present result with weighted soft labels applied in (b). We can observe that weighted soft labels are indeed balancing the sample-wise, not on dataset scale, bias and variance.
|
| 281 |
+
|
| 282 |
+
# A.3 COMBINING WITH RKD (PARK ET AL., 2019).
|
| 283 |
+
|
| 284 |
+
To investigate how the weighted soft labels can be applied to the variants of KD, we conduct an experiment of combining RKD (Park et al., 2019) with our weighted soft labels. Relational knowledge distillation measures the L2 distance of features between two samples or the angle formed by three samples as knowledge to transfer. In other words, the knowledge in RKD is measured by the relations between sample pairs. It is no longer sample-independent, which is different from the weighted soft labels applied to KD which can assign the weights sample-wisely. We currently take the averaged weighting factors of the involved sample pairs when calculating the distance/angle matrix. The results on CIFAR-100 are presented in Tab. 8 (averaged over 5 runs). As can be observed from the table, the weighted soft label applied to RKD still brings improvements, though not that big compared with WSL applied to KD. Also, we believe that it is an important future direction to explore the applications to more variants of KD.
|
| 285 |
+
|
| 286 |
+
Table 8: Combining weighted soft labels with RKD (Park et al., 2019).
|
| 287 |
+
|
| 288 |
+
<table><tr><td>Distillation settings</td><td>WRN-40-2 →WRN-16-2</td><td>WRN-40-2 →WRN-40-1</td><td>resnet56→resnet20</td></tr><tr><td>Teacher</td><td>75.61</td><td>75.61</td><td>72.34</td></tr><tr><td>Student</td><td>73.26</td><td>71.98</td><td>69.06</td></tr><tr><td>RDK</td><td>74.12</td><td>73.34</td><td>70.25</td></tr><tr><td>WSL + RKD</td><td>74.65</td><td>73.89</td><td>70.73</td></tr></table>
|
| 289 |
+
|
| 290 |
+
Table 9: Comparison to other weighting forms. (Setting: CIFAR100, WRN-40-2 WRN-40-1)
|
| 291 |
+
|
| 292 |
+
<table><tr><td>α</td><td>2.0</td><td>3.0</td><td>4.0</td></tr><tr><td>Sigmoid baseline</td><td>74.13</td><td>73.97</td><td>73.29</td></tr><tr><td>Ours</td><td>74.38</td><td>74.12</td><td>73.46</td></tr></table>
|
| 293 |
+
|
| 294 |
+
# A.4 OTHER VARIANTS OF WEIGHTING.
|
| 295 |
+
|
| 296 |
+
In the work, the weighting scheme is defined as $\begin{array} { r } { \left( 1 - \exp \left( - \frac { L _ { \mathrm { c e } } ^ { s } } { L _ { \mathrm { c e } } ^ { t } } \right) \right) } \end{array}$ , which is inspired by Lin et al. (2017); Tang et al. (2019). The basic idea is to convert $\frac { L _ { \mathrm { c e } } ^ { s } } { L _ { \mathrm { c e } } ^ { t } }$ into a value in $[ 0 , 1 ]$ , so that the weights of regularization samples are lower than those non-regularization samples. A straightforward baseline is that we can use the Sigmoid function to convert $\frac { L _ { \mathrm { c e } } ^ { s } } { L _ { \mathrm { c e } } ^ { t } }$ into a value in $[ 0 , 1 ]$ . Note that L cet is always L ce bigger than 1, so the weight needs scaling and can be defined as $\frac { 2 } { 1 + \exp ( - \frac { L _ { \mathrm { c e } } ^ { s } } { L _ { \mathrm { c e } } ^ { t } } ) } - 1$ . In Tab. 9, we present the comparison between adopted weighting form and the Sigmoid baseline. We can see that as long as we can adaptively tune the sample-wise bias-variance tradeoff, the performance is better than KD, i.e., without weighted soft labels.Therefore, although the proposed weighting form is not mathematically optimal, the not-too-big or not-too-small weights for these regularization examples are not hard to tune. These results verify our main contribution that there is sample-wise biasvariance tradeoff and we need to assign weights to the regularization examples.
|
| 297 |
+
|
| 298 |
+
# A.5 ABLATION ON $\alpha$
|
| 299 |
+
|
| 300 |
+
In Tab. 10 We first tune the value of $\alpha$ on CIFAR100, with four values $\{ 1 , 2 , 3 , 4 \}$ tested. Then we test with three values in [2, 3] in (b). Finally, we tune $\alpha$ on ImageNet in (c). As a conclusion, the results are not very sensitive to $\alpha$ and the cost of searching $\alpha$ in our work is not expensive.
|
| 301 |
+
|
| 302 |
+
# A.6 RESULTS ON MULTINLI
|
| 303 |
+
|
| 304 |
+
To further validate our method, we conduct experiments on an NLP dataset MultiNLI (Williams et al., 2018). In this setting, the teacher is BERT-base-cased with 12 layers, 768 Hidden and 108M params. The student is T3 with 3 layers, 768 Hidden and 44M params. Besides, we follow the training setting in Sun et al. (2019). In Tab. 11, we present the result comparisons of standard KD and our weighted soft labels.
|
| 305 |
+
|
| 306 |
+
Table 10: Ablation on $\alpha$
|
| 307 |
+
|
| 308 |
+
<table><tr><td colspan="5">(a) CIFAR100 (WRN-40-2→WRN-40-1)</td></tr><tr><td>α</td><td>1</td><td>2</td><td>3</td><td>4</td></tr><tr><td>Top1</td><td>73.67</td><td>74.38</td><td>74.12</td><td>73.46</td></tr></table>
|
| 309 |
+
|
| 310 |
+
(b) CIFAR100 (WRN-40-2 WRN-40-1)
|
| 311 |
+
|
| 312 |
+
<table><tr><td>α</td><td>2.25</td><td>2.5</td><td>2.75</td></tr><tr><td>Top1</td><td>74.48</td><td>74.34</td><td>74.21</td></tr></table>
|
| 313 |
+
|
| 314 |
+
(c) ImageNet (ResNet-34 ResNet-18)
|
| 315 |
+
|
| 316 |
+
<table><tr><td>α</td><td>2</td><td>2.25</td><td>2.5</td></tr><tr><td>Top1</td><td>71.91</td><td>71.96</td><td>72.04</td></tr></table>
|
| 317 |
+
|
| 318 |
+
Table 11: Results on MultiNLI.
|
| 319 |
+
|
| 320 |
+
<table><tr><td></td><td>Teacher (BERT-12)</td><td>Student (BERT-3)</td><td>KD (BERT-3)</td><td>Ours (BERT-3)</td></tr><tr><td>Results reported by Sun et al. (2019)</td><td>83.7</td><td>74.8</td><td>75.4</td><td>-</td></tr><tr><td>Our replications</td><td>83.57</td><td>75.06</td><td>75.50</td><td>76.28</td></tr></table>
|
md/train/oXSw7laxwUpln/oXSw7laxwUpln.md
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# An Empirical Investigation of Catastrophic Forgetting in Gradient-Based Neural Networks
|
| 2 |
+
|
| 3 |
+
Ian J. Goodfellow Mehdi Mirza Da Xiao Aaron Courville Yoshua Bengio
|
| 4 |
+
|
| 5 |
+
goodfeli@iro.umontreal.ca mirzamom@iro.umontreal.ca xiaoda99@bupt.edu.cn aaron.courville@umontreal.ca yoshua.bengio@umontreal.ca
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Catastrophic forgetting is a problem faced by many machine learning models and algorithms. When trained on one task, then trained on a second task, many machine learning models “forget” how to perform the first task. This is widely believed to be a serious problem for neural networks. Here, we investigate the extent to which the catastrophic forgetting problem occurs for modern neural networks, comparing both established and recent gradient-based training algorithms and activation functions. We also examine the effect of the relationship between the first task and the second task on catastrophic forgetting. We find that it is always best to train using the dropout algorithm– the dropout algorithm is consistently best at adapting to the new task, remembering the old task, and has the best tradeoff curve between these two extremes. We find that different tasks and relationships between tasks result in very different rankings of activation function performance. This suggests that the choice of activation function should always be cross-validated.
|
| 10 |
+
|
| 11 |
+
# 1. Introduction
|
| 12 |
+
|
| 13 |
+
Catastrophic forgetting(McCloskey & Cohen, 1989; Ratcliff, 1990) is a problem that affects neural networks, as well as other learning systems, including both biological and machine learning systems. When a learning system is first trained on one task, then trained on a second task, it may forget how to perform the first task. For example, a machine learning system trained with a convex objective will always reach the same configuration at the end of training on the second task, regardless of how it was initialized. This means that an SVM that is trained on two different tasks will completely forget how to perform the first task. Whenever the SVM is able to correctly classify an example from the original task, it is only due to chance similarities between the two tasks.
|
| 14 |
+
|
| 15 |
+
A well-supported model of biological learning in human beings suggests that neocortical neurons learn using an algorithm that is prone to catastrophic forgetting, and that the neocortical learning algorithm is complemented by a virtual experience system that replays memories stored in the hippocampus in order to continually reinforce tasks that have not been recently performed (McClelland et al., 1995). As machine learning researchers, the lesson we can glean from this is that it is acceptable for our learning algorithms to suffer from forgetting, but they may need complementary algorithms to reduce the information loss. Designing such complementary algorithms depends on understanding the characteristics of the forgetting experienced by our contemporary primary learning algorithms.
|
| 16 |
+
|
| 17 |
+
In this paper we investigate the extent to which catastrophic forgetting affects a variety of learning algorithms and neural network activation functions. Neuroscientific evidence suggests that the relationship between the old and new task strongly influences the outcome of the two successive learning experiences (McClelland). Consequently, we examine three different types of relationship between tasks: one in which the tasks are functionally identical but with different formats of the input, one in which the tasks are similar, and one in which the tasks are dissimilar.
|
| 18 |
+
|
| 19 |
+
We find that dropout (Hinton et al., 2012) is consistently the best training algorithm for modern feedforward neural nets. The choice of activation function has a less consistent effect–different activation functions are preferable depending on the task and relationship between tasks, as well as whether one places greater emphasis on adapting to the new task or retaining performance on the old task. When training with dropout, maxout (Goodfellow et al., 2013b) is the only activation function to consistently appear somewhere on the frontier of performance tradeoffs for all tasks we considered. However, maxout is not the best function at all points along the tradeoff curve, and does not have as consistent performance when trained without dropout, so it is still advisable to cross-validate the choice of activation function, particularly when training without dropout.
|
| 20 |
+
|
| 21 |
+
We find that in most cases, dropout increases the optimal size of the net, so the resistance to forgetting may be explained mostly by the larger nets having greater capacity. However, this effect is not consistent, and when using dissimilar task pairs, dropout usually decreases the size of the net. This suggests dropout may have other more subtle beneficial effects to characterize in the future.
|
| 22 |
+
|
| 23 |
+
# 2. Related work
|
| 24 |
+
|
| 25 |
+
Catastrophic forgetting has not been a well-studied property of neural networks in recent years. This property was well-studied in the past, but has not received much attention since the deep learning renaissance that began in 2006. Srivastava et al. (2013) repopularized the idea of studying this aspect of modern deep neural nets.
|
| 26 |
+
|
| 27 |
+
However, the main focus of this work was not to study catastrophic forgetting, so the experiments were limited. Only one neural network was trained in each case. The networks all used the same hyperparameters, and the same heuristically chosen stopping point. Only one pair of tasks was employed, so it is not clear whether the findings apply only to pairs of tasks with the same kind and degree of similarity or whether the findings generalize to many kinds of pairs of tasks. Only one training algorithm, standard gradient descent was employed. We move beyond all of these limitations by training multiple nets with different hyperparameters, stopping using a validation set, evaluating using three task pairs with different task similarity profiles, and including the dropout algorithm in our set of experiments.
|
| 28 |
+
|
| 29 |
+
# 3. Methods
|
| 30 |
+
|
| 31 |
+
In this section, we describe the basic algorithms and techniques used in our experiments.
|
| 32 |
+
|
| 33 |
+
# 3.1. Dropout
|
| 34 |
+
|
| 35 |
+
Dropout (Hinton et al., 2012; Srivastava, 2013) is a recently introduced training algorithm for neural networks. Dropout is designed to regularize neural networks in order to improve their generalization performance.
|
| 36 |
+
|
| 37 |
+
Dropout training is a modification to standard stochastic gradient descent training. When each example is presented to the network during learning, the input states and hidden unit states of the network are multiplied by a binary mask. The zeros in the mask cause some units to be removed from the network. This mask is generated randomly each time an example is presented. Each element of the mask is sampled independently of the others, using some fixed probability $p$ . At test time, no units are dropped, and the weights going out of each unit are multiplied by $p$ to compensate for that unit being present more often than it was during training.
|
| 38 |
+
|
| 39 |
+
Dropout can be seen as an extremely efficient means of training exponentially many neural networks that share weights, then averaging together their predictions. This procedure resembles bagging, which helps to reduce the generalization error. The fact that the learned features must work well in the context of many different models also helps to regularize the model.
|
| 40 |
+
|
| 41 |
+
Dropout is a very effective regularizer. Prior to the introduction of dropout, one of the main ways of reducing the generalization error of a neural network was simply to restrict its capacity by using a small number of hidden units. Dropout enables training of noticeably larger networks. As an example, we performed random hyperparameter search with 25 experiments in each case to find the best two-layer rectifier network (Glorot et al., 2011a) for classifying the MNIST dataset. When training with dropout, the best network according to the validation set had $5 6 . 4 8 \%$ more parameters than the best network trained without dropout.
|
| 42 |
+
|
| 43 |
+
We hypothesize that the increased size of optimally functioning dropout nets means that they are less prone to the catastrophic forgetting problem than traditional neural nets, which were regularized by constraining the capacity to be just barely sufficient to perform the first task.
|
| 44 |
+
|
| 45 |
+
# 3.2. Activation functions
|
| 46 |
+
|
| 47 |
+
Each of the hidden layers of our neural networks transforms some input vector $x$ into an output vector $h$ . In all cases, this is done by first computing a presynaptic activation $z = W x + b$ where $W$ is a matrix of learnable parameters and $b$ is a vector of learnable parameters. The presynaptic activation $z$ is then transformed into a post-synaptic activation $h$ by an activation function: $h = f ( z )$ . $h$ is then provided as the input to the next layer.
|
| 48 |
+
|
| 49 |
+
We studied the following activation functions:
|
| 50 |
+
|
| 51 |
+
1. Logistic sigmoid:
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\forall i , f ( z ) _ { i } = { \frac { 1 } { 1 + \exp ( - z _ { i } ) } }
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
2. Rectified linear (Jarrett et al., 2009; Glorot et al., 2011a):
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\forall i , f ( z ) _ { i } = \operatorname* { m a x } ( 0 , z _ { i } )
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
3. Hard Local Winner Take All (LWTA) (Srivastava et al., 2013):
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\forall i , f ( z ) _ { i } = g ( i , z ) z _ { i } .
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
Here $g$ is a gating function. $z$ is divided into disjoint blocks of size $k$ , and $g ( i , z )$ is $^ { 1 }$ if $z _ { i }$ is the maximal element of its group. If more than one element is tied for the maximum, we break the tie uniformly at random 1. Otherwise $g ( i , z )$ is $0$ .
|
| 70 |
+
|
| 71 |
+
4. Maxout (Goodfellow et al., 2013b):
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\forall i , f ( z ) _ { i } = \operatorname* { m a x } _ { j } \left\{ z _ { k i } , \dots , z _ { k ( i + 1 ) - 1 } \right\}
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
We trained each of these four activation functions with each of the two algorithms we considered, for a total of eight distinct methods.
|
| 78 |
+
|
| 79 |
+
# 3.3. Random hyperparameter search
|
| 80 |
+
|
| 81 |
+
Making fair comparisons between different deep learning methods is difficult. The performance of most deep learning methods is a complicated non-linear function of multiple hyperparameters. For many applications, the state of the art performance is obtained by a human practitioner selecting hyperparameters for some deep learning method. Human selection is problematic for comparing methods because the human practitioner may be more skillful at selecting hyperparameters for methods that he or she is familiar with. Human practitioners may also have a conflict of interest predisposing them to selecting better hyperparameters for methods that they prefer.
|
| 82 |
+
|
| 83 |
+
Automated selection of hyperparameters allows more fair comparison of methods with a complicated dependence on hyperparameters. However, automated selection of hyperparameters is challenging. Grid search suffers from the curse of dimensionality, requiring exponentially many experiments to explore highdimensional hyperparameter spaces. In this work, we use random hyperparameter search (Bergstra $\&$ Bengio, 2012) instead. This method is simple to implement and obtains roughly state of the art results using only 25 experiments on simple datasets such as MNIST.
|
| 84 |
+
|
| 85 |
+
Other more sophisticated methods of hyperparameter search, such as Bayesian optimization, may be able to obtain better results, but we found that random search was able to obtain state of the art performance on the tasks we consider, so we did not think that the greater complication of using these methods was justified. More sophisticated methods of hyperparameter feedback may also introduce some sort of bias into the experiment, if one of the methods we study satisfies more of the modeling assumptions of the hyperparameter selector.
|
| 86 |
+
|
| 87 |
+
# 4. Experiments
|
| 88 |
+
|
| 89 |
+
All of our experiments follow the same basic form. For each experiment, we define two tasks: the “old task” and the “new task.” We examine the behavior of neural networks that are trained on the old task, then trained on the new task.
|
| 90 |
+
|
| 91 |
+
For each definition of the tasks, we run the same suite of experiments for two kinds of algorithms: stochastic gradient descent training, and dropout training. For each of these algorithms, we try four different activation functions: logistic sigmoid, rectifier, hard LWTA, and maxout.
|
| 92 |
+
|
| 93 |
+
For each of these eight conditions, we randomly generate 25 random sets of hyperparameters. See the code accompanying the paper for details. In all cases, we use a model with two hidden layers followed by a softmax classification layer. The hyperparameters we search over include the magnitude of the maxnorm constraint (Srebro & Shraibman, 2005) for each layer, the method used to initialize the weights for each layer and any hyper-parameters associated with such method, the initial biases for each layer, the parameters controlling a saturating linear learning rate decay and momentum increase schedule, and the size of each layer.
|
| 94 |
+
|
| 95 |
+
We did not search over some hyperparameters for which good values are reasonably well-known. For example, for dropout, the best probability of dropping a hidden unit is known to usually be around 0.5, and the best probability of dropping a visible unit is known to usually be around 0.2. We used these wellknown constants on all experiments. This may reduce the maximum possible performance we are able to obtain using our search, but it makes the search function much better with only 25 experiments since fewer of the experiments fail dramatically.
|
| 96 |
+
|
| 97 |
+
We did our best to keep the hyperparameter searches comparable between different methods. We always used the same hyperparameter search for SGD as for dropout. For the different activation functions, there are some slight differences between the hyperameter searches. All of these differences are related to parameter initialization schemes. For LWTA and maxout, we always set the initial biases to 0, since randomly initializing a bias for each unit can make one unit within a group win the max too often, resulting in dead filters. For rectifiers and sigmoids, we randomly select the initial biases, but using different distributions. Sigmoid networks can benefit from significantly negative initial biases, since this encourages sparsity, but these initializations are fatal to rectifier networks, since a significantly negative initial bias can prevent a unit’s parameters from ever receiving non-zero gradient. Rectifier units can also benefit from slightly positive initial biases, because they help prevent rectifier units from getting stuck, but there is no known reason to believe this helps sigmoid units. We thus use a different range of initial biases for the rectifiers and the sigmoids. This was necessary to make sure that each method is able to achieve roughly state of the art performance with only 25 experiments in the random search. Likewise, there are some differences in the way we initialize the weights for each activation function. For all activation functions, we initialize the weights from a uniform distribution over small values, in at least some cases. For maxout and LWTA, this is always the method we use. For rectifiers and sigmoids, the hyperparameter search may also choose to use the initialization method advocated by Martens $\&$ Sutskever (2011). In this method, all but $k$ of the weights going into a unit are set to 0, while the remaining $k$ are set to relatively large random values. For maxout and LWTA, this method performs poorly because different filters within the same group can be initialized to have extremely dissimilar semantics.
|
| 98 |
+
|
| 99 |
+
In all cases, we first train on the “old task” until the validation set error has not improved in the last 100 epochs. Then we restore the parameters corresponding to the best validation set error, and begin training on the “new task”. We train until the error on the union of the old validation set and new validation set has not improved for 100 epochs.
|
| 100 |
+
|
| 101 |
+
After running all 25 randomly configured experiments for all 8 conditions, we make a possibilities frontier curve showing the minimum amount of test error on the new task obtaining for each amount of test error on the old task. Specifically, these plots are made by drawing a curve that traces out the lower left frontier of the cloud of points of all (old task test error, new task test error) pairs encountered by all 25 models during the course of training on the new task, with one point generated after each pass through the training set. Note that these test set errors are computed after training on only a subset of the training data, because we do not train on the validation set. It is possible to improve further by also training on the validation set, but we do not do so here because we only care about the relative performance of the different methods, not necessarily obtaining state of the art results.
|
| 102 |
+
|
| 103 |
+
(Usually possibilities frontier curves are used in scenarios where higher values are better, and the curves trace out the higher edge of a convex hull of scatterplot. Here, we are plotting error rates, so the lower values are better and the curves trace out the lower edge of a convex hull of a scatterplot. We used error rather than accuracy so that log scale plots would compress regions of bad performance and expand regions of good performance, in order to highlight the differences between the best-performing methods. Note that the log scaling sometimes makes the convex regions apear non-convex)
|
| 104 |
+
|
| 105 |
+
# 4.1. Input reformatting
|
| 106 |
+
|
| 107 |
+
Many naturally occurring tasks are highly similar to each other in terms of the underlying structure that must be understood, but have the input presented in a different format.
|
| 108 |
+
|
| 109 |
+
For example, consider learning to understand Italian after already learning to understand Spanish. Both tasks share the deeper underlying structure of being a natural language understanding problem, and furthermore, Italian and Spanish have similar grammar. However, the specific words in each language are different. A person learning Italian thus benefits from having a pre-existing representation of the general structure of the language. The challenge is to learn to map the new words into these structures (e.g., to attach the Italian word “sei” to the pre-existing concept of the second person conjugation of the verb “to be”) without damaging the ability to understand Spanish. The ability to understand Spanish could diminish if the learning algorithm inadvertently modifies the more abstract definition of language in general (i.e., if neurons that were used for verb conjugation before now get re-purposed for plurality agreement) rather than exploiting the pre-existing definition, or if the learning algorithm removes the associations between individual Spanish words and these pre-existing concepts (e.g., if the net retains the concept of there being a second person conjugation of the verb “to be” but forgets that the Spanish word “eres” corresponds to it).
|
| 110 |
+
|
| 111 |
+
To test this kind of learning problem, we designed a simple pair of tasks, where the tasks are the same, but with different ways of formatting the input. Specifically, we used MNIST classification, but with a different permutation of the pixels for the old task and the new task. Both tasks thus benefit from having concepts like penstroke detectors, or the concept of penstrokes being combined to form digits. However, the meaning of any individual pixel is different. The net must learn to associate new collections of pixels to penstrokes, without significantly disrupting the old higher level concepts, or erasing the old connections between pixels and penstrokes.
|
| 112 |
+
|
| 113 |
+
The classification performance results are presented in Fig. 1. Using dropout improved the two-task validation set performance for all models on this task pair. We show the effect of dropout on the optimal model size in Fig. 2. While the nets were able to basically succeed at this task, we don’t believe that they did so by mapping different sets of pixels into pre-existing concepts. We visualized the first layer weights of the best net (in terms of combined validation set error) and their apparent semantics do not noticeably change between when training on the old task concludes and training on the new task begins. This suggests that the higher layers of the net changed to be able to accomodate a relatively arbitrary projection of the input, rather than remaining the same while the lower layers adapted to the new input format.
|
| 114 |
+
|
| 115 |
+
# 4.2. Similar tasks
|
| 116 |
+
|
| 117 |
+
We next considered what happens when the two tasks are not exactly the same, but semantically similar, and using the same input format. To test this case, we used sentiment analysis of two product categories of Amazon reviews (Blitzer et al., 2007) as the two tasks.
|
| 118 |
+
|
| 119 |
+

|
| 120 |
+
Figure 2. Optimal model size with and without dropout on the input reformatting tasks.
|
| 121 |
+
|
| 122 |
+

|
| 123 |
+
Figure 4. Optimal model size with and without dropout on the similar tasks experiment.
|
| 124 |
+
|
| 125 |
+
The task is just to classify the text of a product review as positive or negative in sentiment. We used the same preprocessing as (Glorot et al., 2011b).
|
| 126 |
+
|
| 127 |
+
The classification performance results are presented in Fig. 3. Using dropout improved the two-task validation set performance for all models on this task pair. We show the effect of dropout on the optimal model size in Fig. 6.
|
| 128 |
+
|
| 129 |
+
# 4.3. Dissimilar tasks
|
| 130 |
+
|
| 131 |
+
We next considered what happens when the two tasks are semantically similar. To test this case, we used Amazon reviews as one task, and MNIST classification as another. In order to give both tasks the same output size, we used only two classes of the MNIST dataset. To give them the same validation set size, we randomly subsampled the remaining examples of the MNIST validation set (since the MNIST validation set was originally larger than the Amazon validation set, and we don’t want the estimate of the performance on the Amazon dataset to have higher variance than the MNIST one). The Amazon dataset as we preprocessed it earlier has 5,000 input features, while MNIST has only 784. To give the two tasks the same input size, we reduced the dimensionality of the Amazon data with PCA.
|
| 132 |
+
|
| 133 |
+
Classification performance results are presented in
|
| 134 |
+
|
| 135 |
+

|
| 136 |
+
Figure 1. Possibilities frontiers for the input reformatting experiment.
|
| 137 |
+
|
| 138 |
+

|
| 139 |
+
Figure 3. Possibilities frontiers for the similar tasks experiment.
|
| 140 |
+
|
| 141 |
+

|
| 142 |
+
Figure 5. Possibilities frontiers for the dissimilar tasks experiment.
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 6. Optimal model size with and without dropout on the disimilar tasks experiment.
|
| 146 |
+
Fig. 5. Using dropout improved the two-task validation set performance for all models on this task pair. We show the effect of dropout on the optimal model size in Fig. 6.
|
| 147 |
+
|
| 148 |
+
# 5. Discussion
|
| 149 |
+
|
| 150 |
+
Our experiments have shown that training with dropout is always beneficial, at least on the relatively small datasets we used in this paper. Dropout improved performance for all eight methods on all three task pairs. Dropout works the best in terms of performance on the new task, performance on the old task, and points along the tradeoff curve balancing these two extremes, for all three task pairs. Dropout’s resistance to forgetting may be explained in part by the large model sizes that can be trained with dropout. On the input-reformatted task pair and the similar task pair, dropout never decreased the size of the optimal model for any of the four activation functions we tried. However, dropout seems to have additional properties that can help prevent forgetting that we do not yet have an explanation for. On the dissimilar tasks experiment, dropout improved performance but reduced the size of the optimal model for most of the activation functions, and on the other task pairs, it occasionally had no effect on the optimal model size.
|
| 151 |
+
|
| 152 |
+
The only recent previous work on catastrophic forgetting(Srivastava et al., 2013) argued that the choice of activation function has a significant effect on the catastrophic forgetting properties of a net, and in particular that hard LWTA outperforms logistic sigmoid and rectified linear units in this respect when trained with stochastic gradient descent.
|
| 153 |
+
|
| 154 |
+
In our more extensive experiments we found that the choice of activation function has a less consistent effect than the choice of training algorithm. When we performed experiments with different kinds of task pairs, we found that the ranking of the activation functions is very problem dependent. For example, logistic sigmoid is the worst under some conditions but the best under other conditions. This suggests that one should always cross-validate the choice of activation function, as long as it is computationally feasible. We also reject the idea that hard LWTA is particular resistant to catastrophic forgetting in general, or that it makes the standard SGD training algorithm more resistant to catastrophic forgetting. For example, when training with SGD on the input reformatting task pair, hard LWTA’s possibilities frontier is worse than all activation functions except sigmoid for most points along the curve. On the similar task pair, LWTA with SGD is the worst of all eight methods we considered, in terms of best performance on the new task, best performance on the old task, and in terms of attaining points close to the origin of the possibilities frontier plot. However, hard LWTA does perform the best in some circumstances (it has the best performance on the new task for the dissimilar task pair ). This suggests that it is worth including hard LWTA as one of many activation functions in a hyperparameter search. LWTA is however never the leftmost point in any of our three task pairs, so it is probably only useful in sequential task settings where forgetting is an issue.
|
| 155 |
+
|
| 156 |
+
When computational resources are too limited to experiment with multiple activation functions, we recommend using the maxout activation function trained with dropout. This is the only method that appears on the lower-left frontier of the performance tradeoff plots for all three task pairs we considered.
|
| 157 |
+
|
| 158 |
+
# Acknowledgments
|
| 159 |
+
|
| 160 |
+
We would like to thank the developers of Theano (Bergstra et al., 2010; Bastien et al., 2012), Pylearn2 (Goodfellow et al., 2013a). We would also like to thank NSERC, Compute Canada, and Calcul Qu´ebec for providing computational resources. Ian Goodfellow is supported by the 2013 Google Fellowship in Deep Learning.
|
| 161 |
+
|
| 162 |
+
# References
|
| 163 |
+
|
| 164 |
+
Bastien, Fr´ed´eric, Lamblin, Pascal, Pascanu, Razvan, Bergstra, James, Goodfellow, Ian J., Bergeron, Arnaud, Bouchard, Nicolas, and Bengio, Yoshua. Theano: new features and speed improvements. Deep Learning and Unsupervised Feature Learning NIPS 2012 Workshop, 2012.
|
| 165 |
+
|
| 166 |
+
Bergstra, James and Bengio, Yoshua. Random search for hyper-parameter optimization. Journal of Machine Learning Research, 13:281–305, February 2012.
|
| 167 |
+
|
| 168 |
+
Bergstra, James, Breuleux, Olivier, Bastien, Fr´ed´eric,
|
| 169 |
+
|
| 170 |
+
Lamblin, Pascal, Pascanu, Razvan, Desjardins, Guillaume, Turian, Joseph, Warde-Farley, David, and Bengio, Yoshua. Theano: a CPU and GPU math expression compiler. In Proceedings of the Python for Scientific Computing Conference (SciPy), June 2010. Oral Presentation.
|
| 171 |
+
|
| 172 |
+
Blitzer, John, Dredze, Mark, and Pereira, Fernando. Biographies, bollywood, boom-boxes and blenders: Domain adaptation for sentiment classification. In ACL ’07, pp. 440–447, 2007.
|
| 173 |
+
|
| 174 |
+
Glorot, Xavier, Bordes, Antoine, and Bengio, Yoshua. Deep sparse rectifier neural networks. In JMLR W&CP: Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics (AISTATS 2011), April 2011a.
|
| 175 |
+
|
| 176 |
+
Glorot, Xavier, Bordes, Antoine, and Bengio, Yoshua. Domain adaptation for large-scale sentiment classification: A deep learning approach. In Proceedings of theTwenty-eight International Conference on Machine Learning (ICML’11), volume 27, pp. 97–110, June 2011b.
|
| 177 |
+
|
| 178 |
+
Goodfellow, Ian J., Warde-Farley, David, Lamblin, Pascal, Dumoulin, Vincent, Mirza, Mehdi, Pascanu, Razvan, Bergstra, James, Bastien, Fr´ed´eric, and Bengio, Yoshua. Pylearn2: a machine learning research library. arXiv preprint arXiv:1308.4214, 2013a.
|
| 179 |
+
|
| 180 |
+
Goodfellow, Ian J., Warde-Farley, David, Mirza, Mehdi, Courville, Aaron, and Bengio, Yoshua. Maxout networks. In Dasgupta, Sanjoy and McAllester, David (eds.), Proceedings of the 30th International Conference on Machine Learning (ICML’13), pp. 13191327. ACM, 2013b. URL http://icml.cc/ 2013/.
|
| 181 |
+
|
| 182 |
+
Hinton, Geoffrey E., Srivastava, Nitish, Krizhevsky, Alex, Sutskever, Ilya, and Salakhutdinov, Ruslan. Improving neural networks by preventing coadaptation of feature detectors. Technical report, arXiv:1207.0580, 2012.
|
| 183 |
+
|
| 184 |
+
Jarrett, Kevin, Kavukcuoglu, Koray, Ranzato, Marc’Aurelio, and LeCun, Yann. What is the best multi-stage architecture for object recognition? In Proc. International Conference on Computer Vision (ICCV’09), pp. 2146–2153. IEEE, 2009.
|
| 185 |
+
|
| 186 |
+
Martens, James and Sutskever, Ilya. Learning recurrent neural networks with Hessian-free optimization. In Proc. ICML’2011. ACM, 2011.
|
| 187 |
+
|
| 188 |
+
McClelland, J. L., McNaughton, B. L., and O’Reilly, R. C. Why there are complementary learning systems in the hippocampus and neocortex: Insights from the successes and failures of connectionist models of learning and memory. Psychological Review, 102:419–457, 1995.
|
| 189 |
+
|
| 190 |
+
McClelland, James L.
|
| 191 |
+
|
| 192 |
+
McCloskey, M. and Cohen, N. J. Catastrophic interference in connectionist networks: The sequential learning problem. In Bower, G. H. (ed.), The Psychology of Learning and Motivation, Vol. 24, pp. 109–164. Academic Press, San Diego, CA, 1989.
|
| 193 |
+
|
| 194 |
+
Ratcliff, R. Connectionist models of recognition memory: constraints imposed by learning and forgetting functions. Psychological review, 97(2):285–308, April 1990. ISSN 0033-295X. URL http://view. ncbi.nlm.nih.gov/pubmed/2186426.
|
| 195 |
+
|
| 196 |
+
Srebro, Nathan and Shraibman, Adi. Rank, tracenorm and max-norm. In Proceedings of the 18th Annual Conference on Learning Theory, pp. 545– 560. Springer-Verlag, 2005.
|
| 197 |
+
|
| 198 |
+
Srivastava, Nitish. Improving neural networks with dropout. Master’s thesis, U. Toronto, 2013.
|
| 199 |
+
|
| 200 |
+
Srivastava, Rupesh K, Masci, Jonathan, Kazerounian, Sohrob, Gomez, Faustino, and Schmidhuber, J¨urgen. Compete to compute. In Burges, C.J.C., Bottou, L., Welling, M., Ghahramani, Z., and Weinberger, K.Q. (eds.), Advances in Neural Information Processing Systems 26, pp. 2310–2318. 2013. URL http://media.nips.cc/nipsbooks/ nipspapers/paper_files/nips26/1109.pdf.
|
md/train/r-oRRT-ElX/r-oRRT-ElX.md
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# On Provable Benefits of Depth in Training Graph Convolutional Networks
|
| 2 |
+
|
| 3 |
+
Weilin Cong Penn State wxc272@psu.edu
|
| 4 |
+
|
| 5 |
+
Morteza Ramezani Penn State morteza@cse.psu.edu
|
| 6 |
+
|
| 7 |
+
Mehrdad MahdaviPenn Statemzm616@psu.edu
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
Graph Convolutional Networks (GCNs) are known to suffer from performance degradation as the number of layers increases, which is usually attributed to oversmoothing. Despite the apparent consensus, we observe that there exists a discrepancy between the theoretical understanding of over-smoothing and the practical capabilities of GCNs. Specifically, we argue that over-smoothing does not necessarily happen in practice, a deeper model is provably expressive, can converge to global optimum with linear convergence rate, and achieve very high training accuracy as long as properly trained. Despite being capable of achieving high training accuracy, empirical results show that the deeper models generalize poorly on the testing stage and existing theoretical understanding of such behavior remains elusive. To achieve better understanding, we carefully analyze the generalization capability of GCNs, and show that the training strategies to achieve high training accuracy significantly deteriorate the generalization capability of GCNs. Motivated by these findings, we propose a decoupled structure for GCNs that detaches weight matrices from feature propagation to preserve the expressive power and ensure good generalization performance. We conduct empirical evaluations on various synthetic and real-world datasets to validate the correctness of our theory.
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
In recent years, Graph Convolutional Networks (GCNs) have achieved state-of-the-art performance in dealing with graph-structured applications, including social networks [28, 21, 51, 12, 44], traffic prediction [10, 45, 34, 31], knowledge graphs [52, 53, 43], drug reaction [14, 16] and recommendation system [2, 60]. Despite the success of GCNs, applying a shallow GCN model that only uses the information of a very limited neighborhood on a large sparse graph has shown to be not effective [23, 6, 20, 9, 46]. As a result, a deeper GCN model would be desirable to reach and aggregate information from farther neighbors. The inefficiency of shallow GCNs is exacerbated even further when the labeled nodes compared to graph size is negligible, as a shallow GCN cannot sufficiently propagate the label information to the entire graph with only a few available labels [35].
|
| 16 |
+
|
| 17 |
+
Although a deeper GCN is preferred to perceive more graph structure information, unlike traditional deep neural networks, it has been pointed out that deeper GCNs potentially suffer from oversmoothing [35, 41, 26, 4, 58], vanishing/exploding gradients [33], over-squashing [1], and training difficulties [62, 38], which significantly affect the performance of GCNs as the depth increases. Among these, the most widely accepted reason is “over-smoothing”, which is referred to as a phenomenon due to applying multiple graph convolutions such that all node embeddings converge to a single subspace (or vector) and leads to indistinguishable node representations.
|
| 18 |
+
|
| 19 |
+
The conventional wisdom is that adding to the number of layers causes over-smoothing, which impairs the expressiveness power of GCNs and consequently leads to a poor training accuracy. However, we observe that there exists a discrepancy between theoretical understanding of their inherent capabilities and practical performances. According to the definition of over-smoothing that the node representation becomes indistinguishable as GCNs goes deeper, the classifier has difficulty assigning the correct label for each node if over-smoothing happens. As a result, the training accuracy is expected to be decreasing as the number of layers increases. However, as shown in Figure 1, GCNs are capable of achieving high training accuracy regardless of the number of layers. But, as it can be observed, deeper GCNs require more training iterations to reach a high training accuracy, and its generalization performance on evaluation set decreases as the number of layers increases. This observation suggests that the performance degradation is likely due to inappropriate training rather than the low expressive power caused by over-smoothing. Otherwise, a low expressiveness model cannot achieve almost perfect training accuracy simply by proper training tricks alone.1 Indeed, recent years significant advances have been witnessed on tweaking the model architecture to overcome the training difficulties in deeper GCN models and achieve good generalization performance [38, 6, 33, 62].
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1: Comparison of F1-score for GCN with different depth on Cora dataset, where deeper models can achieve high training accuracy, but complicate the training by requiring more iterations to converge and suffer from poor generalization.
|
| 23 |
+
|
| 24 |
+
Contributions. Motivated by aforementioned observation, i.e., still achieving high training accuracy when trained properly but poor generalization performance, we aim at answering two fundamental questions in this paper:
|
| 25 |
+
|
| 26 |
+
Q1: Does increasing depth really impair the expressiveness power of GCNs? In Section 4, we argue that there exists a discrepancy between over-smoothing based theoretical results and the practical capabilities of deep GCN models, demonstrating that over-smoothing is not the key factor that leads to the performance degradation in deeper GCNs. In particular, we mathematically show that over-smoothing [41, 26, 35, 4] is mainly an artifact of theoretical analysis and simplifications made in analysis. Indeed, by characterizing the representational capacity of GCNs via Weisfeiler-Lehman (WL) graph isomorphism test [39, 55], we show that deeper GCN model is at least as expressive as the shallow GCN model, the deeper GCN models can distinguish nodes with a different neighborhood that the shallow GCN cannot distinguish, as long as the GCNs are properly trained. Besides, we theoretically show that more training iterations is sufficient (but not necessary due to the assumptions made in our theoretical analysis) for a deeper model to achieve the same training error as the shallow ones, which further suggests the poor training error in deep GCN training is most likely due to inappropriate training.
|
| 27 |
+
|
| 28 |
+
Q2: If expressive, why then deep GCNs generalize poorly?
|
| 29 |
+
|
| 30 |
+
In Section 5, in order to understand the performance degradation phenomenon in deep GCNs during the evaluation phase, we give a novel generalization analysis on GCNs and its variants (e.g., ResGCN, APPNP, and GCNII) under the semi-supervised setting for the node classification task. We show that the generalization gap of GCNs is governed by the number of training iterations, largest node degree, the largest singular value of weight matrices, and the number of layers. In particular, our result suggests that a deeper GCN model requires more iterations of training and optimization tricks to converge (e.g., adding skip-connections), which leads to a poor generalization. More interestingly, our generalization analysis shows that most of the so-called methods to solve oversmoothing [47, 61, 6, 29] can greatly improve the generalization ability of the model, therefore results in a deeper model.
|
| 31 |
+
|
| 32 |
+
The aforementioned findings naturally lead to the algorithmic contribution of this paper. In Section 6, we present a novel framework, Decoupled GCN (DGCN), that is capable of training deeper GCNs and can significantly improve the generalization performance. The main idea is to isolate the expressive power from generalization ability by decoupling the weight parameters from feature propagation. In Section 7, we conduct experiments on the synthetic and real-world datasets to validate the correctness of the theoretical analysis and the advantages of DGCN over baseline methods.
|
| 33 |
+
|
| 34 |
+
# 2 Related works
|
| 35 |
+
|
| 36 |
+
Expressivity of GCNs. Existing results on expressive power of GCNs are mixed, [39, 37, 7, 5] argue that deeper model has higher expressive power but [41, 26, 25] have completely opposite result. On the one hand, [39] shows a deeper GCN is as least as powerful as the shallow one in terms of distinguishing non-isomorphic graphs. [37] shows that deep and wide GCNs is Turing universal, however, GCNs lose power when their depth and width are restricted. [7] and [5] measure the expressive power of GCNs via its subgraph counting capability and attribute walks, and both show the expressive power of GCNs grows exponentially with the GCN depth. On the other hand, [25] studies the infinity wide GCNs and shows that the covariance matrix of its outputs converges to a constant matrix at an exponential rate. [41, 26] characterize the expressive power using the distance between node embeddings to a node feature agnostic subspace and show the distance is decreasing as the number of layers increases. Details are deferred to Section 4 and Appendix B. Such contradictory results motivate us to rethink the role of over-smoothing on expressiveness.
|
| 37 |
+
|
| 38 |
+
Generalization analysis of GCNs. In recent years, many papers are working on the generalization of GCNs using uniform stability [50, 63], Neural Tangent Kernel [15], VC-dimension [49], Rademacher complexity [18, 42], algorithm alignment [56, 57] and PAC-Bayesian [36]. Existing works only focus on a specific GCN structure, which cannot be used to understand the impact of GCN structures on its generalization ability. The most closely related to ours is [50], where they analyze the stability of the single-layer GCN model, and show that the stability of GCN depends on the largest absolute eigenvalue of its Laplacian matrix. However, their result is under the inductive learning setting and extending the results to the multi-layer GCNs with different structures is non-trivial.
|
| 39 |
+
|
| 40 |
+
Literature with similar observations. Most recently, several works have similar observations on the over-smoothing issue to ours. [62] argues that the main factors to performance degradation are vanishing gradient, training instability, and over-fitting, rather than over-smoothing, and proposes a node embedding normalization heuristic to alleviate the aforementioned issues. [38] argues that the performance degradation is mainly due to the training difficulty, and proposes a different graph Laplacian formulation, weight parameter initialization, and skip-connections to improve the training difficulty. [59] argues that deep GCNs can learn to overcome the over-smoothing issue during training, and the key factor of performance degradation is over-fitting, and proposes a node embedding normalization method to help deep GCNs overcome the over-smoothing issue. [30] improves the generalization ability of GCNs by using adversarial training and results in a consistent improvement than all GCNs baseline models without adversarial training. All aforementioned literature only gives heuristic explanations based on the empirical results, and do not provide theoretical arguments.
|
| 41 |
+
|
| 42 |
+
# 3 Preliminaries
|
| 43 |
+
|
| 44 |
+
Notations and setup. We consider the semi-supervised node classification problem, where a selfconnected graph $\mathcal { G } = ( \nu , \mathcal { E } )$ with $N = | \nu |$ nodes is given in which each node $i \in \nu$ is associated with a feature vector $\mathbf { x } _ { i } \in \mathbb { R } ^ { d _ { 0 } }$ , and only a subset of nodes $\mathcal { V } _ { \mathrm { t r a i n } } \subset \mathcal { V }$ are labeled, i.e., $y _ { i } \in \{ 1 , \ldots , | { \mathcal { C } } | \}$ for each $i \in \mathcal { V } _ { \mathrm { t r a i n } }$ and $\mathcal { C }$ is the set of all candidate classes. Let $\mathbf { A } \in \mathbb { R } ^ { N \times N }$ denote the adjacency matrix and $\mathbf { D } \in \mathbb { R } ^ { N \times N }$ denote the corresponding degree matrix with $D _ { i , i } = \deg ( i )$ and $D _ { i , j } = 0$ if $i \neq j$ . Then, the propagation matrix (using the Laplacian matrix defined in [28]) is computed as $\mathbf { P } = \mathbf { D } ^ { - 1 / 2 } \mathbf { A } \mathbf { D } ^ { - 1 / 2 }$ . Our goal is to learn a GCN model using the node features for all nodes $\{ { \bf x } _ { i } \} _ { i \in \mathcal { V } }$ and node labels for the training set nodes $\{ y _ { i } \} _ { i \in \mathcal { V } _ { \operatorname { t r a i n } } }$ , and expect it generalizes well on the unlabeled node set $\mathcal { V } _ { \mathrm { t e s t } } = \mathcal { V } \setminus \mathcal { V } _ { \mathrm { t r a i n } }$ .
|
| 45 |
+
|
| 46 |
+
GCN architectures. In this paper, we consider the following architectures for training GCNs:
|
| 47 |
+
|
| 48 |
+

|
| 49 |
+
Figure 2: Comparison of intra- and inter-class normalized node embeddings $\mathbf { H } ^ { ( \ell ) } / \| \mathbf { H } ^ { ( \ell ) } \| _ { \mathrm { F } }$ pairwise distance on Cora dataset. See Appendix A for more evidences.
|
| 50 |
+
|
| 51 |
+
• Vanilla GCN [28] computes node embeddings by $\mathbf { H } ^ { ( \ell ) } = \sigma ( \mathbf { P H } ^ { ( \ell - 1 ) } \mathbf { W } ^ { ( \ell ) } )$ , where $\mathbf { H } ^ { ( \ell ) } =$ $\{ \mathbf { h } _ { i } ^ { ( \ell ) } \} _ { i = 1 } ^ { N }$ is the \`th layer node embedding matrix, $\mathbf { h } _ { i } ^ { ( \ell ) } \in \mathbb { R } ^ { d _ { \ell } }$ is the embedding of $i$ th node, $\mathbf { W } ^ { ( \ell ) } \in \mathbb { R } ^ { d _ { \ell } \times d _ { \ell - 1 } }$ is the \`th layer weight matrix, and $\sigma ( \cdot )$ is the ReLU activation.
|
| 52 |
+
|
| 53 |
+
• ResGCN [33] solves the vanishing gradient issue by adding skip-connections between adjacency layers. More specifically, ResGCN computes node embeddings by $\mathbf { H } ^ { ( \ell ) } = \sigma ( \mathbf { P H } ^ { ( \ell - 1 ) } \mathbf { \dot { W } } ^ { ( \ell ) } ) \dot { + }$ $\mathbf { H } ^ { ( \ell - 1 ) }$ No fully connected layer after node feature, where node embeddings of the previous layer is added to the output of the current layer to facilitate the training of deeper GCN models.
|
| 54 |
+
|
| 55 |
+
• APPNP [29] adds skip-connections from the input layer to each hidden layer to preserve the feature information. APPNP computes node embeddings by $\mathbf { H } ^ { ( \ell ) } = \alpha _ { \ell } \mathbf { P } \mathbf { H } ^ { ( \ell - 1 ) } + ( \mathbf { \bar { l } } - \alpha _ { \ell } ) \mathbf { H } ^ { ( 0 ) } \mathbf { W }$ , where $\alpha _ { \ell } \in [ 0 , 1 ]$ balances the amount of information preserved at each layer. By decoupling feature transformation and propagation, APPNP can aggregate information from multi-hop neighbors without significantly increasing the computation complexity.
|
| 56 |
+
|
| 57 |
+
• GCNII [6] improves the capacity of APPNP by adding non-linearty and weight matrix at each individual layer. GCNII computes node embeddings by $\mathbf { H } ^ { ( \ell ) } = \bar { \sigma } \big ( ( \alpha _ { \ell } \mathbf { P } \bar { \mathbf { H } ^ { ( \ell - 1 ) } } + ( 1 -$ $\alpha _ { \ell } ) \mathbf { H } ^ { ( 0 ) } ) \bar { \mathbf { W } } ^ { ( \ell ) } )$ , where $\bar { \mathbf { W } } ^ { ( \ell ) } = \beta _ { \ell } \mathbf { W } ^ { ( \ell ) } + ( 1 - \beta _ { \ell } ) \mathbf { I }$ , constant $\alpha _ { \ell }$ same as APPNP, and constant $\beta _ { \ell } \in [ 0 , 1 ]$ restricts the power of \`th layer parameters.
|
| 58 |
+
|
| 59 |
+
# 4 On true expressiveness and optimization landscape of deep GCNs
|
| 60 |
+
|
| 61 |
+
Empirical validation of over-smoothing. In this section, we aim at answering the following fundamental question: “Does over-smoothing really cause the performance degradation in deeper $G C N s ? ^ { \prime \prime }$ As first defined in [35], over-smoothing is referred to as a phenomenon where all node embeddings converge to a single vector after applying multiple graph convolution operations to the node features. However, [35] only considers the graph convolution operation without non-linearity and the per-layer weight matrices. To verify whether over-smoothing exists in normal GCNs, we measure the pairwise distance between the normalized node embeddings with varying the model depth.2 As shown in Figure 2, without the weight matrices and non-linear activation functions, the pairwise distance between node embeddings indeed decreases as the number of layers increases. However, by considering the weight matrices and non-linearity, the pairwise distances are actually increasing after a certain depth which contradicts the definition of over-smoothing that node embeddings become indistinguishable when the model becomes deeper. That is, graph convolution makes adjacent node embeddings get closer, then non-linearity and weight matrices help node embeddings preserve distinguishing-ability after convolution.
|
| 62 |
+
|
| 63 |
+
Most recently, [41, 26] generalize the idea of over-smoothing by taking both the non-linearity and weight matrices into considerations. More specifically, the expressive power of the \`th layer node embeddings $\mathbf { H } ^ { ( \ell ) }$ is measured using $d _ { \mathcal { M } } ( \mathbf { H } ^ { ( \ell ) } )$ , which is defined as the distance of node embeddings to a subspace $\mathcal { M }$ that only has node degree information. Let denote $\lambda _ { L }$ as the second largest eigenvalue of graph Laplacian and $\lambda _ { W }$ as the largest singular value of weight matrices. [41, 26] show that the expressive power $d _ { \mathcal { M } } ( \mathbf { H } ^ { ( \ell ) } )$ is bounded by $d _ { \mathcal { M } } ( \mathbf { H } ^ { ( \ell ) } ) \leq ( \lambda _ { W } \lambda _ { L } ) ^ { \ell } \cdot d _ { \mathcal { M } } ( \mathbf { X } )$ , i.e., the expressive power of node embeddings will be exponentially decreasing or increasing as the number of layers increases, depending on whether $\lambda _ { W } \lambda _ { L } < 1$ or $\lambda _ { W } \lambda _ { L } > 1$ . They conclude that deeper GCN exponentially loss expressive power by assuming $\lambda _ { W } \lambda _ { L } < 1$ . However, we argue that this assumption does not always hold. To see this, let suppose $\mathbf { W } ^ { ( \ell ) } \in \mathbb { R } ^ { d _ { \ell - 1 } \times d _ { \ell } }$ is initialized by uniform distribution $\mathcal { N } ( 0 , \sqrt { 1 / d _ { \ell - 1 } } )$ . By the Gordon’s theorem for Gaussian matrices [11], we know its expected largest singular value is bounded by $\mathbb { E } [ \lambda _ { W } ] \le 1 + \sqrt { d _ { \ell } / d _ { \ell - 1 } }$ , which is strictly greater than 1 and $\lambda _ { W }$ usually increases during training. The above discussion also holds for other commonly used initialization methods [19, 22]. Furthermore, since most real world graphs are sparse with $\lambda _ { L }$ close to 1, e.g., Cora has $\lambda _ { L } = 0 . 9 9 6 4$ , Citeseer has $\lambda _ { L } = 0 . 9 9 8 7$ , and Pubmed has $\lambda _ { L } = 0 . 9 9 0 5$ , making assumption on $\lambda _ { W } \lambda _ { L } < 1$ is not realistic. As shown in Figure 3, when increasing the number of layers, we observe that the distance $d _ { \mathcal { M } } ( \mathbf { H } ^ { ( \ell ) } )$ is decreasing on untrained-GCN models, however, the distance $d _ { \mathcal { M } } ( \mathbf { H } ^ { ( \ell ) } )$ is increasing on trained-GCN models, which contradicts the conclusion in [41]. Due to the space limit, we defer the more empirical evidence to Appendix B. Through these findings, we cast doubt on the power of over-smoothing based analysis to provide a complete picture of why deep GCNs perform badly.
|
| 64 |
+
|
| 65 |
+

|
| 66 |
+
Figure 3: Compare $d _ { \mathcal { M } } ( \mathbf { H } ^ { ( \ell ) } )$ and $\lambda _ { W } ( \mathbf { W } ^ { ( \ell ) } )$ on both trained- (using 500 gradient update) and untrained-GCN models on Cora dataset.
|
| 67 |
+
|
| 68 |
+
Definition 1. Let $\mathcal { T } _ { i } ^ { L }$ denote the $L$ -layer computation tree of node $i$ , which represents the structured $L$ -hop neighbors of node $i$ , where the children of any node $j$ in the tree are the nodes in $\mathcal { N } ( i )$ .
|
| 69 |
+
|
| 70 |
+
Exponentially growing expressieness without strong assumptions. Indeed, we argue that deeper GCNs have stronger expressive power than the shallow GCNs. To prove this, we employ the connection between WL test3 [32] and GCNs. Recently, [39] shows that GCNs have the same expressiveness as the WL-test for graph isomorphism if they are appropriately trained, i.e., a properly trained $L$ -layer GCN computes different node representations for two nodes if their $L$ -layer computation tree (Definition 1) have different structure or different features on the corresponding nodes. Since $L$ -GCN can encode any different computation tree into different representations, it is natural to characterize the expressiveness of $L$ -GCN by the number of computation graph it can encode.
|
| 71 |
+
|
| 72 |
+
Theorem 1. Suppose $\mathcal { T } ^ { L }$ is a computation tree with binary node features and node degree at least d. Then, by assuming the computation tree of two nodes are disjoint, the richness (i.e., the number of computation graphs a model can encode) of the output of $L$ -GCN defined on $\mathcal { T } ^ { L }$ is at least $| \bar { L } \bar { - } G C \bar { N } ( \bar { \cal T } ^ { L } ) | \geq 2 ( \bar { d } - 1 ) ^ { L - 1 }$ .
|
| 73 |
+
|
| 74 |
+
The proof is deferred to Appendix C. The above theorem implies that the richness of $L$ -GCN grows at least exponentially with respect to the number of layers.
|
| 75 |
+
|
| 76 |
+
Comparison of expressiveness metrics. Although distance-based expressiveness metric [41, 26] is strong than WL-based metric in the sense that node embeddings can be distinct but close to each other, the distance-based metric requires explicit assumptions on the GCN structures, weight matrices, and graph structures comparing to the WL-based metric, which has been shown that are not likely hold. On the other hand, WL-based metric has been widely used in characterizing the expressive power of GCNs in graph-level task [39, 37, 7, 5]. More details are deferred to related works (Section 2).
|
| 77 |
+
|
| 78 |
+
Although expressive, it is still unclear why the deeper GCN requires more training iterations to achieve small training error and reach the properly trained status. To understand this, we show in Theorem 2 that under assumptions on the width of the final layer, the deeper GCN can converge to its global optimal with linear convergence rate. More specifically, the theorem claims that if the dimension of the last layer of $\mathrm { G C N } d _ { L }$ is larger than the number of data $N ^ { 4 }$ , then we can guarantee the loss ${ \mathcal { L } } ( \theta _ { T } ) \leq \varepsilon$ after $T = \mathcal { O } ( 1 / \varepsilon )$ iterations of the gradient updates. Besides, more training iterations is sufficient (but not necessary due to the assumptions made in our theoretical analysis) for a deeper model to achieve the same training error as the shallow ones.
|
| 79 |
+
|
| 80 |
+
Theorem 2. Let $\pmb { \theta } _ { t } = \{ \mathbf { W } _ { t } ^ { ( \ell ) } \in \mathbb { R } ^ { d _ { \ell - 1 } \times d _ { \ell } } \} _ { \ell = 1 } ^ { L + 1 }$ be the model parameter at the $t$ -th iteration and using square loss $\begin{array} { r } { \mathcal { L } ( \pmb { \theta } ) = \frac { 1 } { 2 } \| \mathbf { H } ^ { ( L ) } \mathbf { W } ^ { ( L + 1 ) } - \mathbf { Y } \| _ { \mathrm { F } } ^ { 2 } } \end{array}$ , $\mathbf { H } ^ { ( \ell ) } = \sigma ( \mathbf { P H } ^ { ( \ell - 1 ) } \mathbf { W } ^ { ( \ell ) } )$ as objective function. Then, under the condition that $d _ { L } \geq N$ we can obtain $\mathcal { L } ( \pmb { \theta } _ { T } ) \leq \epsilon i f T \geq C ( L ) \log ( \mathcal { L } ( \pmb { \theta } _ { 0 } ) / \epsilon )$ , where $\epsilon$ is the desired error and $C ( L )$ is a function of GCN depth $L$ that grows as GCN becomes deeper.
|
| 81 |
+
|
| 82 |
+
A formal statement of Theorem 2 and its proof are deferred to Appendix D. Besides, gradient stability also provides an alternative way of empirically understanding why deeper GCN requires more iterations: deeper neural networks are prone to exploding/vanishing gradient, which results in a very noisy gradient and requires small learning rate to stabilize the training. This issue can be significantly alleviated by adding skip-connections (Appendix E.5). When training with adaptive learning rate mechanisms, such as Adam $[ 2 7 ]$ , noisy gradient will result in a much smaller update on current model compared to a stabilized gradient, therefore more training iterations are required.
|
| 83 |
+
|
| 84 |
+
# 5 A different view from generalization
|
| 85 |
+
|
| 86 |
+
In the previous section, we provided evidence that a well-trained deep GCN is at least as powerful as a shallow one. However, it is still unclear why a deeper GCN has worse performance than a shallow GCN during the evaluation phase. To answer this question, we provide a different view by analyzing the impact of GCN structures on the generalization.
|
| 87 |
+
|
| 88 |
+
Transductive uniform stability. In the following, we study the generalization ability of GCNs via transductive uniform stability [17], where the generalization gap is defined as the difference between the training and testing errors for the random partition of a full dataset into training and testing sets. Transductive uniform stability is defined under the notation that the output of a classifier does not change much if the input is perturbed a bit, which is an extension of uniform stability [3] from the inductive to the transductive setting. The previous analysis on the uniform stability of GCNs [50] only shows the result of GCN with one graph convolutional layer under inductive learning setting, which cannot explain the effect of depth, model structure, and training data size on the generalization, and its extension to multi-layer GCNs and other GCN structures are non-trivial.
|
| 89 |
+
|
| 90 |
+
Problem setup. Let $m = | \mathcal { V } _ { \mathrm { t r a i n } } |$ and $u = | \nu _ { \mathrm { t e s t } } |$ denote the training and test dataset sizes, respectively. Under the transductive learning setting, we start with a fixed set of points $X _ { m + u } = \{ x _ { 1 } , \ldots , x _ { m + u } \}$ For notational convenience, we assume $X _ { m }$ are the first $m$ data points and $X _ { u }$ are the last $u$ data points of $X _ { m + u }$ . We randomly select a subset $X _ { m } ~ \subset ~ X _ { m + u }$ uniformly at random and reveal the labels $Y _ { m }$ for the selected subset for training, but the labels for the remaining $u$ data points $Y _ { u } = Y _ { m + u } \setminus Y _ { m }$ are not available during the training phase. Let $S _ { m } = ( ( x _ { 1 } , y _ { 1 } ) , \bar { \bf \Phi } \cdot \cdot \cdot , ( x _ { m } , \bar { y } _ { m } ) )$ denotes the labeled set and $X _ { u } = ( x _ { m + 1 } , \dots , x _ { m + u } )$ denotes the unlabeled set. Our goal is to learn a model to label the remaining unlabeled set as accurately as possible.
|
| 91 |
+
|
| 92 |
+
For the analysis purpose, we assume a binary classifier is applied to the final layer node representation $f ( \mathbf { h } _ { i } ^ { ( L ) } ) = \tilde { \sigma } ( \mathbf { v } ^ { \top } \mathbf { h } _ { i } ^ { ( L ) } )$ with $\tilde { \sigma } ( \cdot )$ denotes the sigmoid function. We predict $\hat { y } _ { i } = 1$ if $f ( \mathbf { h } _ { i } ^ { ( L ) } ) > 1 / 2$ and $\hat { y } _ { i } = 0$ otherwise, with ground truth label $y _ { i } \in \{ 0 , 1 \}$ . Let denote the perturbed dataset as $S _ { m } ^ { i j } \triangleq ( S _ { m } \setminus \{ ( x _ { i } , y _ { i } ) \} ) \cup \{ ( x _ { j } , y _ { j } ) \}$ and $X _ { u } ^ { i j } \triangleq ( X _ { u } \setminus \{ x _ { j } \} ) \cup \{ x _ { i } \}$ , which is obtained by replacing the ith example in training set $S _ { m }$ with the $j$ th example from the testing set $X _ { u }$ . Let $\pmb { \theta }$ and $\pmb { \theta } ^ { i j }$ denote the weight parameters trained on the original dataset $( S _ { m } , X _ { u } )$ and the perturbed dataset $( S _ { m } ^ { i j } , X _ { u } ^ { i j } )$ , respectively. Then, we say transductive learner $f$ is $\epsilon$ -uniformly stable if the outputs change less than $\epsilon$ when we exchange two examples from the training set and testing set, i.e., for any $S _ { m } \subset S _ { m + u }$ and any $i , j \in [ m + u ]$ it holds that $\begin{array} { r } { \operatorname* { s u p } _ { i \in [ m + u ] } | f ( \mathbf { h } _ { i } ^ { ( L ) } ) - \tilde { f } ( \tilde { \mathbf { h } } _ { i } ^ { ( L ) } ) ) | \leq \epsilon } \end{array}$ , where $f ( \mathbf { h } _ { i } ^ { ( L ) } )$ and $\tilde { f } ( \tilde { \mathbf { h } } _ { i } ^ { ( L ) } )$ denote the prediction of node $i$ using parameters $\pmb { \theta }$ and $\pmb { \theta } ^ { i j }$ respectively.
|
| 93 |
+
|
| 94 |
+
To define testing error and training error in our setting, let us introduce the difference in probability between the correct and the incorrect label as $p ( z , y ) \triangleq y ( 2 z - 1 ) + ( 1 - y ) ( 1 - 2 z )$ with $p ( z , y ) \leq 0$ if there exists a classification error. Let denote the Then, the testing error is defined as $\begin{array} { r } { \mathcal { R } _ { u } ( f ) = \frac { 1 } { u } \sum _ { i = m + 1 } ^ { m + u } \mathbf { 1 } \{ p ( f ( \mathbf { h } _ { i } ^ { ( L ) } ) , y _ { i } ) \leq 0 \} } \end{array}$ $\gamma$ -margin loss as $\Phi _ { \gamma } ( x ) = \operatorname* { m i n } ( 1 , \operatorname* { m a x } ( 0 , 1 - x / \gamma ) )$ and the training . loss is defined as $\begin{array} { r } { \mathcal { R } _ { m } ^ { \gamma } ( f ) = \frac { 1 } { m } \sum _ { i = 1 } ^ { m } \Phi _ { \gamma } ( - p ( f ( \mathbf { h } _ { i } ^ { ( L ) } ) , y _ { i } ) ) } \end{array}$ . 6
|
| 95 |
+
|
| 96 |
+
Theorem 3 (Transductive uniform stability bound [17]). Let $f$ be a $\epsilon$ -uniformly stable transductive learner and $\gamma , \delta > 0$ , and define $Q = m u / ( m + u )$ . Then, with probability at least $1 - \delta$ over all training and testing partitions, we have $\begin{array} { r } { \mathcal { R } _ { u } ( f ) \leq \mathcal { R } _ { m } ^ { \gamma } ( f ) + \frac { 2 } { \gamma } \mathcal { O } \left( \epsilon \sqrt { Q \ln ( \delta ^ { - 1 } ) } \right) + \mathcal { O } \left( \frac { \ln ( \delta ^ { - 1 } ) } { \sqrt { Q } } \right) } \end{array}$ .
|
| 97 |
+
|
| 98 |
+
Recall that as we discussed in Section 4, deeper GCN is provable more expressive and can achieve very low training error $\mathcal { R } _ { m } ^ { \gamma } ( f )$ if properly training. Then, if the dataset size is sufficiently large, the testing error $\mathcal { R } _ { u } ( f )$ will be dominated by the generalization gap, which is mainly controlled by uniformly stable constant . In the following, we explore the impact of GCN structures on $\epsilon$ . Our key idea is to decompose the $\epsilon$ into three terms: the Lipschitz continuous constant $\rho _ { f }$ , upper bound on gradient $G _ { f }$ , and the smoothness constant $L _ { f }$ of GCNs. Please refer to Lemma 1 for details.
|
| 99 |
+
|
| 100 |
+
Lemma 1. Suppose function $f ( \mathbf { h } ^ { ( L ) } )$ is $\rho _ { f }$ -Lipschitz continuous, $L _ { f }$ -smooth, and the gradient of loss w.r.t. the parameter is bounded by $G _ { f }$ . After $T$ steps of full-batch gradient descent, we have $\begin{array} { r } { \epsilon = \frac { 2 \eta \rho _ { f } G _ { f } } { m } \sum _ { t = 1 } ^ { T } ( 1 + \eta L _ { f } ) ^ { t - 1 } } \end{array}$
|
| 101 |
+
|
| 102 |
+
The proof is deferred to Appendix K. By using Lemma 1, we can derive constant $\epsilon$ of different model structures by comparing the Lipschitz continuity, smoothness, and gradient scale.
|
| 103 |
+
|
| 104 |
+
Before proceeding to our result, we make the following standard assumption on the node feature vectors and weight matrices, which are previously used in generalization analysis of GCNs [18, 36].
|
| 105 |
+
|
| 106 |
+
Assumption 1. We assume the norm of node feature vectors, weight parameters are bounded, i.e., $\| \mathbf { x } _ { i } \| _ { 2 } \leq B _ { x }$ , $\| \mathbf { W } ^ { ( \ell ) } \| _ { 2 } \le B _ { w }$ , and $\| \mathbf { v } \| _ { 2 } \leq 1$ .
|
| 107 |
+
|
| 108 |
+
In Theorem 4, we show that the generalization bounds of GCN and its variants are dominated by the following terms: maximum node degree $d$ , model depth $L$ , training/validation set size $( m , u )$ , training iterations $T$ , and spectral norm of the weight matrices $B _ { w }$ . The larger the aforementioned variables are, the larger the generalization gap is. We defer the formal statements and proofs to Appendices F, G, H, and I.
|
| 109 |
+
|
| 110 |
+
Theorem 4 (Informal). We say model is -uniformly stable with = 2ηρf Gfm PTt= $\begin{array} { r } { \epsilon = \frac { 2 \eta \rho _ { f } G _ { f } } { m } \sum _ { t = 1 } ^ { T } ( 1 + \eta L _ { f } ) ^ { t - 1 } } \end{array}$ where the result of $\rho _ { f } , G _ { f } , L _ { f }$ 1are summarized in Table 1, and other related constants as
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
\begin{array} { r l } & { \quad B _ { d } ^ { \alpha } = ( 1 - \alpha ) \sum _ { \ell = 1 } ^ { L } ( \alpha \sqrt { d } ) ^ { \ell - 1 } + ( \alpha \sqrt { d } ) ^ { L } , \ B _ { w } ^ { \beta } = \beta B _ { w } + ( 1 - \beta ) , } \\ & { B _ { \ell , d } ^ { \alpha , \beta } = \operatorname* { m a x } \big \{ \beta \big ( ( 1 - \alpha ) L + \alpha \sqrt { d } \big ) , ( 1 - \alpha ) L B _ { w } ^ { \beta } + 1 \big \} . } \end{array}
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
In the following, we provide intuitions and discussions on the generalization bound of each algorithm:
|
| 117 |
+
|
| 118 |
+
• Deep GCN requires iterations $T$ to achieve small training error. Since the generalization bound increases with $T$ , more iterations significantly hurt its generalization power. Note that our results considers both $B _ { w } \le 1$ and $B _ { w } > 1$ , where increasing model depth will not hurt the generalization if $B _ { w } \le 1$ , and the generalization gap becomes sensitive to the model depth if $B _ { w } > 1$ . Notice that $B _ { w } > 1$ is more likely to happen during training as we discussed in Section 4.
|
| 119 |
+
|
| 120 |
+
• ResGCN resolves the training difficulties by adding skip-connections between hidden layers. Although it requires less training iterations $T$ , adding skip-connections enlarges the dependency on the number of layers $L$ and the spectral norm of weight matrices $B _ { w }$ , therefore results in a larger generalization gap and a poor generalization performance..
|
| 121 |
+
|
| 122 |
+
Table 1: Comparison of uniform stability constant $\epsilon$ of GCN variants, where $\mathcal { O } ( \cdot )$ is used to hide constants that shared between all bounds.
|
| 123 |
+
|
| 124 |
+
<table><tr><td></td><td>Pf and Gf</td><td>Lf</td><td>C1 and C2</td></tr><tr><td>EGCN</td><td>O(CHC2)</td><td>O(CIC(L + 2)CIC + 2))</td><td>C1 = max{1,√dBw},C= √d(1+Bx)</td></tr><tr><td>EResGCN</td><td>O(CC2)</td><td>O(CIC2((L + 2)CIC2 + 2))</td><td>C1 =1+ √dBω,C = √d(1+Bx)</td></tr><tr><td>EAPPNP</td><td>0(C1)</td><td>O(Ci(CiC2) +1)</td><td>C1=BqBx,C2=max{1,Bω}</td></tr><tr><td>EGCNII</td><td>O(βCIC2)</td><td>O(aβCIC(αβL +2)CIC+ 2β))</td><td></td></tr><tr><td>EDGCN</td><td>0(C1)</td><td>O(Ci(CiC2) + 1)</td><td>C1 =(√d)LBx,C2 = max{1,Bω}</td></tr></table>
|
| 125 |
+
|
| 126 |
+
• APPNP alleviates the aforementioned dependency by decoupling the weight parameters and feature propagation. As a result, its generalization gap does not significantly change as $L$ and $B _ { w }$ increase. The optimal $\alpha$ that minimizes the generalization gap can be obtained by finding the $\alpha$ that minimize the term $B _ { d } ^ { \alpha }$ . Although APPNP can significantly reduce the generalization gap, because a single weight matrix is shared between all layers, its expressive power is not enough for large-scale challenging graph datasets [24].
|
| 127 |
+
|
| 128 |
+
• To gain expressiveness, GCNII proposes to add the weight matrices back and add another hyper-parameter that explicitly controls the dependency on $B _ { w }$ . Although GCNII achieves the state-of-the-art performances on several graph datasets, the selection of hyper-parameters is non-trivial compared to APPNP because $\alpha , \beta$ are coupled with $L , B _ { w }$ , and $d$ . In practice, [6] builds a very deep GCNII by choosing $\beta$ dynamically decreases as the number of layers and different $\alpha$ values for different datasets.
|
| 129 |
+
|
| 130 |
+
• By property chosen hyper-parameters, we have the following order on the generalization gap given the same training iteration $T$ : $\mathrm { A P P N P } \leq \mathrm { G C N I I } \leq \mathrm { G C N } \leq \mathrm { R e s G C N }$ , which exactly match our empirical evaluation on the generalization gap in Section 7 and Appendix E.
|
| 131 |
+
|
| 132 |
+
Remark 1. It is worthy to provide an alternative view of DropEdge [47] and PairNorm [61] algorithms from a generalization perspective. To improve the generalization power of standard GCNs, DropEdge randomly drops edges in the training phase, which leads to a smaller maximum node degree $d _ { s } < d$ . PairNorm applies normalization on intermediate node embeddings to ensure that the total pairwise feature distances remain constant across layers, which leads to less dependency on $d$ and $B _ { w }$ . However, since deep GCN requires significantly more iterations to achieve low training error than shallow one, the performance of applying DropEdge and PairNorm on GCNs is still degrading as the number of layers increases. Most importantly, our empirical results in Appendix E.3 and $E . 4$ suggest that applying Dropout and PairNorm is hurting the training accuracy (i.e., not alleviating over-smoothing) but reducing the generalization gap.
|
| 133 |
+
|
| 134 |
+
# 6 Decoupled GCN
|
| 135 |
+
|
| 136 |
+
We propose to decouple the expressive power from generalization a(DGCN). The DGCN model can be mathematically formulated as $\begin{array} { r } { \mathbf { Z } \ = \ \sum _ { \ell = 1 } ^ { L } \alpha _ { \ell } f ^ { ( \ell ) } ( \mathbf { X } ) } \end{array}$ GCN and $f ^ { ( \ell ) } ( \mathbf { X } ) = \mathbf { P } ^ { \ell } \mathbf { X } \big ( \beta _ { \ell } \mathbf { W } ^ { ( \ell ) } + ( 1 - \beta _ { \ell } ) \mathbf { I } \big )$ , where $\mathbf { W } ^ { ( \ell ) }$ , $\alpha _ { \ell }$ and $\beta _ { \ell }$ are the learnable weights for \`th layer function $f ^ { ( \ell ) } ( { \mathbf { X } } )$ .7 The design of DGCN has the following key ingredients:
|
| 137 |
+
|
| 138 |
+
• (Decoupling) The generalization gap in GCN grows exponentially with the number of layers. To overcome this issue, we propose to decouple the weight matrices from propagation by assigning weight $\mathbf { W } ^ { ( \ell ) }$ to each individual layerwise function ${ \bf \nabla } _ { f } ( \ell ) _ { \left( \mathbf { X } \right) }$ . DGCN can be thought of as an ensemble of multiple SGCs [54] with depth from 1 to $L$ . By doing so, the generalization gap has less dependency on the number of weight matrices, and deep models with large receptive fields can incorporate information of the global graph structure. Please refer to Theorem 5 for the details. • (Learnable $\alpha _ { \ell }$ ) After decoupling the weight matrices from feature propagation, the layerwise function $f ^ { ( \ell ) } ( { \mathbf { X } } )$ with more propagation steps can suffer from less expressive power. Therefore, we propose to assign a learnable weight $\alpha _ { \ell }$ for each step of feature propagation. Intuitively, DGCN assigns smaller weight $\alpha _ { \ell }$ to each layerwise function $f ^ { ( \ell ) } ( { \mathbf { X } } )$ with more propagation steps at the beginning of training. Throughout the training, DGCN gradually adjusts the weight to leverage more useful large receptive field information. • (Learnable $\beta _ { \ell }$ ) A learnable weight $\beta _ { \ell } \in [ 0 , 1 ]$ is assigned to each weight matrix to balance the expressiveness with model complexity, which guarantees a better generalization ability.
|
| 139 |
+
|
| 140 |
+

|
| 141 |
+
Figure 4: Comparison of generalization error on synthetic dataset. The curve early stopped at the largest training accuracy iteration.
|
| 142 |
+
|
| 143 |
+
Theorem 5. Let suppose DGCN-uniformly stable with $\begin{array} { r } { \epsilon _ { D G C N } = \frac { 2 \eta \rho _ { f } \bar { G } _ { f } } { m } \sum _ { t = 1 } ^ { T } ( 1 + \eta L _ { f } ) ^ { t - 1 } } \end{array}$ $\beta _ { \ell }$ during training. We say DGCN iswhere
|
| 144 |
+
|
| 145 |
+
$$
|
| 146 |
+
\begin{array} { r } { \rho _ { f } = G _ { f } = \mathcal { O } \Big ( ( \sqrt { d } ) ^ { L } B _ { x } \Big ) , L _ { f } = \mathcal { O } \Big ( ( \sqrt { d } ) ^ { L } B _ { x } \big ( ( \sqrt { d } ) ^ { L } B _ { x } \operatorname* { m a x } \{ 1 , B _ { w } \} + 1 ) \big ) \Big ) . } \end{array}
|
| 147 |
+
$$
|
| 148 |
+
|
| 149 |
+
The details are deferred to Appendix J, and comparison of bound to other GCN variants are summarized in Table 1. Depending on the automatic selection of $\alpha _ { \ell } , \beta _ { \ell }$ , the generalization bound of DGCN is between APPNP and GCN. In the following, we make connection to many GCN structures:
|
| 150 |
+
|
| 151 |
+
• Connections to APPNP: APPNP can be thought of as a variant of DGCN. More specifically, the layerwise weight in APPNP is computed as $\alpha _ { \ell } = \alpha ( 1 - \alpha ) ^ { \ell }$ for $\ell < L$ and $\alpha _ { \ell } \stackrel { \cdot } { = } ( 1 - \alpha ) ^ { \cdot }$ for $\ell = L$ given some constant $\alpha \in ( 0 , 1 )$ , and the weight matrix is shared between all layers. Although DGCN has $L$ weight matrices, its generalization is independent of the number of weight matrices, and thus enjoys a low generalization error with high expressiveness.
|
| 152 |
+
|
| 153 |
+
• Connections to GCNII: GCNII can be regarded as a variant of DGCN. Compared to GCNII, the decoupled propagation of DGCN significantly reduces the dependency of generalization error to the weight matrices. Besides, the learnable weights $\alpha _ { \ell }$ and $\beta _ { \ell }$ allow DGCN to automatically adapt to challenging large-scale datasets without time-consuming hyper-parameter selection.
|
| 154 |
+
|
| 155 |
+
• Connections to ResGCN: By expanding the forward computation of ResGCN, we know that ResGCN can be think of as training an ensemble of GCNs from 1 to $L$ layer, i.e., $\begin{array} { r } { \mathbf { H } ^ { ( L ) } = \sum _ { \ell = 1 } ^ { L } \alpha _ { \ell } \sigma \big ( \mathbf { P H } ^ { ( \ell - 1 ) } \mathbf { W } ^ { ( \ell ) } \big ) } \end{array}$ with $\alpha _ { \ell } = 1$ . In other word, ResNet can be regarded asL the “summation of the model complexity” of $L$ -layer. However, DGCN is using $\begin{array} { r } { \sum _ { \ell = 1 } ^ { L ^ { - } } \alpha _ { \ell } = 1 } \end{array}$ which can be thought of as a “weighted average of model complexity”. Therefore, ResGCN is a special case of DGCN with equal weights $\alpha _ { \ell }$ on each layerwise function. With just a simple change on the ResNet structure, our model DGCN is both easy to train and good to generalize.
|
| 156 |
+
|
| 157 |
+
# 7 Experiments
|
| 158 |
+
|
| 159 |
+
Synthetic dataset. We empirically compare the generalization error of different GCN structures on the synthetic dataset. In particular, we create the synthetic dataset by contextual stochastic block model (CSBM) [13] with two equal-size classes. CSBM is a graph generation algorithm that adds Gaussian random vectors as node features on top of classical SBM. CSBM allows for smooth control over the information ratio between node features and graph topology by a pair of hyper-parameter $( \mu , \lambda )$ , where $\mu$ controls the diversity of the Gaussian distribution and $\lambda$ controls the number of edges between intra- and inter-class nodes. We generate random graphs with 1000 nodes, average node degree as 5, and each node has a Gaussian random vector of dimension 1000 as node features. We chose $7 5 \%$ nodes as training set, $1 5 \%$ of nodes as validation set for hyper-parameter tuning, and the remaining nodes as testing set. We conduct an experiment 20 times by randomly selecting $( \mu , \lambda )$ such that both node feature and graph topology are equally informative.
|
| 160 |
+
|
| 161 |
+
As shown in Figure 4, we have the following order on the generalization gap given the same training iteration $T$ : $\mathrm { A P P N P } \leq \mathrm { G C N I I } \leq \mathrm { G C N } \leq \mathrm { R e s G C N }$ , which exactly match the theoretical result in Theorem 4. More specifically, ResGCN has the largest generalization gap due to the skip-connections, APPNP has the smallest generalization gap by removing the weight matrices in each individual layer. GCNII achieves a good balance between GCN and APPNP by balancing the expressive and generalization power. Finally, DGCN enjoys a small generalization error by using the decoupled GCN structure.
|
| 162 |
+
|
| 163 |
+
Open graph benchmark dataset. As pointed out by Hu et al. [24], the traditional commonly-used graph datasets are unable to provide a reliable evaluation due to various factors including dataset size, leakage of node features and no consensus on data splitting. To truly evaluate the expressive and the generalization power of existing methods, we evaluate on the open graph benchmark (OGB) dataset. Experiment setups are based on the default setting for GCN implementation on the leaderboard. We choose the hidden dimension as 128, learning rate as 0.01, dropout ratio as 0.5 for Arxiv dataset, and no dropout for Products and Protein datasets. We train $3 0 0 / 1 0 \mathrm { \bar { 0 } 0 / 5 0 0 }$ epochs for Products, Proteins, and Arxiv dataset respectively. Due to limited GPU memory, the number of layers is selected as the one with the best performance between 2 to 16 layers for Arxiv dataset, 2 to 8 layers for Protein dataset, and 2 to 4 for Products dataset. We choose $\alpha _ { \ell }$ from $\{ 0 . 9 , 0 . 8 , 0 . 5 \}$ for APPNP and GCNII, and use $\beta _ { \ell } = 0 . 5 / \ell$ for GCNII, and select the setup with the best validation result for comparison.
|
| 164 |
+
|
| 165 |
+
As shown in Table 2, DGCN achieves a compatible performance to $\mathrm { G C N I I ^ { 8 } }$ without the need of manually tuning the hyper-parameters for all settings, and it significantly outperform APPNP and ResGCN. Due to the space limit, the detailed setups and more results can be found in Appendix E. Notice that generalization bounds are more valuable when comparing two models with same training accuracy (therefore we first show in Section 4 that deeper model can also achieve low training error before our discussion on generalization in Section 5).
|
| 166 |
+
|
| 167 |
+
In Table 2, because ResGCN has no restriction on the weight matrices, it can achieve lower training error and its test performance is mainly restricted by its generalization error. However, because GCNII and APPNP have restrictions on the weight matrices, their performance is mainly restricted by their training error. A model with small generalization error and no restriction on the weight (e.g., DGCN)
|
| 168 |
+
|
| 169 |
+
Table 2: Comparison of F1-score on OGB dataset.
|
| 170 |
+
|
| 171 |
+
<table><tr><td>%</td><td>Products</td><td>Proteins</td><td>Arvix</td></tr><tr><td>GCN</td><td>75.39 ± 0.21</td><td>71.66 ± 0.48</td><td>71.56 ± 0.19</td></tr><tr><td>ResGCN</td><td>75.53 ± 0.12</td><td>74.50 ± 0.41</td><td>72.56 ± 0.31</td></tr><tr><td>APPNP</td><td>66.35±0.10</td><td>71.78±0.29</td><td>68.02 ±0.55</td></tr><tr><td>GCNII</td><td>71.93 ± 0.35t</td><td>75.60±0.47</td><td>72.57 ± 0.23‡</td></tr><tr><td>DGCN</td><td>76.09 ± 0.29</td><td>75.45 ± 0.24</td><td>72.63± 0.12</td></tr></table>
|
| 172 |
+
|
| 173 |
+
is preferred as it has higher potential to reach a better test accuracy by reducing its training error.
|
| 174 |
+
|
| 175 |
+
# 8 Conclusion
|
| 176 |
+
|
| 177 |
+
In this work, we show that there exists a discrepancy between over-smoothing based theoretical results and the practical behavior of deep GCNs. Our theoretical result shows that a deeper GCN can be as expressive as a shallow GCN, if it is properly trained. To truly understand the performance decay issue of deep GCNs, we provide the first transductive uniform stability-based generalization analysis of GCNs and other GCN structures. To improve the optimization issue and benefit from depth, we propose DGCN that enjoys a provable high expressive power and generalization power. We conduct empirical evaluations on various synthetic and real-world datasets to validate the correctness of our theory and advantages over the baselines.
|
| 178 |
+
|
| 179 |
+
# Acknowledgements
|
| 180 |
+
|
| 181 |
+
This work was supported in part by NSF grant 2008398.
|
| 182 |
+
|
| 183 |
+
# References
|
| 184 |
+
|
| 185 |
+
[1] Uri Alon and Eran Yahav. On the bottleneck of graph neural networks and its practical implications. In International Conference on Learning Representations, 2020.
|
| 186 |
+
[2] Rianne van den Berg, Thomas N Kipf, and Max Welling. Graph convolutional matrix completion. arXiv preprint arXiv:1706.02263, 2017.
|
| 187 |
+
[3] Olivier Bousquet and André Elisseeff. Stability and generalization. Journal of machine learning research, 2(Mar):499–526, 2002.
|
| 188 |
+
[4] Chen Cai and Yusu Wang. A note on over-smoothing for graph neural networks. arXiv preprint arXiv:2006.13318, 2020.
|
| 189 |
+
[5] Lei Chen, Zhengdao Chen, and Joan Bruna. On graph neural networks versus graph-augmented mlps. In International Conference on Learning Representations, 2020.
|
| 190 |
+
[6] Ming Chen, Zhewei Wei, Zengfeng Huang, Bolin Ding, and Yaliang Li. Simple and deep graph convolutional networks. In Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18 July 2020, Virtual Event, volume 119 of Proceedings of Machine Learning Research, pages 1725–1735. PMLR, 2020.
|
| 191 |
+
[7] Zhengdao Chen, Lei Chen, Soledad Villar, and Joan Bruna. Can graph neural networks count substructures? In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020.
|
| 192 |
+
[8] Eli Chien, Jianhao Peng, Pan Li, and Olgica Milenkovic. Adaptive universal generalized pagerank graph neural network. 2021.
|
| 193 |
+
[9] Weilin Cong, Rana Forsati, Mahmut T. Kandemir, and Mehrdad Mahdavi. Minimal variance sampling with provable guarantees for fast training of graph neural networks. In KDD ’20: The 26th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, Virtual Event, CA, USA, August 23-27, 2020, pages 1393–1403. ACM, 2020.
|
| 194 |
+
[10] Zhiyong Cui, Kristian Henrickson, Ruimin Ke, and Yinhai Wang. Traffic graph convolutional recurrent neural network: A deep learning framework for network-scale traffic learning and forecasting. IEEE Transactions on Intelligent Transportation Systems, 2019.
|
| 195 |
+
[11] Kenneth R Davidson and Stanislaw J Szarek. Local operator theory, random matrices and banach spaces. Handbook of the geometry of Banach spaces, 1(317-366):131, 2001.
|
| 196 |
+
[12] Songgaojun Deng, Huzefa Rangwala, and Yue Ning. Learning dynamic context graphs for predicting social events. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD 2019, Anchorage, AK, USA, August 4-8, 2019, pages 1007–1016. ACM, 2019.
|
| 197 |
+
[13] Yash Deshpande, Subhabrata Sen, Andrea Montanari, and Elchanan Mossel. Contextual stochastic block models. In Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montréal, Canada, pages 8590–8602, 2018.
|
| 198 |
+
[14] Kien Do, Truyen Tran, and Svetha Venkatesh. Graph transformation policy network for chemical reaction prediction. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD 2019, Anchorage, AK, USA, August 4-8, 2019, pages 750–760. ACM, 2019.
|
| 199 |
+
[15] Simon S. Du, Kangcheng Hou, Ruslan Salakhutdinov, Barnabás Póczos, Ruosong Wang, and Keyulu Xu. Graph neural tangent kernel: Fusing graph neural networks with graph kernels. In Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pages 5724–5734, 2019.
|
| 200 |
+
[16] David Duvenaud, Dougal Maclaurin, Jorge Aguilera-Iparraguirre, Rafael Gómez-Bombarelli, Timothy Hirzel, Alán Aspuru-Guzik, and Ryan P. Adams. Convolutional networks on graphs for learning molecular fingerprints. In Advances in Neural Information Processing Systems 28: Annual Conference on Neural Information Processing Systems 2015, December 7-12, 2015, Montreal, Quebec, Canada, pages 2224–2232, 2015.
|
| 201 |
+
[17] Ran El-Yaniv and Dmitry Pechyony. Stable transductive learning. In Learning Theory, 19th Annual Conference on Learning Theory, COLT 2006, Pittsburgh, PA, USA, June 22-25, 2006, Proceedings, volume 4005 of Lecture Notes in Computer Science, pages 35–49. Springer, 2006.
|
| 202 |
+
[18] Vikas K. Garg, Stefanie Jegelka, and Tommi S. Jaakkola. Generalization and representational limits of graph neural networks. In Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18 July 2020, Virtual Event, volume 119 of Proceedings of Machine Learning Research, pages 3419–3430. PMLR, 2020.
|
| 203 |
+
[19] Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the thirteenth international conference on artificial intelligence and statistics, pages 249–256. JMLR Workshop and Conference Proceedings, 2010.
|
| 204 |
+
[20] Shunwang Gong, Mehdi Bahri, Michael M. Bronstein, and Stefanos Zafeiriou. Geometrically principled connections in graph neural networks. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2020, Seattle, WA, USA, June 13-19, 2020, pages 11412–11421. IEEE, 2020.
|
| 205 |
+
[21] William L. Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pages 1024–1034, 2017.
|
| 206 |
+
[22] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In 2015 IEEE International Conference on Computer Vision, ICCV 2015, Santiago, Chile, December 7-13, 2015, pages 1026–1034. IEEE Computer Society, 2015.
|
| 207 |
+
[23] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2016, Las Vegas, NV, USA, June 27-30, 2016, pages 770–778. IEEE Computer Society, 2016.
|
| 208 |
+
[24] Weihua Hu, Matthias Fey, Marinka Zitnik, Yuxiao Dong, Hongyu Ren, Bowen Liu, Michele Catasta, and Jure Leskovec. Open graph benchmark: Datasets for machine learning on graphs. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020.
|
| 209 |
+
[25] Wei Huang, Yayong Li, Weitao Du, Richard Yi Da Xu, Jie Yin, and Ling Chen. Wide graph neural networks: Aggregation provably leads to exponentially trainability loss. arXiv preprint arXiv:2103.03113, 2021.
|
| 210 |
+
[26] Wenbing Huang, Yu Rong, Tingyang Xu, Fuchun Sun, and Junzhou Huang. Tackling oversmoothing for general graph convolutional networks. arXiv e-prints, pages arXiv–2008, 2020.
|
| 211 |
+
[27] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015.
|
| 212 |
+
[28] 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.
|
| 213 |
+
[29] Johannes Klicpera, Aleksandar Bojchevski, and Stephan Günnemann. Predict then propagate: Graph neural networks meet personalized pagerank. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019.
|
| 214 |
+
[30] Kezhi Kong, Guohao Li, Mucong Ding, Zuxuan Wu, Chen Zhu, Bernard Ghanem, Gavin Taylor, and Tom Goldstein. Flag: Adversarial data augmentation for graph neural networks. arXiv preprint arXiv:2010.09891, 2020.
|
| 215 |
+
[31] Srijan Kumar, Xikun Zhang, and Jure Leskovec. Predicting dynamic embedding trajectory in temporal interaction networks. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD 2019, Anchorage, AK, USA, August 4-8, 2019, pages 1269–1278. ACM, 2019.
|
| 216 |
+
[32] AA Leman and B Weisfeiler. A reduction of a graph to a canonical form and an algebra arising during this reduction. Nauchno-Technicheskaya Informatsiya, 2(9):12–16, 1968.
|
| 217 |
+
[33] Guohao Li, Matthias Müller, Ali K. Thabet, and Bernard Ghanem. Deepgcns: Can gcns go as deep as cnns? In 2019 IEEE/CVF International Conference on Computer Vision, ICCV 2019, Seoul, Korea (South), October 27 - November 2, 2019, pages 9266–9275. IEEE, 2019.
|
| 218 |
+
[34] Jia Li, Zhichao Han, Hong Cheng, Jiao Su, Pengyun Wang, Jianfeng Zhang, and Lujia Pan. Predicting path failure in time-evolving graphs. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD 2019, Anchorage, AK, USA, August 4-8, 2019, pages 1279–1289. ACM, 2019.
|
| 219 |
+
[35] Qimai Li, Zhichao Han, and Xiao-Ming Wu. Deeper insights into graph convolutional networks for semi-supervised learning. In Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence, (AAAI-18), the 30th innovative Applications of Artificial Intelligence (IAAI-18), and the 8th AAAI Symposium on Educational Advances in Artificial Intelligence (EAAI-18), New Orleans, Louisiana, USA, February 2-7, 2018, pages 3538–3545. AAAI Press, 2018.
|
| 220 |
+
[36] Renjie Liao, Raquel Urtasun, and Richard Zemel. A pac-bayesian approach to generalization bounds for graph neural networks. arXiv preprint arXiv:2012.07690, 2020.
|
| 221 |
+
[37] Andreas Loukas. What graph neural networks cannot learn: depth vs width. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020.
|
| 222 |
+
[38] Sitao Luan, Mingde Zhao, Xiao-Wen Chang, and Doina Precup. Training matters: Unlocking potentials of deeper graph convolutional neural networks. arXiv preprint arXiv:2008.08838, 2020.
|
| 223 |
+
[39] Christopher Morris, Martin Ritzert, Matthias Fey, William L. Hamilton, Jan Eric Lenssen, Gaurav Rattan, and Martin Grohe. Weisfeiler and leman go neural: Higher-order graph neural networks. In The Thirty-Third AAAI Conference on Artificial Intelligence, AAAI 2019, The Thirty-First Innovative Applications of Artificial Intelligence Conference, IAAI 2019, The Ninth AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI 2019, Honolulu, Hawaii, USA, January 27 - February 1, 2019, pages 4602–4609. AAAI Press, 2019.
|
| 224 |
+
[40] Quynh Nguyen. On the proof of global convergence of gradient descent for deep relu networks with linear widths. arXiv preprint arXiv:2101.09612, 2021.
|
| 225 |
+
[41] Kenta Oono and Taiji Suzuki. Graph neural networks exponentially lose expressive power for node classification. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020.
|
| 226 |
+
[42] Kenta Oono and Taiji Suzuki. Optimization and generalization analysis of transduction through gradient boosting and application to multi-scale graph neural networks. Advances in Neural Information Processing Systems, 33, 2020.
|
| 227 |
+
[43] Namyong Park, Andrey Kan, Xin Luna Dong, Tong Zhao, and Christos Faloutsos. Estimating node importance in knowledge graphs using graph neural networks. In Proceedings of the $2 5 t h$ ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD 2019, Anchorage, AK, USA, August 4-8, 2019, pages 596–606. ACM, 2019.
|
| 228 |
+
[44] Jiezhong Qiu, Jian Tang, Hao Ma, Yuxiao Dong, Kuansan Wang, and Jie Tang. Deepinf: Modeling influence locality in large social networks. In KDD, 2018.
|
| 229 |
+
[45] Afshin Rahimi, Trevor Cohn, and Timothy Baldwin. Semi-supervised user geolocation via graph convolutional networks. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2009–2019. Association for Computational Linguistics, 2018.
|
| 230 |
+
[46] Morteza Ramezani, Weilin Cong, Mehrdad Mahdavi, Anand Sivasubramaniam, and Mahmut Kandemir. Gcn meets gpu: Decoupling “when to sample” from “how to sample”. Advances in Neural Information Processing Systems, 33, 2020.
|
| 231 |
+
[47] Yu Rong, Wenbing Huang, Tingyang Xu, and Junzhou Huang. Dropedge: Towards deep graph convolutional networks on node classification. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020.
|
| 232 |
+
[48] Ruslan Salakhutdinov. Deep learning. In The 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’14, New York, NY, USA - August 24 - 27, 2014, page 1973. ACM, 2014.
|
| 233 |
+
[49] Franco Scarselli, Ah Chung Tsoi, and Markus Hagenbuchner. The vapnik–chervonenkis dimension of graph and recursive neural networks. Neural Networks, 108:248–259, 2018.
|
| 234 |
+
[50] Saurabh Verma and Zhi-Li Zhang. Stability and generalization of graph convolutional neural networks. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD 2019, Anchorage, AK, USA, August 4-8, 2019, pages 1539– 1548. ACM, 2019.
|
| 235 |
+
[51] Hao Wang, Tong Xu, Qi Liu, Defu Lian, Enhong Chen, Dongfang Du, Han Wu, and Wen Su. MCNE: an end-to-end framework for learning multiple conditional network representations of social network. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD 2019, Anchorage, AK, USA, August 4-8, 2019, pages 1064–1072. ACM, 2019.
|
| 236 |
+
[52] Hongwei Wang, Fuzheng Zhang, Mengdi Zhang, Jure Leskovec, Miao Zhao, Wenjie Li, and Zhongyuan Wang. Knowledge-aware graph neural networks with label smoothness regularization for recommender systems. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD 2019, Anchorage, AK, USA, August 4-8, 2019, pages 968–977. ACM, 2019.
|
| 237 |
+
[53] Xiang Wang, Xiangnan He, Yixin Cao, Meng Liu, and Tat-Seng Chua. KGAT: knowledge graph attention network for recommendation. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD 2019, Anchorage, AK, USA, August 4-8, 2019, pages 950–958. ACM, 2019.
|
| 238 |
+
[54] Felix Wu, Amauri H. Souza Jr., Tianyi Zhang, Christopher Fifty, Tao Yu, and Kilian Q. Weinberger. Simplifying graph convolutional networks. In Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, volume 97 of Proceedings of Machine Learning Research, pages 6861–6871. PMLR, 2019.
|
| 239 |
+
[55] 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.
|
| 240 |
+
[56] Keyulu Xu, Jingling Li, Mozhi Zhang, Simon S. Du, Ken-ichi Kawarabayashi, and Stefanie Jegelka. What can neural networks reason about? In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020.
|
| 241 |
+
[57] Keyulu Xu, Mozhi Zhang, Jingling Li, Simon Shaolei Du, Ken-Ichi Kawarabayashi, and Stefanie Jegelka. How neural networks extrapolate: From feedforward to graph neural networks. In International Conference on Learning Representations, 2021.
|
| 242 |
+
[58] Yujun Yan, Milad Hashemi, Kevin Swersky, Yaoqing Yang, and Danai Koutra. Two sides of the same coin: Heterophily and oversmoothing in graph convolutional neural networks. arXiv preprint arXiv:2102.06462, 2021.
|
| 243 |
+
[59] Chaoqi Yang, Ruijie Wang, Shuochao Yao, Shengzhong Liu, and Tarek Abdelzaher. Revisiting" over-smoothing" in deep gcns. arXiv preprint arXiv:2003.13663, 2020.
|
| 244 |
+
[60] Rex Ying, Ruining He, Kaifeng Chen, Pong Eksombatchai, William L. Hamilton, and Jure Leskovec. Graph convolutional neural networks for web-scale recommender systems. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD 2018, London, UK, August 19-23, 2018, pages 974–983. ACM, 2018.
|
| 245 |
+
[61] Lingxiao Zhao and Leman Akoglu. Pairnorm: Tackling oversmoothing in gnns. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020.
|
| 246 |
+
[62] Kuangqi Zhou, Yanfei Dong, Wee Sun Lee, Bryan Hooi, Huan Xu, and Jiashi Feng. Effective training strategies for deep graph neural networks. arXiv preprint arXiv:2006.07107, 2020.
|
| 247 |
+
[63] Xianchen Zhou and Hongxia Wang. The generalization error of graph convolutional networks may enlarge with more layers. Neurocomputing, 424:97–106, 2021.
|
md/train/r14EOsCqKX/r14EOsCqKX.md
ADDED
|
@@ -0,0 +1,281 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# A CLOSER LOOK AT DEEP LEARNING HEURISTICS: LEARNING RATE RESTARTS, WARMUP AND DISTILLATION
|
| 2 |
+
|
| 3 |
+
Akhilesh Gotmare∗
|
| 4 |
+
Department of Computer Science EPFL, Switzerland
|
| 5 |
+
akhilesh.gotmare@epfl.ch Nitish Shirish Keskar, Caiming Xiong & Richard Socher Salesforce Research
|
| 6 |
+
Palo Alto, US
|
| 7 |
+
{nkeskar, cxiong, rsocher}@salesforce.com
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
The convergence rate and final performance of common deep learning models have significantly benefited from heuristics such as learning rate schedules, knowledge distillation, skip connections, and normalization layers. In the absence of theoretical underpinnings, controlled experiments aimed at explaining these strategies can aid our understanding of deep learning landscapes and the training dynamics. Existing approaches for empirical analysis rely on tools of linear interpolation and visualizations with dimensionality reduction, each with their limitations. Instead, we revisit such analysis of heuristics through the lens of recently proposed methods for loss surface and representation analysis, viz., mode connectivity and canonical correlation analysis (CCA), and hypothesize reasons for the success of the heuristics. In particular, we explore knowledge distillation and learning rate heuristics of (cosine) restarts and warmup using mode connectivity and CCA. Our empirical analysis suggests that: (a) the reasons often quoted for the success of cosine annealing are not evidenced in practice; (b) that the effect of learning rate warmup is to prevent the deeper layers from creating training instability; and (c) that the latent knowledge shared by the teacher is primarily disbursed to the deeper layers.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
The introduction of heuristics such as normalization layers (Ioffe & Szegedy, 2015; Ba et al., 2016), residual connections (He et al., 2016), and learning rate strategies (Loshchilov & Hutter, 2016; Goyal et al., 2017; Smith, 2017) have greatly accelerated progress in Deep Learning. Many of these ingredients are now commonplace in modern architectures, and some of them have also been buttressed with theoretical guarantees (Balduzzi et al., 2017; Poggio & Liao, 2017; Hardt & Ma, 2016). However, despite their simplicity and efficacy, why some of these heuristics work is still relatively unknown. Existing attempts at explaining these strategies empirically have been limited to intuitive explanations and the use of tools such as spectrum analysis (Sagun et al., 2017), linear interpolation between two models and low-dimensional visualizations (Li et al., 2017) of the loss surface. In our work, we instead use recent tools built specifically for analyzing deep networks, viz., mode connectivity (Garipov et al., 2018) and singular value canonical correlation analysis (SVCCA) (Raghu et al., 2017). We investigate three strategies in detail: (a) cosine learning rate decay, (b) learning rate warmup, and (c) knowledge distillation, and list the summary of our contributions at the end of this section.
|
| 16 |
+
|
| 17 |
+
Cosine annealing (Loshchilov & Hutter, 2016), also known as stochastic gradient descent with restarts (SGDR), and more generally cyclical learning rate strategies (Smith, 2017), have been recently proposed to accelerate training of deep networks (Coleman et al., 2018). The strategy involves reductions and restarts of learning rates over the course of training, and was motivated as means to escape spurious local minima. Experimental results have shown that SGDR often improves convergence both from the standpoint of iterations needed for convergence and the final objective.
|
| 18 |
+
|
| 19 |
+
Learning rate warmup (Goyal et al., 2017) also constitutes an important ingredient in training deep networks, especially in the presence of large or dynamic batch sizes. It involves increasing the learning rate to a large value over a certain number of training iterations followed by decreasing the learning rate, which can be performed using step-decay, exponential decay or other such schemes. The strategy was proposed out of the need to induce stability in the initial phase of training with large learning rates (due to large batch sizes). It has been employed in training of several architectures at scale including ResNets and Transformer networks (Vaswani et al., 2017).
|
| 20 |
+
|
| 21 |
+
Further, we investigate knowledge distillation (KD) (Hinton et al., 2015). This strategy involves first training a (teacher) model on a typical loss function on the available data. Next, a different (student) model (typically much smaller than the teacher model) is trained, but instead of optimizing the loss function defined using hard data labels, this student model is trained to mimic the teacher model. It has been empirically found that a student network trained in this fashion significantly outperforms an identical network trained with the hard data labels. We defer a detailed discussion of the three heuristics, and existing explanations for their efficacy to sections 3, 4 and 5 respectively.
|
| 22 |
+
|
| 23 |
+
Finally, we briefly describe the tools we employ for analyzing the aforementioned heuristics. Mode connectivity (MC) is a recent observation that shows that, under circumstances, it is possible to connect any two local minima of deep networks via a piecewise-linear curve (Garipov et al., 2018; Draxler et al., 2018). This shows that local optima obtained through different means, and exhibiting different local and generalization properties, are connected. The authors propose an algorithm that locates such a curve. While not proposed as such, we employ this framework to better understand loss surfaces but begin our analysis in Section 2 by first establishing its robustness as a framework.
|
| 24 |
+
|
| 25 |
+
Deep network analyses focusing on the weights of a network are inherently limited since there are several invariances in this, such as permutation and scaling. Recently, Raghu et al. (2017) propose using CCA along with some pre-processing steps to analyze the activations of networks, such that the resulting comparison is not dependent on permutations and scaling of neurons. They also prove the computational gains of using CCA over alternatives ((Li et al., 2015)) for representational analysis and employ it to better understand many phenomenon in deep learning.
|
| 26 |
+
|
| 27 |
+
# Contributions:
|
| 28 |
+
|
| 29 |
+
• We use mode connectivity and CCA to improve understanding of cosine annealing, learning rate warmup and knowledge distillation. For mode connectivity, we also establish the robustness of the approach across changes in training choices for obtaining the modes. We demonstrate that the reasons often quoted for the success of cosine annealing are not substantiated by our experiments, and that the iterates move over barriers after restarts but the explanation of escaping local minima might be an oversimplification.
|
| 30 |
+
• We show that learning rate warmup primarily limits weight changes in the deeper layers and that freezing them achieves similar outcomes as warmup.
|
| 31 |
+
• We show that the latent knowledge shared by the teacher in knowledge distillation is primarily disbursed in the deeper layers.
|
| 32 |
+
|
| 33 |
+
# 2 EMPIRICAL TOOLS
|
| 34 |
+
|
| 35 |
+
# 2.1 MODE CONNECTIVITY
|
| 36 |
+
|
| 37 |
+
Garipov et al. (2018) introduce a framework, called mode connectivity, to obtain a low loss (or high accuracy, in the case of classification) curve of simple form, such as a piecewise linear curve, that connects optima (modes of the loss function) found independently. This observation suggests that points at the same loss function depth are connected, somewhat contrary to several empirical results claiming that minima are isolated or have barriers between them1.
|
| 38 |
+
|
| 39 |
+
Let $w _ { a } \in \mathbb { R } ^ { D }$ and $w _ { b } \in \mathbb { R } ^ { D }$ be two modes in the $D$ -dimensional parameter space obtained by optimizing a given loss function $\mathcal { L } ( w )$ (like the cross-entropy loss). We represent a curve connecting $w _ { a }$ and $w _ { b }$ by $\phi _ { \theta } ( t ) : [ 0 , 1 ] \to \mathbb { R } ^ { D }$ , such that $\phi _ { \theta } ( 0 ) = w _ { a }$ and $\phi _ { \theta } ( 1 ) = w _ { b }$ . To find a low loss path, we find the set of parameters $\theta \in \mathbb { R } ^ { D }$ that minimizes the following loss: $\begin{array} { r } { \ell ( \theta ) = \int _ { 0 } ^ { 1 } \mathcal { L } ( \phi _ { \theta } ( t ) ) d t = } \end{array}$ $\mathbb { E } _ { t \sim U ( 0 , 1 ) } \mathcal { L } ( \phi _ { \theta } ( t ) )$ where $U ( 0 , 1 )$ is the uniform distribution in the interval $[ 0 , 1 ]$ . To optimize $\ell ( \theta )$ for $\theta$ , we first need to chose a parametric form for $\phi _ { \theta } ( t )$ . One of the forms proposed by Garipov et al. (2018) is a polygonal chain with a single bend at $\theta$ as follows
|
| 40 |
+
|
| 41 |
+

|
| 42 |
+
Figure 1: Validation accuracy corresponding to models on the following 6 different curves - curve $G A$ represents curve connecting mode $G$ (one found with default hyperparameters) and mode $A$ (using large batch size), similarly, curve $G B$ connects mode $G$ and mode $B$ (using Adam), curve $G C$ connects to mode $C$ (using linearly decaying learning rate), curve $G D$ to mode $D$ (with lesser L2 regularization), curve $G E$ to mode $E$ (using a poor initialization), and curve $G F$ to mode $F$ (without using data augmentation). $t = 0$ corresponds to mode $G$ for all plots.
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
\phi _ { \theta } ( t ) = { \left\{ \begin{array} { l l } { 2 ( t \theta + ( 0 . 5 - t ) w _ { a } ) , } & { \quad { \mathrm { i f ~ } } 0 \leq t \leq 0 . 5 } \\ { 2 ( ( t - 0 . 5 ) w _ { b } + ( 1 - t ) \theta ) } & { \quad { \mathrm { i f ~ } } 0 . 5 < t \leq 1 } \end{array} \right. }
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
To minimize $\ell ( \theta )$ , we sample $t \sim U [ 0 , 1 ]$ at each iteration and use $\nabla _ { \theta } \mathcal { L } ( \phi _ { \theta } ( t ) )$ as an unbiased estimate for the true gradient $\nabla _ { { \boldsymbol { \theta } } } \ell ( { \boldsymbol { \theta } } )$ to perform updates on $\theta$ , where $\theta$ is initialized with $\frac { 1 } { 2 } \left( w _ { a } + w _ { b } \right)$ .
|
| 49 |
+
|
| 50 |
+
# 2.1.1 RESILIENCE OF MODE CONNECTIVITY
|
| 51 |
+
|
| 52 |
+
To demonstrate that the curve-finding approach works in practice, Garipov et al. (2018) use two optima found using different initializations but a common training scheme which we detail below. We explore the limits of this procedure by connecting optima obtained from different training strategies. Our goal of this investigation is to first establish the robustness of the framework in order to seamlessly use it as a tool for analysis. In particular, we experiment with different initializations, optimizers, data augmentation choices, and hyperparameter settings including regularization, training batch sizes, and learning rate schemes. We note in passing that while the framework was proposed to connect two points in the parameter space that are at equal depth in the loss landscape, it is well-defined to also connect points at different depths; in this case, the path corresponds to one that minimizes the average loss along the curve.
|
| 53 |
+
|
| 54 |
+
Conventional wisdom suggests that the different training schemes mentioned above will converge to regions in the parameter space that are vastly different from each other. Examples of this include size of minibatches used during training (Keskar et al., 2016), choice of optimizer (Heusel et al., 2017; Wilson et al., 2017), initialization (Goodfellow et al., 2016) and choice of regularizer. Having a high accuracy connection between these pairs would seem counterintuitive.
|
| 55 |
+
|
| 56 |
+
For obtaining the reference model (named mode $G$ ), we train the VGG-16 model architecture (Simonyan & Zisserman, 2014) using CIFAR-10 training data (Krizhevsky et al., 2014) for 200 epochs with SGD. We then build 6 variants of the reference mode $G$ as follows: we obtain mode $A$ using a training batch size of 4000, mode $B$ by using the Adam optimizer instead of SGD, mode $C$ with a linearly decaying learning rate instead of the step decay used in mode $G$ , mode $D$ using a smaller weight decay of $5 \times \mathrm { 1 \overline { { 0 } } ^ { - 6 } }$ , mode $E$ by increasing the variance of the initialization distribution to $3 { \bar { \times } } { \sqrt { 2 / n } }$ and mode $F$ using no data augmentation. Note that for the set of modes $\{ A , B , C , D , E , { \dot { F } } \}$ , all the other hyper-parameters and settings except the ones mentioned above are kept same as that for mode $G$ . We use the mode connectivity algorithm on each of the 6 pairs of modes including $G$ and another mode, resulting in curves $G A , G B , G C , G D , G E$ , and $G F$ .
|
| 57 |
+
|
| 58 |
+
Figure 1 shows the validation accuracy for models on each of the 6 connecting curves during the 20th, 40th, 60th and 80th epochs of the mode connectivity training procedure and also for models on the line segment joining the two endpoints (corresponding to the initialization for $\theta$ at epoch
|
| 59 |
+
|
| 60 |
+
0). As described in Section 2.1, for a polychain curve $G X$ (connecting modes $G$ and $X$ using the curve described by $\theta$ ), model parameters $\phi _ { \theta } ( t )$ on the curve are given by $p _ { \phi _ { \theta } ( t ) } = 2 ( t p _ { \theta } + ( 0 . 5 -$ $t ) p _ { G } )$ if $0 \leq t \leq 0 . 5$ and $p _ { \phi _ { \theta } ( t ) } = 2 ( ( t - 0 . 5 ) p _ { X } + ( 1 - t ) p _ { \theta } )$ if $0 . 5 < t \leq 1$ where $p _ { G } , p _ { \theta }$ and $p _ { X }$ are parameters of the models $G , \theta .$ , and $X$ respectively. Thus $\phi _ { \theta } ( 0 ) = G$ and $\phi _ { \theta } ( 1 ) = X$ .
|
| 61 |
+
|
| 62 |
+
In a few epochs of the curve training, for all 6 pairs, we can find a curve such that each point on it generalizes almost as well as models from the pair that is being connected. Note that by virtue of existence of these 6 curves, there exists a high accuracy connecting curve (albeit with multiple bends) for each of the $\binom { 7 } { 2 }$ pairs of modes. We refer the reader to Appendix 7 for a t-SNE plot of the modes and their connections, and also for additional plots and details. Having established the high likelihood of the existence of these curves, we use this procedure along with interpolation of the loss surface between parameters at different epochs as tools to analyze the dynamics of SGD and SGDR.
|
| 63 |
+
|
| 64 |
+
# 2.2 CCA FOR MEASURING REPRESENTATIONAL SIMILARITY
|
| 65 |
+
|
| 66 |
+
Canonical correlation analysis (CCA) is a classical tool from multivariate statistics (Hotelling, 1936) that investigates the relationships between two sets of random variables. Raghu et al. (2017) have proposed coupling CCA with pre-processing steps like Singular Value Decomposition (SVD) or Discrete Fourier Transform (DFT) to design a similarity metric for two neural net layers that we want to compare. These layers do not have to be of the same size or belong to the same network.
|
| 67 |
+
|
| 68 |
+
Given a dataset with $m$ examples $X = \{ x _ { 1 } , \ldots x _ { m } \}$ , we denote the scalar output of the neuron $z _ { i } ^ { l }$ $i$ -th neuron of layer $l$ ) for the input $x _ { i }$ by $f _ { z _ { i } ^ { L } } ( x _ { i } )$ . These scalar outputs can be stacked (along $n$ different neurons and $m$ different datapoints) to create a matrix $\boldsymbol { L } \in \mathbb { R } ^ { m \times n }$ representing the output of a layer corresponding to the entire dataset. This choice of comparing neural network layers using activations instead of weights and biases is crucial to the setup proposed. Indeed, invariances due to re-parameterizations and permutations limit the interpretability of the model weights (Dinh et al., 2017). However, under CCA of the layers, two activation sets are comparable by design.
|
| 69 |
+
|
| 70 |
+
Given representations corresponding to two layers $L _ { a } \in \mathbb { R } ^ { m _ { a } \times n }$ and $L _ { b } \in \mathbb { R } ^ { m _ { b } \times n }$ , SVCCA first performs dimensionality reduction using SVD to obtain $L _ { a } ^ { ' } \ \in \ \mathbb { R } ^ { m _ { a } ^ { \prime } \times n }$ and $L _ { b } ^ { ' } \ \in \ \mathbb { R } ^ { m _ { b } ^ { \prime } \times n }$ while preserving $9 9 \%$ of the variance. The subsequent CCA step involves transforming $L _ { a } ^ { ' }$ and $L _ { b } ^ { ' }$ to $a _ { 1 } ^ { \top } L _ { a } ^ { ' }$ and $b _ { 1 } ^ { \top } L _ { b } ^ { ' }$ respectively where $\{ a _ { 1 } , b _ { 1 } \}$ is found by maximizing the correlation between the transformed subspaces, and the corresponding correlation is denoted by $\rho _ { 1 }$ . This process continues, using orthogonality constraints, till $c = \mathrm { m i n } \{ m _ { a } ^ { ' } , m _ { b } ^ { ' } \}$ leading to the set of correlation values $\{ \rho _ { 1 } , \rho _ { 2 } \ldots \rho _ { c } \}$ corresponding to $c$ pairs of canonical variables $\{ \{ a _ { 1 } , b _ { 1 } \} , \{ a _ { 2 } , b _ { 2 } \} , . . . \{ a _ { c } , b _ { c } \} \}$ respectively. We refer the reader to Raghu et al. (2017) for details on solving these optimization problems. The average of these $c$ correlations ${ \frac { 1 } { n } } \sum _ { i } \rho _ { i }$ is then considered as a measure of the similarity between the two layers. For convolutional layers, Raghu et al. (2017) suggest using a DFT pre-processing step before CCA, since they typically have a large number of neurons ${ \bf \zeta } _ { m _ { a } }$ or $m _ { b }$ ), where performing raw SVD and CCA would be computationally too expensive. This procedure can then be employed to compare different neural network representations and to determine how representations evolve over training iterations.
|
| 71 |
+
|
| 72 |
+
# 3 STOCHASTIC GRADIENT DESCENT WITH RESTARTS (SGDR)
|
| 73 |
+
|
| 74 |
+
Loshchilov & Hutter (2016) introduced SGDR as a modification to the common linear or step-wise decay of learning rates. The strategy decays learning rates along a cosine curve and then, at the end of the decay, restarts them to its initial value. The learning rate at the $t$ -th epoch in SGDR is given by the following expression in (1) where $\eta _ { m i n }$ and $\eta _ { m a x }$ are the lower and upper bounds respectively for the learning rate. $T _ { c u r }$ represents how many epochs have been performed since the last restart and a warm restart is simulated once $T _ { i }$ epochs are performed. Also $T _ { i } = T _ { m u l t } \times T _ { i - 1 }$ , meaning the period $T _ { i }$ for the learning rate variation is increased by a factor of $T _ { m u l t }$ after each restart.
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\eta _ { t } = \eta _ { m i n } + \frac { 1 } { 2 } \big ( \eta _ { m a x } - \eta _ { m i n } \big ) \left( 1 + \cos \left( \frac { T _ { c u r } } { T _ { i } } \pi \right) \right)
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
While the strategy has been claimed to outperform other learning rate schedulers, little is known why this has been the case. One explanation that has been given in support of SGDR is that it can be useful to deal with multi-modal functions, where the iterates could get stuck in a local optimum and a restart will help them get out of it and explore another region; however, Loshchilov & Hutter (2016) do not claim to observe any effect related to multi-modality. Huang et al. (2017) propose an ensembling strategy using the set of iterates before restarts and claim that, when using the learning rate annealing cycles, the optimization path converges to and escapes from several local minima. We empirically investigate if this is actually the case by interpolating the loss surface between parameters at different epochs and studying the training and validation loss for parameters on the hyperplane passing through2 the two modes found by SGDR and their connectivity. Further, by employing the CCA framework as described in Section 2.2, we investigate the progression of training, and the effect of restarts on the model activations.
|
| 81 |
+
|
| 82 |
+

|
| 83 |
+
Figure 2: (a) Validation accuracy of a VGG16 model trained on CIFAR-10 using SGDR with warm restarts simulated every $T _ { 0 } = 1 0$ epochs and $T _ { m u l t } = 2$ . (b) Cross-entropy training loss on the curve found through Mode Connectivity (MC Curve) and on the line segment (Line Seg.) joining modes $w _ { 3 0 }$ (model corresponding to parameters at the 30-th epoch of SGDR) and $w _ { 7 0 }$ , $w _ { 7 0 }$ and $w _ { 1 5 0 }$ , $w _ { 3 0 }$ and $w _ { 1 5 0 }$ . (c) Cross-entropy training loss on the curve found through Mode Connectivity (MC Curve) and on the line segment (Line Seg.) joining modes $w _ { 5 5 }$ (model corresponding to parameters at the 55-th epoch of SGD with step decay learning rate scheme) and $w _ { 6 5 }$ , $w _ { 1 4 5 }$ and $w _ { 1 5 5 }$ , $w _ { 5 5 }$ and $w _ { 1 5 5 }$ .
|
| 84 |
+
|
| 85 |
+
We train a VGG-16 network (Simonyan & Zisserman, 2014) on the CIFAR-10 dataset using SGDR. For our experiments, we choose $T _ { 0 } = 1 0$ epochs and $T _ { m u l t } = 2$ (warm restarts simulated every 10 epochs and the period $T _ { i }$ doubled at every new warm restart), $\eta _ { m a x } = 0 . 0 5$ and $\eta _ { m i n } = 1 0 ^ { - 6 }$ . We also perform VGG training using SGD (with momentum of 0.9) and a step decay learning rate scheme (initial learning rate of $\eta _ { 0 } = 0 . 0 5$ , scaled by 5 at epochs 60 and 150). Figure 2(a) shows the validation accuracy over training epochs with these two learning rate schemes.
|
| 86 |
+
|
| 87 |
+
In order to understand the loss landscape on the optimization path of SGDR, the pairs of iterates obtained just before the restarts $\{ w _ { 3 0 } , w _ { 7 0 } \} , \{ w _ { 7 0 } , w _ { 1 5 0 } \}$ and $\{ w _ { 3 0 } , w _ { 1 5 0 } \}$ are given as inputs to the mode connectivity algorithm, where $w _ { n }$ is the model corresponding to parameters at the $n$ -th epoch of training. Figure 2(b) shows the training loss for models along the line segment joining these pairs and those on the curve found through mode connectivity. For the baseline case of SGD training, we connect the iterates around the epochs when we decrease our learning rate in the step decay learning rate scheme. Thus, we chose $\{ w _ { 5 5 } , w _ { 6 5 } \}$ , $\{ w _ { 1 4 5 } , w _ { 1 6 5 } \}$ and $\{ w _ { 5 5 } , w _ { 1 6 5 } \}$ as input pairs to the mode connectivity algorithm. Figure 2(c) shows the training loss for models along the line segments joining these pairs and the curves found through mode connectivity.
|
| 88 |
+
|
| 89 |
+

|
| 90 |
+
Figure 3: (a) Training loss surface and (b) validation loss surface, log scales, for points on the plane defined by $\{ w _ { 7 0 } , w _ { 1 5 0 } , w _ { 7 0 - 1 5 0 } \}$ including projections of the SGDR iterates on this hyperplane. A curve of a given color represents a contour line, with the log-loss (lower being better) corresponding to this contour shown in the same color.
|
| 91 |
+
|
| 92 |
+
From Figure 2(b), it is clear that for the pairs $\{ w _ { 3 0 } , w _ { 1 5 0 } \}$ and $\{ w _ { 7 0 } , w _ { 1 5 0 } \}$ the training loss for points on segment is much higher than the endpoints suggesting that SGDR indeed finds paths that move over a barrier3 in the training loss landscape. In contrast, for SGD (without restarts) in Figure 2(c) none of the three pairs show evidence of having a training loss barrier on the line segment joining them. Instead there seems to be an almost linear decrease of training loss along the direction of these line segments, suggesting that SGD’s trajectory is quite different from SGDR’s. We present additional experiments, including results for other metrics, in Appendix 8.
|
| 93 |
+
|
| 94 |
+
To further understand the SGDR trajectory, we evaluate the intermediate points on the hyperplane in the $D$ -dimensional space defined by the three points: $w _ { 7 0 }$ , $w _ { 1 5 0 }$ and $w _ { 7 0 - 1 5 0 }$ , where $w _ { 7 0 - 1 5 0 }$ is the bend point that defines the high accuracy connection for the pair $\{ w _ { 7 0 } , w _ { 1 5 0 } \}$ . Figures 3(a) and 3(b) show the training and validation loss surface for points in this subspace, respectively. Note that the intermediate iterates do not necessarily lie in this plane, and thus are projected. We refer the reader to Appendix 8 for additional details on the projection, and analogous results with $w _ { 3 0 }$ and $w _ { 7 0 }$ . Results for the VGG-16 architecture with batch-normalization are also presented in Appendix 8.4.
|
| 95 |
+
|
| 96 |
+
Figure 3(a) suggests that SGDR helps the iterates converge to a different region although neither of $w _ { 7 0 }$ or $w _ { 1 5 0 }$ are technically a local minimum, nor do they appear to be lying in different basins, hinting that Huang et al. (2017)’s claims about SGDR converging to and escaping from local minima might be an oversimplification.4 Another insight we can draw from Figure 3(a) is that the path found by mode connectivity corresponds to lower training loss than the loss at the iterates that SGDR converges to $( \mathcal { L } ( w _ { 1 5 0 } ) > \mathcal { L } ( w _ { 7 0 - 1 5 0 } ) )$ . However, Figure 3(b) shows that models on this curve seem to overfit and not generalize as well as the iterates $w _ { 7 0 }$ and $w _ { 1 5 0 }$ . Thus, although gathering models from this connecting curve might seem as a novel and computationally cheap way of creating ensembles, this generalization gap alludes to one limitation in doing so; Garipov et al. (2018) point to other shortcomings of curve ensembling in their original work. In Figure 3, the region of the plane between the iterates $w _ { 7 0 }$ and $w _ { 1 5 0 }$ corresponds to higher training loss but lower validation loss than the two iterates. This hints at a reason why averaging iterates to improve generalization using cyclic or constant learning rates (Izmailov et al., 2018) has been found to work well.
|
| 97 |
+
|
| 98 |
+
Finally, in Figure 14 in Appendix 9, we present the CCA similarity plots for two pairs of models: epochs 10 and 150 (model at the beginning and end of training), and epochs 150 and 155 (model just before and just after a restart). For standard SGD training, Raghu et al. (2017) observe that the activations of the shallower layers bear closer resemblance than the deeper layers between a partially and fully trained network from a given training run. For SGDR training, we witness similar results (discussed in Appendix 9), meaning that the representational similarities between the network layers at the beginning and end of training are alike for SGDR and SGD, even though restarts lead to a trajectory that tends to cross over barriers.
|
| 99 |
+
|
| 100 |
+
# 4 WARMUP LEARNING RATE SCHEME
|
| 101 |
+
|
| 102 |
+
Learning rate warmup is a common heuristic used by many practitioners for training deep neural nets for computer vision (Goyal et al., 2017) and natural language processing (Bogoychev et al., 2018; Vaswani et al., 2017) tasks. Theoretically, it can be shown that the learning dynamics of SGD rely on the ratio of the batch size and learning rate (Smith et al., 2017; Jastrzebski et al., 2017; Hoffer et al., 2017). And hence, an increase in batch size over a baseline requires an accompanying increase in learning rate for comparable training. However, in cases when the batch size is increased significantly, the curvature of the loss function typically does not support a proportional increase in the learning rate. Warmup is hence motivated as a means to use large learning rates without causing training instability. We particularly focus on the importance of the learning rate schedule’s warmup phase in the large batch (LB) training of deep convolutional neural networks as discussed in Goyal et al. (2017). Their work adopts a linear scaling rule for adjusting the learning rate as a function of the minibatch size, to enable large-batch training. The question we aim to investigate here is: How does learning rate warmup impact different layers of the network?
|
| 103 |
+
|
| 104 |
+

|
| 105 |
+
Figure 4: (a) Validation accuracy and (b) Learning rate for the three training setups (c) CCA similarity for $i$ -th layer from two different iterations (0-th (before warmup) and 200-th (after warmup) during training (d) Comparing warmup and FC freezing strategies on VGG11 training
|
| 106 |
+
|
| 107 |
+

|
| 108 |
+
Figure 5: CCA similarity output plots for (a) SB no warmup, (b) LB no warmup, (c, d) $\mathrm { ~ L B ~ } +$ warmup training. The $i , j$ -th cell represents the CCA similarity between layer $i$ of the first model, and layer $j$ of other. A higher score implies that the layers are more similar (lighter color).
|
| 109 |
+
|
| 110 |
+
Using CCA as a tool to study the learning dynamics of neural networks through training iterations, we investigate the differences and similarities for the following 3 training configurations - (a) large batch training with warmup $\mathrm { L B } +$ warmup), (b) large batch training without warmup (LB no warmup) and (c) small batch training without warmup (SB no warmup). We train a VGG-11 architecture on the CIFAR-10 (Krizhevsky et al., 2014) dataset using SGD with momentum of 0.9. Learning rate for the small batch case (batch-size of 100) is set to 0.05, and for the large batch cases (batch-size of 5000) is set to 2.5 as per the scaling rule. For the warmup, we increase the learning rate from 0 to 2.5 over the first 200 iterations. Subsequently, we decrease the learning rate as per the step decay schedule for all runs, scaling it down by a factor of 10 at epochs 60, 120 and 150. We plot the learning rate and validation accuracy for these 3 cases in Figure 4(b) and (a).
|
| 111 |
+
|
| 112 |
+
Using CCA and denoting the model at the $j$ -th iteration of a training setup by $i t e r _ { j }$ , we compare activation layers from $i t e r _ { 0 }$ (init.) and $i t e r _ { 2 0 0 }$ (end of warmup) for each of the three runs, presented in Figures 5(a), (b) and (c), and also layers from iter200 (end of warmup) and iter2990 (end of training) for the $\mathrm { L B } +$ warmup case, presented in Figure 5(d). Figure 4(c) plots the similarity for layer $i$ of $i t e r _ { a }$ with the same layer of $i t e r _ { b }$ (this corresponds to diagonal elements of the matrices in Figure 5) for these three setups.
|
| 113 |
+
|
| 114 |
+
An evident pattern in Figures 5(a), (b) and (c) is the increase in similarity for the last few layers (stack of fully-connected layers) for the LB $^ +$ warmup and SB cases, which is absent in the LB without warmup case. This suggests that when used with the large batch size and learning rate, warmup tends to avoid unstably large changes in the fully-connected (FC) stack for this network configuration. To validate this proposition, we train using the LB without warmup setup, but freezing the fully-connected stack for the first 20 epochs5 (LB no warmup $+ \operatorname { F C }$ freeze). Figure 4(d) shows the validation accuracy for this training run in comparison to the three training setups discussed before. The performance is comparable at the end of warmup by freezing the FC stack, suggesting the validity our proposition in this case. We refer the reader to Appendix 10 for analogous results for ResNet-18 and ResNet-32 (He et al., 2016); thus also demonstrating the generality of our claim. Finally, note from Figure 4(d) that no qualitative difference exists in the trajectory beyond the warmup when compared to the standard training approach (Raghu et al., 2017).
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
Figure 6: CCA similarity between $S _ { \mathrm { d i s t i l l e d } } - T$ , $S _ { \mathrm { i n d e p . } } \cdot T$ , and their difference. $i , j$ -th cell of the differencnetwork l, represents denotes th $| \mathbf { C C A } ( l _ { T } ^ { i } , l _ { S _ { \mathrm { d i s t i l l e d } } } ^ { j } ) - \mathbf { C C A } ( l _ { T } ^ { i } , l _ { S _ { \mathrm { i n d e p . } } } ^ { j } ) |$ where is the s $l _ { M } ^ { i }$ denotes the ent network $i$ -th layer ofained using $M$ $T$ $S _ { \mathrm { d i s t i l l e d } }$ distillation and $S _ { \mathrm { i n d e p . } }$ . is the student network trained using hard training labels.
|
| 118 |
+
|
| 119 |
+
# 5 KNOWLEDGE DISTILLATION
|
| 120 |
+
|
| 121 |
+
We study knowledge distillation as proposed by Hinton et al. (2015) using CCA to measure representational similarity between layers of the teacher and student model. Distillation involves training a “student” model using the output probability distribution of a “teacher” model. This has been widely known to help the student model perform better than it would, if it were trained using hard labels due to knowledge transfer from the teacher model. The reason often quoted for the success of distillation is the transfer of dark knowledge from the teacher to the student (Hinton et al., 2015), and more recently, as an interpretation of importance weighing (Furlanello et al., 2018). We investigate if this knowledge transfer is limited to certain parts of the network, and if representational similarity between layers of the student and teacher model and a student can help answer this question.
|
| 122 |
+
|
| 123 |
+
To construct an example of distillation that can be used for our analysis, we use a VGG-16 model (Simonyan & Zisserman, 2014) as our teacher network and a shallow convolutional network ([conv, maxpool, relu] $_ { \textrm { x 2 } }$ , fc, relu, fc, fc, softmax) as the student network. We train the shallow network for CIFAR-10 using the teacher’s predicted probability distribution (softened using a temperature of 5), $( S _ { \mathrm { d i s t i l l e d } } )$ , and for the baseline, train another instance of the same model in a standard way using hard labels, $( S _ { \mathrm { i n d e p . } } )$ . Over 5 runs for each of the two setups, we find the distillation training attains the best validation accuracy at $8 5 . 1 8 \%$ while standard training attains its best at $8 3 . 0 1 \%$ . We compare their layer-wise representations with those of the teacher network $( T )$ .
|
| 124 |
+
|
| 125 |
+
Figure 6 shows the CCA plots and the absolute value of their difference. The scores of these two pairs are quite similar for the shallow layers of the student network relative to the deeper layers, suggesting that the difference that knowledge distillation brings to the training of smaller networks is restricted to the deeper layers (fc stack). Similar results are obtained through different configurations for the student and teacher when the student benefits from the teacher’s knowledge. We hypothesize that the dark knowledge transferred by the teacher is localized majorly in the deeper (discriminative) layers, and less so in the feature extraction layers. We also note that this is not dissimilar to the hypothesis of Furlanello et al. (2018), and also relates ot the results from the literature on fine-tuning or transfer learning (Goodfellow et al., 2016; Yosinski et al., 2014; Howard & Ruder, 2018) which suggest training of only higher layers.
|
| 126 |
+
|
| 127 |
+
# 6 DISCUSSION AND CONCLUSION
|
| 128 |
+
|
| 129 |
+
Heuristics have played an important role in accelerating progress of deep learning. Founded in empirical experience, intuition and observations, many of these strategies are now commonplace in architectures. In the absence of strong theoretical guarantees, controlled experiments aimed at explaining the the efficacy of these strategies can aid our understanding of deep learning and the training dynamics. The primary goal of our work was the investigation of three such heuristics using sophisticated tools for landscape analysis. Specifically, we investigate cosine annealing, learning rate warmup, and knowledge distillation. For this purpose, we employ recently proposed tools of mode connectivity and CCA. Our empirical analysis sheds light on these heuristics and suggests that: (a) the reasons often quoted for the success of cosine annealing are not evidenced in practice; (b) that the effect of learning rate warmup is to prevent the deeper layers from creating training instability; and (c) that the latent knowledge shared by the teacher is primarily disbursed in the deeper layers.
|
| 130 |
+
|
| 131 |
+
Inadvertently, our investigation also leads to the design of new heuristics for practically improving the training process. Through our results on SGDR, we provide additional evidence for the success of averaging schemes in this context. Given the empirical results suggesting the localization of the knowledge transfer between teacher and student in the process of distillation, a heuristic can be designed that only trains portions of the (pre-trained) student networks instead of the whole network. For instance, recent results on self-distillation (Furlanello et al., 2018) show improved performance via multiple generations of knowledge distillation for the same model. Given our results, computational costs of subsequent generations can be reduced if only subsets of the model are trained, instead of training the entire model. Finally, the freezing of weights instead of employing learning rate warmup allows for comparable training performance but with reduced computation during the warmup phase. We note in passing that our result also ties in with results of Hoffer et al. (2018) who suggest not training the classifier at all with negligible loss in performance. Our empirical experiments and hypotheses open new questions and encourage a deeper exploration into improving and better understanding these heuristics.
|
| 132 |
+
|
| 133 |
+
# REFERENCES
|
| 134 |
+
|
| 135 |
+
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
|
| 136 |
+
David Balduzzi, Marcus Frean, Lennox Leary, JP Lewis, Kurt Wan-Duo Ma, and Brian McWilliams. The shattered gradients problem: If resnets are the answer, then what is the question? arXiv preprint arXiv:1702.08591, 2017.
|
| 137 |
+
Nikolay Bogoychev, Marcin Junczys-Dowmunt, Kenneth Heafield, and Alham Fikri Aji. Accelerating asynchronous stochastic gradient descent for neural machine translation. arXiv preprint arXiv:1808.08859, 2018.
|
| 138 |
+
Cody Coleman, Daniel Kang, Deepak Narayanan, Luigi Nardi, Tian Zhao, Jian Zhang, Peter Bailis, Kunle Olukotun, Chris Re, and Matei Zaharia. Analysis of dawnbench, a time-to-accuracy machine learning performance benchmark. arXiv preprint arXiv:1806.01427, 2018.
|
| 139 |
+
Laurent Dinh, Razvan Pascanu, Samy Bengio, and Yoshua Bengio. Sharp minima can generalize for deep nets. arXiv preprint arXiv:1703.04933, 2017.
|
| 140 |
+
Felix Draxler, Kambis Veschgini, Manfred Salmhofer, and Fred A Hamprecht. Essentially no barriers in neural network energy landscape. arXiv preprint arXiv:1803.00885, 2018.
|
| 141 |
+
Tommaso Furlanello, Zachary C Lipton, Michael Tschannen, Laurent Itti, and Anima Anandkumar. Born again neural networks. arXiv preprint arXiv:1805.04770, 2018.
|
| 142 |
+
Timur Garipov, Pavel Izmailov, Dmitrii Podoprikhin, Dmitry P Vetrov, and Andrew Gordon Wilson. Loss surfaces, mode connectivity, and fast ensembling of dnns. arXiv preprint arXiv:1802.10026, 2018.
|
| 143 |
+
Ian Goodfellow, Yoshua Bengio, Aaron Courville, and Yoshua Bengio. Deep learning, volume 1. MIT Press, 2016.
|
| 144 |
+
Priya Goyal, Piotr Dollar, Ross Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, An- ´ drew Tulloch, Yangqing Jia, and Kaiming He. Accurate, large minibatch sgd: training imagenet in 1 hour. arXiv preprint arXiv:1706.02677, 2017.
|
| 145 |
+
|
| 146 |
+
Moritz Hardt and Tengyu Ma. Identity matters in deep learning. arXiv preprint arXiv:1611.04231, 2016.
|
| 147 |
+
|
| 148 |
+
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.
|
| 149 |
+
|
| 150 |
+
Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, Gunter Klambauer, and ¨ Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a nash equilibrium. arXiv preprint arXiv:1706.08500, 2017.
|
| 151 |
+
|
| 152 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
|
| 153 |
+
|
| 154 |
+
Elad Hoffer, Itay Hubara, and Daniel Soudry. Train longer, generalize better: closing the generalization gap in large batch training of neural networks. In Advances in Neural Information Processing Systems, pp. 1731–1741, 2017.
|
| 155 |
+
|
| 156 |
+
Elad Hoffer, Itay Hubara, and Daniel Soudry. Fix your classifier: the marginal value of training the last weight layer. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ S1Dh8Tg0-.
|
| 157 |
+
|
| 158 |
+
Harold Hotelling. Relations between two sets of variates. Biometrika, 28(3/4):321–377, 1936.
|
| 159 |
+
|
| 160 |
+
Jeremy Howard and Sebastian Ruder. Universal language model fine-tuning for text classification. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), volume 1, pp. 328–339, 2018.
|
| 161 |
+
|
| 162 |
+
Gao Huang, Yixuan Li, Geoff Pleiss, Zhuang Liu, John E Hopcroft, and Kilian Q Weinberger. Snapshot ensembles: Train 1, get m for free. arXiv preprint arXiv:1704.00109, 2017.
|
| 163 |
+
|
| 164 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
|
| 165 |
+
|
| 166 |
+
Pavel Izmailov, Dmitrii Podoprikhin, Timur Garipov, Dmitry Vetrov, and Andrew Gordon Wilson. Averaging weights leads to wider optima and better generalization. arXiv preprint arXiv:1803.05407, 2018.
|
| 167 |
+
|
| 168 |
+
Stanisław Jastrzebski, Zachary Kenton, Devansh Arpit, Nicolas Ballas, Asja Fischer, Yoshua Bengio, and Amos Storkey. Three factors influencing minima in sgd. arXiv preprint arXiv:1711.04623, 2017.
|
| 169 |
+
|
| 170 |
+
Nitish Shirish Keskar, Dheevatsa Mudigere, Jorge Nocedal, Mikhail Smelyanskiy, and Ping Tak Peter Tang. On large-batch training for deep learning: Generalization gap and sharp minima. arXiv preprint arXiv:1609.04836, 2016.
|
| 171 |
+
|
| 172 |
+
Alex Krizhevsky, Vinod Nair, and Geoffrey Hinton. The cifar-10 dataset. online: http://www. cs. toronto. edu/kriz/cifar. html, 2014.
|
| 173 |
+
|
| 174 |
+
Hao Li, Zheng Xu, Gavin Taylor, and Tom Goldstein. Visualizing the loss landscape of neural nets. arXiv preprint arXiv:1712.09913, 2017.
|
| 175 |
+
|
| 176 |
+
Yixuan Li, Jason Yosinski, Jeff Clune, Hod Lipson, and John E Hopcroft. Convergent learning: Do different neural networks learn the same representations? In FE@ NIPS, pp. 196–212, 2015.
|
| 177 |
+
|
| 178 |
+
Ilya Loshchilov and Frank Hutter. Sgdr: stochastic gradient descent with restarts. arXiv preprint arXiv:1608.03983, 2016.
|
| 179 |
+
|
| 180 |
+
Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(Nov):2579–2605, 2008.
|
| 181 |
+
|
| 182 |
+
Tomaso Poggio and Qianli Liao. Theory ii: Landscape of the empirical risk in deep learning. PhD thesis, Center for Brains, Minds and Machines (CBMM), arXiv, 2017.
|
| 183 |
+
|
| 184 |
+
Maithra Raghu, Justin Gilmer, Jason Yosinski, and Jascha Sohl-Dickstein. Svcca: Singular vector canonical correlation analysis for deep learning dynamics and interpretability. In Advances in Neural Information Processing Systems, pp. 6076–6085, 2017.
|
| 185 |
+
|
| 186 |
+
Levent Sagun, Utku Evci, V Ugur Guney, Yann Dauphin, and Leon Bottou. Empirical analysis of the hessian of over-parametrized neural networks. arXiv preprint arXiv:1706.04454, 2017.
|
| 187 |
+
|
| 188 |
+
Shibani Santurkar, Dimitris Tsipras, Andrew Ilyas, and Aleksander Madry. How does batch normalization help optimization?(no, it is not about internal covariate shift). arXiv preprint arXiv:1805.11604, 2018.
|
| 189 |
+
|
| 190 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 191 |
+
|
| 192 |
+
Leslie N Smith. Cyclical learning rates for training neural networks. In Applications of Computer Vision (WACV), 2017 IEEE Winter Conference on, pp. 464–472. IEEE, 2017.
|
| 193 |
+
|
| 194 |
+
Samuel L Smith, Pieter-Jan Kindermans, and Quoc V Le. Don’t decay the learning rate, increase the batch size. arXiv preprint arXiv:1711.00489, 2017.
|
| 195 |
+
|
| 196 |
+
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.
|
| 197 |
+
|
| 198 |
+
Ashia C Wilson, Rebecca Roelofs, Mitchell Stern, Nati Srebro, and Benjamin Recht. The marginal value of adaptive gradient methods in machine learning. In Advances in Neural Information Processing Systems, pp. 4151–4161, 2017.
|
| 199 |
+
|
| 200 |
+
Jason Yosinski, Jeff Clune, Yoshua Bengio, and Hod Lipson. How transferable are features in deep neural networks? In Advances in neural information processing systems, pp. 3320–3328, 2014.
|
| 201 |
+
|
| 202 |
+

|
| 203 |
+
Figure 7: Validation loss corresponding to models on the 6 different curves
|
| 204 |
+
|
| 205 |
+

|
| 206 |
+
Figure 8: Training accuracy corresponding to models on the 6 different curves
|
| 207 |
+
|
| 208 |
+
# APPENDIX
|
| 209 |
+
|
| 210 |
+
# 7 ADDITIONAL RESULTS ON ROBUSTNESS OF MC
|
| 211 |
+
|
| 212 |
+
# 7.1 TRAINING DETAILS
|
| 213 |
+
|
| 214 |
+
The learning rate is initialized to 0.05 and scaled down by a factor of 5 at epochs $\{ 6 0 , 1 2 0 , 1 6 0 \}$ (step decay). We use a training batch size of 100, momentum of 0.9, and a weight decay of 0.0005. Elements of the weight vector corresponding to a neuron are initialized randomly from the normal distribution ${ \mathcal { N } } ( 0 , { \sqrt { 2 / n } } )$ where $n$ is the number of inputs to the neuron. We also use data augmentation by random cropping of input images.
|
| 215 |
+
|
| 216 |
+
# 7.2 PLOTS
|
| 217 |
+
|
| 218 |
+
Figures 7, 8 and 9 show the Validation Loss, Training Accuracy and Training Loss respectively for the curves joining the 6 pairs discussed in Section 2.1.1. These results too, confirm the overfitting or poor generalization tendency of models on the curve.
|
| 219 |
+
|
| 220 |
+
# 7.3 T-SNE VISUALIZATION FOR THE 7 MODES
|
| 221 |
+
|
| 222 |
+
We use t-SNE (Maaten & Hinton, 2008) to visualize these 7 modes and the $\theta$ points that define the connectivity for the 6 pairs presented in Section 2.1.1, in a 2-dimensional plot in Figure 10. Since tSNE is known to map only local information correctly and not preserve global distances, we caution the reader about the limited interpretability of this visualization, it is presented simply to establish the notion of connected modes.
|
| 223 |
+
|
| 224 |
+

|
| 225 |
+
Figure 9: Training loss corresponding to models on the 6 different curves.
|
| 226 |
+
|
| 227 |
+

|
| 228 |
+
Figure 10: Representing the modes and their connecting point using t-SNE
|
| 229 |
+
|
| 230 |
+
# 8 ADDITIONAL SGDR RESULTS
|
| 231 |
+
|
| 232 |
+
8.1 ADDITIONAL RESULTS
|
| 233 |
+
|
| 234 |
+
For completeness, in Figure 11, we present the Validation loss, Validation accuracy and Training accuracy results for the curves and line segments joining iterates from SGDR and SGDR discussed in Figure 2(c) and (d).
|
| 235 |
+
|
| 236 |
+
# 8.2 PROJECTING ITERATES
|
| 237 |
+
|
| 238 |
+
The $W _ { n }$ in Figure 3 is equivalent to
|
| 239 |
+
|
| 240 |
+
$$
|
| 241 |
+
W _ { n } = P _ { c } ( w _ { n } ) = { \lambda ^ { \star } } ^ { \top } \left[ \begin{array} { c } { w _ { 7 0 } } \\ { w _ { 1 5 0 } } \\ { \theta } \end{array} \right]
|
| 242 |
+
$$
|
| 243 |
+
|
| 244 |
+
$$
|
| 245 |
+
\begin{array} { r } { \mathrm { w h e r e \ } \lambda ^ { \star } = \operatorname * { a r g m i n } _ { \lambda \in \mathbb { R } ^ { 3 } } \| \lambda ^ { \top } \left[ { \boldsymbol w } _ { 1 5 0 } ^ { w _ { 7 0 } } \right] - w _ { n } \| _ { 2 } ^ { 2 } } \end{array}
|
| 246 |
+
$$
|
| 247 |
+
|
| 248 |
+
meaning it is the point on the plane (linear combination of $w _ { 7 0 } , w _ { 1 5 0 }$ and $\theta$ ) with the least l-2 distance from the original point (iterate in this case).
|
| 249 |
+
|
| 250 |
+
# 8.3 CONNECTING MODES $w _ { 3 0 }$ AND $w _ { 7 0 }$ FROM SGDR
|
| 251 |
+
|
| 252 |
+
In Section 3, we present some experiments and make observations on the trajectory of SGDR by using the plane defined by the points $w _ { 7 0 }$ , $w _ { 1 5 0 }$ and $w _ { 7 0 - 1 5 0 }$ . Here we plot the Training loss and Validation loss surface in Figure 12 for another plane defined by SGDR’s iterates $w _ { 3 0 } , w _ { 7 0 }$ and their connection $w _ { 3 0 - 7 0 }$ to ensure the reader that the observations made are general enough.
|
| 253 |
+
|
| 254 |
+
# 8.4 RESULTS FOR VGG-16 WITH BATCH NORMALIZATION
|
| 255 |
+
|
| 256 |
+
The VGG-16 architecture used in Section 3 does not include Batch Normalization, which has been known to alter properties of the loss surface (Santurkar et al. (2018)). Therefore we train VGG16 with Batch Normalization using SGDR to verify if our observations hold for this case too. As pointed out in Appendix A.2 of Garipov et al. (2018), at the test stage, we compute the Batch Normalization statistics for a network on the curve with an additional pass over the data, since these are not collected during training. Except Batch Normalization, other training parameters are kept the same as discussed for Section 3.
|
| 257 |
+
|
| 258 |
+
Figure 13(a) shows the training loss for models along the line segment and MC curve joining the pair of iterates from SGDR. For the two pairs $\{ w _ { 3 0 } , w _ { 1 5 0 } \}$ and $\{ w _ { 7 0 } , w _ { 1 5 0 } \}$ , we again observe a higher training loss for models on the line segment, suggesting that for this setup too, SGDR finds paths that move over a barrier in the training loss landscape. We further evaluate the intermediate points on the hyperplane defined by $\{ w _ { 7 0 } , w _ { 1 5 0 } , w _ { 7 0 - 1 5 0 } \}$ and plot their training and validation loss in Figure 13(b) and (c) respectively. Our previous observations regarding (a) the iterates $w _ { 7 0 }$ and $w _ { 1 5 0 }$ not lying in different basins, (b) the MC-found $\theta$ or $w _ { 7 0 - 1 5 0 }$ generalizing poorly and (c) averaging of iterates improving generalization hold true here as well.
|
| 259 |
+
|
| 260 |
+

|
| 261 |
+
Figure 11: Left Column: Connecting iterates from SGD with step-decay learning rate scheme Right Column: Connecting iterates from SGDR Top Row: Training Accuracy on the curve found through Mode Connectivity (MC Curve) and on the line segment (Line Seg.) joining iterates from SGDR and SGD. Middle row: Validation Accuracy on the curve found through Mode Connectivity (MC Curve) and on the line segment (Line Seg.) joining iterates from SGDR and SGD. Bottom row Validation Loss on the curve found through Mode Connectivity (MC Curve) and on the line segment (Line Seg.) joining iterates from SGDR and SGD.
|
| 262 |
+
|
| 263 |
+

|
| 264 |
+
Figure 12: Training Loss (left) and Validation Loss (right) surface (log scale) for points on the plane defined by $\{ w _ { 3 0 } , w _ { 7 0 } , w _ { 3 0 - 7 0 } \}$ including projections of iterates on this plane
|
| 265 |
+
|
| 266 |
+

|
| 267 |
+
Figure 13: (a) Training loss for points on line segment and MC curve joining the pairs $w _ { 3 0 } - w _ { 7 0 }$ , $w _ { 3 0 } - w _ { 1 5 0 }$ and $w _ { 7 0 } - w _ { 1 5 0 }$ (b) Training loss surface (log scale) for points on the plane defined by $\{ w _ { 7 0 } , w _ { 1 5 0 } , w _ { 7 0 - 1 5 0 } \}$ including projections of iterates on this plane, (c) Validation Loss Surface (log scale) for points on the plane defined by $\{ w _ { 7 0 } , w _ { 1 5 0 } , w _ { 7 0 - 1 5 0 } \}$ including projections of iterates on this plane
|
| 268 |
+
|
| 269 |
+
# 9 SGDR CCA HEATMAPS
|
| 270 |
+
|
| 271 |
+
In Figure 14, we present the CCA similarity plots comparing two pairs of models: epochs 10 and 150, and epochs 150 and 155. The $( i , j ) ^ { t h }$ block of the matrix denotes the correlation between the $i ^ { t h }$ layer of the first model and the $j ^ { t h }$ layer of the other. A high correlation implies that the layers learn similar representations and vice versa. We present the former to compare against the typical stepwise or linear decay of SGD, and the latter to demonstrate the immediate effect of restarting on the model. Raghu et al. (2017) showed in their work that for typical SGD training, a CCA similarity plot between a partially and completed trained network reveals that the activations of the shallower layers bears closer resemblance in the two models than the deeper layers. We note that, despite the restart, a similar tendency is seen in SGDR training as well. This again suggests that the restart does not greatly impact the model, both in weights and representations, and especially so in the shallower layers. A comparison of epochs 150 and 155, i.e., before and after a restart also stands as evidence for this hypothesis.
|
| 272 |
+
|
| 273 |
+
# 10 WARMUP EXPERIMENTS ON RESNET-18 AND RESNET-32
|
| 274 |
+
|
| 275 |
+
In Figure 4(d), we show that the stability induced by warmup when training with large batches and learning rates can also be obtained by holding the FC stack frozen. This experiment was conducted on the VGG-11 network (Simonyan & Zisserman, 2014). To demonstrate the generality of our claim, we present additional experiments on two ResNet architectures: 18 and 32. The setup for this experiment is identical to the VGG-11 one with one change: instead of the learning rate being set to 2.5, which is the learning rate for SB (0.05) times the batch size increase $( 5 0 \times )$ , we set it to 5.0 since SB training is better with 0.1. For the warmup case, we linearly increase the learning rate from 0 to 5 again for 20 epochs. Experiments on other configurations yielded similar results. Whether these results remain true also for training larger datasets, such as ImageNet, remains to be shown and is a topic of future research.
|
| 276 |
+
|
| 277 |
+

|
| 278 |
+
Figure 14: CCA similarity scores between two pairs of models. (a) comparings models at epochs 150 and 155, (b) comparing models at epochs 10 and 150. The $i , j$ -th cell in each pane represents the CCA similarity between layer $i$ of $w _ { a }$ (model at epoch a) and layer $j$ of model $w _ { b }$ (model at epoch b).
|
| 279 |
+
|
| 280 |
+

|
| 281 |
+
Figure 15: Experiment comparing warmup and FC freezing strategies on ResNet architectures.
|
md/train/r1YqWz-R-/r1YqWz-R-.md
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# IMPROVING CONDITIONAL SEQUENCE GENERATIVE ADVERSARIAL NETWORKS BY STEPWISE EVALUATION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Conditional sequence generation is a widely researched topic. One of the most important tasks is dialogue generation, which is composed of input-output pairs with the one-to-many property. Given the recent success of generative adversarial networks (GANs), GANs have been used for sequence generation. However, there is still limited work of its application on conditional sequence generation. We investigate the influence of GAN on conditional sequence generation with three artificial grammars and dialogue generation. Moreover, we propose stepwise GAN (StepGAN) for conditional sequence generation, which predicts the reward at each time-step. StepGAN can be seen as the general version of SeqGAN. It estimates the expected returns predicted by Monte-Carlo Search in SeqGAN, but it has a lower computational cost than Monte-Carlo Search. Experimental results show that stepwise GAN can outperform other state-of-the-art algorithms in most tasks.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Conditional sequence generation is the task of generating the correspondent response given an input sequence. One of the most important applications is dialogue generation. Dialogue generation is one-to-many; that is, there can be many acceptable responses for a specific input. In previous work, the sequence-to-sequence based dialogue generation model is trained using maximum likelihood estimation, and achieves promising results in terms of both meaning and coherence (Vinyals & Le, 2015). Despite this success, the generated responses given the inputs are still sometimes broken and are often general (for example, I don’t know). Reinforcement learning was therefore proposed to preserve sequence-level quality as opposed to predicting each word given the sequence history (Ranzato et al., 2015; Kandasamy et al., 2017; Bahdanau et al., 2016).
|
| 12 |
+
|
| 13 |
+
More recently, generative adversarial networks have been applied to sequence generation, especially for natural language. The discrete nature of random variables for natural language precludes the use of back-propagation. To solve this problem, several approaches have been proposed, such as policy gradient (Yu et al., 2017; Li et al., 2017), Gumbel-Softmax (Kusner & Hernandez-Lobato, 2016), ´ MaliGAN (Che et al., 2017), and directly connected WGAN-GP (Gulrajani et al., 2017; Rajeswar et al., 2017; Press et al., 2017). In most previous work, multiple assistant methods are used to stabilize training and often introduce improvements, for example, Monte-Carlo search (Yu et al., 2017; Li et al., 2017; Che et al., 2017) and curriculum learning (Rajeswar et al., 2017; Press et al., 2017). Furthermore, modifications of the GAN objective function have been proposed to improve quality in text generation (Zhang et al., 2017; Lin et al., 2017).
|
| 14 |
+
|
| 15 |
+
SeqGAN has been successfully applied on dialogue generation (Li et al., 2017). Due to the high variance of SeqGAN with 1-sample estimate REINFORCE algorithm, researchers use Marte-Carlo search for variation reduction. This method costs extremely high computational resources, therefore Reward for Every Generation Step (REGS) is proposed to replace Monte-Carlo search (Li et al., 2017). Nonetheless, REGS results in a less accurate discriminator because it takes non-terminal sequences into consideration.
|
| 16 |
+
|
| 17 |
+
To address the weaknesses of Monte-Carlo Search and REGS, we propose stepwise GAN (StepGAN). In this approach, the discriminator evaluates the generated sequences at every generation step, and gives a score for every step. A final score for the whole sequence is the summation of the scores for every time step. This training scheme makes StepGAN a general version of SeqGAN, and can simulate the process of Monte-Carlo search with low extra computational cost. In the proposed approach, both generator and discriminator include weighted factors that change the relative importance of each time step. We find step-time-decreasing weight factors can facilitate the training. This is because the set of hyper-parameters simulate curriculum learning by focusing on generating the head of a sequence. After the first subsequence is fit, further improvement are found in later subsequences.
|
| 18 |
+
|
| 19 |
+
We construct artificial grammars to assist our realization of GANs in conditional sequence generation. In these tasks, we calculate the accuracy and the coverage of the generated conditioned sequence to evaluate the quality of the model. The coverage is the percentage of the conditioned sequences sampled from the model distribution over all the probable responses. While accuracy reflects coherence and meaningfulness, coverage measures the diversity of the responses. We further compare the proposed approach with several conditional sequence generation approaches on dialogue generation, and evaluate the results by humans. The proposed models are comparable with or even outperform state-of-the-art algorithms.
|
| 20 |
+
|
| 21 |
+
# 2 RELATED WORK
|
| 22 |
+
|
| 23 |
+
Conditional sequence generation using the seq2seq model (Sutskever et al., 2014; Vinyals & Le, 2015) has been widely studied, and also for dialogue generation. The model can be learned by maximum-likelihood estimation (MLE), which minimizes the word-level cross-entropy between the true data distribution and the generated approximation. Although this method yields reasonable responses, it suffers from exposure bias and does not take into account sequence-level structure (Ranzato et al., 2015). Exposure bias is introduced because of inconsistent conditions between the training and testing stages: while the ground-truth words are fed to the seq2seq model in the training stage, generated words are used in the testing stage.
|
| 24 |
+
|
| 25 |
+
To solve these problems with MLE, besides beam search and scheduled sampling (Bengio et al., 2015), (Ranzato et al., 2015) propose the REINFORCE and MIXER algorithms for sequence generation. By providing a task-specific score for the generated sequence, the REINFORCE algorithm (Williams, 1992) guides the seq2seq model to reach higher scores. Because the score is evaluated based on the whole generated sequence, both MLE problems are solved. However, as the REINFORCE algorithm cannot easily train the model from scratch, the MIXER algorithm is proposed to integrate MLE and REINFORCE. In this process, they first train the whole sequence using MLE, after which they accumulate the number of last words trained by REINFORCE. For further improvements, (Bahdanau et al., 2016) adopt another reinforcement learning (Sutton & Barto, 1998) based approach – the actor-critic architecture. They train a critic to predict the expected value of each time step to guide the actor. These algorithms outperform the original MLE algorithm on the task-specific score (BLEU) for text generation. Nonetheless, there is no evidence that these taskspecific scores are correlated with human prior knowledge. In particular, the relationship between the scores and human evaluation has been proven weak for dialogue generation (Liu et al., 2016).
|
| 26 |
+
|
| 27 |
+
Recently, the significant success of generative adversarial networks (GAN) for image processing has led researchers to use GANs for natural language. However, this has seen limited success because of the difficulty of backpropagation through discrete random variables. To address this problem, (Yu et al., 2017) use policy gradients on text generation. The reward is provided by a discriminator with Monte-Carlo search. In addition, (Li et al., 2017) adopt the same idea for dialogue generation. They also propose Reward for Every Generation Step (REGS), which is more time-efficient but is weaker than Monte-Carlo search. Another way to use GAN for natural-language tasks is by using GumbelSoftmax (Kusner & Hernandez-Lobato, 2016), which can simulate the discrete argmax outputs, ´ and be directly backpropagated from the discriminator. Also, MaliGAN (Che et al., 2017) directly derives the gradient estimator for discrete data. More recently, the improved Wasserstein GAN (WGAN-GP) (Gulrajani et al., 2017) has shown success for text generation by directly feeding the softmax layer to the discriminator, even without pre-training. This breakthrough then inspired (Press et al., 2017) and (Rajeswar et al., 2017) to further investigate WGAN-GP for better performance on text generation.
|
| 28 |
+
|
| 29 |
+
We focus on the influence of different objective function in GANs on conditional sequence generation throughout this paper. We compare the state-of-the-art algorithms without additional assistance such as teacher forcing, curriculum learning, etc. By this setting, we only consider the improvement attributed by the intrinsic of different algorithms rather than other additional assistances.
|
| 30 |
+
|
| 31 |
+
# 3 CONDITIONAL SEQUENCE GENERATION
|
| 32 |
+
|
| 33 |
+
In conditional sequence generation, we generate an output sequence $x \in X$ given an input condition $y \in Y$ . When the output sequence is generated from a model, it is denoted $x ^ { G }$ ; when the output sequence is from real data (training examples), it is instead denoted $x ^ { R }$ . In dialogue generation, both $x$ and $y$ are sequences of words. They can be written as
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
\begin{array} { r } { x = \{ x _ { t } \} _ { t = 1 } ^ { T } , x _ { t } \in V } \\ { y = \{ y _ { t } \} _ { t = 1 } ^ { T } , y _ { t } \in V . } \end{array}
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
Words $x _ { t }$ and $y _ { t }$ represent the word at time step $t$ in the interval $T$ of the specific sequences $x$ and $y$ . Set $V$ is the vocabulary set from which the words are selected. In this paper, we generate $x ^ { G }$ given $y$ using the seq2seq model as the generator $G$ (Sutskever et al., 2014; Vinyals & Le, 2015). From Sections 3.1 to 3.3, we introduce maximum likelihood estimation, REINFORCE algorithm, and GAN for sequence generation. In Section 4, we introduce the proposed approaches.
|
| 40 |
+
|
| 41 |
+
# 3.1 MAXIMUM LIKELIHOOD ESTIMATION
|
| 42 |
+
|
| 43 |
+
The basic idea of maximum likelihood estimation (MLE) for conditional sequence generation is to find the parameters for model $G$ that maximize the likelihood of generating the training data. When using MLE to train the generator model $G$ , the objective function is
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
G ^ { * } = \arg \operatorname* { m a x } _ { G } E _ { ( x ^ { R } , y ) \sim P ^ { R } ( X , Y ) } [ \sum _ { t = 1 } ^ { T } \log ( P ^ { G } ( x _ { t } ^ { R } | y , x _ { 1 \dots t - 1 } ^ { R } ) ) ] ,
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
whof . $P ^ { R } ( X , Y )$ is the joint distribution of the ning stage, in Eq. (2), the pre $( x , y )$ pairs in the training n is learned based on $T$ e length, but the $x ^ { R }$ $< y , x _ { 1 \ldots t - 1 } ^ { R } >$ condition in the testing stage is $< y , x _ { 1 \ldots t - 1 } ^ { G } >$ . This is known as exposure bias, which can result in accumulating error when testing. This is also due to the likelihood is estimated at the word level (Ranzato et al., 2015) only as opposed to the whole sequence.
|
| 50 |
+
|
| 51 |
+
# 3.2 REINFORCE
|
| 52 |
+
|
| 53 |
+
Conditional sequence generation can be formulated as reinforcement learning. Similar to (Ranzato et al., 2015), we describe it as a Markov decision process (MDP), where state $s$ consists of the condition and previous word sequence – in our case, $s = < y , x _ { 1 . . . t - 1 } ^ { G } > -$ and an action $a$ is the generated word conditioned on the current state – in our case, $a = x _ { t } ^ { G }$ is a word in the vocabulary. Each action is generated according to the policy, which is determined by the parameters of generator model $G$ . In typical reinforcement learning, the agent obtains a reward $r _ { t }$ at each time step $t$ . In sequence generation, $r _ { t }$ is zero except for $r _ { T }$ , which evaluates the goodness of the whole generating $x _ { 1 \ldots T } ^ { G ^ { \star } }$ given $y$ . The generator $G$ learns to maximize the expected reward
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
G ^ { * } = \arg \operatorname* { m a x } _ { G } E _ { y \sim P ^ { R } \left( Y \right) , x ^ { G } \sim P ^ { G } \left( X \mid y \right) } [ r _ { T } ] ,
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
where $P ^ { R } ( Y )$ is the probability distribution of condition $y$ in the training data, $P ^ { G } ( X | y )$ is the probability of generating the sequence $x ^ { G }$ given the generator $G$ and condition . Note that the main difference between Equations (2) and (3) is that the condition sequence here is $x _ { 1 \ldots t - 1 } ^ { G }$ rather than $x _ { 1 \ldots t - 1 } ^ { R }$ . Moreover, each $x _ { t } ^ { G }$ here is sampled using softmax rather than argmax over vocabulary set $V$ . The parameters of the generator $\theta _ { G }$ are updated as
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\theta _ { G } \theta _ { G } + \eta ( r _ { T } - b _ { t } ) \nabla \log ( p _ { G } ( x _ { t } ^ { G } | y , x _ { 1 \dots t - 1 } ^ { G } ) ) ,
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
where $b _ { t }$ is the baseline to reduce training variance (Sutton & Barto, 1998; Ranzato et al., 2015), and $\eta$ is the learning rate.
|
| 66 |
+
|
| 67 |
+
# 3.3 GENERATIVE ADVERSARIAL NETWORK
|
| 68 |
+
|
| 69 |
+
A generative adversarial network (GAN) is composed of a generator and a discriminator (Goodfellow et al., 2014). The discriminator differentiates between real data and data from the generator, and the generator attempts to generate plausible data that will deceive the discriminator. Here we use GAN for conditional sequence generation by considering our model $G$ as the generator and constructing a discriminator $D$ sequentially fed with input-output pairs $y$ and $x$ (Mirza & Osindero, 2014; Li et al., 2017).
|
| 70 |
+
|
| 71 |
+
# 3.3.1 SEQGAN
|
| 72 |
+
|
| 73 |
+
Since the vocabulary $V$ in the generated sequence is a discrete variable, we cannot backpropagate through the generator. In SeqGAN ( $\mathrm { Y u }$ et al., 2017; Li et al., 2017), the generation task is formulated as a reinforcement learning scenario, similar to that described in Section 3.2, and the reward function is replaced with the discriminator in regular GAN. The discriminator $D$ is then updated through backpropagation, while the generator $G$ is updated using policy gradient with a reward evaluated over $x$ given $y$ by $D$ . The optimization functions for $D$ and $G$ are
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\begin{array} { r l } { } & { \mathcal { D } ^ { * } = \underset { D } { \arg \operatorname* { m a x } } E _ { y \sim P ^ { R } \left( Y \right) , x ^ { R } \sim \mathit { P } ^ { R } \left( X \mid y \right) } [ \log ( D ( x ^ { R } | y ) ) ] + E _ { y \sim \mathit { P } ^ { R } \left( Y \right) , x ^ { G } \sim \mathit { P } ^ { G } \left( X \mid y \right) } [ \log ( 1 - \mathit { D } ( x ^ { G } | y ) ) ] } \\ { } & { \mathcal { X } ^ { * } = \underset { G } { \arg \operatorname* { m a x } } E _ { y \sim \mathit { P } ^ { R } \left( Y \right) , x ^ { G } \sim \mathit { P } ^ { G } \left( X \mid y \right) } [ \mathit { D } ( x ^ { G } | y ) ] . } \end{array}
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
In the basic SeqGAN, $G$ in Equation (5) is optimized using the REINFORCE algorithm. The formulation for optimizing $G$ in Equation (5) is the same as Equation (3), except that $r _ { T }$ is replaced with $D ( x ^ { G } | y )$ .
|
| 80 |
+
|
| 81 |
+
Due to the sparse reward that only given at the terminal state, this basic setting will cause high training variance. For example, when questioning ”What ’s your name ?”, ”I ’m sorry.” is a wrong answer, while ”I ’m John.” is a correct answer. Although they share the same prefix $\because \mathrm { m } ^ { \prime }$ , the basic SeqGAN will give the prefix different reward in different sentences. The solution in (Yu et al., 2017; Che et al., 2017) is Monte Carlo search. For each prefix $x _ { 1 \ldots t }$ , $N$ possible sequences $x _ { t + 1 \ldots T }$ are samples according to the current policy, and the $N$ final rewards are averaged as the reward for current time step. In practice, we have to complete every prefixes for each training data in a batch, and evaluate all of the $m T N$ episodes, where $m$ is the batch size. This method costs extremely high computational resource. For time efficiency, (Li et al., 2017) proposes Reward for Every Generation Step (REGS) to replace Monte Carlo search. Because they train the discriminator in REGS with prefixes without considering whether the episode is terminated, REGS causes a less accurate discriminator.
|
| 82 |
+
|
| 83 |
+
# 3.3.2 WASSERSTEIN GAN WITH GRADIENT PENALTY (WGAN-GP)
|
| 84 |
+
|
| 85 |
+
In recent work, WGAP-GP has been successfully used for sequence generation (Gulrajani et al., 2017; Rajeswar et al., 2017; Press et al., 2017). Instead of using more complicate methods such as policy gradient, they directly feed the softmax layer into the discriminator. The generator can therefore be updated through backpropagation. We then formulate the conditional version of WGAN-GP as
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\begin{array} { r l } & { D ^ { * } = \underset { D } { \arg \operatorname* { m a x } } E _ { y \sim P ^ { R } ( y ) , x ^ { R } \sim P ^ { R } ( X | y ) } [ D ( x ^ { R } | y ) ] - E _ { y \sim P ^ { R } ( y ) , x ^ { G } \sim P ^ { G } ( X | y ) } [ D ( x ^ { G } | y ) ] } \\ & { G ^ { * } = \underset { G } { \arg \operatorname* { m a x } } E _ { y \sim P ^ { R } ( Y ) , x ^ { G } \sim P ^ { G } ( X | y ) } [ D ( x ^ { G } | y ) ] . } \end{array}
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
# 4 PROPOSED APPROACH: STEPWISE GAN
|
| 92 |
+
|
| 93 |
+
The basic idea of stepwise GAN (see Fig. 1), or StepGAN, is to construct a sequence-to-sequence model as discriminator $D$ . At each time step of $D$ ’s decoder, the hidden vector is passed to a fully-connected layer. The discriminator $D$ then outputs the evaluation score for each subsequence $\langle y , x _ { 1 \ldots t } \rangle$ , denoted as $D ( x _ { 1 . . . t } | y )$ . With discriminator $D$ , we seek to minimize the summation of $D ( x _ { 1 \ldots t } ^ { G } | y )$ over the time steps when input the generated sequences $x ^ { G }$ . Simultaneously, $D$ maximizes the summation of $D ( x _ { 1 \ldots t } ^ { \mathrm { { R } } } | y )$ when the input is real data $x ^ { R }$ . The optimization of $D$ and $G$ is
|
| 94 |
+
|
| 95 |
+

|
| 96 |
+
Figure 1: Illustration of stepwise GAN
|
| 97 |
+
|
| 98 |
+
thus
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
\begin{array} { l } { { \displaystyle D ^ { \prime } ( x | y ) = \sum _ { t = 1 } ^ { T } \alpha _ { t } ^ { D } D \big ( x _ { 1 \dots t } | y \big ) } } \\ { { \displaystyle D ^ { * } = \arg \operatorname* { m a x } _ { D } E _ { y \sim P ^ { R } ( y ) , x ^ { R } \sim P ^ { R } ( X | y ) } [ \log ( D ^ { \prime } ( x ^ { R } | y ) ) ] } } \\ { { \displaystyle \qquad + E _ { y \sim P ^ { R } ( y ) , x ^ { G } \sim P ^ { G } ( X | y ) } [ \log \big ( 1 - D ^ { \prime } ( x ^ { G } | y ) \big ) ] , } } \\ { { \displaystyle G ^ { * } = \arg \operatorname* { m a x } _ { G } E _ { y \sim P ^ { R } ( Y ) , x ^ { G } \sim P ^ { G } ( X | y ) } [ D ( x ^ { G } | y ) ] , } } \end{array}
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
where $\alpha _ { t } ^ { D }$ is a weighted factor with $\textstyle \sum _ { t = 1 } ^ { T } \alpha _ { t } ^ { D } = 1$ . In practice, we set $\begin{array} { r } { \alpha _ { t } ^ { D } = \frac { 1 } { T } } \end{array}$ , but it is possible assign scores for each prefix. Although we only use one way to train $D$ , we think there are two ways to interpret the $D$ ’s scores, and different view points lead to different update formulations for $G$ :
|
| 105 |
+
|
| 106 |
+
• $D ( x _ { 1 . . . t } | y )$ evaluates the extra benefit of adding the word $x _ { t }$ into the sequence. The formulation for $G$ ’s parameter update is
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\theta _ { G } \theta _ { G } + \eta \alpha _ { t } ^ { G } ( \sum _ { t ^ { \prime } = t } ^ { T } D ( x _ { 1 \dots t ^ { \prime } } | y ) ) \nabla \log ( p _ { G } ( x _ { t } ^ { G } | y , x _ { 1 \dots t - 1 } ^ { G } ) ) .
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
$G$ has to increase the summation $\scriptstyle \sum _ { t ^ { \prime } = t } ^ { T } D ( x _ { 1 \dots t ^ { \prime } } | y )$ . We call this stepGAN-Seq.
|
| 113 |
+
|
| 114 |
+
• $D ( x _ { 1 . . . t } | y )$ evaluates the average goodness of all the sequences beginning with $x _ { 1 \ldots t }$ . The update formulation for $\theta _ { G }$ is
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\theta _ { G } \gets \theta _ { G } + \eta \alpha _ { t } ^ { G } D ( x _ { 1 \dots t } | y ) \nabla \log ( p _ { G } ( x _ { t } ^ { G } | y , x _ { 1 \dots t - 1 } ^ { G } ) ) .
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
The $G$ only needs to learn to increase $D ( x _ { 1 \ldots t } | y )$ . We call this stepGAN in following.
|
| 121 |
+
|
| 122 |
+
Using factor $\alpha _ { t } ^ { G }$ , we diversify training by arbitrarily weighting the importance of each time step1. We explore the influence of different values of $\alpha _ { t } ^ { \check { G } }$ and compare the two update formulations in section 5 and appendix B.
|
| 123 |
+
|
| 124 |
+
StepGAN-Seq is a generalized version of SeqGAN. If we set $\alpha _ { T } ^ { D } = 1$ , $\alpha _ { t } ^ { D } = 0$ for $t < T$ , and $\alpha _ { t } ^ { G } = 1$ for all $t$ , then stepGAN-Seq is equivalent to SeqGAN without Monte Carlo search. Also, REGS (Li et al., 2017) can be induced by set $\alpha _ { t } ^ { D } = 1$ at a randomly chosen time step.
|
| 125 |
+
|
| 126 |
+
StepGAN is similar to the actor-critic architecture in (Bahdanau et al., 2016). Instead of the assigned task-specific score, we learn the score by adversarial learning. Because $D$ ’s scores are the expected return in this setting, we would like StepGAN to approximate the expected return obtained by SeqGAN or MaliGAN with Monte Carlo search. This approach only need to add a set of weight factors, and therefore much time efficient than Monte Carlo search. For more details of the algorithm, please refer to appendix A for pseudo-code.
|
| 127 |
+
|
| 128 |
+
# 5 EXPERIMENTS
|
| 129 |
+
|
| 130 |
+
We use a recurrent neural network for both the discriminator and generator due to its strong sequential correlation (Press et al., 2017; Rajeswar et al., 2017). Specifically, we use gated recurrent units (GRUs) (Chung et al., 2014) in our experiments. We view the noise feature in GAN as the random process of sampling from the softmax layer distribution.
|
| 131 |
+
|
| 132 |
+
# 5.1 ARTIFICIAL GRAMMARS
|
| 133 |
+
|
| 134 |
+
To better evaluate GANs for conditional sequence generation, we define three artificial grammars: sequence, counting, and addition. The three grammars are described in Table 1. For the sequence grammar, the aim is to generate a continued consecutive number sequence behind the input $Y$ . For example, for input $\langle 1 , 2 , 3 \rangle$ , the answer would be a consecutive number sequence of any length starting with 4, such as $\langle 4 , 5 , 6 , 7 , 8 \rangle$ . The counting grammar is more complicated. The generated sequence should contain exactly 3 words, where the median is a randomly selected word from the input sequence. The first generated word should be the number of words on the left-hand side of the selected median, while the last generated word should be the number of words on the right-hand side. For example, when the input is $\langle 5 , 9 , 2 , 8 , 3 , 2 , 9 , 1 \rangle$ , one permissible generated sequence is $\langle 0 , 5 , 7 \rangle$ . Last, for the addition grammar we generate the addition of two numbers randomly segmented from the input sequence. That is, for input $\langle 8 , 1 , 3 , 4 \rangle$ , then one permissible output is the addition of 8 and 134 – thus $\langle 1 , 4 , 2 \rangle$ . Note that both the input and output numbers for this grammar are represented in terms of their corresponding digits.
|
| 135 |
+
|
| 136 |
+
The purpose of these design is to imitate major properties in dialogue generation, such as variablelength, repeated prefixes, the same sequence space, one-to-many, and many-to-one. The variablelength property means there is no fixed length for the input and output sequences. The repeated prefixes property means the beginning subsequences are usually shared by many data, for instance What and I am in natural language. The same sequence space here means that the input and output have the same structure and as such are sampled from the same space. Finally, one-to-many and many-to-one are quite common in dialogue generation. For example, when asking How are you?, responses vary from I’m fine to Great! How are you?. Also, the same response can be paired with multiple questions, such as for My name is Paul in response to What’s your name? and Who are you?.
|
| 137 |
+
|
| 138 |
+
We then randomly generate 100,000 samples as training data, 10,000 as development data, and 10,000 samples as testing data. The architectures are set to one layer with 128 hidden units. We evaluate our results using the three measures in Table 2. The first is the accuracy of samples generated from the argmax policy (Acc), the second is that generated from the softmax probability (AccS), and the last is the coverage of softmax samples over all the permissible answers of the specific grammar (Cov). We report them to ensure whether the one-to-many property is being learned. AccS and Cov are important because they can indicate if the model can learn the underlying distribution of answers. When mode collapse happens, which means the model only know a specific type of answers, it will obtain high AccS and low Cov scores. To ensure a fair comparison, all the algorithms are based on the same pre-trained model: the MLE model listed in Table 2.
|
| 139 |
+
|
| 140 |
+
Table 1: Grammar definitions and examples
|
| 141 |
+
|
| 142 |
+
<table><tr><td>Grammar</td><td>Definition</td><td>Examples</td></tr><tr><td>Sequence</td><td>Continue the sequence for a random length</td><td>123: 4, 45,...</td></tr><tr><td>Counting</td><td>Randomly choose a digit, and then calculate the left-and right-hand lengths</td><td>123: 012,121, 230</td></tr><tr><td>Addition</td><td>Randomly partition,and then add the two numbers</td><td>123: 15,24</td></tr></table>
|
| 143 |
+
|
| 144 |
+
Table 2: Results of artificial grammars with different algorithms. Evaluation label Acc $( \% )$ is the accuracy of argmax samples, AccS $( \% )$ is the accuracy of softmax samples, and Cov $( \% )$ is the coverage of softmax samples over permissible answers. The dash (-) here indicates that the algorithm introduced no improvements based on the pre-trained model.
|
| 145 |
+
|
| 146 |
+
<table><tr><td colspan="4"> Sequence</td><td colspan="3">Counting</td><td colspan="3">Addition</td></tr><tr><td></td><td>Acc</td><td>AccS</td><td>Cov</td><td>Acc</td><td>AccS</td><td>Cov</td><td>Acc</td><td>AccS</td><td>Cov</td></tr><tr><td>MLE</td><td>97.43</td><td>81.32</td><td>53.77</td><td>73.48</td><td>68.89</td><td>70.63</td><td>44.57</td><td>32.28</td><td>31.79</td></tr><tr><td>REINFORCE</td><td>99.81</td><td>97.30</td><td>4.54</td><td>99.97</td><td>99.36</td><td>16.99</td><td>79.98</td><td>75.60</td><td>18.32</td></tr><tr><td>WGAN-GP</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>basic-MaliGAN</td><td>97.34</td><td>81.66</td><td>54.19</td><td>74.12</td><td>70.35</td><td>70.15</td><td>44.27</td><td>32.05</td><td>31.92</td></tr><tr><td>basic-SeqGAN</td><td>97.20</td><td>80.28</td><td>57.61</td><td>74.59</td><td>70.56</td><td>70.39</td><td>44.87</td><td>32.30</td><td>31.90</td></tr><tr><td>MC-SeqGAN</td><td>97.20</td><td>80.98</td><td>55.49</td><td>72.96</td><td>68.10</td><td>70.54</td><td>44.72</td><td>32.28</td><td>31.83</td></tr><tr><td>REGS</td><td>97.42</td><td>81.36</td><td>53.82</td><td>75.99</td><td>70.93</td><td>69.40</td><td>44.64</td><td>32.32</td><td>32.01</td></tr><tr><td>StepGAN-Seq</td><td>97.11</td><td>74.85</td><td>67.49</td><td>75.47</td><td>70.64</td><td>69.82</td><td>45.55</td><td>32.49</td><td>32.01</td></tr><tr><td>StepGAN</td><td>97.19</td><td>75.92</td><td>66.08</td><td>81.98</td><td>72.24</td><td>69.02</td><td>44.94</td><td>32.19</td><td>31.67</td></tr></table>
|
| 147 |
+
|
| 148 |
+
We discuss the results of MLE, REINFORCE, and state-of-the-art GAN algorithms on Sequence, Counting, and Addition in Table 2. REINFORCE has higher Acc and AccS than ${ \mathrm { M L E } } ^ { 2 }$ , but it results in strong mode-collapse (very low Cov). We have a very strong MLE baseline for Sequence. Therefore we cannot pretrain discriminator well based on this baseline MLE model. Every GAN algorithms cannot outperform MLE by this setting. StepGAN improves Acc on both Counting and Addition without heavily trade-off with Cov. That is, training model using StepGAN enhances and maintains the knowledge of underlying distribution rather than resulting in strong mode-collapse as REINFORCE.
|
| 149 |
+
|
| 150 |
+
To investigate the trade-off between AccS and Cov, we plot the accuracy-coverage curve in Fig. 2. The trade-off between accuracy and coverage is controlled by sharpening the softmax layer. Besides Fig. 2a, of which the GANs do not obtain good results, StepGAN improves the accuracy-coverage curves in Fig. 2b and Fig. 2c. This is consistent with our realization of Table 2 that StepGAN fits model to the underlying distribution better.
|
| 151 |
+
|
| 152 |
+
# 5.2 DIALOGUE GENERATION
|
| 153 |
+
|
| 154 |
+
We split OpenSubtitles (Tiedemann, 2009) into training set, development set, and testing set with a vocabulary of the top 4,000 most frequently occurring words. Both the generator and discriminator are 1-layer GRUs with a hidden dimension set to $5 1 2 ^ { 3 }$ . To compare the improvements introduced by all the algorithms, we first pre-trained the generator using MLE, after which we further trained the model for 1-epoch by different GANs. SeqGAN, MaliGAN, REGS, and StepGAN were compared. We do not compare Monte Carlo search with other approaches because its time complexity is much larger. All discriminators of SeqGAN, MaliGAN, REGS, and StepGAN were pre-trained on real
|
| 155 |
+
|
| 156 |
+

|
| 157 |
+
Figure 2: Sampled accuracy and coverage curves
|
| 158 |
+
|
| 159 |
+
Table 3: Human evaluation and BLEU score for dialogue generation. CoHS $( \% )$ is coherence human score. SHS $( \% )$ is sentence structure human score.
|
| 160 |
+
|
| 161 |
+
<table><tr><td></td><td colspan="3">CoHS (%)</td><td colspan="3">SHS (%)</td><td colspan="3">BLEU</td></tr><tr><td></td><td>Argmax</td><td>BS</td><td>MMI</td><td>Argmax</td><td>BS</td><td>MMI</td><td>Argmax</td><td>BS</td><td>MMI</td></tr><tr><td>MLE</td><td>44.89</td><td>54.22</td><td>60.44</td><td>15.11</td><td>1.33</td><td>7.56</td><td>0.222</td><td>0.281</td><td>0.272</td></tr><tr><td>SeqGAN</td><td>41.33</td><td>53.33</td><td>63.55</td><td>30.67</td><td>6.22</td><td>10.22</td><td>0.202</td><td>0.267</td><td>0.251</td></tr><tr><td>MaliGAN</td><td>35.56</td><td>51.11</td><td>45.33</td><td>20.89</td><td>5.78</td><td>8.00</td><td>0.180</td><td>0.271</td><td>0.263</td></tr><tr><td>REGS</td><td>36.44</td><td>54.67</td><td>53.78</td><td>36.44</td><td>9.33</td><td>9.78</td><td>0.180</td><td>0.256</td><td>0.246</td></tr><tr><td>StepGAN</td><td>47.56</td><td>63.56</td><td>61.33</td><td>40.89</td><td>3.56</td><td>8.89</td><td>0.171</td><td>0.254</td><td>0.248</td></tr></table>
|
| 162 |
+
|
| 163 |
+
data and generated data from the pre-trained generator. Note that these models were all trained without MIXER, curriculum learning, or teacher forcing, etc. Both the generator and discriminator are optimized by SGD. We used grid search in the experiments with learning rate={1e-1,1e-2,1e-3}, discriminator iteration step={1,5}, and used batchsize $_ { = 6 4 }$ .
|
| 164 |
+
|
| 165 |
+
For human evaluation, we randomly selected 25 inputs from the testing set, and decoded using argmax policy, beam search, and MMI (Li et al., 2015)4. We presented both an input and the generated outputs to 8 and 4 judges respectively, and we asked them to do Turing test (correct or not) of the coherence and sentence structure. Coherence is the rationality of the generated responses given inputs. Sentence structure is the correctness and complexity of grammar. The sentences provide specific information would be considered as having better sentence structure rather than the general ones (egs. I don’t know.) due to more complex grammar. In Table 3, the two measures are labeled as CoHS (Coherence Human Score) and SHS (Sentence structure Human Score). We also show the BLEU score of each algorithm. It was already found that BLEU score is inconsistent with human evaluation (Liu et al., 2016), we also observe the same phenomenon it in our experiments.
|
| 166 |
+
|
| 167 |
+
We show the CoHS and SHS of 15 different results (5 different algorithms and 3 different decoding methods) in Table 3. First, we can see decoding using beam search or MMI improve CoHS. StepGAN obtains the best performance in terms of CoHS when using argmax policy or beam search, but StepGAN cannot further increase the performance using MMI. When using MMI, the CoHS of MLE, SeqGAN and StepGAN are comparable. Second, argmax policy has higher SHS than beam search and MMI in all cases. In the meantime, GANs have higher SHS than MLE, and StepGAN has the highest score with argmax. The inconsistency of improvement between argmax policy, beam search and MMI is very likely because that the GANs are learned with the softmax policy and do not consider beam search and MMI during training. Additionally, we know beam search and MMI maximize the probability of response given an input without maintaining the probability of the response itself. This makes them prefer a coherence response rather than a good sentence structure. These statistics show that SeqGAN, MaliGAN, and REGS cannot consistently improve both coherence and sentence structure, whereas StepGAN outperforms MLE in terms both CoHS and SHS with all decoding methods.5
|
| 168 |
+
|
| 169 |
+

|
| 170 |
+
Figure 3: The variation of discriminators’ scores using different GAN algorithms during training iterations. The printed color is normalized throughout the generation steps $\mathbf { \bar { x } }$ -axis) for each algorithm. (a)(b) are given “how are you ?” as input, and (c)(d) are given “what ’s your name ?” as input.
|
| 171 |
+
|
| 172 |
+
To understand what the discriminators learn, we measure the variance throughout the training iterations at each generation step. In adversarial learning, discriminator’s scores oscillate during training according to the current performance of generator. We argue that discriminator’s score for the most crucial generation step is the most easy to oscillate. This is because the generation step is the most important one for discriminator to identify whether it’s real or fake. In Fig. (3), we show four examples. Fig. (3a) and Fig. (3b) are respectively true response and wrong response given input question ”how are you ?”, and Fig. (3c) and Fig. (3d) are given input question ”what ’s your name ?. The darker color indicates the higher variance on the generation step.
|
| 173 |
+
|
| 174 |
+
In Fig. (3), the colors for SeqGAN is always the same. Because the disriminator of SeqGAN only evaluate the whole sequence, the generation steps means no difference to discriminator. Second, REGS and StepGAN both aim to approximate Monte-Carlo search on SeqGAN, but in practice, we can clearly see that the variance of REGS is very different from Monte Carlo search. This is because REGS considers non-terminated episodes, which makes REGS has to spend extra effort on the generation maximum length to check whether there’s a terminal state $( < E O S > )$ . The results of StepGAN and Monte Carlo search (MC-SeqGAN) are quite similar. Based on MC-SeqGAN and StepGAN, the important parts (with darker colors) in the sentences for discriminating the true ones from fake correspond to human knowledge. For example, ”fine , thank you ” are the most important region in Fig. (3a), ”sorry , i ’m sorry” are the most important region in Fig. (3b) when answering ”how are you ?”. When given ”what ’s your name ?”, MC-SeqGAN and StepGAN focus on ”’m john” in Fig. (3c) and ”sorry” in Fig. (3d). We believe the success of StepGAN comes from estimating the goodness of a sequence at every generation step as Monte Carlo search, but with little extra computation.
|
| 175 |
+
|
| 176 |
+
# 6 CONCLUSION
|
| 177 |
+
|
| 178 |
+
In this paper we propose StepGAN to approximate Monte Carlo search with a much lower computational cost.We show that the proposed StepGAN performs equally to or outperforms the state-ofthe-art GAN algorithms on artificial grammars. On a representative real-world conditional sequence generation task–dialogue generation, StepGAN also outperforms other approaches on both coherence and sentence structure.
|
| 179 |
+
|
| 180 |
+
Our proposed artificial grammars not only accurately reflect model coverage and accuracy but also boast clearly distinguishable styles. For example, the sequence style can be the length, the counting style can be the selected digit position, and the addition style can be the selected partition position. This property lends itself to investigating style transfering for sequences generation, which is one of our aims for future work.
|
| 181 |
+
|
| 182 |
+
REFERENCES
|
| 183 |
+
Dzmitry Bahdanau, Philemon Brakel, Kelvin Xu, Anirudh Goyal, Ryan Lowe, Joelle Pineau, Aaron Courville, and Yoshua Bengio. An actor-critic algorithm for sequence prediction. arXiv preprint arXiv:1607.07086, 2016.
|
| 184 |
+
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.
|
| 185 |
+
Tong Che, Yanran Li, Ruixiang Zhang, R Devon Hjelm, Wenjie Li, Yangqiu Song, and Yoshua Bengio. Maximum-likelihood augmented discrete generative adversarial networks. arXiv preprint arXiv:1702.07983, 2017.
|
| 186 |
+
Junyoung Chung, Caglar Gulcehre, KyungHyun Cho, and Yoshua Bengio. Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv preprint arXiv:1412.3555, 2014.
|
| 187 |
+
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.
|
| 188 |
+
Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron Courville. Improved training of wasserstein gans. arXiv preprint arXiv:1704.00028, 2017.
|
| 189 |
+
Kirthevasan Kandasamy, Yoram Bachrach, Ryota Tomioka, Daniel Tarlow, and David Carter. Batch policy gradient methods for improving neural conversation models. arXiv preprint arXiv:1702.03334, 2017.
|
| 190 |
+
Matt J Kusner and Jose Miguel Hern ´ andez-Lobato. Gans for sequences of discrete elements with ´ the gumbel-softmax distribution. arXiv preprint arXiv:1611.04051, 2016.
|
| 191 |
+
Jiwei Li, Michel Galley, Chris Brockett, Jianfeng Gao, and Bill Dolan. A diversity-promoting objective function for neural conversation models. arXiv preprint arXiv:1510.03055, 2015.
|
| 192 |
+
Jiwei Li, Will Monroe, Tianlin Shi, Alan Ritter, and Dan Jurafsky. Adversarial learning for neural dialogue generation. arXiv preprint arXiv:1701.06547, 2017.
|
| 193 |
+
Kevin Lin, Dianqi Li, Xiaodong He, Zhengyou Zhang, and Ming-Ting Sun. Adversarial ranking for language generation. arXiv preprint arXiv:1705.11001, 2017.
|
| 194 |
+
Chia-Wei Liu, Ryan Lowe, Iulian V Serban, Michael Noseworthy, Laurent Charlin, and Joelle Pineau. How not to evaluate your dialogue system: An empirical study of unsupervised evaluation metrics for dialogue response generation. arXiv preprint arXiv:1603.08023, 2016.
|
| 195 |
+
Mehdi Mirza and Simon Osindero. Conditional generative adversarial nets. arXiv preprint arXiv:1411.1784, 2014.
|
| 196 |
+
Ofir Press, Amir Bar, Ben Bogin, Jonathan Berant, and Lior Wolf. Language generation with recurrent generative adversarial networks without pre-training. arXiv preprint arXiv:1706.01399, 2017.
|
| 197 |
+
Sai Rajeswar, Sandeep Subramanian, Francis Dutil, Christopher Pal, and Aaron Courville. Adversarial generation of natural language. arXiv preprint arXiv:1705.10929, 2017.
|
| 198 |
+
Marc’Aurelio Ranzato, Sumit Chopra, Michael Auli, and Wojciech Zaremba. Sequence level training with recurrent neural networks. arXiv preprint arXiv:1511.06732, 2015.
|
| 199 |
+
|
| 200 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. In Advances in neural information processing systems, pp. 3104–3112, 2014.
|
| 201 |
+
|
| 202 |
+
Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction, volume 1. MIT press Cambridge, 1998.
|
| 203 |
+
|
| 204 |
+
Jorg Tiedemann. News from OPUS - A collection of multilingual parallel corpora with tools ¨ and interfaces. In N. Nicolov, K. Bontcheva, G. Angelova, and R. Mitkov (eds.), Recent Advances in Natural Language Processing, volume V, pp. 237–248. John Benjamins, Amsterdam/Philadelphia, Borovets, Bulgaria, 2009. ISBN 978 90 272 4825 1.
|
| 205 |
+
|
| 206 |
+
Oriol Vinyals and Quoc Le. A neural conversational model. arXiv preprint arXiv:1506.05869, 2015.
|
| 207 |
+
|
| 208 |
+
Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992.
|
| 209 |
+
|
| 210 |
+
Lantao Yu, Weinan Zhang, Jun Wang, and Yong Yu. Seqgan: Sequence generative adversarial nets with policy gradient. In AAAI, pp. 2852–2858, 2017.
|
| 211 |
+
|
| 212 |
+
Yizhe Zhang, Zhe Gan, Kai Fan, Zhi Chen, Ricardo Henao, Dinghan Shen, and Lawrence Carin. Adversarial feature matching for text generation. arXiv preprint arXiv:1706.03850, 2017.
|
| 213 |
+
|
| 214 |
+
Junbo Zhao, Michael Mathieu, and Yann LeCun. Energy-based generative adversarial network. arXiv preprint arXiv:1609.03126, 2016.
|
| 215 |
+
|
| 216 |
+
# A APPENDIX: PSEUDO CODE OF STEPWISE GAN
|
| 217 |
+
|
| 218 |
+
Table 4: Pseudo code of stepwise GAN
|
| 219 |
+
Algorithm 1 Stepwise GAN (StepGAN) Training
|
| 220 |
+
|
| 221 |
+
<table><tr><td>1</td><td>for number of training iterations do</td></tr><tr><td>2</td><td>for i=1, D-steps do Sample (y,xR) from real data</td></tr><tr><td>3</td><td></td></tr><tr><td>4</td><td>Sample xG ~ PG(.ly)</td></tr><tr><td>5</td><td>Update D using equation (7) T</td></tr><tr><td>6</td><td>D'(xly)=∑-1PD(x.tly)</td></tr><tr><td>7</td><td>D* = arg maxD Ey~pR(y),R~pR(xly)[log(D'(xR|y))] +Ey~PR(y),xG~PG(xly)[log(1-D'(xG|y)]</td></tr><tr><td>8</td><td>end for</td></tr><tr><td>9</td><td>for i=1, G-steps do</td></tr><tr><td>10</td><td>Sample y from real data</td></tr><tr><td>11</td><td>Sample xG ~ PG(.ly)</td></tr><tr><td>12</td><td>Update G using equation (9)</td></tr><tr><td>13</td><td>0G ←0G + na£D(x1...tly)Vlog(𝑝G(x£ly,x...t-1))</td></tr><tr><td>14</td><td>end for</td></tr><tr><td>15</td><td>end for</td></tr><tr><td></td><td></td></tr></table>
|
| 222 |
+
|
| 223 |
+
# B WEIGHTED FACTORS SEARCH OF STEPGAN AND STEPGAN-SEQ
|
| 224 |
+
|
| 225 |
+
Table 5: StepGAN and StepGAN-Seq with different weight factors. The dash (-) here notes that the weight factors yield neither improvements nor deterioration.
|
| 226 |
+
|
| 227 |
+
<table><tr><td colspan="7">StepGAN StepGAN-Seq</td></tr><tr><td colspan="2"></td><td>Acc</td><td>AccS</td><td>Cov</td><td>Acc</td><td>AccS Cov</td></tr><tr><td rowspan="3">Sequence</td><td>Uniform</td><td>97.19</td><td>75.92</td><td>66.08</td><td>97.11</td><td>74.85 67.49</td></tr><tr><td>Increase</td><td>97.17</td><td>75.33</td><td>66.75 97.18</td><td>73.30</td><td>68.19</td></tr><tr><td>Decrease</td><td>97.16</td><td>74.73</td><td>67.14</td><td>97.09 74.34</td><td>67.48</td></tr><tr><td rowspan="3">Counting</td><td>Uniform</td><td>77.23</td><td>71.43</td><td>70.18</td><td>74.91</td><td>70.70 69.84</td></tr><tr><td>Increasing</td><td>74.50</td><td>69.66</td><td>70.86</td><td>74.54 70.74</td><td>70.11</td></tr><tr><td>Decreasing</td><td>81.98</td><td>72.24</td><td>69.02</td><td>75.47 70.64</td><td>69.82</td></tr><tr><td rowspan="3">Addition</td><td>Uniform</td><td>44.26</td><td>32.39</td><td>31.91</td><td>44.77</td><td>32.34 31.65</td></tr><tr><td>Increasing</td><td>1</td><td>1 -</td><td>=</td><td>1</td><td>1</td></tr><tr><td>Decreasing</td><td>44.94</td><td>32.19</td><td>31.67</td><td>45.55 32.49</td><td>32.01</td></tr></table>
|
| 228 |
+
|
| 229 |
+
We compare different weighted factors $\alpha ^ { G }$ for StepGAN and StepGAN-Seq, with $\begin{array} { r } { \alpha _ { t } ^ { D } = \frac { 1 } { T } } \end{array}$ for all the presented cases. As depicted in Table 5, the three grammars are trained using three sorts of weighted factors: uniform $\begin{array} { r } { \dot { \left( \alpha _ { t } ^ { G } \ = \ 1 \right) } } \end{array}$ ), increasing $( \alpha _ { t } ^ { G } \ = t )$ , and decreasing $( \alpha _ { t } ^ { G } \ = \ T - \ t + 1 )$ . The results clearly show that the time-step-decreasing weight factors positively affect training. We believe this is because the training spirit of decreased weighted factor start from first correcting prefix. After correcting prefix, it becomes easier to correct the suffix. Please refer to section 5 if you are interested in the details of Acc, AccS, and Cov.
|
| 230 |
+
|
| 231 |
+
# C ENERGY-BASED STEPWISE GAN (EBSTEPGAN)
|
| 232 |
+
|
| 233 |
+
We propose energy-based stepwise GAN (EBStepGAN) that only change the form of objective function of StepGAN. This is mainly inspired by energy-based GAN (Zhao et al., 2016). As depicted in Fig. 4, the discriminator $D$ here has the same architecture as generator $G$ , and its energy function is cross-entropy. Discriminator assigns low energy to real samples and high enery to generated samples. The advantage of EBStepGAN is that we can initialize both generator and discriminator with the same pre-trained model using MLE. The optimization functions are written as
|
| 234 |
+
|
| 235 |
+

|
| 236 |
+
Figure 4: Illustration of energy-based stepwise GAN
|
| 237 |
+
|
| 238 |
+
$$
|
| 239 |
+
\begin{array} { l } { { \displaystyle D ^ { * } = \arg \operatorname* { m a x } _ { D } E _ { ( x ^ { R } , y ) \sim P ^ { R } ( X , Y ) } [ \sum _ { t = 1 } ^ { T } l o g ( P ^ { D } ( x _ { t } ^ { R } | y , x _ { 1 \dots t - 1 } ^ { R } ) ) ] } } \\ { { \displaystyle \qquad + m a x i m u m ( 0 , \beta - E _ { y \sim P ^ { R } ( Y ) , x ^ { G } \sim P ^ { G } ( X | y ) } [ \sum _ { t = 1 } ^ { T } l o g ( P ^ { D } ( x _ { t } ^ { G } | y , x _ { 1 \dots t - 1 } ^ { G } ) ) ] ) } } \end{array}
|
| 240 |
+
$$
|
| 241 |
+
|
| 242 |
+
$$
|
| 243 |
+
G ^ { * } = \arg \operatorname* { m a x } _ { G } E _ { y \sim P ^ { R } ( Y ) , x ^ { G } \sim P ^ { G } ( X | y ) } [ \sum _ { t = 1 } ^ { T } l o g ( P ^ { D } ( x _ { t } ^ { G } | y , x _ { 1 \dots t - 1 } ^ { G } ) ) ] ,
|
| 244 |
+
$$
|
| 245 |
+
|
| 246 |
+
where $P ^ { D } ( x _ { t } ^ { G } | y , x _ { 1 \dots t - 1 } ^ { G } )$ in Equation (11) is the probability of generating $x _ { t } ^ { G }$ given $< y , x _ { 1 \ldots t - 1 } ^ { G } >$ based on the current model , and $\beta$ in Equation (10) is the threshold for preventing the discriminator from distinguishing generated samples from real samples too easily. When the energy of generated samples is too high, the threshold turns off the second term in (10). The results of EBStepGAN is shown in Table 6. According to Table 6, EBStepGAN does not show better performance than StepGAN in our current experiments.
|
| 247 |
+
|
| 248 |
+
Table 6: Results of artificial grammars by EBStepGAN. Please check Table 2 for other results.
|
| 249 |
+
|
| 250 |
+
<table><tr><td colspan="4"> Sequence</td><td colspan="3">Counting</td><td colspan="3">Addition</td></tr><tr><td></td><td>Acc</td><td>AccS</td><td>Cov</td><td>Acc</td><td>AccS</td><td>Cov</td><td>Acc</td><td>AccS</td><td>Cov</td></tr><tr><td>EBStepGAN</td><td>97.32</td><td>80.09</td><td>57.12</td><td>79.78</td><td>71.52</td><td>68.44</td><td>45.74</td><td>32.68</td><td>32.11</td></tr></table>
|
| 251 |
+
|
| 252 |
+
# D APPENDIX: EXAMPLES OF NEURAL DIALOGUE GENERATION
|
| 253 |
+
|
| 254 |
+
Table 7: Examples of neural dialogue generation trained on OpenSubtitles
|
| 255 |
+
|
| 256 |
+
<table><tr><td rowspan=1 colspan=1>Input</td><td rowspan=1 colspan=1>hello,i'm senator snatch</td></tr><tr><td rowspan=1 colspan=1>MLESeqGANMaliGANREGSStepGAN</td><td rowspan=1 colspan=1>i'm sorry .i'm sorry,i'm sorry.i'm a good man . i'm here to see you againsorry you 're late</td></tr><tr><td rowspan=1 colspan=1>Input</td><td rowspan=1 colspan=1>i got the money right here .</td></tr><tr><td rowspan=1 colspan=1>MLESeqGANMaliGANREGSStepGAN</td><td rowspan=1 colspan=1>i'm sorry .i'm here to help .ican.ican 't do it .i'll take you home .</td></tr><tr><td rowspan=1 colspan=1>Input</td><td rowspan=1 colspan=1>hope you enjoyed your pee ..because it ’'s your last on this trip .</td></tr><tr><td rowspan=1 colspan=1>MLESeqGANMaliGANREGSStepGAN</td><td rowspan=1 colspan=1>it 's not a problem . it 's not your fault .it doesn 't matter . it 's not a dream . it 's the only thing i can do .</td></tr><tr><td rowspan=1 colspan=1>Input</td><td rowspan=1 colspan=1>he say ... if you want to be an actor,he has something to show you .</td></tr><tr><td rowspan=1 colspan=1>MLESeqGANMaliGANREGSStepGAN</td><td rowspan=1 colspan=1>you 're not .you can 't do that .what 's he mean ?he 's a very good guy , you know .you 're not gonna be a liar .</td></tr><tr><td rowspan=1 colspan=1>Input</td><td rowspan=1 colspan=1> thank you, thank you .</td></tr><tr><td rowspan=1 colspan=1>MLESeqGANMaliGANREGSStepGAN</td><td rowspan=1 colspan=1>i'm sorry.i'm sorry ,sir .thank you .i'll be right back .you 're welcome .</td></tr><tr><td rowspan=1 colspan=1>Input</td><td rowspan=1 colspan=1>i feel like a paris princess.</td></tr><tr><td rowspan=1 colspan=1>MLESeqGANMaliGANREGSStepGAN</td><td rowspan=1 colspan=1>iknow it .i know that you 're not there .i feel like ..i can 't see it . you 're not a child anymore .</td></tr><tr><td rowspan=1 colspan=1>Input</td><td rowspan=1 colspan=1>i'm tired of all your questions</td></tr><tr><td rowspan=1 colspan=1>MLESeqGANMaliGANREGSStepGAN</td><td rowspan=1 colspan=1>i'm gonna have to ask you to come . i'm gonna call you .i'ma friend. i 'm going to have to ask you to come in i'm going to be a friend of you .</td></tr><tr><td rowspan=1 colspan=1>Input</td><td rowspan=1 colspan=1> it 's great .</td></tr><tr><td rowspan=1 colspan=2>MLE yeah.SeqGAN it 's great, huh ?MaliGAN it 's great .REGS i was just thinking about it .StepGAN you 're so sweet .</td></tr></table>
|
md/train/r1ZdKJ-0W/r1ZdKJ-0W.md
ADDED
|
@@ -0,0 +1,280 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DEEP GAUSSIAN EMBEDDING OF GRAPHS: UNSUPERVISED INDUCTIVE LEARNING VIA RANKING
|
| 2 |
+
|
| 3 |
+
Aleksandar Bojchevski, Stephan Gunnemann ¨ Technical University of Munich, Germany {a.bojchevski,guennemann}@in.tum.de
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Methods that learn representations of nodes in a graph play a critical role in network analysis since they enable many downstream learning tasks. We propose Graph2Gauss – an approach that can efficiently learn versatile node embeddings on large scale (attributed) graphs that show strong performance on tasks such as link prediction and node classification. Unlike most approaches that represent nodes as point vectors in a low-dimensional continuous space, we embed each node as a Gaussian distribution, allowing us to capture uncertainty about the representation. Furthermore, we propose an unsupervised method that handles inductive learning scenarios and is applicable to different types of graphs: plain/attributed, directed/undirected. By leveraging both the network structure and the associated node attributes, we are able to generalize to unseen nodes without additional training. To learn the embeddings we adopt a personalized ranking formulation w.r.t. the node distances that exploits the natural ordering of the nodes imposed by the network structure. Experiments on real world networks demonstrate the high performance of our approach, outperforming state-of-the-art network embedding methods on several different tasks. Additionally, we demonstrate the benefits of modeling uncertainty – by analyzing it we can estimate neighborhood diversity and detect the intrinsic latent dimensionality of a graph.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Graphs are a natural representation for a wide variety of real-life data, from social and rating networks (Facebook, Amazon), to gene interactions and citation networks (BioGRID, arXiv). Node embeddings are a powerful and increasingly popular approach to analyze such data (Cai et al., 2017). By operating in the embedding space, one can employ proved learning techniques and bypass the difficulty of incorporating the complex node interactions. Tasks such as link prediction, node classification, community detection, and visualization all greatly benefit from these latent node representations. Furthermore, for attributed graphs by leveraging both sources of information (network structure and attributes) one is able to learn more useful representations compared to approaches that only consider the graph (Yang et al., 2015; Pan et al., 2016; Ganguly & Pudi, 2017).
|
| 12 |
+
|
| 13 |
+
All existing (attributed) graph embedding approaches represent each node by a single point in a low-dimensional continuous vector space. Representing the nodes simply as points, however, has a crucial limitation: we do not have information about the uncertainty of that representation. Yet uncertainty is inherent when describing a node in a complex graph by a single point only. Imagine a node for which the different sources of information are conflicting with each other, e.g. pointing to different communities or even revealing contradicting underlying patterns. Such discrepancy should be reflected in the uncertainty of its embedding. As a solution to this problem, we introduce a novel embedding approach that represents nodes as Gaussian distributions: each node becomes a full distribution rather than a single point. Thereby, we capture uncertainty about its representation.
|
| 14 |
+
|
| 15 |
+
To effectively capture the non-i.i.d. nature of the data arising from the complex interactions between the nodes, we further propose a novel unsupervised personalized ranking formulation to learn the embeddings. Intuitively, from the point of view of a single node, we want nodes in its immediate neighborhood to be closest in the embedding space, while nodes multiple hops away should become increasingly more distant. This ordering between the nodes imposed by the network structure w.r.t the distances between their embeddings naturally leads to our ranking formulation. Taking into account this natural ranking from each node’s point of view, we learn more powerful embeddings since we incorporate information about the network structure beyond first and second order proximity.
|
| 16 |
+
|
| 17 |
+
Furthermore, when node attributes (e.g. text) are available our method is able to leverage them to easily generate embeddings for previously unseen nodes without additional training. In other words, Graph2Gauss is inductive, which is a significant benefit over existing methods that are inherently transductive and do not naturally generalize to unseen nodes. This desirable inductive property comes from the fact that we are learning an encoder that maps the nodes’ attributes to embeddings.
|
| 18 |
+
|
| 19 |
+
The main contributions of our approach are summarized as follows:
|
| 20 |
+
|
| 21 |
+
a) We embed nodes as Gaussian distributions allowing us to capture uncertainty.
|
| 22 |
+
b) Our unsupervised personalized ranking formulation exploits the natural ordering of the nodes capturing the network structure at multiple scales.
|
| 23 |
+
c) We propose an inductive method that generalizes to unseen nodes and is applicable to different types of graphs: plain/attributed, directed/undirected.
|
| 24 |
+
|
| 25 |
+
# 2 RELATED WORK
|
| 26 |
+
|
| 27 |
+
The focus of this paper is on unsupervised learning of node embeddings for which many different approaches have been proposed. For a comprehensive recent survey see Cai et al. (2017), Hamilton et al. (2017), or Goyal & Ferrara (2017). Approaches such as DeepWalk and node2vec (Perozzi et al., 2014; Grover & Leskovec, 2016) look at plain graphs and learn an embedding based on random walks by extending or adapting the Skip-Gram (Mikolov et al., 2013) architecture. LINE (Tang et al., 2015b) uses first- and second-order proximity and trains the embedding via negative sampling. SDNE (Wang et al., 2016) similarly has a component that preserves second-order proximity and exploits first-order proximity to refine the representations. GraRep (Cao et al., 2015) is a factorization based method that considers local and global structural information.
|
| 28 |
+
|
| 29 |
+
Tri-Party Deep Network Representation (TRIDNR) (Pan et al., 2016) considers node attributes, network structure and potentially node labels. CENE (Sun et al., 2016) similarly to Ganguly & Pudi (2017) treats the attributes as special kinds of nodes and learns embeddings on the augmented network. Text-Associated DeepWalk (TADW) (Yang et al., 2015) performs low-rank matrix factorization considering graph structure and text features. Heterogeneous networks are consider in (Tang et al., 2015a; Chang et al., 2015), while Huang et al. similarly to Pan et al. (2016) considers labels. GraphSAGE (Hamilton et al., 2017) is an inductive method that generates embeddings by sampling and aggregating attributes from a nodes local neighborhood and requires the edges of the new nodes.
|
| 30 |
+
|
| 31 |
+
Graph convolutional networks are another family of approaches that adapt conventional CNNs to graph data (Kipf & Welling, 2016a; Defferrard et al., 2016; Henaff et al., 2015; Monti et al., 2016; Niepert et al., 2016; Pham et al., 2017). They utilize the graph Laplacian and the spectral definition of a convolution and boil down to some form of aggregation over neighbors such as averaging. They can be thought of as implicitly learning an embedding, e.g. by taking the output of the last layer before the supervised component. See Monti et al. (2016) for an overview. In contrast to this paper, most of these methods are (semi-)supervised. The graph variational autoencoder (GAE) (Kipf & Welling, 2016b) is a notable exception that learns node embeddings in an unsupervised manner.
|
| 32 |
+
|
| 33 |
+
Few approaches consider the idea of learning an embedding that is a distribution. Vilnis & McCallum (2014) are the first to learn Gaussian word embeddings to capture uncertainty. Closest to our work, He et al. (2015) represent knowledge graphs and Dos Santos et al. (2016) study heterogeneous graphs for node classification. Both approaches are not applicable for the context of unsupervised learning of (attributed) graphs that we are interested in. The method in He et al. (2015) learns an embedding for each component of the triplets (head, tail, relation) in the knowledge graph. Note that we cannot naively employ this method by considering a single relation ”has an edge” and a single entity ”node”. Since their approach considers similarity between entities and relations, all nodes would be trivially similar to the single relation. Considering the semi-supervised approach proposed in Dos Santos et al. (2016), we cannot simply ”turn off” the supervised component to adapt their method for unsupervised learning, since given the defined loss we would trivially map all nodes to the same Gaussian. Additionally, both of these approaches do not consider node attributes.
|
| 34 |
+
|
| 35 |
+
In this section we introduce our method Graph2Gauss (G2G) and detail how both the attributes and the network structure influence the learning of node representations. The embedding is carried out in two steps: (i) the node attributes are passed through a non-linear transformation via a deep neural network (encoder) and yield the parameters associated with the node’s embedding distribution; (ii) we formulate an unsupervised loss function that incorporates the natural ranking of the nodes as given by the network structure w.r.t. a dissimilarity measure on the embedding distributions.
|
| 36 |
+
|
| 37 |
+
Problem definition. Let $G = \left( \mathbf { A } , \mathbf { X } \right)$ be a directed attributed graph, where $\mathbf { A } \in \mathbb { R } ^ { N \times N }$ is an adjacency matrix representing the edges between $N$ nodes and $\breve { \mathbf { X } } \in \mathbb { R } ^ { N \times D }$ collects the attribute information for each node where $\mathbf { x } _ { i }$ is a $D$ dimensional attribute vector of the $i ^ { t h }$ node.1 $V$ denotes the set of all nodes. We aim to find a lower-dimensional Gaussian distribution embedding $\mathbf { h } _ { i } \ =$ $\textstyle { \mathcal { N } } ( \mu _ { i } , \Sigma _ { i } )$ , $\mu _ { i } \in \mathbb { R } ^ { L } , \Sigma _ { i } \in \mathbb { R } ^ { L \times L }$ with $L \ll N , D$ , such that nodes similar w.r.t. attributes and network structure are also similar in the embedding space given a dissimilarity measure $\Delta ( \mathbf { h } _ { i } , \mathbf { h } _ { j } )$ . In Fig.5(a) for example we show nodes that are embedded as two dimensional Gaussians.
|
| 38 |
+
|
| 39 |
+
# 3.1 NETWORK STRUCTURE REPRESENTATION VIA PERSONALIZED RANKING
|
| 40 |
+
|
| 41 |
+
To capture the structural information of the network in the embedding space, we propose a personalized ranking approach. That is, locally per node $i$ we impose a ranking of all remaining nodes w.r.t. their distance to node $i$ in the embedding space. More precisely, in this paper we exploit the $k$ -hop neighborhoods of each node. Given some anchor node $i$ , we define ${ \cal N } _ { i k } = \{ \bar { j } \in V | i \neq j , \operatorname* { m i n } ( s p ( i , j ) , K ) = k \}$ to be the set of nodes who are exactly $k$ hops away from node $i$ , where $V$ is the set of all nodes, $K$ is a hyper-parameter denoting the maximum distance we are wiling to consider, and $s p ( i , j )$ returns either the length of the shortest path starting at node $i$ and ending in node $j$ or $\infty$ if node $j$ is not reachable.
|
| 42 |
+
|
| 43 |
+
Intuitively, we want all nodes belonging to the 1-hop neighborhood of $i$ to be closer to $i$ w.r.t. their embedding, compared to the all nodes in its 2-hop neighborhood, which in turn are closer than the nodes in its 3-hop neighborhood and so on up to $K$ . Thus, the ranking that we want to ensure from the perspective of node $i$ is
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\Delta ( \mathbf { h } _ { i } , \mathbf { h } _ { k _ { 1 } } ) < \Delta ( \mathbf { h } _ { i } , \mathbf { h } _ { k _ { 2 } } ) < \cdots < \Delta ( \mathbf { h } _ { i } , \mathbf { h } _ { k _ { K } } ) \quad \forall k _ { 1 } \in N _ { i 1 } , \forall k _ { 2 } \in N _ { i 2 } , \dots , \forall k _ { K } \in N _ { i K }
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
or equivalently, we aim to satisfy the following pairwise constraints
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
\Delta ( { \bf h } _ { i } , { \bf h } _ { j } ) < \Delta ( { \bf h } _ { i } , { \bf h } _ { j ^ { \prime } } ) , \forall i \in V , \forall j \in N _ { i k } , \forall j ^ { \prime } \in N _ { i k ^ { \prime } } , \forall k < k ^ { \prime }
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
Going beyond mere first-order and second-order proximity this enables us to capture the network structure at multiple scales incorporating local and global structure.
|
| 56 |
+
|
| 57 |
+
Dissimilarity measure. To solve the above ranking task we have to define a suitable dissimilarity measure between the latent representation of two nodes. Since our latent representations are distributions, similarly to Dos Santos et al. (2016) and He et al. (2015) we employ the asymmetric KL divergence. This gives the additional benefit of handling directed graphs in a sound way. More specifically, given the latent Gaussian distribution representation of two nodes $\mathbf { h } _ { i } , \mathbf { h } _ { j }$ we define
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\Delta ( { \bf h } _ { i } , { \bf h } _ { j } ) = D _ { K L } ( N _ { j } | | \mathcal { N } _ { i } ) = \frac { 1 } { 2 } \bigg [ t r ( \Sigma _ { i } ^ { - 1 } \Sigma _ { j } ) + ( \mu _ { i } - \mu _ { j } ) ^ { T } \Sigma _ { i } ^ { - 1 } ( \mu _ { i } - \mu _ { j } ) - L - l o g \frac { d e t ( \Sigma _ { j } ) } { d e t ( \Sigma _ { i } ) } \bigg ]
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
Here we use the notation $\mu _ { i } , \Sigma _ { i }$ to denote the outputs of some functions $\mu _ { \boldsymbol { \theta } } ( \mathbf { x } _ { i } )$ and $\Sigma _ { \theta } ( \mathbf { x } _ { i } )$ applied to the attributes $\mathbf { x } _ { i }$ of node $i$ and $t r ( . )$ denotes the trace of a matrix. The asymmetric KL divergence also applies to the case of an undirected graph by simply processing both directions of the edge. We could alternatively use a symmetric dissimilarity measure such as the Jensen-Shannon divergence or the expected likelihood (probability product kernel).
|
| 64 |
+
|
| 65 |
+
# 3.2 DEEP ENCODER
|
| 66 |
+
|
| 67 |
+
The functions $\mu _ { \boldsymbol { \theta } } ( \mathbf { x } _ { i } )$ and $\Sigma _ { \theta } ( \mathbf { x } _ { i } )$ are deep feed-forward non-linear neural networks parametrized by $\theta$ . It is important to note that these parameters are shared across instances and thus enjoy statistical strength benefits. Additionally, we design $\mu _ { \boldsymbol { \theta } } ( \mathbf { x } _ { i } )$ and $\Sigma _ { \theta } ( \mathbf { x } _ { i } )$ such that they share parameters as well. More specifically, a deep encoder $f _ { \theta } ( \mathbf { x } _ { i } )$ processes the node’s attributes and outputs an intermediate hidden representation, which is then in turn used to output $\mu _ { i }$ and $\Sigma _ { i }$ in the final layer of the architecture. We focus on diagonal covariance matrices.2 The mapping from the nodes’ attributes to their embedding via the deep encoder is precisely what enables the inductiveness of Graph2Gauss.
|
| 68 |
+
|
| 69 |
+
# 3.3 LEARNING VIA ENERGY-BASED LOSS
|
| 70 |
+
|
| 71 |
+
Since it is intractable to find a solution that satisfies all of the pairwise constraints defined in Sec. 3.1 we turn to an energy based learning approach. The idea is to define an objective function that penalizes ranking errors given the energy of the pairs. More specifically, denoting the KL divergence between two nodes as the respective energy, $E _ { i j } = D _ { K L } ( \mathcal { N } _ { j } | | \mathcal { N } _ { i } )$ , we define the following loss to be optimized
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\mathcal { L } = \sum _ { i } \sum _ { k < l } \sum _ { j _ { k } \in N _ { i k } } \sum _ { j _ { l } \in N _ { i l } } \left( E _ { i j _ { k } } { ^ { 2 } } + \exp ^ { - E _ { i j _ { l } } } \right) = \sum _ { ( i , j _ { k } , j _ { l } ) \in \mathcal { D } _ { t } } \left( E _ { i j _ { k } } { ^ { 2 } } + \exp ^ { - E _ { i j _ { l } } } \right)
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
where $\mathcal { D } _ { t } = \{ ( i , j _ { k } , j _ { l } ) ~ | ~ s p ( i , j _ { k } ) < s p ( i , j _ { l } ) \}$ is the set of all valid triplets. The $E _ { i j _ { k } }$ terms are positive examples whose energy should be lower compared to the energy of the negative examples $E _ { i j _ { l } }$ . Here, we employed the so called square-exponential loss (LeCun et al., 2006) which unlike other typically used losses (e.g. hinge loss) does not have a fixed margin and pushes the energy of the negative terms to infinity with exponentially decreasing force. In our setting, for a given anchor node $i$ , the energy $E _ { i j }$ should be lowest for nodes $j$ in his 1-hop neighborhood, followed by a higher energy for nodes in his 2-hop neighborhood and so on.
|
| 78 |
+
|
| 79 |
+
Finally, we can optimize the parameters $\theta$ of the deep encoder such that the loss $\mathcal { L }$ is minimized and the pairwise rankings are satisfied. Note again that the parameters are shared across all instances, meaning that we share statistical strength and can learn them more easily in comparison to treating the distribution parameters (e.g. $\mu _ { i } , \Sigma _ { i } )$ independently as free variables. The parameters are optimized using Adam (Kingma & Ba, 2014) with a fixed learning rate of 0.001.
|
| 80 |
+
|
| 81 |
+
Sampling strategy. For large graphs, the complete loss is intractable to compute, confirming the need for a stochastic variant. The naive approach would be to sample triplets from $\mathcal { D } _ { t }$ uniformly, i.e. replace $\sum _ { \left( i , j _ { k } , j _ { l } \right) \in { \mathcal { D } } _ { t } }$ with $\mathbb { E } _ { ( i , j _ { k } , j _ { l } ) \sim \mathcal { D } _ { t } }$ in Eq. 1. However, with the naive sampling we are less likely to sample triplets that involve low-degree nodes since high degree nodes occur in many more pairwise constraints. This in turn means that we update the embedding of low-degree nodes less often which is not desirable. Therefore, we propose an alternative node-anchored sampling strategy. Intuitively, for every node $i$ , we randomly sample one other node from each of its neighborhoods (1-hop, 2-hop, etc.) and then optimize over all the corresponding pairwise constraints $( E _ { i 1 } < E _ { i 2 } , \ldots , E _ { i 1 } < E _ { i K } , E _ { i 2 } < E _ { i 3 } , \ldots E _ { i 2 } <$ $\kappa , E _ { i 2 } < E _ { i 3 } , \ldots E _ { i 2 } < E _ { i K } , \ldots , E _ { i K - 1 } < E _ { i K } )$ .
|
| 82 |
+
|
| 83 |
+
Naively applying the node-anchored sampling strategy and optimizing Eq. 1, however, would lead to biased estimates of the gradient. Theorem 1 shows how to adapt the loss such that it is equal in expectation to the original loss under our new sampling strategy. As a consequence, we have unbiased estimates of the gradient using stochastic optimization of the reformulated loss.
|
| 84 |
+
|
| 85 |
+
Theorem 1 For all $i$ , let $( j _ { 1 } , \dots , j _ { K } )$ be independent uniform random samples from the sets $( N _ { i 1 } , \dots , N _ { i K } )$ and $| N _ { i * } |$ the cardinality of each set. Then $\mathcal { L }$ is equal in expectation to
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\mathcal { L } _ { s } = \sum _ { i } \mathbb { E } _ { ( j _ { 1 } , \dots , j _ { K } ) \sim ( N _ { i 1 } , \dots , N _ { i K } ) } \left[ \sum _ { k < l } \vert N _ { i k } \vert \cdot \vert N _ { i l } \vert \cdot \left( E _ { i j _ { k } } ^ { \phantom { - } } + \exp ^ { - E _ { i j _ { l } } } \right) \right] = \mathcal { L }
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
We provide the proof in the appendix. For cases where the number of nodes $N$ is particularly large we can further subsample mini-batches, by selecting anchor nodes $i$ at random. Furthermore, in our experimental study, we analyze the effect of the sampling strategy on convergence, as well as the quality of the stochastic variant w.r.t. the obtained solution and the reached local optima.
|
| 92 |
+
|
| 93 |
+
# 3.4 DISCUSSION
|
| 94 |
+
|
| 95 |
+
Inductive learning. While during learning we need both the network structure (to evaluate the ranking loss) and the attributes, once the learning concludes, the embedding for a node can be obtained solely based on its attributes. This enables our method to easily handle the issue of obtaining representations for new nodes that were not part of the network during training. To do so we simply pass the attributes of the new node through our learned deep encoder. Most approaches cannot handle this issue at all, with a notable exception being SDNE and GraphSAGE (Wang et al., 2016; Hamilton et al., 2017). However, both approaches require the edges of the new node to get the node’s representation, and cannot handle nodes that have no existing connections. In contrast, our method can handle even such nodes, since after the model is learned we rely only on the attribute information.
|
| 96 |
+
|
| 97 |
+
Plain graph embedding. Even though attributed graphs are often found in the real-world, sometimes it is desirable to analyze plain graphs. As already discussed, our method easily handles plain graphs, when the attributes are not available, by using one-hot encoding of the nodes instead. As we later show in the experiments we are able to learn useful representations in this scenario, even outperforming some attributed approaches. Naturally, in this case we lose the inductive ability to handle unseen nodes. We compare the one-hot encoding version, termed G2G oh, with our full method G2G that utilizes the attributes, as well as all remaining competitors.
|
| 98 |
+
|
| 99 |
+
Encoder architecture. Depending on the type of the node attributes (e.g. images, text) we could in principle use CNNs/RNNs to process them. We could also easily incorporate any of the proposed graph convolutional layers inheriting their benefits. However, we observe that in practice using simple feed-forward architecture with rectifier units is sufficient, while being much faster and easier to train. Better yet, we observed that Graph2Gauss is not sensitive to the choice of hyperparameters such as number and size of hidden layers. We provide more detailed information and sensible defaults in the appendix.
|
| 100 |
+
|
| 101 |
+
Complexity. The time complexity for computing the original loss is $O ( N ^ { 3 } )$ where $N$ is the number of nodes. Using our node-anchored sampling strategy, the complexity of the stochastic version is $O ( K ^ { 2 } N )$ where $K$ is the maximum distance considered. Since a small value of $K \leq 2$ consistently showed good performance, $K ^ { 2 }$ becomes negligible and thus the complexity is $O ( N )$ , meaning linear in the number of nodes. This coupled with the small number of epochs $T$ needed for convergence $T \leq 2 0 0 0$ for all shown experiments, see e.g. Fig. 3(b)) and an efficient GPU implementation also made our method faster than most competitors in terms of wall-clock time.
|
| 102 |
+
|
| 103 |
+
# 4 EMBEDDING EVALUATION
|
| 104 |
+
|
| 105 |
+
We compare Graph2Gauss with and without considering attributes (G2G, G2G oh) to several competitors namely: TRIDNR and TADW (Pan et al., 2016; Yang et al., 2015) as representatives that consider attributed graphs, GAE (Kipf & Welling, 2016b) as the unsupervised graph convolutional representative, and node2vec (Grover & Leskovec, 2016) as a representative of the random walk based plain graph embeddings. Additionally, we include a strong Logistic Regression baseline that considers only the attributes. As with all other methods we train TRIDNR in a unsupervised manner, however, since it can only process raw text as attributes (rather than e.g. bag-of-words) it is not always applicable. Furthermore, since TADW, and GAE only support undirected graphs we must symmetrize the graph before using them – giving them a substantial advantage, especially in the link prediction task. Moreover, in all experiments if the competing techniques use an $L$ dimensional embedding, G2G’s embedding is actually only half of this dimensionality so that the overall number of ’parameters’ per node (mean vector $^ +$ variance terms of the diagonal $\Sigma _ { i }$ ) matches $L$ .
|
| 106 |
+
|
| 107 |
+
Dataset description. We use several attributed graph datasets. Cora (McCallum et al., 2000) is a well-known citation network labeled based on the paper topic. While most approaches report on a small subset of this dataset we additionally extract from the original data the entire network and name these two datasets CORA $( N = 1 9 7 9 3 , E = 6 5 3 1 1 , D = 8 7 1 0 , K = 7 0 )$ and CORA-ML $( N = 2 9 9 5 , E = 8 4 1 6 , D = 2 8 7 9 , K = 7 )$ respectively. CITESEER $( N = 4 2 3 0 , E = 5 3 5 8 , D =$ $2 7 0 1 , K = 6 )$ (Giles et al., 1998), DBLP (Pan et al., 2016) $( N = 1 7 7 1 6 , E = 1 0 5 7 3 4 , D =$ 1639, $K = 4$ ) and PUBMBED $( N = 1 8 2 3 0 , E = 7 9 6 1 2 , D = 5 0 0 , K = 3 )$ (Sen et al., 2008) are other commonly used citation datasets. We provide all datasets, the source code of G2G, and further supplementary material (https://www.kdd.in.tum. $\mathrm { d e } / \mathrm { g } 2 \mathrm { g } )$ ).
|
| 108 |
+
|
| 109 |
+
# 4.1 LINK PREDICTION
|
| 110 |
+
|
| 111 |
+
Setup. Link prediction is a commonly used task to demonstrate the meaningfulness of the embeddings. To evaluate the performance we hide a set of edges/non-edges from the original graph and train on the resulting graph. Similarly to Kipf & Welling (2016b) and Wang et al. (2016) we create a validation/test set that contains $5 \% / 1 0 \%$ randomly selected edges respectively and equal number of randomly selected non-edges.We used the validation set for hyper-parameter tuning and early stopping and the test set only to report the performance. As by convention we report the area under the ROC curve (AUC) and the average precision (AP) scores for each method. To rank the candidate edges we use the negative energy $- E _ { i j }$ for Graph2Gauss, and the exact same approach as in the respective original methods (e.g. dot product of the embeddings).
|
| 112 |
+
|
| 113 |
+
Performance on real-world datasets. Table 1 shows the performance on the link prediction task for different datasets and embedding size $L = 1 2 8$ . As we can see our method significantly outperforms the competitors across all datasets which is a strong sign that the learned embeddings are useful. Furthermore, even the constrained version of our method G2G oh that does not consider attributes at all outperforms the competitors on some datasets. While GAE achieves comparable performance on some of the datasets their approach doesn’t scale to large graphs. In fact, for graphs beyond $1 5 K$ nodes we had to revert to slow training on the CPU since the data did not fit on the GPU memory (12GB). The simple Logistic Regression baseline showed surprisingly strong performance, even outperforming some of the more complicated methods.
|
| 114 |
+
|
| 115 |
+
Table 1: Link prediction performance for real-world datasets with $L = 1 2 8$
|
| 116 |
+
|
| 117 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">Cora-ML</td><td colspan="2">Cora</td><td colspan="2">Citeseer</td><td colspan="2">DBLP</td><td colspan="2">Pubmed</td><td colspan="2">Cora-ML Easy</td></tr><tr><td>AUC</td><td>AP</td><td>AUC</td><td>AP</td><td>AUC</td><td>AP</td><td>AUC</td><td>AP</td><td>AUC</td><td>AP</td><td>AUC</td><td>AP</td></tr><tr><td>Logistic Regression</td><td>90.01</td><td>89.75</td><td>86.58</td><td>86.51</td><td>81.70</td><td>79.10</td><td>82.04</td><td>81.91</td><td>90.50</td><td>90.99</td><td>90.28</td><td>90.99</td></tr><tr><td>node2vec(Grover & Leskovec,2016)</td><td>76.80</td><td>75.26</td><td>79.95</td><td>78.98</td><td>83.04</td><td>83.74</td><td>95.42</td><td>95.33</td><td>95.42</td><td>95.33</td><td>93.47</td><td>93.53</td></tr><tr><td>TADW(Yang et al., 2015)</td><td>81.26</td><td>81.34</td><td>76.56</td><td>78.06</td><td>70.14</td><td>72.93</td><td>65.67</td><td>59.85</td><td>62.72</td><td>68.02</td><td>83.53</td><td>82.47</td></tr><tr><td>TRIDNR(Pan et al., 2016)</td><td>84.51</td><td>85.69</td><td>81.61</td><td>81.08</td><td>87.23</td><td>88.87</td><td>92.01</td><td>91.62</td><td>NTA</td><td>NTA</td><td>85.59</td><td>86.16</td></tr><tr><td>GAE(Kipf & Welling,2016b)</td><td>96.65</td><td>96.67</td><td>97.91</td><td>98.07</td><td>92.31</td><td>93.88</td><td>95.78</td><td>96.67</td><td>96.07</td><td>96.12</td><td>95.97</td><td>95.17</td></tr><tr><td>G2G_oh</td><td>96.95</td><td>97.54</td><td>98.41</td><td>98.63</td><td>95.89</td><td>95.78</td><td>98.29</td><td>98.46</td><td>96.75</td><td>96.47</td><td>96.98</td><td>96.42</td></tr><tr><td>G2G</td><td>98.01</td><td>98.03</td><td>98.81</td><td>98.78</td><td>96.09</td><td>96.16</td><td>98.65</td><td>98.78</td><td>97.42</td><td>97.85</td><td>98.03</td><td>98.12</td></tr></table>
|
| 118 |
+
|
| 119 |
+
We also include the performance on the so called ”Cora-ML Easy” dataset, obtained from the CoraML dataset by making it undirected and selecting the nodes in the largest connected component. We see that while node2vec struggles on the original real-world data, it significantly improves in this ”easy” setting. On the contrary, Graph2Gauss handles both settings effortlessly. This demonstrates that Graph2Gauss can be readily applied in realistic scenarios on potentially messy real-world data.
|
| 120 |
+
|
| 121 |
+
Sensitivity analysis. In Figs.1(a) and 1(b) we show the performance w.r.t. the dimensionality of the embedding, averaged over 10 trials. G2G is able to learn useful embeddings with strong performance even for relatively small embedding sizes. Even for the case $L = 2$ , where we embed the points as one dimensional Gaussian distributions $( L = 1 + 1$ for the mean and the sigma of the Gaussian), G2G still outperforms all of the competitors irrespective of their much higher embedding sizes.
|
| 122 |
+
|
| 123 |
+

|
| 124 |
+
Figure 1: Link prediction performance for different embedding sizes and percentages of training edges on Cora-ML. G2G outperforms the competitors even for small sizes and percentage of edges.
|
| 125 |
+
|
| 126 |
+
Finally, we evaluate the performance w.r.t. the percentage of training edges varying from $1 5 \%$ to $8 5 \%$ , averaged over 10 trials. We can see in Figs.1(c) and 1(d) Graph2Gauss strongly outperforms the competitors, especially for small number of training edges. The dashed line indicates the percentage above which we can guarantee to have every node appear at least once in the training set.3 The performance below that line is then indicative of the performance in the inductive setting. Since, the structure only methods are unable to compute meaningful embeddings for unseen nodes we cannot report their performance below the dashed line.
|
| 127 |
+
|
| 128 |
+
# 4.2 NODE CLASSIFICATION
|
| 129 |
+
|
| 130 |
+
Setup. Node classification is another task commonly used to evaluate the strength of the learned embeddings – after they have been trained in an unsupervised manner. We evaluate the node classification performance for three datasets (Cora-ML, Citeseer and DBLP) that have ground-truth classes. First, we train the embeddings on the entire training data in an unsupervised manner (excluding the class labels). Then, following Perozzi et al. (2014) we use varying percentage of randomly selected nodes and their learned embeddings along with their labels as training data for a logistic regression, while evaluating the performance on the rest of the nodes. We also optimize the regularization strength for each method/dataset via cross-validation. We show results averaged over 10 trials.
|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
Figure 2: Classification performance comparison - both G2G and G2G oh perform strongly.
|
| 134 |
+
|
| 135 |
+
Performance on real-world datasets. Figs. 2 compares the methods w.r.t. the classification performance for different percentage of labeled nodes. We can see that our method clearly outperforms the competitors. Again, the constrained version of our method that does not consider attributes is able to outperform some of the competing approaches. Additionally, we can conclude that in general our method shows stable performance regardless of the percentage of labeled nodes. This is a highly desirable property since it shows that should we need to perform classification it is sufficient to train only on a small percentage of labeled nodes.
|
| 136 |
+
|
| 137 |
+
# 4.3 SAMPLING STRATEGY
|
| 138 |
+
|
| 139 |
+
Figure 3(a) shows the validation set ROC score for the link prediction task w.r.t. the number of triplets $( i , j _ { k } , j _ { l } )$ seen. We can see that both sampling strategies are able to reach the same performance as the full loss in significantly fewer $( < 4 . 2 \%$ ) number of pairs seen (note the log scale). It also shows that the naive random sampling converges slower than the node-anchored sampling strategy. Figures 3(b) gives us some insight as to why – our node-anchored sampling strategy achieves significantly lower loss. Finally, Fig. 3(c) shows that our node-anchored sampling strategy has lower variance of the gradient updates, which is another contributor to faster convergence.
|
| 140 |
+
|
| 141 |
+

|
| 142 |
+
Figure 3: Our sampling strategy converges significantly faster than the full loss, while maintaining good performance. It also achieves better loss and has lower variance compared to naive sampling.
|
| 143 |
+
|
| 144 |
+
Learning an embedding that is a distribution rather than a point-vector allows us to capture uncertainty about the representation. We perform several experiments to evaluate the benefit of modeling uncertainty. Figure 4(a) shows that the learned uncertainty is correlated with neighborhood diversity, where for a node $i$ we define diversity as the number of distinct classes among the nodes in its $p$ -hop neighborhood $\textstyle ( \bigcup _ { 1 \leq k \leq p } N _ { i k } )$ . Since the uncertainty for a node $i$ is an $L$ -dimensional vector (diagonal covariance) we show the average across the dimensions. In line with our intuition, nodes with less diverse neighborhood have significantly lower variance compare to more diverse nodes whose immediate neighbors belong to many different classes, thus making their embedding more uncertain. The figure shows the result on the Cora dataset for $p = 3$ hop neighborhood. Similar results hold for the other datasets. This result is particularly impressive given the fact that we learn our embedding in a completely unsupervised manner, yet the uncertainty was able to capture the diversity w.r.t. the class labels of the neighbors of a node, which were never seen during training.
|
| 145 |
+
|
| 146 |
+

|
| 147 |
+
Figure 4: The benefit of modeling the uncertainty of the nodes.
|
| 148 |
+
|
| 149 |
+
Figure 4(b) shows that using the learned uncertainty we are able to detect the intrinsic latent dimensionality of the graph. Each line represents the average variance (over all nodes) for a given dimension $l$ for each epoch. We can see that as the training progresses past the stopping criterion (link prediction performance on validation set) and we start to overfit, some dimensions exhibit a relatively stable average variance, while for others the variance increases with each epoch. By creating a simply rule that monitors the average change of the variance over time we were able to automatically detect these relevant latent dimensions (colored in red). This result holds for multiple datasets and is shown here for Cora-ML. Interestingly, the number of detected latent dimensions (6) is close to the number of ground-truth communities (7).
|
| 150 |
+
|
| 151 |
+
The next obvious question is then how does the performance change if we remove these highly uncertain dimensions whose variance keeps increasing with training. Figure 4(c) answers exactly that. By removing progressively more and more dimensions, starting with the most uncertain first we see imperceptibly small change in performance. Only once we start removing the true latent dimension we see a noticeable degradation in performance. The dashed lines show the performance if we re-train the model, setting $L = 6$ , equal to the detected number of latent dimensions.
|
| 152 |
+
|
| 153 |
+
As a last study of uncertainty, in a use case analysis, the nodes with high uncertainty reveal additional interesting patterns. For example in the Cora dataset, one of the highly uncertain nodes was the paper ”The use of word shape information for cursive script recognition” by R.J. Whitrow – surprisingly, all citations (edges) of that paper (as extracted from the dataset) were towards other papers by the same author.
|
| 154 |
+
|
| 155 |
+
# 4.5 INDUCTIVE LEARNING: GENERALIZATION TO UNSEEN NODES
|
| 156 |
+
|
| 157 |
+
As discussed in Sec. 3.4 G2G is able to learn embeddings even for nodes that were not part of the networks structure during training time. Thus, it not only supports transductive but also inductive learning. To evaluate how our approach generalizes to unseen nodes we perform the following experiment: (i) first we completely hide $1 0 \% / 2 5 \%$ of nodes from the network at random; (ii) we proceed to learn the node embeddings for the rest of the nodes; (iii) after learning is complete we pass the (new) unseen test nodes through our deep encoder to obtain their embedding; (iv) we evaluate by calculating the link prediction performance (AUC and AP scores) using all their edges and same number of non-edges.
|
| 158 |
+
|
| 159 |
+
Table 2: Inductive link prediction performance.
|
| 160 |
+
|
| 161 |
+
<table><tr><td rowspan="2">Method (% hidden)</td><td colspan="2">Cora-ML</td><td colspan="2">Cora</td><td colspan="2">Citeseer</td><td colspan="2">DBLP</td><td colspan="2">Pubmed</td></tr><tr><td>AUC</td><td>AP</td><td>AUC</td><td>AP</td><td>AUC</td><td>AP</td><td>AUC</td><td>AP</td><td>AUC</td><td>AP</td></tr><tr><td>Log.Reg.10%</td><td>75.95</td><td>78.62</td><td>78.53</td><td>78.70</td><td>73.09</td><td>72.54</td><td>67.55</td><td>69.55</td><td>86.83</td><td>87.34</td></tr><tr><td>G2G 10%</td><td>90.93</td><td>89.37</td><td>94.18</td><td>93.40</td><td>88.58</td><td>88.31</td><td>85.06</td><td>83.75</td><td>92.22</td><td>90.45</td></tr><tr><td>G2G 25%</td><td>87.83</td><td>86.31</td><td>92.96</td><td>92.31</td><td>87.30</td><td>86.61</td><td>83.09</td><td>81.49</td><td>90.20</td><td>88.28</td></tr></table>
|
| 162 |
+
|
| 163 |
+
As the results in Table 2 clearly show, since we are utilizing the rich attribute information, we are able to achieve strong performance for unseen nodes. This is true even when a quarter of the nodes are missing. This makes our method applicable in the context of large graphs where training on the entire network is not feasible. Note that SDNE (Wang et al., 2016) and GraphSAGE (Hamilton et al., 2017) cannot be applied in this scenario, since they also require the edges for the unseen nodes to produce an embedding. Graph2Gauss is the only inductive method that can obtain embeddings for a node based only on the node attributes.
|
| 164 |
+
|
| 165 |
+
# 4.6 NETWORK VISUALIZATION
|
| 166 |
+
|
| 167 |
+
One key application of node embedding approaches is creating meaningful visualizations of a network in 2D/3D that support tasks such as data exploration and understanding. Following Tang et al. (2015b) and Pan et al. (2016) we first learn a lower-dimensional $L = 1 2 8$ embedding for each node and then map those representations in 2D with TSNE (Maaten & Hinton, 2008). Additionally, since our method is able to learn useful representations even in low dimensions we embed the nodes as 2D Gaussians and visualize the resulting embedding. This has the added benefit of visualizing the nodes’ uncertainty as well. Fig. 5 shows the visualization for the Cora-ML dataset. We see that Graph2Gauss learns an embedding in which the different classes are clearly separated.
|
| 168 |
+
|
| 169 |
+

|
| 170 |
+
Figure 5: 2D visualization of the embeddings on the Cora-ML dataset. Color indicates the class label not used during training. Best viewed on screen.
|
| 171 |
+
|
| 172 |
+
# 5 CONCLUSION
|
| 173 |
+
|
| 174 |
+
We proposed Graph2Gauss – the first unsupervised approach that represents nodes in attributed graphs as Gaussian distributions and is therefore able to capture uncertainty. Analyzing the uncertainty reveals the latent dimensionality of a graph and gives insight into the neighborhood diversity of a node. Since we exploit the attribute information of the nodes we can effortlessly generalize to unseen nodes, enabling inductive reasoning. Graph2Gauss leverages the natural ordering of the nodes w.r.t. their neighborhoods via a personalized ranking formulation. The strength of the learned embeddings has been demonstrated on several tasks – specifically achieving high link prediction performance even in the case of low dimensional embeddings. As future work we aim to study personalized rankings beyond the ones imposed by the shortest path distance.
|
| 175 |
+
|
| 176 |
+
# ACKNOWLEDGMENTS
|
| 177 |
+
|
| 178 |
+
This research was supported by the German Research Foundation, Emmy Noether grant GU 1409/2- 1, and by the Technical University of Munich - Institute for Advanced Study, funded by the German Excellence Initiative and the European Union Seventh Framework Programme under grant agreement no 291763, co-funded by the European Union.
|
| 179 |
+
|
| 180 |
+
# REFERENCES
|
| 181 |
+
|
| 182 |
+
Hongyun Cai, Vincent W Zheng, and Kevin Chen-Chuan Chang. A comprehensive survey of graph embedding: Problems, techniques and applications. arXiv preprint arXiv:1709.07604, 2017.
|
| 183 |
+
|
| 184 |
+
Shaosheng Cao, Wei Lu, and Qiongkai Xu. Grarep: Learning graph representations with global structural information. In Proceedings of the 24th ACM International on Conference on Information and Knowledge Management, pp. 891–900. ACM, 2015.
|
| 185 |
+
|
| 186 |
+
Shiyu Chang, Wei Han, Jiliang Tang, Guo-Jun Qi, Charu C Aggarwal, and Thomas S Huang. Heterogeneous network embedding via deep architectures. In Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 119–128. ACM, 2015.
|
| 187 |
+
|
| 188 |
+
Michael Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks ¨ on graphs with fast localized spectral filtering. In Advances in Neural Information Processing Systems, pp. 3837–3845, 2016.
|
| 189 |
+
|
| 190 |
+
Ludovic Dos Santos, Benjamin Piwowarski, and Patrick Gallinari. Multilabel classification on heterogeneous graphs with gaussian embeddings. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 606–622. Springer, 2016.
|
| 191 |
+
|
| 192 |
+
Soumyajit Ganguly and Vikram Pudi. Paper2vec: Combining graph and text information for scientific paper representation. In European Conference on Information Retrieval, pp. 383–395. Springer, 2017.
|
| 193 |
+
|
| 194 |
+
C Lee Giles, Kurt D Bollacker, and Steve Lawrence. Citeseer: An automatic citation indexing system. In Proceedings of the third ACM conference on Digital libraries, pp. 89–98. ACM, 1998.
|
| 195 |
+
|
| 196 |
+
Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, pp. 249–256, 2010.
|
| 197 |
+
|
| 198 |
+
Palash Goyal and Emilio Ferrara. Graph embedding techniques, applications, and performance: A survey. arXiv preprint arXiv:1705.02801, 2017.
|
| 199 |
+
|
| 200 |
+
Aditya Grover and Jure Leskovec. node2vec: Scalable feature learning for networks. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 855–864. ACM, 2016.
|
| 201 |
+
|
| 202 |
+
W. L. Hamilton, R. Ying, and J. Leskovec. Representation Learning on Graphs: Methods and Applications. ArXiv e-prints, September 2017.
|
| 203 |
+
|
| 204 |
+
William L Hamilton, Rex Ying, and Jure Leskovec. Inductive representation learning on large graphs. arXiv preprint arXiv:1706.02216, 2017.
|
| 205 |
+
|
| 206 |
+
Shizhu He, Kang Liu, Guoliang Ji, and Jun Zhao. Learning to represent knowledge graphs with gaussian embedding. In Proceedings of the 24th ACM International on Conference on Information and Knowledge Management, pp. 623–632. ACM, 2015.
|
| 207 |
+
|
| 208 |
+
Mikael Henaff, Joan Bruna, and Yann LeCun. Deep convolutional networks on graph-structured data. arXiv preprint arXiv:1506.05163, 2015.
|
| 209 |
+
|
| 210 |
+
Xiao Huang, Jundong Li, and Xia Hu. Label informed attributed network embedding.
|
| 211 |
+
|
| 212 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 213 |
+
|
| 214 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016a.
|
| 215 |
+
|
| 216 |
+
Thomas N Kipf and Max Welling. Variational graph auto-encoders. arXiv preprint arXiv:1611.07308, 2016b.
|
| 217 |
+
|
| 218 |
+
Yann LeCun, Sumit Chopra, Raia Hadsell, M Ranzato, and F Huang. A tutorial on energy-based learning. Predicting structured data, 1:0, 2006.
|
| 219 |
+
|
| 220 |
+
Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of Machine Learning Research, 9(Nov):2579–2605, 2008.
|
| 221 |
+
|
| 222 |
+
Andrew Kachites McCallum, Kamal Nigam, Jason Rennie, and Kristie Seymore. Automating the construction of internet portals with machine learning. Information Retrieval, 3(2):127–163, 2000.
|
| 223 |
+
|
| 224 |
+
Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781, 2013.
|
| 225 |
+
|
| 226 |
+
Federico Monti, Davide Boscaini, Jonathan Masci, Emanuele Rodola, Jan Svoboda, and Michael M \` Bronstein. Geometric deep learning on graphs and manifolds using mixture model cnns. arXiv preprint arXiv:1611.08402, 2016.
|
| 227 |
+
|
| 228 |
+
Mathias Niepert, Mohamed Ahmed, and Konstantin Kutzkov. Learning convolutional neural networks for graphs. In Proceedings of the 33rd annual international conference on machine learning. ACM, 2016.
|
| 229 |
+
|
| 230 |
+
Shirui Pan, Jia Wu, Xingquan Zhu, Chengqi Zhang, and Yang Wang. Tri-party deep network representation. Network, 11(9):12, 2016.
|
| 231 |
+
|
| 232 |
+
Bryan Perozzi, Rami Al-Rfou, and Steven Skiena. Deepwalk: Online learning of social representations. In Proceedings of the 20th ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 701–710. ACM, 2014.
|
| 233 |
+
|
| 234 |
+
Trang Pham, Truyen Tran, Dinh Q Phung, and Svetha Venkatesh. Column networks for collective classification. In AAAI, pp. 2485–2491, 2017.
|
| 235 |
+
|
| 236 |
+
Prithviraj Sen, Galileo Namata, Mustafa Bilgic, Lise Getoor, Brian Galligher, and Tina Eliassi-Rad. Collective classification in network data. AI magazine, 29(3):93, 2008.
|
| 237 |
+
|
| 238 |
+
Xiaofei Sun, Jiang Guo, Xiao Ding, and Ting Liu. A general framework for content-enhanced network representation learning. arXiv preprint arXiv:1610.02906, 2016.
|
| 239 |
+
|
| 240 |
+
Jian Tang, Meng Qu, and Qiaozhu Mei. Pte: Predictive text embedding through large-scale heterogeneous text networks. In Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 1165–1174. ACM, 2015a.
|
| 241 |
+
|
| 242 |
+
Jian Tang, Meng Qu, Mingzhe Wang, Ming Zhang, Jun Yan, and Qiaozhu Mei. Line: Large-scale information network embedding. In Proceedings of the 24th International Conference on World Wide Web, pp. 1067–1077. ACM, 2015b.
|
| 243 |
+
|
| 244 |
+
Luke Vilnis and Andrew McCallum. Word representations via gaussian embedding. arXiv preprint arXiv:1412.6623, 2014.
|
| 245 |
+
|
| 246 |
+
Daixin Wang, Peng Cui, and Wenwu Zhu. Structural deep network embedding. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 1225–1234. ACM, 2016.
|
| 247 |
+
|
| 248 |
+
Cheng Yang, Zhiyuan Liu, Deli Zhao, Maosong Sun, and Edward Y Chang. Network representation learning with rich text information. In IJCAI, pp. 2111–2117, 2015.
|
| 249 |
+
|
| 250 |
+
# APPENDIX
|
| 251 |
+
|
| 252 |
+
A PROOF OF THEOREM 1
|
| 253 |
+
|
| 254 |
+
To prove Theorem 1 we start with the loss $\mathcal { L } _ { s }$ (Eq. 2), and show that by applying the expectation operator we will obtain the original loss $\mathcal { L }$ (Eq. 1). From there it trivially follows that taking the gradient with respect to $\mathcal { L } _ { s }$ for a set of samples gives us an unbiased estimate of the gradient of $\mathcal { L }$ .
|
| 255 |
+
|
| 256 |
+
First we notice that both $\mathcal { L }$ and $\mathcal { L } _ { s }$ are summing over $i$ , thus it is sufficient to show that the losses are equal in expectation for a single node $i$ . Denoting with $\mathcal { L } _ { s } ^ { ( i ) }$ the loss for a single node $i$ and with $E _ { i , k , l } = E _ { i j _ { k } } { } ^ { 2 } + \exp ^ { - E _ { i j _ { l } } }$ for notational convenience we have:
|
| 257 |
+
|
| 258 |
+
$$
|
| 259 |
+
\begin{array} { r l } & { \| \nabla _ { x } ^ { \bot } \varphi \| _ { L ^ { 2 } ( \mathcal H _ { 1 } ) } ^ { 2 } = \frac { 1 } { \lambda _ { x } ^ { 2 } } \sum _ { t _ { i } ^ { \prime } \in \mathcal H _ { 1 } } ^ { 1 } \lambda _ { t _ { i } ^ { \prime } } \sum _ { \lambda _ { x } ^ { \prime } } ^ { \lambda _ { \prime } } \lambda _ { t _ { i } ^ { \prime } } \Big | \nabla _ { x } ^ { \bot } \varphi \Big | _ { L ^ { 2 } ( \mathcal H _ { 1 } ) } ^ { 2 } } \\ & { \quad - \frac { 1 } { \lambda _ { x } ^ { 2 } } \sum _ { t _ { i } ^ { \prime } \in \mathcal H _ { 1 } } \lambda _ { t _ { i } ^ { \prime } } \sum _ { \lambda _ { x } ^ { \prime } } \lambda _ { t _ { i } ^ { \prime } } \Big | \nabla _ { x } \varphi \Big | _ { L ^ { 2 } ( \mathcal H _ { 1 } ) } ^ { 2 } \cdot \nabla _ { x } \varphi \Big | _ { L ^ { 2 } ( \mathcal H _ { 1 } ) } ^ { 2 } } \\ & { \quad + \frac { 1 } { \lambda _ { x } ^ { 2 } } \sum _ { t _ { i } ^ { \prime } \in \mathcal H _ { 1 } } \lambda _ { t _ { i } ^ { \prime } } \sum _ { \lambda _ { x } ^ { \prime } } \lambda _ { t _ { i } ^ { \prime } } \Big | \nabla _ { x } \varphi \Big | _ { L ^ { 2 } ( \mathcal H _ { 1 } ) } ^ { 2 } \cdot \nabla _ { x } \varphi \Big | _ { L ^ { 2 } ( \mathcal H _ { 1 } ) } ^ { 2 } \cdot \nabla _ { x } \varphi \Big | _ { L ^ { 2 } ( \mathcal H _ { 1 } ) } ^ { 2 } } \\ & { \quad - \frac { 1 } { \lambda _ { x } ^ { 2 } } \sum _ { t _ { i } ^ { \prime } \in \mathcal H _ { 1 } } \lambda _ { t _ { i } ^ { \prime } } \Big | \nabla _ { x } \varphi \Big | _ { L ^ { 2 } ( \mathcal H _ { 1 } ) } ^ { 2 } \cdot \nabla _ { x } \varphi \Big | _ { L ^ { 2 } ( \mathcal H _ { 1 } ) } ^ { 2 } } \\ & \quad - \frac { 1 } { \lambda _ { x } ^ { 2 } } \sum _ { t _ { i } ^ { \prime } \in \mathcal H _ { 1 } } \lambda _ { t _ { i } ^ { \prime } } \Big | \nabla _ { x } \varphi \Big | _ L ^ \end{array}
|
| 260 |
+
$$
|
| 261 |
+
|
| 262 |
+
In step (1) we have expanded the sum over $k \ < \ l$ in independent terms. In step (2) we have marginalized the expectation over the variables that do not appear in the expression, e.g. for the term $\mathbb { E } _ { ( j _ { 1 } , . . . , j _ { K } ) \sim ( N _ { i 1 } , . . . , N _ { i K } ) } | N _ { i 1 } | \cdot | N _ { i 2 } | \cdot E _ { i 1 2 }$ we can marginalize over $j _ { p }$ where $p \neq 1$ and $p \neq 2$ since the term doesn’t depend on them. In step (3) we have expanded the expectation term. In step (4) we have substituted $p ( j _ { p } )$ with $\frac { 1 } { | N _ { i j p } | }$ since we are sampling uniformly at random.
|
| 263 |
+
|
| 264 |
+
Since $\mathcal { L } _ { s } ^ { ( i ) }$ is equal to $\mathcal { L } ^ { ( i ) }$ in expectation it follows that $\nabla { \mathcal { L } } _ { s }$ based on a set of samples is an unbiased estimate of $\nabla \mathcal { L }$ .
|
| 265 |
+
|
| 266 |
+
# B IMPLEMENTATION DETAILS
|
| 267 |
+
|
| 268 |
+
Architecture and hyperparameters. We observed that Graph2Gauss is not sensitive to the choice of hyperparameters such as number and size of hidden layers. Better yet, as shown in Sec. 4.4, Graphs2Gauss is also not sensitive to the size of the embedding $L$ . Thus, for a new graph, one can simply pick a relatively large embedding size and if required prune it later similarly to the analysis performed in Fig. 4(c).
|
| 269 |
+
|
| 270 |
+
As a sensible default we recommend an encoder with a single hidden layer of size $s _ { 1 } = 5 1 2$ . More specifically, to obtain the embeddings for a node $i$ we have
|
| 271 |
+
|
| 272 |
+
$$
|
| 273 |
+
\mathbf { h } _ { i } = \mathrm { r e l u } ( \mathbf { X } _ { i } \mathbf { W } + \mathbf { b } ) \qquad \mu _ { i } = \mathbf { h } _ { \mathbf { i } } \mathbf { W } _ { \mu } + \mathbf { b } _ { \mu } \qquad \sigma _ { i } = \mathrm { e l u } ( \mathbf { h } _ { i } \mathbf { W } _ { \Sigma } + \mathbf { b } _ { \Sigma } ) + 1
|
| 274 |
+
$$
|
| 275 |
+
|
| 276 |
+
where $\mathbf { x } _ { i }$ are node attributes, relu and elu are the rectified linear unit and exponential linear unit respectively. In practice, we found that the softplus works equally well as the elu for making sure that $\sigma _ { i }$ are positive and in turn $\Sigma _ { i }$ is positive definite. We used Xavier initialization (Glorot & Bengio, 2010) for the weight matrices $\mathbf { W } \in \mathbb { R } ^ { D \times s _ { 1 } }$ , $\mathbf { b } \in \mathbb { R } ^ { s _ { 1 } }$ , $\mathbf { W } _ { \mu } \in \mathbb { R } ^ { s _ { 1 } \times L / 2 }$ , $\mathbf { b } _ { \pmb { \mu } } \in \mathbb { R } ^ { L / 2 }$ , $\mathbf { W _ { \Sigma } } \in$ $\mathbb { R } ^ { s _ { 1 } \times L / 2 }$ , $\mathbf { b } _ { \pm } \in \mathbb { R } ^ { L / 2 }$ . As discussed in Sec. 3.4, multiple hidden layers, or other architectures such as CNNs/RNNs can also be used based on the specific problem.
|
| 277 |
+
|
| 278 |
+
Unlike other approaches using Gaussian embeddings (Vilnis & McCallum, 2014; He et al., 2015; Dos Santos et al., 2016) we do not explicitly regularize the norm of the means and we do not clip the covariance matrices. Given the self-regularizing nature of the KL divergence this is unnecessary, as was confirmed in our experiments. The parameters are optimized using Adam (Kingma & Ba, 2014) with a fixed learning rate of 0.001 and no learning rate annealing/decay.
|
| 279 |
+
|
| 280 |
+
Edge cover. Some of the methods such as node2vec (Grover & Leskovec, 2016) are not able to produce an embedding for nodes that have not been seen during training. Therefore, it is important to make sure that during the train-validation-test split of the edge set, every node appears at least once in the train set. Random sampling of the edges does not guarantee this, especially when allocating a low percentage of edges in the train set during the split. To guarantee that every node appears at least once in the train set we have to find an edge cover. An edge cover of a graph is a set of edges such that every node of the graph is incident to at least one edge of the set. The minimum edge cover problem is the problem of finding an edge cover of minimum size. The dashed line in Figures 1(c) and 1(d) indicates exactly the size of the minimum edge cover. This condition had to be satisfied for the competing methods, however, since Graph2Gauss is inductive, it does not require that every node is in the train set.
|
md/train/r1lPleBFvH/r1lPleBFvH.md
ADDED
|
@@ -0,0 +1,382 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# UNDERSTANDING THE LIMITATIONS OF CONDITIONAL GENERATIVE MODELS
|
| 2 |
+
|
| 3 |
+
Ethan Fetaya∗ Jörn-Henrik Jacobsen∗
|
| 4 |
+
|
| 5 |
+
Will Grathwohl Richard Zemel
|
| 6 |
+
|
| 7 |
+
Vector Institute and University of Toronto {ethanf, jjacobs,wgrathwohl, zemel} $@$ cs.toronto.edu
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Class-conditional generative models hold promise to overcome the shortcomings of their discriminative counterparts. They are a natural choice to solve discriminative tasks in a robust manner as they jointly optimize for predictive performance and accurate modeling of the input distribution. In this work, we investigate robust classification with likelihood-based generative models from a theoretical and practical perspective to investigate if they can deliver on their promises. Our analysis focuses on a spectrum of robustness properties: (1) Detection of worst-case outliers in the form of adversarial examples; (2) Detection of average-case outliers in the form of ambiguous inputs and (3) Detection of incorrectly labeled in-distribution inputs.
|
| 12 |
+
|
| 13 |
+
Our theoretical result reveals that it is impossible to guarantee detectability of adversarially-perturbed inputs even for near-optimal generative classifiers. Experimentally, we find that while we are able to train robust models for MNIST, robustness completely breaks down on CIFAR10. We relate this failure to various undesirable model properties that can be traced to the maximum likelihood training objective. Despite being a common choice in the literature, our results indicate that likelihood-based conditional generative models may are surprisingly ineffective for robust classification.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Linear interpolations of inputs and respective outputs of a conditional generative model between two MNIST and CIFAR10 images from different classes. X-axis is interpolation steps and Y-axis negative log-likelihood in bits/dim (higher is more likely under model). MNIST interpolated images are far less likely than real images, whereas for CIFAR10 the opposite is observed, leading to high confidence classification of ambiguous out-of-distribution images.
|
| 19 |
+
|
| 20 |
+
Conditional generative models have recently shown promise to overcome many limitations of their discriminative counterparts. They have been shown to be robust against adversarial attacks (Schott et al., 2019; Ghosh et al., 2019; Song et al., 2018; Li et al., 2018; Frosst et al., 2018), to enable robust classification in the presence of outliers (Nalisnick et al., 2019b) and to achieve promising results in semi-supervised learning (Kingma et al., 2014; Salimans et al., 2016). Motivated by these success stories, we study the properties of conditional generative models in more detail.
|
| 21 |
+
|
| 22 |
+
Unlike discriminative models, which can ignore class-irrelevant information, conditional generative models cannot discard any information in the input, potentially making it harder to fool them. Further, jointly modeling the input and target distribution should make it easy to detect out-of-distribution inputs. These traits lend hope to the belief that good class-conditional generative models can overcome important problems faced by discriminative models.
|
| 23 |
+
|
| 24 |
+
In this work, we analyze conditional generative models by assessing them on a spectrum of robustness tasks. (1) Detection of worst-case outliers in the form of adversarial examples; (2) Detection of average-case outliers in the form of ambiguous inputs and (3) Detection of incorrectly labeled indistribution inputs. If a generative classifier is able to perform well on all of these, it will naturally be robust to noisy, ambiguous or adversarially perturbed inputs.
|
| 25 |
+
|
| 26 |
+
Outlier detection in the above settings is substantially different from general out-of-distribution (OOD) detection, where the goal is to use unconditional generative models to detect any OOD input. For the general case, likelihood has been shown to be a poor detector of OOD samples. In fact, often higher likelihood is assigned to OOD data than to the training data itself (Nalisnick et al., 2019a). However, class-conditional likelihood necessarily needs to decrease towards the decision-boundary for the classifier to work well. Thus, if the class-conditional generative model has high accuracy, rejection of outliers from the wrong class via likelihood may be possible.
|
| 27 |
+
|
| 28 |
+
Our contributions are:
|
| 29 |
+
|
| 30 |
+
Provable Robustness We answer: Can we theoretically guarantee that a strong conditional generative model can robustly detect adversarially attacked inputs? In section 2 we show that even a near-perfect conditional generative model cannot be guaranteed to reject adversarially perturbed inputs with high probability.
|
| 31 |
+
|
| 32 |
+
Assessing the Likelihood Objective We discuss the basis to empirically analyze robustness in practice. We identify several fundamental issues with the maximum likelihood objective typically used to train conditional generative models and discuss whether it is appropriate for detecting out-of-distribution inputs.
|
| 33 |
+
|
| 34 |
+
Understanding Conflicting Results We explore various properties of our trained conditional generative models and how they relate to fact that the model is robust on MNIST but not on CIFAR10. We further propose a new dataset where we combine MNIST images with CIFAR background, making the generative task as hard as CIFAR while keeping the discriminative task as easy as MNIST, and investigate how it affects robustness.
|
| 35 |
+
|
| 36 |
+
# 2 CONFIDENT MISTAKES CANNOT BE RULED OUT
|
| 37 |
+
|
| 38 |
+
The most challenging task in robust classification is accurately classifying or detecting adversarial attacks; inputs which have been maliciously perturbed to fool the classifier. In this section we discuss the possibility of guaranteeing robustness to adversarial attacks via conditional generative models.
|
| 39 |
+
|
| 40 |
+
Detectability of Adversarial Examples In the adversarial spheres work (Gilmer et al., 2018) the authors showed that a model can be fooled without changing the ground-truth probability of the attacked datapoint. This was claimed to show that adversarial examples can lie on the data manifold and therefore cannot be detected. While (Gilmer et al., 2018) is an important work for understanding adversarial attacks, it has several limitations with regard to conditional generative models. First, just because the attack does not change the ground-truth likelihood, this does not mean the model can not detect the attack. Since the adversary needs to move the input to a location where the model is incorrect, the question arises: what kind of mistake will the model make? If the model assigns low likelihood to the correct class without increasing the likelihood of the other classes then the adversarial attack will be detected, as the joint likelihood over all classes moves below the threshold of typical inputs. Second, on the adversarial spheres dataset (Gilmer et al., 2018) the class supports do not overlap. If we were to train a model of the joint density $p _ { \theta } ( x , y )$ (which does not have $100 \%$ classification accuracy) then the KL divergence $K L ( p ( x , y ) | | p _ { \theta } ( x , y ) )$ , where $p ( x , y )$ is the data density, is infinite due to division by zero (note that $K L ( p _ { \theta } ( x , y ) | | p ( x , y ) )$ is what is minimized with maximum likelihood). This poses the question, whether small $K L ( p ( x , y ) | | p _ { \theta } ( x , y ) )$ or small Shannon-Jensen divergence is sufficient to guarantee robustness. In the following, we show that this condition is insufficient.
|
| 41 |
+
|
| 42 |
+

|
| 43 |
+
Figure 2: Counter example construction. Shown on the left are the two class data densities, on the right the Bayes-optimal classifier for this problem (assuming $\lambda _ { 1 } > \lambda _ { 2 }$ ) and the model we consider. Despite being almost optimal, the model can be fooled with undetectable adversarial examples (red arrows). Detailed description in section 2.
|
| 44 |
+
|
| 45 |
+
Why no Robustness Guarantee can be Given The intuition why conditional generative models should be robust is as follows: If we have a robust discriminative model then the set of confident mistakes, i.e. where the adversarial attacks must reside, has low probability but might be large in volume. For a robust conditional generative model, the set of undetectable adversarial attacks, i.e. high-density high-confidence mistakes, has to be small in volume. Since the adversary has to be $\Delta$ close to this small volume set, the $\Delta$ area around this small volume set should still be small. This is where the idea breaks down due to the curse of dimensionality. Expanding a set by a small radius can lead to a much larger one even with smoothness assumptions. Based on this insight we build an analytic counter-example for which we can prove that even if
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\begin{array} { r } { K L \left( q | | p \right) < \epsilon \quad K L \left( p | | q \right) < \epsilon } \end{array}
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
where $p = p ( x , y )$ is the data distribution, and $q = q ( x , y )$ is the model, we can with probability $\approx 0 . 5$ take a correctly classified input sampled from $p$ , and perturb it by at most $\Delta$ to create an adversarial example that is classified incorrectly and is not detectable.
|
| 52 |
+
|
| 53 |
+
We note that the probability in every ball with radius $\Delta$ can be made as small as desired, excluding degenerate cases. We also assume that the Bayes optimal classifier is confident and is not affected by the attack, i.e. we do not change the underlying class but wrongfully flip the decision of the classifier.
|
| 54 |
+
|
| 55 |
+
The counter-example goes as follows: Let $U ( a , b )$ be the density of a uniform distribution on an annulus in dimension $d$ , $\{ x \in \mathbb { R } ^ { d } : a \leq | | x | | \leq b \}$ then the data conditional distribution is
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
\begin{array} { r l r l r } { p ( x | 0 ) = } & { { } \lambda _ { 1 } U ( 0 , 1 ) + ( 1 - \lambda _ { 1 } ) U ( 1 , 1 + \Delta ) } & { } & { { } 0 \le \lambda _ { 1 } \le 1 } \\ { p ( x | 1 ) = } & { { } } & { \lambda _ { 2 } U ( 0 , 1 ) + ( 1 - \lambda _ { 2 } ) U ( 2 , 3 ) } & { } & { { } 0 \le \lambda _ { 2 } \le 1 } \end{array}
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
with $p ( y = 0 ) = p ( y = 1 ) = 1 / 2$ . Both classes are a mixture of two distributions, uniform on the unit sphere and uniform on an annulus, as shown in Fig. 2. The model distribution is the following:
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\begin{array} { r l } { q ( x | 0 ) = } & { { } U ( 0 , 1 + \Delta ) } \\ { q ( x | 1 ) = } & { { } \lambda _ { 2 } U ( 0 , 1 ) + ( 1 - \lambda _ { 2 } ) U ( 2 , 3 ) } \end{array}
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
i.e. for $y = 1$ the model is perfect, while for $y ~ = ~ 0$ we replace the mixture with uniform distribution over the whole domain. If $\lambda _ { 1 } \gg \lambda _ { 2 }$ then points in the sphere with radius 1 should be classified as class $y = 0$ with high likelihood. If $\begin{array} { r } { \hat { \lambda } _ { 2 } > > \frac { 1 } { ( 1 + \Delta ) ^ { d } } } \end{array}$ then the model classifies points in the unit sphere incorrectly with high likelihood. Finally if $1 > > \lambda _ { 1 }$ then almost half the data points will fall in the annulus between 1 and $1 + \Delta$ and can be adversarially attacked with distance lesser or equal to $\Delta$ by moving them into the unit sphere as seen in Fig. 2. We also note that these attacks cannot be detected as the model likelihood only increases. In high dimensions, almost all the volume of a sphere is in the outer shell, and this can be used to show that in high enough dimensions we can get the condition in Eq. 1 for any value of $\epsilon$ and $\Delta$ (and also the confidence of the mistakes $\delta$ ). The detailed proof is in the supplementary material.
|
| 68 |
+
|
| 69 |
+
This counter-example shows that even under very strong conditions, a good conditional generative model can be attacked. Therefore no theoretical guarantees can be given in the general case for these models. Our construction, however, does not depend on the learning model but on the data geometry. This raises interesting questions concerning the source of the susceptibility to attacks: Is it the model or an inherent issue with the data?
|
| 70 |
+
|
| 71 |
+
# 3 THE MAXIMUM LIKELIHOOD OBJECTIVE
|
| 72 |
+
|
| 73 |
+
# 3.1 THE DIFFICULTY IN TRAINING CONDITIONAL GENERATIVE MODELS
|
| 74 |
+
|
| 75 |
+
Most recent publications on likelihood-based generative models primarily focus on quantitative results of unconditonal density estimation (van den Oord et al., 2016; Kingma & Dhariwal, 2018; Salimans et al., 2017b; Kingma et al., 2016; Papamakarios et al., 2017). For conditional density estimation, either only qualitative samples are shown (Kingma & Dhariwal, 2018), or it is reported that conditional density estimation does not lead to better likelihoods than unconditional density estimation. In fact, it has been reported that conditional density estimation can lead to slightly worse data likelihoods (Papamakarios et al., 2017; Salimans et al., 2017b), which is surprising at first, as extra bits of important information are provided to the model.
|
| 76 |
+
|
| 77 |
+
Explaining Likelihood Behaviour One way to understand this seemingly contradictory relationship is to consider the objective we use to train our models. When we train a generative model with maximum likelihood (either exactly or through a lower bound) we are minimizing the empirical approximation of $\mathbb { E } _ { x , y \sim P } \left[ - \log ( P _ { \theta } ( \dot { x } , y ) ) \right]$ which is equivalent to minimizing $K L ( \bar { P } ( x , y ) | | \bar { P } _ { \theta } ( x , y ) )$ . Consider now an image $x$ with a discrete label $y$ , which we are trying to model using $P _ { \theta } ( x , y )$ . The negative log-likelihood (NLL) objective is:
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\begin{array} { r l } { \mathbb { E } _ { ( x , y ) \sim P } [ - \log ( P _ { \theta } ( x , y ) ) ] = } & { \ \mathbb { E } _ { x \sim P } [ - \log ( P _ { \theta } ( x ) ) ] } \\ { + } & { \mathbb { E } _ { x \sim P } [ \mathbb { E } _ { y } [ - \log ( P _ { \theta } ( y | x ) ) | x ] ] } \end{array}
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
If we model $P _ { \theta } ( y | x )$ with a uniform distribution over classes, then the second term has a value of $\log ( C )$ where $C$ is the number of classes. This value is negligible compared to the first term $\mathbb { E } _ { x \sim P } [ - \log ( P _ { \theta } ( x ) ) ]$ and therefore the “penalty" for completely ignoring class information is negligible. So it is not surprising that models with strong generative abilities can have limited discriminative power. What makes matters even worse is that the penalty for confident mis-classification can be unbounded. This may also explain why the conditional ELBO is comparable to the unconditional ELBO (Papamakarios et al., 2017). Another way this can be seen is by thinking of the likelihood as the best lossless compression. When trying to encode an image, the benefit of the label is at most $\log ( C )$ bits which is small compared to the whole image. While these few bits are important for users, from a likelihood perspective the difference between the correct $p ( y | x )$ and a uniform distribution is negligible. This means that when naively training a class-conditional generative model by minimizing $\mathbb { E } _ { ( x , y ) \sim P } [ - \log ( P _ { \theta } ( x | y ) ) ]$ , typically discriminative performance as a classifier is very poor.
|
| 84 |
+
|
| 85 |
+
# 3.2 OUTLIER DETECTION
|
| 86 |
+
|
| 87 |
+
Another issue arises when models trained with maximum likelihood are used to detect outliers. The main issue is that maximum likelihood, which is equivalent to minimizing $K L ( P ( x , y ) | | P _ { \theta } ( x , y ) )$ , is known to have a “mode-covering” behavior. It has been shown recently in (Nalisnick et al., 2019a) that generative models, trained using maximum likelihood, can be quite poor at detecting out-of-distribution example. In fact it has been shown that these models can give higher likelihood values, on average, to datasets different from the test dataset that corresponds to the training data. Intuitivily one can still hope that a high accuracy conditional generative model would recognize an input conditioned on the wrong class as an outlier, as it was successfully trained to separate these classes. In section 4.2 we show this is not the case in practice.
|
| 88 |
+
|
| 89 |
+
While (Nalisnick et al., 2019a) focuses its analysis into dataset variance, we propose this is an inherit issue with the likelihood objective. If it is correct then the way conditional generative models are trained is at odds with their desired behaviour. If this is the case, then useful conditional generative model will require a fundamentally different approach.
|
| 90 |
+
|
| 91 |
+
# 4 EXPERIMENTS
|
| 92 |
+
|
| 93 |
+
We now present a set of experiments designed to test the robustness of conditional generative models. All experiments were performed with a flow model where the likelihood can be computed in closed form as the probability of the latent space embedding (the prior) and a Jacobian correction term; see Sec A.1 for a detailed explanation. Given that we can compute $p ( x , y )$ for each class, we can easily compute $p ( y | x )$ and classify accordingly. Besides allowing closed-form likelihood computation, the flexibility in choosing the prior distribution was important to conduct various experiments. In our work we used a version of the GLOW model; details of the models and training is in the supplementary material sec. B. We note that the results are not unique to flow models, and we verified that similar phenomenon can be seen when training with the PixelC $\mathrm { N N } { + } { + }$ autoregressive model (Salimans et al., 2017a) in sec. E.
|
| 94 |
+
|
| 95 |
+
# 4.1 TRAINING CONDITIONAL GENERATIVE MODELS
|
| 96 |
+
|
| 97 |
+
Here we investigate the ability to train a conditional generative model with good likelihood and accuracy simultaneously. Usually in flow models the prior distribution in latent space $z$ is Gaussian. For classification we used aclass-conditional mixture of 10 Gaussians $p ( z | y ) \overset { \cdot } { = } \mathcal { N } ( \mu _ { y } , \sigma _ { y } ^ { 2 } )$ We compare three settings: 1) A class-conditional mixture of 10 Gaussians as the prior (Base). 2) A classconditional mixture of 10 Gaussians trained with an additional classification loss term (Reweighted). 3) Our proposed conditional split prior (Split) described in sec. A.4 in the supplementary material. Results can be found in table 1.
|
| 98 |
+
|
| 99 |
+
Table 1: Comparison between different models.
|
| 100 |
+
|
| 101 |
+
<table><tr><td>MNIST</td><td>Base</td><td>Reweight</td><td>Split</td><td>CIFAR10</td><td>Base</td><td>Reweight</td><td>Split</td></tr><tr><td>% Acc</td><td>96.9</td><td>99.0</td><td>99.3</td><td>% Acc</td><td>56.8</td><td>83.2</td><td>84.0</td></tr><tr><td>bits/diml</td><td>0.95</td><td>1.10</td><td>1.00</td><td>bits/dim</td><td>3.47</td><td>3.54</td><td>3.53</td></tr></table>
|
| 102 |
+
|
| 103 |
+
As we can see, especially on CIFAR10, pushing up the accuracy to values that are still far from stateof-the-art already results in non-negligible deterioration to the likelihood values. This exemplifies how obtaining strong classification accuracy without harming likelihood estimation is still a challenging problem. We note that while the difference between the split prior and re-weighted version is not huge, the split prior achieves better NLL and better accuracy in both experiments. We experimented with various other methods to improve training with limited success, see sec. C in the supplementary material for furture information.
|
| 104 |
+
|
| 105 |
+

|
| 106 |
+
4.2 NEGLIGIBLE IMPACT OF CLASS MEMBERSHIP ON LIKELIHOOD
|
| 107 |
+
Figure 3: NLL for images conditioned on the correct class vs the highest probability wrong class.
|
| 108 |
+
|
| 109 |
+
Next we show that even conditional generative models which are strong classifiers do not see images with the corrupted labels as outliers. To understand this phenomenon we first note that if we want the correct class to have a probability of at least $1 - \delta$ then it is enough for the corresponding logit to be larger than all the others by $\begin{array} { r } { \log ( \mathbf { \bar { \boldsymbol { C } } } ) + \log \left( \frac { 1 - \delta } { \delta } \right) } \end{array}$ where $C$ is the number of classes. For $C = 1 0$ and $\delta = 1 e - 5$ this is about 6, which is negligible relative to the likelihood of the image, which is in the scale of thousands. This means that even for a strong conditional generative model which confidently predicts the correct label, the pair $\{ x _ { i } , y _ { w } \neq y _ { i } \}$ (where $w$ is the leading incorrect class) cannot be detected as an outlier according to the joint distribution, as the gap $\log ( p ( x _ { i } | y _ { i } ) ) - \log ( p ( x _ { i } | y _ { w } ) )$ is much smaller than the variation in likelihood values. In Fig. 3 we show this by plotting the histograms of the likelihood conditioned both on the correct class and on the most likely wrong class over the test set. In other words, in order for $\log ( p ( x _ { i } | y _ { w } ) )$ to be considered an outlier the prediction needs to be extremely confident, much more than we expect it to be, considering test classification error.
|
| 110 |
+
|
| 111 |
+
# 4.3 ADVERSARIAL ATTACKS AS WORST CASE ANALYSIS
|
| 112 |
+
|
| 113 |
+
We first evaluate the ability of conditional generative models to detect standard attacks, and then try to detect attacks designed to fool the detector (likelihood function). We evalulate both the gradient based Carlini-Wagner $L _ { 2 }$ attack (CW- $L _ { 2 }$ ) (Carlini & Wagner, 2017b) and the gradient free boundary attack (Brendel et al., 2018). Results are shown in table 2 on the left. It is interesting to observe the disparity between the CW- $L _ { 2 }$ attack, which is easily detectable, and the boundary attack which is much harder to detect.
|
| 114 |
+
|
| 115 |
+
Table 2: Comparison of attack detection. Percentage of successful and undetected attacks within $L _ { 2 }$ -distance of $\epsilon = 1 . 5$ for MNIST and $\epsilon = 3 3 / 2 5 5$ for CIFAR10 for proposed models. Number in parentheses is percentage of attacks that successfully fool the classifier, both detected and undetected.
|
| 116 |
+
|
| 117 |
+
<table><tr><td>Attacking</td><td colspan="3">Classification</td><td colspan="2">Classification and Detection</td></tr><tr><td>MNIST</td><td>Reweight</td><td>Split</td><td>Reweight</td><td>Split</td><td rowspan="3"></td></tr><tr><td>CW-L2</td><td>0% (100%)</td><td>1% (100%)</td><td>17% (100%)</td><td>14% (100%)</td></tr><tr><td>Boundary attack</td><td>43% (82%)</td><td>36% (80%)</td><td>0% (0%)</td><td>0% (0%)</td></tr><tr><td>CIFAR10</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>CW-L2</td><td>0% (97%)</td><td>0% (0%)</td><td>6% (99%)</td><td></td><td>3% (100%)</td></tr><tr><td>Boundary attack</td><td>67% (100%)</td><td>72% (100%)</td><td>100% (100%)</td><td></td><td>100% (100%)</td></tr></table>
|
| 118 |
+
|
| 119 |
+
Next we modify our attacks to try to fool the detector as well. With the CW- $L _ { 2 }$ attack we follow the modification suggested in (Carlini & Wagner, 2017a) and add an extra loss term $\ell _ { d e t } ( x ^ { \prime } ) =$ $\operatorname* { m a x } \{ 0 , - \log ( p ( x ^ { \prime } ) ) - T \}$ where $T$ is the detection threshold. For the boundary attack we turn the $C$ -way classification into a $C + 1$ -way classification by adding another class which is “non-image” and classify any image above the detection threshold as such. We then use a targeted attack to try to fool the network to classify the image into a specific original class. This simple modification to the boundary attack will typically fail because it cannot initialize. The standard attack starts from a random image and all random images are easily detected as “non-image” and therefore do not have the right target class. To address this we start from a randomly chosen image from the target class, ensuring the original image is detected as a real image from the desired class.
|
| 120 |
+
|
| 121 |
+
From table 2 (right side) we can see that even after the modification CW- $L _ { 2 }$ still struggles to fool the detector. The boundary attack, however, succeeds completely on CIFAR10 and fails completely on MNIST, even when it managed to sometimes fool the detector without directly trying. We hypothesize that this is because the area between two images of separate classes, where the boundary attack needs to pass through, is correctly detected as out of distribution only for MNIST and not CIFAR10. We explore this further below.
|
| 122 |
+
|
| 123 |
+
# 4.4 AMBIGUOUS INPUTS AS AVERAGE CASE ANALYSIS
|
| 124 |
+
|
| 125 |
+
To understand why the learned networks are easily attacked on CIFAR but not on MNIST with the modified boundary attack, we explore the probability density of interpolations between two real images. This is inspired by the fact that the boundary attack proceeds along the line between the attacked image and the initial image. The minimum we would expect from a decent generative model is to detect the intermediate middle images as “non-image” with low likelihood. If this was the case and each class was a disconnected high likelihood region, the boundary attack would have a difficult time when starting from a different class image.
|
| 126 |
+
|
| 127 |
+
Given images $x _ { 0 }$ and $x _ { 1 }$ from separate classes $y _ { 0 }$ and $y _ { 1 }$ and for $\alpha \in [ 0 , 1 ]$ we generate an intermediate image $x _ { \alpha } = \alpha \cdot x _ { 1 } + ( 1 - \alpha ) x _ { 0 }$ , and run the model on various $\alpha$ values to see the model prediction along the line. For endpoints we sample real images that are classified correctly and are above the detection threshold used previously. See Fig. 1 for interpolation examples from MNIST and CIFAR.
|
| 128 |
+
|
| 129 |
+
In figure 4 (a) we see the average results for MNIST for 1487 randomly selected pairs. As expected, the likelihood goes down as $\alpha$ moves away from the real images $x _ { 0 }$ and $x _ { 1 }$ . We also see the probability of both classes drop rapidly as the network predictions become less confident on the intermediate images. Sampling $1 0 0 \alpha$ values uniformly in the range $[ 0 , 1 ]$ we can also investigate how many of the interpolations all stay above the detection threshold, i.e. all intermediate images are considered real by the model, and find that this happens only in $0 . 5 \%$ of the cases.
|
| 130 |
+
|
| 131 |
+

|
| 132 |
+
Figure 4: Average Log likelihoods and class probabilities for interpolations between data points from different classes, $\mathbf { X }$ -axis is interpolation coefficient $\alpha$ . The MNIST model behaves as desired and robustly detects interpolated images. The CIFAR10 model, however, fails strikingly and interpolatd images are consistently more likely than true data under the model.
|
| 133 |
+
|
| 134 |
+
On CIFAR images, using 1179 pairs, we get a very different picture (see fig. 4 (b)). Not only does the intermediate likelihood not drop down, it is even higher on average than on the real images albeit to a small degree. In classification we also see a very smooth transition between classes, unlike the sharp drop in the MNIST experiment. Lastly, $100 \%$ of the interpolated images lay above the detection threshold and none are detected as a “non-image” (for reference the detection threshold has $7 8 . 6 \%$ recall on real CIFAR10 test images). This shows that even with good likelihood and reasonable accuracy, the model still “mashes" the classes together, as one can move from one Gaussian to another without passing through low likelihood regions in-between. It also clarifies why the boundary attack is so successful on CIFAR but fails completely on MNIST. We note that the basic attack on MNIST is allowed to pass through these low density areas which is why it sometimes succeeds.
|
| 135 |
+
|
| 136 |
+
# 4.5 CLASS-UNRELATED ENTROPY IS TO BLAME
|
| 137 |
+
|
| 138 |
+
In this section, we show that the difference in performance between CIFAR10 and MNIST can largely be attributed to how the entropy in the datasets is distributed, i.e how much the uncertainty in the data distribution is reduced after conditioning on the class label. For MNIST digits, a large source of uncertainty in pixel-space comes from the class label. Given the class, most pixels can be predicted accurately by simply taking the mean of the training set in each class. This is exactly why a linear classifier performs well on MNIST. Conversely on CIFAR10, after conditioning on the class label there still exists considerable uncertainty. Given the class is “cat,” there still exists many complicated sources of uncertainty such as where the cat is and how it is posed. In this dataset, a much larger fraction of the uncertainty is not accounted for after conditioning on the label. This is not a function of the domain or the dimensionality of the dataset, it is a function of the dataset itself.
|
| 139 |
+
|
| 140 |
+
To empirically verify this, we have designed a dataset which replicates the challenges of CIFAR10 and places them onto a problem of the same discriminative difficulty as MNIST. To achieve this, we simply replaced the black backgrounds of MNIST images with randomly sampled (downsampled and greyscaled) images from CIFAR10. In this dataset, which we call background-MNIST (BG-MNIST), the classification problem is identically predictable from the same set of pixels as in standard MNIST but modeling the data density is much more challenging.
|
| 141 |
+
|
| 142 |
+

|
| 143 |
+
Figure 5: Top: Samples from the BG-MNIST-0 dataset. Bottom: Samples from conditional generative model trained on the dataset. Note how the model has learnd to capture digit identity.
|
| 144 |
+
|
| 145 |
+
To further control the entropy in a fine-grained manner, we convolve the background with a Gaussian blur filter with various bandwidths to remove varying degrees of high frequency information. With high blur, the task begins to resemble standard MNIST and conditional generative models should perform as they do on MNIST. With low and no blur we expect them to behave as they do on CIFAR10.
|
| 146 |
+
|
| 147 |
+
Table 3 summarizes the performance of conditional generative models on BG-MNIST. We train models with a “Reweighted” discriminative objective as in Section A. The reweighting allows them to perform well as classifiers but the likelihood of their generative component falls to below CIFAR10 levels. More strikingly, now when we interpolate between datapoints we observe behavior identical to our CIFAR10 models. This can be seen in Figure 6. Thus, we have created a dataset with the discriminative difficulty of MNIST and the generative difficulty of CIFAR10.
|
| 148 |
+
|
| 149 |
+
<table><tr><td></td><td>MNIST</td><td>BG-MNIST-5</td><td>BG-MNIST-1</td><td>BG-MNIST-0</td><td>CIFAR10</td></tr><tr><td>% Acc</td><td>99</td><td>99</td><td>99</td><td>98</td><td>84</td></tr><tr><td>bits/dim</td><td>1.10</td><td>1.67</td><td>3.30</td><td>4.58</td><td>3.53</td></tr></table>
|
| 150 |
+
|
| 151 |
+
Table 3: Conditional generative models trained on BG-MNIST. BG-MNIST- $X$ indicates the bandwith of blur applied to CIFAR10 backgrounds.
|
| 152 |
+
|
| 153 |
+

|
| 154 |
+
Figure 6: Average log-likelihoods and class probabilities for interpolations between BG-MNIST-0 datapoints. While classification is on par with MNIST models, the likelihood exhibits the same failures as CIFAR10 models.
|
| 155 |
+
|
| 156 |
+
# 5 RELATED WORK
|
| 157 |
+
|
| 158 |
+
Despite state of the art performance in many tasks, deep neural networks have been shown to be fragile where small image transformations, (Azulay & Weiss, 2018) or background object transplant (Rosenfeld et al., 2018) can greatly change predictions. In the more challenging case of adversarial pertubations, deep neural networks are known to be vulnerable to adversarial attacks (Akhtar & Mian, 2018), and while many attempts have been made to train robust models or detect malicious attacks, significant progress towards truly robust models has been made only on MNIST (Schott et al., 2019; Madry et al., 2017). Even CIFAR10 remains far from being solved from a standpoint of adversarial robustness.
|
| 159 |
+
|
| 160 |
+
One common belief is that adversarial attacks succeed by moving the data points off the data manifold, and therefore can possibly be detected by a generative model which should assign them low likelihood values. Although this view has been challenged in (Gilmer et al., 2018), we now discuss how their setting needs to be extended to fully study robustness guarantees of conditional generative models.
|
| 161 |
+
|
| 162 |
+
Recent work (Song et al., 2018; Frosst et al., 2018; Li et al., 2018) showed that a generative model can detect and defend adversarial attacks. However, there is a caveat when evaluating detectability of adversarial attacks: the attacker needs to be able to attack the detection algorithm as well. Not doing so has been shown to lead to drastically false robustness claims (Carlini & Wagner, 2017a). In (Li et al., 2018) the authors report difficulties training a high accuracy conditional generative model on CIFAR10, and resort to evaluation on a 2-class classification problem derived from CIFAR10. While they do show robustness similar to our Carlini-Wagner results, they do not apply the boundary attack which we found to break our models on CIFAR10. This highlights the need to utilize a diverse set of attacks. In (Schott et al., 2019) a generative model was used not just for adversarial detection but also robust classification on MNIST, leading to state-of-the-art robust classification accuracy. The method was only shown to work on MNIST, and is very slow at inference time. However, overall it provides an existence proof that conditional generative models can be very robust in practice. In (Ghosh et al., 2019) the authors also use generative models for detection and classification but only show results with the relatively weak FGSM attack, and on simple datasets. As we see in Fig. 1 and discuss in section 4, generative models trained on MNIST can display very different behavior than similar models trained on more challenging data like CIFAR10. This shows how success on MNIST may often not translate to success on other datasets.
|
| 163 |
+
|
| 164 |
+
# 6 CONCLUSION
|
| 165 |
+
|
| 166 |
+
In this work we explored limitations, both in theory and practice, of using conditional generative models to detect adversarial attacks. Most practical issues arise due to likelihood, the standard objective and evaluation metric for generative models by which probabilities can be computed. We conclude that likelihood-based density modeling and robust classification may fundamentally be at odds with one another as important aspects of the problem are not captured by this training and evaluation metric. This has wide-reaching implications for applications like out-of-distribution detection, adversarial robustness and generalization as well as semi-supervised learning with these models.
|
| 167 |
+
|
| 168 |
+
# REFERENCES
|
| 169 |
+
|
| 170 |
+
Naveed Akhtar and Ajmal S. Mian. Threat of adversarial attacks on deep learning in computer vision: A survey. IEEE Access, 6:14410–14430, 2018.
|
| 171 |
+
|
| 172 |
+
Aharon Azulay and Yair Weiss. Why do deep convolutional networks generalize so poorly to small image transformations? CoRR, 2018. URL http://arxiv.org/abs/1805.12177.
|
| 173 |
+
|
| 174 |
+
Jens Behrmann, Will Grathwohl, Ricky T. Q. Chen, David Duvenaud, and Jörn-Henrik Jacobsen. Invertible residual networks. International Conference on Machine Learning, 2019.
|
| 175 |
+
|
| 176 |
+
Wieland Brendel, Jonas Rauber, and Matthias Bethge. Decision-based adversarial attacks: Reliable attacks against black-box machine learning models. In International Conference on Learning Representations (ICLR), 2018. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } }$ SyZI0GWCZ.
|
| 177 |
+
|
| 178 |
+
Nicholas Carlini and David Wagner. Adversarial examples are not easily detected: Bypassing ten detection methods. In Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security, pp. 3–14. ACM, 2017a.
|
| 179 |
+
|
| 180 |
+
Nicholas Carlini and David A. Wagner. Towards evaluating the robustness of neural networks. In IEEE Symposium on Security and Privacy, SP, 2017b.
|
| 181 |
+
|
| 182 |
+
Laurent Dinh, David Krueger, and Yoshua Bengio. NICE: non-linear independent components estimation. In International Conference on Learning Representations (ICLR), 2015.
|
| 183 |
+
|
| 184 |
+
Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real NVP. In International Conference on Learning Representations, (ICLR), 2017.
|
| 185 |
+
|
| 186 |
+
Nicholas Frosst, Sara Sabour, and Geoffrey Hinton. Darccc: Detecting adversaries by reconstruction from class conditional capsules. arXiv preprint arXiv:1811.06969, 2018.
|
| 187 |
+
|
| 188 |
+
Partha Ghosh, Arpan Losalka, and Michael J Black. Resisting adversarial attacks using gaussian mixture variational autoencoders. In Conference on Artificial Intelligence (AAAI), 2019. URL https://arxiv.org/abs/1806.00081.
|
| 189 |
+
|
| 190 |
+
Justin Gilmer, Luke Metz, Fartash Faghri, Samuel S. Schoenholz, Maithra Raghu, Martin Wattenberg, and Ian J. Goodfellow. Adversarial spheres. International Conference on Learning Representations (ICLR), 2018. URL http://arxiv.org/abs/1801.02774.
|
| 191 |
+
|
| 192 |
+
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 27. 2014. URL http://papers.nips.cc/paper/ 5423-generative-adversarial-nets.pdf.
|
| 193 |
+
|
| 194 |
+
Aditya Grover, Manik Dhar, and Stefano Ermon. Flow-gan: Combining maximum likelihood and adversarial learning in generative models. In Conference on Artificial Intelligence (AAAI), 2018.
|
| 195 |
+
|
| 196 |
+
Joern-Henrik Jacobsen, Jens Behrmann, Richard Zemel, and Matthias Bethge. Excessive invariance causes adversarial vulnerability. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id $=$ BkfbpsAcF7.
|
| 197 |
+
|
| 198 |
+
Jörn-Henrik Jacobsen, Arnold W. M. Smeulders, and Edouard Oyallon. i-revnet: Deep invertible networks. International Conference on Learning Representations (ICLR), 2018. URL http: //arxiv.org/abs/1802.07088.
|
| 199 |
+
|
| 200 |
+
Durk P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In Advances in Neural Information Processing Systems, pp. 10236–10245, 2018.
|
| 201 |
+
|
| 202 |
+
Durk P Kingma, Shakir Mohamed, Danilo Jimenez Rezende, and Max Welling. Semi-supervised learning with deep generative models. In Advances in neural information processing systems (NIPS), pp. 3581–3589, 2014.
|
| 203 |
+
|
| 204 |
+
Durk P Kingma, Tim Salimans, Rafal Jozefowicz, Xi Chen, Ilya Sutskever, and Max Welling. Improved variational inference with inverse autoregressive flow. In Advances in neural information processing systems, pp. 4743–4751, 2016.
|
| 205 |
+
|
| 206 |
+
Yingzhen Li, John Bradshaw, and Yash Sharma. Are generative classifiers more robust to adversarial attacks? arXiv preprint arXiv:1802.06552, 2018.
|
| 207 |
+
|
| 208 |
+
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.
|
| 209 |
+
|
| 210 |
+
Eric Nalisnick, Akihiro Matsukawa, Yee Whye Teh, Dilan Gorur, and Balaji Lakshminarayanan. Do deep generative models know what they don’t know? In International Conference on Learning Representations, 2019a. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ H1xwNhCcYm.
|
| 211 |
+
|
| 212 |
+
Eric T. Nalisnick, Akihiro Matsukawa, Yee Whye Teh, Dilan Görür, and Balaji Lakshminarayanan. Hybrid models with deep and invertible features. In International Conference on Machine Learning (ICML), 2019b.
|
| 213 |
+
|
| 214 |
+
George Papamakarios, Theo Pavlakou, and Iain Murray. Masked autoregressive flow for density estimation. In Advances in Neural Information Processing Systems, pp. 2338–2347, 2017.
|
| 215 |
+
|
| 216 |
+
Danilo Rezende and Shakir Mohamed. Variational inference with normalizing flows. In International Conference on Machine Learning (ICML), 2015.
|
| 217 |
+
|
| 218 |
+
Amir Rosenfeld, Richard S. Zemel, and John K. Tsotsos. The elephant in the room. CoRR, 2018. URL http://arxiv.org/abs/1808.03305.
|
| 219 |
+
|
| 220 |
+
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.
|
| 221 |
+
|
| 222 |
+
Tim Salimans, Andrej Karpathy, Xi Chen, and Diederik P. Kingma. Pixelcnn $^ { + + }$ : A pixelcnn implementation with discretized logistic mixture likelihood and other modifications. In ICLR, 2017a.
|
| 223 |
+
|
| 224 |
+
Tim Salimans, Andrej Karpathy, Xi Chen, and Diederik P Kingma. Pixelcnn $^ { + + }$ : Improving the pixelcnn with discretized logistic mixture likelihood and other modifications. arXiv preprint arXiv:1701.05517, 2017b.
|
| 225 |
+
|
| 226 |
+
L. Schott, J. Rauber, W. Brendel, and M. Bethge. Towards the first adversarially robust neural network model on mnist. 2019. URL https://arxiv.org/pdf/1805.09190.pdf.
|
| 227 |
+
|
| 228 |
+
Yang Song, Taesup Kim, Sebastian Nowozin, Stefano Ermon, and Nate Kushman. Pixeldefend: Leveraging generative models to understand and defend against adversarial examples. In International Conference on Learning Representations (ICLR), 2018.
|
| 229 |
+
|
| 230 |
+
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.
|
| 231 |
+
|
| 232 |
+
# A TRAINING CONDITIONAL GENERATIVE MODELS
|
| 233 |
+
|
| 234 |
+
A.1 LIKELIHOOD-BASED GENERATIVE MODELS AS GENERATIVE CLASSIFIERS
|
| 235 |
+
|
| 236 |
+
We present a brief overview of flow-based deep generative models, conditional generative models, and their applications to adversarial example detection.
|
| 237 |
+
|
| 238 |
+
Flow based generative models Rezende & Mohamed (2015); Dinh et al. (2015; 2017); Kingma & Dhariwal (2018) compute exact densities for complex distributions using the change of variable formula. They achieve strong empirical results Kingma & Dhariwal (2018) and the closed form likelihood makes them easier to analyze than the closely related VAE Kingma et al. (2014). The main idea behind flow-based generative models is to model the data distribution using a series of bijective mappings $z _ { N } = f ( x ) = f _ { N } \circ f _ { N - 1 } . . . \circ f _ { 1 } ( x )$ where $z _ { N }$ has a known simple distribution, e.g. Gaussian, and all $f _ { i }$ are parametric functions for which the determinant of the Jacobian can be computed efficiently. Using the change of variable formula we have $\log ( p ( x ) ) = \log ( p ( z _ { N } ) ) +$ $\begin{array} { r } { \sum _ { i = 1 } ^ { N } \log ( | \operatorname* { d e t } ( J _ { i } ( z _ { i } ) ) | ) } \end{array}$ where $J _ { i }$ is the Jacobian of $f _ { i }$ and $z _ { i - 1 } = f _ { i - 1 } . . . \circ f _ { 1 } ( x )$ .
|
| 239 |
+
|
| 240 |
+
The standard way to parameterize such functions $f _ { i }$ is by splitting the input $z _ { i - 1 }$ into two $z _ { i - 1 } =$ $( z _ { i - 1 } ^ { 1 } , z _ { i - 1 } ^ { 2 } )$ and chose
|
| 241 |
+
|
| 242 |
+
$$
|
| 243 |
+
f _ { i } \left( \left[ \begin{array} { l } { z _ { i - 1 } ^ { 1 } } \\ { z _ { i - 1 } ^ { 2 } } \end{array} \right] \right) = \left[ s ( z _ { i - 1 } ^ { 1 } ) \odot z _ { i - 1 } ^ { 2 } + t ( z _ { i - 1 } ^ { 1 } ) \right]
|
| 244 |
+
$$
|
| 245 |
+
|
| 246 |
+
which is invertible as long as $s ( z _ { i - 1 } ^ { 1 } ) _ { j } = s _ { j } \neq 0$ and we have $\begin{array} { r } { \log ( | \operatorname* { d e t } ( J _ { i } ( z _ { i - 1 } ) ) | ) = \sum _ { j } \log ( | s _ { j } | ) } \end{array}$ . For images the splitting is normally done in the channel dimension. These models are then trained by maximizing the empirical log likelihood (MLE).
|
| 247 |
+
|
| 248 |
+
A straightforward way to turn this generative model into a conditional generative model is to make $p ( z _ { N } )$ a Gaussian mixture model (GMM) with one Gaussian per class, i.e. $p ( z _ { N } | y ) = N ( \mu _ { y } , \Sigma _ { y } )$ . Assuming $p ( y )$ is known, then maximizing $\log ( p ( x , y ) )$ is equivalent to maximizing $\log ( p ( x | y ) ) { \dot { = } }$ $\begin{array} { r } { \log ( p ( z _ { N } | y ) ) + \sum _ { i = 1 } ^ { N } \log ( | \operatorname* { d e t } ( J _ { i } ( z _ { i } ) ) | ) } \end{array}$ . At inference time, one can classify by simply using Bayes rule. Note that directly optimizing $\log ( p ( x | y ) )$ results in poor classification accuracy as discussed in section 3. This issue was also addressed in the recent hybrid model work Nalisnick et al. (2019a).
|
| 249 |
+
|
| 250 |
+
We will now describe some of the various approaches we investigated in order to train the best possible flow-based conditional generative models, to achieve a better trade-off betwen classification accuracy and data-likelihood as compared to commonly-used approaches. We also discuss some failed approaches in the appendix.
|
| 251 |
+
|
| 252 |
+
# A.2 REWEIGHTING
|
| 253 |
+
|
| 254 |
+
The most basic approach, which has been used before in various works, is to reweight the discriminative part in eq. (4). While this can produce good accuracy, it can have an unfavorable trade-off with the NLL where good accuracy comes with severely sub-optimal NLL. This tradeoff has also been shown in Nalisnick et al. (2019a) where they train a somewhat similar model but classify with a generalized linear model instead of a Gaussian mixture model.
|
| 255 |
+
|
| 256 |
+
# A.3 ARCHITECTURE CHANGE
|
| 257 |
+
|
| 258 |
+
Padding channels has been shown to increase accuracy in invertible networks Jacobsen et al. (2018); Behrmann et al. (2019). This helps ameliorate a basic limitation in bijective mappings (see Eq. (5)), by allowing to increase the number of channels as a pre-processing step. Unlike the discriminative i-RevNet, we cannot just pad zeros as that would not be a continuous density. Instead we pad channels with uniform(0,1) random noise. In effect we do not model MNIST and CIFAR10 as is typically done in the literature, but rather the zero-padded version of those. While the ground-truth likelihoods for the padded and un-padded datapoints are the same due to independence of the uniform noise and unit density of the noise, this is not guaranteed to be captured by the model, making likelihoods very similar but not exactly comparable with the literature. This is not an issue for us, as we only compare models on the padded datasets.
|
| 259 |
+
|
| 260 |
+
# A.4 SPLIT PRIOR
|
| 261 |
+
|
| 262 |
+
One reason MLE is bad at capturing the label is because a small number of dimensions have a small effect on the NLL. Fortunately, we can use this property to our advantage. As the contribution of the conditional class information is negligible for the data log likelihood, we choose to model it in its distinct subspace, as proposed by Jacobsen et al. (2019). Thus, we partition the hidden dimensions $z = ( z _ { s } , z _ { n } )$ and only try to enforce the low-dimensional $z _ { s }$ to be the logits. This has two advantages: 1) we do not enforce class-conditional dimensions to be factorial; and 2) we can explicitly up-weight the loss on this subspace and treat it as standard logits of a discriminative model. A similar approach is also used by semi-supervised VAEs Kingma et al. (2014). This lets us jointly optimize the data log-likelihood alongside a classification objective without requiring most of the dimensions to be discriminative. Using the factorization $p ( z _ { s } , \bar { z _ { n } } | y ) = p ( z _ { s } | y ) \cdot p ( \bar { z } _ { n } | z _ { s } , \bar { y } )$ we model $p ( z _ { s } | y )$ as Gaussian with class conditional mean $e _ { i } = ( 0 , . . . , 0 , 1 , . . . 0 )$ and covariance matrix scaled by a constant. The distribution $p ( z _ { n } | z _ { s } , y )$ is modeled as a Gaussian where the mean and variances are a function of $y$ and $z _ { n }$ .
|
| 263 |
+
|
| 264 |
+
# B IMPLEMENTATION DETAILS
|
| 265 |
+
|
| 266 |
+
We pad MNIST with zeros so both datasets are $3 2 \mathrm { x } 3 2$ and subtract 0.5 from both datasets to have a [-0.5,0.5] range. For data augmentation we do pytorch’s random crop with a padding of 4 and ’edge’ padding mode, and random horizontal flip for CIFAR10 only.
|
| 267 |
+
|
| 268 |
+
The model is based on GLOW with 4 levels, affine coupling layers, 1x1 convolution permutations and actnorm in a multi-scale architecture. We choose 128 channels and 12 blocks per level for MNIST and 256 channels and 16 blocks for CIFAR10. In both MNIST and CIFAR10 experiments we double the number of channels with uniforrm(0,1) noise which we scale down to the range $[ 0 , 2 / 2 5 6 ]$ (taking it into account in the Jacobian term). One major difference is that we do the squeeze operation at the end of each level instead of the beginning, which is what allows us to use 4 levels. This is possible because with the added channels the number of channels is even and the standard splitting is possible before the squeeze operation.
|
| 269 |
+
|
| 270 |
+
The models are optimized using Adam, for 150 epochs. The initial learning rate is $1 e - 3$ , decayed by a factor of 10 every 60 epochs. For the reweighted optimization the objective is
|
| 271 |
+
|
| 272 |
+
$$
|
| 273 |
+
l o s s = - \log ( p ( x | y ) ) / D - \log ( p ( y | x ) )
|
| 274 |
+
$$
|
| 275 |
+
|
| 276 |
+
where $\mathbf { D }$ is the data dimension $3 \mathbf { x } 3 2 \mathbf { x } 3 2$ for CIFAR, $1 \mathrm { x } 3 2 \mathrm { x } 3 2$ for MNIST).
|
| 277 |
+
|
| 278 |
+
For adversarial detection we use a threshold of 1.4 for MNIST ( $100 \%$ of test data are below the threshold) and 4. for CIFAR10 $7 8 . 6 \%$ of test images are below the threshold).
|
| 279 |
+
|
| 280 |
+
# C NEGATIVE RESULTS
|
| 281 |
+
|
| 282 |
+
In this work explored many ideas in order to achieve better tradeoff between accuracy with little or no impact.
|
| 283 |
+
|
| 284 |
+
# C.1 ROBUST PRIORS
|
| 285 |
+
|
| 286 |
+
Since the Gaussian prior is very sensitive to outliers, one idea was that confident miss-classifications carry a strong penalty which might result in “messing" all the classes together. A solution would be to replace the Gaussian with a more robust prior, e.g. Laplace or Cauchy. Another idea we explored is a mixture of Gaussian and Laplace or Cauchy using the same location parameter. In our experiments we did not see any significant difference from the Gaussian prior.
|
| 287 |
+
|
| 288 |
+
# C.2 LABEL SMOOTHING
|
| 289 |
+
|
| 290 |
+
Another approach to try to address the same issue is a version of label smoothing. In this new model the Gaussian clusters are a latent variable that is equal to the real label with probability $1 - \epsilon$
|
| 291 |
+
|
| 292 |
+
and uniform on the other labels with probability $\epsilon .$ . Using this will bound the error for confident miss-classification as long as the data is close to one of the Gaussian centers.
|
| 293 |
+
|
| 294 |
+
# C.3 FLOW-GAN
|
| 295 |
+
|
| 296 |
+
As we claimed the main issue is with the MLE objective, it seems like a better objective is to optimize $K L ( p ( x , y ) | | p _ { \theta } ( x , y ) )$ or the Jensen-Shannon divergence as this KL term is highly penalized for miss-classification. It is also more natural when considering robustness against adversarial attacks. Optimizing this directly is hard, but generative adversarial networks (GANs) Goodfellow et al. (2014) in theory should also optimize this objective. Simply training a GAN would not work as we are interested in the likelihood value for adversarial detection and GANs only let you sample and does not give you any information regarding an input image.
|
| 297 |
+
|
| 298 |
+
Since flow algorithms are bijective, we could combine the two objective as was done in the flow-GAN paper Grover et al. (2018). We trained this approach with various conditional-GAN alternatives and found it very hard to train. GANs are know to be unstable to train, and combining them with the unstable flow generator is problematic.
|
| 299 |
+
|
| 300 |
+
# D ANALYTICAL COUNTER EXAMPLE:
|
| 301 |
+
|
| 302 |
+
$$
|
| 303 |
+
\begin{array} { c } { { p ( y = 1 ) = p ( y = 0 ) = q ( y = 1 ) = q ( y = 0 ) = 1 / 2 \mathrm { ~ a n d ~ } } } \\ { { p ( x | 0 ) = \lambda _ { 1 } U ( 0 , 1 ) + ( 1 - \lambda _ { 1 } ) U ( 1 , 1 + \Delta ) } } \\ { { p ( x | 1 ) = \lambda _ { 2 } U ( 0 , 1 ) + ( 1 - \lambda _ { 2 } ) U ( 2 , 3 ) } } \\ { { q ( x | 0 ) = U ( 0 , 1 + \Delta ) } } \\ { { q ( x | 1 ) = \lambda _ { 2 } U ( 0 , 1 ) + ( 1 - \lambda _ { 2 } ) U ( 2 , 3 ) } } \end{array}
|
| 304 |
+
$$
|
| 305 |
+
|
| 306 |
+
where $U ( a , b )$ is the uniform distribution on the annulus $R ^ { d } ( a , b ) = \{ x \in \mathbb { R } ^ { d } : a \leq | | x | | \leq b \}$ in dimension $d$ .
|
| 307 |
+
|
| 308 |
+
Lemma 1. For $| | x | | < 1$ we have
|
| 309 |
+
|
| 310 |
+
$$
|
| 311 |
+
\begin{array} { l } { \displaystyle p ( 0 | x ) = \frac { \lambda _ { 1 } } { \lambda _ { 1 } + \lambda _ { 2 } } } \\ { \displaystyle q ( 0 | x ) = \frac { 1 } { 1 + \lambda _ { 2 } ( 1 + \Delta ) ^ { d } } } \end{array}
|
| 312 |
+
$$
|
| 313 |
+
|
| 314 |
+
Proof. The $U ( a , b )$ density (when it isn’t zero) is $\frac { 1 } { C _ { d } \big ( b ^ { d } - a ^ { d } \big ) }$ where $c _ { d }$ is the volume of the $d .$ dimensional unit ball. The proof follows by a simple use of Bayes rule. □
|
| 315 |
+
|
| 316 |
+
so by having $\lambda _ { 1 } > > \lambda _ { 2 } > > \frac { 1 } { ( 1 + \Delta ) ^ { d } }$ 1(1+∆)d we can have the model switch wrongfully predictions from $y = 0$ to $y = 1$ when we move $x$ from the annulus $R ^ { d } ( 1 , 1 + \Delta )$ to $R ^ { d } ( 0 , 1 )$ Lemma 2. I $\begin{array} { r } { \hat { \bf \Phi } \lambda _ { 1 } > \frac { 1 } { ( 1 + \Delta ) ^ { d } } } \end{array}$ and $\lambda _ { 1 } < 1 - e ^ { - \epsilon }$ then $K L ( q ( x , y ) | | P ( x , y ) ) \leq \epsilon$
|
| 317 |
+
|
| 318 |
+
Proof. Using the chain rule for KL divergence, $\mathrm { K L } ( P ( x , y ) | | Q ( x , y ) ) = \mathrm { K L } ( P ( y ) | | Q ( y ) ) +$ $\mathbb { E } _ { y } [ \dot { \mathrm { K L } } ( P ( x \bar { | } y ) | | Q ( x | y ) ) ]$ we get that $\mathrm { K L } ( q ( x , y ) | | P ( x , y ) ) = \mathrm { K L } ( q ( x | y = 0 ) | | P ( x | y = 0 ) )$ . We now have
|
| 319 |
+
|
| 320 |
+
$$
|
| 321 |
+
\begin{array} { r l } & { \mathrm { K L } ( q ( x | y = 0 ) | | P ( x | y = 0 ) ) = \displaystyle \int _ { R ^ { d } ( 0 , 1 ) } \frac { 1 } { C _ { d } ( 1 + \Delta ) ^ { d } } \log \left( \frac { \frac { 1 } { C _ { d } ( 1 + \Delta ) ^ { d } } } { \frac { \lambda _ { 1 } } { C _ { d } } } \right) } \\ & { \mathrm { ~ \ } + \displaystyle \int _ { R ^ { d } ( 1 , 1 + \Delta ) } \frac { 1 } { C _ { d } ( 1 + \Delta ) ^ { d } } \log \left( \frac { \frac { 1 } { C _ { d } ( 1 + \Delta ) ^ { d } } } { \frac { 1 - \lambda _ { 1 } } { C _ { d } ( 1 + \Delta ) ^ { d } - 1 ) } } \right) = \frac { - \log ( \lambda _ { 1 } ( 1 + \Delta ) ^ { d } ) } { ( 1 + \Delta ) ^ { d } } } \\ & { \mathrm { ~ \ } + \frac { ( 1 + \Delta ) ^ { d } - 1 } { ( 1 + \Delta ) ^ { d } } \log \left( \frac { ( 1 + \Delta ) ^ { d } - 1 } { ( 1 - \lambda _ { 1 } ) ( 1 + \Delta ) ^ { d } } \right) \leq \log \left( \frac { 1 } { 1 - \lambda _ { 1 } } \right) < \epsilon } \end{array}
|
| 322 |
+
$$
|
| 323 |
+
|
| 324 |
+
Lemma 3. If $\begin{array} { r } { 1 > \lambda _ { 1 } > \frac { 1 } { ( 1 + \Delta ) ^ { d } } } \end{array}$ and $\begin{array} { r } { \lambda _ { 1 } < \frac { \epsilon } { d \log ( 1 + \Delta ) } } \end{array}$ then $K L ( P ( x , y ) | | q ( x , y ) ) \leq \epsilon$
|
| 325 |
+
|
| 326 |
+
Proof. Again using the KL chain rule we have
|
| 327 |
+
|
| 328 |
+
$$
|
| 329 |
+
\begin{array} { l } { \displaystyle \mathrm { K L } ( P ( x | y = 0 ) | | q ( x | y = 0 ) ) = \lambda _ { 1 } \int _ { R ^ { d } ( 0 , 1 ) } \frac { 1 } { C _ { d } } \log \left( \frac { \frac { \lambda _ { 1 } } { C _ { d } } } { \frac { 1 } { C _ { d } ( 1 + \Delta ) ^ { d } } } \right) } \\ { \displaystyle \int _ { R ^ { d } ( 1 , 1 + \Delta ) } \frac { ( 1 - \lambda _ { 1 } ) } { C _ { d } ( ( 1 + \Delta ) ^ { d } - 1 ) } \log \left( \frac { \frac { ( 1 - \lambda _ { 1 } ) } { C _ { d } ( ( 1 + \Delta ) ^ { d } - 1 ) } } { \frac { 1 } { C _ { d } ( 1 + \Delta ) ^ { d } } } \right) \le \lambda _ { 1 } d \log ( 1 + \Delta ) < \epsilon } \end{array}
|
| 330 |
+
$$
|
| 331 |
+
|
| 332 |
+
Proposition 1. For all $( \epsilon , \delta , \Delta )$ there is a distribution $p$ and an approximation $q$ in dimension $\begin{array} { r } { d = \tilde { \mathcal { O } } \left( \frac { \log \left( \frac { \delta } { 1 + \delta } \right) + \log \left( \frac { 1 } { \epsilon } \right) } { \log \left( 1 + \Delta \right) } \right) } \end{array}$ such that
|
| 333 |
+
|
| 334 |
+
$$
|
| 335 |
+
K L ( q ( x , y ) | | p ( x , y ) ) < \epsilon , ~ K L ( p ( x , y ) | | q ( x , y ) ) < \epsilon
|
| 336 |
+
$$
|
| 337 |
+
|
| 338 |
+
but with probability greater then $1 / 3$ over samples $x \sim p$ there is an adversarial example $\bar { x }$ satisfying
|
| 339 |
+
|
| 340 |
+
1. $y _ { q } ( x ) = y _ { p } ( x )$ with $p ( y _ { p } ( x ) | x )$ and $q ( y _ { q } ( x ) | x )$ greater or equal to $1 - \delta$ . The original point is classifier correctly and confidently.
|
| 341 |
+
|
| 342 |
+
2. $y _ { q } ( x ) \neq y ( \bar { x } )$ , $y _ { q } ( \bar { x } ) = y ( \bar { x } )$ . We change the prediction without changing the ground-truth label.
|
| 343 |
+
|
| 344 |
+
3. $q ( y _ { q } ( \bar { x } ) | \bar { x } ) < \delta$ , $p ( y _ { p } ( \bar { x } ) | \bar { x } ) > 1 - \delta$ . The classifier is confident in its wrong prediction.
|
| 345 |
+
|
| 346 |
+
4. $| | x - \bar { x } | | < \Delta$ . We make a small change to the inputs.
|
| 347 |
+
|
| 348 |
+
5. The density $q ( { \bar { x } } )$ is greater or equal to the median density, making the attack undetectable by observing $q ( x )$ .
|
| 349 |
+
|
| 350 |
+
6. For $\Delta < 1$ the probability in any radius ball can be made as small as desired.
|
| 351 |
+
|
| 352 |
+
7. The total variation of the distribution can be made as small as desired.
|
| 353 |
+
|
| 354 |
+
The last two conditions exclude degenerate trivial counter-exmaples, one where the whole distribution support is in a $\Delta$ radius ball and $\Delta$ does indeed represent a small pertubation. The other condition excludes “pathological" distributions ,e.g. misclassification on a dense zero measure set like the rationals.
|
| 355 |
+
|
| 356 |
+
Proof. In order to satisfy conditions 1-5, using previous lemmas, it is enough that
|
| 357 |
+
|
| 358 |
+
1. λ1λ1+λ2 $\begin{array} { r } { \frac { \lambda _ { 1 } } { \lambda _ { 1 } + \lambda _ { 2 } } \geq 1 - \delta } \end{array}$
|
| 359 |
+
2. $\frac { 1 } { 1 + \lambda _ { 2 } ( 1 + \Delta ) ^ { d } } \leq \delta$
|
| 360 |
+
3. $\lambda _ { 1 } \leq 1 - e ^ { - \epsilon }$
|
| 361 |
+
4. λ1 > 1(1+∆)d
|
| 362 |
+
5. λ1 < d log(1+∆)
|
| 363 |
+
|
| 364 |
+
By setting $\begin{array} { r } { \lambda _ { 2 } = \frac { \delta } { 1 - \delta } \lambda _ { 1 } } \end{array}$ we can easily satisfy condition 1. It is not hard to see that condition 2 is equivalent to $\begin{array} { r } { \lambda _ { 1 } \ge \left( \frac { 1 - \delta } { \delta } \right) ^ { 2 } \frac { 1 } { ( 1 + \Delta ) ^ { d } } } \end{array}$ which superseeds condition 4 when $\delta < 1 / 2$ . Condition 3 can be satisfied with $\lambda _ { 1 } < \epsilon / 2$ by using $1 - x \geq e ^ { - 2 x }$ for $x < 1 / 2$ .
|
| 365 |
+
|
| 366 |
+
This boils down to ensuring $d$ is large enough so that there is a valid $\lambda _ { 1 }$ such as
|
| 367 |
+
|
| 368 |
+
$$
|
| 369 |
+
\left( \frac { 1 - \delta } { \delta } \right) ^ { 2 } \frac { 1 } { ( 1 + \Delta ) ^ { d } } < \lambda _ { 1 } < \frac { \epsilon } { d \log ( 1 + \Delta ) }
|
| 370 |
+
$$
|
| 371 |
+
|
| 372 |
+
Which is true for large enough $d$ as the l.h.s decays exponentially while the r.h.s linearly.
|
| 373 |
+
|
| 374 |
+
Condition 6 is trivial as the radius of the support is fixed so as long as $\Delta < 1$ the probability in any $\Delta$ radius ball decays exponentially. Regarding total variation, we note that from the divergence theorem this can be bounded by a term that depends on the surface area of shperes with fixed radius which decreases to zero as $d$ goes to infinity.
|
| 375 |
+
|
| 376 |
+
# E PIXELCNN $^ { + + }$
|
| 377 |
+
|
| 378 |
+
We trained a conditional Pixel $\mathrm { C N N + + }$ where instead of predicting each new pixel using a mixture of 10 components, we use one mixture component per class. Using reweighting we train using the following objective $- l o g ( p ( x | y ) ) / d i m + \bar { \alpha \cdot } - l o g \bar { ( } p ( y | x ) )$ . As one can see from table 4, standard trainig, i.e. $\alpha = 0$ , results in very poor accuracy, while reweighting the classification score results in much better accuracy but worse NLL.
|
| 379 |
+
|
| 380 |
+
Table 4: Accuracy and NLL for pixel $\mathrm { { C N N + + } }$ on CIFAR10
|
| 381 |
+
|
| 382 |
+
<table><tr><td rowspan=1 colspan=1>a</td><td rowspan=1 colspan=1>acc (%)</td><td rowspan=1 colspan=1>bits/dim</td></tr><tr><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>25.48</td><td rowspan=1 colspan=1>3.05</td></tr><tr><td rowspan=1 colspan=1>1000</td><td rowspan=1 colspan=1>85.78</td><td rowspan=1 colspan=1>3.34</td></tr></table>
|
md/train/rkeqn1rtDH/rkeqn1rtDH.md
ADDED
|
@@ -0,0 +1,428 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# HIERARCHICAL GRAPH MATCHING NETWORKS FOR DEEP GRAPH SIMILARITY LEARNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
While the celebrated graph neural networks yield effective representations for individual nodes of a graph, there has been relatively less success in extending to deep graph similarity learning. Recent work has considered either global-level graph-graph interactions or low-level node-node interactions, ignoring the rich cross-level interactions between parts of a graph and a whole graph. In this paper, we propose a Hierarchical Graph Matching Network (HGMN) for computing the graph similarity between any pair of graph-structured objects. Our model jointly learns graph representations and a graph matching metric function for computing graph similarity in an end-to-end fashion. The proposed HGMN model consists of a multi-perspective node-graph matching network for effectively learning crosslevel interactions between parts of a graph and a whole graph, and a siamese graph neural network for learning global-level interactions between two graphs. Our comprehensive experiments demonstrate that our proposed HGMN consistently outperforms state-of-the-art graph matching network baselines for both classification and regression tasks.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Learning a general similarity metric between arbitrary pairs of graph-structured objects is one of the key challenges in machine learning. Such learning problems often arise in a variety of applications, ranging from graph similar searching in graph-based database (Yan & Han, 2002), to Fewshot 3D Action Recognition (Guo et al., 2018), unknown malware detection (Wang et al., 2019), and promising selection in automatic theory proving (Wang et al., 2017), to name just a few.
|
| 12 |
+
|
| 13 |
+
Conceptually, classical exact (or inexact) graph matching techniques (Ullmann, 1976; Caetano et al., 2009; Bunke & Allermann, 1983; Riesen et al., 2010) provide a strong tool for learning graph similarity. However, these methods usually either require input graphs with similar sizes or consider mainly the graph structures for finding a correspondence between the nodes of different graphs without taking into account the node representations or features. In contrast, in this paper, we consider the graph matching problem of learning a mapping between a pair of graph inputs $( { \dot { G } } ^ { 1 } , G ^ { 2 } ) \in { \mathcal { G } } \times { \mathcal { G } }$ and the similarity score $y \in \mathcal { V }$ , based on a set of training triplet of structured input pairs and scalar output score $( G _ { 1 } ^ { \bar { 1 } } , G _ { 1 } ^ { 2 } , y _ { 1 } ) , . . . , ( G _ { n } ^ { 1 } , G _ { n } ^ { 2 } , y _ { n } ) \in \mathcal { G } \times \mathcal { G } \times \mathcal { Y }$ drawn from some fixed but unknown probability distribution.
|
| 14 |
+
|
| 15 |
+
Recent years have seen a surge of interests in graph neural networks (GNNs), which have been demonstrated to be a powerful class of models for learning node embeddings of graph-structured data (Bronstein et al., 2017). Various GNN models have since been developed for learning effective node representations for node classification (Li et al., 2016; Kipf & Welling, 2016; Hamilton et al., 2017; Velickovi ˇ c et al., 2017), or pooling the learned node embeddings into a graph vector for graph ´ classification (Ying et al., 2018; Ma et al., 2019), or combining with variational auto-encoder to learn the graph distribution for graph generation (Simonovsky & Komodakis, 2018; Li et al., 2018; Samanta et al., 2018; You et al., 2018). However, there is relatively less study on learning graph similarity using GNNs.
|
| 16 |
+
|
| 17 |
+
To learn graph similarity, a simple yet straightforward way is to encode each graph as a vector and combine two vectors of each graph to make a decision. This approach is useful since graphlevel embeddings contain important information of a pair of graphs. One obvious limitation of this approach lies in the fact of the ignorance of more fine-grained interactions among different level embeddings of two graphs. Very recently, a few of attempts have been made to take into account lowlevel interactions either by considering the histogram information of node-wise similarity matrix of node embeddings (Bai et al., 2019) or improving the node embeddings of one graph by incorporating implicit attentive neighbors of another graphs through a soft attention (Li et al., 2019). However, there are two significant challenges making these graph matching models potentially ineffective: i) how to learn different-level granularity (global level and local level) of interactions between a pair of graphs; ii) how to effectively learn richer cross-level interactions between parts of a graph and a whole graph.
|
| 18 |
+
|
| 19 |
+
Inspired by these observations, in this paper, we propose a Hierarchical Graph Matching Network (HGMN) for computing the graph similarity between any pair of graph-structured objects. Our model jointly learns graph representations and a graph matching metric function for computing graph similarity in an end-to-end fashion. The proposed HGMN model consists of a novel multiperspective node-graph matching network for effectively learning cross-level interactions between parts of a graph and a whole graph, and a siamese graph neural network for learning global-level interactions between two graphs. Our final small prediction networks consume these feature vectors from both cross-level and global-level interactions to perform either graph-graph classification or graph-graph regression tasks, respectively.
|
| 20 |
+
|
| 21 |
+
Recently proposed works only compute graph similarity by considering either graph-graph classification problem (with labels $Y = { \bar { \{ - 1 , 1 \} } }$ ) (Li et al., 2019), or graph-graph regression problem (with similarity score $Y = [ 0 , 1 ] ,$ ) (Bai et al., 2019). To demonstrate the effectiveness of our model, we systematically investigate the performance of our HGMN model compared with these recently proposed graph matching models on four datasets for both graph-graph classification and regression tasks. To bridge the gap of the lack of standard graph matching datasets, we also create one new dataset from a real application together with a previously released dataset by ( $\mathrm { { X u } }$ et al., 2017) for graph-graph classification task 1. One important aspect is previous works did not consider the impact of the size of two input graphs, which often plays an important role in determining the performance of graph matching. Motivated by this observation, we have considered three different ranges of graph sizes from [3, 200], [20,200], and [50,200] in order to evaluate the robustness of each graph matching model.
|
| 22 |
+
|
| 23 |
+
We highlight our main contributions of this paper as follows:
|
| 24 |
+
|
| 25 |
+
• We propose a hierarchical graph matching network (HGMN) for computing the graph similarity between any pair of graph-structured objects. Our HGMN model jointly learns graph representations and a graph matching metric function for computing graph similarity in an end-to-end fashion.
|
| 26 |
+
• In particular, we propose a multi-perspective node-graph matching network for effectively capturing the cross-level interactions between a node embeddings of a graph and a corresponding attentive graph-level embedding of another graph.
|
| 27 |
+
We systematically investigate different factors on the performance of all graph matching models such as the impact of different tasks (classification and regression) and the sizes of input graphs.
|
| 28 |
+
Our comprehensive experiments demonstrate that our proposed HGMN consistently outperforms state-of-the-art graph matching network baselines for both classification and regression tasks. Compared with previous works, our proposed model HGMN is also more robust when the sizes of the two input graphs increase.
|
| 29 |
+
|
| 30 |
+
# 2 PROBLEM FORMULATION
|
| 31 |
+
|
| 32 |
+
In this section, we briefly introduce the problem formulation. Given a pair of graph inputs $( G ^ { 1 } , G ^ { 2 } )$ , the aim of the graph matching problem we consider in this paper is to produce a graph similarity score $y = s ( \bar { G } ^ { 1 } , \bar { G } ^ { 2 } ) \in \mathcal { V }$ . The graph $G ^ { 1 } = ( V ^ { 1 } , E ^ { 1 } )$ is represented as a set of $N$ nodes $v _ { i } \in$ $V ^ { 1 }$ with a feature matrix $X ^ { 1 } \in \tilde { \mathcal { R } } ^ { N \times d }$ , edges $( \dot { v } _ { i } , v _ { j } ) \in E ^ { 1 }$ (binary or weighted) formulating anř adjacency matrix $A ^ { 1 } \in \mathcal { R } ^ { N \times N }$ , and a degree matrix $\begin{array} { r } { D _ { i i } ^ { 1 } = \sum _ { j } A _ { i j } ^ { 1 } } \end{array}$ . Similarly, the graph $G ^ { 2 } =$ $( V ^ { 2 } , E ^ { 2 } )$ is represented as a set of $M$ nodes $v _ { i } \in V ^ { 2 }$ with a feature matrix $X ^ { 2 } \in \mathcal { R } ^ { M \times d }$ , edges $( v _ { i } , v _ { j } ) \in E ^ { 2 }$ (binary or weighted) formulating an adjacency matrix ř $A ^ { 2 } \in \mathcal { R } ^ { M \times M }$ , and a degree matrix $\begin{array} { r } { D _ { i i } ^ { 2 } = \sum _ { j } A _ { i j } ^ { 2 } } \end{array}$ . Note that, when performing graph-graph classification task the scalar $y$ is the class labels $\begin{array} { r } { { \dot { y } } = \{ - 1 , 1 \} } \end{array}$ ; when performing graph-graph regression task the scalar $y$ is the the measure of the similarity score $y \in [ 0 , 1 ]$ . We train a graph matching model based on a set of training triplet of structured input pairs and scalar output score ${ \bar { ( G _ { 1 } ^ { 1 } , G _ { 1 } ^ { 2 } , y _ { 1 } { \bar { ) } } } } , . . . , ( G _ { n } ^ { 1 } , G _ { n } ^ { 2 } , Y _ { n } ) \in { \mathcal { G } } \times { \mathcal { G } } \times { \bar { \mathcal { y } } }$ drawn from some fixed but unknown probability distribution in real applications.
|
| 33 |
+
|
| 34 |
+

|
| 35 |
+
Figure 1: Overall Model Architecture of Hierarchical Graph Matching Networks (HGMN)
|
| 36 |
+
|
| 37 |
+
# 3 HIERARCHICAL GRAPH MATCHING NETWORKS ARCHITECTURE
|
| 38 |
+
|
| 39 |
+
In this section, we will introduce two key components of our HGMN architecture - Siamese Graph Neural Networks (SGNN) and Multi-Perspective Node-Graph Matching Networks (MPNGMN). We first discuss SGNN for learning the global-level interactions between two graphs and then outline MPNGMN for effectively learning the cross-level node-graph interactions between parts of one graph and one whole graph. Our overall model architecture for HGMN is shown in Fig. 1.
|
| 40 |
+
|
| 41 |
+
# 3.1 SGNN FOR GLOBAL-LEVEL INTERACTION LEARNING
|
| 42 |
+
|
| 43 |
+
The graph-level embeddings contain important information of a graph. Therefore, learning graphlevel interactions between two graphs could be an important component for learning the graph similarity of two graphs. In order to capture the global-level interactions between two graphs, we employ SGNN which is based on Siamese Networks architecture (Bromley et al., 1994), which has achieved great success in many applications such as visual recognition (Bertinetto et al., 2016; Varior et al., 2016) and sentence similarity (He et al., 2015; Mueller & Thyagarajan, 2016). Independently, a similar idea using high-order siamese graph neural networks was presented for brain network analysis (Chaudhuri et al., 2019).
|
| 44 |
+
|
| 45 |
+
Our SGNN adapts popular Graph Convolution Networks (GCN) (Kipf & Welling, 2016) with siamese neural networks for simplicity. Other variants of graph neural networks such as GraphSAGE (Hamilton et al., 2017) and Gated Graph Neural Networks (Li et al., 2016) can also be used. Our SGNN consists of three components: 1) node embedding layers; 2) graph-level embedding aggregation layers; 3) graph-graph matching and prediction layers.
|
| 46 |
+
|
| 47 |
+
Node Embeembeddings $H ^ { l } = \{ \mathbf { h } _ { i } ^ { l } \} _ { i = 1 } ^ { \{ N , M \} } \in \mathcal { R } ^ { \{ N , M \} \times d ^ { \prime } }$ layer GCN witof both graphs ´ $G ^ { 1 }$ e siaand ¯ $G ^ { 2 }$ e networks to generate node,¯ ¯
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
{ \cal H } ^ { l } = f ( X ^ { l } , A ^ { l } ) = \mathrm { R e L U } \Big ( \bar { A } ^ { l } \mathrm { R e L U } \Big ( \bar { A } ^ { l } \mathrm { R e L U } \Big ( \bar { A } ^ { l } X ^ { l } W ^ { ( 0 ) } \Big ) W ^ { ( 1 ) } \Big ) W ^ { ( 2 ) } \Big ) , l = \{ 1 , 2 \} .
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
where $\bar { A } ^ { l } = ( \widetilde { D } ^ { l } ) ^ { - \frac { 1 } { 2 } } \widetilde { A } ^ { l } ( \widetilde { D } ^ { l } ) ^ { - \frac { 1 } { 2 } }$ is the normalized Laplacian matrix for $\widetilde { A } ^ { l } = A ^ { l } + I _ { \{ N , M \} }$ depending on the graph is $G ^ { 1 }$ or $G ^ { 2 }$ , and $W ^ { ( i ) } , i = \{ 0 , 1 , 2 \}$ are hidden weighted matrices for each layer. Note
|
| 54 |
+
|
| 55 |
+
that the twin networks share the parameters of GCN when training on the pair of graphs $( G ^ { 1 } , G ^ { 2 } )$ . The number of GCN layers required depends on the real application graph data. To isolate the effect of overtuning, we choose the three layers after some initial experiments on validation sets.
|
| 56 |
+
|
| 57 |
+
Graph-level Embedding Aggregation Layers. After we compute the resulting node embeddings $H ^ { l }$ of each graph from GCN, we need to aggregate these node embeddings to formulate their corresponding graph-level embeddings of each graph.
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
{ \bf h } _ { G } ^ { l } = \mathrm { A g g r e g a t e } \Big ( \{ { \bf h } _ { i } ^ { l } \} _ { i = 1 } ^ { \{ N , M \} } \Big ) , \quad l = \{ 1 , 2 \} .
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
We employ different aggregation functions such as element-wise max pooling (Max), elementwise max pooling following a transformation by applying a fully connected layer on $H ^ { i }$ (FCMax), element-wise mean pooling (Avg), element-wise mean pooling following a transformation by applying a fully connected layer on $H ^ { i }$ (FCAvg), and a sophisticated aggregator based on LSTM architecture (Hochreiter & Schmidhuber, 1997a). Note that, among these aggregation functions, the LSTM aggregator is not permutation invariant on a set of node embeddings although LSTM may admit more expressive ability. We adapt LSTMs to operate on these node embeddings by simply applying the LSTMs to a random permutation of the node embeddings.
|
| 64 |
+
|
| 65 |
+
Graph-Graph Matching and Prediction Layers. After the graph-level embeddings $\mathbf { h } _ { \mathbf { G } } ^ { \mathbf { 1 } }$ and $\mathbf { h } _ { \mathbf { G } } ^ { 2 }$ are computed for the graphs $G ^ { 1 }$ and $G ^ { 2 }$ , we then use the resulting graph embeddings to compute the graph similarity score of $( G ^ { 1 } , G ^ { 2 } )$ . Depending on the specific tasks, we have slightly different ways to calculate the final similarity score. For classification tasks, we simply compute the cosine similarity of two graph-level embeddings,
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\widetilde { y } = s ( G ^ { 1 } , G ^ { 2 } ) = c o s i n e ( \mathbf { h _ { G } ^ { 1 } } , \mathbf { h _ { G } ^ { 2 } } )
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
where the similarity function $s$ could also be other similarity metric such as Euclidean similarity and dot-product similarity. We find that the cosine similarity function performs generally better across different datasets.
|
| 72 |
+
|
| 73 |
+
For regression tasks, we first concatenate the two aggregated graph embeddings to $[ \mathbf { h } _ { \mathbf { G } } ^ { \mathbf { 1 } } , \mathbf { h } _ { \mathbf { G } } ^ { \mathbf { 2 } } ]$ and then employ four standard fully connected layers to gradually project the vector of dimension $[ \mathbf { h } _ { \mathbf { G } } ^ { \mathbf { 1 } } , \mathbf { h } _ { \mathbf { G } } ^ { \mathbf { 2 } } ]$ down to a scalar of the dimension 1. Since the expected similar score $\widetilde { y }$ should be in range of [0,1], we perform sigmoid function to enforce the final score in this range. We therefore compute the similarity score for graph-graph regression task as following,
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\widetilde { y } = s ( G ^ { 1 } , G ^ { 2 } ) = \mathrm { s i g m o i d } \Big ( \mathrm { M L P } \Big ( [ \mathbf { h _ { G } ^ { 1 } } , \mathbf { h _ { G } ^ { 2 } } ] \Big ) \Big ) .
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
For both tasks, we train the SGNN model using mean square error loss function to compare the computed similarity score $\widetilde { y }$ with the groud-truth similarity score $y$ ,
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\mathcal { L } = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \Big ( \widetilde { y } - y \Big ) ^ { 2 } .
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
# 3.2 MPNGMN FOR CROSS-LEVEL NODE-GRAPH INTERACTION LEARNING
|
| 86 |
+
|
| 87 |
+
Although global-level interaction learning could capture the important structural and feature information of two graphs to some extent, it is not enough to capture all important information of two graphs since they ignore other low-level interactions between parts of two graphs. In particular, existing works have considered either global-level graph-graph interactions or low-level node-node interactions, ignoring the rich cross-level interactions between parts of a graph and a whole graph. Inspired by these observations, we propose a novel multi-perspective node-graph matching network to effectively learn the cross-level interaction features. Our MPNGMN model consists of four parts: 1) node embedding layers; 2) node-graph matching layers; 3) aggregation layers; and 4) prediction layers, as shown in Fig. 1. We will illustrate each part in details as follows.
|
| 88 |
+
|
| 89 |
+
Node Embedding Layers: Similar as described in Sec. 3.1, we choose to employ the three-layer GCN to generate node embeddings $H ^ { 1 } = \{ { \bf h } _ { i } ^ { 1 } \} _ { i = 1 } ^ { N } \in { \mathcal R } ^ { N \times d ^ { \prime } }$ and $H ^ { 2 } = \{ { \bf h } _ { i } ^ { 2 } \} _ { i = 1 } ^ { M } \in \mathcal { R } ^ { M \times d ^ { \prime } }$ for graphs $\bar { G ^ { 1 } }$ and $G ^ { 2 }$ . Conceptually, the node embedding layers of MPNGMN (graph encoder) could be chosen to be an independent GCN or a shared GCN with SGNN. As shown in Fig. 1, our MPNGMN shares the same graph encoder with SGNN due to two reasons: i) the shared GCN parameters reduce the number of parameters by half, which helps mitigate possible overfitting; ii) the shared
|
| 90 |
+
|
| 91 |
+
GCN maintains the consistency of resulting node embeddings for both MPNGMN and SGNN, potentially leading to more aligned global-level interaction and cross-level interaction features. After the node embeddings $H ^ { 1 }$ and $H ^ { \widetilde { 2 } }$ have been computed, they will be fed into the following nodegraph matching layers.
|
| 92 |
+
|
| 93 |
+
Node-Graph Matching Layers: The node-graph matching layer is the key part of our MPNGMN, which can effectively learn the cross-level interactions between parts of a graph and a whole graph. There are generally two steps for this layer: i) calculate the graph-level embedding of a graph; ii) compare the node embeddings of a graph with the associated graph-level embeddings of a whole graph and then produce a similarity feature vector. A simple way to obtain the graph-level embedding of a graph is to perform element-wise mean pooling or max pooling. However, it does not consider any information from the node embedding that the resulting graph-level embedding will compare with later. To build more tight interactions between the two, we calculate the cross-graph attention coefficients between the node $v _ { i } \in \mathcal { V } ^ { 1 }$ in graph $G ^ { 1 }$ and all other nodes $v _ { j } \in \mathcal V ^ { 2 }$ in graph $G ^ { 2 }$ . Similarly, we calculate the cross-graph attention coefficients between the node $v _ { i } \in \mathcal { V } ^ { 2 }$ in graph $G ^ { 2 }$ and all other nodes $v _ { j } \in \mathcal V ^ { 1 }$ in graph $G ^ { 1 }$ . These two cross-graph attention coefficients can be computed independently,
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\alpha _ { i , j } = f _ { s } ( \mathbf { h } _ { i } ^ { 1 } , \mathbf { h } _ { j } ^ { 2 } ) , \ j \in \mathscr { V } ^ { 2 } \quad \mathrm { a n d } \quad \beta _ { i , j } = f _ { s } ( \mathbf { h } _ { i } ^ { 2 } , \mathbf { h } _ { j } ^ { 1 } ) , \ j \in \mathscr { V } ^ { 1 } ,
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
where $f _ { s }$ is the attention function for computing the similarity score. For simplicity, we use cosine function in our experiments but other similarity metrics can be adopted as well. Then we compute the attentive graph-level embeddings $\tilde { \mathbf { h } } _ { G } ^ { 1 }$ or $\tilde { \mathbf { h } } _ { G } ^ { 2 } \in \mathcal { R } ^ { d ^ { \prime } }$ using weighted average of node embeddings of the other graph,
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\widetilde { \mathbf { h } } _ { G } ^ { 2 } = \sum _ { j \in \mathscr { V } ^ { 2 } } \alpha _ { i , j } \mathbf { h } _ { j } ^ { 2 } \quad \mathrm { a n d } \quad \widetilde { \mathbf { h } } _ { G } ^ { 1 } = \sum _ { j \in \mathscr { V } ^ { 1 } } \beta _ { i , j } \mathbf { h } _ { j } ^ { 1 } .
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
Next, we define our multi-perspective matching function $f _ { m }$ to compute the similarity feature vector by comparing two vectors as follows,
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\widetilde { \mathbf { h } } ( i ) = f _ { m } ( \mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } , \mathbf { w } _ { i } ) = f _ { m } ( \mathbf { x } _ { 1 } \odot \mathbf { w } _ { i } , \mathbf { x } _ { 2 } \odot \mathbf { w } _ { i } ) , i = 1 , \ldots , \widetilde { d }
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
where $\widetilde { \mathbf { h } } \in \mathcal { R } ^ { \tilde { d } }$ is a $\widetilde { d } .$ -dimension similarity feature vector, and $W _ { m } = \{ \mathbf { w } _ { i } \} _ { i = 1 } ^ { \tilde { d } } \in \mathcal { R } ^ { d ^ { \prime } \times \tilde { d } }$ is a trainable weight matrix and each $\mathbf { w } _ { i }$ represents a perspective with total $\tilde { d }$ number of perspectives. Notably, $f _ { m }$ could be any similarity function and we use cosine similarity metric in our experiments. It is worth noting that the proposed multi-perspective matching function essentially shares similar spirit with multi-head attention (Vaswani et al., 2017), with the difference that multi-head attention uses $\tilde { d }$ number of weighted matrices instead of vectors.
|
| 112 |
+
|
| 113 |
+
Therefore, we can utilize our defined multi-perspective matching function $f _ { m }$ to compare the $j$ -th node embeddings of a graph with the corresponding attentive graph-level embeddings to capture the cross-level node-graph interactions. The resulting similarity feature vectors $\widetilde { \mathbf { h } } _ { j } ^ { 1 }$ or $\tilde { \mathbf { h } } _ { j } ^ { 2 } \in \mathcal { R } ^ { \tilde { d } }$ (w.r.t the node $v _ { j }$ in either graph $G ^ { 1 }$ or $G ^ { 2 }$ ) can thus be computed by
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
\widetilde { \mathbf { h } } _ { j } ^ { 1 } = f _ { m } \big ( \mathbf { h } _ { j } ^ { 1 } , \widetilde { \mathbf { h } } _ { G } ^ { 2 } , W _ { m } \big ) , \ j \in \mathcal { V } _ { 1 } \quad \mathrm { a n d } \quad \widetilde { \mathbf { h } } _ { j } ^ { 2 } = f _ { m } \big ( \mathbf { h } _ { j } ^ { 2 } , \widetilde { \mathbf { h } } _ { G } ^ { 1 } , W _ { m } \big ) , \ j \in \mathcal { V } _ { 2 }
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
After the node-graph matching layers, these newly produced interaction feature matrices $\tilde { H } ^ { 1 } =$ $\{ \tilde { \mathbf { h } } _ { i } ^ { 1 } \} _ { i = 1 } ^ { N } \in \mathcal { R } ^ { N \times \tilde { d } }$ and $\tilde { H } ^ { 2 } = \{ \bar { \mathbf { h } } _ { i } ^ { 2 } \} _ { i = 1 } ^ { M } \in \mathcal { R } ^ { M \times \tilde { d } }$ for graphs $G ^ { 1 }$ and $G ^ { 2 }$ , are ready to feed them into the aggregation layers.
|
| 120 |
+
|
| 121 |
+
Aggregation Layers: To aggregate these cross-level interaction feature matrix from the node-graph matching layer, we employ the BiLSTM (Hochreiter & Schmidhuber, 1997b) model to aggregate the unordered feature embeddings,
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
\widetilde { \bf h } _ { G } ^ { l } = { \tt B i L S T M } \Big ( \{ { \widetilde { \bf h } _ { j } ^ { l } } \} _ { j = 1 } ^ { \{ N , M \} } \Big ) , \quad l = \{ 1 , 2 \} .
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
where $\tilde { \mathbf { h } } _ { G } ^ { l } \in \mathcal { R } ^ { 2 \tilde { d } }$ concatenate the last hidden vectors of two directions as the aggregated graph embedding for each graph $G ^ { 1 }$ and $G ^ { 2 }$ . Note that other commutative aggregators such as max, average, or attention based aggregation (Velickovi ˇ c et al., 2017) can also be used. However, our ´ extensive experiments showed that BiLSTM aggregator achieved consistent better performance over other aggregators. Similar LSTM-type aggregator has also been exploited in the previous works (Hamilton et al., 2017; Zhang et al., 2019).
|
| 128 |
+
|
| 129 |
+
Prediction Layers: After the aggregated graph embeddings $\tilde { \mathbf { h } } _ { G } ^ { 1 }$ and $\tilde { \mathbf { h } } _ { G } ^ { 2 }$ are obtained, we then use these two embeddings to compute the similarity score of $( \breve { G } ^ { 1 } , G ^ { 2 } )$ . As discussed in Sec.3.1 for graph-graph matching and prediction layers, we use the same prediction layers to predict the similarity score. We also use the same mean square error loss function for the model training. In this way, we can also easily compare the performance difference between SGNN and MPNGMN.
|
| 130 |
+
|
| 131 |
+
# 3.3 DISCUSSIONS ON HGMN MODEL
|
| 132 |
+
|
| 133 |
+
Our model jointly learns graph representations and a graph matching metric function for computing graph similarity in an end-to-end fashion. Our HGMN model combines the advantages of both SGNN and MPNGMN to capture both global-level graph-graph interaction features and novel crosslevel node-graph interaction features between two graphs. Therefore, for final prediction layers of HGMN, we have total six aggregated graph embedding vectors where two of them are $\mathbf { h } _ { G } ^ { 1 }$ and $\mathbf { h } _ { G } ^ { 2 }$ from SGNN, and another four are $\tilde { \mathbf { h } } _ { G } ^ { 1 }$ and $\tilde { \mathbf { h } } _ { G } ^ { 2 }$ from MPNGMN.
|
| 134 |
+
|
| 135 |
+
The computation complexity of SGNN is $O ( ( | E ^ { 1 } | + | E ^ { 2 } | ) d d ^ { \prime } )$ , where the most dominant computation is sparse matrix-matrix operations in equation 1. Similarly, the computational complexity of MPNGMN is $O ( N M d + ( N + M ) d ^ { \prime } + ( N + M ) d d ^ { \prime } )$ , where the most computationally extensive operations are in equations 7, 8, and 9. Compared to recently proposed works in (Bai et al., 2019; Li et al., 2019), the computational complexity of them are comparable.
|
| 136 |
+
|
| 137 |
+
# 4 EXPERIMENTS
|
| 138 |
+
|
| 139 |
+
In this section, we systematically investigate the performance of our HGMN model compared with other recently proposed graph matching models on four datasets for both classification and regression tasks.
|
| 140 |
+
|
| 141 |
+
Table 1: Summary statistics of datasets for both classification & regression tasks.
|
| 142 |
+
|
| 143 |
+
<table><tr><td rowspan=1 colspan=1>Tasks</td><td rowspan=1 colspan=1>Datasets</td><td rowspan=1 colspan=1>Sub-datasets</td><td rowspan=1 colspan=1>#ofGraphs</td><td rowspan=1 colspan=1>#ofFunctions</td><td rowspan=1 colspan=1>AVG #of Nodes</td><td rowspan=1 colspan=1>AVG #of Edges</td><td rowspan=1 colspan=1>AVG # ofAVG Degrees</td><td rowspan=1 colspan=1>Init FeatureDimensions</td></tr><tr><td rowspan=2 colspan=1>classif-ication</td><td rowspan=1 colspan=1>FFmpeg</td><td rowspan=1 colspan=1>[3,200][20,200][50,200]</td><td rowspan=1 colspan=1>830083169610824</td><td rowspan=1 colspan=1>1037676683178</td><td rowspan=1 colspan=1>18.8351.0290.93</td><td rowspan=1 colspan=1>27.0275.88136.83</td><td rowspan=1 colspan=1>2.592.943.00</td><td rowspan=1 colspan=1>6</td></tr><tr><td rowspan=1 colspan=1>OpenSSL</td><td rowspan=1 colspan=1>[3,200][20,200][50,200]</td><td rowspan=1 colspan=1>73953158004308</td><td rowspan=1 colspan=1>42491073338</td><td rowspan=1 colspan=1>15.7344.8983.68</td><td rowspan=1 colspan=1>21.9767.15/127.75</td><td rowspan=1 colspan=1>2.442.953.04</td><td rowspan=1 colspan=1>6</td></tr><tr><td rowspan=2 colspan=1>regre-ssion</td><td rowspan=1 colspan=1>AIDS700</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>700</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>8.90</td><td rowspan=1 colspan=1>8.80</td><td rowspan=1 colspan=1>1.96)</td><td rowspan=1 colspan=1>29</td></tr><tr><td rowspan=1 colspan=1>LINUX1000</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>1000</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>7.58</td><td rowspan=1 colspan=1>6.94</td><td rowspan=1 colspan=1>1.81</td><td rowspan=1 colspan=1>1</td></tr></table>
|
| 144 |
+
|
| 145 |
+
4.1 DATASETS, EXPERIMENTS SETTINGS, AND BASELINES
|
| 146 |
+
|
| 147 |
+
# 4.1.1 DATASETS
|
| 148 |
+
|
| 149 |
+
Classification datasets: we evaluate our model on the problem of detecting similarity between two binary functions, which is the heart of many binary security problems, such as software plagiarism, malware detection, and vulnerability search (Feng et al., 2016; Xu et al., 2017; Ding et al., 2019). In particular, two binary functions that are compiled from the same source code but under different settings (architectures, compilers, optimization levels, etc) are semantically similar to each other. To learn similarity from binary functions, we represent those binaries with control flow graphs, in which the graph nodes represent the basic blocks (a basic block is a sequence of instructions without jumps) and edges represent control flow paths between these basic blocks.
|
| 150 |
+
|
| 151 |
+
Thus, detecting similarity between two binary functions can be cast as the problem of learning the similarity score $s ( G ^ { 1 } , G ^ { \bar { 2 } } )$ between two control flow graphs $G ^ { 1 }$ and $G ^ { 2 }$ , where $s ( G ^ { 1 } , G ^ { 2 } ) \stackrel { \smile } { = } + 1$ indicates $G ^ { 1 }$ and $G ^ { 2 }$ are similar; otherwise $s ( G ^ { 1 } , G ^ { \ 5 } ) \ = \ - 1$ indicates dissimilar. We prepare two benchmark datasets generated from two pieces of popular open-source software: FFmpeg and OpenSSL, with statistics shown in Table 1. For each graph in FFmpeg and OpenSSL, we initialize every node with 6 block-level numeric features. More details about the dataset generation and node features can be found in Appendix A.1.1 and Table 7.
|
| 152 |
+
|
| 153 |
+
Existing graph matching works do not consider the impact of the sizes of graphs on performance. However, we find that the larger the graph size is, the worse the performance is. Therefore, it is important to evaluate the robustness of any graph matching networks in this setting. We thus further split these two datasets into three sub-datasets according to the size range of graph pairs.
|
| 154 |
+
|
| 155 |
+
Regression datasets: we evaluate our model on learning the graph edit distance (GED) (Zeng et al., 2009; Gao et al., 2010; Riesen, 2015), which measures the structural similarity between two graphs. Formally, GED is defined as the cost of the least expensive sequence of edit operations that transform one graph into another, where an edit operation can be an insertion or a deletion of a node or an edge.
|
| 156 |
+
|
| 157 |
+
We evaluate our model on two benchmark datasets AIDS700 and LINUX1000 2. The statistic for the datasets is shown in Table 1, and more details can be found in Appendix A.1.2 and Table 7.
|
| 158 |
+
|
| 159 |
+
# 4.1.2 EXPERIMENTAL SETUP
|
| 160 |
+
|
| 161 |
+
Model Settings. For SGNN, we use 3 GCN layers in node embedding layer and each of the GCNs has an output dimension of 100. We use ReLU as the activation function along with a dropout layer after each GCN layer with dropout rate being 0.1. In the graph-level embedding aggregation layer of SGNN, we can employ different aggregation functions (i,e., Max, FCMax, Avg, FCAvg, BiLSTM, etc.) as stated previously in Section 3.1. For MPNGMN, we exploited different aggregation functions similar to SGNN and we found that BiLSTM aggregator consistently performs better than other aggregation functions (see appendix A.4). Thus, for MPNGMN, we always use BiLSTM as our default aggregation function and we make its hidden size equal to the dimension of node embeddings. For MPNGMN, we set the number of perspectives $\tilde { d }$ to 100, and use another aggregation function BiLSTM to aggregate the output of node-graph matching layer. For each graph, we concatenate the last hidden vector of two directions of BiLSTM, which results in a 200 dimensions vector as the graph embeddings.
|
| 162 |
+
|
| 163 |
+
Implementation Details. We implement our model using PyTorch 1.1 (Paszke et al., 2017), and train the model using the Adam optimizer (Kingma & Ba, 2014). The learning rate is set to $0 . 5 \mathrm { e } { - 3 }$ for classification tasks and 5e-3 for regression tasks. For classification tasks, we split each dataset into three disjoint subsets of binary functions for training/validation/testing. We train our model by running 100 epochs. At each epoch, we build the pairwise training data as follows. For each graph $G$ in training subset, we obtain one positive pair $\{ ( G , G ^ { p o s } ) , + 1 \}$ and a corresponding negative pair $\{ ( G , G ^ { n e g } ) , - 1 \}$ , where $G ^ { p o s }$ is randomly selected from all control flow graphs that compiled from the same source function as $G$ , and $G ^ { n e g }$ is selected from other graphs. By default, for each minibatch in one epoch, we train our model with 5 positive and 5 negative pairs. In regression tasks, we first split graphs of each dataset into training, validation, and testing set, and then build the pairwise training/validation/testing data as previous work Bai et al. (2019). We train our model by 10000 iterations with a mini-batch of 128 graph pairs. Each pair is a tuple of $\{ ( G ^ { 1 } , G ^ { 2 } ) , s \}$ , where $s$ is the ground-truth GED between $G ^ { 1 }$ and $G ^ { 2 }$ . Noted that all experiments are conducted on a computer equipped with 2 Intel Xeon 2.2GHz CPU, 256 GB memory and one NVIDIA GTX 1080 Ti GPU.
|
| 164 |
+
|
| 165 |
+
Baselines. We compared our HGMN against the following baselines: i) SimGNN (Bai et al. (2019)): SimGNN uses GCN to update node features and aggregates them using an attention mechanism. The final pair representation consists of 2 components: One from the interaction between aggregated pair graph features and the other from a pairwise node comparison. ii) GMN (Li et al. (2019)): This method updates node features according to not only current states and messages aggregated from neighborhoods but also information of attentive neighborhoods using cross-graph attention. After updating node features, it aggregates node features in a way similar to that in Gated Graph Neural Network (Li et al. (2016)) to get graph embedding. We have two variants of HGMN: HGMN(FCMax) stands for HGMN model with SGNN(FCMax) and HGMN(BiLSTM) stands for HGMN model with SGNN(BiLSTM).
|
| 166 |
+
|
| 167 |
+
Note that, we report the mean and standard deviation of the experimental results of both baseline and our models by repeating the experiments five times.
|
| 168 |
+
|
| 169 |
+
# 4.2 COMPARISON ON GRAPH-GRAPH CLASSIFICATION TASK
|
| 170 |
+
|
| 171 |
+
Table 2: Summary of classification results in terms of AUC scores (%).
|
| 172 |
+
|
| 173 |
+
<table><tr><td rowspan="2">Model</td><td colspan="3">FFmpeg</td><td colspan="3">OpenSSL</td></tr><tr><td>[3,200]</td><td>[20,200]</td><td>[50,200]</td><td>[3,200]</td><td>[20,200]</td><td>[50,200]</td></tr><tr><td>SimGNN</td><td>95.38±0.76</td><td>94.31±1.01</td><td>93.45±0.54</td><td>95.96±0.31</td><td>93.58±0.82</td><td>94.25±0.85</td></tr><tr><td>GMN</td><td>94.15±0.62</td><td>95.92±1.38</td><td>94.76±0.45</td><td>96.43±0.61</td><td>93.03±3.81</td><td>93.91±1.65</td></tr><tr><td>SGNN (Max)</td><td>93.92±0.07</td><td>93.82±0.28</td><td>85.15±1.39</td><td>91.07±0.10</td><td>88.94±0.47</td><td>82.10±0.51</td></tr><tr><td>MPNGMN</td><td>97.73±0.11</td><td>98.29±0.21</td><td>96.81±0.96</td><td>96.56±0.12</td><td>97.60±0.29</td><td>92.89±1.31</td></tr><tr><td>HGMN (FCMax)</td><td>98.07±0.06</td><td>98.29±0.10</td><td>97.83±0.11</td><td>96.87±0.24</td><td>97.59±0.24</td><td>95.58±1.13</td></tr><tr><td>HGMN (BiLSTM)</td><td>97.56±0.38</td><td>98.12±0.04</td><td>97.16±0.53</td><td>96.90±0.10</td><td>97.31±1.07</td><td>95.87±0.88</td></tr></table>
|
| 174 |
+
|
| 175 |
+
For the classification task of detecting whether two binary functions are similar or not, we measure the Area Under the ROC Curve (AUC) (Bradley, 1997) of different models for classifying graph pairs of the same test set, and summarize the results in Table 2.
|
| 176 |
+
|
| 177 |
+
The results show that our models clearly achieve state-of-the-art performance on all 6 sub-datasets for both FFmpeg and OpenSSL datasets. Both MPNGMN and HGMN models show better and more robust performance than the SimGNN and GMN baselines, particularly when the graph size of the two graphs increases. Compared with the SGNN (Max), our models (both MPNGMN and HGMN models) significantly outperform it, demonstrating the benefits of multi-perspective nodegraph matching mechanism that captures the cross-level interactions between node embeddings of a graph and graph-level embeddings of another graph. More experiments compared with SGNN models using other aggregation functions can be found in Appendix A.3.
|
| 178 |
+
|
| 179 |
+
# 4.3 COMPARISON ON GRAPH-GRAPH REGRESSION TASK
|
| 180 |
+
|
| 181 |
+
Table 3: Summary of regression results on AIDS700 and LINUX1000.
|
| 182 |
+
|
| 183 |
+
<table><tr><td>Datasets</td><td>Model</td><td>mse(10-)</td><td>p</td><td>T</td><td>p@10</td><td>p@20</td></tr><tr><td rowspan="5">AIDS700</td><td>SimGNN</td><td>1.376±0.066</td><td>0.824±0.009</td><td>0.665±0.011</td><td>0.400±0.023</td><td>0.489±0.024</td></tr><tr><td>GMN</td><td>4.610±0.365</td><td>0.672±0.036</td><td>0.497±0.032</td><td>0.200±0.018</td><td>0.263±0.018</td></tr><tr><td>SGNN (Max)</td><td>2.822±0.149</td><td>0.765±0.005</td><td>0.588±0.004</td><td>0.289±0.016</td><td>0.373±0.012</td></tr><tr><td>MPNGMN</td><td>1.191±0.048</td><td>0.904±0.003</td><td>0.749±0.005</td><td>0.465±0.011</td><td>0.538±0.007</td></tr><tr><td>HGMN (FCMax) HGMN (BiLSTM)</td><td>1.205±0.039</td><td>0.904±0.002</td><td>0.749±0.003</td><td>0.457±0.014</td><td>0.532±0.016</td></tr><tr><td rowspan="6">LINUX 1000</td><td></td><td>1.169±0.036</td><td>0.905±0.002</td><td>0.751±0.003</td><td>0.456±0.019</td><td>0.539±0.018</td></tr><tr><td>SimGNN</td><td>2.479±1.038</td><td>0.912±0.031</td><td>0.791±0.046</td><td>0.635±0.328</td><td>0.650±0.283</td></tr><tr><td>GMN</td><td>2.571±0.519</td><td>0.906±0.023</td><td>0.763±0.035</td><td>0.888±0.036</td><td>0.856±0.040</td></tr><tr><td>SGNN (Max)</td><td>11.832±0.698</td><td>0.566±0.022</td><td>0.404±0.017</td><td>0.226±0.106</td><td>0.492±0.190</td></tr><tr><td>MPNGMN</td><td>1.561±0.020</td><td>0.945±0.002</td><td>0.814±0.003</td><td>0.743±0.085</td><td>0.741±0.086</td></tr><tr><td>HGMN (FCMax) HGMN (BiLSTM)</td><td>1.575±0.627 0.439±0.143</td><td>0.946±0.019 0.985±0.005</td><td>0.817±0.034 0.919±0.016</td><td>0.807±0.117 0.955±0.011</td><td>0.784±0.108 0.943±0.014</td></tr></table>
|
| 184 |
+
|
| 185 |
+
For the regression task of computing the graph edit distance between two graphs, we evaluate the models using Mean Square Error (mse), Spearmans Rank Correlation Coefficient $( \rho )$ (Spearman, 1904), Kendalls Rank Correlation Coefficient $( \tau )$ (Kendall, 1938), and precision at k $( \boldsymbol { \mathrm { p } } @ \boldsymbol { \mathrm { k } } )$ . All results of both AIDS700 and LINUX1000 datasets are summarized in Table 3. In terms of all evaluation metrics, our models consistently outperform both SimGNN and GMN baseline models by a significant margin on both AIDS700 and LINUX1000 datasets. On the other hand, compared with SGNN (Max), our models achieve much better performance (see Appendix A.3 for more experiments compared with other SGNN models). The results highlight the importance of our multiperspective node-graph matching mechanism which could effectively capture cross-level node-graph interactions between parts of a graph and a whole graph.
|
| 186 |
+
|
| 187 |
+
Table 4: Classification results of Multi-Perspectives versus Multi-Heads in terms of AUC scores(%).
|
| 188 |
+
|
| 189 |
+
<table><tr><td rowspan="2">Model</td><td colspan="3">FFmpeg</td><td colspan="3">OpenSSL</td></tr><tr><td>[3,200]</td><td>[20,200]</td><td>[50,200]</td><td>[3,200]</td><td>[20,200]</td><td>[50,200]</td></tr><tr><td>Multi-Perspectives (d = 100)</td><td>97.73±0.11</td><td>98.29±0.21</td><td>96.81±0.96</td><td>96.56±0.12</td><td>97.60±0.29</td><td>92.89±1.31</td></tr><tr><td>Multi-Heads (K = 6)</td><td>91.18±5.91</td><td>77.49±5.21</td><td>68.15±6.97</td><td>92.81±5.21</td><td>85.43±5.76</td><td>56.87±7.53</td></tr></table>
|
| 190 |
+
|
| 191 |
+
4.4 FURTHER STUDY ON THE IMPACT OF DIFFERENT ATTENTION FUNCTIONS
|
| 192 |
+
|
| 193 |
+
We perform a further study on the impact of different attention functions for our proposed MPNGMN model. In particular, as we discussed in Sec. 3.2, the proposed multi-perspective matching function shares similar spirits with multi-head attention (Vaswani et al., 2017). Therefore, it is interesting to compare both attention functions in terms of AUC scores for graph-graph classification tasks. Interestingly, our proposed multi-perspective attention mechanism consistently outperforms these results of multi-head attention mechanism by quite a large margin. We suspect that our proposed multi-perspective attention uses vectors attention weights which may significantly reduce the potential overfitting. We also performed a study on the impact of the number of the perspectives on the performance and our model is not sensitive with this hyperparameter (see the appendix A.5).
|
| 194 |
+
|
| 195 |
+
# 4.5 FURTHER STUDY ON THE IMPACT OF DIFFERENT GNNS
|
| 196 |
+
|
| 197 |
+
Table 5: Classification results of different GNNs in terms of AUC scores $( \% )$ .
|
| 198 |
+
|
| 199 |
+
<table><tr><td rowspan="2">Model</td><td colspan="3">FFmpeg</td><td colspan="3">OpenSSL</td></tr><tr><td>[3,200]</td><td>[20,200]</td><td>[50,200]</td><td>[3,200]</td><td>[20,200]</td><td>[50,200]</td></tr><tr><td>MPNGMN-GCN (Our)</td><td>97.73±0.11</td><td>98.29±0.21</td><td>96.81±0.96</td><td>96.56±0.12</td><td>97.60±0.29</td><td>92.89±1.31</td></tr><tr><td>MPNGMN-GraphSAGE</td><td>97.31±0.56</td><td>98.21±0.13</td><td>97.88±0.15</td><td>96.13±0.30</td><td>97.30±0.72</td><td>93.66±3.87</td></tr><tr><td>MPNGMN-GIN</td><td>97.97±0.08</td><td>98.06±0.22</td><td>94.66±4.01</td><td>96.98±0.20</td><td>97.42±0.48</td><td>92.29±2.23</td></tr><tr><td>MPNGMN-GGNN</td><td>98.42±0.41</td><td>99.77±0.07</td><td>97.93±1.18</td><td>99.35±0.06</td><td>98.51±1.04</td><td>94.17±7.74</td></tr></table>
|
| 200 |
+
|
| 201 |
+
Table 6: Regression results of different GNNs on AIDS700 and LINUX1000.
|
| 202 |
+
|
| 203 |
+
<table><tr><td>Datasets</td><td>Model</td><td>mse(10-)</td><td>p</td><td>T</td><td>p@10</td><td>p@20</td></tr><tr><td rowspan="3">AIDS 700</td><td>MPNGMN-GCN (Our)</td><td>1.191±0.048</td><td>0.904±0.003</td><td>0.749±0.005</td><td>0.465±0.011</td><td>0.538±0.007</td></tr><tr><td>MPNGMN-(GraphSAGE)</td><td>1.275±0.054</td><td>0.901±0.006</td><td>0.745±0.008</td><td>0.448±0.016</td><td>0.533±0.014</td></tr><tr><td>MPNGMN-(GIN) MPNGMN-(GGNN)</td><td>1.367±0.085 1.870±0.082</td><td>0.889±0.008 0.871±0.004</td><td>0.729±0.010 0.706±0.005</td><td>0.400±0.022 0.388±0.015</td><td>0.492±0.021 0.457±0.017</td></tr><tr><td rowspan="3">LINUX 1000</td><td>MPNGMN-GCN (Our)</td><td>1.561±0.020</td><td>0.945±0.002</td><td>0.814±0.003</td><td>0.743±0.085</td><td>0.741±0.086</td></tr><tr><td>MPNGMN-GraphSAGE</td><td>2.784±0.705</td><td>0.915±0.019</td><td>0.767±0.028</td><td>0.682±0.183</td><td>0.693±0.167</td></tr><tr><td>MPNGMN-GIN MPNGMN-GGNN</td><td>1.126±0.164 2.068±0.991</td><td>0.963±0.006 0.938±0.028</td><td>0.858±0.015 0.815±0.055</td><td>0.792±0.068 0.628±0.189</td><td>0.821±0.035 0.654±0.176</td></tr></table>
|
| 204 |
+
|
| 205 |
+
We finally investigate the impact of different GNNs adopted by node embedding layers of our MPNGMN model for both classification and regression tasks. Following the same settings of our previous experiments, we only replace GCN with three variants: GraphSAGE (Hamilton et al., 2017), GIN (Xu et al., 2018a), and GGNN (Li et al., 2016), whose output dimensions are kept the same with GCN (i.e, 100) in our experiments. Note that, we do not fine-tune any hyper-parameter of the three GNN models, and their default hyper-parameters of these three GNNs are listed in Appendix A.2.2.
|
| 206 |
+
|
| 207 |
+
Table 5 and Table 6 present the results of GCN versus GraphSAGE/GIN/GGNN in MPNGMN for the classification and regression tasks, respectively. For all datasets of classification and regression tasks, the performance of different GNNs is quite similar. It indicates that our model is not sensitive to the choice of GNN models in node embedding layers. Moreover, we can see from Table 5 that MPNGMN models using GGNN perform even better than our default MPNGMN using GCN on both FFmpeg and OpenSSL datasets for the classification task. It is also observed from Table 6 that MPNGMN models using GIN also outperform our default model using GCN on LINUX1000 dataset for the regression task. These observations show that our model can be further improved by adopting more advanced GNN models or choosing the most appropriate GNN models according to different application tasks.
|
| 208 |
+
|
| 209 |
+
# 5 RELATED WORKS
|
| 210 |
+
|
| 211 |
+
Graph Neural Networks. Recently graph neural networks have been proven to be extremely effective and achieved promising results on various graph-structured based prediction tasks (Gao et al., 2019; Chen et al., 2019a). The main goal of graph neural networks is to learn node-level representations or (sub)graph-level representations for graph-structured data. There is a large body of GNN models (Scarselli et al., 2008; Li et al., 2016; Kipf & Welling, 2016; Hamilton et al., 2017; Velickovi ˇ c et al., 2017; Xu et al., 2018a) that have been proposed to learn node representations. With ´ the learned node representations, various tasks on graphs can be performed such as node classification and link prediction (Velickovi ˇ c et al., 2017; Zhang & Chen, 2018). In addition to learning node ´ representation, some studies try to extend pooling operations to GNNs (Ying et al., 2018; Gao & Ji, 2019; Lee et al., 2019; Ma et al., 2019). These pooling operations are expected to learn scaled-down graph representations from node representations, and can be trained in an end-to-end fashion. Recent works also exploit extending sequence-to-sequence model using bidirectional GNN for developing graph-to-sequence models in order to cope with graph inputs and show promising performance improvement (Xu et al., 2018b;c; Chen et al., 2019b) in various natural language processing tasks.
|
| 212 |
+
|
| 213 |
+
Conventional Graph Matching. In general, graph matching can be categorized into exact graph matching and error-tolerant graph matching. Exact graph matching aims to find a strict correspondence between two (in large parts) identical graphs being matched, while error-tolerant graph matching allows matching between completely nonidentical graphs (Riesen, 2015). In real-world applications, the constraint of exact graph matching is too rigid, and thus a large number of work has been proposed to solve the error-tolerant graph matching problem, which is usually quantified by a specific similarity metric. In fact, the matching similarity metrics can be defined by some measure of structure similarity like Graph Edit Distance (GED) (Gao et al., 2010), Maximum Common Subgraph (MCS) (Bunke, 1997), or even more coarse binary similarity, according to different application backgrounds. For GED and MCS, both of them are well-studies NP-hard problems (Bunke, 1997; McGregor, 1982), and thus suffer from exponential computational complexity and huge memory requirements for exact solutions in practice (Zeng et al., 2009; Blumenthal & Gamper, 2018).
|
| 214 |
+
|
| 215 |
+
Graph Similarity Computation and Graph Matching Networks. A popular line of research of graph matching focuses on developing approximations for graph similarity computations, in which most of them focus on improvements for better efficiency in computation (Gao et al., 2010; Zeng et al., 2009; Riesen, 2015; Wu et al., 2019; Yoshida et al., 2019). However, our solution is a learnable model based on GNN to approximate graph similarity in terms of GED and binary similarity for pairwise graph-based data.
|
| 216 |
+
|
| 217 |
+
The closely relevant work to our solution are two GNN based models: GMN (Li et al., 2019) and SimGNN (Bai et al., 2019). GMN directly updates the node representations of one graph by adding artificial attention-based connections for another graph. SimGNN considers the graph-level representation similarity as well as the histogram features from a pairwise node-level comparison to learn the graph similarity. However, these two models fail to capture different perspectives of graphstructured data between the pairs of graphs.
|
| 218 |
+
|
| 219 |
+
# 6 CONCLUSION AND FUTURE WORK
|
| 220 |
+
|
| 221 |
+
In this paper, we presented a novel Hierarchical Graph Matching Network (HGMN) for computing the graph similarity between any pair of graph-structured objects. Our model jointly learned graph embeddings and a data-driven graph matching metric for computing graph similarity in an end-to-end fashion. We further proposed a new multi-perspective node-graph matching network for effectively learning cross-level interactions between two graphs beyond low-level node-node and global-level graph-graph interactions. Our extensive experimental results correlated the superior performance compared with state-of-the-art baselines on both graph-graph classification and regression tasks.
|
| 222 |
+
|
| 223 |
+
One interesting future direction is to adapt our proposed HGMN model for solving different realworld applications such as unknown malware detection, text matching and entailment, and knowledge graph question answering.
|
| 224 |
+
|
| 225 |
+
# REFERENCES
|
| 226 |
+
|
| 227 |
+
Yunsheng Bai, Hao Ding, Song Bian, Ting Chen, Yizhou Sun, and Wei Wang. Simgnn: A neural network approach to fast graph similarity computation. In Proceedings of the Twelfth ACM International Conference on Web Search and Data Mining, pp. 384–392. ACM, 2019.
|
| 228 |
+
|
| 229 |
+
Luca Bertinetto, Jack Valmadre, Joao F Henriques, Andrea Vedaldi, and Philip HS Torr. Fullyconvolutional siamese networks for object tracking. In European conference on computer vision, pp. 850–865. Springer, 2016.
|
| 230 |
+
|
| 231 |
+
David B Blumenthal and Johann Gamper. On the exact computation of the graph edit distance. Pattern Recognition Letters, 2018.
|
| 232 |
+
|
| 233 |
+
Andrew P Bradley. The use of the area under the roc curve in the evaluation of machine learning algorithms. Pattern Recognition, 1997.
|
| 234 |
+
|
| 235 |
+
Jane Bromley, Isabelle Guyon, Yann LeCun, Eduard Sackinger, and Roopak Shah. Signature verifi- ¨ cation using a” siamese” time delay neural network. In Advances in neural information processing systems, pp. 737–744, 1994.
|
| 236 |
+
|
| 237 |
+
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.
|
| 238 |
+
|
| 239 |
+
Horst Bunke. On a relation between graph edit distance and maximum common subgraph. Pattern Recognition Letters, 18(8):689–694, 1997.
|
| 240 |
+
|
| 241 |
+
Horst Bunke and Gudrun Allermann. Inexact graph matching for structural pattern recognition. Pattern Recognition Letters, 1(4):245–253, 1983.
|
| 242 |
+
|
| 243 |
+
Tiberio S Caetano, Julian J McAuley, Li Cheng, Quoc V Le, and Alex J Smola. Learning graph ´ matching. IEEE transactions on pattern analysis and machine intelligence, 31(6):1048–1058, 2009.
|
| 244 |
+
|
| 245 |
+
Ushasi Chaudhuri, Biplab Banerjee, and Avik Bhattacharya. Siamese graph convolutional network for content based remote sensing image retrieval. Computer Vision and Image Understanding, 184:22–30, 2019.
|
| 246 |
+
|
| 247 |
+
Yu Chen, Lingfei Wu, and Mohammed J Zaki. Graphflow: Exploiting conversation flow with graph neural networks for conversational machine comprehension. arXiv preprint arXiv:1908.00059, 2019a.
|
| 248 |
+
|
| 249 |
+
Yu Chen, Lingfei Wu, and Mohammed J Zaki. Reinforcement learning based graph-to-sequence model for natural question generation. arXiv preprint arXiv:1908.04942, 2019b.
|
| 250 |
+
|
| 251 |
+
Steven HH Ding, Benjamin CM Fung, and Philippe Charland. Asm2vec: Boosting static representation robustness for binary clone search against code obfuscation and compiler optimization. In IEEE Symposium on Security and Privacy (S&P) 2019, 2019.
|
| 252 |
+
|
| 253 |
+
Qian Feng, Rundong Zhou, Chengcheng Xu, Yao Cheng, Brian Testa, and Heng Yin. Scalable graph-based bug search for firmware images. In Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, 2016.
|
| 254 |
+
|
| 255 |
+
Hongyang Gao and Shuiwang Ji. Graph u-nets. arXiv preprint arXiv:1905.05178, 2019.
|
| 256 |
+
|
| 257 |
+
Xinbo Gao, Bing Xiao, Dacheng Tao, and Xuelong Li. A survey of graph edit distance. Pattern Analysis and applications, 13(1):113–129, 2010.
|
| 258 |
+
|
| 259 |
+
Yuyang Gao, Lingfei Wu, Houman Homayoun, and Liang Zhao. Dyngraph2seq: Dynamic-graph-tosequence interpretable learning for health stage prediction in online health forums. arXiv preprint arXiv:1908.08497, 2019.
|
| 260 |
+
|
| 261 |
+
Michelle Guo, Edward Chou, De-An Huang, Shuran Song, Serena Yeung, and Li Fei-Fei. Neural graph matching networks for fewshot 3d action recognition. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 653–669, 2018.
|
| 262 |
+
|
| 263 |
+
Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Advances in Neural Information Processing Systems, 2017.
|
| 264 |
+
|
| 265 |
+
Peter E Hart, Nils J Nilsson, and Bertram Raphael. A formal basis for the heuristic determination of minimum cost paths. IEEE transactions on Systems Science and Cybernetics, 4(2):100–107, 1968.
|
| 266 |
+
|
| 267 |
+
Hua He, Kevin Gimpel, and Jimmy Lin. Multi-perspective sentence similarity modeling with convolutional neural networks. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pp. 1576–1586, 2015.
|
| 268 |
+
|
| 269 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997a.
|
| 270 |
+
|
| 271 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 1997b.
|
| 272 |
+
|
| 273 |
+
Maurice G Kendall. A new measure of rank correlation. Biometrika, 1938.
|
| 274 |
+
|
| 275 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 276 |
+
|
| 277 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016.
|
| 278 |
+
|
| 279 |
+
Junhyun Lee, Inyeop Lee, and Jaewoo Kang. Self-attention graph pooling. arXiv preprint arXiv:1904.08082, 2019.
|
| 280 |
+
|
| 281 |
+
Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard Zemel. Gated graph sequence neural networks. International Conference on Learning Representations, 2016.
|
| 282 |
+
|
| 283 |
+
Yujia Li, Oriol Vinyals, Chris Dyer, Razvan Pascanu, and Peter Battaglia. Learning deep generative models of graphs. arXiv preprint arXiv:1803.03324, 2018.
|
| 284 |
+
|
| 285 |
+
Yujia Li, Chenjie Gu, Thomas Dullien, Oriol Vinyals, and Pushmeet Kohli. Graph matching networks for learning the similarity of graph structured objects. ICML, 2019.
|
| 286 |
+
|
| 287 |
+
Yao Ma, Suhang Wang, Charu C Aggarwal, and Jiliang Tang. Graph convolutional networks with eigenpooling. arXiv preprint arXiv:1904.13107, 2019.
|
| 288 |
+
|
| 289 |
+
James J McGregor. Backtrack search algorithms and the maximal common subgraph problem. Software: Practice and Experience, 12(1):23–34, 1982.
|
| 290 |
+
|
| 291 |
+
Jonas Mueller and Aditya Thyagarajan. Siamese recurrent architectures for learning sentence similarity. In Thirtieth AAAI Conference on Artificial Intelligence, 2016.
|
| 292 |
+
|
| 293 |
+
Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in pytorch, 2017.
|
| 294 |
+
|
| 295 |
+
Kaspar Riesen. Structural pattern recognition with graph edit distance. In Advances in computer vision and pattern recognition. Springer, 2015.
|
| 296 |
+
|
| 297 |
+
Kaspar Riesen, Xiaoyi Jiang, and Horst Bunke. Exact and inexact graph matching: Methodology and applications. In Managing and Mining Graph Data, pp. 217–247. Springer, 2010.
|
| 298 |
+
|
| 299 |
+
Kaspar Riesen, Sandro Emmenegger, and Horst Bunke. A novel software toolkit for graph edit distance computation. In International Workshop on Graph-Based Representations in Pattern Recognition, pp. 142–151. Springer, 2013.
|
| 300 |
+
|
| 301 |
+
Bidisha Samanta, Abir De, Niloy Ganguly, and Manuel Gomez-Rodriguez. Designing random graph models using variational autoencoders with applications to chemical design. arXiv preprint arXiv:1802.05283, 2018.
|
| 302 |
+
|
| 303 |
+
Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. IEEE Transactions on Neural Networks, 20(1):61–80, 2008.
|
| 304 |
+
|
| 305 |
+
Martin Simonovsky and Nikos Komodakis. Graphvae: Towards generation of small graphs using variational autoencoders. arXiv preprint arXiv:1802.03480, 2018.
|
| 306 |
+
|
| 307 |
+
C Spearman. The proof and measurement of association between two things. American Journal of Psychology, 1904.
|
| 308 |
+
|
| 309 |
+
Julian R Ullmann. An algorithm for subgraph isomorphism. Journal of the ACM (JACM), 23(1): 31–42, 1976.
|
| 310 |
+
|
| 311 |
+
Rahul Rama Varior, Mrinal Haloi, and Gang Wang. Gated siamese convolutional neural network architecture for human re-identification. In European conference on computer vision, pp. 791– 808. Springer, 2016.
|
| 312 |
+
|
| 313 |
+
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.
|
| 314 |
+
|
| 315 |
+
Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Li ´ o, and Yoshua \` Bengio. Graph attention networks. arXiv preprint arXiv:1710.10903, 2017.
|
| 316 |
+
|
| 317 |
+
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. 2786–2796, 2017.
|
| 318 |
+
|
| 319 |
+
Shen Wang, Zhengzhang Chen, Xiao Yu, Ding Li, Jingchao Ni, Lu-An Tang, Jiaping Gui, Zhichun Li, Haifeng Chen, and Philip S Yu. Heterogeneous graph matching networks for unknown malware detection. In Proceedings of International Joint Conference on Artificial Intelligence, 2019.
|
| 320 |
+
|
| 321 |
+
Xiaoli Wang, Xiaofeng Ding, Anthony KH Tung, Shanshan Ying, and Hai Jin. An efficient graph indexing method. In 2012 IEEE 28th International Conference on Data Engineering, 2012.
|
| 322 |
+
|
| 323 |
+
Lingfei Wu, Ian En-Hsu Yen, Zhen Zhang, Kun Xu, Liang Zhao, Xi Peng, Yinglong Xia, and Charu Aggarwal. Scalable global alignment graph kernel using random features: From node embedding to graph embedding. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 1418–1428, 2019.
|
| 324 |
+
|
| 325 |
+
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? arXiv preprint arXiv:1810.00826, 2018a.
|
| 326 |
+
|
| 327 |
+
Kun Xu, Lingfei Wu, Zhiguo Wang, and Vadim Sheinin. Graph2seq: Graph to sequence learning with attention-based neural networks. arXiv preprint arXiv:1804.00823, 2018b.
|
| 328 |
+
|
| 329 |
+
Kun Xu, Lingfei Wu, Zhiguo Wang, Mo Yu, Liwei Chen, and Vadim Sheinin. Exploiting rich syntactic information for semantic parsing with graph-to-sequence model. arXiv preprint arXiv:1808.07624, 2018c.
|
| 330 |
+
|
| 331 |
+
Xiaojun Xu, Chang Liu, Qian Feng, Heng Yin, Le Song, and Dawn Song. Neural network-based graph embedding for cross-platform binary code similarity detection. In Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, 2017.
|
| 332 |
+
|
| 333 |
+
Xifeng Yan and Jiawei Han. gspan: Graph-based substructure pattern mining. In Proceedings of IEEE International Conference on Data Mining, pp. 721–724. IEEE, 2002.
|
| 334 |
+
|
| 335 |
+
Zhitao Ying, Jiaxuan You, Christopher Morris, Xiang Ren, Will Hamilton, and Jure Leskovec. Hierarchical graph representation learning with differentiable pooling. In Advances in Neural Information Processing Systems, pp. 4800–4810, 2018.
|
| 336 |
+
|
| 337 |
+
Tomoki Yoshida, Ichiro Takeuchi, and Masayuki Karasuyama. Learning interpretable metric between graphs: Convex formulation and computation with graph mining. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 1026–1036. ACM, 2019.
|
| 338 |
+
|
| 339 |
+
Jiaxuan You, Rex Ying, Xiang Ren, William L Hamilton, and Jure Leskovec. Graphrnn: Generating realistic graphs with deep auto-regressive models. arXiv preprint arXiv:1802.08773, 2018.
|
| 340 |
+
|
| 341 |
+
Zhiping Zeng, Anthony KH Tung, Jianyong Wang, Jianhua Feng, and Lizhu Zhou. Comparing stars: On approximating graph edit distance. Proceedings of the VLDB Endowment, 2(1):25–36, 2009.
|
| 342 |
+
|
| 343 |
+
Chuxu Zhang, Dongjin Song, Chao Huang, Ananthram Swami, and Nitesh V. Chawla. Heterogeneous graph neural network. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, 2019.
|
| 344 |
+
|
| 345 |
+
Muhan Zhang and Yixin Chen. Link prediction based on graph neural networks. In Advances in Neural Information Processing Systems, pp. 5165–5175, 2018.
|
| 346 |
+
|
| 347 |
+
# A APPENDIX
|
| 348 |
+
|
| 349 |
+
# A.1 DATASETS
|
| 350 |
+
|
| 351 |
+
# A.1.1 CLASSIFICATION DATASETS
|
| 352 |
+
|
| 353 |
+
It is noted that one source code function, after compiled with different settings (architectures, compilers, optimization levels, etc), can generate various binary functions with different control flow graphs.
|
| 354 |
+
|
| 355 |
+
For FFmpeg dataset, we prepare the corresponding control flow graphs dataset as the benchmark dataset to detect binary function similarity. First, we compile FFmpeg 4.1.4 using 2 different compilers gcc 5.4.0 and clang 3.8.0, and 4 different compiler optimization levels (O0-O3), and generate 8 different binaries files. Second, these 8 generated binaries are disassembled using IDA Pro,3 which can produce CFGs for all disassembled functions. Finally, for each basic block in CFGs, we extract 6 block-level numeric features as the initial node representation based on IDAPython (a python-based plugin in IDA Pro).
|
| 356 |
+
|
| 357 |
+
OpenSSL is built from OpenSSL (v1.0.1f and v1.0.1u) using gcc 5.4 in 3 different architectures (x86, MIPS, and ARM), and 4 different optimization levels (O0-O3). The OpenSSL dataset we evaluate is previously released by (Xu et al., 2017) and public available4 with prepared 6 block-level numeric features.
|
| 358 |
+
|
| 359 |
+
Overall, for both FFmpeg and OpenSSL, each node in the control flow graphs are initialized with 6 block-level numeric features: # of string constants, $\#$ of numeric constants, # of total instructions, # of transfer instructions, $\#$ of call instructions, and $\#$ of arithmetic instructions.
|
| 360 |
+
|
| 361 |
+
# A.1.2 REGRESSION DATASETS
|
| 362 |
+
|
| 363 |
+
Instead of directly computing the GED between two graphs $G ^ { 1 }$ and $G ^ { 2 }$ , we try to learn a similarity score $s ( G ^ { 1 } , G ^ { 2 } )$ , which is the normalized exponential of GED in the range of $( 0 , 1 ]$ . To be specific, $\begin{array} { r } { s ( G ^ { 1 } , G ^ { 2 } ) \ = \ e x p ^ { - n o r m G E D ( G ^ { 1 } , G ^ { 2 } ) } , n o r m G E D ( G ^ { 1 } , G ^ { 2 } ) \ = \ \frac { G E D ( G ^ { 1 } , G ^ { 2 } ) } { ( | G ^ { 1 } | + | G ^ { 2 } | ) / 2 } } \end{array}$ , where $| G ^ { 1 } |$ or $| G ^ { 2 } |$ denotes the number of nodes of $G ^ { 1 }$ or $G ^ { 2 }$ , and $n o r m G E D ( G ^ { 1 } , \dot { G } ^ { 2 } )$ or $G \bar { E } D ( G ^ { 1 } , G ^ { 2 } )$ denotes the normalized/un-normalized GED between $G ^ { 1 }$ and $G ^ { 2 }$ .
|
| 364 |
+
|
| 365 |
+
We employ both AIDS700 and LINUX1000 released by (Bai et al., 2019), which are public available.5 Each dataset contains a set of graph pairs as well as their ground-truth GED scores, which are computed by exponential-time exact GED computation algorithm $A ^ { * }$ (Hart et al., 1968; Riesen et al., 2013). As the ground-truth GEDs of another dataset IMDB-MULTI is provided with in-exact approximation, we thus do not consider this dataset in our experiments.
|
| 366 |
+
|
| 367 |
+
AIDS700 is a subset of AIDS dataset, a collection of AIDS antiviral screen chemical compounds from Development Therapeutics Program (DTP) in the National Cancer Institute (NCI).6 Originally, AIDS dataset contains 42687 chemical compounds, where each of them can be represented as a graph with atoms as node and bonds as edges. To avoid calculating the ground-truth GED between two graphs with a large number of nodes, Bai et al. (2019) create the AIDS700 dataset that contains 700 graphs with 10 or fewer nodes. For each graph in AIDS700, every node is labeled with the element type of its atom and every edge is unlabeled (i.e., bonds features are ignored).
|
| 368 |
+
|
| 369 |
+
LINUX1000 is also a subset dataset of Linux that introduced in Wang et al. (2012). The original Linux dataset is a collection of 48747 program dependence graphs generated from Linux kernel. In this case, each graph is a static representation of data flow and control dependency within one function, with each node assigned to one statement and each edge describing the dependency between two statements. For the same reason as above that avoiding calculating the ground-truth GED between two graphs with a large number of nodes, the LINUX1000 dataset used in Bai et al. (2019) is randomly selected and contains 1000 graphs with 10 or fewer nodes. For each graph in LINUX1000, both nodes and edges are unlabeled.
|
| 370 |
+
|
| 371 |
+
For both classification and regression datasets, Table 7 provides more detailed statistics.
|
| 372 |
+
|
| 373 |
+
Table 7: Summary statistics of datasets for both classification & regression tasks.
|
| 374 |
+
|
| 375 |
+
<table><tr><td rowspan=1 colspan=1>Tasks</td><td rowspan=1 colspan=1>Datasets</td><td rowspan=1 colspan=1>Sub-datasets</td><td rowspan=1 colspan=1>#ofGraphs</td><td rowspan=1 colspan=1>#ofFunctions</td><td rowspan=1 colspan=1>#of Nodes(Min/Max/AVG)</td><td rowspan=1 colspan=1># of Edges(Min/Max/AVG)</td><td rowspan=1 colspan=1>AVG#ofDegrees(Min/Max/AVG)</td></tr><tr><td rowspan=2 colspan=1>classif-ication</td><td rowspan=1 colspan=1>FFmpeg</td><td rowspan=1 colspan=1>[3,200][20,200][50,200]</td><td rowspan=1 colspan=1>830083169610824</td><td rowspan=1 colspan=1>1037676683178</td><td rowspan=1 colspan=1>(3/200/18.83)(20/200/51.02)(50/200/90.93)</td><td rowspan=1 colspan=1>(2/332/27.02)(20/352/75.88)(52/352/136.83)</td><td rowspan=1 colspan=1>(1.25/4.33/2.59)(1.90/4.33/2.94)(2.00/4.33/3.00)</td></tr><tr><td rowspan=1 colspan=1>OpenSSL</td><td rowspan=1 colspan=1>[3,200][20,200][50,200]</td><td rowspan=1 colspan=1>73953158004308</td><td rowspan=1 colspan=1>42491073338</td><td rowspan=1 colspan=1>(3/200/15.73)(20/200/44.89)(50/200/83.68)</td><td rowspan=1 colspan=1>(1/376/21.97)(2/376/67.15)(52/376/127.75)</td><td rowspan=1 colspan=1>(0.12/3.95/2.44)(0.12/3.95/2.95)(2.00/3.95/3.04)</td></tr><tr><td rowspan=2 colspan=1>regre-ssion</td><td rowspan=1 colspan=1>AIDS700</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>700</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>(2/10/8.90)</td><td rowspan=1 colspan=1>(1/14/8.80)</td><td rowspan=1 colspan=1>(1.00/2.80/1.96)</td></tr><tr><td rowspan=1 colspan=1>LINUX1000</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1000</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>(4/10/7.58)</td><td rowspan=1 colspan=1>(3/13/6.94)</td><td rowspan=1 colspan=1>(1.50/2.60/1.81)</td></tr></table>
|
| 376 |
+
|
| 377 |
+
# A.2 MORE EXPERIMENTAL SETUP FOR MODELS
|
| 378 |
+
|
| 379 |
+
# A.2.1 MORE EXPERIMENTAL SETUP FOR BASELINE METHODS
|
| 380 |
+
|
| 381 |
+
We modified some experimental settings in baselines to fit specific tasks. Detailed settings are given in the following.
|
| 382 |
+
|
| 383 |
+
SimGNN: For regression task, we set batch size to 128 and trained the model for 10000 iterations. We used MSE loss as the training loss and set learning rate to $1 . 0 \times 1 0 ^ { - 3 }$ . Validation starts at the 9000-th iteration and is performed every 50 iterations. The best model among all the validation runs is used for the testing phase. As for the model structure, we used 3 GCNs in the first place to propagate node features, whose output dimension is set to 64, 64, and 32 respectively. Then we applied an ANPM layer implemented by author of SimGNN to perform graph-level interaction. The pair feature vector generated by this layer then passes 4 fully-connected layers and finally a 1-D scalar, which is the predicted similarity score. For classification task, we modified the training settings so now the model is trained in epoches with the same learning rate and the batch size becomes 5. Validation is carried out every iteration and the best model is saved at this time. For training loss, we used Cross-Entropy loss and applied the same learning rate as that in regression task. The model structure is the same as that in regression task except that the final output dimension of fully-connected layers is 2, the softmax of which is the predicted label and is compared with ground truth label in one-hot encoding to get the Cross-Entropy loss.
|
| 384 |
+
|
| 385 |
+
GMN: For classification task, we trained the model for 100 epoches where validation is carried out per epoch. We set batch size to 10 and learning rate to $1 . 0 \times 1 \bar { 0 } ^ { - 3 }$ . We set node feature dimension to 32 and graph representation dimension to 128. As for mode structure, we used 1-layer MLP as node encoder which encodes the initial node features to node states $h _ { i } ^ { ( 0 ) }$ . Then there are 5 propagation layers with the same structure as mentioned in the original paper (Li et al. (2019)). Besides, in this task we applied the pairwise loss based on hamming similarity defined by the author in paper. For regression task, we concatenated representation vectors of 2 graphs in the pair and passed it to a 4-layer MLP to get similarity score. As for training, we set batch size to 128 and used the same training strategy as that in the regression task of SimGNN. MSE loss is applied in this task for learning. Other settings remain the same as in classification task.
|
| 386 |
+
|
| 387 |
+
# A.2.2 MORE EXPERIMENTAL SETUP FOR DIFFERENT GNNS
|
| 388 |
+
|
| 389 |
+
When performing experiments to see how different GNNs affect performance of MPNGMN model, we only replace GCN with GraphSAGE, GIN, and GGNN using the geometric deep learning library - PyTorch Geometric7. More specifically, for GraphSAGE, we used a 3-layer GraphSAGE GNN with their output dimensions all set to 100. For GIN, we used 3 GIN modules with a 1-layer MLP with output dimension 100 as the learnable function. For GGNN, we used 3 one-layer propagation models to replace the 3 GCNs in our original setting and also set their output dimensions to 100.
|
| 390 |
+
|
| 391 |
+
# A.3 MORE EXPERIMENTS OF THE SGNN MODEL WITH DIFFERENT AGGREGATION FUNCTIONS FOR BOTH CLASSIFICATION & REGRESSION TASKS
|
| 392 |
+
|
| 393 |
+
To further compare our models with SGNN models, we train and evaluate several SGNN models with different aggregation functions, such as Max, FCMax, Avg, FCAvg, and BiLSTM. Both classification results and regression results are summarized in Table 8 and Table 9. For both classification and regression tasks, our models show statistically significantly improvement over all SGNN models with different aggregation functions, which indicates the advantage of multi-perspective node-graph matching network that adopted in our model.
|
| 394 |
+
|
| 395 |
+
Table 8: Classification results of SGNN models with different aggregation functions VS. our MPNGMN and HGMN models in term of AUC scores $( \% )$ .
|
| 396 |
+
|
| 397 |
+
<table><tr><td rowspan="2">Model</td><td colspan="3">FFmpeg</td><td colspan="3">OpenSSL</td></tr><tr><td>[3,200]</td><td>[20,200]</td><td>[50,200]</td><td>[3,200]</td><td>[20,200]</td><td>[50,200]</td></tr><tr><td>SGNN (BiLSTM)</td><td>96.92±0.13</td><td>97.62±0.13</td><td>96.35±0.33</td><td>95.24±0.06</td><td>96.30±0.27</td><td>93.99±0.62</td></tr><tr><td>SGNN (Max)</td><td>93.92±0.07</td><td>93.82±0.28</td><td>85.15±1.39</td><td>91.07±0.10</td><td>88.94±0.47</td><td>82.10±0.51</td></tr><tr><td>SGNN (FCMax)</td><td>95.37±0.04</td><td>96.29±0.14</td><td>95.98±0.32</td><td>92.64±0.15</td><td>93.79±0.17</td><td>93.21±0.82</td></tr><tr><td>SGNN (Avg)</td><td>95.61±0.05</td><td>96.09±0.05</td><td>96.70±0.13</td><td>92.89±0.09</td><td>93.90±0.24</td><td>94.12±0.35</td></tr><tr><td>SGNN (FCAvg)</td><td>95.18±0.03</td><td>95.74±0.15</td><td>96.43±0.16</td><td>92.70±0.09</td><td>93.72±0.19</td><td>93.49±0.30</td></tr><tr><td>MPNGMN</td><td>97.73±0.11</td><td>98.29±0.21</td><td>96.81±0.96</td><td>96.56±0.12</td><td>97.60±0.29</td><td>92.89±1.31</td></tr><tr><td>HGMN (Max)</td><td>97.44±0.32</td><td>97.84±0.40</td><td>97.22±0.36</td><td>94.77±1.80</td><td>97.44±0.26</td><td>94.06±1.60</td></tr><tr><td>HGMN (FCMax)</td><td>98.07±0.06</td><td>98.29±0.10</td><td>97.83±0.11</td><td>96.87±0.24</td><td>97.59±0.24</td><td>95.58±1.13</td></tr><tr><td>HGMN (BiLSTM)</td><td>97.56±0.38</td><td>98.12±0.04</td><td>97.16±0.53</td><td>96.90±0.10</td><td>97.31±1.07</td><td>95.87±0.88</td></tr></table>
|
| 398 |
+
|
| 399 |
+
Table 9: Results of SGNN models with different aggregation functions VS. our MPNGMN and HGMN models on AIDS700 and LINUX1000.
|
| 400 |
+
|
| 401 |
+
<table><tr><td>Datasets</td><td>Model</td><td>mse(10-3)</td><td>p</td><td>T</td><td>p@10</td><td>p@20</td></tr><tr><td rowspan="3">AIDS700</td><td rowspan="3">SGNN (BiLSTM) SGNN (Max) SGNN (FCMax) SGNN (Avg)</td><td rowspan="3">1.422±0.044 2.822±0.149 3.114±0.114</td><td>0.881±0.005 0.765±0.005</td><td>0.718±0.006</td><td>0.376±0.020</td><td>0.472±0.014</td></tr><tr><td></td><td>0.588±0.004</td><td>0.289±0.016</td><td>0.373±0.012</td></tr><tr><td>0.735±0.009 1.453±0.015 0.876±0.002</td><td>0.554±0.008 0.712±0.002</td><td>0.278±0.021 0.353±0.007</td><td>0.364±0.017 0.444±0.012</td></tr><tr><td rowspan="4"></td><td>SGNN (FCAvg) MPNGMN</td><td>1.658±0.067 1.191±0.048</td><td>0.857±0.007 0.904±0.003</td><td>0.689±0.008 0.749±0.005</td><td>0.305±0.018 0.465±0.011</td><td>0.399±0.021 0.538±0.007</td></tr><tr><td>HGMN (Max)</td><td>1.210±0.020</td><td>0.900±0.002</td><td>0.743±0.003</td><td>0.461±0.012</td><td>0.534±0.009</td></tr><tr><td>HGMN (FCMax)</td><td>1.205±0.039</td><td>0.904±0.002</td><td>0.749±0.003</td><td>0.457±0.014</td><td>0.532±0.016</td></tr><tr><td>HGMN (BiLSTM)</td><td>1.169±0.036</td><td>0.905±0.002</td><td>0.751±0.003</td><td>0.456±0.019</td><td>0.539±0.018</td></tr><tr><td rowspan="6">LINUX 1000</td><td>SGNN (BiLSTM)</td><td>2.140±1.668</td><td>0.935±0.050</td><td>0.825±0.100</td><td>0.978±0.012</td><td>0.965±0.007</td></tr><tr><td>SGNN (Max)</td><td>11.832±0.698</td><td>0.566±0.022</td><td>0.404±0.017</td><td>0.226±0.106</td><td>0.492±0.190</td></tr><tr><td>SGNN (FCMax)</td><td>17.795±0.406</td><td>0.362±0.021</td><td>0.252±0.015</td><td>0.239±0.000</td><td>0.241±0.000</td></tr><tr><td>SGNN (Avg)</td><td>2.343±0.453</td><td>0.933±0.012</td><td>0.790±0.017</td><td>0.778±0.048</td><td>0.811±0.050</td></tr><tr><td>SGNN (FCAvg)</td><td>3.211±0.318</td><td>0.909±0.004</td><td>0.757±0.008</td><td>0.831±0.163</td><td>0.813±0.159</td></tr><tr><td>MPNGMN</td><td>1.561±0.020</td><td>0.945±0.002</td><td>0.814±0.003</td><td>0.743±0.085</td><td>0.741±0.086</td></tr><tr><td rowspan="4"></td><td>HGMN (Max)</td><td>1.054±0.086</td><td>0.962±0.003</td><td>0.850±0.008</td><td>0.877±0.054</td><td>0.883±0.047</td></tr><tr><td>HGMN (FCMax)</td><td>1.575±0.627</td><td>0.946±0.019</td><td>0.817±0.034</td><td>0.807±0.117</td><td>0.784±0.108</td></tr><tr><td>HGMN (BiLSTM)</td><td>0.439±0.143</td><td>0.985±0.005</td><td>0.919±0.016</td><td>0.955±0.011</td><td>0.943±0.014</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 402 |
+
|
| 403 |
+
# A.4 MORE EXPERIMENTS OF THE MPNGMN MODEL WITH DIFFERENT AGGREGATION FUNCTIONS FOR BOTH CLASSIFICATION & REGRESSION TASKS
|
| 404 |
+
|
| 405 |
+
We investigate the impact of different aggregation functions adopted by Aggregation Layers of the MPNGMN model for both classification and regression tasks. Following the default and same settings of previous experiments, we only change the aggregation layer of MPNGMN and use five possible aggregation functions: Max, FCMax, Avg, FCAvg, LSTM, and BiLSTM. As can be observed from Table 10 and Table 11, BiLSTM offers superior performance over all datasets of both classification and regression tasks in terms of most evaluation metrics. Therefore, we take BiLSTM as the default aggregation function for MPNGMN, and fix it for the MPNGMN part in HGMN models.
|
| 406 |
+
|
| 407 |
+
Table 10: Classification results of MPNGMN models with different aggregation functions in term of AUC scores $( \% )$ .
|
| 408 |
+
|
| 409 |
+
<table><tr><td rowspan="2">Model</td><td colspan="3">FFmpeg</td><td colspan="3">OpenSSL</td></tr><tr><td>[3,200]</td><td>[20,200]</td><td>[50,200]</td><td>[3,200]</td><td>[20,200]</td><td>[50,200]</td></tr><tr><td>MPNGMN (Max)</td><td>73.74±8.30</td><td>73.85±1.76</td><td>77.72±2.07</td><td>67.14±2.70</td><td>63.31±3.29</td><td>63.02±2.77</td></tr><tr><td>MPNGMN (FCMax)</td><td>97.28±0.08</td><td>96.61±0.17</td><td>96.65±0.30</td><td>95.37±0.19</td><td>96.08±0.48</td><td>95.90±0.73</td></tr><tr><td>MPNGMN (Avg)</td><td>85.92±1.07</td><td>83.29±4.49</td><td>85.52±1.42</td><td>80.10±4.59</td><td>70.81±3.41</td><td>66.94±4.33</td></tr><tr><td>MPNGMN (FCAvg)</td><td>95.93±0.21</td><td>73.90±0.70</td><td>94.22±0.06</td><td>93.38±0.80</td><td>94.52±1.16</td><td>94.71±0.86</td></tr><tr><td>MPNGMN (LSTM)</td><td>97.16±0.42</td><td>97.02±0.99</td><td>84.65±6.73</td><td>96.30±0.69</td><td>97.51±0.82</td><td>89.41±8.40</td></tr><tr><td>MPNGMN (BiLSTM)</td><td>97.73±0.11</td><td>98.29±0.21</td><td>96.81±0.96</td><td>96.56±0.12</td><td>97.60±0.29</td><td>92.89±1.31</td></tr></table>
|
| 410 |
+
|
| 411 |
+
Table 11: Regression results of MPNGMN models with different aggregation functions on AIDS700 and LINUX1000.
|
| 412 |
+
|
| 413 |
+
<table><tr><td>Datasets</td><td>Model</td><td>mse(10-3)</td><td>p</td><td>T</td><td>p@10</td><td>p@20</td></tr><tr><td rowspan="4">AIDS 700</td><td>MPNGMN (Max)</td><td>2.378±0.244 2.220±1.547</td><td>0.813±0.015 0.808±0.145</td><td>0.642±0.013 0.656±0.122</td><td>0.578±0.199 0.425±0.078</td><td>0.583±0.169 0.504±0.064</td></tr><tr><td>MPNGMN (FCMax) MPNGMN (Avg)</td><td>1.524±0.161</td><td>0.880±0.010</td><td>0.717±0.012</td><td>0.408±0.044</td><td>0.474±0.027</td></tr><tr><td>MPNGMN (FCAvg)</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>MPNGMN (LSTM)</td><td>1.281±0.075 1.290±0.037</td><td>0.895±0.006 0.895±0.004</td><td>0.737±0.008 0.737±0.005</td><td>0.453±0.015 0.448±0.007</td><td>0.527±0.016 0.520±0.012</td></tr><tr><td rowspan="6">LINUX</td><td>MPNGMN(BiLSTM)</td><td>1.191±0.048</td><td>0.904±0.003</td><td>0.749±0.005</td><td>0.465±0.011</td><td>0.538±0.007</td></tr><tr><td>MPNGMN(Max)*</td><td>16.921±0.000</td><td></td><td></td><td></td><td></td></tr><tr><td>MPNGMN (FCMax)</td><td>4.793±0.262</td><td>0.829±0.006</td><td>0.665±0.011</td><td>0.764±0.170</td><td>0.767±0.166</td></tr><tr><td>MPNGMN (Avg)</td><td>4.050±0.594</td><td>0.888±0.008</td><td>0.719±0.012</td><td>0.501±0.093</td><td>0.536±0.112</td></tr><tr><td>MPNGMN (FCAvg)</td><td>6.953±0.195</td><td>0.897±0.004</td><td>0.736±0.005</td><td>0.499±0.126</td><td>0.509±0.129</td></tr><tr><td rowspan="4">1000</td><td>MPNGMN (LSTM)</td><td>1.535±0.096</td><td>0.945±0.004</td><td>0.813±0.007</td><td>0.695±0.064</td><td>0.698±0.081</td></tr><tr><td>MPNGMN(BiLSTM)</td><td>1.561±0.020</td><td>0.945±0.002</td><td>0.814±0.003</td><td>0.743±0.085</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>0.741±0.086</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 414 |
+
|
| 415 |
+
\* As all duplicated experiments running on this setting do not converge in their training processes, their corresponding result metrics cannot be calculated.
|
| 416 |
+
|
| 417 |
+
# A.5 MORE EXPERIMENTS OF THE MPNGMN MODEL WITH DIFFERENT NUMBER OF PERSPECTIVES FOR THE CLASSIFICATION TASK
|
| 418 |
+
|
| 419 |
+
We further investigate the impact of different number of perspectives adopted by the NodeGraph Matching Layer of the MPNGMN model for classification tasks. Following the default and same settings of previous experiments, we only change the number of perspectives (i.e., $\tilde { d } = 5 0 / 7 5 / 1 0 0 / 1 2 5 / 1 5 0 )$ of MPNGMN. As shown in Figure 2 and Table 12, when the graph size is [3, 200] and [20, 200] (more training samples), our model performance is not sensitive to the number of perspectives (from 50 to 150). When the graph size is [50,200] (fewer training samples), the variance of the model becomes relatively larger than these on [3, 200] and [20, 200]. However, when we used more perspectives (like 150), the variance of the model reduced significantly.
|
| 420 |
+
|
| 421 |
+

|
| 422 |
+
(a) classification performance of FFmpeg
|
| 423 |
+
(b) classification performance of OpenSSL
|
| 424 |
+
Figure 2: (a) and (b) show the impact of the number of perspectives on classification performance of FFmpeg and OpenSSL respectively.
|
| 425 |
+
|
| 426 |
+
Table 12: Classification results of different number of perspectives in terms of AUC scores(%).
|
| 427 |
+
|
| 428 |
+
<table><tr><td rowspan="2">Model</td><td colspan="3">FFmpeg</td><td colspan="3">OpenSSL</td></tr><tr><td>[3,200]</td><td>[20,200]</td><td>[50,200]</td><td>[3,200]</td><td>[20,200]</td><td>[50,200]</td></tr><tr><td>MPNGMN (d = 50)</td><td>98.11±0.14</td><td>97.76±0.14</td><td>96.93±0.52</td><td>97.38±0.11</td><td>97.03±0.84</td><td>93.38±3.03</td></tr><tr><td>MPNGMN (d = 75)</td><td>97.99±0.09</td><td>97.94±0.14</td><td>97.41±0.05</td><td>97.09±0.25</td><td>98.66±0.11</td><td>92.10±4.37</td></tr><tr><td>MPNGMN (d = 100)</td><td>97.73±0.11</td><td>98.29±0.21</td><td>96.81±0.96</td><td>96.56±0.12</td><td>97.60±0.29</td><td>92.89±1.31</td></tr><tr><td>MPNGMN (d = 125)</td><td>98.10±0.03</td><td>98.06±0.08</td><td>97.26±0.36</td><td>96.73±0.33</td><td>98.67±0.11</td><td>96.03±2.08</td></tr><tr><td>MPNGMN (d= 150)</td><td>98.32±0.05</td><td>98.11±0.07</td><td>97.92±0.09</td><td>96.50±0.31</td><td>98.04±0.03</td><td>97.13±0.36</td></tr></table>
|
md/train/rklaWn0qK7/rklaWn0qK7.md
ADDED
|
@@ -0,0 +1,423 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING NEURAL PDE SOLVERS WITH CONVER-GENCE GUARANTEES
|
| 2 |
+
|
| 3 |
+
Jun-Ting Hsieh\* Stanford junting@stanford.edu
|
| 4 |
+
|
| 5 |
+
Shengjia Zhao\* Stanford sjzhao@stanford.edu
|
| 6 |
+
|
| 7 |
+
Stephan Eismann Stanford seismann@stanford.edu
|
| 8 |
+
|
| 9 |
+
Lucia Mirabella
|
| 10 |
+
Siemens
|
| 11 |
+
lucia.mirabella $@$ siemens.com
|
| 12 |
+
|
| 13 |
+
Stefano Ermon Stanford ermon@stanford.edu
|
| 14 |
+
|
| 15 |
+
# ABSTRACT
|
| 16 |
+
|
| 17 |
+
Partial differential equations (PDEs) are widely used across the physical and computational sciences. Decades of research and engineering went into designing fast iterative solution methods. Existing solvers are general purpose, but may be sub-optimal for specific classes of problems. In contrast to existing hand-crafted solutions, we propose an approach to learn a fast iterative solver tailored to a specific domain. We achieve this goal by learning to modify the updates of an existing solver using a deep neural network. Crucially, our approach is proven to preserve strong correctness and convergence guarantees. After training on a single geometry, our model generalizes to a wide variety of geometries and boundary conditions, and achieves 2-3 times speedup compared to state-of-the-art solvers.
|
| 18 |
+
|
| 19 |
+
# 1 INTRODUCTION
|
| 20 |
+
|
| 21 |
+
Partial differential equations (PDEs) are ubiquitous tools for modeling physical phenomena, such as heat, electrostatics, and quantum mechanics. Traditionally, PDEs are solved with hand-crafted approaches that iteratively update and improve a candidate solution until convergence. Decades of research and engineering went into designing update rules with fast convergence properties.
|
| 22 |
+
|
| 23 |
+
The performance of existing solvers varies greatly across application domains, with no method uniformly dominating the others. Generic solvers are typically effective, but could be far from optimal for specific domains. In addition, high performing update rules could be too complex to design by hand. In recent years, we have seen that for many classical problems, complex updates learned from data or experience can out-perform hand-crafted ones. For example, for Markov chain Monte Carlo, learned proposal distributions lead to orders of magnitude speedups compared to handdesigned ones (Song et al., 2017; Levy et al., 2017). Other domains that benefited significantly include learned optimizers (Andrychowicz et al., 2016) and learned data structures (Kraska et al., 2018). Our goal is to bring similar benefits to PDE solvers.
|
| 24 |
+
|
| 25 |
+
Hand-designed solvers are relatively simple to analyze and are guaranteed to be correct in a large class of problems. The main challenge is how to provide the same guarantees with a potentially much more complex learned solver. To achieve this goal, we build our learned iterator on top of an existing standard iterative solver to inherit its desirable properties. The iterative solver updates the solution at each step, and we learn a parameterized function to modify this update. This function class is chosen so that for any choice of parameters, the fixed point of the original iterator is preserved. This guarantees correctness, and training can be performed to enhance convergence speed. Because of this design, we only train on a single problem instance; our model correctly generalizes to a variety of different geometries and boundary conditions with no observable loss of performance. As a result, our approach provides: (i) theoretical guarantees of convergence to the correct stationary solution, (ii) faster convergence than existing solvers, and (iii) generalizes to geometries and boundary conditions very different from the ones seen at training time. This is in stark contrast with existing deep learning approaches for PDE solving (Tang et al., 2017; Farimani et al., 2017) that are limited to specific geometries and boundary conditions, and offer no guarantee of correctness.
|
| 26 |
+
|
| 27 |
+
Our approach applies to any PDE with existing linear iterative solvers. As an example application, we solve the 2D Poisson equations. Our method achieves a $2 { - } 3 \times$ speedup on number of multiplyadd operations when compared to standard iterative solvers, even on domains that are significantly different from our training set. Moreover, compared with state-of-the-art solvers implemented in FEniCS (Logg et al., 2012), our method achieves faster performance in terms of wall clock CPU time. Our method is also simple as opposed to deeply optimized solvers such as our baseline in FEniCS (minimal residual method $^ +$ algebraic multigrid preconditioner). Finally, since we utilize standard convolutional networks which can be easily parallelized on GPU, our approach leads to an additional $3 0 \times$ speedup when run on GPU.
|
| 28 |
+
|
| 29 |
+
# 2 BACKGROUND
|
| 30 |
+
|
| 31 |
+
In this section, we give a brief introduction of linear PDEs and iterative solvers. We refer readers to LeVeque (2007) for a thorough review.
|
| 32 |
+
|
| 33 |
+
# 2.1 LINEAR PDES
|
| 34 |
+
|
| 35 |
+
Linear PDE solvers find functions that satisfy a (possibly infinite) set of linear differential equations. More formally, let $\mathcal { F } = \{ \boldsymbol { u } : \mathbb { R } ^ { k } \mathbb { R } \}$ be the space of candidate functions, and $\mathcal { A } : \mathcal { F } \mathcal { F }$ be a linear operator; the goal is to find a function $u \in { \mathcal { F } }$ that satisfies a linear equation ${ \mathcal { A } } u = { \mathcal { E } }$ , where $\boldsymbol { \mathscr { f } }$ is another function $\mathbb { R } ^ { k } \mathbb { R }$ given by our problem. Many PDEs fall into this framework. For example, heat diffusion satisfies $\nabla ^ { 2 } u = \ell$ (Poisson equation), where $\begin{array} { r } { \nabla ^ { 2 } = \frac { \partial ^ { 2 } } { \partial x _ { 1 } ^ { 2 } } + \cdot \cdot \cdot + \frac { \partial ^ { 2 } } { \partial x _ { k } ^ { 2 } } } \end{array}$ is the linear Laplace operator; $u$ maps spatial coordinates (e.g. in $\mathbb { R } ^ { 3 }$ ) into its temperature, and $\boldsymbol { \mathscr { f } }$ maps spatial coordinates into the heat in/out flow. Solving this equation lets us know the stationary temperature given specified heat in/out flow.
|
| 36 |
+
|
| 37 |
+
Usually the equation ${ \mathcal { A } } u = { \mathcal { E } }$ does not uniquely determine $_ { \mathcal { W } }$ . For example, $u =$ constant for any constant is a solution to the equation $\bar { \nabla } ^ { 2 } \bar { u _ { \ } } = \ 0$ . To ensure a unique solution we provide additional equations, called “boundary conditions”. Several boundary conditions arise very naturally in physical problems. A very common one is the Dirichlet boundary condition, where we pick some subset $\mathcal { G } \subset \mathbf { \mathbb { R } } ^ { k }$ and fix the values of the function on $\mathcal { G }$ to some fixed value $\mathcal { \ell }$ ,
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
u ( x ) = \ell ( x ) , { \mathrm { ~ f o r ~ a l l ~ } } x \in { \mathcal { G } }
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
where the function $\boldsymbol { \ell }$ is usually clear from the underlying physical problem. As in previous literature, we refer to $\mathcal { G }$ as the geometry of the problem, and $\mathcal { \ell }$ as the boundary value. We refer to the pair $( \mathcal G , \mathcal { \ell } )$ as the boundary condition. In this paper, we only consider linear PDEs and boundary conditions that have unique solutions.
|
| 44 |
+
|
| 45 |
+
# 2.2 FINITE DIFFERENCE METHOD
|
| 46 |
+
|
| 47 |
+
Most real-world PDEs do not admit an analytic solution and must be solved numerically. The first step is to discretize the solution space $\mathcal { F }$ from $\mathbb { R } ^ { k } \to \mathbb { R }$ into $\mathbb { D } ^ { k } \to \mathbb { R }$ , where $\mathbb { D }$ is a discrete subset of $\mathbb { R }$ . When the space is compact, it is discretized into an $n \times n \times n \cdots$ ( $k$ many) uniform Cartesian grid with mesh width $h$ . Any function in $\mathcal { F }$ is approximated by its value on the $n ^ { k }$ grid points. We denote the discretized function as a vector $u$ in $\mathbb { R } ^ { \bar { n ^ { k } } }$ . In this paper, we focus on 2D problems $k = 2 ,$ ), but the strategy applies to any dimension.
|
| 48 |
+
|
| 49 |
+
We discretize all three terms in the equation ${ \mathcal { A } } u = { \mathcal { E } }$ and boundary condition $( \mathcal G , \mathcal { \ell } )$ . The PDE solution $_ { \mathcal { W } }$ is discretized such that $u _ { i , j } = u ( x _ { i } , y _ { j } )$ corresponds to the value of $_ { \mathcal { W } }$ at grid point $( x _ { i } , y _ { j } )$ . We can similarly discretize n of partial derivative operato $\boldsymbol { \mathscr { f } }$ and . Fo $\boldsymbol { \ell }$ . In linear PDEs, the linear operatxample, for the Poisson equation $\mathcal { A }$ $\begin{array} { r } { \mathcal { A } = \nabla ^ { 2 } = \sum _ { i } \frac { \partial ^ { 2 } } { \partial x _ { i } ^ { 2 } } } \end{array}$ Therefore we can first discretize each partial derivative, then linearly combine the discretized partial derivatives to obtain a discretized $\mathcal { A }$ .
|
| 50 |
+
|
| 51 |
+
Finite difference is a method that approximates partial derivatives in a discretized space, and as mesh width $h 0$ , the approximation approaches the true derivative. For example, $\scriptstyle { \frac { \partial ^ { 2 } } { \partial x ^ { 2 } } } u$ can be discretized in 2D as $\begin{array} { r } { \frac { \partial ^ { 2 } } { \partial x ^ { 2 } } u \approx \frac { 1 } { h ^ { 2 } } ( u _ { i - 1 , j } - 2 u _ { i , j } + u _ { i + 1 , j } ) } \end{array}$ , the Laplace operator in 2D can be correspondingly approximated as:
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\nabla ^ { 2 } u = \frac { \partial ^ { 2 } u } { \partial x ^ { 2 } } + \frac { \partial ^ { 2 } u } { \partial y ^ { 2 } } \approx \frac { 1 } { h ^ { 2 } } ( u _ { i - 1 , j } + u _ { i + 1 , j } + u _ { i , j - 1 } + u _ { i , j + 1 } - 4 u _ { i , j } )
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
After discretization, we can rewrite ${ \mathcal { A } } u = { \mathcal { E } }$ as a linear matrix equation
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
A u = f
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
where $u , f \in \mathbb { R } ^ { n ^ { 2 } }$ , and $A$ is a matrix in $\mathbb { R } ^ { n ^ { 2 } \times n ^ { 2 } }$ (these are $n ^ { 2 }$ dimensional because we focus on 2D problems). In many PDEs such as the Poisson and Helmholtz equation, $A$ is sparse, banded, and symmetric.
|
| 64 |
+
|
| 65 |
+
# 2.3 BOUNDARY CONDITION
|
| 66 |
+
|
| 67 |
+
We also need to include the boundary condition $u ( x ) = \ell ( x )$ for all $x \in { \mathcal { G } }$ . If a discretized point $( x _ { i } , y _ { j } )$ belongs to $\mathcal { G }$ , we need to fix the value of $u _ { i , j }$ to $b _ { i , j }$ . To achieve this, we first define $e \in \{ 0 , 1 \} ^ { n ^ { 2 } }$ to be a vector of 0’s and 1’s, in which 0 indicates that the corresponding point belongs to $\mathcal { G }$ . Then, we define a “reset” matrix $G = d i a g ( e )$ , a diagonal matrix $\mathbb { R } ^ { n ^ { 2 } } \to \mathbb { R } ^ { n ^ { 2 } }$ such that
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
( G u ) _ { i , j } = { \left\{ \begin{array} { l l } { u _ { i , j } } & { ( x _ { i } , y _ { j } ) \notin { \mathcal { G } } } \\ { 0 } & { ( x _ { i } , y _ { j } ) \in { \mathcal { G } } } \end{array} \right. }
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
Intuitively $G$ ”masks” every point in $\mathcal { G }$ to 0. Similarly, $I - G$ can mask every point not in $\mathcal { G }$ to 0. Note that the boundary values are fixed and do not need to satisfy $A u = f$ . Thus, the solution $u$ to the PDE under geometry $\mathcal { G }$ should satisfy:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\begin{array} { c } { { G ( A u ) = G f } } \\ { { ( I - G ) u = ( I - G ) b } } \end{array}
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
The first equation ensures that the interior points (points not in $\mathcal { G }$ ) satisfy $A u = f$ , and the second ensures that the boundary condition is satisfied.
|
| 80 |
+
|
| 81 |
+
To summarize, $( \mathcal { A } , \mathcal { G } , \ell , \ell , n )$ is our PDE problem, and we first discretize the problem on an $n \times n$ grid to obtain $( A , G , f , b , n )$ . Our objective is to obtain a solution $u$ that satisfies Eq. (4), i.e. $A u = f$ for the interior points and boundary condition $u _ { i , j } = b _ { i , j }$ , $\forall ( x _ { i } , y _ { j } ) \in \mathcal { G }$ .
|
| 82 |
+
|
| 83 |
+
# 2.4 ITERATIVE SOLVERS
|
| 84 |
+
|
| 85 |
+
A linear iterative solver is defined as a function that inputs the current proposed solution $u \in \mathbb { R } ^ { n ^ { 2 } }$ and outputs an updated solution $u ^ { \prime }$ . Formally it is a function $\Psi : \mathbb { R } ^ { n ^ { 2 } } \mathbb { R } ^ { n ^ { 2 } }$ that can be expressed as
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
u ^ { \prime } = \Psi ( u ) = T u + c
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
where $T$ is a constant update matrix and $c$ is a constant vector. For each iterator $\Psi$ there may be special vectors $u ^ { * } \in \mathbb { R } ^ { n ^ { 2 } }$ that satisfy $\boldsymbol { u } ^ { * } = \boldsymbol { \Psi } ( \boldsymbol { u } ^ { * } )$ . These vectors are called fixed points.
|
| 92 |
+
|
| 93 |
+
The iterative solver $\Psi$ should map any initial $u ^ { 0 } \in \mathbb { R } ^ { n ^ { 2 } }$ to a correct solution of the PDE problem.
|
| 94 |
+
This is formalized in the following theorem.
|
| 95 |
+
|
| 96 |
+
Definition 1 (Valid Iterator). An iterator $\Psi$ is valid w.r.t. a PDE problem $( A , G , f , b , n )$ if it satisfies:
|
| 97 |
+
|
| 98 |
+
a) Convergence: There is a unique fixed point $u ^ { * }$ such that $\Psi$ converges to $u ^ { * }$ from any initialization: $\begin{array} { r } { \forall u ^ { 0 } \in \mathbb { R } ^ { n ^ { 2 } } , \operatorname* { l i m } _ { k \to \infty } \Psi ^ { k } ( u ^ { 0 } ) = u ^ { * } } \end{array}$ .
|
| 99 |
+
|
| 100 |
+
$^ b$ ) Fixed Point: The fixed point $u ^ { * }$ is the solution to the linear system $A u = f$ under boundary condition $( G , b )$ .
|
| 101 |
+
|
| 102 |
+
Convergence: Condition (a) in Definition 1 is satisfied if the matrix $T$ is convergent, i.e. $T ^ { k } \to 0$ as $k \infty$ . It has been proven that $T$ is convergent if and only if the spectral radius $\rho ( T ) < 1$ (Olver, 2008):
|
| 103 |
+
|
| 104 |
+
Theorem 1. (Olver, 2008, Prop 7.25) For a linear iterator $\Psi ( u ) = T u + c , \Psi$ converges to a unique stable fixed point from any initialization if and only if the spectral radius $\rho ( T ) < 1$ .
|
| 105 |
+
|
| 106 |
+
Proof. See Appendix A.
|
| 107 |
+
|
| 108 |
+
It is important to note that Condition (a) only depends on $T$ and not the constant $c$ .
|
| 109 |
+
|
| 110 |
+
Fixed Point: Condition (b) in Definition 1 contains two requirements: satisfy $A u \ : = \ : f$ , and the boundary condition $( G , b )$ . To satisfy $A u = f$ a standard approach is to design $\Psi$ by matrix splitting: split the matrix $A$ into $A = M - N$ ; rewrite $A u = f$ as $M u = N u + f$ (LeVeque, 2007). This naturally suggests the iterative update
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
u ^ { \prime } = M ^ { - 1 } N u + M ^ { - 1 } f
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
Because Eq. (6) is a rewrite of $A u = f$ , stationary points $u ^ { * }$ of Eq. (6) satisfy $A u ^ { * } = f$ . Clearly, the choices of $M$ and $N$ are arbitrary but crucial. From Theorem 1, we must choose $M$ such that the update converges. In addition, $\dot { M ^ { - 1 } }$ must easy to compute (e.g., diagonal).
|
| 117 |
+
|
| 118 |
+
Finally we also need to satisfy the boundary condition $( I - G ) u = ( I - G ) b$ in Eq.4. After each update in Eq. (6), the boundary condition could be violated. We use the “reset” operator defined in Eq. (3) to “reset” the values of $u _ { i , j }$ to $b _ { i , j }$ by $G u + ( I - G ) b$ .
|
| 119 |
+
|
| 120 |
+
The final update rule becomes
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
u ^ { \prime } = G ( M ^ { - 1 } N u + M ^ { - 1 } f ) + ( I - G ) b
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
Despite the added complexity, it is still a linear update rule in the form of $u ^ { \prime } = T u + c$ in Eq. (5): we have $T = G M ^ { - 1 } { \dot { N } }$ and $\dot { c } = G M ^ { - 1 } f + ( 1 - \mathbf { \dot { \cal G } } ) b$ . As long as $M$ is a full rank diagonal matrix, fixed points of this equation satisfies Eq. (4). In other words, such a fixed point is a solution of the PDE problem $( A , G , f , b , n )$ .
|
| 127 |
+
|
| 128 |
+
Proposition 1. If $M$ is a full rank diagonal matrix, and $u ^ { * } \in \mathbb { R } ^ { n ^ { 2 } \times n ^ { 2 } }$ satisfies Eq. (7), then $u ^ { * }$ satisfies Eq. (4).
|
| 129 |
+
|
| 130 |
+
# 2.4.1 JACOBI METHOD
|
| 131 |
+
|
| 132 |
+
A simple but effective way to choose $M$ is the Jacobi method, which sets $M \ : = \ : I$ (a full rank diagonal matrix, as required by Proposition 1). For Poisson equations, this update rule has the following form,
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
\begin{array} { l } { { \hat { u } _ { i , j } = \displaystyle \frac { 1 } { 4 } \big ( u _ { i - 1 , j } + u _ { i + 1 , j } + u _ { i , j - 1 } + u _ { i , j + 1 } \big ) + \frac { h ^ { 2 } } { 4 } f _ { i , j } } } \\ { { u ^ { \prime } = G \hat { u } + ( 1 - G ) b } } \end{array}
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
For Poisson equations and any geometry $G$ , the update matrix $T = G ( I - A )$ has spectral radius $\rho ( T ) < 1$ (see Appendix B). In addition, by Proposition 1 any fixed point of the update rule Eq.(8,9) must satisfy Eq. (4). Both convergence and fixed point conditions from Definition 1 are satisfied: Jacobi iterator Eq.(8,9) is valid for any Poisson PDE problem.
|
| 139 |
+
|
| 140 |
+
In addition, each step of the Jacobi update can be implemented as a neural network layer, i.e., Eq. (8) can be efficiently implemented by convolving $u$ with kernel $\left( \begin{array} { c c c } { { 0 } } & { { 1 / 4 } } & { { 0 } } \\ { { 1 / 4 } } & { { 0 } } & { { 1 / 4 } } \\ { { 0 } } & { { 1 / 4 } } & { { 0 } } \end{array} \right)$ and adding $h ^ { 2 } f / 4$ . The “reset” step in Eq. (9) can also be implemented as multiplying $u$ with $\mathbf { G }$ and adding the boundary values $( 1 - G ) b$ .
|
| 141 |
+
|
| 142 |
+
# 2.4.2 MULTIGRID METHOD
|
| 143 |
+
|
| 144 |
+
The Jacobi method has very slow convergence rate (LeVeque, 2007). This is evident from the update rule, where the value at each grid point is only influenced by its immediate neighbors. To propagate information from one grid point to another, we need as many iterations as their distance on the grid. The key insight of the Multigrid method is to perform Jacobi updates on a downsampled (coarser) grid and then upsample the results. A common structure is the V-cycle (Briggs et al., 2000). In each
|
| 145 |
+
|
| 146 |
+
V-cycle, there are $k$ downsampling layers followed by $k$ upsampling layers, and multiple Jacobi updates are performed at each resolution. The downsampling and upsampling operations are also called restriction and prolongation, and are often implemented using weighted restriction and linear interpolation respectively. The advantage of the multigrid method is clear: on a downsampled grid (by a factor of 2) with mesh width $2 h$ , information propagation is twice as fast, and each iteration requires only 1/4 operations compared to the original grid with mesh width $h$ .
|
| 147 |
+
|
| 148 |
+
# 3 LEARNING FAST AND PROVABLY CORRECT ITERATIVE PDE SOLVERS
|
| 149 |
+
|
| 150 |
+
A PDE problem consists of five components $( \mathcal { A } , \mathcal { G } , \ell , \ell , n )$ . One is often interested in solving the same PDE class $\mathcal { A }$ under varying $\boldsymbol { \mathscr { f } }$ , discretization $n$ , and boundary conditions $( \mathcal G , \mathcal { \ell } )$ . For example, solving the Poisson equation under different boundary conditions (e.g., corresponding to different mechanical systems governed by the same physics). In this paper, we fix $\mathcal { A }$ but vary ${ \mathcal { G } } , { \mathcal { f } } , { \mathcal { k } } , n$ , and learn an iterator that solves a class of PDE problems governed by the same $\mathcal { A }$ . For a discretized PDE problem $( A , G , f , b , n )$ and given a standard (hand designed) iterative solver $\Psi$ , our goal is to improve upon $\Psi$ and learn a solver $\Phi$ that has (1) correct fixed point and (2) fast convergence (on average) on the class of problems of interest. We will proceed to parameterize a family of $\Phi$ that satisfies (1) by design, and achieve (2) by optimization.
|
| 151 |
+
|
| 152 |
+
In practice, we can only train $\Phi$ on a small number of problems $( A , f _ { i } , G _ { i } , b _ { i } , n _ { i } )$ . To be useful, $\Phi$ must deliver good performance on every choice of $G , f , b$ , and different grid sizes $n$ . We show, theoretically and empirically, that our iterator family has good generalization properties: even if we train on a single problem $( A , G , f , b , n )$ , the iterator performs well on very different choices of $G , f , b$ , and grid size $n$ . For example, we train our iterator on a $6 4 \times 6 4$ square domain, and test on a $2 5 6 \times 2 5 6$ L-shaped domain (see Figure 1).
|
| 153 |
+
|
| 154 |
+
# 3.1 FORMULATION
|
| 155 |
+
|
| 156 |
+
For a fixed PDE problem class $\mathcal { A }$ , let $\Psi$ be a standard linear iterative solver known to be valid. We will use more formal notation $\Psi ( u ; G , f , b , n )$ as $\Psi$ is a function of $u$ , but also depends on $G , f , b , n$ . Our assumption is that for any choice of $G , f , b , n$ (but fixed PDE class $\mathcal { A }$ ), $\Psi ( u ; G , f , b , n )$ is valid. We previously showed that Jacobi iterator Eq.(8,9) have this property for the Poisson PDE class.
|
| 157 |
+
|
| 158 |
+
We design our new family of iterators $\Phi _ { H } : \mathbb { R } ^ { n ^ { 2 } } \mathbb { R } ^ { n ^ { 2 } }$
|
| 159 |
+
|
| 160 |
+
$$
|
| 161 |
+
\begin{array} { c } { { w = \Psi ( u ; G , f , b , n ) - u } } \\ { { { } } } \\ { { \Phi _ { H } ( u ; G , f , b , n ) = \Psi ( u ; G , f , b , n ) + G H w } } \end{array}
|
| 162 |
+
$$
|
| 163 |
+
|
| 164 |
+
where $H$ is a learned linear operator (it satisfies $H 0 = 0$ ). The term $G H w$ can be interpreted as a correction term to $\Psi ( u ; G , \bar { f } , b , n )$ . When there is no confusion, we neglect the dependence on $G , f , b , n$ and denote as $\Psi ( u )$ and $\Phi _ { H } ( u )$ .
|
| 165 |
+
|
| 166 |
+
$\Phi _ { H }$ should have similar computation complexity as $\Psi$ . Therefore, we choose $H$ to be a convolutional operator, which can be parameterized by a deep linear convolutional network. We will discuss the parameterization of $H$ in detail in Section 3.4; we first prove some parameterization independent properties.
|
| 167 |
+
|
| 168 |
+
The correct PDE solution is a fixed point of $\Phi _ { H }$ by the following lemma:
|
| 169 |
+
|
| 170 |
+
Lemma 1. For any PDE problem $( A , G , f , b , n )$ and choice of $H$ , if $u ^ { * }$ is a fixed point of $\Psi$ , it is $a$ fixed point of $\Phi _ { H }$ in Eq. (10).
|
| 171 |
+
|
| 172 |
+
Proof. Based on the iterative rule in Eq. (10), if $u ^ { * }$ satisfies $\Psi ( u ^ { * } ) = u ^ { * }$ then $w = \Psi ( u ^ { * } ) - u ^ { * } = \mathbf { 0 }$ Therefore, $\Phi _ { H } ( u ^ { * } ) = \Psi ( u ^ { * } ) + G H \mathbf { 0 } = u ^ { * }$ . □
|
| 173 |
+
|
| 174 |
+
Moreover, the space of $\Phi _ { H }$ subsumes the standard solver $\Psi$ . If $H = 0$ , then $\Phi _ { H } = \Psi$ . Furthermore, denote $\Psi ( u ) = T u + c$ , then if $H = T$ , then since $G T = T$ (see Eq. (7)),
|
| 175 |
+
|
| 176 |
+
$$
|
| 177 |
+
\Phi _ { H } ( u ) = \Psi ( u ) + G T ( \Psi ( u ) - u ) = T \Psi ( u ) + c = \Psi ^ { 2 } ( u )
|
| 178 |
+
$$
|
| 179 |
+
|
| 180 |
+
which is equal to two iterations of $\Psi$ . Computing $\Psi$ requires one convolution $T$ , while computing $\Phi _ { H }$ requires two convolutions: $T$ and $H$ . Therefore, if we choose $H = T$ , then $\Phi _ { H }$ computes two iterations of $\Psi$ with two convolutions: it is at least as efficient as the standard solver $\Psi$ .
|
| 181 |
+
|
| 182 |
+
# 3.2 TRAINING AND GENERALIZATION
|
| 183 |
+
|
| 184 |
+
We train our iterator $\Phi _ { H } ( u ; G , f , b , n )$ to converge quickly to the ground truth solution on a set $\mathcal { D } = \{ ( G _ { l } , f _ { l } , b _ { l } , n _ { l } ) \} _ { l = 1 } ^ { M }$ of problem instances. For each instance, the ground truth solution $u ^ { * }$ is obtained from the existing solver $\Psi$ . The learning objective is then
|
| 185 |
+
|
| 186 |
+
$$
|
| 187 |
+
\operatorname* { m i n } _ { H } \sum _ { ( G _ { l } , f _ { l } , b _ { l } , n _ { l } ) \in \mathcal { D } } \mathbb { E } _ { u ^ { 0 } \sim \mathcal { N } ( 0 , 1 ) } \| \Phi _ { H } ^ { k } ( u ^ { 0 } ; G _ { l } , f _ { l } , b _ { l } , n _ { l } ) - u ^ { * } \| _ { 2 } ^ { 2 }
|
| 188 |
+
$$
|
| 189 |
+
|
| 190 |
+
Intuitively, we look for a matrix $H$ such that the corresponding iterator $\Phi _ { H }$ will get us as close as possible to the solution in $k$ steps, starting from a random initialization $u ^ { 0 }$ sampled from a white Gaussian. $k$ in our experiments is uniformly chosen from [1, 20], similar to the procedure in (Song et al., 2017). Smaller $k$ is easier to learn with less steps to back-propagate through, while larger $k$ better approximates our test-time setting: we care about the final approximation accuracy after a given number of iteration steps. Combining smaller and larger $k$ performs best in practice.
|
| 191 |
+
|
| 192 |
+
We show in the following theorem that there is a convex open set of $H$ that the learning algorithm can explore. To simplify the statement of the theorem, for any linear iterator $\Phi ( u ) = \mathbf { \bar { \mathit { T } } } u \mathbf { \bar { \mathit { + } } } c$ we will refer to the spectral radius (norm) of $\Phi$ as the spectral radius (norm) of $T$ .
|
| 193 |
+
|
| 194 |
+
Theorem 2. For fixed $G , f , b , n ,$ , the spectral norm of $\Phi _ { H } ( u ; G , f , b , n )$ is a convex function of $H$ and the set of $H$ such that the spectral norm of $\Phi _ { H } ( u ; G , f , b , n ) < 1$ is a convex open set.
|
| 195 |
+
|
| 196 |
+
Proof. See Appendix A.
|
| 197 |
+
|
| 198 |
+
Therefore, to find an iterator with small spectral norm, the learning algorithm only has to explore a convex open set. Note that Theorem 2 holds for spectral norm, whereas validity requires small spectral radius in Theorem 1. Nonetheless, several important PDE problems (Poisson, Helmholtz, etc) are symmetric, so it is natural to use a symmetric iterator, which means that spectral norm is equal to spectral radius. In our experiments, we do not explicitly enforce symmetry, but we observe that the optimization finds symmetric iterators automatically.
|
| 199 |
+
|
| 200 |
+
For training, we use a single grid size $n$ , a single geometry $G$ , $f = 0$ , and a restricted set of boundary conditions $b$ . The geometry we use is a square domain shown in Figure 1a. Although we train on a single domain, the model has surprising generalization properties, which we show in the following:
|
| 201 |
+
|
| 202 |
+
Proposition 2. For fixed $A , G , n$ and fixed $H$ , if for some $f _ { 0 } , b _ { 0 } , \Phi _ { H } ( u ; G , f _ { 0 } , b _ { 0 } , n )$ is valid for the PDE problem $( A , G , f _ { 0 } , b _ { 0 } , n )$ , then for all $f$ and $b$ , the iterator $\Phi _ { H } ( u ; G , f , b , n )$ is valid for the PDE problem $( A , G , f , b , n )$ .
|
| 203 |
+
|
| 204 |
+
Proof. See Appendix A.
|
| 205 |
+
|
| 206 |
+
The proposition states that we freely generalize to different $f$ and $b$ . There is no guarantee that we can generalize to different $G$ and $n$ . Generalization to different $G$ and $n$ has to be empirically verified: in our experiments, our learned iterator converges to the correct solution for a variety of grid sizes $n$ and geometries $G$ , even though it was only trained on one grid size and geometry.
|
| 207 |
+
|
| 208 |
+
Even when generalization fails, there is no risk of obtaining incorrect results. The iterator will simply fail to converge. This is because according to Lemma 1, fixed points of our new iterator is the same as the fixed point of hand designed iterator $\Psi$ . Therefore if our iterator is convergent, it is valid.
|
| 209 |
+
|
| 210 |
+
# 3.3 INTERPRETATION OF $H$
|
| 211 |
+
|
| 212 |
+
What is $H$ trying to approximate? In this section we show that we are training our linear function $G H$ to approximate $\bar { T ( I - T ) } ^ { - 1 }$ : if it were able to approximate $T ( I - T ) ^ { - 1 }$ perfectly, our iterator $\Phi _ { H }$ will converge to the correct solution in a single iteration.
|
| 213 |
+
|
| 214 |
+
Let the original update rule be $\Psi ( u ) = T u + c$ , and the unknown ground truth solution be $u ^ { * }$ satisfying $u ^ { * } = T u ^ { * } + c$ . Let $r = u ^ { * } - u$ be the current error, and $e = u ^ { * } - \Psi ( u )$ be the new error after applying one step of $\Psi$ . They are related by
|
| 215 |
+
|
| 216 |
+
$$
|
| 217 |
+
e = u ^ { * } - \Psi ( u ) = u ^ { * } - ( T u + c ) = T ( u ^ { * } - u ) = T r
|
| 218 |
+
$$
|
| 219 |
+
|
| 220 |
+
In addition, let $w = \Psi ( u ) - u$ be the update $\Psi$ makes. This is related to the current error $r$ by
|
| 221 |
+
|
| 222 |
+
$$
|
| 223 |
+
w = \Psi ( u ) - u = T u + c - u + ( u ^ { * } - T u ^ { * } - c ) = T ( u - u ^ { * } ) + ( u ^ { * } - u ) = ( I - T ) r
|
| 224 |
+
$$
|
| 225 |
+
|
| 226 |
+
From Eq. (10) we can observe that the linear operator $G H$ takes as input $\Psi$ ’s update $w$ , and tries to approximate the error $e$ : $G H w \approx e$ . If the approximation were perfect: $G H w = e$ , the iterator $\Phi _ { H }$ would converge in a single iteration. Therefore, we are trying to find some linear operator $R$ , such that $R w = e$ . In fact, if we combine Eq. (13) and Eq. (14), we can observe that $T ( I - T ) ^ { - 1 }$ is (uniquely) the linear operator we are looking for
|
| 227 |
+
|
| 228 |
+
$$
|
| 229 |
+
T ( I - T ) ^ { - 1 } w = e
|
| 230 |
+
$$
|
| 231 |
+
|
| 232 |
+
where $( I - T ) ^ { - 1 }$ exists because $\rho ( T ) < 1$ , so all eigenvalues of $I - T$ must be strictly positive.
|
| 233 |
+
Therefore, we would like our linear function $G H$ to approximate $T ( I - T ) ^ { - 1 }$ .
|
| 234 |
+
|
| 235 |
+
Note that $( I - T ) ^ { - 1 }$ is a dense matrix in general, meaning that it is impossible to exactly achieve $G H = T ( { \cal I } - { \cal T } ) \dot { - } 1$ with a convolutional operator $H$ . However, the better $G H$ is able to approximate $T ( I - T ) ^ { - 1 }$ , the faster our iterator converges to the solution $u ^ { * }$ .
|
| 236 |
+
|
| 237 |
+
# 3.4 LINEAR DEEP NETWORKS
|
| 238 |
+
|
| 239 |
+
In our iterator design, $H$ is a linear function parameterized by a linear deep network without nonlinearity or bias terms. Even though our objective in Eq. (12) is a non-linear function of the parameters of the deep network, this is not an issue in practice. In particular, Arora et al. (2018) observes that when modeling linear functions, deep networks can be faster to optimize with gradient descent compared to linear ones, despite non-convexity.
|
| 240 |
+
|
| 241 |
+
Even though a linear deep network can only represent a linear function, it has several advantages. On an $n \times n$ grid, each convolution layer only requires $O ( n ^ { 2 } )$ computation and have a constant number of parameters, while a general linear function requires ${ \dot { O ( n ^ { 4 } ) } }$ computation and have $O ( n ^ { 4 } )$ parameters. Stacking $d$ convolution layers allows us to parameterize complex linear functions with large receptive fields, while only requiring $O ( d n ^ { 2 } )$ computation and $O ( d ) ^ { \top }$ parameters. We experiment on two types of linear deep networks:
|
| 242 |
+
|
| 243 |
+
Conv model. We model $H$ as a network with $3 \times 3$ convolutional layers without non-linearity or bias. We will refer to a model with $k$ layers as $^ { 6 6 } \mathrm { C o n v } k ^ { \prime }$ , e.g. Conv3 has 3 convolutional layers.
|
| 244 |
+
|
| 245 |
+
U-Net model. The Conv models suffer from the same problem as Jacobi: the receptive field grows only by 1 for each additional layer. To resolve this problem, we design the deep network counterpart of the Multigrid method. Instead of manually designing the sub-sampling $/$ super-sampling functions, we use a U-Net architecture (Ronneberger et al., 2015) to learn them from data. Because each layer reduces the grid size by half, and the $i$ -th layer of the U-Net only operates on $( 2 ^ { - i } n )$ -sized grids, the total computation is only increased by a factor of
|
| 246 |
+
|
| 247 |
+
$$
|
| 248 |
+
1 + 1 / 4 + 1 / 1 6 + \cdot \cdot \cdot < 4 / 3
|
| 249 |
+
$$
|
| 250 |
+
|
| 251 |
+
compared to a two-layer convolution. The minimal overhead provides a very large improvement of convergence speed in our experiments. We will refer to Multigrid and U-Net models with $k$ sub-sampling layers as Multigrid $k$ and U-Netk, e.g. U-Net2 is a model with 2 sub-sampling layers.
|
| 252 |
+
|
| 253 |
+
# 4 EXPERIMENTS
|
| 254 |
+
|
| 255 |
+
# 4.1 SETTING
|
| 256 |
+
|
| 257 |
+
We evaluate our method on the 2D Poisson equation with Dirichlet boundary conditions, $\nabla ^ { 2 } u =$ $\boldsymbol { \mathscr { f } }$ . There exist several iterative solvers for the Poisson equation, including Jacobi, Gauss-Seidel, conjugate-gradient, and multigrid methods. We select the Jacobi method as our standard solver $\Psi$ .
|
| 258 |
+
|
| 259 |
+
To reemphasize, our goal is to train a model on simple domains where the ground truth solutions can be easily obtained, and then evaluate its performance on different geometries and boundary conditions. Therefore, for training, we select the simplest Laplace equation, $\nabla ^ { 2 } u = 0$ , on a square domain with boundary conditions such that each side is a random fixed value. Figure 1a shows an example of our training domain and its ground truth solution. This setting is also used in Farimani et al. (2017) and Sharma et al. (2018).
|
| 260 |
+
|
| 261 |
+

|
| 262 |
+
Figure 1: The ground truth solutions of examples in different settings. We only train our models on the square domain, and we test on all 4 settings.
|
| 263 |
+
|
| 264 |
+
For testing, we use larger grid sizes than training. For example, we test on $2 5 6 \times 2 5 6$ grid for a model trained on $6 4 \times 6 4$ grids. Moreover, we designed challenging geometries to test the generalization of our models. We test generalization on 4 different settings: (i) same geometry but larger grid, (ii) L-shape geometry, (iii) Cylinders geometry, and (iv) Poisson equation in same geometry, but $f \neq 0$ . The two geometries are designed because the models were trained on square domains and have never seen sharp or curved boundaries. Examples of the 4 settings are shown in Figure 1.
|
| 265 |
+
|
| 266 |
+
# 4.2 EVALUATION
|
| 267 |
+
|
| 268 |
+
As discussed in Section 2.4, the convergence rate of any linear iterator can be determined from the spectral radius $\rho ( T )$ , which provides guarantees on convergence and convergence rate. However, a fair comparison should also consider the computation cost of $H$ . Thus, we evaluate the convergence rate by calculating the computation cost required for the error to drop below a certain threshold.
|
| 269 |
+
|
| 270 |
+
On GPU, the Jacobi iterator and our model can both be efficiently implemented as convolutional layers. Thus, we measure the computation cost by the number of convolutional layers. On CPU, each Jacobi iteration $\begin{array} { r } { u _ { i , j } ^ { \prime } = \frac { 1 } { 4 } ( u _ { i - 1 , j } + u _ { i + 1 , j } + \dot { u } _ { i , j - 1 } + u _ { i , j + 1 } ) } \end{array}$ has 4 multiply-add operations, while a $3 \times 3$ convolutional kernel requires 9 operations, so we measure the computation cost by the number of multiply-add operations. This metric is biased in favor of Jacobi because there is little practical reason to implement convolutions on CPU. Nonetheless, we report both metrics in our experiments.
|
| 271 |
+
|
| 272 |
+
# 4.3 CONV MODEL
|
| 273 |
+
|
| 274 |
+
Table 1 shows results of the Conv model. The model is trained on a $1 6 \times 1 6$ square domain, and tested on $6 4 \times 6 4$ . For all settings, our models converge to the correct solution, and require less computation than Jacobi. The best model, Conv3, is $\sim 5 \times$ faster than Jacobi in terms of layers, and $\sim 2 . 5 \times$ faster in terms of multiply-add operations.
|
| 275 |
+
|
| 276 |
+
As discussed in Section 3.2, if our iterator converges for a geometry, then it is guaranteed to converge to the correct solution for any $f$ and boundary values $b$ . The experiment results show that our model not only converges but also converges faster than the standard solver, even though it is only trained on a smaller square domain.
|
| 277 |
+
|
| 278 |
+
# 4.4 U-NET MODEL
|
| 279 |
+
|
| 280 |
+
For the U-Net models, we compare them against Multigrid models with the same number of subsampling and smoothing layers. Therefore, our models have the same number of convolutional layers, and roughly $9 / 4$ times the number of operations compared to Multigrid. The model is trained on a $6 4 \times 6 4$ square domain, and tested on $2 5 6 \times 2 5 6$ .
|
| 281 |
+
|
| 282 |
+
The bottom part of Table 1 shows the results of the U-Net model. Similar to the results of Conv models, our models outperforms Multigrid in all settings. Note that U-Net2 has lower computation cost compared with Multigrid2 than U-Net3 compared to Multigrid 3. This is because Multigrid2 is a relatively worse baseline. U-Net3 still converges faster than U-Net2.
|
| 283 |
+
|
| 284 |
+
Table 1: Comparisons between our models and the baseline solvers. The Conv models are compared with Jacobi, and the U-Net models are compared with Multigrid. The numbers are the ratio between the computation costs of our models and the baselines. None of the values are greater than 1, which means that all of our models achieve a speed up on every problem and both performance metric (convolutional layers and multiply-add operations).
|
| 285 |
+
|
| 286 |
+
<table><tr><td>Model</td><td>Baseline</td><td>Square layers /ops</td><td>L-shape layers /ops</td><td>Cylinders layers /ops</td><td>Square-Poisson layers /ops</td></tr><tr><td>Conv1</td><td>Jacobi</td><td>0.432/0.702</td><td>0.432/0.702</td><td>0.432/0.702</td><td>0.431/0.701</td></tr><tr><td>Conv2</td><td>Jacobi</td><td>0.286 / 0.524</td><td>0.286 / 0.524</td><td>0.286 / 0.524</td><td>0.285 / 0.522</td></tr><tr><td>Conv3</td><td>Jacobi</td><td>0.219 / 0.424</td><td>0.219 / 0.423</td><td>0.220 / 0.426</td><td>0.217 /0.421</td></tr><tr><td>Conv4</td><td>Jacobi</td><td>0.224 /0.449</td><td>0.224 / 0.449</td><td>0.224 / 0.448</td><td>0.222 / 0.444</td></tr><tr><td>U-Net2</td><td>Multigrid2</td><td>0.091/0.205</td><td>0.090/0.203</td><td>0.091/0.204</td><td>0.079 / 0.178</td></tr><tr><td>U-Net3</td><td>Multigrid3</td><td>0.220 / 0.494</td><td>0.213 / 0.479</td><td>0.201 / 0.453</td><td>0.185 / 0.417</td></tr></table>
|
| 287 |
+
|
| 288 |
+

|
| 289 |
+
Figure 2: CPU runtime comparisons of our model with the FEniCS model. Our method is comparable or faster than the best solver in FEniCS in all cases. When run on GPU, our solver provides an additional $3 0 \times$ speedup.
|
| 290 |
+
|
| 291 |
+
# 4.5 COMPARISON WITH FENICS
|
| 292 |
+
|
| 293 |
+
The FEniCS package (Logg et al., 2012) provides a collection of tools with high-level Python and $\mathrm { C } { + } { + }$ interfaces to solve differential equations. The open-source project is developed and maintained by a global community of scientists and software developers. Its extensive optimization over the years, including the support for parallel computation, has led to its widespread adaption in industry and academia (Alnæs et al., 2015).
|
| 294 |
+
|
| 295 |
+
We measure the wall clock time of the FEniCS model and our model, run on the same hardware. The FEniCS model is set to be the minimal residual method with algebraic multigrid preconditioner, which we measure to be the fastest compared to other methods such as Jacobi or Incomplete LU factorization preconditioner. We ignore the time it takes to set up geometry and boundary conditions, and only consider the time the solver takes to solve the problem. We set the error threshold to be 1 percent of the initial error. For the square domain, we use a quadrilateral mesh. For the L-shape and cylinder domains, however, we let FEniCS generate the mesh automatically, while ensuring the number of mesh points to be similar.
|
| 296 |
+
|
| 297 |
+
Figure 2 shows that our model is comparable or faster than FEniCS in wall clock time. These experiments are all done on CPU. Our model efficiently runs on GPU, while the fast but complex methods in FEniCS do not have efficient GPU implementations available. On GPU, we measure an additional $3 0 \times$ speedup (on Tesla K80 GPU, compared with a 64-core CPU).
|
| 298 |
+
|
| 299 |
+
# 5 RELATED WORK
|
| 300 |
+
|
| 301 |
+
Recently, there have been several works on applying deep learning to solve the Poisson equation. However, to the best of our knowledge, previous works used deep networks to directly generate the solution; they have no correctness guarantees and are not generalizable to arbitrary grid sizes and boundary conditions. Most related to our work are (Farimani et al., 2017) and (Sharma et al., 2018), which learn deep networks to output the solution of the 2D Laplace equation (a special case where $f = 0 ,$ ). (Farimani et al., 2017) trained a U-Net model that takes in the boundary condition as a 2D image and outputs the solution. The model is trained by L1 loss to the ground truth solution and an adversarial discriminator loss. (Sharma et al., 2018) also trained a U-net model but used a weakly-supervised loss. There are other related works that solved the Poisson equation in concrete physical problems. (Tang et al., 2017) solved for electric potential in 2D/3D space; (Tompson et al., 2017) solved for pressure fields for fluid simulation; (Zhang et al., 2018) solved particle simulation of a PN Junction.
|
| 302 |
+
|
| 303 |
+
There are other works that solve other types of PDEs. For example, many studies aimed to use deep learning to accelerate and approximate fluid dynamics, governed by the Euler equation or the Navier-Stokes equations (Guo et al., 2016; Yang et al., 2016; Chu & Thuerey, 2017; Kutz, 2017). (Eismann et al., 2018) use Bayesian optimization to design shapes with reduced drag coefficients in laminar fluid flow. Other applications include solving the Schrodinger equation (Mills et al., 2017), turbulence modeling (Singh et al., 2017), and the American options and Black Scholes PDE (Sirignano & Spiliopoulos, 2018). A lot of these PDEs are nonlinear and may not have a standard linear iterative solver, which is a limitation to our current method since our model must be built on top of an existing linear solver to ensure correctness. We consider the extension to different PDEs as future work.
|
| 304 |
+
|
| 305 |
+
# 6 CONCLUSION
|
| 306 |
+
|
| 307 |
+
We presented a method to learn an iterative solver for PDEs that improves on an existing standard solver. The correct solution is theoretically guaranteed to be the fixed point of our iterator. We show that our model, trained on simple domains, can generalize to different grid sizes, geometries and boundary conditions. It converges correctly and achieves significant speedups compared to standard solvers, including highly optimized ones implemented in FEniCS.
|
| 308 |
+
|
| 309 |
+
# REFERENCES
|
| 310 |
+
|
| 311 |
+
Martin S Alnæs, Jan Blechta, Johan Hake, August Johansson, Benjamin Kehlet, Anders Logg, Chris Richardson, Johannes Ring, Marie E Rognes, and Garth N Wells. The fenics project version 1.5. Archive of Numerical Software, 3(100):9–23, 2015.
|
| 312 |
+
|
| 313 |
+
Marcin Andrychowicz, Misha Denil, Sergio Gomez, Matthew W Hoffman, David Pfau, Tom Schaul, Brendan Shillingford, and Nando De Freitas. Learning to learn by gradient descent by gradient descent. In Advances in Neural Information Processing Systems, 2016.
|
| 314 |
+
|
| 315 |
+
Sanjeev Arora, Nadav Cohen, and Elad Hazan. On the optimization of deep networks: Implicit acceleration by overparameterization. arXiv preprint arXiv:1802.06509, 2018.
|
| 316 |
+
|
| 317 |
+
William L Briggs, Steve F McCormick, et al. A multigrid tutorial, volume 72. Siam, 2000.
|
| 318 |
+
|
| 319 |
+
Mengyu Chu and Nils Thuerey. Data-driven synthesis of smoke flows with cnn-based feature descriptors. ACM Transactions on Graphics (TOG), 36(4):69, 2017.
|
| 320 |
+
|
| 321 |
+
Stephan Eismann, Daniel Levy, Rui Shu, Stefan Bartzsch, and Stefano Ermon. Bayesian optimization and attribute adjustment. In Proc. 34th Conference on Uncertainty in Artificial Intelligence, 2018.
|
| 322 |
+
|
| 323 |
+
Amir Barati Farimani, Joseph Gomes, and Vijay S Pande. Deep learning the physics of transport phenomena. arXiv preprint arXiv:1709.02432, 2017.
|
| 324 |
+
|
| 325 |
+
Stanley P Frankel. Convergence rates of iterative treatments of partial differential equations. Mathematical Tables and Other Aids to Computation, 4(30):65–75, 1950.
|
| 326 |
+
|
| 327 |
+
Xiaoxiao Guo, Wei Li, and Francesco Iorio. Convolutional neural networks for steady flow approximation. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 481–490, 2016.
|
| 328 |
+
|
| 329 |
+
Tim Kraska, Alex Beutel, Ed H Chi, Jeffrey Dean, and Neoklis Polyzotis. The case for learned index structures. In Proceedings of the 2018 International Conference on Management of Data, pp. 489–504. ACM, 2018.
|
| 330 |
+
|
| 331 |
+
J Nathan Kutz. Deep learning in fluid dynamics. Journal of Fluid Mechanics, 814:1–4, 2017.
|
| 332 |
+
|
| 333 |
+
Randall J LeVeque. Finite difference methods for ordinary and partial differential equations: steadystate and time-dependent problems, volume 98. Siam, 2007.
|
| 334 |
+
|
| 335 |
+
Daniel Levy, Matthew D Hoffman, and Jascha Sohl-Dickstein. Generalizing hamiltonian monte carlo with neural networks. arXiv preprint arXiv:1711.09268, 2017.
|
| 336 |
+
|
| 337 |
+
Anders Logg, Kent-Andre Mardal, and Garth Wells. Automated solution of differential equations by the finite element method: The FEniCS book. Springer, 2012. ISBN 978-3-642-23098-1. doi: 10.1007/978-3-642-23099-8.
|
| 338 |
+
|
| 339 |
+
Kyle Mills, Michael Spanner, and Isaac Tamblyn. Deep learning and the schrodinger equation.¨ Physical Review A, 96(4):042113, 2017.
|
| 340 |
+
|
| 341 |
+
Peter J Olver. Numerical solution of ordinary differential equations. Numerical Analysis Lecture Notes, 2008.
|
| 342 |
+
|
| 343 |
+
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.
|
| 344 |
+
|
| 345 |
+
Rishi Sharma, Amir Barati Farimani, Joe Gomes, Peter Eastman, and Vijay Pande. Weaklysupervised deep learning of heat transport via physics informed loss. arXiv preprint arXiv:1807.11374, 2018.
|
| 346 |
+
|
| 347 |
+
Anand Pratap Singh, Shivaji Medida, and Karthik Duraisamy. Machine-learning-augmented predictive modeling of turbulent separated flows over airfoils. AIAA Journal, pp. 2215–2227, 2017.
|
| 348 |
+
|
| 349 |
+
Justin Sirignano and Konstantinos Spiliopoulos. Dgm: A deep learning algorithm for solving partial differential equations. Journal of Computational Physics, 375:1339–1364, 2018.
|
| 350 |
+
|
| 351 |
+
Jiaming Song, Shengjia Zhao, and Stefano Ermon. A-nice-mc: Adversarial training for mcmc. In Advances in Neural Information Processing Systems, 2017.
|
| 352 |
+
|
| 353 |
+
Wei Tang, Tao Shan, Xunwang Dang, Maokun Li, Fan Yang, Shenheng Xu, and Ji Wu. Study on a poisson’s equation solver based on deep learning technique. In IEEE Electrical Design of Advanced Packaging and Systems Symposium (EDAPS). IEEE, 2017.
|
| 354 |
+
|
| 355 |
+
Jonathan Tompson, Kristofer Schlachter, Pablo Sprechmann, and Ken Perlin. Accelerating eulerian fluid simulation with convolutional networks. In International Conference on Machine Learning, 2017.
|
| 356 |
+
|
| 357 |
+
Cheng Yang, Xubo Yang, and Xiangyun Xiao. Data-driven projection method in fluid simulation. Computer Animation and Virtual Worlds, 27(3-4):415–424, 2016.
|
| 358 |
+
|
| 359 |
+
Zhongyang Zhang, Ling Zhang, Ze Sun, Nicholas Erickson, Ryan From, and Jun Fan. Solving poisson’s equation using deep learning in particle simulation of pn junction. arXiv preprint arXiv:1810.10192, 2018.
|
| 360 |
+
|
| 361 |
+
# A PROOFS
|
| 362 |
+
|
| 363 |
+
Theorem 1. For a linear iterator $\Psi ( u ) = T u + c , \Psi$ $\Psi$ converges to a unique stable fixed point from any initialization if and only if the spectral radius $\rho ( T ) < 1$ .
|
| 364 |
+
|
| 365 |
+
Proof. Suppose $\rho ( T ) < 1$ , then $( I { - } T ) ^ { - 1 }$ must exist because all eigenvalues of $I { - } T$ must be strictly positive. Let $u ^ { * } = ( I - T ) ^ { - 1 } c ;$ ; this $u ^ { * }$ is a stationary point of the iterator $\Psi$ , i.e. $u ^ { * } = T u ^ { * } + c$ . For any initialization $u ^ { 0 }$ , let $\boldsymbol { u } ^ { \hat { k } } = \boldsymbol { \Psi } ^ { k } ( \boldsymbol { u } ^ { 0 } )$ . The error $e ^ { k } = u ^ { * } - u ^ { k }$ satisfies
|
| 366 |
+
|
| 367 |
+
$$
|
| 368 |
+
T e ^ { k } = ( T u ^ { * } + c ) - ( T u ^ { k } + c ) = u ^ { * } - u ^ { k + 1 } = e ^ { k + 1 } \Rightarrow e ^ { k } = T ^ { k } e ^ { 0 }
|
| 369 |
+
$$
|
| 370 |
+
|
| 371 |
+
Since $\rho ( T ) < 1$ , we know $T ^ { k } 0$ as $k \infty$ (LeVeque, 2007), which means the error $e ^ { k } \to 0$ Therefore, $\Psi$ converges to $u ^ { * }$ from any $u ^ { 0 }$ .
|
| 372 |
+
|
| 373 |
+
Now suppose $\rho ( T ) \geq 1$ . Let $\lambda _ { 1 }$ be the largest absolute eigenvalue where $\rho ( T ) = | \lambda _ { 1 } | \geq 1$ , and $v _ { 1 }$ be its corresponding eigenvector. We select initialization $u ^ { 0 } = u ^ { * } + v _ { 1 }$ , then $e ^ { 0 } = v _ { 1 }$ . Because $| \lambda _ { 1 } | \ge 1$ , we have $| \lambda _ { 1 } ^ { k } | \geq \bar { 1 }$ , then
|
| 374 |
+
|
| 375 |
+
$$
|
| 376 |
+
T ^ { k } e ^ { 0 } = \lambda _ { 1 } ^ { k } v _ { 1 } \triangleleft _ { k \to \infty } 0
|
| 377 |
+
$$
|
| 378 |
+
|
| 379 |
+
However we know that under a different initialization $\hat { u } ^ { 0 } = u ^ { * }$ , we have $\hat { e } ^ { 0 } = 0$ , so $T ^ { k } \hat { e } ^ { 0 } = 0$ . Therefore the iteration cannot converge to the same fixed point from different initializations $u ^ { 0 }$ and $\hat { u } ^ { 0 }$ .
|
| 380 |
+
|
| 381 |
+
Proposition 1 If $M$ is a full rank diagonal matrix, and $u ^ { * } \in \mathbb { R } ^ { n ^ { 2 } \times n ^ { 2 } }$ satisfies Eq. $( 7 )$ , then $u ^ { * }$ satisfies Eq. (4).
|
| 382 |
+
|
| 383 |
+
Proof of Proposition $^ { l }$ . Let $u ^ { * }$ be a fixed point of Eq. (7) then
|
| 384 |
+
|
| 385 |
+
$$
|
| 386 |
+
G u ^ { * } + ( I - G ) u ^ { * } = G ( M ^ { - 1 } N u ^ { * } + M ^ { - 1 } f ) + ( I - G ) b
|
| 387 |
+
$$
|
| 388 |
+
|
| 389 |
+
This is equivalent to
|
| 390 |
+
|
| 391 |
+
$$
|
| 392 |
+
\begin{array} { c } { { ( I - G ) u ^ { * } = ( I - G ) b } } \\ { { \nonumber } } \\ { { G ( u ^ { * } - M ^ { - 1 } N u ^ { * } - M ^ { - 1 } f ) = 0 } } \end{array}
|
| 393 |
+
$$
|
| 394 |
+
|
| 395 |
+
The latter equation is equivalent to $G M ^ { - 1 } ( A u ^ { * } - f ) = 0$ . If $M$ is a full rank diagonal matrix, this implies $G ( A u ^ { * } - f ) = 0$ , which is $G A u ^ { * } = G f$ . Therefore, $u ^ { * }$ satisfies Eq.(4). □
|
| 396 |
+
|
| 397 |
+
Theorem 2. For fixed $G , f , b , n$ , the spectral norm of $\Phi _ { H } ( u ; G , f , b , n )$ is a convex function of $H$ , and the set of $H$ such that the spectral norm of $\Phi _ { H } ( u ; G , f , b , n ) < 1$ is a convex open set.
|
| 398 |
+
|
| 399 |
+
Proof. As before, denote $\Psi ( u ) = T u + c$ . Observe that
|
| 400 |
+
|
| 401 |
+
$$
|
| 402 |
+
\Phi _ { H } ( u ; G , f , b , n ) = T u + c + G H ( T u + c - u ) = ( T + G H T - G H ) u + G H c + c T ( T + G H T - G H ) .
|
| 403 |
+
$$
|
| 404 |
+
|
| 405 |
+
The spectral norm $\lVert \cdot \rVert _ { 2 }$ is convex with respect to its argument, and $( T + G H T - G H )$ is linear in $H$ . Thus, $\| T + G H T - G H \| _ { 2 }$ is convex in $H$ as well. Thus, under the condition that $\| T +$ $G H T - G H \vert _ { 2 } < 1$ , the set of $H$ must be convex because it is a sub-level set of the convex function $\| T + G H T - G H \| _ { 2 }$ .
|
| 406 |
+
|
| 407 |
+
To prove that it is open, observe that $\lVert \cdot \rVert _ { 2 }$ is a continuous function, so $\| T + G H T - G H \| _ { 2 }$ is a continuous map from $H$ to the spectral radius of $\Phi _ { H }$ . If we consider the set of $H$ such that $\| T + G H T - G H \| _ { 2 } < 1$ , this set is the preimage of $( - \epsilon , 1 )$ for any $\epsilon > 0$ . As $( - \epsilon , 1 )$ is open, its preimage must be open.
|
| 408 |
+
|
| 409 |
+
Proposition 2. For fixed $A , G , n$ and fixed $H$ , if for some $f _ { 0 } , b _ { 0 } , \Phi _ { H } ( u ; G , f _ { 0 } , b _ { 0 } , n )$ is valid for the PDE problem $( A , G , f _ { 0 } , b _ { 0 } , n )$ , then for all $f$ and $b$ , the iterator $\Phi _ { H } ( u ; G , f , b , n )$ is valid for the PDE problem $( A , G , f , b , n )$ .
|
| 410 |
+
|
| 411 |
+
Proof. From Theorem 1 and Lemma 1, our iterator is valid if and only if $\rho ( T + G H T - G H ) < 1$ . The iterator $T + G H T - G H$ only depends on $A , G$ , and is independent of the constant $c$ in Eq. (18). Thus, the validity of the iterator is independent with $f$ and $b$ . Thus, if the iterator is valid for some $f _ { 0 }$ and $b _ { 0 }$ , then it is valid for any choice of $f$ and $b$ .
|
| 412 |
+
|
| 413 |
+
# B PROOF OF CONVERGENCE OF JACOBI METHOD
|
| 414 |
+
|
| 415 |
+
In Section 2.4.1, we show that for Poisson equation, the update matrix $T = G ( I - A )$ . We now formally prove that $\rho ( G ( I - A ) ) < 1$ for any $G$ .
|
| 416 |
+
|
| 417 |
+
For any matrix $T$ , the spectral radius is bounded by the spectral norm: $\rho ( T ) \ \leq \ \| T \| _ { 2 }$ , and the equality holds if $T$ is symmetric. Since $( I - A )$ is a symmetric matrix, $\rho ( I - A ) = \| I - A \| _ { 2 }$ . It has been proven that $\rho ( I - A ) < 1$ (Frankel, 1950). Moreover, $\| G \| _ { 2 } = 1$ . Finally, matrix norms are sub-multiplicative, so
|
| 418 |
+
|
| 419 |
+
$$
|
| 420 |
+
\rho ( T ) \leq \| G ( I - A ) \| _ { 2 } \leq \| G \| _ { 2 } \| I - A \| _ { 2 } < 1
|
| 421 |
+
$$
|
| 422 |
+
|
| 423 |
+
$\rho ( T ) < 1$ is true for any $G$ . Thus, the standard Jacobi method is valid for the Poisson equation under any geometry.
|
md/train/ryG6xZ-RZ/ryG6xZ-RZ.md
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DLVM: A MODERN COMPILER INFRASTRUCTURE FOR DEEP LEARNING SYSTEMS
|
| 2 |
+
|
| 3 |
+
Richard Wei
|
| 4 |
+
Departments of Computer Science & Linguistics
|
| 5 |
+
University of Illinois at Urbana-Champaign
|
| 6 |
+
Urbana, IL 61801
|
| 7 |
+
xwei12@illinois.edu
|
| 8 |
+
Lane Schwartz
|
| 9 |
+
Department of Linguistics
|
| 10 |
+
University of Illinois at Urbana-Champaign
|
| 11 |
+
Urbana, IL 61801
|
| 12 |
+
lanes@illinois.edu
|
| 13 |
+
|
| 14 |
+
# Vikram Adve
|
| 15 |
+
|
| 16 |
+
Department of Computer Science
|
| 17 |
+
University of Illinois at Urbana-Champaign
|
| 18 |
+
Urbana, IL 61801
|
| 19 |
+
vadve@illinois.edu
|
| 20 |
+
|
| 21 |
+
# ABSTRACT
|
| 22 |
+
|
| 23 |
+
Deep learning software demands reliability and performance. However, many of the existing deep learning frameworks are software libraries that act as an unsafe DSL in Python and a computation graph interpreter. We present DLVM, a design and implementation of a compiler infrastructure with a linear algebra intermediate representation, algorithmic differentiation by adjoint code generation, domainspecific optimizations and a code generator targeting GPU via LLVM. Designed as a modern compiler infrastructure inspired by LLVM, DLVM is more modular and more generic than existing deep learning compiler frameworks, and supports tensor DSLs with high expressivity. With our prototypical staged DSL embedded in Swift, we argue that the DLVM system enables a form of modular, safe and performant frameworks for deep learning.
|
| 24 |
+
|
| 25 |
+
# 1 INTRODUCTION
|
| 26 |
+
|
| 27 |
+
Within the deep learning community, most current approaches to neural networks make use of high-level frameworks with a tensor domain-specific language (DSL) such as Torch (Collobert et al., 2011), TensorFlow (Abadi et al., 2016), PyTorch (PyTorch Development Team, 2016), and MXNet (Chen et al., 2015). Traditionally, developers would build a computation graph (or dynamically generate graph nodes) using a DSL and let the framework interpret the computation graph on parallel architectures such as NVIDIA GPUs. While using hand-tuned GPU subroutines usually yields the best performance for complex operators, advanced compiler techniques can be applied to simplify computation, merge high-level operators based on shaping conditions, and fuse compatible elementwise operators to a single kernel to minimize the latency between kernel launches. Recent projects, the TensorFlow XLA compiler (Leary & Wang, 2017) and the NNVM compiler (NNVM, 2017) including TVM (Chen et al., 2017), have begun to apply compiler techniques to deep learning systems, targeting LLVM (Lattner & Adve, 2004) and various back-ends to achieve good performance. However, their design and implementation have not entirely followed established best practices in widely-used compiler frameworks in the industry.
|
| 28 |
+
|
| 29 |
+
Moreover, some frameworks use operator-overloading algorithmic differentiation (AD) to compute gradients, leaving the gradient computation unoptimizable. The other approach to AD, source code transformation, can produce more efficient code. While frameworks such as TensorFlow already perform AD as a graph transformation and apply various optimizations, their AD transformation is not designed as a transformation pass in the pipeline of their compiler framework, but as part of the DSL library. Making AD part of the compiler framework would greatly simplify the development of DSLs, achieving separation of concerns.
|
| 30 |
+
|
| 31 |
+

|
| 32 |
+
Figure 1: Software stack of the DLVM infrastructure. Blue components are the compiler framework.
|
| 33 |
+
|
| 34 |
+
We introduce DLVM, a new compiler infrastructure for deep learning systems that addresses shortcomings of existing deep learning frameworks. Our solution includes (1) a domain-specific intermediate representation specifically designed for tensor computation, (2) principled use of modern compiler optimization techniques to substantially simplify neural network computation, including algebra simplification, AD checkpointing, compute kernel fusion, and various traditional compiler optimizations, (3) code generation through a mature compiler infrastructure that allows for transparent targeting of various hardware, and (4) an embedded DSL that supports static analysis, type safety, and natural expression of tensor computation, and has a just-in-time (JIT) compiler targeting DLVM for AD, optimizations, and code generation.
|
| 35 |
+
|
| 36 |
+
# 2 RELATED WORK
|
| 37 |
+
|
| 38 |
+
Numerous existing projects provide specialized systems for machine learning but are not closely related to our work. These include Apache SystemML (Ghoting et al., 2011), a high-level language and framework for writing and executing machine learning problems targeting Apache Spark, and TACO (Kjolstad et al., 2017), a $\mathrm { C } { + } { + }$ library for compiling and optimizing kernels that is more similar to Halide (Ragan-Kelley et al., 2013) than to our work. Our work treats the creation of neural networks as a compilers problem to be addressed using mature compiler techniques. SystemML does not consider this issue at all; TACO does use compiler optimization, but only at a very low level to generate individual kernels.
|
| 39 |
+
|
| 40 |
+
Two projects closely related to this work are the TensorFlow XLA compiler and the NNVM compiler. The code representation in these frameworks is a “sea of nodes” representation, embedding control flow nodes and composite nodes in a data flow graph. To apply algorithmic differentiation on this IR requires non-standard processing. In contrast, our approach is designed from the start around the idea that a neural network (and its associated tensor computations) is itself a program, which is best optimized through robust application of mature techniques in a principled compilation pipeline. We represent tensor computation in static single assignment (SSA) form with control flow graph, and perform algorithmic differentiation, domain-specific optimizations, general-purpose optimizations, low-level optimizations, and code generation.
|
| 41 |
+
|
| 42 |
+
XLA takes a similar approach to ours, transforming TensorFlow sub-graphs to XLA’s HLO graph and performing optimizations. Our intermediate representation is much more expressive than XLA’s by including modular IR components and general-purpose instructions; this enables our approach to support full-fledged DSLs including standalone compiled DSLs and perform more extensive optimizations such as inlining and interprocedual optimizations. Our approach also differs from XLA by representing composite functions such as min and max directly through primitive instructions such as compare and select, which enables us to apply generic AD, and by using SSA form with control flow graph, which allows for reusing battle-tested SSA optimization algorithms in the LLVM community. Importantly, our entire infrastructure was designed from the start around a robust compile-time framework for tensor DSLs, whereas XLA has been adapted around the existing TensorFlow infrastructure with a particular focus on hardware support for Google’s Tensor Processing Units (Jouppi et al., 2017).
|
| 43 |
+
|
| 44 |
+

|
| 45 |
+
Figure 2: Compilation stages in the DLVM compilation pipeline.
|
| 46 |
+
|
| 47 |
+
Where TVM and NNVM are built as a DSL and a graph library in Python with a $\mathrm { C } { + } { + }$ implementation, DLVM’s architecture is closer to LLVM and the Swift Intermediate Language (Groff & Lattner, 2015), having an IR file format and a full-fledged command line toolchain. More specifically, our work differs from NNVM and XLA in the design and presence of an IR that has a textual parsable format, a module/function/basic block hierarchy, custom type declarations and memory semantics. The textual IR enables robust unit testing via FileCheck, which is used extensively in LLVM and most LLVM-based compilers. Moreover, DLVM and its associated DSLs are implemented entirely in Swift, a safe systems programming language, and thus have an elegantly compact codebase and type-safe APIs.
|
| 48 |
+
|
| 49 |
+
# 3 DLVM
|
| 50 |
+
|
| 51 |
+
Deep Learning Virtual Machine (DLVM) is a compiler infrastructure designed for modern deep learning systems.1 DLVM is designed to apply a multi-stage compiler optimization strategy to both high-level linear algebra and low-level parallelism, perform domain-specific transformations, relieve the overhead in front-end languages, and serve as the host for research and development of DSLs for deep learning. The complete DLVM software stack, including sample front-end deep learning DSLs, is shown in Figure 1 on the preceding page.
|
| 52 |
+
|
| 53 |
+
Figure 2 illustrates the major stages in the DLVM compilation pipeline. The DLVM compilation stages address algorithmic differentiation, domain-specific optimizations, general-purpose optimizations, and static code generation targeting a variety of compute architectures. The raw and optimizable stages allow constructs for high-level tensor operations and various high-level optimizations. The compute and schedule stages allow constructs for low-level array operations lowered from tensor operations in high-level stages, borrowing the design from Halide (Ragan-Kelley et al., 2013).
|
| 54 |
+
|
| 55 |
+
The DLVM Intermediate Representation (IR) is the core language of the system. It uses static single assignment (SSA) form, control flow graphs, high-level types including a first-class tensor type, and a set of linear algebra operators combined with a general-purpose instruction set (see Table 1). The system enables a wide variety of domain-specific analyses and transformations, such as reverse-mode AD, AD checkpointing, algebra simplification and linear algebra fusion.
|
| 56 |
+
|
| 57 |
+
To demonstrate how DLVM helps the development of domain-specific languages (DSLs), in Section 3.4 we present one prototypical staged DSL: NNKit. NNKit features safe and natural expression of tensor computation alongside the host program, and targets DLVM for differentiation, optimizations and static code generation.
|
| 58 |
+
|
| 59 |
+
Table 1: This table illustrates a selection of the instructions in the DLVM virtual instruction set. The instruction set includes linear algebra operations such as tanh and dot in addition to control flow instructions such as branch.
|
| 60 |
+
|
| 61 |
+
<table><tr><td rowspan=1 colspan=1>Kind</td><td rowspan=1 colspan=2>Example</td></tr><tr><td rowspan=2 colspan=1>Element-wise unaryElement-wise binaryDot</td><td></td><td></td></tr><tr><td rowspan=1 colspan=1> dot %a:<10 x</td><td></td></tr><tr><td rowspan=2 colspan=1>ReduceTransposeSliceCompareData type cast</td><td></td><td></td></tr><tr><td rowspan=1 colspan=1>slice %a:</td><td></td></tr><tr><td rowspan=2 colspan=1>Function applicationBranchConditional branchShape cast</td><td rowspan=2 colspan=1>arpl</td><td rowspan=1 colspan=1>ly%</td></tr><tr><td rowspan=1 colspan=1>bran</td><td rowspan=1 colspan=1>nch</td></tr></table>
|
| 62 |
+
|
| 63 |
+
# 3.1 DLVM CORE
|
| 64 |
+
|
| 65 |
+
DLVM Core contains essential components for an optimizing compiler: IR, pass manager, and passes (see Figure 1 on page 2). The DLVM IR consists of a virtual instruction set, control flow graph and data flow representation. Passes are functions that traverse the intermediate representation of a program, either producing useful results as analyses of the program (analysis passes), or mutating the program for differentiation and optimizations (transform passes).
|
| 66 |
+
|
| 67 |
+
# 3.1.1 A DOMAIN-SPECIFIC COMPILER INTERMEDIATE REPRESENTATION FOR DLVM
|
| 68 |
+
|
| 69 |
+
Inspired by the LLVM IR (Lattner & Adve, 2004) and the Swift Intermediate Language (Groff & Lattner, 2015), DLVM IR is a graph-based, modular code representation, with both an in-memory format and a textual format. The code representation has a hierarchy of abstractions: module, function, basic block, and instruction. An instruction is the minimal unit of code that operates on values, which can be globals, function arguments or temporary virtual registers produced by instructions. Each module contains a collection of type definitions, global values and functions. Each function has a control flow graph formed by basic blocks and control flow edges. Each basic block contains an ordered list of instructions with data dependencies forming a directed acyclic graph.
|
| 70 |
+
|
| 71 |
+
The DLVM IR has a high-level type system with tensor as a first-class type. The DLVM virtual instruction set includes domain-specific primitive math operators, as well as general-purpose instructions for memory management, control flow and function application. Domain-specific instructions include element-wise unary operators, such as tanh and negate, element-wise binary operators, such as add and power, and complex operators such as dot, transpose, and convolve. All element-wise binary operators support broadcasting. A sample of DLVM IR code is shown in Figure 3 on the next page.
|
| 72 |
+
|
| 73 |
+
The DLVM instruction set does not include composite math functions such as softmax, sigmoid, min or max. All of these functions can be composed of primitive math instructions and control flow constructs. This design allows for the standard AD algorithm to be applied to any differentiable program, with no need for special handling of composite cases.
|
| 74 |
+
|
| 75 |
+
# 3.1.2 DOMAIN-SPECIFIC COMPILER PASSES FOR DLVM
|
| 76 |
+
|
| 77 |
+
DLVM has a full-fledged pass infrastructure, performing various analyses and two kinds of transformations: differentiation and optimization. Differentiation constructs function definitions from gradient declarations using adjoint code generation (see Section 3.1.3 below). Optimization is then performed on the resulting IR, maximizing the code performance. Optimizations include domainspecific optimizations, such as algebra simplification, linear algebra fusion, matrix multiplication reordering, and AD checkpointing, and traditional compiler optimizations.
|
| 78 |
+
|
| 79 |
+

|
| 80 |
+
Figure 3: Example code in DLVM intermediate representation. Note that some functions are annotated as defining the gradient of another function with respect some or all arguments. The body of these gradient functions will be automatically generated.
|
| 81 |
+
|
| 82 |
+
Since DLVM IR is aware of mathematical operators such as tanh and power, the algebra simplification pass can find and simplify certain mathematical operations that are expensive or redundant. For example, $x ^ { 2 }$ can be simplified to $x \odot x$ $\odot$ stands for element-wise multiplication), and $x ^ { 0 }$ can be simplified to constant 1. Matrix multiplication reordering is another classic optimization that minimizes the number of sub-operations in a chain of matrix multiplications with different dimensionality, based on matrix multiplication’s associativity.
|
| 83 |
+
|
| 84 |
+
Since the DLVM optimizer is aware of linear algebra operations with static dimensionality, maximizing the performance by fusing verbose linear operations into a single matrix multiplication is beneficial as well. For example, it is very common to encounter expressions of the form $\mathbf { W } \mathbf { X } + \mathbf { b }$ When unoptimized, the matrix multiplication and the addition will be parallelized separately. Since launching compute kernels separately can be expensive, DLVM performs linear algebra fusion, which transforms subexpressions involving both matrix multiplication and element-wise operations into a single matrix multiplication instruction on padded tensors. Besides the simple pattern like an addition of matrix multiplication and a vector, we can apply the same approach to a polynomial of multiple matrix multiplications, turning the polynomial into a single matrix multiplication. For example, in a simple recurrent neural network (RNN), each cell of the recurrence is a feed forward neural network that takes two inputs: $\mathbf { x } _ { t }$ , the input local to the current timestep, and $\mathbf { h } _ { t }$ , the hidden state carried along the recurrence. The linear algebra fusion pass can simplify operations in $\mathbf { h } _ { t } = f ( \mathbf { W } \mathbf { x } _ { t - 1 } + \mathbf { U } \mathbf { h } _ { t - 1 } + \mathbf { b } )$ from two matrix multiplications and two additions into a single matrix multiplication. A more aggressive, interprocedural version of linear algebra fusion can optimize parameter passing and memory allocation, so that the entire concatenated matrix can be created and passed around in the first place without reallocation.
|
| 85 |
+
|
| 86 |
+
# 3.1.3 ALGORITHMIC DIFFERENTIATION THROUGH ADJOINT CODE GENERATION
|
| 87 |
+
|
| 88 |
+
Algorithmic differentiation (AD), also known as automatic differentiation, encompasses a family of a well-known techniques for algorithmically obtaining the derivatives of a function $f : \mathbf { x } \in \mathbb { R } ^ { n } $ $\mathbf { y } \in \mathbb { R } ^ { m }$ (Naumann, 2011). The function $f$ can be represented as a directed acyclic computation graph representing the composition of elementary computational operations for which the respective derivatives are well known. The partial derivative $\frac { \partial y _ { j } } { \partial x _ { i } }$ can be computed through recursive applications of the chain rule, either in the forward direction (corresponding to a bottom-up traversal of the computation graph) or in the backward direction (corresponding to a top-down traversal of the computation graph). The former approach, called forward-mode or tangent-mode AD, is used in some research communities, most commonly when $m \gg n$ (Goodfellow et al., 2016). The latter approach, which includes the back-propagation algorithm (Rumelhart et al., 1986) as a special case, is called reverse-mode or adjoint-mode AD, and encompasses the techniques most commonly used for training the weights in neural networks.
|
| 89 |
+
|
| 90 |
+
In DLVM, the differentiation pass is responsible for performing reverse-mode AD. This pass is responsible for generating DLVM IR code that calculates the derivative of a differentiable function. A function is marked as being automatically differentiable via gradient declarations. A gradient declaration is a function in a module that is declared with its mathematical relation with another function in the module and no function body. The function $\mathsf { \Omega } \mathsf { \Omega } \mathsf { \Omega } \mathsf { \Omega } \mathsf { \Omega } \mathsf { \Omega } \mathsf { f o o \mathrm { - \mathsf { \Omega } \mathsf { { g r a d } } \Omega } }$ in Figure 3 is an example of such a function. Gradient declarations are configurable, e.g. specifying arguments to differentiate with respect to, keeping original outputs, and toggling seedability to accept back-propagated gradients. The differentiation pass, when applied, canonicalizes every gradient declaration in the module to a normal function definition with basic blocks and instructions. The canonicalization process first copies basic blocks and instructions from the original function to the new function body, and then applies adjoint code generation to the function. Unlike many of the existing deep learning frameworks, AD in DLVM is a source code transformation, not interpretation (operator overloading) over the same program. This makes the compiler able to perform optimizations on the gradient computation separately and enables higher order differentiation.
|
| 91 |
+
|
| 92 |
+
Given a differentiable function $f ( \mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } , \ldots , \mathbf { x } _ { n } )$ , this pass creates a new function that computes the Jacobian $\mathbf { J } _ { f }$ . This approach to AD has several advantages with respect to AD performed by operator overloading $/$ graph interpretation. Unlike operator overloading, the gradient function produced by AD is a standalone function that sits uniformly alongside other functions in an IR module, representationally unrelated to the original function. The generated function takes original inputs and produces a tuple of partial derivatives with respect to the inputs. In AD, not all values in the forward evaluation will necessarily be used to compute derivatives. In DLVM, unused operations can be easily eliminated by the aggressive dead code elimination pass in the compilation pipeline (see Section 3.1.4). In addition, an AD-specific optimization technique called checkpointing can further reduce memory consumption during gradient computation.
|
| 93 |
+
|
| 94 |
+
AD in DLVM is configurable. The front-end can choose to differentiate a function with respect to selected arguments, to keep some of the outputs of the original function, to apply differentiation to a specific output when there are multiple return values, or to enable the function to accept backpropagated gradients (seeds) through function composition, all by gradient declarations. If the function returns multiple values in a tuple, the gradient declaration can also specify which tuple element to differentiate. Our approach to AD is implemented as a transformation from one function to another function. This approach also makes higher-order differentiation possible; this can be accomplished by declaring a higher-order gradient function that differentiates the original gradient function.
|
| 95 |
+
|
| 96 |
+
# 3.1.4 GENERAL-PURPOSE OPTIMIZATIONS FOR DLVM
|
| 97 |
+
|
| 98 |
+
General-purpose optimizations refer to traditional compiler optimizations applied to DLVM IR. These optimizations are important at the DLVM stage in the compilation pipeline, since linear algebra computation can be highly optimized or eliminated before they get lowered to LLVM IR which contain parallel execution and low-level information that prevent LLVM optimizations from identifying high-level patterns. Some of these optimizations are aggressive dead code elimination, common subexpression elimination, and sparse conditional constant propagation. Applying such optimizations on gradient computation is not feasible in other approaches to AD that use graph interpretation (operator overloading), because the forward pass and the backward pass are tied together in a single graph; mutating either evaluation pass will alter the semantics of the other.
|
| 99 |
+
|
| 100 |
+
# 3.2 CODE GENERATION
|
| 101 |
+
|
| 102 |
+
Two major design goals of DLVM are the ability to target multiple heterogenous parallel architectures from the same front-end DSL code (and corresponding DLVM IR), and the ability to perform aggressive optimizations on lowered programs. In order to attain these goals, DLVM code generation transforms DLVM IR into LLVM IR. LLVM is a robust and mature compiler infrastructure with multiple back-ends, including NVIDIA GPUs. Many high-level DLVM IR linear algebra instructions over tensors abstract lower-level operations. The DLVM compiler transforms the high-level DLVM IR into lower-level stages and ultimately into calls to BLAS and compute kernels in LLVM IR. Existing LLVM utilities are used to compile the generated LLVM IR to the final binary.
|
| 103 |
+
|
| 104 |
+
In order to take full advantage of a variety of emerging heterogeneous parallel architectures, we plan for future versions of DLVM to target the IR of HPVM (Srivastava et al., 2016), a higherlevel heterogeneous compiler extension to LLVM IR that allows for transparent targeting of diverse architectures from a data flow graph.
|
| 105 |
+
|
| 106 |
+
# 3.3 DLVM COMMAND LINE TOOLCHAIN
|
| 107 |
+
|
| 108 |
+
The front-end software associated with each DSL (see Section 3.4) is responsible for generating a DLVM IR for a given source language program to be compiled. The DLVM compiler infrastructure itself is a compiler from DLVM IR to LLVM IR, therefore having a command line toolchain is necessary for verifying, transforming and compiling batches of DLVM IR files $( \star _ { } . \mathrm { d l } )$ . Unlike XLA and NNVM/TVM, which only provide a Python $/ \mathrm { C } { + + }$ interface to their users, DLVM provides a command line interface like any industry-standard compiler.
|
| 109 |
+
|
| 110 |
+
The DLVM optimizer utility, dlopt, accepts $\star$ .dl IR files and applies user-specified optimization passes on them. The DLVM compiler driver, dlc, accepts $\star$ .dl IR files and performs user-specified tasks, such as verification, differentiation, optimization passes, stage lowering passes, and code generation; the driver invokes the DLVM core library to achieve these tasks. Because of having a textual format of the IR, the DLVM framework can easily make use of the LLVM Integrated Tester (lit) and FileCheck to perform robust unit testing. In future development, we plan to introduce a DLVM bitcode format for compact storage and high-throughput processing of DLVM code.
|
| 111 |
+
|
| 112 |
+
# 3.4 NEURAL NETWORK DSLS
|
| 113 |
+
|
| 114 |
+
Most of existing deep learning DSLs are embedded in a dynamically typed scripting language such as Python and Lua. While these scripting languages provide flexibility and a large number of libraries for scientific computing, they can act as a barrier between lightweight prototyping code and systematic production code. This barrier significantly reduces the reliability of ML software, resulting in suboptimal programming experience and unnecessarily effortful development cycles.
|
| 115 |
+
|
| 116 |
+
In software engineering, a proven approach to tackle this problem is language and compiler technologies, starting from a language that is amenable to static analysis. A well-designed deep learning DSL should support the needs of deep learning software developers by providing a safe environment for rapid prototyping, while simultaneously generating highly efficient code for training and inference. DSLs in a scripting language can easily achieve rapid prototyping, but they are generally incapable of providing a safe environment with optimal performance. We believe that the best solution is DSLs embedded in a type-safe, type-inferring programming language that is both fast and easy to learn. In our initial release of DLVM, we provide one such DSL, both as a proof-of-concept and as a reference implementation that showcases the capabilities of DLVM as a platform for deep learning DSL development.
|
| 117 |
+
|
| 118 |
+
NNKit is a staged DSL embedded in Swift, featuring natural expression of tensor computation alongside the host program without losing static analyses and optimizations on the tensor program. Inspired by Lightweight Modular Staging (Rompf & Odersky, 2010), NNKit leverages the static type system of Swift to guarantee type safety of the DSL. Tensor types are wrapped in $\mathrm { R e p } { < } \mathrm { T } >$ , meaning the representation of some computation that produces data of type T. Tensor operators overloaded for Rep are essentially AST builders for delayed evaluation. Instead of generating computation nodes at runtime and performing operator-overloading AD like PyTorch or TensorFlow Eager (Google Brain Team, 2017), NNKit tensor computations are staged once during the lifetime of the host program. At invocation time of staged functions, NNKit emits shape-specialized DLVM IR and leverages DLVM to perform AD, optimizations, and low-level code generation. A sample of Swift code using NNKit is shown in Figure 4.
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 4: Example code in Swift using NNKit, a staged DSL targeting DLVM.
|
| 122 |
+
|
| 123 |
+
The NNKit just-in-time compiler has four important phases: The first phase, expression staging, produces an unshaped graph IR of the tensor computation. The second phase, shape specialization, prepares to generate statically shaped DLVM IR for staged functions when they are applied to shaped tensors. The third phase, lowering, generates DLVM IR and passes it through DLVM, producing a dynamic library containing a function symbol. The final phase, function reification, loads the binary and wraps the low-level function to a Swift function.
|
| 124 |
+
|
| 125 |
+
We anticipate other existing deep learning frameworks, such as TensorFlow, could be adapted to use DLVM as a back-end to their tensor math DSLs.
|
| 126 |
+
|
| 127 |
+
# 4 CONCLUSION
|
| 128 |
+
|
| 129 |
+
The deep learning research community has a rich variety of available frameworks. While two existing projects have attempted a compilers approach to deep learning frameworks, and have respectively achieved good integration with existing systems (TensorFlow XLA) and good performance (NNVM $+ \mathrm { T V M } )$ , their design philosophies have not entirely followed established best practices in optimizing compiler design. While well intentioned, the remaining vast majority of other frameworks have failed to observe that the problem of front-end DSLs, algorithmic differentiation, and converting a neural network into efficient executable code is, at its core, a compilers problem. As a result, important issues of extensibility and optimization have been addressed in less than optimal fashion in such frameworks. Nevertheless, several such frameworks have achieved wide adoption. We believe that the principled application of optimizing compiler techniques will lead to substantial improvements in the tools available to deep learning researchers. DLVM and its associated front-end DSLs have a major role to play in this future. Our existing implementation supports reverse-mode AD in the core language, and utilizes LLVM to target NVIDIA GPUs. In our ongoing work, we plan to substantially increase the number of supported hardware architectures by utilizing HPVM as an additional back-end, and explore more advanced AD techniques such as mixing forward and reverse modes.
|
| 130 |
+
|
| 131 |
+
# REFERENCES
|
| 132 |
+
|
| 133 |
+
Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Gregory S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian J. Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Józefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dan Mané, Rajat Monga, Sherry Moore, Derek Gordon Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul A. Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda B. Viégas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-scale machine learning on heterogeneous distributed systems. CoRR, abs/1603.04467, 2016. URL http://arxiv.org/abs/1603.04467.
|
| 134 |
+
|
| 135 |
+
Tianqi Chen, Mu Li, Yutian Li, Min Lin, Naiyan Wang, Minjie Wang, Tianjun Xiao, Bing Xu, Chiyuan Zhang, and Zheng Zhang. Mxnet: A flexible and efficient machine learning library for heterogeneous distributed systems. CoRR, abs/1512.01274, 2015. URL http://arxiv.org/ abs/1512.01274.
|
| 136 |
+
|
| 137 |
+
Tianqi Chen, Thierry Moreau, Ziheng Jiang, and Haichen Shen. TVM: An end to end IR stack for deploying deep learning workloads on hardware platforms. http://tvmlang.org/2017/ 08/17/tvm-release-announcement.html, 2017.
|
| 138 |
+
|
| 139 |
+
Ronan Collobert, Koray Kavukcuoglu, and Clément Farabet. Torch7: A Matlab-like environment for machine learning. In NIPS Big Learning Workshop: Algorithms, Systems, and Tools for Learning at Scale, December 2011.
|
| 140 |
+
|
| 141 |
+
Amol Ghoting, Rajasekar Krishnamurthy, Edwin Pednault, Berthold Reinwald, Vikas Sindhwani, Shirish Tatikonda, Yuanyuan Tian, and Shivakumar Vaithyanathan. Systemml: Declarative machine learning on MapReduce. In Proceedings of the 2011 IEEE 27th International Conference on Data Engineering, ICDE ’11, pp. 231–242, Washington, DC, USA, 2011. IEEE Computer Society. ISBN 978-1-4244-8959-6. doi: 10.1109/ICDE.2011.5767930. URL http://dx.doi.org/ 10.1109/ICDE.2011.5767930.
|
| 142 |
+
|
| 143 |
+
Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep Learning. MIT Press, 2016. http: //www.deeplearningbook.org.
|
| 144 |
+
|
| 145 |
+
Google Brain Team. Eager Execution: An imperative, define-by-run interface to TensorFlow. 2017. URL https://research.googleblog.com/2017/10/ eager-execution-imperative-define-by.html.
|
| 146 |
+
|
| 147 |
+
Joe Groff and Chris Lattner. Swift’s High-Level IR: A Case Study of Complementing LLVM IR with Language-Specific Optimization. 2015 LLVM Developers’ Meeting, 2015. URL http: //llvm.org/devmtg/2015-10/slides/GroffLattner-SILHighLevelIR.pdf.
|
| 148 |
+
|
| 149 |
+
Norman P. Jouppi, Cliff Young, Nishant Patil, David Patterson, Gaurav Agrawal, Raminder Bajwa, Sarah Bates, Suresh Bhatia, Nan Boden, Al Borchers, Rick Boyle, Pierre-luc Cantin, Clifford Chao, Chris Clark, Jeremy Coriell, Mike Daley, Matt Dau, Jeffrey Dean, Ben Gelb, Tara Vazir Ghaemmaghami, Rajendra Gottipati, William Gulland, Robert Hagmann, Richard C. Ho, Doug Hogberg, John Hu, Robert Hundt, Dan Hurt, Julian Ibarz, Aaron Jaffey, Alek Jaworski, Alexander Kaplan, Harshit Khaitan, Andy Koch, Naveen Kumar, Steve Lacy, James Laudon, James Law, Diemthu Le, Chris Leary, Zhuyuan Liu, Kyle Lucke, Alan Lundin, Gordon MacKean, Adriana Maggiore, Maire Mahony, Kieran Miller, Rahul Nagarajan, Ravi Narayanaswami, Ray Ni, Kathy Nix, Thomas Norrie, Mark Omernick, Narayana Penukonda, Andy Phelps, Jonathan Ross, Amir Salek, Emad Samadiani, Chris Severn, Gregory Sizikov, Matthew Snelham, Jed Souter, Dan Steinberg, Andy Swing, Mercedes Tan, Gregory Thorson, Bo Tian, Horia Toma, Erick Tuttle, Vijay Vasudevan, Richard Walter, Walter Wang, Eric Wilcox, and Doe Hyun Yoon. In-datacenter performance analysis of a tensor processing unit. CoRR, abs/1704.04760, 2017. URL http: //arxiv.org/abs/1704.04760.
|
| 150 |
+
|
| 151 |
+
Fredrik Kjolstad, Shoaib Kamil, Stephen Chou, David Lugato, and Saman Amarasinghe. The tensor algebra compiler. Proc. ACM Program. Lang., 1(OOPSLA):77:1–77:29, October 2017. ISSN 2475-1421. doi: 10.1145/3133901. URL http://doi.acm.org/10.1145/3133901.
|
| 152 |
+
|
| 153 |
+
Chris Lattner and Vikram Adve. LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation. In Proceedings of the 2004 International Symposium on Code Generation and Optimization (CGO’04), Palo Alto, California, Mar 2004.
|
| 154 |
+
|
| 155 |
+
Chris Leary and Todd Wang. XLA: TensorFlow, compiled! TensorFlow Dev Summit 2017, February 2017.
|
| 156 |
+
|
| 157 |
+
Uwe Naumann. The Art of Differentiating Computer Programs. Society for Industrial and Applied Mathematics, 2011. doi: 10.1137/1.9781611972078. URL http://epubs.siam.org/doi/ abs/10.1137/1.9781611972078.
|
| 158 |
+
|
| 159 |
+
NNVM. NNVM compiler: Open compiler for AI frameworks. http://tvmlang.org/2017/ 10/06/nnvm-compiler-announcement.html, 2017.
|
| 160 |
+
|
| 161 |
+
PyTorch Development Team. Tensors and Dynamic neural networks in Python with strong GPU acceleration. 2016. URL http://pytorch.org.
|
| 162 |
+
|
| 163 |
+
Jonathan Ragan-Kelley, Connelly Barnes, Andrew Adams, Sylvain Paris, Frédo Durand, and Saman Amarasinghe. Halide: A language and compiler for optimizing parallelism, locality, and recomputation in image processing pipelines. In Proceedings of the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’13, pp. 519–530, New York, NY, USA, 2013. ACM. ISBN 978-1-4503-2014-6. doi: 10.1145/2491956.2462176. URL http://doi.acm.org/10.1145/2491956.2462176.
|
| 164 |
+
|
| 165 |
+
Tiark Rompf and Martin Odersky. Lightweight modular staging: A pragmatic approach to runtime code generation and compiled dsls. In Proceedings of the Ninth International Conference on Generative Programming and Component Engineering, GPCE ’10, pp. 127–136, New York, NY, USA, 2010. ACM. ISBN 978-1-4503-0154-1. doi: 10.1145/1868294.1868314. URL http://doi.acm.org/10.1145/1868294.1868314.
|
| 166 |
+
|
| 167 |
+
David E. Rumelhart, James L. McClelland, and CORPORATE PDP Research Group (eds.). Parallel Distributed Processing: Explorations in the Microstructure of Cognition, Vol. 1: Foundations. MIT Press, Cambridge, MA, USA, 1986. ISBN 0-262-68053-X.
|
| 168 |
+
|
| 169 |
+
Prakalp Srivastava, Maria Kotsifakou, and Vikram S. Adve. HPVM: A portable virtual instruction set for heterogeneous parallel systems. CoRR, abs/1611.00860, 2016. URL http://arxiv.org/ abs/1611.00860.
|
md/train/ryenvpEKDr/ryenvpEKDr.md
ADDED
|
@@ -0,0 +1,464 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# A CONSTRUCTIVE PREDICTION OF THEGENERALIZATION ERROR ACROSS SCALES
|
| 2 |
+
|
| 3 |
+
Jonathan S. Rosenfeld1 Amir Rosenfeld2 Yonatan Belinkov13 Nir Shavit145 {jonsr,belinkov,shanir}@csail.mit.edu amir@cse.yorku.ca
|
| 4 |
+
|
| 5 |
+
1 Massachusetts Institute of Technology 2 York University 3 Harvard University
|
| 6 |
+
4 Neural Magic Inc 5 Tel Aviv University
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
The dependency of the generalization error of neural networks on model and dataset size is of critical importance both in practice and for understanding the theory of neural networks. Nevertheless, the functional form of this dependency remains elusive. In this work, we present a functional form which approximates well the generalization error in practice. Capitalizing on the successful concept of model scaling (e.g., width, depth), we are able to simultaneously construct such a form and specify the exact models which can attain it across model/data scales. Our construction follows insights obtained from observations conducted over a range of model/data scales, in various model types and datasets, in vision and language tasks. We show that the form both fits the observations well across scales, and provides accurate predictions from small- to large-scale models and data.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
With the success and heightened adoption of neural networks for real world tasks, some questions remain poorly answered. For a given task and model architecture, how much data would one require to reach a prescribed performance level? How big a model would be needed?
|
| 15 |
+
|
| 16 |
+
Addressing such questions is made especially difficult by the mounting evidence that large, deep neural networks trained on large-scale data outperform their smaller counterparts, rendering the training of high performance models prohibitively costly. Indeed, in the absence of practical answers to the above questions, surrogate approaches have proven useful. One such common approach is model scaling, where one designs and compares small-scale models, and applies the obtained architectural principles at a larger scale (e.g., Liu et al., 2018; Real et al., 2018; Zoph et al., 2018). Despite these heuristics being widely used to various degrees of success, the relation between the performance of a model in the small- and large-scale settings is not well understood. Hence, exploring the limitations or improving the efficiency of such methods remains subject to trial and error.
|
| 17 |
+
|
| 18 |
+
In this work we circle back to the fundamental question: what is the (functional) relation between generalization error and model and dataset sizes? Critically, we capitalize on the concept of model scaling in its strictest form: we consider the case where there is some given scaling policy that completely defines how to scale up a model from small to large scales. We include in this context all model parameters, such that traversing from one scale (in which all parameters are known) to another requires no additional resources for specifying the model (e.g., architecture search/design).
|
| 19 |
+
|
| 20 |
+
We empirically explore the behavior of the generalization error over a wide range of datasets and models in vision and language tasks. While the error landscape seems fairly complex at first glance, we observe the emergence of several key characteristics shared across benchmarks and domains. Chief among these characteristics is the emergence of regions where power-law behavior approximates the error well both with respect to data size, when holding model size fixed, and vice versa.
|
| 21 |
+
|
| 22 |
+
Motivated by these observations, we establish criteria which a function approximating the error landscape should meet. We propose an intuitive candidate for such a function and evaluate its quality, both in explaining the observed error landscapes and in extrapolating from small scale (seen) to large scale (unseen) errors. Critically, our functional approximation of the error depends on both model and data sizes. We find that this function leads to a high quality fit and extrapolation. For instance, the mean and standard deviation of the relative errors are under $2 \%$ when fitting across all scales investigated and under $5 \%$ when extrapolating from a slimmed-down model (1/16 of the parameters) on a fraction of the training data (1/8 of the examples) on the ImageNet (Russakovsky et al., 2015) and WikiText-103 (Merity et al., 2016) datasets, with similar results for other datasets.
|
| 23 |
+
|
| 24 |
+
To the best of our knowledge, this is the first work that provides simultaneously:
|
| 25 |
+
|
| 26 |
+
• A joint functional form of the generalization error landscape—as dependent on both data and model size—with few, interpretable degrees of freedom (section 5). Direct and complete specification (via the scaling policy) of the model configuration attaining said generalization error across model and dataset sizes. Highly accurate approximation of error measurements across model and data scales via the functional form, evaluated on different models, datasets, and tasks (section 6 ). • Highly accurate error prediction from small to large model and data (section 7).
|
| 27 |
+
|
| 28 |
+
We conclude with a discussion of some implications of our findings as a practical and principled tool for understanding network design at small scale and for efficient computation and trade-off design in general. We hope this work also provides a useful empirical leg to stand on and an invitation to search for a theory of generalization error which accounts for our findings.
|
| 29 |
+
|
| 30 |
+
# 2 RELATED WORK
|
| 31 |
+
|
| 32 |
+
Model scaling: A number of studies have explored the effect of model scaling on performance. For instance, image classification networks can be scaled by depth (number of layers; He et al., 2016) or width (number of channels; Zagoruyko & Komodakis, 2016; Howard et al., 2017). More recently, Tan & Le (2019) demonstrated how scaling width, depth, and input resolution has combined positive effects larger than scaling each factor in isolation. However, this relationship has yet to be quantified in a predictive form – by how much will error change with model scaling? In this work, we focus on finding a constructive functional form for determining the model given a specified performance.
|
| 33 |
+
|
| 34 |
+
Data scaling: It has long been recognized that more data improves performance, and various studies report such trends in both computer vision (e.g., Zhu et al., 2012; Sun et al., 2017) and language processing tasks (e.g., Banko & Brill, 2001; Talmor & Berant, 2019). A number of prior studies observed power-law relations between the generalization error and training data size (Cho et al., 2015; Miceli Barone et al., 2017; Johnson et al., 2018). Most relevant to our work, Hestness et al. (2017) explored the effect of data size on the generalization error in vision, language, and speech tasks, and observed a strikingly consistent power-law behavior in a large set of experiments. However, while these studies point to the empirical existence of a power law in terms of data, they do not offer tools for predicting the performance given a specified model. Nor do they offer low-cost methods to specify the model configuration which would attain the power law with data dependency. Indeed, Hestness et al. had to search over models and their configurations at large scale to exhibit their findings, incurring prohibitive computational costs.
|
| 35 |
+
|
| 36 |
+
In contrast, we demonstrate a constructive recipe, where we directly predict the test performance at large scale and specify the full model configuration which attains it (with no need for large-scale search), given performance at small scale.
|
| 37 |
+
|
| 38 |
+
Predicting model performance: Since training models at full data/model scale may be computationally prohibitive, a line of work tries to predict the performance of a given model on a given dataset, without training the model, for example by using a bank of previously trained models, dataset, and their associated performances (Istrate et al., 2019). Others have proposed to estimate performance on small data (Klein et al., 2017) or model sizes (Zoph et al., 2018; Real et al., 2019) in the context of neural architecture search (NAS). In this case, the small-scale evaluation is used to compare models at small cost, to expedite the search process; see Elsken et al. (2019) for a recent survey. Our work complements previous approaches by demonstrating a functional form that can predict large-scale performance from small-scale measurements. Moreover, our method may be integrated in NAS, addressing some of its current limitations (as discussed in section 8).
|
| 39 |
+
|
| 40 |
+
Table 1: The datasets and models used in this work, along with their original training data size and the range of explored scales. For more information, see appendix A.
|
| 41 |
+
(a) Training data size (number of words) and model size (number of parameters excluding word embeddings) for language modeling tasks.
|
| 42 |
+
|
| 43 |
+
<table><tr><td>Dataset</td><td>Size (N)</td><td>Scales (n)</td><td>Base Model</td><td>Size (M)</td><td>Scales (m)</td></tr><tr><td>PTB WikiText-2</td><td>0.9M 2M</td><td>2-kN,</td><td>AWD-LSTM AWD-LSTM</td><td>20M 20M</td><td>4-kM,</td></tr><tr><td>WikiText-103</td><td>100M</td><td>0≤k≤5</td><td>Transformer-XL</td><td>41M</td><td>0≤k≤6</td></tr><tr><td colspan="6">(b)Training data size (number of images)and model size (number of parameters)for image classification tasks.</td></tr><tr><td>Dataset</td><td>Size (N)</td><td>Scales (n)</td><td>Base Model</td><td>Size (M)</td><td>Scales (m)</td></tr><tr><td>ImageNet</td><td>1.2M</td><td>2-kN,0≤k≤6</td><td>ResNet-50</td><td>25.5M</td><td>4-M,0≤k≤6</td></tr><tr><td>CIFAR10</td><td>60K</td><td>2-kN,</td><td>WRN-44-16</td><td>0.7M</td><td>4-𝑘M,-3≤k≤4</td></tr><tr><td>CIFAR100</td><td>60K</td><td></td><td>WRN-44-16</td><td>0.7M</td><td>4-kM,</td></tr><tr><td>DTD</td><td>5640</td><td>0≤k≤5</td><td>WRN-44-16</td><td>0.7M</td><td></td></tr><tr><td>Aircraft</td><td>10K</td><td></td><td>WRN-44-16</td><td>0.7M</td><td>-2≤k≤4</td></tr><tr><td>UCF101</td><td>13K</td><td></td><td>WRN-44-16</td><td>0.7M</td><td></td></tr></table>
|
| 44 |
+
|
| 45 |
+
Theoretical error bounds: Much attention has been given to theoretical explanations of the generalization capabilities of deep neural networks (Neyshabur et al., 2017a;b; Allen-Zhu et al., 2018a;b; Arora et al., 2018). While fully engaging with this literature is beyond our scope, we note that recent studies have derived bounds involving power-law dependencies in both model (Yarotsky, 2018) and data size (Liang et al., 2019). We leave it as an open question for future work to find theoretical explanations for the empirical behavior and the functional form we investigate in this work.
|
| 46 |
+
|
| 47 |
+
# 3 EXPERIMENTAL SETUP
|
| 48 |
+
|
| 49 |
+
Notation: Let $\mathbb { D } _ { n } = \{ \pmb { x } _ { i } , y _ { i } \} _ { i = 1 } ^ { n }$ denote a labeled (training) dataset with $n$ samples or datapoints. Let $f _ { m }$ denote a neural network whose size is the number of parameters $m$ , such that $\hat { y } = f _ { m } ( \pmb { x } )$ is the predicted label. Let $\epsilon \left( n , m \right)$ be the generalization error as a function of $n$ and $m$ , measured by a performance metric (e.g., top-1 accuracy or cross-entropy loss) on a held-out test set. We refer to this error function as the error landscape.
|
| 50 |
+
|
| 51 |
+
# 3.1 SCALING POLICIES
|
| 52 |
+
|
| 53 |
+
Dataset scaling: We wish to scale datasets while preserving the original distribution. For image classification, we uniformly subsample all classes by a constant ratio, thus preserving the relative sample size per class. We limit the maximal sub-sampling to avoid eradicating any class. For language modeling, where the number of classes (vocabulary items) has a very long tail distribution, we randomly sample sentences such that the total number of sampled words will be a certain fraction of the original dataset. Table 1 reports the data scales we use. In all tasks the held-out test set remains untouched for evaluating the error.
|
| 54 |
+
|
| 55 |
+
Model scaling: We are critically interested in a method where moving across scales is defined by some scaling function, such that no additional significant computation would be incurred. We thus consider the case where the model architecture is given and the model size determines how to scale it. For instance, one may scale width (number of channels in convolutional networks, hidden state size in recurrent networks), depth (number of layers), do compound scaling (Tan & Le, 2019), or more generally define a function tying the model degrees of freedom and size. We focus primarily on width scaling in our experiments; the model scales are reported in Table 1. We also perform selected depth scaling to demonstrate flexibility with respect to the scaling method.
|
| 56 |
+
|
| 57 |
+

|
| 58 |
+
Figure 1: Error landscapes in log-log-log scale. Each point (blue dot) is the error resulting from training with a model/data configuration $m , n$ . The surface is a linear interpolation between the points, which is then projected on the $( m , \epsilon )$ , $( n , \epsilon )$ and $( m , n )$ planes. See Appendix C for details.
|
| 59 |
+
|
| 60 |
+

|
| 61 |
+
Figure 2: Error vs. data size (left part of each subfigure) and model size (right part) for Wiki103 and CIFAR10. Solid dots are measurements, dashed lines are best fit to saturating power-law.
|
| 62 |
+
|
| 63 |
+
Hyper-parameters: For similar reasons we wish to avoid hyper-paramater search at large scales, and thus avoid the temptation to tune hyper-parameters accordingly (learning rate, regularization, etc.). Therefore, we hold all hyper-parameters fixed. This enables us to construct a functional form that fits the error landscape and can be used to predict the error across scales while completely defining the model attaining it. We consider pros and cons of this approach in the discussion (section 8).
|
| 64 |
+
|
| 65 |
+
# 3.2 TASKS, MODELS, OPTIMIZERS AND DATASETS
|
| 66 |
+
|
| 67 |
+
We experiment with both vision and language tasks. We use 6 benchmark datasets for image classification and 3 for language modeling. For image classification, we train ResNet (He et al., 2016) and WRN models (Zagoruyko & Komodakis, 2016) with stochastic gradient decent (SGD). In section 6.2 we explore the effect of varying architectures and optimizers for a fixed task (CIFAR100), adding VGG16 (Simonyan & Zisserman, 2014) and DenseNet (Huang et al., 2017) models trained with both Adam (Kingma & Ba, 2015) and SGD. For language modeling, we train AWD-LSTM (Merity et al., 2018) and Transformer-XL models (Dai et al., 2019) with SGD and Adam optimizers respectively. Summary statistics are shown in Table 1, along with the range of explored scales. Appendix A gives additional information.
|
| 68 |
+
|
| 69 |
+
# 4 OBSERVATIONS ON THE ERROR LANDSCAPE
|
| 70 |
+
|
| 71 |
+
Figures 1a and 1b respectively show an example test error landscape for width scaling of Transformer-XL on WikiText-103 and WRN-44-16 on CIFAR10. Various additional such landscapes are found in appendix C, showing largely consistent patterns. Examining the error landscapes yields the following observations:
|
| 72 |
+
|
| 73 |
+
# O1 Model Scaling
|
| 74 |
+
|
| 75 |
+
O1.1 For a given dataset size, scaling up the model results in an initial decrease in test error, which then saturates to a level determined by the dataset size.1 This behavior has been noted by Tan & Le (2019) across varied model scaling methods, although they have not engaged with the dependency on dataset size.
|
| 76 |
+
|
| 77 |
+
O1.2 The rate of error decrease with model size appears well approximated by a power-law.
|
| 78 |
+
|
| 79 |
+
These two observations together can be summarized as the following relation:
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\epsilon ( m , n ) \approx b ( n ) m ^ { - \beta ( n ) } + c _ { m } ( n )
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
where $b , \beta , c _ { m }$ may depend on the data size $n$ , s.t. as $m$ grows, $\epsilon \to c _ { m }$ . Example fits to this form (allowing $b , \beta , c _ { m }$ to be fit per $n$ ) are seen in figure 2a (right) and figure 2b (right).
|
| 86 |
+
|
| 87 |
+
# O2 Data scaling
|
| 88 |
+
|
| 89 |
+
O2.1 For a given model size, scaling up the dataset results in an initial increase in performance, which then saturates to a level determined by the model size.
|
| 90 |
+
|
| 91 |
+
O2.2 The rate of error decrease with dataset size appears well approximated by a power-law. Hestness et al. (2017) also noted a similar relationship, but did not functionally tie the saturation level to the dataset size.
|
| 92 |
+
|
| 93 |
+
These two observations together can be summarized as the following relation:
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\epsilon ( m , n ) \approx a ( m ) n ^ { - \alpha ( m ) } + c _ { n } ( m )
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
where $a , \alpha , c _ { n }$ may depend on the model size $m$ , s.t. as $n$ grows, $\epsilon \to c _ { n }$ . Example fits to this form (allowing $a , \alpha , c _ { n }$ to be fit per $m$ ) are seen in figure 2a (left) and figure 2b (left).
|
| 100 |
+
|
| 101 |
+
O3 Joint properties The behavior of the error when scaling model size while holding data size fixed, and vice versa, extends to the entire error landscape in a well-behaved manner, such that the manifold $\epsilon ( m , n )$ is smooth everywhere as a function of both model and data scales.
|
| 102 |
+
|
| 103 |
+
# 5 FUNCTIONAL APPROXIMATION OF THE GENERALIZATION ERROR
|
| 104 |
+
|
| 105 |
+
# 5.1 CRITERIA
|
| 106 |
+
|
| 107 |
+
Motivated by the above observations, we now consider a functional approximation for the error landscape. In particular, let us consider function families meeting the following criteria which augment and restrict our observations:
|
| 108 |
+
|
| 109 |
+
C1 As either model or dataset size goes to zero, the expected performance is equivalent to a random-guess error level $\epsilon _ { 0 }$ .2
|
| 110 |
+
C2 For a given dataset size, scaling up the model will result in an initial increase in performance, which will then saturate, taking the form in equation 1.
|
| 111 |
+
C3 For a given model size, scaling up the dataset will result in an initial increase in performance, which will then saturate, taking the form in equation 2.
|
| 112 |
+
C4 There exists an irreducible error $\epsilon _ { \infty }$ , intrinsic to the dataset.
|
| 113 |
+
C5 The function must be smooth everywhere and monotonic non-increasing in terms of model and data size (observation O3).
|
| 114 |
+
|
| 115 |
+
While there are many possible function families meeting the above criteria, below we propose a simple function family for our evaluation. We do not claim that this is in fact the true underlying dependency, but rather that it serves as a good approximation of the error landscape—consistent with these criteria.
|
| 116 |
+
|
| 117 |
+
# 5.2 PROPOSED FUNCTION FAMILY
|
| 118 |
+
|
| 119 |
+
As a first insightful step, consider the implications of satisfying C2 and C3 simultaneously. By examining the limiting behavior as $m$ or $n$ grow, we have:
|
| 120 |
+
|
| 121 |
+
As m grows large: $\begin{array} { l } { { c _ { m } ( n ) \approx a ( m ) n ^ { - \alpha ( m ) } + c _ { n } ( m ) } } \\ { { c _ { n } ( m ) \approx b ( n ) m ^ { - \beta ( n ) } + c _ { m } ( n ) } } \end{array}$ As n grows large:
|
| 122 |
+
|
| 123 |
+
Thus, a consistent form satisfying C2 and C3 simultaneously is:
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\epsilon ( m , n ) \approx a ( m ) n ^ { - \alpha ( m ) } + b ( n ) m ^ { - \beta ( n ) } + c _ { \infty }
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
where $c _ { \infty }$ is a constant not dependent on either $m$ or $n$ .
|
| 130 |
+
|
| 131 |
+
Let us now examine the simplified case where $a , b , \alpha , \beta$ are constant:
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
\tilde { \epsilon } ( m , n ) = a n ^ { - \alpha } + b m ^ { - \beta } + c _ { \infty }
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
where $\alpha \geq 0$ and $\beta \geq 0$ control the global rate at which error decreases with data and model size, respectively, $a > 0$ and $b > 0$ are a form of unit conversion between data and model sizes and error, and $c _ { \infty } > 0$ is the asymptotic lower value attainable. This function is a special case of equation 3 and meets criteria C2 and C3 by construction. Importantly C4 and C5 are also met.
|
| 138 |
+
|
| 139 |
+
However, by giving up the dependence of $a , b , \alpha , \beta$ on $m , n$ , this function does not meet criterion C1. We thus need to model the transition from the initial random-guess level to the power-law region. We propose to parameterize the transition using the following envelope (complex) function:
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
\hat { \epsilon } ( m , n ) = \epsilon _ { 0 } \left\| \frac { \tilde { \epsilon } ( m , n ) } { \tilde { \epsilon } ( m , n ) - i \eta } \right\| = \epsilon _ { 0 } \left\| \frac { a n ^ { - \alpha } + b m ^ { - \beta } + c _ { \infty } } { a n ^ { - \alpha } + b m ^ { - \beta } + c _ { \infty } - i \eta } \right\|
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
where $i = \sqrt { - 1 }$ . Here the simple pole at $\eta$ controls the transition point from the initial random-guess level $\epsilon _ { \mathrm { 0 } }$ as $( m , n )$ increase. As $( m , n )$ grow, $\tilde { \epsilon } \to c _ { \infty }$ and the final irreducible error $\epsilon _ { \infty } \triangleq \epsilon _ { 0 } c _ { \infty } \eta ^ { - 1 }$ is approached. The random-guess error, $\epsilon _ { \mathrm { 0 } }$ , is a known parameter determined by dataset statistics (e.g, $\dot { ( } N _ { c l a s s e s } - 1 ) / N _ { c l a s s e s }$ for a balanced dataset). Note that due to our choice of rational envelope, we can divide by a constant the form in equation 4. Without loss of generality, let us choose $a = 1$ .
|
| 146 |
+
|
| 147 |
+
Note that while the forms in equations 3 and 4 are well motivated, the approach taken for modeling the transition is solely a convenience one. In fact, the transition(s) as function of $m$ and $n$ may be captured in the functional forms of $a , b , \alpha , \beta$ or another envelope mechanism. We leave a more refined investigation of the nature of the transitions to future work.
|
| 148 |
+
|
| 149 |
+
# 6 ERROR LANDSCAPE ESTIMATION
|
| 150 |
+
|
| 151 |
+
We wish to empirically estimate the quality of the proposed functional parameterization as a fit to the true error landscape. Let $\hat { \epsilon } ( n , m ; \pmb { \theta } )$ be the parametric function family (equation 5) approximating the error landscape $\epsilon \left( n , m \right)$ , where $\pmb { \theta } = \{ \alpha , \beta , b , c _ { \infty } , \eta \}$ .3 Define the divergence $\delta ( n , m ; \pmb \theta )$ as the relative difference between the estimated error $\hat { \epsilon } ( m , n ; \pmb \theta )$ and the true error $\epsilon ( m , n )$ :
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
\delta ( n , m ; \pmb { \theta } ) \triangleq \frac { \hat { \epsilon } ( m , n ; \pmb { \theta } ) - \epsilon ( m , n ) } { \epsilon ( m , n ) }
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
We fit a least squares regression model to find the best parameters minimizing the divergence. In this section, we fit the function using 10-fold cross-validation across all model/data configurations $m , n$ (see Table 1) and evaluate the fit quality. (In the next section, we perform extrapolation experiments, from seen to unseen points.) We perform the fit separately for each dataset and evaluate its quality by the mean $\mu$ and standard deviation $\sigma$ of the divergence $\delta$ over all points $( m , n )$ . See Appendix B.1 for experimental details.
|
| 158 |
+
|
| 159 |
+
As figure 3 shows, estimated test accuracy is highly correlated with actual test accuracy for various datasets, with worst-case values $\mu < 1 \%$ and $\sigma < 5 \%$ . Note that the number of free parameters is small $( | \pmb { \theta } | \leq 6 )$ compared to the number of points (42–49 model-data configurations), demonstrating the appropriateness of the proposed function for modeling the complex error landscape.
|
| 160 |
+
|
| 161 |
+

|
| 162 |
+
Figure 3: Error estimation results, using 10-fold cross-validation on all configurations in each dataset. For reference, in blue is the identity line. The legend shows mean $\mu$ and standard deviation $\sigma$ of the divergence $\delta$ $\pm$ one std). See Appendix C for the actual and estimated landscapes in each dataset.
|
| 163 |
+
|
| 164 |
+

|
| 165 |
+
(b) Estimated vs. actual test error for various image classification datasets.
|
| 166 |
+
|
| 167 |
+

|
| 168 |
+
Figure 4: Error landscape estimation results on CIFAR10 for width and depth scaling, showing small and comparable fit errors in both cases. Numbers in legends denote mean/variance of the estimation divergence.
|
| 169 |
+
|
| 170 |
+
# 6.1 A PROBE INTO DEPTH SCALING
|
| 171 |
+
|
| 172 |
+
Here we verify that our results extend to another canonical scaling policy, namely depth scaling. Figure 4a shows the error landscape with depth scaling on CIFAR10, exhibiting the same characteristics as width scaling. Figures 4b and 4c show error landscape estimation results for both cases of width and depth scaling, exhibiting small and comparable fit errors (confidence intervals $< 3 \%$ ).
|
| 173 |
+
|
| 174 |
+
Since the difference in approximation quality is effectively indistinguishable when scaling depth or width orthogonally, we expect compound scaling to adhere to the same functional form. Indeed, we verified this on the publicly available (model scaling only) results for EfficientNet (Tan & Le, 2019).
|
| 175 |
+
|
| 176 |
+
# 6.2 ON THE VARIETY OF OPTIMIZERS AND ARCHITECTURES
|
| 177 |
+
|
| 178 |
+
Our study covers a deliberate variety of architectures (ResNet, WRN, LSTM, Transformer) and optimizers (Adam, SGD variants), following standard implementations in the literature as recommended for each dataset/model setting; see Appendix A.
|
| 179 |
+
|
| 180 |
+

|
| 181 |
+
Figure 6: Extrapolation results. (a) Illustration of the extrapolation setup, where we fit on a subset of the points (in green) and predict on larger points (in red). (b) and (c) show example results on one configuration in two benchmark datasets. Comprehensive results are given in Appendix D.
|
| 182 |
+
|
| 183 |
+
However, the model/optimizer settings differ in multiple aspects across the different tasks , rendering the comparison of, say, different optimizers, challenging. In this section we verify that the functional form holds when varying the optimizer and/or the architecture on the same task, namely image classification on CIFAR100.
|
| 184 |
+
|
| 185 |
+
In addition to the previously examined setting of WRN with SGD, we add four more settings: two well known architectures (VGG and DenseNet), each trained with both SGD and Adam optimizers. See Appendix A for experimental details. Figure 5 exhibits consistent, accurate, fit values across all architecture/optimizer settings, with mean divergence of $\mu < 1 \%$ (std: $\sigma ~ < ~ 6 \%$ ; confidence intervals $< 4 \%$ ).
|
| 186 |
+
|
| 187 |
+

|
| 188 |
+
Figure 5: CIFAR100 Error estimation results with three architectures (WRN, VGG, DenseNet) and two optimizers (SGD, Adam).
|
| 189 |
+
|
| 190 |
+
# 7 EXTRAPOLATION
|
| 191 |
+
|
| 192 |
+
In this section, we evaluate the ability of our functional approximation to extrapolate beyond seen model/data configurations. The primary question we ask is: can we predict the error of a large model/data configuration from the errors of smaller-scale model/data configurations? To do this, we fit the least squares regression on a subset of the configurations and predict the error on larger, unseen configurations. More formally, let $( m _ { i } , n _ { j } )$ denote a given model/data configuration. We first estimate parameters $\theta _ { i j }$ by fitting the function in equation 5 on all points of at most that size $( m \leq$ $m _ { i } , n \le n _ { j } )$ ). Then we predict the error $\epsilon ( m , n )$ in all points corresponding to larger configurations $( m > m _ { i } , n > n _ { j } )$ using estimated $\theta _ { i j }$ . Finally, we measure the divergence $\delta ( \bar { m } , n )$ between the estimated error and the actual error at all larger configurations. This process is illustrated in figure 6a.
|
| 193 |
+
|
| 194 |
+
Figure 6b shows the results of one such extrapolation experiment, on ImageNet. In this case, we have fit the functional form on all configurations of model size $m \le m _ { i } = M / 1 6$ and data size $n \le n _ { j } = N / 8$ , and predicted the error on all larger configurations. As the figure shows, the extrapolation is highly accurate, with a mean divergence of $\mu \stackrel { - } { = } 4 . 5 \%$ (std: $\sigma = 4 . 7 \%$ ). Figure 6c reports a similar experiment on WikiText-103. Here, again, we see very good extrapolation, with a mean divergence of $\mu = 0 . 5 \%$ (std: $\sigma = 1 . 7 \%$ ). Note that each extrapolation is run 10 times with different random initializations of $\theta _ { i j }$ in the least squares with negligible effect on the prediction.
|
| 195 |
+
|
| 196 |
+
In practice, we may be interested in extrapolation quality with different subsets of configurations. Appendix D provides detailed extrapolation results on multiple subsets of configurations, for both vision and language datasets. Generally, the extrapolation performs well once not ill-posed, which may be caused by lack of signal in the region of the initial “random-guess” level, or in degenerate cases like having fewer measurements than the number of free parameters in $\pmb \theta$ .
|
| 197 |
+
|
| 198 |
+
# 8 DISCUSSION AND CONCLUSION
|
| 199 |
+
|
| 200 |
+
In this work, through insights gained by the joint examination of the dependencies of generalization error on both model and data size, we arrive at criteria for functions consistent with the form of the generalization error under a given scaling policy. We consider one such function and find it to be in very good agreement with the actual behavior of the error landscape. Indeed, the agreement is strong enough that extrapolation from small to large scale becomes feasible: the function predicts the behavior of the generalization error in practice for the practical case of scaling models and data. We discuss several example implications of knowing such a functional form.
|
| 201 |
+
|
| 202 |
+
Small-scale network development: At the core of small fidelity searches is the notion of performance rank comparison between models. However, small scale and large scale ranks are not assured to be consistent. If indeed a functional form such as empirically found in this work holds very generally, then in contrast, one can safely assess scaling rank between models at small scale, with the assurance that it remains consistent. This suggests that one would be well served by searching over scaling policies; a pertinent example of such a success is Tan & Le (2019). The functional form also explains the limitation of small-scale search: once reaching the random-guess error level, where the sensitivity to scaling vanishes, the informativeness of ranking diminishes. Finally, the functional form allows direct usage of differentiable methods for NAS.
|
| 203 |
+
|
| 204 |
+
Principled design: Knowing the error landscape function facilitates reasoning about the choice of $( m , n )$ attaining a specified error level. In other words, for any given error level, one can solve Eq. 5 for $m , n$ based on small-scale measurements. Thus, one can quantitatively answer design questions regarding the expected (in particular, large-scale) relations between $m , n$ , and $\epsilon$ . In fact, Eq. 5 provides direct ansewrs to questions such as ”how much data would one require to reach a prescribed performance level?” or ”how big a model would be needed?” Imposing constraints is also straightforward. For instance, consider the following question: ”What is the maximal model size possibly needed (useful), when the data is limited in size, $n = n _ { l i m }$ (for a given model architecture and scaling policy)?” For a fixed dataset size, model scaling eventually contributes marginally to error reduction and becomes negligible when $b m ^ { - \beta } \ll n _ { l i m } ^ { - \alpha }$ (Eq. 5). Define the relative contribution threshold $T$ as satisfying $\begin{array} { r } { T = \frac { n _ { l i m } ^ { - \alpha } } { b m _ { m a x } ^ { - \beta } } } \end{array}$ . (For example, $T = 1 0 .$ .) Then the maximal useful model size meeting threshold $T$ is:
|
| 205 |
+
|
| 206 |
+
$$
|
| 207 |
+
m _ { m a x } ( T ) = \left( b T \right) ^ { 1 / \beta } n _ { l i m } ^ { \alpha / \beta }
|
| 208 |
+
$$
|
| 209 |
+
|
| 210 |
+
Similarly, The maximal useful amount of data for a limited sized model $\boldsymbol { m } _ { l i m }$ is:
|
| 211 |
+
|
| 212 |
+
$$
|
| 213 |
+
n _ { m a x } ( T ) = \left( 1 / b T \right) ^ { 1 / \alpha } m _ { l i m } ^ { \beta / \alpha }
|
| 214 |
+
$$
|
| 215 |
+
|
| 216 |
+
Moreover, Eq. 5 allows for complex design trade-offs. Generally, given some design-tradeoff cost function $C ( m , n , \epsilon )$ , one can minimize such cost s.t. Eq. 5. For example, consider the case of optimizing for efficient computation which has both practical and environmental importance (Schwartz et al., 2019). Since the number of FLOPs during training is $\propto m \cdot n$ (for constant epoch budget), the trade-off cost function may be formulated as $C ( \mathrm { F L O P S } , \epsilon ) = C ( m n , \epsilon )$ . Further, since constant error contour is very well approximated by c = 1nα $\begin{array} { r } { c = \frac { 1 } { n ^ { \alpha } } + \frac { b } { m ^ { \beta } } } \end{array}$ (Eq. 5), dataset and models may be scaled with optimal resource efficiency with no effect on performance by solving for:
|
| 217 |
+
|
| 218 |
+
$$
|
| 219 |
+
\operatorname { a r g m i n } _ { m , n } \quad m \cdot n \qquad \mathrm { s . t . } \quad c = { \frac { 1 } { n ^ { \alpha } } } + { \frac { b } { m ^ { \beta } } }
|
| 220 |
+
$$
|
| 221 |
+
|
| 222 |
+
The solution gives us the optimal-computational-efficiency ratio of model to data size: bβα nmβ = 1.
|
| 223 |
+
|
| 224 |
+
Limitations: We have made a few simplifying assumptions in our choice of approximating function, in particular in how to model the transition from the initial random-guess error level and the union of the random-guess level of the two scenarios (small model with large data and large model with small data). We leave a more detailed examination of the behavior of the transitions from random-guess error levels and refinements of the functional form to future work.
|
| 225 |
+
|
| 226 |
+
Critically, the restrictive nature of our scaling framework (all parameters and hyperparameters described by a policy) is both a blessing and a challenge. The blessing comes in fulfilling the goal of finding simultaneously both the form of the generalization error and the full specification of the model and hyperparameters that attain it across scales. The challenge is that we have demonstrated in this work only the case of constant hyper-parameters. We conjecture that the relation between model configuration and hyperparameter choice (Zela et al., 2018) may entail the potential to formulate hyperparameter-scaling policies similar in nature to the model-scaling polices, and that these too fall under the scope of the form we find in this work. This too will be the subject of future work.
|
| 227 |
+
|
| 228 |
+
We hope that this work will bring the actual functional form of the generalization error in this practical case of scaling to the fore, both in practice and as an empirical leg to stand on in the quest for its theoretical origins.
|
| 229 |
+
|
| 230 |
+
# ACKNOWLEDGMENTS
|
| 231 |
+
|
| 232 |
+
We thank Alexander Rakhlin, Alexander Madry, Kai Xiao, Lu Mi, Viaks Garg, Dan Alistrah, and Tommi Jaakkola for discussions and their help. We also thank the anonymous reviewers for their valuable feedback. J.R. was partly supported by the Eli and Dorothy Berman Fellowship as well as grants NSF IIS-1447786, NSF CCF-1563880 and China-Singapore Suzhou Industrial Park. A.R. was partially supported by the Air Force Office of Scientific Research USA (FA9550-18-1-0054) though a grant to John K. Tsotsos. Y.B. was partly supported by the Harvard Mind ,Brain, and Behavior Initiative.
|
| 233 |
+
|
| 234 |
+
# REFERENCES
|
| 235 |
+
|
| 236 |
+
Zeyuan Allen-Zhu, Yuanzhi Li, and Yingyu Liang. Learning and generalization in overparameterized neural networks, going beyond two layers. arXiv preprint arXiv:1811.04918, 2018a.
|
| 237 |
+
|
| 238 |
+
Zeyuan Allen-Zhu, Yuanzhi Li, and Zhao Song. On the convergence rate of training recurrent neural networks. arXiv preprint arXiv:1810.12065, 2018b.
|
| 239 |
+
|
| 240 |
+
Sanjeev Arora, Rong Ge, Behnam Neyshabur, and Yi Zhang. Stronger generalization bounds for deep nets via a compression approach. arXiv preprint arXiv:1802.05296, 2018.
|
| 241 |
+
|
| 242 |
+
Michele Banko and Eric Brill. Mitigating the paucity-of-data problem: Exploring the effect of training corpus size on classifier performance for natural language processing. In Proceedings of the first international conference on Human language technology research, pp. 1–5. Association for Computational Linguistics, 2001.
|
| 243 |
+
|
| 244 |
+
Hakan Bilen, Basura Fernando, Efstratios Gavves, Andrea Vedaldi, and Stephen Gould. Dynamic image networks for action recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3034–3042, 2016.
|
| 245 |
+
|
| 246 |
+
James Bradbury, Stephen Merity, Caiming Xiong, and Richard Socher. Quasi-recurrent neural networks. In International Conference on Learning Representations, 2017.
|
| 247 |
+
|
| 248 |
+
Junghwan Cho, Kyewook Lee, Ellie Shin, Garry Choy, and Synho Do. How much data is needed to train a medical image deep learning system to achieve necessary high accuracy? arXiv preprint arXiv:1511.06348, 2015.
|
| 249 |
+
|
| 250 |
+
Mircea Cimpoi, Subhransu Maji, Iasonas Kokkinos, Sammy Mohamed, and Andrea Vedaldi. Describing textures in the wild. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3606–3613, 2014.
|
| 251 |
+
|
| 252 |
+
Zihang Dai, Zhilin Yang, Yiming Yang, Jaime Carbonell, Quoc Le, and Ruslan Salakhutdinov. Transformer-XL: Attentive language models beyond a fixed-length context. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 2978–2988, Florence, Italy, July 2019. Association for Computational Linguistics. doi: 10.18653/v1/P19-1285. URL https://www.aclweb.org/anthology/P19-1285.
|
| 253 |
+
|
| 254 |
+
Thomas Elsken, Jan Hendrik Metzen, and Frank Hutter. Neural architecture search: A survey. Journal of Machine Learning Research, 20(55):1–21, 2019.
|
| 255 |
+
|
| 256 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. pp. 770–778, 2016.
|
| 257 |
+
|
| 258 |
+
Joel Hestness, Sharan Narang, Newsha Ardalani, Gregory Diamos, Heewoo Jun, Hassan Kianinejad, Md Patwary, Mostofa Ali, Yang Yang, and Yanqi Zhou. Deep learning scaling is predictable, empirically. arXiv preprint arXiv:1712.00409, 2017.
|
| 259 |
+
|
| 260 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 261 |
+
|
| 262 |
+
Elad Hoffer, Itay Hubara, and Daniel Soudry. Fix your classifier: the marginal value of training the last weight layer. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ S1Dh8Tg0-.
|
| 263 |
+
|
| 264 |
+
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.
|
| 265 |
+
|
| 266 |
+
Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. 1(2):3, 2017.
|
| 267 |
+
|
| 268 |
+
Roxana Istrate, Florian Scheidegger, Giovanni Mariani, Dimitrios Nikolopoulos, Costas Bekas, and A Cristiano I Malossi. Tapas: Train-less accuracy predictor for architecture search. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 3927–3934, 2019.
|
| 269 |
+
|
| 270 |
+
Mark Johnson, Peter Anderson, Mark Dras, and Mark Steedman. Predicting accuracy on large datasets from smaller pilot data. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pp. 450–455, Melbourne, Australia, July 2018. Association for Computational Linguistics. doi: 10.18653/v1/P18-2072. URL https: //www.aclweb.org/anthology/P18-2072.
|
| 271 |
+
|
| 272 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. 2015.
|
| 273 |
+
|
| 274 |
+
Aaron Klein, Stefan Falkner, Simon Bartels, Philipp Hennig, and Frank Hutter. Fast bayesian optimization of machine learning hyperparameters on large datasets. In Artificial Intelligence and Statistics, pp. 528–536, 2017.
|
| 275 |
+
|
| 276 |
+
Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
|
| 277 |
+
|
| 278 |
+
Tengyuan Liang, Alexander Rakhlin, and Xiyu Zhai. On the risk of minimum-norm interpolants and restricted lower isometry of kernels. arXiv preprint arXiv:1908.10292, 2019.
|
| 279 |
+
|
| 280 |
+
Hanxiao Liu, Karen Simonyan, and Yiming Yang. Darts: Differentiable architecture search. arXiv preprint arXiv:1806.09055, 2018.
|
| 281 |
+
|
| 282 |
+
Subhransu Maji, Esa Rahtu, Juho Kannala, Matthew Blaschko, and Andrea Vedaldi. Fine-grained visual classification of aircraft. arXiv preprint arXiv:1306.5151, 2013.
|
| 283 |
+
|
| 284 |
+
Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. arXiv preprint arXiv:1609.07843, 2016.
|
| 285 |
+
|
| 286 |
+
Stephen Merity, Nitish Shirish Keskar, and Richard Socher. Regularizing and optimizing LSTM language models. In International Conference on Learning Representations, 2018. URL https: //openreview.net/forum?id=SyyGPP0TZ.
|
| 287 |
+
|
| 288 |
+
Antonio Valerio Miceli Barone, Barry Haddow, Ulrich Germann, and Rico Sennrich. Regularization techniques for fine-tuning in neural machine translation. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 1489–1494, Copenhagen, Denmark, September 2017. Association for Computational Linguistics. doi: 10.18653/v1/D17-1156. URL https://www.aclweb.org/anthology/D17-1156.
|
| 289 |
+
|
| 290 |
+
Toma´s Mikolov, Martin Karafi ˇ at, Luk ´ a´s Burget, Jan ˇ Cernock ˇ y, and Sanjeev Khudanpur. Recurrent \` neural network based language model. In Eleventh Annual Conference of the International Speech Communication Association, 2010.
|
| 291 |
+
|
| 292 |
+
Behnam Neyshabur, Srinadh Bhojanapalli, David McAllester, and Nati Srebro. Exploring generalization in deep learning. In Advances in Neural Information Processing Systems, pp. 5947–5956, 2017a.
|
| 293 |
+
|
| 294 |
+
Behnam Neyshabur, Srinadh Bhojanapalli, and Nathan Srebro. A pac-bayesian approach to spectrally-normalized margin bounds for neural networks. arXiv preprint arXiv:1707.09564, 2017b.
|
| 295 |
+
|
| 296 |
+
Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in PyTorch. In NIPS Autodiff Workshop, 2017.
|
| 297 |
+
|
| 298 |
+
E Real, A Aggarwal, Y Huang, and QV Le. Aging evolution for image classifier architecture search. In AAAI Conference on Artificial Intelligence, 2019.
|
| 299 |
+
|
| 300 |
+
Esteban Real, Alok Aggarwal, Yanping Huang, and Quoc V Le. Regularized evolution for image classifier architecture search. arXiv preprint arXiv:1802.01548, 2018.
|
| 301 |
+
|
| 302 |
+
Sylvestre-Alvise Rebuffi, Hakan Bilen, and Andrea Vedaldi. Learning multiple visual domains with residual adapters. In Advances in Neural Information Processing Systems, pp. 506–516, 2017.
|
| 303 |
+
|
| 304 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International journal of computer vision, 115(3):211–252, 2015.
|
| 305 |
+
|
| 306 |
+
Roy Schwartz, Jesse Dodge, Noah A Smith, and Oren Etzioni. Green ai. arXiv preprint arXiv:1907.10597, 2019.
|
| 307 |
+
|
| 308 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 309 |
+
|
| 310 |
+
Khurram Soomro, Amir Roshan Zamir, and Mubarak Shah. Ucf101: A dataset of 101 human actions classes from videos in the wild. arXiv preprint arXiv:1212.0402, 2012.
|
| 311 |
+
|
| 312 |
+
Chen Sun, Abhinav Shrivastava, Saurabh Singh, and Abhinav Gupta. Revisiting unreasonable effectiveness of data in deep learning era. In Proceedings of the IEEE international conference on computer vision, pp. 843–852, 2017.
|
| 313 |
+
|
| 314 |
+
Alon Talmor and Jonathan Berant. MultiQA: An empirical investigation of generalization and transfer in reading comprehension. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 4911–4921, Florence, Italy, July 2019. Association for Computational Linguistics. doi: 10.18653/v1/P19-1485. URL https://www.aclweb.org/ anthology/P19-1485.
|
| 315 |
+
|
| 316 |
+
Mingxing Tan and Quoc Le. Efficientnet: Rethinking model scaling for convolutional neural networks. In International Conference on Machine Learning, pp. 6105–6114, 2019.
|
| 317 |
+
|
| 318 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Ł ukasz Kaiser, and Illia Polosukhin. Attention is all you need. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett (eds.), Advances in Neural Information Processing Systems 30, pp. 5998–6008. Curran Associates, Inc., 2017. URL http://papers.nips.cc/paper/7181-attention-is-all-you-need.pdf.
|
| 319 |
+
|
| 320 |
+
Zifeng Wu, Chunhua Shen, and Anton van den Hengel. Wider or deeper: Revisiting the resnet model for visual recognition. arXiv preprint arXiv:1611.10080, 2016.
|
| 321 |
+
|
| 322 |
+
Dmitry Yarotsky. Optimal approximation of continuous functions by very deep relu networks. arXiv preprint arXiv:1802.03620, 2018.
|
| 323 |
+
|
| 324 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016.
|
| 325 |
+
|
| 326 |
+
Arber Zela, Aaron Klein, Stefan Falkner, and Frank Hutter. Towards automated deep learning: Efficient joint neural architecture and hyperparameter search. arXiv preprint arXiv:1807.06906, 2018.
|
| 327 |
+
|
| 328 |
+
Xiangxin Zhu, Carl Vondrick, Deva Ramanan, and Charless C Fowlkes. Do we need more training data or better models for object detection?. In BMVC, volume 3, pp. 5. Citeseer, 2012.
|
| 329 |
+
|
| 330 |
+
Barret Zoph, Vijay Vasudevan, Jonathon Shlens, and Quoc V Le. Learning transferable architectures for scalable image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 8697–8710, 2018.
|
| 331 |
+
|
| 332 |
+
# A DATASETS AND MODELS
|
| 333 |
+
|
| 334 |
+
A.1 IMAGE CLASSIFICATION
|
| 335 |
+
|
| 336 |
+
# A.1.1 DATASETS
|
| 337 |
+
|
| 338 |
+
We evaluated our predictions on several popular image classification datasets: ImageNet (Russakovsky et al., 2015): a large-scale recognition benchmark consisting of natural images of 1000 object categories with 1.28M training images spread roughly uniformly over the categories. It has 50K validation and 100K testing images. It has been the most popular large-scale benchmark for image classification methods for the better part of the last decade. CIFAR10/100 (Krizhevsky et al., 2009): 60K natural RGB images of 10 classes (100 for CIFAR100) with a train/test split of 50K/10K. For each of the following datasets, we use the version collated, resized, and split into train/validation/test sets by Rebuffi et al. (2017). DTD (Cimpoi et al., 2014): a texture database of 47 categories and 5640 images. Aircraft (Maji et al., 2013): 10K images of 100 different aircraft classes. UCF101 (Soomro et al., 2012): originally a video action recognition dataset, converted using the method of Bilen et al. (2016) into a single image per video. It contains 13,320 images of 101 action classes.
|
| 339 |
+
|
| 340 |
+
# A.1.2 MODELS
|
| 341 |
+
|
| 342 |
+
We experiment with four models for image classification. We use different variants of the popular ResNet architecture (He et al., 2016) in the main experiments. For ImageNet we use ResNet-50 and build on the code from the PyTorch framework (Paszke et al., 2017) to vary the model width. For all other datasets we use WRN-44-16 (Wu et al., 2016) of varying widths, modified from the implementation of Hoffer et al. (2018).
|
| 343 |
+
|
| 344 |
+
Scaling the models’ width is performed by multiplying the number of channels in each convolutional layer and the width of the hidden linear layers by a constant factor and rounding to the nearest integer. The ranges of width scales (and data scales) for the main experiments are detailed in Table 1b.
|
| 345 |
+
|
| 346 |
+
In section 6.2, we perform width scaling for two additional architectures, VGG16bn (Simonyan & Zisserman, 2014) and DenseNet $( { \bf L } { = } 4 0 , { \bf k } { = } 3 2$ ) (Huang et al., 2017). The VGG and DenseNet models were also modified for width scaling from the implementation of Hoffer et al. (2018). The model scales in this case are $4 ^ { - k }$ , $0 \leq k \leq \bar { 5 }$ , for both VGG and DenseNEt.
|
| 347 |
+
|
| 348 |
+
Depth-scaling, in the CIFAR10 case (section 6.1), is performed by appending extra layers within each block.
|
| 349 |
+
|
| 350 |
+
# A.1.3 TRAINING
|
| 351 |
+
|
| 352 |
+
In the main experiments, training is done via SGD with a momentum of 0.9, weight decay of 1e-4 and initial learning rate of 0.1. For ImageNet we train for 90 epochs, decreasing the learning rate by a multiplicative factor of 0.1 after and 30 and after 60 epochs. We use a batch size of 16. For all other vision datasets we use a batch-size of 128. We begin training with a learning rate of 0.1, run for 200 epochs, and reduce by a multiplicative factor of 0.1 after 80, 120, and 160 epochs.
|
| 353 |
+
|
| 354 |
+
For the VGG and DenseNet experiments on CIFAR100 in section 6.2, we train with both SGD and Adam optimizers. We train VGG for 170 epochs and Densenet for 300 epochs. Adam hyperparameters are default, with an initial learning rate of 1e-3. When training with SGD, we retain initial learning rate, batch size, momentum, and weight-decay, as in the main experiment (at 0.1, 128, 0.9, and 1e-4 respectively) and follow standard stepped learning rate schedules: For VGG, learning rate multiplicative factor of 0.1 after 80, 120, and 160 epochs; For DenseNet, learning rate multiplicative factor of 0.1 after 150 and 225 epochs.
|
| 355 |
+
|
| 356 |
+
# A.2 LANGUAGE MODELING
|
| 357 |
+
|
| 358 |
+
# A.2.1 DATASETS
|
| 359 |
+
|
| 360 |
+
We evaluate on several datasets commonly used for (word-level) language modeling: Penn Treebank (Mikolov et al., 2010), WikiText-2 (Bradbury et al., 2017), and WikiText-103 (Merity et al., 2016). The PTB is a relatively small language modeling dataset of news texts, with a vocabulary of 10K unique words and about 900K/70K/80K training/validation/test words. WikiText-2 is drawn from Wikipedia articles and it is both larger and richer, with a vocabulary of 33K words and 2M/210K/240K training/validation/test words. WikiText-103 is also based on Wikipedia, but larger still, with a vocabulary of 270K words and 100M training words (and the same validation and test sets as WikiText-2).
|
| 361 |
+
|
| 362 |
+
# A.2.2 MODELS
|
| 363 |
+
|
| 364 |
+
We experiment with two standard models for language modeling: Transformer-XL (Dai et al., 2019) and AWD-LSTM (Merity et al., 2018). Transformer-XL is a recent language modeling architecture that is based on transformer self-attention (Vaswani et al., 2017), but modified to better learn dependencies beyond a fixed length by adding a segment-level recurrence mechanism. It has achieved state-of-the-art results on multiple benchmarks. We use the official PyTorch implementation4 with their base configuration: 16 layers, embedding size of 410, inner dimension of 2100 in the fullyconnected layers, and 10 attention heads. Training is done with Adam. See the implementation for other details. For scaling experiments, we decimate the inner dimension. We use Transformer-XL for WikiText-103.
|
| 365 |
+
|
| 366 |
+
AWD-LSTM is a long short-term memory (Hochreiter & Schmidhuber, 1997) language model with adaptive weight averaging. We use the official implementation5 with the recommended configuration: 3 layers, embedding size of 400, and hidden state size of 1150. Training is done with SGD. We use AWD-LSTM for PTB and WikiText-2 and follow the recommended settings for these two datasets. For scaling experiments, we decimate the hidden state size.
|
| 367 |
+
|
| 368 |
+
# B ERROR ESTIMATION EXPERIMENT
|
| 369 |
+
|
| 370 |
+
# B.1 EXPERIMENTAL DETAILS
|
| 371 |
+
|
| 372 |
+
In the experiment described in section 6, we fit a least squares regression model to find the best parameters minimizing the divergence $\delta ( m , n )$ - evaluated at configurations $m , n$ as in Table 1:
|
| 373 |
+
|
| 374 |
+
$$
|
| 375 |
+
\pmb { \theta } ^ { * } = \arg \operatorname* { m i n } _ { \pmb { \theta } } \sum _ { n , m } | \delta ( m , n ; \pmb { \theta } ) | ^ { 2 }
|
| 376 |
+
$$
|
| 377 |
+
|
| 378 |
+
We quantify the quality of the fit by the mean $\mu$ and standard deviation $\sigma$ of the fitted divergence by performing standard 10-fold cross validation over all points $( m , n )$ with confidence intervals reported as $\pm 1$ std over the folds.
|
| 379 |
+
|
| 380 |
+
# B.2 FOUND THETA VALUES
|
| 381 |
+
|
| 382 |
+
Table 2: Optimal values of $\pmb \theta$ as found by the least squres regression fitting the functional form.
|
| 383 |
+
(a) Image classification (fitting top 1 error).
|
| 384 |
+
|
| 385 |
+
<table><tr><td></td><td>α</td><td>β</td><td>b</td><td>C8</td><td>n</td></tr><tr><td>ImageNet</td><td>0.75</td><td>0.61</td><td>0.76</td><td>3.63</td><td>18.50</td></tr><tr><td>CIFAR10</td><td>0.66</td><td>0.53</td><td>5.87·10-02</td><td>7.14· 10-14</td><td>19.77</td></tr><tr><td>CIFAR100</td><td>0.70</td><td>0.51</td><td>0.15</td><td>0.71</td><td>6.93</td></tr><tr><td>DTD</td><td>0.40</td><td>1.16</td><td>4.30 · 10-05</td><td>1.27 · 10-09</td><td>0.85</td></tr><tr><td>Aircraft</td><td>1.10</td><td>0.83</td><td>3.47 · 10-03</td><td>5.16 : 10-10</td><td>1.13</td></tr><tr><td>UFC101</td><td>0.93</td><td>0.54</td><td>4.68· 10-02</td><td>1.16 : 10-09</td><td>2.98</td></tr><tr><td colspan="6">(b)Language modeling (fitting crossentropy1 loss).</td></tr><tr><td></td><td>α</td><td>β</td><td>b</td><td>Co</td><td>m</td><td>E0</td></tr><tr><td>PTB</td><td>0.81</td><td>0.34</td><td>0.15</td><td>5.00</td><td>6.27</td><td>6.10</td></tr><tr><td>WikiText-2</td><td>1.01</td><td>0.22</td><td>0.99</td><td>8.23</td><td>10.38</td><td>6.21</td></tr><tr><td>WikiText-103</td><td>0.74</td><td>0.56</td><td>0.33</td><td>9.04</td><td>16.34</td><td>6.60</td></tr></table>
|
| 386 |
+
|
| 387 |
+
# C ADDITIONAL ERROR LANDSCAPE MEASUREMENTS AND ESTIMATIONS
|
| 388 |
+
|
| 389 |
+
In this appendix, we provide error landscape measurements and estimations for all datasets, corresponding to the experiment in section 6. The results are shown in 3D graphs similar to figure 1. In each such graph, the $\mathbf { Z }$ -axis is the logarithm of the generalization error as a function of two independent variables: the model size $m$ and the data size $n$ .
|
| 390 |
+
|
| 391 |
+
The 3D graph is deliberately portrayed in log-log-log scale, as we cover a very large range of data scales and model scales and a correspondingly wide range of errors. This view is a useful one when one wishes to evaluate both large dynamic ranges (simultaneously both very large and very small values) and is especially vivid in portraying power-law like dependencies; a power-law naturally forms a straight line in a log-log view.
|
| 392 |
+
|
| 393 |
+
In each figure, subfigure (a) shows the measured error landscape is in log-log-log scale, where each point (blue dot) is the error resulting from training with a model/data configuration $m , n$ . Subfigure (b) shows the best-fit estimated error landscape. The surface is a linear interpolation between the points, which is then projected on the model-error $( m , \epsilon )$ , data-error $( n , \epsilon )$ , and model-data $( m , n )$ planes. The contour plots on each one of these planes are the projections of the error landscape surface, and are useful in considering the behavior of the surface when holding one dimension constant.
|
| 394 |
+
|
| 395 |
+
We call to attention several interesting observations on the datasets explored:
|
| 396 |
+
|
| 397 |
+
• As quantified rigorously in section 6, the fits perform well across error ranges. In these surfaces, one also gets qualitative sense of the fit adequacy across the wide ranges of the dataset and model scales directly. While perhaps slightly difficult to asses the surface directly, a helpful view is to consider the similarity between the projections of the actual and projected surfaces. With increasing model size, indeed typically the error does remain saturated. However, in one of our tested datasets (figure 12) there was a renewed slight increase. We verify that this is indeed over-fitting, in the sense that there is no corresponding increase in the training error. We note that the functional form we find can actually be used to veer clear of the $m , n$ regions where such over-fitting may occur.
|
| 398 |
+
• The simplifying approach taken by considering the random guess levels (and associated transitions) for small models or small data as identical, seems to work fairly well with some deviation apparent by examining figure 15. Indeed the simplification can hold well for balanced datasets, but need not for imbalanced ones such as in the task of language modeling. Thus, a relaxation of this simplification is expected to be important conceptually and practically.
|
| 399 |
+
|
| 400 |
+

|
| 401 |
+
Figure 7: ImageNet error landscape.
|
| 402 |
+
|
| 403 |
+

|
| 404 |
+
Figure 8: CIFAR10 error landscape.
|
| 405 |
+
|
| 406 |
+

|
| 407 |
+
Figure 9: CIFAR100 error landscape.
|
| 408 |
+
|
| 409 |
+

|
| 410 |
+
Figure 10: DTD error landscape.
|
| 411 |
+
|
| 412 |
+

|
| 413 |
+
Figure 11: Aircraft error landscape.
|
| 414 |
+
|
| 415 |
+

|
| 416 |
+
Figure 12: UFC101 error landscape.
|
| 417 |
+
|
| 418 |
+

|
| 419 |
+
Figure 13: PTB error landscape.
|
| 420 |
+
|
| 421 |
+

|
| 422 |
+
Figure 14: WikiText-2 error landscape.
|
| 423 |
+
|
| 424 |
+

|
| 425 |
+
Figure 15: WikiText-103 error landscape.
|
| 426 |
+
|
| 427 |
+
# D ADDITIONAL EXTRAPOLATION RESULTS
|
| 428 |
+
|
| 429 |
+
Here we provide detailed extrapolation results, for all datasets. All figures are structured in a similar way. Each subplot shows estimated (y-axis) vs. actual error $\mathbf { \dot { x } }$ -axis) (0 to 1 scale on both axes). Each subplot is located at the coordinate of the maximal data and model given for the task of performing the fit to the functional form in equation 5. This is the point at the top-right corner of the green dots in the illustration in figure 6a. The target is to find the error-landscape values for unseen, larger scales of both model and data (red points in the same illustration). Going from left to right in each figure indicates observed measurements of the error from models of an increasing fraction w.r.t the full size. Going from bottom-to top indicates observed measurements of the error from dataset sizes of an increasingly large fraction of the full dataset.
|
| 430 |
+
|
| 431 |
+
In each subplot, every point shows the estimated vs. actual error on a model-data configuration. Points that were given for fitting the function are colored in green, while unseen points that were not used are in red. The red points show the estimation error vs. actual error when extrapolating to all larger models and data sizes. In each subplot, the mean and standard deviation over all divergences $\delta$ at target points are given in text.
|
| 432 |
+
|
| 433 |
+
Each experiment fit of the parameters was repeated 100 times, with different random initializations of $\pmb { \theta }$ . The shaded bands show one standard deviation across these runs.
|
| 434 |
+
|
| 435 |
+
The quality of the extrapolation is critically dependent on the signal provided in the (green) fitted points. Two limiting factors are evident by examining the figures below, which both play a role in the well-posedness of the solution:
|
| 436 |
+
|
| 437 |
+
• The proximity to the initial random guess level. Only upon transitioning from the initial error plateau, does meaningful signal about the scaling rates become available. Indeed, for scales prior still in the region or close to the initial error level, one sees poor extrapolation results; see figures 18, 19, and 21, and the vivid origin of this phenomena by examining figures 11, 10, and 12. A second source of ill-posedness is tied to the number of configurations used for the estimation of $\pmb \theta$ . Clearly, when this is small, one cannot expect the extrapolation to be stable. In fact, at least two measurements in each scaling dimension (model/data) are needed, and no less than the number of parameters in $\pmb { \theta }$ in total. Indeed, for all the plots in this appendix, the smallest scale of $m , n$ is omitted form the graph such that the lowermost row and leftmost column span exactly two model and data scales correspondingly. Of course, there is nothing tying directly the number of points and scale of configurations measured, and one can decouple these two factors by taking closer spaced samples at small scale. • When both the above factors are not limiting the measurement, one readily sees that for divergences of no more than a few percent, it is sufficient to measure model/data configurations which are far-ranged from the configurations which one wishes to extrapolate to
|
| 438 |
+
|
| 439 |
+

|
| 440 |
+
Figure 16: ImageNet extrapolation results.
|
| 441 |
+
|
| 442 |
+

|
| 443 |
+
Figure 17: CIFAR100 Extrapolation Results
|
| 444 |
+
|
| 445 |
+

|
| 446 |
+
Figure 18: Aircraft extrapolation results.
|
| 447 |
+
|
| 448 |
+

|
| 449 |
+
Figure 19: DTD Results
|
| 450 |
+
|
| 451 |
+

|
| 452 |
+
Figure 20: CIFAR10 extrapolation results.
|
| 453 |
+
|
| 454 |
+

|
| 455 |
+
Figure 21: UCF101 extrapolation results.
|
| 456 |
+
|
| 457 |
+

|
| 458 |
+
Figure 22: PTB extrapolation results.
|
| 459 |
+
|
| 460 |
+

|
| 461 |
+
Figure 23: WikiText-2 extrapolation results.
|
| 462 |
+
|
| 463 |
+

|
| 464 |
+
Figure 24: WikiText-103 extrapolation results.
|
md/train/ryxB0Rtxx/ryxB0Rtxx.md
ADDED
|
@@ -0,0 +1,483 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# IDENTITY MATTERS IN DEEP LEARNING
|
| 2 |
+
|
| 3 |
+
# Moritz Hardt
|
| 4 |
+
|
| 5 |
+
# Tengyu Ma
|
| 6 |
+
|
| 7 |
+
Google Brain
|
| 8 |
+
1600 Amphitheatre Parkway, Mountain View, CA, 94043 m@mrtz.org
|
| 9 |
+
|
| 10 |
+
Department of Computer Sciene Princeton University 35 Olden Street, Princeton, 08540 tengyu@cs.princeton.edu
|
| 11 |
+
|
| 12 |
+
# ABSTRACT
|
| 13 |
+
|
| 14 |
+
An emerging design principle in deep learning is that each layer of a deep artificial neural network should be able to easily express the identity transformation. This idea not only motivated various normalization techniques, such as batch normalization, but was also key to the immense success of residual networks.
|
| 15 |
+
|
| 16 |
+
In this work, we put the principle of identity parameterization on a more solid theoretical footing alongside further empirical progress. We first give a strikingly simple proof that arbitrarily deep linear residual networks have no spurious local optima. The same result for feed-forward networks in their standard parameterization is substantially more delicate. Second, we show that residual networks with ReLu activations have universal finite-sample expressivity in the sense that the network can represent any function of its sample provided that the model has more parameters than the sample size.
|
| 17 |
+
|
| 18 |
+
Directly inspired by our theory, we experiment with a radically simple residual architecture consisting of only residual convolutional layers and ReLu activations, but no batch normalization, dropout, or max pool. Our model improves significantly on previous all-convolutional networks on the CIFAR10, CIFAR100, and ImageNet classification benchmarks.
|
| 19 |
+
|
| 20 |
+
# 1 INTRODUCTION
|
| 21 |
+
|
| 22 |
+
Traditional convolutional neural networks for image classification, such as AlexNet (Krizhevsky et al. (2012)), are parameterized in such a way that when all trainable weights are 0, a convolutional layer represents the 0-mapping. Moreover, the weights are initialized symmetrically around 0. This standard parameterization makes it non-trivial for a convolutional layer trained with stochastic gradient methods to preserve features that were already good. Put differently, such convolutional layers cannot easily converge to the identity transformation at training time.
|
| 23 |
+
|
| 24 |
+
This shortcoming was observed and partially addressed by Ioffe & Szegedy (2015) through batch normalization, i.e., layer-wise whitening of the input with a learned mean and covariance. But the idea remained somewhat implicit until residual networks (He et al. (2015); He et al. (2016)) explicitly introduced a reparameterization of the convolutional layers such that when all trainable weights are 0, the layer represents the identity function. Formally, for an input $x$ , each residual layer has the form $x + h ( x )$ , rather than $h ( x )$ . This simple reparameterization allows for much deeper architectures largely avoiding the problem of vanishing (or exploding) gradients. Residual networks, and subsequent architectures that use the same parameterization, have since then consistently achieved state-of-the-art results on various computer vision benchmarks such as CIFAR10 and ImageNet.
|
| 25 |
+
|
| 26 |
+
# 1.1 OUR CONTRIBUTIONS
|
| 27 |
+
|
| 28 |
+
In this work, we consider identity parameterizations from a theoretical perspective, while translating some of our theoretical insight back into experiments. Loosely speaking, our first result underlines how identity parameterizations make optimization easier, while our second result shows the same is true for representation.
|
| 29 |
+
|
| 30 |
+
Linear residual networks. Since general non-linear neural networks, are beyond the reach of current theoretical methods in optimization, we consider the case of deep linear networks as a simplified model. A linear network represents an arbitrary linear map as a sequence of matrices $A _ { \ell } \cdots A _ { 2 } A _ { 1 }$ . The objective function is $\mathbb { E } \| y - A _ { \ell } \cdot \cdot \cdot A _ { 1 } x \| ^ { 2 }$ , where $y = R x$ for some unknown linear transformation $R$ and $x$ is drawn from a distribution. Such linear networks have been studied actively in recent years as a stepping stone toward the general non-linear case (see Section 1.2). Even though $A _ { \ell } \cdots A _ { 1 }$ is just a linear map, the optimization problem over the factored variables $( A _ { \ell } , \ldots , A _ { 1 } )$ is non-convex.
|
| 31 |
+
|
| 32 |
+
In analogy with residual networks, we will instead parameterize the objective function as
|
| 33 |
+
|
| 34 |
+
$$
|
| 35 |
+
\operatorname* { m i n } _ { A _ { 1 } , \dots , A _ { \ell } } \mathbb { E } \| y - ( I + A _ { \ell } ) \cdot \cdot \cdot ( I + A _ { 1 } ) x \| ^ { 2 } .
|
| 36 |
+
$$
|
| 37 |
+
|
| 38 |
+
To give some intuition, when the depth $\ell$ is large enough, we can hope that the target function $R$ has a factored representation in which each matrix $A _ { i }$ has small norm. Any symmetric positive semidefinite matrix $O$ can, for example, be written as a product $O = O _ { \ell } \cdot \cdot \cdot O _ { 1 }$ , where each $O _ { i } =$ $O ^ { 1 / \ell }$ is very close to the identity for large $\ell$ so that $A _ { i } = O _ { i } - I$ has small spectral norm. We first prove that an analogous claim is true for all linear transformations $R$ . Specifically, we prove that for every linear transformation $R$ , there exists a global optimizer $( A _ { 1 } , \ldots , A _ { \ell } )$ of (1.1) such that for large enough depth $\ell$ ,
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
\operatorname* { m a x } _ { 1 \leq i \leq \ell } \| A _ { i } \| \leq O ( 1 / \ell ) .
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
Here, $\| A \|$ denotes the spectral norm of $A$ . The constant factor depends on the conditioning of $R$ . We give the formal statement in Theorem 2.1. The theorem has the interesting consequence that as the depth increases, smaller norm solutions exist and hence regularization may offset the increase in parameters.
|
| 45 |
+
|
| 46 |
+
Having established the existence of small norm solutions, our main result on linear residual networks shows that the objective function (1.1) is, in fact, easy to optimize when all matrices have sufficiently small norm. More formally, letting $A = ( A _ { 1 } , \ldots , A _ { \ell } ) $ and $f ( A )$ denote the objective function in (1.1), we can show that the gradients of vanish only when $f ( A ) = 0$ provided that maxi $\| A _ { i } \| \leq$ $O ( 1 / \ell )$ . See Theorem 2.2. This result implies that linear residual networks have no critical points other than the global optimum. In contrast, for standard linear neural networks we only know, by work of Kawaguchi (2016) that these networks don’t have local optima except the global optimum, but it doesn’t rule out other critical points. In fact, setting $A _ { i } = 0$ will always lead to a bad critical point in the standard parameterization.
|
| 47 |
+
|
| 48 |
+
Universal finite sample expressivity. Going back to non-linear residual networks with ReLU activations, we can ask: How expressive are deep neural networks that are solely based on residual layers with ReLU activations? To answer this question, we give a very simple construction showing that such residual networks have perfect finite sample expressivity. In other words, a residual network with ReLU activations can easily express any functions of a sample of size $n$ , provided that it has sufficiently more than $n$ parameters. Note that this requirement is easily met in practice. On CIFAR 10 $\mathit { n } = 5 0 0 0 0 $ ), for example, successful residual networks often have more than $1 0 ^ { 6 }$ parameters. More formally, for a data set of size $n$ with $r$ classes, our construction requires $O ( n \log \bar { n } + r ^ { 2 } )$ parameters. Theorem 3.2 gives the formal statement.
|
| 49 |
+
|
| 50 |
+
Each residual layer in our construction is of the form $x + V \mathrm { R e L U } ( U x )$ , where $U$ and $V$ are linear transformations. These layers are significantly simpler than standard residual layers, which typically have two ReLU activations as well as two instances of batch normalization.
|
| 51 |
+
|
| 52 |
+
The power of all-convolutional residual networks. Directly inspired by the simplicity of our expressivity result, we experiment with a very similar architecture on the CIFAR10, CIFAR100, and ImageNet data sets. Our architecture is merely a chain of convolutional residual layers each with a single ReLU activation, but without batch normalization, dropout, or max pooling as are common in standard architectures. The last layer is a fixed random projection that is not trained. In line with our theory, the convolutional weights are initialized near 0, using Gaussian noise mainly as a symmetry breaker. The only regularizer is standard weight decay $\ell _ { 2 }$ -regularization) and there is no need for dropout. Despite its simplicity, our architecture reaches $6 . 3 8 \%$ top-1 classification error on the CIFAR10 benchmark (with standard data augmentation). This is competitive with the best residual network reported in He et al. (2015), which achieved $6 . 4 3 \%$ . Moreover, it improves upon the performance of the previous best all-convolutional network, $7 . 2 5 \%$ , achieved by Springenberg et al. (2014). Unlike ours, this previous all-convolutional architecture additionally required dropout and a non-standard preprocessing (ZCA) of the entire data set. Our architecture also improves significantly upon Springenberg et al. (2014) on both Cifar100 and ImageNet.
|
| 53 |
+
|
| 54 |
+
# 1.2 RELATED WORK
|
| 55 |
+
|
| 56 |
+
Since the advent of residual networks (He et al. (2015); He et al. (2016)), most state-of-the-art networks for image classification have adopted a residual parameterization of the convolutional layers. Further impressive improvements were reported by Huang et al. (2016) with a variant of residual networks, called dense nets. Rather than adding the original input to the output of a convolutional layer, these networks preserve the original features directly by concatenation. In doing so, dense nets are also able to easily encode an identity embedding in a higher-dimensional space. It would be interesting to see if our theoretical results also apply to this variant of residual networks.
|
| 57 |
+
|
| 58 |
+
There has been recent progress on understanding the optimization landscape of neural networks, though a comprehensive answer remains elusive. Experiments in Goodfellow et al. (2014) and Dauphin et al. (2014) suggest that the training objectives have a limited number of bad local minima with large function values. Work by Choromanska et al. (2015) draws an analogy between the optimization landscape of neural nets and that of the spin glass model in physics (Auffinger et al. (2013)). Soudry & Carmon (2016) showed that 2-layer neural networks have no bad differentiable local minima, but they didn’t prove that a good differentiable local minimum does exist. Baldi & Hornik (1989) and Kawaguchi (2016) show that linear neural networks have no bad local minima. In contrast, we show that the optimization landscape of deep linear residual networks has no bad critical point, which is a stronger and more desirable property. Our proof is also notably simpler illustrating the power of re-parametrization for optimization. Our results also indicate that deeper networks may have more desirable optimization landscapes compared with shallower ones.
|
| 59 |
+
|
| 60 |
+
# 2 OPTIMIZATION LANDSCAPE OF LINEAR RESIDUAL NETWORKS
|
| 61 |
+
|
| 62 |
+
Consider the problem of learning a linear transformation $R \colon { \mathbb { R } } ^ { d } \to { \mathbb { R } } ^ { d }$ from noisy measurements $y = R x + \xi$ , where $\xi \in \mathcal { N } ( 0 , \operatorname { I d } _ { d } )$ is a $d$ -dimensional spherical Gaussian vector. Denoting by $\mathcal { D }$ the distribution of the input data $x$ , let $\Sigma = \mathbb { E } _ { x \sim { \mathcal { D } } } [ x x ^ { \top } ]$ be its covariance matrix.
|
| 63 |
+
|
| 64 |
+
There are, of course, many ways to solve this classical problem, but our goal is to gain insights into the optimization landscape of neural nets, and in particular, residual networks. We therefore parameterize our learned model by a sequence of weight matrices $A _ { 1 } , \ldots , A _ { \ell } \in \mathbb { R } ^ { d \times d }$ ,
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
h _ { 0 } = x , \qquad h _ { j } = h _ { j - 1 } + A _ { j } h _ { j - 1 } , \qquad \hat { y } = h _ { \ell } .
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
Here $h _ { 1 } , \ldots , h _ { \ell - 1 }$ are the $\ell - 1$ hidden layers and $\hat { y } = h _ { \ell }$ are the predictions of the learned model on input $x$ . More succinctly, we have
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\hat { y } = ( \operatorname { I d } _ { d } + A _ { \ell } ) \dots ( \operatorname { I d } + A _ { 1 } ) x .
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
It is easy to see that this model can express any linear transformation $R$ . We will use $A$ as a shorthand for all of the weight matrices, that is, the $\ell \times d \times d$ -dimensional tensor the contains $A _ { 1 } , \ldots , A _ { \ell }$ as slices. Our objective function is the maximum likelihood estimator,
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
f ( A , ( x , y ) ) = \| { \hat { y } } - y \| ^ { 2 } = \| ( \operatorname { I d } + A _ { \ell } ) \dots ( \operatorname { I d } + A _ { 1 } ) x - R x - \xi \| ^ { 2 } .
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
We will analyze the landscape of the population risk, defined as,
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
f ( A ) : = \mathbb { E } \left[ f ( A , ( x , y ) ) \right] .
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
Recall that $\left. A _ { i } \right.$ is the spectral norm of $A _ { i }$ . We define the norm $\left\| \cdot \right\|$ for the tensor $A$ as the maximum of the spectral norms of its slices,
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\| A \| : = \operatorname* { m a x } _ { 1 \leq i \leq \ell } \left\| A _ { i } \right\| .
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
The first theorem of this section states that the objective function $f$ has an optimal solution with small $\left\| \cdot \right\|$ -norm, which is inversely proportional to the number of layers $\ell$ . Thus, when
|
| 95 |
+
|
| 96 |
+
the architecture is deep, we can shoot for fairly small norm solutions. We define $\gamma \quad : =$ $\operatorname* { m a x } \{ | \log \sigma _ { \operatorname* { m a x } } ( R ) | , | \log \sigma _ { \operatorname* { m i n } } ( R ) | \}$ . Here $\sigma _ { \operatorname* { m i n } } ( \cdot ) , \sigma _ { \operatorname* { m a x } } ( \cdot )$ denote the least and largest singular values of $R$ respectively.
|
| 97 |
+
|
| 98 |
+
Theorem 2.1. Suppose $\ell \geq 3 \gamma$ . Then, there exists a global optimum solution $A ^ { \star }$ of the population risk $f ( \cdot )$ with norm
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
\left\| | A ^ { \star } | \right\| \leq 2 ( \sqrt { \pi } + \sqrt { 3 \gamma } ) ^ { 2 } / \ell .
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
Here $\gamma$ should be thought of as a constant since if $R$ is too large (or too small), we can scale the data properly so that $\sigma _ { \operatorname* { m i n } } ( R ) \leq 1 \leq \sigma _ { \operatorname* { m a x } } ( R )$ . Concretely, if $\sigma _ { \mathrm { m a x } } ( R ) / \sigma _ { \mathrm { m i n } } ( R ) = \kappa ,$ , then we can scaling for the outputs properly so that √ $\sigma _ { \mathrm { m i n } } ( R ) = 1 / \bar { \sqrt { \kappa } }$ and $\sigma _ { \operatorname* { m a x } } ( R ) = \sqrt { \kappa }$ . In this case, we have $\gamma = \log \sqrt { \kappa }$ , which will remain a small constant for fairly large condition number $\kappa$ . We also point out that we made no attempt to optimize the constant factors here in the analysis. The proof of Theorem 2.1 is rather involved and is deferred to Section A.
|
| 105 |
+
|
| 106 |
+
Given the observation of Theorem 2.1, we restrict our attention to analyzing the landscape of $f ( \cdot )$ in the set of $A$ with $\left\| \cdot \right\|$ -norm less than $\tau$ ,
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\begin{array} { r } { B _ { \tau } = \left\{ A \in \mathbb { R } ^ { \ell \times d \times d } : \left\| \left| A \right\| \right\| \leq \tau \right\} . } \end{array}
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
Here using Theorem 2.1, the radius $\tau$ should be thought of as on the order of $1 / \ell$ . Our main theorem in this section claims that there is no bad critical point in the domain $B _ { \tau }$ for any $\tau < 1$ . Recall that a critical point has vanishing gradient.
|
| 113 |
+
|
| 114 |
+
Theorem 2.2. For any $\tau < 1$ , we have that any critical point $A$ of the objective function $f ( \cdot )$ inside the domain $B _ { \tau }$ must also be a global minimum.
|
| 115 |
+
|
| 116 |
+
Theorem 2.2 suggests that it is sufficient for the optimizer to converge to critical points of the population risk, since all the critical points are also global minima.
|
| 117 |
+
|
| 118 |
+
Moreover, in addition to Theorem 2.2, we also have that any $A$ inside the domain $B _ { \tau }$ satisfies that
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\begin{array} { r } { \| \nabla f ( A ) \| _ { F } ^ { 2 } \geq 4 \ell ( 1 - \tau ) ^ { \ell - 1 } \sigma _ { \operatorname* { m i n } } ( \Sigma ) ^ { 2 } ( f ( A ) - C _ { \mathrm { o p t } } ) . } \end{array}
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
Here $C _ { \mathrm { o p t } }$ is the global minimal value of $f ( \cdot )$ and $\| \nabla f ( A ) \| _ { F }$ denotes the euclidean norm1 of the ${ \ell \times d \times \bar { d } }$ -dimensional tensor $\nabla f ( A )$ . Note that $\sigma _ { \mathrm { m i n } } ( \Sigma )$ denote the minimum singular value of $\Sigma$ .
|
| 125 |
+
|
| 126 |
+
Equation (2.3) says that the gradient has fairly large norm compared to the error, which guarantees convergence of the gradient descent to a global minimum (Karimi et al. (2016)) if the iterates stay inside the domain $B _ { \tau }$ , which is not guaranteed by Theorem 2.2 by itself.
|
| 127 |
+
|
| 128 |
+
Towards proving Theorem 2.2, we start off with a simple claim that simplifies the population risk.
|
| 129 |
+
We also use $\left\| \cdot \right\| _ { F }$ to denote the Frobenius norm of a matrix.
|
| 130 |
+
|
| 131 |
+
Claim 2.3. In the setting of this section, we have,
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
f ( A ) = \left\| ( ( \operatorname { I d } + A _ { \ell } ) \ldots ( \operatorname { I d } + A _ { 1 } ) - R ) \Sigma ^ { 1 / 2 } \right\| _ { F } ^ { 2 } + C .
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
Here $C$ is a constant that doesn’t depend on $A$ , and $\Sigma ^ { 1 / 2 }$ denote the square root of $\Sigma$ , that is, the unique symmetric matrix $B$ that satisfies $B ^ { 2 } = \Sigma$ .
|
| 138 |
+
|
| 139 |
+
Proof of Claim 2.3. Let $\operatorname { t r } ( A )$ denotes the trace of the matrix $A$ . Let $E = ( \mathbf { I d } + A _ { \ell } ) \dots ( \mathbf { I d } + A _ { 1 } ) - R$ . Recalling the definition of $f ( A )$ and using equation (2.2), we have
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
\begin{array} { r l r } { f ( A ) = \mathbb { E } \left[ \| E x - \xi \| ^ { 2 } \right] } & { { \mathrm { ( b y ~ e q u a t i o n ~ } ( 2 . 2 ) ) } } \\ { = \mathbb { E } \left[ \| E x \| ^ { 2 } + \| \xi \| ^ { 2 } - 2 \langle E x , \xi \rangle \right] } & { } \\ { = \mathbb { E } \left[ \mathrm { t r } ( E x x ^ { \top } E ^ { \top } ) \right] + \mathbb { E } \left[ \| \xi \| ^ { 2 } \right] } & { { \mathrm { ( s i n c e ~ } } \mathbb { E } \left[ \langle E x , \xi \rangle \right] = \mathbb { E } \left[ \langle E x , \mathbb { E } \left[ \xi | x \right] \rangle \right] = 0 ) } \\ { } & { = \mathrm { t r } \left( E \mathbb { E } \left[ x x ^ { \top } \right] E ^ { \top } \right) + C } & { { \mathrm { ( w h e r e ~ } } C = \mathbb { E } [ x x ^ { \top } ] ) } \\ { } & { = \mathrm { t r } ( E \Sigma E ^ { \top } ) + C = \| E \Sigma ^ { 1 / 2 } \| _ { F } ^ { 2 } + C . } & { { \mathrm { ( s i n c e ~ } } \mathbb { E } \left[ x x ^ { \top } \right] = \Sigma ) } \end{array}
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
Next we compute the gradients of the objective function $f ( \cdot )$ from straightforward matrix calculus.
|
| 146 |
+
We defer the full proof to Section A.
|
| 147 |
+
|
| 148 |
+
Lemma 2.4. The gradients of $f ( \cdot )$ can be written as,
|
| 149 |
+
|
| 150 |
+
$$
|
| 151 |
+
\frac { \partial f } { \partial A _ { i } } = 2 \big ( \mathbf { I d } + A _ { \ell } ^ { \top } \big ) \ldots \big ( \mathbf { I d } + A _ { i + 1 } ^ { \top } \big ) E \Sigma \big ( \mathbf { I d } + A _ { i - 1 } ^ { \top } \big ) \ldots \big ( \mathbf { I d } + A _ { 1 } ^ { \top } \big ) ,
|
| 152 |
+
$$
|
| 153 |
+
|
| 154 |
+
where $E = \left( \operatorname { I d } + A _ { \ell } \right) \ldots \left( \operatorname { I d } + A _ { 1 } \right) - R$ .
|
| 155 |
+
|
| 156 |
+
Now we are ready to prove Theorem 2.2. The key observation is that each matric $A _ { j }$ has small norm and cannot cancel the identity matrix. Therefore, the gradients in equation (2.5) is a product of non-zero matrices, except for the error matrix $E$ . Therefore, if the gradient vanishes, then the only possibility is that the matrix $E$ vanishes, which in turns implies $A$ is an optimal solution.
|
| 157 |
+
|
| 158 |
+
Proof of Theorem 2.2. Using Lemma 2.4, we have,
|
| 159 |
+
|
| 160 |
+
$$
|
| 161 |
+
\left\| \frac { \partial f } { \partial A _ { i } } \right\| _ { F } = 2 \left\| ( \mathbf { I d } + A _ { \ell } ^ { \top } ) \ldots ( \mathbf { I d } + A _ { i + 1 } ^ { \top } ) E \Sigma ( \mathbf { I d } + A _ { i - 1 } ^ { \top } ) \ldots ( \mathbf { I d } + A _ { 1 } ^ { \top } ) \right\| _ { F } \quad \mathrm { ( b y ~ L e m m a ~ 2 . 4 ) }
|
| 162 |
+
$$
|
| 163 |
+
|
| 164 |
+
It follows that
|
| 165 |
+
|
| 166 |
+
$$
|
| 167 |
+
\begin{array} { r l r } { { \| \nabla f ( A ) \| _ { F } ^ { 2 } = \sum _ { i = 1 } ^ { \ell } \| \frac { \partial f } { \partial A _ { i } } \| _ { F } ^ { 2 } \geq 4 \ell ( 1 - \tau ) ^ { \ell - 1 } \sigma _ { \operatorname* { m i n } } ( \Sigma ) ^ { 2 } \| E \| ^ { 2 } } } \\ & { } & { \geq 4 \ell ( 1 - \tau ) ^ { \ell - 1 } \sigma _ { \operatorname* { m i n } } ( \Sigma ) ^ { 2 } ( f ( A ) - C ) \qquad \mathrm { ( b y ~ t h e ~ d e f i n i t i o n ~ o f ~ } E \mathrm { ~ a n d ~ C l a i m ~ } 2 . 3 ) } \\ & { } & { \geq 4 \ell ( 1 - \tau ) ^ { \ell - 1 } \sigma _ { \operatorname* { m i n } } ( \Sigma ) ^ { 2 } ( f ( A ) - C _ { \operatorname* { m i n } } ) . \qquad . \qquad . \qquad . \qquad . \qquad . \qquad . } \end{array}
|
| 168 |
+
$$
|
| 169 |
+
|
| 170 |
+
Therefore we complete the proof of equation (2.3). Finally, if $A$ is a critical point, namely, $\nabla f ( A ) =$ 0, then by equation (2.3) we have that $f ( A ) = C _ { \mathrm { o p t } }$ . That is, $A$ is a global minimum.
|
| 171 |
+
|
| 172 |
+
# 3 REPRESENTATIONAL POWER OF THE RESIDUAL NETWORKS
|
| 173 |
+
|
| 174 |
+
In this section we characterize the finite-sample expressivity of residual networks. We consider a residual layers with a single ReLU activation and no batch normalization. The basic residual building block is a function $\mathcal { T } _ { U , V , s } ( \cdot ) : \mathbb { R } ^ { k } \to \mathbb { R } ^ { k }$ that is parameterized by two weight matrices $U \in \mathbb { R } ^ { \times k } , V \in \mathbb { R } ^ { k \times k }$ and a bias vector $s \in \mathbb { R } ^ { k }$ ,
|
| 175 |
+
|
| 176 |
+
$$
|
| 177 |
+
\begin{array} { r } { \mathcal { T } _ { U , V , s } ( h ) = V \mathrm { R e L u } ( U h + s ) . } \end{array}
|
| 178 |
+
$$
|
| 179 |
+
|
| 180 |
+
A residual network is composed of a sequence of such residual blocks. In comparison with the full pre-activation architecture in He et al. (2016), we remove two batch normalization layers and one ReLU layer in each building block.
|
| 181 |
+
|
| 182 |
+
We assume the data has $r$ labels, encoded as $r$ standard basis vectors in $\mathbb { R } ^ { r }$ , denoted by $e _ { 1 } , \ldots , e _ { r }$ . We have $n$ training examples $( x ^ { ( 1 ) } , y ^ { ( 1 ) } ) , \dots , ( x ^ { ( n ) } , y ^ { ( n ) } )$ , where $\boldsymbol { x } ^ { ( i ) } \in \mathbb { R } ^ { d }$ denotes the $i$ -th data and $y ^ { ( i ) } \in \{ e _ { 1 } , \ldots , e _ { r } \}$ denotes the $i$ -th label. Without loss of generality we assume the data are normalized so that $x ^ { ( i ) } = 1$ . We also make the mild assumption that no two data points are very close to each other.
|
| 183 |
+
|
| 184 |
+
Assumption 3.1. We assume that for every $1 \leq i < j \leq n$ , we have $\| x ^ { ( i ) } - x ^ { ( j ) } \| ^ { 2 } \geq \rho$ for some absolute constant $\rho > 0$ .
|
| 185 |
+
|
| 186 |
+
Images, for example, can always be imperceptibly perturbed in pixel space so as to satisfy this assumption for a small but constant $\rho$ .
|
| 187 |
+
|
| 188 |
+
Under this mild assumption, we prove that residual networks have the power to express any possible labeling of the data as long as the number of parameters is a logarithmic factor larger than $n$ .
|
| 189 |
+
|
| 190 |
+
Theorem 3.2. Suppose the training examples satisfy Assumption 3.1. Then, there exists a residual network $N$ (specified below) with ${ \bar { O } } ( n \log n + r ^ { 2 } )$ parameters that perfectly expresses the training data, i.e., for all $i \in \{ 1 , \ldots , n \}$ , the network $N$ maps $x ^ { ( i ) }$ to $\boldsymbol y ^ { ( i ) }$ .
|
| 191 |
+
|
| 192 |
+
It is common in practice that $n > r ^ { 2 }$ , as is for example the case for the Imagenet data set where $n > 1 0 ^ { 6 }$ and $r = 1 0 0 0$ .
|
| 193 |
+
|
| 194 |
+
We construct the following residual net using the building blocks of the form ${ \mathcal { T } } _ { U , V , s }$ as defined in equation (3.1). The network consists of $\ell + 1$ hidden layers $h _ { 0 } , \ldots , h _ { \ell }$ , and the output is denoted by $\hat { y } \in \mathbb { R } ^ { r }$ . The first layer of weights matrices $A _ { 0 }$ maps the $d$ -dimensional input to a $k$ -dimensional hidden variable $h _ { 0 }$ . Then we apply $\ell$ layers of building block $\tau$ with weight matrices $A _ { j } , B _ { j } \in \mathbb { R } ^ { k \times k }$ . Finally, we apply another layer to map the hidden variable $h _ { \ell }$ to the label $\hat { y }$ in $\mathbb { R } ^ { k }$ . Mathematically, we have
|
| 195 |
+
|
| 196 |
+
$$
|
| 197 |
+
\begin{array} { r l } & { h _ { 0 } = A _ { 0 } x , } \\ & { h _ { j } = h _ { j - 1 } + { \mathcal T } _ { A _ { j } , B _ { j } , b _ { j } } ( h _ { j - 1 } ) , \quad \forall j \in \{ 1 , \ldots , \ell \} } \\ & { \hat { y } = h _ { \ell } + { \mathcal T } _ { A _ { \ell + 1 } , B _ { \ell + 1 } , s _ { \ell + 1 } } ( h _ { \ell } ) . } \end{array}
|
| 198 |
+
$$
|
| 199 |
+
|
| 200 |
+
We note that here $A _ { \ell + 1 } \in \mathbb { R } ^ { k \times r }$ and $B _ { \ell + 1 } \in \mathbb { R } ^ { r \times r }$ so that the dimension is compatible. We assume the number of labels $r$ and the input dimension $d$ are both smaller than $n$ , which is safely true in practical applications.2 The hyperparameter $k$ will be chosen to be $O ( \log n )$ and the number of layers is chosen to be $\ell = [ \underline { { n } } / k ]$ . Thus, the first layer has $d k$ parameters, and each of the middle $\ell$ building blocks contains $2 k ^ { 2 }$ parameters and the final building block has $k r + r ^ { 2 }$ parameters. Hence, the total number of parameters is $O ( k d + \ell k ^ { 2 } + r k + r ^ { 2 } ) = O ( n \log n + r ^ { 2 } )$ .
|
| 201 |
+
|
| 202 |
+
Towards constructing the network $N$ of the form above that fits the data, we first take a random matrix $A _ { 0 } \in \mathbb { R } ^ { k \times d }$ that maps all the data points $x ^ { ( i ) }$ to vectors $h _ { 0 } ^ { ( i ) } : = A _ { 0 } x ^ { ( i ) }$ . Here we will use $h _ { j } ^ { ( i ) }$ to denote the $j$ -th layer of hidden variable of the $i$ -th example. By Johnson-Lindenstrauss Theorem (Johnson $\&$ Lindenstrauss (1984), or see Wikipedia (2016)), with good probability, the resulting vectors $h _ { 0 } ^ { ( i ) }$ ’s remain to satisfy Assumption 3.1 (with slightly different scaling and larger constant $\rho )$ , that is, any two vectors $h _ { 0 } ^ { ( i ) }$ and $h _ { 0 } ^ { ( j ) }$ are not very correlated.
|
| 203 |
+
|
| 204 |
+
Then we construct $\ell$ middle layers that maps $h _ { 0 } ^ { ( i ) }$ to $h _ { \ell } ^ { ( i ) }$ for every $i \in \{ 1 , \ldots , n \}$ . These vectors $h _ { \ell } ^ { ( i ) }$ will clustered into $r$ groups according to the labels, though they are in the $\mathbb { R } ^ { k }$ instead of in $\mathbb { R } ^ { r }$ as desired. Concretely, we design this cluster centers by picking $r$ random unit vectors $q _ { 1 } , \ldots , q _ { r }$ in $\mathbb { R } ^ { k }$ . We view them as the surrogate label vectors in dimension $k$ (note that $k$ is potentially much smaller than $r$ ). In high dimensions (technically, if $k > 4 \log r$ ) random unit vectors $q _ { 1 } , \ldots , q _ { r }$ are pair-wise uncorrelated with inner product less than $< 0 . 5$ . We associate the $i$ -th example with the target surrogate label vector $v ^ { ( i ) }$ defined as follows,
|
| 205 |
+
|
| 206 |
+
$$
|
| 207 |
+
\begin{array} { r } { \mathrm { ~ f ~ } y ^ { ( i ) } = e _ { j } , \operatorname { t h e n } v ^ { ( i ) } = q _ { j } . } \end{array}
|
| 208 |
+
$$
|
| 209 |
+
|
| 210 |
+
Then we will construct the matrices $( A _ { 1 } , B _ { 1 } ) , \ldots , ( A _ { \ell } , B _ { \ell } )$ such that the first $\ell$ layers of the network maps vector $h _ { 0 } ^ { ( i ) }$ to the surrogate label vector $v ^ { ( i ) }$ . Mathematically, we will construct $( A _ { 1 } , B _ { 1 } ) , \ldots , ( A _ { \ell } , B _ { \ell } )$ such that
|
| 211 |
+
|
| 212 |
+
$$
|
| 213 |
+
\forall i \in \{ 1 , \ldots , n \} , h _ { \ell } ^ { ( i ) } = v ^ { ( i ) } .
|
| 214 |
+
$$
|
| 215 |
+
|
| 216 |
+
Finally we will construct the last layer $\mathcal { T } _ { A _ { \ell + 1 } , B _ { \ell + 1 } , b _ { \ell + 1 } }$ so that it maps the vectors $q _ { 1 } , \ldots , q _ { r } \in \mathbb { R } ^ { k }$ to $e _ { 1 } , \ldots , e _ { r } \in \mathbb { R } ^ { r }$ ,
|
| 217 |
+
|
| 218 |
+
$$
|
| 219 |
+
\forall j \in \{ 1 , \ldots , r \} , q _ { j } + \mathcal { T } _ { A _ { \ell + 1 } , B _ { \ell + 1 } , b _ { \ell + 1 } } ( q _ { j } ) = e _ { j } .
|
| 220 |
+
$$
|
| 221 |
+
|
| 222 |
+
Putting these together, we have that by the definition (3.2) and equation (3.3), for every $i$ , if the label is $\boldsymbol y ^ { ( i ) }$ is $e _ { j }$ , then $h _ { \ell } ^ { ( i ) }$ will be $q _ { j }$ . Then by equation (3.4), we have that $\begin{array} { r l } { \hat { y } ^ { ( i ) } } & { { } = } \end{array}$ $q _ { j } + \mathcal { T } _ { A _ { \ell + 1 } , B _ { \ell + 1 } , b _ { \ell + 1 } } ( q _ { j } ) = e _ { j }$ . Hence we obtain that $\hat { y } ^ { ( i ) } = y ^ { ( i ) }$ .
|
| 223 |
+
|
| 224 |
+
The key part of this plan is the construction of the middle $\ell$ layers of weight matrices so that $h _ { \ell } ^ { ( i ) } =$ $v ^ { ( i ) }$ . We encapsulate this into the following informal lemma. The formal statement and the full proof is deferred to Section B.
|
| 225 |
+
|
| 226 |
+
Lemma 3.3 (Informal version of Lemma B.2). In the setting above, for (almost) arbitrary vectors $h _ { 0 } ^ { ( 1 ) } , \ldots , h _ { 0 } ^ { ( n ) }$ and $v ^ { ( 1 ) } , \ldots , v ^ { ( n ) } \in \{ q _ { 1 } , \ldots , q _ { r } \}$ , there exists weights matrices $( A _ { 1 } , B _ { 1 } ) , \ldots , ( \bar { A } _ { \ell } , B _ { \ell } )$ , such that,
|
| 227 |
+
|
| 228 |
+
$$
|
| 229 |
+
\forall i \in \{ 1 , \ldots , n \} , h _ { \ell } ^ { ( i ) } = v ^ { ( i ) } .
|
| 230 |
+
$$
|
| 231 |
+
|
| 232 |
+
We briefly sketch the proof of the Lemma to provide intuitions, and defer the full proof to Section B. The operation that each residual block applies to the hidden variable can be abstractly written as,
|
| 233 |
+
|
| 234 |
+
$$
|
| 235 |
+
\hat { h } \to h + { \mathcal { T } } _ { U , V , s } ( h ) .
|
| 236 |
+
$$
|
| 237 |
+
|
| 238 |
+
where $h$ corresponds to the hidden variable before the block and $\hat { h }$ corresponds to that after. We claim that for an (almost) arbitrary sequence of vectors ${ { h } ^ { ( 1 ) } } , \ldots , { { h } ^ { ( n ) } }$ , there exist $\mathcal { T } _ { U , V , s } ( \cdot )$ such that operation (3.5) transforms $k$ vectors of $\it { { h ^ { ( i ) } } }$ ’s to an arbitrary set of other $k$ vectors that we can freely choose, and maintain the value of the rest of $n - k$ vectors. Concretely, for any subset $S$ of size $k$ , and any desired vector $v ^ { ( i ) } ( i \in S )$ , there exist $U , V , s$ such that
|
| 239 |
+
|
| 240 |
+
$$
|
| 241 |
+
\begin{array} { r } { \boldsymbol { v } ^ { ( i ) } = \boldsymbol { h } ^ { ( i ) } + \mathcal { T } _ { U , V , s } ( \boldsymbol { h } ^ { ( i ) } ) ~ \forall i \in S } \\ { \boldsymbol { h } ^ { ( i ) } = \boldsymbol { h } ^ { ( i ) } + \mathcal { T } _ { U , V , s } ( \boldsymbol { h } ^ { ( i ) } ) ~ \forall i \notin S } \end{array}
|
| 242 |
+
$$
|
| 243 |
+
|
| 244 |
+
This claim is formalized in Lemma B.1. We can use it repeatedly to construct $\ell$ layers of building blocks, each of which transforms a subset of $k$ vectors in $\{ h _ { 0 } ^ { ( 1 ) } , \ldots , h _ { 0 } ^ { ( n ) } \}$ to the corresponding vectors in $\{ v ^ { ( 1 ) } , \ldots , v ^ { ( n ) } \}$ , and maintains the values of the others. Recall that we have $\ell = \lceil n / k \rceil$ layers and therefore after $\ell$ layers, all the vectors $h _ { 0 } ^ { ( i ) }$ ’s are transformed to $v ^ { ( i ) }$ ’s, which complete the proof sketch. □
|
| 245 |
+
|
| 246 |
+
# 4 POWER OF ALL-CONVOLUTIONAL RESIDUAL NETWORKS
|
| 247 |
+
|
| 248 |
+
Inspired by our theory, we experimented with all-convolutional residual networks on standard image classification benchmarks.
|
| 249 |
+
|
| 250 |
+
# 4.1 CIFAR10 AND CIFAR100
|
| 251 |
+
|
| 252 |
+
Our architectures for CIFAR10 and CIFAR100 are identical except for the final dimension corresponding to the number of classes 10 and 100, respectively. In Table 1, we outline our architecture. Each residual block has the form $x + C _ { 2 } ( \mathrm { R e L U } ( C _ { 1 } x ) )$ , where $C _ { 1 } , C _ { 2 }$ are convolutions of the specified dimension (kernel width, kernel height, number of input channels, number of output channels). The second convolution in each block always has stride 1, while the first may have stride 2 where indicated. In cases where transformation is not dimensionality-preserving, the original input $x$ is adjusted using averaging pooling and padding as is standard in residual layers.
|
| 253 |
+
|
| 254 |
+
We trained our models with the Tensorflow framework, using a momentum optimizer with momen$\mathrm { t u m ~ 0 . 9 }$ , and batch size is 128. All convolutional weights are trained with weight decay 0.0001. The initial learning rate is 0.05, which drops by a factor 10 and 30000 and 50000 steps. The model reaches peak performance at around $5 0 k$ steps, which takes about $2 4 h$ on a single NVIDIA Tesla K40 GPU. Our code can be easily derived from an open source implementation3 by removing batch normalization, adjusting the residual components and model architecture. An important departure from the code is that we initialize a residual convolutional layer of kernel size $k \times k$ and $c$ output channels using a random normal initializer of standard deviation $\sigma = 1 / k ^ { 2 } c$ , rather than $1 / k { \sqrt { c } }$ used for standard convolutional layers. This substantially smaller weight initialization helped training, while not affecting representation.
|
| 255 |
+
|
| 256 |
+
A notable difference from standard models is that the last layer is not trained, but simply a fixed random projection. On the one hand, this slightly improved test error (perhaps due to a regularizing effect). On the other hand, it means that the only trainable weights in our model are those of the convolutions, making our architecture “all-convolutional”.
|
| 257 |
+
|
| 258 |
+
Table 1: Architecture for CIFAR10/100 (55 convolutions, 13.5M parameters)
|
| 259 |
+
|
| 260 |
+
<table><tr><td>variabledimensions</td><td>initial stride</td><td>description</td></tr><tr><td>3×3×3×16 3×3×16×64</td><td>1</td><td>1 standard conv</td></tr><tr><td rowspan="3">3×3×64×128 3×3×128×256</td><td>1</td><td>9 residual blocks</td></tr><tr><td>2</td><td>9 residual blocks</td></tr><tr><td>2</td><td>9 residual blocks</td></tr><tr><td rowspan="2">256 × num_classes</td><td></td><td>8 × 8 global average pool</td></tr><tr><td></td><td>random projection (not trained)</td></tr></table>
|
| 261 |
+
|
| 262 |
+

|
| 263 |
+
Figure 1: Convergence plots of best model for CIFAR10 (left) and CIFAR (100) right. One step is a gradient update with batch size 128.
|
| 264 |
+
|
| 265 |
+
An interesting aspect of our model is that despite its massive size of 13.59 million trainable parameters, the model does not seem to overfit too quickly even though the data set size is 50000. In contrast, we found it difficult to train a model with batch normalization of this size without significant overfitting on CIFAR10.
|
| 266 |
+
|
| 267 |
+
Table 2 summarizes the top-1 classification error of our models compared with a non-exhaustive list of previous works, restricted to the best previous all-convolutional result by Springenberg et al. (2014), the first residual results He et al. (2015), and state-of-the-art results on CIFAR by Huang et al. (2016). All results are with standard data augmentation.
|
| 268 |
+
|
| 269 |
+
Table 2: Comparison of top-1 classification error on different benchmarks
|
| 270 |
+
|
| 271 |
+
<table><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>CIFAR10</td><td rowspan=1 colspan=1>CIFAR100</td><td rowspan=1 colspan=1>ImageNet</td><td rowspan=1 colspan=1>remarks</td></tr><tr><td rowspan=1 colspan=1>All-CNN</td><td rowspan=1 colspan=1>7.25</td><td rowspan=1 colspan=1>32.39</td><td rowspan=1 colspan=1>41.2</td><td rowspan=1 colspan=1> all-convolutional, dropout, extra data processing</td></tr><tr><td rowspan=1 colspan=1>Ours</td><td rowspan=1 colspan=1>6.38</td><td rowspan=1 colspan=1>24.64</td><td rowspan=1 colspan=1>35.29</td><td rowspan=1 colspan=1>all-convolutional</td></tr><tr><td rowspan=1 colspan=1>ResNet</td><td rowspan=1 colspan=1>6.43</td><td rowspan=1 colspan=1>25.16</td><td rowspan=1 colspan=1>19.38</td><td></td></tr><tr><td rowspan=1 colspan=1>DenseNet</td><td rowspan=1 colspan=1>3.74</td><td rowspan=1 colspan=1>19.25</td><td rowspan=1 colspan=1>N/A</td><td></td></tr></table>
|
| 272 |
+
|
| 273 |
+
# 4.2 IMAGENET
|
| 274 |
+
|
| 275 |
+
The ImageNet ILSVRC 2012 data set has 1, 281, 167 data points with 1000 classes. Each image is resized to $2 2 4 \times 2 2 4$ pixels with 3 channels. We experimented with an all-convolutional variant of the 34-layer network in He et al. (2015). The original model achieved $2 5 . 0 3 \%$ classification error. Our derived model has $3 5 . 7 M$ trainable parameters. We trained the model with a momentum optimizer (with momentum 0.9) and a learning rate schedule that decays by a factor of 0.94 every two epochs, starting from the initial learning rate 0.1. Training was distributed across 6 machines updating asynchronously. Each machine was equipped with 8 GPUs (NVIDIA Tesla K40) and used batch size 256 split across the 8 GPUs so that each GPU updated with batches of size 32.
|
| 276 |
+
|
| 277 |
+
In contrast to the situation with CIFAR10 and CIFAR100, on ImageNet our all-convolutional model performed significantly worse than its original counterpart. Specifically, we experienced a significant amount of underfitting suggesting that a larger model would likely perform better.
|
| 278 |
+
|
| 279 |
+
Despite this issue, our model still reached $3 5 . 2 9 \%$ top-1 classification error on the test set (50000 data points), and $1 4 . 1 7 \%$ top-5 test error after 700, 000 steps (about one week of training). While no longer state-of-the-art, this performance is significantly better than the $4 0 . 7 \%$ reported by Krizhevsky et al. (2012), as well as the best all-convolutional architecture by Springenberg et al. (2014). We believe it is quite likely that a better learning rate schedule and hyperparameter settings of our model could substantially improve on the preliminary performance reported here.
|
| 280 |
+
|
| 281 |
+
# 5 CONCLUSION
|
| 282 |
+
|
| 283 |
+
Our theory underlines the importance of identity parameterizations when training deep artificial neural networks. An outstanding open problem is to extend our optimization result to the non-linear case where each residual has a single ReLU activiation as in our expressivity result. We conjecture that a result analogous to Theorem 2.2 is true for the general non-linear case. Unlike with the standard parameterization, we see no fundamental obstacle for such a result.
|
| 284 |
+
|
| 285 |
+
We hope our theory and experiments together help simplify the state of deep learning by aiming to explain its success with a few fundamental principles, rather than a multitude of tricks that need to be delicately combined. We believe that much of the advances in image recognition can be achieved with residual convolutional layers and ReLU activations alone. This could lead to extremely simple (albeit deep) architectures that match the state-of-the-art on all image classification benchmarks.
|
| 286 |
+
|
| 287 |
+
# REFERENCES
|
| 288 |
+
|
| 289 |
+
Antonio Auffinger, Gerard Ben Arous, and Ji ´ ˇr´ı Cern ˇ y. Random matrices and complexity of spin \` glasses. Communications on Pure and Applied Mathematics, 66(2):165–201, 2013.
|
| 290 |
+
|
| 291 |
+
P. Baldi and K. Hornik. Neural networks and principal component analysis: Learning from examples without local minima. Neural Netw., 2(1):53–58, January 1989. ISSN 0893-6080. doi: 10. 1016/0893-6080(89)90014-2. URL http://dx.doi.org/10.1016/0893-6080(89) 90014-2.
|
| 292 |
+
|
| 293 |
+
Anna Choromanska, Mikael Henaff, Michael Mathieu, Gerard Ben Arous, and Yann LeCun. The ´ loss surfaces of multilayer networks. In AISTATS, 2015.
|
| 294 |
+
|
| 295 |
+
Yann N Dauphin, Razvan Pascanu, Caglar Gulcehre, Kyunghyun Cho, Surya Ganguli, and Yoshua Bengio. Identifying and attacking the saddle point problem in high-dimensional non-convex optimization. In Advances in neural information processing systems, pp. 2933–2941, 2014.
|
| 296 |
+
|
| 297 |
+
I. J. Goodfellow, O. Vinyals, and A. M. Saxe. Qualitatively characterizing neural network optimization problems. ArXiv e-prints, December 2014.
|
| 298 |
+
|
| 299 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In arXiv prepring arXiv:1506.01497, 2015.
|
| 300 |
+
|
| 301 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In Computer Vision - ECCV 2016 - 14th European Conference, Amsterdam, The Netherlands, October 11-14, 2016, Proceedings, Part IV, pp. 630–645, 2016. doi: 10.1007/ 978-3-319-46493-0 38. URL http://dx.doi.org/10.1007/978-3-319-46493-0_ 38.
|
| 302 |
+
|
| 303 |
+
Gao Huang, Zhuang Liu, and Kilian Q. Weinberger. Densely connected convolutional networks. CoRR, abs/1608.06993, 2016. URL http://arxiv.org/abs/1608.06993.
|
| 304 |
+
|
| 305 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, pp. 448–456, 2015. URL http://jmlr. org/proceedings/papers/v37/ioffe15.html.
|
| 306 |
+
|
| 307 |
+
William B Johnson and Joram Lindenstrauss. Extensions of lipschitz mappings into a hilbert space. Contemporary mathematics, 26(189-206):1, 1984.
|
| 308 |
+
|
| 309 |
+
H. Karimi, J. Nutini, and M. Schmidt. Linear Convergence of Gradient and Proximal-Gradient Methods Under the Polyak- $\langle { \mathrm { L } } \{ \}$ ojasiewicz Condition. ArXiv e-prints, August 2016.
|
| 310 |
+
|
| 311 |
+
K. Kawaguchi. Deep Learning without Poor Local Minima. ArXiv e-prints, May 2016.
|
| 312 |
+
|
| 313 |
+
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.
|
| 314 |
+
|
| 315 |
+
D. Soudry and Y. Carmon. No bad local minima: Data independent training error guarantees for multilayer neural networks. ArXiv e-prints, May 2016.
|
| 316 |
+
|
| 317 |
+
J. T. Springenberg, A. Dosovitskiy, T. Brox, and M. Riedmiller. Striving for Simplicity: The All Convolutional Net. ArXiv e-prints, December 2014.
|
| 318 |
+
|
| 319 |
+
Eric W. Weisstein. Normal matrix, from mathworld–a wolfram web resource., 2016. URL http: //mathworld.wolfram.com/NormalMatrix.html.
|
| 320 |
+
|
| 321 |
+
Wikipedia. Johnsonlindenstrauss lemma — wikipedia, the free encyclopedia, 2016. URL https://en.wikipedia.org/w/index.php?title $=$ Johnson%E2%80% 93Lindenstrauss_lemma&oldid $= ^ { \star }$ 743553642.
|
| 322 |
+
|
| 323 |
+
# A MISSING PROOFS IN SECTION 2
|
| 324 |
+
|
| 325 |
+
In this section, we give the complete proofs for Theorem 2.1 and Lemma 2.4, which are omitted in Section 2.
|
| 326 |
+
|
| 327 |
+
# A.1 PROOF OF THEOREM 2.1
|
| 328 |
+
|
| 329 |
+
It turns out the proof will be significantly easier if $R$ is assumed to be a symmetric positive semidefinite (PSD) matrix, or if we allow the variables to be complex matrices. Here we first give a proof sketch for the first special case. The readers can skip it and jumps to the full proof below. We will also prove stronger results, namely, $\| A ^ { \star } \| \le 3 \gamma / \ell$ , for the special case.
|
| 330 |
+
|
| 331 |
+
When $R$ is PSD, it can be diagonalized by orthonormal matrix $U$ in the sense that $R = U Z U ^ { \top }$ , where $Z = \operatorname { d i a g } ( z _ { 1 } , \ldots , z _ { d } )$ is a diagonal matrix with non-negative diagonal entries $z _ { 1 } , \ldots , z _ { d }$ . Let $A _ { 1 } ^ { \star } = \dots = A _ { \ell } ^ { \star } = U \mathrm { d i a g } ( z _ { i } ^ { 1 / \ell } ) U ^ { \top } - \mathrm { I d }$ , then we have
|
| 332 |
+
|
| 333 |
+
$$
|
| 334 |
+
\begin{array} { r l } & { ( \mathrm { I d } + A _ { \ell } ^ { \star } ) \cdot \cdot \cdot ( \mathrm { I d } + A _ { 1 } ^ { \star } ) = ( U \mathrm { d i a g } ( z _ { i } ^ { 1 / \ell } ) U ^ { \top } ) ^ { \ell } = U \mathrm { d i a g } ( z _ { i } ^ { 1 / \ell } ) ^ { \ell } U \qquad \quad ( \mathrm { s i n c e ~ } U ^ { \top } U = \mathrm { I d } ) } \\ & { \qquad = U Z U ^ { \top } = R . } \end{array}
|
| 335 |
+
$$
|
| 336 |
+
|
| 337 |
+
We see that the network defined by $A ^ { \star }$ reconstruct the transformation $R$ , and therefore it’s a global minimum of the population risk (formally see Claim 2.3 below). Next, we verify that each of the $A _ { j } ^ { \star }$ has small spectral norm:
|
| 338 |
+
|
| 339 |
+
$$
|
| 340 |
+
\begin{array} { r l r } { { \| A _ { j } ^ { \star } \| = \| \mathrm { I d } - U \mathrm { d i a g } ( z _ { i } ^ { 1 / \ell } ) U ^ { \top } ) \| = \| U ( \mathrm { I d } - \mathrm { d i a g } ( z _ { i } ) ^ { 1 / \ell } ) U ^ { \top } \| = \| \mathrm { I d } - \mathrm { d i a g } ( z _ { i } ) ^ { 1 / \ell } \| } } \\ & { } & { \mathrm { ( s i n c e ~ } U \mathrm { ~ i s ~ o r t h o n o n ~ } \mathrm { ~ } \quad } \\ & { } & { \mathrm { ~ } = \operatorname* { m a x } _ { i } | z _ { i } ^ { 1 / \ell } - 1 | . } \end{array}
|
| 341 |
+
$$
|
| 342 |
+
|
| 343 |
+
rmal)
|
| 344 |
+
|
| 345 |
+
Since $\sigma _ { \operatorname* { m i n } } ( R ) \leq z _ { i } \leq \sigma _ { \operatorname* { m a x } } ( R )$ , we have $\ell \geq 3 \gamma \geq | \log z _ { i } |$ . It follows that
|
| 346 |
+
|
| 347 |
+
$$
|
| 348 |
+
| z _ { i } ^ { 1 / \ell } - 1 | = | e ^ { ( \log z _ { i } ) / \ell } - 1 | \leq 3 | ( \log z _ { i } ) / \ell | \leq 3 \gamma / \ell . \quad \mathrm { ( s i n c e ~ } | e ^ { x } - 1 | \leq 3 | x | \mathrm { ~ f ~ e ~ r ~ , ~ }
|
| 349 |
+
$$
|
| 350 |
+
|
| 351 |
+
Then using equation (A.1) and the equation above, we have that $\| A \| \leq \operatorname* { m a x } _ { j } \| A _ { j } ^ { \star } \| \leq 3 \gamma / \ell$ , which completes the proof for the special case.
|
| 352 |
+
|
| 353 |
+
Next we give the formal full proof of Theorem 2.1.
|
| 354 |
+
|
| 355 |
+
Proof of Theorem 2.1. We assume the dimension $d$ is an even number. The odd case has very similar proof and is left to the readers. Let $R = U K V ^ { \top }$ be its singular value decomposition, where $U , V$ are two orthonormal matrices and $K$ is a diagonal matrix. Since $U$ is a normal matrix (that is, $U$ satisfies that $U U ^ { \top } = U ^ { \top } U )$ , by Claim C.1, we have that $U$ can be block-diagnolaized by orthonormal matrix $S$ into $U = S D S ^ { - 1 }$ , where $D = \operatorname { d i a g } ( D _ { 1 } , \dots , D _ { d / 2 } )$ is a real block diagonal matrix with each block $D _ { i }$ being of size $2 \times 2$ .
|
| 356 |
+
|
| 357 |
+
Since $U$ is orthonormal, $U$ has all its eigenvalues lying on the unit circle (in complex plane). Since $D$ and $U$ are unitarily similar to each other, $D$ also has eigenvalues lying on the unit circle, and so does each of the block $D _ { i }$ . This means that each $D _ { i }$ is a $2 \times 2$ dimensional rotation matrix. Each rotation matrix can be written as $T ( \theta ) = \left[ \sin \theta \quad - \sin \theta \right]$ . Suppose $D _ { i } = T ( \theta _ { i } )$ where $\theta _ { i } \in [ - \pi , \pi ]$ . Then we have that $D _ { i } = T ( \theta _ { i } / q ) ^ { q }$ for any integer $q$ (that is chosen later). Let $W = \mathrm { d i a g } ( T ( \theta _ { i } / q ) )$ . Therefore, it follows that $D = \mathrm { d i a g } ( D _ { i } ) = W ^ { q }$ . Moreover, we have $U = S D S ^ { - 1 } = ( \dot { S } W \dot { S } ^ { - \bar { 1 } } ) ^ { q }$ . Therefore, let $B _ { 1 } = B _ { 2 } = \cdot \cdot \cdot = B _ { q } = \operatorname { I d } - S W S ^ { - 1 }$ , then we have $U = ( \operatorname { I d } + B _ { q } ) \dots ( \operatorname { I d } + B _ { 1 } )$ . We verify the spectral norm of these matrices are indeed small,
|
| 358 |
+
|
| 359 |
+
$$
|
| 360 |
+
\begin{array} { r l r } { { \| B _ { j } \| = \| \mathrm { I d } - S W S ^ { - 1 } \| = \| S ( \mathrm { I d } - W ) S ^ { - 1 } \| } } \\ & { } & { = \| \mathrm { I d } - W \| } \\ & { } & { = \underset { i \in [ d / 2 ] } { \operatorname* { m a x } } \| T ( 0 ) - T ( \theta _ { i } / q ) \| \qquad \mathrm { ( s i n c e ~ } W = \mathrm { d i a g } ( T ( \theta _ { i } / q ) \mathrm { ) } \mathrm { i } } \\ & { } & { = \operatorname* { m a x } | \mathrm { s i n } ( \theta _ { i } / q ) | \leq \pi / q . } \end{array}
|
| 361 |
+
$$
|
| 362 |
+
|
| 363 |
+
Similarly, we can choose $B _ { 1 } ^ { \prime } , \ldots , B _ { q } ^ { \prime }$ with $\| C _ { j } \| \le \pi / q$ so that $V ^ { \top } = \left( \operatorname { I d } + B _ { q } ^ { \prime } \right) \ldots \left( \operatorname { I d } + B _ { 1 } ^ { \prime } \right)$
|
| 364 |
+
|
| 365 |
+
Last, we deal with the diagonal matrix $K$ . Let $\begin{array} { r c l } { K } & { = } & { \mathrm { d i a g } ( k _ { i } ) } \end{array}$ . We have $\begin{array} { r l } { \operatorname* { m i n } k _ { i } } & { { } = } \end{array}$ $\sigma _ { \operatorname* { m i n } } ( R ) , \operatorname* { m a x } k _ { i } = \sigma _ { \operatorname* { m a x } } ( R )$ . Then, we can write $K = ( K ^ { \prime } ) ^ { p }$ where $K ^ { \prime } = \mathrm { d i a g } ( k _ { i } ^ { 1 / p } )$ and $p$ is an integer to be chosen later. We have that $\lVert K ^ { \prime } - \mathbf { I d } \rVert \leq \operatorname* { m a x } | k _ { i } ^ { 1 / p } - 1 | \leq \operatorname* { m a x } | e ^ { \log k _ { i } \cdot 1 / p } - 1 | .$ . When $p \geq \gamma = \operatorname* { m a x } \{ \log \operatorname* { m a x } k _ { i } , - \log \operatorname* { m i n } k _ { i } \} = \operatorname* { m a x } \{ \log \sigma _ { \operatorname* { m a x } } ( R ) , - \log \sigma _ { \operatorname* { m i n } } ( R ) \}$ , we have that
|
| 366 |
+
|
| 367 |
+
$$
|
| 368 |
+
\begin{array} { r } { \| K ^ { \prime } - \mathbf { I d } \| \leq \operatorname* { m a x } \left| e ^ { \log k _ { i } \cdot 1 / p } - 1 \right| \leq 3 \operatorname* { m a x } \left| \log k _ { i } \cdot 1 / p \right| = 3 \gamma / p . } \end{array}
|
| 369 |
+
$$
|
| 370 |
+
|
| 371 |
+
Let $B _ { 1 } ^ { \prime \prime } = \cdot \cdot \cdot = B _ { p } ^ { \prime \prime } = K ^ { \prime } - \mathrm { I d }$ and then we have $K = ( { \mathrm { I d } } + B _ { p } ^ { \prime \prime } ) \cdot \cdot \cdot ( { \mathrm { I d } } + B _ { 1 } ^ { \prime \prime } )$ . Finally, we choose p = \` 3γ2(√π+√3γ) and $\begin{array} { r } { q = \frac { \ell \sqrt { \pi } } { \sqrt { \pi } + \sqrt { 3 \gamma } } } \end{array}$ , 4and let $A _ { 2 p + q } = B _ { q } , \cdot \cdot \cdot = A _ { p + q + 1 } = B _ { 1 } , A _ { p + q } =$ $B _ { p } ^ { \prime \prime } , \cdot \cdot \cdot , A _ { q + 1 } = B _ { 1 } ^ { \prime \prime } , A _ { q } = B _ { q } ^ { \prime } , \cdot \cdot \cdot , A _ { 1 } = B _ { 1 } ^ { \prime }$ . We have that $2 q + \ell = 1$ and
|
| 372 |
+
|
| 373 |
+
$$
|
| 374 |
+
R = U K V ^ { \top } = \left( \mathbf { I d } + A _ { \ell } \right) \ldots \left( \mathbf { I d } + A _ { 1 } \right) .
|
| 375 |
+
$$
|
| 376 |
+
|
| 377 |
+
Moreover, we have $\| A \| \le \operatorname* { m a x } \{ \| B _ { j } \| , \| B _ { j } ^ { \prime } \| . \| B _ { j } ^ { \prime \prime } \| \} \le \pi / q + 3 \gamma / p \le 2 ( \sqrt \pi + \sqrt { 3 \gamma } ) ^ { 2 } / \ell ,$ as desired.
|
| 378 |
+
|
| 379 |
+
# A.2 PROOF OF LEMMA 2.4
|
| 380 |
+
|
| 381 |
+
We compute the partial gradients by definition. Let $\Delta _ { j } \in \mathbb { R } ^ { d \times d }$ be an infinitesimal change to $A _ { j }$ . Using Claim 2.3, consider the Taylor expansion of $f ( \bar { A _ { 1 } } , \ldots , A _ { \ell } + \Delta _ { j } , \ldots , A _ { \ell } )$
|
| 382 |
+
|
| 383 |
+
$$
|
| 384 |
+
\begin{array} { r l } & { f ( A _ { 1 } , \ldots , A _ { \ell } + \Delta _ { j } , \ldots , A _ { \ell } ) } \\ & { = \left\| \big ( ( \mathbf { I d } + A _ { \ell } ) \cdots ( \mathbf { I d } + A _ { j } + \Delta _ { j } ) \ldots ( \mathbf { I d } + A _ { 1 } ) - R ) \Sigma ^ { 1 / 2 } \right\| _ { F } ^ { 2 } } \\ & { = \Big \| \big ( ( \mathbf { I d } + A _ { \ell } ) \cdot \cdot ( \mathbf { I d } + A _ { 1 } ) - R ) \Sigma ^ { 1 / 2 } + ( \mathbf { I d } + A _ { \ell } ) \cdot \cdot \cdot \Delta _ { j } \ldots ( \mathbf { I d } + A _ { 1 } ) \Sigma ^ { 1 / 2 } \Big \| _ { F } ^ { 2 } } \\ & { = \Big \| \big ( \mathbf { I d } + A _ { \ell } ) \cdot \cdot ( \mathbf { I d } + A _ { 1 } ) - R ) \Sigma ^ { 1 / 2 } \Big \| _ { F } ^ { 2 } + } \\ & { \quad 2 \langle ( ( \mathbf { I d } + A _ { \ell } ) \cdot \cdot ( \mathbf { I d } + A _ { 1 } ) - R ) \Sigma ^ { 1 / 2 } , ( \mathbf { I d } + A _ { \ell } ) \cdot \cdot \Delta _ { j } \ldots ( \mathbf { I d } + A _ { 1 } ) \Sigma ^ { 1 / 2 } \rangle + O ( \| \Delta _ { j } \| _ { F } ^ { 2 } ) } \\ & { = f ( A ) + 2 \langle ( \mathbf { I d } + A _ { \ell } ^ { \top } ) \ldots ( \mathbf { I d } + A _ { j + 1 } ^ { \top } ) E \Sigma ( \mathbf { I d } + A _ { j - 1 } ^ { \top } ) \ldots ( \mathbf { I d } + A _ { 1 } ^ { \top } ) , \Delta _ { j } \rangle + O ( \| \Delta _ { j } \| _ { F } ^ { 2 } ) . } \end{array}
|
| 385 |
+
$$
|
| 386 |
+
|
| 387 |
+
By definition, this means that the $\begin{array} { r } { \frac { \partial f } { \partial A _ { j } } \ = \ 2 \big ( \mathbf { I d } + A _ { \ell } ^ { \top } \big ) \ldots \big ( \mathbf { I d } + A _ { j + 1 } ^ { \top } \big ) E \Sigma \big ( \mathbf { I d } + A _ { j - 1 } ^ { \top } \big ) \ldots \big ( \mathbf { I d } + } \end{array}$ $A _ { 1 } ^ { \top }$ ).
|
| 388 |
+
|
| 389 |
+
# B MISSING PROOFS IN SECTION 3
|
| 390 |
+
|
| 391 |
+
In this section, we provide the full proof of Theorem 3.2. We start with the following Lemma that constructs a building block $\tau$ that transform $k$ vectors of an arbitrary sequence of $n$ vectors to any arbitrary set of vectors, and main the value of the others. For better abstraction we use $\alpha ^ { ( i ) } , \beta ^ { ( i ) }$ to denote the sequence of vectors.
|
| 392 |
+
|
| 393 |
+
Lemma B.1. Let $S \subset [ n ]$ be of size $k$ . Suppose $\alpha ^ { ( 1 ) } , \ldots , \alpha ^ { ( n ) }$ is a sequences of $n$ vectors satisfying a) for every $1 \leq i \leq n$ , we have $1 - \rho ^ { \prime } \leq \| \alpha _ { i } \| ^ { 2 } \leq 1 + \rho ^ { \prime }$ , and $^ b$ ) if $\because j \neq j$ and $S$ contains at least one of $i , j$ , then $\| \alpha ^ { ( i ) } - \beta ^ { ( j ) } \| \ge 3 \rho ^ { \prime }$ . Let $\beta ^ { ( 1 ) } , \ldots , \beta ^ { ( n ) }$ be an arbitrary sequence of vectors. Then, there exists $U , V \in \mathbb { R } ^ { k \times k } , .$ s such that for every $i \in S$ , we have $\mathcal { T } _ { U , V , s } \big ( \alpha ^ { ( i ) } \big ) = \beta ^ { ( i ) } - \alpha ^ { ( i ) }$ , and moreover, for every $i \in [ n ] \backslash S$ we have $\mathcal { T } _ { U , V , s } ( \alpha ^ { ( i ) } ) = 0$ .
|
| 394 |
+
|
| 395 |
+
We can see that the conclusion implies
|
| 396 |
+
|
| 397 |
+
$$
|
| 398 |
+
\begin{array} { r } { \beta ^ { ( i ) } = \alpha ^ { ( i ) } + \mathcal { T } _ { U , V , s } ( \alpha ^ { ( i ) } ) ~ \forall i \in S } \\ { \alpha ^ { ( i ) } = \alpha ^ { ( i ) } + \mathcal { T } _ { U , V , s } ( \alpha ^ { ( i ) } ) ~ \forall i \notin S } \end{array}
|
| 399 |
+
$$
|
| 400 |
+
|
| 401 |
+
which is a different way of writing equation (3.6).
|
| 402 |
+
|
| 403 |
+
Proof of Lemma B.1. Without loss of generality, suppose $S = \{ 1 , \ldots , k \}$ . We construct $U , V , s$ as follows. Let the $i$ -th row of $U$ be $\alpha ^ { ( i ) }$ for $i \in [ k ]$ , and let $s = - ( 1 - 2 \rho ^ { \prime } ) \cdot { \bf 1 }$ where 1 denotes the all 1’s vector. Let the $i$ -column of $V$ be $\begin{array} { r } { \frac { 1 } { \| \alpha ^ { ( i ) } \| ^ { 2 } - ( 1 - 2 \rho ^ { \prime } ) } \big ( \beta ^ { ( i ) } - \alpha ^ { ( i ) } \big ) } \end{array}$ for $i \in [ k ]$ .
|
| 404 |
+
|
| 405 |
+
Next we verify that the correctness of the construction. We first consider $1 \leq i \leq k$ . We have that $U \alpha ^ { ( i ) }$ is a a vector with $i$ -th coordinate equal to $\| \alpha ^ { ( i ) } \| ^ { 2 } \ge 1 - \rho ^ { \prime }$ . The $j$ -th coordinate of $U \alpha ^ { ( i ) }$ is equal to $\langle \alpha ^ { ( j ) } , \alpha ^ { ( i ) } \rangle$ , which can be upperbounded using the assumption of the Lemma by
|
| 406 |
+
|
| 407 |
+
$$
|
| 408 |
+
\langle \alpha ^ { ( j ) } , \alpha ^ { ( i ) } \rangle = \frac { 1 } { 2 } \left( \| \alpha ^ { ( i ) } \| ^ { 2 } + \| \alpha ^ { ( j ) } \| ^ { 2 } \right) - \| \alpha ^ { ( i ) } - \alpha ^ { ( j ) } \| ^ { 2 } \le 1 + \rho ^ { \prime } - 3 \rho ^ { \prime } \le 1 - 2 \rho ^ { \prime } .
|
| 409 |
+
$$
|
| 410 |
+
|
| 411 |
+
Therefore, this means $U \alpha ^ { ( i ) } \ : - \ : ( 1 \ : - \ : 2 \rho ^ { \prime } )$ · 1contains a single positive entry (with value at least $\| { \boldsymbol { \alpha } } ^ { ( i ) } \| ^ { 2 } - ( 1 - 2 \rho ^ { \prime } ) \geq \rho ^ { \prime } )$ , and all other entries being non-positive. This means that $\mathrm { R e L u } ( U \alpha ^ { ( i ) } + b ) = \left( \| \alpha ^ { ( i ) } \| ^ { 2 } - ( 1 - 2 \rho ^ { \prime } ) \right) e _ { i }$ where $e _ { i }$ is the $i$ -th natural basis vector. It follows that $V \mathrm { R e L u } ( U \alpha ^ { ( i ) } + b ) = ( \| \alpha ^ { ( i ) } \| ^ { 2 } - ( 1 - 2 \rho ^ { \prime } ) ) V e _ { i } = \beta ^ { ( i ) } - \alpha ^ { ( i ) } .$
|
| 412 |
+
|
| 413 |
+
Finally, consider $n \geq i > k$ . Then similarly to the computation in equation (B.1), $U \alpha ^ { ( i ) }$ is a vector with all coordinates less than $1 - 2 \rho ^ { \prime }$ . Therefore $\boldsymbol { U } \boldsymbol { \alpha } ^ { ( i ) } + \boldsymbol { b }$ is a vector with negative entries. Hence we have $\mathtt { R e L u } ( U \alpha ^ { ( i ) } + b ) = 0$ , which implies $V \mathrm { R e L u } ( U \alpha ^ { ( i ) } + b ) = 0$ . □
|
| 414 |
+
|
| 415 |
+
Now we are ready to state the formal version of Lemma 3.3.
|
| 416 |
+
|
| 417 |
+
Lemma B.2. Suppose a sequence of $n$ vectors $z ^ { ( 1 ) } , \ldots , z ^ { ( n ) }$ satisfies a relaxed version of Assumption 3.1: a) for every i, $1 - \bar { \rho } ^ { \prime } \leq \| z ^ { ( i ) } \| ^ { 2 } \leq 1 + \rho ^ { \prime } b )$ for every $i \neq j$ , we have $\| z ^ { ( i ) } - z ^ { ( j ) } \| ^ { 2 } \geq \dot { \rho ^ { \prime } }$ ;. Let $v ^ { ( 1 ) } , \ldots , v ^ { ( n ) }$ be defined above. Then there exists weigh matrices $( A _ { 1 } , B _ { 1 } ) , \ldots , ( A _ { \ell } , B _ { \ell } )$ , such that given $\forall i , h _ { 0 } ^ { ( i ) } = z ^ { ( i ) }$ , we have,
|
| 418 |
+
|
| 419 |
+
$$
|
| 420 |
+
\forall i \in \{ 1 , \ldots , n \} , h _ { \ell } ^ { ( i ) } = v ^ { ( i ) } .
|
| 421 |
+
$$
|
| 422 |
+
|
| 423 |
+
We will use Lemma B.1 repeatedly to construct building blocks $\mathcal { T } _ { A _ { j } , B _ { k } , s _ { j } } ( \cdot )$ , and thus prove Lemma B.2. Each building block $\mathcal { T } _ { A _ { j } , B _ { k } , s _ { j } } \left( \cdot \right)$ takes a subset of $k$ vectors among $\{ z ^ { ( 1 ) } , \ldots , z ^ { ( n ) } \}$ and convert them to $v ^ { ( i ) }$ ’s, while maintaining all other vectors as fixed. Since they are totally $n / k$ layers, we finally maps all the $z ^ { ( i ) }$ ’s to the target vectors $v ^ { ( i ) }$ ’s.
|
| 424 |
+
|
| 425 |
+
Proof of Lemma B.2. We use Lemma B.1 repeatedly. Let $S _ { 1 } = [ 1 , \ldots , k ]$ . Then using Lemma B.1 with $\alpha ^ { ( i ) } = z ^ { ( i ) }$ and $\beta ^ { ( i ) } = v ^ { ( i ) }$ for $i \in [ n ]$ , we obtain that there exists $A _ { 1 } , B _ { 1 } , b _ { 1 }$ such that for $i ~ \leq ~ k$ , it holds that $h _ { 1 } ^ { ( i ) } = z ^ { ( i ) } + \mathcal { T } _ { A _ { 1 } , B _ { 1 } , b _ { 1 } } \big ( z ^ { ( i ) } \big ) = v ^ { ( i ) }$ , and for $i \geq k$ , it holds that $h _ { 1 } ^ { ( i ) } =$ $z ^ { ( i ) } + \mathcal { T } _ { A _ { 1 } , B _ { 1 } , b _ { 1 } } ( z ^ { ( i ) } ) \bar { = } z ^ { ( i ) }$ .
|
| 426 |
+
|
| 427 |
+
Now we construct the other layers inductively. We will construct the layers such that the hidden variable at layer $j$ satisfies $h _ { j } ^ { ( i ) } = v ^ { ( i ) }$ for every $1 \leq i \leq j k$ , and $h _ { j } ^ { ( i ) } = z ^ { ( i ) }$ for every $n \geq i >$ $j k$ . Assume that we have constructed the first $j$ layer and next we use Lemma B.1 to construct the $j + 1$ layer. Then we argue that the choice of $\alpha ^ { ( 1 ) } = v ^ { ( 1 ) } , \ldots , \alpha ^ { ( j k ) } = v ^ { ( j k ) } , \alpha ^ { ( j k + 1 ) } =$ $z ^ { ( j k + 1 ) } , \cdot \cdot \cdot , \dot { \alpha } ^ { ( n ) } = z ^ { ( n ) }$ , and $S = \{ j k + 1 , \ldots , ( j + 1 ) k \}$ satisfies the assumption of Lemma B.1. Indeed, because $q _ { i }$ ’s are chosen uniformly randomly, we have w.h.p for every $s$ and $i$ , $\langle q _ { s } , z ^ { ( i ) } \rangle \leq$ $1 - \rho ^ { \prime }$ . Thus, since $v ^ { ( i ) } \in \{ q _ { 1 } , \ldots , q _ { r } \}$ , we have that $v ^ { ( i ) }$ also doesn’t correlate with any of the $z ^ { ( i ) }$ . Then we apply Lemma B.1 and conclude that there exists $A _ { j + 1 } = U , B _ { j + 1 } = V , b _ { j + 1 } = s$ such that $\mathcal { T } _ { A _ { j + 1 } , b _ { j + 1 } , b _ { j + 1 } } ( v ^ { ( i ) } ) = 0$ for $i \leq j k , \mathcal { T } _ { A _ { j + 1 } , b _ { j + 1 } , b _ { j + 1 } } ( z ^ { ( i ) } ) = v ^ { ( i ) } - z ^ { ( i ) }$ for $j k < i \leq ( j + 1 ) k$ , and $\mathcal { T } _ { A _ { j + 1 } , b _ { j + 1 } , b _ { j + 1 } } ( z ^ { ( i ) } ) = 0$ for $n \geq i > ( j + 1 ) k$ . These imply that
|
| 428 |
+
|
| 429 |
+
$$
|
| 430 |
+
\begin{array} { r l } & { h _ { j + 1 } ^ { ( i ) } = h _ { j } ^ { ( i ) } + { \mathcal T } _ { A _ { j + 1 } , b _ { j + 1 } , b _ { j + 1 } } \big ( v ^ { ( i ) } \big ) = v ^ { ( i ) } \quad \forall 1 \leq i \leq j k } \\ & { h _ { j + 1 } ^ { ( i ) } = h _ { j } ^ { ( i ) } + { \mathcal T } _ { A _ { j + 1 } , b _ { j + 1 } , b _ { j + 1 } } \big ( z ^ { ( i ) } \big ) = v ^ { ( i ) } \quad \forall j k + 1 \leq i \leq ( j + 1 ) k } \\ & { h _ { j + 1 } ^ { ( i ) } = h _ { j } ^ { ( i ) } + { \mathcal T } _ { A _ { j + 1 } , b _ { j + 1 } , b _ { j + 1 } } \big ( z ^ { ( i ) } \big ) = z ^ { ( i ) } \quad \forall ( j + 1 ) k < i \leq n } \end{array}
|
| 431 |
+
$$
|
| 432 |
+
|
| 433 |
+
Therefore we constructed the $j + 1$ layers that meets the inductive hypothesis for layer $j + 1$ Therefore, by induction we get all the layers, and the last layer satisfies that $h _ { \ell } ^ { ( i ) } = v ^ { ( i ) }$ for every example $i$ . □
|
| 434 |
+
|
| 435 |
+
Now we ready to prove Theorem 3.2, following the general plan sketched in Section 3.
|
| 436 |
+
|
| 437 |
+
Proof of Theorem 3.2. We use formalize the intuition discussed below Theorem 3.2. First, take $k = \overset { \cdot } { c } ( \log n ) / \rho ^ { 2 }$ for sufficiently large absolute constant $c$ (for example, $c = 1 0$ works), by JohnsonLindenstrauss Theorem (Johnson $\&$ Lindenstrauss (1984), or see Wikipedia (2016)) we have that when $A _ { 0 }$ is a random matrix with standard normal entires, with high probability, all the pairwise distance between the the set of vectors $\{ 0 , x ^ { ( 1 ) } , \ldots , x ^ { ( n ) } \}$ are preserved up to $1 \pm \rho / 3$ factor. That is, we have that for every $i , 1 { - } \rho / 3 \le \| A _ { 0 } x ^ { ( i ) } \| \le 1 { + } \rho / 3$ , and for every $i \neq j$ , $\| A _ { 0 } x ^ { ( i ) } - A _ { 0 } x ^ { ( j ) } \| \ge$ $\rho ( 1 - \rho / 3 ) \ge 2 \rho / 3$ . Let $z ^ { ( i ) } = A _ { 0 } x ^ { ( i ) }$ and $\rho ^ { \prime } = \rho / 3$ . Then we have $z ^ { ( i ) }$ ’s satisfy the condition of Lemam B.2. We pick $r$ random vectors $q _ { 1 } , \ldots , q _ { r }$ in $\mathbb { R } ^ { k }$ . Let $v ^ { ( 1 ) } , \ldots , v ^ { ( n ) }$ be defined as in equation (3.2). Then by Lemma B.2, we can construct matrices $( A _ { 1 } , B _ { 1 } ) , \ldots , ( A _ { \ell } , B _ { \ell } )$ such that
|
| 438 |
+
|
| 439 |
+
$$
|
| 440 |
+
h _ { \ell } ^ { ( i ) } = v ^ { ( i ) } .
|
| 441 |
+
$$
|
| 442 |
+
|
| 443 |
+
Note that $v ^ { ( i ) } \in \{ q _ { 1 } , \ldots , q _ { r } \}$ , and $q _ { i }$ ’s are random unit vector. Therefore, the choice of $\alpha ^ { ( 1 ) } =$ $q _ { 1 } , \ldots , \alpha ^ { ( r ) } = q _ { r }$ , $\beta ^ { ( 1 ) } = e _ { 1 } , \ldots , \beta ^ { ( r ) } = e _ { r }$ , and satisfies the condition of Lemma B.1, and using Lemma B.1 we conclude that there exists $A _ { \ell + 1 } , B _ { \ell + 1 } , s _ { \ell + 1 }$ such that
|
| 444 |
+
|
| 445 |
+
$$
|
| 446 |
+
e _ { j } = v _ { j } + \mathcal { T } _ { A _ { \ell + 1 } , B _ { \ell + 1 } , b _ { \ell + 1 } } ( v _ { j } ) , \mathrm { ~ f o r ~ e v e r y ~ } j \in \{ 1 , \dots , r \} \dots
|
| 447 |
+
$$
|
| 448 |
+
|
| 449 |
+
By the definition of $v ^ { ( i ) }$ in equation (3.2) and equation (B.2), we conclude that $\hat { y } ^ { ( i ) } = h _ { \ell } ^ { ( i ) } +$ $\begin{array} { r } { \mathcal { T } _ { A _ { \ell + 1 } , B _ { \ell + 1 } , b _ { \ell + 1 } } ( h _ { \ell } ^ { ( i ) } ) = y ^ { ( i ) } . } \end{array}$ ., which complete the proof. □
|
| 450 |
+
|
| 451 |
+
# C TOOLBOX
|
| 452 |
+
|
| 453 |
+
In this section, we state two folklore linear algebra statements. The following Claim should be known, but we can’t find it in the literature. We provide the proof here for completeness.
|
| 454 |
+
|
| 455 |
+
Claim C.1. Let $U \in \mathbb { R } ^ { d \times d }$ be a real normal matrix (that is, it satisfies $U U ^ { \top } = U ^ { \top } U$ ). Then, there exists an orthonormal matrix $S \in \mathbb { R } ^ { d \times d }$ such that
|
| 456 |
+
|
| 457 |
+
$$
|
| 458 |
+
U = S D S ^ { \top } ,
|
| 459 |
+
$$
|
| 460 |
+
|
| 461 |
+
where $D$ is a real block diagonal matrix that consists of blocks with size at most $2 \times 2$ . Moreover, if $d$ is even, then $D$ consists of blocks with size exactly $2 \times 2$ .
|
| 462 |
+
|
| 463 |
+
Proof. Since $U$ is a normal matrix, it is unitarily diagonalizable (see Weisstein (2016) for backgrounds). Therefore, there exists unitary matrix $V$ in $\mathbb { C } ^ { d \times d }$ and diagonal matrix in $\mathbb { C } ^ { d \times \breve { d } }$ such that $U$ has eigen-decomposition $\begin{array} { r c l } { U } & { = } & { V \Lambda V ^ { * } } \end{array}$ . Since $U$ itself is a real matrix, we have that the eigenvalues (the diagonal entries of $\Lambda$ ) come as conjugate pairs, and so do the eigenvectors (which are the columns of $V$ ). That is, we can group the columns of $V$ into pairs $( v _ { 1 } , \bar { v } _ { 1 } ) , \ldots , ( v _ { s } , \bar { v _ { s } } ) , v _ { s + 1 } , \ldots , v _ { t } .$ , and let the corresponding eigenvalues be $\lambda _ { 1 } , \bar { \lambda } _ { 1 } , \dots , \bar { \lambda } _ { \lambda _ { s } } , \bar { \lambda } _ { s } , \lambda _ { s + 1 } , \dots , \bar { \lambda _ { t } }$ . Here $\lambda _ { s + 1 } , \ldots , \lambda _ { t } \in \mathbb { R }$ . Then we get that $U \ =$ $\begin{array} { r } { \sum _ { i = 1 } ^ { s } 2 \Re ( v _ { i } \lambda _ { i } v _ { i } ^ { * } ) + \sum _ { i = s + 1 } ^ { t } v _ { i } \lambda _ { i } v _ { i } ^ { \top } } \end{array}$ . Let $Q _ { i } = \Re ( v _ { i } \lambda _ { i } v _ { i } ^ { * } )$ , then we have that $Q _ { i }$ is a real matrix of rank-2. Let $S _ { i } \in \mathbb { R } ^ { d \times 2 }$ be a orthonormal basis of the column span of $Q _ { i }$ and then we have that $Q _ { i }$ can be written as $Q _ { i } = S _ { i } D _ { i } S _ { i } ^ { \top }$ where $D _ { i }$ is a $2 \times 2$ matrix. Finally, let $S = [ S _ { 1 } , \ldots , S _ { s } , v _ { s + 1 } , \ldots , v _ { t } ]$ , and $D = \mathrm { d i a g } ( D _ { 1 } , \dots , D _ { s } , \lambda _ { s + 1 } , \dots , \lambda _ { t } )$ we complete the proof. □
|
| 464 |
+
|
| 465 |
+
The following Claim is used in the proof of Theorem 2.2. We provide a proof here for completeness. Claim C.2 (folklore). For any two matrices $A , B \in \mathbb { R } ^ { d \times d }$ , we have that
|
| 466 |
+
|
| 467 |
+
$$
|
| 468 |
+
\| A B \| _ { F } \geq \sigma _ { \operatorname* { m i n } } ( A ) \| B \| _ { F } .
|
| 469 |
+
$$
|
| 470 |
+
|
| 471 |
+
Proof. Since $\sigma _ { \mathrm { m i n } } ( A ) ^ { 2 }$ is the smallest eigenvalue of $A ^ { \top } A$ , we have that
|
| 472 |
+
|
| 473 |
+
$$
|
| 474 |
+
B ^ { \top } A ^ { \top } A B \succeq B ^ { \top } \cdot \sigma _ { \operatorname* { m i n } } ( A ) ^ { 2 } \mathrm { I d } \cdot B .
|
| 475 |
+
$$
|
| 476 |
+
|
| 477 |
+
Therefore, it follows that
|
| 478 |
+
|
| 479 |
+
$$
|
| 480 |
+
\begin{array} { r l } & { \| A B \| _ { F } ^ { 2 } = \mathrm { t r } ( B ^ { \top } A ^ { \top } A B ) \geq \mathrm { t r } ( B ^ { \top } \cdot \sigma _ { \operatorname* { m i n } } ( A ) ^ { 2 } \mathrm { I d } \cdot B ) } \\ & { \qquad = \sigma _ { \operatorname* { m i n } } ( A ) ^ { 2 } \mathrm { t r } ( B ^ { \top } B ) = \sigma _ { \operatorname* { m i n } } ( A ) ^ { 2 } \| B \| _ { F } ^ { 2 } . } \end{array}
|
| 481 |
+
$$
|
| 482 |
+
|
| 483 |
+
Taking square root of both sides completes the proof.
|
md/train/xN3XX6pKSD5/xN3XX6pKSD5.md
ADDED
|
@@ -0,0 +1,339 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Deep Marching Tetrahedra: a Hybrid Representation for High-Resolution 3D Shape Synthesis
|
| 2 |
+
|
| 3 |
+
Tianchang Shen 1,2,3 Jun Gao1,2,3 Kangxue Yin 1
|
| 4 |
+
|
| 5 |
+
Ming-Yu Liu 1 Sanja Fidler1,2,3
|
| 6 |
+
|
| 7 |
+
NVIDIA1 University of Toronto2 Vector Institute3
|
| 8 |
+
|
| 9 |
+
{frshen, jung, kangxuey, mingyul, sfidler}@nvidia.com
|
| 10 |
+
|
| 11 |
+
# Abstract
|
| 12 |
+
|
| 13 |
+
We introduce DMTET, a deep 3D conditional generative model that can synthesize high-resolution 3D shapes using simple user guides such as coarse voxels. It marries the merits of implicit and explicit 3D representations by leveraging a novel hybrid 3D representation. Compared to the current implicit approaches, which are trained to regress the signed distance values, DMTET directly optimizes for the reconstructed surface, which enables us to synthesize finer geometric details with fewer artifacts. Unlike deep 3D generative models that directly generate explicit representations such as meshes, our model can synthesize shapes with arbitrary topology. The core of DMTET includes a deformable tetrahedral grid that encodes a discretized signed distance function and a differentiable marching tetrahedra layer that converts the implicit signed distance representation to the explicit surface mesh representation. This combination allows joint optimization of the surface geometry and topology as well as generation of the hierarchy of subdivisions using reconstruction and adversarial losses defined explicitly on the surface mesh. Our approach significantly outperforms existing work on conditional shape synthesis from coarse voxel inputs, trained on a dataset of complex 3D animal shapes. Project page: https://nv-tlabs.github.io/DMTet/.
|
| 14 |
+
|
| 15 |
+
# 1 Introduction
|
| 16 |
+
|
| 17 |
+
Fields such as simulation, architecture, gaming, and film rely on high-quality 3D content with rich geometric details and complex topology. However, creating such content requires tremendous expert human effort. It takes a significant amount of development time to create each individual 3D asset. In contrast, creating rough 3D shapes with simple building blocks like voxels has been widely adopted. For example, Minecraft has been used by hundreds of millions of users for creating 3D content. Most of them are non-experts. Developing A.I. tools that enable regular people to upscale coarse, voxelized objects into high resolution, beautiful 3D shapes would bring us one step closer to democratizing high-quality 3D content creation. Similar tools can be envisioned for turning 3D scans of objects recorded by modern phones into high-quality forms. Our work aspires to create such capabilities.
|
| 18 |
+
|
| 19 |
+
A powerful 3D representation is a critical component of a learning-based 3D content creation framework. A good 3D representation for high-quality reconstruction and synthesis should capture local geometric details and represent objects with arbitrary topology while also being memory and computationally efficient for fast inference in interactive applications.
|
| 20 |
+
|
| 21 |
+
Recently, neural implicit representations [8, 39, 42, 51], which use a neural network to implicitly represent a shape via a signed distance field (SDF) or an occupancy field (OF), have emerged as an effective 3D representation. Neural implicits have the benefit of representing complex geometry and topology, not limited to a predefined resolution. The success of these methods has been shown in shape compression [49, 13, 51], single-image shape generation [47, 60, 48], and point cloud reconstruction [57]. However, most of the current implicit approaches are trained by regressing to SDF or OF values and cannot utilize an explicit supervision on the target surface, which imposes useful constraints for training. To mitigate this issue, several works [45, 31] proposed to utilize iso-surfacing techniques such as the Marching Cubes (MC) algorithm to extract a surface mesh from the implicit representation, which, however, is computationally expensive.
|
| 22 |
+
|
| 23 |
+
In this work, we introduce DMTET, a deep 3D conditional generative model for high-resolution 3D shape synthesis from user guides in the form of coarse voxels. In the heart of DMTET is a new differentiable shape representation that marries implicit and explicit 3D representations. In contrast to deep implicit approaches optimized for predicting sign distance (or occupancy) values, our model employs additional supervision on the surface, which empirically renders higher quality shapes with finer geometric details. Compared to methods that learn to directly generate explicit representations, such as meshes [54], by committing to a preset topology, our DMTET can produce shapes with arbitrary topology. Specifically, DMTET predicts the underlying surface parameterized by an implicit function encoded via a deformable tetrahedral grid. The underlying surface is converted into an explicit mesh with a Marching Tetrahedra (MT) algorithm, which we show is differentiable and more performant than the Marching Cubes. DMTET maintains efficiency by learning to adapt the grid resolution by deforming and selectively subdividing tetrahedra. This has the effect of spending computation only on the relevant regions in space. We achieve further gains in the overall quality of the output shape with learned surface subdivision. Our DMTET is end-to-end differentiable, allowing the network to jointly optimize the geometry and topology of the surface, as well as the hierarchy of subdivisions using a loss function defined explicitly on the surface mesh.
|
| 24 |
+
|
| 25 |
+
We demonstrate our DMTET on two challenging tasks: 3D shape synthesis from coarse voxel inputs and point cloud 3D reconstruction. We outperform existing state-of-the-art methods by a significant margin while being 10 times faster than alternative implicit representation-based methods at inference time. In summary, we make the following technical contributions:
|
| 26 |
+
|
| 27 |
+
1. We show that using Marching Tetrahedra (MT) as a differentiable iso-surfacing layer allows topological change for the underlying shape represented by a implicit field, in contrast to the analysis in prior works [31, 45].
|
| 28 |
+
2. We incorporate MT in a DL framework and introduce DMTET, a hybrid representation that combines implicit and explicit surface representations. We demonstrate that the additional supervision (e.g. chamfer distance, adversarial loss) defined directly on the extracted surface from implicit field improves the shape synthesis quality.
|
| 29 |
+
3. We introduce a coarse-to-fine optimization strategy that scales DMTET to high resolution during training. We thus achieves better reconstruction quality than state-of-the-art methods on challenging 3D shape synthesis tasks, while requiring a lower computation cost.
|
| 30 |
+
|
| 31 |
+
# 2 Related Work
|
| 32 |
+
|
| 33 |
+
We review the related work on learning-based 3D synthesis methods based on their 3D representations.
|
| 34 |
+
|
| 35 |
+
Voxel-based Methods Early work [59, 10, 38] represented 3D shapes as voxels, which store the coarse occupancy (inside/outside) values on a regular grid, which makes powerful convolutional neural networks native and renders impressive results on 3D reconstruction and synthesis [12, 11, 58, 2]. For high-resolution shape synthesis, DECOR-GAN [6] transfers geometric details from a high-resolution shape represented in voxel to a low-resolution shape by utilizing a discriminator defined on 3D patches of the voxel grid. However, the computational and memory costs grow cubically as the resolution increases, prohibiting the reconstruction of fine geometric details and smooth curves. One common way to address this limitation is building hierarchical structures such as octrees [46, 52, 55, 56, 24, 52], which adapt the grid resolution locally based on the underlying shape. In this paper, we adopt a hierarchical deformable tetrahedral grid to utilize the resolution better. Unlike octree-based shape synthesis, our network learns grid deformation and subdivision jointly to better represent the surface without relying on explicit supervision from a pre-computed hierarchy.
|
| 36 |
+
|
| 37 |
+
Deep Implicit Fields (DIFs) represent a 3D shape as a zero level set of a continuous function parameterized by a neural network [39, 44, 17, 40]. This formulation can represent arbitrary typology and has infinite resolution. DIF-based shape synthesis approaches have demonstrated strong performance in many applications, including single view 3D reconstruction [60, 30, 47, 48], shape manipulation, and synthesis [26, 21, 28, 14, 1, 9]. However, as these approaches are trained by minimizing the reconstruction loss of function values at a set of sampled 3D locations (a rough proxy of the surface), they tend to render artifacts when synthesizing fine details. Furthermore, if one desires a mesh to be extracted from a DIF, an expensive iso-surfacing step based on Marching Cubes [36] or Marching Tetrahedra [15] is required. Due to the computational burden, iso-surfacing is often done on a smaller resolution, hence prone to quantization errors. Lei et al. [29] proposes an analytic meshing solution to reduce the error, but is only applicable to DIFs parametrized by MLPs with ReLU activation. Our representation scales to high resolution and does not require additional modification to the backward pass for training end-to-end. DMTET can represent arbitrary typology, and is trained via direct supervision on the generated surface. Recent works [1, 9] learn to regress unsigned distance to triangle soup or point cloud. However, their iso-surfacing formulation is not differentiable in contrast to DMTET.
|
| 38 |
+
|
| 39 |
+

|
| 40 |
+
Figure 1: DMTET reconstructs the shape implicitly in a coarse-to-fine manner by predicting the SDF defined on a deformable tetrahedral grid. It then converts the SDF to a surface mesh by a differentiable Marching Tetrahedra layer. DMTET is trained by optimizing the objective function defined on the final surface.
|
| 41 |
+
|
| 42 |
+
Surface-based Methods directly predict triangular meshes and have achieved impressive results for reconstructing and synthesizing simpler shapes [54, 23, 5, 41, 7]. Typically, they predefined the topology of the shape, e.g. equivalent to a sphere [54, 5, 25], or a union of primitives [43, 53, 19] or a set of segmented parts [61, 62, 50]. As a result, they can not model a distribution of shapes with complex topology variations. Recently, DefTet [18] represents a mesh with a deformable tetrahedral grid where the grid vertex coordinates and the occupancy values are learned. However, similar to voxel-based methods, the computational costf increases cubically with the grid resolution. Furthermore, as the occupancy loss for supervising topology learning and the surface loss for supervising geometry learning do not support joint training, it tends to generate suboptimal results. In contrast, our method is able to synthesize high-resolution 3D shapes, not shown in previous work.
|
| 43 |
+
|
| 44 |
+
# 3 Deep Marching Tetrahedra
|
| 45 |
+
|
| 46 |
+
We now introduce our DMTET for synthesizing high-quality 3D objects. The schematic illustration is provided in Fig. 1. Our model relies on a new, hybrid 3D representation specifically designed for high-resolution reconstruction and synthesis, which we describe in Sec. 3.1. In Sec. 3.2, we describe the neural network architecture of DMTET that predicts the shape representation from inputs such as coarse voxels. We provide the training objectives in Sec. 3.3.
|
| 47 |
+
|
| 48 |
+
# 3.1 3D Representation
|
| 49 |
+
|
| 50 |
+
We represent a shape using a sign distance field (SDF) encoded with a deformable tetrahedral grid, adopted from DefTet [18, 20]. The grid fully tetrahedralizes a unit cube, where each cell in the volume is a tetahedron with 4 vertices and faces. The key aspect of this representation is that the grid vertices can deform to represent the geometry of the shape more efficiently. While the original DefTet encoded occupancy defined on each tetrahedron, we here encode signed distance values defined on the vertices of the grid and represent the underlying surface implicitly (Sec. 3.1.1). The use of signed distance values, instead of occupancy values, provides more flexibility in representing the underlying surface. For greater representation power while keeping memory and computation manageable, we further selectively subdivide the tetrahedra around the predicted surface (Sec. 3.1.2). We convert the signed distance-based implicit representation into a triangular mesh using a marching tetrahedra layer, which we discuss in Sec. 3.1.3. The final mesh is further converted into a parameterized surface with a differentiable surface subdivision module, described in Sec. 3.1.4.
|
| 51 |
+
|
| 52 |
+
# 3.1.1 Deformable Tetrahedral Mesh as an Approximation of an Implicit Function
|
| 53 |
+
|
| 54 |
+
We adopt and extend the deformable tetrahedral grid introduced in Gao et al. [18], which we denote with $( V _ { T } , T )$ , where $V _ { T }$ are the vertices in the tetrahedral grid $T$ . Following the notation in [18], each tetrahedron $T _ { k } \in T$ is represented with four vertices $\left\{ v _ { a _ { k } } , v _ { b _ { k } } , v _ { c _ { k } } , v _ { d _ { k } } \right\}$ , with $k \in \{ 1 , . . . . , K \}$ , where $K$ is the total number of tetrahedra and $v _ { i _ { k } } \in V _ { T }$ .
|
| 55 |
+
|
| 56 |
+
We represent the sign distance field by interpolating SDF values defined on the vertices of the grid. Specifically, we denote the SDF value in vertex $v _ { i } \in V _ { T }$ as $s ( v _ { i } )$ . SDF values for the points that lie inside the tetrahedron follow a barycentric interpolation of the SDF values of the four vertices that encapsulates the point.
|
| 57 |
+
|
| 58 |
+
# 3.1.2 Volume Subdivision
|
| 59 |
+
|
| 60 |
+
We represent shape in a coarse to fine manner for efficiency. We determine the surface tetrahedra $T _ { s u r f }$ by checking whether a tetrahedron has vertices with different SDF signs – indicating that it intersects the surface encoded by the SDF. We subdivide $T _ { s u r f }$ as well as their immediate neighbors and increase resolution by adding the mid point to each edge. We compute SDF values of the new vertices by averaging the SDF values on the edge (Fig. 2).
|
| 61 |
+
|
| 62 |
+

|
| 63 |
+
Figure 2: Volume Subdivision: Each surface tet.(blue) is divided into 8 tet.(red) by adding midpoints.
|
| 64 |
+
|
| 65 |
+
# 3.1.3 Marching Tetrahedra for converting between an Implicit and Explicit Representation
|
| 66 |
+
|
| 67 |
+

|
| 68 |
+
Figure 3: Three unique surface configurations in MT. Vertex color indicates the sign of signed distance value. Notice that flipping the signs of all vertices will result in the same surface configuration. Position of the vertex is linearly interpolated along the edges with sign change.
|
| 69 |
+
|
| 70 |
+
We use the Marching Tetrahedra [15] algorithm to convert the encoded SDF into an explicit triangular mesh. Given the SDF values $\mathbf { \bar { \{ } } s ( v _ { a } ) , s ( \mathbf { \bar { { v } } } _ { b } ) , s ( v _ { c } ) , s ( v _ { d } ) \}$ of the vertices of a tetrahedron, MT determines the surface typology inside the tetrahedron based on the signs of $s ( v )$ , which is illustrated in Fig. 3. The total number of configurations is $2 ^ { 4 } = { \bar { 1 } } 6$ , which falls into 3 unique cases after considering rotation symmetry. Once the surface typology inside the tetrahedron is identified, the vertex location of the iso-surface is computed at the zero crossings of the linear interpolation along the tetrahedron’s edges, as shown in Fig. 3.
|
| 71 |
+
|
| 72 |
+
Prior works [45, 31] argue that the singularity in this formulation, i.e. when $s ( v _ { a } ) = s ( v _ { b } )$ , prevents the change of surface typology (sign change of $s ( v _ { a } ) )$ ) during training. However, we find that, in practise, the equation is only evaluated when $\mathrm { s i g n } ( s ( v _ { a } ) ) \neq \mathrm { s i g n } ( s ( v _ { b } ) )$ . Thus, during training, the singularity never happens and the gradient from a loss defined on the extracted iso-surface (Sec. 3.3), can be back-propagated to both vertex positions and SDF values via the chain rule. A more detailed analysis is in the Appendix.
|
| 73 |
+
|
| 74 |
+
# 3.1.4 Surface Subdivision
|
| 75 |
+
|
| 76 |
+
Having a surface mesh as output allows us to further increase the representation power and the visual quality of the shapes with a differentiable surface subdivision module. We follow the scheme of the Loop Subdivision method [35], but instead of using a fixed set of parameters for subdivision, we make these parameters learnable in DMTET. Specifically, learnable parameters include the positions of each mesh vertex $\boldsymbol { v } _ { i } ^ { \prime }$ , as well as $\alpha _ { i }$ which controls the generated surface via weighting the smoothness of neighbouring vertices. Note that different from Liu et al. [33], we only predict the per-vertex parameter at the beginning and carry it over to subsequent subdivision iterations to attain a lower computational cost. We provide more details in Appendix.
|
| 77 |
+
|
| 78 |
+
# 3.2 DMTET: 3D Deep Conditional Generative Model
|
| 79 |
+
|
| 80 |
+
Our DMTET is a neural network that utilizes our proposed 3D representation and aims to output a high resolution 3D mesh $M$ from input $x$ (a point cloud or a coarse voxelized shape). We describe the architecture (Fig. 4) of the generator for each module of our 3D representation in Sec. 3.2.1, with the architecture of the discriminator presented in Sec. 3.2.2. Further details are in Appendix.
|
| 81 |
+
|
| 82 |
+

|
| 83 |
+
Figure 4: Our generator and discriminator architectures. The generator is composed of two parts—one utilizes MLP to generate the initial predictions for all grid vertices and the other uses GCN to refine the surface.
|
| 84 |
+
|
| 85 |
+
# 3.2.1 3D Generator
|
| 86 |
+
|
| 87 |
+
Input Encoder We use PVCNN [34] as an input encoder to extract a 3D feature volume $F _ { v o l } ( x )$ from a point cloud. When the input is a coarse voxelized shape, we sample points on its surface. We compute a feature vector $F _ { v o l } ( v , x )$ for a grid vertex $v \in \mathbb { R } ^ { 3 }$ via trilinear interpolation.
|
| 88 |
+
|
| 89 |
+
Initial Prediction of SDF We predict the SDF value for each vertex in the initial deformable tetrahedral grid using a fully-connected network $s ( v ) = M L P ( F _ { v o l } ( v , x ) , v )$ . The fully-connected network additionally outputs a feature vector $f ( v )$ , which is used for the surface refinement in the volume subdivision stage.
|
| 90 |
+
|
| 91 |
+
Surface Refinement with Volume Subdivision After obtaining the initial SDF, we iteratively refine the surface and subdivide the tetrahedral grid. We first identify surface tetrahedra $T _ { s u r f }$ based on the current $s ( v )$ value. We then build a graph $G = ( V _ { s u r f } , E _ { s u r f } )$ , where $V _ { s u r f } , E _ { s u r f }$ correspond to the vertices and edges in $T _ { s u r f }$ . We then predict the position offsets $\Delta v _ { i }$ and SDF residual values $\Delta s ( v _ { i } )$ for each vertex $i$ in $V _ { s u r f }$ using a Graph Convolutional Network [32] (GCN):
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\begin{array} { r c l } { f _ { v _ { i } } ^ { \prime } } & { = } & { \mathsf { c o n c a t } ( v _ { i } , s ( v _ { i } ) , F _ { v o l } ( v _ { i } , x ) , f ( v _ { i } ) ) , } \\ { ( \Delta v _ { i } , \Delta s ( v _ { i } ) , \overline { { f ( v _ { i } ) } } ) _ { i = 1 , \cdots N _ { s u r f } } } & { = } & { \mathsf { G C N } \big ( ( f _ { v _ { i } } ^ { \prime } ) _ { i = 1 , \cdots N _ { s u r f } } , G \big ) , } \end{array}
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
where $N _ { s u r f }$ is the total number of vertices in $V _ { s u r f }$ and $\overline { { f ( v _ { i } ) } }$ is the updated per-vertex feature. The vertex position and the SDF value for vertex $v _ { i }$ are updated as $v _ { i } ^ { \prime } = v _ { i } + \Delta v _ { i }$ and $s ( v _ { i } ^ { \prime } ) =$ $s ( v _ { i } ) + \Delta s ( v _ { i } )$ . This refinement step can potentially flip the sign of the SDF values to refine the local typology, and also move the vertices thus improving the local geometry.
|
| 98 |
+
|
| 99 |
+
After surface refinement, we perform the volume subdivision step followed by an additional surface refinement step. In particular, we re-identify $T _ { s u r f }$ and subdivide $T _ { s u r f }$ and their immediate neighbors. We drop the unsubdivided tetrahedra from the full tetrahedral grid in both steps, which saves memory and computation, as the size of the $T _ { s u r f }$ is proportional to the surface area of the object, and scales up quadratically rather than cubically as the grid resolution increases.
|
| 100 |
+
|
| 101 |
+
Note that the SDF values and positions of the vertices are inherited from the level before subdivision, thus, the loss computed at the final surface can back-propagate to all vertices from all levels. Therefore, our DMTET automatically learns to subdivide the tetrahedra and does not need an additional loss term in the intermediate steps to supervise the learning of the octree hierarchy as in the prior work [52].
|
| 102 |
+
|
| 103 |
+
Learnable Surface Subdivision After extracting the surface mesh using MT, we can further apply learnable surface subdivision. Specifically, we build a new graph on the extracted mesh, and use GCN to predict the updated position of each vertex $\boldsymbol { v } _ { i } ^ { \prime }$ , and $\alpha _ { i }$ for Loop Subvidision. This step removes the quantization errors and mitigates the approximation errors from the classic Loop Subdivision by adjusting $\alpha _ { i }$ , which are fixed in the classic method.
|
| 104 |
+
|
| 105 |
+
# 3.2.2 3D Discriminator
|
| 106 |
+
|
| 107 |
+
We apply a 3D discriminator $D$ on the final surface predicted from the generator. We empirically find that using a 3D CNN from DECOR-GAN [6] as the discriminator on the signed distance field that is computed from the predicted mesh is effective to capture the local details. Specifically, we first randomly select a high-curvature vertex $v$ from the target mesh and compute the ground truth signed distance field $S _ { r e a l } \in \mathbb { R } ^ { N \times N \times N }$ at a voxelized region around $v$ . Similarly, we compute the signed distance field of the predicted surface mesh $M$ at the same location to obtain $S _ { p r e d } \in \mathbb { R } ^ { N \times \tilde { N } \times N }$ . Note that $S _ { p r e d }$ is an analytical function of the mesh $M$ , and thus the gradient to $S _ { p r e d }$ can backpropagate to the vertex positions in $M$ . We feed $S _ { r e a l }$ or $S _ { p r e d }$ into the discriminator, along with the feature vector $F _ { v o l } ( v , x )$ in position $v$ . The discriminator then predicts the probability indicating whether the input comes from the real or generated shapes.
|
| 108 |
+
|
| 109 |
+
# 3.3 Loss Function
|
| 110 |
+
|
| 111 |
+
DMTET is end-to-end trainable. We supervise all modules to minimize the error defined on the final predicted mesh $M$ . Our loss function contains three different terms: a surface alignment loss to encourage the alignment with ground truth surface, an adversarial loss to improve realism of the generated shape, and regularizations to regularize the behavior of SDF and vertex deformations.
|
| 112 |
+
|
| 113 |
+
Surface Alignment loss We sample a set of points $P _ { g t }$ from the surface of the ground truth mesh $M _ { g t }$ . Similarly, we also sample a set of points from $M _ { p r e d }$ to obtain $P _ { p r e d }$ , and minimize the L2 Chamfer Distance and the normal consistency loss between $P _ { g t }$ and $P _ { p r e d }$ :
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
L _ { \mathrm { c d } } = \sum _ { p \in P _ { p r e d } } \operatorname* { m i n } _ { q \in P _ { g t } } | | p - q | | _ { 2 } + \sum _ { q \in P _ { g t } } \operatorname* { m i n } _ { p \in P _ { p r e d } } | | q - p | | _ { 2 } , L _ { \mathrm { n o m a l } } = \sum _ { p \in P _ { p r e d } } ( 1 - | \Vec { \mathbf { n } } _ { p } \cdot \Vec { \mathbf { n } } _ { \Vec { q } } | ) ,
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
where $\hat { q }$ is the point that corresponds to $p$ when computing the Chamfer Distance, and $\vec { \bf n } _ { p } , \vec { \bf n } _ { \hat { q } }$ denotes the normal direction at point $p , \hat { q }$ .
|
| 120 |
+
|
| 121 |
+
Adversarial Loss We use the adversarial loss proposed in LSGAN [37]:
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
L _ { \mathrm { D } } = \frac { 1 } { 2 } [ ( D ( M _ { g t } ) - 1 ) ^ { 2 } + D ( M _ { p r e d } ) ^ { 2 } ] , L _ { \mathrm { G } } = \frac { 1 } { 2 } [ ( D ( M _ { p r e d } ) - 1 ) ^ { 2 } ] .
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
Regularizations The above loss functions operate on the extracted surface, thus, only the vertices that are close to the iso-surface in the tetrahedral grid receive gradients, while the other vertices do not. Moreover, the surface losses do not provide information about what is inside/outside, since flipping the SDF sign of all vertices in a tetrahedron would result in the same surface being extracted by MT. This may lead to disconnected components during training. To alleviate this issue, we add a SDF loss to regularize SDF values:
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
L _ { \mathrm { S D F } } = \sum _ { v _ { i } \in V _ { T } } | s ( v _ { i } ) - S D F ( v _ { i } , M _ { g t } ) | ^ { 2 } ,
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
where $S D F ( v _ { i } , M _ { g t } )$ denotes the SDF value of point $v _ { i }$ to the mesh $M _ { g t }$ . In addition, we apply the $L _ { 2 }$ regularization loss on the predicted vertex deformations to avoid artifacts: $\begin{array} { r } { L _ { \mathrm { d e f } } = \sum _ { v _ { i } \in V _ { T } } | | \Delta v _ { i } | | _ { 2 } } \end{array}$ .
|
| 134 |
+
|
| 135 |
+
The final loss is a weighted sum of all five loss terms:
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
L = \lambda _ { \mathrm { c d } } L _ { \mathrm { c d } } + \lambda _ { \mathrm { n o r m a l } } L _ { \mathrm { n o r m a l } } + \lambda _ { \mathrm { G } } L _ { \mathrm { G } } + \lambda _ { \mathrm { S D F } } L _ { \mathrm { S D F } } + \lambda _ { \mathrm { d e f } } L _ { \mathrm { d e f } } ,
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
where $\lambda _ { \mathrm { c d } } , \lambda _ { \mathrm { n o r m a l } } , \lambda _ { \mathrm { G } } , \lambda _ { \mathrm { S D F } } , \lambda _ { \mathrm { d e f } }$ are hyperparameters (provided in the Supplement).
|
| 142 |
+
|
| 143 |
+
# 4 Experiments
|
| 144 |
+
|
| 145 |
+
We first evaluate DMTET in the challenging application of generating high-quality animal shapes from coarse voxels. We further evaluate DMTET in reconstructing 3D shapes from noisy point clouds on ShapeNet by comparing to existing state-of-the-art methods.
|
| 146 |
+
|
| 147 |
+
# 4.1 3D Shape Synthesis from Coarse Voxels
|
| 148 |
+
|
| 149 |
+
Experimental Settings We collected 1562 animal models from the TurboSquid website1. These models have a wide range of diversity, ranging from cats, dogs, bears, giraffes, to rhinoceros, goats, etc. We provide visualizations in Supplement. Among 1562 shapes, we randomly select 1120 shapes for training, and the remaining 442 shapes for testing. We follow the pipeline in Kaolin [27] to convert shapes to watertight meshes. To prepare the input to the network, we first voxelize the mesh into the resolution of $1 6 ^ { \overleftarrow { 3 } }$ , and then sample 3000 points from the surface after applying marching cubes to the $1 6 ^ { 3 }$ voxel grid. Note that this preprocessing is agnostic to the representation of the input coarse shape, allowing us to evaluate on different resolution voxels, or even meshes.
|
| 150 |
+
|
| 151 |
+
We compare our model with the official implementation of ConvOnet [44], which achieved SOTA performance on voxel upsampling. We also compare to DECOR-GAN [6], which obtained impressive results on transferring styles from a high-resolution voxel shape to a low-resolution voxel. Note that the original setting of DECOR-GAN is different from ours. For a fair comparison, we use all 1120 training shapes as the high-resolution style shapes during training, and retrieve the closet training shape to the test shape as the style shape during inference, which we refer as DECOR-Retv. We also compare against a randomly selected style shape as reference, denoted as DECOR-Rand.
|
| 152 |
+
|
| 153 |
+
1https://www.turbosquid.com, we obtain consent via an agreement with TurboSquid, and following license at https://blog.turbosquid.com/turbosquid-3d-model-license/
|
| 154 |
+
|
| 155 |
+

|
| 156 |
+
Figure 5: Qualitative results on 3D shapes Synthesis from Coarse Voxels. Comparing with all baselines, our method reconstructs shapes with much higher quality. Adding GAN further improves the realism of the generated shape. We also show the retrieved shapes from the training set in the second last column.
|
| 157 |
+
|
| 158 |
+
Metrics We evaluate L2 and L1 Chamfer Distance, as well as normal consistency score to assess how well the methods reconstruct the corresponding high-resolution shape following [44]. We also report Light Field Distance [4] (LFD) which measures the visual similarity in 2D rendered views. In addition, we evaluate Cls score following [6]. Specifically, we render the predicted 3D shapes and train a patch-based image classifier to distinguish whether images are from the renderings of real or generated shapes. The mean classification accuracy of the trained classifier is reported as Cls (lower is better). More details are in the Supplement.
|
| 159 |
+
|
| 160 |
+
Experimental Results We provide quantitative results in Table 1 with qualitative examples in Fig. 5. Our DMTET achieves significant improvements over all baselines in terms of all metrics. Compared to both ConvOnet [44] and DECORGAN [6], our DMTET reconstructs shapes with better quality when training without adversarial loss (5th column in Fig. 5). Further geometric details, including nails, ears, eyes, mouths, etc, are captured when trained with the adversarial loss (6th column in Fig. 5), significantly improving the realism and visual quality of the generated shape. To demonstrate the generalization ability of our
|
| 161 |
+
|
| 162 |
+

|
| 163 |
+
Figure 6: Qualitative Results of synthesizing highresolution shapes from coarse voxels collected online.
|
| 164 |
+
|
| 165 |
+
DMTET, we collect human-created low-resolution voxels from Turbosquid (shapes unseen in training). We provide qualitative results in Fig. 6. Despite the fact that these human-created shapes have noticeable differences with our coarse voxels used in training, e.g., different ratios of body parts compared with our training shapes (larger head, thinner legs, longer necks), our model faithfully generates high-quality 3D details conditioned on each coarse voxel – an exciting result.
|
| 166 |
+
|
| 167 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>L2 Chamfer↓</td><td rowspan=1 colspan=1>L1 Chamfer↓</td><td rowspan=1 colspan=1>Norm. Cons.↑</td><td rowspan=1 colspan=1>LFD↓</td><td rowspan=1 colspan=1>Cls</td></tr><tr><td rowspan=1 colspan=1>ConvOnet [44]</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>2.41</td><td rowspan=1 colspan=1>0.901</td><td rowspan=1 colspan=1>3220</td><td rowspan=1 colspan=1>0.63</td></tr><tr><td rowspan=1 colspan=1>DECOR [6]-Retv.</td><td rowspan=1 colspan=1>1.32</td><td rowspan=1 colspan=1>3.81</td><td rowspan=1 colspan=1>0.876</td><td rowspan=1 colspan=1>3689</td><td rowspan=1 colspan=1>0.66</td></tr><tr><td rowspan=1 colspan=1>DECOR [6]-Rand.</td><td rowspan=1 colspan=1>2.38</td><td rowspan=1 colspan=1>6.85</td><td rowspan=1 colspan=1>0.797</td><td rowspan=1 colspan=1>5338</td><td rowspan=1 colspan=1>0.67</td></tr><tr><td rowspan=1 colspan=1>DMTET wo Adv.</td><td rowspan=1 colspan=1>0.76</td><td rowspan=1 colspan=1>2.20</td><td rowspan=1 colspan=1>0.916</td><td rowspan=1 colspan=1>2846</td><td rowspan=1 colspan=1>0.58</td></tr><tr><td rowspan=1 colspan=1>DMTET</td><td rowspan=1 colspan=1>0.75</td><td rowspan=1 colspan=1>2.19</td><td rowspan=1 colspan=1>0.918</td><td rowspan=1 colspan=1>2823</td><td rowspan=1 colspan=1>0.54</td></tr></table>
|
| 168 |
+
|
| 169 |
+
Table 1: Super Resolution of Animal Shapes: DMTET significantly outperforms all baselines in all metrics.
|
| 170 |
+
|
| 171 |
+
User Studies We conduct user studies via Amazon Machanical Turk (AMT) to further evaluate the performance of all methods. In particular, we present two shapes that are predicted from two different models to the AMT workers and ask them to evaluate which one is a better looking shape and which one features more realistic details. Detailed experimental settings are provided in the Supplement. We compare DMTET against ConvONet [44], DECOR [6]-Retv, as well as DMTET without adversarial loss (w.o. Adv.). Quantitative results are reported in Table 2. Human judges agree that the shapes generated from our model have better details, compared to all baselines, in a vast majority of the cases. Ablations on using adversarial loss demonstrate the effectiveness of generating higher quality geometry using a discriminator during training.
|
| 172 |
+
|
| 173 |
+
Ablation Studies To evaluate the effectiveness of our volume subdivision and surface subdivision modules, we ablate by sequentially introducing them to the base model (we refer as $\mathrm { D M T E T } _ { B }$ ) which we train on 100-resolution uniform tetrahedral grid without both volume and surface subdivision modules and adversarial
|
| 174 |
+
|
| 175 |
+
Table 2: User Study on 3D Shape Synthesis from Coarse voxels. In each cell, we report percentages of shapes for which the users agree are better looking (left) or have better details (right).
|
| 176 |
+
|
| 177 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>ConvONet[44]</td><td rowspan=1 colspan=1>DECOR[6]-Retv.</td><td rowspan=1 colspan=1>DMTETWoAdv</td></tr><tr><td rowspan=1 colspan=1>Baselinewins</td><td rowspan=1 colspan=1>5% 15%</td><td rowspan=1 colspan=1>26%/17%</td><td rowspan=1 colspan=1>29% /25%</td></tr><tr><td rowspan=1 colspan=1>DMTETwins</td><td rowspan=1 colspan=1>95%/95%</td><td rowspan=1 colspan=1>74% /83%</td><td rowspan=1 colspan=1>71% 175%</td></tr></table>
|
| 178 |
+
|
| 179 |
+
loss. We conduct user studies to evaluate the improvement after each step using the protocol described in the above paragraph. We first reduce the initial resolution to 70 and employ volume subdivision to support higher output resolution (we refer this model as $\mathbf { D M T E T } _ { V }$ ) and compare with $\mathbf { D M T E T } _ { B }$ Predictions by $\mathrm { D M T E T } _ { V }$ wins $78 \%$ of cases over $\mathrm { D M T E T } _ { B }$ for better looking, and $61 \%$ of cases for realistic details, showing that the volume subdivision module is effective in synthesizing shape details. We then add surface subdivision on top of the $\mathbf { D M T E T } _ { V }$ and compare with it. The new model wins $62 \%$ of cases over $\mathrm { D M T E T } _ { V }$ for better looking, and $62 \%$ of cases for realistic details as well, demonstrating the effect of surface subdivision module in enhancing the shape details.
|
| 180 |
+
|
| 181 |
+
# 4.2 Point Cloud 3D Reconstruction
|
| 182 |
+
|
| 183 |
+
Experimental Settings We follow the setting from DefTet [18], and use all 13 categories in ShapeNet [3] core data2, which we pre-process using Kaolin [27] to watertight meshes. We sample 5000 points for each shape and add Gaussian noise with zero mean of standard deviation 0.005. For quantitative evaluation, we report the L1 Chamfer Distance in the main paper, and refer readers to the Supplement for results in other metrics (3D IoU, L2 Chamfer Distance and F1 score). We additionally report average inference time on the same Nvidia V100 GPU.
|
| 184 |
+
|
| 185 |
+
We compare DMTET against state-of-the-art 3D reconstruction approaches using different representations: voxels [10], deforming a mesh with a fixed template [54], deforming a mesh generated from a volumetric representation [22], DefTet [18], and implicit functions [44]. For a fair comparison, we use the same point cloud encoder for all the methods, and adopt the decoders in the original papers to generate shapes in different representations. We also remove the adversarial loss in this application, since baselines also do not have it. We further compare with oracle performance of MC/MT where the ground truth SDF is utilized to extract iso-surface using MC/MT.
|
| 186 |
+
|
| 187 |
+
Experimental Results Quantitative results are summarized in Table 3, with a few qualitative examples shown in Fig. 7. Compared to DMC [31], which also predicts the SDF values and supervises with a surface loss, DMTET achieves much better reconstruction quality since training using the marching tetrahedra layer is more efficient than calculating an expectation over all possible configurations within one grid cell as done in DMC [31]. Compared to a method that deforms a fixed template (sphere) [54], we reconstruct shapes with different topologies, achieving more faithful results compared to the ground truth shape. When compared with other explicit surface representations that also support different topology [18, 22], our method achieves higher quality results for local geometry, benefiting from the fact that the typology is jointly optimized with the geometry, whereas it is separately supervised by an occupancy loss in [18, 22]. Compared to a neural implicit method [44], we generate higher quality shapes with less artifacts, while running significantly faster at inference. Finally, compared to a voxel-based method [10] at the same resolution, our method recovers more geometric details, benefiting from the predicted vertex deformations as well as the surface loss.
|
| 188 |
+
|
| 189 |
+

|
| 190 |
+
Figure 7: Qualitative results on 3D Reconstruction from Point Clouds: Our model reconstructs shapes with more geometric details compared to baselines.
|
| 191 |
+
|
| 192 |
+
Table 3: Quantitative Results on Point Cloud Reconstruction (Chamfer L1). Note that all the networks in the baselines are not designed for this task, and thus we use the same encoder and their decoder for a fair comparison. We also ablate ourselves by operating on fixed grid (DMTET wo (Def, Vol., Surf.)), removing volume subdivision (DMTET wo Vol.), or surface subdivision (DMTET wo Surf.), or the both (DMTET wo (Vol., Surf.)).
|
| 193 |
+
|
| 194 |
+
<table><tr><td>Category</td><td>Airplane</td><td>Bench</td><td>Dresser</td><td>Car</td><td>Chair</td><td>Display</td><td>Lamp</td><td>Speaker</td><td>Rifle</td><td>Sofa</td><td>Table</td><td>Phone</td><td>Vessel</td><td>Mean↓</td><td>Time(ms)</td></tr><tr><td>3D-R2N2[10]</td><td>1.48</td><td>1.59</td><td>1.64</td><td>1.62</td><td>1.70</td><td>1.66</td><td>1.74</td><td>1.74</td><td>1.37</td><td>1.60</td><td>1.78</td><td>1.55</td><td>1.51</td><td>1.61</td><td>174</td></tr><tr><td>DMC [31]</td><td>1.57</td><td>1.47</td><td>1.29</td><td>1.67</td><td>1.44</td><td>1.25</td><td>2.15</td><td>1.49</td><td>1.45</td><td>1.19</td><td>1.33</td><td>0.88</td><td>1.70</td><td>1.45</td><td>349</td></tr><tr><td>Pixel2mesh [54]</td><td>0.98</td><td>1.28</td><td>1.44</td><td>1.19</td><td>1.91</td><td>1.25</td><td>2.07</td><td>1.61</td><td>0.91</td><td>1.15</td><td>1.82</td><td>0.83</td><td>1.12</td><td>1.35</td><td>30</td></tr><tr><td>ConvOnet [44]</td><td>0.82</td><td>0.95</td><td>0.96</td><td>1.12</td><td>1.03</td><td>0.93</td><td>1.22</td><td>1.12</td><td>0.79</td><td>0.91</td><td>0.94</td><td>0.67</td><td>0.99</td><td>0.95</td><td>866</td></tr><tr><td>MeshRCNN [22]</td><td>0.88</td><td>1.01</td><td>1.05</td><td>1.14</td><td>1.10</td><td>0.99</td><td>1.20</td><td>1.21</td><td>0.83</td><td>0.96</td><td>1.00</td><td>0.71</td><td>1.03</td><td>1.01</td><td>228</td></tr><tr><td>DEFTET[18]</td><td>0.85</td><td>0.94</td><td>0.97</td><td>1.13</td><td>1.04</td><td>0.92</td><td>1.28</td><td>1.17</td><td>0.85</td><td>0.90</td><td>0.93</td><td>0.65</td><td>0.99</td><td>0.97</td><td>61</td></tr><tr><td>DMTET wo (Def, Vol., Surf.)]</td><td>0.82</td><td>0.96</td><td>0.94</td><td>0.98</td><td>0.99</td><td>0.90</td><td>1.04</td><td>1.03</td><td>0.80</td><td>0.86</td><td>0.93</td><td>0.65</td><td>0.89</td><td>0.91</td><td></td></tr><tr><td>DMTET wo (Vol.,Surf.)</td><td>0.69</td><td>0.82</td><td>0.88</td><td>0.92</td><td>0.92</td><td>0.82</td><td>0.89</td><td>0.97</td><td>0.65</td><td>0.81</td><td>0.84</td><td>0.61</td><td>0.80</td><td>0.81</td><td>52 52</td></tr><tr><td>DMTET wo Vol.</td><td>0.65</td><td>0.78</td><td>0.84</td><td>0.89</td><td>0.89</td><td>0.79</td><td>0.86</td><td>0.95</td><td>0.61</td><td>0.78</td><td>0.79</td><td>0.60</td><td>0.78</td><td>0.79</td><td>67</td></tr><tr><td>DMTET wo Surf.</td><td>0.63</td><td>0.77</td><td>0.84</td><td>0.88</td><td>0.88</td><td>0.79</td><td>0.84</td><td>0.94</td><td>0.60</td><td>0.78</td><td>0.79</td><td>0.59</td><td>0.76</td><td>0.78</td><td>108</td></tr><tr><td>DMTET</td><td>0.62</td><td>0.76</td><td>0.83</td><td>0.87</td><td>0.88</td><td>0.78</td><td>0.84</td><td>0.94</td><td>0.59</td><td>0.77</td><td>0.78</td><td>0.57</td><td>0.76</td><td>0.77</td><td>129</td></tr></table>
|
| 195 |
+
|
| 196 |
+
# 4.2.1 Analysis
|
| 197 |
+
|
| 198 |
+
We investigate how each component in our representation affects the performance and reconstruction quality.
|
| 199 |
+
|
| 200 |
+
Comparisons with Oracle Performance of MC/MT We first demonstrate the effect of learning on explicit surface via MT. We compare with the oracle performance of extracting the iso-surface with MT/MC from the ground truth signed distance fields on the Chair test set in ShapeNet, which contains diverse high-quality details. Specifically, for MC/MT, we first compute the discretized SDF at different grid resolutions, and compare the extracted surface to the ground truth surface.
|
| 201 |
+
|
| 202 |
+

|
| 203 |
+
Figure 8: Comparing our DMTET with oracle performance of MC and MT.
|
| 204 |
+
|
| 205 |
+
As shown in Fig. 8, MT consistently outperforms MC when querying the same number of points. We found the staggered grids pattern in tetrahedral grid [16, 18] better captures thin structures at a limited resolution (Fig. 9). This makes MT a better choice for efficiency reasons. The usage of tetrahedral mesh in DMTET follows this motivation. Without deforming the grid, DMTET outperforms the oracle performance of MT by a large margin when querying the same number of points, although DMTET predicts the surface from noisy point cloud. This demonstrates that directly optimizing the reconstructed surface can mitigate the discretization errors imposed by MT to a large extent.
|
| 206 |
+
|
| 207 |
+

|
| 208 |
+
Figure 9: We compare trained DMTET to oracle performance of MT and MC. Number in bracket indicates number of SDF points queried.
|
| 209 |
+
|
| 210 |
+
Ablation Studies We further provide ablation studies on the entire ShapeNet test set, which is summarized in Tab. 3. We first compare the version where we only predict SDF values without learning to deform the vertices and volume/surface subdivision with the version that predicts both SDF and the deformation. Predicting deformation along with SDF is significantly more performant, since vertex movements allow for a better reconstruction of the underlying surface. This is especially true for categories with thin structures (e.g. lamp) where the grid vertices are desired to align with them. We further ablate the use of volume subdivision and surface subdivision. We show that each component provides an improvement. In particular, volume subdivision has a significant
|
| 211 |
+
|
| 212 |
+
improvement for object categories with fine-grained structural details, such as airplane and lamp, which require higher grid resolutions to model the occupancy change. Surface subdivision generates shapes with a parametric surface, avoiding the quantization errors in the planar faces and produces more visually pleasing results.
|
| 213 |
+
|
| 214 |
+
# 5 Conclusion
|
| 215 |
+
|
| 216 |
+
In this paper, we introduced a deep 3D conditional generative model that can synthesize highresolution 3D shapes using simple user guides such as coarse voxels. Our DMTET features a novel 3D representation that marries implicit and explicit representations by leveraging the advantages of both. We experimentally show that our approach synthesizes significantly higher quality shapes with better geometric details than existing methods, confirmed by quantitative metrics and an extensive user study. By showcasing the ability to upscale coarse voxels such as Minecraft shapes, we hope that we take one step closer to democratizing 3D content creation.
|
| 217 |
+
|
| 218 |
+
# 6 Broad Impact
|
| 219 |
+
|
| 220 |
+
Many fields such as AR/VR, robotics, architecture, gaming and film rely on high-quality 3D content. Creating such content, however, requires human experts, i.e., experienced artists, and a significant amount of development time. In contrast, platforms like Minecraft enable millions of users around the world to carve out coarse shapes with simple blocks. Our work aims at creating A.I. tools that would enable even novice users to upscale simple, low-resolution shapes into high resolution, beautiful 3D content. Our method currently focuses on 3D animal shapes. We are not currently aware of and do not foresee nefarious use cases of our method.
|
| 221 |
+
|
| 222 |
+
# 7 Disclosure of Funding
|
| 223 |
+
|
| 224 |
+
This work was funded by NVIDIA. Tianchang Shen and Jun Gao acknowledge additional revenue in the form of student scholarships from University of Toronto and the Vector Institute, which are not in direct support of this work.
|
| 225 |
+
|
| 226 |
+
# References
|
| 227 |
+
|
| 228 |
+
[1] Matan Atzmon and Yaron Lipman. Sal: Sign agnostic learning of shapes from raw data. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2565–2574, 2020.
|
| 229 |
+
[2] Andrew Brock, Theodore Lim, James M Ritchie, and Nick Weston. Generative and discriminative voxel modeling with convolutional neural networks. arXiv preprint arXiv:1608.04236, 2016. [3] Angel X Chang, Thomas Funkhouser, Leonidas Guibas, Pat Hanrahan, Qixing Huang, Zimo Li, Silvio Savarese, Manolis Savva, Shuran Song, Hao Su, et al. Shapenet: An information-rich 3d model repository. arXiv preprint arXiv:1512.03012, 2015.
|
| 230 |
+
[4] Ding-Yun Chen, Xiao-Pei Tian, Yu-Te Shen, and Ming Ouhyoung. On visual similarity based 3d model retrieval. In Computer graphics forum, volume 22, pages 223–232. Wiley Online Library, 2003.
|
| 231 |
+
[5] Wenzheng Chen, Jun Gao, Huan Ling, Edward Smith, Jaakko Lehtinen, Alec Jacobson, and Sanja Fidler. Learning to predict 3d objects with an interpolation-based differentiable renderer. In Advances In Neural Information Processing Systems, 2019.
|
| 232 |
+
[6] Zhiqin Chen, Vladimir G. Kim, Matthew Fisher, Noam Aigerman, Hao Zhang, and Siddhartha Chaudhuri. Decor-gan: 3d shape detailization by conditional refinement. Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2021.
|
| 233 |
+
[7] Zhiqin Chen, Andrea Tagliasacchi, and Hao Zhang. Bsp-net: Generating compact meshes via binary space partitioning. Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020. [8] Zhiqin Chen and Hao Zhang. Learning implicit fields for generative shape modeling. Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019.
|
| 234 |
+
[9] Julian Chibane, Aymen Mir, and Gerard Pons-Moll. Neural unsigned distance fields for implicit function learning. In Advances in Neural Information Processing Systems (NeurIPS), December 2020.
|
| 235 |
+
[10] Christopher B Choy, Danfei Xu, JunYoung Gwak, Kevin Chen, and Silvio Savarese. 3d-r2n2: A unified approach for single and multi-view 3d object reconstruction. In European conference on computer vision, pages 628–644. Springer, 2016.
|
| 236 |
+
[11] Angela Dai, Daniel Ritchie, Martin Bokeloh, Scott Reed, Jürgen Sturm, and Matthias Nießner. Scancomplete: Large-scale scene completion and semantic segmentation for 3d scans. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4578–4587, 2018.
|
| 237 |
+
[12] Angela Dai, Charles Ruizhongtai Qi, and Matthias Nießner. Shape completion using 3d-encoder-predictor cnns and shape synthesis. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5868–5877, 2017.
|
| 238 |
+
[13] Thomas Davies, Derek Nowrouzezahrai, and Alec Jacobson. Overfit neural networks as a compact shape representation. arXiv preprint arXiv:2009.09808, 2020.
|
| 239 |
+
[14] Yu Deng, Jiaolong Yang, and Xin Tong. Deformed implicit field: Modeling 3d shapes with learned dense correspondence. In IEEE Computer Vision and Pattern Recognition, 2021.
|
| 240 |
+
[15] Akio Doi and Akio Koide. An efficient method of triangulating equi-valued surfaces by using tetrahedral cells. IEICE TRANSACTIONS on Information and Systems, 74(1):214–224, 1991.
|
| 241 |
+
[16] Crawford Doran, Athena Chang, and Robert Bridson. Isosurface stuffing improved: acute lattices and feature matching. In ACM SIGGRAPH 2013 Talks, pages 1–1, 2013.
|
| 242 |
+
[17] Yueqi Duan, Haidong Zhu, He Wang, Li Yi, Ram Nevatia, and Leonidas J Guibas. Curriculum deepsdf. In European Conference on Computer Vision, pages 51–67. Springer, 2020.
|
| 243 |
+
[18] Jun Gao, Wenzheng Chen, Tommy Xiang, Clement Fuji Tsang, Alec Jacobson, Morgan McGuire, and Sanja Fidler. Learning deformable tetrahedral meshes for 3d reconstruction. In Advances In Neural Information Processing Systems, 2020.
|
| 244 |
+
[19] Jun Gao, Chengcheng Tang, Vignesh Ganapathi-Subramanian, Jiahui Huang, Hao Su, and Leonidas J Guibas. Deepspline: Data-driven reconstruction of parametric curves and surfaces. arXiv preprint arXiv:1901.03781, 2019.
|
| 245 |
+
[20] Jun Gao, Zian Wang, Jinchen Xuan, and Sanja Fidler. Beyond fixed grid: Learning geometric image representation with a deformable grid. In ECCV, 2020.
|
| 246 |
+
[21] Lin Gao, Jie Yang, Tong Wu, Yu-Jie Yuan, Hongbo Fu, Yu-Kun Lai, and Hao Zhang. Sdm-net: Deep generative network for structured deformable mesh. ACM Transactions on Graphics (TOG), 38(6):1–15, 2019.
|
| 247 |
+
[22] Georgia Gkioxari, Jitendra Malik, and Justin Johnson. Mesh r-cnn. In Proceedings of the IEEE International Conference on Computer Vision, pages 9785–9795, 2019.
|
| 248 |
+
[23] Thibault Groueix, Matthew Fisher, Vladimir G Kim, Bryan C Russell, and Mathieu Aubry. A papier-mâché approach to learning 3d surface generation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 216–224, 2018.
|
| 249 |
+
[24] Christian Häne, Shubham Tulsiani, and Jitendra Malik. Hierarchical surface prediction for 3d object reconstruction. In 2017 International Conference on 3D Vision (3DV), pages 412–420. IEEE, 2017.
|
| 250 |
+
[25] Rana Hanocka, Gal Metzer, Raja Giryes, and Daniel Cohen-Or. Point2mesh: A self-prior for deformable meshes. ACM Trans. Graph., 39(4), 2020.
|
| 251 |
+
[26] Zekun Hao, Hadar Averbuch-Elor, Noah Snavely, and Serge Belongie. Dualsdf: Semantic shape manipulation using a two-level representation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 7631–7641, 2020.
|
| 252 |
+
[27] Krishna Murthy J., Edward Smith, Jean-Francois Lafleche, Clement Fuji Tsang, Artem Rozantsev, Wenzheng Chen, Tommy Xiang, Rev Lebaredian, and Sanja Fidler. Kaolin: A pytorch library for accelerating 3d deep learning research. arXiv:1911.05063, 2019.
|
| 253 |
+
[28] Marian Kleineberg, Matthias Fey, and Frank Weichert. Adversarial generation of continuous implicit shape representations. arXiv preprint arXiv:2002.00349, 2020.
|
| 254 |
+
[29] Jiabao Lei and Kui Jia. Analytic marching: An analytic meshing solution from deep implicit surface networks. In International Conference on Machine Learning, pages 5789–5798. PMLR, 2020.
|
| 255 |
+
[30] Manyi Li and Hao Zhang. D2im-net: Learning detail disentangled implicit fields from single images. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10246– 10255, 2021.
|
| 256 |
+
[31] Yiyi Liao, Simon Donné, and Andreas Geiger. Deep marching cubes: Learning explicit surface representations. In Conference on Computer Vision and Pattern Recognition (CVPR), 2018.
|
| 257 |
+
[32] Huan Ling, Jun Gao, Amlan Kar, Wenzheng Chen, and Sanja Fidler. Fast interactive object annotation with curve-gcn. In CVPR, 2019.
|
| 258 |
+
[33] Hsueh-Ti Derek Liu, Vladimir G. Kim, Siddhartha Chaudhuri, Noam Aigerman, and Alec Jacobson. Neural subdivision. ACM Trans. Graph., 39(4), 2020.
|
| 259 |
+
[34] Zhijian Liu, Haotian Tang, Yujun Lin, and Song Han. Point-voxel cnn for efficient 3d deep learning. In Advances in Neural Information Processing Systems, 2019.
|
| 260 |
+
[35] Charles Loop. Smooth subdivision surfaces based on triangles. January 1987.
|
| 261 |
+
[36] William E Lorensen and Harvey E Cline. Marching cubes: A high resolution 3d surface construction algorithm. ACM siggraph computer graphics, 21(4):163–169, 1987.
|
| 262 |
+
[37] Xudong Mao, Qing Li, Haoran Xie, Raymond YK Lau, Zhen Wang, and Stephen Paul Smolley. Least squares generative adversarial networks. In Proceedings of the IEEE international conference on computer vision, pages 2794–2802, 2017.
|
| 263 |
+
[38] Daniel Maturana and Sebastian Scherer. Voxnet: A 3d convolutional neural network for real-time object recognition. In 2015 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pages 922–928. IEEE, 2015.
|
| 264 |
+
[39] Lars Mescheder, Michael Oechsle, Michael Niemeyer, Sebastian Nowozin, and Andreas Geiger. Occupancy networks: Learning 3d reconstruction in function space. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4460–4470, 2019.
|
| 265 |
+
[40] Ben Mildenhall, Pratul P. Srinivasan, Matthew Tancik, Jonathan T. Barron, Ravi Ramamoorthi, and Ren Ng. Nerf: Representing scenes as neural radiance fields for view synthesis. In ECCV, 2020.
|
| 266 |
+
[41] Charlie Nash, Yaroslav Ganin, S. M. Ali Eslami, and Peter W. Battaglia. Polygen: An autoregressive generative model of 3d meshes. ICML, 2020.
|
| 267 |
+
[42] Jeong Joon Park, Peter Florence, Julian Straub, Richard Newcombe, and Steven Lovegrove. Deepsdf: Learning continuous signed distance functions for shape representation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 165–174, 2019.
|
| 268 |
+
[43] Despoina Paschalidou, Angelos Katharopoulos, Andreas Geiger, and Sanja Fidler. Neural parts: Learning expressive 3d shape abstractions with invertible neural networks. In Proceedings IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2021.
|
| 269 |
+
|
| 270 |
+
[44] Songyou Peng, Michael Niemeyer, Lars Mescheder, Marc Pollefeys, and Andreas Geiger. Convolutional occupancy networks. In European Conference on Computer Vision (ECCV), 2020.
|
| 271 |
+
|
| 272 |
+
[45] Edoardo Remelli, Artem Lukoianov, Stephan Richter, Benoit Guillard, Timur Bagautdinov, Pierre Baque, and Pascal Fua. Meshsdf: Differentiable iso-surface extraction. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 22468–22478. Curran Associates, Inc., 2020.
|
| 273 |
+
|
| 274 |
+
[46] Gernot Riegler, Ali Osman Ulusoy, and Andreas Geiger. Octnet: Learning deep 3d representations at high resolutions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3577–3586, 2017.
|
| 275 |
+
|
| 276 |
+
[47] Shunsuke Saito, Zeng Huang, Ryota Natsume, Shigeo Morishima, Angjoo Kanazawa, and Hao Li. Pifu: Pixel-aligned implicit function for high-resolution clothed human digitization. In The IEEE International Conference on Computer Vision (ICCV), October 2019.
|
| 277 |
+
|
| 278 |
+
[48] Shunsuke Saito, Tomas Simon, Jason Saragih, and Hanbyul Joo. Pifuhd: Multi-level pixel-aligned implicit function for high-resolution 3d human digitization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, June 2020.
|
| 279 |
+
|
| 280 |
+
[49] Vincent Sitzmann, Julien N.P. Martel, Alexander W. Bergman, David B. Lindell, and Gordon Wetzstein. Implicit neural representations with periodic activation functions. In Proc. NeurIPS, 2020.
|
| 281 |
+
|
| 282 |
+
[50] Minhyuk Sung, Hao Su, Vladimir G Kim, Siddhartha Chaudhuri, and Leonidas Guibas. Complementme: Weakly-supervised component suggestions for 3d modeling. ACM Transactions on Graphics (TOG), 36(6):1–12, 2017.
|
| 283 |
+
|
| 284 |
+
[51] Towaki Takikawa, Joey Litalien, Kangxue Yin, Karsten Kreis, Charles Loop, Derek Nowrouzezahrai, Alec Jacobson, Morgan McGuire, and Sanja Fidler. Neural geometric level of detail: Real-time rendering with implicit 3D shapes. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2021.
|
| 285 |
+
|
| 286 |
+
[52] M. Tatarchenko, A. Dosovitskiy, and T. Brox. Octree generating networks: Efficient convolutional architectures for high-resolution 3d outputs. In IEEE International Conference on Computer Vision (ICCV), 2017.
|
| 287 |
+
|
| 288 |
+
[53] Shubham Tulsiani, Hao Su, Leonidas J. Guibas, Alexei A. Efros, and Jitendra Malik. Learning shape abstractions by assembling volumetric primitives. In Computer Vision and Pattern Regognition (CVPR), 2017.
|
| 289 |
+
|
| 290 |
+
[54] Nanyang Wang, Yinda Zhang, Zhuwen Li, Yanwei Fu, Wei Liu, and Yu-Gang Jiang. Pixel2mesh: Generating 3d mesh models from single rgb images. In Proceedings of the European Conference on Computer Vision (ECCV), pages 52–67, 2018.
|
| 291 |
+
|
| 292 |
+
[55] Peng-Shuai Wang, Yang Liu, Yu-Xiao Guo, Chun-Yu Sun, and Xin Tong. O-CNN: Octree-based Convolutional Neural Networks for 3D Shape Analysis. ACM Transactions on Graphics (SIGGRAPH), 36(4), 2017.
|
| 293 |
+
|
| 294 |
+
[56] Peng-Shuai Wang, Yang Liu, and Xin Tong. Deep octree-based cnns with output-guided skip connections for 3d shape and scene completion. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pages 266–267, 2020.
|
| 295 |
+
|
| 296 |
+
[57] Francis Williams, Matthew Trager, Joan Bruna, and Denis Zorin. Neural splines: Fitting 3d surfaces with infinitely-wide neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9949–9958, 2021.
|
| 297 |
+
|
| 298 |
+
[58] Jiajun Wu, Chengkai Zhang, Tianfan Xue, William T Freeman, and Joshua B Tenenbaum. Learning a probabilistic latent space of object shapes via 3d generative-adversarial modeling. In Advances in Neural Information Processing Systems, pages 82–90, 2016.
|
| 299 |
+
|
| 300 |
+
[59] Zhirong Wu, Shuran Song, Aditya Khosla, Fisher Yu, Linguang Zhang, Xiaoou Tang, and Jianxiong Xiao. 3d shapenets: A deep representation for volumetric shapes. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1912–1920, 2015.
|
| 301 |
+
|
| 302 |
+
[60] Qiangeng Xu, Weiyue Wang, Duygu Ceylan, Radomir Mech, and Ulrich Neumann. Disn: Deep implicit surface network for high-quality single-view 3d reconstruction. In Advances in Neural Information Processing Systems, pages 490–500, 2019.
|
| 303 |
+
|
| 304 |
+
[61] Kangxue Yin, Zhiqin Chen, Siddhartha Chaudhuri, Matthew Fisher, Vladimir Kim, and Hao Zhang. Coalesce: Component assembly by learning to synthesize connections. In Proc. of 3DV, 2020.
|
| 305 |
+
[62] Chenyang Zhu, Kai Xu, Siddhartha Chaudhuri, Renjiao Yi, and Hao Zhang. SCORES: Shape composition with recursive substructure priors. ACM Transactions on Graphics, 37(6):Article 211, 2018.
|
| 306 |
+
|
| 307 |
+
# Checklist
|
| 308 |
+
|
| 309 |
+
1. For all authors...
|
| 310 |
+
|
| 311 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] We provide extensive experiments in Sec. 4.
|
| 312 |
+
(b) Did you describe the limitations of your work? [Yes] We provide the discussion on limitations an failure cases in Supplement.
|
| 313 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes] We provide the discussion in the Board Impact section with further discussions in Supplement.
|
| 314 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 315 |
+
|
| 316 |
+
2. If you are including theoretical results...
|
| 317 |
+
|
| 318 |
+
(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
|
| 319 |
+
|
| 320 |
+
3. If you ran experiments...
|
| 321 |
+
|
| 322 |
+
(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)? [No] The code is currently quite uncleaned and requires many dependencies. We are planning to release the code after cleaning.
|
| 323 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] We provide training details in both Sec. 4 in the main paper and Supplement.
|
| 324 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No] Training existing 3D models, including ours, on large-scale 3D datasets is too computation costly to repeat multiple times.
|
| 325 |
+
(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] We provide in the Supplement.
|
| 326 |
+
|
| 327 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 328 |
+
|
| 329 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] We used ShapeNet [3] core dataset in Sec. 4.2. We also used official code to reproduce baselines with citations. In particular, ConvONet [44] and DECOR-GAN [6].
|
| 330 |
+
(b) Did you mention the license of the assets? [Yes] We provided the license of ShapeNet and Turbosquid.
|
| 331 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [No] The Turbosquid data we are using contains proprietary information.
|
| 332 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [Yes] We discussed in the Sec. 4 and provide further details in the Supplementary Materials.
|
| 333 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [Yes] We provide discussion on this in Supplement.
|
| 334 |
+
|
| 335 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 336 |
+
|
| 337 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [Yes] We provide details in the paper, with full text and screenshot in Supplement.
|
| 338 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [No] We did not anticipate the potential participant risks, as we only conduct human studies on generated animals.
|
| 339 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [Yes] We provide details in Supplement
|