Datasets:
Add files using upload-large-folder tool
Browse files- md/train/--rcOeCKRh/--rcOeCKRh.md +236 -0
- md/train/5GihaaZKL4/5GihaaZKL4.md +394 -0
- md/train/9Y7_c5ZAd5i/9Y7_c5ZAd5i.md +0 -0
- md/train/9c-IsSptbmA/9c-IsSptbmA.md +257 -0
- md/train/B1eB5xSFvr/B1eB5xSFvr.md +432 -0
- md/train/B1gJ1L2aW/B1gJ1L2aW.md +289 -0
- md/train/B1lda1HtvB/B1lda1HtvB.md +600 -0
- md/train/BJe932EYwS/BJe932EYwS.md +342 -0
- md/train/Bk7wvW-C-/Bk7wvW-C-.md +261 -0
- md/train/Bki4EfWCb/Bki4EfWCb.md +366 -0
- md/train/BylVcTNtDS/BylVcTNtDS.md +251 -0
- md/train/BysZhEqee/BysZhEqee.md +277 -0
- md/train/CR1XOQ0UTh-/CR1XOQ0UTh-.md +0 -0
- md/train/DPHsCQ8OpA/DPHsCQ8OpA.md +335 -0
- md/train/H1egcgHtvB/H1egcgHtvB.md +260 -0
- md/train/H1lGHsA9KX/H1lGHsA9KX.md +321 -0
- md/train/HJxYwiC5tm/HJxYwiC5tm.md +242 -0
- md/train/HkgB2TNYPS/HkgB2TNYPS.md +499 -0
- md/train/HkgaETNtDB/HkgaETNtDB.md +391 -0
- md/train/HkgrZ0EYwB/HkgrZ0EYwB.md +346 -0
- md/train/HkuGJ3kCb/HkuGJ3kCb.md +0 -0
- md/train/I3HOxaZIJ0J/I3HOxaZIJ0J.md +487 -0
- md/train/L7Irrt5sMQa/L7Irrt5sMQa.md +537 -0
- md/train/Ov_sMNau-PF/Ov_sMNau-PF.md +331 -0
- md/train/PKubaeJkw3/PKubaeJkw3.md +396 -0
- md/train/S1efxTVYDr/S1efxTVYDr.md +440 -0
- md/train/SPrVNsXnGd/SPrVNsXnGd.md +313 -0
- md/train/Syl7OsRqY7/Syl7OsRqY7.md +570 -0
- md/train/Syx72jC9tm/Syx72jC9tm.md +345 -0
- md/train/Ysuv-WOFeKR/Ysuv-WOFeKR.md +352 -0
- md/train/ZsGg52s-cQZ/ZsGg52s-cQZ.md +273 -0
- md/train/aDjoksTpXOP/aDjoksTpXOP.md +768 -0
- md/train/aFvG-DNPNB9/aFvG-DNPNB9.md +288 -0
- md/train/fATZNtA1-V0/fATZNtA1-V0.md +251 -0
- md/train/fmgYOUahK9/fmgYOUahK9.md +263 -0
- md/train/iKQAk8a2kM0/iKQAk8a2kM0.md +434 -0
- md/train/lxHgXYN4bwl/lxHgXYN4bwl.md +0 -0
- md/train/nYz2_BbZnYk/nYz2_BbZnYk.md +268 -0
- md/train/r1gRTCVFvB/r1gRTCVFvB.md +339 -0
- md/train/r1kNDlbCb/r1kNDlbCb.md +309 -0
- md/train/rG2ponW2Si/rG2ponW2Si.md +257 -0
- md/train/rJYFzMZC-/rJYFzMZC-.md +335 -0
- md/train/rJlUhhVYvS/rJlUhhVYvS.md +0 -0
- md/train/rk6cfpRjZ/rk6cfpRjZ.md +239 -0
- md/train/rk6qdGgCZ/rk6qdGgCZ.md +252 -0
- md/train/ryGDEjCcK7/ryGDEjCcK7.md +243 -0
- md/train/rylSzl-R-/rylSzl-R-.md +601 -0
- md/train/tPCrkaLa9Y5ld/tPCrkaLa9Y5ld.md +200 -0
- md/train/x2TMPhseWAW/x2TMPhseWAW.md +427 -0
- md/train/xpFFI_NtgpW/xpFFI_NtgpW.md +369 -0
md/train/--rcOeCKRh/--rcOeCKRh.md
ADDED
|
@@ -0,0 +1,236 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CROSS-SUPERVISED OBJECT DETECTION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
After learning a new object category from image-level annotations (with no object bounding boxes), humans are remarkably good at precisely localizing those objects. However, building good object localizers (i.e., detectors) currently requires expensive instance-level annotations. While some work has been done on learning detectors from weakly labeled samples (with only class labels), these detectors do poorly at localization. In this work, we show how to build better object detectors from weakly labeled images of new categories by leveraging knowledge learned from fully labeled base categories. We call this learning paradigm cross-supervised object detection. While earlier works investigated this paradigm, they did not apply it to realistic complex images (e.g., COCO), and their performance was poor. We propose a unified framework that combines a detection head trained from instance-level annotations and a recognition head learned from image-level annotations, together with a spatial correlation module that bridges the gap between detection and recognition. These contributions enable us to better detect novel objects with image-level annotations in complex multi-object scenes such as the COCO dataset.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep architectures have achieved great success in many computer vision tasks including object recognition and the closely related problem of object detection. Modern detectors, such as the Faster RCNN (Ren et al., 2015), YOLO (Redmon et al., 2016), and RetinaNet (Lin et al., 2017), use the same network backbone as popular recognition models. However, even with the same backbone architectures, detection and recognition models require different types of supervision. A good detector relies heavily on precise bounding boxes and labels for each instance (we shall refer to these as instance-level annotations), whereas a recognition model needs only image-level labels. Needless to say, it is more time consuming and expensive to obtain high quality bounding box annotations than class labels. As a result, current detectors are limited to a small set of categories relative to their object recognition counterparts. To address this limitation, it is natural to ask, “Is it possible to learn detectors with only class labels?” This problem is commonly referred to as weakly supervised object detection (WSOD).
|
| 12 |
+
|
| 13 |
+
Early WSOD work (Hoffman et al., 2014) showed fair performance by directly applying recognition networks to object detection. More recently, researchers have used multiple instance learning methods (Dietterich et al., 1997) to recast WSOD as a multi-label classification problem (Bilen & Vedaldi, 2016). However, these weakly supervised detectors perform poorly at localization. Most WSOD experiments have been conducted on the ILSVRC (Russakovsky et al., 2015) data set, in which images have only a single object, or on the PASCAL VOC (Everingham et al., 2010) data set, which has only 20 categories. The simplicity of these data sets limits the number and types of distractors in an image, making localization substantially easier. Learning from only class labels, it is challenging to detect objects at different scales in an image that contains many distractors. In particular, as shown in our experiments, weakly supervised object detectors do not work well in complex multi-object scenes, such as the COCO dataset (Lin et al., 2014).
|
| 14 |
+
|
| 15 |
+
To address this challenge, we focus on a form of learning in which the localization of classes with only object labels (weakly labeled classes) can benefit from other classes that have ground truth bounding boxes (fully labeled classes). We refer to this interesting learning paradigm as crosssupervised object detection (CSOD). While several works (Hoffman et al., 2014; Tang et al., 2016;
|
| 16 |
+
|
| 17 |
+
Yang et al., 2019a; Redmon & Farhadi, 2017) have explored this problem before, they still have the same limitation as the WSOD work we mentioned above. Those cross-supervised object detectors work under simplified scenarios (e.g., ILSVRC data set) where images contain single objects and are object-centered. They struggle to learn under more complex and realistic scenarios, where there are multiple objects from potentially very different classes, and objects could be small and appear anywhere in the images. In this work, we show that by doing multi-task learning on both weaklysupervised base classes and fully-supervised novel classes, our model is able to learn a good detector under the CSOD setting.
|
| 18 |
+
|
| 19 |
+
More formally, we define CSOD as follows. At training time, we are given 1) images contain objects from both base and novel classes, 2) both class labels and ground truth bounding boxes for base objects, and 3) only class labels for novel objects. Our goal is to detect novel objects. In CSOD, base classes and novel classes are disjoint. Thus, it can be seen as performing fullysupervised detection on the base classes and weakly supervised detection on the novel classes. It has similarities to both transfer learning and semi-supervised learning, since it transfer knowledge from base class to novel class and have more information about some instances than other instances. However, CSOD represents a distinct and novel paradigm for learning.
|
| 20 |
+
|
| 21 |
+
The current weakly-supervised method has several drawbacks to learn from a multi objects image. As shown in Fig. 1, a weakly supervised object detector tends to detect only the most discriminating part of novel objects instead of the whole object. Notice how only the head of the person, and not the whole body, is detected. Another issue is that the localizer for one object (e.g., the horse) may be confused by the occurrence of another object, such as the person on the horse. This example illustrates the gap between detection and recognition: without ground truth bounding boxes, the detector acts like a standard recognition model – focusing on discriminating rather than detecting.
|
| 22 |
+
|
| 23 |
+
In this paper, we explore two major mechanisms for improving on this. Our first mechanism is unifying detection and recognition. Using the same network backbone architecture, recognition and detection can be seen as image-level classification and region-level classification respectively, suggesting a strong relation between them. In particular, it suggests a shared training framework in which the same backbone is used with different heads for detection and recognition. Thus, we combine a detection head learned from ground truth bounding boxes, and a recognition head learned in a weakly supervised fashion from class labels. Unlike a traditional recognition head, our recognition head produces a class score for multiple proposals and is capable of detecting objects. The second mechanism is learning a spatial correlation module to reduce the gap between detection and recognition. It takes several high-confidence bounding boxes produced by the recognition head as input, and learns to regress ground truth bounding boxes. By combining these mechanisms together, our model outperforms all previous models when all novel objects are weakly labeled.
|
| 24 |
+
|
| 25 |
+
In summary, our contributions are three-fold. First, we define a new task—cross-supervised object detection, which enables us to leverage knowledge from fully labeled base categories to help learn a robust detector from novel object class labels only. Second, we propose a unified framework in which two heads are learned from class labels and detection labels respectively, along with a spatial correlation module bridging the gap between recognition and detection. Third, we significantly outperform existing methods (Zhang et al. (2018a); Tang et al. (2017; 2018)) on PASCAL VOC and COCO, suggesting that CSOD could be a promising approach for expanding object detection to a much larger number of categories.
|
| 26 |
+
|
| 27 |
+
# 2 RELATED WORK
|
| 28 |
+
|
| 29 |
+
Weakly supervised object detection. WSOD (Kosugi et al. (2019); Zeng et al. (2019); Yang et al. (2019b); Wan et al. (2019); Arun et al. (2019); Wan et al. (2018); Zhang et al. (2018b); Ren et al. (2020); Zhang et al. (2018c); Li et al. (2019); Gao et al. (2019b); Kosugi et al. (2019)) attempts to learn a detector with only image category labels. Most of these methods adopt the idea of Multiple Instance Learning (Dietterich et al. (1997)) to recast WSOD as a multi-label classification task. Bilen & Vedaldi (2016) propose an end-to-end network by modifying a classifier to operate at the level of image regions, serving as a region selector and a classifier simultaneously. Tang et al. (2017) and Tang et al. (2018) find that several iterations of online refinement based on the outputs of previous iterations boosts performance. Wei et al. (2018) and Diba et al. (2017) use semantic segmentation based on class activation maps (Zhou et al. (2016)) to help generate tight bounding boxes. However,
|
| 30 |
+
|
| 31 |
+

|
| 32 |
+
Figure 1: A comparison between weakly supervised object detector and our detector. Weakly supervised object detector only detects the most discriminating part of an object, e.g., focus on head of a person when detecting a person; or being distracted by co-occurring instances, e.g., distracted by the person on the horse when detecting a horse. Our detector can address these issues.
|
| 33 |
+
|
| 34 |
+
WSOD methods tend to focus on the most discriminating part of an object and are prone to distractions from co-occurring objects. Detecting a part of the object or distractors represents convergence to a local optimum. Thus, their performance depends heavily on initialization. In comparison, our proposed cross-supervised object detector alleviates the issue of getting trapped in a local optimum by leveraging knowledge learned from fully labeled base categories.
|
| 35 |
+
|
| 36 |
+
Cross-supervised object detection. There are several previous works using both image-level and instance-level annotations. Kuen et al. (2019) learned a parameter transferring function between a classifier and a detector, enabling an image-based classification network to be adapted to a regionbased classification network. Hoffman et al. (2014) and Tang et al. (2016) propose methods of adaptation for knowledge transfer from classification features to detection features. Uijlings et al. (2018) use a proposal generator trained on base classes to transfer knowledge by leveraging a MIL framework, organized in a semantic hierarchy. Hoffman et al. (2015) design a three-step framework to learn a feature representation from weakly supervised classes and strongly supervised classes jointly. However, these methods can only perform object localization in single object scenes such as ILSVRC, whereas our method can perform object detection in complex multi-object scenes as well, e.g. COCO. Also, it is worth noting that we are doing multi-task learning, which means that we jointly learn from base and novel classes. In comparison, some works (Uijlings et al., 2018) are doing transfer learning. They first learn a model on base classes and then transfer and fine-tune the model on novel classes. Gao et al. (2019a) use a few instance-level labels and a large scale of image-level labels for each category in a training-mining framework, which is referred to as semisupervised detection. Zhang et al. (2018a) propose a framework named MSD that learn objectness on base categories and use it to reject distractors when learning novel objects. In comparison, our spatial correlation module not only learns objectness, but also refines coarse bounding boxes. Further, our model learns from both base and novel classes instead of only novel classes.
|
| 37 |
+
|
| 38 |
+
# 3 CROSS-SUPERVISED OBJECT DETECTION
|
| 39 |
+
|
| 40 |
+
CSOD requires us to learn from instance-level annotations (detection labels) and image-level annotations (recognition labels). In this section, we explain the unification of detection and recognition and introduce our framework. In the next section, we describe our novel spatial correlation module.
|
| 41 |
+
|
| 42 |
+
# 3.1 UNIFYING DETECTION AND RECOGNITION
|
| 43 |
+
|
| 44 |
+
How to learn a detector from both instance-level and image-level annotations? Since detection and recognition can be seen as region-level and image-level classification respectively, a natural choice is to design a unified framework that combines a detection head and a recognition head that can learn from image-level and instance-level annotations respectively. Here we exploit several baselines to unify the detection and recognition head. (1) Finetune. We first learn through the detection head on base classes with fully labeled samples. Then, we finetune our model using the recognition head on novel classes with only class labels. (2) Two Head. We simultaneously learn the detection and recognition head on base and novel classes, respectively. The weights of the backbones are updated using the loss backpropagated from both heads jointly. (3) Two head +. Instead of learning only on novel classes, we learn the recognition head from class labels of both base and novel classes whereas the recognition head remain the same. (4) Two Branch. Instead of having two shared fully-connected layers after RoI pooling layer (see Fig. 2), we make these two fully-connected layers seperated, allowing the detection and recognition head to have separate unshared pair of fully-connected layers each. Everything else is the same as the Two Head baseline. Experiments are conducted to compare these baselines in $\ S \ S . 1$ and $\ S \ S . 2$ . Our proposed model is based on Two Head. We will discuss the details in $\ S 3 . 2$ .
|
| 45 |
+
|
| 46 |
+

|
| 47 |
+
Figure 2: Our Detection-Recognition Network (DRN) without the spatial correlation module. In this illustration, Person belongs to novel classes and Boat belongs to base classes. The recognition head learns from the class label Person and outputs the top-scoring bounding box to help the detection head learn to detect the person. The spatial correlation module, discussed in $\ S 4$ , can be added to further refine the top-scoring bounding boxes.
|
| 48 |
+
|
| 49 |
+
The connection between the recognition and detection head. The baselines mentioned above only use the recognition head to detect novel objects, ignoring the fact that a detection head can play the same role even better. A majority of WSOD methods (Tang et al. (2017); Wan et al. (2019); Wei et al. (2018)) find that re-train a new detector taking the top-scoring bounding boxes from a weakly supervised object detector as ground truth marginally improve the performance. Even with coarse and noisy pseudo bounding boxes, a standard object detector produces better detection results than a weakly supervised object detector. Keeping this hypothesis in mind, we introduce a guidance from the recognition head to the detection head. For each of the novel categories existing in a training sample, the recognition head outputs the top-scoring bounding box, which are then used by the detection head as supervision in that sample.
|
| 50 |
+
|
| 51 |
+
# 3.2 DETECTION-RECOGNITION NETWORK
|
| 52 |
+
|
| 53 |
+
The structure of our Detection-Recognition Network (DRN) is shown in Fig. 2. Given an image, we first generate 2000 object proposals by Selective Search (Uijlings et al. (2013)) or RPN (Ren et al. (2015)) trained on base classes. The image and proposals are fed into several convolutional (conv) layers followed by a region-of-interest (RoI) pooling layer (Girshick (2015)) to output fixed-size feature maps. Then, these feature maps are fed into two fully connected (fc) layers to produce a collection of proposal features, which are further branched into the recognition and detection head.
|
| 54 |
+
|
| 55 |
+
Recognition Head. We followed previous WSOD methods to design our recognition head. Since OICR (Tang et al. (2017)) is simple, neat, and commonly being used, we make our recognition head the same as OICR, but with fewer refinement branches to reduce the computation cost. However, our recognition head can be replaced by any WSOD structure as shown in $\ S 5 . 3$ .
|
| 56 |
+
|
| 57 |
+
Within the recognition head as shown in Fig. 2, the proposal features are branched into three streams producing three matrices $\mathbf { x } ^ { c } , \mathbf { x } ^ { d } , \mathbf { x } ^ { e } \in \mathbb { R } ^ { C \times | R | }$ , where $C$ is the number of novel classes and $| R |$ is the number of proposals. Then the two matrices $\mathbf { x } ^ { c }$ and $\mathbf { x } ^ { d }$ are passed through a softmax function
|
| 58 |
+
|
| 59 |
+

|
| 60 |
+
Figure 3: Our spatial correlation module (SCM). Our SCM learns to capture spatial correlation among high-confidence bounding boxes, generating a class-agnostic heatmap for the whole image. A heatmap detector is then trained to learn ground truth bounding boxes.
|
| 61 |
+
|
| 62 |
+
over classes and proposals respectively: $\sigma ( \mathbf { x } ^ { c } )$ and $\sigma ( \mathbf { x } ^ { d } )$ . A proposal score $\mathbf { x } _ { c r } ^ { R }$ , indicating the score of $c ^ { t h }$ novel class for $r ^ { t h }$ proposal, corresponds to the respective element of the matrix $\bar { \mathbf { x } } ^ { R } =$ $\sigma ( \mathbf { x } ^ { c } ) \odot \sigma ( \mathbf { x } ^ { d } )$ , where $\odot$ refers to an element-wise product. Finally, we obtain the image score of $c ^ { t h }$ class $\phi _ { c }$ by summing over all proposals: $\begin{array} { r } { \phi _ { c } = \sum _ { r = 1 } ^ { | R | } x _ { c r } ^ { R } } \end{array}$ . Then we culate a standard multi-class cross-entropy loss as shown in the first term of Eq.1. Another matrix $\mathbf { x } ^ { e }$
|
| 63 |
+
function over classes, the result of which is expresses as a weighted multi-class cross entropy loss as shown in the second term of Eq.1. We set the pseudo label for each proposal $r$ based on its IoU (or overlap) with the top-scoring proposal of $c ^ { t h }$ class, $y _ { c r } = 1$ if $\mathrm { I o U } > 0 . 5$ and $y _ { c r } = 0$ otherwise. The weight $w _ { r }$ for each proposal $r$ is its IoU with the top-scoring proposal. The total loss for the recognition head is
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
L _ { r e c } = [ - \sum _ { c = 1 } ^ { C } y _ { c } l o g \phi _ { c } + ( 1 - y _ { c } ) l o g ( 1 - \phi _ { c } ) ] + [ - \frac { 1 } { | { \cal R } | } \sum _ { r = 1 } ^ { | { \cal R } | } \sum _ { c = 1 } ^ { C + 1 } w _ { r } y _ { c r } l o g x _ { c r } ^ { e } ]
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
Supervision from our recognition head. We use the matrix $x ^ { e }$ to propose pseudos bounding boxes to guide the detection head. Specifically, we select one top-scoring proposal for each object category that appears in the image as a pseudo bounding box, as done in OICR. We introduce the spatial correlation module in $\ S 4$ , to further refine this pseudo ground truth.
|
| 70 |
+
|
| 71 |
+
Detection Head. Now that we have pseudo bounding boxes for novel objects and ground truth bounding boxes for base objects, we train our detection head like a standard detector. For simplicity and efficiency, our detection head use the same structure of Faster R-CNN (Ren et al. (2015)). At inference time, the detection head produces detection results for both base categories and novel categories.
|
| 72 |
+
|
| 73 |
+
# 4 LEARNING TO MODEL SPATIAL CORRELATION
|
| 74 |
+
|
| 75 |
+
Our intuition is that there exists spatial correlation among high-confidence bounding boxes, and such spatial correlation can be captured to predict ground truth bounding boxes. By representing the spatial correlation in a class-agnostic heatmap, we can easily learn a mapping from recognitionbased bounding boxes to ground truth bounding boxes for base categories, and then transfer this mapping to novel categories.
|
| 76 |
+
|
| 77 |
+
Thus, we propose a spatial correlation module (SCM). SCM is used as a guidance refinement technique, taking sets of high-confidence bounding boxes from the recognition head, and correspondingly returning pseudo ground truth bounding boxes to the detection head. These pseudo ground truth boxes act as supervision while training on novel categories. The framework of SCM is showed in Fig. 3. Within this module, we first generate a class agnostic heatmap based on the high-confidence bounding boxes predicted by our recognition head, and then we perform detection on top of the heatmap.
|
| 78 |
+
|
| 79 |
+
Heatmap synthesis. We want to capture the information about how the high-confidence bounding boxes interact amongst themselves. Here, we introduce a simple way of achieving this using a class-agnostic heatmap. For each category existing in the image $y _ { c } = 1 , c \in C$ , we first threshold and select high-confidence bounding boxes of class $c$ . Then we synthesize a corresponding classagnostic heatmap, which is essentially a two-channel feature map of the same size as the original image. The value at each pixel is the sum and the maximum of confidence over all selected bounding boxes covering that pixel.
|
| 80 |
+
|
| 81 |
+
Table 1: Object Detection performance (mAP $\%$ ) on PASCAL VOC 2007 test set. ∗ indicates using the structure of OICR in the recognition head. ”MSD-Ens” is the ensemble of AlexNet and VGG16. ”MSD-Ens+FRCN” indicates using an ensemble model to predict pseudo ground truths and then learn a Fast-RCNN (Girshick (2015)) using VGG-16.
|
| 82 |
+
|
| 83 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">Base mean</td><td colspan="9">Novel</td><td rowspan="2"></td></tr><tr><td>table</td><td>dog</td><td>horse</td><td>mbike</td><td>person</td><td>plant sheep</td><td></td><td>sofa</td><td>train tv</td></tr><tr><td>OICR</td><td>42.1</td><td>33.4</td><td>29.3</td><td>56.3</td><td>64.6</td><td>8.0</td><td>23.5</td><td>47.2</td><td>47.2</td><td>48.3 61.7</td><td>mean 42.0</td></tr><tr><td>PCL</td><td>49.2</td><td>51.5</td><td>37.3</td><td>63.3</td><td>63.9</td><td>15.8 23.6</td><td>48.8</td><td>55.3</td><td>61.2</td><td>62.1</td><td>48.3</td></tr><tr><td>MSD-VGG16</td><td>50.6</td><td>14.3</td><td>69.3</td><td>65.4 69.6</td><td>2.4</td><td>20.5</td><td>54.6</td><td>34.3</td><td>58.3</td><td>54.6</td><td>44.3</td></tr><tr><td>MSD-Ens</td><td>53.4</td><td>18.3</td><td>70.6</td><td>66.7 69.8</td><td></td><td>3.7 24.7</td><td>55.0</td><td>37.4</td><td>58.3</td><td>57.3</td><td>46.1</td></tr><tr><td>MSD-Ens+FRCN</td><td>53.9</td><td>15.3</td><td>72.0</td><td>74.4</td><td>65.2</td><td>15.4</td><td>25.1 53.6</td><td>54.4</td><td>45.6</td><td>61.4</td><td>48.2</td></tr><tr><td>Weight Transfer</td><td>68.4</td><td>10.4</td><td>61.0</td><td>58.0</td><td>65.1</td><td>19.8</td><td>19.5</td><td>58.0</td><td>50.8 58.6</td><td>52.7</td><td>45.4</td></tr><tr><td>Finetune*</td><td>71.8</td><td>17.8</td><td>22.9</td><td>15.2</td><td>71.2</td><td>10.2</td><td>15.1</td><td>61.7 36.6</td><td>21.9</td><td>61.3</td><td>33.4</td></tr><tr><td>Two Head*</td><td>72.9</td><td>60.6</td><td>33.2</td><td>47.7</td><td>70.2</td><td>3.9</td><td>25.5</td><td>52.6</td><td>58.4 54.7</td><td>64.4</td><td>47.1</td></tr><tr><td>Two Head+*</td><td>72.4</td><td>44.5</td><td>29.5</td><td>52.4</td><td>68.4</td><td>5.1</td><td>22.6 53.0</td><td>55.5</td><td>58.6</td><td>64.8</td><td> 45.4</td></tr><tr><td>Two Branch*</td><td>72.7</td><td>57.3</td><td>30.2</td><td>44.2 68.1</td><td>3.0</td><td>21.4</td><td>52.2</td><td>53.5</td><td>51.2</td><td>59.7</td><td>44.1</td></tr><tr><td>Ours w/o SCM</td><td>71.6</td><td>62.3</td><td>41.9</td><td>38.2</td><td>73.0</td><td>11.3</td><td>26.0</td><td>60.6</td><td>63.8</td><td>70.5 65.3</td><td>51.3</td></tr><tr><td>Ours</td><td>72.9</td><td>61.0</td><td>57.1</td><td>63.5</td><td>72.0</td><td>19.5</td><td>24.2</td><td>60.9</td><td>58.6</td><td>68.5 65.5</td><td>55.1+3.8</td></tr><tr><td>Ours* w/o SCM</td><td>72.7</td><td>66.8</td><td>50.4</td><td>57.0 71.5</td><td></td><td>12.1 27.6</td><td>57.1</td><td>62.7</td><td>54.2</td><td>64.2</td><td>52.4</td></tr><tr><td>Ours*</td><td>72.7</td><td>60.9</td><td>59.4</td><td>70.5</td><td>71.0</td><td>17.5</td><td>24.1</td><td>62.0</td><td>60.5 62.4</td><td>69.1</td><td>55.7+8.3</td></tr></table>
|
| 84 |
+
|
| 85 |
+
Heatmap detection. We consider each class-agnostic heatmap as a two-channel image, and perform detection on it. Specifically, we learn a class-agnostic detector on base classes, that we further use to produce pseudo ground truth bounding boxes for novel objects.
|
| 86 |
+
|
| 87 |
+
For this task, we use a lightweight one-stage detector, consisting of only five convolutional layers. We follow the same network architecture and loss as FCOS (Tian et al. (2019)), replacing the backbone and feature pyramid network with five max pooling layers. In our experiments, we also compare this tiny detector to a baseline: using three fully-connected layers to regress the groundtruth location taking the coordinates of high-confidence bounding boxes as input.
|
| 88 |
+
|
| 89 |
+
Loss of DRN. After introducing our SCM, we can formulate the full loss function for DRN. We use $L _ { r e c }$ , $L _ { d e t }$ , and $L _ { s c m }$ to indicate the losses from our recognition head, detection head, and spatial correlation module respectively. $\lambda _ { r e c } , \lambda _ { d e t }$ , and $\lambda _ { s c m }$ are the regularization hyperparameters used to balance the three separate loss functions. We train our DRN using the following loss:
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
L = \lambda _ { r e c } L _ { r e c } + \lambda _ { d e t } L _ { d e t } + \lambda _ { s c m } L _ { s c m }
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
# 5 EXPERIMENTS
|
| 96 |
+
|
| 97 |
+
# 5.1 PASCAL VOC
|
| 98 |
+
|
| 99 |
+
Setup. PASCAL VOC 2007 and 2012 datasets contain 9, 962 and 22, 531 images respectively for 20 object classes. They are divided into train, val, and test sets. Here we follow previous work (Tang et al. (2017)) to choose the trainval set (5, 011 images from 2007 and 11, 540 images from 2012). We divide the first 10 classes into base classes and the other 10 classes into novel classes. To evaluate our methods, we calculate mean of Average Precision (mAP) based on the PASCAL criteria, i.e., $\mathrm { I O U } { > } 0 . 5$ between predicted boxes and ground truths.
|
| 100 |
+
|
| 101 |
+
Implementation details. All our baselines, competitors and our framework are based on VGG16 (Simonyan & Zisserman (2015)) followed most of weakly supervised object detection methods. We set $\lambda _ { r e c } = 1$ , $\lambda _ { d e t } = 1 0$ , and $\lambda _ { s c m } = 1 0$ . We train the whole framework for 20 epochs using SGD with a momentum of 0.9, a weight decay of 0.0005 and a learning rate of 0.001, which is reduced by a factor of 10 at $1 4 ^ { t h }$ epoch. For a stable learning process, we don’t provide supervision from recognition head to detection head in the first 9 epochs.
|
| 102 |
+
|
| 103 |
+
Table 2: The results on COCO. We compare our method with several strong baselines in $\ S \ 3 . 1$ and competitors. Our method significantly outperforms these approaches, showing that our crosssupervised object detector is capable of detecting novel objects in complex multi-object scenes.
|
| 104 |
+
|
| 105 |
+
<table><tr><td rowspan="2">method</td><td colspan="6">non-voc -→ voc: test on B = {voc}</td><td colspan="6"> sixty→ twenty: test on B= {twenty}</td></tr><tr><td>AP</td><td>AP50</td><td>AP75</td><td>APs APM</td><td></td><td>APL</td><td>AP</td><td>AP50</td><td>AP75 APsAPm APL</td><td></td><td></td><td></td></tr><tr><td>Rec. Head</td><td>4.0</td><td>15.4</td><td>0.9</td><td>1.2</td><td>5.7</td><td>5.8</td><td>4.7</td><td>16.4</td><td>1.3</td><td>1.7</td><td>8.0</td><td>6.9</td></tr><tr><td>OICR</td><td>4.2</td><td>15.7</td><td>1.0</td><td>1.3</td><td>5.5</td><td>5.9</td><td>4.5</td><td>16.6</td><td>1.4</td><td>2.0</td><td>8.2</td><td>7.1</td></tr><tr><td>PCL</td><td>9.2</td><td>19.6</td><td>-</td><td>-</td><td>1</td><td>-</td><td>9.2</td><td>19.6</td><td>-</td><td>-</td><td>1</td><td>-</td></tr><tr><td>Weight T.</td><td>9.3</td><td>26.4</td><td>5.7</td><td>5.8</td><td>11.7</td><td>12.4</td><td>8.7</td><td>25.5</td><td>5.5</td><td>5.4</td><td>11.5</td><td>11.7</td></tr><tr><td>Finetune</td><td>2.3</td><td>7.4</td><td>0.3</td><td>0.7</td><td>3.1</td><td>3.3</td><td>2.4</td><td>7.7</td><td>0.2</td><td>0.5</td><td>2.8</td><td>3.0</td></tr><tr><td>Two Head</td><td>11.0</td><td>30.2</td><td>6.1</td><td>6.2</td><td>15.4</td><td>15.4</td><td>11.3</td><td>29.5</td><td>5.8</td><td>6.3</td><td>14.8</td><td>15.0</td></tr><tr><td>Two Head+</td><td>9.1</td><td>26.7</td><td>5.4</td><td>5.5</td><td>12.1</td><td>12.3</td><td>9.0</td><td>27.1</td><td>5.4</td><td>5.7</td><td>11.7</td><td>11.6</td></tr><tr><td>Two Branch</td><td>9.4</td><td>26.6</td><td>5.6</td><td>5.7</td><td>12.3</td><td>12.4</td><td>8.5</td><td>24.4</td><td>4.5</td><td>4.3</td><td>11.9</td><td>11.9</td></tr><tr><td>Ours w/o SCM</td><td>12.5</td><td>33.6</td><td>6.6</td><td>7.3</td><td>19.2</td><td>16.4</td><td>12.6</td><td>32.3</td><td>7.8</td><td>7.0</td><td>19.4</td><td>17.4</td></tr><tr><td> Ours</td><td>13.9+1.4</td><td> 36.2+2.6</td><td>7.7</td><td>6.9</td><td>18.8</td><td>19.9</td><td>14.0+1.4</td><td> 34.5+2.2</td><td>8.9</td><td>7.1</td><td>19.2</td><td>20.6</td></tr></table>
|
| 106 |
+
|
| 107 |
+
Baselines and competitors. We compare against several baselines as mentioned in $\ S \ 3 . 1$ , two WSOD methods: OICR (Tang et al. (2017)) and PCL (Tang et al. (2018)), and two cross-supervised object detector: MSD (Zhang et al. (2018a)), weight transfer (Kuen et al. (2019)).
|
| 108 |
+
|
| 109 |
+
Results. As shown in Table 1, our method outperforms all other approaches by a large margin (over $7 \%$ relative increase in mAP on novel classes). The results are consistent with our discussion in $\ S \ 3 . 1$ . We note that (1) sharing backbone for the recognition and detection head learns a more discriminative embedding for novel objects. In Table 1, Two Head∗ boosts the performance by 5 points as compared to only using the recognition head (OICR). (2) A supervision from recognition head to detection head exploits the full potential of a detection model. By adding the supervision (Ours∗ w/o SCM ), the result is improved by 5 points as compared to Two Head. (3) Our spatial correlation module successfully captures the spatial correlation between high-confidence proposals. It further boosts the performance by 3 points.
|
| 110 |
+
|
| 111 |
+
<table><tr><td>method</td><td>non-voc-→voc AP50 on B</td><td>sixty-→twenty AP50 on B</td></tr><tr><td>2 layer Fc layer 3 layer</td><td>31.0 30.8</td><td>28.7 28.3</td></tr><tr><td>4 layer</td><td>30.5</td><td>28.5</td></tr><tr><td>R-50-FPN</td><td>36.4</td><td>34.8</td></tr><tr><td>FCOS 4 conv</td><td>35.8</td><td>33.8</td></tr><tr><td>5 conv</td><td>36.2</td><td>34.5</td></tr><tr><td>w/o SCM</td><td>33.6</td><td>32.3</td></tr></table>
|
| 112 |
+
|
| 113 |
+
(a) Ablation on Heatmap synthesis. The result suggests using two-channel heatmap consists of maximum confidence and sum of confidence over proposals covering that position.
|
| 114 |
+
|
| 115 |
+
(b) Ablation on the structure of SCM. FCOS with 5 conv layers has nearly the best performance and very few parameters compared to a ResNet-50 backbone.
|
| 116 |
+
|
| 117 |
+
Table 3: Ablation study of our method.
|
| 118 |
+
|
| 119 |
+
<table><tr><td></td><td>non-voc-→voc AP50 on B</td><td>sixty→twenty AP50 on B</td></tr><tr><td>method max</td><td>35.5</td><td>33.8</td></tr><tr><td>sum</td><td>36.0</td><td>34.0</td></tr><tr><td>num</td><td>31.5</td><td>29.5</td></tr><tr><td>max+sum</td><td>36.2</td><td>34.5</td></tr><tr><td>max+num</td><td>35.7</td><td>34.1</td></tr><tr><td>sum+num</td><td>35.9</td><td>34.2</td></tr><tr><td>max+sum+num</td><td>36.1</td><td>34.2</td></tr></table>
|
| 120 |
+
|
| 121 |
+
<table><tr><td>method</td><td>non-voc-→voc AP50 on B</td><td>sixty-→twenty AP50 on B</td></tr><tr><td>WSDDN</td><td>35.7</td><td>33.8</td></tr><tr><td>OICR</td><td>36.6</td><td>34.7</td></tr><tr><td>Ours</td><td>36.4</td><td>34.5</td></tr></table>
|
| 122 |
+
|
| 123 |
+
<table><tr><td colspan="2"></td><td colspan="2">base-novel AP50 on A AP5o on B</td></tr><tr><td rowspan="2">dataset PASCAL VOC</td><td>method</td><td></td><td rowspan="2">46.1</td></tr><tr><td>RPN</td><td>76.2</td></tr><tr><td rowspan="2">non-voc->voc</td><td>SS</td><td>72.7</td><td>55.7</td></tr><tr><td>RPN SS</td><td>46.3 42.5</td><td>36.2 34.5</td></tr></table>
|
| 124 |
+
|
| 125 |
+
(c) Ablation on the structure of the recognition head. OICR has more refinement branches so it behaves a little better than our recognition head but takes double the computation time.
|
| 126 |
+
|
| 127 |
+
(d) Ablation on the proposal generator. On PASCAL VOC, there are not enough categories to learn a good RPN. So, we use selective search and RPN to generate proposals for PASCAL VOC and COCO respectively.
|
| 128 |
+
|
| 129 |
+

|
| 130 |
+
Figure 4: Detection results on novel objects. The results are from our proposed model but with different heads. The first row shows the results of the recognition head. The second row lists the results from SCM. The third row displays the results from the detection head.
|
| 131 |
+
|
| 132 |
+
# 5.2 COCO
|
| 133 |
+
|
| 134 |
+
Setup. We train on the COCO train2017 split and test on val2017 split. We simulate the crosssupervised object detection scenario on COCO by splitting the 80 classes into base and novel classes. We use a 20/60 split same as Hu et al. (2018), dividing the COCO categories into all the 20 classes contained in PASCAL VOC and the 60 that are not. We refer to these as the ‘voc’ and ‘non-voc’ category sets. ‘voc non-voc’ indicates that we take ‘voc’ as our base classes and ‘non-voc’ as our novel classes. Similarly, we split the first 20 classes into ‘twenty’ and the last 60 classes into ’sixty’.
|
| 135 |
+
|
| 136 |
+
Implementation details. The implementation details are the same as $\ S 5 . 1$ by default. We train the whole framework for 13 epochs. There is no supervision from recognition head to detection head in the first 5 epochs. The learning rate is reduced by a factor of 10 at $\bar { 8 } ^ { t h }$ , and $1 2 ^ { t h }$ epochs.
|
| 137 |
+
|
| 138 |
+
Baselines and competitors. Most baselines and competitors are the same as $\ S \ S . 1$ . ’Rec. Head’ represents only using our recognition head structure as a weakly supervised object detector.
|
| 139 |
+
|
| 140 |
+
Results. The results on COCO still support our discussion in $\ S 5 . 1$ . Even in complex multi objects scenes, our DRN outperforms all baselines and competitors by a large margin.
|
| 141 |
+
|
| 142 |
+
# 5.3 ABLATION EXPERIMENTS
|
| 143 |
+
|
| 144 |
+
Heatmap synthesis. In Table 3a, we compare the different methods to synthesize the heatmaps in the spatial correlation module. For each position in the heatmap, we consider three kinds of values: the maximum of confidence, the sum of confidence, and the number of proposals covering the position. This result informs us to use max and sum to create a two-channel heatmap.
|
| 145 |
+
|
| 146 |
+
Structure of SCM. In Table 3b, we compare different implementations of SCM. We compare the FCOS (Tian et al. (2019)) with 5 convolutional layers and the standard FCOS with a ResNet-50 (He et al. (2016)) backbone. We also compare to the regression baseline mentioned in $\ S 4$ . Considering the computation cost, we choose FCOS with 5 convolutional layer as our heatmap detector.
|
| 147 |
+
|
| 148 |
+
Structure of the Recognition head. In Table 3c, we compare different structures for the recognition head. WSDDN (Bilen & Vedaldi (2016)) and OICR are compared to our structure. The results support that our model can benefit from a stronger recognition head.
|
| 149 |
+
|
| 150 |
+
Different proposal generation methods. Table 3d shows the ablation of different ways to generate proposals. In PASCAL VOC with only 10 base classes, RPN performs worse than selective search. In COCO with 60 base classes, RPN performs better than selective search.
|
| 151 |
+
|
| 152 |
+
Visualization. Fig. 4 shows detection results on novel objects. Images in the first row, the second row, and the third row are detected by our model from the recognition head, the SCM, and the detection head respectively. The images in the first row tend to focus on the discriminating parts of the objects, e.g. the first and the second images contain only a part of the person. It also tends to detect co-occurring objects, e.g. the fourth image not only detects horse but also a large part of the person. Our SCM alleviates these problems. It tends to focus on the whole object, e.g. the first and the third samples detect the whole person instead of only the head. Also, it can correct unsatisfactory bounding boxes distracted by co-occurring objects, e.g. SCM correctly localizes the horse instead of localizing both the person and the horse in the fourth example. Obviously, bounding boxes in the third row are the best, indicating the efficacy of our framework.
|
| 153 |
+
|
| 154 |
+
# 6 CONCLUSION
|
| 155 |
+
|
| 156 |
+
In this paper, we have focused on cross-supervised object detection in realistic settings with complex imagery. We explore two major ways to build a good cross-supervised object detector: sharing network backbone between a recognition head and a detection head, and learning a spatial correlation module to bridge the gap between recognition and detection. Significant improvement on PASCAL VOC and COCO suggests a novel and promising approach for expanding object detection to a much larger number of categories.
|
| 157 |
+
|
| 158 |
+
# REFERENCES
|
| 159 |
+
|
| 160 |
+
Aditya Arun, C.V. Jawahar, and M. Pawan Kumar. Dissimilarity coefficient based weakly supervised object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019.
|
| 161 |
+
|
| 162 |
+
Hakan Bilen and Andrea Vedaldi. Weakly supervised deep detection networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016.
|
| 163 |
+
|
| 164 |
+
Ali Diba, Vivek Sharma, Ali Pazandeh, Hamed Pirsiavash, and Luc Van Gool. Weakly supervised cascaded convolutional networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017.
|
| 165 |
+
|
| 166 |
+
Thomas G Dietterich, Richard H Lathrop, and Tomas Lozano-P ´ erez. Solving the multiple instance ´ problem with axis-parallel rectangles. Artificial intelligence, 1997.
|
| 167 |
+
|
| 168 |
+
Mark Everingham, Luc Van Gool, Christopher KI Williams, John Winn, and Andrew Zisserman. The pascal visual object classes (voc) challenge. International journal of computer vision (IJCV), 2010.
|
| 169 |
+
|
| 170 |
+
Jiyang Gao, Jiang Wang, Shengyang Dai, Li-Jia Li, and Ram Nevatia. Note-rcnn: Noise tolerant ensemble rcnn for semi-supervised object detection. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), 2019a.
|
| 171 |
+
|
| 172 |
+
Yan Gao, Boxiao Liu, Nan Guo, Xiaochun Ye, Fang Wan, Haihang You, and Dongrui Fan. Cmidn: Coupled multiple instance detection network with segmentation guidance for weakly supervised object detection. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), 2019b.
|
| 173 |
+
|
| 174 |
+
Ross Girshick. Fast r-cnn. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), 2015.
|
| 175 |
+
|
| 176 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016.
|
| 177 |
+
|
| 178 |
+
Judy Hoffman, Sergio Guadarrama, Eric S Tzeng, Ronghang Hu, Jeff Donahue, Ross Girshick, Trevor Darrell, and Kate Saenko. Lsda: Large scale detection through adaptation. In Advances in Neural Information Processing Systems (NeurIPS), 2014.
|
| 179 |
+
|
| 180 |
+
Judy Hoffman, Deepak Pathak, Trevor Darrell, and Kate Saenko. Detector discovery in the wild: Joint multiple instance and representation learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015.
|
| 181 |
+
|
| 182 |
+
Ronghang Hu, Piotr Dollar, Kaiming He, Trevor Darrell, and Ross Girshick. Learning to segment ´ every thing. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018.
|
| 183 |
+
|
| 184 |
+
Satoshi Kosugi, Toshihiko Yamasaki, and Kiyoharu Aizawa. Object-aware instance labeling for weakly supervised object detection. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), 2019.
|
| 185 |
+
|
| 186 |
+
Jason Kuen, Federico Perazzi, Zhe Lin, Jianming Zhang, and Yap-Peng Tan. Scaling object detection by transferring classification weights. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), 2019.
|
| 187 |
+
|
| 188 |
+
Xiaoyan Li, Meina Kan, Shiguang Shan, and Xilin Chen. Weakly supervised object detection with segmentation collaboration. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), 2019.
|
| 189 |
+
|
| 190 |
+
Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollar, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In ´ Proceedings of the European Conference on Computer Vision (ECCV), 2014.
|
| 191 |
+
|
| 192 |
+
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 (ICCV), 2017.
|
| 193 |
+
|
| 194 |
+
Joseph Redmon and Ali Farhadi. Yolo9000: better, faster, stronger. In Proceedings of the IEEE International Conference on Computer Vision (CVPR), 2017.
|
| 195 |
+
|
| 196 |
+
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), 2016.
|
| 197 |
+
|
| 198 |
+
Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In Advances in Neural Information Processing Systems (NeurIPS), 2015.
|
| 199 |
+
|
| 200 |
+
Zhongzheng Ren, Zhiding Yu, Xiaodong Yang, Ming-Yu Liu, Yong Jae Lee, Alexander G Schwing, and Jan Kautz. Instance-aware, context-focused, and memory-efficient weakly supervised object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020.
|
| 201 |
+
|
| 202 |
+
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), 2015.
|
| 203 |
+
|
| 204 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In Proceedings of the International Conference on Learning Representations (ICLR), 2015.
|
| 205 |
+
|
| 206 |
+
Peng Tang, Xinggang Wang, Xiang Bai, and Wenyu Liu. Multiple instance detection network with online instance classifier refinement. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017.
|
| 207 |
+
|
| 208 |
+
Peng Tang, Xinggang Wang, Song Bai, Wei Shen, Xiang Bai, Wenyu Liu, and Alan Yuille. Pcl: Proposal cluster learning for weakly supervised object detection. IEEE transactions on pattern analysis and machine intelligence, 2018.
|
| 209 |
+
|
| 210 |
+
Yuxing Tang, Josiah Wang, Boyang Gao, Emmanuel Dellandrea, Robert Gaizauskas, and Liming ´ Chen. Large scale semi-supervised object detection using visual and semantic knowledge transfer. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016.
|
| 211 |
+
|
| 212 |
+
Zhi Tian, Chunhua Shen, Hao Chen, and Tong He. Fcos: Fully convolutional one-stage object detection. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), 2019.
|
| 213 |
+
|
| 214 |
+
Jasper Uijlings, Stefan Popov, and Vittorio Ferrari. Revisiting knowledge transfer for training object class detectors. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018.
|
| 215 |
+
|
| 216 |
+
Jasper RR Uijlings, Koen EA Van De Sande, Theo Gevers, and Arnold WM Smeulders. Selective search for object recognition. International journal of computer vision (IJCV), 2013.
|
| 217 |
+
|
| 218 |
+
Fang Wan, Pengxu Wei, Jianbin Jiao, Zhenjun Han, and Qixiang Ye. Min-entropy latent model for weakly supervised object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018.
|
| 219 |
+
|
| 220 |
+
Fang Wan, Chang Liu, Wei Ke, Xiangyang Ji, Jianbin Jiao, and Qixiang Ye. C-mil: Continuation multiple instance learning for weakly supervised object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019.
|
| 221 |
+
|
| 222 |
+
Yunchao Wei, Zhiqiang Shen, Bowen Cheng, Honghui Shi, Jinjun Xiong, Jiashi Feng, and Thomas Huang. Ts2c: Tight box mining with surrounding segmentation context for weakly supervised object detection. In Proceedings of the European Conference on Computer Vision (ECCV), 2018.
|
| 223 |
+
|
| 224 |
+
Hao Yang, Hao Wu, and Hao Chen. Detecting 11k classes: Large scale object detection without fine-grained bounding boxes. In Proceedings of the IEEE International Conference on Computer Vision (CVPR), 2019a.
|
| 225 |
+
|
| 226 |
+
Ke Yang, Dongsheng Li, and Yong Dou. Towards precise end-to-end weakly supervised object detection network. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), 2019b.
|
| 227 |
+
|
| 228 |
+
Zhaoyang Zeng, Bei Liu, Jianlong Fu, Hongyang Chao, and Lei Zhang. Wsod2: Learning bottomup and top-down objectness distillation for weakly-supervised object detection. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), 2019.
|
| 229 |
+
|
| 230 |
+
Junge Zhang, Kaiqi Huang, Jianguo Zhang, et al. Mixed supervised object detection with robust objectness transfer. IEEE transactions on pattern analysis and machine intelligence, 2018a.
|
| 231 |
+
|
| 232 |
+
Xiaopeng Zhang, Jiashi Feng, Hongkai Xiong, and Qi Tian. Zigzag learning for weakly supervised object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018b.
|
| 233 |
+
|
| 234 |
+
Yongqiang Zhang, Yancheng Bai, Mingli Ding, Yongqiang Li, and Bernard Ghanem. W2f: A weakly-supervised to fully-supervised framework for object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018c.
|
| 235 |
+
|
| 236 |
+
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 (CVPR), 2016.
|
md/train/5GihaaZKL4/5GihaaZKL4.md
ADDED
|
@@ -0,0 +1,394 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Pairwise Adjusted Mutual Information
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
1 A well-known metric for quantifying the similarity between two clusterings is
|
| 11 |
+
2 the adjusted mutual information. Compared to mutual information, a corrective
|
| 12 |
+
3 term based on random permutations of the labels is introduced, preventing two
|
| 13 |
+
4 clusterings being similar by chance. Unfortunately, this adjustment makes the
|
| 14 |
+
5 metric computationally expensive. In this paper, we propose a novel adjustment
|
| 15 |
+
6 based on pairwise label permutations instead of full label permutations. Specifically,
|
| 16 |
+
7 we consider permutations where only two samples, selected uniformly at random,
|
| 17 |
+
8 exchange their labels. We show that the corresponding adjusted metric, which
|
| 18 |
+
9 can be expressed explicitly, behaves similarly to the standard adjusted mutual
|
| 19 |
+
10 information for assessing the quality of a clustering, while having a much lower
|
| 20 |
+
11 time complexity. Both metrics are compared in terms of quality and performance
|
| 21 |
+
12 on experiments based on synthetic and real data.
|
| 22 |
+
|
| 23 |
+
# 13 1 Introduction
|
| 24 |
+
|
| 25 |
+
14 A well-known metric for quantifying the similarity between two clusterings of the same data is
|
| 26 |
+
15 the adjusted mutual information [Nguyen et al., 2009; Vinh et al., 2010]. Compared to mutual
|
| 27 |
+
16 information, this metric is adjusted against chance, meaning that the similarity cannot be due to
|
| 28 |
+
17 randomness but only to the structure of the dataset, appearing in both clusterings. This is the reason
|
| 29 |
+
18 why this metric is widely used in unsupervised learning, see [Zhang et al., 2013; Thirion et al., 2014;
|
| 30 |
+
19 Taha and Hanbury, 2015; Yang et al., 2016; Wang et al., 2017] for various applications.
|
| 31 |
+
20 The standard way of adjusting mutual information against chance is through random label permuta
|
| 32 |
+
21 tions of one of the clusterings [Vinh et al., 2010]. Unfortunately, this adjustment makes the metric
|
| 33 |
+
22 computationally expensive. Specifically, the time complexity of the metric is in $O ( \operatorname* { m a x } ( k , l ) n )$ ,
|
| 34 |
+
23 where $k , l$ are the numbers of clusters in each clustering and $n$ is the number of samples [Romano et
|
| 35 |
+
24 al., 2014]. As a comparison, the time complexity of mutual information is equal to $O ( k l )$ given the
|
| 36 |
+
25 contingency matrix of the clusterings, i.e., the matrix counting the number of samples in each pair of
|
| 37 |
+
26 clusters, one per clustering. The additional computational effort required by adjustment is significant
|
| 38 |
+
27 as the number of samples $n$ is typically much larger than the numbers of clusters $k , l$ .
|
| 39 |
+
28 In this paper, we propose a novel adjustment based on pairwise permutations. That is, we consider
|
| 40 |
+
29 permutations where only two samples, selected uniformly at random, exchange their labels. We
|
| 41 |
+
30 show that the corresponding adjusted metric, we refer to as pairwise adjusted mutual information,
|
| 42 |
+
31 is as efficient as adjusted mutual information for assessing the quality of a clustering, with a much
|
| 43 |
+
32 lower time complexity. In particular, the time complexity is the same as that of mutual information.
|
| 44 |
+
33 The gain in complexity is significant, as the computation time is now independent of the number of
|
| 45 |
+
34 samples $n$ , given the contingency matrix.
|
| 46 |
+
35 The rest of the paper is organized as follows. We first provide the definition and key properties of
|
| 47 |
+
36 adjusted mutual information in the general setting of information theory. We then introduce mutual
|
| 48 |
+
37 information with pairwise adjustement and explain why the exact same properties are satisfied by
|
| 49 |
+
38 this new notion of adjusted mutual information. The application of both notions of adjustment to
|
| 50 |
+
39 clustering, including the explicit expressions of the corresponding metrics, is presented in section 4.
|
| 51 |
+
40 Experiments on both synthetic and real data are presented in section 5. Section 6 concludes the paper.
|
| 52 |
+
|
| 53 |
+
# 41 2 Adjusted mutual information
|
| 54 |
+
|
| 55 |
+
42 Let $P$ be the uniform probability measure on $\Omega = \{ 1 , \dots , n \}$ , for some positive integer $n$ . Let $X , Y$
|
| 56 |
+
43 be random variables on the probability space $( \Omega , P )$ . Without any loss of generality, we assume that
|
| 57 |
+
44 $X$ and $Y$ are mapping from $\Omega$ to sets consisting of consecutive integers, starting from 1. Denoting by
|
| 58 |
+
45 $H$ the entropy, the mutual information between $X$ and $Y$ is defined by [Cover and Thomas, 1991]:
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
I ( X , Y ) = H ( X ) + H ( Y ) - H ( X , Y ) .
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
This is the information shared by $X$ and $Y$ , which is equal to 0 if $X$ and $Y$ are independent. A distance between $X$ and $Y$ can then be defined by:
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
d ( X , Y ) = H ( X , Y ) - I ( X , Y ) = H ( X | Y ) + H ( Y | X ) .
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
46 This distance, known as the variation of information, is a metric in the quotient space of random
|
| 71 |
+
47 variables under the equivalence relation $X \sim Y$ if and only if there is some bijection $\varphi$ such that
|
| 72 |
+
48 $X = \varphi ( Y )$ [Meila, 2003]. ˘
|
| 73 |
+
49 Adjusted mutual information. The adjusted mutual information between $X$ and $Y$ , corresponding
|
| 74 |
+
50 to the mutual information between $X$ and $Y$ adjusted against chance, is defined by:
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\Delta I ( X , Y ) = I ( X , Y ) - \operatorname { E } ( I ( X , Y _ { \sigma } ) ) ,
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
51 where $Y _ { \sigma }$ is the random variable $Y \circ \sigma$ , for any permutation $\sigma$ of $\{ 1 , \ldots , n \}$ , and the expectation is
|
| 81 |
+
52 taken over all permutations $\sigma$ , chosen uniformly at random.
|
| 82 |
+
53 Remark 1 (Normalization). It is frequent to also normalize adjusted mutual information, so as to
|
| 83 |
+
54 get a score between $\boldsymbol { \theta }$ and 1 [Vinh et al., 2010; Romano et al., 2014]. In this paper, we only focus on
|
| 84 |
+
55 the adjustment step. Note that normalization can be equally applied to both considered notions of
|
| 85 |
+
56 adjustment and thus be studied separately.
|
| 86 |
+
|
| 87 |
+
57 We have the equivalent definition:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\begin{array} { l } { \displaystyle \Delta I ( X , Y ) = \mathrm { E } ( H ( X , Y _ { \sigma } ) ) - H ( X , Y ) , } \\ { \displaystyle = \frac { 1 } { 2 } ( \mathrm { E } ( d ( X , Y _ { \sigma } ) ) - d ( X , Y ) ) . } \end{array}
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
58 This equivalence follows from Proposition 1 and the fact that the definition is symmetric in $X$ and $Y$
|
| 94 |
+
59 All proofs are available in the supplementary material.
|
| 95 |
+
|
| 96 |
+
60 Proposition 1. We have for any random variables $X$ and $Y$ :
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\begin{array} { r l } & { H ( X ) = \operatorname { E } ( H ( X _ { \sigma } ) ) , } \\ & { \operatorname { E } ( H ( X , Y _ { \sigma } ) ) = \operatorname { E } ( H ( X _ { \sigma } , Y ) ) , } \\ & { \operatorname { E } ( I ( X , Y _ { \sigma } ) ) = \operatorname { E } ( I ( X _ { \sigma } , Y ) ) . } \end{array}
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
61 In view of (3), we expect $\Delta I ( X , Y )$ to be positive if $X$ and $Y$ share information, as $X$ is expected to
|
| 103 |
+
62 be closer to $Y$ (for the distance $d$ ) than to $Y _ { \sigma }$ , a randomized version of $Y$ . There are specific cases
|
| 104 |
+
63 where $\Delta I ( X , Y ) = 0$ , as stated in Proposition 2; these cases will be interpreted in terms of clustering
|
| 105 |
+
64 in section 4.
|
| 106 |
+
65 Proposition 2. We have $\Delta I ( X , Y ) = 0$ whenever $Y$ (or $X$ , by symmetry) is constant or equal to
|
| 107 |
+
66 some permutation of $\{ 1 , \ldots , n \}$ .
|
| 108 |
+
|
| 109 |
+
Adjusted entropy. Observing that $H ( X ) = I ( X , X )$ , we define similarly the adjusted entropy of $X$ by:
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\Delta H ( X ) = \Delta I ( X , X ) = H ( X ) - \operatorname { E } ( I ( X , X _ { \sigma } ) ) .
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
67 By (1), we get:
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
\Delta H ( X ) = \operatorname { E } ( H ( X , X _ { \sigma } ) ) - H ( X ) = { \frac { 1 } { 2 } } \operatorname { E } ( d ( X , X _ { \sigma } ) ) .
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
68 Since $d$ is a metric, this shows that the adjusted entropy of $X$ is non-negative.
|
| 122 |
+
|
| 123 |
+
69 Proposition 3. We have $\Delta H ( X ) = 0$ if and only if X is constant or equal to some permutation of
|
| 124 |
+
70 $\{ 1 , \ldots , n \}$ .
|
| 125 |
+
71 Proposition 3 characterizes random variables with zero adjusted entropy. Again, this result will be
|
| 126 |
+
2 interpreted in terms of clustering in section 4.
|
| 127 |
+
|
| 128 |
+
# 73 3 Pairwise adjustment
|
| 129 |
+
|
| 130 |
+
74 In this section, we introduce pairwise adjusted mutual information. The definition is the same as
|
| 131 |
+
75 adjusted mutual information, except that the permutation $\sigma$ is now restricted to the set of pairwise
|
| 132 |
+
76 permutations. Specifically, we consider permutations $\sigma$ for which there exists $i , j \in \{ 1 , \ldots , n \}$
|
| 133 |
+
77 such that $\sigma ( i ) \stackrel { \textstyle - } { = } j$ and $\overset { \cdot } { \boldsymbol { \sigma } ( j ) } = i$ , whereas $\sigma ( t ) = t$ for all $t \neq i , j$ . We consider the set of such
|
| 134 |
+
78 permutations $\sigma$ where the samples $i , j$ are drawn uniformly at random in the set $\{ 1 , \ldots , n \}$ . We
|
| 135 |
+
79 denote by $\sigma _ { \mathrm { p } }$ such a random permutation. Observe that $\sigma _ { \mathrm { p } }$ is the identity with probability $1 / n$ (the
|
| 136 |
+
80 probability that $i = j$ ).
|
| 137 |
+
|
| 138 |
+
Pairwise adjusted mutual information. We define the pairwise adjusted mutual information as:
|
| 139 |
+
|
| 140 |
+
$$
|
| 141 |
+
\Delta _ { \mathrm { p } } I ( X , Y ) = I ( X , Y ) - \mathrm { E } ( I ( X , Y _ { \sigma _ { \mathrm { p } } } ) ) .
|
| 142 |
+
$$
|
| 143 |
+
|
| 144 |
+
81 This is exactly the same definition as the adjusted mutual information, except for the considered
|
| 145 |
+
82 permutations $\sigma _ { \mathrm { p } }$ . It can be readily verified that the same properties apply, with the exact same proofs,
|
| 146 |
+
83 a key property being that the random permutations $\sigma _ { \mathrm { p } }$ and $\sigma _ { \mathrm { p } } ^ { \mathrm { ~ - 1 ~ } }$ have the same distributions. In
|
| 147 |
+
84 particular, we have the analogue of (3):
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
\begin{array} { l } { { \Delta _ { \mathrm { p } } I ( X , Y ) = \mathrm { E } ( H ( X , Y _ { \sigma _ { \mathrm { p } } } ) ) - H ( X , Y ) , } } \\ { { \ ~ = { \frac { 1 } { 2 } } ( \mathrm { E } ( d ( X , Y _ { \sigma _ { \mathrm { p } } } ) ) - d ( X , Y ) ) . } } \end{array}
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
85 Moreover, $\Delta _ { \mathrm { p } } I ( X , Y ) = 0$ whenever $X$ or $Y$ is constant or equal to some permutation of $\{ 1 , \ldots , n \}$
|
| 154 |
+
|
| 155 |
+
Pairwise adjusted entropy. We also define the pairwise adjusted entropy as:
|
| 156 |
+
|
| 157 |
+
$$
|
| 158 |
+
\Delta _ { \mathrm { p } } H ( X ) = \Delta _ { \mathrm { p } } I ( X , X ) = H ( X ) - \mathrm { E } ( I ( X , X _ { \sigma _ { \mathrm { p } } } ) ) .
|
| 159 |
+
$$
|
| 160 |
+
|
| 161 |
+
86 We have $\Delta _ { \mathrm { p } } H ( X ) \geq 0$ , with equality if and only if $X$ is constant or equal to some permutation of
|
| 162 |
+
87 $\{ 1 , \ldots , n \}$ .
|
| 163 |
+
|
| 164 |
+
# 88 4 Application to clustering
|
| 165 |
+
|
| 166 |
+
89 Let $A = \{ A _ { 1 } , \ldots , A _ { k } \}$ and $B = \{ B _ { 1 } , \ldots , B _ { l } \}$ be two partitions of some finite set $\{ 1 , \ldots , n \}$ into $k$
|
| 167 |
+
90 and $l$ clusters, respectively. Let $\Omega = \{ 1 , \dots , n \}$ and $\mathrm { P }$ be the uniform probability measure over $\Omega$ .
|
| 168 |
+
91 Consider the random variables $X$ and $Y$ defined on $( \Omega , \mathrm { P } )$ by $X ^ { - 1 } ( i ) \doteq A _ { i }$ for all $i = 1 , \ldots , k$ and
|
| 169 |
+
92 $Y ^ { - 1 } ( j ) = B _ { j }$ for all $j = 1 , \dots , l .$ . Note that $X ( \omega )$ and $Y ( \omega )$ can be interpreted as the labels $i$ and $j$
|
| 170 |
+
93 of sample $\omega$ in clusterings $A$ and $B$ , for each $\omega \in \{ 1 , \ldots , n \}$ .
|
| 171 |
+
94 We denote by $a _ { i } ~ = ~ \left| A _ { i } \right|$ the size of cluster $A _ { i }$ , by $b _ { j } ~ = ~ | B _ { j } |$ the size of cluster $B _ { j }$ , and by
|
| 172 |
+
95 $n _ { i j } = | A _ { i } \cap B _ { j } |$ the number of samples both in cluster $A _ { i }$ and cluster $B _ { j }$ , for all $i = 1 , \ldots , k$ and
|
| 173 |
+
96 $j = 1 , \dots , l$ . The matrix $( n _ { i j } ) _ { 1 \leq i \leq k , 1 \leq j \leq l }$ is known as the contingency matrix. Note that $a _ { i }$ and $b _ { j }$
|
| 174 |
+
97 are the sums of row $i$ and column $j$ of the contingency matrix, respectively.
|
| 175 |
+
98 Adjusted mutual information. A well-known metric for assessing the similarity $s ( A , B )$ between
|
| 176 |
+
99 clusterings $A$ and $B$ is the adjusted mutual information 1 $\Delta I ( X , { \bar { Y } } )$ between the corresponding
|
| 177 |
+
100 random variables $X$ and $Y$ . In words, this is the common information shared by clusterings $A$ and $B$
|
| 178 |
+
101 not due to randomness.
|
| 179 |
+
102 By Proposition 2, we have $s ( A , B ) = 0$ whenever clustering $A$ (or $B$ , by symmetry) is trivial, that is,
|
| 180 |
+
103 it consists of a single cluster or of $n$ clusters (one per sample). This is a key property, showing the
|
| 181 |
+
104 interest of the adjustment.
|
| 182 |
+
|
| 183 |
+
105 It is known that [Vinh et al., 2010]:
|
| 184 |
+
|
| 185 |
+
$$
|
| 186 |
+
\begin{array} { l } { { \displaystyle s ( A , B ) = - \sum _ { i = 1 } ^ { k } \sum _ { j = 1 } ^ { l } \frac { n _ { i j } } { n } \log \frac { n _ { i j } } { n } } } \\ { { \displaystyle + \sum _ { i = 1 } ^ { k } \sum _ { j = 1 } ^ { l } \sum _ { c = ( a _ { i } + b _ { j } - n ) ^ { + } } ^ { \operatorname* { m i n } ( a _ { i } , b _ { j } ) } \frac { a _ { i } ! b _ { j } ! ( n - a _ { i } ) ! ( n - b _ { j } ) ! } { n ! c ! ( a _ { i } - c ) ! ( b _ { j } - c ) ! ( n - a _ { i } - b _ { j } + c ) ! } \frac { c } { n } \log \frac { c } { n } } , } \end{array}
|
| 187 |
+
$$
|
| 188 |
+
|
| 189 |
+
with the notation 106 $( \cdot ) ^ { + } = \operatorname* { m a x } ( \cdot , 0 )$ . The time complexity of this formula, which is dominated by the 107 second term, is in $O ( \operatorname* { m a x } ( k , l ) n )$ [Romano et al., 2014]. In particular, it is linear in the number of 108 samples $n$ .
|
| 190 |
+
|
| 191 |
+
109 Interestingly, we can similarly assess the quantity of information $q ( A )$ contained in clustering
|
| 192 |
+
110 $A$ through the adjusted entropy $\Delta H ( X )$ of the corresponding random variable $X$ . This is the
|
| 193 |
+
111 information contained in $A$ not due to randomness. We have $q ( A ) \geq 0$ and, by Proposition 3,
|
| 194 |
+
112 $q ( A ) = 0$ if and only if clustering $A$ is trivial, that is, it consists of a single cluster or of $n$ clusters
|
| 195 |
+
113 (one per sample).
|
| 196 |
+
|
| 197 |
+
114 Since $q ( A ) = s ( A , A )$ , it follows from (6) that:
|
| 198 |
+
|
| 199 |
+
$$
|
| 200 |
+
\mathfrak { r } ( A ) = - \sum _ { i = 1 } ^ { k } \frac { a _ { i } } { n } \log \frac { a _ { i } } { n } + \sum _ { i , j = 1 } ^ { K } \sum _ { c = ( a _ { i } + a _ { j } - n ) ^ { + } } ^ { \operatorname* { m i n } ( a _ { i } , a _ { j } ) } + \frac { a _ { i } ! a _ { j } ! ( n - a _ { i } ) ! ( n - a _ { j } ) ! } { n ! c ! ( a _ { i } - c ) ! ( a _ { j } - c ) ! ( n - a _ { i } - a _ { j } + k ) ! } \frac { c } { n } \log \frac { c } { n } .
|
| 201 |
+
$$
|
| 202 |
+
|
| 203 |
+
115 The time complexity of this formula, also dominated by the second term, is in $O ( k n )$ . Again, this
|
| 204 |
+
116 complexity is linear in the number of samples $n$ .
|
| 205 |
+
117 Pairwise adjusted mutual information. The main contribution of the paper is the following new
|
| 206 |
+
118 measure of similarity $s _ { \mathrm { p } } ( A , B )$ between clusterings $A$ and $B$ , based on the pairwise adjusted mutual
|
| 207 |
+
119 information $\Delta _ { \mathrm { p } } I ( X , Y )$ between the corresponding random variables $X$ and $Y$ . We have an explicit
|
| 208 |
+
120 expression for this similarity:
|
| 209 |
+
|
| 210 |
+
121 Theorem 1. We have for any clusterings $A , B$
|
| 211 |
+
|
| 212 |
+
$$
|
| 213 |
+
\begin{array} { c } { { s _ { \mathrm { p } } ( A , B ) = 2 \displaystyle \sum _ { i = 1 } ^ { k } \displaystyle \sum _ { j = 1 } ^ { l } \displaystyle \frac { n _ { i j } ( n - a _ { i } - b _ { j } + n _ { i j } ) } { n ^ { 2 } } \left( \displaystyle \frac { n _ { i j } } { n } \log \displaystyle \frac { n _ { i j } } { n } - \displaystyle \frac { n _ { i j } - 1 } { n } \log \displaystyle \frac { n _ { i j } - 1 } { n } \right) } } \\ { { + 2 \displaystyle \sum _ { i = 1 } ^ { k } \displaystyle \sum _ { j = 1 } ^ { l } \displaystyle \frac { ( a _ { i } - n _ { i j } ) ( b _ { j } - n _ { i j } ) } { n ^ { 2 } } \left( \displaystyle \frac { n _ { i j } } { n } \log \displaystyle \frac { n _ { i j } } { n } - \displaystyle \frac { n _ { i j } + 1 } { n } \log \displaystyle \frac { n _ { i j } + 1 } { n } \right) . } } \end{array}
|
| 214 |
+
$$
|
| 215 |
+
|
| 216 |
+
122 The time complexity of this formula is in $O ( k l )$ , like mutual information. It is independent of the
|
| 217 |
+
123 number of samples $n$ , given the contingency matrix. Corollary 1 shows that the time complexity
|
| 218 |
+
124 reduces to $O ( m )$ , where $m$ is the number of non-zero entries of the contingency matrix, provided the
|
| 219 |
+
125 latter is stored in sparse format.
|
| 220 |
+
|
| 221 |
+
126 Corollary 1. We have for any clusterings $A , B$ :
|
| 222 |
+
|
| 223 |
+
$$
|
| 224 |
+
{ \begin{array} { l } { { \displaystyle { \boldsymbol { s } } _ { \mathrm { p } } ( A , B ) = 2 \sum _ { i , j : n _ { i j } > 0 } { \frac { n _ { i j } ( n - a _ { i } - b _ { j } + n _ { i j } ) } { n ^ { 2 } } } \left( { \frac { n _ { i j } } { n } } \log { \frac { n _ { i j } } { n } } - { \frac { n _ { i j } - 1 } { n } } \log { \frac { n _ { i j } - 1 } { n } } \right) } } \\ { \displaystyle \qquad + 2 \sum _ { i , j : n _ { i j } > 0 } { \frac { ( a _ { i } - n _ { i j } ) ( b _ { j } - n _ { i j } ) } { n ^ { 2 } } } \left( { \frac { n _ { i j } } { n } } \log { \frac { n _ { i j } } { n } } - { \frac { n _ { i j } + 1 } { n } } \log { \frac { n _ { i j } + 1 } { n } } + { \frac { 1 } { n } } \log { \frac { 1 } { n } } \right) } \\ { \displaystyle \qquad - 2 \left( n ^ { 2 } - \sum _ { i = 1 } ^ { k } a _ { i } ^ { 2 } - \sum _ { j = 1 } ^ { l } b _ { i } ^ { 2 } + \sum _ { i , j : n _ { i j } > 0 } n _ { i j } ^ { 2 } \right) { \frac { 1 } { n } } \log { \frac { 1 } { n } } . } \end{array} }
|
| 225 |
+
$$
|
| 226 |
+
|
| 227 |
+
127 Similarly, we can define the quantity of information $q _ { \mathrm { p } } ( A )$ in clustering $A$ through the pairwise
|
| 228 |
+
128 adjusted entropy $\Delta _ { \mathrm { p } } H ( X )$ of the corresponding random variable $X$ . Again, $q _ { \mathrm { p } } ( A ) \geq 0$ , with
|
| 229 |
+
129 $q _ { \mathrm { p } } \overset { \cdot } { (} A ) = 0$ if and only if clustering $A$ is trivial.
|
| 230 |
+
|
| 231 |
+
$$
|
| 232 |
+
q _ { \mathrm { p } } ( A ) = 2 \sum _ { i = 1 } ^ { k } { \frac { a _ { i } ( n - a _ { i } ) } { n ^ { 2 } } } \left( { \frac { a _ { i } } { n } } \log { \frac { a _ { i } } { n } } - { \frac { a _ { i } - 1 } { n } } \log { \frac { a _ { i } - 1 } { n } } - { \frac { 1 } { n } } \log { \frac { 1 } { n } } \right) .
|
| 233 |
+
$$
|
| 234 |
+
|
| 235 |
+
131 Note that the time complexity of this formula in $O ( k )$ . It only depends on the number of clusters $k$ ,
|
| 236 |
+
132 and not on the number of samples $n$ .
|
| 237 |
+
|
| 238 |
+
# 133 5 Experiments
|
| 239 |
+
|
| 240 |
+
134 In this section, we compare both notions of adjusted mutual information through experiments
|
| 241 |
+
135 involving synthetic and real data. The experiments are run on a computer equipped with an AMD
|
| 242 |
+
136 Ryzen Threadripper 1950X 16-Core Processor and 32 GB of RAM, with a a Debian $1 0 0 \mathrm { S }$ . All codes
|
| 243 |
+
137 and datasets used in the experiments are available in the supplementary material.
|
| 244 |
+
138 Synthetic data. We start with the simple case of $n = 1 0 0$ samples with clusters of even sizes,
|
| 245 |
+
139 consisting of consecutive samples. Specifically, we consider the set of clusterings $A ^ { ( s ) }$ , consisting of
|
| 246 |
+
140 clusters of size $s$ (except possibly the last one), for $s = 1 , 2 , \ldots , 1 0 0$ . In particular, both $A ^ { ( 1 ) }$ and
|
| 247 |
+
141 $A ^ { ( 1 0 0 ) }$ are trivial clusterings while $A ^ { ( 5 ) }$ consists of 20 clusters of size 5.
|
| 248 |
+
142 Figure 1 gives the similarity between clusterings $A ^ { ( 1 0 ) }$ and $A ^ { ( s ) }$ with respect to $s$ in terms of adjusted
|
| 249 |
+
143 mutual information, for both notions of adjustment, i.e., $s ( A ^ { ( 1 0 ) } , A ^ { ( s ) } )$ and $s _ { \mathrm { p } } ( A ^ { ( 1 0 ) } , A ^ { ( s ) } )$ . We
|
| 250 |
+
144 observe very close behaviors, suggesting that both notions of adjustment tend to capture the same
|
| 251 |
+
145 patterns in the clusterings. Note that the maximum similarity is attained for $s = 1 0$ in both cases, as
|
| 252 |
+
146 expected. The similarity is equal to 0 for $s \in \{ 1 , 1 0 0 \}$ for both cases, in agreement with Proposition
|
| 253 |
+
147 2. We also observe local peaks at $s = 2 0 , 3 0 , \ldots , 9 0$ , which can be interpreted by the fact that
|
| 254 |
+
148 clustering $A ^ { ( 1 0 ) }$ is a refinement of clustering $A ^ { ( s ) }$ for these values of $s$ ; similarly, the local peak at
|
| 255 |
+
149 $s = 5$ may be interpreted by the fact that clustering $A ^ { ( 5 ) }$ is a refinement of clustering $A ^ { ( 1 \bar { 0 } ) }$ . The
|
| 256 |
+
Spearman correlation between both metrics over all values of $s$ is equal to 0.99.
|
| 257 |
+
151 We now consider random clusterings. Specifically, we assign $n$ samples to $k$ clusters independently
|
| 258 |
+
152 at random, according to some probability distribution $p = ( p _ { 1 } , \dotsc , p _ { k } )$ , which is itself drawn at
|
| 259 |
+
153 random2. Consider three such random clusterings $A , B$ , $C$ (with the same parameters $n$ and $k$ , but
|
| 260 |
+
154 different probability distributions $p$ ). We would like to know whether $A$ is “closer" to $B$ or to $C$ . In
|
| 261 |
+
155 particular, we are interested in testing whether both notions of adjusted mutual information give the
|
| 262 |
+
156 same ordering in the sense that:
|
| 263 |
+
|
| 264 |
+

|
| 265 |
+
Figure 1: Comparison of metrics on synthetic data $\mathit { n } = 1 0 0 $ ).
|
| 266 |
+
|
| 267 |
+
$$
|
| 268 |
+
( s ( A , B ) - s ( A , C ) ) ( s _ { \mathrm { p } } ( A , B ) - s _ { \mathrm { p } } ( A , C ) ) \geq 0 .
|
| 269 |
+
$$
|
| 270 |
+
|
| 271 |
+
157 We compute the average precision score (fraction of triplets $A , B , C$ for which (7) is true) over 1 000
|
| 272 |
+
158 independent samples of $A , B , C$ , for different values of $n$ and $k$ . We repeat the experiment 100 times
|
| 273 |
+
159 to get the mean and standard deviation. The results are given in Table 1. We observe a very high
|
| 274 |
+
160 precision score, always higher than $9 3 \%$ , showing that both notions of adjusted mutual information
|
| 275 |
+
161 tend to give the same ordering of these random clusterings.
|
| 276 |
+
162 For the performance gain, we compare the computation times of both versions of adjusted mutual
|
| 277 |
+
163 information for the similarity between clusterings $A$ and $B$ , where $A$ consists of $k = 1 0$ clusters
|
| 278 |
+
164 of same size and $B$ is a random clustering, drawn as in the previous experiment. Both versions of
|
| 279 |
+
165 adjusted mutual information are coded in Python, with the standard version imported from scikit-learn.
|
| 280 |
+
166 Figure 2 shows the computation time when the number of samples $n$ grows from $1 0 ^ { 2 }$ to $1 0 ^ { 7 }$ . The
|
| 281 |
+
167 performance gain brought by pairwise adjustement is significant. In particular, the computation time
|
| 282 |
+
168 becomes independent of the number of samples.
|
| 283 |
+
|
| 284 |
+
<table><tr><td>n</td><td>k</td><td>Precision score</td></tr><tr><td>100 100</td><td>2 5</td><td>0.972 ± 0.004 0.952 ± 0.007</td></tr><tr><td>100</td><td>10</td><td>0.943 ± 0.006</td></tr><tr><td>100</td><td>20</td><td>0.955 ± 0.008</td></tr><tr><td>500</td><td>20</td><td>0.936 ± 0.007</td></tr><tr><td>1000 1000</td><td>20 50</td><td>0.933 ± 0.006</td></tr></table>
|
| 285 |
+
|
| 286 |
+

|
| 287 |
+
Table 1: Precision score (mean $\pm$ standard deviation)
|
| 288 |
+
Figure 2: Computation time with respect to $n$ (mean $\pm$ standard deviation).
|
| 289 |
+
|
| 290 |
+
Real data. We first consider the 79 datasets of the benchmark suite [Gagolewski,169 $2 0 2 0 ] ^ { 3 }$ . We apply 170 to each dataset each of the following clustering algorithms:
|
| 291 |
+
|
| 292 |
+
• $k$ -means
|
| 293 |
+
• Affinity propagation
|
| 294 |
+
• Mean shift
|
| 295 |
+
• Spectral clustering
|
| 296 |
+
• Ward
|
| 297 |
+
• Agglomerative clustering
|
| 298 |
+
• DBSCAN
|
| 299 |
+
• OPTICS
|
| 300 |
+
• Birch
|
| 301 |
+
• Gaussian Mixture
|
| 302 |
+
|
| 303 |
+
181 We use the scikit-learn4 implementation of these algorithms, with the corresponding default param
|
| 304 |
+
182 eters5. We get 10 clusterings per dataset. The quality of each clustering is assessed through the
|
| 305 |
+
183 similarity with the available ground-truth labels, using adjusted mutual information with either full
|
| 306 |
+
184 adjustment or pairwise adjustment. We then compute the Spearman correlation of the corresponding
|
| 307 |
+
185 similarities, a value of 1 meaning the exact same ordering of the 10 clusterings with full adjustment
|
| 308 |
+
186 and pairwise adjustment. The results are shown in Figure 3, together with the speed-up in computation
|
| 309 |
+
187 time due to pairwise adjustment. In both cases, the 79 datasets are ordered by the number of samples,
|
| 310 |
+
188 ranging from 105 to 105 600 [Gagolewski, 2020].
|
| 311 |
+
189 We first observe that the correlation is very high, suggesting again that both notions of adjusted mutual
|
| 312 |
+
190 information tend to provide the same results. For 65 datasets among 79, the Spearman correlation is
|
| 313 |
+
191 higher than $9 5 \%$ . As for the computation time, we observe a significant performance gain, by one
|
| 314 |
+
192 order of magnitude for the largest datasets.
|
| 315 |
+
193 We have conducted the same experiments with OpenML [Vanschoren et al., 2013]6. We selected all
|
| 316 |
+
194 datasets with at least 1,000 but no more than 50,000 samples, at most 100 features (all numerical), no
|
| 317 |
+
195 missing data and ground-truth labels forming clusters of at least 5 samples on average. The results
|
| 318 |
+
196 are shown in Figure for the resulting 34 datasets. Again, the datasets are ordered by the number of
|
| 319 |
+
197 samples, here ranging from 1,188 to 45,918. The conclusions are similar. In particular, the Spearman
|
| 320 |
+
198 correlation is higher than $9 5 \%$ for 30 datasets among 34, and the performance gain exceeds 25 for the
|
| 321 |
+
199 largest datasets.
|
| 322 |
+
|
| 323 |
+

|
| 324 |
+
Figure 3: Comparison of metrics on the Gagolewski benchmark.
|
| 325 |
+
|
| 326 |
+

|
| 327 |
+
Figure 4: Comparison of metrics on OpenML datasets.
|
| 328 |
+
|
| 329 |
+
We have proposed another way of adjusting mutual information against chance, through pairwise label permutations. The novel metric, whose explicit expression is given in Theorem 1, has a much lower complexity than the usual adjusted mutual information. Interestingly, both metrics can also be used to assess the quantity of information contained in a clustering, which the common property of being equal to 0 if and only if the clustering is trivial, as stated in Proposition 3; again, the pairwise adjusted entropy, given in Corollary 2, has a much lower complexity. Experiments on synthetic and real data show that pairwise adjusted mutual information tends to provide the same results as the usual adjusted mutual information for comparing clusterings, while involving much less computations.
|
| 330 |
+
|
| 331 |
+
For future work, we plan to extend this idea to other similarity metrics. While the practical interest is less obvious for the Adjusted Rand Index [Hubert and Arabie, 1985], due to the fact that the time complexity of this metric is already independent of the number of samples, it would be worth considering other versions of information theoretic measures, as those studied in [Romano et al., 2016].
|
| 332 |
+
|
| 333 |
+
# References
|
| 334 |
+
|
| 335 |
+
Thomas M Cover and Joy A Thomas. Elements of Information Theory. Wiley, 1991.
|
| 336 |
+
|
| 337 |
+
Marek Gagolewski. Benchmark suite for clustering algorithms – version 1, 2020.
|
| 338 |
+
|
| 339 |
+
Lawrence Hubert and Phipps Arabie. Comparing partitions. Journal of classification, 2(1):193–218, 1985.
|
| 340 |
+
|
| 341 |
+
Marina Meila. Comparing clusterings by the variation of information. In ˘ Learning theory and kernel machines, pages 173–187. Springer, 2003.
|
| 342 |
+
|
| 343 |
+
Xuan Vinh Nguyen, Julien Epps, and James Bailey. Information theoretic measures for clusterings comparison: is a correction for chance necessary? In ICML, 2009.
|
| 344 |
+
|
| 345 |
+
Simone Romano, James Bailey, Vinh Nguyen, and Karin Verspoor. Standardized mutual information for clustering comparisons: one step further in adjustment for chance. In International Conference on Machine Learning, pages 1143–1151, 2014.
|
| 346 |
+
|
| 347 |
+
Simone Romano, Nguyen Xuan Vinh, James Bailey, and Karin Verspoor. Adjusting for chance clustering comparison measures. The Journal of Machine Learning Research, 17(1):4635–4666, 2016.
|
| 348 |
+
|
| 349 |
+
Abdel Aziz Taha and Allan Hanbury. Metrics for evaluating 3d medical image segmentation: analysis, selection, and tool. BMC medical imaging, 15(1):29, 2015.
|
| 350 |
+
|
| 351 |
+
Bertrand Thirion, Gaël Varoquaux, Elvis Dohmatob, and Jean-Baptiste Poline. Which fmri clustering gives good brain parcellations? Frontiers in neuroscience, 8:167, 2014.
|
| 352 |
+
|
| 353 |
+
Joaquin Vanschoren, Jan N. van Rijn, Bernd Bischl, and Luis Torgo. Openml: Networked science in machine learning. SIGKDD Explorations, 15(2):49–60, 2013.
|
| 354 |
+
|
| 355 |
+
Nguyen Xuan Vinh, Julien Epps, and James Bailey. Information theoretic measures for clusterings comparison: Variants, properties, normalization and correction for chance. The Journal of Machine Learning Research, 11:2837–2854, 2010.
|
| 356 |
+
|
| 357 |
+
Bo Wang, Junjie Zhu, Emma Pierson, Daniele Ramazzotti, and Serafim Batzoglou. Visualization and analysis of single-cell rna-seq data by kernel-based similarity learning. Nature methods, 14(4):414–416, 2017.
|
| 358 |
+
|
| 359 |
+
Zhao Yang, René Algesheimer, and Claudio J Tessone. A comparative analysis of community detection algorithms on artificial networks. Scientific reports, 6:30750, 2016.
|
| 360 |
+
|
| 361 |
+
Jiajie Zhang, Paschalia Kapli, Pavlos Pavlidis, and Alexandros Stamatakis. A general species delimitation method with applications to phylogenetic placements. Bioinformatics, 29(22):2869– 2876, 2013.
|
| 362 |
+
|
| 363 |
+
1. For all authors...
|
| 364 |
+
|
| 365 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] A variant of adjusted mutual information.
|
| 366 |
+
(b) Did you describe the limitations of your work? [Yes] Pairwise adjustement only applied to mutual information in the present work, see Section 6.
|
| 367 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A]
|
| 368 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 369 |
+
|
| 370 |
+
2. If you are including theoretical results...
|
| 371 |
+
|
| 372 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] No specific assumption is required. Theorem 1, Corollary 2 and 3 give explicit expressions using notations defined at the beginning of Section 4.
|
| 373 |
+
(b) Did you include complete proofs of all theoretical results? [Yes] See the supplementary material.
|
| 374 |
+
|
| 375 |
+
3. If you ran experiments...
|
| 376 |
+
|
| 377 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] See the Jupyter notebooks in the supplementary material.
|
| 378 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [N/A] This is a metric for unsupervised learning. No data split required, no hyperparameter.
|
| 379 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] See Table 1 and Figure 2 (not applicable to other experiments).
|
| 380 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See the running times provided in the Figures; the resources used are detailed at the beginning of section 5.
|
| 381 |
+
|
| 382 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 383 |
+
|
| 384 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] See the references for the datasets.
|
| 385 |
+
(b) Did you mention the license of the assets? [N/A]
|
| 386 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 387 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 388 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 389 |
+
|
| 390 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 391 |
+
|
| 392 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 393 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 394 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/9Y7_c5ZAd5i/9Y7_c5ZAd5i.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/9c-IsSptbmA/9c-IsSptbmA.md
ADDED
|
@@ -0,0 +1,257 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Be Confident! Towards Trustworthy Graph Neural Networks via Confidence Calibration
|
| 2 |
+
|
| 3 |
+
Xiao Wang, Hongrui Liu, Chuan Shi∗, Cheng Yang
|
| 4 |
+
|
| 5 |
+
School of Computer Science (National Pilot Software Engineering School) Beijing University of Posts and Telecommunications Beijing, China
|
| 6 |
+
{xiaowang, liuhongrui, shichuan, yangcheng}@bupt.edu.cn
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
Despite Graph Neural Networks (GNNs) have achieved remarkable accuracy, whether the results are trustworthy is still unexplored. Previous studies suggest that many modern neural networks are over-confident on the predictions, however, surprisingly, we discover that GNNs are primarily in the opposite direction, i.e., GNNs are under-confident. Therefore, the confidence calibration for GNNs is highly desired. In this paper, we propose a novel trustworthy GNN model by designing a topology-aware post-hoc calibration function. Specifically, we first verify that the confidence distribution in a graph has homophily property, and this finding inspires us to design a calibration GNN model (CaGCN) to learn the calibration function. CaGCN is able to obtain a unique transformation from logits of GNNs to the calibrated confidence for each node, meanwhile, such transformation is able to preserve the order between classes, satisfying the accuracypreserving property. Moreover, we apply the calibration GNN to self-training framework, showing that more trustworthy pseudo labels can be obtained with the calibrated confidence and further improve the performance. Extensive experiments demonstrate the effectiveness of our proposed model in terms of both calibration and accuracy.
|
| 11 |
+
|
| 12 |
+
# 1 Introduction
|
| 13 |
+
|
| 14 |
+
Graphs are ubiquitous in the real world, including social networks, e-commerce networks, traffic networks, and so on. Recently, Graph Neural Networks (GNNs), which are able to effectively learn the node representations based on the message-passing manner, have attracted considerable attention in dealing with graph data [16, 33, 39, 44, 15, 2, 34]. To date, GNNs have been applied to various applications and achieved remarkable accuracy, e.g., node classification [16, 33], link prediction [41] and graph classification [9].
|
| 15 |
+
|
| 16 |
+
However, it is well established that a model with good accuracy is not the only goal, but a trustworthy model is highly desired in many applications, especially in safety-critical fields [1]. Usually, a trustworthy model implies that it should know when it is likely to be incorrect, in other words, the probability, i.e., the confidence, associated with the predicted class label should reflect its ground truth correctness likelihood [12]. For example, in the scene of autonomous driving, the system will adopt the prediction given by the model only when the model has high confidence for its prediction. Otherwise, the decision-making power will be returned to the driver or the system adopts other safer strategies. Recently, the confidence calibration has attracted considerable attention in deep learning [12, 40, 19], which reveals that many modern neural network models are over-confident on the predictions, i.e., the prediction accuracy is lower than its confidence. However, it has not been studied in GNNs on the semi-supervised scenario, which gives rise to one fundamental question: will the current GNNs follow the same over-confident property as other neural networks? A well-informed answer can help us better understand GNNs and enable GNNs to be applied to various areas in a more reliable manner.
|
| 17 |
+
|
| 18 |
+
As the first contribution of this study, we present experiments assessing the relationship between the confidence and the accuracy of Graph Convolutional Networks (GCNs) [16] and Graph Attention Networks (GAT) [33] in the node classification task (more details can be seen in Section 2), respectively. Surprisingly, we discover that existing GNNs are far distant from being well-calibrated, and more importantly, GNNs tend to be under-confident in their predictions, which is very different from other modern deep learning models that are often over-confident [12, 19]. GNNs being under-confident means that many predictions are distributed in the low-confidence range, and therefore, fewer predictions are available for safety-critical applications. Once the weakness is identified, another natural question is: how can we calibrate the confidence on predictions given by GNNs so as to make them more trustworthy?
|
| 19 |
+
|
| 20 |
+
Essentially, the confidence calibration is to calibrate the outputs (also known logits) of original models (e.g., GNNs), therefore, a straightforward manner is to employ temperature scaling (TS) [12], OP-families [25] to learn calibration function using a held-out dataset in a post-hoc way. However, when being applied to graphs, they all ignore the effect of topology, which will inevitably make mistakes during calibration. For example, considering that the logits of two nodes $a$ and $^ b$ are the same, but node $a$ is similar to its neighbors while node $b$ is not. Apparently, the predictions of GCNs for $a$ should be more confident than $^ b$ , while the traditional calibration methods, e.g., TS, will learn the same confidence for $a$ and $^ b$ , because it does not consider the effect of topology.
|
| 21 |
+
|
| 22 |
+
Moreover, most of them explore calibration functions only in the linear space [12, 18] while it is well known that non-linear space contains more complex function transformation which is able to calibrate networks with complicated landscapes well. Even if some works have explored the non-linear space such as Matrix Scaling [12], they generally degrade the classification accuracy of the original classifier, while a good accuracy is still a basic requirement by many applications.
|
| 23 |
+
|
| 24 |
+
In this paper, we introduce a topology-aware post-hoc calibration method for GNNs. Specifically, for the logits given by the original classification GNNs, we employ another calibration GCN (CaGCN) to propagate confidence, naturally enabling that the confidence of topologically adjacent nodes becomes similar. CaGCN learns a unique temperature $t$ for each node for temperature scaling, thus preserving the accuracy of the original classification GCN. In addition, based on our finding that large numbers of high-accuracy predictions are distributed in the low-confidence range, we design a calibrated self-training model CaGCN-st in which the confidence is firstly calibrated then used to generate pseudo labels with high confidence. The contributions of this paper are three-fold:
|
| 25 |
+
|
| 26 |
+
• We study the trustworthy problem of GNNs, and discover one unique characteristic of GNNs, i.e., the predictions made by GNNs are usually under-confident.
|
| 27 |
+
• We propose a novel trustworthy GNN model based on the confidence calibration. Our proposed calibration function has three features: topology-aware, non-linear, and accuracy-preserving. We further design a calibrated self-training GNN model, which can effectively utilize the predictions with high confidence.
|
| 28 |
+
• Extensive experiments demonstrate the effectiveness of our proposed models in terms of both calibration and accuracy.
|
| 29 |
+
|
| 30 |
+
# 2 Notation and Preliminary Study
|
| 31 |
+
|
| 32 |
+
In this paper, we focus on the calibration of semi-supervised node classification in an undirected attributed graph $G = \left( V , E \right)$ with the adjacent matrix $\mathbf { A } \in \mathbb { R } ^ { N \times N }$ and the node feature matrix $\mathbf { X } =$ $[ \mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { N } ] ^ { \mathsf { T } }$ . $V$ is a set of nodes and $E \subseteq V \times V$ is a set of edges between nodes. $N = | V |$ is the number of nodes. Here we give the definition of perfect calibration of GNNs as follows:
|
| 33 |
+
|
| 34 |
+
Definition 1. Given random variables A, $\mathbf { X }$ , $\mathbf { Y } \subseteq \{ 1 , \ldots , K \}$ and a GNN model $f _ { \theta }$ where $\theta$ is the learnable parameters, for node i with label $y _ { i } \in \mathbf { Y }$ , $\mathbf { z } _ { i } = f _ { \theta } ( \mathbf { x } _ { i } , \mathbf { A } ) = [ z _ { i , 1 } , \ldots , z _ { i , K } ] ^ { \mathsf { T } }$ is the output of GNNs (i.e., the prediction probability), and $\hat { y } _ { i } = \mathrm { a r g } \operatorname* { m a x } _ { k } z _ { i , k }$ and $\hat { p } _ { i } = \operatorname* { m a x } _ { k } z _ { i , k }$ are the prediction and the confidence respectively. Then we define $f _ { \theta }$ to be perfectly calibrated as:
|
| 35 |
+
|
| 36 |
+
$$
|
| 37 |
+
\mathbb { P } ( \hat { y } _ { i } = y _ { i } | \hat { p } _ { i } = p ) = p , \forall p \in [ 0 , 1 ] .
|
| 38 |
+
$$
|
| 39 |
+
|
| 40 |
+

|
| 41 |
+
Figure 1: Reliability diagrams for GCN (top) and GAT (bottom) without confidence calibration. The diagram is expected to plot an identity function of accuracy with respect to confidence. Any deviation from a perfectly diagonal (i.e., the difference between blue and red histogram) represents the miscalibration.
|
| 42 |
+
|
| 43 |
+

|
| 44 |
+
Figure 2: Confidence distribution before calibration.
|
| 45 |
+
|
| 46 |
+
According to Definition 1, GNN is perfectly calibrated only when the confidence $\hat { p } _ { i }$ is exactly equal to the true probability of getting a correct prediction for every node.
|
| 47 |
+
|
| 48 |
+
Next, we take two representative GNNs (GCN [16] and GAT [33]) as examples to analyze whether they are perfectly calibrated. Specifically, we apply GCN and GAT to four widely used datasets Cora [29], Citeseer [29], Pubmed [29], CoraFull [3], and examine whether their results satisfy Definition 1. To provide more results, we select three label rates for training set (i.e., 20, 40, 60 labeled nodes per class). All the experimental settings follow [16, 33]. Since the true probability $p$ cannot be exactly known, we take an approximate way to evaluate the calibration as in [12]. In particular, we first partition the [0,1] range of confidence into 20 equal bins and then we group the nodes into corresponding bins according to their confidence. After that we calculate the average accuracy of each bin. We expect the average accuracy is equal to the average confidence of each bin, which means the model is approximately perfectly calibrated. For example, if the average confidence of nodes in the bin [0.95, 1.0] is 0.96, and then the classification accuracy in this bin should be $96 \%$ .
|
| 49 |
+
|
| 50 |
+
We illustrate the results of label rate being 20 in Fig. 1 using Reliability Diagrams [23] here, where the $\mathbf { X }$ -axis is the confidence in 20 bins of equal size and y-axis is the average accuracy in each bin. The blue represents the classification accuracy of GCN and GAT while the red is our expectation. More results of label rate being 40, 60 and other GNN models can be seen in Fig. 8, Fig. 9, Fig. 12, Fig. 13 and Fig. 14 in the appendix. We can see that in all the datasets, the average accuracy of most bins is higher than the average confidence. In other words, these GNNs actually achieve remarkable performance, but they all output low confidence, i.e., the GNNs are usually under-confident. Please note that this phenomenon of GNNs is very different from other modern neural networks, which are generally known to be over-confident [12, 19]. Moreover, as shown in Fig. 2, we also visualize the confidence distribution of test nodes, where the $\mathbf { X }$ -axis is the confidence and y-axis is the density [28]. The histogram height multiplied by the width is equal to the frequency. The blue represents the confidence distribution of correct predictions while the yellow represents that of incorrect predictions. More results of label rate being 40 and 60 can be seen in Fig. 10 and Fig. 11 in the appendix. We can see that a large quantity of correct predictions are distributed in the low confidence range. The results above indicate that the current GNNs are far from perfect calibration, leading to unreliable confidence.
|
| 51 |
+
|
| 52 |
+
# 3 Confidence Calibration on GCNs
|
| 53 |
+
|
| 54 |
+
In this section, we propose our method to calibrate current GNNs. Given $\mathbf { A }$ and $\mathbf { X }$ , for a $l$ -layer GCN [16], the output of the GCN before the softmax layer can be obtained by:
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\begin{array} { r } { \mathbf { V } = \mathbf { A } \sigma ( \cdots \mathbf { A } \sigma ( \mathbf { A X W } ^ { ( 1 ) } ) \mathbf { W } ^ { ( 2 ) } \cdots ) \mathbf { W } ^ { ( l ) } = [ \mathbf { v } _ { 1 } , \cdots , \mathbf { v } _ { N } ] ^ { \mathsf { T } } , } \end{array}
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
where $\mathbf { W } ^ { ( l ) }$ is the weight matrix of $l$ -th layer in GCN and $\sigma ( \cdot )$ is the activation function. For each node $i \in \{ 1 , \cdots , N \}$ , our goal is to learn a calibration function which is fed with $\mathbf { v } _ { i }$ (often known as the logit of node $i$ ) and outputs a calibrated confidence using a held-out dataset in a post-hoc way. The calibration function should satisfy three points below: (1) taking the network topology into account (2) non-linear (3) preserving the classification accuracy of the GCNs.
|
| 61 |
+
|
| 62 |
+
# 3.1 CaGCN: GCNs as Calibration Function
|
| 63 |
+
|
| 64 |
+

|
| 65 |
+
Figure 3: The illustration of the confidence propagation. Different colors indicate different classes.
|
| 66 |
+
|
| 67 |
+
Table 1: Summary of total variation of confidence before and after calibration (Bold: best). Uncal. is short for uncalibrated and TS is short for temperature scaling.
|
| 68 |
+
|
| 69 |
+
<table><tr><td rowspan="2">Dataset</td><td colspan="3">GCN</td></tr><tr><td>Uncal.</td><td>TS</td><td>Ours</td></tr><tr><td>Cora</td><td>240.267</td><td>172.346</td><td>164.651</td></tr><tr><td>Citeseer</td><td>128.145</td><td>112.212</td><td>108.684</td></tr><tr><td>Pubmed</td><td>1299.33</td><td>1266.68</td><td>1113.41</td></tr><tr><td>CoraFull</td><td>6014.32</td><td>4698.20</td><td>4500.30</td></tr></table>
|
| 70 |
+
|
| 71 |
+
We assume that the ground-truth confidence distribution in a graph has homophily property, i.e., the confidence of neighboured nodes given by well-calibrated models should be similar, and thus we conduct an experiment to verify this. We employ the classic temperature scaling method [12] as our calibration function and use the total variation [27] of confidence as our evaluation, which sums the difference of confidence between all the neighboured nodes. We compare the total variation of confidence before and after confidence calibration, where the results are shown in Table 1. We can find that the total variation of confidence does decrease after temperature scaling, which verifies our assumption. This inspires us that if a GCN model is well-calibrated, then the confidence between neighbors should be more similar than before.
|
| 72 |
+
|
| 73 |
+
To this end, we find that GCN itself can play the role of calibration function that meets above requirement since GCN is able to propagate node features along the network topology and smooth similar information between neighboured nodes. Therefore, we can employ another $l .$ -layer GCN (CaGCN) as our calibration function to propagate the confidence along the network topology. Specifically, given the output $\mathbf { V }$ of the classification GCN, the logit $\mathbf { v } _ { i } ^ { \prime }$ and confidence $\hat { p } _ { i }$ for node $i$ after calibration can be obtained by:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\begin{array} { r l } & { { \mathbf { V } } ^ { \prime } = { \mathbf { A } } \sigma ( \cdots { \mathbf { A } } \sigma ( { \mathbf { A } } { \mathbf { V } } { \mathbf { W } } ^ { ( 1 ) } ) { \mathbf { W } } ^ { ( 2 ) } \cdots ) { \mathbf { W } } ^ { ( l ) } = [ { \mathbf { v } } ^ { \prime } _ { 1 } , \cdots , { \mathbf { v } } ^ { \prime } _ { N } ] ^ { \mathsf { T } } , } \\ & { { \mathbf { z } } _ { i } = [ \sigma _ { S M } ( \nu ^ { \prime } _ { i , 1 } ) , \cdots , \sigma _ { S M } ( \nu ^ { \prime } _ { i , K } ) ] ^ { \mathsf { T } } , \hat { p } _ { i } = \operatorname* { m a x } z _ { i , k } , } \end{array}
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
where $\begin{array} { r } { \sigma _ { S M } ( \nu ^ { \prime } _ { i , \cdot } ) = \frac { \exp ( \nu ^ { \prime } _ { i , \cdot } ) } { \sum _ { j = 1 } ^ { K } \exp ( \nu ^ { \prime } _ { i , j } ) } } \end{array}$ is the softmax operation. Then the total variation of confidence will surely become lower and the original classification GCN will be calibrated. Please note that although temperature scaling can be directly applied here, compared with GCN, it does not take the network topology into account, which may cause mistakes mentioned in Section 1. Moreover, temperature scaling only employs a linear transformation, and GCN is able to learn a non-linear calibration function.
|
| 80 |
+
|
| 81 |
+
For a comprehensive understanding of confidence propagation, we make a detailed and visible illustration here. As shown in Fig. 3, the logits of two nodes $a$ and $^ b$ are the same, but node $a$ is similar to its neighbors while node $b$ is not. Apparently, the predictions of GCNs for $a$ should be more confident than $b$ . Suppose that $a$ , $b$ and their neighbours are under-confident based on the observation above. If we continue to propagate their logits along the topology using another GCN, the logits of $a$ and its neighbors will tend to be the same. Therefore, if one or more of these nodes are calibrated during the calibration process, all of them will be calibrated as well. The confidence is propagated in this way. On the other hand, looking at another node $b$ , it is as difficult even for manual classification as it is for GCNs. Consequently, the confidence of $b$ should stay still even be lower. However, it will become higher because of the influence from $a$ if we use the traditional calibration method without considering the network topology. Instead, when the network topology is taken into account, the logit of $^ b$ will be averaged by its neighboured and each dimension tends to $1 / K$ . It will be correctly calibrated when other nodes in the same situation are well-calibrated.
|
| 82 |
+
|
| 83 |
+
# 3.2 The Accuracy-Preserving Property
|
| 84 |
+
|
| 85 |
+
Until now, we have proposed a non-linear calibration model CaGCN which can take the network topology into account, but the accuracy-preserving property cannot be satisfied. To address this problem, we firstly study the general accuracy-preserving calibration function.
|
| 86 |
+
|
| 87 |
+
Proposition 1. Let $h : \mathbb { R } ^ { K } \to \mathbb { R } ^ { K }$ be a calibration function, $s : \mathbb { R } \to \mathbb { R }$ be a 1-D function and $\mathbf { v } _ { i } = [ \nu _ { i , 1 } , \cdots , \nu _ { i , K } ] ^ { \mathsf { T } }$ be the logit of node i. The calibration function $h$ preserves the classification accuracy of the original model if s is a strictly isotonic function and $h$ satisfies:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\begin{array} { r } { h ( \mathbf { v } _ { i } ) = [ s ( \nu _ { i , 1 } ) , \dots , s ( \nu _ { i , K } ) ] ^ { \mathsf { T } } , \forall i \in \{ 1 , \cdots , N \} . } \end{array}
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
Proof We set $\nu _ { i , 1 } < \nu _ { i , 2 } < \cdots < \nu _ { i , K }$ without loss of generality. Since $[ s ( \nu _ { i , 1 } ) , \ldots , s ( \nu _ { i , K } ) ] ^ { \mathsf { T } }$ shares the same order with $\mathbf { v } _ { i }$ as a result of the strictly isotonicity of $s$ , the order between classes of the logit $\mathbf { v } _ { i }$ is unchanged, hence the accuracy of the prediction is preserved.
|
| 94 |
+
|
| 95 |
+
Temperature scaling [12] is the simplest accuracy-preserving calibration method using a scalar parameter $t$ called temperature for all classes. Given the logit $\mathbf { v } _ { i }$ of node $i .$ , the confidence of the prediction is $\hat { p } _ { i } = \operatorname* { m a x } _ { k } \sigma _ { S M } ( \nu _ { i , k } / t ) ( t > 0 )$ . In temperature scaling, $h ( { \bf v } _ { i } ) = [ \nu _ { i , 1 } / t , \cdot \cdot \cdot , \nu _ { i , K } / t ] ^ { \top }$ is the calibration function and $s ( x ) = x / t$ is the strictly isotonic function.
|
| 96 |
+
|
| 97 |
+
However, we can find that temperature scaling (TS) [40] only performs the same linear transformation for all the nodes using the same $t$ . As mentioned in Eq. 3, we propose to use CaGCN as our calibration function, while CaGCN is generally not isotonic, i.e., the order between classes of $\mathbf { v } _ { i }$ and $\mathbf { v } _ { i } ^ { \prime }$ is not the same, implying that after calibration by CaGCN, the accuracy of original GCN cannot be preserved. Instead, here we propose an improved CaGCN. Given the output $\mathbf { V }$ of the classification GCN, we firstly use a $l$ -layer GCN to learn a unique temperature $t _ { i }$ for each node $i .$ , then get a calibrated logit $\mathbf { v } _ { i } ^ { \prime }$ by transforming its original logit $\mathbf { v } _ { i }$ using $t _ { i }$ in a temperature-scaling way, and finally obtain calibrated confidence $\hat { p } _ { i }$ as follows:
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\begin{array} { r } { \mathbf { t } = \sigma ^ { + } ( \mathbf { A } \sigma ( \cdot \cdot \cdot \mathbf { A } \sigma ( \mathbf { A } \mathbf { V } \mathbf { W } ^ { ( 1 ) } ) \mathbf { W } ^ { ( 2 ) } \cdot \cdot \cdot ) \mathbf { W } ^ { ( l ) } ) = [ t _ { 1 } , \cdots , t _ { N } ] ^ { \top } ( t _ { i } > 0 , \forall i \in \{ 1 , \cdots , N \} ) , } \\ { \mathbf { v } _ { i } ^ { r } = h ( \mathbf { v } _ { i } , t _ { i } ) = [ \nu _ { i , 1 } / t _ { i } , \cdots , \nu _ { i , K } / t _ { i } ] ^ { \top } , \mathbf { z } _ { i } = [ \sigma _ { S M } ( \nu _ { i , 1 } ^ { \prime } ) , \cdots , \sigma _ { S M } ( \nu _ { i , K } ^ { \prime } ) ] ^ { \top } , \hat { p } _ { i } = \operatorname* { m a x } _ { { \boldsymbol { k } } } z _ { i , { \boldsymbol { k } } } , } \end{array}
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
where $t _ { i } \in \mathbb { R }$ is a scalar greater than zero and $\sigma ^ { + } ( \mathbf { x } ) = l o g ( 1 + e x p ( \mathbf { x } ) )$ is an element-wise softplus activation [8]. The model proposed in Eq. 5 does not change the order between classes of $\mathbf { v } _ { i }$ and $\mathbf { v } _ { i } ^ { \prime }$ , implying that the accuracy of original GCN is preserved. Compared Eq. 5 with Eq. 3, we can find that Eq. 5 makes the same transformation on all the dimensions of $\mathbf { v } _ { i }$ , which will limit the learnable calibration function space. However, we will prove that actually Eq. 5 is the same with the model proposed in Eq. 3 on confidence calibration using the Proposition 2. Considering that for any logit $\mathbf { v } _ { i }$ , our expectation is in fact that the calibration model can output any confidence $\hat { p } _ { i } \in \big ( \frac { 1 } { K } , 1 \big )$ . Please note that $\hat { p } _ { i } \geq \frac { 1 } { K }$ , or the prediction will be changed. Since Eq. 3 has no limitation on the learnt calibration model, its output $\hat { p } _ { i }$ can take any value from $\frac { 1 } { K }$ to 1. Therefore, if we can prove the output $\hat { p } _ { i }$ in Eq. 5 can also traverse the interval $\textstyle { \big ( } { \frac { 1 } { K } } , 1 { \big ) }$ for any $\mathbf { v } _ { i }$ , the equality between Eq. 3 and Eq.5 can be proved.
|
| 104 |
+
|
| 105 |
+
Proposition 2. Given the original logit $\mathbf { v } _ { i } = [ \nu _ { i , 1 } , \cdots , \nu _ { i , K } ] ^ { \mathsf { T } }$ of node $i ,$ assume $\nu _ { i , j }$ not approaching infinity for each $j \in \{ 1 , \cdots , K \}$ . The calibrated confidence $\hat { p } _ { i }$ in Eq. $5$ can traverse the interval $\textstyle { \big ( } { \frac { 1 } { K } } , 1 { \big ) }$ for node i.
|
| 106 |
+
|
| 107 |
+
Proof We set $\nu _ { i , 1 } > \nu _ { i , 2 } > \cdots > \nu _ { i , K }$ without loss of generality. For any $\mathbf { v } _ { i } \in \mathbb { R } ^ { K }$ , with the assumption of $\mathbf { v } _ { i }$ not approaching infinity, we have that
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
\operatorname* { l i m } _ { t \to 0 } \hat { p } _ { i } = \operatorname* { l i m } _ { t \to 0 } \frac { e x p ( \nu _ { i , 1 } / t _ { i } ) } { \sum _ { j = 1 } ^ { K } e x p ( \nu _ { i , j } / t _ { i } ) } = \operatorname* { l i m } _ { t \to 0 } \frac { e x p ( ( \nu _ { i , 1 } - \nu _ { i , 2 } ) / t _ { i } ) } { e x p ( ( \nu _ { i , 1 } - \nu _ { i , 2 } ) / t _ { i } ) + \sum _ { j = 2 } ^ { K } e x p ( ( \nu _ { i , j } - \nu _ { i , 2 } ) / t _ { i } ) } = 1
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
and
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
\operatorname* { l i m } _ { t \to + \infty } \hat { p } _ { i } = \operatorname* { l i m } _ { t \to + \infty } \frac { e x p ( \nu _ { i , 1 } / t _ { i } ) } { \sum _ { j = 1 } ^ { K } e x p ( \nu _ { i , j } / t _ { i } ) } = \frac { 1 } { K } .
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
Obviously, both $\sigma _ { S M } ( \nu _ { i , k } )$ and $\mathbf { v } _ { i } / t _ { i }$ are continuous, thus $\sigma _ { S M } ( \nu _ { i , k } / t _ { i } )$ is continuous. Therefore, $\begin{array} { r } { \hat { p } _ { i } = \operatorname* { m a x } _ { k } z _ { i , k } = \operatorname* { m a x } _ { k } \sigma _ { S M } ( \nu _ { i , k } / t _ { i } ) } \end{array}$ can traverse the interval $( 1 / K , 1 )$ .
|
| 120 |
+
|
| 121 |
+
The assumption about $\mathbf { v } _ { i }$ is easy to be satisfied since the L2-norm in GCN drives the weight matrix $\mathbf { W }$ approaching zero matrix and each element in node feature matrix $\mathbf { X }$ is not infinity. Therefore, based on Eq. 2, each element $\nu _ { i , j }$ in $\mathbf { V }$ cannot approach infinity. From Proposition 2 we know that for any $\mathbf { v } _ { i }$ , there exactly exists such a unique temperature $t _ { i }$ that $\hat { p } _ { i }$ can take any value from $1 / K$ to 1. In other words, the model can be perfectly calibrated.
|
| 122 |
+
|
| 123 |
+
# 3.3 Optimization Objective
|
| 124 |
+
|
| 125 |
+
Since NLL loss [10] can be decomposed into calibration loss and refinement loss [21], minimizing NLL loss benefits for confidence calibration. Therefore, we employ the NLL loss as our objective function with an additional regularization term. We use the prediction probability $\mathbf { z } _ { i } \in \mathbb { R } ^ { K }$ in Eq. 5 to calculate the NLL loss. Denote the $K$ -class one-hot label for node $i$ as $\mathbf y _ { i } = [ y _ { i , 1 } , \cdots , y _ { i , K } ] ^ { \intercal }$ and suppose the size of the validation set is $| D _ { \nu a l } |$ . Then the NLL loss over all validation nodes is represented as ${ \mathcal { L } } _ { n l l }$ where:
|
| 126 |
+
|
| 127 |
+
$$
|
| 128 |
+
\mathcal { L } _ { n l l } = - \sum _ { i = 1 } ^ { | D _ { \nu a l } | } \sum _ { k = 1 } ^ { K } y _ { i , k } l o g ( z _ { i , k } ) .
|
| 129 |
+
$$
|
| 130 |
+
|
| 131 |
+
Due to the under-confidence of GCNs, our goal is to increase the confidence of correct predictions while decreasing that of incorrect predictions. Considering that for incorrect predictions, the NLL loss cannot directly reduce their confidence, therefore, we design a regularization term for NLL loss as follows:
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
\mathcal { L } _ { c a l } = \frac { 1 } { n } ( \sum _ { i = 1 } ^ { | c o r | } 1 - z _ { i , m } ^ { ( c o r ) } + z _ { i , s } ^ { ( c o r ) } + \sum _ { i = 1 } ^ { | i n c | } z _ { i , m } ^ { ( i n c ) } - z _ { i , s } ^ { ( i n c ) } ) ,
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
where $\left| c o r \right|$ and $| i n c |$ are the number of nodes correctly and incorrectly predicted and $z _ { i , m }$ and $z _ { i , s }$ are the max and submax prediction probability. Intuitively, the confidence of incorrect predictions is decreased by reducing the gap between the max and the submax value of $\mathbf { z } _ { i }$ and vice versa. Combining ${ \mathcal { L } } _ { n l l }$ and $\mathcal { L } _ { c a l }$ , we have the following overall objective function:
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
\begin{array} { r } { \mathcal { L } = \mathcal { L } _ { n l l } + \lambda \mathcal { L } _ { c a l } , } \end{array}
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
where $\lambda$ is the parameter of the regularization term. With the guide of labeled data, we can optimize CaGCN via back propagation and learn the calibrated confidence. The overall framework of CaGCN is shown in Fig. 4.
|
| 144 |
+
|
| 145 |
+
# 4 Self-training with Confidence Calibration
|
| 146 |
+
|
| 147 |
+
Here we propose a practical application of confidence calibration to improve the performance of self-training in GCNs. Self-training is to predict the labels for unlabeled data, and then add them to the training set, so as to achieve better performance. When applying self-training to GCN, we firstly obtain the predictions $\hat { y } _ { i }$ and the confidence $\hat { p } _ { i }$ given by GCN and then add the most confident nodes to the training set with pseudo labels $\hat { y } _ { i }$ based on $\hat { p } _ { i }$ . We continue to train until convergence. However, existing self-training methods perform not as expected with higher label rates [30]. Considering the under-confidence of existing GCNs, motivated by [26], we argue that the under-performance of existing self-training methods originals from large numbers of high-accuracy predictions distributing in low-confidence intervals as shown in Fig. 2, causing that they cannot be added to the training set.
|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
Figure 4: The overall framework of CaGCN. Solid lines represent that we can backpropagate gradient here while dashed lines represent we cannot. We firstly train a classification GCN using the training set to obtain the logit $\mathbf { V }$ of all the nodes. Then we feed $\mathbf { V }$ to $\mathrm { C a G C N }$ to get the temperature t and transform $\mathbf { V }$ using t into $\mathbf { V } ^ { \prime }$ . Finally, the loss can be obtained using $\mathbf { V } ^ { \prime }$ after softmax according to Eq. 10 and CaGCN can be optimized with the guide of the validation set.
|
| 151 |
+
|
| 152 |
+
Table 2: ECE $\mathbf { \Gamma } ( \mathbf { M } { = } 2 0 )$ ) on different models and citation networks of various label rate (L/C) with and without calibration. Uncal. represents the uncalibrated model, (-) denotes this method cannot converge to a meaningful result and bold denotes the best result, the subscript of each result refers to the standard deviation $( \times 1 0 ^ { - 3 } )$ while the superscript refers to the results of paired t-test ( \* for 0.05 level and $^ { * * }$ for 0.01 level).
|
| 153 |
+
|
| 154 |
+
<table><tr><td rowspan="2">Dataset</td><td rowspan="2">L/C</td><td colspan="4">GCN</td><td colspan="4">GAT</td></tr><tr><td>Uncal.</td><td>TS</td><td>MS</td><td>CaGCN</td><td>Uncal.</td><td>TS</td><td>MS</td><td>CaGCN</td></tr><tr><td rowspan="3">Cora</td><td>20</td><td>0.13476.3</td><td>0.04885.5</td><td>0.04145.7</td><td>0.04016.7</td><td>0.15588.9</td><td>0.07179.8</td><td>0.05449.4</td><td>0.0450</td></tr><tr><td>40</td><td>0.11344.7</td><td>0.04177.2</td><td>0.03724.6</td><td>0.04075.4</td><td>0.13405.4</td><td>0.04857.7</td><td>0.04916.0</td><td>0.0365</td></tr><tr><td>60</td><td>0.09374.9</td><td>0.0355.4</td><td>0.03646.1</td><td>0.03764.4</td><td>0.12013.3</td><td>0.03936.1</td><td>0.04115.3</td><td>0.031332</td></tr><tr><td rowspan="3">Citeseer</td><td>20</td><td>0.12487.1</td><td>0.06418.7</td><td>0.06443.7</td><td>0.05957.2</td><td>0.15345.0</td><td>0.09168.7</td><td>0.06339.8</td><td>0.05726.8</td></tr><tr><td>40</td><td>0.09577.7</td><td>0.06014.2</td><td>0.05385.7</td><td>0.05455.5</td><td>0.12528.7</td><td>0.07973.1</td><td>0.05905.4</td><td>0.05325.4</td></tr><tr><td>60</td><td>0.08066.4</td><td>0.05595.0</td><td>0.05216.4</td><td>0.05463.4</td><td>0.10905.9</td><td>0.06487.1</td><td>0.05199.1</td><td>0.05257.6</td></tr><tr><td rowspan="3">Pubmed</td><td>20</td><td>0.05867.7</td><td>0.05413.8</td><td>0.04764.2</td><td>0.0405.0</td><td>0.08353.1</td><td>0.06564.6</td><td>0.05013.7</td><td>0.0356</td></tr><tr><td>40</td><td>0.04445.5</td><td>0.04466.3</td><td>0.04366.3</td><td>0.0402.0</td><td>0.08694.6</td><td>0.06586.5</td><td>0.05396.0</td><td>0.0308</td></tr><tr><td>60</td><td>0.04459.7</td><td>0.03676.0</td><td>0.03186.4</td><td>0.03114.8</td><td>0.09934.1</td><td>0.06696.3</td><td>0.04835.7</td><td>0.03082</td></tr><tr><td rowspan="3">CoraFull</td><td>20</td><td>0.19866.1</td><td>0.10136.1</td><td>=</td><td>0.0776</td><td>0.21193.6</td><td>0.11015.1</td><td>=</td><td>0.07880</td></tr><tr><td>40</td><td>0.23215.4</td><td>0.11176.5</td><td></td><td>0.0701</td><td>0.24384.2</td><td>0.11338.3</td><td></td><td>0.07388</td></tr><tr><td>60</td><td>0.23374.0</td><td>0.09813.8</td><td></td><td>0.0768</td><td>0.24971.8</td><td>0.11335.2</td><td></td><td>0.0849</td></tr></table>
|
| 155 |
+
|
| 156 |
+
Consequently, we design a self-training model CaGCN-st where confidence is firstly calibrated then employed to generate pseudo labels for unlabeled nodes. Specifically, given an unlabeled dataset $D _ { U }$ and a labeled dataset $D _ { L }$ which has been divided into three parts $D _ { t r a i n }$ , $D _ { \nu a l }$ and $D _ { t e s t }$ , we firstly train a classification GCN using $D _ { t r a i n }$ to get the logit of each node. Then all the logits will be fed into a CaGCN to train and we get a calibrated confidence for each node. It should be noted that instead of $D _ { \nu a l }$ , we still employ $D _ { t r a i n }$ to train our CaGCN. After that, the most confident predictions of $D _ { U }$ will be adopted as the pseudo labels according to a threshold $\tau$ and added to the label set. The $D _ { t r a i n }$ is enlarged in this way. The process above will be repeated $s$ stages until convergence. Please note that our classification GCN and CaGCN are re-initialized in each stage.
|
| 157 |
+
|
| 158 |
+
# 5 Experiments
|
| 159 |
+
|
| 160 |
+
In this section, we evaluate the performance of CaGCN on confidence calibration and CaGCN-st on self-training respectively. We choose the commonly used citation networks Cora [29], Citeseer [29], Pubmed [29] and CoraFull [3] for evaluation, and more detailed descriptions are in Appendix B.
|
| 161 |
+
|
| 162 |
+
Table 3: Node classification accuracy and the standard deviation on GCN and its self-training variants.
|
| 163 |
+
|
| 164 |
+
<table><tr><td rowspan="2">Dataset</td><td rowspan="2">L/C</td><td colspan="7">Methods</td></tr><tr><td>Orig.</td><td>St.</td><td>Ct.</td><td>Union</td><td>Inter.</td><td>TS-st</td><td>CaGCN-st</td></tr><tr><td rowspan="3">Cora</td><td>20</td><td>81.630.24</td><td>82.270.33</td><td>81.510.30</td><td>81.850.68</td><td>81.410.28</td><td>82.680.20</td><td>83.110.52</td></tr><tr><td>40</td><td>83.990.26</td><td>83.590.34</td><td>83.660.25</td><td>83.330.41</td><td>83.380.33</td><td>84.440.35</td><td>84.370.38</td></tr><tr><td>60</td><td>84.440.29</td><td>84.980.32</td><td>84.630.31</td><td>85.030.30</td><td>84.880.18</td><td>85.600.24</td><td>85.790.27</td></tr><tr><td rowspan="3">Citeseer</td><td>20</td><td>71.640.32</td><td>73.240.44</td><td>74.220.29</td><td>74.600.38</td><td>72.250.45</td><td>74.200.24</td><td>74.90040</td></tr><tr><td>40</td><td>72.250.32</td><td>74.700.33</td><td>72.120.39</td><td>74.790.36</td><td>73.660.32</td><td>75.620.19</td><td>75.480.50</td></tr><tr><td>60</td><td>73.200.35</td><td>75.080.29</td><td>73.210.36</td><td>75.530.30</td><td>75.230.23</td><td>75.870.24</td><td>76.430.20</td></tr><tr><td rowspan="3">Pubmed</td><td>20</td><td>79.570.33</td><td>80.320.18</td><td>79.670.32</td><td>81.120.29</td><td>79.590.29</td><td>80.950.18</td><td>81.16.36</td></tr><tr><td>40</td><td>80.650.39</td><td>82.200.32</td><td>81.620.40</td><td>81.840.23</td><td>80.460.55</td><td>82.280.39</td><td>83.0821</td></tr><tr><td>60</td><td>83.380.34</td><td>83.350.28</td><td>83.400.36</td><td>83.320.35</td><td>83.310.17</td><td>83.260.39</td><td>84.47023</td></tr><tr><td rowspan="3">CoraFull</td><td>20</td><td>60.450.43</td><td>60.870.28</td><td>60.120.45</td><td>60.520.35</td><td>61.010.53</td><td>61.730.41</td><td>62.190.49</td></tr><tr><td>40</td><td>65.770.37</td><td>65.830.45</td><td>64.220.35</td><td>64.330.42</td><td>65.840.37</td><td>66.110.60</td><td>66.300.31</td></tr><tr><td>60</td><td>66.520.25</td><td>66.620.30</td><td>66.640.29</td><td>66.780.29</td><td>66.820.32</td><td>66.950.45</td><td>67.600.40</td></tr></table>
|
| 165 |
+
|
| 166 |
+
# 5.1 Confidence Calibration Evaluation
|
| 167 |
+
|
| 168 |
+
Baselines. Since our CaGCN is a general calibration model for GNNs, here we choose GCN [16] and GAT [33] as our classification models. For comparison, we choose the classic post-hoc calibration methods temperature scaling (TS) [12] and matrix scaling with off-diagonal regularization (MS) [18] as our baselines.
|
| 169 |
+
|
| 170 |
+
Experimental settings. For the base model GCN and GAT, i.e., the uncalibrated model, we follow parameters suggested by [16] and [33] and further carefully tune them to get optimal performance. For the post-hoc calibration technique, we follow the official implementation [12, 18]. For our CaGCN, we train a two-layer GCN with the hidden layer dimension to be 16. We set $\lambda = 0 . 5$ for all datasets, weight decay to be 5e-3 for Cora, Citeseer, Pubmed and 0.03 for CoraFull. Other parameters of CaGCN follows [16]. We evaluate the performance of confidence calibration by ECE [22], NLL [10] and Brier Score (BS) [4], which we expect are smaller, and we set the bin number $M = 2 0$ for ECE (more details can be seen in Appendix A). For all methods, we randomly run 10 times and report the average results. More detailed experimental settings can be seen in Appendix B.
|
| 171 |
+
|
| 172 |
+
Results. Table 2 reports calibration results evaluated by ECE (more results on NLL and Brier Score are in Appendix C.1). We have the following observations: (1) Compared with uncalibrated models and other baselines, CaGCN is statistically significantly better at the $^ { * } 0 . 0 5$ level and $\ast \ast _ { } 0 . 0 1$ level. (2) The ECE values on uncalibrated models are generally the highest, implying that GCN and GAT are poorly calibrated. (3) MS behaves badly on datasets with many classes, e.g., CoraFull. This is because the number of parameters for matrix scaling scales quadratically with the number of classes while the size of the validation set keeps unchanged. Therefore, it will over-fit to the small validation set when dataset has a great number of classes. However, CaGCN does not have this problem.
|
| 173 |
+
|
| 174 |
+
Additional analysis. In Section 2 we visualize the under-confidence problem of existing GNNs using reliability diagrams. Here we utilize the same visualization method to make a comparison before and after confidence calibration. As shown in Fig. 8, Fig. 9, Fig. 10 and Fig. 11 in the appendix, we can find that the confidence is well-calibrated after calibration.
|
| 175 |
+
|
| 176 |
+
# 5.2 Classification Evaluation of Self-Training
|
| 177 |
+
|
| 178 |
+
Baselines. Since self-training can be applied to any models, here we choose GCN and GAT as our base models, i.e., the original models (Orig.) without self-training, and we choose self-training (St.), co-training (Ct.), Union, Intersection (Inter.) methods proposed in [20] for comparison, which are commonly used as the baselines in self-training. Furthermore, we employ TS as the confidence calibration function in CaGCN-st as another baseline and we denote it by TS-st.
|
| 179 |
+
|
| 180 |
+
Experimental settings. We set the learning rate $l r = 0 . 0 0 1$ for CaGCN-st and train our CaGCN-st 200 epochs for Cora, 150 epochs for Citeseer, 100 epochs for Pubmed and 500 epochs for CoraFull. We set the threshold $\tau \in \{ 0 . 8 , 0 . 8 5 , 0 . 9 , 0 . 9 5 , 0 . 9 9 \}$ and the maximum number of stage $s = 1 0$ . As for baselines, all the parameters follow [20] and we further carefully tune them to get optimal performance. For all methods, we randomly run 10 times and report the average results.
|
| 181 |
+
|
| 182 |
+
Results. Table 3 summarizes the node classification accuracy on GCN and its self-training variants. More results on GAT can be seen in Appendix C.2. We have the following observation: (1) CaGCN-st consistently outperforms all the baselines on all the datasets and label rates at the $^ { * } 0 . 0 5$ level. (2) Compared with the base model, self-training methods generally achieve better results, which proves their effectiveness. (3) Self-training methods with confidence calibration (i.e., TS-st and CaGCN-st) have better performance, which implies that confidence calibration scales more correct predictions to the high confidence range while keeps incorrect predictions basically unchanged, which we believe is beneficial for self-training.
|
| 183 |
+
|
| 184 |
+
Ablation study. CaGCN-st generates pseudo labels based on the calibrated confidence. Here we study the effectiveness of the confidence calibration function CaGCN in CaGCNst. We propose a variant GCN-st of CaGCNst, where CaGCN is removed from CaGCN-st while other parts are kept unchanged. All the experimental settings of GCN-st are the same as CaGCN-st. We report the results in Table 4, and we can observe that CaGCN-st consistently outperforms GCN-st on all the datasets, implying that self-training with calibrated confidence can generate more correct pseudo labels.
|
| 185 |
+
|
| 186 |
+
Additional analysis. We also investigate the changing trends of accuracy with respect to the threshold $\tau$ in CaGCN-st in Appendix C.2 and study why GCNs are poorly calibrated in Appendix D.
|
| 187 |
+
|
| 188 |
+
Table 4: Abaltion study on self-training
|
| 189 |
+
|
| 190 |
+
<table><tr><td rowspan="2">Dataset L/C</td><td rowspan="2"></td><td>GCN</td><td></td><td>GAT</td></tr><tr><td>GCN-st CaGCN-st</td><td></td><td>GCN-st CaGCN-st</td></tr><tr><td rowspan="3">Cora</td><td>20</td><td>82.28</td><td>83.11</td><td>84.08 84.08</td></tr><tr><td>40</td><td>84.10</td><td>84.37 85.50</td><td>85.63</td></tr><tr><td>60</td><td>85.16 85.79</td><td>85.57</td><td>86.26</td></tr><tr><td rowspan="3">Citeseer</td><td>20</td><td>74.13</td><td>74.90</td><td>73.73 74.34</td></tr><tr><td>40</td><td>75.28</td><td>75.48</td><td>75.07 75.62</td></tr><tr><td>60</td><td>75.85 76.43</td><td>75.13</td><td>76.08</td></tr><tr><td rowspan="3">Pubmed</td><td>20</td><td>81.01</td><td>81.16</td><td>80.34 81.17</td></tr><tr><td>40</td><td>82.90</td><td>83.08</td><td>82.75 83.47</td></tr><tr><td>60</td><td>83.44 84.47</td><td>83.46</td><td>83.95</td></tr><tr><td rowspan="3">CoraFull</td><td>20</td><td>61.32</td><td>62.19 62.09</td><td>65.46</td></tr><tr><td>40</td><td>65.96</td><td>66.30</td><td>65.92 66.86</td></tr><tr><td>60</td><td>66.43 67.60</td><td>66.54</td><td>67.45</td></tr></table>
|
| 191 |
+
|
| 192 |
+
# 6 Related Work
|
| 193 |
+
|
| 194 |
+
Graph Neural Networks. Modern GCNs mimics CNNs to learn the local and global structural patterns of graphs through designed convolution and readout functions. [5] generalizes CNNs to graph signal based on the spectrum of graph Laplacian. ChebNet [7] uses Chebyshev polynomials to approximate the $K$ -order localized graph filters and GCN [16] further employs the 1-order simplification of the Chebyshev filter. GAT [33] utilizes attention mechanisms to adaptively learn aggregation weights. GraphSAGE [13] uses various ways of pooling for aggregation. [20] introduces self-training to GCNs and [30] proposes a multi-stage self-supervised (M3S) self-training algorithm of GCNs. Both [20] and [30] focus on the few-shot learning and neither has ever explored self-training with higher label rates in GCNs. More works on GNNs can be found in surveys [36, 43], however, to the best of our knowledge, current GNNs have not considered the confidence calibration.
|
| 195 |
+
|
| 196 |
+
Confidence Calibration. Confidence calibration has been studied for a long time in CV and NLP [12, 23, 25, 14, 19, 37, 40, 42]. [12] discovers modern neural networks are poorly calibrated and study factors influencing calibration. Platt scaling [24] is a simple post-hoc calibration method for binary models, which transforms the logit using scalar parameters. Temperature scaling is the simplest multi-class extension of Platt scaling and matrix and vector scaling are another two extensions of platt scaling. [40] proposes Mix-n-Match calibration strategies which mix parameter methods with non-parameter methods. [25] explores the non-linear space for post-hoc calibration function using a neural network. Moreover, [32] points out GNNs can be miscalibrated in the supervised scenario and mainly focus on miscalibration originated from the imbalanced class distribution. However, none of them have considered the confidence calibration in GNNs on the common semi-supervised scenario.
|
| 197 |
+
|
| 198 |
+
# 7 Conclusion
|
| 199 |
+
|
| 200 |
+
Current efforts on advancing GNNs mostly focus on classification accuracy. However, when deploying GNNs to real-world applications, especially safety-critical fields, whether the results of GNNs are trustworthy is another important factor that cannot be neglected. In this paper, we study the confidence calibration problem in GNNs and discover existing GNNs are under-confident on their predictions. To solve this problem, we propose a novel trustworthy GNN model CaGCN which respects the homophily property of confidence in GNNs and preserves the classification accuracy. Moreover, we propose a novel self-training method CaGCN-st where confidence is first calibrated by CaGCN and then used to generate pseudo labels. Extensive experiments demonstrate the effectiveness of our proposed model in terms of both calibration and accuracy.
|
| 201 |
+
|
| 202 |
+
An interesting direction for future work is to extend CaGCN to other graph tasks, but more studies need to be conducted. We take the link prediction as an example, where we can regard the link prediction as a binary classification problem and the output as the confidence. Considering that the ground-truth confidence distribution for nodes should have the homophily property as is shown in Section 3.1, edges are likely to have the same property as well. As a result, we can employ CaGCN to propagate the confidence between edges by regarding the edges as the nodes. However, more exploration still needs to be conducted for the homophily property of edges.
|
| 203 |
+
|
| 204 |
+
Broader impact. Current efforts on advancing GNNs mostly focus on classification accuracy. However, when deploying GNNs to real-world applications, especially safety-critical fields, whether the results of GNNs are trustworthy is another important factor. The demands for a trustworthy model are universal and extensive such as in the field of disease prediction [31], traffic states prediction [6] and object detection [11] for autonomous driving, where estimating the true probability of getting a correct prediction is necessary. We take the disease prediction [31] as an example, where GNNs are utilized to encode the information of different symptoms, users and diseases. In this scenario, accurately and comprehensively predicting diseases at an early stage will help patients receive prevention treatments in a timely manner. Otherwise, the misdiagnosis and missed diagnosis will endanger the health of patients. Therefore, a trustworthy model is urgently needed. Our CaGCN can make a trustworthy prediction based on its confidence, and as a result, decrease the risk of misdiagnosis and missed diagnosis. We hope our work can provide insights for future improvements in tackling the trustworthiness problem in other saftey-critical fields.
|
| 205 |
+
|
| 206 |
+
Limitations. One potential issue of this work is that it provides a limited explanation to the underconfidence problem. We advocate peer researchers to look into this, making GNNs more reliable in different domains. Other than that, since this work is mostly on the discovery of the confidence calibration problem in GNNs and the theoretical aspect of improving calibration, we do not foresee any direct negative impacts on the society.
|
| 207 |
+
|
| 208 |
+
# Acknowledgments and Disclosure of Funding
|
| 209 |
+
|
| 210 |
+
This work is supported in part by the National Natural Science Foundation of China (No. 62172052, No. U20B2045, U1936104, 61772082, 61702296, 62002029).
|
| 211 |
+
|
| 212 |
+
# References
|
| 213 |
+
|
| 214 |
+
[1] Dario Amodei, Chris Olah, Jacob Steinhardt, Paul Christiano, John Schulman, and Dan Mané. Concrete problems in ai safety. arXiv preprint arXiv:1606.06565, 2016.
|
| 215 |
+
[2] Deyu Bo, Xiao Wang, Chuan Shi, and Huawei Shen. Beyond low-frequency information in graph convolutional networks. arXiv preprint arXiv:2101.00797, 2021.
|
| 216 |
+
[3] Aleksandar Bojchevski and Stephan Günnemann. Deep gaussian embedding of graphs: Unsupervised inductive learning via ranking. arXiv preprint arXiv:1707.03815, 2017.
|
| 217 |
+
[4] Glenn W Brier. Verification of forecasts expressed in terms of probability. Monthly weather review, 78(1):1–3, 1950.
|
| 218 |
+
[5] Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs. arXiv preprint arXiv:1312.6203, 2013.
|
| 219 |
+
[6] 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, 21(11):4883–4894, 2019.
|
| 220 |
+
[7] Michaël Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. arXiv preprint arXiv:1606.09375, 2016.
|
| 221 |
+
[8] Charles Dugas, Yoshua Bengio, François Bélisle, Claude Nadeau, and René Garcia. Incorporating second-order functional knowledge for better option pricing. Advances in neural information processing systems, pages 472–478, 2001.
|
| 222 |
+
[9] Federico Errica, Marco Podda, Davide Bacciu, and Alessio Micheli. A fair comparison of graph neural networks for graph classification. arXiv preprint arXiv:1912.09893, 2019.
|
| 223 |
+
[10] Jerome Friedman, Trevor Hastie, Robert Tibshirani, et al. The elements of statistical learning, volume 1. Springer series in statistics New York, 2001.
|
| 224 |
+
[11] Jiayuan Gu, Han Hu, Liwei Wang, Yichen Wei, and Jifeng Dai. Learning region features for object detection. In Proceedings of the european conference on computer vision (ECCV), pages 381–395, 2018.
|
| 225 |
+
[12] Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q Weinberger. On calibration of modern neural networks. In International Conference on Machine Learning, pages 1321–1330. PMLR, 2017.
|
| 226 |
+
[13] William L Hamilton, Rex Ying, and Jure Leskovec. Inductive representation learning on large graphs. arXiv preprint arXiv:1706.02216, 2017.
|
| 227 |
+
[14] Zongbo Han, Changqing Zhang, Huazhu Fu, and Joey Tianyi Zhou. Trusted multi-view classification. In 9th International Conference on Learning Representations, ICLR 2021.
|
| 228 |
+
[15] Weihua Hu, Matthias Fey, Marinka Zitnik, Yuxiao Dong, Hongyu Ren, Bowen Liu, Michele Catasta, and Jure Leskovec. Open graph benchmark: Datasets for machine learning on graphs. arXiv preprint arXiv:2005.00687, 2020.
|
| 229 |
+
[16] Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016.
|
| 230 |
+
[17] 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.
|
| 231 |
+
[18] Meelis Kull, Miquel Perello-Nieto, Markus Kängsepp, Hao Song, Peter Flach, et al. Beyond temperature scaling: Obtaining well-calibrated multiclass probabilities with dirichlet calibration. arXiv preprint arXiv:1910.12656, 2019.
|
| 232 |
+
[19] Aviral Kumar, Sunita Sarawagi, and Ujjwal Jain. Trainable calibration measures for neural networks from kernel mean embeddings. In International Conference on Machine Learning, pages 2805–2814. PMLR, 2018.
|
| 233 |
+
[20] Qimai Li, Zhichao Han, and Xiao-Ming Wu. Deeper insights into graph convolutional networks for semi-supervised learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018.
|
| 234 |
+
[21] Allan H Murphy. A new vector partition of the probability score. Journal of Applied Meteorology and Climatology, 12(4):595–600, 1973.
|
| 235 |
+
[22] Mahdi Pakdaman Naeini, Gregory Cooper, and Milos Hauskrecht. Obtaining well calibrated probabilities using bayesian binning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 29, 2015.
|
| 236 |
+
[23] Alexandru Niculescu-Mizil and Rich Caruana. Predicting good probabilities with supervised learning. In Proceedings of the 22nd international conference on Machine learning, pages 625–632, 2005.
|
| 237 |
+
[24] John Platt et al. Probabilistic outputs for support vector machines and comparisons to regularized likelihood methods. Advances in large margin classifiers, 10(3):61–74, 1999.
|
| 238 |
+
[25] Amir Rahimi, Amirreza Shaban, Ching-An Cheng, Richard Hartley, and Byron Boots. Intra order-preserving functions for calibration of multi-class neural networks. Advances in Neural Information Processing Systems, 33, 2020.
|
| 239 |
+
[26] Mamshad Nayeem Rizve, Kevin Duarte, Yogesh S Rawat, and Mubarak Shah. In defense of pseudo-labeling: An uncertainty-aware pseudo-label selection framework for semi-supervised learning. arXiv preprint arXiv:2101.06329, 2021.
|
| 240 |
+
[27] Stanisław Saks. Theory of the integral. 1937.
|
| 241 |
+
[28] David W Scott. Multivariate density estimation: theory, practice, and visualization. John Wiley & Sons, 2015.
|
| 242 |
+
[29] Prithviraj Sen, Galileo Namata, Mustafa Bilgic, Lise Getoor, Brian Galligher, and Tina EliassiRad. Collective classification in network data. AI magazine, 29(3):93–93, 2008.
|
| 243 |
+
[30] Ke Sun, Zhouchen Lin, and Zhanxing Zhu. Multi-stage self-supervised learning for graph convolutional networks on graphs with few labeled nodes. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 5892–5899, 2020.
|
| 244 |
+
[31] Zhenchao Sun, Hongzhi Yin, Hongxu Chen, Tong Chen, Lizhen Cui, and Fan Yang. Disease prediction via graph neural networks. IEEE Journal of Biomedical and Health Informatics, 25 (3):818–826, 2020.
|
| 245 |
+
[32] Leonardo Teixeira, Brian Jalaian, and Bruno Ribeiro. Are graph neural networks miscalibrated? arXiv preprint arXiv:1905.02296, 2019.
|
| 246 |
+
[33] Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua ´ Bengio. Graph attention networks. arXiv preprint arXiv:1710.10903, 2017.
|
| 247 |
+
[34] Xiao Wang, Meiqi Zhu, Deyu Bo, Peng Cui, Chuan Shi, and Jian Pei. Am-gcn: Adaptive multichannel graph convolutional networks. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 1243–1253, 2020.
|
| 248 |
+
[35] Felix Wu, Amauri Souza, Tianyi Zhang, Christopher Fifty, Tao Yu, and Kilian Weinberger. Simplifying graph convolutional networks. In International conference on machine learning, pages 6861–6871. PMLR, 2019.
|
| 249 |
+
[36] Zonghan Wu, Shirui Pan, Fengwen Chen, Guodong Long, Chengqi Zhang, and S Yu Philip. A comprehensive survey on graph neural networks. IEEE transactions on neural networks and learning systems, 2020.
|
| 250 |
+
[37] Chen Xing, Sercan Arik, Zizhao Zhang, and Tomas Pfister. Distance-based learning from errors for confidence calibration. arXiv preprint arXiv:1912.01730, 2019.
|
| 251 |
+
[38] Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In 7th International Conference on Learning Representations, ICLR 2019.
|
| 252 |
+
[39] Jiaxuan You, Zhitao Ying, and Jure Leskovec. Design space for graph neural networks. Advances in Neural Information Processing Systems, 33, 2020.
|
| 253 |
+
[40] Jize Zhang, Bhavya Kailkhura, and T Yong-Jin Han. Mix-n-match: Ensemble and compositional methods for uncertainty calibration in deep learning. In International Conference on Machine Learning, pages 11117–11128. PMLR, 2020.
|
| 254 |
+
[41] Muhan Zhang and Yixin Chen. Link prediction based on graph neural networks. arXiv preprint arXiv:1802.09691, 2018.
|
| 255 |
+
[42] Xujiang Zhao, Feng Chen, Shu Hu, and Jin-Hee Cho. Uncertainty aware semi-supervised learning on graph data. arXiv preprint arXiv:2010.12783, 2020.
|
| 256 |
+
[43] Jie Zhou, Ganqu Cui, Shengding Hu, Zhengyan Zhang, Cheng Yang, Zhiyuan Liu, Lifeng Wang, Changcheng Li, and Maosong Sun. Graph neural networks: A review of methods and applications. AI Open, 1:57–81, 2020.
|
| 257 |
+
[44] Jiong Zhu, Yujun Yan, Lingxiao Zhao, Mark Heimann, Leman Akoglu, and Danai Koutra. Beyond homophily in graph neural networks: Current limitations and effective designs. Advances in Neural Information Processing Systems, 33, 2020.
|
md/train/B1eB5xSFvr/B1eB5xSFvr.md
ADDED
|
@@ -0,0 +1,432 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DIFFTAICHI: DIFFERENTIABLE PROGRAMMING FORPHYSICAL SIMULATION
|
| 2 |
+
|
| 3 |
+
Yuanming $\mathbf { H } \mathbf { u } ^ { \dag }$ , Luke Anderson†, Tzu-Mao $\mathbf { L i } ^ { * }$ , Qi $\mathbf { S u n } ^ { \ddagger }$ , Nathan $\mathbf { C a r r } ^ { \dagger }$ ,
|
| 4 |
+
Jonathan Ragan-Kelley∗, Frédo Durand†
|
| 5 |
+
†MIT CSAIL {yuanming,lukea,fredo}@mit.edu
|
| 6 |
+
‡Adobe Research {qisu,ncarr}@adobe.com
|
| 7 |
+
∗UC Berkeley {tzumao,jrk}@berkeley.edu
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
We present DiffTaichi, a new differentiable programming language tailored for building high-performance differentiable physical simulators. Based on an imperative programming language, DiffTaichi generates gradients of simulation steps using source code transformations that preserve arithmetic intensity and parallelism. A light-weight tape is used to record the whole simulation program structure and replay the gradient kernels in a reversed order, for end-to-end backpropagation. We demonstrate the performance and productivity of our language in gradient-based learning and optimization tasks on 10 different physical simulators. For example, a differentiable elastic object simulator written in our language is $4 . 2 \times$ shorter than the hand-engineered CUDA version yet runs as fast, and is $1 8 8 \times$ faster than the TensorFlow implementation. Using our differentiable programs, neural network controllers are typically optimized within only tens of iterations.
|
| 12 |
+
|
| 13 |
+

|
| 14 |
+
Figure 1: Left: Our language allows us to seamlessly integrate a neural network (NN) controller and a physical simulation module, and update the weights of the controller or the initial state parameterization (blue). Our simulations typically have $5 1 2 \sim 2 0 4 8$ time steps, and each time step has up to one thousand parallel operations. Right: 10 differentiable simulators built with DiffTaichi.
|
| 15 |
+
|
| 16 |
+
Differentiable physical simulators are effective components in machine learning systems. For example, de Avila Belbute-Peres et al. (2018a) and Hu et al. (2019b) have shown that controller optimization with differentiable simulators converges one to four orders of magnitude faster than model-free reinforcement learning algorithms. The presence of differentiable physical simulators in the inner loop of these applications makes their performance vitally important. Unfortunately, using existing tools it is difficult to implement these simulators with high performance.
|
| 17 |
+
|
| 18 |
+
We present DiffTaichi, a new differentiable programming language for high performance physical simulations on both CPU and GPU. It is based on the Taichi programming language (Hu et al.,
|
| 19 |
+
|
| 20 |
+
2019a). The DiffTaichi automatic differentiation system is designed to suit key language features required by physical simulation, yet often missing in existing differentiable programming tools, as detailed below:
|
| 21 |
+
|
| 22 |
+
Megakernels Our language uses a “megakernel” approach, allowing the programmer to naturally fuse multiple stages of computation into a single kernel, which is later differentiated using source code transformations and just-in-time compilation. Compared to the linear algebra operators in TensorFlow (Abadi et al., 2016) and PyTorch (Paszke et al., 2017), DiffTaichi kernels have higher arithmetic intensity and are therefore more efficient for physical simulation tasks.
|
| 23 |
+
|
| 24 |
+
Imperative Parallel Programming In contrast to functional array programming languages that are popular in modern deep learning (Bergstra et al., 2010; Abadi et al., 2016; Li et al., 2018b), most traditional physical simulation programs are written in imperative languages such as Fortran and $\mathrm { C } { + } { + }$ . DiffTaichi likewise adopts an imperative approach. The language provides parallel loops and control flows (such as “if” statements), which are widely used constructs in physical simulations: they simplify common tasks such as handling collisions, evaluating boundary conditions, and building iterative solvers. Using an imperative style makes it easier to port existing physical simulation code to DiffTaichi.
|
| 25 |
+
|
| 26 |
+
Flexible Indexing Existing parallel differentiable programming systems provide element-wise operations on arrays of the same shape, e.g. c[i, j] $=$ a[i, j] + b[i, j]. However, many physical simulation operations, such as numerical stencils and particle-grid interactions are not elementwise. Common simulation patterns such as y[p[i] $\star \ 2$ , $\mathbf { j } ] \ = \ \times [ \mathbf { q } [ \mathbf { j } + \mathbf { j } ] ]$ can only be expressed with unintuitive scatter/gather operations in these existing systems, which are not only inefficient but also hard to develop and maintain. On the other hand, in DiffTaichi, the programmer directly manipulates array elements via arbitrary indexing, thus allowing partial updates of global arrays and making these common simulation patterns naturally expressible. The explicit indexing syntax also makes it easy for the compiler to perform access optimizations (Hu et al., 2019a).
|
| 27 |
+
|
| 28 |
+
The three requirements motivated us to design a tailored two-scale automatic differentiation system, which makes DiffTaichi especially suitable for developing complex and high-performance differentiable physical simulators, possibly with neural network controllers (Fig. 1, left). Using our language, we are able to quickly implement and automatically differentiate 10 physical simulators1, covering rigid bodies, deformable objects, and fluids (Fig. 1, right). A comprehensive comparison between DiffTaichiand other differentiable programming tools is in Appendix A.
|
| 29 |
+
|
| 30 |
+
# 2 BACKGROUND: THE TAICHI PROGRAMMING LANGUAGE
|
| 31 |
+
|
| 32 |
+
DiffTaichi is based on the Taichi programming language (Hu et al., 2019a). Taichi is an imperative programming language embedded in $\mathrm { C } { + } { + } 1 4$ . It delivers both high performance and high productivity on modern hardware. The key design that distinguishes Taichi from other imperative programming languages such as $\mathrm { C + + / C U D A }$ is the decoupling of computation from data structures. This allows programmers to easily switch between different data layouts and access data structures with indices (i.e. $\times [ \mathfrak { i } , \ \mathfrak { j } , \ \mathsf { k } ] ,$ , as if they are normal dense arrays, regardless of the underlying layout. The Taichi compiler then takes both the data structure and algorithm information to apply performance optimizations. Taichi provides “parallel-for" loops as a first-class construct. These designs make Taichi especially suitable for writing high-performance physical simulators. For more details, readers are referred to Hu et al. (2019a).
|
| 33 |
+
|
| 34 |
+
The DiffTaichi language frontend is embedded in Python, and a Python AST transformer compiles DiffTaichi code to Taichi intermediate representation (IR). Unlike Python, the DiffTaichi language is compiled, statically-typed, parallel, and differentiable. We extend the Taichi compiler to further compile and automatically differentiate the generated Taichi IR into forward and backward executables.
|
| 35 |
+
|
| 36 |
+
We demonstrate the language using a mass-spring simulator, with three springs and three mass points, as shown right. In this section we introduce the forward simulator using the DiffTaichi frontend of Taichi, which is an easier-to-use wrapper of the Taichi $\mathrm { C } { + } { + } 1 4$ frontend.
|
| 37 |
+
|
| 38 |
+
Allocating Global Variables Firstly we allocate a set of global tensors to store the simulation state. These tensors include a scalar loss of type float32, 2D tensors $\times , ~ \lor$ , force of size steps $\times { \mathsf n _ { - } }$ springs and type float $3 2 \times 2$ , and 1D arrays of size n_spring for spring properties: spring_anchor_a (int32), spring_anchor_b (int32), spring_length (float32).
|
| 39 |
+
|
| 40 |
+
Defining Kernels A mass-spring system is modeled by Hooke’s law $\textbf { F } = \ k ( \| \mathbf { x } _ { a } - \mathbf { x } _ { b } \| _ { 2 } \ - $ $l _ { 0 } ) \frac { \mathbf { x } _ { a } - \mathbf { x } _ { b } } { \lVert \mathbf { x } _ { a } - \mathbf { x } _ { b } \rVert _ { 2 } }$ where $k$ is the spring stiffness, $\mathbf { F }$ is spring force, $\mathbf { x } _ { a }$ and $\mathbf { x } _ { b }$ are the positions of two mass points, and $l _ { 0 }$ is the rest length. The following kernel loops over all the springs and scatters forces to mass points:
|
| 41 |
+
|
| 42 |
+
@ti.kernel
|
| 43 |
+
def apply_spring_force(t: ti.i32): # Kernels can have parameters. Here t is a parameter with type int32. for i in range(n_springs): # A parallel for, preferably on GPU a, $\textrm { b } =$ spring_anchor_a[i], spring_anchor_b[i] $\times \_ a$ , ${ \bf \sf x _ { - } b } ~ = ~ { \bf \sf x _ { \bar { \tau } } t } ~ - ~ { \bf \epsilon } _ { 1 }$ , a], $\times \left[ { \ t { \mathrm { ~ \ - ~ } } 1 } \right.$ , b] dist $= \mathbf { \nabla } \times \_ \mathsf { a } - \mathbf { \nabla } \times \_ \mathsf { b }$ length $=$ dist.norm() + 1e-4 $\begin{array} { r l } { \mathsf { F } } & { { } = } \end{array}$ (length - spring_length[i]) $\star$ spring_stiffness $\star$ dist / length # Apply spring impulses to mass points. force[t, a] $+ = - \mathsf { F } \sharp \mathsf { \Gamma } ^ { \prime \prime } { + } = { \mathrm { \Omega } } ^ { \prime \prime }$ is atomic by default force[t, b] $\mathrm { \Sigma } + + + \mathrm { \Sigma } \mathsf { F }$
|
| 44 |
+
|
| 45 |
+
For each particle $i$ , we use semi-implicit Euler time integration with damping: $\begin{array} { r } { { \pmb v } _ { t , i } = e ^ { - \Delta t \alpha } { \pmb v } _ { t - 1 , i } + } \end{array}$ $\begin{array} { r } { \frac { \Delta t } { m _ { i } } { \bf F } _ { t , i } , { \bf x } _ { t , i } = { \bf x } _ { t - 1 , i } + \Delta t { \bf v } _ { t , i } } \end{array}$ , where $\pmb { v } _ { t , i } , \mathbf { x } _ { t , i } , m _ { i }$ are the velocity, position and mass of particle $i$ at time step $t$ , respectively. $\alpha$ is a damping factor. The kernel is as follows:
|
| 46 |
+
|
| 47 |
+
@ti.kernel
|
| 48 |
+
def time_integrate(t: ti.i32): for i in range(n_objects): $\qquad \mathsf { s } \quad \mathsf { = }$ math.exp(-dt $\star$ damping) $\#$ Compile-time evaluation since dt and damping are constants $\mathsf { v } [ \mathsf { t } , \mathsf { ~ \mathsf { ~ \mathsf { \Sigma } ~ } } _ { } { \mathsf { \Sigma } } ] = \mathsf { s } \star \mathsf { v } [ \mathsf { t } - \mathsf { ~ \mathsf { \Sigma } ~ } _ { } { \mathsf { \Sigma } } _ { } { \mathsf { \Sigma } } \mathsf { i } ] + \mathsf { d } \mathsf { t } \star \mathsf { \Sigma } _ { } { \mathsf { \Sigma } } _ { } { \mathsf { \Sigma } } _ { } { \mathsf { \Sigma } } _ { } { \mathsf { \Sigma } } _ { } { \mathsf { \Sigma } } _ { } { \mathsf { \Sigma } } _ { } { \mathsf { \Sigma } } _ { } { \mathsf { \Sigma } } _ { }$ force[t, i] / mass $\#$ mass $= ~ 1$ in this example x[t, $\dot { \bf ~ l } ] ~ = ~ { \bf \nabla } \times [ \dot { \bf t } ~ - ~ { \bf 1 }$ , i] $^ +$ dt $\star$ v[t, i]
|
| 49 |
+
|
| 50 |
+
Assembling the Forward Simulator With these components, we define the forward time integration:
|
| 51 |
+
|
| 52 |
+
def forward(): for t in range(1, steps): apply_spring_force(t) time_integrate(t)
|
| 53 |
+
|
| 54 |
+
# 3 AUTOMATICALLY DIFFERENTIATING PHYSICAL SIMULATORS IN TAICHI
|
| 55 |
+
|
| 56 |
+
The main goal of DiffTaichi’s automatic differentiation (AD) system is to generate gradient simulators automatically with minimal code changes to the traditional forward simulators.
|
| 57 |
+
|
| 58 |
+
Design Decision Source Code Transformation (SCT) (Griewank & Walther, 2008) and Tracing (Wengert, 1964) are common choices when designing AD systems. In our setting, using SCT to differentiate a whole simulator with thousands of time steps, results in high performance yet poor flexibility and long compilation time. On the other hand, naively adopting tracing provides flexibility yet poor performance, since the “megakernel" structure is not preserved during backpropagation. To get both performance and flexibility, we developed a two-scale automatic differentiation system (Figure 2): we use SCT for differentiating within kernels, and use a light-weight tape that only stores function pointers and arguments for end-to-end simulation differentiation. The global tensors are natural checkpoints for gradient evaluation.
|
| 59 |
+
|
| 60 |
+

|
| 61 |
+
Figure 2: Left: The DiffTaichi system. We reuse some infrastructure (white boxes) from Taichi, while the blue boxes are our extensions for differentiable programming. Right: The tape records kernel launches and replays the gradient kernels in reverse order during backpropagation.
|
| 62 |
+
|
| 63 |
+
Assumption Unlike functional programming languages where immutable output buffers are generated, imperative programming allows programmers to freely modify global tensors. To make automatic differentiation well-defined under this setting, we make the following assumption on imperative kernels:
|
| 64 |
+
|
| 65 |
+
# Global Data Access Rules:
|
| 66 |
+
|
| 67 |
+
1) If a global tensor element is written more than once, then starting from the second write, the write must come in the form of an atomic add (“accumulation”). 2) No read accesses happen to a global tensor element, until its accumulation is done.
|
| 68 |
+
|
| 69 |
+
In forward simulators, programmers may make subtle changes to satisfy the rules. For instance, in the mass-spring simulation example, we record the whole history of $\times$ and $\vee$ , instead of keeping only the latest values. The memory consumption issues caused by this can be alleviated via checkpointing, as discussed later in Appendix D.
|
| 70 |
+
|
| 71 |
+
With these assumptions, kernels will not overwrite the outputs of each other, and the goal of AD is clear: given a primal kernel $f$ that takes as input $X _ { 1 } , X _ { 2 } , \ldots , X _ { n }$ and outputs (or accumulates to) $Y _ { 1 } , Y _ { 2 } , \dots , Y _ { m }$ , the generated gradient (adjoint) kernel $f ^ { * }$ should take as input $X _ { 1 } , X _ { 2 } , \ldots , X _ { n }$ and $Y _ { 1 } ^ { * }$ $^ { \prime * } _ { 1 } , Y _ { 2 } ^ { * } , \ldots , Y _ { m } ^ { * }$ and accumulate gradient contributions to $X _ { 1 } ^ { * } , X _ { 2 } ^ { * } , \ldots , X _ { m } ^ { * }$ , where each $X _ { i } ^ { * }$ is an adjoint of $X _ { i }$ , i.e. $\partial ( \mathrm { I o s s } ) / \partial X _ { i }$ .
|
| 72 |
+
|
| 73 |
+
Storage Control of Adjoint Tensors Users can specify the storage of adjoint tensors using the Taichi data structure description language (Hu et al., 2019a), as if they are primal tensors. We also provide ti.root.lazy_grad() to automatically place the adjoint tensors following the layout of their primals.
|
| 74 |
+
|
| 75 |
+
# 3.1 LOCAL AD: DIFFERENTIATING TAICHI KERNELS USING SOURCE CODE TRANSFORMS
|
| 76 |
+
|
| 77 |
+
A typical Taichi kernel consists of multiple levels of for loops and a body block. To make later AD easier, we introduce two basic code transforms to simplify the loop body, as detailed below.
|
| 78 |
+
|
| 79 |
+

|
| 80 |
+
Figure 3: Simple IR preprocessing before running the AD source code transform (left to right). Demonstrated in ${ \mathsf { C } } { + } { + }$ . The actual Taichi IR is often more complex. Containing loops are ignored.
|
| 81 |
+
|
| 82 |
+
Flatten Branching In physical simulation branches are common, e.g., when implementing boundary conditions and collisions. To simplify the reverse-mode AD pass, we first replace “if” statements with ternary operators select(cond, value_if_true, value_if_false), whose gradients are clearly defined (Fig. 3, middle). This is a common transformation in program vectorization (e.g. Karrenberg & Hack (2011); Pharr & Mark (2012)).
|
| 83 |
+
|
| 84 |
+
Eliminate Mutable Local Variables After removing branching, we end up with straight-line loop bodies. To further simplify the IR and make the procedure truly single-assignment, we apply a series of local variable store forwarding transforms, until the mutable local variables can be fully eliminated (Fig. 3, right).
|
| 85 |
+
|
| 86 |
+
After these two custom IR simplification transforms, DiffTaichi only has to differentiate the straightline code without mutable variables, which it achieves with reverse-mode AD, using a standard source code transformation (Griewank & Walther, 2008). More details on this transform are in Appendix B.
|
| 87 |
+
|
| 88 |
+
Loops Most loops in physical simulation are parallel loops, and during AD we preserve the parallel loop structures. For loops that are not explicitly marked as parallel, we reverse the loop order during AD transforms. We do not support loops that carry a mutating local variable since that would require a complex and costly run-time stack to maintain the history of local variables. Instead, users are instructed to employ global variables that satisfy the global data access rules.
|
| 89 |
+
|
| 90 |
+
Parallelism and Thread Safety For forward simulation, we inherit the “parallel-for" construct from Taichi to map each loop iteration onto CPU/GPU threads. Programmers use atomic operations for thread safety. Our system can automatically differentiate these atomic operations. Gradient contributions in backward kernels are accumulated to the adjoint tensors via atomic adds.
|
| 91 |
+
|
| 92 |
+
# 3.2 GLOBAL AD: END-TO-END BACKPROPAGATION USING A LIGHT-WEIGHT TAPE
|
| 93 |
+
|
| 94 |
+
We construct a tape (Fig. 2, right) of the kernel execution so that gradient kernels can be replayed in a reversed order. The tape is very light-weight: since the intermediate results are stored in global tensors, during forward simulation the tape only records kernel names and the (scalar) input parameters, unlike other differentiable functional array systems where all the intermediate buffers have to be recorded by the tape. Whenever a DiffTaichi kernel is launched, we append the kernel function pointer and parameters to the tape. When evaluating gradients, we traverse the reversed tape, and invoke the gradient kernels with the recorded parameters. Note that DiffTaichi AD is evaluating gradients with respect to input global tensors instead of the input parameters.
|
| 95 |
+
|
| 96 |
+
Learning/Optimization with Gradients Now we revisit the mass-spring example and make it differentiable for optimization. Suppose the goal is to optimize the rest lengths of the springs so that the triangle area formed by the three springs becomes 0.2 at the end of the simulation. We first define the loss function:
|
| 97 |
+
|
| 98 |
+

|
| 99 |
+
|
| 100 |
+
Goal: Adjust the spring
|
| 101 |
+
rest lengths,so that thisarea=0.2
|
| 102 |
+
after 1024 time steps
|
| 103 |
+
(initialarea $\mathbf { \tau } = \mathbf { 0 . 0 0 5 }$ )
|
| 104 |
+
|
| 105 |
+
The programmer uses ti.Tape to memorize forward kernel launches. It automatically replays the gradients of these kernels in reverse for backpropagation. Initially the springs have lengths [0.1, 0.1, 0.14], and after optimization the rest lengths are [0.600, 0.600, 0.529]. This means the springs will expand the triangle according to Hooke’s law and form a larger triangle: [Reproduce: mass_spring_simple.py]
|
| 106 |
+
|
| 107 |
+

|
| 108 |
+
|
| 109 |
+
Complex Kernels Sometimes the user may want to override the gradients provided by the compiler. For example, when differentiating a 3D singular value decomposition done with an iterative solver, it is better to use a manually engineered SVD derivative subroutine for better stability. We provide two more decorators ti.complex_kernel and ti.complex_kernel_grad to overwrite the default automatic differentiation, as detailed in Appendix C. Apart from custom gradients, complex kernels can also be used to implement checkpointing, as detailed in Appendix D.
|
| 110 |
+
|
| 111 |
+
# 4 EVALUATION
|
| 112 |
+
|
| 113 |
+
We evaluate DiffTaichi on 10 different physical simulators covering large-scale continuum and small-scale rigid body simulations. All results can be reproduced with the provided script. The dynamic/optimization processes are visualized in the supplemental video. In this section we focus our discussions on three simulators. More details on the simulators are in Appendix E.
|
| 114 |
+
|
| 115 |
+
# 4.1 DIFFERENTIABLE CONTINUUM MECHANICS FOR ELASTIC OBJECTS [diffmpm]
|
| 116 |
+
|
| 117 |
+
First, we build a differentiable continuum simulation for soft robotics applications. The physical system is governed by momentum and mass conservation, i.e. $\begin{array} { r } { \rho \frac { D \mathbf { v } } { D t } = \nabla \cdot \boldsymbol { \sigma } + \rho \mathbf { g } } \end{array}$ , $\begin{array} { r } { \frac { D \rho } { D t } + \rho \nabla \cdot \mathbf { v } = } \end{array}$ 0. We follow ChainQueen’s implementation (Hu et al., 2019b) and use the moving least squares material point method (Hu et al., 2018) to simulate the system. We were able to easily translate the original CUDA simulator into DiffTaichi syntax. Using this simulator and an open-loop controller, we can easily train a soft robot to move forward (Fig. 1, diffmpm).
|
| 118 |
+
|
| 119 |
+
Performance and Productivity Compared with manual gradient implementations in (Hu et al., 2019b), getting gradients in DiffTaichi is effortless. As a result, the DiffTaichi implementation is $4 . 2 \times$ shorter in terms of lines of code, and runs almost as fast; compared with TensorFlow, DiffTaichi code is $1 . 7 \times$ shorter and $1 8 8 \times$ faster (Table 1). The Tensorflow implementation is verbose due to the heavy use of tf.gather_nd/scatter_nd and array transposing and broadcasting.
|
| 120 |
+
|
| 121 |
+
Table 1: diffmpm performance comparison on an NVIDIA GTX 1080 Ti GPU. We benchmark in 2D using 6.4K particles. For the lines of code, we only include the essential implementation, excluding boilerplate code. [Reproduce: python3 diffmpm_benchmark.py]
|
| 122 |
+
|
| 123 |
+
<table><tr><td>Approach</td><td>Forward Time</td><td>Backward Time</td><td>Total Time</td><td># Lines of Code</td></tr><tr><td>TensorFlow</td><td>13.20 ms</td><td>35.70 ms</td><td>48.90 ms (188.×)</td><td>190</td></tr><tr><td>CUDA</td><td>0.10 ms</td><td>0.14 ms</td><td>0.24 ms (0.92×)</td><td>460</td></tr><tr><td>DiffTaichi</td><td>0.11 ms</td><td>0.15 ms</td><td>0.26 ms (1.00×)</td><td>110</td></tr></table>
|
| 124 |
+
|
| 125 |
+
# 4.2 DIFFERENTIABLE INCOMPRESSIBLE FLUID SIMULATOR [smoke]
|
| 126 |
+
|
| 127 |
+
We implemented a smoke simulator (Fig. 1, smoke) with semi-Lagrangian advection (Stam, 1999) and implicit pressure projection, following the example in Autograd (Maclaurin et al., 2015). Using gradient descent optimization on the initial velocity field, we are able to find a velocity field that changes the pattern of the fluid to a target image (Fig. 7a in Appendix). We compare the performance of our system against PyTorch, Autograd, and JAX in Table 2. Note that as an example from the
|
| 128 |
+
|
| 129 |
+
Table 2: smoke benchmark against Autograd, PyTorch, and JAX. We used a $1 1 0 ~ \times ~ 1 1 0$ grid and 100 time steps, each with 6 Jacobi pressure projections. [Reproduce: python3 smoke_[autograd/pytorch/jax/taichi_cpu/taichi_gpu].py]. Note that the Autograd program uses float64 precision, which approximately doubles the run time.
|
| 130 |
+
|
| 131 |
+
<table><tr><td>Approach</td><td>Forward Time</td><td>Backward Time</td><td>Total Time</td><td>#Essential LoC</td></tr><tr><td>PyTorch (CPU, f32)</td><td>405 ms</td><td>328 ms</td><td>733 ms (13.8×)</td><td>74</td></tr><tr><td>PyTorch (GPU, f32)</td><td>254 ms</td><td>457 ms</td><td>711 ms (13.4×)</td><td>74</td></tr><tr><td>Autograd (CPU, f64)</td><td>307 ms</td><td>1197 ms</td><td>1504 ms (28.4×)</td><td>51</td></tr><tr><td>JAX (GPU, f32)</td><td>24 ms</td><td>75 ms</td><td>99 ms (1.9×)</td><td>90</td></tr><tr><td>DiffTaichi (CPU, f32)</td><td>66 ms</td><td>132 ms</td><td>198 ms (3.7x)</td><td>75</td></tr><tr><td>DiffTaichi (GPU, f32)</td><td>24 ms</td><td>29 ms</td><td>53 ms (1.0×)</td><td>75</td></tr></table>
|
| 132 |
+
|
| 133 |
+
Autograd library, this grid-based simulator is intentionally simplified to suit traditional array-based programs. For example, a periodic boundary condition is used so that Autograd can represent it using numpy.roll, without any branching. Still, Taichi delivers higher performance than these arraybased systems. The whole program takes 10 seconds to run in DiffTaichi on a GPU, and 2 seconds are spent on JIT. JAX JIT compilation takes 2 minutes.
|
| 134 |
+
|
| 135 |
+
# 4.3 DIFFERENTIABLE RIGID BODY SIMULATORS [rigid_body]
|
| 136 |
+
|
| 137 |
+
We built an impulse-based (Catto, 2009) differentiable rigid body simulator (Fig. 1, rigid_body) for optimizing robot controllers. This simulator supports rigid body collision and friction, spring forces, joints, and actuation. The simulation is end-to-end differentiable except for a countable number of discontinuities. Interestingly, although the forward simulator works well, naively differentiating it with DiffTaichi leads to completely misleading gradients, due to the rigid body collisions. We discuss the cause and solution of this issue below.
|
| 138 |
+
|
| 139 |
+
Improving collision gradients Consider the rigid ball example in Fig. 4 (left), where a rigid ball collides with a friction-less ground. Gravity is ignored, and due to conservation of kinetic energy the ball keeps a constant speed even after this elastic collision.
|
| 140 |
+
|
| 141 |
+
In the forward simulation, using a small $\Delta t$ often leads to a reasonable result, as done in many physics simulators. Lowering the initial ball height will increase the final ball height, since there is less distance to travel before the ball hits the ground and more after (see the loss curves in Fig.4, middle right). However, using a naive time integrator, no matter how small $\Delta t$ is, the evaluated gradient of final height w.r.t. initial height will be 1 instead of $- 1$ . This counter-intuitive behavior is due to the fact that time discretization itself is not differentiated by the compiler. Fig. 4 explains this effect in greater detail.
|
| 142 |
+
|
| 143 |
+

|
| 144 |
+
Figure 4: How gradients can go wrong with naive time integrators. For clarity we use a large $\Delta t$ here. Left: Since collision detection only happens at multiples of $\Delta t$ ( $2 \Delta t$ in this case), lowering the initial position of the ball (light blue) leads to a lowered final position. Middle Left: By improving the time integrator to support continuous time of impact (TOI), collisions can be detected at any time, e.g. $1 . 9 \Delta t$ (light red). Now the blue ball ends up higher than the green one. Middle Right: Although the two time integration techniques lead to almost identical forward results (in practice $\Delta t$ is small), the naive time integrator gives an incorrect gradient of 1, but adding TOI yields the correct gradient. Please see our supplemental video for a better demonstration. [Reproduce: python3 rigid_body_toi.py] Right: When zooming in, the loss of the naive integrator is decreasing, and the saw-tooth pattern explains the positive gradients. [Reproduce: python3 rigid_body_toi.py zoom]
|
| 145 |
+
|
| 146 |
+

|
| 147 |
+
Figure 5: Adding TOI greatly improves gradient and optimization quality. Each experiment is repeated five times. [Reproduce: python3 [mass_spring/rigid_body.py] [1/2] plot && python3 plot_losses.py]
|
| 148 |
+
|
| 149 |
+
We propose a simple solution of adding continuous collision resolution (see, for example, Redon et al. (2002)), which considers precise time of impact (TOI), to the forward program (Fig. 4, middle left). Although it barely improves the forward simulation (Fig. 4, middle right), the gradient will be corrected effectively (Fig. 4, right). The details of continuous collision detection are in Appendix F. In real-world simulators, we find the TOI technique leads to significant improvement in gradient quality in controller optimization tasks (Fig. 5). Having TOI or not barely affects forward simulation: in the supplemental video, we show that a robot controller optimized in a simulator with TOI, actually works well in a simulator without TOI.
|
| 150 |
+
|
| 151 |
+
The takeaway is, differentiating physical simulators does not always yield useful gradients of the physical system being simulated, even if the simulator does forward simulation well. In Appendix G, we discuss some additional gradient issues we have encountered.
|
| 152 |
+
|
| 153 |
+
# 5 RELATED WORK
|
| 154 |
+
|
| 155 |
+
Differentiable programming The recent rise of deep learning has motivated the development of differentiable programming libraries for deep NNs, most notably auto-differentiation frameworks such as Theano (Bergstra et al., 2010), TensorFlow (Abadi et al., 2016) and PyTorch (Paszke et al., 2017). However, physical simulation requires complex and customizable operations due to the intrinsic computational irregularity. Using the aforementioned frameworks, programmers have to compose these coarse-grained basic operations into desired complex operations. Doing so often leads to unsatisfactory performance.
|
| 156 |
+
|
| 157 |
+
Earlier work on automatic differentiation focuses on transforming existing scalar code to obtain derivatives (e.g. Utke et al. (2008), Hascoet & Pascual (2013), Pearlmutter & Siskind (2008)). A recent trend has emerged for modern programming languages to support differentiable function transformations through annotation (e.g. Innes et al. (2019), Wei et al. (2019)). These frameworks enable differentiating general programming languages, yet they provide limited parallelism.
|
| 158 |
+
|
| 159 |
+
Differentiable array programming languages such as Halide (Ragan-Kelley et al., 2013; Li et al., 2018b), Autograd (Maclaurin et al., 2015), JAX (Bradbury et al., 2018), and Enoki (Jakob, 2019) operate on arrays instead of scalars to utilize parallelism. Instead of operating on arrays that are immutable, DiffTaichi uses an imperative style with flexible indexing to make porting existing physical simulation algorithms easier.
|
| 160 |
+
|
| 161 |
+
Differentiable Physical Simulators Building differentiable simulators for robotics and machine learning has recently increased in popularity. Without differentiable programming, Battaglia et al. (2016), Chang et al. (2016) and Mrowca et al. (2018) used NNs to approximate the physical process and used the NN gradients as the approximate simulation gradients. Degrave et al. (2016) and de Avila Belbute-Peres et al. (2018b) used Theano and PyTorch respectively to build differentiable rigid body simulators. Schenck & Fox (2018) differentiates position-based fluid using custom CUDA kernels. Popovic et al. ´ (2000) used a differentiable rigid body simulator for manipulating physically based animations. The ChainQueen differentiable elastic object simulator (Hu et al., 2019b) implements forward and gradient versions of continuum mechanics in hand-written CUDA kernels, leading to performance that is two orders of magnitude higher than a pure TensorFlow implementation. Liang et al. (2019) built a differentiable cloth simulator for material estimation and motion control. The deep learning community also often incorporates differentiable rendering operations (OpenDR (Loper & Black, 2014), N3MR (Kato et al., 2018), redner (Li et al., 2018a), Mitsuba 2 (Nimier-David et al., 2019)) to learn from 3D scenes.
|
| 162 |
+
|
| 163 |
+
# 6 CONCLUSION
|
| 164 |
+
|
| 165 |
+
We have presented DiffTaichi, a new differentiable programming language designed specifically for building high-performance differentiable physical simulators. Motivated by the need for supporting megakernels, imperative programming, and flexible indexing, we developed a tailored two-scale automatic differentiation system. We used DiffTaichi to build 10 simulators and integrated them into deep neural networks, which proved the performance and productivity of DiffTaichi over existing systems. We hope our programming language can greatly lower the barrier of future research on differentiable physical simulation in the machine learning and robotics communities.
|
| 166 |
+
|
| 167 |
+
# BIBLIOGRAPHY
|
| 168 |
+
|
| 169 |
+
Martín Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, et al. Tensorflow: A system for largescale machine learning. In 12th USENIX Symposium on Operating Systems Design and Implementation (OSDI 16), pp. 265–283, 2016.
|
| 170 |
+
|
| 171 |
+
Peter W. Battaglia, Razvan Pascanu, Matthew Lai, Danilo Rezende, and Koray Kavukcuoglu. Interaction networks for learning about objects, relations and physics. 2016.
|
| 172 |
+
|
| 173 |
+
James Bergstra, Olivier Breuleux, Frédéric Bastien, Pascal Lamblin, Razvan Pascanu, Guillaume Desjardins, Joseph Turian, David Warde-Farley, and Yoshua Bengio. Theano: A cpu and gpu math compiler in python. In Proc. 9th Python in Science Conf, volume 1, pp. 3–10, 2010.
|
| 174 |
+
|
| 175 |
+
James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal Maclaurin, and Skye Wanderman-Milne. JAX: composable transformations of Python+NumPy programs, 2018. URL http://github.com/google/jax.
|
| 176 |
+
|
| 177 |
+
Erin Catto. Modeling and solving constraints. In Game Developers Conference, pp. 16, 2009.
|
| 178 |
+
|
| 179 |
+
Michael B Chang, Tomer Ullman, Antonio Torralba, and Joshua B Tenenbaum. A compositional object-based approach to learning physical dynamics. ICLR, 2016.
|
| 180 |
+
|
| 181 |
+
Filipe de Avila Belbute-Peres, Kevin Smith, Kelsey Allen, Josh Tenenbaum, and J Zico Kolter. End-to-end differentiable physics for learning and control. In Advances in Neural Information Processing Systems, pp. 7178–7189, 2018a.
|
| 182 |
+
|
| 183 |
+
Filipe de Avila Belbute-Peres, Kevin A Smith, Kelsey Allen, Joshua B Tenenbaum, and J Zico Kolter. End-to-end differentiable physics for learning and control. In Neural Information Processing Systems, 2018b.
|
| 184 |
+
|
| 185 |
+
Jonas Degrave, Michiel Hermans, Joni Dambre, et al. A differentiable physics engine for deep learning in robotics. arXiv preprint arXiv:1611.01652, 2016.
|
| 186 |
+
|
| 187 |
+
Ronald M Errico. What is an adjoint model? Bulletin of the American Meteorological Society, 78 (11):2577–2592, 1997.
|
| 188 |
+
|
| 189 |
+
Richard Gordon, Robert Bender, and Gabor T Herman. Algebraic reconstruction techniques (art) for three-dimensional electron microscopy and x-ray photography. Journal of theoretical Biology, 29(3):471–481, 1970.
|
| 190 |
+
|
| 191 |
+
Andreas Griewank and Andrea Walther. Evaluating derivatives: principles and techniques of algorithmic differentiation, volume 105. Siam, 2008.
|
| 192 |
+
|
| 193 |
+
Laurent Hascoet and Valérie Pascual. The Tapenade automatic differentiation tool: Principles, model, and specification. 39(3):20:1–20:43, 2013.
|
| 194 |
+
|
| 195 |
+
Yuanming Hu, Yu Fang, Ziheng Ge, Ziyin Qu, Yixin Zhu, Andre Pradhana, and Chenfanfu Jiang. A moving least squares material point method with displacement discontinuity and two-way rigid body coupling. 37(4):150, 2018.
|
| 196 |
+
|
| 197 |
+
Yuanming Hu, Tzu-Mao Li, Luke Anderson, Jonathan Ragan-Kelley, and Frédo Durand. Taichi: A language for high-performance computation on spatially sparse data structures. In SIGGRAPH Asia 2019 Technical Papers, pp. 201. ACM, 2019a.
|
| 198 |
+
|
| 199 |
+
Yuanming Hu, Jiancheng Liu, Andrew Spielberg, Joshua B Tenenbaum, William T Freeman, Jiajun Wu, Daniela Rus, and Wojciech Matusik. Chainqueen: A real-time differentiable physical simulator for soft robotics. Proceedings of IEEE International Conference on Robotics and Automation (ICRA), 2019b.
|
| 200 |
+
|
| 201 |
+
Mike Innes, Alan Edelman, Keno Fischer, Chris Rackauckus, Elliot Saba, Viral B Shah, and Will Tebbutt. Zygote: A differentiable programming system to bridge machine learning and scientific computing. arXiv preprint arXiv:1907.07587, 2019.
|
| 202 |
+
|
| 203 |
+
Wenzel Jakob. Enoki: structured vectorization and differentiation on modern processor architectures, 2019. https://github.com/mitsuba-renderer/enoki.
|
| 204 |
+
|
| 205 |
+
Chenfanfu Jiang. The material point method for the physics-based simulation of solids and fluids. University of California, Los Angeles, 2015.
|
| 206 |
+
|
| 207 |
+
Ralf Karrenberg and Sebastian Hack. Whole-function vectorization. In Code Generation and Optimization, pp. 141–150, 2011.
|
| 208 |
+
|
| 209 |
+
Hiroharu Kato, Yoshitaka Ushiku, and Tatsuya Harada. Neural 3d mesh renderer. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3907–3916, 2018.
|
| 210 |
+
|
| 211 |
+
Stig Larsson and Vidar Thomée. Partial differential equations with numerical methods, volume 45. Springer Science & Business Media, 2008.
|
| 212 |
+
|
| 213 |
+
Tzu-Mao Li, Miika Aittala, Frédo Durand, and Jaakko Lehtinen. Differentiable monte carlo ray tracing through edge sampling. In SIGGRAPH Asia 2018 Technical Papers, pp. 222. ACM, 2018a.
|
| 214 |
+
|
| 215 |
+
Tzu-Mao Li, Michaël Gharbi, Andrew Adams, Frédo Durand, and Jonathan Ragan-Kelley. Differentiable programming for image processing and deep learning in Halide. ACM Transactions on Graphics (TOG), 37(4):139, 2018b.
|
| 216 |
+
|
| 217 |
+
Junbang Liang, Ming C Lin, and Vladlen Koltun. Differentiable cloth simulation for inverse problems. Advances in Neural Information Processing Systems, 2019.
|
| 218 |
+
|
| 219 |
+
Matthew M Loper and Michael J Black. Opendr: An approximate differentiable renderer. In European Conference on Computer Vision, pp. 154–169. Springer, 2014.
|
| 220 |
+
|
| 221 |
+
Dougal Maclaurin, David Duvenaud, and Ryan P Adams. Autograd: Effortless gradients in numpy. In ICML 2015 AutoML Workshop, volume 238, 2015.
|
| 222 |
+
|
| 223 |
+
Aleka McAdams, Andrew Selle, Rasmus Tamstorf, Joseph Teran, and Eftychios Sifakis. Computing the singular value decomposition of 3x3 matrices with minimal branching and elementary floating point operations. Technical report, University of Wisconsin-Madison Department of Computer Sciences, 2011.
|
| 224 |
+
|
| 225 |
+
Damian Mrowca, Chengxu Zhuang, Elias Wang, Nick Haber, Li Fei-Fei, Joshua B Tenenbaum, and Daniel LK Yamins. Flexible neural representation for physics prediction. 1806.08047, 2018.
|
| 226 |
+
|
| 227 |
+
Merlin Nimier-David, Delio Vicini, Tizian Zeltner, and Wenzel Jakob. Mitsuba 2: A retargetable forward and inverse renderer. Transactions on Graphics (Proceedings of SIGGRAPH Asia), 38 (6), November 2019. doi: 10.1145/3355089.3356498.
|
| 228 |
+
|
| 229 |
+
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.
|
| 230 |
+
|
| 231 |
+
Barak A. Pearlmutter and Jeffrey Mark Siskind. Reverse-mode AD in a functional framework: Lambda the ultimate backpropagator. ACM Transactions on Programming Languages and Systems, 30(2):7:1–7:36, 2008.
|
| 232 |
+
|
| 233 |
+
Matt Pharr and William R Mark. ispc: A spmd compiler for high-performance cpu programming. In Innovative Parallel Computing, pp. 1–13, 2012.
|
| 234 |
+
|
| 235 |
+
Jovan Popovic, Steven M Seitz, Michael Erdmann, Zoran Popovi ´ c, and Andrew Witkin. Interactive ´ manipulation of rigid body simulations. In Proceedings of the 27th annual conference on Computer graphics and interactive techniques, pp. 209–217. ACM Press/Addison-Wesley Publishing Co., 2000.
|
| 236 |
+
|
| 237 |
+
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. SIGPLAN Not., 48(6):519–530, jun 2013.
|
| 238 |
+
|
| 239 |
+
Stéphane Redon, Abderrahmane Kheddar, and Sabine Coquillart. Fast continuous collision detection between rigid bodies. In Computer graphics forum, volume 21, pp. 279–287. Wiley Online Library, 2002.
|
| 240 |
+
|
| 241 |
+
Connor Schenck and Dieter Fox. Spnets: Differentiable fluid dynamics for deep neural networks. arXiv preprint arXiv:1806.06094, 2018.
|
| 242 |
+
|
| 243 |
+
Jos Stam. Stable fluids. In Siggraph, volume 99, pp. 121–128, 1999.
|
| 244 |
+
|
| 245 |
+
Andre Pradhana Tampubolon, Theodore Gast, Gergely Klár, Chuyuan Fu, Joseph Teran, Chenfanfu Jiang, and Ken Museth. Multi-species simulation of porous sand and water mixtures. ACM Transactions on Graphics (TOG), 36(4):105, 2017.
|
| 246 |
+
|
| 247 |
+
Jean Utke, Uwe Naumann, Mike Fagan, Nathan Tallent, Michelle Strout, Patrick Heimbach, Chris Hill, and Carl Wunsch. Openad/f: A modular open-source tool for automatic differentiation of fortran codes. 34(4):18, 2008.
|
| 248 |
+
|
| 249 |
+
Jui-Hsien Wang, Ante Qu, Timothy R Langlois, and Doug L James. Toward wave-based sound synthesis for computer animation. ACM Trans. Graph., 37(4):109–1, 2018.
|
| 250 |
+
|
| 251 |
+
Richard Wei, Marc Rasi Dan Zheng, and Bart Chrzaszcz. Differentiable programming mega-proposal. https://github.com/apple/swift/blob/master/docs/ DifferentiableProgramming.md, 2019. Accessed: 2019-09-25.
|
| 252 |
+
|
| 253 |
+
R. E. Wengert. A simple automatic derivative evaluation program. Communications of the ACM, 7 (8):463–464, aug 1964.
|
| 254 |
+
|
| 255 |
+
# A COMPARISON WITH EXISTING SYSTEMS
|
| 256 |
+
|
| 257 |
+
Workload differences between deep learning and differentiable physical simulation Existing differentiable programming tools for deep learning are typically centered around large data blobs. For example, in AlexNet, the second convolution layer has size $2 7 \times 2 7 \times 1 2 8 \times 1 2 8$ . These tools usually provide users with both low-level operations such as tensor add and mul, and high-level operations such as convolution. The bottleneck of typical deep-learning-based computer vision tasks are convolutions, so the provided high-level operations, with very high arithmetic intensity2, can fully exploit hardware capability. However, the provided operations are “atoms” of these differentiable programming tools, and cannot be further customized. Users often have to use low-level operations to compose their desired high-level operations. This introduces a lot of temporary buffers, and potentially excessive GPU kernel launches. As shown in Hu et al. (2019b), a pure TensorFlow implementation of a complex physical simulator is $1 3 2 \times$ slower than a CUDA implementation, due to excessive GPU kernel launches and the lack of producer-consumer locality3.
|
| 258 |
+
|
| 259 |
+
The table below compares DiffTaichi with existing tools for build differentiable physical simulators.
|
| 260 |
+
|
| 261 |
+
Table 3: Comparisons between DiffTaichi and other differentiable programming tools. Note that this table only discusses features related to differentiable physical simulation, and the other tools may not have been designed for this purpose. For example, PyTorch and TensorFlow are designed for classical deep learning tasks and have proven successful in their target domains. Also note that the XLA backend of TensorFlow and JIT feature of PyTorch allow them to fuse operators to some extent, but for simulation we want complete operator fusion within megakernels. “Swift” AD (Wei et al., 2019) is partially implemented as of November 2019. “Julia” refers to Innes et al. (2019).
|
| 262 |
+
|
| 263 |
+
<table><tr><td>Feature</td><td>DiffTaichi</td><td>PyTorch</td><td>TensorFlow</td><td>Enoki</td><td>JAX</td><td>Halide</td><td>Julia</td><td>Swift</td></tr><tr><td>GPUMegakernels</td><td><</td><td>A</td><td>△</td><td><</td><td></td><td></td><td></td><td></td></tr><tr><td>Imperative Scheme</td><td></td><td></td><td></td><td>【</td><td></td><td></td><td></td><td>【</td></tr><tr><td>Parallelism</td><td></td><td></td><td></td><td></td><td>?</td><td></td><td></td><td></td></tr><tr><td>Flexible Indexing</td><td></td><td></td><td></td><td></td><td></td><td>【</td><td>【</td><td></td></tr></table>
|
| 264 |
+
|
| 265 |
+
# B DIFFERENTATING STRAIGHT-LINE TAICHI KERNELS USING SOURCE CODE TRANSFORM
|
| 266 |
+
|
| 267 |
+
Primal and adjoint kernels Recall that in DiffTaichi, (primal) kernels are operators that take as input multiple tensors (e.g., $X , Y )$ and output another set of tensors. Mathematically, kernel $f$ has the form
|
| 268 |
+
|
| 269 |
+
$$
|
| 270 |
+
f ( X _ { 0 } , X _ { 1 } , . . , X _ { n } ) = Y _ { 0 } , Y _ { 1 } , . . . , Y _ { m } .
|
| 271 |
+
$$
|
| 272 |
+
|
| 273 |
+
Kernels usually execute uniform operations on these tensors. When it comes to differentiable programming, a loss function is defined on the final output tensors. The gradients of the loss function “ $L ^ { \prime \prime }$ with respect to each tensor are stored in adjoint tensors and computed via adjoint kernels.
|
| 274 |
+
|
| 275 |
+
The adjoint tensor of (primal) tensor $X _ { i j k }$ is denoted as $X _ { i j k } ^ { * }$ . Its entries are defined by $X _ { i j k } ^ { * } =$ $\partial L / \partial X _ { i j k }$ . At a high level, our automatic differentiation (AD) system transforms a primal kernel into its adjoint form. Mathematically,
|
| 276 |
+
|
| 277 |
+
Reverse-Mode Automatic Differentiation
|
| 278 |
+
|
| 279 |
+
$$
|
| 280 |
+
( \mathbf { a d j o i n t } ) f ^ { * } ( X _ { 0 } , X _ { 1 } , . . , X _ { n } , Y _ { 0 } ^ { * } , Y _ { 1 } ^ { * } , . . . , Y _ { m } ^ { * } ) = X _ { 0 } ^ { * } , X _ { 1 } ^ { * } , . . , X _ { n } ^ { * } .
|
| 281 |
+
$$
|
| 282 |
+
|
| 283 |
+
Differentiating within kernels: The “make_adjoint” pass (reverse-mode AD) After the preprocessing passes, which flatten branching and eliminate mutable local variables, the “make_adjoint” pass transforms a forward evaluation (primal) kernel into its gradient accumulation (“adjoint”) kernel. It takes straight-line code directly and operates on the hierarchical intermediate representation (IR) of Taichi4 . Multiple outer for loops are allowed for the primal kernel. The Taichi compiler will distribute these parallel iterations onto CPU/GPU threads.
|
| 284 |
+
|
| 285 |
+
During the “make_adjoint” pass, for each SSA instruction, a local adjoint variable will be allocated for gradient contribution accumulation. The compiler will traverse the statements in reverse order, and accumulate the gradients to the corresponding adjoint local variable.
|
| 286 |
+
|
| 287 |
+
For example, a 1D array operation $y _ { i } = \sin x _ { i } ^ { 2 }$ has its IR representation as follows:
|
| 288 |
+
|
| 289 |
+
<table><tr><td>for i ∈ range(0, 16, step 1) do</td></tr><tr><td>%1=load x[i]</td></tr><tr><td>%2 = mul %1, %1</td></tr><tr><td>%3= sin(%2)</td></tr><tr><td>store y[i] = %3</td></tr><tr><td>end for</td></tr></table>
|
| 290 |
+
|
| 291 |
+
The above primal kernel will be transformed into the following adjoint kernel:
|
| 292 |
+
|
| 293 |
+
<table><tr><td>for i in range(0,16, step 1) do</td></tr><tr><td>/ adjoint variables</td></tr><tr><td>%1adj = alloca 0.0</td></tr><tr><td>%2adj = alloca 0.0</td></tr><tr><td>%3adj = alloca 0.0</td></tr><tr><td>// original forward computation</td></tr><tr><td>%1=load x[] %2 = mul %1, %1</td></tr><tr><td>%3= sin(%2)</td></tr><tr><td>/ reverse accumulation</td></tr><tr><td>%4 = load y_adj[i]</td></tr><tr><td>%3adj += %4</td></tr><tr><td>%5 = cos(%2)</td></tr><tr><td>%2adj += %3adj * %5</td></tr><tr><td>%1adj += 2 * %1 * %2adj</td></tr><tr><td>atomic add x_adj[i],%1adj end for</td></tr></table>
|
| 294 |
+
|
| 295 |
+
Note that for clarity the transformed code is not strictly SSA here. The actual IR has more instructions. A following simplification pass will simplify redundant instructions generated by the AD pass.
|
| 296 |
+
|
| 297 |
+
# C COMPLEX KERNELS
|
| 298 |
+
|
| 299 |
+
Here we demonstrated how to use complex kernels to override the automatic differentiation system. We use singular value decomposition (SVD) of $3 \times 3$ matrices $\mathbf { M } = \mathbf { U } \pmb { \Sigma } \mathbf { V } ^ { * }$ ) as an example. Fast SVD solvers used in physical simulation are often iterative, yet directly evaluate the gradient of this iterative process is likely numerically unstable. Suppose we use McAdams et al. (2011) as the forward SVD solver, and use the method in Jiang (2015) (Section 2.1.1.2) to evalute the gradients, the complex kernels are used as follows:
|
| 300 |
+
|
| 301 |
+
# Do Singular Value Decomposition (SVD) on n matrices
|
| 302 |
+
@ti.kernel
|
| 303 |
+
def iterative_svd(num_iterations: ti.f32): for i in range(n): input $=$ matrix_M[i] for iter in range(num_iterations): ... iteratively solve SVD using McAdams et al. 2011 matrix_U[i] $=$ ... matrix_Sigma[i] $=$ matrix_V[i] $=$ ...
|
| 304 |
+
@ti.kernel
|
| 305 |
+
def svd_gradient(): for i in range(n): ... Implement, for example, section 2.1.1.2 of Jiang (2015) .
|
| 306 |
+
# A complex kernel that is registered as the svd_forward complex kernel
|
| 307 |
+
@ti.complex_kernel_grad(svd_forward)
|
| 308 |
+
def svd_backward(num_iterations): # differentiave SVD svd_gradient()
|
| 309 |
+
|
| 310 |
+
# D CHECKPOINTING
|
| 311 |
+
|
| 312 |
+
In this section we demonstrate how to use checkpointing via complex kernels. The goal of checkpointing is to use recomputation to save memory space. We demonstrate this using the diffmpm example, whose simulation cycle consists of particle to grid transform (p2g), grid boundary conditions (grid_op), and grid to particle transform $( \mathtt { g } 2 \mathsf { p } )$ . We assume the simulation has $O ( n )$ time steps.
|
| 313 |
+
|
| 314 |
+
# D.1 RECOMPUTATION WITHIN TIME STEPS
|
| 315 |
+
|
| 316 |
+
A naive implementation without checkpointing allocates $O ( n )$ copied of the simulation grid, which can cost a lot of memory space. Actually, if we recompute the grid states during the backward simulation time step by redoing ${ \mathsf { p } } 2 { \mathsf { g } }$ and grid_op, we can reused the grid states and allocate only one copy. This checkpointing optimization is demonstrated in the code below:
|
| 317 |
+
|
| 318 |
+
<table><tr><td>@ti.complex_kernel</td></tr><tr><td>def advance(s):</td></tr><tr><td>clear_grid()</td></tr><tr><td>compute_actuation(s)</td></tr><tr><td>p2g(s)</td></tr><tr><td>grid_op()</td></tr><tr><td>g2p(s)</td></tr><tr><td>@ti.complex_kernel_grad(advance)</td></tr><tr><td>def advance_grad(s):</td></tr><tr><td>clear_grid() p2g(s)</td></tr><tr><td>grid_op() # recompute the grid</td></tr><tr><td></td></tr><tr><td>g2p.grad(s)</td></tr><tr><td>grid_op.grad()</td></tr><tr><td>p2g.grad(s) compute_actuation.grad(s)</td></tr></table>
|
| 319 |
+
|
| 320 |
+
# D.2 SEGMENT-WISE RECOMPUTATION
|
| 321 |
+
|
| 322 |
+
Given a simulation with $O ( n )$ time steps, if all simulation steps are recorded, the space consumption is $O ( n )$ . This linear space consumption is sometimes too large for high-resolution simulations with long time horizon. Fortunately, we can reduce the space consumption using a segment-wise checkpointing trick: We split the simulation into segments of $S$ steps, and in forward simulation store only the first simulation state in each segment. During backpropagation when we need the remaining simulation states in a segment, we recompute them based on the first state in that segment.
|
| 323 |
+
|
| 324 |
+
Note that if the segment size is $O ( S )$ , then we only need to store $O ( n / S )$ simulation steps for checkpoints and $\bar { O ( S ) }$ reusable simulation steps for backpropagation within segments. The total√ space consumption is √ $O ( S + n / S )$ . Setting ${ \cal S } \doteq { \cal O } ( \sqrt { n } )$ reduces memory consumption from $O ( n )$ to $O ( { \sqrt { n } } )$ . The time complexity remains $O ( n )$ .
|
| 325 |
+
|
| 326 |
+
# E DETAILS ON 10 DIFFERENTIABLE SIMULATORS
|
| 327 |
+
|
| 328 |
+
E.1 DIFFERENTIABLE CONTINUUM MECHANICS FOR ELASTIC OBJECTS [diffmpm]
|
| 329 |
+
|
| 330 |
+

|
| 331 |
+
Figure 6: Controller optimization with our differentiable continuum simulators. Left: the 2D robot with four muscles. Middle: A 3D robot with 16 muscles and 30K particles crawling on the ground. [Reproduce: python3 [diffmpm/diffmpm3d].py] Right: We couple the robot (30K particles) and the liquid simulator (13K particles), and optimize its open-loop controller in this difficult situation.[Reproduce: python3 liquid.py]
|
| 332 |
+
|
| 333 |
+
# E.2 DIFFERENTIABLE LIQUID SIMULATOR [liquid]
|
| 334 |
+
|
| 335 |
+
We follow the weakly compressible fluid model in Tampubolon et al. (2017) and implemented a 3D differentiable liquid simulator within the [diffmpm3d] framework. Our liquid simulation can be two-way coupled with elastic object simulation (Figure 6, right).
|
| 336 |
+
|
| 337 |
+
# E.3 DIFFERENTIABLE INCOMPRESSIBLE FLUID SIMULATOR [smoke]
|
| 338 |
+
|
| 339 |
+

|
| 340 |
+
Figure 7: (a): (Left to right) with an optimized initial smoke velocity field, the fluid changes its pattern to a “Taichi" symbol. [Reproduce: python3 smoke_taichi.py] (b): Unoptimized (top three) and optimized (bottom three) waves at time step 3, 189, and 255. [Reproduce: python3 wave.py]
|
| 341 |
+
|
| 342 |
+
Backpropagating Through Pressure Projection We followed the baseline implementation in Autograd, and used 10 Jacobi iterations for pressure projection. Technically, 10 Jacobi iterations are not sufficient to make the velocity field fully divergence-free. However, in this example, it does a decent job, and we are able to successfully backpropagate through the unrolled 10 Jacobi iterations.
|
| 343 |
+
|
| 344 |
+
In larger-scale simulations, 10 Jacobi iterations are likely not sufficient. Assuming the Poisson solve is done by an iterative solver (e.g. multigrid preconditioned conjugate gradients, MGPCG) with 5 multigrid levels and 50 conjugate gradient iterations, then automatic differentiation will likely not be able to provide gradients with sufficient numerical accuracy across this long iterative process. The accuracy is likely worse when conjugate gradients present, as they are known to numerically drift as the number of iterations increases. In this case, the user can still use DiffTaichi to implement the forward MGPCG solver, while implementing the backward part of the Poisson solve manually, likely using adjoint methods (Errico, 1997). DiffTaichi provides “complex kernels” to override the built-in AD system, as shown in Appendix C.
|
| 345 |
+
|
| 346 |
+
E.4 DIFFERENTIABLE HEIGHT FIELD SHALLOW WATER SIMULATOR [wave]
|
| 347 |
+
|
| 348 |
+
We adopt the wave equation in Wang et al. (2018) to model shallow water height field evolution:
|
| 349 |
+
|
| 350 |
+
$$
|
| 351 |
+
\ddot { u } = c ^ { 2 } \nabla ^ { 2 } u + c \alpha \nabla ^ { 2 } \dot { u } ,
|
| 352 |
+
$$
|
| 353 |
+
|
| 354 |
+
where $u$ is the height of shallow water, $c$ is the “speed of sound” and $\alpha$ is a damping coefficient. We use the $\dot { u }$ and $\ddot { u }$ notations for the first and second order partial derivatives of $u$ w.r.t time $t$ respectively.
|
| 355 |
+
|
| 356 |
+
Wang et al. (2018) used the finite different time-domain (FDTD) method (Larsson & Thomée, 2008) to discretize Eqn. 1, yielding an update scheme:
|
| 357 |
+
|
| 358 |
+
where
|
| 359 |
+
|
| 360 |
+
$$
|
| 361 |
+
\begin{array} { r l } & { \mathrm { \quad } _ { t , i , j } = 2 u _ { t - 1 , i , j } + ( c ^ { 2 } \dot { \Delta t ^ { 2 } } + c \alpha \Delta t ) ( \nabla ^ { 2 } u ) _ { t - 1 , i , j } - p _ { t - 2 , i , j } - c \alpha \Delta t ( \nabla ^ { 2 } u ) _ { t - 2 , i , j } , } \\ & { \mathrm { \quad } ( \nabla ^ { 2 } u ) _ { t , i , j } = \frac { - 4 u _ { t , i , j } + u _ { t , i , j + 1 } + u _ { t , i , j - 1 } + u _ { t , i + 1 , j } + u _ { t , i - 1 , j } } { { \Delta x ^ { 2 } } } . } \end{array}
|
| 362 |
+
$$
|
| 363 |
+
|
| 364 |
+
We implemented this wave simulator in DiffTaichi to simulate shallow water. We used a grid of resolution $1 2 8 \times 1 2 8$ and 256 time steps. The loss function is defined as
|
| 365 |
+
|
| 366 |
+
$$
|
| 367 |
+
L = \sum _ { i , j } \Delta x ^ { 2 } ( u _ { T , i , j } - \hat { u } _ { i , j } ) ^ { 2 }
|
| 368 |
+
$$
|
| 369 |
+
|
| 370 |
+
where $T$ is the final time step, and $\hat { u }$ is the target height field. 200 gradient descent iterations are then used to optimize the initial height field. We set $\hat { u }$ to be the pattern “Taichi", and Fig. 7b shows the unoptimized and optimized wave evolution.
|
| 371 |
+
|
| 372 |
+
We set the “Taichi" symbol as the target pattern. Fig. 7b shows the unoptimized and optimized final wave patterns. More details on discretization is in Appendix E.
|
| 373 |
+
|
| 374 |
+
# E.5 DIFFERENTIABLE MASS-SPRING SYSTEM [mass_spring]
|
| 375 |
+
|
| 376 |
+
We extend the mass-spring system in the main text with ground collision and a NN controller. The time-of-impact fix is implemented for improved gradients. The optimization goal is to maximize the distance moved forward with 2048 time steps. We designed three mass-spring robots as shown in Fig. 8 (left).
|
| 377 |
+
|
| 378 |
+
# E.6 DIFFERENTIABLE BILLIARD SIMULATOR [billiards]
|
| 379 |
+
|
| 380 |
+
A differentiable rigid body simulator is built for optimizing a billiards strategy (Fig. 8, middle). We used forward Euler for the billiard ball motion and conservation of momentum and kinetic energy for collision resolution.
|
| 381 |
+
|
| 382 |
+

|
| 383 |
+
Figure 8: Left: Three mass-spring robots. The red and blue springs are actuated. A two layer NN is used as controller. [Reproduce: python3 mass_spring.py [1/2/3] train]. Middle: Optimizing billiards. The optimizer adjusts the initial position and velocity of the white ball, so that the blue ball will reach the target destination (black dot). [Reproduce: python3 billiards.py] Right: Optimizing a robot walking. The rigid robot is controlled with a NN controller and learned to walk in 20 gradient descent iterations. [Reproduce: python3 rigid_body.py]
|
| 384 |
+
|
| 385 |
+
E.7 DIFFERENTIABLE RIGID BODY SIMULATOR [rigid_body]
|
| 386 |
+
|
| 387 |
+
Are rigid body collisions differentiable? It is worth noting that discontinuities can happen in rigid body collisions, and at a countable number of discontinuities the objective function is nondifferentiable. However, apart from these discontinuities, the process is still differentiable almost everywhere. The situation of rigid body collision is somewhat similar to the “ReLU” activation function in neural networks: at point $x = 0$ , ReLU is not differentiable (although continuous), yet it is still widely adopted. The rigid body simulation cases are more complex than ReLU, as we have not only non-differentiable points, but also discontinuous points. Based on our experiments, in these impulse-based rigid body simulators, we still find the gradients useful for optimization despite the discontinuities, especially with our time-of-impact fix.
|
| 388 |
+
|
| 389 |
+
# E.8 DIFFERENTIABLE WATER RENDERER [water_renderer]
|
| 390 |
+
|
| 391 |
+
We implemented differentiable renderers to visualize the refracting water surfaces from wave. We use finite differences to reconstruct the water surface models based on the input height field and refract camera rays to sample the images, using bilinear interpolation for meaningful gradients. To show our system works well with other differentiable programming systems, we use an adversarial optimization goal: fool VGG-16 into thinking that the refracted squirrel image is a goldfish (Fig. 9).
|
| 392 |
+
|
| 393 |
+

|
| 394 |
+
Figure 9: This three-stage program (simulation, rendering, recognition) is end-to-end differentiable. Our optimized initial water height field evolves to form a refraction pattern that perturbs the image into one that fools VGG16 $( 9 9 . 9 1 \%$ goldfish). [Reproduce: python3 water_renderer.py]
|
| 395 |
+
|
| 396 |
+
E.9 DIFFERENTIABLE VOLUME RENDERER [volume_renderer]
|
| 397 |
+
|
| 398 |
+
We implemented a basic volume renderer that simply uses ray marching (we ignore light, scattering, etc.) to integrate a density field over each camera ray. In this task, we render a number of target images from different viewpoints, with the camera rotated around the given volume. The goal is then to optimize for the density field of the volume that would produce these target images: we render candidate images from the same viewpoints and compute an L2 loss between them and the target images, before performing gradient descent on the density field (Fig. 10). Essentially, this demonstrates how to use gradients to reconstruct 3D objects out of $\mathrm { X }$ -ray photos in a brute-force manner. Other approaches to this task include algebraic reconstruction techniques (ART) (Gordon et al., 1970).
|
| 399 |
+
|
| 400 |
+

|
| 401 |
+
Figure 10: Volume rendering of bunny shaped density field. Left: 3 (of the 7) target images. Right: optimized images of the middle bunny after iteration 2, 50, 100. [Reproduce: python3 volume_renderer.py]
|
| 402 |
+
|
| 403 |
+
E.10 DIFFERENTIABLE ELECTRIC FIELD SIMULATOR [electric]
|
| 404 |
+
|
| 405 |
+
Recall Coulomb’s law: $\mathbf { F } = k { \frac { q _ { 1 } q _ { 2 } } { r ^ { 2 } } } { \hat { \mathbf { r } } }$ . In the right figure, there are eight electrodes carrying static charge. The red ball also carries static charge. The controller, which is a two-layer neural network, tries to manipulate the electrodes so that the red ball follows the path of the blue ball. The bigger the electrode, the more positive charge it carries.
|
| 406 |
+
|
| 407 |
+
# F FIXING GRADIENTS WITH TIME OF IMPACT AND CONTINUOUS COLLISION DETECTION
|
| 408 |
+
|
| 409 |
+
Here is a naive time integrator in the mass-spring system example:
|
| 410 |
+
|
| 411 |
+
@ti.kernel
|
| 412 |
+
def advance(t: ti.i32): for $\dot { 7 }$ in range(n_objects): s $=$ math.exp(-dt $\star$ damping) new $\underline { { \boldsymbol { \mathsf { U } } } } \mathrm { ~ \boldsymbol { \mathsf { U } } ~ } = \mathrm { ~ \boldsymbol { \mathsf { S } } ~ } \star$ v[t - 1, i] $^ +$ dt $\star$ gravity $\star$ ti.Vector([0.0, 1.0]) ol $\mathsf { I } \_ { \mathsf { X } } \ = \ \mathsf { x } [ \mathsf { t } \ \textrm { - } \ \mathsf { 1 }$ , i] depth $=$ old_x[1] - ground_height if depth $< ~ \Theta$ and new_ $\iota [ 1 ] ~ < ~ \mathfrak { O }$ : # assuming a sticky ground (infinite coefficient of friction) new_v[0] $= \cdot$ 0 new_v[1] $=$ 0 # Without considering time of impact, we assume the whole dt uses new_v new_x $=$ old_x + dt \* new_v v[t, i] $=$ new_v x[t, i] $=$ new_x
|
| 413 |
+
|
| 414 |
+
Implementing TOI in this system is relative straightforward:
|
| 415 |
+
|
| 416 |
+
@ti.kernel
|
| 417 |
+
def advance_toi(t: ti.i32): for i in range(n_objects): $\qquad \mathsf { s } \quad \mathsf { = }$ math.exp(-dt $\star$ damping) old_v = s \* v[t - 1, i] $^ +$ dt $\star$ gravity $\star$ ti.Vector([0.0, 1.0]) old_x $=$ x[t - 1, i] new_x $=$ old_x $^ +$ dt $\star$ old_v toi $\mathbf { \xi } = \mathbf { \xi } \odot . \Theta$ new_v $=$ old_v if new $\_ x [ 1 ] \ <$ ground_height and old_v[1] < -1e-4: # The 1e-4 safe guard is important for numerical stability toi $=$ -(old_x[1] - ground_height) / old_v[1] # Compute the time of impact new_ $. { } v = { }$ ti.Vector([0.0, 0.0]) # Note that with time of impact, dt is divided into two parts, # the first part using old_v, and second part using new_v new $\underline { { \boldsymbol { \mathsf { X } } } } \ = \ \mathsf { o l d } _ { - } \mathsf { { X } } \ +$ toi $\star$ old_v $^ +$ (dt - toi) $\star$ new_v v[t, i] $=$ new_v x[t, i] $=$ new_x In rigid body simulation, the implementation follows the same idea yet is slightly more complex.
|
| 418 |
+
Please refer to rigid_body.py for more details.
|
| 419 |
+
|
| 420 |
+
# G ADDITIONAL TIPS ON GRADIENT BEHAVIORS
|
| 421 |
+
|
| 422 |
+
Initialization matters: flat lands and local minima in physical processes A trivial example of objective flat land is in billiards. Without proper initialization, gradient descent will make no progress since gradients are zero (Fig. 11). Also note the local minimum near $\left( - 5 , 0 . 0 3 \right)$ .
|
| 423 |
+
|
| 424 |
+

|
| 425 |
+
Figure 11: Left: Scanning initial velocity in the billiard example. Middle: Most initial angles yield a flat objective (final distance between the blue ball and black destination) of 0.065, since the white ball does not collide with any other balls and imposes no effect on the pink ball via the chain reaction. Right: A zoomed-in view of the middle figure. The complex collisions lead to a lot of local minimums. [Reproduce: python3 billiards.py 1.0/0.23]
|
| 426 |
+
|
| 427 |
+
In mass_spring and rigid_body, once the robot falls down, gradient descent will quickly become trapped. A robot on the ground will make no further progress, no matter how it changes its controller. This leads to a more non-trivial local minimum and zero gradient case.
|
| 428 |
+
|
| 429 |
+
Ideal physical models are only “ideal”: discontinuities and singularities Real-world macroscopic physical processes are usually continuous. However, building upon ideal physical models, even in the forward physical simulation results can contain discontinuities. For example, in a rigid body model with friction, changing the initial rotation of the box can lead to different corners hitting the ground first, and result in a discontinuity (Fig. 12). In electric and mass_spring, due to the $\textstyle { \frac { 1 ^ { - } } { r ^ { 2 } } }$ and $\textstyle { \frac { 1 } { r } }$ terms, when $r 0$ , gradients can be very inaccurate due to numerical precision issues. Note that $\dot { d } ( 1 / r ) / d r = - 1 / r ^ { 2 }$ , and the gradient is more numerically problematic than the primal for a small $r$ . Safeguarding $r$ is critically important for gradient stability.
|
| 430 |
+
|
| 431 |
+

|
| 432 |
+
Figure 12: Friction in rigid body with collision is a common source of discontinuity. In this scene a rigid body hits the ground. Slightly rotating the rigid body changes which corner (A/B) hits the ground first, and different normal/friction impulses will be applied to the rigid body. This leads to a discontinuity in its final position $\mathrm { l o s s } \mathrm { = }$ final y coordinate). [Reproduce: python3 rigid_body_discontinuity.py] Please see our supplemental video for more details.
|
md/train/B1gJ1L2aW/B1gJ1L2aW.md
ADDED
|
@@ -0,0 +1,289 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CHARACTERIZING ADVERSARIAL SUBSPACES USING LOCAL INTRINSIC DIMENSIONALITY
|
| 2 |
+
|
| 3 |
+
Xingjun $\mathbf { M } \mathbf { a } ^ { 1 }$ , $\mathbf { B o L i } ^ { 2 }$ , Yisen Wang3, Sarah M. Erfani1, Sudanthi Wijewickrema1
|
| 4 |
+
Grant Schoenebeck4, Dawn $\mathbf { S o n g ^ { \bar { 2 } } }$ , Michael E. Houle5, James Bailey1
|
| 5 |
+
1The University of Melbourne, Parkville, Australia
|
| 6 |
+
2University of California, Berkeley, USA
|
| 7 |
+
3Tsinghua University, Beijing, China
|
| 8 |
+
4University of Michigan, Ann Arbor, USA
|
| 9 |
+
5National Institute of Informatics, Tokyo, Japan
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
Deep Neural Networks (DNNs) have recently been shown to be vulnerable against adversarial examples, which are carefully crafted instances that can mislead DNNs to make errors during prediction. To better understand such attacks, a characterization is needed of the properties of regions (the so-called ‘adversarial subspaces’) in which adversarial examples lie. We tackle this challenge by characterizing the dimensional properties of adversarial regions, via the use of Local Intrinsic Dimensionality (LID). LID assesses the space-filling capability of the region surrounding a reference example, based on the distance distribution of the example to its neighbors. We first provide explanations about how adversarial perturbation can affect the LID characteristic of adversarial regions, and then show empirically that LID characteristics can facilitate the distinction of adversarial examples generated using state-of-the-art attacks. As a proof-of-concept, we show that a potential application of LID is to distinguish adversarial examples, and the preliminary results show that it can outperform several state-of-the-art detection measures by large margins for five attack strategies considered in this paper across three benchmark datasets . Our analysis of the LID characteristic for adversarial regions not only motivates new directions of effective adversarial defense, but also opens up more challenges for developing new attacks to better understand the vulnerabilities of DNNs.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Deep Neural Networks (DNNs) are highly expressive models that have achieved state-of-the-art performance on a wide range of complex problems, such as speech recognition (Hinton et al., 2012) and image classification (Krizhevsky et al., 2012). However, recent studies have found that DNNs can be compromised by adversarial examples (Szegedy et al., 2013; Goodfellow et al., 2014; Nguyen et al., 2015). These intentionally-perturbed inputs can induce the network to make incorrect predictions at test time with high confidence, even when the examples are generated using different networks (Liu et al., 2016; Carlini & Wagner, 2017b; Papernot et al., 2016b). The amount of perturbation required is often small, and (in the case of images) imperceptible to human observers. This undesirable property of deep networks has become a major security concern in real-world applications of DNNs, such as self-driving cars and identity recognition (Evtimov et al., 2017; Sharif et al., 2016). In this paper, we aim to further understand adversarial attacks by characterizing the regions within which adversarial examples reside.
|
| 18 |
+
|
| 19 |
+
Each adversarial example can be regarded as being surrounded by a connected region of the domain (the ‘adversarial region’ or ‘adversarial subspace’) within which all points subvert the classifier in a similar way. Adversarial regions can be defined not only in the input space, but also with respect to the activation space of different DNN layers (Szegedy et al., 2013). Developing an understanding of the properties of adversarial regions is a key requirement for adversarial defense. Under the assumption that data can be modeled in terms of collections of manifolds, several works have attempted to characterize the properties of adversarial subspaces, but no definitive method yet exists which can reliably discriminate adversarial regions from those in which normal data can be found. Szegedy et al. (2013) argued that adversarial subspaces are low probability regions (not naturally occurring) that are densely scattered in the high dimensional representation space of DNNs. However, a linear formulation argues that adversarial subspaces span a contiguous multidimensional space, rather than being scattered randomly in small pockets (Goodfellow et al., 2014; Warde-Farley et al., 2016). Tanay & Griffin (2016) further emphasize that adversarial subspaces lie close to (but not on) the data submanifold. Similarly, it has also been found that the boundaries of adversarial subspaces are close to legitimate data points in adversarial directions, and that the higher the number of orthogonal adversarial directions of these subspaces, the more transferable they are to other models (Tramer\` et al., 2017). To summarize, with respect to the manifold model of data, the known properties of adversarial subspaces are: (1) they are of low probability, (2) they span a contiguous multidimensional space, (3) they lie off (but are close to) the data submanifold, and (4) they have class distributions that differ from that of their closest data submanifold.
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1: This example shows how density measures can fail to characterize the spatial properties of adversarial regions. The Gaussian kernel with bandwidth 0.2 is used for KD.
|
| 23 |
+
|
| 24 |
+
Among adversarial defense/detection techniques, Kernel Density (KD) estimation has been proposed as a measure to identify adversarial subspaces (Feinman et al., 2017). Carlini & Wagner (2017a) demonstrated the usefulness of KD-based detection, taking advantage of the low probability density generally associated with adversarial subspaces. However, in this paper we will show that kernel density is not effective for the detection of some forms of attack. In addition to kernel density, there are other density-based measures, such as the number of nearest neighbors within a fixed distance, and the mean distance to the $k$ nearest neighbors ( $k$ -mean distance). Again, these measures have limitations for the characterization of local adversarial regions. For example, in Figure 1 the three density measures fail to differentiate an adversarial example (red star) from a normal example (black cross), as the two examples are locally surrounded by the same number of neighbors (50), and have the same $k$ -mean distance $\mathrm { \ K M = } 0 . 1 9$ ) and kernel density $( \mathrm { K D = } 0 . 9 2$ ).
|
| 25 |
+
|
| 26 |
+
As an alternative to density measures, Figure 1 leads us to consider expansion-based measures of intrinsic dimensionality as a potentially effective method of characterizing adversarial examples. Expansion models of dimensionality assess the local dimensional structure of the data — such models have been successfully employed in a wide range of applications, such as manifold learning, dimension reduction, similarity search and anomaly detection (Amsaleg et al., 2015; Houle, 2017a). Although earlier expansion models characterize intrinsic dimensionality as a property of data sets, the Local Intrinsic Dimensionality (LID) fully generalizes this concept to the local distance distribution from a reference point to its neighbors (Houle, 2017a;b) — the dimensionality of the local data submanifold in the vicinity of the reference point is revealed by the growth characteristics of the cumulative distribution function. In this paper, we use LID to characterize the intrinsic dimensionality of adversarial regions, and attempt to test how well the estimates of LID can be used to distinguish adversarial examples. Note that the main goal of LID is to characterize properties of adversarial examples, instead of being applied as a pure defense method, which requires stronger assumptions on the current threat model. In Figure 1, the estimated LID of the adversarial example $( \mathrm { L I D } \approx 4 . 3 6 )$ is much higher than that of the referenced normal data sample $( \mathrm { L I D } \approx 1 . 5 3 ) $ , illustrating that the estimated LID can efficiently capture the intrinsic dimensional properties of adversarial regions. In this paper, we aim to study the LID properties of adversarial examples generated using state-of-the-art attack methods. In particular, our contributions are:
|
| 27 |
+
|
| 28 |
+
• We propose LID for the characterization of adversarial regions of deep networks. We discuss how adversarial perturbation can affect the LID characteristics of an adversarial region, and empirically show that the characteristics of test examples can be estimated effectively using a minibatch of training data.
|
| 29 |
+
• Our study reveals that the estimated LID of adversarial examples considered in this paper1 is significantly higher than that of normal data examples, and that this difference becomes more pronounced in deeper layers of DNNs.
|
| 30 |
+
We empirically demonstrate that the LID characteristics of adversarial examples generated using five state-of-the-art attack methods can be easily discriminated from those of normal examples, and provide a baseline classifier with features based on LID estimates that generally outperforms several existing detection measures on five attacks across three benchmark datasets. Though the adversarial examples considered here are not guaranteed to be the strongest with careful parameter tuning, these preliminary results firmly demonstrate the usefulness of LID measurement.
|
| 31 |
+
• We show that the adversarial regions generated by different attacks share similar dimensional properties, in that LID characteristics of a simple attack can potentially be used to detect other more complex attacks. We also show that a naive LID-based detector is robust to the normal low confidence Optimization-based attack of (Carlini & Wagner, 2017a).
|
| 32 |
+
|
| 33 |
+
# 2 RELATED WORK
|
| 34 |
+
|
| 35 |
+
In this section, we briefly review the state of the art in both adversarial attack and adversarial defense.
|
| 36 |
+
|
| 37 |
+
Adversarial Attack: A wide range of approaches have been proposed for the crafting of adversarial examples to compromise the performance of DNNs; here, we mention a selection of such works. The Fast Gradient Method (FGM) (Goodfellow et al., 2014) directly perturbs normal input by a small amount along the gradient direction. The Basic Iterative Method (BIM) is an iterative version of FGM (Kurakin et al., 2016). One variant of BIM stops immediately once misclassification has been achieved with respect to the training set (BIM-a), and another iterates a fixed number of steps (BIM-b). For image sets, the Jacobian-based Saliency Map Attack (JSMA) iteratively selects the two most effective pixels to perturb based on the adversarial saliency map, repeating the process until misclassification is achieved (Papernot et al., 2016c). The Optimization-based attack (Opt), arguably the most effective to date, addresses the problem via an optimization framework (Liu et al., 2016; Carlini & Wagner, 2017b).
|
| 38 |
+
|
| 39 |
+
Adversarial Defense: A number of defense techniques have been introduced, including adversarial training (Goodfellow et al., 2014), distillation (Papernot et al., 2016d), gradient masking (Gu & Rigazio, 2014), and feature squeezing (Xu et al., 2017). However, these defenses can generally be evaded by Opt attacks, either wholly or partially (Carlini & Wagner, 2017a; He et al., 2017; Li & Vorobeychik, 2014; 2015). Given the inherent challenges for adversarial defense, recent works have instead focused on detecting adversarial examples. These works attempt to discriminate adversarial examples (positive class) from both normal and noisy examples (negative class), based on features extracted from different layers of a DNN. Detection subnetworks based on activations (Metzen et al., 2017), a cascade detector based on the PCA projection of activations (Li & Li, 2016), an augmented neural network detector based on statistical measures, a learning framework that covers unexplored space in vulnerable models (Rouhani et al., 2017; 2018), a logistic regression detector based on KD, and Bayesian Uncertainty (BU) features (Grosse et al., 2017) are a few such works. However, a recent study by Carlini & Wagner (2017a) has shown that these detection methods can be vulnerable to attack as well.
|
| 40 |
+
|
| 41 |
+
# 3 LOCAL INTRINSIC DIMENSIONALITY
|
| 42 |
+
|
| 43 |
+
In the theory of intrinsic dimensionality, classical expansion models (such as the expansion dimension and generalized expansion dimension (Karger & Ruhl, 2002; Houle et al., 2012)) measure the rate of growth in the number of data objects encountered as the distance from the reference sample increases. As an intuitive example, in Euclidean space, the volume of an $m$ -dimensional ball grows proportionally to $r ^ { m }$ , when its size is scaled by a factor of $r$ . From this rate of volume growth with distance, the expansion dimension $m$ can be deduced as:
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
{ \frac { V _ { 2 } } { V _ { 1 } } } = \left( { \frac { r _ { 2 } } { r _ { 1 } } } \right) ^ { m } \Rightarrow m = { \frac { \ln ( V _ { 2 } / V _ { 1 } ) } { \ln ( r _ { 2 } / r _ { 1 } ) } } .
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
By treating probability mass as a proxy for volume, classical expansion models provide a local view of the dimensional structure of the data, as their estimation is restricted to a neighborhood around the sample of interest. Transferring the concept of expansion dimension to the statistical setting of continuous distance distributions leads to the formal definition of LID (Houle, 2017a).
|
| 50 |
+
|
| 51 |
+
Definition 1 (Local Intrinsic Dimensionality).
|
| 52 |
+
|
| 53 |
+
Given a data sample $x \in X$ , let $R > 0$ be a random variable denoting the distance from x to other data samples. If the cumulative distribution function $F ( r )$ of $R$ is positive and continuously differentiable at distance $r > 0$ , the LID of $x$ at distance $r$ is given by:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\mathbf { L I D } _ { F } ( r ) \triangleq \operatorname* { l i m } _ { \epsilon 0 } \frac { \ln \big ( F ( ( 1 + \epsilon ) \cdot r ) / F ( r ) \big ) } { \ln ( 1 + \epsilon ) } = \frac { r \cdot F ^ { \prime } ( r ) } { F ( r ) } ,
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
whenever the limit exists.
|
| 60 |
+
|
| 61 |
+
$F ( r )$ is analogous to the volume $V$ in Equation (1); however, we note that the underlying distance measure need not be Euclidean. The last equality of Equation (2) follows by applying L’Hopital’s ˆ rule to the limits (Houle, 2017a). The local intrinsic dimension at $x$ is in turn defined as the limit, when the radius $r$ tends to zero:
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\mathrm { L I D } _ { F } = \operatorname * { l i m } _ { r \to 0 } \mathrm { L I D } _ { F } ( r ) .
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
$\mathrm { L I D } _ { F }$ describes the relative rate at which its cumulative distance function $F ( r )$ increases as the distance $r$ increases from 0, and can be estimated using the distances of $x$ to its $k$ nearest neighbors within the sample (Amsaleg et al., 2015).
|
| 68 |
+
|
| 69 |
+
In the ideal case where the data in the vicinity of $x$ is distributed uniformly within a submanifold, $\mathrm { L I D } _ { F }$ equals the dimension of the submanifold; however, in general these distributions are not ideal, the manifold model of data does not perfectly apply, and $\mathrm { L I D } _ { F }$ is not an integer. Nevertheless, the local intrinsic dimensionality does give a rough indication of the dimension of the submanifold containing $x$ that would best fit the data distribution in the vicinity of $x$ . We refer readers to Houle (2017a;b) for more details concerning the LID model.
|
| 70 |
+
|
| 71 |
+
Estimation of LID: According to the branch of statistics known as extreme value theory, the smallest $k$ nearest neighbor distances could be regarded as extreme events associated with the lower tail of the underlying distance distribution. Under very reasonable assumptions, the tails of continuous probability distributions converge to the Generalized Pareto Distribution (GPD), a form of powerlaw distribution (Coles et al., 2001). From this, Amsaleg et al. (2015) developed several estimators of LID to heuristically approximate the true underlying distance distribution by a transformed GPD; among these, the Maximum Likelihood Estimator (MLE) exhibited a useful trade-off between statistical efficiency and complexity. Given a reference sample $x \sim \mathcal { P }$ , where $\mathcal { P }$ represents the data distribution, the MLE estimator of the LID at $x$ is defined as follows:
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\widehat { \mathrm { L I D } } ( x ) = - \Bigg ( \frac { 1 } { k } \sum _ { i = 1 } ^ { k } \log \frac { r _ { i } ( x ) } { r _ { k } ( x ) } \Bigg ) ^ { - 1 } .
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
Here, $r _ { i } ( x )$ denotes the distance between $x$ and its $i$ -th nearest neighbor within a sample of points drawn from $\mathcal { P }$ , where $r _ { k } ( x )$ is the maximum of the neighbor distances. In practice, the sample set is drawn uniformly from the available training data (omitting $x$ itself), which itself is presumed to have been randomly drawn from $\mathcal { P }$ . We emphasize that the LID defined in Equation (3) is a theoretical quantity, and that $\widehat { \mathrm { L I D } }$ as defined in Equation (4) is its estimate. In the remainder of this paper, we will refer to Equation (4) to calculate LID estimates.
|
| 78 |
+
|
| 79 |
+
# 4 CHARACTERIZING ADVERSARIAL REGIONS
|
| 80 |
+
|
| 81 |
+
Our aim is to gain a better understanding of adversarial regions, and thereby derive potential defenses and provide new directions for more efficient attacks. We begin by providing some motivation with respect to the manifold model of data as to how adversarial perturbation might affect the LID characteristic of adversarial regions. We then show how a detector can potentially be designed using LID estimates to discriminate between adversarial and normal examples.
|
| 82 |
+
|
| 83 |
+
LID of Adversarial Subspaces: Consider a sample $x \in X$ lying within a data submanifold $S$ , where $X$ is a randomly sampled dataset from $\mathcal { P }$ consisting only of normal (unperturbed) examples. Adversarial perturbation of $x$ typically results in a new sample $x ^ { \prime }$ whose coordinates differ from those of $x$ by very small amounts. Assuming that $x ^ { \prime }$ is indeed a successful adversarial perturbation of $x$ , the theoretical LID value associated with $x$ is simply the dimension of $S$ , whereas the theoretical LID value associated with $x ^ { \prime }$ is the dimension of the adversarial subspace within which it resides. Recent work in Amsaleg et al. (2017) shows that the magnitude of the perturbation required to make changes in the expected nearest neighbor ranking tends to zero as the LID and the data sample size tend to infinity.
|
| 84 |
+
|
| 85 |
+
Since perturbation schemes generally allow the modification of all data coordinates, they exploit the full degrees of freedom afforded by the representational dimension of the data domain. As pointed out by (Goodfellow et al., 2014; Warde-Farley et al., 2016; Tanay & Griffin, 2016), $x ^ { \prime }$ is very likely to lie outside $S$ (but very close to $S$ — in a high-dimensional contiguous space). In applications involving high-dimensional data, the representational dimension is typically far larger than the intrinsic dimension of any given data submanifold, which implies that the theoretical LID of $x ^ { \prime }$ is far greater than that of $x$ .
|
| 86 |
+
|
| 87 |
+
In practice, however, the values of LID must be estimated from local data samples. This is typically done by applying an appropriate estimator (such as the MLE estimator shown in Equation (4)) to a $k$ -nearest neighborhood of the test samples, for some appropriate fixed choice of $k$ . Typically, $k$ is chosen large enough for the estimation to stabilize, but not so large that the sample is no longer local to the test sample. If the dimension of $S$ is reasonably low, one can expect the estimation of the LID of $x$ to be reasonably accurate.
|
| 88 |
+
|
| 89 |
+
For the adversarial subspace, the samples appearing in the neighborhood of $x ^ { \prime }$ can be expected to be drawn from more than one manifold. The proximity of $x ^ { \prime }$ to $S$ means that the neighborhood is likely to contain neighbors lying in $S$ ; however, if the neighborhood were composed mostly of samples drawn from $S$ , $x ^ { \prime }$ would not likely be an adversarial example. Thus, the neighbors of $x ^ { \prime }$ taken together are likely to span a subspace of intrinsic dimensionality much higher than any of these submanifolds considered individually, and the LID estimate computed for $x ^ { \prime }$ can be expected to reveal this.
|
| 90 |
+
|
| 91 |
+
Efficiency through Minibatch Sampling: Computing neighborhoods with respect to the entirety of the dataset $X$ can be prohibitively expensive, particularly when the (global) intrinsic dimensionality of $X$ is too high to support efficient indexing. For this reason, when $X$ is large, the computational cost can be reduced by estimating the LID of an adversarial example $x ^ { \prime }$ from its $k$ -nearest neighbor set within a randomly-selected sample (minibatch) of the dataset $X$ . Since the LID estimation model regards the distances from $x ^ { \prime }$ to the members of $X$ as determined by independently-drawn samples from a distribution $\mathcal { P }$ , the estimator can also be applied to the distances induced by any random minibatch, as it too would be drawn independently from the same distribution $\mathcal { P }$ .
|
| 92 |
+
|
| 93 |
+
Provided that the minibatch is chosen sufficiently large so as to ensure that the $k$ -nearest neighbor sets remain in the vicinity of $x ^ { \prime }$ , estimates of LID computed for $x ^ { \prime }$ within the minibatch would resemble those computed within the full dataset $X$ . Conversely, as the size of the minibatch is reduced, the variance of the estimates would increase. However, if the gap between the true LID values of $x$ and $x ^ { \prime }$ is sufficiently large, even an extremely small minibatch size and / or small neighborhood size could conceivably produce estimates whose difference is sufficient to reveal the adversarial nature of $x ^ { \prime }$ . As we shall show in Section 5.2, discrimination between adversarial and non-adversarial examples turns out to be possible even for minibatch sizes as small as 100, and for neighborhood sizes as small as 20.
|
| 94 |
+
|
| 95 |
+
Using LID to Characterize Adversarial Examples: We next describe how LID estimates can serve as features to train a detector to distinguish adversarial examples. Note that here we only aim to train a baseline classifier to demonstrate how well LID can characterize adversarial examples. Robust detection taking different attack variations into account, such as attack confidence, will be left as future work. Our methodology requires that training sets be comprised of three types of examples: adversarial, normal and noisy. This replicates the methodology used in (Feinman et al., 2017; Carlini & Wagner, 2017a), where the rationale for including noisy examples is that DNNs are required to be robust to random input noise (Fawzi et al., 2016) and noisy inputs should not be identified as adversarial attacks. A classifier can be trained by using the training data to construct features for each sample, based on its LID within a minibatch of samples across different layers, where the class label is assigned positive for adversarial examples and assigned negative for normal and noisy examples.
|
| 96 |
+
|
| 97 |
+
Algorithm 1 describes how the LID features can be extracted for training an LID-based classifier. Given an initial training dataset and a DNN pre-trained on the initial training dataset, the algorithm outputs a classifier trained using LID features. As in previous studies (Carlini & Wagner, 2017a; Feinman et al., 2017), we assume that the initial training dataset is free of adversarial examples — that is, all examples in the dataset are considered ‘normal’ to begin with. The extraction of LID features first begins with the generation of adversarial and noisy counterparts to normal examples (step 3 and 4) in each minibatch. One minibatch of normal examples $( B _ { n o r m } )$ is used for generating 2 counterpart minibatches of examples: one adversarial $( B _ { a d v } )$ and one noisy $( B _ { n o i s y } )$ . The adversarial examples are generated using an adversarial attack on normal examples (step 3), while noisy examples are generated by adding random noise to normal examples, subject to the constraint that the magnitude of perturbation undergone by a noisy example is the same as the magnitude of perturbation undergone by its counterpart adversarial example (step 4). One minibatch of normal examples is converted to an equal number of adversarial examples after step 3, and an equal number of noisy examples after step 4.
|
| 98 |
+
|
| 99 |
+
The LID associated with each example (either normal, adversarial or noisy) is estimated from its $k$ nearest neighbors in the normal minibatch (steps 12-14), using Equation (4). For any new unknown test example, a minibatch consisting only of normal training examples is used to estimate LID. For each example and each transformation layer in the DNN, an LID estimate is calculated. The distance function needed for this estimate uses the activation values of the neurons in the given layer as inputs (step 7). As will be discussed in Section 5.2, we use all transformation layers, including conv2d, max-pooling, dropout, ReLU and softmax, since we expect adversarial regions to exist in each layer of the DNN representation space. The LID estimates associated with the example are then used as feature values (one feature for each transformation layer). Finally, a classifier (such as logistic regression) is trained using the LID features. Test examples can then be classified by the LID-based classifier to either the positive (adversarial) or negative (non-adversarial) class by means of its LID-based feature values.
|
| 100 |
+
|
| 101 |
+
# 5 EVALUATING LID-BASED CHARACTERIZATION OF ADVERSARIAL EXAMPLES
|
| 102 |
+
|
| 103 |
+
In this section, we evaluate the discrimination power of LID-based characterization against five adversarial attack strategies — FGM, BIM-a, BIM-b, JSMA, and Opt, as introduced in Section 2. These attack strategies were selected for our experiments due to their reported effectiveness and their diversity. For each of the 5 forms of attack, the LID detector is compared with the state-of-the-art detection measures KD and BU as discussed in Section 2, with respect to three benchmark image datasets: MNIST (LeCun et al., 1990), CIFAR-10 (Krizhevsky & Hinton, 2009) and SVHN (Netzer et al., 2011). Each of these three datasets is associated with a designated training set and test set. Before reporting and discussing the results, we first describe the experimental setup.
|
| 104 |
+
|
| 105 |
+
# Algorithm 1 Training phase for LID-based adversarial classifier
|
| 106 |
+
|
| 107 |
+
#
|
| 108 |
+
|
| 109 |
+
$X$ : a dataset of normal examples $H ( x )$ : a pre-trained DNN with $L$ transformation layers $k$ : the number of nearest neighbors for LID estimation
|
| 110 |
+
|
| 111 |
+
# Output:
|
| 112 |
+
|
| 113 |
+
Detector(LID) . a detector 1: $\mathrm { L I D } _ { n e g } { = } [ ]$ , $\mathrm { L I D } _ { p o s } { = } [ ]$ 2: for $B _ { n o r m }$ in $X$ do $\textsf { \textsf { D } } B _ { n o r m }$ : a minibatch of normal examples 3: $B _ { a d v } : =$ adversarial attack $B _ { n o r m }$ . $B _ { a d v }$ : a minibatch of adversarial examples 4: $B _ { n o i s y }$ : $: =$ add random noise to $B _ { n o r m }$ . $B _ { n o i s y }$ : a minibatch of noisy examples 5: N = |Bnorm| $\triangleright$ number of examples in $B _ { n o r m }$ 6: LIDnorm, LIDnoisy, $\mathrm { L I D } _ { n o i s y } = \mathrm { z e r o s } [ N , L ]$ 7: for $i$ in $[ 1 , L ]$ do 8: Anorm = Hi(Bnorm) $\triangleright i$ -th layer activations of $B _ { n o r m }$ 9: Aadv = Hi(Badv) $\triangleright i$ -th layer activations of $B _ { a d v }$ 10: $A _ { n o i s y } = H ^ { i } ( B _ { n o i s y } )$ ${ \triangleright } i$ -th layer activations of $B _ { n o i s y }$ 11: for $j$ in $[ 1 , N ]$ do 12: $\begin{array} { r } { \dot { \mathrm { L I D } _ { n o r m } } \dot { [ j , i ] } = - \Big ( \frac { 1 } { k } \sum _ { i = 1 } ^ { k } \log { \frac { r _ { i } ( A _ { n o r m } [ j ] , A _ { n o r m } ) } { r _ { k } ( A _ { n o r m } [ j ] , A _ { n o r m } ) } } \Big ) ^ { - 1 } } \end{array}$ 13: $\begin{array} { r } { \mathbf { L I D } _ { a d v } [ j , i ] = - \Big ( \frac { 1 } { k } \sum _ { i = 1 } ^ { k } \log \frac { r _ { i } ( A _ { a d v } [ j ] , A _ { n o r m } ) } { r _ { k } ( A _ { a d v } [ j ] , A _ { n o r m } ) } \Big ) ^ { - \frac { 1 } { \gamma _ { k } } } } \end{array}$ 1 14: LIDnoisy[j, i] = − 1k Pki=1 log ri(Anoisy[j],Anorm)rk(Anoisy[j],Anorm) 15: $\triangleright r _ { i } ( A [ j ] , A _ { n o r m } )$ : the $L _ { 2 }$ distance of $A _ { - } [ j ]$ to its $i$ -th nearest neighbor in $A _ { n o r m }$ 16: end for 17: end for 18: ${ \mathrm { L I D } } _ { n e g }$ .append $( \mathrm { L I D } _ { n o r m } )$ , ${ \mathrm { L I D } } _ { n e g }$ .append $( \mathrm { L I D } _ { n o i s y } )$ 19: $\mathrm { L I D } _ { p o s }$ .append $\mathrm { L I D } _ { a d v , }$ ) 20: end for 21: Detector $\left( \mathrm { L I D } \right) =$ train a classifier on $( \mathrm { L I D } _ { n e g } , \mathrm { L I D } _ { p o s } )$
|
| 114 |
+
|
| 115 |
+
# 5.1 EXPERIMENTAL SETUP
|
| 116 |
+
|
| 117 |
+
Training and Testing: For each of the three image datasets, a DNN classifier was independently pretrained on its designated training set (the pre-train set), and its designated test set was used for testing (the pre-test set). Any pre-test images not correctly classified were discarded, and the remaining images were subdivided into train $( 8 0 \% )$ and test $( 2 0 \% )$ sets for subsequent processing. Both of these sets were randomly partitioned into minibatches of size 100, for later use in the computation of LID characteristics.
|
| 118 |
+
|
| 119 |
+
The LID-, KD- and BU-based detectors were trained separately on the train set using the scheme in Algorithm 1, with the calculation of LID estimates replaced by KD and BU calculation for their respective detectors. All three detectors were then evaluated against equal numbers of normal, noisy and adversarial images crafted from members of the test set, as described in Steps 2-4 of Algorithm 1. The LID, KD and BU characteristics of those test images were then generated as shown in Steps 1- 19 of Algorithm 1. It should be noted that no images of the test set were examined during any of the training processes, so as to avoid cross contamination. The adversarial examples for both training and testing were generated by applying one of the five selected attacks. Following the procedure outlined in Feinman et al. (2017), the noisy examples for the JSMA attack were crafted by changing the values of a randomly-selected set of pixels to either their minimum or maximum (determined randomly), where the number of pixels to be adjusted was chosen to be equal to the number of pixels perturbed in the generation of adversarial examples. For the other attack strategies, $L _ { 2 }$ Gaussian noise was added to the pixel values instead of setting them to their minimum or maximum. As suggested by Feinman et al. (2017); Carlini & Wagner (2017a), we used the logistic regression classifier as detector, and report its AUC score as the metric for performance.
|
| 120 |
+
|
| 121 |
+
Deep Neural Networks for Pretraining: The pretrained DNN used for MNIST was a 5-layer ConvNet with max-pooling and dropout. It achieved $9 9 . 2 9 \%$ classification accuracy on (normal)
|
| 122 |
+
|
| 123 |
+
pre-test images. For CIFAR-10, a 12-layer ConvNet with max-pooling and dropout was used. This model reported an accuracy of $8 4 . 5 6 \%$ on (normal) pre-test images. For SVHN, we trained a 6-layer ConvNet with max-pooling and dropout. It achieved $9 2 . 1 8 \%$ accuracy on (normal) pre-test images. We deliberately did not tune the DNNs, as their performance was close to the state-of-the-art and could thus be considered sufficient for use in an adversarial study (Feinman et al., 2017).
|
| 124 |
+
|
| 125 |
+
Parameter Tuning: We tuned the bandwidth $( \sigma )$ parameter for KD, and the number of nearest neighbors $( k )$ for LID, using nested cross validation within the training set (train). Using the AUC values of detection performance, the bandwidth was tuned using a grid search over the range [0, 10) in log-space, and neighborhood size was tuned using a grid search over the range [10, 100) with respect to a minibatch of size 100. For a given dataset, the parameter setting selected was the one with highest AUC averaged across all attacks. The optimal bandwidths chosen for MNIST, CIFAR10 and SVHN were 3.79, 0.26, and 1.0, respectively, while the value of $k$ for LID estimation was set to 20 for MNIST and CIFAR-10, and 30 for SVHN. For BU, we chose the number of prediction runs to be $T = 5 0$ in all experiments. We did not tune this parameter, as it is not considered to be sensitive for choices of $T$ greater than 20 (Carlini & Wagner, 2017a).
|
| 126 |
+
|
| 127 |
+
Our implementation is based on the detection framework of Feinman et al. (2017). For FGM, JSMA, BIM-a, and BIM-b attack strategies, we used the cleverhans library (Papernot et al., 2016a), and for the Opt attack strategy, we used the author’s implementation (Carlini & Wagner, 2017b). We scaled all image feature values to the interval [0, 1]. Our code is available for download at https: //github.com/xingjunm/lid_adversarial_subspace_detection.
|
| 128 |
+
|
| 129 |
+
# 5.2 LID CHARACTERISTICS OF ADVERSARIAL EXAMPLES
|
| 130 |
+
|
| 131 |
+
We provide empirical results showing the LID characteristics of adversarial examples generated by Opt, the most effective of the known attack strategies. The left subfigure in Figure 2 shows the LID scores (at the softmax layer) of 100 randomly selected normal, noisy and adversarial (Opt) examples from the CIFAR-10 dataset. We observe that at this layer, the LID scores of adversarial examples are significantly higher than those of normal or noisy examples. This supports our expectation that adversarial regions have higher intrinsic dimensionality than normal data regions (as discussed in Section 4). It also suggests that the transition from normal example to adversarial example may follow directions in which the complexity of the local data submanifold significantly increases, leading to an increase in estimated LID values.
|
| 132 |
+
|
| 133 |
+
In the right subfigure of Figure 2, we further show that the LID scores of adversarial examples are more easily discriminated from those of other examples at deeper layers of the network. The 12-layer ConvNet used for CIFAR-10 consists of 26 transformation layers: the input layer $( L _ { 0 } )$ , conv2d/max-pooling $( L _ { 1 - 1 7 } )$ , dense/dropout $( L _ { 1 8 - 2 4 } )$ and the final softmax layer $\left( L _ { 2 5 } \right)$ . The estimated LID characteristics of adversarial examples become distinguishable (detection $\mathrm { A U C } > 0 . 5 )$ at the dense layers $( L _ { 1 8 - 2 4 } )$ , and significantly different at the softmax layer $\left( L _ { 2 5 } \right)$ . This suggests that the fully-connected and softmax transformations may be more sensitive to adversarial perturbations than convolutional transformations. Plots of LID scores for the MNIST and SVHN datasets can be found in Appendix A.2.
|
| 134 |
+
|
| 135 |
+
With regard to the stability of performance based on parameter variation ( $k$ for LID, or bandwidth for KD), we can see from Figure 3 that LID is more stable than KD, exhibiting less variation in AUC as the parameter varies. From this figure, we also see that KD requires significantly different optimal settings for different types of data. For simpler datasets such as MNIST and SVHN, KD requires quite high bandwidth choices for best performance.
|
| 136 |
+
|
| 137 |
+
# 5.3 ANALYSIS OF LID PROPERTIES
|
| 138 |
+
|
| 139 |
+
LID Outperforms KD and BU: We compare the performance of LID-based detection with that of detectors trained with features of KD and BU individually, as well as a detector trained with a combination of KD and BU features (denoted as $\mathsf { \nabla \mathsf { K D + B U } } ^ { \mathsf { 5 } }$ ). As shown in Table 1, LID outperforms the KD and BU measures (both individually and combined) by large margins on all attack strategies tested, across all datasets tested. For the most effective attack strategy known to date, the Opt attack, the LID-based detector achieved AUC scores of $9 9 . 2 4 \%$ , $9 8 . 9 4 \mathrm { \bar { / } } _ { 0 }$ and $9 7 . 6 0 \%$ on MNIST, CIFAR-10 and SVHN respectively, compared to AUC scores of $9 5 . 3 5 \%$ , $9 3 . 7 7 \%$ and $9 0 . 6 6 \%$ for the detector based on KD and BU. This strong performance suggests that LID is a highly promising characteristic for the discrimination of adversarial examples and regions. We also note that KD was not effective for the FGM, JSMA and BIM-a attack strategies, whereas the BU measure failed to detect most FGM and BIM- $\mathbf { \sigma } . \mathbf { b }$ attacks on the MNIST dataset.
|
| 140 |
+
|
| 141 |
+

|
| 142 |
+
Figure 2: The left-hand figure shows the LID scores (at the softmax layer) of 100 normal (blue), noisy (green), and Opt attack (red $\mathbf { X }$ -cross) examples from the CIFAR-10 dataset. The scores have been scaled to the interval [0,1] using min-max normalization. The blue and green lines appear superimposed due to similarities in the LID scores for normal and noisy examples. The right-hand figure shows the detection performance (AUC) based on LID scores computed at different layers. $L _ { i }$ denotes the $i$ -th transformation layer.
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 3: Top row: tuning bandwidth $\sigma$ for KD using a grid search over the range [0, 10) in logspace, separately for each dataset. Bottom row: tuning $k$ for LID using a grid search over the range [10, 100) for minibatch size 100, separately for each dataset. The vertical dashed lines denote the selected parameter choice.
|
| 146 |
+
|
| 147 |
+
Generalizability Analysis: It is natural to consider the question of whether samples of one attack strategy may be detected by a model that has been trained on samples of a different attack strategy. We conduct a preliminary investigation of this issue by studying the generalizability of KD, BU and LID for detecting previously unseen attack strategies on the CIFAR-10 dataset. The KD, BU and LID detectors are trained on samples of the simplest attack strategy, FGM, and then tested on samples of the more complex attacks BIM-a, BIM-b, JSMA and Opt. The training and test datasets are generated in the same way as in our previous experiments with only the FGM attack applied on the train set while the other attacks applied separately on the test set. The test attack data is standardized by scaling so as to fit the training data. The results are shown in Table 2, from which we see that the LID detector trained on FGM can accurately detect the much more complex attacks of the other strategies. The KD and BU characteristics can also achieve good performance on this transfer learning task, but are less consistent than our proposed LID characteristic. The results appear to indicate that the adversarial regions generated by different attack strategies possess similar dimensional properties.
|
| 148 |
+
|
| 149 |
+
Table 1: A comparison of the discrimination power (AUC score $( \% )$ of a logistic regression classifier) among LID, KD, BU, and $\mathrm { K D + B U }$ . The AUC score is computed for each attack strategy on each dataset, and the best results are highlighted in bold.
|
| 150 |
+
|
| 151 |
+
<table><tr><td>Dataset</td><td>Feature</td><td>FGM</td><td>BIM-a</td><td>BIM-b</td><td>JSMA</td><td>Opt</td></tr><tr><td rowspan="3">MNIST</td><td rowspan="3">KD BU KD+BU</td><td>78.12</td><td>98.14</td><td>98.61</td><td>68.77</td><td>95.15</td></tr><tr><td>32.37</td><td>91.55</td><td>25.46</td><td>88.74</td><td>71.30</td></tr><tr><td>82.43</td><td>99.20</td><td>98.81</td><td>90.12</td><td>95.35</td></tr><tr><td rowspan="4">CIFAR-10</td><td>LID KD</td><td>96.89 64.92</td><td>99.60 68.38</td><td>99.83 98.70</td><td>92.24 85.77</td><td>99.24 91.35</td></tr><tr><td>BU</td><td>70.53</td><td>81.60</td><td>97.32</td><td>87.36</td><td>91.39</td></tr><tr><td>KD+BU</td><td>70.40</td><td>81.33</td><td>98.90</td><td>88.91</td><td>93.77</td></tr><tr><td>LID</td><td>82.38</td><td>82.51</td><td>99.78</td><td>95.87</td><td>98.94</td></tr><tr><td rowspan="4">SVHN</td><td>KD</td><td>70.39</td><td>77.18</td><td>99.57</td><td>86.46</td><td>87.41</td></tr><tr><td>BU</td><td>86.78</td><td>84.07</td><td>86.93</td><td>91.33</td><td>87.13</td></tr><tr><td>KD+BU</td><td>86.86</td><td>83.63</td><td>99.52</td><td>93.19</td><td>90.66</td></tr><tr><td>LID</td><td>97.61</td><td>87.55</td><td>99.72</td><td>95.07</td><td>97.60</td></tr></table>
|
| 152 |
+
|
| 153 |
+
It is worth mentioning that the BU detector trained on the FGM attack generalizes poorly to detect BIM-b adversarial examples $( \mathrm { A U C } { = } 2 . 6 5 \%$ ). This may due to the fact that BIM-b performs a fixed number of perturbations (50 in our setting) that likely extend well beyond the classification boundary. Such perturbed adversarial examples tend to possess Bayesian model uncertainties even lower than normal examples under dropout randomization, as dropping out a certain proportion of their representations $5 0 \%$ in our setting) would not lead to high prediction variance. This is consistent with the results reported in Feinman et al. (2017): only $4 \%$ of BIM-b adversarial examples, in contrast to at least $7 4 . 7 \%$ of adversarial examples of other attack strategies, exhibit higher Bayesian uncertainties than normal examples. It is particularly interesting to see that detectors trained on the FGM attack strategy can sometimes achieve better performance when used to identify the other attacks. An extensive study of detection generalizability across all attack strategies is an interesting topic for future work.
|
| 154 |
+
|
| 155 |
+
Table 2: This table of AUC scores $( \% )$ shows the generalizability of detectors trained on the FGM attack strategy (row) to other forms of attack (column), with respect to the CIFAR-10 dataset. The best results are indicated in bold font.
|
| 156 |
+
|
| 157 |
+
<table><tr><td>Train</td><td>Test</td><td>FGM</td><td>BIM-a</td><td>BIM-b</td><td>JSMA</td><td>Opt</td></tr><tr><td rowspan="3">FGM</td><td>KD</td><td>64.92</td><td>69.15</td><td>89.71</td><td>85.72</td><td>91.22</td></tr><tr><td>BU</td><td>70.53</td><td>81.67</td><td>2.65</td><td>86.79</td><td>91.27</td></tr><tr><td>LID</td><td>82.38</td><td>82.30</td><td>91.61</td><td>89.93</td><td>93.32</td></tr></table>
|
| 158 |
+
|
| 159 |
+
Effect of Larger Minibatch Sizes in LID Estimation: In the estimation of LID values, a default minibatch size of 100 was used, with a view to ensuring efficiency. Even though experimental analysis has shown that the MLE estimator of LID is not stable on such small samples (Amsaleg et al., 2015), this is more than adequately compensated for by the learning process in LID-based detection, as evidenced by the superior performance shown in Table 1. However, it is an interesting question as to whether the use of larger minibatch sizes could further improve the performance (as measured by AUC) without incurring unreasonably high computational cost. Figure 5 in Appendix A.3 illustrates the effect of using a minibatch size of 1000 for different choices of $k$ . It does indicate that increasing the batch size can improve the detection performance even further. A comprehensive investigation of the tradeoffs among minibatch size, LID estimation accuracy, and detection performance is an interesting direction for future work.
|
| 160 |
+
|
| 161 |
+
Table 3: The failure rate $( \% )$ of an adaptive attack targeting the LID-based detector.
|
| 162 |
+
|
| 163 |
+
<table><tr><td></td><td>MNIST</td><td>CIFAR-10</td><td>SVHN</td></tr><tr><td>Scenario 1 (LID at all layers): Attack Failure Rate</td><td>100</td><td>100</td><td>100</td></tr><tr><td>Scenario 2 (LID at one layer): Attack Failure Rate</td><td>100</td><td>95.7</td><td>97.2</td></tr></table>
|
| 164 |
+
|
| 165 |
+
Adaptive Attack Against LID Measurement: To further evaluate the robustness of our LIDbased detector, we applied an adaptive Opt attack in a white-box setting. Similar to the strategy used in Carlini & Wagner (2017a) to attack the KD-based detector, we used an $\mathrm { O p t } L _ { 2 }$ attack with a modified adversarial objective:
|
| 166 |
+
|
| 167 |
+
$$
|
| 168 |
+
\mathrm { m i n i m i z e } \ \| x - x _ { a d v } \| _ { 2 } ^ { 2 } + \alpha \cdot \left( \ell ( x _ { a d v } ) + \ell ( \mathrm { L I D } ( x _ { a d v } ) ) \right)
|
| 169 |
+
$$
|
| 170 |
+
|
| 171 |
+
where $\alpha$ is a constant balancing between the amount of perturbation and the adversarial strength, and the LID scores are computed at the pre-softmax layer.
|
| 172 |
+
|
| 173 |
+
We test two different scenarios for detection. In the first scenario, we use LID features as described in Algorithm 1. In the second scenario, we use LID scores only at the pre-softmax layer. Since the Opt attack uses only the pre-softmax activation output to guide the perturbation, the latter scenario allows a fair comparison to be made (Carlini & Wagner, 2017b;a). The optimal constant $\alpha$ is determined via an internal binary search for $\alpha \in [ 1 0 ^ { - 3 } , 1 0 ^ { 6 } ]$ . The rationale for the minimization of the LID characteristic in Equation (5) is that adversarial examples have higher LID characteristics than normal examples, as we have demonstrated in Section 5.2.
|
| 174 |
+
|
| 175 |
+
We applied the adaptive attack on 1000 normal images randomly chosen from the detection test set (test). The deep networks used were the same ConvNet configurations as used in our previous experiments. To evaluate attack performance, instead of AUC as measured in the previous sections, we report accuracy as suggested by Carlini & Wagner (2017a). We see from Table 3 that the adaptive attack in Scenario 2 fails to find any valid adversarial example $1 0 0 \%$ , $9 5 . 7 \%$ and $9 7 . 2 \%$ of the time on MNIST, CIFAR-10 and SVHN respectively. In addition, when trained on all transformation layers (Scenario 1), the LID-based detector still correctly detected the attacks $1 0 0 \%$ of the time. Based on these results, we can conclude that integrating LID into the adversarial objective (increasing the complexity of the attack) does not make detection more difficult for our method. This is in contrast to the work of Carlini & Wagner (2017a), who showed that incorporating kernel density into the objective function makes detection substantially more difficult for the KD method.
|
| 176 |
+
|
| 177 |
+
# 6 DISCUSSION AND CONCLUSION
|
| 178 |
+
|
| 179 |
+
In this paper, we have addressed the challenge of understanding the properties of adversarial regions, particularly with a view to detecting adversarial examples. We characterized the dimensional properties of adversarial regions via the use of Local Intrinsic Dimensionality (LID), and showed how these could be used as features in an adversarial example detection process. Our empirical results suggest that LID is a highly promising measure for the characterization of adversarial examples, one that can be used to deliver state-of-the-art discrimination performance. From a theoretical perspective, we have provided an initial intuition as to how LID is an effective method for characterizing adversarial attack, one which complements the recent theoretical analysis showing how increases in LID effectively diminish the amount of perturbation required to move a normal example into an adversarial region (with respect to 1-NN classification) (Amsaleg et al., 2017). Further investigation in this direction may lead to new techniques for both adversarial attack and defense.
|
| 180 |
+
|
| 181 |
+
In the learning process, the activation values at each layer of the LID-based detector can be regarded as a transformation of the input to a space in which the LID values have themselves been transformed. A full understanding of LID characteristics should take into account the effect of DNN transformations on these characteristics. This is a challenging question, since it requires a better understanding of the DNN learning processes themselves. One possible avenue for future research may be to model the dimensional characteristics of the DNN itself, and to empirically verify how they influence the robustness of DNNs to adversarial attacks.
|
| 182 |
+
|
| 183 |
+
Another open issue for future research is the empirical investigation of the effect of LID estimation quality on the performance of adversarial detection. As evidenced by the improvement in performance observed when increasing the minibatch size from 100 to 1000 (Figure 5 in Appendix A.3), it stands to reason that improvements in estimator quality or sampling strategies could both be beneficial in practice.
|
| 184 |
+
|
| 185 |
+
# ACKNOWLEDGMENTS
|
| 186 |
+
|
| 187 |
+
James Bailey is in part supported by the Australian Research Council via grant number DP170102472. Michael E. Houle is in part supported by JSPS Kakenhi Kiban (B) Research Grant 15H02753. Bo Li and Dawn Song are partially supported by Berkeley Deep Drive, the Center for Long-Term Cybersecurity, and FORCES (Foundations Of Resilient CybEr-Physical Systems), which receives support from the National Science Foundation (NSF award numbers CNS-1238959, CNS-1238962, CNS-1239054, CNS-1239166).
|
| 188 |
+
|
| 189 |
+
# REFERENCES
|
| 190 |
+
|
| 191 |
+
Laurent Amsaleg, Oussama Chelly, Teddy Furon, Stephane Girard, Michael E. Houle, Ken-ichi ´ Kawarabayashi, and Michael Nett. Estimating local intrinsic dimensionality. In SIGKDD, pp. 29–38. ACM, 2015.
|
| 192 |
+
|
| 193 |
+
Laurent Amsaleg, James Bailey, Dominique Barbe, Sarah Erfani, Michael E. Houle, Vinh Nguyen, and Milos Radovanovic. The vulnerability of learning to adversarial perturbation increases withˇ intrinsic dimensionality. In WIFS, 2017.
|
| 194 |
+
|
| 195 |
+
Nicholas Carlini and David Wagner. Adversarial examples are not easily detected: Bypassing ten detection methods. arXiv preprint arXiv:1705.07263, 2017a.
|
| 196 |
+
|
| 197 |
+
Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In S&P, pp. 39–57, 2017b.
|
| 198 |
+
|
| 199 |
+
Stuart Coles, Joanna Bawa, Lesley Trenner, and Pat Dorazio. An introduction to statistical modeling of extreme values, volume 208. Springer, 2001.
|
| 200 |
+
|
| 201 |
+
Ivan Evtimov, Kevin Eykholt, Earlence Fernandes, Tadayoshi Kohno, Bo Li, Atul Prakash, Amir Rahmati, and Dawn Song. Robust physical-world attacks on machine learning models. arXiv preprint arXiv:1707.08945, 2017.
|
| 202 |
+
|
| 203 |
+
Alhussein Fawzi, Seyed-Mohsen Moosavi-Dezfooli, and Pascal Frossard. Robustness of classifiers: from adversarial to random noise. In NIPS, pp. 1632–1640, 2016.
|
| 204 |
+
|
| 205 |
+
Reuben Feinman, Ryan R. Curtin, Saurabh Shintre, and Andrew B Gardner. Detecting adversarial samples from artifacts. arXiv preprint arXiv:1703.00410, 2017.
|
| 206 |
+
|
| 207 |
+
Ian J. Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
|
| 208 |
+
|
| 209 |
+
Kathrin Grosse, Praveen Manoharan, Nicolas Papernot, Michael Backes, and Patrick McDaniel. On the (statistical) detection of adversarial examples. arXiv preprint arXiv:1702.06280, 2017.
|
| 210 |
+
|
| 211 |
+
Shixiang Gu and Luca Rigazio. Towards deep neural network architectures robust to adversarial examples. arXiv preprint arXiv:1412.5068, 2014.
|
| 212 |
+
|
| 213 |
+
Warren He, James Wei, Xinyun Chen, Nicholas Carlini, and Dawn Song. Adversarial example defenses: Ensembles of weak defenses are not strong. arXiv preprint arXiv:1706.04701, 2017.
|
| 214 |
+
|
| 215 |
+
Geoffrey Hinton, Li Deng, Dong Yu, George E. Dahl, Abdel-rahman Mohamed, Navdeep Jaitly, Andrew Senior, Vincent Vanhoucke, Patrick Nguyen, Tara N. Sainath, and Brian Kingsbury. Deep neural networks for acoustic modeling in speech recognition: The shared views of four research groups. Signal Processing Magazine, 29(6):82–97, 2012.
|
| 216 |
+
|
| 217 |
+
Michael E. Houle. Local intrinsic dimensionality I: an extreme-value-theoretic foundation for similarity applications. In SISAP, pp. 64–79, 2017a.
|
| 218 |
+
|
| 219 |
+
Michael E. Houle. Local intrinsic dimensionality II: multivariate analysis and distributional support. In SISAP, pp. 80–95, 2017b.
|
| 220 |
+
|
| 221 |
+
Michael E. Houle, Hisashi Kashima, and Michael Nett. Generalized expansion dimension. In ICDMW, pp. 587–594, 2012.
|
| 222 |
+
|
| 223 |
+
David R. Karger and Matthias Ruhl. Finding nearest neighbors in growth-restricted metrics. In STOC, pp. 741–750. ACM, 2002.
|
| 224 |
+
|
| 225 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. 2009.
|
| 226 |
+
|
| 227 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, pp. 1097–1105, 2012.
|
| 228 |
+
|
| 229 |
+
Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. arXiv preprint arXiv:1607.02533, 2016.
|
| 230 |
+
|
| 231 |
+
Yann LeCun, Bernhard E Boser, John S Denker, Donnie Henderson, Richard E Howard, Wayne E Hubbard, and Lawrence D Jackel. Handwritten digit recognition with a back-propagation network. In Advances in neural information processing systems, pp. 396–404, 1990.
|
| 232 |
+
|
| 233 |
+
Bo Li and Yevgeniy Vorobeychik. Feature cross-substitution in adversarial classification. In Advances in neural information processing systems, pp. 2087–2095, 2014.
|
| 234 |
+
|
| 235 |
+
Bo Li and Yevgeniy Vorobeychik. Scalable optimization of randomized operational decisions in adversarial classification settings. In Artificial Intelligence and Statistics, pp. 599–607, 2015.
|
| 236 |
+
|
| 237 |
+
Xin Li and Fuxin Li. Adversarial examples detection in deep networks with convolutional filter statistics. arXiv preprint arXiv:1612.07767, 2016.
|
| 238 |
+
|
| 239 |
+
Yanpei Liu, Xinyun Chen, Chang Liu, and Dawn Song. Delving into transferable adversarial examples and black-box attacks. arXiv preprint arXiv:1611.02770, 2016.
|
| 240 |
+
|
| 241 |
+
Jan Hendrik Metzen, Tim Genewein, Volker Fischer, and Bastian Bischoff. On detecting adversarial perturbations. arXiv preprint arXiv:1702.04267, 2017.
|
| 242 |
+
|
| 243 |
+
Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. In NIPS workshop on deep learning and unsupervised feature learning, volume 2011, pp. 5, 2011.
|
| 244 |
+
|
| 245 |
+
Anh Nguyen, Jason Yosinski, and Jeff Clune. Deep neural networks are easily fooled: High confidence predictions for unrecognizable images. In CVPR, pp. 427–436, 2015.
|
| 246 |
+
|
| 247 |
+
Nicolas Papernot, Ian Goodfellow, Ryan Sheatsley, Reuben Feinman, and Patrick McDaniel. cleverhans v1. 0.0: an adversarial machine learning library. arXiv preprint arXiv:1610.00768, 2016a.
|
| 248 |
+
|
| 249 |
+
Nicolas Papernot, Patrick McDaniel, and Ian Goodfellow. Transferability in machine learning: from phenomena to black-box attacks using adversarial samples. arXiv preprint arXiv:1605.07277, 2016b.
|
| 250 |
+
|
| 251 |
+
Nicolas Papernot, Patrick McDaniel, Somesh Jha, Matt Fredrikson, Z. Berkay Celik, and Ananthram Swami. The limitations of deep learning in adversarial settings. In EuroS&P, pp. 372–387, 2016c.
|
| 252 |
+
|
| 253 |
+
Nicolas Papernot, Patrick McDaniel, Xi Wu, Somesh Jha, and Ananthram Swami. Distillation as a defense to adversarial perturbations against deep neural networks. In S&P, pp. 582–597, 2016d.
|
| 254 |
+
|
| 255 |
+
Bita Darvish Rouhani, Mohammad Samragh, Tara Javidi, and Farinaz Koushanfar. Curtail: Characterizing and thwarting adversarial deep learning. arXiv preprint arXiv:1709.02538, 2017.
|
| 256 |
+
|
| 257 |
+
Bita Darvish Rouhani, Mohammad Samragh, Tara Javidi, and Farinaz Koushanfar. Towards safe deep learning: Unsupervised defense against generic adversarial attacks, 2018.
|
| 258 |
+
|
| 259 |
+
Mahmood Sharif, Sruti Bhagavatula, Lujo Bauer, and Michael K Reiter. Accessorize to a crime: Real and stealthy attacks on state-of-the-art face recognition. In Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, pp. 1528–1540, 2016.
|
| 260 |
+
|
| 261 |
+
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.
|
| 262 |
+
|
| 263 |
+
Thomas Tanay and Lewis Griffin. A boundary tilting persepective on the phenomenon of adversarial examples. arXiv preprint arXiv:1608.07690, 2016.
|
| 264 |
+
|
| 265 |
+
Florian Tramer, Nicolas Papernot, Ian Goodfellow, Dan Boneh, and Patrick McDaniel. The space \` of transferable adversarial examples. arXiv preprint arXiv:1704.03453, 2017.
|
| 266 |
+
|
| 267 |
+
David Warde-Farley, Ian Goodfellow, T. Hazan, G. Papandreou, and D. Tarlow. Adversarial perturbations of deep neural networks. Perturbations, Optimization, and Statistics, pp. 1–32, 2016.
|
| 268 |
+
|
| 269 |
+
Weilin Xu, David Evans, and Yanjun Qi. Feature squeezing: Detecting adversarial examples in deep neural networks. arXiv preprint arXiv:1704.01155, 2017.
|
| 270 |
+
|
| 271 |
+
# A APPENDIX
|
| 272 |
+
|
| 273 |
+
# A.1 STATISTICS OF ADVERSARIAL ATTACK STRATEGIES
|
| 274 |
+
|
| 275 |
+
Table 4: The $L _ { 2 }$ mean perturbation and model accuracy $( \% )$ on adversarial examples.
|
| 276 |
+
|
| 277 |
+
<table><tr><td rowspan="2"></td><td colspan="2">MNIST</td><td colspan="2">CIFAR</td><td colspan="2">SVHN</td></tr><tr><td>L2</td><td>Acc.</td><td>L2</td><td>Acc.</td><td>L2</td><td>Acc.</td></tr><tr><td>FGM</td><td>6.26</td><td>11.09</td><td>2.74</td><td>3.15</td><td>7.09</td><td>6.17</td></tr><tr><td>BIM-a</td><td>2.30</td><td>10.43</td><td>0.48</td><td>0.00</td><td>0.83</td><td>0.13</td></tr><tr><td>BIM-b</td><td>5.42</td><td>10.42</td><td>3.39</td><td>0.00</td><td>5.53</td><td>0.13</td></tr><tr><td>JSMA</td><td>5.40</td><td>10.00</td><td>3.64</td><td>0.04</td><td>3.09</td><td>0.16</td></tr><tr><td>Opt</td><td>4.21</td><td>3.92</td><td>0.37</td><td>0.01</td><td>0.59</td><td>0.26</td></tr></table>
|
| 278 |
+
|
| 279 |
+
# A.2 LID CHARACTERISTICS OF ADVERSARIAL EXAMPLES
|
| 280 |
+
|
| 281 |
+
Figure 4 illustrates LID characteristics of the most effective attack strategy known to date, Opt, on the MNIST and SVHN datasets. On both datasets, the LID scores of adversarial examples are significantly higher than those of normal or noisy examples. In the right-hand plot, the LID scores of normal examples and its noisy counterparts appear superimposed due to their similarities.
|
| 282 |
+
|
| 283 |
+

|
| 284 |
+
Figure 4: The plots show the normalized LID scores of 100 randomly selected normal (blue), noisy (green) and Opt attack (red $\mathbf { X }$ -cross) examples. The noisy and adversarial examples were generated from the normal examples. The left-hand plot shows the scores (at the pre-softmax layer) of MNIST examples, while the right-hand plot shows LID scores (at the softmax layer) of SVHN examples. Normal and noisy example curves appear superimposed in the right-hand figure due to the similarity of their values.
|
| 285 |
+
|
| 286 |
+
Figure 5 shows the discrimination power (detection AUC) of LID characteristics estimated using two different minibatch sizes: the default setting of 100, and a larger size of 1000. The horizontal axis represents different choices of the neighborhood size $k$ , from $\bar { 1 } 0 \%$ to $9 0 \%$ percent to the batch size. We note that the peak AUC is higher for the larger minibatch size.
|
| 287 |
+
|
| 288 |
+

|
| 289 |
+
Figure 5: The detection AUC score of LID estimated using different neighborhood sizes $k$ with a larger minibatch size of 1000. The results are shown for the detection of Opt attacks on the MNIST, CIFAR-10 and SVHN datasets.
|
md/train/B1lda1HtvB/B1lda1HtvB.md
ADDED
|
@@ -0,0 +1,600 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FEATURE SELECTION USING STOCHASTIC GATES
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Feature selection problems have been extensively studied in the setting of linear estimation, for instance LASSO, but less emphasis has been placed on feature selection for non-linear functions. In this study, we propose a method for feature selection in non-linear function estimation problems. The new procedure is based on directly penalizing the $\ell _ { 0 }$ norm of features, or the count of the number of selected features. Our $\ell _ { 0 }$ based regularization relies on a continuous relaxation of the Bernoulli distribution, which allows our model to learn the parameters of the approximate Bernoulli distributions via gradient descent. The proposed framework simultaneously learns a non-linear regression or classification function while selecting a small subset of features. We provide an information-theoretic justification for incorporating Bernoulli distribution into our approach. Furthermore, we evaluate our method using synthetic and real-life data and demonstrate that our approach outperforms other embedded methods in terms of predictive performance and feature selection.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Feature selection is a fundamental task in machine learning and statistics. Feature selection leads to a number of potential benefits: reducing experimental costs Min et al. (2014), enhancing interpretability (Ribeiro et al., 2016), computational speed up and even improving model generalization on unseen data (Chandrashekar & Sahin, 2014). In biomedicine, scientists collect multitude datasets comprising of many biomarkers (e.g., genes or proteins) that require development of effective diagnostics or prognostics models. For instance, in Genome wide association studies (GWAS), feature selection can help identify such models and lead to improved risk assessment and reduced cost.
|
| 12 |
+
|
| 13 |
+
Feature selection methods may be classified into three major categories: filter methods, wrapper methods, and embedded methods. Filter methods attempt to remove irrelevant features prior to learning a model. These methods filter features using a per-feature relevance score that is created based on some statistical measure (Battiti, 1994; Peng et al., 2005; Estévez et al., 2009; Song et al., 2007; 2012; Chen et al., 2017). Wrapper methods (Kohavi & John, 1997b; Stein et al., 2005; Zhu et al., 2007; Reunanen, 2003; Allen, 2013) use the outcome of a classifier to determine the relevance of each feature, which requires recomputing the classifier for each subset of features. This becomes computationally expensive for neural network based wrapper methods (Verikas & Bacauskiene, 2002; Kabir et al., 2010; Roy et al., 2015).
|
| 14 |
+
|
| 15 |
+
Embedded methods aim to remove this burden by learning the model while simultaneously selecting the subset of relevant features. The Least Absolute Shrinkage and Selection Operator (LASSO) (Tibshirani, 1996) is a well-known embedded method, whose objective is to minimize the loss while enforcing an $\ell _ { 1 }$ constraint on the weights of the features. Although LASSO is scalable and widely used (Hans, 2009; Li et al., 2011; 2006), it is restricted to the domain of linear functions. To allow the model to capture nonlinear interaction, it is appealing to consider the non-convex extension of the LASSO formulation using neural networks.
|
| 16 |
+
|
| 17 |
+
We develop a fully embedded feature selection method for nonlinear models. To the best of our knowledge it is the first $\ell _ { 0 }$ embedded feature selection method. Our method improves upon the LASSO formulation in two aspects: a) it captures nonlinear interactions between the features via neural network modeling and b) it employs an $\ell _ { 0 }$ -like regularization using gates whose weights are parametrized by a smooth variant of a Bernoulli distribution. Altogether these twofold improvements are formulated as a fully differentiable neural network. Specifically, our contributions are as follows:
|
| 18 |
+
|
| 19 |
+
1. By utilizing a recent development of continuous and differentiable approximation to discrete distributions (Maddison et al., 2016), (Jang et al., 2017), (Louizos et al., 2017), we introduce a solution to the long standing problem of feature selection with an $\ell _ { 0 }$ regularization.
|
| 20 |
+
2. We present a novel simple relaxation of Bernoulli distribution to sparsify the input layer (the feature space) which we call stochastic gate (STG) and show its advantage over the distribution presented by (Louizos et al., 2017) both in performance and convergence time.
|
| 21 |
+
3. By applying these two relaxations to an input layer of a neural network, we perform embedded feature selection in classification, regression or survival analysis tasks and demonstrate its capabilities on artificial and real data sets.
|
| 22 |
+
4. We justify our probabilistic approach by analyzing the constrained Mutual Information maximization objective of feature selection. We demonstrate the applicability of our method using numerous examples (see Section 6 and Appendix).
|
| 23 |
+
|
| 24 |
+
Notation: We refer to vectors as bold lowercase $_ { \textbf { \em x } }$ and random vectors as bold uppercase letters $\boldsymbol { X }$ . Scalars are non-bold case $y$ , while random variables are capital case $Y$ . A set is represented by script fonts $\mathcal { X } , \mathcal { Y } , \mathcal { S }$ . For example the $n ^ { t h }$ vector-valued observation is denoted as ${ \mathbf { \mathcal { x } } } _ { n }$ whereas $X _ { d }$ represents the $d ^ { t h }$ feature of the vector-valued random variable $\boldsymbol { X }$ . Let $[ n ] = 1 , 2 , \ldots , n$ . For a set $\bar { \mathcal { S } } \bar { \subset } [ D ]$ let the vector $\pmb { s } \in \{ 0 , 1 \} ^ { D }$ be the characteristic function for the set. That is $s _ { i } = 1$ if $i \in S$ and 0 otherwise. For two vectors $_ { \textbf { \em x } }$ and $_ { z }$ we denote $\pmb { x } \odot z$ to be the element-wise product between $_ { \textbf { \em x } }$ and $_ z$ . Thus, if we let $\pmb { s } \in \{ 0 , 1 \} ^ { D }$ be the characteristic vector of $s$ , then we may define $\mathbf { \Delta } \mathbf { x } _ { S } = \mathbf { \Delta } \mathbf { x } \odot \mathbf { \Delta } \mathbf { s }$ The $\ell _ { 1 }$ norm of a vector is denoted as $\begin{array} { r } { \| \pmb { x } \| _ { 1 } = \sum _ { i = 1 } ^ { D } | x _ { i } | } \end{array}$ . Finally, the $\ell _ { 0 }$ norm of a vector is denoted as $\| \pmb { x } \| _ { 0 }$ and counts the total number of non-zero entries in the vector $_ { \textbf { \em x } }$ .
|
| 25 |
+
|
| 26 |
+
# 2 PROBLEM SETUP AND BACKGROUND
|
| 27 |
+
|
| 28 |
+
Let $\boldsymbol { \mathcal { X } } ~ \in ~ \mathbb { R } ^ { D }$ be the input domain with corresponding response domain $\mathcal { V }$ . Given realizations from some unknown data distribution $P _ { X , Y }$ , the goal of embedded feature selection methods is to simultaneously find a subset of indices $\mathcal { S } \subset \{ 1 , . . . D \}$ and construct a model that predicts $Y$ based on the selected features $X _ { \mathcal { S } }$ .
|
| 29 |
+
|
| 30 |
+
# 2.1 RISK MINIMIZATION OBJECTIVE
|
| 31 |
+
|
| 32 |
+
We assume that we are given a family of functions $\mathcal { F }$ such that any function $f _ { \pmb { \theta } } \in \mathcal { F }$ is indexed by a set of parameters $\pmb \theta$ . Given some loss $L$ , a selection of features $s \subset [ D ]$ , and a choice of parameters $\pmb \theta$ , we denote the risk of our model as
|
| 33 |
+
|
| 34 |
+
$$
|
| 35 |
+
R ( \pmb \theta , \pmb s ) = \mathbb { E } _ { X , Y } L ( f _ { \boldsymbol \theta } ( \pmb X \odot \pmb s ) , Y ) ,
|
| 36 |
+
$$
|
| 37 |
+
|
| 38 |
+
where we recall that $\pmb { s } = \{ 0 , 1 \} ^ { D }$ is a vector of indicator variables for the set $s$ and $\odot$ denotes the point-wise product. Thus, the goal of the feature selection problem is to find the parameters $\pmb \theta$ and $\pmb { s }$ that minimize $R ( \pmb \theta , s )$ such that $\| s \| _ { 0 }$ is small compared to $D$ .
|
| 39 |
+
|
| 40 |
+
# 2.2 FEATURE SELECTION FOR LINEAR MODELS
|
| 41 |
+
|
| 42 |
+
Before proceeding with our proposed method, we review the feature selection problem in the linear regression setting with the least squares loss. Thus, we restrict $\mathcal { F }$ to be the space of linear functions and the loss function to be the quadratic loss.
|
| 43 |
+
|
| 44 |
+
Given observations $\{ x _ { n } , y _ { n } \} _ { n = 1 } ^ { N }$ we may consider the constrained empirical risk minimization problem
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
\operatorname* { m i n } _ { \pmb { \theta } } \frac { 1 } { N } \sum _ { n = 1 } ^ { N } L ( \pmb { \theta } ^ { T } \pmb { x } _ { n } , y _ { n } ) \quad \mathrm { s . t . } \ \| \pmb { \theta } \| _ { 0 } \leq k .
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
Since the above problem is intractable, a number of authors replace the $\ell _ { 0 }$ constraint with a surrogate function $\Omega ( \pmb \theta ) : \dot { \mathbb { R } } ^ { D } \mathbb { R } _ { + }$ designed to penalize the number of selected features in $\pmb \theta$ . A natural choice for $\Omega$ is the $\ell _ { 1 }$ norm, which yields a convex problem and more precisely the LASSO optimization problem. The $\ell _ { 1 }$ is known to be the closest convex relaxation to the $\ell _ { 0 }$ . In fact, in certain settings the
|
| 51 |
+
|
| 52 |
+
LASSO optimization and the $\ell _ { 0 }$ based objective have the same solution. While the original LASSO problem focuses on the constrained optimization problem, the regularized least squares problem, which is often used in practice, yields the following minimization objective:
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\operatorname* { m i n } _ { \pmb { \theta } } \frac { 1 } { N } \sum _ { n = 1 } ^ { N } ( \pmb { \theta } ^ { T } \pmb { x } _ { n } - \pmb { y } _ { n } ) ^ { 2 } + \lambda \| \pmb { \theta } \| _ { 1 } .
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
The hyperparameter $\lambda$ trades off the amount of regularization versus the fit of the objective1. The $\ell _ { 1 }$ regularized method is very effective for feature selection and prediction; however, it achieves this through shrinkage of the coefficients. As a result, (Fan & Li, 2001) have considered non-convex choices for $\Omega$ that perform well both theoretically and empirically for prediction and feature selection.
|
| 59 |
+
|
| 60 |
+
Our goal is to apply such regularization techniques to perform feature selection while learning a non-linear function. Kernel methods have been considered (Yamada et al., 2014), but scale quadratically in the number of observations. To alleviate this burden, (Gregorová et al., 2018) use random Fourier features to approximate the kernel. (Li et al., 2016) and (Scardapane et al., 2017) take an alternative approach by modeling $f _ { \theta }$ using a neural network with $\ell _ { 1 }$ regularization on the input weights. However, in practice, introducing an $\ell _ { 1 }$ penalty into gradient descent does not provide sufficient sparsification. Below, we discuss our method that works to directly use an $\ell _ { 0 }$ penalty.
|
| 61 |
+
|
| 62 |
+
# 3 PROPOSED METHOD
|
| 63 |
+
|
| 64 |
+
We take a probabilistic approach to approximate the $\ell _ { 0 }$ norm, which can extend to non-linear models while remaining computationally efficient. To motivate such probabilistic approach, we provide theoretical support (see Section 4) based on a Mutual Information perspective of the feature selection problem.
|
| 65 |
+
|
| 66 |
+
To view the $\ell _ { 0 }$ regularized version of the risk (Eq. 1) from a probabilistic perspective, one can introduce a Bernoulli random vector $\tilde { S }$ whose entries are independent and the $d ^ { t h }$ entry satisfies $\pi _ { d } = \mathbb { P } ( \tilde { S } _ { d } = 1 )$ for $d \in [ D ]$ . If we denote the empirical expectation over our observations as $\hat { \mathbb { E } } _ { X , Y }$ , then, the empirical regularized risk (Eq. 1) becomes
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\operatorname* { m i n } _ { \theta , \pi } \hat { R } ( \theta , \pi ) = \operatorname* { m i n } _ { \theta , \pi } \hat { \mathbb { E } } _ { X , Y } \mathbb { E } _ { \tilde { S } } \left[ L ( f _ { \theta } ( X \odot \tilde { S } ) , Y ) + \lambda | | \tilde { S } | | _ { 0 } \right] ,
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
where we have $\mathbb { E } _ { \tilde { S } } | | \tilde { S } | | _ { 0 } = \sum _ { d = 1 } ^ { D } \pi _ { d }$ and we constrain $\pi _ { d } \in \{ 0 , 1 \}$ . Clearly, this formulation is equivalent to Eq. 1, with a regularized penalty on cardinality rather than an explicit constraint. We may then relax the discrete constraint on $\pi _ { d }$ to be $\pi _ { d } \in [ 0 , 1 ]$ .
|
| 73 |
+
|
| 74 |
+
Now, our goal is to find the model parameters $\pmb { \theta } ^ { * }$ and Bernoulli parameters $\pi ^ { * }$ that minimize the empirical risk $\hat { R } ( \pmb \theta , \pmb \pi )$ via gradient descent. However, an optimization of a loss function which includes discrete random variables suffers from high variance (see F in the Appendix for more details). Therefore, inspired by a recently developed continuous approximation for discrete random variables, suggested by (Jang et al., 2017; Maddison et al., 2016), we develop and use a novel and simple continuous distribution that is fully differentiable and suited for the task of feature selection.
|
| 75 |
+
|
| 76 |
+
# 3.1 CONTINUOUS RELAXATION
|
| 77 |
+
|
| 78 |
+
Our continuous relaxation for the Bernoulli variables ${ \cal \tilde { S } } _ { d }$ for $d \in \ [ D ]$ is termed stochastic gate (STG). The STG relies on the reparametrization trick, which is widely used for reducing the variance of gradient estimators (Miller et al., 2017; Figurnov et al., 2018). To construct a continuous approximation to Bernoulli random variable via the reparametrization trick, we define $z _ { d } = g ( \mu _ { d } + \epsilon _ { d } ) = \operatorname* { m a x } ( 0 , \operatorname* { m i n } ( 1 , \epsilon _ { d } + \mu _ { d } + 0 . 5 ) )$ where $\epsilon _ { d }$ is drawn from a Gaussian distribution $\mathcal { N } ( 0 , \sigma _ { d } )$ , where $\sigma _ { d }$ is fixed throughout training. This approximation can be viewed as a clipped, mean-shifted, Gaussian random vector. Furthermore, the gradient of the objective with respect to $\mu _ { d }$ can be computed via the chain rule.
|
| 79 |
+
|
| 80 |
+
We can now rewrite the objective in Eq. 4 as
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\operatorname* { m i n } _ { \theta , \mu } \hat { R } ( \theta , \mu ) = \operatorname* { m i n } _ { \theta , \mu } \mathbb { E } _ { X , Y } \mathbb { E } _ { Z } \left[ L ( f _ { \theta } ( X \odot Z ) , Y ) + \lambda | | Z | | _ { 0 } \right] ,
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
where $z$ is a random vector with $D$ independent variables $z _ { d }$ for $[ D ]$ . To optimize the empirical surrogate of the objective (Eq. 5), we first differentiate it with respect to $\pmb { \mu }$ . Then, Monte Carlo sampling leads us to the following gradient estimator
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\frac { \partial } { \partial \mu _ { d } } \hat { R } ( \pmb \theta , \mu ) = \frac { 1 } { K } \sum _ { k = 1 } ^ { K } \bigg [ L ^ { \prime } ( z ^ { k } ) \frac { \partial z _ { d } ^ { k } } { \partial \mu _ { d } } \bigg ] + \frac { \lambda } { K } \frac { \partial } { \partial \mu _ { d } } \sum _ { k = 1 } ^ { K } \mathrm { P r } \{ z _ { d } ^ { k } > 0 \} ,
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
where $K$ is the number of Monte Carlo samples. Thus, we can update the parameters $\mu _ { d }$ for $[ D ]$ via gradient descent. We note that if we replace $\frac { \partial { z } _ { d } ^ { k } } { \partial { \mu } _ { d } }$ with 1, the above gradient estimator for $L ^ { \prime }$ is reduced to the Straight-Through estimator (Bengio et al., 2013).
|
| 93 |
+
|
| 94 |
+
Under the continuous relaxation, the expected regularization term in the objective $\hat { R } ( \pmb \theta , \pmb \mu )$ is simply the sum of the probability that the gates $\{ z _ { d } \} _ { d = 1 } ^ { D }$ are active, which is equal to $\begin{array} { r } { \sum _ { d = 1 } ^ { D } \Phi \left( \frac { \mu _ { d } + \frac { 1 } { 2 } } { \sigma _ { d } } \right) } \end{array}$ where $\Phi$ is the standard Gaussian CDF. To conclude, we can now optimize the objective in Eq. 5 using gradient descent over the model parameters $\pmb \theta$ and the parameters $\pmb { \mu }$ representing the Gaussian’s mean (instead of the Bernoulli parameters $\pi$ ).
|
| 95 |
+
|
| 96 |
+
After training, to remove the stochasticity from the learned gates, we set $\hat { z } _ { d } = \operatorname* { m a x } _ { \mathbf { \alpha } } ( 0 , \operatorname* { m i n } ( 1 , \mu _ { d } +$ 0.5)), which informs what features are selected. Note that when $\left| \mu _ { d } \right|$ is less than $\begin{array} { l } { { \frac { 1 } { 2 } } } \end{array}$ , $\hat { z } _ { d }$ returns the value between $( 0 , 1 )$ . In such a case, we can treat the value of $\hat { z } _ { d }$ as feature importance or employ an additional thresholding (i.e. 1 if $\hat { z } _ { d } > 0 . 5$ and 0 otherwise) depending on application-specific needs. In the Appendix, we provide the pseudo-code of our algorithm as well as the discussion of the choice of $\sigma _ { d }$ .
|
| 97 |
+
|
| 98 |
+
# 4 CONNECTION TO MUTUAL INFORMATION
|
| 99 |
+
|
| 100 |
+
In this section we show an equivalence between the Bernoulli formulation of the feature selection problem and the $\ell _ { 0 }$ regularized approach.
|
| 101 |
+
|
| 102 |
+
# 4.1 MUTUAL INFORMATION BASED OBJECTIVE
|
| 103 |
+
|
| 104 |
+
From an information theoretic perspective, the goal of feature selection is to find a subset of features $s$ that has the highest Mutual Information (MI) with the target variable $Y$ . Recall that the MI between two random variables can be defined as $I ( X ; Y ) = H ( Y ) - H ( Y | X )$ where $H ( Y ) , H ( Y | X )$ are the entropy of $p _ { Y } ( Y )$ and the conditional entropy of $p _ { Y | \mathbf { X } } ( Y | X )$ , respectively (Cover & Thomas, 2006). Then we can formulate the task as selecting $s$ such that the mutual information between $X _ { \mathcal { S } }$ and $Y$ are maximized:
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
\operatorname* { m a x } _ { s } I ( X _ { s } , Y ) \quad { \mathrm { s . t . ~ } } | S | = k ,
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
where $k$ is the hypothesised number of relevant features.
|
| 111 |
+
|
| 112 |
+
# 4.2 INTRODUCING RANDOMNESS
|
| 113 |
+
|
| 114 |
+
We first demonstrate that under mild assumptions we can replace the deterministic search over the set $s$ (or corresponding indicator vector $\pmb { s }$ ), by a search over the parameters of the distributions that model $\pmb { s }$ . Our proposition is based on the following two assumptions:
|
| 115 |
+
|
| 116 |
+
Assumption 1: There exists a subset of indices ${ \boldsymbol { S } } ^ { * }$ with cardinality equal to $k$ such that for any $i \in S ^ { * }$ we have $I ( X _ { i } ; Y | { \cal { X } } _ { \backslash \{ i \} } ) > 0$ .
|
| 117 |
+
Assumption 2: $I ( X _ { \cal S ^ { * c } } ; Y | X _ { \cal S ^ { * } } ) = 0$ .
|
| 118 |
+
|
| 119 |
+
Discussion of assumptions: Assumption 1 that including an element from $S ^ { * }$ improves prediction accuracy. This assumption is equivalent to stating that feature $i$ is strongly relevant (Kohavi & John, 1997a; Brown et al., 2012). Assumption 2 simply states that $S ^ { * }$ is a superset of the Markov Blanket of the variable $Y$ (Brown et al., 2012). The assumptions are quite benign. For instance they are satisfied if $\boldsymbol { X }$ is drawn from a Gaussian with a non-degenerate covariance matrix and $Y = f ( X _ { \mathcal { S } ^ { * } } ) + w$ where $w$ is noise independent of $\boldsymbol { X }$ and $f$ is not degenerate. With these assumptions in hand, we may present our result.
|
| 120 |
+
|
| 121 |
+
Proposition 1. Suppose that the above assumptions hold for the model. Then, solving the optimization in Eq. 6 is equivalent to solving the optimization
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
\operatorname* { m a x } _ { \mathbf { 0 } \leq \pi \leq 1 } I ( X \odot \tilde { S } ; Y ) \quad s . t . \quad \sum _ { i } \mathbb { E } [ \tilde { S } _ { i } ] \leq k ,
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
where the coordinates $\tilde { S } _ { i }$ are drawn independently at random according to a Bernoulli distribution with parameter $\pi _ { i }$ .
|
| 128 |
+
|
| 129 |
+
Due to length constraints, we leave the proof of this proposition and how it bridges the MI maximization (Eq. 6) and risk minimization (Eq. 2) to the Appendix (see Section C and D).
|
| 130 |
+
|
| 131 |
+
# 5 RELATED WORK
|
| 132 |
+
|
| 133 |
+
The two most related works to this study are (Louizos et al., 2017) and (Chen et al., 2018). In (Louizos et al., 2017), they introduce the Hard-Concrete (HC) distribution as a continuous surrogate for Bernoulli distributions in the context of model compression. The HC distribution is induced by applying a hard sigmoid $z = \operatorname* { m i n } ( 1 , \operatorname* { m a x } ( 0 , \bar { s } ) )$ to $\bar { s }$ , where we construct $\bar { s }$ by applying Sigmoid function to the logistic distribution as follows:
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
u \sim U ( 0 , 1 ) , L = \log ( u ) - \log ( 1 - u ) , s = \frac { 1 } { 1 + \exp ( \frac { - ( \log \alpha + L ) } { \beta } ) } , \bar { s } = s ( \zeta - \tau ) + \tau
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
The interval $( \tau , \zeta )$ , with $\tau < 0$ and $\zeta > 1$ , allows the distribution to have more probability mass on the edge of the support. The authors demonstrate how incorporating the HC in deep neural networks leads to fast convergence and improved generalization due to the sparsification effect. In this study, we introduce this type of sparsification for the long standing problem of feature selection with $\ell _ { 0 }$ regularization.We demonstrate that a simple relaxation of Bernoulli distributions is sufficient and works better than the HC distribution for feature selection. We find empirically that the HC yields high variance gradient estimates compared to the STG. This high-variance does not affect model sparsification as the sparsity pattern does not matter. Contrarily, for feature selection it is crucial as practitioners require a stable procedure. Furthermore, higher variance gradients will result in a slower convergence of the model (this has been demonstrated empirically in the supp. material). In (Chen et al., 2018), the Gumbel-softmax trick is used to develop a framework for interpreting pre-trained models. Their method is focused on finding a subset of features given a particular instance, and therefore is not appropriate for general feature selection.
|
| 140 |
+
|
| 141 |
+
Some studies tackle embedded feature selection problems by extending LASSO and group LASSO to neural network models. The authors (Li et al., 2016; Scardapane et al., 2017) and (Feng & Simon, 2017) have a similar goal as ours in performing feature selection, but instead rely on the $\ell _ { 1 }$ relaxation to the $\ell _ { 0 }$ . Our approach, which utilizes stochastic gates coupled with the $\ell _ { 0 }$ norm achieves substantially better empirical performance compared against other $\ell _ { 1 }$ based baselines. This point is demonstrated in the next section.
|
| 142 |
+
|
| 143 |
+
# 6 EXPERIMENTS
|
| 144 |
+
|
| 145 |
+
Here we provide empirical evaluation of our method in a wide range of settings. We begin with simple linear regression evaluating the capabilities of our approach to select a sparse set of relevant features (section 6.1). We then evaluate our method in nonlinear regression tasks (section 6.2). Next, we demonstrate the applicability of the method in a highly nonlinear classification task (section 6.3. Finally, we present two potential applications (section 7).
|
| 146 |
+
|
| 147 |
+
We implement our method using both the STG and HC distributions and compare their applicability for feature selection. The hyperparamters of all the methods are optimized using validation sets via Optuna (Takuya Akiba & Koyama, 2019). In the Appendix, we provide all details of the Optuna based parameter tuning procedure. Additional experiments also appear in the Appendix, including high dimensional datasets and an extensive comparisons between the STG and HC (Louizos et al., 2017) distributions.
|
| 148 |
+
|
| 149 |
+
# 6.1 SUPPORT RECOVERY IN LINEAR REGRESSION
|
| 150 |
+
|
| 151 |
+
In the setting of noisy linear regression, (Wainwright, 2009) have analyzed the probability of LASSO to correctly identify a sparse subset of active variables. The problem is know as support recovery and is formulated as follows; let $\beta ^ { * } \in \mathbb { R } ^ { D }$ be a fixed sparse vector, such that $\beta _ { i } ^ { * } \in \{ - \overline { { 0 . 5 } } , 0 . 5 \}$ (with equal probability) if $i \in S$ , and $\beta _ { i } ^ { * } = 0$ otherwise. Suppose the cardinality of the support $| S | = k$ is known. Given a matrix of measurements $\pmb { X } \in \mathbb { R } ^ { N \times D }$ with values drawn independently from $N ( 0 , 1 )$ , the response $\textbf { { y } }$ is defined as
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
\pmb { y } = \pmb { X } \beta ^ { * } + \pmb { w } ,
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
where the values of the noise $\pmb { w } _ { i } , i = 1 , . . . , N$ are drawn independently from $N ( 0 , 0 . 5 )$
|
| 158 |
+
|
| 159 |
+
Here, we reproduce this setting to evaluate the probability of the proposed approach to perfectly recover the support of $\beta ^ { * }$ . As suggested by (Wainwright, 2009), we use a sparsity that scales with $D$ such that $k = \lceil 0 . 4 D ^ { 0 . 7 5 } \rceil$ . For each number of samples $N$ in the range [10, 500], we run 200 simulations and count the portion of correctly recovered supports. We repeat this process for 2 different values of $D$ and compare our performance to LASSO. For LASSO, the regularization parameter was set to its optimal value $\begin{array} { r } { \alpha _ { N } = \sqrt { \frac { 2 \sigma ^ { 2 } \log ( D - k ) \log ( k ) } { N } } } \end{array}$ (Wainwright, 2009). For STG and HC we set $\lambda _ { N } = C \alpha _ { N }$ , such that $C$ is a constant, which is selected using a grid search in the range [0.1,10]. As evident from Fig. 1, even when restricting to linear functions our method has a clear advantage over LASSO. This implies that the $\ell _ { 0 }$ based penalty, although is non convex in nature, allows perfect recovery of the support using less samples. Furthermore, the proposed STG requires even less samples than the HC distribution and suffers from a smaller variance.
|
| 160 |
+
|
| 161 |
+

|
| 162 |
+
Figure 1: Probability of successfully recovering the support of a sparse signal $\boldsymbol { \beta } ^ { * } \in \mathbb { R } ^ { D }$ vs. the number of observations $N$ . Comparison between the proposed method, HC and LASSO under a linear additive noise model $\pmb { y } = \pmb { X } \beta ^ { * } + \pmb { w }$ using (a) $D = 6 4$ and (b) $D = 1 2 8$ . Central lines are the means while shaded are represent the standard deviation.
|
| 163 |
+
|
| 164 |
+
# 6.2 NONLINEAR REGRESSION USING SYNTHETIC AND REAL DATASETS
|
| 165 |
+
|
| 166 |
+
In this section, we evaluate our method for regression tasks against two other embedded feature selection methods: LASSO and Sparse Random Fourier Features (Gregorová et al., 2018). Following the same format as (Gregorová et al., 2018), the following functions are used to generate synthetic data: (SE1: 100/5) $y = \sin { ( x _ { 1 } + x _ { 3 } ) ^ { 2 } } \sin { ( x _ { 7 } x _ { 8 } x _ { 9 } ) } + \mathcal { N } ( 0 , 0 . 1 )$ . (SE2: 18/5) $\begin{array} { r } { y = \log ( ( \sum _ { s = 1 1 } ^ { \mathbf { \bar { 1 } } 5 } x _ { s } ) ^ { 2 } ) + } \end{array}$ $\mathcal { N } ( 0 , 0 . 1 )$ . (SE3: 1000/10) $y = 1 0 ( z _ { 1 } ^ { 2 } + z _ { 3 } ^ { 2 } ) e ^ { - 2 ( z _ { 1 } ^ { 2 } + z _ { 3 } ^ { 2 } ) } + \mathcal { N } ( 0 , 0 . 0 1 )$ , where each $x _ { i }$ is drawn from the standard Gaussian $\mathcal { N } ( 0 , 1 )$ . For (SE3), the five consecutive coordinates are generated by ${ x _ { 5 } } _ { ( j - 1 ) + i } = { z _ { j } } + \mathrm { { N } } ( 0 , 0 . 1 )$ , where $z _ { j } \sim \mathcal { N } ( 0 , 1 )$ for $i = 1 , . . . , 5$ and $j = 1 , . . . , 2 0 0$ . The numbers next to the experiment code indicate total dimensions/relevant dimensions in the feature space. We also evaluate our method using three real datasets: (RCP: 21/-), of computer systems activity, (REL 17/-) of F16 elevators and (RAI 39/-) of F16 ailernos all taken from the LIACC repository 2. For each dataset, we generate 30 different replications and randomly split the data into train, validation, and test set (see Appendix for more details). The root mean squared error on the test set averaged over 30 random replicated datasets are reported in Table 1. Our method outperforms all alternative methods for most cases. Note that (SE1) is generated using a sine function, which is in favor of the random Fourier feature based method (SRFF).
|
| 167 |
+
|
| 168 |
+
Table 1: Regression performance comparison in terms of root mean squared error. The mean and standard deviation are computed across 30 resamples. $N$ is 1000 for SE1,2,3 and 6000 for RCP. The values for LASSO and SRFF are borrowed from (Gregorová et al., 2018). DNN represents a deep neural network without feature selection.
|
| 169 |
+
|
| 170 |
+
<table><tr><td>EXP</td><td>LASSO</td><td>RF</td><td>SG-L1-NN</td><td>SRFF</td><td>DNN</td><td>HC</td><td>STG</td></tr><tr><td>SE1</td><td>0.29 (0.01)</td><td>0.30 (0.01)</td><td>0.29 (0.01)</td><td>0.27 (0.01)</td><td>0.29 (0.01)</td><td>0.29 (0.01)</td><td>0.29 (0.01)</td></tr><tr><td>SE2</td><td>2.22 (0.10)</td><td>2.34 (0.17)</td><td>2.35 (0.18)</td><td>1.60 (0.10)</td><td>2.05 (0.11)</td><td>1.19 (0.31)</td><td>0.87 (0.15)</td></tr><tr><td>SE3</td><td>0.68 (0.002)</td><td>0.50(0.01)</td><td>0.68 (0.01)</td><td>0.48 (0.03)</td><td>0.73 (0.02)</td><td>0.33 (0.05)</td><td>0.14 (0.10)</td></tr><tr><td>RCP</td><td>9.69 (0.71)</td><td>3.52 (0.12)</td><td>9.64 (0.65)</td><td>2.52 (0.18)</td><td>2.89 (0.25)</td><td>2.74 (0.75)</td><td>2.44 (0.08)</td></tr><tr><td>REL</td><td>0.47 (0.01)</td><td>0.58 (0.01)</td><td>0.44 (0.01)</td><td>0.31 (0.03)</td><td>0.61 (0.01)</td><td>0.33 (0.04)</td><td>0.27 (0.002)</td></tr><tr><td>RAI</td><td>0.43 (0.02)</td><td>0.48 (0.003)</td><td>0.47(0.002)</td><td>0.41(0.02)</td><td>0.44 (0.01)</td><td>0.41 (0.01)</td><td>0.39 (0.01)</td></tr></table>
|
| 171 |
+
|
| 172 |
+
6.3 NOISY BINARY XOR CLASSIFICATION
|
| 173 |
+
|
| 174 |
+
In the following evaluation, we consider the problem of learning a binary XOR function for classification task. The first two coordinates $x _ { 1 } , x _ { 2 }$ are drawn from a binary "fair" Bernoulli distribution. The response variable is set as an XOR of the first coordinates, such that $y = x _ { 1 } \oplus x _ { 2 }$ . The coordinates $x _ { i } , i = 3 , . . . , D$ are nuisance features, also drawn from a binary "fair" Bernoulli distribution. The number of points we generate is $N = 1 , 5 0 0$ , of which $7 0 \%$ are reserved for test and $1 0 \%$ of the remaining training set was reserved for validation. We compare the proposed method to four embedded feature selection methods (LASSO (Tibshirani, 1996), C-support vectors (SVC) (Chang & Lin, 2011), deep feature selection (DFS) (Li et al., 2016), sparse group regularized NN (SG-L1-NN) (Scardapane et al., 2017)). To provide more benchmarks, we also compare our embedded method against three wrapper methods (Extremely Randomized Trees (Tree) (Rastogi & Shim, 2000), Random Forests (RF) (Strobl et al., 2008)) and Extreme Gradient Boosting (XGBOOST) (Chen & Guestrin, 2016).
|
| 175 |
+
|
| 176 |
+
To evaluate the feature selection performance, we calculate the Informative Features Weight Ratio (IFWR). IFWR is defined as the sum of weights $W _ { d }$ over the informative features divided by the sum over all weights. In the case of binary weights the IFWR is in fact a recall measure for the relevant features (See the Appendix for more details.)
|
| 177 |
+
|
| 178 |
+
The experiment is repeated 20 times for different values of $D$ , and the average test classification accuracy and standard deviation are presented in Fig. 2(a), followed by the IFWR in Fig. 2(b). The number of selected features affects the accuracy. Therefore, to treat all the methods in a fair manner, we tune the hyperparameter that controls the sparsity level using Optuna (Takuya Akiba & Koyama, 2019) which optimizes the overall accuracy across different $D \mathrm { s }$ . For instance, the wrapper methods (Tree, RF and XGBOOST) has a threshold value to retain features. We retrain them using only such features whose weight is higher than the threshold. In terms of feature ranking (see Fig. 2(c), only the tree based methods and the proposed (STG and HC based) provide the optimal median rank (which is 1.5) for the two relevant features. Nonetheless, the ranking provided by STG is the most stable comparing to all the alternative methods.
|
| 179 |
+
|
| 180 |
+

|
| 181 |
+
Figure 2: (a) Classification accuracy (mean and standard deviation) vs. the number of irrelevant noisy dimension $( D )$ for the XOR problem. (b) The Informative Features Weight Ratio (IFWR), central lines are the means while shaded are represent the standard deviation. IFWR is the sum of weights $W _ { d }$ over the informative features divided by the sum over all weights. (c) Box plots for the median rank of the two informative features. Black line and dashed red represent the median and mean of each method. Optimal median rank in this experiment is 1.5.
|
| 182 |
+
|
| 183 |
+
# 7 APPLICATION
|
| 184 |
+
|
| 185 |
+
# 7.1 PURIFIED POPULATIONS OF PERIPHERAL BLOOD MONOCYTES (PBMCS)
|
| 186 |
+
|
| 187 |
+
In (Zheng et al., 2017), the authors have subjected more than 90, 000 purified cell populations of peripheral blood monocytes (PBMCs) to Single-cell RNA sequencing (scRNA-seq) analysis. Here we use this data and focus on classifying two subpopulations of T-cells, namely Naive and regulatory T-cells. We use the proposed method to select a subset of genes for which the network discriminates between Naive and regulatory T-cells. We first filter out the genes that are lowly expressed in the cells, which leaves us with $D = 2 5 3 8$ genes (features). The total number of cells in these two classes is $N = 2 0 7 4 2$ , of which we only use $1 \bar { 0 } \%$ of the data for training. We apply the proposed method for different values of $\lambda$ and report the number of selected features and classification accuracy on the test set. Here we compare our performance (STG and HC) to RF and LASSO. A least squares polynomial fit plot of the accuracy vs. number of selected features is presented in Fig. 3. The accuracy obtained by a NN without feature selection is $9 1 . 0 9 \%$ , which is comparable to what we achieve with a small fraction of the features. We have also evaluated the performance of the Hard-Concrete applied to all layers (HC-Full), following the procedure in (Louizos et al., 2017). Empirically we observed that using this type of regularization across all layers provides inferior capabilities in terms of feature selection. Moreover, when the HC-Full converges to a larger subset of features $( d > 5 0$ ), it does not generalize at all and the test accuracy is around 0.5.
|
| 188 |
+
|
| 189 |
+
Table 2: Performance comparison of survival analysis on METABRIC. We run the same experiment 5 times with different train/test split and report the mean and the standard deviation on the test set. In (Katzman et al., 2018), it is reported that DeepSurv outperforms other existing survival analysis methods such as Random Survival Forest (RSF) (Ishwaran et al., 2008) and the original Cox Propotional Hazard Model.
|
| 190 |
+
|
| 191 |
+
<table><tr><td></td><td>DEEPSURV</td><td>RSF</td><td>CoX-LASSO</td><td>Cox-HC</td><td>CoX-STG</td></tr><tr><td>C-INDEX</td><td>0.612 (0.009)</td><td>0.626 (0.006)</td><td>0.580 (0.003)</td><td>0.636 (0.007)</td><td>0.633 (0.005)</td></tr><tr><td># FEATURES</td><td>221 (ALL)</td><td>221 (ALL)</td><td>44(0)</td><td>8 (0.89)</td><td>2(0)</td></tr></table>
|
| 192 |
+
|
| 193 |
+

|
| 194 |
+
Figure 3: Classification of T-cells sub-populations. Accuracy vs. number of features selected by each method. Comparison of the proposed method (STG and HC) to Random Forests (RF) and LASSO.
|
| 195 |
+
|
| 196 |
+
7.2 COX PROPORTIONAL HAZARD MODELS FOR SURVIVAL ANALYSIS
|
| 197 |
+
|
| 198 |
+
We incorporate our STG into DeepSurv (Katzman et al., 2018) to examine how this procedure improves survival analysis. The input to this analysis are gene expression profiles (Curtis et al., 2012) along with additional commonly used clinical variables, the goal is to predict survival time. In this setting, identifying a small subset of predictive covariates is important as it may lead to cheaper and more stable medical assays. See the Appendix for additional description of the data and the experimental setup.
|
| 199 |
+
|
| 200 |
+
We compared our method (Cox-STG and COX-HC) against three other methods: Cox model with $\ell _ { 1 }$ regularization (Cox-LASSO), Random Survival Forest (RSF) (Ishwaran et al., 2008) and the original DeepSurv. We evaluate the predictive ability of the learned models based on the concordance index (CI), a standard performance metric for model assessment in survival analysis, which measures the agreement between the rankings of the predicted and observed survival times. The performance in terms of the CI is reported in Table 2. We see that Cox-HC and Cox-STG outperform the alternative methods, indicating that our method shrinks the feature size while learning a predictive model.
|
| 201 |
+
|
| 202 |
+
# 8 CONCLUSION
|
| 203 |
+
|
| 204 |
+
In this paper, we propose a novel embedded feature selection method for neural networks and linear models based on stochastic gates. It has an advantage over previous $\ell _ { 1 }$ based regularization methods in terms of achieving a high level of sparsity while learning effective non linear models. We justify our probabilistic feature selection framework from the information theoretic perspective. In experiments, we demonstrate that our method consistently outperforms existing embedded feature selection methods in both synthetic and real datasets.
|
| 205 |
+
|
| 206 |
+
# REFERENCES
|
| 207 |
+
|
| 208 |
+
Genevera I Allen. Automatic feature selection via weighted kernels and regularization. Journal of Computational and Graphical Statistics, 22(2):284–299, 2013.
|
| 209 |
+
|
| 210 |
+
Roberto Battiti. Using mutual information for selecting features in supervised neural net learning. IEEE Transactions on neural networks, 5(4):537–550, 1994.
|
| 211 |
+
|
| 212 |
+
Yoshua Bengio, Nicholas Léonard, and Aaron C. Courville. Estimating or propagating gradients through stochastic neurons for conditional computation. CoRR, abs/1308.3432, 2013.
|
| 213 |
+
|
| 214 |
+
Gavin Brown, Adam Pocock, Ming-Jie Zhao, and Mikel Luján. Conditional likelihood maximisation: a unifying framework for information theoretic feature selection. Journal of machine learning research, 13(Jan):27–66, 2012.
|
| 215 |
+
|
| 216 |
+
Sohail Chand. On tuning parameter selection of lasso-type methods-a monte carlo study. In Proceedings of 2012 9th International Bhurban Conference on Applied Sciences & Technology (IBCAST), pp. 120–129. IEEE, 2012.
|
| 217 |
+
|
| 218 |
+
Girish Chandrashekar and Ferat Sahin. A survey on feature selection methods. Computers & Electrical Engineering, 40(1):16–28, 2014.
|
| 219 |
+
|
| 220 |
+
Chih-Chung Chang and Chih-Jen Lin. Libsvm: A library for support vector machines. ACM transactions on intelligent systems and technology (TIST), 2(3):27, 2011.
|
| 221 |
+
|
| 222 |
+
Jianbo Chen, Mitchell Stern, Martin J Wainwright, and Michael I Jordan. Kernel feature selection via conditional covariance minimization. In Advances in Neural Information Processing Systems, pp. 6946–6955, 2017.
|
| 223 |
+
|
| 224 |
+
Jianbo Chen, Le Song, Martin J Wainwright, and Michael I Jordan. Learning to explain: An information-theoretic perspective on model interpretation. arXiv preprint arXiv:1802.07814, 2018.
|
| 225 |
+
|
| 226 |
+
Tianqi Chen and Carlos Guestrin. Xgboost: A scalable tree boosting system. In Proceedings of the 22nd acm sigkdd international conference on knowledge discovery and data mining, pp. 785–794. ACM, 2016.
|
| 227 |
+
|
| 228 |
+
Tom Coen, Wouter Saeys, Herman Ramon, and Josse De Baerdemaeker. Optimizing the tuning parameters of least squares support vector machines regression for nir spectra. Journal of Chemometrics: A Journal of the Chemometrics Society, 20(5):184–192, 2006.
|
| 229 |
+
|
| 230 |
+
Thomas M. Cover and Joy A. Thomas. Elements of Information Theory (Wiley Series in Telecommunications and Signal Processing). Wiley-Interscience, New York, NY, USA, 2006. ISBN 0471241954.
|
| 231 |
+
|
| 232 |
+
Christina Curtis, Sohrab P Shah, Suet-Feung Chin, Gulisa Turashvili, Oscar M Rueda, Mark J Dunning, Doug Speed, Andy G Lynch, Shamith Samarajiwa, Yinyin Yuan, et al. The genomic and transcriptomic architecture of 2,000 breast tumours reveals novel subgroups. Nature, 486(7403): 346, 2012.
|
| 233 |
+
|
| 234 |
+
Pablo A Estévez, Michel Tesmer, Claudio A Perez, and Jacek M Zurada. Normalized mutual information feature selection. IEEE Transactions on Neural Networks, 20(2):189–201, 2009.
|
| 235 |
+
|
| 236 |
+
Jianqing Fan and Runze Li. Variable selection via nonconcave penalized likelihood and its oracle properties. Journal of the American statistical Association, 96(456):1348–1360, 2001.
|
| 237 |
+
|
| 238 |
+
Yingying Fan and Cheng Yong Tang. Tuning parameter selection in high dimensional penalized likelihood. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 75(3): 531–552, 2013.
|
| 239 |
+
|
| 240 |
+
J. Feng and N. Simon. Sparse-Input Neural Networks for High-dimensional Nonparametric Regression and Classification. ArXiv e-prints, November 2017.
|
| 241 |
+
|
| 242 |
+
Mikhail Figurnov, Shakir Mohamed, and Andriy Mnih. Implicit reparameterization gradients. In Advances in Neural Information Processing Systems, pp. 441–452, 2018.
|
| 243 |
+
|
| 244 |
+
Magda Gregorová, Jason Ramapuram, Alexandros Kalousis, and Stéphane Marchand-Maillet. Largescale nonlinear variable selection via kernel random features. arXiv preprint arXiv:1804.07169, 2018.
|
| 245 |
+
|
| 246 |
+
Chris Hans. Bayesian lasso regression. Biometrika, 96(4):835–845, 2009.
|
| 247 |
+
|
| 248 |
+
Hemant Ishwaran and Udaya B. Kogalur. Random survival forests for r, 2007.
|
| 249 |
+
|
| 250 |
+
Hemant Ishwaran, Udaya B. Kogalur, Eugene H. Blackstone, and Michael S. Lauer. Random survival forests. Annals of Applied Statistics, 2(3):841–860, 9 2008. ISSN 1932-6157. doi: 10.1214/08-AOAS169.
|
| 251 |
+
|
| 252 |
+
Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. 2017. URL https://arxiv.org/abs/1611.01144.
|
| 253 |
+
|
| 254 |
+
Md Monirul Kabir, Md Monirul Islam, and Kazuyuki Murase. A new wrapper feature selection approach using neural network. Neurocomputing, 73(16-18):3273–3283, 2010.
|
| 255 |
+
|
| 256 |
+
Jared L. Katzman, Uri Shaham, Alexander Cloninger, Jonathan Bates, Tingting Jiang, and Yuval Kluger. Deepsurv: personalized treatment recommender system using a cox proportional hazards deep neural network. BMC Medical Research Methodology, 18, 2018.
|
| 257 |
+
|
| 258 |
+
Ron Kohavi and George H John. Wrappers for feature subset selection. Artificial intelligence, 97 (1-2):273–324, 1997a.
|
| 259 |
+
|
| 260 |
+
Ron Kohavi and George H John. Wrappers for feature subset selection. Artificial intelligence, 97 (1-2):273–324, 1997b.
|
| 261 |
+
|
| 262 |
+
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.
|
| 263 |
+
|
| 264 |
+
Johannes Lederer and Christian Müller. Don’t fall for tuning parameters: tuning-free variable selection in high dimensions with the trex. In Twenty-Ninth AAAI Conference on Artificial Intelligence, 2015.
|
| 265 |
+
|
| 266 |
+
Fan Li, Yiming Yang, and Eric P Xing. From lasso regression to feature vector machine. In Advances in Neural Information Processing Systems, pp. 779–786, 2006.
|
| 267 |
+
|
| 268 |
+
Wei Li, Jianxing Feng, and Tao Jiang. Isolasso: a lasso regression approach to rna-seq based transcriptome assembly. In International Conference on Research in Computational Molecular Biology, pp. 168–188. Springer, 2011.
|
| 269 |
+
|
| 270 |
+
Yifeng Li, Chih-Yu Chen, and Wyeth W Wasserman. Deep feature selection: theory and application to identify enhancers and promoters. Journal of Computational Biology, 23(5):322–336, 2016.
|
| 271 |
+
|
| 272 |
+
Christos Louizos, Max Welling, and Diederik P. Kingma. Learning sparse neural networks through l0 regularization. CoRR, abs/1712.01312, 2017.
|
| 273 |
+
|
| 274 |
+
Chris J. Maddison, Andriy Mnih, and Yee Whye Teh. The concrete distribution: A continuous relaxation of discrete random variables. CoRR, abs/1611.00712, 2016. URL http://arxiv. org/abs/1611.00712.
|
| 275 |
+
|
| 276 |
+
Andrew Miller, Nick Foti, Alexander D’Amour, and Ryan P Adams. Reducing reparameterization gradient variance. In Advances in Neural Information Processing Systems, pp. 3708–3718, 2017.
|
| 277 |
+
|
| 278 |
+
Fan Min, Qinghua Hu, and William Zhu. Feature selection with test cost constraint. International Journal of Approximate Reasoning, 55(1):167–179, 2014.
|
| 279 |
+
|
| 280 |
+
Hanchuan Peng, Fuhui Long, and Chris Ding. Feature selection based on mutual information criteria of max-dependency, max-relevance, and min-redundancy. IEEE Transactions on pattern analysis and machine intelligence, 27(8):1226–1238, 2005.
|
| 281 |
+
|
| 282 |
+
Rajeev Rastogi and Kyuseok Shim. Public: A decision tree classifier that integrates building and pruning. Data Mining and Knowledge Discovery, 4(4):315–344, 2000.
|
| 283 |
+
|
| 284 |
+
Juha Reunanen. Overfitting in making comparisons between variable selection methods. Journal of Machine Learning Research, 3(Mar):1371–1382, 2003.
|
| 285 |
+
|
| 286 |
+
Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. "why should i trust you?": Explaining the predictions of any classifier. In Proceedings of the 22Nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’16, pp. 1135–1144, New York, NY, USA, 2016. ACM. ISBN 978-1-4503-4232-2. doi: 10.1145/2939672.2939778. URL http://doi.acm. org/10.1145/2939672.2939778.
|
| 287 |
+
|
| 288 |
+
Debaditya Roy, K Sri Rama Murty, and C Krishna Mohan. Feature selection using deep neural networks. In Neural Networks (IJCNN), 2015 International Joint Conference on, pp. 1–6. IEEE, 2015.
|
| 289 |
+
|
| 290 |
+
Simone Scardapane, Danilo Comminiello, Amir Hussain, and Aurelio Uncini. Group sparse regularization for deep neural networks. Neurocomput., 241(C):81–89, June 2017. ISSN 0925- 2312. doi: 10.1016/j.neucom.2017.02.029. URL https://doi.org/10.1016/j.neucom. 2017.02.029.
|
| 291 |
+
|
| 292 |
+
Le Song, Alex Smola, Arthur Gretton, Karsten M Borgwardt, and Justin Bedo. Supervised feature selection via dependence estimation. In Proceedings of the 24th international conference on Machine learning, pp. 823–830. ACM, 2007.
|
| 293 |
+
|
| 294 |
+
Le Song, Alex Smola, Arthur Gretton, Justin Bedo, and Karsten Borgwardt. Feature selection via dependence maximization. Journal of Machine Learning Research, 13(May):1393–1434, 2012.
|
| 295 |
+
|
| 296 |
+
Gary Stein, Bing Chen, Annie S Wu, and Kien A Hua. Decision tree classifier for network intrusion detection with ga-based feature selection. In Proceedings of the 43rd annual Southeast regional conference-Volume 2, pp. 136–141. ACM, 2005.
|
| 297 |
+
|
| 298 |
+
Carolin Strobl, Anne-Laure Boulesteix, Thomas Kneib, Thomas Augustin, and Achim Zeileis. Conditional variable importance for random forests. BMC bioinformatics, 9(1):307, 2008.
|
| 299 |
+
|
| 300 |
+
Toshihiko Yanase Takeru Ohta Takuya Akiba, Shotaro Sano and Masanori Koyama. Optuna: A next-generation hyperparameter optimization framework. KDD, 2019.
|
| 301 |
+
|
| 302 |
+
Robert Tibshirani. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society. Series B (Methodological), pp. 267–288, 1996.
|
| 303 |
+
|
| 304 |
+
Antanas Verikas and Marija Bacauskiene. Feature selection with neural networks. Pattern Recognition Letters, 23(11):1323–1335, 2002.
|
| 305 |
+
|
| 306 |
+
Martin J. Wainwright. Sharp thresholds for high-dimensional and noisy sparsity recovery using $\ell _ { 1 }$ -constrained quadratic programming (lasso). IEEE Transactions on Information Theory, 55 (5):2183–2202, May 2009. ISSN 0018-9448. doi: 10.1109/tit.2009.2016018. URL http: //dx.doi.org/10.1109/tit.2009.2016018.
|
| 307 |
+
|
| 308 |
+
Ronald J. Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine Learning, 8:229–256, 1992.
|
| 309 |
+
|
| 310 |
+
Makoto Yamada, Wittawat Jitkrittum, Leonid Sigal, Eric P Xing, and Masashi Sugiyama. Highdimensional feature selection by feature-wise kernelized lasso. Neural computation, 26(1):185–207, 2014.
|
| 311 |
+
|
| 312 |
+
Grace XY Zheng, Jessica M Terry, Phillip Belgrader, Paul Ryvkin, Zachary W Bent, Ryan Wilson, Solongo B Ziraldo, Tobias D Wheeler, Geoff P McDermott, Junjie Zhu, et al. Massively parallel digital transcriptional profiling of single cells. Nature communications, 8:14049, 2017.
|
| 313 |
+
|
| 314 |
+
Zexuan Zhu, Yew-Soon Ong, and Manoranjan Dash. Wrapper–filter feature selection algorithm using a memetic framework. IEEE Transactions on Systems, Man, and Cybernetics, Part B (Cybernetics), 37(1):70–76, 2007.
|
| 315 |
+
|
| 316 |
+
A APPENDIX B ALGORITHM
|
| 317 |
+
|
| 318 |
+
Here we present the pseudo code of our method, presented in Algorithm 1. The loss $L$ is typically negative-log likelihood for classification and squared loss for regression. $N$ is the sample size, $D$ is the number of features, $K$ is the number of Monte Carlo samples.
|
| 319 |
+
|
| 320 |
+
Input: $\pmb { X } \in \mathbb { R } ^ { N \times D }$ , target variables $\boldsymbol { y } \in \mathbb { R } ^ { N }$ , regularization parameter $\lambda$ , number of epochs $M$ , learning rate $\gamma$ ,
|
| 321 |
+
|
| 322 |
+
Output: Trained model $f _ { \pmb { \theta } }$ and parameter $\boldsymbol { \mu } \in \mathbb { R } ^ { D }$
|
| 323 |
+
|
| 324 |
+
.
|
| 325 |
+
1: Initialize the model parameter $\pmb { \theta }$ . Set $\pmb { \mu } = 0$ .
|
| 326 |
+
2: for $i = 1 , . . . , M$ do
|
| 327 |
+
3: for $n = 1 , . . . , N$ do
|
| 328 |
+
4: for $d = 1 , . . . , D$ do
|
| 329 |
+
5: for $k = 1 , . . . , K$ do
|
| 330 |
+
6: Sample (k)d ∼ $\epsilon _ { d } ^ { ( k ) } \sim N ( 0 , \sigma _ { d } )$
|
| 331 |
+
7: Compute the gate z(kd $z _ { d } ^ { ( k ) } = \operatorname* { m a x } ( 0 , \operatorname* { m i n } ( 1 , \mu _ { d } + \epsilon _ { d } ^ { ( k ) } + 0 . 5 ) )$
|
| 332 |
+
8: end for
|
| 333 |
+
9: $\begin{array} { r } { z _ { d } = \frac { 1 } { K } \sum _ { k = 1 } ^ { K } z _ { d } ^ { ( k ) } } \end{array}$
|
| 334 |
+
10: end for
|
| 335 |
+
11: Set $\boldsymbol { z } = [ z _ { 1 } , . . . , z _ { D } ] ^ { T }$
|
| 336 |
+
12: 13: end forCompute the loss $\begin{array} { r } { \hat { L } = \frac { 1 } { N } \sum _ { n = 1 } ^ { N } L ( f _ { \theta } ( \pmb { x } _ { n } \odot \pmb { z } ) , y _ { n } ) } \end{array}$
|
| 337 |
+
14: N Compute the regularization term $\begin{array} { r } { R = \lambda \sum _ { d = 1 } ^ { D } \Phi ( \frac { \mu _ { d } + 0 . 5 } { \sigma _ { d } } ) } \end{array}$
|
| 338 |
+
15: Update $\pmb { \theta } : = \pmb { \theta } - \gamma \nabla _ { \pmb { \theta } } \hat { L }$ and $\pmb { \mu } : = \pmb { \mu } - \gamma \nabla \pmb { \mu } ( \hat { L } + R )$
|
| 339 |
+
16: end for
|
| 340 |
+
|
| 341 |
+
17:
|
| 342 |
+
|
| 343 |
+
Algorithm 1: STG: Feature selection using stochastic gates
|
| 344 |
+
|
| 345 |
+
We empirically observe that setting the number of Monte Carlo samples $K = 1$ and the standard deviation of the Gaussian distribution $\sigma _ { d } = 0 . 5$ for $d = 1 , . . . , D$ suffices for feature selection in our experiments. See Section E in the Appendix for more details about the specific choice of $\sigma _ { d }$ . After training, the set of indices for selected features is: $\{ d : \operatorname* { m i n } ( 1 , \operatorname* { m a x } ( 0 , \mu _ { d } + 0 . 5 ) ) > 0 \}$ .
|
| 346 |
+
|
| 347 |
+
# C PROOF OF PROPOSITION 1
|
| 348 |
+
|
| 349 |
+
We now provide a proof for Proposition 1, showing the equivalence between the stochastic optimization (Eq.7) and the deterministic one (Eq. 6). Let $\tilde { \cal S }$ be a subset such that $S ^ { * } \setminus \tilde { S } \ne \emptyset$ . That is there exists some element in $S ^ { * }$ that is not in $\tilde { \cal S }$ . For any such set $\tilde { \cal S }$ we have that $I ( X _ { \tilde { S } } ; Y ) < I ( X ; Y )$ . Indeed, if we let $i \in { \cal S } ^ { * } \cap \tilde { \cal S } ^ { c }$ then we have
|
| 350 |
+
|
| 351 |
+
$$
|
| 352 |
+
\begin{array} { r l } { I ( \boldsymbol { X } _ { \tilde { \mathcal { S } } } ; Y ) } & { \leq I ( \boldsymbol { X } _ { \backslash \{ i \} } ; Y ) } \\ & { = I ( \boldsymbol { X } ; Y ) - I ( \boldsymbol { X } _ { i } ; Y | \boldsymbol { X } _ { \backslash \{ i \} } ) } \\ & { < I ( \boldsymbol { X } ; Y ) , } \end{array}
|
| 353 |
+
$$
|
| 354 |
+
|
| 355 |
+
where the final inequality follows by Assumption 1. Assumption 2 also yields that for any set $\tilde { \cal S }$ such that $S ^ { * } \subset \tilde { S }$ , we have $I ( { \pmb X } _ { \tilde { S } } ; Y ) = I ( { \pmb X } ; Y )$ . Now, when we consider the Bernoulli optimization problem we have
|
| 356 |
+
|
| 357 |
+
$$
|
| 358 |
+
\operatorname* { m a x } _ { \pi } I ( X \odot S ; Y ) \quad \mathrm { s . t . } \quad \sum _ { l } \pi _ { l } \leq k \mathrm { a n d } 0 \leq \pi _ { l } \leq 1 .
|
| 359 |
+
$$
|
| 360 |
+
|
| 361 |
+
The mutual information can be expanded as
|
| 362 |
+
|
| 363 |
+
$$
|
| 364 |
+
I ( X \odot S ; Y ) = \sum _ { s } I ( X \odot s ; Y ) p _ { \pi } ( S = s ) ,
|
| 365 |
+
$$
|
| 366 |
+
|
| 367 |
+
where we have used the fact that $_ { s }$ is independent of everything else. Recall that in optimization (Eq. 7) the coordinates of $\pmb { S }$ are sampled at random. Therefore, the distribution that is being optimized over $p _ { \pi }$ is a product distribution. Our goal is to understand the form of this distribution. To that end, we will consider a problem dropping the independence constraint. If we can show that the distribution found by solving this new optimization problem with less constraints is still a product distribution, then we obtain a solution to the original optimization (Eq. 6).
|
| 368 |
+
|
| 369 |
+
Now, from above we know that the optimal value of the optimization is $I ( X \odot { \tilde { S } } ; Y )$ for any set $S ^ { * } \subset \tilde { S }$ . Hence, any unconstrained distribution should place all of its mass on such subsets in order to maximize the mutual information. As a result $\begin{array} { r } { \sum _ { l \in S ^ { * } } p ( S _ { l } = 1 ) = k } \end{array}$ . However, there is an optimization constraint that $\mathbb { E } [ \sum _ { l } S _ { l } ] \le k$ . Therefore, $\mathbb { E } [ S _ { l } ] = 0$ for any $l \notin S ^ { * }$ . Hence, the optimal solution is to select the distribution so that all of the mass is placed on the subset $S ^ { * }$ and no mass elsewhere. As this is also a product distribution, this complete the proof of the claim.
|
| 370 |
+
|
| 371 |
+
# D BRIDGING THE TWO PERSPECTIVES
|
| 372 |
+
|
| 373 |
+
To motivate the introduction of randomness into the risk, we have looked at the feature selection problem from a MI perspective. Based on the MI objective, we have observed that introducing randomness into the constrained maximization procedure, does not change the objective (Proposition 1). Here we provide a relation between the MI objective (Eq. 6) to the empirical risk (Eq. 1), which supports our proposed procedure.
|
| 374 |
+
|
| 375 |
+
We first note that the MI maximization over the set $s$ can be reformulated as the minimization of the conditional entropy $H ( Y | \boldsymbol { X } _ { \mathcal { S } } )$ since $H ( Y )$ does not depend on $s$ :
|
| 376 |
+
|
| 377 |
+
$$
|
| 378 |
+
\displaystyle { \operatorname* { m a x } _ { \mathcal { S } } I ( \mathbf { \boldsymbol { X } } _ { \mathcal { S } } ; Y ) = \operatorname* { m a x } _ { \mathcal { S } } H ( Y ) - H ( Y | \mathbf { \boldsymbol { X } } _ { \mathcal { S } } ) \iff \operatorname* { m i n } _ { \mathcal { S } } H ( Y | \mathbf { \boldsymbol { X } } _ { \mathcal { S } } ) } .
|
| 379 |
+
$$
|
| 380 |
+
|
| 381 |
+
Recall that $X _ { \mathcal { S } } = X \odot \tilde { S }$ . By Proposition 1, we can rewrite the deterministic search over the set $s$ by a search over the Bernoulli parameters $\pi$ :
|
| 382 |
+
|
| 383 |
+
$$
|
| 384 |
+
\begin{array} { r l } { \displaystyle \operatorname* { m i n } _ { \pi } H ( \boldsymbol { Y } | \boldsymbol { X } \odot \tilde { \boldsymbol { S } } ) = \operatorname* { m i n } _ { \pi } \mathbb { E } _ { \boldsymbol { X } , \boldsymbol { Y } , \tilde { \boldsymbol { S } } } - \log P _ { \pmb { \theta } ^ { * } } ( \boldsymbol { Y } | \boldsymbol { X } \odot \tilde { \boldsymbol { S } } ) } & { } \\ { = \displaystyle \operatorname* { m i n } _ { \pmb { \theta } } \operatorname* { m i n } _ { \pi } \mathbb { E } _ { \boldsymbol { X } , \boldsymbol { Y } , \tilde { \boldsymbol { S } } } - \log P _ { \pmb { \theta } } ( \boldsymbol { Y } | \boldsymbol { X } \odot \tilde { \boldsymbol { S } } ) , } \end{array}
|
| 385 |
+
$$
|
| 386 |
+
|
| 387 |
+
where the expectation is over $X , Y \sim P _ { \pmb { \theta } _ { * } }$ , which is the true data distribution, and $\tilde { S } \sim B e r n ( \tilde { S } | \pi )$ . Put our model distribution as $P _ { \theta }$ , then we can rewrite the right hand side as:
|
| 388 |
+
|
| 389 |
+
$$
|
| 390 |
+
\begin{array} { r l } & { \mathbb { E } _ { X , Y , \tilde { S } } \log P _ { \theta ^ { * } } \big ( Y | X \odot \tilde { S } \big ) = \mathbb { E } _ { X , Y , \tilde { S } } \Bigg [ \log P _ { \theta ^ { * } } \big ( Y | X \odot \tilde { S } \big ) \frac { P _ { \theta } \big ( Y | X \odot \tilde { S } \big ) } { P _ { \theta } \big ( Y | X \odot \tilde { S } \big ) } \Bigg ] } \\ & { \qquad = \mathbb { E } _ { X , Y , \tilde { S } } \log \frac { P _ { \theta ^ { * } } \big ( Y | X \odot \tilde { S } \big ) } { P _ { \theta } \big ( Y | X \odot \tilde { S } \big ) } + \mathbb { E } _ { X , Y , \tilde { S } } \log P _ { \theta } \big ( Y | X \odot \tilde { S } \big ) . } \end{array}
|
| 391 |
+
$$
|
| 392 |
+
|
| 393 |
+
Since $\mathrm { K L } ( P _ { \theta ^ { * } } ( Y | X \odot \tilde { S } ) | | P _ { \theta } ( Y | X \odot \tilde { S } ) )$ is non-negative, $\mathbb { E } _ { \tilde { S } } \mathbf { K } \mathbf { L } ( P _ { \theta * } ( Y | \boldsymbol { X } \odot \tilde { \pmb { S } } ) | | P _ { \theta } ( Y | \boldsymbol { X } \odot \tilde { \pmb { S } } ) )$ is also non-negative because it is a weighted sum of non-negative terms. Noting that
|
| 394 |
+
|
| 395 |
+
$$
|
| 396 |
+
\mathbb { E } _ { \tilde { S } } \mathrm { K L } \big ( P _ { \theta * } ( Y | X \odot \tilde { S } ) | | P _ { \theta } ( Y | X \odot \tilde { S } ) \big ) = \mathbb { E } _ { X , Y , \tilde { S } } \log \frac { P _ { \theta * } ( Y | X \odot \tilde { S } ) } { P _ { \theta } ( Y | X \odot \tilde { S } ) }
|
| 397 |
+
$$
|
| 398 |
+
|
| 399 |
+
we can conclude that
|
| 400 |
+
|
| 401 |
+
$$
|
| 402 |
+
\mathbb { E } _ { X , Y , \tilde { S } } - \log P _ { \theta ^ { * } } ( Y | X \odot \tilde { S } ) \leq \mathbb { E } _ { X , Y , \tilde { S } } - \log P _ { \theta } ( Y | X \odot \tilde { S } ) .
|
| 403 |
+
$$
|
| 404 |
+
|
| 405 |
+
If we consider the negative log likelihood of the target given the observations (i.e. $- \log P _ { \theta } ( Y | X \odot \tilde { \pmb { S } } ) )$ as a loss function $L$ (which encodes the classification or regression function $f _ { \pmb { \theta } } ,$ ), then we see that minimizing the risk approximately maximizes the MI objective in Eq. 6.
|
| 406 |
+
|
| 407 |
+
# E DETAILS OF REGULARIZATION TERM
|
| 408 |
+
|
| 409 |
+
Here we provide the detail description of the regularization term. For the vector of stochastic gates $z \in \mathbb { R } ^ { D }$ , the regularization term is expressed as follows:
|
| 410 |
+
|
| 411 |
+
$$
|
| 412 |
+
\begin{array} { l } { \displaystyle \mathbb { E } _ { Z } \| Z \| _ { 0 } = \displaystyle \sum _ { d = 1 } ^ { D } \mathbb { P } [ z _ { d } > 0 ] = \displaystyle \sum _ { d = 1 } ^ { D } \mathbb { P } [ \mu _ { d } + \sigma _ { d } \epsilon _ { d } > - \frac { 1 } { 2 } ] } \\ { = \displaystyle \sum _ { d = 1 } ^ { D } \{ 1 - \mathbb { P } [ \mu _ { d } + \sigma _ { d } \epsilon _ { d } \leq - \frac { 1 } { 2 } ] \} } \\ { = \displaystyle \sum _ { d = 1 } ^ { D } \{ 1 - \Phi ( - \frac { 1 } { \sigma _ { d } } ) \} } \\ { = \displaystyle \sum _ { d = 1 } ^ { D } \Phi ( \frac { \mu _ { d } + \frac { 1 } { 2 } } { \sigma _ { d } } ) . } \end{array}
|
| 413 |
+
$$
|
| 414 |
+
|
| 415 |
+
The derivative of the regularization term with respect to the distribution parameter $\mu _ { d }$ is simply the Gaussian PDF:
|
| 416 |
+
|
| 417 |
+
$$
|
| 418 |
+
\frac { \partial } { \partial \mu _ { d } } \mathbb { E } _ { Z } \left\| Z \right\| _ { 0 } = \frac { \partial } { \partial \mu _ { d } } \Phi ( \frac { \mu _ { d } + \frac { 1 } { 2 } } { \sigma _ { d } } ) = \frac { 1 } { \sqrt { 2 \pi \sigma _ { d } ^ { 2 } } } e ^ { - \frac { ( \mu _ { d } + \frac { 1 } { 2 } ) ^ { 2 } } { 2 \sigma _ { d } ^ { 2 } } } .
|
| 419 |
+
$$
|
| 420 |
+
|
| 421 |
+
The effect of $\sigma$ can be understood by looking at the value of $\frac { \partial } { \partial \mu _ { d } } \mathbb { E } _ { Z } | | Z | | _ { 0 }$ . In the first iteration during the training, $\mu _ { d }$ is 0. Therefore, during the initial phase of training, it is close to $\frac { \lambda } { \sqrt { 2 \pi \sigma _ { d } ^ { 2 } } } e ^ { - \frac { 1 } { 8 \sigma _ { d } ^ { 2 } } }$ . In order to remove irrelevant features, this term has to be greater than the derivative of the loss with respect to $\mu _ { d }$ because otherwise $\mu _ { d }$ is updated in the incorrect direction. To encourage such behavior, we set $\sigma = 0 . 5$ , which is around the maximum of the gradient during the initial phase as shown in Fig. 4. Although the point that attains the maximum moves as $\mu$ changes, we empirically observe that setting $\sigma = 0 . 5$ performs well in our experiments when the regularization parameter $\lambda$ is appropriately tuned (see Section I).
|
| 422 |
+
|
| 423 |
+

|
| 424 |
+
Figure 4: The plot of ∂∂µ EZ||Z||0|µ=0 = √ 12πσ2 e for $\sigma = [ 0 . 0 0 1 , 2 ]$
|
| 425 |
+
|
| 426 |
+
# F ISSUES IN GRADIENT ESTIMATION OF DISCRETE RANDOM VARIABLES
|
| 427 |
+
|
| 428 |
+
In Section 3.1, we have introduced Bernoulli random $\widetilde { s } _ { d } , d = 1 , . . . , D$ variables with corresponding parameters $\pi _ { d }$ into the risk objective (Eq. 4). Taking the expectation over the $\ell _ { 0 }$ norm of $\tilde { s }$ boils down to the sum of the Bernoulli parameters $\pi _ { d }$ . However, the optimization of the resulting objective suffers from high variance due to the discrete nature of $\tilde { S }$ . Here, we attempt to convey this problem by analyzing the risk term in the objective in Eq. 4. Using the Bernoulli paramterization the empirical risk $\hat { R } ( \pmb \theta , \pmb \pi )$ is expressed as
|
| 429 |
+
|
| 430 |
+
$$
|
| 431 |
+
\sum _ { \mathscr { Z } : \{ 0 , 1 \} ^ { D } } \left[ \sum _ { n = 1 } ^ { N } [ L ( f _ { \theta } ( \mathscr { z } \odot \mathscr { x } _ { n } ) , \pmb { y } _ { n } ] \prod _ { d = 1 } ^ { D } \pi _ { d } ^ { \mathscr { z } _ { d } } ( 1 - \pi _ { d } ) ^ { 1 - \mathscr { z } _ { d } } \right] .
|
| 432 |
+
$$
|
| 433 |
+
|
| 434 |
+
In practice, as the outer sum involves enumerating $2 ^ { D }$ possibilities of the indicator variables, one can replace the outer sum with Monte Carlo samples from the product of Bernoulli distributions $B ( z | \pi )$ . However, a Monte Carlo estimate of $\frac { \partial } { \partial \pi _ { d } } \hat { R } ( \pmb \theta , \pmb \pi )$ suffers from high variance. To see this, consider the following exact gradient of the empirical risk with respect to $\pi _ { d }$ , which is
|
| 435 |
+
|
| 436 |
+
$$
|
| 437 |
+
\sum _ { z : \{ 0 , 1 \} ^ { D } , z _ { d } = 1 } \left[ L ( z ) p _ { z _ { i } \neq d } \right] - \sum _ { z : \{ 0 , 1 \} ^ { D } , z _ { d } = 0 } \left[ L ( z ) p _ { z _ { i } \neq d } \right] ,
|
| 438 |
+
$$
|
| 439 |
+
|
| 440 |
+
where $p ( z _ { i \neq d } ) = \prod _ { i \neq d } ^ { D } \pi _ { i } ^ { z _ { i } } ( 1 - \pi _ { i } ) ^ { 1 - z _ { i } }$ , by absorbing the model $f _ { \theta } ( \cdot )$ and the data into $L ( \cdot )$ . Due to the discrete nature of $_ z$ , we see that even the sign of the gradient estimate becomes inaccurate if we can only access a small number of Monte Carlo samples. While a score-function estimator such as REINFORCE (Williams, 1992) can be used, it is known that the reparametrization trick reduces the variance more in practice.
|
| 441 |
+
|
| 442 |
+
# G COMPARISON TO HARD-CONCRETE DISTRIBUTION
|
| 443 |
+
|
| 444 |
+
To evaluate the strength of the proposed continuous relaxation of the Bernoulli distribution, described in Subsection 3.1, we compare it with the Hard-Concrete distribution (Louizos et al., 2017), another continuous surrogate for Bernoulli distributions, which was originally developed for neural network model compression. The details of the Hard-Concrete distribution is described below.
|
| 445 |
+
|
| 446 |
+
# G.1 HARD-CONCRETE DISTRIBUTION
|
| 447 |
+
|
| 448 |
+
The authors in (Louizos et al., 2017) introduce a modification of Binary Concrete, whose sampling procedure is as follows:
|
| 449 |
+
|
| 450 |
+
$$
|
| 451 |
+
\begin{array} { r } { u \sim U ( 0 , 1 ) , L = \log ( U ) - \log ( 1 - U ) } \\ { s = \frac { 1 } { 1 + \exp ( \frac { - ( \log { \alpha } + L ) } { \beta } ) } } \\ { \bar { s } = s ( \zeta - \tau ) + \tau } \\ { z = \operatorname* { m i n } ( 1 , \operatorname* { m a x } ( 0 , \bar { s } ) ) } \end{array}
|
| 452 |
+
$$
|
| 453 |
+
|
| 454 |
+
where $( \tau , \zeta )$ is an interval, with $\tau < 0$ and $\zeta > 1$ . This induces a new distribution, whose support is $[ 0 , 1 ]$ instead of $( 0 , 1 )$ . With $0 < \beta < 1$ , the probability density concentrates its mass near the end points, since values larger than $\frac { 1 - \tau } { \zeta - \tau }$ are rounded to one, whereas values smaller than $\frac { - \tau } { \zeta - \tau }$ are rounded to zero.
|
| 455 |
+
|
| 456 |
+
The CDF of $s$ is
|
| 457 |
+
|
| 458 |
+
$$
|
| 459 |
+
Q _ { s } ( s | \beta , \log \alpha ) = \mathrm { { S i g m o i d } } ( ( \log s - \log ( 1 - s ) ) \beta - \log \alpha )
|
| 460 |
+
$$
|
| 461 |
+
|
| 462 |
+
and so the CDF of $\bar { s }$ is
|
| 463 |
+
|
| 464 |
+
$$
|
| 465 |
+
Q _ { \bar { s } } ( \bar { s } | \phi ) = \mathrm { S i g m o i d } ( ( \log ( \frac { \bar { s } - \tau } { \zeta - \tau } ) - \log ( 1 - \frac { \bar { s } - \tau } { \zeta - \tau } ) ) \beta - \log \alpha
|
| 466 |
+
$$
|
| 467 |
+
|
| 468 |
+
where $\phi = ( \beta , \log \alpha , \zeta , \tau )$
|
| 469 |
+
|
| 470 |
+
Now, the probability of being the gate $z _ { i }$ being active is $1 - Q _ { \bar { s } } ( 0 | \phi )$ and can be written as
|
| 471 |
+
|
| 472 |
+
$$
|
| 473 |
+
1 - Q _ { \bar { s } } ( 0 | \phi ) = \mathrm { S i g m o i d } ( \log \alpha - \beta \log \frac { - \tau } { \zeta } )
|
| 474 |
+
$$
|
| 475 |
+
|
| 476 |
+
# G.2 THE EFFECT OF THE HEAVY TAIL DISTRIBUTION
|
| 477 |
+
|
| 478 |
+
The main difference between our proposed distribution (STG) and the Hard-Concrete (Louizos et al., 2017) distribution is that the latter is based on the logistic distribution, which has a heavier tail than the Gaussian distribution we have employed. As shown in Fig 5, the heavy-tailness results in instability during training. Furthermore, our method converges much faster and more reliably than the feature selection method using the Hard-Concrete distribution on a the two-moons, XOR and MADELON datasets (see Subsection J.1 and J.2). A similar phenomenon is also demonstrated in the MNIST experiment (see Subsection J.3).
|
| 479 |
+
|
| 480 |
+

|
| 481 |
+
Figure 5: Comparison between STG and Hard-Concrete on the Two-Moon dataset (a), XOR (b) and MADELON (c). The shaded area represents the standard deviation, calculated by running the same experiment 10 times with different random initializations.
|
| 482 |
+
|
| 483 |
+
# H NON-CONVEX DETERMINISTIC REGULARIZATION
|
| 484 |
+
|
| 485 |
+
Our proposed objective for feature selection (summarized in Eq. 5) consists of three major differences compared to the LASSO formulation.
|
| 486 |
+
|
| 487 |
+
• Non-linearity, which is obtained by learning parameters of a multi-layer network with non linear activation’s. • Feature gates, these are a specific form on non convex regularization. • Stochasticity, which is achieved by injecting noise via the reparametrization trick.
|
| 488 |
+
|
| 489 |
+
In section 6.1, we have demonstrated that even in the linear regime the proposed formulation outperforms the LASSO in the task of identifying active features (see Fig. 1(a)).
|
| 490 |
+
|
| 491 |
+
The stochastic property of the gates proposed in this paper is justified using a MI prospective (see Section 4). Nonetheless, in this section we evaluate whether the practical performance gain of our method stems from the non-convex regularization or from it’s combination with the injected noise.
|
| 492 |
+
|
| 493 |
+
We define a deterministic gate using $\tilde { z } _ { d } = g ( \mu _ { d } ) = \operatorname* { m a x } ( 0 , \operatorname* { m i n } ( 1 , \mu _ { d } + 0 . 5 ) )$ , where $\mu _ { d }$ is a parameter learned for each feature $d = 1 , . . . , D$ . In the linear regression setting we can define the non-convex deterministic (NCD) as
|
| 494 |
+
|
| 495 |
+
$$
|
| 496 |
+
\operatorname* { m i n } _ { \theta , \mu } \frac { 1 } { N } \sum _ { n = 1 } ^ { N } ( \theta ^ { T } x _ { n } \odot \tilde { z } - y _ { n } ) ^ { 2 } + \lambda \sum _ { d = 1 } ^ { D } \Phi \left( \frac { \mu _ { d } + 0 . 5 } { 0 . 5 } \right) ,
|
| 497 |
+
$$
|
| 498 |
+
|
| 499 |
+
where $\Phi$ is the standard Gaussian CDF. Combined with $\tilde { z } _ { d }$ this non-convex regularized objective is deterministic and differentiable, and its solution can be approximated via gradient decent. We evaluate the applicability of such alternative objective for the task of feature selection in linear regression. The experimental setting follows the description in Section 6.1 using $D = 6 4$ .
|
| 500 |
+
|
| 501 |
+
In Fig. 6(b), we compare the values of the deteministic gates (DNC) and stochastic gates (STG) using $N = 6 0$ . As depicted from this figure, the STG correctly identifies the active features (first 10) and sparsifies the non-active features. The deterministic version DNC does induce partial sparsity, but fails to remove some of the irrelevant features. Furthemore, it does not push the gates values of active features up to 1. Clearly, in the deterministic setting, shrinking the value of $\mu _ { d }$ while compensating with a large coefficient in $\pmb \theta$ is preferable for the objective in Eq. 12.
|
| 502 |
+
|
| 503 |
+
To evaluate the probability of support recovery using DNC, we apply additional thresholding to the gates. Specifically, we use a threshold of 0.5 to define if a feature is active or not. A comparison with STG, HC and LASSO in this setting appears in Fig. 6(a). The DNC is superior to LASSO, but inferior to the HC and STG. Which means that there is a true advantage of stochacity in our formulation.
|
| 504 |
+
|
| 505 |
+
One aspect that is crucially difference between the STG and DNC is what we call “second chance”. For the deterministic formulation, if a feature is zeroed out in an early training phase, the gradient of the feature vanishes for further training and it will never be pulled back. For the STG, even if the feature has been pulled to zero, the gate may still be pushed back up to one at a later training phase. This is due to the injected noise which allows to reevaluate the gradient of each gate. In Fig. 6(c), we demonstrate this “second chance” effect using $N = 6 0$ samples and presenting the gate’s values (throughout training) for an active feature.
|
| 506 |
+
|
| 507 |
+
To conclude, this form of deterministic gates (Eq. 12) is not suitable for an embedded feature selection method. Using thresholding seems somewhat effective; however such thresholding was not required for the STG in any of our experiments. While the shrinkage phenomenon might be avoided using further regularization on $\pmb \theta$ this is out of the scope of the current study.
|
| 508 |
+
|
| 509 |
+

|
| 510 |
+
Figure 6: Support recovery in the linear regression (see Section 6.1), the dimension $D = 6 4$ . (a) Phase transition comparison between the STG, HC, LASSO and the deterministic non convex (DNC). (b) An example of the output gates, STG $( z _ { d } )$ and DNC $( \tilde { z } _ { d } )$ for $N = 6 0$ . Each marker represents the gate value of the corresponding feature, of which the first 10 features are active. The deterministic gates are not pushed towards 1. (c) Demonstration of the “second chance” inherit to the STG. In the deterministic setting if a feature is eliminated its gradient vanishes for the rest of the training. The STG reevaluates this features and “recovers” after 4000 epochs.
|
| 511 |
+
|
| 512 |
+
# I TUNING THE REGULARIZATION PARAMETER $\lambda$
|
| 513 |
+
|
| 514 |
+
There have been several studies (Lederer & Müller, 2015; Coen et al., 2006) on the problem of tuning regularization parameter in regression and classification. Perhaps the most related regularized objective is the LASSO formulation. Studies such as (Chand, 2012; Fan & Tang, 2013) develop methods for tuning the regularization parameter in LASSO. In Eq. 5 as in the LASSO formulation, increasing the value of $\lambda$ effectively forces a sparser solution with less features. For simplicity, we focus on one popular way for tuning $\lambda$ in the LASSO. The idea is to minimize the generalization error using a cross validation procedure over a range of $\lambda$ values.
|
| 515 |
+
|
| 516 |
+
In this section, we demonstrate that this procedure is also applicable for the proposed approach. We apply the STG to the RAI dataset and evaluate the MSE using a 5-folds cross validation procedure. We compute the MSE on the validation data using 100 values of $\lambda$ logarithmically scaled in $[ 1 0 ^ { - 3 } , 1 0 ^ { 1 } ]$ As demonstrated in Fig. 7, using a cross validation procedure for tuning $\lambda$ provides a clear optimal value for this example.
|
| 517 |
+
|
| 518 |
+

|
| 519 |
+
Figure 7: Demonstrating a cross validation procedure on the RAI dataset (see section I for details). We perform 5-folds cross validation and evaluate the MSE on the test test. The optimal $\lambda = 0 . 1 3 5$ which seems stable in this example based on the low standard deviation.
|
| 520 |
+
|
| 521 |
+
# J ADDITIONAL EXPERIMENTS
|
| 522 |
+
|
| 523 |
+
# J.1 MADELON DATASET
|
| 524 |
+
|
| 525 |
+
The MADELON dataset, first suggested for the NIPS 2003 feature selection problem, is a multivariate highly nonlinear binary classification problem. The MADELON dataset is generated using 32 groups of data points placed on a 5 dimensional hyper-cube and randomly labeling them by one of the two class labels. The first 5 informative features are then used to create 15 additional coordinates that are formed based on a random linear transformation of the first 5. A Gaussian noise $N ( 0 , 1 )$ is added to each feature. Next, additional 480 nuisance coordinates are added in the same manner. These features have no effect on the class label. Finally, $1 \%$ of the labels are flipped. To be consistent with the XOR and two moons experiments, we use 1, 500 points from this dataset, and evaluate our proposed method in terms of its predictive power and ability to detect the informative features. We vary the regularizaton parameter $\lambda$ in the range [0.01, 10] and evaluate the classification accuracy using 5 folds cross validation. In this example, we restrict our comparison to Random Forest and LASSO. We focus on Random Forest as it was the strongest competitor to our method in all of our experiments, while LASSO is evaluated because it is a widely used embedded feature selection method.
|
| 526 |
+
|
| 527 |
+
As evident from Fig. 8(a), our method achieves the highest accuracy while using less features. Moreover, as depicted from this figure, peak performence occurs when selecting 5 features, thus, our method provides a clear indication to the true number of informative features. Both LASSO and RF on the other hand, do not provide a clear indication of the true number of relevant features. In Fig. 8(b), we evaluate the effect of $\lambda$ on the number and quality of selected features. As shown in this plot, there is a wide range of $\lambda$ ’s such that our method only selects relevant features. Finally, as evident from the plato on the right hand side of the red plot, there is a range of $\lambda$ ’s such that exactly 5 features are selected.
|
| 528 |
+
|
| 529 |
+

|
| 530 |
+
Figure 8: (a) Classification accuracy on the MADELON data sets. We evaluate performance using 5-fold cross validation for different number of selected features. In this dataset, only the first 20 coordinates are informative. In that regime the proposed method outperforms RF and LASSO. (b) An empirical evaluation of the effect the regularization parameter $\lambda$ . The IFWR and the number of selected features are presented on both sides of the $y$ -axis of this plot. For both plots, the mean is presented as a solid/dashed line, while the standard deviation is marked as a shaded color around the mean. (c) Box plots for the median rank of the 5 original informative features. Black line and dashed red represent the median and mean of each method. Optimal median rank in this experiment is 3.
|
| 531 |
+
|
| 532 |
+
# J.2 TWO MOONS CLASSIFICATION WITH NUISANCE FEATURES
|
| 533 |
+
|
| 534 |
+
In this experiment, we construct a dataset based on "two moons" shape classes, concatenated with noisy features. The first two coordinates $x _ { 1 } , x _ { 2 }$ are generated by adding a Gaussian noise with zero mean and the variance of $\sigma _ { r } ^ { 2 } = 0 . 1$ onto two nested half circles, as presented in Fig. 9(a). Nuisance features $x _ { i } , i = 3 , . . . , D$ , are drawn from a Gaussian distribution with zero mean and variance of $\sigma _ { n } ^ { 2 } = 1$ . We reserve the $7 0 \%$ as a test set, and use $1 0 \%$ of the remaining training set as a validation set. We follow the same hyperparameter tuning procedure as in the XOR experiment. The classification accuracy is in Fig. 9(b). Based on the classification accuracies, it is evident that for a small number of nuisance dimensions all methods correctly identify the most relevant features. The proposed method (STG) and Random Forest (RF) are the only methods that achieve near perfect classification accuracy for a wide range of nuisance dimensions. The other NN based method (DFS) seem to converge to sub-optimal solutions. We note that the median rank for all the methods is 1.5.
|
| 535 |
+
|
| 536 |
+

|
| 537 |
+
Figure 9: (a) Realizations from the "Two moons" shaped binary classification class. $X _ { 1 }$ and $X _ { 2 }$ are the relevant features, $X _ { i } , i = 3 , . . . , D$ are noisy features drawn from a Gaussian with zero mean and variance of 1. (b) Classification accuracy (mean and standard deviation based on 20 runs) vs. the number of irrelevant noisy dimension.
|
| 538 |
+
|
| 539 |
+
# J.3 SPARSE HANDWRITTEN DIGITS CLASSIFICATION
|
| 540 |
+
|
| 541 |
+
In the following toy example, we attempt to distinguish between images of handwritten digits of 3’s and 8’s using samples from MNIST (LeCun et al., 1998). The orientation and location of the digits is more or less the same throughout this dataset, therefore for these two classes (3’s and 8’s), we expect that some of the left side features (pixels) would be sufficient for the separation. The experiment is performed as followed. We reserve $9 0 \%$ of the data as the test set, and train on the remaining $1 0 \%$ . We then apply STG and evaluate the classification accuracy and the number of selected features. We use the architecture [200, 50, 10] with tanh activations. The experiment was repeated 10 times, the extracted features and accuracies were consistent over 20 trials. We noticed a relatively small number of selected features, which are positioned southwest and close to the center of the images, achieve very high classification accuracy. An example of 9 randomly selected samples overlaid with the weights of the selected features is presented in Fig. 10(a). Furthermore, we also evaluate the effect of $\lambda$ on the the number of selected features and accuracy of the method. We apply our method (STG) and its variant using the Hard-Concrete distribution to a randomly sampled training set of size $N = 1 5 0 0$ and vary $\lambda$ in the range of [0.001, 0.01]. In Fig. 10(b) we present the accuracy and sparsity level vs. the $\lambda$ parameter. This experiment demonstrates the improved performance of the proposed distribution compared to the Hard-Concrete (HC (Louizos et al., 2017)), which was designed for neural net model compression. Not only that the overall accuracy is superior, but also it seems that the transition as a function of $\lambda$ is smoother, which suggests that the method is less sensitive to the choice of $\lambda$ .
|
| 542 |
+
|
| 543 |
+
# J.4 GISETTE DATASET
|
| 544 |
+
|
| 545 |
+
The Gisette is a handwritten dataset also appears in the NIPS 2003 feature selection challenge. The data consists of 13, 500 handwritten digits of $\ ' 4 '$ and ’9’. The original digits have $2 8 \times 2 8$ pixels, which were modified for the feature selection challenge. Specifically, a random subset of the features are embedded in a 2500 dimensional space and additional 2500 irrelevant probes are added. The train, validation and test dimensions are $6 0 0 0 / 1 0 0 0 / 7 5 0 0$ respectively. We apply the proposed STG based feature selection method and compare its performance to Random Forests (RF) and Extremely Randomized Trees (Tree). As evident from Fig. 11, we obtain a high accuracy even for a dramatic reduction in the feature size. LASSO is not presented in this experiment as its performance is dramatically inferior to the alternatives (accuracy $< 0 . 6$ ).
|
| 546 |
+
|
| 547 |
+

|
| 548 |
+
Figure 10: (a) Nine samples from MNIST (white) overlaid with the subset of 13 features (black) selected by STG. Based on only these features, the binary classification accuracy reaches $9 2 . 2 \%$ . For these nine randomly selected samples, all the 8’s have values within the support of the selected features, whereas for the 3’s there is no intersection. (b) The comparison of accuracy and sparsity level performance for $\lambda$ in the range of $[ 1 0 ^ { - 3 } , 1 0 ^ { - 2 } ]$ between using our proposed method (STG) and its variant using the Hard-Concrete (HC) distribution.
|
| 549 |
+
|
| 550 |
+

|
| 551 |
+
Figure 11: Classification of the binary noisy digits from the Gisette dataset. The total number of feature is 5000 of which 2500 are irrelevant probes. Here we compare the performance of the proposed approach to RF and Tree based classifier. The lines represent a least squares polynomial fit plot of the accuracy vs. number of selected features.
|
| 552 |
+
|
| 553 |
+
# J.5 REUTERS CORPUS VOLUME I
|
| 554 |
+
|
| 555 |
+
The Reuters Corpus Volume I (RCV1) consists of 800, 000 newswire stories manually labeled by 103 categories. This is a multilable regime, i.e. each story is assigned to multiple categories. Here we focus on a binary subset of this corpus, with 23, 203 stories. The total number of feature is 47, 236 and the train, validation and test portions are $1 0 \%$ , $8 . 5 \%$ , and $8 1 . 5 \%$ respectively. We evaluate the performance of our method using a 5-fold cross validation. A comparison the LASSO and RF appears in Fig. 12. This example demonstrates that our method is also effective in an extremely high dimensional regime of non linear function estimation.
|
| 556 |
+
|
| 557 |
+
# J.6 DETAILS OF COX PROPORTIONAL HAZARD MODEL
|
| 558 |
+
|
| 559 |
+
Survival times are assumed to follow a distribution, which is characterized by the survival function $S ( t ) = P ( T > t )$ . A hazard function, which measures the instantaneous rate of death, is defined by $\begin{array} { r } { h ( t ) = \operatorname* { l i m } _ { \Delta t 0 } \frac { P ( t < T \leq t + \Delta t | T > t ) } { \Delta t } = \frac { p ( t ) } { S ( t ) } } \end{array}$ . We can relate the two functions in the following way: S(t) = e− R t0 h(t)dt.
|
| 560 |
+
|
| 561 |
+
Proportional hazard models assume a multiplicative effect of the covariates $x$ on the hazard function such that
|
| 562 |
+
|
| 563 |
+
$$
|
| 564 |
+
h ( t | \boldsymbol { x } ) = h _ { 0 } ( t ) e ^ { \theta ^ { T } \boldsymbol { x } } ,
|
| 565 |
+
$$
|
| 566 |
+
|
| 567 |
+

|
| 568 |
+
Figure 12: Classification of the version of the RCV1 textual dataset. The total number of feature is 47, 236. Here we compare the performance of the proposed approach to RF and LASSO. The lines represent a least squares polynomial fit plot of the accuracy vs. number of selected features.
|
| 569 |
+
|
| 570 |
+
where $h _ { 0 } ( t )$ is a baseline hazard function, which is often the exponential or Weibull distribution, and $\pmb \theta$ is the parameter of interests.
|
| 571 |
+
|
| 572 |
+
One of the difficulties in estimating $\pmb { \theta }$ in survival analysis is that a large portion of the available data is censored. However, in order to obtain estimates, Cox observed that it is sufficient to maximize the partial-likelihood, which is defined as follows: $\begin{array} { r } { L ( \pmb \theta ) = \prod _ { T _ { i } \mathrm { u n c e n s o r e d } } \frac { e ^ { \pmb \theta ^ { T } \pmb x _ { i } } } { \sum _ { T _ { j } \geq T _ { i } } e ^ { \pmb \theta ^ { T } \pmb x _ { j } } } . } \end{array}$
|
| 573 |
+
|
| 574 |
+
In (Katzman et al., 2018), the authors propose DeepSurv, which uses a deep neural network model to replace the linear relations between the covariate $_ { \textbf { \em x } }$ and $\pmb { \theta }$ , demonstrating improvements of survival time prediction over existing models such as CPH and the random survival forest (Ishwaran $\&$ Kogalur, 2007), (Ishwaran et al., 2008).
|
| 575 |
+
|
| 576 |
+
The Molecular Taxonomy of Breast Cancer International Consortium (METABRIC) dataset consists of gene expression data and clinical features for 1, 980 patients, and $5 7 . 7 2 \%$ have an observed death due to breast cancer with a median survival time of 116 months.
|
| 577 |
+
|
| 578 |
+
The METABRIC dataset involves 24,368 features (genes). Most genes are irrelevant for outcome prediction. To demonstrate the advantage of STG in the context of survival analysis, we selected 16 well-known genes relevant for survival (out of the 24,368 genes) that correspond to the Oncotype DX test, a gene panel used for treatment decision making. We also include five additional clinical features (hormone treatment indicator, radiotherapy indicator, chemotherapy indicator, ER-positive indicator, and age at diagnosis). We then added 200 additional irrelevant gene variables that we selected randomly from the remaining list of genes.
|
| 579 |
+
|
| 580 |
+
After we omit the null values, the number of samples is 1969. We reserve the $2 0 \%$ for test, and use the $2 0 \%$ of the remaining training set as validation. (That is, Train: 1260, Valid: 315, Test: 394 samples.)
|
| 581 |
+
|
| 582 |
+
Experimental Detail For DeepSurv, we manually select the architecture using the validation set so that we obtain a similar performance reported in (Katzman et al., 2018). The learning rate decay is set to 1. The learning rate and the regularization parameter are optimized via Optuna using the validation set, where the search range is set $L R : [ 1 e - 3 , 1 ]$ and $\lambda : [ 1 e - 3 , 1 ]$ . The hyperparameters used in the experiment are the following: architecture :[60, 20, 3], activation: selu (as suggested by (Katzman et al., 2018)), learning rate : 0.152, learning rate decay: 1.0, $\sigma : 0 . 5$ , $\lambda : 0 . 0 2 3$ , training epoch: 2000. Note that to see the effect of feature selection, we used the hyperparameters optimized for DeepSurv to test our method (STG-DeepSurv).
|
| 583 |
+
|
| 584 |
+
# J.7 ADDITIONAL EXPERIMENTAL DETAILS
|
| 585 |
+
|
| 586 |
+
Here we provide a full description of the procedures we have performed in the experimental parts of the paper.
|
| 587 |
+
|
| 588 |
+
For synthetic datasets are first split into train, validation and test. Validation is always $1 0 \%$ of the train, while the exact ratios between train and test is detailed for each experiment separately. All the neural network weights are initialized by drawing from $\mathcal { N } ( 0 , 0 . 1 )$ and bias terms are set to 0. All the batch sizes are equal to the number of training samples. In table 3, we detail the search range of hyperparamters as well as the exact values used in our experiments. We set n-trials $= 1 0 0 0$ for Optuna, which is a define-by-run based hyperparameter optimization software equipped with efficient search and pruning strategies. We use SGD for all the experiments, except for the Cox model where we use Adam. All the experiments are conducted using Intel(R) Xeon(R) CPU E5-2620 v3 $( \underline { { { \omega } } } 2 . 4 \mathrm { G h z }$ $_ { \mathbf { X } 2 }$ (12 cores total).
|
| 589 |
+
|
| 590 |
+
Table 3: List of the search range for the hyperparameters used in our expirements for XOR and Two-Moon
|
| 591 |
+
|
| 592 |
+
<table><tr><td>Param</td><td>Search range</td></tr><tr><td># dense layers #hidden units activation LR n-epoch (DFS, SG-L1-NN) α (SG-L1-NN) 入 (SG-L1-NN) 入 (STG,DFS) 入 (LASSO) n-est (RF, XGBoost, Tree) n-boost-round (XGBoost) Thresh (RF,XGBoost, Tree) max-depth (XGBoost) c (SVC)</td><td>[1,3] [10,500] [tanh, relu, sigmoid] [le-4, 1e-1] [50,20000] [1e-3,1] [1e-7, 1] [1e-3, 1] [0.01, 1] [5,100] [1,100] [0.01,0.5] [0.01,0.5] [1e-7, 1]</td></tr></table>
|
| 593 |
+
|
| 594 |
+
For the Phase Transition experiment, we use 0.1 as a learning rate. For all the experiments when we use Tree and RF, we use the default value for max-depth, so that nodes are expanded based on the purity. For the XOR problem, the exact architectures used for the NN based methods are: (STG/HC): [476, 490, 14] with Tanh, (DFS): [100, 10] with Tanh, (SG-L1-NN): [100, 10, 5] with Tanh. For the two moons we use (STG): [490, 406, 18] with Tanh, (DFS): [158, 27, 224] with Tanh, (SG-L1-NN): [88, 28, 27] with Tanh. For the XOR problem, we attempted to use Optuna to optimize parameters of DFS and SG-L1-NN, but we ended up using the architecture suggested by the authors (Li et al., 2016; Scardapane et al., 2017) as they outperform the values suggested by Optuna. The number of epochs used for the XOR problem is $2 0 K$ , 14K, 800 for STG/HC, DFS and SG-L1-NN respectively. Regularization parameters are $0 . 1 7 , 3 . 3 e \mathrm { ~ - ~ } 5$ and $3 e - 5$ respectively. The number of epochs used for the two-moons problem is $2 0 K$ , 1570, 708 for STG/HC, DFS and SG-L1-NN respectively. Regularization parameters are $0 . 4 8 , 9 e \mathrm { ~ - ~ } 3$ and $1 e - 3$ respectively. We note that the regularization parameters and learning procedure is different in nature, as we use an $\ell _ { 0 }$ type penalty. For the PBMC experiment, the architecture was hand-tuned using the validation set and set as [200, 100, 50, 10] with Tanh. Learning rate was 0.2 and the number of epochs 4000. The hyperparameter $\lambda$ varies in the range [0.001, 0.11] to achieve different levels of sparsity. For MADELON, we use the architecture optimized for the binary XOR classification. The number of epochs used is $2 0 K$ , the learning rate is 0.06 and $\lambda$ varies in the range [0.01, 10]. For regression, the learning rate and the $\lambda$ are optimized via Optuna using the search range $L R : [ 1 e - 4 , 1 ]$ and $\lambda : [ 1 e - 4 , 1 0 ]$ based on validation. The parameters used are the following: (SE1) architecture [600, 200, 100, 50, 1] with ReLu activations, num epochs: 5, $\lambda : 5$ , $L R : 0 . 0 0 0 1$ (SE2) architecture [600, 300, 150, 60, 20] with ReLu activations, num epochs $= 2 0 0 0$ , $\lambda : 5$ , $L R : 0 . 0 0 1$ (SE3) architecture [600, 300, 150, 60, 20] with ReLu activations, num epochs : 1000, $\lambda : 1$ , $L R : 0 . 0 0 5$ . (RCP) architecture [1000, 300, 150, 60, 20] with ReLu activation, num-epochs: 2000, $\lambda : 5 . 0$ , $L R : 0 . 0 0 1$ . (REL) architecture [26,91,63] with ReLu activation, num-epochs: 1600, $\lambda : 0 . 0 3 1$ , $L R : 0 . 0 0 7$ . (RAI) architecture [10,177] with ReLu activation, num-epochs: 1800, $\lambda : 0 . 0 1 9$ , $L R : 0 . 0 0 2$ . Architectures for SE1-SE3 and RCP where tuned manually.
|
| 595 |
+
|
| 596 |
+
The ratio of train/test/valid split is 1:1:1 for synthetic data. For the real data (RCP and REL), the train size is 6000, the test and valid size is 1000 samples. For RAI the train size is 5000, the test and valid size is 1000 samples.
|
| 597 |
+
|
| 598 |
+
In order to define the IFWR, for STG, the $d ^ { t h }$ feature weight is set to $\operatorname* { m a x } ( 0 , \operatorname* { m i n } ( 1 , \mu _ { d } + 0 . 5 ) )$ . For other neural net based methods, it is given by $\textstyle \sum _ { j } W _ { d j }$ , where $W$ is the weight matrix of the first layer. For other methods we just used the feature relevance returned by the trained model. Finally, the LASSO’s IFWR in the XOR experiment was omitted from the manuscript as it suffered from high variance.
|
| 599 |
+
|
| 600 |
+
Regarding the comparison performed in the two-moons and XOR problem, we believe that adding IFWR along with classification accuracy versus number of feature selected provides a complementary perspective in demonstrating the efficacy of feature selection techniques. We emphasize that our goal is not to just rank features but select features by assigning the weight of 0 to irrelevant features while simultaneously obtaining good predictive accuracy.
|
md/train/BJe932EYwS/BJe932EYwS.md
ADDED
|
@@ -0,0 +1,342 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# PNAT: NON-AUTOREGRESSIVE TRANSFORMER BY POSITION LEARNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Non-autoregressive models are promising on various text generation tasks. Previous work hardly considers to explicitly model the positions of generated words. However, the position modeling is an essential problem in non-autoregressive text generation. In this study, we propose PNAT, which incorporates positions as a latent variable into the text generative process. Experimental results show that PNAT achieves top results on machine translation and paraphrase generation tasks, outperforming several strong baselines.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Transformer (Vaswani et al., 2017) has been widely used in many text generation tasks, which is first proposed in neural machine translation, achieving great success for its promising performance. Nevertheless, the auto-regressive property of Transformer has been a bottleneck. Specifically, the decoder of Transformer generates words sequentially, and the latter words are conditioned on previous ones in a sentence. Such bottleneck prevents the decoder from higher efficiency in parallel computation, and imposes strong constrains in text generation, with which the generation order has to be left to right (or right to left) (Shaw et al., 2018; Vaswani et al., 2017).
|
| 12 |
+
|
| 13 |
+
Recently, many researches (Gu et al., 2018; Lee et al., 2018; Wang et al., 2019; Wei et al., 2019) are devoted to break the auto-regressive bottleneck by introducing non-autoregressive Transformer (NAT) for neural machine translation, where the decoder generates all words simultaneously instead of sequentially. Intuitively, NAT abandons feeding previous predicted words into decoder state at the next time step, but directly copy encoded representation at source side to the decoder inputs (Gu et al., 2018). However, without the auto-regressive constrain, the search space of the output sentence becomes larger (Wei et al., 2019), which brings the performance gap (Lee et al., 2018) between NAT and auto-regressive Transformer (AT). Related works propose to include some inductive priors or learning techniques to boost the performance of NAT. But most of previous work hardly consider explicitly modeling the position of output words during text generation.
|
| 14 |
+
|
| 15 |
+
We argue that position prediction is an essential problem of NAT. Current NAT approaches do not explicitly model the position of output words, and may ignore the reordering issue in generating output sentences. Compared to machine translation, the reorder problem is much more severe in tasks such as table-to-text (Liu et al., 2018) and dialog generations (Shen et al., 2017). Additionally, it is straightforward to explicitly model word positions in output sentences, as position embeddings are used in Transformer, which is natively non-autoregressive, to include the order information. Intuitively, if output positions are explicitly modeled, the predicted position combined with Transformer to realize non-autoregressive generation would become more natural.
|
| 16 |
+
|
| 17 |
+
In this paper, we propose non-autoregressive transformer by position learning (PNAT). PNAT is simple yet effective, which explicitly models positions of output words as latent variables in the text generation. Specifically, we introduce a heuristic search process to guide the position learning, and max sampling is adopted to inference the latent model. The proposed PNAT is motivated by learning syntax position (also called syntax distance). Shen et al. (2018) show that syntax position of words in a sentence could be predicted by neural networks in a non-autoregressive fashion, which even obtains top parsing accuracy among strong parser baselines. Given the observations above, we try to directly predict the positions of output words to build a NAT model for text generation.
|
| 18 |
+
|
| 19 |
+
Our proposed PNAT takes following advantages:
|
| 20 |
+
|
| 21 |
+
• We propose PNAT, which first includes positions of output words as latent variables for text generation. Experiments show that PNAT achieves very top results in non-autoregressive NMT, outperforming many strong baselines. PNAT also obtains better results than AT in paraphrase generation task. Further analysis shows that PNAT has great potentials. With the increase of position prediction accuracy, performances of PNAT could increase significantly. The observations may shed light on the future direction of NAT. Thanks to the explicitly modeling of position, we could control the generation by facilitating the position latent variable, which may enable interesting applications such as controlling one special word left to another one. We leave this as future work.
|
| 22 |
+
|
| 23 |
+
# 2 BACKGROUND
|
| 24 |
+
|
| 25 |
+
# 2.1 AUTOREGRESSIVE DECODING
|
| 26 |
+
|
| 27 |
+
A target sequence $Y { = } y _ { 1 : M }$ is decomposed into a series of conditional probabilities autoregressively, each of which is parameterized using neural networks. This approach has become a de facto standard in language modeling(Sundermeyer et al., 2012), and has been also applied to conditional sequence modeling $p ( Y | X )$ by introducing an additional conditional variable $X { = } x _ { 1 : N }$ :
|
| 28 |
+
|
| 29 |
+
$$
|
| 30 |
+
p ( \boldsymbol { Y } | \boldsymbol { X } ) = \prod _ { t = 1 } ^ { M } p ( y _ { t } | y _ { < t } , \boldsymbol { X } ; \theta )
|
| 31 |
+
$$
|
| 32 |
+
|
| 33 |
+
With different choices of neural network architectures such as recurrent neural networks (RNNs) (Bahdanau et al., 2014; Cho et al., 2014), convolutional neural networks (CNNs) (Krizhevsky et al., 2012; Gehring et al., 2017), as well as self-attention based transformer (Vaswani et al., 2017), the autoregressive decoding has achieved great success in tasks such as machine translation (Bahdanau et al., 2014), paraphrase generation (Gupta et al., 2018), speech recognition (Graves et al., 2013), etc.
|
| 34 |
+
|
| 35 |
+
# 2.2 NON-AUTOREGRESSIVE DECODING
|
| 36 |
+
|
| 37 |
+
Autoregressive model suffers from the issue of slow decoding in inference, because tokens are generated sequentially and each of them depends on previous ones. As a solution to this issue, Gu et al. (2018) proposed Non-Autoregressive Transformer (denoted as NAT) for machine translation, breaking the dependency among the target tokens through time by decoding all the tokens simultaneously. Put simply, NAT (Gu et al., 2018) factorizes the conditional distribution over a target sequence into a series of conditionally independent distributions with respect to time:
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
p ( { \cal Y } | { \cal X } ) = p _ { L } ( { \cal M } | { \cal X } : \theta ) \cdot \prod _ { t = 1 } ^ { M } p ( y _ { t } | { \cal X } )
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
which allows trivially finding the most likely target sequence by arg $\operatorname* { m a x } _ { Y }$ $p ( Y | X )$ for each timestep $t$ , effectively bypassing computational overhead and sub-optimality in decoding from an autoregressive model.
|
| 44 |
+
|
| 45 |
+
Although non-autoregressive models achieves $1 5 \times$ speedup in machine translation compared with autoregressive models, it comes at the expense of potential performance degradation (Gu et al., 2018). The degradation results from the removal of conditional dependencies within the decoding sentence $y _ { t }$ depend on $y _ { < t , }$ ). Without such dependencies, the decoder is hard to leverage the inherent sentence structure in prediction.
|
| 46 |
+
|
| 47 |
+
# 2.3 LATENT VARIABLES FOR NON-AUTOREGRESSIVE DECODING
|
| 48 |
+
|
| 49 |
+
A non-autoregressive model could be incorporated with conditional dependency as latent variable to alleviate the degradation resulted from the absence of dependency:
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
P ( Y | X ) = \int _ { z } P ( z | X ) \prod _ { t = 1 } ^ { M } P ( y _ { t } | z , X ) d z
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
For example, NAT-FT (Gu et al., 2018) models the inherent sentence structure with a latent fertility variable, which represents how many target tokens that a source token would translate to. Lee et al. (2018) introduces $L$ intermediate predictions $Y ^ { 1 : L }$ as random variables , and to refine the predictions from $Y ^ { 1 }$ to $Y ^ { L }$ in a iterative manner.
|
| 56 |
+
|
| 57 |
+
# 3 PNAT: POSITION-BASED NON-AUTOREGRESSIVE TRANSFORMER
|
| 58 |
+
|
| 59 |
+
We propose position-based non-autoregressive transformer (PNAT), an extension to transformer incorporated with non auto-regressive decoding and position learning.
|
| 60 |
+
|
| 61 |
+
# 3.1 MODELING POSITION WITH LATENT VARIABLES
|
| 62 |
+
|
| 63 |
+
Languages are usually inconsistent with each other in word order. Thus reordering is usually required when translating a sentence from a language to another. In NAT family, words representations or encoder states at source side are copied to the target side to feed into decoder as its input. Previously, Gu et al. (2018) utilizes positional attention which incorporates positional encoding into decoder attention to perform local reordering. But such implicitly reordering mechanism by position attention may cause a repeated generation problem, because position learning module is not optimized directly, and is likely to be misguided by target supervision.
|
| 64 |
+
|
| 65 |
+
To tackle with this problem, we propose to explicitly model the position as a latent variable. We rewrite the target sequence $Y$ with its corresponding position latent variable $z = z _ { 1 : M }$ as a set $Y _ { z } =$ $y _ { z _ { 1 } : z _ { M } }$ . The conditional probability $P ( { Y \vert { X } } )$ is factorized with respect to the position latent variable:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
P ( Y | X ) = \sum _ { z \in \pi ( M ) } P ( z | X ) \cdot P ( Y | z , X )
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
where $\pi ( M )$ is a set consisting of permutations with $M$ elements. At decoding time, the factorization allows us to decode sentences in parallel by pre-predicting the corresponding position variables $z$ .
|
| 72 |
+
|
| 73 |
+
# 3.2 MODEL ARCHITECTURE
|
| 74 |
+
|
| 75 |
+

|
| 76 |
+
attention over the output of the encoder stack. Similar to the encoder, we employ residual connectionsaround each of the sub-layers, followed by layer normalization. We also modify the self-attention around each of the sub-layers, followed by layer normalization. We also modify the self-attentionFigure 1: Illustration of the proposed model, where the black solid arrows represent differentiable sub-layer in the decoder stack to prevent positions from attending to subsequent positions. Tmasking, combined with fact that the output embeddings are offset by one position, ensures thatsub-layer in the decoder stack to prevent positions frommasking, combined with fact that the output embeddings aconnections and the dashed arrows are non-differentiable operations.
|
| 77 |
+
|
| 78 |
+
As shown in Figure 1, PNAT is composed of four modules: an encoder stack, a bridge block, a 3.2 Attention 3.2 Attentionposition predictor as well as a decoder stack. Before detailing each component of PNAT model, we overview the architecture for a brief understanding.
|
| 79 |
+
|
| 80 |
+
Like most sequence-to-sequence models, PNAT first encodes a source sequence $X { = } x _ { 1 : N }$ into its contextual word representations $\scriptstyle { E = e _ { 1 : N } }$ with the encoder stack. With generated contextual word representation $E$ at source side, the bridge block is leveraged to computed the target length $M$ as well as the corresponding features $D { = } d _ { 1 : { M } }$ , which is fed into the decoder as its input. It is worth noting that the decoder inputs $D$ is computed without reordering. Thus the position predictor is introduced to deal with this issue by predicting a permutation $z { = } z _ { 1 : { M } }$ over $D$ . Finally, PNAT generates the target sequence from the decoder input $D$ and its permutation $_ z$ .
|
| 81 |
+
|
| 82 |
+
Encoder and Decoder Given a source sentence $X$ with length $N$ , PNAT encoder produces its contextual word representations $E$ . The contextual word representations $E$ are further used in computing target length $M$ and decoder initial states $D$ , and are also used as memory of attention at decoder side.
|
| 83 |
+
|
| 84 |
+
Generally, PNAT decoder can be considered as a transformer with a broader vision, because it leverages future word information that is blind to the autoregressive transformer. Intuitively, we use relative position encoding in self-attention(Shaw et al., 2018), rather than absolute one that is more likely to cause position errors. Following Shaw et al. (2018) with a clipping distance $d$ (usually $d \geq 2 \AA$ ) set for relative positions, we preserve $d = 4$ relations.
|
| 85 |
+
|
| 86 |
+
Bridge The bridge module predicts the target length $M$ , and initializes the decoder inputs $D$ from the source representations $E$ . The target length $M$ could be estimated from the source encoder representation:
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
M = N + \arg \operatorname* { m a x } \phi ( E )
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
where $\phi ( \cdot )$ produces a categorical distribution ranged in $[ - B , B ]$ $B = 2 0$ ). It is notable that we use the predicted length at inference stage, although during training, we simply use the length of each reference target sequence. Then, we adopt the method proposed by Li et al. (2019) to compute $D$ . Given the source representation $E$ and the estimated target length $M$ , we linearly combine the embeddings of the neighboring source tokens to generate $D$ as follows:
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
d _ { j } = \sum _ { i } w _ { j i } \cdot e _ { i }
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
w _ { j i } = \mathrm { s o f t m a x } ( - | j - i | / \tau )
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
where $w _ { j i }$ is a normalized weight that reflects the contribution of $e _ { i }$ to $d _ { j }$ , and $\tau$ is a hyperparameter indicating the sharpness of the weight distribution.
|
| 103 |
+
|
| 104 |
+
Position Predictor For the proposed PNAT, we model position permutations with a position predictor. As shown in Figure 1, the position predictor takes the decoder inputs $D$ and the source representation $E$ to predict a permutation $_ z$ . The position predictor has a sub-encoder which stacks multiple layers of encoder units to predict its predicted input $R { = } r _ { 1 : { M } }$ .
|
| 105 |
+
|
| 106 |
+
With the predicted inputs $R$ , we conduct an autoregressive position predictor, denoted as AR-Predictor. The AR-Predictor searches a permutation $_ { z }$ with:
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
P ( \boldsymbol { z } | D , E ) = \prod _ { t = 1 } ^ { M } p _ { ( } z _ { t } | \boldsymbol { z } _ { < t } , D , E ; \boldsymbol { \theta } )
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
where $\theta$ is the parameter of AR-Predictor, which includes a RNN-based model incorporated with a pointer network (Vinyals et al., 2015).
|
| 113 |
+
|
| 114 |
+
To purse the efficiency of decoding, we also explore a non-autoregressive version for the position predictor, denoted as NAR-Predictor, to model the position permutation probabilities with:
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
P ( z | D , E ) = \prod _ { t = 1 } ^ { M } p ( z _ { t } | D , E ; \theta )
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
To obtain the permutation $_ { z }$ , AR-Predictor performs greedy search whereas NAR-Predictor performs direct arg max. We chose the AR-Predictor as our mainly position module in PNAT, and we also analyze the effectiveness of position modeling in Sec. 4.4.
|
| 121 |
+
|
| 122 |
+
# 3.3 TRAINING
|
| 123 |
+
|
| 124 |
+
Training requires maximizing the marginalized likelihood in Eqn. 4. However, this is intractable since we need to enumerate all the $M !$ permutations of tokens. We therefore optimize this objective by Monte Carlo sampling method with a heuristic search algorithm.
|
| 125 |
+
|
| 126 |
+
Heuristic Search for Positions Intuitively, each target token should have a corresponding decoder input, and meanwhile each decoder input should be assigned to a target token. Based on this idea, we design a heuristic search algorithm to allocate positions. Given the decoder inputs and its target tokens, we first estimate the similarity between each pair of the decoder input $d _ { i }$ and the target token embedding $y _ { j }$ , which is also the weights of the target word classifier:
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
\mathrm { s i m } _ { i , j } = \mathrm { c o s i n e } \left( d _ { i } , y _ { j } \right)
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+
Based on the cosine similarity matrix, HSP is designed to find a perfect matching between decoder inputs and target tokens:
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
\mathrm { H S P } ( z ) = \underset { z } { \arg \operatorname* { m a x } } \sum _ { i = 0 } ^ { M } ( \ s i \mathrm { m } _ { i , z _ { i } } )
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
Here we apply a greedy algorithm to select the pair with the highest similarity score iteratively until a permutation $z _ { \mathrm { r e f } }$ is generated. More details are provided in Appendix A.
|
| 139 |
+
|
| 140 |
+
The intuition behind is that, if the decoder input $d _ { i }$ is already the most similar one to a target word, it would be easier to keep and even reinforce this association in learning the model. We also analyze the effectiveness of the HSP in the Sec. 4.4.
|
| 141 |
+
|
| 142 |
+
Objective Function With the heuristically discovered positions as reference positions $z _ { \mathrm { r e f } }$ , the position predictor could be trained with a position loss:
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
\mathcal { L } _ { \mathrm { p } } = - \log P ( z _ { \mathrm { r e f } } | D , E )
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
Grounding on the referenced positions, the generative process of target sequences is optimized by:
|
| 149 |
+
|
| 150 |
+
$$
|
| 151 |
+
\mathcal { L } _ { \mathrm { g } } = - \sum _ { t = 1 } ^ { M } \log P ( Y | z _ { \mathrm { r e f } } ; X )
|
| 152 |
+
$$
|
| 153 |
+
|
| 154 |
+
Finally, combining two loss functions mentioned above, a full-fledged loss is derived as
|
| 155 |
+
|
| 156 |
+
$$
|
| 157 |
+
{ \mathcal { L } } = { \mathcal { L } } _ { \mathrm { g } } + \alpha { \mathcal { L } } _ { \mathrm { p } }
|
| 158 |
+
$$
|
| 159 |
+
|
| 160 |
+
The length predictor is a classifier that follows the previous settings. We also follow the previous practice (Gu et al., 2018; Wei et al., 2019) and perform an extra training process for the length predictor after the model trained and do not tune the parameter of the encoder.
|
| 161 |
+
|
| 162 |
+
# 3.4 INFERENCE
|
| 163 |
+
|
| 164 |
+
We follow the common choice of approximating decoding algorithms (Gu et al., 2018; Lee et al., 2018) to reduce the search space of latent variable model.
|
| 165 |
+
|
| 166 |
+
Argmax Decoding Following Gu et al. (2018), one simple and effective method is to select the best sequence by choosing the highest-probability latent sequence $z$ :
|
| 167 |
+
|
| 168 |
+
$$
|
| 169 |
+
\begin{array} { c } { { z ^ { * } = \arg \operatorname* { m a x } _ { z } P ( z | D , E ) } } \\ { { } } \\ { { Y ^ { * } = \arg \operatorname* { m a x } _ { y } P ( Y | z ^ { * } , X ) } } \end{array}
|
| 170 |
+
$$
|
| 171 |
+
|
| 172 |
+
where identifying $Y ^ { * }$ only requires independently maximizing the local probability for each output position.
|
| 173 |
+
|
| 174 |
+
Length Parallel Decoding We also consider the common practice of noisy parallel decoding (Gu et al., 2018), which generates a number of decoding candidates in parallel and selects the best via re-scoring using a pre-trained autoregressive model. For PNAT, we first predict the target length as $\hat { M }$ , then generate output sequence with argmax decoding for each target length candidate $M \in$ $[ \hat { M } - \Delta M , \hat { M } + \Delta M ]$ ( $M = 4$ in our experiments), which was called length parallel decoding (LPD). Then we use the pre-trained autoregressive model to rank these sequences and identify the best overall output as the final output.
|
| 175 |
+
|
| 176 |
+
# 4 EXPERIMENTS
|
| 177 |
+
|
| 178 |
+
We test PNAT on several benchmark sequence generation tasks. We first describe the experimental setting and implementation details and then present the main results, followed by some deep studies.
|
| 179 |
+
|
| 180 |
+
# 4.1 EXPERIMENTAL SETTING
|
| 181 |
+
|
| 182 |
+
To show the generation ability of PNAT, we conduct experiments on the popular machine translation and paraphrase generation tasks. These sequence generation task evaluation models from different perspectives. Translation tasks test the ability of semantic transforming across bilingual corpus. While paraphrase task focuses on substitution between the same languages while keeping the semantics.
|
| 183 |
+
|
| 184 |
+
Machine Translation We valid the effectiveness of PNAT on the most widely used benchmarks for machine translation — WMT14 EN-DE(4.5M pairs) and IWSLT16 DE-EN(196K pairs). The dataset is processed with Moses script (Koehn et al., 2007), and the words are segmented into subword units using byte-pair encoding (Sennrich et al., 2016, BPE). For both WMT datasets, the source and target languages share the same set of subword embeddings while for IWSLT we use separate embeddings.
|
| 185 |
+
|
| 186 |
+
Paraphrase Generation We conduct experiments following previous work (Miao et al., 2019) for paraphrase generation. We make use of the established Quora dataset 1 to evaluate on the paraphrase generation task. We consider the supervised paraphrase generation and split the Quora dataset in the standard setting. We sample $1 0 0 \mathrm { k }$ pairs sentence as training data, and holds out 3k, 30k for validation and testing, respectively.
|
| 187 |
+
|
| 188 |
+
# 4.2 IMPLEMENTATION DETAILS
|
| 189 |
+
|
| 190 |
+
Module Setting For machine translation, we follow the settings from Gu et al. (2018). In the case of IWSLT task, we use a small setting $( d _ { \mathrm { m o d e l } } = 2 7 8$ , $d _ { \mathrm { h i d d e n } } = 5 0 7$ , $p _ { \mathrm { d r o p o u t } } = 0 . 1$ , $n _ { \mathrm { l a y e r } } = 5$ and nhead $= 2$ ) suggested by Gu et al. (2018) for Transformer and NAT models. For WMT task, we use the base setting of the Vaswani et al. (2017) $\dot { d } _ { \mathrm { m o d e l } } = 5 1 2$ , $d _ { \mathrm { h i d d e n } } = 5 1 2$ , $p _ { \mathrm { d r o p o u t } } = 0 . 1$ , $n _ { \mathrm { l a y e r } } = 6 $ ).
|
| 191 |
+
|
| 192 |
+
For paraphrase generation, we follow the settings from Miao et al. (2019), and set the 300-dimensional GRU with 2 layer for Seq-to-Seq (GRU). We empirically select a Transformer and NAT models with hyperparameters $\dot { d } _ { \mathrm { m o d e l } } = 4 0 0$ , $d _ { \mathrm { h i d d e n } } = 8 0 0$ , $p _ { \mathrm { d r o p o u t } } = 0 . 1$ , $n _ { \mathrm { l a y e r } } = 3$ and $n _ { \mathrm { h e a d } } = 4$ ).
|
| 193 |
+
|
| 194 |
+
Optimization We optimize the parameter with the Adam optimizer (Kingma & Ba, 2014). The hyperparameter $\alpha$ used in Eqn. 14 was be set to 1.0 for WMT, 0.3 for IWSLT and Quora. We also use inverse square root learning rate scheduling (Vaswani et al., 2017) for the WMT, and using linear annealing (from $3 e - 4$ to $1 e - 5$ , suggested by Lee et al. (2018)) for the IWSLT and Quora. Each mini-batch consists of approximately 2K tokens for IWSLT and Quora, 32K tokens for WMT.
|
| 195 |
+
|
| 196 |
+
Knowledge Distillation Sequence-level knowledge distillation is applied to alleviate multimodality problem while training, using Transformer as a teacher (Hinton et al., 2015). Previous studies on non-autoregressive generation (Gu et al., 2018; Lee et al., 2018; Wei et al., 2019) have used translations produced by a pre-trained Transformer model as the training data, which significantly improves the performance. We follow this setting in translation tasks.
|
| 197 |
+
|
| 198 |
+
Table 1: Performance on the newstest-2014 for WMT14 EN-DE and test2013 for IWSLT EN-DE. ‘-’ denotes same numbers as above. ‘\*’ indicates our implementation. The decoding speed is measured sentence-by-sentence and the speedup is computed by comparing with Transformer.
|
| 199 |
+
|
| 200 |
+
<table><tr><td>Model</td><td>WMT14 EN-DE DE-EN</td><td>IWSLT16 DE-EN</td><td></td><td>Speedup</td></tr><tr><td colspan="3">Autoregressive Methods</td><td></td><td></td></tr><tr><td>Transformer-base (Vaswani et al., 2017) *Transformer(Beam=4)</td><td>27.30 27.40</td><td>1 31.33</td><td>34.81</td><td>1.0×</td></tr><tr><td colspan="3">Non-Autoregressive Methods</td><td></td><td></td></tr><tr><td>Flowseq (Ma et al., 2019)</td><td>18.55</td><td>23.36</td><td></td><td></td></tr><tr><td>*NAT-base</td><td>/</td><td>11.02</td><td></td><td>/</td></tr><tr><td>*PNAT</td><td>19.73 NAT w/ Knowledge Distillation</td><td>24.04</td><td></td><td>/</td></tr><tr><td>NAT-FT (Gu et al., 2018) LT (Kaiser et al., 2018) IR-NAT (Lee et al., 2018)</td><td>17.69 19.80 13.91</td><td>21.47 /</td><td>/ / 27.68</td><td>15.6× 5.8×</td></tr><tr><td>ENAT (Guo et al., 2019) NAT-REG (Wang et al., 2019) imitate-NAT (Wei et al.,2019) Flowseq (Ma et al.,2019)</td><td>20.65 20.65 22.44</td><td>16.77 23.02 24.77 25.67</td><td>/ / 1</td><td>9.0× 24.3× 1 18.6×</td></tr><tr><td>*NAT-base</td><td>21.45 1 23.05</td><td>26.16 16.69</td><td>一</td><td>1.1× 13.5x</td></tr><tr><td colspan="3">*PNAT 27.18 NATw/Reranking orIterative Refinments</td><td>31.23</td><td>7.3×</td></tr><tr><td>NAT-FT (rescoring 10 candidates) LT (rescoring 10 candidates) IR-NAT (refinement 10)</td><td>18.66 22.50</td><td>22.42 /</td><td>/ 一</td><td>7.7× /</td></tr><tr><td>ENAT (rescoring 9 candidates)</td><td>21.61 24.28</td><td>25.48 26.10</td><td>32.31 /</td><td>1.3× 12.4×</td></tr><tr><td>NAT-REG (rescoring 9 candidates) imitate-NAT (rescoring 9 candidates)</td><td>24.61 24.15</td><td>28.90 27.28</td><td>/ /</td><td>1 9.7×</td></tr><tr><td>Flowseq (rescoring 30 candidates) *PNAT (LPD n=9,△M=4)</td><td>23.48 24.48</td><td>28.40 29.16</td><td>/ 32.60</td><td>/ 3.7x</td></tr></table>
|
| 201 |
+
|
| 202 |
+
# 4.3 MAIN RESULTS
|
| 203 |
+
|
| 204 |
+
Machine Translation We compare the PNAT with strong NAT baselines, including the NAT with fertility (Gu et al., 2018, NAT-FT), the NAT with iterative refinement (Lee et al., 2018, IR-NAT), the NAT with regularization (Wang et al., 2019, NAT-REG), the NAT with enhanced decoder input (Guo et al., 2019, ENAT), the NAT with learning from auto-regressive model (Wei et al., 2019, imitateNAT), the NAT build on latent variables (Kaiser et al., 2018, LT), and the flow-based NAT model (Ma et al., 2019, Flowseq).
|
| 205 |
+
|
| 206 |
+
The results are shown in Table 1. We basically compare the proposed PNAT against the autoregressive counterpart both in terms of generation quality, which is measured with BLEU (Papineni et al., 2002) and inference speedup. For all our tasks, we obtain the performance of competitors by either directly using the performance figures reported in the previous works if they are available or producing them by using the open source implementation of baseline algorithms on our datasets.2 Clearly, PNAT achieves a comparable or better result to previous NAT models on both WMT and IWSLT tasks.
|
| 207 |
+
|
| 208 |
+
We list the result of the NAT models trained without using knowledge distillation in the second block of the Table 1. The PNAT achieves significant improvements (more than 13.0 BLEU points) over the naive baselines, which indicate that position learning greatly contributes to improve the model capability of NAT model. The PNAT also achieves a better result than the Flowseq around 1.0 BLEU, which demonstrates the effectiveness of PNAT in modeling dependencies between the target outputs.
|
| 209 |
+
|
| 210 |
+
As shown in the third block of the Table 1, without using reranking techniques, the PNAT outperforms all the competitors with a large margin, achieves a balance between performance and efficiency. In particular, the previous state-of-the-art(WMT14 DE-EN) Flowseq achieves good performance with the slow speed $( 1 . 1 \times )$ , while PNAT goes beyond Flowseq in both respects.
|
| 211 |
+
|
| 212 |
+
Our best results are obtained with length parallel decoding which employ autoregressive model to rerank the multiple generation candidates of different target length. Specifically, on the large scale WMT14 DE-EN task, PNAT $( + \mathrm { L P D } )$ surpass the NAT-REG by 0.76 BLEU score. Without reranking, the gap has increased to 2.4 BLEU score (27.18 v.s. 24.77). The experiments shows the power of explicitly position modeling which reduces the gap between non-autoregressive and the autoregressive models.
|
| 213 |
+
|
| 214 |
+
Paraphrase Generation Given a sentence, paraphrase generation aims to synthesize another sentence that is different from the given one, but conveys the same meaning. Comparing with translation task, paraphrase generation prefers a more similar order between source and target sentence, which possibly learn a trivial position model. PNAT can potentially yield better results with the position model to infer the relatively ordered alignment relationship.
|
| 215 |
+
|
| 216 |
+
Table 2: Results on validation set and test set of Quora.
|
| 217 |
+
|
| 218 |
+
<table><tr><td>Model Valid</td><td>Paraphrase(BLEU) Test</td></tr><tr><td>Seq-to-seq(GRU) Transformer</td><td>24.68 24.75 25.46</td></tr><tr><td>NAT-base</td><td>25.88 19.80</td></tr><tr><td>PNAT 29.30</td><td>20.34 29.00</td></tr></table>
|
| 219 |
+
|
| 220 |
+
The results of the paraphrase generation are shown in Table 2. In consist with our intuition, PNAT achieves the best result on this task and even surpass Transformer around 3.5 BLEU. The NAT model is not powerful enough to capture the latent position relationship. The comparison between NAT-base and PNAT shows that explicit position modeling in PNAT plays a crucial role in generating sentences.
|
| 221 |
+
|
| 222 |
+
# 4.4 ANALYSIS
|
| 223 |
+
|
| 224 |
+
Effectiveness of Heuristic Searched Position First, we analyze whether the position derived from the heuristic search is suitable for use as supervision to the position predictor. We evaluate the effectiveness of the searched position by training a PNAT as before and testing with the heuristic searched position instead of the predicted position. As shown in the second block of the Table 3, it is easier noticed that as PNAT w/ HSP achieves a significant improvement over the NAT-base and the Transformer, which demonstrates that the heuristic search for the position is effective.
|
| 225 |
+
|
| 226 |
+
<table><tr><td>Model</td><td colspan="2">Position Accuracy(%) permutation-acc relative-acc(r=4)</td><td>WMT14DE-EN BLEU</td><td>Speed Up</td></tr><tr><td>Transformer(beam=4)</td><td>/</td><td>1</td><td>30.68</td><td>1.0×</td></tr><tr><td>NAT-base</td><td>/</td><td>/</td><td>16.71</td><td>13.5×</td></tr><tr><td>PNATw/HSP</td><td>100.00</td><td>100.00</td><td>46.03</td><td>12.5×</td></tr><tr><td>PNATw/AR-Predictor</td><td>25.30</td><td>59.27</td><td>27.11</td><td>7.3×</td></tr><tr><td>PNAT w/NAR-Predictor</td><td>23.11</td><td>55.57</td><td>20.81</td><td>11.7×</td></tr></table>
|
| 227 |
+
|
| 228 |
+
Table 3: Results on validation set of WMT14 DE-EN with different position strategy. “HSP” means the reference position sequence derived from the heuristic position searching.
|
| 229 |
+
|
| 230 |
+
Effectiveness and Efficiency of Position Modeling We are also analysis the accuracy of our position modeling and its influence on the quality of generation on the WMT14 DE-EN task. For evaluating the position accuracy, we adopt the heuristic searched position as the position reference (denoted as “HSP”), which is the training target of the position predictor. PNAT requires the position information at two places. The first is the mutual relative relationship between the states that will be used during decoding. And the second is to reorder the decoded output after decoding. We then propose the corresponding metrics for evaluation, which is the relative position accuracy (with relation threshold $r = 4$ ) and the permutation accuracy.
|
| 231 |
+
|
| 232 |
+
As shown in Table 3, better position accuracy always yields better generation performance. The non-autoregressive position model is less effective than the current autoregressive position model, both in the accuracy of the permutation and the relative position. Even though the current PNAT with a simple AR-Predictor has surpassed the previous NAT model, the position accuracy is still less desirable (say, less than $30 \%$ ) and has a great exploration space. We provide a few examples in Appendix B. There is also a trade-off between the effectiveness and efficiency, the choice of the non-autoregressive means the efficiency and the choice of autoregressive means the effectiveness.
|
| 233 |
+
|
| 234 |
+
Repeated Generation Analysis Previous NAT often suffers from the repeated generation problem due to the lack of sequential position information. NAT is less effective to distinguish adjacent decoder hidden states, which is copied from the adjacent source representation. To further study this problem, we proposed to evaluate the gains of simply remove the repeated tokens. As shown in Table 4, we perform the repeated generation analysis on the paraphrase generation tasks. Removing repeated tokens has little impact for PNAT model, with only 0.05 BLEU differences. However for the NAT-base model, the gap comes with almost 1 BLEU (0.89). The results clearly demonstrate that the explicitly position model essentially learns the sequential information for sequence generation.
|
| 235 |
+
|
| 236 |
+
Table 4: Results on test set of Quora.
|
| 237 |
+
|
| 238 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">Paraphrase(Test-BLEU)</td><td></td></tr><tr><td>w/ remove repeats</td><td>w/o remove repeats</td><td>△BLEU</td></tr><tr><td>NAT-base</td><td>20.34</td><td>19.45</td><td>0.89</td></tr><tr><td>PNAT</td><td>29.00</td><td>28.95</td><td>0.05</td></tr></table>
|
| 239 |
+
|
| 240 |
+
Convergence Efficiency We also perform the training efficiency analysis in IWSLT16 DE-EN Translation task. The learning curves are shown in 2. The curve of the PNAT is on the top-left corner. Remarkably, PNAT has the best convergence speed compared with the NAT competitors and even a strong autoregressive model. The results are in line with our intuition, that the position learning brings meaningful information of position relationship and benefits the generation of the target sentence.
|
| 241 |
+
|
| 242 |
+

|
| 243 |
+
Figure 2: The learning curves from training of models on evaluation set of IWSLT-16 DE-EN. Mini-batch size is 2048 tokens.
|
| 244 |
+
|
| 245 |
+
# 5 RELATED WORK
|
| 246 |
+
|
| 247 |
+
Gu et al. (2018) first develops a non-autoregressive Transformer for neural machine translation (NMT) tasks, which produces the outputs in parallel and the inference speed is thus significantly boosted.
|
| 248 |
+
|
| 249 |
+
Due to the removal of the dependencies between the target outputs, it comes at the cost that the translation quality is largely sacrificed. A line of work has been proposed to mitigate such performance degradation. Some previous work is focused on enhancing the decoder inputs by replacing the target words as inputs, such as Guo et al. (2019) and Lee et al. (2018). Lee et al. (2018) proposed a method of iterative refinement based on the latent variable model and denoising autoencoder. Guo et al. (2019) enhances decoder input by introducing the phrase table in statistical machine translation and embedding transformation. Another part of previous work focuses on improving the supervision of NAT’s decoder states, including imitation learning from autoregressive models (Wei et al., 2019) or regularizing the decoder state with backward reconstruction error (Wang et al., 2019). There is also a line studies build upon latent variables, such as Kaiser et al. (2018) and Roy et al. (2018) utilize discrete latent variables for making decoding more parallelizable. Moreover, Shao et al. (2019) also proposed a method to retrieve the target sequential information for NAT models. Unlike previous work, we explicitly model the position, which has shown its importance to the autoregressive model and can well model the dependence between states. To the best of our knowledge, PNAT is the first work to explicitly model position information for non-autoregressive text generation.
|
| 250 |
+
|
| 251 |
+
# 6 CONCLUSION
|
| 252 |
+
|
| 253 |
+
We proposed PNAT, a non-autoregressive transformer by explicitly modeled positions, which bridge the performance gap between the non-autoregressive decoding and autoregressive decoding. Specifically, we model the position as latent variables, and training with heuristic searched positions with MC algorithms. As a result, PNAT leads to significant improvement and move more close to the performance gap between the NAT and AT on machine translation tasks. Besides, the experimental results of the paraphrase generation task show that the performance of the PNAT can exceed that of the autoregressive model, and at the same time, it also has a large improvement space. According to our further analysis on effectiveness of position modeling, in future work, we can still enhance the performance of the NAT model by strengthening position learning.
|
| 254 |
+
|
| 255 |
+
# REFERENCES
|
| 256 |
+
|
| 257 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014.
|
| 258 |
+
|
| 259 |
+
Kyunghyun Cho, Bart van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder–decoder for statistical machine translation. In EMNLP, pp. 1724–1734, 2014.
|
| 260 |
+
|
| 261 |
+
Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N Dauphin. Convolutional sequence to sequence learning. In ICML, pp. 1243–1252, 2017.
|
| 262 |
+
|
| 263 |
+
Alex Graves, Abdel-rahman Mohamed, and Geoffrey Hinton. Speech recognition with deep recurrent neural networks. In 2013 IEEE international conference on acoustics, speech and signal processing, pp. 6645–6649. IEEE, 2013.
|
| 264 |
+
|
| 265 |
+
Jiatao Gu, James Bradbury, Caiming Xiong, Victor O.K. Li, and Richard Socher. Non-autoregressive neural machine translation. In ICLR, 2018.
|
| 266 |
+
|
| 267 |
+
Junliang Guo, Xu Tan, Di He, Tao Qin, Linli Xu, and Tie-Yan Liu. Non-autoregressive neural machine translation with enhanced decoder input. In AAAI, volume 33, pp. 3723–3730, 2019.
|
| 268 |
+
|
| 269 |
+
Ankush Gupta, Arvind Agarwal, Prawaan Singh, and Piyush Rai. A deep generative framework for paraphrase generation. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
|
| 270 |
+
|
| 271 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
|
| 272 |
+
|
| 273 |
+
Lukasz Kaiser, Samy Bengio, Aurko Roy, Ashish Vaswani, Niki Parmar, Jakob Uszkoreit, and Noam Shazeer. Fast decoding in sequence models using discrete latent variables. In ICML, pp. 2395–2404, 2018.
|
| 274 |
+
|
| 275 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 276 |
+
|
| 277 |
+
Philipp Koehn, Hieu Hoang, Alexandra Birch, Chris Callison-Burch, Marcello Federico, Nicola Bertoldi, Brooke Cowan, Wade Shen, Christine Moran, Richard Zens, Chris Dyer, Ondˇrej Bojar, Alexandra Constantin, and Evan Herbst. Moses: Open source toolkit for statistical machine translation. In ACL, pp. 177–180, 2007.
|
| 278 |
+
|
| 279 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, pp. 1097–1105, 2012.
|
| 280 |
+
|
| 281 |
+
Jason Lee, Elman Mansimov, and Kyunghyun Cho. Deterministic non-autoregressive neural sequence modeling by iterative refinement. In EMNLP, pp. 1173–1182, 2018.
|
| 282 |
+
|
| 283 |
+
Zhuohan Li, Di He, Fei Tian, Tao Qin, Liwei Wang, and Tie-Yan Liu. Hint-based training for non-autoregressive translation. In NeuralIPS (to appear), 2019.
|
| 284 |
+
|
| 285 |
+
Tianyu Liu, Kexiang Wang, Lei Sha, Baobao Chang, and Zhifang Sui. Table-to-text generation by structure-aware seq2seq learning. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
|
| 286 |
+
|
| 287 |
+
Xuezhe Ma, Chunting Zhou, Xian Li, Graham Neubig, and Eduard Hovy. FlowSeq: Nonautoregressive conditional sequence generation with generative flow. In EMNLP-IJCNLP, pp. 4273–4283, Hong Kong, China, November 2019. doi: 10.18653/v1/D19-1437. URL https://www.aclweb.org/anthology/D19-1437.
|
| 288 |
+
|
| 289 |
+
Ning Miao, Hao Zhou, Lili Mou, Rui Yan, and Lei Li. CGMH: Constrained sentence generation by Metropolis-Hastings sampling. In AAAI, 2019.
|
| 290 |
+
|
| 291 |
+
Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. BLEU: A method for automatic evaluation of machine translation. In ACL, pp. 311–318, 2002.
|
| 292 |
+
|
| 293 |
+
Aurko Roy, Ashish Vaswani, Niki Parmar, and Arvind Neelakantan. Towards a better understanding of vector quantized autoencoders. 2018.
|
| 294 |
+
|
| 295 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In ACL, pp. 1715–1725, 2016.
|
| 296 |
+
|
| 297 |
+
Chenze Shao, Yang Feng, Jinchao Zhang, Fandong Meng, Xilin Chen, and Jie Zhou. Retrieving sequential information for non-autoregressive neural machine translation. In ACL, 2019.
|
| 298 |
+
|
| 299 |
+
Peter Shaw, Jakob Uszkoreit, and Ashish Vaswani. Self-attention with relative position representations. In NAACL-HLT, pp. 464–468, 2018.
|
| 300 |
+
|
| 301 |
+
Xiaoyu Shen, Hui Su, Yanran Li, Wenjie Li, Shuzi Niu, Yang Zhao, Akiko Aizawa, and Guoping Long. A conditional variational framework for dialog generation. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pp. 504–509, 2017.
|
| 302 |
+
|
| 303 |
+
Yikang Shen, Zhouhan Lin, Athul Paul Jacob, Alessandro Sordoni, Aaron Courville, and Yoshua Bengio. Straight to the tree: Constituency parsing with neural syntactic distance. In ACL, pp. 1171–1180, 2018.
|
| 304 |
+
|
| 305 |
+
Martin Sundermeyer, Ralf Schluter, and Hermann Ney. Lstm neural networks for language modeling. ¨ In Thirteenth annual conference of the international speech communication association, 2012.
|
| 306 |
+
|
| 307 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NIPS, pp. 5998–6008, 2017.
|
| 308 |
+
|
| 309 |
+
Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer networks. In NIPS, pp. 2692–2700, 2015.
|
| 310 |
+
|
| 311 |
+
Yiren Wang, Fei Tian, Di He, Tao Qin, ChengXiang Zhai, and Tie-Yan Liu. Non-autoregressive machine translation with auxiliary regularization. In AAAI, 2019.
|
| 312 |
+
|
| 313 |
+
Bingzhen Wei, Mingxuan Wang, Hao Zhou, Junyang Lin, and Xu Sun. Imitation learning for non-autoregressive neural machine translation. In ACL, 2019.
|
| 314 |
+
|
| 315 |
+
# A HEURISTIC SEARCH FOR POSITIONS
|
| 316 |
+
|
| 317 |
+
# Algorithm 1 Heuristic Search for Positions
|
| 318 |
+
|
| 319 |
+
Input: The candidates set of decoder inputs: $D = \{ d _ { 1 } , \cdots , d _ { M } \}$ and target embeddings: $Y =$ $\{ y _ { 1 } , \cdots , y _ { M } \}$ ;
|
| 320 |
+
Output: The position of the decoder inputs $\hat { z }$ .
|
| 321 |
+
1: initial $A { \stackrel { \cdot } { = } } \{ \} , { \hat { D } } = D , { \hat { Y } } = Y$ ;
|
| 322 |
+
2: compute the similarity matrix $\mathrm { S i m } _ { D , Y }$ : the $\mathrm { S i m } [ i , j ]$ in the matrix is the the similarity between the $d _ { i }$ and $y _ { j }$ computing with $\mathrm { s i m } _ { i , j } =$ cosine $( d _ { i } , y _ { j } )$ ;
|
| 323 |
+
3: repeat
|
| 324 |
+
4: extract the similarity matrix $\mathrm { S i m } _ { \hat { D } , \hat { Y } }$ from the $\mathrm { S i m } _ { D , Y }$ ;
|
| 325 |
+
5: select: (i, j) = arg max(i,j) SimD,ˆ Yˆ
|
| 326 |
+
6: update: $A A \cup \{ ( i , j ) \}$ , $\hat { D } \hat { D } \setminus \{ d _ { i } \} , \hat { Y } \hat { Y } \setminus \{ y _ { j } \} ;$
|
| 327 |
+
7: until $\hat { D } = \left\{ \begin{array} { r l r } \end{array} \right\}$ and $\hat { Y } = \{ \}$
|
| 328 |
+
8: for each pair $( i , j )$ in $A$ do set $\hat { z } _ { i } = j$
|
| 329 |
+
9: end for;
|
| 330 |
+
10: return $\hat { z }$
|
| 331 |
+
|
| 332 |
+
As shown in Algorithm 1, we perform a greedy algorithm to select the pair with the highest similarity score iteratively until the permutation $\hat { z }$ is generated.
|
| 333 |
+
|
| 334 |
+
The complexity of this algorithm is $o ( M ^ { 3 } )$ ( $M$ is the length of output sentence). Specifically, the complexity to select the maximum from the similarity matrix is $o ( \dot { M } ^ { 2 } )$ for each loop. We need $M$ loops of greedy search to allocate positions for all decoder inputs.
|
| 335 |
+
|
| 336 |
+
# B CASE STUDY OF PREDICTED POSITIONS
|
| 337 |
+
|
| 338 |
+
We also provide a few examples in Table 5. For each source sentence, we first analyze the generation quality of the PNAT with a heuristic searched position. Besides, we also show the translation with the predicted position. We have the following observations: First, the output generated by the PNAT using the heuristic searched position always keeps the high consistency with the reference, shows the effectiveness of the heuristic searched position. Second, better position accuracy always yields better generation performance (Case 1,2 against Case 3). Third, as we can see in case 4, though the permutation accuracy is lower, it still generates a good result, the reason why we chose to use the relative self-attention instead of absolute self-attention.
|
| 339 |
+
|
| 340 |
+
Table 5: Examples of translation outputs from PNAT with different setting on WMT14 DE-EN. It is should be noted that the length is different between the position sequence and the output sequence because we keep the origin position output and combine the BPE sequence to word sequence.
|
| 341 |
+
|
| 342 |
+
<table><tr><td>Source</td><td>bei dem deutschen Gesetz geht es um die Zuweisung bei der Geburt.</td></tr><tr><td>Reference Heuristic Searched Position(HSP) PNATw/HSP</td><td>German law is about assigning it at birth . 3,6, 1, 2, 10, 0, 5,4, 7, 8, 9 German law is about assigning them at birth .</td></tr><tr><td>PredictedPosition PNAT w/Predicted Postion</td><td>3, 6,1, 2, 10, 0, 5, 4, 7, 8, 9 German law is about assigning them at birth .</td></tr><tr><td>Source</td><td>weiB er über das Telefon @-@ Hacking Bescheid ?</td></tr><tr><td>Reference Heuristic Searched Position(HSP) PNATw/HSP</td><td>does he know about phone hacking ? 2, 1, 3,4, 8,5,6, 0, 7,9 does he know the telephone hacking ?</td></tr><tr><td>PredictedPosition PNAT w/Predicted Postion</td><td>1, 0, 3,4, 8,5, 6,2, 7, 9 he know about the telephone hacking ?</td></tr><tr><td>Source</td><td>was CCAAbedeutet,mochte eineBesucherin wissen.</td></tr><tr><td>Reference Heuristic Searched Position(HSP)</td><td>one visitor wants to know what CCAA means . 5,6, 7,8,9,3,2, 0,1, 11,4, 10</td></tr><tr><td>PNATw/HSP Predicted Position</td><td>a visitor wants to know what CCAA means . 5,0, 1, 2,3, 7,4, 8, 9,11,6, 10</td></tr><tr><td>PNAT w/Predicted Postion Source</td><td>CCAA means wants to know to a visitor . eines von 2O Kindern in den Vereinigten</td></tr><tr><td></td><td>Staaten hat inzwischen eine Lebensmittelal-</td></tr><tr><td>Reference</td><td>lergie . one in 20 children in the United States now</td></tr><tr><td>Heuristic Searched Position(HSP)</td><td>have food allergies . 14,1,2, 3,4,5,6,7,9,8,0,10,11, 12,13</td></tr><tr><td>PNAT w/HSP Predicted Position</td><td>one of 2O children in theUnited Statesnowhas food allergy . 14, 0, 1, 2, 3,4,5, 6, 8,7, 9, 10, 11, 12, 13</td></tr></table>
|
md/train/Bk7wvW-C-/Bk7wvW-C-.md
ADDED
|
@@ -0,0 +1,261 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# EXPLORING ASYMMETRIC ENCODER-DECODER STRUCTURE FOR CONTEXT-BASED SENTENCE REPRESENTATION LEARNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Context information plays an important role in human language understanding, and it is also useful for machines to learn vector representations of language. In this paper, we explore an asymmetric encoder-decoder structure for unsupervised context-based sentence representation learning. As a result, we build an encoderdecoder architecture with an RNN encoder and a CNN decoder, and we show that neither an autoregressive decoder nor an RNN decoder is required. We further combine a suite of effective designs to significantly improve model efficiency while also achieving better performance. Our model is trained on two different large unlabeled corpora, and in both cases transferability is evaluated on a set of downstream language understanding tasks. We empirically show that our model is simple and fast while producing rich sentence representations that excel in downstream tasks.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Learning distributed representations of sentences is an important and hard topic in both the deep learning and natural language processing communities, since it requires machines to encode a sentence with rich language content into a fixed-dimension vector filled with continuous values. We are interested in learning to build a distributed sentence encoder in an unsupervised fashion by exploiting the structure and relationship in a large unlabeled corpus. Since humans interpret sentences by composing from the meanings of the words, we decompose the task of learning a sentence encoder into two essential components: learning distributed word representations, and learning how to compose a sentence representation from the representations of words in the given sentence.
|
| 12 |
+
|
| 13 |
+
Numerous studies in human language processing have claimed that the context in which words and sentences are understood plays an important role in human language understanding (Altmann & Mirkovic, 2009; Binder & Desai, 2011). The idea of learning from the context information (Turney & Pantel, 2010) was recently successfully applied to vector representation learning for words in Mikolov et al. (2013); Pennington et al. (2014).
|
| 14 |
+
|
| 15 |
+
Collobert et al. (2011) proposed a unified framework for learning language representation from the unlabeled data, and it is able to generalize to various NLP tasks. Inspired by the prior work on incorporating context information into representation learning, Kiros et al. (2015) proposed the Skipthought model, which is an encoder-decoder model for unsupervised sentence representation learning. The paper exploits the semantic similarity within a tuple of adjacent sentences as supervision, and successfully built a generic, distributed sentence encoder. Rather than applying the conventional autoencoder model, the skip-thought model tries to reconstruct the surrounding 2 sentences instead of the input sentence. The learned sentence representation encoder outperforms previous unsupervised pretrained models on the evaluation tasks with no finetuning, and the results are comparable to the models which were trained directly on the datasets in a supervised fashion.
|
| 16 |
+
|
| 17 |
+
The usage of 2 independent decoders in Skip-thought model matches our intuition that, given the current sentence, inferring the previous sentence and inferring the next one should be different. Recently, Tang et al. (2017) proposed the Skip-thought Neighbor model, which only decodes the next sentence, and the performance on the downstream tasks is similar to that of their implementation of the Skip-thought model.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Our proposed model is composed of an RNN encoder, and a CNN decoder. During training, a batch of sentences are sent to the model, and the RNN encoder computes a vector representation for each of sentences; then the CNN decoder needs to reconstruct the paired target sequence, which contains 30 contiguous words right after the input sentence, given the vector representation. 300 is the dimension of word vectors. $D$ is the dimension of sentence representation, and it varies along with the change of the RNN encoder size. (Better view in color.)
|
| 21 |
+
|
| 22 |
+
In this paper, we follow the idea in the Skip-thought Neighbor model, which exploits the subsequent context information for learning representation, and aim to bring asymmetry into structure design as well. Our proposed model has an asymmetric encoder-decoder structure, which keeps an RNN as the encoder and has a CNN as the decoder, and will be referred to as an “RNN-CNN” model. The key components of our model design can be summarized as:
|
| 23 |
+
|
| 24 |
+
1. a bidirectional RNN encodes the input sentence, and a CNN decodes all words in the paired target sequence at once, which speeds up the training process;
|
| 25 |
+
2. the supervision for training comes from inferring the next contiguous words given the current sentence, which helps the model to learn from the context in an unsupervised fashion;
|
| 26 |
+
3. the mean+max pooling captures complex interactions among words, which augments the transferability of the proposed model;
|
| 27 |
+
4. tying word embeddings in the encoder with the word prediction layer in the decoder constrains the input and output space to be the same, which also reduces number of parameters and regularizes the model.
|
| 28 |
+
|
| 29 |
+
We demonstrate the transferability of our model by evaluation on various downstream tasks, and the performance shows that our model improves both results and training efficiency.
|
| 30 |
+
|
| 31 |
+
# 2 RNN-CNN MODEL
|
| 32 |
+
|
| 33 |
+
Our model is highly asymmetric in terms of both training pairs and model structure. Specifically, our model has an RNN as the encoder, and a CNN as the decoder. During training, the encoder takes the $i$ - th sentence $s _ { i }$ as input, and then generates a fixed-dimension vector $\mathbf { z } _ { i }$ as the sentence representation; the decoder is applied to reconstruct the next sentence or the subsequent few contiguous words $t _ { i }$ . The difference of the generated sequence and the target sequence is measured by cross-entropy loss. An illustration is in Figure 1. (For simplicity, we omit the subscript $i$ in the section.)
|
| 34 |
+
|
| 35 |
+
Encoder: The encoder is a bi-directional Gated Recurrent Unit (GRU) (Chung et al., 2014). We experimented with both Long-short Term Memory (LSTM, Hochreiter & Schmidhuber (1997)) and GRU. Since LSTM didn’t give us significant performance boost, and generally GRU runs faster than LSTM, in our experiments, we stick to using GRU in the encoder. Suppose that a sentence $s$ contains $M$ words, which are $\boldsymbol { w } ^ { 1 } , \boldsymbol { w } ^ { 2 } , . . . , \boldsymbol { w } ^ { M }$ , and they are transformed by an embedding matrix $\mathbf { E }$ to word vectors. The bi-directional GRU will take one word vector at a time, and run in both forward and backward direction; both sets of hidden states are concatenated to form the hidden state matrix $\mathbf { H } = [ \mathbf { h } ^ { 1 } , \mathbf { h } ^ { 2 } , . . . , \mathbf { h } ^ { M } ] \in \mathbb { R } ^ { D \times M }$ , where $d$ is the dimension of the representations $\mathbf { h } ^ { m } = \left[ \overleftarrow { \mathbf { h } ^ { m } } ; \overrightarrow { \mathbf { h } ^ { m } } \right]$ $( \forall m \in \{ 1 , 2 , . . . , M \} )$ .
|
| 36 |
+
|
| 37 |
+
Representation: We aim to provide a model with faster training speed with better transferability than existing algorithms, thus we choose to apply a parameter-free composition function, which is a concatenation of the outputs from a global mean pooling over time and a global max pooling over time, on the computed sequence of hidden states. The composition function can be represented as
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
\mathbf { z } = \left[ \frac { 1 } { M } \sum _ { m = 1 } ^ { M } \mathbf { h } ^ { m } ; \operatorname* { m a x } \mathbf { H } _ { \mathrm { 1 } \cdot } ; \operatorname* { m a x } \mathbf { H } _ { \mathrm { 2 } \cdot } ; . . . ; \operatorname* { m a x } \mathbf { H } _ { d } \right] ,
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
where max $\mathbf { H } _ { d }$ · is the max operation on the $d$ -th row of the matrix $\mathbf { H }$ , which outputs a scalar. Thus the representation $\mathbf { z }$ has a dimension of $2 d$ .
|
| 44 |
+
|
| 45 |
+
Decoder: The decoder is a 3-layer CNN to reconstruct the paired target sequence $t$ , which needs to expand $\mathbf { z }$ from length 1 to the length of $t$ . Intuitively, the decoder could be a stack of deconvolution layers. For fast training speed, we optimized the architecture to make it plausible to use fullyconnected layers and convolution layers in the decoder, since generally, convolution layers run faster than deconvolution layers in modern deep learning frameworks.
|
| 46 |
+
|
| 47 |
+
Suppose that the target sequence $t$ has $N$ words, the first layer of deconvolution will expand $\mathbf { z }$ , which could be considered as a sequence with length 1, into a feature map with length $N$ . It can be easily implemented as a concatenation of outputs from $N$ linear transformations in parallel. Then the second and third layer are 1D-convolution layers with kernel size 3 and 1, respectively. The output feature map $\mathbf { V } = [ \bar { \mathbf { v } } ^ { 1 } , \mathbf { v } ^ { 2 } , . . . , \mathbf { v } ^ { N } ]$ , where $\mathbf { v } \in \mathbb { R } ^ { e }$ , and $e$ is dimension of the word vectors.
|
| 48 |
+
|
| 49 |
+
Note that our decoder is not an autoregressive model, and it brings us high training efficiency. We will discuss the reason of choosing this decoder which we call a predict-all-words CNN decoder.
|
| 50 |
+
|
| 51 |
+
Objective: A softmax layer is applied after the decoder to produce a probability distribution over words at each position, softmax $\left( \mathbf { E v } ^ { n } \right)$ , and the training objective is to minimize the sum of the negative log-likelihood over all positions in the target sequence $t$ :
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\mathcal { L } = - \sum _ { n = 1 } ^ { N } \log P ( w ^ { n } | \mathbf { z } ) .
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
The loss function $\mathcal { L }$ is summed over all sentences in the training corpus.
|
| 58 |
+
|
| 59 |
+
# 3 ARCHITECTURE DESIGN
|
| 60 |
+
|
| 61 |
+
We follow the idea of an encoder-decoder model with using the context information for learning sentence representations in an unsupervised fashion. Since the decoder won’t be used after training, and the quality of the generated sequences is not our main focus, it is important to study the design of the decoder. Generally, a fast training algorithm is preferred, thus proposing a new decoder with high training efficiency and also strong transferability is crucial for an encoder-decoder model.
|
| 62 |
+
|
| 63 |
+
# 3.1 CNN AS THE DECODER
|
| 64 |
+
|
| 65 |
+
Our design of the decoder is basically a 3-layer ConvNet, and it predicts all words in the next sequence all at once. In contrast, existing work, such as Skip-thought Kiros et al. (2015), and CNN-LSTM Gan et al. (2017),use autoregressive RNNs as the decoders.
|
| 66 |
+
|
| 67 |
+
An autoregressive model is good at generating sequences with high quality, such as language and speech. However, an autoregressive decoder seems to be unnecessary in an encoder-decoder model for learning sentence representations, since it won’t be used after training, and it runs quite slow during training. Therefore, we conducted experiments to test the necessity of using an autoregressive decoder in learning sentence representations, and we had 2 findings.
|
| 68 |
+
|
| 69 |
+
Finding I: It is not necessary to input the correct words into an autoregressive decoder in terms of learning good sentence representations.
|
| 70 |
+
|
| 71 |
+
<table><tr><td>Decoder</td><td>SICK-r</td><td>SICK-E</td><td>STS14</td><td>MSRP (Acc/F1)</td><td>SST</td><td>TREC</td></tr><tr><td colspan="7">auto-regressive RNN as decoder</td></tr><tr><td>Baseline</td><td>0.8530</td><td>82.6</td><td>0.51/0.50</td><td>74.1/81.7</td><td>82.5</td><td>88.2</td></tr><tr><td>Always Sampling</td><td>0.8576</td><td>83.2</td><td>0.55/0.53</td><td>74.7 /81.3</td><td>80.6</td><td>87.0</td></tr><tr><td>Uniform Sampling</td><td>0.8559</td><td>82.9</td><td>0.54/0.53</td><td>74.0 / 81.8</td><td>81.0</td><td>87.4</td></tr><tr><td colspan="7">auto-regressive CNN as decoder</td></tr><tr><td>Baseline</td><td>0.8510</td><td>82.8</td><td>0.49/0.48</td><td>74.7/82.8</td><td>81.4</td><td>82.6</td></tr><tr><td>Always Sampling</td><td>0.8535</td><td>83.3</td><td>0.53/0.52</td><td>75.0/81.7</td><td>81.4</td><td>87.6</td></tr><tr><td>Uniform Sampling</td><td>0.8568</td><td>83.4</td><td>0.56/0.54</td><td>74.7 /81.4</td><td>83.0</td><td>88.4</td></tr><tr><td colspan="7">predict-all-words RNN as decoder</td></tr><tr><td>RNN</td><td>0.8508</td><td>82.8</td><td>0.58/0.55</td><td>74.2/82.8</td><td>81.6</td><td>88.8</td></tr><tr><td colspan="7">predict-all-words CNN as decoder</td></tr><tr><td>CNN</td><td>0.8530</td><td>82.6</td><td>0.58/0.56</td><td>75.6/82.9</td><td>82.8</td><td>89.2</td></tr><tr><td>CNN-Max</td><td>0.8465</td><td>82.6</td><td>0.50/0.47</td><td>73.3 / 81.5</td><td>79.1</td><td>82.2</td></tr><tr><td colspan="7">Double-sized RNN Encoder</td></tr><tr><td>CNN</td><td>0.8631</td><td>83.9</td><td>0.58/0.55</td><td>74.7 /83.1</td><td>83.4</td><td>90.2</td></tr><tr><td>CNN-Max</td><td>0.8485</td><td>83.2</td><td>0.47/0.44</td><td>72.9 / 80.8</td><td>82.2</td><td>86.6</td></tr></table>
|
| 72 |
+
|
| 73 |
+
Table 1: The models here all have a bi-directional GRU as the encoder (dimensionality 300 in each direction). The default way of producing the representation is a concatenation of outputs from a global mean-pooling and a global max-pooling, while “·-Max” refers to the model with only global maxpooling. Bold numbers are the best results among all presented models. We found that 1) inputting correct words to an autoregressive decoder is not necessary; 2) predict-all-words decoders work roughly the same as autoregressive decoders; 3) mean+max pooling provides stronger transferability than the max-pooling alone does. The table supports our choice of the predict-all-words CNN decoder and the way of producing vector representations from the bi-directional RNN encoder.
|
| 74 |
+
|
| 75 |
+
The experimental design was inspired by Bengio et al. (2015). The model we designed for the experiment has a bi-directional GRU as the encoder, and an autoregressive decoder, including both RNN and CNN. We started by analyzing the effect of different sampling strategies of the input words on learning an auto-regressive decoder.
|
| 76 |
+
|
| 77 |
+
We compared 3 autoregressive decoding settings: 1) using ground-truth words (Baseline), 2) using previously predicted words (Always Sampling), and 3) using uniformly sampled words from the dictionary (Uniform Sampling). The 3 decoding settings were named by Bengio et al. (2015). The results are presented in the Table 1.
|
| 78 |
+
|
| 79 |
+
Generally, the three different decoding settings didn’t make much of a difference in terms of the performance on selected downstream tasks, with RNN or CNN as the decoder. The results tell us that, in terms of learning good sentence representations, the autoregressive decoder doesn’t require the correct ground-truth words as the inputs.
|
| 80 |
+
|
| 81 |
+
# Finding II: The model with an autoregressive decoder works roughly the same as the model with a predict-all-words decoder.
|
| 82 |
+
|
| 83 |
+
With Finding I, we noticed that the correct ground-truth input words to the autoregressive decoder is not necessary in terms of learning sentence representations. Therefore, it makes sense to test whether we need an autoregressive model at all.
|
| 84 |
+
|
| 85 |
+
In our model, the CNN decoder predicts all words at once during training, which is different from autoregressive decoders, and we call it a predict-all-words CNN decoder. We want to compare the performance of the predict-all-words decoders and that of the autoregressive decoders separate from the RNN/CNN distinction, thus we designed a predict-all-words CNN decoder and RNN decoder.
|
| 86 |
+
|
| 87 |
+
The predict-all-words CNN decoder is described in Section 2, which is a stack of 3 convolutional layers, and all words are predicted once at the output of the decoder. The predict-all-words RNN decoder is built based on our CNN decoder. To keep the number of parameters roughly the same, we replaced the last 2 convolutional layers with a bidirectional GRU.
|
| 88 |
+
|
| 89 |
+
The results are also presented in the Table 1. The performance of the predict-all-words RNN decoder does not significantly differ from that of any one of the autoregressive RNN decoders, and the same observation was observed in CNN decoders.
|
| 90 |
+
|
| 91 |
+
These two findings actually support our choice of using a predict-all-words CNN as the decoder, and it brings the model higher training efficiency and strong transferability.
|
| 92 |
+
|
| 93 |
+
# 3.2 MEAN $^ +$ MAX POOLING
|
| 94 |
+
|
| 95 |
+
Since the encoder is a bi-directional RNN in our model, we have multiple ways to select/compute on the generated hidden states to produce a sentence representation. In Skip-thought (Kiros et al., 2015) and SDAE (Hill et al., 2016), only the hidden state at the last time step produced by the RNN encoder is regarded as the vector representation for a given sentence, which may not be the most expressive vector for representing the input sentence.
|
| 96 |
+
|
| 97 |
+
We followed the idea proposed in Chen et al. (2016). They built a model for supervised SNLI task (Bowman et al., 2015) that concatenates the outputs from a global mean pooling and a global max pooling to serve as a sentence representation, and showed a performance boost on the SNLI dataset. Also, Conneau et al. (2017) found that the model with global max pooling function has stronger transferability than the model with a global mean pooling function after supervised training on SNLI.
|
| 98 |
+
|
| 99 |
+
In our proposed RNN-CNN model, we empirically show that the mean $+$ max pooling provides stronger transferability than the max pooling does, and the results are presented in Table 1. The concatenation of a mean-pooling and a max pooling function is actually a parameter-free composition function, and the computation load is negligible compared to heavy matrix multiplications. Also, the non-linearity of the max pooling function augments the mean pooling function for building a representation that captures a more complex composition of the syntactic information.
|
| 100 |
+
|
| 101 |
+
# 3.3 TYING WORD EMBEDDINGS AND WORD PREDICTION LAYER
|
| 102 |
+
|
| 103 |
+
We choose to share the parameters in the word embedding layer in RNN encoder and the word prediction layer in CNN decoder. The tying was proposed in both Press & Wolf (2017) and Inan et al. (2016), and it generally helps to learn a better language model. In our model, the tying also drastically reduces the number of parameters, which could prevent overfitting.
|
| 104 |
+
|
| 105 |
+
Furthermore, we initialize the word embeddings with pretrained word vectors, such as word2vec (Mikolov et al., 2013) and GloVe (Pennington et al., 2014), since it has been shown that these pretrained word vectors can serve as good initialization for deep learning models, and more likely lead to better results than random samples from a uniform distribution.
|
| 106 |
+
|
| 107 |
+
# 3.4 STUDY OF THE HYPERPARAMETERS IN OUR MODEL DESIGN
|
| 108 |
+
|
| 109 |
+
We studied hyperparameters in our model design based on 3 out of 10 downstream tasks, including SICK-r, SICK-E (Marelli et al., 2014), and STS14 (Agirre et al., 2014). The first model we created, which is reported in Section 2, is a decent design, and the following variations didn’t give us much performance change except small improvements with increasing the dimensionality of the encoder. However, we think it is worth mentioning the effect of hyperparameters in our model design. We present the Table in the supplementary material and we summarize it as follows:
|
| 110 |
+
|
| 111 |
+
1. Decoding the next sentence worked similarly as decoding the subsequent contiguous words.
|
| 112 |
+
2. Decoding subsequent 30 words, which was adopted from the Skip-thought training code 1, gave us a reasonable good performance. More words for decoding didn’t give us a significant performance gain, while it took longer to train.
|
| 113 |
+
3. Adding more layers into the decoder and enlarging the dimension of the convolutional layers indeed sightly improved the performance on the 3 downstream tasks, but as training efficiency is one of our main concerns, we decided it wasn’t worth sacrificing training efficiency for the minor performance improvement.
|
| 114 |
+
|
| 115 |
+
4. Increasing the dimensionality of the RNN encoder improved the model performance, and the additional training time brought by it was less than that by adding more layers and enlarging the dimension of the convolutional layers in the CNN decoder. We reported results from both smallest and largest models in Table 2.
|
| 116 |
+
|
| 117 |
+
# 4 EXPERIMENT SETTINGS
|
| 118 |
+
|
| 119 |
+
The large corpus we used for unsupervised training is the BookCorpus dataset Zhu et al. (2015), which contains 74 million sentences from 7000 books in total. For stable training, we use ADAM (Kingma & Ba, 2014) algorithm for optimization, and gradient clipping (Pascanu et al., 2013) when the norm of gradient exceeds a certain value. Since we didn’t find any significant difference between word2vec and GloVe as initialization in terms of the performance, we stick to using the word vectors from word2vec to initialize the word embedding layer in our models.
|
| 120 |
+
|
| 121 |
+
The vocabulary for unsupervised training contains the top $2 0 \mathrm { k }$ most frequent words in BookCorpus. In order to generalize the model trained with a relatively small, fixed vocabulary to the much larger set of all possible English words, Kiros et al. (2015) proposed a word expansion method that learns a linear projection from the pretrained word embeddings word2vec to the learned RNN word embeddings. Thus, the model benefits from the generalization ability of the pretrained word embeddings.
|
| 122 |
+
|
| 123 |
+
The downstream tasks for evaluation include semantic relatedness (SICK) (Marelli et al., 2014), paraphrase detection (MSRP) (Dolan et al., 2004), question-type classification (TREC) (Li & Roth, 2002), and 5 benchmark sentiment and subjective datasets, which includes movie review sentiment (MR, SST) (Pang & Lee, 2005; Socher et al., 2013), customer product reviews (CR) (Hu & Liu, 2004), subjectivity/objectivity classification (SUBJ) (Pang & Lee, 2004), opinion polarity (MPQA) (Wiebe et al., 2005), and semantic textual similarity (STS14) (Agirre et al., 2014). After unsupervised training on the BookCorpus dataset, we fix the parameters in the encoder, and apply it as a sentence representation extractor on the 10 tasks.
|
| 124 |
+
|
| 125 |
+
In order to compare the effect of different corpora, we also trained 2 models on Amazon Book Review dataset (without ratings) which is the largest subset of the Amazon Review dataset (McAuley et al., 2015) with 142 million sentences after tokenization, about twice as large as BookCorpus.
|
| 126 |
+
|
| 127 |
+
Both training and evaluation of our models were conducted in PyTorch 2, and we used SentEval 3 provided by Conneau et al. (2017) to evaluate the transferability of models with different settings. All the models were trained for the same number of iterations with the same batch size, and the performance was measured at the end of training for each of the models.
|
| 128 |
+
|
| 129 |
+
# 5 RELATED WORK AND COMPARISON
|
| 130 |
+
|
| 131 |
+
Table 2 presented the results on 10 evaluation tasks of our proposed RNN-CNN models, and related work. “small RNN-CNN” refers to the model with the dimension of representation as 1200, and “large RNN-CNN” refers to that as 4800. The results of our model on SNLI can be found in Table 3.
|
| 132 |
+
|
| 133 |
+
Our work was inspired by analyzing the Skip-thought model (Kiros et al., 2015). Skip-thought model successfully applied this form of learning from the context information into unsupervised representation learning for sentences, in which the model learns to encode the current sentence and decode the surrounding 2 sentences, and then, Ba et al. (2016) augmented the LSTM with proposed layer-normalization (Skip-thought+LN), which improved the skip-thought model generally on all downstream tasks. Instead of applying RNNs in the model, Hill et al. (2016) proposed the FastSent model which only learns source and target word embeddings, and it is a generalization of CBOW (Mikolov et al., 2013) to sentence-level learning, and the composition function over word embeddings is a summation operation. Later on, Gan et al. (2017) applied a CNN as the encoder, which is called the CNN-LSTM model. The proposed composition model follows the idea of encoding the current sentence and predicting itself and the next sentence; the proposed hierarchical model leverages the context information from both sentence-level and paragraph-level, while learning to encode the current sentence and predict the next one, the model has another RNN to process the sentence representation one at a time at paragraph-level.
|
| 134 |
+
|
| 135 |
+
<table><tr><td>Model</td><td>Hrs</td><td>SICK-r</td><td>SICK-E</td><td>STS14</td><td>MSRP</td><td></td><td>TREC MR</td><td>CR</td><td></td><td>SUBJ MPQA SST</td><td></td></tr><tr><td colspan="10">Unsupervised training with unordered sentences</td><td></td><td></td><td></td></tr><tr><td>Unigram-TFIDF</td><td>-</td><td>-</td><td>-</td><td></td><td>73.6/81.7</td><td>85.0</td><td>73.7</td><td>79.2</td><td>90.3</td><td>82.4</td><td>-</td></tr><tr><td>ParagraphVec</td><td>4</td><td>-</td><td>-</td><td>0.42/0.43</td><td>72.9/81.1</td><td>59.4</td><td>60.2</td><td>66.9</td><td>76.3</td><td>70.7</td><td>-</td></tr><tr><td>word2vec BOW</td><td>2</td><td>0.8030</td><td>78.7</td><td>0.65/0.64</td><td>72.5/81.4</td><td>83.6</td><td>77.7</td><td>79.8</td><td>90.9</td><td>88.3</td><td>79.7</td></tr><tr><td>fastText BOW</td><td>-</td><td>0.8000</td><td>77.9</td><td>0.63/0.62</td><td>72.4/81.2</td><td>81.8</td><td>76.5</td><td>78.9</td><td>91.6</td><td>87.4</td><td>78.8</td></tr><tr><td>GloVe BOW</td><td>-</td><td>0.8000</td><td>78.6</td><td>0.54/0.56</td><td>72.1/80.9</td><td>83.6</td><td>78.7</td><td>78.5</td><td>91.6</td><td>87.6</td><td>79.8</td></tr><tr><td>SDAE</td><td>72</td><td>-</td><td>-</td><td>0.37/0.38</td><td>73.7/80.7</td><td>78.4</td><td>74.6</td><td>78.0</td><td>90.8</td><td>86.9</td><td>-</td></tr><tr><td colspan="10">Unsupervised trainingwith ordered sentences-BookCorpus</td></tr><tr><td>DiscSent:</td><td>8</td><td>-</td><td>-</td><td>-</td><td>75.0/-</td><td>87.2</td><td>-</td><td>-</td><td>93.0</td><td>-</td><td>■</td></tr><tr><td>FastSent</td><td>2</td><td>-</td><td>-</td><td>0.63/0.64</td><td>72.2/80.3</td><td>76.8</td><td>70.8</td><td>78.4</td><td>88.7</td><td>80.6</td><td>■</td></tr><tr><td>FastSent+AE</td><td>2</td><td>-</td><td>-</td><td>0.62/0.62</td><td>71.2/79.1</td><td>80.4</td><td>71.8</td><td>76.5</td><td>88.8</td><td>81.5</td><td>-</td></tr><tr><td>Skip-thought</td><td>336</td><td>0.8580</td><td>82.3</td><td>0.29/0.35</td><td>73.0/82.0</td><td>92.2</td><td>76.5</td><td>80.1</td><td>93.6</td><td>87.1</td><td>82.0</td></tr><tr><td>Skip-thought+LN</td><td>720</td><td>0.8580</td><td>79.5</td><td>0.44/0.45</td><td>■</td><td>88.4</td><td>79.4</td><td>83.1</td><td>93.7</td><td>89.3</td><td>82.9</td></tr><tr><td>combine CNN-LSTM</td><td>-</td><td>0.8618</td><td>:</td><td>1</td><td>76.5/83.8</td><td>92.6</td><td>77.8</td><td>82.1</td><td>93.6</td><td>89.4</td><td>1</td></tr><tr><td>small RNN-CNN+</td><td>20</td><td>0.8530</td><td>82.6</td><td>0.58/0.56</td><td>75.6/82.9</td><td>89.2</td><td>77.6</td><td>80.3</td><td>92.3</td><td>87.8</td><td>82.8</td></tr><tr><td>large RNN-CNN+</td><td>34</td><td>0.8698</td><td>85.2</td><td>0.59/0.57</td><td>75.1/83.2</td><td>92.2</td><td>79.7</td><td>81.9</td><td>94.0</td><td>88.7</td><td>84.1</td></tr><tr><td colspan="10">Unsupervised training with ordered sentences-Amazon Book Review</td><td></td></tr><tr><td>small RNN-CNN+</td><td>21</td><td>0.8476</td><td>82.7</td><td>0.53/0.53</td><td>73.8/81.5</td><td>84.8</td><td>83.3</td><td>83.0</td><td>94.7</td><td>88.2</td><td>87.8</td></tr><tr><td>large RNN-CNN+</td><td>33</td><td>0.8616</td><td>84.3</td><td>0.51/0.51</td><td>75.7/82.8</td><td>90.8</td><td>85.3</td><td>86.8</td><td>95.3</td><td>89.0</td><td>88.3</td></tr><tr><td colspan="10">Unsupervised training with ordered sentences-Amazon Review</td></tr><tr><td>BYTE m-LSTM</td><td>720</td><td>0.7920</td><td>-</td><td></td><td>75.0/82.8</td><td>■</td><td>86.9</td><td>91.4</td><td>94.6</td><td>88.5</td><td>■</td></tr><tr><td colspan="10">Supervisedtraining-Transfer learning</td><td></td></tr><tr><td>NMTEn-to-Fr</td><td>72</td><td>-</td><td>=</td><td>0.43/0.42</td><td>-</td><td>82.8</td><td>64.7</td><td>70.1</td><td>84.9</td><td>81.5</td><td>■</td></tr><tr><td>CaptionRep BOW</td><td>24</td><td></td><td></td><td>0.46/0.42</td><td>-</td><td>72.2</td><td>61.9</td><td>69.3</td><td>77.4</td><td>70.8</td><td>=</td></tr><tr><td>DictRep BOW</td><td>24</td><td></td><td>=</td><td>0.67/0.70</td><td>68.4/76.8</td><td>81.0</td><td>76.7</td><td>78.7</td><td>90.7</td><td>87.2</td><td>-</td></tr><tr><td>BiLSTM-Max(SNLI)</td><td><24</td><td>0.8850</td><td>84.6</td><td>0.68/0.65</td><td>75.1/82.3</td><td>88.7</td><td>79.9</td><td>84.6</td><td>92.1</td><td>89.8</td><td>83.3</td></tr><tr><td>BiLSTM-Max(AlINLI)</td><td><24</td><td>0.8840</td><td>86.3</td><td>0.70/0.67</td><td>76.2/83.1</td><td>88.2</td><td>81.1</td><td>86.3</td><td>92.4</td><td>90.2</td><td>84.6</td></tr><tr><td colspan="10">Supervised task-dependent training-No transfer learning</td></tr><tr><td>NB-SVM</td><td>-</td><td></td><td></td><td></td><td></td><td>-</td><td>79.4</td><td>81.8</td><td>93.2</td><td>86.3</td><td>83.1</td></tr><tr><td>AdaSent</td><td>-</td><td>=</td><td></td><td></td><td></td><td>92.4</td><td>83.1</td><td>86.3</td><td>95.5</td><td>93.3</td><td>-</td></tr><tr><td>Tree-LSTM</td><td>、</td><td>0.8680</td><td></td><td></td><td>-</td><td>-</td><td>-</td><td>■</td><td>-</td><td>-</td><td>■</td></tr><tr><td>TF-KLD</td><td>-</td><td>-</td><td></td><td></td><td>80.4/85.9</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td></tr></table>
|
| 136 |
+
|
| 137 |
+
Table 2: Related Work and Comparison. As presented in the table, our designed asymmetric RNN-CNN model has strong transferability, and is overall better than existing unsupervised models in terms of fast training speed and good performance on evaluation tasks. The table presents the model comparison. “†”s refer to our models, and “small/large” refers to the dimension of representation as 1200/4800. “‡” indicates that DiscSent model was trained with additional data from Wikipedia and the Gutenberg project. Bold numbers are the best ones among the models with same training and transferring setting, and underlined numbers are best results among all unsupervised representation learning models. For STS14, the performance measures are Pearson’s and Spearman’s score. For MSRP, the performance measures are accuracy and F1 score.
|
| 138 |
+
|
| 139 |
+
Our model falls in the same category as it is an encoder-decoder model. However, we aim to propose an efficient and effective model. Instead of decoding the surrounding 2 sentences as in Skip-thought, FastSent and the compositional CNN-LSTM, our model only decodes the subsequent sequence with a fixed length. Compared with hierarchical CNN-LSTM, our model showed that, with a proper model design, this next-words context information is sufficient in learning sentence representations. Particularly, our proposed small RNN-CNN model runs roughly 3 times faster than our implemented Skip-thought model on the same GPU machine during training.
|
| 140 |
+
|
| 141 |
+
Another unsupervised approach is to learn a discriminative model by distinguishing whether a target sentence is in the context of the source sentence, and also the discourse information. DiscSent (Jernite et al., 2017) proposed to learn a classifier on top of the representations, which judges 1) whether the two sentences are adjacent to each other, 2) whether the two sentences are in the correct order, and 3) whether the second sentence starts with a conjunction phrase. DisSent (Nie et al., 2017) pointed out that human annotated explicit discourse relations is also good for learning sentence representations. It is a very promising research direction since the proposed models are generally computational efficient and have clear intuition. However, the performance on the downstream tasks is still worse than encoder-decoder models.
|
| 142 |
+
|
| 143 |
+
Proposed by Radford et al. (2017), BYTE m-LSTM model uses a multiplicative LSTM unit (Krause et al., 2016) to learn a language model on Amazon Review data McAuley et al. (2015). The model works reasonably well on the downstream tasks, since the RNNs are able to produce a distributed representation for the given left-context information, such as a sentence or a document. In our experiment, we also trained our RNN-CNN model on the Amazon Book review, which is the largest subset of the Amazon review dataset, and indeed, we had a performance gain on all single-sentence classification tasks. The performance gain in our experiment and also in BYTE m-LSTM was brought by the matching between the corpus domain and the domain of downstream tasks, and it raises 2 questions 1) which corpus is good for learning sentence representations, and 2) whether the downstream tasks are comprehensive to cover sufficient aspects of a sentence.
|
| 144 |
+
|
| 145 |
+
Previously mentioned models are learned from ordered sentences, but unordered sentences can also be used for learning representations of sentences. ParagraphVec (Le & Mikolov, 2014) learns a fixed-dimension vector for each sentence by predicting the words within the given sentence. However, after training, the representation for a new sentence is hard to derive, since it requires optimizing the sentence representation towards an objective. SDAE (Hill et al., 2016) learns the sentence representations with a denoising auto-encoder model. The noise was added in the encoder by replacing words with a fixed token, and swapping two words, both with a specific probability. Our proposed RNN-CNN model trains faster than SDAE does, since the CNN decoder runs faster than the RNN decoder in SDAE, and since we utilized the sentence-level continuity as a supervision which SDAE doesn’t, our model largely performs better than SDAE.
|
| 146 |
+
|
| 147 |
+
Table 3: We implemented the same classifier as mentioned in Vendrov et al. (2015) on top of the features computed by our model. Our proposed RNN-CNN model gets similar result on SNLI as Skip-thought, but with much less training time.
|
| 148 |
+
|
| 149 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>SNLI (Acc %)</td></tr><tr><td rowspan=1 colspan=2>Unsupervised TransferLearning</td></tr><tr><td rowspan=1 colspan=1>Skip-thought (Vendrov et al.)largeRNN-CNN BookCorpuslarge RNN-CNN Amazon</td><td rowspan=1 colspan=1>81.581.781.5</td></tr><tr><td rowspan=1 colspan=2>SupervisedTraining</td></tr><tr><td rowspan=1 colspan=1>ESIM (Chen et al.)DIIN (Gong et al.)</td><td rowspan=1 colspan=1>86.788.9</td></tr></table>
|
| 150 |
+
|
| 151 |
+
Supervised transfer learning is also promising when we are able to get large enough labeled data. Conneau et al. (2017) applied a bi-directional LSTM as the sentence encoder with multiple fully-connected layers to deal with both SNLI (Bowman et al., 2015), and MultiNLI (Williams et al., 2017). The trained model demonstrates a very impressive transferability on all downstream tasks, including both supervised and unsupervised. The direct and discriminative training signal pushes the RNN encoder to focus on the semantics of a given sentence, which learns to a boost in performance, and beats all other methods. Our RNN-CNN model trained on Amazon Book Review data has better results on supervised classification tasks than BiLSTM-Max does, while the per
|
| 152 |
+
|
| 153 |
+
formance of ours on semantic relatedness tasks is inferior to BiLSTM-Max. We argue that labeling a large amount of training data is time-consuming and costly; unsupervised learning could potentially provide a great initial point for human labeling making it less costly and more efficient.
|
| 154 |
+
|
| 155 |
+
# 6 CONCLUSION
|
| 156 |
+
|
| 157 |
+
Inspired by learning to exploit the contextual information present in adjacent sentences, we proposed an asymmetric encoder-decoder model with a suite of techniques for improving context-based unsupervised sentence representation learning. Since we believe that a simple model will be faster in training and easier to analyze, we opt to use simple techniques in our proposed model, including 1) an RNN as the encoder, and a predict-all-words CNN as the decoder, 2) learning by inferring next contiguous words, 3) mean+max pooling, and 4) tying word vectors with word prediction. With thorough discussion and extensive evaluation, we justify our decision making for each component in our RNN-CNN model. In terms of the performance and the efficiency of training, we justify that our model is a fast and simple algorithm for learning generic sentence representations from unlabeled corpora. Further research will focus on how to maximize the utility of the context information, and how to design simple architectures to best make use of it.
|
| 158 |
+
|
| 159 |
+
# REFERENCES
|
| 160 |
+
|
| 161 |
+
Eneko Agirre, Carmen Banea, Claire Cardie, Daniel M. Cer, Mona T. Diab, Aitor Gonzalez-Agirre, Weiwei Guo, Rada Mihalcea, German Rigau, and Janyce Wiebe. Semeval-2014 task 10: Multilingual semantic textual similarity. In SemEval@COLING, 2014.
|
| 162 |
+
|
| 163 |
+
Gerry Altmann and Jelena Mirkovic. Incrementality and prediction in human sentence processing. Cognitive science, 33 4:583–609, 2009.
|
| 164 |
+
|
| 165 |
+
Jimmy Ba, Ryan Kiros, and Geoffrey E. Hinton. Layer normalization. CoRR, abs/1607.06450, 2016.
|
| 166 |
+
|
| 167 |
+
Samy Bengio, Oriol Vinyals, Navdeep Jaitly, and Noam Shazeer. Scheduled sampling for sequence prediction with recurrent neural networks. In NIPS, 2015.
|
| 168 |
+
|
| 169 |
+
Jeffrey R Binder and Rutvik H Desai. The neurobiology of semantic memory. Trends in cognitive sciences, 15 11:527–36, 2011.
|
| 170 |
+
|
| 171 |
+
Samuel R. Bowman, Gabor Angeli, Christopher Potts, and Christopher D. Manning. A large annotated corpus for learning natural language inference. In EMNLP, 2015.
|
| 172 |
+
|
| 173 |
+
Qian Chen, Xiaodan Zhu, Zhenhua Ling, Si Wei, and Hui Jiang. Enhancing and combining sequential and tree lstm for natural language inference. arXiv preprint arXiv:1609.06038, 2016.
|
| 174 |
+
|
| 175 |
+
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.
|
| 176 |
+
|
| 177 |
+
Ronan Collobert, Jason Weston, Léon Bottou, Michael Karlen, Koray Kavukcuoglu, and Pavel P. Kuksa. Natural language processing (almost) from scratch. Journal of Machine Learning Research, 12:2493–2537, 2011.
|
| 178 |
+
|
| 179 |
+
Alexis Conneau, Douwe Kiela, Holger Schwenk, Loïc Barrault, and Antoine Bordes. Supervised learning of universal sentence representations from natural language inference data. In EMNLP, 2017.
|
| 180 |
+
|
| 181 |
+
William B. Dolan, Chris Quirk, and Chris Brockett. Unsupervised construction of large paraphrase corpora: Exploiting massively parallel news sources. In COLING, 2004.
|
| 182 |
+
|
| 183 |
+
Zhe Gan, Yunchen Pu, Ricardo Henao, Chunyuan Li, Xiaodong He, and Lawrence Carin. Learning generic sentence representations using convolutional neural networks. In EMNLP, 2017.
|
| 184 |
+
|
| 185 |
+
Yichen Gong, Heng Luo, and Jian Zhang. Natural language inference over interaction space. CoRR, abs/1709.04348, 2017.
|
| 186 |
+
|
| 187 |
+
Felix Hill, Kyunghyun Cho, and Anna Korhonen. Learning distributed representations of sentences from unlabelled data. In HLT-NAACL, 2016.
|
| 188 |
+
|
| 189 |
+
Sepp Hochreiter and Juergen Schmidhuber. Long short-term memory. Neural Computation, 9: 1735–1780, 1997.
|
| 190 |
+
|
| 191 |
+
Minqing Hu and Bing Liu. Mining and summarizing customer reviews. In KDD, 2004.
|
| 192 |
+
|
| 193 |
+
Hakan Inan, Khashayar Khosravi, and Richard Socher. Tying word vectors and word classifiers: A loss framework for language modeling. CoRR, abs/1611.01462, 2016.
|
| 194 |
+
|
| 195 |
+
Yacine Jernite, Samuel R. Bowman, and David Sontag. Discourse-based objectives for fast unsupervised sentence representation learning. CoRR, abs/1705.00557, 2017.
|
| 196 |
+
|
| 197 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 198 |
+
|
| 199 |
+
Jamie Ryan Kiros, Yukun Zhu, Ruslan Salakhutdinov, Richard S. Zemel, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Skip-thought vectors. In NIPS, 2015.
|
| 200 |
+
|
| 201 |
+
Ben Krause, Liang Lu, Iain Murray, and Steve Renals. Multiplicative lstm for sequence modelling. CoRR, abs/1609.07959, 2016.
|
| 202 |
+
|
| 203 |
+
Quoc V. Le and Tomas Mikolov. Distributed representations of sentences and documents. In ICML, 2014.
|
| 204 |
+
|
| 205 |
+
Xin Li and Dan Roth. Learning question classifiers. In COLING, 2002.
|
| 206 |
+
|
| 207 |
+
Marco Marelli, Stefano Menini, Marco Baroni, Luisa Bentivogli, Raffaella Bernardi, and Roberto Zamparelli. A sick cure for the evaluation of compositional distributional semantic models. In LREC, 2014.
|
| 208 |
+
|
| 209 |
+
Julian J. McAuley, Christopher Targett, Qinfeng Shi, and Anton van den Hengel. Image-based recommendations on styles and substitutes. In SIGIR, 2015.
|
| 210 |
+
|
| 211 |
+
Tomas Mikolov, Ilya Sutskever, Kai Chen, Gregory S. Corrado, and Jeffrey Dean. Distributed representations of words and phrases and their compositionality. In NIPS, 2013.
|
| 212 |
+
|
| 213 |
+
Allen Nie, Erin D. Bennett, and Noah D. Goodman. Dissent: Sentence representation learning from explicit discourse relations. CoRR, abs/1710.04334, 2017.
|
| 214 |
+
|
| 215 |
+
Bo Pang and Lillian Lee. A sentimental education: Sentiment analysis using subjectivity summarization based on minimum cuts. In ACL, 2004.
|
| 216 |
+
|
| 217 |
+
Bo Pang and Lillian Lee. Seeing stars: Exploiting class relationships for sentiment categorization with respect to rating scales. In ACL, 2005.
|
| 218 |
+
|
| 219 |
+
Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio. On the difficulty of training recurrent neural networks. In ICML, 2013.
|
| 220 |
+
|
| 221 |
+
Jeffrey Pennington, Richard Socher, and Christopher D. Manning. Glove: Global vectors for word representation. In EMNLP, 2014.
|
| 222 |
+
|
| 223 |
+
Ofir Press and Lior Wolf. Using the output embedding to improve language models. In EACL, 2017.
|
| 224 |
+
|
| 225 |
+
Alec Radford, Rafal Józefowicz, and Ilya Sutskever. Learning to generate reviews and discovering sentiment. CoRR, abs/1704.01444, 2017.
|
| 226 |
+
|
| 227 |
+
Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D. Manning, Andrew Ng, and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. 2013.
|
| 228 |
+
|
| 229 |
+
Shuai Tang, Hailin Jin, Chen Fang, Zhaowen Wang, and Virginia R. de Sa. Rethinking skip-thought: A neighborhood based approach. In RepL4NLP, ACL Workshop, 2017.
|
| 230 |
+
|
| 231 |
+
Peter D. Turney and Patrick Pantel. From frequency to meaning: Vector space models of semantics. J. Artif. Intell. Res., 37:141–188, 2010.
|
| 232 |
+
|
| 233 |
+
Ivan Vendrov, Jamie Ryan Kiros, Sanja Fidler, and Raquel Urtasun. Order-embeddings of images and language. CoRR, abs/1511.06361, 2015.
|
| 234 |
+
|
| 235 |
+
Janyce Wiebe, Theresa Wilson, and Claire Cardie. Annotating expressions of opinions and emotions in language. Language Resources and Evaluation, 39:165–210, 2005.
|
| 236 |
+
|
| 237 |
+
Adina Williams, Nikita Nangia, and Samuel R. Bowman. A broad-coverage challenge corpus for sentence understanding through inference. CoRR, abs/1704.05426, 2017.
|
| 238 |
+
|
| 239 |
+
Yukun Zhu, Ryan Kiros, Richard S. 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. ICCV, pp. 19–27, 2015.
|
| 240 |
+
|
| 241 |
+
# SUPPLEMENTARY
|
| 242 |
+
|
| 243 |
+
# Anonymous authors
|
| 244 |
+
|
| 245 |
+
Paper under double-blind review
|
| 246 |
+
|
| 247 |
+
<table><tr><td>Encoder</td><td colspan="2">Decoder</td><td>Hrs</td><td>SICK-r SICK-E</td><td>STS14</td><td>MSRP (Acc/F1)</td><td>SST</td><td>TREC</td></tr><tr><td>type dim type</td><td colspan="8">dim Dimension of Sentence Representation: 1200</td></tr><tr><td rowspan="5">RNN 2x300</td><td>CNN</td><td>600-1200-300</td><td>20</td><td>0.8530 82.6</td><td>0.58/0.56</td><td>75.6/82.9</td><td>82.8</td><td>89.2</td></tr><tr><td>CNNt</td><td>600-1200-300</td><td>21</td><td>0.8515 82.7</td><td>0.58/0.56</td><td>75.3/82.5</td><td>82.9</td><td>85.2</td></tr><tr><td>CNN(10)</td><td>600-1200-300</td><td>11</td><td>0.8474 82.9</td><td>0.57/0.55</td><td>74.2/81.6</td><td>82.8</td><td>88.0</td></tr><tr><td>CNN(50)</td><td>600-1200-300</td><td>27</td><td>0.8533 82.5</td><td>0.57/0.55</td><td>74.7/82.2</td><td>81.5</td><td>86.2</td></tr><tr><td>RNN</td><td>600</td><td>26</td><td>0.8530 82.6</td><td>0.51/0.50</td><td>74.1/81.7</td><td></td><td></td></tr><tr><td>RNN2x300 CNN4x300S</td><td>CNN</td><td>600-1200-300</td><td>8</td><td>0.8117 80.5</td><td>0.44/0.42</td><td>72.7/80.7</td><td>81.0 78.4</td><td>89.0 85.0</td></tr><tr><td rowspan="2">RNN 2x300</td><td>CNN</td><td>600-1200-2400-300</td><td>28</td><td>0.8570</td><td></td><td>74.3/81.5</td><td></td><td>88.2</td></tr><tr><td>CNN</td><td>1200-2400-300</td><td>27</td><td>84.0 0.8541 83.0</td><td>0.58/0.56 0.59/0.57</td><td>74.3/82.2</td><td>82.8 82.9</td><td>89.0</td></tr><tr><td colspan="9">Dimension of Sentence Representation: 2400</td></tr><tr><td>RNN2x600</td><td>CNN</td><td>600-1200-300</td><td>25</td><td>0.8631 83.9</td><td></td><td>0.58/0.55</td><td>74.7/83.1</td><td>83.4 90.2</td></tr><tr><td>RNN2x600</td><td>RNN</td><td>600</td><td>32</td><td>0.8647</td><td>84.2</td><td>0.52/0.51</td><td>74.0/81.2 84.2</td><td>87.6</td></tr><tr><td>CNN3x800‡</td><td>RNN</td><td>600</td><td>8</td><td>0.8132</td><td></td><td>71.9/81.9</td><td>-</td><td>86.6</td></tr><tr><td colspan="9">Dimension of Sentence Representation: 4800</td></tr><tr><td>RNN2x1200</td><td>CNN</td><td>600-1200-300</td><td>34 0.8698</td><td>85.2</td><td>0.59/0.57</td><td>75.1/83.2</td><td>84.1</td><td>92.2</td></tr><tr><td colspan="2">Skip-thought (Kiros et al.,2015)</td><td>336</td><td>0.8584</td><td>82.3</td><td>0.29/0.35</td><td>73.0/82.0</td><td>82.0</td><td>92.2</td></tr><tr><td colspan="2">Skip-thought+LN (Ba et al., 2016)</td><td></td><td>720 0.8580</td><td>79.5</td><td>0.44/0.45</td><td>-</td><td>82.9</td><td>88.4</td></tr></table>
|
| 248 |
+
|
| 249 |
+
Table 1: Architecture Comparison. As shown in the table, our designed asymmetric RNN-CNN model (row 1,9, and 12) works better than other asymmetric models (CNN-LSTM, row 11), and models with symmetric structure (RNN-RNN, row 5 and 10). In addition, with larger encoder size, our model demonstrates stronger transferability. The default setting for our CNN decoder is that it learns to reconstruct 30 words right next to every input sentence. “CNN(10)” represents a CNN decoder with the length of outputs as 10, and “CNN(50)” represents it with the length of outputs as 50. “†” indicates that the CNN decoder learns to reconstruct next sentence. $^ { 6 6 } \ddag ^ { 5 }$ indicates the results reported in Gan et al. as future predictor. The CNN encoder in our experiment, noted as “ $\cdot \ S ^ { \ , }$ , was based on AdaSent in Zhao et al. and Conneau et al.. Bold numbers are best results among models at same dimension, and underlined numbers are best results among all models. For STS14, the performance measures are Pearson’s and Spearman’s score. For MSRP, the performance measures are accuracy and F1 score.
|
| 250 |
+
|
| 251 |
+
# REFERENCES
|
| 252 |
+
|
| 253 |
+
Jimmy Ba, Ryan Kiros, and Geoffrey E. Hinton. Layer normalization. CoRR, abs/1607.06450, 2016.
|
| 254 |
+
|
| 255 |
+
Alexis Conneau, Douwe Kiela, Holger Schwenk, Loïc Barrault, and Antoine Bordes. Supervised learning of universal sentence representations from natural language inference data. In EMNLP, 2017.
|
| 256 |
+
|
| 257 |
+
Zhe Gan, Yunchen Pu, Ricardo Henao, Chunyuan Li, Xiaodong He, and Lawrence Carin. Learning generic sentence representations using convolutional neural networks. In EMNLP, 2017.
|
| 258 |
+
|
| 259 |
+
Jamie Ryan Kiros, Yukun Zhu, Ruslan Salakhutdinov, Richard S. Zemel, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Skip-thought vectors. In NIPS, 2015.
|
| 260 |
+
|
| 261 |
+
Han Zhao, Zhengdong Lu, and Pascal Poupart. Self-adaptive hierarchical sentence model. In IJCAI, 2015.
|
md/train/Bki4EfWCb/Bki4EfWCb.md
ADDED
|
@@ -0,0 +1,366 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# INFERENCE SUBOPTIMALITY IN VARIATIONAL AUTOENCODERS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Amortized inference has led to efficient approximate inference for large datasets. The quality of posterior inference is largely determined by two factors: a) the ability of the variational distribution to model the true posterior and b) the capacity of the recognition network to generalize inference over all datapoints. We analyze approximate inference in variational autoencoders in terms of these factors. We find that suboptimal inference is often due to amortizing inference rather than the limited complexity of the approximating distribution. We show that this is due partly to the generator learning to accommodate the choice of approximation. Furthermore, we show that the parameters used to increase the expressiveness of the approximation play a role in generalizing inference rather than simply improving the complexity of the approximation.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
There has been significant work on improving inference in variational autoencoders (VAEs) (Kingma & Welling, 2014; Rezende et al., 2014) through the development of expressive approximate posteriors (Rezende & Mohamed, 2015; Kingma et al., 2016; Ranganath et al., 2016; Tomczak & Welling, 2016; 2017). These works have shown that with more expressive approximate posteriors, the model learns a better distribution over the data.
|
| 12 |
+
|
| 13 |
+
In this paper, we analyze inference suboptimality in VAEs: the mismatch between the true and approximate posterior. In other words, we are interested in understanding what factors cause the gap between the marginal log-likelihood and the evidence lower bound (ELBO). We refer to this as the inference gap. Moreover, we break down the inference gap into two components: the approximation gap and the amortization gap. The approximation gap comes from the inability of the approximate distribution family to exactly match the true posterior. The amortization gap refers to the difference caused by amortizing the variational parameters over the entire training set, instead of optimizing for each datapoint independently. We refer the reader to Table 1 for detailed definitions and Figure 1 for a simple illustration of the gaps. In Figure 1, ${ \mathcal { L } } [ q ]$ refers to the ELBO using an amortized distribution $q$ , whereas $q ^ { * }$ is the optimal $q$ within its variational family.
|
| 14 |
+
|
| 15 |
+
Our experiments investigate how the choice of encoder, posterior approximation, decoder, and model optimization affect the approximation and amortization gaps. We train VAE models in a number of settings on the MNIST, Fashion-MNIST (Xiao et al., 2017), and CIFAR10 datasets.
|
| 16 |
+
|
| 17 |
+
Our contributions are: a) we investigate inference suboptimality in terms of the approximation and amortization gaps, providing insight to guide future improvements in VAE inference, b) we quantitatively demonstrate that the learned true posterior accommodates the choice of approximation, and c) we demonstrate that using parameterized functions to improve the expressiveness of the approximation plays a large role in reducing error caused by amortization.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Gaps in Inference
|
| 21 |
+
|
| 22 |
+
<table><tr><td>Term</td><td>Definition</td><td>VAE Formulation</td></tr><tr><td>Inference</td><td>logp(x)-L[q]</td><td>KL(q(z|x)llp(z|x))</td></tr><tr><td>Approximation</td><td>logp(x)-L[q*]</td><td>KL(q*(z|x)lp(z|x))</td></tr><tr><td>Amortization</td><td>C-C[a]</td><td>KL(q(z|x)llp(z|x))-KL(q*(z|x)llp(z|x))</td></tr></table>
|
| 23 |
+
|
| 24 |
+
Table 1: Summary of Gap Terms. The middle column refers to the general case where our variational objective is a lower bound on the marginal log-likelihood (not necessarily the ELBO). The right most column demonstrates the specific case in VAEs. $q ^ { * } ( z | x )$ refers to the optimal approximation within a family $\mathcal { Q }$ , i.e. $\begin{array} { r } { q ^ { * } ( z | x ) = \mathrm { \bar { a r g m i n } } _ { q \in \mathcal { Q } } \mathrm { K L } \left( q ( z | \bar { x } ) | | \dot { p ( z | x ) } \right) } \end{array}$ .
|
| 25 |
+
|
| 26 |
+
# 2 BACKGROUND
|
| 27 |
+
|
| 28 |
+
# 2.1 INFERENCE IN VARIATIONAL AUTOENCODERS
|
| 29 |
+
|
| 30 |
+
Let $x$ be the observed variable, $z$ the latent variable, and $p ( x , z )$ be their joint distribution. Given a dataset $X = \{ x _ { 1 } , x _ { 2 } , . . . , x _ { N } \}$ , we would like to maximize the marginal log-likelihood:
|
| 31 |
+
|
| 32 |
+
$$
|
| 33 |
+
\log p ( X ) = \sum _ { i = 1 } ^ { N } \log p ( x _ { i } ) = \sum _ { i = 1 } ^ { N } \log \int p ( x _ { i } , z _ { i } ) d z _ { i } .
|
| 34 |
+
$$
|
| 35 |
+
|
| 36 |
+
In practice, the marginal log-likelihood is computationally intractable due to the integration over the latent variable $z$ . Instead, VAEs optimize the ELBO of the marginal log-likelihood (Kingma & Welling, 2014; Rezende et al., 2014):
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
\begin{array} { r l } & { \log p ( x ) = \mathbb { E } _ { z \sim q ( z \mid x ) } \left[ \log \left( \displaystyle \frac { p ( x , z ) } { q ( z \mid x ) } \right) \right] + { \mathrm { K L } } \left( q ( z \mid x ) | | p ( z | x ) \right) } \\ & { \phantom { \exp x } \geq \mathbb { E } _ { z \sim q ( z \mid x ) } \left[ \log \left( \displaystyle \frac { p ( x , z ) } { q ( z \mid x ) } \right) \right] = \mathcal { L } _ { \mathrm { V A E } } [ q ] . } \end{array}
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
From the above we can see that the lower bound is tight if $q ( z | x ) = p ( z | x )$ . The choice of $q ( z | x )$ is often a factorized Gaussian distribution for its simplicity and efficiency. VAEs perform amortized inference by utilizing a recognition network (encoder), resulting in efficient approximate inference for large datasets. The overall model is trained by stochastically optimizing the ELBO using the reparametrization trick (Kingma & Welling, 2014).
|
| 43 |
+
|
| 44 |
+
# 2.2 EXPRESSIVE APPROXIMATE POSTERIORS
|
| 45 |
+
|
| 46 |
+
There are a number of strategies for increasing the expressiveness of approximate posteriors, going beyond the original factorized-Gaussian. We briefly summarize normalizing flows and auxiliary variables.
|
| 47 |
+
|
| 48 |
+
# 2.2.1 NORMALIZING FLOWS
|
| 49 |
+
|
| 50 |
+
Normalizing flow (Rezende & Mohamed, 2015) is a change of variables procedure for constructing complex distributions by transforming probability densities through a series of invertible mappings. Specifically, if we transform a random variable $z _ { \mathrm { 0 } }$ with distribution $q _ { 0 } ( z )$ , the resulting random variable $z _ { T } = T ( z _ { 0 } )$ has a distribution:
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
q _ { T } ( z _ { T } ) = q _ { 0 } ( z _ { 0 } ) \left| \mathrm { d e t } \frac { \partial z _ { T } } { \partial z _ { 0 } } \right| ^ { - 1 }
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
By successively applying these transformations, we can build arbitrarily complex distributions. Stacking these transformations remains tractable due to the determinant being decomposable: $\operatorname* { d e t } ( A { \bar { B } } ) = \operatorname* { d e t } ( A ) \operatorname* { d e t } ( B )$ . An important property of these transformations is that we can take expectations with respect to the transformed density $q _ { T } ( z _ { T } )$ without explicitly knowing its formula known as the law of the unconscious statistician (LOTUS):
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\mathbb { E } _ { q _ { T } } [ h ( z _ { T } ) ] = \mathbb { E } _ { q _ { 0 } } [ h ( f _ { T } ( f _ { T - 1 } ( \dots f _ { 1 } ( z _ { 0 } ) ) ) ) ]
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
Using the change of variable and LOTUS, the lower bound can be written as:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\log p ( x ) \geq \mathbb { E } _ { z _ { 0 } \sim q _ { 0 } ( z | x ) } \left[ \log \left( \frac { p ( x , z _ { T } ) } { q _ { 0 } ( z _ { 0 } | x ) \prod _ { t = 1 } ^ { T } \left| \operatorname* { d e t } \frac { \partial z _ { t } } { \partial z _ { t - 1 } } \right| ^ { - 1 } } \right) \right] .
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
The main constraint on these transformations is that the determinant of their Jacobian needs to be easily computable.
|
| 69 |
+
|
| 70 |
+
# 2.2.2 AUXILIARY VARIABLES
|
| 71 |
+
|
| 72 |
+
Deep generative models can be extended with auxiliary variables which leave the generative model unchanged but make the variational distribution more expressive. Just as hierarchical Bayesian models induce dependencies between data, hierarchical variational models can induce dependencies between latent variables. The addition of the auxiliary variable changes the lower bound to:
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\begin{array} { r l } & { \log p ( x ) \geq \mathbb { E } _ { z , v \sim q ( z , v \mid x ) } \left[ \log \left( \displaystyle \frac { p ( x , z ) r ( v \mid x , z ) } { q ( z , v \mid x ) } \right) \right] } \\ & { \qquad = \mathbb { E } _ { q ( z \mid x ) } \left[ \log \left( \displaystyle \frac { p ( x , z ) } { q ( z \mid x ) } \right) - { \mathrm { K L } \Big ( q ( v \mid z , x ) \| r ( v \mid x , z ) \Big ) } \right] } \end{array}
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
where $r ( v | x , z )$ is called the reverse model. From Eqn. 8, we see that this bound is looser than the regular ELBO, however the extra flexibility provided by the auxiliary variable can result in a higher lower bound. This idea has been employed in works such as auxiliary deep generative models (ADGM, Maaløe et al. (2016)), hierarchical variational models (HVM, Ranganath et al. (2016)) and Hamiltonian variational inference (HVI, Salimans et al. (2015)).
|
| 79 |
+
|
| 80 |
+
# 2.3 MARGINAL LOG-LIKELIHOOD ESTIMATION
|
| 81 |
+
|
| 82 |
+
We use two bounds to estimate the marginal log-likelihood of a model: IWAE (Burda et al., 2016) and AIS (Neal, 2001). Here we describe the IWAE bound. See Section 6.5 in the appendix for a description of AIS.
|
| 83 |
+
|
| 84 |
+
The IWAE bound is a tighter lower bound than the VAE bound. More specifically, if we take multiple samples from the $q$ distribution, we can compute a tighter lower bound on the marginal log-likelihood:
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\log p ( x ) \geq \mathbb { E } _ { z _ { 1 } . . . z _ { k } \sim q ( z | x ) } \left[ \log \left( \frac { 1 } { k } \sum _ { i = 1 } ^ { k } \frac { p ( x , z _ { i } ) } { q ( z _ { i } | x ) } \right) \right] = \mathcal { L } _ { \mathrm { I W A E } } [ q ] .
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
As the number of importance samples approaches infinity, the bound approaches the marginal loglikelihood. This importance weighted bound was introduced along with the Importance Weighted Autoencoder (Burda et al., 2016), thus we refer to it as the IWAE bound. It is often used as an evaluation metric for generative models (Burda et al., 2016; Kingma et al., 2016). As shown by Bachman & Precup (2015) and Cremer et al. (2017), the IWAE bound can be seen as using the VAE bound but with an importance weighted $q$ distribution.
|
| 91 |
+
|
| 92 |
+
# 3 METHODS
|
| 93 |
+
|
| 94 |
+
# 3.1 APPROXIMATION AND AMORTIZATION GAPS
|
| 95 |
+
|
| 96 |
+
The inference gap $\mathcal { G }$ is the difference between the marginal log-likelihood $\log p ( x )$ and a lower bound ${ \mathcal { L } } [ q ]$ . Given the distribution in the family that maximizes the bound, $q ^ { * } ( z | x ) \ =$ arg $\operatorname* { m a x } _ { q \in \mathcal { Q } } \mathcal { L } [ q ]$ , the inference gap decomposes as the sum of approximation and amortization gaps:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\mathcal { G } = \log p ( x ) - \mathcal { L } [ q ] = \underbrace { \log p ( x ) - \mathcal { L } [ q ^ { * } ] } _ { \mathrm { A p p r o x i m a t i o n } } + \underbrace { \mathcal { L } [ q ^ { * } ] - \mathcal { L } [ q ] } _ { \mathrm { A m o r t i z a t i o n } } .
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
For VAEs, we can translate the gaps to KL divergences by rearranging (2):
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\mathcal { G } _ { \mathrm { V A E } } = \mathrm { K L } \big ( q ^ { * } ( z | x ) | | p ( z | x ) \big ) + \mathrm { K L } \big ( q ( z | x ) | | p ( z | x ) \big ) - \mathrm { K L } \big ( q ^ { * } ( z | x ) | | p ( z | x ) \big ) .
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
# 3.2 FLEXIBLE APPROXIMATE POSTERIOR
|
| 109 |
+
|
| 110 |
+
Our experimentation compares two families of approximate posteriors: the fully-factorized Gaussian (FFG) and a flexible flow (Flow). Our choice of flow is a combination of the Real NVP (Dinh et al., 2017) and auxiliary variables (Ranganath et al., 2016; Maaløe et al., 2016). Our model also resembles leap-frog dynamics applied in Hamiltonian Monte Carlo (HMC, Neal et al. (2011)).
|
| 111 |
+
|
| 112 |
+
Let $z \in \mathbb { R } ^ { n }$ be the variable of interest and $v \in \mathbb { R } ^ { n }$ the auxiliary variable. Each flow step involves:
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\begin{array} { l } { { v ^ { \prime } = v \circ \sigma _ { 1 } ( z ) + \mu _ { 1 } ( z ) } } \\ { { z ^ { \prime } = z \circ \sigma _ { 2 } ( v ^ { \prime } ) + \mu _ { 2 } ( v ^ { \prime } ) } } \end{array}
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
where $\sigma _ { 1 } , \sigma _ { 2 } , \mu _ { 1 } , \mu _ { 2 } : \mathbb { R } ^ { n } \to \mathbb { R } ^ { n }$ are differentiable mappings parameterized by neural nets and $\circ$ takes the Hadamard or element-wise product. The determinant of the combined transformation’s Jacobian, $| \mathrm { d e t } ( D f ) |$ , can be easily evaluated. See section 6.2 in the Appendix for a detailed derivation.
|
| 119 |
+
|
| 120 |
+
Thus, we can jointly train the generative and flow-based inference model by optimizing the bound:
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\log p ( x ) \geq \mathbb { E } _ { z , v \sim q ( z , v \mid x ) } \left[ \log \left( { \frac { p ( x , z ^ { \prime } ) r ( v ^ { \prime } | x , z ^ { \prime } ) } { q ( z , v | x ) \left| \operatorname* { d e t } ( D f ) \right| ^ { - 1 } } } \right) \right] = \mathcal { L } _ { \mathrm { f l o w } } [ q ] .
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
Additionally, multiple such type of transformations can be stacked to improve expressiveness. We refer readers to section 6.1.2 in the Appendix for details of our flow configuration adopted in the experimentation.
|
| 127 |
+
|
| 128 |
+
# 3.3 EVALUATION BOUNDS
|
| 129 |
+
|
| 130 |
+
We use several bounds to compute the inference gaps. To estimate the marginal log-likelihood, $\log { \hat { p } } ( x )$ , we take the maximum of our tightest lower bounds, specifically the maximum between the IWAE and AIS bounds. To compute the AIS bound, we use 100 chains, each with 500 intermediate distributions, where each transition consists of one HMC trajectory with 10 leapfrog steps. The initial distribution for AIS is the prior, so that it is encoder-independent.
|
| 131 |
+
|
| 132 |
+
For our experiments, we test two different variational distributions: the fully-factorized Gaussian $q _ { F F G }$ and the flexible approximation $q F l o w$ as described in section 3.2. When computing ${ \mathcal { L } } _ { \mathrm { V A E } } [ q ]$ and $\mathcal { L } _ { \mathrm { I W A E } } [ q ]$ , we use 5000 samples. To compute $\mathcal { L } _ { \mathrm { V A E } } [ q ^ { * } ]$ , we optimize the parameters of the variational distribution for every datapoint. See Section 6.4 for details of the local optimization and stopping criteria.
|
| 133 |
+
|
| 134 |
+
# 4 RELATED WORK
|
| 135 |
+
|
| 136 |
+
Much of the earlier work on variational inference focused on optimizing the variational parameters locally for each datapoint, e.g. the original Stochastic Variational Inference scheme (SVI, Hoffman et al. (2013)) specifies the variational parameters to be optimized locally in the inner loop. Salakhutdinov & Larochelle (2010) perform such local optimization when learning deep Boltzmann machines. More recent work has applied this idea to improve approximate inference in directed Belief networks (Hjelm et al., 2015).
|
| 137 |
+
|
| 138 |
+
Most relevant to our work is the recent work of Krishnan et al. (2017). They explicitly remark on two sources of error in variational learning with inference networks, and propose to optimize approximate inference locally from an initialization output by the inference network. They show improved training on high-dimensional, sparse data with the hybrid method, claiming that local optimization reduces the negative effects of random initialization in the inference network early on in training. Yet, their work only dwells on reducing the amortization gap and does analyze the error arising from the use of limited approximating distributions.
|
| 139 |
+
|
| 140 |
+

|
| 141 |
+
Figure 2: True Posterior and Approximate Distributions of a VAE with 2D latent space. Columns: 4 different datapoints. FFG: Fully-factorized Gaussian. Flow: Using a flexible approximate distribution. Amortized: Using amortized parameters. Optimal: Parameters optimized for individual datapoints. The green distributions are the true posterior distributions, highlighting the mismatch with the approximation.
|
| 142 |
+
|
| 143 |
+
Even though it is clear that failed inference would lead to a failed generative model, little quantitative assessment has been done showing the effect of the approximate posterior on the true posterior. Burda et al. (2016) visually demonstrate that when trained with an importance-weighted approximate posterior, the resulting true posterior is more complex than those trained with fully-factorized Gaussian approximations. We extend this observation quantitatively in the setting of flow-based approximate inference.
|
| 144 |
+
|
| 145 |
+
# 5 EXPERIMENTAL RESULTS
|
| 146 |
+
|
| 147 |
+
# 5.1 INTUITION THROUGH VISUALIZATION
|
| 148 |
+
|
| 149 |
+
To begin, we would like to gain some insight into the properties of inference in VAEs by visualizing different distributions in the latent space. To this end, we trained a VAE with a two-dimensional latent space on MNIST. We show contour plots of various distributions in the latent space in Fig. 2. The first row contains contour plots of the true posteriors $p ( z | x )$ for four different training datapoints (columns). We have selected these four examples to highlight different inference phenomena. The amortized FFG row refers to the output of the recognition net, in this case, a fully-factorized Gaussian (FFG) approximation. Optimal FFG is the FFG that best fits the posterior of the datapoint. Optimal Flow is the optimal fit of a flexible distribution to the same posterior, where the flexible distribution we use is described in Section 3.2.
|
| 150 |
+
|
| 151 |
+
Posterior A is an example of a distribution where FFG can fit well. Posterior B is an example of dependence between dimensions, demonstrating the limitation of having a factorized approximation. Posterior C highlights a shortcoming of performing amortization with a limited-capacity recognition network, where the amortized FFG shares little support with the true posterior. Posterior $\mathbf { D }$ is a bimodal distribution which demonstrates the ability of the flexible approximation to fit to complex distributions, in contrast to the simple FFG approximation. These observations raise the following question: in more typical VAEs, is the amortization of inference the leading cause of the distribution mismatch, or is it the choice of approximation?
|
| 152 |
+
|
| 153 |
+
<table><tr><td rowspan="2"></td><td colspan="2">MNIST</td><td colspan="2">Fashion-MNIST</td><td colspan="2">CIFAR-10</td></tr><tr><td>qFFG</td><td>qFlow</td><td>qFFG</td><td>qFlow</td><td>qFFG</td><td>qFlow</td></tr><tr><td>log p(x)</td><td>-89.80</td><td>-88.94</td><td>-97.47</td><td>-97.41</td><td>-14913.15</td><td>-14914.45</td></tr><tr><td>LVAE[qFlow]</td><td>-90.80</td><td>-90.38</td><td>-98.92</td><td>-99.10</td><td>-14914.22</td><td>-14915.57</td></tr><tr><td>LVAE[qFFG]</td><td>-91.23</td><td>-113.54</td><td>-100.53</td><td>-132.46</td><td>-14915.40</td><td>-14919.08</td></tr><tr><td>LVAE[q]</td><td>-92.57</td><td>-91.79</td><td>-104.75</td><td>-103.76</td><td>-14976.57</td><td>-14975.12</td></tr><tr><td>Approximation</td><td>1.43</td><td>1.44</td><td>3.06</td><td>1.69</td><td>2.25</td><td>1.12</td></tr><tr><td>Amortization</td><td>1.34</td><td>1.41</td><td>4.22</td><td>4.66</td><td>61.17</td><td>59.55</td></tr><tr><td>Inference</td><td>2.77</td><td>2.85</td><td>7.28</td><td>6.35</td><td>63.42</td><td>60.67</td></tr></table>
|
| 154 |
+
|
| 155 |
+
Table 2: Inference Gaps. The columns $q _ { F F G }$ and $q _ { F l o w }$ refer to the variational distribution used for training the model. All numbers are in nats.
|
| 156 |
+
|
| 157 |
+
# 5.2 AMORTIZATION VS APPROXIMATION GAP
|
| 158 |
+
|
| 159 |
+
Here we will compare the influence that the approximation and amortization errors have on the total inference gap. Table 2 are results from training on MNIST, Fashion-MNIST and CIFAR-10. For each dataset, we trained two different approximate posterior distributions: a fully-factorized Gaussian, $q _ { F F G }$ , and a flexible distribution, $q _ { F l o w }$ . Due to the computational cost of optimizing the local parameters for each datapoint, our evaluation is performed on a subset of 1000 datapoints for MNIST and Fashion-MNIST and a subset of 100 datapoints for CIFAR-10.
|
| 160 |
+
|
| 161 |
+
For MNIST, we see that the amortization and approximation gaps each account for nearly half of the inference gap. On Fashion-MNIST, which is a more difficult dataset to model, the amortization gap becomes larger than the approximation gap. Similarly for CIFAR-10, we see that the amortization gap is much more significant than the approximation gap. Thus, for the three datasets and model architectures that we tested, the amortization gap seems to be the prominent cause of inference suboptimality, especially when the difficulty of the dataset increases. This analysis indicates that improvements in inference will likely be a result of reducing amortization error, rather than approximation errors.
|
| 162 |
+
|
| 163 |
+
With these results in mind, would simply increasing the capacity of the encoder improve the amortization gap? We examined this by training the MNIST and Fashion-MNIST models from above but with larger encoders. See Section 6.1.2 for implementation details. Table 3 are the results of this experiment. Comparing to Table 2, we see that for both datasets and both variational distributions, the inference gap decreases and the decrease is mainly due to a reduction in the amortization gap.
|
| 164 |
+
|
| 165 |
+
<table><tr><td rowspan="7">logp(x) LVAE[qFlow] LVAEqFFG]</td><td colspan="2">MNIST</td><td colspan="2">Fashion-MNIST</td></tr><tr><td>qFFG</td><td>qFlow</td><td>qFFG</td><td>qFlow</td></tr><tr><td>-89.61</td><td>-88.99</td><td>-95.99</td><td>-96.18</td></tr><tr><td>-90.65</td><td>-90.44</td><td>-97.40</td><td>-97.91</td></tr><tr><td>-91.07</td><td>-108.71</td><td>-99.64</td><td>-129.7</td></tr><tr><td>-92.18</td><td>-91.19</td><td>-102.73</td><td>-101.67</td></tr><tr><td>LVAE[q] Approximation 1.46</td><td>1.45</td><td>3.65</td><td>1.73</td></tr><tr><td>Amortization</td><td>1.11</td><td>0.75</td><td>3.09</td><td>3.76</td></tr><tr><td>Inference</td><td>2.56</td><td>2.20</td><td>6.74</td><td>5.49</td></tr></table>
|
| 166 |
+
|
| 167 |
+
Table 3: Larger Encoder. The columns $q _ { F F G }$ and $q F l o w$ refer to the variational distribution used for training the model. All numbers are in nats.
|
| 168 |
+
|
| 169 |
+
# 5.2.1 INFLUENCE OF FLOWS ON AMORTIZATION GAP
|
| 170 |
+
|
| 171 |
+
The common reasoning for increasing the expressiveness of the approximate posterior is to minimize the difference between the true and approximate, i.e. reduce the approximation gap. However, given that the expressive approximation is often accompanied by many additional parameters, we would like to know if it has an influence on the amortization error.
|
| 172 |
+
|
| 173 |
+
To investigate this, we trained a VAE in the same manner as Section 5.2. After training, we kept the generator fixed and trained new encoders to fit to the fixed posterior. Specifically, we trained a small encoder with a factorized Gaussian $q$ distribution to obtain a large amortization gap. We then trained a small encoder with a flow distribution. See Section 6.2 for the details of the experiment. The results are shown in Table 4. As expected, we observe that the small encoder has a very large amortization gap. However, when we use $q _ { F l o w }$ as the approximate distribution, we see the approximation gap decrease, but more importantly, there is a significant decrease in the amortization gap. This indicates that the parameters used for increasing the complexity of the approximation also play a large role in diminishing the amortization error.
|
| 174 |
+
|
| 175 |
+
Table 4: Influence of Flows on the Amortization Gap. The parameters used to increase the flexibility of the approximate distribution also reduce the amortization gap. See Section 5.2.1 for details of the experiment.
|
| 176 |
+
|
| 177 |
+
<table><tr><td>Variational Family</td><td>qFFG</td><td>qFlow</td></tr><tr><td>logp(x) LVAE[q*]</td><td>-84.70 -86.61</td><td>-84.70 -85.48</td></tr><tr><td>LVAE[q] Approximation</td><td>-129.83 1.91</td><td>-98.58 0.78</td></tr><tr><td>Amortization</td><td>43.22</td><td>13.10</td></tr><tr><td>Inference</td><td>45.13</td><td>13.88</td></tr></table>
|
| 178 |
+
|
| 179 |
+
These results are expected given that the parameterization of the Flow distribution can be interpreted as an instance of the RevNet (Gomez et al., 2017) which has demonstrated that Real-NVP like transformations (Dinh et al., 2017) can model complex functions similar to typical MLPs. Thus the flow transformations we employ should also be expected to increase the expressiveness while also increasing the capacity of the encoder. The implication of this observation is that models which improve the flexibility of their variational approximation, and attribute their improved results to the increased expressiveness, may have actually been due to the reduction in amortization error.
|
| 180 |
+
|
| 181 |
+
# 5.3 INFLUENCE OF APPROXIMATE POSTERIOR ON TRUE POSTERIOR
|
| 182 |
+
|
| 183 |
+
We have seen that increasing the expressiveness of the approximation improves the marginal likelihood of the trained model, but to what amount does it alter the true posterior? Will a factorized Gaussian approximation cause the true posterior to be more like a factorized Gaussian or is the true posterior mostly fixed? Just as it is hard to evaluate a generative model by visually inspecting samples from the model, its hard to say how Gaussian the true posterior is by visual inspection. We can quantitatively determine how close the posterior is to a fully factorized Gaussian (FFG) distribution by comparing the marginal log-likelihood estimate, $\log { \dot { \hat { p } } } ( x )$ , and the Optimal FFG bound, $\mathcal { L } _ { \mathrm { V A E } } [ q _ { F F G } ^ { * } ]$ . In other words, we are estimating the KL divergence between the optimal Gaussian and the true posterior, $\mathrm { K L } \left( q ^ { * } ( z | x ) | | p ( z | x ) \right)$ .
|
| 184 |
+
|
| 185 |
+
In Table 2 on MNIST, the Optimal Flow improves upon the Optimal FFG for the FFG trained model by 0.4 nats. In contrast, on the Flow trained model, the difference increases to 12.5 nats. This suggests that the true posterior of a FFG-trained model is closer to FFG than the true posterior of the Flow-trained model. The same observation can be made on the Fashion-MNIST dataset. This implies that the decoder can learn to have a true posterior that fits better to the approximation. Although the generative model can learn to have a posterior that fits to the approximation, it seems that not having this constraint, ie. using a flexible approximate, results in better generative models.
|
| 186 |
+
|
| 187 |
+
We can use these observations to help justify our approximation and amortization gap results of Section 5.2. Those results showed that the amortization error is often the main cause of inference suboptimality. One reason for this is that the generator accommodates to the choice of approximation, as shown above, thus reducing the approximation error.
|
| 188 |
+
|
| 189 |
+
Given that we have seen that the generator could accommodate to the choice of approximation, our next question is whether a generator with more capacity can accommodate more. To this end, we trained VAEs with decoders of different sizes and measured the approximation gaps. Specifically, we trained decoders with 0, 2, and 4 hidden layers on MNIST. See Table 5 for the results. We see that as the capacity of the decoder increases, the approximation gap decreases. This result implies that the more flexible the generator, the less flexible the approximate distribution needs to be.
|
| 190 |
+
|
| 191 |
+
Table 5: Increased decoder capacity reduces approximation gap. All numbers are in nats.
|
| 192 |
+
|
| 193 |
+
<table><tr><td>Generator HiddenLayers</td><td>0</td><td>2</td><td>4</td></tr><tr><td>logp(x)</td><td>-100.52</td><td>-86.61</td><td>-83.82</td></tr><tr><td>LVAE[qFFG]</td><td>-104.42</td><td>-84.78</td><td>-82.19</td></tr><tr><td>Approximation Gap</td><td>3.90</td><td>1.83</td><td>1.63</td></tr></table>
|
| 194 |
+
|
| 195 |
+
# 5.3.1 ANNEALING THE ENTROPY
|
| 196 |
+
|
| 197 |
+
Typical warm-up (Bowman et al., 2015; Sønderby et al., 2016) refers to annealing $\mathrm { K L } \left( q ( \boldsymbol { z } | \boldsymbol { x } ) | | p ( \boldsymbol { z } ) \right)$ during training. This can also be interpreted as performing maximum likelihood estimation (MLE) early on during training. This optimization technique is known to help prevent the latent variable from degrading to the prior (Burda et al., 2016; Sønderby et al., 2016). We employ a similar annealing scheme during training. Rather than annealing the KL divergence, we anneal the entropy of the approximate distribution $q$ :
|
| 198 |
+
|
| 199 |
+
$$
|
| 200 |
+
\begin{array} { r } { \mathbb { E } _ { z \sim q ( z | x ) } \left[ \log p ( x , z ) - \lambda \log q ( z | x ) \right] , } \end{array}
|
| 201 |
+
$$
|
| 202 |
+
|
| 203 |
+
where $\lambda$ is annealed from 0 to 1 over training. This can be interpreted as maximum a posteriori (MAP) in the initial phase. Due to its similarity, we will also refer to this technique as warm-up.
|
| 204 |
+
|
| 205 |
+
We find that warm-up techniques, such as annealing the entropy, are important for allowing the true posterior to be more complex. Table 6 are results from a model trained without the entropy annealing schedule. Comparing these results to Table 2, we observe that the difference between $\mathcal { L } _ { \mathrm { V A E } } [ q _ { F F G } ^ { * } ]$ and $\mathcal { L } _ { \mathrm { V A E } } [ q _ { F l o w } ^ { * } ]$ is significantly smaller without entropy annealing. This indicates that the true posterior is more Gaussian when entropy annealing is not used. This suggests that, in addition to preventing the latent variable from degrading to the prior, entropy annealing allows the true posterior to better utilize the flexibility of the expressive approximation, resulting in a better trained model.
|
| 206 |
+
|
| 207 |
+
<table><tr><td rowspan="7">log p(x) LVAE[qFlow LVAE[qFFG]</td><td colspan="2">MNIST</td><td colspan="2">Fashion-MNIST</td></tr><tr><td>qFFG</td><td>qFlow</td><td>qFFG</td><td>qFlow</td></tr><tr><td>-89.82</td><td>-89.52</td><td>-102.56</td><td>-102.88</td></tr><tr><td>-90.96</td><td>-90.45</td><td>-103.73</td><td>-104.02</td></tr><tr><td>-90.84</td><td>-92.25</td><td>-103.85</td><td>-105.80</td></tr><tr><td>-92.33</td><td>-91.75</td><td>-106.90</td><td>-107.01</td></tr><tr><td>LvAE[q] Approximation 1.02</td><td>0.93</td><td>1.29</td><td>1.14</td></tr><tr><td>Amortization</td><td>1.49</td><td>1.30</td><td>3.05</td><td>2.29</td></tr><tr><td>Inference</td><td>2.51</td><td>2.23</td><td>4.34</td><td>4.13</td></tr></table>
|
| 208 |
+
|
| 209 |
+
Table 6: Models trained without entropy annealing. The columns $q _ { F F G }$ and $q _ { F l o w }$ refer to the variational distribution used for training the model. All numbers are in nats.
|
| 210 |
+
|
| 211 |
+
# 6 CONCLUSION
|
| 212 |
+
|
| 213 |
+
In this paper, we investigated how encoder capacity, approximation choice, decoder capacity, and model optimization influence inference suboptimality in terms of the approximation and amortization gaps. We found that the amortization gap is often the leading source of inference suboptimality and that the generator reduces the approximation gap by learning a true posterior that fits to the choice of approximate distribution. We showed that the parameters used to increase the expressiveness of the approximation play a role in generalizing inference rather than simply improving the complexity of the approximation. We confirmed that increasing the capacity of the encoder reduces the amortization error. We also showed that optimization techniques, such as entropy annealing, help the generative model to better utilize the flexibility of the expressive variational distribution. Computing these gaps can be useful for guiding improvements to inference in VAEs. Future work includes evaluating other types of expressive approximations and more complex likelihood functions.
|
| 214 |
+
|
| 215 |
+
REFERENCES
|
| 216 |
+
P. Bachman and D. Precup. Training Deep Generative Models: Variations on a Theme. NIPS Approximate Inference Workshop, 2015.
|
| 217 |
+
S. R. Bowman, L. Vilnis, O. Vinyals, A. M. Dai, R. Jozefowicz, and S. Bengio. Generating Sentences from a Continuous Space. ArXiv e-prints, November 2015.
|
| 218 |
+
Y. Burda, R. Grosse, and R. Salakhutdinov. Importance weighted autoencoders. In ICLR, 2016.
|
| 219 |
+
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.
|
| 220 |
+
C. Cremer, Q. Morris, and D. Duvenaud. Reinterpreting Importance-Weighted Autoencoders. ICLR Workshop, 2017.
|
| 221 |
+
L. Dinh, J. Sohl-Dickstein, and S. Bengio. Density estimation using Real NVP. ICLR, 2017.
|
| 222 |
+
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.
|
| 223 |
+
Aidan N Gomez, Mengye Ren, Raquel Urtasun, and Roger B Grosse. The reversible residual network: Backpropagation without storing activations. In Advances in Neural Information Processing Systems, pp. 2211–2221, 2017.
|
| 224 |
+
R. Grosse, Z. Ghahramani, and R. P Adams. Sandwiching the marginal likelihood using bidirectional monte carlo. arXiv preprint arXiv:1511.02543, 2015.
|
| 225 |
+
R Devon Hjelm, Kyunghyun Cho, Junyoung Chung, Russ Salakhutdinov, Vince Calhoun, and Nebojsa Jojic. Iterative refinement of approximate posterior for training directed belief networks. arXiv preprint arXiv:1511.06382, 2015.
|
| 226 |
+
Matthew D Hoffman, David M Blei, Chong Wang, and John Paisley. Stochastic variational inference. The Journal of Machine Learning Research, 14(1):1303–1347, 2013.
|
| 227 |
+
C. Jarzynski. Nonequilibrium equality for free energy differences. Physical Review Letters, 78(14): 2690, 1997.
|
| 228 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 229 |
+
D.P. Kingma and M. Welling. Auto-Encoding Variational Bayes. In ICLR, 2014.
|
| 230 |
+
D.P. Kingma, T. Salimans, R. Jozefowicz, X. Chen, I. Sutskever, and M. Welling. Improving Variational Inference with Inverse Autoregressive Flow. NIPS, 2016.
|
| 231 |
+
R. G. Krishnan, D. Liang, and M. Hoffman. On the challenges of learning with inference networks on sparse, high-dimensional data. ArXiv e-prints, October 2017.
|
| 232 |
+
Hugo Larochelle and Yoshua Bengio. Classification using discriminative restricted boltzmann machines. In Proceedings of the 25th international conference on Machine learning, pp. 536–543. ACM, 2008.
|
| 233 |
+
L. Maaløe, CK. Sønderby, SK. Sønderby, and O. Winther. Auxiliary Deep Generative Models. ICML, 2016.
|
| 234 |
+
Radford M Neal et al. Mcmc using hamiltonian dynamics. Handbook of Markov Chain Monte Carlo, 2(11), 2011.
|
| 235 |
+
R.M. Neal. Annealed importance sampling. Statistics and Computing, 2001.
|
| 236 |
+
R. Ranganath, D. Tran, and D. M. Blei. Hierarchical Variational Models. ICML, 2016.
|
| 237 |
+
D.J. Rezende and S Mohamed. Variational Inference with Normalizing Flows. In ICML, 2015.
|
| 238 |
+
|
| 239 |
+
D.J. Rezende, S. Mohamed, and D. Wierstra. Stochastic Backpropagation and Approximate Inference in Deep Generative Models. ICML, 2014.
|
| 240 |
+
|
| 241 |
+
R. Salakhutdinov and I. Murray. On the quantitative analysis of deep belief networks. In Proceedings of the 25th international conference on Machine learning, pp. 872–879. ACM, 2008.
|
| 242 |
+
|
| 243 |
+
Ruslan Salakhutdinov and Hugo Larochelle. Efficient learning of deep boltzmann machines. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, pp. 693–700, 2010.
|
| 244 |
+
|
| 245 |
+
T. Salimans, D.P. Kingma, and M. Welling. Markov chain monte carlo and variational inference: Bridging the gap. In ICML, 2015.
|
| 246 |
+
|
| 247 |
+
Casper Kaae Sønderby, Tapani Raiko, Lars Maaløe, Søren Kaae Sønderby, and Ole Winther. Ladder variational autoencoders. In Advances in Neural Information Processing Systems, pp. 3738–3746, 2016.
|
| 248 |
+
|
| 249 |
+
J. M. Tomczak and M. Welling. Improving Variational Auto-Encoders using Householder Flow. ArXiv e-prints, November 2016.
|
| 250 |
+
|
| 251 |
+
J. M. Tomczak and M. Welling. Improving Variational Auto-Encoders using convex combination linear Inverse Autoregressive Flow. ArXiv e-prints, June 2017.
|
| 252 |
+
|
| 253 |
+
Y. Wu, Y. Burda, R. Salakhutdinov, and R. Grosse. On the Quantitative Analysis of Decoder-Based Generative Models. ICLR, 2017.
|
| 254 |
+
|
| 255 |
+
Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms. github.com/zalandoresearch/fashion-mnist, 2017.
|
| 256 |
+
|
| 257 |
+
# APPENDIX
|
| 258 |
+
|
| 259 |
+
# 6.1 MODEL ARCHITECTURES AND TRAINING HYPERPARAMETERS
|
| 260 |
+
|
| 261 |
+
# 6.1.1 2D VISUALIZATION
|
| 262 |
+
|
| 263 |
+
The VAE model of Fig. 2 uses a decoder $p ( x | z )$ with architecture: $2 - 1 0 0 - 7 8 4$ , and an encoder $q ( z | x )$ with architecture: $7 8 4 - 1 0 0 - 4$ . We use tanh activations and a batch size of 50. The model is trained for 3000 epochs with a learning rate of $1 0 ^ { - 4 }$ using the ADAM optimizer (Kingma & Ba, 2014).
|
| 264 |
+
|
| 265 |
+
# 6.1.2 MNIST & FASHION-MNIST
|
| 266 |
+
|
| 267 |
+
Both MNIST and Fashion-MNIST consist of a training and test set with 60k and 10k datapoints respectively, where each datapoint is a $2 8 \mathbf { x } 2 8$ grey-scale image. We rescale the original images so that pixel values are within the range [0, 1]. For MNIST, We use the statically binarized version described by Larochelle & Bengio (2008). We also binarize Fashion-MINST statically. For both datasets, we adopt the Bernoulli likelihood for the generator.
|
| 268 |
+
|
| 269 |
+
The VAE models for MNIST and Fashion-MNIST experiments have the same architecture given in table 7. The flow configuration is given in table 8.
|
| 270 |
+
|
| 271 |
+
Table 7: Neural net architecture for MNIST/Fashion-MNIST experiments.
|
| 272 |
+
|
| 273 |
+
<table><tr><td>Inference Network</td><td>Generator</td></tr><tr><td>Input ∈R784</td><td>Input ∈R50</td></tr><tr><td>FC.200-ELU-FC.200-ELU-FC.50+50</td><td>FC.200-ELU-FC.200-ELU-FC.784-Sigmoid</td></tr></table>
|
| 274 |
+
|
| 275 |
+
In the large encoder setting, we change the number of hidden units for the inference network to be 500, instead of 200. The warm-up models are trained with a linear schedule over the first 400 epochs according to Section 5.3.1.
|
| 276 |
+
|
| 277 |
+
The activation function is chosen to be the exponential linear unit (ELU, Clevert et al. (2015)), as we observe improved performance compared to tanh. We follow the same learning rate schedule and train for the same amount of epochs as described by Burda et al. (2016). All models are trained with the a batch-size of 100 with ADAM.
|
| 278 |
+
|
| 279 |
+
# 6.1.3 CIFAR-10
|
| 280 |
+
|
| 281 |
+
CIFAR-10 consists of a training and test dataset with $5 0 \mathrm { k }$ and $1 0 \mathrm { k }$ datapoints respectively, where each datapoint is a $3 2 \times 3 2$ color image. We rescale individual pixel values to be in the range [0, 1]. We follow the discretized logistic likelihood model adopted by Kingma et al. (2016), where each input channel has its own scale learned by an MLP. For the latent variable, we use a 32-dimensional factorized Gaussian for $q ( z | x )$ following Kingma et al. (2016). For all neural networks, ELU is chosen to be the activation function. The specific network architecture is shown in Table 9.
|
| 282 |
+
|
| 283 |
+
We adopt a gradually decreasing learning rate with an initialize value of $1 0 ^ { - 3 }$ . Warm-up is applied with a linear schedule over the first 20 epochs. All models are trained with a batch-size of 100 with ADAM. Early-stopping is applied based on the performance on the held-out set.
|
| 284 |
+
|
| 285 |
+
For the model with expressive inference, we use four flow steps as opposed to only two in MNIST/Fashion-MNIST experiments.
|
| 286 |
+
|
| 287 |
+
# 6.2 INFLUENCE OF FLOWS ON AMORTIZATION GAP EXPERIMENT
|
| 288 |
+
|
| 289 |
+
The aim of this experiment is to show that the parameters used for increasing the expressiveness of the approximation also contribute to reducing the amortization error. To show this, we train a VAE on MNIST, discard the encoder, then retrain two encoders on the fixed decoder: one with a factorized Gaussian distribution and the other with a parameterized ’flow’ distribution. We use fixed decoder so that the true posterior is constant for both encoders. See 5.2.1 for the results and below for the architecture details.
|
| 290 |
+
|
| 291 |
+
The architecture of the decoder is: $D _ { Z } - 2 0 0 - 2 0 0 - D _ { X }$ . The architecture of the encoder used to train the decoder is $D _ { X } - 2 0 0 - 2 0 0 - 2 D _ { Z }$ . The approximate distribution $q ( z | x )$ is a factorized Gaussian.
|
| 292 |
+
|
| 293 |
+
Next, we describe the encoders which were trained on the fixed trained decoder. In order to highlight a large amortization gap, we employed a very small encoder architecture: $D _ { X } - 2 D _ { Z }$ . This encoder has no hidden layers, which greatly impoverishes its ability and results in a large amortization gap.
|
| 294 |
+
|
| 295 |
+
We compare two approximate distributions $q ( z | x )$ . Firstly, we experiment with the typical fully factorized Gaussian (FFG). The second is what we call a flow distribution. Specifically, we use the transformations of Dinh et al. (2017). We also include an auxiliary variable so we don’t need to select how to divide the latent space for the transformations. The approximate distribution over the latent $z$ and auxiliary variable $v$ factorizes as: $q ( z , v | x ) = q ( z | x ) \bar { q } ( v )$ . The $q ( v )$ distribution is simply a ${ \bf N } ( 0 , 1 )$ distribution. Since we’re using a auxiliary variable, we also require the $r ( v | z )$ distribution which we parameterize as $r ( v | z )$ : $[ D z ] - 5 0 - 5 0 - 2 D z$ . The flow transformation is the same as in Section 3.2, which we apply twice.
|
| 296 |
+
|
| 297 |
+
<table><tr><td>q(uolz0)</td><td>r(Ur|zT)</td></tr><tr><td>Input ∈R50</td><td>Input ∈ R50</td></tr><tr><td>FC.100-ELU-FC.100-ELU-FC.50+50</td><td>FC.100-ELU-FC.100-ELU-FC.50+50</td></tr></table>
|
| 298 |
+
|
| 299 |
+
<table><tr><td colspan="2">q(Ut+1, Zt+1lUt, zt)</td></tr><tr><td>01(),02()</td><td>μ1(.),μ2(.)</td></tr><tr><td>Input ∈ R50</td><td>Input ∈ R50</td></tr><tr><td>FC.100-ELU-FC.100-ELU-FC.50</td><td>FC.100-ELU-FC.100-ELU-FC.50</td></tr></table>
|
| 300 |
+
|
| 301 |
+
Table 8: Flow setting for MNIST/Fashion-MNIST experiments. $q ( v _ { T } , z _ { T } | v _ { 0 } , z _ { 0 } )$ consists of two normalizing flows given in the second tabular.
|
| 302 |
+
|
| 303 |
+
<table><tr><td>Inference Network</td><td>Generator</td></tr><tr><td>Input 32 × 32 color image</td><td>Input ∈ R32</td></tr><tr><td>4 × 4 conv. 64 channels.stride 2.BN 4 × 4 conv.128 channels.stride 2.BN</td><td>FC.256×2×2ELU;FC.64-ELU-FC.32-ELU-FC.3 4 × 4 deconv. 128 channels. stride 2. BN</td></tr><tr><td>4 × 4 conv. 256 channels. stride 2.BN</td><td>4 × 4 deconv.64 channels.stride 2.BN</td></tr><tr><td>FC.32 + 32.output layer for mean and log-variance</td><td>4 × 4 deconv.3 channels.stride 2. Sigmoid</td></tr></table>
|
| 304 |
+
|
| 305 |
+
Table 9: Network architecture for CIFAR-10 experiments. For the generator, one of the MLPs immediately after the input layer of the generator outputs channel-wise scales for the discretized logistic likelihood model. BN stands for batch-normalization.
|
| 306 |
+
|
| 307 |
+
# 6.3 COMPUTATION OF THE DETERMINANT FOR FLOW
|
| 308 |
+
|
| 309 |
+
The overall mapping $f$ that performs $( z , v ) \mapsto ( z ^ { \prime } , v ^ { \prime } )$ is the composition of two sheer mappings $f _ { 1 }$ and $f _ { 2 }$ that respectively perform $( z , v ) \mapsto ( z , v ^ { \prime } )$ and $( z , v ^ { \prime } ) \mapsto ( z ^ { \prime } , v ^ { \prime } )$ . Since the Jacobian of either one of the sheer mappings is diagonal, the determinant of the composed transformation’s Jacobian $D f$ can be easily computed:
|
| 310 |
+
|
| 311 |
+
$$
|
| 312 |
+
\operatorname * { d e t } ( D f ) = \operatorname * { d e t } ( D f _ { 1 } ) \mathrm { d e t } ( D f _ { 2 } ) = \Bigl ( \prod _ { i = 1 } ^ { n } \sigma _ { 1 } ( z ) _ { i } \Bigr ) \Bigl ( \prod _ { j = 1 } ^ { n } \sigma _ { 2 } ( v ^ { \prime } ) _ { j } \Bigr ) .
|
| 313 |
+
$$
|
| 314 |
+
|
| 315 |
+
# 6.4 LOCAL OPTIMIZATION OF APPROXIMATE DISTRIBUTION
|
| 316 |
+
|
| 317 |
+
For the local FFG optimization, we initialize the mean and variance as the prior, i.e. $\mathcal { N } ( 0 , I )$ . We optimize the mean and variance using the Adam optimizer with a learning rate of $1 0 ^ { - 3 }$ . To determine convergence, after every 100 optimization steps, we compute the average of the previous 100 ELBO values and compare it to the best achieved average. If it does not improve for 10 consecutive iterations then the optimization is terminated. For the Flow model, the same process is used to optimize all of its parameters. All neural nets for the flow were initialized with a variant of the Xavier initilization (Glorot & Bengio, 2010). We use 100 Monte Carlo samples to compute the ELBO to reduce variance.
|
| 318 |
+
|
| 319 |
+
# 6.5 ANNEALED IMPORTANCE SAMPLING
|
| 320 |
+
|
| 321 |
+
Annealed importance sampling (AIS, Neal (2001); Jarzynski (1997)) is a means of computing a lower bound to the marginal log-likelihood. Similarly to the importance weighted bound, AIS must sample a proposal distribution $\bar { f } _ { 1 } ( z )$ and compute the density of these samples, however, AIS then transforms the samples through a sequence of reversible transitions $\mathcal { T } _ { t } ( z ^ { \prime } | z )$ . The transitions anneal the proposal distribution to the desired distribution $f _ { T } ( z )$ .
|
| 322 |
+
|
| 323 |
+
Specifically, AIS samples an initial state $z _ { 1 } \sim f _ { 1 } ( z )$ and sets an initial weight $w _ { 1 } = 1$ . For the following annealing steps, $z _ { t }$ is sampled from $\mathcal { T } _ { t } { \left( z ^ { \prime } \right| } z )$ and the weight is updated according to:
|
| 324 |
+
|
| 325 |
+
$$
|
| 326 |
+
w _ { t } = w _ { t - 1 } \frac { f _ { t } ( z _ { t - 1 } ) } { f _ { t - 1 } ( z _ { t - 1 } ) } .
|
| 327 |
+
$$
|
| 328 |
+
|
| 329 |
+
This procedure produces weight $w _ { T }$ such that $\mathbb { E } \left[ w _ { T } \right] = \mathcal { Z } _ { T } / \mathcal { Z } _ { 1 }$ , where $Z _ { T }$ and $Z _ { 1 }$ are the normalizing constants of $f _ { T } ( z )$ and $f _ { 1 } ( z )$ respectively. This pertains to estimating the marginal likelihood when the target distribution is $p ( x , z )$ when we integrate with respect to $z$ .
|
| 330 |
+
|
| 331 |
+
Typically, the intermediate distributions are simply defined to be geometric averages: $f _ { t } ( z ) ~ =$ $\dot { f _ { 1 } } \dot { ( z ) } ^ { 1 - \dot { \beta _ { t } } } f _ { T } ( z ) ^ { \beta _ { t } }$ , where $\beta _ { t }$ is monotonically increasing with $\beta _ { 1 } = 0$ and $\beta _ { T } = 1$ . When $f _ { 1 } ( z ) =$ $p ( z )$ and $f _ { T } ( z ) = p ( x , z )$ , the intermediate distributions are: $f _ { i } ( x ) = p ( z ) p ( x | z ) ^ { \beta _ { i } }$ .
|
| 332 |
+
|
| 333 |
+
Model evaluation with AIS appears early on in the setting of deep belief networks (Salakhutdinov & Murray, 2008). AIS for decoder-based models was also used by $\mathrm { { W u } }$ et al. (2017). They validated the accuracy of the approach with Bidirectional Monte Carlo (BDMC, Grosse et al. (2015)) and demonstrated the advantage of using AIS over the IWAE bound for evaluation when the inference network overfits to the training data.
|
| 334 |
+
|
| 335 |
+
# 6.6 THE INFERENCE GAP
|
| 336 |
+
|
| 337 |
+
How well is inference done in VAEs during training? Are we close to doing the optimal or is there much room for improvement? To answer this question, we quantitatively measure the inference gap: the gap between the true marginal log-likelihood and the lower bound. This amounts to measuring how well inference is being done during training. Since we cannot compute the exact marginal log-likelihood, we estimate it using the maximum of any of its lower bounds, described in 3.3.
|
| 338 |
+
|
| 339 |
+
Fig. 3a shows training curves for a FFG and Flow inference network as measured by the VAE, IWAE, and AIS bounds on the training and test set. The inference gap on the training set with the FFG model is 3.01 nats, whereas the Flow model is 2.71 nats. Accordingly, Fig. 3a shows that the training IWAE bound is slightly tighter for the Flow model compared to the FFG. Due to this lower inference gap during training, the Flow model achieves a higher AIS bound on the test set than the FFG model.
|
| 340 |
+
|
| 341 |
+
To demonstrate that a very small inference gap can be achieved, even with a limited approximation such as a factorized Gaussian, we train the model on a small dataset. In this experiment, our training set consists of 1000 datapoints randomly chosen from the original MNIST training set. The training curves on this small datatset are show in Fig. 3b. Even with a factorized Gaussian distribution, the inference gap is very small: the AIS and IWAE bounds are overlapping and the VAE is just slightly below. Yet, the model is overfitting as seen by the decreasing test set bounds.
|
| 342 |
+
|
| 343 |
+

|
| 344 |
+
Figure 3: Training curves for a FFG and a Flow inference model on MNIST. AIS provides the tightest lower bound and is independent of encoder overfitting. There is little difference between FFG and Flow models trained on the 1000 datapoints since inference is nearly equivalent.
|
| 345 |
+
|
| 346 |
+
# 6.6.1 ENCODER AND DECODER OVERFITTING
|
| 347 |
+
|
| 348 |
+
We will begin by explaining how we separate encoder from decoder overfitting. Decoder overfitting is the same as in the regular supervised learning scenario, where we compare the train and test error. To measure decoder overfitting independently from encoder overfitting, we use the AIS bound since it is encoder-independent. Thus we can observe decoder overfitting through the AIS test training curve. In contrast, the encoder can only overfit in the sense that the recognition network becomes unsuitable for computing the marginal likelihood on the test set. Thus, encoder overfitting is computed by: $\mathcal { L } _ { \mathrm { A I S } } \ - \mathcal { L } _ { \mathrm { I W } }$ on the test set.
|
| 349 |
+
|
| 350 |
+
For the small dataset of Fig. 3b, it clear that there is significant encoder and decoder overfitting. A model trained in this setting would benefit from regularization. For Fig. 3a, the model is not overfit and would benefit from more training. However, there is some encoder overfitting due to the gap between the AIS and IWAE bounds on the test set. Comparing the FFG and Flow models, it appears that the Flow does not have a large effect on encoder or decoder overfitting.
|
| 351 |
+
|
| 352 |
+
# 6.7 GAUSSIAN LATENTS WITH FULL COVARIANCE
|
| 353 |
+
|
| 354 |
+
The flexiblity of the Gaussian family with arbitrary covariance lies between that of FFG and Flow. With covariance, the Gaussian distribution can model interactions between different latent dimensions. Yet, compared to Flow, its expressiveness is limited due to its inability to model higher order interactions and its unimodal nature.
|
| 355 |
+
|
| 356 |
+
To apply the reparameterization trick, we perform the Cholesky decomposition on the covariance matrix: $\overrightharpoon { \Sigma } = L \overrightharpoon { L } ^ { \top }$ , where $L$ is lower triangular. A sample from $\mathcal { N } ( \boldsymbol { \mu } , \boldsymbol { \Sigma } )$ could be obtained by first sampling from a unit Gaussian $\epsilon \sim \mathcal { N } ( 0 , \bar { I } )$ , then computing $z = \mu + L \epsilon$ .
|
| 357 |
+
|
| 358 |
+
To analyze the capability of the Gaussian family, we train several VAEs on MNIST and FashionMNIST with the approximate posterior $q ( z | x )$ being a Gaussian with full covariance. To inspect how well inference is done, we perform the local optimizations described in Section 5.2 with FFG and Flow.
|
| 359 |
+
|
| 360 |
+
Table 10: Gaussian latents trained with full covariance.
|
| 361 |
+
|
| 362 |
+
<table><tr><td></td><td>MNIST</td><td>Fashion-MNIST</td></tr><tr><td>logp(x)</td><td>-89.28</td><td>-96.46</td></tr><tr><td>LVAElqFlow]</td><td>-90.69</td><td>-98.19</td></tr><tr><td>LvAE[FFG]</td><td>-101.84</td><td>-107.89</td></tr><tr><td>LvAE[q]</td><td>-92.05</td><td>-102.93</td></tr></table>
|
| 363 |
+
|
| 364 |
+
We can see from table 10 that local optimization with FFG on a model trained with full covariance inference produces a bad lower bound. This resonates with the argument that the approximation has a significant influence on the true posterior as described in section 5.3.
|
| 365 |
+
|
| 366 |
+
Comparing to numbers in table 2, we can see that the full-covariance VAE trained on MNIST is nearly on par with that trained with Flow (-89.28 vs -88.94). For Fashion-MNIST, the fullcovariance VAE even performs better by a large margin in terms of the estimated log-likelihood (-96.46 vs -97.41).
|
md/train/BylVcTNtDS/BylVcTNtDS.md
ADDED
|
@@ -0,0 +1,251 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# A TARGET-AGNOSTIC ATTACK ON DEEP MODELS: EXPLOITING SECURITY VULNERABILITIES OF TRANSFER LEARNING
|
| 2 |
+
|
| 3 |
+
Shahbaz Rezaei & Xin Liu
|
| 4 |
+
Department of Computer Science
|
| 5 |
+
University of California
|
| 6 |
+
Davis, CA 95616, USA
|
| 7 |
+
{srezaei,xinliu}@ucdavis.edu
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Due to insufficient training data and the high computational cost to train a deep neural network from scratch, transfer learning has been extensively used in many deep-neural-network-based applications. A commonly used transfer learning approach involves taking a part of a pre-trained model, adding a few layers at the end, and re-training the new layers with a small dataset. This approach, while efficient and widely used, imposes a security vulnerability because the pre-trained model used in transfer learning is usually publicly available, including to potential attackers. In this paper, we show that without any additional knowledge other than the pre-trained model, an attacker can launch an effective and efficient brute force attack that can craft instances of input to trigger each target class with high confidence. We assume that the attacker has no access to any target-specific information, including samples from target classes, re-trained model, and probabilities assigned by Softmax to each class, and thus making the attack target-agnostic. These assumptions render all previous attack models inapplicable, to the best of our knowledge. To evaluate the proposed attack, we perform a set of experiments on face recognition and speech recognition tasks and show the effectiveness of the attack. Our work reveals a fundamental security weakness of the Softmax layer when used in transfer learning settings.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Deep learning has been widely used in various applications, such as image classification Parkhi et al. (2015), image segmentation Chen et al. (2016), speech recognition Ji et al. (2018), machine translation Wu et al. (2016), network traffic classification Rezaei & Liu (2019b), etc. Because training a deep model is expensive, time-consuming, and data intensive, it is often undesirable or impractical to train a model from scratch in many applications. In such cases, transfer learning is often adopted to overcome these hurdles.
|
| 16 |
+
|
| 17 |
+
A typical approach for transfer learning is to transfer a part of the network that has already been trained on a similar task, add one or more layers at the end, and then re-train the model. Since a large part of the model has already been trained on a similar task, the weights are usually kept frozen and only the new layers are trained on the new task. Hence, the number of training parameters is considerably smaller than it is when training the entire model, which allows us to train the model quickly with a small dataset. Transfer learning has been widely used in practice Rezaei & Liu (2019c), including applications such as face recognition Parkhi et al. (2015), text-to-speech synthesis Jia et al. (2018), encrypted traffic classification Rezaei & Liu (2019a), and skin cancer detection Esteva et al. (2017).
|
| 18 |
+
|
| 19 |
+
One security vulnerability of transfer learning is that pre-trained models, also refereed to as teacher models, are often publicly available. For example, Google Cloud ML tutorial suggests using Google’s Inception V3 model as a pre-trained model and Microsoft Cognitive Toolkit (CNTK) suggests using ResNet18 as a pre-trained model for tasks such as flower classification Wang et al.
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1: Example of activation vector and how the Softmax layer responses. The image on the left shows the activation vector of a natural face in the training set. The Softmax layer performs Softmax operation over the linear combination of such activation vectors and assigns high confidence to the corresponding class. The target-agnostic image (the image on the right) is crafted such that it activates one neuron in activation vector with extremely large value and all others are almost zero. Such activation vector also fools the softmax layer to produce output with high confidence. Due to the lack of space, we only show the first 400 neurons of the activation vector.
|
| 23 |
+
|
| 24 |
+
(2018). This means that the part of the model transferred from the pre-trained model is known to potential attackers.
|
| 25 |
+
|
| 26 |
+
In this paper, we show that an attacker can launch a target-agnostic attack and fool the network when only the pre-trained model is available to the attacker. In our attack, the attacker only knows the pretrained (teacher) model used to re-train the target (student) model. The attacker does not know the class labels, samples from any target class, the entire re-trained model, or probabilities the model assigns to each class, making it target-agnostic. To the best of our knowledge, these assumptions are more general than those used in any previously proposed attack models, which renders the old models ineffective.
|
| 27 |
+
|
| 28 |
+
The target-agnostic attack can be adopted in scenarios where fingerprint, face, or voice is used for authentication/verification. In such cases, the attacker usually lacks access to fingerprint or voice samples, which could be used to bypass authentication/verification. Our attack aims to craft an input that triggers any target class with high confidence. The attacker can also continue the crafting process to trigger all target classes. Such adversarial examples can be used to easily bypass authentication/verification systems without having a true sample of the target class. Our work develops a highly effective target-agnostic attack, exploiting the intrinsic characteristic of Softmax in transfer learning settings. Our experiments on face recognition and speech recognition demonstrate the effectiveness of our attack.
|
| 29 |
+
|
| 30 |
+
In a typical transfer learning procedure, all neural network layers up to the penultimate layer are transferred to a new model and then a Softmax layer is added and re-trained on a new task. We call the scores at the penultimate layer activation vector and the part of the model that produces the activation vector feature extractor. Hence, the Softmax layer basically computes the softmax operation over the linear combination of activation vector. The left side of Figure 1 presents a natural input and a typical activation vector. Due to the use of linear combination of elements of activation vectors in Softmax layer, not only such patterns can trigger the corresponding classes, but also a large number of other unrelated patterns can also trigger Softmax layer in the same way. In this paper, we show that if we craft an image that produces an activation vector such that one neuron is large and others are almost zero (the right side of Figure 1), it triggers the class for which the weight associated to that neuron is higher in the linear combination. In other words, instead of finding all features that should be activated by feature extractor, we assign very large value to only one neuron to compensate for other neurons that we do not activate.
|
| 31 |
+
|
| 32 |
+
In summary, the contributions of this paper are as follows:
|
| 33 |
+
|
| 34 |
+
1. Present a target-agnostic attack in transfer learning settings. We show that if the pre-trained model used during transfer learning is available, an attacker can craft a set of universal adversarial images that can effectively fool any model re-trained on the pre-trained model. Our attack does not need any training sample from the target model or the target model itself for crafting images. Such a target-agnostic attack has two consequences: I) the crafting time is irrelevant because adversarial images are crafted only once and then they can be used on any model that used the pre-trained model during the transfer learning stage (that is why the attack is called target-agnostic), and II) it does not need to query the target model to craft images. Hence, an attack can craft a set of adversarial images on VGG face model, as an example, and then uses them effectively on any re-trained model based on VGG face.
|
| 35 |
+
|
| 36 |
+
2. Design a simple approach to exploit the vulnerabilities of Softmax layer. We show that both threshold-based approach, where the model only accept the classification result if the confidence is high, and reject-class-based approach, where the model is trained with an extra class, called reject/null class, to reject adversarial images are prone to our attack.
|
| 37 |
+
|
| 38 |
+
3. Evaluation of our attack on face recognition and speech recognition tasks. We study the effectiveness of our model in different scenarios and settings.
|
| 39 |
+
|
| 40 |
+
# 2 RELATED WORK
|
| 41 |
+
|
| 42 |
+
In general, there are two types of attacks on deep neural networks in literature: I) evasion and 2) data poisoning. In the evasion attack, an attacker aims to craft or modify an input to fool the neural network or force the model to predict a specific target class Elsayed et al. (2018). Various methods have been developed to generate adversarial examples by iteratively modifying pixels in an image using gradient of the loss function with respect to the input to finally fool the network Szegedy et al. (2013); Carlini & Wagner (2017a;b). These attacks usually assume that the gradient of the loss function is available to the attacker. In cases where the gradient is not available, it has been shown than one can still generate adversarial examples if the top 3 (or any other number of) predicted class labels are available Sharif et al. (2016). Interestingly, it has been shown that the adversarial examples are often universal, that is, an adversarial example generated for a model can often fool other models as well Carlini & Wagner (2017a). This allows an attacker to craft adversarial examples from a model she trained and use it on the target model provided that the training set is available.
|
| 43 |
+
|
| 44 |
+
The second type of attacks on deep neural networks is called data poisoning Shafahi et al. (2018). In the data poisoning attack, an attacker modifies the training dataset to create a backdoor that can be used later to trigger specific neurons which cause mis-classification. In some papers, a specific pattern is generated and added to the training set to fool the network to associate the pattern with a specific target class Sharif et al. (2016); Chen et al. (2017b); Liao et al. (2018); Liu et al. (2017). For instance, these patterns can be an eyeglass in a face recognition task Sharif et al. (2016), randomly chosen patterns Chen et al. (2017b), some specific watermarks or logos Liu et al. (2017), specific patterns to fool malware classifiers Munoz-Gonz ˜ alez et al. (2017), etc. In some extreme cases, it ´ has been shown that by only modifying a single bit to have a maximum or minimum possible value, one can create a backdoor Alberti et al. (2018). This happens due to the operation of max pooling layer commonly used in convolutional neural networks. After the training phase, the backdoor can be used to fool the network to predict the class label associated with these patterns at inference time.
|
| 45 |
+
|
| 46 |
+
There are a few studies specifically focused on attacks in transfer learning scenarios Ji et al. (2018); Wang et al. (2018). In Wang et al. (2018), the pre-trained model and an instance of target image are assumed to be available. Assuming that the attacker knows that the first $k$ layers of the pretrained model copied to the new model, the attacker perturb the source image such that the internal representation (activation vector) of the source image becomes similar to the internal representation of the target image at layer $k$ , using pre-trained model. In Ji et al. (2018), first, a set of semantic neighbors are generated for a given source and target input which are used to find the salient features of the source and target class. Then, similar to Wang et al. (2018), the pre-trained feature extractor is used to perturb the source image along the salient features such that their internal representation becomes close. However, these attacks do not work when no instances of the target class is available.
|
| 47 |
+
|
| 48 |
+
In this paper, we propose a target-agnostic attack on transfer learning. We assume that only the pretrained model (e.g., VGG face or ResNet18) is available to the attacker. We assume the re-training data and the re-trained model is unknown and not even a single target class sample is available. Our attack model is more general than the previous studies, and thus renders previous attacks on transfer learning infeasible. Note that black-box attacks Sharif et al. (2016); Papernot et al. (2017), where an attacker only have access to the model output, can theoretically be applied in our transfer learning settings. However, a successful black-box attack often needs hundreds to millions of queries to the target model whereas the high effectiveness of our attack means it only needs a few query to the target model to generate adversarial input.
|
| 49 |
+
|
| 50 |
+

|
| 51 |
+
Figure 2: Transfer learning on VGG Face
|
| 52 |
+
|
| 53 |
+
# 3 SYSTEM MODEL
|
| 54 |
+
|
| 55 |
+
In this paper, we assume that the transferred model trained on a source task is publicly available. This is a reasonable assumption, which in fact is widely used in practice. For instance, Liu et al. (2017) used the VGG face model Parkhi et al. (2015) trained to recognize 2622 identities to recognize 5 new faces. The model is shown in Fig. 2. While our attack targets any transfer-learning-based deep models, we use face recognition based on VGG face as an example for explanation. Fig. 2 shows the typical transfer learning approach for face recognition Parkhi et al. (2015).
|
| 56 |
+
|
| 57 |
+
In transfer learning, the layers whose weights are transferred to the new model are called feature extractor that outputs semantic (internal) representation of an input. The last few layers that are re-trained on the new task are called classifier. In typical transfer learning attack scenarios, the transferred model is publicly available, but the re-trained model is not known to an attacker. In other words, the attacker only knows the feature extractor but not the classifier. The previous work on transfer learning Wang et al. (2018); Ji et al. (2018) assumes that at least one sample image from each target class is available because they aim to generate images that produce similar activation vector as the target samples produce. These approaches do not work without samples from the target class.
|
| 58 |
+
|
| 59 |
+
In this paper, we assume that the attacker does not have access to any samples of the new target classes. Our motivation of the attack is to craft images for models used in systems, such as authentication/verification system, for which there is no target sample available, otherwise the attacker could have just used those samples. In such cases, attackers do not have access to samples of the target classes and, consequently, the previous attacks do not work.
|
| 60 |
+
|
| 61 |
+
# 4 ATTACK DESIGN
|
| 62 |
+
|
| 63 |
+
Design Principle. To launch an attack with these restrictive assumptions, we need to approach the problem differently. Our attack exploits the key vulnerabilities of the Softmax layer which assigns high confidence labels to vast area of input space that are not necessarily close to the training manifold Gunther et al. (2017). Softmax layer basically performs Softmax operation on the linear combination of activation vector. The activation vector of a real image often shows certain pattern with several triggered neurons, as in Figure 1 (on the left). However, the linear combination of the Softmax layer can also be triggered if only a single neuron in the activation vector has a large value. In other words, each neuron of the activation vector has a direct and linear relation with one or few target classes with different weights. Hence, the attacker can trigger these neurons one by one to see which one is highly associated with each target class.
|
| 64 |
+
|
| 65 |
+
The main attack idea is to activate the $i ^ { t h }$ neuron at the output of the feature extractor $( n - 1 ^ { t h }$ layer), denoted by $x _ { i } ^ { n - 1 }$ , with a high value and keep the other neurons at the same layer zero, similar to the Figure 1 (on the right). After the feature extractor, the model has only a FC layer and a Softmax that outputs the probability of each class. Because of the linear combination used before Softmax operation, if there exists a neuron at layer $n ^ { t h }$ that associated a large weight to $x _ { i } ^ { n - 1 }$ , it will become large. Hence, the softmax will assign a high confidence to that class. In order to find an adversary image, we can iteratively try to trigger each neuron at the $( n - 1 ) ^ { t h }$ layer to find an adversary image.
|
| 66 |
+
|
| 67 |
+
Next, we further explain the attack intuition in more detail using a simple example. Let’s assume that the output of feature extractor is layer $( n - 1 ) ^ { t h }$ and we only have two target classes. Let’s keep all neurons at layer $( n - 1 ) ^ { t h }$ zero except the $i ^ { t h }$ neuron, denoted by $x _ { i } ^ { n - 1 }$ . Then, for the last layer, $n ^ { t h }$ , we have $x _ { 1 } ^ { n } = W _ { 1 , i } ^ { n } x _ { i } ^ { n - 1 }$ and $x _ { 2 } ^ { n } = W _ { 2 , i } ^ { n } x _ { i } ^ { n - 1 }$ , and other terms are zero. We omit $b$ for simplicity. Now, if $W _ { 1 , i } ^ { n } > W _ { 2 , i } ^ { n }$ , increasing $x _ { i } ^ { n - 1 }$ increases the difference between $x _ { 1 } ^ { n }$ and $x _ { 2 } ^ { n }$ . Although the difference increases linearly with $x _ { i } ^ { n - 1 }$ , the Softmax operation makes the difference exponential. In other words, by increasing $x _ { i } ^ { n - 1 }$ , one can arbitrarily increase the confidence of the target class whose ${ { W } _ { i } ^ { n } }$ is higher, i.e., class 1 in this example. That is the motivation of the proposed brute force attack.
|
| 68 |
+
|
| 69 |
+
Algorithm 1 The target-agnostic brute force attack
|
| 70 |
+
|
| 71 |
+
<table><tr><td></td><td>Input: M (number of neurons at the output of feature extractor),Iimg (initial input), K (number of</td></tr><tr><td>procedure ATTACK(Iimg,F,T)</td><td>iteration), F (known feature extractor),α (step constant),T (the target model on attack):</td></tr><tr><td>1: 2:</td><td>fori from 1 to M do</td></tr><tr><td></td><td>Y=0m</td></tr><tr><td>3: 4:</td><td></td></tr><tr><td>5:</td><td>Y[𝑖] = 1000; >Any sufficiently large number</td></tr><tr><td>6:</td><td>X=Iimg for j from 1 to K do</td></tr><tr><td>7:</td><td>L = γ(F(X)[i])-Y[i])²+ β(∑t≠i relu(F(X)[l]-Y[[])²)</td></tr><tr><td>8:</td><td>8=</td></tr><tr><td>9:</td><td>X=X-αδ</td></tr><tr><td>10:</td><td>if T(X) bypasses the authentication then return X</td></tr><tr><td>return </td><td></td></tr></table>
|
| 72 |
+
|
| 73 |
+
Algorithm Design. The brute force algorithm is shown in Algorithm 1. We first iterate through all neurons at the output of the feature extractor and set the target, $Y$ , such that at each iteration only one neuron is triggered. We set all elements of $Y$ to zero except for the $i ^ { t h }$ one which can be set to any sufficiently large number, e.g., 1000, in Algorithm 1. Note that $Y$ is a target of the feature extractor, not that of the entire re-trained model. In the case of the VGG face, there are 4096 neurons at this layer. So, we only try 4096 times at maximum. In fact, we will show in the next section that we only need to try a few times to trigger any class and we need way fewer than 4096 attempts to trigger all target classes at least once.
|
| 74 |
+
|
| 75 |
+
Inside the second loop, we use the derivative of the loss with respect to an input and change the input gradually to decrease the loss. Note that in the loop we only use the pre-trained model and the re-trained target model is not needed. We find that typical MSE loss between Y and feature extractor is very inefficient. For the target activation vector where $i ^ { t h }$ neuron is large and all other neurons are close to zero, the modified loss is defined as follows:
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
L = \gamma ( F ( x ) [ i ] ) - Y [ i ] ) ^ { 2 } + \beta ( \sum _ { l \neq i } r e l u ( F ( x ) [ l ] - Y [ l ] ) ^ { 2 } ) ,
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
where $F ( X )$ is the output of feature extractor (i.e. activation vector) and $Y$ is the target activation vector. It is similar to the regular MSE loss with two minor changes: I) Because the importance of $i ^ { t h }$ neuron is greater than all other 4095 neurons to our attack, we use $\gamma$ and $\beta$ to control the influence of each part on the loss function. II) Because of the existence of relu function after each fully connected layer to provide non-linearity, any value on the $( - \infty , 0 ]$ range becomes 0. Hence, instead of crafting an image that has large value in $i ^ { t h }$ neuron and zero value in all other neurons, we aim to craft an image that has large value in $i ^ { t h }$ neuron and any non-positive value in all other neurons. Not only the original MSE might not converge to an adversary example, our revised loss function defined in (1) is much more efficient since the loss function only focuses on neurons that have positive value at each step and ignores the ones that are already negative. This goal is acheived by adding the relu function in the loss function.
|
| 82 |
+
|
| 83 |
+
Implication. We call this type of attack target-agnostic because it does not exploit any information from target’s classes, model, or samples. In fact, if the same pre-trained model is used to re-train two different target tasks (models), $A$ and $B$ , the proposed target-agnostic attack crafts similar adversarial inputs for both $A$ and $B$ since it only uses the pre-trained model to craft inputs. The implication is that the attacker can craft a set of adversarial inputs with the source model using the proposed attack and use it effectively to attack all re-trained models that use the same pre-trained model. This means that the attack crafting time is not important and one can create a database of likely-to-trigger inputs for each popular pre-trained model, such as the VGG face or ResNet18. Given the simplicity, remarkable effectiveness, and target-agnostic feature of the proposed algorithm, it poses a huge security threat to transfer learning.
|
| 84 |
+
|
| 85 |
+
# 5 EVALUATION
|
| 86 |
+
|
| 87 |
+
In this section, we evaluate the effectiveness of our approach using two test cases: Face recognition and speech recognition (Appendix A.2). We use Keras with Tensorflow backend and a server with Intel Xeon W-2155 and Nvidia Titan Xp GPU using Ubuntu $1 6 . 0 4 ^ { 1 }$ . We use two metrics to evaluate the proposed attack model: 1) Number of attempts to break all classes (NABAC): Assuming that the number of target classes are known, this metric shows how many adversarial input instances are queried, on average, to trigger all target classes at least once with above $9 9 \%$ confidence. 2) Effectiveness $( X \% )$ : This metric shows the ratio of crafted inputs that trigger any target classes with $X \%$ confidence over the total number of crafted inputs. We use $9 5 \%$ and $9 9 \%$ confidence for effectiveness in this paper.
|
| 88 |
+
|
| 89 |
+
# 5.1 CASE STUDY: FACE RECOGNITION
|
| 90 |
+
|
| 91 |
+
In this case study, we use the VGG face model Parkhi et al. (2015) as a pre-trained model. We remove the last FC layer and the softmax (SM) layer to make a feature extractor. Then, we pair it with a new FC and SM layer, and re-train the model (while fixing feature extractor) with labeled faces of vision lab at UMass LWF (2016). During re-training, we train the model with Adam optimizer and cross entropy loss function. We set $K = 5 0 0 0 0$ , $\alpha = 0 . 1$ , $\beta = 0 . 0 1$ , and $\gamma = 1$ . In some experiments, we add more FC layers before the SM layer, as explained later.
|
| 92 |
+
|
| 93 |
+
Number of Target Classes. Table 1 shows the impact of number of target classes on the attack performance. We use 20 classes with the highest number of samples from UMass dataset LWF (2016). The largest class is George W Bush with 530 samples and the smallest one is Alejandro Toledo with 39 samples. A blank image is used as an intial image. For 5, 10, and 15 classes, we randomly choose a set from 20 classes and re-train and attack the model 50 times and average the results. For 20 classes, we only re-train and attack once. That is the reason we do not show the standard deviation in the table. Table 2 shows the result when we use five images from each class for test set and all other images for training set. Hence, the re-training dataset is imbalanced. To balance the dataset, we undersample all classes to have an equal training size, shown in Table 1.
|
| 94 |
+
|
| 95 |
+
As it is shown, the effectiveness of the attack on an imbalanced model is higher. However, the NABAC is slightly worse. We find out that on average the weights of SM layer for the class with larger training samples are slightly higher than the other classes. Hence, it is easier to trigger that class with the proposed method which increases the effectiveness. However, it is much harder to trigger the smallest class which makes the NABAC larger. The impact of imbalance re-training dataset is studied in more detail in Appendix A.1, where we show that the probability of triggering a target class directly associated with the number of training samples of that class during re-training. Moreover, the effectiveness and the NABAC improves when the number of target classes decreases, as expected. Note that in all scenarios, the effectiveness is greater than $7 5 \%$ . It means that the first crafted image has more than $7 5 \%$ chance of bypassing the authentication system (or any other application). It basically means that the traditional approach of limiting the number of queries to prevent brute-force-based attack does not work here.
|
| 96 |
+
|
| 97 |
+
Number of Layers to Re-train. In previous experiments, we assume that the weights of the feature extractor transferred from the pre-trained model are fixed during re-training and only the last FC layer is changed. One can tune more layers during re-training. Fig. 3(a) shows the impact of tuning more layers on the effectiveness and accuracy. Note that we assume that attacker does not know anything about the target model. Hence, in this experiment, the attacker still uses the pre-trained feature extractor up until the last FC layer. That means the pre-trained feature extractor that the attacker uses is slightly different from the re-trained model. In Fig. 3(a), X axis represents the layer from which we start tuning up to the last FC layer. Due to the small re-training dataset, as the number of tuning layers increases the accuracy drops. However, by tuning more layers, the pre-trained model that the attacker has access to becomes more different from the re-trained model. That is why the effectiveness of the attack decreases. Similarly, NABAC increases, as shown in Fig. 3(b). Despite the difference between the re-trained model and the model the attacker has access to, the attack is still effective, which means that the pre-trained model cannot be changed dramatically during re-training process and re-training more layers is not an effective defense strategy.
|
| 98 |
+
|
| 99 |
+
Table 1: Attack performance on balanced re-training dataset. Acc, NABAC, and $E f f$ stands for accuracy, number of attempts to break all classes, and effectiveness, respectively.
|
| 100 |
+
|
| 101 |
+
<table><tr><td rowspan="2">Target classes</td><td colspan="4">Balanced dataset</td></tr><tr><td>Acc</td><td>NABAC</td><td>Eff(95%)</td><td>Eff(99%)</td></tr><tr><td>5</td><td>99.12% ± .27</td><td>48.25 ± 42.5</td><td>91.68% ± 5.69</td><td>87.82% ± 6.98</td></tr><tr><td>10</td><td>98.43% ± .23</td><td>149.97± 132.15</td><td>88.87% ± 2.46</td><td>83.07% ± 3.31</td></tr><tr><td>15</td><td>97.16% ± 1.64</td><td>323.36± 253.56</td><td>87.79% ± 2.42</td><td>82.05% ± 2.74</td></tr><tr><td>20</td><td>96.87%</td><td>413</td><td>87.17%</td><td>79.16%</td></tr></table>
|
| 102 |
+
|
| 103 |
+
Table 2: Attack performance on imbalanced re-training dataset. Acc, NABAC, and $E f f$ stands for accuracy, number of attempts to break all classes, and effectiveness, respectively.
|
| 104 |
+
|
| 105 |
+
<table><tr><td rowspan="2">Target classes</td><td colspan="4">Imbalanced dataset</td></tr><tr><td>Acc</td><td>NABAC</td><td>Eff(95%)</td><td>Eff(99%)</td></tr><tr><td>5</td><td>99.21% ± .29</td><td>63.29 ± 80.30</td><td>93.52% ± 5.07</td><td>90.23% ± 5.71</td></tr><tr><td>10</td><td>98.47% ± .81</td><td>264.80 士 111.09</td><td>91.14% ± 3.65</td><td>86.28%± 5.40</td></tr><tr><td>15</td><td>98.01% ± 1.39</td><td>451.45 ± 244.31</td><td>90.41% ± 1.89</td><td>85.31% ± 2.48</td></tr><tr><td>20</td><td>97.07%</td><td>2836</td><td>88.72%</td><td>82.93%</td></tr></table>
|
| 106 |
+
|
| 107 |
+
Number of New Layers in the Re-trained Model. Next, we measure how adding and training more layers (pair of $\mathrm { F C } + \mathrm { R e l u } )$ ) after feature extractor can affect the proposed attack effectiveness. In this experiment, we use 5 balanced target classes. As shown in Table 3, adding more layers decreases the accuracy of the re-trained model because the re-training dataset is small and not enough to train more layers from scratch. The effectiveness of the attack decreases sightly as more new layers are tuned. When adding more new layers, not all target classes are affected equally and some classes may become harder to trigger. That is why NABAC increases. The goal of our attack is to have an activation vector with only one large value. However, each extra layer, added after feature extractor, smooths out the single large value and distributes it to more neurons in activation vector. That is the reason the attack becomes less effective when more new layers are added.
|
| 108 |
+
|
| 109 |
+

|
| 110 |
+
Figure 3: Effect of number of re-training layers
|
| 111 |
+
|
| 112 |
+
Table 3: Effect of number of new layers in the re-trained model
|
| 113 |
+
|
| 114 |
+
<table><tr><td># of new layers</td><td>Accuracy</td><td>NABAC</td><td>Effectiveness(95%)</td><td>Effectiveness(99%)</td></tr><tr><td>1</td><td>99.12% ± .27</td><td>48.25 ± 42.5</td><td>91.68% ± 5.69</td><td>87.82% ± 6.98</td></tr><tr><td>2</td><td>98.24% ± 2.10</td><td>51.87 ± 39.94</td><td>91.57% ± 4.87</td><td>86.45% ± 5.35</td></tr><tr><td>3</td><td>95.46% ± 4.2</td><td>257.26 ± 387.16</td><td>89.45% ± 8.20</td><td>85.67% ± 8.88</td></tr></table>
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
Figure 4: Number of reject training samples vs effectiveness/accuracy
|
| 118 |
+
|
| 119 |
+
Attack Effectiveness on A Classifier with Reject Class. It has been shown that relying on a threshold to reject or accept the classification result is not accurate because for the vast space of unknown inputs Softmax provides high confidence scores Nguyen et al. (2015). Hence, we add an extra class to the softmax layer, similar to Hosseini et al. (2017), called reject/unknown class. During re-training, we choose random sample images from entire UMass dataset, except the classes that we choose for target faces, and label them as reject class. We vary the number of training samples for reject class to see its effect on accuracy and effectiveness. Figure 4 illustrates the trade-off between the accuracy of the re-trained model and the effectiveness of our attack. The lowest effectiveness, for which the accuracy is $8 7 . 7 2 \%$ , is $4 1 . 4 0 \%$ which is still high. Hence, the classifier with a reject class option is still prone to our target-agnostic attack.
|
| 120 |
+
|
| 121 |
+
Attack Comparison with black-box attack and baseline attack. We compare our attack with a black-box attack and a baseline. For the baseline attack, we choose random face images from UMass dataset that have not been used for training. Interestingly, for the threshold-based model, there is a $1 2 . 6 0 \%$ chance that a random face image triggers an output class with high probability, as shown in Table 4. A model with a reject class can effectively prevent baseline attack since none of the random images fool the model. Moreover, we use Zoo black-box attack Chen et al. (2017a) as comparison. The default configuration of untargeted Zoo attack yields a very low effectiveness of $1 8 . 2 0 \%$ . After hyper-parameter tuning and setting the confidence of the crafted images in the algorithm to $0 . 9 9 \%$ , Zoo achieves its highest effectiveness of $7 6 . 1 2 \%$ . The effectiveness of all attacks are higher against the threshold-based model than the model with a reject class. Our attack needs only one query to the re-trained (student) model because it crafts the images using the publicly available pre-trained (teacher) model. Any black-box attack, such as Zoo, that depends only on the student models needs a significant number of queries which is easy to defend by limiting the number of queries.
|
| 122 |
+
|
| 123 |
+
# 6 DISCUSSION
|
| 124 |
+
|
| 125 |
+
In this paper, we show that the public information from transfer learning settings can be exploited to fool Softmax-based classifier. The main vulnerabilities of the Softmax layer comes from the fact that it assigns a high confidence output to inputs that are far away from the training input distribution. This drawback has been shown in studies that investigate open-set problem Bendale & Boult (2016); Gunther et al. (2017). In other words, Softmax-based models are vulnerable to inputs with different distribution than their training set. To mitigate the problem and defeat our attack, we use a recent novel classifier for the open-set problem, called extreme value machine (EVM) Rudd et al. (2017), that aims to fit a distribution to the activation vector (Figure 1) rather than a linear combination based on Softmax operation. We follow the experimental setting similar to Gunther et al. (2017). The accuracy of the EVM-based model is $9 5 . 6 0 \%$ , which is lower than the softmax-based model in our experiments, and the model successfully defeat all our crafted images. The main reason that EVM can be used as a defense mechanism is that the activation vector of our crafted images are far from the activation vector of any image in the training set. However, EVM has its own vulnerability: we find out that by feeding images of random faces (UMass dataset in our study), there is a $7 . 3 8 \%$ chance that the EVM-base model classifies the input as one of the target classes. Hence, more robust model is needed to defend our attack and also work well in open-set scenarios.
|
| 126 |
+
|
| 127 |
+
Table 4: Attack Comparison. NQT, NQS, and $E f$ stands for number of query to the teacher model, number of query to the student model, and effectiveness, respectively.
|
| 128 |
+
|
| 129 |
+
<table><tr><td rowspan="2">Attack type</td><td colspan="3">Threshold-based model</td><td colspan="2">With reject class</td></tr><tr><td>NQT</td><td>NQS</td><td>Ef(99%)</td><td>NQT NQS</td><td>Ef</td></tr><tr><td>Our attack</td><td>50,000</td><td>1</td><td>87.82%</td><td>50,000 1</td><td>78.24%</td></tr><tr><td>Zoo (black-box)</td><td>-</td><td>1,036,800</td><td>76.12%</td><td>二 816,800</td><td>81.01%</td></tr><tr><td>Baseline (random)</td><td>=</td><td>1</td><td>12.60%</td><td>- 1</td><td>00.00%</td></tr></table>
|
| 130 |
+
|
| 131 |
+
Another approach to defend the vulnerability of the Softmax layer is to check all elements of activation vector and avoid classification of suspicious inputs. In other words, if an activation element is significantly larger than what it should normally be, we can label the input image as malicious. In our experiment, we find that the average value of the largest neurons in activation vector is around 23.86 for normal face images and the largest value we observed is 47.22. So, if we define a threshold for the maximum value in activation vector to be around 50, it is possible to detect crafted images with our attack. In our attack scenario, we craft inputs with the maximum value in activation vector of 1000, which is easily detectable, if checked. We perform an experiment to see if our attack work when this value is much smaller and in a normal range. By crafting images with max value in activation vector of 50, instead of 1000, the effectiveness of our attack is dramatically reduced $( 0 . 0 0 0 7 \% )$ . However, this threshold may lead to a large false positive in inference time. With the max value of 100 and 200, the effectiveness is $0 . 0 5 8 \%$ and $0 . 2 \hat { 7 } \%$ , respectively. Hence, if the threshold value for anomaly detection is chosen meticulously, it can serve as a defense mechanism for our attack with the cost of increasing false positive (labeling some natural face images as malicious).
|
| 132 |
+
|
| 133 |
+
# 7 CONCLUSION
|
| 134 |
+
|
| 135 |
+
In this paper, we develop an efficient brute force attack on transfer learning for deep neural networks - the attack exploits a fundamental vulnerability of the Softmax layer that can be easily exploited when transfer learning is used. We assume that the attacker only knows the transferred model and its weights, and does not have access to the re-trained model, the re-trained dataset, and the re-trained model’s output. Our evaluations based on face recognition and speech recognition show that with a handful of attempts, the attacker can craft adversarial samples that can trigger all classes despite the fact that the attacker does not know the re-trained model and model’s target classes. The targetagnostic feature of the attack allows the attacker to use the same set of crafted images for different re-trained models and achieve high effectiveness when the models use the same pre-trained model. The proposed target-agnostic attack reveals a fundamental challenge of Softmax layer in transfer learning settings: because the Softmax layer assign high confidence output to vast space of unseen inputs, a simple brute-force attack can operate surprisingly effective. To defeat the target-agnostic attack, the model should consider the distribution of the activation vector, like EVM method, not the linear combination alone, like Softmax layer. Nevertheless, there is a fundamental trade-off between accuracy and robustness and it should be tuned based on the sensitivity of the application.
|
| 136 |
+
|
| 137 |
+
# ACKNOWLEDGMENTS
|
| 138 |
+
|
| 139 |
+
This work was supported by the National Science Foundation (NSF) under Grant CNS-1547461, Grant CNS-1718901, and Grant IIS-1838207.
|
| 140 |
+
|
| 141 |
+
# REFERENCES
|
| 142 |
+
|
| 143 |
+
Labeled faces in the wild, 2016. URL http://vis-www.cs.umass.edu/lfw/. [Online; accessed 24-Mar-2019].
|
| 144 |
+
|
| 145 |
+
Speech commands, 2017. URL https://www.tensorflow.org/tutorials/ sequences/audio_recognition. [Online; accessed 24-Mar-2019].
|
| 146 |
+
|
| 147 |
+
Pannous speech recognition, 2017. URL https://github.com/pannous/ tensorflow-speech-recognition. [Online; accessed 24-Mar-2019].
|
| 148 |
+
|
| 149 |
+
Michele Alberti, Vinaychandran Pondenkandath, Marcel Wursch, Manuel Bouillon, Mathias Seuret, Rolf Ingold, and Marcus Liwicki. Are you tampering with my data? In Proceedings of the European Conference on Computer Vision (ECCV), pp. 0–0, 2018.
|
| 150 |
+
|
| 151 |
+
Abhijit Bendale and Terrance E Boult. Towards open set deep networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1563–1572, 2016.
|
| 152 |
+
|
| 153 |
+
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.
|
| 154 |
+
|
| 155 |
+
Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In 2017 IEEE Symposium on Security and Privacy (SP), pp. 39–57. IEEE, 2017b.
|
| 156 |
+
|
| 157 |
+
Liang-Chieh Chen, Yi Yang, Jiang Wang, Wei Xu, and Alan L Yuille. Attention to scale: Scaleaware semantic image segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3640–3649, 2016.
|
| 158 |
+
|
| 159 |
+
Pin-Yu Chen, Huan Zhang, Yash Sharma, Jinfeng Yi, and Cho-Jui Hsieh. Zoo: Zeroth order optimization based black-box attacks to deep neural networks without training substitute models. In Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security, pp. 15–26. ACM, 2017a.
|
| 160 |
+
|
| 161 |
+
Xinyun Chen, Chang Liu, Bo Li, Kimberly Lu, and Dawn Song. Targeted backdoor attacks on deep learning systems using data poisoning. arXiv preprint arXiv:1712.05526, 2017b.
|
| 162 |
+
|
| 163 |
+
Gamaleldin F Elsayed, Shreya Shankar, Brian Cheung, Nicolas Papernot, Alex Kurakin, Ian Goodfellow, and Jascha Sohl-Dickstein. Adversarial examples that fool both human and computer vision. arXiv preprint arXiv:1802.08195, 2018.
|
| 164 |
+
|
| 165 |
+
Andre Esteva, Brett Kuprel, Roberto A Novoa, Justin Ko, Susan M Swetter, Helen M Blau, and Sebastian Thrun. Dermatologist-level classification of skin cancer with deep neural networks. Nature, 542(7639):115, 2017.
|
| 166 |
+
|
| 167 |
+
Manuel Gunther, Steve Cruz, Ethan M Rudd, and Terrance E Boult. Toward open-set face recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pp. 71–80, 2017.
|
| 168 |
+
|
| 169 |
+
Hossein Hosseini, Yize Chen, Sreeram Kannan, Baosen Zhang, and Radha Poovendran. Blocking transferability of adversarial examples in black-box learning systems. arXiv preprint arXiv:1703.04318, 2017.
|
| 170 |
+
|
| 171 |
+
Yujie Ji, Xinyang Zhang, Shouling Ji, Xiapu Luo, and Ting Wang. Model-reuse attacks on deep learning systems. In Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security, pp. 349–363. ACM, 2018.
|
| 172 |
+
|
| 173 |
+
Ye Jia, Yu Zhang, Ron Weiss, Quan Wang, Jonathan Shen, Fei Ren, Patrick Nguyen, Ruoming Pang, Ignacio Lopez Moreno, Yonghui Wu, et al. Transfer learning from speaker verification to multispeaker text-to-speech synthesis. In Advances in Neural Information Processing Systems, pp. 4485–4495, 2018.
|
| 174 |
+
|
| 175 |
+
Cong Liao, Haoti Zhong, Anna Squicciarini, Sencun Zhu, and David Miller. Backdoor embedding in convolutional neural network models via invisible perturbation. arXiv preprint arXiv:1808.10307, 2018.
|
| 176 |
+
|
| 177 |
+
Yingqi Liu, Shiqing Ma, Yousra Aafer, Wen-Chuan Lee, Juan Zhai, Weihang Wang, and Xiangyu Zhang. Trojaning attack on neural networks. Proc. NDSS, 2017.
|
| 178 |
+
|
| 179 |
+
Luis Munoz-Gonz ˜ alez, Battista Biggio, Ambra Demontis, Andrea Paudice, Vasin Wongrassamee, ´ Emil C Lupu, and Fabio Roli. Towards poisoning of deep learning algorithms with back-gradient optimization. In Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security, pp. 27–38. ACM, 2017.
|
| 180 |
+
|
| 181 |
+
Anh Nguyen, Jason Yosinski, and Jeff Clune. Deep neural networks are easily fooled: High confidence predictions for unrecognizable images. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 427–436, 2015.
|
| 182 |
+
|
| 183 |
+
Nicolas Papernot, Patrick McDaniel, Ian Goodfellow, Somesh Jha, Z Berkay Celik, and Ananthram Swami. Practical black-box attacks against machine learning. In Proceedings of the 2017 ACM on Asia conference on computer and communications security, pp. 506–519. ACM, 2017.
|
| 184 |
+
|
| 185 |
+
Omkar M Parkhi, Andrea Vedaldi, Andrew Zisserman, et al. Deep face recognition. In BMVC, volume 1, pp. 6, 2015.
|
| 186 |
+
|
| 187 |
+
Shahbaz Rezaei and Xin Liu. How to achieve high classification accuracy with just a few labels: A semi-supervised approach using sampled packets. In Advances in Data Mining - Applications and Theoretical Aspects, 19th Industrial Conference, {ICDM} 2019, New York, USA, July 17 - July 21, pp. 28–42, 2019a.
|
| 188 |
+
|
| 189 |
+
Shahbaz Rezaei and Xin Liu. Deep learning for encrypted traffic classification: An overview. IEEE communications magazine, 57(5):76–81, 2019b.
|
| 190 |
+
|
| 191 |
+
Shahbaz Rezaei and Xin Liu. Security of deep learning methodologies: Challenges and opportunities. arXiv preprint arXiv:1912.03735, 2019c.
|
| 192 |
+
|
| 193 |
+
Ethan M Rudd, Lalit P Jain, Walter J Scheirer, and Terrance E Boult. The extreme value machine. IEEE transactions on pattern analysis and machine intelligence, 40(3):762–768, 2017.
|
| 194 |
+
|
| 195 |
+
Ali Shafahi, W Ronny Huang, Mahyar Najibi, Octavian Suciu, Christoph Studer, Tudor Dumitras, and Tom Goldstein. Poison frogs! targeted clean-label poisoning attacks on neural networks. arXiv preprint arXiv:1804.00792, 2018.
|
| 196 |
+
|
| 197 |
+
Mahmood Sharif, Sruti Bhagavatula, Lujo Bauer, and Michael K Reiter. Accessorize to a crime: Real and stealthy attacks on state-of-the-art face recognition. In Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, pp. 1528–1540. ACM, 2016.
|
| 198 |
+
|
| 199 |
+
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.
|
| 200 |
+
|
| 201 |
+
Bolun Wang, Yuanshun Yao, Bimal Viswanath, Haitao Zheng, and Ben Y Zhao. With great training comes great vulnerability: practical attacks against transfer learning. In 27th {USENIX} Security Symposium ({USENIX} Security 18), pp. 1281–1297, 2018.
|
| 202 |
+
|
| 203 |
+
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.
|
| 204 |
+
|
| 205 |
+
# A APPENDIX
|
| 206 |
+
|
| 207 |
+
# A.1 CASE STUDY: FACE RECOGNITION
|
| 208 |
+
|
| 209 |
+
Choice of Initial Image. To generate adversarial images using Algorithm 1, we need to start with an initial image. To find out whether the initial image we start with has any impact on the brute force attack, we conduct 3 different experiments. We use random input, blank image (with all pixel set to one), and random images of celebrities. The results are shown in Fig. 5. First column shows crafted images starting from the random input. Second column illustrates crafted images from blank image.
|
| 210 |
+
|
| 211 |
+

|
| 212 |
+
Figure 5: First column shows crafted images starting from the random input. Second column illustrates crafted images from blank image. Third and fourth columns show the initial images and the crafted images from the initial image, respectively. The fifth column illustrates a sample image from each class that is used for re-training.
|
| 213 |
+
|
| 214 |
+

|
| 215 |
+
Figure 6: Target class distribution
|
| 216 |
+
|
| 217 |
+
Third and fourth columns show the initial images and the crafted images from the initial image, respectively. The fifth column illustrates a sample image from each class that is used for re-training. In our experiment, the choice of initial image has negligible impact on effectiveness of our attack.
|
| 218 |
+
|
| 219 |
+
Table 5 shows the result of using different initial images on the attack performance. We only re-train a model once with 5 randomly chosen faces and we achieve $9 9 . 3 8 \%$ accuracy. Then, we launch the attack on the same model 3 times, each with a different initial image. Although using a face image marginally improves the attack performance, the impact is negligible and the other initial input cases are still considerably effective.
|
| 220 |
+
|
| 221 |
+
Table 5: Impact of initial input on the attack
|
| 222 |
+
|
| 223 |
+
<table><tr><td>Initial input</td><td>NABAC</td><td>Effectiveness(95%)</td><td>Effectiveness(99%)</td></tr><tr><td>Blank</td><td>18</td><td>98.37%</td><td>98.37%</td></tr><tr><td>Random</td><td>19</td><td>98.37%</td><td>97.22%</td></tr><tr><td>A face image</td><td>18</td><td>99.83%</td><td>99.19%</td></tr></table>
|
| 224 |
+
|
| 225 |
+
Distribution of Target Classes. Fig. 6(a) illustrates a typical distribution of target classes triggered by crafted images of the proposed method. It is clear that the distribution is far from Uniform. It basically means that more neurons in layer $n - 1$ are associated with class 1 and, hence, during brute force attack, more crafted images will trigger that class.
|
| 226 |
+
|
| 227 |
+
To measure the impact of re-training set on the distribution of target classes, we use Jensen-Shannon distance (JSD). Jensen-Shannon divergence measures the similarity between two distributions as follows:
|
| 228 |
+
|
| 229 |
+
$$
|
| 230 |
+
J S D ( P | | Q ) = \frac { 1 } { 2 } D ( P | | M ) + \frac { 1 } { 2 } D ( Q | | M )
|
| 231 |
+
$$
|
| 232 |
+
|
| 233 |
+
where D(.) is Kullback-Leibler divergence and $M = { \textstyle \frac { 1 } { 2 } } ( P + Q )$ . Square root of JSD is a metric that we use to compare the similarity between the distribution of data samples in re-training dataset versus the distribution of triggered classes with adversarial inputs of our method.
|
| 234 |
+
|
| 235 |
+
We find that distribution of training samples during re-training can affect the target class distribution. Fig. 6(b) shows the JS distance of training set distribution and Uniform distribution versus JS distance of target class distribution and Uniform distribution. For each data point, we pick 5 random persons from UMass dataset and then re-train the VGG face model with. The line in Fig. 6(b) represents the linear regression of all data point. The figure shows that when the training set of re-training phase becomes more non-Uniform, the target class distribution becomes even more non-Uniform.
|
| 236 |
+
|
| 237 |
+
# A.2 CASE STUDY: SPEECH RECOGNITION
|
| 238 |
+
|
| 239 |
+
In Ji et al. (2018), a speech recognition model for digits were re-trained to detect speech commands. Following the same experiment, a model first pre-trained on the Pannous Speech dataset dig (2017) containing utterance of ten digits. Then, we randomly pick 5 classes from speech command dataset com (2017) to re-train the model. $8 0 \%$ of the dataset is used for fine-tuning and $2 0 \%$ for inference. Due to the lack of space and similarity of the results with previous case study, we omit most experiments with similar results. We use a 2D CNN model with 3 building block, each of which contains convolutional layers, Relu activation, and pooling layer, followed by $2 \mathrm { F C }$ layers and softmax layer at the end. The input is the Mel-Frequency Cepstral Coefficients (MFCC) of the wave files. Similar to the previous case study, we replace the SM layer and re-train the model by only tuning the last FC and SM layer.
|
| 240 |
+
|
| 241 |
+
Table 6: Effect of number of target classes on the proposed attack
|
| 242 |
+
|
| 243 |
+
<table><tr><td>#of target classes</td><td>Accuracy</td><td>NABAC</td><td>Effectiveness(95%)</td><td>Effectiveness(99%)</td></tr><tr><td>5</td><td>97.38%</td><td>37</td><td>100.00%</td><td>98.21%</td></tr><tr><td>10</td><td>93.30%</td><td>114</td><td>95.80%</td><td>93.75%</td></tr><tr><td>15</td><td>85.72%</td><td>812</td><td>92.22%</td><td>84.17%</td></tr></table>
|
| 244 |
+
|
| 245 |
+
Table 7: Effect of re-training set size
|
| 246 |
+
|
| 247 |
+
<table><tr><td>#of samples per class</td><td>Accuracy</td><td>NABAC</td><td>Effectiveness(95%)</td><td>Effectiveness(99%)</td></tr><tr><td>50</td><td>77.56%</td><td>13</td><td>97.48%</td><td>95.00%</td></tr><tr><td>100</td><td>82.46%</td><td>17</td><td>97.21%</td><td>95.23%</td></tr><tr><td>200</td><td>85.51%</td><td>21</td><td>98.25%</td><td>96.82%</td></tr><tr><td>1000</td><td>89.89%</td><td>17</td><td>98.60%</td><td>97.64%</td></tr><tr><td>2000</td><td>92.04%</td><td>17</td><td>98.60%</td><td>97.81%</td></tr></table>
|
| 248 |
+
|
| 249 |
+
Number of Target Classes. Table 6 shows the impact of number of target classes on the accuracy of the model and attack performance. Similar to the face recognition experiment, we start with a blank input (a 2D MFCC with 0 for all elements) and we use 70 and 0.1 for $k$ and $\alpha$ , respectively. As expected, the accuracy drops when the number of target classes increases. Since ten classes representing digits exist in both the pre-training dataset (Pannous dig (2017)) and the re-training dataset (speech command com (2017)), these classes are much easier for the target model to re-train with high accuracy in comparison with other classes, such as stop or left command. Hence, the re-trained model has more neuron connections to help classify digit classes which makes it harder for both the model to classify the other classes and the proposed attack to craft adversarial input for the non-digit classes. That is why we observe more dramatic decrease in accuracy and attack performance when the number of target classes increases.
|
| 250 |
+
|
| 251 |
+
Re-training Sample Size. Unlike face recognition case study in which most re-training classes have fewer than 100 samples, speech command dataset com (2017) contains more than 2000 samples for each class. Hence, we conduct an experiment to study the effect of re-training sample size on model and attack performance. We choose six classes (commands) that the pre-trained model did not trained on, i.e., left, right, down, up, go, and stop speech commands. Table 7 shows the impact of re-training set size on the model and attack performance. As expected, increasing the re-training set size improves the accuracy of the model. However, the accuracy of the re-trained model and the re-training set size have a negligible effect on the performance of proposed attack. By comparing Table 6 and Table 7, we realize that the attack performance is directly affected by the number of target classes, but it is not significantly affected by the accuracy of the re-trained model.
|
md/train/BysZhEqee/BysZhEqee.md
ADDED
|
@@ -0,0 +1,277 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MARGINAL DEEP ARCHITECTURES: DEEP LEARNING FOR SMALL AND MIDDLE SCALE APPLICATIONS
|
| 2 |
+
|
| 3 |
+
Yuchen Zheng, Guoqiang Zhong & Junyu Dong
|
| 4 |
+
|
| 5 |
+
Department of Computer Science and Technology Ocean University of China ouczyc@outlook.com,{gqzhong, dongjunyu}@ouc.edu.cn
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
In recent years, many deep architectures have been proposed in different fields. However, to obtain good results, most of the previous deep models need a large number of training data. In this paper, for small and middle scale applications, we propose a novel deep learning framework based on stacked feature learning models. Particularly, we stack marginal Fisher analysis (MFA) layer by layer for the initialization of the deep architecture and call it “Marginal Deep Architectures” (MDA). In the implementation of MDA, the weight matrices of MFA are first learned layer by layer, and then we exploit some deep learning techniques, such as back propagation, dropout and denoising to fine tune the network. To evaluate the effectiveness of MDA, we have compared it with some feature learning methods and deep learning models on 7 small and middle scale real-world applications, including handwritten digits recognition, speech recognition, historical document understanding, image classification, action recognition and so on. Extensive experiments demonstrate that MDA performs not only better than shallow feature learning models, but also state-of-the-art deep learning models in these applications.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Deep learning methods have achieved desirable performance in many domains, such as image classification and detection, document analysis and recognition, natural language processing, video analysis (Krizhevsky et al., 2012; Chan et al., 2014; Ciresan et al., 2010; Collobert & Weston, 2008; Le et al., 2011). Deep learning methods learn the data representation by using multiple processing layers, which discover the intricate structure of high dimensional data with multiple levels of abstraction (LeCun et al., 2015). For example, for face recognition, the learned features of first layer may be the edges, directions and some local information. The second layer typically detects some object parts which are combination of edges and directions. The higher layers may further abstract the face image by combining the features of previous layers (outline of the eyes, nose, lips). This procedure is very similar with human visual and perceptual system.
|
| 14 |
+
|
| 15 |
+
In recently years, many deep learning methods have been proposed (l. Boureau & others, 2008; Lee et al., 2009b;a; Hinton & Salakhutdinov, 2006). However, most models meet some difficult problems to solve, such as some parameters need to be randomly initialized, like the weight matrix of two successive layers in deep belief networks (DBNs) and the convolution kernel in convolutional neural networks (CNNs). In addition, traditional deep learning methods need a large scale training data to train the complex networks. It causes many problems in the training process. If we don’t initialize the parameters properly, the optimization procedure might need a long training time and fall into local minima. Alternatively, many feature learning models have been proposed to learn the intrinsic structures of high-dimensional data and avoid the curse of dimensionality. In particular, most of them can be trained with small and middle scale of data and their learning algorithms are generally based on closed-form solution or convex optimization. For instance, marginal Fisher analysis (MFA) (Yan et al., 2007; Zhong et al., 2013) is one of the feature learning models that is a supervised method based on the graph embedding framework. It utilizes an intrinsic graph to characterize the intraclass compactness, and another penalty graph to characterize the interclass separability. Its optimal solution can be learned by generalized eigenvalue decomposition. However, on the one hand, shallow feature learning models cannot work well on the data with highly nonlinear structure; on the other hand, few efforts are made to combine shallow feature learning models for the design of deep architectures.
|
| 16 |
+
|
| 17 |
+
In order to simultaneously solve the existing problems in deep learning methods and combine the advantages of feature learning models, we proposed a novel deep learning method based on stacked feature learning models. Particularly, we stack marginal Fisher analysis (MFA) layer by layer for the initialization of the deep architecture and call it “Marginal Deep Architectures” (MDA). Firstly, the input data are mapped to higher dimensional space by using random weight matrix. Then we use MFA to learn the lower dimensional representation layer by layer. In the implementation of this architecture, we add some tricks in the training process, such as back propagation, dropout and denoising to fine tune the network. Finally, the softmax layer is connected to the last feature layer. We have compared our MDA with some feature learning methods and deep learning models on different domains of datasets (including handwritten digits recognition, speech recognition, historical document understanding, image classification, action recognition and so on). Extensive experiments demonstrate that MDA performs not only better than shallow feature learning models, but also state-of-the-art deep learning models in small and middle scale applications.
|
| 18 |
+
|
| 19 |
+
The contributions of this work are highlighted as follows.
|
| 20 |
+
|
| 21 |
+
1. We propose a novel structure to build a deep architecture. The first hidden layer has twice or quadruple neurons as the input layer. Then we can use some feature learning models layer by layer to learn the compact representations of data. Finally, we set the last layer as a softmax classifier.
|
| 22 |
+
|
| 23 |
+
2. Traditional deep learning models in general need a large scale training data. Compared with traditional deep learning models, MDA can work better than traditional deep learning models in small and middle scale applications because the initialization of the weight matrices using MFA is much better than that using random initialization.
|
| 24 |
+
|
| 25 |
+
3. Our MDA can work well in different domains of datasets, such as handwritten digits, spoken letters and natural images. Extensive experiments demonstrate that MDA is a general model to handel small and middle scale data. On the other hand, for large scale datasets, like CIFAR-10, MDA works comparatively with other deep learning methods.
|
| 26 |
+
|
| 27 |
+
The rest of this paper is organized as follows: In Section 2, we give a brief overview of related work. In Section 3, we present the marginal Fisher analysis (MFA) and the proposed marginal deep architectures (MDA) in detail. The experimental settings and results are reported in Section 4, while Section 5 concludes this paper with remarks and future work.
|
| 28 |
+
|
| 29 |
+
# 2 RELATED WORK
|
| 30 |
+
|
| 31 |
+
With the development of deep learning methods, many deep networks have been proposed in recent years (Donahue et al., 2013; Krizhevsky et al., 2012; Long et al., 2015; Zhou et al., 2014). These deep learning models show their powerful performance in various fields, such as image classification and analysis, document analysis and recognition, natural language processing et al. In the area of image analysis, Hinton et al. proposed a large, deep convolutional neural network (Alex net) to classify the 1.2 million high-resolution images in the ImageNet. It uses efficient GPU to speed their method. The results show that a large, deep convolutional neural network is capable of achieving recordbreaking results on a highly challenging dataset using purely supervised learning (Krizhevsky et al., 2012). In order to popularize the deep convolutional neural network, Donahue ea al. proposed DeCAF (Deep Convolutional Activation Feature) which is trained in a fully supervised fashion on a large, fixed set of object recognition tasks (Donahue et al., 2013). DeCAF provides a uniform framework for researchers who can improve and change this framework on some specific tasks. However, its performance at scene recognition has not attained the same level of success. In order to handle this problem, Zhou et al. introduce a new scene-centric database called Places with over 7 million labeled pictures of scenes. Then, they learn the deep features for scene recognition tasks by using the same architecture as ImageNet, and establish new state-of-the-art results on several scenecentric datasets (Zhou et al., 2014). However, these methods based on convolutional operation need very large scale training samples and a long training time. They can not work well on small and middle scale applications.
|
| 32 |
+
|
| 33 |
+
In other domains, deep learning methods also achieve good performance. Hinton et al. represent the shared views of four research groups that have had recent successes in using DNNs for automatic speech recognition (ASR). The DNNs that contain many layers of nonlinear hidden units and a very large output layer can outperform Gaussian mixture models (GMMs) at acoustic modeling for speech recognition on a variety of data sets (Hinton et al., 2012a). In the area of genetics, Xiong et al. use “deep learning” computer algorithms to derive a computational model that takes as input DNA sequences and applies general rules to predict splicing in human tissues (Xiong et al., 2015). It reveals the genetic origins of disease and how strongly genetic variants affect RNA splicing. In the area of natural language understanding, deep learning models have delivered strong results on topic classification, sentiment analysis et al. Sutskever et al. proposed a general approach, the Long Short-Term Memory (LSTM) architecture which can solve the general sequence to sequence problems better than before (Sutskever et al., 2014). In addition, Hinton et al. proposed autoencoder (AE) networks that is an effective way to learn the low-dimensional codes of high-dimensional data. Based on autoencoder, there are also have many excellent works to handle various tasks. Vincent et al. proposed a denoising autoencoder (DAE) which maked the learned representations robust to partial corruption of the input data (Vincent et al., 2008). The denoising autoencoder which initialize the deep architectures layer by layer is very similar with human visual system. Hinton et al. introduced random ‘dropout’ to prevent the overfitting which improve many benchmark tasks and obtain new records for speech and object recognition (Hinton et al., 2012b). Then, Vincent et al. proposed stacked denoising autoencoders (SDAE) which based on stacking layers of stacked denoising autoencoders (Vincent et al., 2010). It is very useful to learn the higher level representations and work well on natural images and handwritten digits. However, for the same reason, they also need a large scale training set and a long training time. They have no advantages to handle the small and middle scale applications.
|
| 34 |
+
|
| 35 |
+
Moreover, in the field of feature learning models, dimensionality reduction plays a crucial role to handle the problems for compressing, visualizing high-dimensional data and avoiding the “curse of dimensionality” (van der Maaten et al., 2009; van der Maaten, 2007). Traditional dimensionality reduction mainly can be classified into three types: linear or nonlinear, like principal components analysis (PCA) (Jolliffe, 2002) and linearity preserving projection (LPP) (Niyogi, 2004) are linear methods, stochastic neighbor embedding (SNE) (Hinton & Roweis, 2002) is a nonlinear method; supervised or unsupervised, such as marginal Fisher analysis (MFA) (Yan et al., 2007; Zhong et al., 2013) and linear discriminant analysis (LDA) (Fisher, 1936) are supervised methods, PCA is an unsupervised method; local or global, like MFA and SNE are local methods, PCA is a global method. Many feature learning models based on geometry theory provide different solutions to the problem of dimensionality reduction. Yan et al. proposed a general formulation about graph embedding framework can exploit new dimensionality reduction algorithms (Yan et al., 2007). If only directly use some feature learning models to extract the good representation from original data, it often eventually couldn’t get a good outcome. Considering this situation, we try to choose some excellent feature learning models and combine them with some deep learning algorithms. MFA is one special formulation of the graph embedding models based on this framework. It utilizes an intrinsic graph to characterize the intraclass compactness, and another penalty graph to characterize the interclass separability. Our motivation is to combine the advantage of MFA and deep architectures and propose a new initialization method for deep learning algorithms.
|
| 36 |
+
|
| 37 |
+
There are also have some excellent works about feature learning models combined the deep architectures (Yuan et al.; George et al., 2014; Ngiam et al., 2011). Yuan et al. proposed an improved multilayer learning model to solve the scene recognition task (Yuan et al.). This model overcome the limitation of shallow, one-layer representations for scene recognition. Trigeorgis et al proposed deep Semi-NMF, that is able to learn such hidden representations from different, unknown attributes of a given dataset (George et al., 2014). Ngiam proposed a deep architectures to learn features over multiple modalities (Ngiam et al., 2011). They showed that multi-modality feature learning is better than one modality and achieved good performance on video and audio datasets. However, in general, we can only obtain data from one modality. In this work, we combine the advantages of MFA and deep architectures, which based on stacked feature learning models (Zheng et al., 2014; 2015), then we use some deep learning tricks, like back propagation, denoising and dropout to fine tuning the network. The advantage of this deep architecture is that we can learn the desirable weight matrix even if the training data is not large enough. And compared with traditional deep learning models and shallow feature learning models, our MDA achieved state-of-the-art results in most cases.
|
| 38 |
+
|
| 39 |
+

|
| 40 |
+
Figure 1: The brief representation for MDA. $\mathbf { W } _ { r _ { 1 } }$ represents the first layer random weight matrix, ${ \bf W } _ { M F A _ { 2 } }$ and ${ \bf W } _ { M F A _ { 3 } }$ represent the weight matrixes learned by MFA. The dotted red lines represent the dropout operation, the dotted red circle is the ‘dropout’ node, and the cross nodes are corrupted. The denoising and dropout operation are completely random. For simplicity, we have omitted bias terms.
|
| 41 |
+
|
| 42 |
+
# 3 MARGINAL DEEP ARCHITECTURES (MDA)
|
| 43 |
+
|
| 44 |
+
In this section, we firstly introduce a novel framework of deep architectures, then we introduce marginal Fisher analysis (MFA) and the proposed marginal deep architectures (MDA) in detail. In addition, we also present some deep learning tricks that we used in the MDA model, including back propagation, denoising and dropout.
|
| 45 |
+
|
| 46 |
+
# 3.1 A NOVEL FRAMEWORK OF DEEP ARCHITECTURES
|
| 47 |
+
|
| 48 |
+
The feature learning problem is generally formulated as follow. Given $n$ data, $\{ \mathbf { x } _ { 1 } ^ { T } , \hdots , \mathbf { x } _ { n } ^ { T } \} \in \Re ^ { D }$ , where $D$ is the dimensionality of the data space, we seeks the compact representations of these data, i.e., $\{ \mathbf { y } _ { 1 } ^ { T } , \ldots , \mathbf { y } _ { n } ^ { T } \} \in \Re ^ { d }$ , where $d$ is the dimensionality of the low dimensional embeddings.
|
| 49 |
+
|
| 50 |
+
In order to improve the accuracy of shallow feature learning models, we use stacked feature learning models to construct the deep architectures (Zheng et al., 2014; 2015), which is a general framework for different applications. In this case, the mapping of data from the original $D$ -dimensional space to the resulted $d$ -dimensional space can be described as
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
D \Longrightarrow D _ { 1 } \Longrightarrow \cdots \Longrightarrow D _ { i } \Longrightarrow \cdots \Longrightarrow D _ { p - 1 } \Longrightarrow d ,
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
where $D _ { 1 }$ is the first higher dimensional space, the number of the node is twice or quadruple as the input layer. $D _ { i }$ represents the dimensionality of the $i$ -th intermediate representation space, and $p$ is the total steps of mappings. Here, we can use different feature learning models for the learning of each layer. As the feature learning models are optimized layer by layer, we can obtain the mapping functions between successive layers. The first hidden layer is random by $\mathbf { W } _ { r 1 }$ , and the representation is,
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\mathbf { a } ^ { 1 } = g ( \mathbf { W } _ { r _ { 1 } } ^ { T } \mathbf { x } + \mathbf { b } )
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
where, $g ( . )$ is a non-linear activation or transfer function. Then, we can use some feature learning models to initialize the next layers. The representations of next hidden layers are,
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\mathbf { a } ^ { k } = g ( \mathbf { W } _ { F _ { k - 1 } } ^ { T } \mathbf { a } ^ { k - 1 } + \mathbf { b } )
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
where, $\mathbf { W } _ { F _ { k - 1 } }$ is the weight matrix of the $k - 1$ th layer learned from feature learning models.
|
| 69 |
+
|
| 70 |
+
# 3.2 MARGINAL FISHER ANALYSIS (MFA)
|
| 71 |
+
|
| 72 |
+
Based on our novel framework of deep architecture, we introduce Marginal Fisher Analysis (MFA) to build MDA. Here, many traditional feature learning models, such as linear discriminant analysis (LDA), can be used as building blocks of MDA. Take LDA as an example. It assumes that the data of each class follow a Gaussian distribution. However, this assumption is not often satisfied in the real world. Without this assumption, LDA can not work well to separate the data with nonlinear structure. Alternatively, MFA can solve this problem effectively. Hence, considering the learning capability, we choose MFA as the build blocks of MDA in our work. MFA used the graph embedding framework to set up an intrinsic graph that characterizes the intraclass compactness and another penalty graph which characterizes the interclass separability. The marginal Fisher criterion is defined as
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\mathbf { W } ^ { * } = \operatorname * { a r g m i n } _ { \mathbf { W } } \frac { \operatorname { t r } ( \mathbf { W } ^ { T } \mathbf { X } ( \mathbf { D } - \mathbf { A } ) \mathbf { X } ^ { T } \mathbf { W } ) } { \operatorname { t r } ( \mathbf { W } ^ { T } \mathbf { X } ( \mathbf { D } ^ { p } - \mathbf { A } ^ { p } ) \mathbf { X } ^ { T } \mathbf { W } ) }
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
where $\mathbf { D }$ and $\mathbf { D } ^ { p }$ are diagonal matrices with elements $\begin{array} { r } { \mathbf { D } _ { i i } = \sum _ { j } \mathbf { A } _ { i j } } \end{array}$ , and $\begin{array} { r } { \mathbf { D } _ { i j } ^ { p } = \sum _ { j } \mathbf { A } _ { i j } ^ { p } } \end{array}$ , respectively. Then we can learn the projection matrix to multiply PCA’s projection and marginal Fisher projection,
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\mathbf { W } _ { M F A } = \mathbf { W } _ { P C A } \mathbf { W } ^ { * }
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
# 3.3 MARGINAL DEEP ARCHITECTURES (MDA)
|
| 85 |
+
|
| 86 |
+
In order to combine the advantages of MFA and proposed deep architectures, we propose the marginal deep architectures (or MDA). The MDA inherited from the proposed novel framework of deep architectures is shown in Fig. 1. As an input vector $\mathbf { x } \in [ 0 , 1 \bar { ] } ^ { d }$ , we first map it to higher dimensional space by a random weight matrix $\mathbf { W } _ { r 1 }$ . The representation of first hidden layer is computed as
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\mathbf { a } ^ { 1 } = s ( \mathbf { W } _ { r _ { 1 } } ^ { T } \mathbf { x } + \mathbf { b } )
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
where, $s ( . )$ is the sigmoid function $\begin{array} { r } { s ( x ) = \frac { 1 } { 1 + e ^ { - x } } } \end{array}$ , $\mathbf { b }$ is the bias terms, $\mathbf { a } ^ { 1 }$ is the output of first layer. From second layer to $( n - 1 )$ -th layer, we use the weight matrices learned from MFA to map layer by layer.
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\mathbf { a } ^ { k } = s ( \mathbf { W } _ { M F A _ { k - 1 } } ^ { T } \mathbf { a } ^ { k - 1 } + \mathbf { b } )
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
The last layer is a softmax regression layer and the number of neuron is the number of category. The cost function is defined as,
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
J ( \mathbf { w } ) = - \frac { 1 } { N } ( \sum _ { i = 1 } ^ { N } \sum _ { j = 1 } ^ { K } \mathbf { I } ( y _ { i } = j ) \log \frac { \exp ( \mathbf { w } _ { j } ^ { T } \mathbf { a } _ { i } ^ { n - 1 } ) } { \sum _ { l = 1 } ^ { K } \exp ( \mathbf { w } _ { l } ^ { T } \mathbf { a } _ { i } ^ { n - 1 } ) } )
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
where, $\mathbf { I } ( x )$ is the indicator function, $\mathbf { I } ( x ) = 1$ if $x$ is true, else $\mathbf { I } ( x ) = 0$ . $y _ { i }$ is the label corresponding to $\mathbf { x } _ { i }$ . Then the probability that $\mathbf { x } _ { i }$ is classified to $j$ is,
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
p ( y _ { i } = j | \mathbf { x } _ { i } , \mathbf { w } ) = \frac { \exp ( \mathbf { w } _ { j } ^ { T } \mathbf { a } _ { i } ^ { n - 1 } ) } { \sum _ { l = 1 } ^ { K } \exp ( \mathbf { w } _ { l } ^ { T } \mathbf { a } _ { i } ^ { n - 1 } ) }
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
Taking derivatives, one can show that the gradient is,
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
\nabla J ( \mathbf { w } ) = - \frac { 1 } { N } \sum _ { i = 1 } ^ { N } [ \mathbf { x } _ { i } ( \mathbf { I } ( y _ { i } = j ) - p ( y _ { i } = j | \mathbf { x } _ { i } , \mathbf { w } ) ]
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
If the $n { - } 1$ layer’s neurons are more than the last layer, we can continue using MFA to map it. On the contrary, If the $n - 1$ layer’s neurons are less than last layer, we can randomly initialize the weight matrix between this two layers. Next, in order to improve the MDA, we introduce back propagation, denoising and dropout operation.
|
| 117 |
+
|
| 118 |
+
# 3.4 BACK PROPAGATION
|
| 119 |
+
|
| 120 |
+
In order to adjust the network, we use back propagation (Rumelhart et al., 1986) to compute partial derivative and stochastic gradient descent to update the weight matrixes and the bias terms. For each node $i$ in output layer $n$ -th layer), we compute an error term as
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\delta _ { i } ^ { n } = \nabla J ( \mathbf { w } )
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
where, $J ( \mathbf { w } )$ is the cost function computed from Equ.8 and $\nabla J ( \mathbf { w } )$ computed from Equ.10. For each node $i$ in $( n - 1 )$ -th to second layer, the error term is computed as,
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
\delta _ { i } ^ { k } = ( \sum _ { j = 1 } ^ { k + 1 } w _ { j i } ^ { k } \delta _ { j } ^ { k + 1 } ) s ^ { \prime } ( z _ { i } ^ { k } )
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+
The back propagation procedure relies on computing the gradient of an objective function with respect to the weights of a multilayer stacked modules. It starting from the output at the top and end to the input at the bottom.
|
| 133 |
+
|
| 134 |
+
# 3.5 DENOISING OPERATION
|
| 135 |
+
|
| 136 |
+
Vincent et al. proposed the denoising autoencoder to improve the robustness of autoencoder (Vincent et al., 2008). It’s very similar with the regularization methods and avoids the “overfitting” problem. The basic idea is to corrupt partial input data by the desired proportion of $\nu$ “destruction”. for each input $\mathbf { x }$ , a fixed number $\nu d$ of components are chosen at random, and their value is forced to 0, while the others are left untouched. The initial input $\mathbf { x }$ to get a partially destroyed version $\tilde { \mathbf { x } }$ by means of a stochastic mapping,
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\tilde { \mathbf { x } } \sim q _ { D } ( \tilde { \mathbf { x } } | \mathbf { x } )
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
where, $q _ { D } ( \tilde { \mathbf { x } } | \mathbf { x } )$ is the unknown distribution. Then, for a hidden representation $\mathbf { h }$ ,
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
\mathbf { h } = s ( \mathbf { W } ^ { T } \widetilde { \mathbf { x } } + \mathbf { b } )
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
In our MDA, we use this idea to improve the network, please refer to Fig. 1 to find clear sight. For the input layer, the output of first hidden layer is represented as,
|
| 149 |
+
|
| 150 |
+
$$
|
| 151 |
+
\mathbf { a } ^ { 2 } = s ( \mathbf { W } _ { r _ { 1 } } ^ { T } \tilde { \mathbf { x } } + \mathbf { b } _ { 1 } )
|
| 152 |
+
$$
|
| 153 |
+
|
| 154 |
+
where, $\mathbf { W } _ { r _ { 1 } }$ is the first layer random weight matrix, $\mathbf { b } _ { 1 }$ is the bias term of first layer. The “denoising” operation is established to a hypothetical additional specific criterion: robustness to partial destruction of the input, which means a good intermediate representation is learned from unknown distribution of its observed input. This operation helps for learning more stable structure and avoids the overfitting problem in most cases.
|
| 155 |
+
|
| 156 |
+
# 3.6 DROPOUT
|
| 157 |
+
|
| 158 |
+
As the same reason with denoising operation, dropout is a trick to prevent overfitting (Hinton et al., 2012b). When a large feedforward neural network is trained on a small training set, dropout performed well on test set. In order to prevent the complex co-adaptations on the training data, the basic idea of dropout is that each hidden node is randomly omitted from the network with a probability of $\beta$ , so a hidden node can’t rely on other hidden node. In another view, dropout is as a very efficient way of performing model averaging with neural networks. On test set, we train many separate networks and then to apply each of these networks to the test data. Dropout operation can save the train time and then we average the predictions produced by a very large number of different networks. Fig. 1 shows the dropout operation in our MDA.
|
| 159 |
+
|
| 160 |
+
# 4 EXPERIMENTS
|
| 161 |
+
|
| 162 |
+
# 4.1 DATESET DESCRIPTIONS
|
| 163 |
+
|
| 164 |
+
We evaluate the performance of MDA on five benchmark data sets. The detail of the data is showed in Tab 1. The USPS 1 data set is a handwritten digits image data set includes 7291 training samples and 2007 test samples from 10 classes with 256 dimensional features. This task is to recognize the digits 0 to 9. The Isolet 2 data set is a collection of audio feature vectors of spoken letters from the English alphabet. It includes 6238 training samples and 1559 test samples from 26 classes with 614 dimensional features. The task is to identify which letter is spoken based on the recorded (and pre-processed) audio signal. Sensor 3 is a sensorless drive diagnosis data set includes 46816 training samples and 11693 test samples from 11 classes with 48 dimensional features. The features are extracted from electric current drive signals. The task is to classify 11 different classes with different conditions of the drive which has intact and defective components. Covertype 4 contains geological and map-based data from four wilderness areas located in the Roosevelt National Forest of northern Colorado. It includes 15120 training samples and 565892 test samples from 7 classes with 54 dimensional features. The task is to identify forest cover type from cartographic variables. For the IbnSina 5 ancient Arabic document data set, we use 50 pages of the manuscript for training (17543 training samples) and 10 pages for testing (3125 test samples). The data samples belong to 174 classes of subwords and are of dimensionality 200.
|
| 165 |
+
|
| 166 |
+
Table 1: Characteristics of datasets used in evaluation.
|
| 167 |
+
|
| 168 |
+
<table><tr><td colspan="6">DATASETSTATISTICS</td></tr><tr><td>dataset</td><td>n</td><td>train</td><td>test</td><td>[V</td><td>d(target)</td></tr><tr><td>USPS</td><td>9298</td><td>7291</td><td>2007</td><td>10</td><td>256(32)</td></tr><tr><td>Isolet</td><td>7797</td><td>6238</td><td>1559</td><td>26</td><td>614(308)</td></tr><tr><td>Sensor</td><td>58509</td><td>46816</td><td>11693</td><td>11</td><td>48(24)</td></tr><tr><td>Covertype</td><td>581012</td><td>15120</td><td>565892</td><td>7</td><td>54(27)</td></tr><tr><td>Ibnsina</td><td>20668</td><td>17543</td><td>3125</td><td>174</td><td>200(100)</td></tr><tr><td>CIFAR-10</td><td>60000</td><td>50000</td><td>10000</td><td>10</td><td>3072(64)</td></tr><tr><td>CMU</td><td>49</td><td>44</td><td>5</td><td>3</td><td>93(24)</td></tr></table>
|
| 169 |
+
|
| 170 |
+
In addition, we also use a large scale dataset CIFAR-10 6 to test our MDA on large scale applications. The CIFAR-10 dataset consists of $6 0 0 0 0 3 2 \times 3 2$ colour images in 10 classes, with 6000 images per class. There are 50000 training images and 10000 test images. We also test our MDA on a specific task which use the CMU motion capture (CMU mocap) data set 7. The CMU mocap data set includes three categories, namely, jumping, running and walking. We choose 49 video sequences from four subjects. For each sequence, the features are generated using Lawrences method 8, with dimensionality 93 (Zhong et al., 2010). By reason of the few samples of CMU, we adopt 10-fold cross-validation in our experiments and use the average error rate and standard deviation to evaluate the performance.
|
| 171 |
+
|
| 172 |
+
# 4.2 CLASSIFICATION ON FIVE BENCHMARK DATA SETS
|
| 173 |
+
|
| 174 |
+
# 4.2.1 BASELINE METHODS
|
| 175 |
+
|
| 176 |
+
In order to evaluate the performance of MDA, we compared our MDA with 5 deep learning models include autoencoder (AE) (Hinton & Salakhutdinov, 2006), stacked autoencoders, denoising autoencoders (Vincent et al., 2008), stacked denoising autoencoders (Vincent et al., 2010) and stacked denoising autoencoders with dropout, 2 feature learning models, MFA (Zhong et al., 2013; Yan et al., 2007) and PCA (Jolliffe, 2002), PCA deep architecture base on our uniform framework and the classification accuracy on original space.
|
| 177 |
+
|
| 178 |
+
# 4.2.2 EXPERIMENTAL SETTINGS
|
| 179 |
+
|
| 180 |
+
All of the deep learning methods have the same settings. The size of minibatch was set to 100, the learning rate and momentum were the default value 1 and 0.5, the number of epoch was set to 400, the dropout rate and denoising rate $\nu$ were set to 0.1. For the AE and SAE, weight penalty of the $L 2$ norm was set to $1 0 ^ { - 4 }$ . For MFA, the number of nearest neighbors for constructing the intrinsic graph was set to 5, while that for constructing the penalty graph was set to 20. The target spaces of MFA and PCA on different data sets were showed in Tab 1. For the USPS data set, The architecture was set to $2 5 6 - 5 1 2 - 2 5 6 - 1 2 8 - 6 4 - 3 2$ . For the Isolet data set ,the architecture was set to $6 1 7 - 1 3 2 4 - 6 1 7 - 3 0 8$ . For the Sensor data set, the architecture was set to $4 8 - 9 6 - 4 8 - 2 4$ .
|
| 181 |
+
|
| 182 |
+
Table 2: The classification accuracy on different datasets. “ORIG” represents the results obtained in the original data space. ‘PDA’ represents the PCA deep architecture. ‘MDA’ represents the MFA deep architecture. The best reslut is highlighted with boldface.
|
| 183 |
+
|
| 184 |
+
<table><tr><td>Method</td><td>ORIG</td><td>PCA</td><td>MFA</td><td>AE</td><td>SAE</td><td>DAE(dropout)</td><td>DAE</td><td>SDAE</td><td>PDA</td><td>MDA</td></tr><tr><td>USPS</td><td>0.8366</td><td>0.9402</td><td>0.9392</td><td>0.9402</td><td>0.9402</td><td>0.9581</td><td>0.9532</td><td>0.9452</td><td>0.9586</td><td>0.9601</td></tr><tr><td>Isolet</td><td>0.9467</td><td>0.9237</td><td>0.9269</td><td>0.9519</td><td>0.9506</td><td>0.9596</td><td>0.9519</td><td>0.9543</td><td>0.9584</td><td>0.9622</td></tr><tr><td>Sensor</td><td>0.8151</td><td>0.8042</td><td>0.8234</td><td>0.7995</td><td>0.8325</td><td>0.8178</td><td>0.7764</td><td>0.7870</td><td>0.8582</td><td>0.8558</td></tr><tr><td>Covertype</td><td>0.5576</td><td>0.5596</td><td>0.6057</td><td>0.7405</td><td>0.5576</td><td>0.7093</td><td>0.7397</td><td>0.7440</td><td>0.7458</td><td>0.7589</td></tr><tr><td>Ibnsina</td><td>0.8957</td><td>0.9190</td><td>0.9206</td><td>0.9363</td><td>0.9184</td><td>0.9402</td><td>0.9370</td><td>0.9261</td><td>0.9421</td><td>0.9491</td></tr></table>
|
| 185 |
+
|
| 186 |
+
Table 3: The structures on 5 data sets. “None” represents without second layer in MDA. “Twice” means the second layer’s nodes are as twice as the input layer. “Quadruple” represents the second layer’s nodes are as quadruple as the input layer. “Octuple” represents the second layer’s nodes are as octuple as the input layer.
|
| 187 |
+
|
| 188 |
+
<table><tr><td>Dataset</td><td>None</td><td>Twice</td><td>Quadruple</td><td>Octuple</td></tr><tr><td>USPS</td><td>256-128-64-32</td><td>256-512-256-128-64-32</td><td>256-1024-512-256-128-64-32</td><td>256-2048-1024-512-256-128-64-32</td></tr><tr><td>Isolet</td><td>617-308</td><td>617-1324-617-308</td><td>617-2648-1324-617-308</td><td>617-5296-2648-1324-617-308</td></tr><tr><td>Sensor</td><td>48-24</td><td>48-96-24</td><td>48-192-96-24</td><td>48-384-192-96-24</td></tr><tr><td>Covertype</td><td>54-27</td><td>54-108-27</td><td>54-216-108-54-27</td><td>54-432-216-108-54-27</td></tr><tr><td>Ibnsina</td><td>200-100</td><td>200-400-200-100</td><td>200-800-400-200-100</td><td>200-1600-800-400-200-100</td></tr></table>
|
| 189 |
+
|
| 190 |
+
For the Covertype data set, we set the architecture to $5 4 - 2 1 6 - 1 0 8 - 5 4 - 2 7$ . Finally, for Ibnsina data set, the architecture was set to $2 0 0 - 4 0 0 - 2 0 0 - 1 0 0$ .
|
| 191 |
+
|
| 192 |
+
# 4.2.3 CLASSIFICATION RESULTS
|
| 193 |
+
|
| 194 |
+
The experimental results are shown in Tab. 2. We can see that our MDA achieves the best results on four dataset except the Sensor dataset, but MDA achieves the second best result on Sensor data set and only below the PDA. The PDA achieves the best result on Sensor data set and the second best results on other data sets. These results demonstrate that our uniform deep architectures achieve the good performance in most case. In addition, MDA not only outperform the traditional deep learning models, but also the shallow feature learning models. It shows that our deep architectures based on stacked some feature learning models can learn the better feature than shallow feature learning models.
|
| 195 |
+
|
| 196 |
+
# 4.3 EVALUATION
|
| 197 |
+
|
| 198 |
+
# 4.3.1 DIFFERENT STRUCTURES FOR MDA
|
| 199 |
+
|
| 200 |
+
In order to evaluate the desired structures of MDA, we changed the node’s number of the second layer. For USPS data set, we get rid of the second layer and the architecture was $2 5 6 - 1 2 8 - 6 4 - 3 2$ . Then, we set the number of node of the second layer was as twice as the input layer, the architecture was $2 5 6 - 1 2 8 - 6 4 - 3 2$ . Next, the number of node was as quadruple as the input layer, the architecture was $2 5 6 - 1 0 2 4 - 5 1 2 - 2 5 6 - 1 2 8 - 6 4 - 3 2$ . Finally, the node’s number is as octuple as the input layer, the architecture was $2 5 6 \mathrm { ~ - ~ } 2 0 4 8 \mathrm { ~ - ~ } 1 0 2 4 \mathrm { ~ - ~ } 5 1 2 \mathrm { ~ - ~ } 2 5 6 \mathrm { ~ - ~ } 1 2 8 \mathrm { ~ - ~ } 6 4 \mathrm { ~ - ~ } 3 2$ . The structures of other data sets are shown in Tab. 3.
|
| 201 |
+
|
| 202 |
+
The experimental results are shown in Tab. 4. When the the number of nodes of the second layer is as twice as the input layer, MDA achieved the minimum classification error on all data sets except the Covertype data set. When the number of nodes of the second layer is as quadruple as the input layer, MDA get the worst result on Covertype data set. We can conclude that MDA can work well when the number of nodes of the second layer is as twice or quadruple as the input layer.
|
| 203 |
+
|
| 204 |
+
Table 4: The classification error with different structures on 5 data sets. The best results (minimum error) are highlighted with boldface.
|
| 205 |
+
|
| 206 |
+
<table><tr><td>Dataset</td><td>None</td><td>Twice</td><td>Quadruple</td><td>Octuple</td></tr><tr><td>USPS</td><td>0.0463</td><td>0.0399</td><td>0.0433</td><td>0.0453</td></tr><tr><td>Isolet</td><td>0.0398</td><td>0.0378</td><td>0.0417</td><td>0.0430</td></tr><tr><td>Sensor</td><td>0.2172</td><td>0.1442</td><td>0.1559</td><td>0.7856</td></tr><tr><td>Covertype</td><td>0.3876</td><td>0.3878</td><td>0.2411</td><td>0.3806</td></tr><tr><td>Ibnsina</td><td>0.0643</td><td>0.0509</td><td>0.0614</td><td>0.0858</td></tr></table>
|
| 207 |
+
|
| 208 |
+
Table 5: The classification error on 5 datasets with different number of hidden layers.
|
| 209 |
+
|
| 210 |
+
<table><tr><td>The number of hidden layers</td><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td></tr><tr><td>USPS</td><td>0.05780</td><td>0.05032</td><td>0.05082</td><td>0.05182</td><td>0.03990</td><td>0.05730</td><td>0.05132</td></tr><tr><td>Isolet</td><td>0.03977</td><td>0.04169</td><td>0.03785</td><td>0.03849</td><td>0.05452</td><td>0.04234</td><td>0.04683</td></tr><tr><td>Covertype</td><td>0.27171</td><td>0.25601</td><td>0.24110</td><td>0.26731</td><td>0.27491</td><td></td><td></td></tr><tr><td>Sensor</td><td>0.20457</td><td>0.15522</td><td>0.14420</td><td>0.17027</td><td>0.15567</td><td></td><td></td></tr><tr><td>Ibnsina</td><td>0.05696</td><td>0.05184</td><td>0.05088</td><td>0.06016</td><td>0.06720</td><td></td><td></td></tr></table>
|
| 211 |
+
|
| 212 |
+
Table 6: The classification error on gray-CIFAR10 and CMU mocap data sets.
|
| 213 |
+
|
| 214 |
+
<table><tr><td colspan="2">(a)gray-CIFAR10</td><td colspan="2">(b) CMU mocap</td></tr><tr><td>Method</td><td>Error</td><td>Method</td><td>Error</td></tr><tr><td>AE</td><td>0.5117</td><td>AE</td><td>0.3970±0.1343</td></tr><tr><td>SAE</td><td>0.5252</td><td>SAE</td><td>0.4106 ± 0.1648</td></tr><tr><td>DAE(dropout)</td><td>0.5090</td><td>DAE(dropout)</td><td>0.3970±0.1343</td></tr><tr><td>DAE</td><td>0.5176</td><td>DAE</td><td>0.4061 ± 0.1540</td></tr><tr><td>SDAE</td><td>0.5113</td><td>SDAE</td><td>0.3970 ± 0.1343</td></tr><tr><td>PDA</td><td>0.5085</td><td>PDA</td><td>0.3591 ± 0.0815</td></tr><tr><td>MDA</td><td>0.4947</td><td>MDA</td><td>0.3636 ± 0.0958</td></tr></table>
|
| 215 |
+
|
| 216 |
+
# 4.3.2 DIFFERENT NUMBER OF HIDDEN LAYERS FOR MDA
|
| 217 |
+
|
| 218 |
+
In order to evaluate how many hidden layers adapt to different datasets, we designed some experiments which have different number of hidden layers. We used $1 \sim 7$ hidden layers on USPS and Isolet datasets and $1 \sim 5$ hidden layers on Covertype, Sensor and Ibnsina datasets. The experimental settings were same as previous experiments.
|
| 219 |
+
|
| 220 |
+
Tab. 5 shows the classification error on 5 datasets with different hidden layers. All the datasets achieved the best results when hidden layer’s number is 3 except USPS dataset. The USPS dataset achieved the best result when hidden layer’s number is 5. As $1 \sim 3$ hidden layers, with the increase of the number of layers, the classification error is decreasing on all datasets. As small and middle scale applications, we don’t need very deep architectures to handle it. As large scale applications, we can design deeper architectures to achieve better performance.
|
| 221 |
+
|
| 222 |
+
# 4.4 CLASSIFICATION ON LARGE SCALE DATASET CIFAR-10
|
| 223 |
+
|
| 224 |
+
The previous section introduced the advantages of MDA on small and middle scale applications. In order to evaluate the universality of MDA, we chose a relatively large scale dataset CIFAR-10 to test the performance of MDA.
|
| 225 |
+
|
| 226 |
+
In our experiments, we first transformed the color images to gray images in order to reduce the dimensionality of input. Then we took one sample as a 1024 dimensional vector which is the input of our MDA. So, we can call this data set gray-CIFAR10. The architecture was set to $1 0 2 4 - 2 0 4 8 -$ $1 0 2 4 - 5 1 2 - 2 5 6 - 1 2 8 - 6 4 .$ the minibatch’s size was set to 100, the dropout ratio and denoising ratio were set to 0.1, the number of epoch was set to 400, the learning rate was set to 1, the momentum was set to 0.5. We compared our MDA with previous 6 methods.
|
| 227 |
+
|
| 228 |
+
Table. 6(a) shows the classification error on gray-CIFAR10, we can see that PDA and MDA achieved the best results in these 7 methods. However, all of the methods on this framework didn’t perform well because we use the gray operation.
|
| 229 |
+
|
| 230 |
+
# 4.5 CLASSIFICATION ON CMU MOCAP DATA SET
|
| 231 |
+
|
| 232 |
+
CMU mocap data set is a very small dataset that only has 49 samples. Traditional deep learning methods didn’t work well in these kind of applications. We test our MDA and PDA and compared them with other 5 deep learning models. The architectures for all deep models (except the PDA) were set to $9 3 - 1 8 6 - 9 3 - 4 7 - 2 4$ . Specially, since the CMU mocap data set only has 49 samples, the PCA method only reduce the dimensionality to 49 at most, so the architecture of PDA was set to
|
| 233 |
+
|
| 234 |
+
$9 3 - 1 8 6 - 2 4 $ . The denoising ratio and dropout ratio were set to 0.1 on DAE, DAE with dropout, SDAE, SAE, PDA and MDA. The weight penalty on AE was set to $1 0 ^ { - 4 }$ . The learning rate was set to 0.01, the momentum was set to 0.5 and the number of epoch is set to 600. The experiment was test on 10-fold cross validation. The experimental results are shown in Tab. 6(b).
|
| 235 |
+
|
| 236 |
+
In Tab. 6(b), our PDA and MDA achieved the best results in this dataset and have lower standard deviation than other deep learning models. It demonstrates that our PDA and MDA are more stable than other deep learning models. The traditional autoencoder, SDAE, DAE with dropout achieved the same result in this dataset and better than SAE and DAE.
|
| 237 |
+
|
| 238 |
+
# 5 CONCLUSION
|
| 239 |
+
|
| 240 |
+
In this paper, we proposed a novel deep learning framework that based on stacked some feature learning models to handle small or middle data sets. Then we introduce MFA in this framework, called MDA. The deep learning tricks like backpropagation, denoising and dropout operation are applied on MDA to improve its performance. Extensive experiments on 7 different type data sets demonstrate that MDA performs not only better than shallow feature learning models, but also stateof-the-art deep learning models on small and middle scale applications. The evaluation of MDA show that how to adjust the parameters make the MDA work well. For future work, we plan to try other feature learning models and explore the different structures for this novel deep learning model. In addition, we plan to explore new deep architectures based on this framework to handle the large scale datasets.
|
| 241 |
+
|
| 242 |
+
# REFERENCES
|
| 243 |
+
|
| 244 |
+
T.-H. Chan, K. Jia, S. Gao, J. Lu, Z. Zeng, and Y. Ma. PCANet: A simple deep learning baseline for image classification? arXiv preprint arXiv:1404.3606, 2014.
|
| 245 |
+
D. C. Ciresan, U. Meier, L. M. Gambardella, and J. Schmidhuber. Deep, big, simple neural nets for handwritten digit recognition. Neural computation, 22(12):3207–3220, 2010.
|
| 246 |
+
R. Collobert and J. Weston. A unified architecture for natural language processing: Deep neural networks with multitask learning. In ICML, pp. 160–167, 2008.
|
| 247 |
+
J. Donahue, Y. Jia, O. Vinyals, J. Hoffman, N. Zhang, E. Tzeng, and T. Darrell. Decaf: A deep convolutional activation feature for generic visual recognition. arXiv preprint arXiv:1310.1531, 2013.
|
| 248 |
+
R. A. Fisher. The use of multiple measurements in taxonomic problems. Annals of eugenics, 7(2): 179–188, 1936.
|
| 249 |
+
T. George, B. Konstantinos, Z. Stefanos, and Bjorn W. Schuller. A Deep Semi-NMF Model for ¨ Learning Hidden Representations. In ICML, pp. 1692–1700, 2014.
|
| 250 |
+
G. Hinton and R. Salakhutdinov. Reducing the Dimensionality of Data with Neural Networks. Science, 313(5786):504–507, 2006.
|
| 251 |
+
G. Hinton, L. Deng, D. Yu, G. E. Dahl, A. r. Mohamed, N. Jaitly, A. Senior, V. Vanhoucke, P. Nguyen, T. N. Sainath, et al. Deep neural networks for acoustic modeling in speech recognition: The shared views of four research groups. Signal Processing Magazine, IEEE, 29(6):82–97, 2012a.
|
| 252 |
+
G. E. Hinton and S. T. Roweis. Stochastic neighbor embedding. In NIPS, pp. 833–840, 2002.
|
| 253 |
+
G. E. Hinton, N. Srivastava, A. Krizhevsky, I. Sutskever, and R. R. Salakhutdinov. Improving neural networks by preventing co-adaptation of feature detectors. arXiv preprint arXiv:1207.0580, 2012b.
|
| 254 |
+
I. Jolliffe. Principal component analysis. 2002.
|
| 255 |
+
A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, pp. 1097–1105, 2012.
|
| 256 |
+
Y. l. Boureau and Y.L. Cunand others. Sparse feature learning for deep belief networks. In NIPS, pp. 1185–1192, 2008.
|
| 257 |
+
Q. V. Le, W. Y. Zou, S. Y. Yeung, and A. Y. Ng. Learning hierarchical invariant spatio-temporal features for action recognition with independent subspace analysis. In CVPR, pp. 3361–3368, 2011.
|
| 258 |
+
Y. LeCun, Y. Bengio, and G. Hinton. Deep learning. Nature, pp. 436–444, 2015.
|
| 259 |
+
H. Lee, R. Grosse, R. Ranganath, and A. Y. Ng. Convolutional deep belief networks for scalable unsupervised learning of hierarchical representations. In ICML, pp. 609–616, 2009a.
|
| 260 |
+
H. Lee, P. Pham, Y. Largman, and A. Y. Ng. Unsupervised feature learning for audio classification using convolutional deep belief networks. In NIPS, pp. 1096–1104, 2009b.
|
| 261 |
+
M. Long, Y. Cao, J. Wang, and M. Jordan. Learning Transferable Features with Deep Adaptation Networks. In ICML, pp. 97–105, 2015.
|
| 262 |
+
J. Ngiam, A. Khosla, M. Kim, J. Nam, H. Lee, and A. Y. Ng. Multimodal deep learning. In ICML, pp. 689–696, 2011.
|
| 263 |
+
X. Niyogi. Locality preserving projections. In NIPS, volume 16, pp. 153, 2004.
|
| 264 |
+
D. E Rumelhart, G. E. Hinton, and R. G. Williams. Learning representations by back-propagating errors. Nature, pp. 323–533, 1986.
|
| 265 |
+
I. Sutskever, O. Vinyals, and Q. V. Le. Sequence to sequence learning with neural networks. In NIPS, pp. 3104–3112, 2014.
|
| 266 |
+
L. J. van der Maaten. An introduction to dimensionality reduction using matlab. Report, 1201 (07-07):62, 2007.
|
| 267 |
+
L. J. van der Maaten, E. O. Postma, and H. J. van den Herik. Dimensionality reduction: A comparative review. The Journal of Machine Learning Research, 10(1-41):66–71, 2009.
|
| 268 |
+
P. Vincent, H. Larochelle, Y. Bengio, and P.-A. Manzagol. Extracting and composing robust features with denoising autoencoders. In ICML, pp. 1096–1103, 2008.
|
| 269 |
+
P. Vincent, H. Larochelle, I. Lajoie, Y. Bengio, and P.-A. Manzagol. Stacked denoising autoencoders: Learning useful representations in a deep network with a local denoising criterion. The Journal of Machine Learning Research, 11:3371–3408, 2010.
|
| 270 |
+
H. Y. Xiong, B. Alipanahi, L. J. Lee, H. Bretschneider, D. Merico, R. K. Yuen, Y. Hua, S. Gueroussov, H. S. Najafabadi, T. R. Hughes, et al. The human splicing code reveals new insights into the genetic determinants of disease. Science, 347(6218):1254806, 2015.
|
| 271 |
+
S. Yan, D. Xu, B. Zhang, H.-J. Zhang, Q. Yang, and S. Lin. Graph Embedding and Extensions: A General Framework for Dimensionality Reduction. Pattern Analysis and Machine Intelligence, IEEE Transactions on, 29(1):40–51, 2007.
|
| 272 |
+
Y. Yuan, L. Mou, and X. Lu. Scene recognition by manifold regularized deep learning architecture. Neural Networks and Learning System, IEEE Transactions on.
|
| 273 |
+
Y. Zheng, G. Zhong, J. Liu, X. Cai, and J. Dong. Visual Texture Perception with Feature Learning Models and Deep Architectures. In CCPR, pp. 401–410. 2014.
|
| 274 |
+
Y. Zheng, Y. Cai, G. Zhong, Y. Chherawala, Y. Shi, and J. Dong. Stretching Deep Architectures for Text Recognition. In ICDAR, pp. 236–240, 2015.
|
| 275 |
+
G. Zhong, W.-J. Li, D.-Y. Yeung, X. Hou, and C.-L. Liu. Gaussian Process Latent Random Field. In AAAI, 2010.
|
| 276 |
+
G. Zhong, Y. Chherawala, and M. Cheriet. An Empirical Evaluation of Supervised Dimensionality Reduction for Recognition. In ICDAR, pp. 1315–1319, 2013.
|
| 277 |
+
B. Zhou, A. Lapedriza, J. Xiao, A. Torralba, and A. Oliva. Learning deep features for scene recognition using places database. In NIPS, pp. 487–495, 2014.
|
md/train/CR1XOQ0UTh-/CR1XOQ0UTh-.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/DPHsCQ8OpA/DPHsCQ8OpA.md
ADDED
|
@@ -0,0 +1,335 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Habitat 2.0: Training Home Assistants to Rearrange their Habitat
|
| 2 |
+
|
| 3 |
+
Andrew Szot2, ⇤ Alex Clegg1, Eric Undersander1, Erik Wijmans1,2, Yili Zhao1, John Turner1, Noah Maestre1, Mustafa Mukadam1, Devendra Chaplot1, Oleksandr Maksymets1, Aaron Gokaslan1, Vladimir Vondrus, Sameer Dharur2, Franziska Meier1, Wojciech Galuba1, Angel Chang4, Zsolt ${ \bf K i r a } ^ { 2 }$ , Vladlen Koltun3, Jitendra Malik1,5, Manolis Savva4, Dhruv Batra1,2 1Facebook AI Research, 2Georgia Tech, 3Intel Research, 4Simon Fraser University 5UC Berkeley
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
We introduce Habitat 2.0 (H2.0), a simulation platform for training virtual robots in interactive 3D environments and complex physics-enabled scenarios. We make comprehensive contributions to all levels of the embodied AI stack – data, simulation, and benchmark tasks. Specifically, we present: (i) ReplicaCAD: an artist-authored, annotated, reconfigurable 3D dataset of apartments (matching real spaces) with articulated objects (e.g. cabinets and drawers that can open/close); (ii) H2.0: a high-performance physics-enabled 3D simulator with speeds exceeding 25,000 simulation steps per second $\mathbf { 8 5 0 } \times$ real-time) on an 8-GPU node, representing $1 0 0 \times$ speed-ups over prior work; and, (iii) Home Assistant Benchmark (HAB): a suite of common tasks for assistive robots (tidy the house, stock groceries, set the table) that test a range of mobile manipulation capabilities. These large-scale engineering contributions allow us to systematically compare deep reinforcement learning (RL) at scale and classical sense-plan-act (SPA) pipelines in long-horizon structured tasks, with an emphasis on generalization to new objects, receptacles, and layouts. We find that (1) flat RL policies struggle on HAB compared to hierarchical ones; (2) a hierarchy with independent skills suffers from ‘hand-off problems’, and (3) SPA pipelines are more brittle than RL policies.
|
| 8 |
+
|
| 9 |
+

|
| 10 |
+
Figure 1: A mobile manipulator (Fetch robot) simulated in Habitat 2.0 performing rearrangement tasks in a ReplicaCAD apartment – (left) opening a drawer before picking up an item from it, and (right) placing an object into the bowl after navigating to the table. Best viewed in motion at https://aihabitat.org/docs/habitat2.
|
| 11 |
+
|
| 12 |
+
# 1 Introduction
|
| 13 |
+
|
| 14 |
+
Consider a home assistant robot illustrated in Fig. 1 – a mobile manipulator (Fetch [1]) performing tasks like stocking groceries into the fridge, clearing the table and putting dishes into the dishwasher, fetching objects on command and putting them back, etc. Developing such embodied intelligent systems is a goal of deep scientific and societal value. So how should we accomplish this goal?
|
| 15 |
+
|
| 16 |
+
Training and testing such robots in hardware directly is slow, expensive, and difficult to reproduce. We aim to advance the entire ‘research stack’ for developing such embodied agents in simulation – (1) data: curating house-scale interactive 3D assets (e.g. kitchens with cabinets, drawers, fridges that can open/close) that support studying generalization to unseen objects, receptacles, and home layouts, (2) simulation: developing the next generation of high-performance photo-realistic 3D simulators that support rich interactive environments, (3) tasks: setting up challenging representative benchmarks to enable reproducible comparisons and systematic tracking of progress over the years. To support this long-term research agenda, we present:
|
| 17 |
+
|
| 18 |
+
• ReplicaCAD: an artist-authored fully-interactive recreation of ‘FRL-apartment’ spaces from the Replica dataset [2] consisting of 111 unique layouts of a single apartment background with 92 authored objects including dynamic parameters, semantic class and surface annotations, and efficient collision proxies, representing $9 0 0 +$ person-hours of professional 3D artist effort. ReplicaCAD (illustrated in figures and videos) was created with the consent of and compensation to artists, and will be shared under a Creative Commons license for non-commercial use with attribution (CC-BY-NC).
|
| 19 |
+
|
| 20 |
+
• Habitat 2.0 (H2.0): a high-performance physics-enabled 3D simulator, representing approximately 2 years of development effort and the next generation of the Habitat project [3] (Habitat 1. 0). H2.0 supports piecewise-rigid objects (e.g. door, cabinets, and drawers that can rotate about an axis or slide), articulated robots (e.g. mobile manipulators like Fetch [1], fixed-base arms like Franka [4], quadrupeds like AlienGo [5]), and rigid-body mechanics (kinematics and dynamics). The design philosophy of $\mathrm { H } 2 . 0$ is to prioritize performance (or speed) over the breadth of simulation capabilities. $\mathrm { H } 2 . 0$ by design and choice does not support non-rigid dynamics (deformables, fluids, films, cloths, ropes), physical state transformations (cutting, drilling, welding, melting), audio or tactile sensing – many of which are capabilities provided by other simulators [6–8]. The benefit of this focus is that we were able to design and optimize $\mathrm { H } 2 . 0$ to be exceedingly fast – simulating a Fetch robot interacting in ReplicaCAD scenes at 1200 steps per second (SPS), where each ‘step’ involves rendering 1 RGBD observation ( $1 2 8 \times 1 2 8$ pixels) and simulating rigid-body dynamics for $^ { 1 / 3 0 }$ sec. Thus, 30 SPS would be considered ‘real time’ and $1 2 0 0 \mathrm { S P S }$ is $4 0 \times$ real-time. $\mathrm { H } 2 . 0$ also scales well – achieving 8,200 SPS $2 7 3 \times$ real-time) multi-process on a single GPU and over 25,000 SPS ( $8 5 0 \times$ real-time) on a single node with 8 GPUs. For reference, existing simulators typically achieve 10-400 SPS (see Tab. 1). These $1 0 0 \times$ simulation-speedups correspond to cutting experimentation time from 6 months to under 2 days, unlocking experiments that were hitherto infeasible, allowing us to answer questions that were hitherto unanswerable. As we will show, they also directly translate to training-time speed-up and accuracy improvements from training agents (for object rearrangement tasks) on more experience.
|
| 21 |
+
|
| 22 |
+
• Home Assistant Benchmark (HAB): a suite of common tasks for assistive robots (TidyHouse, PrepareGroceries, SetTable) that are specific instantiations of the generalized rearrangement problem [9]. Specifically, a mobile manipulator (Fetch) is asked to rearrange a list of objects from initial to desired positions – picking/placing objects from receptacles (counter, sink, sofa, table), opening/closing containers (drawers, fridges) as necessary. We use the GeometricGoal specification prescribed by Batra et al. [9] – i.e., initial and desired 3D (center-of-mass) position of each target object $i$ to be rearranged $\left( s _ { i } ^ { 0 } , s _ { i } ^ { * } \right) _ { i = 1 } ^ { N }$ The choice of GeometricGoal is deliberate – we aim to create the PointNav [10] equivalent for mobile manipulators. As witnessed in the navigation literature, such a task becomes the testbed for exploring ideas [11–19] and a starting point for more semantic tasks [20–22]. The robot operates entirely from onboard sensing – head- and arm-mounted RGB-D cameras, proprioceptive joint-position sensors (for the arm), and egomotion sensors (for the mobile base) – and may not access any privileged state information (no prebuilt maps, no 3D models of rooms or objects, no physically-implausible sensors providing knowledge of mass, friction, articulation of containers, etc.). Notice that an object’s center-of-mass provides no information about its size or orientation. The target object may be located inside a container (drawer, fridge), on top of supporting surfaces (shelf, table, sofa) of varying heights and sizes, and surrounded by clutter; all of which must be sensed and maneuvered. Receptacles like drawers and fridges start closed, meaning that the agent must open and close articulated objects to succeed. An episode is considered successful if all target objects are placed within $\mathrm { 1 5 c m }$ of their desired positions (without considering orientation). The robot uses continuous end-effector control for the arm and velocity control for the base. We deliberately focus on gross motor control (the base and arm) and not fine motor control (the gripper), following
|
| 23 |
+
|
| 24 |
+
<table><tr><td rowspan="2"></td><td colspan="2">Rendering</td><td colspan="2">Physics</td><td rowspan="2">Scene Complexity</td><td rowspan="2">Speed (steps/sec)</td></tr><tr><td>Library</td><td>Supports</td><td>Library</td><td>Supports</td></tr><tr><td>Habitat [3]</td><td>Magnum</td><td>3D scans</td><td>none</td><td>continuous navigation (navmesh)</td><td>building-scale</td><td>3,000</td></tr><tr><td>AI2-THOR [6]</td><td>Unity</td><td>Unity</td><td>Unity</td><td>rigid dynamics,animated interactions</td><td>room-scale</td><td>30-60</td></tr><tr><td>ManipulaTHOR [33]</td><td>Unity</td><td>Unity</td><td>Unity</td><td>AI2-THOR + manipulation</td><td>room-scale</td><td>30-40</td></tr><tr><td>ThreeDWorld [7]</td><td>Unity</td><td>Unity</td><td>Unity (PhysX) + FLEX</td><td>rigid + particle dynamics</td><td>room/house-scale</td><td>5-168</td></tr><tr><td>SAPIEN [34]</td><td>OpenGL/OptiX</td><td>configurable</td><td>PhysX</td><td>rigid/articulated dynamics</td><td>object-level</td><td>200-400t</td></tr><tr><td>RLBench [35]</td><td>CoppeliaSim (OpenGL)</td><td>Gouraud shading</td><td>CoppeliaSim (Bullet/ODE)</td><td>rigid/articulated dynamics</td><td>table-top</td><td>1-60t</td></tr><tr><td>iGibson [36]</td><td>PyRender</td><td>PBR shading</td><td>PyBullet</td><td>rigid/articulated dynamics</td><td>house-scale</td><td>100</td></tr><tr><td>Habitat 2.0 (H2.0)</td><td>Magnum</td><td>3D scans + PBR shading</td><td>Bullet</td><td>rigid/articulated dynamics + navmesh</td><td>house-scale</td><td>1,200</td></tr></table>
|
| 25 |
+
|
| 26 |
+
Table 1: High-level comparison of different simulators. Note: Speeds were taken directly from respective publications or obtained via direct personal correspondence with the authors when not publicly available (indicated by †). Benchmarking was conducted by different teams on different hardware with different underlying 3D assets simulating different capabilities. Thus, these should be considered qualitative comparisons representing what a user expects to experience on a single instance of the simulator (no parallelization).
|
| 27 |
+
|
| 28 |
+
the ‘abstracted grasping’ recommendations from [9]. Specifically, once the end-effector reaches $1 5 \mathrm { c m }$ (or closer) to an object, a discrete grasp action becomes available that, if executed, snaps the object into its parallel-jaw gripper 2. We conduct a systematic study of two distinct techniques – monolithic ‘sensors-to-actions’ policies trained with reinforcement learning (RL) at scale, and classical senseplan-act pipelines (SPA) [26] – with a particular emphasis on systematic generalization to new objects, receptacles, apartment layouts (not just robot starting pose). Our findings include:
|
| 29 |
+
|
| 30 |
+
1. Flat vs hierarchical: Monolithic RL policies successfully learn diverse individual skills (pick/place, navigate, open/close drawer). However, crafting a combined reward function and learning scheme that elicits chaining of such skills for the long-horizon HAB tasks remained out of our reach. We saw significantly stronger results with a hierarchical approach that assumes knowledge of a perfect task planner (via STRIPS [27]) to break it down into a sequence of skills.
|
| 31 |
+
|
| 32 |
+
2. Hierarchy cuts both ways: However, a hierarchy with independent skills suffers from ‘hand-off problems’ where a succeeding skill isn’t set up for success by the preceding one – e.g., navigating to a bad location for subsequent manipulation, only partially opening a drawer to grab an object inside, or knocking an object out of reach that is later needed.
|
| 33 |
+
|
| 34 |
+
3. Brittleness of SensePlanAct: For simple skills, SPA performs just as well as monolithic RL. However, it is significantly more brittle since it needs to map all obstacles in the workspace for planning. More complex settings involving clutter, challenging receptacles, and imperfect navigation can poorly frame the target object and obstacles in the robot’s camera, leading to incorrect plans.
|
| 35 |
+
|
| 36 |
+
We hope our work will serve as a benchmark for many years to come. $\mathrm { H } 2 . 0$ is free, open-sourced under the MIT license, and under active development. 3 We believe it will reduce the community’s reliance on commercial lock-ins [28, 29] and non-photorealistic simulation engines [30–32].
|
| 37 |
+
|
| 38 |
+
# 2 Related Work
|
| 39 |
+
|
| 40 |
+
What is a simulator? Abstractly speaking, a simulator has two components: (1) a physics engine that evolves the world state $s$ over time $s _ { t } \to s _ { t + 1 }$ , and (2) a renderer that generates sensor observations $o$ from states: $s _ { t } \to o _ { t }$ . The boundary between the two is often blurred as a matter of convenience. Many physics engines implement minimal renderers to visualize results, and some rendering engines include integrations with a physics engine. PyBullet [37], MuJoCo [28], DART [38], ODE [39], PhysX/FleX [40, 41], and Chrono [42] are primarily physics engines with some level of rendering, while Magnum [43], ORRB [44], and PyRender [45] are primarily renderers. Game engines like Unity [46] and Unreal [47] provide tightly coupled integration of physics and rendering. Some simulators [3, 48, 49] involve largely static environments – the agent can move but not change the state of the environment (e.g. open cabinets). Thus, they are heavily invested in rendering with fairly lightweight physics (e.g. collision checking with the agent approximated as a cylinder).
|
| 41 |
+
|
| 42 |
+
How are interactive simulators built today? Either by relying on game engines [6, 50, 51] or via a ‘homebrew’ integration of existing rendering and physics libraries [7, 34, 36, 52]. Both options have problems. Game engines tend to be optimized for human needs (high image-resolution, ${ \sim } 6 0$ FPS, persistent display) not for AI’s needs [53] ( $1 0 \mathbf { k } +$ FPS, low-res, ‘headless’ deployment on a cluster). Reliance on them leads to limited control over the performance characteristics. On the other hand, they represent decades of knowledge and engineering effort whose value cannot be discounted. This is perhaps why ‘homebrew’ efforts involve a high-level (typically Python-based) integration of existing libraries. Unfortunately but understandably, this results in simulation speeds of 10-100s of SPS, which is orders of magnitude sub-optimal. $\mathrm { H } 2 . 0$ involved a deep low-level $( \mathbf { C } + + )$ integration of rendering (via Magnum [43]) and physics (via Bullet [37]), enabling precise control of scheduling and task-aware optimizations, resulting in substantial performance improvements.
|
| 43 |
+
|
| 44 |
+
Object rearrangement. Task- and motion-planning [54] and mobile manipulation have a long history in AI and robotics, whose full survey is beyond the scope of this document. Batra et al. [9] provide a good summary of the historical background of rearrangement, a review of recent efforts, a general framework, and a set of recommendations that we adopt here. Broadly speaking, our work is distinguished from prior literature by a combination of the emphasis on visual perception, lack of access to state, systematic generalization, and the experimental setup of visually-complex and ecologically-realistic home-scale environments. We now situate w.r.t. a few recent efforts. [55] study replanning in the presence of partial observability but do not consider mobile manipulation. [52] tackle ‘interactive navigation’, where the robot can bump into and push objects during navigation, but does not have an arm. Some works [56–58] abstract away gross motor control entirely by using symbolic interaction capabilities (e.g. a ‘pick up $X ^ { \prime }$ action) or a ‘magic pointer’ [9]. We use abstracted grasping but not abstract manipulation. [19] develop hierarchical methods for mobile manipulation, combining RL policies for goal-generation and motion-planning for executing them. We use the opposite combination of planning and learning – using task-planning to generate goals and RL for skills. [33] is perhaps the most similar to our work. Their task involves moving a single object from one location to another, excluding interactions with container objects (opening a drawer or fridge to place an object inside). We will see that rearrangement of multiple objects while handling containment is a much more challenging task. Interestingly, our experiments show evidence for the opposite conclusion reached therein – monolithic end-to-end trained RL methods are outperformed by a modular approach that is trained stage-wise to handle long-horizon rearrangement tasks.
|
| 45 |
+
|
| 46 |
+
# 3 Replica to ReplicaCAD: Creating Interactive Digital Twins of Real Spaces
|
| 47 |
+
|
| 48 |
+
We begin by describing our dataset that provides a rich set of indoor layouts for studying rearrangement tasks. Our starting point was Replica [2], a dataset of highly photo-realistic 3D reconstructions at room and building scale. Unfortunately, static 3D scans are unsuitable for studying rearrangement tasks because objects in a static scan cannot be moved or manipulated.
|
| 49 |
+
|
| 50 |
+

|
| 51 |
+
Figure 2: Left: The original Replica scene. Right: the artist recreated scene ReplicaCAD. All objects (furniture, mugs) including articulated ones (drawers, fridge) in ReplicaCAD are fully physically simulated and interactive.
|
| 52 |
+
|
| 53 |
+
Asset Creation. ReplicaCAD is an artist-created, fully-interactive recreation of ‘FRL-apartment’ spaces from the Replica dataset [2]. First, a team of 3D artists authored individual 3D models (geometry, textures, and material specifications) to faithfully recreate nearly all objects (furniture, kitchen utensils, books, etc.; 92 in total) in all 6 rooms from the FRL-apartment spaces as well as an accompanying static backdrop (floor and walls). Fig. 2 compares a layout of ReplicaCAD with the original Replica scan. Next, each object was prepared for rigid-body simulation by authoring physical parameters (mass, friction, restitution), collision proxy shapes, and semantic annotations. Several objects (e.g. refrigerator, kitchen counter) were made ‘articulated’ through sub-part segmentation (annotating fridge door, counter cabinet) and authoring of URDF files describing joint configurations (e.g. fridge door swings around a hinge) and dynamic properties (e.g. joint type and limits). For each large furniture object (e.g. table), we annotated surface regions (e.g. table tops) and containment volumes (e.g. drawer space) to enable programmatic placement of small objects on top of or within.
|
| 54 |
+
|
| 55 |
+
Human Layout Generation. Next, a 3D artist authored an additional 5 semantically plausible ‘macro variations’ of the scenes – producing new scene layouts consisting only of larger furniture from the same 3D object assets. Each of these macro variations was further perturbed through 20 ‘micro variations’ that re-positioned objects – e.g. swapping the locations of similarly sized tables or a sofa and two chairs. This resulted in a total of 105 scene layouts that exhibit major and minor semantically-meaningful variations in furniture placement and scene layout, enabling controlled testing of generalization. Illustrations of these variations can be found in Appendix A.
|
| 56 |
+
|
| 57 |
+
Procedural Clutter Generation. To maximize the value of the human-authored assets we also develop a pipeline that allows us to generate new clutter procedurally. Specifically, we dynamically populate the annotated supporting surfaces (e.g. table-top, shelves in a cabinet) and containment volumes (e.g. fridge interior, drawer spaces) with object instances from appropriate categories (e.g., plates, food items). These inserted objects can come from ReplicaCAD or the YCB dataset [59]. We compute physically-stable insertions of clutter offline (i.e. letting an inserted bowl ‘settle’ on a shelf) and then load these stable arrangements into the scene dynamically at run-time.
|
| 58 |
+
|
| 59 |
+
ReplicaCAD is fully integrated with the $\mathrm { H } 2 . 0$ and a supporting configuration file structure enables simple import, instancing, and programmatic alternation of any of these interactive scenes. Overall, ReplicaCAD represents $9 0 0 +$ person-hours of professional 3D artist effort so far (with augmentations in progress). It was created with the consent of and compensation to artists, and will be shared under a Creative Commons license for non-commercial use with attribution (CC-BY-NC). Further ReplicaCAD details and statistics are in Appendix A.
|
| 60 |
+
|
| 61 |
+
# 4 Habitat 2.0 (H2.0): a Lazy Simulator
|
| 62 |
+
|
| 63 |
+
$\mathrm { H } 2 . 0$ ’s design philosophy is that speed is more important than the breadth of capabilities. H2.0 achieves fast rigid-body simulation in large photo-realistic 3D scenes by being lazy and only simulating what is absolutely needed. We instantiate this principle via 3 key ideas – localized physics and rendering (Sec. 4.1), interleaved physics and rendering (Sec. 4.2), and simplify-and-reuse (Sec. B.1). We also describe motion planning integration in Appendix B.2.
|
| 64 |
+
|
| 65 |
+
# 4.1 Localized Physics and Rendering
|
| 66 |
+
|
| 67 |
+
Realistic indoor 3D scenes can span houses with multiple rooms (kitchen, living room), hundreds of objects (sofa, table, mug) and ‘containers’ (fridge, drawer, cabinet), and thousands of parts (fridge shelf, cabinet door). Simulating physics for every part at all times is slow and unnecessary. We leverage Bullet’s built-in island sleep system to minimize simulation overhead for idle objects. In addition, we make several optimizations: (1) We employ a navigation mesh to move the robot base kinematically (which has been shown to transfer well to real the world [60]) rather than simulating wheel-ground contact. (2) For multi-body articulated furniture, we remove static parts (e.g. the walls and floor of a cabinet) from the Bullet multi-body and instead load these as separate static rigid objects. This improves the sleeping behavior of the entire simulation, for example, an idle object resting on the floor of the cabinet can sleep even while the cabinet door is moving. (3) We use the sleeping state of objects to optimize rendering by caching and re-using scene graph transformation matrices and frustum-culling results.
|
| 68 |
+
|
| 69 |
+
# 4.2 Interleaved rendering and physics
|
| 70 |
+
|
| 71 |
+
Most physics engines (e.g. Bullet) run on the CPU, while rendering (e.g. via Magnum) typically occurs on the GPU. After our initial optimizations, we found each to take nearly equal compute-time. This represents a glaring inefficiency – as illustrated in Fig. 3, at any given time either the CPU is sitting idle waiting for the GPU or vice-versa. Thus, interleaving them leads to significant gains. However, this is complicated by a sequential dependency – state transitions depend on robot actions $\mathcal { T } : ( s _ { t } , a _ { t } ) s _ { t + 1 }$ , robot actions depend on the sensor observations: $\pi : o _ { t } a _ { t }$ , and observations depend on the state $\mathcal { O } : s _ { t } \to o _ { t }$ . Thus, it ostensibly appears that physics and rendering outputs $( s _ { t + 1 }$ , $o _ { t }$ ) cannot be computed in parallel from $s _ { t }$ because computation of $a _ { t }$ cannot begin till $o _ { t }$ is available. We break this sequential dependency by changing the agent policy to be $\pi ( a _ { t } \mid o _ { t - 1 } )$ instead of $\pi ( \boldsymbol { a } _ { t } | \boldsymbol { o } _ { t } )$ . Thus, our agent predicts the current action $a _ { t }$ not from the current observations $o _ { t }$ but from an observation from 1 timestep ago $o _ { t - 1 }$ , essentially ‘living in the past and acting in the future’.
|
| 72 |
+
|
| 73 |
+
This simple change means that we can generate $s _ { t + 1 }$ on the CPU at the same time as $o _ { t }$ is being generated on the GPU.
|
| 74 |
+
|
| 75 |
+
This strategy not only increases simulation throughput, but also offers two other fortuitous benefits – increased biological plausibility and improved sim2real transfer potential. The former is due to closer analogy to all sensors (biological or artificial) having a sensing latency (e.g., the human visual system has approximately $1 5 0 \mathrm { m s }$ latency [61]). The latter is due to a line of prior work [62–64] showing that introducing this latency in simulators improves the transfer of learned agents to reality.
|
| 76 |
+
|
| 77 |
+
# 4.3 Benchmarking
|
| 78 |
+
|
| 79 |
+
# Sequential
|
| 80 |
+
|
| 81 |
+

|
| 82 |
+
Figure 3: Interleaved physics and rendering. Top shows the normal sequential method of performing physics $( s _ { t } , a _ { t } ) \to s _ { t + 1 }$ then rendering $s _ { t + 1 } \to o _ { t + 1 }$ . Bottom shows $\mathrm { H } 2 . 0$ ’s interleaved physics and rendering.
|
| 83 |
+
|
| 84 |
+
We benchmark using a Fetch robot, equipped with (up to) two RGB-D cameras ( $1 2 8 \times 1 2 8$ pixels) in ReplicaCAD scenes under three scenarios: (1) Idle- $1 \times \mathrm { R G B }$ : with the robot initialized in the center of the living room somewhat far from furniture or any other object and taking random actions and equipped with a single RGB camera, (2) Idle- $2 \times \mathrm { R G B } { \cdot } \mathrm { D }$ , Idle-RGB with two RGB-D cameras, (3) Interact: with the robot initialized fairly close to the fridge and taking actions from a pre-computed trajectory that results in representative interaction with objects and equipped with two RGB-D cameras. Each simulation step consists of 1 rendering pass and 4 physics-steps, each simulating $1 / 1 2 0$ sec for a total of $1 / _ { 3 0 }$ sec. New joint position goals are set every $1 / _ { 3 0 }$ sec and a joint controller computes the joint torques to achieve the joint goals for the current joint state every $\mathbb { I } / 1 2 0$ sec. This is a fairly standard experimental configuration in robotics (with $3 0 \mathrm { F P S }$ cameras and $1 2 0 \mathrm { H z }$ control). In this setting, a simulator operating at 30 steps per (wallclock) second (SPS) corresponds to ‘real time’.
|
| 85 |
+
|
| 86 |
+
Benchmarking was done on machines with dual Intel Xeon Gold 6226R CPUs – 32 cores/64 threads (32C/64T) total – and 8 NVIDIA GeForce 2080 Ti GPUs. For single-GPU benchmarking processes are confined to 8C/16T of one CPU, simulating an 8C/16T single GPU workstation. For single-GPU multi-process benchmarking, 16 processes were used. For multi-GPU benchmarking, 64 processes were used with 8 processes assigned to each GPU. We used python-3.8 and gcc-9.3 for compiling H2.0. We report average SPS over 10 runs and a $9 5 \%$ confidence-interval computed via standard error of the mean. Note that 8 processes do not fully utilize a $2 0 8 0 \mathrm { T i }$ and thus multi-process multi-GPU performance may be better on machines with more CPU cores.
|
| 87 |
+
|
| 88 |
+
<table><tr><td></td><td colspan="7">1 Process</td><td colspan="6">1 GPU</td><td colspan="6">8 GPUs</td></tr><tr><td></td><td colspan="2">Idle 1×RGB</td><td colspan="2">Idle 2×RGB-D</td><td colspan="2">Interact 2×RGB-D</td><td colspan="2">Idle 1×RGB</td><td colspan="2">Idle 2×RGB-D</td><td colspan="2">Interact 2×RGB-D</td><td colspan="2">Idle 1×RGB</td><td colspan="2">Idle 2×RGB-D</td><td colspan="2">Interact 2×RGB-D</td></tr><tr><td>H2.0 (Full)</td><td>1191</td><td>±36</td><td>669</td><td>±13</td><td>510</td><td>±6</td><td>8186</td><td>±47</td><td>1926</td><td>±19</td><td>1660</td><td>±6</td><td>25734</td><td>±301</td><td>9542</td><td>±71</td><td>7699</td><td>±177</td></tr><tr><td>- render opts.</td><td>781</td><td>±9</td><td>364</td><td>±2</td><td>282</td><td>±2</td><td>6709</td><td>±89</td><td>1076</td><td>±6</td><td>1035</td><td>±3</td><td>18844</td><td>±285</td><td>6397</td><td>±43</td><td>5517</td><td>±31</td></tr><tr><td>- physics opts.</td><td>271</td><td>±3</td><td>252</td><td>±3</td><td>358</td><td>±6</td><td>2290</td><td>±5</td><td>1270</td><td>±30</td><td>1606</td><td>±6</td><td>7942</td><td>±50</td><td>5535</td><td>±41</td><td>6119</td><td>±51</td></tr><tr><td>- all opts.</td><td>242</td><td>±2</td><td>177</td><td>±3</td><td>224</td><td></td><td>2223</td><td>±3</td><td>814</td><td>±2</td><td>941</td><td>±2</td><td>7192</td><td>±55</td><td>3965</td><td>±30</td><td>4829</td><td>±50</td></tr></table>
|
| 89 |
+
|
| 90 |
+
Table 2: Benchmarking $\mathrm { H } 2 . 0$ performance: simulation steps per second (higher better) over 10 runs and a $9 5 \%$ confidence-interval In Idle, the agent is executing random actions but not interacting with the scene, while Interact uses a precomputed trajectory and thus results in representative interaction with objects. To put these numbers into context, see Tab. 1. Reproduce these numbers at https://aihabitat.org/docs/habitat2.
|
| 91 |
+
|
| 92 |
+
Table 2 reports benchmarking numbers for H2.0. We make a few observations. The ablations for $\mathrm { H } 2 . 0$ (denoted by ‘- render opts’, ‘-physics opts’, and ‘-all opts.’) show that principles followed in our system design lead to significant performance improvements.
|
| 93 |
+
|
| 94 |
+
Our ‘Idle- $\mathbf { \cdot l } \times \mathbf { R G B } ^ { \mathbf { \cdot } }$ setting is similar to the benchmarking setup of iGibson [36], which reports 100 SPS. In contrast, $\mathrm { H } 2 . 0$ single-process with all optimizations turned off is $240 \%$ faster (242 vs 100 SPS). H2.0 single-process with optimizations on is $\sim 1 2 0 0 \%$ faster than iGibson (1191 vs 100 SPS). The comparison to iGibson is particularly illustrative since it uses the ‘same’ physics engine (PyBullet) as $\mathrm { H } 2 . 0$ (Bullet). We can clearly see the benefit of working with the low-level $\mathrm { C } { + } { + }$ Bullet rather than PyBullet and the deep integration between rendering and physics. However, we note the comparison between the two benchmarks is not exact since the robot type, number of objects, and object assets are different. A direct comparison against other simulators is not feasible due to different capabilities, assets, hardware, and experimental settings. But a qualitative order-of-magnitude survey is illustrative – AI2-THOR [6] achieves 60/30 SPS in idle/interact, SAPIEN [34] achieves 200/400 SPS (personal communication), TDW [7] achieves 5 SPS in interact, and RLBench [35] achieves between 1 and 60 SPS depending on the sensor suite (personal communication). Finally, $\mathrm { H } 2 . 0$ scales well – achieving 8,186 SPS ( $2 7 2 \times$ real-time) multi-process on a single GPU and 25,734 SPS $8 5 0 \times$ real-time) on a single node with 8 GPUs. These $1 0 0 \times$ simulation-speedups correspond to cutting experimentation time from 6-month cycle to under 2 days. iGibson also supports multi-process parallization for speeding simulation speeds beyond the reported single process numbers in the current version of the paper [36], and we recommend following updates of their work for more details.
|
| 95 |
+
|
| 96 |
+
# 5 The Pick Task: a Base Case of Rearrangement
|
| 97 |
+
|
| 98 |
+
We first carry out systematic analyses on a relatively simple robotic manipulation task: picking up one object from a cluttered ‘receptacle’. This forms a ‘base case’ and an instructive starting point that we eventually expand to the more challenging Home Assistant Benchmark (HAB) (Sec. 6).
|
| 99 |
+
|
| 100 |
+
Task Definition: Pick $( s ^ { 0 } )$ . Fig. 4 illustrates an episode in the pick task. Our agent (a Fetch robot [1]) is spawned close to a receptacle (a table) that holds multiple objects (e.g. cracker box, bowl). The task for the robot is to pick up a target object with center-of-mass coordinates $s ^ { 0 } \in R ^ { 3 }$ (provided in robot’s coordinate system) as efficiently as possible without excessive collisions. We study systematic generalization to new clutter layout on the receptacle, to new objects, and to new receptacles. Agent embodiment and sensing. Fetch [1] is a wheeled base with a 7-DoF arm manipulator and a parallel-jaw gripper, equipped with two RGBD cameras ${ \mathrm { 9 0 ^ { \circ } F o V } } _ { : }$ , $1 2 8 \times 1 2 8$ pixels) mounted on its ‘head’ and arm.
|
| 101 |
+
|
| 102 |
+
It can sense its proprioceptive-state – arm joint angles (7- dim), end-effector position (3-dim), and base-egomotion (6-dim, also known as $\mathrm { G P S } { + }$ Compass in the navigation literature [3]). Note: the episodes in Pick are constructed such that the robot does not need to move its base. Thus, the egomotion sensor does not play a role in Pick but will be important in HAB tasks (Section 6).
|
| 103 |
+
|
| 104 |
+
Action space: gross motor control. The agent performs end-effector control at $3 0 \mathrm { H z }$ . At every step, it outputs the desired change in end-effector position $( \delta x , \delta y , \delta z )$ ; the desired end-effector position is fed into an inverse kinematics solver from PyBullet [37] to derive desired states for all joints, which are used to set the joint motor targets, achieved using PD control. The maximum endeffector displacement per step is $1 . 5 \mathrm { c m }$ , and the maximum impulse of the joint motors is 10Ns with a position gain of $\mathrm { K p } { = } 0 . 3$ . In Pick, the base is fixed but in HAB, the agent also emits linear and angular velocities for the base.
|
| 105 |
+
|
| 106 |
+

|
| 107 |
+
Figure 4: Fetch with head and arm cameras picking up a bowl from the counter.
|
| 108 |
+
|
| 109 |
+
Abstracted grasping. The agent controls the gripper by emitting a scalar. If this scalar is positive and the gripper is not currently holding an object and the end-effector is within $1 5 c m$ of an object, then the object closest to the end-effector is snapped into the parallel-jaw gripper. The grasping is perfect and objects do not slide out. If the scalar is negative and the gripper is currently holding an object, then the object currently held in the gripper is released and simulated as falling. In all other cases, nothing happens. For analysis of other action spaces see Appendix F.6.
|
| 110 |
+
|
| 111 |
+
Evaluation. An object is considered successfully picked if the arm returns to a known ‘resting position’ with the target object grasped. The agent fails if the accumulated contact force experienced by the arm/body exceeds a threshold of 5k Newtons. If the agent picks up the wrong object, the episode terminates. Once the object is grasped, the drop action is masked out meaning the agent will never release the object. The episode horizon is 200 steps.
|
| 112 |
+
|
| 113 |
+
Methods. We compare two methods representing two distinctive approaches to this problem: 1. MonolithicRL: a ‘sensors-to-actions’ policy trained end-to-end with reinforcement learning (RL). The visual input is encoded using a CNN, concatenated with embeddings of proprioceptive-sensing and goal coordinates, and fed to a recurrent actor-critic network, trained with DD-PPO [11] for 100
|
| 114 |
+
|
| 115 |
+
Million steps of experience (see Appendix C for details). This baseline translates our community’s most-successful paradigm yet from navigation to manipulation.
|
| 116 |
+
|
| 117 |
+
2. SensePlanAct (SPA) pipeline: Sensing consists of constructing an accumulative 3D point-cloud of the scene from depth sensors, which is then used for collision queries. Motion planning is done using Bidirectional RRT [65] in the arm joint configuration space (see Appendix D). The controller was described in ‘Action Space’ above and is consistent with MonolithicRL. We also create SensePlanAct-Priviledged (SPA-Priv), that uses privileged information – perfect knowledge of scene geometry (from the simulator) and a perfect controller (arm is kinematically set to desired joint poses). The purpose of this baseline is to provide an upper-bound on the performance of SPA.
|
| 118 |
+
|
| 119 |
+
Systematic Generalization. With $\mathrm { H } 2 . 0$ we can compare how learning based systems generalize compared to SPA architectures. Tab. 3 shows the results of a systematic generalization study of 4 unseen objects, 3 unseen receptacles, and 20 unseen apartment layouts (from 1 unseen ‘macro variation’ in ReplicaCAD). In training the agent sees 9 objects from the YCB dataset kitchen and food categories (chef can, cracker box, sugar box, tomato soup can, tuna fish cap, pudding box, gelatin box, potted meat can, and
|
| 120 |
+
|
| 121 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">Seen</td><td colspan="3">Unseen</td></tr><tr><td>Layouts</td><td>Objects</td><td>Receptacles</td></tr><tr><td>MonolithicRL 91.7 ±1.1</td><td></td><td>86.3 ±1.4</td><td>74.7 ±1.8</td><td>52.7 ±2.0</td></tr><tr><td>SPA</td><td>70.2 ±1.9</td><td>72.7 ±1.8</td><td>72.7 ±1.8</td><td>60.3 ±2.0</td></tr><tr><td>SPA-Priv</td><td>77.0 ±1.7</td><td>80.0±1.6</td><td>79.2 ±1.7</td><td>60.7 ±2.0</td></tr></table>
|
| 122 |
+
|
| 123 |
+
Table 3: Pick generalization analysis: success rates with mean and standard error on 600 episodes (and across 3 seeds for MonolithicRL).
|
| 124 |
+
|
| 125 |
+
bowl). During evaluation it is tested on 4 unseen objects (apple, orange, mug, sponge). Likewise, the agent is trained on the counter, sink, light table, cabinet, fridge, dark table, and sofa receptacles (view in Fig. 11) but evaluated on the unseen receptacles of tv stand, shelves, and chair (view in Fig. 12).
|
| 126 |
+
|
| 127 |
+
MonolithicRL generalizes fairly well from seen to unseen layouts $( 9 1 . 7 8 6 . 3 \%$ ), significantly outperforming SPA $( 7 2 . 7 \% )$ and even SPA-Priv $( 8 0 . 0 \% )$ . However, generalization to new objects is challenging $( 9 1 . 7 7 4 . 7 \% )$ as a result of the new visual feature distribution and new object obstacles. Generalization to new receptacles is poor $( 9 1 . 7 5 2 . 7 \% )$ ). However, the performance drop of SPA (and qualitative results) suggest that the unseen receptacles (shelf, armchair, tv stand) may be objectively more difficult to pick up objects from since the shelf and armchair are tight constrained areas whereas the majority of the training receptacles, such as counters and tables, have no such constraints (see Fig. 12). We believe the performance of MonolithicRL will improve as more receptacles 3D assets become available since the training distribution was only 4 receptacles. We cannot make any such claims for SPA.
|
| 128 |
+
|
| 129 |
+
In the supplementary we also analyze different sensor input modalities (Appendix F.1), the surprising success of “blind" policies (Appendix F.2), the effect of different camera placements (Appendix F.3), different action spaces (Appendix F.6), the effect of the time delay on performance (Appendix F.5), and qualitative evidence of self-tracking (Appendix F.4).
|
| 130 |
+
|
| 131 |
+
# 6 Home Assistant Benchmark (HAB)
|
| 132 |
+
|
| 133 |
+
We now describe our benchmark of common household assistive robotic tasks. We stress that these tasks illustrate the capabilities of $\mathrm { H } 2 . 0$ but do not delineate them – a lot more is possible but not feasible to pack into a single coherent document with clear scientific takeaways.
|
| 134 |
+
|
| 135 |
+
Task Definition. We study three (families of) long-range tasks that correspond to common activities:
|
| 136 |
+
|
| 137 |
+
1. TidyHouse: Move 5 objects from random (unimpeded) locations back to where they belong (see Fig. 19a). This task requires no opening or closing and no objects are contained.
|
| 138 |
+
|
| 139 |
+
• Start: 5 target objects objects spawned in 6 possible receptacles (excluding fridge and drawer).
|
| 140 |
+
|
| 141 |
+
• Goal: Each target object is assigned a goal in a different receptacle than the starting receptacle.
|
| 142 |
+
|
| 143 |
+
• Task length: 5000 steps.
|
| 144 |
+
|
| 145 |
+
2. PrepareGroceries: Remove 2 objects from the fridge to the counters and place one object back in the fridge (see Fig. 19b). This task requires no opening or closing and no objects are contained.
|
| 146 |
+
|
| 147 |
+
• Start: 2 target objects in the fridge and one on the left counter. The fridge is fully opened.
|
| 148 |
+
• Goal: The goal for the target objects in the fridge are on the right counter and light table. The goal for the other target object is in the fridge.
|
| 149 |
+
• Task length: 4000 steps
|
| 150 |
+
|
| 151 |
+
3. SetTable: Get a bowl from a drawer, a fruit from fridge, place the fruit in the bowl on the table (see Fig. 19c).
|
| 152 |
+
|
| 153 |
+
• Start: A target bowl object is in one of the drawers and a target fruit object in the middle fridge shelf. Both the fridge and drawer start closed.
|
| 154 |
+
• Goal: The goal for the bowl is on the light table, the goal for the fruit is on top of the bowl. Both the fridge and drawer must be closed.
|
| 155 |
+
• Task length: 4500 steps.
|
| 156 |
+
|
| 157 |
+
The list is in increasing order of complexity – from no interaction with containers (TidyHouse), to picking and placing from the fridge container (PrepareGroceries), to opening and closing containers (SetTable). Note that these descriptions are provided purely for human understanding; the robot operates entirely from a GeometricGoal specification [9] – given by the initial and desired 3D (center-of-mass) position of each target object $i$ to be moved $\left( s _ { i } ^ { 0 } , s _ { i } ^ { * } \right) _ { i = 1 } ^ { N }$ . Thus, Pick $( s _ { i } ^ { 0 } )$ is a special case where $N = 1$ and $s _ { i } ^ { * }$ is a constant (arm resting) location. For each task episode, we sample a ReplicaCAD layout with YCB [59] objects randomly placed on feasible placement regions (see procedural clutter generation in Section 3). Each task has 5 clutter objects per receptacle. Unless specified, objects are sampled from the ‘food’ and ‘kitchen’ YCB item categories in the YCB dataset.
|
| 158 |
+
|
| 159 |
+
The agent is evaluated on unseen layouts and configurations of objects, and so cannot simply memorize. We characterize task difficulty by the required number of rigid-body transitions (e.g., picking up a bowl, opening a drawer). The task evaluation, agent embodiment, sensing, and action space remain unchanged from Section 5, with the addition of base control via velocity commands. Details on episode statistics, as well as the evaluation protocols are in Appendix G.
|
| 160 |
+
|
| 161 |
+
Methods. We extend the methods from Sec. 5 to better handle the above long-horizon tasks with a high-level STRIPS planner using a parameterized set of skills: Pick, Place, Open fridge door, Close fridge door, Open drawer, Close drawer, and Navigate. The full details of the planner implementation and how methods are extended are in Appendix H. Here, we provide a brief overview.
|
| 162 |
+
|
| 163 |
+
1. MonolithicRL: Essentially unchanged from Sec. 5, with the exception of accepting a list of start and goal coordinates $\left( s _ { i } ^ { 0 } , s _ { i } ^ { * } \right) _ { i = 1 } ^ { N }$ , as opposed to just $s _ { 1 } ^ { 0 }$ .
|
| 164 |
+
|
| 165 |
+
2. TaskPlanning $^ +$ SkillsRL $\mathbf { \hat { \Pi } } \mathbf { T P } { + } \mathbf { S R L }$ ): a hierarchical approach that assumes knowledge of a perfect task planner (implemented with STRIPS [27]) and the initial object containment needed by the task planner to break down a task into a sequence of parameterized skills: Navigate, Pick, Place, Open fridge door, Close fridge door, Open drawer, Close drawer. Each skill is functionally identical to MonolithicRL in Sec. $5 -$ taking as input a single 3D position, either $s _ { i } ^ { 0 }$ or $s _ { i } ^ { * }$ . For instance, in the SetTable task, let $( a ^ { 0 } , a ^ { * } )$ and $( b ^ { 0 ^ { * } } , b ^ { * } )$ denote the start and goal positions of the apple and bowl, respectively. The task planner converts this task into:
|
| 166 |
+
|
| 167 |
+
Open Drawer Transport Bowl Close Drawer $\begin{array} { r } { \overbrace { \mathrm { ` a u r i g a t e } ( b ^ { 0 } ) } ^ { \substack { } } , \mathtt { O p e n ~ d r a w e r } ( b ^ { 0 } ) , \overbrace { \mathrm { ` e i c k } ( b ^ { 0 } ) , \mathtt { N a v i z a t e } ( b ^ { * } ) , \mathtt { P l a c e } ( b ^ { * } ) } ^ { \substack { } } , \overbrace { \mathrm { ` N a v i z a t e } ( b ^ { 0 } ) , \mathrm { C l o s s e ~ d r a w e r } ( b ^ { 0 } ) } ^ { \substack { } } , \overbrace { \mathrm { ` r a n s e ~ d r a w e r } ( b ^ { 0 } ) } ^ { \substack { } } , \overbrace { \mathrm { ` r a n s e ~ d r a w e r } ( b ^ { 0 } ) } ^ { \substack { } } , \overbrace { \mathrm { ` r a n s e ~ d r a w e r } ( b ^ { 0 } ) } ^ { \substack { } } , } \end{array}$ Navigate(a0), Open fridge door(a0) , Navigate(a⇤), Place(a⇤) , Navigate(a0), Close fridge door(a0) . {zOpen Fridge {zTransport Apple {zClose Fridge Simply listing out this sequence highlights the challenging nature of these tasks.
|
| 168 |
+
|
| 169 |
+
3. TaskPlanning $^ +$ SensePlanAct $\mathbf { \left( T P + S P A \right) }$ ): Same task planner as above, with each skill implemented via SPA from Sec. 5 except for Navigate where the same learned navigation policy from $\mathbf { T P + S P A }$ is used. $\mathbf { T P + S P A }$ -Priv is analogously defined. Crafting an SPA pipeline for opening/closing unknown articulated containers is an open unsolved problem in robotics – involving detecting and tracking articulation [66, 67] without models, constrained full-body planning [68–70] without hand engineering constraints, and designing controllers to handle continuous contact [71, 72] – making it out of scope for this work. Thus, we do not report $\mathbf { T P + S P A }$ on SetTable.
|
| 170 |
+
|
| 171 |
+
Results and Findings. Figure 5 shows progressive success rates for different methods on all tasks. Due to the difficulty of the full task, for analysis, the $\mathrm { X }$ -axis lists the sequence of agent-environment interactions (pick, place, open, close) required to accomplish the task, same as that used by the task-planner.4 The number of interactions is a proxy for task difficulty and the plot is analogous to precision-recall curves (with the ideal curve being a straight line at $100 \%$ ). Furthermore, since navigation is often executed between successive skills, we include versions of the task planning methods with an oracle navigation skill. We make the following observations (See Appendix I for skill learning curves and SPA failure statistics):
|
| 172 |
+
|
| 173 |
+

|
| 174 |
+
Figure 5: Success rates for Home Assistant Benchmark tasks. Due to the difficulty of full HAB tasks, we analyze performance as completing a part of the overall task. For the TP methods that use an explicit navigation skill, we indicate with an arrow in the interaction names where navigation occurs and include versions for learned and oracle navigation. Results are on unseen layouts with mean and standard error computed for 100 episodes.
|
| 175 |
+
|
| 176 |
+
1. MonolithicRL performs abysmally. We were able to train individual skills with RL to reasonable degrees of success (see Appendix I.2). However, crafting a combined reward function and learning scheme that elicits chaining of such skills for a long-horizon task, without any architectural inductive bias about the task structure, remained out of our reach despite prolonged effort.
|
| 177 |
+
|
| 178 |
+
2. Learning a navigation policy to chain together skills is challenging as illustrated by the performance drop between learned and oracle navigation. In navigation for the sake of navigation (PointNav [10]), the agent is provided coordinates of the reachable goal location. In navigation for manipulation (Navigate), the agent is provided coordinates of a target object’s center-of-mass but needs to navigate to an unspecified non-unique suitable location from where the object is manipulable.
|
| 179 |
+
|
| 180 |
+
3. Compounding errors hurt performance of task planning methods. Even with the relatively easier skills in TidyHouse in Figure 5a all methods with oracle navigation gradually decrease in performance as the number of required interactions increases.
|
| 181 |
+
|
| 182 |
+
4. Sense-plan-act variants scale poorly to increasing task complexity. In the easiest setting, Tidy House with oracle navigation (Figure 5a), $\mathbf { T P + S P A }$ performs better than $\mathbf { T P + S R L }$ . However, this trend is reversed with learned navigation since $\mathbf { T P + S P A }$ methods, which rely on egocentric perception for planning, are not necessarily correctly positioned to sense the workspace. In the more complex task of PrepareGroceries (Figure 5b), $\mathbf { \hat { T } P + S R L }$ outperforms $\mathbf { T P + S P A }$ both with and without oracle navigation due to the perception challenge of the tight and cluttered fridge. $\mathbf { T P + S P A }$ fails to find a goal configuration 3x more often and fails to find a plan in the allowed time $3 \mathbf { x }$ more often in PrepareGroceries than TidyHouse.
|
| 183 |
+
|
| 184 |
+
# 7 Societal Impacts, Limitations, and Conclusion
|
| 185 |
+
|
| 186 |
+
ReplicaCAD was modeled upon apartments in one country (USA). Different cultures and regions may have different layouts of furniture, types of furniture, and types of objects not represented in ReplicaCAD; and this lack of representation can have negative social implications for the assistants developed. While $\mathrm { H } 2 . 0$ is a fast simulator, we find that the performance of the overall simulation+training loop is bottlenecked by factors like synchronization of parallel environments and reloading of assets upon episode reset. An exciting and complementary future direction is holistically reorganizing the rendering+physics $\scriptstyle \mathrm { + R L }$ interplay as studied by [73–78]. As illustrated in Figure 3, there is idle GPU time when rendering is faster than physics, because inference waits for both $o _ { t }$ and $s _ { t + 1 }$ to be ready despite not needing $s _ { t + 1 }$ . This is done because existing RL training systems expect the reward $r _ { t }$ to be returned when the agent takes an action $a _ { t }$ , but $r _ { t }$ is typically a function of $s _ { t } , a _ { t }$ , and $s _ { t + 1 }$ . Reorganizing the rendering $^ +$ physic $\mathrm { \ s + R L }$ interplay is an exciting problem for future work.
|
| 187 |
+
|
| 188 |
+
We presented the ReplicaCAD dataset, the Habitat 2.0 platform and a home assistant benchmark. $\mathrm { H } 2 . 0$ is a fully interactive, high-performance 3D simulator that enables efficient experimentation involving embodied AI agents rearranging richly interactive 3D environments. Coupled with the ReplicaCAD data these improvements allow us to investigate the performance of RL policies against classical MP approaches for the suite of challenging rearrangement tasks we defined. We hope that the Habitat 2.0 platform will catalyze work on embodied AI for interactive environments.
|
| 189 |
+
|
| 190 |
+
# 8 Acknowledgements
|
| 191 |
+
|
| 192 |
+
Funding in direct support of this work: The Georgia Tech portion of this work supported by state funds from Georgia Tech (AS, ZK), NSF (DB), AFRL (DB), DARPA (DB), ONR YIPs (DB), ARO PECASE (DB), Amazon (DB). The SFU portion of this work is supported by a CIFAR AI Chair (AC), a Canada Research Chair (MS), and NSERC Discovery Grants (AC,MS). This work was also supported by FAIR (AC, EU, YZ, JT, NM, MM, DC, OM, AG, FM, WG) and Intel (VK).
|
| 193 |
+
|
| 194 |
+
Additional revenues related to this work: NSF (ZK), DARPA (ZK), ONR (ZK), NGA (ZK), Samsung (ZK), Airbus (ZK), consulting for Marble Inc (ZK), paid talk by Data Science Connect (ZK), sponsored research funding by FAIR (AC,MS).
|
| 195 |
+
|
| 196 |
+
# References
|
| 197 |
+
|
| 198 |
+
[1] Fetch robotics. Fetch. http://fetchrobotics.com/, 2020.
|
| 199 |
+
[2] Julian Straub, Thomas Whelan, Lingni Ma, Yufan Chen, Erik Wijmans, Simon Green, Jakob J Engel, Raul Mur-Artal, Carl Ren, Shobhit Verma, et al. The replica dataset: A digital replica of indoor spaces. arXiv preprint arXiv:1906.05797, 2019.
|
| 200 |
+
[3] Manolis Savva, Abhishek Kadian, Oleksandr Maksymets, Yili Zhao, Erik Wijmans, Bhavana Jain, Julian Straub, Jia Liu, Vladlen Koltun, Jitendra Malik, et al. Habitat: A Platform for Embodied AI Research. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 9339–9347, 2019.
|
| 201 |
+
[4] Franka. Franka emika specification. https://www.franka.de, 2020.
|
| 202 |
+
[5] Unitree robotics. Aliengo. https://www.unitree.com, 2020.
|
| 203 |
+
[6] Eric Kolve, Roozbeh Mottaghi, Winson Han, Eli VanderBilt, Luca Weihs, Alvaro Herrasti, Daniel Gordon, Yuke Zhu, Abhinav Gupta, and Ali Farhadi. AI2-Thor: An interactive 3D environment for visual AI. arXiv preprint arXiv:1712.05474, 2017.
|
| 204 |
+
[7] Chuang Gan, Jeremy Schwartz, Seth Alter, Martin Schrimpf, James Traer, Julian De Freitas, Jonas Kubilius, Abhishek Bhandwaldar, Nick Haber, Megumi Sano, et al. ThreeDWorld: A platform for interactive multi-modal physical simulation. arXiv preprint arXiv:2007.04954, 2020.
|
| 205 |
+
[8] Daniel Seita, Pete Florence, Jonathan Tompson, Erwin Coumans, Vikas Sindhwani, Ken Goldberg, and Andy Zeng. Learning to Rearrange Deformable Cables, Fabrics, and Bags with Goal-Conditioned Transporter Networks. In IEEE International Conference on Robotics and Automation (ICRA), 2021.
|
| 206 |
+
[9] Dhruv Batra, Angel X Chang, Sonia Chernova, Andrew J Davison, Jia Deng, Vladlen Koltun, Sergey Levine, Jitendra Malik, Igor Mordatch, Roozbeh Mottaghi, Manolis Savva, and Hao Su. Rearrangement: A challenge for embodied AI. arXiv preprint arXiv:2011.01975, 2020.
|
| 207 |
+
[10] Peter Anderson, Angel Chang, Devendra Singh Chaplot, Alexey Dosovitskiy, Saurabh Gupta, Vladlen Koltun, Jana Kosecka, Jitendra Malik, Roozbeh Mottaghi, Manolis Savva, et al. On evaluation of embodied navigation agents. arXiv preprint arXiv:1807.06757, 2018.
|
| 208 |
+
[11] Erik Wijmans, Abhishek Kadian, Ari Morcos, Stefan Lee, Irfan Essa, Devi Parikh, Manolis Savva, and Dhruv Batra. DD-PPO: Learning near-perfect pointgoal navigators from 2.5 billion frames. In International Conference on Learning Representations (ICLR), 2020.
|
| 209 |
+
[12] Erik Wijmans, Irfan Essa, and Dhruv Batra. How to train pointgoal navigation agents on a (sample and compute) budget. arXiv preprint arXiv:2012.06117, 2020.
|
| 210 |
+
[13] Joel Ye, Dhruv Batra, Erik Wijmans, and Abhishek Das. Auxiliary tasks speed up learning pointgoal navigation. arXiv preprint arXiv:2007.04561, 2020.
|
| 211 |
+
[14] Yilun Du, Chuang Gan, and Phillip Isola. Curious representation learning for embodied intelligence. arXiv preprint arXiv:2105.01060, 2021.
|
| 212 |
+
[15] Peter Karkus, Shaojun Cai, and David Hsu. Differentiable slam-net: Learning particle slam for visual navigation. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2021.
|
| 213 |
+
[16] Claudia Pérez-D’Arpino, Can Liu, Patrick Goebel, Roberto Martín-Martín, and Silvio Savarese. Robot navigation in constrained pedestrian environments using reinforcement learning. In Proceedings of IEEE International Conference on Robotics and Automation (ICRA), 2021.
|
| 214 |
+
[17] Santhosh K. Ramakrishnan, Ziad Al-Halah, and Kristen Grauman. Occupancy anticipation for efficient exploration and navigation. In ECCV, 2020.
|
| 215 |
+
[18] Somil Bansal, Varun Tolani, Saurabh Gupta, Jitendra Malik, and Claire Tomlin. Combining optimal control and learning for visual navigation in novel environments. In Conference on Robot Learning (CoRL), 2019.
|
| 216 |
+
[19] Fei Xia, Chengshu Li, Roberto Martín-Martín, Or Litany, Alexander Toshev, and Silvio Savarese. Relmogen: Leveraging motion generation in reinforcement learning for mobile manipulation. In Proceedings of IEEE International Conference on Robotics and Automation (ICRA), 2021.
|
| 217 |
+
[20] Dhruv Batra, Aaron Gokaslan, Aniruddha Kembhavi, Oleksandr Maksymets, Roozbeh Mottaghi, Manolis Savva, Alexander Toshev, and Erik Wijmans. Objectnav revisited: On evaluation of embodied agents navigating to objects. arXiv preprint arXiv:2006.13171, 2020.
|
| 218 |
+
[21] Alexander Ku, Peter Anderson, Roma Patel, Eugene Ie, and Jason Baldridge. Room-across-room: Multilingual vision-and-language navigation with dense spatiotemporal grounding. arXiv preprint arXiv:2010.07954, 2020.
|
| 219 |
+
[22] Peter Anderson, Qi Wu, Damien Teney, Jake Bruce, Mark Johnson, Niko Sünderhauf, Ian Reid, Stephen Gould, and Anton Van Den Hengel. Vision-and-language navigation: Interpreting visually-grounded navigation instructions in real environments. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3674–3683, 2018.
|
| 220 |
+
[23] Adithyavairavan Murali, Arsalan Mousavian, Clemens Eppner, Chris Paxton, and Dieter Fox. 6-dof grasping for target-driven object manipulation in clutter. In 2020 IEEE International Conference on Robotics and Automation (ICRA), pages 6232–6238. IEEE, 2020.
|
| 221 |
+
[24] Jeannette Bohg, Antonio Morales, Tamim Asfour, and Danica Kragic. Data-driven grasp synthesis—a survey. IEEE Transactions on Robotics, 30(2):289–309, 2013.
|
| 222 |
+
[25] Kaiyu Hang, Miao Li, Johannes A Stork, Yasemin Bekiroglu, Florian T Pokorny, Aude Billard, and Danica Kragic. Hierarchical fingertip space: A unified framework for grasp planning and in-hand grasp adaptation. IEEE Transactions on robotics, 32(4):960–972, 2016.
|
| 223 |
+
[26] Robin R Murphy. Introduction to AI robotics. MIT press, 2019.
|
| 224 |
+
[27] Richard E Fikes and Nils J Nilsson. Strips: A new approach to the application of theorem proving to problem solving. Artificial intelligence, 2(3-4):189–208, 1971.
|
| 225 |
+
[28] 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, pages 5026–5033. IEEE, 2012.
|
| 226 |
+
[29] Nvidia. Isaac Sim. https://developer.nvidia.com/isaac-sim, 2020.
|
| 227 |
+
[30] Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym. arXiv preprint arXiv:1606.01540, 2016.
|
| 228 |
+
[31] Marc G Bellemare, Yavar Naddaf, Joel Veness, and Michael Bowling. The arcade learning environment: An evaluation platform for general agents. Journal of Artificial Intelligence Research, 47:253–279, 2013.
|
| 229 |
+
[32] Yuval Tassa, Yotam Doron, Alistair Muldal, Tom Erez, Yazhe Li, Diego de Las Casas, David Budden, Abbas Abdolmaleki, Josh Merel, Andrew Lefrancq, et al. Deepmind control suite. arXiv preprint arXiv:1801.00690, 2018.
|
| 230 |
+
[33] Kiana Ehsani, Winson Han, Alvaro Herrasti, Eli VanderBilt, Luca Weihs, Eric Kolve, Aniruddha Kembhavi, and Roozbeh Mottaghi. ManipulaTHOR: A framework for visual object manipulation. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 2021.
|
| 231 |
+
[34] Fanbo Xiang, Yuzhe Qin, Kaichun Mo, Yikuan Xia, Hao Zhu, Fangchen Liu, Minghua Liu, Hanxiao Jiang, Yifu Yuan, He Wang, Li Yi, Angel X. Chang, Leonidas J. Guibas, and Hao Su. SAPIEN: A simulated part-based interactive environment. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2020.
|
| 232 |
+
[35] Stephen James, Zicong Ma, David Rovick Arrojo, and Andrew J Davison. Rlbench: The robot learning benchmark & learning environment. IEEE Robotics and Automation Letters, 5(2):3019–3026, 2020.
|
| 233 |
+
[36] Bokui Shen, Fei Xia, Chengshu Li, Roberto Martın-Martın, Linxi Fan, Guanzhi Wang, Shyamal Buch, Claudia D’Arpino, Sanjana Srivastava, Lyne P Tchapmi, Kent Vainio, Li Fei-Fei, and Silvio Savarese. iGibson, a simulation environment for interactive tasks in large realistic scenes. arXiv preprint, 2020.
|
| 234 |
+
[37] Erwin Coumans and Yunfei Bai. PyBullet, a Python module for physics simulation for games, robotics and machine learning. http://pybullet.org, 2016–2019.
|
| 235 |
+
[38] Jeongseok Lee, Michael X Grey, Sehoon Ha, Tobias Kunz, Sumit Jain, Yuting Ye, Siddhartha S Srinivasa, Mike Stilman, and C Karen Liu. Dart: Dynamic animation and robotics toolkit. Journal of Open Source Software, 3(22):500, 2018.
|
| 236 |
+
[39] R Smith. ODE: Open Dynamics Engine. http://www.ode.org/, 01 2009.
|
| 237 |
+
[40] Nvidia. PhysX. https://developer.nvidia.com/gameworks-physx-overview.
|
| 238 |
+
[41] Nvidia. FleX. https://developer.nvidia.com/flex, 2020.
|
| 239 |
+
[42] Hammad Mazhar, Toby Heyn, Arman Pazouki, Dan Melanz, Andrew Seidl, Aaron Bartholomew, Alessandro Tasora, and Dan Negrut. CHRONO: A parallel multi-physics library for rigid-body, flexible-body, and fluid dynamics. Mechanical Sciences, 4:49–64, 02 2013. doi: 10.5194/ms-4-49-2013. URL https://projectchrono.org/.
|
| 240 |
+
[43] Vladimír Vondruš and contributors. Magnum. https://magnum.graphics, 2020.
|
| 241 |
+
[44] Lilian Weng Maciek Chociej, Peter Welinder. Orrb: Openai remote rendering backend. In eprint arXiv, 2019. URL https://arxiv.org/abs/1906.11633.
|
| 242 |
+
[45] Matthew Matl. Pyrender. https://github.com/mmatl/pyrender, 2020.
|
| 243 |
+
[46] Unity Technologies. Unity. https://unity.com/.
|
| 244 |
+
[47] Epic Games. Unreal Engine. https://www.unrealengine.com/.
|
| 245 |
+
[48] Manolis Savva, Angel X. Chang, Alexey Dosovitskiy, Thomas Funkhouser, and Vladlen Koltun. MINOS: Multimodal indoor simulator for navigation in complex environments. arXiv:1712.03931, 2017.
|
| 246 |
+
[49] Yi Wu, Yuxin Wu, Georgia Gkioxari, and Yuandong Tian. Building generalizable agents with a realistic and rich 3d environment. arXiv preprint arXiv:1801.02209, 2018.
|
| 247 |
+
[50] Claudia Yan, Dipendra Misra, Andrew Bennnett, Aaron Walsman, Yonatan Bisk, and Yoav Artzi. Chalet: Cornell house agent learning environment. arXiv preprint arXiv:1801.07357, 2018.
|
| 248 |
+
[51] Xavier Puig, Kevin Ra, Marko Boben, Jiaman Li, Tingwu Wang, Sanja Fidler, and Antonio Torralba. VirtualHome: Simulating household activities via programs. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 8494–8502, 2018.
|
| 249 |
+
[52] Fei Xia, William B Shen, Chengshu Li, Priya Kasimbeg, Micael Edmond Tchapmi, Alexander Toshev, Roberto Martín-Martín, and Silvio Savarese. Interactive gibson benchmark: A benchmark for interactive navigation in cluttered environments. IEEE Robotics and Automation Letters, 5(2):713–720, 2020.
|
| 250 |
+
[53] HeeSun Choi, Cindy Crump, Christian Duriez, Asher Elmquist, Gregory Hager, David Han, Frank Hearl, Jessica Hodgins, Abhinandan Jain, Frederick Leve, Chen Li, Franziska Meier, Dan Negrut, Ludovic Righetti, Alberto Rodriguez, Jie Tan, and Jeff Trinkle. On the use of simulation in robotics: Opportunities, challenges, and suggestions for moving forward. Proceedings of the National Academy of Sciences, 118(1), 2021. ISSN 0027-8424. doi: 10.1073/pnas.1907856118. URL https://www.pnas.org/ content/118/1/e1907856118.
|
| 251 |
+
[54] Caelan Reed Garrett, Rohan Chitnis, Rachel Holladay, Beomjoon Kim, Tom Silver, Leslie Pack Kaelbling, and Tomás Lozano-Pérez. Integrated task and motion planning. arXiv preprint arXiv:2010.01083, 2020.
|
| 252 |
+
[55] Caelan Reed Garrett, Chris Paxton, Tomás Lozano-Pérez, Leslie Pack Kaelbling, and Dieter Fox. Online replanning in belief space for partially observable task and motion problems. In IEEE International Conference on Robotics and Automation (ICRA), 2020.
|
| 253 |
+
[56] Dipendra Misra, Andrew Bennett, Valts Blukis, Eyvind Niklasson, Max Shatkhin, and Yoav Artzi. Mapping instructions to actions in 3d environments with visual goal prediction. arXiv preprint arXiv:1809.00786, 2018.
|
| 254 |
+
[57] Mohit Shridhar, Jesse Thomason, Daniel Gordon, Yonatan Bisk, Winson Han, Roozbeh Mottaghi, Luke Zettlemoyer, and Dieter Fox. Alfred: A benchmark for interpreting grounded instructions for everyday tasks. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 10740–10749, 2020.
|
| 255 |
+
[58] Luca Weihs, Matt Deitke, Aniruddha Kembhavi, and Roozbeh Mottaghi. Visual room rearrangement. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 2021.
|
| 256 |
+
[59] Berk Calli, Arjun Singh, Aaron Walsman, Siddhartha Srinivasa, Pieter Abbeel, and Aaron M Dollar. The YCB object and model set: Towards common benchmarks for manipulation research. In 2015 international conference on advanced robotics (ICAR), pages 510–517. IEEE, 2015.
|
| 257 |
+
[60] Abhishek Kadian, Joanne Truong, Aaron Gokaslan, Alexander Clegg, Erik Wijmans, Stefan Lee, Manolis Savva, Sonia Chernova, and Dhruv Batra. Sim2real predictivity: Does evaluation in simulation predict real-world performance? IEEE Robotics and Automation Letters, 5(4):6670–6677, 2020.
|
| 258 |
+
[61] Simon Thorpe, Denis Fize, and Catherine Marlot. Speed of processing in the human visual system. nature, 381(6582):520–522, 1996.
|
| 259 |
+
[62] Sandeep Singh Sandha, Luis Garcia, Bharathan Balaji, Fatima M Anwar, and Mani Srivastava. Sim2real transfer for deep reinforcement learning with stochastic state transition delays. CoRL 2020, 2020.
|
| 260 |
+
[63] Gabriel Dulac-Arnold, Nir Levine, Daniel J. Mankowitz, Jerry Li, Cosmin Paduraru, Sven Gowal, and Todd Hester. An empirical investigation of the challenges of real-world reinforcement learning. arXiv preprint, 2020.
|
| 261 |
+
[64] Jie Tan, Tingnan Zhang, Erwin Coumans, Atil Iscen, Yunfei Bai, Danijar Hafner, Steven Bohez, and Vincent Vanhoucke. Sim-to-real: Learning agile locomotion for quadruped robots. RSS 14, 2018.
|
| 262 |
+
[65] Steven M LaValle. Planning algorithms. Cambridge university press, 2006.
|
| 263 |
+
[66] Tanner Schmidt, Richard A Newcombe, and Dieter Fox. Dart: Dense articulated real-time tracking. In Robotics: Science and Systems, volume 2. Berkeley, CA, 2014.
|
| 264 |
+
[67] Richard Sahala Hartanto, Ryoichi Ishikawa, Menandro Roxas, and Takeshi Oishi. Hand-motion-guided articulation and segmentation estimation. In 2020 29th IEEE International Conference on Robot and Human Interactive Communication (RO-MAN), pages 807–813. IEEE, 2020.
|
| 265 |
+
[68] Dmitry Berenson, Siddhartha Srinivasa, and James Kuffner. Task space regions: A framework for poseconstrained manipulation planning. The International Journal of Robotics Research, 30(12):1435–1460, 2011.
|
| 266 |
+
[69] Felix Burget, Armin Hornung, and Maren Bennewitz. Whole-body motion planning for manipulation of articulated objects. In 2013 IEEE International Conference on Robotics and Automation, pages 1656–1662. IEEE, 2013.
|
| 267 |
+
[70] Zachary Kingston, Mark Moll, and Lydia E Kavraki. Sampling-based methods for motion planning with constraints. Annual review of control, robotics, and autonomous systems, 1:159–185, 2018.
|
| 268 |
+
[71] Wim Meeussen, Melonee Wise, Stuart Glaser, Sachin Chitta, Conor McGann, Patrick Mihelich, Eitan Marder-Eppstein, Marius Muja, Victor Eruhimov, Tully Foote, et al. Autonomous door opening and plugging in with a personal robot. In 2010 IEEE International Conference on Robotics and Automation, pages 729–736. IEEE, 2010.
|
| 269 |
+
[72] Advait Jain and Charles C Kemp. Pulling open doors and drawers: Coordinating an omni-directional base and a compliant arm with equilibrium point control. In 2010 IEEE International Conference on Robotics and Automation, pages 1807–1814. IEEE, 2010.
|
| 270 |
+
[73] Steven Dalton, Iuri Frosio, and Michael Garland. Accelerating reinforcement learning through gpu atari emulation. In Conference on Neural Information Processing Systems (NeurIPS), 2020.
|
| 271 |
+
[75] Lasse Espeholt, Hubert Soyer, Remi Munos, Karen Simonyan, Vlad 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, pages 1407–1416. PMLR, 2018.
|
| 272 |
+
[76] Lasse Espeholt, Raphaël Marinier, Piotr Stanczyk, Ke Wang, and Marcin Michalski. Seed rl: Scalable and efficient deep-rl with accelerated central inference. arXiv preprint arXiv:1910.06591, 2019.
|
| 273 |
+
[77] Aleksei Petrenko, Zhehui Huang, Tushar Kumar, Gaurav Sukhatme, and Vladlen Koltun. Sample factory: Egocentric 3D control from pixels at 100000 FPS with asynchronous reinforcement learning. In International Conference on Machine Learning, pages 7652–7662. PMLR, 2020.
|
| 274 |
+
[78] Brennan Shacklett, Erik Wijmans, Aleksei Petrenko, Manolis Savva, Dhruv Batra, Vladlen Koltun, and Kayvon Fatahalian. Large batch simulation for deep reinforcement learning. In International Conference on Learning Representations (ICLR), 2021. URL https://openreview.net/forum? id=cP5IcoAkfKa.
|
| 275 |
+
[79] Binomial LLC. Basis universal. https://github.com/BinomialLLC/basis_universal, 2020.
|
| 276 |
+
[80] Ioan A Sucan, Mark Moll, and Lydia E Kavraki. The open motion planning library. IEEE Robotics & Automation Magazine, 19(4):72–82, 2012.
|
| 277 |
+
[81] John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
|
| 278 |
+
[82] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 279 |
+
[83] David Coleman, Ioan Sucan, Sachin Chitta, and Nikolaus Correll. Reducing the barrier to entry of complex robotic software: a moveit! case study. arXiv preprint arXiv:1404.3785, 2014.
|
| 280 |
+
[84] James J Kuffner and Steven M LaValle. Rrt-connect: An efficient approach to single-query path planning. In Proceedings 2000 ICRA. Millennium Conference. IEEE International Conference on Robotics and Automation. Symposia Proceedings (Cat. No. 00CH37065), volume 2, pages 995–1001. IEEE, 2000.
|
| 281 |
+
[85] Yoshiaki Kuwata, Gaston A Fiore, Justin Teo, Emilio Frazzoli, and Jonathan P How. Motion planning for urban driving using rrt. In 2008 IEEE/RSJ International Conference on Intelligent Robots and Systems, pages 1681–1686. IEEE, 2008.
|
| 282 |
+
[86] Nathan Ratliff, Matt Zucker, J Andrew Bagnell, and Siddhartha Srinivasa. Chomp: Gradient optimization techniques for efficient motion planning. In 2009 IEEE International Conference on Robotics and Automation, pages 489–494. IEEE, 2009.
|
| 283 |
+
[87] John Schulman, Yan Duan, Jonathan Ho, Alex Lee, Ibrahim Awwal, Henry Bradlow, Jia Pan, Sachin Patil, Ken Goldberg, and Pieter Abbeel. Motion planning with sequential convex optimization and convex collision checking. The International Journal of Robotics Research, 33(9):1251–1270, 2014.
|
| 284 |
+
[88] Carlos Hernandez, Mukunda Bharatheesha, Wilson Ko, Hans Gaiser, Jethro Tan, Kanter van Deurzen, Maarten de Vries, Bas Van Mil, Jeff van Egmond, Ruben Burger, et al. Team delft’s robot winner of the amazon picking challenge 2016. In Robot World Cup, pages 613–624. Springer, 2016.
|
| 285 |
+
[89] Mustafa Mukadam, Jing Dong, Xinyan Yan, Frank Dellaert, and Byron Boots. Continuous-time gaussian process motion planning via probabilistic inference. The International Journal of Robotics Research, 37 (11):1319–1340, 2018.
|
| 286 |
+
[90] Brian Ichter, James Harrison, and Marco Pavone. Learning sampling distributions for robot motion planning. In 2018 IEEE International Conference on Robotics and Automation (ICRA), pages 7087–7094. IEEE, 2018.
|
| 287 |
+
[91] Brian Hou, Sanjiban Choudhury, Gilwoo Lee, Aditya Mandalika, and Siddhartha S Srinivasa. Posterior sampling for anytime motion planning on graphs with expensive-to-evaluate edges. In 2020 IEEE International Conference on Robotics and Automation (ICRA), pages 4266–4272. IEEE, 2020.
|
| 288 |
+
[92] Fahad Islam, Chris Paxton, Clemens Eppner, Bryan Peele, Maxim Likhachev, and Dieter Fox. Alternative paths planner (app) for provably fixed-time manipulation planning in semi-structured environments. arXiv preprint arXiv:2012.14970, 2020.
|
| 289 |
+
[93] Michael Pantic, Lionel Ott, Cesar Cadena, Roland Siegwart, and Juan Nieto. Mesh manifold based riemannian motion planning for omnidirectional micro aerial vehicles. arXiv preprint arXiv:2102.10313, 2021.
|
| 290 |
+
[94] Jonathan D Gammell, Siddhartha S Srinivasa, and Timothy D Barfoot. Informed rrt\*: Optimal samplingbased path planning focused via direct sampling of an admissible ellipsoidal heuristic. In 2014 IEEE/RSJ International Conference on Intelligent Robots and Systems, pages 2997–3004. IEEE, 2014.
|
| 291 |
+
[95] Jonathan D Gammell, Siddhartha S Srinivasa, and Timothy D Barfoot. Batch informed trees (bit\*): Sampling-based optimal planning via the heuristically guided search of implicit random geometric graphs. In 2015 IEEE international conference on robotics and automation (ICRA), pages 3067–3074. IEEE, 2015.
|
| 292 |
+
[96] Daniel Kappler, Franziska Meier, Jan Issac, Jim Mainprice, Cristina Garcia Cifuentes, Manuel Wüthrich, Vincent Berenz, Stefan Schaal, Nathan Ratliff, and Jeannette Bohg. Real-time perception meets reactive motion generation. IEEE Robotics and Automation Letters, 3(3):1864–1871, 2018.
|
| 293 |
+
[97] Morgan Quigley, Ken Conley, Brian Gerkey, Josh Faust, Tully Foote, Jeremy Leibs, Rob Wheeler, and Andrew Y Ng. Ros: an open-source robot operating system. In ICRA workshop on open source software, volume 3, page 5. Kobe, Japan, 2009.
|
| 294 |
+
[98] Aleksandra Faust, Kenneth Oslund, Oscar Ramirez, Anthony Francis, Lydia Tapia, Marek Fiser, and James Davidson. Prm-rl: Long-range robotic navigation tasks by combining reinforcement learning and sampling-based planning. In 2018 IEEE International Conference on Robotics and Automation (ICRA), pages 5113–5120. IEEE, 2018.
|
| 295 |
+
[99] Mohak Bhardwaj, Byron Boots, and Mustafa Mukadam. Differentiable gaussian process motion planning. In 2020 IEEE International Conference on Robotics and Automation (ICRA), pages 10598–10604. IEEE, 2020.
|
| 296 |
+
[100] Dmitry Berenson, Siddhartha S Srinivasa, Dave Ferguson, and James J Kuffner. Manipulation planning on constraint manifolds. In 2009 IEEE international conference on robotics and automation, pages 625–632. IEEE, 2009.
|
| 297 |
+
[101] Naoki Yokoyama, Sehoon Ha, and Dhruv Batra. Success weighted by completion time: A dynamics-aware evaluation criteria for embodied navigation. arXiv preprint arXiv:2103.08022, 2021.
|
| 298 |
+
[102] Ilya Kostrikov, Denis Yarats, and Rob Fergus. Image augmentation is all you need: Regularizing deep reinforcement learning from pixels. In International Conference on Learning Representations (ICLR), 2021.
|
| 299 |
+
[103] Ramprasaath R. Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedantam, Devi Parikh, and Dhruv Batra. Grad-cam: Visual explanations from deep networks via gradient-based localization. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), 2017.
|
| 300 |
+
[104] Akanksha Atrey, Kaleigh Clary, and David Jensen. Exploratory not explanatory: Counterfactual analysis of saliency maps for deep reinforcement learning. In International Conference on Learning Representations (ICLR), 2020. URL https://openreview.net/forum?id=rkl3m1BFDB.
|
| 301 |
+
[105] Julius Adebayo, Justin Gilmer, Ian Goodfellow, Moritz Hardt, and Been Kim. Sanity checks for saliency maps. In Conference on Neural Information Processing Systems (NeurIPS), 2018.
|
| 302 |
+
|
| 303 |
+
# Checklist
|
| 304 |
+
|
| 305 |
+
1. For all authors...
|
| 306 |
+
|
| 307 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 308 |
+
(b) Did you describe the limitations of your work? [Yes] See second paragraph of Sec. 7.
|
| 309 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes] See the first paragraph of Sec. 7.
|
| 310 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 311 |
+
|
| 312 |
+
2. If you are including theoretical results...
|
| 313 |
+
|
| 314 |
+
(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]
|
| 315 |
+
|
| 316 |
+
3. If you ran experiments...
|
| 317 |
+
|
| 318 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] Code and setup instructions can be found at https://github.com/facebookresearch/habitat-lab.
|
| 319 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] All methods and training details are described in detail in Sec. H.
|
| 320 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] Results in Sec. 5 are over three random seeds and 600 episodes each. Results in Sec. F.1 and Sec. F.3 are over 10 random seeds and 500 episodes each. Finally, results in Sec. 6 are over 100 episodes.
|
| 321 |
+
(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] Compute resources for the benchmark are described in Section 4, for RL training in Appendix C.2, and for motion planning in Appendix D.
|
| 322 |
+
|
| 323 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 324 |
+
|
| 325 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] Cited [59] for use of the YCB objects.
|
| 326 |
+
(b) Did you mention the license of the assets? [Yes] ReplicaCAD is released under the Creative Commons license and $\mathrm { H } 2 . 0$ is open-sourced under the MIT license
|
| 327 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] The ReplicaCAD dataset will be made publicly available for free prior to publication under the Creative Commons license. Download instructions can be found at https://github.com/facebookresearch/habitatlab.
|
| 328 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 329 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] The released ReplicaCAD dataset includes furniture layouts and common kitchen items. There is no identifiable or offensive content.
|
| 330 |
+
|
| 331 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 332 |
+
|
| 333 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 334 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 335 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/H1egcgHtvB/H1egcgHtvB.md
ADDED
|
@@ -0,0 +1,260 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RAT-SQL: RELATION-AWARE SCHEMA ENCODING AND LINKING FOR TEXT-TO-SQL PARSERS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
When translating natural language questions into SQL queries to answer questions from a database, contemporary semantic parsing models struggle to generalize to unseen database schemas. The generalization challenge lies in (a) encoding the database relations in an accessible way for the semantic parser, and (b) modeling alignment between database columns and their mentions in a given query. We present a unified framework, based on the relation-aware self-attention mechanism, to address schema encoding, schema linking, and feature representation within a text-to-SQL encoder. On the challenging Spider dataset this framework boosts the exact match accuracy to $5 3 . 7 \%$ , compared to $4 7 . 4 \%$ for the state-of-the-art model unaugmented with BERT embeddings. In addition, we observe qualitative improvements in the model’s understanding of schema linking and alignment.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The ability to effectively query databases with natural language has the potential to unlock the power of large datasets to the vast majority of users who are not proficient in query languages. As such, a large body of research has focused on the task of translating natural language questions into queries that existing database software can execute.
|
| 12 |
+
|
| 13 |
+
The release of large annotated datasets containing questions and the corresponding database SQL queries has catalyzed progress in the field, by enabling the training of supervised learning models for the task. In contrast to prior semantic parsing datasets (Finegan-Dollak et al., 2018), new tasks such as WikiSQL (Zhong et al., 2017) and Spider (Yu et al., 2018b) pose the real-life challenge of generalization to unseen database schemas. Every query is conditioned on a multi-table database schema, and the databases do not overlap between the train and test sets.
|
| 14 |
+
|
| 15 |
+
Schema generalization is challenging for three interconnected reasons. First, any text-to-SQL semantic parsing model must encode a given schema into column and table representations suitable for decoding a SQL query that might involve any of the given columns or tables. Second, these representations should encode all the information about the schema, including its column types, foreign key relations, and primary keys used for database joins. Finally, the model must recognize natural language used to refer to database columns and tables, which might differ from the referential language seen in training. The latter challenge is known as schema linking – aligning column/table references in the question to the corresponding schema columns/tables.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: A challenging text-to-SQL task from the Spider dataset.
|
| 19 |
+
|
| 20 |
+
While the question of schema encoding has been studied in recent literature (Bogin et al., 2019b), schema linking has been relatively less explored. Consider the example in Figure 1. It illustrates the challenge of ambiguity in linking: while “model” in the question refers to car_names.model rather than model_list.model, “cars” actually refers to both cars_data and car_names (but not car_makers) for the purpose of table joining. To resolve the column/table references properly, the semantic parser must take into account both the known schema relations (e.g. foreign keys) and the question context.
|
| 21 |
+
|
| 22 |
+
Prior work (Bogin et al., 2019b) addressed the schema representation problem by encoding the directed graph of foreign key relations among the columns with a graph neural network. While effective, this approach has two important shortcomings. First, it does not contextualize schema encoding with the question, thus making it difficult for the model to reason about schema linking after both the column representations and question word representations have been built. Second, it limits information propagation during schema encoding to predefined relations in the schema such as foreign keys. The advent of self-attentional mechanisms in natural language processing (Vaswani et al., 2017) shows that global reasoning is crucial to building effective representations of relational structures. However, we would like any global reasoning to also take into account the aforementioned predefined schema relations.
|
| 23 |
+
|
| 24 |
+
In this work, we present a unified framework, called RAT-SQL,1 for encoding relational structure in the database schema and a given question. It uses relation-aware self-attention to combine global reasoning over the schema entities and question words with structured reasoning over predefined schema relations. We then apply RAT-SQL to the problems of schema encoding and schema linking. As a result, we obtain $5 3 . 7 \%$ exact match accuracy on the Spider test set. At the time of writing, this result is the state of the art among models unaugmented with pretrained BERT embeddings. In addition, we experimentally demonstrate that RAT-SQL enables the model to build more accurate internal representations of the question’s true alignment with schema columns and tables.
|
| 25 |
+
|
| 26 |
+
# 2 RELATED WORK
|
| 27 |
+
|
| 28 |
+
Semantic parsing of natural language to SQL queries recently surged in popularity thanks to the creation of two new multi-table datasets with the challenge of schema generalization – WikiSQL (Zhong et al., 2017) and Spider (Yu et al., 2018b). Schema encoding is not as challenging in WikiSQL as in Spider thanks to the lack of multi-table relations. Schema linking is relevant for both tasks but also more challenging in Spider due to the richer natural language expressiveness and less restricted SQL grammar observed in it. Indeed, the state of the art semantic parser on WikiSQL (He et al., 2019) achieves a test set accuracy of $9 1 . 8 \%$ , significantly higher than the state of the art on Spider.
|
| 29 |
+
|
| 30 |
+
The recent state-of-the-art models evaluated on Spider use various attentional architectures for question/schema encoding and AST-based structural architectures for query decoding. IRNet (Guo et al., 2019) encodes the question and schema separately with LSTM and self-attention respectively, augmenting them with custom type vectors for schema linking. They further use the AST-based decoder of Yin and Neubig (2017) to decode a query in an intermediate representation (IR) that exhibits higher-level abstraction structure than SQL. Bogin et al. (2019b) encode the schema with a graph neural network and a similar grammar-based decoder. Both approaches highlight the importance of schema encoding and schema linking, but design separate feature engineering techniques to augment word vectors (as opposed to relations between words and columns) to resolve it. In contrast, the relational framework of RAT-SQL provides a unified way to encode arbitrary relational information among the inputs.
|
| 31 |
+
|
| 32 |
+
Concurrently with this work, Bogin et al. (2019a) published Global-GNN, a different approach to schema linking for Spider which applies global reasoning between question words and schema columns/tables. Global reasoning is implemented by gating the graph neural network that computes the representation of schema elements using question token representations. This conceptually differs from RAT-SQL in two important ways: (a) question word representations influence the schema representations but not vice versa, and (b) like in other GNN-based encoding approaches, message propagation is limited to the schema-induced edges such as foreign key relations. In contrast, our relation-aware transformer mechanism allows encoding arbitrary relations between question words and schema elements explicitly, and these representations are computed jointly using self-attention.
|
| 33 |
+
|
| 34 |
+

|
| 35 |
+
Figure 2: An illustration of an example schema as a graph. We do not depict all edges and label types of Table 1 to reduce clutter.
|
| 36 |
+
|
| 37 |
+
We use the same formulation of relation-aware self-attention as Shaw et al. (2018). However, that work only applied it to sequences of words in the context of machine translation, and as such, their set of relation types only encoded the relative distance between two words. We extend their work and show that relation-aware self-attention can effectively encode more complex relationships that exist within an unordered sets of elements (in this case, columns and tables within a database schema as well as relations between the schema and the question). To the best of our knowledge, this is the first application of relation-aware self-attention to joint representation learning with both predefined and softly induced relations in the input structure.
|
| 38 |
+
|
| 39 |
+
# 3 RAT-SQL
|
| 40 |
+
|
| 41 |
+
We now describe the RAT-SQL framework and its application to the problems of schema encoding and linking. First, we formally define the text-to-SQL semantic parsing problem and its components. Then, we introduce the relation-aware self-attention mechanism, our framework for jointly encoding relational structure between the question and the schema. Finally, we present our implementation of schema linking in the RAT-SQL framework.
|
| 42 |
+
|
| 43 |
+
# 3.1 PROBLEM DEFINITION
|
| 44 |
+
|
| 45 |
+
Given a natural language question $Q$ and a schema $s = \langle \mathcal { C } , \mathcal { T } \rangle$ for a relational database, our goal is to generate the corresponding SQL $P$ . Here the question $Q = q _ { 1 } \ldots q _ { | Q | }$ is a sequence of words, and the schema consists of columns $\mathcal { C } = \{ c _ { 1 } , \ldots , c _ { | \mathcal { C } | } \}$ and tables $\mathcal { T } = \left\{ t _ { 1 } , \dots , t _ { | T | } \right\}$ . Each column name $c _ { i }$ contains words $c _ { i , 1 } , \ldots , c _ { i , \left| \boldsymbol { c } _ { i } \right| }$ and each table name $t _ { i }$ contains words $t _ { i , 1 } , \ldots , t _ { i , | t _ { i } | }$ . The desired program $P$ is represented as an abstract syntax tree $T$ in the context-free grammar of SQL.
|
| 46 |
+
|
| 47 |
+
Some columns in the schema are primary keys, used for uniquely indexing the corresponding table, and some are foreign keys, used to reference a primary key column in a different table. As described in Section 1, we would like to softly bias our schema encoding mechanism toward these predefined relations. In addition, each column has a type $\tau$ such as number or text.
|
| 48 |
+
|
| 49 |
+
Schema linking aims at finding the alignment between question words and mentioned columns or tables. It’s a crucial step for a parser to generate the right columns and tables in SQL. We model the latent alignment explicitly using an alignment matrix (Section 3.6), which is softly biased towards some string-match based relations, as inspired by Guo et al. (2019).
|
| 50 |
+
|
| 51 |
+
# 3.2 ENCODING THE SCHEMA AS A GRAPH
|
| 52 |
+
|
| 53 |
+
To support reasoning about relationships between schema elements in the encoder, we begin by representing the database schema using a directed graph $\mathcal { G }$ , where each node and edge has a label. We represent each table and column in the schema as a node in this graph, labeled with the words in the name; for columns, we prepend the type of the column to the label. For each pair of nodes $x$ and $y$ in the graph, Table 1 describes when there exists an edge from $x$ to $y$ and the label it should have. Figure 2 illustrates an example graph (although not all edges and labels are shown).
|
| 54 |
+
|
| 55 |
+

|
| 56 |
+
Figure 3: Overview of the stages of our approach.
|
| 57 |
+
|
| 58 |
+
# 3.3 INITIAL ENCODING OF THE INPUT
|
| 59 |
+
|
| 60 |
+
We now obtain an initial representation for each of the nodes in the graph, as well as for the words in the input question. For the graph nodes, we use a bidirectional LSTM (BiLSTM) over the words contained in the label. We concatenate the output of the initial and final time steps of this LSTM to form the embedding for the node. For the question, we also use a bidirectional LSTM over the words:
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\begin{array} { r l } & { c _ { i , 0 } ^ { \mathrm { f w d } } , c _ { i , 0 } ^ { \mathrm { r e v } } ) \cdot \cdot \cdot , ( c _ { i , | c _ { i } | } ^ { \mathrm { f w d } } , c _ { i , | c _ { i } | } ^ { \mathrm { r e v } } ) = \mathrm { B i L S T M } _ { \mathrm { C o h m m } } ( c _ { i } ^ { \mathrm { t p e } } , c _ { i , 1 } , \cdot \cdot , c _ { i , | c _ { i } | } ) ; \quad c _ { i } ^ { \mathrm { i n t } } = \mathrm { C o n c a t } ( c _ { i , | c _ { i } | } ^ { \mathrm { f w d } } , c _ { i , 0 } ^ { \mathrm { r e v } } ) } \\ & { ( t _ { i , 1 } ^ { \mathrm { f w d } } , t _ { i , 1 } ^ { \mathrm { r e v } } ) \cdot \cdot \cdot , ( t _ { i , | c _ { i } | } ^ { \mathrm { f w d } } , t _ { i , | i _ { i } | } ^ { \mathrm { r e v } } ) = \mathrm { B i L S T M } _ { \mathrm { T a b s } } ( t _ { i , 1 } , \cdot \cdot , t _ { i , | t _ { i } | } ) ; \quad t _ { i } ^ { \mathrm { i n t } } = \mathrm { C o n c a t } ( t _ { i , | c _ { i } | } ^ { \mathrm { f w d } } , t _ { i , 1 } ^ { \mathrm { r e v } } ) } \\ & { ( q _ { 1 } ^ { \mathrm { f w d } } , q _ { 1 } ^ { \mathrm { r e v } } ) , \cdot \cdot \cdot , ( q _ { | Q | } ^ { \mathrm { f w d } } , q _ { | Q | } ^ { \mathrm { r e v } } ) = \mathrm { B i L S T M } _ { \mathrm { Q u e s i o n } } ( q _ { 1 } , \cdot \cdot \cdot , q _ { | Q | } ) ; \quad q _ { i } ^ { \mathrm { i n t } } = \mathrm { C o n c a t } ( q _ { i } ^ { \mathrm { f w d } } , q _ { i } ^ { \mathrm { r e v } } ) } \end{array}
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
where each of the BiLSTM functions first lookup word embeddings for each of the input tokens. The LSTMs do not share any parameters.
|
| 67 |
+
|
| 68 |
+
# 3.4 RELATION-AWARE TRANSFORMER
|
| 69 |
+
|
| 70 |
+
At this point, we have representations $c _ { i } ^ { \mathrm { i n i t } } , t _ { i } ^ { \mathrm { i n i t } }$ , and $\pmb q _ { i } ^ { \mathrm { i n i t } }$ . Similar to encoders used in some previous papers, these initial representations are independent of each other (uninfluenced by which other columns or tables are present). Now, we would like to imbue these representations with the information in the schema graph. We use a form of self-attention (Vaswani et al., 2017) that is relation-aware (Shaw et al., 2018) to achieve this goal.
|
| 71 |
+
|
| 72 |
+
In one step of relation-aware self-attention, we begin with an input $_ { \textbf { \em x } }$ of $n$ elements (where $x _ { i } \in \mathbb { R } ^ { d _ { x } } .$ ) and transform each $x _ { i }$ into $y _ { i } \in \mathbb { R } ^ { d _ { x } }$ . We follow the formulation described in Shaw et al. (2018):
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\begin{array} { r l } & { e _ { i j } ^ { ( h ) } = \cfrac { x _ { i } W _ { Q } ^ { ( h ) } ( x _ { j } W _ { K } ^ { ( h ) } + r _ { i j } ^ { K } ) ^ { T } } { \sqrt { d _ { z } / H } } ; \quad \alpha _ { i j } ^ { ( h ) } = \cfrac { \exp ( e _ { i j } ^ { ( h ) } ) } { \sum _ { l = 1 } ^ { n } \exp ( e _ { i l } ^ { ( h ) } ) } } \\ & { z _ { i } ^ { ( h ) } = \displaystyle \sum _ { j = 1 } ^ { n } \alpha _ { i j } ^ { ( h ) } ( x _ { j } W _ { V } ^ { ( h ) } + r _ { i j } ^ { V } ) ; \quad z _ { i } = \mathrm { C o n c a t } ( z _ { i } ^ { ( 1 ) } , \cdots , z _ { i } ^ { ( H ) } ) } \\ & { \tilde { y } _ { i } = \mathrm { L a y e r N o r m } ( x _ { i } + z _ { i } ) ; \quad y _ { i } = \mathrm { L a y e r N o r m } ( \tilde { y } _ { i } + \mathrm { F C } ( \mathrm { R e L U } ( \mathrm { F C } ( \tilde { y } _ { i } ) ) ) } \end{array}
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
where FC is a fully-connected layer, $1 \leq h \leq H$ , and $W _ { Q } ^ { ( h ) } , W _ { K } ^ { ( h ) } , W _ { V } ^ { ( h ) } \in \mathbb { R } ^ { d _ { x } \times ( d _ { x } / H ) }$ . The $r _ { i j }$ terms encode the relationship between the two elements $x _ { i }$ and $x _ { j }$ in the input. We explain how we obtain $r _ { i j }$ in the next part.
|
| 79 |
+
|
| 80 |
+
Application Within Our Encoder At the start, we construct the input $x$ of $| c | + | t | + | q |$ elements using $c _ { i } ^ { \mathrm { i n i t } } , t _ { i } ^ { \mathrm { i n i t } }$ , and $\pmb q _ { i } ^ { \mathrm { i n i t } }$ :
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\boldsymbol { x } = ( \boldsymbol { c } _ { 1 } ^ { \mathrm { { i n i t } } } , \cdot \cdot \cdot , \boldsymbol { c } _ { | \mathcal { C } | } ^ { \mathrm { { i n i t } } } , t _ { 1 } ^ { \mathrm { { i n i t } } } , \cdot \cdot \cdot , t _ { | \mathcal { T } | } ^ { \mathrm { { i n i t } } } , \boldsymbol { q } _ { 1 } ^ { \mathrm { { i n i t } } } , \cdot \cdot \cdot , \boldsymbol { q } _ { | \mathcal { Q } | } ^ { \mathrm { { i n i t } } } ) .
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
We then apply a stack of $N$ relation-aware self-attention layers, where $N$ is a hyperparameter. The weights of the encoder layers are not tied; each layer has its own set of weights. After processing through the stack of $N$ encoder layers, we obtain
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\begin{array} { r } { ( c _ { 1 } ^ { \mathrm { f i n a l } } , \cdot \cdot \cdot , c _ { | \mathcal { C } | } ^ { \mathrm { f i n a l } } , t _ { 1 } ^ { \mathrm { f i n a l } } , \cdot \cdot \cdot , t _ { | \mathcal { T } | } ^ { \mathrm { f i n a l } } , q _ { 1 } ^ { \mathrm { f i n a l } } , \cdot \cdot \cdot , q _ { | \mathcal { Q } | } ^ { \mathrm { f i n a l } } ) = y . } \end{array}
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
Table 1: Description of edge types present in the directed graph created to represent the schema. An edge exists from source node $x \in S$ to target node $y \in S$ if the pair fulfills one of the descriptions listed in the table, with the corresponding label. Otherwise, no edge exists from $x$ to $y$ .
|
| 93 |
+
|
| 94 |
+
<table><tr><td></td><td>Type of xType of y</td><td>Edge label</td><td>Description</td></tr><tr><td rowspan="3">Column</td><td rowspan="3">Column</td><td>SAME-TABLE</td><td>x and y belong to the same table.</td></tr><tr><td>FOREIGN-KEY-COL-F</td><td>x is a foreign key for y.</td></tr><tr><td>FOREIGN-KEY-COL-R</td><td>y is a foreign key for x.</td></tr><tr><td rowspan="2">Column</td><td rowspan="2">Table</td><td>PRIMARY-KEY-F</td><td>x is the primary key of y.</td></tr><tr><td>BELONGS-TO-F</td><td>x is a column of y (but not the primary key).</td></tr><tr><td rowspan="2">Table</td><td rowspan="2">Column</td><td>PRIMARY-KEY-R</td><td>y is the primary key of x.</td></tr><tr><td>BELONGS-TO-R</td><td>y is a column of x (but not the primary key).</td></tr><tr><td rowspan="3">Table</td><td rowspan="3">Table</td><td>FOREIGN-KEY-TAB-F</td><td>Table x has a foreign key column in y.</td></tr><tr><td>FOREIGN-KEY-TAB-R</td><td>Same as above,but x and y are reversed.</td></tr><tr><td>FOREIGN-KEY-TAB-B</td><td>x and y have foreign keys in both directions.</td></tr></table>
|
| 95 |
+
|
| 96 |
+
${ \boldsymbol { c } } _ { i } ^ { \mathrm { f i n a l } } , { \boldsymbol { t } } _ { i } ^ { \mathrm { f i n a l } } ,$ $\pmb q _ { i } ^ { \mathrm { f i n a l } }$
|
| 97 |
+
|
| 98 |
+
We define a discrete set of possible relation types, and map each type to an embedding to obtain $r _ { i j } ^ { V }$ and $r _ { i j } ^ { K }$ . We need a value of $r _ { i j }$ for every pair of elements in $x$ . In the subsequent sections, we describe the set of relation types we used.
|
| 99 |
+
|
| 100 |
+
# 3.5 SCHEMA ENCODING
|
| 101 |
+
|
| 102 |
+
If $x _ { i }$ and $x _ { j }$ both correspond to nodes in $\mathcal { G }$ (i.e. each is either a column or table) with an edge from $x _ { i }$ to $x _ { j }$ , then we use the label on that edge (possibilities listed in Table 1) for $r _ { i j }$ . However, this is not sufficient to obtain $r _ { i j }$ for every pair of $i$ and $j$ . The graph $\mathcal { G }$ has no nodes corresponding to the question words, not every pair of schema nodes has an edge between them, and there is no self-edges (for when $i = j$ ). As such, we add more types beyond what is defined in Table 1:
|
| 103 |
+
|
| 104 |
+
• If $i = j$ , then COLUMN-IDENTITY or TABLE-IDENTITY.
|
| 105 |
+
• $x _ { i } \in$ question, $x _ { j } ~ \in$ question: QUESTION-DIST- $d$ , where $d = \mathrm { c l i p } ( j - i , D )$ ; $ \mathrm { c l i p } ( a , D ) =$ $\operatorname* { m a x } ( - D , \operatorname* { m i n } ( \tilde { D _ { \mathbf { \nu } } } , a ) )$ . We use $D = 2$ .
|
| 106 |
+
• $x _ { i } \in$ question, $x _ { j } \in \mathsf { c o l u m n } \cup$ table; or $x _ { i } \in$ column ∪ table, $x _ { j } \in$ question: see Section 3.6.
|
| 107 |
+
• Otherwise, one of COLUMN-COLUMN, COLUMN-TABLE, TABLE-COLUMN, or TABLE-TABLE.
|
| 108 |
+
|
| 109 |
+
# 3.6 SCHEMA LINKING
|
| 110 |
+
|
| 111 |
+
To aid the model with aligning column/table references in the question to the corresponding schema columns/tables, we furthermore define relation types which indicate when parts of the question textually match the names of the columns and tables. Specifically, for all n-grams of length 1 to 5 in the question, we determine (1) whether it exactly matches the name of a column/table (exact match); or (2) whether the n-gram is a subsequence of the name of a column/table (partial match).2
|
| 112 |
+
|
| 113 |
+
Therefore, for the case where $x _ { i } \in$ question, $x _ { j } \in$ column ∪ table; or $x _ { i } \in$ column ∪ table, $x _ { j } \in$ question, we set $r _ { i j }$ to QUESTION-COLUMN-M, QUESTION-TABLE-M, COLUMN-QUESTIONM or TABLE-QUESTION-M depending on the type of $x _ { i }$ and $x _ { j }$ . $\mathsf { M }$ is one of EXACTMATCH, PARTIALMATCH, or NOMATCH. In the end, we add $2 + 5 + ( 4 \times \mathsf { \bar { 3 } } ) + 4$ types (one term per bullet in Section 3.5) beyond the 10 in Table 1, for a total of 33 types.
|
| 114 |
+
|
| 115 |
+
Memory-Schema Alignment Matrix Our intuition suggests that the columns and tables which occur in the SQL $P$ will generally have a corresponding reference in the natural language question (for example, “cars” and “cylinders” in Figure 1). To capture this intuition in the model, we apply relation-aware attention as a pointer mechanism between every memory element in $y$ and all the columns/tables to compute explicit alignment matrices $L ^ { \mathrm { { c o l } } } \in \dot { \mathbb { R } ^ { | y | \times | C | } }$ and $L ^ { \mathrm { t a b } } \in \mathbb { R } ^ { | y | \times | T | }$ :
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
\begin{array} { r l } & { \tilde { L } _ { i , j } ^ { \mathrm { c o l } } = \frac { y _ { i } W _ { Q } ^ { \mathrm { c o l } } ( c _ { j } ^ { \mathrm { f i n a l } } W _ { K } ^ { \mathrm { c o l } } + r _ { i j } ^ { K } ) ^ { T } } { \sqrt { d _ { x } } } ; \quad L _ { i , j } ^ { \mathrm { c o l } } = \frac { \mathrm { e x p } ( \tilde { L } _ { i , j } ^ { \mathrm { c o l } } ) } { \sum _ { k = 1 } ^ { | \mathcal { C } | } \exp ( \tilde { L } _ { i , k } ^ { \mathrm { c o l } } ) } } \\ & { \tilde { L } _ { i , j } ^ { \mathrm { t a b } } = \frac { y _ { i } W _ { Q } ^ { \mathrm { t a b } } ( t _ { j } ^ { \mathrm { f i n a l } } W _ { K } ^ { \mathrm { t a b } } + r _ { i j } ^ { K } ) ^ { T } } { \sqrt { d _ { x } } } ; \quad L _ { i , j } ^ { \mathrm { t a b } } = \frac { \mathrm { e x p } ( \tilde { L } _ { i , j } ^ { \mathrm { t a b } } ) } { \sum _ { k = 1 } ^ { | \mathcal { T } | } \exp ( \tilde { L } _ { i , k } ^ { \mathrm { t a b } } ) } } \end{array}
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
The memory-schema alignment matrix is expected to resemble the real discrete alignments, therefore should respect certain constraints like sparsity. For example, the question word “model” in Figure 1 should be aligned with car_names.model rather than model_list.model or model_- list.model_id. To further bias the soft alignment towards the real discrete structures, we add an auxiliary loss to encourage sparsity of the alignment matrix. Specifically, for a column/table that is mentioned in the SQL query, we treat the model’s current belief of the best alignment as the ground truth. Then we use a cross-entropy loss, referred as alignment loss, to strengthen the model’s belief:
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
a l i g n \_ l o s s = - \frac { 1 } { | R e l ( \mathcal { C } ) | } \sum _ { \substack { j \in R e l ( \mathcal { C } ) } } \log \operatorname* { m a x } _ { i } L _ { i , j } ^ { \mathrm { c o l } } - \frac { 1 } { | R e l ( \mathcal { T } ) | } \sum _ { \substack { j \in R e l ( \mathcal { T } ) } } \log \operatorname* { m a x } _ { i } L _ { i , j } ^ { \mathrm { t a b } }
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
where $R e l ( \mathcal { C } )$ and $R e l ( \tau )$ denote the set of relevant columns and tables that appear in the SQL $P$ .
|
| 128 |
+
|
| 129 |
+
# 3.7 DECODER
|
| 130 |
+
|
| 131 |
+
Once we have obtained an encoding of the input, we used the decoder from Yin and Neubig (2017) to generate the SQL $P$ . The decoder generates $P$ as an abstract syntax tree in depth-first traversal order, by using an LSTM to output a sequence of decoder actions that (i) expand the last generated node in the tree according to the grammar, called APPLYRULE; or when necessary to complete the last node, (ii) chooses a column or table from the schema, called SELECTCOLUMN and SELECTTABLE. Formally, we have the following:
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
\operatorname* { P r } ( P \mid y ) = \prod _ { t } \operatorname* { P r } ( a _ { t } \mid a _ { < t } , y )
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
where $y$ is the final encoding of the question and schema from the previous section, and $a _ { < t }$ are all previous actions. We update the LSTM’s state in the following way: $m _ { t } , h _ { t } ~ =$ $f _ { \mathrm { L S T M } } \left( \left[ \pmb { a } _ { t - 1 } \right] \parallel \boldsymbol { z } _ { t } \parallel \boldsymbol { h } _ { p _ { t } } \parallel \pmb { a } _ { p _ { t } } \parallel \pmb { n } _ { f _ { t } } \right]$ , $\mathbf { \bar { \Gamma } } _ { m _ { t - 1 } , h _ { t - 1 } } )$ where $\mathbf { \nabla } m _ { t }$ is the LSTM cell state, $h _ { t }$ is the LSTM output at step $t$ , $\mathbf { } _ { a _ { t - 1 } }$ is the embedding of the previous action, $p _ { t }$ is the step corresponding to expanding the parent AST node of the current node, and $\boldsymbol { n } _ { f _ { t } }$ is the embedding of the current node type. We obtain ${ \boldsymbol { z } } _ { t }$ using multi-head attention (with 8 heads) on $h _ { t - 1 }$ over $y$ .
|
| 138 |
+
|
| 139 |
+
For APPLYRULE $[ R ]$ , we compute $\operatorname* { P r } ( a _ { t } = \mathrm { A P P L Y R U L E } [ R ] \mid a _ { < t } , y ) = { \mathsf { s o f t m a x } } _ { R } \left( g ( h _ { t } ) \right)$ where $g ( \cdot )$ is a 2-layer MLP with a tanh non-linearity. For SELECTCOLUMN, we compute
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
\tilde { \lambda } _ { i } = \frac { h _ { t } W _ { Q } ^ { \mathrm { s c } } ( y _ { i } W _ { K } ^ { \mathrm { s c } } ) ^ { T } } { \sqrt { d _ { x } } } ; \lambda _ { i } = \frac { \exp ( \tilde { \lambda } _ { i } ) } { \sum _ { j = 1 } ^ { | y | } \tilde { \lambda } _ { j } } ; \operatorname* { P r } ( a _ { t } = \mathrm { S E L E C T C O L U M N } [ i ] \mid a _ { < t } , y ) = \sum _ { j = 1 } ^ { | y | } \lambda _ { j } L _ { j , i } ^ { \mathrm { c o l l } } ;
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
and similarly for SELECTTABLE.
|
| 146 |
+
|
| 147 |
+
# 4 EXPERIMENTS
|
| 148 |
+
|
| 149 |
+
# 4.1 EXPERIMENTAL SETUP
|
| 150 |
+
|
| 151 |
+
We implemented our model using PyTorch (Paszke et al., 2017). During preprocessing, the input of questions, column names and table names are tokenized and lemmatized with the StandfordNLP toolkit (Manning et al., 2014). Within the encoder, we use GloVe (Pennington et al., 2014) word embeddings, held fixed in training except for the 50 most common words in the training set. All word embeddings have dimension 300. The bidirectional LSTMs have hidden size 128 per direction, and use the recurrent dropout method of Gal and Ghahramani (2016) with rate 0.2. We stack 8
|
| 152 |
+
|
| 153 |
+
Table 2: Our main results (all numbers are exact match $\%$ ).
|
| 154 |
+
|
| 155 |
+
(a) Accuracy on the Spider development and test sets, compared to the other approaches at the top of the dataset leaderboard as of Sept 24, 2019. The test set results were scored using the Spider evaluation server.
|
| 156 |
+
|
| 157 |
+
<table><tr><td>Model</td><td>Dev</td><td>Test</td></tr><tr><td>IRNet (Guo et al. (2019)) Global-GNN (Bogin et al. (2019a))</td><td>53.2 52.7</td><td>46.7 47.4</td></tr><tr><td>TPNet (anonymous) RAT-SQL (ours)</td><td>55.4 60.6</td><td>48.5 53.7</td></tr><tr><td>BERT</td><td></td><td></td></tr><tr><td>EditSQL + BERT (Zhang et al.(2019))</td><td>57.6</td><td>53.4</td></tr><tr><td>IRNet+ BERT (Guo et al. (2019))</td><td>61.9</td><td>54.7</td></tr><tr><td>GIRN+BERT (anonymous)</td><td>60.2</td><td>54.8</td></tr><tr><td>TPNet + BERT (anonymous)</td><td>63.9</td><td>55.0</td></tr></table>
|
| 158 |
+
|
| 159 |
+
(b) Accuracy on the Spider development and test sets, by difficulty as defined by $\mathrm { Y u }$ et al. (2018c).
|
| 160 |
+
|
| 161 |
+
<table><tr><td>Split</td><td>Easy</td><td>Medium</td><td>Hard</td><td>Extra Hard</td><td>All</td></tr><tr><td>Dev</td><td>80.0</td><td>61.4</td><td>50.6</td><td>40.6</td><td>60.6</td></tr><tr><td>Test</td><td>73.1</td><td>60.1</td><td>45.3</td><td>24.8</td><td>53.7</td></tr></table>
|
| 162 |
+
|
| 163 |
+
(c) Accuracy (and $\pm 9 5 \%$ confidence interval) of RATSQL ablations on the dev set. Schema linking makes a statistically significant difference $_ { \mathrm { { p < 0 . 0 0 1 } } }$ ).
|
| 164 |
+
|
| 165 |
+
<table><tr><td>Model</td><td>Accuracy</td></tr><tr><td>RAT-SQL</td><td>58.52 ± 0.84</td></tr><tr><td>RAT-SQL w/o alignment loss</td><td>58.61 ± 0.59</td></tr><tr><td>RAT-SQL w/o schema linking relations</td><td>46.16 ± 1.33</td></tr></table>
|
| 166 |
+
|
| 167 |
+
relation-aware self-attention layers on top of the bidirectional LSTMs. Within the relation-aware self-attention layers, we set $d _ { x } = d _ { z } = 2 5 6$ , $H = 8$ , and use dropout with rate 0.1. The position-wise feed-forward network has inner layer dimension 1024. Inside the decoder, we use rule embeddings of size 128, node type embeddings of size 64, and a hidden size of 512 inside the LSTM with dropout rate 0.21.
|
| 168 |
+
|
| 169 |
+
We used the Adam optimizer (Kingma and Ba, 2014) with $\beta _ { 1 } = 0 . 9$ , $\beta _ { 2 } = 0 . 9 9 9$ , and $\epsilon = 1 0 ^ { - 9 }$ , which are defaults in PyTorch. During the first warmup_ $\mathrm { \Delta } \mathrm { \cdot } t e p s = m a x \mathrm { \_ } s t e p s / 2 0$ steps of training, we linearly increase the learning rate from 0 to $7 . 4 \times 1 0 ^ { - 4 }$ . Afterwards, the learning rate is annealed to 0, with formula $\begin{array} { r } { 1 0 ^ { - 3 } ( 1 - \frac { \overline { { s t e p - w a r m u p \_ s t e p s } } } { m a x \_ s t e p s - w a r m u p \_ s t e p s } ) ^ { - 0 . 5 } \_ } \end{array}$ . For all parameters, we used the default initialization method in PyTorch. We use a batch size of 20 and train for up to 40,000 steps.
|
| 170 |
+
|
| 171 |
+
# 4.2 DATASET AND METRICS
|
| 172 |
+
|
| 173 |
+
We use the Spider dataset (Yu et al., 2018b) for all our experiments. As described by Yu et al. (2018b), the training data contains 8,659 examples, including 1,659 examples (questions and queries, with the accompanying schemas) from the Restaurants (Popescu et al., 2003; Tang and Mooney, 2000), GeoQuery (Zelle and Mooney, 1996), Scholar (Iyer et al., 2017), Academic (Li and Jagadish, 2014), Yelp and IMDB (Yaghmazadeh et al., 2017) datasets.
|
| 174 |
+
|
| 175 |
+
As Yu et al. (2018b) make the test set accessible only through an evaluation server, we perform most evaluations (other than the final accuracy measurement) using the development set. It contains 1,034 examples, with databases and schemas distinct from those in the training set. We report results using the same metrics as Yu et al. (2018a): exact match accuracy on all examples, as well as divided by difficulty levels specified in the dataset. As in previous work, these metrics do not measure the model’s performance on generating values within the queries.
|
| 176 |
+
|
| 177 |
+
# 4.3 RESULTS
|
| 178 |
+
|
| 179 |
+
In Table 2a we show accuracy on the (hidden) test set for RAT-SQL and compare to all other approaches that are at or near state-of-the-art (according to the official dataset leaderboard). RATSQL outperforms all other methods that, like RAT-SQL, are not augmented with BERT embeddings. It even comes within $1 . 3 \%$ of beating the best BERT-augmented model. Since the typical improvement achieved by BERT augmentation is about $7 \%$ for all models, we are hopeful that adding such augmentation to RAT-SQL will also lead to state-of-the-art performance among BERT models.
|
| 180 |
+
|
| 181 |
+
We also provide a breakdown of the accuracy by difficulty in Table 2b. As expected, performance drops with increasing difficulty. The overall generalization gap between development and test was strongly affected by the significant drop in accuracy $( 1 5 \% )$ on the extra hard questions.
|
| 182 |
+
|
| 183 |
+
Schema Linking Table 2c shows an ablation study without RAT-based schema linking relations. Schema linking makes a statistically significant improvement to accuracy $_ { ( \mathrm { p < 0 . 0 0 1 } ) }$ . The full model accuracy here differs from Table 2a because the latter shows the best single model from a hyper-parameter sweep (submitted for test evaluation) and the former gives the mean over ten runs.
|
| 184 |
+
|
| 185 |
+

|
| 186 |
+
Figure 4: Alignment between the question “For the cars with 4 cylinders, which model has the largest horsepower” and the database car_1 schema (columns and tables).
|
| 187 |
+
|
| 188 |
+
Alignment Recall from Section 3 that we explicitly represent the alignment between question words and table columns which is used during decoding for column selection. The existence of the alignment matrix provides a mechanism for the model to align words to columns, but the additional terms in the loss encourage it to actually act like an alignment.
|
| 189 |
+
|
| 190 |
+
In our final model, the alignment loss terms do not make a difference in overall accuracy. This is surprising to us because in earlier development, the alignment loss did improve the model (statistically significantly, from $5 3 . 0 \%$ to $5 5 . 4 \%$ ). We hypothesize that hyper-parameter tuning that caused us to increase encoding depth also eliminated the need for explicit supervision of alignment.
|
| 191 |
+
|
| 192 |
+
An accurate alignment representation has other benefits as well, such as identifying question words to copy when a constant is needed (not part of the Spider dataset evaluation). In Figure 4 we show the alignment generated by our model on an example from the development set.3 For the three key words that reference columns (“cylinders”, “model”, “horsepower”), the alignment matrix correctly identifies their corresponding column (cylinders, model, horsepower) and the table (cars_data) except it mistakenly aligns ”model” to cars_data also instead of to car_names. The word “cars” aligns to the primary key of the cars_data table.
|
| 193 |
+
|
| 194 |
+
# 5 CONCLUSION
|
| 195 |
+
|
| 196 |
+
Despite the abundance of research in semantic parsing of text to SQL, many contemporary models struggle to learn good representations for a given database schema as well as to properly link column/table references in the question. These problems are related: to encode & use columns/tables from the schema, the model must reason about their role in the context of a given question. In this work, we present a unified framework for addressing the schema encoding and linking challenges. Thanks to relation-aware self-attention, it jointly learns schema and question word representations based on their alignment with each other and predefined schema relations.
|
| 197 |
+
|
| 198 |
+
Empirically, the RAT framework allows us to gain significant state of the art improvement on textto-SQL parsing. Qualitatively, it provides a way to combine predefined hard schema relations and inferred soft self-attended relations in the same encoder architecture. We foresee this joint representation learning being beneficial in many learning tasks beyond text-to-SQL, as long as the input has predefined structure.
|
| 199 |
+
|
| 200 |
+
# REFERENCES
|
| 201 |
+
|
| 202 |
+
Ben Bogin, Matt Gardner, and Jonathan Berant. Global reasoning over database structures for text-to-sql parsing. arXiv preprint arXiv:1908.11214, 2019a.
|
| 203 |
+
|
| 204 |
+
Ben Bogin, Matt Gardner, and Jonathan Berant. Representing schema structure with graph neural networks for text-to-sql parsing. arXiv preprint arXiv:1905.06241, 2019b.
|
| 205 |
+
|
| 206 |
+
Catherine Finegan-Dollak, Jonathan K. Kummerfeld, Li Zhang, Karthik Ramanathan, Sesh Sadasivam, Rui Zhang, and Dragomir Radev. Improving Text-to-SQL Evaluation Methodology. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 351–360. Association for Computational Linguistics, 2018. URL http:// aclweb.org/anthology/P18-1033.
|
| 207 |
+
|
| 208 |
+
Yarin Gal and Zoubin Ghahramani. A Theoretically Grounded Application of Dropout in Recurrent Neural Networks. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett, editors, Advances in Neural Information Processing Systems 29, pages 1019– 1027. Curran Associates, Inc., 2016. URL http://papers.nips.cc/paper/6241- a-theoretically-grounded-application-of-dropout-in-recurrentneural-networks.pdf.
|
| 209 |
+
|
| 210 |
+
Jiaqi Guo, Zecheng Zhan, Yan Gao, Yan Xiao, Jian-Guang Lou, Ting Liu, and Dongmei Zhang. Towards complex text-to-sql in cross-domain database with intermediate representation. arXiv preprint arXiv:1905.08205, 2019.
|
| 211 |
+
|
| 212 |
+
Pengcheng He, Yi Mao, Kaushik Chakrabarti, and Weizhu Chen. X-sql: reinforce schema representation with context. arXiv preprint arXiv:1908.08113, 2019.
|
| 213 |
+
|
| 214 |
+
Srinivasan Iyer, Ioannis Konstas, Alvin Cheung, Jayant Krishnamurthy, and Luke Zettlemoyer. Learning a neural semantic parser from user feedback. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 963–973, 2017. URL http://www.aclweb.org/anthology/P17-1089.
|
| 215 |
+
|
| 216 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A Method for Stochastic Optimization. arXiv:1412.6980 [cs], December 2014. URL http://arxiv.org/abs/1412.6980.
|
| 217 |
+
|
| 218 |
+
Fei Li and H. V. Jagadish. Constructing an interactive natural language interface for relational databases. Proceedings of the VLDB Endowment, 8(1):73–84, September 2014. URL http: //dx.doi.org/10.14778/2735461.2735468.
|
| 219 |
+
|
| 220 |
+
Christopher D. Manning, Mihai Surdeanu, John Bauer, Jenny Finkel, Steven J. Bethard, and David McClosky. The Stanford CoreNLP natural language processing toolkit. In Association for Computational Linguistics (ACL) System Demonstrations, pages 55–60, 2014. URL http: //www.aclweb.org/anthology/P/P14/P14-5010.
|
| 221 |
+
|
| 222 |
+
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. October 2017. URL https://openreview.net/forum?id $=$ BJJsrmfCZ.
|
| 223 |
+
|
| 224 |
+
Jeffrey Pennington, Richard Socher, and Christopher Manning. Glove: Global vectors for word representation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1532–1543, Doha, Qatar, October 2014. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/D14-1162.
|
| 225 |
+
|
| 226 |
+
Ana-Maria Popescu, Oren Etzioni, , and Henry Kautz. Towards a theory of natural language interfaces to databases. In Proceedings of the 8th International Conference on Intelligent User Interfaces, pages 149–157, 2003. URL http://doi.acm.org/10.1145/604045.604070.
|
| 227 |
+
|
| 228 |
+
Peter Shaw, Jakob Uszkoreit, and Ashish Vaswani. Self-Attention with Relative Position Representations. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers), pages 464–468. Association for Computational Linguistics, 2018. doi: 10.18653/v1/N18-2074. URL http://aclweb.org/anthology/N18-2074.
|
| 229 |
+
|
| 230 |
+
Lappoon R. Tang and Raymond J. Mooney. Automated construction of database interfaces: Intergrating statistical and relational learning for semantic parsing. In 2000 Joint SIGDAT Conference on Empirical Methods in Natural Language Processing and Very Large Corpora, pages 133–141, 2000. URL http://www.aclweb.org/anthology/W00-1317.
|
| 231 |
+
|
| 232 |
+
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, editors, Advances in Neural Information Processing Systems 30, pages 5998–6008. Curran Associates, Inc., 2017. URL http://papers.nips.cc/paper/7181-attention-is-all-you-need.pdf.
|
| 233 |
+
|
| 234 |
+
Navid Yaghmazadeh, Yuepeng Wang, Isil Dillig, and Thomas Dillig. Sqlizer: Query synthesis from natural language. In International Conference on Object-Oriented Programming, Systems, Languages, and Applications, ACM, pages 63:1–63:26, October 2017. URL http://doi.org/ 10.1145/3133887.
|
| 235 |
+
|
| 236 |
+
Pengcheng Yin and Graham Neubig. A Syntactic Neural Model for General-Purpose Code Generation. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 440–450. Association for Computational Linguistics, 2017. doi: 10.18653/v1/P17-1041. URL http://aclweb.org/anthology/P17-1041.
|
| 237 |
+
|
| 238 |
+
Tao Yu, Michihiro Yasunaga, Kai Yang, Rui Zhang, Dongxu Wang, Zifan Li, and Dragomir Radev. SyntaxSQLNet: Syntax Tree Networks for Complex and Cross-Domain Text-to-SQL Task. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 1653–1663. Association for Computational Linguistics, 2018a. URL http://aclweb.org/ anthology/D18-1193.
|
| 239 |
+
|
| 240 |
+
Tao Yu, Rui Zhang, Kai Yang, Michihiro Yasunaga, Dongxu Wang, Zifan Li, James Ma, Irene Li, Qingning Yao, Shanelle Roman, Zilin Zhang, and Dragomir Radev. Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Task. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 3911–3921, 2018b. URL http://aclweb.org/anthology/D18-1425.
|
| 241 |
+
|
| 242 |
+
Tao Yu, Rui Zhang, Kai Yang, Michihiro Yasunaga, Dongxu Wang, Zifan Li, James Ma, Irene Li, Qingning Yao, Shanelle Roman, Zilin Zhang, and Dragomir Radev. Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Task. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 3911–3921. Association for Computational Linguistics, 2018c. URL http://aclweb. org/anthology/D18-1425.
|
| 243 |
+
|
| 244 |
+
John M. Zelle and Raymond J. Mooney. Learning to parse database queries using inductive logic programming. In Proceedings of the Thirteenth National Conference on Artificial Intelligence - Volume 2, pages 1050–1055, 1996. URL http://dl.acm.org/citation.cfm?id= 1864519.1864543.
|
| 245 |
+
|
| 246 |
+
Rui Zhang, Tao Yu, He Yang Er, Sungrok Shim, Eric Xue, Xi Victoria Lin, Tianze Shi, Caiming Xiong, Richard Socher, and Dragomir Radev. Editing-based sql query generation for cross-domain context-dependent questions. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing. Association for Computational Linguistics, 2019.
|
| 247 |
+
|
| 248 |
+
Victor Zhong, Caiming Xiong, and Richard Socher. Seq2SQL: Generating Structured Queries from Natural Language using Reinforcement Learning. arXiv:1709.00103 [cs], August 2017. URL http://arxiv.org/abs/1709.00103.
|
| 249 |
+
|
| 250 |
+
Table 3: Accuracy (exact match $\%$ ) on development set with an oracle providing correct columns and tables (Oractle cols) and/or the AST sketch structure (Oracle sketch).
|
| 251 |
+
|
| 252 |
+
<table><tr><td>Model</td><td>Accuracy</td></tr><tr><td>RAT-SQL</td><td>60.6</td></tr><tr><td>RAT-SQL + Oracle cols</td><td>67.6</td></tr><tr><td>RAT-SQL + Oracle sketch</td><td>70.9</td></tr><tr><td>RAT-SQL + Oracle sketch + Oracle cols</td><td>99.4</td></tr></table>
|
| 253 |
+
|
| 254 |
+
# A THE NEED FOR SCHEMA LINKING
|
| 255 |
+
|
| 256 |
+
One natural question is how often does the decoder fail to select the correct column, even with the schema encoding and linking improvements we have made. To answer this, we conducted an oracle experiment (see Table 3).
|
| 257 |
+
|
| 258 |
+
For ”oracle sketch”, at every grammar nonterminal the decoder is forced to make the correct choice so the final SQL sketch exactly matches that of the correct answer. The rest of the decoding proceeds as if the decoder had made the choice on its own. Similarly, ”oracle cols” forces the decoder to output the correct column or table at terminal productions.
|
| 259 |
+
|
| 260 |
+
With both oracles, we see an accuracy of $9 9 . 4 \%$ which just verifies that our grammar is sufficient to answer nearly every question in the data set. With just ”oracle sketch”, the accuracy is only $7 0 . 9 \%$ , which means $7 3 . 5 \%$ of the questions that RAT-SQL gets wrong and could get right have incorrect column or table selection. Similarly, with just ”oracle cols”, the accuracy is $6 7 . 6 \%$ , which means that $8 2 . 0 \%$ of the questions that RAT-SQL gets wrong have incorrect structure. In other words, most questions have both column and structure wrong, so both problems will continue to be important to work on for the future.
|
md/train/H1lGHsA9KX/H1lGHsA9KX.md
ADDED
|
@@ -0,0 +1,321 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# A RESIZABLE MINI-BATCH GRADIENT DESCENT BASED ON A MULTI-ARMED BANDIT
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Determining the appropriate batch size for mini-batch gradient descent is always time consuming as it often relies on grid search. This paper considers a resizable mini-batch gradient descent (RMGD) algorithm based on a multi-armed bandit that achieves performance equivalent to that of best fixed batch-size. At each epoch, the RMGD samples a batch size according to a certain probability distribution proportional to a batch being successful in reducing the loss function. Sampling from this probability provides a mechanism for exploring different batch size and exploiting batch sizes with history of success. After obtaining the validation loss at each epoch with the sampled batch size, the probability distribution is updated to incorporate the effectiveness of the sampled batch size. Experimental results show that the RMGD achieves performance better than the best performing single batch size. It is surprising that the RMGD achieves better performance than grid search. Furthermore, it attains this performance in a shorter amount of time than grid search.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Gradient descent (GD) is a common optimization algorithm for finding the minimum of the expected loss. It takes iterative steps proportional to the negative gradient of the loss function at each iteration. It is based on the observation that if the multi-variable loss functions $f ( w )$ is differentiable at point $\pmb { w }$ , then $f ( w )$ decreases fastest in the direction of the negative gradient of $f$ at $\textbf { \em w }$ , i.e., $- \nabla f ( \boldsymbol { w } )$ . The model parameters are updated iteratively in GD as follows:
|
| 12 |
+
|
| 13 |
+
$$
|
| 14 |
+
\pmb { w } _ { t + 1 } = \pmb { w } _ { t } - \eta _ { t } \pmb { g } _ { t } , \qquad \pmb { g } _ { t } = \nabla _ { \pmb { w } } f \big ( \pmb { w } _ { t } \big )
|
| 15 |
+
$$
|
| 16 |
+
|
| 17 |
+
where ${ \mathbf { } } w _ { t } , { \mathbf { } } g _ { t }$ , and $\eta _ { t }$ are the model parameters, gradients of $f$ with respect to $\pmb { w }$ , and learning rate at time $t$ respectively. For small enough $\eta _ { t }$ , ${ f ( \pmb { w } _ { t } ) \geq f ( \pmb { w } _ { t + 1 } ) }$ and ultimately the sequence of ${ \pmb w } _ { t }$ will move down toward a local minimum. For a convex loss function, GD is guaranteed to converge to a global minimum with an appropriate learning rate.
|
| 18 |
+
|
| 19 |
+
There are various issues to consider in gradient-based optimization. First, GD can be extremely slow and impractical for large dataset: gradients of all the data have to be evaluated for each iteration. With larger data size, the convergence rate, the computational cost and memory become critical, and special care is required to minimize these factors. Second, for non-convex function which is often encountered in deep learning, GD can get stuck in a local minimum without the hope of escaping. Third, stochastic gradient descent (SGD), which is based on the gradient of a single training sample, has large gradient variance, and it requires a large number of iterations. This ultimately translates to slow convergence. Mini-batch gradient descent (MGD), which is based on the gradient over a small batch of training data, trades off between the robustness of SGD and the stability of GD. There are three advantages for using MGD over GD and SGD: 1) The batching allows both the efficiency of memory usage and implementations; 2) The model update frequency is higher than GD which allows for a more robust convergence avoiding local minimum; 3) MGD requires less iteration per epoch and provides a more stable update than SGD. For these reasons, MGD has been a popular algorithm for machine learning. However, selecting an appropriate batch size is difficult. Various studies suggest that there is a close link between performance and batch size used in MGD Breuel (2015); Keskar et al. (2016); Wilson & Martinez (2003).
|
| 20 |
+
|
| 21 |
+
There are various guidelines for selecting a batch size but have not been completely practical Bengio (2012). Grid search is a popular method but it comes at the expense of search time. There are a small number of adaptive MGD algorithms to replace grid search Byrd et al. (2012); De et al. (2016); Friedlander & Schmidt (2012). These algorithms increase the batch size gradually according to their own criterion. However, these algorithms are based on convex loss function and hard to be applied to deep learning. For non-convex optimization, it is difficult to determine the optimal batch size for best performance.
|
| 22 |
+
|
| 23 |
+
This paper considers a resizable mini-batch gradient descent (RMGD) algorithm based on a multi-armed bandit for achieving best performance in grid search by selecting an appropriate batch size at each epoch with a probability defined as a function of its previous success/failure. At each epoch, RMGD samples a batch size from its probability distribution, then uses the selected batch size for mini-batch gradient descent. After obtaining the validation loss at each epoch, the probability distribution is updated to incorporate the effectiveness of the sampled batch size. The benefit of RMGD is that it avoids the need for cumbersome grid search to achieve best performance and that it is simple enough to apply to any optimization algorithm using MGD. The detailed algorithm of RMGD are described in Section 4, and experimental results are presented in Section 5.
|
| 24 |
+
|
| 25 |
+
# 2 RELATED WORKS
|
| 26 |
+
|
| 27 |
+
There are only a few published results on the topic of batch size. It was empirically shown that SGD converged faster than GD on a large speech recognition database Wilson & Martinez (2003). It was determined that the range of learning rate resulting in low test errors was considerably getting smaller as the batch size increased on convolutional neural networks and that small batch size yielded the best test error, while large batch size could not yield comparable low error rate Breuel (2015). It was observed that larger batch size are more liable to converge to a sharp local minimum thus leading to poor generalization Keskar et al. (2016). It was found that the learning rate and the batch size controlled the trade-off between the depth and width of the minima in MGD Jastrzkebski et al. (2017).
|
| 28 |
+
|
| 29 |
+
A small number of adaptive MGD algorithms have been proposed. Byrd et al. (2012) introduced a methodology for using varying sample size in MGD. A relatively small batch size is chosen at the start, then the algorithm chooses a larger batch size when the optimization step does not produce improvement in the target objective function. They assumed that using a small batch size allowed rapid progress in the early stages, while a larger batch size yielded high accuracy. However, this assumption did not corresponded with later researches that reported the degradation of performance with large batch size Breuel (2015); Keskar et al. (2016); Mishkin et al. (2017). Another similar adaptive algorithm, which increases the batch size gradually as the iteration proceeded, was done by Friedlander & Schmidt (2012). The algorithm uses relatively few samples to approximate the gradient, and gradually increase the number of samples with a constant learning rate. It was observed that increasing the batch size is more effective than decaying the learning rate for reducing the number of iterations Smith et al. (2017). However, these increasing batch size algorithms lack flexibility since it is unidirectional. Balles et al. (2017) proposed a dynamic batch size adaptation algorithm. It estimates the variance of the stochastic gradients and adapts the batch size to decrease the variance. However, this algorithm needs to find the gradient variance and its computation depends on the number of model parameters.
|
| 30 |
+
|
| 31 |
+
Batch size can also be considered as a hyperparameter, and there have been some proposals based on bandit-based hyperparameter (but not batch size) optimization which maybe applicable for determining the best fixed batch size. Jamieson & Talwalkar (2016) introduced a successive halving algorithm. This algorithm uniformly allocates a budget to a set of hyperparameter configurations, evaluates the performance of all configurations, and throws out the worst half until one configuration remains. Li et al. (2017) introduced a novel bandit-based hyperparameter optimization algorithm referred as HYPERBAND. This algorithm considers the optimization problem as a resource allocation problem. The two algorithms mentioned above are not adaptive, and for searching a small hyperparameter space, the two algorithms will not be very effective. The experimental results in this paper show that adaptive MGD tends to perform better than fixed MGD.
|
| 32 |
+
|
| 33 |
+

|
| 34 |
+
Figure 1: An overall framework of considered resizable mini-batch gradient descent algorithm (RMGD). The RMGD samples a batch size from a probability distribution, and parameters are updated by mini-batch gradient using the selected batch size. Then the probability distribution is updated by checking the validation loss.
|
| 35 |
+
|
| 36 |
+
# 3 SETUP
|
| 37 |
+
|
| 38 |
+
Let $\boldsymbol { B } = \{ b _ { k } \} _ { k = 1 } ^ { K }$ be the set of possible batch size and $\pmb { \pi } = \{ \pi ^ { k } \} _ { k = 1 } ^ { K }$ be the probability distribution of batch size where $b _ { k } , \pi ^ { k }$ , and $K$ are the $k ^ { \mathrm { t h } }$ batch size, the probability of $b _ { k }$ to be selected, and number of batch sizes respectively. This paper considers algorithm for multi-armed bandit over $\boldsymbol { B }$ according to Algorithm 1. Let $\mathbf { \boldsymbol { w } } _ { \tau } \in \mathcal { W }$ be the model parameters at epoch $\tau$ , and $\tilde { \mathbf { \ b { w } } } _ { t }$ be the temporal parameters at sub iteration $t$ . Let $J : \mathcal { W } \mathbb { R }$ be the training loss function and let $\mathbf { \delta } \mathbf { \mathbf { { g } } } = \nabla J ( \mathbf { \delta } \mathbf { \mathbf { { w } } } )$ be the gradients of training loss function with respect to the model parameters. $\eta _ { \tau }$ is the learning rate at epoch $\tau$ . Let $\ell : \mathcal { W } \to \mathbb { R }$ be the validation loss function, and $y ^ { k } \in \{ 0 , \dot { 1 } \}$ be the cost of choosing the batch size $b _ { k }$ . In here, $y ^ { k } = 0$ if the validation loss decreases by the selected batch size $b _ { k }$ (well-updating) and $y ^ { k } = 1$ otherwise (misupdating). The aim of the algorithm is to have low misupdating. For the cost function $y ^ { k }$ , graduated losses such as hinge loss and percentage of nonnegative changes in validation loss can be variations of 0-1 loss. However, there are no differences in regret bound among them in this setting and it is experimentally confirmed that there are little performance gaps among them. Therefore, this paper introduces the 0-1 loss, which is simple and basic.
|
| 39 |
+
|
| 40 |
+
# 4 RESIZABLE MINI-BATCH GRADIENT DESCENT
|
| 41 |
+
|
| 42 |
+
The resizable mini-batch gradient descent (RMGD) sets the batch sizes as multi arms, and at each epoch it samples one of the batch sizes from probability distribution. Then, it suffers a cost of selecting this batch size. Using the cost, probability distribution is updated.
|
| 43 |
+
|
| 44 |
+
# 4.1 ALGORITHMS
|
| 45 |
+
|
| 46 |
+
The overall framework of the RMGD algorithm is shown in Figure 1. The RMGD consists of two components: batch size selector and parameter optimizer. The selector samples a batch size from probability distribution and updates the distribution. The optimizer is usual mini-batch gradient.
|
| 47 |
+
|
| 48 |
+
Selector samples a batch size $b _ { k _ { \tau } } \in B$ from the probability distribution $\pi _ { \tau }$ at each epoch $\tau$ where $k _ { \tau }$ is selected index. Here $b _ { k }$ is associated with probability $\pi ^ { k }$ . The selected batch size $b _ { k _ { \tau } }$ is applied to optimizer for MGD at each epoch, and the selector gets cost $y ^ { k _ { \tau } }$ from optimizer. Then, the selector
|
| 49 |
+
|
| 50 |
+
# Algorithm 1 Resizable Mini-batch Gradient Descent
|
| 51 |
+
|
| 52 |
+
#
|
| 53 |
+
|
| 54 |
+
$\begin{array} { r } { B = \{ b _ { k } \} _ { k = 1 } ^ { K } : } \end{array}$ Set of batch sizes $\pi _ { 0 } = \{ 1 / K , \ldots , 1 / K \}$ : Prior probability distribution
|
| 55 |
+
|
| 56 |
+
# Procedure:
|
| 57 |
+
|
| 58 |
+
1: Initialize model parameters $\pmb { w } _ { 0 }$
|
| 59 |
+
2: for epoch $\tau = 0 , 1 , 2 , \dots$
|
| 60 |
+
3: Select batch size $b _ { k _ { \tau } } \in B$ from $\pi _ { \tau }$
|
| 61 |
+
4: Set temporal parameters $\tilde { \mathbf { { w } } } _ { 0 } = \mathbf { w } _ { \tau }$
|
| 62 |
+
5: for $t = 0 , 1 , \ldots , T - 1$ where $T = \lceil m / b _ { k _ { \tau } } \rceil$
|
| 63 |
+
6: Compute gradient $\pmb { g } _ { t } = \nabla J ( \tilde { \pmb { w } } _ { t } )$
|
| 64 |
+
7: Update $\tilde { \pmb { w } } _ { t + 1 } = \tilde { \pmb { w } } _ { t } - \eta _ { \tau } \pmb { g } _ { t }$
|
| 65 |
+
8: end for
|
| 66 |
+
9: Update ${ \pmb w } _ { \tau + 1 } = \tilde { { \pmb w } } _ { T }$
|
| 67 |
+
10: Observe validation loss $\ell ( w _ { \tau + 1 } )$
|
| 68 |
+
11: if $\ell ( \pmb { w } _ { \tau + 1 } ) < \ell ( \pmb { w } _ { \tau } )$
|
| 69 |
+
12: Get cost $y ^ { k _ { \tau } } = 0$
|
| 70 |
+
13: else
|
| 71 |
+
14: Get cost $y ^ { k _ { \tau } } = 1$
|
| 72 |
+
15: end if
|
| 73 |
+
16: for $i = 1 , 2 , \dots , K$
|
| 74 |
+
17: if $i = k _ { \tau }$
|
| 75 |
+
18: Set temporal probability π˜i = πi e−βykτ /πiτ
|
| 76 |
+
19: else
|
| 77 |
+
20: Set temporal probability $\tilde { \pi } ^ { i } = \pi _ { \tau } ^ { i }$
|
| 78 |
+
21: end if
|
| 79 |
+
22: end for
|
| 80 |
+
23: Update $\begin{array} { r } { \forall i \in [ K ] , \pi _ { \tau + 1 } ^ { i } = \tilde { \pi } ^ { i } / \sum _ { j } \tilde { \pi } ^ { j } } \end{array}$
|
| 81 |
+
24: end for
|
| 82 |
+
|
| 83 |
+
updates probabilities by randomized weighted majority,
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\begin{array} { r l } { \mathrm { f o r } i = k _ { \tau } , } & { \tilde { \pi } ^ { i } = \pi _ { \tau } ^ { i } e ^ { - \beta y ^ { k _ { \tau } } / \pi _ { \tau } ^ { i } } } \\ { \mathrm { f o r } i \neq k _ { \tau } , } & { \tilde { \pi } ^ { i } = \pi _ { \tau } ^ { i } } \\ { \forall i , } & { \pi _ { \tau + 1 } ^ { i } = \tilde { \pi } ^ { i } / \sum _ { j } \tilde { \pi } ^ { j } } \end{array}
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
where $\beta \in ( 0 , 1 )$ is positive hyperparameter. When $\tau = 0$ , $\pi _ { \tau } = \{ 1 / K , \ldots , 1 / K \}$
|
| 90 |
+
|
| 91 |
+
Optimizer updates the model parameters $\pmb { w }$ . For each epoch, temporal parameters $\tilde { \pmb { w } } _ { 0 }$ is set to ${ \pmb w } _ { \tau }$ , and MGD iterates $T = \bar { \lceil m \ / } ^ { } / b _ { k _ { \tau } } \rceil ^ { 1 }$ times using the selected batch size $b _ { k _ { \tau } }$ where $m$ is the total number of training samples:
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\pmb { \tilde { w } } _ { t + 1 } = \pmb { \tilde { w } } _ { t } - \eta _ { \tau } \pmb { g } _ { t } , \quad \pmb { g } _ { t } = \nabla J \big ( \pmb { \tilde { w } } _ { t } \big ) .
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
After $T$ iterations at epoch $\tau$ , the model parameters is updated as ${ \pmb w } _ { \tau + 1 } = \tilde { { \pmb w } } _ { T }$ . Then, the optimizer obtains validation loss $\ell$ , and outputs cost as follows:
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
y ^ { k _ { \tau } } = \left\{ \begin{array} { l l } { 0 } & { \mathrm { i f ~ } \ell ( { \pmb w } _ { \tau + 1 } ) < \ell ( { \pmb w } _ { \tau } ) } \\ { 1 } & { \mathrm { o t h e r w i s e } } \end{array} \right. .
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
The RMGD samples an appropriate batch size from a probability distribution at each epoch. This probability distribution encourages exploration of different batch size and then later exploits batch size with history of success, which means decreasing validation loss. Figure 2 shows an example of training progress of RMGD. The figure represents the probability distribution with respect to epoch. The white dot represents the selected batch size at each epoch. In the early stage of training, commonly, all batch sizes tend to decrease validation loss: $\pi$ is uniform. Thus, all batch size have equal probability of being sampled (exploration). In the later stages of training, the probability distribution varies based on success and failure. Thus, better performing batch size gets higher probability to be sampled (exploitation). In this case, 256 is the best performing batch size.
|
| 104 |
+
|
| 105 |
+

|
| 106 |
+
Figure 2: The probability distribution vs epoch using the RMGD. (top) The early stages of the training. (bottom) The later stages of the training. The white dot represents the selected batch size at each epoch. In the early stages of the training, RMGD updates the probabilities to search various batch sizes (exploration), and in the later stages, RMGD increases the probability of successful batch size (exploitation).
|
| 107 |
+
|
| 108 |
+
# 4.2 REGRET BOUND
|
| 109 |
+
|
| 110 |
+
The regret bound of the RMGD follows the regret bound derived in Shalev-Shwartz et al. (2012). The goal of this algorithm is to have low regret for not selecting the best performing batch size such that
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
\mathrm { R e g r e t } _ { \mathcal T } ( S ) = \mathbb { E } \left[ \sum _ { \tau = 1 } ^ { \mathcal T } y _ { \tau } ^ { k _ { \tau } } \right] - \operatorname* { m i n } _ { i } \sum _ { \tau = 1 } ^ { \mathcal T } y _ { \tau } ^ { i }
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
where the expectation is over the algorithm’s randomness of batch size selection and the second term on the right-hand side is the cumulative sum of the cost by the best fixed batch size which minimizes the cumulative sum of the cost. The regret of the RMGD is bounded,
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\mathbb { E } \left[ \sum _ { \tau = 1 } ^ { \mathcal { T } } y _ { \tau } ^ { k _ { \tau } } \right] - \operatorname* { m i n } _ { i } \sum _ { \tau = 1 } ^ { \mathcal { T } } y _ { \tau } ^ { i } \leq \frac { \log K } { \beta } + \beta K \mathcal { T } .
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
In particular, setting $\beta = \sqrt { \log ( K ) / ( K T ) }$ , the regret is bounded by $2 \sqrt { K \log ( K ) \mathcal { T } }$ , which is sublinear with $\tau$ . The detailed derivation of regret bound is described in the appendix A.
|
| 123 |
+
|
| 124 |
+
# 5 EXPERIMENTS
|
| 125 |
+
|
| 126 |
+
This section describes various experimental results on MNIST, CIFAR10, and CIFAR100 dataset. In the experiments, simple convolutional neural networks (CNN) is used for MNIST and ‘All-CNN$\mathbf { C } '$ Springenberg et al. (2014) is used for CIFAR10 and CIFAR100. The details of the dataset and experimental settings are presented in the appendix B.
|
| 127 |
+
|
| 128 |
+

|
| 129 |
+
Figure 3: The probability distribution and selected batch size. The white dot is selected batch size at epoch. (top) The case that small batch size performs better. (middle) The case that large batch size performs better. (bottom) The case that best performing batch size varies.
|
| 130 |
+
|
| 131 |
+

|
| 132 |
+
Figure 4: The results of test accuracy for the MNIST dataset. The error bar is standard error. (left) The test accuracy of 100 times repeated experiments with AdamOptimizer. (right) The test accuracy of 100 times repeated experiments with AdagradOptimizer. In both cases, most RMGD settings outperform all fixed MGD algorithms.
|
| 133 |
+
|
| 134 |
+
# 5.1 MNIST DATASET
|
| 135 |
+
|
| 136 |
+
The validity of the RMGD was assessed by performing image classification on the MNIST dataset using AdamOptimizer and AdagradOptimizer as optimizer. The experiments were repeated 100 times for each algorithm and each optimizer, then the results were analyzed for significance. Figure 3 shows the probability distribution and the selected batch size with respect to epoch during training for the RMGD. The white dot represents the batch size selected at each epoch. The top figure is the case that small batch size (32) performs better. After epoch 50, batch size 32 gets high probability and is selected more than others. It means that batch size 32 has less misupdating in this case. The gradually increasing batch size algorithm may not perform well in this case. The middle figure is the case that large batch size (512) performs better. After epoch 60, batch size 512 gets high probability and selected more than others. The bottom figure shows that the best performing batch size varies with epoch. During epoch from 40 to 55, batch size of 256 performs best, and best performing batch size switches to 128 during epoch from 60 to 70, then better performing batch size backs to 256 after epoch 80. In the results, any batch size can be a successful batch size in the later stages without any particular order. The RMGD is more flexible for such situation than the MGD or directional adaptive MGD such as gradually increasing batch size algorithm.
|
| 137 |
+
|
| 138 |
+
Figure 4 shows the test accuracy of each algorithm. The error bar is standard error. The number in parenthesis next to MGD represents the batch size used in the MGD. ’Basic’, ’sub’, ’super’, ’hinge’, and ’ratio’ in parenthesis next to RMGD represent RMGD settings ’batch size set equal to grid search, 0-1 loss’, ’subset of basic, 0-1 loss’, ’superset of basic, 0-1 loss’, ’basic set, hinge loss’, and ’basic set, percentage of non-negative changes in validation loss’, respectively. The left figure is the test accuracy with AdamOptimizer. The right figure is the test accuracy with AdagradOptimizer. Among the MGD algorithms, relatively small batch sizes (16 - 64) lead to higher performance than large batch sizes (128 - 512) and batch size 64 achieves the best performance in grid search. These results correspond with other studies Breuel (2015); Keskar et al. (2016); Mishkin et al. (2017). Most RMGD settings outperform all fixed MGD algorithms in both case. Although the performance of RMGD is not significantly increased compared to the best MGD, the purpose of this algorithm is not to improve performance, but to ensure that the best performance is achieved without performing a grid search on the batch size. Rather, the improved performance of the RMGD is a surprising result. Therefore, the RMGD is said to be valid. There are little performance gap among RMGD settings. The ’sub’ setting outperforms the ’basic’ setting in left figure, but the opposite result is shown in right figure. Therefore, there is no clear tendency of performance change depending on the size of the batch size set.
|
| 139 |
+
|
| 140 |
+
Table 1: Iterations and real time for training, and test accuracy of MNIST classification with AdamOptimizer. The ’total’ is the sum of the average values from MGD 16 to 512, which means the whole grid search is performed.
|
| 141 |
+
|
| 142 |
+
<table><tr><td rowspan=2 colspan=1>Algorithms</td><td rowspan=2 colspan=1>Iterations</td><td rowspan=2 colspan=1>Real time (sec)</td><td rowspan=1 colspan=3>Test accuracy (%)</td></tr><tr><td rowspan=1 colspan=1>Mean±SD</td><td rowspan=1 colspan=1>Max</td><td rowspan=1 colspan=1>Min</td></tr><tr><td rowspan=1 colspan=1>MGD (16)</td><td rowspan=1 colspan=1>343,800</td><td rowspan=1 colspan=1>1,221.54 ± 36.00</td><td rowspan=1 colspan=1>99.327 ± 0.064</td><td rowspan=1 colspan=1>99.480</td><td rowspan=1 colspan=1>99.140</td></tr><tr><td rowspan=1 colspan=1>MGD (32)</td><td rowspan=1 colspan=1>171,900</td><td rowspan=1 colspan=1>697.82 ± 19.70</td><td rowspan=1 colspan=1>99.322 ± 0.060</td><td rowspan=1 colspan=1>99.500</td><td rowspan=1 colspan=1>99.150</td></tr><tr><td rowspan=1 colspan=1>MGD (64)</td><td rowspan=1 colspan=1>86,000</td><td rowspan=1 colspan=1>379.14 ± 11.32</td><td rowspan=1 colspan=1>99.328 ± 0.058</td><td rowspan=1 colspan=1>99.460</td><td rowspan=1 colspan=1>99.170</td></tr><tr><td rowspan=1 colspan=1>MGD (128)</td><td rowspan=1 colspan=1>43,000</td><td rowspan=1 colspan=1>262.33 ± 2.34</td><td rowspan=1 colspan=1>99.314 ± 0.056</td><td rowspan=1 colspan=1>99.440</td><td rowspan=1 colspan=1>99.170</td></tr><tr><td rowspan=1 colspan=1>MGD (256)</td><td rowspan=1 colspan=1>21,500</td><td rowspan=1 colspan=1>208.13 ± 2.20</td><td rowspan=1 colspan=1>99.295 ± 0.059</td><td rowspan=1 colspan=1>99.470</td><td rowspan=1 colspan=1>99.170</td></tr><tr><td rowspan=1 colspan=1>MGD (512)</td><td rowspan=1 colspan=1>10,800</td><td rowspan=1 colspan=1>180.06 ± 0.37</td><td rowspan=1 colspan=1>99.254 ± 0.054</td><td rowspan=1 colspan=1>99.430</td><td rowspan=1 colspan=1>99.110</td></tr><tr><td rowspan=1 colspan=1>MGD (total)</td><td rowspan=1 colspan=1>677,000</td><td rowspan=1 colspan=1>2,949.02</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>RMGD (basic)</td><td rowspan=1 colspan=1>68,309 ± 8,900</td><td rowspan=1 colspan=1>333.73 ± 25.38</td><td rowspan=1 colspan=1>99.342 ± 0.064</td><td rowspan=1 colspan=1>99.480</td><td rowspan=1 colspan=1>99.110</td></tr><tr><td rowspan=1 colspan=1>RMGD (sub)</td><td rowspan=1 colspan=1>85,777 ± 12,112</td><td rowspan=1 colspan=1>400.73 ± 51.91</td><td rowspan=1 colspan=1>99.357± 0.057</td><td rowspan=1 colspan=1>99.510</td><td rowspan=1 colspan=1>99.060</td></tr><tr><td rowspan=1 colspan=1>RMGD (super)</td><td rowspan=1 colspan=1>67,948 ± 6,022</td><td rowspan=1 colspan=1>332.61 ± 22.26</td><td rowspan=1 colspan=1>99.345 ± 0.058</td><td rowspan=1 colspan=1>99.460</td><td rowspan=1 colspan=1>99.110</td></tr><tr><td rowspan=1 colspan=1>RMGD (hinge)</td><td rowspan=1 colspan=1>69,607 ± 8,887</td><td rowspan=1 colspan=1>337.38 ± 25.29</td><td rowspan=1 colspan=1>99.341 ± 0.062</td><td rowspan=1 colspan=1>99.480</td><td rowspan=1 colspan=1>99.130</td></tr><tr><td rowspan=1 colspan=1>RMGD (ratio)</td><td rowspan=1 colspan=1>95,530 ± 8,281</td><td rowspan=1 colspan=1>449.37 ± 26.71</td><td rowspan=1 colspan=1>99.339 ± 0.062</td><td rowspan=1 colspan=1>99.470</td><td rowspan=1 colspan=1>99.150</td></tr></table>
|
| 143 |
+
|
| 144 |
+
Table 2: Iterations and real time for training, and test accuracy of MNIST classification with AdagradOptimizer.
|
| 145 |
+
|
| 146 |
+
<table><tr><td rowspan=2 colspan=1>Algorithms</td><td rowspan=2 colspan=1>Iterations</td><td rowspan=2 colspan=1>Real time (sec)</td><td rowspan=1 colspan=3>Test accuracy (%)</td></tr><tr><td rowspan=1 colspan=1>Mean± SD</td><td rowspan=1 colspan=1>Max</td><td rowspan=1 colspan=1>Min</td></tr><tr><td rowspan=1 colspan=1>MGD (16)</td><td rowspan=1 colspan=1>343,800</td><td rowspan=1 colspan=1>1,160.87 ± 22.34</td><td rowspan=1 colspan=1>99.268 ± 0.090</td><td rowspan=1 colspan=1>99.430</td><td rowspan=1 colspan=1>98.920</td></tr><tr><td rowspan=1 colspan=1>MGD (32)</td><td rowspan=1 colspan=1>171,900</td><td rowspan=1 colspan=1>640.68 ± 15.53</td><td rowspan=1 colspan=1>99.270 ± 0.070</td><td rowspan=1 colspan=1>99.410</td><td rowspan=1 colspan=1>99.050</td></tr><tr><td rowspan=1 colspan=1>MGD (64)</td><td rowspan=1 colspan=1>86,000</td><td rowspan=1 colspan=1>367.40 ± 12.63</td><td rowspan=1 colspan=1>99.277 ± 0.077</td><td rowspan=1 colspan=1>99.440</td><td rowspan=1 colspan=1>99.110</td></tr><tr><td rowspan=1 colspan=1>MGD (128)</td><td rowspan=1 colspan=1>43,000</td><td rowspan=1 colspan=1>262.48 ± 1.37</td><td rowspan=1 colspan=1>99.269 ± 0.069</td><td rowspan=1 colspan=1>99.410</td><td rowspan=1 colspan=1>99.080</td></tr><tr><td rowspan=1 colspan=1>MGD (256)</td><td rowspan=1 colspan=1>21,500</td><td rowspan=1 colspan=1>195.60 ± 2.00</td><td rowspan=1 colspan=1>99.240 ± 0.072</td><td rowspan=1 colspan=1>99.390</td><td rowspan=1 colspan=1>99.030</td></tr><tr><td rowspan=1 colspan=1>MGD (512)</td><td rowspan=1 colspan=1>10,800</td><td rowspan=1 colspan=1>170.31 ± 1.41</td><td rowspan=1 colspan=1>99.198 ± 0.085</td><td rowspan=1 colspan=1>99.390</td><td rowspan=1 colspan=1>98.810</td></tr><tr><td rowspan=1 colspan=1>MGD (total)</td><td rowspan=1 colspan=1>677,000</td><td rowspan=1 colspan=1>2,797.34</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>RMGD (basic)</td><td rowspan=1 colspan=1>68,159 ± 8,447</td><td rowspan=1 colspan=1>323.33 ± 23.57</td><td rowspan=1 colspan=1>99.286 ± 0.088</td><td rowspan=1 colspan=1>99.490</td><td rowspan=1 colspan=1>98.900</td></tr><tr><td rowspan=1 colspan=1>RMGD (sub)</td><td rowspan=1 colspan=1>81,479 ± 9,141</td><td rowspan=1 colspan=1>356.16 ± 28.06</td><td rowspan=1 colspan=1>99.272 ± 0.092</td><td rowspan=1 colspan=1>99.460</td><td rowspan=1 colspan=1>98.960</td></tr><tr><td rowspan=1 colspan=1>RMGD (super)</td><td rowspan=1 colspan=1>67,638 ± 7,733</td><td rowspan=1 colspan=1>320.38 ± 23.55</td><td rowspan=1 colspan=1>99.280 ± 0.074</td><td rowspan=1 colspan=1>99.410</td><td rowspan=1 colspan=1>99.090</td></tr><tr><td rowspan=1 colspan=1>RMGD (hinge)</td><td rowspan=1 colspan=1>68,199 ± 8,642</td><td rowspan=1 colspan=1>322.33 ± 24.03</td><td rowspan=1 colspan=1>99.282 ± 0.089</td><td rowspan=1 colspan=1>99.420</td><td rowspan=1 colspan=1>98.900</td></tr><tr><td rowspan=1 colspan=1>RMGD (ratio)</td><td rowspan=1 colspan=1>93,523 ± 9,871</td><td rowspan=1 colspan=1>452.69 ± 34.71</td><td rowspan=1 colspan=1>99.283 ± 0.078</td><td rowspan=1 colspan=1>99.480</td><td rowspan=1 colspan=1>99.020</td></tr></table>
|
| 147 |
+
|
| 148 |
+
Table 1 and 2 present iterations and real time for training, mean, maximum, and minimum of test accuracies for each algorithm with AdamOptimizer and AdagradOptimizer respectively. The MGD (total) is the summation of the iterations and real time of whole MGDs for grid search. The RMGD (basic) outperforms best performing MGD and is, also, faster than best performing MGD. Furthermore, it is 8 times faster than grid search in both cases. In the results, the RMGD is effective regardless of the optimizer.
|
| 149 |
+
|
| 150 |
+
# 5.2 CIFAR10 AND CIFAR100 DATASET
|
| 151 |
+
|
| 152 |
+
The CIFAR10 and CIFAR100 dataset were, also, used to assess effectiveness of the RMGD. The experiments were repeated 25 times and 10 times, respectively. In these experiments, all images are whitened and contrast normalized before being input to the network. Figure 5 shows the test accuracy for each algorithm. The left figure represents the test accuracy on CIFAR10. In contrast to the MNIST results, relatively large batch sizes (128 - 256) lead to higher performance than small batch sizes (16 - 64) and batch size 256 achieves the best performance in grid search. The right figure represents the test accuracy on CIFAR100 and batch size 128 achieves the best performance in grid search. The results on MNIST, CIFAR10 and CIFAR100 indicate that it is difficult to know which batch size is optimal before performing a grid search. Meanwhile, all RMGD settings have again exceeded the best performance of fixed MGD. There are no significant performance gaps among RMGD settings, so there is no need to worry about choosing appropriate batch size set or selecting cost function.
|
| 153 |
+
|
| 154 |
+

|
| 155 |
+
Figure 5: The results of test accuracy for the CIFAR10 and CIFAR100 dataset. The error bar is standard error. (left) The test accuracy of 25 times repeated experiments on CIFAR10. (right) The test accuracy of 10 times repeated experiments on CIFAR100. In both cases, all RMGD settings outperform all fixed MGD algorithms.
|
| 156 |
+
|
| 157 |
+
Table 3: Iterations and real time for training, and test accuracy on CIFAR10.
|
| 158 |
+
|
| 159 |
+
<table><tr><td rowspan=2 colspan=1>Algorithms</td><td rowspan=2 colspan=1>Iterations</td><td rowspan=2 colspan=1>Real time (sec)</td><td rowspan=1 colspan=3>Test accuracy (%)</td></tr><tr><td rowspan=1 colspan=1>Mean ± SD</td><td rowspan=1 colspan=1>Max</td><td rowspan=1 colspan=1>Min</td></tr><tr><td rowspan=1 colspan=1>MGD (16)</td><td rowspan=1 colspan=1>1,072,050</td><td rowspan=1 colspan=1>10,085.26 ± 216.48</td><td rowspan=1 colspan=1>87.778 ± 0.207</td><td rowspan=1 colspan=1>88.290</td><td rowspan=1 colspan=1>87.480</td></tr><tr><td rowspan=1 colspan=1>MGD (32)</td><td rowspan=1 colspan=1>536,200</td><td rowspan=1 colspan=1>7,643.93 ± 459.95</td><td rowspan=1 colspan=1>87.851 ± 0.160</td><td rowspan=1 colspan=1>88.250</td><td rowspan=1 colspan=1>87.630</td></tr><tr><td rowspan=1 colspan=1>MGD (64)</td><td rowspan=1 colspan=1>268,100</td><td rowspan=1 colspan=1>6,160.16 ± 68.54</td><td rowspan=1 colspan=1>87.853 ± 0.202</td><td rowspan=1 colspan=1>88.330</td><td rowspan=1 colspan=1>87.450</td></tr><tr><td rowspan=1 colspan=1>MGD (128)</td><td rowspan=1 colspan=1>134,050</td><td rowspan=1 colspan=1>5,675.15 ± 181.80</td><td rowspan=1 colspan=1>87.873 ± 0.234</td><td rowspan=1 colspan=1>88.210</td><td rowspan=1 colspan=1>87.090</td></tr><tr><td rowspan=1 colspan=1>MGD (256)</td><td rowspan=1 colspan=1>67,200</td><td rowspan=1 colspan=1>5,466.79 ± 402.20</td><td rowspan=1 colspan=1>87.897 ± 0.293</td><td rowspan=1 colspan=1>88.260</td><td rowspan=1 colspan=1>87.170</td></tr><tr><td rowspan=1 colspan=1>MGD (total)</td><td rowspan=1 colspan=1>2,077,600</td><td rowspan=1 colspan=1>35,031.29</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>RMGD (basic)</td><td rowspan=1 colspan=1>463,629 ± 48,692</td><td rowspan=1 colspan=1>7,592.43 ± 403.65</td><td rowspan=1 colspan=1>88.004 ± 0.167</td><td rowspan=1 colspan=1>88.380</td><td rowspan=1 colspan=1>87.780</td></tr><tr><td rowspan=1 colspan=1>RMGD (sub)</td><td rowspan=1 colspan=1>507,186 ± 93,961</td><td rowspan=1 colspan=1>7,614.16 ± 514.20</td><td rowspan=1 colspan=1>87.992 ± 0.147</td><td rowspan=1 colspan=1>88.270</td><td rowspan=1 colspan=1>87.730</td></tr><tr><td rowspan=1 colspan=1>RMGD (super)</td><td rowspan=1 colspan=1>397,685 ± 33,535</td><td rowspan=1 colspan=1>7,426.11 ± 228.28</td><td rowspan=1 colspan=1>88.027 ± 0.179</td><td rowspan=1 colspan=1>88.340</td><td rowspan=1 colspan=1>87.760</td></tr><tr><td rowspan=1 colspan=1>RMGD (hinge)</td><td rowspan=1 colspan=1>459,664± 56,086</td><td rowspan=1 colspan=1>7,584.01 ± 439.62</td><td rowspan=1 colspan=1>88.003 ± 0.167</td><td rowspan=1 colspan=1>88.380</td><td rowspan=1 colspan=1>87.810</td></tr><tr><td rowspan=1 colspan=1>RMGD (ratio)</td><td rowspan=1 colspan=1>426,123 ± 15,213</td><td rowspan=1 colspan=1>7,561.72 ± 220.56</td><td rowspan=1 colspan=1>88.002 ± 0.129</td><td rowspan=1 colspan=1>88.330</td><td rowspan=1 colspan=1>87.770</td></tr></table>
|
| 160 |
+
|
| 161 |
+
Table 4: Iterations and real time for training, and test accuracy on CIFAR100.
|
| 162 |
+
|
| 163 |
+
<table><tr><td rowspan=2 colspan=1>Algorithms</td><td rowspan=2 colspan=1>Iterations</td><td rowspan=2 colspan=1>Real time (sec)</td><td rowspan=1 colspan=3>Test accuracy (%)</td></tr><tr><td rowspan=1 colspan=1>Mean ± SD</td><td rowspan=1 colspan=1>Max</td><td rowspan=1 colspan=1>Min</td></tr><tr><td rowspan=1 colspan=1>MGD (16)</td><td rowspan=1 colspan=1>1,072,050</td><td rowspan=1 colspan=1>12,097.47 ± 57.47</td><td rowspan=1 colspan=1>60.247 ± 0.690</td><td rowspan=1 colspan=1>61.940</td><td rowspan=1 colspan=1>59.620</td></tr><tr><td rowspan=1 colspan=1>MGD (32)</td><td rowspan=1 colspan=1>536,200</td><td rowspan=1 colspan=1>8,058.14 ± 39.87</td><td rowspan=1 colspan=1>60.475 ± 0.721</td><td rowspan=1 colspan=1>61.750</td><td rowspan=1 colspan=1>59.290</td></tr><tr><td rowspan=1 colspan=1>MGD (64)</td><td rowspan=1 colspan=1>268,100</td><td rowspan=1 colspan=1>6,400.21 ± 12.78</td><td rowspan=1 colspan=1>60.628 ± 0.795</td><td rowspan=1 colspan=1>61.950</td><td rowspan=1 colspan=1>59.170</td></tr><tr><td rowspan=1 colspan=1>MGD (128)</td><td rowspan=1 colspan=1>134,050</td><td rowspan=1 colspan=1>5,598.85 ± 38.18</td><td rowspan=1 colspan=1>60.954 ± 0.834</td><td rowspan=1 colspan=1>62.120</td><td rowspan=1 colspan=1>59.530</td></tr><tr><td rowspan=1 colspan=1>MGD (256)</td><td rowspan=1 colspan=1>67,200</td><td rowspan=1 colspan=1>5,245.88 ± 40.67</td><td rowspan=1 colspan=1>60.504 ± 0.553</td><td rowspan=1 colspan=1>61.560</td><td rowspan=1 colspan=1>59.830</td></tr><tr><td rowspan=1 colspan=1>MGD (total)</td><td rowspan=1 colspan=1>2,077,600</td><td rowspan=1 colspan=1>37,400.55</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>RMGD (basic)</td><td rowspan=1 colspan=1>425,416± 44,392</td><td rowspan=1 colspan=1>7,503.09 ± 281.79</td><td rowspan=1 colspan=1>61.203 ± 0.502</td><td rowspan=1 colspan=1>62.050</td><td rowspan=1 colspan=1>60.310</td></tr><tr><td rowspan=1 colspan=1>RMGD (sub)</td><td rowspan=1 colspan=1>532,624 ± 69,195</td><td rowspan=1 colspan=1>7,841.88 ± 530.29</td><td rowspan=1 colspan=1>61.080 ± 0.720</td><td rowspan=1 colspan=1>61.910</td><td rowspan=1 colspan=1>59.900</td></tr><tr><td rowspan=1 colspan=1>RMGD (super)</td><td rowspan=1 colspan=1>397,717 ± 20,091</td><td rowspan=1 colspan=1>7,408.00 ± 163.74</td><td rowspan=1 colspan=1>61.166 ± 0.560</td><td rowspan=1 colspan=1>61.970</td><td rowspan=1 colspan=1>60.320</td></tr><tr><td rowspan=1 colspan=1>RMGD (hinge)</td><td rowspan=1 colspan=1>419,100 ± 53,491</td><td rowspan=1 colspan=1>7,476.71 ± 324.29</td><td rowspan=1 colspan=1>61.219 ± 0.714</td><td rowspan=1 colspan=1>62.060</td><td rowspan=1 colspan=1>59.580</td></tr><tr><td rowspan=1 colspan=1>RMGD (ratio)</td><td rowspan=1 colspan=1>412,532 ±15,660</td><td rowspan=1 colspan=1>7,456.50 ± 100.79</td><td rowspan=1 colspan=1>61.340 ± 0.411</td><td rowspan=1 colspan=1>61.880</td><td rowspan=1 colspan=1>60.550</td></tr></table>
|
| 164 |
+
|
| 165 |
+
Table 3 and 4 present the detailed results on CIFAR10 and CIFAR100 dataset. The RMGD (basic) is a little slower than single best performing MGD (256 for CIFAR10 and 128 for CIFAR100), however, it was much faster than grid search -about 4.6 times on CIFAR10 and 5.0 times on CIFAR100 faster. Therefore, this results, also, show the effectiveness of the RMGD.
|
| 166 |
+
|
| 167 |
+
It is difficult to compare the RMGD with other adaptive batch size algorithm, e.g. coupling adaptive batch sizes (CABS) Balles et al. (2017), directly since the underlying goals are different. While the goal of the RMGD is to reduce the validation loss in terms of generalization performance, the CABS determines the batch size to balance between the gradient variance and computation. However, it is obvious that the RMGD is simpler and easier to implement than any other adaptive algorithm cited in this paper, and comparing the test accuracy between the RMGD and the CABS on the CIFAR10 and CIFAR100 using the same experimental settings with ’All-CNN-C’ shows that the performance of the RMGD is higher than that of the CABS (CIFAR10: $8 7 . 8 6 2 \pm 0 . 1 4 2$ , CIFAR100: 60.782 $\pm \ : 0 . 4 2 1 $ ). And again, the purpose of this algorithm is not to outperform other algorithms, but to guarantee that the best performance is reached without grid search.
|
| 168 |
+
|
| 169 |
+
# CONCLUSION
|
| 170 |
+
|
| 171 |
+
Selecting batch size affects the model quality and training efficiency, and determining the appropriate batch size is time consuming and requires considerable resources as it often relies on grid search. The focus of this paper is to design a simple robust algorithm that is theoretically sound and applicable in many situations.
|
| 172 |
+
|
| 173 |
+
This paper considers a resizable mini-batch gradient descent (RMGD) algorithm based on a multiarmed bandit that achieves equivalent performance to that of best fixed batch-size. At each epoch, the RMGD samples a batch size according to certain probability distribution of a batch being successful in reducing the loss function. Sampling from this probability provides a mechanism for exploring different batch size and exploiting batch sizes with history of success. After obtaining the validation loss at each epoch with the sampled batch size, the probability distribution is updated to incorporate the effectiveness of the sampled batch size.
|
| 174 |
+
|
| 175 |
+
The goal of this algorithm is not to achieve state-of-the-art accuracy but rather to select appropriate batch size which leads low misupdating and performs better. The RMGD essentially assists the learning process to explore the possible domain of the batch size and exploit successful batch size. The benefit of RMGD is that it avoids the need for cumbersome grid search to achieve best performance and that it is simple enough to apply to various field of machine learning including deep learning using MGD. Experimental results show that the RMGD achieves the best grid search performance on various dataset, networks, and optimizers. Furthermore, it, obviously, attains this performance in a shorter amount of time than the grid search. Also, there is no need to worry about which batch size set or cost function to choose when setting RMGD. In conclusion, the RMGD is effective and flexible mini-batch gradient descent algorithm.
|
| 176 |
+
|
| 177 |
+
# REFERENCES
|
| 178 |
+
|
| 179 |
+
Lukas Balles, Javier Romero, and Philipp Hennig. Coupling adaptive batch sizes with learning rates. In Proceedings of the Thirty-Third Conference on Uncertainty in Artificial Intelligence, UAI 2017, Sydney, Australia, August 11-15, 2017, 2017. URL http://auai.org/uai2017/ proceedings/papers/141.pdf.
|
| 180 |
+
|
| 181 |
+
Yoshua Bengio. Practical recommendations for gradient-based training of deep architectures. In Neural networks: Tricks of the trade, pp. 437–478. Springer, 2012.
|
| 182 |
+
|
| 183 |
+
Thomas M Breuel. The effects of hyperparameters on sgd training of neural networks. arXiv preprint arXiv:1508.02788, 2015.
|
| 184 |
+
|
| 185 |
+
Richard H Byrd, Gillian M Chin, Jorge Nocedal, and Yuchen Wu. Sample size selection in optimization methods for machine learning. Mathematical programming, 134(1):127–155, 2012.
|
| 186 |
+
|
| 187 |
+
Soham De, Abhay Yadav, David Jacobs, and Tom Goldstein. Big batch sgd: Automated inference using adaptive batch sizes. arXiv preprint arXiv:1610.05792, 2016.
|
| 188 |
+
|
| 189 |
+
Michael P Friedlander and Mark Schmidt. Hybrid deterministic-stochastic methods for data fitting. SIAM Journal on Scientific Computing, 34(3):A1380–A1405, 2012.
|
| 190 |
+
Elad Hazan and Satyen Kale. Extracting certainty from uncertainty: Regret bounded by variation in costs. Machine learning, 80(2-3):165–188, 2010.
|
| 191 |
+
Kevin Jamieson and Ameet Talwalkar. Non-stochastic best arm identification and hyperparameter optimization. In Artificial Intelligence and Statistics, pp. 240–248, 2016.
|
| 192 |
+
Stanislaw Jastrzkebski, 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.
|
| 193 |
+
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.
|
| 194 |
+
Lisha Li, Kevin Jamieson, Giulia DeSalvo, Afshin Rostamizadeh, and Ameet Talwalkar. Hyperband: A novel bandit-based approach to hyperparameter optimization. The Journal of Machine Learning Research, 18(1):6765–6816, 2017.
|
| 195 |
+
Dmytro Mishkin, Nikolay Sergievskiy, and Jiri Matas. Systematic evaluation of convolution neural network advances on the imagenet. Computer Vision and Image Understanding, 161:11–19, 2017.
|
| 196 |
+
Shai Shalev-Shwartz et al. Online learning and online convex optimization. Foundations and Trends $\textsuperscript { \textregistered }$ in Machine Learning, 4(2):107–194, 2012.
|
| 197 |
+
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.
|
| 198 |
+
Jost Tobias Springenberg, Alexey Dosovitskiy, Thomas Brox, and Martin Riedmiller. Striving for simplicity: The all convolutional net. arXiv preprint arXiv:1412.6806, 2014.
|
| 199 |
+
D Randall Wilson and Tony R Martinez. The general inefficiency of batch training for gradient descent learning. Neural Networks, 16(10):1429–1451, 2003.
|
| 200 |
+
|
| 201 |
+
# APPENDIX
|
| 202 |
+
|
| 203 |
+
# A REGRET BOUND
|
| 204 |
+
|
| 205 |
+
In the RMGD algorithm, there are $K$ batch sizes as multi arms with the probability distribution $\pi \in S$ , and at each epoch the algorithm should select one of the batch sizes $b _ { k _ { \tau } }$ . Then it receives a cost of selecting this arm, $y _ { \tau } ^ { k _ { \tau } } \in \{ 0 , 1 \}$ by testing the validation loss $\ell$ . The vector ${ \pmb y } _ { \tau } \in \{ 0 , 1 \} ^ { K }$ represents the selecting cost for each batch size. The goal of this algorithm is to have low regret for not selecting the best performing batch size.
|
| 206 |
+
|
| 207 |
+
$$
|
| 208 |
+
\mathrm { R e g r e t } _ { \mathcal { T } } ( S ) = \mathbb { E } \left[ \sum _ { \tau = 1 } ^ { \mathcal { T } } y _ { \tau } ^ { k _ { \tau } } \right] - \operatorname* { m i n } _ { i } \sum _ { \tau = 1 } ^ { \mathcal { T } } y _ { \tau } ^ { i }
|
| 209 |
+
$$
|
| 210 |
+
|
| 211 |
+
where the expectation is over the algorithm’s randomness of batch size selection.
|
| 212 |
+
|
| 213 |
+
Let $S$ be the probability simplex, the selecting loss functions be $f _ { \tau } ( \pmb { \pi } ) = \langle \pmb { \pi } , \pmb { y } _ { \tau } \rangle ^ { 2 }$ and $R : S \mathbb { R }$ be a regularization function that is often chosen to be strongly convex with respect to some norm $\| \cdot \|$ . The algorithm select a batch size with probability $\mathbb { P } [ b _ { k _ { \tau } } ] = \pi _ { \tau } ^ { k _ { \tau } }$ and therefore $f _ { \tau } ( \pmb { \pi } _ { \tau } )$ is the expected cost of the selected batch size at epoch $\tau$ . The gradient of the selecting loss function is ${ \pmb y } _ { \tau }$ . However, only one element $y _ { \tau } ^ { k _ { \tau } }$ is known at each epoch. To estimate gradient, random vector $z _ { \tau }$ is defined as follows:
|
| 214 |
+
|
| 215 |
+
$$
|
| 216 |
+
z _ { \tau } ^ { i } = \left\{ \begin{array} { c l } { { y _ { \tau } ^ { i } / \pi _ { \tau } ^ { i } } } & { { \mathrm { i f ~ } i = k _ { \tau } } } \\ { { 0 } } & { { \mathrm { o t h e r w i s e } } } \end{array} \right.
|
| 217 |
+
$$
|
| 218 |
+
|
| 219 |
+
and expectation of $z _ { \tau }$ satisfies,
|
| 220 |
+
|
| 221 |
+
$$
|
| 222 |
+
\mathbb { E } [ z _ { \tau } | z _ { \tau - 1 } , \dots , z _ { 0 } ] = \sum _ { i = 1 } ^ { K } \mathbb { P } [ b _ { k _ { \tau } } ] z _ { \tau } ^ { i } = \pi _ { \tau } ^ { k _ { \tau } } \frac { y _ { \tau } ^ { k _ { \tau } } } { \pi _ { \tau } ^ { k _ { \tau } } } = y _ { \tau } ^ { k _ { \tau } } .
|
| 223 |
+
$$
|
| 224 |
+
|
| 225 |
+
The most natural learning rule is to set the probability distribution which has minimal cost on all past epochs. It is referred to as Follow-the-Regularized-Leader (FTRL) in online learning:
|
| 226 |
+
|
| 227 |
+
$$
|
| 228 |
+
\forall \tau , \quad \pi _ { \tau + 1 } = \underset { \pi \in S } { \arg \operatorname* { m i n } } \left\{ \beta \sum _ { t = 1 } ^ { \tau } f _ { t } ( \pi ) + R ( \pi ) \right\} ,
|
| 229 |
+
$$
|
| 230 |
+
|
| 231 |
+
where $\beta$ is positive hyperparameter. The FTRL has a problem that it requires solving an optimization problem at each epoch. To solve this problem, Online Mirror Descent (OMD) is applied. The OMD computes the current probability distribution iteratively based on a gradient update rule and the previous probability distribution and lies in the update being carried out in a ’dual’ space, defined by regularizer. This follows from considering $\nabla R$ as a mapping from $\mathbb { R } ^ { K }$ onto itself. The OMD relies on Bregman divergence. The Bregman divergence between $\pi$ and $\tilde { \pi }$ with respect to the regularizer $R$ is given as:
|
| 232 |
+
|
| 233 |
+
$$
|
| 234 |
+
B _ { R } ( { \pmb \pi } \| { \tilde { \pmb \pi } } ) = R ( { \pmb \pi } ) - R ( { \tilde { \pmb \pi } } ) - \nabla R ( { \tilde { \pmb \pi } } ) \cdot ( { \pmb \pi } - { \tilde { \pmb \pi } } ) ,
|
| 235 |
+
$$
|
| 236 |
+
|
| 237 |
+
and a Bregman projection of $\tilde { \pi }$ onto simplex $S$ :
|
| 238 |
+
|
| 239 |
+
$$
|
| 240 |
+
\operatorname { a r g m i n } _ { \pi \in S } B _ { R } ( \pi \| { \tilde { \pi } } ) .
|
| 241 |
+
$$
|
| 242 |
+
|
| 243 |
+
Then the probability distribution is updated by the OMD as follows:
|
| 244 |
+
|
| 245 |
+
$$
|
| 246 |
+
\begin{array} { r c l } { \nabla R ( \tilde { \pmb { \pi } } _ { \tau + 1 } ) } & { = } & { \nabla R ( \tilde { \pmb { \pi } } _ { \tau } ) - \beta \pmb { z } _ { \tau } } \\ { \pmb { \pi } _ { \tau + 1 } } & { = } & { \underset { \pmb { \pi } \in S } { \arg \operatorname* { m i n } } B _ { R } ( \pmb { \pi } \| \tilde { \pmb { \pi } } _ { \tau + 1 } ) . } \end{array}
|
| 247 |
+
$$
|
| 248 |
+
|
| 249 |
+
In general, if $R$ is strongly convex, then $\nabla R$ becomes a bijective mapping, thus $\tilde { \pi } _ { \tau + 1 }$ can be recovered by the inverse gradient mapping $( \nabla R ) ^ { - 1 }$ . Given that $R$ is strongly convex, the OMD and FTRL produce equivalent predictions:
|
| 250 |
+
|
| 251 |
+
$$
|
| 252 |
+
\underset { \pi \in S } { \arg \operatorname* { m i n } } B _ { R } ( \pi \| \tilde { \pi } _ { \tau + 1 } ) = \underset { \pi \in S } { \arg \operatorname* { m i n } } \left\{ \beta \sum _ { t = 1 } ^ { \tau } f _ { t } ( \pi ) + R ( \pi ) \right\}
|
| 253 |
+
$$
|
| 254 |
+
|
| 255 |
+
by the Lemma 1 in Hazan & Kale (2010). It makes sense to use the negative entropic regularization for $R$ in RMGD setting:
|
| 256 |
+
|
| 257 |
+
$$
|
| 258 |
+
R ( { \pmb \pi } ) = \sum _ { i = 1 } ^ { K } \pi ^ { i } \log ( \pi ^ { i } ) .
|
| 259 |
+
$$
|
| 260 |
+
|
| 261 |
+
Then, $\nabla R ( { \pmb \pi } ) _ { i } = \log ( \pi ^ { i } ) + 1$ . From the OMD, $\tilde { \pi } _ { \tau + 1 }$ is updated as follows:
|
| 262 |
+
|
| 263 |
+
$$
|
| 264 |
+
\begin{array} { r c l } { \nabla R ( \tilde { \pi } _ { \tau + 1 } ) } & { = } & { \nabla R ( \tilde { \pi } _ { \tau } ) - \beta z _ { \tau } } \\ { \log ( \tilde { \pi } _ { \tau + 1 } ^ { i } ) + 1 } & { = } & { \log ( \tilde { \pi } _ { \tau } ^ { i } ) + 1 - \beta z _ { \tau } ^ { i } } \\ { \tilde { \pi } _ { \tau + 1 } ^ { i } } & { = } & { \tilde { \pi } _ { \tau } ^ { i } e ^ { - \beta z _ { \tau } ^ { i } } . } \end{array}
|
| 265 |
+
$$
|
| 266 |
+
|
| 267 |
+
The Bregman projection with respect to the negative entropy function becomes scaling by the $\ell _ { 1 }$ - norm. Therefore,
|
| 268 |
+
|
| 269 |
+
$$
|
| 270 |
+
\pi _ { \tau + 1 } ^ { i } = \frac { \tilde { \pi } _ { \tau + 1 } ^ { i } } { \sum _ { j } \tilde { \pi } _ { \tau + 1 } ^ { j } } .
|
| 271 |
+
$$
|
| 272 |
+
|
| 273 |
+
The probability distribution $\pi _ { \tau }$ is updated by the rule of the normalized exponentiated gradient (normalized-EG) algorithm described in Algorithm 1. Also, the selecting loss function is linear and it is satisfied that $\forall \tau , i$ we have $\beta z _ { \tau } ^ { i } \geq 0$ . Then,
|
| 274 |
+
|
| 275 |
+
$$
|
| 276 |
+
\sum _ { \tau = 1 } ^ { T } \langle \pi _ { \tau } - \pi ^ { * } , z _ { \tau } \rangle \leq \frac { \log ( K ) } { \beta } + \beta \sum _ { \tau = 1 } ^ { T } \sum _ { i = 1 } ^ { K } \pi _ { \tau } ^ { i } ( z _ { \tau } ^ { i } ) ^ { 2 }
|
| 277 |
+
$$
|
| 278 |
+
|
| 279 |
+
by the Theorem 2.22 in Shalev-Shwartz et al. (2012), where $\pi ^ { * } \in S$ is a fixed vector which minimizes the cumulative selecting loss,
|
| 280 |
+
|
| 281 |
+
$$
|
| 282 |
+
\pi ^ { * } = \arg \operatorname* { m i n } _ { \pi \in S } \sum _ { \tau = 1 } ^ { \tau } f _ { \tau } ( \pi ) .
|
| 283 |
+
$$
|
| 284 |
+
|
| 285 |
+
Since $f _ { \tau }$ is convex and $z _ { \tau }$ is estimated gradients for all $\tau$
|
| 286 |
+
|
| 287 |
+
$$
|
| 288 |
+
\mathbb { E } \left[ \sum _ { \tau = 1 } ^ { \mathcal { T } } ( f _ { \tau } ( \pi _ { \tau } ) - f _ { \tau } ( \pi ^ { * } ) ) \right] \leq \frac { \log ( K ) } { \beta } + \beta \sum _ { \tau = 1 } ^ { \mathcal { T } } \mathbb { E } \left[ \sum _ { i = 1 } ^ { K } \pi _ { \tau } ^ { i } ( z _ { \tau } ^ { i } ) ^ { 2 } \right]
|
| 289 |
+
$$
|
| 290 |
+
|
| 291 |
+
by the Theorem 4.1 in Shalev-Shwartz et al. (2012). The last term is bounded as follows:
|
| 292 |
+
|
| 293 |
+
$$
|
| 294 |
+
\begin{array} { r c l } { \mathbb { E } \left[ \displaystyle \sum _ { i = 1 } ^ { K } \pi _ { \tau } ^ { i } ( z _ { \tau } ^ { i } ) ^ { 2 } \right] } & { = } & { \displaystyle \sum _ { j = 1 } ^ { K } \mathbb { P } [ k _ { \tau } = j ] \sum _ { i = 1 } ^ { K } \pi _ { \tau } ^ { i } ( z _ { \tau } ^ { i } ) ^ { 2 } } \\ & { = } & { \displaystyle \sum _ { j = 1 } ^ { K } ( \pi _ { \tau } ^ { j } ) ^ { 2 } ( y _ { \tau } ^ { j } / \pi _ { \tau } ^ { j } ) ^ { 2 } } \\ & { = } & { \displaystyle \sum _ { j = 1 } ^ { K } ( y _ { \tau } ^ { j } ) ^ { 2 } \leq K . } \end{array}
|
| 295 |
+
$$
|
| 296 |
+
|
| 297 |
+
Therefore, the regret of the RMGD is bounded,
|
| 298 |
+
|
| 299 |
+
$$
|
| 300 |
+
\mathbb { E } \left[ \sum _ { \tau = 1 } ^ { \mathcal { T } } y _ { \tau } ^ { k _ { \tau } } \right] - \operatorname* { m i n } _ { i } \sum _ { \tau = 1 } ^ { \mathcal { T } } y _ { \tau } ^ { i } \leq \frac { \log K } { \beta } + \beta K \mathcal { T } .
|
| 301 |
+
$$
|
| 302 |
+
|
| 303 |
+
In particular, setting $\beta = \sqrt { \log ( K ) / ( K T ) }$ , the regret is bounded by $2 \sqrt { K \log ( K ) \mathcal { T } }$ , which is sublinear with $\tau$ .
|
| 304 |
+
|
| 305 |
+
# B EXPERIMENTAL SETTINGS
|
| 306 |
+
|
| 307 |
+
# DATASET
|
| 308 |
+
|
| 309 |
+
MNIST is a dataset of handwritten digits that is commonly used for image classification. Each sample is a black and white image and $2 8 \times 2 8$ in size. The MNIST is split into three parts: 55,000 samples for training, 5,000 samples for validation, and 10,000 samples for test.
|
| 310 |
+
|
| 311 |
+
CIFAR10 consists of $6 0 { , } 0 0 0 \ 3 2 \times 3 2$ color images in 10 classes (airplane, automobile, bird, cat, deer, dog, frog, horse, ship, and truck), with 6,000 images per class. The CIFAR10 is split into three parts: 45,000 samples for training, 5,000 samples for validation, and 10,000 samples for test.
|
| 312 |
+
|
| 313 |
+
CIFAR100 consists of $6 0 { , } 0 0 0 \ 3 2 \times 3 2$ color images in 100 classes. The CIFAR100 is split into three parts: 45,000 samples for training, 5,000 samples for validation, and 10,000 samples for test.
|
| 314 |
+
|
| 315 |
+
# SETTINGS
|
| 316 |
+
|
| 317 |
+
The simple CNN consists of two convolution layers with $5 \times 5$ filter and $1 \times 1$ stride, two max pooling layers with $2 \times 2$ kernel and $2 \times 2$ stride, single fully-connected layer, and softmax classifier. Description of the ’All-CNN-C’ is provided in Table 5. For MNIST, AdamOptimizer with $\eta = 1 0 ^ { - 4 }$ and AdagradOptimizer with $\eta = 0 . 1$ are used as optimizer. The basic batch size set $B = \{ 1 6 , 3 2 , 6 4 , 1 2 8 , 2 5 6 , 5 1 2 \}$ , subset of basic $B ^ { - } ~ = ~ \{ 1 6 , 6 4 , 2 5 6 \}$ , and superset of basic $B ^ { + } ~ = ~ \{ 1 6 , 2 4 , 3 2 , 4 8 , 6 4 , 9 6 , 1 2 8 , 1 9 2 , 2 5 6 , 3 8 ^ { \circ }$ 4, 512}. The model is trained for a total of 100 epochs. For CIFAR10 and CIFAR100, MomentumOptimizer with fixed momentum of 0.9 is used as optimizer. The learning rate $\eta ^ { k }$ is scaled up proportionately to the batch size $( \eta ^ { k } = 0 . 0 5 * b _ { k } / 2 5 6 )$ and decayed by a schedule $S = [ 2 0 0 , 2 5 0 , 3 0 0 ]$ in which $\dot { \boldsymbol { \eta } } ^ { k }$ is multiplied by a fixed multiplier of 0.1 after 200, 250, and 300 epochs respectively. The model is trained for a total of 350 epochs. Dropout is applied to the input image as well as after each convolution layer with stride 2. The dropout probabilities are $20 \%$ for dropping out inputs and $50 \%$ otherwise. The model is regularized with weight decay $\lambda ~ = ~ 0 . 0 0 1$ . The basic batch size set $B = \{ 1 6 , 3 2 , 6 2 , 1 2 8 , 2 5 6 \}$ , subset of basic $B ^ { - } = \{ 1 6 , 6 4 , 2 5 6 \}$ , and superset of basic $B ^ { + } = \{ 1 6 , 2 4 , 3 2 , 4 8 , 6 4 , 9 6 , 1 2 8 , 1 9 2 , 2$ $2 5 6 \}$ . For all experiments, rectified linear unit (ReLU) is used as activation function. For RMGD, $\beta$ is set to $\sqrt { \log ( 6 ) / ( 6 * 1 0 0 ) } \approx 0 . 0 5 5$ for MNIST and $\sqrt { \log ( 5 ) / ( 5 * 3 5 0 ) } \approx 0 . 0 3 0$ for CIFAR10 and CIFAR100. The basic batch size selecting cost is 0-1 loss, hinge loss is $\operatorname* { m a x } \{ 0 , \ell _ { \tau } - \ell _ { \tau - 1 } \}$ , and ratio loss is $\operatorname* { m a x } \{ 0 , ( \ell _ { \tau } - \ell _ { \tau - 1 } ) / \ell _ { \tau - 1 } \}$ .
|
| 318 |
+
|
| 319 |
+
Table 5: Architecture of the All-CNN-C for CIFAR10 and CIFAR100
|
| 320 |
+
|
| 321 |
+
<table><tr><td>Layer</td><td>Layerdescription</td></tr><tr><td>input conv1</td><td>Input 32 × 32 RGB image 3 × 3 conv. 96 ReLU, stride 1, dropout 0.2</td></tr><tr><td>conv2</td><td>3 × 3 conv. 96 ReLU, stride 1</td></tr><tr><td>conv3</td><td>3 × 3 conv.96 ReLU, stride 2</td></tr><tr><td>conv4</td><td>3 × 3 conv.192 ReLU, stride 1, dropout 0.5</td></tr><tr><td>conv5</td><td>3 × 3 conv.192 ReLU, stride 1</td></tr><tr><td>conv6</td><td>3 × 3 conv. 192 ReLU, stride 2</td></tr><tr><td>conv7</td><td>3 × 3 conv.192 ReLU, stride 1, dropout 0.5</td></tr><tr><td>conv8</td><td>1 × 1 conv.192 ReLU, stride 1</td></tr><tr><td>conv9</td><td></td></tr><tr><td>pool</td><td>1 × 1 conv. 10 or 100 ReLU, stride 1</td></tr><tr><td></td><td>averaging over 6 × 6 spatial dimensions</td></tr><tr><td>softmax</td><td>10-way or 100-way softmax</td></tr></table>
|
md/train/HJxYwiC5tm/HJxYwiC5tm.md
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# WHY DO DEEP CONVOLUTIONAL NETWORKS GENERALIZE SO POORLY TO SMALL IMAGE TRANSFORMATIONS?
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Deep convolutional network architectures are often assumed to guarantee generalization for small image translations and deformations. In this paper we show that modern CNNs (VGG16, ResNet50, and InceptionResNetV2) can drastically change their output when an image is translated in the image plane by a few pixels, and that this failure of generalization also happens with other realistic small image transformations. Furthermore, we see these failures to generalize more frequently in more modern networks. We show that these failures are related to the fact that the architecture of modern CNNs ignores the classical sampling theorem so that generalization is not guaranteed. We also show that biases in the statistics of commonly used image datasets makes it unlikely that CNNs will learn to be invariant to these transformations. Taken together our results suggest that the performance of CNNs in object recognition falls far short of the generalization capabilities of humans.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep convolutional neural networks (CNNs) have revolutionized computer vision. Perhaps the most dramatic success is in the area of object recognition, where performance is now described as "superhuman" (He et al., 2015). A key to the success of any machine learning method is the inductive bias of the method, and clearly the choice of architecture in a neural network significantly affects the inductive bias. In particular, the choice of convolution and pooling in CNNs is motivated by the desire to endow the networks with invariance to irrelevant cues such as image translations, scalings, and other small deformations (Fukushima & Miyake, 1982; Zeiler & Fergus, 2014). This motivation was made explicit in the 1980s by Fukushima in describing the "neocognitron" architecture, which served as inspiration for modern CNNs (LeCun et al., 1989), "After finishing the process of learning, pattern recognition is performed on the basis of similarity in shape between patterns, and is not affected by deformation, nor by changes in size, nor by shifts in the position of the input patterns." (Fukushima, 1988)
|
| 12 |
+
|
| 13 |
+
Despite the excellent performance of CNNs on object recognition, the vulnerability to adversarial attacks suggests that superficial changes can result in highly non-human shifts in prediction (e.g. (Bhagoji et al., 2017; Su et al., 2017). In addition, filtering the image in the Fourier domain (in a way that does not change human prediction) also results in a substantial drop in prediction accuracy (Jo & Bengio, 2017). These and other results (Rodner et al., 2016) indicate that CNNs are not invariant to cues that are irrelevant to the object identity.
|
| 14 |
+
|
| 15 |
+
An argument against adversarial attacks on CNNs is that they often involve highly unnatural transformations to the input images, hence in some sense we would not expect CNNs to be invariant to these transformations. When considering more natural transformations, there is preliminary evidence that AlexNet (Krizhevsky et al., 2012) is robust to some of them (Zeiler & Fergus, 2014). On the other hand, there is also preliminary evidence for lack of robustness in the more modern networks for object classification (Bunne et al., 2018) and detection (Rosenfeld et al., 2018) along with studies suggesting that with small CNNs and the MNIST data, data augmentation is the main feature affecting CNN invariance (Kauderer-Abrams, 2017). An indirect method to probe for invariances measures the linearity of the learned representations under natural transformations to the input image (Lenc & Vedaldi, 2015; Hénaff & Simoncelli, 2015; Fawzi & Frossard, 2015; Cohen & Welling, 2014). The recent work of (Engstrom et al., 2017) investigates adversarial attacks that use only rotations and translations. They find that "simple transformations, namely translations and rotations alone, are sufficient to fool neural network-based vision models on a significant fraction of inputs" and show that advanced data augmentation methods can make the networks more robust.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Examples of jagged predictions of modern deep convolutional neural networks. Top: A negligible vertical shift of the object (Kuvasz) results in an abrupt decrease in the network’s predicted score of the correct class. Middle: A tiny increase in the size of the object (Lotion) produces a dramatic decrease in the network’s predicted score of the correct class. Bottom: A very small change in the bear’s posture results in an abrupt decrease in the network’s predicted score of the correct class. Colored dots represent images chosen from interesting $\mathbf { X }$ -axis locations of the graphs on the right. These dots illustrate sensitivity of modern neural networks to small, insignificant (to a human), and realistic variations in the image.
|
| 19 |
+
|
| 20 |
+
In this paper, we directly ask "why are modern CNNs not invariant to natural image transformations despite the architecture being explicitly designed to provide such invariances?". Specifically, we systematically examine the invariances of three modern deep CNNs: VGG-16 (Simonyan & Zisserman, 2014), ResNet-50 (He et al., 2016), and InceptionResNet-V2 (Szegedy et al., 2017). We find that modern deep CNNs are not invariant to translations, scalings and other realistic image transformations, and this lack of invariance is related to the subsampling operation and the biases contained in image datasets.
|
| 21 |
+
|
| 22 |
+
# 2 FAILURES OF MODERN CNNS
|
| 23 |
+
|
| 24 |
+
Figure 1 contains examples of abrupt failures following tiny realistic transformations for the InceptionResNet-V2 CNN. Shifting or scaling the object by just one pixel could result in a sharp change in prediction. In the top row, we embed the original image in a larger image and shift it in the image plane (while filling in the rest of the image with a simple inpainting procedure). In the middle row, we repeat this protocol with rescaling. In the bottom row, we show frames from a BBC film in which the ice bear moves almost imperceptibly between frames and the network’s output changes dramatically1.
|
| 25 |
+
|
| 26 |
+

|
| 27 |
+
Figure 2: Modern deep convolutional neural networks are sensitive to small image translations. A) Comparison of three networks of various depths in the task of vertical image translation depicted in figure 1. Images (rows) are randomly chosen from the ImageNet dataset (Deng et al., 2009), and are sorted by the network’s prediction sum in a descending order. B) More modern networks have more jagged predictions.
|
| 28 |
+
|
| 29 |
+
In order to measure how typical these failures are, we randomly chose images from the ImageNet validation set and measured the output of three modern CNNs as we embedded these images in a larger image and systematically varied the vertical translation. As was the case in figure 1, we used a simple inpainting procedure to fill in the rest of the image.
|
| 30 |
+
|
| 31 |
+
Results are shown in figure 2. Each row corresponds to an image under different translations and the color denotes the network’s estimate of the probability of the correct class. Thus a row that is all light corresponds to a correct classification that is invariant to translation, while a row that is all dark corresponds to an incorrect classification that is invariant to translation. Surprisingly, many rows show abrupt transitions from light to dark, indicating that the classification changes abruptly as the object is translated. We quantify the lack of invariance by a measure we call "jaggedness": the number of times the network’s predictions had the correct class in its top-5 and after just one pixel shift it moved outside of the top-5 (and also the opposite transition from non-top-5 to top5). Using this measure, we find that for approximately $30 \%$ of the images, the output is "jagged", i.e the network changes its prediction by a shift of a single pixel. Also, as shown in the right of figure 2, jaggedness is greater for the modern, deeper, networks compared to the less modern VGG16 network. While the deeper networks have better test accuracy, they are also less invariant. In the appendix we also show an alternative to the "jaggedness" measure, which gives similar results.
|
| 32 |
+
|
| 33 |
+
A natural criticism of these results is that they are somehow related to the image resizing and inpainting procedures that we used. To test this possibility, we repeated the experiment with a different protocol where we chose different crops of the original ImageNet image while making sure that the object bounding box remained within the crop. This protocol does not require any inpainting while still translating the object location within the new image. Results are shown in the appendix. We still have a large fraction of images for which the prediction is not invariant to translation. We also show in the appendix similar results for scaling rather than translation. Overall we find that regardless of the protocol used, modern CNNs often change their output significantly as a result of a small translation or scaling.
|
| 34 |
+
|
| 35 |
+
# 3 IGNORING THE SAMPLING THEOREM
|
| 36 |
+
|
| 37 |
+
The failure of CNNs to generalize to image translations is particularly puzzling. Intuitively, it would seem that if all layers in a network are convolutional then the representation should simply translate when an image is translated. If the final features for classification are obtained by a global pooling operation on the representation (as is done for example in ResNet50 and InceptionResNetV2) then these features should be invariant to translation. Where does this intuition fail?
|
| 38 |
+
|
| 39 |
+

|
| 40 |
+
Figure 3: The deeper the network, the less shiftable are the feature maps. A) A vertical shift of a "Kuvasz" dog in the image plane. B) Feature maps from three different network architectures in response to the translated Kuvasz image. Layer depth assignments reflect the number of trainable convolutional layers preceding the selected layer. The last layer is always the last convolutional layer in each network.
|
| 41 |
+
|
| 42 |
+
This intuition ignores the subsampling operation which is prevalent in modern CNNs, also known as "stride". This failure of translation invariance in systems with subsampling was explicitly discussed in Simoncelli et al. (Simoncelli et al., 1992) who wrote "We cannot literally expect translation invariance in a system based on convolution and subsampling: translation of the input signal cannot produce simple translations of the transform coefficients, unless the translation is a multiple of each of the subsampling factors in the system". Since deep networks often contain many subsampling operations, the subsampling factor of the deep layers may be very large so that "literal" translation invariance only holds for very special translations. In InceptionResnetV2, for example, the subsampling factor is 60, so we expect exact translation invariance to hold only for $\scriptstyle { \frac { 1 } { 6 0 ^ { 2 } } }$ of possible translations.
|
| 43 |
+
|
| 44 |
+
Simoncelli et al. also defined a weaker form of translation invariance, which they called "shiftability" and showed that it can hold for systems with subsampling (this is related to weak translation invariance as defined by (Lenc & Vedaldi, 2015), see also (Esteves et al., 2017; Cohen & Welling, 2014) for related ideas applied to neural networks). Here we extend the basic shiftability result to show that when shiftability holds, then global pooling will indeed yield invariant representations.
|
| 45 |
+
|
| 46 |
+
We define $r ( x )$ as the response of a feature detector at location $x$ in the image plane. We say that this response is "convolutional" if translating the image by any translation $\delta$ yields a translation of the response by the same $\delta$ . This definition includes cases when the feature response is obtained by convolving the input image with a fixed filter, but also includes combinations of linear operations and nonlinear operations that do not include any subsampling.
|
| 47 |
+
|
| 48 |
+
We start by a trivial observation:
|
| 49 |
+
|
| 50 |
+
Observation: If $r ( x )$ is convolutional then global pooling $\begin{array} { r } { r = \sum _ { x } r ( x ) } \end{array}$ is translation invariant.
|
| 51 |
+
|
| 52 |
+
Proof: This follows directly from the definition of a convolutional response. If $r ( x )$ is the feature response to one image and $r _ { 2 } ( x )$ is the feature response to the same image translated, then $\textstyle \sum _ { x } r ( x ) =$ $\textstyle \sum _ { x } ^ { * } r _ { 2 } ( x )$ since the two responses are shifts of each other.
|
| 53 |
+
|
| 54 |
+
Definition: A feature detector $r ( x )$ with subsampling factor $s$ is called “shiftable” if for any $x$ the detector output at location $x$ can be linearly interpolated from the responses on the sampling grid:
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
r ( x ) = \sum _ { i } B _ { s } ( x - x _ { i } ) r ( x _ { i } )
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
where $x _ { i }$ are located on the sampling grid for subsampling factor $s$ and $B _ { s } ( x )$ is the basis function for reconstructing $r ( x )$ from the samples.
|
| 61 |
+
|
| 62 |
+
The classic Shannon-Nyquist theorem tells us that $r ( x )$ will be shiftable if and only if the sampling frequency is at least twice the highest frequency in $r ( x )$ .
|
| 63 |
+
|
| 64 |
+
Claim: If $r ( x )$ is shiftable then global pooling on the sampling grid $\begin{array} { r } { r = \sum _ { i } r ( x _ { i } ) } \end{array}$ is translation invariant.
|
| 65 |
+
|
| 66 |
+
Proof: This follows from the fact that global pooling on the sampling grid is (up to a constant) the same as global pooling for all $x$ .
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\begin{array} { l c l } { \displaystyle \sum _ { x } r ( x ) } & { = } & { \displaystyle \sum _ { x } \sum _ { i } r ( x _ { i } ) B ( x - x _ { i } ) } \\ { \displaystyle } & { = } & { \displaystyle \sum _ { i } r ( x _ { i } ) \sum _ { x } B ( x - x _ { i } ) } \\ { \displaystyle } & { = } & { K \sum _ { i } r ( x _ { i } ) } \end{array}
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
where $\begin{array} { r } { K = \sum _ { x } B ( x - x _ { i } ) } \end{array}$ and $K$ does not depend on $x _ { i }$
|
| 73 |
+
|
| 74 |
+
While the claim focuses on a global translation, it can also be extended to piecewise constant transformations.
|
| 75 |
+
|
| 76 |
+
Corollary: Consider a set of transformations $T$ that are constant on a set of given image subareas. If $r ( x )$ is shiftable and for a given image, the support of $r ( x )$ and its receptive field is contained in the same subregion for all transformations in $T$ , then global pooling on the sampling grid is invariant to any transformation in $T$ .
|
| 77 |
+
|
| 78 |
+
Proof: This follows from the fact that applying any transformation in $T$ to an image has the same effect on the feature map $r ( x )$ as translating the image.
|
| 79 |
+
|
| 80 |
+
To illustrate the importance of the sampling theorem in guaranteeing invariance in CNNs, consider a convolutional layer in a deep CNN where each unit acts as a localized "part detector" (this has been reported to be the case for many modern CNNs (Zeiler & Fergus, 2014; Zhou et al., 2014)). Each such part detector has a spatial tuning function and the degree of sharpness of this tuning function will determine whether the feature map can be subsampled while preserving shiftability or not. For example, consider a part detector that fires only when the part is exactly at the center of its receptive field. If there is no subsampling, then as we translate the input image, the feature map will translate as well, and the global sum of the feature map is invariant to translation. But if we subsample by two (or equivalently use a stride of two), then there will only be activity in the feature map when the feature is centered on an even pixel, but not when it is centered on an odd pixel. This means that the global sum of the feature map will not be invariant to translation.
|
| 81 |
+
|
| 82 |
+
In the language of Fourier transforms, the problem with a part detector that fires only when the part is exactly at the center of the receptive field is that the feature map contains many high frequencies and hence it cannot be subsampled while preserving shiftability. On the other hand, if we have a part detector whose spatial tuning function is more broad, it can be shiftable and our claim (above) shows that the global sum of activities in a feature map will be preserved for all translations, even though the individual firing rates of units will still be different when the part is centered at an odd pixel or an even pixel. Our corollary (above), shows the importance of shiftability to other smooth transformations: in this case each "part detector" will translate with a different translation but it is still the case that nonshiftable representations will not preserve the global sum of activities as the image is transformed, while shiftable representations will.
|
| 83 |
+
|
| 84 |
+
Figure 3 examines the extent to which the representations learned by modern CNNs are invariant or shiftable. The top row shows an image that is translated vertically, while the bottom three rows show the representations in different layers for the three CNNs we consider. For VGG16 the representation appears to shift along with the object, including the final layer where the blurred pattern of response is not a simple translation of the original response, but seems to preserve the global sum for this particular image. For the two more modern networks, the responses are sharper but lose their shiftability in the later layers. In particular, the final layers show approximate invariance to one special translation but no response at all to another translation, suggesting that the many layers of subsampling yield a final response that is not shiftable.
|
| 85 |
+
|
| 86 |
+
We also performed a more quantitative measure of shiftability by counting for a given image the number of times the global sum of activities in each layer changes significantly (more than $20 \%$ of mean) as the input is shifted (for each image, we only considered feature maps where the maximum response was above a threshold). We call this measure "nonshiftability". According to the preceding analysis, in architectures that obey the sampling theorem, the global sum should be invariant to input translation so nonshiftability should be zero in all layers. We find that for all three networks, the initial layers have nonshiftability close to zero but as we go deeper and deeper nonshiftability increases. Furthermore, the deeper, more modern networks, exhibit larger nonshiftability in their deep layers compared to VGG16 (see appendix for graphs).
|
| 87 |
+
|
| 88 |
+
How can we guarantee that representations in CNNs will be shiftable? As explained above, we need to make sure that any feature map that uses stride does not contain frequencies above the Nyquist frequency. If CNNs were purely linear, we could simply blur the input images so that they would not include any frequencies higher than the Nyquist limit determined by the final sampling factor of the network. But since CNNs also include nonlinearities, they can add high frequencies that were not present in the input.
|
| 89 |
+
|
| 90 |
+
An important message of the sampling theorem is that you should always blur before subsampling. Translated to the language of neural networks this means that stride (i.e. subsampling) should always be combined with pooling (i.e. blurring) in the preceding layer. Indeed if we have an arbitrarily deep CNN where all the layers use stride $^ { = 1 }$ followed by one layer that has a stride greater than one, then by choosing the pooling window appropriately we can guarantee that the final layer will still be shiftable. If we do not use appropriate pooling then there is no guarantee that this layer will be shiftable. Even if we use appropriate pooling that ensures that a given layer is shiftable, the subsequent nonlinearities in a CNN may not preserve the shiftability, as the nonlinearities may again introduce high frequencies.
|
| 91 |
+
|
| 92 |
+
To illustrate the effect of pooling on shiftability in modern CNNs we replaced the $2 \times 2$ max pooling layers of VGG16 with $6 \times 6$ average pooling. This has the effect of reducing low freqencies but given the nonlinearities, it does not guarantee shiftability. As shown in figure 4 this simple change makes the representations approximately shiftable and, as predicted by our theory, the global sum is now invariant to both translations and rescalings of the input. This invariance of course comes with a price: the feature maps now have less detail and in preliminary experiments we find that recognition performance decreases somewhat. But the sampling theorem tells us that if we want to use subsampling while avoiding aliasing, we need to ensure that no high frequencies (relative to the Nyquist frequency) are present in the feature maps.
|
| 93 |
+
|
| 94 |
+
As an alternative to pooling, Ruderman et al. (Ruderman et al., 2018) have shown that networks may learn smooth filters that will lead to reduced sensitivity to transformations. Evidently, the filters learned in standard VGG16 are not smooth enough.
|
| 95 |
+
|
| 96 |
+
# 4 WHY DON’T MODERN CNNS LEARN TO BE INVARIANT FROM DATA?
|
| 97 |
+
|
| 98 |
+
While the preceding discussion suggests that the CNN architecture will not yield translation invariance "for free", there is still the possibility that the CNN will learn a translation invariant prediction from the training examples. This requires that the training set will actually be invariant to the irrelevant transformations. We examined the degree of invariance in the ImageNet training set by manually labeling the training images in five categories: Tibetan terrier, elephant, pineapple, bagel and rowing paddle.
|
| 99 |
+
|
| 100 |
+
Consistent with previous results on "dataset bias" (Simon et al., 2007; Raguram & Lazebnik, 2008; Berg & Berg, 2009; Torralba & Efros, 2011; Weyand & Leibe, 2011; Mezuman & Weiss, 2012) we find that the ImageNet dataset is not invariant to translations and rescalings. Figure 5 shows the distribution of the distances between the eyes of a "Tibetan terrier" and the positions of the center point between the dog’s eyes. Notice that both distributions are far from uniform. Similar results are obtained for the other four categories.
|
| 101 |
+
|
| 102 |
+

|
| 103 |
+
Figure 4: Average pooling makes VGG representations approximately shiftable. Plotted are summation of feature maps from the last layer of VGG (spatial dimension $7 { \bf x } 7 $ ) as an input image is vertically translated in the image plane (top), or rescaled (bottom). Left: the original VGG16 with its $2 \mathbf { x } 2$ max pooling layers. Right: VGG16 where every $2 \mathbf { x } 2$ max pooling layer was replaced by a 6x6 average pooling layer. More randomly selected images are shown in the appendix.
|
| 104 |
+
|
| 105 |
+

|
| 106 |
+
Figure 5: Photographer’s biases in the ImageNet’s “Tibetan terrier” category. Left: Example of the hand-labeling procedure. Middle: Positions of the middle point between the dog’s eyes. Right: Histogram of distances between the dog’s eyes. Notice the bias in both the object’s position and scale.
|
| 107 |
+
|
| 108 |
+
To be more quantitative, we used the available bounding-box labels, and extracted the center point of the bounding-box and its height as proxies for the object position and size respectively. We then applied a statistical significance test to ask whether object location and object sizes were uniform for that category. For more than 900 out of the 1000 categories we found that location and size were highly non uniform $( P < 1 0 ^ { - 1 0 }$ ). Given these strong biases, we cannot expect a learning system to learn to be invariant.
|
| 109 |
+
|
| 110 |
+
Even if the training set is not invariant, we can make it invariant using data augmentation. Will this make the CNN learn an invariant prediction? First, we note that we used pretrained networks and according to the authors’ description of the training procedure, all three networks were trained using data augmentation. Obviously, not any data augmentation is sufficient for the networks to learn invariances. To understand the failure of data augmentation, it is again instructive to consider the subsampling factor. Since in modern networks the subsampling factor is approximately 60, then for a system to learn complete invariance to translation only, it would need to see $6 0 ^ { \mathrm { { 2 } } } = 3 6 0 0$ augmented versions of each training example, or it would need to have an inductive bias that allows it to generalize over transformations. If we also add invariance to rotations and scalings, the number grows exponentially with the number of irrelevant transformations. Engstrom et al. (Engstrom et al., 2017) suggest a sophisticated data augmentation method and show that it increases the invariance to translation and rotation. However, for challenging datasets such as ImageNet the lack of invariance largely persists.
|
| 111 |
+
|
| 112 |
+

|
| 113 |
+
Figure 6: The performance of modern CNNs on test images from ImageNet that are embedded in a random location in a larger image is quite poor (less than $50 \%$ accuracy). Human performance is not affected. Right: An example of a full sized image and the same image resized to $1 0 0 \mathrm { x } 1 0 0$ .
|
| 114 |
+
|
| 115 |
+
# 5 IMPLICATIONS FOR PRACTICAL SYSTEMS
|
| 116 |
+
|
| 117 |
+
Although our results show that modern CNNs fail to generalize for small image transformations, their performance on the ImageNet test set is still amazingly good and far better than previous techniques. This is related to the fact that the ImageNet test set contains the same photographer’s biases as the training set, so generalization to very different sizes and locations is not required. To highlight this point, we created a new test set in which ImageNet images were embedded in a larger image in a random location (and the missing pixels were filled in using a simple inpainting algorithm). Figure 6 shows that human performance is not affected by the rescaling and random translations, while the performance of modern CNNs deteriorates dramatically. In fact, when images are scaled to half their original size and randomly translated, the accuracy of modern CNNs is less than $50 \%$ , typically considered poor performance.
|
| 118 |
+
|
| 119 |
+
One way in which modern systems partially address the lack of invariance is using test time augmentation in which the system output on a given image is computed by a majority vote among many random crops of the image. Clearly this is wasteful in resources and still only provides partial invariance.
|
| 120 |
+
|
| 121 |
+
# 6 DISCUSSION
|
| 122 |
+
|
| 123 |
+
CNN architectures were designed based on an intuition that the convolutional structure and pooling operations will give invariance to translations and small image deformations "for free". In this paper we have shown that this intuition breaks down once subsampling, or "stride" is used and we have presented empirical evidence that modern CNNs do not display the desired invariances since the architecture ignores the classic sampling theorem. This still leaves open the possibility of a CNN learning invariance from the data but we have shown that the ImageNet training and testing examples include significant photographer’s bias so that it is unlikely that a system will learn invariance using these examples.
|
| 124 |
+
|
| 125 |
+
In addition to pointing out these failures, the sampling theorem also suggests a way to impose translation invariance by ensuring that all representations are sufficiently blurred to overcome the subsampling. However, such blurred representations may lead to a decrease in performance, especially in datasets and benchmarks that contain photographer’s bias. Alternatively, one could use specially designed features in which invariance is hard coded or neural network architectures that explicitly enforce invariance (Sifre & Mallat, 2013; Gens & Domingos, 2014; Cheng et al., 2016a;b; Dieleman et al., 2016; 2015; Xu et al., 2014; Worrall et al., 2017; Cohen & Welling, 2016). Again, as long as the datasets contain significant photographer’s bias, such invariant approaches may lead to a decrease in performance.
|
| 126 |
+
|
| 127 |
+
# REFERENCES
|
| 128 |
+
|
| 129 |
+
Tamara L Berg and Alexander C Berg. Finding iconic images. In Computer Vision and Pattern Recognition Workshops, 2009. CVPR Workshops 2009. IEEE Computer Society Conference on, pp. 1–8. IEEE, 2009.
|
| 130 |
+
|
| 131 |
+
Arjun Nitin Bhagoji, Warren He, Bo Li, and Dawn Song. Exploring the space of black-box attacks on deep neural networks. arXiv preprint arXiv:1712.09491, 2017.
|
| 132 |
+
|
| 133 |
+
Charlotte Bunne, Lukas Rahmann, and Thomas Wolf. Studying invariances of trained convolutional neural networks. arXiv preprint arXiv:1803.05963, 2018.
|
| 134 |
+
|
| 135 |
+
Gong Cheng, Peicheng Zhou, and Junwei Han. Learning rotation-invariant convolutional neural networks for object detection in vhr optical remote sensing images. IEEE Transactions on Geoscience and Remote Sensing, 54(12):7405–7415, 2016a.
|
| 136 |
+
|
| 137 |
+
Gong Cheng, Peicheng Zhou, and Junwei Han. Rifd-cnn: Rotation-invariant and fisher discriminative convolutional neural networks for object detection. In Computer Vision and Pattern Recognition (CVPR), 2016 IEEE Conference on, pp. 2884–2893. IEEE, 2016b.
|
| 138 |
+
|
| 139 |
+
Taco Cohen and Max Welling. Group equivariant convolutional networks. In International Conference on Machine Learning, pp. 2990–2999, 2016.
|
| 140 |
+
|
| 141 |
+
Taco S Cohen and Max Welling. Transformation properties of learned visual representations. arXiv preprint arXiv:1412.7659, 2014.
|
| 142 |
+
|
| 143 |
+
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.
|
| 144 |
+
|
| 145 |
+
Sander Dieleman, Kyle W Willett, and Joni Dambre. Rotation-invariant convolutional neural networks for galaxy morphology prediction. Monthly notices of the royal astronomical society, 450(2): 1441–1459, 2015.
|
| 146 |
+
|
| 147 |
+
Sander Dieleman, Jeffrey De Fauw, and Koray Kavukcuoglu. Exploiting cyclic symmetry in convolutional neural networks. arXiv preprint arXiv:1602.02660, 2016.
|
| 148 |
+
|
| 149 |
+
Logan Engstrom, Dimitris Tsipras, Ludwig Schmidt, and Aleksander Madry. A rotation and a translation suffice: Fooling cnns with simple transformations. CoRR, abs/1712.02779, 2017. URL http://arxiv.org/abs/1712.02779.
|
| 150 |
+
|
| 151 |
+
Carlos Esteves, Christine Allen-Blanchette, Xiaowei Zhou, and Kostas Daniilidis. Polar transformer networks. arXiv preprint arXiv:1709.01889, 2017.
|
| 152 |
+
|
| 153 |
+
Alhussein Fawzi and Pascal Frossard. Manitest: Are classifiers really invariant? arXiv preprint arXiv:1507.06535, 2015.
|
| 154 |
+
|
| 155 |
+
Kunihiko Fukushima. Neocognitron: A hierarchical neural network capable of visual pattern recognition. Neural networks, 1(2):119–130, 1988.
|
| 156 |
+
|
| 157 |
+
Kunihiko Fukushima and Sei Miyake. Neocognitron: A self-organizing neural network model for a mechanism of visual pattern recognition. In Competition and cooperation in neural nets, pp. 267–285. Springer, 1982.
|
| 158 |
+
|
| 159 |
+
Robert Gens and Pedro M Domingos. Deep symmetry networks. In Advances in neural information processing systems, pp. 2537–2545, 2014.
|
| 160 |
+
|
| 161 |
+
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.
|
| 162 |
+
|
| 163 |
+
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.
|
| 164 |
+
|
| 165 |
+
Olivier J Hénaff and Eero P Simoncelli. Geodesics of learned representations. arXiv preprint arXiv:1511.06394, 2015.
|
| 166 |
+
|
| 167 |
+
Jason Jo and Yoshua Bengio. Measuring the tendency of cnns to learn surface statistical regularities. arXiv preprint arXiv:1711.11561, 2017.
|
| 168 |
+
|
| 169 |
+
Eric Kauderer-Abrams. Quantifying translation-invariance in convolutional neural networks. arXiv preprint arXiv:1801.01450, 2017.
|
| 170 |
+
|
| 171 |
+
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.
|
| 172 |
+
|
| 173 |
+
Yann LeCun, Bernhard Boser, John S Denker, Donnie Henderson, Richard E Howard, Wayne Hubbard, and Lawrence D Jackel. Backpropagation applied to handwritten zip code recognition. Neural computation, 1(4):541–551, 1989.
|
| 174 |
+
|
| 175 |
+
Karel Lenc and Andrea Vedaldi. Understanding image representations by measuring their equivariance and equivalence. In Computer Vision and Pattern Recognition (CVPR), 2015 IEEE Conference on, pp. 991–999. IEEE, 2015.
|
| 176 |
+
|
| 177 |
+
Elad Mezuman and Yair Weiss. Learning about canonical views from internet image collections. In Advances in Neural Information Processing Systems, pp. 719–727, 2012.
|
| 178 |
+
|
| 179 |
+
Rahul Raguram and Svetlana Lazebnik. Computing iconic summaries of general visual concepts. In Computer Vision and Pattern Recognition Workshops, 2008. CVPRW’08. IEEE Computer Society Conference on, pp. 1–8. IEEE, 2008.
|
| 180 |
+
|
| 181 |
+
Erik Rodner, Marcel Simon, Robert B Fisher, and Joachim Denzler. Fine-grained recognition in the noisy wild: Sensitivity analysis of convolutional neural networks approaches. arXiv preprint arXiv:1610.06756, 2016.
|
| 182 |
+
|
| 183 |
+
Amir Rosenfeld, Richard Zemel, and John K Tsotsos. The elephant in the room. arXiv preprint arXiv:1808.03305, 2018.
|
| 184 |
+
|
| 185 |
+
Avraham Ruderman, Neil C. Rabinowitz, Ari S. Morcos, and Daniel Zoran. Learned deformation stability in convolutional neural networks. CoRR, abs/1804.04438, 2018. URL http://arxiv. org/abs/1804.04438.
|
| 186 |
+
|
| 187 |
+
Laurent Sifre and Stéphane Mallat. Rotation, scaling and deformation invariant scattering for texture discrimination. In Computer Vision and Pattern Recognition (CVPR), 2013 IEEE Conference on, pp. 1233–1240. IEEE, 2013.
|
| 188 |
+
|
| 189 |
+
Ian Simon, Noah Snavely, and Steven M Seitz. Scene summarization for online image collections. In Computer Vision, 2007. ICCV 2007. IEEE 11th International Conference on, pp. 1–8. IEEE, 2007.
|
| 190 |
+
|
| 191 |
+
Eero P Simoncelli, William T Freeman, Edward H Adelson, and David J Heeger. Shiftable multiscale transforms. IEEE transactions on Information Theory, 38(2):587–607, 1992.
|
| 192 |
+
|
| 193 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 194 |
+
|
| 195 |
+
Jiawei Su, Danilo Vasconcellos Vargas, and Sakurai Kouichi. One pixel attack for fooling deep neural networks. arXiv preprint arXiv:1710.08864, 2017.
|
| 196 |
+
|
| 197 |
+
Christian Szegedy, Sergey Ioffe, Vincent Vanhoucke, and Alexander A Alemi. Inception-v4, inceptionresnet and the impact of residual connections on learning. In AAAI, volume 4, pp. 12, 2017.
|
| 198 |
+
|
| 199 |
+
Antonio Torralba and Alexei A Efros. Unbiased look at dataset bias. In Computer Vision and Pattern Recognition (CVPR), 2011 IEEE Conference on, pp. 1521–1528. IEEE, 2011.
|
| 200 |
+
|
| 201 |
+
Tobias Weyand and Bastian Leibe. Discovering favorite views of popular places with iconoid shift. In Computer Vision (ICCV), 2011 IEEE International Conference on, pp. 1132–1139. IEEE, 2011.
|
| 202 |
+
|
| 203 |
+
Daniel E Worrall, Stephan J Garbin, Daniyar Turmukhambetov, and Gabriel J Brostow. Harmonic networks: Deep translation and rotation equivariance. In Proc. IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), volume 2, 2017.
|
| 204 |
+
|
| 205 |
+
Yichong Xu, Tianjun Xiao, Jiaxing Zhang, Kuiyuan Yang, and Zheng Zhang. Scale-invariant convolutional neural networks. arXiv preprint arXiv:1411.6369, 2014.
|
| 206 |
+
|
| 207 |
+
Matthew D Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In European conference on computer vision, pp. 818–833. Springer, 2014.
|
| 208 |
+
|
| 209 |
+
Bolei Zhou, Aditya Khosla, Àgata Lapedriza, Aude Oliva, and Antonio Torralba. Object detectors emerge in deep scene cnns. CoRR, abs/1412.6856, 2014. URL http://arxiv.org/abs/ 1412.6856.
|
| 210 |
+
|
| 211 |
+
# APPENDIX
|
| 212 |
+
|
| 213 |
+
# A PIPELINE FOR PRODUCING THE BOTTOM ROW OF FIGURE 1
|
| 214 |
+
|
| 215 |
+
We download this video: https://www.youtube.com/watch?v=0mgnf6t9VEc using an online downloader. We load the video frames and resize them to 299 by 299 as used by the standard Keras applications framework (https://keras.io/applications/). We preprocess the frames using the standard Keras preprocessing function. Finally, we use the predictions of the InceptionV3 model to demonstrate the jagged behavior shown in figure 1.
|
| 216 |
+
|
| 217 |
+
# B OTHER SUPPLEMENTARY MATERIAL
|
| 218 |
+
|
| 219 |
+
<table><tr><td>Network</td><td>Top-1</td><td>Top-5</td><td>Parameters</td><td>Depth</td></tr><tr><td>VGG16 (Simonyan & Zisserman, 2014)</td><td>0.715</td><td>0.901</td><td>138,357,544</td><td>16</td></tr><tr><td>ResNet50 (He et al., 2016)</td><td>0.759</td><td>0.929</td><td>25,636,712</td><td>50</td></tr><tr><td>InceptionResNetV2 (Szegedy et al., 2017)</td><td>0.804</td><td>0.953</td><td>55,873,736</td><td>134</td></tr></table>
|
| 220 |
+
|
| 221 |
+
Table 1: The networks used (taken from (https://keras.io/applications/))
|
| 222 |
+
|
| 223 |
+

|
| 224 |
+
Figure 7: We also measure jaggedness using the Mean Absolute Difference (MAD) in the probability of the correct response as the image is shifted by a single pixel. Results are similar to those using the jaggedness measure described in the text.
|
| 225 |
+
|
| 226 |
+

|
| 227 |
+
Figure 8: Modern deep convolutional neural networks are sensitive to small image translations (Without image downscaling). A) Example of InceptionResNetV2 sensitivity to very small horizontal translations. B) Comparison of three networks of various depths (16, 50, and 134 for VGG16, ResNet50, and InceptionResNetV2 respectively) in the task of horizontal image translation. Rows are sorted by sum. B) Modern networks have more jagged predictions. Jaggedness is calculated by counting the number of times the network’s predictions had the correct class in its top-5 and after just one pixel shift it moved outside of the top-5 (and also the opposite transition from non-top-5 to top5). Similar results can be seen with the alternative measure of jaggedness: Mean Absolute Difference (MAD)
|
| 228 |
+
|
| 229 |
+

|
| 230 |
+
Figure 9: Modern deep convolutional neural networks are sensitive to small image rescalings A) Comparison of three networks of various depths (16, 50, and 134 for VGG16, ResNet50, and InceptionResNetV2 respectively) in the task of image rescaling. Rows are sorted by their sum. B) Quantification of the jagged behaviour of the deep neural networks.
|
| 231 |
+
|
| 232 |
+

|
| 233 |
+
Figure 10: Nonshiftability as a function of depth in the three networks. Nonshiftability is defined as the number of times the global sum of a feature map changes by more than $20 \%$ of the mean as the input is translated. We only consider feature maps where the maximum response was above a threshold. According to our analysis, this measure should be zero if the representation is shiftable. Each line shows the nonshiftability in different layers in response to a randomly selected image.
|
| 234 |
+
|
| 235 |
+

|
| 236 |
+
Figure 11: Another randomly selected image. Plotted are summation of feature maps from the last layer of VGG (spatial dimension $7 \mathrm { x } 7$ ) as the input is vertically translated in the image plane (top), or rescaled (bottom). Left: the original VGG16 with its $2 \mathbf { x } 2$ max pooling layers. Right: VGG16 where every $2 \mathbf { x } 2$ max pooling layer was replaced by a 6x6 average pooling layer.
|
| 237 |
+
|
| 238 |
+

|
| 239 |
+
Figure 12: Another randomly selected image. Plotted are summation of feature maps from the last layer of VGG (spatial dimension $7 \mathrm { x } 7$ ) as the input is vertically translated in the image plane (top), or rescaled (bottom). Left: the original VGG16 with its $2 \mathbf { x } 2$ max pooling layers. Right: VGG16 where every 2x2 max pooling layer was replaced by a 6x6 average pooling layer.
|
| 240 |
+
|
| 241 |
+

|
| 242 |
+
Figure 13: Another randomly selected image. Plotted are summation of feature maps from the last layer of VGG (spatial dimension $7 \mathrm { x } 7$ ) as the input is vertically translated in the image plane (top), or rescaled (bottom). Left: the original VGG16 with its $2 \mathbf { x } 2$ max pooling layers. Right: VGG16 where every $2 \mathbf { x } 2$ max pooling layer was replaced by a 6x6 average pooling layer.
|
md/train/HkgB2TNYPS/HkgB2TNYPS.md
ADDED
|
@@ -0,0 +1,499 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# A THEORETICAL ANALYSIS OF THE NUMBER OF SHOTS IN FEW-SHOT LEARNING
|
| 2 |
+
|
| 3 |
+
Tianshi $\mathbf { C a o ^ { 1 , 2 } }$ , Marc T. Law1,2,3, Sanja Fidler1,2,3
|
| 4 |
+
1 Department of Computer Science, University of Toronto
|
| 5 |
+
2 Vector Institute
|
| 6 |
+
3 NVIDIA
|
| 7 |
+
{jcao, law, fidler}@cs.toronto.edu
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Few-shot classification is the task of predicting the category of an example from few labeled examples. The number of labeled examples per category is called the number of shots (or shot number). Recent works tackle this task through metalearning, where a meta-learner extracts information from observed tasks during meta-training to quickly adapt to new tasks during meta-testing. In this formulation, the number of shots exploited during meta-training has an impact on the recognition performance at meta-test time. Generally, the shot number used in meta-training should match the one used in meta-testing to obtain the best performance. We introduce a theoretical analysis of the impact of the shot number on Prototypical Networks, a state-of-the-art few-shot classification method. From our analysis, we propose a simple method that is robust to the choice of shot number used during meta-training, which is a crucial hyperparameter. The performance of our model trained for an arbitrary meta-training shot number shows great performance for different values of meta-testing shot numbers. We experimentally demonstrate our approach on different few-shot classification benchmarks.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Human cognition has the impressive ability of grasping new concepts from exposure to a handful of examples (Yger et al., 2015). In comparison, while modern deep learning methods achieve unprecedented performances with very deep neural-networks (He et al., 2016; Szegedy et al., 2015), they require extensive amounts of data to train, often ranging in the millions. Few-shot learning aims to bridge the sample-efficiency gap between deep learning and human learning in fields such as computer vision, reinforcement learning and speech recognition (Santoro et al., 2016; Ravi & Larochelle, 2017; Finn et al., 2017; Vinyals et al., 2016; Wang et al., 2019a). These methods fall under the framework of meta-learning, in which a meta-learner extracts knowledge from many related tasks (in the meta-training phase) and leverages that knowledge to quickly learn new tasks (in the meta-testing phase). In this paper, we focus on the few-shot classification problem where each task is defined as a $N$ -way classification problem with $k$ samples (shots) per class available for training.
|
| 16 |
+
|
| 17 |
+
Many meta-learning methods use the episodic training setup in which the meta-learner iterates through episodes in the meta-training phase. In each episode, a task is drawn from some population and a limited amount of support and query data from that task is made available. The meta-learner then learns a task-specific classifier on the support data and the classifier predicts on the query data. Updates to the meta-learner is computed based on the performance of the classifier on the query set. Evaluation of the meta-learner (during a phase called meta-testing) is also carried out in episodes in a similar fashion, except that the meta-learner is no longer updated and the performance on query data across multiple episodes is aggregated.
|
| 18 |
+
|
| 19 |
+
In the episodic setup, the selection of $k$ during meta-training time can have significant effects on the learning outcomes of the meta-learner. Intuitively, if support data is expected to be scarce, the meta-learner needs to provide strong inductive bias to the task-specific learner as the danger of overfitting is high. In contrast, if support data is expected to be abundant, then the meta-learner can provide generally more relaxed biases to the task-specific learner to achieve better fitting to the task data. Therefore it is plausible that a meta-learner trained with one $k$ value can be suboptimal at adapting to tasks with a different $k$ value and thus exhibit meta-overfitting to $k$ . In experiments, $k$ is often simply kept fixed between meta-training and meta-testing, but in real-world usage, one cannot expect to know beforehand the amount of support data from unseen tasks during deployment.
|
| 20 |
+
|
| 21 |
+
In this paper we will focus on Prototypical networks (Snell et al., 2017), a.k.a. ProtoNet. ProtoNet is of practical interest because of its flexibility: a single trained instance of ProtoNet can be used on new tasks with any $k$ and $N$ . However, ProtoNet exhibits performance degradation when the $k$ used in training does not match the $k$ used in testing.1 First, we will undertake a theoretical investigation to elicit the connection from $k$ to a lower bound of expected performance, as well as to the intrinsic dimension of the learned embedding space. Then, we conduct experiments to empirically verify our theoretical results across various settings. Guided by our new understanding of the effects of $k$ , we propose an elegant method to tackle performance degradation in mismatched $k$ cases. Our contributions are threefold:
|
| 22 |
+
|
| 23 |
+
• We provide performance bounds for ProtoNets given an embedding function. From which, we argue that $k$ affects learning and performance by scaling the contribution of intra-class variance.
|
| 24 |
+
|
| 25 |
+
• Through VC-learnability theory, we connect the value of $k$ used in meta-training to the intrinsic dimension of the embedding space.
|
| 26 |
+
|
| 27 |
+
• The most important contribution of this paper (introduced in Section 3.3) is a new method that improves upon vanilla ProtoNets by eliminating the performance degradation in cases where the $k$ is mismatched between meta-training and meta-testing. Our evaluation protocol more closely adheres to real-world scenarios where the model is exposed to different numbers of training samples.
|
| 28 |
+
|
| 29 |
+
# 2 BACKGROUND
|
| 30 |
+
|
| 31 |
+
# 2.1 PROBLEM SETUP
|
| 32 |
+
|
| 33 |
+
The few-shot classification problem considered in this paper is set up as described below. Consider a space of classes $C$ with a probability distribution $\tau$ , $N$ classes $\mathbf { c } \doteq \{ c _ { 1 } , . . . , c _ { N } \}$ are sampled i.i.d. from $\tau$ to form a $N$ -way classification problem. For each class $c _ { i }$ , $k$ support data are sampled from class-conditional distribution $S _ { i } = \{ _ { s } { \bf x } _ { 1 } , . . , _ { s } { \bf x } _ { k } \} \stackrel { i i d } { \sim } P ( { \bf x } | Y ( { \bf x } ) = c _ { i } )$ , where $\mathbf { x } \in \mathbb { R } ^ { D }$ , $D$ denotes the dimension of data, and $Y ( \mathbf { x } )$ denotes the class assignment of $\mathbf { x }$ . Note that we assume that $Y ( \mathbf { x } )$ is singular (e.g. each $\mathbf { x }$ can only have 1 label), and does not depend on $N$ (e.g. a data point with a label “cat” will always have the label “cat”), in contrast to $y$ defined below.
|
| 34 |
+
|
| 35 |
+
Additionally, the set $Q = \{ _ { q } \mathbf { x } _ { 1 } , . . . , _ { q } \mathbf { x } _ { l } \}$ containing $l$ query data is sampled from the joint distribution $\begin{array} { r } { \frac { 1 } { N } \sum _ { i = 1 } ^ { N } P ( \mathbf { x } | c _ { i } ) } \end{array}$ .2 For each $\mathbf { x }$ , let $y \in \{ 1 , . . . , N \}$ denote its label in the context of the few-shot classificafor class $c _ { i }$ n task. Define , and denote t $\hat { S } _ { i } = \left\{ ( _ { s } \mathbf { x } _ { 1 } , y _ { 1 } = i ) , . . . , ( _ { s } \mathbf { x } _ { k } , y _ { k } = i ) \right\}$ $N$ as as $\textstyle S = \bigcup _ { i = 1 } ^ { N } { \hat { S } } _ { i }$ set of supports. The few-shot classification task is to predict $y$ for each $\mathbf { x }$ in $Q$ given $S$ . During meta-training, the ground truth label for $Q$ is also available to the learner.
|
| 36 |
+
|
| 37 |
+
# 2.2 META-LEARNING SETUP
|
| 38 |
+
|
| 39 |
+
Meta-learning approaches train on a distribution of tasks to obtain information that generalizes to unseen tasks. For few-shot classification, a task is determined by which classes are involved in the $N$ -way classification task. During meta-training, the meta-learner observes episodes of few-shot classification tasks consisting of $N$ classes, $k$ labelled samples per class, and $l$ unlabelled samples, as previously described. The collection of all classes observed during meta-training forms the metatraining split $\mathcal { D } _ { t r } = \{ { _ { t r } c _ { 1 } } , . . . , { _ { t r } c _ { R } } \}$ . Critically, we assume that every unseen class that the learner is evaluated upon (during meta-testing) is also drawn from the same distribution $\tau$ .
|
| 40 |
+
|
| 41 |
+
# 2.3 PROTOTYPICAL NETWORKS
|
| 42 |
+
|
| 43 |
+
ProtoNets (Snell et al., 2017) compute $E$ -dimensional embeddings for all samples in $S$ and $Q$ . The embedding function $\phi : \mathbb { R } ^ { D } \mathbb { R } ^ { \dot { E } }$ is usually a deep network.The prototype representation for each class is formed by averaging the embeddings for all supports of said class: $\begin{array} { r } { \overline { { \phi ( S _ { i } ) } } = \frac { 1 } { k } \sum _ { \mathbf { x } \in S _ { i } } \phi ( \mathbf { x } ) } \end{array}$ . Classification of any input $\mathbf { x }$ (e.g. $\mathbf { x } \in Q$ i) is performed by computing the softmax over squared Euclidean distances of the input point’s embedding to the prototypes. Let $\hat { y }$ denote the prediction of the classifier for one of the categories $j \in \{ 1 , \cdots , N \}$ :
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
p _ { \phi } ( \hat { y } = j | \mathbf { x } , S ) = \frac { e ^ { - \left\| \phi ( \mathbf { x } ) - \overline { { \phi ( S _ { j } ) } } \right\| ^ { 2 } } } { \sum _ { i = 1 } ^ { N } e ^ { - \left\| \phi ( \mathbf { x } ) - \overline { { \phi ( S _ { i } ) } } ^ { 2 } \right\| } } \quad , \mathrm { w h e r e } \quad \left\| \mathbf { v } \right\| ^ { 2 } = \sum _ { d = 1 } ^ { E } v _ { d } ^ { 2 }
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
The parameters of the embedding functions are learned through meta-training. Negative log-likelihood $J ( \phi ) = - \log \left( p ( \hat { y } = y | \mathbf { x } ) \right)$ of the correct class $y$ is minimized on the query points through SGD.
|
| 50 |
+
|
| 51 |
+
As explained in (Law et al., 2019), ProtoNets can be seen as a metric learning approach optimized for the supervised hard clustering task (Law et al., 2016). The model $\phi$ is learned so that the representations of similar examples (i.e. belonging to a same category) are all grouped into the same cluster in $\mathbb { R } ^ { E }$ . We propose in this paper a subsequent metric learning step which learns a linear transformation that maximizes inter-to-intra class variance ratio.
|
| 52 |
+
|
| 53 |
+
# 3 PROPOSED METHOD
|
| 54 |
+
|
| 55 |
+
We first present theoretical results explaining the effect of the shot number on ProtoNets, and then introduce our method for addressing performance degradation in cases of mismatched shots.
|
| 56 |
+
|
| 57 |
+
# 3.1 RELATING $k$ TO LOWER BOUND OF EXPECTED ACCURACY
|
| 58 |
+
|
| 59 |
+
To better understand the role of $k$ on the performance of ProtoNets, we study how it contributes to the expected accuracy across episodes when using any kind of fixed embedding function (e.g. the embedding function obtained at the end of the meta-training phase). With $I$ denoting the indicator function, we define the expected accuracy $R$ as:
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
R ( \phi ) = \mathbb { E } _ { \mathbf { c } } \mathbb { E } _ { S , \mathbf { x } , y } I [ \arg \operatorname* { m a x } _ { j } \left\{ p _ { \phi } ( \hat { y } = j | \mathbf { x } , S ) \right\} = y ]
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
Definitions: Throughout this section, we will use the following symbols to denote the means and variances of embeddings under different expectations:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
{ \begin{array} { r l } & { \mathbf { \mu } _ { c } \triangleq \mathbb { E } _ { \mathbf { x } } [ \phi ( \mathbf { x } ) | \ X ( \mathbf { x } ) = c ] \qquad \quad \Sigma _ { c } \triangleq \mathbb { E } _ { \mathbf { x } } [ ( \phi ( \mathbf { x } ) - \mathbf { \mu } _ { c } ) ( \phi ( \mathbf { x } ) - \mathbf { \mu } _ { c } ) ^ { T } | \ Y ( \mathbf { x } ) = c ] } \\ & { \quad \mathbf { \mu } \triangleq \mathbb { E } _ { c } [ \mathbf { \mu } _ { c } ] \qquad \quad \Sigma \triangleq \mathbb { E } _ { c } [ ( \mathbf { \mu } _ { c } - \mathbf { \mu } ) ( \mathbf { \mu } _ { c } - \mathbf { \mu } ) ^ { T } ] } \end{array} }
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
Remark. $\mu _ { c }$ is the expectation of the embedding conditioned on class $c , \mu$ is the (full) expectation of the embedding, which can be expressed as the expectation of $\mu _ { c }$ over classes. $\Sigma$ is the variance of class means in the embedding space - it can be interpreted as the signal of the input to the classifier, as larger $\Sigma$ implies larger distances between classes. $\Sigma _ { c }$ is the expected intra-class variance - it represents the noise in the above signal.
|
| 72 |
+
|
| 73 |
+
Modelling assumptions of ProtoNets: The use of the squared Euclidean distance and softmax activation in ProtoNets implies that classification with ProtoNets is equivalent to a mixture density estimation on the support set with spherical Gaussian densities (Snell et al., 2017). Specifically, we adopt the modelling assumptions that the distribution of $\phi ( \mathbf { x } )$ given any class assignment is normally distributed $( p ( \phi ( \mathbf { x } ) \bar { | } Y ( \mathbf { x } ) \bar { = } c ) = \mathcal { N } ( \mu _ { c } , \Sigma _ { c } ) )$ , with equal covariance for all classes in the embedding space $( \forall ( c , c ^ { \prime } ) , \Sigma _ { c } = \Sigma _ { c ^ { \prime } } ) ^ { 3 }$ .
|
| 74 |
+
|
| 75 |
+
We present the analysis for the special case of episodes with binary classification (i.e. with $N = 2$ ) for ease of presentation, but the conclusion can be generalized to arbitrary $N > 2$ (see appendix).
|
| 76 |
+
|
| 77 |
+
Also, as noted in Section 2.1, we assume equal likelihood between the classes. We would like to emphasize that the assignment of labels can be permuted freely and the classifier’s prediction would not be affected due to symmetry. Hence, we only need to consider one case for the ground truth label without loss of generality. Let $a$ and $b$ denote any pair of classes sampled from $\tau$ . Let $\mathbf { x }$ be drawn from $a$ , and overload $a$ and $b$ to also indicate the ground truth label in the context of that episode, then equation 2 can be written as:
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
R ( \phi ) = \mathbb { E } _ { a , b \sim \tau } \mathbb { E } _ { \mathbf { x } , S } I [ \hat { y } = a ]
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
Additionally, noting that $p ( \hat { y } = a )$ can be expressed as a sigmoid function $\sigma$ :
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
p ( \hat { y } = a | \mathbf { x } ) = \frac { e ^ { - \left\| \phi ( \mathbf { x } ) - \overline { { \phi ( S _ { a } ) } } \right\| ^ { 2 } } } { e ^ { - \left\| \phi ( \mathbf { x } ) - \overline { { \phi ( S _ { b } ) } } \right\| ^ { 2 } } + e ^ { - \left\| \phi ( \mathbf { x } ) - \overline { { \phi ( S _ { a } ) } } \right\| ^ { 2 } } } = \sigma ( \left\| \phi ( \mathbf { x } ) - \overline { { \phi ( S _ { b } ) } } \right\| ^ { 2 } - \left\| \phi ( \mathbf { x } ) - \overline { { \phi ( S _ { a } ) } } \right\| ^ { 2 } )
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
We can express equation 3 as a probability:
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
R ( \phi ) = \operatorname* { P r } _ { a , b , \mathbf { x } , S } ( { \hat { y } } = a ) = \operatorname* { P r } _ { a , b , \mathbf { x } , S } ( \alpha > 0 )
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
We will introduce a few auxiliary results before stating the main result for this section.
|
| 96 |
+
|
| 97 |
+
Proposition 1. From the one-sided Chebyshev’s inequality, it immediately follows that:
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
R ( \phi ) = \mathrm { P r } ( \alpha > 0 ) \geq \frac { \mathbb { E } [ \alpha ] ^ { 2 } } { \mathrm { V a r } ( \alpha ) + \mathbb { E } [ \alpha ] ^ { 2 } }
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
In Lemma 1 and Lemma 2, we derive the expectation and variance of $\alpha$ when conditioned on the classes sampled in a episode. Then, in Theorem 3, we compose them into the $R H S$ of Proposition 1 through law of total expectation.
|
| 104 |
+
|
| 105 |
+
Lemma 1. Consider space of classes $C$ with sampling distribution $\tau$ $; , a , b \stackrel { i i d } { \sim } \tau .$ . Let $S = \{ S _ { a } , S _ { b } \}$ $S _ { a } = \left\{ { { \bf { \Psi } } _ { a } { \bf { x } } _ { 1 } } , . . . , { \bf { \Psi } } _ { a } { \bf { x } } _ { k } \right\}$ , $S _ { b } = \left\{ \vphantom { b } _ { b } \mathbf { x } _ { 1 } , . . . , \vphantom { b } _ { b } \mathbf { x } _ { k } \right\}$ , $k \in \mathbb N$ is the shot number, and $Y ( \mathbf { x } ) = a$ . Define ${ \overline { { \phi ( S _ { a } ) } } } \triangleq { \frac { 1 } { k } } \sum _ { \mathbf { x } \in S _ { a } } \phi ( \mathbf { x } )$ and ${ \overline { { \phi ( S _ { b } ) } } } \triangleq { \frac { 1 } { k } } \sum _ { \mathbf { x } \in S _ { b } } \phi ( \mathbf { x } )$ . Consider $\Sigma$ as defined earlier. Assume $p ( \phi ( \mathbf { x } ) | Y ( \mathbf { x } ) = c ) = N ( \mu _ { c } , \Sigma _ { c } )$ and $\Sigma _ { c } = \Sigma _ { c ^ { \prime } }$ for any choice of $c , c ^ { \prime } \in C$ , then,
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\mathbb { E } _ { \mathbf { x } , S | a , b } [ \alpha ] = \left( \mathtt { u } _ { a } - \mathtt { u } _ { b } \right) ^ { T } ( \mathtt { u } _ { a } - \mathtt { u } _ { b } ) \qquad , a n d \qquad \mathbb { E } _ { a , b , \mathbf { x } , S } [ \alpha ] = 2 \mathrm { T r } ( \Sigma ) .
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
Lemma 2. Under the same notation and assumptions as Lemma $I$ , additionally invoking definition for $\Sigma _ { c } ,$ then,
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
\mathbb { E } _ { a , b } [ \mathrm { V a r } ( \alpha | a , b ) ] \leq 8 ( 1 + \frac { 1 } { k } ) \mathrm { T r } \left( \Sigma _ { c } ( ( 1 + \frac { 1 } { k } ) \Sigma _ { c } + 2 \Sigma ) \right) .
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
The proofs of the above lemmas are in the appendix. With the results above, we are ready to state our main theoretical result in this section.
|
| 118 |
+
|
| 119 |
+
Theorem 3. Under the conditions where Lemma 1 and 2 hold, we have:
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
R ( \phi ) \geq \frac { 4 \mathrm { T r } ( \Sigma ) ^ { 2 } } { 8 ( 1 + 1 / k ) ^ { 2 } \mathrm { T r } ( \Sigma _ { c } ^ { 2 } ) + 1 6 ( 1 + 1 / k ) \mathrm { T r } ( \Sigma \Sigma _ { c } ) + \mathbb { E } _ { a , b } [ ( \mathbf { \mu } ( \mathbf { \mu } _ { a } - \mathbf { \mu } \mathbf { \mu } _ { b } ) ^ { T } ( \mathbf { \mu } _ { a } - \mathbf { \mu } \mathbf { \mu } _ { b } ) ) ^ { 2 } ] } .
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
Proof. First, we use decompose the $\mathrm { V a r } ( \alpha )$ term in Proposition 1 by Law of Total Expectation.
|
| 126 |
+
|
| 127 |
+
$$
|
| 128 |
+
\begin{array} { r l } & { \mathrm { V a r } ( \boldsymbol \alpha ) = \mathbb { E } _ { a , b , \mathbf { x } , S } [ \boldsymbol \alpha ^ { 2 } ] - \mathbb { E } _ { a , b , \mathbf { x } , S } [ \boldsymbol \alpha ] ^ { 2 } = \mathbb { E } _ { a , b } \mathbb { E } _ { \mathbf { x } , S } [ \boldsymbol \alpha ^ { 2 } | a , b ] - \mathbb { E } _ { a , b , \mathbf { x } , S } [ \boldsymbol \alpha ] ^ { 2 } } \\ & { \quad \quad \quad \quad = \mathbb { E } _ { a , b } [ \mathrm { V a r } ( \boldsymbol \alpha | a , b ) + \mathbb { E } _ { \mathbf { x } , S } [ \boldsymbol \alpha | a , b ] ^ { 2 } ] - \mathbb { E } _ { a , b , \mathbf { x } , S } [ \boldsymbol \alpha ] ^ { 2 } . } \end{array}
|
| 129 |
+
$$
|
| 130 |
+
|
| 131 |
+
Hence, Proposition 1 can also be expressed as
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
R ( \phi ) \geq \frac { \mathbb { E } [ \alpha ] ^ { 2 } } { \mathbb { E } _ { a , b } [ \mathrm { V a r } ( \alpha \vert a , b ) + \mathbb { E } _ { \mathbf { x } , S } [ \alpha \vert a , b ] ^ { 2 } ] } .
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
Finally, we arrive at Theorem 3 by plugging Lemma 1 and 2 into equation 10.
|
| 138 |
+
|
| 139 |
+
Several observations can be made from Theorem 3:
|
| 140 |
+
|
| 141 |
+
1. The shot number $k$ only appears in the first two terms of the denominator, implying that the bound saturates quickly with increasing $k$ . This is also in agreement with the empirical observation that meta-testing accuracy has diminishing improvements when more support data is added.
|
| 142 |
+
|
| 143 |
+
2. By observing the degree of terms in equation 7 (and treating the last term of the denominator as a constant), it is clear that increasing $k$ will decrease the sensitivity (magnitude of partial derivative) of this lower bound to $\Sigma _ { c }$ , and increase its sensitivity to $\Sigma$ .
|
| 144 |
+
|
| 145 |
+
3. If one postulates that meta-learning updates on $\phi$ are similar to gradient ascent on this accuracy lower bound, then learning with smaller $k$ emphasizes minimizing noise, while learning with higher $k$ emphasizes maximizing signal.
|
| 146 |
+
|
| 147 |
+
In conclusion, these observations give us a plausible reason for the performance degradation observed in mismatched shots: when an embedding function has been optimized (trained) for $k _ { t r a i n } ~ >$ $k _ { t e s t }$ , the relatively high $\Sigma _ { c }$ is amplified by the now smaller $k$ , resulting in degraded performance. Conversely, an embedding function trained for $k _ { t r a i n } ~ < ~ k _ { t e s t }$ already has small $\Sigma _ { c }$ , such that increasing $k$ during testing has further diminished improvement on performance.
|
| 148 |
+
|
| 149 |
+
# 3.2 INTERPRETATION IN TERMS OF VC DIMENSION
|
| 150 |
+
|
| 151 |
+
In any given episode, a nearest neighbour prediction is performed from the support data (with a fixed embedding function). Therefore, a PAC learnability interpretation of the relation between the number of support data and complexity of the classifier can be made. Specifically, for binary classification, classical PAC learning theory (Vapnik et al., 1994) states that with probability of at least $1 - \delta$ , the following inequality on the difference between empirical error $e r r _ { t r a i n }$ (of the support samples) and true error $e r r _ { t r u e }$ holds for any classifier $h$ :
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
e r r _ { t r u e } ( h ) - e r r _ { t r a i n } ( h ) \leq \sqrt { \frac { D ( \ln \frac { 4 k } { D } + 1 ) + \ln \frac { 4 } { \delta } } { 2 k } }
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
Where $D$ is the VC dimension, and $k$ is the number of support samples per class 4. Under this binary classification setting, the predictions of prototypical network are equal to $\sigma ( \alpha )$ as shown earlier. Denoting $\mathbf { z } _ { c } = \overline { { \phi ( S _ { c } ) } }$ and $\mathbf { z } _ { c ^ { \prime } } = \overline { { \phi ( S _ { c ^ { \prime } } ) } }$ , we can manipulate $\alpha$ as follows:
|
| 158 |
+
|
| 159 |
+
$$
|
| 160 |
+
\begin{array} { r l } { \alpha = \left\| \phi ( \mathbf { x } ) - \mathbf { z } _ { c } \right\| ^ { 2 } - \left\| \phi ( \mathbf { x } ) - \mathbf { z } _ { c ^ { \prime } } \right\| ^ { 2 } } & { { } = 2 ( \mathbf { z } _ { c ^ { \prime } } - \mathbf { z } _ { c } ) ^ { T } \phi ( \mathbf { x } ) + ( \mathbf { z } _ { c } ^ { T } \mathbf { z } _ { c } - \mathbf { z } _ { c ^ { \prime } } ^ { T } \mathbf { z } _ { c ^ { \prime } } ) } \end{array}
|
| 161 |
+
$$
|
| 162 |
+
|
| 163 |
+
From equation 12, the prototypes form a linear classifier with offset in the embedding space. The VC dimension of this type of classifier is $1 + d$ where $d$ is the intrinsic dimension of the embedding space (Vapnik, 1998). In ProtoNets, the intrinsic dimension of the embedding space is not only influenced by network architecture, but more importantly determined by the parameter themselves, making it a learned property. For example, if the embedding function can be represented with a linear transformation $\phi ( \mathbf { x } ) = \Phi \cdot \mathbf { x }$ , then the intrinsic dimension of the embedding space is upper bounded by the rank of $\Phi$ (since all embeddings must lie in the column space of $\Phi$ ). Thus, the number of support samples required to learn from an episode is proportional to the intrinsic dimension of the embedding space. We hypothesize that an embedding function optimal for lower shot (e.g. one-shot) classification affords fewer intrinsic dimensions than one that is optimal for higher shot (e.g. 10-shot) classification.
|
| 164 |
+
|
| 165 |
+
# 3.3 RECONCILING SHOT DISCREPANCY THROUGH EMBEDDING SPACE TRANSFORMATION
|
| 166 |
+
|
| 167 |
+
Observations in Section 3.2 reveal that an ideal $\phi$ would have an output space whose intrinsic dimension $d$ is as small as possible to minimize the right-hand side of equation 11 but just large enough to allow low $e r r _ { t r a i n }$ ; the balance between the two objectives is dictated by $k$ . Similarly, observations in Section 3.1 suggest that an ideal $\phi$ would balance between minimizing $\Sigma _ { c }$ and maximizing $\Sigma$ also according to $k$ . As a result, when there is discrepancy between meta-training shots and meta-testing shots5, accuracy at meta-test time will suffer. A naive solution is to prepare many embedding functions trained for different shots, and select the embedding function according to the availability of label data at test-time. However, this solution is computationally burdensome as it requires multiple models to be trained and stored. Instead, we want to train and store a single model, and then adapt the embedding function’s variance characteristics and the embedding space dimensionality to achieve good performance for any test shot.
|
| 168 |
+
|
| 169 |
+
Linear Discriminant Analysis (LDA) is a dimensionality reduction method suited for downstream classification (Fukunaga, 1990). Its goal is to find a maximally discriminating subspace (maximum inter-class variance and minimal intra-class variance) for a given classification task. Theoretically, performance can be maximized in each individual episode by computing the LDA transformation matrix using support samples of that episode. LDA computes the eigenvectors of the matrix $S ^ { - 1 } S _ { \mu }$ , where $S _ { \mu }$ is the covariance matrix of prototypes and $S$ is the class-conditional covariance matrix. In practice, $S _ { \mu }$ and $S$ cannot be stably estimated in few-shot episodes, preventing the direct application of LDA.
|
| 170 |
+
|
| 171 |
+
We propose an alternative which we call Embedding Space Transformation (EST). The purpose of EST is to perform dimensionality reduction on the features, while also improving the ratio in Theorem 3. This is a different goal from LDA because Theorem 3 demonstrates that the expected performance across many episodes can be improved by maximizing $\Sigma$ and minimizing $\Sigma _ { c }$ . Similar to LDA, EST works by applying a linear transformation
|
| 172 |
+
|
| 173 |
+
$$
|
| 174 |
+
\phi ( \mathbf { x } ) \mapsto V ^ { * } ( \phi ( \mathbf { x } ) )
|
| 175 |
+
$$
|
| 176 |
+
|
| 177 |
+
to the outputs of the embedding function. Here, $V ^ { * }$ is a linear transformation computed using $\mathcal { D } _ { t r }$ after meta-training has completed. To compute $V ^ { * }$ , we first iterate through all classes in $\mathcal { D } _ { t r }$ and compute their in-class means and covariance matrices in the embedding space. We can then find the covariance of means $\Sigma _ { \mu }$ , and the mean of covariances $\overline { { \Sigma } } _ { s }$ across $\mathcal { D } _ { t r }$ . Finally, $V ^ { * }$ is computed by taking the leading eigenvectors of $\Sigma _ { \mu } - \rho \overline { { \Sigma } } _ { s }$ - the difference between the covariance matrix of the mean and the mean covariance matrix with weight parameter $\rho$ . The exact procedure for computing $V ^ { * }$ is presented in the appendix.
|
| 178 |
+
|
| 179 |
+
# 4 EXPERIMENTS AND RESULTS
|
| 180 |
+
|
| 181 |
+
In this section, our first two experiments aim at supporting our theoretical results in Sections 3.1 and 3.2, while our third experiment demonstrates the improvement of EST on benchmark data sets over vanilla ProtoNets. To illustrate the applicability of our results to different embedding function architectures, all experiments are performed with both a vanilla 4-layer CNN (as in (Snell et al., 2017)) and a 7-layer Residual network (He et al., 2016). Detailed description of the architecture can be found in the appendix. Experiments are performed on three data sets: Omniglot (Lake et al., 2015), miniImageNet (Vinyals et al., 2016), and tieredImageNet (Ren et al., 2018). We followed standard data processing procedures which are detailed in the appendix.
|
| 182 |
+
|
| 183 |
+
# 4.1 TRAINING SHOTS AFFECT VARIANCE CONTRIBUTION
|
| 184 |
+
|
| 185 |
+
The total variance observed among embeddings of all data points can be seen as a composition of inter-class and (expected) intra-class variance based on the law of total variance $\mathrm { ( V a r } [ \mathbf { x } ] \ =$ $\mathbb { E } [ \mathrm { V a r } ( \mathbf { x } | c ) ] + \mathrm { V a r } ( \mathbb { E } [ \mathbf { x } | c ] ) = \mathbb { E } [ \Sigma _ { c } ] + \Sigma _ { \mu } )$ . Our analysis predicts that as we increase the shot number used during training, the ratio of inter-class to intra-class variance will decrease.
|
| 186 |
+
|
| 187 |
+
To verify this hypothesis, we trained ProtoNets (vanilla and residual) with a range of shots (1 to 10 on miniImageNet and tiered imagenet, 1 to 5 on Omniglot) until convergence with 3 random initializations per group. Then, we computed the inter-class and intra-class covariance matrices across all samples in the training-set embedded by each network. To qualify the amplitude of each matrix, we take the trace of each covariance matrix. The ratio of inter-class to intra-class variance is presented in Figure 1: as we increase $k$ used during training, the inter-class to intra-class variance ratio decreases. This trend can be observed in both vanilla and residual embeddings, and across all three data sets, lending strong support to our result in Section 3.1. Another observation can be made that the ratio between inter-class and intra-class variance is significantly higher in the Omniglot data set than the other two data sets. This may indeed be reflective of the relative difficulty of each data set and the accuracy of ProtoNet on the data sets.
|
| 188 |
+
|
| 189 |
+

|
| 190 |
+
Figure 1: Inter-class to Intra-class variance ratios of embedding space varies with $k$ used in training. Left: Omniglot. Right: miniImageNet and tieredImageNet.
|
| 191 |
+
|
| 192 |
+
# 4.2 TRAINING SHOTS AFFECT INTRINSIC DIMENSION
|
| 193 |
+
|
| 194 |
+
We consider the intrinsic dimension (id) of an embedding function with extrinsic dimension $E$ (operated on a data set) to be defined as the minimum integer $d$ where all embedded points of that data set lie within a $d$ -dimensional subspace of $\mathbb { R } ^ { E }$ (Bishop, 2006). A simple method for estimating $d$ is through principal component analysis (PCA) of the embedded data set. By eigendecomposing the covariance matrix of embeddings, we obtain the principal components expressed as the significant eigenvalues, and the principal directions expressed as the eigenvectors corresponding to those eigenvalues. The number of significant eigenvalues approximates the intrinsic dimension of the embedding space. When the subspace is linear, this approximation is exact; otherwise, it serves as an upper bound to the true intrinsic dimension (Fukunaga & Olsen, 1971).
|
| 195 |
+
|
| 196 |
+
We determine the number of significant eigenvalues by an explained-variance over total-variance criterion. The qualifying metric is $\begin{array} { r } { r _ { d } \triangleq \sum _ { i \in [ 1 , d ] } \lambda _ { i } / \sum _ { i \in [ 1 , E ] } \lambda _ { i } } \end{array}$ . In our experiments, we set the threshold for $r _ { d }$ at 0.9. Similar to the previous experiment, we train ProtoNets with different shots to convergence. The total covariance matrix is then computed on the training set and eigendecomposition is performed. The approximate id is plotted for various values of $k$ in Figure 2. We can see a clear trend that as we increase training shot, the id of the embedding space increases.
|
| 197 |
+
|
| 198 |
+

|
| 199 |
+
Figure 2: Intrinsic dimension approximated by the number of significant eigenvalues varies with $k$ used in training. Left: Omniglot. Right: miniImageNet and tieredImageNet
|
| 200 |
+
|
| 201 |
+
# 4.3 EXPERIMENTS WITH EST
|
| 202 |
+
|
| 203 |
+
We evaluate the performance of EST on the three aforementioned data sets. The performance is compared against our implementation of vanilla ProtoNets as a baseline, as well as a variant of ProtoNets using principal components obtained from all embedding points (ProtoNet-PCA).
|
| 204 |
+
|
| 205 |
+
All methods in this section use the same set of trained ProtoNets. As with before, networks are trained with $k \in \{ 1 , . . . , 5 \}$ on Omniglot and $k \in \{ 1 , . . . , 1 0 \}$ on miniImageNet and tieredImageNet. Additionally, we also trained a mixed-shot network for each data set. This is done by randomly selecting a value for $k$ within the specified range for each episode, and then sampling the corresponding number of support samples. Hyper-parameters for training are described in the appendix.
|
| 206 |
+
|
| 207 |
+
(a) Omniglot-20-way, with 4 layer CNN.
|
| 208 |
+
|
| 209 |
+
Table 1: Classification accuracies of ProtoNet variants. Best performing methods and any other runs within $9 5 \%$ confidence margin is in bold
|
| 210 |
+
(b) Omniglot-20-way, with 7 layer ResNet.
|
| 211 |
+
|
| 212 |
+
<table><tr><td>MODEL</td><td>TRAINING SHOTS</td><td colspan="2">TESTING SHOTS</td><td>AVERAGE ACCURACY</td><td>MODEL</td><td>TRAINING SHOTS</td><td colspan="2">TESTING SHOTS</td><td>AVERAGE ACCURACY</td></tr><tr><td></td><td></td><td>1</td><td>5</td><td></td><td></td><td></td><td>1</td><td>5</td><td></td></tr><tr><td>VANILLA PROTONET</td><td>1</td><td>95.07%</td><td>98.89%</td><td>97.81%</td><td>VANILLA PROTONET</td><td>1</td><td>96.46%</td><td>99.07%</td><td>98.35%</td></tr><tr><td>VANILLA PROTONET</td><td>5</td><td>93.42%</td><td>98.78%</td><td>97.25%</td><td>VANILLA PROTONET</td><td>5</td><td>94.42%</td><td>98.99%</td><td>97.75%</td></tr><tr><td>MIXED-k SHOT</td><td>1-5</td><td>94.84%</td><td>98.92%</td><td>97.74%</td><td>MIXED-k PROTONET</td><td>1-5</td><td>96.53%</td><td>99.15%</td><td>98.43%</td></tr><tr><td>PCAPROTONET</td><td>1</td><td>94.94%</td><td>98.85%</td><td>97.78%</td><td>PCA PROTONET</td><td>1</td><td>96.02%</td><td>98.99%</td><td>98.19%</td></tr><tr><td>EST PROTONET</td><td>1</td><td>95.11%</td><td>98.84%</td><td>97.83 %</td><td>EST PROTONET</td><td>1</td><td>95.55%</td><td>99.02%</td><td>98.19%</td></tr></table>
|
| 213 |
+
|
| 214 |
+
(c) miniImageNet-5-way, with 4 layer CNN.
|
| 215 |
+
|
| 216 |
+
<table><tr><td rowspan="2">MODEL</td><td rowspan="2">TRAINING SHOTS</td><td colspan="3">TESTING SHOTS</td><td rowspan="2">AVERAGE ACCURACY</td></tr><tr><td>1</td><td>5</td><td>10</td></tr><tr><td>PROTONET</td><td>1</td><td>48.89%</td><td>64.70%</td><td>68.90%</td><td>63.15%</td></tr><tr><td>PROTONET</td><td>5</td><td>44.75%</td><td>67.23%</td><td>72.36%</td><td>65.08%</td></tr><tr><td>PROTONET</td><td>10</td><td>39.99%</td><td>66.23%</td><td>72.47%</td><td>63.54%</td></tr><tr><td>MIXED-k SHOT</td><td>1-10</td><td>49.36%</td><td>67.96%</td><td>72.27%</td><td>65.83%</td></tr><tr><td>PCA PROTONET</td><td>5</td><td>49.36%</td><td>68.63%</td><td>72.82%</td><td>66.12%</td></tr><tr><td>EST PROTONET</td><td>5</td><td>50.22%</td><td>68.25%</td><td>73.29%</td><td>66.60%</td></tr></table>
|
| 217 |
+
|
| 218 |
+
(d) miniImageNet-5-way, with 7 layer ResNet.
|
| 219 |
+
|
| 220 |
+
<table><tr><td></td><td>TRAINING</td><td colspan="3">TESTING SHOTS</td><td>AVERAGE</td></tr><tr><td>MODEL</td><td>SHOTS</td><td>1</td><td>5</td><td>10</td><td>ACCURACY</td></tr><tr><td>PROTONET</td><td>1</td><td>52.65%</td><td>68.27%</td><td>72.29 %</td><td>66.73%</td></tr><tr><td>PROTONET</td><td>5</td><td>47.40%</td><td>69.93%</td><td>74.35%</td><td>67.18%</td></tr><tr><td>PROTONET</td><td>10</td><td>42.20%</td><td>68.23%</td><td>74.54%</td><td>65.75%</td></tr><tr><td>MIXED-k SHOT</td><td>1-10</td><td>51.74%</td><td>69.09%</td><td>73.63%</td><td>67.41%</td></tr><tr><td>PCA PROTONET</td><td>5</td><td>50.09%</td><td>69.25%</td><td>74.24%</td><td>67.63%</td></tr><tr><td>EST PROTONET</td><td>5</td><td>51.93%</td><td>69.98%</td><td>74.80%</td><td>68.19%</td></tr></table>
|
| 221 |
+
|
| 222 |
+
(e) tieredImageNet-5-way, with 4 layer CNN.
|
| 223 |
+
|
| 224 |
+
<table><tr><td></td><td>TRAINING</td><td colspan="3">TESTING SHOTS</td><td>AVERAGE</td></tr><tr><td>MODEL</td><td>SHOTS</td><td>1</td><td>5</td><td>10</td><td>ACCURACY</td></tr><tr><td>PROTONET</td><td>1</td><td>47.37%</td><td>63.70%</td><td>67.99%</td><td>61.85%</td></tr><tr><td>PROTONET</td><td>5</td><td>42.33%</td><td>66.51%</td><td>72.05%</td><td>64.05%</td></tr><tr><td>PROTONET</td><td>10</td><td>35.38%</td><td>64.56%</td><td>71.03%</td><td>61.24%</td></tr><tr><td>MIXED-k SHOT</td><td>1-10</td><td>47.67%</td><td>66.34%</td><td>70.96%</td><td>64.33%</td></tr><tr><td>PCA PROTONET</td><td>5</td><td>48.34%</td><td>67.07%</td><td>71.65%</td><td>64.96%</td></tr><tr><td>EST PROTONET</td><td>5</td><td>48.85%</td><td>67.24%</td><td>72.09 %</td><td>65.46%</td></tr></table>
|
| 225 |
+
|
| 226 |
+
(f) tieredImageNet-5-way, with 7 layer ResNet.
|
| 227 |
+
|
| 228 |
+
<table><tr><td></td><td>TRAINING</td><td colspan="3">TESTING SHOTS</td><td>AVERAGE</td></tr><tr><td>MODEL</td><td>SHOTS</td><td>1</td><td>5</td><td>10</td><td>ACCURACY</td></tr><tr><td>PROTONET</td><td>1</td><td>49.78%</td><td>65.17%</td><td>69.88%</td><td>63.98%</td></tr><tr><td>PROTONET</td><td>5</td><td>47.88%</td><td>69.12%</td><td>73.80%</td><td>66.99 %</td></tr><tr><td>PROTONET</td><td>10</td><td>40.86%</td><td>69.37%</td><td>74.72%</td><td>65.95%</td></tr><tr><td>MIXED-k SHOT</td><td>1-10</td><td>50.74%</td><td>69.28%</td><td>73.01 %</td><td>66.95%</td></tr><tr><td>PCA PROTONET</td><td>5</td><td>51.21%</td><td>68.88%</td><td>72.17 %</td><td>67.14%</td></tr><tr><td>EST PROTONET</td><td>5</td><td>53.05%</td><td>69.30%</td><td>73.63%</td><td>67.91%</td></tr></table>
|
| 229 |
+
|
| 230 |
+
Each model is evaluated on the test splits of the corresponding data sets (e.g. networks trained on Omniglot are only evaluated on Omniglot). Five test runs are performed per network on Omniglot to evaluate the $k$ -shot performance $( k \in [ 1 , 5 ] )$ ). Each run consists of 600 episodes formed by 1-5 support samples and 5 query sample per class. The performance is aggregated across runs for the combined performance. Similarly, on miniImageNet and tieredImageNet, 10 test runs are performed with support per sample $k \in [ 1 , 1 0 ]$ , 600 episodes per run, and 15 query samples in each episode.
|
| 231 |
+
|
| 232 |
+
Model configuration: Vanilla ProtoNet is used as our baseline. We present the performance of multiple ProtoNets trained with different shots to illustrate the performance degradation issue. ProtoNet-PCA uses principal components of the training split embeddings in place of $V ^ { * }$ , with components other than the $d$ leading ones zeroed out. We carry out a parameter sweep on miniImageNet and set $d = 6 0$ ; the same value is used on the other two data sets. For selecting the training shot of the embedding network, we find that overall performance to be optimal using $k = 5$ . ProtoNet-EST contains three parameters that need to be determined: $\rho , d$ , and training shots of the embedding network. For our experiments, we set $\rho = 0 . 0 0 1$ and $d = 6 0$ based on performance on miniImageNet. For selecting the number of training shots, we use the same strategy as before by evaluating ProtoNetEST with all trained embedding networks and found the same trend to hold.
|
| 233 |
+
|
| 234 |
+
As an abalation study, FC-ProtoNet adds a fully connected layer to the embedding network such that the output dimension is also 60. Results of this variant can be found in the appendix.
|
| 235 |
+
|
| 236 |
+
EST performance results: Table 1 summarizes the performance of the evaluated methods on all data sets. Due to space constraints, only 1-shot, 5-shot, 10-shot and 1-10 shot average performance are included. Additional results are in the appendix. The best performing method in each evaluation is in bold. On Omniglot, there is no significant difference in performance between the best performing vanilla ProtoNet and any other methods. We attribute this to the already high accuracy of the baseline model. On miniImageNet and tieredImageNet, EST-ProtoNet significantly outperforms baseline methods and PCA-protonet in terms of average accuracy over test runs with different shots.
|
| 237 |
+
|
| 238 |
+
We observe that matching the training shot to the test shot generally provides the best performance for vanilla ProtoNets. Also importantly, training with a mixture of different values of $k$ does not provide optimal performance when evaluated on the same mixture of $k$ values. Instead, the resulting performance is mediocre in all test shots. ProtoNet-EST provides minor improvements over the best-performing baseline method under most test shots settings. We hypothesize that this is due to EST aligning the embedding space to the directions with high inter-class variance and low intra-class variance. Comparison against the direct PCA approach demonstrates that the performance uplift is not entirely attributed to reducing the dimensions of the embedding space.
|
| 239 |
+
|
| 240 |
+
In conclusion, EST improves the performance of ProtoNets on the more challenging data sets when evaluated with various test shots. It successfully tackles performance degradation when testing shots and training shots are different. This improvement is vital to the deployment of ProtoNets in real world scenarios where the number of support samples cannot be determined in advance.
|
| 241 |
+
|
| 242 |
+
# 5 RELATED WORK
|
| 243 |
+
|
| 244 |
+
We summarize related work on extensions of ProtoNets, on improving the few-shot classification setup, and on analyzing theoretical properties of meta-learning methods.
|
| 245 |
+
|
| 246 |
+
Extensions of ProtoNets: Allen et al. (2019) build upon ProtoNets by allowing each class to be represented by multiple prototypes, thereby improving the representation power of ProtoNets. Oreshkin et al. (2018) use a context-conditioned embedding network to produce prototypes that are aware of the other classes. These prior works assume matched training and testing shots whereas our work focuses on setups where testing shots are not fixed (i.e. not necessarily the same as training shots). Our work is parallel to these works in that EST can be applied on the embeddings learned by these methods.
|
| 247 |
+
|
| 248 |
+
Improvement of few-shot classification setup: Chen et al. (2019) extend the few-shot learning problem setup by considering domain adaptation in addition to learning novel classes. Specifically, they look at how well models trained on miniImageNet can perform on few-shot learning in CUB200. Importantly, they still force the number of shots to be consistent between training time and testing time. While their work deals with varying the domain of the episodes at test time, our work deals with varying shots. Concurrent to our work, Triantafillou et al. (2020) further broaden the scope of few-shot learning by introducing a benchmark composed of data from various domains; methods are tested on their ability to adapt to different domains and deal with class imbalance. We extend their work with a thorough analysis of how the number of shots affects the learning outcome, and further propose a method to overcome the negative impact of mismatched shots.
|
| 249 |
+
|
| 250 |
+
Theoretical analysis of few-shot learning: Despite the myriad of methodological improvements, theoretical work on few-shot learning has been sparse. Wang et al. (2019b) provide a unifying formulation for few-shot learning methods, and clearly outline the key challenge in few-shot learning through a PAC argument, but do not introduce any new theoretical results. In contrast, our work introduces a novel bound for the accuracy of ProtoNets; this bound provides useful intuitions pertaining to how ProtoNets adapt to few-shot episodes. Additionally, we demonstrate theoretically and experimentally that the intrinsic dimension of the embedding function’s output space varies with the number of shots as a direct consequence of the challenges outlined in the PAC argument. To the best of our knowledge, Amit & Meir (2017) provide the only prior work to bound the error of a meta-learning agent. Specifically, they use the generalized PAC-Bayes framework to derive an error-rate bound for a MAML-style learning algorithm (where the hypothesis class is fixed). Their main result relates the performance of the learning algorithm to both the number of tasks encountered during meta-training and the number of shots given in any task. In contrast to our work, their result does not apply to non-parametric methods such as ProtoNets because the hypothesis class in ProtoNets can change from episode to episode depending on the number of ways.
|
| 251 |
+
|
| 252 |
+
# 6 CONCLUSION AND FUTURE WORK
|
| 253 |
+
|
| 254 |
+
We have explored how the number of support samples used during meta-training can influence the learned embedding function’s performance and intrinsic dimensions. Our proposed method transforms the embedding space to maximize inter-to-intra class variance ratio while constraining the dimensions of the space itself. In terms of applications, our method can be combined other works (Oreshkin et al., 2018; Ye et al., 2018; Rusu et al., 2019; Dong & Xing, 2018; Ren et al., 2018; Tapaswi et al., 2019) with an embedding learning component. We believe our approach is a significant step to reduce the impact of the shot number in meta-training, which is a crucial hyperparameter for few-shot classification.
|
| 255 |
+
|
| 256 |
+
# ACKNOWLEDGMENTS
|
| 257 |
+
|
| 258 |
+
We acknowledge partial support from NSERC COHESA NETGP485577-15 and Samsung. We thank Chaoqi Wang for discussion on the initial idea, and Clement Fuji Tsang, Mark Brophy and the ´ anonymous reviewers for helpful feedback on early versions of this paper.
|
| 259 |
+
|
| 260 |
+
# REFERENCES
|
| 261 |
+
|
| 262 |
+
Kelsey R. Allen, Evan Shelhamer, Hanul Shin, and Joshua B. Tenenbaum. Infinite mixture prototypes for few-shot learning. CoRR, abs/1902.04552, 2019. URL http://arxiv.org/abs/1902. 04552.
|
| 263 |
+
|
| 264 |
+
Ron Amit and Ron Meir. Meta-learning by adjusting priors based on extended pac-bayes theory. In ICML, 2017.
|
| 265 |
+
|
| 266 |
+
Christopher M. Bishop. Pattern Recognition and Machine Learning (Information Science and Statistics). Springer-Verlag, Berlin, Heidelberg, 2006. ISBN 0387310738.
|
| 267 |
+
|
| 268 |
+
Wei-Yu Chen, Yen-Cheng Liu, Zsolt Kira, Yu-Chiang Frank Wang, and Jia-Bin Huang. A closer look at few-shot classification. ArXiv, abs/1904.04232, 2019.
|
| 269 |
+
|
| 270 |
+
Nanqing Dong and Eric P. Xing. Few-shot semantic segmentation with prototype learning. In British Machine Vision Conference (BMVC), 2018.
|
| 271 |
+
|
| 272 |
+
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International Conference on Machine Learning (ICML), volume 70 of Proceedings of Machine Learning Research, pp. 1126–1135, International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR. URL http://proceedings.mlr.press/v70/finn17a.html.
|
| 273 |
+
|
| 274 |
+
Keinosuke Fukunaga. Introduction to Statistical Pattern Recognition (2Nd Ed.). Academic Press Professional, Inc., San Diego, CA, USA, 1990. ISBN 0-12-269851-7.
|
| 275 |
+
|
| 276 |
+
Keinosuke Fukunaga and David R. Olsen. An algorithm for finding intrinsic dimensionality of data. IEEE Transactions on Computers, C-20:176–183, 1971.
|
| 277 |
+
|
| 278 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition (CVPR), pp. 770–778, 2016.
|
| 279 |
+
|
| 280 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Francis Bach and David Blei (eds.), Proceedings of the 32nd International Conference on Machine Learning (ICML), volume 37 of Proceedings of Machine Learning Research, pp. 448–456, Lille, France, 07–09 Jul 2015. PMLR. URL http://proceedings.mlr.press/v37/ioffe15.html.
|
| 281 |
+
|
| 282 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. International Conference on Learning Representations (ICLR), 2014.
|
| 283 |
+
|
| 284 |
+
Brenden M. Lake, Ruslan Salakhutdinov, and Joshua B. Tenenbaum. Human-level concept learning through probabilistic program induction. Science, 350(6266):1332–1338, 2015. ISSN 0036-8075. doi: 10.1126/science.aab3050. URL http://science.sciencemag.org/ content/350/6266/1332.
|
| 285 |
+
|
| 286 |
+
Marc T. Law, Yaoliang Yu, Matthieu Cord, and Eric P. Xing. Closed-form training of mahalanobis distance for supervised clustering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 3909–3917, 2016.
|
| 287 |
+
|
| 288 |
+
Marc T. Law, Jake Snell, Amir massoud Farahmand, Raquel Urtasun, and Richard S. Zemel. Dimensionality reduction for representing the knowledge of probabilistic models. In International Conference on Learning Representations (ICLR), 2019. URL https://openreview.net/ forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ SygD-hCcF7.
|
| 289 |
+
|
| 290 |
+
Boris Oreshkin, Pau Rodr´ıguez Lopez, and Alexandre Lacoste. Tadam: Task dependent adaptive ´ metric for improved few-shot learning. In Advances in Neural Information Processing Systems (NeurIPS), pp. 721–731, 2018.
|
| 291 |
+
|
| 292 |
+
Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. In In International Conference on Learning Representations (ICLR), 2017.
|
| 293 |
+
|
| 294 |
+
Mengye Ren, Eleni Triantafillou, Sachin Ravi, Jake Snell, Kevin Swersky, Joshua B. Tenenbaum, Hugo Larochelle, and Richard S. Zemel. Meta-learning for semi-supervised few-shot classification. In Proceedings of 6th International Conference on Learning Representations (ICLR), 2018.
|
| 295 |
+
|
| 296 |
+
Alvin C. Rencher and G. Bruce Schaalje. Linear Models in Statistics. John Wiley & Sons, Inc., 2nd edition, 2008.
|
| 297 |
+
|
| 298 |
+
Andrei A. Rusu, Dushyant Rao, Jakub Sygnowski, Oriol Vinyals, Razvan Pascanu, Simon Osindero, and Raia Hadsell. Meta-learning with latent embedding optimization. CoRR, abs/1807.05960, 2019.
|
| 299 |
+
|
| 300 |
+
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 (ICML), volume 48 of Proceedings of Machine Learning Research, pp. 1842–1850, New York, New York, USA, 20–22 Jun 2016. PMLR. URL http://proceedings.mlr.press/v48/ santoro16.html.
|
| 301 |
+
|
| 302 |
+
Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. In Advances in Neural Information Processing Systems (NIPS), pp. 4077–4087, 2017.
|
| 303 |
+
|
| 304 |
+
Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Computer Vision and Pattern Recognition (CVPR), 2015. URL http://arxiv.org/abs/1409.4842.
|
| 305 |
+
|
| 306 |
+
Makarand Tapaswi, Marc T. Law, and Sanja Fidler. Video face clustering with unknown number of clusters. In The IEEE International Conference on Computer Vision (ICCV), October 2019.
|
| 307 |
+
|
| 308 |
+
Eleni Triantafillou, Tyler Zhu, Vincent Dumoulin, Pascal Lamblin, Utku Evci, Kelvin Xu, Ross Goroshin, Carles Gelada, Kevin Swersky, Pierre-Antoine Manzagol, and Hugo Larochelle. Metadataset: A dataset of datasets for learning to learn from few examples. In International Conference on Learning Representations, 2020.
|
| 309 |
+
|
| 310 |
+
Vladimir Vapnik, Esther Levin, and Yann Le Cun. Measuring the vc-dimension of a learning machine. Neural Computation, 6(5):851–876, 1994. doi: 10.1162/neco.1994.6.5.851. URL https://doi.org/10.1162/neco.1994.6.5.851.
|
| 311 |
+
|
| 312 |
+
Vladimir N. Vapnik. Statistical Machine Learning. JOHN WILEY & SONS, INC., 1998.
|
| 313 |
+
|
| 314 |
+
Oriol Vinyals, Charles Blundell, Timothy Lillicrap, Koray Kavukcuoglu, and Daan Wierstra. Matching networks for one shot learning. In Proceedings of the 30th International Conference on Neural Information Processing Systems (NIPS), NIPS’16, pp. 3637–3645, USA, 2016. Curran Associates Inc. ISBN 978-1-5108-3881-9. URL http://dl.acm.org/citation.cfm? id=3157382.3157504.
|
| 315 |
+
|
| 316 |
+
Jixuan Wang, Kuan-Chieh Wang, Marc T. Law, Frank Rudzicz, and Michael Brudno. Centroid-based deep metric learning for speaker recognition. In ICASSP 2019-2019 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 3652–3656. IEEE, 2019a.
|
| 317 |
+
|
| 318 |
+
Yaqing Wang, Quanming Yao, James T. Kwok, and Lionel M. Ni. Generalizing from a few examples: A survey on few-shot learning. 2019b.
|
| 319 |
+
|
| 320 |
+
Han-Jia Ye, Hexiang Hu, De-Chuan Zhan, and Fei Sha. Learning embedding adaptation for few-shot learning. CoRR, abs/1812.03664, 2018. URL http://arxiv.org/abs/1812.03664.
|
| 321 |
+
|
| 322 |
+
Pierre Yger, Marcel Stimberg, and Romain Brette. Fast learning with weak synaptic plasticity. Journal of Neuroscience, 35(39):13351–13362, 2015. ISSN 0270-6474. doi: 10.1523/JNEUROSCI. 0607-15.2015. URL http://www.jneurosci.org/content/35/39/13351.
|
| 323 |
+
|
| 324 |
+
# A APPENDIX
|
| 325 |
+
|
| 326 |
+
# A.1 ALGORITHM FOR EST
|
| 327 |
+
|
| 328 |
+
Below is the exact procedure for computing $\tau$ for embedding space transformation.
|
| 329 |
+
|
| 330 |
+
Algorithm 1 Algorithm for computing the transformation $\tau$ .
|
| 331 |
+
$L _ { n }$ is the number of samples belonging to class $n$ ; $\mu _ { n }$ and $\Sigma _ { n }$ are the mean and covariance of the embeddings of that class; $\mu _ { T }$ and $\widetilde { \Sigma } _ { s }$ are the average of mean embeddings and covariances; $\Sigma _ { \mu }$ is the covariance of the mean embeddings; $V ^ { * }$ is the matrix of eigenvectors that correspoinds to the $d$ largest eigenvalues in $\Lambda$ .
|
| 332 |
+
|
| 333 |
+
Input: Training set $\mathcal { D } _ { t r } = \{ ( \mathbf { x } _ { 1 } , y _ { 1 } ) , . . . , ( \mathbf { x } _ { M } , y _ { M } \}$ , where $y _ { i } \in \{ 1 , . . . , N \}$ , $\mathcal { D } _ { n }$ denotes the subset of $\mathcal { D } _ { t r }$ where $\forall y \in { \mathcal { D } } _ { n } , y = n$ , embedding function $\phi$ , weighting parameter $\rho$ , dimension parameter $d$ .
|
| 334 |
+
|
| 335 |
+
$$
|
| 336 |
+
\begin{array} { r } { \Sigma [ n ] = \frac { 1 } { L _ { n } } \sum _ { ( \mathbf { x } _ { i } , y _ { i } ) \in \mathcal { D } _ { n } } ^ { L _ { n } } ( \phi ( \mathbf { x } _ { i } ) - \mu _ { n } ) ( \phi ( \mathbf { x } _ { i } ) - \mu _ { n } ) ^ { T } } \end{array}
|
| 337 |
+
$$
|
| 338 |
+
|
| 339 |
+
# end for
|
| 340 |
+
|
| 341 |
+
$$
|
| 342 |
+
\begin{array} { r l } & { \mu _ { T } = \frac { 1 } { M } \sum _ { ( \mathbf { x } _ { i } , y _ { i } ) \in \mathcal { D } _ { t r } } \phi ( \mathbf { x } _ { i } ) } \\ & { \Sigma _ { \mu } = \frac { 1 } { N } \sum _ { n \in [ 1 , N ] } ( \mu [ n ] - \mu _ { T } ) ( \mu [ n ] - \mu _ { T } ) ^ { T } } \\ & { \overline { { \Sigma } } _ { s } = \frac { 1 } { N } \sum _ { n \in [ 1 , N ] } \Sigma [ n ] } \end{array}
|
| 343 |
+
$$
|
| 344 |
+
|
| 345 |
+
# A.2 NETWORK ARCHITECTURE
|
| 346 |
+
|
| 347 |
+
The vanilla CNN has the exact same architecture as the original ProtoNet (Snell et al., 2017). It consists of four convolution layers with depth of 64; each convolution layer is followed by Relu activation, max-pooling, and batch normalization (Ioffe & Szegedy, 2015). Resnet of 7 layers is constructed with one vanilla convolution layer of depth 64 followed by three residual blocks, all joined by max-pooling layers; each residual block consists of two sets of conv-batchnorm-Relu layers, of depth 128-256-256.
|
| 348 |
+
|
| 349 |
+
# A.3 DATA SET DESCRIPTION AND PRE-PROCESSING
|
| 350 |
+
|
| 351 |
+
Experiments are performed on three data sets: Omniglot (Lake et al., 2015), miniImageNet (Vinyals et al., 2016), and tieredImageNet (Ren et al., 2018). For Omniglot experiments, we follow the same configuration as in the original paper where 1200 classes augmented with rotations (4800 total) are used for training, and the remaining classes are used for testing.
|
| 352 |
+
|
| 353 |
+
For miniImageNet experiments, we use the splits proposed by (Ravi & Larochelle, 2017) where 64 classes are used for training, 16 for validation, and 20 for testing. Mirroring the original paper, we resize all miniImageNet images to $8 4 \mathrm { x } 8 4$ . No data augmentation is applied. As most state-of-art few-shot classification methods achieve saturating accuracies on Omniglot, and miniImageNet’s small number of classes make claims about generalization difficult, we also conduct experiments of tieredImageNet.
|
| 354 |
+
|
| 355 |
+
TieredImageNet is also a subset of Imagenet1000. TieredImageNet groups classes into broader categories corresponding to higher-level nodes in the ImageNet hierarchy. It includes 34 categories, with each category containing between 10 and 30 classes. These are split into 20 training, 6 validation and 8 testing categories. In total, there are 351 classes in training, 97 in validation, and 160 in testing. Preprocessing of images follow the same steps as used for miniImageNet.
|
| 356 |
+
|
| 357 |
+
# A.4 PROTONET TRAINING
|
| 358 |
+
|
| 359 |
+
Training procedure of ProtoNets largely mirrors the protocol used by Snell et al. (2017). On Omniglot, we train the network to convergence after 30000 episodes. On miniImageNet and tieredImageNet, we monitor the performance of the network on the validation set and select the best performing checkpoint after training for 50000 episodes. Adam (Kingma & Ba, 2014) optimizer is used with $\alpha = 0 . 9$ , $\beta = 0 . 9 9 9$ , $\epsilon = 1 0 ^ { - 8 }$ , and an initial learning rate of 0.001 that is decayed by half every 2000 episodes. On Omniglot, we train with 60 classes and 5 query points per episode. On miniImageNet and tieredImageNet, we train with 20 classes and 15 query points per episode.
|
| 360 |
+
|
| 361 |
+
# A.5 DERIVATION DETAILS
|
| 362 |
+
|
| 363 |
+
Proof of Lemma 1:
|
| 364 |
+
|
| 365 |
+
Proof. First, from the definition of $\alpha$ , we split $\mathbb { E } _ { \mathbf { x } , S \mid a , b } [ \alpha ]$ in to two parts and examine them separately:
|
| 366 |
+
|
| 367 |
+
$$
|
| 368 |
+
\mathbb { E } _ { \mathbf { x } , S | a , b } [ \alpha ] = \underbrace { \mathbb { E } [ \left. \phi ( \mathbf { x } ) - \overline { { \phi ( S _ { b } ) } } \right. ^ { 2 } ] } _ { i } - \underbrace { \mathbb { E } [ \left. \phi ( \mathbf { x } ) - \overline { { \phi ( S _ { a } ) } } \right. ^ { 2 } ] } _ { i i } .
|
| 369 |
+
$$
|
| 370 |
+
|
| 371 |
+
In general, for random vector $X$ , the expectation of the quadratic form is $\mathbb { E } [ \left. X \right. ^ { 2 } ] = \operatorname { T r } ( \operatorname { V a r } ( X ) ) +$ $\mathbb { E } [ { \bar { X } } ] ^ { T } \mathbb { E } [ X ]$ . Hence,
|
| 372 |
+
|
| 373 |
+
$$
|
| 374 |
+
\begin{array} { r l } & { i = \mathbb { E } _ { \mathbf { x } , S \mid a , b } [ \Big \| \phi ( \mathbf { x } ) - \overline { { \phi ( S _ { b } ) } } \Big \| ^ { 2 } ] } \\ & { \phantom { = } = \mathrm { T r } ( \Sigma _ { \phi ( \mathbf { x } ) - \overline { { \phi ( S _ { b } ) } } } ) + \mathbb { E } [ \phi ( \mathbf { x } ) - \overline { { \phi ( S _ { b } ) } } ] ^ { T } \mathbb { E } [ \phi ( \mathbf { x } ) - \overline { { \phi ( S _ { b } ) } } ] , } \end{array}
|
| 375 |
+
$$
|
| 376 |
+
|
| 377 |
+
where the first term inside the trace can be expanded as:
|
| 378 |
+
|
| 379 |
+
$$
|
| 380 |
+
\begin{array} { l l } { { \displaystyle \Sigma _ { \phi ( { \bf x } ) - \overline { { \phi ( S _ { b } ) } } } = \mathrm { V a r } [ \phi ( { \bf x } ) - \overline { { \phi ( S _ { b } ) } } ] } } \\ { { } } & { { = \mathbb E [ ( \phi ( { \bf x } ) - \overline { { \phi ( S _ { b } ) } } ) ( \phi ( { \bf x } ) - \overline { { \phi ( S _ { b } ) } } ) ^ { T } ] - ( \mathbf { \mu } _ { a } - \mathbf { \mu } _ { b } ) ( \mathbf { \mu } _ { a } - \mathbf { \mu } _ { b } ) ^ { T } } } \\ { { } } & { { = \Sigma _ { c } + \mathbf { \mu } _ { a } \mathbf { \mu } _ { a } ^ { T } + \displaystyle \frac { 1 } { k } \Sigma _ { c } + \mathbf { \mu } _ { b } \mathbf { \mu } _ { b } ^ { T } - \displaystyle \mathbf { \mu } _ { a } \mathbf { \mu } _ { b } ^ { T } - \displaystyle \mathbf { \mu } _ { b } \mathbf { \mu } _ { a } ^ { T } - ( \mathbf { \mu } _ { a } - \mathbf { \mu } _ { b } ) ( \mathbf { \mu } _ { a } - \mathbf { \mu } _ { b } ) ^ { T } } } \\ { { } } & { { = ( 1 + \displaystyle \frac { 1 } { k } ) \Sigma _ { c } ~ \displaystyle ( \mathrm { L a s t ~ t e r m s ~ c a n c e l ~ o u t } ) . } } \end{array}
|
| 381 |
+
$$
|
| 382 |
+
|
| 383 |
+
To go from (18) to (19), we note that $\operatorname { V a r } ( X ) = \mathbb { E } [ X X ^ { T } ] - \mathbb { E } [ X ] \mathbb { E } [ X ] ^ { T }$ and $\Sigma _ { c } \overset { \Delta } { = } \mathrm { V a r } ( \phi ( \mathbf { x } ) )$ . Hence (19) can be obtained by expanding out the first term and taking the expectation of each resulting item.
|
| 384 |
+
|
| 385 |
+
The second term of (16) is simply:
|
| 386 |
+
|
| 387 |
+
$$
|
| 388 |
+
\mathbb { E } _ { \mathbf { x } , S | a , b } [ \phi ( \mathbf { x } ) - \overline { { \phi ( S _ { b } ) } } ] = \mu _ { a } - \mu _ { b } .
|
| 389 |
+
$$
|
| 390 |
+
|
| 391 |
+
Putting them together:
|
| 392 |
+
|
| 393 |
+
$$
|
| 394 |
+
i = ( 1 + \frac { 1 } { k } ) \mathrm { T r } ( \Sigma _ { c } ) + ( \mu _ { a } - \mu _ { b } ) ^ { T } ( \mu _ { a } - \mu _ { b } ) .
|
| 395 |
+
$$
|
| 396 |
+
|
| 397 |
+
Similarly for $_ { i i }$
|
| 398 |
+
|
| 399 |
+
$$
|
| 400 |
+
\begin{array} { l } { { \displaystyle i i = \mathbb { E } _ { { \bf x } , S \vert a , b } [ \left. \phi ( { \bf x } ) - \overline { { \phi ( S _ { a } ) } } \right. ^ { 2 } ] } \ ~ } \\ { { \displaystyle ~ = \mathrm { T r } ( \Sigma _ { \phi ( { \bf x } ) - \overline { { \phi ( S _ { a } ) } } } ) + \mathbb { E } [ \phi ( { \bf x } ) - \overline { { \phi ( S _ { a } ) } } ] ^ { T } \mathbb { E } [ \phi ( { \bf x } ) - \overline { { \phi ( S _ { a } ) } } ] } \ } \\ { { \displaystyle ~ = ( 1 + \frac { 1 } { k } ) \mathrm { T r } ( \Sigma _ { c } ) . } } \end{array}
|
| 401 |
+
$$
|
| 402 |
+
|
| 403 |
+
Putting together $i$ and $\romannumeral 2$ :
|
| 404 |
+
|
| 405 |
+
$$
|
| 406 |
+
\begin{array} { l } { \displaystyle \mathbb { E } _ { { \mathbf { x } } , S | a , b } [ \alpha ] = ( 1 + \frac { 1 } { k } ) \mathrm { T r } ( \Sigma _ { c } ) + ( \mathbf { \mu } _ { a } - \mathbf { \mu } _ { b } ) ( \mathbf { \mu } _ { a } - \mathbf { \mu } _ { b } ) ^ { T } - ( 1 + \frac { 1 } { k } ) \mathrm { T r } ( \Sigma _ { c } ) } \\ { = ( \mathbf { \mu } _ { a } - \mathbf { \mu } _ { b } ) ^ { T } ( \mathbf { \mu } _ { a } - \mathbf { \mu } _ { b } ) } \end{array}
|
| 407 |
+
$$
|
| 408 |
+
|
| 409 |
+
Then, since $\mathbb { E } _ { a , b , \mathbf { x } , S } [ \alpha ] = \mathbb { E } _ { a , b } [ \mathbb { E } _ { \mathbf { x } , S | a , b } [ \alpha ] ]$ , we have:
|
| 410 |
+
|
| 411 |
+
$$
|
| 412 |
+
\begin{array} { r l } & { \mathbb { E } _ { a , b , \mathbf { x } , S } [ \alpha ] = \mathbb { E } _ { a , b } [ ( \mu _ { a } - \mu _ { b } ) ^ { T } ( \mu _ { a } - \mu _ { b } ) ] } \\ & { \qquad = \mathbb { E } _ { a , b } [ \mu _ { a } ^ { T } \mu _ { a } + \mu _ { b } ^ { T } \mu _ { b } - \mu _ { a } ^ { T } \mu _ { b } - \mu _ { b } ^ { T } \mu _ { a } ] } \\ & { \qquad = \mathrm { T r } ( \Sigma ) + \mu ^ { T } \mu + \mathrm { T r } ( \Sigma ) + \mu ^ { T } \mu - 2 \mu ^ { T } \mu } \\ & { \qquad = 2 \mathrm { T r } ( \Sigma ) } \end{array}
|
| 413 |
+
$$
|
| 414 |
+
|
| 415 |
+
Where from the second to the third line, we note that $\mu _ { a } ^ { T } \mu _ { a }$ and $\mu _ { b } ^ { T } \mu _ { b }$ are quadratic forms while $\mu _ { a } ^ { T } \mu _ { b }$ describe a dot product between two independent randomly drawn samples which has expectation $\mu ^ { T } \mu$ . □
|
| 416 |
+
|
| 417 |
+
For proof of Lemma 2, we first re-state the result on quadratic forms of normally distributed random vectors by Rencher & Schaalje (2008).
|
| 418 |
+
|
| 419 |
+
Theorem 4. Consider random vector y $\sim \cal { N } ( \{ \mathfrak { u } , \Sigma \}$ and symmetric matrix of constants $A$ , we have:
|
| 420 |
+
|
| 421 |
+
$$
|
| 422 |
+
\mathrm { V a r } ( y ^ { T } A y ) = 2 \mathrm { T r } ( ( A \Sigma ) ^ { 2 } ) + 4 { \mu } ^ { T } A \Sigma A { \mu } .
|
| 423 |
+
$$
|
| 424 |
+
|
| 425 |
+
Proof of Lemma 2:
|
| 426 |
+
|
| 427 |
+
Proof.
|
| 428 |
+
|
| 429 |
+
$$
|
| 430 |
+
\begin{array} { r l } { \mathrm { V a r } ( \alpha | a , b ) = \mathrm { V a r } ( \left\| \phi ( \mathbf { x } ) - \overline { { \phi ( S _ { b } ) } } \right\| ^ { 2 } - \left\| \phi ( \mathbf { x } ) - \overline { { \phi ( S _ { b } ) } } \right\| ^ { 2 } ) } & { } \\ { = \mathrm { V a r } ( \left\| \phi ( \mathbf { x } ) - \overline { { \phi ( S _ { b } ) } } \right\| ^ { 2 } ) + \mathrm { V a r } ( \left\| \phi ( \mathbf { x } ) - \overline { { \phi ( S _ { a } ) } } \right\| ^ { 2 } ) } & { } \\ { - 2 \mathrm { C o v } ( \left\| \phi ( \mathbf { x } ) - \overline { { \phi ( S _ { a } ) } } \right\| ^ { 2 } , \left\| \phi ( \mathbf { x } ) - \overline { { \phi ( S _ { b } ) } } \right\| ^ { 2 } ) } & { } \\ { \leq \mathrm { V a r } ( \left\| \phi ( \mathbf { x } ) - \overline { { \phi ( S _ { b } ) } } \right\| ^ { 2 } ) + \mathrm { V a r } ( \left\| \phi ( \mathbf { x } ) - \overline { { \phi ( S _ { a } ) } } \right\| ^ { 2 } ) } & { } \\ { + 2 \sqrt { \mathrm { V a r } ( \left\| \phi ( \mathbf { x } ) - \overline { { \phi ( S _ { b } ) } } \right\| ^ { 2 } ) \mathrm { V a r } ( \left\| \phi ( \mathbf { x } ) - \overline { { \phi ( S _ { a } ) } } \right\| ^ { 2 } ) } } & { } \\ { \leq 2 \mathrm { V a r } ( \left\| \phi ( \mathbf { x } ) - \overline { { \phi ( S _ { b } ) } } \right\| ^ { 2 } ) + 2 \mathrm { V a r } ( \left\| \phi ( \mathbf { x } ) - \overline { { \phi ( S _ { a } ) } } \right\| ^ { 2 } ) } & { } \end{array}
|
| 431 |
+
$$
|
| 432 |
+
|
| 433 |
+
From 33 to 35, we used Cauchy Schwarz inequality. From line 35 to line 37, we use the fact that $2 a b \leq a ^ { 2 } + b ^ { 2 }$ for all $a , b \in \mathcal { R } ^ { + }$ .
|
| 434 |
+
|
| 435 |
+
By applying Theorem 4, we have:
|
| 436 |
+
|
| 437 |
+
$$
|
| 438 |
+
{ \begin{array} { r l } & { \operatorname { V a r } ( \left\| \phi ( \mathbf { x } ) - { \overline { { \phi ( S _ { b } ) } } } \right\| ^ { 2 } ) = 2 ( 1 + { \frac { 1 } { k } } ) ^ { 2 } \operatorname { T r } ( \Sigma _ { c } ^ { 2 } ) + 4 ( 1 + { \frac { 1 } { k } } ) ( \mu _ { a } - \mu _ { b } ) ^ { T } \Sigma _ { c } ( \mu _ { a } - \mu _ { b } ) } \\ & { \operatorname { V a r } ( \left\| \phi ( \mathbf { x } ) - { \overline { { \phi ( S _ { a } ) } } } \right\| ^ { 2 } ) = 2 ( 1 + { \frac { 1 } { k } } ) ^ { 2 } \operatorname { T r } ( \Sigma _ { c } ^ { 2 } ) } \end{array} }
|
| 439 |
+
$$
|
| 440 |
+
|
| 441 |
+
Finally,
|
| 442 |
+
|
| 443 |
+
$$
|
| 444 |
+
\begin{array} { r l } & { \mathbb { E } _ { a , b } [ \mathrm { V a r } ( \alpha | a , b ) ] \leq \mathbb { E } _ { a , b } [ 2 \mathrm { V a r } ( \left\| \phi ( \mathbf { x } ) - \overline { { \phi ( S _ { b } ) } } \right\| ^ { 2 } ) + 2 \mathrm { V a r } ( \left\| \phi ( \mathbf { x } ) - \overline { { \phi ( S _ { a } ) } } \right\| ^ { 2 } ) ] } \\ & { \qquad = \mathbb { E } _ { a , b } [ 8 ( 1 + \frac { 1 } { k } ) ^ { 2 } \mathrm { T r } ( \Sigma _ { c } ^ { 2 } ) + 8 ( 1 + \frac { 1 } { k } ) ( \mathbf { \mu } _ { a } - \mathbf { \mu } _ { b } ) ^ { T } \Sigma _ { c } ( \mathbf { \mu } _ { a } - \mathbf { \mu } _ { b } ) ] } \\ & { \qquad = 8 ( 1 + \frac { 1 } { k } ) \mathbb { E } _ { a , b } [ \mathrm { T r } \{ ( 1 + \frac { 1 } { k } ) \Sigma _ { c } ^ { 2 } + \Sigma _ { c } ( \mathbf { \mu } _ { a } - \mathbf { \mu } _ { b } ) ( \mathbf { \mu } _ { a } - \mathbf { \mu } _ { b } ) ^ { T } \} ] } \\ & { \qquad = 8 ( 1 + \frac { 1 } { k } ) \mathrm { T r } \{ \Sigma _ { c } [ ( 1 + \frac { 1 } { k } ) \Sigma _ { c } + 2 \Sigma ] \} } \end{array}
|
| 445 |
+
$$
|
| 446 |
+
|
| 447 |
+
Extending to $N$ class: Let $\mathbf x , y$ denote the query data pair, and the set of $N$ classes be denoted as c. Let $\alpha _ { i } = \left\| \phi ( \mathbf { x } ) - \overline { { \phi ( S _ { i } } } ) \right\| ^ { 2 } - \left\| \phi ( \mathbf { x } ) - \overline { { \phi ( S _ { y } } ) } \right\| ^ { 2 }$ . Then we have a correct prediction $\hat { y } = y$ if $\forall i \in [ 1 , N ] , i \neq y , \alpha _ { i } > 0$ . Hence: $R ( \phi ) = \operatorname* { P r } _ { \mathbf { c } , \mathbf { x } , S } ( \bigcup _ { i \neq y } ^ { N } \alpha _ { i } > 0 )$
|
| 448 |
+
|
| 449 |
+
By Frechet’s inequality:
|
| 450 |
+
|
| 451 |
+
$$
|
| 452 |
+
R ( \phi ) \geq \sum _ { \stackrel { i = 1 } { i \neq y } } ^ { N } \operatorname* { P r } ( \alpha _ { i } > 0 ) - ( N - 2 )
|
| 453 |
+
$$
|
| 454 |
+
|
| 455 |
+
Noting that Theorem 3 can be applied to each term in the summation:
|
| 456 |
+
|
| 457 |
+
$$
|
| 458 |
+
\mathfrak { L } ( \phi ) \geq \sum _ { \stackrel { i = 1 } { i \neq y } } ^ { N } \frac { 4 \mathrm { T r } ( \Sigma ) ^ { 2 } } { 8 ( 1 + 1 / k ) ^ { 2 } \mathrm { T r } ( \Sigma _ { c } ^ { 2 } ) + 1 6 ( 1 + 1 / k ) \mathrm { T r } ( \Sigma \Sigma _ { c } ) + \mathbf { E } _ { i , y } [ ( ( \mu _ { y } - \mu _ { i } ) ( \mu _ { y } - \mu _ { i } ) ^ { T } ) ^ { 2 } ] } - ( N - 2 )
|
| 459 |
+
$$
|
| 460 |
+
|
| 461 |
+
It is then clear that the observations made on the binary case also applies to the multiclass case.
|
| 462 |
+
|
| 463 |
+
# A.6 ADDITIONAL RESULTS
|
| 464 |
+
|
| 465 |
+
Additionally, we experimented with directly setting the output dimension of the embedding network to 60 by adding a fully connected layer to the embedding network. This variant of protonet performs worse than both the base variant and all other methods.
|
| 466 |
+
|
| 467 |
+
Table 2: Classification Accuracy on miniImageNet-5-way, with 4 layer $\mathrm { C N N } + 1$ Fully connected layer embedding network.
|
| 468 |
+
|
| 469 |
+
<table><tr><td rowspan="2"></td><td rowspan="2">TRAINING SHOTS</td><td colspan="9">2 3</td><td rowspan="2">10</td><td rowspan="2">AVERAGE ACCURACY</td></tr><tr><td></td><td></td><td></td><td>4</td><td>5</td><td>TESTING SHOTS 6</td><td>7</td><td>8</td><td>9</td></tr><tr><td>PROTONET + FC</td><td>5</td><td>44.77%</td><td>53.75%</td><td>58.04%</td><td>61.06%</td><td>62.26%</td><td>64.60%</td><td>65.19%</td><td>66.63%</td><td>66.65%</td><td></td><td>67.52%</td><td>61.05±0.28%</td></tr></table>
|
| 470 |
+
|
| 471 |
+

|
| 472 |
+
Figure 3: Effect of hyperparameters on k-shot testing performance on miniImageNet.
|
| 473 |
+
|
| 474 |
+
Table 3: Classification Accuracy on miniImageNet-5-way, with 4 layer CNN embedding network.
|
| 475 |
+
|
| 476 |
+
<table><tr><td>MODEL</td><td>TRAINING</td><td colspan="10">TESTING SHOTS</td><td>AVERAGE</td></tr><tr><td></td><td>SHOTS</td><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td><td>9</td><td>10</td><td>ACCURACY</td></tr><tr><td>VANILLA PROTONET</td><td>1</td><td>48.89%</td><td>56.54%</td><td>60.31%</td><td>63.12%</td><td>64.70%</td><td>66.02%</td><td>66.62%</td><td>67.99%</td><td>68.41%</td><td>68.90%</td><td>63.15±0.21%</td></tr><tr><td>EST PROTONET</td><td>1</td><td>49.07%</td><td>56.49%</td><td>60.62%</td><td>62.67%</td><td>64.83%</td><td>66.23%</td><td>66.84%</td><td>67.90%</td><td>67.68%</td><td>68.73%</td><td>63.11±0.22%</td></tr><tr><td>PCA PROTONET</td><td>1</td><td>49.01%</td><td>56.35%</td><td>60.07%</td><td>62.42%</td><td>64.38%</td><td>65.28%</td><td>66.56%</td><td>67.81%</td><td>67.59%</td><td>68.26%</td><td>62.77 ±0.22%</td></tr><tr><td>VANILLA PROTONET</td><td>5</td><td>44.75%</td><td>56.61%</td><td>61.52%</td><td>65.32%</td><td>67.23%</td><td>69.04%</td><td>70.66%</td><td>71.47%</td><td>71.84%</td><td>72.36%</td><td>65.08±0.23%</td></tr><tr><td>EST PROTONET</td><td>5</td><td>50.22%</td><td>59.04 %</td><td>64.14%</td><td>66.61%</td><td>68.25%</td><td>69.46%</td><td>70.80%</td><td>71.60%</td><td>72.61%</td><td>73.29%</td><td>66.60±0.23%</td></tr><tr><td>PCA PROTONET</td><td></td><td>48.72%</td><td>58.43%</td><td>63.17%</td><td>66.07%</td><td>68.63%</td><td>69.56%</td><td>70.55%</td><td>71.21%</td><td>72.09%</td><td>72.82%</td><td>66.12±0.24%</td></tr><tr><td>VANILLA PROTONET</td><td>10</td><td>39.99%</td><td>52.73%</td><td>59.71%</td><td>63.41%</td><td>66.23%</td><td>68.27%</td><td>69.86%</td><td>71.03%</td><td>71.72%</td><td>72.47%</td><td>63.54±0.25%</td></tr><tr><td>EST PROTONET</td><td>10</td><td>48.98%</td><td>57.83%</td><td>63.13%</td><td>66.39%</td><td>68.12%</td><td>69.82%</td><td>70.63%</td><td>71.85%</td><td>72.79%</td><td>73.22%</td><td>66.28±0.23%</td></tr><tr><td>PCA PROTONET</td><td>10</td><td>48.04%</td><td>57.05%</td><td>62.46%</td><td>64.63%</td><td>67.61%</td><td>68.98%</td><td>69.71%</td><td>71.78%</td><td>71.75%</td><td>72.42%</td><td>65.44±0.24%</td></tr><tr><td>VANILLA PROTONET</td><td>1-10</td><td>49.36%</td><td>58.67%</td><td>62.77 %</td><td>65.76%</td><td>67.96%</td><td>69.20%</td><td>70.05%</td><td>70.90%</td><td>71.34%</td><td>72.27%</td><td>65.83±0.21%</td></tr></table>
|
| 477 |
+
|
| 478 |
+

|
| 479 |
+
Figure 4: Comparison between estimated accuracy lower bound and empirical accuracy for various training and test shots. Experiment is 2-way few-shot classification performed on miniImageNet.
|
| 480 |
+
|
| 481 |
+
Table 4: Classification Accuracy on tieredImageNet-5-way, with 4 layer CNN embedding network.
|
| 482 |
+
|
| 483 |
+
<table><tr><td>MODEL</td><td>TRAINING SHOTS</td><td>2</td><td></td><td>4</td><td>5</td><td>TESTING SHOTS</td><td>6</td><td>7</td><td>8</td><td>9</td><td>10</td><td>AVERAGE ACCURACY</td></tr><tr><td></td><td></td><td>1</td><td></td><td>3</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>61.85±0.29%</td></tr><tr><td>VANILLA PROTONET EST PROTONET</td><td>1 1</td><td>47.37% 47.71%</td><td>55.72% 55.05%</td><td>59.27% 59.31%</td><td>61.50% 61.97%</td><td>63.70% 63.48%</td><td>64.28% 64.65%</td><td>65.01% 65.35%</td><td>66.43% 66.33%</td><td>67.20% 66.42%</td><td>67.99% 67.44%</td><td>61.77±0.31%</td></tr><tr><td>PCA PROTONET</td><td>1</td><td>47.72%</td><td>54.60%</td><td>58.69%</td><td>60.73%</td><td>62.78%</td><td>64.92%</td><td>65.88%</td><td>65.88%</td><td>66.11%</td><td>66.87%</td><td>61.42±0.32%</td></tr><tr><td>VANILLA PROTONET</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>EST PROTONET</td><td>55</td><td>42.33% 48.85%</td><td>55.06%</td><td>61.32%</td><td>64.57%</td><td>66.51%</td><td>67.86%</td><td>69.33%</td><td>70.15%</td><td>71.32% 70.87%</td><td>72.05% 72.09%</td><td>64.05±0.33% 65.46±0.32%</td></tr><tr><td>PCA PROTONET</td><td>5</td><td>48.34%</td><td>58.38% 57.44%</td><td>62.75% 0.79%</td><td>65.16% 64.96%</td><td>67.24% 67.07%</td><td>68.39% 67.93%</td><td>69.89% 69.08%</td><td>70.99% 70.40%</td><td>70.38%</td><td>71.65%</td><td>64.96±0.31%</td></tr><tr><td>VANILLA PROTONET</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>EST PROTONET</td><td>10</td><td>35.38%</td><td>49.40%</td><td>56.76%</td><td>61.25%</td><td>64.56%</td><td>66.56%</td><td>68.05%</td><td>69.31%</td><td>70.12%</td><td>71.03%</td><td>61.24±0.36% 65.26±0.32%</td></tr><tr><td>PCA PROTONET</td><td>10 10</td><td>47.33% 46.55%</td><td>56.75% 56.61%</td><td>62.80% 60.81%</td><td>65.78% 64.01%</td><td>66.84% 66.53%</td><td>69.07% 67.70%</td><td>69.98% 69.18%</td><td>70.82% 69.83%</td><td>71.99% 70.62%</td><td>71.20% 71.22%</td><td>64.31 ±0.33%</td></tr><tr><td>VANILLA PROTONET</td><td>1-10</td><td>47.65%</td><td>56.23%</td><td>62.12 %</td><td>63.93%</td><td>66.34%</td><td>67.94%</td><td>68.44%</td><td>68.93%</td><td>70.80%</td><td>70.96%</td><td>64.33±0.30%</td></tr></table>
|
| 484 |
+
|
| 485 |
+
Table 5: Classification Accuracy on Omniglot-20-way, with 4 layer CNN embedding network.
|
| 486 |
+
|
| 487 |
+
<table><tr><td rowspan="2">MODEL</td><td rowspan="2">TRAINING SHOTS 1</td><td colspan="6">TESTING SHOTS</td></tr><tr><td></td><td>2</td><td>3</td><td>4</td><td>5</td><td>AVERAGE ACCURACY</td></tr><tr><td>VANILLA PROTONET</td><td>1</td><td>95.07 ±0.17 %</td><td>97.89 ±0.09 %</td><td>98.45 ±0.08 %</td><td>98.75 ±0.06 %</td><td>98.89 ±0.06%</td><td>97.81±0.06 %</td></tr><tr><td>VANILLA PROTONET</td><td>2</td><td>94.59 ±0.18 %</td><td>97.69 ±0.09 %</td><td>98.44 ±0.07 %</td><td>98.69 ±0.06 %</td><td>98.89 ±0.06 %</td><td>97.66 ±0.07 %</td></tr><tr><td>VANILLA PROTONET</td><td>3</td><td>94.19 ±0.18 %</td><td>97.57 ±0.09 %</td><td>98.30±0.07 %</td><td>98.63±0.07 %</td><td>98.79 ±0.06 %</td><td>97.50 ±0.07 %</td></tr><tr><td>VANILLA PROTONET</td><td>4</td><td>93.79 ±0.18 %</td><td>97.41 ±0.10 %</td><td>98.19 ±0.08 %</td><td>98.54 ±0.07 %</td><td>98.75±0.06%</td><td>97.34 ±0.07 %</td></tr><tr><td>VANILLA PROTONET</td><td>5</td><td>93.42 ±0.18 %</td><td>97.34±0.10 %</td><td>98.18 ±0.07 %</td><td>98.53 ±0.07 %</td><td>98.78 ±0.05 %</td><td>97.25 ±0.07 %</td></tr><tr><td>MIXED-k SHOT</td><td>1-5</td><td>94.84±0.17 %</td><td>97.81 ±0.09 %</td><td>98.45±0.07 %</td><td>98.70 ±0.06 %</td><td>98.92 ±0.54 %</td><td>97.74 ±0.06 %</td></tr><tr><td>PCA PROTONET</td><td>1</td><td>94.94 ±0.16 %</td><td>97.81 ±0.09 %</td><td>98.53±0.07 %</td><td>98.79 ±0.06 %</td><td>98.85±0.06%</td><td>97.78 ±0.06 %</td></tr><tr><td>EST PROTONET</td><td>1</td><td>95.11 ±0.17 %</td><td>97.95 ±0.09 %</td><td>98.46±0.07 %</td><td>98.77 ±0.06 %</td><td>98.84±0.06%</td><td>97.83 ±0.06 %</td></tr></table>
|
| 488 |
+
|
| 489 |
+
Table 6: Classification Accuracy on miniImageNet-5-way, with 7 layer ResNet embedding network.
|
| 490 |
+
|
| 491 |
+
<table><tr><td rowspan="2">MODEL</td><td rowspan="2">TRAINING SHOTS</td><td rowspan="2">2</td><td colspan="9">TESTING SHOTS 3 4</td><td rowspan="2">AVERAGE</td><td rowspan="2">ACCURACY</td></tr><tr><td></td><td></td><td></td><td></td><td>5</td><td>6</td><td>7</td><td>8</td><td></td></tr><tr><td>VANILLA PROTONET</td><td>1</td><td>52.65%</td><td>60.46%</td><td>64.18%</td><td>66.83%</td><td>68.27%</td><td></td><td>69.23%</td><td>70.19%</td><td>71.37%</td><td>71.83%</td><td>72.29%</td><td>66.73±0.20%</td></tr><tr><td>EST PROTONET</td><td>1</td><td>52.56%</td><td>60.63%</td><td>64.50%</td><td>66.53%</td><td>68.33%</td><td>69.36%</td><td></td><td>70.04%</td><td>71.21%</td><td>71.37%</td><td>71.60%</td><td>66.61±0.22%</td></tr><tr><td>PCA PROTONET</td><td>1</td><td>52.78%</td><td>60.35%</td><td>64.05%</td><td>66.24%</td><td>67.51%</td><td></td><td>69.64%</td><td>69.85%</td><td>71.13%</td><td>71.88%</td><td>71.79%</td><td>66.52±0.22%</td></tr><tr><td>VANILLA PROTONET</td><td>5</td><td>47.40%</td><td>58.23%</td><td>64.60%</td><td>67.52%</td><td></td><td>69.93%</td><td>71.05%</td><td>72.27%</td><td>72.90%</td><td>73.55%</td><td>74.35%</td><td>67.18±0.23%</td></tr><tr><td>EST PROTONET</td><td>5</td><td>51.93%</td><td>60.70%</td><td>65.33%</td><td>68.06%</td><td></td><td>69.98%</td><td>71.26%</td><td>72.33%</td><td>73.46%</td><td>74.03%</td><td>74.80%</td><td>68.19±0.23 %</td></tr><tr><td>PCA PROTONET</td><td>5</td><td>50.90%</td><td>60.38%</td><td>64.66%</td><td>67.23%</td><td></td><td>69.25%</td><td>71.30%</td><td>71.72%</td><td>72.75%</td><td>73.84%</td><td>74.24%</td><td>67.63±0.23%</td></tr><tr><td>VANILLA PROTONET</td><td></td><td></td><td></td><td></td><td></td><td></td><td>68.23%</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>EST PROTONET</td><td>10 10</td><td>42.20% 51.24%</td><td>55.98% 60.46%</td><td>61.67%</td><td>66.08%</td><td></td><td>70.06%</td><td>69.95% 71.07%</td><td>72.20% 72.55%</td><td>72.56% 73.39%</td><td>74.04% 73.85%</td><td>74.54 % 74.69%</td><td>65.75±0.25% 68.00±0.23%</td></tr><tr><td>PCAPROTONET</td><td>10</td><td>50.52%</td><td>59.20%</td><td>65.11% 64.44%</td><td>67.63% 66.86%</td><td>69.36%</td><td></td><td>71.00%</td><td>71.73%</td><td>73.19%</td><td>73.73%</td><td>73.82%</td><td>67.38±0.23%</td></tr><tr><td>VANILLA PROTONET</td><td>1-10</td><td>51.74%</td><td>60.10%</td><td>65.13%</td><td>67.12%</td><td>69.09%</td><td></td><td>70.53%</td><td>71.57%</td><td>72.22%</td><td>72.99%</td><td>73.63%</td><td>67.41±0.21%</td></tr></table>
|
| 492 |
+
|
| 493 |
+
Table 7: Classification Accuracy on tieredImageNet-5-way, with 7 layer ResNet embedding network.
|
| 494 |
+
|
| 495 |
+
<table><tr><td>MODEL</td><td>TRAINING</td><td colspan="10">TESTING SHOTS</td><td>AVERAGE</td></tr><tr><td></td><td>SHOTS</td><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td><td>9</td><td>10</td><td>ACCURACY</td></tr><tr><td>VANILLA PROTONET</td><td>1</td><td>49.78%</td><td>57.67%</td><td>61.37%</td><td>64.88%</td><td>65.17%</td><td>66.73%</td><td>67.53%</td><td>68.58%</td><td>68.21%</td><td>69.88%</td><td>63.98±0.29%</td></tr><tr><td>EST PROTONET</td><td>1</td><td>51.19%</td><td>57.61%</td><td>61.85%</td><td>64.43%</td><td>65.48%</td><td>67.64%</td><td>67.69%</td><td>67.76%</td><td>68.51%</td><td>68.20%</td><td>64.04±0.30%</td></tr><tr><td>PCA PROTONET</td><td>1</td><td>51.38%</td><td>57.89%</td><td>61.68%</td><td>64.32%</td><td>65.96%</td><td>66.15%</td><td>66.83%</td><td>68.00%</td><td>68.58%</td><td>68.77%</td><td>63.95±0.30%</td></tr><tr><td>VANILLA PROTONET</td><td>5</td><td>47.88%</td><td>58.70%</td><td>63.95%</td><td>66.58%</td><td>69.12%</td><td>71.69%</td><td>71.95%</td><td>73.15%</td><td>73.11%</td><td>73.80%</td><td>66.99 ±0.31%</td></tr><tr><td>EST PROTONET</td><td>5</td><td>53.05%</td><td>61.13 %</td><td>65.67%</td><td>68.07%</td><td>69.30%</td><td>71.47%</td><td>71.59 %</td><td>72.42%</td><td>72.80%</td><td>73.63%</td><td>67.91 ±0.31%</td></tr><tr><td>PCA PROTONET</td><td></td><td>51.21%</td><td>59.86%</td><td>63.91%</td><td>66.92%</td><td>68.88%</td><td>70.38%</td><td>71.48%</td><td>72.77%</td><td>73.81%</td><td>72.17%</td><td>67.14±0.32%</td></tr><tr><td>VANILLA PROTONET</td><td>10</td><td>40.84%</td><td>56.24%</td><td>62.10%</td><td>66.28%</td><td>69.37%</td><td>71.43%</td><td>72.09%</td><td>72.91%</td><td>73.56%</td><td>74.72%</td><td>65.95±0.35%</td></tr><tr><td>EST PROTONET</td><td>10</td><td>50.45%</td><td>60.41%</td><td>65.19%</td><td>68.46%</td><td>69.55%</td><td>70.87%</td><td>72.07%</td><td>72.66%</td><td>73.78%</td><td>74.79%</td><td>67.82 ±0.32%</td></tr><tr><td>PCA PROTONET</td><td>10</td><td>50.18%</td><td>59.59%</td><td>64.24%</td><td>67.43%</td><td>69.52%</td><td>70.65%</td><td>71.78%</td><td>72.10%</td><td>72.78%</td><td>73.65%</td><td>67.19±0.31%</td></tr><tr><td>VANILLA PROTONET</td><td>1-10</td><td>50.74%</td><td>60.03%</td><td>64.17 %</td><td>67.26%</td><td>69.28%</td><td>69.56%</td><td>71.07%</td><td>72.41%</td><td>71.99%</td><td>73.01%</td><td>66.95 ±0.29 %</td></tr></table>
|
| 496 |
+
|
| 497 |
+
Table 8: Classification Accuracy on Omniglot-20-way, with 7 layer ResNet embedding network.
|
| 498 |
+
|
| 499 |
+
<table><tr><td></td><td colspan="7">TESTING SHOTS</td></tr><tr><td>MODEL</td><td>TRAINING SHOTS</td><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>AVERAGE ACCURACY</td></tr><tr><td>VANILLA PROTONET</td><td>1</td><td>96.46%</td><td>98.39 %</td><td>98.82%</td><td>99.01 %</td><td>99.07%</td><td>98.35 ±0.05 %</td></tr><tr><td>VANILLA PROTONET</td><td>2</td><td>95.85%</td><td>98.32%</td><td>98.80%</td><td>98.95%</td><td>99.07%</td><td>98.20±0.05 %</td></tr><tr><td>VANILLA PROTONET</td><td>3</td><td>95.35 %</td><td>98.15%</td><td>98.73 %</td><td>98.91 %</td><td>99.03%</td><td>98.03 ±0.06%</td></tr><tr><td>VANILLA PROTONET</td><td>4</td><td>95.00%</td><td>98.05%</td><td>98.62 %</td><td>98.90%</td><td>98.99%</td><td>97.91 ±0.06 %</td></tr><tr><td>VANILLA PROTONET</td><td>5</td><td>94.42 %</td><td>97.98 %</td><td>98.60%</td><td>98.77 %</td><td>98.99%</td><td>97.75 ±0.06 %</td></tr><tr><td>VANILLA PROTONET</td><td>1-5</td><td>96.53%</td><td>98.53%</td><td>98.90%</td><td>99.06%</td><td>99.15%</td><td>98.43 ±0.05 %</td></tr><tr><td>EST PROTONET</td><td>1</td><td>96.18%</td><td>98.23 %</td><td>98.68%</td><td>98.87%</td><td>98.99%</td><td>98.19 ±0.05 %</td></tr><tr><td>PCA PROTONET</td><td>1</td><td>96.02%</td><td>98.22 %</td><td>98.76%</td><td>98.93%</td><td>99.02 %</td><td>98.19 ±0.05 %</td></tr></table>
|
md/train/HkgaETNtDB/HkgaETNtDB.md
ADDED
|
@@ -0,0 +1,391 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MIXOUT: EFFECTIVE REGULARIZATION TO FINETUNE LARGE-SCALE PRETRAINED LANGUAGE MODELS
|
| 2 |
+
|
| 3 |
+
Cheolhyoung Lee∗
|
| 4 |
+
|
| 5 |
+
cheolhyoung.lee@kaist.ac.kr
|
| 6 |
+
|
| 7 |
+
Kyunghyun Cho† ‡ § kyunghyun.cho@nyu.edu
|
| 8 |
+
|
| 9 |
+
Wanmo Kang∗
|
| 10 |
+
|
| 11 |
+
wanmo.kang@kaist.ac.kr
|
| 12 |
+
|
| 13 |
+
# ABSTRACT
|
| 14 |
+
|
| 15 |
+
In natural language processing, it has been observed recently that generalization could be greatly improved by finetuning a large-scale language model pretrained on a large unlabeled corpus. Despite its recent success and wide adoption, finetuning a large pretrained language model on a downstream task is prone to degenerate performance when there are only a small number of training instances available. In this paper, we introduce a new regularization technique, to which we refer as “mixout”, motivated by dropout. Mixout stochastically mixes the parameters of two models. We show that our mixout technique regularizes learning to minimize the deviation from one of the two models and that the strength of regularization adapts along the optimization trajectory. We empirically evaluate the proposed mixout and its variants on finetuning a pretrained language model on downstream tasks. More specifically, we demonstrate that the stability of finetuning and the average accuracy greatly increase when we use the proposed approach to regularize finetuning of BERT on downstream tasks in GLUE.
|
| 16 |
+
|
| 17 |
+
# 1 INTRODUCTION
|
| 18 |
+
|
| 19 |
+
Transfer learning has been widely used for the tasks in natural language processing (NLP) (Collobert et al., 2011; Devlin et al., 2018; Yang et al., 2019; Liu et al., 2019; Phang et al., 2018). In particular, Devlin et al. (2018) recently demonstrated the effectiveness of finetuning a large-scale language model pretrained on a large, unannotated corpus on a wide range of NLP tasks including question answering and language inference. They have designed two variants of models, BERTLARGE (340M parameters) and BERTBASE (110M parameters). Although BERTLARGE outperforms BERTBASE generally, it was observed that finetuning sometimes fails when a target dataset has fewer than 10,000 training instances (Devlin et al., 2018; Phang et al., 2018).
|
| 20 |
+
|
| 21 |
+
When finetuning a big, pretrained language model, dropout (Srivastava et al., 2014) has been used as a regularization technique to prevent co-adaptation of neurons (Vaswani et al., 2017; Devlin et al., 2018; Yang et al., 2019). We provide a theoretical understanding of dropout and its variants, such as Gaussian dropout (Wang & Manning, 2013), variational dropout (Kingma et al., 2015), and dropconnect (Wan et al., 2013), as an adaptive $L ^ { 2 }$ -penalty toward the origin (all zero parameters 0) and generalize dropout by considering a target model parameter $\textbf { \em u }$ (instead of the origin), to which we refer as $\mathtt { m i x o u t } ( { \pmb u } )$ . We illustrate mixout $( { \pmb u } )$ in Figure 1. To be specific, $\mathtt { m i x o u t } ( { \pmb u } )$ replaces all outgoing parameters from a randomly selected neuron to the corresponding parameters of $\textbf { \em u }$ . mixout $( { \pmb u } )$ avoids optimization from diverging away from $\textbf { \em u }$ through an adaptive $L ^ { 2 }$ -penalty toward $\textbf { \em u }$ . Unlike mixout $( { \pmb u } )$ , dropout encourages a move toward the origin which deviates away from $\textbf { \em u }$ since dropout is equivalent to mixout(0).
|
| 22 |
+
|
| 23 |
+
We conduct experiments empirically validating the effectiveness of the proposed $\mathtt { m i x o u t } ( w _ { \mathrm { p r e } } )$ where ${ \pmb w } _ { \mathrm { p r e } }$ denotes a pretrained model parameter. To validate our theoretical findings, we train a fully connected network on EMNIST Digits (Cohen et al., 2017) and finetune it on MNIST. We observe that a finetuning solution of $\mathtt { m i x o u t } ( w _ { \mathrm { p r e } } )$ deviates less from ${ \pmb w } _ { \mathrm { p r e } }$ in the $L ^ { 2 }$ -sense than that of dropout. In the main experiment, we finetune $\mathrm { B E R T _ { L A R G E } }$ with mixout $( w _ { \mathrm { p r e } } )$ on small training sets of GLUE (Wang et al., 2018). We observe that $\mathtt { m i x o u t } ( w _ { \mathrm { p r e } } )$ reduces the number of unusable models that fail with the chance-level accuracy and increases the average development (dev) scores for all tasks. In the ablation studies, we perform the following three experiments for finetuning BERTLARGE with mixout $( { \pmb w } _ { \mathrm { p r e } } )$ : (i) the effect of $\mathtt { m i x o u t } ( w _ { \mathrm { p r e } } )$ on a sufficient number of training examples, (ii) the effect of a regularization technique for an additional output layer which is not pretrained, and (iii) the effect of probability of $\mathtt { m i x o u t } ( w _ { \mathrm { p r e } } )$ compared to dropout. From these ablation studies, we observe that three characteristics of mixout $( w _ { \mathrm { p r e } } )$ : (i) finetuning with mixout $( { \pmb w } _ { \mathrm { p r e } } )$ does not harm model performance even with a sufficient number of training examples; (ii) It is beneficial to use a variant of mixout as a regularization technique for the additional output layer; (iii) The proposed mixout $( w _ { \mathrm { p r e } } )$ is helpful to the average dev score and to the finetuning stability in a wider range of its hyperparameter $p$ than dropout.
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: Illustration of mixout $( { \pmb u } )$ . Suppose that $\textbf { \em u }$ and $\pmb { w }$ are a target model parameter and a current model parameter, respectively. (a): We first memorize the parameters of the vanilla network at $\textbf { \em u }$ . (b): In the dropout network, we randomly choose an input neuron to be dropped (a dotted neuron) with a probability of $p$ . That is, all outgoing parameters from the dropped neuron are eliminated (dotted connections). (c): In the mixout $( { \pmb u } )$ network, the eliminated parameters in (b) are replaced by the corresponding parameters in (a). In other words, the mixout $( { \pmb u } )$ network at $\pmb { w }$ is the mixture of the vanilla network at $\textbf { \em u }$ and the dropout network at $\pmb { w }$ with a probability of $p$ .
|
| 27 |
+
|
| 28 |
+
# 1.1 RELATED WORK
|
| 29 |
+
|
| 30 |
+
For large-scale pretrained language models (Vaswani et al., 2017; Devlin et al., 2018; Yang et al., 2019), dropout has been used as one of several regularization techniques. The theoretical analysis for dropout as an $L ^ { 2 }$ -regularizer toward 0 was explored by Wan et al. (2013) where 0 is the origin. They provided a sharp characterization of dropout for a simplified setting (generalized linear model). Mianjy & Arora (2019) gave a formal and complete characterization of dropout in deep linear networks with squared loss as a nuclear norm regularization toward 0. However, neither Wan et al. (2013) nor Mianjy $\&$ Arora (2019) gives theoretical analysis for the extension of dropout which uses a point other than 0.
|
| 31 |
+
|
| 32 |
+
Wiese et al. (2017), Kirkpatrick et al. (2017), and Schwarz et al. (2018) used $L ^ { 2 }$ -penalty toward a pretrained model parameter to improve performance. They focused on preventing catastrophic forgetting to enable their models to learn multiple tasks sequentially. They however do not discuss nor demonstrate the effect of $L ^ { 2 }$ -penalty toward the pretrained model parameter on the stability of finetuning. Barone et al. (2017) introduced tuneout, which is a special case of mixout. They applied various regularization techniques including dropout, tuneout, and $L ^ { 2 }$ -penalty toward a pretrained model parameter to finetune neural machine translation. They however do not demonstrate empirical significance of tuneout compared to other regularization techniques nor its theoretical justification.
|
| 33 |
+
|
| 34 |
+
# 2 PRELIMINARIES AND NOTATIONS
|
| 35 |
+
|
| 36 |
+
Norms and Loss Functions Unless explicitly stated, a norm $\| \cdot \|$ refers to $L ^ { 2 }$ -norm. A loss function of a neural network is written as $\begin{array} { r } { \mathcal { L } ( \mathbf { w } ) = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathcal { L } _ { i } ( \ddot { \mathbf { w } } ) } \end{array}$ , where $\pmb { w }$ is a trainable model parameter. $\mathcal { L } _ { i }$ is “a per-example loss function” computed on the $i$ -th data point.
|
| 37 |
+
|
| 38 |
+
Strong Convexity A differentiable function $f$ is strongly convex if there exists $m > 0$ such that
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
f ( pmb { y } ) \geq f ( \pmb { x } ) + \nabla f ( \pmb { x } ) ^ { \top } ( \pmb { y } - \pmb { x } ) + \frac { m } { 2 } \| \pmb { y } - \pmb { x } \| ^ { 2 } ,
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
for all $_ { \textbf { \em x } }$ and $\textbf { { y } }$
|
| 45 |
+
|
| 46 |
+
Weight Decay We refer as “wdecay $( \pmb { u } , \lambda ) ^ { \prime }$ to minimizing
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\mathcal { L } ( \boldsymbol { \boldsymbol { w } } ) + \frac { \lambda } { 2 } \| \boldsymbol { \boldsymbol { w } } - \boldsymbol { u } \| ^ { 2 } ,
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
instead of the original loss function $\mathcal { L } ( w )$ where $\lambda$ is a regularization coefficient. Usual weight decay of $\lambda$ is equivalent to wdecay $( \mathbf { 0 } , \lambda )$ .
|
| 53 |
+
|
| 54 |
+
Probability for Dropout and Dropconnect Dropout (Srivastava et al., 2014) is a regularization technique selecting a neuron to drop with a probability of $p$ . Dropconnect (Wan et al., 2013) chooses a parameter to drop with a probability of $p$ . To emphasize their hyperparameter $p$ , we write dropout and dropconnect with a drop probability of $p$ as “dropout $( p )$ ” and “dropconnect $( p ) ^ { \dag }$ , respectively. dropout $( p )$ is a special case of dropconnect $( p )$ if we simultaneously drop the parameters outgoing from each dropped neuron.
|
| 55 |
+
|
| 56 |
+
Inverted Dropout and Dropconnect In the case of dropout $( p )$ , a neuron is retained with a probability of $1 - p$ during training. If we denote the weight parameter of that neuron as $\pmb { w }$ during training, then we use $( 1 - p ) \pmb { w }$ for that weight parameter at test time (Srivastava et al., 2014). This ensures that the expected output of a neuron is the same as the actual output at test time. In this paper, dropout $( p )$ refers to inverted dropout $( p )$ which uses ${ \pmb w } / ( 1 - p )$ instead of $\textbf { \em w }$ during training. By doing so, we do not need to compute the output separately at test time. Similarly, dropconnect $( p )$ refers to inverted dropconnect $( p )$ .
|
| 57 |
+
|
| 58 |
+
# 3 ANALYSIS OF DROPOUT AND ITS GENERALIZATION
|
| 59 |
+
|
| 60 |
+
We start our theoretical analysis by investigating dropconnect which is a general form of dropout and then apply the result derived from dropconnect to dropout. The iterative SGD equation for dropconnect $( p )$ with a learning rate of $\eta$ is
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\pmb { w } ^ { ( t + 1 ) } = \pmb { w } ^ { ( t ) } - \eta \pmb { B } ^ { ( t ) } \nabla \mathcal { L } \left( \left( \mathbb { E } B _ { 1 } ^ { ( t ) } \right) ^ { - 1 } \pmb { B } ^ { ( t ) } \pmb { w } ^ { ( t ) } \right) , t = 0 , 1 , 2 , \cdots ,
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
where $\pmb { B } ^ { ( t ) } = \mathrm { d i a g } ( \boldsymbol { B } _ { 1 } ^ { ( t ) } , \boldsymbol { B } _ { 2 } ^ { ( t ) }$ , · · · , $B _ { d } ^ { ( t ) } )$ ) and $B _ { i } ^ { ( t ) }$ ’s are mutually independent Bernoulli $( 1 - p )$ random variables with a drop probability of $p$ for all $i$ and $t$ . We regard equation 2 as finding a solution to the minimization problem below:
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\operatorname* { m i n } _ { \pmb { w } } \mathbb { E } \mathcal { L } \left( ( \mathbb { E } B _ { 1 } ) ^ { - 1 } \pmb { B } \pmb { w } \right) ,
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
where $B = \operatorname { d i a g } ( B _ { 1 } , ~ B _ { 2 } , ~ \cdot \cdot \cdot , ~ B _ { d } )$ and $B _ { i }$ ’s are mutually independent Bernoulli $( 1 - p )$ random variables with a drop probability of $p$ for all $i$ .
|
| 73 |
+
|
| 74 |
+
Gaussian dropout (Wang & Manning, 2013) and variational dropout (Kingma et al., 2015) use other random masks to improve dropout rather than Bernoulli random masks. To explain these variants of dropout as well, we set a random mask matrix $M = \mathrm { d i a g } ( M _ { 1 } , M _ { 2 }$ , · · · , $M _ { d } )$ ) to satisfy $\mathbb { E } M _ { i } = \mu$ and $\mathrm { V a r } ( M _ { i } ) = \sigma ^ { 2 }$ for all $i$ . Now we define a random mixture function with respect to $\textbf { \em w }$ from $\textbf { \em u }$ and $M$ as
|
| 75 |
+
|
| 76 |
+
and a minimization p
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\begin{array} { r l } & { \Phi ( w ; \boldsymbol { u } , M ) = \mu ^ { - 1 } \big ( ( I - M ) \boldsymbol { u } + M \boldsymbol { w } - ( 1 - \mu ) \boldsymbol { u } \big ) , } \\ & { \mathrm { r o b l e m ~ w i t h ~ } ^ { * } \mathrm { m i x c o n n e c t } ( \boldsymbol { u } , \mu , \boldsymbol { \sigma } ^ { 2 } ) ^ { , * } \mathrm { a s } } \\ & { ~ \operatorname* { m i n } _ { \boldsymbol { w } } \mathbb { E } \mathcal { L } \big ( \Phi ( \boldsymbol { w } ; \boldsymbol { u } , M ) \big ) . } \end{array}
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
We can view dropconnect $( p )$ equation 3 as a special case of equation 5 where ${ \pmb u } = { \bf 0 }$ and $M = B$ We investigate how mixconnect $( \pmb { u } , \mu , \sigma ^ { 2 } )$ differs from the vanilla minimization problem
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\operatorname* { m i n } _ { \boldsymbol { w } } \mathbb { E } \mathcal { L } ( \boldsymbol { w } ) .
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
If the loss function $\mathcal { L }$ is strongly convex, we can derive a lower bound of $\mathbb { E } \mathscr { L } \big ( \Phi ( { \boldsymbol w } ; { \boldsymbol u } , M ) \big )$ as in Theorem 1:
|
| 89 |
+
|
| 90 |
+
Theorem 1. Assume that the loss function $\mathcal { L }$ is strongly convex. Suppose that a random mixture function with respect to $\pmb { w }$ from $\textbf { \em u }$ and $M$ is given by $\Phi ( { \pmb w } ; { \pmb u } , M )$ in equation $^ { 4 }$ where $M$ is $\mathrm { d i a g } ( M _ { 1 } , ~ M _ { 2 } , ~ \cdot \cdot \cdot , ~ M _ { d } ) $ satisfying $\mathbb { E } M _ { i } = \mu$ and $\mathrm { V a r } ( M _ { i } ) = \sigma ^ { 2 }$ for all $i$ . Then, there exists $m > 0$ such that
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
\mathbb { E } \mathcal { L } \big ( \Phi ( { \boldsymbol w } ; { \boldsymbol u } , M ) \big ) \ge \mathcal { L } ( { \boldsymbol w } ) + \frac { m \sigma ^ { 2 } } { 2 \mu ^ { 2 } } \| { \boldsymbol w } - { \boldsymbol u } \| ^ { 2 } ,
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
for all $\textbf { \em w }$ (Proof in Supplement $A$ ).
|
| 97 |
+
|
| 98 |
+
Theorem 1 shows that minimizing the l.h.s. of equation 7 minimizes the r.h.s. of equation 7 when the r.h.s. is a sharp lower limit of the l.h.s. The strong convexity of $\mathcal { L }$ means that $\mathcal { L }$ is bounded from below by a quadratic function, and the inequality of equation 7 comes from the strong convexity. Hence, the equality holds if $\mathcal { L }$ is quadratic, and mixconnect $( \pmb { u } , \mu , \sigma ^ { 2 } )$ is an $L ^ { 2 }$ -regularizer with a regularization coefficient of $m \sigma ^ { 2 } { \dot { / } } \mu ^ { 2 }$ .
|
| 99 |
+
|
| 100 |
+
# 3.1 MIXCONNECT TO MIXOUT
|
| 101 |
+
|
| 102 |
+
We propose mixout as a special case of mixconnect, which is motivated by the relationship between dropout and dropconnect. We assume that
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\begin{array} { r } { { \pmb w } = \left( { \pmb w } _ { 1 } ^ { ( N _ { 1 } ) } , \ \cdots , \ { \pmb w } _ { d _ { 1 } } ^ { ( N _ { 1 } ) } , \ w _ { 1 } ^ { ( N _ { 2 } ) } , \ \cdots , \ w _ { d _ { 2 } } ^ { ( N _ { 2 } ) } , \ \cdots \dots , w _ { 1 } ^ { ( N _ { k } ) } , \ \cdots , \ w _ { d _ { k } } ^ { ( N _ { k } ) } \right) , } \end{array}
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
where $w _ { j } ^ { ( N _ { i } ) }$ is the $j$ th parameter outgoing from the neuron $N _ { i }$ . We set the corresponding $M$
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
M = \mathrm { d i a g } \left( M ^ { ( N _ { 1 } ) } , \ \cdots \ , \ M ^ { ( N _ { 1 } ) } , \ M ^ { ( N _ { 2 } ) } , \ \cdots \ , \ M ^ { ( N _ { 2 } ) } , \ \cdots \ \cdots \ , \ M ^ { ( N _ { k } ) } , \ \cdots \ , \ M ^ { ( N _ { k } ) } \right) ,
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
where $\mathbb { E } M ^ { ( N _ { i } ) } = \mu$ and $\mathrm { V a r } ( M ^ { ( N _ { i } ) } ) = \sigma ^ { 2 }$ for all $i$ . In this paper, we set $M ^ { ( N _ { i } ) }$ to Bernoull $( 1 - p )$ for all $i$ and mixout $( { \pmb u } )$ hereafter refers to this correlated version of mixconnect with Bernoulli random masks. We write it as “mixout $( \boldsymbol { u } , \boldsymbol { p } ) ^ { \flat }$ when we emphasize the mix probability $p$ .
|
| 115 |
+
|
| 116 |
+
Corollary 1.1. Assume that the loss function $\mathcal { L }$ is strongly convex. We denote the random mixture function of mixout $( \pmb { u } , \ p )$ , which is equivalent to that of mixconnect $( \pmb { u } , \ 1 - p , \ p - p ^ { 2 } )$ , as $\Phi ( { \pmb w } ; { \pmb u } , M )$ where $M$ is defined in equation 8. Then, there exists $m > 0$ such that
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\mathbb { E } \mathcal { L } \big ( \Phi ( { \boldsymbol w } ; { \boldsymbol u } , B ) \big ) \ge \mathcal { L } ( { \boldsymbol w } ) + \frac { m p } { 2 ( 1 - p ) } \| { \boldsymbol w } - { \boldsymbol u } \| ^ { 2 } ,
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
for all $\textbf { \em w }$
|
| 123 |
+
|
| 124 |
+
Corollary 1.1 is a straightforward result from Theorem 1. As the mix probability $p$ in equation 9 increases to 1, the $L ^ { 2 }$ -regularization coefficient of $m p / ( 1 - p )$ increases to infinity. It means that $p$ of mixout $( \boldsymbol { \mathscr { u } } , \boldsymbol { p } )$ can adjust the strength of $L ^ { 2 }$ -penalty toward $\textbf { \em u }$ in optimization. mixout $( { \pmb u } )$ differs from wdecay $( { \pmb u } )$ since the regularization coefficient of mixout $( { \pmb u } )$ depends on $m$ determined by the current model parameter $\pmb { w }$ . mixout $( \pmb { u } , \ p )$ indeed regularizes learning to minimize the deviation from $\textbf { \em u }$ . We validate this by performing least squares regression in Supplement D.
|
| 125 |
+
|
| 126 |
+
We often apply dropout to specific layers. For instance, Simonyan & Zisserman (2014) applied dropout to fully connected layers only. We generalize Theorem 1 to the case in which mixout is only applied to specific layers, and it can be done by constructing $M$ in a particular way. We demonstrate this approach in Supplement B and show that mixout for specific layers adaptively $L ^ { 2 }$ -penalizes their parameters.
|
| 127 |
+
|
| 128 |
+
# 3.2 MIXOUT FOR PRETRAINED MODELS
|
| 129 |
+
|
| 130 |
+
Hoffer et al. (2017) have empirically shown that
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\left\| \mathbfcal { w } _ { t } - \mathbfcal { w } _ { 0 } \right\| \sim \log t ,
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
where ${ \pmb w } _ { t }$ is a model parameter after the $t$ -th SGD step. When training from scratch, we usually sample an initial model parameter $\pmb { w } _ { 0 }$ from a normal/uniform distribution with mean 0 and small variance. Since ${ \pmb w } _ { 0 }$ is close to the origin, ${ \pmb w } _ { t }$ is away from the origin only with a large $t$ by equation 10. When finetuning, we initialize our model parameter from a pretrained model parameter ${ \pmb w } _ { \mathrm { p r e } }$ . Since we usually obtain ${ \pmb w } _ { \mathrm { p r e } }$ by training from scratch on a large pretraining dataset, ${ \pmb w } _ { \mathrm { p r e } }$ is often far away from the origin. By Corollary 1.1, dropout $L ^ { 2 }$ -penalizes the model parameter for deviating away from the origin rather than ${ \pmb w } _ { \mathrm { p r e } }$ . To explicitly prevent the deviation from ${ \pmb w } _ { \mathrm { p r e } }$ , we instead propose to use mixout $( w _ { \mathrm { p r e } } )$ .
|
| 137 |
+
|
| 138 |
+
# 4 VERIFICATION OF THEORETICAL RESULTS FOR MIXOUT ON MNIST
|
| 139 |
+
|
| 140 |
+
Wiese et al. (2017) have highlighted that wdecay $( w _ { \mathrm { p r e } } )$ is an effective regularization technique to avoid catastrophic forgetting during finetuning. Because mixout $( w _ { \mathrm { p r e } } )$ keeps the finetuned model to stay in the vicinity of the pretrained model similarly to wdecay $( \dot { \boldsymbol { w } } _ { \mathrm { p r e } } )$ , we suspect that the proposed mixout $( w _ { \mathrm { p r e } } )$ has a similar effect of alleviating the issue of catastrophic forgetting. To empirically verify this claim, we pretrain a 784-300-100-10 fully-connected network on EMNIST Digits (Cohen et al., 2017), and finetune it on MNIST. For more detailed description of the model architecture and datasets, see Supplement C.1.
|
| 141 |
+
|
| 142 |
+
In the pretraining stage, we run five random experiments with a batch size of 32 for $\{ 1 , 2 , \cdots , 2 0 \}$ training epochs. We use Adam (Kingma & Ba, 2014) with a learning rate of $1 0 ^ { - 4 }$ , $\beta _ { 1 } ~ = ~ 0 . 9$ , $\beta _ { 2 } ~ = ~ 0 . 9 9 9$ , wdecay $\mathbf { ( 0 , \eta 0 . 0 1 ) }$ , learning rate warm-up over the first $10 \%$ steps of the total steps, and linear decay of the learning rate after the warm-up. We use dropout(0.1) for all layers except the input and output layers. We select ${ \pmb w } _ { \mathrm { p r e } }$ whose validation accuracy on EMNIST Digits is best (0.992) in all experiments.
|
| 143 |
+
|
| 144 |
+
For finetuning, most of the model hyperparameters are kept same as in pretraining, with the exception of the learning rate, number of training epochs, and regularization techniques. We train with a learning rate of $\zeta \times 1 0 ^ { - 5 }$ for 5 training epochs. We replace dropout $( p )$ with mixout $( \mathbf { \boldsymbol { w } } _ { \mathrm { p r e } } , \mathbf { \boldsymbol { p } } )$ . We do not use any other regularization technique such as wdecay(0) and wdecay $( { \pmb w } _ { \mathrm { p r e } } )$ . We monitor $\lvert | \boldsymbol { w } _ { \mathrm { f t } } - \boldsymbol { w } _ { \mathrm { p r e } } \rvert | ^ { 2 }$ ,1 validation accuracy on MNIST, and validation accuracy on EMNIST Digits to compare mixout $( { \pmb w } _ { \mathrm { p r e } } , \ p )$ to dropout $( p )$ across 10 random restarts.2
|
| 145 |
+
|
| 146 |
+

|
| 147 |
+
Figure 2: We present $\lvert | \boldsymbol { w } _ { \mathrm { f t } } - \boldsymbol { w } _ { \mathrm { p r e } } \rvert | ^ { 2 }$ , validation accuracy on MNIST (target task), and validation accuracy on EMNIST Digits (source task), as the function of the probability $p$ where ${ \pmb w } _ { \mathrm { f t } }$ and ${ \pmb w } _ { \mathrm { p r e } }$ are the model parameter after finetuning and the pretrained model parameter, respectively. We report mean (curve) $\pm$ std. (shaded area) across 10 random restarts. (a): mixout $( { \pmb w } _ { \mathrm { p r e } } , \ p ) \ \bar { L } ^ { 2 }$ -penalizes the deviation from ${ \pmb w } _ { \mathrm { p r e } }$ , and this penalty becomes strong as $p$ increases. However, with dropout $( p )$ , ${ \pmb w } _ { \mathrm { f t } }$ becomes away from ${ \pmb w } _ { \mathrm { p r e } }$ as $p$ increases. (b): After finetuning on MNIST, both mixout $( \pmb { w } _ { \mathrm { p r e } } , p )$ and dropout $( p )$ result in high validation accuracy on MNIST for $p \in \{ 0 . 1 , 0 . 2 , 0 . 3 \}$ . (c): Validation accuracy of dropout $( p )$ on EMNIST Digits drops more than that of mixout $( \mathbf { \boldsymbol { w } } _ { \mathrm { p r e } } , \mathbf { \boldsymbol { p } } )$ for all $p$ . mixout $( \mathbf { \boldsymbol { w } } _ { \mathrm { p r e } } , \mathbf { \boldsymbol { p } } )$ minimizes the deviation from ${ \pmb w } _ { \mathrm { p r e } }$ and memorizes the source task better than dropout $( p )$ for all $p$ .
|
| 148 |
+
|
| 149 |
+
As shown in Figure 2 (a), after finetuning with mixout $( \mathbf { \boldsymbol { w } } _ { \mathrm { p r e } } , \mathbf { \boldsymbol { p } } )$ , the deviation from ${ \pmb w } _ { \mathrm { p r e } }$ is minimized in the $L ^ { 2 }$ -sense. This result verifies Corollary 1.1. We demonstrate that the validation accuracy of mixout $( \mathbf { \boldsymbol { w } } _ { \mathrm { p r e } } , \mathbf { \boldsymbol { p } } )$ has greater robustness to the choice of $p$ than that of dropout $( p )$ . In Figure 2 (b), both dropout $( p )$ and mixout $( \mathbf { \boldsymbol { w } } _ { \mathrm { p r e } } , \mathbf { \boldsymbol { p } } )$ result in high validation accuracy on the target task (MNIST) for $p \in \{ 0 . 1 , \ 0 . 2 , \ 0 . 3 \}$ , although mixout $( \mathbf { \boldsymbol { w } } _ { \mathrm { p r e } } , \mathbf { \boldsymbol { p } } )$ is much more robust with respect to the choice of the mix probability $p$ . In Figure 2 (c), the validation accuracy of mixout $( { \pmb w } _ { \mathrm { p r e } } , \ p )$ on the source task (EMNIST Digits) drops from the validation accuracy of the model at ${ \pmb w } _ { \mathrm { p r e } }$ (0.992) to approximately 0.723 regardless of $p$ . On the other hand, the validation accuracy of dropout $( p )$ on the source task respectively drops by 0.041, 0.074 and 0.105 which are more than those of mixout $( \pmb { w } _ { \mathrm { p r e } } , p )$ for $p \in \{ \bar { 0 } . 1 , 0 . \bar { 2 } , 0 . 3 \bar \}$ .
|
| 150 |
+
|
| 151 |
+
# 5 FINETUNING A PRETRAINED LANGUAGE MODEL WITH MIXOUT
|
| 152 |
+
|
| 153 |
+
In order to experimentally validate the effectiveness of mixout, we finetune BERTLARGE on a subset of GLUE (Wang et al., 2018) tasks (RTE, MRPC, CoLA, and STS-B) with mixout $( w _ { \mathrm { p r e } } )$ . We choose them because Phang et al. (2018) have observed that it was unstable to finetune BERTLARGE on these four tasks. We use the publicly available pretrained model released by Devlin et al. (2018), ported into PyTorch by HuggingFace.3 We use the learning setup and hyperparameters recommended by Devlin et al. (2018). We use Adam with a learning rate of $\overset { \cdot } { 2 } \times \overset { \cdot } { 1 } 0 ^ { - 5 }$ , $\beta _ { 1 } ~ = ~ 0 . 9$ , $\beta _ { 2 } ~ = ~ 0 . 9 \dot { 9 } 9$ , learning rate warmup over the first $10 \%$ steps of the total steps, and linear decay of the learning rate after the warmup finishes. We train with a batch size of 32 for 3 training epochs. Since the pretrained BERTLARGE is the sentence encoder, we have to create an additional output layer, which is not pretrained. We initialize each parameter of it with $\mathcal { N } ( 0 , 0 . 0 2 ^ { 2 } )$ . We describe our experimental setup further in Supplement C.2.
|
| 154 |
+
|
| 155 |
+
The original regularization strategy used in Devlin et al. (2018) for finetuning BERTLARGE is using both dropout(0.1) and wdecay $\mathbf { ( 0 , \eta 0 . 0 1 ) }$ for all layers except layer normalization and intermediate layers activated by GELU (Hendrycks & Gimpel, 2016). We however cannot use mixout $( { \pmb w } _ { \mathrm { p r e } } )$ nor wdecay $( { \pmb w } _ { \mathrm { p r e } } )$ for the additional output layer which was not pretrained and therefore does not have ${ \pmb w } _ { \mathrm { p r e } }$ . We do not use any regularization for the additional output layer when finetuning BERTLARGE with mixout $( { \boldsymbol { w } } _ { \mathrm { p r e } } )$ and wdecay $( w _ { \mathrm { p r e } } )$ . For the other layers, we replace dropout(0.1) and wdecay $\mathbf { ( 0 , \ 0 . 0 1 ) }$ with mixout $( { \boldsymbol { w } } _ { \mathrm { p r e } } )$ and wdecay $( w _ { \mathrm { p r e } } )$ , respectively.
|
| 156 |
+
|
| 157 |
+
Phang et al. (2018) have reported that large pretrained models (e.g., $\mathrm { B E R T _ { L A R G E } } \backslash$ ) are prone to degenerate performance when finetuned on a task with a small number of training examples, and that multiple random restarts4 are required to obtain a usable model better than random prediction. To compare finetuning stability of the regularization techniques, we need to demonstrate the distribution of model performance. We therefore train $\mathrm { B E R T _ { L A R G E } }$ with each regularization strategy on each task with 20 random restarts. We validate each random restart on the dev set to observe the behaviour of the proposed mixout and finally evaluate it on the test set for generalization. We present the test score of our proposed regularization strategy on each task in Supplement C.3.
|
| 158 |
+
|
| 159 |
+
We finetune $\mathrm { B E R T _ { L A R G E } }$ with mixout $( w _ { \mathrm { p r e } }$ , $\{ 0 . 7 , 0 . 8 , 0 . 9 \} \mathrm { , }$ ) on RTE, MRPC, CoLA, and STSB. For the baselines, we finetune $\mathrm { B E R T _ { L A R G E } }$ with both dropout(0.1) and wdecay $\mathbf { ( 0 , \ 0 . 0 1 ) }$ as well as with wdecay $\mathbf { \Delta } _ { w _ { \mathrm { p r e } } }$ , $\{ 0 . 0 1 , 0 . 0 4 , 0 . 0 7 , 0 . 1 0 \} )$ . These choices are made based on the experiments in Section 6.3 and Supplement F. In Section 6.3, we observe that finetuning BERTLARGE with mixout $( \mathbf { \boldsymbol { w } } _ { \mathrm { p r e } } , \mathbf { \boldsymbol { p } } )$ on RTE is significantly more stable with $p \in \{ 0 . 7 , \ 0 . 8 , \ 0 . 9 \}$ while finetuning with $\operatorname { d r o p o u t } ( p )$ becomes unstable as $p$ increases. In Supplement F, we demonstrate that dropout(0.1) is almost optimal for all the tasks in terms of mean dev score although Devlin et al. (2018) selected it to improve the maximum dev score.
|
| 160 |
+
|
| 161 |
+
In Figure 3, we plot the distributions of the dev scores from 20 random restarts when finetuning BERTLARGE with various regularization strategies on each task. For conciseness, we only show four regularization strategies; Devlin et al. (2018)’s: both dropout(0.1) and wdecay $\mathbf { ( 0 , \theta 0 . 0 1 ) }$ , Wiese et al. (2017)’s: wdecay $( w _ { \mathrm { p r e } } , \ 0 . 0 1 )$ , ours: mixout $( w _ { \mathrm { p r e } } , \ 0 . 7 )$ , and ours $^ +$ Wiese et al. (2017)’s: both mixout $( { \pmb w } _ { \mathrm { p r e } } , \ 0 . 7 )$ and wdecay $( w _ { \mathrm { p r e } } , \ 0 . 0 1 )$ . As shown in Figure 3 (a–c), we observe many finetuning runs that fail with the chance-level accuracy when we finetune BERTLARGE with both dropout(0.1) and wdecay $\mathbf { ( 0 , \ 0 . 0 1 ) }$ on RTE, MRPC, and CoLA. We also have a bunch of degenerate model configurations when we use wdecay $( w _ { \mathrm { p r e } } , \ 0 . 0 1 )$ without mixout $( w _ { \mathrm { p r e } } , \ 0 . 7 )$ .
|
| 162 |
+
|
| 163 |
+
Unlike existing regularization strategies, when we use mixout $( { \pmb w } _ { \mathrm { p r e } } , \ 0 . 7 )$ as a regularization technique with or without wdecay $( { \pmb w } _ { \mathrm { p r e } } , \ 0 . 0 1 )$ for finetuning $\mathrm { B E R T _ { L A R G E } }$ , the number of degenerate model configurations that fail with a chance-level accuracy significantly decreases. For example, in Figure 3 (c), we have only one degenerate model configuration when finetuning BERTLARGE with mixout $( { \pmb w } _ { \mathrm { p r e } } , \ 0 . 7 )$ on CoLA while we observe respectively seven and six degenerate models with Devlin et al. (2018)’s and Wiese et al. (2017)’s regularization strategies.
|
| 164 |
+
|
| 165 |
+

|
| 166 |
+
Figure 3: Distribution of dev scores on each task from 20 random restarts when finetuning BERTLARGE with Devlin et al. (2018)’s: both dropout(0.1) and wdecay(0, 0.01), Wiese et al. (2017)’s: wdecay $( { \pmb w } _ { \mathrm { p r e } } , \ 0 . 0 1 )$ , ours: mixout $( w _ { \mathrm { p r e } } , \ 0 . 7 )$ , and ours $+$ Wiese et al. (2017)’s: both mixout $( w _ { \mathrm { p r e } } , \ 0 . 7 )$ and wdecay( $( w _ { \mathrm { p r e } } , \ 0 . 0 1 )$ . We write them as Devlin (blue), Wiese (orange), Our (green), and $\mathrm { O u r + W }$ (red), respectively. We use the same set of 20 random initializations across all the regularization setups. Error intervals show mean±std. For all the tasks, the number of finetuning runs that fail with the chance-level accuracy is significantly reduced when we use our regularization mixout $( { \pmb w } _ { \mathrm { p r e } } , \ 0 . 7 )$ regardless of using wdecay $( { \pmb w } _ { \mathrm { p r e } } , \ 0 . 0 1 )$ .
|
| 167 |
+
|
| 168 |
+
In Figure 3 (a), we further improve the stability of finetuning BERTLARGE by using both mixout $( w _ { \mathrm { p r e } } , 0 . 7 )$ and wdecay( $\mathbf { \Delta } _ { w _ { \mathrm { p r e } } }$ , 0.01). Figure 3 (d) shows respectively two and one degenerate model configurations with Devlin et al. (2018)’s and Wiese et al. (2017)’s, but we do not have any degenerate resulting model with ours and ours $+$ Wiese et al. (2017)’s. In Figure 3 (b, c), we observe that the number of degenerate model configurations increases when we use wdecay $( { \pmb w } _ { \mathrm { p r e } } , \ 0 . 0 1 )$ ) additionally to mixout $( { \pmb w } _ { \mathrm { p r e } } , \ 0 . 7 )$ . In short, applying our proposed mixout significantly stabilizes the finetuning results of BERTLARGE on small training sets regardless of whether we use wdecay $( \mathbf { \mathscr { w } } _ { \mathrm { p r e } } , \ 0 . 0 1 )$ .
|
| 169 |
+
|
| 170 |
+
In Table 1, we report the average and the best dev scores across 20 random restarts for each task with various regularization strategies. The average dev scores with mixout( $\mathbf { \Delta } w _ { \mathrm { p r e } }$ , $\{ 0 . 7 , \ 0 . 8 , \ 0 . 9 \} ,$ ) increase for all the tasks. For instance, the mean dev score of finetuning with mixout $( { \pmb w } _ { \mathrm { p r e } } , \ 0 . 8 )$ on CoLA is 57.9 which is $4 9 . 2 \%$ increase over 38.8 obtained by finetuning with both dropout $( p )$ and wdecay $\mathbf { ( 0 , \ 0 . 0 1 ) }$ . We observe that using wdecay( $\mathbf { \Delta } w _ { \mathrm { p r e } }$ , $\{ \bar { 0 . 0 1 } , 0 . 0 4 , \mathsf { \bar { 0 } . 0 7 } , 0 . 1 0 \} \}$ ) also improves the average dev scores for most tasks compared to using both dropout $( p )$ and wdecay $\mathbf { ( 0 , \ 0 . 0 1 ) }$ . We however observe that finetuning with mixout $: ( w _ { \mathrm { p r e } } , ~ \{ 0 . 7 , 0 . 8 , 0 . 9 \} )$ outperforms that with wdecay $\mathbf { \Delta } _ { w _ { \mathrm { p r e } } }$ $_ \mathrm { e } , \ \{ 0 . 0 1 , 0 . 0 4 , 0 . 0 7 , 0 . 1 0 \}$ ) on average. This confirms that $\mathtt { m i x o u t } ( w _ { \mathrm { p r e } } )$ has a different effect for finetuning BERTLARGE compared to wdecay $( { \pmb w } _ { \mathrm { p r e } } )$ since mixout $( w _ { \mathrm { p r e } } )$ is an adaptive $L ^ { 2 }$ -regularizer along the optimization trajectory.
|
| 171 |
+
|
| 172 |
+
Since finetuning a large pretrained language model such as $\mathrm { B E R T _ { L A R G E } }$ on a small training set frequently fails, the final model performance has often been reported as the maximum dev score (Devlin et al., 2018; Phang et al., 2018) among a few random restarts. We thus report the best dev score for each setting in Table 1. According to the best dev scores as well, mixout( $\mathbf { \Delta } _ { w _ { \mathrm { p r e } } }$ , $\{ 0 . 7 , ~ 0 . 8 , ~ 0 . 9 \} )$ improves performance for all the tasks compared to using both dropout $( p )$ and wdecay $\mathbf { ( 0 , \ 0 . 0 1 ) }$ . For instance, using $\mathrm { m i x o u t } ( w _ { \mathrm { p r e } } , \ 0 . 9 )$ improves the maximum dev score by 0.9 compared to using both dropout $( p )$ and wdecay(0, 0.01) on MRPC. Unlike the average dev scores, the best dev scores achieved by using wdecay $( w _ { \mathrm { p r e } }$ , $\{ 0 . 0 1 , 0 . 0 4 , 0 . 0 7 , 0 . 1 0 \}$ ) are better than those achieved by using mixout( $\mathbf { \Delta } _ { w _ { \mathrm { p r e } } }$ , $\{ 0 . 7 , 0 . 8 , 0 . 9 \}$ ) except RTE on which it was better to use mixout $\mathbf { \Delta } _ { w _ { \mathrm { p r e } } }$ , $\left\{ 0 . 7 , 0 . 8 , 0 . 9 \right\}$ ) than wdecay( ${ \pmb w } _ { \mathrm { p r e } }$ , $\{ 0 . 0 \bar { 1 } , 0 . 0 4 , 0 . 0 7 , 0 . 1 0 \}$ ).
|
| 173 |
+
|
| 174 |
+
Table 1: Mean (max) dev scores across 20 random restarts when finetuning BERTLARGE with various regularization strategies on each task. We show the following baseline results on the first and second cells: Devlin et al. (2018)’s regularization strategy (both dropout $( p )$ and wdecay $\mathbf { ( 0 , \ 0 . 0 1 ) } )$ ) and Wiese et al. (2017)’s regularization strategy (wdecay( $( w _ { \mathrm { p r e } }$ , $\{ 0 . 0 1 , 0 . 0 4 , 0 . 0 7 , 0 . 1 0 \} )$ ). In the third cell, we demonstrate finetuning results with only mixout $( w _ { \mathrm { p r e } }$ , $\{ 0 . 7 , \ 0 . 8 , \ 0 . 9 \} $ ). The results with both mixout $\mathbf { \Delta } _ { w _ { \mathrm { p r e } } }$ , $\{ 0 . 7 , 0 . 8 , \mathbf { \bar { 0 } } . 9 \} )$ and wdecay( $\mathbf { \Delta } w _ { \mathrm { p r e } }$ , 0.01) are also presented in the fourth cell. Bold marks the best of each statistics within each column. The mean dev scores greatly increase for all the tasks when we use mixout( $\mathbf { \Delta } _ { w _ { \mathrm { p r e } } }$ , $\{ 0 . 7 , 0 . 8 , 0 . 9 \}$ ).
|
| 175 |
+
|
| 176 |
+
<table><tr><td>TECHNIQUE 1</td><td>TECHNIQUE 2</td><td>RTE</td><td>MRPC</td><td>CoLA</td><td>STS-B</td></tr><tr><td>dropout(0.1)</td><td>wdecay(0, 0.01)</td><td>56.5 (73.6)</td><td>83.4 (90.4)</td><td>38.8 (63.3)</td><td>82.4 (90.3)</td></tr><tr><td>-</td><td>wdecay( (wpre, 0.01)</td><td>56.3 (71.5)</td><td>86.2 (91.6)</td><td>41.9 (65.6)</td><td>85.4 (90.5)</td></tr><tr><td></td><td>wdecay( (wpre, 0.04)</td><td>51.5 (70.8)</td><td>85.8 (91.5)</td><td>35.4 (64.7)</td><td>80.7 (90.6)</td></tr><tr><td></td><td>wdecay( (wpre, 0.07</td><td>57.0 (70.4)</td><td>85.8 (91.0)</td><td>48.1 (63.9)</td><td>89.6 (90.3)</td></tr><tr><td>-</td><td>wdecay( (wpre, 0.10)</td><td>54.6 (71.1)</td><td>84.2 (91.8)</td><td>45.6 (63.8)</td><td>84.3 (90.1)</td></tr><tr><td>mixout(wpre, 0.7)</td><td></td><td>61.6 (74.0)</td><td>87.1 (91.1)</td><td>57.4 (62.1)</td><td>89.6 (90.3)</td></tr><tr><td>mixout( (Wpre, 0.8</td><td></td><td>64.0 (74.0)</td><td>89.0 (90.7)</td><td>57.9 (63.8)</td><td>89.4 (90.3)</td></tr><tr><td>mixout( (Wpre, 0.9)</td><td></td><td>64.3 (73.3)</td><td>88.2 (91.4)</td><td>55.2 (63.4)</td><td>89.4 (90.0)</td></tr><tr><td>mixout( 0.7)</td><td>wdecay 0.01)</td><td>65.3 (74.4)</td><td>87.8 (91.8)</td><td>51.9 (64.0)</td><td></td></tr><tr><td>(wpre, mixout( 0.8</td><td>(wpre, wdecay( 0.01)</td><td>62.8 (74.0)</td><td>86.3 (90.9)</td><td>58.3 (65.1)</td><td>89.6 (90.6) 89.7 (90.3)</td></tr><tr><td>(Wpre,</td><td>(wpre,</td><td></td><td></td><td></td><td></td></tr><tr><td>mixout(wpre, 0.9</td><td>wdecay( (wpre, 0.01)</td><td>65.0 (75.5)</td><td>88.6 (91.3)</td><td>58.1 (65.1)</td><td>89.5 (90.0)</td></tr></table>
|
| 177 |
+
|
| 178 |
+
We investigate the effect of combining both mixout $( { \pmb w } _ { \mathrm { p r e } } )$ and wdecay $( { \pmb w } _ { \mathrm { p r e } } )$ to see whether they are complementary. We finetune BERTLARGE with both mixout( $\mathbf { \Delta } _ { w _ { \mathrm { p r e } } }$ , {0.7, 0.8, 0.9}) and wdecay $( \mathbf { { w } } _ { \mathrm { { p r e } } } , \ 0 . 0 1 )$ . This leads not only to the improvement in the average dev scores but also in the best dev scores compared to using wdecay $( w _ { \mathrm { p r e } }$ , $\{ 0 . 0 1 , 0 . 0 4 , 0 . 0 7 , 0 . 1 0 \} )$ ) and using both $\operatorname { d r o p o u t } ( p )$ and wdecay(0, 0.01). The experiments in this section confirm that using mixout $( w _ { \mathrm { p r e } } )$ as one of several regularization techniques prevents finetuning instability and yields gains in dev scores.
|
| 179 |
+
|
| 180 |
+
# 6 ABLATION STUDY
|
| 181 |
+
|
| 182 |
+
In this section, we perform ablation experiments to better understand mixout $( w _ { \mathrm { p r e } } )$ . Unless explicitly stated, all experimental setups are the same as in Section 5.
|
| 183 |
+
|
| 184 |
+
# 6.1 MIXOUT WITH A SUFFICIENT NUMBER OF TRAINING EXAMPLES
|
| 185 |
+
|
| 186 |
+
We showed the effectiveness of the proposed mixout finetuning with only a few training examples in Section 5. In this section, we investigate the effectiveness of the proposed mixout in the case of a larger finetuning set. Since it has been stable to finetune $\mathrm { B E R T _ { L A R G E } }$ on a sufficient number of training examples (Devlin et al., 2018; Phang et al., 2018), we expect to see the change in the behaviour of mixout $( { \pmb w } _ { \mathrm { p r e } } )$ when we use it to finetune BERTLARGE on a larger training set.
|
| 187 |
+
|
| 188 |
+
We train BERTLARGE by using both mixout $( w _ { \mathrm { p r e } } , \ 0 . 7 )$ and wdecay( ${ \pmb w } _ { \mathrm { p r e } }$ , 0.01) with 20 random restarts on SST-2.5 We also train $\mathrm { B E R T _ { L A R G E } }$ by using both dropout $( p )$ and wdecay(0, 0.01) with 20 random restarts on SST-2 as the baseline. In Table 2, we report the mean and maximum of
|
| 189 |
+
|
| 190 |
+
SST-2 dev scores across 20 random restarts with each regularization strategy. We observe that there is little difference between their mean and maximum dev scores on a larger training set, although using both mixout $( w _ { \mathrm { p r e } } , \ 0 . 7 )$ and wdecay $( { \pmb w } _ { \mathrm { p r e } } , \ 0 . 0 1 )$ outperformed using both dropout $( p )$ and wdecay(0, 0.01) on the small training sets in Section 5.
|
| 191 |
+
|
| 192 |
+
Table 2: Mean (max) SST-2 dev scores across 20 random restarts when finetuning BERTLARGE with each regularization strategy. Bold marks the best of each statistics within each column. For a large training set, both mean and maximum dev scores are similar to each other.
|
| 193 |
+
|
| 194 |
+
<table><tr><td>TECHNIQUE 1</td><td>TECHNIQUE 2</td><td>SST-2</td></tr><tr><td>dropout(0.1)</td><td>wdecay(0, ( 0.01)</td><td>93.4 (94.0)</td></tr><tr><td>mixout(wpre, 0.7)</td><td>wdecay(wpre, 0.01)</td><td>93.5 (94.3)</td></tr></table>
|
| 195 |
+
|
| 196 |
+
# 6.2 EFFECT OF A REGULARIZATION TECHNIQUE FOR AN ADDITIONAL OUTPUT LAYER
|
| 197 |
+
|
| 198 |
+
In this section, we explore the effect of a regularization technique for an additional output layer. There are two regularization techniques available for the additional output layer: dropout $( p )$ and mixout $( \boldsymbol { w } _ { 0 } , \boldsymbol { p } )$ where $\pmb { w } _ { 0 }$ is its randomly initialized parameter. Either of these strategies differs from the earlier experiments in Section 5 where we did not put any regularization for the additional output layer.
|
| 199 |
+
|
| 200 |
+
Table 3: We present mean (max) dev scores across 20 random restarts with various regularization techniques for the additional output layers (ADDITIONAL) when finetuning BERTLARGE on each task. For all cases, we apply mixout $( w _ { \mathrm { p r e } } , \ 0 . 7 )$ to the pretrained layers (PRETRAINED). The first row corresponds to the setup in Section 5. In the second row, we apply mixout $( w _ { 0 } , \ 0 . 7 )$ to the additional output layer where $\pmb { w } _ { 0 }$ is its randomly initialized parameter. The third row shows the results obtained by applying dropout(0.7) to the additional output layer. In the fourth row, we demonstrate the best of each result from all the regularization strategies shown in Table 1. Bold marks the best of each statistics within each column. We obtain additional gains in dev scores by varying the regularization technique for the additional output layer.
|
| 201 |
+
|
| 202 |
+
<table><tr><td>PRETRAINED</td><td>ADDITIONAL</td><td>RTE</td><td>MRPC</td><td>CoLA</td><td>STS-B</td></tr><tr><td>mixout(wpre, 0.7)</td><td>1</td><td>61.6 (74.0)</td><td>87.1 (91.1)</td><td>57.4 (62.1)</td><td>89.6 (90.3)</td></tr><tr><td>mixout( (wpre, 0.7)</td><td>mixout(wo, 0.7)</td><td>66.5 (75.5)</td><td>88.1 (92.4)</td><td>58.7 (65.6)</td><td>89.7 (90.6)</td></tr><tr><td>mixout(wpre, 0.7)</td><td>dropout(0.7)</td><td>57.2 (70.8)</td><td>85.9 (92.5)</td><td>48.9 (64.3)</td><td>89.2 (89.8)</td></tr><tr><td colspan="2">The best of each result from Table 1</td><td>65.3 (75.5)</td><td>89.0 (91.8)</td><td>58.3 (65.6)</td><td>89.7 (90.6)</td></tr></table>
|
| 203 |
+
|
| 204 |
+
We report the average and best dev scores across 20 random restarts when finetuning BERTLARGE with mixout $( w _ { \mathrm { p r e } } , 0 . 7 )$ while varying the regularization technique for the additional output layer in Table 3.6 We observe that using mixout $( w _ { 0 } , 0 . 7 )$ for the additional output layer improves both the average and best dev score on RTE, CoLA, and STS-B. In the case of MRPC, we have the highest best-dev score by using dropout(0.7) for the additional output layer while the highest mean dev score is obtained by using mixout $( w _ { 0 } , 0 . 7 )$ for it. In Section 3.2, we discussed how mixout $( \pmb { w } _ { 0 } )$ does not differ from dropout when the layer is randomly initialized, since we sample ${ \pmb w } _ { 0 }$ from w whose mean and variance are 0 and small, respectively. Although the additional output layer is randomly initialized, we observe the significant difference between dropout and mixout $( \pmb { w } _ { 0 } )$ in this layer. We conjecture that $\lVert \mathbf { \boldsymbol { w } } _ { 0 } - \mathbf { 0 } \rVert$ is not sufficiently small because $\mathbb { E } \lVert \mathbf { w } - \mathbf { 0 } \rVert$ is proportional to the dimensionality of the layer (2,048). We therefore expect mixout $\mathbf { \Pi } ( \pmb { w } _ { 0 } )$ to behave differently from dropout even for the case of training from scratch.
|
| 205 |
+
|
| 206 |
+
In the last row of Table 3, we present the best of the corresponding result from Table 1. We have the highest mean and best dev scores when we respectively use mixout $( { \pmb w } _ { \mathrm { p r e } } , \ 0 . 7 )$ and mixout $( w _ { 0 } , 0 . 7 )$ for the pretrained layers and the additional output layer on RTE, CoLA, and STSB. The highest mean dev score on MRPC is obtained by using mixout $( { \pmb w } _ { \mathrm { p r e } } , \ 0 . 8 )$ for the pretrained layers which is one of the results in Table 1. We have the highest best dev score on MRPC when we use mixout $( w _ { \mathrm { p r e } } , \ 0 . 7 )$ and dropout(0.7) for the pretrained layers and the additional output layer, respectively. The experiments in this section reveal that using mixout $\mathbf { \Pi } ( \pmb { w } _ { 0 } )$ for a randomly initialized layer of a pretrained model is one of the regularization schemes to improve the average dev score and the best dev score.
|
| 207 |
+
|
| 208 |
+
# 6.3 EFFECT OF MIX PROBABILITY FOR MIXOUT AND DROPOUT
|
| 209 |
+
|
| 210 |
+
We explore the effect of the hyperparameter $p$ when finetuning BERTLARGE with mixout $( \boldsymbol { \mathbf { \mathit { w } } } _ { \mathrm { p r e } } , \boldsymbol { \mathbf { \mathit { p } } } )$ and dropout $( p )$ . We train $\mathrm { B E R T _ { L A R G E } }$ with mixout $\mathbf { \Delta } ( w _ { \mathrm { p r e } }$ , $\{ 0 . 0 , 0 . 1 , \ \cdot \cdot \ , \ 0 . 9 \} )$ on RTE with 20 random restarts. We also train $\mathrm { B E R T _ { L A R G E } }$ after replacing mixout $( { \pmb w } _ { \mathrm { p r e } } , \ p )$ by dropout $( p )$ with 20 random restarts. We do not use any regularization technique for the additional output layer. Because we use neither wdecay(0) nor wdecay $( { \pmb w } _ { \mathrm { p r e } } )$ in this section, dropout(0.0) and mixout $( { \pmb w } _ { \mathrm { p r e } } , \ 0 . 0 )$ are equivalent to finetuning without regularization.
|
| 211 |
+
|
| 212 |
+

|
| 213 |
+
Figure 4: Distribution of RTE dev scores (Accuracy) from 20 random restarts when finetuning BERTLARGE with dropout $( p )$ (orange) or mixout $( \pmb { w } _ { \mathrm { p r e } } , \ p )$ (blue). Error intervals show mean $\pm$ std. We do not use wdecay(0) nor wdecay $( { \boldsymbol { w } } _ { \mathrm { p r e } } )$ . In the case of mixout $( \mathbf { \boldsymbol { w } } _ { \mathrm { p r e } } , \mathbf { \boldsymbol { p } } )$ , the number of usable models after finetuning with mixout $\omega _ { \mathrm { p r e } }$ , $\{ 0 . 7 , \ 0 . 8 , \ 0 . 9 \} ,$ is significantly more than the number of usable models after finetuning with dropout $( p )$ for all $p$ .
|
| 214 |
+
|
| 215 |
+
It is not helpful to vary $p$ for dropout $( p )$ while mixout $( \pmb { w } _ { \mathrm { p r e } } , p )$ helps significantly in a wide range of $p$ . Figure 4 shows distributions of RTE dev scores across 20 random restarts when finetuning BERTLARGE with dropout $( p )$ and mixout $( \mathbf { \boldsymbol { w } } _ { \mathrm { p r e } } , \mathbf { \boldsymbol { p } } )$ for $p \in \{ 0 . 0 , 0 . 1 , \ \cdot \cdot \cdot , 0 . 9 \}$ . The mean dev score of finetuning BERTLARGE with mixout $( \boldsymbol { \mathbf { \mathit { w } } } _ { \mathrm { p r e } } , \boldsymbol { \mathbf { \mathit { p } } } )$ increases as $p$ increases. On the other hand, the mean dev score of finetuning $\mathrm { B E R T _ { L A R G E } }$ with dropout $( p )$ decreases as $p$ increases. If $p$ is less than 0.4, finetuning with mixout $( \boldsymbol { \mathbf { \mathit { w } } } _ { \mathrm { p r e } } , \boldsymbol { \mathbf { \mathit { p } } } )$ does not improve the finetuning results of using dropout $\left( \{ 0 . 0 , 0 . 1 , 0 . 2 \} \right)$ . We however observe that mixout( $\mathbf { \Delta } _ { w _ { \mathrm { p r e } } }$ , $\{ 0 . 7 , 0 . 8 , 0 . { \bar { 9 } } \} )$ yields better average dev scores than dropout $( p )$ for all $p$ , and significantly reduces the number of finetuning runs that fail with the chance-level accuracy.
|
| 216 |
+
|
| 217 |
+
We notice that the proposed mixout spends more time than dropout from the experiments in this section. It takes longer to finetune a model with the proposed mixout than with the original dropout, although this increase is not significant especially considering the waste of time from failed finetuning runs using dropout. In Supplement E, we describe more in detail the difference between mixout and dropout in terms of wall-clock time.
|
| 218 |
+
|
| 219 |
+
# 7 CONCLUSION
|
| 220 |
+
|
| 221 |
+
The special case of our approach, mixout $( w _ { \mathrm { p r e } } )$ , is one of several regularization techniques modifying a finetuning procedure to prevent catastrophic forgetting. Unlike wdecay $( w _ { \mathrm { p r e } } )$ proposed earlier by Wiese et al. (2017), mixout $( { \pmb w } _ { \mathrm { p r e } } )$ is an adaptive $L ^ { 2 }$ -regularizer toward ${ \pmb w } _ { \mathrm { p r e } }$ in the sense that its regularization coefficient adapts along the optimization path. Due to this difference, the proposed mixout improves the stability of finetuning a big, pretrained language model even with only a few training examples of a target task. Furthermore, our experiments have revealed the proposed approach improves finetuning results in terms of the average accuracy and the best accuracy over multiple runs. We emphasize that our approach can be used with any pretrained language models such as RoBERTa (Liu et al., 2019) and XLNet (Yang et al., 2019), since mixout does not depend on model architectures, and leave it as future work.
|
| 222 |
+
|
| 223 |
+
# ACKNOWLEDGMENTS
|
| 224 |
+
|
| 225 |
+
The first and third authors’ work was supported by the National Research Foundation of Korea (NRF) grants funded by the Korea government (MOE, MSIT) (NRF-2017R1A2B4011546, NRF2019R1A5A1028324). The second author thanks support by AdeptMind, eBay, TenCent, NVIDIA and CIFAR and was partly supported by Samsung Electronics (Improving Deep Learning using Latent Structure).
|
| 226 |
+
|
| 227 |
+
# REFERENCES
|
| 228 |
+
|
| 229 |
+
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
|
| 230 |
+
|
| 231 |
+
Antonio Valerio Miceli Barone, Barry Haddow, Ulrich Germann, and Rico Sennrich. Regularization techniques for fine-tuning in neural machine translation. arXiv preprint arXiv:1707.09920, 2017.
|
| 232 |
+
|
| 233 |
+
Daniel Cer, Mona Diab, Eneko Agirre, Inigo Lopez-Gazpio, and Lucia Specia. Semeval-2017 task 1: Semantic textual similarity-multilingual and cross-lingual focused evaluation. arXiv preprint arXiv:1708.00055, 2017.
|
| 234 |
+
|
| 235 |
+
Gregory Cohen, Saeed Afshar, Jonathan Tapson, and Andre van Schaik. Emnist: an extension of ´ mnist to handwritten letters. arXiv preprint arXiv:1702.05373, 2017.
|
| 236 |
+
|
| 237 |
+
Ronan Collobert, Jason Weston, Leon Bottou, Michael Karlen, Koray Kavukcuoglu, and Pavel ´ Kuksa. Natural language processing (almost) from scratch. Journal of machine learning research, 12(Aug):2493–2537, 2011.
|
| 238 |
+
|
| 239 |
+
Ido Dagan, Oren Glickman, and Bernardo Magnini. The PASCAL recognising textual entailment challenge. In Machine learning challenges. evaluating predictive uncertainty, visual object classification, and recognising tectual entailment, pp. 177–190. Springer, 2006.
|
| 240 |
+
|
| 241 |
+
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.
|
| 242 |
+
|
| 243 |
+
William B Dolan and Chris Brockett. Automatically constructing a corpus of sentential paraphrases. In Proceedings of the International Workshop on Paraphrasing, 2005.
|
| 244 |
+
|
| 245 |
+
Dan Hendrycks and Kevin Gimpel. Gaussian error linear units (gelus). arXiv preprint arXiv:1606.08415, 2016.
|
| 246 |
+
|
| 247 |
+
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.
|
| 248 |
+
|
| 249 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 250 |
+
|
| 251 |
+
Durk P Kingma, Tim Salimans, and Max Welling. Variational dropout and the local reparameterization trick. In Advances in Neural Information Processing Systems, pp. 2575–2583, 2015.
|
| 252 |
+
|
| 253 |
+
James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, et al. Overcoming catastrophic forgetting in neural networks. Proceedings of the national academy of sciences, 114(13):3521–3526, 2017.
|
| 254 |
+
|
| 255 |
+
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.
|
| 256 |
+
|
| 257 |
+
Poorya Mianjy and Raman Arora. On dropout and nuclear norm regularization. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 4575–4584, Long Beach, California, USA, 09–15 Jun 2019. PMLR. URL http : / / proceedings . mlr . press/v97/mianjy19a.html.
|
| 258 |
+
|
| 259 |
+
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), pp. 807–814, 2010.
|
| 260 |
+
|
| 261 |
+
Jason Phang, Thibault Fevry, and Samuel R Bowman. Sentence encoders on stilts: Supplementary ´ training on intermediate labeled-data tasks. arXiv preprint arXiv:1811.01088, 2018.
|
| 262 |
+
|
| 263 |
+
Jonathan Schwarz, Jelena Luketina, Wojciech M Czarnecki, Agnieszka Grabska-Barwinska, Yee Whye Teh, Razvan Pascanu, and Raia Hadsell. Progress & compress: A scalable framework for continual learning. arXiv preprint arXiv:1805.06370, 2018.
|
| 264 |
+
|
| 265 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 266 |
+
|
| 267 |
+
Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew $\mathrm { N g }$ , and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of EMNLP, pp. 1631–1642, 2013.
|
| 268 |
+
|
| 269 |
+
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.
|
| 270 |
+
|
| 271 |
+
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.
|
| 272 |
+
|
| 273 |
+
Li Wan, Matthew Zeiler, Sixin Zhang, Yann Le Cun, and Rob Fergus. Regularization of neural networks using dropconnect. In International conference on machine learning, pp. 1058–1066, 2013.
|
| 274 |
+
|
| 275 |
+
Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R Bowman. Glue: A multi-task benchmark and analysis platform for natural language understanding. arXiv preprint arXiv:1804.07461, 2018.
|
| 276 |
+
|
| 277 |
+
Sida Wang and Christopher Manning. Fast dropout training. In international conference on machine learning, pp. 118–126, 2013.
|
| 278 |
+
|
| 279 |
+
Alex Warstadt, Amanpreet Singh, and Samuel R. Bowman. Neural network acceptability judgments. arXiv preprint 1805.12471, 2018.
|
| 280 |
+
|
| 281 |
+
Georg Wiese, Dirk Weissenborn, and Mariana Neves. Neural domain adaptation for biomedical question answering. arXiv preprint arXiv:1706.03610, 2017.
|
| 282 |
+
|
| 283 |
+
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.
|
| 284 |
+
|
| 285 |
+
SUPPLEMENTARY MATERIAL
|
| 286 |
+
|
| 287 |
+
A PROOFS FOR THEOREM 1
|
| 288 |
+
|
| 289 |
+
Theorem 1. Assume that the loss function $\mathcal { L }$ is strongly convex. Suppose that a random mixture function with respect to $\textbf { \em w }$ from $\textbf { \em u }$ and $M$ is given by
|
| 290 |
+
|
| 291 |
+
$$
|
| 292 |
+
\Phi ( { \pmb w } ; { \pmb u } , M ) = \mu ^ { - 1 } \big ( ( { \pmb I } - M ) { \pmb u } + M { \pmb w } - ( 1 - \mu ) { \pmb u } \big ) ,
|
| 293 |
+
$$
|
| 294 |
+
|
| 295 |
+
where $M$ is $\mathrm { d i a g } ( M _ { 1 } , ~ M _ { 2 } , ~ \cdot \cdot \cdot , ~ M _ { d } ) $ satisfying $\mathbb { E } M _ { i } = \mu$ and $\mathrm { V a r } ( M _ { i } ) = \sigma ^ { 2 }$ for all $i$ . Then, there exists $m > 0$ such that
|
| 296 |
+
|
| 297 |
+
$$
|
| 298 |
+
\mathbb { E } \mathcal { L } \big ( \Phi ( { \boldsymbol w } ; { \boldsymbol u } , M ) \big ) \ge \mathcal { L } ( { \boldsymbol w } ) + \frac { m \sigma ^ { 2 } } { 2 \mu ^ { 2 } } \| { \boldsymbol w } - { \boldsymbol u } \| ^ { 2 } ,
|
| 299 |
+
$$
|
| 300 |
+
|
| 301 |
+
for all $\textbf { \em w }$
|
| 302 |
+
|
| 303 |
+
Proof. Since $\mathcal { L }$ is strongly convex, there exist $m > 0$ such that
|
| 304 |
+
|
| 305 |
+
$$
|
| 306 |
+
\begin{array} { r l } & { \mathbb { E } \mathcal { L } \big ( \Phi ( w ; u , M ) \big ) = \mathbb { E } \mathcal { L } \Big ( w + \big ( \Phi ( w ; u , M ) - w \big ) \Big ) } \\ & { \qquad \quad \geq \mathcal { L } ( w ) + \nabla \mathcal { L } ( w ) ^ { \top } \mathbb { E } [ \Phi ( w ; u , M ) - w ] + \frac { m } { 2 } \mathbb { E } \| \Phi ( w ; u , M ) - w \| ^ { 2 } , } \end{array}
|
| 307 |
+
$$
|
| 308 |
+
|
| 309 |
+
for all $\pmb { w }$ by equation 1. Recall that $\mathbb { E } M _ { i } = \mu$ and $\mathrm { V a r } ( M _ { i } ) = \sigma ^ { 2 }$ for all $i$ . Then, we have
|
| 310 |
+
|
| 311 |
+
$$
|
| 312 |
+
\mathbb { E } [ \Phi ( { \pmb w } ; { \pmb u } , M ) - { \pmb w } ] = { \bf 0 } ,
|
| 313 |
+
$$
|
| 314 |
+
|
| 315 |
+
and
|
| 316 |
+
|
| 317 |
+
$$
|
| 318 |
+
\begin{array} { l } { \displaystyle \mathbb { E } \| \Phi ( \boldsymbol { w } ; ~ \boldsymbol { u } , \boldsymbol { M } ) - \boldsymbol { w } \| ^ { 2 } = \mathbb { E } \left\| \frac { 1 } { \mu } ( \boldsymbol { w } - \boldsymbol { u } ) ( \boldsymbol { M } - \mu \boldsymbol { I } ) \right\| ^ { 2 } } \\ { \displaystyle \qquad = \frac { 1 } { \mu ^ { 2 } } \sum _ { i = 1 } ^ { d } ( w _ { i } - u _ { i } ) ^ { 2 } \mathbb { E } ( M _ { i } - \mu ) ^ { 2 } } \\ { \displaystyle \qquad = \frac { \sigma ^ { 2 } } { \mu ^ { 2 } } \| \boldsymbol { w } - \boldsymbol { u } \| ^ { 2 } . } \end{array}
|
| 319 |
+
$$
|
| 320 |
+
|
| 321 |
+
By using equation 13 and equation 14, we can rewrite equation 12 as
|
| 322 |
+
|
| 323 |
+
$$
|
| 324 |
+
\mathbb { E } \mathcal { L } \big ( \Phi ( { \boldsymbol w } ; { \boldsymbol u } , M ) \big ) \ge \mathcal { L } ( { \boldsymbol w } ) + \frac { m \sigma ^ { 2 } } { 2 \mu ^ { 2 } } \| { \boldsymbol w } - { \boldsymbol u } \| ^ { 2 } .
|
| 325 |
+
$$
|
| 326 |
+
|
| 327 |
+
# B APPLYING TO SPECIFIC LAYERS
|
| 328 |
+
|
| 329 |
+
We often apply dropout to specific layers. For instance, Simonyan & Zisserman (2014) applied dropout to fully connected layers only. We generalize Theorem 1 to the case in which mixconnect is only applied to specific layers, and it can be done by constructing $M$ in a particular way. To better characterize mixconnect applied to specific layers, we define the index set $\mathbb { I }$ as $\mathbb { I } = \{ i : \ \boldsymbol { M } _ { i } = 1 \}$ . Furthermore, we use $\tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } ^ { v }$ and $\tilde { \mathbf { \pmb { u } } }$ to denote $( w _ { i } ) _ { i \notin \mathbb { I } }$ and $( u _ { i } ) _ { i \notin \mathbb { I } }$ , respectively. Then, we generalize equation 7 to
|
| 330 |
+
|
| 331 |
+
$$
|
| 332 |
+
\mathbb { E } \mathcal { L } \big ( \Phi ( { \boldsymbol w } ; { \boldsymbol u } , M ) \big ) \ge \mathcal { L } ( { \boldsymbol w } ) + \frac { m \sigma ^ { 2 } } { 2 \mu ^ { 2 } } \| \tilde { { \boldsymbol w } } - \tilde { { \boldsymbol u } } \| ^ { 2 } .
|
| 333 |
+
$$
|
| 334 |
+
|
| 335 |
+
From equation 15, applying mixconnec $\scriptstyle ; ( u , \mu , \sigma ^ { 2 } )$ is to use adaptive wdecay $( \tilde { u } )$ on the weight parameter of the specific layers $\tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } ^ { \tilde { \mathbf { \Gamma } } } \tilde { \mathbf { \Gamma } } ^ { \tilde { \mathbf { \Gamma } } } \tilde { \mathbf { \Gamma } } ^ { \tilde { \mathbf { \Gamma } } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde { \mathbf { \Gamma } } \tilde \mathrm { \Gamma }$ . Similarly, we can regard applying mixout $( \boldsymbol { \mathscr { u } } , \boldsymbol { \mathscr { p } } )$ to specific layers as adaptive wdecay $( \tilde { u } )$ .
|
| 336 |
+
|
| 337 |
+
# C EXPERIMENTAL DETAILS
|
| 338 |
+
|
| 339 |
+
# C.1 FROM EMNIST DIGITS TO MNIST
|
| 340 |
+
|
| 341 |
+
Model Architecture The model architecture in Section 4 is a 784-300-100-10 fully connected network with a softmax output layer. For each hidden layer, we add layer normalization (Ba et al., 2016) right after the ReLU (Nair & Hinton, 2010) nonlinearity. We initialize each parameter with $\mathcal { N } ( 0 , 0 . \bar { 0 } 2 ^ { 2 } )$ and each bias with 0.
|
| 342 |
+
|
| 343 |
+
Regularization In the pretraining stage, we use dropout(0.1) and wdecay $\mathbf { ( 0 , \ 0 . 0 1 ) }$ . We apply dropout(0.1) to all hidden layers. That is, we do not drop neurons of the input and output layers. wdecay $\mathbf { ( 0 , \eta 0 . 0 1 ) }$ does not penalize the parameters for bias and layer normalization. When we finetune our model on MNIST, we replace dropout $( p )$ with mixout $( \mathbf { \boldsymbol { w } } _ { \mathrm { p r e } } , \mathbf { \boldsymbol { p } } )$ . We use neither wdecay(0) nor wdecay $( { \pmb w } _ { \mathrm { p r e } } )$ for finetuning.
|
| 344 |
+
|
| 345 |
+
Dataset For pretraining, we train our model on EMNIST Digits. This dataset has 280,000 characters into 10 balanced classes. These characters are compatible with MNIST characters. EMNIST Digits provides 240,000 characters for training and 40,000 characters for test. We use 240,000 characters provide for training and split these into the training set (216,000 characters) and validation set (24,000 characters). For finetuning, we train our model on MNIST. This has 70,000 characters into 10 balance classes. MNIST provide 60,000 characters for training and 10,000 characters for test. We use 60,000 characters given for training and split these into the training set (54,000 characters) and validation set (6,000 characters).
|
| 346 |
+
|
| 347 |
+
Data Preprocessing We only use normalization after scaling pixel values into [0, 1]. We do not use any data augmentation.
|
| 348 |
+
|
| 349 |
+
# C.2 FINETUNING BERT ON PARTIAL GLUE TASKS
|
| 350 |
+
|
| 351 |
+
Model Architecture Because the model architecture of $\mathrm { B E R T _ { L A R G E } }$ is identical to the original (Devlin et al., 2018), we omit its exhaustive description. Briefly, BERTLARGE has 24 layers, 1024 hidden size, and 16 self-attention heads (total 340M parameters). We use the publicly available pretrained model released by Devlin et al. (2018), ported into PyTorch by HuggingFace.7 We initialize each weight parameter and bias for an additional output layer with $\mathcal { N } ( 0 , 0 . 0 2 ^ { 2 } )$ and 0, respectively.
|
| 352 |
+
|
| 353 |
+
Regularization In the finetuning stage, Devlin et al. (2018) used wdecay $\mathbf { ( 0 , \ 0 . 0 1 ) }$ for all parameters except bias and layer normalization. They apply dropout(0.1) to all layers except each hidden layer activated by GELU (Hendrycks & Gimpel, 2016) and layer normalization. We substitute wdecay $( { \boldsymbol { w } } _ { \mathrm { p r e } } )$ and mixout $( { \pmb w } _ { \mathrm { p r e } } )$ for wdecay $\mathbf { ( 0 , \ 0 . 0 1 ) }$ and dropout(0.1), respectively.
|
| 354 |
+
|
| 355 |
+
Dataset We use a subset of GLUE (Wang et al., 2018) tasks. The brief description for each dataset is as the following:
|
| 356 |
+
|
| 357 |
+
• RTE (2,500 training examples): Binary entailment task (Dagan et al., 2006) • MRPC (3,700 training examples): Semantic similarity (Dolan & Brockett, 2005) • CoLA (8,500 training examples): Acceptability classification (Warstadt et al., 2018) STS-B (7,000 training examples): Semantic textual similarity (Cer et al., 2017) • SST-2 (67,000 training examples): Binary sentiment classification (Socher et al., 2013)
|
| 358 |
+
|
| 359 |
+
In this paper, we reported F1 accuracy scores for MRPC, Mattew’s correlation scores for CoLA, Spearman correlation scores for STS-B, and accuracy scores for the other tasks.
|
| 360 |
+
|
| 361 |
+
Data Preprocessing We use the publicly available implementation of BERTLARGE by HuggingFace.8
|
| 362 |
+
|
| 363 |
+
# C.3 TEST RESULTS ON GLUE TASKS
|
| 364 |
+
|
| 365 |
+
We expect that using mixout stabilizes finetuning results of BERTLARGE on a small training set. To show this, we demonstrated distributions of dev scores from 20 random restarts on RTE, MRPC, CoLA, and STS-B in Figure 3. We further obtained the highest average/best dev score on each task in Table 3. To confirm the generalization of the our best model on the dev set, we demonstrate the test results scored by the evaluation server9 in Table 4.
|
| 366 |
+
|
| 367 |
+
Table 4: We present the test score when finetuning BERTLARGE with each regularization strategy on each task. The first row shows the test scores obtained by using both dropout $( p )$ and wdecay $\mathbf { ( 0 , \ 0 . 0 1 ) }$ . These results in the first row are reported by Devlin et al. (2018). They used the learning rate of $\lbrace 2 \times 1 0 ^ { - 5 }$ , $3 \times 1 0 ^ { - 5 }$ , $4 \times 1 0 ^ { - 5 }$ , $5 \times 1 0 ^ { - 5 } \}$ and a batch size of 32 for 3 epochs with multiple random restarts. They selected the best model on each dev set. In the second row, we demonstrate the test scores obtained by using the proposed mixout in Section 6.2: using mixout $( w _ { \mathrm { p r e } } , \ 0 . 7 )$ for the pretrained layers and mixout $( w _ { 0 } , \ 0 . 7 )$ for the additional output layer where $\pmb { w } _ { 0 }$ is its randomly initialized weight parameter. We used the learning rate of $2 \times 1 0 ^ { - 5 }$ and a batch size of 32 for 3 epochs with 20 random restarts. We submitted the best model on each dev set. The third row shows that the test scores obtained by using both dropout $( p )$ and wdecay $\mathbf { ( 0 , \ 0 . 0 1 ) }$ with same experimental setups of the second row. Bold marks the best within each column. The proposed mixout improves the test scores except MRPC compared to the original regularization strategy proposed by Devlin et al. (2018).
|
| 368 |
+
|
| 369 |
+
<table><tr><td>STRATEGY</td><td>RTE</td><td>MRPC</td><td>CoLA</td><td>STS-B</td></tr><tr><td>Devlin et al. (2018)</td><td>70.1</td><td>89.3</td><td>60.5</td><td>86.5</td></tr><tr><td>mixout(wpre, 0.7)& mixout(wo,0.7)</td><td>70.2</td><td>89.1</td><td>62.1</td><td>87.3</td></tr><tr><td>dropout(p) + wdecay(0, 0.01)</td><td>68.2</td><td>88.3</td><td>59.6</td><td>86.0</td></tr></table>
|
| 370 |
+
|
| 371 |
+
For all the tasks except MRPC, the test scores obtained by the proposed mixout10 are better than those reported by Devlin et al. (2018). We explored the behaviour of finetuning $\mathrm { B E R T _ { L A R G E } }$ with mixout by using the learning rate of $2 \times 1 0 ^ { - 5 }$ while Devlin et al. (2018) obtained their results by using the learning rate of $\lbrace 2 \times 1 0 ^ { - 5 }$ , $3 \times 1 0 ^ { - 5 }$ , $4 \times 1 0 ^ { - 5 }$ , $5 \times 1 0 ^ { - 5 } \}$ . We thus present the test scores obtained by the regularization strategy of Devlin et al. (2018) when the learning rate is $2 \times 1 0 ^ { - 5 }$ . The results in this section show that the best model on the dev set generalizes well, and all the experiments based on dev scores in this paper are proper to validate the effectiveness of the proposed mixout. For the remaining GLUE tasks such as SST-2 with a sufficient number of training instances, we observed that using mixout does not differs from using dropout in Section 6.1. We therefore omit the test results on the other tasks in GLUE.
|
| 372 |
+
|
| 373 |
+
# D VERIFICATION OF COROLLARY 1.1 WITH LEAST SQUARES REGRESSION
|
| 374 |
+
|
| 375 |
+
Corollary 1.1 shows that mixout $( \pmb { u } , p )$ regularizes learning to minimize the deviation from the target model parameter $\textbf { \em u }$ , and the strength of regularization increases as $p$ increases when the loss function is strongly convex. In order to validate this, we explore the behavior of least squares regression with mixout $( \pmb { u } , p )$ on a synthetic dataset. For randomly given $w _ { 1 } ^ { * }$ and $w _ { 2 } ^ { * }$ , we generated an observation $y$ satisfying $y = w _ { 1 } ^ { * } x + w _ { 2 } ^ { * } + \epsilon$ where $\epsilon$ is Gaussian noise. We set the model to $\hat { y } = w _ { 1 } x + w _ { 2 }$ . That is, the model parameter $\pmb { w }$ is given by $( w _ { 1 } , w _ { 2 } )$ . We randomly pick $\textbf { \em u }$ as a target model parameter for $\mathtt { m i x o u t } ( { \boldsymbol { u } } , { \boldsymbol { p } } )$ and perform least squares regression with $\tilde { \mathrm { m i x o u t } } ( u , \ \{ 0 . 0 \dot { , } \ 0 . 3 , \ 0 . 6 , \ 0 . 9 \} )$ . As shown in Figure 5, $\pmb { w }$ converges to the target model parameter $\textbf { \em u }$ rather than the true model parameter $\boldsymbol { w ^ { * } } = ( w _ { 1 } ^ { * } , \ w _ { 2 } ^ { * } )$ as the mix probability $p$ increases.
|
| 376 |
+
|
| 377 |
+

|
| 378 |
+
Figure 5: Behavior of mixout $( \pmb { u } , \pmb { p } )$ for a strongly convex loss function. We plot the line obtained by least squares regression with mixout $( { \pmb u } , \ \{ 0 . \bar { 0 } , \ 0 . 3 , \ 0 . 6 , \ 0 . 9 \} )$ (each green line) on a synthetic dataset (blue dots) generated by the true line (each blue dotted line). As $p$ increases, the regression line (each green line) converges to the target line generated by the target model parameter $\textbf { \em u }$ (each orange dotted line) rather than the true line (each blue dotted line).
|
| 379 |
+
|
| 380 |
+
# E TIME USAGE OF MIXOUT COMPARED TO DROPOUT
|
| 381 |
+
|
| 382 |
+
We recorded the training time of the experiment in Section 6.3 to compare the time usage of mixout and that of dropout. It took about 843 seconds to finetune $\mathrm { B E R T _ { L A R G E } }$ with mixout $( { \pmb w } _ { \mathrm { p r e } } )$ . On the other hand, it took about 636 seconds to finetune BERTLARGE with dropout. mixout $( w _ { \mathrm { p r e } } )$ spends $3 2 . 5 \%$ more time than dropout since mixout $( { \boldsymbol { w } } _ { \mathrm { p r e } } )$ needs an additional computation with the pretrained model parameter ${ \pmb w } _ { \mathrm { p r e } }$ . However, as shown in Figure 4, at least 15 finetuning runs among 20 random restarts fail with the chance-level accuracy on RTE with dropout $( p )$ for all $p$ while only 4 finetuning runs out of 20 random restarts are unusable with mixout( $\mathbf { \Delta } _ { w _ { \mathrm { p r e } } }$ , 0.8). From this result, it is reasonable to finetune with the proposed mixout although this requires additional time usage compared to dropout.
|
| 383 |
+
|
| 384 |
+
# F EXTENSIVE HYPERPARAMETER SEARCH FOR DROPOUT
|
| 385 |
+
|
| 386 |
+
Devlin et al. (2018) finetuned BERTLARGE with dropout(0.1) on all GLUE (Wang et al., 2018) tasks. They chose it to improve the maximum dev score on each downstream task, but we have reported not only the maximum dev score but also the mean dev score to quantitatively compare various regularization techniques in our paper. In this section, we explore the effect of the hyperparameter $p$ when finetuning BERTLARGE with dropout $( p )$ on RTE, MRPC, CoLA, and STS-B to show dropout(0.1) is optimal in terms of mean dev score. All experimental setups for these experiments are the same as Section 6.3.
|
| 387 |
+
|
| 388 |
+

|
| 389 |
+
Figure 6: Distribution of dev scores on each task from 20 random restarts when finetuning BERTLARGE with dropout $( \{ 0 . 0 , 0 . 1 , \ \cdot \cdot \ , 0 . 5 \} )$ . Error intervals show mean±std. When we use dropout(0.1), we have the highest average dev scores on MRPC and STS-B and the second-highest average dev scores on RTE and CoLA. These results show that dropout(0.1) is almost optimal for all tasks in terms of mean dev score.
|
| 390 |
+
|
| 391 |
+
As shown in Figure 6, we have the highest average dev score on MRPC with dropout(0.1) as well as on STS-B. We obtain the highest average dev scores with dropout(0.0) on RTE and CoLA, but we get the second-highest average dev scores with dropout(0.1) on them. These experiments confirm that the drop probability 0.1 is almost optimal for the highest average dev score on each task.
|
md/train/HkgrZ0EYwB/HkgrZ0EYwB.md
ADDED
|
@@ -0,0 +1,346 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# UNPAIRED POINT CLOUD COMPLETION ON REALSCANS USING ADVERSARIAL TRAINING
|
| 2 |
+
|
| 3 |
+
Baoquan Chen Peking University
|
| 4 |
+
|
| 5 |
+
Xuelin Chen Shandong University University College London
|
| 6 |
+
|
| 7 |
+
Niloy J. Mitra University College London Adobe Research London
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
As 3D scanning solutions become increasingly popular, several deep learning setups have been developed for the task of scan completion, i.e., plausibly filling in regions that were missed in the raw scans. These methods, however, largely rely on supervision in the form of paired training data, i.e., partial scans with corresponding desired completed scans. While these methods have been successfully demonstrated on synthetic data, the approaches cannot be directly used on real scans in the absence of suitable paired training data. We develop a first approach that works directly on input point clouds, does not require paired training data, and hence can directly be applied to real scans for scan completion. We evaluate the approach qualitatively on several real-world datasets (ScanNet, Matterport3D, KITTI), quantitatively on 3D-EPN shape completion dataset, and demonstrate realistic completions under varying levels of incompleteness.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Robust, efficient, and scalable solutions now exist for easily scanning large environments and workspaces (Dai et al., 2017a; Chang et al., 2017). The resultant scans, however, are often partial and have to be completed (i.e., missing parts have to be hallucinated and filled in) before they can be used in downstream applications, e.g., virtual walk-through, path planning.
|
| 16 |
+
|
| 17 |
+
The most popular data-driven scan completion methods rely on paired supervision data, i.e., for each incomplete training scan, a corresponding complete data (e.g., voxels, point sets, signed distance fields) is required. One way to establish such a shape completion network is then to train a suitably designed encoder-decoder architecture (Dai et al., 2017b; 2018). The required paired training data is obtained by virtually scanning 3D objects (e.g., SunCG Song et al. (2017), ShapeNet Chang et al. (2015) datasets) to simulate occlusion effects. Such approaches, however, are unsuited for real scans where large volumes of paired supervision data remain difficult to collect. Additionally, when data distributions from virtual scans do not match those from real scans, completion networks trained on synthetic-partial and synthetic-complete data do not sufficiently generalize to real (partial) scans. To the best of our knowledge, no point-based unpaired method exists that learns to translate noisy and incomplete point cloud from raw scans to clean and complete point sets.
|
| 18 |
+
|
| 19 |
+
We propose an unpaired point-based scan completion method that can be trained without requiring explicit correspondence between partial point sets (e.g., raw scans) and example complete shape models (e.g., synthetic models). Note that the network does not require explicit examples of real complete scans and hence existing (unpaired) large-scale real 3D scan (e.g., Dai et al. (2017a); Chang et al. (2017)) and virtual 3D object repositories (e.g., Song et al. (2017); Chang et al. (2015)) can directly be leveraged as training data. Figure 1 shows example scan completions. As we show in Table 1, unlike methods requiring paired supervision, our method continues to perform well even if the data distributions of synthetic complete scans and real partial scans differ.
|
| 20 |
+
|
| 21 |
+
We achieve this by designing a generative adversarial network (GAN) wherein a generator, i.e., an adaptation network, transforms the input into a suitable latent representation such that a discriminator cannot differentiate between the transformed latent variables and the latent variables obtained from training data (i.e., complete shape models). Intuitively, the generator is responsible for the key task of mapping raw partial point sets into clean and complete point sets, and the process is regularized by working in two different latent spaces that have separately learned manifolds of scanned and synthetic object data.
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: We present a point-based shape completion network that can be directly used on raw scans without requiring paired training data. Here we show a sampling of results from the ScanNet, Matterport3D, 3D-EPN, and KITTI datasets.
|
| 25 |
+
|
| 26 |
+
We demonstrate our method on several publicly available real-world scan datasets namely (i) ScanNet (Dai et al., 2017a) chairs and tables; (ii) Matterport3D (Chang et al., 2017) chairs and tables; and (iii) KITTI (Geiger et al., 2012) cars. In absence of completion ground truth, we cannot directly compute accuracy for the completed scans, and instead compare using plausibility scores. Further, in order to quantitatively evaluate the performance of the network, we report numbers on a synthetic dataset (Dai et al., 2017b) where completed versions are available. Finally, we compare our method against baseline methods to demonstrate the advantages of the proposed unpaired scan completion framework.
|
| 27 |
+
|
| 28 |
+
# 2 RELATED WORK
|
| 29 |
+
|
| 30 |
+
Shape Completion. Many deep neural networks have been proposed to address the shape completion challenge. Inspired by CNN-based 2D image completion networks, 3D convolutional neural networks applied on voxelized inputs have been widely adopted for 3D shape completion task (Dai et al., 2018; 2017b; Sharma et al., 2016; Han et al., 2017; Thanh Nguyen et al., 2016; Yang et al., 2018; Wang et al., 2017). As quantizing shapes to voxel grids lead to geometric information loss, recent approaches (Yuan et al., 2018; Yu et al., 2018b; Achlioptas et al., 2018) operate directly on point sets to fill in missing parts. These works, however, require supervision in the form of partialcomplete paired data for training deep neural networks to directly regress partial input to their ground truth counterparts. Since paired ground truth of real-world data is rarely available such training data is generated using virtual scanning. While the methods work well on synthetic test data, they do not generalize easily to real scans arising from hard-to-model acquisition processes.
|
| 31 |
+
|
| 32 |
+
Realizing the gap between synthetically-generated data and real-world data, Stutz & Geiger (2018) proposed to directly work on voxelized real-world data. They also work in a latent space created for clean and complete data but measure reconstruction loss using a maximum likelihood estimator. Instead, we propose a GAN setup to learn a mapping between latent spaces respectively arising from partial real and synthetic complete data. Further, by measuring loss using Hausdorff distance on point clouds, we directly work with point sets instead of voxelized input.
|
| 33 |
+
|
| 34 |
+
Generative Adversarial Network. Since its introduction, GAN (Goodfellow et al., 2014) has been used for a variety of generative tasks. In 2D image domain, researchers have utilized adversarial training to recover richer information from low-resolution images or corrupted images (Ledig et al., 2017; Wang et al., 2018; Mao et al., 2017; Park et al., 2018; Bulat et al., 2018; Yeh et al., 2017; Iizuka et al., 2017). In 3D context, Yang et al. (2018); Wang et al. (2017) combine 3D-CNN and generative adversarial training to complete shapes under the supervision of ground truth data. Gurumurthy & Agrawal (2019) treats the point cloud completion task as denoising AE problem, utilizing adversarial training to optimize on the AE latent space. We also leverage the power of GAN for reasoning the missing part of partial point cloud scanning. However, our method is designed to work with unpaired data, and thus can directly be applied to real-world scans even when real-world and synthetic data distributions differ. Intuitively, our GAN-based approach directly learns a translation mapping between these two different distributions.
|
| 35 |
+
|
| 36 |
+
Deep Learning on Point clouds. Our method is built upon recent advances in deep neural networks for point clouds. PointNet Qi et al. (2017a), the pioneering work on this topic, takes an input point set through point-wise MLP layers followed by a symmetric and permutation-invariant function to produce a compact global feature, which can then be used for a diverse set of tasks (e.g., classification, segmentation). Although many improvements to PointNet have been proposed (Su et al., 2018; Li et al., 2018b; Qi et al., 2017b; Li et al., 2018a; Zaheer et al., 2017), the simplicity and effectiveness of PointNet and its extension PointNet++ make them popular for many other analysis tasks (Yu et al., 2018a; Yin et al., 2018; Yu et al., 2018b; Guerrero et al., 2018).
|
| 37 |
+
|
| 38 |
+

|
| 39 |
+
Figure 2: Unpaired Scan Completion Network.
|
| 40 |
+
|
| 41 |
+
In the context of synthesis, Achlioptas et al. (2018) proposed an autoencoder network, using a PointNet-based backbone, to learn compact representations of point clouds. By working in a reduced latent space produced by the autoencoder, they report significant advantages in training GANs, instead of having a generator producing raw point clouds. Inspired by this work, we design a GAN to translate between two different latent spaces to perform unpaired shape completion on real scans.
|
| 42 |
+
|
| 43 |
+
# 3 METHOD
|
| 44 |
+
|
| 45 |
+
Given a noisy and partial point set ${ \cal { S } } = \{ { \bf { s } } _ { i } \}$ as input, our goal is to produce a clean and complete point set $\mathcal { R } = \left\{ \mathbf { r } _ { i } \right\}$ as output. Note that although the two sets have the same number of points, there is no explicit correspondence between the sets $s$ and $\mathcal { R }$ . Further, we assume access to clean and complete point sets for shapes for the object classes. We achieve unpaired completion by learning two class-specific point set manifolds, $\mathbb { X } _ { r }$ for the scanned inputs, and $\mathbb { X } _ { c }$ for clean and complete shapes. Solving the shape completion problem then amounts to learning a mapping $\mathbb { X } _ { r } \ \to \ \mathbb { X } _ { c }$ between the respective latent spaces. We train a generator $G _ { \theta } : \mathbb { X } _ { r } \mathbb { X } _ { c }$ to perform the mapping. Note that we do not require the noise characteristics in the two data distributions, i.e., real and synthetic, to be the same. In absence of paired training data, we score the generated output by setting up a min-max game where the generator is trained to fool a discriminator $F _ { \chi }$ , whose goal is to differentiate between encoded clean and complete shapes, and mapped encodings of the raw and partial inputs. Figure 2 shows the setup of the proposed scan completion network. The latent space encoder-decoders, the mapping generator, and the discriminator are all trained as detailed next.
|
| 46 |
+
|
| 47 |
+
# 3.1 LEARNING LATENT SPACES FOR POINT SETS
|
| 48 |
+
|
| 49 |
+
The latent space of a given set of point sets is obtained by training an autoencoder, which encodes the given input to a low-dimension latent feature and then decodes to reconstruct the original input. We work directly on the point sets via these learned latent spaces instead of quantizing them to voxel grids or signed distance fields.
|
| 50 |
+
|
| 51 |
+
For point sets coming from the clean and complete point sets $\mathcal { P }$ , we learn an encoder network $E _ { \eta } ^ { c }$ that maps $\mathcal { P }$ from the original parameter space $ { \mathbb { R } } ^ { 3 N }$ , defined by concatenating the coordinates of the $N$ (2048 in all our experiments) points, to a lower-dimensional latent space $\mathbb { X } _ { c }$ . A decoder network $D _ { \phi } ^ { c }$ performs the inverse transformation back to $\mathbb { R } ^ { 3 N }$ giving us a reconstructed point set $\tilde { \mathcal P }$ with also $N$ points. The encoder-decoders are trained with reconstruction loss,
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\mathcal { L } ^ { \mathrm { E M D } } ( \eta , \phi ) = \mathbb { E } _ { \mathcal { P } \sim p _ { \mathrm { c o m p l e t e } } } d ( \mathcal { P } , D _ { \phi } ^ { c } ( E _ { \eta } ^ { c } ( \mathcal { P } ) ) ) ,
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
where $\mathcal { P } \sim p _ { \mathrm { c o m p l e t e } }$ denotes point set samples drawn from the set of clean and complete point sets, $d ( X _ { 1 } , X _ { 2 } )$ is the Earth Mover’s Distance (EMD) between point sets $X _ { 1 } , X _ { 2 }$ , and $( \eta , \phi )$ are the learnable parameters of the encoder and decoder networks, respectively. Once trained, the weights of both networks are held fixed and the latent code $z = E _ { \eta } ^ { c } ( X )$ , $z \in \mathbb { X } _ { c }$ for a clean and complete point set $X$ provides a compact representation for subsequent training and implicitly captures the manifold of clean and complete data. The architecture of the encoder and decoder is similar to Achlioptas et al. (2018); Qi et al. (2017a): using a 5-layer MLP to lift individual points to a deeper feature space, followed by a symmetric function to maintain permutation invariance. This results in a $k$ - dimensional latent code that describes the entire point cloud $k { = } 1 2 8$ in all our experiments). More details of the network architecture can be found in the appendix.
|
| 58 |
+
|
| 59 |
+

|
| 60 |
+
Figure 3: Effect of unpaired scan completion without (Equation 5) and with HL term (Equation 6). Without the HL term, the network produces a clean point set for a complete chair, that is different in shape from the input. With the HL term, the network produces a clean point set that matches the input.
|
| 61 |
+
|
| 62 |
+
As for the point set coming from the noisy-partial point sets $s$ , one can also train another encoder $E _ { \gamma } ^ { r } : \mathcal { S } \mathbb { X } _ { r }$ and decoder $D _ { \psi } ^ { r } : \mathbb { X } _ { r } \tilde { \mathcal { S } }$ pair that provides a latent parameterization $\mathbb { X } _ { r }$ for the noisy-partial point sets, with the definition of the reconstruction loss as,
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\begin{array} { r } { \mathcal { L } ^ { \mathrm { E M D } } ( \gamma , \psi ) = \mathbb { E } _ { S \sim p _ { \mathrm { r a w } } } d ( S , D _ { \psi } ^ { r } ( E _ { \gamma } ^ { r } ( S ) ) ) , } \end{array}
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
where ${ \mathcal { S } } \sim p _ { \mathrm { r a w } }$ denotes point set samples drawn from the set of noisy and partial point sets.
|
| 69 |
+
|
| 70 |
+
Although, in experiments, the latent space of this autoencoder trained on noisy-partial point sets works considerably well as the noisy-partial point set manifold, we found that using the latent space produced by feeding noisy-partial point sets to the autoencoder trained on clean and complete point sets yields slightly better results. Hence, unless specified, we set $\gamma = \eta$ and $\psi = \phi$ in our experiments. The comparison of different choices to obtain the latent space for noisy-partial point sets is also presented in Section 4. Next, we will describe the GAN setup to learn a mapping between the latent spaces of raw noisy-partial and synthetic clean-complete point sets, i.e., $\mathbb { X } _ { r } \to \mathbb { X } _ { c }$ .
|
| 71 |
+
|
| 72 |
+
# 3.2 LEARNING A MAPPING BETWEEN LATENT SPACES
|
| 73 |
+
|
| 74 |
+
We set up a min-max game between a generator and a discriminator to perform the mapping between the latent spaces. The generator $G _ { \theta }$ is trained to perform the mapping $\mathbb { X } _ { r } \ \to \ \mathbb { X } _ { c }$ such that the discriminator fails to reliably tell if the latent variable comes from original $\mathbb { X } _ { c }$ or the remapped $\mathbb { X } _ { r }$ .
|
| 75 |
+
|
| 76 |
+
The latent representation of a noisy and partial scan $z _ { r } = E _ { \gamma } ^ { r } ( S )$ is mapped by the generator to $\tilde { z } _ { c } = G _ { \theta } ( z _ { r } )$ . Then, the task of the discriminator $F _ { \chi }$ is to distinguish between latent representations $\tilde { z } _ { c }$ and $z _ { c } = E _ { \eta } ^ { c } ( \mathcal { P } )$ . We train the mapping function using a GAN. Given training examples of clean latent variables $z _ { c }$ and remapped-noisy latent variables $\tilde { z } _ { c }$ , we seek to optimize the following adversarial loss over the mapping generator $G _ { \theta }$ and a discriminator $F _ { \chi }$ ,
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\operatorname* { m i n } _ { \theta } \operatorname* { m a x } _ { \chi } \mathbb { E } _ { \boldsymbol { x } \sim p _ { \mathrm { c l e a n - c o n p l e t } } } \left[ \log \left( F _ { \chi } \big ( E _ { \eta } ^ { c } ( x ) \big ) \right) \right] + \mathbb { E } _ { \boldsymbol { y } \sim p _ { \mathrm { m i s p - r a t i a } } } \left[ \log \left( 1 - F _ { \chi } \big ( G _ { \theta } \big ( E _ { \gamma } ^ { r } ( y ) \big ) \right) \right] .
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
In our experiments, we found the least square GAN Mao et al. (2016) to be easier to train and hence minimize both the discriminator and generator losses defined as,
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\begin{array} { r l } & { \mathcal { L } _ { F } ( \chi ) \ : = \ : \mathbb { E } _ { x \sim p _ { \mathrm { c l e a n - o m p l e t } } } \left[ F _ { \chi } \big ( E _ { \eta } ^ { c } ( x ) \big ) - 1 \right] ^ { 2 } + \mathbb { E } _ { y \sim p _ { \mathrm { n o i s y p a r i a } } } \big [ F _ { \chi } \big ( G _ { \theta } ( E _ { \gamma } ^ { r } ( y ) ) \big ) \big ] ^ { 2 } } \\ & { \mathcal { L } _ { G } ( \theta ) \ : = \mathbb { E } _ { y \sim p _ { \mathrm { n o i s y p a r i a } } } \big [ F _ { \chi } \big ( G _ { \theta } ( E _ { \gamma } ^ { r } ( y ) ) \big ) - 1 \big ] ^ { 2 } . } \end{array}
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
The above setup encourages the generator to perform the mapping $\mathbb { X } _ { r } \to \mathbb { X } _ { c }$ resulting in $D _ { \psi } ^ { c } ( \tilde { z _ { c } } )$ to be a clean and complete point cloud $\mathcal { R }$ . However, the generator is free to map a noisy latent vector to any point on the manifold of valid shapes in $\mathbb { X } _ { c }$ , including shapes that are far from the original partial scan $s$ . As shown in Figure 3, the result is a complete and clean point cloud that can be dissimilar in shape to the partial scanned input. To prevent this, we add a reconstruction loss term $\scriptstyle { \mathcal { L } } _ { \mathrm { r e c o n } }$ to the generator loss:
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\mathcal { L } _ { G } ( \theta ) = \alpha \mathbb { E } _ { y \sim p _ { \mathrm { n o s y \mathrm { s t i a } } } } \big [ F _ { \chi } \big ( G _ { \theta } ( E _ { \gamma } ^ { r } ( y ) ) \big ) - 1 \big ] ^ { 2 } + \beta \mathcal { L } _ { \mathrm { r e c o n } } ^ { \mathrm { H L } } ( \mathcal { S } , D _ { \psi } ^ { c } ( G _ { \theta } ( E _ { \gamma } ^ { r } ( \mathcal { S } ) ) ) ) ,
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
where $\mathcal { L } _ { \mathrm { r e c o n } } ^ { \mathrm { H L } }$ denotes the Hausdorff distance loss 1 (HL) from the partial input point set to the completion point set, which encourages the predicted completion point set to match the input only partially. Note that, it is crucial to use $\mathrm { H L }$ as $\scriptstyle { \mathcal { L } } _ { \mathrm { r e c o n } }$ , since the partial input can only provide partial supervision when no ground truth complete point set is available. In contrast, using EMD as $\scriptstyle { \mathcal { L } } _ { \mathrm { r e c o n } }$ forces the network to reconstruct the overall partial input leading to worse completion results. The comparison of these design choices is presented in Section 4. Unless specified, we set the trade-off parameters as $\alpha = 0 . 2 5$ and $\beta = 0 . 7 5$ in all our experiments.
|
| 95 |
+
|
| 96 |
+
# 4 EXPERIMENTAL EVALUATION
|
| 97 |
+
|
| 98 |
+
We present quantitative and qualitative experimental results on several noisy and partial datasets. First, we present results on real-world datasets, demonstrating the effectiveness of our method on unpaired raw scans. Second, we thoroughly compare our method to various baseline methods on 3D-EPN dataset, which contains simulated partial scans and corresponding ground truth for full evaluation. Finally, we derive a synthetic noisy-partial scan dataset based on ShapeNet, on which we can evaluate the performance degradation of applying supervised methods to test data of different distribution and the performance of our method under varying levels of incompleteness. A set of ablation studies is also included to evaluate our design choices.
|
| 99 |
+
|
| 100 |
+
Datasets. (A) Real-world dataset comes from three sources. First, a dataset of ${ \sim } 5 5 0 $ chairs and ${ \sim } 5 5 0 $ tables extracted from the ScanNet dataset split into $90 \%$ - $10 \%$ train-test sets. Second, a dataset of 20 chairs and 20 tables extracted from the Matterport3D dataset. Note that we train our method only on the ScanNet training split, and use the trained model to test on the Matterport3D data to evaluate generalization to new data sources. Third, a dataset containing cars from the KITTI Velodyne point clouds. (B) 3D-EPN dataset provides simulated partial scans with corresponding ground truth. Scans are represented as Signed Distance Field (SDF). We only use the provided point cloud representations of the training data, instead of using the SDF data which holds richer information. $( C )$ Clean and complete point set dataset contains virtually scanned point sets of ShapeNet models covering 8 categories, namely boat, car, chair, dresser, lamp, plane, sofa, and table. We use this dataset for learning the clean-complete point set manifold in all our experiments. $( D )$ Synthetic dataset provides different incomplete scan distribution and at different levels of incompleteness. Ground truth complete scan counterparts are available for evaluation.
|
| 101 |
+
|
| 102 |
+
Evaluation measures. We assess completion quality using the following measures. (A) Accuracy measures the fraction of points in $P _ { c o m p }$ that are matched by $P _ { g t }$ , where and $P _ { c o m p }$ denote the completion point set and $P _ { g t }$ denote the ground truth point set. Specifically, for each point $v \in P _ { c o m p }$ , we compute $D ( v , P _ { g t } { \ ' } ) { ' } = m i n \{ \| \ \bar { v } - q \ \| , q \in \operatorname { \bar { P } } _ { g t } \}$ . If $\bar { D } ( v , P _ { g t } )$ is within distance threshold $\epsilon = 0 . 0 3$ , we count it as a correct match. The fraction of matched points is reported as the accuracy in percentage. $( B )$ Completeness reports the fraction of points in $P _ { g t }$ that are within distance threshold $\epsilon$ of any point in $P _ { c o m p }$ . $( C ) F I$ score is defined as the harmonic average of the accuracy and the completeness, where F1 reaches its best value at 1 (perfect accuracy and completeness) and worst at 0. $( D )$ Plausibility of the completion is evaluated as the classification accuracy in percentage produced by PointNet++, a SOA point-based classification network. To avoid bias on ShapeNet point clouds, we trained the classification network on the ModelNet40 dataset. We mainly used plausibility score for real-world data completions, where no ground truth data is available for calculating accuracy, completeness, or F1 scores.
|
| 103 |
+
|
| 104 |
+
In the following, we show all experimental and evaluation results. We trained separate networks for each category. More details are in the appendix.
|
| 105 |
+
|
| 106 |
+
# 4.1 EXPERIMENTAL RESULTS ON REAL-WORLD DATA
|
| 107 |
+
|
| 108 |
+
Our method works directly on real-world data where no paired data is available. We train and test our network on noisy-partial chairs and tables extracted from the ScanNet dataset. We further test the network trained on ScanNet dataset on chairs and tables extracted from the Matterport3D dataset, to show how well our network can generalize to definitely unseen data. We present qualitative results of our method in Fig 4. Our method consistently produces plausible completions for the ScanNet and Matterport3D data.
|
| 109 |
+
|
| 110 |
+

|
| 111 |
+
Figure 4: Qualitative comparisons on real-world data, which includes partial scans of ScanNet chairs and tables, Matterport3D chairs and tables, and KITTI cars. We show the partial input in grey and the corresponding completion in gold on the right.
|
| 112 |
+
|
| 113 |
+
In the absence of ground truth completions on real data, we compare our method quantitatively against others based on the plausibility of the results. The left sub-table of Table 1 shows that our method is superior to those supervised methods, namely 3D-EPN and PCN. Directly applying PCN trained on simulated partial data to real-world data leads to completions that have low plausibility, while our method consistently produces results with high plausibility. 3D-EPN trained on simulated partial data failed to complete the real-world partial scans. In Section 4.2 and Section 4.3, we present more in-depth comparisons on 3D-EPN and our synthetic dataset, where the ground truth is available for computing accuracy, completeness, and F1 of the completions.
|
| 114 |
+
|
| 115 |
+
Table 1: Completion plausibility on synthetic scans and real-world scans and effects of data distribution discrepancy. (Left) Plausibility comparison on synthetic scans and real-world scans. Synthetic scans includes test data from 3D-EPN, real-world scans includes ScanNet and Matterport3D test data. 3D-EPN failed to produce good completions on real-world data. (Right) On our synthetic data, supervised methods trained on other simulated partial scans produce worse results on partial scans with different data distribution.
|
| 116 |
+
|
| 117 |
+
<table><tr><td></td><td></td><td>Raw input</td><td>3D-EPN</td><td>PCN</td><td>Ours</td></tr><tr><td rowspan="2">Synthetic</td><td>chair</td><td>73.1</td><td>77.3</td><td>85.0</td><td>91.5</td></tr><tr><td>table</td><td>52.5</td><td>71.2</td><td>72.0</td><td>80.6</td></tr><tr><td rowspan="2">Real-world</td><td>chair</td><td>71.4</td><td>7.1</td><td>78.6</td><td>94.3</td></tr><tr><td>table</td><td>47.8</td><td>4.4</td><td>69.6</td><td>81.2</td></tr></table>
|
| 118 |
+
|
| 119 |
+
<table><tr><td></td><td colspan="3">3D-EPN</td><td colspan="3">PCN</td><td colspan="3">Ours</td></tr><tr><td>model</td><td>acc.</td><td>comp.</td><td>F1</td><td>acc.</td><td>comp.</td><td>F1</td><td>acc.</td><td>comp.</td><td>F1</td></tr><tr><td>chair</td><td>39.6</td><td>61.8</td><td>48.2</td><td>49.3</td><td>76.0</td><td>59.8</td><td>80.7</td><td>80.8</td><td>80.8</td></tr><tr><td>car</td><td>43.8</td><td>62.3</td><td>51.4</td><td>63.2</td><td>81.4</td><td>71.2</td><td>82.6</td><td>80.7</td><td>81.7</td></tr><tr><td>table</td><td>36.6</td><td>61.0</td><td>45.8</td><td>62.3</td><td>80.6</td><td>70.3</td><td>83.1</td><td>84.5</td><td>83.8</td></tr><tr><td>plane</td><td>17.1</td><td>57.6</td><td>26.3</td><td>67.1</td><td>85.4</td><td>75.1</td><td>94.4</td><td>92.7</td><td>93.6</td></tr></table>
|
| 120 |
+
|
| 121 |
+
Completing the car observations from KITTI is extremely challenging, as each car instance only receives few data points from the Lidar scanner. Fig 4 shows the qualitative results of our method on completing sparse point sets of KITTI cars, we can see that our network can still generate highly plausible cars with such sparse inputs.
|
| 122 |
+
|
| 123 |
+
We also use a point-based object part segmentation network (Qi et al., 2017b) to indirectly evaluate our completions of real-world data. Due to the absence of ground truth segmentation, we calculate the approximate segmentation accuracy for each completion. Specifically, for the completion of a chair, we count the predicted segmentation label of each point to be correct as long as the predicted label falls into the set of 4 parts (i.e., seat, back, leg, and armrest) of chair class. Our completion results have much higher approximate segmentation accuracy compared to the real-world raw input (chair: $7 7 . 2 \%$ vs. $2 4 . 8 \%$ ; table: $9 6 . 4 \%$ vs. $8 3 . 5 \%$ ; and car: $9 8 . 0 \%$ vs. $5 . 2 \%$ , as segmentation accuracy on our completions versus on original partial input), indicating high completion quality.
|
| 124 |
+
|
| 125 |
+
# 4.2 COMPARISON WITH BASELINES ON 3D-EPN DATA
|
| 126 |
+
|
| 127 |
+
We compare our method to several baseline methods and present both quantitative and qualitative comparisons on the 3D-EPN test set:
|
| 128 |
+
|
| 129 |
+
• Autoencoder (AE), which is trained only with clean and complete point sets. • 3D-EPN (Dai et al., 2017b), a supervised method that requires SDF input and is trained with paired data. We convert its Distance Field representation results into surface meshes, from which we can uniformly sample $N$ points for calculating our point-based measures.
|
| 130 |
+
|
| 131 |
+
Table 2: Comparison with baselines on the 3D-EPN dataset. Note that 3D-EPN and PCN require paired supervision data, while ours does not. Ours outperforms 3D-EPN and achieves comparable results to PCN. Furthermore, after adapted to leverage the ground truth data as well, our method achieves similar performance to PCN.
|
| 132 |
+
|
| 133 |
+
<table><tr><td>一</td><td></td><td>AE</td><td></td><td></td><td>EPN (fully supervised)</td><td></td><td>PCN (fully supervised)</td><td></td><td></td><td></td><td>Ours (unsupervised)</td><td></td><td></td><td>Ours+ (supervised)</td><td></td></tr><tr><td>model</td><td>acc.</td><td>comp.</td><td>F1</td><td>acc.</td><td>comp.</td><td>F1</td><td>acc.</td><td>comp.</td><td>F1</td><td>acc.</td><td>comp.</td><td>F1</td><td>acc.</td><td>comp.</td><td>F1</td></tr><tr><td>boat</td><td>89.6</td><td>81.4</td><td>85.3</td><td>82.4</td><td>81.4</td><td>81.9</td><td>92.6</td><td>93.4</td><td>93.0</td><td>86.6</td><td>84.7</td><td>85.6</td><td>89.8</td><td>92.0</td><td>90.9</td></tr><tr><td>car</td><td>81.3</td><td>71.1</td><td>75.9</td><td>69.8</td><td>81.7</td><td>75.3</td><td>97.3</td><td>96.1</td><td>96.7</td><td>88.9</td><td>87.6</td><td>88.2</td><td>93.5</td><td>92.8</td><td>93.1</td></tr><tr><td>chair</td><td>79.9</td><td>68.5</td><td>73.8</td><td>61.7</td><td>76.9</td><td>68.5</td><td>91.1</td><td>90.6</td><td>90.9</td><td>78.7</td><td>77.4</td><td>78.0</td><td>82.3</td><td>83.3</td><td>82.8</td></tr><tr><td>dresser</td><td>68.9</td><td>64.2</td><td>66.5</td><td>58.4</td><td>72.7</td><td>64.8</td><td>93.5</td><td>91.5</td><td>92.5</td><td>75.8</td><td>76.5</td><td>76.2</td><td>87.4</td><td>91.5</td><td>89.4</td></tr><tr><td>lamp</td><td>75.9</td><td>79.6</td><td>77.7</td><td>60.8</td><td>67.8</td><td>64.1</td><td>82.9</td><td>88.3</td><td>85.5</td><td>71.3</td><td>80.2</td><td>75.5</td><td>76.6</td><td>86.3</td><td>81.2</td></tr><tr><td>plane</td><td>97.6</td><td>95.1</td><td>96.3</td><td>78.1</td><td>93.5</td><td>85.1</td><td>98.3</td><td>98.2</td><td>98.2</td><td>97.2</td><td>95.9</td><td>96.5</td><td>95.6</td><td>94.8</td><td>95.2</td></tr><tr><td>sofa</td><td>80.3</td><td>64.0</td><td>71.2</td><td>65.0</td><td>72.6</td><td>68.6</td><td>91.5</td><td>90.8</td><td>91.1</td><td>68.2</td><td>72.3</td><td>70.2</td><td>81.0</td><td>87.0</td><td>83.9</td></tr><tr><td>table</td><td>82.8</td><td>72.5</td><td>77.3</td><td>56.8</td><td>75.1</td><td>64.7</td><td>93.4</td><td>89.2</td><td>91.2</td><td>82.2</td><td>77.8</td><td>80.0</td><td>81.2</td><td>81.4</td><td>81.3</td></tr></table>
|
| 134 |
+
|
| 135 |
+
• PCN (Yuan et al., 2018), which completes partial inputs in a hierarchical manner, receiving supervision from both sparse and dense ground truth point clouds.
|
| 136 |
+
|
| 137 |
+
• ${ \mathrm { O u r s } } +$ , which is an adaption of our method for training with paired data, to show that our method can be easily adapted to work with ground truth data, improving the completion. Specifically, we set $\alpha = 0$ and use EMD loss as $L _ { r e c o n }$ . More details and discussion about adapting our method to train with paired data can be found in the appendix.
|
| 138 |
+
|
| 139 |
+
Table 2 shows quantitative results on 3D-EPN test split and summarizes the comparisons: although our network is only trained with unpaired data, our method outperforms 3D-EPN method and achieves comparable results to PCN. Note that both 3D-EPN and PCN require paired data. Furthermore, after adapting our method to be supervised by the ground truth, the performance of our method $( \mathrm { O u r s } { + } )$ improves, achieving similar performance to PCN. Note that a simple autoencoder network trained with only clean-complete data can produce quantitatively good results, especially when the input is rather complete. Thus, we also evaluate the performance of AE on our synthetic data with incompleteness control in Section 4.3, to show that AE performance declines dramatically as the incompleteness of the input increases. Additional comparisons are included in the appendix.
|
| 140 |
+
|
| 141 |
+
# 4.3 EFFECT OF DATA DISTRIBUTION DISCREPANCY AND VARYING INCOMPLETENESS
|
| 142 |
+
|
| 143 |
+
Supervised methods assume that simulated partial scans share the same data distribution as the test data. We conduct quantitative experiments to show that applying 3D-EPN and PCN to our synthetic data, which is of different data distribution to its training data and in which the ground truth complete scans are not available for training, lead to performance degradation. The right sub-table of Table 1 shows that our method continues to produce good completions on our synthetic data, as we do not require paired data for training. The visual comparison is presented in the appendix.
|
| 144 |
+
|
| 145 |
+
To evaluate our method under different levels of input incompleteness, we conduct experiments on our synthetic data, in which we can control the fraction of missing points. Specifically, we train our network with varying levels of incompleteness by randomizing the amount of missing points during training, and afterwards fix the amount of missing points for testing. Table 3 shows the performance of our method on different classes under increasing amount of incompleteness and the comparison to AE. We can see that AE performance declines dramatically as the incompleteness of the input increases, while our method can still produce completions with high plausibility and F1 score.
|
| 146 |
+
|
| 147 |
+
Table 3: Effect of varying incompleteness. Performance of AE and ours with increasing incompleteness $\%$ of the missing points). Our completions remain robust even with increasing incompleteness as our method restricts the completion via the learned latent shape manifolds.
|
| 148 |
+
|
| 149 |
+
<table><tr><td></td><td></td><td colspan="2">Plausibility</td><td colspan="2"></td><td colspan="2"></td><td colspan="2">Plausibility</td><td colspan="2">F1</td><td colspan="2">Plausibility</td><td colspan="2">F1</td><td colspan="2"></td><td colspan="2">Plausibility</td><td colspan="2">F1</td></tr><tr><td>incomp.</td><td>model</td><td>AE</td><td>Ours</td><td>AE</td><td>Ours</td><td>model</td><td></td><td>AE</td><td>Ours</td><td>AE Ours</td><td>model</td><td></td><td>AE</td><td>Ours</td><td>AE</td><td>Ours</td><td>model</td><td>AE</td><td>Ours AE</td><td>Ours</td></tr><tr><td>10</td><td></td><td>96.3</td><td>99.4</td><td>94.9</td><td>85.8</td><td></td><td>88.0</td><td>91.0</td><td>88.4</td><td>87.7</td><td></td><td>69.3</td><td>74.0</td><td>90.0</td><td>90.2</td><td></td><td>88.9</td><td>91.0</td><td>96.6</td><td>96.5</td></tr><tr><td>20</td><td></td><td>96.7</td><td>99.7</td><td>89.5</td><td>84.5</td><td></td><td>81.0</td><td>91.0</td><td>87.2</td><td>85.1</td><td></td><td>65.0</td><td>75.5</td><td>85.0</td><td>87.3</td><td></td><td>89.7</td><td>90.7</td><td>94.0</td><td>95.5</td></tr><tr><td>30</td><td></td><td>95.0</td><td>98.2</td><td>81.8</td><td>83.3</td><td></td><td>67.0</td><td>90.9</td><td>70.8</td><td>80.7</td><td>table</td><td>55.2</td><td>73.4</td><td>77.3</td><td>84.0</td><td></td><td>88.7</td><td>90.7</td><td>89.5</td><td>94.1</td></tr><tr><td>40</td><td>car</td><td>85.4</td><td>96.1</td><td>71.8</td><td>79.7</td><td>chair</td><td>44.0</td><td>89.4</td><td>52.5</td><td>76.9</td><td></td><td>45.1</td><td>71.8</td><td>69.6</td><td>80.1</td><td>plane</td><td>85.0</td><td>89.0</td><td>84.9</td><td>92.8</td></tr><tr><td>50</td><td></td><td>58.6</td><td>96.4</td><td>63.4</td><td>72.5</td><td></td><td>38.0</td><td>83.5</td><td>33.5</td><td>71.8</td><td></td><td>32.5</td><td>73.3</td><td>62.1</td><td>74.5</td><td></td><td>80.0</td><td>90.7</td><td>80.6</td><td>91.0</td></tr></table>
|
| 150 |
+
|
| 151 |
+
# 4.4 DIVERSITY OF THE COMPLETION RESULTS
|
| 152 |
+
|
| 153 |
+
Our network is encouraged to partially match the input, alleviating the mode-collapse issue, which often occurs in GAN. Unlike traditional generative model problem, where high diversity in generated results is always better, the diversity in our completion results should match that of the ground truth. Although this can be qualitatively accessed, see Fig. 5 in Appendix, in order to quantitatively quantify the divergence, we compute the Jensen-Shannon Divergence (JSD) between the marginal distribution of ground truth point sets and that of our completions as proposed in Achlioptas et al. (2018). As a reference, we simulate extremely mode-collapsed point cloud sets by repeating a randomly selected point cloud, then report the JSD between ground truth point sets and the simulated extremely mode-collapsed point sets. The JSD scores – lower is better – highlight the diversity of our 3D-EPN completions and the divergence between our diversity and that of the ground truth using the extreme mode-collapse results as reference (the former is ours): 0.06 vs. 0.46 on cars, $0 . 0 5 ~ \nu s$ . 0.61 on chairs, 0.04 vs. 0.53 on planes and 0.04 vs. 0.59 on tables.
|
| 154 |
+
|
| 155 |
+
# 4.5 ABLATION STUDY
|
| 156 |
+
|
| 157 |
+
• Ours with partial AE, uses encoder $E _ { \gamma } ^ { r }$ and decoder $D _ { \psi } ^ { r }$ that are trained to reconstruct partial point sets for the latent space of partial input.
|
| 158 |
+
• Ours with EMD loss, uses EMD as the reconstruction loss.
|
| 159 |
+
• Ours without GAN, “switch off” the GAN module by simply setting $\alpha = 0$ and $\beta = 1$ , to verify the effectiveness of using adversarial training in our network.
|
| 160 |
+
• Ours with reconstruction loss, removes the reconstruction loss term by simply setting $\alpha = 1$ and $\beta = 0$ , to verify the effectiveness of the reconstruction loss term in generator loss.
|
| 161 |
+
|
| 162 |
+
Table 4 presents quantitative results for the ablation experiments, where we demonstrate the importance of various design choices and modules in our proposed network. We can see that our method has the best performance over all other variations.
|
| 163 |
+
|
| 164 |
+
Table 4: Ablation study showing the importance of various design choices in our proposed network.
|
| 165 |
+
|
| 166 |
+
<table><tr><td></td><td colspan="3">Ours w/ partial AE</td><td colspan="3">Ours w/EMD</td><td colspan="3">Ours w/o GAN</td><td colspan="3">Ours w/o Recon.</td><td colspan="3">Ours</td></tr><tr><td></td><td>acc.</td><td>comp.</td><td>F1</td><td>acc.</td><td>comp.</td><td>F1</td><td>acc.</td><td>comp.</td><td>F1</td><td>acc.</td><td>comp.</td><td>F1</td><td>acc.</td><td>comp.</td><td>F1</td></tr><tr><td>boat</td><td>75.1</td><td>75.4</td><td>75.2</td><td>82.0</td><td>84.8</td><td>83.4</td><td>47.4</td><td>93.1</td><td>62.8</td><td>44.4</td><td>38.1</td><td>41.0</td><td>86.6</td><td>84.7</td><td>85.6</td></tr><tr><td>car</td><td>88.9</td><td>87.6</td><td>88.2</td><td>76.0</td><td>76.8</td><td>76.4</td><td>46.2</td><td>88.3</td><td>60.7</td><td>72.2</td><td>72.7</td><td>72.5</td><td>88.9</td><td>87.7</td><td>88.3</td></tr><tr><td>chair</td><td>64.1</td><td>66.7</td><td>65.4</td><td>78.6</td><td>76.4</td><td>77.5</td><td>41.3</td><td>79.8</td><td>54.4</td><td>75.6</td><td>75.1</td><td>75.3</td><td>78.7</td><td>77.4</td><td>78.0</td></tr><tr><td>dresser</td><td>67.4</td><td>68.6</td><td>68.0</td><td>71.4</td><td>72.3</td><td>71.9</td><td>44.2</td><td>74.4</td><td>55.4</td><td>20.9</td><td>21.9</td><td>21.4</td><td>75.8</td><td>76.5</td><td>76.2</td></tr><tr><td>lamp</td><td>64.0</td><td>74.8</td><td>69.0</td><td>69.9</td><td>79.0</td><td>74.2</td><td>28.6</td><td>84.7</td><td>42.8</td><td>15.6</td><td>22.2</td><td>18.3</td><td>71.3</td><td>80.2</td><td>75.5</td></tr><tr><td>plane</td><td>94.3</td><td>94.9</td><td>94.6</td><td>96.8</td><td>95.4</td><td>96.1</td><td>41.2</td><td>98.3</td><td>58.1</td><td>87.1</td><td>84.7</td><td>85.9</td><td>97.2</td><td>95.9</td><td>96.5</td></tr><tr><td>sofa</td><td>64.8</td><td>67.3</td><td>66.0</td><td>68.6</td><td>69.8</td><td>69.2</td><td>38.6</td><td>75.6</td><td>51.1</td><td>55.1</td><td>58.0</td><td>56.5</td><td>68.2</td><td>72.3</td><td>70.2</td></tr><tr><td>table</td><td>76.0</td><td>77.6</td><td>76.8</td><td>81.5</td><td>75.1</td><td>78.2</td><td>23.0</td><td>59.3</td><td>33.1</td><td>27.4</td><td>23.4</td><td>25.2</td><td>82.2</td><td>77.8</td><td>80.0</td></tr></table>
|
| 167 |
+
|
| 168 |
+
# 5 CONCLUSION
|
| 169 |
+
|
| 170 |
+
We presented a point-based unpaired shape completion framework that can be applied directly on raw partial scans to obtain clean and complete point clouds. At the core of the algorithm is an adaptation network acting as a generator that transforms latent code encodings of the raw point scans, and maps them to latent code encodings of clean and complete object scans. The two latent spaces regularize the problem by restricting the transfer problem to respective data manifolds. We extensively evaluated our method on real scans and virtual scans, demonstrating that our approach consistently leads to plausible completions and perform superior to other methods. The work opens up the possibility of generalizing our approach to scene-level scan completions, rather than object-specific completions. Our method shares the same limitations as many of the supervised counterparts: does not produce fine-scale details and assumes input to be canonically oriented. Another interesting future direction will be to combine point- and image-features to apply the completion setup to both geometry and texture details.
|
| 171 |
+
|
| 172 |
+
# 6 ACKNOWLEDGEMENTS
|
| 173 |
+
|
| 174 |
+
We thank all the anonymous reviewers for their insightful comments and feedback. This work is supported in part by grants from National Key R&D Program of China (2019YFF0302900), China Scholarship Council, National Natural Science Foundation of China (No.61602273), ERC Starting Grant, ERC PoC Grant, Google Faculty Award, Royal Society Advanced Newton Fellowship, and gifts from Adobe.
|
| 175 |
+
|
| 176 |
+
# REFERENCES
|
| 177 |
+
|
| 178 |
+
Panos Achlioptas, Olga Diamanti, Ioannis Mitliagkas, and Leonidas Guibas. Learning representations and generative models for 3d point clouds. In International Conference on Machine Learning (ICML), pp. 40–49, 2018.
|
| 179 |
+
|
| 180 |
+
Adrian Bulat, Jing Yang, and Georgios Tzimiropoulos. To learn image super-resolution, use a gan to learn how to do image degradation first. In European Conference on Computer Vision (ECCV), pp. 185–200, 2018.
|
| 181 |
+
|
| 182 |
+
Angel Chang, Angela Dai, Thomas Funkhouser, Maciej Halber, Matthias Niessner, Manolis Savva, Shuran Song, Andy Zeng, and Yinda Zhang. Matterport3d: Learning from rgb-d data in indoor environments. arXiv preprint arXiv:1709.06158, 2017.
|
| 183 |
+
|
| 184 |
+
Angel X. Chang, Thomas Funkhouser, Leonidas Guibas, Pat Hanrahan, Qixing Huang, Zimo Li, Silvio Savarese, Manolis Savva, Shuran Song, Hao Su, Jianxiong Xiao, Li Yi, and Fisher Yu. ShapeNet: An Information-Rich 3D Model Repository. Technical Report arXiv:1512.03012 [cs.GR], Stanford University — Princeton University — Toyota Technological Institute at Chicago, 2015.
|
| 185 |
+
|
| 186 |
+
Brian Curless and Marc Levoy. A volumetric method for building complex models from range images. 1996.
|
| 187 |
+
|
| 188 |
+
Angela Dai, Angel X. Chang, Manolis Savva, Maciej Halber, Thomas Funkhouser, and Matthias Nießner. Scannet: Richly-annotated 3d reconstructions of indoor scenes. In Conference on Computer Vision and Pattern Recognition (CVPR), 2017a.
|
| 189 |
+
|
| 190 |
+
Angela Dai, Charles Ruizhongtai Qi, and Matthias Nießner. Shape completion using 3d-encoderpredictor cnns and shape synthesis. In International Conference on Computer Vision (ICCV), pp. 5868–5877, 2017b.
|
| 191 |
+
|
| 192 |
+
Angela Dai, Daniel Ritchie, Martin Bokeloh, Scott Reed, Jurgen Sturm, and Matthias Nießner. Scan- ¨ complete: Large-scale scene completion and semantic segmentation for 3d scans. In Conference on Computer Vision and Pattern Recognition (CVPR), 2018.
|
| 193 |
+
|
| 194 |
+
Andreas Geiger, Philip Lenz, and Raquel Urtasun. Are we ready for autonomous driving? the kitti vision benchmark suite. In Conference on Computer Vision and Pattern Recognition (CVPR), 2012.
|
| 195 |
+
|
| 196 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Z. Ghahramani, M. Welling, C. Cortes, N. D. Lawrence, and K. Q. Weinberger (eds.), Advances in Neural Information Processing Systems, pp. 2672–2680, 2014.
|
| 197 |
+
|
| 198 |
+
Paul Guerrero, Yanir Kleiman, Maks Ovsjanikov, and Niloy J Mitra. Pcpnet learning local shape properties from raw point clouds. In Computer Graphics Forum, volume 37, pp. 75–85, 2018.
|
| 199 |
+
|
| 200 |
+
Swaminathan Gurumurthy and Shubham Agrawal. High fidelity semantic shape completion for point clouds using latent optimization. In 2019 IEEE Winter Conference on Applications of Computer Vision (WACV), pp. 1099–1108. IEEE, 2019.
|
| 201 |
+
|
| 202 |
+
Xiaoguang Han, Zhen Li, Haibin Huang, Evangelos Kalogerakis, and Yizhou Yu. High-resolution shape completion using deep neural networks for global structure and local geometry inference. In International Conference on Computer Vision (ICCV), pp. 85–93, 2017.
|
| 203 |
+
|
| 204 |
+
Satoshi Iizuka, Edgar Simo-Serra, and Hiroshi Ishikawa. Globally and locally consistent image completion. ACM Transactions on Graphics (TOG), 36(4):107, 2017.
|
| 205 |
+
|
| 206 |
+
Christian Ledig, Lucas Theis, Ferenc Huszar, Jose Caballero, Andrew Cunningham, Alejandro´ Acosta, Andrew Aitken, Alykhan Tejani, Johannes Totz, Zehan Wang, et al. Photo-realistic single image super-resolution using a generative adversarial network. In Conference on Computer Vision and Pattern Recognition (CVPR), pp. 4681–4690, 2017.
|
| 207 |
+
|
| 208 |
+
Jiaxin Li, Ben M Chen, and Gim Hee Lee. So-net: Self-organizing network for point cloud analysis. In Conference on Computer Vision and Pattern Recognition (CVPR), pp. 9397–9406, 2018a.
|
| 209 |
+
|
| 210 |
+
Yangyan Li, Rui Bu, Mingchao Sun, Wei Wu, Xinhan Di, and Baoquan Chen. Pointcnn: Convolution on x-transformed points. In Advances in Neural Information Processing Systems, 2018b.
|
| 211 |
+
|
| 212 |
+
Xudong Mao, Qing Li, Haoran Xie, Raymond Y. K. Lau, and Zhen Wang. Multi-class generative adversarial networks with the L2 loss function. CoRR, abs/1611.04076, 2016.
|
| 213 |
+
|
| 214 |
+
Xudong Mao, Qing Li, Haoran Xie, Raymond YK Lau, Zhen Wang, and Stephen Paul Smolley. Least squares generative adversarial networks. In International Conference on Computer Vision (ICCV), pp. 2794–2802, 2017.
|
| 215 |
+
|
| 216 |
+
Seong-Jin Park, Hyeongseok Son, Sunghyun Cho, Ki-Sang Hong, and Seungyong Lee. Srfeat: Single image super-resolution with feature discrimination. In European Conference on Computer Vision (ECCV), pp. 439–455, 2018.
|
| 217 |
+
|
| 218 |
+
Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. In Conference on Computer Vision and Pattern Recognition (CVPR), pp. 652–660, 2017a.
|
| 219 |
+
|
| 220 |
+
Charles R Qi, Wei Liu, Chenxia Wu, Hao Su, and Leonidas J Guibas. Frustum pointnets for 3d object detection from rgb-d data. In Conference on Computer Vision and Pattern Recognition (CVPR), pp. 918–927, 2018.
|
| 221 |
+
|
| 222 |
+
Charles Ruizhongtai Qi, Li Yi, Hao Su, and Leonidas J Guibas. Pointne $^ { + + }$ : Deep hierarchical feature learning on point sets in a metric space. In Advances in Neural Information Processing Systems, pp. 5099–5108, 2017b.
|
| 223 |
+
|
| 224 |
+
Abhishek Sharma, Oliver Grau, and Mario Fritz. Vconv-dae: Deep volumetric shape learning without object labels. In European Conference on Computer Vision (ECCV), pp. 236–250, 2016.
|
| 225 |
+
|
| 226 |
+
Shuran Song, Fisher Yu, Andy Zeng, Angel X Chang, Manolis Savva, and Thomas Funkhouser. Semantic scene completion from a single depth image. Conference on Computer Vision and Pattern Recognition (CVPR), 2017.
|
| 227 |
+
|
| 228 |
+
David Stutz and Andreas Geiger. Learning 3d shape completion from laser scan data with weak supervision. In Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1955–1964, 2018.
|
| 229 |
+
|
| 230 |
+
Hang Su, Varun Jampani, Deqing Sun, Subhransu Maji, Evangelos Kalogerakis, Ming-Hsuan Yang, and Jan Kautz. Splatnet: Sparse lattice networks for point cloud processing. In Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2530–2539, 2018.
|
| 231 |
+
|
| 232 |
+
Duc Thanh Nguyen, Binh-Son Hua, Khoi Tran, Quang-Hieu Pham, and Sai-Kit Yeung. A field model for repairing 3d shapes. In Conference on Computer Vision and Pattern Recognition (CVPR), pp. 5676–5684, 2016.
|
| 233 |
+
|
| 234 |
+
Weiyue Wang, Qiangui Huang, Suya You, Chao Yang, and Ulrich Neumann. Shape inpainting using 3d generative adversarial network and recurrent convolutional networks. In International Conference on Computer Vision (ICCV), pp. 2298–2306, 2017.
|
| 235 |
+
|
| 236 |
+
Xintao Wang, Ke Yu, Shixiang Wu, Jinjin Gu, Yihao Liu, Chao Dong, Yu Qiao, and Chen Change Loy. Esrgan: Enhanced super-resolution generative adversarial networks. In European Conference on Computer Vision (ECCV), pp. 63–79. Springer, 2018.
|
| 237 |
+
|
| 238 |
+
Bo Yang, Stefano Rosa, Andrew Markham, Niki Trigoni, and Hongkai Wen. 3d object dense reconstruction from a single depth view. arXiv preprint arXiv:1802.00411, 1(2):6, 2018.
|
| 239 |
+
|
| 240 |
+
Raymond A Yeh, Chen Chen, Teck Yian Lim, Alexander G Schwing, Mark Hasegawa-Johnson, and Minh N Do. Semantic image inpainting with deep generative models. In Conference on Computer Vision and Pattern Recognition (CVPR), pp. 5485–5493, 2017.
|
| 241 |
+
|
| 242 |
+
Kangxue Yin, Hui Huang, Daniel Cohen-Or, and Hao Zhang. P2p-net: bidirectional point displacement net for shape transform. ACM Transactions on Graphics (TOG), 37(4):152, 2018.
|
| 243 |
+
|
| 244 |
+
Lequan Yu, Xianzhi Li, Chi-Wing Fu, Daniel Cohen-Or, and Pheng-Ann Heng. Ec-net: an edgeaware point set consolidation network. In European Conference on Computer Vision (ECCV), pp. 386–402, 2018a.
|
| 245 |
+
|
| 246 |
+
Lequan Yu, Xianzhi Li, Chi-Wing Fu, Daniel Cohen-Or, and Pheng-Ann Heng. Pu-net: Point cloud upsampling network. In Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2790–2799, 2018b.
|
| 247 |
+
|
| 248 |
+
Wentao Yuan, Tejas Khot, David Held, Christoph Mertz, and Martial Hebert. Pcn: Point completion network. In 2018 International Conference on 3D Vision (3DV), pp. 728–737, 2018.
|
| 249 |
+
|
| 250 |
+
Manzil Zaheer, Satwik Kottur, Siamak Ravanbakhsh, Barnabas Poczos, Ruslan R Salakhutdinov, and Alexander J Smola. Deep sets. In Advances in Neural Information Processing Systems, 2017.
|
| 251 |
+
|
| 252 |
+
# A DETAILS OF DATASETS
|
| 253 |
+
|
| 254 |
+
Clean and Complete Point Sets are obtained by virtually scanning the models from ShapeNet. We use a subset of 8 categories, namely boat, car, chair, dresser, lamp, plane, sofa and table, in our experiments. To generate clean and complete point set of a model, we virtually scan the models by performing ray-intersection test from cameras placed around the model to obtain the dense point set, followed by a down-sampling procedure to obtain a relatively sparser point set of $N$ points. Note that we use the models without any pose and scale augmentation.
|
| 255 |
+
|
| 256 |
+
This dataset is used for training to learn the clean-complete point set manifold in all our experiments.
|
| 257 |
+
The following datasets of different data distributions serve as different noisy-partial input data.
|
| 258 |
+
|
| 259 |
+
Real-world Data comes from three sources. The first one is derived from ScanNet dataset which provides many mesh objects that have been pre-segmented from its surrounding environment. For the purpose of training and testing our network, we extract ${ \sim } 5 5 0 $ chair objects and ${ \sim } 5 5 0 $ table objects from ScanNet dataset, and manually align them to be consistently orientated with models in ShapeNet dataset. We also split these objects into $90 \% / 1 0 \%$ train/test sets.
|
| 260 |
+
|
| 261 |
+
The second one consists of 20 chairs and 20 tables from the Matterport3D dataset, to which the same extraction and alignment as is done in ScanNet dataset is also applied. Note that we train our method only on ScanNet training split, and use the trained model to test on Matterport3D data, to show how our method can generalize to absolutely unseen data. For both ScanNet and Matterport3D datasets, we uniformly sample $N$ points on the surface mesh of each object to obtain the input point sets.
|
| 262 |
+
|
| 263 |
+
Last, we extract car observations from the KITTI dataset using the provided ground truth bounding boxes for training and testing our method. We use KITTI Velodyne point clouds from the 3D object detection benchmark and the split of Qi et al. (2018). We filter the observations such that each car observation contains at least 100 points to avoid overly sparse observations.
|
| 264 |
+
|
| 265 |
+
3D-EPN Dataset provides partial reconstructions of ShapeNet objects (8 categories) by using volumetric fusion method Curless & Levoy (1996) to integrate depth maps scanned along a virtual scanning trajectory around the model. For each model, a set of trajectories is generated with different levels of incompleteness, reflect the real-world scanning with a hand-held commodity RGB-D sensor. The entire dataset covers 8 categories and a total of 25590 object instances (the test set is composed of 5384 models). Note that, in the original 3D-EPN dataset, the data is represented in Signed Distance Field (SDF) for training data and Distance Field (DF) for test data. As our method works on pure point sets, we only use the point cloud representations of the training data provided by the authors, instead of using the SDF data which holds richer information and is claimed in Dai et al. (2017b) to be crucial for completing partial data.
|
| 266 |
+
|
| 267 |
+
Synthetic Data serves the purpose of having another dataset of different incomplete scan distribution and controlling the incompleteness of the input. We use ShapeNet to generate a synthetic dataset, in which we can control the incompleteness of the synthetic partial point sets. For the models in each one of the 4 categories (car, chair, plane, and table), we split them into $90 \% / 1 0 \%$ train/test sets. For each model, from which a clean and complete point set has been scanned (as described earlier in this subsection), we can randomly pick a point and remove its $N \times r$ $( r \in [ 0 , 1 )$ ) nearest neighbor points. The parameter $r$ controls the incompleteness of the synthetically-generated input. Furthermore, we add Gaussian noise ${ \mathcal { N } } ( \mu , \sigma ^ { 2 } )$ to each point ( $\scriptstyle \mu = 0$ and $\sigma { = } 0 . 0 1$ for all our experiments). Last, we duplicate the points in the resulting point sets to generate point sets with an equal number of $N$ points.
|
| 268 |
+
|
| 269 |
+
# B NETWORK ARCHITECTURE DETAILS
|
| 270 |
+
|
| 271 |
+
In this section, we describe the details of the encoder, decoder, generator and discriminator in our network implementation.
|
| 272 |
+
|
| 273 |
+
# B.1 AE ARCHITECTURE DETAILS
|
| 274 |
+
|
| 275 |
+
Encoder consists of 5 1-D convolutional layers which are implemented as 1-D convolutions with ReLU and batch normalization, with kernel size of 1 and stride of 1, to lift the feature of each point to high dimensional feature space independently. In all experiments, we use an encoder with 64,
|
| 276 |
+
|
| 277 |
+
128, 128, 256 and $k = 1 2 8$ filters in each of its layers, with $k$ being the latent code size. The output of the last convolutional layer is passed to a feature-wise maximum to produce a $k$ -dimensional latent code.
|
| 278 |
+
|
| 279 |
+
Decoder transforms the latent vector using 3 fully connected layers with 256, 256, and $N \textbf { x } 3$ neurons each, the first two having ReLUs, to reconstruct $N \times 3$ output.
|
| 280 |
+
|
| 281 |
+
# B.2 GAN ARCHITECTURE DETAILS
|
| 282 |
+
|
| 283 |
+
Since the generator and discriminator of GAN directly operate on the latent space, the architecture for them is significantly simpler. Specifically, the generator is comprised of two fully connected layers with 128 and 128 neurons each, to map the latent code of noisy and incomplete point sets to that of clean and complete point sets. The discriminator consists of 3 fully connected layers with 256, 512 and 1 neurons each, to produce a single scalar for each latent code.
|
| 284 |
+
|
| 285 |
+
# C TRAINING DETAILS
|
| 286 |
+
|
| 287 |
+
To make the training of the entire network trackable, we pre-train the AEs used for obtaining the latent spaces. After that we retain the weights of AEs, only the weights of the generator and discriminator are updated through the back-propagation during the GAN training. The following training hyper-parameters are used in all our experiments.
|
| 288 |
+
|
| 289 |
+
For training the AE, we use Adam optimizer with an initial learning rate of 0.0005, $\beta _ { 1 } = 0 . 9$ and a batch size of 200 and train for a maximum of 2000 epochs.
|
| 290 |
+
|
| 291 |
+
For training the generator and discriminator on the latent spaces, we use Adam optimizer with an initial learning rate of 0.0001, $\beta _ { 1 } ~ = ~ 0 . 5$ and a batch size of 24 and train the generator and discriminator alternately for a maximum of 1000 epochs.
|
| 292 |
+
|
| 293 |
+
# D QUALITATIVE RESULTS ON 3D-EPN DATASET
|
| 294 |
+
|
| 295 |
+
We present qualitatively comparisons in Fig 5, where we show the partial input, AE, 3D-EPN, PCN, Ours, Our $^ +$ result and the ground truth point set. We can see that, although our method is not quantitatively the best, our results are very qualitatively plausible, as the generator is restricted to generate point sets from learned clean and complete shape manifolds.
|
| 296 |
+
|
| 297 |
+
# E VISUAL COMPARISON ON TEST DATA WITH DISTRIBUTION DIFFERENT TO TRAINING DATA
|
| 298 |
+
|
| 299 |
+
We present the visual comparison of 3D-EPN, PCN and our method on our synthetic data, which differs from 3D-EPN and PCN training data. In this experiment, the ground truth of our synthetic data is only available for evaluation. In Fig 6, we can see that our method keeps producing high-quality completions, as our method does not require paired data for training hence can still be trained when no ground truth is available. 3D-EPN and PCN produce much worse results as the data distribution of its training data and our synthetic data differ.
|
| 300 |
+
|
| 301 |
+
# F VARIATIONS OF LEVERAGING GROUND TRUTH SUPERVISION
|
| 302 |
+
|
| 303 |
+
To adapt our network for training with ground truth point sets, we first change the reconstruction loss term in the generator loss from HD (Hausdorff Distance) to EMD (Earth Mover’s Distance), as the ground truth point set is complete and thus contains full information for supervising the completion. Note that HD is superior when the ground truth is unavailable for training, as shown in Table 4 of Section 4. Moreover, we present the comparison of different decisions on whether to adopt the adversarial training in our network for training with the ground truth.
|
| 304 |
+
|
| 305 |
+

|
| 306 |
+
Figure 5: Qualitative comparison on 3D-EPN dataset.
|
| 307 |
+
|
| 308 |
+

|
| 309 |
+
Figure 6: Effect of data distribution discrepancy and qualitative comparison on our synthetic dataset.
|
| 310 |
+
|
| 311 |
+
• Ours $\mathrm { G T + E M D } $ ), which is also denoted as ${ \mathrm { O u r s } } +$ in the paper, removes the adversarial training in the network by simply setting $\alpha = 0$ and not updating the discriminator weights, hence there is only EMD reconstruction loss for the generator.
|
| 312 |
+
|
| 313 |
+
• Ours ( $\mathbf { G } \mathbf { T } { \mathrm { + E } } \mathbf { M } \mathbf { D } { \mathrm { + G } } \mathbf { A } \mathbf { N } )$ , in contrast, retains the adversarial training.
|
| 314 |
+
|
| 315 |
+
Table 5 shows the quantitative comparison results, we can see that, when the ground truth point sets are available, Ours $\mathbf { \bar { G } T + E M D } ,$ produces better results than Ours $\mathrm { ( G T + E M D + G A N ) }$ . Our explanation for why adopting adversarial training here leads to worse results is that: when the ground truth is available, which is complete and contains all information for supervising the network, adding adversarial training will make the network much harder to train, as the network always gets punished by failing to fool the discriminator when it is actually transforming current output closer to the ground truth.
|
| 316 |
+
|
| 317 |
+
Table 5: Removal of adversarial training when training with ground truth leads to significant improvement.
|
| 318 |
+
|
| 319 |
+
<table><tr><td></td><td colspan="3">Ours (GT+EMD)</td><td colspan="3">Ours (GT+EMD+GAN)</td></tr><tr><td>model</td><td>acc.</td><td>comp.</td><td>F1</td><td>acc.</td><td>comp.</td><td>F1</td></tr><tr><td>car</td><td>93.5</td><td>92.8</td><td>93.1</td><td>80.5</td><td>77.9</td><td>79.2</td></tr><tr><td>chair</td><td>82.3</td><td>83.3</td><td>82.8</td><td>51.5</td><td>58.1</td><td>54.6</td></tr><tr><td> plane</td><td>95.6</td><td>94.8</td><td>95.2</td><td>91.4</td><td>86.3</td><td>88.8</td></tr><tr><td>table</td><td>81.2</td><td>81.4</td><td>81.3</td><td>37.9</td><td>39.3</td><td>38.6</td></tr></table>
|
| 320 |
+
|
| 321 |
+
# G MORE STATISTICS FRO THE BASELINE COMPARISON
|
| 322 |
+
|
| 323 |
+
For the baseline methods comparison on 3D-EPN dataset, we also report the Chamfer distance (CD), Earth Mover’s Distance (EMD) and Hausdorff Distance (HD, maximum of the two directional distances) between the ground truth and the completion in Table 6:
|
| 324 |
+
|
| 325 |
+
Table 6
|
| 326 |
+
|
| 327 |
+
<table><tr><td></td><td></td><td>AE</td><td></td><td></td><td>EPN</td><td></td><td></td><td>PCN</td><td></td><td></td><td></td><td>Ours</td><td></td><td>Ours+</td><td></td><td></td></tr><tr><td>model</td><td>CD</td><td>EMD</td><td>HD</td><td>CD</td><td>EMD</td><td>HD</td><td>CD</td><td></td><td>EMD</td><td>HD</td><td>CD</td><td>EMD</td><td>HD</td><td>CD</td><td>EMD</td><td>HD</td></tr><tr><td>boat</td><td>0.0012</td><td>0.0530</td><td>0.0864</td><td>0.0009</td><td>0.0500</td><td>0.0562</td><td>0.0006</td><td></td><td>0.0437</td><td>0.0635</td><td>0.0011</td><td>0.0532</td><td>0.0857</td><td>0.0008</td><td>0.0455</td><td>0.0799</td></tr><tr><td>car</td><td>0.0019</td><td>0.0668</td><td>0.1093</td><td>0.0024</td><td>0.0744</td><td>0.0989</td><td>0.0005</td><td></td><td>0.0418</td><td>0.0648</td><td>0.0010</td><td>0.0434</td><td>0.0763</td><td>0.0007</td><td>0.0393</td><td>0.0677</td></tr><tr><td>chair</td><td>0.0031</td><td>0.1003</td><td>0.1374</td><td>0.0016</td><td>0.0704</td><td>0.0877</td><td>0.0009</td><td>0.0586</td><td></td><td>0.0832</td><td>0.0020</td><td>0.0773</td><td>0.1010</td><td>0.0015</td><td>0.0619</td><td>0.0915</td></tr><tr><td>dresser</td><td>0.0037</td><td>0.0985</td><td>0.1295</td><td>0.0027</td><td>0.0783</td><td>0.0963</td><td>0.0008</td><td>0.0545</td><td></td><td>0.0771</td><td>0.0019</td><td>0.0588</td><td>0.0833</td><td>0.0011</td><td>0.0482</td><td>0.0734</td></tr><tr><td>lamp</td><td>0.0026</td><td>0.0857</td><td>0.1092</td><td>0.0038</td><td>0.0966</td><td>0.1154</td><td>0.0013</td><td>0.0692</td><td></td><td>0.0890</td><td>0.0023</td><td>0.0848</td><td>0.1073</td><td>0.0018</td><td>0.0729</td><td>0.1002</td></tr><tr><td>plane</td><td>0.0004</td><td>0.0346</td><td>0.0591</td><td>0.0060</td><td>0.0943</td><td>0.1255</td><td>0.0002</td><td>0.0308</td><td></td><td>0.0394</td><td>0.0004</td><td>0.0338</td><td>0.0545</td><td>0.0005</td><td>0.0405</td><td>0.0685</td></tr><tr><td>sofa</td><td>0.0030</td><td>0.0792</td><td>0.1232</td><td>0.0045</td><td>0.0880</td><td>0.1093</td><td>0.0008</td><td>0.0494</td><td></td><td>0.0651</td><td>0.0026</td><td>0.0655</td><td>0.0928</td><td>0.0012</td><td>0.0536</td><td>0.0958</td></tr><tr><td>table</td><td>0.0044</td><td>0.0886</td><td>0.1518</td><td>0.0014</td><td>0.0681</td><td>0.0975</td><td>0.0010</td><td>0.0603</td><td>0.0968</td><td></td><td>0.0026</td><td>0.068445</td><td>0.1071</td><td>0.0021</td><td>0.0681</td><td>0.1224</td></tr></table>
|
| 328 |
+
|
| 329 |
+
# H USER STUDY ON REAL-WORLD DATA COMPLETION
|
| 330 |
+
|
| 331 |
+
We also conducted a user study on the completion results of the real-world scans, where given a partial input users are required to pick the most preferable completion among EPN, PCN and our results. In total, we received 1,000 valid user selections and report the preference (in percentage of the total selections) of each method in the user study. From Fig. 7 we can see that in over half $( 5 2 \% )$ of the selections, our completion results are selected as the best completion, while PCN completion results are better in $45 \%$ of the selections.
|
| 332 |
+
|
| 333 |
+
Interestingly, although our method outperforms other methods in the user study, our method clearly does not hold a dominant position in this user study. After a more in-depth analysis of the user selections, we found that users intend to pick the completion in which the partial input is embedded, which can be formulated as the Hausdorff distance from the partial input to the completion, and the supervised method PCN preserves the input point cloud in its completion output as this always minimizes the distance loss. The plausibility of the completion result is usually neglected by users, while the plausibility and the Hausdorff distance from the partial input to the completion are both considered as two trade-off terms in the objective function of our completion generator. Fig. 8 gives a typical example, where the PCN completion without clear chair structure is often picked as better completion while our completion tries to trade-off between the HL and the plausibility.
|
| 334 |
+
|
| 335 |
+

|
| 336 |
+
Figure 7
|
| 337 |
+
|
| 338 |
+

|
| 339 |
+
Figure 8
|
| 340 |
+
|
| 341 |
+
# I GENERALIZATION TO UNSEEN CLASSES
|
| 342 |
+
|
| 343 |
+

|
| 344 |
+
Figure 9
|
| 345 |
+
|
| 346 |
+
Our method does generalize to unseen objects from the same category in the test set, which is demonstrated in the experimental results section. However, our method intuitively should not generalize to classes that are not seen during the training, as the autoencoder, which is a fundamental component in our network, does not generalize to unseen classes. We present the qualitative results of applying our table completion network on chair and airplane class. We can see that from Fig. 9, on the unseen chair class, which shares similar structure with table, our table completion network can produce some reasonable structures, but is unable to complete with a seat back as the autoencoder does not have such capability; on the unseen airplane class, which is rather dissimilar to table class, our table completion network failed to complete the partial airplanes.
|
md/train/HkuGJ3kCb/HkuGJ3kCb.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/I3HOxaZIJ0J/I3HOxaZIJ0J.md
ADDED
|
@@ -0,0 +1,487 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Unit Ball Model for Embedding Hierarchical Structures in the Complex Hyperbolic Space
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
Learning the representation of data with hierarchical structures in the hyperbolic space attracts increasing attention in recent years. Due to the constant negative curvature, the hyperbolic space resembles tree metrics and captures the tree-like properties naturally, which enables the hyperbolic embeddings to improve over traditional Euclidean models. However, many real-world hierarchically structured data such as taxonomies and multitree networks have varying local structures and they are not trees, thus they do not ubiquitously match the constant curvature property of the hyperbolic space. To address this limitation of hyperbolic embeddings, we explore the complex hyperbolic space, which has the variable negative curvature, for representation learning. Specifically, we propose to learn the embeddings of hierarchically structured data in the unit ball model of the complex hyperbolic space. The unit ball model based embeddings have a more powerful representation capacity to capture a variety of hierarchical structures. Through experiments on synthetic and real-world data, we show that our approach improves over the hyperbolic embedding models significantly.
|
| 11 |
+
|
| 12 |
+
# 16 1 Introduction
|
| 13 |
+
|
| 14 |
+
17 Representation learning of data with hierarchical structures is an important machine learning task with
|
| 15 |
+
18 many applications, such as taxonomy induction (Fu et al., 2014) and hypernymy detection (Shwartz
|
| 16 |
+
19 et al., 2016). In recent years, the hyperbolic embeddings (Nickel and Kiela, 2017, 2018) have been
|
| 17 |
+
20 proposed to improve the traditional Euclidean embedding models (Nickel et al., 2011; Bordes et al.,
|
| 18 |
+
21 2013). The constant negative curvature of the hyperbolic space produces several manifestations,
|
| 19 |
+
22 where the most desirable property for representation learning is that the hyperbolic space can be
|
| 20 |
+
23 regarded as a continuous approximation to trees (Krioukov et al., 2010). The hyperbolic space is
|
| 21 |
+
24 capable of embedding any finite tree while preserving the distances approximately (Gromov, 1987).
|
| 22 |
+
25 As a result of the tree-like properties, the hyperbolic space is more suitable to embed hierarchically
|
| 23 |
+
26 structured data than Euclidean space.
|
| 24 |
+
27 However, the real-world hierarchically structured data are usually not trees since they can have
|
| 25 |
+
28 varying local structures while being tree-like globally. For example, although the taxonomies such as
|
| 26 |
+
29 WordNet (Miller, 1995) and YAGO (Suchanek et al., 2007) have underlying hierarchical structures,
|
| 27 |
+
30 they contain many $1 { - } n$ (1 child links to multiple parents) cases and multitree structures (Griggs et al.,
|
| 28 |
+
31 2012), which are much more complicated than trees. Thus, the general hierarchically structured data
|
| 29 |
+
32 cannot ubiquitously match the constant negative curvature property of the hyperbolic space.
|
| 30 |
+
33 To address the challenge, in this paper, we present a new approach to learning the embeddings of
|
| 31 |
+
34 hierarchically structured data. Specifically, we embed the data with hierarchical structures into the
|
| 32 |
+
35 unit ball model of the complex hyperbolic space. The unit ball model is a projective geometry based
|
| 33 |
+
36 model to identify the complex hyperbolic space. One of the main differences between the complex
|
| 34 |
+
37 and the real hyperbolic space is that the curvature is no longer constant in the complex hyperbolic
|
| 35 |
+
38 space. Instead, it has the variable negative curvature. In practice, the variable negative curvature
|
| 36 |
+
39 makes the unit ball model based embeddings more flexible in handling varying structures while the
|
| 37 |
+
40 tree-like properties retain the superiority in hierarchies.
|
| 38 |
+
41 For empirical evaluation, we first compare our approach with the hyperbolic embedding methods on
|
| 39 |
+
42 tree structures to show that the complex hyperbolic space maintains the tree-like properties. Then we
|
| 40 |
+
43 evaluate our approach and the baselines on various hierarchically structured data, including synthetic
|
| 41 |
+
44 graphs and real-world taxonomies. The experimental results demonstrate the advantages of our
|
| 42 |
+
45 approach. To summarize, our work has the following main contributions:
|
| 43 |
+
|
| 44 |
+
1. We present a novel embedding approach, which takes advantage of the variable negative curvature of the complex hyperbolic space, to handle data with complicated and various hierarchical structures. To the best of our knowledge, our work is the first to propose complex hyperbolic embeddings.
|
| 45 |
+
2. We introduce the embedding algorithm in the unit ball model of the complex hyperbolic space. We formulate the learning and Riemannian optimization in the unit ball model.
|
| 46 |
+
3. We evaluate our approach with experiments on an extensive range of synthetic and real-world data and show the remarkable improvements of our approach.
|
| 47 |
+
|
| 48 |
+
# 54 2 Related work
|
| 49 |
+
|
| 50 |
+
55 Hyperbolic embeddings. Hyperbolic embedding methods have become the leading approach for
|
| 51 |
+
56 representation learning of hierarchical structures. (Nickel and Kiela, 2017) learned the representations
|
| 52 |
+
57 of hierarchical graphs in the Poncaré ball model of the hyperbolic space and obtained high-quality
|
| 53 |
+
58 embeddings for taxonomies. (Ganea et al., 2018a) introduced the hyperbolic entailment cones
|
| 54 |
+
59 to formally define the partial ordering relation. (Nickel and Kiela, 2018) proposed to learn the
|
| 55 |
+
60 embeddings in the hyperboloid model (also known as the Lorentz model) of the hyperbolic space to
|
| 56 |
+
61 avoid the numerical instabilities of the Poncaré ball model. These methods learned the hyperbolic
|
| 57 |
+
62 embeddings by Riemannian optimization (Bonnabel, 2013), which was further improved by the
|
| 58 |
+
63 Riemannian adaptive optimization (Bécigneul and Ganea, 2019). Additionally, (Yu and Sa, 2019)
|
| 59 |
+
64 used an integer-based tiling to solve the numerical instabilities in the hyperbolic embeddings.
|
| 60 |
+
65 Another branch of study (Sala et al., 2018; Sonthalia and Gilbert, 2020) learned the hyperbolic
|
| 61 |
+
66 embeddings through combinatorial construction. Instead of optimizing the soft-ranking loss by
|
| 62 |
+
67 Riemannian SGD to preserve the hierarchical relationships as in (Nickel and Kiela, 2017, 2018),
|
| 63 |
+
68 the construction-based methods minimize the reconstruction distortion and focus on the graph
|
| 64 |
+
69 reconstruction task. Remarkably, TreeRep (Sonthalia and Gilbert, 2020) can exactly recover the
|
| 65 |
+
70 original tree structure when the given graph is a tree. However, both the optimization-based and
|
| 66 |
+
71 construction-based hyperbolic embeddings suffer from the limitation in hierarchical graphs with
|
| 67 |
+
72 varying local structures. To tackle the challenge, (Gu et al., 2019) extended the construction-based
|
| 68 |
+
73 method by jointly learning the curvature and the embeddings of data in a product manifold. Although
|
| 69 |
+
74 it can provide a better representation than a single space with constant curvature, it is impractical to
|
| 70 |
+
75 search for the best manifold combination among enormous combinations for each new structure.
|
| 71 |
+
76 Note that our complex hyperbolic embedding model is different from the hyperbolic embedding
|
| 72 |
+
77 methods (Nickel and Kiela, 2017, 2018) or the product manifold embeddings (Gu et al., 2019) since
|
| 73 |
+
78 the geometrical spaces are typically of different characteristics. The $n$ -dimensional $\mathit { \Pi } _ { n }$ -d) complex
|
| 74 |
+
79 hyperbolic space is not simply the $2 n$ -d hyperbolic space or the product of two $n$ -d hyperbolic spaces.
|
| 75 |
+
80 Section 3 will show that their geometries differ markedly.
|
| 76 |
+
81 Motivated by the promising results of previous works, extensions to the multi-relational graph
|
| 77 |
+
82 hyperbolic embeddings (Balazevic et al., 2019; Chami et al., 2020; Sun et al., 2020) and hyperbolic
|
| 78 |
+
83 neural networks (Ganea et al., 2018b; Gülçehre et al., 2019; Liu et al., 2019; Chami et al., 2019; Dai
|
| 79 |
+
84 et al., 2021; Shimizu et al., 2021) were explored. Notably, (Chami et al., 2019, 2020) leverages
|
| 80 |
+
85 the trainable curvature to compensate for the disparity between the actual data structures and the
|
| 81 |
+
86 constant-curvature hyperbolic space, where each layer in the graph neural network or each relation
|
| 82 |
+
87 in the multi-relational graph has its own curvature parameterization. Since we only focus on the
|
| 83 |
+
88 single-relation graph embeddings and taxonomy embeddings in this work, we do not evaluate the
|
| 84 |
+
89 multi-relational knowledge graph embedding models or the neural networks in our tasks.
|
| 85 |
+
90 Complex embeddings. The traditional knowledge graph embeddings were learned in the real
|
| 86 |
+
91 Euclidean space (Nickel et al., 2011; Bordes et al., 2013; Yang et al., 2015) and were used for
|
| 87 |
+
92 knowledge graph inference and reasoning. In recent years, several works suggested utilizing the
|
| 88 |
+
93 complex Euclidean space for inferring more relation patterns, such as ComplEx (Trouillon et al.,
|
| 89 |
+
94 2016) and RotatE (Sun et al., 2019). The computation operations and transformations in the complex
|
| 90 |
+
95 space have been demonstrated to be effective in the knowledge graph embeddings. The success of
|
| 91 |
+
96 the complex embeddings reveals the potential of the complex space and inspires us to explore the
|
| 92 |
+
97 complex hyperbolic space.
|
| 93 |
+
|
| 94 |
+
# 98 3 Preliminaries
|
| 95 |
+
|
| 96 |
+
# 3.1 Curvature
|
| 97 |
+
|
| 98 |
+
100 Before introducing the hyperbolic geometry and the complex hyperbolic geometry, we need to give
|
| 99 |
+
101 the definition of curvature, which describes the curve of Riemannian manifolds and controls the rate
|
| 100 |
+
102 of geodesic deviation. In this paper, curvature refers to the sectional curvature.
|
| 101 |
+
103 Definition 1 (Curvature). Given a Riemannian manifold and two linearly independent tangent vectors
|
| 102 |
+
104 at the same point, u and v, the (sectional) curvature is defined as
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
K ( \mathbf { u } , \mathbf { v } ) = \frac { \langle R ( \mathbf { u } , \mathbf { v } ) \mathbf { v } , \mathbf { u } \rangle } { \langle \mathbf { u } , \mathbf { u } \rangle \langle \mathbf { v } , \mathbf { v } \rangle - \langle \mathbf { u } , \mathbf { v } \rangle ^ { 2 } } ,
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
where $R$ is the Riemann curvature tensor, defined by the convention $R ( \mathbf { u } , \mathbf { v } ) \mathbf { w } \ = \ \nabla _ { \mathbf { u } } \nabla _ { \mathbf { v } } \mathbf { w } \ -$ $\nabla _ { \mathbf { v } } \nabla _ { \mathbf { u } } \mathbf { w } - \nabla _ { [ \mathbf { u } , \mathbf { v } ] } \mathbf { w }$ .
|
| 109 |
+
|
| 110 |
+
# 3.2 Hyperbolic geometry
|
| 111 |
+
|
| 112 |
+
108 Hyperbolic space1 is a homogeneous space with constant negative curvature. Here constant means
|
| 113 |
+
109 constant both at all points and in all pairs of directions. In the hyperbolic space $\mathbb { H } _ { \mathbb { R } } ^ { n } ( K )$ of dimension
|
| 114 |
+
110 $n$ and curvature $K < 0$ , the volume of a ball grows exponentially with its radius $\rho$ :
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
v o l ( B _ { \mathbb { H } _ { \mathbb { R } } ^ { n } ( K ) } ( \rho ) ) \sim e ^ { \sqrt { - K } ( n - 1 ) \rho } .
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
Contrastively, in the Euclidean space 111 $\mathbb { E } ^ { n }$ , the curvature is 0 and the volume of a ball grows polynomi112 ally with its radius:
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
v o l ( B _ { \mathbb { E } ^ { n } } ( \rho ) ) = \frac { \pi ^ { \frac { n } { 2 } } } { \Gamma ( \frac { n } { 2 } ) } \rho ^ { n } \sim \rho ^ { n } .
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
113 The exponential volume growth rate enables the hyperbolic space to have powerful representation
|
| 127 |
+
114 capability for tree structures since the number of nodes grows exponentially with the depth in a tree,
|
| 128 |
+
115 while the Euclidean space is too flat and narrow to embed trees.
|
| 129 |
+
|
| 130 |
+
# 3.3 Complex hyperbolic geometry
|
| 131 |
+
|
| 132 |
+
117 Complex hyperbolic space is a homogeneous geometry of variable negative curvature. Its ambient
|
| 133 |
+
118 Hermitian vector space $\mathbb { C } ^ { n , 1 }$ is the complex Euclidean space $\mathbb { C } ^ { n + 1 }$ endowed with a Hermitian form
|
| 134 |
+
119 $\langle \langle \mathbf { z } , \mathbf { w } \rangle \rangle$ , where $\mathbf { z } , \mathbf { w } \in \mathbb { C } ^ { n + 1 }$ . Then the Hermitian space $\mathbb { C } ^ { n , 1 }$ can be divided into three subsets:
|
| 135 |
+
120 $\ddot { V } _ { - } = \overset { \cdot } { \left\{ \mathbf { z } \in \mathbb { C } ^ { n , 1 } | \langle \langle \mathbf { z } , \mathbf { z } \rangle \rangle < 0 \right\} }$ , $V _ { 0 } = \{ \mathbf { z } \in \mathbb { C } ^ { n , 1 } - \{ \mathbf { 0 } \} \vert \langle \langle \mathbf { z } , \mathbf { z } \rangle \rangle = 0 \}$ , and $V _ { + } = \{ \mathbf { z } \in \mathbb { C } ^ { n , 1 } | \langle \langle \mathbf { z } , \mathbf { z } \rangle \rangle >$
|
| 136 |
+
121 $0 \}$ . Let $\mathbb { P }$ be a projection map $\mathbb { P } : \mathbb { C } ^ { n , 1 } - \{ z _ { n + 1 } = 0 \} \mathbb { C } ^ { n }$ , i.e.,
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\mathbb { P } : \left[ { \begin{array} { c } { z _ { 1 } } \\ { \dots } \\ { z _ { n + 1 } } \end{array} } \right] \mapsto \left[ { \begin{array} { c } { z _ { 1 } / z _ { n + 1 } } \\ { \dots } \\ { z _ { n } / z _ { n + 1 } } \end{array} } \right] , { \mathrm { w h e r e ~ } } z _ { n + 1 } \neq 0 .
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
Then the complex hyperbolic space 122 $\mathbb { H } _ { \mathbb { C } } ^ { n }$ and its boundary $\partial \mathbb { H } _ { \mathbb { C } } ^ { n }$ are defined using the projectivization:
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
\mathbb { H } _ { \mathbb { C } } ^ { n } = \mathbb { P } V _ { - } , \qquad \partial \mathbb { H } _ { \mathbb { C } } ^ { n } = \mathbb { P } V _ { 0 } .
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
123 The curvature of the complex hyperbolic space is summarized by (Goldman, 1999) as follows:
|
| 149 |
+
|
| 150 |
+
24 Theorem 1. The curvature is not constant in $\mathbb { H } _ { \mathbb { C } } ^ { n }$ . It is pinched between $- 1$ (in the directions of
|
| 151 |
+
25 complex projective lines) and $- 1 / 4$ (in the directions of totally real planes).
|
| 152 |
+
126 We leave the full proof in Appendix A. The non-constant curvature, which we expect to be favorable
|
| 153 |
+
127 for embedding various hierarchical structures, is one of the main differences between $\mathbb { H } _ { \mathbb { C } } ^ { n }$ and the real
|
| 154 |
+
128 hyperbolic space $\mathbb { H } _ { \mathbb { R } } ^ { n }$ .
|
| 155 |
+
|
| 156 |
+
29 The complex hyperbolic space also has the tree-like exponential volume growth property. The volume of a ball with radius 30 $\rho$ in $\mathbb { H } _ { \mathbb { C } } ^ { n }$ is given by
|
| 157 |
+
|
| 158 |
+
$$
|
| 159 |
+
v o l ( B _ { \mathbb { H } _ { \mathbb { C } } ^ { n } } ( \rho ) ) = \frac { 8 ^ { n } \sigma _ { 2 n - 1 } } { 2 n } \sinh ^ { 2 n } ( \rho / 2 ) \sim \frac { 8 ^ { n } \sigma _ { 2 n - 1 } } { 2 n } e ^ { n \rho } ,
|
| 160 |
+
$$
|
| 161 |
+
|
| 162 |
+
where 131 $\sigma _ { 2 n - 1 } = 2 \pi ^ { n } / n !$ is the Euclidean volume of the unit sphere $S ^ { 2 n - 1 } \in \mathbb { C } ^ { n }$ .
|
| 163 |
+
|
| 164 |
+
32 From the properties of the complex hyperbolic geometry, we expect that the complex hyperbolic space can naturally handle data with diverse local structures in virtue of the variable curvature as presented in Theorem 1 while preserving the tree-like properties as shown in Eq. (5).
|
| 165 |
+
|
| 166 |
+
# 4 Unit ball embeddings
|
| 167 |
+
|
| 168 |
+
We propose to embed the hierarchically structured data into the unit ball model of the complex hyperbolic space. In this section, We introduce our approach in detail.
|
| 169 |
+
|
| 170 |
+
# 4.1 The unit ball model
|
| 171 |
+
|
| 172 |
+
The unit ball model is one model used to identify the complex hyperbolic space, which can be derived via the projective geometry (Goldman, 1999). We now provide the derivation sketch.
|
| 173 |
+
|
| 174 |
+
Take the Hermitian form of 41 $\mathbb { C } ^ { n , 1 }$ in Section 3.3 to be a standard Hermitian form:
|
| 175 |
+
|
| 176 |
+
$$
|
| 177 |
+
\langle \langle \mathbf { z } , \mathbf { w } \rangle \rangle = z _ { 1 } { \overline { { w _ { 1 } } } } + \cdot \cdot \cdot + z _ { n } { \overline { { w _ { n } } } } - z _ { n + 1 } { \overline { { w _ { n + 1 } } } } ,
|
| 178 |
+
$$
|
| 179 |
+
|
| 180 |
+
142 where $\overline { { w } }$ is the conjugate of $w$ . Take $z _ { n + 1 } = 1$ in the projection map $\mathbb { P }$ in Eq. (3), then from Eq. (4)
|
| 181 |
+
143 we can derive the formula of the unit ball model:
|
| 182 |
+
|
| 183 |
+
$$
|
| 184 |
+
\mathcal { B } _ { \mathbb { C } } ^ { n } = \{ ( z _ { 1 } , \cdot \cdot \cdot , z _ { n } , 1 ) | | z _ { 1 } | ^ { 2 } + \cdot \cdot \cdot + | z _ { n } | ^ { 2 } < 1 \} ,
|
| 185 |
+
$$
|
| 186 |
+
|
| 187 |
+
144 where $| \cdot |$ is the Euclidean norm.
|
| 188 |
+
|
| 189 |
+
The metric on 145 $B _ { \mathbb { C } } ^ { n }$ is Bergman metric, which takes the formula below in 2-d case:
|
| 190 |
+
|
| 191 |
+
$$
|
| 192 |
+
d s ^ { 2 } = { \frac { - 4 } { \langle \langle { \bf z } , { \bf z } \rangle \rangle ^ { 2 } } } \operatorname* { d e t } \left[ \langle \langle { \bf z } , { \bf z } \rangle \rangle \langle \langle d { \bf z } , { \bf z } \rangle \rangle \right] .
|
| 193 |
+
$$
|
| 194 |
+
|
| 195 |
+
The distance function on 146 $B _ { \mathbb { C } } ^ { n }$ is given by
|
| 196 |
+
|
| 197 |
+
$$
|
| 198 |
+
d _ { { \mathcal B } _ { \mathbb C } ^ { n } } ( \mathbf z , \mathbf w ) = a r c o s h ( 2 \frac { \left. \left. \mathbf z , \mathbf w \right. \right. \left. \left. \mathbf w , \mathbf z \right. \right. } { \left. \left. \mathbf z , \mathbf z \right. \right. \left. \left. \mathbf w , \mathbf w \right. \right. } - 1 ) ,
|
| 199 |
+
$$
|
| 200 |
+
|
| 201 |
+
147 where the Hermitian form $\langle \langle \mathbf { z } , \mathbf { w } \rangle \rangle$ is defined in Eq. (6).
|
| 202 |
+
|
| 203 |
+
# 4.2 Embeddings in the unit ball model
|
| 204 |
+
|
| 205 |
+
Given the hierarchical data containing a set of nodes $X ~ = ~ \{ x _ { p } \} _ { p = 1 } ^ { m }$ and a set of edges $E =$ $\{ ( x _ { p } , x _ { q } ) | x _ { p } , x _ { q } \in X \}$ , we aim to learn the embeddings of the nodes $\mathbf { \dot { Z } } = \{ \mathbf { z } _ { p } \} _ { p = 1 } ^ { m }$ , where $\mathbf { z } _ { p } \in B _ { \mathbb { C } } ^ { n }$ .
|
| 206 |
+
|
| 207 |
+
The objective of the embeddings is to recover the structures of input data, including the distances between the nodes as well as the partial order in the hierarchies. Here we adopt the soft ranking loss used in the Poincaré ball embeddings (Nickel and Kiela, 2017) and the hyperboloid embeddings (Nickel and Kiela, 2018), which aims at preserving the hierarchical relationships among nodes:
|
| 208 |
+
|
| 209 |
+
$$
|
| 210 |
+
L = \sum _ { ( x _ { p } , x _ { q } ) \in E } \log \frac { e ^ { - d _ { \mathcal { B } _ { \mathbb { C } } ^ { n } } ( \mathbf { z } _ { p } , \mathbf { z } _ { q } ) } } { \sum _ { x _ { k } \in \mathcal { N } ( x _ { p } ) } e ^ { - d _ { \mathcal { B } _ { \mathbb { C } } ^ { n } } ( \mathbf { z } _ { p } , \mathbf { z } _ { k } ) } } ,
|
| 211 |
+
$$
|
| 212 |
+
|
| 213 |
+
Algorithm 1 RSGD of the unit ball embeddings.
|
| 214 |
+
|
| 215 |
+
<table><tr><td></td></tr><tr><td>for t = 1 to Tdo dB adBr</td></tr><tr><td>Compute and by Eqs. (14) and (15).</td></tr><tr><td>dx ay Compute VEL(z) and VRL(z) by Eq. (13).</td></tr><tr><td>Update z(t) by Eq. (17).</td></tr></table>
|
| 216 |
+
|
| 217 |
+
156 where $\mathcal { N } ( x _ { p } ) = \{ x _ { k } : ( x _ { p } , x _ { k } ) \notin E \tau \} \cup \{ x _ { p } \}$ is the set of negative examples for $x _ { p }$ together with
|
| 218 |
+
157 $x _ { p } . \ d _ { B _ { \mathbb { C } } ^ { n } }$ is the distance function in the unit ball model given in Eq. (9). The minimization of $L$ makes
|
| 219 |
+
158 the connected nodes closer in the embedding space than those with no observed edges.
|
| 220 |
+
159 Note that instead of manually setting the curvature of the learning space or training the curvature
|
| 221 |
+
160 as extra parameters, we learn the embeddings directly in the complex hyperbolic space, where the
|
| 222 |
+
161 curvature is variable. The learned embeddings are located in different submanifolds of the unit ball
|
| 223 |
+
162 model, whose curvatures are different.
|
| 224 |
+
|
| 225 |
+
# 163 4.3 Riemannian optimization in the unit ball model
|
| 226 |
+
|
| 227 |
+
We learn the embeddings 164 $\mathbf { Z } = \{ \mathbf { z } _ { p } \} _ { p = 1 } ^ { m }$ through solving the optimization problem with constraint:
|
| 228 |
+
|
| 229 |
+
$$
|
| 230 |
+
\mathbf { Z } \arg \operatorname* { m i n } _ { \mathbf { Z } } L \qquad s . t . \forall \mathbf { z } _ { p } \in \mathbf { Z } , \mathbf { z } _ { p } \in B _ { \mathbb { C } } ^ { n } .
|
| 231 |
+
$$
|
| 232 |
+
|
| 233 |
+
165 For the optimization problems in Riemannian manifolds, (Bonnabel, 2013) presented the Riemannian
|
| 234 |
+
166 stochastic gradient descent (RSGD) algorithm, which we employ to optimize Eq. (11). To update an
|
| 235 |
+
167 embedding $\mathbf { z } \in B _ { \mathbb { C } } ^ { n }$ ,2 we need to obtain its Riemannian gradient $\nabla _ { R }$ . Specifically, denote $\mathcal { T } _ { \mathbf { z } } B _ { \mathbb { C } } ^ { n }$ as
|
| 236 |
+
168 the tangent space of $\mathbf { z }$ , then the embedding is updated at the $t { \cdot }$ -th iteration by
|
| 237 |
+
|
| 238 |
+
$$
|
| 239 |
+
\mathbf { z } ^ { ( t ) } \gets \mathbf { z } ^ { ( t - 1 ) } - \eta ^ { ( t ) } \nabla _ { R } L ( \mathbf { z } ) ,
|
| 240 |
+
$$
|
| 241 |
+
|
| 242 |
+
169 where $\eta ^ { ( t ) }$ is the learning rate at the $t$ -th iteration and $\nabla _ { R } L ( \mathbf { z } ) \in \mathcal { T } _ { \mathbf { z } } B _ { \mathbb { C } } ^ { n }$ is the Riemannian gradient
|
| 243 |
+
170 of $L ( \mathbf { z } )$ . Then the Riemannian gradient $\nabla _ { R }$ can be derived from rescaling the Euclidean gradient
|
| 244 |
+
171 $\nabla _ { E }$ with the inverse of the metric tensor $d s ^ { 2 }$ and applying the chain rule of differential functions:
|
| 245 |
+
|
| 246 |
+
$$
|
| 247 |
+
\nabla _ { R } L ( \mathbf { z } ) = \frac { 1 } { d s ^ { 2 } } \nabla _ { E } L ( \mathbf { z } ) = \frac { 1 } { d s ^ { 2 } } \frac { \partial L ( \mathbf { z } ) } { \partial d _ { B _ { \mathbb { C } } ^ { n } } ( \mathbf { z } , \mathbf { w } ) } \nabla _ { E } d _ { B _ { \mathbb { C } } ^ { n } } ( \mathbf { z } , \mathbf { w } ) ,
|
| 248 |
+
$$
|
| 249 |
+
|
| 250 |
+
where 172 $d s ^ { 2 }$ is in Eq. (8) and $\frac { \partial L ( \mathbf { z } ) } { \partial d _ { B _ { \mathbb { C } } ^ { n } } ( \mathbf { z } , \mathbf { w } ) }$ is trivial to compute from Eq. (10).
|
| 251 |
+
|
| 252 |
+
173 In practical training, we implement and compute the complex hyperbolic embedding as its real part
|
| 253 |
+
174 and imaginary part, i.e., $\mathbf { z } = \mathbf { x } + i \mathbf { y }$ , where $i$ represents the imaginary unit, i.e., $i ^ { 2 } = - 1$ . In order to
|
| 254 |
+
175 get the gradient of the distance function $\nabla _ { E } d _ { B _ { \mathbb { C } } ^ { n } } ( \mathbf { z } , \mathbf { w } )$ in Eq. (13), we get the partial derivative with
|
| 255 |
+
176 regard to the real part and the imaginary part, i.e., $\begin{array} { r } { \nabla _ { E } d _ { { \mathcal B } _ { \mathbb C } ^ { n } } ( { \bf z } , { \bf w } ) = \frac { \partial d _ { { \mathcal B } _ { \mathbb C } ^ { n } } ( { \bf z } , { \bf w } ) } { \partial { \bf x } } + i \frac { \partial d _ { { \mathcal B } _ { \mathbb C } ^ { n } } ( { \bf z } , { \bf w } ) } { \partial { \bf y } } . } \end{array}$
|
| 256 |
+
|
| 257 |
+
177 The partial derivatives of the unit ball model distance take the following formulas:
|
| 258 |
+
|
| 259 |
+
$$
|
| 260 |
+
\begin{array} { r l r } & { } & { \displaystyle \frac { \partial d _ { B _ { \mathbb { C } } ^ { n } } } { \partial \mathbf { x } } = \frac { 4 } { \sqrt { p ^ { 2 } - 1 } } \Big ( \frac { R e ( \langle \mathbf { z } , \mathbf { w } \rangle \mathbf { w } ) } { \mathbf { z } , \mathbf { z } \mathbf { w } , \mathbf { w } } - \frac { \mathbf { z } , \mathbf { w } \mathbf { w } , \mathbf { z } \mathbf { x } } { \mathbf { z } , \mathbf { z } ^ { 2 } \mathbf { w } , \mathbf { w } } \Big ) , } \\ & { } & { \displaystyle \frac { \partial d _ { B _ { \mathbb { C } } ^ { n } } } { \partial \mathbf { y } } = \frac { 4 } { \sqrt { p ^ { 2 } - 1 } } \Big ( \frac { I m ( \langle \mathbf { z } , \mathbf { w } \mathbf { w } ) } { \mathbf { z } , \mathbf { z } \mathbf { w } , \mathbf { w } } - \frac { \mathbf { z } , \mathbf { w } \mathbf { w } , \mathbf { z } \mathbf { y } } { \mathbf { z } , \mathbf { z } ^ { 2 } \mathbf { w } , \mathbf { w } } \Big ) , } \end{array}
|
| 261 |
+
$$
|
| 262 |
+
|
| 263 |
+
178 where $p = \cosh ( d _ { B _ { \mathbb { C } _ { - } } ^ { n } } ( \mathbf { z } , \mathbf { w } ) )$ , $R e ( \cdot )$ and $I m ( \cdot )$ denote the real and the imaginary part respectively.
|
| 264 |
+
179 The full derivation of Eqs. (14) and (15) is given in Appendix B.
|
| 265 |
+
180 Since the embedding $\mathbf { z }$ should be constrained within the unit ball model, we apply the same projection
|
| 266 |
+
181 strategy as (Nickel and Kiela, 2017) via a small constant $\varepsilon$ :
|
| 267 |
+
|
| 268 |
+
$$
|
| 269 |
+
\begin{array} { r } { p r o j ( \mathbf { z } ) = \left\{ \begin{array} { l l } { \mathbf { z } / ( | \mathbf { z } | - \varepsilon ) } & { \mathrm { i f ~ } | \mathbf { z } | \geq 1 , } \\ { \mathbf { z } } & { \mathrm { o t h e r w i s e } . } \end{array} \right. } \end{array}
|
| 270 |
+
$$
|
| 271 |
+
|
| 272 |
+
Table 1: The real-world datasets statistics.
|
| 273 |
+
|
| 274 |
+
<table><tr><td></td><td>ICD10</td><td>YAGO3-wikiObjects</td><td>WordNet-noun</td></tr><tr><td>Nodes</td><td>19,155</td><td>17,375</td><td>82,115</td></tr><tr><td>Edges</td><td>78,357</td><td>153,643</td><td>743,086</td></tr><tr><td>Depth</td><td>6</td><td>16</td><td>20</td></tr><tr><td>Training edges</td><td>70,521</td><td>138,277</td><td>668,776</td></tr><tr><td>Valid/Test edges</td><td>3,918</td><td>7,683</td><td>37,155</td></tr><tr><td>δ-hyperbolicity</td><td>0.0</td><td>1.0</td><td>0.5</td></tr></table>
|
| 275 |
+
|
| 276 |
+
182 To sum up, the update of $\mathbf { z }$ at the $t$ -th iteration is
|
| 277 |
+
|
| 278 |
+
$$
|
| 279 |
+
{ \bf z } ^ { ( t ) } \gets p r o j \big ( { \bf z } ^ { ( t - 1 ) } - \eta ^ { ( t ) } \nabla _ { R } L ( { \bf z } ) \big ) = p r o j \big ( { \bf z } ^ { ( t - 1 ) } - \eta ^ { ( t ) } \frac { 1 } { d s ^ { 2 } } \nabla _ { E } L ( { \bf z } ) \big ) .
|
| 280 |
+
$$
|
| 281 |
+
|
| 282 |
+
183 The RSGD steps of the unit ball embeddings are presented in Algorithm 1.
|
| 283 |
+
|
| 284 |
+
# 5 Experiments
|
| 285 |
+
|
| 286 |
+
In this section, we evaluate the performances of our approach on tree structures and various hierarchical structures, including synthetic graphs and real-world taxonomies. We focus on the graph reconstruction and link prediction tasks. For more experiments, please refer to Appendix D.
|
| 287 |
+
|
| 288 |
+
# 5.1 Experimental settings
|
| 289 |
+
|
| 290 |
+
# 5.1.1 Data
|
| 291 |
+
|
| 292 |
+
We use synthetic and real-world data that exhibit underlying hierarchical structures to evaluate our approach. The details are as follows.
|
| 293 |
+
|
| 294 |
+
Synthetic. We generate various balanced trees and compressed graphs using NetworkX package (Hagberg et al., 2008).3 For balanced trees, we generate the balanced tree with degree $r$ and depth $h$ . For compressed graphs, we generate $k$ random trees on $m$ nodes and then aggregate their edges to form a graph. Some examples of the synthetic data are given in Appendix D.1.
|
| 295 |
+
|
| 296 |
+
ICD10. The 10-th revision of International Statistical Classification of Diseases and Related Health Problems (ICD10)4 (Brämer, 1988) is a medical classification list provided by the World Health Organization. The classification list forms a tree structure. We construct its full transitive closure as the ICD10 dataset.
|
| 297 |
+
|
| 298 |
+
YAGO3-wikiObjects. $\mathrm { Y A G O } 3 ^ { 5 }$ (Mahdisoltani et al., 2015) is a huge semantic knowledge base. It provides a taxonomy derived from Wikipedia and WordNet. We extract the Wikipedia concepts and entities that are descendants of $\langle w i k i c a t \_ O b j e c t s \rangle$ as well as the hypernymy edges among them. We compute the transitive closure of the sampled taxonomy to construct the YAGO3-wikiObjects dataset.
|
| 299 |
+
|
| 300 |
+
WordNet-noun. WordNet6 (Miller, 1995) is a large lexical database. The hypernymy relation among all nouns forms a noun hierarchy. We use its full transitive closure as the WordNet-noun dataset.
|
| 301 |
+
|
| 302 |
+
For each real-world dataset, we randomly split the edges into train-validation-test sets with the ratio $9 0 \% { : } 5 \% { : } 5 \%$ . We make sure that any node in the validation and test sets must occur in the training set since otherwise, it cannot be predicted. But the edges in the validation and test sets do not occur in the training set since they are disjoint. We provide the statistics of the real-world datasets in Table 1. The Gromov’s $\delta$ -hyperbolicity (Gromov, 1987) measures the tree-likeness of graphs (refer to Appendix C for definition). The lower $\delta$ corresponds to the more tree-like graph and trees have 0 $\delta$ -hyperbolicity.
|
| 303 |
+
|
| 304 |
+
# 5.1.2 Tasks
|
| 305 |
+
|
| 306 |
+
213 We evaluate the following two tasks:
|
| 307 |
+
|
| 308 |
+
3https://networkx.org/documentation/stable/reference/generators.html
|
| 309 |
+
4https://www.who.int/standards/classifications/classification-of-diseases
|
| 310 |
+
5https://yago-knowledge.org/
|
| 311 |
+
6https://wordnet.princeton.edu/
|
| 312 |
+
|
| 313 |
+
Graph reconstruction. We train the embeddings of the full data and then reconstruct it from the embeddings. The task evaluates representation capacity.
|
| 314 |
+
|
| 315 |
+
Link prediction. We train the embeddings on the training set and predict the edges in the test set.
|
| 316 |
+
The task evaluates generalization performance.
|
| 317 |
+
|
| 318 |
+
# 5.1.3 Baselines
|
| 319 |
+
|
| 320 |
+
We compare our approach UnitBall to the following methods: the sate-of-the-art combinatorial construction-based hyperbolic embedding method TreeRep (Sonthalia and Gilbert, 2020), the optimization-based hyperbolic embeddings in the Poincaré ball model (Nickel and Kiela, 2017) and the Hyperboloid model (Nickel and Kiela, 2018), the simple Euclidean embedding model using the same loss function with (Nickel and Kiela, 2017, 2018). Recall that we use the same loss function with Poincaré and Hyperboloid but learn in the unit ball model. Therefore, the comparisons among UnitBall, Poincaré, Hyperboloid, and Euclidean reveal the representation capacities of different geometrical models in different spaces.
|
| 321 |
+
|
| 322 |
+
For the baselines, we use their public codes to train the embeddings. For all methods, the hyperparameters are tuned on each validation set for link prediction task and on balanced tree-(15,3) for graph reconstruction task. The hardware information is given in Appendix D.2 and the hyperparameters are listed in Appendix D.3. In all experiments, we report the mean results over 5 running executions. The code of our approach will be publicly available after the publishing of the paper.
|
| 323 |
+
|
| 324 |
+
# 5.1.4 Evaluation
|
| 325 |
+
|
| 326 |
+
We use the mean average precision (MAP), mean reciprocal rank (MRR), and $\mathbf { H i t s } @ \mathbf { N }$ as our evaluation metrics, which are widely used for evaluating ranking and link prediction. The details of prediction steps and the evaluation metrics are given in Appendix D.4.
|
| 327 |
+
|
| 328 |
+
The $n$ -d complex hyperbolic embeddings have around double parameters of the $n$ -d real embeddings since the $n$ -d complex hyperbolic vectors have $n$ -d real part and $n$ -d imaginary part. For a fair comparison, in each experimental setting, we compare our $n$ -d complex hyperbolic embeddings of UnitBall against the $2 n$ -d embeddings of the baselines. The results will also demonstrate that the $n$ -d complex hyperbolic space is not simply the $2 n$ -d hyperbolic space, they have different capacities.
|
| 329 |
+
|
| 330 |
+
# 5.2 Graph reconstruction
|
| 331 |
+
|
| 332 |
+
# 5.2.1 Results on balanced trees
|
| 333 |
+
|
| 334 |
+
To compare the representation capacities of UnitBall and the hyperbolic embedding models for the tree structures, we first evaluate the graph reconstruction task on the synthetic balanced trees. A balanced tree- $( r , h )$ has degree $r$ and depth $h$ , so it has $r ^ { 0 } + \cdots + r ^ { d }$ nodes and $r ^ { 0 } + \cdot \cdot \cdot + r ^ { d } - 1$ edges. The $\delta$ -hyperbolicity of any balanced tree is 0. We embed the balanced trees into 20-d hyperbolic space for the baselines and 10-d complex hyperbolic space for UnitBall.
|
| 335 |
+
|
| 336 |
+
Figure 1 presents the MAP and Hits $\textcircled { a } 3$ scores with varying $r$ and $h$ . We see that when the tree is in small scale, e.g., $( r , h ) = ( 1 5 , 3 ) , ( 1 0 , 2 ) , ( 1 0 , 3 ) ,$ all methods have very good performances, demonstrating the expected powerful capacities of hyperbolic geometry and complex hyperbolic geometry on tree structures. However, when the breadth or the depth increases, the performances of Poincaré and Hyperboloid drop rapidly, suggesting that the optimization-based embeddings in $\mathbb { H } _ { \mathbb { R } } ^ { 2 0 }$ are not effective enough for reconstructing trees of such scales.
|
| 337 |
+
|
| 338 |
+
In comparison, UnitBall and TreeRep achieve stable performances for larger trees. TreeRep learns a tree structure from the data as an intermediate step and then embeds the learned trees into the hyperbolic space using Sarkar’s construction (Sarkar, 2011). When the input data is a tree, TreeRep exactly recovers the original tree structure. Figure 1 shows that UnitBall achieves comparable or even better performances than TreeRep on the balanced trees. The results demonstrate that UnitBall does not compromise on trees. It produces high-quality embeddings for tree structures.
|
| 339 |
+
|
| 340 |
+
# 5.2.2 Results on compressed graphs
|
| 341 |
+
|
| 342 |
+
61 To illustrate the benefits of UnitBall on varying hierarchical structures, we now evaluate on the
|
| 343 |
+
62 synthetic compressed graphs. The compressed graphs have local tree structures while being more
|
| 344 |
+
017 018 045 Figure 2: Evaluation of graph reconstruction on synthetic compressed graphs in 20-d embedding
|
| 345 |
+
019 020 047 spaces (10-d complex hyperbolic space for UnitBall). $m$ represents the number of nodes in the graph
|
| 346 |
+
021 022 while $k$ 049 represents the number of random trees aggregated to the graph ( $k$ controls the denseness and
|
| 347 |
+
023 024 051 noise level of the graph). The statistics of the compressed graphs are provided in the tables.
|
| 348 |
+
027 0283 complicated than trees. Each compressed graph- $( m , k )$ consists of $m$ nodes and is aggregated from $k$
|
| 349 |
+
029 0304 random trees on the $m$ nodes. The bigger $k$ corresponds to the denser and noisier graph.
|
| 350 |
+
032 Figure 2 depicts the reconstruction results as a function of varying $m$ and $k$ . The results on the
|
| 351 |
+
034 compressed graphs are not as good as on balanced trees, especially with the increase of $m$ and $k$ , which
|
| 352 |
+
036 represents the increase of graph scale and denseness respectively. Notably, UnitBall outperforms
|
| 353 |
+
038 all other methods on the challenging data, showing that UnitBall handles the noisy locally tree-like
|
| 354 |
+
039 040 Edges 499 998 1,496 1,985 2,468 2,966 3,452 3,939 4,426 4,890structures better. TreeRep has comparable results with other methods when $( m , k ) \stackrel { \cdot } { = } ( 5 0 \stackrel { \cdot } { 0 } , 1 )$ since
|
| 355 |
+
042 δ-when $k = 1$ 0.0 2.5 1.5 1.0 1.0 1.0 1.0 1.0 , the graph is exactly a tree, i.e., $\delta = 0$ . However, when $k > 1$ and $\delta > 0$ , TreeRep cannot
|
| 356 |
+
044 achieve promising results, because when the data metrics deviate from tree metrics, it does not help
|
| 357 |
+
045 046 much to learn a tree structure from the data as an intermediate step.
|
| 358 |
+
|
| 359 |
+

|
| 360 |
+
Figure 1: Evaluation of graph reconstruction on synthetic balanced trees in 20-d embedding spaces009 (10-d complex hyperbolic space for UnitBall). $r$ represents the degree while m(k = 5) 100 200 300 400 500 $h$ represents the depth. 700 800 900 1000
|
| 361 |
+
|
| 362 |
+

|
| 363 |
+
|
| 364 |
+
<table><tr><td>m(k =5)</td><td>100</td><td>200</td><td>300</td><td>400</td><td>500</td><td>600</td><td>700</td><td>800</td><td>900</td><td>1000</td></tr><tr><td>Edges</td><td>478</td><td>982</td><td>1474</td><td>1,965</td><td>2,468</td><td>2.976</td><td>3,476</td><td>3.983</td><td>4,468</td><td>4,970</td></tr><tr><td>δ-hyperbolicity</td><td>1.0</td><td>1.0</td><td>1.0</td><td>1.0</td><td>1.0</td><td>1.5</td><td>1.5</td><td>1.5</td><td>1.5</td><td>1.5</td></tr></table>
|
| 365 |
+
|
| 366 |
+
<table><tr><td>k(m = 500)</td><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td><td>9</td><td>10</td></tr><tr><td>Edges</td><td>499</td><td>998</td><td>1,496</td><td>1,985</td><td>2.468</td><td>2.966</td><td>3,452</td><td>3,939</td><td>4,426</td><td>4,890</td></tr><tr><td>δ-hyperbolicity</td><td>0.0</td><td>2.5</td><td>1.5</td><td>1.0</td><td>1.0</td><td>1.0</td><td>1.0</td><td>1.0</td><td>1.0</td><td>1.0</td></tr></table>
|
| 367 |
+
|
| 368 |
+
# 049 050 5.3 Link prediction
|
| 369 |
+
|
| 370 |
+
# 053 0545.3.1 Overall results
|
| 371 |
+
|
| 372 |
+
In this section, we evaluate the performances on the link prediction task for the real-world taxonomies. Table 2 presents the results in 32-d embedding spaces for baselines and 16-d complex hyperbolic space for UnitBall. Predicting missing links requires stronger generalization capacity than reconstructing graphs, and UnitBall still has the best performances on all three datasets. Besides, we see that Euclidean shows shortages on these hierarchically-structured data, which is consistent with the results in previous works (Nickel and Kiela, 2017, 2018). Similar to the results on the graph reconstruction task, Poincaré and Hyperboloid have very close performances, while Hyperboloid has slightly better results. They have significant improvements over Euclidean, but they still fall behind UnitBall, which
|
| 373 |
+
|
| 374 |
+
Table 2: Evaluation of taxonomy link prediction in 32-d embedding spaces (16-d complex hyperbolic space for UnitBall). The best results are shown in boldface. The second best results are underlined.
|
| 375 |
+
|
| 376 |
+
<table><tr><td></td><td colspan="3">ICD10</td><td colspan="3">YAGO3-wikiObjects</td><td colspan="3">WordNet-noun</td></tr><tr><td></td><td>MAP</td><td>MRR</td><td>Hits@3</td><td>MAP</td><td>MRR</td><td>Hits@3</td><td>MAP</td><td>MRR</td><td>Hits@3</td></tr><tr><td>Euclidean</td><td>3.75</td><td>3.72</td><td>2.39</td><td>4.85</td><td>4.45</td><td>2.78</td><td>5.59</td><td>5.36</td><td>3.16</td></tr><tr><td>TreeRep</td><td>4.96</td><td>7.92</td><td>8.49</td><td>20.19</td><td>21.85</td><td>27.19</td><td>9.30</td><td>9.98</td><td>11.90</td></tr><tr><td>Poincaré</td><td>35.24</td><td>34.45</td><td>52.71</td><td>30.06</td><td>28.47</td><td>41.61</td><td>25.46</td><td>23.99</td><td>27.80</td></tr><tr><td>Hyperboloid</td><td>34.80</td><td>34.01</td><td>52.88</td><td>30.80</td><td>29.21</td><td>43.17</td><td>25.65</td><td>24.15</td><td>27.50</td></tr><tr><td>UnitBall</td><td>47.88</td><td>46.96</td><td>70.28</td><td>33.33</td><td>31.85</td><td>47.41</td><td>27.29</td><td>25.93</td><td>32.95</td></tr></table>
|
| 377 |
+
|
| 378 |
+
Table 3: Evaluation of taxonomy link prediction in different embedding dimensions (the embedding dimension for UnitBall is half of other models). The best results are shown in boldface. The second best results are underlined.
|
| 379 |
+
|
| 380 |
+
<table><tr><td></td><td colspan="9">YAGO3-wikiObjects</td></tr><tr><td></td><td colspan="3">8-dimensional</td><td colspan="3">32-dimensional</td><td colspan="3">128-dimensional</td></tr><tr><td></td><td>MAP</td><td>MRR</td><td>Hits@3</td><td>MAP</td><td>MRR</td><td>Hits@3</td><td>MAP</td><td>MRR</td><td>Hits@3</td></tr><tr><td>Euclidean</td><td>1.02</td><td>0.92</td><td>0.57</td><td>4.85</td><td>4.45</td><td>2.78</td><td>16.67</td><td>15.76</td><td>15.97</td></tr><tr><td>TreeRep</td><td>16.91</td><td>17.48</td><td>27.53</td><td>20.19</td><td>21.85</td><td>27.19</td><td>21.18</td><td>23.44</td><td>32.84</td></tr><tr><td>Poincaré</td><td>29.70</td><td>28.13</td><td>41.64</td><td>30.06</td><td>28.47</td><td>41.61</td><td>29.93</td><td>28.35</td><td>41.53</td></tr><tr><td>Hyperboloid</td><td>30.87</td><td>29.28</td><td>43.50</td><td>30.80</td><td>29.21</td><td>43.17</td><td>30.68</td><td>29.07</td><td>42.86</td></tr><tr><td>UnitBall</td><td>31.40</td><td>29.98</td><td>44.25</td><td>33.33</td><td>31.85</td><td>47.41</td><td>32.76</td><td>31.28</td><td>46.25</td></tr></table>
|
| 381 |
+
|
| 382 |
+
83 demonstrates our claims that the non-constant negative curvature of the complex hyperbolic space
|
| 383 |
+
284 addresses the varying hierarchical structures on real-world datasets.
|
| 384 |
+
|
| 385 |
+
We notice that TreeRep does not perform well on the link prediction task. As mentioned in Section 2, the combinatorial construction-based embedding methods (Sala et al., 2018; Gu et al., 2019; Sonthalia and Gilbert, 2020) target on minimizing the reconstruction distortion of data and they can achieve very good results on the graph reconstruction task. But minimizing the reconstruction distortion may overfit the training set, thus resulting in the unpromising generalization performance for unobserved edges. Hence, they are more suitable to learn the representation of graph data without missing links. We also evaluate TreeRep on the real-world taxonomy reconstruction task in Appendix D.5.
|
| 386 |
+
|
| 387 |
+
# 5.3.2 Exploring the embedding dimensions
|
| 388 |
+
|
| 389 |
+
In this section, we explore the performances in different embedding dimensions. The results on YAGO3-wikiObjects are presented in Table 3. Results on other datasets are in Appendix D.6. We find that with the increase of the embedding dimension, Euclidean can have big improvements, but its performances in 128-d still cannot surpass other methods in 8-d. TreeRep also achieves better results with the increase of dimension, but overall its performances on the link prediction task are not very promising. By comparison, Poincaré, Hyperboloid, and UnitBall achieve great results steadily. 8-d is already enough for Poincaré and Hyperboloid to handle the link prediction task. We notice that UnitBall has small improvements from 4-d to 16-d, then converges to the stable performance. The results demonstrate that the Euclidean embeddings need to increase the dimension to better model the increasing complex hierarchies, while the complex hyperbolic space and the hyperbolic space have strong generalization competence for hierarchical structures.
|
| 390 |
+
|
| 391 |
+
# 04 6 Conclusion
|
| 392 |
+
|
| 393 |
+
In this paper, we present a novel approach for learning the embeddings of hierarchical structures in the unit ball model of the complex hyperbolic space. We characterize the geometrical properties of the complex hyperbolic space, including the variable negative curvature and the exponential growth of volume of geodesic balls, which are beneficial for data with various hierarchical structures. We exemplify the superiority of our approach over the graph reconstruction task and the link prediction task on both synthetic and real-world data, which cover the tree structures as well as the general hierarchical structures. The empirical results show that our approach outperforms the hyperbolic embedding methods in terms of representation capacity and generalization performance.
|
| 394 |
+
|
| 395 |
+
# 13 References
|
| 396 |
+
|
| 397 |
+
314 I. Balazevic, C. Allen, and T. M. Hospedales. Multi-relational poincaré graph embeddings. In
|
| 398 |
+
315 NeurIPS, pages 4465–4475, 2019.
|
| 399 |
+
316 G. Bécigneul and O. Ganea. Riemannian adaptive optimization methods. In ICLR (Poster). OpenRe
|
| 400 |
+
317 view.net, 2019.
|
| 401 |
+
318 S. Bonnabel. Stochastic gradient descent on riemannian manifolds. IEEE Trans. Autom. Control., 58
|
| 402 |
+
319 (9):2217–2229, 2013.
|
| 403 |
+
320 A. Bordes, N. Usunier, A. García-Durán, J. Weston, and O. Yakhnenko. Translating embeddings for
|
| 404 |
+
321 modeling multi-relational data. In NIPS, pages 2787–2795, 2013.
|
| 405 |
+
322 G. R. Brämer. International statistical classification of diseases and related health problems. tenth
|
| 406 |
+
323 revision. World health statistics quarterly. Rapport trimestriel de statistiques sanitaires mondiales,
|
| 407 |
+
324 41(1):32–36, 1988.
|
| 408 |
+
325 I. Chami, Z. Ying, C. Ré, and J. Leskovec. Hyperbolic graph convolutional neural networks. In
|
| 409 |
+
326 NeurIPS, pages 4869–4880, 2019.
|
| 410 |
+
327 I. Chami, A. Wolf, D. Juan, F. Sala, S. Ravi, and C. Ré. Low-dimensional hyperbolic knowledge
|
| 411 |
+
328 graph embeddings. In ACL, pages 6901–6914. Association for Computational Linguistics, 2020.
|
| 412 |
+
329 J. Dai, Y. Wu, Z. Gao, and Y. Jia. A hyperbolic-to-hyperbolic graph convolutional network. In CVPR,
|
| 413 |
+
330 2021.
|
| 414 |
+
331 R. Fu, J. Guo, B. Qin, W. Che, H. Wang, and T. Liu. Learning semantic hierarchies via word
|
| 415 |
+
332 embeddings. In ACL (1), pages 1199–1209. The Association for Computer Linguistics, 2014.
|
| 416 |
+
333 O. Ganea, G. Bécigneul, and T. Hofmann. Hyperbolic entailment cones for learning hierarchical
|
| 417 |
+
334 embeddings. In ICML, volume 80 of Proceedings of Machine Learning Research, pages 1632–1641.
|
| 418 |
+
335 PMLR, 2018a.
|
| 419 |
+
336 O. Ganea, G. Bécigneul, and T. Hofmann. Hyperbolic neural networks. In NeurIPS, pages 5350–5360,
|
| 420 |
+
337 2018b.
|
| 421 |
+
338 W. M. Goldman. Complex hyperbolic geometry. Oxford University Press, 1999.
|
| 422 |
+
339 J. R. Griggs, W. Li, and L. Lu. Diamond-free families. J. Comb. Theory, Ser. A, 119(2):310–322,
|
| 423 |
+
340 2012.
|
| 424 |
+
341 M. Gromov. Hyperbolic groups. In Essays in group theory, pages 75–263. Springer, 1987.
|
| 425 |
+
342 A. Gu, F. Sala, B. Gunel, and C. Ré. Learning mixed-curvature representations in product spaces. In
|
| 426 |
+
343 ICLR (Poster). OpenReview.net, 2019.
|
| 427 |
+
344 Ç. Gülçehre, M. Denil, M. Malinowski, A. Razavi, R. Pascanu, K. M. Hermann, P. W. Battaglia,
|
| 428 |
+
345 V. Bapst, D. Raposo, A. Santoro, and N. de Freitas. Hyperbolic attention networks. In ICLR
|
| 429 |
+
346 (Poster). OpenReview.net, 2019.
|
| 430 |
+
347 A. A. Hagberg, D. A. Schult, and P. J. Swart. Exploring network structure, dynamics, and function
|
| 431 |
+
348 using networkx. In G. Varoquaux, T. Vaught, and J. Millman, editors, Proceedings of the 7th
|
| 432 |
+
349 Python in Science Conference, pages 11 – 15, Pasadena, CA USA, 2008.
|
| 433 |
+
350 D. Krioukov, F. Papadopoulos, M. Kitsak, A. Vahdat, and M. Boguñá. Hyperbolic geometry of
|
| 434 |
+
351 complex networks. Phys. Rev. E, 82:036106, Sep 2010. doi: 10.1103/PhysRevE.82.036106. URL
|
| 435 |
+
352 https://link.aps.org/doi/10.1103/PhysRevE.82.036106.
|
| 436 |
+
353 Q. Liu, M. Nickel, and D. Kiela. Hyperbolic graph neural networks. In NeurIPS, pages 8228–8239,
|
| 437 |
+
354 2019.
|
| 438 |
+
355 F. Mahdisoltani, J. Biega, and F. M. Suchanek. YAGO3: A knowledge base from multilingual
|
| 439 |
+
356 wikipedias. In CIDR. www.cidrdb.org, 2015.
|
| 440 |
+
|
| 441 |
+
G. A. Miller. Wordnet: A lexical database for english. Commun. ACM, 38(11):39–41, 1995.
|
| 442 |
+
8 M. Nickel and D. Kiela. Poincaré embeddings for learning hierarchical representations. In NIPS, pages 6338–6347, 2017.
|
| 443 |
+
M. Nickel and D. Kiela. Learning continuous hierarchies in the lorentz model of hyperbolic geometry. In ICML, volume 80 of Proceedings of Machine Learning Research, pages 3776–3785. PMLR, 2018.
|
| 444 |
+
M. Nickel, V. Tresp, and H. Kriegel. A three-way model for collective learning on multi-relational data. In ICML, pages 809–816. Omnipress, 2011.
|
| 445 |
+
F. Sala, C. D. Sa, A. Gu, and C. Ré. Representation tradeoffs for hyperbolic embeddings. In ICML, volume 80 of Proceedings of Machine Learning Research, pages 4457–4466. PMLR, 2018.
|
| 446 |
+
R. Sarkar. Low distortion delaunay embedding of trees in hyperbolic plane. In Graph Drawing, volume 7034 of Lecture Notes in Computer Science, pages 355–366. Springer, 2011. R. Shimizu, Y. Mukuta, and T. Harada. Hyperbolic neural networks $^ { + + }$ . In ICLR (Poster), 2021.
|
| 447 |
+
V. Shwartz, Y. Goldberg, and I. Dagan. Improving hypernymy detection with an integrated path-based and distributional method. In ACL (1). The Association for Computer Linguistics, 2016.
|
| 448 |
+
R. Sonthalia and A. C. Gilbert. Tree! I am no tree! I am a low dimensional hyperbolic embedding. In NeurIPS, 2020.
|
| 449 |
+
F. M. Suchanek, G. Kasneci, and G. Weikum. Yago: a core of semantic knowledge. In WWW, pages 697–706. ACM, 2007.
|
| 450 |
+
Z. Sun, Z. Deng, J. Nie, and J. Tang. Rotate: Knowledge graph embedding by relational rotation in complex space. In ICLR (Poster). OpenReview.net, 2019.
|
| 451 |
+
Z. Sun, M. Chen, W. Hu, C. Wang, J. Dai, and W. Zhang. Knowledge association with hyperbolic knowledge graph embeddings. In EMNLP (1), pages 5704–5716. Association for Computational Linguistics, 2020. T. Trouillon, J. Welbl, S. Riedel, É. Gaussier, and G. Bouchard. Complex embeddings for simple link prediction. In ICML, volume 48 of JMLR Workshop and Conference Proceedings, pages 2071–2080. JMLR.org, 2016. B. Yang, W. Yih, X. He, J. Gao, and L. Deng. Embedding entities and relations for learning and inference in knowledge bases. In ICLR (Poster), 2015.
|
| 452 |
+
T. Yu and C. D. Sa. Numerically accurate hyperbolic embeddings using tiling-based models. In NeurIPS, pages 2021–2031, 2019.
|
| 453 |
+
|
| 454 |
+
# Checklist
|
| 455 |
+
|
| 456 |
+
1. For all authors...
|
| 457 |
+
|
| 458 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 459 |
+
(b) Did you describe the limitations of your work? [Yes] The discussions on the limitations of our work are mainly presented in Experiments both in the paper and in Appendix.
|
| 460 |
+
(c) Did you discuss any potential negative societal impacts of your work? [No]
|
| 461 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 462 |
+
|
| 463 |
+
2. If you are including theoretical results...
|
| 464 |
+
|
| 465 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] See Section 3 and 4.
|
| 466 |
+
(b) Did you include complete proofs of all theoretical results? [Yes] See Appendix A and B.
|
| 467 |
+
|
| 468 |
+
3. If you ran experiments...
|
| 469 |
+
|
| 470 |
+
(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 proprietary for this moment. The code will be released after the the publishing of the paper.
|
| 471 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section 5.1 and Appendix D.3.
|
| 472 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No] We report the mean results over 5 running times.
|
| 473 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Appendix D.2.
|
| 474 |
+
|
| 475 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 476 |
+
|
| 477 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] See Section 5.1.1. The data are publicly available. We cite the corresponding references and give the public data links.
|
| 478 |
+
(b) Did you mention the license of the assets? [No]
|
| 479 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [No] We do not create new datasets. We sample a taxonomy from YAGO3 and will release it after the the publishing of the paper.
|
| 480 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [No]
|
| 481 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [No]
|
| 482 |
+
|
| 483 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 484 |
+
|
| 485 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 486 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 487 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/L7Irrt5sMQa/L7Irrt5sMQa.md
ADDED
|
@@ -0,0 +1,537 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# THE SURPRISING POWER OF GRAPH NEURAL NETWORKS WITH RANDOM NODE INITIALIZATION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Graph neural networks (GNNs) are effective models for representation learning on graph-structured data. However, standard GNNs are limited in their expressive power, as they cannot distinguish graphs beyond the capability of the WeisfeilerLeman (1-WL) graph isomorphism heuristic. This limitation motivated a large body of work, including higher-order GNNs, which are provably more powerful models. To date, higher-order invariant and equivariant networks are the only models with known universality results, but these results are practically hindered by prohibitive computational complexity. Thus, despite their limitations, standard GNNs are commonly used, due to their strong practical performance. In practice, GNNs have shown a promising performance when enhanced with random node initialization (RNI), where the idea is to train and run the models with randomized initial node features. In this paper, we analyze the expressive power of GNNs with RNI, and pose the following question: are GNNs with RNI more expressive than GNNs? We prove that this is indeed the case, by showing that GNNs with RNI are universal, a first such result for GNNs not relying on computationally demanding higher-order properties. We then empirically analyze the effect of RNI on GNNs, based on carefully constructed datasets. Our empirical findings support the superior performance of GNNs with RNI over standard GNNs. In fact, we demonstrate that the performance of GNNs with RNI is often comparable with or better than that of higher-order GNNs, while keeping the much lower memory requirements of standard GNNs. However, this improvement typically comes at the cost of slower model convergence. Somewhat surprisingly, we found that the convergence rate and the accuracy of the models can be improved by using only a partial random initialization regime.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Graph neural networks (GNNs) (Scarselli et al., 2009; Gori et al., 2005) are neural architectures designed for learning functions over graph-structured data, and naturally encode desirable properties such as permutation invariance (resp., equivariance) relative to graph nodes, and node-level computation based on message passing between these nodes. These properties provide GNNs with a strong inductive bias, enabling them to effectively learn and combine both local and global graph features (Battaglia et al., 2018). As a result, GNNs have been applied to a multitude of tasks, ranging from protein classification (Gilmer et al., 2017) and synthesis (You et al., 2018), protein-protein interaction (Fout et al., 2017), and social network analysis (Hamilton et al., 2017), to recommender systems (Ying et al., 2018) and combinatorial optimization (Bengio et al., 2018; Selsam et al., 2019).
|
| 12 |
+
|
| 13 |
+
However, popular GNN architectures, primarily based on message passing (MPNNs), are limited in their expressive power. In particular, MPNNs are at most as powerful as the Weisfeiler-Leman (1-WL) graph isomorphism heuristic (Morris et al., 2019; Xu et al., 2019), and thus cannot discern between several families of non-isomorphic graphs, e.g., sets of regular graphs (Cai et al., 1992). To address this limitation, alternative GNN architectures with provably higher expressive power than MPNNs have been proposed. These models, which we refer to as higher-order GNNs, are inspired by the more powerful generalization of 1-WL to $k$ −tuples of nodes, known as $k$ -WL (Grohe, 2017). These models are the only GNNs with an established universality result, but these models are computationally very demanding. As a result, MPNNs, despite their limited expressiveness, remain the standard GNN model for graph learning applications.
|
| 14 |
+
|
| 15 |
+
In a parallel development, MPNNs have recently achieved significant empirical improvements using random node initialization (RNI), through which initial graph node embeddings are randomly set. Indeed, RNI has enabled MPNNs to distinguish instances that 1-WL cannot distinguish, and is proven to enable better approximation of a class of combinatorial problems (Sato et al., 2020). However, the effect of RNI on the expressive power of GNNs has not yet been comprehensively studied, and its impact on the inductive capacity and learning ability of GNNs remains unclear.
|
| 16 |
+
|
| 17 |
+
In this paper, we thoroughly study the impact of RNI on MPNNs. First, we prove that MPNNs enhanced with RNI are universal, in the sense that they can approximate every function defined on graphs of any fixed order. This follows from a logical characterisation of the expressiveness of MPNNs (Barcelo et al., 2020) combined with an argument on order-invariant definability. Our ´ result strongly contrasts with existing 1-WL limitations for deterministic MPNNs, and provides a foundation for developing very expressive and memory-efficient MPNN models.
|
| 18 |
+
|
| 19 |
+
To empirically verify our theoretical findings, we carry out a careful empirical study to quantify the practical impact of RNI. To this end, we design EXP, a synthetic dataset requiring 2-WL expressive power for models to achieve above-random performance, and run MPNNs with RNI on it, to observe how well and how easily this model can learn and generalize based on this dataset. Then, we propose CEXP, a modification of EXP with partially 1-WL distinguishable data, and evaluate the same questions in this more variable setting. Overall, the contributions of this paper are as follows:
|
| 20 |
+
|
| 21 |
+
- We prove that MPNNs with RNI are universal, a significant improvement over the 1-WL limit of standard MPNNs and, to our knowledge, a first universality result for memory-efficient GNNs.
|
| 22 |
+
- We introduce two carefully designed datasets, EXP and CEXP, based on graph pairs only distinguishable by 2-WL or higher, to rigorously evaluate the impact of RNI.
|
| 23 |
+
- Using these datasets, we thoroughly analyze the effects of RNI on MPNN, and observe that (i) MPNNs with RNI can closely match the performance of higher-order GNNs, (ii) the improved performance of MPNNs with RNI comes at the cost of slower convergence (compared to higherorder GNNs), and (iii) using a partial random initialization regime over node features typically improves convergence rate and the accuracy of the models.
|
| 24 |
+
- We additionally perform the same experiments with analog, sparser datasets, with longer training, and observe similar behavior, but more volatility.
|
| 25 |
+
|
| 26 |
+
# 2 GRAPH NEURAL NETWORKS
|
| 27 |
+
|
| 28 |
+
Graph neural networks (GNNs) (Gori et al., 2005; Scarselli et al., 2009) are neural architectures dedicated to learning functions over graph-structured data. In a GNN, nodes in the input graph are assigned vector representations, which are updated iteratively through series of invariant or equivariant computational layers. We recall message passing neural networks (MPNNs) (Gilmer et al., 2017), a popular family of GNN models, and its expressive power in relation to the WeisfeilerLeman graph isomorphism heuristic. We discuss alternative GNN models in Section 3; for a broader coverage, we refer the reader to the literature (Hamilton, 2020).
|
| 29 |
+
|
| 30 |
+
In MPNNs, node representations aggregate messages from their neighboring nodes, and use this information to iteratively update their representations. Formally, given a node $x$ , its vector representation $v _ { x , t }$ at time $t$ , and its neighborhood $N ( x )$ , a message passing update can be written as:
|
| 31 |
+
|
| 32 |
+
$$
|
| 33 |
+
v _ { x , t + 1 } = c o m b i n e { \Big ( } v _ { x , t } , a g g r e g a t e { \big ( } \{ v _ { y , t } | y \in N ( x ) \} { \big ) } { \Big ) } ,
|
| 34 |
+
$$
|
| 35 |
+
|
| 36 |
+
where combine and aggregate are functions, and aggregate is typically permutation-invariant. Once message passing is complete, the final node representations are then used to compute target outputs. Prominent message passing GNN architectures include graph convolutional networks (GCNs) (Kipf & Welling, 2017) and gated graph neural networks (GGNNs) (Li et al., 2016).
|
| 37 |
+
|
| 38 |
+
It is well-known that standard MPNNs have the same power as the 1-dimensional Weisfeiler-Leman algorithm (1-WL) (Xu et al., 2019; Morris et al., 2019). This entails that two nodes in a graph cannot be distinguished if 1-WL does not distinguish them, and neither can two graphs be distinguished if 1-WL cannot distinguish them.
|
| 39 |
+
|
| 40 |
+
Consider the graphs $G$ and $H$ shown in Figure 1. 1-WL cannot distinguish any two nodes of the graph $G$ . Thus, for example, the invariant function $f : V ( G ) \to \mathbb { R }$ that maps all nodes in the 4-cycle of $G$ to 1 and all nodes in the triangle to 0 is not expressible (or approximable) by a GNN. Moreover, 1-WL cannot distinguish the graphs $G , H$ , even though they are obviously non-isomorphic, so no classifier based on the node embeddings computed by an MPNN can distinguish the two graphs.
|
| 41 |
+
|
| 42 |
+

|
| 43 |
+
Figure 1: $G$ and $H$ are indistinguishable by 1-WL and hence by (1-WL) GNNs.
|
| 44 |
+
|
| 45 |
+
A somewhat trivial limitation in the expressiveness of MPNNs is that information is only propagated along edges, and hence can never be shared between distinct connected components of a graph (Barcelo et al., 2020; Xu et al., 2019). An easy way to overcome this limitation is by adding ´ global readouts, that is, permutation-invariant functions that aggregate the current states of all nodes1. Throughout the paper, we therefore focus on MPNNs with global readouts (also called aggregatecombine GNNs with global readout, i.e., ACR-GNNs (Barcelo et al., 2020)). ´
|
| 46 |
+
|
| 47 |
+
# 3 RELATED WORK & MOTIVATION
|
| 48 |
+
|
| 49 |
+
Developing more expressive GNNs is an active research area due to the prominence of GNNs for relational learning (Hamilton et al., 2017) and combinatorial optimization (Bengio et al., 2018). As mentioned earlier, standard GNN models are at most as expressive as 1-WL (Morris et al., 2019; Xu et al., 2019), and thus cannot distinguish between non-isomorphic input instances. In this section, we describe theoretical results quantifying the expressive power of existing GNNs.
|
| 50 |
+
|
| 51 |
+
Higher-order GNNs. We recall the following families of higher-order GNN models:
|
| 52 |
+
|
| 53 |
+
- Invariant (resp., equivariant) graph networks: Invariant (resp., equivariant) graph networks (Maron et al., 2019b) represent graphs as a tensor where node adjacency is directly encoded, and implicitly pass information between nodes through invariant (resp., equivariant) computational blocks. Hence, these models are themselves invariant (resp., equivariant), a desirable property for computations on graphs. Following intermediate blocks, higher-order tensors are typically returned, and the order of these tensors correlates directly with the expressive power of the overall model. Indeed, invariant networks (Maron et al., 2019c), and later equivariant networks (Keriven & Peyre, 2019), are shown to be universal, but with tensor orders of ´ $\dot { O } ( | V | ^ { 2 } )$ , where $| V |$ denotes the number of graph nodes. Furthermore, invariant (resp., equivariant) networks with intermediate tensor order $k$ are shown to be equivalent in power to $\left( k - 1 \right)$ -WL (Maron et al., 2019a), which is strictly more expressive as $k$ increases (Cai et al., 1992). Therefore, such universal higher-order models require intractably-sized intermediate tensors in practice.
|
| 54 |
+
|
| 55 |
+
- Higher-order MPNNs: The $k { \mathrm { - } } \mathbf { W } \mathbf { L }$ hierarchy has been directly emulated in GNNs, such that these models learn embeddings for tuples of nodes, and perform messaging passing between them, as opposed to individual nodes. This approach has yielded models such as $k$ -GNNs (Morris et al., 2019). $k$ -GNNs have $\left( k - 1 \right)$ -WL expressive power,2 but need $O ( | V | ^ { k } )$ memory to run, leading to excessive memory requirements.
|
| 56 |
+
|
| 57 |
+
- Provably powerful graph networks (PPGNs): PPGN is an invariant GNN (Maron et al., 2019a), based on “blocks” of multilayer perceptrons (MLPs) and matrix multiplication, which theoretically has 2-WL expressive power, and only requires memory $O ( | V | ^ { 2 } )$ (compared to $O ( | V | ^ { 3 } )$ for 3-GNNs). However, PPGN theoretically requires exponentially many samples in the number of graph nodes to learn necessary functions for 2-WL expressiveness (Puny et al., 2020).
|
| 58 |
+
|
| 59 |
+
GNNs with random node initialization. MPNNs have been enhanced with random node initialization (Sato et al., 2020), such that the model trains and runs with partially randomized initial node features. These models, denoted rGNNs, are shown to near-optimally approximate solutions to specific combinatorial optimization problems, and are able to distinguish between 1-WL indistinguishable graph pairs. rGNNs can also detect characteristic sub-graphs in an input graph with high probability. Nonetheless, it remains open as to how much expressive power is exactly gained through RNI, and, in general, whether a GNN model that is universal, scalable, and structure-preserving, can be developed. Our work strongly improves the theoretical result of Sato et al. (2020), as it shows universality of MPNNs with RNI, and thus that arbitrary real-valued functions over graphs can be learned by MPNNs with the help of RNI. On the empirical side, we highlight the power of RNI in a significantly more challenging setting than rGNN, using a target function (SAT) beyond their theoretical scope. Indeed, for SAT, approximation is known to be hard, and fixed local structures are not useful for prediction.
|
| 60 |
+
|
| 61 |
+
Similar work to RNI has also been conducted in terms of randomly adding features from a predetermined set of colors (Dasoulas et al., 2020) to disambiguate between nodes. This model, known as CLIP, is similar in spirit to RNI, in that it introduces randomness to node representations, but explicitly makes graphs distinguishable by construction. By contrast, we study random features produced by RNI, which (i) are not designed a priori to distinguish nodes, (ii) do not explicitly introduce a fixed underlying structure, and (iii) yield potentially infinitely many representations for a single graph. In this more general setting, we nonetheless show that RNI adds expressive power to distinguish between nodes with high probability, leads to a universality result, and performs strongly in challenging problem settings.
|
| 62 |
+
|
| 63 |
+
# 4 RANDOM NODE INITIALIZATION MAKES GNNS UNIVERSAL
|
| 64 |
+
|
| 65 |
+
We present the main result of the paper, showing that random node initialization significantly increases the expressiveness and makes MPNNs universal, in a natural sense. Our work is a first positive result for the universality of MPNNs. This result is not based on a new model, but rather on random initialization of node features, which is widely used in practice, and in this respect, it also serves as a theoretical justification for models that are successfully employed in practice.
|
| 66 |
+
|
| 67 |
+
It may appear somewhat surprising, and even counter-intuitive, that randomly initializing node features, on its own, would deliver such a gain in expressiveness. In fact, on the surface, random initialization no longer preserves the invariance of MPNNs, since the result of the computation of an MPNN with RNI not only depends on the structure (i.e., the isomorphism type) of the input graph, but also on the random initialization. The broader picture is, however, rather subtle, as we can view such a model as computing a random variable (or as generating an output distribution), and this random variable would still be invariant. This means that the outcome of the computation of an MPNN with RNI does still not depend on the specific representation of the input graph, which fundamentally maintains invariance. Indeed, random features vary around a mean which, in expectation, will inform GNN predictions, and is identical across all nodes as randomization is i.i.d. However, the variability between different samples, and the variability of a random sample relative to this mean, enable graph discrimination and improve expressiveness. Hence, in expectation, all samples over training and evaluation fluctuate around a unique value, preserving invariance, whereas single-sample variance achieves the improved expressiveness.
|
| 68 |
+
|
| 69 |
+
Formally, let ${ \mathcal { G } } _ { n }$ be the class of all $n$ -vertex graphs, i.e., graphs that consist of at most $n$ vertices, and let $f : { \mathcal { G } } _ { n } \to \mathbb { R }$ . We say that $f$ is invariant if for isomorphic graphs $G , H \ \in \ G _ { n }$ it holds that $f ( G ) = f ( H )$ . We say that a randomized function $\mathcal { X }$ that associates with every graph $G \in \mathcal G _ { n }$ a random variable $\mathcal { X } ( G )$ is an $( \epsilon , \delta )$ -approximation of $f$ if for all $G \in \mathcal G _ { n }$ it holds that $\operatorname* { P r } \left( | f ( G ) - \mathcal { X } ( G ) | \leq \epsilon \right) \geq 1 - \delta$ . Note that MPNNs with RNI compute functions $\mathcal { X }$ of this type. If $\mathcal { X }$ is computed by an MPNN $\mathcal { N }$ with RNI, we say that $\mathcal { N } \left( \epsilon , \delta \right)$ -approximates $f$ .
|
| 70 |
+
|
| 71 |
+
Theorem 4.1 (Universal approximation). Let $n \geq 1$ , and let $f : { \mathcal { G } } _ { n } \to \mathbb { R }$ be invariant. Then, for all $\epsilon , \delta > 0$ , there is a MPNN with RNI that $( \epsilon , \delta )$ -approximates $f$ .
|
| 72 |
+
|
| 73 |
+
For ease of presentation, we state the theorem only for real-valued functions, but it can be extended to equivariant functions defined on the nodes of a graph (that is, functions $f$ mapping graphs $G$ to vectors $\pmb { x } \in \mathbb { R } ^ { V ( G ) }$ with the property that for every permutation $\pi$ of $V ( G )$ it holds that $f ( G ^ { \pi } ) = f ( G ) ^ { \pi } )$ and even higher-order equivariant functions. The result can also be extended to weighted graphs, but then the function $f$ that we approximate needs to be continuous.
|
| 74 |
+
|
| 75 |
+
To prove Theorem 4.1, we first show that MPNNs with RNI can capture arbitrary Boolean functions, by building on the result of Barcelo et al. (2020), which states that any logical sentence in ´ $\mathsf { C } ^ { 2 }$ can be captured by an MPNN with global readout. The logic $\complement$ is the extension of first-order predicate logic using counting quantifiers of the form $\exists ^ { \geq k } x$ for $k \geq 0$ , where $\exists ^ { \geq k } x \varphi ( x )$ means that there are at least $k$ elements $x$ satisfying $\varphi$ , and $\mathsf { C } ^ { 2 }$ is the two-variable fragment of $\mathrm { c }$ (see appendix for further details). We establish that any graph with identifying node features, which we call individualized graphs, can be represented by a sentence in $\mathsf { C } ^ { 2 }$ . Then, we extend this result to sets of individualized graphs, and thus to Boolean functions mapping these sets to True, by showing that these functions are represented by a $\mathsf { C } ^ { 2 }$ sentence, namely the disjunction of all constituent graph sentences. Following this, we provide a construction with node embeddings based on random node initialization, and show that, with high probability, RNI makes the input graph individualized. Thus, with high probability, RNI makes that MPNNs learn a Boolean function over individualized graphs. Since all such functions can be captured by a sentence in $\mathsf { C } ^ { 2 }$ , and an MPNN with a global readout can capture any Boolean function by Barcelo et al. (2020), we conclude that MPNNs with RNI can capture arbitrary ´ Boolean functions. Finally, the result is extended to real-valued functions via a natural mapping, yielding universality.
|
| 76 |
+
|
| 77 |
+
The concrete implications of Theorem 4.1 can be summarized as follows: First, MPNNs enhanced with RNI are able to distinguish individual graphs, already with an embedding dimensionality polynomial in the inverse of desired confidence $\delta$ , namely $O ( n ^ { 2 } \delta ^ { - 1 } )$ , where $n$ is the number of graph nodes. Second, our universality results holds also with partial RNI. More specifically, it already holds with only one randomized dimension. Third, although Theorem 4.1 can potentially result in very large constructions, we note that it is very adaptive and tightly linked to the descriptive complexity of the function that we want to approximate. That is, for a more restricted class of functions, there may be more efficient constructions, and our proof does not rely on a particular construction. This deserves a more thorough investigation, which we leave for future work. Finally, our construction provides a logical characterization of the power of MPNNs with RNI, and substantiates the means through which randomization yields expressiveness improvements. This construction therefore also serves as a basis for a more logically grounded theoretical study of randomized MPNN models, based on particular architectural or parametric choices.
|
| 78 |
+
|
| 79 |
+
Similarly to other universality results, Theorem 4.1 can potentially result in very large constructions. This is a simple consequence of the general nature of such universality results: Theorem 4.1 applies to families of functions, describing problems of arbitrary computational complexity, including problems that are computationally hard (even to approximate). Thus, a practically more relevant aspect is to empirically verify the formal statement, and test the capacity of MPNNs with RNI, in comparison to higher-order GNNs. Higher-order GNNs typically suffer from prohibitive space requirements, which is not the case for MPNNs with RNI, and this already makes them more viable in practice. As we discuss later in detail, our experiments demonstrate that MPNNs with RNI indeed combine expressiveness with efficiency in practice.
|
| 80 |
+
|
| 81 |
+
# 5 DATASETS FOR EVALUATING THE EXPRESSIVE POWER OF GNNS
|
| 82 |
+
|
| 83 |
+
GNN models are evaluated on prominent real-world datasets, such as IMDB, TU, and Proteins (Kersting et al., 2016). These datasets are not tailored for evaluating the expressive power of GNNs, as they do not contain instances or edge cases requiring expressiveness beyond 1-WL. In fact, higherorder models only marginally outperform MPNNs on these datasets (Maron et al., 2019a; Dwivedi et al., 2020), which further highlights their unsuitability for expressiveness evaluation.
|
| 84 |
+
|
| 85 |
+
We develop the datasets EXP and CEXP. EXP is designed to explicitly evaluate the expressiveness of GNN models, and consists of a set of graph instances $\left\{ { G _ { 1 } \dots { \bar { G } } _ { n } , \dot { H } _ { 1 } \dots { \cal H } _ { n } } \right\}$ , such that each instance is a graph encoding of a propositional formula. The classification task is to determine whether the formula is satisfiable (SAT). Each pair $( G _ { i } , H _ { i } )$ respects the following properties: (i) $G _ { i }$ and $H _ { i }$ are non-isomorphic, (ii) $G _ { i }$ and $H _ { i }$ have different SAT outcomes, that is, $G _ { i }$ encodes a satisfiable formula, while $H _ { i }$ encodes an unsatisfiable formula, (iii) $G _ { i }$ and $H _ { i }$ are 1-WL indistinguishable, so are guaranteed to be classified in the same way by standard MPNNs, and (iv) $G _ { i }$ and $H _ { i }$ are 2-WL distinguishable, so can be classified differently by higher-order GNNs. Thanks to these properties, we can explicitly compare the performance of MPNNs with RNI to these higher-order models.
|
| 86 |
+
|
| 87 |
+
Ensuring these properties in EXP is highly non-trivial, and the construction of this dataset is cumbersome. Fundamentally, every $( G _ { i } , H _ { i } )$ is carefully constructed on top of a basic building block, the core pair, such that the 2 cores underlie $G _ { i }$ and $H _ { i }$ , respectively. In this core pair, both cores are based on propositional clauses, such that one core is satisfiable and the other is not, and that these cores exclusively determine the satisfiability of $G _ { i }$ (resp., $H _ { i }$ ) and have graph encodings enabling all aforementioned properties. Core pairs, and their resulting graph instances in EXP are planar and are also carefully constrained to ensure they are 2-WL distinguishable. Hence, core pairs are key substructures within EXP, and distinguishing these cores is essential for good performance.
|
| 88 |
+
|
| 89 |
+
Building on EXP, CEXP includes instances with varying expressiveness requirements. Specifically, CEXP is a standard EXP dataset where $50 \%$ of all satisfiable graph pairs are modified, such that they become 1-WL distinguishable from their unsatisfiable counterparts, only differing from these by a small number of added edges. Hence, CEXP consists of $50 \%$ “corrupted” data, which can be distinguished and learned by a standard MPNN model (1-WL), which we label CORRUPT, and $50 \%$ unmodified data, generated analogously to EXP, and requiring expressive power beyond 1- WL, which we refer to as $\overline { { \mathrm { E x p } } }$ . Thus, CEXP contains the same core structures as EXP, but these now lead to different SAT values in $\overline { { \mathrm { E x P } } }$ and CORRUPT, and this makes the overall learning task more challenging than learning $\overline { { \mathrm { E x p } } }$ or CORRUPT in isolation. Complete details of the overall data generation process for both datasets can be found in the appendix.
|
| 90 |
+
|
| 91 |
+
# 6 EXPERIMENTAL EVALUATION
|
| 92 |
+
|
| 93 |
+
In this section, we first evaluate the practical effect of RNI on MPNN expressiveness based on EXP, and compare MPNN-RNI against established higher-order GNNs. We then extend our empirical analysis to CEXP. Both experiments are conducted using the following models:
|
| 94 |
+
|
| 95 |
+
- 1-WL GCN (1-GCN): A GCN with 8 distinct message passing iterations, ELU non-linearities (Clevert et al., 2016), 64-dimensional embeddings, and deterministic learnable initial node embeddings indicating node type. This model is guaranteed to achieve $50 \%$ accuracy on EXP.
|
| 96 |
+
|
| 97 |
+
- GCN - Random node initialization (GCN-RNI): An analogous model to 1-GCN with an identical architecture, enhanced with RNI. We evaluate this model with four initialization distributions, namely the standard normal distribution $\mathcal { N } ( 0 , 1 )$ (N), the uniform distribution over $[ - 1 , 1 ]$ (U), Xavier normal (XN), and the Xavier uniform distribution (XU) (Glorot & Bengio, 2010). We denote the respective models $\mathbf { G C N - R N I } ( D )$ , where $D \in \{ \mathrm { N , U , X N , X U } \}$ .
|
| 98 |
+
|
| 99 |
+
- GCN - Partial Random node initialization $( \mathbf { G C N - } x \% \mathbf { R N I } )$ : A GCN-RNI model, where only a percentage $x$ of initial node embedding dimensions are randomized. That is, for $d$ -dimensional node embeddings, GCN- $x \%$ RNI randomizes $\lfloor \frac { x d } { 1 0 0 } \rfloor$ dimensions, and sets the remaining dimensions deterministically from input features, namely, a one-hot representation of the two possible node types (literal and disjunction) in the input graph representation (see appendix for more details). We set $x$ to the extreme values 0 and $100 \%$ , $50 \%$ , as well as near-edge cases of $8 7 . 5 \%$ and $12 . 5 \%$ , respectively.
|
| 100 |
+
|
| 101 |
+
- Provably Powerful Graph Network (PPGN) (Maron et al., 2019a): A higher-order GNN with 2-WL expressive power, and which requires quadratic memory relative to the number of graph nodes. We set up PPGN with eight 400-dimensional computational blocks.
|
| 102 |
+
|
| 103 |
+
- 1-2-3-GCN-L: A higher-order GNN (Morris et al., 2019) emulating 2-WL on 3-tuples of nodes. 1-2-3-GCN-L operates at increasingly coarse node granularities, starting with single nodes and rising to 3-tuples. The model first computes all possible 3-tuples of nodes, then represents them as standard graph nodes. These nodes are connected to one another following the 2-WL neighborhood definition, i.e., tuples that exchange messages in 2-WL are connected by an edge in 3-GCN. 3-GCN-L implements a connected relaxation of 2-WL, in that only 3-tuples forming a connected graph are used, which comes at the cost of some theoretical guarantees. Nonetheless, the computation and representation of all tuples still imposes a severe overhead relative to MPNNs. We set up 1-2-3-GCN-L with 64-dimensional embeddings, 3 message passing iterations at level 1, 2 at level 2 and 8 at level 3.
|
| 104 |
+
|
| 105 |
+
- 3-GCN: A modification to 1-2-3-GCN-L, such that (i) only the 3rd level is used, and (ii) the full 2-WL procedure is implemented, i.e., all 3-tuples are computed, as in standard 2-WL, rather than only the connected ones.
|
| 106 |
+
|
| 107 |
+
6.1 EXPERIMENT 1: HOW DOES RNI IMPROVE MPNN EXPRESSIVENESS?
|
| 108 |
+
|
| 109 |
+
In this experiment, we evaluate GCNs using different RNI settings on EXP, and compare with standard GNNs and higher-order models. Specifically, we generate an EXP dataset consisting of 600 graph pairs, and discuss this generation in more detail in the appendix. Then, we evaluate all models on EXP using 10-fold cross-validation. We train 3-GCN for 100 epochs per fold, and all other systems for 500 epochs. Mean test accuracy across all validation folds is measured and reported.
|
| 110 |
+
|
| 111 |
+
Full test accuracy results for all models are reported in Table 1, and model convergence for 3-GCN and all GCN-RNI models are shown in Figure 2. In line with Theorem 4.1, GCN-RNI achieves a near-perfect performance on EXP, substantially surpassing $50 \%$ . Indeed, all fully randomized GCN-RNI models achieve a performance above $9 5 \%$ with all four RNI distributions. This finding supports observations made in related studies on RNI (Sato et al., 2020), which suggest that RNI enables (sub)structure detection beyond the theoretical limits of 1-WL. Empirically, we observed that GCN-RNI is highly sensitive to changes in learning rate, activation function, and/or randomization distribution, and required delicate tuning to achieve its best performance.
|
| 112 |
+
|
| 113 |
+
Table 1: Accuracy results on EXP.
|
| 114 |
+
|
| 115 |
+
<table><tr><td>Model</td><td>Test Accuracy (%)</td></tr><tr><td>GCN-RNI(U)</td><td>97.3 ± 2.55</td></tr><tr><td>GCN-RNI(N) GCN-RNI(XU)</td><td>98.0 ± 1.85 97.0 ± 1.43</td></tr><tr><td>GCN-RNI(XN)</td><td>96.6 ± 2.20</td></tr><tr><td>PPGN</td><td>50.0</td></tr><tr><td>1-2-3-GCN-L</td><td>50.0</td></tr><tr><td>3-GCN</td><td>99.7 ± 0.004</td></tr></table>
|
| 116 |
+
|
| 117 |
+
Surprisingly, PPGN does not achieve performance above $50 \%$ , despite being theoretically 2-WL expressive. Essentially, PPGN learns an approximation of 2-WL, based on power-sum multisymmetric polynomials (PMP), but fails to distinguish EXP graph pairs, despite extensive training. This suggests that PPGNs struggle to learn the required PMPs, and we could not improve these results, both for training and testing, with hyperparameter tuning. Furthermore, as mentioned in Section 3, PPGN requires exponentially many data samples in the size of the input graph (Puny et al., 2020) for learning. Hence, PPGN is likely struggling to discern between EXP graph pairs due to the smaller sample size and variability of the dataset. 1-2-3-GCN-L also only achieves $50 \%$ accuracy, which can be attributed to theoretical model limitations. Indeed, the local and connected algorithm drops necessary information to distinguish graph pairs, as it only considers 3-tuples of nodes that form a connected sub-graph. Thus, 1-2-3-GCN-L discards disconnected 3-tuples that crucially are where the difference between the EXP cores lies. This further highlights the difficulty of EXP instances, as even a relaxation of 2-WL costs the model the ability to achieve above-random performance. Note that 3-GCN achieves near-perfect performance, as it explicitly has the sufficient theoretical power needed for the task, irrespective of learning constraints, and must only learn appropriate injective aggregation functions for neighbor aggregation (Xu et al., 2019).
|
| 118 |
+
|
| 119 |
+

|
| 120 |
+
Figure 2: Learning curves on EXP.
|
| 121 |
+
|
| 122 |
+
In terms of model convergence, we observe that 3- GCN converges significantly faster than all GCNRNI models, for all randomization percentages. Indeed, 3-GCN only requires about 10 epochs to achieve its optimal performance, whereas GCN-RNI models all require in excess of 100 epochs. The rp Intuitively, the slower convergence of GCN-RNI can be attributed to a significantly harder learning task compared to 3- GCN: Whereas 3-GCN must learn from a deterministic set of node embeddings, and is naturally capable of discerning between dataset cores, GCN-RNI relies on RNI to discern between data points in EXP, via an artificial node ordering. This in turn implies that GCNRNI must first leverage RNI to detect structure, then subsequently learn robustness against the variability of RNI, which makes the learning task for GCN-RNI especially challenging.
|
| 123 |
+
|
| 124 |
+
Our findings suggest that RNI can practically improve the expressiveness of MPNNs, and make them competitive with higher-order models, despite being significantly less demanding computationally. Indeed, for a typical EXP instance with 50 nodes, GCN-RNI only requires 3200 parameters (using
|
| 125 |
+
|
| 126 |
+

|
| 127 |
+
Figure 3: Model convergence results for Experiment 2 on CEXP on all models.
|
| 128 |
+
|
| 129 |
+

|
| 130 |
+
(b) Learning curves for CEXP, split across EXP (/E) and CORRUPT (/C).
|
| 131 |
+
|
| 132 |
+
(a) Learning curves for all GCN-RNI models and 3-GCN on CEXP.
|
| 133 |
+
|
| 134 |
+
64-dimensional embeddings), whereas 3-GCN requires 1,254,400 parameters. Nonetheless, GCNRNI performs comparably to 3-GCN, and, unlike the latter model, can easily scale to larger instances exceeding the range used in our datasets. This increase in expressive power, however, comes at the cost of slower convergence. Even so, RNI proves to be a promising direction for building scalable yet powerful MPNNs.
|
| 135 |
+
|
| 136 |
+
# 6.2 EXPERIMENT 2: HOW DOES RNI AFFECT MPNN ON MORE VARIABLE DATASETS?
|
| 137 |
+
|
| 138 |
+
In Experiment 1, we observed that RNI practically improves the expressive power of GCNs over EXP. However, EXP is solely designed for expressiveness evaluation, and this leaves multiple questions open: How does RNI impact learning when data contains instances with varying expressiveness requirements, and how does RNI affect model generalization on more variable datasets? We experiment with CEXP to explicitly address these questions.
|
| 139 |
+
|
| 140 |
+
Analogously to Experiment 1, we generate an EXP dataset with 600 pairs of graphs. Then, we create CEXP by selecting 300 graph pairs and modifying their satisfiable graph, yielding CORRUPT. CEXP is well-suited for evaluating the efficacy of RNI more holistically, as it allows (i) the evaluation of the contribution of RNI on EXP conjointly with a second learning task on CORRUPT involving very similar core structures, and (ii) a study of the effect of different degrees of randomization on overall and subset-specific model performance.
|
| 141 |
+
|
| 142 |
+
In this experiment, we train GCN-RNI (with varying randomization degrees) and 3-GCN on CEXP, and compare their test accuracy across all cross-validation splits. For GCN-RNI models, we observe the effect of RNI on specifically learning $\overline { { \mathrm { E x p } } }$ and CORRUPT, and the interplay between these two tasks. In all experiments, we exclusively use normal distribution initialization, given its strong performance in Experiment 1.
|
| 143 |
+
|
| 144 |
+
The learning curves of all GCN-RNI and 3-GCN on CEXP are shown in Figure 3a, and the same curves for the EXP and CORRUPT subsets are shown in Figure 3b. As on EXP, we observe that 3- GCN converges very quickly, exceeding $90 \%$ test accuracy within 25 epochs on CEXP. By contrast, GCN-RNI, for all randomization levels, converges much slower, around after 200 epochs, despite the small size of input graphs ( $\mathord { \sim } 7 0$ nodes at most). Furthermore, fully randomized GCN-RNI performs worse than partly randomized GCN-RNI models, particularly on CEXP, due to its weak performance on CORRUPT, as shown in Figure 3b.
|
| 145 |
+
|
| 146 |
+
First, we observe that partial randomization can significantly improve model performance. This can clearly be seen on CEXP, in Figure 3a and Figure 3b, where GCN- $12 . 5 \%$ RNI and GCN-87.5%RNI achieve the best performance, by far outperforming GCN-RNI, which struggles on CORRUPT. This can be attributed to having a better inductive bias than a fully randomized model. Indeed, GCN$1 2 . 5 \% \mathrm { R N I }$ has mostly deterministic node embeddings, which simplifies learning over CORRUPT.
|
| 147 |
+
|
| 148 |
+
This also applies to $\mathrm { G C N - } 8 7 . 5 \% \mathrm { R N }$ I, where the number of deterministic dimensions, though small, remains sufficient for learning over CORRUPT. Both models also benefit from randomization to perform strongly on $\overline { { \mathrm { E x p } } }$ , and have sufficient randomization to perform similarly to a fully randomized GCN. GCN- $1 2 . 5 \% \mathrm { R N I }$ and $\mathrm { G C N - } 8 7 . 5 \% \mathrm { R l }$ NI effectively achieve the best of both worlds on CEXP, leveraging inductive bias from deterministic node embeddings, while harnessing the power of random embeddings to perform strongly on $\overline { { \mathrm { E x p } } }$ . This is best shown in Figure 3b, where standard GCN fails to learn $\overline { { \mathrm { E x p } } }$ , fully randomized GCN-RNI struggles to learn CORRUPT, and the semi-randomized $G C N { - } 5 0 \% \mathrm { R l }$ NI achieves perfect performance on both subsets. Overall, this is a surprising finding, as it suggests that MPNNs can perform significantly better with partial, and even small, amounts of randomization.
|
| 149 |
+
|
| 150 |
+
Second, we observe that the fully randomized GCN-RNI performs substantially worse than its partially randomized counterparts. Whereas fully randomized GCN-RNI only performs marginally worse on EXP (cf. Figure 2) than partially randomized models, this gap is very large on CEXP, primarily due to CORRUPT. This observation concurs with the earlier idea of inductive bias: Fully randomized GCN-RNI loses all node type information, which is valuable for making robust and consistent decisions, and therefore struggles to match 3-GCN and partially randomized models. Indeed, the model fails to achieve even $60 \%$ accuracy on CORRUPT, where other models are near perfect, and also relatively struggles on $\overline { { \mathrm { E x p } } }$ , only reaching $91 \%$ accuracy and converging slower.
|
| 151 |
+
|
| 152 |
+
Third, all GCN-RNI models, at all randomization levels, converge significantly slower on both datasets than 3-GCN, similarly to Experiment 1. However, an interesting phenomenon can be seen on CEXP: All GCN-RNI models hover around $55 \%$ accuracy within the first 100 epochs over CEXP (cf. Figure 3a), suggesting a struggle jointly fitting both CORRUPT and $\overline { { \mathrm { E x p } } }$ , before these models ultimately improve. This, however, is not observed with 3-GCN. Unlike on EXP, randomness is not necessarily beneficial on CEXP, as it can hurt performance on CORRUPT. Hence, RNI-enhanced models must additionally learn to isolate deterministic dimensions for CORRUPT, and randomized dimensions for EXP. These findings consolidate the earlier observations made on EXP on the impact of RNI on MPNN learning behavior, and highlight that the variability and slower learning for RNI also hinges on the variability and complexity of the input dataset.
|
| 153 |
+
|
| 154 |
+
Finally, we observe that both fully randomized GCN-RNI, and, surprisingly, 1-GCN, struggle to learn CORRUPT relative to partially randomized GCN-RNI. We can also observe that 1-GCN does not present a “struggle” phase, and begins improving consistently from the start of training. These observations can be attributed to key conceptual , but very distinct hindrances impeding both models. In the case of 1-GCN, the model is jointly trying to learn both EXP and CORRUPT, when it is proven that it cannot fit the former. This joint optimization severely hinders CORRUPT learning, as data pairs from both subsets are highly similar, and share identically generated UNSAT graphs (cf. Appendix). Hence, 1-GCN, in attempting to fit SAT graphs from both subsets, knowing it cannot distinguish EXP pairs, struggles to learn the simpler difference in CORRUPT pairs. For GCN-RNI, the model discards key type information, so must only rely on structural differences to learn CORRUPT, which impedes its convergence. All in all, this further consolidates the promise of partial RNI as a means to combine the strengths of both deterministic and random features.
|
| 155 |
+
|
| 156 |
+
Further to the earlier two experiments, we also conducted analogous experiments using sparser analogs of the datasets EXP and CEXP. In these cases, we observed similar behavior, albeit with slower convergence overall. More details on these experiments can be found in the appendix.
|
| 157 |
+
|
| 158 |
+
# 7 SUMMARY AND OUTLOOK
|
| 159 |
+
|
| 160 |
+
We studied the expressive power of MPNNs with RNI, and showed that these are universal models. We empirically evaluated this model on carefully designed datasets, and observed that RNI practically improves the learning abilities of MPNNs for challenging data, though it does slow down model convergence owing to the need to learn robustness against random variability. Our work delivers a strong theoretical result, supported by empirical evaluation and practical insights, to rigorously quantify the effect of RNI on GNNs. Somewhat surprisingly, our experiments suggest that partial randomization may be the best strategy in most practical scenarios. An important direction for future work is to theoretically study the sensitivity of RNI to model architectures and initialization distributions, to yield a more complete understanding of the benefits and limitations of RNI.
|
| 161 |
+
|
| 162 |
+
# REFERENCES
|
| 163 |
+
|
| 164 |
+
Pablo Barcelo, Egor V. Kostylev, Mika ´ el Monet, Jorge P ¨ erez, Juan L. Reutter, and Juan Pablo Silva. ´ The logical expressiveness of graph neural networks. In Proceedings of the Eighth International Conference on Learning Representations , (ICLR), 2020.
|
| 165 |
+
|
| 166 |
+
Peter W. Battaglia, Jessica B. Hamrick, Victor Bapst, Alvaro Sanchez-Gonzalez, Vin´ıcius Flores Zambaldi, Mateusz Malinowski, Andrea Tacchetti, David Raposo, Adam Santoro, Ryan Faulkner, C¸ aglar Gulc¸ehre, H. Francis Song, Andrew J. Ballard, Justin Gilmer, George E. Dahl, Ashish ¨ Vaswani, Kelsey R. Allen, Charles Nash, Victoria Langston, Chris Dyer, Nicolas Heess, Daan Wierstra, Pushmeet Kohli, Matthew Botvinick, Oriol Vinyals, Yujia Li, and Razvan Pascanu. Relational inductive biases, deep learning, and graph networks. CoRR, abs/1806.01261, 2018.
|
| 167 |
+
|
| 168 |
+
Yoshua Bengio, Andrea Lodi, and Antoine Prouvost. Machine learning for combinatorial optimization: a methodological tour d’Horizon. CoRR, abs/1811.06128, 2018.
|
| 169 |
+
|
| 170 |
+
Gunnar Brinkmann, Brendan D McKay, et al. Fast generation of planar graphs. MATCH Commun. Math. Comput. Chem, 58(2):323–357, 2007.
|
| 171 |
+
|
| 172 |
+
Jin-yi Cai, Martin Furer, and Neil Immerman. An optimal lower bound on the number of variables ¨ for graph identifications. Comb., 12(4):389–410, 1992.
|
| 173 |
+
|
| 174 |
+
Djork-Arne Clevert, Thomas Unterthiner, and Sepp Hochreiter. Fast and accurate deep network ´ learning by exponential linear units (elus). In Proceedings of the Fourth International Conference on Learning Representations (ICLR), 2016.
|
| 175 |
+
|
| 176 |
+
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.
|
| 177 |
+
|
| 178 |
+
George Dasoulas, Ludovic Dos Santos, Kevin Scaman, and Aladin Virmaux. Coloring graph neural networks for node disambiguation. In Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence, IJCAI 2020, pp. 2126–2132, 2020.
|
| 179 |
+
|
| 180 |
+
Vijay Prakash Dwivedi, Chaitanya K. Joshi, Thomas Laurent, Yoshua Bengio, and Xavier Bresson. Benchmarking graph neural networks. CoRR, abs/2003.00982, 2020.
|
| 181 |
+
|
| 182 |
+
Alex Fout, Jonathon Byrd, Basir Shariat, and Asa Ben - Hur. Protein interface prediction using graph convolutional networks. In Proccedings of the Thirtieth Annual Conference on Advances in Neural Information Processing Systems (NIPS), pp. 6530–6539, 2017.
|
| 183 |
+
|
| 184 |
+
Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. Neural message passing for quantum chemistry. In Proceedings of the Thirty-Fourth International Conference on Machine Learning (ICML), pp. 1263–1272, 2017.
|
| 185 |
+
|
| 186 |
+
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 (AISTATS), pp. 249–256, 2010.
|
| 187 |
+
|
| 188 |
+
Marco Gori, Gabriele Monfardini, and Franco Scarselli. A new model for learning in graph domains. In Proceedings of the 2005 IEEE International Joint Conference on Neural Networks (IJCNN), volume 2, pp. 729–734, 2005.
|
| 189 |
+
|
| 190 |
+
Martin Grohe. Descriptive Complexity, Canonisation, and Definable Graph Structure Theory, volume 47 of Lecture Notes in Logic. Cambridge University Press, 2017.
|
| 191 |
+
|
| 192 |
+
William L. Hamilton. Graph Representation Learning. Morgan and Claypool Publishers, 2020.
|
| 193 |
+
|
| 194 |
+
William L. Hamilton, Rex Ying, and Jure Leskovec. Representation learning on graphs: Methods and applications. IEEE Data Eng. Bull., 40(3):52–74, 2017.
|
| 195 |
+
|
| 196 |
+
Harry B Hunt III, Madhav V Marathe, Venkatesh Radhakrishnan, and Richard E Stearns. The complexity of planar counting problems. SIAM Journal on Computing, 27(4):1142–1167, 1998.
|
| 197 |
+
|
| 198 |
+
Nicolas Keriven and Gabriel Peyre. Universal invariant and equivariant graph neural networks. In ´ Proceedings of the Thirty-Second Annual Conference on Advances in Neural Information Processing Systems (NeurIPS), pp. 7090–7099, 2019.
|
| 199 |
+
|
| 200 |
+
Kristian Kersting, Nils M. Kriege, Christopher Morris, Petra Mutzel, and Marion Neumann. Benchmark data sets for graph kernels, 2016. http://graphkernels.cs.tu-dortmund.de.
|
| 201 |
+
|
| 202 |
+
Sandra Kiefer, Ilia Ponomarenko, and Pascal Schweitzer. The Weisfeiler-Leman dimension of planar graphs is at most 3. J. ACM, 66(6):44:1–44:31, 2019.
|
| 203 |
+
|
| 204 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Proceedings of the Third International Conference on Learning Representations, ICLR, 2015.
|
| 205 |
+
|
| 206 |
+
Thomas Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In Proceedings of the Fifth International Conference on Learning Representations (ICLR), 2017.
|
| 207 |
+
|
| 208 |
+
Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard Zemel. Gated graph sequence neural networks. In Proceedings of the Fourth International Conference on Learning Representations (ICLR), 2016.
|
| 209 |
+
|
| 210 |
+
Haggai Maron, Heli Ben-Hamu, Hadar Serviansky, and Yaron Lipman. Provably powerful graph networks. In Proceedings of the Thirty-Second Annual Conference on Advances in Neural Information Processing Systems (NeurIPS), pp. 2153–2164, 2019a.
|
| 211 |
+
|
| 212 |
+
Haggai Maron, Heli Ben-Hamu, Nadav Shamir, and Yaron Lipman. Invariant and equivariant graph networks. In Proceedings of the Seventh International Conference on Learning Representations (ICLR), 2019b.
|
| 213 |
+
|
| 214 |
+
Haggai Maron, Ethan Fetaya, Nimrod Segol, and Yaron Lipman. On the universality of invariant networks. In Proceedings of the Thirty-Sixth International Conference on Machine Learning, (ICML), pp. 4363–4371, 2019c.
|
| 215 |
+
|
| 216 |
+
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 Proceedings of the Thirty-Third AAAI Conference on Artificial Intelligence (AAAI), pp. 4602– 4609, 2019.
|
| 217 |
+
|
| 218 |
+
Omri Puny, Heli Ben-Hamu, and Yaron Lipman. From graph low-rank global attention to 2-FWL approximation. CoRR, abs/2006.07846, 2020.
|
| 219 |
+
|
| 220 |
+
Ryoma Sato, Makoto Yamada, and Hisashi Kashima. Random features strengthen graph neural networks. CoRR, abs/2002.03155, 2020.
|
| 221 |
+
|
| 222 |
+
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.
|
| 223 |
+
|
| 224 |
+
Daniel Selsam, Matthew Lamm, Benedikt Bunz, Percy Liang, Leonardo Leonardo de Moura, and ¨ David Dill. Learning a SAT solver from single-bit supervision. In Proceedings of the Seventh International Conference on Learning Representations (ICLR), 2019.
|
| 225 |
+
|
| 226 |
+
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In Proceedings of the Seventh International Conference on Learning Representations (ICLR), 2019.
|
| 227 |
+
|
| 228 |
+
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 Twenty-Fourth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD), pp. 974–983, 2018.
|
| 229 |
+
|
| 230 |
+
Jiaxuan You, Bowen Liu, Zhitao Ying, Vijay S. Pande, and Jure Leskovec. Graph convolutional policy network for goal-directed molecular graph generation. In Proceedings of the Thirty-First Annual Conference on Advances in Neural Information Processing Systems, (NeurIPS), pp. 6412– 6422, 2018.
|
| 231 |
+
|
| 232 |
+
# A APPENDIX
|
| 233 |
+
|
| 234 |
+
# A.1 PROPOSITIONAL LOGIC
|
| 235 |
+
|
| 236 |
+
We briefly present propositional logic, which underpins the dataset generation. Let $S$ be a (finite) set $S$ of propositional variables. A literal is defined as $v$ , or $\bar { v }$ (resp., $\neg v$ ), where $v \in S$ . A disjunction of literals is a clause. The width of a clause is defined as the number of literals it contains. A formula $\varphi$ is in conjunctive normal form $( C N F )$ if it is a conjunction of clauses. A CNF has width $k$ if it contains clauses of width at most $k$ , and is referred to as a $k$ −CNF. To illustrate, the formula $\varphi = \left( x _ { 1 } \vee { } { \neg x } _ { 3 } \right) \wedge \left( x _ { 4 } \vee x _ { 1 } \right)$ is a CNF with clauses of width 2.
|
| 237 |
+
|
| 238 |
+
An assignment $\nu : S \mapsto \{ 0 , 1 \}$ maps variables to False (0), or True (1), and satisfies $\varphi$ , which we denote by $\nu \models \varphi$ , in the usual sense, where $\vDash$ is propositional entailment. Given a propositional formula $\varphi$ , the satisfiability problem, commonly known as SAT, consists of determining whether $\varphi$ admits a satisfying assignment, and is NP-complete (Cook, 1971).
|
| 239 |
+
|
| 240 |
+
# A.2 PROOF OF THEOREM 4.1
|
| 241 |
+
|
| 242 |
+
We first prove a Boolean version of the theorem.
|
| 243 |
+
|
| 244 |
+
Lemma A.1. Let $n \geq 1$ , and let $f : { \mathcal { G } } _ { n } \to \{ 0 , 1 \}$ be an invariant Boolean function. Then, for all $\epsilon , \delta > 0$ there is a MPNN with RNI that $( \epsilon , \delta )$ -approximates $f$ .
|
| 245 |
+
|
| 246 |
+
To prove this lemma, we use a logical characterization of the expressiveness of MPNNs, which we always assume to admit global readouts. Let $\complement$ be the extension of first-order predicate logic using counting quantifiers of the form $\exists ^ { \geq k } x$ for $k \geq 0$ , where $\exists ^ { \geq k } x \varphi ( x )$ means that there are at least $k$ elements x satisfying ϕ.
|
| 247 |
+
|
| 248 |
+
For example, consider the formula
|
| 249 |
+
|
| 250 |
+
$$
|
| 251 |
+
\varphi ( x ) : = \lnot \exists ^ { \geq 3 } y \big ( E ( x , y ) \land \exists ^ { \geq 5 } z E ( y , z ) \big ) .
|
| 252 |
+
$$
|
| 253 |
+
|
| 254 |
+
This is a formula in the language of graphs; $E ( x , y )$ means that there is an edge between the nodes interpreting $x$ and $y$ . For a graph $G$ and a vertex $v \in V ( G )$ , we have $G \models \varphi ( v )$ ( $^ { 6 6 } G$ satisfies $\varphi$ if the variable $x$ is interpreted by the vertex $v '$ ”) if and only if $v$ has at most 2 neighbors in $G$ that have degree at least 5.
|
| 255 |
+
|
| 256 |
+
We will not only consider formulas in the language of graphs, but also formulas in the language of colored graphs, where in addition to the binary edge relation we also have unary relations, that is, sets of nodes, which we may view as colors of the nodes. For example, the formula
|
| 257 |
+
|
| 258 |
+
$$
|
| 259 |
+
\psi ( x ) : = \exists ^ { \geq 4 } y { \bigl ( } E ( x , y ) \land R E D ( y ) { \bigr ) }
|
| 260 |
+
$$
|
| 261 |
+
|
| 262 |
+
says that node $x$ has at least 4 red neighbors (more precisely, neighbors in the unary relation $R E D$ ). Formally, we assume we have fixed infinite list $R _ { 1 } , R _ { 2 } , \ldots$ of color symbols that we may use in our formulas. Then a colored graph is a graph together with a mapping that assigns a finite set $\rho ( v )$ of colors $R _ { i }$ to each vertex (so we allow one vertex to have more than one, but only finitely many, colors).
|
| 263 |
+
|
| 264 |
+
A sentence (of the logic $\complement$ or any other logic) is a formula without free variable. Thus a sentence expresses a property of a graph, which we can also view as a Boolean function. For a sentence $\varphi$ we denote this function by $[ [ \varphi ] ]$ . If $\varphi$ is a sentence in the language of (colored) graphs, then for every (colored) graph $G$ J we have $\mathbb { [ } \varphi ] ( G ) = 1$ if $G \models \varphi$ and $\mathbb { I } \varphi \mathbb { I } ( { \overline { { G } } } ) { \overline { { = 0 } } }$ otherwise.
|
| 265 |
+
|
| 266 |
+
It is easy to see that $\complement$ is only a syntactic extension of first order logic FO—for every C-formula there is a logically equivalent $\mathsf { F O }$ -formula. To see this, note that we can simulate $\exists ^ { \geq k } x$ by $k$ ordinary existential quantifiers: $\exists ^ { \geq k } x$ is equivalent to $\exists x _ { 1 } \dots \exists x _ { k } { \Big ( } \bigwedge _ { 1 \leq i < j \leq k } x _ { i } \neq x _ { j } \wedge \bigwedge _ { 1 \leq i \leq k } \varphi ( x _ { i } ) { \Big ) }$ . However, counting quantifiers add expressiveness if we restrict the number of variables. The $\complement$ -formula $\exists ^ { \geq k } x$ $( x = x )$ ) (saying that there are at least $k$ vertices) with just one variable is not equivalent to any FO-formula using less than $k$ variables. By ${ \mathsf { C } } ^ { k }$ we denote the fragment of $\complement$ consisting of all formulas with at most $k$ variables.
|
| 267 |
+
|
| 268 |
+
For example, the formula $\varphi ( x )$ in (A.1) is in ${ \mathsf C } ^ { 3 }$ , but not in $\mathsf { C } ^ { 2 }$ . But $\varphi ( x )$ is equivalent to the following formula $\varphi ^ { \prime } ( x )$ in $\mathsf { C } ^ { 2 }$ :
|
| 269 |
+
|
| 270 |
+
$$
|
| 271 |
+
\varphi ^ { \prime } ( x ) : = \neg \exists ^ { \geq 3 } y \big ( E ( x , y ) \land \exists ^ { \geq 5 } x E ( y , x ) \big ) .
|
| 272 |
+
$$
|
| 273 |
+
|
| 274 |
+
The fragments ${ \mathsf { C } } ^ { k }$ are interesting for us, because their expressiveness corresponds to that of $\left( k - 1 \right)$ - WL and hence to that of $k$ -GNNs. More precisely, for all $k \geq 2$ , two graphs $G$ and $H$ satisfy the same ${ \mathsf { C } } ^ { k }$ -sentences if and only if $\left( k - 1 \right)$ -WL does not distinguish them (Cai et al., 1992). By the results of (Morris et al., 2019; Xu et al., 2019) this implies, in particular, that two graphs are indistinguishable by all MPNNs if and only if they satisfy the same $\mathsf { C } ^ { 2 }$ -sentences. Barcelo et al. (2020) strengthened ´ this result and showed that every $\mathsf { C } ^ { 2 }$ -sentence can be simulated by an MPNN.
|
| 275 |
+
|
| 276 |
+
Lemma A.2 (Barcelo et al. 2020) ´ . For every $\mathsf { C } ^ { 2 }$ -sentence $\varphi$ and every $\epsilon > 0$ there is an MPNN that $\epsilon$ -approximates $[ [ \varphi ] ]$ .
|
| 277 |
+
|
| 278 |
+
Since here we are talking about deterministic MPNNs, there is no randomness involved, and we just say “ $\epsilon$ -approximates” instead of “ $\mathopen { } \mathclose \bgroup \left( \epsilon , 1 \aftergroup \egroup \right)$ -approximates”.
|
| 279 |
+
|
| 280 |
+
Lemma A.2 not only holds for sentences in the language of graphs, but also for sentences in the language of colored graphs. Let us briefly discuss the way MPNNs access such colors. We encode the colors using one-hot vectors that are part of the initial states of the nodes. For example, if we have a formula that uses color symbols among $R _ { 1 } , \ldots , R _ { k }$ , then we reserve $k$ places in the initial state $\pmb { x } _ { v } = \left( x _ { v 1 } , \dots , x _ { v \ell } \right)$ of each vertex $v$ (say, for convenience, $x _ { v 1 } , \ldots , x _ { v k } )$ and we initialize $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { v } }$ by letting $x _ { v i } = 1$ if $v$ is in $R _ { i }$ and $x _ { v i } = 0$ otherwise.
|
| 281 |
+
|
| 282 |
+
Let us call a colored graph $G$ individualized if for any two distinct vertices $v , w \in V ( G )$ the sets $\rho ( v ) , \rho ( w )$ of colors they have are distinct. Let us say that a sentence $\chi$ identifies a (colored) graph $G$ if for all (colored) graphs $H$ we have $H \models \chi$ if and only if $H$ is isomorphic to $G$ .
|
| 283 |
+
|
| 284 |
+
Lemma A.3. For every individualized colored graph $G$ there is a $\mathsf { C } ^ { 2 }$ -sentence $\chi _ { G }$ that identifies $G$
|
| 285 |
+
|
| 286 |
+
Proof. Let $G$ be an individualized graph. For every vertex $v \in V ( G )$ , let
|
| 287 |
+
|
| 288 |
+
$$
|
| 289 |
+
\alpha _ { v } ( x ) : = \bigwedge _ { R \in \rho ( v ) } R ( x ) \wedge \bigwedge _ { R \in \{ R _ { 1 } , \ldots , R _ { k } \} \setminus \rho ( x ) } \neg R ( x ) .
|
| 290 |
+
$$
|
| 291 |
+
|
| 292 |
+
Then $v$ is the unique vertex of $G$ such that $G \models \alpha _ { v } ( v )$ . For every pair $v , w \in V ( G )$ of vertices, we let
|
| 293 |
+
|
| 294 |
+
$$
|
| 295 |
+
\begin{array} { r } { \beta _ { v w } ( x , y ) : = \left\{ \begin{array} { l l } { \alpha _ { v } ( x ) \wedge \alpha _ { w } ( y ) \wedge E ( x , y ) } & { \mathrm { i f ~ } ( v , w ) \in E ( G ) , } \\ { \alpha _ { v } ( x ) \wedge \alpha _ { w } ( y ) \wedge \neg E ( x , y ) } & { \mathrm { i f ~ } ( v , w ) \not \in E ( G ) . } \end{array} \right. } \end{array}
|
| 296 |
+
$$
|
| 297 |
+
|
| 298 |
+
We let
|
| 299 |
+
|
| 300 |
+
$$
|
| 301 |
+
\chi _ { G } : = \bigwedge _ { v \in V ( G ) } \left( \exists x \alpha _ { v } ( x ) \wedge \neg \exists ^ { \geq 2 } x \alpha _ { v } ( x ) \right) \wedge \bigwedge _ { v , w \in V ( G ) } \exists x \exists y \beta _ { v w } ( x , y ) .
|
| 302 |
+
$$
|
| 303 |
+
|
| 304 |
+
It is easy to see that $\chi _ { G }$ identifies $G$ .
|
| 305 |
+
|
| 306 |
+
For $n , k \in \mathbb { N }$ , we let $\mathcal { G } _ { n , k }$ be the class of all individualized colored graphs that only use colors among $R _ { 1 } , \ldots , R _ { k }$ .
|
| 307 |
+
|
| 308 |
+
Lemma A.4. Let $h : { \mathcal { G } } _ { n , k } \to \{ 0 , 1 \}$ be an invariant Boolean function. Then there exists a $\mathsf { C } ^ { 2 }$ - sentence $\psi _ { h }$ such that for all $G \in \mathcal { G } _ { n , k }$ it holds that $[ [ \psi _ { h } ] ] ( G ) = h ( G )$ .
|
| 309 |
+
|
| 310 |
+
Proof. Let ${ \mathcal { H } } \subseteq { \mathcal { G } } _ { n , k }$ be the subset consisting of all graphs $H$ with $h ( H ) = 1$ . We let
|
| 311 |
+
|
| 312 |
+
$$
|
| 313 |
+
\psi _ { h } : = \bigvee _ { H \in \mathcal { H } } \chi _ { H } .
|
| 314 |
+
$$
|
| 315 |
+
|
| 316 |
+
We eliminate duplicates in the disjunction. Since up to isomorphism, the class $\mathcal { G } _ { n , k }$ is finite, this makes the disjunction finite and hence $\psi _ { h }$ well-defined. □
|
| 317 |
+
|
| 318 |
+
The restriction of a colored graph $G$ is the underlying plain graph, that is, the graph $G ^ { \vee }$ obtained from the colored graph $G$ by forgetting all the colors. Conversely, a colored graph $G ^ { \wedge }$ is an expansion of a plain graph $G$ if $G = ( G ^ { \wedge } ) ^ { \vee }$ .
|
| 319 |
+
|
| 320 |
+
Corollary A.1. Let $f : { \mathcal { G } } _ { n } \to \{ 0 , 1 \}$ be an invariant Boolean function. Then there exists a $\mathsf { C } ^ { 2 }$ - sentence $\varphi _ { f } ^ { \wedge }$ (in the language of colored graphs) such that for all $G \in { \mathcal { G } } _ { n , k }$ it holds that $\mathbb { [ } \psi _ { f } ^ { \wedge } ] ( G ) =$ $f ( G ^ { \vee } )$ .
|
| 321 |
+
|
| 322 |
+
Towards proving Lemma A.1, we fix an $n \geq 1$ and a $\epsilon , \delta > 0$ . We let
|
| 323 |
+
|
| 324 |
+
$$
|
| 325 |
+
c : = \left\lceil { \frac { 2 } { \delta } } \right\rceil \quad { \mathrm { a n d } } \quad k : = c ^ { 2 } \cdot n ^ { 3 }
|
| 326 |
+
$$
|
| 327 |
+
|
| 328 |
+
The technical details of the proof of Lemma A.1 and Theorem 4.1 depend on the exact choice of the random initialization and the activation functions used in the neural networks, but the idea is always the same. For simplicity, we assume that we initialize the states $\pmb { x } _ { v } = \left( x _ { v 1 } , \ldots , x _ { v \ell } \right)$ of all vertices to $( r _ { v } , 0 , \ldots , 0 )$ , where $r _ { v }$ for $v \in V ( G )$ are chosen independently uniformly at random from $[ 0 , 1 ]$ . As our activation function $\sigma$ , we choose the linearized sigmoid function defined by $\sigma ( x ) = \bar { 0 }$ for $x < 0$ , $\sigma ( x ) = x$ for $0 \leq x < 1$ , and $\sigma ( x ) = 1$ for $x \geq 1$ .
|
| 329 |
+
|
| 330 |
+
Lemma A.5. Let $r _ { 1 } , \ldots , r _ { n }$ be chosen independently uniformly at random from the interval $[ 0 , 1 ]$ . For $1 \leq i \leq n$ and $1 \leq j \leq c \cdot n ^ { 2 }$ , let
|
| 331 |
+
|
| 332 |
+
$$
|
| 333 |
+
s _ { i j } : = k \cdot r _ { i } - \left( j - 1 \right) \cdot \frac { k } { c \cdot n ^ { 2 } } .
|
| 334 |
+
$$
|
| 335 |
+
|
| 336 |
+
Then with probability greater than $1 - \delta$ , the following conditions are satisfied.
|
| 337 |
+
|
| 338 |
+
(ii) For all distinct $i , i ^ { \prime } \in \{ 1 , . . . , n \}$ there exists a $j \in \left\{ 1 , \dots , c \cdot n ^ { 2 } \right\}$ such that $\sigma ( s _ { i j } ) \neq \sigma ( s _ { i ^ { \prime } j } )$
|
| 339 |
+
|
| 340 |
+
Proof. For every $i$ , let $p _ { i } : = \lfloor r _ { i } \cdot k \rfloor$ . Since $k \cdot r _ { i }$ is uniformly random from the interval $[ 0 , k ]$ , the integer $p _ { i }$ is uniformly random from $\{ 0 , \ldots , k - 1 \}$ . Observe that $0 < \sigma ( s _ { i j } ) < 1$ only if $p _ { i } - ( j -$ $\textstyle 1 ) \cdot { \frac { k } { c \cdot n ^ { 2 } } } = 0$ (here we use the fact that $k$ is divisible by $c \cdot n ^ { 2 } .$ ). The probability that this happens is $\frac { 1 } { k }$ ⋅Thus, by the Union Bound,
|
| 341 |
+
|
| 342 |
+
$$
|
| 343 |
+
\operatorname* { P r } \left( \exists i , j : 0 < \sigma ( s _ { i j } ) < 1 \right) \leq \frac { c \cdot n ^ { 3 } } { k } .
|
| 344 |
+
$$
|
| 345 |
+
|
| 346 |
+
Now let $i , i ^ { \prime }$ be distinct and suppose that $\sigma ( s _ { i j } ) = \sigma ( s _ { i ^ { \prime } j } )$ for all $j$ . Then for all $j$ we have $s _ { i j } \leq$ $0 \iff s _ { i ^ { \prime } j } \leq 0$ and therefore $\lfloor s _ { i j } \rfloor \le 0 \iff \lfloor \stackrel { \sim } { s } _ { i ^ { \prime } j } \rfloor \le 0$ . This implies
|
| 347 |
+
|
| 348 |
+
$$
|
| 349 |
+
\forall j \in \{ 1 , \ldots , c \cdot n ^ { 2 } \} : \quad p _ { i } \leq ( j - 1 ) \cdot { \frac { k } { c \cdot n ^ { 2 } } } \Longleftrightarrow p _ { i ^ { \prime } } \leq ( j - 1 ) \cdot { \frac { k } { c \cdot n ^ { 2 } } } .
|
| 350 |
+
$$
|
| 351 |
+
|
| 352 |
+
Let $j ^ { * } \in \{ 1 , \ldots , c \cdot n ^ { 2 } \}$ such that $p _ { i } \in \left\{ \left( j ^ { * } - 1 \right) \cdot { \frac { k } { c \cdot n ^ { 2 } } } , \ldots , j ^ { * } \cdot { \frac { k } { c \cdot n ^ { 2 } } } - 1 \right\}$ . Then by (A.4) we have
|
| 353 |
+
$\begin{array} { r } { p _ { i } ^ { \prime } \in \left\{ \left( j ^ { * } - 1 \right) \cdot \frac { k } { c \cdot n ^ { 2 } } , \ldots , j ^ { * } \cdot \frac { k } { c \cdot n ^ { 2 } } - 1 \right\} } \end{array}$ . As $p _ { i ^ { \prime } }$ is independent of $p _ { i }$ and hence of $j ^ { * }$ , the probability
|
| 354 |
+
that this happens is at most $\begin{array} { r } { \frac { 1 } { k } \cdot \frac { k } { c \cdot n ^ { 2 } } = \frac { 1 } { c \cdot n ^ { 2 } } } \end{array}$ . This proves that for all distinct $i , i ^ { \prime }$ the probability that k1
|
| 355 |
+
$\sigma ( s _ { i j } ) = \sigma ( s _ { i ^ { \prime } j } )$ is at most $\textstyle { \frac { 1 } { c \cdot n ^ { 2 } } }$ . Hence, again by the Union Bound,
|
| 356 |
+
|
| 357 |
+
$$
|
| 358 |
+
\operatorname* { P r } ( \exists i \neq i ^ { \prime } \forall j : \sigma ( s _ { i j } ) = \sigma ( s _ { i ^ { \prime } j } ) ) \leq \frac { 1 } { c } .
|
| 359 |
+
$$
|
| 360 |
+
|
| 361 |
+
(A.3) and (A.5) imply that the probability that either (i) or (ii) is violated is at most
|
| 362 |
+
|
| 363 |
+
$$
|
| 364 |
+
\frac { c \cdot n ^ { 3 } } { k } + \frac { 1 } { c } \leq \frac { 2 } { c } \leq \delta .
|
| 365 |
+
$$
|
| 366 |
+
|
| 367 |
+
Proof of Lemma A.1. For given function $f : { \mathcal { G } } _ { n } \to \{ 0 , 1 \}$ , we choose the sentence $\psi _ { f } ^ { \wedge }$ according to Corollary A.1. Applying Lemma A.2 to this sentence and $\epsilon$ , we obtain an MPNN $\ddot { \mathcal { N } } _ { f }$ that on a colored graph $G \in \mathcal { G } _ { n , k }$ computes an $\epsilon$ -approximation of $f ( G ^ { \vee } )$ .
|
| 368 |
+
|
| 369 |
+
Without loss of generality, we assume that the vertex set of the input graph to our MPNN is $\{ 1 , \ldots , n \}$ . We choose $\ell$ (the dimension of the state vectors) in such a way that $\ell \geq c \cdot n ^ { 2 }$ and $\ell$ is at least as large as the dimension of the state vectors of $\mathcal { N } _ { f }$ . Recall that the state vectors are
|
| 370 |
+
|
| 371 |
+
initialized as x(0i $\pmb { x } _ { i } ^ { ( 0 ) } = ( r _ { i } , 0 , \ldots , 0 )$ for values $r _ { i }$ chosen independently uniformly at random from the interval $[ 0 , 1 ]$ .
|
| 372 |
+
|
| 373 |
+
passed) that maps x(0)i t o x( 1 )i = $\pmb { x } _ { i } ^ { ( 1 ) } = \bar { ( x _ { i 1 } ^ { ( 1 ) } , \dots , x _ { i \ell } ^ { ( 1 ) } ) }$ ly local transformation (no messages need to be with
|
| 374 |
+
|
| 375 |
+
$$
|
| 376 |
+
\begin{array} { r } { x _ { i j } ^ { ( 1 ) } = \left\{ \begin{array} { l l } { \sigma \Big ( \boldsymbol { k } \cdot \boldsymbol { r _ { i } } - \left( j - 1 \right) \cdot \frac { \boldsymbol { k } } { c \cdot n ^ { 2 } } \Big ) } & { \mathrm { f o r ~ } 1 \leq j \leq c \cdot n ^ { 2 } , } \\ { 0 } & { \mathrm { f o r ~ } c \cdot n ^ { 2 } + 1 \leq j \leq \ell . } \end{array} \right. } \end{array}
|
| 377 |
+
$$
|
| 378 |
+
|
| 379 |
+
Since we treat $k , c , n$ as constants, the mapping $\begin{array} { r } { r _ { i } \mapsto k \cdot r _ { i } - \left( j - 1 \right) \cdot \frac { k } { c \cdot n ^ { 2 } } } \end{array}$ is just a linear mapping applied to $r _ { i } = x _ { i 1 } ^ { ( 0 ) }$ .
|
| 380 |
+
|
| 381 |
+
By Lemma A.5, with probability at least $1 - \delta$ , the vectors $\pmb { x } _ { i } ^ { ( 1 ) }$ are mutually distinct $\{ 0 , 1 \}$ -vectors, which we view as encoding a coloring of the input graph with colors from $R _ { 1 } , \ldots , R _ { k }$ . Let $G ^ { \wedge }$ be the resulting colored graph. Since the vectors $\mathbf { \bar { x } } _ { i } ^ { ( 0 ) }$ are mutually distinct, $G ^ { \wedge }$ is individualized and thus in the class $\mathcal { G } _ { n , k }$ . We now apply the MPNN $\mathcal { N } _ { f }$ , and it computes a value $\epsilon$ -close to $\mathbb { } [ \psi _ { f } ^ { \wedge } ] ( G ^ { \wedge } ) =$ $f ( ( G ^ { \wedge } ) ^ { \vee } ) = f ( G )$ . □
|
| 382 |
+
|
| 383 |
+
Proof of Theorem 4.1. Let $f : { \mathcal { G } } _ { n } \to \mathbb { R }$ be invariant. Since $\mathcal { G } _ { n }$ is finite, the range $Y : = f ( { \mathcal { G } } _ { n } )$ is finite. To be precise, we have $N : = | Y | \leq | \mathcal { G } _ { n } | = 2 ^ { { \binom { n } { 2 } } }$ .
|
| 384 |
+
|
| 385 |
+
Say, $Y = \{ y _ { 1 } , \dots , y _ { N } \}$ . For $i = 1 , \ldots , N$ , let $g _ { i } : { \mathcal { G } } _ { n } \{ 0 , 1 \}$ be the Boolean function defined by
|
| 386 |
+
|
| 387 |
+
$$
|
| 388 |
+
g _ { i } ( G ) = { \left\{ \begin{array} { l l } { 1 } & { { \mathrm { i f ~ } } f ( G ) = y _ { i } , } \\ { 0 } & { { \mathrm { o t h e r w i s e . } } } \end{array} \right. }
|
| 389 |
+
$$
|
| 390 |
+
|
| 391 |
+
Note that $g _ { i }$ is invariant.
|
| 392 |
+
|
| 393 |
+
Let $\epsilon , \delta > 0$ and $\begin{array} { r } { \epsilon ^ { \prime } : = \frac { \epsilon } { \operatorname* { m a x } Y } } \end{array}$ and $\begin{array} { r } { \delta ^ { \prime } : = \frac { \delta } { N } } \end{array}$ . By Lemma A.1, for every $i \in \{ 1 , \ldots , N \}$ there is an MPNN with $\boldsymbol { \mathrm { R N I } } \mathcal { N } _ { i }$ that $( \epsilon ^ { \prime } , \delta )$ -approximates $g _ { i }$ . Putting all the ${ \mathcal { N } } _ { i }$ together, we obtain an invariant MPNN $\mathcal { N }$ that computes a function $g : { \mathcal { G } } _ { n } \to \{ 0 , 1 \} ^ { N }$ . We only need to apply the linear transformation
|
| 394 |
+
|
| 395 |
+
$$
|
| 396 |
+
\pmb { x } \mapsto \sum _ { i = 1 } ^ { N } x _ { i } \cdot y _ { i }
|
| 397 |
+
$$
|
| 398 |
+
|
| 399 |
+
to the output of $\mathcal { N }$ to obtain the desired approximation of $f$ .
|
| 400 |
+
|
| 401 |
+
Remark 1. Obviously, our construction yields MPNNs with a prohibitively large state space. In particular, this is the case for the brute force step from Boolean to general functions. We doubt that there are much more efficient approximators, after all we make no assumption whatsoever on the function $f$ .
|
| 402 |
+
|
| 403 |
+
The approximation of Boolean functions is more interesting. It may still happen that the GNNs get exponentially large in $n$ ; this seems unavoidable. However, the nice thing here is that our construction is very adaptive and tightly linked to the descriptive complexity of the function we want to approximate. This deserves a more thorough investigation, which we leave for future work.
|
| 404 |
+
|
| 405 |
+
As opposed to other universality results for GNNs, our construction needs no higher-order tensors defined on tuples of nodes, with practically infeasible space requirements on all but very small graphs. Instead, the complexity of our construction goes entirely into the dimension of the state space. The advantage of this is that we can treat this dimension as a hyperparameter that we can easily adapt and that gives us more fine-grained control over the space requirements. Our experiments show that usually in practice a small dimension already yields very powerful networks.
|
| 406 |
+
|
| 407 |
+
Remark 2. In our experiments, we found that a partial random initialization, which only assigns random values to a fraction of all node embedding vectors, often yields very good results, sometimes better than a full random initialization. There is plausibility to this from a theoretical perspective. For most graphs, we do not lose much by only initializing a small fraction of vertex embeddings, because in a few message-passing rounds GNNs can propagate the randomness and, referring our construction above, individualize the full input graph. On the other hand, we reduce the amount of noise our models have to handle when we only randomize partially.
|
| 408 |
+
|
| 409 |
+

|
| 410 |
+
Figure 4: Illustration of planar embeddings for the formulas $\varphi _ { 1 }$ and $\varphi _ { 2 }$ for $n = 2$ .
|
| 411 |
+
|
| 412 |
+
# A.3 DETAILS OF DATASET CONSTRUCTION
|
| 413 |
+
|
| 414 |
+
There is an interesting universality result for functions defined on planar graphs. It is known that 3- WL can distinguish between any pair of planar graphs (Kiefer et al., 2019). Since 4-GCNs can simulate 3-WL, this implies that functions defined on planar graphs can be approximated by 4-GCNs. This result can be extended to much wider graph classes, including all graph classes excluding a fixed graph as a minor (Grohe, 2017).
|
| 415 |
+
|
| 416 |
+
Inspired by this, we generate planar instances, and ensure that they can be distinguished by 2- WL, by carefully constraining these instances further. Hence, any GNN with 2-WL expressive power can approximate solutions to these planar instances. This, however, does not imply that these GNNs will solve EXP in practice, but only that an appropriate approximation function exists and can theoretically be learned.
|
| 417 |
+
|
| 418 |
+
# A.3.1 CONSTRUCTION OF EXP
|
| 419 |
+
|
| 420 |
+
We now explain the construction and composition of EXP. Fundamentally, EXP consists of two main components, (i) a pair of cores, which are non-isomorphic, planar, 1-WL indistinguishable, 2-WL distinguishable, and decide the satisfiability of every instance, and (ii) an additional randomly generated and satisfiable planar component, identically added to the core pair, to add variability to EXP and make learning more challenging. We first present both components, and then provide further details about graph encoding and planar embeddings.
|
| 421 |
+
|
| 422 |
+
Core pair. In EXP, a core pair consists of two CNF formulas $\varphi _ { 1 } , \varphi _ { 2 }$ , both defined using $2 n$ variables, $n \in \mathbb { N } ^ { + }$ , such that $\varphi _ { 1 }$ is unsatisfiable and $\varphi _ { 2 }$ is satisfiable, and such that their graph encodings are 1-WL indistinguishable and planar. $\varphi _ { 1 }$ and $\varphi _ { 2 }$ are constructed using two structures which we refer to as variable chains and variable bridges respectively.
|
| 423 |
+
|
| 424 |
+
A variable chain $\varphi _ { c h a i n }$ is defined over a set of $n \geq 2$ Boolean variables, and imposes that all variables be equally set. The variable chain can be defined in increasing or decreasing order over these variables. More specifically, given variables $x _ { i } , . . . , x _ { j }$ ,
|
| 425 |
+
|
| 426 |
+
$$
|
| 427 |
+
\begin{array} { r l } & { \mathrm { C h a i n } _ { \mathrm { I n c } } ( i , j ) = \displaystyle \bigwedge _ { k = i } ^ { j - 1 } ( \bar { x _ { k } } \vee x _ { i + ( k + 1 ) } \% ( j - i + 1 ) ) , \mathrm { ~ a n d } } \\ & { \mathrm { C h a i n } _ { \mathrm { I n e c } } ( i , j ) = \displaystyle \bigwedge _ { k = i } ^ { j - 1 } ( x _ { k } \vee \bar { x } _ { i + ( k + 1 ) } \% ( j - i + 1 ) ) . } \end{array}
|
| 428 |
+
$$
|
| 429 |
+
|
| 430 |
+
Additionally, a variable bridge is defined over an even number of variables $x _ { 0 } , . . . , x _ { 2 n - 1 }$ , as
|
| 431 |
+
|
| 432 |
+
$$
|
| 433 |
+
\varphi _ { b r i d g e } = \bigwedge _ { i = 0 } ^ { n - 1 } { \big ( } ( x _ { i } \vee x _ { 2 n - 1 - i } ) \wedge ( { \bar { x } } _ { i } \vee { \bar { x } } _ { 2 n - 1 - i } ) { \big ) } .
|
| 434 |
+
$$
|
| 435 |
+
|
| 436 |
+
A variable bridge makes the variables it connects forcibly have opposite values, e.g., $x _ { 0 } = \bar { x _ { 1 } }$ for $n = 1$ . We denote a variable bridge over $x _ { 0 } , . . . , x _ { 2 n - 1 }$ as Bridge $( 2 n )$ .
|
| 437 |
+
|
| 438 |
+
To get $\varphi _ { 1 }$ and $\varphi _ { 2 }$ , we define $\varphi _ { 1 }$ as a variable chain and bridge on all variables, yielding contrasting and unsatisfiable constraints. To define $\varphi _ { 2 }$ , we “cut” the chain in half, such that the first $n$ variables can differ from the latter $n$ , satisfying the bridge. The second half of the “cut” chain is then flipped to a decrementing order, which preserves the satisfiability of $\varphi _ { 2 }$ , but maintains the planarity of the resulting graph. More specifically, this yields:
|
| 439 |
+
|
| 440 |
+
$$
|
| 441 |
+
\begin{array} { r l } & { \varphi _ { 1 } = \mathbf { C h a i n } _ { \mathrm { I n c } } ( 0 , 2 n ) \wedge \mathbf { B r i d g e } ( 2 n ) , \mathrm { a n d } } \\ & { \varphi _ { 2 } = \mathbf { C h a i n } _ { \mathrm { I n c } } ( 0 , n ) \wedge \mathbf { C h a i n } _ { \mathrm { D e c } } ( n , 2 n ) \wedge \mathbf { B r i d g e } ( 2 n ) . } \end{array}
|
| 442 |
+
$$
|
| 443 |
+
|
| 444 |
+
Planar component. Following the generation of $\varphi _ { 1 }$ and $\varphi _ { 2 }$ , a disjoint satisfiable planar graph component $\varphi _ { \mathrm { p l a n a r } }$ is added. $\varphi _ { \mathrm { p l a n a r } }$ shares no variables or disjunctions with the cores, so is primarily introduced to create noise and make learning more challenging. $\varphi _ { \mathrm { p l a n a r } }$ is generated starting from random 2-connected (i.e., at least 2 edges must be removed to disconnect a component within the graph) bipartite planar graphs from the Plantri tool (Brinkmann et al., 2007), such that (i) the larger set of nodes in the graph is the variable set3, (ii) highly-connected disjunctions are split in a planaritypreserving fashion to maintain disjunction widths not exceeding 5, (iii) literal signs for variables are uniformly randomly assigned, and (iv) redundant disjunctions, if any, are removed. If this $\varphi _ { \mathrm { p l a n a r } }$ is satisfiable, then it is accepted and used. Otherwise, the formula is discarded and a new $\varphi _ { \mathrm { p l a n a r } }$ is analogously generated until a satisfiable formula is produced.
|
| 445 |
+
|
| 446 |
+
Since the core pair and $\varphi _ { \mathrm { p l a n a r } }$ are disjoint, it is easy to deduce that the graph encoding of $\varphi _ { \mathrm { p l a n a r } } \wedge \varphi _ { 1 }$ and $\varphi _ { \mathrm { p l a n a r } } \wedge \varphi _ { 2 }$ are both planar and 1-WL indistinguishable. Furthermore, $\varphi _ { \mathrm { p l a n a r } } \wedge \varphi _ { 1 }$ is satisfiable, and $\varphi _ { \mathrm { p l a n a r } } \wedge \varphi _ { 2 }$ is not. Hence, the introduction of $\varphi _ { \mathrm { p l a n a r } }$ maintains all the desirable core properties, all while making any generated EXP dataset more challenging.
|
| 447 |
+
|
| 448 |
+
The structural properties of the cores, combined with the combinatorial difficulty of SAT, make EXP a challenging dataset. For example, even minor formula changes, such as flipping a literal, can lead to a change in the SAT outcome, which enables the creation of near-identical, yet semantically different instances. Moreover, SAT is NP-complete (Cook, 1971), and remains so on planar instances (Hunt III et al., 1998). Hence, EXP is cast to be challenging, both from an expressiveness and computational perspective.
|
| 449 |
+
|
| 450 |
+
Remark 3. Intuitively, $\varphi _ { 1 }$ and $\varphi _ { 2 }$ , generated as described, can be distinguished by 2-WL, as 2-WL can detect the break in cycles resulting from the aforementioned “cut”. In other words, 2-WL can identify that the chain has been broken in between these two formulas, and thus will return distinct colourings. Hence, $\varphi _ { 1 }$ and $\varphi _ { 2 }$ can be distinguished by 3-GCNs.
|
| 451 |
+
|
| 452 |
+
Graph encoding. We use the following graph encoding, denoted by Enc: (i) Every variable is encoded by two nodes, representing its positive and negative literals, and connected by an edge, (ii) Every disjunction is represented by a node, and an edge connects a literal node to a disjunction node if the literal appears in the disjunction, and (iii) Variable and disjunction nodes are encoded with different types. We opt for this encoding, as it is commonly used in the literature (Selsam et al., 2019), and is sufficient, for the sake of our empirical evaluation, to yield planar encodings for EXP graph pairs.
|
| 453 |
+
|
| 454 |
+
Planar embeddings for core pair. We show planar embeddings for $E n c ( \varphi _ { 1 } )$ and $E n c ( \varphi _ { 2 } )$ for $n = 2$ in Figure 4, and these embeddings can naturally be extended to any $n$ . $E n c ( \varphi _ { 1 } )$ and $E n c ( \varphi _ { 2 } )$ can also be shown to be 1-WL indistinguishable. This can be observed intuitively, as node neighborhoods in both graphs are identical and very regular: all variable nodes are connected to exactly one other variable node and two disjunction nodes, and all disjunction nodes are connected to exactly two variables.
|
| 455 |
+
|
| 456 |
+
# A.3.2 CONSTRUCTION OF CEXP
|
| 457 |
+
|
| 458 |
+
Given a EXP dataset with $N$ pairs of graphs, we create CEXP by selecting $N / 2$ graph pairs and modifying them to yield CORRUPT. The unmodified graph pairs are therefore exactly identical in type to EXP instances, and we refer to these instances within CEXP as $\overline { { \mathrm { E x p } } }$ .
|
| 459 |
+
|
| 460 |
+
For every graph pair, we discard the satisfiable graph and construct a new graph from a copy of the unsatisfiable graph as follows.
|
| 461 |
+
|
| 462 |
+
1. Randomly introduce new literals to the existing disjunctions of the copy of the unsatisfiable graph, such that no redundancies are created (i.e., adding $x$ to a disjunction when $x$ or $\bar { x }$ is already present), until 3 literals are added and the formula becomes satisfiable. Literal addition is done by creating new edges in the graph between disjunction and literal nodes. To do this, disjunctions with less than 5 literals are uniformly randomly selected, and the literal to add is uniformly randomly sampled from the set of all non-redundant literals given the selected disjunction. 2. Once a satisfiable formula is reached, iterate sequentially over all added edges, and eliminate any edge whose removal does not restore unsatisfiability. This ensures that a minimal number of new edges, relative to the original unsatisfiable graph, are added.
|
| 463 |
+
|
| 464 |
+
Observe that these modifications have several interesting effects on the dataset. First, they preserve the existing UNSAT core nodes and edges, while flipping the satisfiability of their overall formulas, which makes the learning task go beyond structure identification. Second, they introduce significant new variability to the dataset, in that the planar component and cores can share edges. Finally, they make the graph pairs 1-WL distinguishable, which gives standard GNNs a chance to perform well on CORRUPT.
|
| 465 |
+
|
| 466 |
+
# A.3.3 DATASET GENERATION FOR EXPERIMENTS
|
| 467 |
+
|
| 468 |
+
To create the EXP dataset, we randomly generate 600 core pairs, where $n$ (cf. Appendix A.3) is uniformly randomly set between 2 and 4 inclusive. Then, we generate the additional planar component using Plantri, such that $5 0 0 \varphi _ { \mathrm { p l a n a r } }$ formulas are generated from 12-node planar bipartite planar graphs, and the remaining 100 from planar bipartite graphs with 15 nodes.
|
| 469 |
+
|
| 470 |
+
This generation process implies that every formula has a number of variables ranging between 10 (4 core variables when $n = 2$ plus a minimum 6 variables from the larger bipartite set during $\varphi _ { 1 }$ planar generation from 12-node graphs) and 22 variables (8 core variables for $n = 4$ plus a maximally-sized variable subset of 14 nodes for $\varphi _ { \mathrm { p l a n a r } }$ generation from 15-node graphs).
|
| 471 |
+
|
| 472 |
+
Furthermore, the number of disjunctions also ranges from 10 (8 core disjunctions for $n = 2$ plus the minimum 2 disjunctions for the case where $\varphi _ { \mathrm { p l a n a r } }$ , generated from 12-node graphs, has 10 variables and 2 disjunctions) to 30 disjunctions (16 core disjunctions for $n = 4$ plus at most 14 disjunctions for the case where $\varphi _ { \mathrm { p l a n a r } }$ , generated from 15-node graphs, initially has 8 variables and 7 disjunctions, which can at most lead to 14 final disjunctions following step (ii)).
|
| 473 |
+
|
| 474 |
+
In this subsection, we investigate the variability of GCN-RNI learning across validation folds, and do so with a representative model and dataset, namely the semi-randomized GCN$5 0 \% \mathrm { R N I }$ model and the standard EXP dataset. The standard deviation of the test accuracy of $\mathrm { G C N } { - } 5 0 \% \mathrm { F }$ RNI over EXP, across all 10 cross-validation folds relative to the number of epochs, is shown in Figure 5. From this figure, we see that standard deviation spikes sharply at the start of training, and only begins dropping after 100 epochs. This suggests that the learning behavior of $G C N { - } 5 0 \%$ RNI is quite variable, sometimes requiring few epochs to converge, and in other cases requiring a very high number of epochs. Furthermore, standard deviation converges to almost zero following 200 epochs, corresponding to the phase where all
|
| 475 |
+
|
| 476 |
+

|
| 477 |
+
Figure 5: Standard deviation of test accuracy over all 10 validation splits of GCN- $50 \%$ RNI on EXP.
|
| 478 |
+
|
| 479 |
+
validation folds have achieved near-perfect test performance. From these findings, we further confirm that RNI introduces volatility to GCN training, this time manifesting in variable convergence times across validation folds, but that this volatility does not ultimately hinder convergence and performance, as all folds eventually reach satisfactory performance within a reasonable amount of epochs, and subsequently stabilize at this level.
|
| 480 |
+
|
| 481 |
+
# A.5 ADDITIONAL EXPERIMENTS
|
| 482 |
+
|
| 483 |
+
In addition to the experiments in the main body of the paper, we additionally evaluate RNI on sparser analog datasets to EXP and CEXP, namely SPARSEEXP and SPARSECEXP. These datasets only contain $2 5 \%$ of the number of instances of their original counterparts, and are used to study the behavior and impact of RNI when data is sparse.
|
| 484 |
+
|
| 485 |
+
# A.5.1 EXPERIMENT 1 ON SPARSEEXP
|
| 486 |
+
|
| 487 |
+
In this experiment, we generate SPARSEEXP analogously to EXP, except that this dataset only consists of 150 graph pairs, i.e., 300 graphs in total. We then train 3-GCN for 200 epochs, and all other systems for 1000 epochs on SPARSEEXP, as opposed to 100 and 500 respectively for EXP, to give all evaluated models a better opportunity to compensate for the smaller dataset size. We show the learning curves for all models on SPARSEEXP, and reproduce the original figure for EXP, in Figure 6 for easier comparison.
|
| 488 |
+
|
| 489 |
+
First, we observe that all models converge slower on SPARSEEXP compared to EXP. This is not surprising, as a lower data availability makes learning a well-performing function slower and more challenging. More specifically, sparsity implies that (i) fewer weight updates are made per epoch, and (ii) these updates are of lower quality, as they are computed from a less representative and complete dataset. Nonetheless, the same relative convergence patterns between GCN-RNI models and 3-GCN are also visible in this setting, further highighting the increased convergence time required by GCN-RNI models.
|
| 490 |
+
|
| 491 |
+
We also observe that all GCN-RNI models, though also eventually converging, do so in a more volatile fashion. Indeed, GCN-RNI models suffer from the sparseness of the dataset, as this makes them more sensitive to RNI. As a result, these models require more training to effectively learn robustness against RNI values, and learn this from a smaller sample set, increasing their variability further. Moreover, the nature of SPARSEEXP makes learning more difficult, as it fully relies on RNI for MPNNs to have a chance of achieving above-random performance, and thus encourages MPNNs to fit specific RNI values. Hence, RNI introduces significant volatility and variability to training, particularly with sparser data, and requires substantial training and epochs for GCN-RNI models to effectively develop a robustness to RNI instantiations.
|
| 492 |
+
|
| 493 |
+

|
| 494 |
+
|
| 495 |
+

|
| 496 |
+
|
| 497 |
+

|
| 498 |
+
Figure 6: Model convergence results for Experiment 1 on the datasets EXP and SPARSEEXP.
|
| 499 |
+
|
| 500 |
+

|
| 501 |
+
|
| 502 |
+
(a) Learning curves for all GCN-RNI models and 3-GCN on CEXP.
|
| 503 |
+
|
| 504 |
+
(b) Learning curves for CEXP, split across EXP $\left( / \mathrm { E } \right)$ and CORRUPT (/C).
|
| 505 |
+
|
| 506 |
+

|
| 507 |
+
Figure 7: Model convergence results for Experiment 2 on CEXP and SPARSECEXP.
|
| 508 |
+
|
| 509 |
+

|
| 510 |
+
|
| 511 |
+
(c) Learning curves for all GCN-RNI models and 3-GCN on SPARSECEXP.
|
| 512 |
+
|
| 513 |
+
(d) Learning curves for SPARSECEXP, split across EXP (/E) and CORRUPT (/C).
|
| 514 |
+
|
| 515 |
+
# A.5.2 EXPERIMENT 2 ON SPARSECEXP
|
| 516 |
+
|
| 517 |
+
Analogously to Experiment 1, we generate a SPARSECEXP dataset similarly to CEXP, but only generate 150 graph pairs. Then, we select 75 graph pairs and modify them, as described in Appendix A.3.2. We report the learning curves for all models on SPARSECEXP, as well as the original curves for CEXP from the main body, in Figure 7.
|
| 518 |
+
|
| 519 |
+
Table 2: Hyper-parameter configurations for all GCN-RNIand 3-GCN experiments.
|
| 520 |
+
|
| 521 |
+
<table><tr><td>Dataset</td><td colspan="2">EXP</td><td colspan="2">CEXP</td></tr><tr><td></td><td>入</td><td>p</td><td>入</td><td>p</td></tr><tr><td>GCN</td><td>1×10-4</td><td>N/A</td><td>1×10-4</td><td>N/A</td></tr><tr><td>GCN-12.5%RNI</td><td>2×10-4</td><td>N</td><td>2×10-4</td><td>N</td></tr><tr><td>GCN-50%RNI</td><td>2×10-4</td><td>N</td><td>2×10-4</td><td>N</td></tr><tr><td>GCN-87.5%RNI</td><td>2×10-4</td><td>N</td><td>5×10-4</td><td>N</td></tr><tr><td>GCN-RNI</td><td>5×10-4</td><td>N</td><td>5×10-4</td><td>N</td></tr><tr><td>3-GCN</td><td>5×10-4</td><td>N/A</td><td>2×10-4</td><td>N/A</td></tr></table>
|
| 522 |
+
|
| 523 |
+
Table 3: Performance of GCN-RNI models on the EXP dataset with the hyperbolic tangent activation function.
|
| 524 |
+
|
| 525 |
+
<table><tr><td>Model</td><td>Testing Accuracy (%)</td></tr><tr><td>GCN-RNI(U)</td><td>92.7 ± 5.61</td></tr><tr><td>GCN-RNI(N)</td><td>96.0 ± 2.11</td></tr><tr><td>GCN-RNI(XU)</td><td>64.6 ± 19.9</td></tr><tr><td>GCN-RNI(XN)</td><td>63.0 ± 20.9</td></tr></table>
|
| 526 |
+
|
| 527 |
+
As in the previous subsection, similar behavior is observed on SPARSECEXP compared with CEXP, only differing by slower convergence in the former case. However, we note that the “struggle” phase described in the main paper, which only occurs during the first 100 epochs over CEXP, lasts for around 500 epochs on SPARSEEXP. Intuitively, this “struggle” phenomenon is due to conflicting learning requirements, stemming from CORRUPT and EXP, which effectively require models to “isolate” deterministic dimensions for CORRUPT, and other randomized dimensions for $\overline { { \mathrm { E x p } } }$ . This in itself is already challenging on CEXP, but is made even more difficult on SPARSECEXP due to its sparsity. Indeed, sparsity makes that further samples are needed in expectation to find a reasonable solution, leading to a lengthy “struggle” phase, in which both CORRUPT and $\overline { { \mathrm { E x p } } }$ data points conflict with one another during optimization.
|
| 528 |
+
|
| 529 |
+
# A.6 HYPER-PARAMETER DETAILS
|
| 530 |
+
|
| 531 |
+
All GCN models with (partially or completely) deterministic initial node embeddings map a 2- dimensional one-hot encoding of node type (literal or disjunction) to a $k$ -dimensional embedding space, where $k$ corresponds to the dimensionality of the deterministic embeddings. Furthermore, the final prediction for every graph is computed by aggregating all node embeddings following message passing using the max function, and then passing the result through a multi-layer perceptron of 3 layers with dimensionality $x$ , 32 and 2 respectively, where $x$ is the embedding dimensionality used in the given model. The activation function for the first two MLP layers is the ELU function (Clevert et al., 2016), and the softmax function is used to make a final prediction at the final MLP layer.
|
| 532 |
+
|
| 533 |
+
All neural networks in this work are optimized using the Adam optimizer (Kingma & Ba, 2015). All training is conducted with a fixed learning rate $\lambda$ , for fairer comparison between all models. Initially, decaying learning rates were used, but these were discarded, as they yielded sub-optimal convergence for all GCN-RNI models. Finally, all experiments were run on a V100 GPU. Detailed hyper-parameters, namely learning rate $\lambda$ and RNI distribution $p$ , per model on every evaluation dataset are shown in Table 2.
|
| 534 |
+
|
| 535 |
+
# A.6.1 RESULTS FOR GCN-RNI WITH HYPERBOLIC TANGENT ACTIVATION
|
| 536 |
+
|
| 537 |
+
In addition to experimenting with the RNI probability distribution, we also experimented with different activation functions for the GCN message passing iterations. Results are shown in Table 3. Performance with tanh is significantly more variable across distributions than ELU, which shows that RNI can be highly sensitive to practical choices of hyper-parameters.
|
md/train/Ov_sMNau-PF/Ov_sMNau-PF.md
ADDED
|
@@ -0,0 +1,331 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SEMANTIC RE-TUNING WITH CONTRASTIVE TENSION
|
| 2 |
+
|
| 3 |
+
Fredrik Carlsson∗ Evangelia Gogoulou Erik Ylipa¨ a¨ Amaru Cuba Gyllensten Magnus Sahlgren RISE - NLU Group {firstname.lastname}@ri.se
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Extracting semantically useful natural language sentence representations from pre-trained deep neural networks such as Transformers remains a challenge. We first demonstrate that pre-training objectives impose a significant task bias onto the final layers of models, with a layer-wise survey of the Semantic Textual Similarity (STS) correlations for multiple common Transformer language models. We then propose a new self-supervised method called Contrastive Tension (CT) to counter such biases. CT frames the training objective as a noise-contrastive task between the final layer representations of two independent models, in turn making the final layer representations suitable for feature extraction. Results from multiple common unsupervised and supervised STS tasks indicate that CT outperforms previous State Of The Art (SOTA), and when combining CT with supervised data we improve upon previous SOTA results with large margins.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Representation learning concerns the pursuit of automatically learning representations of data that are useful for future extraction of information (Bengio et al., 2013). Recent work has predominantly been focused on training and extracting such representations from various deep neural architectures. However, as these deep models are mostly trained via error minimization of an objective function applied to the final layers (Rumelhart et al., 1988), features residing in layers close to the objective function will be task-specific Yosinski et al. (2014). Therefore, to reduce the representation’s bias towards the objective function it is common to discard one or several of the final layers, or alternatively consider features of other intermediate layers, as with AutoEncoders (Rumelhart et al., 1986).
|
| 12 |
+
|
| 13 |
+
One domain where this issue is particularly striking is learning semantic sentence embeddings with deep Transformer networks (Vaswani et al., 2017) pre-trained towards some language modeling task. Although utilizing pre-trained Transformer models such as BERT, XLnet, ELECTRA and GPT-2(Devlin et al., 2019; Yang et al., 2019; Clark et al., 2020; Brown et al., 2020) has become the dominant approach within the field of Natural Language Processing (NLP), with current State Of The Art (SOTA) results in basically all NLP tasks belonging to fine-tuned versions of such models, it has been shown that simply extracting features from the layers of such models does not produce competitive sentence embeddings (Reimers & Gurevych, 2019; Liu et al., 2019a). Our interpretation of this phenomenon, which we will demonstrate in this paper, is that the currently used language modeling objectives enforce a task-bias at the final layers of the Transformer, and that this bias is not beneficial for the learning of semantic sentence representations.
|
| 14 |
+
|
| 15 |
+
Reimers & Gurevych (2019) propose to solve this by pooling a fixed size sentence embedding from the final Transformer layer and fine-tune towards a Natural Language Inference (NLI) task, an approach that when applied to Transformers is known as Sentence-BERT (or S-BERT in short). While Hill et al. (2016a) empirically show that fine-tuning language models towards NLI data yields good results on Semantic Textual Similarity (STS), there exists no convincing argument for why NLI is preferred over other tasks. Hence, it is unclear whether the impressive improvements of S-BERT are to be mainly attributed to the NLI task itself, or if this merely trains the model to output sentence embeddings, in turn exposing the semantics learned during pre-training. Since NLI requires labeled data, it would be highly valuable if an alternative method that requires no such labels was possible.
|
| 16 |
+
|
| 17 |
+
We therefore propose a fully self-supervised training objective that aims to remove the bias posed by the pre-training objective and to encourage the model to output semantically useful sentence representations. Our method trains two separate language models on the task of maximizing the dot product between the two models’ representations for identical sentences, and minimizing the dot product between the models’ representations for different sentences. When applied to pre-trained BERT models, our method achieves SOTA results for multiple unsupervised STS tasks, and when applied to the S-BERT model it outperforms previous SOTA by a clear margin. To further bolster the robustness of our method, we demonstrate that CT drastically improves STS scores for various models, across multiple languages.
|
| 18 |
+
|
| 19 |
+
Additionally, we contribute with a layer-wise STS survey for the most common Transformer-based language models, in which we find great variability in performance between different architectures and pre-training objectives. Finally, by introducing an alteration to the supervised regression task of S-BERT, we are able to improve upon the supervised STS embedding results for all tested models. In summary, the main contributions of our paper are as follows:
|
| 20 |
+
|
| 21 |
+
1. A novel self-supervised approach for learning sentence embeddings from pre-trained language models.
|
| 22 |
+
2. Analytical results of the layer-wise STS performance for commonly used language models.
|
| 23 |
+
3. An improvement to the supervised regression task of S-BERT that yields a higher performance for all tested models.
|
| 24 |
+
|
| 25 |
+
Code and models is available at Github.com/FreddeFrallan/Contrastive-Tension
|
| 26 |
+
|
| 27 |
+
# 2 RELATED WORK
|
| 28 |
+
|
| 29 |
+
Where earlier work for learning sentence embeddings focused on the composition of pre-trained word embeddings (Le & Mikolov (2014); Wieting et al. (2015); Arora et al. (2016)), recent work has instead favored extracting features from deep neural networks. The training methods of such networks can be divided into supervised and self-supervised. A systematic comparison of preTransformer sentence embedding methods is available in the works of Hill et al. (2016b).
|
| 30 |
+
|
| 31 |
+
Self-supervised methods typically rely on the assumption that sentences sharing similar adjacent sentences, have similar meaning. Utilizing this assumption, Kiros et al. (2015) introduced SkipThoughts that trains an encoder-decoder to reconstruct surrounding sentences from an encoded passage. Logeswaran & Lee (2018) proposed QuickThoughts that instead frames the training objective as a sentence context classification task. Recently, and still under peer-review, Giorgi et al. (2020) proposed DeCLUTR that uses a setup similar to QuickThoughts, but allow positive sentences to be overlapping or subsuming (one being a subsequence of the other), which further improves results.
|
| 32 |
+
|
| 33 |
+
Supervised methods utilize labeled datasets to introduce a semantic learning signal. As the amount of explicitly labeled STS data is very limited, supervised methods often rely on various proxy tasks where more labeled data is available. Conneau et al. (2017) introduced InferSent that learns sentence embeddings via a siamese BiLSTM trained on NLI data. The Universal Sentence Encoder (USE) of Cer et al. (2018) is a Transformer encoder trained with both unlabeled data and labeled NLI data. S-BERT by Reimers & Gurevych (2019) adopts the training objective of InferSent but instead applies pre-trained BERT models. Finally, Wang & Kuo (2020) recently proposed S-BERT-WK, an extension to S-BERT that further increases the performance by subspace analysis of the model’s layer-wise word features.
|
| 34 |
+
|
| 35 |
+
Recently, Grill et al. (2020) introduced the self-supervised BYOL framework that attain useful image representations, comparable with previous supervised methods. Although their method also utilizes two untied dual networks, the main training objective and the underlying motivation for this differ greatly. Where BYOL train using solely positive samples generated via data augmentation, our method mainly aims to dissipate negative examples and relies on two networks in order to stabilize the training process. To the best of our knowledge, our work is the first that suggests learning sentence representations by removing the bias imposed from the pre-training objective.
|
| 36 |
+
|
| 37 |
+
# 3 LAYER-WISE STUDY OF TRANSFORMER MODELS
|
| 38 |
+
|
| 39 |
+
Previous work analyzing the downstream applicability of layer-wise features in Transformer model reports similar trends of performance increasing until the middle layers before decreasing towards the final layers. Merchant et al. (2020) found the best suited features for linguistic tasks such as entity typing and relation classification reside in the intermediate layers of BERT, and Chen et al. (2020) found the most useful representations for image classification in the intermediate layers of Image-GPT.
|
| 40 |
+
|
| 41 |
+
We contribute with a layer-wise study of the semantic quality of the sentence representations found in a selected number of common Transformer architectures. Following the approach of S-BERT, we generate sentence embeddings by mean pooling over the word-piece features of a given layer. These sentence embeddings are directly evaluated towards the STS-b test (Cer et al., 2017), without any additional training, from which we report the Spearman correlation between the cosine similarity of the embeddings and the manually collected similarity scores. The test partition of the dataset contains 1,379 sentence pairs, with decimal human similarity scores ranging from 0.0 (two sentences having completely different meanings) to 5.0 (two sentences have identical meaning).
|
| 42 |
+
|
| 43 |
+
Figure 1 shows the results for BERT, Electra, XLNet and GPT-2, with results for additional models in appendix B.4. Although the different models display different layer-wise patterns, a common theme is that it is not obvious where to extract features for semantic sentence embeddings; the worst-performing representations are often found in the layers close to the objective function, with the exception of RoBerta base (Liu et al., 2019b). Considering the discrepancy between BERT and Electra which share an almost identical architecture but differ drastically in their pre-training objectives, it is clear that the semantic quality of a model’s sentence representations is heavily impacted by the choice of pre-training objective.
|
| 44 |
+
|
| 45 |
+

|
| 46 |
+
Figure 1: Layer-wise unsupervised STS performance on the STS-b test set. $\mathrm { X }$ -axis denotes the layers of the depicted model and the Y-axis denotes the Spearman correlation $( \mathrm { x } 1 0 0 )$ . Color is a redundant indicator of the Spearman correlation and the value 50 is included for visual comparison.
|
| 47 |
+
|
| 48 |
+
# 4 METHOD
|
| 49 |
+
|
| 50 |
+
To counter the negative trend found in Section 3, where the lacking STS performance of the sentence representations in the final layers became apparent, we define a training objective meant to encourage the model to retain a semantically distinguishable sentence representation until the final layer. We name this method Contrastive Tension (CT), where two independent models, with identically initialized weights, are set to maximise the dot product between their sentence representations for identical sentences, and minimize the dot product for their sentence representations of differing sentences. Hence, the CT objective is defined as:
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
\begin{array} { r } { z = f _ { 1 } ( s _ { 1 } ) ^ { T } \cdot f _ { 2 } ( s _ { 2 } ) } \\ { \mathscr { L } ( z , s _ { 1 } , s _ { 2 } ) = \left\{ \begin{array} { l l } { - l o g \sigma ( z ) } & { \mathrm { i f } s _ { 1 } = s _ { 2 } } \\ { - l o g \sigma ( 1 - z ) } & { \mathrm { i f } s _ { 1 } \neq s _ { 2 } } \end{array} \right. } \end{array}
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
Where $f _ { 1 }$ and $f _ { 2 }$ are two independently parameterized models that given a sentence $s$ produces a fixed size vector representation and where $\sigma$ refers to the Logistic function.
|
| 57 |
+
|
| 58 |
+
Following the works of Reimers & Gurevych (2019), we generate fixed size sentence representations by mean pooling over the features in the final layer of pre-trained transformer models. Training data is randomly generated from a given corpus, where for each randomly selected sentence $s$ , $K$ negative sentences are sampled to generate $K + 1$ training samples by pairing $s$ with the negative sentences and copying $s$ into an identical sentence pair. This yields one positive training sample and $K$ negative training samples. We include the $K + 1$ training samples in the same batch and always use $f _ { 2 }$ to embed the $K$ negative sentences (See Appendix A.1 for a visual example). Our approach for generating negative samples is based on the assumption that two randomly selected sentences are very likely to be semantically dissimilar.
|
| 59 |
+
|
| 60 |
+
As the models are initialized with identical weights, the CT objective creates a tension between having the two models retain similar representations for identical sentences, at the same time as the two models are encouraged to distinguish their representations for differing sentences. Our intuition is that this creates a training dynamic where the two models acts as smooth anchors to each other, where the tension to remain synchronized mitigates the downsides of simply distancing the embeddings of differing sentences. This makes CT a nondestructive method for distinguishing the sentence embeddings of non semantically similar sentences.
|
| 61 |
+
|
| 62 |
+
# 5 EXPERIMENTS
|
| 63 |
+
|
| 64 |
+
Unless stated otherwise, the following set of hyperparameters is applied when using CT throughout all experiments: Training data is randomly sampled from English Wikipedia (See Appendix C.2), where we collect $K = 7$ negative sentence pairs for each positive sentence pair. The batch size is set to 16, which results in every batch having 2 positive sentence pairs and 14 negative sentence pairs. We apply an RMSProp optimizer (Hinton, 2012) with a fixed learning rate schedule that decreases from $\bar { 1 { e } } ^ { \bar { - } 5 }$ to $2 e ^ { - 6 }$ (Appendix A.3). To showcase the robustness and unsupervised applicability of CT, we strictly perform 50,000 update steps before evaluating, and for all unsupervised tasks we report results for the worst-performing of the two models used in the CT setup. The experiment section follows the model naming convention elaborated upon in A.2, which describes the order and what training objectives that has been applied to a model.
|
| 65 |
+
|
| 66 |
+
There exists a clear discrepancy between previously reported STS scores for various methods and models. To improve upon this state of confusion we perform all evaluation with the SentEval package (Conneau & Kiela, 2018), to which we provide code and models for full reproducability of all tested methods. A Discussion regarding our experience with trying to reproduce previous work is available in Appendix A.4. A comprehensive list of all used model checkpoints is available in Appendix C.1
|
| 67 |
+
|
| 68 |
+
Table 1: Pearson and Spearman correlation (x100) on various unsupervised semantic textual similarity tasks.
|
| 69 |
+
|
| 70 |
+
<table><tr><td></td><td>STS12</td><td>STS13</td><td>STS14</td><td>STS15</td><td>STS16</td><td>Avg.</td></tr><tr><td>InferSent-GloVe</td><td>56.39/57.27</td><td>56.02/55.22</td><td>65.53/63.41</td><td>67.79/69.02</td><td>64.10/65.09</td><td>62.00/62.00</td></tr><tr><td>USE v4</td><td>67.37 / 65,56</td><td>67.11/67.95 58.24/59.83</td><td>74.32 /71.48 63.00/60.42</td><td>80.03/80.82 67.33/67.81</td><td>77.79/78.74 67.22/69.01</td><td>73.32/72.91 61.96/62.64</td></tr><tr><td>BERT-Distil BERT-Base</td><td>54.03/56.15 46.88 / 50.07</td><td>52.77 /52.91</td><td>57.15 / 54.91</td><td>63.47 / 63.37</td><td>64.51 / 64.96</td><td>56.96 /57.24</td></tr><tr><td>BERT-Large</td><td>42.59 /49.01</td><td>47.35/50.88</td><td>49.31/49.69</td><td>55.56/56.79</td><td>60.43 /61.41</td><td>51.05 / 53.56</td></tr><tr><td>S-BERT-Distil</td><td>64.07/63.06</td><td>66.42/68.31</td><td>72.29/72.23</td><td></td><td></td><td></td></tr><tr><td>S-BERT-Base</td><td>66.61/63.80</td><td>67.54 / 69.34</td><td>73.22/72.94</td><td>74.44/75.09</td><td>71.17/73.86 70.16/73.27</td><td>69.68/70.51</td></tr><tr><td>S-BERT-Large</td><td>66.90 /66.85</td><td>69.42 /71.46</td><td>74.20 /74.31</td><td>74.34 /75.16</td><td></td><td>70.37 / 70.90</td></tr><tr><td>S-BERT-Base-WK</td><td></td><td></td><td></td><td>77.26/78.26</td><td>72.82 /75.12</td><td>72.12 / 73.20</td></tr><tr><td>S-BERT-Large-WK</td><td>70.23/68.26</td><td>68.13/68.82 47.95 /78.94</td><td>75.46/74.26</td><td>76.94 /77.54</td><td>74.51/76.97</td><td>73.05/73.17</td></tr><tr><td>OurContributions</td><td>56.51 / 55.82</td><td></td><td>56.46 / 55.61</td><td>63.41/ 64.14</td><td>57.84/59.42</td><td>56.43 / 56.79</td></tr><tr><td>BERT-Distil-CT</td><td>67.27/66.92</td><td>71.31/72.41</td><td></td><td></td><td></td><td></td></tr><tr><td>BERT-Base-CT</td><td></td><td></td><td>75.68/72.72</td><td>77.73/78.26</td><td>77.17/78.60</td><td>73.83/73.78</td></tr><tr><td>BERT-Large-CT</td><td>67.19 /66.86 69.63 / 69.50</td><td>70.77 /70.91 75.79 /75.97</td><td>75.64 /72.37</td><td>77.86 /78.55</td><td>76.65 /77.78</td><td>73.62 /73.29</td></tr><tr><td>S-BERT-Distil-CT</td><td>69.39/68.38</td><td>74.83/75.15</td><td>77.15 /74.22 78.04/75.94</td><td>78.28 /78.83</td><td>77.70 / 78.92</td><td>75.71/75.49</td></tr><tr><td>S-BERT-Base-CT</td><td>68.58 /68.80</td><td>73.61/74.58</td><td>78.15 /76.62</td><td>78.98/80.06 78.60 /79.72</td><td>74.91/77.57 75.01/77.14</td><td>75.23/75.42</td></tr><tr><td>S-BERT-Large-CT</td><td>71.70 / 69.80</td><td>73.95 / 75.45</td><td>78.10 / 76.47</td><td>80.39 / 81.34</td><td>75.93 /78.11</td><td>74.79 /75.37</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>76.01 / 76.23</td></tr></table>
|
| 71 |
+
|
| 72 |
+

|
| 73 |
+
Figure 2: Layer-Wise STS performance on the STS-b test set throughout training with CT. $\mathrm { X }$ -axis depicts the layers of the model, Y-Axis depicts the Spearman correlation $( \mathrm { x } 1 0 0 )$ and the $\mathsf { Z }$ -Axis depicts the progression of time. Color is a redundant indicator of the Spearman correlation.
|
| 74 |
+
|
| 75 |
+
# 5.1 UNSUPERVISED STS
|
| 76 |
+
|
| 77 |
+
Table 1 shows the results for CT when evaluated on the unsupervised English STS tasks of Agirre et al. (2012; 2013; 2014; 2015; 2016). The non-fine-tuned BERT models perform the worst out of all considered models, with a decrease in performance as the size of the BERT models increase. CT clearly improves the results for all BERT based models and outperforms previous methods. When CT is applied to the supervised S-BERT models, it sets a new SOTA with a large margin (3.03 Spearman Points). Applying CT to BERT-Distil and S-BERT-Distil produces models that outperform S-BERT-Large while having $8 1 \%$ fewer parameters.
|
| 78 |
+
|
| 79 |
+
To further investigate the training dynamic of CT, we record the layer-wise STS performance for BERT and XLNet throughout the CT training process, by unsupervised evaluation on the STS-b test set. Figure 2 depicts the observed progression trends, and although the STS performance of the models’ final layers differs greatly before fine-tuning, with XLNet showing drastically worse performance, both models clearly benefit from the CT training task. For both models, CT mainly affects the STS performance for the latter layers, as is to be expected from the low learning rate.
|
| 80 |
+
|
| 81 |
+
# 5.2 SUPERVISED STS
|
| 82 |
+
|
| 83 |
+
Reimers & Gurevych (2019) proposed an supervised STS regression task which directly targets the cosine similarity between sentence embeddings, creating regression labels by linearly mapping the human similarity scores to the range $[ 0 , 1 ]$ . However, as evaluation of STS related tasks uses the Pearson and Spearman correlation the range to which the cosine similarity labels are linearly mapped to is arbitrary. Hence, we propose to first investigate the spread within the models embedding space to find a model specific linear mapping of the regression labels that imposes less change to the current embedding space.
|
| 84 |
+
|
| 85 |
+
We investigate the STS spread of a model’s embedding space by dividing the STS-b training data by their labels into 20 buckets, and measuring the mean cosine similarity between the sentence pairs within each respective bucket. As the STS-b data is labeled in the range [0, 5], each bucket covers a range of $5 / \bar { 2 } 0 = 0 . 2 5$ . Thus the lowest bucket contains all training samples with labels between $[ 0 , 0 . 2 5 ]$ and the next bucket covers the range (0.25, 0.5]. The STS spread results for BERT and S-BERT before and after CT is available in Figure 3. We find that BERT produces sentence embeddings with high cosine similarity for all sentence pairs. Both CT and S-BERT improve the STS performance by decreasing the mean similarity for non-similar sentence pairs, but S-BERT does this with less precision.
|
| 86 |
+
|
| 87 |
+
After attaining prior knowledge about the model’s sentence embedding space, we fine-tune towards the STS-b training data using the S-BERT regression setup, but with model specific regression labels. The cosine similarity labels are linearly mapped to the range $[ M , 1 ]$ , where $M$ is the mean cosine similarity of the lowest bucket. For each model and label scheme we perform 10 training runs for 8 epochs. Table 2 shows the test results of the model that performed best on the validation set.
|
| 88 |
+
|
| 89 |
+
We see a clear increase in performance for all models when utilizing the model specific regression labels. However, we find no significant increase in the supervised results when applying either CT, SBERT, or a combination of the two prior to the supervised fine-tuning. As discussed in Appendix A.4 we failed to reproduce the results of Reimers & Gurevych (2019), which reports a mean Spearman correlation of S-BERT-Base: 85.35 and S-BERT-Large: 86.10, after training for 2 epochs.
|
| 90 |
+
|
| 91 |
+
Table 2: Pearson and Spearman correlation $( \mathbf { x } 1 0 0 )$ on the STS-b test set.
|
| 92 |
+
|
| 93 |
+
<table><tr><td colspan="2">Nottrained forSTS</td><td colspan="3">TrainedwithSTS-bdata</td></tr><tr><td colspan="2"></td><td>Regression Labels</td><td>[0,1]</td><td>[M, 1]</td></tr><tr><td>BERT-Base</td><td>47.91/47.29</td><td>BERT-Distil</td><td>84.07 /84.23</td><td>85.02/85.54</td></tr><tr><td>InferSent-GloVe</td><td>65.30 / 63.21</td><td>BERT-Base</td><td>85.28 /84.99</td><td>85.11 / 85.64</td></tr><tr><td>USE v4</td><td>78.73 /77.09</td><td>BERT-Large</td><td>85.54 /85.37</td><td>85.90 /86.35</td></tr><tr><td>S-BERT-Distil</td><td>73.88/76.19</td><td>S-BERT-Distil</td><td>84.22/84.26</td><td>85.40/85.64</td></tr><tr><td>S-BERT-Base</td><td>74.15 /76.98</td><td>S-BERT-Base</td><td>85.17 /84.90</td><td>85.59 / 85.81</td></tr><tr><td>S-BERT-Large</td><td>76.16 /79.19</td><td>S-BERT-Large</td><td>85.14 /85.07</td><td>85.25 /86.28</td></tr><tr><td colspan="3">Ourcontributions</td><td></td><td></td></tr><tr><td>BERT-Distil-CT</td><td>79.00/78.56</td><td>BERT-Distil-CT</td><td>84.14/ 84.19</td><td>85.32/85.82</td></tr><tr><td>BERT-Base-CT</td><td>77.87 /76.32</td><td>BERT-Base-CT</td><td>85.13 /84.92</td><td>85.76 /85.89</td></tr><tr><td>BERT-Large-CT</td><td>79.97 /78.99</td><td>BERT-Large-CT</td><td>85.20 /84.97</td><td>86.37 / 85.89</td></tr><tr><td>S-BERT-Base-CT</td><td>76.25/ 80.11</td><td>S-BERT-Distil-CT</td><td>80.09/84.27</td><td>85.61/85.80</td></tr><tr><td>S-BERT-Base-CT</td><td>78.83 /81.24</td><td>S-BERT-Base-CT</td><td>85.26/85.20</td><td>85.72 /85.95</td></tr><tr><td>S-BERT-Large-CT</td><td>80.99 /82.14</td><td>S-BERT-Large-CT</td><td>85.36 /85.16</td><td>86.09 /86.43</td></tr></table>
|
| 94 |
+
|
| 95 |
+

|
| 96 |
+
Figure 3: Predicted similarities for sentence pairs in the STS-b training set. Sentence pairs are chunked into 20 buckets by their labels, each bucket covering a label range of 0.25. Opaque line denotes the mean and the transparent area denotes the standard deviation.
|
| 97 |
+
|
| 98 |
+
# 5.3 MULTILINGUAL STS
|
| 99 |
+
|
| 100 |
+
Table 3: Pearson / Spearman correlation $( \mathrm { x } 1 0 0 )$ on the STS test sets of various languages.
|
| 101 |
+
|
| 102 |
+
<table><tr><td></td><td>Arabic</td><td>English</td><td>Russian</td><td>Spanish</td><td>Swedish</td></tr><tr><td>Native BERT Multilingual BERT</td><td>37.92 /45.21 48.93 / 50.56</td><td>47.91/47.29 56.98 / 55.97</td><td>64.34/ 65.75 67.70 / 68.59</td><td>67.41/ 69.19 63.35 / 66.96</td><td>41.90/44.91 47.02 /47.49</td></tr><tr><td>XLMR Our Contributions</td><td>46.64 / 44.76</td><td>40.54 / 40.35</td><td>60.93 / 61.28</td><td>57.30 / 59.31</td><td>42.16 /42.03</td></tr><tr><td>NativeBERT-CT</td><td>67.91/ 67.57</td><td>77.87 /76.32</td><td>79.38 / 79.62</td><td>76.02/76.07</td><td>61.69 / 61.68</td></tr><tr><td>Multilingual BERT-CT</td><td>60.12 / 60.15</td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td>64.39 / 62.28</td><td>70.14 / 70.54</td><td>77.67 / 77.96</td><td>58.63 / 57.45</td></tr><tr><td>XLMR-CT</td><td>62.30 / 62.14</td><td>69.85 / 68.22</td><td>67.96 / 68.42</td><td>76.00 /77.30</td><td>59.29 / 58.19</td></tr></table>
|
| 103 |
+
|
| 104 |
+
We investigate the performance of CT when applied to various languages and evaluated towards STS data for Arabic, Spanish (Cer et al., 2017), Russian1, and Swedish (Isbister & Sahlgren, 2020). All CT training is performed solely with data for the respective language towards which we evaluate it, using text from a Wikipedia dump of that language (See Appendix C.2). We perform experiments with three different types of pre-trained models, all of which have encountered the targeted evaluation language during pre-training: Native BERT models pre-trained with text data specifically for the targeted language, a multilingual BERT pre-trained for 104 languages and an XLM-R model pre-trained on 100 languages (Conneau et al., 2020)
|
| 105 |
+
|
| 106 |
+
Results in table 3 show that CT clearly improves the performance of all models. Prior to training with CT, we find that the multilingual BERT performs best, with the exception of Spanish where the native BERT performs the best. XLM-R performs the worst on all languages before CT. After training with CT the native BERT models outperform both the multilingual models, again with the exception of Spanish, where a slight edge is seen for the Multilingual BERT. The big performance increase seen on all models, on all languages, without requiring any labeled data, clearly demonstrate the robustness and unsupervised applicability of CT.
|
| 107 |
+
|
| 108 |
+
# 5.4 CORPUS VARIETY
|
| 109 |
+
|
| 110 |
+
To investigate how CT is impacted by different types of text data we vary the corpus from which training data is sampled. The corpora we consider are as follows: a dump of all English Wikipedia pages, a large book corpus comprised of 11, 038 books (Zhu et al., 2015), resulting in text data with a different tone and style compared to the text found on Wikipedia. Finally, we generate random word sequences by first uniformly sampling a sentence length in the range [20, 75] and then filling that sequence with uniformly sampled tokens from the model’s vocabulary.
|
| 111 |
+
|
| 112 |
+
For each corpus, we train 5 models with CT, and report the mean unsupervised Pearson and Spearman correlation on the STS-b test set. The results found in table 4 show that CT applied with different types corpus styles yields different STS results. All models attain their highest score with the Wikipedia data, with a noticeable performance drop with the book corpus and large performance drop using random data. Although the random corpus performs worst, it interestingly improves the performance of the smaller models while drastically worsening the performance of the large model. While the number of models used in this experiment is too small for conclusive evidence, the performance drop between corpus types seems correlated with model size.
|
| 113 |
+
|
| 114 |
+
Table 4: Unsupervised Pearson / Spearman correlation $( \mathbf { x } 1 0 0 )$ on the STS-b test set when performing CT with various corpora.
|
| 115 |
+
|
| 116 |
+
<table><tr><td></td><td>Before CT Pear /Spear</td><td>Wikipedia Pear /Spear</td><td>Books Pear /Spear</td><td>Random Pear /Spear</td></tr><tr><td>Bert-Distil Bert-Base Bert-Large</td><td>57.17 / 56.77 47.91 /47.29</td><td>78.21/ 77.55 75.30 / 73.75</td><td>77.54 / 76.12 73.30 / 70.95</td><td>62.45 / 62.85 52.95 / 52.42 16.65 / 23.67</td></tr></table>
|
| 117 |
+
|
| 118 |
+
# 6 DISCUSSION
|
| 119 |
+
|
| 120 |
+
The quality of a sentence representation depends on the generating model’s ability to represent contextual interactions between the individual parts (in most cases, wordpieces) of the sentence. We refer to this as compositionality, for the lack of a better term. We propose that the task-bias of current Transformer language models can be seen as a form of compositionality-amnesia, where the models progressively express less compositional information throughout the layers, in favor of features specific to the pre-training objective. Sentence embedding methods attempt to correct for this bias by applying a learning criterion that enforces compositionality in the final layers.
|
| 121 |
+
|
| 122 |
+
In the case of CT, the learning objective is simply to maximize the dot product for identical sentences, and minimizing it for dissimilar ones. In the case of other techniques, the learning objective takes the form of modeling adjacent sentences (Skip-thoughts, Quick-thoughts, and DeCLUTR), or classifying entailment based on two given sentences (S-BERT), both of which have semantic interpretations. We argue that the CT objective is more suitable for the purpose of enforcing compositionality, since it only targets the composition function; there is no semantics involved in distinguishing identical from dissimilar sentences (all the necessary semantics is already learned by the language modeling objective).2 The finding that CT works to some extent even with randomly generated sentences further strengthens this interpretation.
|
| 123 |
+
|
| 124 |
+
It is our intuition that CT is non-constructive, or in a sense uninformative: It does not add new information to the model, but rather forces the model to realign such that the compositional representation discriminates between different sentences. Hence, we find little reason to believe that the realignment enforced by CT to be beneficial for fine-tuning tasks where ample training data is available e.g. tasks for which a pre-trained BERT model can be fine-tuned with good performance. This is in accordance with the results available in Appendix 10, where the CT models are evaluated towards multiple supervised model tasks.
|
| 125 |
+
|
| 126 |
+
As can be seen in Figure 3, CT decreases the cosine-similarity for non-semantically similar sentences, while the cosine-similarity for highly semantically similar sentences mainly remain the same. We believe the reason for this desired behaviour to be that all representations are generated through a common parameterized compositionality function (the Transformer model). We thus find it unlikely that similar results could be attained by applying CT directly to individual representations so that the manipulation of individual embeddings is performed independently (as algorithms like Word2Vec does).
|
| 127 |
+
|
| 128 |
+
Our work demonstrates the potential to produce high-quality semantic sentence representations given a pre-trained Transformer Language model, without requiring any labeled data. In accordance with the multilingual results in Section 3, we would hence like to emphasize that this makes CT well suited for low resource languages, as neither pre-training or fine-tuning requires labeled data. Additionally, we think that interesting future work might consider exploring the possibilities of applying CT (or similar re-tuning objectives) during the pre-training of Transformer language model, and/or applying it to different intermediate layers
|
| 129 |
+
|
| 130 |
+
Finally, it is noteworthy that our results are not to be considered final, as many of the chosen hyperparameters for the CT experiments are yet to be thoroughly investigated. It is therefore possible that CT and similar methods can yield even better results, with either utilizing different language models or tuning of certain hyperparameters. Especially considering that during the unsupervised tasks, due to the emulation of having zero labeled data, we strictly performed a fixed number of iterations and assumed the worst-case scenario by reporting results for the worst performing model of the two CT models. A higher performance is therefore expected if the training is monitored with a validation set or if one were to combine the output of both CT models.
|
| 131 |
+
|
| 132 |
+
# 7 CONCLUSION
|
| 133 |
+
|
| 134 |
+
This paper contributed with a layer-wise survey of the unsupervised STS performance of pre-trained Transformer language models. Results from this survey indicates that the final layer of most models produce the worst performing representations. To overcome this we proposed the self-supervised method Contrastive Tension (CT) that trains the model to output semantically distinguishable sentence representations, without requiring any labeled data. In an unsupervised setting CT achieves strong STS results when applied with various models, with varying corpora and across multiple languages. Setting a new SOTA score for multiple well established unsupervised English STS tasks.
|
| 135 |
+
|
| 136 |
+
Additionally, this paper introduced an alteration to the supervised STS regression task proposed by Reimers & Gurevych (2019), which improves the supervised STS scores for all tested models. Using this altered regression task, regular BERT models achieve equally good as when first finetuned towards NLI, CT or both. Suggesting that the current Transformer pre-training objectives themselves capture useful sentence level semantic knowledge.
|
| 137 |
+
|
| 138 |
+
# 8 ACKNOWLEDGEMENTS
|
| 139 |
+
|
| 140 |
+
This work was partially funded by Vinnova under contract 2019-02996, and the Swedish Foundation for Strategic Research (SSF) under contract RIT15-0046. Finally, the authors wish to thank Joey Ohman, Melker Mossberg and Linus Bein Fahlander, for the spicy Taco evenings which helped us ¨ through the rough times of COVID-19.
|
| 141 |
+
|
| 142 |
+
# REFERENCES
|
| 143 |
+
|
| 144 |
+
Eneko Agirre, Daniel Cer, Mona Diab, and Aitor Gonzalez-Agirre. SemEval-2012 task 6: A pilot on semantic textual similarity. In \*SEM 2012: The First Joint Conference on Lexical and Computational Semantics – Volume 1: Proceedings of the main conference and the shared task, and Volume 2: Proceedings of the Sixth International Workshop on Semantic Evaluation (SemEval 2012), pp. 385–393, Montreal, Canada, 7-8 June 2012. Association for Computational Linguistics. URL ´ https://www.aclweb.org/anthology/S12-1051.
|
| 145 |
+
|
| 146 |
+
Eneko Agirre, Daniel Cer, Mona Diab, Aitor Gonzalez-Agirre, and Weiwei Guo. \*SEM 2013 shared task: Semantic textual similarity. In Second Joint Conference on Lexical and Computational Semantics $( { } ^ { * } S E M )$ , Volume 1: Proceedings of the Main Conference and the Shared Task: Semantic Textual Similarity, pp. 32–43, Atlanta, Georgia, USA, June 2013. Association for Computational Linguistics. URL https://www.aclweb.org/anthology/S13-1004.
|
| 147 |
+
|
| 148 |
+
Eneko Agirre, Carmen Banea, Claire Cardie, Daniel Cer, Mona Diab, Aitor Gonzalez-Agirre, Weiwei Guo, Rada Mihalcea, German Rigau, and Janyce Wiebe. SemEval-2014 task 10: Multilingual semantic textual similarity. In Proceedings of the 8th International Workshop on Semantic Evaluation (SemEval 2014), pp. 81–91, Dublin, Ireland, August 2014. Association for Computational Linguistics. doi: 10.3115/v1/S14-2010. URL https://www.aclweb.org/anthology/ S14-2010.
|
| 149 |
+
|
| 150 |
+
Eneko Agirre, Carmen Banea, Claire Cardie, Daniel Cer, Mona Diab, Aitor Gonzalez-Agirre, Weiwei Guo, Inigo Lopez-Gazpio, Montse Maritxalar, Rada Mihalcea, German Rigau, Larraitz Uria, ˜ and Janyce Wiebe. SemEval-2015 task 2: Semantic textual similarity, English, Spanish and pilot on interpretability. In Proceedings of the 9th International Workshop on Semantic Evaluation (SemEval 2015), pp. 252–263, Denver, Colorado, June 2015. Association for Computational Linguistics. doi: 10.18653/v1/S15-2045. URL https://www.aclweb.org/anthology/S15-2045.
|
| 151 |
+
|
| 152 |
+
Eneko Agirre, Carmen Banea, Daniel Cer, Mona Diab, Aitor Gonzalez-Agirre, Rada Mihalcea, German Rigau, and Janyce Wiebe. SemEval-2016 task 1: Semantic textual similarity, monolingual and cross-lingual evaluation. In Proceedings of the 10th International Workshop on Semantic Evaluation (SemEval-2016), pp. 497–511, San Diego, California, June 2016. Association for Computational Linguistics. doi: 10.18653/v1/S16-1081. URL https://www.aclweb.org/ anthology/S16-1081.
|
| 153 |
+
|
| 154 |
+
Sanjeev Arora, Yingyu Liang, and Tengyu Ma. A simple but tough-to-beat baseline for sentence embeddings. 2016.
|
| 155 |
+
|
| 156 |
+
Giusepppe Attardi. Wikiextractor. https://github.com/attardi/wikiextractor, 2015.
|
| 157 |
+
|
| 158 |
+
Yoshua Bengio, Aaron Courville, and Pascal Vincent. Representation learning: A review and new perspectives. IEEE Trans. Pattern Anal. Mach. Intell., 35(8):1798–1828, August 2013. ISSN 0162-8828. doi: 10.1109/TPAMI.2013.50. URL https://doi.org/10.1109/TPAMI.2013. 50.
|
| 159 |
+
|
| 160 |
+
Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners, 2020.
|
| 161 |
+
|
| 162 |
+
Daniel Cer, Mona Diab, Eneko Agirre, Inigo Lopez-Gazpio, and Lucia Specia. Semeval-2017 task 1: Semantic textual similarity-multilingual and cross-lingual focused evaluation. arXiv preprint arXiv:1708.00055, 2017.
|
| 163 |
+
|
| 164 |
+
Daniel Cer, Yinfei Yang, Sheng-yi Kong, Nan Hua, Nicole Limtiaco, Rhomni St. John, Noah Constant, Mario Guajardo-Cespedes, Steve Yuan, Chris Tar, Brian Strope, and Ray Kurzweil. Universal sentence encoder for English. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pp. 169–174, Brussels, Belgium, November 2018. Association for Computational Linguistics. doi: 10.18653/v1/D18-2029. URL https://www.aclweb.org/anthology/D18-2029.
|
| 165 |
+
|
| 166 |
+
Mark Chen, Alec Radford, Rewon Child, Jeffrey Wu, Heewoo Jun, David Luan, and Ilya Sutskever. Generative pretraining from pixels. In Proceedings of Machine Learning and Systems 2020, pp. 10466–10478. 2020.
|
| 167 |
+
|
| 168 |
+
Kevin Clark, Minh-Thang Luong, Quoc V. Le, and Christopher D. Manning. ELECTRA: Pretraining text encoders as discriminators rather than generators. In ICLR, 2020. URL https: //openreview.net/pdf?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ r1xMH1BtvB.
|
| 169 |
+
|
| 170 |
+
Alexis Conneau and Douwe Kiela. SentEval: An evaluation toolkit for universal sentence representations. In Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018), Miyazaki, Japan, May 2018. European Language Resources Association (ELRA). URL https://www.aclweb.org/anthology/L18-1269.
|
| 171 |
+
|
| 172 |
+
Alexis Conneau, Douwe Kiela, Holger Schwenk, Lo¨ıc Barrault, and Antoine Bordes. Supervised learning of universal sentence representations from natural language inference data. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 670– 680, Copenhagen, Denmark, September 2017. Association for Computational Linguistics. doi: 10.18653/v1/D17-1070. URL https://www.aclweb.org/anthology/D17-1070.
|
| 173 |
+
|
| 174 |
+
Alexis Conneau, Kartikay Khandelwal, Naman Goyal, Vishrav Chaudhary, Guillaume Wenzek, Francisco Guzman, Edouard Grave, Myle Ott, Luke Zettlemoyer, and Veselin Stoyanov. Un- ´ supervised cross-lingual representation learning at scale. In Dan Jurafsky, Joyce Chai, Natalie Schluter, and Joel R. Tetreault (eds.), Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, ACL 2020, Online, July 5-10, 2020, pp. 8440–8451. Association for Computational Linguistics, 2020. URL https://www.aclweb.org/anthology/2020. acl-main.747/.
|
| 175 |
+
|
| 176 |
+
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. doi: 10.18653/v1/N19-1423. URL https: //www.aclweb.org/anthology/N19-1423.
|
| 177 |
+
|
| 178 |
+
John M Giorgi, Osvald Nitski, Gary D Bader, and Bo Wang. Declutr: Deep contrastive learning for unsupervised textual representations. arXiv preprint arXiv:2006.03659, 2020.
|
| 179 |
+
|
| 180 |
+
Jean-Bastien Grill, Florian Strub, Florent Altche, Corentin Tallec, Pierre H Richemond, Elena ´ Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Daniel Guo, Mohammad Gheshlaghi Azar, et al. Bootstrap your own latent: A new approach to self-supervised learning. arXiv preprint arXiv:2006.07733, 2020.
|
| 181 |
+
|
| 182 |
+
Felix Hill, Kyunghyun Cho, and Anna Korhonen. Learning distributed representations of sentences from unlabelled data. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 1367–1377, San Diego, California, June 2016a. Association for Computational Linguistics. doi: 10.18653/ v1/N16-1162. URL https://www.aclweb.org/anthology/N16-1162.
|
| 183 |
+
|
| 184 |
+
Felix Hill, Kyunghyun Cho, and Anna Korhonen. Learning distributed representations of sentences from unlabelled data. arXiv preprint arXiv:1602.03483, 2016b.
|
| 185 |
+
|
| 186 |
+
Tieleman Hinton. Lecture 6.5 - rmsprop, coursera: Neural networks for machine learning. 2012.
|
| 187 |
+
|
| 188 |
+
Tim Isbister and Magnus Sahlgren. Why not simply translate? a first swedish evaluation benchmark for semantic similarity, 2020.
|
| 189 |
+
|
| 190 |
+
Ryan Kiros, Yukun Zhu, Russ R Salakhutdinov, Richard Zemel, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Skip-thought vectors. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett (eds.), Advances in Neural Information Processing Systems 28, pp. 3294–3302. Curran Associates, Inc., 2015. URL http://papers.nips.cc/paper/ 5950-skip-thought-vectors.pdf.
|
| 191 |
+
|
| 192 |
+
Quoc Le and Tomas Mikolov. Distributed representations of sentences and documents. In International conference on machine learning, pp. 1188–1196, 2014.
|
| 193 |
+
|
| 194 |
+
Nelson F. Liu, Matt Gardner, Yonatan Belinkov, Matthew E. Peters, and Noah A. Smith. Linguistic knowledge and transferability of contextual representations. 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. 1073–1094, Minneapolis, Minnesota, June 2019a. Association for Computational Linguistics. doi: 10.18653/v1/N19-1112. URL https://www.aclweb.org/anthology/N19-1112.
|
| 195 |
+
|
| 196 |
+
Y. Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, M. Lewis, Luke Zettlemoyer, and Veselin Stoyanov. Roberta: A robustly optimized bert pretraining approach. ArXiv, abs/1907.11692, 2019b.
|
| 197 |
+
|
| 198 |
+
Lajanugen Logeswaran and Honglak Lee. An efficient framework for learning sentence representations. In International Conference on Learning Representations, 2018. URL https: //openreview.net/forum?id $\equiv$ rJvJXZb0W.
|
| 199 |
+
|
| 200 |
+
Amil Merchant, Elahe Rahimtoroghi, Ellie Pavlick, and Ian Tenney. What happens to bert embeddings during fine-tuning?, 2020.
|
| 201 |
+
|
| 202 |
+
Nils Reimers and Iryna Gurevych. Sentence-BERT: Sentence embeddings using Siamese BERTnetworks. 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. 3982–3992, Hong Kong, China, November 2019. Association for Computational Linguistics. doi: 10.18653/v1/D19-1410. URL https://www.aclweb.org/anthology/ D19-1410.
|
| 203 |
+
|
| 204 |
+
D. E. Rumelhart, G. E. Hinton, and R. J. Williams. Learning Internal Representations by Error Propagation, pp. 318–362. MIT Press, Cambridge, MA, USA, 1986. ISBN 026268053X.
|
| 205 |
+
|
| 206 |
+
David E. Rumelhart, Geoffrey E. Hinton, and Ronald J. Williams. Learning Representations by Back-Propagating Errors, pp. 696–699. MIT Press, Cambridge, MA, USA, 1988. ISBN 0262010976.
|
| 207 |
+
|
| 208 |
+
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.
|
| 209 |
+
|
| 210 |
+
Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. GLUE: A multi-task benchmark and analysis platform for natural language understanding. In International Conference on Learning Representations, 2019. URL https://openreview. net/forum?id $\equiv$ rJ4km2R5t7.
|
| 211 |
+
|
| 212 |
+
B. Wang and C. . J. Kuo. SBERT-WK: A sentence embedding method by dissecting BERT-based word models. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 28:2146– 2157, 2020.
|
| 213 |
+
|
| 214 |
+
Bin Wang and C-C Jay Kuo. Sbert-wk: A sentence embedding method by dissecting bert-based word models. arXiv preprint arXiv:2002.06652, 2020.
|
| 215 |
+
|
| 216 |
+
John Wieting, Mohit Bansal, Kevin Gimpel, and Karen Livescu. Towards universal paraphrastic sentence embeddings. arXiv preprint arXiv:1511.08198, 2015.
|
| 217 |
+
|
| 218 |
+
Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, R’emi Louf, Morgan Funtowicz, and Jamie Brew. Huggingface’s transformers: State-of-the-art natural language processing. ArXiv, abs/1910.03771, 2019.
|
| 219 |
+
|
| 220 |
+
Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Russ R Salakhutdinov, and Quoc V Le. Xlnet: Generalized autoregressive pretraining for language understanding. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alche-Buc, E. Fox, and ´ R. Garnett (eds.), Advances in Neural Information Processing Systems 32, pp. 5753– 5763. Curran Associates, Inc., 2019. URL http://papers.nips.cc/paper/ 8812-xlnet-generalized-autoregressive-pretraining-for-language-understanding. pdf.
|
| 221 |
+
|
| 222 |
+
Jason Yosinski, Jeff Clune, Yoshua Bengio, and Hod Lipson. How transferable are features in deep neural networks? In Z. Ghahramani, M. Welling, C. Cortes, N. Lawrence, and K. Q. Weinberger (eds.), Advances in Neural Information Processing Systems, volume 27, pp. 3320–3328. Curran Associates, Inc., 2014. URL https://proceedings.neurips.cc/paper/2014/file/ 375c71349b295fbe2dcdca9206f20a06-Paper.pdf.
|
| 223 |
+
|
| 224 |
+
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 The IEEE International Conference on Computer Vision (ICCV), December 2015.
|
| 225 |
+
|
| 226 |
+
A APPENDIX
|
| 227 |
+
|
| 228 |
+
A.1 VISUAL EXAMPLE OF CONTRASTIVE TENSION
|
| 229 |
+
|
| 230 |
+

|
| 231 |
+
Figure 4: CT follows an architecture similar to a siamese network, but with independent models. Both models are updated based on a contrastive loss on the unnormalized dot product
|
| 232 |
+
|
| 233 |
+
Figure 4 demonstrates how CT is applied when $K \ = \ 7$ which yields 1 positive sentence pair $( S _ { A } , S _ { A } )$ where the models are trained to maximize the dot product, and 7 negative sentence pairs $( S _ { A } , S _ { B } ) , ( S _ { A } , S _ { C } ) \dots ( S _ { A } , S _ { H } )$ where the models are trained to minimize the dot product. As all sentence pairs are included into the same batch, the loss for all $K + 1$ sentence pairs are calculated before updating the models parameters.
|
| 234 |
+
|
| 235 |
+
# A.2 MODEL NAMING CONVENTION
|
| 236 |
+
|
| 237 |
+
Throughout the paper we sequentially apply different fine-tuning objectives on pre-trained transformer models, i.e no pre-training is performed during fine-tuning and no two fine-tuning tasks are applied in parallel. The terms ”Distil”, ”Base” and ”Large” are used as descriptors of the pretrained model’s size and in the case of ”Distil” also its pre-training objective.
|
| 238 |
+
|
| 239 |
+
The two main fine-tuning tasks we consider is CT and the Siamese NLI task of InferSent and SBERT. When a model has been tuned towards the Siamese NLI task an additional $^ { \prime \prime } S _ { ^ { \prime } } { } ^ { , , }$ is added as a prefix to the model base. When a model has been trained with the CT training objective ”-CT” is added as suffix to the model name. It is strictly the case that when both these tasks are applied to a model, the NLI task is applied before to the CT objective.
|
| 240 |
+
|
| 241 |
+
For example the model ”S-BERT-Distil-CT”, is a distilled BERT model that has been fine-tuned towards the S-BERT NLI task, before finally tuned with the CT training objective.
|
| 242 |
+
|
| 243 |
+
# A.3 LEARNING RATE SCHEDULE
|
| 244 |
+
|
| 245 |
+
Hyperparameter search concluded that $2 e ^ { - } 6$ was a stable learning rate for applying CT to pre-trained BERT models. However, we found it possible to speedup learning during the early training stages by using a higher learning rate, leading us to the step-wise learning rate schedule seen in table 5. We found no significant difference in the end result when applying the learning rate schedule and when training for a longer period with a smaller learning rate.
|
| 246 |
+
|
| 247 |
+
Table 5: Step-wise learning schedule applied for all training with Contrastive Tension.
|
| 248 |
+
|
| 249 |
+
<table><tr><td rowspan=1 colspan=1>N #Updates</td><td rowspan=1 colspan=1>Learning Rate</td></tr><tr><td rowspan=1 colspan=1>N<500</td><td rowspan=1 colspan=1>1e-5</td></tr><tr><td rowspan=1 colspan=1>N<1000</td><td rowspan=1 colspan=1>8e-6</td></tr><tr><td rowspan=1 colspan=1>N<1500</td><td rowspan=1 colspan=1>6e-6</td></tr><tr><td rowspan=1 colspan=1>N<2000</td><td rowspan=1 colspan=1>4e-6</td></tr><tr><td rowspan=1 colspan=1>2000≤N</td><td rowspan=1 colspan=1>2e-6</td></tr></table>
|
| 250 |
+
|
| 251 |
+
# A.4 REPRODUCIBILITY OF PREVIOUS WORK
|
| 252 |
+
|
| 253 |
+
There exists a discrepancy regarding the reported STS scores between various previous works (Reimers & Gurevych, 2019; Wang & Kuo, 2020). As mentioned, we perform all our STS evaluation with the SentEval framework of Conneau & Kiela (2018), the following are our observations and experiences as we compare with reported results of Reimers & Gurevych (2019), and the follow up work of Wang & Kuo (2020).
|
| 254 |
+
|
| 255 |
+
For the English Unsupervised STS tasks of SemEval 2012-2016 we found that:
|
| 256 |
+
|
| 257 |
+
1. Our results for BERT, S-BERT and S-BERT-WK are consistent with the work of Wang & Kuo (2020). (Although they do not report results for S-BERT-Large-WK). 2. Reimers & Gurevych (2019) report the highest STS score for the S-BERT models but the lowest for BERT. Which when compared gives an average Spearman difference of 3.9 for S-BERT-Base, 3.4 for S-BERT-Large and $- 1 . 4 5$ for BERT.
|
| 258 |
+
|
| 259 |
+
3. No one agrees upon the scores of either InferSent or USE.
|
| 260 |
+
|
| 261 |
+
When evaluating towards the Supervised STS tasks of STS-b test set we found that:
|
| 262 |
+
|
| 263 |
+
1. Our Spearman results for S-BERT-Base and S-BERT-Large, prior to fine-tuning, are consistent with the work of Reimers & Gurevych (2019). Differing with less than 0.05 points. 2. Using the official S-BERT code to fine-tune the released S-BERT-Large model, with the described hyperparameters, yields worse results than reported by Reimers & Gurevych (2019), both when evaluating with SentEval or the included evaluation script.
|
| 264 |
+
|
| 265 |
+
Finally, we note that the official S-BERT implementation continuously evaluates towards the STSb validation set throughout the NLI training, saving the copy that performs best. This makes all models trained with this setup invalid for the unsupervised STS tasks, as the STS-b validation set is a collection of samples from these tests. This is not to say that this is the setup that was used for the results reported by Reimers & Gurevych (2019), but something that future researchers should be aware of.
|
| 266 |
+
|
| 267 |
+
# B
|
| 268 |
+
|
| 269 |
+
Additional Experiments and Results
|
| 270 |
+
|
| 271 |
+
# B.1 ADDITIONAL UNSUPERVISED STS
|
| 272 |
+
|
| 273 |
+
In order to give further insights on the performance of CT we report unsupervised STS results from $1 0 \ \mathrm { C T }$ training runs per considered pre-trained model. Since CT trains two models in parallel this results in $1 0 ~ \mathrm { C T }$ model pairs i.e. 20 models per considered pre-trained model. Table 6 show the worst/best performing model and the average performance of all 20 models, completely disregarding which models were paired during training. Table 7 showcases how two paired CT models tend to differ in regards to the mean unsupervised STS score, showing the min, max and average difference over the 10 training runs.
|
| 274 |
+
|
| 275 |
+
It is apparent that out of the models whom have not been tuned towards the NLI task, BERT-Distil$C T$ showcases the most stable performance, with very little variation between the worst and best performing model compared to both BERT-Base-CT and BERT-Large-CT who show a lower worst possible score. If this discrepancy in performance stability is due to model size or that BERT-Distil is trained via distillation is left for future work. Applying CT to a model who has been tuned towards an NLI task seemingly produces both more stable and better results.
|
| 276 |
+
|
| 277 |
+
Table 6: Pearson and Spearman correlation (x100) on various unsupervised semantic textual similarity tasks.
|
| 278 |
+
|
| 279 |
+
<table><tr><td></td><td>STS12</td><td>STS13</td><td>STS14</td><td>STS15</td><td>STS16</td><td>Avg.</td></tr><tr><td>WorstPerformingModel</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>BERT-Distil-CT</td><td>66.69/66.23</td><td>72.44/73.72</td><td>76.04/73.09</td><td>77.61/78.20</td><td>77.51/78.08</td><td>73.86/73.86</td></tr><tr><td>BERT-Base-CT</td><td>62.04 /62.65</td><td>65.23 / 65.50</td><td>71.62 /68.85</td><td>75.48/75.90</td><td>74.69 /75.66</td><td>69.81/ 69.71</td></tr><tr><td>BERT-Large-CT</td><td>63.82/65.12</td><td>72.14 / 72.21</td><td>72.20 /69.40</td><td>72.58 /73.02</td><td>73.25 /74.33</td><td>70.80 / 70.82</td></tr><tr><td>S-BERT-Distil-CT</td><td>68.96/67.51</td><td>72.02/72.74</td><td>77.30/75.44</td><td>78.31/79.73</td><td>74.80/77.54</td><td>74.28/74.59</td></tr><tr><td>S-BERT-Base-CT</td><td>68.09 /67.69</td><td>72.54 / 73.35</td><td>77.25 /75.80</td><td>77.93 / 78.99</td><td>74.59 /76.61</td><td>74.08 / 74.49</td></tr><tr><td>S-BERT-Large-CT</td><td>70.37 /68.94</td><td>74.70 / 74.90</td><td>78.36/76.36</td><td>79.22 /80.29</td><td>74.66 /77.23</td><td>75.46 / 75.54</td></tr><tr><td>BestPerformingModel</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>BERT-Distil-CT</td><td>68.14/67.22</td><td>73.48/74.04</td><td>77.03/73.45</td><td>77.88/78.56</td><td>76.54/78.15</td><td>74.61/74.28</td></tr><tr><td>BERT-Base-CT</td><td>68.20 /68.56</td><td>74.33 /74.50</td><td>76.76 /73.33</td><td>78.71 /79.29</td><td>78.10 /79.15</td><td>75.22 /74.97</td></tr><tr><td>BERT-Large-CT</td><td>69.26 /69.03</td><td>76.90 / 77.19</td><td>77.71/ 74.50</td><td>79.08 / 79.58</td><td>79.16 /80.07</td><td>76.42/76.07</td></tr><tr><td>S-BERT-Distil-CT</td><td>70.04/68.25</td><td>76.78/76.98</td><td>79.69/66.68</td><td>79.66/80.37</td><td>77.54/79.63</td><td>76.74/76.58</td></tr><tr><td>S-BERT-Base-CT</td><td>69.59 / 68.20</td><td>74.38 /75.18</td><td>78.30 / 76.56</td><td>79.71/ 80.54</td><td>75.71 / 77.58</td><td>75.54 / 75.64</td></tr><tr><td>S-BERT-Large-CT</td><td>71.72 / 69.96</td><td>77.09 / 77.17</td><td>78.61 / 76.73</td><td>80.50 / 81.45</td><td>76.38 / 78.43</td><td>76.86 /76.75</td></tr><tr><td>MeanPerformance</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>BERT-Distil-CT</td><td>67.69/67.10</td><td>72.84/73.95</td><td>76.54/73.29</td><td>77.66/78.27</td><td>76.53/78.15</td><td>74.25/74.15</td></tr><tr><td>BERT-Base-CT</td><td>64.46 /64.74</td><td>68.11/68.34</td><td>73.14 / 70.24</td><td>76.66 /77.09</td><td>75.85 /76.84</td><td>71.64 / 71.46</td></tr><tr><td>BERT-Large-CT</td><td>67.25 /67.80</td><td>74.57 /74.70</td><td>75.84 / 72.73</td><td>77.41 /77.89</td><td>77.22 /78.21</td><td>74.46 /74.27</td></tr><tr><td>S-BERT-Distil-CT</td><td>69.75/68.14</td><td>74.58/75.05</td><td>77.98/76.19</td><td>78.63/79.77</td><td>75.82/78.23</td><td>75.35/75.48</td></tr><tr><td>S-BERT-Base-CT</td><td>69.10 / 68.38</td><td>73.61/74.36</td><td>77.90 / 76.27</td><td>78.88/79.88</td><td>75.06 /77.11</td><td>74.91/75.20</td></tr><tr><td>S-BERT-Large-CT</td><td>71.37 /69.70</td><td>75.56 /75.80</td><td>78.60 /77.02</td><td>79.99 / 80.98</td><td>75.96 /78.06</td><td>76.30 / 76.31</td></tr></table>
|
| 280 |
+
|
| 281 |
+
Table 7: Min, max and mean difference between CT paired models in Pearson and Spearman correlation $( \mathrm { x } 1 0 0 )$ in regards to the mean score of the unsupervised semantic textual similarity tasks.
|
| 282 |
+
|
| 283 |
+
<table><tr><td></td><td>MINDifference</td><td>MAXDifference</td><td>MEANDifference</td></tr><tr><td>BERT-Distil-CT BERT-Base-CT</td><td>0.06/0.04</td><td>0.55/0.29</td><td>0.31/0.17</td></tr><tr><td>BERT-Large-CT</td><td>0.05 /0.00</td><td>1.71 / 1.36</td><td>0.75 /0.51</td></tr><tr><td>S-BERT-Distil-CT</td><td>0.03 /0.02</td><td>4.49 / 3.43</td><td>1.26 /1.13</td></tr><tr><td>S-BERT-Base-CT</td><td>0.31/0.11</td><td>1.52 / 1.25</td><td>0.88/0.76</td></tr><tr><td></td><td>0.23/0.09</td><td>1.03 / 0.90</td><td>0.58 /0.33</td></tr><tr><td>S-BERT-Large-CT</td><td>0.00 /0.04</td><td>0.81 / 0.92</td><td>0.38 / 0.33</td></tr></table>
|
| 284 |
+
|
| 285 |
+
# B.2 DOWNSTREAM & PROBING TASKS
|
| 286 |
+
|
| 287 |
+
To comply with previous work, we evaluate CT on the various set of downstream tasks supplied by the SentEval package (Conneau & Kiela, 2018). As results in table 8 show, we find only minor improvements when using the representations from the fine-tuned models compared to BERT. SBERT produces a minor improvement for most non semantic related downstream tasks and CT performs slightly better on the semantic related tasks SICK-R and STS-b. Interestingly, the results from table 2 show that BERT-CT, S-BERT and S-BERT-CT all perform better on the STS-b test set when not training an extra linear classifier.
|
| 288 |
+
|
| 289 |
+
Additionally we evaluate towards the fine grained analysis tasks supplied by SentEval. The results in table 9 clearly show that S-BERT’s NLI fine-tuning objective decreases the score in all tests compared to BERT. CT also clearly decreases the performance on all tests except the Bigram Shift task, where this is done to a smaller degree.
|
| 290 |
+
|
| 291 |
+
Table 8: Results on the downstream tasks supplied with the SentEval package. For the semantic related tasks SICK-R and STS-b, the Pearson correlation (x100) is reported.
|
| 292 |
+
|
| 293 |
+
<table><tr><td></td><td>CR</td><td>MR</td><td>MPQA</td><td>SUBJ</td><td>SST2</td><td>SST5</td><td>TREC</td><td>MRPC</td><td>SICK-E</td><td>SICK-R</td><td>STS-b</td><td>AVG</td></tr><tr><td>BERT-Distil</td><td>85.96</td><td>79.98</td><td>88.42</td><td>95.14</td><td>85.39</td><td>45.93</td><td>90.60</td><td>74.14</td><td>81.69</td><td>83.74</td><td>69.53</td><td>80.05</td></tr><tr><td>BERT-Base</td><td>86.96</td><td>81.33</td><td>88.07</td><td>95.03</td><td>85.94</td><td>46.74</td><td>90.60</td><td>73.74</td><td>79.50</td><td>80.47</td><td>65.40</td><td>79.44</td></tr><tr><td>BERT-Large</td><td>88.74</td><td>84.33</td><td>86.64</td><td>95.27</td><td>79.29</td><td>50.32</td><td>91.40</td><td>71.65</td><td>75.28</td><td>77.09</td><td>66.22</td><td>78.75</td></tr><tr><td>BERT-Distil-NLI</td><td>88.37</td><td>80.83</td><td>95.50</td><td>82.54</td><td>86.99</td><td>47.47</td><td>85.60</td><td>76.12</td><td>83.15</td><td>84.72</td><td>75.90</td><td>80.11</td></tr><tr><td>BERT-Base-NLI</td><td>89.24</td><td>82.65</td><td>89.61</td><td>93.84</td><td>88.36</td><td>47.38</td><td>85.20</td><td>75.07</td><td>82.04</td><td>84.24</td><td>73.05</td><td>80.97</td></tr><tr><td>BERT-Large-NLI</td><td>90.52</td><td>84.36</td><td>90.30</td><td>94.32</td><td>90.72</td><td>50.05</td><td>86.80</td><td>76.52</td><td>83.05</td><td>84.94</td><td>75.02</td><td>82.42</td></tr><tr><td>OurContributions</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>BERT-Distil-CT</td><td>84.00</td><td>78.51</td><td>88.62</td><td>93.83</td><td>83.47</td><td>45.34</td><td>87.60</td><td>74.61</td><td>81.96</td><td>85.06</td><td>74.45</td><td>79.77</td></tr><tr><td>BERT-Base-CT</td><td>84.00</td><td>79.84</td><td>88.06</td><td>94.10</td><td>82.43</td><td>45.25</td><td>89.20</td><td>73.80</td><td>80.80</td><td>84.30</td><td>73.69</td><td>79.59</td></tr><tr><td>BERT-Large-CT</td><td>86.81</td><td>82.38</td><td>88.31</td><td>94.34</td><td>87.75</td><td>46.56</td><td>88.00</td><td>73.10</td><td>81.49</td><td>84.93</td><td>76.50</td><td>80.92</td></tr><tr><td>BERT-Distil-NLI-CT</td><td>87.68</td><td>80.74</td><td>89.33</td><td>92.59</td><td>86.27</td><td>46.97</td><td>85.80</td><td>75.59</td><td>82.81</td><td>84.91</td><td>77.68</td><td>80.94</td></tr><tr><td>BERT-Base-NLI-CT</td><td>88.66</td><td>81.83</td><td>89.79</td><td>93.72</td><td>87.91</td><td>47.83</td><td>83.00</td><td>74.43</td><td>82.42</td><td>85.32</td><td>77.42</td><td>81.12</td></tr><tr><td>BERT-Large-NLI-CT</td><td>89.56</td><td>82.56</td><td>90.20</td><td>83.08</td><td>88.85</td><td>48.60</td><td>87.20</td><td>74.43</td><td>82.77</td><td>84.88</td><td>77.49</td><td>80.87</td></tr></table>
|
| 294 |
+
|
| 295 |
+
Table 9: Results on the fine grained analysis tasks tasks supplied with the SentEval package.
|
| 296 |
+
|
| 297 |
+
<table><tr><td></td><td>Length</td><td>WC</td><td>Depth</td><td>TopConst</td><td>BShift</td><td>Tense</td><td>SubjNum</td><td>ObjNum</td><td>OddManOut</td><td>CoordInv</td><td>AVG</td></tr><tr><td>BERT-Distil</td><td>88.29</td><td>67.39</td><td>39.68</td><td>76.03</td><td>86.81</td><td>88.89</td><td>86.06</td><td>83.15</td><td>63.19</td><td>65.09</td><td>74.46</td></tr><tr><td>BERT-Base</td><td>81.99</td><td>61.20</td><td>36.19</td><td>77.63</td><td>88.76</td><td>88.23</td><td>84.98</td><td>82.11</td><td>66.69</td><td>69.94</td><td>73.77</td></tr><tr><td>BERT-Large</td><td>70.82</td><td>55.26</td><td>33.35</td><td>68.86</td><td>90.29</td><td>88.31</td><td>81.67</td><td>80.37</td><td>69.29</td><td>71.23</td><td>70.95</td></tr><tr><td>BERT-Distil-NLI</td><td>71.23</td><td>61.76</td><td>31.83</td><td>58.75</td><td>70.41</td><td>85.11</td><td>79.02</td><td>77.71</td><td>57.93</td><td>59.10</td><td>65.29</td></tr><tr><td>BERT-Base-NLI</td><td>72.12</td><td>58.65</td><td>31.14</td><td>60.50</td><td>76.02</td><td>86.81</td><td>78.38</td><td>77.08</td><td>62.97</td><td>63.78</td><td>66.29</td></tr><tr><td>BERT-Large-NLI</td><td>59.79</td><td>54.47</td><td>29.63</td><td>57.98</td><td>76.28</td><td>84.36</td><td>76.34</td><td>73.65</td><td>64.28</td><td>65.71</td><td>64.25</td></tr><tr><td>OurContributions</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>BERT-Distil-CT</td><td>81.86</td><td>74.49</td><td>37.78</td><td>69.76</td><td>80.38</td><td>88.54</td><td>83.76</td><td>80.86</td><td>60.91</td><td>59.94</td><td>71.83</td></tr><tr><td>BERT-Base-CT</td><td>77.68</td><td>80.69</td><td>34.21</td><td>68.32</td><td>85.70</td><td>88.03</td><td>83.70</td><td>80.35</td><td>64.93</td><td>64.97</td><td>72.86</td></tr><tr><td>BERT-Large-CT</td><td>64.85</td><td>65.93</td><td>30.97</td><td>64.75</td><td>86.59</td><td>87.9</td><td>81.17</td><td>80.85</td><td>68.04</td><td>67.37</td><td>69.84</td></tr><tr><td>BERT-Distil-NLI-CT</td><td>72.55</td><td>67.84</td><td>33.29</td><td>62.61</td><td>72.49</td><td>86.20</td><td>82.01</td><td>78.84</td><td>58.40</td><td>59.61</td><td>67.38</td></tr><tr><td>BERT-Base-NLI-CT</td><td>71.44</td><td>66.42</td><td>32.19</td><td>61.45</td><td>77.61</td><td>87.87</td><td>80.10</td><td>78.45</td><td>63.21</td><td>63.83</td><td>68.26</td></tr><tr><td>BERT-Large-NLI-CT</td><td>59.26</td><td>64.85</td><td>29.11</td><td>58.54</td><td>75.79</td><td>83.05</td><td>76.98</td><td>74.17</td><td>62.88</td><td>63.63</td><td>64.83</td></tr></table>
|
| 298 |
+
|
| 299 |
+
# B.3 GLUE BENCHMARK
|
| 300 |
+
|
| 301 |
+
We evaluate our BERT-Base-CT model on the General Language Understanding Evaluation (GLUE) benchmark (Wang et al., 2019), and compare with BERT-Base and S-BERT-Base. Following Devlin et al. (2019), we chose the best performing model on the validation set for each combination of learning rate (among 5e-5, 4e-5, 3e-5, 2e-5 for BERT-base and among 5e-5, 4e-5, 3e-5, 2e-5, 1e-5, 2e-6 for the other models), model and task. For all GLUE tasks, all models are fine-tuned using a batch size of 32 for three epochs.
|
| 302 |
+
|
| 303 |
+
The results presented in Table 10 demonstrates that BERT performs the best, with a slight margin, on near all tasks. Exception being the STS-b task, where both S-BERT and BERT-CT see a slight improvement over BERT. However, as depicted in Table 2 both S-BERT and BERT-CT attain higher test scores with the embedding based approach, compared to feeding both sentences to the same model as is done in the GLUE tasks.
|
| 304 |
+
|
| 305 |
+
Table 10: GLUE Test results, returned by the GLUE evaluation server (https:// gluebenchmark.com/leaderboard). Following Devlin et al. (2019), the WNLI set has been excluded from the computation of the average score. F1 score is reported for QQP and MRPC, Spearman correlation $( \mathrm { x } 1 0 0 )$ for STS-b and accuracy is reported for the rest of the tasks.
|
| 306 |
+
|
| 307 |
+
<table><tr><td></td><td>MNLI-(m/mm)</td><td>QQP</td><td>QNLI</td><td>SST-2</td><td>CoLA</td><td>STS-b</td><td>MRPC</td><td>RTE</td><td>Average</td></tr><tr><td>BERT-Base</td><td>84.2/83.6</td><td>71.3</td><td>90.6</td><td>91.7</td><td>51.9</td><td>83.6</td><td>87.8</td><td>65.0</td><td>78.8</td></tr><tr><td>S-BERT-Base</td><td>83.9/83.1</td><td>71.3</td><td>90.5</td><td>90.9</td><td>47.0</td><td>84.7</td><td>85.3</td><td>61.6</td><td>77.6</td></tr><tr><td>BERT-Base-CT</td><td>82.3/81.9</td><td>70.1</td><td>89.7</td><td>91.3</td><td>48.8</td><td>84.0</td><td>84.4</td><td>61.1</td><td>77.0</td></tr></table>
|
| 308 |
+
|
| 309 |
+

|
| 310 |
+
Figure 5: Layer-wise unsupervised STS performance on the STS-b test set. $\mathrm { X }$ -axis denotes the layers of the depicted model and the Y-axis denotes the Spearman correlation $( \mathrm { x } 1 0 0 )$ . Color is a redundant indicator of the Spearman correlation and the value 50 is included for visual comparison.
|
| 311 |
+
|
| 312 |
+

|
| 313 |
+
Figure 6: Layer-wise unsupervised STS performance on the STS-b test set. $\mathrm { X }$ -axis denotes the layers of the depicted model and the Y-axis denotes the Spearman correlation $( \mathrm { x } 1 0 0 )$ . Color is a redundant indicator of the Spearman correlation and the value 50 is included for visual comparison.
|
| 314 |
+
|
| 315 |
+
# C EXPERIMENT SETUP
|
| 316 |
+
|
| 317 |
+
# C.1 MODEL CHECKPOINTS
|
| 318 |
+
|
| 319 |
+
All models and checkpoints where implemented and loaded using the Huggingface API (Wolf et al., 2019). The various model checkpoints used throughout the experiments of this paper are available in Table 11.
|
| 320 |
+
|
| 321 |
+
Table 11: Model checkpoints used in these experiments.
|
| 322 |
+
|
| 323 |
+
<table><tr><td>Model Name</td><td>Parameters</td><td>URL</td></tr><tr><td colspan="3">EnglishBertModels</td></tr><tr><td>Bert-Distil Bert-Base</td><td>66M</td><td>huggingface.co/distilbert-base-uncased</td></tr><tr><td></td><td>110 M</td><td>huggingface.co/bert-base-uncased</td></tr><tr><td>Bert-Large</td><td>340M</td><td>huggingface.co/distilbert-base-uncased</td></tr><tr><td>S-Bert-Distil</td><td>66M</td><td>Anonymous Upload</td></tr><tr><td>S-Bert-Base</td><td>110M</td><td>https://huggingface.co/sentence-transformers/bert-base-nli-mean-tokens</td></tr><tr><td>S-Bert-Large Multilingual Models</td><td>340M</td><td>https://huggingface.co/sentence-transformers/bert-large-nli-mean-tokens</td></tr><tr><td colspan="3"></td></tr><tr><td>Arabic Bert-Base Spanish Bert-Base</td><td>110M</td><td>huggingface.co/asafaya/bert-base-arabic</td></tr><tr><td>Swedish Bert-Base</td><td>110M</td><td>https://huggingface.co/dccuchile/bert-base-spanish-wwm-uncased</td></tr><tr><td>Russian Bert-Base</td><td>110 M</td><td>https://huggingface.co/KB/bert-base-swedish-cased</td></tr><tr><td>Multilingual Bert-Base</td><td>110M</td><td>https://huggingface.co/DeepPavlov/rubert-base-cased</td></tr><tr><td>XLM-R</td><td>110 M</td><td>https://huggingface.co/bert-base-multilingual-cased</td></tr><tr><td>AdditionalModels</td><td>571M</td><td>https://huggingface.co/xlm-mlm-10o-1280</td></tr><tr><td colspan="3">Albert-Base</td></tr><tr><td>Albert-Large Electra-Base</td><td>11 M 17M</td><td>https://huggingface.co/albert-base-vl https://huggingface.co/albert-large-vl</td></tr><tr><td></td><td>110 M</td><td>https://huggingface.co/google/electra-base-discriminator</td></tr><tr><td>Electra-Large</td><td>340M</td><td>https://huggingface.co/google/electra-large-discriminator</td></tr><tr><td>GPT2-Small</td><td>117M</td><td>https://huggingface.co/gpt2</td></tr><tr><td>GPT2-Medium</td><td>345M</td><td>https://huggingface.co/gpt2-medium</td></tr><tr><td>GPT2-Large</td><td>774 M</td><td></td></tr><tr><td>GPT2-XL</td><td>1558M</td><td>https://huggingface.co/gpt2-large</td></tr><tr><td>RoBerta-Base</td><td>125M</td><td>https://huggingface.co/gpt2-xl https://huggingface.co/roberta-base</td></tr><tr><td>RoBerta-Large</td><td>355M</td><td>https://huggingface.co/roberta-large</td></tr><tr><td>XLNet-Base</td><td>110 M</td><td>https://huggingface.co/xlnet-base-cased</td></tr><tr><td>XLNet-Large</td><td>340M</td><td>https://huggingface.co/xlnet-large-cased</td></tr><tr><td></td><td></td><td></td></tr></table>
|
| 324 |
+
|
| 325 |
+
# C.2 WIKIPEDIA DUMPS
|
| 326 |
+
|
| 327 |
+
All Wikipedia text data was pre-processed using the WikiExtractor provided by Attardi (2015). The dump files used as text corpora throughout the experiments of this paper are available in Table 12.
|
| 328 |
+
|
| 329 |
+
Table 12: Wikipedia dumps used in these experiments.
|
| 330 |
+
|
| 331 |
+
<table><tr><td>Language</td><td>URL</td></tr><tr><td>Arabic</td><td>https://dumps.wikimedia.org/arwiki/20200820/arwiki-20200820-pages-articles-multistream.xml.bz2</td></tr><tr><td>English</td><td>https://dumps.wikimedia.org/enwiki/20200820/enwiki-20200820-pages-articles-multistream.xml.bz2</td></tr><tr><td>Russian</td><td>https://dumps.wikimedia.org/ruwiki/20200820/ruwiki-20200820-pages-articles-multistream.xml.bz2</td></tr><tr><td>Spanish</td><td>https://dumps.wikimedia.org/eswiki/20200820/eswiki-20200820-pages-articles-multistream.xml.bz2</td></tr><tr><td>Swedish</td><td>https://umps.wikimedia.org/svwiki/20200820/svwiki-20200820-pages-articles-multistream.xml.bz2</td></tr></table>
|
md/train/PKubaeJkw3/PKubaeJkw3.md
ADDED
|
@@ -0,0 +1,396 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RETHINKING ARCHITECTURE SELECTION IN DIFFERENTIABLE NAS
|
| 2 |
+
|
| 3 |
+
Ruochen Wang1, Minhao Cheng1, Xiangning Chen1, Xiaocheng Tang2, Cho-Jui Hsieh1
|
| 4 |
+
1Department of Computer Science, UCLA, 2DiDi AI Labs
|
| 5 |
+
{ruocwang, mhcheng}@ucla.edu {xiangning, chohsieh}@cs.ucla.edu
|
| 6 |
+
xiaochengtang@didiglobal.com
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
Differentiable Neural Architecture Search is one of the most popular Neural Architecture Search (NAS) methods for its search efficiency and simplicity, accomplished by jointly optimizing the model weight and architecture parameters in a weight-sharing supernet via gradient-based algorithms. At the end of the search phase, the operations with the largest architecture parameters will be selected to form the final architecture, with the implicit assumption that the values of architecture parameters reflect the operation strength. While much has been discussed about the supernet’s optimization, the architecture selection process has received little attention. We provide empirical and theoretical analysis to show that the magnitude of architecture parameters does not necessarily indicate how much the operation contributes to the supernet’s performance. We propose an alternative perturbation-based architecture selection that directly measures each operation’s influence on the supernet. We re-evaluate several differentiable NAS methods with the proposed architecture selection and find that it is able to extract significantly improved architectures from the underlying supernets consistently. Furthermore, we find that several failure modes of DARTS can be greatly alleviated with the proposed selection method, indicating that much of the poor generalization observed in DARTS can be attributed to the failure of magnitude-based architecture selection rather than entirely the optimization of its supernet.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
Neural Architecture Search (NAS) has been drawing increasing attention in both academia and industry for its potential to automatize the process of discovering high-performance architectures, which have long been handcrafted. Early works on NAS deploy Evolutionary Algorithm (Stanley & Miikkulainen, 2002; Real et al., 2017; Liu et al., 2017) and Reinforcement Learning (Zoph & Le, 2017; Pham et al., 2018; Zhong et al., 2018) to guide the architecture discovery process. Recently, several one-shot methods have been proposed that significantly improve the search efficiency (Brock et al., 2018; Guo et al., 2019; Bender et al., 2018).
|
| 15 |
+
|
| 16 |
+
As a particularly popular instance of one-shot methods, DARTS (Liu et al., 2019) enables the search process to be performed with a gradient-based optimizer in an end-to-end manner. It applies continuous relaxation that transforms the categorical choice of architectures into continuous architecture parameters $\alpha$ . The resulting supernet can be optimized via gradient-based methods, and the operations associated with the largest architecture parameters are selected to form the final architecture. Despite its simplicity, several works cast doubt on the effectiveness of DARTS. For example, a simple randomized search (Li & Talwalkar, 2019) outperforms the original DARTS; Zela et al. (2020) observes that DARTS degenerates to networks filled with parametric-free operations such as the skip connection or even random noise, leading to the poor performance of the selected architecture.
|
| 17 |
+
|
| 18 |
+
While the majority of previous research attributes the failure of DARTS to its supernet optimization (Zela et al., 2020; Chen & Hsieh, 2020; Chen et al., 2021), little has been discussed about the validity of another important assumption: the value of α reflects the strength of the underlying operations. In this paper, we conduct an in-depth analysis of this problem. Surprisingly, we find that in many cases, $\alpha$ does not really indicate the operation importance in a supernet. Firstly, the operation associated with larger $\alpha$ does not necessarily result in higher validation accuracy after discretization. Secondly, as an important example, we show mathematically that the domination of skip connection observed in DARTS (i.e. $\alpha _ { s k i p }$ becomes larger than other operations.) is in fact a reasonable outcome of the supernet’s optimization but becomes problematic when we rely on $\alpha$ to select the best operation.
|
| 19 |
+
|
| 20 |
+
If $\alpha$ is not a good indicator of operation strength, how should we select the final architecture from a pretrained supernet? Our analysis indicates that the strength of each operation should be evaluated based on its contribution to the supernet performance instead. To this end, we propose an alternative perturbation-based architecture selection method. Given a pretrained supernet, the best operation on an edge is selected and discretized based on how much it perturbs the supernet accuracy; The final architecture is derived edge by edge, with fine-tuning in between so that the supernet remains converged for every operation decision. We re-evaluate several differentiable NAS methods (DARTS (Liu et al., 2019), SDARTS (Chen & Hsieh, 2020), SGAS (Li et al., 2020)) and show that the proposed selection method is able to consistently extract significantly improved architectures from the supernets than magnitude-based counterparts. Furthermore, we find that the robustness issues of DARTS can be greatly alleviated by replacing the magnitude-based selection with the proposed perturbation-based selection method.
|
| 21 |
+
|
| 22 |
+
# 2 BACKGROUND AND RELATED WORK
|
| 23 |
+
|
| 24 |
+
Preliminaries of Differentiable Architecture Search (DARTS) We start by reviewing the formulation of DARTS. DARTS’ search space consists of repetitions of cell-based microstructures. Every cell can be viewed as a DAG with N nodes and $\mathrm { E }$ edges, where each node represents a latent feature map $x ^ { i }$ , and each edge is associated with an operation $o$ (e.g. skip connect, sep conv $3 x 3$ ) from the search space $\mathcal { O }$ . Continuous relaxation is then applied to this search space. Concretely, every operation on an edge is activated during the search phase, with their outputs mixed by the architecture parameter α to form the final mixed output of that edge m¯ (xi) = Po∈O P exp αoo0 exp αo0 . This particular formulation allows the architecture search to be performed in a differentiable manner: DARTS jointly optimizes $\alpha$ and model weight $w$ with the following bilevel objective via alternative gradient updates:
|
| 25 |
+
|
| 26 |
+
$$
|
| 27 |
+
\operatorname* { m i n } _ { \alpha } \mathcal { L } _ { v a l } ( w ^ { * } , \alpha ) \mathrm { s . t . } w ^ { * } = \arg \operatorname* { m i n } _ { w } \mathcal { L } _ { t r a i n } ( w , \alpha ) .
|
| 28 |
+
$$
|
| 29 |
+
|
| 30 |
+
We refer to the continuous relaxed network used in the search phase as the supernet of DARTS. At the end of the search phase, the operation associated with the largest $\alpha _ { o }$ on each edge will be selected from the supernet to form the final architecture.
|
| 31 |
+
|
| 32 |
+
Failure mode analysis of DARTS Several works cast doubt on the robustness of DARTS. Zela et al. (2020) tests DARTS on four different search spaces and observes significantly degenerated performance. They empirically find that the selected architectures perform poorly when DARTS’ supernet falls into high curvature areas of validation loss (captured by large dominant eigenvalues of the Hessian $\nabla _ { \alpha , \alpha } ^ { 2 } \mathcal { L } _ { v a l } ( w , \alpha ) )$ . While Zela et al. (2020) relates this problem to the failure of supernet training in DARTS, we examine it from the architecture selection aspects of DARTS, and show that much of DARTS’ robustness issue can be alleviated by a better architecture selection method.
|
| 33 |
+
|
| 34 |
+
Progressive search space shrinking There is a line of research on NAS that focuses on reducing the search cost and aligning the model sizes of the search and evaluation phases via progressive search space shrinking (Liu et al., 2018; Li et al., 2019; Chen et al., 2021; Li et al., 2020). The general scheme of these methods is to prune out weak operations and edges sequentially during the search phase, based on the magnitude of $\alpha$ following DARTS. Our method is orthogonal to them in this respect, since we select operations based on how much it contributes to the supernet’s performance rather than the $\alpha$ value. Although we also discretize edges greedily and fine-tune the network in between, the purpose is to let the supernet recover from the loss of accuracy after discretization to accurately evaluate operation strength on the next edge, rather than to reduce the search cost.
|
| 35 |
+
|
| 36 |
+
# 3 THE PITFALL OF MAGNITUDE-BASED ARCHITECTURE SELECTION IN DARTS
|
| 37 |
+
|
| 38 |
+
In this section, we put forward the opinion that the architecture parameter $\alpha$ does not necessarily represent the strength of the underlying operation in general, backed by both empirical and theoretical evidence. As an important example, we mathematically justify that the skip connection domination phenomenon observed in DARTS is reasonable by itself, and becomes problematic when combined with the magnitude-based architecture selection.
|
| 39 |
+
|
| 40 |
+
# 3.1 $\alpha$ MAY NOT REPRESENT THE OPERATION STRENGTH
|
| 41 |
+
|
| 42 |
+

|
| 43 |
+
Figure 1: $\alpha$ vs discretization accuracy at convergence of all operations on 3 randomly selected edges from a pretrained DARTS supernet (one subplot per edge). The magnitude of $\alpha$ for each operation does not necessarily agree with its relative discretization accuracy at convergence.
|
| 44 |
+
|
| 45 |
+

|
| 46 |
+
Figure 2: Operation strength on each edge of S2 (skip connect, sep conv ${ _ { - 3 x 3 } }$ ). (a). Operations associated with the largest $\alpha$ . (b). Operations that result in the highest discretization validation accuracy at convergence. Parameterized operations are marked red.
|
| 47 |
+
|
| 48 |
+
Following DARTS, existing differentiable NAS methods use the value of architecture parameters $\alpha$ to select the final architecture from the supernet, with the implicit assumption that $\alpha$ represents the strength of the underlying operations. In this section, we study the validity of this assumption in detail.
|
| 49 |
+
|
| 50 |
+
Consider one edge on a pretrained supernet; the strength of an operation on the edge can be naturally defined as the supernet accuracy after we discretize to this operation and fine-tune the remaining network until it converges again; we refer to this as ”discretization accuracy at convergence” for short. The operation that achieves the best discretization accuracy at convergence can be considered as the best operation for the given edge. Figure 1 shows the comparison of $\alpha$ (blue) and operation strength (orange) of randomly select edges on DARTS supernet. As we can see, the magnitude of $\alpha$ for each operation does not necessarily agree with their relative strength measured by discretization accuracy at convergence. Moreover, operations assigned with small $\alpha \mathbf { s }$ are sometimes strong ones that lead to high discretization accuracy at convergence. To further verify the mismatch, we investigate the operation strength on search space S2, where DARTS fails dramatically due to excessive skip connections (Zela et al., 2020). S2 is a variant of DARTS search space that only contains two operations per edge (skip connect, sep conv ${ _ { 3 x 3 } }$ ). Figure 2 shows the selected operations based on $\alpha$ (left) and operation strength (right) on all edges on S2. From Figure 2a, we can see that αskip connect $> \alpha _ { s e p . c o n v . 3 x 3 }$ on 12 of 14 edges. Consequently, the derived child architecture will lack representation ability and perform poorly due to too many skip connections. However, as shown in Figure 2b, the supernet benefits more from discretizing to sep conv 3x3 than skip connect on half of the edges.
|
| 51 |
+
|
| 52 |
+
# 3.2 A CASE STUDY: SKIP CONNECTION
|
| 53 |
+
|
| 54 |
+
Several works point out that DARTS tends to assign large $\alpha$ to skip connections, resulting in shallow architectures with poor generability (Zela et al., 2020; Liang et al., 2019; Bi et al., 2019). This ”skip connection domination” issue is generally attributed to the failure of DARTS’ supernet optimization. In contrast, we draw inspiration from research on ResNet (He et al., 2016) and show that this phenomenon by itself is a reasonable outcome while DARTS refines its estimation of the optimal feature map, rendering $\alpha _ { s k i p }$ ineffective in the architecture selection.
|
| 55 |
+
|
| 56 |
+
In vanilla networks (e.g., VGG), each layer computes a new level of feature map from the output feature map of the predecessor layer; thus, reordering layers at test time would dramatically hurt the performance (Veit et al., 2016). Unlike vanilla networks, Greff et al. (2017) and Veit et al. (2016) discover that successive layers in ResNet with compatible channel sizes are in fact estimating the same optimal feature map so that the outputs of these layers
|
| 57 |
+
|
| 58 |
+
Table 1: Test accuracy before and after layer (edge) shuffling on cifar10. For ResNet and VGG, we randomly swap two layers in each stage (defined as successive layers between two downsampling blocks. For DARTS supernet, we randomly swap two edges in every cell.
|
| 59 |
+
|
| 60 |
+
<table><tr><td></td><td>VGG</td><td>ResNet</td><td>DARTS</td></tr><tr><td>Before</td><td>92.69</td><td>93.86</td><td>88.44</td></tr><tr><td>After</td><td>9.83 ± 0.33</td><td>83.2015 ± 2.03</td><td>81.09 ± 1.87</td></tr></table>
|
| 61 |
+
|
| 62 |
+
stay relatively close to each other at convergence; As a result, ResNet’s test accuracy remains robust under layer reordering. Greff et al. (2017) refers to this unique way of feature map estimation in ResNet as the ”unrolled estimation.”
|
| 63 |
+
|
| 64 |
+
DARTS’ supernet resembles ResNet, rather than vanilla networks like VGG, in both appearance and behavior. Appearance-wise, within a cell of DARTS’ supernet, edges with skip connection are in direct correspondence with the successive residual layers in ResNet. Behavior-wise, DARTS’ supernet also exhibits a high degree of robustness under edge shuffling. As shown in Table 1, randomly reordering edges on a pretrained DARTS’ supernet at test time also has little effect on its performance. This evidence indicates that DARTS performs unrolled estimation like ResNet as well, i.e., edges within a cell share the same optimal feature map that they try to estimate. In the following proposition, we apply this finding and provide the optimal solution of $\alpha$ in the sense of minimizing the variance of feature map estimation.
|
| 65 |
+
|
| 66 |
+
Proposition 1. 1 Without loss of generality, consider one cell from a simplified search space consists of two operations: (skip, conv). Let $m ^ { * }$ denotes the optimal feature map, which is shared across all edges according to the unrolled estimation view (Greff et al., 2017). Let $o _ { e } ( x _ { e } )$ be the output of convolution operation, and let $x _ { e }$ be the skip connection (i.e., the input feature map of edge e). Assume $m ^ { * }$ , $o _ { e } ( x _ { e } )$ and $x _ { e }$ are normalized to the same scale. The current estimation of $m ^ { * }$ can then be written as:
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\overline { { { m } } } _ { e } ( x _ { e } ) = \frac { \exp ( \alpha _ { c o n v } ) } { \exp ( \alpha _ { c o n v } ) + \exp ( \alpha _ { s k i p } ) } o _ { e } ( x _ { e } ) + \frac { \exp ( \alpha _ { s k i p } ) } { \exp ( \alpha _ { c o n v } ) + \exp ( \alpha _ { s k i p } ) } x _ { e } ,
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
where $\alpha _ { c o n v }$ and $\alpha _ { s k i p }$ are the architecture parameters defined in DARTS. The optimal $\alpha _ { c o n v } ^ { * }$ and $\alpha _ { s k i p } ^ { * }$ minimizing v $a r \mathbf { \hat { ( } } \overline { { m } } _ { e } ( x _ { e } ) - m ^ { * } )$ , the variance of the difference between the optimal feature map $m ^ { * }$ and its current estimation $\overline { { m } } _ { e } ( x _ { e } )$ , are given by:
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\begin{array} { l } { \alpha _ { c o n v } ^ { * } \propto v a r ( x _ { e } - m ^ { * } ) } \\ { \alpha _ { s k i p } ^ { * } \propto v a r ( o _ { e } ( x _ { e } ) - m ^ { * } ) . } \end{array}
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
We refer the reader to Appendix A.4 for detailed proof. From eq. (3) and eq. (4), we can see that the relative magnitudes of $\alpha _ { s k i p }$ and $\alpha _ { c o n v }$ come down to which one of $x _ { e }$ or $o _ { e } ( x _ { e } )$ is closer to $m ^ { * }$ in variance:
|
| 79 |
+
|
| 80 |
+
• $o _ { e } ( x _ { e } )$ is the output of a single convolution operation instead of the complete mixed output of edge $e$ , so it will deviate from $m ^ { * }$ even at convergence.
|
| 81 |
+
|
| 82 |
+
Therefore, in a well-optimized supernet, $x _ { e }$ will naturally be closer to $m ^ { * }$ than $o _ { e } ( x _ { e } )$ , causing $\alpha _ { s k i p }$ to be greater than $\alpha _ { c o n v }$ .
|
| 83 |
+
|
| 84 |
+
Our analysis above indicates that the better the supernet, the larger the $( \alpha _ { s k i p } - \alpha _ { c o n v } )$ gap (softmaxed) will become since $x _ { e }$ gets closer and closer to $m ^ { * }$ as the supernet is optimized. This result is evidenced in Figure 3, where $m e a n ( \alpha _ { s k i p } - \alpha _ { c o n v } )$ continues to grow as the supernet gets better. In this case, although $\alpha _ { s k i p } > \alpha _ { c o n v }$ is reasonable by itself, it becomes an inductive bias to NAS if we were to select the final architecture based on $\alpha$ .
|
| 85 |
+
|
| 86 |
+
# 4 PERTURBATION-BASED ARCHITECTURE SELECTION
|
| 87 |
+
|
| 88 |
+

|
| 89 |
+
Figure 3: $m e a n ( \alpha _ { s k i p } - \alpha _ { c o n v } )$ (softmaxed) v.s. supernet’s validation accuracy. The gap of $( \alpha _ { s k i p } - \alpha _ { c o n v } )$ increases as supernet gets better.
|
| 90 |
+
|
| 91 |
+
Instead of relying on the $\alpha$ value to select the best operation, we propose to directly evaluate operation strength in
|
| 92 |
+
|
| 93 |
+
terms of its contribution to the supernet’s performance. The operation selection criterion is laid out in section 4.1. In section 4.2, we describe the entire architecture selection process.
|
| 94 |
+
|
| 95 |
+
# 4.1 EVALUATING THE STRENGTH OF EACH OPERATION
|
| 96 |
+
|
| 97 |
+
In section 3.1, we define the strength of each operation on a given edge as how much it contributes to the performance of the supernet, measured by discretization accuracy. To avoid inaccurate evaluation due to large disturbance of the supernet during discretization, we fine-tune the remaining supernet until it converges again, and then compute its validation accuracy (discretization accuracy at convergence). The fine-tuning process needs to be carried out for evaluating each operation on an edge, leading to substantial computation costs.
|
| 98 |
+
|
| 99 |
+
To alleviate the computational overhead, we consider a more practical measure of operation strength: for each operation on a given edge, we mask it out while keeping all other operations, and re-evaluate the supernet. The one that results in the largest drop in the supernet’s validation accuracy will be considered as the most important operation on that edge. This alternative criterion incurs much less perturbation to the supernet than discretization since it only deletes one operation from the supernet at a time. As a result, the supernet’s validation accuracy after deletion stays close to the unmodified supernet, and thus it alleviates the requirement of tuning the remaining supernet to convergence. Therefore, we implement this measurement for the operation selection in this work.
|
| 100 |
+
|
| 101 |
+
Input: A pretrained supernet $S$ , Set of edges $\mathcal { E }$ from $S$ , Set of nodes $\mathcal { N }$ from $S$
|
| 102 |
+
Result: Set of selected operations $\{ o _ { e } ^ { * } \} _ { e \in \mathcal { E } }$
|
| 103 |
+
while $| \mathcal { E } | > 0$ do randomly select an edge $e \in { \mathcal { E } }$ (and remove it from $\mathcal { E }$ ); forall operation o on edge $e$ do evaluate the validation accuracy of $S$ when $o$ is removed $( A C C _ { \backslash o } )$ ; end select the best operation for $e$ : $\begin{array} { r } { o _ { e } ^ { * } \gets \operatorname * { a r g m i n } _ { o } A C C _ { \backslash o } } \end{array}$ ; discretize edge $e$ to $o _ { e } ^ { * }$ and tune the remaining supernet for a few epochs;
|
| 104 |
+
end
|
| 105 |
+
|
| 106 |
+
# 4.2 THE COMPLETE ARCHITECTURE SELECTION PROCESS
|
| 107 |
+
|
| 108 |
+
Our method operates directly on top of DARTS’ pretrained supernet. Given a supernet, we randomly iterate over all of its edges. We evaluate each operation on an edge, and select the best one to be discretized based on the measurement described in section 4.1. After that, we tune the supernet for a few epochs to recover the accuracy lost during discretization. The above steps are repeated until all edges are decided. Algorithm 1 summarizes the operation selection process. The cell topology is decided in a similar fashion. We refer the reader to Appendix A.3 for the full algorithm, including deciding the cell topology. This simple method is termed ”perturbation-based architecture selection (PT)” in the following sections.
|
| 109 |
+
|
| 110 |
+
# 5 EXPERIMENTAL RESULTS
|
| 111 |
+
|
| 112 |
+
In this section, we demonstrate that the perturbation-based architecture selection method is able to consistently find better architectures than those selected based on the values of $\alpha$ . The evaluation is based on the search space of DARTS and NAS-Bench-201 (Dong & Yang, 2020), and we show that the perturbation-based architecture selection method can be applied to several variants of DARTS.
|
| 113 |
+
|
| 114 |
+
# 5.1 RESULTS ON DARTS’ CNN SEARCH SPACE
|
| 115 |
+
|
| 116 |
+
We keep all the search and retrain settings identical to DARTS since our method only modifies the architecture selection part. After the search phase, we perform perturbation-based architecture selection following Algorithm 1 on the pretrained supernet. We tune the supernet for 5 epochs between two selections as it is enough for the supernet to recover from the drop of accuracy after discretization. We run the search and architecture selection phase with four random seeds and report both the best and average test errors of the obtained architectures.
|
| 117 |
+
|
| 118 |
+
As shown in Table 2, the proposed method (DARTS $+ \mathrm { P T }$ ) improves DARTS’ test error from $3 . 0 0 \%$ to $2 . 6 1 \%$ , with manageable search cost (0.8 GPU days). Note that by only changing the architecture selection method, DARTS performs significantly better than many other differentiable NAS methods that enjoy carefully designed optimization process of the supernet, such as GDAS (Dong & Yang, 2019) and SNAS (Xie et al., 2019). This empirical result suggests that architecture selection is crucial to DARTS: with the proper selection algorithm, DARTS remains a very competitive method.
|
| 119 |
+
|
| 120 |
+
Our method is also able to improve the performance of other variants of DARTS. To show this, we evaluate our method on SDARTS(rs) and SGAS (Chen & Hsieh, 2020; Li et al., 2020). SDARTS(rs) is a variant of DARTS that regularizes the search phase by applying Gaussian perturbation to $\alpha$ . Unlike DARTS and SDARTS, SGAS performs progressive search space shrinking. Concretely, SGAS progressively discretizes its edges with the order from most to least important, based on a novel edge importance score. For a fair comparison, we keep its unique search space shrinking process unmodified and only replace its magnitude-based operation selection with ours. As we can see from Table 2, our method consistently achieves better average test errors than its magnitudebased counterpart. Concretely, the proposed method improves SDARTS’ test error from $2 . 6 7 \%$ to $2 . 5 4 \%$ and SGAS’ test error from $2 . 6 6 \%$ to $2 . 5 6 \%$ . Moreover, the best architecture discovered in our experiments achieves a test error of $2 . 4 4 \%$ , ranked top among other NAS methods.
|
| 121 |
+
|
| 122 |
+

|
| 123 |
+
5.2 PERFORMANCE ON NAS-BENCH-201 SEARCH SPACE
|
| 124 |
+
Figure 4: Trajectory of test accuracy on space NAS-Bench-201 and three datasets (Left: cifar10, Middle: cifar100, Right: Imagenet16-120). The test accuracy of our method is plotted by taking the snapshots of DARTS’ supernet at corresponding epochs and run our selection method on top of it.
|
| 125 |
+
|
| 126 |
+
To further verify the effectiveness of the proposed perturbation-based architecture selection, we conduct experiments on NAS-Bench-201. NAS-Bench-201 provides a unified cell-based search space similar to DARTS. Every architecture in the search space is trained under the same protocol on three datasets (cifar10, cifar100, and imagenet16-120), and their performance can be obtained by querying the database. As in section 5.1, we take the pretrained supernet from DARTS and apply our method on top of it. All other settings are kept unmodified. Figure 4 shows the performance trajectory of DARTS+PT compared with DARTS. While the architectures found by magnitude-based selection degenerates over time, the perturbation-based method is able to extract better architectures from the same underlying supernets stably. The result implies that the DARTS’ degenerated performance comes from the failure of magnitude based architecture selection.
|
| 127 |
+
|
| 128 |
+
Table 2: Comparison with state-of-the-art image classifiers on CIFAR-10.
|
| 129 |
+
|
| 130 |
+
<table><tr><td>Architecture</td><td>Test Error (%)</td><td>Params (M)</td><td>Search Cost (GPU days)</td><td>Search Method</td></tr><tr><td>DenseNet-BC (Huang etal.,2017)</td><td>3.46</td><td>25.6</td><td>-</td><td>manual</td></tr><tr><td>NASNet-A (Zoph et al.,2018)</td><td>2.65</td><td>3.3</td><td>2000</td><td>RL</td></tr><tr><td>AmoebaNet-A (Real etal.,2019)</td><td>3.34± 0.06</td><td>3.2</td><td>3150</td><td>evolution</td></tr><tr><td>AmoebaNet-B (Real et al.,2019)</td><td>2.55 ± 0.05</td><td>2.8</td><td>3150</td><td>evolution</td></tr><tr><td>PNAS (Liu et al.,2018)*</td><td>3.41 ± 0.09</td><td>3.2</td><td>225</td><td>SMBO</td></tr><tr><td>ENAS (Pham et al.,2018)</td><td>2.89</td><td>4.6</td><td>0.5</td><td>RL</td></tr><tr><td>NAONet (Luo et al.,2018)</td><td>3.53</td><td>3.1</td><td>0.4</td><td>NAO</td></tr><tr><td>SNAS (moderate) (Xie et al.,2019)</td><td>2.85±0.02</td><td>2.8</td><td>1.5</td><td>gradient</td></tr><tr><td>GDAS(Dong& Yang,2019)</td><td>2.93</td><td>3.4</td><td>0.3</td><td>gradient</td></tr><tr><td>BayesNAS (Zhou et al.,2019)</td><td>2.81± 0.04</td><td>3.4</td><td>0.2</td><td>gradient</td></tr><tr><td>ProxylessNAS (Cai et al.,2019)†</td><td>2.08</td><td>5.7</td><td>4.0</td><td>gradient</td></tr><tr><td>NASP(Yao et al.,2020)</td><td>2.83±0.09</td><td>3.3</td><td>0.1</td><td>gradient</td></tr><tr><td>P-DARTS (Chen et al.,2019)</td><td>2.50</td><td>3.4</td><td>0.3</td><td>gradient</td></tr><tr><td>PC-DARTS (Xu et al.,2020)</td><td>2.57 ± 0.07</td><td>3.6</td><td>0.1</td><td>gradient</td></tr><tr><td>R-DARTS (L2) Zela et al. (2020)</td><td>2.95 ± 0.21</td><td>-</td><td>1.6</td><td>gradient</td></tr><tr><td>DARTS (Liu et al.,2019)</td><td>3.00±0.14</td><td>3.3</td><td>0.4</td><td>gradient</td></tr><tr><td>SDARTS-RS (Chen& Hsieh,2020)</td><td>2.67± 0.03</td><td>3.4</td><td>0.4</td><td>gradient</td></tr><tr><td>SGAS(Cri 1.avg) (Li et al.,2020)</td><td>2.66 ± 0.24</td><td>3.7</td><td>0.25</td><td>gradient</td></tr><tr><td>DARTS+PT (avg)*</td><td>2.61±0.08</td><td>3.0</td><td>0.8t</td><td>gradient</td></tr><tr><td>DARTS+PT (best)</td><td>2.48</td><td>3.3</td><td>0.8t</td><td>gradient</td></tr><tr><td>SDARTS-RS+PT (avg)*</td><td>2.54 ± 0.10</td><td>3.3</td><td>0.8t</td><td></td></tr><tr><td>SDARTS-RS+PT(best)</td><td>2.44</td><td>3.2</td><td>0.8t</td><td>gradient</td></tr><tr><td>SGAS+PT (Crit.1 avg)*</td><td>2.56 ± 0.10</td><td>3.9</td><td>0.29t</td><td>gradient gradient</td></tr><tr><td>SGAS+PT (Crit.1 best)</td><td>2.46</td><td>3.9</td><td>0.29t</td><td>gradient</td></tr></table>
|
| 131 |
+
|
| 132 |
+
† Obtained on a different space with PyramidNet (Han et al., 2017) as the backbone. ‡ Recorded on a single GTX 1080Ti GPU. ∗ Obtained by running the search and retrain phase under four different seeds and computing the average test error of the derived architectures.
|
| 133 |
+
|
| 134 |
+
# 6 ANALYSIS
|
| 135 |
+
|
| 136 |
+
# 6.1 ISSUE WITH THE ROBUSTNESS OF DARTS
|
| 137 |
+
|
| 138 |
+
Zela et al. (2020) observes that DARTS tends to yield degenerate architectures with abysmal performance. We conjecture that this robustness issue of DARTS can be explained by the failure of magnitude-based architecture selection.
|
| 139 |
+
|
| 140 |
+
To show this, we test DARTS’ performance with perturbation-based architecture selection on four spaces proposed by Zela et al. (2020) (S1-S4). The complete specifications of these spaces can be found in Appendix A.2. Given a supernet, the architecture selected based on $\alpha$ performs poorly across spaces and datasets (column 3 in Table 3). However, our method is able to consistently extract meaningful architectures with significantly improved performance (Column 4 in Table 3).
|
| 141 |
+
|
| 142 |
+
Table 3: DARTS+PT on S1-S4 (test error $( \% ) _ { . }$
|
| 143 |
+
|
| 144 |
+
<table><tr><td>Dataset</td><td>Space</td><td>DARTS</td><td>DARTS+PT(Ours)</td><td>DARTS+PT(fixα)*</td></tr><tr><td rowspan="4">C10</td><td>S1</td><td>3.84</td><td>3.50</td><td rowspan="4">2.86</td></tr><tr><td>S2</td><td>4.85</td><td>2.79</td><td>2.59</td></tr><tr><td>S3</td><td>3.34</td><td>2.49</td><td>2.52</td></tr><tr><td>S4</td><td>7.20</td><td>2.64</td><td>2.58</td></tr><tr><td rowspan="4">C100</td><td>S1</td><td>29.46</td><td>24.48</td><td rowspan="4">24.40</td></tr><tr><td>S2</td><td>26.05</td><td>23.16</td><td>23.30</td></tr><tr><td>S3</td><td>28.90</td><td>22.03</td><td></td></tr><tr><td>S4</td><td>22.85</td><td>20.80</td><td>21.94 20.66</td></tr><tr><td rowspan="4">SVHN</td><td>S1</td><td>4.58</td><td>2.62</td><td>2.39</td></tr><tr><td>S2</td><td>3.53</td><td>2.53</td><td>2.32</td></tr><tr><td>S3</td><td>3.41</td><td>2.42</td><td>2.32</td></tr><tr><td>S4</td><td>3.05</td><td>2.42</td><td>2.39</td></tr></table>
|
| 145 |
+
|
| 146 |
+
? This column will be explained later in Section 6.3
|
| 147 |
+
|
| 148 |
+
Notably, DART $\mathrm { S + P T }$ is able to find meaningful architecture on S2 (skip connect, sep conv ${ } _ { - 3 x 3 }$ ) and S4 (noise, sep conv $3 x 3$ ), where DARTS failed dramatically. As shown in Figure 5, on S2, while magnitude-based selection degenerates to architectures filled with skip connections, DART $\mathrm { \bf S } { + } \mathrm { \bf P T }$ is able to find architecture with 4 convolutions; On S4, DART $\mathrm { \ s + P T }$ consistently favors sep conv 3x3 on edges where $\alpha$ selects noise.
|
| 149 |
+
|
| 150 |
+

|
| 151 |
+
Figure 5: Comparison of normal cells found on S2 and S4. The perturbation-based architecture selection (DARTS $+ \mathrm { P T }$ ) is able to find reasonable architectures in cases where the magnitude-based method (DARTS) fails dramatically. The complete architecture can be found in Appendix A.9. Non-trivial operations are marked red.
|
| 152 |
+
|
| 153 |
+
# 6.2 PROGRESSIVE TUNING
|
| 154 |
+
|
| 155 |
+
In addition to operation selection, we also tune the supernet after an edge is discretized so that the supernet could regain the lost accuracy. To measure the effectiveness of our operation selection criterion alone, we conduct an ablation study on the progressive tuning part. Concretely, we test a baseline by combining progressive tuning with magnitude-based operation selection instead of our selection criterion, which we code-named DARTS $+$ PT-Mag. Figure 6 plots the change of validation accuracy of DART $\mathrm { \bf S } { + } \mathrm { \bf P T }$ and DARTS $+$ PT-Mag during the operation selection phase. As we can see, DART $\mathsf { s } + \mathsf { P T }$ is able to identify better operations that lead to higher validation accuracy than the magnitude-based alternative, revealing the effectiveness of our operation selection criteria. Moreover, DARTS+PT-Mag is only able to obtain a test error of $2 . 8 5 \%$ on DARTS space
|
| 156 |
+
|
| 157 |
+

|
| 158 |
+
Figure 6: The trajectory of validation accuracy in the operation selection phase on S2. DARTS $+ \mathrm { P T }$ is able to select better operations that lead to higher accuracy of the supernet than DARTS $\mathrm { \Phi + P T }$ - Mag.
|
| 159 |
+
|
| 160 |
+
on cifar10, much worse than DART $\mathsf { S } { + } \mathsf { P T }$ $( 2 . 6 1 \% )$ , indicating that the operation selection part plays a crucial role in our method.
|
| 161 |
+
|
| 162 |
+
# 6.3 FIXING $\alpha$ AS UNIFORM
|
| 163 |
+
|
| 164 |
+
Since the proposed method does not rely on $\alpha$ for architecture selection, a natural question is whether it is necessary to optimize a stand-alone $\alpha$ . We find that by fixing $\alpha = 0$ (uniform weights for all the operations) while training supernet and applying perturbation-based architecture se
|
| 165 |
+
|
| 166 |
+
Table 4: DART $\mathrm { \bf S } { + } \mathrm { \bf P T }$ v.s. DART $\mathrm { S } { + } \mathrm { P T }$ (fixed $\alpha$ ) on more spaces (test error $\%$ ) on cifar10.
|
| 167 |
+
|
| 168 |
+
<table><tr><td>Space</td><td>DARTS</td><td>DARTS+PT</td><td>DARTS+PT (fix α)</td></tr><tr><td>DARTS Space</td><td>3.00</td><td>2.61</td><td>2.87</td></tr><tr><td>NAS-Bench-201</td><td>45.7</td><td>11.89</td><td>6.20</td></tr></table>
|
| 169 |
+
|
| 170 |
+
lection, the resulting method performs on-par with DART $\mathrm { \Delta } \mathrm { S } { + } \mathrm { P T } ,$ , and in some cases even better. For example, DARTS $\mathrm { \Phi } _ { \mathrm { + P T } }$ (fix $\alpha$ ) achieves better performance than DARTS $\mathrm { \Phi + P T }$ on NAS-Bench-201. On DARTS’ search space and its variants S1-S4, DART $\mathrm { \bf S } { + } \mathrm { \bf P T }$ (fix $\alpha$ ) performs similarly to DART $\mathrm { \bf { S } } { + } \mathrm { \bf { P } } \mathrm { \bf { T } }$ . The results can be found in Table 3 and Table 4. This surprising finding suggests that even the most naive approach, simply training a supernet without $\alpha$ , will be a competitive method when combining with the proposed perturbation-based architecture selection.
|
| 171 |
+
|
| 172 |
+
# 7 CONCLUSION AND DISCUSSION
|
| 173 |
+
|
| 174 |
+
This paper attempts to understand Differentiable NAS methods from the architecture selection perspective. We re-examine the magnitude-based architecture selection process of DARTS and provide empirical and theoretical evidence on why it does not indicate the underlying operation strength. We introduce an alternative perturbation-based architecture selection method that directly measures the operation strength via its contribution to the supernet performance. The proposed selection method is able to consistently extract improved architecture from supernets trained identically to the respective base methods on several spaces and datasets.
|
| 175 |
+
|
| 176 |
+
Our method brings more freedom in supernet training as it does not rely on $\alpha$ to derive the final architecture. We hope the perturbation-based architecture selection can bring a new perspective to the NAS community to rethink the role of $\alpha$ in Differential NAS.
|
| 177 |
+
|
| 178 |
+
# ACKNOWLEDGEMENT
|
| 179 |
+
|
| 180 |
+
This work is supported in part by NSF under IIS-1901527, IIS-2008173, IIS-2048280 and by Army Research Laboratory under agreement number W911NF-20-2-0158.
|
| 181 |
+
|
| 182 |
+
# REFERENCES
|
| 183 |
+
|
| 184 |
+
Gabriel Bender, Pieter-Jan Kindermans, Barret Zoph, Vijay Vasudevan, and Quoc Le. Understanding and simplifying one-shot architecture search. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 550–559, Stockholmsmassan, Stockholm Sweden, 10–15 Jul ¨ 2018. PMLR. URL http://proceedings.mlr.press/v80/bender18a.html.
|
| 185 |
+
|
| 186 |
+
Kaifeng Bi, Changping Hu, Lingxi Xie, Xin Chen, Longhui Wei, and Qi Tian. Stabilizing darts with amended gradient estimation on architectural parameters, 2019.
|
| 187 |
+
|
| 188 |
+
Andrew Brock, Theo Lim, J.M. Ritchie, and Nick Weston. SMASH: One-shot model architecture search through hypernetworks. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $=$ rydeCEhs-.
|
| 189 |
+
|
| 190 |
+
Han Cai, Ligeng Zhu, and Song Han. ProxylessNAS: Direct neural architecture search on target task and hardware. In International Conference on Learning Representations, 2019. URL https: //openreview.net/forum?id $=$ HylVB3AqYm.
|
| 191 |
+
|
| 192 |
+
Xiangning Chen and Cho-Jui Hsieh. Stabilizing differentiable architecture search via perturbationbased regularization. In Hal Daume III and Aarti Singh (eds.), ´ Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pp. 1554–1565. PMLR, 13–18 Jul 2020. URL http://proceedings.mlr.press/ v119/chen20f.html.
|
| 193 |
+
|
| 194 |
+
Xiangning Chen, Ruochen Wang, Minhao Cheng, Xiaocheng Tang, and Cho-Jui Hsieh. DrNAS: Dirichlet neural architecture search. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id ${ . } = { }$ 9FWas6YbmB3.
|
| 195 |
+
|
| 196 |
+
Xin Chen, Lingxi Xie, Jun Wu, and Qi Tian. Progressive differentiable architecture search: Bridging the depth gap between search and evaluation. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1294–1303, 2019.
|
| 197 |
+
|
| 198 |
+
Xuanyi Dong and Yi Yang. Searching for a robust neural architecture in four gpu hours. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1761– 1770, 2019.
|
| 199 |
+
|
| 200 |
+
Xuanyi Dong and Yi Yang. Nas-bench-201: Extending the scope of reproducible neural architecture search. In International Conference on Learning Representations (ICLR), 2020.
|
| 201 |
+
|
| 202 |
+
Klaus Greff, Rupesh K. Srivastava, and Jurgen Schmidhuber. Highway and residual networks learn ¨ unrolled iterative estimation. In International Conference on Learning Representations (ICLR), 2017.
|
| 203 |
+
|
| 204 |
+
Zichao Guo, Xiangyu Zhang, Haoyuan Mu, Wen Heng, Zechun Liu, Yichen Wei, and Jian Sun. Single path one-shot neural architecture search with uniform sampling, 2019.
|
| 205 |
+
|
| 206 |
+
Dongyoon Han, Jiwhan Kim, and Junmo Kim. Deep pyramidal residual networks. 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Jul 2017.
|
| 207 |
+
|
| 208 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In IEEE Conference on Computer Vision and Pattern Recognition, pp. 770–778, 06 2016. doi: 10.1109/CVPR.2016.90.
|
| 209 |
+
|
| 210 |
+
Gao Huang, Zhuang Liu, Laurens van der Maaten, and Kilian Q. Weinberger. Densely connected convolutional networks. 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Jul 2017. doi: 10.1109/cvpr.2017.243. URL http://dx.doi.org/10.1109/ CVPR.2017.243.
|
| 211 |
+
|
| 212 |
+
Guilin Li, Xing Zhang, Zitong Wang, Zhenguo Li, and Tong Zhang. Stacnas: Towards stable and consistent differentiable neural architecture search, 2019.
|
| 213 |
+
|
| 214 |
+
Guohao Li, Guocheng Qian, Itzel C. Delgadillo, Matthias Muller, Ali Thabet, and Bernard Ghanem. Sgas: Sequential greedy architecture search. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1620–1630, 2020.
|
| 215 |
+
|
| 216 |
+
Liam Li and Ameet Talwalkar. Random search and reproducibility for neural architecture search, 2019.
|
| 217 |
+
|
| 218 |
+
Hanwen Liang, Shifeng Zhang, Jiacheng Sun, Xingqiu He, Weiran Huang, Kechen Zhuang, and Zhenguo Li. Darts+: Improved differentiable architecture search with early stopping, 2019.
|
| 219 |
+
|
| 220 |
+
Chenxi Liu, Barret Zoph, Maxim Neumann, Jonathon Shlens, Wei Hua, Li-Jia Li, Li Fei-Fei, Alan Yuille, Jonathan Huang, and Kevin Murphy. Progressive neural architecture search. Lecture Notes in Computer Science, pp. 19–35, 2018.
|
| 221 |
+
|
| 222 |
+
Hanxiao Liu, Karen Simonyan, Oriol Vinyals, Chrisantha Fernando, and Koray Kavukcuoglu. Hierarchical representations for efficient architecture search, 2017.
|
| 223 |
+
|
| 224 |
+
Hanxiao Liu, Karen Simonyan, and Yiming Yang. DARTS: Differentiable architecture search. In International Conference on Learning Representations, 2019.
|
| 225 |
+
|
| 226 |
+
Renqian Luo, Fei Tian, Tao Qin, Enhong Chen, and Tie-Yan Liu. Neural architecture optimization. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. CesaBianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems 31, pp. 7816–7827. Curran Associates, Inc., 2018. URL http://papers.nips.cc/paper/ 8007-neural-architecture-optimization.pdf.
|
| 227 |
+
|
| 228 |
+
Hieu Pham, Melody Guan, Barret Zoph, Quoc Le, and Jeff Dean. Efficient neural architecture search via parameters sharing. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 4095–4104, Stockholmsmassan, Stockholm Sweden, 10–15 Jul 2018. PMLR. ¨
|
| 229 |
+
|
| 230 |
+
Esteban Real, Sherry Moore, Andrew Selle, Saurabh Saxena, Yutaka Leon Suematsu, Jie Tan, Quoc V. Le, and Alexey Kurakin. Large-scale evolution of image classifiers. In Proceedings of the 34th International Conference on Machine Learning - Volume 70, ICML’17, pp. 2902–2911. JMLR.org, 2017.
|
| 231 |
+
|
| 232 |
+
Esteban Real, Alok Aggarwal, Yanping Huang, and Quoc V. Le. Regularized evolution for image classifier architecture search. Proceedings of the AAAI Conference on Artificial Intelligence, 33: 4780–4789, Jul 2019. ISSN 2159-5399. doi: 10.1609/aaai.v33i01.33014780. URL http: //dx.doi.org/10.1609/aaai.v33i01.33014780.
|
| 233 |
+
|
| 234 |
+
Kenneth O. Stanley and Risto Miikkulainen. Evolving neural networks through augmenting topologies. Evolutionary Computation, 10(2):99–127, 2002. doi: 10.1162/106365602320169811. URL https://doi.org/10.1162/106365602320169811.
|
| 235 |
+
|
| 236 |
+
Andreas Veit, Michael Wilber, and Serge Belongie. Residual networks behave like ensembles of relatively shallow networks. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. CesaBianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems 29, pp. 550— -558. Curran Associates, Inc., 2016.
|
| 237 |
+
|
| 238 |
+
Sirui Xie, Hehui Zheng, Chunxiao Liu, and Liang Lin. SNAS: stochastic neural architecture search. In International Conference on Learning Representations, 2019.
|
| 239 |
+
|
| 240 |
+
Yuhui Xu, Lingxi Xie, Xiaopeng Zhang, Xin Chen, Guo-Jun Qi, Qi Tian, and Hongkai Xiong. PCDARTS: Partial channel connections for memory-efficient architecture search. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum? id $=$ BJlS634tPr.
|
| 241 |
+
|
| 242 |
+
Quanming Yao, Ju Xu, Wei-Wei Tu, and Zhanxing Zhu. Efficient neural architecture search via proximal iterations. In AAAI, 2020.
|
| 243 |
+
|
| 244 |
+
Arber Zela, Thomas Elsken, Tonmoy Saikia, Yassine Marrakchi, Thomas Brox, and Frank Hutter. Understanding and robustifying differentiable architecture search. In International Conference on Learning Representations, 2020.
|
| 245 |
+
|
| 246 |
+
Zhao Zhong, Junjie Yan, Wei Wu, Jing Shao, and Cheng-Lin Liu. Practical block-wise neural network architecture generation. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2018, 2018.
|
| 247 |
+
|
| 248 |
+
Hongpeng Zhou, Minghao Yang, Jun Wang, and Wei Pan. Bayesnas: A bayesian approach for neural architecture search. In ICML, pp. 7603–7613, 2019. URL http://proceedings. mlr.press/v97/zhou19e.html.
|
| 249 |
+
|
| 250 |
+
Barret Zoph and Quoc V. Le. Neural architecture search with reinforcement learning. In International Conference on Learning Representations (ICLR), 2017. URL https://arxiv.org/ abs/1611.01578.
|
| 251 |
+
|
| 252 |
+
Barret Zoph, Vijay Vasudevan, Jonathon Shlens, and Quoc V. Le. Learning transferable architectures for scalable image recognition. 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Jun 2018. doi: 10.1109/cvpr.2018.00907. URL http://dx.doi.org/10. 1109/CVPR.2018.00907.
|
| 253 |
+
|
| 254 |
+
A APPENDIX
|
| 255 |
+
|
| 256 |
+
A.1 DESCRIPTION ABOUT OUR BASELINE MODELS
|
| 257 |
+
|
| 258 |
+
# A.1.1 DARTS
|
| 259 |
+
|
| 260 |
+
DARTS (Liu et al., 2019) is a pioneering work that introduces the general differentiable NAS framework, which we reviewed in section 2. In DARTS, the topology and operation are searched together. Concretely, at the end of the search, it selects one operation for every edge in the normal (reduction) cell based on the architecture parameter $\alpha$ . Then it selects two input edges for each node in the cell by comparing the largest $\alpha$ of every input edge. The final architecture consists of one operation on each of the eight edges in the normal (reduction) cell. The operation on an edge will be selected from a pool of seven candidates: skip connection, avg pool ${ } _ { - 3 \mathrm { x } 3 }$ , max pool ${ } _ { - 3 \mathrm { x } 3 }$ , sep conv 3x3, sep conv 5x5, dil conv 3x3, and dil conv 5x5. In addition to these operations, DARTS also maintains a ”none” op, which is used exclusively for determining the topology rather than treated as an operation (Liu et al., 2019). Since the main focus of our paper is operation assignment, we omit none op when applying the proposed selection method on DARTS.
|
| 261 |
+
|
| 262 |
+
# A.1.2 SDARTS
|
| 263 |
+
|
| 264 |
+
SDARTS (Chen & Hsieh, 2020) is a variant of DARTS aiming at regularizing the bilevel optimization process in DARTS via random Gaussian perturbation, inspired by the recent finding that regularizing DARTS’ supernet leads to improved performance. While the optimization of architecture parameter $\alpha$ in SDARTS is identical to DARTS, it distorts the architecture parameters $\alpha$ with random Gaussian noise while training the model weights $w$ . This simple yet effective regularizer is able to consistently improve the robustness and performance of DARTS.
|
| 265 |
+
|
| 266 |
+
# A.1.3 SGAS
|
| 267 |
+
|
| 268 |
+
SGAS (Li et al., 2020) represents a line of research on improving the search efficiency of differentiable NAS by progressively shrinking the search space. It first trains the model weights $w$ alone for 10 epochs. After that, it selects one edge from the supernet and then selects the best operation on that edge based on $\alpha$ to be discretized. The edge selection is based on the ranking of the proposed edge importance score. The process stops after all eight edges of the final architecture are decided.
|
| 269 |
+
|
| 270 |
+
# A.2 MICROARCHITECTURE OF SPACE S1 - S4
|
| 271 |
+
|
| 272 |
+
Zela et al. (2020) introduces four variants of the DARTS’ space (S1, S2, S3, and S4) to study the robustness of DARTS. These spaces differ from DARTS’ original space only in the number and types of operations on each edge. Apart from that, everything else is the same.
|
| 273 |
+
|
| 274 |
+
• S1 is a pre-optimized search space consisting of top2 operations selected by DARTS. As a result, each edge contains a different set of operations to be searched from. • S2 consists of two operations: skip connect and sep conv 3x3. • S3 consists of three operations: none, skip connect and sep conv 3x3. • S4 consists of two operations: noise and sep conv 3x3. The noise operation outputs a random Gaussian noise $\mathcal { N } ( 0 , 1 )$ regardless of the input. This operation generally hurts the performance of discretized architecture, and should be avoided by NAS algorithm.
|
| 275 |
+
|
| 276 |
+
# Algorithm 2: Perturbation-based Architecture Selection
|
| 277 |
+
|
| 278 |
+
Input: A pretrained Supernet $S$ , Set of Edges $\mathcal { E }$ from $s$ , Set of Nodes $\mathcal { N }$ from $s$
|
| 279 |
+
Result: Set of selected operations $\{ o _ { e } ^ { * } \} _ { e \in \mathcal { E } }$ , and top2 input edges for each node $\{ ( e _ { n } ^ { ( 1 ) * } , e _ { n } ^ { ( 2 ) * } \} _ { n \in \mathcal { N } }$
|
| 280 |
+
while $| \mathcal { E } | > 0 \mathbf { d } \mathbf { 0 } \ / / \ \mathrm { o } $ peration selection phase randomly select an edge $e \in { \mathcal { E } }$ (and remove it from $\mathcal { E }$ ); forall operation o on edge $e$ do evaluate the validation accuracy of $S$ when $o$ is removed $( A C C _ { \backslash o } )$ ; end select the best operation on $e$ : $\begin{array} { r } { o _ { e } ^ { * } \gets \operatorname * { a r g m i n } _ { o } A C C _ { \backslash o } } \end{array}$ ; discretize edge $e$ to $o _ { e } ^ { * }$ and train the remaining supernet until it converges again;
|
| 281 |
+
end
|
| 282 |
+
while $| { \mathcal { N } } | > 0$ do $/ /$ topology selection phase randomly select a node $n \in \mathcal N$ (and remove it from $\mathcal { N }$ ); forall input edge e of node $n$ do evaluate the validation accuracy of $S$ when $e$ is removed $( A C C _ { \backslash e } )$ ; end set top2 edges on $n ( e _ { n } ^ { ( 1 ) * } , e _ { n } ^ { ( 2 ) * } )$ to be the ones with lowest and second lowest $A C C _ { \backslash e }$ ; prune out all other edges of $n$ and train the remaining supernet until it converges again;
|
| 283 |
+
end
|
| 284 |
+
|
| 285 |
+
# A.4 PROOF OF PROPOSITION 1
|
| 286 |
+
|
| 287 |
+
Proof. Let $\theta _ { s k i p } = S o f t m a x ( \alpha _ { s k i p } )$ and $\theta _ { c o n v } = S o f t m a x ( \alpha _ { c o n v } )$ . Then the mixed operation can be written as $\overline { { m } } _ { e } ( x _ { e } ) = \theta _ { c o n v } o _ { e } ( x _ { e } ) + \theta _ { s k i p } x _ { e }$ . We formally formulate the objective to be:
|
| 288 |
+
|
| 289 |
+
$$
|
| 290 |
+
\begin{array} { r l } { \underset { \theta _ { s k i p } , \theta _ { c o n v } } { \operatorname* { m i n } } V a r ( \overline { { m } } _ { e } ( x _ { e } ) - m ^ { * } ) } & { { } } \\ { s . t . } & { { } \theta _ { s k i p } + \theta _ { c o n v } = 1 } \end{array}
|
| 291 |
+
$$
|
| 292 |
+
|
| 293 |
+
This constraint optimization problem can be solved with Lagrangian multipliers:
|
| 294 |
+
|
| 295 |
+
$$
|
| 296 |
+
\begin{array} { r l } { L ( \theta _ { s k i p } , \theta _ { c o n s } , \lambda ) = V a r ( \overline { { m } } _ { e } ( x _ { e } ) - m ^ { * } ) - \lambda ( \theta _ { s k i p } + \theta _ { c o n s } - 1 ) } \\ & { = V a r ( \theta _ { c o n s } \theta _ { e } ( x _ { e } ) + \theta _ { s k i p } x _ { e } - m ^ { * } ) - \lambda ( \theta _ { s k i p } + \theta _ { c o n v } - 1 ) } \\ & { = V a r ( \theta _ { c o n v } ( \theta _ { e } ( x _ { e } ) - m ^ { * } ) + \theta _ { s k i p } ( x _ { e } - m ^ { * } ) ) } \\ & { \quad - \lambda ( \theta _ { s k i p } + \theta _ { c o n v } - 1 ) } \\ & { = V a r ( \theta _ { c o n v } ( \theta _ { e } ( x _ { e } ) - m ^ { * } ) ) + V a r ( \theta _ { s k i p } ( x _ { e } - m ^ { * } ) ) } \\ & { \quad + 2 C o v ( \theta _ { c o n v } ( \theta _ { c o } ( x _ { e } ) - m ^ { * } ) , \theta _ { s k i p } ( x _ { e } - m ^ { * } ) ) } \\ & { \quad - \lambda ( \theta _ { s k i p } + \theta _ { c o n v } - 1 ) } \\ & { = \theta _ { c o n v } ^ { 2 } V a r ( \theta _ { c } ( x _ { e } ) - m ^ { * } ) + \theta _ { s k i p } ^ { 2 } V a r ( x _ { e } - m ^ { * } ) } \\ & { \quad + 2 \theta _ { c o n v } \theta _ { s k i p } C o v ( \theta _ { e } ( x _ { e } ) - m ^ { * } , x _ { e } - m ^ { * } ) } \\ & { \quad - \lambda ( \theta _ { s k i p } + \theta _ { c o n v } - 1 ) } \end{array}
|
| 297 |
+
$$
|
| 298 |
+
|
| 299 |
+
Setting:
|
| 300 |
+
|
| 301 |
+
$$
|
| 302 |
+
\begin{array} { c } { { \displaystyle \frac { \partial { \cal L } } { \partial \lambda } = \theta _ { c o n v } + \theta _ { s k i p } - 1 = 0 } } \\ { { \displaystyle \frac { \partial { \cal L } } { \partial \theta _ { c o n v } } = 2 \theta _ { c o n v } V a r ( o _ { e } ( x _ { e } ) - m ^ { * } ) + 2 \theta _ { s k i p } C o v ( o _ { e } ( x _ { e } ) - m ^ { * } , x _ { e } - m ^ { * } ) } } \\ { { - \lambda = 0 } } \\ { { \displaystyle \frac { \partial { \cal L } } { \partial \theta _ { s k i p } } = 2 \theta _ { c o n v } C o v ( o _ { e } ( x _ { e } ) - m ^ { * } , x _ { e } - m ^ { * } ) + 2 \theta _ { s k i p } V a r ( x _ { e } - m ^ { * } ) } } \\ { { - \lambda = 0 } } \end{array}
|
| 303 |
+
$$
|
| 304 |
+
|
| 305 |
+
Solving the above equations will give us:
|
| 306 |
+
|
| 307 |
+
$$
|
| 308 |
+
\begin{array} { r } { \theta _ { c o n v } ^ { * } = \frac { V a r ( x _ { e } - m ^ { * } ) - C o v ( o _ { e } ( x _ { e } ) - m ^ { * } , x _ { e } - m ^ { * } ) } { Z } } \\ { \theta _ { s k i p } ^ { * } = \frac { V a r ( o _ { e } ( x _ { e } ) - m ^ { * } ) - C o v ( o _ { e } ( x _ { e } ) - m ^ { * } , x _ { e } - m ^ { * } ) } { Z } } \end{array}
|
| 309 |
+
$$
|
| 310 |
+
|
| 311 |
+
Where $Z = V a r ( o _ { e } ( x _ { e } ) - m ^ { * } ) - C o v ( o _ { e } ( x _ { e } ) - m ^ { * } , x _ { e } - m ^ { * } ) + V a r ( x _ { e } - m ^ { * } ) - C o v ( o _ { e } ( x _ { e } ) - m ^ { * } )$ $m ^ { * } , x _ { e } - m ^ { * } )$ . Aligning basis with DARTS, we get:
|
| 312 |
+
|
| 313 |
+
$$
|
| 314 |
+
\begin{array} { r l } & { \alpha _ { c o n v } ^ { * } = \log \left[ V a r ( x _ { e } - m ^ { * } ) - C o v ( o _ { e } ( x _ { e } ) - m ^ { * } , x _ { e } - m ^ { * } ) \right] + C } \\ & { \alpha _ { s k i p } ^ { * } = \log \left[ V a r ( o _ { e } ( x _ { e } ) - m ^ { * } ) - C o v ( o _ { e } ( x _ { e } ) - m ^ { * } , x _ { e } - m ^ { * } ) \right] + C } \end{array}
|
| 315 |
+
$$
|
| 316 |
+
|
| 317 |
+
The only term that differentiates $\alpha _ { s k i p }$ from $\alpha _ { c o n v }$ is the first term inside the logarithm, therefore:
|
| 318 |
+
|
| 319 |
+
$$
|
| 320 |
+
\begin{array} { l l } { \alpha _ { c o n v } ^ { * } \propto v a r ( x _ { e } - m ^ { * } ) } \\ { \alpha _ { s k i p } ^ { * } \propto v a r ( o _ { e } ( x _ { e } ) - m ^ { * } ) } \end{array}
|
| 321 |
+
$$
|
| 322 |
+
|
| 323 |
+
# A.5 MORE FIGURES ON $\alpha$ AND DISCRETIZATION ACCURACY AT CONVERGENCE
|
| 324 |
+
|
| 325 |
+
We provide extra figures similar to Figure 1 to take into account the randomness of supernet’s training. We first train 6 supernets with different seeds, and then randomly select 1 edge from each of them. We can see that the results are consistent with Figure 1. As shown in Figure 7, the magnitude of $\alpha$ for each operation does not necessarily agree with its relative discretization accuracy at convergence.
|
| 326 |
+
|
| 327 |
+

|
| 328 |
+
Figure 7: $\alpha$ v.s. discretization accuracy at convergence of all the operations on 6 randomly selected edges from DARTS’ supernet trained with different seeds (one subfigure for each edge).
|
| 329 |
+
|
| 330 |
+
# A.6 PERFORMANCE TRAJECTORY OF DART $\mathrm { \bf S } { + } \mathrm { \bf P T }$ (FIX $\alpha$ ) ON NAS-BENCH-201
|
| 331 |
+
|
| 332 |
+
We plot the performance trajectory of DARTS $\therefore \mathrm { { P T } }$ (fix $\alpha$ ) on NAS-Bench-201 similar to Figure 4. As shown in Figure 8, it consistently achieves strong performance without training $\alpha$ at all, indicating that the extra freedom of supernet training without $\alpha$ can be explored to develop improved search algorithm in the future.
|
| 333 |
+
|
| 334 |
+

|
| 335 |
+
Figure 8: Trajectory of test accuracy of architectures found by DART $\mathrm { S + P T }$ (fix $\alpha$ ) on space NAS Bench-201 and 3 datasets (Left: cifar10, Middle: cifar100, Right: Imagenet16-120).
|
| 336 |
+
|
| 337 |
+
Table 5: Evaluation of the derived architecture on ImageNet in the mobile setting.
|
| 338 |
+
|
| 339 |
+
<table><tr><td rowspan="2">Architecture</td><td colspan="2">Test Error(%)</td><td rowspan="2">Params (M)</td><td rowspan="2">Search Method</td></tr><tr><td>top-1</td><td>top-5</td></tr><tr><td>DARTS (Liu et al.,2019)</td><td>26.7</td><td>8.7</td><td>4.7</td><td>gradient</td></tr><tr><td>DARTS+PT</td><td>25.5</td><td>8.0</td><td>4.6</td><td>gradient</td></tr></table>
|
| 340 |
+
|
| 341 |
+
# A.7 ABLATION STUDY ON THE NUMBER OF FINE-TUNING EPOCHS
|
| 342 |
+
|
| 343 |
+
As described in section 4.2, we perform fine-tuning between two edge decisions to recover supernet from the accuracy drop after discretization. The number of fine-tuning epochs is set to 5 for all experiments because empirically we find that it is enough for the supernet to converge again. In this section, we conduct an ablation study on the effect of the number of fine-tuning epochs. As shown in Figure 9, the gain from tuning the supernet longer than 5 epochs is marginal.
|
| 344 |
+
|
| 345 |
+

|
| 346 |
+
Figure 9: Performance of DARTS $+ \mathrm { P T }$ under different number of fine-tuning epochs on NAS-Bench201. Tuning the supernet longer results in marginal improvement on the proposed method.
|
| 347 |
+
|
| 348 |
+
# A.8 ARCHITECTURE TRANSFERABILITY EVALUATION ON IMAGENET
|
| 349 |
+
|
| 350 |
+
We further evaluate the performance of the derived architecture on ImageNet. We strictly follow the training protocals as well as the hyperparameter settings of DARTS (Liu et al., 2019) for this experiment. As shown in Table 5, the proposed method improves the top1 performance of DARTS by $1 . 2 \%$ .
|
| 351 |
+
|
| 352 |
+
A.9 SEARCHED ARCHITECTURES
|
| 353 |
+
|
| 354 |
+

|
| 355 |
+
|
| 356 |
+

|
| 357 |
+
Figure 11: Normal and Reduction cells discovered by SDARTS $\mathrm { \Phi + P T }$ on cifar10
|
| 358 |
+
|
| 359 |
+

|
| 360 |
+
Figure 12: Normal and Reduction cells discovered by SGAS-PT on cifar10
|
| 361 |
+
|
| 362 |
+

|
| 363 |
+
Figure 13: Normal and Reduction cells discovered by DART $\mathrm { \Phi } _ { \mathrm { { + P T } } }$ on cifar10 on Space S1
|
| 364 |
+
|
| 365 |
+

|
| 366 |
+
Figure 14: Normal and Reduction cells discovered by DART $\mathrm { S + P T }$ on cifar10 on Space S2
|
| 367 |
+
|
| 368 |
+

|
| 369 |
+
Figure 15: Normal and Reduction cells discovered by DART $\mathrm { \bf S } { + } \mathrm { \bf P T }$ on cifar10 on Space S3
|
| 370 |
+
|
| 371 |
+

|
| 372 |
+
Figure 16: Normal and Reduction cells discovered by DART $\mathrm { \bf S } { + } \mathrm { \bf P T }$ on cifar10 on Space S4
|
| 373 |
+
|
| 374 |
+

|
| 375 |
+
Figure 17: Normal and Reduction cells discovered by DART $\mathrm { S + P T }$ on cifar100 on Space S1
|
| 376 |
+
|
| 377 |
+

|
| 378 |
+
Figure 18: Normal and Reduction cells discovered by DART $\mathrm { \bf { S } } { + } \mathrm { \bf { P } } \mathrm { \bf { T } }$ on cifar100 on Space S2
|
| 379 |
+
|
| 380 |
+

|
| 381 |
+
Figure 19: Normal and Reduction cells discovered by DART $\mathrm { \bf S } { + } \mathrm { \bf P T }$ on cifar100 on Space S3
|
| 382 |
+
|
| 383 |
+

|
| 384 |
+
Figure 20: Normal and Reduction cells discovered by DART $\mathrm { \bf S } { + } \mathrm { \bf P T }$ on cifar100 on Space S4
|
| 385 |
+
|
| 386 |
+

|
| 387 |
+
Figure 21: Normal and Reduction cells discovered by DART $\mathrm { \bf { S } } { + } \mathrm { \bf { P } } \mathrm { \bf { T } }$ on svhn on Space S1
|
| 388 |
+
|
| 389 |
+

|
| 390 |
+
Figure 22: Normal and Reduction cells discovered by DART $\mathrm { \bf S } { + } \mathrm { \bf P T }$ on svhn on Space S2
|
| 391 |
+
|
| 392 |
+

|
| 393 |
+
Figure 23: Normal and Reduction cells discovered by DART $\mathrm { \Phi } _ { \mathrm { { + P T } } }$ on svhn on Space S3
|
| 394 |
+
|
| 395 |
+

|
| 396 |
+
Figure 24: Normal and Reduction cells discovered by DART $\mathrm { \bf S } { + } \mathrm { \bf P T }$ on svhn on Space S4
|
md/train/S1efxTVYDr/S1efxTVYDr.md
ADDED
|
@@ -0,0 +1,440 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DATA-DEPENDENT GAUSSIAN PRIOR OBJECTIVEFOR LANGUAGE GENERATION
|
| 2 |
+
|
| 3 |
+
Zuchao $\mathbf { L i } ^ { 1 , 2 , 3 }$ , Rui Wang4,∗, Kehai Chen4, Masao Utiyama4, Eiichiro Sumita4, Zhuosheng Zhang1,2,3 , Hai Zhao1,2,3,∗
|
| 4 |
+
|
| 5 |
+
1Department of Computer Science and Engineering, Shanghai Jiao Tong University 2Key Laboratory of Shanghai Education Commission for Intelligent Interaction and Cognitive Engineering, Shanghai Jiao Tong University, Shanghai, China 3MoE Key Lab of Artificial Intelligence, AI Institute, Shanghai Jiao Tong University 4National Institute of Information and Communications Technology (NICT), Kyoto, Japan charlee@sjtu.edu.cn, zhangzs@sjtu.edu.cn, zhaohai@cs.sjtu.edu.cn, {wangrui, khchen, mutiyama, eiichiro.sumita}@nict.go.jp
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
For typical sequence prediction problems such as language generation, maximum likelihood estimation (MLE) has commonly been adopted as it encourages the predicted sequence most consistent with the ground-truth sequence to have the highest probability of occurring. However, MLE focuses on once-to-all matching between the predicted sequence and gold-standard, consequently treating all incorrect predictions as being equally incorrect. We refer to this drawback as negative diversity ignorance in this paper. Treating all incorrect predictions as equal unfairly downplays the nuance of these sequences’ detailed token-wise structure. To counteract this, we augment the MLE loss by introducing an extra Kullback– Leibler divergence term derived by comparing a data-dependent Gaussian prior and the detailed training prediction. The proposed data-dependent Gaussian prior objective (D2GPo) is defined over a prior topological order of tokens and is poles apart from the data-independent Gaussian prior (L2 regularization) commonly adopted in smoothing the training of MLE. Experimental results show that the proposed method makes effective use of a more detailed prior in the data and has improved performance in typical language generation tasks, including supervised and unsupervised machine translation, text summarization, storytelling, and image captioning.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Language understanding is the crown jewel of artificial intelligence. As the well-known dictum by Richard Feynman states, “what I cannot create, I do not understand.” Language generation therefore reflects the level of development of language understanding. Language generation models have seen remarkable advances in recent years, especially with the rapid development of deep neural networks (DNNs). There are several models typically used in language generation, namely sequenceto-sequence (seq2seq) models (Kalchbrenner & Blunsom, 2013; Sutskever et al., 2014; Bahdanau et al., 2015; Luong et al., 2015; Vaswani et al., 2017), generative adversarial networks (GANs) (Goodfellow et al., 2014), variational autoencoders (Kingma & Welling, 2013), and auto-regressive networks (Larochelle & Murray, 2011; Van Oord et al., 2016). Language generation is usually modeled as a sequence prediction task, which adopts maximum likelihood estimation (MLE) as the standard training criterion (i.e., objective). MLE has had much success owing to its intuitiveness and flexibility. However, sequence prediction has encountered the following series of problems due to MLE.
|
| 14 |
+
|
| 15 |
+
• Exposure bias: The model is not exposed to the full range of errors during training. • Loss mismatch: During training, we maximize the log-likelihood, whereas, during inference, the model is evaluated by a different metric such as BLEU or ROUGE. Generation diversity: The generations are dull, generic (Sordoni et al., 2015; Serban et al., 2016; Li et al., 2016a), repetitive, and short-sighted (Li et al., 2016b). • Negative diversity ignorance: MLE fails to assign proper scores to different incorrect model outputs, which means that all incorrect outputs are treated equally during training.
|
| 16 |
+
|
| 17 |
+
A variety of work has alleviated the above MLE training shortcomings apart from negative diversity ignorance. Negative diversity ignorance is a result of unfairly downplaying the nuance of sequences’ detailed token-wise structure. When the MLE objective compares its predicted and ground-truth sequences, it takes a once-for-all matching strategy; the predicted sequence is given a binary label, either correct or incorrect. However, these incorrect training predictions may be quite diverse and letting the model be aware of which incorrect predictions are more incorrect or less incorrect than others may more effectively guide model training. For instance, an armchair might be mistaken with a deckchair, but it should usually not be mistaken for a mushroom.
|
| 18 |
+
|
| 19 |
+
To alleviate the issue of the negative diversity ignorance, we add an extra Gaussian prior objective to augment the current MLE training with an extra Kullback–Leibler divergence loss term. The extra loss is computed by comparing two probability distributions, the first of which is from the detailed model training prediction and the second of which is from a ground-truth token-wise distribution and is defined as a kind of data-dependent Gaussian prior distribution. The proposed data-dependent Gaussian prior objective (D2GPo) is then injected into the final loss through a KL divergence term. The D2GPo is poles apart from the commonly adopted data-independent Gaussian prior (L2 regularization) for the purpose of smoothing the training of MLE, which is also directly added into the MLE loss. Experimental results show that the proposed method makes effectively use of a more detailed prior in the data and improves the performance of typical language generation tasks, including supervised and unsupervised machine translation, text summarization, storytelling, and image captioning.
|
| 20 |
+
|
| 21 |
+
# 2 RELATED WORK
|
| 22 |
+
|
| 23 |
+
Natural language generation (NLG) has long been considered the most challenging natural language processing (NLP) task (Murty & Kabadi, 1987). NLG techniques have been widely adopted as a critical module in various tasks, including control-free sentence or poem generation (Zhang & Lapata, 2014) and input-conditioned language generation, such as machine translation, image captioning, text summarization, storytelling (Vaswani et al., 2017; Lample et al., 2018; Karpathy & Fei-Fei, 2015; Fan et al., 2018), and sentiment/tense-controlled sentence generation (Hu et al., 2017). In this work, we focus on input-conditioned language generation tasks, though our proposed method can also be applied to other language generation fields.
|
| 24 |
+
|
| 25 |
+
Input-conditioned language generation tasks are challenging because there is an information imbalance between the input and output in these tasks, especially for cases with non-text input (Shapiro, 1992). Reiter & Dale (2000) discussed different ways of building complicated knowledge-based systems for NLG. In recent years, neural networks (NNs), especially DNNs, have shown promising results in many NLP tasks. Bengio et al. (2003) first proposed the NN language model (NNLM) to exploit the advantages of NNs for language generation tasks. In an NNLM, the $n$ -gram paradigm is extended by the generalization ability of NNs.
|
| 26 |
+
|
| 27 |
+
Given the ground truth sequence $s = \langle w _ { 1 } , w _ { 2 } , . . . , w _ { t - 1 } \rangle$ , the NNLM adopts the equation
|
| 28 |
+
|
| 29 |
+
$$
|
| 30 |
+
p _ { t } \approx p ( w _ { t } | w _ { t - n } , w _ { t - n + 1 } , . . . , w _ { t - 1 } ) .
|
| 31 |
+
$$
|
| 32 |
+
|
| 33 |
+
Mikolov et al. (2010) developed a more general implementation for a language model (called the recurrent NN language model (RNNLM) by integrating a Markov property using a recurrent NN (RNN) to address the NNLMs’ theoretical inability to capture long-term dependencies:
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
p _ { t } \approx p ( w _ { t } | \mathbf { R N N } ( w _ { 1 } , w _ { 2 } , . . . , w _ { t - 1 } ) ) .
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
The RNNLM is an effective solution because it is designed to capture long-term dependencies. Because of the vanishing gradient problem in RNNs, however, the long-term dependency processing capability is limited. In contrast to an RNN, the Transformer (Vaswani et al., 2017) provides a new self-attention mechanism for handling long-term dependencies in text, resulting in robust performance across diverse tasks. Radford et al. (2018) proposed a Transformer language model called GPT, which uses a left-to-right architecture, where each token pays attention to previous tokens in the self-attention layers of the Transformer. Devlin et al. (2019) introduced a new pre-training objective: the masked language model (MLM), which enables the representation to fuse the left and right contexts and allows us to pre-train a deep bidirectional Transformer called BERT.
|
| 40 |
+
|
| 41 |
+
The generators of the most current language generation model use the RNNLM or Transformer language model structure. However, as pointed out by Bengio et al. (2015), fitting the distribution of observation data does not mean that satisfactory text will be generated, because the model is not exposed to the full range of errors during training. This is called the exposure bias problem. Reinforcement learning, GANs (Goodfellow et al., 2014; Yu et al., 2017), and end-to-end re-parameterization techniques (Kusner & Hernandez-Lobato, 2016) have been proposed to solve ´ this problem. The exposure bias is no longer an issue in reinforcement learning models because the training sequences are generated by the model itself.
|
| 42 |
+
|
| 43 |
+
Using MLE for the training objective leads to the problem of loss mismatch. Ranzato et al. (2015) incorporated the evaluation metric into the training of sequence-to-sequence (seq2seq) models and proposed the mixed incremental cross-entropy reinforce (MIXER) training strategy, which is similar to the idea of minimum risk training (Smith & Eisner, 2006; Li & Eisner, 2009; Ayana et al., 2016; Shen et al., 2016). MIXER uses decoder hidden states to predict the bias term and hence reduce the variance, while minimum risk training renormalizes the predicted probabilities. Zhang & Zhao (2018) introduced a new training criterion based on the Hellinger distance for the seq2seq model and empirically compared the models of two optimization categories: minimum divergence and maximum margin.
|
| 44 |
+
|
| 45 |
+
For the generation diversity problem, Serban et al. (2017) applied a latent variable hierarchical encoder–decoder dialog model to introduce utterance-level variations and facilitate longer responses. Zhao et al. (2017) presented a novel framework based on conditional variational autoencoders that improves generation diversity by sampling a latent variable $z$ and optionally adding linguistic features to constrain the style further.
|
| 46 |
+
|
| 47 |
+
There is an increasing interest in incorporating problem field knowledge in machine learning approaches (Taskar et al., 2004; Ganchev et al., 2010; Hu et al., 2016). One common way is to design specialized network architectures or features for specific knowledge (e.g., Liang et al. (2017; 2018)). In contrast, for structured probabilistic models, posterior regularization and related frameworks (Ganchev et al., 2010; Liang et al., 2009; Bellare et al., 2009) provide a general means to impose knowledge constraints during model estimation. Hu et al. (2018) established a mathematical correspondence between posterior regularization and reinforcement learning and, using this correspondence, expanded posterior regularization to learn knowledge constraints as the extrinsic reward in reinforcement learning. Our approach can be seen as incorporating a priori knowledge of the language field into language generation learning.
|
| 48 |
+
|
| 49 |
+
Additionally, Welleck et al. (2019) proposed a new objective, unlikelihood training, which forces unlikely generations to be assigned lower probability by the model. The difference is that (Welleck et al., 2019) focuses on low-frequency words while our model focuses on negative tokens. It is claimed that the likelihood objective itself is at fault, resulting in a model that assigns too much probability to sequences containing repetition and frequent words, unlike those from the human training distribution. From this point of view, there is a point in common with our motivation, which is to make the model prediction consistent with human training distribution to some extent.
|
| 50 |
+
|
| 51 |
+
# 3 BACKGROUND
|
| 52 |
+
|
| 53 |
+
Consider a conditional probability model for sequence predictions ${ \pmb y } \sim p _ { \pmb \theta } ( { \pmb x } )$ with parameters $\pmb \theta$ . The target sequence $\textbf { { y } }$ can be conditioned on any type of source $_ { \textbf { \em x } }$ (e.g., a phrase, sentence, or passage of human language or even an image), which is omitted for simplicity of notation. For the sequence $\pmb { y } = \langle y _ { 1 } , y _ { 2 } , . . . , y _ { l } \rangle$ , the probability $p _ { \theta } ( \pmb { y } | \pmb { x } )$ is
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
p _ { \theta } ( { \pmb y } | { \pmb x } ) = p _ { \theta } ( y _ { 1 } | { \pmb x } ) p _ { \theta } ( y _ { 2 } | { \pmb x } , y _ { 1 } ) . . . p _ { \theta } ( y _ { l } | { \pmb x } , y _ { 1 : l - 1 } ) .
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
Commonly, sequence prediction models are trained using MLE (also known as teacher forcing) (Williams & Zipser, 1989). MLE minimizes the negative log-likelihood of $p _ { \theta } ( \pmb { y } | \pmb { x } )$ :
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\mathcal { L } _ { \mathrm { M L E } } ( \theta ) = - \log p _ { \theta } ( \pmb { y } | \pmb { x } ) = - \sum _ { i = 1 } ^ { l } \log p _ { \theta } ( y _ { i } | \pmb { x } , \pmb { y } _ { < i } ) .
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
Optimizing the MLE objective $\mathcal { L } _ { \mathrm { M L E } } ( \theta )$ is straightforward and meets the principle of empirical risk minimization while focusing on only minimizing losses of the correct target on the training data set.
|
| 66 |
+
|
| 67 |
+
However, there may be noise in the training data, and forcibly learning the distribution of a training set does not enable the obtained model to reach good generalization. Additionally, for sequence prediction, models trained subject to MLE cursorily evaluate all predictions as either correct or incorrect and ignore the similarity between the correct and “less incorrect” predictions. Incorrect predictions might range from nearly perfect (i.e., one token is mistaken with a synonym) to completely wrong, having nothing in common with the gold sequence. However, MLE training treats all incorrect training predictions equally, which implies that MLE fails to accurately assign scores to diverse (especially negative) model predictions.
|
| 68 |
+
|
| 69 |
+
# 4 D2GPO: DATA-DEPENDENT GAUSSIAN PRIOR OBJECTIVE
|
| 70 |
+
|
| 71 |
+
To capture the diversity of negative training predictions, we augment the MLE objective of the model with an additional objective $\mathcal { O }$ that more accurately models such a negative diversity. Without loss of generality, supposing $\tilde { y }$ is the prediction candidate, we introduce a general evaluation function $f ( \tilde { \pmb { y } } , \pmb { y } ) \in \mathbb { R }$ independent of the model prediction, such that with a golden target token $y ^ { * }$ , a higher $f ( \tilde { y } , y ^ { * } )$ value indicates a better $p _ { \theta } ( \tilde { y } | \boldsymbol { x } )$ for a target candidate $\tilde { y } \in V$ (where $V$ is the target candidate set). Note that $f ( \tilde { \pmb y } , \pmb y )$ can also involve other factors such as latent variables and extra supervisions.
|
| 72 |
+
|
| 73 |
+
There are two main methods of learning $f ( \tilde { \pmb y } , \pmb y )$ in the model. If $p _ { \theta }$ is a GAN-like implicit generative model or an explicit distribution that can be efficiently reparametrized (e.g., Gaussian) (Kingma & Welling, 2013), then one effective method is maximizing $\mathbb { E } _ { p _ { \theta } } \left[ f ( \tilde { \pmb { y } } , \pmb { y } ) \right]$ . The other method is computing the gradient $\nabla _ { \boldsymbol { \theta } } \mathbb { E } _ { p _ { \boldsymbol { \theta } } } \left[ f ( \tilde { \boldsymbol { \ y } } , \boldsymbol { y } ) \right]$ using the log-derivative trick that can suffer from high variance but is often used for the large set of non-parameterizable explicit distributions.
|
| 74 |
+
|
| 75 |
+
Corresponding to the probability distribution of model predictions $p _ { \theta } ( \cdot )$ , we define a prior distribution $q ( \pmb { y } )$ (for each target $y _ { i }$ , it has its own unique distribution of $q _ { i } = q ( y _ { i } ) )$ which is extracted and derived from the ground-truth data (e.g., language text in language generation tasks). To guide the probability distribution of model predictions $p _ { \theta } ( \cdot )$ to match the prior probability distributions $q ( \cdot )$ , we adopt Kullback–Leibler divergence. Considering also the learning of the evaluation function $f ( \tilde { \boldsymbol { y } } , \boldsymbol { y } )$ , the loss for objective $\mathcal { O }$ is calculated as
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\mathcal { L } _ { \mathcal { O } } ( \pmb { \theta } , \boldsymbol { q } ) = K L ( \boldsymbol { q } ( \pmb { y } ) | | p _ { \theta } ( \pmb { y } | \pmb { x } ) ) - \alpha \mathbb { E } _ { \boldsymbol { q } } \left[ f ( \pmb { \tilde { y } } , \pmb { y } ) \right] ,
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
where $\alpha$ is a weight for the evaluation function learning term. We derive the prior distribution $q ( \pmb { y } )$ from the ground-truth data (which is independent of model parameters $\theta$ ), and therefore $\mathbb { E } _ { q } \left[ f ( \tilde { \pmb { y } } , \pmb { y } ) \right] { = } 0$ . Hence, Eq. (5) becomes
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\begin{array} { r } { \mathcal { L } _ { \mathcal { O } } ( \pmb { \theta } , q ) = K L ( q ( \pmb { y } ) \| p _ { \theta } ( \pmb { y } | \pmb { x } ) ) , } \end{array}
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
in which KL divergence can be expanded as
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
K L ( q \| p _ { \theta } ) = \mathbb { E } _ { p } ( \log ( \frac { q } { p } ) ) = \sum _ { i } q _ { i } * \log ( q _ { i } ) - \sum _ { i } q _ { i } * \log ( p _ { i } ) .
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
The final objective for learning the model is written as
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\begin{array} { r } { \operatorname* { m i n } _ { \theta } \mathcal { L } _ { \mathrm { M L E } } ( \theta ) + \lambda \mathcal { L } _ { \mathcal { O } } ( \theta , q ) , } \end{array}
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
where $\lambda$ is the balancing hyperparameter. Because optimizing the original model objective $\mathcal { L } _ { \mathrm { M L E } } ( \theta )$ is straightforward, in the following, we omit the discussion of $\mathcal { L } _ { \mathrm { M L E } } ( \theta )$ and focus on the proposed $\mathcal { L } _ { \mathcal { O } } ( \pmb { \theta } , \bar { \mathbf { q } } )$ .
|
| 100 |
+
|
| 101 |
+
The prior probability distribution $q ( y ^ { * } )$ on $y ^ { * }$ can be obtained from the evaluation function $f ( \cdot , \cdot )$ with a softmax operation. To expose the mass of the distribution over the classes, Hinton et al. (2015) introduced a softmax temperature mechanism; therefore, the relationship between $q$ and $f ( \tilde { \pmb { y } } , \pmb { y } )$ is
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
q ( y ^ { * } ) = \frac { e x p ( f ( \tilde { y } , y ^ { * } ) / T ) } { \sum _ { j } e x p ( f ( \tilde { y } _ { j } , y ^ { * } ) / T ) } ,
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
where $T$ is a temperature parameter. When $T 0$ , the distribution becomes a Kronecker distribution (and is equivalent to a one-hot target vector); when $T \to + \infty$ , the distribution becomes a uniform distribution. The softmax operation always turns an evaluation function $f ( \cdot , \cdot )$ into a form of probability distribution no matter the form of the original $f ( \cdot , \cdot )$ ; thus, we only focus on $f ( \cdot , \cdot )$ .
|
| 108 |
+
|
| 109 |
+
To find a good evaluation function, we have to mine token-wise diversity for all $y ^ { * }$ . Considering all token types $\tilde { y } _ { j }$ in a vocabulary, with respect to each $y ^ { * }$ , there exists a prior topological order $O R D E R ( y ^ { * } )$ among all the known tokens, in which $y ^ { * }$ is always ranked top priority. $f ( \tilde { y } _ { j } , y ^ { * } )$ can then be defined as a monotonic function over the corresponding topological order so that it has a maximal value only when the input is $y ^ { * }$ itself. Note that defining $f ( \cdot , \cdot )$ in this way leads to the resulting $q$ also being monotonic over the corresponding topological order. Considering that $q$ is $a$ priori, it is fixed throughout the learning process.
|
| 110 |
+
|
| 111 |
+
The remaining questions are about how to find a meaningful evaluation function $f ( \cdot , \cdot )$ for the distribution $q$ . In language generation tasks, we may conveniently take word embedding as the token representation, and let the embedding distance determine such an order $O R D E R ( y ^ { * } )$ for each $y ^ { * }$ . In this work, we adopt the cosine similarity of pre-trained embeddings to sort the token (word/subword) order.
|
| 112 |
+
|
| 113 |
+
Discussion For the evaluation function $f ( \cdot , \cdot )$ of $q$ , we adopt the Gaussian probability density function, though later we also present experimental results for other types of functions in an ablation study. As the adopted Gaussian prior used in the training objective is derived from a datadependent token-wise distribution, we call it the data-dependent Gaussian prior objective (D2GPo). This objective is a big departure from the Gaussian prior commonly adopted for smoothing in MLE training (which we the data-independent Gaussian prior). The following briefly explains why we chose the Gaussian probability density function and how our D2GPo mathematically differs from the data-independent Gaussian prior.
|
| 114 |
+
|
| 115 |
+
The central limit theorem indicates that suitably standardized sums of independent random variables have an approximately normal distribution. Thus, any random variable that arises as the sum of a sufficiently large number of small random components can be modeled accurately using a normal distribution. Embedding has a linear additive property (e.g., $k i n g \textrm { - } m a n + w o m a n \approx q u e e n )$ . The additive property of embedding can be explained by inspecting the training objective (Mikolov et al., 2013). Each dimension of an embedding represents a potential feature of the token. Considering each potential feature as an independent random variable, the sum follows a Gaussian distribution centered on the correct vocabulary unit $y ^ { * }$ according to the linear additive property. We can therefore use a Gaussian distribution for the embedding-distance-determined order to effectively model the distribution $q ( y ^ { * } )$ . An overview of the concepts underlying D2GPo is illustrated in Appendix A.1.
|
| 116 |
+
|
| 117 |
+
The D2GPo in this paper is different from the data-independent Gaussian prior in machine learning optimization theory. We hypothesize and experimentally verify that the embedding feature extracted from the data obeys the Gaussian distribution. The distribution from the prior knowledge of language data is used as a soft target to guide the model language generation process using knowledge distillation. The Gaussian prior in the machine learning optimization theory assumes that each component in the parameter $\theta$ is subject to a zero-mean Gaussian prior distribution, which is equivalent to L2 regularization. In general, our Gaussian prior objective is to act on the guiding target probability, while the Gaussian prior in machine learning is applied to the selection of model parameters.
|
| 118 |
+
|
| 119 |
+
# 5 EXPERIMENTS AND RESULTS
|
| 120 |
+
|
| 121 |
+
This section describes the experimental evaluation of D2GPo on a variety of typical language generation tasks: neural machine translation (NMT), text summarization, storytelling, and image captioning. The hyperparameters in D2GPo and effect analysis are given in Appendix A.7.
|
| 122 |
+
|
| 123 |
+
# 5.1 EMBEDDING PRE-TRAINING
|
| 124 |
+
|
| 125 |
+
Our proposed D2GPo approach for experimental tasks requires either word embeddings or bytepair-encoding (BPE) (Sennrich et al., 2016b) subword embeddings. We generated the pretrained embeddings using fastText (Bojanowski et al., 2017) with an embedding dimension of 512, a context window of size 5, and 10 negative samples. For NMT, fastText was applied to the concatenation of source and target language monolingual corpora, resulting in cross-lingual BPE subword embedding. For text summarization, we generated BPE subword embedding only on the English monolingual corpora, while for the storytelling and image captioning, we obtained the word embedding also on the English monolingual corpora.
|
| 126 |
+
|
| 127 |
+
# 5.2 SUPERVISED NMT
|
| 128 |
+
|
| 129 |
+
We evaluated the model on several widely used translation tasks: WMT14 English-to-German (EN– DE), English-to-French (EN–FR), and WMT16 English-to-Romanian (EN–RO)1 tasks, which all have standard large-scale corpora for NMT evaluation. Owing to space limits, the data details are provided in Appendix A.3. The sentences were encoded using sub-word types based on BPE, which has a shared vocabulary of 40,000 sub-word units for all three tasks. We chose the Transformer NMT (Vaswani et al., 2017) model as our baseline. For the hyperparameters of the Transformer (base/big) models, we followed the settings used by Vaswani et al. (2017). The BLEU (Papineni et al., 2002) score with multi-bleu.pl was calculated during the evaluation.
|
| 130 |
+
|
| 131 |
+
<table><tr><td>System</td><td>EN-DE</td><td>EN-FR</td><td>EN-RO</td><td>EN-RO + STD</td></tr><tr><td>Vaswani et al. (2017) (base)</td><td>27.30</td><td>38.10</td><td>-</td><td></td></tr><tr><td>Vaswani et al. (2017) (big)</td><td>28.40</td><td>41.00</td><td>1</td><td>-</td></tr><tr><td>Transformer (base)</td><td>27.35</td><td>38.44</td><td>33.22</td><td>36.68</td></tr><tr><td>+ D2GPo</td><td>27.93++</td><td>39.23++</td><td>34.00+</td><td>37.11+</td></tr><tr><td>Transformer (big)</td><td>28.51</td><td>41.05</td><td>33.45</td><td>37.55</td></tr><tr><td>+ D2GP0</td><td>29.10+</td><td>41.77++</td><td>34.13+</td><td>37.92+</td></tr></table>
|
| 132 |
+
|
| 133 |
+
Table 1: Comparison with baseline and existing systems on supervised translation tasks. Here, $" + + / + "$ after the BLEU score indicates that the proposed method was significantly better than the corresponding baseline Transformer (base or big) at significance levels $p < 0 . 0 1 / 0 . 0 5$ . “STD” represents synthetic training data from (Sennrich et al., 2016b).
|
| 134 |
+
|
| 135 |
+
In Table 1, we report the performance of our full model, the baseline, and existing systems. Our baseline model obtains results similar to those of Vaswani et al. (2017), the existing strong model used for these tasks. The results indicate that our method performed better than the strong baselines for all language pairs. Our model is not only an improvement on the translation model of large-scale training sets but also performs better for small-scale training sets. Refer to Appendix A.8 and A.9 for analysis of the low-resource scenario and generation diversity.
|
| 136 |
+
|
| 137 |
+
# 5.3 UNSUPERVISED NMT
|
| 138 |
+
|
| 139 |
+
For unsupervised machine translation, we also used the three language pairs EN–DE, EN–FR, and EN–RO as our evaluation targets. Note that the evaluation performed on EN–DE uses newstest2016 instead of newstest2014 to ensure the results are comparable with the results of other works; this is unlike supervised machine translation. We used the masked sequence to sequence the pre-training (MASS) model (Song et al., 2019) as our baseline. Following the practice of Song et al. (2019), we pretrained our model with a masked sequence-to-sequence pre-training (MASS) objective (without D2GPo) on EN, FR, DE, and RO monolingual data samples from WMT 2007–2018 News Crawl datasets that respectively cover 190M, 60M, 270M, and 10M sentences. We then fine-tuned the models on the same monolingual data using the back-translation cross-entropy loss (Lample et al., 2018) and our D2GPo loss. For the training dataset, we filtered out sentences longer than 175 words in length and jointly learned 60K BPE sub-word units for each language pair.
|
| 140 |
+
|
| 141 |
+
<table><tr><td>Method</td><td>EN-FR</td><td>FR-EN</td><td>EN-DE</td><td>DE-EN</td><td>EN-RO</td><td>RO-EN</td></tr><tr><td>Artetxe et al. (2017)</td><td>15.13</td><td>15.56</td><td>6.89</td><td>10.16</td><td></td><td>=</td></tr><tr><td>Lample et al. (2017)</td><td>15.05</td><td>14.31</td><td>9.75</td><td>13.33</td><td>=</td><td>1</td></tr><tr><td>Yang et al. (2018)</td><td>16.97</td><td>15.58</td><td>10.86</td><td>14.62</td><td>=</td><td>=</td></tr><tr><td>Lample et al. (2018)</td><td>25.14</td><td>24.18</td><td>17.16</td><td>21.00</td><td>21.18</td><td>19.44</td></tr><tr><td>XLM (Lample & Conneau, 2019)</td><td>33.40</td><td>33.30</td><td>27.00</td><td>34.30</td><td>33.30</td><td>31.80</td></tr><tr><td>MASS (Song et al.,2019)</td><td>37.50</td><td>34.90</td><td>28.30</td><td>35.20</td><td>35.20</td><td>33.10</td></tr><tr><td>MASS +D2GPo</td><td>37.92</td><td>34.94</td><td>28.42</td><td>35.62</td><td>36.31</td><td>33.41</td></tr></table>
|
| 142 |
+
|
| 143 |
+
Table 2: BLEU score comparisons between MASS and previous methods of unsupervised NMT.
|
| 144 |
+
|
| 145 |
+
As shown in Table 2, D2GPo consistently outperformed MASS (the state-of-the-art baseline) on all unsupervised translation pairs. Meanwhile, the MASS and XLMsystems leverage large-scale monolingual pre-training, and the decoder (generator, language model) can still be improved by our D2GPo loss in the fine-tuning phase. This demonstrates the efficiency of the proposed method.
|
| 146 |
+
|
| 147 |
+
# 5.4 TEXT SUMMARIZATION
|
| 148 |
+
|
| 149 |
+
Text summarization is a typical language generation task that creates a short and fluent summary of the given long-text document. Song et al. (2019) fine-tuned the MASS pretrained model on the text summarization task and achieved state-of-the-art results. We chose this model as our baseline, maintained consistent pre-training, and used D2GPo loss for enhancements in the fine-tuning phase. We used the Annotated Gigaword corpus as the benchmark, as detailed in Appendix A.4. In the evaluation, ROUGE-1, ROUGE-2, and ROUGE-L (Lin, 2004) are reported.
|
| 150 |
+
|
| 151 |
+
Table 3: Performance on the text summarization task
|
| 152 |
+
|
| 153 |
+
<table><tr><td colspan="2">Model</td><td>ROUGE-1</td><td>ROUGE-2</td><td>ROUGE-L</td></tr><tr><td>Supervised</td><td>RNN-based seq2seq Nallapati et al. (2016)</td><td>35.50 34.97</td><td>15.54 17.17</td><td>32.45 32.70</td></tr><tr><td>Semi-supervised</td><td>MLM pre-training ( g (Song et al.,2019) DAE pre-training (Song et al., 2019) MASS pre-training (Song et al., 2019) MASS + D2GP0</td><td>37.75 35.97 38.73 39.23</td><td>18.45 17.17 19.71 20.11</td><td>34.85 33.14 35.96 36.48</td></tr></table>
|
| 154 |
+
|
| 155 |
+
Our results for text summarization are listed in Table 3. We compared our $+ { \bf D } 2 \mathrm { { G P o } }$ with our baseline MASS, which is the current state-of-the-art model; $+ { \bf D } 2 \mathrm { { G P o } }$ consistently outperformed the baseline on all evaluation metrics. The models with a semi-supervised setting yielded a large-margin improvement relative to the model without any pre-training, which demonstrates that the supervised pre-training is effective in the text summarization task.
|
| 156 |
+
|
| 157 |
+
# 5.5 STORYTELLING
|
| 158 |
+
|
| 159 |
+
Storytelling is at the frontier of current language generation technologies; i.e., stories must maintain a consistent theme throughout and require long-distance dependency modeling. Additionally, stories require creativity and a high-level plot with planning ahead rather than word-by-word generation (Wiseman et al., 2017).
|
| 160 |
+
|
| 161 |
+
We used the hierarchical story generation model (Fan et al., 2018) (which is introduced in Appendix A.5) as our baseline to test the improvements of D2GPo for the storytelling task. To guarantee the single-variable principle, we added only the D2GPo loss to the story generation model. The prompt generation model is consistent with Fan et al. (2018).
|
| 162 |
+
|
| 163 |
+
For automatic evaluation, we measured the model perplexity on validation and test sets. Table 4 shows results obtained using D2GPo. It is seen that with the addition of D2GPo, the Conv seq2seq $^ +$ self-attention model substantially improved the likelihood of human-generated stories and even outperformed the ensemble or fusion models without increasing the number of parameters. Perplexity was further reduced with the addition of the fusion mechanism. These results suggest that
|
| 164 |
+
|
| 165 |
+
Table 4: Perplexity on WRITINGPROMPTS.
|
| 166 |
+
|
| 167 |
+
<table><tr><td>Model</td><td>Params</td><td>Valid Perplexity</td><td>Test Perplexity</td></tr><tr><td>GCNN LM</td><td>123.4 M</td><td>54.50</td><td>54.79</td></tr><tr><td>GCNN + self-attention LM</td><td>126.4 M</td><td>51.84</td><td>51.18</td></tr><tr><td>LSTM seq2seq</td><td>110.3M</td><td>46.83</td><td>46.79</td></tr><tr><td>Conv seq2seq</td><td>113.0 M</td><td>45.27</td><td>45.54</td></tr><tr><td>Conv seq2seq + self-attention</td><td>134.7M</td><td>37.37</td><td>37.94</td></tr><tr><td>Ensemble: Conv seq2seq + self-attention</td><td>270.3M</td><td>36.63</td><td>36.93</td></tr><tr><td>Fusion: Conv seq2seq + self-attention</td><td>255.4 M</td><td>36.08</td><td>36.56</td></tr><tr><td>Conv seq2seq + self-attention + D2GPo</td><td>134.7M</td><td>35.56</td><td>35.74</td></tr><tr><td>Fusion: Conv seq2seq + self-attention +D2GPo</td><td>255.4 M</td><td>33.82</td><td>33.90</td></tr></table>
|
| 168 |
+
|
| 169 |
+
D2GPo improves the quality of language generation greatly, especially in settings where there are fewer restrictions on story generation tasks.
|
| 170 |
+
|
| 171 |
+
# 5.6 IMAGE CAPTIONING
|
| 172 |
+
|
| 173 |
+
Image captioning is a task that combines image understanding and language generation. It continues to inspire considerable research at the boundary of computer vision and natural language processing. We elected to experiment with image captioning to verify the performance of D2GPo on a language generation model having diverse types of input.
|
| 174 |
+
|
| 175 |
+
In our experiments, we evaluated our model on an ablated baseline (top-down, as detailed in Appendix A.6) (Anderson et al., 2018) against prior work on the MSCOCO 2014 caption dataset (Lin et al., 2014), which has became the standard benchmark for image captioning. For validation of model hyperparameters and offline testing, we used Karpathy splits (Karpathy & Fei-Fei, 2015), which have been used extensively in prior work. SPICE (Anderson et al., 2016), CIDEr (Vedantam et al., 2015), METEOR (Denkowski & Lavie, 2014), ROUGE-L, and BLEU were used to evaluate the caption quality.
|
| 176 |
+
|
| 177 |
+
Table 5: Image caption performance on the MSCOCO Karpathy test split.
|
| 178 |
+
|
| 179 |
+
<table><tr><td></td><td>BLEU-1</td><td>BLEU-4</td><td>METEOR</td><td>ROUGE-L</td><td>CIDEr</td><td>SPICE</td></tr><tr><td>Att2in (Rennie et al., 2017)</td><td>=</td><td>31.3</td><td>26.0</td><td>54.3</td><td>101.3</td><td>1</td></tr><tr><td>Att2all (Rennie et al., 2017)</td><td>-</td><td>30.0</td><td>25.9</td><td>53.4</td><td>99.4</td><td>-</td></tr><tr><td>Baseline: Top-down Baseline + D2GPo</td><td>74.5</td><td>33.4</td><td>26.1</td><td>54.4</td><td>105.4</td><td>19.2</td></tr><tr><td></td><td>75.2</td><td>33.6</td><td>26.3</td><td>55.1</td><td>106.6</td><td>19.7</td></tr><tr><td>Baseline + SCST</td><td>77.8</td><td>34.4</td><td>26.6</td><td>56.1</td><td>114.3</td><td>19.9</td></tr><tr><td>Baseline + SCST + D2GPo</td><td>78.0</td><td>34.7</td><td>26.8</td><td>56.3</td><td>116.8</td><td>20.2</td></tr></table>
|
| 180 |
+
|
| 181 |
+
Table 5 summarizes the performance of our full model and the ResNet Top-down baseline in comparison with the existing strong Self-critical Sequence Training (SCST) (Rennie et al., 2017) approach on the test portion of the Karpathy splits. To ensure a fair comparison, results are only reported for models trained with standard cross-entropy loss (i.e., MLE). All results are reported for a single model with no fine tuning of the input ResNet model. Our ResNet baseline performs slightly better than the SCST models. After incorporating our proposed D2GPo loss, our model improves further across all metrics.
|
| 182 |
+
|
| 183 |
+
# 6 EVALUATION FUNCTION
|
| 184 |
+
|
| 185 |
+
According to the analysis in Section 4, for the embedding, we used the Gaussian probability density function as our evaluation function $f ( \cdot )$ ; however, to evaluate the effectiveness of different evaluation functions, we changed the function and tested the performance changes on the supervised NMT
|
| 186 |
+
|
| 187 |
+
EN-DE task. We used the same experiment settings as described in Section 5.2 and compared the BLEU score changes on the test set, as listed in Table 6.
|
| 188 |
+
|
| 189 |
+
<table><tr><td>Evaluation Function</td><td>BLEU</td><td>△</td></tr><tr><td>Baseline</td><td>27.35</td><td></td></tr><tr><td>Gaussian</td><td>27.93</td><td>0.58个</td></tr><tr><td>Random</td><td>26.34</td><td>1.01↓</td></tr><tr><td>Linear</td><td>27.45</td><td>0.10个</td></tr><tr><td>Cosine</td><td>27.62</td><td>0.27个</td></tr></table>
|
| 190 |
+
|
| 191 |
+
Table 6: Ablation study on our proposed D2GPo with different evaluation functions on the supervised NMT WMT14 EN-DE task, with the Transformer-base model.
|
| 192 |
+
|
| 193 |
+
The table shows that the performance of Gaussian density, linear, and cosine functions increased while the performance of the random function decreased. This shows that the distance information obtained from embedding can effectively guide the generation process. Among these functions, the Gaussian density function had the greatest improvement, which agrees with our analysis of the embedding features obeying the Gaussian distribution. We postulate that because the linear and cosine functions are rough approximations of the Gaussian density function, they perform similarly to the Gaussian density function.
|
| 194 |
+
|
| 195 |
+
# 7 CONCLUSION
|
| 196 |
+
|
| 197 |
+
This work proposed a data-dependent Gaussian prior objective (D2GPo) for language generation tasks with the hope of alleviating the difficulty of negative diversity ignorance. D2GPo imposes the prior from (linguistic) data over the sequence prediction models. D2GPo outperformed strong baselines in experiments on classic language generation tasks (i.e., neural machine translation, text summarization, storytelling, and image captioning tasks).
|
| 198 |
+
|
| 199 |
+
# REFERENCES
|
| 200 |
+
|
| 201 |
+
Peter Anderson, Basura Fernando, Mark Johnson, and Stephen Gould. Spice: Semantic propositional image caption evaluation. In European Conference on Computer Vision, pp. 382–398. Springer, 2016.
|
| 202 |
+
|
| 203 |
+
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.
|
| 204 |
+
|
| 205 |
+
Mikel Artetxe, Gorka Labaka, Eneko Agirre, and Kyunghyun Cho. Unsupervised neural machine translation. arXiv preprint arXiv:1710.11041, 2017.
|
| 206 |
+
|
| 207 |
+
Shiqi Shen Ayana, Zhiyuan Liu, and Maosong Sun. Neural headline generation with minimum risk training. arXiv preprint arXiv:1604.01904, 2016.
|
| 208 |
+
|
| 209 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In International Conference on Learning Representations, 2015.
|
| 210 |
+
|
| 211 |
+
Kedar Bellare, Gregory Druck, and Andrew McCallum. Alternating projections for learning with expectation constraints. In Proceedings of the Twenty-Fifth Conference on Uncertainty in Artificial Intelligence, pp. 43–50. AUAI Press, 2009.
|
| 212 |
+
|
| 213 |
+
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.
|
| 214 |
+
|
| 215 |
+
Yoshua Bengio, Rejean Ducharme, Pascal Vincent, and Christian Jauvin. A neural probabilistic´ language model. Journal of machine learning research, 3(Feb):1137–1155, 2003.
|
| 216 |
+
|
| 217 |
+
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. doi: 10.1162/tacl a 00051. URL https://www.aclweb.org/anthology/ Q17-1010.
|
| 218 |
+
|
| 219 |
+
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-Volume 70, pp. 933–941. JMLR. org, 2017.
|
| 220 |
+
|
| 221 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248–255. Ieee, 2009.
|
| 222 |
+
|
| 223 |
+
Michael Denkowski and Alon Lavie. Meteor universal: Language specific translation evaluation for any target language. In Proceedings of the Ninth Workshop on Statistical Machine Translation, pp. 376–380, Baltimore, Maryland, USA, June 2014. Association for Computational Linguistics. doi: 10.3115/v1/W14-3348. URL https://www.aclweb.org/anthology/W14-3348.
|
| 224 |
+
|
| 225 |
+
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. doi: 10.18653/v1/N19-1423. URL https: //www.aclweb.org/anthology/N19-1423.
|
| 226 |
+
|
| 227 |
+
Angela Fan, Mike Lewis, and Yann Dauphin. Hierarchical neural story generation. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 889–898, Melbourne, Australia, July 2018. Association for Computational Linguistics. doi: 10.18653/v1/P18-1082. URL https://www.aclweb.org/anthology/P18-1082.
|
| 228 |
+
|
| 229 |
+
Kuzman Ganchev, Jennifer Gillenwater, Ben Taskar, et al. Posterior regularization for structured latent variable models. Journal of Machine Learning Research, 11(Jul):2001–2049, 2010.
|
| 230 |
+
|
| 231 |
+
Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N Dauphin. Convolutional sequence to sequence learning. In International Conference on Machine Learning, pp. 1243– 1252, 2017.
|
| 232 |
+
|
| 233 |
+
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.
|
| 234 |
+
|
| 235 |
+
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.
|
| 236 |
+
|
| 237 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
|
| 238 |
+
|
| 239 |
+
Zhiting Hu, Xuezhe Ma, Zhengzhong Liu, Eduard Hovy, and Eric Xing. Harnessing deep neural networks with logic rules. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 2410–2420, Berlin, Germany, August 2016. Association for Computational Linguistics. doi: 10.18653/v1/P16-1228. URL https: //www.aclweb.org/anthology/P16-1228.
|
| 240 |
+
|
| 241 |
+
Zhiting Hu, Zichao Yang, Xiaodan Liang, Ruslan Salakhutdinov, and Eric P Xing. Controllable text generation. arXiv preprint arXiv:1703.00955, 4, 2017.
|
| 242 |
+
|
| 243 |
+
Zhiting Hu, Zichao Yang, Ruslan R Salakhutdinov, LIANHUI Qin, Xiaodan Liang, Haoye Dong, and Eric P Xing. Deep generative models with learnable knowledge constraints. In Advances in Neural Information Processing Systems, pp. 10501–10512, 2018.
|
| 244 |
+
|
| 245 |
+
Nal Kalchbrenner and Phil Blunsom. Recurrent continuous translation models. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pp. 1700–1709, Seattle, Washington, USA, October 2013. Association for Computational Linguistics. URL https: //www.aclweb.org/anthology/D13-1176.
|
| 246 |
+
|
| 247 |
+
Andrej Karpathy and Li Fei-Fei. Deep visual-semantic alignments for generating image descriptions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3128–3137, 2015.
|
| 248 |
+
|
| 249 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 250 |
+
|
| 251 |
+
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.
|
| 252 |
+
|
| 253 |
+
Guillaume Lample and Alexis Conneau. Cross-lingual language model pretraining. arXiv preprint arXiv:1901.07291, 2019.
|
| 254 |
+
|
| 255 |
+
Guillaume Lample, Alexis Conneau, Ludovic Denoyer, and Marc’Aurelio Ranzato. Unsupervised machine translation using monolingual corpora only. arXiv preprint arXiv:1711.00043, 2017.
|
| 256 |
+
|
| 257 |
+
Guillaume Lample, Myle Ott, Alexis Conneau, Ludovic Denoyer, and Marc’Aurelio Ranzato. Phrase-based & neural unsupervised machine translation. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 5039–5049, Brussels, Belgium, October-November 2018. Association for Computational Linguistics. doi: 10.18653/v1/ D18-1549. URL https://www.aclweb.org/anthology/D18-1549.
|
| 258 |
+
|
| 259 |
+
Hugo Larochelle and Iain Murray. The neural autoregressive distribution estimator. In Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, pp. 29–37, 2011.
|
| 260 |
+
|
| 261 |
+
Jiwei Li, Michel Galley, Chris Brockett, Jianfeng Gao, and Bill Dolan. A diversity-promoting objective function for neural conversation models. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 110–119, San Diego, California, June 2016a. Association for Computational Linguistics. doi: 10.18653/v1/N16-1014. URL https://www.aclweb.org/anthology/ N16-1014.
|
| 262 |
+
|
| 263 |
+
Jiwei Li, Will Monroe, Alan Ritter, Dan Jurafsky, Michel Galley, and Jianfeng Gao. Deep reinforcement learning for dialogue generation. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 1192–1202, Austin, Texas, November 2016b. Association for Computational Linguistics. doi: 10.18653/v1/D16-1127. URL https://www.aclweb.org/anthology/D16-1127.
|
| 264 |
+
|
| 265 |
+
Zhifei Li and Jason Eisner. First- and second-order expectation semirings with applications to minimum-risk training on translation forests. In Proceedings of the 2009 Conference on Empirical Methods in Natural Language Processing, pp. 40–51, Singapore, August 2009. Association for Computational Linguistics. URL https://www.aclweb.org/anthology/D09-1005.
|
| 266 |
+
|
| 267 |
+
Percy Liang, Michael I Jordan, and Dan Klein. Learning from measurements in exponential families. In Proceedings of the 26th annual international conference on machine learning, pp. 641–648. ACM, 2009.
|
| 268 |
+
|
| 269 |
+
Xiaodan Liang, Zhiting Hu, Hao Zhang, Chuang Gan, and Eric P Xing. Recurrent topic-transition gan for visual paragraph generation. In Proceedings of the IEEE International Conference on Computer Vision, pp. 3362–3371, 2017.
|
| 270 |
+
|
| 271 |
+
Xiaodan Liang, Zhiting Hu, Hao Zhang, Liang Lin, and Eric P Xing. Symbolic graph reasoning meets convolutions. In Advances in Neural Information Processing Systems, pp. 1853–1863, 2018.
|
| 272 |
+
|
| 273 |
+
Chin-Yew Lin. ROUGE: A package for automatic evaluation of summaries. In Text Summarization Branches Out, pp. 74–81, Barcelona, Spain, July 2004. Association for Computational Linguistics. URL https://www.aclweb.org/anthology/W04-1013.
|
| 274 |
+
|
| 275 |
+
Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollar, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In ´ European conference on computer vision, pp. 740–755. Springer, 2014.
|
| 276 |
+
|
| 277 |
+
Thang Luong, Hieu Pham, and Christopher D. Manning. Effective approaches to attention-based neural machine translation. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pp. 1412–1421, Lisbon, Portugal, September 2015. Association for Computational Linguistics. doi: 10.18653/v1/D15-1166. URL https://www.aclweb. org/anthology/D15-1166.
|
| 278 |
+
|
| 279 |
+
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.
|
| 280 |
+
|
| 281 |
+
Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems, pp. 3111–3119, 2013.
|
| 282 |
+
|
| 283 |
+
Katta G Murty and Santosh N Kabadi. Some np-complete problems in quadratic and nonlinear programming. Mathematical programming, 39(2):117–129, 1987.
|
| 284 |
+
|
| 285 |
+
Ramesh Nallapati, Bowen Zhou, Cicero dos Santos, Caglar Gulcehre, and Bing Xiang. Abstractive text summarization using sequence-to-sequence RNNs and beyond. In Proceedings of The 20th SIGNLL Conference on Computational Natural Language Learning, pp. 280–290, Berlin, Germany, August 2016. Association for Computational Linguistics. doi: 10.18653/v1/K16-1028. URL https://www.aclweb.org/anthology/K16-1028.
|
| 286 |
+
|
| 287 |
+
Courtney Napoles, Matthew Gormley, and Benjamin Van Durme. Annotated Gigaword. In Proceedings of the Joint Workshop on Automatic Knowledge Base Construction and Web-scale Knowledge Extraction (AKBC-WEKEX), pp. 95–100, Montreal, Canada, June 2012. Association for Compu- ´ tational Linguistics. URL https://www.aclweb.org/anthology/W12-3018.
|
| 288 |
+
|
| 289 |
+
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, Philadelphia, Pennsylvania, USA, July 2002. Association for Computational Linguistics. doi: 10.3115/1073083.1073135. URL https: //www.aclweb.org/anthology/P02-1040.
|
| 290 |
+
|
| 291 |
+
Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training. URL https://s3-us-west-2. amazonaws. com/openaiassets/researchcovers/languageunsupervised/language understanding paper. pdf, 2018.
|
| 292 |
+
|
| 293 |
+
Marc’Aurelio Ranzato, Sumit Chopra, Michael Auli, and Wojciech Zaremba. Sequence level training with recurrent neural networks. arXiv preprint arXiv:1511.06732, 2015.
|
| 294 |
+
|
| 295 |
+
Ehud Reiter and Robert Dale. Building natural language generation systems. Cambridge university press, 2000.
|
| 296 |
+
|
| 297 |
+
Steven J Rennie, Etienne Marcheret, Youssef Mroueh, Jerret Ross, and Vaibhava Goel. Self-critical sequence training for image captioning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7008–7024, 2017.
|
| 298 |
+
|
| 299 |
+
Alexander M. Rush, Sumit Chopra, and Jason Weston. A neural attention model for abstractive sentence summarization. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pp. 379–389, Lisbon, Portugal, September 2015. Association for Computational Linguistics. doi: 10.18653/v1/D15-1044. URL https://www.aclweb.org/ anthology/D15-1044.
|
| 300 |
+
|
| 301 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Edinburgh neural machine translation systems for WMT 16. In Proceedings of the First Conference on Machine Translation: Volume 2, Shared Task Papers, pp. 371–376, Berlin, Germany, August 2016a. Association for Computational Linguistics. doi: 10.18653/v1/W16-2323. URL https://www.aclweb.org/anthology/ W16-2323.
|
| 302 |
+
|
| 303 |
+
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 (Volume 1: Long Papers), pp. 1715–1725, Berlin, Germany, August 2016b. Association for Computational Linguistics. doi: 10.18653/v1/P16-1162. URL https: //www.aclweb.org/anthology/P16-1162.
|
| 304 |
+
|
| 305 |
+
Iulian V Serban, Alessandro Sordoni, Yoshua Bengio, Aaron Courville, and Joelle Pineau. Building end-to-end dialogue systems using generative hierarchical neural network models. In Thirtieth AAAI Conference on Artificial Intelligence, 2016.
|
| 306 |
+
|
| 307 |
+
Iulian Vlad Serban, Alessandro Sordoni, Ryan Lowe, Laurent Charlin, Joelle Pineau, Aaron Courville, and Yoshua Bengio. A hierarchical latent variable encoder-decoder model for generating dialogues. In Thirty-First AAAI Conference on Artificial Intelligence, 2017.
|
| 308 |
+
|
| 309 |
+
Stuart C Shapiro. Encyclopedia of artificial intelligence second edition. John, 1992.
|
| 310 |
+
|
| 311 |
+
Shiqi Shen, Yong Cheng, Zhongjun He, Wei He, Hua Wu, Maosong Sun, and Yang Liu. Minimum risk training for neural machine translation. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1683–1692, Berlin, Germany, August 2016. Association for Computational Linguistics. doi: 10.18653/v1/P16-1159. URL https://www.aclweb.org/anthology/P16-1159.
|
| 312 |
+
|
| 313 |
+
David A. Smith and Jason Eisner. Minimum risk annealing for training log-linear models. In Proceedings of the COLING/ACL 2006 Main Conference Poster Sessions, pp. 787–794, Sydney, Australia, July 2006. Association for Computational Linguistics. URL https://www.aclweb. org/anthology/P06-2101.
|
| 314 |
+
|
| 315 |
+
Kaitao Song, Xu Tan, Tao Qin, Jianfeng Lu, and Tie-Yan Liu. Mass: Masked sequence to sequence pre-training for language generation. In International Conference on Machine Learning, pp. 5926–5936, 2019.
|
| 316 |
+
|
| 317 |
+
Alessandro Sordoni, Michel Galley, Michael Auli, Chris Brockett, Yangfeng Ji, Margaret Mitchell, Jian-Yun Nie, Jianfeng Gao, and Bill Dolan. A neural network approach to context-sensitive generation of conversational responses. In Proceedings of the 2015 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 196–205, Denver, Colorado, May–June 2015. Association for Computational Linguistics. doi: 10.3115/v1/N15-1020. URL https://www.aclweb.org/anthology/N15-1020.
|
| 318 |
+
|
| 319 |
+
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.
|
| 320 |
+
|
| 321 |
+
Ben Taskar, Carlos Guestrin, and Daphne Koller. Max-margin markov networks. In Advances in neural information processing systems, pp. 25–32, 2004.
|
| 322 |
+
|
| 323 |
+
Aaron Van Oord, Nal Kalchbrenner, and Koray Kavukcuoglu. Pixel recurrent neural networks. In International Conference on Machine Learning, pp. 1747–1756, 2016.
|
| 324 |
+
|
| 325 |
+
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.
|
| 326 |
+
|
| 327 |
+
Ramakrishna Vedantam, C Lawrence Zitnick, and Devi Parikh. Cider: Consensus-based image description evaluation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 4566–4575, 2015.
|
| 328 |
+
|
| 329 |
+
Sean Welleck, Ilia Kulikov, Stephen Roller, Emily Dinan, Kyunghyun Cho, and Jason Weston. Neural text generation with unlikelihood training. 2019.
|
| 330 |
+
|
| 331 |
+
Ronald J Williams and David Zipser. A learning algorithm for continually running fully recurrent neural networks. Neural computation, 1(2):270–280, 1989.
|
| 332 |
+
|
| 333 |
+
Sam Wiseman, Stuart Shieber, and Alexander Rush. Challenges in data-to-document generation. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 2253–2263, Copenhagen, Denmark, September 2017. Association for Computational Linguistics. doi: 10.18653/v1/D17-1239. URL https://www.aclweb.org/anthology/ D17-1239.
|
| 334 |
+
|
| 335 |
+
Zhen Yang, Wei Chen, Feng Wang, and Bo Xu. Unsupervised neural machine translation with weight sharing. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 46–55, Melbourne, Australia, July 2018. Association for Computational Linguistics. doi: 10.18653/v1/P18-1005. URL https://www.aclweb. org/anthology/P18-1005.
|
| 336 |
+
|
| 337 |
+
Lantao Yu, Weinan Zhang, Jun Wang, and Yong Yu. Seqgan: Sequence generative adversarial nets with policy gradient. In Thirty-First AAAI Conference on Artificial Intelligence, 2017.
|
| 338 |
+
|
| 339 |
+
Huan Zhang and Hai Zhao. Minimum divergence vs. maximum margin: an empirical comparison on seq2seq models. In International Conference on Learning Representations, 2018.
|
| 340 |
+
|
| 341 |
+
Xingxing Zhang and Mirella Lapata. Chinese poetry generation with recurrent neural networks. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 670–680, Doha, Qatar, October 2014. Association for Computational Linguistics. doi: 10.3115/v1/D14-1074. URL https://www.aclweb.org/anthology/D14-1074.
|
| 342 |
+
|
| 343 |
+
Tiancheng Zhao, Ran Zhao, and Maxine Eskenazi. Learning discourse-level diversity for neural dialog models using conditional variational autoencoders. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 654–664, Vancouver, Canada, July 2017. Association for Computational Linguistics. doi: 10.18653/v1/ P17-1061. URL https://www.aclweb.org/anthology/P17-1061.
|
| 344 |
+
|
| 345 |
+
# A APPENDIX
|
| 346 |
+
|
| 347 |
+
# A.1 CONCEPTS UNDERLYING D2GPO
|
| 348 |
+
|
| 349 |
+

|
| 350 |
+
Figure 1: Overview of the concepts underlying D2GPo taking the example of the sentence The little boy sits on the armchair.
|
| 351 |
+
|
| 352 |
+
# A.2 TOPOLOGICAL ORDER
|
| 353 |
+
|
| 354 |
+
Specifically, for target $y ^ { * }$ , we calculate the embedding cosine similarity as the distance $d i s t ( \tilde { y } _ { j } , y ^ { * } )$ of $y ^ { * }$ and all other token types in the vocabulary $\tilde { y } _ { j }$ , which are used to give the distance:
|
| 355 |
+
|
| 356 |
+
$$
|
| 357 |
+
d i s t ( \tilde { y } _ { j } , y ^ { * } ) = c o s i n e \_ s i m i l a r i t y ( e m b ( \tilde { y } _ { j } ) , e m b ( y ^ { * } ) ) .
|
| 358 |
+
$$
|
| 359 |
+
|
| 360 |
+
Sorting by distance from small to large to obtain the topological order of token types yields
|
| 361 |
+
|
| 362 |
+
$$
|
| 363 |
+
O R D E R ( y ^ { * } ) = I N D E X ( s o r t ( [ d i s t ( \tilde { y } _ { 1 } , y ^ { * } ) , d i s t ( \tilde { y } _ { 2 } , y ^ { * } ) , . . . , d i s t ( \tilde { y } _ { N } , y ^ { * } ) ] ) ) .
|
| 364 |
+
$$
|
| 365 |
+
|
| 366 |
+
where $N$ is the vocabulary size and $I N D E X ( \cdot )$ is used to obtain the new sequential index according to the distance sort. We define $O R D E R ( y ^ { * } ) _ { j }$ as the $j$ -th value in $O R D \bar { E } R ( y ^ { * } )$ . Therefore, the evaluation function $f ( \tilde { y } _ { j } , y ^ { * } )$ is converted to a function defined on $O R D E R ( y ^ { * } )$ :
|
| 367 |
+
|
| 368 |
+
$$
|
| 369 |
+
f ( { \tilde { y } } _ { j } , y ^ { * } ) = f ( O R D E R ( y ^ { * } ) _ { j } ) .
|
| 370 |
+
$$
|
| 371 |
+
|
| 372 |
+
For example, suppose the vocabulary has 5 tokens (i.e. ${ \mathrm { N } } { = } 5$ ), for the golden target $y ^ { * }$ to be predicted, there is a relationship: $d i s t ( \tilde { y } _ { 2 } , y ^ { * } ) < d i s t ( \tilde { y } _ { 3 } , y ^ { * } ) < d i s t ( \tilde { y } _ { 1 } , y ^ { * } ) < d i s t ( \tilde { y } _ { 5 } , y ^ { * } ) < d i s t ( \tilde { y } _ { 4 } , y ^ { * } )$ , the $O R D E R ( y ^ { * } )$ is $[ 3 , 1 , 2 , 5 , 4 ]$ .
|
| 373 |
+
|
| 374 |
+
# A.3 SUPERVISED NMT DATA
|
| 375 |
+
|
| 376 |
+
For the EN–DE translation task, 4.43M bilingual sentence pairs from the WMT’14 dataset, which includes the Common Crawl, News Commentary, and Europarl v7 datasets, were used as training data. The newstest2013 and newstest2014 datasets were used as the dev set and test set, respectively.
|
| 377 |
+
|
| 378 |
+
For the EN–FR translation task, 36M bilingual sentence pairs from the WMT’14 dataset were used as training data. The newstest2012 and newstest2013 datasets were combined for validation and newstest2014 was used as the test set, following the configuration of Gehring et al. (2017).
|
| 379 |
+
|
| 380 |
+
For the EN–RO task, we tested two settings; i.e., Europarl v7, which uses only the officially provided parallel corpus, and SETIMES2, which yields 600,000 sentence pairs for a low-resource supervised machine translation study. Alternatively, following the work of Sennrich et al. (2016a), we used synthetic training data (STD) of Sennrich et al. (2016a), which provides $2 . 8 \mathbf { M }$ sentence pairs for training. We used newsdev2016 as the dev set and newstest2016 as the test set. Our reported results on EN-RO are evaluated on a reference for which diacritics are removed from letters.
|
| 381 |
+
|
| 382 |
+
# A.4 TEXT SUMMARIZATION DATA
|
| 383 |
+
|
| 384 |
+
The Annotated Gigaword corpus (Napoles et al., 2012) was used as a benchmark (Rush et al., 2015). This data set is derived from news articles and comprises pairs of main sentences in the article (longer) and headline (shorter). The article and headline were respectively used as the source input sentence and reference. The data include approximately $3 . 8 \mathbf { M }$ training samples, 400,000 validation samples, and 2000 test samples.
|
| 385 |
+
|
| 386 |
+
# A.5 HIERARCHICAL STORY GENERATION MODEL
|
| 387 |
+
|
| 388 |
+
The hierarchical story generation model (Fan et al., 2018) was proposed for the situation in which a sentence called a prompt that describes the topic of the upcoming story generation is first generated, and then conditions on the prompt are applied when generating the story. Specifically, Fan et al. (2018) used a self-attention gated convolutional language model (GCNN) (Dauphin et al., 2017) as the sequence-to-sequence prompt generation model with top- $k$ random sampling. For prompt-tostory generation, they collected a dataset from Reddit’s WRITINGPROMPTS forum in which each prompt has multiple story responses. With the dataset, they trained a story generation model that benefitted from a novel form of model fusion that improved the relevance of the story to the prompt and added a new gated multi-scale self-attention mechanism to model the long-range context.
|
| 389 |
+
|
| 390 |
+
# A.6 TOP-DOWN IMAGE CAPTION MODEL
|
| 391 |
+
|
| 392 |
+
The top-down image captioning model uses a ResNet (He et al., 2016) convolutional neural net pretrained on ImageNet (Deng et al., 2009) to encode each image. Similar to previous work (Rennie et al., 2017), the cited study encoded the full-sized input image with the final convolutional layer of Resnet-101 and used bilinear interpolation to resize the output to a fixed-size spatial representation of $1 0 \times 1 0$ . This is equivalent to the maximum number of spatial regions used in our full model.
|
| 393 |
+
|
| 394 |
+
# A.7 HYPERPARAMETERS IN D2GPO
|
| 395 |
+
|
| 396 |
+
During training with our D2GPo, the value of the standard deviation of the KL diversity item $\lambda$ was set to 0.1, and the softmax temperature was $T = 2 . 0$ in all experiments.
|
| 397 |
+
|
| 398 |
+
To study the effects of hyperparameters (i.e., the standard deviation $\lambda$ and softmax temperature $T$ in D2GPo) on the experimental results, we carried out experiments on WMT14 EN-DE with the Transformer-base model as the baseline 2 and set $\lambda$ as $[ 0 , 0 . \dot { 1 } , 0 . 2 , 0 . 5 , 1 . 0 ]$ , $T$ as [1.0, 2.0, 5.0, 10.0].
|
| 399 |
+
|
| 400 |
+

|
| 401 |
+
Figure 3: Performances on WMT14 EN-DE with different $\lambda$ values.
|
| 402 |
+
|
| 403 |
+

|
| 404 |
+
Figure 4: Performances on WMT14 EN-DE with different $T$ values.
|
| 405 |
+
|
| 406 |
+
The experimental results reveal that $\lambda$ affects the model training process. We believe that the reason is that a small value of $\lambda$ results in the model being unable to make full use of the prior knowledge (distribution), while a larger value of $\lambda$ will make the model more uncertain because of the higher probability of there being incorrect or even opposite words whose fastText embeddings are similar.
|
| 407 |
+
|
| 408 |
+
In addition, experimental results show that a small value of $T$ can improve the model to some extent, whereas a large value of $T$ will seriously decrease the performance of the model. Theoretically, when $T$ approaches infinity, the distribution $q$ becomes uniform, and there is no prior knowledge with which to guide the model. A loss penalty is applied to any model prediction, and an excessively high value of $T$ is thus harmful to training.
|
| 409 |
+
|
| 410 |
+
# A.8 D2GPO UNDER A LOW-RESOURCE SETTING
|
| 411 |
+
|
| 412 |
+
Priors are generally more helpful in low-data regimes. We sampled 10,000, 100,000, and 600,000 paired sentences from the bilingual training data of WMT16 EN-RO to explore the performance of D2GPo in different low-resource scenarios. We used the same BPE code and learned fastText embeddings in all WMT16 EN-RO training data.
|
| 413 |
+
|
| 414 |
+
<table><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>10K</td><td rowspan=1 colspan=1>100K</td><td rowspan=1 colspan=1>600K</td></tr><tr><td rowspan=2 colspan=1>Baseline+ D2GPo</td><td rowspan=1 colspan=1>1.01</td><td rowspan=1 colspan=1>17.80</td><td rowspan=2 colspan=1>33.2234.00</td></tr><tr><td rowspan=1 colspan=1>4.33</td><td rowspan=1 colspan=1>20.48</td></tr></table>
|
| 415 |
+
|
| 416 |
+
Table 7: Comparison of our baseline and our D2GPo method under different training data scales in terms of BLEU on the WMT16 EN-RO test set.
|
| 417 |
+
|
| 418 |
+
As shown in Table 7, D2GPo outperforms the baseline model, demonstrating the effectiveness of our method in low-resource scenarios. At the same time, the results show that the performance improvement provided by D2GPo increases with fewer training data. This shows that prior knowledge can substantially improve the performance of the model when training data are scarce. A possible reason is that the training data are insufficient to train a robust model. In this case, the injection of prior knowledge can help train the parameters of the model and substantially improve the translation performance. However, with an increase in the number of training data, the model itself can be optimized well, and the improvement gained by introducing prior knowledge is not as substantial as before.
|
| 419 |
+
|
| 420 |
+
# A.9 EXAMPLES OF IMAGE CAPTIONING
|
| 421 |
+
|
| 422 |
+

|
| 423 |
+
Table 8: Captions generated for the left image by the various models described in the paper. The models trained with SCST return a more accurate and more detailed summary of the image. The models trained with D2GPo return a more grammatically complete sentence.
|
| 424 |
+
|
| 425 |
+
# A.10 ANALYSIS ON GENERATION DIVERSITY
|
| 426 |
+
|
| 427 |
+
Compared with traditional MLE training, D2GPo encourages negative diversity. To examine differences between D2GPo and MLE models, we counted high- and low-frequency words in the training set and compared the frequencies of low-frequency words predicted by the two models and the golden reference on the test set.
|
| 428 |
+
|
| 429 |
+
<table><tr><td></td><td>#GOLD</td><td>Baseline</td><td>+D2GPo</td></tr><tr><td>#LF</td><td>4915</td><td>3900</td><td>3998</td></tr><tr><td>#SUM</td><td>63086</td><td>55234</td><td>56129</td></tr><tr><td>#RATIO</td><td>7.79%</td><td>7.06%</td><td>7.12%</td></tr></table>
|
| 430 |
+
|
| 431 |
+
Table 9: The statics of low frequency words in the reference and generations.
|
| 432 |
+
|
| 433 |
+
The experiment was carried out on WMT14 EN-DE, the baseline model was Transformer-base, and the statistics were calculated at the word level. We chose words with a frequency less than or equal to 100 in the training set as low-frequency words. We used the golden reference (#GOLD), baseline model prediction output, and $+ { \bf D } 2 \mathrm { G P o }$ model prediction output to count the total number of tokens (#SUM) and the number of low-frequency words (#LF). Results are given in Table 8.
|
| 434 |
+
|
| 435 |
+
The results show that compared with the baseline, the D2GPo optimized model generates more lowfrequency words and has a higher ratio of low-frequency words. However, the number is still far less than the golden reference. It is thus demonstrated that D2GPo increases the diversity of model output.
|
| 436 |
+
|
| 437 |
+
A.11 EXAMPLES OF STORYTELLING
|
| 438 |
+
Table 10: Example stories generated by the baselines and our full models.
|
| 439 |
+
|
| 440 |
+
<table><tr><td></td><td rowspan=1 colspan=1>Example Prompt: The scientists have discovered something terrible .</td></tr><tr><td></td><td rowspan=1 colspan=1>Generation with Conv seq2seq + Self-Attention (PPL 37.37):</td></tr><tr><td></td><td rowspan=1 colspan=1>The discovery of the discovery was a Iong and boring process. It was a small,(unk),and a simple andelegant solution .The scientists,scientists in charge,and the scientific community,was able to decipherthe meaning of the universe .The theory that the universe was not a very real one ,was that the universe itself was not a planet ,but avery,very real planet.The discovery of a particular object in the universe that the universe was not .We found something thatresembled something that could not be described,but something that could not be described .Wefound a way to make the object a lot more specific .We found that it was a very ,very large thing ,asmall,very small and very large .It was the first thing we noticed that we found that it was a masive,large ,enormous,enormous ,giant ,giant .We found a way to make the whole thing.We found that the entire</td></tr><tr><td></td><td rowspan=1 colspan=1>Generation with_Conv seq2seq + Self-Attention_+ D2GPo (PPL_35.74):</td></tr><tr><td></td><td rowspan=1 colspan=1>Idon'tunderstand.Whydid you tell us aboutit?"The scientist'saistant,Dr.harry,looked up fromhis tablet and back at the scientist “ It 's... you see.” He looked back up at Dr. harry.”What ’s it mean ? ”“ It means that the experiment is on the cusp of time .It’s not the same as it looks .There 's no explanation It’'s just that...“ How is it possible that the experiment is going to fail ?”The scientist looked ut the window and then backat Dr. harry,who was still looking out the window ,at the vast blackness of the room .“ You think they 'll do it ?”“ Well , no, we can ’t be sure,Dr. harry . They 'll do it.”,Dr. harry turned to the scientist in front of him .”We can 't risk losing our best friend in the world</td></tr><tr><td></td><td rowspan=1 colspan=1>Generation with_ Fusion of Conv_seq2seq_+_Self-Attention (PPL 36.08):We thought that we should be able to see our entire species . The scientists were n't sure what we wouldfind . But they had to be prepared for it . They could n’t be ready .The scientists had never seen anything like this,and yet they hadn't seen anything like this {unk)in months. The scientists were just about to be in their own business , when they saw the results .They were n't readyfor anything:We thought that we should take a deep breath before we go . But it was n't . There was n't any sign of any other intelligent life in the universe . It was nothing .The scientists had no idea what was going on . They just watched,waiting for a signal .Theyhad no ideawhat it would mean .But they could n't see us .The scientists just knew . They were allafraid of what they would see .They could n't see the future .They could n’t see the future .</td></tr><tr><td rowspan=1 colspan=2>Generation with_Fusion of Conv_seq2seq_+_Self-Attention + D2GPo (PPL 33.82):"Im afraid Iwo n't be able to find out why my experiment is working .“Well , we ’ve been working on the project for about a month now .“ It's been a month and a half since Ilast saw it ."“ We 're all looking at the results . ”“ You've already been working on it for months now . You think we've found that ? ”“ I do n't know, but we do have a lot of research to do ."“ But it ’s not like it was working ,is it ? ”“ We do n't know . We 're not looking for a breakthrough , it 's just an experiment .”“ It's just an experiment ? People will die and the world may be destroyed .The disaster is about to happen,we have to act."“ What do you mean,it’ll not . It 's just an experiment . ”“ No ,no ,no ,it is something terrible we cannot ignore "</td></tr></table>
|
md/train/SPrVNsXnGd/SPrVNsXnGd.md
ADDED
|
@@ -0,0 +1,313 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Rényi Differential Privacy of the Subsampled Shuffle Model in Distributed Learning
|
| 2 |
+
|
| 3 |
+
Antonious M. Girgis UCLA amgirgis@g.ucla.edu
|
| 4 |
+
|
| 5 |
+
Deepesh Data UCLA deepesh.data@gmail.com
|
| 6 |
+
|
| 7 |
+
Suhas Diggavi UCLA suhasdiggavi@ucla.edu
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
We study privacy in a distributed learning framework, where clients collaboratively build a learning model iteratively through interactions with a server from whom we need privacy. Motivated by stochastic optimization and the federated learning (FL) paradigm, we focus on the case where a small fraction of data samples are randomly sub-sampled in each round to participate in the learning process, which also enables privacy amplification. To obtain even stronger local privacy guarantees, we study this in the shuffle privacy model, where each client randomizes its response using a local differentially private (LDP) mechanism and the server only receives a random permutation (shuffle) of the clients’ responses without their association to each client. The principal result of this paper is a privacyoptimization performance trade-off for discrete randomization mechanisms in this sub-sampled shuffle privacy model. This is enabled through a new theoretical technique to analyze the Rényi Differential Privacy (RDP) of the sub-sampled shuffle model. We numerically demonstrate that, for important regimes, with composition our bound yields significant improvement in privacy guarantee over the state-of-the-art approximate Differential Privacy (DP) guarantee (with strong composition) for sub-sampled shuffled models. We also demonstrate numerically significant improvement in privacy-learning performance operating point using real data sets. Despite these advances an open question is to bridge the gap between lower and upper privacy bounds in our RDP analysis.
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
As learning moves towards the edge, there is a need to collaborate to build learning models1, such as in federated learning [36, 44, 33]. In this framework, the collaboration is typically mediated by a server. In particular, we want to collaboratively build a learning model by solving an empirical risk minimization (ERM) problem (see $( 2 )$ in Section $2 )$ . To obtain a model parametrized by $\theta$ using ERM, the commonly used mechanism is Stochastic Gradient Descent (SGD) [12]. However, one needs to solve this while enabling strong privacy guarantees on local data from the server, while also obtaining good learning performance, i.e., a suitable privacy-learning performance operating point.
|
| 16 |
+
|
| 17 |
+
Differential privacy (DP) $\boxed { 1 8 }$ is the gold standard notion of data privacy that gives a rigorous framework through quantifying the information leakage about individual training data points from the observed interactions. Though DP was originally proposed in a framework where data resides centrally $\boxed { 1 8 }$ , for distributed learning the more appropriate notion is of local differential privacy (LDP) [35, 17]. Here, each client randomizes its interactions with the server from whom the data is to be kept private (e.g., see industrial implementations [23, 31, 16]). However, LDP mechanisms suffer from poor performance in comparison with the central DP mechanisms [17, 35, 32]. To overcome this, a new privacy framework using anonymization has been proposed in the so-called shuffled model $\underline { { { \sqrt { 2 2 } } } } | 2 5 | 6 | \dot { 2 } 6 | 5 | \dot { \overline { { { 1 5 } } } } | \overline { { { \mathrm { [ 7 ] } } } } | 8 |$ . In the shuffled model, each client sends her private message to a secure shuffler that randomly permutes all the received messages before forwarding them to the server. This model enables significantly better privacy-utility performance by amplifying DP through this shuffling. Therefore, in this paper we consider the shuffle privacy framework for distributed learning.
|
| 18 |
+
|
| 19 |
+
In solving $( 2 )$ using (distributed) gradient descent, each exchange leaks information about the local data, but we need as many steps as possible to obtain a good model; setting up the tension between privacy and performance. The goal is to obtain as many such interactions as possible for a given privacy budget. This is quantified through analyzing the privacy of the composition of privacy mechanisms. Abadi et al. [1] developed a framework for tighter analysis of such compositions, and this was later reformulated in terms of Rényi Differential Privacy (RDP) $\textcircled { 1 3 7 }$ , and mapping this back to DP guarantee $\textcircled { 1 3 8 }$ . Therefore, studying RDP is important to obtaining strong composition privacy results, and is the focus of this paper.
|
| 20 |
+
|
| 21 |
+
In distributed (and federated) learning, a fraction of the data samples are sampled; for example, with random client participation and stochastic gradient descent (SGD), which can be written as
|
| 22 |
+
|
| 23 |
+
$$
|
| 24 |
+
\theta _ { t + 1 } \theta _ { t } - \eta _ { t } \frac { 1 } { | \mathcal { T } | } \sum _ { i \in \mathcal { I } } \mathcal { R } ( \nabla f _ { i } ( \theta _ { t } ) ) ,
|
| 25 |
+
$$
|
| 26 |
+
|
| 27 |
+
where $\mathcal { R }$ is the local randomization mechanism and $\mathcal { T }$ are the indices of the sampled data. This is a subsampled mechanism that enables another privacy amplification opportunity; which, in several cases, is shown to yield a privacy advantage proportional to the subsampling rate; see $\dot { \sqrt { 3 5 } } \boxed { 4 2 }$ . The central technical question addressed in this paper is how to analyze the RDP of an arbitrary discrete mechanism for the subsampled shuffle privacy model. This enables us to answer the overall question posed in this paper, which is an achievable privacy-learning performance trade-off point for solving in the shuffled privacy model for distributed learning (see Figure 1). Our contributions are:
|
| 28 |
+
|
| 29 |
+

|
| 30 |
+
Figure 1: An iteration from the CLDPSGD Algorithm, where 3 clients are randomly chosen at each iteration. Each client sends the private gradient $\mathcal { R } _ { p } \left( g _ { t } ( d _ { i } ) \right)$ to the shuffler that randomly permutes the gradients before passing them to the server.
|
| 31 |
+
|
| 32 |
+
We analyze the RDP of subsampled mechanisms in the shuffle framework by developing a novel bound applicable to any discrete $\epsilon _ { 0 }$ -LDP mechanism as a function of the RDP order $\lambda$ , subsampling rate $\gamma$ , the LDP parameter $\epsilon _ { 0 }$ , and the number of clients $n$ ; see Theorem $\bigtriangledown$ The bound is explicit and amenable to numerics, including all constants.2 Furthermore, the bounds are valid for generic LDP mechanisms and all parameter regimes.3 We also provide a lower bound for the RDP in Theorem $\bigstar$ We prove our upper bound (Theorem 1) using the following novel analysis techniques: First, we reduce the problem of computing the RDP of sub-sampled shuffle mechanisms to the problem of computing ternary $| \chi | ^ { \alpha } \cdot \mathrm { D P } ^ { \bullet } | \overline { { { 4 3 } } } | ]$ of shuffle (non sub-sampled) mechanisms; see Lemma 2. Then we reduce the computation of the ternary $| \chi | ^ { \alpha }$ -DP of shuffle mechanisms for a generic triple of neighboring datasets to those that have a special structure (see Theorem $5 )$ – this reduction step is one of the core technical results of this paper. Then we bound the ternary $| \chi | ^ { \alpha }$ -DP of the shuffle mechanisms for triples of neighboring datasets having special structures by bounding the Pearson-Vajda divergence $\lvert \overline { { 4 3 } } \rvert$ using some concentration properties (see Theorem $\overline { { 6 ) } }$ .
|
| 33 |
+
|
| 34 |
+
• Using the core technical result in Theorem $^ { 1 , }$ we analyze privacy-convergence trade-offs of the CLDP-SGD algorithm (see Algorithm 1) for Lipschitz convex functions in Theorem $3 .$ This partially resolves an open question posed in $| \vec { \boldsymbol { { \vert { 2 7 } } \| } }$ , to extend their privacy analysis to RDP and significantly strengthening their privacy guatantees.
|
| 35 |
+
|
| 36 |
+
• Numerically, we save a factor $1 4 \times$ in privacy (✏) over the best known results for approximate DP for shuffling $\pm \overbrace { | 2 4 | }$ combined with strong composition $\pm$ for $T = 1 0 ^ { 5 } , \gamma = 0 . 0 0 \bar { 1 } , n = 1 0 ^ { 6 }$ , and a factor of $2 . 5 \times$ better than the best known RDP for shuffling bound $\lVert 2 9 \rVert$ combined with the sub-sampling result in $\textcircled { 1 4 3 } \textcircled { 1 }$ . Translating these to privacy-performance operating point in distributed optimization, over the MNIST data set with $\ell _ { \infty }$ clipping we numerically show gains: For the same privacy budget of $\epsilon = 1 . 4$ , we get a test performance of $8 0 \%$ whereas using strong composition the test performance of $\mathbb { \lVert 2 4 \rVert }$ is $7 0 \%$ ; furthermore, we achieves $9 0 \%$ accuracy with the total privacy budget $\epsilon = 2 . 9 1$ , whereas, $\mathring { \| 2 4 \| }$ (with strong composition) achieves the same accuracy with a total privacy budget of $\epsilon = 4 . 8 2$ . See Section 4 and the supplementary material for more results.
|
| 37 |
+
|
| 38 |
+
Related work: We give a more complete literature review in Appendix A, and focus here on the works that are closest to the results presented in this paper.
|
| 39 |
+
|
| 40 |
+
Private optimization in the shuffled model: Recently, $\pmb { \mathbb { Z } } 1 \mathbf { l }$ and $ { \mathbb { P } } ^ { \geq \sum { \left. \left. 2 8 \right. \right. } }$ have proposed differentially private SGD algorithms for federated learning, where at each iteration, each client applies an LDP mechanism on the gradients with the existence of a secure shuffler between the clients and the central server. However, the privacy analyses in these works developed approximate DP using advanced composition theorems for DP (e.g., $\pm \pm \pm \pm ) )$ ), which are known to be loose for composition $\textcircled { 1 }$ . To the best of our knowledge, analyzing the private optimization framework using RDP and subsampling in the shuffled model is new to this paper.
|
| 41 |
+
|
| 42 |
+
Subsampled RDP: The works [38, 43, 45] have studied the RDP of subsampled mechanisms without shuffling. They demonstrated that this provides a tighter bound on the total privacy loss than the bound that can be obtained using the standard strong composition theorems. The RDP analysis of subsampled mechanisms in the shuffled privacy framework has not been studied before,4 and is new to this paper. The RDP of the shuffled model was very recently studied in $\left[ \left[ 2 9 \right] \right]$ , but without incorporating subsampling, which poses new technical challenges, as directly bounding the RDP of subsampled shuffle mechanisms is non-trivial. We overcome this by reducing our problem of computing RDP to bounding the ternary $| \chi | ^ { \alpha }$ -DP, and bounding the latter is a core technical contribution of our paper.
|
| 43 |
+
|
| 44 |
+
Paper organization: We give preliminaries and problem formulation in Section 2, main results (upper and lower bounds, and privacy-convergence tradeoff) in Section $\textcircled { 3 }$ numerical results in Section 4, proof of the upper bound in Section $5 _ { : }$ and proof of the ternary DP of the shuffle model in Section 6. Omitted details/proofs from this paper are given in the supplementary material.
|
| 45 |
+
|
| 46 |
+
# 2 Preliminaries and Problem Formulation
|
| 47 |
+
|
| 48 |
+
We use several privacy definitions throughout this paper. Among these, the local and central differential privacy definitions are standard and we defer them to Appendix $\begin{array} { l } { \mathbf { B } . } \\ { . } \end{array}$ The other privacy definitions (Rényi DP and ternary $| \chi | ^ { \alpha }$ -DP) are relatively less standard and we define them below.
|
| 49 |
+
|
| 50 |
+
We say that two datasets $\mathcal { D } = \{ d _ { 1 } , \ldots , d _ { n } \} \in \mathcal { X } ^ { n }$ and $\mathcal { D } ^ { \prime } = \{ d _ { 1 } ^ { \prime } , \ldots , d _ { n } ^ { \prime } \} \in \mathcal { X } ^ { n }$ are neighboring (and denoted by $\mathcal { D } \sim \mathcal { D } ^ { \prime }$ ) if they differ in one data point, i.e., there exists an $i \in [ n ]$ such that $d _ { i } \neq d _ { i } ^ { \prime }$ and for every $j \in [ n ] , j \neq i$ , we have $d _ { j } = d _ { j } ^ { \prime }$ .
|
| 51 |
+
|
| 52 |
+
Definition 1 $( \lambda , \epsilon )$ -RDP (Rényi Differential Privacy) $\pmb { \mathbb { B } } \pmb { \mathbb { Z } } )$ ). A randomized mechanism $\mathcal { M } : \mathcal { X } ^ { n } \mathcal { Y }$ is said to have $\epsilon$ -Rényi differential privacy of order $\lambda \in ( 1 , \infty )$ (in short, $( \lambda , \epsilon ( \lambda ) )$ -RDP), if for any neighboring datasets $\mathcal { D }$ , $\mathcal { D } ^ { \prime } \in \mathcal { X } ^ { n }$ , the Rényi divergence of order $\lambda$ between $\mathcal { M } ( \mathcal { D } )$ and $\mathcal { M } ( \mathcal { D ^ { \prime } } )$ is upper-bounded by $\epsilon ( \lambda )$ , i.e.,
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
D _ { \lambda } ( \mathcal { M } ( \mathcal { D } ) | | \mathcal { M } ( \mathcal { D } ^ { \prime } ) ) = \frac { 1 } { \lambda - 1 } \log \left( \mathbb { E } _ { \theta \sim \mathcal { M } ( \mathcal { D } ^ { \prime } ) } \left[ \left( \frac { \mathcal { M } ( \mathcal { D } ) ( \theta ) } { \mathcal { M } ( \mathcal { D } ^ { \prime } ) ( \theta ) } \right) ^ { \lambda } \right] \right) \leq \epsilon ( \lambda ) ,
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
where $\mathcal { M } ( \mathcal { D } ) ( \theta )$ denotes the probability that $\mathcal { M }$ on input $\mathcal { D }$ generates the output $\theta$
|
| 59 |
+
|
| 60 |
+
Definition 2 ( $\zeta$ -Ternary $| \chi | ^ { \alpha }$ -differential privacy $\mathbb { \left[ 4 3 \right] }$ ). A randomized mechanism $\mathcal { M } : \mathcal { X } ^ { n } \mathcal { Y }$ is said to have $\zeta$ -ternary- $| \chi | ^ { \alpha }$ -DP, if for any triple of mutually adjacent datasets $\mathcal { D } , \mathcal { D } ^ { \prime } , \mathcal { D } ^ { \prime \prime } \in \mathcal { X } ^ { n }$ (i.e., they mutually differ in the same location), the ternary- $\cdot | \chi | ^ { \alpha }$ divergence of $\mathcal { M } ( \mathcal { D } ) , \mathcal { M } ( \mathcal { D ^ { \prime } } ) , \mathcal { M } ( \mathcal { D ^ { \prime } } )$ is upper-bounded by $( \zeta ( \alpha ) ) ^ { \alpha }$ for all $\alpha \geq 1$ (where $\zeta$ is a function from $\mathbb { R } ^ { + }$ to $\mathbb { R } ^ { + }$ ), i.e.,
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
D _ { | \chi | ^ { \alpha } } \left( \mathcal { M } ( \mathcal { D } ) , \mathcal { M } ( \mathcal { D } ^ { \prime } ) | | \mathcal { M } ( \mathcal { D } ^ { \prime \prime } ) \right) : = \mathbb { E } _ { \mathcal { M } ( \mathcal { D } ^ { \prime \prime } ) } \left[ \left| \frac { \mathcal { M } ( \mathcal { D } ) - \mathcal { M } ( \mathcal { D } ^ { \prime } ) } { \mathcal { M } ( \mathcal { D } ^ { \prime \prime } ) } \right| ^ { \alpha } \right] \leq \left( \zeta ( \alpha ) \right) ^ { \alpha } .
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
The ternary $| \chi | ^ { \alpha }$ -DP was proposed in $\underline { { \| 4 3 \| } }$ to characterize the RDP of the sub-sampled mechanism without shuffling. In this work, we analyze the ternary $| \chi | ^ { \alpha }$ -DP of the shuffled mechanism to bound the RDP of the sub-sampled shuffle model.
|
| 67 |
+
|
| 68 |
+
We can use the following result for converting the RDP guarantees of a mechanism to its central DP guarantees. To the best of our knowledge, this result gives the best conversion.
|
| 69 |
+
|
| 70 |
+
Lemma 1 (From RDP to DP [13, 4]). Suppose for any $\lambda > 1$ , a mechanism $\mathcal { M }$ is $( \lambda , \epsilon \left( \lambda \right) )$ -RDP. Then, the mechanism $\mathcal { M }$ is $( \epsilon , \delta )$ -DP, where $\delta > 0$ is arbitrary and $\epsilon$ is given by
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\epsilon = \operatorname* { m i n } _ { \lambda } \left( \epsilon \left( \lambda \right) + \frac { \log \left( 1 / \delta \right) + \left( \lambda - 1 \right) \log \left( 1 - 1 / \lambda \right) - \log \left( \lambda \right) } { \lambda - 1 } \right) .
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
Problem formulation: We consider a distributed private learning setup comprising a set of $n$ clients, where the ith client has a data point $d _ { i }$ drawn from a universe $\mathcal { X }$ for $i \in [ n ]$ ; see also Figure 1. Let $\mathcal { D } = ( d _ { 1 } , \ldots , d _ { n } )$ denote the entire training dataset. The clients are connected to an untrusted server in order to solve the following empirical risk minimization (ERM) problem
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\operatorname* { m i n } _ { \theta \in { \mathcal { C } } } { \Big ( } F ( \theta , { \mathcal { D } } ) : = { \frac { 1 } { n } } \sum _ { i = 1 } ^ { n } f ( \theta , d _ { i } ) { \Big ) } ,
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
where $\mathcal { C } \subset \mathbb { R } ^ { d }$ is a closed convex set, and $f : \mathcal { C } \times \mathcal { D } \mathbb { R }$ is the loss function. Our goal is to construct a global learning model $\theta$ via stochastic gradient descent (SGD) while preserving privacy of individual data points in the training dataset $\mathcal { D }$ by providing strong DP guarantees.
|
| 83 |
+
|
| 84 |
+
We revisit the CLDP-SGD algorithm presented in $\pmb { \Vert 2 7 }$ and described in Algorithm $\bar { \mathbf { \xi } } _ { 1 }$ to solve the ERM $\boxed { 2 }$ . In each step of CLDP-SGD, we choose uniformly at random a set $\mathcal { U } _ { t }$ of $\boldsymbol { k } \quad \le \quad n$ clients out of $n$ clients. Each client $i \in \ U _ { t }$ computes and clips the $\ell _ { p }$ -norm of the gradient $\nabla _ { { \boldsymbol { \theta } } _ { t } } f \left( { \boldsymbol { \theta } } _ { t } , d _ { i } \right)$ to apply the LDP mechanism $\mathcal { R } _ { p }$ where $\mathcal { R } _ { p } \ : \ B _ { p _ { . } } ^ { d } \ \to \ \{ 0 , 1 \} ^ { \bar { b } }$ is an $\epsilon _ { \mathrm { 0 } }$ -LDP mechanism when inputs come from an $\ell _ { p }$ -norm ball. In $\textstyle \left\| 2 7 \right\|$ , the authors proposed different $\epsilon _ { \mathrm { 0 } }$ -LDP mechanisms for general $\ell _ { p }$ -norm balls. After that, the shuffler randomly permutes the received $k$ gradients $\{ \mathcal { R } _ { p } \left( \tilde { \mathbf { g } } _ { t } \left( d _ { i } \right) \right) \} _ { i \in \mathcal { U } _ { t } }$ and sends them to the server. Finally,
|
| 85 |
+
|
| 86 |
+
Algorithm 1 Acldp: CLDP-SGD
|
| 87 |
+
|
| 88 |
+
Input: Datasets $\mathcal { D } = ( d _ { 1 } , \ldots , d _ { n } ) .$ , LDP privacy parameter $\epsilon _ { \mathrm { 0 } }$ gradient norm bound $C$ , and learning rate schedule $\left\{ \eta _ { t } \right\}$ .
|
| 89 |
+
|
| 90 |
+
1: Initialize: $\theta _ { 0 } \in { \mathcal { C } }$
|
| 91 |
+
2: for $t \in [ T ]$ do
|
| 92 |
+
3: Client sampling: A random set $\mathcal { U } _ { t }$ of $k$ clients is chosen.
|
| 93 |
+
4: for clients $i \in \mathcal { U } _ { t }$ do
|
| 94 |
+
5: Compute gradient: $\mathbf { g } _ { t } \left( d _ { i } \right) \gets \nabla _ { \theta _ { t } } f \left( \theta _ { t } , d _ { i } \right)$
|
| 95 |
+
6: Clip gradient: g˜t (di) gt (di) / max n 1, kgt(di)kpC o
|
| 96 |
+
7: Client $i$ sends $\mathcal { R } _ { p } \left( \tilde { \bf g } _ { t } \left( d _ { i } \right) \right)$ to the shuffler.
|
| 97 |
+
8: end for
|
| 98 |
+
9: Shuffling: The shuffler sends random permutation of
|
| 99 |
+
$\{ \mathcal { R } _ { p } \left( \tilde { \bf g } _ { t } \left( d _ { i } \right) \right) : i \in \mathcal { U } _ { t } \}$ to the server.
|
| 100 |
+
10: Aggregate: $\begin{array} { r } { \overline { { \bf g } } _ { t } \frac { 1 } { k } \sum _ { i \in \mathcal { U } _ { t } } \mathcal { R } _ { p } ( \tilde { \bf g } _ { t } ( d _ { i } ) ) } \end{array}$
|
| 101 |
+
11: Descent Step: $\theta _ { t + 1 } \prod _ { \mathcal { C } } ( \theta _ { t } - \eta _ { t } \overline { { \mathbf { g } } } _ { t } )$ , where $\Pi _ { c }$ is the
|
| 102 |
+
projection operator onto the set $\mathcal { C }$ .
|
| 103 |
+
|
| 104 |
+
# 12: end for
|
| 105 |
+
|
| 106 |
+
Output: The model $\theta _ { T }$ and the privacy parameters $\epsilon , \delta$
|
| 107 |
+
|
| 108 |
+
the server takes the average of the received gradients and updates the parameter vector. Our main contribution in this work is to present a stronger privacy analysis of the CLDP-SGD algorithm by characterizing the RDP of the sub-sampled shuffle model.
|
| 109 |
+
|
| 110 |
+
# 3 Main Results
|
| 111 |
+
|
| 112 |
+
In this section, we present our main results. First, we characterize the RDP of the subsampled shuffle mechanism by presenting an upper bound in Theorem 1 and a lower bound in Theorem $\dot { 2 }$ We then present the privacy-convergence trade-offs of the CLDP-SGD Algorithm in Theorem 3.
|
| 113 |
+
|
| 114 |
+
Consider an arbitrary $\epsilon _ { \mathrm { 0 } }$ -LDP mechanism $\mathcal { R }$ , whose range is a discrete set $[ B ] = \{ 1 , \dots , B \}$ for some $B \in \mathbb { N } : = \{ 1 , 2 , 3 , . . . \}$ . Here, $[ B ]$ could be the whole of $\mathbb { N }$ . Let $\mathcal { M } ( \mathcal { D } )$ be a subsampled shuffle mechanism defined as follows: First subsample $k \leq n$ clients of the $n$ clients (without replacement), where $\textstyle \gamma = { \frac { k } { n } }$ denotes the sampling parameter. Each client $i$ out of the $k$ selected clients applies $\mathcal { R }$ on $d _ { i }$ and sends $\mathcal { R } ( d _ { i } )$ to the shuffler,5 who randomly permutes the received $k$ inputs and outputs the result. To formalize this, let $\mathcal { H } _ { k } : \overline { { \mathcal { V } } } ^ { k } \to \mathcal { V } ^ { k }$ denote the shuffling operation that takes $k$ inputs and outputs their uniformly random permutation. Let $\operatorname { s a m p } _ { k } ^ { n } : \mathcal { X } ^ { n } \to ^ { \mathbf { \bar { \alpha } } } \mathcal { X } ^ { k }$ denote the sampling operation for choosing a random subset of $k$ elements from a set of $n$ elements. We define the subsampled-shuffle mechanism as
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\mathcal { M } \left( \mathcal { D } \right) : = \mathcal { H } _ { k } \circ \operatorname { s a m p } _ { k } ^ { n } \left( \mathcal { R } \left( d _ { 1 } \right) , \dotsc , \mathcal { R } \left( d _ { n } \right) \right) .
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
Observe that each iteration of Algorithm 1 can be represented as an output of the subsampled shuffle mechanism $\mathcal { M }$ . Thus, to analyze the privacy of Algorithm $\bigstar$ it is sufficient to analyze the privacy of a sequence of identical $T$ subsampled shuffle mechanisms, and then apply composition theorems.
|
| 121 |
+
|
| 122 |
+
Histogram notation. It will be useful to define the following notation. Since the output of $\mathcal { H } _ { k }$ is a random permutation of the $k$ outputs of $\mathcal { R }$ (subsampling is not important here), the server cannot associate the $k$ messages to the clients; and the only information it can use from the messages is the histogram, i.e., the number of messages that give any particular output in $[ B ]$ . We define a set $\mathcal { A } _ { B } ^ { k }$ as
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
\mathcal { A } _ { B } ^ { k } = \bigg \{ h = ( h _ { 1 } , \ldots , h _ { B } ) : \sum _ { j = 1 } ^ { B } h _ { j } = k \bigg \} ,
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
to denote the set of all possible histograms of the output of the shuffler with $k$ inputs. Therefore, we can assume, without loss of generality (w.l.o.g.), that the output of $\mathcal { M }$ is a distribution over $\mathcal { A } _ { B } ^ { k }$ .
|
| 129 |
+
|
| 130 |
+
Our main results for the RDP of the subsampled shuffled mechanism (defined in $( 3 )$ ) are given below. Our first result provides an upper bound (stated in Theorem 1 and proved in Section $. 5 )$ and the second result provides a lower bound (stated in Theorem 2 and proved in Appendix D)
|
| 131 |
+
|
| 132 |
+
Theorem 1 (Upper Bound). For any $n \in \mathbb { N } , k \leq n , \epsilon _ { 0 } \geq 0 ,$ and any integer $\lambda \geq 2$ , the RDP of the subsampled shuffle mechanism $\mathcal { M }$ (defined in $\textcircled { 3 }$ ) is upper-bounded by
|
| 133 |
+
|
| 134 |
+
$\epsilon ( \lambda ) \leq \frac { 1 } { \lambda - 1 } \log \left( 1 + 4 \binom { \lambda } { 2 } \gamma ^ { 2 } \frac { \left( e ^ { \epsilon _ { 0 } } - 1 \right) ^ { 2 } } { \bar { k } e ^ { \epsilon _ { 0 } } } + \sum _ { j = 3 } ^ { \lambda } \binom { \lambda } { j } \gamma ^ { j } j \Gamma \left( j / 2 \right) \left( \frac { 2 \left( e ^ { 2 \epsilon _ { 0 } } - 1 \right) ^ { 2 } } { \bar { k } e ^ { 2 \epsilon _ { 0 } } } \right) ^ { j / 2 } + \Upsilon \right) ,$ where $\begin{array} { r } { \overline { { k } } = \lfloor \frac { k - 1 } { 2 e ^ { \epsilon _ { 0 } } } \rfloor + 1 , \gamma = \frac { k } { n } } \end{array}$ , and $\begin{array} { r } { \Gamma \left( z \right) = \int _ { 0 } ^ { \infty } x ^ { z - 1 } e ^ { - x } d x } \end{array}$ is the Gamma function. The term $\Upsilon$ is given by $\begin{array} { r } { \Upsilon = \left( \left( 1 + \gamma \frac { e ^ { 2 \epsilon _ { 0 } } - 1 } { e ^ { \epsilon _ { 0 } } } \right) ^ { \lambda } - 1 - \lambda \gamma \frac { e ^ { 2 \epsilon _ { 0 } } - 1 } { e ^ { \epsilon _ { 0 } } } \right) e ^ { - \frac { k - 1 } { 8 e ^ { \epsilon _ { 0 } } } } . } \end{array}$ .
|
| 135 |
+
|
| 136 |
+
Theorem 2 (Lower Bound). For any $n \in \mathbb { N } , k \leq n , \epsilon _ { 0 } \geq 0$ , and any integer $\lambda \geq 2$ , the RDP of the subsampled shuffle mechanism $\mathcal { M }$ (defined in $\textcircled { 3 }$ ) is lower-bounded by
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\mathrm { \Sigma } ( \lambda ) \geq \frac { 1 } { \lambda - 1 } \log \left( 1 + { \binom { \lambda } { 2 } } \gamma ^ { 2 } \frac { \left( e ^ { \epsilon _ { 0 } } - 1 \right) ^ { 2 } } { k e ^ { \epsilon _ { 0 } } } + \sum _ { j = 3 } ^ { \lambda } { \binom { \lambda } { j } } \gamma ^ { j } \left( \frac { \left( e ^ { 2 \epsilon _ { 0 } } - 1 \right) } { k e ^ { \epsilon _ { 0 } } } \right) ^ { j } \mathbb { E } \left( m - \frac { k } { e ^ { \epsilon _ { 0 } } + 1 } \right) ^ { j } \right) ,
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
where expectation is taken w.r.t. the binomial r.v. $m \sim B i n \left( k , p \right)$ with parameter $\begin{array} { r } { p = \frac { 1 } { e ^ { \epsilon _ { 0 } } + 1 } } \end{array}$ .
|
| 143 |
+
|
| 144 |
+
Our CLDP-SGD algorithm and its privacy-convergence trade-offs (stated in Theorem 3 below) are given for a general local randomizer $\mathcal { R } _ { p }$ (whose inputs comes from an $\ell _ { p }$ -ball for any $p \in [ 1 , \infty ] )$ that satisfies the following conditions: (i) The randomized mechanism $\mathcal { R } _ { p }$ is an $\scriptstyle \epsilon _ { 0 } - \mathrm { \mathrm { L D P } }$ mechanism. (ii) The randomized mechanism $\mathcal { R } _ { p }$ is unbiased, i.e., $\vec { \mathfrak { L } } [ \mathcal { R } _ { p } ( \mathbf { x } ) | \mathbf { x } | = \mathbf { x }$ for all $\mathbf { x } \in B _ { p } ( a )$ , where $a$ is the radius of the ball $B _ { p }$ . (iii) The output of the randomized mechanism $\mathcal { R } _ { p }$ can be represented using $B \in$ $\mathbb { N } ^ { + }$ bits. (iv) The randomized $\mathcal { R } _ { p }$ has a bounded variance: $\begin{array} { r } { \operatorname* { s u p } _ { \mathbf { x } \in \mathcal { B } _ { p } ( a ) } \mathbb { E } \| \mathcal { R } _ { p } \left( \mathbf { x } \right) - \mathbf { x } \| _ { 2 } ^ { 2 } \leq G _ { p } ^ { 2 } ( a ) } \end{array}$ , where $G _ { p } ^ { 2 }$ is a function from $\mathbb { R } ^ { + }$ to $\mathbb { R } ^ { + }$ .
|
| 145 |
+
|
| 146 |
+
Girgis et al. $\textstyle \left\| 2 7 \right\|$ proposed unbiased $\epsilon _ { 0 }$ -LDP mechanisms $\mathcal { R } _ { p }$ for several values of norms $p \in [ 1 , \infty ]$ that require $b = \mathcal { O } \left( \log \left( d \right) \right)$ bits of communication and satisfy the above conditions. In this paper, achieving communication efficiency is not our goal (though we also achieve that since the $\epsilon _ { 0 } { \mathrm { - L D P } }$ mechanism $\mathcal { R } _ { p }$ that we use takes values in a discrete set), as our main focus is on analyzing the RDP of the subsampled shuffle mechanism. If we use the $\epsilon _ { 0 }$ -LDP mechanism $\mathcal { R } _ { p }$ from $\dot { \underline { 1 2 7 } }$ , we would also get similar gains in communication as were obtained in $\lVert 2 7 \rVert$ .
|
| 147 |
+
|
| 148 |
+
The privacy-convergence trade-off of our algorithm $\mathcal { A } _ { \mathrm { c l d p } }$ is given below.
|
| 149 |
+
|
| 150 |
+

|
| 151 |
+
(a) Approx. DP as a function of $T$ (b) Approx. DP as a function of $T$ (c) Approx. DP as a function of $n$ for $\epsilon _ { 0 } = 2 $ , $\gamma = 0 . 0 0 1$ , $n = 1 0 ^ { 6 }$ for $\epsilon _ { 0 } = 1$ , $\gamma = 0 . 0 0 1$ , $n = 1 0 ^ { 7 }$ for $\epsilon _ { 0 } = 2 $ , $\gamma n = 1 0 ^ { 3 }$ , $T = 1 0 ^ { 5 }$
|
| 152 |
+
Figure 2: Comparison of several bounds on the Approximate $( \epsilon , \delta )$ -DP for composition of a sequence of subsampled shuffle mechanisms for $\delta = 1 0 ^ { - 8 }$ : (i) Approximate DP obtained from our upper bound on the RDP in Theorem $\perp$ (blue); (ii) Approximate DP obtained from our lower bound on the RDP in Theorem $\bigstar$ (red); (iii) Approximate DP obtained from the upper bound on the RDP given in $\left[ \left[ 2 9 \right] \right]$ with RDP amplification by subsampling from $\pmb { \boxed { 4 3 } }$ (black); and (iv) Applying the strong composition theorem $\textcircled { 1 3 4 } |$ after getting the Approximate DP of the shuffled model given in $\pm$ with subsampling $\mathbf { \widehat { | 4 2 | } }$ (magenta).
|
| 153 |
+
|
| 154 |
+
Theorem 3 (Privacy-Convergence tradeoffs). Let the set $\mathcal { C }$ be convex with diameter $D$ and the function $f ( \theta ; . ) : \mathcal { C } \times \mathcal { D } \mathbb { R }$ be convex and $L$ -Lipschitz continuous with respect to the $\ell _ { g }$ -norm, which is the dual of the $\ell _ { p }$ -norm. Let $\theta ^ { * } = \arg \operatorname* { m i n } _ { \theta \in { \mathcal { C } } } F \left( \theta \right)$ denote the minimizer of the problem $\textcircled { 2 }$ For $\textstyle \gamma = { \frac { k } { n } }$ , if we run Algorithm $\mathcal { A } _ { \mathrm { c l d p } }$ over $T$ iterations, then we have
|
| 155 |
+
|
| 156 |
+
$$
|
| 157 |
+
\epsilon = \operatorname* { m i n } _ { \lambda } \left( T \epsilon \left( \lambda \right) + \frac { \log \left( 1 / \delta \right) + \left( \lambda \stackrel { \star } { - } 1 \right) \log \left( 1 - 1 / \lambda \right) - \log \left( \lambda \right) } { \lambda - 1 } \right) ,
|
| 158 |
+
$$
|
| 159 |
+
|
| 160 |
+
where $\epsilon \left( \lambda \right)$ is the RDP of the subsampled shuffle mechanism given in Theorem 1.
|
| 161 |
+
|
| 162 |
+
2. Convergence: If we run $\mathcal { A } _ { \mathrm { c l d p } }$ with $\begin{array} { r } { \eta _ { t } = \frac { D } { G \sqrt { t } } } \end{array}$ , where $\begin{array} { r } { G ^ { 2 } = \operatorname* { m a x } \lbrace d ^ { 1 - \frac { 2 } { p } } , 1 \rbrace L ^ { 2 } + \frac { G _ { p } ^ { 2 } ( L ) } { \gamma n } } \end{array}$ , we get $\mathbb { E } \left[ F \left( \theta _ { T } \right) \right] - F \left( \theta ^ { * } \right) \leq \mathcal { O } \left( \frac { D G \log ( T ) } { \sqrt { T } } \right) .$
|
| 163 |
+
|
| 164 |
+
The proof outline of Theorem $3$ is as follows: Note that $\mathcal { A } _ { \mathrm { c l d p } }$ is an iterative algorithm, where in each iteration we use the subsampled shuffle mechanism as defined in $\textcircled{3}$ , for which we have computed the RDP guarantees in Theorem $\bigtriangledown$ Now, for the privacy analysis of $\mathcal { A } _ { \mathrm { c l d p } }$ , we use the adaptive composition theorem from $\textcircled { 1 3 7 }$ Proposition 1] and then use the RDP to DP conversion given in Lemma $^ { 1 . }$ For the convergence analysis, we use a standard non-private SGD convergence result and compute the required parameters for that. See Appendix F for a complete proof of Theorem 3.
|
| 165 |
+
|
| 166 |
+
Remark 1. Note that our convergence bound is affected by the variance of the $\epsilon _ { \mathrm { 0 } }$ -LDP mechanism $\mathcal { R } _ { p }$ . For example, when $f$ is $L$ -Lipschitz continuous w.r.t. the $\ell _ { 2 }$ -norm, we can use the LDP mechanism $\mathcal { R } _ { 2 }$ proposed in $\boxed { 1 1 }$ that has variance $\begin{array} { r } { G _ { 2 } ^ { 2 } ( L ) = 1 4 L ^ { 2 } d \big ( \frac { e ^ { \epsilon _ { 0 } } + 1 } { e ^ { \epsilon _ { 0 } } - 1 } \big ) ^ { 2 } } \end{array}$ ; and when $f$ is $L$ -Lipschitz continuous w.r.t. the $\ell _ { 1 }$ -norm or $\ell _ { \infty }$ -norm, we can use the LDP mechanisms $\mathcal { R } _ { \infty }$ or $\mathcal { R } _ { 1 }$ , respectively, proposed in $\lVert 2 7 \rVert$ 1 that have variances $\begin{array} { r } { G _ { \infty } ^ { 2 } ( L ) = L ^ { 2 } d ^ { 2 } \big ( \frac { e ^ { \epsilon _ { 0 } } + 1 } { e ^ { \epsilon _ { 0 } } - 1 } \big ) ^ { 2 } } \end{array}$ 2 and G21(L) = L2d e✏0 +1e✏0 1 2 , respectively. By plugging these variances $G _ { p } ^ { 2 } ( L )$ (for $p = 1 , 2 , \infty )$ into Theorem $3 .$ we get the convergence rate of the $L$ -Lipschitz continuous loss function w.r.t. the $\ell _ { p }$ -norm (for $p \equiv \infty , 2 , 1 $ ).
|
| 167 |
+
|
| 168 |
+
Remark 2. The privacy parameter in $( 5 )$ is not in a closed form expression and could be obtained by solving an optimization problem. However, we numerically compute it for several interesting regimes of parameters in our numerical experiments; see Section 4 for more details.
|
| 169 |
+
|
| 170 |
+
# 4 Numerical Results
|
| 171 |
+
|
| 172 |
+
In this section, we present numerical experiments to show the performance of our bounds on RDP of the subsampled shuffle mechanism and its usage for getting approximate DP of Algorithm 1 for training machine learning models.
|
| 173 |
+
|
| 174 |
+
Composition of a sequence of subsampled shuffle models: In Figure 2, we plot several bounds on the approximate $( \epsilon , \delta )$ -DP for a composition of $T$ mechanisms $( \mathcal { M } _ { 1 } , \ldots , \mathcal { M } _ { T } )$ , where $\mathcal { M } _ { t }$ is a subsampled shuffle mechanism for $t \in [ T ]$ . In all our experiments reported in Figure $2 .$ we fix $\delta = 1 0 ^ { - 8 }$ . We observe that our new bound on the RDP of the subsampled shuffle mechanism achieves a significant saving in total privacy $\epsilon$ compared to the state-of-the-art. For example, we save a factor of $1 4 \times$ compared to the bound on DP $\pm \overbrace { \lVert 2 4 \rVert }$ with strong composition theorem $\textcircled { 1 3 4 } \textcircled { 1 }$ and $2 . 5 \times$ compared to the bound on the RDP given in $\lVert 2 9 \rVert$ with subsampled RDP $\textcircled { 1 4 3 } |$ in computing the overall privacy parameter $\epsilon$ for number of iterations $\bar { T } = 1 0 ^ { 5 }$ , subsampling parameter $\gamma = 0 . 0 0 1$ , LDP parameter $\epsilon _ { 0 } = 2 $ , and number of clients $n = 1 0 ^ { 6 }$ . We observe in Figure $\boxed { 2 \mathrm { b } }$ that the bound given in $\pmb { \mathbb { Z 4 } }$ with the strong composition theorem $\pm$ behaves better than the bound on the RDP $\pmb { \bigtriangledown }$ with subsampled RDP bound $\boxed { \boxed { 4 3 } }$ when the number of subsampled clients per iteration is equal to $k = \gamma n = \mathrm { \bar { 1 0 ^ { 4 } } }$ ; however, our bound beats both of them.6 In Figure $\boxed { 2 \mathrm { c } }$ we fix the number of subsampled clients per iteration to be $k = \gamma n = 1 0 ^ { 3 }$ , and hence, the subsampling parameter $\gamma$ varies with $n$ .
|
| 175 |
+
|
| 176 |
+
Distributed private learning: We numerically evaluate the proposed privacy-learning performance on training machine learning models. We consider the standard MNIST handwritten digit dataset that has 60, 000 training images and 10, 000 test images. We train a simple neural network that was also used in $\pm \pm \pm \textcircled { 3 9 }$ and described in Table $\bigstar$ This model has $d = 1 3$ , 170 parameters and achieves an accuracy of $9 9 \%$ for non-private, uncompressed vanilla SGD. We assume that we have $n = 6 0 , 0 0 0$ clients, where each client has one sample. At each step of the Algorithm $\bigstar \bigstar$ we choose uniformly at random 10, 000 clients, where each client clips the $\ell _ { \infty }$ -norm of the gradient with clipping parameter $C = 1 / 1 0 0$ and applies the $\mathcal { R } _ { \infty }$ $\epsilon _ { \mathrm { 0 } }$ -LDP mechanism proposed in $\mathbb { \ Z } \mathbb { \ Z }$ with $\epsilon _ { 0 } = 1 . 5$ . We run Algorithm $^ 1$ with $\bar { \delta } = 1 0 ^ { - 5 }$ for 200 epochs, with learning rate $\eta = 0 . 3$ for the first 70 epochs, and
|
| 177 |
+
|
| 178 |
+
then decrease it to 0.18 in the remaining epochs.
|
| 179 |
+
|
| 180 |
+
Table 1: Model architecture for MNIST
|
| 181 |
+
|
| 182 |
+
<table><tr><td>Layer</td><td>Parameters</td></tr><tr><td>Convolution Max-Pooling Convolution Max-Pooling Fully connected Softmax</td><td>16 filters of 8 × 8,Stride 2 2×2 32 filters of 4 × 4, Stride 2 2×2 32 units 10 units</td></tr></table>
|
| 183 |
+
|
| 184 |
+

|
| 185 |
+
Figure 3: Privacy-Utility trade-offs on the MNIST dataset with $\ell _ { \infty }$ -norm clipping.
|
| 186 |
+
|
| 187 |
+
Figure 3 plots the mean and the standard deviation of privacy-accuracy trade-offs averaged over 10 runs. For our privacy analysis, the total privacy budget is computed by optimizing over RDP order $\lambda$ using our upper bound given in Theorem $^ { 1 . }$ For privacy analysis of $\dot { \lVert 2 4 \rVert }$ , we first compute the privacy amplification by shuffling numerically given in $\lVert 2 4 \rVert$ ; then we compute its privacy obtained when amplified via subsampling $\lVert \overline { { 4 2 } } \rVert$ ; and finally we use the strong composition theorem $\overleftarrow { \mathbb { B } 4 }$ to obtain the central privacy parameter $\epsilon$ .
|
| 188 |
+
|
| 189 |
+
We observe that we achieve an accuracy of $8 0 \% ( \pm 1 . 8 )$ with a total privacy budget of $\epsilon = 1 . 4$ using our new privacy analysis, whereas, $\dot { \lVert 2 4 \rVert }$ achieves an accuracy of only $7 0 . 7 \% ( \pm 2 . 1 )$ with the same privacy budget of $\epsilon = 1 . 4$ using the standard composition theorems. Furthermore, we can see that we achieves accuracy $9 0 \% ( \pm 0 . { \bar { 5 } } )$ with total privacy budget $\epsilon = 2 . 9 1$ using our new privacy analysis, whereas, $\pmb { \left[ 2 4 \right] }$ (together with the standard strong composition theorem) achieves the same accuracy with a total privacy budget of $\epsilon = 4 . 8 2$ .
|
| 190 |
+
|
| 191 |
+
# 5 Proof of Theorem 1: Upper Bound
|
| 192 |
+
|
| 193 |
+
For any dataset $\mathcal { D } _ { k } = ( d _ { 1 } , \ldots , d _ { k } ) \in \mathcal { X } ^ { k }$ containing of $k$ data points, we define a shuffle mechanism $\mathcal { M } _ { s h } ( \mathcal { D } _ { k } )$ as follows:
|
| 194 |
+
|
| 195 |
+
$$
|
| 196 |
+
\mathcal { M } _ { s h } ( \mathcal { D } _ { k } ) = \mathcal { H } _ { k } \left( \mathcal { R } \left( d _ { 1 } \right) , \ldots , \mathcal { R } \left( d _ { k } \right) \right) ,
|
| 197 |
+
$$
|
| 198 |
+
|
| 199 |
+
where $\mathcal { H } _ { k }$ takes $k$ inputs and outputs a uniformly random permutation of them. Recall from $\textcircled{3}$ , for any dataset $\mathcal { D } _ { n } = ( \bar { d } _ { 1 } , \ldots , d _ { n } ) \in \mathcal { X } ^ { n }$ containing $n$ data points, the subsampled-shuffle mechanism is defined as $\mathcal { M } \left( \mathcal { D } \right) : = \mathcal { H } _ { k } \circ \mathrm { s a m p } _ { k } ^ { n }$ $( \mathcal { R } \left( d _ { 1 } \right) , \ldots , \mathcal { R } \left( d _ { n } \right) )$ .
|
| 200 |
+
|
| 201 |
+
The proof of Theorem 1 consists of two steps. First, we bound the ternary- $\cdot | \chi | ^ { \alpha }$ -DP of the shuffle mechanism $\mathcal { M } _ { s h }$ (see Theorem $\bigstar$ , which is the main technical contribution in this proof. Then, using this, we bound the RDP of the subsampled shuffle mechanism $\mathcal { M }$ .
|
| 202 |
+
|
| 203 |
+
Theorem 4 $\zeta$ -ternary- $| \chi | ^ { \alpha }$ -DP of the shuffle mechanism $\mathcal { M } _ { s h }$ ). For any integer $k \geq 2$ , $\epsilon _ { 0 } > 0$ , and all $\alpha \geq 2$ , the $\zeta$ -ternary- $\cdot | \chi | ^ { \alpha }$ -DP of the shuffle mechanism $\mathcal { M } _ { s h }$ is bounded by:
|
| 204 |
+
|
| 205 |
+
$$
|
| 206 |
+
\zeta \left( \alpha \right) ^ { \alpha } \leq \left\{ \begin{array} { l l } { 4 \frac { \left( e ^ { \epsilon _ { 0 } } - 1 \right) ^ { 2 } } { \bar { k } e ^ { \epsilon _ { 0 } } } + ( e ^ { \epsilon _ { 0 } } - e ^ { - \epsilon _ { 0 } } ) ^ { \alpha } e ^ { - \frac { k - 1 } { 8 e ^ { \epsilon _ { 0 } } } } } & { i f \alpha = 2 , } \\ { \alpha \Gamma \left( \alpha / 2 \right) \left( \frac { 2 \left( e ^ { 2 \epsilon _ { 0 } } - 1 \right) ^ { 2 } } { \bar { k } e ^ { 2 \epsilon _ { 0 } } } \right) ^ { \alpha / 2 } + ( e ^ { \epsilon _ { 0 } } - e ^ { - \epsilon _ { 0 } } ) ^ { \alpha } e ^ { - \frac { k - 1 } { 8 e ^ { \epsilon _ { 0 } } } } } & { o t h e r w i s e , } \end{array} \right.
|
| 207 |
+
$$
|
| 208 |
+
|
| 209 |
+
where $\begin{array} { r } { \overline { { k } } = \lfloor \frac { k - 1 } { 2 e ^ { \epsilon _ { 0 } } } \rfloor + 1 } \end{array}$ and $\begin{array} { r } { \Gamma \left( z \right) = \int _ { 0 } ^ { \infty } x ^ { z - 1 } e ^ { - x } d x } \end{array}$ is the Gamma function.
|
| 210 |
+
|
| 211 |
+
Theorem 4 is one of the core technical results of this paper, and we prove it in Section 6.
|
| 212 |
+
|
| 213 |
+
It was shown in $\boxed { \boxed { 4 3 } }$ Proposition 16] that if a mechanism obeys $\zeta$ -ternary- $\cdot | \chi | ^ { \alpha }$ -DP, then its subsampled version (with subsampling parameter $\gamma$ ) will obey $\gamma \zeta .$ -ternary- $| \chi | ^ { \alpha }$ -DP. Using that result, the authors then bounded the RDP of the subsampled mechanism in $\underline { { \bar { 1 4 3 } } } \underline { { \bar { 1 } } }$ Eq. (9)]. Adapting that result to our setting, we have the following lemma.
|
| 214 |
+
|
| 215 |
+
Lemma 2 (From $\zeta$ -ternary- $| \chi | ^ { \alpha }$ -DP to subsampled RDP). Suppose the shuffle mechanism $\mathcal { M } _ { s h }$ obeys $\zeta$ -ternary- $| \chi | ^ { \alpha }$ -DP. For any $\lambda \geq 2 , k \leq n$ , RDP of the subsampled shuffle mechanism $\mathcal { M }$ (with subsampling parameter $\gamma = k / n ,$ ) is bounded by: $\begin{array} { r } { \epsilon ( \lambda ) \leq \frac { 1 } { \lambda - 1 } \log \left( 1 + \sum _ { \alpha = 2 } ^ { \lambda } \binom { \lambda } { \alpha } \gamma ^ { \alpha } \zeta ( \alpha ) ^ { \alpha } \right) } \end{array}$ .
|
| 216 |
+
|
| 217 |
+
Lemma 2 can be seen as a corollary to $\boxed { \ 4 3 }$ Proposition 16 and Eq. (9)]. However, for completeness, we prove it in Appendix $\boxed { \mathrm { E . 1 } }$ Substituting the bound on $\zeta ( \alpha )$ from Theorem 4 into Lemma 2 together with some algebraic manipulation gives proves Theorem 1; see Appendix $\mathrm { E } . 2$ for details.
|
| 218 |
+
|
| 219 |
+
# 6 Proof of Theorem $\mathbf { 4 } ;$ Ternary $| \chi | ^ { \alpha }$ -DP of the Shuffle Model
|
| 220 |
+
|
| 221 |
+
The proof has two main steps. In the first step, we reduce the problem of deriving ternary divergence for arbitrary neighboring datasets to the problem of deriving the ternary divergence for specific neighboring datasets, $\mathcal { D } \stackrel { - } { \sim } \mathcal { D } ^ { \prime } \sim \mathcal { D } ^ { \prime \prime }$ , where all elements in $\mathcal { D }$ are the same and $\mathcal { D } ^ { \prime } , \mathcal { D } ^ { \prime \prime }$ differ from $\mathcal { D }$ in one entry. In the second step, we derive the ternary divergence for the special neighboring datasets.
|
| 222 |
+
|
| 223 |
+
The specific neighboring datasets to which we reduce our general problem has the following form:
|
| 224 |
+
|
| 225 |
+
$$
|
| 226 |
+
\begin{array} { r } { \mathcal { D } _ { \mathrm { s a m e } } ^ { m } = \{ ( \mathcal { D } _ { m } , \mathcal { D } _ { m } ^ { \prime } , \mathcal { D } _ { m } ^ { \prime \prime } ) : \mathcal { D } _ { m } = ( d , \ldots , d , d ) \in \mathcal { X } ^ { m } , \mathcal { D } _ { m } ^ { \prime } = ( d , \ldots , d , d ^ { \prime } ) \in \mathcal { X } ^ { m } , \mathrm { ~ a ~ n ~ d ~ } \mathcal { X } = 1 , \ldots , d , 1 \} , } \\ { \mathcal { D } _ { m } ^ { \prime \prime } = ( d , \ldots , d , d ^ { \prime \prime } ) \in \mathcal { X } ^ { m } , \mathrm { ~ w h e r e ~ } d , d ^ { \prime } , d ^ { \prime \prime } \in \mathcal { X } \} } \end{array}
|
| 227 |
+
$$
|
| 228 |
+
|
| 229 |
+
Consider arbitrary neighboring datasets $\mathcal { D } = \left( d _ { 1 } , \ldots , d _ { k - 1 } , d _ { k } \right)$ , $\mathcal { D } ^ { \prime } = ( d _ { 1 } , \ldots , d _ { k - 1 } , d _ { k } ^ { \prime } )$ , and $\mathcal { D } ^ { \prime \prime } = ( d _ { 1 } , \dots , d _ { k - 1 } ^ { - } , d _ { k } ^ { \overline { { \prime } } \prime } )$ , each having $k$ elements. For any $m \in \{ 0 , \ldots , k - 1 \}$ , we define new neighboring dataeach having = (d00k , . . . , d00k , dk), D0(k)m+1 = (d00k , . . . , d00k , d0k), and D00(k)m+1 $\mathcal { D } _ { m + 1 } ^ { \prime \prime ( k ) } = ( d _ { k } ^ { \prime \prime } , \dots , d _ { k } ^ { \prime \prime } )$ $m + 1$ $( \mathcal { D } _ { m + 1 } ^ { \prime \prime ( k ) } , \mathcal { D } _ { m + 1 } ^ { \prime ( k ) } , \mathcal { D } _ { m + 1 } ^ { ( k ) } ) \in \mathcal { D } _ { \mathrm { s a m e } } ^ { m }$
|
| 230 |
+
|
| 231 |
+
The first step of the proof is given in the following theorem.
|
| 232 |
+
|
| 233 |
+
Theorem 5 (Reduction to the Special Case). Let $\begin{array} { r } { q = \frac { 1 } { e ^ { \epsilon _ { 0 } } } } \end{array}$ . We have:
|
| 234 |
+
|
| 235 |
+
$$
|
| 236 |
+
\begin{array} { r l } & { \mathbb { E } _ { h \sim \mathcal { M } _ { s h } ( \mathcal { D } ^ { \prime \prime } ) } \left[ \left| \frac { \mathcal { M } _ { s h } ( \mathcal { D } ) ( h ) - \mathcal { M } _ { s h } ( \mathcal { D } ^ { \prime } ) ( h ) } { \mathcal { M } _ { s h } ( \mathcal { D } ^ { \prime \prime } ) ( h ) } \right| ^ { \alpha } \right] } \\ & { \qquad \leq \mathbb { E } _ { m \sim \mathrm { B i n } ( k - 1 , q ) } \left[ \mathbb { E } _ { h \sim \mathcal { M } _ { s h } ( \mathcal { D } _ { m + 1 } ^ { \prime \prime ( k ) } ) } \left[ \left| \frac { \mathcal { M } _ { s h } ( \mathcal { D } _ { m + 1 } ^ { ( k ) } ) ( h ) - \mathcal { M } _ { s h } ( \mathcal { D } _ { m + 1 } ^ { \prime ( k ) } ) ( h ) } { \mathcal { M } _ { s h } ( \mathcal { D } _ { m + 1 } ^ { \prime \prime ( k ) } ) ( h ) } \right| ^ { \alpha } \right] \right] . } \end{array}
|
| 237 |
+
$$
|
| 238 |
+
|
| 239 |
+
We know (by Chernoff bound) that the binomial r.v. is concentrated around its mean, which implies that the terms in the RHS of $\textcircled { 9 }$ that correspond to $m \ < \ ( 1 - \tau ) q ( k - 1 )$ (we will take $\tau ~ = ~ 1 / 2 )$ will contribute in a negligible amount. Then we show that $E _ { m } : =$ $\mathbb { E } _ { \boldsymbol { h } \sim \mathcal { M } _ { s h } ( \mathcal { D } _ { m + 1 } ^ { \prime \prime ( k ) } ) } \left[ \left| \frac { \mathcal { M } _ { s h } ( \mathcal { D } _ { m + 1 } ^ { ( k ) } ) ( \boldsymbol { h } ) - \mathcal { M } _ { s h } ( \mathcal { D } _ { m + 1 } ^ { \prime ( k ) } ) ( \boldsymbol { h } ) } { \mathcal { M } _ { s h } ( \mathcal { D } _ { m + 1 } ^ { \prime \prime ( k ) } ) ( \underline { { h } } ) } \right| ^ { \alpha } \right]$ is a non-increasing function of $m$ . These observation together imply that the RHS in $( 9 )$ is approximately equal to $E _ { ( 1 - \tau ) q ( k - 1 ) }$ .
|
| 240 |
+
|
| 241 |
+
Since $E _ { m }$ is precisely what is required to bound the ternary DP for the specific neighboring datasets, we have reduced the problem of computing the ternary DP for arbitrary neighboring datasets to the problem of computing ternary DP for specific neighboring datasets. The second step of the proof bounds $E _ { ( 1 - \tau ) q ( n - 1 ) }$ , which follows from the result below that holds for any $m \in \mathbb { N }$ .
|
| 242 |
+
|
| 243 |
+
$[ | \chi | ^ { \alpha }$ $m \in \mathbb { N }$ $\alpha \geq 2$ $( \mathcal { D } _ { m } ^ { \prime \prime } , \mathcal { D } _ { m } ^ { \prime } , \mathcal { D } _ { m } ) \in \mathcal { D } _ { s a m e } ^ { m }$
|
| 244 |
+
|
| 245 |
+
$$
|
| 246 |
+
\mathbb { E } _ { h \sim M _ { s h } ( \mathcal { D } _ { m } ) } \left[ \left| \frac { \mathcal { M } _ { s h } ( \mathcal { D } _ { m } ^ { \prime } ) ( h ) - \mathcal { M } _ { s h } ( \mathcal { D } _ { m } ^ { \prime \prime } ) ( h ) } { \mathcal { M } _ { s h } ( \mathcal { D } _ { m } ) ( h ) } \right| ^ { \alpha } \right] \leq \left\{ \begin{array} { l l } { 4 \frac { ( e ^ { \epsilon _ { 0 } } - 1 ) ^ { 2 } } { m \epsilon ^ { \epsilon _ { 0 } } } } & { i f \alpha = 2 , } \\ { \alpha \Gamma ( \alpha / 2 ) \left( \frac { 2 ( e ^ { z _ { 0 } } - 1 ) ^ { 2 } } { m e ^ { 2 z _ { 0 } } } \right) ^ { \alpha / 2 } } & { o t h e r w i s e . } \end{array} \right.
|
| 247 |
+
$$
|
| 248 |
+
|
| 249 |
+
Missing details of how Theorem $^ 4$ follows from Theorems 5, 6 can be found in Appendix C.4.
|
| 250 |
+
|
| 251 |
+
Proof sketch of Theorem $\boxed { 5 }$ Let $\pmb { p } _ { i } , i \in [ k ] , \pmb { p } _ { k } ^ { \prime } , \pmb { p } _ { k } ^ { \prime \prime }$ denote the distributions of $\mathcal { R }$ when the input data point is $d _ { i } , d _ { k } ^ { \prime } , d _ { k } ^ { \prime \prime }$ , respectively. The main idea of the proof is the observation that each $\pmb { p } _ { i }$ can be written as a mixture distribution $\begin{array} { r } { \pmb { p } _ { i } = \frac { 1 } { e ^ { \epsilon _ { 0 } } } \pmb { p } _ { k } ^ { \prime \prime } + \left( 1 - \frac { 1 } { e ^ { \epsilon _ { 0 } } } \right) \tilde { \pmb { p } } _ { i } } \end{array}$ , where $\tilde { \pmb { p } } _ { i }$ is defined in terms of ${ \pmb p } _ { i } , { \pmb p } _ { k } ^ { \prime \prime }$ . So, instead of client $i \in [ k - 1 ]$ mapping its data point $d _ { i }$ according to $\mathbf { \nabla } _ { \pmb { p } _ { i } }$ , we can view it as the client $i$ maps $d _ { i }$ according to $\pmb { p } _ { k } ^ { \prime \prime }$ with probability (w.p.) $1 / e ^ { \epsilon _ { 0 } }$ and according to $\tilde { \pmb { p } } _ { i }$ w.p. $\left( 1 - 1 / e ^ { \epsilon _ { 0 } } \right)$ . As a result, the number of clients that sample from the distribution $\pmb { p } _ { k } ^ { \prime \prime }$ follows a binomial distribution $\mathrm { B i n } ( k - 1 , 1 / e ^ { \epsilon _ { 0 } } )$ . This allows us to write the distribution of $\mathcal { M } _ { s h }$ when clients map their data points according to $\pmb { p } _ { 1 } , \ldots , \pmb { p } _ { k } , \pmb { p } _ { k } ^ { \prime } , \pmb { p } _ { k } ^ { \prime \prime }$ as a convex combination of the distribution of $\mathcal { M }$ when clients map their data points according to $\tilde { { p } } _ { 1 } , \ldots , { p } _ { k - 1 } , { p } _ { k } , { p } _ { k } ^ { \prime } , { p } _ { k } ^ { \prime \prime }$ ; see Lemma $\boxed { 4 }$ Then using a joint convexity argument (see Lemma $\textcircled { 3 }$ , we write the ternary divergence between the original triple of distributions of $\mathcal { M } _ { s h }$ in terms of the same convex combination of the ternary divergence between the resulting triples of distributions of $\mathcal { M } _ { s h }$ as in Lemma $\bigstar$ Using a monotonicity argument (see Lemma 5), we can remove the effect of clients that do not sample from the distribution $p _ { k } ^ { \prime \prime }$ without decreasing the ternary divergence. By this chain of arguments, we have reduced the problem to the one involving the computation of ternary divergence only for the special form of neighboring datasets (as in Theorem 6), which proves Theorem $\bigtriangledown$ See Appendix C.1 for a complete proof.
|
| 252 |
+
|
| 253 |
+
Proof sketch of Theorem $6 .$ Consider $( \mathcal { D } _ { m } ^ { \prime \prime } , \mathcal { D } _ { m } ^ { \prime } , \mathcal { D } _ { m } ) \in \mathcal { D } _ { \mathrm { s a m e } } ^ { m }$ as in the statement of Theorem First we observe that for any $\alpha \geq 1$ and any three distributions $p , q , r$ over the same domain, we can write $\begin{array} { r } { \mathbb { E } _ { r } \left[ \left| \frac { p - q } { r } \right| ^ { \alpha } \right] \leq 2 ^ { \alpha - 1 } \left( \mathbb { E } _ { r } \left[ \left| \frac { p } { r } - 1 \right| ^ { \alpha } \right] + \mathbb { E } _ { r } \left[ \left| \frac { q } { r } - 1 \right| ^ { \alpha } \right] \right) } \end{array}$ . This is a straight-forward application of the standard inequality $| x + y | ^ { \alpha } \leq 2 ^ { \alpha - 1 } ( | x | ^ { \alpha } + | y | ^ { \alpha } )$ which holds for all $x , y \in \mathbb { R }$ and $\alpha \geq 1$ . Now, by taking $p = \mathcal { M } _ { s h } ( \mathcal { D } _ { m } ^ { \prime } )$ , $q = \mathcal { M } _ { s h } ( \mathcal { D } _ { m } ^ { \prime \prime } )$ , and $r = \mathcal { M } _ { s h } ( \mathcal { D } _ { m } )$ , we reduce the problem of computing the ternary $| \chi | ^ { \alpha } .$ -divergence (which we need to bound) to the problem of computing the Pearson-Vajda divergence $| | \overline { { 4 3 } } | |$ , which we can write in terms of the $\alpha$ -th absolute moment of the r.v. $X : \mathcal { A } _ { B } ^ { m } \mathbb { R }$ , defined as $\begin{array} { r } { X ( \pmb { h } ) : = \big ( \frac { \mathcal { M } _ { s h } ( \mathcal { D } ^ { \prime } ) ( \pmb { h } ) } { \mathcal { M } _ { s h } ( \mathcal { D } _ { m } ) ( \pmb { h } ) } - 1 \big ) } \end{array}$ for all $\pmb { h } \in \mathcal { A } _ { B } ^ { m }$ (where $\mathcal { D } ^ { \prime } \in \{ \mathcal { D } _ { m } ^ { \prime } , \mathcal { D } _ { m } ^ { \prime \prime } \} )$ and distributed according to $X ( \pmb { h } ) \sim \mathcal { M } _ { s h } ( \mathcal { D } _ { m } ) ( \pmb { h } )$ . In $\mathbb { E 9 }$ , the authors have bounded the absolute moments of the r.v. $X ( h )$ by showing that $X ( h )$ is sub-Gaussian r.v. and using standard concentration results. See Appendix C.3 for a complete proof.
|
| 254 |
+
|
| 255 |
+
# 7 Discussion
|
| 256 |
+
|
| 257 |
+
In this paper, we analyzed the Rényi differential privacy of the subsampled shuffle model by bounding the ternary $| \chi | ^ { \alpha }$ -DP of the shuffle model. We numerically demonstrated the importance of our proposed bound, where we obtain a significant improvement over using the state-of-the-art in practical regimes. Furthermore, we used our privacy analysis to study the privacy-accuracy trade-offs on the MNIST dataset, where we obtained $9 0 \%$ accuracy with total privacy budget of $\epsilon = 2 . 9 1$ , which is an improvement over an analysis yielding 4.82, using standard strong composition theorem.
|
| 258 |
+
|
| 259 |
+
Closing the gap (shown numerically) between our lower bound in Theorem $\bigstar$ and the achievable upper bound in Theorem $\triangledown$ is an important unresolved question. Another direction to explore would be to analyze the RDP of the subsampled shuffle model for different sub-sampling techniques such as Poisson subsampling $\underline { { \mathbb { G 5 } } } ] |$ , random check-in $\textcircled { 9 }$ , or client self-sampling $| \overline { { 3 0 } } \|$ .
|
| 260 |
+
|
| 261 |
+
Societal Impact. Collaborative learning comes with significant societal risks of privacy violations, which is the main topic addressed in this paper. However, such learning is only as good as the data used for training, and if the data is not unbiased, this could lead to significant issues related to fairness and could also lead to societally undesirable outcomes. Such an issue is exacerbated when privacy is guaranteed on the data used for training, making a-priori fairness checks on data infeasible. This can be ameliorated by properly testing models finally obtained against fairness criteria and rejecting models that fail the test. This paper did not consider the issue of robustness to security, and this could also be an important societal issue in collaborative learning, where a small subset of users could insert malicious inputs to disrupt the learning process or worse bias the learned model covertly. This could also lead to negative outcomes. This issue of robustness to malicious participants has been studied in several papers, and incorporating this into the framework of the paper is an important future research topic.
|
| 262 |
+
|
| 263 |
+
# Acknowledgment
|
| 264 |
+
|
| 265 |
+
This work was supported in part by NSF grants #2007714 and #1955632 and a Google Faculty research award and an Amazon Research Award.
|
| 266 |
+
|
| 267 |
+
# References
|
| 268 |
+
|
| 269 |
+
[1] M. Abadi, A. Chu, I. Goodfellow, H. B. McMahan, I. Mironov, K. Talwar, and L. Zhang. Deep learning with differential privacy. In Proceedings of the 2016 ACM SIGSAC conference on computer and communications security, pages 308–318, 2016.
|
| 270 |
+
[2] N. Agarwal, A. T. Suresh, F. X. X. Yu, S. Kumar, and B. McMahan. cpsgd: Communicationefficient and differentially-private distributed sgd. In Advances in Neural Information Processing Systems, pages 7564–7575, 2018.
|
| 271 |
+
[3] S. Asoodeh, J. Liao, F. P. Calmon, O. Kosut, and L. Sankar. Three variants of differential privacy: Lossless conversion and applications. IEEE Journal on Selected Areas in Information Theory, 2(1):208–222, 2021.
|
| 272 |
+
[4] B. Balle, G. Barthe, M. Gaboardi, J. Hsu, and T. Sato. Hypothesis testing interpretations and renyi differential privacy. In S. Chiappa and R. Calandra, editors, International Conference on Artificial Intelligence and Statistics (AISTATS), volume 108 of Proceedings of Machine Learning Research, pages 2496–2506. PMLR, 2020.
|
| 273 |
+
[5] B. Balle, J. Bell, A. Gascon, and K. Nissim. Differentially private summation with multimessage shuffling. arXiv preprint arXiv:1906.09116, 2019.
|
| 274 |
+
[6] B. Balle, J. Bell, A. Gascón, and K. Nissim. Improved summation from shuffling. arXiv preprint arXiv:1909.11225, 2019.
|
| 275 |
+
[7] B. Balle, J. Bell, A. Gascón, and K. Nissim. The privacy blanket of the shuffle model. In Annual International Cryptology Conference, pages 638–667. Springer, 2019.
|
| 276 |
+
[8] B. Balle, J. Bell, A. Gascón, and K. Nissim. Private summation in the multi-message shuffle model. In Proceedings of the 2020 ACM SIGSAC Conference on Computer and Communications Security, pages 657–676, 2020.
|
| 277 |
+
[9] B. Balle, P. Kairouz, B. McMahan, O. D. Thakkar, and A. Thakurta. Privacy amplification via random check-ins. In H. Larochelle, M. Ranzato, R. Hadsell, M. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020.
|
| 278 |
+
[10] R. Bassily, A. Smith, and A. Thakurta. Private empirical risk minimization: Efficient algorithms and tight error bounds. In 2014 IEEE 55th Annual Symposium on Foundations of Computer Science, pages 464–473. IEEE, 2014.
|
| 279 |
+
[11] A. Bhowmick, J. Duchi, J. Freudiger, G. Kapoor, and R. Rogers. Protection against reconstruction and its applications in private federated learning. arXiv preprint arXiv:1812.00984, 2018.
|
| 280 |
+
[12] L. Bottou. Large-scale machine learning with stochastic gradient descent. In Proceedings of COMPSTAT’2010, pages 177–186. Springer, 2010.
|
| 281 |
+
[13] C. L. Canonne, G. Kamath, and T. Steinke. The discrete gaussian for differential privacy. In H. Larochelle, M. Ranzato, R. Hadsell, M. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020.
|
| 282 |
+
[14] K. Chaudhuri, C. Monteleoni, and A. D. Sarwate. Differentially private empirical risk minimization. Journal of Machine Learning Research, 12(3), 2011.
|
| 283 |
+
[15] A. Cheu, A. D. Smith, J. Ullman, D. Zeber, and M. Zhilyaev. Distributed differential privacy via shuffling. In Advances in Cryptology - EUROCRYPT 2019, volume 11476, pages 375–403. Springer, 2019.
|
| 284 |
+
[16] B. Ding, J. Kulkarni, and S. Yekhanin. Collecting telemetry data privately. In Proceedings of the 31st International Conference on Neural Information Processing Systems, NIPS’17, page 3574–3583, Red Hook, NY, USA, 2017. Curran Associates Inc.
|
| 285 |
+
[17] J. C. Duchi, M. I. Jordan, and M. J. Wainwright. Local privacy and statistical minimax rates. In 2013 IEEE 54th Annual Symposium on Foundations of Computer Science, pages 429–438. IEEE, 2013.
|
| 286 |
+
[18] C. Dwork, F. McSherry, K. Nissim, and A. D. Smith. Calibrating noise to sensitivity in private data analysis. In Theory of Cryptography Conference (TCC), pages 265–284, 2006.
|
| 287 |
+
[19] C. Dwork and A. Roth. The algorithmic foundations of differential privacy. Foundations and Trends in Theoretical Computer Science, 9(3-4):211–407, 2014.
|
| 288 |
+
[20] C. Dwork, G. N. Rothblum, and S. Vadhan. Boosting and differential privacy. In 2010 IEEE 51st Annual Symposium on Foundations of Computer Science, pages 51–60. IEEE, 2010.
|
| 289 |
+
[21] Ú. Erlingsson, V. Feldman, I. Mironov, A. Raghunathan, S. Song, K. Talwar, and A. Thakurta. Encode, shuffle, analyze privacy revisited: Formalizations and empirical evaluation. CoRR, abs/2001.03618, 2020.
|
| 290 |
+
[22] Ú. Erlingsson, V. Feldman, I. Mironov, A. Raghunathan, K. Talwar, and A. Thakurta. Amplification by shuffling: From local to central differential privacy via anonymity. In Proceedings of the Thirtieth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 2468–2479. SIAM, 2019.
|
| 291 |
+
[23] Ú. Erlingsson, V. Pihur, and A. Korolova. Rappor: Randomized aggregatable privacy-preserving ordinal response. In Proceedings of the 2014 ACM SIGSAC conference on computer and communications security, pages 1054–1067, 2014.
|
| 292 |
+
[24] V. Feldman, A. McMillan, and K. Talwar. Hiding among the clones: A simple and nearly optimal analysis of privacy amplification by shuffling. In 2021 IEEE 62nd Annual Symposium on Foundations of Computer Science. IEEE, 2021.
|
| 293 |
+
[25] B. Ghazi, N. Golowich, R. Kumar, R. Pagh, and A. Velingker. On the power of multiple anonymous messages. IACR Cryptol. ePrint Arch., 2019:1382, 2019.
|
| 294 |
+
[26] B. Ghazi, R. Pagh, and A. Velingker. Scalable and differentially private distributed aggregation in the shuffled model. arXiv preprint arXiv:1906.08320, 2019.
|
| 295 |
+
[27] A. Girgis, D. Data, S. Diggavi, P. Kairouz, and A. Theertha Suresh. Shuffled model of differential privacy in federated learning. In A. Banerjee and K. Fukumizu, editors, Proceedings of The 24th International Conference on Artificial Intelligence and Statistics, volume 130 of Proceedings of Machine Learning Research, pages 2521–2529. PMLR, 13–15 Apr 2021.
|
| 296 |
+
[28] A. M. Girgis, D. Data, S. Diggavi, P. Kairouz, and A. T. Suresh. Shuffled model of federated learning: Privacy, accuracy and communication trade-offs. IEEE Journal on Selected Areas in Information Theory, 2(1):464–478, 2021.
|
| 297 |
+
[29] A. M. Girgis, D. Data, S. Diggavi, A. T. Suresh, and P. Kairouz. On the renyi differential privacy of the shuffle model. In Proceedings of the 2021 ACM SIGSAC conference on computer and communications security. ACM, 2021.
|
| 298 |
+
[30] A. M. Girgis, D. Data, and S. N. Diggavi. Differentially private federated learning with shuffling and client self-sampling. In IEEE International Symposium on Information Theory, ISIT 2021, Melbourne, Australia, July 12-20, 2021, pages 338–343. IEEE, 2021.
|
| 299 |
+
[31] A. Greenberg. Apple’s ‘differential privacy’is about collecting your data—but not your data. Wired, June, 13, 2016.
|
| 300 |
+
[32] P. Kairouz, K. Bonawitz, and D. Ramage. Discrete distribution estimation under local privacy. In International Conference on Machine Learning, ICML, pages 2436–2444, 2016.
|
| 301 |
+
[33] P. Kairouz, H. B. McMahan, B. Avent, A. Bellet, M. Bennis, A. N. Bhagoji, K. Bonawitz, Z. Charles, G. Cormode, R. Cummings, et al. Advances and open problems in federated learning. arXiv preprint arXiv:1912.04977, 2019.
|
| 302 |
+
[34] P. Kairouz, S. Oh, and P. Viswanath. The composition theorem for differential privacy. In International conference on machine learning, pages 1376–1385. PMLR, 2015.
|
| 303 |
+
[35] S. P. Kasiviswanathan, H. K. Lee, K. Nissim, S. Raskhodnikova, and A. Smith. What can we learn privately? SIAM Journal on Computing, 40(3):793–826, 2011.
|
| 304 |
+
[36] J. Konecnˇ ý, H. B. McMahan, F. X. Yu, P. Richtarik, A. T. Suresh, and D. Bacon. Federated learning: Strategies for improving communication efficiency. In NIPS Workshop on Private Multi-Party Machine Learning, 2016.
|
| 305 |
+
[37] I. Mironov. Rényi differential privacy. In 2017 IEEE 30th Computer Security Foundations Symposium (CSF), pages 263–275. IEEE, 2017.
|
| 306 |
+
[38] I. Mironov, K. Talwar, and L. Zhang. R\’enyi differential privacy of the sampled gaussian mechanism. arXiv preprint arXiv:1908.10530, 2019.
|
| 307 |
+
[39] N. Papernot, A. Thakurta, S. Song, S. Chien, and Ú. Erlingsson. Tempered sigmoid activations for deep learning with differential privacy. arXiv preprint arXiv:2007.14191, 2020.
|
| 308 |
+
[40] S. Shalev-Shwartz et al. Online learning and online convex optimization. Foundations and Trends® in Machine Learning, 4(2):107–194, 2012.
|
| 309 |
+
[41] O. Shamir and T. Zhang. Stochastic gradient descent for non-smooth optimization: Convergence results and optimal averaging schemes. In International conference on machine learning, pages 71–79, 2013.
|
| 310 |
+
[42] J. Ullman. Cs7880. rigorous approaches to data privacy. 2017.
|
| 311 |
+
[43] Y.-X. Wang, B. Balle, and S. P. Kasiviswanathan. Subsampled rényi differential privacy and analytical moments accountant. In The 22nd International Conference on Artificial Intelligence and Statistics, pages 1226–1235. PMLR, 2019.
|
| 312 |
+
[44] Q. Yang, Y. Liu, T. Chen, and Y. Tong. Federated machine learning: Concept and applications. ACM Transactions on Intelligent Systems and Technology (TIST), 10(2):1–19, 2019.
|
| 313 |
+
[45] Y. Zhu and Y.-X. Wang. Poission subsampled rényi differential privacy. In International Conference on Machine Learning, pages 7634–7642. PMLR, 2019.
|
md/train/Syl7OsRqY7/Syl7OsRqY7.md
ADDED
|
@@ -0,0 +1,570 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# COARSE-GRAIN FINE-GRAIN COATTENTION NETWORK FOR MULTI-EVIDENCE QUESTION ANSWERING
|
| 2 |
+
|
| 3 |
+
Victor Zhong1, Caiming Xiong2, Nitish Shirish Keskar2, and Richard Socher2
|
| 4 |
+
|
| 5 |
+
1Paul G. Allen School of Computer Science & Engineering, University of Washington, Seattle, WA vzhong@cs.washington.edu 2Salesforce Research, Palo Alto, CA {cxiong, nkeskar, rsocher}@salesforce.com
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
End-to-end neural models have made significant progress in question answering, however recent studies show that these models implicitly assume that the answer and evidence appear close together in a single document. In this work, we propose the Coarse-grain Fine-grain Coattention Network (CFC), a new question answering model that combines information from evidence across multiple documents. The CFC consists of a coarse-grain module that interprets documents with respect to the query then finds a relevant answer, and a fine-grain module which scores each candidate answer by comparing its occurrences across all of the documents with the query. We design these modules using hierarchies of coattention and selfattention, which learn to emphasize different parts of the input. On the Qangaroo WikiHop multi-evidence question answering task, the CFC obtains a new stateof-the-art result of $7 0 . 6 \%$ on the blind test set, outperforming the previous best by $3 \%$ accuracy despite not using pretrained contextual encoders.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
A requirement of scalable and practical question answering (QA) systems is the ability to reason over multiple documents and combine their information to answer questions. Although existing datasets enabled the development of effective end-to-end neural question answering systems, they tend to focus on reasoning over localized sections of a single document (Hermann et al., 2015; Rajpurkar et al., 2016; 2018; Trischler et al., 2017). For example, Min et al. (2018) find that $90 \%$ of the questions in the Stanford Question Answering Dataset are answerable given 1 sentence in a document. In this work, we instead focus on multi-evidence QA, in which answering the question requires aggregating evidence from multiple documents (Welbl et al., 2018; Joshi et al., 2017).
|
| 14 |
+
|
| 15 |
+
Our multi-evidence QA model, the Coarse-grain Fine-grain Coattention Network (CFC), selects among a set of candidate answers given a set of support documents and a query. The CFC is inspired by coarse-grain reasoning and fine-grain reasoning. In coarse-grain reasoning, the model builds a coarse summary of support documents conditioned on the query without knowing what candidates are available, then scores each candidate. In fine-grain reasoning, the model matches specific finegrain contexts in which the candidate is mentioned with the query in order to gauge the relevance of the candidate. These two strategies of reasoning are respectively modeled by the coarse-grain and fine-grain modules of the CFC. Each module employs a novel hierarchical attention — a hierarchy of coattention and self-attention — to combine information from the support documents conditioned on the query and candidates. Figure 1 illustrates the architecture of the CFC.
|
| 16 |
+
|
| 17 |
+
The CFC achieves a new state-of-the-art result on the blind Qangaroo WikiHop test set of $7 0 . 6 \%$ accuracy, beating previous best by $3 \%$ accuracy despite not using pretrained contextual encoders. In addition, on the TriviaQA multi-paragraph question answering task (Joshi et al., 2017), reranking outputs from a traditional span extraction model (Clark & Gardner, 2018) using the CFC improves exact match accuracy by $3 . 1 \%$ and F1 by $3 . 0 \%$ .
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: The Coarse-grain Fine-grain Coattention Network.
|
| 21 |
+
|
| 22 |
+
Our analysis shows that components in the attention hierarchies of the coarse and fine-grain modules learn to focus on distinct parts of the input. This enables the CFC to more effectively represent a large collection of long documents. Finally, we outline common types of errors produced by CFC, caused by difficulty in aggregating large quantity of references, noise in distant supervision, and difficult relation types.
|
| 23 |
+
|
| 24 |
+
# 2 COARSE-GRAIN FINE-GRAIN COATTENTION NETWORK
|
| 25 |
+
|
| 26 |
+
The coarse-grain module and fine-grain module of the CFC correspond to coarse-grain reasoning and fine-grain reasoning strategies. The coarse-grain module summarizes support documents without knowing the candidates: it builds codependent representations of support documents and the query using coattention, then produces a coarse-grain summary using self-attention. In contrast, the fine-grain module retrieves specific contexts in which each candidate occurs: it identifies coreferent mentions of the candidate, then uses coattention to build codependent representations between these mentions and the query. While low-level encodings of the inputs are shared between modules, we show that this division of labour allows the attention hierarchies in each module to focus on different parts of the input. This enables the model to more effectively represent a large number of potentially long support documents.
|
| 27 |
+
|
| 28 |
+
Suppose we are given a query, a set of $N _ { s }$ support documents, and a set of $N _ { c }$ candidates. Without loss of generality, let us consider the ith document and the $j$ th candidate. Let $L _ { q } \in \mathbb { R } ^ { T _ { q } \times d _ { \mathrm { e m b } } }$ , $L _ { s } \in \mathbb { R } ^ { T _ { s } \times d _ { \mathrm { e m b } } }$ , and $L _ { c } \in \mathbb { R } ^ { T _ { c } \times d _ { \mathrm { e m b } } }$ respectively denote the word embeddings of the query, the ith support document, and the $j$ th candidate answer. Here, $T _ { q }$ , $T _ { s }$ , and $T _ { c }$ are the number of words in the corresponding sequence. $d _ { \mathrm { e m b } }$ is the size of the word embedding. We begin by encoding each sequence using a bidirectional Gated Recurrent Units (GRUs) (Cho et al., 2014).
|
| 29 |
+
|
| 30 |
+

|
| 31 |
+
Figure 2: Coarse-grain module.
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
\begin{array} { r c l } { E _ { q } } & { = } & { \mathrm { B i G R U } \left( \operatorname { t a n h } ( W _ { q } L _ { q } + b _ { q } ) \right) \in \mathbb R ^ { T _ { q } \times d _ { \mathrm { h i d } } } } \\ { E _ { s } } & { = } & { \mathrm { B i G R U } \left( L _ { s } \right) \in \mathbb R ^ { T _ { s } \times d _ { \mathrm { h i d } } } } \\ { E _ { c } } & { = } & { \mathrm { B i G R U } \left( L _ { c } \right) \in \mathbb R ^ { T _ { c } \times d _ { \mathrm { h i d } } } } \end{array}
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
Here, $E _ { q } , E _ { s }$ , and $E _ { c }$ are the encodings of the query, support, and candidate. $W _ { q }$ and $b _ { q }$ are parameters of a query projection layer. $d _ { \mathrm { h i d } }$ is the size of the bidirectional GRU.
|
| 38 |
+
|
| 39 |
+
# 2.1 COARSE-GRAIN MODULE
|
| 40 |
+
|
| 41 |
+
The coarse-grain module of the CFC, shown in Figure 2, builds codependent representations of support documents $E _ { s }$ and the query $E _ { q }$ using coattention, and then summarizes the coattention context using self-attention to compare it to the candidate $E _ { c }$ . Coattention and similar techniques are crucial to single-document question answering models (Xiong et al., 2017; Wang & Jiang, 2017; Seo et al., 2017). We start by computing the affinity matrix between the document and the query as
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
A = E _ { s } ( E _ { q } ) ^ { \intercal } \in \mathbb { R } ^ { T _ { s } \times T _ { q } }
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
The support summary vectors and query summary vectors are defined as
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\begin{array} { r c l } { S _ { s } } & { = } & { \mathrm { s o f t m a x } \left( A \right) E _ { q } \in \mathbb { R } ^ { T _ { s } \times d _ { \mathrm { h i d } } } } \\ { S _ { q } } & { = } & { \mathrm { s o f t m a x } \left( A ^ { \top } \right) E _ { s } \in \mathbb { R } ^ { T _ { q } \times d _ { \mathrm { h i d } } } } \end{array}
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
where softmax $( X )$ normalizes $X$ column-wise. We obtain the document context as
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\begin{array} { r l r } { C _ { s } } & { = } & { \mathrm { B i G R U } \left( S _ { q } \operatorname { s o f t m a x } \left( A \right) \right) \in \mathbb { R } ^ { T _ { s } \times d _ { \mathrm { h i d } } } } \end{array}
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
The coattention context is then the feature-wise concatenation of the document context $C _ { s }$ and the document summary vector $S _ { s }$ .
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\begin{array} { r l r } { U _ { s } } & { { } = } & { \left[ C _ { s } ; S _ { s } \right] \in \mathbb { R } ^ { T _ { s } \times 2 d _ { \mathrm { h i d } } } } \end{array}
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
For ease of exposition, we abbreviate coattention, which takes as input a document encoding $E _ { s }$ and a query encoding $E _ { q }$ and produces the coattention context $U _ { s }$ , as
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\mathrm { C o a t t n } ( E _ { s } , E _ { q } ) U _ { s }
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
Next, we summarize the coattention context — a codependent encoding of the supporting document and the query — using hierarchical self-attention. First, we use self-attention to create a fixedlength summary vector of the coattention context. We compute a score for each position of the
|
| 72 |
+
|
| 73 |
+

|
| 74 |
+
Figure 3: The fine-grain module of the CFC.
|
| 75 |
+
|
| 76 |
+
coattention context using a two-layer multi-layer perceptron (MLP). This score is normalized and used to compute a weighted sum over the coattention context.
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\begin{array} { r c l } { \displaystyle a _ { s i } } & { = } & { \operatorname { t a n h } \left( W _ { 2 } \operatorname { t a n h } \left( W _ { 1 } U _ { s i } + b _ { 1 } \right) + b _ { 2 } \right) \in \mathbb { R } } \\ { \widehat { a } _ { s } } & { = } & { \operatorname { s o f t m a x } ( a _ { s } ) } \\ { \displaystyle G _ { s } } & { = } & { \displaystyle \sum _ { i } ^ { T _ { s } } \widehat { a } _ { s i } U _ { s i } \in \mathbb { R } ^ { 2 d _ { \mathrm { h i d } } } } \end{array}
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
Here, $a _ { s i }$ and $\hat { a } _ { s i }$ are respectively the unnormalized and normalized score for the ith position of the coattention context. $W _ { 2 } , b _ { 2 }$ , $W _ { 1 }$ , and $b _ { 1 }$ are parameters for the MLP scorer. $U _ { s i }$ is the ith position of the coattention context. We abbreviate self-attention, which takes as input a sequence $U _ { s }$ and produces the summary conditioned on the query $G _ { s }$ , as
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\mathrm { S e l f a t t n } ( U _ { s } ) G _ { s }
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
Recall that $G _ { s }$ provides the summary of the ith of $N _ { s }$ support documents. We apply another selfattention layer to compute a fixed-length summary vector of all support documents. This summary is then multiplied with the summary of the candidate answer to produce the coarse-grain score. Let $G \in \mathbb { R } ^ { N _ { s } \times 2 \bar { d } _ { \mathrm { h i d } } }$ represent the sequence of summaries for all support documents. We have
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\begin{array} { r c l } { G _ { c } } & { = } & { \mathrm { S e l f a t t n } \left( E _ { c } \right) \in \mathbb { R } ^ { d _ { \mathrm { h i d } } } } \\ { G ^ { \prime } } & { = } & { \mathrm { S e l f a t t n } \left( G \right) \in \mathbb { R } ^ { 2 d _ { \mathrm { h i d } } } } \\ { y _ { \mathrm { c o a r s e } } } & { = } & { \operatorname { t a n h } \left( W _ { \mathrm { c o a r s e } } G ^ { \prime } + b _ { \mathrm { c o a r s e } } \right) G _ { c } \in \mathbb { R } } \end{array}
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
where $E _ { c }$ and $G _ { c }$ are respectively the encoding and the self-attention summary of the candidate. $G ^ { \prime }$ is the fixed-length summary vector of all support documents. $W _ { \mathrm { c o a r s e } }$ and $b _ { \mathrm { c o a r s e } }$ are parameters of a projection layer that reduces the support documents summary from $\mathbb { R } ^ { 2 d _ { \mathrm { h i d } } }$ to $\mathbb { R } ^ { d _ { \mathrm { h i d } } }$ .
|
| 95 |
+
|
| 96 |
+
# 2.2 CANDIDATE-DEPENDENT FINE-GRAIN MODULE
|
| 97 |
+
|
| 98 |
+
In contrast to the coarse-grain module, the fine-grain module, shown in Figure 3, finds the specific context in which the candidate occurs in the supporting documents using coreference resolution 1. Each mention is then summarized using a self-attention layer to form a mention representation. We then compute the coattention between the mention representations and the query. This coattention context, which is a codependent encoding of the mentions and the query, is again summarized via self-attention to produce a fine-grain summary to score the candidate.
|
| 99 |
+
|
| 100 |
+
Let us assume that there are $m$ mentions of the candidate in the ith support document. Let the kth mention corresponds to the $i _ { \mathrm { s t a r t } }$ to $i _ { \mathrm { e n d } }$ tokens in the support document. We represent this mention using self-attention over the span of the support document encoding that corresponds to the mention.
|
| 101 |
+
|
| 102 |
+

|
| 103 |
+
Figure 4: An example from the Qangaroo WikiHop QA task. The relevant multiple pieces of evidence required to answer the question is shown in red. The correct answer is shown in blue.
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
M _ { k } = \mathrm { S e l f a t t n } \left( E _ { s } [ i _ { \mathrm { s t a r t } } : i _ { \mathrm { e n d } } ] \right) \in \mathbb { R } ^ { d _ { \mathrm { h i d } } }
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
Suppose that there are $N _ { m }$ mentions of the candidate in total. We extract each mention representation using self-attention to produce a sequence of mention representations $M \in \mathbb { R } ^ { N _ { m } \times d _ { \mathrm { h i d } } }$ . The coattention context and summary of these mentions $M$ with respect to the query $E _ { q }$ are
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\begin{array} { r c l } { U _ { m } } & { = } & { \mathrm { C o a t t n } \left( M , E _ { q } \right) \in \mathbb { R } ^ { N _ { m } \times 2 d _ { \mathrm { h i d } } } } \\ { G _ { m } } & { = } & { \mathrm { S e l f a t t n } \left( U _ { m } \right) \in \mathbb { R } ^ { 2 d _ { \mathrm { h i d } } } } \end{array}
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
We use a linear layer to determine the fine-grain score of the candidate
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
y _ { \mathrm { f i n e } } = W _ { \mathrm { f i n e } } G _ { m } + b _ { \mathrm { f i n e } } \in \mathbb { R }
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
# 2.3 SCORE AGGREGATION
|
| 122 |
+
|
| 123 |
+
We take the sum of the coarse-grain score and the fine-grain score, $y = y _ { \mathrm { c o a r s e } } + y _ { \mathrm { f i n e } }$ , as the score for the candidate. Recall that our earlier presentation is with respect to the $j$ th out of $N _ { c }$ candidates. We combine each candidate score to form the final score vector $Y \in \mathbb { R } ^ { \bar { N } _ { c } }$ . The model is trained using cross-entropy loss.
|
| 124 |
+
|
| 125 |
+
# 3 EXPERIMENTS
|
| 126 |
+
|
| 127 |
+
We evaluate the CFC on two tasks to evaluate its effectiveness. The first task is multi-evidence question answering on the unmasked and masked version of the WikiHop dataset (Welbl et al., 2018). The second task is the multi-paragraph extractive question answering task TriviaQA, which we frame as a span reranking task (Joshi et al., 2017). On the former, the CFC achieves a new stateof-the-art result. On the latter, reranking the outputs of a span-extraction model (Clark & Gardner, 2018) using the CFC results in significant performance improvement.
|
| 128 |
+
|
| 129 |
+
# 3.1 MULTI-EVIDENCE QUESTION ANSWERING ON WIKIHOP
|
| 130 |
+
|
| 131 |
+
Welbl et al. (2018) proposed the Qangaroo WikiHop task to facilitate the study of multi-evidence question answering. This dataset is constructed by linking entities in a document corpus (Wikipedia) with a knowledge base (Wikidata). This produces a bipartite graph of documents and entities, an edge in which marks the occurrence of an entity in a document. A knowledge base fact triplet consequently corresponds to a path from the subject to the object in the resulting graph. The documents along this path compose the support documents for the fact triplet. The Qangaroo WikiHop task, shown in Figure 4, is as follows: given a query, that is, the subject and relation of a fact triplet, a set
|
| 132 |
+
|
| 133 |
+
<table><tr><td>Model</td><td>Masked Dev</td><td>Dev</td><td>Test</td></tr><tr><td>CFC (ours)</td><td>72.1%</td><td>66.4%</td><td>70.6%</td></tr><tr><td>Enitity-GCN (Cao et al., 2018)</td><td>70.5%</td><td>64.8%</td><td>67.6%</td></tr><tr><td>MHQA-GRN (Song et al., 2018)</td><td></td><td>62.8%</td><td>65.4%</td></tr><tr><td>Jenga (Facebook AI Research*, 2018)</td><td></td><td></td><td>65.3%</td></tr><tr><td>Vanilla Coattention Model (NTU*,2018)</td><td></td><td></td><td>59.9%</td></tr><tr><td>Coref GRU (Dhingra et al., 2018)</td><td></td><td>56.0%</td><td>59.3%</td></tr><tr><td>BiDAF Baseline (Welbl et al.,2018)</td><td>54.5%</td><td></td><td>42.9%</td></tr></table>
|
| 134 |
+
|
| 135 |
+
Table 1: Model accuracy on the WikiHop leaderboard at the time of submission on September 14, 2018. Missing entries indicate that the published entry did not include the corresponding score. \* indicates that the work has not been published.
|
| 136 |
+
|
| 137 |
+

|
| 138 |
+
Figure 5: WikiHop dev errors across query lengths, support documents lengths, number of support documents, and number of candidates for the coarse-grain-only and fine-grain-only models.
|
| 139 |
+
|
| 140 |
+
of plausible candidate objects, and the corresponding support documents for the candidates, select the correct candidate as the answer.
|
| 141 |
+
|
| 142 |
+
The unmasked version of WikiHop represents candidate answers with original text while the masked version replaces them with randomly sampled placeholders in order to remove correlation between frequent answers and support documents. Official blind, held-out test evaluation is performed using the unmasked version. We tokenize the data using Stanford CoreNLP (Manning et al., 2014). We use fixed GloVe embeddings (Pennington et al., 2014) as well as character ngram embeddings (Hashimoto et al., 2017). We split symbolic query relations into words. All models are trained using ADAM (Kingma & Ba, 2015). We list detailed experiment setup and hyperparemeters of the best-performing model in A.2 of the Appendix.
|
| 143 |
+
|
| 144 |
+
We compare the performance of the CFC to other models on the WikiHop leaderboard in Table 1. The CFC achieves state-of-the-art results on both the masked and unmasked versions of WikiHop. In particular, on the blind, held-out WikiHop test set, the CFC achieves a new best accuracy of $7 0 . 6 \%$ . The previous state-of-the-art result by Cao et al. (2018) uses pretrained contextual encoders, which has led to consistent improvements across NLP tasks (Peters et al., 2018). We outperform this result by $3 \%$ despite not using pretrained contextual encoders 2. In addition, we show that the division of labour between the coarse-grain module and the fine-grain module allows the attention hierarchies of each module to focus on different parts of the input. This enables the CFC to more effectively model the large collection of potentially long documents found in WikiHop.
|
| 145 |
+
|
| 146 |
+
# 3.2 RERANKING EXTRACTIVE QUESTION ANSWERING ON TRIVIAQA
|
| 147 |
+
|
| 148 |
+
To further study the effectiveness of our model, we also experiment on TriviaQA (Joshi et al., 2017), another large-scale question answering dataset that requires aggregating evidence from multiple sentences. Similar to Hu et al. (2018b); Wang et al. (2018), we decompose the original TriviaQA task into two subtasks: proposing plausible candidate answers and reranking candidate answers.
|
| 149 |
+
|
| 150 |
+
Table 2: Answer reranking results on the dev split of TriviaQA Wikipedia. We use the ${ \mathrm { B i D A F } } { + } { + }$ model with the merge method of span scoring by Clark & Gardner (2018) to propose candidate answers, which are subsequently reranked using the CFC. “Answerable” indicates that the candidate answers proposed contains at least one correct answer. “Unanswerable” indicates that none of the candidate answers proposed are correct.
|
| 151 |
+
|
| 152 |
+
<table><tr><td rowspan="2">Answerable</td><td rowspan="2">% of data</td><td colspan="2">Before reranking</td><td colspan="2">After reranking</td></tr><tr><td>EM</td><td>F1</td><td>EM</td><td>F1</td></tr><tr><td>Answerable</td><td>86.8%</td><td>59.8%</td><td>64.5%</td><td>63.2%</td><td>67.8%</td></tr><tr><td>Unanswerable</td><td>13.2%</td><td>17.5%</td><td>22.2%</td><td>17.9%</td><td>22.9%</td></tr><tr><td>Total</td><td>100%</td><td>54.0%</td><td>58.7%</td><td>57.1%</td><td>61.7%</td></tr></table>
|
| 153 |
+
|
| 154 |
+
We address the first subtask using ${ \mathrm { B i D A F } } { + } { + }$ , a competitive span extraction question answering model by Clark & Gardner (2018) and the second subtask using the CFC. To compute the candidate list for reranking, we obtain the top 50 answer candidates from ${ \mathrm { B i D A F } } { + } { + }$ . During training, we use the answer candidate that gives the maximum F1 as the gold label for training the CFC.
|
| 155 |
+
|
| 156 |
+
Our experimental results in Table 2 show that reranking using the CFC provides consistent performance gains over only using the span extraction question answering model. In particular, reranking using the CFC improves performance regardless of whether the candidate answer set obtained from the span extraction model contains correct answers. On the whole TriviaQA dev set, reranking using the CFC results in a gain of $3 . 1 \%$ EM and $3 . 0 \%$ F1, which suggests that the CFC can be used to further refine the outputs produced by span extraction question answering models.
|
| 157 |
+
|
| 158 |
+
<table><tr><td>Model</td><td>Dev</td><td>△ Dev</td></tr><tr><td>CFC</td><td>66.4%</td><td></td></tr><tr><td>-coarse</td><td>61.9%</td><td>-4.5%</td></tr><tr><td>-fine</td><td>63.6%</td><td>-2.8%</td></tr><tr><td>-selfattn</td><td>64.8%</td><td>-1.6%</td></tr><tr><td>-bidir</td><td>65.4%</td><td>-1.0%</td></tr><tr><td>-encoder</td><td>61.3%</td><td>-5.1%</td></tr></table>
|
| 159 |
+
|
| 160 |
+
# 3.3 ABLATION STUDY
|
| 161 |
+
|
| 162 |
+
Table 3 shows the performance contributions of the coarse-grain module, the fine-grain module, as well as model decisions such as self-attention and bidirectional GRUs. Both the coarse-grain
|
| 163 |
+
|
| 164 |
+
Table 3: Ablation study on the WikiHop dev set. The rows respectively correspond to the removal of coarse-grain module, the removal of finegrain module, the replacement of self-attention with average pooling, the replacement of bidir. with unidir. GRUs, and the replacement of encoder GRUs with projection over word embeddings.
|
| 165 |
+
|
| 166 |
+
module and the fine-grain module significantly contribute to model performance. Replacing selfattention layers with mean-pooling and the bidirectional GRUs with unidirectional GRUs result in less performance degradation. Replacing the encoder with a projection over word embeddings result in significant performance drop, which suggests that contextual encodings that capture positional information is crucial to this task.
|
| 167 |
+
|
| 168 |
+
Figure 5 shows the distribution of model prediction errors across various lengths of the dataset for the coarse-grain-only model (-fine) and the fine-grain-only model (-coarse). The fine-grain-only model under-performs the coarse-grain-only model consistently across almost all length measures. This is likely due to the difficulty of coreference resolution of candidates in the support documents — the technique we use of exact lexical matching tends to produce high precision and low recall. However, the fine-grain-only model matches or outperforms the coarse-grain-only model on examples with a large number of support documents or with long support documents. This is likely because the entity-matching coreference resolution we employ captures intra-document and inter-document dependencies more precisely than hierarchical attention.
|
| 169 |
+
|
| 170 |
+
# 3.4 QUALITATIVE ANALYSIS
|
| 171 |
+
|
| 172 |
+
We examine the hierarchical attention maps produced by the CFC on examples from the WikiHop development set. We find that coattention layers consistently focus on phrases that are similar between the document and the query, while lower level self-attention layers capture phrases that characterize the entity described by the document. Because these attention maps are very large, we do not include them in the main text and instead refer readers to A.3 of the Appendix.
|
| 173 |
+
|
| 174 |
+

|
| 175 |
+
Figure 7: Fine-grain coattention and self-attention scores for for the query located in the administrative territorial entity hampton wick war memorial, for which the answer is “London borough of Richmond Upon Thames”. The coattention tends to align the relation part of the query to the context in which the mention occurs in the text. The first, second, and fourth mentions respectively describe Hampton Wicks, Hampton Hills, and Teddington — all of which are located in Richmond upon Thames. The third describes Richmond upon Thames itself.
|
| 176 |
+
|
| 177 |
+
Coarse-grain summary self-attention, described in equation 15, tends to focus on support documents that present information relevant to the object in the query. Figure 6 illustrates an example of this in which the self-attention focuses on documents relevant to the literary work “The Troll”, namely those about The Troll, its author Julia Donaldson, and Old Norse.
|
| 178 |
+
|
| 179 |
+
In contrast, fine-grain coattention over mention representations, described in equation 19, tends to focus on the relation part of the query. Figure 7 illustrates an example of this in which the coattention focuses on the relationship between the mentions and the phrase “located in the administrative territorial entity”. Attention maps of more examples can be found in A.3 of the Appendix.
|
| 180 |
+
|
| 181 |
+

|
| 182 |
+
Figure 6: Coarse-grain summary self-attention scores for the query country of origin the troll, for which the answer is “United Kingdom”. The summary selfattention tends to focus on documents relevant to the subject in the query. The top three support documents 2, 4, 5 respectively present information about the literary work The Troll, its author Julia Donaldson, and Old Norse.
|
| 183 |
+
|
| 184 |
+
# 3.5 ERROR ANALYSIS
|
| 185 |
+
|
| 186 |
+
We examine 100 errors the CFC produced on the WikiHop development set and categorize them into four types. We list identifiers and examples of these errors in A.4 of the Appendix. The first type ( $42 \%$ of errors) results from the model aggregating the wrong reference. For example, for the query country of citizenship jamie burnett, the model correctly attends to the documents about Jamie Burnett being born in South Larnarkshire and about Lanarkshire being in Scotland. However it wrongly focuses on the word “england” in the latter document instead of the answer “scotland”. We hypothesize that ways to reduce this type of error include using more robust pretrained contextual encoders (McCann et al., 2017; Peters et al., 2018) and coreference resolution. The second type $2 8 \%$ of errors) results from questions that are not answerable. For example, the support documents do not provide the narrative location of the play “The Beloved Vagabond” for the query narrative location the beloved vagabond. The third type $2 2 \%$ of errors) results from queries that yield multiple correct answers. An example is the query instance of qilakitsoq, for which the model predicts “archaeological site”, which is more specific than the answer “town”. The second and third types of errors underscore the difficulty of using distant supervision to create large-scale datasets such as WikiHop. The fourth type ( $8 \%$ of errors) results from complex relation types such as parent taxon which are difficult to interpret using pretrained word embeddings. One method to alleviate this type of errors is to embed relations using tunable symbolic embeddings as well as fixed word embeddings.
|
| 187 |
+
|
| 188 |
+
# 4 RELATED WORK
|
| 189 |
+
|
| 190 |
+
Question answering and information aggregation tasks. QA tasks span a variety of sources such as Wikipedia (Yang et al., 2015; Rajpurkar et al., 2016; 2018; Hewlett et al., 2016; Joshi et al., 2017; Welbl et al., 2018), news articles (Hermann et al., 2015; Trischler et al., 2017), books (Richardson et al., 2013), and trivia (Iyyer et al., 2014). Most QA tasks seldom require reasoning over multiple pieces of evidence. In the event that such reasoning is required, it typically arises in the form of coreference resolution within a single document (Min et al., 2018). In contrast, the Qangaroo WikiHop dataset encourages reasoning over multiple pieces of evidence across documents due to its construction. A similar task that also requires aggregating information from multiple documents is query-focused multi-document summarization, in which a model summarizes a collection of documents given an input query (Dang, 2006; Gupta et al., 2007; Lu et al., 2013).
|
| 191 |
+
|
| 192 |
+
Question answering models. The recent development of large-scale QA datasets has led to a host of end-to-end QA models. These include early document attention models for cloze-form QA (Chen et al., 2015), multi-hop memory networks (Weston et al., 2015; Sukhbaatar et al., 2015; Kumar et al., 2016), as well as cross-sequence attention models for span-extraction QA. Variations of crosssequence attention include match-LSTM (Wang & Jiang, 2017), coattention (Xiong et al., 2017; 2018), bidirectional attention (Seo et al., 2017), and query-context attention (Yu et al., 2018). Recent advances include the use of reinforcement learning to encourage the exploration of close answers that may have imprecise span match (Xiong et al., 2018; Hu et al., 2018a), the use of convolutions and self-attention to model local and global interactions (Yu et al., 2018), as well as the addition of reranking models to refine span-extraction output (Wang et al., 2018; Hu et al., 2018b). Our work builds upon prior work on single-document QA and generalizes to multi-evidence QA across documents.
|
| 193 |
+
|
| 194 |
+
Attention as information aggregation. Neural attention has been successfully applied to a variety of tasks to summarize and aggregate information. Bahdanau et al. (2015) demonstrate the use of attention over the encoder to capture soft alignments for machine translation. Similar types of attention has also been used in relation extraction (Zhang et al., 2017), summarization (Rush et al., 2015), and semantic parsing (Dong & Lapata, 2018). Coattention as a means to encode codependent representations between two inputs has also been successfully applied to visual question answering (Lu et al., 2016) in addition to textual question answering. Self-attention has similarly been shown to be effective as a means to combine information in textual entailment (Shen et al., 2018; Deunsol Yoon, 2018), coreference resolution (Lee et al., 2017), dialogue state-tracking (Zhong et al., 2018), machine translation (Vaswani et al., 2017), and semantic parsing (Kitaev & Klein, 2018). In the CFC, we present a novel way to combine self-attention and coattention in a hierarchy to build effective conditional and codependent representations of a large number of potentially long documents.
|
| 195 |
+
|
| 196 |
+
Coarse-to-fine modeling. Hierarchical coarse-to-fine modeling, which gradually introduces complexity, is an effective technique to model long documents. Petrov (2009) provides a detailed overview of this technique and demonstrates its effectiveness on parsing, speech recognition, and machine translation. Neural coarse-to-fine modeling has also been applied to question answering (Choi et al., 2017; Min et al., 2018; Swayamdipta et al., 2018) and semantic parsing (Dong & Lapata, 2018). The coarse and fine-grain modules of the CFC similarly focus on extracting coarse and fine representations of the input. Unlike previous work in which a coarse module precedes a fine module, the modules in the CFC are complementary.
|
| 197 |
+
|
| 198 |
+
# 5 CONCLUSION
|
| 199 |
+
|
| 200 |
+
We presented CFC, a new state-of-the-art model for multi-evidence question answering inspired by coarse-grain reasoning and fine-grain reasoning. On the WikiHop question answering task, the CFC achieves $7 0 . 6 \%$ test accuracy, outperforming previous methods by $3 \%$ accuracy. We showed in our analysis that the complementary coarse-grain and fine-grain modules of the CFC focus on different aspects of the input, and are an effective means to represent large collections of long documents.
|
| 201 |
+
|
| 202 |
+
# ACKNOWLEDGEMENT
|
| 203 |
+
|
| 204 |
+
The authors thank Luke Zettlemoyer for his feedback and advice and Sewon Min for her help in preprocessing the TriviaQA dataset.
|
| 205 |
+
|
| 206 |
+
# REFERENCES
|
| 207 |
+
|
| 208 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In ICLR, 2015.
|
| 209 |
+
|
| 210 |
+
Nicola De Cao, Wilker Aziz, and Ivan Titov. Question answering by reasoning across documents with graph convolutional networks. arXiv preprint arXiv:1808.09920, 2018.
|
| 211 |
+
|
| 212 |
+
Danqi Chen, Jason Bolton, and Christopher D. Manning. A thorough examination of the CNN/Daily Mail reading comprehension task. In ACL, 2015.
|
| 213 |
+
|
| 214 |
+
Kyunghyun Cho, Bart van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder-decoder for statistical machine translation. In EMNLP, 2014.
|
| 215 |
+
|
| 216 |
+
Eunsol Choi, Daniel Hewlett, Jakob Uszkoreit, Illia Polosukhin, Alexandre Lacoste, and Jonathan Berant. Coarse-to-fine question answering for long documents. In ACL, 2017.
|
| 217 |
+
|
| 218 |
+
Christopher Clark and Matt Gardner. Simple and effective multi-paragraph reading comprehension. In ACL, 2018.
|
| 219 |
+
|
| 220 |
+
Hoa Trang Dang. Overview of DUC 2006. In DUC, 2006.
|
| 221 |
+
|
| 222 |
+
SangKeun Lee Deunsol Yoon, Dongbok Lee. Dynamic self-attention: Computing attention over words dynamically for sentence embedding. arXiv preprint arXiv:1808.07383, 2018.
|
| 223 |
+
|
| 224 |
+
Bhuwan Dhingra, Qiao Jin, Zhilin Yang, William W. Cohen, and Ruslan Salakhutdinov. Neural models for reasoning over multiple mentions using coreference. arXiv preprint arXiv:1804.05922, 2018.
|
| 225 |
+
|
| 226 |
+
Li Dong and Mirella Lapata. Coarse-to-fine decoding for neural semantic parsing. In ACL, 2018.
|
| 227 |
+
|
| 228 |
+
Surabhi Gupta, Ani Nenkova, and Dan Jurafsky. Measuring importance and query relevance in topic-focused multi-document summarization. In ACL, 2007.
|
| 229 |
+
|
| 230 |
+
Kazuma Hashimoto, Caiming Xiong, Yoshimasa Tsuruoka, and Richard Socher. A joint many-task model: Growing a neural network for multiple NLP tasks. In EMNLP, 2017.
|
| 231 |
+
|
| 232 |
+
Karl Moritz Hermann, Tomas Kocisky, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa Suleyman, and Phil Blunsom. Teaching machines to read and comprehend. In NIPS, 2015.
|
| 233 |
+
|
| 234 |
+
Daniel Hewlett, Alexandre Lacoste, Llion Jones, Illia Polosukhin, Andrew Fandrianto, Jay Han, Matthew Kelcey, and David Berthelot. WIKIREADING: A novel large-scale language understanding task over Wikipedia. In ACL, 2016.
|
| 235 |
+
|
| 236 |
+
Minghao Hu, Yuxing Peng, Zhen Huang, Xipeng Qiu, Furu Wei, and Ming Zhou. Reinforced mnemonic reader for machine comprehension. In IJCAI, 2018a.
|
| 237 |
+
|
| 238 |
+
Minghao Hu, Furu Wei, Yuxing Peng, Zhen Huang, Nan Yang, and Dongsheng Li. Read $^ +$ verify: Machine reading comprehension with unanswerable questions. In AAAI, 2018b.
|
| 239 |
+
|
| 240 |
+
Mohit Iyyer, Jordan Boyd-Graber, Leonardo Claudino, Richard Socher, and Hal Daum III. A neural network for factoid question answering over paragraphs. In EMNLP, 2014.
|
| 241 |
+
|
| 242 |
+
Mandar Joshi, Eunsol Choi, Daniel S. Weld, and Luke Zettlemoyer. TriviaQA: A large scale distantly supervised challenge dataset for reading comprehension. In ACL, 2017.
|
| 243 |
+
|
| 244 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
|
| 245 |
+
|
| 246 |
+
Nikita Kitaev and Dan Klein. Constituency parsing with a self-attentive encoder. In ACL, 2018.
|
| 247 |
+
|
| 248 |
+
Ankit Kumar, Ozan Irsoy, Peter Ondruska, Mohit Iyyer, James Bradbury, Ishaan Gulrajani, Victor Zhong, Romain Paulus, and Richard Socher. Ask me anything: Dynamic memory networks for natural language processing. In ICML, 2016.
|
| 249 |
+
|
| 250 |
+
Kenton Lee, Luheng He, Mike Lewis, and Luke Zettlemoyer. End-to-end neural coreference resolution. In EMNLP, 2017.
|
| 251 |
+
|
| 252 |
+
Ilya Loshchilov and Frank Hutter. SGDR: Stochastic gradient descent with warm restarts. In ICLR, 2017.
|
| 253 |
+
|
| 254 |
+
Jiasen Lu, Jianwei Yang, Dhruv Batra, and Devi Parikh. Hierarchical question-image co-attention for visual question answering. In NIPS, 2016.
|
| 255 |
+
|
| 256 |
+
Wang Lu, Hema Raghavan, Vittorio Castelli, Radu Florian, and Claire Cardie. A sentence compression based framework to query-focused multi-document summarization. In ACL, 2013.
|
| 257 |
+
|
| 258 |
+
Christopher D. Manning, Mihai Surdeanu, John Bauer, Jenny Rose Finkel, Steven Bethard, and David McClosky. The Stanford CoreNLP natural language processing toolkit. In ACL, 2014.
|
| 259 |
+
|
| 260 |
+
Bryan McCann, James Bradbury, Caiming Xiong, and Richard Socher. Learned in translation: Contextualized word vectors. In NIPS, 2017.
|
| 261 |
+
|
| 262 |
+
Sewon Min, Victor Zhong, Richard Socher, and Caiming Xiong. Efficient and robust question answering from minimal context over documents. In ACL, 2018.
|
| 263 |
+
|
| 264 |
+
Jeffrey Pennington, Richard Socher, and Christopher D. Manning. Glove: Global vectors for word representation. In EMNLP, 2014.
|
| 265 |
+
|
| 266 |
+
Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. In NAACL, 2018.
|
| 267 |
+
|
| 268 |
+
Slav Orlinov Petrov. Coarse-to-fine Natural Language Processing. PhD thesis, University of California, Berkeley, 2009.
|
| 269 |
+
|
| 270 |
+
Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. SQuAD: 100, $0 0 0 +$ questions for machine comprehension of text. In EMNLP, 2016.
|
| 271 |
+
|
| 272 |
+
Pranav Rajpurkar, Robin Jia, and Percy Liang. Know what you don’t know: Unanswerable questions for SQuAD. In ACL, 2018.
|
| 273 |
+
|
| 274 |
+
Matthew Richardson, Christopher J. C. Burges, and Erin Renshaw. MCTest: A challenge dataset for the open-domain. In EMNLP, 2013.
|
| 275 |
+
|
| 276 |
+
Alexander M. Rush, Sumit Chopra, and Jason Weston. A neural attention model for abstractive sentence summarization. In ACL, 2015.
|
| 277 |
+
|
| 278 |
+
Min Joon Seo, Aniruddha Kembhavi, Ali Farhadi, and Hannaneh Hajishirzi. Bidirectional attention flow for machine comprehension. In ICLR, 2017.
|
| 279 |
+
|
| 280 |
+
Tao Shen, Tianyi Zhou, Guodong Long, Jing Jiang, Sen Wang, and Chengqi Zhang. Reinforced self-attention network: a hybrid of hard and soft attention for sequence modeling. In IJCAI, 2018.
|
| 281 |
+
|
| 282 |
+
Linfeng Song, Zhiguo Wang, Mo Yu, Yue Zhang, Radu Florian, and Daniel Gildea. Exploring graph-structured passage representation for multi-hop reading comprehension with graph neural networks. arXiv preprint arXiv:1809.02040, 2018.
|
| 283 |
+
|
| 284 |
+
Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. JMLR, 2014.
|
| 285 |
+
|
| 286 |
+
Sainbayar Sukhbaatar, Arthur Szlam, Jason Weston, and Rob Fergus. End-to-end memory networks. In NIPS, 2015.
|
| 287 |
+
|
| 288 |
+
Swabha Swayamdipta, Ankur P. Parikh, and Tom Kwiatkowski. Multi-mention learning for reading comprehension with neural cascades. In ICLR, 2018.
|
| 289 |
+
|
| 290 |
+
Adam Trischler, Tong Wang, Xingdi Yuan, Justin Harris, Alessandro Sordoni, Philip Bachman, and Kaheer Suleman. NewsQA: A machine comprehension dataset. In The 2nd Workshop on Representation Learning for NLP. ACL, 2017.
|
| 291 |
+
|
| 292 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NIPS, 2017.
|
| 293 |
+
|
| 294 |
+
Shuohang Wang and Jing Jiang. Machine comprehension using match-LSTM and answer pointer. In ICLR, 2017.
|
| 295 |
+
|
| 296 |
+
Shuohang Wang, Mo Yu, Jing Jiang, Wei Zhang, Xiaoxiao Guo, Shiyu Chang, and Zhiguo Wang. Evidence aggregation for answer re-ranking in open-domain question answering. In ICLR, 2018.
|
| 297 |
+
|
| 298 |
+
Johannes Welbl, Pontus Stenetorp, and Sebastian Riedel. Constructing datasets for multi-hop reading comprehension across documents. TACL, 2018.
|
| 299 |
+
|
| 300 |
+
Jason Weston, Sumit Chopra, and Antoine Bordes. Memory networks. In ICLR, 2015.
|
| 301 |
+
|
| 302 |
+
Caiming Xiong, Victor Zhong, and Richard Socher. Dynamic coattention networks for question answering. In ICLR, 2017.
|
| 303 |
+
|
| 304 |
+
Caiming Xiong, Victor Zhong, and Richard Socher. DCN+: Mixed objective and deep residual coattention for question answering. In ICLR, 2018.
|
| 305 |
+
|
| 306 |
+
Yi Yang, Wen tau Yih, and Christopher Meek. WikiQA: A challenge dataset for open-domain question answering. In ACL, 2015.
|
| 307 |
+
|
| 308 |
+
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. In ICLR, 2018.
|
| 309 |
+
|
| 310 |
+
Yuhao Zhang, Victor Zhong, Danqi Chen, Gabor Angeli, and Christopher D. Manning. Positionaware attention and supervised data improve slot filling. In EMNLP, 2017.
|
| 311 |
+
|
| 312 |
+
Victor Zhong, Caiming Xiong, and Richard Socher. Global-locally self-attentive dialogue state tracker. In ACL, 2018.
|
| 313 |
+
|
| 314 |
+
# A APPENDIX
|
| 315 |
+
|
| 316 |
+
# A.1 COREFERENCE RESOLUTION
|
| 317 |
+
|
| 318 |
+
In this work, we use simple lexical matching instead of using full-scale coreference resolution systems. The integration of the latter remains a direction for future work. To perform simple lexical matching for a given candidate, we first tokenize the document as well as the candidate. Each time the candidate tokens occur consequetively in the document, we extract the corresponding token span as a coreference mention.
|
| 319 |
+
|
| 320 |
+
# A.2 EXPERIMENT SETUP
|
| 321 |
+
|
| 322 |
+
For the best-performing model, we train the CFC using Adam (Kingma & Ba, 2015) for a maximum of 50 epochs with a batch size of 80 examples. We use an initial learning rate of $1 0 ^ { - 3 }$ with $( \beta _ { 1 } , \beta _ { 2 } ) = ( 0 . 9 , 0 . 9 9 9 )$ and employ a cosine learning rate decay Loshchilov & Hutter (2017) over the maximum budget. We find this approach to outperform a development set-based annealing heuristic as well as those based on piecewise-constant approximations. We evaluate the accuracy of the model on the development set every epoch, and evaluate the model that obtained the best accuracy on the development set on the held-out test set. We present the convergence plot in Figure 8.
|
| 323 |
+
|
| 324 |
+

|
| 325 |
+
Figure 8: Accuracy convergence plot.
|
| 326 |
+
|
| 327 |
+
We use a embedding size of $d _ { \mathrm { e m b } } = 4 0 0$ , 300 of which are from GloVe vectors (Pennington et al., 2014) and 100 of which are from character ngram vectors (Hashimoto et al., 2017). The embeddings are fixed and not tuned during training. All GRUs have a hidden size of $d _ { \mathrm { h i d } } = 1 0 0$ . We regularize the model using dropout (Srivastava et al., 2014) at several locations in the model: after the embedding layer with a rate of 0.3, encoders with a rate of 0.3, coattention layers with a rate of 0.2, and self-attention layers with a rate of 0.2. We also apply word dropout with a rate of 0.25 (Zhang et al., 2017; Zhong et al., 2018). The values for the dropout rates are coarsely tuned and we find that performance is more sensitive to word dropout than other dropout.
|
| 328 |
+
|
| 329 |
+
# A.3 ATTENTION MAPS
|
| 330 |
+
|
| 331 |
+
This section includes attention maps produced by the CFC on the development split of WikiHop. We include the fine-grain mention self-attention and coattention, the coarse-grain summary selfattention, and the document self-attention and coattention for the top scoring supporing documents, ranked by the summary self-attention score. The query can be found in the coattention maps. We use the answer as the title of the subsection.
|
| 332 |
+
|
| 333 |
+
# A.3.1 HOUSE OF VALOIS
|
| 334 |
+
|
| 335 |
+

|
| 336 |
+
|
| 337 |
+
(a) Fine-grain mentions.
|
| 338 |
+
|
| 339 |
+

|
| 340 |
+
Figure 10: Top supporting documents.
|
| 341 |
+
|
| 342 |
+
# A.3.2 GERMAN EMPIRE
|
| 343 |
+
|
| 344 |
+

|
| 345 |
+
|
| 346 |
+
(a) Fine-grain mentions.
|
| 347 |
+
|
| 348 |
+

|
| 349 |
+
Figure 12: Top supporting documents.
|
| 350 |
+
|
| 351 |
+

|
| 352 |
+
Figure 14: Top supporting documents.
|
| 353 |
+
|
| 354 |
+

|
| 355 |
+
A.3.4 LONDON BOROUGH OF RICHMOND UPON THAMES
|
| 356 |
+
|
| 357 |
+
(a) Fine-grain mentions.
|
| 358 |
+
|
| 359 |
+

|
| 360 |
+
Figure 16: Top supporting documents.
|
| 361 |
+
|
| 362 |
+
# A.4 ERROR ANALYSIS
|
| 363 |
+
|
| 364 |
+
This section includes identifiers and examples of the unanswerable questions we found in the development set during error analysis. In particular, these corresponds to 100 randomly sampled errors made by the CFC on the dev split of WikiHop.
|
| 365 |
+
|
| 366 |
+
Type 1 Error WH dev 1, WH dev 5, WH dev 8, WH dev 29, WH dev 30, WH dev 36, WH dev 40, WH dev 66, WH dev 71, WH dev 76, WH dev 77, WH dev 78, WH dev 80, WH dev 95, WH dev 96, WH dev 97, WH dev 107, WH dev 108, WH dev 109, WH dev 111, WH dev 113, WH dev 114, WH dev 116, WH dev 125, WH dev 143, WH dev 148, WH dev 151, WH dev 156, WH dev 161, WH dev 162, WH dev 164, WH dev 175, WH dev 188, WH dev 190, WH dev 191, WH dev 193, WH dev 196, WH dev 198, WH dev 212, WH dev 215, WH dev 224, WH dev 256
|
| 367 |
+
|
| 368 |
+
Type 2 Error WH dev 35, WH dev 68, WH dev 69, WH dev 81, WH dev 87, WH dev 89, WH dev 98, WH dev 123, WH dev 139, WH dev 150, WH dev 153, WH dev 154, WH dev 155, WH dev 158, WH dev 160, WH dev 168, WH dev 200, WH dev 203, WH dev 205, WH dev 208, WH dev 218, WH dev 221, WH dev 226, WH dev 228, WH dev 230, WH dev 239, WH dev 252, WH dev 260
|
| 369 |
+
|
| 370 |
+
Type 3 Error WH dev 13, WH dev 16, WH dev 18, WH dev 23, WH dev 32, WH dev 58, WH dev 65, WH dev 83, WH dev 86, WH dev 100, WH dev 107, WH dev 140, WH dev 144, WH dev 172, WH dev 176, WH dev 186, WH dev 189, WH dev 220, WH dev 222, WH dev 233, WH dev 243, WH dev 262
|
| 371 |
+
|
| 372 |
+
Type 4 Error WH dev 14, WH dev 47, WH dev 115, WH dev 120, WH dev 133, WH dev 134, WH dev 142, WH dev 234
|
| 373 |
+
|
| 374 |
+
A.4.1 TYPE 1 ERROR: AGGREGATION OF WRONG REFERENCE
|
| 375 |
+
|
| 376 |
+
Total 100 42
|
| 377 |
+
|
| 378 |
+
Query country of citizenship jamie burnett
|
| 379 |
+
|
| 380 |
+
Candidates british empire, england, london, scotland, united kingdom
|
| 381 |
+
|
| 382 |
+
Answer scotland
|
| 383 |
+
|
| 384 |
+
Prediction england
|
| 385 |
+
|
| 386 |
+
Support documents Jamie Burnett ( born 16 September 1975 ) is a professional snooker player from Hamilton , South Lanarkshire .
|
| 387 |
+
|
| 388 |
+
Glasgow is the largest city in Scotland, and third largest in the United Kingdom. Historically part of Lanarkshire, it is now one of the 32 council areas of Scotland. It is situated on the River Clyde in the countrys West Central Lowlands. Inhabitants of the city are referred to as Glaswegians.
|
| 389 |
+
|
| 390 |
+
A council area is one of the areas defined in Schedule 1 of the Local Government etc. (Scotland) Act 1994 and is under the control of one of the local authorities in Scotland created by that Act.
|
| 391 |
+
|
| 392 |
+
Edinburgh is the capital city of Scotland and one of its 32 local government council areas. Located in Lothian on the Firth of Forths southern shore, it is Scotlands second most populous city and the seventh most populous in the United Kingdom. The 2014 official population estimates are 464,990 for the city of Edinburgh, 492,680 for the local authority area, and 1,339,380 for the city region as of 2014 (Edinburgh lies at the heart of the proposed Edinburgh and South East Scotland city region). Recognised as the capital of Scotland since at least the 15th century, Edinburgh is home to the Scottish Parliament and the seat of the monarchy in Scotland. The city is also the annual venue of the General Assembly of the Church of Scotland and home to national institutions such as the National Museum of Scotland, the National Library of Scotland and the Scottish National Gallery. It is the largest financial centre in the UK after London.
|
| 393 |
+
|
| 394 |
+
Carlisle (or from Cumbric: ”Caer Luel” ) is a city and the county town of Cumbria. Historically in Cumberland, it is also the administrative centre of the City of Carlisle district in North West England. Carlisle is located at the confluence of the rivers Eden, Caldew and Petteril, south of the Scottish border. It is the largest settlement in the county of Cumbria, and serves as the administrative centre for both Carlisle City Council and Cumbria County Council. At the time of the 2001 census, the population of Carlisle was 71,773, with 100,734 living in the wider city. Ten years later, at the 2011 census, the citys population had risen to 75,306, with 107,524 in the wider city.
|
| 395 |
+
|
| 396 |
+
Hamilton is a town in South Lanarkshire, in the central Lowlands of Scotland. It serves as the main administrative centre of the South Lanarkshire council area. It is the fourth-biggest town in Scotland. It sits south-east of Glasgow, south-west of Edinburgh and north of Carlisle, Cumbria. It is situated on the south bank of the River Clyde at its confluence with the Avon Water. Hamilton is the historical county town of Lanarkshire.
|
| 397 |
+
|
| 398 |
+
South Lanarkshire is one of 32 unitary authorities of Scotland. It borders the south-east of the City of Glasgow and contains some of Greater Glasgows suburbs. It also contains many towns and villages. It also shares borders with Dumfries and Galloway, East Ayrshire, East Renfrewshire, North Lanarkshire, the Scottish Borders and West Lothian. It includes part of the historic county of Lanarkshire.
|
| 399 |
+
|
| 400 |
+
The Central Lowlands or Midland Valley is a geologically defined area of relatively low-lying land in southern Scotland. It consists of a rift valley between the Highland Boundary Fault to the north and the Southern Uplands Fault to the south. The Central Lowlands are one of the three main geographical sub-divisions of Scotland, the other two being the Highlands and Islands which lie to the north, northwest and the Southern Uplands, which lie south of the associated second fault line.
|
| 401 |
+
|
| 402 |
+
The River Clyde is a river, that flows into the Firth of Clyde in Scotland. It is the eighth-longest river in the United Kingdom, and the second-longest in Scotland. Flowing through the major city of Glasgow, it was an important river for shipbuilding and trade in the British Empire. In the early medieval Cumbric language it was known as ”Clud” or ”Clut”, and was central to the Kingdom of Strathclyde (”Teyrnas Ystrad Clut”).
|
| 403 |
+
|
| 404 |
+
Scotland (Scots: ) is a country that is part of the United Kingdom and covers the northern third of the island of Great Britain. It shares a border with England to the south, and is otherwise surrounded by the Atlantic Ocean, with the North Sea to the east and the North Channel and Irish Sea to the south-west. In addition to the mainland, the country is made up of more than 790 islands, including the Northern Isles and the Hebrides.
|
| 405 |
+
|
| 406 |
+
Avon Water, also known locally as the River Avon, is a river in Scotland, and a tributary of the River Clyde.
|
| 407 |
+
|
| 408 |
+
Lanarkshire, also called the County of Lanark is a historic county in the central Lowlands of Scotland.
|
| 409 |
+
|
| 410 |
+
A.4.2 TYPE 2 ERROR: UNANSWERABLE
|
| 411 |
+
|
| 412 |
+
Total 100 28
|
| 413 |
+
|
| 414 |
+
Query narrative location the beloved vagabond
|
| 415 |
+
|
| 416 |
+
Candidates 2014, arctic, atlantic ocean, austin, austria, belgium, brittany, burgundy, cyprus, earth, england, europe, finland, france, frankfurt, germany, hollywood, israel, lithuania, london, luxembourg, lyon, marseille, netherlands, paris, portugal, rhine, swiss alps, victoria, worms
|
| 417 |
+
|
| 418 |
+
Answer london
|
| 419 |
+
|
| 420 |
+
Prediction marseille
|
| 421 |
+
|
| 422 |
+
Support documents The North Sea is a marginal sea of the Atlantic Ocean located between Great Britain, Scandinavia, Germany, the Netherlands, Belgium, and France. An epeiric (or ”shelf”) sea on the European continental shelf, it connects to the ocean through the English Channel in the south and the Norwegian Sea in the north. It is more than long and wide, with an area of around .
|
| 423 |
+
|
| 424 |
+
Worms is a city in Rhineland-Palatinate, Germany, situated on the Upper Rhine about southsouthwest of Frankfurt-am-Main. It had approximately 85,000 inhabitants .
|
| 425 |
+
|
| 426 |
+
William George ”Will” Barker (18 January 1868 in Cheshunt 6 November 1951 in Wimbledon) was a British film producer, director, cinematographer, and entrepreneur who took film-making in
|
| 427 |
+
|
| 428 |
+
Britain from a low budget form of novel entertainment to the heights of lavishly-produced epics that were matched only by Hollywood for quality and style .
|
| 429 |
+
|
| 430 |
+
Ealing is a major suburban district of west London, England and the administrative centre of the London Borough of Ealing. It is one of the major metropolitan centres identified in the London Plan. It was historically a rural village in the county of Middlesex and formed an ancient parish. Improvement in communications with London, culminating with the opening of the railway station in 1838, shifted the local economy to market garden supply and eventually to suburban development.
|
| 431 |
+
|
| 432 |
+
Paris (French: ) is the capital and most populous city of France. It has an area of and a population in 2013 of 2,229,621 within its administrative limits. The city is both a commune and department, and forms the centre and headquarters of the le-de-France, or Paris Region, which has an area of and a population in 2014 of 12,005,077, comprising 18.2 percent of the population of France.
|
| 433 |
+
|
| 434 |
+
Bordeaux (Gascon Occitan: ””) is a port city on the Garonne River in the Gironde department in southwestern France.
|
| 435 |
+
|
| 436 |
+
The euro (sign: ; code: EUR) is the official currency of the eurozone, which consists of 19 of the member states of the European Union: Austria, Belgium, Cyprus, Estonia, Finland, France, Germany, Greece, Ireland, Italy, Latvia, Lithuania, Luxembourg, Malta, the Netherlands, Portugal, Slovakia, Slovenia, and Spain. The currency is also officially used by the institutions of the European Union and four other European countries, as well as unilaterally by two others, and is consequently used daily by some 337 million Europeans . Outside of Europe, a number of overseas territories of EU members also use the euro as their currency.
|
| 437 |
+
|
| 438 |
+
Lille is a city in northern France, in French Flanders. On the Dele River, near Frances border with Belgium, it is the capital of the Hauts-de-France region and the prefecture of the Nord department.
|
| 439 |
+
|
| 440 |
+
The Big Pond is a 1930 American Pre-Code romantic comedy film based on a 1928 play of the same name by George Middleton and A.E. Thomas. The film was written by Garrett Fort, Robert Presnell Sr. and Preston Sturges, who provided the dialogue in his first Hollywood assignment, and was directed by Hobart Henley. The film stars Maurice Chevalier and Claudette Colbert, and features George Barbier, Marion Ballou, and Andre Corday, and was released by Paramount Pictures.
|
| 441 |
+
|
| 442 |
+
Passport to Pimlico is a 1949 British comedy film made by Ealing Studios and starring Stanley Holloway, Margaret Rutherford and Hermione Baddeley. It was directed by Henry Cornelius and written by T. E. B. Clarke. The story concerns the unearthing of treasure and documents that lead to a small part of Pimlico to be declared a legal part of the House of Burgundy, and therefore exempt from the post-war rationing or other bureaucratic restrictions active in Britain at the time.
|
| 443 |
+
|
| 444 |
+
Lyon or (more archaically) Lyons (or ) is a city in east-central France, in the Auvergne-Rhne-Alpes region, about from Paris and from Marseille. Inhabitants of the city are called ”Lyonnais”.
|
| 445 |
+
|
| 446 |
+
”Thank Heaven for Little Girls” is a 1957 song written by Alan Jay Lerner and Frederick Loewe and often associated with performer Maurice Chevalier. It opened and closed the 1958 film ”Gigi”. Alfred Drake performed the song in the 1973 Broadway stage production of ”Gigi”, though in the 2015 revival, it was sung as a duet between Victoria Clark and Dee Hoty.
|
| 447 |
+
|
| 448 |
+
The Lavender Hill Mob is a 1951 comedy film from Ealing Studios, written by T.E.B. Clarke, directed by Charles Crichton, starring Alec Guinness and Stanley Holloway and featuring Sid James and Alfie Bass. The title refers to Lavender Hill, a street in Battersea, a district of South London, in the postcode district SW11, near to Clapham Junction railway station.
|
| 449 |
+
|
| 450 |
+
Curtis Bernhardt (15 April 1899 22 February 1981) was a German film director born in Worms, Germany, under the name Kurt Bernhardt. He trained as an actor in Germany, and performed on the stage, before starting as a film director in 1926. Other films include ”A Stolen Life” (1946) and ”Sirocco” (1951).
|
| 451 |
+
|
| 452 |
+
Toulouse is the capital city of the southwestern French department of Haute-Garonne, as well as of the Occitanie region. The city lies on the banks of the River Garonne, from the Mediterranean Sea, from the Atlantic Ocean, and from Paris. It is the fourth-largest city in France with 466,297 inhabitants in January 2014. The Toulouse Metro area is, with 1 312 304 inhabitants as of 2014, Frances 4th metropolitan area after Paris, Lyon and Marseille and ahead of Lille and Bordeaux.
|
| 453 |
+
|
| 454 |
+
French Guiana (pronounced or ), officially called Guiana, is an overseas department and region of France, located on the north Atlantic coast of South America in the Guyanas. It borders Brazil to the east and south, and Suriname to the west. Its area has a very low population density of only 3 inhabitants per km, with half of its 244,118 inhabitants in 2013 living in the metropolitan area of Cayenne, its capital. By land area, it is the second largest region of France and the largest outermost region within the European Union.
|
| 455 |
+
|
| 456 |
+
The Mediterranean Sea (pronounced ) is a sea connected to the Atlantic Ocean, surrounded by the Mediterranean Basin and almost completely enclosed by land: on the north by Southern Europe and Anatolia, on the south by North Africa, and on the east by the Levant. The sea is sometimes considered a part of the Atlantic Ocean, although it is usually identified as a separate body of water.
|
| 457 |
+
|
| 458 |
+
Maurice Auguste Chevalier (September 12, 1888 January 1, 1972) was a French actor, cabaret singer and entertainer. He is perhaps best known for his signature songs, including ”Louise”, ”Mimi”, ”Valentine”, and ”Thank Heaven for Little Girls” and for his films, including ”The Love Parade” and ”The Big Pond”. His trademark attire was a boater hat, which he always wore on stage with a tuxedo.
|
| 459 |
+
|
| 460 |
+
Nice (; Niard , classical norm, or ””, nonstandard, ) is the fifth most populous city in France and the capital of the Alpes-Maritimes ”dpartement”. The urban area of Nice extends beyond the administrative city limits, with a population of about 1 million on an area of . Located in the French Riviera, on the south east coast of France on the Mediterranean Sea, at the foot of the Alps, Nice is the second-largest French city on the Mediterranean coast and the second-largest city in the ProvenceAlpes-Cte dAzur region after Marseille. Nice is about 13 kilometres (8 miles) from the principality of Monaco, and its airport is a gateway to the principality as well.
|
| 461 |
+
|
| 462 |
+
Ealing Studios is a television and film production company and facilities provider at Ealing Green in west London. Will Barker bought the White Lodge on Ealing Green in 1902 as a base for film making, and films have been made on the site ever since. It is the oldest continuously working studio facility for film production in the world, and the current stages were opened for the use of sound in 1931. It is best known for a series of classic films produced in the post-WWII years, including ”Kind Hearts and Coronets” (1949), ”Passport to Pimlico” (1949), ”The Lavender Hill Mob” (1951), and ”The Ladykillers” (1955). The BBC owned and filmed at the Studios for forty years from 1955 until 1995. Since 2000, Ealing Studios has resumed releasing films under its own name, including the revived ”St Trinians” franchise. In more recent times, films shot here include ”The Importance of Being Earnest” (2002) and ”Shaun of the Dead” (2004), as well as ”The Theory of Everything” (2014), ”The Imitation Game” (2014) and ”Burnt” (2015). Interior scenes of the British period drama television series ”Downton Abbey” are shot in Stage 2 of the studios. The Met Film School London operates on the site.
|
| 463 |
+
|
| 464 |
+
Kind Hearts and Coronets is a British black comedy film of 1949 starring Dennis Price, Joan Greenwood, Valerie Hobson, and Alec Guinness. Guinness plays eight distinct characters. The plot is loosely based on the novel ”Israel Rank: The Autobiography of a Criminal” (1907) by Roy Horniman, with the screenplay written by Robert Hamer and John Dighton and the film directed by Hamer. The title refers to a line in Tennysons poem ”Lady Clara Vere de Vere”: ”Kind hearts are more than coronets, and simple faith than Norman blood.”
|
| 465 |
+
|
| 466 |
+
Europe is a continent that comprises the westernmost part of Eurasia. Europe is bordered by the Arctic Ocean to the north, the Atlantic Ocean to the west, and the Mediterranean Sea to the south. To the east and southeast, Europe is generally considered as separated from Asia by the watershed divides of the Ural and Caucasus Mountains, the Ural River, the Caspian and Black Seas, and the waterways of the Turkish Straits. Yet the non-oceanic borders of Europea concept dating back to classical antiquityare arbitrary. The primarily physiographic term ”continent” as applied to Europe also incorporates cultural and political elements whose discontinuities are not always reflected by the continents current overland boundaries.
|
| 467 |
+
|
| 468 |
+
France, officially the French Republic, is a country with territory in western Europe and several overseas regions and territories. The European, or metropolitan, area of France extends from the Mediterranean Sea to the English Channel and the North Sea, and from the Rhine to the Atlantic Ocean. Overseas France include French Guiana on the South American continent and several island territories in the Atlantic, Pacific and Indian oceans. France spans and had a total population of almost 67 million people as of January 2017. It is a unitary semi-presidential republic with the capital in Paris, the countrys largest city and main cultural and commercial centre. Other major urban centres include Marseille, Lyon, Lille, Nice, Toulouse and Bordeaux.
|
| 469 |
+
|
| 470 |
+
The British Broadcasting Corporation (BBC) is a British public service broadcaster. It is headquartered at Broadcasting House in London, is the worlds oldest national broadcasting organisation, and is the largest broadcaster in the world by number of employees, with over 20,950 staff in total, of whom 16,672 are in public sector broadcasting; including part-time, flexible as well as fixed contract staff, the total number is 35,402.
|
| 471 |
+
|
| 472 |
+
The Rhine $( , , )$ is a European river that begins in the Swiss canton of Graubnden in the southeastern Swiss Alps, forms part of the Swiss-Austrian, Swiss-Liechtenstein, Swiss-German and then the Franco-German border, then flows through the Rhineland and eventually empties into the North Sea in the Netherlands. The largest city on the river Rhine is Cologne, Germany, with a population of more than 1,050,000 people. It is the second-longest river in Central and Western Europe (after the Danube), at about , with an average discharge of about .
|
| 473 |
+
|
| 474 |
+
The Beloved Vagabond is a 1936 British musical drama film directed by Curtis Bernhardt and starring Maurice Chevalier , Betty Stockfeld , Margaret Lockwood and Austin Trevor . In nineteenth century France an architect posing as a tramp falls in love with a woman . The film was made at Ealing Studios by the independent producer Ludovico Toeplitz .
|
| 475 |
+
|
| 476 |
+
The Atlantic Ocean is the second largest of the worlds oceans with a total area of about . It covers approximately 20 percent of the Earths surface and about 29 percent of its water surface area. It separates the ”Old World” from the ”New World”.
|
| 477 |
+
|
| 478 |
+
Claude Austin Trevor (7 October 1897 22 January 1978) was a Northern Irish actor who had a long career in film and television.
|
| 479 |
+
|
| 480 |
+
The English Channel (”the Sleeve” [hence ] ”Sea of Brittany” ”British Sea”), also called simply the Channel, is the body of water that separates southern England from northern France, and joins the southern part of the North Sea to the rest of the Atlantic Ocean.
|
| 481 |
+
|
| 482 |
+
A.4.3 TYPE 3 ERROR: MULTIPLE CORRECT ANSWERS
|
| 483 |
+
|
| 484 |
+
Total $\frac { 2 2 } { 1 0 0 }$
|
| 485 |
+
|
| 486 |
+
Query instance of qilakitsoq
|
| 487 |
+
|
| 488 |
+
Candidates 1, academic discipline, activity, agriculture, archaeological site, archaeological theory, archaeology, archipelago, architecture, base, bay, branch, century, circle, coast, company, constituent country, continent, culture, director, endangered language, evidence, family, ferry, five, fjord, group, gulf, history, human, humans, hunting, inlet, island, lancaster, language isolate, material, monarchy, municipality, part, peninsula, people, queen, realm, region, republic, science, sea, sign, sound, study, subcontinent, system, territory, theory, time, town, understanding, war, world war, year
|
| 489 |
+
|
| 490 |
+
Answer town
|
| 491 |
+
|
| 492 |
+
Prediction archaeological site
|
| 493 |
+
|
| 494 |
+
Support documents North America is a continent entirely within the Northern Hemisphere and almost all within the Western Hemisphere. It can also be considered a northern subcontinent of the Americas. It is bordered to the north by the Arctic Ocean, to the east by the Atlantic Ocean, to the west and south by the Pacific Ocean, and to the southeast by South America and the Caribbean Sea.
|
| 495 |
+
|
| 496 |
+
Inuit (pronounced or ; Inuktitut: , ”the people”) are a group of culturally similar indigenous peoples inhabiting the Arctic regions of Greenland, Canada and Alaska. Inuit is a plural noun; the singular is Inuk. The oral Inuit languages are classified in the Eskimo-Aleut family. Inuit Sign Language is a critically endangered language isolate spoken in Nunavut.
|
| 497 |
+
|
| 498 |
+
Qilakitsoq is an archaeological site on Nuussuaq Peninsula , on the shore of Uummannaq Fjord in northwestern Greenland . Formally a settlement , it is famous for the discovery of eight mummified bodies in 1972 . Four of the mummies are currently on display in the Greenland National Museum .
|
| 499 |
+
|
| 500 |
+
Norway (; Norwegian: (Bokml) or (Nynorsk); Sami: ”Norgga”), officially the Kingdom of Norway, is a sovereign and unitary monarchy whose territory comprises the western portion of the Scandinavian Peninsula plus the island Jan Mayen and the archipelago of Svalbard. The Antarctic Peter I Island and the sub-Antarctic Bouvet Island are dependent territories and thus not considered part of the Kingdom. Norway also lays claim to a section of Antarctica known as Queen Maud Land. Until 1814, the Kingdom included the Faroe Islands (since 1035), Greenland (1261), and Iceland (1262). It also included Shetland and Orkney until 1468. It also included the following provinces, now in Sweden: Jmtland, Hrjedalen and Bohusln.
|
| 501 |
+
|
| 502 |
+
The Arctic (or ) is a polar region located at the northernmost part of Earth. The Arctic consists of the Arctic Ocean, adjacent seas, and parts of Alaska (United States), Canada, Finland, Greenland (Denmark), Iceland, Norway, Russia, and Sweden. Land within the Arctic region has seasonally varying snow and ice cover, with predominantly treeless permafrost-containing tundra. Arctic seas contain seasonal sea ice in many places.
|
| 503 |
+
|
| 504 |
+
Archaeology, or archeology, is the study of human activity through the recovery and analysis of material culture. The archaeological record consists of artifacts, architecture, biofacts or ecofacts, and cultural landscapes. Archaeology can be considered both a social science and a branch of the humanities. In North America, archaeology is considered a sub-field of anthropology, while in Europe archaeology is often viewed as either a discipline in its own right or a sub-field of other disciplines.
|
| 505 |
+
|
| 506 |
+
An archaeological site is a place (or group of physical sites) in which evidence of past activity is preserved (either prehistoric or historic or contemporary), and which has been, or may be, investigated using the discipline of archaeology and represents a part of the archaeological record. Sites may range from those with few or no remains visible above ground, to buildings and other structures still in use.
|
| 507 |
+
|
| 508 |
+
Nuussuaq Peninsula (old spelling: ”Ngssuaq”) is a large $1 8 0 \mathrm { x } 4 8 \mathrm { k m } ,$ peninsula in western Greenland.
|
| 509 |
+
|
| 510 |
+
Geologically, a fjord or fiord is a long, narrow inlet with steep sides or cliffs, created by glacial erosion. There are many fjords on the coasts of Alaska, British Columbia, Chile, Greenland, Iceland, the Kerguelen Islands, New Zealand, Norway, Novaya Zemlya, Labrador, Nunavut, Newfoundland, Scotland, and Washington state. Norways coastline is estimated at with fjords, but only when fjords are excluded.
|
| 511 |
+
|
| 512 |
+
Baffin Bay (Inuktitut: ”Saknirutiak Imanga”; ), located between Baffin Island and the southwest coast of Greenland, is a marginal sea of the North Atlantic Ocean. It is connected to the Atlantic via Davis Strait and the Labrador Sea. The narrower Nares Strait connects Baffin Bay with the Arctic Ocean. The bay is not navigable most of the year because of the ice cover and high density of floating ice and icebergs in the open areas. However, a polynya of about , known as the North Water, opens in summer on the north near Smith Sound. Most of the aquatic life of the bay is concentrated near that region. Extent. The International Hydrographic Organization defines the limits of Baffin Bay as follows: History. The area of the bay has been inhabited since . Around 1200, the initial Dorset settlers were replaced by the Thule (the later Inuit) peoples. Recent excavations also suggest that the Norse colonization of the Americas reached the shores of Baffin Bay sometime between the 10th and 14th centuries. The English explorer John Davis was the first recorded European to enter the bay, arriving in 1585. In 1612, a group of English merchants formed the ”Company of Merchants of London, Discoverers of the North-West Passage”. Their governor Thomas Smythe organized five expeditions to explore the northern coasts of Canada in search of a maritime passage to the Far East. Henry Hudson and Thomas Buttons explored Hudson Bay, William Gibbons Labrador, and Robert Bylot Hudson Strait and the area which became known as Baffins Bay after his pilot William Baffin. Aboard the ”Discovery”, Baffin charted the area and named Lancaster, Smith, and Jones Sounds after members of his company. By the completion of his 1616 voyage, Baffin held out no hope of an ice-free passage and the area remained unexplored for another two centuries. Over time, his account came to be doubted until it was confirmed by John Rosss 1818 voyage. More advanced scientific studies followed in 1928, in the 1930s and after World War II by Danish, American and Canadian expeditions.
|
| 513 |
+
|
| 514 |
+
The archaeological record is the body of physical (not written) evidence about the past. It is one of the core concepts in archaeology, the academic discipline concerned with documenting and interpreting the archaeological record. Archaeological theory is used to interpret the archaeological record for a better understanding of human cultures. The archaeological record can consist of the earliest ancient findings as well as contemporary artifacts. Human activity has had a large impact on the archaeological record. Destructive human processes, such as agriculture and land development, may damage or destroy potential archaeological sites. Other threats to the archaeological record include natural phenomena and scavenging. Archaeology can be a destructive science for the finite resources of the archaeological record are lost to excavation. Therefore archaeologists limit the amount of excavation that they do at each site and keep meticulous records of what is found. The archaeological record is the record of human history, of why civilizations prosper or fail and why cultures change and grow. It is the story of the world that humans have created.
|
| 515 |
+
|
| 516 |
+
The Danish Realm is a realm comprising Denmark proper, The Faroe Islands and Greenland.
|
| 517 |
+
|
| 518 |
+
Greenland is an autonomous constituent country within the Danish Realm between the Arctic and Atlantic Oceans, east of the Canadian Arctic Archipelago. Though physiographically a part of the continent of North America, Greenland has been politically and culturally associated with Europe (specifically Norway and Denmark, the colonial powers, as well as the nearby island of Iceland) for more than a millennium. The majority of its residents are Inuit, whose ancestors migrated began migrating from the Canadian mainland in the 13th century, gradually settling across the island.
|
| 519 |
+
|
| 520 |
+
Uummannaq is a town in the Qaasuitsup municipality, in northwestern Greenland. With 1,282 inhabitants in 2013, it is the eleventh-largest town in Greenland, and is home to the countrys most northerly ferry terminal. Founded in 1763 as maak, the town is a hunting and fishing base, with a canning factory and a marble quarry. In 1932 the Universal Greenland-Filmexpedition with director Arnold Fanck realized the film SOS Eisberg near Uummannaq.
|
| 521 |
+
|
| 522 |
+
The Republic of Iceland, ”Lveldi sland” in Icelandic, is a Nordic island country in the North Atlantic Ocean. It has a population of and an area of , making it the most sparsely populated country in Europe. The capital and largest city is Reykjavk. Reykjavk and the surrounding areas in the southwest of the country are home to over two-thirds of the population. Iceland is volcanically and geologically active. The interior consists of a plateau characterised by sand and lava fields, mountains and glaciers, while many glacial rivers flow to the sea through the lowlands. Iceland is warmed by the Gulf Stream and has a temperate climate, despite a high latitude just outside the Arctic Circle. Its high latitude and marine influence still keeps summers chilly, with most of the archipelago having a tundra climate.
|
| 523 |
+
|
| 524 |
+
The Canadian Arctic Archipelago, also known as the Arctic Archipelago, is a group of islands north of the Canadian mainland.
|
| 525 |
+
|
| 526 |
+
Uummannaq Fjord is a large fjord system in the northern part of western Greenland, the largest after Kangertittivaq fjord in eastern Greenland. It has a roughly south-east to west-north-west orientation, emptying into the Baffin Bay in the northwest.
|
| 527 |
+
|
| 528 |
+
A.4.4 TYPE 4 ERROR: COMPLEX RELATION TYPES
|
| 529 |
+
|
| 530 |
+
Total $\frac { 8 } { 1 0 0 }$
|
| 531 |
+
|
| 532 |
+
Query parent taxon stenotritidae
|
| 533 |
+
|
| 534 |
+
Candidates angiosperms, animal, aphid, apocrita, apoidea, area, areas, colletidae, crabronidae, formicidae, honey bee, human, hymenoptera, insects, magnoliophyta, plant, thorax
|
| 535 |
+
|
| 536 |
+
Answer apoidea
|
| 537 |
+
|
| 538 |
+
Prediction crabronidae
|
| 539 |
+
|
| 540 |
+
Support documents A honey bee (or honeybee) is any bee member of the genus Apis, primarily distinguished by the production and storage of honey and the construction of perennial, colonial nests from wax. Currently, only seven species of honey bee are recognized, with a total of 44 subspecies, though historically, from six to eleven species have been recognized. The best known honey bee is the Western honey bee which has been domesticated for honey production and crop pollination. Honey bees represent only a small fraction of the roughly 20,000 known species of bees. Some other types of related bees produce and store honey, including the stingless honey bees, but only members of the genus ”Apis” are true honey bees. The study of bees including honey bees is known as melittology.
|
| 541 |
+
|
| 542 |
+
The superfamily Apoidea is a major group within the Hymenoptera, which includes two traditionally recognized lineages, the ”sphecoid” wasps, and the bees. Molecular phylogeny demonstrates that the bees arose from within the Crabronidae, so that grouping is paraphyletic.
|
| 543 |
+
|
| 544 |
+
Honey is a sugary food substance produced and stored by certain social hymenopteran insects. It is produced from the sugary secretions of plants or insects, such as floral nectar or aphid honeydew, through regurgitation, enzymatic activity, and water evaporation. The variety of honey produced by honey bees (the genus ”Apis”) is the most well-known, due to its worldwide commercial production and human consumption. Honey gets its sweetness from the monosaccharides fructose and glucose, and has about the same relative sweetness as granulated sugar. It has attractive chemical properties for baking and a distinctive flavor that leads some people to prefer it to sugar and other sweeteners. Most microorganisms do not grow in honey, so sealed honey does not spoil, even after thousands of years. However, honey sometimes contains dormant endospores of the bacterium ”Clostridium botulinum”, which can be dangerous to babies, as it may result in botulism. People who have a weakened immune system should not eat honey because of the risk of bacterial or fungal infection. Although some evidence indicates honey may be effective in treating diseases and other medical conditions, such as wounds and burns, the overall evidence for its use in therapy is not conclusive. Providing 64 calories in a typical serving of one tablespoon ( $\mathrm { 1 5 m l }$ ) equivalent to 1272 kj per $1 0 0 \ \mathrm { g }$ , honey has no significant nutritional value. Honey is generally safe, but may have various, potential adverse effects or interactions with excessive consumption, existing disease conditions, or drugs. Honey use and production have a long and varied history as an ancient activity, depicted in Valencia, Spain by a cave painting of humans foraging for honey at least 8,000 years ago.
|
| 545 |
+
|
| 546 |
+
Australia, officially the Commonwealth of Australia, is a country comprising the mainland of the Australian continent, the island of Tasmania and numerous smaller islands. It is the worlds sixthlargest country by total area. The neighbouring countries are Papua New Guinea, Indonesia and East Timor to the north; the Solomon Islands and Vanuatu to the north-east; and New Zealand to the south-east. Australias capital is Canberra, and its largest urban area is Sydney.
|
| 547 |
+
|
| 548 |
+
Bees are flying insects closely related to wasps and ants, known for their role in pollination and, in the case of the best-known bee species, the European honey bee, for producing honey and beeswax. Bees are a monophyletic lineage within the superfamily Apoidea, presently considered as a clade Anthophila. There are nearly 20,000 known species of bees in seven to nine recognized families, though many are undescribed and the actual number is probably higher. They are found on every continent except Antarctica, in every habitat on the planet that contains insect-pollinated flowering plants.
|
| 549 |
+
|
| 550 |
+
Solomon Islands is a sovereign country consisting of six major islands and over 900 smaller islands in Oceania lying to the east of Papua New Guinea and northwest of Vanuatu and covering a land area of . The countrys capital, Honiara, is located on the island of Guadalcanal. The country takes its name from the Solomon Islands archipelago, which is a collection of Melanesian islands that also includes the North Solomon Islands (part of Papua New Guinea), but excludes outlying islands, such as Rennell and Bellona, and the Santa Cruz Islands.
|
| 551 |
+
|
| 552 |
+
The Colletidae are a family of bees, and are often referred to collectively as plasterer bees or polyester bees, due to the method of smoothing the walls of their nest cells with secretions applied with their mouthparts; these secretions dry into a cellophane-like lining. The five subfamilies, 54 genera, and over 2000 species are all evidently solitary, though many nest in aggregations. Two of the subfamilies, Euryglossinae and Hylaeinae, lack the external pollen-carrying apparatus (the scopa) that otherwise characterizes most bees, and instead carry the pollen in their crops. These groups, and most genera in this family, have liquid or semiliquid pollen masses on which the larvae develop.
|
| 553 |
+
|
| 554 |
+
Indonesia (or ; Indonesian: ), officially the Republic of Indonesia, is a unitary sovereign state and transcontinental country located mainly in Southeast Asia with some territories in Oceania. Situated between the Indian and Pacific oceans, it is the worlds largest island country, with more than seventeen thousand islands. At , Indonesia is the worlds 14th-largest country in terms of land area and worlds 7th-largest country in terms of combined sea and land area. It has an estimated population of over 260 million people and is the worlds fourth most populous country, the most populous Austronesian nation, as well as the most populous Muslim-majority country. The worlds most populous island of Java contains more than half of the countrys population.
|
| 555 |
+
|
| 556 |
+
Ants are eusocial insects of the family Formicidae and, along with the related wasps and bees, belong to the order Hymenoptera. Ants evolved from wasp-like ancestors in the Cretaceous period, about 99 million years ago and diversified after the rise of flowering plants. More than 12,500 of an estimated total of 22,000 species have been classified. They are easily identified by their elbowed antennae and the distinctive node-like structure that forms their slender waists.
|
| 557 |
+
|
| 558 |
+
Tasmania (abbreviated as Tas and known colloquially as ”Tassie”) is an island state of the Commonwealth of Australia. It is located to the south of the Australian mainland, separated by Bass Strait. The state encompasses the main island of Tasmania, the 26th-largest island in the world, and the surrounding 334 islands. The state has a population of around 518,500, just over forty percent of which resides in the Greater Hobart precinct, which forms the metropolitan area of the state capital and largest city, Hobart.
|
| 559 |
+
|
| 560 |
+
New Zealand is an island nation in the southwestern Pacific Ocean. The country geographically comprises two main landmassesthat of the North Island, or Te Ika-a-Mui, and the South Island, or Te Waipounamuand numerous smaller islands. New Zealand is situated some east of Australia across the Tasman Sea and roughly south of the Pacific island areas of New Caledonia, Fiji, and Tonga. Because of its remoteness, it was one of the last lands to be settled by humans. During its long period of isolation, New Zealand developed a distinct biodiversity of animal, fungal and plant life. The countrys varied topography and its sharp mountain peaks, such as the Southern Alps, owe much to the tectonic uplift of land and volcanic eruptions. New Zealands capital city is Wellington, while its most populous city is Auckland.
|
| 561 |
+
|
| 562 |
+
The flowering plants (angiosperms), also known as Angiospermae or Magnoliophyta, are the most diverse group of land plants, with 416 families, approx. 13,164 known genera and a total of c. 295,383 known species. Like gymnosperms, angiosperms are seed-producing plants; they are distinguished from gymnosperms by characteristics including flowers, endosperm within the seeds, and the production of fruits that contain the seeds. Etymologically, angiosperm means a plant that produces seeds within an enclosure, in other words, a fruiting plant. The term ”angiosperm” comes from the Greek composite word (”angeion”, ”case” or ”casing”, and ”sperma”, ”seed”) meaning ”enclosed seeds”, after the enclosed condition of the seeds.
|
| 563 |
+
|
| 564 |
+
Pollination is the process by which pollen is transferred to the female reproductive organs of a plant, thereby enabling fertilization to take place. Like all living organisms, seed plants have a single major goal: to pass their genetic information on to the next generation. The reproductive unit is the seed, and pollination is an essential step in the production of seeds in all spermatophytes (seed plants).
|
| 565 |
+
|
| 566 |
+
Insects (from Latin , a calque of Greek [], ”cut into sections”) are a class of invertebrates within the arthropod phylum that have a chitinous exoskeleton, a three-part body (head, thorax and abdomen), three pairs of jointed legs, compound eyes and one pair of antennae. They are the most diverse group of animals on the planet, including more than a million described species and representing more than half of all known living organisms. The number of extant species is estimated at between six and ten million, and potentially represent over 90
|
| 567 |
+
|
| 568 |
+
The Stenotritidae are the smallest of all formally recognized bee families , with only 21 species in two genera , all of them restricted to Australia . Historically , they were generally considered to belong in the family Colletidae , but the stenotritids are presently considered their sister taxon , and deserving of family status . Of prime importance is the stenotritids have unmodified mouthparts , whereas colletids are separated from all other bees by having bilobed glossae . They are large , densely hairy , fast - flying bees , which make simple burrows in the ground and firm , ovoid provision masses in cells lined with a waterproof secretions . The larvae do not spin cocoons . Fossil brood cells of a stenotritid bee have been found in the Pleistocene of the Eyre Peninsula , South Australia .
|
| 569 |
+
|
| 570 |
+
A wasp is any insect of the order Hymenoptera and suborder Apocrita that is neither a bee nor an ant. The Apocrita have a common evolutionary ancestor and form a clade; wasps as a group do not form a clade, but are paraphyletic with respect to bees and ants.
|
md/train/Syx72jC9tm/Syx72jC9tm.md
ADDED
|
@@ -0,0 +1,345 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# INVARIANT AND EQUIVARIANT GRAPH NETWORKS
|
| 2 |
+
|
| 3 |
+
Haggai Maron, Heli Ben-Hamu, Nadav Shamir & Yaron Lipman
|
| 4 |
+
|
| 5 |
+
Department of Computer Science and Applied Mathematics
|
| 6 |
+
Weizmann Institute of Science
|
| 7 |
+
Rehovot, Israel
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Invariant and equivariant networks have been successfully used for learning images, sets, point clouds, and graphs. A basic challenge in developing such networks is finding the maximal collection of invariant and equivariant linear layers. Although this question is answered for the first three examples (for popular transformations, at-least), a full characterization of invariant and equivariant linear layers for graphs is not known.
|
| 12 |
+
|
| 13 |
+
In this paper we provide a characterization of all permutation invariant and equivariant linear layers for (hyper-)graph data, and show that their dimension, in case of edge-value graph data, is 2 and 15, respectively. More generally, for graph data defined on $k$ -tuples of nodes, the dimension is the $k$ -th and $2 k$ -th Bell numbers. Orthogonal bases for the layers are computed, including generalization to multigraph data. The constant number of basis elements and their characteristics allow successfully applying the networks to different size graphs. From the theoretical point of view, our results generalize and unify recent advancement in equivariant deep learning. In particular, we show that our model is capable of approximating any message passing neural network.
|
| 14 |
+
|
| 15 |
+
Applying these new linear layers in a simple deep neural network framework is shown to achieve comparable results to state-of-the-art and to have better expressivity than previous invariant and equivariant bases.
|
| 16 |
+
|
| 17 |
+
# 1 INTRODUCTION
|
| 18 |
+
|
| 19 |
+
We consider the problem of graph learning, namely finding a functional relation between input graphs (more generally, hyper-graphs) $\mathcal { G } ^ { \ell }$ and corresponding targets $T ^ { \ell }$ , e.g., labels. As graphs are common data representations, this task received quite a bit of recent attention in the machine learning community Bruna et al. (2013); Henaff et al. (2015); Monti et al. (2017); Ying et al. (2018).
|
| 20 |
+
|
| 21 |
+
More specifically, a (hyper-)graph data point $\mathcal { G } = ( \mathbb { V } , \pmb { \mathsf { A } } )$ consists of a set of $n$ nodes $\mathbb { V }$ , and values $\pmb { \mathsf { A } }$ attached to its hyper-edges1. These values are encoded in a tensor $\pmb { \mathsf { A } }$ . The order of the tensor $\pmb { \mathsf { A } }$ , or equivalently, the number of indices used to represent its elements, indicates the type of data it represents, as follows: First order tensor represents node-values where $\pmb { \mathsf { A } } _ { i }$ is the value of the $i$ -th node; Second order tensor represents edge-values, where $\pmb { \mathsf { A } } _ { i j }$ is the value attached to the $( i , j )$ edge; in general, $k$ -th order tensor encodes hyper-edge-values, where $\mathsf { \pmb { A } } _ { i _ { 1 } , \dots , i _ { k } }$ represents the value of the hyper-edge represented by $( i _ { 1 } , \dots , i _ { k } )$ . For example, it is customary to represent a graph using a binary adjacency matrix $\pmb { \mathsf { A } }$ , where $\mathsf { \pmb { A } } _ { i j }$ equals one if vertex $i$ is connected to vertex $j$ and zero otherwise. We denote the set of order- $k$ tensors by $\mathbb { R } ^ { n ^ { k } }$ .
|
| 22 |
+
|
| 23 |
+
The task at hand is constructing a functional relation $f ( \mathbf { A } ^ { \ell } ) \approx T ^ { \ell }$ , where $f$ is a neural network. If $T ^ { \ell } = t ^ { \ell }$ is a single output response then it is natural to ask that $f$ is order invariant, namely it should produce the same output regardless of the node numbering used to encode $\pmb { \mathsf { A } }$ . For example, if we represent a graph using an adjacency matrix $\pmb { \mathsf { A } } = \pmb { \cal A } \in \mathbb { R } ^ { n \times n }$ , then for an arbitrary permutation matrix $_ { r }$ and an arbitrary adjacency matrix $\pmb { A }$ , the function $f$ is order invariant if it satisfies $f ( P ^ { T } A P ) = f ( A )$ . If the targets $T ^ { \ell }$ specify output response in a form of a tensor, $T ^ { \ell } = \boldsymbol { \mathsf { T } } ^ { \ell }$ , then it is natural to ask that $f$ is order equivariant, that is, $f$ commutes with the renumbering of nodes operator acting on tensors. Using the above adjacency matrix example, for every adjacency matrix $\pmb { A }$ and every permutation matrix $_ { P }$ , the function $f$ is equivariant if it satisfies $f ( P ^ { T } A P ) = P ^ { T } f ( A ) P$ . To define invariance and equivariance for functions acting on general tensors $\pmb { \mathsf { A } } \in \mathbb { R } ^ { n ^ { k } }$ we use the reordering operator: $\pmb { P } \star \pmb { \mathsf { A } }$ is defined to be the tensor that results from renumbering the nodes $\mathbb { V }$ according to the permutation defined by $_ { r }$ . Invariance now reads as $f ( P \star \mathsf { \pmb { A } } ) = f ( \mathsf { \pmb { A } } )$ ; while equivariance means $f ( P \star \mathsf { \pmb { A } } ) = P \star f ( \mathsf { \pmb { A } } )$ . Note that the latter equivariance definition also holds for functions between different order tensors, $f : \mathbb { R } ^ { n ^ { k } } \mathbb { R } ^ { n ^ { l } }$ .
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: The full basis for equivariant linear layers for edge-value data $\ b { \sf A } \in \mathbb { R } ^ { n \times n }$ , for $n = 5$ . The purely linear 15 basis elements, $\mathtt { B } ^ { \mu }$ , are represented by matrices $n ^ { 2 } \times n ^ { 2 }$ , and the 2 bias basis elements (right), ${ \pmb { \complement } } ^ { \lambda }$ , by matrices $n \times n$ , see equation 9.
|
| 27 |
+
|
| 28 |
+
Following the standard paradigm of neural-networks where a network $f$ is defined by alternating compositions of linear layers and non-linear activations, we set as a goal to characterize all linear invariant and equivariant layers. The case of node-value input $\pmb { \mathsf { A } } = \pmb { a } \in \mathbb { R } ^ { n }$ was treated in the pioneering works of Zaheer et al. (2017); Qi et al. (2017). These works characterize all linear permutation invariant and equivariant operators acting on node-value (i.e., first order) tensors, $\mathbb { R } ^ { n }$ . In particular it it shown that the linear space of invariant linear operators $L : \mathbb { R } ^ { n } \to \mathbb { R }$ is of dimension one, containing essentially only the sum operator, $\mathbf { \Psi } _ { L ( \mathbf { a } ) } = \alpha \mathbf { \dot { 1 } } ^ { T } \mathbf { a }$ . The space of equivariant linear operators $L : \mathbb { R } ^ { n } \to \mathbb { R } ^ { n }$ is of dimension two, $L ( \mathbf { \boldsymbol { a } } ) = \left[ \alpha \mathbf { \boldsymbol { I } } + \beta ( \mathbf { 1 1 } ^ { T } - I ) \right] \mathbf { \boldsymbol { a } } .$ .
|
| 29 |
+
|
| 30 |
+
The general equivariant tensor case was partially treated in Kondor et al. (2018) where the authors make the observation that the set of standard tensor operators: product, element-wise product, summation, and contraction are all equivariant, and due to linearity the same applies to their linear combinations. However, these do not exhaust nor provide a full and complete basis for all possible tensor equivariant linear layers.
|
| 31 |
+
|
| 32 |
+
In this paper we provide a full characterization of permutation invariant and equivariant linear layers for general tensor input and output data. We show that the space of invariant linear layers $L : \mathbb { R } ^ { k } \to \mathbb { R }$ is of dimension $\mathrm { b } ( k )$ , where $\mathrm { b } ( k )$ is the $k$ -th Bell number. The $k$ -th Bell number is the number of possible partitions of a set of size $k$ ; see inset for the case $k = 3$ . Furthermore, the space of equivariant linear layers
|
| 33 |
+
|
| 34 |
+

|
| 35 |
+
|
| 36 |
+
$L : \mathbb { R } ^ { n ^ { k } } \to \mathbb { R } ^ { n ^ { l } }$ is of dimension $\mathrm { b } ( k + l )$ . Remarkably, this dimension is independent of the size $n$ of the node set $\mathbb { V }$ . This allows applying the same network on graphs of different sizes. For both types of layers we provide a general formula for an orthogonal basis that can be readily used to build linear invariant or equivariant layers with maximal expressive power. Going back to the example of a graph represented by an adjacency matrix $\pmb { A } \in \mathbb { R } ^ { \bar { n } \times n }$ we have $k = 2$ and the linear invariant layers $L : \mathbb { R } ^ { n \times n } \mathbb { R }$ have dimension ${ \mathrm { b } } ( 2 ) = 2$ , while linear equivariant layers $L : \mathbb { R } ^ { n \times n } \mathbb { R } ^ { n \times n }$ have dimension $\mathrm { b } ( 4 ) = 1 5$ . Figure 1 shows visualization of the basis to the linear equivariant layers acting on edge-value data such as adjacency matrices.
|
| 37 |
+
|
| 38 |
+
In Hartford et al. (2018) the authors provide an impressive generalization of the case of node-value data to several node sets, $\mathbb { V } _ { 1 } , \mathbb { V } _ { 2 } , \ldots , \mathbb { V } _ { m }$ of sizes $n _ { 1 } , n _ { 2 } , \ldots , n _ { m }$ . Their goal is to learn interactions across sets. That is, an input data point is a tensor $\mathbf { A } \in \mathbb { R } ^ { n _ { 1 } \times n _ { 2 } \times \cdots \times n _ { m } }$ that assigns a value to each element in the cartesian product $\mathbb { V } _ { 1 } \times \mathbb { V } _ { 2 } \times \dots \times \mathbb { V } _ { m }$ . Renumbering the nodes in each node set using permutation matrices $P _ { 1 } , \ldots , P _ { m }$ (resp.) results in a new tensor we denote by $P _ { 1 : m } \star \pmb { \mathsf { A } }$ . Order invariance means $f ( P _ { 1 : m } \star \mathbf { A } ) = f ( \mathbf { A } )$ and order equivariance is $f ( P _ { 1 : m } \star \pmb { \mathsf { A } } ) = \dot { P } _ { 1 : m } \star f ( \pmb { \mathsf { A } } )$ . Hartford et al. (2018) introduce bases for linear invariant and equivariant layers. Although the layers in Hartford et al. (2018) satisfy the order invariance and equivariance, they do not exhaust all possible such layers in case some node sets coincide. For example, if $\mathbb { V } _ { 1 } = \mathbb { V } _ { 2 }$ they have 4 independent learnable parameters where our model has the maximal number of 15 parameters.
|
| 39 |
+
|
| 40 |
+
Our analysis allows generalizing the multi-node set case to arbitrary tensor data over $\mathbb { V } _ { 1 } \times \mathbb { V } _ { 2 } \times$ $\cdots \times \mathbb { V } _ { m }$ . Namely, for data points in the form of a tensor $\pmb { \ A } \in \mathbb { R } ^ { k _ { 1 } } \times n _ { 2 } ^ { k _ { 2 } } \times \cdots \times n _ { m } ^ { k _ { m } }$ . The tensor $\pmb { \mathsf { A } }$ attaches a value to every element of the Cartesian product $\mathbb { V } _ { 1 } ^ { k _ { 1 } } \times \dots \times \mathbb { V } _ { 2 } ^ { k _ { 2 } }$ , that is, $k _ { 1 }$ -tuple from $\mathbb { V } _ { 1 }$ , $k _ { 2 }$ -tuple from $\mathbb { V } _ { 2 }$ and so forth. We show that the linear space of invariant linear layers $L : \mathbb { R } ^ { n _ { 1 } ^ { k _ { 1 } } \times n _ { 2 } ^ { k _ { 2 } } \times \dots \times n _ { m } ^ { k _ { m } } } \mathbb { R }$ is of dimension $\textstyle \prod _ { i = 1 } ^ { m } { \mathrm { b } ( k _ { i } ) }$ , while the equivariant linear layers $L :$
|
| 41 |
+
|
| 42 |
+
$\mathbb { R } ^ { n _ { 1 } ^ { k _ { 1 } } \times n _ { 2 } ^ { k _ { 2 } } \times \dots \times n _ { m } ^ { k _ { m } } } \mathbb { R } ^ { n _ { 1 } ^ { l _ { 1 } } \times n _ { 2 } ^ { l _ { 2 } } \times \dots \times n _ { m } ^ { l _ { m } } }$ has dimension $\textstyle \prod _ { i = 1 } ^ { m } \ b ( k _ { i } + l _ { i } )$ . We also provide orthogonal bases for these spaces. Note that, for clarity, the discussion above disregards biases and features; we detail these in the paper.
|
| 43 |
+
|
| 44 |
+
In appendix C we show that our model is capable of approximating any message-passing neural network as defined in Gilmer et al. (2017) which encapsulate several popular graph learning models. One immediate corollary is that the universal approximation power of our model is not lower than message passing neural nets.
|
| 45 |
+
|
| 46 |
+
In the experimental part of the paper we concentrated on possibly the most popular instantiation of graph learning, namely that of a single node set and edge-value data, e.g., with adjacency matrices. We created simple networks by composing our invariant or equivariant linear layers in standard ways and tested the networks in learning invariant and equivariant graph functions: (i) We compared identical networks with our basis and the basis of Hartford et al. (2018) and showed we can learn graph functions like trace, diagonal, and maximal singular vector. The basis in Hartford et al. (2018), tailored to the multi-set setting, cannot learn these functions demonstrating it is not maximal in the graph-learning (i.e., multi-set with repetitions) scenario. We also demonstrate our representation allows extrapolation: learning on one size graphs and testing on another size; (ii) We also tested our networks on a collection of graph learning datasets, achieving results that are comparable to the state-of-the-art in 3 social network datasets.
|
| 47 |
+
|
| 48 |
+
# 2 PREVIOUS WORK
|
| 49 |
+
|
| 50 |
+
Our work builds on two main sub-fields of deep learning: group invariant or equivariant networks, and deep learning on graphs. Here we briefly review the relevant works.
|
| 51 |
+
|
| 52 |
+
Invariance and equivariance in deep learning. In many learning tasks the functions that we want to learn are invariant or equivariant to certain symmetries of the input object description. Maybe the first example is the celebrated translation invariance of Convolutional Neural Networks (CNNs) (LeCun et al., 1989; Krizhevsky et al., 2012); in this case, the image label is invariant to a translation of the input image. In recent years this idea was generalized to other types of symmetries such as rotational symmetries (Cohen & Welling, 2016a;b; Weiler et al., 2018; Cohen et al., 2018). Cohen & Welling (2016a) introduced Group Equivariant Neural Networks that use a generalization of the convolution operator to groups of rotations and reflections; Weiler et al. (2018); Cohen et al. (2018) also considered rotational symmetries but in the case of 3D shapes and spherical functions. Ravanbakhsh et al. (2017) showed that any equivariant layer is equivalent to a certain parameter sharing scheme. If we adopt this point of view, our work reveals the structure of the parameter sharing in the case of graphs and hyper-graphs. In another work, Kondor & Trivedi (2018) show that a neural network layer is equivariant to the action of some compact group iff it implements a generalized form of the convolution operator. Yarotsky (2018) suggested certain group invariant/equivariant models and proved their universality. To the best of our knowledge these models were not implemented.
|
| 53 |
+
|
| 54 |
+
Learning of graphs. Learning of graphs is of huge interest in machine learning and we restrict our attention to recent advancements in deep learning on graphs. Gori et al. (2005); Scarselli et al. (2009) introduced Graph Neural Networks (GNN): GNNs hold a state (a real valued vector) for each node in the graph, and propagate these states according to the graph structure and learned parametric functions. This idea was further developed in Li et al. (2015) that use gated recurrent units. Following the success of CNNs, numerous works suggested ways to define convolution operator on graphs. One promising approach is to define convolution by imitating its spectral properties using the Laplacian operator to define generalized Fourier basis on graphs (Bruna et al., 2013). Multiple follow-up works (Henaff et al., 2015; Defferrard et al., 2016; Kipf & Welling, 2016; Levie et al., 2017) suggest more efficient and spatially localized filters. The main drawback of spectral approaches is that the generalized Fourier basis is graph-dependent and applying the same network to different graphs can be challenging. Another popular way to generalize the convolution operator to graphs is learning stationary functions that operate on neighbors of each node and update its current state (Atwood & Towsley, 2016; Duvenaud et al., 2015; Hamilton et al., 2017; Niepert et al., 2016; Velickovi ˇ c´ et al., 2017; Monti et al., 2017; Simonovsky & Komodakis, 2017). This idea generalizes the locality and weight sharing properties of the standard convolution operators on regular grids. As shown in the important work of Gilmer et al. (2017), most of the the above mentioned methods (including the spectral methods) can be seen as instances of the general class of Message Passing Neural Networks.
|
| 55 |
+
|
| 56 |
+
In this section we characterize the collection of linear invariant and equivariant layers. We start with the case of a single node set $\mathbb { V }$ of size $n$ and edge-value data, that is order 2 tensors $\pmb { \mathsf { A } } = \pmb { \cal A } \in \mathbb { R } ^ { n \times n }$ . As a typical example imagine, as above, an adjacency matrix of a graph. We set a bit of notation. Given a matrix $\dot { \boldsymbol { X } _ { \mathrm { ~ \scriptsize ~ \in ~ } \mathbb { R } ^ { a \times b } } }$ we denote $\mathrm { v e c } ( \bar { \boldsymbol X } ) \in \dot { \mathbb R } ^ { a b \times 1 }$ its column stack, and by brackets the inverse action of reshaping to a square matrix, namely $[ \mathrm { v e c } ( X ) ] = X$ . Let $p$ denote an arbitrary permutation and $_ { r }$ its corresponding permutation matrix.
|
| 57 |
+
|
| 58 |
+
Let $\pmb { L } \in \mathbb { R } ^ { 1 \times n ^ { 2 } }$ denote the matrix representing a general linear operator $L : \mathbb { R } ^ { n \times n } \mathbb { R }$ in the standard basis, then $L$ is order invariant iff $\underline { { L } } \mathrm { v e c } ( \bar { P ^ { T } } A P ) = \underline { { L } } \mathrm { v e c } ( A )$ . Using the property of the Kronecker product that $\operatorname { v e c } ( X A Y ) = Y ^ { T } \otimes X \operatorname { v e c } ( A )$ , we get the equivalent equality $\dot { L } P ^ { T } \otimes$ $P ^ { T } \mathrm { v e c } ( A ) \stackrel { - } { = } L \mathrm { v e c } ( A )$ . Since the latter equality should hold for every $\pmb { A }$ we get (after transposing both sides of the equation) that order invariant $\pmb { L }$ is equivalent to the equation
|
| 59 |
+
|
| 60 |
+
for every permutation matrix $_ { r }$ . Note that we used $\pmb { L } ^ { T } = \mathrm { v e c } ( \pmb { L } )$ .
|
| 61 |
+
|
| 62 |
+
For equivariant layers we consider a general linear operator $L : \mathbb { R } ^ { n \times n } \mathbb { R } ^ { n \times n }$ and its corresponding matrix $\boldsymbol { L } \in \mathbb { R } ^ { n ^ { 2 } \times n ^ { 2 } }$ . Equivariance of $L$ is now equivalent to $\left[ L \mathrm { v e c } ( P ^ { T } A P ) \right] =$ $P ^ { \acute { T } } [ L \mathrm { v e c } \acute { ( } A ) ] P$ . Using the above property of the Kronecker product again we get $ { \mathbf { } } ^ { L P ^ { T } \otimes }$ $P ^ { T } \mathrm { { v e c } } ( A ) = P ^ { T } \otimes \bar { P ^ { T } } L \mathrm { v e c } ( A )$ . Noting that $P ^ { T } \otimes P ^ { T }$ is an $n ^ { 2 } \times n ^ { \bar { 2 } }$ permutation matrix and its inverse is $P \otimes P$ we get to the equivalent equality $P \otimes P L P ^ { T } \otimes P ^ { T } \mathrm { v \bar { e c } } ( A ) = L \mathrm { v e c } ( A )$ . As before, since this holds for every $\pmb { A }$ and using the properties of the Kronecker product we get that $\pmb { L }$ is order equivariant iff for all permutation matrices $_ { r }$
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
P \otimes P \otimes P \otimes P \operatorname { v e c } ( L ) = \operatorname { v e c } ( L ) .
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
From equations 1 and 2 we see that finding invariant and equivariant linear layers for the order-2 tensor data over one node set requires finding fixed points of the permutation matrix group represented by Kronecker powers $P \otimes P \otimes \cdots \otimes P$ of permutation matrices $_ { P }$ . As we show next, this is also the general case for order- $k$ tensor data $\pmb { \mathsf { A } } \in \bar { \mathbb { R } } ^ { k }$ over one node set, $\mathbb { V }$ . That is,
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\begin{array} { r l } { \operatorname { i n v a r i a n t } L : \quad } & { P ^ { \otimes k } \mathrm { v e c } ( L ) = \mathrm { v e c } ( L ) } \\ { \mathrm { e q u i v a r i a n t } L : \quad } & { P ^ { \otimes 2 k } \mathrm { v e c } ( L ) = \mathrm { v e c } ( L ) } \end{array}
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
k for every permutation matrix $_ { r }$ , where $P ^ { \otimes k } = \overbrace { P \otimes \cdots \otimes P } ^ { \substack { \longleftrightarrow } }$ . In equation 3, $\pmb { L } \in \mathbb { R } ^ { 1 \times n ^ { k } }$ is the matrix of an invariant operator; and in equation 4, L ∈ Rnk×nk i s the matrix of an equivariant operator. We call equations 3,4 the fixed-point equations.
|
| 75 |
+
|
| 76 |
+
To see this, let us add a bit of notation first. Let $p$ denote the permutation corresponding to the permutation matrix $_ { r }$ . We let $\pmb { P } \star \pmb { \mathsf { A } }$ denote the tensor that results from expressing the tensor $\pmb { \mathsf { A } }$ after renumbering the nodes in $\mathbb { V }$ according to permutation $_ { r }$ . Explicitly, the $( p ( i _ { 1 } ) , p ( i _ { 2 } ) , \dots , p ( i _ { k } ) )$ -th entry of $\pmb { P } \star \pmb { \mathsf { A } }$ equals the $( i _ { 1 } , i _ { 2 } , \ldots , i _ { k } )$ -th entry of $\pmb { \mathsf { A } }$ . The matrix that corresponds to the operator $P \star$ in the standard tensor basis $e ^ { ( i _ { 1 } ) } \otimes \cdots \otimes e ^ { ( i _ { k } ) }$ is the Kronecker power $P ^ { T \otimes k } = ( P ^ { T } ) ^ { \otimes k }$ . Note that $\operatorname { v e c } ( \pmb { \mathsf { A } } )$ is exactly the coordinate vector of the tensor $\pmb { \mathsf { A } }$ in this standard basis and therefore we have $\mathrm { v e c } ( \pmb { P } \star \mathbf { A } ) = \mathbf { \dot { P } } ^ { T \otimes k } \mathrm { v e c } ( \mathbf { A } )$ . We now show:
|
| 77 |
+
|
| 78 |
+
Proposition 1. A linear layer is invariant (equivariant) if and only if its coefficient matrix satisfies the fixed-point equations, namely equation $^ 3$ (equation 4).
|
| 79 |
+
|
| 80 |
+
Proof. Similarly to the argument from the order-2 case, let $\pmb { L } \in \mathbb { R } ^ { 1 \times n ^ { k } }$ denote the matrix corresponding to a general linear operator $L : \mathbb { R } ^ { n ^ { k } } \to \mathbb { R }$ . Order invariance means
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
L \mathrm { v e c } ( P \star \mathsf { \pmb { A } } ) = L \mathrm { v e c } ( \mathsf { \pmb { A } } ) .
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
Using the matrix $P ^ { T \otimes k }$ we have equivalently $L P ^ { T \otimes k } \mathrm { v e c } ( \pmb { \mathsf { A } } ) = L \mathrm { v e c } ( \pmb { \mathsf { A } } )$ which is in turn equivalent to $P ^ { \otimes k } \mathrm { v e c } ( L ) \ = \ \mathrm { v e c } ( L )$ for all permutation matrices $_ { r }$ . For order equivariance, let $\pmb { L } \in \mathbb { R } ^ { n ^ { k } \times n ^ { k } }$ denote the matrix of a general linear operator $L : \mathbb { R } ^ { n ^ { k } } \to \mathbb { R } ^ { n ^ { k } }$ . Now equivariance of $L$ is equivalent to
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
[ L \mathrm { v e c } ( P \star \mathsf { \pmb A } ) ] = P \star [ L \mathrm { v e c } ( \mathsf { \pmb A } ) ] .
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
Similarly to above this is equivalent to $L P ^ { T \otimes k } \mathrm { v e c } ( \mathbf { A } ) = P ^ { T \otimes k } L \mathrm { v e c } ( \mathbf { A } ) .$ which in turn leads to $P ^ { \otimes k } L \dot { P } ^ { T \otimes k } = L$ , and using the Kronecker product properties we get $P ^ { \otimes 2 k } \mathrm { v e c } ( L ) = \mathrm { v e c } ( L )$ .
|
| 93 |
+
|
| 94 |
+
We have reduced the problem of finding all invariant and equivariant linear operators $L$ to finding all solutions $\pmb { L }$ of equations 3 and 4. Although the fixed point equations consist of an exponential number of equations with only a polynomial number of unknowns they actually possess a solution space of constant dimension (i.e., independent of $n$ ).
|
| 95 |
+
|
| 96 |
+
To find the solution of $P ^ { \otimes \ell } \mathrm { v e c } ( { \pmb X } ) = \mathrm { v e c } ( { \pmb X } )$ , where $\pmb { \mathsf { X } } \in \mathbb { R } ^ { n ^ { \ell } }$ , note that $P ^ { \otimes \ell } \mathrm { v e c } ( { \pmb X } ) = \mathrm { v e c } ( { \pmb Q } \star { \pmb X } )$ , where $Q = P ^ { T }$ . As above, the tensor $Q \star \mathsf { X }$ is the tensor resulted from renumbering the nodes in $\mathbb { V }$ using permutation $Q$ . Equivalently, the fixed-point equations we need to solve can be formulated as
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
Q \star { \mathsf { X } } = { \mathsf { X } } , \quad \forall Q \ \mathrm { p e r m u t a t i o n \ m a t r i c e s }
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
The permutation group is acting on tensors $\mathbf { X } \in \mathbb { R } ^ { n ^ { \ell } }$ with the action ${ \pmb x } \mapsto { \pmb Q } \star { \pmb X }$ . We are looking for fixed points under this action. To that end, let us define an equivalence relation in the index space of tensors $\mathbb { R } ^ { n ^ { \ell } }$ , namely in $[ n ] ^ { \ell }$ , where with a slight abuse of notation (we use light brackets) we set $[ n ] = \{ 1 , 2 , \dots , n \}$ . For multi-indices $a , b \in [ n ] ^ { \ell }$ we set $\mathbf { \mu } _ { a \sim b }$ iff $\mathbf { \delta } _ { a , b }$ have the same equality pattern, that is $\pmb { a } _ { i } = \pmb { a } _ { j } \Leftrightarrow b _ { i } = b _ { j }$ for all $i , j \in [ \ell ]$ .
|
| 103 |
+
|
| 104 |
+
The equality pattern equivalence relation partitions the index set $[ n ] ^ { \ell }$ into equivalence classes, the collection of which is denoted $[ n ] ^ { \ell } / _ { \sim }$ . Each equivalence class can be represented by a unique partition of the set $[ \ell ]$ where each set in the partition indicates maximal set of identical values. Let us exemplify. For $\ell = 2$ we have two equivalence classes $\gamma _ { 1 } = \{ \{ 1 \} , \{ 2 \} \}$ and $\gamma _ { 2 } = \{ \{ 1 , 2 \} \}$ ; $\gamma _ { 1 }$ represents all multi-indices $( i , j )$ where $i \neq j$ , while $\gamma _ { 2 }$ represents all multi-indices $( i , j )$ where $i = j$ . For $\ell = 4$ , there are 15 equivalence classes $\gamma _ { 1 } = \{ \{ 1 \} , \{ 2 \} , \{ 3 \} , \{ 4 \} \}$ , $\gamma _ { 2 } = \{ \{ 1 \} , \{ 2 \} , \{ 3 , 4 \} \}$ , $\gamma _ { 3 } = \{ \{ 1 , 2 \} , \{ 3 \} , \{ 4 \} \} , . .$ . ; $\gamma _ { 3 }$ represents multi-indices $( i _ { 1 } , i _ { 2 } , i _ { 3 } , i _ { 4 } )$ so that $i _ { 1 } = i _ { 2 }$ , $i _ { 2 } \neq i _ { 3 }$ , $i _ { 3 } \neq i _ { 4 }$ , $i _ { 2 } \neq i _ { 4 }$ .
|
| 105 |
+
|
| 106 |
+
For each equivalence class $\gamma \in [ n ] ^ { \ell } / _ { \sim }$ we define an order- $\ell$ tensor $\mathbf { B } ^ { \gamma } \in \mathbb { R } ^ { n ^ { \ell } }$ by setting
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\mathbf { { \vec { 8 } } } _ { a } ^ { \gamma } = \left\{ { \begin{array} { l l } { 1 } & { \mathbf { { \vec { a } } } \in \gamma } \\ { 0 } & { { \mathrm { o t h e r w i s e } } } \end{array} } \right.
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
Since we have a tensor $\pmb { \mathsf { B } } ^ { \gamma }$ for every equivalence class $\gamma$ , and the equivalence classes are in oneto-one correspondence with partitions of the set $[ \ell ]$ we have ${ \bf b } ( \ell )$ tensors $\pmb { \mathsf { B } } ^ { \gamma }$ . (Remember that ${ \mathrm { b } } ( \ell )$ denotes the $\ell$ -th Bell number.) We next prove:
|
| 113 |
+
|
| 114 |
+
Proposition 2. The tensors $\pmb { \mathsf { B } } ^ { \gamma }$ in equation 8 form an orthogonal basis (in the standard innerproduct) to the solution set of equations 7. The dimension of the solution set is therefore ${ \bf b } ( \ell )$ .
|
| 115 |
+
|
| 116 |
+
Proof. Let us first show that: $\pmb { \chi }$ is a solution to equation 7 iff $\pmb { \chi }$ is constant on equivalence classes of the equality pattern relation, $\sim$ . Since permutation $q : [ n ] [ n ]$ is a bijection the equality patterns of $\pmb { a } = ( i _ { 1 } , i _ { 2 } , \dotsc , i _ { \ell } ) \in [ n ] ^ { \ell }$ and $q ( \pmb { a } ) = ( q ( i _ { 1 } ) , q ( i _ { 2 } ) , \dots , \bar { q } ( i _ { \ell } ) ) \in [ n ] ^ { \ell }$ are identical, i.e., $a \sim q ( a )$ . Taking the $a \in [ \dot { n } ] ^ { \ell }$ entry of both sides of equation 7 gives $\pmb { \mathsf { X } } _ { q ( \pmb { a } ) } = \pmb { \mathsf { X } } _ { \pmb { a } }$ . Now, if $\pmb { \chi }$ is constant on equivalence classes then in particular it will have the same value at $\textbf { \em a }$ and $q ( a )$ for all ${ \pmb a } \in [ n ] ^ { \ell }$ and permutations $q$ . Therefore $\pmb { \chi }$ is a solution to equation 7. For the only if part, consider a tensor $\pmb { \chi }$ for which there exist multi-indices $\mathbf { \mu } _ { a \sim b }$ (with identical equality patterns) and ${ \pmb X } _ { a } \ne { \pmb X } _ { b }$ then $\pmb { \chi }$ is not a solution to equation 7. Indeed, since $\mathbf { \mu } _ { a \sim b }$ one can find a permutation $q$ so that $\pmb { b } = \pmb { q } ( \pmb { a } )$ and using the equation above, $\pmb { \mathsf { X } } _ { b } = \pmb { \mathsf { X } } _ { q ( \pmb { a } ) } = \pmb { \mathsf { X } } _ { a }$ which leads to a contradiction.
|
| 117 |
+
|
| 118 |
+
To finish the proof note that any tensor $\pmb { \chi }$ , constant on equivalence classes, can be written as a linear combination of $\pmb { \mathsf { B } } ^ { \gamma }$ , which are merely indicators of the equivalence class. Furthermore, the collection $\pmb { \mathsf { B } } ^ { \gamma }$ have pairwise disjoint supports and therefore are an orthogonal basis. □
|
| 119 |
+
|
| 120 |
+
Combining propositions 1 and 2 we get the characterization of invariant and equivariant linear layers acting on general $k$ -order tensor data over a single node set $\mathbb { V }$ :
|
| 121 |
+
|
| 122 |
+
Theorem 1. The space of invariant (equivariant) linear layers $\mathbb { R } ^ { n ^ { k } } \mathbb { R }$ $( \mathbb { R } ^ { n ^ { k } } \to \mathbb { R } ^ { n ^ { k } } ,$ ) is of dimension $\mathrm { b } ( k )$ $( \mathrm { b } ( 2 k ) )$ with basis elements $\pmb { \mathsf { B } } ^ { \gamma }$ defined in equation 8, where $\gamma$ are equivalence classes in $[ n ] ^ { k } / _ { \sim } ( [ n ] ^ { 2 k } / _ { \sim } )$ .
|
| 123 |
+
|
| 124 |
+
Biases Theorem 1 deals with purely linear layers, that is without bias, i.e., without constant part. Nevertheless extending the previous analysis to constant layers is straight-forward. First, any constant layer Rnk $\mathbb { R } ^ { n ^ { k } } \mathbb { R }$ is also invariant so all constant invariant layers are represented by constants $c \in \mathbb { R }$ . For equivariant layers $L : \mathbb { R } ^ { k } \to \mathbb { R } ^ { n ^ { k } }$ we note that equivariance means ${ \mathsf { \pmb { \mathsf { C } } } } = { \cal L } ( { \pmb { P } } \star { \pmb { \mathsf { A } } } ) = { \pmb { P } } \star { \cal L } ( { \pmb { \mathsf { A } } } ) = { \pmb { P } } \star { \pmb { \mathsf { C } } }$ . Representing this equation in matrix form we get $P ^ { T \otimes k } \mathrm { v e c } ( { \bf { C } } ) = \mathrm { v e c } ( { \bf { C } } )$ . This shows that constant equivariant layers on one node set acting on general $k$ -order tensors are also characterized by the fixed-point equations, and in fact have the same form and dimensionality as invariant layers on $k$ -order tensors, see equation 3. Specifically, their basis is $\boldsymbol { \mathsf { B } } ^ { \lambda }$ , $\lambda \in [ n ] ^ { k } / _ { \sim }$ . For example, for $k = 2$ , the biases are shown on the right in figure 1.
|
| 125 |
+
|
| 126 |
+
Features. It is pretty common that input tensors have vector values (i.e., features) attached to each hyper-edge ( $k$ -tuple of nodes) in $\mathbb { V }$ , that is $\pmb { \mathsf { A } } \in \mathbb { R } ^ { n ^ { k } \times d }$ . Now linear invariant $\mathbb { R } ^ { n ^ { k } \times d } \ \to \ \mathbb { R } ^ { 1 \times d ^ { \prime } }$ or equivariant $\bar { \mathbb { R } ^ { n ^ { k } \times d } } \to \mathbb { R } ^ { n ^ { k } \times d ^ { \prime } }$ layers can be formulated using a slight generalization of the previous analysis. The operator $\pmb { P } \star \pmb { \mathsf { A } }$ is defined to act only on the nodal indices, i.e., $i _ { 1 } , \dots , i _ { k }$ (the first $k$ indices). Explicitly, the $( p ( i _ { 1 } ) , p ( i _ { 2 } ) , \dots , p ( i _ { k } ) , i _ { k + 1 } )$ -th entry of $\pmb { P } \star \pmb { \mathsf { A } }$ equals the $( i _ { 1 } , i _ { 2 } , \ldots , i _ { k } , i _ { k + 1 } ) $ -th entry of $\pmb { \mathsf { A } }$ .
|
| 127 |
+
|
| 128 |
+
Invariance is now formulated exactly as before, equation 5, namely ${ \cal L } \mathrm { v e c } ( P \star { \bf A } ) = { \cal L } \mathrm { v e c } ( { \bf A } )$ . The matrix that corresponds to $\mathbfcal { P } \star$ acting on $\mathbb { R } ^ { n ^ { k } \times d }$ in the standard basis is $P ^ { T \otimes k } \otimes I _ { d }$ and therefore $L ( P ^ { T \otimes k } \otimes I _ { d } ) \mathrm { v e c } ( \mathbf { A } ) = L \mathrm { v e c } ( \mathbf { A } )$ . Since this is true for all $\pmb { \mathsf { A } }$ we have $\begin{array} { r } { ( P ^ { \otimes k } \otimes I _ { d } \otimes I _ { d ^ { \prime } } ) \operatorname { v e c } ( L ) = } \end{array}$ $\mathrm { v e c } ( L )$ , using the properties of the Kronecker product. Equivariance is written as in equation 6, $[ L \mathrm { v e c } ( P \star \mathsf { \pmb { A } } ) ] = P \star [ L \mathrm { v e c } ( \mathsf { \pmb { A } } ) ]$ . In matrix form, the equivariance equation becomes ${ \pmb { L } } ( { \pmb { P } } ^ { T \otimes k } \otimes$ ${ \bar { { \cal I } } } _ { d } ) \mathrm { v e c } ( { \bf A } ) = \bar { ( } P ^ { T \otimes k } \stackrel { \cdot } { \otimes } { \cal I } _ { d ^ { \prime } } ) { \cal L } \mathrm { v e c } ( { \bf A } )$ , since this is true for all $\pmb { \mathsf { A } }$ and using the properties of the Kronecker product again we get to $\mathring { P ^ { \otimes k } } \otimes I _ { d } \otimes P ^ { \otimes k } \otimes I _ { d ^ { \prime } } \ : \mathrm { v e c } ( L ) = \mathrm { v e c } ( L ) .$ . The basis (with biases) to the solution space of these fixed-point equations is defined as follows. We use $a , b \in [ n ] ^ { k }$ , $i , j \in [ d ] , \ i ^ { \prime } , j ^ { \prime } \in [ d ^ { \prime } ] , \ \hat { \lambda } \in [ n ] ^ { k } / \sim , \mu \in [ n ] ^ { 2 k } / \sim$ .
|
| 129 |
+
|
| 130 |
+
$$
|
| 131 |
+
\begin{array} { r l } & { \mathsf { B } _ { a , i , i ^ { \prime } } ^ { \lambda , j , j ^ { \prime } } = \left\{ \begin{array} { l l } { 1 } & { a \in \lambda , \ i = j , \ i ^ { \prime } = j ^ { \prime } } \\ { 0 } & { \mathrm { o t h e r w i s e } } \end{array} \right. ; \quad \mathsf { C } _ { i ^ { \prime } } ^ { j ^ { \prime } } = \left\{ \begin{array} { l l } { 1 } & { i ^ { \prime } = j ^ { \prime } } \\ { 0 } & { \mathrm { o t h e r w i s e } } \end{array} \right. } \\ & { \mathsf { B } _ { a , i , b , i ^ { \prime } } ^ { \mu , j , j ^ { \prime } } = \left\{ \begin{array} { l l } { 1 } & { ( a , b ) \in \mu , \ i = j , \ i ^ { \prime } = j ^ { \prime } } \\ { 0 } & { \mathrm { o t h e r w i s e } } \end{array} \right. ; \quad \mathsf { C } _ { b , i ^ { \prime } } ^ { \lambda , j ^ { \prime } } = \left\{ \begin{array} { l l } { 1 } & { b \in \lambda , \ i ^ { \prime } = j ^ { \prime } } \\ { 0 } & { \mathrm { o t h e r w i s e } } \end{array} \right. } \end{array}
|
| 132 |
+
$$
|
| 133 |
+
|
| 134 |
+
Note that these basis elements are similar to the ones in equation 8 with the difference that we have different basis tensor for each pair of input $j$ and output $j ^ { \prime }$ feature channels.
|
| 135 |
+
|
| 136 |
+
An invariant (equation 10a)/ equivariant (equation 10b) linear layer $L$ including the biases can be written as follows for input $\pmb { \mathsf { A } } \in \mathbb { R } ^ { n ^ { k } \times d }$ :
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\begin{array} { r l } & { L ( \pmb { \mathsf { A } } ) _ { i ^ { \prime } } = \displaystyle \sum _ { a , i } \mathbf { \mathsf { T } } _ { a , i , i ^ { \prime } } \mathbf { A } _ { a , i } + \mathbf { Y } _ { i ^ { \prime } } ; \quad \mathsf { T } = \displaystyle \sum _ { \lambda , j , j ^ { \prime } } w _ { \lambda , j , j ^ { \prime } } \pmb { \mathsf { B } } ^ { \lambda , j , j ^ { \prime } } ; \pmb { \mathsf { Y } } = \displaystyle \sum _ { j ^ { \prime } } b _ { j ^ { \prime } } \pmb { \mathsf { C } } ^ { j ^ { \prime } } } \\ & { L ( \pmb { \mathsf { A } } ) _ { b , i ^ { \prime } } = \displaystyle \sum _ { a , i } \mathbf { \mathsf { T } } _ { a , i , b , i ^ { \prime } } \mathbf { A } _ { a , i } + \mathbf { Y } _ { b , i ^ { \prime } } ; \quad \mathsf { T } = \displaystyle \sum _ { \mu , j , j ^ { \prime } } w _ { \mu , j , j ^ { \prime } } \mathbf { B } ^ { \mu , j , j ^ { \prime } } ; \pmb { \mathsf { Y } } = \displaystyle \sum _ { \lambda , j ^ { \prime } } b _ { \lambda , j ^ { \prime } } \mathbf { C } ^ { \lambda , j ^ { \prime } } } \end{array}
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
where the learnable parameters are $w \in \mathbb { R } ^ { \mathrm { b } ( k ) \times d \times d ^ { \prime } }$ and $b \in \mathbb { R } ^ { d ^ { \prime } }$ for a single linear invariant layer $\mathbb { R } ^ { n ^ { k } \times d } \to \mathbb { R } ^ { d ^ { \prime } }$ ; and it is $w \in \mathbb { R } ^ { \mathrm { b } ( 2 k ) \times d \times d ^ { \prime } }$ and $b \in \mathbb { R } ^ { \mathrm { b } ( k ) \times d ^ { \prime } }$ for a single linear equivariant layer $\mathbb { R } ^ { n ^ { k } \times d } \to \mathbb { R } ^ { n ^ { k } \times d ^ { \prime } }$ . The natural generalization of theorem 1 to include bias and features is therefore:
|
| 143 |
+
|
| 144 |
+
Theorem 2. The space of invariant (equivariant) linear layers $\mathbb { R } ^ { n ^ { k } , d } \to \mathbb { R } ^ { d ^ { \prime } }$ $\mathbb { R } ^ { n ^ { k } \times d } \mathbb { R } ^ { n ^ { k } \times d ^ { \prime } } )$ is of dimension $d d ^ { \prime } \mathrm { b } ( k ) + d ^ { \prime }$ (for equivariant: $d d ^ { \prime } \mathrm { b } ( 2 k ) + \bar { d ^ { \prime } } \mathrm { b } ( k ) )$ with basis elements defined in equation $^ { g }$ ; equation 10a (10b) show the general form of such layers.
|
| 145 |
+
|
| 146 |
+
Since, by similar arguments to proposition 2, the purely linear parts $\mathbf { B }$ and biases $\circ$ in equation 9 are independent solutions to the relevant fixed-point equations, theorem 2 will be proved if their number equals the dimension of the solution space of these fixed-point equations, namely $d d ^ { \prime } \mathrm { b } ( k )$ for purely linear part and $d ^ { \prime }$ for bias in the invariant case, and $d d ^ { \prime } \mathrm { b } ( \mathrm { 2 } k )$ for purely linear and $d ^ { \prime } \mathrm { b } ( k )$ for bias in the equivariant case. This can be shown by repeating the arguments of the proof of proposition 2 slightly adapted to this case, or by a combinatorial identity we show in Appendix $\mathbf { B }$ .
|
| 147 |
+
|
| 148 |
+
For example, figure 1 depicts the 15 basis elements for linear equivariant layers $\mathbb { R } ^ { n \times n } \to \mathbb { R } ^ { n \times n }$ taking as input edge-value (order-2) tensor data $\ b { \sf A } \in \mathbb { R } ^ { n \times n }$ and outputting the same dimension tensor. The basis for the purely linear part are shown as $n ^ { 2 } \times n ^ { 2 }$ matrices while the bias part as $n \times n$ matrices (far right); the size of the node set is $| \mathbb { V } | = n = 5$ .
|
| 149 |
+
|
| 150 |
+
Mixed order equivariant layers. Another useful generalization of order equivariant linear layers is to linear layers between different order tensor layers, that is, $L : \mathbb { R } ^ { n ^ { k } } \to \bar { \mathbb { R } } ^ { n ^ { l } }$ , where $l \neq k$ . For example, one can think of a layer mapping an adjacency matrix to per-node features. For simplicity we will discuss the purely linear scalar-valued case, however generalization to include bias and/or general feature vectors can be done as discussed above. Consider the matrix $\pmb { L } \in \mathbb { R } ^ { n ^ { l } \times n ^ { k } }$ representing the linear layer $L$ , using the renumbering operator, $P \star$ , order equivariance is equivalent to $[ L \mathrm { v e c } ( P \star \mathsf { \pmb A } ) ] = P \star [ L \mathrm { v e c } ( \mathsf { \pmb A } ) ]$ . Note that while this equation looks identical to equation 6 it is nevertheless different in the sense that the $P \star$ operator in the l.h.s. of this equation acts on $k$ -order tensors while the one on the r.h.s. acts on $l$ -order tensor. Still, we can transform this equation to a matrix equation as before by remembering that $P ^ { T \otimes k }$ is the matrix representation of the renumbering operator $P \star$ acting on $k$ -tensors in the standard basis. Therefore, repeating the arguments in proof of proposition 1, equivariance is equivalent to $P ^ { \otimes ( k + l ) } \mathrm { v e c } ( L ) = \mathrm { v e c } ( L )$ , for all permutation matrices $_ { r }$ . This equation is solved as in section 3.1. The corresponding bases to such equivariant layers are computed as in equation 9b, with the only difference that now $\mathbf { a } \in [ n ] ^ { k }$ , $b \in { \overline { { [ n ] } } } ^ { l }$ , an d $\mu \doteq [ n ] ^ { k + l } / \sim$ .
|
| 151 |
+
|
| 152 |
+
# 4 EXPERIMENTS
|
| 153 |
+
|
| 154 |
+
Implementation details. We implemented our method in Tensorflow (Abadi et al., 2016). The equivariant linear basis was implemented efficiently using basic row/column/diagonal summation operators, see appendix A for details. The networks we used are composition of $1 - 4$ equivariant linear layers with ReLU activation between them for the equivariant function setting. For invariant function setting we further added a max over the invariant basis and $1 - 3$ fully-connected layers with ReLU activations.
|
| 155 |
+
|
| 156 |
+
Table 1: Comparison to baseline methods on synthetic experiments.
|
| 157 |
+
|
| 158 |
+
<table><tr><td></td><td colspan="3">Symmetric projection</td><td colspan="3">Diagonal extraction</td><td colspan="4">Max singular vector</td><td colspan="3">Trace</td></tr><tr><td>#Layers</td><td>1</td><td>2</td><td>3</td><td>1</td><td>2</td><td>3</td><td>1</td><td>2</td><td>3</td><td>4</td><td>1</td><td>2</td><td>3</td></tr><tr><td>Trivial predictor Hartford et al.</td><td>4.17</td><td>4.17</td><td>4.17</td><td>0.21</td><td>0.21</td><td>0.21</td><td>0.025</td><td>0.025</td><td>0.025</td><td>0.025</td><td>333.33</td><td>333.33</td><td>333.33</td></tr><tr><td></td><td>2.09</td><td>2.09</td><td>2.09</td><td>0.81</td><td>0.81</td><td>0.81</td><td>0.043</td><td>0.044</td><td>0.043</td><td>0.043</td><td>316.22</td><td>311.55</td><td>307.97</td></tr><tr><td>Ours</td><td>1E-05</td><td>7E-06</td><td>2E-05</td><td>8E-06</td><td>7E-06</td><td>1E-04</td><td>0.015</td><td>0.0084</td><td>0.0054</td><td>0.0016</td><td>0.005</td><td>0.001</td><td>0.003</td></tr></table>
|
| 159 |
+
|
| 160 |
+
Synthetic datasets. We tested our method on several synthetic equivariant and invariant graph functions that highlight the differences in expressivity between our linear basis and the basis of Hartford et al. (2018). Given an input matrix data $A \in \mathbb { R } ^ { n \times n }$ we considered: (i) projection onto the symmetric matrices $\scriptstyle { \frac { 1 } { 2 } } ( A + A ^ { T } )$ ; (ii) diagonal extraction $\operatorname { l i a g } ( \operatorname { d i a g } ( A ) )$ (keeps only the diagonal and plugs zeros elsewhere); (iii) computing the maximal right singular vector arg $\operatorname* { m a x } _ { \| \pmb { v } \| _ { 2 } = 1 } \| \pmb { A } \pmb { v } \| _ { 2 }$ ; and (iv) computing the trace $\operatorname { t r } ( A )$ . Tasks (i)-(iii) are equivariant while task (iv) is invariant. We created accordingly 4 datasets with $1 0 K$ train and $1 K$ test examples of $4 0 \times 4 0$ matrices; for tasks (i), (ii), (iv) we used i.i.d. random matrices with uniform distribution in $[ 0 , 1 0 ]$ ; we used mean-squared error (MSE) as loss; for task (iii) we random matrices with uniform distribution of singular values in $[ 0 , 0 . 5 ]$ and spectral $\mathrm { g a p } \geq 0 . 5$ ; due to sign ambiguity in this task we used cosine loss of the form $l ( \pmb { x } , \pmb { y } ) = 1 - \left. \pmb { x } / \left\| \pmb { x } \right\| , \pmb { y } / \left\| \pmb { y } \right\| \right. ^ { 2 }$ .
|
| 161 |
+
|
| 162 |
+
We trained networks with 1, 2, and 3 hidden layers with 8 feature channels each and a single fullyconnected layer. Both our models as well as Hartford et al. (2018) use the same architecture but with different bases for the linear layers. Table 1 logs the best mean-square error of each method over a set of hyper-parameters. We add the MSE for the trivial mean predictor.
|
| 163 |
+
|
| 164 |
+
Table 2: Generalization.
|
| 165 |
+
|
| 166 |
+
<table><tr><td></td><td>30</td><td>40</td><td>50</td></tr><tr><td>sym</td><td>0.0053</td><td>3.8E-05</td><td>0.0013</td></tr><tr><td>svd</td><td>0.0108</td><td>0.0084</td><td>0.0096</td></tr><tr><td>diag</td><td>0.0150</td><td>1.5E-05</td><td>0.0055</td></tr></table>
|
| 167 |
+
|
| 168 |
+
This experiment emphasizes simple cases in which the additional parameters in our model, with respect to Hartford et al. (2018), are needed. We note that Hartford et al. (2018) target a different scenario where the permutations acting on the rows and columns of the input matrix are not necessarily the same. The assumption taken in this paper, namely, that the same permutation acts on both rows and columns, gives rise to additional parameters that are associated with the diagonal and with the transpose of the matrix (for a complete list of layers for the $k = 2$ case see appendix A). In case of an input matrix that represents graphs, these parameters can be understood as parameters that control self-edges or node features, and incoming/outgoing edges in a different way. Table 2 shows the result of applying the learned equivariant networks from the above experiment to graphs (matrices) of unseen sizes of $n = 3 0$ and $n = 5 0$ . Note, that although the network was trained on a fixed size, the network provides plausible generalization to different size graphs. We note that the generalization of the invariant task of computing the trace did not generalize well to unseen sizes and probably requires training on different sizes as was done in the datasets below.
|
| 169 |
+
|
| 170 |
+
Table 3: Graph Classification Results.
|
| 171 |
+
|
| 172 |
+
<table><tr><td>dataset</td><td>MUTAG</td><td>PTC</td><td>PROTEINS</td><td>NCI1</td><td>NCI109</td><td>COLLAB</td><td>IMDB-B</td><td>IMDB-M</td></tr><tr><td>size</td><td>188</td><td>344</td><td>1113</td><td>4110</td><td>4127</td><td>5000</td><td>1000</td><td>1500</td></tr><tr><td>classes</td><td>2</td><td>2</td><td>2</td><td>2</td><td>2</td><td>3</td><td>2</td><td>3</td></tr><tr><td>avg node #</td><td>17.9</td><td>25.5</td><td>39.1</td><td>29.8</td><td>29.6</td><td>74.4</td><td>19.7</td><td>13</td></tr><tr><td colspan="9">Results</td></tr><tr><td>DGCNN</td><td>85.83±1.7</td><td>58.59±2.5</td><td>75.54±0.9</td><td>74.44±0.5</td><td>NA</td><td>73.76±0.5</td><td>70.03±0.9</td><td>47.83±0.9</td></tr><tr><td>PSCN (k=10)</td><td>88.95±4.4</td><td>62.29±5.7</td><td>75±2.5</td><td>76.34±1.7</td><td>NA</td><td>72.6±2.2</td><td>71±2.3</td><td>45.23±2.8</td></tr><tr><td>DCNN</td><td>NA</td><td>NA</td><td>61.29±1.6</td><td>56.61± 1.0</td><td>NA</td><td>52.11±0.7</td><td>49.06±1.4</td><td>33.49±1.4</td></tr><tr><td>ECC</td><td>76.11</td><td>NA</td><td>NA</td><td>76.82</td><td>75.03</td><td>NA</td><td>NA</td><td>NA</td></tr><tr><td>DGK</td><td>87.44±2.7</td><td>60.08±2.6</td><td>75.68±0.5</td><td>80.31±0.5</td><td>80.32±0.3</td><td>73.09±0.3</td><td>66.96±0.6</td><td>44.55±0.5</td></tr><tr><td>DiffPool</td><td>NA</td><td>NA</td><td>78.1</td><td>NA</td><td>NA</td><td>75.5</td><td>NA</td><td>NA</td></tr><tr><td>CCN</td><td>91.64±7.2</td><td>70.62±7.0</td><td>NA</td><td>76.27±4.1</td><td>75.54±3.4</td><td>NA</td><td>NA</td><td>NA</td></tr><tr><td>GK</td><td>81.39±1.7</td><td>55.65±0.5</td><td>71.39±0.3</td><td>62.49±0.3</td><td>62.35±0.3</td><td>NA</td><td>NA</td><td>NA</td></tr><tr><td>RW</td><td>79.17±2.1</td><td>55.91±0.3</td><td>59.57±0.1</td><td>>3days</td><td>NA</td><td>NA</td><td>NA</td><td>NA</td></tr><tr><td>PK</td><td>76±2.7</td><td>59.5±2.4</td><td>73.68±0.7</td><td>82.54±0.5</td><td>NA</td><td>NA</td><td>NA</td><td>NA</td></tr><tr><td>WL</td><td>84.11±1.9</td><td>57.97±2.5</td><td>74.68±0.5</td><td>84.46±0.5</td><td>85.12±0.3</td><td>NA</td><td>NA</td><td>NA</td></tr><tr><td>FGSD</td><td>92.12</td><td>62.80</td><td>73.42</td><td>79.80</td><td>78.84</td><td>80.02</td><td>73.62</td><td>52.41</td></tr><tr><td>AWE-DD</td><td>NA</td><td>NA</td><td>NA</td><td>NA</td><td>NA</td><td>73.93±1.9</td><td>74.45 ±5.8</td><td>51.54 ± 3.6</td></tr><tr><td>AWE-FB</td><td>87.87±9.7</td><td>NA</td><td>NA</td><td>NA</td><td>NA</td><td>70.99 ± 1.4</td><td>73.13 ±3.2</td><td>51.58 ± 4.6</td></tr><tr><td>ours</td><td>84.61±10</td><td>59.47±7.3</td><td>75.19±4.3</td><td>73.71±2.6</td><td>72.48±2.5</td><td>77.92±1.7</td><td>71.27±4.5</td><td>48.55±3.9</td></tr></table>
|
| 173 |
+
|
| 174 |
+
Graph classification. We tested our method on standard benchmarks of graph classification. We use 8 different real world datasets from the benchmark of Yanardag & Vishwanathan (2015): five of these datasets originate from bioinformatics while the other three come from social networks. In all datasets the adjacency matrix of each graph is used as input and a categorial label is assigned as output. In the bioinformatics datasets node labels are also provided as inputs. These node labels can be used in our framework by placing their 1-hot representations on the diagonal of the input.
|
| 175 |
+
|
| 176 |
+
Table 3 specifies the results for our method compared to state-of-the-art deep and non-deep graph learning methods. We follow the evaluation protocol including the 10-fold splits of Zhang et al. (2018). For each dataset we selected learning and decay rates on one random fold. In all experiments we used a fixed simple architecture of 3 layers with (16, 32, 256) features accordingly. The last equivariant layer is followed by an invariant max layer according to the invariant basis. We then add two fully-connected hidden layers with (512, 256) features.
|
| 177 |
+
|
| 178 |
+
We compared our results to seven deep learning methods: DGCNN (Zhang et al., 2018), PSCN (Niepert et al., 2016), DCNN (Atwood & Towsley, 2016), ECC (Simonovsky & Komodakis, 2017), DGK (Yanardag & Vishwanathan, 2015), DiffPool (Ying et al., 2018) and CCN (Kondor et al., 2018). We also compare our results to four popular graph kernel methods: Graphlet Kernel (GK) (Shervashidze et al., 2009),Random Walk Kernel (RW) (Vishwanathan et al., 2010), Propagation Kernel (PK) (Neumann et al., 2016), and Weisfeiler-lehman kernels (WL) (Shervashidze et al., 2011) and two recent feature-based methods: Family of Graph Spectral Distance (FGSD) (Verma & Zhang, 2017) and Anonymous Walk Embeddings (AWE) (Ivanov & Burnaev, 2018). Our method achieved results comparable to the state-of-the-art on the three social networks datasets, and slightly worse results than state-of-the-art on the biological datasets.
|
| 179 |
+
|
| 180 |
+
# 5 GENERALIZATIONS TO MULTI-NODE SETS
|
| 181 |
+
|
| 182 |
+
Lastly, we provide a generalization of our framework to data that is given on tuples of nodes from a collection of node sets $\mathbb { R } ^ { n _ { 1 } ^ { k _ { 1 } } \times n _ { 2 } ^ { k _ { 2 } } \times \dots \times n _ { m } ^ { k _ { m } } }$ . We characterize invariant linear layers $\mathbb { V } _ { 1 } , \mathbb { V } _ { 2 } , \ldots , \mathbb { V } _ { m }$ of sizes $L : \mathbb { R } ^ { n _ { 1 } ^ { k _ { 1 } } \times \dots \times n _ { m } ^ { k _ { m } } } \mathbb { R }$ $n _ { 1 } , n _ { 2 } , \ldots , n _ { m }$ (resp.), namely and equivariant ${ \textbf { \textsf { A } } } \in$ linear layer $L : \mathbb { R } ^ { n _ { 1 } ^ { k _ { 1 } } \times \dots \times n _ { m } ^ { k _ { m } } } \mathbb { R } ^ { n _ { 1 } ^ { l _ { 1 } } \times \dots \times n _ { m } ^ { l _ { m } } }$ , where for simplicity we do not discuss features that can be readily added as discussed in section 3. Note that the case of $k _ { i } = l _ { i } = 1$ for all $i = 1 , \ldots , m$ is treated in Hartford et al. (2018). The reordering operator now is built out of permutation matrices $P _ { i } \in \mathbb { R } ^ { n _ { i } \times n _ { i } }$ ${ p } _ { i }$ denotes the permutation), $i = 1 , \ldots , m$ , denoted $P _ { 1 : m } \star$ , and defined as follows: the $( p _ { 1 } ( { \pmb a } _ { 1 } ) , p _ { 2 } ( { \pmb a } _ { 2 } ) , \dots , p _ { m } ( { \pmb a } _ { m } ) )$ -th entry of the tensor $P _ { 1 : m } \star \pmb { \mathsf { A } }$ , where $\mathbf { a } _ { i } \in [ n _ { i } ] ^ { k _ { i } }$ is defined to be the $( \pmb { a } _ { 1 } , \pmb { a } _ { 2 } , \dots , \pmb { a } _ { m } )$ -th entry of the tensor $\pmb { \mathsf { A } }$ . Rewriting the invariant and equivariant equations, i.e., equation 5, 6, in matrix format, similarly to before, we get the fixed-point equations: $M \mathrm { v e c } ( { \cal L } ) = \mathrm { v e c } ( { \cal L } )$ for invariant, and $M \otimes M \mathrm { v e c } ( L ) = \mathrm { v e c } ( L )$ for equivariant, where $M = P _ { 1 } ^ { \otimes k _ { 1 } } \otimes \cdot \cdot \cdot \otimes P _ { m } ^ { \otimes k _ { m } }$ . The solution of these equations would be linear combinations of basis tensor similar to equation 9 of the form
|
| 183 |
+
|
| 184 |
+
$$
|
| 185 |
+
\begin{array} { r } { \mathsf { t } : \mathsf { B } _ { a _ { 1 } , \ldots , a _ { m } } ^ { \lambda _ { 1 } , \ldots , \lambda _ { m } } = \left\{ \begin{array} { l l } { 1 } & { a _ { i } \in \lambda _ { i } , \forall i } \\ { 0 } & { \mathrm { o t h e r w i s e } } \end{array} \right. ; \quad \mathrm { e q u i v a r i a n t : } \ \mathsf { B } _ { a _ { 1 } , \ldots , a _ { m } , b _ { 1 } , \ldots , b _ { m } } ^ { \mu _ { 1 } , \ldots , \mu _ { m } } = \left\{ \begin{array} { l l } { 1 } & { ( a _ { i } , b _ { i } ) \in \mu _ { i } , \forall i } \\ { 0 } & { \mathrm { o t h e r w i s e } } \end{array} \right. } \end{array}
|
| 186 |
+
$$
|
| 187 |
+
|
| 188 |
+
where $\lambda _ { i } \in [ n _ { i } ] ^ { k _ { i } } , \mu _ { i } \in [ n _ { i } ] ^ { k _ { i } + l _ { i } } , { \pmb a } \in [ n _ { i } ] ^ { k _ { i } } , { \pmb b } _ { i } \in [ n _ { i } ] ^ { l _ { i } }$ . The number of these tensors is $\textstyle \prod _ { i = 1 } ^ { m } \mathrm { b } ( i )$ for invariant layers and $\textstyle \prod _ { i = 1 } ^ { m } \mathrm { b } ( k _ { i } + l _ { i } )$ i=1 for equivariant layers. Since these are all linear independent (pairwise disjoint support of non-zero entries) we need to show that their number equal the dimension of the solution of the relevant fixed-point equations above. This can be done again by similar arguments to the proof of proposition 2 or as shown in appendix B. To summarize:
|
| 189 |
+
|
| 190 |
+
Theorem 3. The linear space of invariant linear layers L : Rnk11 × $L : \mathbb { R } ^ { n _ { 1 } ^ { k _ { 1 } } \times n _ { 2 } ^ { k _ { 2 } } \times \dots \times n _ { m } ^ { k _ { m } } } \mathbb { R }$ is of dimension $\textstyle \prod _ { i = 1 } ^ { m } { \mathrm { b } ( k _ { i } ) }$ . The equivariant linear layers $L : \mathbb { R } ^ { n _ { 1 } ^ { k _ { 1 } } \times n _ { 2 } ^ { k _ { 2 } } \times \dots \times n _ { m } ^ { k _ { m } } } \mathbb { R } ^ { n _ { 1 } ^ { l _ { 1 } } \times n _ { 2 } ^ { l _ { 2 } } \times \dots \times n _ { m } ^ { l _ { m } } }$ has dimension $\textstyle \prod _ { i = 1 } ^ { m } \ b ( k _ { i } + l _ { i } )$ . Orthogonal bases for these layers are listed in equation $1 l$ .
|
| 191 |
+
|
| 192 |
+
# ACKNOWLEDGMENTS
|
| 193 |
+
|
| 194 |
+
This research was supported in part by the European Research Council (ERC Consolidator Grant, ”LiftMatch” 771136) and the Israel Science Foundation (Grant No. 1830/17).
|
| 195 |
+
|
| 196 |
+
# REFERENCES
|
| 197 |
+
|
| 198 |
+
Mart´ın Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, et al. Tensorflow: a system for largescale machine learning. In OSDI, volume 16, pp. 265–283, 2016.
|
| 199 |
+
|
| 200 |
+
James Atwood and Don Towsley. Diffusion-convolutional neural networks. In Advances in Neural Information Processing Systems, pp. 1993–2001, 2016.
|
| 201 |
+
|
| 202 |
+
Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral Networks and Locally Connected Networks on Graphs. pp. 1–14, 2013. URL http://arxiv.org/abs/1312. 6203.
|
| 203 |
+
|
| 204 |
+
Taco Cohen and Max Welling. Group equivariant convolutional networks. In International conference on machine learning, pp. 2990–2999, 2016a.
|
| 205 |
+
|
| 206 |
+
Taco S. Cohen and Max Welling. Steerable CNNs. (1990):1–14, 2016b. URL http://arxiv. org/abs/1612.08498.
|
| 207 |
+
|
| 208 |
+
Taco S Cohen, Mario Geiger, Jonas Kohler, and Max Welling. Spherical cnns. ¨ arXiv preprint arXiv:1801.10130, 2018.
|
| 209 |
+
|
| 210 |
+
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. 3844–3852, 2016.
|
| 211 |
+
|
| 212 |
+
David K Duvenaud, Dougal Maclaurin, Jorge Iparraguirre, Rafael Bombarell, Timothy Hirzel, Alan´ Aspuru-Guzik, and Ryan P Adams. Convolutional networks on graphs for learning molecular fingerprints. In Advances in neural information processing systems, pp. 2224–2232, 2015.
|
| 213 |
+
|
| 214 |
+
William Fulton and Joe Harris. Representation theory: a first course, volume 129. Springer Science & Business Media, 2013.
|
| 215 |
+
|
| 216 |
+
Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. In International Conference on Machine Learning, pp. 1263–1272, 2017.
|
| 217 |
+
|
| 218 |
+
Marco Gori, Gabriele Monfardini, and Franco Scarselli. A new model for earning in raph domains. Proceedings of the International Joint Conference on Neural Networks, 2(January):729– 734, 2005. doi: 10.1109/IJCNN.2005.1555942.
|
| 219 |
+
|
| 220 |
+
Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Advances in Neural Information Processing Systems, pp. 1024–1034, 2017.
|
| 221 |
+
Jason S. Hartford, Devon R. Graham, Kevin Leyton-Brown, and Siamak Ravanbakhsh. Deep models of interactions across sets. In ICML, 2018.
|
| 222 |
+
Mikael Henaff, Joan Bruna, and Yann LeCun. Deep Convolutional Networks on Graph-Structured Data. (June), 2015. ISSN 1506.05163. URL http://arxiv.org/abs/1506.05163.
|
| 223 |
+
Kurt Hornik. Approximation capabilities of multilayer feedforward networks. Neural networks, 4 (2):251–257, 1991.
|
| 224 |
+
Sergey Ivanov and Evgeny Burnaev. Anonymous walk embeddings. arXiv preprint arXiv:1805.11921, 2018.
|
| 225 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016.
|
| 226 |
+
Risi Kondor and Shubhendu Trivedi. On the generalization of equivariance and convolution in neural networks to the action of compact groups. arXiv preprint arXiv:1802.03690, 2018.
|
| 227 |
+
Risi Kondor, Hy Truong Son, Horace Pan, Brandon Anderson, and Shubhendu Trivedi. Covariant compositional networks for learning graphs. arXiv preprint arXiv:1801.02144, 2018.
|
| 228 |
+
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.
|
| 229 |
+
Yann LeCun, Bernhard Boser, John S Denker, Donnie Henderson, Richard E Howard, Wayne Hubbard, and Lawrence D Jackel. Backpropagation applied to handwritten zip code recognition. Neural computation, 1(4):541–551, 1989.
|
| 230 |
+
Ron Levie, Federico Monti, Xavier Bresson, and Michael M. Bronstein. CayleyNets: Graph Convolutional Neural Networks with Complex Rational Spectral Filters. pp. 1–12, 2017. ISSN 1063-6919. doi: 10.1109/CVPR.2017.576. URL http://arxiv.org/abs/1705.07664.
|
| 231 |
+
Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard Zemel. Gated Graph Sequence Neural Networks. (1):1–20, 2015. ISSN 10797114. doi: 10.1103/PhysRevLett.116.082003. URL http://arxiv.org/abs/1511.05493.
|
| 232 |
+
Federico Monti, Davide Boscaini, Jonathan Masci, Emanuele Rodola, Jan Svoboda, and Michael M Bronstein. Geometric deep learning on graphs and manifolds using mixture model cnns. In Proc. CVPR, volume 1, pp. 3, 2017.
|
| 233 |
+
Marion Neumann, Roman Garnett, Christian Bauckhage, and Kristian Kersting. Propagation kernels: efficient graph kernels from propagated information. Machine Learning, 102(2):209–245, 2016.
|
| 234 |
+
Mathias Niepert, Mohamed Ahmed, and Konstantin Kutzkov. Learning Convolutional Neural Networks for Graphs. 2016. ISSN 1938-7228.
|
| 235 |
+
Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. Proc. Computer Vision and Pattern Recognition (CVPR), IEEE, 1(2):4, 2017.
|
| 236 |
+
Siamak Ravanbakhsh, Jeff Schneider, and Barnabas Poczos. Equivariance through parametersharing. arXiv preprint arXiv:1702.08389, 2017.
|
| 237 |
+
Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. Neural Networks, IEEE Transactions on, 20(1):61–80, 2009. ISSN 1045-9227. doi: 10.1109/TNN.2008.2005605.
|
| 238 |
+
Nino Shervashidze, SVN Vishwanathan, Tobias Petri, Kurt Mehlhorn, and Karsten Borgwardt. Efficient graphlet kernels for large graph comparison. In Artificial Intelligence and Statistics, pp. 488–495, 2009.
|
| 239 |
+
|
| 240 |
+
Nino Shervashidze, Pascal Schweitzer, Erik Jan van Leeuwen, Kurt Mehlhorn, and Karsten M Borgwardt. Weisfeiler-lehman graph kernels. Journal of Machine Learning Research, 12(Sep):2539– 2561, 2011.
|
| 241 |
+
|
| 242 |
+
Martin Simonovsky and Nikos Komodakis. Dynamic edge-conditioned filters in convolutional neural networks on graphs. In Proceedings - 30th IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2017, 2017. ISBN 9781538604571. doi: 10.1109/CVPR.2017.11.
|
| 243 |
+
|
| 244 |
+
Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Li ´ o, and Yoshua \` Bengio. Graph Attention Networks. pp. 1–12, 2017. URL http://arxiv.org/abs/1710. 10903.
|
| 245 |
+
|
| 246 |
+
Saurabh Verma and Zhi-Li Zhang. Hunt for the unique, stable, sparse and fast feature learning on graphs. In Advances in Neural Information Processing Systems, pp. 88–98, 2017.
|
| 247 |
+
|
| 248 |
+
S Vichy N Vishwanathan, Nicol N Schraudolph, Risi Kondor, and Karsten M Borgwardt. Graph kernels. Journal of Machine Learning Research, 11(Apr):1201–1242, 2010.
|
| 249 |
+
|
| 250 |
+
Maurice Weiler, Mario Geiger, Max Welling, Wouter Boomsma, and Taco Cohen. 3D Steerable CNNs: Learning Rotationally Equivariant Features in Volumetric Data. 2018. URL http: //arxiv.org/abs/1807.02547.
|
| 251 |
+
|
| 252 |
+
Pinar Yanardag and S.V.N. Vishwanathan. Deep Graph Kernels. In Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining - KDD ’15, 2015. ISBN 9781450336642. doi: 10.1145/2783258.2783417.
|
| 253 |
+
|
| 254 |
+
Dmitry Yarotsky. Universal approximations of invariant maps by neural networks. arXiv preprint arXiv:1804.10306, 2018.
|
| 255 |
+
|
| 256 |
+
Rex Ying, Jiaxuan You, Christopher Morris, Xiang Ren, William L. , and Jure Leskovec. Hierarchical Graph Representation Learning with Differentiable Pooling. 2018. doi: 10.1145/nnnnnnn. nnnnnnn. URL http://arxiv.org/abs/1806.08804.
|
| 257 |
+
|
| 258 |
+
Manzil Zaheer, Satwik Kottur, Siamak Ravanbakhsh, Barnabas Poczos, Ruslan R Salakhutdinov, and Alexander J Smola. Deep sets. In Advances in Neural Information Processing Systems, pp. 3391–3401, 2017.
|
| 259 |
+
|
| 260 |
+
Muhan Zhang, Zhicheng Cui, Marion Neumann, and Yixin Chen. An end-to-end deep learning architecture for graph classification. In Proceedings of AAAI Conference on Artificial Inteligence, 2018.
|
| 261 |
+
|
| 262 |
+
# APPENDIX A EFFICIENT IMPLEMENTATION OF LAYERS
|
| 263 |
+
|
| 264 |
+
For fast execution of order-2 layers we implemented the following 15 operations which can be easily shown to span the basis discussed in the paper. We denote by $\mathbf { 1 } \in \mathbb { R } ^ { n }$ the vector of all ones.
|
| 265 |
+
|
| 266 |
+
1. The identity and transpose operations: $L ( A ) = A$ , $L ( A ) = A ^ { T }$ .
|
| 267 |
+
2. The diag operation: $L ( A ) = \mathrm { d i a g } ( \mathrm { d i a g } ( A ) )$ .
|
| 268 |
+
3. Sum of rows replicated on rows/ columns/ diagonal: $L ( A ) = A \mathbf { 1 1 } ^ { T } , L ( A ) = \mathbf { 1 } ( A \mathbf { 1 } ) ^ { T }$ , $L ( A ) = \mathrm { d i a g } ( { \bar { A } } \mathbf { 1 } )$ .
|
| 269 |
+
4. Sum of columns replicated on rows/ columns/ diagonal: $L ( A ) \ = \ A ^ { T } \mathbf { 1 } \mathbf { 1 } ^ { T }$ , $L ( A ) =$ $\mathbf { 1 } ( A ^ { T } \mathbf { 1 } ) ^ { T } , L ( A ) = { \mathrm { { d i a g } } } ( A ^ { T } \mathbf { 1 } )$ .
|
| 270 |
+
5. Sum of all elements replicated on all matrix/ diagonal: $L ( A ) = ( \mathbf { 1 } ^ { T } A \mathbf { 1 } ) \cdot \mathbf { 1 } \mathbf { 1 } ^ { T } ,$ $L ( A ) =$ $( \mathbf { 1 } ^ { T } A \mathbf { 1 } ) \cdot \mathrm { { d i a g } ( \mathbf { 1 } ) }$ .
|
| 271 |
+
6. Sum of diagonal elements replicated on all matrix/diagonal: $L ( A ) = ( \mathbf { 1 } ^ { T } \mathrm { d i a g } ( A ) ) \cdot \mathbf { 1 } \mathbf { 1 } ^ { T }$ , $L ( A ) = ( \bar { \mathbf { 1 } ^ { T } } \mathrm { d i a g } ( A ) ) \cdot \mathrm { d i a g } \bar { ( } \mathbf { 1 } )$ .
|
| 272 |
+
7. Replicate diagonal elements on rows/columns: $L ( A ) = \mathrm { d i a g } ( A ) \mathbf { 1 } ^ { T }$ , $L ( A ) = \mathbf { 1 } \mathrm { d i a g } ( A ) ^ { T }$ .
|
| 273 |
+
|
| 274 |
+
We normalize each operation to have unit max operator norm. We note that in case the input matrix is symmetric, our basis reduces to 11 elements in the first layer. If we further assume the matrix has zero diagonal we get a 6 element basis in the first layer. In both cases our model is more expressive than the 4 element basis of Hartford et al. (2018) and as the output of the first layer (or other inner states) need not be symmetric nor have zero diagonal the deeper layers can potentially make good use of the full 15 element basis.
|
| 275 |
+
|
| 276 |
+
# APPENDIX B INVARIANT AND EQUIVARIANT SUBSPACE DIMENSIONS
|
| 277 |
+
|
| 278 |
+
We prove a useful combinatorial fact as a corollary of proposition 2. This fact will be used later to easily compute the dimensions of more general spaces of invariant and equivariant linear layers. We use the fact that if $V$ is a representation of a finite group $G$ then
|
| 279 |
+
|
| 280 |
+
$$
|
| 281 |
+
\phi = { \frac { 1 } { | G | } } \sum _ { g \in G } g \in { \mathrm { E n d } } ( V )
|
| 282 |
+
$$
|
| 283 |
+
|
| 284 |
+
is a projection onto $V ^ { G } = \{ \pmb { v } \in V | g \pmb { v } = \pmb { v } , \forall g \in G \}$ , the subspace of fixed points in $V$ under the action of $G$ , and consequently that $\operatorname { t r } ( \phi ) = \dim ( V ^ { G } )$ (see Fulton & Harris (2013) for simple proofs).
|
| 285 |
+
|
| 286 |
+
Proposition 3. The following formula holds:
|
| 287 |
+
|
| 288 |
+
$$
|
| 289 |
+
{ \frac { 1 } { n ! } } \sum _ { P \in \Pi _ { n } } t r ( P ) ^ { k } = \mathrm { b } ( k ) ,
|
| 290 |
+
$$
|
| 291 |
+
|
| 292 |
+
where $\Pi _ { n }$ is the matrix permutation group of dimensions $n \times n$ .
|
| 293 |
+
|
| 294 |
+
Proof. In our case, the vector space is the space of order- $k$ tensors and the group acting on it is the matrix group $G = \left\{ P ^ { \otimes k } \mid P \in \overline { { \Pi } } _ { m } \right\}$ .
|
| 295 |
+
|
| 296 |
+
$$
|
| 297 |
+
\dim ( V ^ { G } ) = \operatorname { t r } ( \phi ) = { \frac { 1 } { | G | } } \sum _ { g \in G } \operatorname { t r } ( g ) = { \frac { 1 } { n ! } } \sum _ { P \in \Pi _ { n } } \operatorname { t r } ( P ^ { \otimes k } ) = { \frac { 1 } { n ! } } \sum _ { P \in \Pi _ { n } } \operatorname { t r } ( P ) ^ { k } ,
|
| 298 |
+
$$
|
| 299 |
+
|
| 300 |
+
where we used the multiplicative law of the trace with respect to Kronecker product. Now we use proposition 2 noting that in this case $V ^ { G }$ is the solution space of the fixed-point equations. Therefore, $\mathrm { d i m } ( V ^ { G } ) = \mathrm { b } ( k )$ and the proof is finished. □
|
| 301 |
+
|
| 302 |
+
Recall that for a permutation matrix $_ { r }$ , $\operatorname { t r } ( P ) = | \{ i \in [ n ]$ s.t. $_ { r }$ fixes $e _ { i } \} |$ . Using this, we can interpret the equation in proposition 3 as the $k$ -th moment of a random variable counting the number of fixed points of a permutation, with uniform distribution over the permutation group. Proposition 3 proves that the $k$ -th moment of this random variable is the $k$ -th Bell number.
|
| 303 |
+
|
| 304 |
+
We can now use proposition 3 to calculate the dimensions of two linear layer spaces: (i) Equivariant layers acting on order- $k$ tensors with features (as in 3); and (ii) multi-node sets (as in section 5).
|
| 305 |
+
|
| 306 |
+
Theorem 2. The space of invariant (equivariant) linear layers $\mathbb { R } ^ { n ^ { k } , d } \to \mathbb { R } ^ { d ^ { \prime } }$ $\mathbb { R } ^ { n ^ { k } \times d } \mathbb { R } ^ { n ^ { k } \times d ^ { \prime } } )$ is of dimension $d d ^ { \prime } \mathrm { b } ( k ) + d ^ { \prime }$ (for equivariant: $d d ^ { \prime } \mathrm { b } ( 2 k ) + d ^ { \prime } \mathrm { b } ( k ) )$ with basis elements defined in equation $^ { 9 }$ ; equations 10a (10b) show the general form of such layers.
|
| 307 |
+
|
| 308 |
+
Proof. We prove the dimension formulas for the invariant case. The equivariant case is proved similarly. The solution space for the fixed point equations is the set $V ^ { G }$ for the matrix group $G =$ $\left\{ P ^ { \otimes k } { \overset { \cdot } { \otimes } } I _ { d } \otimes I _ { d ^ { \prime } } | P \in { \overset { \cdot } { \Pi } } _ { n } \right\}$ . Using the projection formula 12 we get that the dimension of the solution subspace, which is the space of invariant linear layers, can be computed as follows:
|
| 309 |
+
|
| 310 |
+
$$
|
| 311 |
+
\dim ( V ^ { G } ) = { \frac { 1 } { n ! } } \sum _ { P \in \Pi _ { n } } \operatorname { t r } ( P ) ^ { k } \operatorname { t r } ( I _ { d } ) \operatorname { t r } ( I _ { d ^ { \prime } } ) = \left( { \frac { 1 } { n ! } } \sum _ { P \in \Pi _ { n } } \operatorname { t r } ( P ) ^ { k } \right) \operatorname { t r } ( I _ { d } ) \operatorname { t r } ( I _ { d ^ { \prime } } ) = d \cdot d ^ { \prime } \cdot \operatorname { b } ( k ) .
|
| 312 |
+
$$
|
| 313 |
+
|
| 314 |
+
Theorem 3. The linear space of invariant linear layers $L : \mathbb { R } ^ { n _ { 1 } ^ { k _ { 1 } } \times n _ { 2 } ^ { k _ { 2 } } \times \dots \times n _ { m } ^ { k _ { m } } } \mathbb { R }$ is of dimension $\textstyle \prod _ { i = 1 } ^ { m } { \mathrm { b } ( k _ { i } ) }$ . The equivariant linear layers $L : \mathbb { R } ^ { n _ { 1 } ^ { k _ { 1 } } \times n _ { 2 } ^ { k _ { 2 } } \times \dots \times n _ { m } ^ { k _ { m } } } \mathbb { R } ^ { n _ { 1 } ^ { l _ { 1 } } \times n _ { 2 } ^ { l _ { 2 } } \times \dots \times n _ { m } ^ { l _ { m } } }$ has dimension $\textstyle \prod _ { i = 1 } ^ { m } \ b ( k _ { i } + l _ { i } )$ . Orthogonal bases for these layers are listed in equation $1 l$ .
|
| 315 |
+
|
| 316 |
+
Proof. In this case we get the fixed-point equations: $M \mathrm { v e c } ( { \cal L } ) = \mathrm { v e c } ( { \cal L } )$ for invariant, and $M \otimes$ $M \mathrm { v e c } ( { \cal L } ) = \mathrm { v e c } ( { \cal L } )$ for equivariant, where $M = P _ { 1 } ^ { \otimes k _ { 1 } } \otimes \cdot \cdot \cdot \otimes P _ { m } ^ { \otimes k _ { m } }$ . Similarly to the previous theorem, plugging $M$ into equation 12, using the trace multiplication rule and proposition 3 we get the above formulas. □
|
| 317 |
+
|
| 318 |
+
# APPENDIX C IMPLEMENTING MESSAGE PASSING WITH OUR MODEL
|
| 319 |
+
|
| 320 |
+
In this appendix we show that our model can approximate message passing layers as defined in Gilmer et al. (2017) to an arbitrary precision, and consequently that our model is able to approximate any network consisting of several such layers. The key idea is to mimic multiplication of features by the adjacency matrix, which allows summing over local neighborhoods. This can be implemented using our basis.
|
| 321 |
+
|
| 322 |
+
Theorem 4. Our model can represent message passing layers to an arbitrary precision on compact sets.
|
| 323 |
+
|
| 324 |
+
Proof. Consider input vertex data $\pmb { H } = ( h _ { u } ) \in \mathbb { R } ^ { n \times d }$ ( $n$ is the number of vertices in the graph, and $d$ is the input feature depth), adjacency matrix $\pmb { A } = ( a _ { u v } ) \in \mathbb { R } ^ { n \times n }$ of the graph, and additional edge features $\pmb { \dot { \mathsf { E } } } = ( e _ { u v } ) \in \dot { \mathbb { R } } ^ { n \times n \times l }$ . Recall that a message passing layer of Gilmer et al. (2017) is of the form:
|
| 325 |
+
|
| 326 |
+
$$
|
| 327 |
+
\begin{array} { l } { { m _ { u } ^ { t + 1 } = \displaystyle \sum _ { v \in N ( u ) } { \cal M } _ { t } ( h _ { u } ^ { t } , h _ { v } ^ { t } , e _ { u v } ) } } \\ { { \displaystyle h _ { u } ^ { t + 1 } = { \cal U } _ { t } ( h _ { u } ^ { t } , m _ { u } ^ { t + 1 } ) } } \end{array}
|
| 328 |
+
$$
|
| 329 |
+
|
| 330 |
+
where $u , v$ are nodes in the graph, $h _ { u } ^ { t }$ is the feature vector associated with $u$ in layer $t$ , and $e _ { u v }$ are additional edge features. We denote the number of output features of $M _ { t }$ by $d ^ { \prime }$ .
|
| 331 |
+
|
| 332 |
+
In our setting we represent this data using a tensor $\pmb { \gamma } \in \mathbb { R } ^ { n \times n \times ( 1 + l + d ) }$ where the first channel is the adjacency matrix $\pmb { A }$ , the next $l$ channels are edge features, and the last $d$ channels are diagonal matrices that hold $\boldsymbol { X }$ .
|
| 333 |
+
|
| 334 |
+
Let us construct a message passing layer using our model:
|
| 335 |
+
|
| 336 |
+
1. Our first step is constructing an $n \times n \times ( 1 + l + 2 d )$ tensor. In the first channels we put the adjacency matrix $\pmb { A }$ and the edge features $\mathsf E$ . In the next $d$ channels we replicate the features on the rows, and in the last $d$ channels we replicate features on the columns. The output tensor ${ \pmb Z } ^ { 1 }$ has the form ${ \bf { Z } } _ { u , v } ^ { 1 } = [ a _ { u v } , e _ { u v } , h _ { u } ^ { t } , h _ { v } ^ { t } ]$ .
|
| 337 |
+
2. Next, we copy the feature channels $[ a _ { u v } , e _ { u v } , h _ { u } ^ { t } ]$ to the output tensor ${ \pmb Z } ^ { 2 }$ . We then apply a multilayer perceptron (MLP) on the last $l + 2 d$ feature dimensions of ${ \pmb Z } ^ { 1 }$ that approximates $M _ { t }$ (Hornik, 1991). The output tensor of this stage is $\begin{array} { r l } { \pmb { { Z } } _ { u , v } ^ { 2 } } & { { } = } \end{array}$ $\left[ a _ { u v } , e _ { u v } , h _ { u } ^ { t } , M _ { t } ( h _ { u } ^ { t } , h _ { v } ^ { t } , e _ { u v } ) + \epsilon _ { 1 } \right]$ .
|
| 338 |
+
3. Next, we would like to perform poi ise multiplication $\mathbf { Z } _ { u , v , 1 } ^ { 2 } \odot \mathbf { Z } _ { u , v , ( l + d + 2 ) : e n d } ^ { 2 }$ . This $M _ { t }$ for non-adjacent nodes $u , v$ . As this point-wise multiplication is not a part of our framework we can use an MLP on the feature dimension to approximate it and get $\pmb { \mathrm { Z } } _ { u , v } ^ { 3 } = [ a _ { u v } , e _ { u v } , h _ { u } ^ { t } , a _ { u v } M _ { t } ( h _ { u } ^ { t } , h _ { v } ^ { t } ) + \epsilon _ { 2 } ]$ .
|
| 339 |
+
4. As before we copy the feature channels $[ a _ { u v } , e _ { u v } , h _ { u } ^ { t } ]$ . We now apply a sum over the rows ( $v$ dimension) on the $M _ { t }$ output channels. We put the output of this sum on the diagonal of ${ \pmb Z } ^ { 4 }$ in separate channels. We get $\begin{array} { r } { \pmb { \mathsf { Z } } _ { u , v } ^ { 4 } = [ a _ { u v } , e _ { u v } , h _ { u } ^ { t } , \delta _ { u v } \sum _ { w \in N ( u ) } M _ { t } ( h _ { u } ^ { t } , h _ { w } ^ { t } ) + \epsilon _ { 3 } ] . } \end{array}$ , where $\delta _ { u v }$ is the Kronecker delta. We get a tensor $\pmb { \mathrm { Z } } ^ { 4 } \in \mathbb { R } ^ { n \times n \times ( 1 + l + d + d ^ { \prime } ) }$ .
|
| 340 |
+
|
| 341 |
+
5. The last step is to apply an MLP to the last $d + d ^ { \prime }$ feature channels of the diagonal of ${ \pmb Z } ^ { 4 }$ . After this last step we have $\pmb { \mathrm { Z } } _ { u , v } ^ { 5 } = [ a _ { u v } , e _ { u v } , \delta _ { u v } U _ { t } ( h _ { u } ^ { t } , m _ { u } ^ { t + 1 } ) + \epsilon _ { 4 } ]$ .
|
| 342 |
+
|
| 343 |
+
The errors $\epsilon _ { i }$ depend on the approximation error of the MLP to the relevant function, the previous errors $\epsilon _ { i - 1 }$ (for $i > 1 \AA$ ), and uniform bounds as-well as uniform continuity of the approximated functions. □
|
| 344 |
+
|
| 345 |
+
Corollary 1. Our model can represent any message passing network to an arbitrary precision on compact sets. In other words, in terms of universality our model is at-least as powerful as any message passing neural network (MPNN) that falls into the framework of Gilmer et al. (2017).
|
md/train/Ysuv-WOFeKR/Ysuv-WOFeKR.md
ADDED
|
@@ -0,0 +1,352 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# PARROT: DATA-DRIVEN BEHAVIORAL PRIORS FOR REINFORCEMENT LEARNING
|
| 2 |
+
|
| 3 |
+
Avi Singh∗, Huihan $\mathbf { L i u } ^ { * }$ , Gaoyue Zhou, Albert Yu, Nicholas Rhinehart, Sergey Levine University of California, Berkeley
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Reinforcement learning provides a general framework for flexible decision making and control, but requires extensive data collection for each new task that an agent needs to learn. In other machine learning fields, such as natural language processing or computer vision, pre-training on large, previously collected datasets to bootstrap learning for new tasks has emerged as a powerful paradigm to reduce data requirements when learning a new task. In this paper, we ask the following question: how can we enable similarly useful pre-training for RL agents? We propose a method for pre-training behavioral priors that can capture complex input-output relationships observed in successful trials from a wide range of previously seen tasks, and we show how this learned prior can be used for rapidly learning new tasks without impeding the RL agent’s ability to try out novel behaviors. We demonstrate the effectiveness of our approach in challenging robotic manipulation domains involving image observations and sparse reward functions, where our method outperforms prior works by a substantial margin. Additional materials can be found on our project website: https://sites.google.com/view/parrot-rl
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Reinforcement Learning (RL) is an attractive paradigm for robotic learning because of its flexibility in being able to learn a diverse range of skills and its capacity to continuously improve. However, RL algorithms typically require a large amount of data to solve each individual task, including simple ones. Since an RL agent is generally initialized without any prior knowledge, it must try many largely unproductive behaviors before it discovers a high-reward outcome. In contrast, humans rarely attempt to solve new tasks in this way: they draw on their prior experience of what is useful when they attempt a new task, which substantially shrinks the task search space. For example, faced with a new task involving objects on a table, a person might grasp an object, stack multiple objects, or explore other object rearrangements, rather than re-learning how to move their arms and fingers.
|
| 12 |
+
|
| 13 |
+
Can we endow RL agents with a similar sort of behavioral prior from past experience? In other fields of machine learning, the use of large prior datasets to bootstrap acquisition of new capabilities has been studied extensively to good effect. For example, language models trained on large, diverse datasets offer representations that drastically improve the efficiency of learning downstream tasks (Devlin et al., 2019). What would be the analogue of this kind of pre-training in robotics and RL? One way we can approach this problem is to leverage successful trials from a wide range of previously seen tasks to improve learning for new tasks. The data could come from previously learned policies, from human demonstrations, or even unstructured teleoperation of robots (Lynch et al., 2019). In this paper, we show that behavioral priors can be obtained through representation learning, and the representation in question must not only be a representation of inputs, but actually a representation of input-output relationships – a space of possible and likely mappings from states to actions among which the learning process can interpolate when confronted with a new task.
|
| 14 |
+
|
| 15 |
+
What makes for a good representation for RL? Given a new task, a good representation must (a) provide an effective exploration strategy, (b) simplify the policy learning problem for the RL algorithm, and (c) allow the RL agent to retain full control over the environment. In this paper, we address
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Our problem setting. Our training dataset consists of near-optimal state-action trajectories (without reward labels) from a wide range of tasks. Each task might involve interacting with a different set of objects. Even for the same set of objects, the task can be different depending on our objective. For example, in the upper right corner, the objective could be picking up a cup, or it could be to place the bottle on the yellow cube. We learn a behavioral prior from this multi-task dataset capable of trying many different useful behaviors when placed in a new environment, and can aid an RL agent to quickly learn a specific task in this new environment.
|
| 19 |
+
|
| 20 |
+
Transfer Behavioral all of these challenges through learning an invertible function that maps noise vectors to complex, Prior Learning New Taskshigh-dimensional environment actions. Building on prior work in normalizing flows (Dinh et al., 2017), we train this mapping to maximize the (conditional) log-likelihood of actions observed in Trial 2successful trials from past tasks. When dropped into a new MDP, the RL agent can now sample from a unit Gaussian, and use the learned mapping (which we refer to as the behavioral prior) to generate likely environment actions, conditional on the current observation. This learned mapping essentially transforms the original MDP into a simpler one for the RL agent, as long as the original Trial n-1 MDP shares (partial) structure with previously seen MDPs (see Section 3). Furthermore, since this mapping is invertible, the RL agent still retains full control over the original MDP: for every possible Trial n environment action, there exists a point within the support of the Gaussian distribution that maps to that action. This allows the RL agent to still try out new behaviors that are distinct from what was previously observed.
|
| 21 |
+
|
| 22 |
+
Our main contribution is a framework for pre-training in RL from a diverse multi-task dataset, which produces a behavioral prior that accelerates acquisition of new skills. We present an instantiation of this framework in robotic manipulation, where we utilize manipulation data from a diverse range of prior tasks to train our behavioral prior, and then use it to bootstrap exploration for new tasks. By making it possible to pre-train action representations on large prior datasets for robotics and RL, we hope that our method provides a path toward leveraging large datasets in the RL and robotics settings, much like language models can leverage large text corpora in NLP and unsupervised pretraining can leverage large image datasets in computer vision. Our method, which we call Prior AcceleRated ReinfOrcemenT (PARROT), is able to quickly learn tasks that involve manipulating previously unseen objects, from image observations and sparse rewards, in settings where RL from scratch fails to learn a policy at all. We also compare against prior works that incorporate prior data for RL, and show that PARROT substantially outperforms these prior works.
|
| 23 |
+
|
| 24 |
+
# 2 RELATED WORK
|
| 25 |
+
|
| 26 |
+
Combining RL with demonstrations. Our work is related to methods for learning from demonstrations (Pomerleau, 1989; Schaal et al., 2003; Ratliff et al., 2007; Pastor et al., 2009; Ho & Ermon, 2016; Finn et al., 2017b; Giusti et al., 2016; Sun et al., 2017; Zhang et al., 2017; Lynch et al., 2019). While demonstrations can also be used to speed up RL (Schaal, 1996; Peters & Schaal, 2006; Kormushev et al., 2010; Hester et al., 2017; Vecer´ık et al., 2017; Nair et al., 2018; Rajeswaran et al., 2018; Silver et al., 2018; Peng et al., 2018; Johannink et al., 2019; Gupta et al., 2019), this usually requires collecting demonstrations for the specific task that is being learned. In contrast, we use data from a wide range of other prior tasks to speed up RL for a new task. As we show in our experiments, PARROT is better suited to this problem setting when compared to prior methods that combine imitation and RL for the same task.
|
| 27 |
+
|
| 28 |
+
Generative modeling and RL. Several prior works model multi-modal action distributions using expert trajectories from different tasks. IntentionGAN (Hausman et al.) and InfoGAIL (Li et al., 2017) learn multi-modal policies via interaction with an environment using an adversarial imitation approach (Ho & Ermon, 2016), but we learn these distributions only from data. Other works learn these distributions from data (Xie et al., 2019; Rhinehart et al., 2020) and utilize them for planning at test time to optimize a user-provided cost function. In contrast, we use the behavioral prior to augment model-free RL of a new task. This allows us to learn policies for new tasks that may be substantially different from prior tasks, since we can collect data specific to the new task at hand, and we do not explicitly need to model the environment, which can be complicated for high-dimensional state and action spaces, such as when performing continuous control from images observations. Another line of work (Ghadirzadeh et al., 2017; Ham¨ al¨ ainen et al. ¨ , 2019; Ghadirzadeh et al., 2020) explores using generative models for RL, using a variational autoencoder (Kingma & Welling, 2014) to model entire trajectories in an observation-independent manner, and then learning an open-loop, single-step policy using RL to solve the downstream task. Our approach differs in several key aspects: (1) our model is observation-conditioned, allowing it to prioritize actions that are relevant to the current scene or environment, (2) our model allows for closed-loop feedback control, and (3) our model is invertible, allowing the high-level policy to retain full control over the action space. Our experiments demonstrate these aspects are crucial for solving harder tasks.
|
| 29 |
+
|
| 30 |
+
Hierarchical learning. Our method can be interpreted as training a hierarchical model: the lowlevel policy is the behavioral prior trained on prior data, while the high-level policy is trained using RL and controls the low-level policy. This structure is similar to prior work in hierarchical RL (Dayan & Hinton, 1992; Parr & Russell, 1997; Dietterich, 1998; Sutton et al., 1999; Kulkarni et al., 2016). We divide prior work in hierarchical learning into two categories: methods that seek to learn both the low-level and high-level policies through active interaction with an environment (Kupcsik et al., 2013; Heess et al., 2016; Bacon et al., 2017; Florensa et al., 2017; Haarnoja et al., 2018a; Nachum et al., 2018; Chandak et al., 2019; Peng et al., 2019), and methods that learn temporally extended actions, also known as options, from demonstrations, and then recompose them to perform long-horizon tasks through RL or planning (Fox et al., 2017; Krishnan et al., 2017; Kipf et al., 2019; Shankar et al., 2020; Shankar & Gupta, 2020). Our work shares similarities with the data-driven approach of the latter methods, but work on options focuses on modeling the temporal structure in demonstrations for a small number of long-horizon tasks, while our behavioral prior is not concerned with temporally-extended abstractions, but rather with transforming the original MDP into one where potentially useful behaviors are more likely, and useless behaviors are less likely.
|
| 31 |
+
|
| 32 |
+
Meta-learning. Our goal in this paper is to utilize data from previously seen tasks to speed up RL for new tasks. Meta-RL (Duan et al., 2016; Wang et al., 2016; Finn et al., 2017a; Mishra et al., 2017; Rakelly et al., 2019; Mendonca et al., 2019; Zintgraf et al., 2020; Fakoor et al., 2020) and meta-imitation methods (Duan et al., 2017; Finn et al., 2017c; Huang et al., 2018; James et al., 2018; Paine et al., 2018; Yu et al., 2018; Huang et al., 2019; Zhou et al., 2020) also seek to speed up learning for new tasks by leveraging experience from previously seen tasks. While meta-learning provides an appealing and principled framework to accelerate acquisition of future tasks, we focus on a more lightweight approach with relaxed assumptions that make our method more practically applicable, and we discuss these assumptions in detail in the next section.
|
| 33 |
+
|
| 34 |
+
# 3 PROBLEM SETUP
|
| 35 |
+
|
| 36 |
+
Our goal is to improve an agent’s ability to learn new tasks by incorporating a behavioral prior, which it can acquire from previously seen tasks. Each task can be considered a Markov decision process (MDP), which is defined by a tuple $( S , \mathcal { A } , \mathrm { T } , r , \gamma )$ , where $s$ and $\mathcal { A }$ represent state and action spaces, $\mathrm { T } ( s ^ { \prime } | s , a )$ and $r ( s , a )$ represent the dynamics and reward functions, and $\gamma \in ( 0 , 1 )$ represents the discount factor. Let $p ( M )$ denote a distribution over such MDPs, with the constraint that the state and action spaces are fixed. In our experiments, we treat high-dimensional images as $s$ , which means that this constraint is not very restrictive in practice. In order for the behavioral prior to be able to accelerate the acquisition of new skills, we assume the behavioral prior is trained on data that structurally resembles potential optimal policies for all or part of the new task. For example, if the new task requires placing a bottle in a tray, the prior data might include some behaviors that involve picking up objects. There are many ways to formalize this assumption. One way to state this formally is to assume that prior data consists of executions of near-optimal policies for MDPs drawn according to $M \sim p ( M )$ , and the new task $M ^ { \star }$ is likewise drawn from $p ( M )$ . In this case, the generative process for the prior data can be expressed as:
|
| 37 |
+
|
| 38 |
+

|
| 39 |
+
Figure 2: PARROT. Using successful trials from a large variety of tasks, we learn an invertible mapping $f _ { \phi }$ s that maps noise $z$ to useful actions $a$ Z0 Z1 Z2 Z3=a . This mapping is conditioned on the current observation, which in our case is an RGB image. The image is passed through a stack of convolutional layers and flattened to obtain an image encoding $\psi ( s )$ , and this image encoding is then used to condition each individual transformation $f _ { i }$ pi(z|s)of our overall mapping function $f _ { \phi }$ . The parameters of the mapping (including the convolutional encoder) are a learned through maximizing the conditional log-likelihood of state-action pairs observed in the dataset. When learning a new task, this mapping can simplify the MDP for an RL agent by mapping actions sampled from a randomly initialized policy to actions that are likely to lead to useful behavior in the current scene. Since the mapping is invertible, the RL agent still retains full control over the action space of the original MDP, simply the likelihood of executing a useful action is increased through use of the pre-trained mapping.
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
M \sim p ( M ) , \quad \pi _ { M } ( \tau ) = \arg \operatorname* { m a x } _ { \pi } \mathbb { E } _ { \pi , M } [ R _ { M } ] , \quad \tau _ { M } \sim \pi _ { M } ( \tau ) ,
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
where $\tau _ { M } = ( s _ { 1 } , a _ { 1 } , s _ { 2 } , a _ { 2 } , . . . , s _ { T } , a _ { T } )$ is a sequence of state and actions, $\pi _ { M } ( \tau )$ denotes a nearoptimal policy (Kearns & Singh, 2002) for MDP $M$ and $\textstyle R _ { M } = \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r _ { t }$ . When incorporating the behavioral prior for learning a new task $M ^ { \star }$ , our goal is the same as standard RL: to find a policy $\pi$ that maximizes the expected return ar $\operatorname { \mu } _ { 5 } \operatorname* { m a x } _ { \pi } \mathbb { E } _ { \pi , M ^ { \star } } [ R _ { M ^ { \star } } ]$ . Our assumption on tasks being drawn from a distribution $p ( M )$ shares similarities with the meta-RL problem (Wang et al., 2016; Duan et al., 2016), but our setup is different: it does not require accessing any task in $p ( M )$ except the new task we are learning, $M ^ { \star }$ . Meta-RL methods need to interact with the tasks in $p ( M )$ during meta-training, with access to rewards and additional samples, whereas we learn our behavioral prior simply from data, without even requiring this data to be labeled with rewards. This is of particular importance for real-world problem settings such as robotics: it is much easier to store data from prior tasks (e.g., different environments) than to have a robot physically revisit those prior settings and retry those tasks, and not requiring known rewards makes it possible to use data from a variety of sources, including human-provided demonstrations. In our setting, RL is performed in only one environment, while the prior data can come from many environments.
|
| 46 |
+
|
| 47 |
+
Our setting is related to meta-imitation learning (Duan et al., 2017; Finn et al., 2017c), as we speed up learning new tasks using data collected from past tasks. However, meta-imitation learning methods require at least one demonstration for each new task, whereas our method can learn new tasks without any demonstrations. Further, our data requirements are less stringent: meta-imitation learning methods require all demonstrations to be optimal, require all trajectories in the dataset to have a task label, and requires “paired demonstrations”, i.e. at least two demonstrations for each task (since meta-imitation methods maximize the likelihood of actions from one demonstration after conditioning the policy on another demonstration from the same task). Relaxing these requirements increases the scalability of our method: we can incorporate data from a wider range of sources, and we do not need to explicitly organize it into specific tasks.
|
| 48 |
+
|
| 49 |
+
# 4 BEHAVIORAL PRIORS FOR REINFORCEMENT LEARNING
|
| 50 |
+
|
| 51 |
+
Our method learns a behavioral prior for downstream RL by utilizing a dataset $\mathcal { D }$ of (near-optimal) state-action pairs from previously seen tasks. We do so by learning a state-conditioned mapping $f _ { \phi } \colon { \mathcal { Z } } \times { \mathcal { S } } \to { \mathcal { A } }$ (where $\phi$ denotes learnable parameters) that transforms a noise vector $z$ into an action $a$ that is likely to be useful in the current state $s$ . This removes the need for exploring via “meaningless” random behavior, and instead enables an exploration process where the agent attempts behaviors that have been shown to be useful in previously seen domains. For example, if a robotic arm is placed in front of several objects, randomly sampling $z$ (from a simple distribution, such as the unit Gaussian) and applying the mapping $a = f _ { \phi } ( z ; s )$ should result in actions that, when executed, result in meaningful interactions with the objects. This learned mapping essentially transforms the MDP experienced by the RL agent into a simpler one, where every random action executed in this transformed MDP is much more likely to lead to a useful behavior.
|
| 52 |
+
|
| 53 |
+
How can we learn such a mapping? In this paper, we propose to learn this mapping through stateconditioned generative modeling of the actions observed in the original dataset $\mathcal { D }$ , and we refer to this state-conditioned distribution over actions as the behavioral prior $p _ { \mathrm { p r i o r } } ( a | s )$ . A deep generative model takes noise as input, and outputs a plausible sample from the target distribution, i.e. it can represent $p _ { \mathrm { p r i o r } } ( a | s )$ as a distribution over noise $z$ using a deterministic mapping $f _ { \phi } : \mathcal { Z } \times \mathcal { S } \mapsto A$ When learning a new task, we can use this mapping to reparametrize the action space of the RL agent: if the action chosen by the randomly initialized neural network policy is $z$ , then we execute the action $a = f _ { \phi } ( z ; s )$ in the original MDP, and learn a policy $\pi ( \boldsymbol { z } | \boldsymbol { s } )$ that maximizes the task reward through learning to control the inputs to the mapping $f _ { \phi }$ . The training of the behavioral prior and the task-specific policy is decoupled, allowing us to mix and match RL algorithms and generative models to best suit the application of interest. An overview of our overall architecture is depicted in Figure 2. In the next subsection, we discuss what properties we would like the behavioral prior to satisfy, and present one particular choice for learning a prior that satisfies all of these properties.
|
| 54 |
+
|
| 55 |
+
# 4.1 LEARNING A BEHAVIORAL PRIOR WITH NORMALIZING FLOWS
|
| 56 |
+
|
| 57 |
+
For the behavioral prior to be effective, it needs to satisfy certain properties. Since we learn the prior from a multi-task dataset, containing several different behaviors even for the same initial state, the learned prior should be capable of representing complex, multi-modal distributions. Second, it should provide a mapping for generating “useful” actions from noise samples when learning a new task. Third, the prior should be state-conditioned, so that only actions that are relevant to the current state are sampled. And finally, the learned mapping should allow easier learning in the reparameterized action space without hindering the RL agent’s ability to attempt novel behaviors, including actions that might not have been observed in the dataset $\mathcal { D }$ . Generative models based on normalizing flows (Dinh et al., 2017) satisfy all of these properties well: they allow maximizing the model’s exact log-likelihood of observed examples, and learn a deterministic, invertible mapping that transforms samples from a simple distribution $p _ { z }$ to examples observed in the training dataset. In particular, the real-valued non-volume preserving (real NVP) architecture introduced by Dinh et al. (2017) allows using deep neural networks to parameterize this mapping (making it expressive) While the original real NVP work modelled unconditional distributions, follow-up work has found that it can be easily extended to incorporate conditioning information (Ardizzone et al., 2019). We refer the reader to prior work (Dinh et al., 2017) for a complete description of real NVPs, and summarize its key features here. Given an invertible mapping $a = f _ { \phi } ( z ; s )$ , the change of variable formula allows expressing the likelihood of the observed actions using samples from $\mathcal { D }$ in the following way:
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
p _ { \mathrm { p r i o r } } ( a | s ) = p _ { z } \left( f _ { \phi } ^ { - 1 } ( a ; s ) \right) \left| \operatorname* { d e t } \left( \partial f _ { \phi } ^ { - 1 } ( a ; s ) / \partial a \right) \right|
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
Dinh et al. (2017) propose a particular (unconditioned) form of the invertible mapping $f _ { \phi }$ , called an affine coupling layer, that maintains tractability of the likelihood term above, while still allowing the mapping $f _ { \phi }$ to be expressive. Several coupling layers can be composed together to transform simple noise vectors into samples from complex distributions, and each layer can be conditioned on other variables, as shown in Figure 2.
|
| 64 |
+
|
| 65 |
+
# 4.2 ACCELERATED REINFORCEMENT LEARNING VIA BEHAVIORAL PRIORS
|
| 66 |
+
|
| 67 |
+
After we obtain the mapping $f _ { \phi } ( z ; s )$ from the behavioral prior learned by maximizing the likelihood term in Equation 2, we would like to use it to accelerate RL when solving a new task. Instead of learning a policy $\pi _ { \boldsymbol { \theta } } ( a | s )$ that directly executes its actions in the original MDP, we learn a policy $\pi _ { \boldsymbol { \theta } } { \left( z | \boldsymbol { s } \right) }$ , and execute an action in the environment according to $a = f _ { \phi } ( z ; s )$ . As shown in Figure 2, this essentially transforms the MDP experienced for the RL agent into one where random actions $z \sim p _ { z }$ (where $p _ { z }$ is the base distribution used for training the mapping $f _ { \phi }$ ) are much more likely to result in useful behaviors. To enable effective exploration at the start of the learning period, we initialize the RL policy to the base distribution used for training the prior, so that at the beginning of training, $\pi _ { \theta } ( z | s ) \mathbf { \bar { \theta } } { : = } \bar { p _ { z } } ( z )$ . Since the mapping $f _ { \phi }$ is invertible, the RL agent still retains full control over the action space: for any given $a$ , it can always find a $z$ that generates $z = f _ { \phi } ^ { - 1 } ( a ; s )$ in the original MDP. The learned mapping increases the likelihood of useful actions without crippling the RL agent, making it ideal for fine-tuning from task-specific data. Our complete method is described in Algorithm 1 in Appendix A. Note that we need to learn the mapping $f _ { \phi }$ only once, and it can be used for accelerated learning of any new task.
|
| 68 |
+
|
| 69 |
+
# 4.3 IMPLEMENTATION DETAILS
|
| 70 |
+
|
| 71 |
+
We use real NVP to learn $f _ { \phi }$ , and as shown in Figure 2, each coupling layer in the real NVP takes as input the the output of the previous coupling layer, and the conditioning information. The conditioning information in our case corresponds to RGB image observations, which allows us to train a single behavioral prior across a wide variety of tasks, even when the tasks might have different underlying states (for example, different objects). We train a real NVP model with four coupling layers; the exact architecture, and other hyperparameters, are detailed in Appendix B. The behavioral prior can be combined with any RL algorithm that is suitable for continuous action spaces, and we chose to use the soft actor-critic (Haarnoja et al., 2018b) due to its stability and ease of use.
|
| 72 |
+
|
| 73 |
+
# 5 EXPERIMENTS
|
| 74 |
+
|
| 75 |
+
Our experiments seek to answer: (1) Can the behavioral prior accelerate learning of new tasks? (2) How does PARROT compare to prior works that accelerate RL with demonstrations? (3) How does PARROT compare to prior methods that combine hierarchical imitation with RL?
|
| 76 |
+
|
| 77 |
+
Domains. We evaluate our method on a suite of challenging robotic manipulation tasks, a subset of which are depicted in Figure 3. Each task involves controlling a 6-DoF robotic arm and its gripper, with a 7D action space. The observation is a $4 8 \times 4 8$ RGB image, which allows us to use the same observation representation across tasks, even though each underlying task might have a different underlying state (e.g., different objects). No other observations (such as joint angles or end-effector positions) are provided. In each task, the robot needs to interact with one or two objects in the scene to achieve its objective, and there are three objects in each scene. Note that all of the objects in the test scenes are novel – the dataset $\mathcal { D }$ contains no interactions with these objects. The object positions at the start of each trial are randomized, and the policy must infer these positions from image observations in order to successfully solve the task. A reward of $+ 1$ is provided when the objective for the task is achieved, and the reward is zero otherwise. Detailed information on the objective for each task and example rollouts are provided in Appendix C.1, and on our anonymous project website1.
|
| 78 |
+
|
| 79 |
+
Data collection. Our behavioral prior is trained on a diverse dataset of trajectories from a wide range of tasks, and then utilized to accelerate reinforcement learning of new tasks. As discussed in Section 3, for the prior to be effective, it needs to be trained on a dataset that structurally resembles the behaviors that might be optimal for the new tasks. In our case, all of the behaviors involve repositioning objects (i.e., picking up objects and moving them to new locations), which represents a very general class of tasks that might be performed by a robotic arm. While the dataset can be collected in many ways, such as from human demonstrations or prior tasks solved by the robot, we collect it using a set of randomized scripted policies, see Appendix C.2 for details. Since the policies are randomized, not every execution of such a policy results in a useful behavior, and we decide to keep or discard a collected trajectory based on a simple predefined rule: if the trajectory collected ends with a successful grasp or rearrangement of any one of the objects in the scene, we add this trajectory to our dataset. We collect a dataset of 50K trajectories, where each trajectory is of length 25 timesteps ${ \approx } 5 – 6$ seconds), for a total of $1 . 2 5 \mathrm { m }$ observation-action pairs. The observation is a $4 8 \times 4 8$ RGB image, while the actions are continuous 7D vectors. Data collection involves interactions with over 50 everyday objects (see Appendix C.3); the diversity of this dataset enables learning priors that can produce useful behavior when interacting with a new object.
|
| 80 |
+
|
| 81 |
+

|
| 82 |
+
Figure 3: Tasks. A subset of our evaluation tasks, with one task shown in each row. In the first task (first row), the objective is to pick up a can and place it in the pan. In the second task, the robot must pick up the vase and put it in the basket. In the third task, the goal is to place the chair on top of the checkerboard. In the fourth task, the robot must pick up the mug and hold it above a certain height. Initial positions of all objects are randomized, and must be inferred from visual observations. Not all objects in the scene are relevant to the current task.
|
| 83 |
+
|
| 84 |
+
# 5.1 RESULTS, COMPARISONS AND ANALYSIS
|
| 85 |
+
|
| 86 |
+
To answer the questions posed at the start of this section, we compare PARROT against a number of prior works, as well as ablations of our method. Additional implementation details and hyperparameters can be found in Appendix B.
|
| 87 |
+
|
| 88 |
+
Soft-Actor Critic (SAC). For a basic RL comparison, we compare against the vanilla soft-actor critic algorithm (Haarnoja et al., 2018b), which does not incorporate any previously collected data.
|
| 89 |
+
|
| 90 |
+
SAC with demonstrations (BC-SAC). We compare against a method that incorporates demonstrations to speed up learning of new tasks. In particular, we initialize the SAC policy by performing behavioral cloning on the entire dataset $\mathcal { D }$ , and then fine-tune it using SAC. This approach is similar to what has been used in prior work (Rajeswaran et al., 2018), except we use SAC as our RL algorithm. While we did test other methods that are designed to use demonstration data with RL such as DDPGfD (Vecer´ık et al., 2017) and AWAC (Nair et al., 2020), we found that our simple $\mathrm { B C } + \mathrm { S A C }$ variant performed better. This somewhat contradicts the results reported in prior work (Nair et al., 2020), but we believe that this is because the prior data is not labeled with rewards (all transitions are assigned a reward of 0), and more powerful demonstration $+ \mathrm { R L }$ methods require access to these rewards, and subsequently struggle due to the reward misspecification.
|
| 91 |
+
|
| 92 |
+
Transfer Learning via Feature Learning (VAE-features). We compare against prior methods for transfer learning (in RL) that involve learning a robust representation of the input observation. Similar to Higgins et al. (2017b), we train a $\beta$ -VAE using the observations in our training set, and train a policy on top of the features learned by this VAE when learning downstream tasks.
|
| 93 |
+
|
| 94 |
+
Trajectory modeling and RL (TrajRL). Ghadirzadeh et al. (2020) model entire trajectories using a VAE, and learn a one-step policy on top of the VAE to solve tasks using RL. Our implementation of this method uses a VAE architecture identical to the original paper’s, and we then train a policy using SAC to solve new tasks with the action space induced by the VAE. We performed additional hyperparameter tuning for this comparison, the details of which can be found in Appendix B.
|
| 95 |
+
|
| 96 |
+
Hierarchical imitation and RL (HIRL). Prior works in hierarchical imitation learning (Fox et al., 2017; Shankar & Gupta, 2020) train latent variable models over expert demonstrations to discover options, and later utilize these options to learn longhorizon tasks using RL. While PARROT can also be extended to model the temporal structure in trajectories through conditioning on past states and actions, by modeling $p _ { \mathrm { p r i o r } } ( a _ { t } , \vert s _ { t } , s _ { t - 1 } , . . . , a _ { t - 1 } , . . . , a _ { 0 } )$ instead of $p _ { \mathrm { p r i o r } } ( a _ { t } | s _ { t } )$ , we focus on a simpler version of the model in this paper that does not condition on the past. In order to provide a fair comparison, we modify the model proposed by Shankar & Gupta (2020) to remove the past conditioning, which then reduces to training a conditional VAE, and performing RL on the action space induced by the latent space of this VAE. This comparison is similar to our proposed approach, but with one crucial difference: the mapping we learn is invertible, and allows the
|
| 97 |
+
|
| 98 |
+

|
| 99 |
+
Figure 4: We plot trajectories from executing a random policy, with and without the behavioral prior. We see that the behavioral prior substantially increases the likelihood of executing an action that is likely to lead to a meaningful interaction with an object, while still exploring a diverse set of actions.
|
| 100 |
+
|
| 101 |
+
RL agent to retain full control over the final actions in the environment (since for every $a \in { \mathcal { A } }$ , there exist some $z = f _ { \phi } ^ { - 1 } ( a ; s )$ , while a latent space learned by a VAE provides no such guarantee).
|
| 102 |
+
|
| 103 |
+

|
| 104 |
+
Figure 5: Results. The lines represent average performance across multiple random seeds, and the shaded areas represent the standard deviation. PARROT is able to learn much faster than prior methods on a majority of the tasks, and shows little variance across runs (all experiments were run with three random seeds, computational constraints of image-based RL make it difficult to run more seeds). Note that some methods that failed to make any progress on certain tasks (such as “Place Sculpture in Basket”) overlap each other with a success rate of zero. SAC and VAE-features fail to make progress on any of the tasks.
|
| 105 |
+
|
| 106 |
+
Exploration via behavioral prior (Prior-explore). We also run experiments with an ablation of our method: instead of using a behavioral prior to transform the MDP being experienced by the RL agent, we use it to simply aid the exploration process. While collecting data, an action is executed from the prior with probability $\epsilon$ , else an action is executed from the learned policy. We experimented with $\epsilon = 0 . 1 , 0 . 3 , 0 . 7 , 0 . 9$ , and found 0.9 to perform best.
|
| 107 |
+
|
| 108 |
+
Main results. Our results are summarised in Figure 5. We see that PARROT is able to solve all of the tasks substantially faster and achieve substantially higher final returns than other methods. The SAC baseline (which does not use any prior data) fails to make progress on any of the tasks, which we suspect is due to the challenge of exploring in sparse reward settings with a randomly initialized policy. Figure 4 illustrates a comparison between using a behavioral prior and a random policy for exploration. The VAE-features baseline similarly fails to make any progress, and due to the same reason: the difficulty of exploration in a sparse reward setting. Initializing the SAC policy with behavior cloning allows it to make progress on only two of the tasks, which is not surprising: a Gaussian policy learned through a behavior cloning loss is not expressive enough to represent the complex, multi-modal action distributions observed in dataset $\mathcal { D }$ . Both TrajRL and HIRL perform much better than any of the other baselines, but their performance plateaus a lot earlier than PARROT. While the initial exploration performance of our learned behavioral prior is not substantially better from these methods (denoted by the initial success rate in the learning curves), the flexibility of the representation it offers (through learning an invertible mapping) allows the RL agent to improve far beyond its initial performance. Prior-explore, an ablation of our method, is able to make progress on most tasks, but is unable to learn as fast as our method, and also demonstrates unstable learning on some of the tasks. We suspect this is due to the following reason: while off-policy RL methods like SAC aim to learn from data collected by any policy, they are in practice quite sensitive to the data distribution, and can run into issues if the data collection policy differs substantially from the policy being learned (Kumar et al., 2019).
|
| 109 |
+
|
| 110 |
+
Impact of dataset size on performance. We conducted additional experiments on a subset of our tasks to evaluate how final performance is impacted as a result of dataset size, results from which are shown in Figure 6. As one might expect, the size of the dataset positively correlates with performance, but about 10K trajectories are sufficient for obtaining good performance, and collecting additional data yields diminishing returns. Note that initializing with even a smaller dataset size (like 5K trajectories) yields much better performance than learning from scratch.
|
| 111 |
+
|
| 112 |
+

|
| 113 |
+
Figure 6: Impact of dataset size on performance. We observe that training on 10K, 25K or 50K trajectories yields similar performance.
|
| 114 |
+
|
| 115 |
+
Mismatch between train and test tasks. We ran experiments in which we deliberately bias the training dataset so that the training tasks and test tasks are functionally different (i.e. involve substantially different actions), the results from which are shown in Figure 7. We observe that if the prior is trained on pick and place tasks alone, it can still solve downstream grasping tasks well. However, if the prior is trained only on grasping, it is unable to perform well when solving pick and place tasks. We suspect this is due to the fact that pick and place tasks involve a completely new action (that of opening the gripper), which is never observed by the prior if it is trained only on grasping, making it difficult to learn this behavior from scratch for downstream tasks.
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
Figure 7: Impact of train/test mismatch on performance. Each plot shows results for four tasks. Note that for the pick and place tasks, the performance is close to zero, and the curves mostly overlap each other on the $\mathbf { X }$ -axis.
|
| 119 |
+
|
| 120 |
+
# 6 CONCLUSION
|
| 121 |
+
|
| 122 |
+
We presented PARROT, a method for learning behavioral priors using successful trials from a wide range of tasks. Learning from priors accelerates RL on new tasks–including manipulating previously unseen objects from high-dimensional image observations–which RL from scratch often fails to learn. Our method also compares favorably to other prior works that use prior data to bootstrap learning for new tasks. While our method learns faster and performs better than prior work in learning novel tasks, it still requires thousands of trials to attain high success rates. Improving this efficiency even further, perhaps inspired by ideas in meta-learning, could be a promising direction for future work. Our work opens the possibility for several exciting future directions. PARROT provides a mapping for executing actions in new environments structurally similar to those of prior tasks. While we primarily utilized this mapping to accelerate learning of new tasks, future work could investigate how it can also enable safe exploration of new environments (Hunt et al., 2020; Rhinehart et al., 2020). While the invertibility of our learned mapping ensures that it is theoretically possible for the RL policy to execute any action in the original MDP, the probability of executing an action can become very low if this action was never seen in the training set. This can be an issue if there is a significant mismatch between the training dataset and the downstream task (as shown in our experiments), and tackling this issue would make for an interesting problem. Since our method speeds up learning using a problem setup that takes into account real world considerations (no rewards for prior data, no need to revisit prior tasks, etc.), we are also excited about its future application to domains like real world robotics.
|
| 123 |
+
|
| 124 |
+
# REFERENCES
|
| 125 |
+
|
| 126 |
+
Lynton Ardizzone, Jakob Kruse, Carsten Rother, and Ullrich Kothe. Analyzing inverse problems ¨ with invertible neural networks. In ICLR, 2019.
|
| 127 |
+
|
| 128 |
+
Pierre-Luc Bacon, Jean Harb, and Doina Precup. The option-critic architecture. In AAAI, 2017.
|
| 129 |
+
|
| 130 |
+
Yash Chandak, Georgios Theocharous, James Kostas, Scott M. Jordan, and Philip S. Thomas. Learning action representations for reinforcement learning. In ICML, 2019.
|
| 131 |
+
|
| 132 |
+
Angel X. Chang, Thomas A. Funkhouser, Leonidas J. Guibas, Pat Hanrahan, Qi-Xing Huang, Zimo Li, Silvio Savarese, Manolis Savva, Shuran Song, Hao Su, Jianxiong Xiao, Li Yi, and Fisher Yu. Shapenet: An information-rich 3d model repository. CoRR, abs/1512.03012, 2015.
|
| 133 |
+
|
| 134 |
+
E Coumans and Y Bai. Pybullet, a python module for physics simulation for games, robotics and machine learning. GitHub repository, 2016.
|
| 135 |
+
|
| 136 |
+
Peter Dayan and Geoffrey E. Hinton. Feudal reinforcement learning. In NIPS, 1992.
|
| 137 |
+
|
| 138 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: pre-training of deep bidirectional transformers for language understanding. In NAACL-HLT, 2019.
|
| 139 |
+
|
| 140 |
+
Thomas G. Dietterich. The MAXQ method for hierarchical reinforcement learning. In ICML, 1998.
|
| 141 |
+
|
| 142 |
+
Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real NVP. In ICLR, 2017.
|
| 143 |
+
|
| 144 |
+
Yan Duan, John Schulman, Xi Chen, Peter L Bartlett, Ilya Sutskever, and Pieter Abbeel. Rl2: Fast reinforcement learning via slow reinforcement learning. arXiv preprint arXiv:1611.02779, 2016.
|
| 145 |
+
|
| 146 |
+
Yan Duan, Marcin Andrychowicz, Bradly Stadie, Jonathan Ho, Jonas Schneider, Ilya Sutskever, Pieter Abbeel, and Wojciech Zaremba. One-shot imitation learning. Neural Information Processing Systems (NIPS), 2017.
|
| 147 |
+
|
| 148 |
+
Rasool Fakoor, Pratik Chaudhari, Stefano Soatto, and Alexander J. Smola. Meta-q-learning. In ICLR, 2020.
|
| 149 |
+
|
| 150 |
+
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. arXiv preprint arXiv:1703.03400, 2017a.
|
| 151 |
+
|
| 152 |
+
Chelsea Finn, Sergey Levine, and Pieter Abbeel. Guided cost learning: Deep inverse optimal control via policy optimization. In International Conference on Machine Learning (ICML), 2017b.
|
| 153 |
+
|
| 154 |
+
Chelsea Finn, Tianhe Yu, Tianhao Zhang, Pieter Abbeel, and Sergey Levine. One-shot visual imitation learning via meta-learning. Conference on Robot Learning (CoRL), 2017c.
|
| 155 |
+
|
| 156 |
+
Carlos Florensa, Yan Duan, and Pieter Abbeel. Stochastic neural networks for hierarchical reinforcement learning. In ICLR, 2017.
|
| 157 |
+
|
| 158 |
+
Roy Fox, Sanjay Krishnan, Ion Stoica, and Ken Goldberg. Multi-level discovery of deep options. CoRR, abs/1703.08294, 2017.
|
| 159 |
+
|
| 160 |
+
Ali Ghadirzadeh, Atsuto Maki, Danica Kragic, and Marten Bj ˚ orkman. Deep predictive policy train- ¨ ing using reinforcement learning. In International Conference on Intelligent Robots and Systems, 2017.
|
| 161 |
+
|
| 162 |
+
Ali Ghadirzadeh, Petra Poklukar, Ville Kyrki, Danica Kragic, and Marten Bj ˚ orkman. Data- ¨ efficient visuomotor policy training using reinforcement learning and generative models. CoRR, abs/2007.13134, 2020.
|
| 163 |
+
|
| 164 |
+
Alessandro Giusti, Jer´ ome Guzzi, Dan C Cires¸an, Fang-Lin He, Juan P Rodr ˆ ´ıguez, Flavio Fontana, Matthias Faessler, Christian Forster, Jurgen Schmidhuber, Gianni Di Caro, et al. A machine ¨ learning approach to visual perception of forest trails for mobile robots. IEEE Robotics and Automation Letters (RA-L), 2016.
|
| 165 |
+
|
| 166 |
+
Abhishek Gupta, Vikash Kumar, Corey Lynch, Sergey Levine, and Karol Hausman. Relay policy learning: Solving long-horizon tasks via imitation and reinforcement learning. In Leslie Pack Kaelbling, Danica Kragic, and Komei Sugiura (eds.), Conference on Robot Learning, 2019.
|
| 167 |
+
|
| 168 |
+
Tuomas Haarnoja, Haoran Tang, Pieter Abbeel, and Sergey Levine. Reinforcement learning with deep energy-based policies. In International Conference on Machine Learning (ICML), 2017.
|
| 169 |
+
|
| 170 |
+
Tuomas Haarnoja, Kristian Hartikainen, Pieter Abbeel, and Sergey Levine. Latent space policies for hierarchical reinforcement learning. In Jennifer G. Dy and Andreas Krause (eds.), ICML, 2018a.
|
| 171 |
+
|
| 172 |
+
Tuomas Haarnoja, Aurick Zhou, Kristian Hartikainen, George Tucker, Sehoon Ha, Vikash Kumar Jie Tan, Henry Zhu, Abhishek Gupta, Pieter Abbeel, and Sergey Levine. Soft actor-critic algorithms and applications. Technical report, 2018b.
|
| 173 |
+
|
| 174 |
+
Aleksi Ham¨ al¨ ainen, Karol Arndt, Ali Ghadirzadeh, and Ville Kyrki. Affordance learning for end- ¨ to-end visuomotor robot control. In IROS, 2019.
|
| 175 |
+
|
| 176 |
+
Karol Hausman, Yevgen Chebotar, Stefan Schaal, Gaurav S. Sukhatme, and Joseph J. Lim. Multimodal imitation learning from unstructured demonstrations using generative adversarial nets. In Isabelle Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vishwanathan, and Roman Garnett (eds.), NIPS.
|
| 177 |
+
|
| 178 |
+
Nicolas Heess, Gregory Wayne, Yuval Tassa, Timothy P. Lillicrap, Martin A. Riedmiller, and David Silver. Learning and transfer of modulated locomotor controllers. CoRR, abs/1610.05182, 2016.
|
| 179 |
+
|
| 180 |
+
Todd Hester, Matej Vecer´ık, Olivier Pietquin, Marc Lanctot, Tom Schaul, Bilal Piot, Andrew Sendonaris, Gabriel Dulac-Arnold, Ian Osband, John P. Agapiou, Joel Z. Leibo, and Audrunas Gruslys. Learning from demonstrations for real world reinforcement learning. CoRR, abs/1704.03732, 2017.
|
| 181 |
+
|
| 182 |
+
Irina Higgins, Lo¨ıc Matthey, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-vae: Learning basic visual concepts with a constrained variational framework. In ICLR, 2017a.
|
| 183 |
+
|
| 184 |
+
Irina Higgins, Arka Pal, Andrei A. Rusu, Lo¨ıc Matthey, Christopher Burgess, Alexander Pritzel, Matthew Botvinick, Charles Blundell, and Alexander Lerchner. DARLA: improving zero-shot transfer in reinforcement learning. In ICML, 2017b.
|
| 185 |
+
|
| 186 |
+
Jonathan Ho and Stefano Ermon. Generative adversarial imitation learning. In Advances in Neural Information Processing Systems (NIPS), 2016.
|
| 187 |
+
|
| 188 |
+
De-An Huang, Suraj Nair, Danfei Xu, Yuke Zhu, Animesh Garg, Li Fei-Fei, Silvio Savarese, and Juan Carlos Niebles. Neural task graphs: Generalizing to unseen tasks from a single video demonstration. 2018.
|
| 189 |
+
|
| 190 |
+
De-An Huang, Danfei Xu, Yuke Zhu, Animesh Garg, Silvio Savarese, Li Fei-Fei, and Juan Carlos Niebles. Continuous relaxation of symbolic planner for one-shot imitation learning. In IROS, 2019.
|
| 191 |
+
|
| 192 |
+
Nathan Hunt, Nathan Fulton, Sara Magliacane, Nghia Hoang, Subhro Das, and Armando Solar-Lezama. Verifiably safe exploration for end-to-end reinforcement learning. CoRR, abs/2007.01223, 2020.
|
| 193 |
+
|
| 194 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, 2015.
|
| 195 |
+
|
| 196 |
+
Stephen James, Michael Bloesch, and Andrew J Davison. Task-embedded control networks for few-shot imitation learning. arXiv preprint arXiv:1810.03237, 2018.
|
| 197 |
+
|
| 198 |
+
Tobias Johannink, Shikhar Bahl, Ashvin Nair, Jianlan Luo, Avinash Kumar, Matthias Loskyll, Juan Aparicio Ojea, Eugen Solowjow, and Sergey Levine. Residual reinforcement learning for robot control. In ICRA, 2019.
|
| 199 |
+
|
| 200 |
+
Michael J. Kearns and Satinder P. Singh. Near-optimal reinforcement learning in polynomial time. Machine Learning, 49(2-3):209–232, 2002.
|
| 201 |
+
|
| 202 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference for Learning Representations (ICLR), 2015.
|
| 203 |
+
|
| 204 |
+
Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In Yoshua Bengio and Yann LeCun (eds.), ICLR, 2014.
|
| 205 |
+
|
| 206 |
+
Thomas Kipf, Yujia Li, Hanjun Dai, Vin´ıcius Flores Zambaldi, Alvaro Sanchez-Gonzalez, Edward Grefenstette, Pushmeet Kohli, and Peter W. Battaglia. Compile: Compositional imitation learning and execution. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), ICML, 2019.
|
| 207 |
+
|
| 208 |
+
Petar Kormushev, Sylvain Calinon, and Darwin G. Caldwell. Robot motor skill coordination with em-based reinforcement learning. In IROS, 2010.
|
| 209 |
+
|
| 210 |
+
Sanjay Krishnan, Roy Fox, Ion Stoica, and Ken Goldberg. DDCO: discovery of deep continuous options for robot learning from demonstrations. In CoRL, 2017.
|
| 211 |
+
|
| 212 |
+
Tejas D. Kulkarni, Karthik Narasimhan, Ardavan Saeedi, and Josh Tenenbaum. Hierarchical deep reinforcement learning: Integrating temporal abstraction and intrinsic motivation. In Advances in Neural Information Processing Systems, 2016.
|
| 213 |
+
|
| 214 |
+
Aviral Kumar, Justin Fu, Matthew Soh, George Tucker, and Sergey Levine. Stabilizing off-policy q-learning via bootstrapping error reduction. In NeurIPS, 2019.
|
| 215 |
+
|
| 216 |
+
Andras Gabor Kupcsik, Marc Peter Deisenroth, Jan Peters, and Gerhard Neumann. Data-efficient generalization of robot skills with contextual policy search. In AAAI, 2013.
|
| 217 |
+
|
| 218 |
+
Yunzhu Li, Jiaming Song, and Stefano Ermon. Infogail: Interpretable imitation learning from visual demonstrations. In Advances in Neural Information Processing Systems, 2017.
|
| 219 |
+
|
| 220 |
+
Corey Lynch, Mohi Khansari, Ted Xiao, Vikash Kumar, Jonathan Tompson, Sergey Levine, and Pierre Sermanet. Learning latent plans from play. In Conference on Robot Learning, 2019.
|
| 221 |
+
|
| 222 |
+
Russell Mendonca, Abhishek Gupta, Rosen Kralev, Pieter Abbeel, Sergey Levine, and Chelsea Finn. Guided meta-policy search. arXiv preprint arXiv:1904.00956, 2019.
|
| 223 |
+
|
| 224 |
+
Nikhil Mishra, Mostafa Rohaninejad, Xi Chen, and Pieter Abbeel. Meta-learning with temporal convolutions. arXiv:1707.03141, 2017.
|
| 225 |
+
|
| 226 |
+
Ofir Nachum, Shixiang Gu, Honglak Lee, and Sergey Levine. Data-efficient hierarchical reinforcement learning. In Samy Bengio, Hanna M. Wallach, Hugo Larochelle, Kristen Grauman, Nicolo\` Cesa-Bianchi, and Roman Garnett (eds.), Advances in Neural Information Processing Systems, 2018.
|
| 227 |
+
|
| 228 |
+
Ashvin Nair, Bob McGrew, Marcin Andrychowicz, Wojciech Zaremba, and Pieter Abbeel. Overcoming exploration in reinforcement learning with demonstrations. In ICRA, 2018.
|
| 229 |
+
|
| 230 |
+
Ashvin Nair, Murtaza Dalal, Abhishek Gupta, and Sergey Levine. Accelerating online reinforcement learning with offline datasets. CoRR, abs/2006.09359, 2020.
|
| 231 |
+
|
| 232 |
+
Tom Le Paine, Sergio Gomez Colmenarejo, Ziyu Wang, Scott Reed, Yusuf Aytar, Tobias Pfaff, ´ Matt W Hoffman, Gabriel Barth-Maron, Serkan Cabi, David Budden, et al. One-shot high-fidelity imitation: Training large-scale deep nets with rl. arXiv preprint arXiv:1810.05017, 2018.
|
| 233 |
+
|
| 234 |
+
Ronald Parr and Stuart J. Russell. Reinforcement learning with hierarchies of machines. In Advances in Neural Information Processing Systems, 1997.
|
| 235 |
+
|
| 236 |
+
Peter Pastor, Heiko Hoffmann, Tamim Asfour, and Stefan Schaal. Learning and generalization of motor skills by learning from demonstration. In International Conference on Robotics and Automation (ICRA), 2009.
|
| 237 |
+
|
| 238 |
+
Xue Bin Peng, Pieter Abbeel, Sergey Levine, and Michiel van de Panne. Deepmimic: exampleguided deep reinforcement learning of physics-based character skills. ACM Trans. Graph., 2018.
|
| 239 |
+
|
| 240 |
+
Xue Bin Peng, Michael Chang, Grace Zhang, Pieter Abbeel, and Sergey Levine. MCP: learning composable hierarchical control with multiplicative compositional policies. In NeurIPS, 2019.
|
| 241 |
+
|
| 242 |
+
Jan Peters and Stefan Schaal. Policy gradient methods for robotics. In IROS, 2006.
|
| 243 |
+
|
| 244 |
+
Dean A Pomerleau. Alvinn: An autonomous land vehicle in a neural network. In Neural Information Processing Systems (NIPS), pp. 305–313, 1989.
|
| 245 |
+
|
| 246 |
+
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 Robotics: Science and Systems, 2018.
|
| 247 |
+
|
| 248 |
+
Kate Rakelly, Aurick Zhou, Deirdre Quillen, Chelsea Finn, and Sergey Levine. Efficient off-policy meta-reinforcement learning via probabilistic context variables. In ICML, 2019.
|
| 249 |
+
|
| 250 |
+
Nathan Ratliff, J Andrew Bagnell, and Siddhartha S Srinivasa. Imitation learning for locomotion and manipulation. In International Conference on Humanoid Robots, 2007.
|
| 251 |
+
|
| 252 |
+
Nicholas Rhinehart, Rowan McAllister, and Sergey Levine. Deep imitative models for flexible inference, planning, and control. In ICLR, 2020.
|
| 253 |
+
|
| 254 |
+
Stefan Schaal. Learning from demonstration. In Michael Mozer, Michael I. Jordan, and Thomas Petsche (eds.), NIPS, 1996.
|
| 255 |
+
|
| 256 |
+
Stefan Schaal, Auke Ijspeert, and Aude Billard. Computational approaches to motor learning by imitation. Philosophical Transactions of the Royal Society of London B: Biological Sciences, 2003.
|
| 257 |
+
|
| 258 |
+
Tanmay Shankar and Abhinav Gupta. Learning robot skills with temporal variational inference. 2020.
|
| 259 |
+
|
| 260 |
+
Tanmay Shankar, Shubham Tulsiani, Lerrel Pinto, and Abhinav Gupta. Discovering motor programs by recomposing demonstrations. In ICLR, 2020.
|
| 261 |
+
|
| 262 |
+
Tom Silver, Kelsey R. Allen, Josh Tenenbaum, and Leslie Pack Kaelbling. Residual policy learning. CoRR, abs/1812.06298, 2018.
|
| 263 |
+
|
| 264 |
+
Wen Sun, Arun Venkatraman, Geoffrey J Gordon, Byron Boots, and J Andrew Bagnell. Deeply aggrevated: Differentiable imitation learning for sequential prediction. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 3309–3318. JMLR. org, 2017.
|
| 265 |
+
|
| 266 |
+
Richard S. Sutton, Doina Precup, and Satinder P. Singh. Between mdps and semi-mdps: A framework for temporal abstraction in reinforcement learning. Artificial Intelligence, 1999.
|
| 267 |
+
|
| 268 |
+
Aaron van den Oord, Oriol Vinyals, and Koray Kavukcuoglu. Neural discrete representation learn- ¨ ing. In NeurIPS, 2017.
|
| 269 |
+
|
| 270 |
+
Matej Vecer´ık, Todd Hester, Jonathan Scholz, Fumin Wang, Olivier Pietquin, Bilal Piot, Nicolas Heess, Thomas Rothorl, Thomas Lampe, and Martin A. Riedmiller. Leveraging demon- ¨ strations for deep reinforcement learning on robotics problems with sparse rewards. CoRR, abs/1707.08817, 2017.
|
| 271 |
+
|
| 272 |
+
Jane X Wang, Zeb Kurth-Nelson, Dhruva Tirumala, Hubert Soyer, Joel Z Leibo, Remi Munos, Charles Blundell, Dharshan Kumaran, and Matt Botvinick. Learning to reinforcement learn. arXiv preprint arXiv:1611.05763, 2016.
|
| 273 |
+
|
| 274 |
+
Annie Xie, Frederik Ebert, Sergey Levine, and Chelsea Finn. Improvisation through physical understanding: Using novel objects as tools with visual foresight. In Robotics: Science and Systems, 2019.
|
| 275 |
+
|
| 276 |
+
Tianhe Yu, Chelsea Finn, Annie Xie, Sudeep Dasari, Tianhao Zhang, Pieter Abbeel, and Sergey Levine. One-shot imitation from observing humans via domain-adaptive meta-learning. Robotics: Science and Systems (RSS), 2018.
|
| 277 |
+
|
| 278 |
+
Tianhao Zhang, Zoe McCarthy, Owen Jow, Dennis Lee, Ken Goldberg, and Pieter Abbeel. Deep imitation learning for complex manipulation tasks from virtual reality teleoperation. arXiv preprint arXiv:1710.04615, 2017.
|
| 279 |
+
|
| 280 |
+
Allan Zhou, Eric Jang, Daniel Kappler, Alexander Herzog, Mohi Khansari, Paul Wohlhart, Yunfei Bai, Mrinal Kalakrishnan, Sergey Levine, and Chelsea Finn. Watch, try, learn: Meta-learning from demonstrations and reward. 2020.
|
| 281 |
+
|
| 282 |
+
Luisa M. 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 metalearning. In ICLR, 2020.
|
| 283 |
+
|
| 284 |
+
# Appendices
|
| 285 |
+
|
| 286 |
+
A ALGORITHM
|
| 287 |
+
|
| 288 |
+
# Algorithm 1 RL with Behavioral Priors
|
| 289 |
+
|
| 290 |
+
1: Input: Dataset $\mathcal { D }$ of state-action pairs $( s , a )$ from previous tasks, new task $M ^ { \star }$
|
| 291 |
+
2: Learn $f _ { \phi }$ by maximizing the likelihood term in Equation 2
|
| 292 |
+
3: for step $k$ in $\{ 1 , . . . , \Nu \}$ do
|
| 293 |
+
4: $s $ current observation
|
| 294 |
+
5: Sample $z \sim \pi _ { \theta } ( z | s )$
|
| 295 |
+
6: $a \gets f _ { \phi } ( z ; s )$
|
| 296 |
+
7: $s ^ { \prime } , r \gets$ Execute $a$ in $M ^ { \star }$
|
| 297 |
+
8: Update $\pi _ { \boldsymbol { \theta } } { \left( z | \boldsymbol { s } \right) }$ with $( s , z , s ^ { \prime } , r )$
|
| 298 |
+
9: end for
|
| 299 |
+
10: Return: Policy $\pi _ { \boldsymbol { \theta } } { \left( z | \boldsymbol { s } \right) }$ for task $M ^ { \star }$ .
|
| 300 |
+
|
| 301 |
+
# B IMPLEMENTATION DETAILS AND HYPERPARAMETER TUNING
|
| 302 |
+
|
| 303 |
+
We now provide details of the neural network architectures and other hyperparameters used in our experiments.
|
| 304 |
+
|
| 305 |
+
Behavioral prior. We use a conditional real NVP with four affine coupling layers as our behavioral prior. The architecture for a single coupling layer is shown in Figure 8. We use a learning rate of $1 e { - 4 }$ and the Adam (Kingma & Ba, 2015) optimizer to train the behavioral prior for 500K steps.
|
| 306 |
+
|
| 307 |
+

|
| 308 |
+
Figure 8: Coupling layer architecture. A computation graph for a single affine coupling layer is shown in (a). Given an input noise $z$ , the coupling layers transform it into $z ^ { \prime }$ through the following operations: $z _ { 1 : d } ^ { \prime } = z _ { 1 : d }$ and $z _ { d + 1 : D } ^ { \prime } = z _ { d + 1 : D } \odot \exp ( v ( z _ { 1 : d } ; \phi ( s ) ) ) + t ( z _ { 1 : d } ; \phi ( s ) )$ , where the $v$ , $t$ and $\psi$ are functions implemented using neural networks whose architectures are shown in (b) and (c). Since $v$ and $t$ have the same input, they are implemented using a single fully connected neural network (shown in (b)), and the output of this network is split into two. The image encoder, $\psi ( s )$ is implemented using a convolutional neural network with parameters shown in (c).
|
| 309 |
+
|
| 310 |
+
TrajVAE. For this comparison, we use the same architecture as Ghadirzadeh et al. (2020). The decoder consists of three fully connected layers with 128, 256, and 512 units respectively. BatchNorm (Ioffe & Szegedy, 2015) and ReLU nonlinearity are applied after each layer. The encoder is symmetric: 512, 256, and 128 layers, respectively. The size of the latent space is 8 (same as the behavioral prior). We sweep the following values for the $\beta$ parameter (Higgins et al., 2017a): 0.1, 0.01, 0.005, 0.001, 0.0005, and find 0.001 to be optimal. We initialize $\beta$ to zero at the start of training, and anneal it to the target $\beta$ value using a logistic function, achieving half of the target value in
|
| 311 |
+
|
| 312 |
+
25K steps. We use a learning rate of $1 e { - 4 }$ and the Adam (Kingma & Ba, 2015) optimizer to train this model for 500K steps.
|
| 313 |
+
|
| 314 |
+
HIRL. This comparison is implemented using a conditional variational autoencoder, and uses an architecture that is similar to the one used by the TrajVAE, but with two differences: since this comparison uses image conditioning, we use the same convolutional network $\psi$ as the behavioral prior to encode the image (shown in Figure 8), and pass it as conditioning information to both the encoder and decoder networks. Second, instead of modeling the entire trajectory in a single forward pass, it instead models individual actions, allowing the high-level policy to perform closed-loop control, similar to the behavioral prior model. We sweep the following values for the $\beta$ parameter: 0.1, 0.01, 0.005, 0.001, 0.0005, and find 0.001 to be optimal. We found the annealing process to be essential for obtaining good RL performance using this method. We use a learning rate of $1 e { - 4 }$ and the Adam (Kingma & Ba, 2015) optimizer to train this model for 500K steps.
|
| 315 |
+
|
| 316 |
+
Behavior cloning (BC). We implement behavior cloning via maximum likelihood with a Gaussian policy (and entropy regularization (Haarnoja et al., 2017)). For both behavior cloning and RL with SAC, we used the same policy network architecture as shown in Figure 9. We train this model for 2M steps, using Adam with a learning rate of $3 e ^ { - 4 }$ .
|
| 317 |
+
|
| 318 |
+
VAE-features. For this comparison, we use the standard VAE architecture used for CIFAR-10 experiments (van den Oord et al., 2017). The encoder consists of two strided convolutional layers (stride 2, window size $4 \times 4$ ), which is followed by two residual $3 \times 3$ blocks, all of which have 256 hidden units. Each residual block is implemented as ReLU, 3x3 conv, ReLU, 1x1 conv. The decoder is symmetric to the encoder. We train this model for $1 . 5 \mathbf { M }$ steps, using Adam with a learning rate of $1 e ^ { - 3 }$ and a batch size of 128.
|
| 319 |
+
|
| 320 |
+
Soft Actor Critic (SAC). We use the soft actor critic method (Haarnoja et al., 2018b) as our RL algorithm, with the hyperparameters shown in Table 1. We use the same hyperparameters for all of our RL experiments (our method, HIRL, TrajRL, $\mathrm { B C + S A C }$ , SAC).
|
| 321 |
+
|
| 322 |
+
Table 1: Hyperparameters for soft-actor critic (SAC)
|
| 323 |
+
|
| 324 |
+
<table><tr><td>Hyperparameter</td><td>value used</td></tr><tr><td>Target network update period</td><td>1000 steps</td></tr><tr><td>discount factor y</td><td>0.99</td></tr><tr><td>policy learning rate</td><td>3e-4</td></tr><tr><td>Q-function learning rate</td><td>3e-4</td></tr><tr><td>reward scale</td><td>1.0</td></tr><tr><td>automatic entropy tuning number of update steps per env step</td><td>enabled 1</td></tr></table>
|
| 325 |
+
|
| 326 |
+

|
| 327 |
+
Figure 9: Policy and Q-function network architectures. We use a convolutional neural network to represent the Q-function for SAC, shown in this figure. The policy network is identical, except it does not take in an action as an input and outputs a 7D action instead of a scalar Q-value.
|
| 328 |
+
|
| 329 |
+
# C EXPERIMENTAL SETUP
|
| 330 |
+
|
| 331 |
+
# C.1 TASKS
|
| 332 |
+
|
| 333 |
+
We provided a visual depiction of 4 of our 8 evaluations tasks in Figure 3, and the remaining tasks are shown here in Figure 10.
|
| 334 |
+
|
| 335 |
+

|
| 336 |
+
Figure 10: In the first row, the objective is to grasp a can and lift it above a certain height. Rows two and three are similar, except the objective is to grasp a vase and a baseball cap, respectively. The final row depicts a task where the goal is to pick the baseball cap and place it on the marble cube.
|
| 337 |
+
|
| 338 |
+
# C.2 DATA COLLECTION
|
| 339 |
+
|
| 340 |
+
We collected our dataset using scripted policies detailed in Algorithms 2 and 3.
|
| 341 |
+
|
| 342 |
+
<table><tr><td>Algorithm 2 Scripted Grasping</td><td></td><td>Algorithm3 Scripted Pick and Place</td></tr><tr><td>1:threshold ←0.02</td><td></td><td>1:threshold ← 0.02</td></tr><tr><td>2:1 numTimesteps ←25</td><td></td><td>2:numTimesteps ←25</td></tr><tr><td>3:targetPoint ← object position</td><td></td><td>3:placeAttempted ←False</td></tr><tr><td>4: for tin(O,numTimesteps) do</td><td></td><td>4: dropPos ←point above container</td></tr><tr><td>5:</td><td>eePos ← end effector position</td><td>5: for t in (O, numTimesteps) do</td></tr><tr><td>6:</td><td>targetEEDist ← distance(targetPoint,eePos)</td><td>6: eePos ← end effector position</td></tr><tr><td>7:</td><td>if targetEEDist > threshold then</td><td>7: objectDropDist ← distance(eePos,dropPos)</td></tr><tr><td>8:</td><td>action ← targetPoint-eePos</td><td>if placeAttempted then</td></tr><tr><td>9:</td><td>else if gripperOpened then</td><td>8: 9: action ←0</td></tr><tr><td>10:</td><td>action ← close gripper</td><td>10: else if object not grasped AND objectDropDist</td></tr><tr><td>11:</td><td>else if object not raised high enough then</td><td>> threshold then Execute grasp using Algorithm 2</td></tr><tr><td>12:</td><td>action ← lift upward</td><td>11:</td></tr><tr><td>13:</td><td>else</td><td>12: else if objectDropDist >threshold then</td></tr><tr><td>14:</td><td>action←0</td><td>13: action ← dropPos-eePos</td></tr><tr><td>15:</td><td>end if</td><td>14: else</td></tr><tr><td>16:</td><td>noise ~ N(0,0.1)</td><td>15: action ← open gripper</td></tr><tr><td>17:</td><td>action ←action+noise</td><td>16: placeAttempted ←True 17:</td></tr><tr><td>18:</td><td>s'←env.step(action)</td><td>else</td></tr><tr><td>19: end for</td><td></td><td>action←0</td></tr><tr><td>20:</td><td>19:</td><td>end if</td></tr><tr><td></td><td>20:</td><td>noise ~ N(0,0.1)</td></tr><tr><td></td><td>21:</td><td>action ← action+noise</td></tr><tr><td></td><td>22:</td><td>s'← env.step(action)</td></tr><tr><td></td><td>23: end for</td><td></td></tr></table>
|
| 343 |
+
|
| 344 |
+
# C.3 SIMULATION OBJECTS
|
| 345 |
+
|
| 346 |
+
To collect data in diverse environments, we used 3D object models from the ShapeNet dataset (Chang et al., 2015) and the PyBullet (Coumans & Bai, 2016) object libraries.
|
| 347 |
+
|
| 348 |
+

|
| 349 |
+
Figure 11: Train objects.
|
| 350 |
+
|
| 351 |
+

|
| 352 |
+
Figure 12: Test objects
|
md/train/ZsGg52s-cQZ/ZsGg52s-cQZ.md
ADDED
|
@@ -0,0 +1,273 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Topology-Imbalance Learning for Semi-Supervised Node Classification
|
| 2 |
+
|
| 3 |
+
Deli Chen1,2, Yankai $\mathbf { L i n } ^ { 1 }$ , Guangxiang Zhao2, Xuancheng Ren2, Peng $\mathbf { L i } ^ { 1 }$ , Jie $\mathbf { Z } \mathbf { h o u } ^ { 1 }$ , $\mathbf { X } \mathbf { u } \mathbf { S } \mathbf { u } \mathbf { n } ^ { 2 }$ 1Pattern Recognition Center, WeChat AI, Tencent Inc., China 2MOE Key Lab of Computational Linguistics, School of EECS, Peking University {delichen, yankailin, patrickpli,withtomzhou}@tencent.com {zhaoguangxiang,renxc,xusun}@pku.edu.cn
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
The class imbalance problem, as an important issue in learning node representations, has drawn increasing attention from the community. Although the imbalance considered by existing studies roots from the unequal quantity of labeled examples in different classes (quantity imbalance), we argue that graph data expose a unique source of imbalance from the asymmetric topological properties of the labeled nodes, i.e., labeled nodes are not equal in terms of their structural role in the graph (topology imbalance). In this work, we first probe the previously unknown topology-imbalance issue, including its characteristics, causes, and threats to semisupervised node classification learning. We then provide a unified view to jointly analyzing the quantity- and topology- imbalance issues by considering the node influence shift phenomenon with the Label Propagation algorithm. In light of our analysis, we devise an influence conflict detection–based metric Totoro to measure the degree of graph topology imbalance and propose a model-agnostic method ReNode to address the topology-imbalance issue by re-weighting the influence of labeled nodes adaptively based on their relative positions to class boundaries. Systematic experiments demonstrate the effectiveness and generalizability of our method in relieving topology-imbalance issue and promoting semi-supervised node classification. The further analysis unveils varied sensitivity of different graph neural networks (GNNs) to topology imbalance, which may serve as a new perspective in evaluating GNN architectures.1
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Graph is a widely-used data structure [51], where the nodes are connected to each other through natural or handcrafted edges. Similar to other data structures, the representation learning for node classification faces the challenge of quantity-imbalance issue, where the labeling size varies among classes and the decision boundaries of trained classifiers are mainly decided by the majority classes [46]. There have been a series of studies [35, 11, 49] handling the Quantity-Imbalance Node Representation Learning (short as QINL). However, different with other data structures, graph-structured data suffers from another aspect of the imbalance problem: the imbalance caused by the asymmetric and uneven topology of labeled nodes, where the decision boundaries are driven by the labeled nodes close to the topological class boundaries (left of Figure 1) thus interfering with the model learning.
|
| 12 |
+
|
| 13 |
+
Present Work. For the first time, we recognize the Topology-Imbalance Node Representation Learning (short as TINL) as a graph-specific imbalance learning topic, which mainly focus on the decision boundaries shift phenomena driven by the topology imbalance in graph and is an essential component for node imbalance learning. Comparing with the well-explored QINL that studies the imbalance caused by the numbers of labeled nodes, TINL explores the imbalance caused by the positions of labeled nodes and owns the following characteristics:
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Schematic diagram of the topology-imbalance issue in node representation learning. The color and the hue denote the type and the intensity of each node’s received influence from the labeled nodes, respectively. The left shows that nodes close to the boundary have the risk of information conflict and nodes far away from labeled nodes have the risk of information insufficient. The right shows that our method can decrease the training weights of labeled nodes (R1) close to the class boundary and increase the weights of labeled nodes (B and R2) close to the class centers, thus relieving the topology-imbalance issue.
|
| 17 |
+
|
| 18 |
+
• Ubiquity: Due to the complex connections of the graph nodes, the topology structure of nodes in different categories is naturally asymmetric, which makes TINL an essential characteristic in node representation learning. Hence, it is difficult to construct a completely symmetric labeling set even with an abundant annotation budget. • Perniciousness: The influence from labeled nodes decays with the topology distance [3]. The asymmetric topology of labeled nodes in different classes and the uneven distribution of labeled nodes in the same class will cause the influence conflict and influence insufficient problems (left of Figure 1) respectively, resulting in a shift of decision boundaries. • Orthogonality: Quantity-imbalance studies [49, 8, 5] usually treat the labeled nodes of the same class as a whole and devise solutions based on the total numbers of each class, while TINL explores the influence of the unique position of each labeled node on decision boundaries. Thus, TINL is independent of QINL in terms of the object of study.
|
| 19 |
+
|
| 20 |
+
Exploring TINL is of great importance for node representation learning due to its ubiquity and perniciousness. However, the methods [17, 22] for quantity imbalance can be hardly applied to TINL because of the orthogonality. To remedy the topology-imbalance issue, thus promoting the node classification, we propose a model-agnostic training framework ReNode to re-weight the labeled nodes according to their positions. We devise the conflict detection-based Topology Relative Location (Totoro) metric to leverage the interaction among labeled nodes across the whole graph to locate their structural positions. Based on the Totoro metric, we further increase the training weights of nodes with small conflict that are highly likely to be close to topological class centers to make them play a more pivotal role during training, and vice versa (right of Figure 1). Empirical results of various imbalance scenarios (TINL, QINL, large-scale graph) and multiple graph neural networks (GNNs) demonstrate the effectiveness and generalizability of our method. Besides, we provide the sensitivity to topology imbalance as a new evaluation perspective for different GNN architectures.
|
| 21 |
+
|
| 22 |
+
# 2 Topology-Imbalance Node Representation Learning
|
| 23 |
+
|
| 24 |
+
# 2.1 Notations and Preliminary
|
| 25 |
+
|
| 26 |
+
In this work, we follow the well-established semi-supervised node classification setting [47, 18] to conduct analyses and experiments. Given an undirected and unweighted graph $\mathcal { G } = ( \boldsymbol { \nu } , \pmb { \varepsilon } , \pmb { c } )$ , where $\nu$ is the node set represented by the feature matrix $\boldsymbol { X } \in \mathbb { R } ^ { n * d }$ $\dot { \boldsymbol { n } } = | \boldsymbol { \nu } |$ is the node size and $d$ is the node embedding dimension), $\varepsilon$ is the edge set which is represented by an adjacency matrix $A \in \mathbb { R } ^ { n * n }$ , $\pmb { \mathcal { L } } \subset \nu$ is the labeled node set and usually we have $| \bar { \boldsymbol { L } } | \ll | \boldsymbol { \nu } |$ , the node classification task is to train a classifier $\mathcal { F }$ (usually a GNN) to predict the class label y for the unlabeled node set $u = \nu - c$ . The training sets for different classes are represented by $( \pmb { \mathscr { C } } _ { 1 } , \pmb { \mathscr { C } } _ { 2 } , \cdots , \pmb { \mathscr { C } } _ { k } )$ and $k$ is the number of classes. The labeling ratio $\delta = \angle \mathcal { x } / \nu$ is the proportion of labeled nodes in all nodes. In this work, we focus on TINL in homogeneously-connected graphs and hope to inspire future studies on the critical topology-imbalance issue.
|
| 27 |
+
|
| 28 |
+

|
| 29 |
+
Figure 2: Node influence and boundary shift caused by quantity- and topology-imbalance. (a): The prediction results of GCN and LP are highly consistent (t-SNE [39] visualization of the $C O R A$ dataset). (b): The node influence boundary (the yellow dotted line) is shifted towards the small class from the true class boundary (the black dotted line) under the quantity- and topology-imbalance scene. (c): The node influence boundary is shifted towards the large class under the quantity-balanced, topology-imbalanced scene. We regard the large class as positive class to indicate the results.
|
| 30 |
+
|
| 31 |
+
# 2.2 Understanding Topology Imbalance via Label Propagation
|
| 32 |
+
|
| 33 |
+
From Figure 1, we can intuitively perceive the imbalance brought by the positions of labeled nodes; in this part, we further explore the nature of topology imbalance with the well-known Label Propagation [50] algorithm (short as LP) and provide a uniform analysis framework for the comprehensive node imbalance issue. In LP, labels are propagated from the labeled nodes and aggregated along edges, which can also be viewed as a random walk process from labeled nodes. The convergence result $\mathbf { Y }$ after repeated propagation is regarded as the nodes soft-labels:
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
\pmb { Y } = \alpha ( \pmb { I } - ( 1 - \alpha ) \pmb { A } ^ { \prime } ) ^ { - 1 } \pmb { Y } ^ { 0 } ,
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
where $\pmb { I }$ is the identity matrix, $\alpha \in ( 0 , 1 ]$ is the random walk restart probability, $A ^ { \prime } = D ^ { - { \frac { 1 } { 2 } } } A D ^ { - { \frac { 1 } { 2 } } }$ is the adjacency matrix normalized by the diagonal degree matrix $_ { D }$ , $\mathbf { \dot { Y } } ^ { 0 }$ is the initial label distribution where labeled nodes are represented by the one-hot vectors. The prediction label for the $i$ -th node is $q _ { i } = \arg \operatorname* { m a x } _ { j } Y _ { i j }$ . LP is a simple yet successful model [37] and can be unified with GNN models owning the message-passing mechanism [41]. From Figure 2(a), we can empirically find that there is a significant correlation between the results of LP and GCN (T/F indicates prediction is True/False).
|
| 40 |
+
|
| 41 |
+
The LP prediction $\pmb q$ can be viewed as the distribution of the (labeled) node influence [41] (i.e. each node is mostly influenced by which class’s information); hence the boundaries of the node influence can act as an effective reflection for the GNN model decision boundaries considering the high consistency between LP and GNN. Moreover, node influence offers a unified view of TINL and QINL: ideally, the node influence boundaries should be consistent with the true class boundaries, but both the labeled nodes’ numbers (QINL) and positions (TINL) can cause a shift of the node influence boundaries from the true one, resulting in deviation of the model decision boundaries.
|
| 42 |
+
|
| 43 |
+
Node imbalance issue is composed of topology- and quantity-imbalance. Figure 2 illustrates two examples of node influence boundary shift. In Figure 2(b), when the uniform selection is adopted to generate training set, both the quantity and the topology are imbalanced for model training; then the large class with more total nodes (denotes by blue color) will own stronger influence than the small class with fewer total nodes (denotes by red color) due to the quantity advantage and the node influence boundary is shifted towards the small class. In Figure 2(c), when the quantity-balanced strategy is adopted for sampling training nodes, it will be easier for the small class to has more labeled nodes close to the class boundary and the boundary of the node influence is shifted into the large class. We can find that even when the training set is quantity-balanced, the topology-imbalance issue still exists and hinders the node classification learning. Hence, we can conclude that node imbalance learning is caused by the joint effect of TINL and QINL. Separately considering TINL or QINL will lead to a one-sided solution to node imbalance learning.
|
| 44 |
+
|
| 45 |
+

|
| 46 |
+
Figure 3: Effectiveness of Totoro at (a) Node Level: labeled nodes (t-SNE visualization of the CORA dataset) with less influence conflict (lighter color) are farther-away from class boundaries than those with high conflict (darker color), and (b) Dataset Level: There is a significant negative correlation between the GNN (GCN) performance and overall conflict of the training set (the Pearson correlation coefficient is $- 0 . 6 1 8$ over 50 randomly selected training sets with the $p$ value smaller than 0.01).
|
| 47 |
+
|
| 48 |
+
# 2.3 Measuring Topology Imbalance by Influence Conflict
|
| 49 |
+
|
| 50 |
+
Although we have realized that the imbalance of node topology interferes with model learning, how to measure the labeled node’s relative topological position to its class (being far away from or close to the class center) remains the key challenge in handling the topology-imbalance issue due to the complex graph connections and the unknown class labels for most nodes in the graph. As the nodes are homogeneously connected when constructing the graph, even nodes close to the class boundaries own similar characteristics to their neighbors. Thus it is unreliable to leverage the difference between the characteristics of one labeled node and its surrounding subgraphs to locate its topological position. Instead, we propose to utilize the node topology information by considering the node influence conflict across the whole graph and devise the Conflict Detection-based Topology Relative Location metric (Totoro).
|
| 51 |
+
|
| 52 |
+
Similar to Eq (1), we calculate the Personalized PageRank [27] matrix $_ { r }$ to measure node influence distribution from each labeled node:
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
P = \alpha ( { \cal I } - ( 1 - \alpha ) A ^ { \prime } ) ^ { - 1 } .
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
Node influence conflict denotes topological position. According to related studies [41, 19, 2], $_ { r }$ can be viewed as the distribution of influence exerted outward from each node. We assume that if a labeled node $v \in \nu$ encounters strong heterogeneous influence from the other classes’ labeled nodes in the subgraph around node $v$ where node $v$ itself owns great influence, we have the conclusion that node $v$ meets large influence conflict in message passing and it is close to topological class boundaries, and vice versa. Based on this hypothesis, we take the expectation of the influence conflict between the node $v$ and the labeled nodes from other classes when node $v$ randomly walks across the entire graph as a measurement of how topologically close node $v$ is to the center of the class it belongs to. The Totoro value of node $v$ is computed as:
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\pmb { T } _ { v } = \mathbb { E } _ { \boldsymbol { x } \sim \pmb { P } _ { v , : } } [ \sum _ { \substack { j \in [ 1 , k ] , j \neq y _ { v } } } \frac { 1 } { | \pmb { \mathcal { C } } _ { j } | } \sum _ { i \in \pmb { \mathcal { C } } _ { j } } \pmb { P } _ { i , x } ] ,
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
where $\mathbf { \nabla } _ { \mathbf { y } _ { v } }$ is the ground-truth label of node $v$ , $P _ { v }$ indicates the personalized PageRank probability vector for the node $v$ . A larger Totoro value $\mathbf { \delta } _ { \mathbf { \mathcal { T } } _ { v } }$ indicates that node $v$ is topologically closer to class boundaries, and vice versa. The normalization item $1 / | c _ { j } |$ is added to make the influence from the different classes comparable when computing conflict.
|
| 65 |
+
|
| 66 |
+
We visualize the node labels and the Totoro values (scaled to $[ 0 , 1 ] $ ) of labeled nodes in Figure 3(a). We can find that the labeled nodes with smaller Totoro values are farther away from the class boundaries, demonstrating the effectiveness of Totoro in locating the positions of labeled nodes. Besides, we sum the conflict of all the labeled nodes $\textstyle \sum _ { b \in { \mathcal { L } } } T _ { v }$ to measure the overall conflict of the dataset, which can be viewed as the metric for the overall topology imbalance given the graph $\mathfrak { g }$ and the training set $\mathcal { L }$ . Figure 3(b) shows that there is a significant negative correlation between the overall conflict and the model performance, which further demonstrates the effectiveness of Totoro in measuring the intensity of topology imbalance at the dataset level.
|
| 67 |
+
|
| 68 |
+
# 2.4 Alleviate Topology Imbalance by Instance-wise Node Re-weighting
|
| 69 |
+
|
| 70 |
+
In this section, we introduce ReNode, a model-agnostic training weight schedule mechanism to address TINL for general GNN encoder in a plug-and-play manner. Inspired by the analysis in Section 2.2, the ReNode method is devised to promote the training weights of the labeled nodes that are close to the topological class centers, so as to make these nodes play a more active role in model learning, and vice versa. Specifically, we devise a cosine annealing mechanise 2 for the training node weights based on their Totoro values:
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
{ \pmb w } _ { v } = w _ { \mathrm { m i n } } + \frac { 1 } { 2 } ( w _ { \mathrm { m a x } } - w _ { \mathrm { m i n } } ) ( 1 + \cos ( \frac { \mathrm { R a n k } ( { \pmb T } _ { v } ) } { | { \pmb L } | } \pi ) ) , \quad v \in { \pmb C }
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
where $\pmb { w } _ { v }$ is the modified training weight for the labeled node $v , w _ { \mathrm { m i n } } , w _ { \mathrm { m a x } }$ are the hyper-parameters indicating the lower bound and upper bound of the weight correction factor, $\mathrm { R a n k } ( \pmb { T } _ { v } )$ is the ranking order of $\mathbf { \delta } _ { \mathbf { \mathcal { T } } _ { v } }$ from the smallest to the largest. The training loss $L _ { T }$ for the quantity-balanced, topologyimbalanced node classification task is computed by the following equations:
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
L _ { T } = - \frac { 1 } { | { \cal { L } } | } \sum _ { v \in { \cal { L } } } w _ { v } \sum _ { c = 1 } ^ { k } y _ { v } ^ { * c } \log \ g _ { v } ^ { c } , \quad g = \mathrm { s o f t m a x } ( { \mathcal { F } } ( X , A , \theta ) ) ,
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
where $\mathcal { F }$ denotes any GNN encoder, $\pmb \theta$ is the parameter of ${ \mathcal { F } } , g _ { i }$ is the GNN output for node $i$ , $\mathbf { \nabla } _ { \mathbf { \boldsymbol { y } } _ { i } ^ { * } }$ is the gold label for node $i$ in one-hot embedding. By encouraging the positive effects of the labeled nodes near the class topological centers, and reducing the negative effects of those near the topological class boundaries, our ReNode method is expected to minimize the deviation between the node influence boundaries and the true class boundaries, so as to correct the class imbalance caused by the positions of labeled nodes.
|
| 83 |
+
|
| 84 |
+
ReNode to Jointly Handle TINL and QINL In this part, we introduce the application of the ReNode method in a more general graph imbalance scenario where both the topology- and quantityimbalance issues exist. As analyzed in previous sections, the TINL and QINL are orthogonal problems. Therefore, we propose that our ReNode method based on (labeled) node topology can be seamlessly combined with the existing methods designed for the quantity-imbalance learning. Without loss of generality, we present how our ReNode method can be combined with the vanilla class frequency-based re-weight method [17]. The training loss $L _ { Q }$ for the quantity-imbalanced, topology-imbalanced node classification task is formalized in the following equation:
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
L _ { Q } = - \frac { 1 } { | \mathcal { L } | } \sum _ { v \in \mathcal { L } } w _ { v } \frac { | \bar { \mathcal { C } } | } { | \mathcal { C } _ { j } | } \sum _ { c = 1 } ^ { k } { y } _ { v } ^ { * c } \log \textbf { \em g } _ { v } ^ { c } ,
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
where $| \bar { c } |$ is the average number of the class training sizes. With this method, the final weight of the labeled node is affected by two perspectives: training examples of the minority classes will have higher weights than that of the majority classes; training examples close to the topological class centers will have higher weights than those are close to the topological class boundaries.
|
| 91 |
+
|
| 92 |
+
ReNode for Large-scale Graph There are mainly two challenges when applying ReNode to largescale graphs: (1) how to calculate the PageRank matrix, and (2) how to train the GNN model in an inductive setting [13]. In this work, we follow the PPRGo method [2] to implement our method on the large-scale graph, which can decouple the feature learning process from the information transmission process to resolve the dependence on the global graph topology structure and can be carried out much efficiently. Following PPRGo, the Personalized PageRank matrix $\hat { P }$ and the corresponding training ReNode factor $\hat { \pmb { w } }$ are generated by the estimation method from Andersen et al. [1] and then $\hat { P }$ is directly employed as the aggregation weights from all the other nodes regardless of their topology distance from the current node:
|
| 93 |
+
|
| 94 |
+
Table 1: ReNode (short as RN) for the pure topology-imbalance issue. We report Weighted-F1 (W-F, $\%$ ), Macro-F1 (M-F, $\%$ ) and the corresponding standard deviation for each group of experiments. $^ *$ and $^ { \ast \ast }$ represent the result is significant in student t-test with $p < 0 . 0 5$ and $p < 0 . 0 1$ , respectively.
|
| 95 |
+
|
| 96 |
+
<table><tr><td rowspan="2">Model</td><td rowspan="2">Training</td><td colspan="2">CORA</td><td colspan="2">CiteSeer</td><td colspan="2">PubMed</td><td colspan="2">Photo</td><td colspan="2">Computers</td></tr><tr><td>W-F</td><td>M-F</td><td>W-F</td><td>M-F</td><td>W-F</td><td>M-F</td><td>W-F</td><td>M-F</td><td>W-F</td><td>M-F</td></tr><tr><td rowspan="2">GCN</td><td>w/oRN</td><td>79.1±1.1</td><td>77.8±1.5</td><td>66.2±1.0</td><td>62.0±1.3</td><td>74.6±2.1</td><td>74.7±1.9</td><td>86.8±2.0</td><td>84.7±1.7</td><td>74.2±2.6</td><td>73.6±2.9</td></tr><tr><td>w/RN</td><td>79.8**±0.9</td><td>78.6**±1.2</td><td>66.9* ±1.1</td><td>62.8* ±1.4</td><td>76.1** ±1.5</td><td>76.1**±1.8</td><td>87.7**±2.2</td><td>85.4**±1.9</td><td>74.7* ±2.2</td><td>74.5**±2.3</td></tr><tr><td rowspan="2">GAT</td><td>w/o RN</td><td>76.0±1.7</td><td>74.9±1.9</td><td>66.3±2.8</td><td>62.4±2.6</td><td>73.9±2.2</td><td>73.9±2.1</td><td>88.3±2.0</td><td>86.2±2.2</td><td>79.0±2.1</td><td>78.8±2.3</td></tr><tr><td>W/RN</td><td>77.7**±*2.0</td><td>76.2**±1.8</td><td>67.1*±1.9</td><td>63.2*±1.6</td><td>75.2**±2.0</td><td>75.1**±2.5</td><td>89.1**±2.0</td><td>87.1**±2.0</td><td>78.8±1.9</td><td>78.7±2.0</td></tr><tr><td rowspan="2">PPNP</td><td>w/oRN</td><td>80.5±1.6</td><td>79.1±1.4</td><td>67.5±1.8</td><td>63.2±1.6</td><td>74.6±1.9</td><td>74.7±1.7</td><td>89.3±1.3</td><td>86.8±1.4</td><td>78.7±1.5</td><td>77.7±1.7</td></tr><tr><td>w/RN</td><td>81.9**±0.6</td><td>80.5**±0.8</td><td>68.1* ±1.4</td><td>63.7* ±2.0</td><td>76.0**±2.0</td><td>76.1**±2.2</td><td>89.7*±1.0</td><td>87.2* ±1.3</td><td>79.0* ±1.1</td><td>78.3* ±11</td></tr><tr><td rowspan="2">SAGE</td><td>w/o RN</td><td>75.1±1.7</td><td>74.6±1.4</td><td>67.0±1.4</td><td>63.0±1.4</td><td>74.2±2.2</td><td>74.2±2.1</td><td>86.2±2.6</td><td>83.9±2.4</td><td>73.5±3.4</td><td>71.6±2.5</td></tr><tr><td>w/RN</td><td>75.7**±1.7</td><td>75.1**±1.4</td><td>67.3±1.4</td><td>63.5* ±1.2</td><td>74.9**±1.9</td><td>78.2**±2.3</td><td>86.5±1.7</td><td>84.1±1.7</td><td>74.9**±3.0</td><td>72.3**±2.5</td></tr><tr><td rowspan="2">CHEB</td><td>w/oRN</td><td>74.5±1.1</td><td>73.4±1.1</td><td>66.8±1.8</td><td>63.2±1.6</td><td>75.1±1.8</td><td>75.2±1.1</td><td>82.1±2.2</td><td>79.4±3.5</td><td>70.3±4.0</td><td>68.4±3.4</td></tr><tr><td>w/RN</td><td>75.3**±1.1</td><td>74.0**±1.1</td><td>67.5**±1.6</td><td>63.8**±1.5</td><td>76.2**±1.4</td><td>76.3**±1.2</td><td>84.8**±2.4</td><td>82.1**±2.8</td><td>70.5±4.0</td><td>68.6±3.4</td></tr><tr><td rowspan="2">SGC</td><td>w/oRN</td><td>74.9±2.1</td><td>73.8±2.1</td><td>65.7±1.6</td><td>61.8±1.6</td><td>72.9±2.3</td><td>73.1±2.6</td><td>87.1±1.3</td><td>84.9±11</td><td>77.4±1.7</td><td>76.8±1.8</td></tr><tr><td>w/RN</td><td>77.0**±1.1</td><td>76.0**±1.1</td><td>67.2**±1.3</td><td>62.9**±1.8</td><td>73.7**±2.8</td><td>73.8**±2.1</td><td>87.4±1.5</td><td>85.2±1.5</td><td>78.2**±1.8</td><td>77.8**±1.2</td></tr></table>
|
| 97 |
+
|
| 98 |
+
Table 2: Result of different dataset conflict levels (High/Middle/Low). Our ReNode method improve the GNN (GCN) performance most when the conflict level of graph is high.
|
| 99 |
+
|
| 100 |
+
<table><tr><td>W-F(%)</td><td>CORA-H</td><td>CORA-M</td><td>CORA-L</td><td>CiteSeer-H</td><td>CiteSeer-M</td><td>CiteSeer-L</td><td>PubMed-H</td><td>PubMed-M</td><td>|PubMed-L</td></tr><tr><td>w/o RN w/RN</td><td>76.5±1.3 78.7**±0.8</td><td>78.4±0.7 79.3**±0.6</td><td>79.7±0.8 80.4**±0.6</td><td>62.6±1.5 63.8**±1.3</td><td>65.3±0.6 66.0**±0.8</td><td>67.3±1.1 67.5±1.4</td><td>72.1±2.4 74.3**±2.1</td><td>74.7±1.8 75.6**±1.9</td><td>78.3±1.8 78.8* ±1.5</td></tr></table>
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\pmb { g } ^ { \prime } = \mathrm { s o f t m a x } ( \hat { P } \mathcal { F } ^ { \prime } ( \pmb { X } , \pmb { \theta } ^ { \prime } ) ) ,
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
where ${ \mathcal { F } } ^ { \prime }$ can be a linear layer or a multi-layer perceptron with parameter $\theta ^ { \prime }$ . The final training loss for large-scale graph $L _ { L }$ follows Eq (5) and (6), and replaces $\pmb { w }$ and $\textbf { { g } }$ with $\hat { \pmb { w } }$ and $\pmb { g } ^ { \prime }$ .
|
| 107 |
+
|
| 108 |
+
# 3 Experiments
|
| 109 |
+
|
| 110 |
+
In this section, we will first introduce the experimental datasets for both transductive and inductive semi-supervised node classification. Then we introduce the experiments to verify the effectiveness of the proposed ReNode method in three different imbalance situations: (1) TINL only, (2) TINL and QINL, (3) Large-scale Graph.
|
| 111 |
+
|
| 112 |
+
# 3.1 Datasets
|
| 113 |
+
|
| 114 |
+
We adopt two sets of graph datasets to conduct experiments. For the transductive setting [13], we take the widely-used Plantoid paper citation graphs [33] (CORA,CiteSeer, Pubmed) and the Amazon copurchase graphs [24] (Photo,Computers) to verify the effectiveness of our method. For the inductive setting, we conduct experiments on the popular Reddit dataset [13] and the enormous MAG-Scholar dataset (coarse-grain version) [2] which owns millions of nodes and features. For each of these datasets, we repeat experiments on 5 different datasets splittings [34] and we run 3 times for each splitting to reduce the random variance. More details about the datasets and experiment settings are presented in Appendix A.
|
| 115 |
+
|
| 116 |
+
# 3.2 ReNode for the Pure Topology-imbalance Issue
|
| 117 |
+
|
| 118 |
+
Settings When considering topology-imbalance only, the labeling set takes a balanced setting and the annotation size for each class is all equal to $| \dot { \mathcal { L } } | / k$ . Following the most widely-used semisupervised setting in node classification studies [47, 18], we randomly select 20 nodes in each class for training and 30 nodes per class for validation; all the remaining nodes form the test set. We display the experiment results for the 5 transductive datasets on 6 widely-used GNN models: GCN [18], GAT [40], PPNP [19], GraphSAGE [13] (short as SAGE), ChebGCN [9] (short as CHEB) and SGC [43]. We strictly align the hyperparameters in each group of experiments to show the pure improvement brought by our ReNode method (similarly hereinafter). The training loss $L _ { T }$ from section 2.4 is adopted.
|
| 119 |
+
|
| 120 |
+
Table 3: ReNode method for the compound scene of TINL and QINL. The imbalance ratio $\rho$ is set to different levels ([5, 10]) to test the effect of our method under different imbalance intensities.
|
| 121 |
+
|
| 122 |
+
<table><tr><td rowspan=1 colspan=1>Macro-F1(%)</td><td rowspan=1 colspan=2>CORA</td><td rowspan=1 colspan=2>CiteSeer</td><td rowspan=1 colspan=2>PubMed</td><td rowspan=1 colspan=2>Photo</td><td rowspan=1 colspan=2>Computers</td></tr><tr><td rowspan=1 colspan=1>Imbalance Ratio</td><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>10</td></tr><tr><td rowspan=1 colspan=1>CE</td><td rowspan=1 colspan=1>60.9±1.5</td><td rowspan=1 colspan=1>41.0±3.5</td><td rowspan=1 colspan=1>53.6±2.1</td><td rowspan=1 colspan=1>47.6±2.8</td><td rowspan=1 colspan=1>61.0±1.9</td><td rowspan=1 colspan=1>49.7±2.6</td><td rowspan=1 colspan=1>62.0±2.7</td><td rowspan=1 colspan=1>40.7±3.4</td><td rowspan=1 colspan=1>50.4±2.6</td><td rowspan=1 colspan=1>35.5±3.2</td></tr><tr><td rowspan=1 colspan=1>DR-GCN</td><td rowspan=1 colspan=1>67.7±1.1</td><td rowspan=1 colspan=1>51.3±1.4</td><td rowspan=1 colspan=1>54.7±1.7</td><td rowspan=1 colspan=1>52.5±2.6</td><td rowspan=1 colspan=1>79.4±1.2</td><td rowspan=1 colspan=1>78.0±1.6</td><td rowspan=1 colspan=1>80.8±2.3</td><td rowspan=1 colspan=1>79.5±2.8</td><td rowspan=1 colspan=1>66.9±3.5</td><td rowspan=1 colspan=1>67.4±3.6</td></tr><tr><td rowspan=2 colspan=1>RA-GCNG-SMOTE</td><td rowspan=1 colspan=1>69.0±1.5</td><td rowspan=2 colspan=1>51.7±1.749.6±1.1</td><td rowspan=2 colspan=1>55.6±1.354.0±1.6</td><td rowspan=1 colspan=1>52.7±2.1</td><td rowspan=2 colspan=1>80.6±1.879.7±1.2</td><td rowspan=2 colspan=1>78.1±2.176.4±1.5</td><td rowspan=2 colspan=1>81.4±2.682.2±1.8</td><td rowspan=2 colspan=1>79.4±3.277.5±2.1</td><td rowspan=2 colspan=1>71.2±2.871.9±2.5</td><td rowspan=1 colspan=1>68.7±3.0</td></tr><tr><td rowspan=1 colspan=1>68.1±0.9</td><td rowspan=1 colspan=1>51.8±1.3</td><td rowspan=1 colspan=1>61.3±3.2</td></tr><tr><td rowspan=1 colspan=1>RW (w/o RN)</td><td rowspan=1 colspan=1>69.1±1.4</td><td rowspan=1 colspan=1>49.7±1.6</td><td rowspan=1 colspan=1>53.6±2.3</td><td rowspan=1 colspan=1>52.9±2.6</td><td rowspan=1 colspan=1>80.5±1.5</td><td rowspan=1 colspan=1>78.0±2.0</td><td rowspan=1 colspan=1>80.5±2.7</td><td rowspan=1 colspan=1>80.4±3.3</td><td rowspan=1 colspan=1>70.5±3.2</td><td rowspan=1 colspan=1>67.8±4.2</td></tr><tr><td rowspan=1 colspan=1>RW (w/ RN)</td><td rowspan=1 colspan=1>70.0*±1.3</td><td rowspan=1 colspan=1>50.1±1.7</td><td rowspan=1 colspan=1>55.2**±1.8</td><td rowspan=1 colspan=1>54.0**±2.5</td><td rowspan=1 colspan=1>81.2* ±1.0</td><td rowspan=1 colspan=1>78.5*±2.2</td><td rowspan=1 colspan=1>83.9**±2.1</td><td rowspan=1 colspan=1>81.3**±3.2</td><td rowspan=1 colspan=1>72.4**±2.6</td><td rowspan=1 colspan=1>70.2**±2.4</td></tr><tr><td rowspan=2 colspan=1>FOCAL (w/o RN)FOCAL (w/RN)</td><td rowspan=1 colspan=1>66.4±1.6</td><td rowspan=1 colspan=1>51.9±1.8</td><td rowspan=1 colspan=1>54.3±1.3</td><td rowspan=1 colspan=1>54.0±1.9</td><td rowspan=1 colspan=1>80.5±0.7</td><td rowspan=1 colspan=1>78.0±1.6</td><td rowspan=1 colspan=1>79.3±1.9</td><td rowspan=1 colspan=1>79.2±2.2</td><td rowspan=1 colspan=1>65.8±2.7</td><td rowspan=1 colspan=1>63.9±2.6</td></tr><tr><td rowspan=1 colspan=1>68.7**±0.7</td><td rowspan=1 colspan=1>52.6**±1.9</td><td rowspan=1 colspan=1>54.6±1.2</td><td rowspan=1 colspan=1>54.7*±1.5</td><td rowspan=1 colspan=1>80.9*±0.8</td><td rowspan=1 colspan=1>78.7**±1.4</td><td rowspan=1 colspan=1>80.0**±*2.3</td><td rowspan=1 colspan=1>80.7**±2.9</td><td rowspan=1 colspan=1>68.6**±3.1</td><td rowspan=1 colspan=1>65.5**±3.5</td></tr><tr><td rowspan=2 colspan=1>CB (w/o RN)CB (w/RN)</td><td rowspan=1 colspan=1>69.8±1.5</td><td rowspan=2 colspan=1>51.5±1.551.9*±1.2</td><td rowspan=2 colspan=1>54.1±1.354.7*±1.6</td><td rowspan=2 colspan=1>53.5±0.854.3**±2.3</td><td rowspan=2 colspan=1>80.6±0.881.2*±1.8</td><td rowspan=2 colspan=1>77.6±1.678.3**±2.6</td><td rowspan=2 colspan=1>77.9±2.679.6** ±2.7</td><td rowspan=2 colspan=1>78.8±3.180.4**±3.3</td><td rowspan=2 colspan=1>69.6±2.273.1**±3.1</td><td rowspan=2 colspan=1>64.8±2.966.5**±3.6</td></tr><tr><td rowspan=1 colspan=1>71.1**±0.6</td></tr></table>
|
| 123 |
+
|
| 124 |
+
Results From Table 1, we can find that our ReNode method can effectively improve the overall performance (Weighted-F1) and the class-balance performance (Macro-F1) for all the 6 experiment GNNs in most cases, which proves the effectiveness and generalizability of our method. Our method considers the graph-specific topology imbalance issue which has been usually neglected in existing methods and conducts a fine-grained and self-adaptive adjustment to the training node weights based on their topological positions. We notice that the improvement for the CiteSeer dataset is less than the other datasets. We analyze the reason lies in that the connectivity of CiteSeer is poor, which makes the conflict detection–based method fail to reflect the node topological position well. To verify the motivation of relieving topology-imbalance, we set training sets with different levels of topologyimbalance to test our method3. Table 2 displays that our ReNode method improves the performance of GNN (GCN) most when the dataset is highly topologically imbalanced, which demonstrates that our method can effectively alleviate topology-imbalance and improve GNN performance.
|
| 125 |
+
|
| 126 |
+
# 3.3 ReNode for the Compound Scene of TINL and QINL
|
| 127 |
+
|
| 128 |
+
Settings When jointly considering both topology- and quantity-imbalance issues, following existing studies [5, 4], we take the step imbalance setting, in which all the minority classes have the same labeling size $n _ { i }$ and all the majority classes have the same labeling size $n _ { a } = \rho * n _ { i }$ . The imbalance ratio $\rho$ denotes the intensity of quantity imbalance which is equal to the ratio of the node size of the most frequent to least frequent class. In this work, the imbalance ratio $\rho$ is set to [5, 10] for each dataset. The fraction of the majority classes is $\mu$ , and for all experiments, we set $\mu = 0 . 5$ and round down the result $\mu * k$ . The training loss $L _ { Q }$ from section 2.4 is adopted. We implement two groups of baselines for comparison: (1) Popular quantity-imbalance methods for general scenarios: Re-weight [17] (RW), Focal Loss [22] (Focal) and Class Balanced Loss [8] (CB); (2) Graph-specific quantity-imbalance methods: DR-GCN [35], RA-GCN [11] and GraphSMOTE [49]. To jointly handle the topology- and quantity-imbalance issues and demonstrate the orthogonality of them, we combine our ReNode method with these three general quantity-imbalance methods (RW, Focal, CB)4. The backbone model is GCN [18], and the labeling ratio $\delta$ is set to $5 \%$ .
|
| 129 |
+
|
| 130 |
+
Results From Table 3 (Macro-F1 is reported here for a fair comparison with these methods designed for class-balance performance), we can find that our ReNode method significantly outperforms both the general and the graph-specific quantity-imbalance methods in most situations by simultaneously alleviating the topology- and quantity-imbalance issues. Even when the training set is severely quantity-imbalanced $\scriptstyle ( \rho = 1 0 )$ , our method still effectively alleviates the imbalance issue and promotes model performance well. The performance of the quantity-imbalance methods from the general field (RW, Focal, CB) is on par with or less effective than the graph-specific quantity-imbalance methods (DR-GCN, RA-GCN, G-SMOTE), while the combination of our ReNode method and these general quantity-imbalance methods can surpass the graph-specific quantity-imbalance methods, which demonstrates that the node imbalance learning can be further solved by jointly handling the topology- and quantity-imbalance issues instead of considering the quantity-imbalance issue only.
|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
Figure 4: Experimental results (Weighted-F1, $\%$ ) on the large-scale Reddit and MAG-Scholar graphs. Our ReNode method can effectively improve the model performance under different labeling sizes.
|
| 134 |
+
|
| 135 |
+

|
| 136 |
+
Figure 5: Evaluating GNNs from the aspect of topology-imbalance sensitivity (Metric: Weighted-F1 $( \% ) ,$ ). We can summarize the ranking of topology-imbalance sensitivity: $\mathrm { G C N } > \mathrm { P P N P } > \mathrm { G A T }$ .
|
| 137 |
+
|
| 138 |
+
# 3.4 ReNode for Large-scale Graphs
|
| 139 |
+
|
| 140 |
+
Settings We conduct experiments on the two large-scale datasets: Reddit and MAG-Scholar, to verify the effectiveness of our ReNode method in the inductive setting. We conduct experiments with different labeling sizes (20/50/100 training nodes per class) and imbalance settings (TINL-only, TINL and QINL). The backbone GNN model is PPRGo [2] 5. For QINL, we take the uniform selection to sample training nodes to be consistent with PPRGo. The training loss $L _ { L }$ from section 2.4 is adopted. Both baseline and our methods are not combined with any quantity-imbalance method.
|
| 141 |
+
|
| 142 |
+
Results In Figure 4, we present the experiment results with different labeling sizes and imbalance settings, we can find that our method can effectively promote the performance on the large-scale graphs comparing to the popular PPRGo model across different settings, which demonstrates the applicability of our method for extremely-large graphs. We also notice that our method can bring greater improvement when the labeling size is large. We explain the reason lies in that when the labeling size is large, the positions located by the conflicts among nodes will be more accurate, thus bringing more reasonable weight adjustments. On the other hand, when the labeling ratio is extremely small (especially for the enormous MAG-Scholar graph) and the influence conflict between the labeled nodes is negligible, our method exhibits the cold start problem.
|
| 143 |
+
|
| 144 |
+
# 4 Discussions
|
| 145 |
+
|
| 146 |
+
# 4.1 Evaluating GNNs from the Aspect of Topology-Imbalance Sensitivity
|
| 147 |
+
|
| 148 |
+
In Figure 5, we evaluate the GNN’s capability for handling topology-imbalance and find that different GNNs present significant difference in the topology-imbalance sensitivity across multiple datasets. The GCN model is susceptible to the topology-imbalance level of the graph and its performance decays greatly when the topology-imbalance increases. On the opposite, the GAT model is less sensitive to the topology-imbalance level and can achieve the best results when the topology-imbalance level is high. The PPNP model can achieve ideal performance when the topology-imbalance level is low, and its performance does not drop as sharply as GCN when the topology-imbalance level is high. We analyze the reason lies in that: (1) the aggregation operation of GCN is equivalent to directly averaging neighbor features [45] that lacks the noise filtering mechanism, so it is more sensitive to the topology-imbalance level of the graph; (2) the GAT model can dynamically adjust the aggregation weight from different neighbors, which increases its robustness to the high topology-imbalance situation but hinders the model performance when the graph topology-imbalance level is low and there is less need to filter neighbor information; (3) the infinite convolution mechanism of the PPNP model makes it possible to aggregate the information from distant nodes to enhance its robustness to the graph topology imbalance.
|
| 149 |
+
|
| 150 |
+
Shchur et al. [34] notice that the performance ranking of GNNs varies with the training set selection. Hence, existing node classification studies [32, 14] usually repeat experiments multiple times with different training sets to reduce this randomness. The results from Figure 5 inspire us that the topology imbalance can partly explain the randomness of GNN performance caused by the training set selection and we can adopt the topology-imbalance sensitivity as a new aspect in evaluating the performance of different GNN architectures.
|
| 151 |
+
|
| 152 |
+
# 4.2 Limitations of Method
|
| 153 |
+
|
| 154 |
+
Although our ReNode method has proven effective in multiple scenarios, we also notice some limitations of it because of the complexity of node imbalance learning. First, the ReNode method is devised for homogeneously-connected graphs (linked nodes are expected to be similar, such as the various datasets in experiments), and it needs a further update for heterogeneously-connected graphs (such as protein networks). Besides, the ReNode method improves less when the graph connectivity is poor (Section 3.2) or the labeling ratio is extremely low (Section 3.3) because in these cases, the conflict level among nodes is low thus the nodes topological positions are insufficiently reflected.
|
| 155 |
+
|
| 156 |
+
# 5 Related Work
|
| 157 |
+
|
| 158 |
+
Imbalanced classification problems are widespread in real scenarios and have attracted extensive attention from both academia and industry. Most existing studies on this topic focus on the classimbalanced quantity distribution [15], where the model’s inference ability for the majority classes will be significantly better than that of minority classes [12]. The existing methods for solving the quantity-imbalance issue can be roughly divided into methods for the data selection phase and the model training phase. Active learning [31, 10, 42] and Re-sampling [6, 16, 25] are two classical examples designed to construct a quantity-balanced training set . On the other hand, Re-weighting is a simple but effective solution for the model training phase, which adjusts the weights of training samples in different classes based on the labeling sizes [17, 30, 8, 5]. However, directly applying these methods into the graph scene lacks the consideration for the graph-specific topology-imbalance issue. Unlike the re-weight methods which conduct class-lever re-weighting, our ReNode method is a more fine-grained one and assign weights to each node individually.
|
| 159 |
+
|
| 160 |
+
There have been quantity-imbalance studies (Tomek links [38], NearMiss [23], One-Sided Selection [20]) trying to exclude the negative influence of labeling samples close to class boundaries by measuring the similarity of sample features. However, in the graph scene, the prior knowledge contained in node connections is more reliable than directly calculating the feature similarity. Besides, the number of labeled nodes is quite small in the semi-supervised setting. Thus it is not robust to locate their positions by computing similarity among a small number of nodes and we propose to leverage the influence conflict across the whole graph to locate node position to boundaries.
|
| 161 |
+
|
| 162 |
+
Graph data structure owns a wide range of applications, such as social media [13], stock exchange [21], shopping [34], medicine [44], transportation [28] and so on. Similar to other data structures, graph node representation learning also suffer from the quantity-imbalance issue [35]. Apart from the universal quantity-balance approaches introduced in Section 5 which can be transferred to the graph scene, there are some graph-specific quantity-imbalance methods recently proposed. DR-GCN [35] propose two types of regularization to tackle quantity imbalance: class-conditioned adversarial training and unlabeled nodes latent distribution constraint. RA-GCN [11] propose to automatically learn to weight the training samples in different classes in an adversarial training manner. AdaGCN Shi et al. [36] propose to leverage the boosting algorithm to handle the quantity-imbalance issue for the node classification task. GraphSMOTE [49] combines the synthetic node generation and the edge generation to up-sample nodes for the minority classes. However, these studies only pay attention to the quantity imbalance and overlook the topology imbalance.
|
| 163 |
+
|
| 164 |
+
Different from these studies [48, 29, 26] that try to locate the absolute positions for all the nodes by measuring their distance from the selected anchor nodes, our Totoro metric is devised to locate the relative positions to the class boundary for the labeling nodes by considering the influence conflict and can get rid of the dependence on the anchor nodes. Besides, our relative positions can more accurately reflect node class information because we distinguish the information from different classes while existing studies [48, 29] treat all the anchor nodes the same and ignore the class difference.
|
| 165 |
+
|
| 166 |
+
# 6 Conclusion and Future Work
|
| 167 |
+
|
| 168 |
+
In this work, we recognize the topology-imbalance node representation learning (TINL) as a graphspecific imbalance learning problem that has not been studied so far. We find that the topologyimbalance issue widely exists in graphs and severely hinders the learning of node classification. We unify TINL with the quantity-imbalance node representation learning (QINL) by considering the shift of the node influence boundaries from true class boundaries. To measure the degree of topology imbalance, we devise a conflict detection–based metric Totoro to locate node position, and further propose the ReNode method to adaptively adjust the training weights of labeled nodes based on their topological positions. Extensive empirical results have verified the effectiveness of our method in various settings: TINL-only, both TINL and QINL, and large-scale graph. Besides, we also propose the topology-imbalance sensitivity as a new metric to evaluate GNNs.
|
| 169 |
+
|
| 170 |
+
Considering the importance of the topology-imbalance issue and the limitations of our approach, advanced methods with stronger theoretical or experimental support are expected in future work. Moreover, since topology imbalance is widespread in graph-related tasks other than node classification, how to measure and solve the topology-imbalance issues in broader graph scopes remains a meaningful challenge for future study.
|
| 171 |
+
|
| 172 |
+
# 7 Acknowledgement
|
| 173 |
+
|
| 174 |
+
We appreciate all the thoughtful and insightful suggestions from reviews. This work was supported in part by a Tencent Research Grant and National Natural Science Foundation of China (No. 61673028). Xu Sun is the corresponding author of this paper.
|
| 175 |
+
|
| 176 |
+
# References
|
| 177 |
+
|
| 178 |
+
[1] Reid Andersen, Fan R. K. Chung, and Kevin J. Lang. Local Graph Partitioning using PageRank Vectors. In 47th Annual IEEE Symposium on Foundations of Computer Science (FOCS 2006), 21-24 October 2006, Berkeley, California, USA, Proceedings, pages 475–486. IEEE Computer Society, 2006.
|
| 179 |
+
[2] Aleksandar Bojchevski, Johannes Klicpera, Bryan Perozzi, Amol Kapoor, Martin Blais, Benedek Rózemberczki, Michal Lukasik, and Stephan Günnemann. Scaling Graph Neural Networks with Approximate PageRank. In the 26th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, KDD 2020, pages 2464–2473. ACM, 2020.
|
| 180 |
+
[3] Eliav Buchnik and Edith Cohen. Bootstrapped Graph Diffusions: Exposing the Power of Nonlinearity. Proc. ACM Meas. Anal. Comput. Syst., 2(1):10:1–10:19, 2018.
|
| 181 |
+
[4] Mateusz Buda, Atsuto Maki, and Maciej A. Mazurowski. A Systematic Study of the Class Imbalance Problem in Convolutional Neural Networks. Neural Networks, 106:249–259, 2018.
|
| 182 |
+
[5] Kaidi Cao, Colin Wei, Adrien Gaidon, Nikos Aréchiga, and Tengyu Ma. Learning Imbalanced Datasets with Label-Distribution-Aware Margin Loss. 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 1565–1576, 2019.
|
| 183 |
+
[6] Nitesh V Chawla, Kevin W Bowyer, Lawrence O Hall, and W Philip Kegelmeyer. SMOTE: Synthetic Minority Over-sampling Technique. Journal of artificial intelligence research, 16: 321–357, 2002.
|
| 184 |
+
|
| 185 |
+
[7] Wei-Lin Chiang, Xuanqing Liu, Si Si, Yang Li, Samy Bengio, and Cho-Jui Hsieh. Cluster-GCN: An Efficient Algorithm for Training Deep and Large Graph Convolutional Networks. In the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD 2019, Anchorage, AK, USA, August 4-8, 2019, pages 257–266. ACM, 2019.
|
| 186 |
+
|
| 187 |
+
[8] Yin Cui, Menglin Jia, Tsung-Yi Lin, Yang Song, and Serge J. Belongie. Class-Balanced Loss Based on Effective Number of Samples. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2019, Long Beach, CA, USA, June 16-20, 2019, pages 9268–9277. Computer Vision Foundation / IEEE, 2019.
|
| 188 |
+
|
| 189 |
+
[9] Michaël Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional Neural Networks on Graphs with Fast Localized Spectral Filtering. In Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pages 3837–3845, 2016.
|
| 190 |
+
|
| 191 |
+
[10] Seyda Ertekin, Jian Huang, and C Lee Giles. Active Learning for Class Imbalance Problem. In the 30th Annual International ACM SIGIR Conference on Research and Development in Information Retrieval, SIGIR 2007, pages 823–824, 2007.
|
| 192 |
+
|
| 193 |
+
[11] Mahsa Ghorbani, Anees Kazi, Mahdieh Soleymani Baghshah, Hamid R. Rabiee, and Nassir Navab. RA-GCN: Graph Convolutional Network for Disease Prediction Problems with Imbalanced Data. arXiv preprint: 2103.00221, 2021.
|
| 194 |
+
|
| 195 |
+
[12] Haixiang Guo, Yijing Li, Jennifer Shang, Gu Mingyun, Huang Yuanyue, and Gong Bing. Learning from Class-Imbalanced Data: Review of Methods and Applications. Expert Syst. Appl., 73:220–239, 2017.
|
| 196 |
+
|
| 197 |
+
[13] 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.
|
| 198 |
+
|
| 199 |
+
[14] Kaveh Hassani and Amir Hosein Khasahmadi. Contrastive Multi-View Representation Learning on Graphs. In the 37th International Conference on Machine Learning, ICML 2020, 13-18 July 2020, Virtual Event, volume 119 of Proceedings of Machine Learning Research, pages 4116–4126. PMLR, 2020.
|
| 200 |
+
|
| 201 |
+
[15] Haibo He and Edwardo A. Garcia. Learning from imbalanced data. IEEE Trans. Knowl. Data Eng., 21(9):1263–1284, 2009.
|
| 202 |
+
|
| 203 |
+
[16] Haibo He, Yang Bai, Edwardo A. Garcia, and Shutao Li. ADASYN: Adaptive synthetic sampling approach for imbalanced learning. In the International Joint Conference on Neural Networks, IJCNN 2008, part of the IEEE World Congress on Computational Intelligence, WCCI 2008, Hong Kong, China, June 1-6, 2008, pages 1322–1328. IEEE, 2008.
|
| 204 |
+
|
| 205 |
+
[17] Chen Huang, Yining Li, Chen Change Loy, and Xiaoou Tang. Learning Deep Representation for Imbalanced Classification. In the 29th IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2016, pages 5375–5384, 2016.
|
| 206 |
+
|
| 207 |
+
[18] Thomas N Kipf and Max Welling. Semi-supervised Classification with Graph Convolutional Networks. In the 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017.
|
| 208 |
+
|
| 209 |
+
[19] Johannes Klicpera, Aleksandar Bojchevski, and Stephan Günnemann. Predict then Propagate: Graph Neural Networks meet Personalized PageRank. In the 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019.
|
| 210 |
+
|
| 211 |
+
[20] Miroslav Kubat, Stan Matwin, et al. Addressing the Curse of Imbalanced Training Sets: Onesided Selection. In the 14th International Conference on Machine Learning (ICML 1997), Nashville, Tennessee, USA, July 8-12, 1997, volume 97, pages 179–186. Morgan Kaufmann, 1997.
|
| 212 |
+
|
| 213 |
+
[21] Wei Li, Ruihan Bao, Keiko Harimoto, Deli Chen, Jingjing Xu, and Qi Su. Modeling the Stock Relation with Graph Network for Overnight Stock Movement Prediction. In the 29th International Joint Conference on Artificial Intelligence, IJCAI 2020, pages 4541–4547. ijcai.org, 2020.
|
| 214 |
+
|
| 215 |
+
[22] Tsung-Yi Lin, Priya Goyal, Ross B. Girshick, Kaiming He, and Piotr Dollár. Focal Loss for Dense Object Detection. In IEEE International Conference on Computer Vision, ICCV 2017, Venice, Italy, October 22-29, 2017, pages 2999–3007. IEEE Computer Society, 2017.
|
| 216 |
+
|
| 217 |
+
[23] Inderjeet Mani and I Zhang. kNN Approach to Unbalanced Data Distributions: A Case Study Involving Information Extraction. In Workshop on Learning from Imbalanced Datasets, volume 126, 2003.
|
| 218 |
+
|
| 219 |
+
[24] Julian McAuley, Christopher Targett, Qinfeng Shi, and Anton Van Den Hengel. Image-based Recommendations on Styles and Substitutes. In the 38th International ACM SIGIR Conference on Research and Development in Information Retrieval, Santiago, Chile, August 9-13, 2015, pages 43–52. ACM, 2015.
|
| 220 |
+
|
| 221 |
+
[25] Iman Nekooeimehr and Susana K Lai-Yuen. Adaptive Semi-unsupervised Weighted Oversampling (A-SUWO) for Imbalanced Datasets. Expert Systems with Applications, 46:405–416, 2016.
|
| 222 |
+
|
| 223 |
+
[26] Sunil Nishad, Shubhangi Agarwal, Arnab Bhattacharya, and Sayan Ranu. GraphReach: PositionAware Graph Neural Networks using Reachability Estimations. In the 30th International Joint Conference on Artificial Intelligence IJCAI, 2020.
|
| 224 |
+
|
| 225 |
+
[27] Lawrence Page, Sergey Brin, Rajeev Motwani, and Terry Winograd. The PageRank Citation Ranking: Bringing Order to the Web. Technical report, Stanford InfoLab, 1999.
|
| 226 |
+
|
| 227 |
+
[28] Nikolay G Prokoptsev, AE Alekseenko, and Yaroslav Aleksandrovich Kholodov. Traffic Flow Speed Prediction on Transportation Graph with Convolutional Neural Networks. Computer research and modeling, 10(3):359–367, 2018.
|
| 228 |
+
|
| 229 |
+
[29] Zhenyue Qin, Saeed Anwar, Dongwoo Kim, Yang Liu, Pan Ji, and Tom Gedeon. PositionSensing Graph Neural Networks: Proactively Learning Nodes Relative Positions. arXiv preprint: 2105.11346, 2021.
|
| 230 |
+
|
| 231 |
+
[30] Mengye Ren, Wenyuan Zeng, Bin Yang, and Raquel Urtasun. Learning to Reweight Examples for Robust Deep Learning. In International Conference on Machine Learning, pages 4334–4343. PMLR, 2018.
|
| 232 |
+
|
| 233 |
+
[31] Pengzhen Ren, Yun Xiao, Xiaojun Chang, Po-Yao Huang, Zhihui Li, Xiaojiang Chen, and Xin Wang. A Survey of Deep Active Learning. arXiv preprint: 2009.00236, 2020.
|
| 234 |
+
|
| 235 |
+
[32] Yu Rong, Wenbing Huang, Tingyang Xu, and Junzhou Huang. The Truly Deep Graph Convolutional Networks for Node Classification. arXiv preprint: 1907.10903, 2019.
|
| 236 |
+
|
| 237 |
+
[33] Prithviraj Sen, Galileo Namata, Mustafa Bilgic, Lise Getoor, Brian Galligher, and Tina EliassiRad. Collective Classification in Network Data. AI magazine, 29(3):93–93, 2008.
|
| 238 |
+
|
| 239 |
+
[34] Oleksandr Shchur, Maximilian Mumme, Aleksandar Bojchevski, and Stephan Günnemann. Pitfalls of Graph Neural Network Evaluation. arXiv preprint: 1811.05868, 2018.
|
| 240 |
+
|
| 241 |
+
[35] Min Shi, Yufei Tang, Xingquan Zhu, David A. Wilson, and Jianxun Liu. Multi-Class Imbalanced Graph Convolutional Network Learning. In the 29th International Joint Conference on Artificial Intelligence, IJCAI 2020, pages 2879–2885. ijcai.org, 2020.
|
| 242 |
+
|
| 243 |
+
[36] Shuhao Shi, Kai Qiao, Shuai Yang, L Wang, J Chen, and Bin Yan. AdaGCN: Adaptive Boosting Algorithm for Graph Convolutional Networks on Imbalanced Node Classification. arXiv preprint: 2105.11625, 2021.
|
| 244 |
+
|
| 245 |
+
[37] Marina Sokol, Konstantin Avrachenkov, Paulo Gonçalves, and Alexey Mishenin. Generalized Optimization Framework for Graph-based Semi-supervised Learning. In the 12th SIAM International Conference on Data Mining, Anaheim, California, USA, April 26-28, 2012, pages 966–974. SIAM / Omnipress, 2012.
|
| 246 |
+
|
| 247 |
+
[38] Ivan Tomek et al. Two Modifications of CNN. IEEE Transactions on Systems, Man, and Cybernetics, 1976.
|
| 248 |
+
|
| 249 |
+
[39] Laurens Van der Maaten and Geoffrey Hinton. Visualizing Data using t-SNE. Journal of machine learning research, 9(11), 2008.
|
| 250 |
+
|
| 251 |
+
[40] Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and ´ Yoshua Bengio. Graph Attention Networks. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net, 2018.
|
| 252 |
+
|
| 253 |
+
[41] Hongwei Wang and Jure Leskovec. Unifying Graph Convolutional Neural Networks and Label Propagation. arXiv preprint: 2002.06755, 2020.
|
| 254 |
+
|
| 255 |
+
[42] Xinyue Wang, Bo Liu, Siyu Cao, Liping Jing, and Jian Yu. Important Sampling based Active Learning for Imbalance Classification. Science China Information Sciences, 63(8):1–14, 2020.
|
| 256 |
+
|
| 257 |
+
[43] Felix Wu, Amauri Souza, Tianyi Zhang, Christopher Fifty, Tao Yu, and Kilian Weinberger. Simplifying Graph Convolutional Networks. In International Conference on Machine Learning, pages 6861–6871. PMLR, 2019.
|
| 258 |
+
|
| 259 |
+
[44] Zhenqin Wu, Bharath Ramsundar, Evan N Feinberg, Joseph Gomes, Caleb Geniesse, Aneesh S Pappu, Karl Leswing, and Vijay Pande. MoleculeNet: a Benchmark for Molecular Machine Learning. Chemical science, 2018.
|
| 260 |
+
|
| 261 |
+
[45] Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How Powerful are Graph Neural Networks? In the 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019.
|
| 262 |
+
|
| 263 |
+
[46] Yuzhe Yang and Zhi Xu. Rethinking the Value of Labels for Improving Class-Imbalanced Learning. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020.
|
| 264 |
+
|
| 265 |
+
[47] Zhilin Yang, William W Cohen, and Ruslan Salakhutdinov. Revisiting Semi-supervised Learning with Graph Embeddings. In the 33nd International Conference on Machine Learning, ICML 2016, volume 48 of JMLR Workshop and Conference Proceedings, pages 40–48. JMLR.org, 2016.
|
| 266 |
+
|
| 267 |
+
[48] Jiaxuan You, Rex Ying, and Jure Leskovec. Position-aware Graph Neural Networks. In the 36th International Conference on Machine Learning, ICML 2019, volume 97 of Proceedings of Machine Learning Research, pages 7134–7143. PMLR, 2019.
|
| 268 |
+
|
| 269 |
+
[49] Tianxiang Zhao, Xiang Zhang, and Suhang Wang. GraphSMOTE: Imbalanced Node Classification on Graphs with Graph Neural Networks. In WSDM ’21, The Fourteenth ACM International Conference on Web Search and Data Mining, Virtual Event, Israel, March 8-12, 2021, pages 833–841. ACM, 2021.
|
| 270 |
+
|
| 271 |
+
[50] Dengyong Zhou and Christopher J. C. Burges. Spectral Clustering and Transductive Learning with Multiple Views. In the 24th Annual International Conference on Machine Learning, ICML 2007, volume 227, pages 1159–1166. ACM, 2007.
|
| 272 |
+
|
| 273 |
+
[51] Jie Zhou, Ganqu Cui, Zhengyan Zhang, Cheng Yang, Zhiyuan Liu, and Maosong Sun. Graph Neural Networks: A Review of Methods and Applications. AI Open, 1, 2020.
|
md/train/aDjoksTpXOP/aDjoksTpXOP.md
ADDED
|
@@ -0,0 +1,768 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Deep Equals Shallow for ReLU Networks in Kernel Regimes
|
| 2 |
+
|
| 3 |
+
Alberto Bietti∗ NYU† alberto.bietti@nyu.edu
|
| 4 |
+
|
| 5 |
+
Francis Bach
|
| 6 |
+
Inria‡
|
| 7 |
+
francis.bach@inria.fr
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
Deep networks are often considered to be more expressive than shallow ones in terms of approximation. Indeed, certain functions can be approximated by deep networks provably more efficiently than by shallow ones, however, no tractable algorithms are known for learning such deep models. Separately, a recent line of work has shown that deep networks trained with gradient descent may behave like (tractable) kernel methods in a certain over-parameterized regime, where the kernel is determined by the architecture and initialization, and this paper focuses on approximation for such kernels. We show that for ReLU activations, the kernels derived from deep fully-connected networks have essentially the same approximation properties as their “shallow” two-layer counterpart, namely the same eigenvalue decay for the corresponding integral operator. This highlights the limitations of the kernel framework for understanding the benefits of such deep architectures. Our main theoretical result relies on characterizing such eigenvalue decays through differentiability properties of the kernel function, which also easily applies to the study of other kernels defined on the sphere.
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
The question of which functions can be well approximated by neural networks is crucial for understanding when these models are successful, and has always been at the heart of the theoretical study of neural networks (e.g., Hornik et al., 1989; Pinkus, 1999). While early works have mostly focused on shallow networks with only two layers, more recent works have shown benefits of deep networks for approximating certain classes of functions (Eldan & Shamir, 2016; Mhaskar & Poggio, 2016; Telgarsky, 2016; Daniely, 2017; Yarotsky, 2017; Schmidt-Hieber et al., 2020). Unfortunately, many of these approaches rely on constructions that are not currently known to be learnable using efficient algorithms.
|
| 16 |
+
|
| 17 |
+
A separate line of work has considered over-parameterized networks with random neurons (Neal, 1996), which also display universal approximation properties while additionally providing efficient algorithms based on kernel methods or their approximations such as random features (Rahimi & Recht, 2007; Bach, 2017b). Many recent results on gradient-based optimization of certain over-parameterized networks have been shown to be equivalent to kernel methods with an architecture-specific kernel called the neural tangent kernel (NTK) and thus also fall in this category (e.g., Jacot et al., 2018; Li & Liang, 2018; Allen-Zhu et al., 2019b; Du et al., 2019a;b; Zou et al., 2019). This regime has been coined lazy (Chizat et al., 2019), as it does not capture the common phenomenon where weights move significantly away from random initialization and thus may not provide a satisfying model for learning adaptive representations, in contrast to other settings such as the mean field or active regime, which captures complex training dynamics where weights may move in a non-trivial manner and adapt to the data (e.g., Chizat & Bach, 2018; Mei et al., 2018). Nevertheless, one benefit compared to the mean field regime is that the kernel approach easily extends to deep architectures, leading to compositional kernels similar to the ones of Cho & Saul (2009); Daniely et al. (2016). Our goal in this paper is to study the role of depth in determining approximation properties for such kernels, with a focus on fully-connected deep ReLU networks.
|
| 18 |
+
|
| 19 |
+
Our approximation results rely on the study of eigenvalue decays of integral operators associated to the obtained dot-product kernels on the sphere, which are diagonalized in the basis of spherical harmonics. This provides a characterization of the functions in the corresponding reproducing kernel Hilbert space (RKHS) in terms of their smoothness, and leads to convergence rates for non-parametric regression when the data are uniformly distributed on the sphere. We show that for ReLU networks, the eigenvalue decays for the corresponding deep kernels remain the same regardless of the depth of the network. Our key result is that the decay for a certain class of kernels is characterized by a property related to differentiability of the kernel function around the point where the two inputs are aligned. In particular, the property is preserved when adding layers with ReLU activations, showing that depth plays essentially no role for such networks in kernel regimes. This highlights the limitations of the kernel regime for understanding the power of depth in fully-connected networks, and calls for new models of deep networks beyond kernels (see, e.g., Allen-Zhu & Li, 2020; Chen et al., 2020, for recent works in this direction). We also provide applications of our result to other kernels and architectures, and illustrate our results with numerical experiments on synthetic and real datasets.
|
| 20 |
+
|
| 21 |
+
Related work. Kernels for deep learning were originally derived by Neal (1996) for shallow networks, and later for deep networks (Cho & Saul, 2009; Daniely et al., 2016; Lee et al., 2018; Matthews et al., 2018). Smola et al. (2001); Minh et al. (2006) study regularization properties of dot-product kernels on the sphere using spherical harmonics, and Bach (2017a) derives eigenvalue decays for such dot-product kernels arising from shallow networks with positively homogeneous activations including the ReLU. Extensions to shallow NTK or Laplace kernels are studied by Basri et al. (2019); Bietti & Mairal (2019b); Geifman et al. (2020). The observation that depth does not change the decay of the NTK was previously made by Basri et al. (2020) empirically, and Geifman et al. (2020) provide a lower bound on the eigenvalues for deep networks; our work makes this observation rigorous by providing tight asymptotic decays. Spectral properties of wide neural networks were also considered in (Cao et al., 2019; Fan & Wang, 2020; Ghorbani et al., 2019; Xie et al., 2017; Yang & Salman, 2019). Azevedo & Menegatto (2014); Scetbon & Harchaoui (2020) also study eigenvalue decays for dot-product kernels but focus on kernels with geometric decays, while our main focus is on polynomial decays. Additional works on over-parameterized or infinite-width networks in lazy regimes include (Allen-Zhu et al., 2019a;b; Arora et al., 2019a;b; Brand et al., 2020; Lee et al., 2020; Song & Yang, 2019).
|
| 22 |
+
|
| 23 |
+
Concurrently to our work, Chen & Xu (2021) also studied the RKHS of the NTK for deep ReLU networks, showing that it is the same as for the Laplace kernel on the sphere. They achieve this by studying asymptotic decays of Taylor coefficients of the kernel function at zero using complex-analytic extensions of the kernel functions, and leveraging this to obtain both inclusions between the two RKHSs. In contrast, we obtain precise descriptions of the RKHS and regularization properties in the basis of spherical harmonics for various dot-product kernels through spectral decompositions of integral operators, using (real) asymptotic expansions of the kernel function around endpoints. The equality between the RKHS of the deep NTK and Laplace kernel then easily follows from our results by the fact that the two kernels have the same spectral decay.
|
| 24 |
+
|
| 25 |
+
# 2 Review of Approximation with Dot-Product Kernels
|
| 26 |
+
|
| 27 |
+
In this section, we provide a brief review of the kernels that arise from neural networks and their approximation properties.
|
| 28 |
+
|
| 29 |
+
# 2.1 Kernels for wide neural networks
|
| 30 |
+
|
| 31 |
+
Wide neural networks with random weights or weights close to random initialization naturally lead to certain dot-product kernels that depend on the architecture and activation function, which we now present, with a focus on fully-connected architectures.
|
| 32 |
+
|
| 33 |
+
Random feature kernels. We first consider a two-layer (shallow) network of the form $\begin{array} { r } { f ( \boldsymbol { x } ) = \frac { 1 } { \sqrt { m } } \sum _ { j = 1 } ^ { m } v _ { j } \sigma ( w _ { j } ^ { \top } \boldsymbol { x } ) } \end{array}$ , for some activation function $\sigma$ . When $w _ { j } \sim \mathcal { N } ( 0 , I ) \in \mathbb { R } ^ { d }$ are fixed and only $v _ { j } \in \mathbb { R }$ are trained with $\ell _ { 2 }$ regularization, this corresponds to using a random feature approximation Rahimi $\&$ Recht (2007) of the kernel
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
\begin{array} { r } { k ( x , x ^ { \prime } ) = \mathbb { E } _ { w \sim \mathcal { N } ( 0 , I ) } [ \sigma ( w ^ { \top } x ) \sigma ( w ^ { \top } x ^ { \prime } ) ] . } \end{array}
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
If $x , x ^ { \prime }$ are on the sphere, then by spherical symmetry of the Gaussian distribution, one may show that $k$ is invariant to unitary transformations and takes the form $k ( x , x ^ { \prime } ) = \kappa ( x ^ { \prime } x ^ { \prime } )$ for a certain function $\kappa$ . More precisely, if $\textstyle { \boldsymbol { \sigma } } ( u ) = \sum _ { i \geq 0 } a _ { i } h _ { i } ( u )$ is the decomposition of $\sigma$ in the basis of Hermite polynomials $h _ { i }$ , which are orthogonal w.r.t. the Gaussian measure, then we have (Daniely et al., 2016):
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\kappa ( u ) = \sum _ { i \geq 0 } a _ { i } ^ { 2 } u ^ { i } .
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
Conversely, given a kernel function of the form above with $\begin{array} { r } { \kappa ( u ) = \sum _ { i \geq 0 } b _ { i } u ^ { i } } \end{array}$ with $b _ { i } \geq 0$ , one may construct corresponding activations using Hermite polynomials by taking
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\sigma ( u ) = \sum _ { i } a _ { i } h _ { i } ( u ) , \quad a _ { i } \in \{ \pm \sqrt { b _ { i } } \} .
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
In the case where $o$ is $s$ -positively homogeneous, such as the ReLU $\sigma ( u ) = \mathrm { m a x } ( u , 0 )$ (with $s \ = \ 1$ ), or more generally $\sigma _ { s } ( u ) ~ = ~ \operatorname* { m a x } ( u , 0 ) ^ { s }$ , then the kernel (1) takes the form $\begin{array} { r } { k ( x , x ^ { \prime } ) = \| x \| ^ { s } \| x ^ { \prime } \| ^ { s } \kappa \big ( \frac { x ^ { \intercal } x ^ { \prime } } { \| x \| \| x ^ { \prime } \| } \big ) } \end{array}$ ( x>x0kxkkx0k ) for any x, x0. This leads to RKHS functions of the form $f ( x ) = \| x \| ^ { s } g ( { \frac { x } { \| x \| } } )$ , with $g$ in the RKHS of the kernel restricted to the sphere (Bietti $\&$ Mairal, 2019b, Prop. 8). In particular, for the step and ReLU activations $\sigma _ { 0 }$ and $\sigma _ { 1 }$ , the functions $\kappa$ are given by the following arc-cosine kernels (Cho & Saul, 2009):1
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\kappa _ { 0 } ( u ) = \frac { 1 } { \pi } \left( \pi - \operatorname { a r c c o s } ( u ) \right) , \qquad \kappa _ { 1 } ( u ) = \frac { 1 } { \pi } \left( u \cdot ( \pi - \operatorname { a r c c o s } ( u ) ) + \sqrt { 1 - u ^ { 2 } } \right) .
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
Note that given a kernel function $\kappa$ , the corresponding activations (3) will generally not be homogeneous, thus the inputs to a random network with such activations need to lie on the sphere (or be appropriately normalized) in order to yield the kernel $\kappa$ .
|
| 58 |
+
|
| 59 |
+
Extension to deep networks. When considering a deep network with more than two layers and fixed random weights before the last layer, the connection to random features is less direct since the features are correlated through intermediate layers. Nevertheless, when the hidden layers are wide enough, one still approaches a kernel obtained by letting the widths go to infinity (see, e.g., Daniely et al., 2016; Lee et al., 2018; Matthews et al., 2018), which takes a similar form to the multi-layer kernels of Cho $\&$ Saul (2009):
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
k ^ { L } ( x , x ^ { \prime } ) = \kappa ^ { L } ( x ^ { \top } x ^ { \prime } ) : = \underbrace { \kappa \circ \cdot \cdot \circ \kappa } _ { L - 1 { \mathrm { ~ t i m e s } } } ( x ^ { \top } x ^ { \prime } ) ,
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
for $x , x ^ { \prime }$ on the sphere, where $\kappa$ is obtained as described above for a given activation $\sigma$ , and $L$ is the number of layers. We still refer to this kernel as the random features (RF) kernel in this paper, noting that it is sometimes known as the “conjugate kernel” or NNGP kernel (for neural network Gaussian process). It is usually good to normalize $\kappa$ such that $\kappa ( 1 ) = 1$ , so that we also have $\kappa ^ { L } ( 1 ) = 1$ , avoiding exploding or vanishing behavior for deep networks. In practice, this corresponds to using an activation-dependent scaling in the random weight initialization, which is commonly used by practitioners (He et al., 2015).
|
| 66 |
+
|
| 67 |
+
Neural tangent kernels. When intermediate layers are trained along with the last layer using gradient methods, the resulting problem is non-convex and the statistical properties of such approaches are not well understood in general, particularly for deep networks. However, in a specific over-parameterized regime, it may be shown that gradient descent can reach a global minimum while keeping weights very close to random initialization. More precisely, for a network $f ( x ; \theta )$ parameterized by $\theta$ with large width $m$ , the model remains close to its linearization around random initialization $\theta _ { 0 }$ throughout training, that is, $f ( x ; \theta ) \approx$ $f ( x ; \theta _ { 0 } ) + \langle \theta - \theta _ { 0 } , \nabla _ { \theta } f ( x ; \theta _ { 0 } ) \rangle$ . This is also known as the lazy training regime (Chizat et al., 2019). Learning is then equivalent to a kernel method with another architecture-specific kernel known as the neural tangent kernel (NTK, Jacot et al., 2018), given by
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
k _ { \mathrm { N T K } } ( x , x ^ { \prime } ) = \operatorname* { l i m } _ { m \infty } \langle \nabla f ( x ; \theta _ { 0 } ) , \nabla f ( x ^ { \prime } ; \theta _ { 0 } ) \rangle .
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
For a simple two-layer network with activation $\sigma$ , it is then given by
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
k _ { \mathrm { N T K } } ( \boldsymbol { x } , \boldsymbol { x ^ { \prime } } ) = ( x ^ { \top } \boldsymbol { x ^ { \prime } } ) ~ \mathbb { E } _ { w } [ \sigma ^ { \prime } ( w ^ { \top } \boldsymbol { x } ) \sigma ^ { \prime } ( w ^ { \top } \boldsymbol { x ^ { \prime } } ) ] + \mathbb { E } _ { w } [ \sigma ( w ^ { \top } \boldsymbol { x } ) \sigma ( w ^ { \top } \boldsymbol { x ^ { \prime } } ) ] .
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
For a ReLU network with $L$ layers with inputs on the sphere, taking appropriate limits on the widths, one can show (Jacot et al., 2018): $k _ { \mathrm { N T K } } ( x , x ^ { \prime } ) = \kappa _ { \mathrm { N T K } } ^ { L } ( x ^ { \top } x ^ { \prime } )$ , with $\kappa _ { \mathrm { N T K } } ^ { 1 } ( u ) =$ $\kappa ^ { 1 } ( u ) = u$ and for $\ell = 2 , \ldots , L$ ,
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\begin{array} { r } { \kappa ^ { \ell } ( u ) = \kappa _ { 1 } ( \kappa ^ { \ell - 1 } ( u ) ) \qquad } \\ { \kappa _ { \mathrm { N T K } } ^ { \ell } ( u ) = \kappa _ { \mathrm { N T K } } ^ { \ell - 1 } ( u ) \kappa _ { 0 } ( \kappa ^ { \ell - 1 } ( u ) ) + \kappa ^ { \ell } ( u ) , } \end{array}
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
where $\kappa _ { 0 }$ and $\kappa _ { 1 }$ are given in (4).
|
| 86 |
+
|
| 87 |
+
# 2.2 Approximation and harmonic analysis with dot-product kernels
|
| 88 |
+
|
| 89 |
+
In this section, we recall approximation properties of dot-product kernels on the sphere, through spectral decompositions of integral operators in the basis of spherical harmonics. Further background is provided in Appendix A.
|
| 90 |
+
|
| 91 |
+
Spherical harmonics and description of the RKHS. A standard approach to study the RKHS of a kernel is through the spectral decomposition of an integral operator $T$ given by $\begin{array} { r } { T f ( x ) = \int k ( x , y ) f ( y ) d \tau ( y ) } \end{array}$ for some measure $\tau$ , leading to Mercer’s theorem (e.g., Cucker & Smale, 2002). When inputs lie on the sphere $\mathbb { S } ^ { d - 1 }$ in $d$ dimensions, dot-product kernels of the form $k ( x , x ^ { \prime } ) = \kappa ( x ^ { \prime } x ^ { \prime } )$ are rotationally-invariant, depending only on the angle between $x$ and $x ^ { \prime }$ . Similarly to how translation-invariant kernels are diagonalized in the Fourier basis, rotation-invariant kernels are diagonalized in the basis of spherical harmonics (Smola et al., 2001; Bach, 2017a), which lead to connections between eigenvalue decays and regularity as in the Fourier setting. In particular, if $\tau$ denotes the uniform measure on $\mathbb { S } ^ { d - 1 }$ , then $T Y _ { k , j } = \mu _ { k } Y _ { k , j }$ , where $Y _ { k , j }$ is the $j$ -th spherical harmonic polynomial of degree $k$ , where $k$ plays the role of a frequency as in the Fourier case, and the number of such orthogonal polynomials of degree $k$ is given by $\begin{array} { r } { N ( d , k ) = \frac { 2 k + d - 2 } { k } \binom { k + d - 3 } { d - 2 } } \end{array}$ 2 k+d−3d−2 , which grows as $k ^ { d - 2 }$ for large $k$ . The eigenvalues $\mu _ { k }$ only depend on the frequency $k$ and are given by
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\mu _ { k } = \frac { \omega _ { d - 2 } } { \omega _ { d - 1 } } \int _ { - 1 } ^ { 1 } \kappa ( t ) P _ { k } ( t ) ( 1 - t ^ { 2 } ) ^ { ( d - 3 ) / 2 } d t ,
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
where $P _ { k }$ is the Legendre polynomial of degree $k$ in $d$ dimensions (also known as Gegenbauer polynomial when using a different scaling), and $\omega _ { d - 1 }$ denotes the surface of the sphere $\mathbb { S } ^ { d - 1 }$ . Mercer’s theorem then states that the RKHS $\mathcal { H }$ associated to the kernel is given by
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\mathcal { H } = \left\{ f = \sum _ { k \geq 0 , \mu _ { k } \neq 0 } \sum _ { j = 1 } ^ { N ( d , k ) } a _ { k , j } Y _ { k , j } ( \cdot ) \quad \mathrm { ~ s . t . ~ } \quad \| f \| _ { \mathcal { H } } ^ { 2 } : = \sum _ { k \geq 0 , \mu _ { k } \neq 0 } \sum _ { j = 1 } ^ { N ( d , k ) } \frac { a _ { k , j } ^ { 2 } } { \mu _ { k } } < \infty \right\} .
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
In particular, if $\mu _ { k }$ has a fast decay, then the coefficients $u _ { k , j }$ of $f$ must also decay quickly with $k$ in order for $f$ to be in $\mathcal { H }$ , which means $f$ must have a certain level of regularity. Similarly to the Fourier case, an exponential decay of $\mu _ { k }$ implies that the functions in $\mathcal { H }$ are infinitely differentiable, while for polynomial decay $\mathcal { H }$ contains all functions whose derivatives only up to a certain order are bounded, as in Sobolev spaces. If two kernels lead to the same asymptotic decay of $\mu _ { k }$ up to a constant, then by (9) their RKHS norms are equivalent up to a constant, and thus they have the same RKHS. For the specific case of random feature kernels arising from $s$ -positively homogeneous activations, Bach (2017a) shows that $\mu _ { k }$ decays as $k ^ { - d - 2 s }$ for $k$ of the opposite parity of $s$ , and is zero for large enough $k$ of opposite parity, which results in a RKHS that contains even or odd functions (depending on the parity of $s$ ) defined on the sphere with bounded derivatives up to order $\beta : = d / 2 + s$ (note that $\beta$ must be greater than $( d - 1 ) / 2$ in order for the eigenvalues of $T$ to be summable and thus lead to a well-defined RKHS). Bietti $\&$ Mairal (2019b) show that the same decay holds for the NTK of two-layer ReLU networks, with $s = 0$ and a change of parity. Basri et al. (2019) show that the parity constraints may be removed by adding a zero-initialized additive bias term when deriving the NTK. We note that one can also obtain rates of approximation for Lipschitz functions from such decay estimates (Bach, 2017a). Our goal in this paper is to extend this to more general dot-product kernels such as those arising from multi-layer networks, by providing a more general approach for obtaining decay estimates from differentiability properties of the function $\kappa$ .
|
| 104 |
+
|
| 105 |
+
Non-parametric regression. When the data are uniformly distributed on the sphere, we may also obtain convergence rates for non-parametric regression, which typically depend on the eigenvalue decay of the integral operator associated to the marginal distribution on inputs and on the decomposition of the regression function $f ^ { * } ( x ) = \mathbb { E } [ y | x ]$ on the same basis (e.g., Caponnetto & De Vito, 2007).2 Then one may achieve optimal rates that depend mainly on the regularity of $f ^ { * }$ when using various algorithms with tuned hyperparameters, but the choice of kernel and its decay may have an impact on the rates in some regimes, as well as on the difficulty of the optimization problem (see, e.g., Bach, 2013, Section 4.3).
|
| 106 |
+
|
| 107 |
+
# 3 Main Result and Applications to Deep Networks
|
| 108 |
+
|
| 109 |
+
In this section, we present our main results concerning approximation properties of dotproduct kernels on the sphere, and applications to the kernels arising from wide random neural networks. We begin by stating our main theorem, which provides eigenvalue decays for dot-product kernels from differentiability properties of the kernel function $\kappa$ at the endpoints $\pm 1$ . We then present applications of this result to various kernels, including those coming from deep networks, showing in particular that the RKHSs associated to deep and shallow ReLU networks are the same (up to parity constraints).
|
| 110 |
+
|
| 111 |
+
# 3.1 Statement of our main theorem
|
| 112 |
+
|
| 113 |
+
We now state our main result regarding the asymptotic eigenvalue decay of dot-product kernels. Recall that we consider a kernel of the form $k ( x , y ) = \kappa ( x ^ { \top } y )$ for $x , y \in \mathbb { S } ^ { d - 1 }$ , and seek to obtain decay estimates on the eigenvalues $\mu _ { k }$ defined in (8). We now state our main theorem, which derives the asymptotic decay of $\mu _ { k }$ with $k$ in terms of differentiability properties of $\kappa$ around $\{ \pm 1 \}$ , assuming that $\kappa$ is infinitely differentiable on $( - 1 , 1 )$ . This latter condition is always verified when $\kappa$ takes the form of a power series (2) with $\kappa ( 1 ) = 1$ , since the radius of convergence is at least 1. We also require a technical condition, namely the ability to “differentiate asymptotic expansions” of $\kappa$ at $\pm 1$ , which holds for the kernels considered in this work.
|
| 114 |
+
|
| 115 |
+
Theorem 1 (Decay from regularity of $\kappa$ at endpoints, simplified). Let $\kappa : [ - 1 , 1 ] \to \mathbb { R }$ be $a$ function that is $C ^ { \infty }$ on $( - 1 , 1 )$ and has the following asymptotic expansions around $\pm 1$ :
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
\begin{array} { c } { { \kappa ( 1 - t ) = p _ { 1 } ( t ) + c _ { 1 } t ^ { \nu } + o ( t ^ { \nu } ) } } \\ { { \kappa ( - 1 + t ) = p _ { - 1 } ( t ) + c _ { - 1 } t ^ { \nu } + o ( t ^ { \nu } ) , } } \end{array}
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
for $t \geq 0$ , where $p _ { 1 } , p _ { - 1 }$ are polynomials and $\nu > 0$ is not an integer. Also, assume that the derivatives of $\kappa$ admit similar expansions obtained by differentiating the above ones. Then, there is an absolute constant $C ( d , \nu )$ depending on d and $\nu$ such that:
|
| 122 |
+
|
| 123 |
+
In the case $| c _ { 1 } | = | c _ { - 1 } |$ , then we have $\mu _ { k } = o ( k ^ { - d - 2 \nu + 1 } )$ for one of the two parities (or both if $c _ { 1 } = c _ { - 1 } = 0$ ). If $\kappa$ is infinitely differentiable on $[ - 1 , 1 ]$ so that no such $\nu$ exists, then $\mu _ { k }$ decays faster than any polynomial.
|
| 124 |
+
|
| 125 |
+
The full theorem is given in Appendix B along with its proof, and requires an additional mild technical condition on the expansion which is verified for all kernels considered in this paper, namely, a finite number of terms in the expansions with exponents between $\nu$ and $\nu + 1$ . The proof relies on integration by parts using properties of Legendre polynomials, in a way reminiscent of fast decays of Fourier series for differentiable functions, and on precise computations of the decay for simple functions of the form $t \mapsto ( 1 - t ^ { 2 } ) ^ { \nu }$ . This allows us to obtain the asymptotic decay for general kernel functions $\kappa$ as long as the behavior around the endpoints is known, in contrast to previous approaches which rely on the precise form of $\kappa$ , or of the corresponding activation in the case of arc-cosine kernels (Bach, 2017a; Basri et al., 2019; Bietti $\&$ Mairal, 2019b; Geifman et al., 2020). This enables the study of more general and complex kernels, such as those arising from deep networks, as discussed below. When $\kappa$ is of the form $\begin{array} { r } { \kappa ( t ) = \sum _ { k } b _ { k } t ^ { k } } \end{array}$ , the exponent $\nu$ in Theorem 1 is also related to the decay of coefficients $b _ { k }$ . Such coefficients provide a dimension-free description of the kernel which may be useful for instance in the study of kernel methods in certain high-dimensional regimes (see, e.g., El Karoui, 2010; Ghorbani et al., 2019; Liang et al., 2020). We show in Appendix B.1 that the $b _ { k }$ may be recovered from the $\mu _ { k }$ by taking high-dimensional limits $d \to \infty$ , and that they decay as $k ^ { - \nu - 1 }$ .
|
| 126 |
+
|
| 127 |
+
# 3.2 Consequences for ReLU networks
|
| 128 |
+
|
| 129 |
+
When considering neural networks with ReLU activations, the corresponding random features and neural tangent kernels depend on the arc-cosine functions $\kappa _ { 1 }$ and $\kappa _ { 0 }$ defined in (4). These have the following expansions (with generalized exponents) near $+ 1$ :
|
| 130 |
+
|
| 131 |
+
$$
|
| 132 |
+
\begin{array} { l } { { \kappa _ { 0 } ( 1 - t ) = 1 - \displaystyle \frac { \sqrt { 2 } } { \pi } t ^ { 1 / 2 } + O ( t ^ { 3 / 2 } ) } } \\ { { \kappa _ { 1 } ( 1 - t ) = 1 - t + \displaystyle \frac { 2 \sqrt { 2 } } { 3 \pi } t ^ { 3 / 2 } + O ( t ^ { 5 / 2 } ) . } } \end{array}
|
| 133 |
+
$$
|
| 134 |
+
|
| 135 |
+
Indeed, the first follows from integrating the expansion of the derivative using the relation t arccos(1 ��� t) = 1√2t√1−t/2 and the second follows from the first using the expression of $\kappa _ { 1 }$ in (4). Near $^ { - 1 }$ , we have by symmetry $\begin{array} { r } { \kappa _ { 0 } ( - 1 + t ) = 1 - \kappa _ { 0 } ( 1 - t ) = \frac { \sqrt { 2 } } { \pi } t ^ { 1 / 2 } + O ( t ^ { 3 / 2 } ) } \end{array}$ , and we have different $\begin{array} { r } { \kappa _ { 1 } ( - 1 + t ) = \frac { 2 \sqrt { 2 } } { 3 \pi } t ^ { 3 / 2 } + O ( t ^ { 5 / 3 } ) } \end{array}$ by using (Flajolet $\kappa _ { 1 } ^ { \prime } = \kappa _ { 0 }$ and ick, $\kappa _ { 1 } ( - 1 ) = 0$ . The ability toem VI.8, p.419), $\&$
|
| 136 |
+
together with a complex-analytic property known as $\Delta$ -analyticity, which was shown to hold for RF and NTK kernels by Chen $\&$ Xu (2021). By Theorem 1, we immediately obtain a decay of $k ^ { - d - 2 }$ for even coefficients for $\kappa _ { 1 }$ , and $k ^ { - d }$ for odd coefficients for $\kappa _ { 0 }$ , recovering results of Bach (2017a). For the two-layer ReLU NTK, we have $\kappa _ { \mathrm { N T K } } ^ { 2 } ( u ) = u \kappa _ { 0 } ( u ) + \kappa _ { 1 } ( u )$ , leading to a similar expansion to $\kappa _ { 0 }$ and thus decay, up to a change of parity due to the factor $u$ which changes signs in the expansion around $^ { - 1 }$ ; this recovers Bietti $\&$ Mairal (2019b). We note that for these specific kernels, Bach (2017a); Bietti & Mairal (2019b) show in addition that coefficients of the opposite parity are exactly zero for large enough $k$ , which imposes parity constraints on functions in the RKHS, although such a constraint may be removed in the NTK case by adding a zero-initialized bias term (Basri et al., 2019), leading to a kernel $\kappa _ { \mathrm { N T K } , b } ( u ) = ( u + 1 ) \kappa _ { 0 } ( u ) + \kappa _ { 1 } ( u )$ .
|
| 137 |
+
|
| 138 |
+
Deep networks. Recall from Section 2.1 that the RF and NTK kernels for deep ReLU networks may be obtained through compositions and products using the functions $\kappa _ { 1 }$ and $\kappa _ { 0 }$ . Since asymptotic expansions can be composed and multiplied, we can then obtain expansions for the deep RF and NTK kernels. The following results show that such kernels have the same eigenvalue decay as the ones for the corresponding shallow (two-layer) networks.
|
| 139 |
+
|
| 140 |
+
Corollary 2 (Deep RF decay.). For the random neuron kernel $\kappa _ { R F } ^ { L }$ of an $L$ -layer ReL $U$ network with $L \geq 3$ , we have $\mu _ { k } \sim C ( d , L ) k ^ { - d - 2 }$ , where $C ( d , L )$ is different depending on the parity of $k$ and grows linearly with $L$ .
|
| 141 |
+
|
| 142 |
+
Corollary 3 (Deep NTK decay.). For the neural tangent kernel $\kappa _ { N T K } ^ { L }$ of an $L$ -layer ReL $U$ network with $L \geq 3$ , we have $\mu _ { k } \sim C ( d , L ) k ^ { - d }$ , where $C ( d , L )$ is different depending on the parity of $k$ and grows quadratically with $L$ (it grows linearly with $L$ when considering the normalized NTK $\kappa _ { N T K } ^ { L } / L$ , which satisfies $\kappa _ { N T K } ^ { L } ( 1 ) / L = 1 ,$ ).
|
| 143 |
+
|
| 144 |
+
The proofs, given in Appendix C, use the fact that $\kappa _ { 1 } \cup \kappa _ { 1 }$ and $\kappa _ { 1 }$ have the same non-integer exponent factors in their expansions, and similarly for $\kappa _ { 0 } \cup \kappa _ { 1 }$ and $\kappa _ { 0 }$ . One benefit compared to the shallow case is that the odd and even coefficients are both non-zero with the same decay, which removes the parity constraints, but as mentioned before, simple modifications of the shallow kernels can yield the same effect.
|
| 145 |
+
|
| 146 |
+
The finite neuron case. For two-layer networks with a finite number of neurons, the obtained models correspond to random feature approximations of the limiting kernels (Rahimi & Recht, 2007). Then, one may approximate RKHS functions and achieve optimal rates in non-parametric regression as long as the number of random features exceeds a certain degrees-of-freedom quantity (Bach, 2017b; Rudi & Rosasco, 2017), which is similar to standard such quantities in the analysis of ridge regression (Caponnetto & De Vito, 2007), at least when the data are uniformly distributed on the sphere (otherwise the quantity involved may be larger unless features are sampled non-uniformly). Such a number of random features is optimal for a given eigenvalue decay of the integral operator (Bach, 2017b), which implies that the shallow random feature architectures provides optimal approximation for the multi-layer ReLU kernels as well, since the shallow and deep kernels have the same decay, up to the parity constraint. In order to overcome this constraint for shallow kernels while preserving decay, one may consider vector-valued random features of the form $( \sigma ( w ^ { \top } x ) , x _ { 1 } \sigma ( w ^ { \top } x ) , \ldots , x _ { d } \sigma ( w ^ { \top } x ) )$ with $w \sim \mathcal { N } ( 0 , I )$ , leading to a kernel $\kappa _ { \sigma , b } ( u ) = ( 1 + u ) \kappa _ { \sigma } ( u )$ , where $\kappa _ { \sigma }$ is the random feature kernel corresponding to $\sigma$ . With $\sigma ( u ) = \operatorname* { m a x } ( 0 , u )$ , $\kappa _ { \sigma , b }$ has the same decay as $\kappa _ { \mathrm { R F } } ^ { L }$ , and when $\sigma ( u ) = \mathbb { 1 } \{ u \geq 0 \}$ it has the same decay as κLNTK.
|
| 147 |
+
|
| 148 |
+
# 3.3 Extensions to other kernels
|
| 149 |
+
|
| 150 |
+
We now provide other examples of kernels for which Theorem 1 provides approximation properties thanks to its generality.
|
| 151 |
+
|
| 152 |
+
Laplace kernel and generalizations. The Laplace kernel $k _ { c } ( x , y ) = e ^ { - c \| x - y \| }$ has been found to provide similar empirical behavior to neural networks when fitting randomly labeled data with gradient descent (Belkin et al., 2018). Recently, Geifman et al. (2020) have shown that when inputs are on the sphere, the Laplace kernel has the same decay as the NTK, which may suggest a similar conditioning of the optimization problem as for fully-connected networks, as discussed in Section 2.2. Denoting $\kappa _ { c } ( u ) = e ^ { - c \sqrt { 1 - u } }$ so that $k _ { c } ( x , y ) \mathop { = } \kappa _ { \underline { { c } } \sqrt { 2 } } ( x ^ { \top } y )$ , we may easily recover this result using Theorem 1 by noticing that $\kappa _ { c }$ is infinitely differentiable around $^ { - 1 }$ and satisfies
|
| 153 |
+
|
| 154 |
+
$$
|
| 155 |
+
\kappa _ { c } ( 1 - t ) = e ^ { - c \sqrt { t } } = 1 - c \sqrt { t } + O ( t ) ,
|
| 156 |
+
$$
|
| 157 |
+
|
| 158 |
+
which yields the same decay $k ^ { - d }$ as the NTK. Geifman et al. (2020) also consider a heuristic generalization of the Laplace kernel with different exponents, $\kappa _ { c , \gamma } ( u ) = e ^ { - c ( 1 - u ) ^ { \gamma } }$ . Theorem 1 allows us to obtain a precise decay for this kernel as well using $\kappa _ { c , \gamma } ( 1 - t ) =$ $1 - c t ^ { \gamma } + O ( t ^ { 2 \gamma } )$ , which is of the form $k ^ { - d - 2 \gamma + 1 }$ for non-integer $\gamma > 0$ , and in particular approaches the limiting order of smoothness $( d - 1 ) / 2$ when $\gamma \to 0$ .3
|
| 159 |
+
|
| 160 |
+
Deep kernels with step activations. We saw in Section 3.2 that for ReLU activations, depth does not change the decay of the corresponding kernels. In contrast, when considering step activations $\sigma ( u ) = \mathbb { 1 } \{ u \geq 0 \}$ , we show in Appendix C.3 that approximation properties of the corresponding random neuron kernels (of the form $\kappa _ { 0 } \cup \cdots \cup \kappa _ { 0 }$ ) improve with depth, leading to a decay $k ^ { - d - 2 \nu + 1 }$ with $\nu = 1 / 2 ^ { L - 1 }$ for $L$ layers. This also leads to an RKHS which becomes as large as allowed (order of smoothness close to $( d - 1 ) / 2$ ) when $L \infty$ . While this may suggest a benefit of depth, note that step activations make optimization hard for anything beyond a linear regime with random weights, since the gradients with respect to inner neurons vanish. Theorem 1 may also be applied to deep kernels with other positively homogeneous activations $\sigma _ { s } ( u ) = \operatorname* { m a x } ( 0 , u ) ^ { s }$ with $s \geq 2$ , for which endpoint expansions easily follow from those of $\kappa _ { 0 }$ or $\kappa _ { 1 }$ through integration.
|
| 161 |
+
|
| 162 |
+
Infinitely differentiable kernels. Finally, we note that Theorem 1 shows that kernels associated to infinitely differentiable activations (which are themselves infinitely differentiable, see Daniely et al. $( 2 0 1 6 ) ^ { 4 }$ ), as well as Gaussian kernels on the sphere of the form $e ^ { - c ( 1 - x ^ { \top } y ) }$ , have faster decays than any polynomial. This results in a “small” RKHS that only contains smooth functions. See Azevedo $\&$ Menegatto (2014); Minh et al. (2006) for a more precise study of the decay for Gaussian kernels on the sphere.
|
| 163 |
+
|
| 164 |
+
# 4 Numerical experiments
|
| 165 |
+
|
| 166 |
+
We now present numerical experiments on synthetic and real data to illustrate our theory.
|
| 167 |
+
Our code is available at https://github.com/albietz/deep_shallow_kernel.
|
| 168 |
+
|
| 169 |
+
Synthetic experiments. We consider randomly sampled inputs on the sphere $\mathbb { S } ^ { 3 }$ in 4 dimensions, and outputs generated according to the following target models, for an arbitrary w ∈ S3: f ∗1 (x) = 1{w>x ≥ 0.7} and f ∗2 (x) = e−(1−w>x)3/2 $f _ { 2 } ^ { * } ( x ) = e ^ { - ( 1 - w ^ { \top } x ) ^ { 3 / 2 } } + e ^ { - ( 1 + w ^ { \top } x ) ^ { 3 / 2 } }$ Note that $f _ { 1 } ^ { * }$ is discontinuous and thus not in the RKHS in general, while $f _ { 2 } ^ { * }$ is in the RKHS of $\kappa _ { 1 }$ (since it is even and has the same decay as $\kappa _ { 1 }$ as discussed in Section 3.3). In Figure 1 we compare the quality of approximation for different kernels by examining generalization performance of ridge regression with exact kernels or random features. The regularization parameter $\lambda$ is optimized on 10 000 test datapoints on a logarithmic grid. In order to illustrate the difficulty of optimization due to a small optimal $\lambda$ , which would also indicate slower convergence with gradient methods, we consider grids with $\lambda \geq \lambda _ { \operatorname* { m i n } }$ , for two different choices of $\lambda _ { \mathrm { m i n } }$ . We see that all kernels provide a similar rate of approximation for a large enough grid, but when fixing a smaller optimization budget by taking a larger $\lambda _ { \mathrm { m i n } }$ , the NTK and Laplace kernels can achieve better performance for large sample size $n$ , thanks to a slower eigenvalue decay of the covariance operator. Figure $1 ( \mathrm { r i g h t } )$ shows that when using $m = { \sqrt { n } }$ random features (which can achieve optimal rates in some settings, see Rudi & Rosasco, 2017), the “shallow” ReLU network performs better than a three-layer version, despite having fewer weights. This suggests that in addition to providing no improvements to approximation in the infinite-width case, the kernel regimes for deep ReLU networks may even be worse than their two-layer counterparts in the finite-width setting.
|
| 170 |
+
|
| 171 |
+
MNIST and Fashion-MNIST. In Table 1, we consider the image classification datasets MNIST and Fashion-MNIST, which both consist of 60k training and 10k test images of size 28x28 with 10 output classes. We evaluate one-versus-all classifiers obtained by using kernel ridge regression by setting $y = 0 . 9$ for the correct label and $y = - 0 . 1$ otherwise. We train on random subsets of 50k examples and use the remaining 10k examples for validation. We find that test accuracy is comparable for different numbers of layers in RF or NTK kernels, with a slightly poorer performance for the two-layer case likely due to parity constraints, in agreement with our theoretical result that the decay is the same for different $L$ . There is a small decrease in accuracy for growing $L$ , which may reflect changes in the decay constants or numerical errors when composing kernels. The slightly better performance of RF compared to NTK may suggest that these problems are relatively easy (e.g., the regression function is smooth), so that a faster decay is preferable due to better adaptivity to smoothness.
|
| 172 |
+
|
| 173 |
+

|
| 174 |
+
Figure 1: (left, middle) expected squared error vs sample size $n$ for kernel ridge regression estimators with different kernels on $f _ { 1 } ^ { * }$ and with two different budgets on optimization difficulty $\lambda _ { \mathrm { m i n } }$ (the minimum regularization parameter allowed). (right) ridge regression with one or two layers of random ReLU features on $f _ { 2 } ^ { * }$ , with different scalings of the number of “neurons” at each layer in terms of $n$ .
|
| 175 |
+
|
| 176 |
+
Table 1: Test accuracies on MNIST (left) and Fashion-MNIST (right) for RF and NTK kernels with varying numbers of layers $L$ . We use kernel ridge regression on 50k samples, with $\lambda$ optimized on a validation set of size 10k, and report mean and standard errors across 5 such random splits of the 60k training samples. For comparison, the Laplace kernel with $c = 1$ yields accuracies $9 8 . 3 9 \pm 0 . 0 2$ on MNIST and $9 0 . 3 8 \pm 0 . 0 6$ on F-MNIST.
|
| 177 |
+
|
| 178 |
+
MNIST
|
| 179 |
+
|
| 180 |
+
<table><tr><td rowspan=1 colspan=1>L</td><td rowspan=1 colspan=1>RF</td><td rowspan=1 colspan=1>NTK</td></tr><tr><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>98.60 ± 0.03</td><td rowspan=1 colspan=1>98.49± 0.02</td></tr><tr><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>98.67 ± 0.03</td><td rowspan=2 colspan=1>98.53 ± 0.0298.49 ± 0.01</td></tr><tr><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>98.66 ± 0.02</td></tr><tr><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>98.65 ± 0.04</td><td rowspan=1 colspan=1>98.46 ± 0.02</td></tr></table>
|
| 181 |
+
|
| 182 |
+
F-MNIST
|
| 183 |
+
|
| 184 |
+
<table><tr><td>L</td><td>RF</td><td>NTK</td></tr><tr><td>2 3 4 5</td><td>90.75 ± 0.11 90.87 ± 0.16 90.89 ± 0.13 90.88 ± 0.08</td><td>90.65 ± 0.07 90.62 ± 0.08 90.55 ± 0.07 90.50 ± 0.05</td></tr></table>
|
| 185 |
+
|
| 186 |
+
# 5 Discussion
|
| 187 |
+
|
| 188 |
+
In this paper, we have analyzed the approximation properties of deep networks in kernel regimes, by studying eigenvalue decays of integral operators through differentiability properties of the kernel function. In particular, the decay is governed by the form of the function’s (generalized) power series expansion around $\pm 1$ , which remains the same for kernels arising from fully-connected ReLU networks of varying depths. This result suggests that the kernel approach is unsatisfactory for understanding the power of depth in fully-connected networks. In particular, it highlights the need to incorporate other regimes in the study of deep networks, such as the mean field regime (Chizat & Bach, 2018; Mei et al., 2018), and other settings with hierarchical structure (see, e.g., Allen-Zhu & Li, 2020; Chen et al., 2020). We note that our results do not rule out benefits of depth for other network architectures in kernel regimes; for instance, depth may improve stability properties of convolutional kernels (Bietti & Mairal, 2019a;b), and a precise study of approximation for such kernels and its dependence on depth would also be of interest.
|
| 189 |
+
|
| 190 |
+
# Acknowledgments
|
| 191 |
+
|
| 192 |
+
The authors would like to thank David Holzm¨uller for finding an error in an earlier version of the paper, which led us to include the new assumption on differentiation of asymptotic expansions in Theorem 1. This work was funded in part by the French government under management of Agence Nationale de la Recherche as part of the “Investissements d’avenir” program, reference ANR-19-P3IA-0001 (PRAIRIE 3IA Institute). We also acknowledge support of the European Research Council (grant SEQUOIA 724063).
|
| 193 |
+
|
| 194 |
+
# References
|
| 195 |
+
|
| 196 |
+
Zeyuan Allen-Zhu and Yuanzhi Li. Backward feature correction: How deep learning performs deep learning. arXiv preprint arXiv:2001.04413, 2020.
|
| 197 |
+
|
| 198 |
+
Zeyuan Allen-Zhu, Yuanzhi Li, and Yingyu Liang. Learning and generalization in overparameterized neural networks, going beyond two layers. In Advances in Neural Information Processing Systems (NeurIPS), 2019a.
|
| 199 |
+
|
| 200 |
+
Zeyuan Allen-Zhu, Yuanzhi Li, and Zhao Song. A convergence theory for deep learning via over-parameterization. In Proceedings of the International Conference on Machine Learning (ICML), 2019b.
|
| 201 |
+
|
| 202 |
+
Sanjeev Arora, Simon S Du, Wei Hu, Zhiyuan Li, Russ R Salakhutdinov, and Ruosong Wang. On exact computation with an infinitely wide neural net. In Advances in Neural Information Processing Systems (NeurIPS), 2019a.
|
| 203 |
+
|
| 204 |
+
Sanjeev Arora, Simon S Du, Wei Hu, Zhiyuan Li, and Ruosong Wang. Fine-grained analysis of optimization and generalization for overparameterized two-layer neural networks. In Proceedings of the International Conference on Machine Learning (ICML), 2019b.
|
| 205 |
+
|
| 206 |
+
Kendall Atkinson and Weimin Han. Spherical harmonics and approximations on the unit sphere: an introduction, volume 2044. Springer Science & Business Media, 2012.
|
| 207 |
+
|
| 208 |
+
Douglas Azevedo and Valdir Antonio Menegatto. Sharp estimates for eigenvalues of integral operators generated by dot product kernels on the sphere. Journal of Approximation Theory, 177:57–68, 2014.
|
| 209 |
+
|
| 210 |
+
Francis Bach. Sharp analysis of low-rank kernel matrix approximations. In Conference on Learning Theory (COLT), 2013.
|
| 211 |
+
|
| 212 |
+
Francis Bach. Breaking the curse of dimensionality with convex neural networks. Journal of Machine Learning Research (JMLR), 18(1):629–681, 2017a.
|
| 213 |
+
|
| 214 |
+
Francis Bach. On the equivalence between kernel quadrature rules and random feature expansions. Journal of Machine Learning Research (JMLR), 18(1):714–751, 2017b.
|
| 215 |
+
|
| 216 |
+
Ronen Basri, David Jacobs, Yoni Kasten, and Shira Kritchman. The convergence rate of neural networks for learned functions of different frequencies. In Advances in Neural Information Processing Systems (NeurIPS), 2019.
|
| 217 |
+
|
| 218 |
+
Ronen Basri, Meirav Galun, Amnon Geifman, David Jacobs, Yoni Kasten, and Shira Kritchman. Frequency bias in neural networks for input of non-uniform density. In Proceedings of the International Conference on Machine Learning (ICML), 2020.
|
| 219 |
+
|
| 220 |
+
Mikhail Belkin, Siyuan Ma, and Soumik Mandal. To understand deep learning we need to understand kernel learning. In Proceedings of the International Conference on Machine Learning (ICML), 2018.
|
| 221 |
+
|
| 222 |
+
Alberto Bietti and Julien Mairal. Group invariance, stability to deformations, and complexity of deep convolutional representations. Journal of Machine Learning Research (JMLR), 20(25):1–49, 2019a.
|
| 223 |
+
|
| 224 |
+
Alberto Bietti and Julien Mairal. On the inductive bias of neural tangent kernels. In Advances in Neural Information Processing Systems (NeurIPS), 2019b.
|
| 225 |
+
|
| 226 |
+
Jan van den Brand, Binghui Peng, Zhao Song, and Omri Weinstein. Training (overparametrized) neural networks in near-linear time. arXiv preprint arXiv:2006.11648, 2020.
|
| 227 |
+
|
| 228 |
+
Yuan Cao, Zhiying Fang, Yue Wu, Ding-Xuan Zhou, and Quanquan Gu. Towards understanding the spectral bias of deep learning. arXiv preprint arXiv:1912.01198, 2019.
|
| 229 |
+
|
| 230 |
+
Andrea Caponnetto and Ernesto De Vito. Optimal rates for the regularized least-squares algorithm. Foundations of Computational Mathematics, 7(3):331–368, 2007.
|
| 231 |
+
|
| 232 |
+
Lin Chen and Sheng Xu. Deep neural tangent kernel and laplace kernel have the same rkhs. In Proceedings of the International Conference on Learning Representations (ICLR), 2021.
|
| 233 |
+
|
| 234 |
+
Minshuo Chen, Yu Bai, Jason D Lee, Tuo Zhao, Huan Wang, Caiming Xiong, and Richard Socher. Towards understanding hierarchical learning: Benefits of neural representations. In Advances in Neural Information Processing Systems (NeurIPS), 2020.
|
| 235 |
+
|
| 236 |
+
Lenaic Chizat and Francis Bach. On the global convergence of gradient descent for overparameterized models using optimal transport. In Advances in Neural Information Processing Systems (NeurIPS), 2018.
|
| 237 |
+
|
| 238 |
+
Lenaic Chizat, Edouard Oyallon, and Francis Bach. On lazy training in differentiable programming. In Advances in Neural Information Processing Systems (NeurIPS), 2019.
|
| 239 |
+
|
| 240 |
+
Youngmin Cho and Lawrence K Saul. Kernel methods for deep learning. In Advances in Neural Information Processing Systems (NIPS), 2009.
|
| 241 |
+
|
| 242 |
+
Felipe Cucker and Steve Smale. On the mathematical foundations of learning. Bulletin of the American mathematical society, 39(1):1–49, 2002.
|
| 243 |
+
|
| 244 |
+
Amit Daniely. Depth separation for neural networks. In Conference on Learning Theory (COLT), 2017.
|
| 245 |
+
|
| 246 |
+
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 (NIPS), 2016.
|
| 247 |
+
|
| 248 |
+
Simon S Du, Jason D Lee, Haochuan Li, Liwei Wang, and Xiyu Zhai. Gradient descent finds global minima of deep neural networks. In Proceedings of the International Conference on Machine Learning (ICML), 2019a.
|
| 249 |
+
|
| 250 |
+
Simon S Du, Xiyu Zhai, Barnabas Poczos, and Aarti Singh. Gradient descent provably optimizes over-parameterized neural networks. In Proceedings of the International Conference on Learning Representations (ICLR), 2019b.
|
| 251 |
+
|
| 252 |
+
Costas Efthimiou and Christopher Frye. Spherical harmonics in p dimensions. World Scientific, 2014.
|
| 253 |
+
|
| 254 |
+
Noureddine El Karoui. The spectrum of kernel random matrices. The Annals of Statistics, 38(1):1–50, 2010.
|
| 255 |
+
|
| 256 |
+
Ronen Eldan and Ohad Shamir. The power of depth for feedforward neural networks. In Conference on Learning Theory (COLT), 2016.
|
| 257 |
+
|
| 258 |
+
Zhou Fan and Zhichao Wang. Spectra of the conjugate kernel and neural tangent kernel for linear-width neural networks. In Advances in Neural Information Processing Systems (NeurIPS), 2020.
|
| 259 |
+
|
| 260 |
+
Philippe Flajolet and Robert Sedgewick. Analytic combinatorics. Cambridge University press, 2009.
|
| 261 |
+
|
| 262 |
+
Amnon Geifman, Abhay Yadav, Yoni Kasten, Meirav Galun, David Jacobs, and Ronen Basri. On the similarity between the laplace and neural tangent kernels. In Advances in Neural Information Processing Systems (NeurIPS), 2020.
|
| 263 |
+
|
| 264 |
+
Behrooz Ghorbani, Song Mei, Theodor Misiakiewicz, and Andrea Montanari. Linearized two-layers neural networks in high dimension. arXiv preprint arXiv:1904.12191, 2019.
|
| 265 |
+
|
| 266 |
+
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 Conference on Computer Vision and Pattern Recognition (CVPR), 2015.
|
| 267 |
+
|
| 268 |
+
Kurt Hornik, Maxwell Stinchcombe, and Halbert White. Multilayer feedforward networks are universal approximators. Neural networks, 2(5):359–366, 1989.
|
| 269 |
+
|
| 270 |
+
Mourad Ismail. Classical and quantum orthogonal polynomials in one variable, volume 13. Cambridge university press, 2005.
|
| 271 |
+
|
| 272 |
+
Arthur Jacot, Franck Gabriel, and Cl´ement Hongler. Neural tangent kernel: Convergence and generalization in neural networks. In Advances in Neural Information Processing Systems (NIPS), 2018.
|
| 273 |
+
|
| 274 |
+
Jaehoon Lee, Yasaman Bahri, Roman Novak, Samuel S Schoenholz, Jeffrey Pennington, and Jascha Sohl-Dickstein. Deep neural networks as gaussian processes. In Proceedings of the International Conference on Learning Representations (ICLR), 2018.
|
| 275 |
+
|
| 276 |
+
Jason D Lee, Ruoqi Shen, Zhao Song, Mengdi Wang, et al. Generalized leverage score sampling for neural networks. In Advances in Neural Information Processing Systems (NeurIPS), 2020.
|
| 277 |
+
|
| 278 |
+
Yuanzhi Li and Yingyu Liang. Learning overparameterized neural networks via stochastic gradient descent on structured data. In Advances in Neural Information Processing Systems (NeurIPS), 2018.
|
| 279 |
+
|
| 280 |
+
Tengyuan Liang, Alexander Rakhlin, and Xiyu Zhai. On the risk of minimum-norm interpolants and restricted lower isometry of kernels. In Conference on Learning Theory (COLT), 2020.
|
| 281 |
+
|
| 282 |
+
Alexander Matthews, Mark Rowland, Jiri Hron, Richard E Turner, and Zoubin Ghahramani. Gaussian process behaviour in wide deep neural networks. arXiv preprint arXiv:1804.11271, 2018.
|
| 283 |
+
|
| 284 |
+
Song Mei, Andrea Montanari, and Phan-Minh Nguyen. A mean field view of the landscape of two-layer neural networks. Proceedings of the National Academy of Sciences, 115(33): E7665–E7671, 2018.
|
| 285 |
+
|
| 286 |
+
Hrushikesh N Mhaskar and Tomaso Poggio. Deep vs. shallow networks: An approximation theory perspective. Analysis and Applications, 14(06):829–848, 2016.
|
| 287 |
+
|
| 288 |
+
Ha Quang Minh, Partha Niyogi, and Yuan Yao. Mercer’s theorem, feature maps, and smoothing. In Conference on Learning Theory (COLT), 2006.
|
| 289 |
+
|
| 290 |
+
Radford M Neal. Bayesian learning for neural networks. Springer, 1996.
|
| 291 |
+
|
| 292 |
+
Allan Pinkus. Approximation theory of the mlp model in neural networks. Acta numerica, 8:143–195, 1999.
|
| 293 |
+
|
| 294 |
+
Ali Rahimi and Benjamin Recht. Random features for large-scale kernel machines. In Advances in Neural Information Processing Systems (NIPS), 2007.
|
| 295 |
+
|
| 296 |
+
Alessandro Rudi and Lorenzo Rosasco. Generalization properties of learning with random features. In Advances in Neural Information Processing Systems, pp. 3215–3225, 2017.
|
| 297 |
+
|
| 298 |
+
Meyer Scetbon and Zaid Harchaoui. Risk bounds for multi-layer perceptrons through spectra of integral operators. arXiv preprint arXiv:2002.12640, 2020.
|
| 299 |
+
|
| 300 |
+
Johannes Schmidt-Hieber et al. Nonparametric regression using deep neural networks with relu activation function. Annals of Statistics, 48(4):1875–1897, 2020.
|
| 301 |
+
|
| 302 |
+
Alex J Smola, Zoltan L Ovari, and Robert C Williamson. Regularization with dot-product kernels. In Advances in Neural Information Processing Systems (NIPS), 2001.
|
| 303 |
+
|
| 304 |
+
Zhao Song and Xin Yang. Quadratic suffices for over-parametrization via matrix chernoff bound. arXiv preprint arXiv:1906.03593, 2019.
|
| 305 |
+
|
| 306 |
+
Matus Telgarsky. Benefits of depth in neural networks. In Conference on Learning Theory (COLT), 2016.
|
| 307 |
+
|
| 308 |
+
Bo Xie, Yingyu Liang, and Le Song. Diverse neural network learns true target functions. In Proceedings of the International Conference on Artificial Intelligence and Statistics (AISTATS), 2017.
|
| 309 |
+
|
| 310 |
+
Greg Yang and Hadi Salman. A fine-grained spectral perspective on neural networks. arXiv preprint arXiv:1907.10599, 2019.
|
| 311 |
+
|
| 312 |
+
Dmitry Yarotsky. Error bounds for approximations with deep relu networks. Neural Networks, 94:103–114, 2017.
|
| 313 |
+
|
| 314 |
+
Difan Zou, Yuan Cao, Dongruo Zhou, and Quanquan Gu. Stochastic gradient descent optimizes over-parameterized deep relu networks. Machine Learning, 2019.
|
| 315 |
+
|
| 316 |
+
# A Background on Spherical Harmonics
|
| 317 |
+
|
| 318 |
+
In this section, we provide some background on spherical harmonics needed for our study of approximation. See (Efthimiou & Frye, 2014; Atkinson & Han, 2012; Ismail, 2005) for references, as well as (Bach, 2017a, Appendix D). We consider inputs on the $d - 1$ sphere $\mathbb { S } ^ { d - 1 } = \{ x \in \mathbb { R } ^ { d } , \| x \| = 1 \}$ .
|
| 319 |
+
|
| 320 |
+
We recall some properties of the spherical harmonics $Y _ { k , j }$ introduced in Section 2.2. For j = 1, . . . , N (d, k), where N (d, k) = 2k+d−2 k+d−3, the spherical harmonics $Y _ { k , j }$ are homogeneous harmonic polynomials of degree $k$ that are orthonormal with respect to the uniform distribution $\tau$ on the $d$ –1 sphere. The degree $k$ plays the role of an integer frequency, as in Fourier series, and the collection $\{ Y _ { k , j } , k \geq 0 , j = 1 , \ldots , N ( d , k ) \}$ forms an orthonormal basis of $L ^ { 2 } ( \mathbb { S } ^ { d - 1 } , d \tau )$ . As with Fourier series, there are tight connections between decay of coefficients in this basis w.r.t. $k$ , and regularity/differentiability of functions, in this case differentiability on the sphere. This follows from the fact that spherical harmonics are eigenfunctions of the Laplace-Beltrami operator on the sphere $\Delta _ { \mathbb { S } ^ { d - 1 } }$ (see Efthimiou & Frye, 2014, Proposition 4.5):
|
| 321 |
+
|
| 322 |
+
$$
|
| 323 |
+
\Delta _ { \mathbb { S } ^ { d - 1 } } Y _ { k , j } = - k ( k + d - 2 ) Y _ { k , j } .
|
| 324 |
+
$$
|
| 325 |
+
|
| 326 |
+
For a given frequency $k$ , we have the following addition formula:
|
| 327 |
+
|
| 328 |
+
$$
|
| 329 |
+
\sum _ { j = 1 } ^ { N ( d , k ) } Y _ { k , j } ( x ) Y _ { k , j } ( y ) = N ( d , k ) P _ { k } ( x ^ { \top } y ) ,
|
| 330 |
+
$$
|
| 331 |
+
|
| 332 |
+
where $P _ { k }$ is the $k$ -th Legendre polynomial in dimension $d$ (also known as Gegenbauer polynomial when using a different scaling), given by the Rodrigues formula:
|
| 333 |
+
|
| 334 |
+
$$
|
| 335 |
+
P _ { k } ( t ) = ( - 1 / 2 ) ^ { k } \frac { \Gamma ( \frac { d - 1 } { 2 } ) } { \Gamma ( k + \frac { d - 1 } { 2 } ) } ( 1 - t ^ { 2 } ) ^ { ( 3 - d ) / 2 } \left( \frac { d } { d t } \right) ^ { k } ( 1 - t ^ { 2 } ) ^ { k + ( d - 3 ) / 2 } .
|
| 336 |
+
$$
|
| 337 |
+
|
| 338 |
+
Note that these may also be expressed using the hypergeometric function ${ } _ { 2 } F _ { 1 }$ (see, e.g., Ismail, 2005, Section 4.5), an expression we will use in proof of Theorem 1 (see the proof of Lemma 6).
|
| 339 |
+
|
| 340 |
+
The polynomials $P _ { k }$ are orthogonal in $L ^ { 2 } ( [ - 1 , 1 ] , d \nu )$ where the measure $d \nu$ is given by the weight function $d \nu ( t ) = ( 1 - t ^ { 2 } ) ^ { ( d - 3 ) / 2 } d t$ , and we have
|
| 341 |
+
|
| 342 |
+
$$
|
| 343 |
+
\int _ { - 1 } ^ { 1 } P _ { k } ^ { 2 } ( t ) ( 1 - t ^ { 2 } ) ^ { ( d - 3 ) / 2 } d t = \frac { \omega _ { d - 1 } } { \omega _ { d - 2 } } \frac { 1 } { N ( d , k ) } ,
|
| 344 |
+
$$
|
| 345 |
+
|
| 346 |
+
where $\begin{array} { r } { \omega _ { p - 1 } = \frac { 2 \pi ^ { p / 2 } } { \Gamma ( p / 2 ) } } \end{array}$ denotes the surface of the sphere $\mathbb { S } ^ { p - 1 }$ in $p$ dimensions. Using the addition formula (15) and orthogonality of spherical harmonics, we can show
|
| 347 |
+
|
| 348 |
+
$$
|
| 349 |
+
\int P _ { j } ( w ^ { \top } x ) P _ { k } ( w ^ { \top } y ) d \tau ( w ) = \frac { \delta _ { j k } } { N ( d , k ) } P _ { k } ( x ^ { \top } y )
|
| 350 |
+
$$
|
| 351 |
+
|
| 352 |
+
We will use two other properties of Legendre polynomials, namely the following recurrence relation (Efthimiou & Frye, 2014, Eq. 4.36)
|
| 353 |
+
|
| 354 |
+
$$
|
| 355 |
+
t P _ { k } ( t ) = \frac { k } { 2 k + d - 2 } P _ { k - 1 } ( t ) + \frac { k + d - 2 } { 2 k + d - 2 } P _ { k + 1 } ( t ) ,
|
| 356 |
+
$$
|
| 357 |
+
|
| 358 |
+
for $k \geq 1$ , and for $k = 0$ we simply have $t P _ { 0 } ( t ) = P _ { 1 } ( t )$ , as well as the differential equation (see, e.g., Efthimiou $\&$ Frye, 2014, Proposition 4.20):
|
| 359 |
+
|
| 360 |
+
$$
|
| 361 |
+
( 1 - t ^ { 2 } ) P _ { k } ^ { \prime \prime } ( t ) + ( 1 - d ) t P _ { k } ^ { \prime } ( t ) + k ( k + d - 2 ) P _ { k } ( t ) = 0 .
|
| 362 |
+
$$
|
| 363 |
+
|
| 364 |
+
The Funk-Hecke formula is helpful for computing Fourier coefficients in the basis of spherical harmonics in terms of Legendre polynomials: for any $j = 1 , \ldots , N ( d , k )$ , we have
|
| 365 |
+
|
| 366 |
+
$$
|
| 367 |
+
\int f ( x ^ { \top } y ) Y _ { k , j } ( y ) d \tau ( y ) = \frac { \omega _ { d - 2 } } { \omega _ { d - 1 } } Y _ { k , j } ( x ) \int _ { - 1 } ^ { 1 } f ( t ) P _ { k } ( t ) ( 1 - t ^ { 2 } ) ^ { ( d - 3 ) / 2 } d t .
|
| 368 |
+
$$
|
| 369 |
+
|
| 370 |
+
For example, we may use this to obtain decompositions of dot-product kernels by computing Fourier coefficients of functions $\kappa ( \langle x , \cdot \rangle )$ . Indeed, denoting
|
| 371 |
+
|
| 372 |
+
$$
|
| 373 |
+
\mu _ { k } = \frac { \omega _ { d - 2 } } { \omega _ { d - 1 } } \int _ { - 1 } ^ { 1 } \kappa ( t ) P _ { k } ( t ) ( 1 - t ^ { 2 } ) ^ { ( d - 3 ) / 2 } d t ,
|
| 374 |
+
$$
|
| 375 |
+
|
| 376 |
+
writing the decomposition of $\kappa ( \langle x , \cdot \rangle )$ using (21) leads to the following Mercer decomposition of the kernel:
|
| 377 |
+
|
| 378 |
+
$$
|
| 379 |
+
\kappa ( x ^ { \top } y ) = \sum _ { k = 0 } ^ { \infty } \mu _ { k } \sum _ { j = 1 } ^ { N ( d , k ) } Y _ { k , j } ( x ) Y _ { k , j } ( y ) = \sum _ { k = 0 } ^ { \infty } \mu _ { k } N ( d , k ) P _ { k } ( x ^ { \top } y ) .
|
| 380 |
+
$$
|
| 381 |
+
|
| 382 |
+
# B Proof of Theorem 1
|
| 383 |
+
|
| 384 |
+
The proof of Theorem 1, stated below in full as Theorem 7, proceeds as follows. We first derive an upper bound on the decay of $\kappa$ of the form $k ^ { - d - 2 \nu + 3 }$ (Lemma 5), which is weaker than the desired $k ^ { - d - 2 \nu + 1 }$ , by exploiting regularity properties of $\kappa$ through integration by parts. The goal is then to apply this result on a function $\tilde { \kappa } = \kappa - \psi$ , where $\psi$ is a function that allows us to “cancel” the leading terms in the expansions of $\kappa$ , while being simple enough that it allows a precise estimate of its decay. In the proof of Theorem 7, we follow this strategy by considering $\psi$ as a sum of functions of the form $t \mapsto ( 1 - t ^ { 2 } ) ^ { \nu }$ and $t \mapsto t ( 1 - t ^ { 2 } ) ^ { \nu }$ , for which we provide a precise computation of the decay in Lemma 6.
|
| 385 |
+
|
| 386 |
+
Decay upper bound through regularity. We begin by establishing a weak upper bound on the decay of $\kappa$ (Lemma 5) by leveraging its regularity up to the terms of order $( 1 - t ^ { 2 } ) ^ { \nu }$ . This is achieved by iteratively applying the following integration by parts lemma, which is conceptually similar to integrating by parts on the sphere by leveraging the spherical Laplacian relation (14) in Appendix A, but directly uses properties of $\kappa$ and of Legendre polynomials instead (namely, the differential equation (20)). We note that the final statement in Theorem 1 on infinitely differentiable $\kappa$ directly follows from Lemma 5.
|
| 387 |
+
|
| 388 |
+
Lemma 4 (Integration by parts lemma). Let $\kappa : [ - 1 , 1 ] \to \mathbb { R }$ be a function that is $C ^ { \infty }$ on $( - 1 , 1 )$ and such that $\kappa ^ { \prime } ( t ) ( 1 - t ^ { 2 } ) ^ { 1 + \frac { d - 3 } { 2 } } = O ( 1 )$ . We have
|
| 389 |
+
|
| 390 |
+
$$
|
| 391 |
+
\begin{array} { r l r } { { \int _ { - 1 } ^ { 1 } \kappa ( t ) P _ { k } ( t ) ( 1 - t ^ { 2 } ) ^ { \frac { d - 3 } { 2 } } d t = \frac { 1 } { k ( k + d - 2 ) } \Big ( - \kappa ( t ) ( 1 - t ^ { 2 } ) ^ { 1 + \frac { d - 3 } { 2 } } P _ { k } ^ { \prime } ( t ) \Big | _ { - 1 } ^ { 1 } } } & { { } } & { { ( 2 3 ) } } \\ { + \kappa ^ { \prime } ( t ) ( 1 - t ^ { 2 } ) ^ { 1 + \frac { d - 3 } { 2 } } P _ { k } ( t ) \Big | _ { - 1 } ^ { 1 } + \int _ { - 1 } ^ { 1 } \tilde { \kappa } ( t ) P _ { k } ( t ) ( 1 - t ^ { 2 } ) ^ { ( d - 3 ) / 2 } d t } & { { } } & { } \end{array}
|
| 392 |
+
$$
|
| 393 |
+
|
| 394 |
+
with $\tilde { \kappa } ( t ) = - \kappa ^ { \prime \prime } ( t ) ( 1 - t ^ { 2 } ) + ( d - 1 ) t \kappa ^ { \prime } ( t ) .$
|
| 395 |
+
|
| 396 |
+
Proof. In order to perform integration by parts, we use the following differential equation satisfied by Legendre polynomials (see, e.g., Efthimiou $\&$ Frye, 2014, Proposition 4.20):
|
| 397 |
+
|
| 398 |
+
$$
|
| 399 |
+
( 1 - t ^ { 2 } ) P _ { k } ^ { \prime \prime } ( t ) + ( 1 - d ) t P _ { k } ^ { \prime } ( t ) + k ( k + d - 2 ) P _ { k } ( t ) = 0 .
|
| 400 |
+
$$
|
| 401 |
+
|
| 402 |
+
Using this equation, we may write for $k \geq 1$ ,
|
| 403 |
+
|
| 404 |
+
$$
|
| 405 |
+
\begin{array} { c } { { \displaystyle { \int _ { - 1 } ^ { 1 } \kappa ( t ) P _ { k } ( t ) ( 1 - t ^ { 2 } ) ^ { ( d - 3 ) / 2 } d t = \frac { 1 } { k ( k + d - 2 ) } \Big ( ( d - 1 ) \int t \kappa ( t ) P _ { k } ^ { \prime } ( t ) ( 1 - t ^ { 2 } ) ^ { \frac { d - 3 } { 2 } } d t } } } \\ { { - \displaystyle { \int \kappa ( t ) P _ { k } ^ { \prime \prime } ( t ) ( 1 - t ^ { 2 } ) ^ { 1 + \frac { d - 3 } { 2 } } d t } \Big ) . } } \end{array}
|
| 406 |
+
$$
|
| 407 |
+
|
| 408 |
+
We may integrate the second term by parts using
|
| 409 |
+
|
| 410 |
+
$$
|
| 411 |
+
\begin{array} { c } { { \displaystyle \frac { d } { d t } \left( \kappa ( t ) ( 1 - t ^ { 2 } ) ^ { 1 + \frac { d - 3 } { 2 } } \right) = \kappa ^ { \prime } ( t ) ( 1 - t ^ { 2 } ) ^ { 1 + \frac { d - 3 } { 2 } } - 2 t ( 1 + ( d - 3 ) / 2 ) \kappa ( t ) ( 1 - t ^ { 2 } ) ^ { \frac { d - 3 } { 2 } } } } \\ { { = \kappa ^ { \prime } ( t ) ( 1 - t ^ { 2 } ) ^ { 1 + \frac { d - 3 } { 2 } } - ( d - 1 ) t \kappa ( t ) ( 1 - t ^ { 2 } ) ^ { \frac { d - 3 } { 2 } } . } } \end{array}
|
| 412 |
+
$$
|
| 413 |
+
|
| 414 |
+
Noting that the first term in (26) cancels out with the integral resulting from the second term in (28), we then obtain
|
| 415 |
+
|
| 416 |
+
$$
|
| 417 |
+
\begin{array} { r l } { \displaystyle \int _ { - 1 } ^ { 1 } \kappa ( t ) P _ { k } ( t ) ( 1 - t ^ { 2 } ) ^ { ( d - 3 ) / 2 } d t = \frac { 1 } { k ( k + d - 2 ) } \Big ( - \kappa ( t ) ( 1 - t ^ { 2 } ) ^ { 1 + \frac { d - 3 } { 2 } } P _ { k } ^ { \prime } ( t ) \Big | _ { - 1 } ^ { 1 } } & { } \\ { + \displaystyle \int _ { - 1 } ^ { 1 } \kappa ^ { \prime } ( t ) ( 1 - t ^ { 2 } ) ^ { 1 + \frac { d - 3 } { 2 } } P _ { k } ^ { \prime } ( t ) d t \Big ) . } & { } \end{array}
|
| 418 |
+
$$
|
| 419 |
+
|
| 420 |
+
Integrating by parts once more, the second term becomes
|
| 421 |
+
|
| 422 |
+
$$
|
| 423 |
+
\begin{array} { r l r } { { \int _ { - 1 } ^ { 1 } \kappa ^ { \prime } ( t ) ( 1 - t ^ { 2 } ) ^ { 1 + \frac { d - 3 } { 2 } } P _ { k } ^ { \prime } ( t ) d t = \kappa ^ { \prime } ( t ) ( 1 - t ^ { 2 } ) ^ { 1 + \frac { d - 3 } { 2 } } P _ { k } ( t ) \Big | _ { - 1 } ^ { 1 } } } \\ & { } & { \qquad - \int _ { - 1 } ^ { 1 } ( \kappa ^ { \prime \prime } ( t ) ( 1 - t ^ { 2 } ) - ( d - 1 ) t \kappa ^ { \prime } ( t ) ) P _ { k } ( t ) ( 1 - t ^ { 2 } ) ^ { ( d - 3 ) / 2 } d t . ~ } \end{array}
|
| 424 |
+
$$
|
| 425 |
+
|
| 426 |
+
The desired result follows.
|
| 427 |
+
|
| 428 |
+
Lemma 5 (Weak upper bound on the decay). Let $\kappa : [ - 1 , 1 ] \to \mathbb { R }$ be a function that is $C ^ { \infty }$ on $( - 1 , 1 )$ and has the following expansions around $\pm 1$ on its derivatives:
|
| 429 |
+
|
| 430 |
+
$$
|
| 431 |
+
\begin{array} { l } { { \kappa ^ { ( j ) } ( t ) = p _ { j , 1 } ( 1 - t ) + O ( ( 1 - t ) ^ { \nu - j } ) } } \\ { { \kappa ^ { ( j ) } ( t ) = p _ { j , - 1 } ( 1 + t ) + O ( ( 1 + t ) ^ { \nu - j } ) , } } \end{array}
|
| 432 |
+
$$
|
| 433 |
+
|
| 434 |
+
for $t \in [ - 1 , 1 ]$ and $j \geq 0$ , where $p _ { j , 1 } , p _ { j , - 1 }$ are polynomials and $\nu$ may be non-integer. Then the Legendre coefficients $\mu _ { k } ( \kappa )$ of $\kappa$ given in (8) satisfy
|
| 435 |
+
|
| 436 |
+
$$
|
| 437 |
+
\mu _ { k } ( \kappa ) = O ( k ^ { - d - 2 \nu + 3 } ) .
|
| 438 |
+
$$
|
| 439 |
+
|
| 440 |
+
Proof. Let $f _ { 0 } : = \kappa$ and for $j \geq 1$
|
| 441 |
+
|
| 442 |
+
$$
|
| 443 |
+
f _ { j } ( t ) : = - f _ { j - 1 } ^ { \prime \prime } ( t ) ( 1 - t ^ { 2 } ) + ( d - 1 ) f _ { j - 1 } ^ { \prime } ( t ) .
|
| 444 |
+
$$
|
| 445 |
+
|
| 446 |
+
Then $f _ { j }$ is $C ^ { \infty }$ on $( - 1 , 1 )$ and has similar expansions to $\kappa$ of the form
|
| 447 |
+
|
| 448 |
+
$$
|
| 449 |
+
\begin{array} { l } { { f _ { j } ( t ) = q _ { j , 1 } ( 1 - t ) + O ( ( 1 - t ) ^ { \nu - j } ) } } \\ { { f _ { j } ( t ) = q _ { j , - 1 } ( 1 + t ) + O ( ( 1 + t ) ^ { \nu - j } ) , } } \end{array}
|
| 450 |
+
$$
|
| 451 |
+
|
| 452 |
+
brackets vanish, until for some polynomials $q _ { j , \pm 1 }$ . We may apply Lemma 4 repeatedly as long as the terms in btain, for $\begin{array} { r } { j = \lceil \nu + \frac { d - 3 } { 2 } \rceil - 1 } \end{array}$ ,
|
| 453 |
+
|
| 454 |
+
$$
|
| 455 |
+
\begin{array} { l } { \displaystyle \int _ { - 1 } ^ { 1 } \kappa ( t ) P _ { k } ( t ) ( 1 - t ^ { 2 } ) ^ { ( d - 3 ) / 2 } d t } \\ { = \displaystyle \frac { 1 } { ( k ( k + d - 2 ) ) ^ { j + 1 } } \left( f _ { j } ^ { \prime } ( t ) ( 1 - t ^ { 2 } ) ^ { 1 + \frac { d - 3 } { 2 } } P _ { k } ( t ) \Big | _ { - 1 } ^ { 1 } + \displaystyle \int _ { - 1 } ^ { 1 } f _ { j + 1 } ( t ) P _ { k } ( t ) ( 1 - t ^ { 2 } ) ^ { ( d - 3 ) / 2 } d t \right) } \end{array}
|
| 456 |
+
$$
|
| 457 |
+
|
| 458 |
+
Given our choice for $j$ , we have $f _ { j } ^ { \prime } ( t ) ( 1 - t ^ { 2 } ) ^ { 1 + \frac { d - 3 } { 2 } } = O ( 1 )$ , and $f _ { j + 1 } ( t ) ( 1 - t ^ { 2 } ) ^ { ( d - 3 ) / 2 } =$ $O ( ( 1 - t ^ { 2 } ) ^ { - 1 + \epsilon } )$ for some $\epsilon > 0$ . Since $P _ { k } ( t ) \in [ - 1 , 1 ]$ for any $t \ \in \ [ - 1 , 1 ]$ , we obtain $\mu _ { k } ( \kappa ) = O ( k ^ { - 2 ( j + 1 ) } ) = O ( k ^ { - d - 2 \nu + 3 } )$ . □
|
| 459 |
+
|
| 460 |
+
Precise decay for simple function. We now provide precise decay estimates for functions of the form $t \mapsto ( 1 - t ^ { 2 } ) ^ { \nu }$ and $t \mapsto t ( 1 - t ^ { 2 } ) ^ { \nu }$ , which will lead to the dominant terms in the decomposition of $\kappa$ in the main theorem.
|
| 461 |
+
|
| 462 |
+
Lemma 6 (Decay for simple functions $\phi _ { \nu }$ and $\phi _ { \nu }$ ). Let $\phi _ { \nu } ( t ) = ( 1 - t ^ { 2 } ) ^ { \nu }$ , with $\nu > 0$ noninteger, and let $\mu _ { k } ( \phi _ { \nu } )$ denote its Legendre coefficients in $d$ dimensions given by $\begin{array} { r } { \frac { \omega _ { d - 2 } } { \omega _ { d - 1 } } \int _ { - 1 } ^ { 1 } ( 1 - } \end{array}$ $t ^ { 2 } ) ^ { \nu + ( d - 3 ) / 2 } P _ { k } ( t ) d t$ . We have
|
| 463 |
+
|
| 464 |
+
Analogously, let ${ \bar { \phi } } _ { \nu } ( t ) : = t ( 1 - t ^ { 2 } ) ^ { \nu }$ . We have
|
| 465 |
+
|
| 466 |
+
Proof. We recall the following representation of Legendre polynomials based on the hypergeometric function (e.g., Ismail, 2005, Section 4.5):5
|
| 467 |
+
|
| 468 |
+
$$
|
| 469 |
+
P _ { k } ( t ) = { } _ { 2 } F _ { 1 } ( - k , k + d - 2 ; ( d - 1 ) / 2 ; ( 1 - t ) / 2 ) ,
|
| 470 |
+
$$
|
| 471 |
+
|
| 472 |
+
where the hypergeometric function is given in its generalized form by
|
| 473 |
+
|
| 474 |
+
$$
|
| 475 |
+
_ p F _ { q } ( a _ { 1 } , \dots , a _ { p } ; b _ { 1 } , \dots , b _ { q } ; x ) = \sum _ { s = 0 } ^ { \infty } { \frac { ( a _ { 1 } ) _ { s } \cdot \cdot \cdot ( a _ { p } ) _ { s } } { ( b _ { 1 } ) _ { s } \cdot \cdot \cdot ( b _ { q } ) _ { s } } } { \frac { x ^ { s } } { s ! } } ,
|
| 476 |
+
$$
|
| 477 |
+
|
| 478 |
+
where $( a ) _ { s } = \Gamma ( a + s ) / \Gamma ( a )$ is the rising factorial or Pochhammer symbol.
|
| 479 |
+
|
| 480 |
+
Using the above definitions and the integral representation of Beta functions, we then have
|
| 481 |
+
|
| 482 |
+
$$
|
| 483 |
+
\begin{array} { r l } { \int _ { - 1 } ^ { 1 } \left( 1 - i ^ { 2 } \right) ^ { n + \frac { \omega ^ { 2 } } { 2 } } P _ { k } ( \psi ) d u = 2 ^ { 2 n + \frac { \omega } { 2 } } \int _ { - 1 } ^ { 1 } \Bigg ( \displaystyle \frac { 1 - i } { 2 } \Bigg ) ^ { n + \frac { \omega } { 2 } } \left( \displaystyle \frac { 1 + i ^ { n } } { 2 } \right) ^ { n + \frac { \omega } { 2 } - 1 } P _ { k } ( \psi ) d u } \\ { = 2 ^ { 2 n + 1 } \ a ^ { 3 } \displaystyle \sum _ { s = 0 } ^ { k } \displaystyle \frac { \left( - i - k \right) \left( i ^ { 2 } - 2 k \right) } { \left( \frac { \omega ^ { 2 } } { 2 } \right) _ { s } , u ^ { 3 } } \int _ { - 1 } ^ { 1 } \left( \displaystyle \frac { 1 - i } { 2 } \right) ^ { s + \frac { \omega } { 2 } + \frac { \omega } { 2 } } \left( \displaystyle \frac { 1 + i } { 2 } \right) ^ { n + \frac { \omega } { 2 } } } \\ { = 2 ^ { 2 n + \frac { \omega } { 2 } } \displaystyle \sum _ { s = 0 } ^ { k } \left( \displaystyle \frac { \left( - k \right) \left( i - 2 + k \right) k } { 2 } \right) _ { s } \int _ { 0 } ^ { 1 } \left( 1 - w \right) ^ { n + \frac { \omega } { 2 } + \frac { \omega } { 2 } } u ^ { \frac { n + \omega } { 2 } } } \\ { = 2 ^ { 2 n + \frac { \omega } { 2 } } \displaystyle \sum _ { s = 0 } ^ { k } \left( \displaystyle \frac { i - k \left( i - 2 + k \right) k } { \left( \frac { \omega } { 2 } \right) _ { s } , u ^ { 3 } } \int _ { 0 } ^ { 1 } \left( 1 - w \right) ^ { n + \frac { \omega } { 2 } } u ^ { \frac { n + \frac { \omega - 1 } { 2 } } } \right) \left( i ^ { \frac { \omega } { 2 } } + i ^ { \frac { \omega - 1 } { 2 } } \right) } \\ =\right) 2 ^ { 2 n + \frac { \omega - 1 } { 2 } } \displaystyle \sum _ { s = 0 } ^ { k } \frac { \left( i - k \right) \left( i ^ { 2 } - 2 k \right) n ! } { \left( i - 2 \right) _ { s } , u ^ { 3 } } \\ = 2 ^ { 2 n + \frac { \omega } { 2 } - 1 } \displaystyle \sum _ { s = 0 } ^ { k } \frac \left( i \end{array}
|
| 484 |
+
$$
|
| 485 |
+
|
| 486 |
+
Now, we use Watson’s theorem (e.g., Ismail, 2005, Eq. (1.4.12)), which states that
|
| 487 |
+
|
| 488 |
+
$$
|
| 489 |
+
{ _ 3 F _ { 2 } } \left( { _ { ( a + b + 1 ) / 2 , 2 c } } \Big | 1 \right) = \frac { \Gamma ( \frac { 1 } { 2 } ) \Gamma ( c + \frac { 1 } { 2 } ) \Gamma ( \frac { a + b + 1 } { 2 } ) \Gamma ( c + \frac { 1 - a - b } { 2 } ) } { \Gamma ( \frac { a + 1 } { 2 } ) \Gamma ( \frac { b + 1 } { 2 } ) \Gamma ( c + \frac { 1 - a } { 2 } ) } .
|
| 490 |
+
$$
|
| 491 |
+
|
| 492 |
+
We remark that with $a = - k , b = k + d - 2 , c = \nu + ( d - 1 ) / 2$ , our expression above is of the form of Watson’s theorem, and we may thus evaluate $\mu _ { k }$ in closed form. Indeed, we have
|
| 493 |
+
|
| 494 |
+
$$
|
| 495 |
+
{ _ 3 F _ { 2 } } \left( \begin{array} { c } { { - k , k + d - 2 , \nu + ( d - 1 ) / 2 } } \\ { { ( d - 1 ) / 2 , 2 \nu + d - 1 } } \end{array} \biggr | 1 \right) = \frac { \Gamma ( \frac { 1 } { 2 } ) \Gamma ( \nu + \frac { d } { 2 } ) \Gamma ( \frac { d - 1 } { 2 } ) \Gamma ( \nu + 1 ) } { \Gamma ( \frac { 1 - k } { 2 } ) \Gamma ( \frac { d + k - 1 } { 2 } ) \Gamma ( \nu + \frac { k } { 2 } + \frac { d } { 2 } ) \Gamma ( \nu + 1 - \frac { k } { 2 } ) } .
|
| 496 |
+
$$
|
| 497 |
+
|
| 498 |
+
When $k$ is odd, then $( 1 - k ) / 2$ is a non-positive integer so that the denominator is infinite and thus $\mu _ { k }$ vanishes. We assume from now on that $k$ is even, making the denominator is finite. Using the following relation, for $\epsilon \not \in \mathbb { Z }$ and an integer $n$ :
|
| 499 |
+
|
| 500 |
+
$$
|
| 501 |
+
{ \frac { \Gamma ( 1 + \epsilon ) } { \Gamma ( \epsilon - n ) } } = \epsilon ( \epsilon - 1 ) \cdot \cdot \cdot ( \epsilon - n ) = ( - 1 ) ^ { n - 1 } { \frac { \Gamma ( n + 1 - \epsilon ) } { \Gamma ( - \epsilon ) } } ,
|
| 502 |
+
$$
|
| 503 |
+
|
| 504 |
+
we may then rewrite
|
| 505 |
+
|
| 506 |
+
$$
|
| 507 |
+
{ } _ { 3 } F _ { 2 } \left( { - k , k + d - 2 , \nu + ( d - 1 ) / 2 } \Big | 1 \right) = \frac { \Gamma ( \nu + \frac { d } { 2 } ) \Gamma ( \frac { d - 1 } { 2 } ) \Gamma ( \nu + 1 ) } { \Gamma ( - \frac { 1 } { 2 } ) \Gamma ( \nu + 2 ) \Gamma ( - \nu - 1 ) } \frac { \Gamma ( \frac { k + 1 } { 2 } ) \Gamma ( \frac { k } { 2 } - \nu ) } { \Gamma ( \frac { d + k - 1 } { 2 } ) \Gamma ( \nu + \frac { k } { 2 } + \frac { d } { 2 } ) } \cdot
|
| 508 |
+
$$
|
| 509 |
+
|
| 510 |
+
When $k \infty$ , Stirling’s formula $\Gamma ( x ) \sim x ^ { x - { \frac { 1 } { 2 } } } e ^ { - x } \sqrt { 2 \pi }$ yields the equivalent
|
| 511 |
+
|
| 512 |
+
$$
|
| 513 |
+
\frac { \Gamma ( \frac { k + 1 } { 2 } ) \Gamma ( \frac { k } { 2 } - \nu ) } { \Gamma ( \frac { d + k - 1 } { 2 } ) \Gamma ( \nu + \frac { k } { 2 } + \frac { d } { 2 } ) } \sim \left( \frac { k } { 2 } \right) ^ { - d - 2 \nu + 1 } .
|
| 514 |
+
$$
|
| 515 |
+
|
| 516 |
+
This yields
|
| 517 |
+
|
| 518 |
+
$$
|
| 519 |
+
\mu _ { k } \sim C ( d , \nu ) k ^ { - d - 2 \nu + 1 } ,
|
| 520 |
+
$$
|
| 521 |
+
|
| 522 |
+
with
|
| 523 |
+
|
| 524 |
+
$$
|
| 525 |
+
C ( d , \nu ) = 2 ^ { 2 \nu + d - 2 } \frac { \omega _ { d - 2 } } { \omega _ { d - 1 } } \frac { \Gamma ( \nu + \frac { d - 1 } { 2 } ) ^ { 2 } } { \Gamma ( 2 \nu + d - 1 ) } \frac { \Gamma ( \nu + \frac { d } { 2 } ) \Gamma ( \frac { d - 1 } { 2 } ) \Gamma ( \nu + 1 ) } { \Gamma ( - \frac { 1 } { 2 } ) \Gamma ( \nu + 2 ) \Gamma ( - \nu - 1 ) } ( 1 / 2 ) ^ { - d - 2 \nu + 1 } .
|
| 526 |
+
$$
|
| 527 |
+
|
| 528 |
+
Decay for $\phi _ { \nu }$ . The decay for $\phi _ { \nu }$ follows from the decay of $\phi _ { \nu }$ and the recurrence relation (Efthimiou $\&$ Frye, 2014, Eq. (4.36))
|
| 529 |
+
|
| 530 |
+
$$
|
| 531 |
+
t P _ { k } ( t ) = \frac { k } { 2 k + d - 2 } P _ { k - 1 } ( t ) + \frac { k + d - 2 } { 2 k + d - 2 } P _ { k + 1 } ( t ) ,
|
| 532 |
+
$$
|
| 533 |
+
|
| 534 |
+
which ensures the same decay with a change parity.
|
| 535 |
+
|
| 536 |
+
Final theorem. We are now ready to prove our main theorem, which differs from the simplified statement of Theorem 1 by the technical assumption that only a finite number $r$ of terms of order between $\nu$ and $\nu + 1$ are present in the series expansions around $\pm 1$ .
|
| 537 |
+
|
| 538 |
+
Theorem 7 (Main theorem, full version). Let $\kappa : [ - 1 , 1 ] \to \mathbb { R }$ be a function that is $C ^ { \infty }$ on $( - 1 , 1 )$ and has the following expansions around $\pm 1$ :
|
| 539 |
+
|
| 540 |
+
$$
|
| 541 |
+
\begin{array} { l } { \kappa ( t ) = p _ { 1 } ( 1 - t ) + \displaystyle \sum _ { j = 1 } ^ { r } c _ { j , 1 } ( 1 - t ) ^ { \nu _ { j } } + O ( ( 1 - t ) ^ { \nu _ { 1 } + 1 + \epsilon } ) } \\ { \kappa ( t ) = p _ { - 1 } ( 1 + t ) + \displaystyle \sum _ { j = 1 } ^ { r } c _ { j , - 1 } ( 1 + t ) ^ { \nu _ { j } } + O ( ( 1 + t ) ^ { \nu _ { 1 } + 1 + \epsilon } ) , } \end{array}
|
| 542 |
+
$$
|
| 543 |
+
|
| 544 |
+
for $t \in [ - 1 , 1 ]$ , where $p _ { 1 } , p _ { - 1 }$ are polynomials and $0 < \nu _ { 1 } < . . . < \nu _ { r }$ are not integers and $0 < \epsilon < \nu _ { 2 } - \nu _ { 1 }$ . We also assume that the derivatives $\kappa ^ { ( s ) }$ of $\kappa$ have the following expansions:
|
| 545 |
+
|
| 546 |
+
$$
|
| 547 |
+
\begin{array} { l } { { \kappa ^ { ( s ) } ( t ) = p _ { s , 1 } ( 1 - t ) + ( - 1 ) ^ { s } \displaystyle \sum _ { j = 1 } ^ { r } c _ { j , 1 } \displaystyle \frac { \Gamma ( \nu _ { j } + 1 ) } { \Gamma ( \nu _ { j } + 1 - s ) } ( 1 - t ) ^ { \nu _ { j } - s } + { \cal O } ( ( 1 - t ) ^ { \nu _ { 1 } + 1 + \epsilon - s } ) } } \\ { { \kappa ^ { ( s ) } ( t ) = p _ { s , - 1 } ( 1 + t ) + \displaystyle \sum _ { j = 1 } ^ { r } c _ { j , - 1 } \displaystyle \frac { \Gamma ( \nu _ { j } + 1 ) } { \Gamma ( \nu _ { j } + 1 - s ) } ( 1 + t ) ^ { \nu _ { j } - s } + { \cal O } ( ( 1 + t ) ^ { \nu _ { 1 } + 1 + \epsilon - s } ) , } } \end{array}
|
| 548 |
+
$$
|
| 549 |
+
|
| 550 |
+
for some polynomials $p _ { s , \pm 1 }$ . Then we have, for an absolute constant $C ( d , \nu _ { 1 } )$ depending only on $d$ and $\nu _ { 1 }$ ,
|
| 551 |
+
|
| 552 |
+
Proof. Define the functions
|
| 553 |
+
|
| 554 |
+
$$
|
| 555 |
+
\begin{array} { l } { { \displaystyle \psi _ { j } ( t ) = c _ { j , 1 } \frac { \phi _ { \nu _ { j } } ( t ) + \bar { \phi } _ { \nu _ { j } } ( t ) } { 2 ^ { \nu _ { j } + 1 } } + c _ { j , - 1 } \frac { \phi _ { \nu _ { j } } ( t ) - \bar { \phi } _ { \nu _ { j } } ( t ) } { 2 ^ { \nu _ { j } + 1 } } } } \\ { { \displaystyle \quad = \frac { c _ { j , 1 } + c _ { j , - 1 } } { 2 ^ { \nu _ { j } + 1 } } \phi _ { \nu _ { j } } ( t ) + \frac { c _ { j , 1 } - c _ { j , - 1 } } { 2 ^ { \nu _ { j } + 1 } } \bar { \phi } _ { \nu _ { j } } ( t ) , } } \end{array}
|
| 556 |
+
$$
|
| 557 |
+
|
| 558 |
+
for $j = 1 , \dots , r$ , where $\phi _ { \nu } , \phi _ { \nu }$ are defined in Lemma 6. We have the asymptotic expansions:6
|
| 559 |
+
|
| 560 |
+
$$
|
| 561 |
+
\begin{array} { l } { \psi _ { 1 } ( t ) = c _ { 1 , 1 } ( 1 - t ) ^ { \nu _ { 1 } } - \displaystyle \frac { ( 1 + \nu _ { 1 } ) c _ { 1 , 1 } + c _ { 1 , - 1 } } { 2 } ( 1 - t ) ^ { \nu _ { 1 } + 1 } + O ( ( 1 - t ) ^ { \nu _ { 1 } + 1 + \epsilon } ) } \\ { \psi _ { 1 } ( t ) = c _ { 1 , - 1 } ( 1 + t ) ^ { \nu _ { 1 } } + \displaystyle \frac { c _ { 1 , 1 } - ( 1 + \nu ) c _ { 1 , - 1 } } { 2 } ( 1 + t ) ^ { \nu _ { 1 } + 1 } + O ( ( 1 + t ) ^ { \nu _ { 1 } + 1 + \epsilon } ) , } \end{array}
|
| 562 |
+
$$
|
| 563 |
+
|
| 564 |
+
and for $j \geq 2$ ,
|
| 565 |
+
|
| 566 |
+
$$
|
| 567 |
+
\begin{array} { l } { { \psi _ { j } ( t ) = c _ { j , 1 } ( 1 - t ) ^ { \nu _ { j } } + O ( ( 1 - t ) ^ { \nu _ { 1 } + 1 + \epsilon } ) } } \\ { { \psi _ { j } ( t ) = c _ { j , - 1 } ( 1 + t ) ^ { \nu _ { j } } + O ( ( 1 + t ) ^ { \nu _ { 1 } + 1 + \epsilon } ) . } } \end{array}
|
| 568 |
+
$$
|
| 569 |
+
|
| 570 |
+
Define additionally $\psi _ { r + 1 }$ the same way as the other $\psi _ { j }$ , with $\nu _ { r + 1 } = \nu _ { 1 } + 1$ , $c _ { r + 1 , 1 } =$ $( ( 1 + \nu _ { 1 } ) c _ { 1 , 1 } + c _ { 1 , - 1 } ) / 2$ , and $c _ { r + 1 , - 1 } = - ( c _ { 1 , 1 } - ( 1 + \nu ) c _ { 1 , - 1 } ) / 2$ , which satisfies a similar asymptotic expansion as the above ones for $j \geq 2$ . One can check that the derivatives $\psi _ { j }$ expanded w, we have for e derivatives of the expansions above. Then, defining, $\begin{array} { r } { \tilde { \kappa } = \kappa - \sum _ { j = 1 } ^ { r + 1 } \psi _ { j } } \end{array}$ $s \geq 0$
|
| 571 |
+
|
| 572 |
+
$$
|
| 573 |
+
\begin{array} { l } { { \tilde { \kappa } ^ { ( s ) } ( t ) = p _ { s , 1 } ( 1 - t ) + O ( ( 1 - t ) ^ { \nu _ { 1 } + 1 + \epsilon - s } ) } } \\ { { \tilde { \kappa } ^ { ( s ) } ( t ) = p _ { s , - 1 } ( 1 + t ) + O ( ( 1 + t ) ^ { \nu _ { 1 } + 1 + \epsilon - s } ) . } } \end{array}
|
| 574 |
+
$$
|
| 575 |
+
|
| 576 |
+
The functions $\psi _ { j }$ satisfy
|
| 577 |
+
|
| 578 |
+
$$
|
| 579 |
+
\mu _ { k } ( \psi _ { j } ) = \left\{ \begin{array} { l l } { \frac { c _ { j , 1 } + c _ { j , - 1 } } { 2 ^ { \nu _ { j } + 1 } } \mu _ { k } ( \phi _ { \nu _ { j } } ) , } & { \mathrm { ~ i f ~ } k \mathrm { ~ e v e n } , } \\ { \frac { c _ { j , 1 } - c _ { j , - 1 } } { 2 ^ { \nu _ { j } + 1 } } \mu _ { k } ( \bar { \phi } _ { \nu _ { j } } ) , } & { \mathrm { ~ i f ~ } k \mathrm { ~ o d d } . } \end{array} \right.
|
| 580 |
+
$$
|
| 581 |
+
|
| 582 |
+
By Lemma 5, we have
|
| 583 |
+
|
| 584 |
+
$$
|
| 585 |
+
\begin{array} { l } { \displaystyle \mu _ { k } ( \kappa ) = \mu _ { k } ( \tilde { \kappa } ) + \sum _ { j = 1 } ^ { r } \mu _ { k } ( \psi _ { j } ) } \\ { \displaystyle = \sum _ { j = 1 } ^ { r } \mu _ { k } ( \psi _ { j } ) + O ( k ^ { - d - 2 ( \nu _ { 1 } + 1 + \epsilon ) + 3 } ) } \\ { \displaystyle = \sum _ { j = 1 } ^ { r } \mu _ { k } ( \psi _ { j } ) + o ( k ^ { - d - 2 \nu _ { 1 } + 1 } ) . } \end{array}
|
| 586 |
+
$$
|
| 587 |
+
|
| 588 |
+
The result then follows from Lemma 6, with a constant $C ( d , \nu _ { 1 } ) / 2 ^ { \nu _ { 1 } + 1 }$ , where $C ( d , \nu _ { 1 } )$ is given by the proof of Lemma 6. $\boxed { \begin{array} { r l } \end{array} }$
|
| 589 |
+
|
| 590 |
+
# B.1 Dimension-free description
|
| 591 |
+
|
| 592 |
+
While our above description of the RKHS depends on the dimension $d$ , in some cases a dimension-free description given by Taylor coefficients of the kernel $\kappa$ at 0 may be useful, for instance for the study of kernel methods in certain high-dimensional regimes (e.g., El Karoui, 2010; Ghorbani et al., 2019; Liang et al., 2020). Here we remark that such coefficients and their decay may be recovered from the Legendre coefficients in $d$ dimensions, by taking highdimensional limits $d \to \infty$ . We illustrate this on the functions $\phi _ { \nu } ( t ) = ( 1 - t ^ { 2 } ) ^ { \nu }$ , for which Lemma 6 provides precise estimates of the Legendre coefficients $\mu _ { k , d } ( \phi _ { \nu } )$ in $d$ dimensions (this only serves as an instructive illustration, since in this case Taylor coefficients may be computed directly through a power series expansion of $\phi _ { \nu }$ using the Binomial formula).
|
| 593 |
+
|
| 594 |
+
Lemma 8 (Recovering Taylor coefficients of $\phi _ { \nu }$ through high-dimensional limits). Let $\begin{array} { r } { b _ { k } ( \phi _ { \nu } ) : = \frac { \phi _ { \nu } ^ { ( k ) } } { k ! } } \end{array}$ for some non-integer $\nu > 0$ . For $k$ even, we have
|
| 595 |
+
|
| 596 |
+
$$
|
| 597 |
+
b _ { k } ( \phi _ { \nu } ) = C _ { \nu } 2 ^ { k } \frac { \Gamma ( \frac { k + 1 } { 2 } ) \Gamma ( \frac { k } { 2 } - \nu ) } { \Gamma ( k + 1 ) } ,
|
| 598 |
+
$$
|
| 599 |
+
|
| 600 |
+
for a constant $C _ { \nu }$ depending only on $\nu$ . This leads to an equivalent $b _ { k } \sim C _ { \nu } ^ { \prime } k ^ { - \nu - 1 }$ for $k \infty$ with $k$ even.
|
| 601 |
+
|
| 602 |
+
Proof. Assume throughout that $k$ is even. Recall the expression of the Legendre coefficients $\mu _ { k , d } ( \phi _ { \nu } )$ of $\phi _ { \nu }$ in $d$ dimensions (we include $d$ as a subscript for more clarity here) from the proof of Lemma 6:
|
| 603 |
+
|
| 604 |
+
$$
|
| 605 |
+
\begin{array} { l } { \displaystyle \mu _ { k , d } ( \phi _ { \nu } ) = \frac { \omega _ { d - 2 } } { \omega _ { d - 1 } } \int _ { - 1 } ^ { 1 } \kappa ( t ) P _ { k , d } ( t ) ( 1 - t ^ { 2 } ) ^ { \frac { d - 3 } { 2 } } d t } { ( 5 \xi + \frac { d - 1 } { 2 } ) ^ { \lambda } } \\ { = \displaystyle 2 ^ { 2 \nu + d - 2 } \frac { \omega _ { d - 2 } } { \omega _ { d - 1 } } \frac { \Gamma ( \nu + \frac { d - 1 } { 2 } ) ^ { 2 } } { \Gamma ( 2 \nu + d - 1 ) } \frac { \Gamma ( \nu + \frac { d } { 2 } ) \Gamma ( \frac { d - 1 } { 2 } ) \Gamma ( \nu + 1 ) } { \Gamma ( - \frac { 1 } { 2 } ) \Gamma ( \nu + 2 ) \Gamma ( - \nu - 1 ) } \frac { \Gamma ( \frac { k + 1 } { 2 } ) \Gamma ( \frac { k } { 2 } - \nu ) } { \Gamma ( \frac { d + k - 1 } { 2 } ) \Gamma ( \nu + \frac { k } { 2 } + \frac { d } { 2 } ) } . } \end{array}
|
| 606 |
+
$$
|
| 607 |
+
|
| 608 |
+
Now, note that when $d$ is large enough compared to $k$ , we may use the Rodrigues formula (16) and integration by parts to obtain the following alternative expression:
|
| 609 |
+
|
| 610 |
+
$$
|
| 611 |
+
\mu _ { k , d } ( \phi _ { \nu } ) = 2 ^ { - k } \frac { \omega _ { d - 2 } } { \omega _ { d - 1 } } \frac { \Gamma ( \frac { d - 1 } { 2 } ) } { \Gamma ( k + \frac { d - 1 } { 2 } ) } \int _ { - 1 } ^ { 1 } \phi _ { \nu } ^ { ( k ) } ( t ) ( 1 - t ^ { 2 } ) ^ { k + \frac { d - 3 } { 2 } } d t
|
| 612 |
+
$$
|
| 613 |
+
|
| 614 |
+
Following similar arguments to Ghorbani et al. (2019), we may then use dominated convergence to show:
|
| 615 |
+
|
| 616 |
+
$$
|
| 617 |
+
\frac { \Gamma ( \frac { d } { 2 } ) } { \sqrt { \pi } \Gamma ( \frac { d - 1 } { 2 } ) } \int _ { - 1 } ^ { 1 } \phi _ { \nu } ^ { ( k ) } ( t ) ( 1 - t ^ { 2 } ) ^ { k + \frac { d - 3 } { 2 } } d t \phi _ { \nu } ^ { ( k ) } ( 0 ) \quad \mathrm { ~ a s ~ } d \infty .
|
| 618 |
+
$$
|
| 619 |
+
|
| 620 |
+
Indeed, $\frac { \Gamma ( \frac { d } { 2 } ) } { \sqrt { \pi } \Gamma ( \frac { d - 1 } { 2 } ) } ( 1 - t ^ { 2 } ) ^ { ( d - 3 ) / 2 }$ is a probability density that approaches a Dirac mass at $0$ when $d \to \infty$ . This yields
|
| 621 |
+
|
| 622 |
+
$$
|
| 623 |
+
b _ { k } ( \phi _ { \nu } ) = \frac { \phi _ { \nu } ^ { ( k ) } } { k ! } = \operatorname * { l i m } _ { d \to \infty } 2 ^ { k } \frac { \omega _ { d - 1 } } { \omega _ { d - 2 } } \frac { \Gamma ( \frac { d } { 2 } ) \Gamma ( k + \frac { d - 1 } { 2 } ) } { \sqrt { \pi } \Gamma ( \frac { d - 1 } { 2 } ) \Gamma ( \frac { d - 1 } { 2 } ) \Gamma ( k + 1 ) } \mu _ { k , d } ( \phi _ { \nu } ) .
|
| 624 |
+
$$
|
| 625 |
+
|
| 626 |
+
Plugging (59) and using Stirling’s formula to take limits $d \to \infty$ yields
|
| 627 |
+
|
| 628 |
+
$$
|
| 629 |
+
b _ { k } ( \phi _ { \nu } ) = C _ { \nu } 2 ^ { k } \frac { \Gamma ( \frac { k + 1 } { 2 } ) \Gamma ( \frac { k } { 2 } - \nu ) } { \Gamma ( k + 1 ) } ,
|
| 630 |
+
$$
|
| 631 |
+
|
| 632 |
+
lent where $b _ { k } ( \phi _ { \nu } ) \sim C _ { \nu } ^ { \prime } k ^ { - \nu - 1 }$ $C _ { \nu }$ only depends on for $\nu$ $k \infty$ . Using Stirling’s formula once again yields the desired equiva- , $k$ even, with a different constant $C _ { \nu } ^ { \prime }$ . □
|
| 633 |
+
|
| 634 |
+
We note that a similar asymptotic equivalent holds for $b _ { k } { \left( \phi _ { \nu } \right) }$ for $k$ odd. The next result leverages this to derive asymptotic decays of $b _ { k } ( \kappa )$ for any $\kappa$ of the form $\kappa ( u ) \ =$ $\textstyle \sum _ { k \geq 0 } b _ { k } ( \kappa ) u ^ { k }$ satisfying similar conditions as in Theorem 7.
|
| 635 |
+
|
| 636 |
+
Corollary 9 (Taylor coefficients of $\kappa$ ). Let $\kappa : [ - 1 , 1 ] \to \mathbb { R }$ be a function admitting a power series expansion $\begin{array} { r } { \kappa ( u ) = \sum _ { k \geq 0 } b _ { k } u ^ { k } } \end{array}$ , with the following expansions around $\pm 1$ :
|
| 637 |
+
|
| 638 |
+
$$
|
| 639 |
+
\begin{array} { l } { \kappa ( t ) = p _ { 1 } ( 1 - t ) + \displaystyle \sum _ { j = 1 } ^ { r } c _ { j , 1 } ( 1 - t ) ^ { \nu _ { j } } + O ( ( 1 - t ) ^ { \lceil \nu _ { 1 } \rceil + 1 } ) } \\ { \kappa ( t ) = p _ { - 1 } ( 1 + t ) + \displaystyle \sum _ { j = 1 } ^ { r } c _ { j , - 1 } ( 1 + t ) ^ { \nu _ { j } } + O ( ( 1 + t ) ^ { \lceil \nu _ { 1 } \rceil + 1 } ) , } \end{array}
|
| 640 |
+
$$
|
| 641 |
+
|
| 642 |
+
for $t \in [ - 1 , 1 ]$ , where $p _ { 1 } , p _ { - 1 }$ are polynomials and $0 < \nu _ { 1 } < . . . < \nu _ { r }$ are not integers and $0 < \epsilon < \nu _ { 2 } - \nu _ { 1 }$ . Then we have, for an absolute constant $C ( \nu _ { 1 } )$ depending only on $\nu _ { 1 }$ ,
|
| 643 |
+
|
| 644 |
+
Proof. As in the proof of Theorem 7, we may construct a function $\begin{array} { r } { \psi = \sum _ { j } \alpha _ { j } \phi _ { \nu _ { j } } + \bar { \alpha } _ { j } \phi _ { \nu _ { j } } } \end{array}$ , with $\begin{array} { r } { \alpha _ { 1 } = \frac { c _ { 1 , 1 } + c _ { 1 , - 1 } } { 2 ^ { \nu _ { 1 } + 1 } } } \end{array}$ , $\begin{array} { r } { \bar { \alpha } _ { 1 } = \frac { c _ { 1 , 1 } - c _ { 1 , - 1 } } { 2 ^ { \nu _ { 1 } + 1 } } } \end{array}$ for $j = 1$ , the other terms being of higher orders $\nu _ { j } >$ $\nu _ { 1 }$ , such that $\tilde { \kappa } : = \kappa - \psi$ (which is also a power series with convergence radius $\geq 1$ ) satisfies
|
| 645 |
+
|
| 646 |
+
$$
|
| 647 |
+
\begin{array} { l } { { \tilde { \kappa } ( t ) = p _ { 1 } ( 1 - t ) + O ( ( 1 - t ) ^ { \lceil \nu _ { 1 } \rceil + 1 } ) } } \\ { { \tilde { \kappa } ( t ) = p _ { - 1 } ( 1 + t ) + O ( ( 1 + t ) ^ { \lceil \nu _ { 1 } \rceil + 1 } ) , } } \end{array}
|
| 648 |
+
$$
|
| 649 |
+
|
| 650 |
+
It follows that $\tilde { \kappa } ^ { ( \lceil \nu _ { 1 } \rceil + 1 ) } ( 1 )$ is bounded, so that the Taylor coefficients of $\tilde { \kappa }$ , denoted $b _ { k } ( \tilde { \kappa } )$ , satisfy
|
| 651 |
+
|
| 652 |
+
$$
|
| 653 |
+
b _ { k } ( \tilde { \kappa } ) = o ( k ^ { - \lceil \nu _ { 1 } \rceil - 1 } ) = o ( k ^ { - \nu _ { 1 } - 1 } ) .
|
| 654 |
+
$$
|
| 655 |
+
|
| 656 |
+
The result then follows from Lemma 8 by using the decays of $b _ { k } { \left( \phi _ { \nu } \right) }$ and $b _ { k } { \left( \phi _ { \nu } \right) }$ .
|
| 657 |
+
|
| 658 |
+
# C Other Proofs
|
| 659 |
+
|
| 660 |
+
In this section, we provide the proofs for results in Section 3.3 related to obtaining power series expansions (with generalized exponents) of kernels arising from deep networks, which leads to the corresponding decays by Theorem 1. We note that for the kernels considered in this section, we can differentiate the expansions since the kernel function is $\Delta$ -analytic (see Chen & Xu, 2021, Theorem 7), so that the technical assumption in Theorem 1 is verified.
|
| 661 |
+
|
| 662 |
+
# C.1 Proof of Corollary 2
|
| 663 |
+
|
| 664 |
+
Proof. Let $\kappa ^ { \ell } : = \kappa _ { 1 } \circ \cdot \cdot \cdot \circ \kappa _ { 1 _ { . } } = \kappa _ { \mathrm { R F } } ^ { \ell }$ . We have $\ell - 1$ {z times
|
| 665 |
+
|
| 666 |
+
$$
|
| 667 |
+
\kappa _ { 1 } ( 1 - t ) = 1 - t + c t ^ { 3 / 2 } + o ( t ^ { 3 / 2 } ) , \quad c : = \frac { 2 \sqrt { 2 } } { 3 \pi } .
|
| 668 |
+
$$
|
| 669 |
+
|
| 670 |
+
We now show by induction that $\kappa _ { , } ^ { \ell } ( 1 - t ) = 1 - t + a _ { \ell } t ^ { 3 / 2 } + o ( t ^ { 3 / 2 } )$ , with $a _ { \ell } = ( \ell - 1 ) c$ . This is obviously true for $\ell = 2$ since $\kappa ^ { \ell } = \kappa _ { 1 }$ , and for $\ell \geq 3$ we have
|
| 671 |
+
|
| 672 |
+
$$
|
| 673 |
+
\begin{array} { r l } & { \kappa ^ { \ell } ( 1 - t ) = \kappa _ { 1 } ( \kappa ^ { \ell - 1 } ( 1 - t ) ) } \\ & { \qquad = \kappa _ { 1 } ( 1 - t + a _ { \ell - 1 } t ^ { 3 / 2 } + o ( t ^ { 3 / 2 } ) ) } \\ & { \qquad = 1 - ( t - a _ { \ell - 1 } t ^ { 3 / 2 } + o ( t ^ { 3 / 2 } ) ) + c ( t + O ( t ^ { 3 / 2 } ) ) ^ { 3 / 2 } + o ( O ( t ) ^ { 3 / 2 } ) } \\ & { \qquad = 1 - t + a _ { \ell - 1 } t ^ { 3 / 2 } + c t ^ { 3 / 2 } ( 1 + O ( t ^ { 1 / 2 } ) ) ^ { 3 / 2 } + o ( t ^ { 3 / 2 } ) } \\ & { \qquad = 1 - t + a _ { \ell - 1 } t ^ { 3 / 2 } + c t ^ { 3 / 2 } ( 1 + O ( t ^ { 1 / 2 } ) ) + o ( t ^ { 3 / 2 } ) } \\ & { \qquad = 1 - t + a _ { \ell } t ^ { 3 / 2 } + o ( t ^ { 3 / 2 } ) , } \end{array}
|
| 674 |
+
$$
|
| 675 |
+
|
| 676 |
+
which proves the result.
|
| 677 |
+
|
| 678 |
+
Around $^ { - 1 }$ , we know that
|
| 679 |
+
|
| 680 |
+
$$
|
| 681 |
+
\kappa _ { 1 } ( - 1 + t ) = c t ^ { 3 / 2 } + o ( t ^ { 3 / 2 } ) .
|
| 682 |
+
$$
|
| 683 |
+
|
| 684 |
+
We then have $\kappa ^ { \ell } ( - 1 + t ) = b _ { \ell } + c _ { \ell } t ^ { 3 / 2 } + o ( t ^ { 3 / 2 } )$ , with $0 \leq b _ { \ell } < 1$ and $0 < c _ { \ell } \le c$ (and the upper bound is strict for $\ell \geq 3$ ). Indeed, this is true for $\ell = 2$ , and for $\ell \geq 3$ we have,
|
| 685 |
+
|
| 686 |
+
for $t > 0$
|
| 687 |
+
|
| 688 |
+
$$
|
| 689 |
+
\begin{array} { r l } & { \kappa ^ { \ell } ( - 1 + t ) = \kappa _ { 1 } ( \kappa ^ { \ell - 1 } ( - 1 + t ) ) } \\ & { \qquad = \kappa _ { 1 } \bigl ( b _ { \ell - 1 } + c _ { \ell - 1 } t ^ { 3 / 2 } + o ( t ^ { 3 / 2 } ) \bigr ) } \\ & { \qquad = \kappa _ { 1 } \bigl ( b _ { \ell - 1 } ) + \kappa _ { 1 } ^ { \prime } ( b _ { \ell - 1 } ) c _ { \ell - 1 } t ^ { 3 / 2 } + o ( t ^ { 3 / 2 } ) . } \end{array}
|
| 690 |
+
$$
|
| 691 |
+
|
| 692 |
+
Now, note that $\kappa _ { 1 }$ and $\kappa _ { 1 } ^ { \prime }$ are both positive and strictly increasing on $[ 0 , 1 ]$ , with $\kappa _ { 1 } ( 1 ) =$ $\kappa _ { 1 } ^ { \prime } ( 1 ) = 1$ . Thus, we have $b _ { \ell } = \kappa _ { 1 } ( b _ { \ell - 1 } ) \in ( 0 , 1 )$ , and $c _ { \ell } = \kappa _ { 1 } ^ { \prime } ( a _ { \ell - 1 } ) c _ { \ell - 1 } < c _ { \ell - 1 }$ , thus completing the proof.
|
| 693 |
+
|
| 694 |
+
Since $c _ { \ell }$ is bounded while $a _ { \ell }$ grows linearly with $\ell$ , the constants in front of the asymptotic decay $k ^ { - d - 2 }$ grow linearly with $\ell$ .
|
| 695 |
+
|
| 696 |
+
# C.2 Proof of Corollary 3
|
| 697 |
+
|
| 698 |
+
Proof. We show by induction that $\kappa _ { \mathrm { N T K } } ^ { \ell }$ as defined in (7) satisfies
|
| 699 |
+
|
| 700 |
+
$$
|
| 701 |
+
\kappa _ { \mathrm { N T K } } ^ { \ell } ( 1 - t ) = \ell - \left( \sum _ { s = 1 } ^ { \ell - 1 } s \right) c t ^ { 1 / 2 } + o ( t ^ { 1 / 2 } ) , \qquad c : = \frac { \sqrt { 2 } } { \pi } .
|
| 702 |
+
$$
|
| 703 |
+
|
| 704 |
+
For $\ell = 2$ we have $\kappa _ { \mathrm { N T K } } ^ { \ell } ( u ) = u \kappa _ { 0 } ( u ) + \kappa _ { 1 } ( u )$ , so that
|
| 705 |
+
|
| 706 |
+
$$
|
| 707 |
+
\kappa _ { \mathrm { N T K } } ^ { 2 } ( 1 - t ) = ( 1 - t ) ( 1 - c t ^ { 1 / 2 } + o ( t ^ { 1 / 2 } ) ) + 1 + O ( t ) = 2 - c t ^ { 1 / 2 } + o ( t ^ { 1 / 2 } ) .
|
| 708 |
+
$$
|
| 709 |
+
|
| 710 |
+
By induction, for $\ell \geq 3$ , we have $\kappa _ { \mathrm { N T K } } ^ { \ell } ( u ) = \kappa _ { \mathrm { N T K } } ^ { \ell - 1 } ( u ) \kappa _ { 0 } ( \kappa ^ { \ell - 1 } ( u ) ) + \kappa ^ { \ell } ( u )$ , with $\kappa ^ { \ell }$ as in the proof of Corollary 2, which hence satisfies $\kappa ^ { \ell } ( 1 - t ) = 1 - t + o ( t )$ for all $\ell \geq 2$ . We then have
|
| 711 |
+
|
| 712 |
+
$$
|
| 713 |
+
\begin{array} { r l } & { \kappa _ { 0 } ( \kappa ^ { \ell - 1 } ( 1 - t ) ) = \kappa _ { 0 } ( 1 - t + o ( t ) ) } \\ & { \qquad = 1 - c ( t + o ( t ) ) ^ { 1 / 2 } + o ( t ^ { 1 / 2 } ) } \\ & { \qquad = 1 - c t ^ { 1 / 2 } ( 1 + o ( t ^ { 1 / 2 } ) ) + o ( t ^ { 1 / 2 } ) } \\ & { \qquad = 1 - c t ^ { 1 / 2 } + o ( t ^ { 1 / 2 } ) . } \end{array}
|
| 714 |
+
$$
|
| 715 |
+
|
| 716 |
+
This yields
|
| 717 |
+
|
| 718 |
+
$$
|
| 719 |
+
\begin{array} { l } { \kappa _ { \mathrm { N T K } } ^ { \ell } ( 1 - t ) = \displaystyle ( \ell - 1 - ( \overset { \ell - 2 } { \underset { s = 1 } { \sum } } s ) c t ^ { 1 / 2 } + o ( t ^ { 1 / 2 } ) ) ( 1 - c t ^ { 1 / 2 } + o ( t ^ { 1 / 2 } ) ) + 1 + O ( t ) } \\ { = \ell - ( \overset { \ell - 1 } { \underset { s = 1 } { \sum } } s ) c t ^ { 1 / 2 } + o ( t ^ { 1 / 2 } ) } \\ { = \ell - \frac { \ell ( \ell - 1 ) } { 2 } c t ^ { 1 / 2 } + o ( t ^ { 1 / 2 } ) , } \end{array}
|
| 720 |
+
$$
|
| 721 |
+
|
| 722 |
+
which proves the claim for the expansion around $+ 1$ .
|
| 723 |
+
|
| 724 |
+
Around -1, recall the expansion from the proof of Corollary 2, $\kappa ^ { \ell } ( - 1 + t ) = b _ { \ell } + O ( t ^ { 3 / 2 } )$ , with $0 \leq b _ { \ell } < 1$ . For $\ell = 2$ , we have
|
| 725 |
+
|
| 726 |
+
$$
|
| 727 |
+
\kappa _ { \mathrm { N T K } } ^ { 2 } ( - 1 + t ) = ( - 1 + t ) ( c t ^ { 1 / 2 } + o ( t ^ { 1 / 2 } ) ) + b _ { 2 } + o ( t ^ { 1 / 2 } ) = b _ { 2 } - c t ^ { 1 / 2 } + o ( t ^ { 1 / 2 } ) .
|
| 728 |
+
$$
|
| 729 |
+
|
| 730 |
+
Note also that for $\ell \geq 2$ ,
|
| 731 |
+
|
| 732 |
+
$$
|
| 733 |
+
\kappa _ { 0 } ( \kappa ^ { \ell } ( - 1 + t ) ) = \kappa _ { 0 } ( b _ { \ell } + O ( t ^ { 3 / 2 } ) ) = \kappa _ { 0 } ( b _ { \ell } ) + O ( t ^ { 3 / 2 } ) ,
|
| 734 |
+
$$
|
| 735 |
+
|
| 736 |
+
since $\kappa _ { 0 } ^ { \prime } ( b _ { \ell } )$ is finite for $b _ { \ell } < 1$ . We also have $\kappa _ { 0 } ( b _ { \ell } ) \in ( 0 , 1 )$ since $\kappa _ { 0 }$ is positive and strictly increasing on $[ 0 , 1 ]$ with $\kappa _ { 0 } ( 1 ) = 1$ . Then, by an easy induction, we obtain
|
| 737 |
+
|
| 738 |
+
$$
|
| 739 |
+
\kappa _ { \mathrm { N T K } } ^ { \ell } ( - 1 + t ) = a _ { \ell } - c _ { \ell } t ^ { 1 / 2 } + o ( t ^ { 1 / 2 } ) ,
|
| 740 |
+
$$
|
| 741 |
+
|
| 742 |
+
with $a _ { \ell } \leq \ell$ and $0 < c _ { \ell } < c$ .
|
| 743 |
+
|
| 744 |
+
Similar to the case of the RF kernel, the constant in front of $t ^ { 1 / 2 }$ grows with $\ell ^ { 2 }$ for the expansion around $+ 1$ but is bounded for the expansion around $^ { - 1 }$ , so that the final constants in front of the asymptotic decay $k ^ { - d }$ grow quadratically with $\ell$ . However, they grow linearly with $\ell$ when considering the NTK normalized by $\ell$ , $\tilde { \kappa } ^ { \ell } = \kappa _ { \mathrm { N T K } } ^ { \ell } / \ell$ , which then satisfies $\tilde { \kappa } ^ { \ell } ( 1 ) = 1$ .
|
| 745 |
+
|
| 746 |
+
# C.3 Deep networks with step activations
|
| 747 |
+
|
| 748 |
+
In this section, we study the decay of the random weight kernel arising from deep networks with step activations, as presented in Section 3.3. For an $L$ -layer network, this kernel is of the form $\kappa _ { s } ^ { L } : = \kappa _ { 0 } \circ \cdots \circ \kappa _ { 0 _ { \cdot } }$ .
|
| 749 |
+
|
| 750 |
+

|
| 751 |
+
|
| 752 |
+
Corollary 10. $\kappa _ { s } ^ { L }$ has a decay $k ^ { - d - 2 \nu _ { L } + 1 }$ with $\nu _ { L } = 1 / 2 ^ { L - 1 }$ for $L$ layers.
|
| 753 |
+
|
| 754 |
+
Proof. We show by induction that we have, for $\ell \geq 2$ ,
|
| 755 |
+
|
| 756 |
+
$$
|
| 757 |
+
\begin{array} { r } { \kappa _ { s } ^ { \ell } ( 1 - t ) = 1 - c ^ { \sum _ { j = 0 } ^ { \ell - 1 } 2 ^ { - j } } t ^ { 1 / 2 ^ { \ell - 1 } } + o ( t ^ { 1 / 2 ^ { \ell - 1 } } ) , } \end{array}
|
| 758 |
+
$$
|
| 759 |
+
|
| 760 |
+
with $\begin{array} { r } { c : = \frac { \sqrt { 2 } } { \pi } } \end{array}$ . This is true for $\ell = 2$ due to the expansion for $\kappa _ { 0 }$ . Now assume it holds for $\ell \geq 2$ . We have
|
| 761 |
+
|
| 762 |
+
$$
|
| 763 |
+
\begin{array} { r l } & { \kappa _ { s } ^ { \ell + 1 } ( 1 - t ) = \kappa _ { 0 } ( \kappa _ { s } ^ { \ell } ( 1 - t ) ) } \\ & { \qquad = \kappa _ { 0 } \left( 1 - c \sum _ { j = 0 } ^ { \ell - 1 } 2 ^ { - j } t ^ { 1 / 2 ^ { \ell - 1 } } + o ( t ^ { 1 / 2 ^ { \ell - 1 } } ) \right) } \\ & { \qquad = 1 - c \left( c \sum _ { j = 0 } ^ { \ell - 1 } t ^ { 1 / 2 ^ { \ell - 1 } } + o ( t ^ { 1 / 2 ^ { \ell - 1 } } ) \right) ^ { 1 / 2 } + o ( o ( t ^ { 1 / 2 ^ { \ell - 1 } } ) ^ { 1 / 2 } ) } \\ & { \qquad = 1 - c \sum _ { j = 0 } ^ { \ell } 2 ^ { - j } t ^ { 1 / 2 ^ { \ell } } ( 1 + o ( 1 ) ) + o ( t ^ { 1 / 2 ^ { \ell } } ) } \\ & { \qquad = 1 - c \sum _ { j = 0 } ^ { \ell } 2 ^ { - j } t ^ { 1 / 2 ^ { \ell } } + o ( t ^ { 1 / 2 ^ { \ell } } ) , } \end{array}
|
| 764 |
+
$$
|
| 765 |
+
|
| 766 |
+
proving the desired claim.
|
| 767 |
+
|
| 768 |
+
Around $^ { - 1 }$ , we have $\kappa _ { 0 } ( - 1 + t ) = c t ^ { 1 / 2 } + o ( t ^ { 1 / 2 } )$ , and for $\ell \geq 3$ , $\kappa _ { s } ^ { \ell } ( - 1 + t ) = a _ { \ell } + O ( t ^ { 1 / 2 } )$ , by an easy induction using the fact that $\kappa _ { 0 } ( [ 0 , 1 ) ) \subset ( 0 , 1 )$ and $\kappa _ { 0 }$ is smooth on $\lfloor 0 , 1 \rfloor$ . Thus the behavior around $^ { - 1 }$ does not affect the decay of $\kappa _ { s } ^ { \ell }$ for $\ell \geq 3$ , and Theorem 1 leads to the desired decay, with a constant that only depends on $\ell$ through $\scriptstyle { C ^ { \sum _ { j = 0 } ^ { \ell - 1 } 2 ^ { - j } } }$ , which lies in the interval $[ c ^ { 2 } , c ]$ for any $\ell$ . □
|
md/train/aFvG-DNPNB9/aFvG-DNPNB9.md
ADDED
|
@@ -0,0 +1,288 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SELF-REFLECTIVE VARIATIONAL AUTOENCODER
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
The Variational Autoencoder (VAE) is a powerful framework for learning probabilistic latent variable generative models. However, typical assumptions on the approximate posterior distributions can substantially restrict its capacity for inference and generative modeling. Variational inference based on neural autoregressive models respects the conditional dependencies of the exact posterior, but this flexibility comes at a cost: the resulting models are expensive to train in highdimensional regimes and can be slow to produce samples. In this work, we introduce an orthogonal solution, which we call self-reflective inference. By redesigning the hierarchical structure of existing VAE architectures, self-reflection ensures that the stochastic flow preserves the factorization of the exact posterior, sequentially updating the latent codes in a manner consistent with the generative model. We empirically demonstrate the advantages of matching the variational posterior to the exact posterior—on binarized MNIST self-reflective inference achieves state-of-the-art performance without resorting to complex, computationally expensive components such as autoregressive layers. Moreover, we design a variational normalizing flow that employs the proposed architecture, yielding predictive benefits compared to its purely generative counterpart. Our proposed modification is quite general and it complements the existing literature; self-reflective inference can naturally leverage advances in distribution estimation and generative modeling to improve the capacity of each layer in the hierarchy.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The advent of deep learning has led to great strides in both supervised and unsupervised learning. One of the most popular recent frameworks for the latter is the Variational Autoencoder (VAE), in which a probabilistic encoder and generator are jointly trained via backpropagation to simultaneously perform sampling and variational inference. Since the introduction of the VAE (Kingma & Welling, 2014), or more generally, the development of techniques for low-variance stochastic backpropagation of Deep Latent Gaussian Models (DLGMs) (Rezende et al., 2014), research has rapidly progressed towards improving their generative modeling capacity and/or the quality of their variational approximation. However, as deeper and more complex architectures are introduced, care must be taken to ensure the correctness of various modeling assumptions, whether explicit or implicit. In particular, when working with hierarchical models it is easy to unintentionally introduce mismatches in the generative and inference models, to the detriment of both. In this work, we demonstrate the existence of such a modeling pitfall common to much of the recent literature on DLGMs. We discuss why this problem emerges, and we introduce a simple—yet crucial—modification to the existing architectures to address the issue.
|
| 12 |
+
|
| 13 |
+
Vanilla VAE architectures make strong assumptions about the posterior distribution—specifically, it is standard to assume that the posterior is approximately factorial. More recent research has investigated the effect of such assumptions which govern the variational posterior (Wenzel et al., 2020) or prior (Wilson & Izmailov, 2020) in the context of uncertainty estimation in Bayesian neural networks. In many scenarios, these restrictions have been found to be problematic. A large body of recent work attempts to improve performance by building a more complex encoder and/or decoder with convolutional layers and more modern architectures (such as ResNets (He et al., 2016)) (Salimans et al., 2015; Gulrajani et al., 2017) or by employing more complex posterior distributions constructed with autoregressive layers (Kingma et al., 2016; Chen et al., 2017). Other work (Tomczak & Welling, 2018; Klushyn et al., 2019a) focuses on refining the prior distribution of the latent codes. Taking a different approach, hierarchical VAEs (Rezende et al., 2014; Gulrajani et al., 2017; Sønderby et al., 2016; Maaløe et al., 2019; Klushyn et al., 2019b) leverage increasingly deep and interdependent layers of latent variables, similar to how subsequent layers in a discriminative network are believed to learn more and more abstract representations. These architectures exhibit superior generative and reconstructive capabilities since they allow for modeling of much richer latent spaces. While the benefits of incorporating hierarchical latent variables is clear, all existing architectures suffer from a modeling mismatch which results in sub-optimal performance: the variational posterior does not respect the factorization of the exact posterior distribution of the generative model.
|
| 14 |
+
|
| 15 |
+
In earlier works on hierarchical VAEs (Rezende et al., 2014), inference proceeds bottom-up, counter to the top-down generative process. To better match the order of dependence of latent variables to that of the generative model, later works (Sønderby et al., 2016; Bachman, 2016) split inference into two stages: first a deterministic bottom-up pass which does necessary precomputation for evidence encoding, followed by a stochastic top-down pass which incorporates the hierarchical latents to form a closer variational approximation to the exact posterior. Crucially, while these newer architectures ensure that the order of the latent variables mirrors that of the generative model, the overall variational posterior does not match because of the strong restrictions on the variational distributions of each layer.
|
| 16 |
+
|
| 17 |
+
Contributions. In this work, we propose to restructure common hierarchical VAE architectures with a series of bijective layers which enable communication between the inference and generative networks, refining the latent representations. Concretely, our contributions are as follows:
|
| 18 |
+
|
| 19 |
+
• We motivate and introduce a straightforward rearrangement of the stochastic flow of the model which addresses the aforementioned modeling mismatch. This modification substantially compensates for the observed performance gap between models with only simple layers and those with complex autoregressive networks (Kingma et al., 2016; Chen et al., 2017). • We formally prove that this refinement results in a hierarchical VAE whose variational posterior respects the precise factorization of the exact posterior. To the best of our knowledge, this is the first deep architecture to do so without resorting to computationally expensive autoregressive components or making strong assumptions (e.g., diagonal Gaussian) on the distributions of each layer (Sønderby et al., 2016)—assumptions that lead to degraded performance. • We experimentally demonstrate the benefits of the improved representation capacity of this model, which stems from the corrected factorial form of the posterior. We achieve state-of-the-art perfomance on MNIST among models without autoregressive layers, and our model performs on par with recent, fully autoregressive models such as Kingma et al. (2016). Due to the simplicity of our architecture, we achieve these results for a fraction of the computational cost in both training and inference. • We design a hierarchical variational normalizing flow that deploys the suggested architecture in order to recursively update the base distribution and the conditional bijective transformations. This architecture significantly improves upon the predictive performance and data complexity of a Masked Autoregressive Flow (MAF) (Papamakarios et al., 2017) on CIFAR-10.
|
| 20 |
+
|
| 21 |
+
Finally, it should be noted that our contribution is quite general and can naturally leverage recent advances in variational inference and deep autoencoders (Chen et al., 2017; Kingma et al., 2016; Tomczak & Welling, 2018; Burda et al., 2016; Dai & Wipf, 2019; van den Oord et al., 2016a; Rezende & Viola, 2018) as well as architectural improvements to density estimation (Gulrajani et al., 2017; Dinh et al., 2017; Kingma & Dhariwal, 2018; Durkan et al., 2019; van den Oord et al., 2016b; Gregor et al., 2015). We suspect that combining our model with other state-of-the-art methods could further improve the attained performance, which we leave to future work.
|
| 22 |
+
|
| 23 |
+
# 2 VARIATIONAL AUTONENCODERS
|
| 24 |
+
|
| 25 |
+
A Variational Autoencoder (VAE) (Kingma & Welling, 2014; 2019) is a generative model which is capable of generating samples $\pmb { x } \in \tilde { \mathbb { R } } ^ { D }$ from a distribution of interest $p ( { \pmb x } )$ by utilizing latent variables $_ z$ coming from a prior distribution $p ( z )$ . To perform inference, the marginal likelihood
|
| 26 |
+
|
| 27 |
+
should be computed which involves integrating out the latent variables:
|
| 28 |
+
|
| 29 |
+
$$
|
| 30 |
+
p ( \pmb { x } ) = \int p ( \pmb { x } , z ) d z .
|
| 31 |
+
$$
|
| 32 |
+
|
| 33 |
+
In general, this integration will be intractable and a lower bound on the marginal likelihood is maximized instead. This is done by introducing an approximate posterior distribution $q ( { \boldsymbol { z } } \mid { \boldsymbol { x } } )$ and applying Jensen’s inequality:
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
\begin{array} { r l r } & { } & { \log p ( { \pmb x } ) = \log \displaystyle \int p ( { \pmb x } , { \pmb z } ) d { \pmb z } = \log \int \displaystyle \frac { q ( { \pmb z } \mid { \pmb x } ) } { q ( { \pmb z } \mid { \pmb x } ) } p ( { \pmb x } , { \pmb z } ) d { \pmb z } \geq \int q ( { \pmb z } \mid { \pmb x } ) \log \left[ \frac { p ( { \pmb x } \mid { \pmb z } ) p ( { \pmb z } ) } { q ( { \pmb z } \mid { \pmb x } ) } \right] \ d { \pmb z } } \\ & { } & { \implies \log p ( { \pmb x } ) \geq \mathbb { E } _ { q ( { \pmb z } \mid { \pmb x } ) } [ \log p ( { \pmb x } \mid { \pmb z } ) ] - D _ { K L } ( q ( { \pmb z } \mid { \pmb x } ) \parallel p ( { \pmb z } ) ) \triangleq \mathcal { L } ( { \pmb x } ; { \pmb \theta } , { \pmb \phi } ) , \qquad ( { \pmb 2 } ) } \end{array}
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
where $\theta , \phi$ parameterize $p ( { \pmb x } , z ; { \pmb \theta } )$ and $q ( \boldsymbol { z } \mid \boldsymbol { x } ; \boldsymbol { \phi } )$ respectively. For ease of notation, we may omit $\theta , \phi$ in the derivations. This objective is called the Evidence Lower BOund (ELBO) and can be optimized efficiently for continuous $_ z$ via stochastic gradient descent (Kingma & Welling, 2014; Rezende et al., 2014).
|
| 40 |
+
|
| 41 |
+
# 3 SELF-REFLECTIVE VARIATIONAL INFERENCE
|
| 42 |
+
|
| 43 |
+
With this background, we are now ready to introduce our main contribution: the first deep probabilistic model which ensures that the variational posterior matches the factorization of the exact posterior induced by its generative model. We refer to this architecture as the Self-Reflective Variational Autoencoder (SeRe-VAE). We expound upon its components in the following subsections.
|
| 44 |
+
|
| 45 |
+
# 3.1 GENERATIVE MODEL
|
| 46 |
+
|
| 47 |
+
Figure 1 displays the overall stochastic flow of the generative network. A detailed illustration of our model is provided in Figure S3.
|
| 48 |
+
|
| 49 |
+
Our generative model consists of a hierarchy of $L$ stochastic layers, as in Rezende et al. (2014). However, in this work, the data $\pmb { x } = ( \pmb { x } _ { 1 } , \pmb { x } _ { 2 } , \dots , \pmb { x } _ { L } ) \in \mathbb { R } ^ { D }$ is partitioned into $L$ blocks, with each layer generating only $\pmb { x } _ { l } \in \mathbb { R } ^ { D _ { l } }$ , with $\Sigma _ { l } D _ { l } = \mathbf { \bar { \mathit { D } } }$ . At each layer $l$ , $N _ { l }$ -dimensional latent variables $\boldsymbol { \epsilon } _ { l } \in \mathbb { R } ^ { N _ { l } }$ are first sampled from a simple prior distribution (prior layer) and subsequently transformed to latent variables $\bar { z _ { l } } \in \mathbb { R } ^ { N _ { l } }$ by a bijective function $f _ { l } : \mathbb { R } ^ { N _ { l } } \mathbb { R } ^ { N _ { l } }$ .
|
| 50 |
+
|
| 51 |
+
To distinguish between the two sets of latent variables in our model, throughout this paper we refer to $\epsilon _ { l }$ as the base latent variables and $z _ { l }$ as the latent codes. For example, for an affine transformation $f _ { l }$ the latent codes are given by $z _ { l } = f _ { l } ( \epsilon _ { l } ) = c _ { l } + ( d i a g ( d _ { l } ) + u _ { l } u _ { l } ^ { T } ) \times \epsilon _ { l }$ , with $\boldsymbol { c } _ { l } , \boldsymbol { u } _ { l } , \boldsymbol { d } _ { l } \in \mathbb { R } ^ { N _ { l } }$ and $d _ { l } \ge 0$ to ensure bijectivity. The latent codes $z _ { l }$ are subsequently passed to the stochastic layer responsible for generating the observed data $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } \mathbf { \mathcal { l } } }$ (data layer).
|
| 52 |
+
|
| 53 |
+
Moreover, the layers in the hierarchy are connected in three ways: i) the prior layer $l$ can access the latent codes $_ { z _ { l - 1 } }$ defining a conditional distribution $p ( \epsilon _ { l } \mid z _ { l - 1 } )$ ii) $z _ { l - 1 }$ is fed to the next bijection $f _ { l }$ defining a conditional transformation $z _ { l } = f _ { l } ( \epsilon _ { l } \mid z _ { l - 1 } )$ iii) the data layer $l$ receives the data block $\mathbf { \delta } _ { \mathbf { \mathcal { X } } l - 1 }$ generated by the previous data layer defining a conditional distribution $p ( \pmb { x } _ { l } \ | \ z _ { l - 1 } , \pmb { x } _ { l - 1 } )$ . Intuitively, this choice is justified because the latent codes $z _ { l }$ of layer $l$ , conditioned on $z _ { l - 1 }$ , will be successively refined based on how well $_ { z _ { l - 1 } }$ reconstructed $\mathbf { \delta } _ { \mathbf { \mathcal { X } } l - 1 }$ , yielding progressively more meaningful latent representations. In the following subsections, we describe these steps in detail. The joint distribution of the base latent variables $\boldsymbol { \epsilon } = \left( \epsilon _ { 1 } , \epsilon _ { 2 } , \ldots , \epsilon _ { L } \right)$ and the observed data $_ { \textbf { \em x } }$ of the generative model is:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
p ( \pmb { x } , \pmb { \epsilon } ) = p ( \pmb { \epsilon } _ { 1 } ) \times p ( \pmb { x } _ { 1 } | \pmb { z } _ { 1 } ) \times \prod _ { l = 2 } ^ { L } p ( \pmb { \epsilon } _ { l } \mid \pmb { z } _ { l - 1 } ) \times p ( \pmb { x } _ { l } \mid z _ { l - 1 } , \pmb { x } _ { l - 1 } ) .
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
# 3.2 INFERENCE MODEL
|
| 60 |
+
|
| 61 |
+
The inference network is identical to the generative network shown in Figure 1, except that the prior layers are replaced by posterior layers, that are additionally conditioned on the observed data $_ { \pmb { x } }$ , for
|
| 62 |
+
|
| 63 |
+

|
| 64 |
+
Figure 1: $D$ -separation between stochastic layers. By the Bayes ball rule, all paths from $\epsilon _ { 1 }$ to $\epsilon _ { 3 }$ pass either through $\scriptstyle { \pmb x } _ { 1 }$ or $z _ { 2 }$ , which $D$ - separate them. Therefore, $\epsilon _ { 1 }$ ⊥⊥ $\epsilon _ { \mathrm { 3 } } | z _ { \mathrm { 2 } } , x$ .
|
| 65 |
+
|
| 66 |
+
the generation of the base latent variables $\epsilon _ { l }$ . Specifically, the variational encoder of the SeRe-VAE is defined as follows:
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
q ( \epsilon _ { 1 } , \epsilon _ { 2 } , \ldots , \epsilon _ { L } \mid x ) = q ( \epsilon _ { 1 } \mid x ) \times \prod _ { l = 2 } ^ { L } q ( \epsilon _ { l } \mid z _ { l - 1 } , x ) .
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
The formal justification of this factorization is deferred to section 3.3. Compared to other hierarchical architectures, in the proposed model the inference layers are conditioned on the output of the preceding bijective layer — these components are shared between the generative and the inference network (see also Figure S2). This choice allows for complex transformations of the latent variables and is theoretically motivated by the following proposition.
|
| 73 |
+
|
| 74 |
+
Proposition 1 Let $p ( \epsilon )$ and $q ( \epsilon )$ be two $N$ -dimensional probability densities. Let $f : \mathbb { R } ^ { N } \to \mathbb { R } ^ { N }$ be an invertible, smooth transformation of the random variable $\epsilon$ such that $z = f ( \epsilon )$ , yielding distributions $p ^ { \prime } ( z )$ and $q ^ { \prime } ( z )$ of $_ z$ respectively. Then, $D _ { K L } ( q ^ { \prime } ( z ) \parallel p ^ { \prime } ( z ) ) = D _ { K L } ( q ( \epsilon ) \parallel p ( \epsilon ) )$ .
|
| 75 |
+
|
| 76 |
+
Proof: From the definition of the Kullback–Leibler divergence and the change of variables formula (Rudin, 2006; Bogachev, 2007):
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\tilde { \mathfrak { L } } _ { q ^ { \prime } ( z ) } \left[ \log \frac { q ^ { \prime } ( z ) } { p ^ { \prime } ( z ) } \right] = \mathbb { E } _ { q ( \epsilon ) } \left[ \log \frac { q ^ { \prime } ( f ( \epsilon ) ) } { p ^ { \prime } ( f ( \epsilon ) ) } \right] = \mathbb { E } _ { q ( \epsilon ) } \left[ \log \frac { q ( \epsilon ) \times | \operatorname* { d e t } J _ { f } ( \epsilon ) | ^ { - 1 } } { p ( \epsilon ) \times | \operatorname* { d e t } J _ { f } ( \epsilon ) | ^ { - 1 } } \right] = \mathbb { E } _ { q ( \epsilon ) } \left[ \log \frac { q ( \epsilon ) } { p ( \epsilon ) } \right]
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
where $J _ { f } ( \epsilon )$ is the Jacobian matrix of $f$ evaluated at $\epsilon$ .
|
| 83 |
+
|
| 84 |
+
Proposition 1 implies that the inclusion of the bijectors $f _ { l }$ can help increase the conditional likelihood $p ( { \pmb x } \mid z )$ in equation 2 without increasing the KL term. Moreover—though not pursed in this work—it motivates the construction of normalizing flows for variational inference with non-linear time determinant of the Jacobian matrix, since the analytical form of the transformed distribution is no longer needed for the computation of the KL-divergence. In this work, we assume Gaussian diagonal base distributions. In order to account for the two conditioning streams, the evidence $_ { \pmb { x } }$ and the latent factors $z _ { l - 1 }$ , we employ a residual parametrization as described in section 3.4.2.
|
| 85 |
+
|
| 86 |
+
# 3.3 EXACT BAYES PROPAGATION
|
| 87 |
+
|
| 88 |
+
In this section, we provide the formal justification for the choice of equation 4: we prove that backpropagation of our model preserves the factorization of the true posterior, without resorting to complex graph inversion as in Webb et al. (2018). We use the following straightforward lemma:
|
| 89 |
+
|
| 90 |
+
Lemma 1 Let $f : \mathbb { R } ^ { N } \to \mathbb { R } ^ { N }$ be an invertible transformation such that both $f$ and $f ^ { - 1 }$ are differentiable everywhere. Then for any $z \in \mathbb { R } ^ { N }$ , $p ( \epsilon | z ) = p ( \epsilon | f ( z ) )$ .
|
| 91 |
+
|
| 92 |
+
Proof: By Bayes’s Theorem and the change of variables formula (Rudin, 2006; Bogachev, 2007),
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
p ( \epsilon | f ( z ) ) = { \frac { p ( f ( z ) | \epsilon ) \times p ( \epsilon ) } { p ( f ( z ) ) } } = { \frac { p ( z | \epsilon ) \times | \operatorname* { d e t } J _ { f } ( z ) | ^ { - 1 } \times p ( \epsilon ) } { p ( z ) \times | \operatorname* { d e t } J _ { f } ( z ) | ^ { - 1 } } } = p ( \epsilon | z ) ,
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
where $J _ { f } ( z )$ is the Jacobian matrix of $f$ evaluated at $_ { z }$ , which has non-zero determinant by assumption.
|
| 99 |
+
|
| 100 |
+
We now present our main theoretical result, which says that the factorization of our model’s variational posterior exactly matches that of the generative distribution.
|
| 101 |
+
|
| 102 |
+
Proposition 2 The factorization of the variational posterior defined in equation 4 respects the factorization of the exact posterior distribution induced by the generative model in equation 3.
|
| 103 |
+
|
| 104 |
+
Proof: Let $p ( \epsilon _ { 1 } , \epsilon _ { 2 } , \ldots , \epsilon _ { L } \mid x )$ be the posterior distribution induced by the generative model defined in equation 3, as illustrated in Figure 1. Then, according to the probability product rule the posterior distribution can be expressed as:
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
p ( \epsilon _ { 1 } , \epsilon _ { 2 } , . . . , \epsilon _ { L } \mid x ) = p ( \epsilon _ { 1 } \mid x ) \times \prod _ { l = 2 } ^ { L } p ( \epsilon _ { l } \mid \epsilon _ { < l } , x ) ,
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
where $\epsilon _ { < l } \triangleq \{ \epsilon _ { 1 } , \epsilon _ { 2 } , . . . , \epsilon _ { l - 1 } \}$ . We will apply the Bayes ball rule (Jordan, 2003) to simplify equation 6. Consider an arbitrary layer $l$ of the hierarchy. Because $f _ { l - 1 }$ is a bijector, by Lemma 1 we have
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
p ( \epsilon _ { l } \mid \epsilon _ { < l } , x ) = p ( \epsilon _ { l } \mid \epsilon _ { l - 1 } , \epsilon _ { < l - 1 } , x ) = p ( \epsilon _ { l } \mid z _ { l - 1 } , \epsilon _ { < l - 1 } , x ) .
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
Now, note that $\epsilon _ { l }$ is $D$ -separated from $\epsilon _ { l - 1 } , \ldots , \epsilon _ { 1 }$ since all paths from $\epsilon _ { l }$ to $\epsilon _ { < l }$ pass through the observed nodes $z _ { l - 1 }$ or $\pmb { x } _ { 1 } , \pmb { x } _ { 2 } , \dots , \pmb { x } _ { l - 1 }$ (see Figure 1 for an example). Therefore, we have
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
p ( \epsilon _ { l } \mid z _ { l - 1 } , \epsilon _ { < l - 1 } , \pmb { x } ) = p ( \epsilon _ { l } \mid z _ { l - 1 } , \pmb { x } ) .
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
Since this applies to every layer, it follows that the exact posterior equation 6 can also be expressed as
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
p ( \epsilon _ { 1 } , \epsilon _ { 2 } , \ldots , \epsilon _ { L } \mid x ) = p ( \epsilon _ { 1 } \mid x ) \times \prod _ { l = 2 } ^ { L } p ( \epsilon _ { l } \mid z _ { l - 1 } , x ) ,
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
exactly matching the factorization of the approximate posterior in equation 4.
|
| 129 |
+
|
| 130 |
+
# 3.4 IMPLEMENTATION DETAILS
|
| 131 |
+
|
| 132 |
+
# 3.4.1 AMORTIZED LAYERS
|
| 133 |
+
|
| 134 |
+
We use an amortized parametrization to construct the conditional probability densities involved in the derivations above. In particular, for a probability density $p ( \epsilon \mid z ; \theta )$ we take the parametrization $\pmb { \theta }$ as a function of $_ { z }$ : $\theta \equiv \theta ( z )$ . For example, a conditional Gaussian distribution is defined as $p ( \epsilon \mid z ) = \mathcal { N } ( \pmb { \mu } ( z ) , \pmb { \sigma } ( z ) )$ with $\pmb \theta ( z ) = ( \pmb \mu ( z ) , \pmb \sigma ( z ) )$ . The computational graph of an amortized Gaussian layer is shown in Figure S4. Similarly, for a conditional bijector $f ( \epsilon \mid z ; \beta )$ we take $\beta$ as a function of $_ z$ : $\beta \equiv \beta ( z )$ . For example, for the affine bijector defined in section 3.1, we consider $\beta ( z ) = ( c ( z ) , d ( z ) , u ( z ) )$ .
|
| 135 |
+
|
| 136 |
+
# 3.4.2 RESIDUAL DISTRIBUTIONAL LAYERS
|
| 137 |
+
|
| 138 |
+
All but the first data layer $p ( \pmb { x } _ { l } \mid \pmb { z } _ { l - 1 } , \pmb { x } _ { l - 1 } )$ and posterior layer $q ( \epsilon _ { l } \mid z _ { l - 1 } , \pmb { x } )$ receive two streams of conditioning factors—one latent and one observed. We ensure that each factor incrementally refines the distribution by adopting a residual parametrization. Here we describe the residual Gaussian distribution when conditioned on the two factors $z , x$ . Its probability density is given by
|
| 139 |
+
|
| 140 |
+
$$
|
| 141 |
+
q ( \epsilon | z , \pmb { x } ) = \mathcal { N } ( \pmb { \mu } ( z ) \delta \pmb { \sigma } ( \pmb { x } ) + \delta \pmb { \mu } ( \pmb { x } ) , \pmb { \sigma } ( z ) \delta \pmb { \sigma } ( \pmb { x } ) ) ,
|
| 142 |
+
$$
|
| 143 |
+
|
| 144 |
+
which can be interpreted as follows. The first distribution $\mathcal { N } ( \pmb { \mu } ( z ) , \pmb { \sigma } ( z ) )$ is corrected by the residuals $\delta { \pmb \sigma } ( { \pmb x } )$ , $\delta { \pmb \mu } ( { \pmb x } )$ ; here we see the dependence on the conditioning factor $_ { x }$ . If $_ { x }$ does not provide additional information on $\epsilon$ (formally, $p ( \epsilon | z , x ) = p ( \epsilon | z ) )$ ), the two corrections collapse to 1 and 0 respectively—that is, inducing no change. The reader may refer to Figure S7 where we qualitatively illustrate the effect of the residual distributional layer that improves the conditional likelihood provided by the first one. To reduce the number of parameters, we consider networks for $\mu ( z )$ , $\pmb { \sigma } ( z )$ that are shared between the prior and the posterior, yielding a prior of the form $p ( \epsilon | z ) = \mathcal { N } ( \pmb { \mu } ( z ) , \pmb { \sigma } ( z ) )$ . Finally, we found experimentally that enforcing $\delta { \pmb \sigma } ( { \pmb x } ) \le 1$ helps optimization by ensuring that $_ { x }$ can only reduce the variance of the prior.
|
| 145 |
+
|
| 146 |
+
# 3.5 GENERAL REMARKS
|
| 147 |
+
|
| 148 |
+
Following the above analysis, we make some observations about the hierarchy of shared bijective layers in the model:
|
| 149 |
+
|
| 150 |
+
• In contrast to Rezende et al. (2014) (see Figure S1), in our model i) the prior layers are not independent, but rather are conditioned on the previous layers in the hierarchy; and ii) the transformational layers are restricted to be bijective.
|
| 151 |
+
• The proposed model also differs from other hierarchical architectures (Gulrajani et al., 2017; Sønderby et al., 2016; Maaløe et al., 2019); in these models the layers of the prior are conditioned upon the previous prior layers and not upon bijective layers that are shared between the generative and inference model.
|
| 152 |
+
• One additional key difference between our model and all previous work is the coupling between the data layers. Therefore, the decoder can be perceived layer-wise instead of pixel-wise autoregressive rendering the sampling much more efficient ( $\mathcal { O } ( L )$ instead of $\mathcal { O } ( D )$ ). In section 4, we provide empirical results demonstrating the benefits of these modeling choices.
|
| 153 |
+
• By reducing the set of conditioning variables from $\epsilon _ { < l }$ to $z _ { l - 1 }$ in a theoretically justified manner, the hierarchical bijective layers offer a convenient way to precisely and efficiently factorize the variational distribution, alleviating the bottleneck present in high-dimensional autoregressive approaches.
|
| 154 |
+
• The model, albeit hierarchical, is less prone to posterior collapse, since each layer is responsible for the generation of a different portion of the data. Experimental support for this observation is provided in Figure S8, where we plot the KL divergence for each layer of the architecture investigated in section 4.1.2.
|
| 155 |
+
|
| 156 |
+
# 4 EXPERIMENTAL STUDIES
|
| 157 |
+
|
| 158 |
+
# 4.1 DYNAMICALLY BINARIZED MNIST
|
| 159 |
+
|
| 160 |
+
We empirically evaluate the SeRe-VAE on dynamically binarized MNIST. As in Burda et al. (2016); Sønderby et al. (2016); Kingma et al. (2016), the binary-valued observations are sampled after each epoch with the Bernoulli expectations being set equal to the real, normalized pixel values in the dataset which prevents overfitting.
|
| 161 |
+
|
| 162 |
+
# 4.1.1 PERFORMANCE OF THE MLP SERE-VAE
|
| 163 |
+
|
| 164 |
+
To demonstrate that our model’s improved performance is due to the restructuring of the stochastic flow and not sophisticated layers, we use simple multilayer-perceptron (MLP) components; we similarly forgo importance weighting (Burda et al., 2016). We adopt a 10-layer architecture, with $N _ { l } = 1 0$ latent variables per layer, for a total of 100 latent features being passed to the decoder after being transformed by an affine bijector as described in section 3.1. We partition the image into $L = 1 0$ equally sized blocks (except for the last one) from left to right in a raster fashion. Finally, we use independent deterministic encoders for the data preprocessing. The full details of our implementation are delegated to the supplementary material. We again emphasize the overall simplicity of our architecture, choosing instead to focus on the benefits of the corrected posterior factorization. As shown in Table 1, our model (SeRe-VAE) outperforms existing models of the same complexity such as the DLGM and Ladder VAE (LVAE), those of higher complexity such as Inverse Autoregressive Flow (IAF), and models trained with importance weighted samples (IW-LVAE). Note that the architecture of the DLGM is identical to that of SeRe-VAE; to ensure a fair comparison, the DLGM was given larger feature maps in the encoders to compensate for the additional bijective layer inputs in the SeRe-VAE. Therefore, the performance benefits are solely attributed to the inclusion of the latent codes in subsequent stochastic layers in the hierarchy. Our model outperforms the LVAE models, despite using a smaller latent dimensionality (128 vs. 100) and being trained with a single importance sample. Moreover, our model exhibits superior performance compared to the autoregressive IAF; this discrepancy could stem from the 1-layer architecture or the fact that a standard normal prior was used. This result indicates that a prior of equivalent expressive capacity communicating with the bijective layer could yield additional improvement. Finally, in our experiments the
|
| 165 |
+
|
| 166 |
+
Table 1: Dynamically binarized MNIST Performance for VAEs without ResNet layers. 1000 importance samples were used for the estimation of the marginal likelihood. For the Ladder VAE performance, we refer to Table1 in Sønderby et al. (2016). The models were trained with a single importance sample unless otherwise noted $\mathrm { ( I W } { = } 1 ) ,$ ).
|
| 167 |
+
|
| 168 |
+
<table><tr><td>Model</td><td>Details</td><td>log p(x) ≥</td></tr><tr><td>Self-Reflective</td><td>10 layers /1O variables each,diagonal Gaussian prior -81.17</td><td></td></tr><tr><td>Importance Weighted Ladder</td><td> 5 layers /128 variables total, #IW samples=10</td><td>-81.74</td></tr><tr><td>Ladder</td><td>5layers/128variables total</td><td>-81.84</td></tr><tr><td>Self-Reflective IAF</td><td>10 layers /1O variables each, Standard Normal Prior</td><td>-81.96</td></tr><tr><td>Inverse Autoregressive Flow</td><td>1layer/1OO variables,Standard Normal Prior</td><td>-83.04</td></tr><tr><td></td><td>Deep Latent Gaussian Model1O layers /1O variables each, diagonal Gaussian prior</td><td>-84.53</td></tr><tr><td>Relaxed Bernoulli VAEs</td><td>30 latent variables,exact factorization</td><td>-90</td></tr></table>
|
| 169 |
+
|
| 170 |
+
10-layer IAF took nearly twice as long to train compared to the SeRe-VAE. Finally, the Relaxed Bernoulli VAE (Webb et al., 2018) respects the factorization of the true posterior but scales up to 30 latent variables while not supporting recurrent refinement across layers. The learning curves, the architectural details and the training hyperparameters are provided in the appendix.
|
| 171 |
+
|
| 172 |
+
# 4.1.2 PERFORMANCE OF THE RESNET SERE-VAE
|
| 173 |
+
|
| 174 |
+
To demonstrate the capacity of our model when combined with complex layers, we replaced the MLPs with ResNets as in Salimans et al. (2015) while preserving the same number of latent variables. As shown in Table 2, our model performs better than all recent models that do not use expensive coupling or pixel-level autoregressive layers, either in the encoder or in the decoder, and on par with models of higher complexity. Especially for BIVA, it should be mentioned that more, 168 vs 100 of our model, latent variables are used. The full architectural details are provided in the appendix.
|
| 175 |
+
|
| 176 |
+
Table 2: Dynamically binarized MNIST performance for VAEs with sophisticated layers. 1000 importance samples were used for the estimation of the marginal likelihood. All performances listed here are taken from Maaløe et al. (2019) and Durkan et al. (2019). All models were trained with a single importance sample.
|
| 177 |
+
|
| 178 |
+
<table><tr><td>Model</td><td>log p(x) ≥</td></tr><tr><td>Models with autoregressive (AR) or coupling(C) components</td><td></td></tr><tr><td>VLAE(Chen et al.,2017)</td><td>-79.03</td></tr><tr><td>Pixel RNN(van den Oord et al.,2016b)</td><td>-79.20</td></tr><tr><td>RQ-NSF(C) (Durkan et al., 2019)</td><td>-79.63</td></tr><tr><td>Pixel VAE (Gulrajani et al., 2017)</td><td>-79.66</td></tr><tr><td>RQ-NSF (AR) (Durkan et al., 2019)</td><td>-79.71</td></tr><tr><td>IAF VAE (Kingma et al., 2016)</td><td>-79.88</td></tr><tr><td>DRAW (Gregor et al., 2015) Pixel CNN (van den Oord et al.,2016a)</td><td>-80.97</td></tr><tr><td></td><td>-81.30</td></tr><tr><td>Models without autoregressive or coupling components SeRe-VAE</td><td>-79.50</td></tr><tr><td>BIVA (Maalpe et al.,2019)</td><td>-80.47</td></tr><tr><td>Discrete VAE (Rolfe,2017)</td><td>-81.01</td></tr></table>
|
| 179 |
+
|
| 180 |
+
# 4.2 CIFAR10 NATURAL IMAGES
|
| 181 |
+
|
| 182 |
+
# 4.2.1 ABLATION STUDY
|
| 183 |
+
|
| 184 |
+
In this section, we study the effect of the different couplings between the layers of the architecture presented in Figure 1 on CIFAR-10 images which have dimension (32, 32, 3). We consider a 16- layer architecture with each layer generating a $( 8 , 8 , 3 )$ patch of the image when partitioned in a spatial checkerboard pattern. We use $( 8 , 8 , 2 )$ latent spaces per layer. For the decoder, we use the mixture of discretized logistic distributions (Salimans et al., 2017). In particular, we investigate three different architectures:
|
| 185 |
+
|
| 186 |
+
• case 1: there are no couplings (no vertical edges) between the layers and each patch is independently generated from the others, • case 2: there are couplings only between the decoders $( \pmb { x } _ { l - 1 } \pmb { x } _ { l }$ edges), • case 3: there is feedback from the previous inference layer both in the observed space ${ \bf { x } } _ { l - 1 } { \bf { x } } _ { l }$ edges) and the latent space $z _ { l - 1 } \to \epsilon _ { l }$ , and $z _ { l - 1 } z _ { l }$ edges).
|
| 187 |
+
|
| 188 |
+
In all of the above cases, we consider joint bijective layers between the inference and generative network. One observation that we would like to make and turned out to be critical , when we tested our architecture on more complex regimes such as CIFAR-10, and in order to obtain significant predictive benefits from case 3 compared to case 2 was that we had to consider a lower bound for the variance in the prior layers. In other words, a deep probabilistic should self-reflect by obtaining information from the previous inference layers but without being overly confident in its prior assumptions. This can also be mathematically corroborated by examining the KL-divergence in the VAE objective of equation 2 for the residual parametrization introduced in section 3.4.2:
|
| 189 |
+
|
| 190 |
+
$$
|
| 191 |
+
\mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt \beta } } } } } } } } \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt \beta } } } } } } } } \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt \beta } } } } } } } } \mathtt \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \beta } } } } } } } } \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt \beta } } } } } } } \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt \beta } } } } } } } } \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \beta } } } } } } } \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \beta } } } } } } } } \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \beta } } } } } } \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \beta } } } } } } } } } \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \beta } } } } } } \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt \beta } } } } } } } } } } \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \beta } } } } } } \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt \beta } } } } } } } } } } \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \beta } } } } } } } } \mathtt { \mathtt { \mathtt { \mathtt \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt \beta } } } } } } } } } \mathtt { \mathtt { \mathtt { \mathtt \mathtt { \mathtt { \mathtt { \mathtt { \mathtt { \mathtt \beta } } } } } } } } \mathtt { \mathtt { \mathtt { \mathtt \mathtt { \mathtt { \mathtt { \mathtt { \mathtt \beta } } } } } } } \mathtt { \mathtt { \mathtt \mathtt { \mathtt { \mathtt \mathtt { \mathtt { \mathtt { \mathtt \beta } } } } } } } \mathtt { \mathtt { \mathtt \mathtt { \mathtt { \mathtt \mathtt { \mathtt { \mathtt \beta } } } } } } \mathtt { \mathtt { \mathtt \mathtt { \mathtt { \mathtt \mathtt { \mathtt { \mathtt \beta } } } } } } \mathtt { \mathtt { \mathtt \mathtt { \mathtt { \mathtt \mathtt { \mathtt { \mathtt \beta } } } } } } \mathtt \mathtt \mathtt \mathtt \mathtt \mathtt \mathtt \mathtt
|
| 192 |
+
$$
|
| 193 |
+
|
| 194 |
+
As it can be seen, bounding $\pmb { \sigma } ( z )$ from below prevents making the first term of the $\mathrm { K L }$ arbitrarily large. In these experiments, we take a unit lower bound.
|
| 195 |
+
|
| 196 |
+
<table><tr><td>architecture</td><td>128 epochs</td><td>256 epochs</td><td>512 epochs</td></tr><tr><td>case 1 (no vertical edges)</td><td>4.56</td><td>4.47</td><td>4.47</td></tr><tr><td>case 2 (coupled decoders)</td><td>4.47</td><td>4.34</td><td>4.28</td></tr><tr><td>case 3 (SeRe-VAE)</td><td>4.19</td><td>3.79</td><td>3.68</td></tr></table>
|
| 197 |
+
|
| 198 |
+
Table 3: Studying the impact in bits/dim of the connectivity between layers on the test set of CIFAR10 data for a different number of training epochs. The KL was linearly annealed (S.II.A.1) from 0.2 to 1 for the first half of the training.
|
| 199 |
+
|
| 200 |
+
In Table 3, we observe that utilization of information from previous layers in the hierarchy both in the evidence space and in the latent space consistently improves inference. Moreover, the gap in the performance becomes larger as more training epochs are dedicated.
|
| 201 |
+
|
| 202 |
+
The attained performance could be further improved:
|
| 203 |
+
|
| 204 |
+
• without increasing the complexity of the network i) by re-distributing the latent variables allocated per-layer so that critical patches of the image are given more latent variables ii) further finetuning, especially of the lower bound of the scale in the prior iii) investigating block-coordinate descent optimization algorithms (with the parameters of each layer defining each block).
|
| 205 |
+
|
| 206 |
+
• by increasing the complexity of the network, in particular i) by deploying a deeper architecture ii) by increasing the receptive field of each inference layer so that it is coupled not only with the previous inference layers responsible for the generation of the immediately adjacent left/above patches iii) by employing recent deep VAE architectures for each one of the layer in our proposed scheme iv) by using more expressive, such as IAF, flows for the joint bijective layers v) by using pixel-autoregressive decoders.
|
| 207 |
+
|
| 208 |
+
Please note that none of the aforementioned suggestions introduces modeling redundancies (large latent spaces with many of their dimensions collapsing to their prior counterpart) or modeling mismatches between the true and the variational posterior.
|
| 209 |
+
|
| 210 |
+
4.2.2 PERFORMANCE OF A SELF-REFLECTIVE, VARIATIONAL MASKED AUTOREGRESSIVE FLOW ON CIFAR-10
|
| 211 |
+
|
| 212 |
+
In this section, we introduce a hierarchical latent variable normalizing flow: the first VAE with a decoder consisting of normalizing flow transformations—realizing improvements over its purely generative counterpart. Due to space constraints we refer the reader to the appendix for a review of normalizing flows, as well as the full technical details of our architecture. A high-level description is provided here. The latent variables are generated by the proposed network shown in Figure 1. Subsequently, the latent variables $_ { z }$ are incorporated in the flow in two ways: i) conditioning the base distribution and ii) conditioning the bijective transformations. In the case of a Masked Autoregressive Flow (MAF) (Papamakarios et al., 2017) or an Inverse Autoregressive Flow (Kingma et al., 2016), the latter amounts to designing conditional MADE layers (Germain et al., 2015) that account for a mask offset so that the additional inputs $_ z$ are not masked out. The first amounts to building an amortized Gaussian layer. We used a 5 layer hierarchy of 40 latent variables each. We adopted a unit rank Gaussian base distribution in the decoder—parameterized as in Equation (9) in Rezende et al. (2014)—and diagonal Gaussian prior and posterior layers. We used neural spline bijective layers with coupling transformations (Durkan et al., 2019), which boosted the performance compared to affine transformations. We refer to our source code and the supplementary material for the implementation details. In Table 4, we compare against generative MAF models with the same or larger width, with or without training dataset augmentation with horizontal image flips and different number of MADEs. Our variational model exhibits significant improvement over the baselines.
|
| 213 |
+
|
| 214 |
+
Table 4: Performance of different MAFs on CIFAR-10.
|
| 215 |
+
|
| 216 |
+
<table><tr><td>Model</td><td>Variational</td><td>#MADE layers</td><td>Width</td><td>Flipped Images</td><td>Test Loglikelihood</td></tr><tr><td>SeRe-MAF</td><td>Yes</td><td>10 (2 flows,5layers)</td><td>1024</td><td>No</td><td>≥3190 (ELBO)</td></tr><tr><td>MAF</td><td>No</td><td>10</td><td>1024</td><td>No</td><td>2670</td></tr><tr><td>MAF(5) (Papamakarios et al.,2017)</td><td>No</td><td>5</td><td>2048</td><td>Yes</td><td>2936</td></tr><tr><td>MAF(10) (Papamakarios et al.,2017)</td><td>No</td><td>10</td><td>2048</td><td>Yes</td><td>3049</td></tr></table>
|
| 217 |
+
|
| 218 |
+
# 5 CONCLUSION AND DISCUSSION
|
| 219 |
+
|
| 220 |
+
In this paper, we presented self-reflective variational inference that suggests a structural modification for hierarchical VAEs (SeRe-VAE) and combines top-down inference with iterative feedback between the generative and inference network through shared bijective layers. This modification increases the representation capacity of existing VAEs, leading to smaller latent spaces and vast computational benefits without compromising the generative capacity of the model. We further introduced hierarchical latent variable normalizing flows which utilize the proposed architecture to recurrently refine the base distribution and the bijectors from the latent codes of the previous layer. For our experiments, we used uncoupled deterministic encoders; it would be interesting to explore any predictive benefits of a bottom-up deterministic pass of the inference network, especially for modeling natural images. The architecture could be further refined by adopting hierarchical stochastic layers. Finally, integration of pixel-regressive decoders and importance-weighted variations of the proposed scheme constitute directions for future research.
|
| 221 |
+
|
| 222 |
+
# REFERENCES
|
| 223 |
+
|
| 224 |
+
Philip Bachman. An architecture for Deep, Hierarchical Generative Models. In Proceedings of the 30th International Conference on Neural Information Processing Systems, 2016.
|
| 225 |
+
|
| 226 |
+
Vladimir I Bogachev. Measure theory, volume 1. Springer Science & Business Media, 2007.
|
| 227 |
+
|
| 228 |
+
Yuri Burda, Roger B. Grosse, and Ruslan Salakhutdinov. Importance Weighted Autoencoders. In 4th International Conference on Learning Representations, ICLR, 2016.
|
| 229 |
+
|
| 230 |
+
Xi Chen, Diederik P. Kingma, Tim Salimans, Yan Duan, Prafulla Dhariwal, John Schulman, Ilya Sutskever, and Pieter Abbeel. Variational Lossy Autoencoder. In 5th International Conference on Learning Representations, ICLR, 2017.
|
| 231 |
+
|
| 232 |
+
Bin Dai and David P. Wipf. Diagnosing and Enhancing VAE models. In 7th International Conference on Learning Representations, ICLR, 2019.
|
| 233 |
+
|
| 234 |
+
Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using Real NVP. In 5th International Conference on Learning Representations, ICLR, 2017.
|
| 235 |
+
|
| 236 |
+
Conor Durkan, Artur Bekasov, Iain Murray, and George Papamakarios. Neural spline flows. In Advances in Neural Information Processing Systems 32, 2019.
|
| 237 |
+
|
| 238 |
+
Mathieu Germain, Karol Gregor, Iain Murray, and Hugo Larochelle. MADE: Masked Autoencoder for Distribution Estimation. In Proceedings of the 32nd International Conference on Machine Learning, ICML, 2015.
|
| 239 |
+
|
| 240 |
+
Karol Gregor, Ivo Danihelka, Alex Graves, Danilo Jimenez Rezende, and Daan Wierstra. DRAW: A Recurrent Neural Network for Image Generation. In Proceedings of the 32nd International Conference on Machine Learning, ICML, 2015.
|
| 241 |
+
|
| 242 |
+
Ishaan Gulrajani, Kundan Kumar, Faruk Ahmed, Adrien Ali Ta¨ıga, Francesco Visin, David Vazquez, ´ and Aaron C. Courville. PixelVAE: A Latent Variable Model for Natural Images. In 5th International Conference on Learning Representations, ICLR, 2017.
|
| 243 |
+
|
| 244 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep Residual Learning for Image Recognition. In The IEEE Conference on Computer Vision and Pattern Recognition, CVPR, June 2016.
|
| 245 |
+
|
| 246 |
+
Michael I Jordan. An introduction to probabilistic graphical models, 2003.
|
| 247 |
+
|
| 248 |
+
Diederik P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In Advances in Neural Information Processing Systems 31, 2018.
|
| 249 |
+
|
| 250 |
+
Diederik P. Kingma and Max Welling. Auto-Encoding Variational Bayes. In 2nd International Conference on Learning Representations, ICLR, 2014.
|
| 251 |
+
|
| 252 |
+
Diederik P. Kingma and Max Welling. An Introduction to Variational Autoencoders. Foundations and Trends in Machine Learning, 12(4):307–392, 2019. doi: 10.1561/2200000056. URL https://doi.org/10.1561/2200000056.
|
| 253 |
+
|
| 254 |
+
Diederik 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 29, 2016.
|
| 255 |
+
|
| 256 |
+
Alexej Klushyn, Nutan Chen, Richard Kurle, Botond Cseke, and Patrick van der Smagt. Learning Hierarchical Priors in VAEs. In Advances in Neural Information Processing Systems 32, 2019a.
|
| 257 |
+
|
| 258 |
+
Alexej Klushyn, Nutan Chen, Richard Kurle, Botond Cseke, and Patrick van der Smagt. Learning Hierarchical Priors in VAEs. In Advances in Neural Information Processing Systems 32, 2019b.
|
| 259 |
+
|
| 260 |
+
Lars Maaløe, Marco Fraccaro, Valentin Lievin, and Ole Winther. BIVA: A Very Deep Hierarchy ´ of Latent Variables for Generative Modeling. In Advances in Neural Information Processing Systems 32, 2019.
|
| 261 |
+
|
| 262 |
+
George Papamakarios, Theo Pavlakou, and Iain Murray. Masked Autoregressive Flow for Density Estimation. In Advances in Neural Information Processing Systems 30, 2017.
|
| 263 |
+
|
| 264 |
+
Danilo Jimenez Rezende and Fabio Viola. Taming VAEs. In arXiv preprint arXiv:1810.00597, 2018.
|
| 265 |
+
|
| 266 |
+
Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic Backpropagation and Approximate Inference in Deep Generative Models. In Proceedings of the 31st International Conference on Machine Learning , ICML, 2014.
|
| 267 |
+
|
| 268 |
+
Jason Tyler Rolfe. Discrete Variational Autoencoders. In 5th International Conference on Learning Representations, ICLR, 2017.
|
| 269 |
+
|
| 270 |
+
Walter Rudin. Real and complex analysis. Tata McGraw-hill education, 2006.
|
| 271 |
+
|
| 272 |
+
Tim Salimans, Diederik Kingma, and Max Welling. Markov Chain Monte Carlo and Variational Inference: Bridging the Gap. In Proceedings of the 32nd International Conference on Machine Learning, ICML, 2015.
|
| 273 |
+
|
| 274 |
+
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, 2017.
|
| 275 |
+
|
| 276 |
+
Casper Kaae Sønderby, Tapani Raiko, Lars Maaløe, Søren Kaae Sønderby, and Ole Winther. Ladder Variational Autoencoders. In Advances in Neural Information Processing Systems 29, 2016.
|
| 277 |
+
|
| 278 |
+
Jakub Tomczak and Max Welling. VAE with a VampPrior. In Proceedings of the Twenty-First International Conference on Artificial Intelligence and Statistics, volume 84 of Proceedings of Machine Learning Research. PMLR, 2018.
|
| 279 |
+
|
| 280 |
+
Aaron van den Oord, Nal Kalchbrenner, Lasse Espeholt, Koray Kavukcuoglu, Oriol Vinyals, and ¨ Alex Graves. Conditional Image Generation with PixelCNN Decoders. In Advances in Neural Information Processing Systems 29, 2016a.
|
| 281 |
+
|
| 282 |
+
Aaron van den Oord, Nal Kalchbrenner, and Koray Kavukcuoglu. Pixel Recurrent Neural Networks. ¨ In Proceedings of the 33nd International Conference on Machine Learning, ICML, 2016b.
|
| 283 |
+
|
| 284 |
+
Stefan Webb, Adam Golinski, Rob Zinkov, N Siddharth, Tom Rainforth, Yee Whye Teh, and Frank Wood. Faithful inversion of generative models for effective amortized inference. In Advances in Neural Information Processing Systems, pp. 3070–3080, 2018.
|
| 285 |
+
|
| 286 |
+
Florian Wenzel, Kevin Roth, Bastiaan S Veeling, Jakub Swiatkowski, Linh Tran, Stephan Mandt, ´ Jasper Snoek, Tim Salimans, Rodolphe Jenatton, and Sebastian Nowozin. How Good is the Bayes Posterior in Deep Neural Networks Really? arXiv preprint arXiv:2002.02405, 2020.
|
| 287 |
+
|
| 288 |
+
Andrew Gordon Wilson and Pavel Izmailov. Bayesian Deep Learning and a Probabilistic Perspective of Generalization. arXiv preprint arXiv:2002.08791, 2020.
|
md/train/fATZNtA1-V0/fATZNtA1-V0.md
ADDED
|
@@ -0,0 +1,251 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Neural-PIL: Neural Pre-Integrated Lighting for Reflectance Decomposition
|
| 2 |
+
|
| 3 |
+
Mark Boss University of Tübingen
|
| 4 |
+
|
| 5 |
+
Varun Jampani Google Research
|
| 6 |
+
|
| 7 |
+
Raphael Braun University of Tübingen
|
| 8 |
+
|
| 9 |
+
Ce Liu∗ Microsoft Azure AI
|
| 10 |
+
|
| 11 |
+
Jonathan T. Barron Google Research
|
| 12 |
+
|
| 13 |
+
Hendrik P. A. Lensch University of Tübingen
|
| 14 |
+
|
| 15 |
+
# Abstract
|
| 16 |
+
|
| 17 |
+
Decomposing a scene into its shape, reflectance and illumination is a fundamental problem in computer vision and graphics. Neural approaches such as NeRF have achieved remarkable success in view synthesis, but do not explicitly perform decomposition and instead operate exclusively on radiance (the product of reflectance and illumination). Extensions to NeRF, such as NeRD, can perform decomposition but struggle to accurately recover detailed illumination, thereby significantly limiting realism. We propose a novel reflectance decomposition network that can estimate shape, BRDF and per-image illumination given a set of object images captured under varying illumination. Our key technique is a novel illumination integration network called Neural-PIL that replaces a costly illumination integral operation in the rendering with a simple network query. In addition, we also learn deep low-dimensional priors on BRDF and illumination representations using novel smooth manifold auto-encoders. Our decompositions can result in considerably better BRDF and light estimates enabling more accurate novel view-synthesis and relighting compared to prior art. Project page: https://markboss.me/publication/2021-neural-pil/
|
| 18 |
+
|
| 19 |
+
# 1 Introduction
|
| 20 |
+
|
| 21 |
+
Inverse rendering is the task of decomposing a scene into its underlying physical properties, such as geometry and materials. Recovering these properties is useful for several vision and graphics applications such as view synthesis [10, 11, 51, 57], relighting [4, 10, 11, 23, 24, 38, 51, 58], and object insertion [7, 21, 38]. In this work, we aim to recover the 3D shape and spatiallyvarying bidirectional reflectance distribution function (SVBRDF) of an object imaged under different illumination conditions, as shown in Fig. 1. Estimating shape, illumination, and SVBRDF from 2D images is a highly ill-posed problem, as an observed pixel may appear dark either due to a dark surface material, or due to the incident light at that surface being reduced or absent.
|
| 22 |
+
|
| 23 |
+
Our approach follows the recent success of coordinate-based scene representation networks [14, 40, 43, 44, 46, 49] in representing 3D scenes for high-quality view-synthesis [44, 49]. These models decompose the scene into models of shape and radiance (emitted light), thereby enabling view synthesis. However, performing complete inverse rendering requires that radiance is decomposed further, into illumination and material appearances (SVBRDF) [6, 11, 51, 63]. A key component in learning these neural SVBRDF decomposition networks is the differentiable rendering [10, 11, 63] that generates images and gradients for the estimated lighting and SVBRDF parameters. These methods leverage traditional rendering techniques within modern deep learning frameworks to enable backpropagation. This is often expensive, as rendering requires computing integrals over the incoming light at each 3D location in the scene. As a remedy, recent works [11, 63] approximate the incident light by spherical Gaussians (SG), thereby accelerating the illumination integration. However, these SG representations lack the capacity required to model or recover the shape and material properties of highly reflective objects or images in complex natural environments.
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: Problem setting. Our neural-PIL based technique decomposes images observed under unknown illumination into high-quality BRDF, shape and illuminations. This allows us to then synthesize novel views (targets shown in insets) and perform relighting or illumination transfer.
|
| 27 |
+
|
| 28 |
+
In this work, we aim to replace the costly illumination integration step within these rendering approaches with a learned network. Inspired by the real-time graphics literature on image-based lighting [28], we propose a novel pre-integrated lighting (PIL) network that converts the illumination integration process used in rendering into a simple network query. Our neural-PIL takes as input a latent vector representation for the environment map, the surface roughness, and an incident ray direction, and from them predicts an integrated illumination estimate. This query-based approach for light integration results in efficient rendering and thereby simplifies and accelerates rendering and optimization. This neural light representation is also significantly more expressive than the more commonly used SG representation, thereby enabling higher-fidelity renderings. The architecture of our neural-PIL uses conditional multi-layer perceptrons (MLP) with FiLM layers [12]. Fig. 2 illustrates this illumination pre-integration for different surface roughness levels.
|
| 29 |
+
|
| 30 |
+
In addition, we also present a smooth manifold auto-encoder (SMAE), based on interpolating auto-encoders [5], that can learn effective low-dimensional representations of light and BRDFs. This learned low-dimensional space serves as a strong regularizer or prior for constraining the solution space of BRDFs and illumination. These constraints are critical, due to the ill-posedness of our problem setting. The smoothness of this manifold enables stable and effective gradientbased optimization of BRDF and light parameters. The neural-PIL, light-SMAE, and BRDF-SMAE networks are pre-trained on a dataset with high-quality environment maps (illumination) and materials (BRDFs). We integrate these component networks into our decomposition framework, in which we optimize a 3D neural volume with shape and SVBRDF while also optimizing per-image illuminations.
|
| 31 |
+
|
| 32 |
+
We perform an empirical analysis on synthetic datasets, along with qualitative and quantitative visual results on real-world datasets. We demonstrate that our decomposition network using our neural-PIL can estimate more accurate shape and material properties compared to prior art. The 3D assets with material properties produced by our model can be used to generate high-quality relighting and view-synthesis results with finer details compared to existing approaches.
|
| 33 |
+
|
| 34 |
+
# 2 Related Work
|
| 35 |
+
|
| 36 |
+
Coordinate-based MLPs allow spatial information to be stored within the weights of a neural network, thereby allowing the retrieval of information solely by querying coordinates [14, 43, 46, 52]. These methods have been combined with neural volume rendering [40] to enable photorealistic results on novel view synthesis, well-exemplified by NeRF [44]. In NeRF, a coordinate-based model is used to model a field of volumetric density and color, and renderings are produced by ray-marching through that neural volume. Though NeRF is capable of photorealistic renderings, it has many limitations that have been explored by recent work, such as: no relighting capabilities [6, 11, 42, 51, 63], long training times [39, 54], long inference times [11, 25, 31, 39, 60], extraction of 3D geometry and materials [11], and generalization [12, 54, 64]. This work addresses some of these challenges that enables relighting, extracts a conventional 3D geometry and material estimate, and enables real-time rendering (as our 3D assets are compatible with existing real-time rendering engines). The concurrent works of NeRD [11], NeRV [51] and PhySG [63] are most clostly related to ours. These methods decomposes the scene into shape and analytical SVBRDF parameters. However, NeRV requires known illumination, and NeRD and PhySG employ a spherical Gaussian (SG) model, which is not capable of modeling detailed illumination patterns.
|
| 37 |
+
|
| 38 |
+

|
| 39 |
+
Figure 2: Pre-integrated lighting. As the roughness of the material increases, the reflected radiance depends on a larger region of the environment map. Brute-force integrals over the environment map are expensive, hence we propose a coordinate-based MLP that is trained to directly output the integrated illumination values conditioned on the surface roughness and view direction.
|
| 40 |
+
|
| 41 |
+
BRDF estimation is a challenging research problem that aims to estimate the appearance of a physical material. For the highest accuracy results, measurements are performed under controlled laboratory conditions with known view and light positions [3, 9, 32, 33, 34], but this does not allow for the on-site capture of materials. Casual capture methods aim to solve this constraint by only requiring a camera, and sometimes a known light source. Often, machine learning techniques are leveraged to reduce the ambiguity through the use of data-drive priors and large datasets of BRDFs. Additional constraints from planar surfaces viewed under camera flash illumination are considered for single-shot [1, 16, 26, 36, 47], few-shot [1] or multi-shot [2, 9, 17, 18, 20] estimation. This casual setup can be extended to estimating the BRDF and shape of objects [6, 7, 8, 10, 30, 45, 47, 62] or scenes [38, 48]. Most of these methods are based on known active illumination. A limited number of light sources — most often a single one — are assumed to be responsible for the majority of illumination in a scene. Relying on only natural, uncontrolled illumination adds several additional challenges due to the drastically increased ambiguity across shape, illumination and BRDFs. Often these challenges are reduced by keeping the specular albedo non-spatially-varying, or by removing it entirely [35, 59, 63]. Other approaches require temporal traces and limit the casual capture setup [19, 56].
|
| 42 |
+
|
| 43 |
+
Illumination estimation from a single image is an inherently challenging problem. The task is inherently linked to BRDF estimation, as illumination affects appearance and is only indirectly observable from its interactions with surface materials. These two tasks are often solved in conjunction, sometimes by decomposing a single object into shape, reflectance, and a global set of spherical Gaussians (SGs) [11, 63]. Chen et al. [13] leverage a deep prior of environment maps with homogeneous materials, using an invertible neural BRDF model. Li et al. [38] decompose an entire scene into a simplified BRDF model with hemispherical SGs per point in the scene. The image of the environment in the background may be incorporated into prediction, shifting the problem to completion of the HDR environment map from sparse observations [21, 50, 55]. We not only learn a deep prior but a rendering aware network which is capable of integrating the environment illumination for a specific surface roughness enabling rendering the entire hemisphere of incoming light with a single evaluation.
|
| 44 |
+
|
| 45 |
+
# 3 Method
|
| 46 |
+
|
| 47 |
+
Given an image collection of an object captured under varying illumination conditions and camera viewpoints, we aim to jointly estimate the object’s 3D shape and spatially-varying BRDF, as well as the illumination conditions of each image. Our input consists of a set of $q$ images with $s$ pixels each: $C _ { j } \in \mathbb { R } ^ { s \times 3 } ; j \in \{ 1 , \dots , q \}$ along with per-pixel masks $M _ { j } \in \{ 0 , 1 \} ^ { s \times 1 }$ indicating which pixels belong to the object. Our goal is to learn a neural 3D volume $\nu$ where, at each point $\pmb { x } \in \mathbb { R } ^ { 3 }$ , we estimate the BRDF parameters for the Cook-Torrance model [15] $\mathbf { b } \in \mathbb { R } ^ { 7 }$ (diffuse $b _ { d } \in \mathbb { R } ^ { 3 }$ , specular $b _ { s } ~ \in \mathbb { R } ^ { 3 }$ , roughness $b _ { r } \in \mathbb { R }$ ), unit-length surface normal $\textbf { \em n } \in \mathbb { R } ^ { 3 }$ and optical density $\sigma \in \mathbb { R }$ . In addition, we also estimate latent vectors representing per-image illumination $z ^ { l } \in \mathbb { R } ^ { 1 2 \bar { 8 } }$ . This problem statement corresponds to the practical application of recovering a 3D model of some real-world object (for e.g., a statue or landmark) that has been photographed by different people at different times.
|
| 48 |
+
|
| 49 |
+
# 3.1 Preliminaries
|
| 50 |
+
|
| 51 |
+
Brief overview of neural radiance fields (NeRF). Our method is based on NeRF [44] which creates a neural volume for novel view synthesis using two Multi-Layer-Perceptrons (MLPs). The first MLP learns a coarse representation, which samples the 3D volume in a fixed sampling pattern, and the second MLP uses this knowledge to sample the volume in high-density areas at a finer resolution. The output of the MLP is a view-dependent color $\boldsymbol { c } \in \mathbb { R } ^ { 3 }$ and optical density $\sigma \in \mathbb { R }$ for each given 3D location $\pmb { x } \in \mathbb { R } ^ { 3 }$ and view direction $\ b { d } \in \mathbb { R } ^ { 3 }$ . In order to render the output color $\hat { \pmb { c } } \in \mathbb { R } ^ { 3 }$ for a camera ray $r ( t ) = o + t d$ , with ray origin $\mathbf { o } \in \mathbb { R } ^ { 3 }$ and view direction $^ d$ , we approximate (via numerical quadrature) the integral $\begin{array} { r } { \hat { c } ( \pmb { r } ) = \int _ { t _ { n } } ^ { t _ { f } } T ( t ) \sigma ( t ) \pmb { c } ( t ) d t } \end{array}$ with $\begin{array} { r } { T ( t ) = \exp ( - \int _ { t _ { n } } ^ { t } \sigma ( t ) d t ) } \end{array}$ , using the near and far bounds of the ray $t _ { n }$ and $t _ { f }$ respectively [44].
|
| 52 |
+
|
| 53 |
+
Image formation and image-based lighting. NeRF directly models view-dependent color $\hat { c }$ at each 3D location. Thus, a simple image formation process that integrates the color information along camera rays is sufficient to render images. In contrast, we want to explicitly estimate an object material decomposition at each 3D location. We therefore must use a more explicit rendering formulation that relates image formation to BRDFs and illumination. The rendering equation [27] estimates the radiance $L _ { o } ~ \in \mathbb { R } ^ { 3 }$ at $_ { \textbf { \em x } }$ along the outgoing view direction $\omega _ { o } ~ \in ~ \mathbb { R } ^ { 3 }$ $( \omega _ { o } ~ = ~ - d )$ : $\begin{array} { r } { L _ { o } ( \pmb { x } , \pmb { \omega } _ { o } ) = \int _ { \Omega } f _ { r } ( \pmb { x } , \pmb { \omega } _ { i } , \pmb { \omega } _ { o } ; \pmb { b } ) L _ { i } ( \pmb { x } , \pmb { \omega } _ { i } ) ( \pmb { \omega } _ { i } \cdot \pmb { n } ) d \omega _ { i } } \end{array}$ , where $f _ { r }$ is the BRDF evaluation, $L _ { i } \in \mathbb { R } ^ { 3 }$ is incoming light, and $\boldsymbol { \omega } _ { i } \in \mathbb { R } ^ { 3 }$ is the incoming light direction. Using this single bounce rendering formulation, and ignoring exposure variation and tone-mapping, $L _ { o }$ is equivalent to NeRF’s color $\hat { c }$ . The formulation can be split into diffuse and specular components:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
L _ { o } ( \pmb { x } , \omega _ { o } ) = \underbrace { \frac { b _ { d } } { \pi } \int _ { \Omega } L _ { i } ( \pmb { x } , \omega _ { i } ) ( \omega _ { i } \cdot \pmb { n } ) d \omega _ { i } } _ { \mathrm { d i f f u s e } } + \underbrace { \int _ { \Omega } f _ { s } ( \pmb { x } , \omega _ { i } , \omega _ { o } ; \pmb { b } _ { s } , b _ { r } ) L _ { i } ( \pmb { x } , \omega _ { i } ) ( \omega _ { i } \cdot \pmb { n } ) d \omega _ { i } } _ { \mathrm { s p e c u l a r } }
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
where $f _ { s }$ now only represents the specular portion of the BRDF evaluation. Following Karis et al. [28], several parts of this integration can be pre-computed [29]:
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
L _ { o } ( \pmb { x } , \omega _ { o } ) \approx \underbrace { ( { b _ { d } } / \pi ) \tilde { L } _ { i } ( n , 1 ) } _ { \mathrm { d i f f u s e } } + \underbrace { b _ { s } ( F _ { 0 } ( \omega _ { o } , n ) B _ { 0 } ( \omega _ { o } \cdot n , b _ { r } ) + B _ { 1 } ( \omega _ { o } \cdot n , b _ { r } ) ) \tilde { L } _ { i } ( \omega _ { r } , b _ { r } ) } _ { \mathrm { s p e c u l a r } }
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
The illumination is now pre-integrated as: $\begin{array} { r } { \tilde { L } _ { i } ( \omega _ { r } , b _ { r } ) = \int _ { \Omega } D ( b _ { r } , \omega _ { i } , \omega _ { r } ) L _ { i } ( \pmb { x } , \omega _ { i } ) d \omega _ { i } } \end{array}$ which only depends on the mirrored view direction $\omega _ { r }$ (which subsumes the surface normal $\textbf { \em n }$ ) and the roughness $b _ { r }$ , where $D$ describes the microfacet distribution [53]. This light pre-integration is illustrated in Fig. 2. Note that the same pre-integrated $\tilde { L } _ { i } ( \omega _ { r } , b _ { r } )$ is queried twice: the diffuse part captures the entire hemisphere and therefore is parameterized by the surface normal $\mathbf { \boldsymbol { n } } \in \mathbb { R } ^ { 3 }$ and a diffuse roughness of 1. The specular part looks up $\tilde { L } _ { i } ( \omega _ { r } , b _ { r } )$ for the reflected view direction $\omega _ { r } \in \mathbb { R } ^ { 3 }$ and the specular roughness $b _ { r }$ . While the pre-integration already considers the microfacet distribution $D$ , one must also account for shadowing, masking, and the Fresnel term. As shown in Karis et al. [28], these remaining parts can be pre-computed into two 2D lookup textures (LUT) $B _ { 0 }$ and $B _ { 1 }$ indexed by $( { \boldsymbol \omega } _ { o } \cdot { \boldsymbol n } )$ and the roughness $b _ { r }$ . These are combined with the Fresnel term at normal incidence $\bar { F _ { 0 } } ( \omega _ { o } , \pmb { n } ) = ( 1 - \omega _ { o } \cdot \bar { \pmb { h } } ) ^ { 5 }$ with $\pmb { h } = \| \pmb { \omega } _ { i } + \pmb { \omega } _ { o } \|$ .
|
| 66 |
+
|
| 67 |
+
This pre-integration approach replaces the complex integration during shading with a set of simple additions and multiplications. We have integrated the core idea of this approach into an efficient differentiable neural rendering framework, which allows for the optimization of geometry, BRDF, and illumination simultaneously via standard backpropagation. We further reduce the computational complexity by mimicking the pre-integration of $\tilde { L } _ { i } ( \omega _ { r } , b _ { r } )$ with a simple query through our NeuralPIL that operates directly on a neural representation of the illumination, as we will now explain.
|
| 68 |
+
|
| 69 |
+
# 3.2 Decomposition with Neural-PIL
|
| 70 |
+
|
| 71 |
+
Fig. 3 shows the neural decomposition architecture which closely follows the architectures of NeRF [44] and NeRD [11], but with some key differences. The coarse network learns a view and illumination-dependent color whereas the fine network decomposes the scene into BRDF parameters.
|
| 72 |
+
|
| 73 |
+

|
| 74 |
+
Figure 3: Decomposition with Neural-PIL architecture. (a) Similar to NeRF-W[42] our coarse network uses a latent illumination estimate to predict a view-dependent color and density. (b) Pre-trained networks restrict the possible BRDF representation (BRDF-SMAE) and the incident lighting (PIL) to lower-dimensional spaces. A single evaluation of Neural-PIL returns a pre-filtered illumination cone according to surface roughness. Using that, the BRDF estimate, and a surface normal (the unit-norm gradient of our density estimate), we render the shaded color $^ c$ .
|
| 75 |
+
|
| 76 |
+

|
| 77 |
+
|
| 78 |
+
Coarse network. Like in NeRF [44], the aim of the coarse network is to obtain rough point density that helps in finer sampling for the following decomposition network. As illustrated in Figure 3a, the coarse network takes 3D location $_ { \textbf { \em x } }$ , view direction $\omega _ { o }$ and illumination embedding $z ^ { l }$ as input and predicts point density $\sigma$ and color $^ c$ at $_ { \textbf { \em x } }$ . In contrast to NeRF, which estimates view-conditioned colors, we estimate both view and illumination conditioned colors, as our input images can be captured under varying illumination. Refer to the supplement for architecture details.
|
| 79 |
+
|
| 80 |
+
Decomposition network. The decomposition network estimates density $\sigma$ and BRDF embedding $z ^ { b } \in \mathbb { R } ^ { \bar { 4 } }$ at each 3D location $_ { \textbf { \em x } }$ in the implicit volume. As illustrated in Figure 3b, the conditional network in the coarse network is replaced by explicit rendering in the decomposition network. There are two key innovations in the decomposition network: 1) Use a novel pre-integrated light (PIL) network that results in efficient rendering while also representing the illumination with high fidelity. 2) We learn smooth low-dimensional manifolds to represent illumination and BRDF parameters, which serve as strong priors. We will now explain our rendering process, the Neural-PIL, and the smooth manifold auto-encoders (SMAE).
|
| 81 |
+
|
| 82 |
+
Rendering process. For rendering, we use the rendering formulation in Equation 2. We estimate normal $\textbf { \em n }$ at $_ { \textbf { \em x } }$ by computing the gradient $\nabla \sigma _ { x }$ of the density w.r.t. the input position (by passing gradients through the decomposition network). We also convert the BRDF embedding $z ^ { b }$ into BRDF parameters $^ { b }$ with our BRDF-SMAE. Unlike NeRF [44], which integrates sample colors along the camera ray, we first compute the expected termination of each ray (similar to depth map) with the sample densities along the camera ray, and then do the rendering only at that point along each camera ray. At the ray termination positions, we compute the integrated illumination $\tilde { L } _ { i } ( \omega _ { r } , b _ { r } )$ and use Equation 2 for rendering with the estimated BRDF $^ { b }$ and normal $\textbf { \em n }$ .
|
| 83 |
+
|
| 84 |
+
Neural-PIL. The integration of the incoming light is traditionally approximated by Monte Carlo sampling, in which illumination contributions from many directions are numerically integrated. The computation of the pre-integrated $\tilde { L } _ { i } ( \omega _ { r } , b _ { r } )$ also involves either this costly numerical accumulation, or a convolution performed on the complete environment map — though neither approach is practical within a differential rendering engine. We therefore learn a network that performs this light preintegration, thereby converting the costly integral computation into a simple network query. The architecture of the Neural-PIL is visualized in Fig. 4. The Neural-PIL takes as input the illumination embedding $z ^ { l }$ , the incoming light direction $\omega _ { r }$ and the roughness $b _ { r }$ at a point, and directly predicts the pre-integrated light $\tilde { L } _ { i } ( \omega _ { r } , b _ { r } )$ . The aim of the Neural-PIL is to first decode the illumination along the incoming mirror direction $\omega _ { r }$ from the given embedding $z ^ { l }$ and then mimic the light pre-integration process for the surface roughness $b _ { r }$ . Following this general intuition, the Neural-PIL takes $\omega _ { r }$ as input, and we condition the first few layers of the network with illumination $z ^ { l }$ , and condition a later layer with roughness $b _ { r }$ . The first few layers are intended to decode all required illumination information for the given direction, and the later layers are intended to perform light integration conditioned on the material roughness.
|
| 85 |
+
|
| 86 |
+

|
| 87 |
+
Figure 4: Neural-PIL. A coordinate-based MLP returns the pre-integrated radiance for the query direction, where roughness determines the integration footprint.
|
| 88 |
+
|
| 89 |
+

|
| 90 |
+
Figure 5: Smooth manifold auto-encoder. By imposing specific losses on interpolations between input samples, our Smooth Manifold Autoencoder encourages a smooth embedding space.
|
| 91 |
+
|
| 92 |
+
For the Neural-PIL design, we leverage a pi-GAN-like [12] architecture with FiLM-SIREN layers. Each FILM-SIREN layer [12] takes the modulating parameters (a scalar $\lambda _ { 0 }$ and two vectors $\beta$ and $\gamma )$ to modulate the output $\textbf { { y } }$ of the earlier linear layer followed by sine computation as follows: $\phi ( \pmb { y } ) = \sin ( \lambda _ { 0 } \gamma \odot \pmb { y } + \beta )$ , where $\odot$ denotes a Hadamard product. In our Neural-PIL, we employ two mapping networks to predict modulating parameters $( \gamma , \beta )$ for the FiLM-SIREN layers. The first mapping network generates the modulating parameters for the first layers from the illumination embedding $\bar { z } ^ { l }$ , while the second one for the penultimate layer from the given roughness $b _ { r }$ .
|
| 93 |
+
|
| 94 |
+
In addition to converting a costly light integration process in the rendering into a simple network query, our Neural-PIL has another key advantage. State-of-the-art differentiable rendering frameworks [11, 22, 38, 63] that work with BRDFs use either spherical Gaussian (SG) or spherical harmonic (SH) light representations, which both suffer from lack of fine details. Although one could represent fine illumination details with a large number of SG or SH bands, this parameter increase would also make the rendering prohibitively slow with high memory costs. In contrast, our Neural-PIL is an MLP that directly produces pre-integrated light required for the rendering. Our experiments also demonstrate that our Neural-PIL can represent finer details in illumination compared to SG representation (Sec. 4 - Fig. 6). See the supplementary for more Neural-PIL architecture details.
|
| 95 |
+
|
| 96 |
+
Smooth manifold auto-encoder (SMAE). Since jointly estimating 3D shape, materials and lighting is a highly underconstrained problem, in order to converge to plausible solutions, we must regularize optimization towards likely illuminations and BRDFs. For this, we learn low-dimensional smooth manifolds that capture the data distribution of BRDFs and illuminations. In addition to acting as strong priors, optimizing on smooth manifolds (as opposed to directly optimizing on standard BRDF space, which need not be smooth) allows for more effective gradient-based optimization of reflectance decomposition for a given scene. Fig. 5 illustrates our SMAE that we use to learn separate low-dimensional manifolds to represent BRDF and illumination embeddings. Specifically, we use Interpolating Autoencoders [5] with several additional loss functions. The encoder network $E$ takes input $\pmb { p }$ (either BRDF or light environment map) and generates the latent embedding $_ { z }$ , which is then passed onto the decoder network $G$ that generates an input reconstruction $\pmb { p } ^ { \prime }$ . We then randomly sample two latent vectors from the mini-batch: $z _ { a }$ and $z _ { b }$ ; followed by sampling $m \in \mathbb { N }$ linearly interpolated embeddings that are uniformly spaced between $z _ { a }$ and $z _ { b }$ : $\{ z _ { n } ^ { \prime } \} | n = 1 , 2 , \ldots , m$ . We pass each of these interpolated latents $z _ { n } ^ { \prime }$ through the decoder $G$ and the encoder $E$ to obtain $\hat { p } _ { n } ^ { \prime }$ and $\hat { z } _ { n } ^ { \prime }$ , respectively. Using the four losses depicted in Fig. 5 the encoder and decoder networks are trained jointly. One is the standard reconstruction loss $\mathcal { L } _ { r }$ between input $\pmb { p }$ and reconstruction $\pmb { p } ^ { \prime }$ . In addition, we add a discriminator network on $\hat { p } _ { n } ^ { \prime }$ and use the standard adversarial loss ${ \mathcal { L } } _ { a }$ used in LSGAN [41], which ensures that the interpolated latent vectors can generate plausible data. We enforce a bijective mapping of the encoder and the decoder with a cyclic loss $\mathcal { L } _ { c }$ which is the $L _ { 2 }$ -loss between the interpolated latents $\{ z _ { n } ^ { \prime } \}$ and their re-estimated counterparts $\left\{ \hat { z } _ { n } ^ { \prime } \right\}$ . Lastly, to ensure that the learned embedding space is smooth, we impose a smoothness loss $\mathcal { L } _ { s }$ on the gradient of decoder
|
| 97 |
+
|
| 98 |
+
$G$ w.r.t. the interpolating scalar value $\alpha$ : $\begin{array} { r } { \mathcal { L } _ { s } = 1 / m \sum _ { n } ( \nabla _ { \alpha } G ( z _ { n } ^ { \prime } ) ) ^ { 2 } } \end{array}$ . The total loss to train SMAE is a combination of the 4 losses: $\mathscr { L } = \mathscr { L } _ { r } + \lambda _ { 1 } \mathscr { L } _ { a } + \lambda _ { 2 } \mathscr { L } _ { c } + \lambda _ { 3 } \mathscr { L } _ { s }$ .
|
| 99 |
+
|
| 100 |
+
Despite being only 7-dimensional, the space of the Cook-Torrence BRDF representation [15] that we use is too unconstrained for our task, and imposes strong correlations between the diffuse and specular terms of real-world materials. We therefore train a BRDF-SMAE with an MLP encoder and decoder that maps these 7D parameters into 4D latent embeddings $z ^ { b } \in \mathbb { R } ^ { 4 }$ using a dataset of real-world BRDF material collections [10]. Similarly, real-world illuminations exhibit significant statistical regularities: lights are more likely to be tinted blue or yellow, and brighter light is more likely to coming from above than below. To capture this regularity, we train a Light-SMAE with CNN encoder and decoder on a dataset of 320 environment maps from [61]. We then map the $1 2 8 \times 2 5 6$ 2D environment maps onto a 128-dimensional smooth latent space, $z ^ { l } \in \mathbb { R } ^ { 1 2 8 }$ . We provide more network and training details for BRDF-SMAE and Light-SMAE in the supplementary.
|
| 101 |
+
|
| 102 |
+
Training. Since we have several networks in our decomposition learning pipeline, we will briefly explain the overall training protocol here with more details in the supplementary. We first train Light-SMAE and BRDF-SMAE with a dataset of environment maps and BRDFs respectively. The Neural-PIL network is then trained with the manifold created by the frozen Light-SAME encoder. This separation is mainly done to ease the memory requirements of training both networks jointly. With the frozen BRDF-SMAE’s decoder in the decomposition network and with Neural-PIL in the rendering step, we jointly optimize both the coarse network and the decomposition network for a given set of scene images. For stability, we only optimize the illumination embedding $z ^ { l }$ via decomposition network and we do not backpropagate the loss signal onto illumination in the coarse network. More training details can be found in the supplement.
|
| 103 |
+
|
| 104 |
+
# 4 Experiments
|
| 105 |
+
|
| 106 |
+
We evaluate our approach w.r.t. different baselines on the aspects of BRDF and light estimation, view synthesis, and relighting.
|
| 107 |
+
|
| 108 |
+
Baselines. The closest work to ours is NeRD [11] which forms our primary comparison across different evaluations. To our knowledge, there exists no other published work that tackles the same problem of estimating shape, illumination and BRDF from images of varying illumination. For view synthesis, we also compare with NeRF [44]. For BRDF evaluations, we also compare with Li et al. [37] which does BRDF decomposition from a single image. In addition, we combine Li et al. [37] with NeRF [44] to create a baseline that is closer to our problem setting.
|
| 109 |
+
|
| 110 |
+
Datasets. To enable the comparisons with NeRD [11], we use the publicly released dataset used in [11] which provides 3 synthetic (Chair, Globe, Car) and 4 real-world
|
| 111 |
+
|
| 112 |
+

|
| 113 |
+
Figure 6: Neural-PIL vs. spherical Gaussian (SG) vs. Monte-Carlo (MC) integration renderings. With known geometry and reflectance, we optimize using MC integration for the direct illumination, SGs as well as our latent illumination via Neural-PIL. This figure shows final renderings with the optimized light parameters, while the recovered illumination is shown in the insets. Despite Neural-PIL having fewer parameters, it is able to recover more detailed environment maps and thereby produce accurate renderings.
|
| 114 |
+
|
| 115 |
+
scenes. Two real-world datasets consist of multi-view captures with fixed, unknown illumination (Cape), relatively varying illumination (Head) and two others where the illumination varies with each image (Gnome, MotherChild). In addition, we also present view synthesis results on datasets (Ship, Chair, Lego) used in NeRF [44].
|
| 116 |
+
|
| 117 |
+
Fildelity of Neural-PIL. Since Neural-PIL forms the key component of our decomposition framework, we evaluate its learned light representation against a more commonly used spherical Gaussians (SG) representation. Additionally, we add a baseline which directly optimizes an environment map using Monte-Carlo (MC) integration. We render a simple metallic sphere using an unseen environment as shown in Fig. 6, with two different roughness levels 0.2 and 0.5. Assuming known roughness and shape, we optimize for SG illumination using the SG-based differentiable rendering used in NeRD [11]. Similarly, we optimize the latent illumination representation using our Neural-PIL-based renderer. For the MC baseline, we leverage BRDF importance sampling, which based on the surface roughness describes how the rays would likely scatter. Here, we cast 128 samples-per-pixel (spp) based on the BRDF towards the environment map with a resolution of $1 2 8 \times 2 5 6$ . The resulting estimated MC, SG illumination and Neural-PIL illuminations are shows in Fig. 6. Compared to the SG illumination model with 24 lobes and 168 parameters, our recovered illumination vector $z ^ { l }$ with only 128 dimensions captures more details, especially in the high-frequency light panels. This leads to a significantly reduced rendering error for both roughness values even though the illumination prediction is more ambiguous for rougher materials. While the MC integration could easily recover detailed highlights, the remaining areas are not recovered well. Besides the improved quality, Neural-PIL based rendering is also much faster. Rendering million samples with our Neural-PIL network takes just $1 . 8 6 \mathrm { m s }$ compared to $2 1 0 \mathrm { m s }$ rendering with 24 SGs. Table 1 shows average PSNR on 6 rendered spheres with more visual results similar to Fig. 6 in the supplements. Our method outperforms both baselines in reconstruction quality.
|
| 118 |
+
|
| 119 |
+

|
| 120 |
+
Figure 7: Visual comparisons. (a) Our model produces more accurate BRDF and illumination estimates, which results in more faithful rendering results. (b) To evaluate view synthesis and relighting we keep the camera and light fixed (col 2), then move the camera (col 3), and then adjust the lighting (col 4). (c) Even when using a single illumination (the problem setting used by NeRF) our method produces shape estimates with fewer artifacts and more detail than both NeRF or NeRD.
|
| 121 |
+
|
| 122 |
+
Ablation study. To showcase the effectiveness of our novel additions, we perform an ablation of the BRDF-SMAE. Table 2 shows the influence of the BRDF-SMAE on material estimation. These are the PSNR values on the 3 synthetic scenes under varying illumination. It is clear from the table that, especially in estimating the specular parameter, using BRDF-SMAE improves the results drastically. As this parameter is also tied to the diffuse color a degradation in performance is expected. The roughness parameter – even though it is uncorrelated to diffuse and specular – is also improved most likely due to improved color parameters. For the ablation of Neural PIL network, one can refer to NeRD [11] as a baseline that neither uses BRDF-SMAE nor Neural PIL. PSNR metrics in Table 3a shows that our method can result in better decomposition compared to [11].
|
| 123 |
+
|
| 124 |
+
BRDF evaluations. Following the results in NeRD [11], Table 3a shows the BRDF estimation metrics for different techniques computed on the scenes Globe, Car and Chair. When compared with NeRD, our approach resulted in better diffuse and roughness parameters. Only the prediction of the specular parameter is worse compared to NeRD. This may be due to NeRD’s basecolor-metallic parameterization, which can reduce some ambiguity but also limits the space of expressible materials. A visual comparison is shown in Fig. 7a demonstrating clear visual improvements w.r.t. [37]. One can observe higher frequency details in the environment map using our approach compared to NeRD and the final renderings also show that our result is closer to GT rendering (top-right). Refer to the supplementary material for more visual results.
|
| 125 |
+
|
| 126 |
+
Table 1: Better illumination estimates with Neural-PIL. Average PSNR with 6 rendered spheres shows that Neural-PIL achieves better PSNR over the spherical Gaussian (SG) and MonteCarlo integration (MC) baselines. More accurate illuminations also enables improved BRDF decomposition and relighting.
|
| 127 |
+
|
| 128 |
+
<table><tr><td>Roughness</td><td>MC</td><td>SGs</td><td>Neural-PIL (Ours)</td></tr><tr><td>0.2</td><td>34.88</td><td>31.57</td><td>35.76</td></tr><tr><td>0.5</td><td>35.14</td><td>28.98</td><td>35.28</td></tr></table>
|
| 129 |
+
|
| 130 |
+
Table 2: Ablation study. Average PSNR of BRDF estimation on 3 synthetic scens under varying illumination demonstrates the positive influence of using the BRDF-SMAE to constrain the BRDF parameter space.
|
| 131 |
+
|
| 132 |
+
<table><tr><td>Parameter</td><td>w/o BRDF SMAE</td><td>Ours</td></tr><tr><td>Diffuse</td><td>11.87</td><td>20.22</td></tr><tr><td>Specular</td><td>9.24</td><td>16.84</td></tr><tr><td>Roughness</td><td>16.51</td><td>24.82</td></tr></table>
|
| 133 |
+
|
| 134 |
+
(a) BRDF decomposition
|
| 135 |
+
|
| 136 |
+
<table><tr><td>PSNR↑</td><td>[37]</td><td>[37]+[44]</td><td>[11]</td><td>Ours</td></tr><tr><td>Diffuse</td><td>1.06</td><td>1.15</td><td>18.24</td><td>20.22</td></tr><tr><td>Specular</td><td></td><td></td><td>25.70</td><td>16.84</td></tr><tr><td>Roughness</td><td>17.18</td><td>17.28</td><td>15.00</td><td>24.82</td></tr></table>
|
| 137 |
+
|
| 138 |
+
(b) View synthesis
|
| 139 |
+
|
| 140 |
+
<table><tr><td colspan="2">Synthetic Method PSNR↑SSIM↑PSNR↑SSIM↑</td><td colspan="2">Real-World</td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>NeRF</td><td>34.24</td><td>0.97</td><td>23.34 0.85</td></tr><tr><td>NeRD</td><td>30.07</td><td>0.95</td><td>23.86 0.88 0.90</td></tr><tr><td>Ours</td><td>30.08</td><td>0.95</td><td>23.95</td></tr></table>
|
| 141 |
+
|
| 142 |
+
(c) View synthesis and relighting
|
| 143 |
+
|
| 144 |
+
<table><tr><td colspan="2">Synthetic</td><td colspan="2">Real-World</td></tr><tr><td>MethodPSNR↑</td><td></td><td>SSIM↑1</td><td>PSNR↑SSIM↑</td></tr><tr><td>NeRF</td><td>21.05</td><td>0.89</td><td>20.11 0.87</td></tr><tr><td>NeRD</td><td>27.96</td><td>0.95 25.81</td><td>0.95</td></tr><tr><td>Ours</td><td>29.24</td><td>0.96 26.23</td><td>0.95</td></tr></table>
|
| 145 |
+
|
| 146 |
+
Table 3: Comparisons with baselines. (a) A comparison against methods for BRDF decomposition under unknown illuminations, where we see that our model performs well (consistent with our improved relighting performance). (b) An evaluation of view-synthesis (without relighting) under a single illumination, where our model performs well despite this not being our primary task. (c) Here, input images are taken under different illumination conditions, so joint relighting and view synthesis are required. Our model outperforms both baselines by a significant margin: NeRF (which is not intended to address this task) but also NeRD (which targets this same problem statement).
|
| 147 |
+
|
| 148 |
+
View synthesis and relighting. On the datasets with fixed illumination (Cape, NeRF-Ship, NeRFChair, NeRF-Lego), we can directly compare our renderings with existing novel view synthesis techniques (both NeRF [44] and NeRD [11] here). Table 3b shows novel view evaluation metrics on these datasets with fixed illumination. Results show that our results are better than NeRD showing the improved capture of view-dependent effects. NeRF still outperforms NeRD and our method in the synthetic fixed illumination setting, but is outperformed on the real-world fixed illumination dataset. However, the fixed illumination might in general limit the decomposition capabilities, as shadows do appear always at the same surface locations and therefore might not be correctly disentangled from the BRDF.
|
| 149 |
+
|
| 150 |
+
On datasets with varying illumination across images (Gnome, MotherChild, Chair, Car, Globe, Head), we need to do both view synthesis and relighting to generate novel unseen test views. Table 3c displays the results on these datasets. NeRF [44] can not do relighting and is included as a weak baseline. The results are significantly better than NeRD and shows that our method can more faithfully estimate the underlying parameters resulting in better relighting under novel illumination conditions.
|
| 151 |
+
|
| 152 |
+
Fig. 7b shows a couple of results with view synthesis and relighting. The renderings demonstrate realistic view synthesis including re-lighting. Fig. 7c shows novel view synthesis comparison with NeRF and NeRD on Cape scene captured with fixed illumination. Despite NeRF being a strong baseline it could not recover the complete surface due to the reflectiveness. On the other hand, our view synthesis results are more close to the GT on unseen views compared to both NeRF and NeRD.
|
| 153 |
+
|
| 154 |
+
# 5 Conclusion
|
| 155 |
+
|
| 156 |
+
We presented a novel reflectance decomposition technique that can estimate shape, per-image illumination and BRDF from images captured in unknown and varying illuminations. The key innovation is the neural-PIL network that can replace costly light integration during rendering with a simple network query resulting in a fast and practical differentiable rendering with high-fidelity illumination. In addition, we propose novel learning techniques with SMAEs that can learn effective low-dimensional smooth manifolds for both BRDF and light representations. Experiments on both synthetic and real-world scenes demonstrate superior decomposition results along with better novel view synthesis and relighting in comparison to prior art.
|
| 157 |
+
|
| 158 |
+
Limitations. While our techniques make significant strides in the areas of differentiable rendering as well as shape and material decomposition, several challenges still remain in this complex problem setting. Our approach can not handle inter-reflections. Concurrent works such as NeRV [51] are capable of handling inter-reflections and shadowing but only for known illumination. Due to the large ambiguity between the interplay of all effects, solving everything jointly is an extremely challenging problem. Another limitation of our method is that we can not guarantee to converge to the correct underlying BRDF, reflectance and illumination. Our loss is only photometric and, therefore, we find one solution which explains all input images, e.g., adding a new input image might converge to a different representation, as new effects are visible. Also, while our neural-PIL network is capable of producing higher frequency illumination with fewer parameters compared to standard representations such as SGs, mirror-like reflections are still not possible and therefore can limit the reconstruction quality when mirror-like surfaces are present in the scene.
|
| 159 |
+
|
| 160 |
+
Broader impact. As is generally the case in machine learning, biases in the data used during training may result in biases in the learned model. Our pre-trained networks for BRDFs and incident illumination serve as priors on materials and lighting conditions, and so any bias in the training data used for pre-training those models may result in bias in our estimations of materials and illumination. If the presented techniques were applied to human subjects (which we do not do here) the performance of the model might vary as a function of the subject’s skin color for skewed training distributions.
|
| 161 |
+
|
| 162 |
+
The purpose of our model is to better enable the creation of highly accurate 3D models from photographs, which could then be used as visual effects in film or television, or in video games. Currently, the creation or acquisition of 3D assets is largely the domain of specialized CGI artists. Improved tools for automating this task may lower the barrier to entry into these careers, which may be seen as harming job opportunities for artists already working in this area. Despite this, we are hopeful that the commoditization of tools for 3D model acquisition will have a net positive impact by allowing a wider range of people to automatically construct high-fidelity 3D models from their image collections.
|
| 163 |
+
|
| 164 |
+
# Acknowledgments and Disclosure of Funding
|
| 165 |
+
|
| 166 |
+
This work has been funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under Germany’s Excellence Strategy – EXC number 2064/1 – Project number 390727645 and SFB 1233, TP 02 - Project number 276693517. It was supported by the German Federal Ministry of Education and Research (BMBF): Tübingen AI Center, FKZ: 01IS18039A.
|
| 167 |
+
|
| 168 |
+
# References
|
| 169 |
+
|
| 170 |
+
[1] Miika Aittala, Timo Aila, and Jaakko Lehtinen. Reflectance modeling by neural texture synthesis. In ACM Transactions on Graphics (ToG), 2018.
|
| 171 |
+
[2] Rachel Albert, Dorian Yao Chan, Dan B. Goldman, and James F. O’Brian. Approximate svBRDF estimation from mobile phone video. In Eurographics Symposium on Rendering, 2018.
|
| 172 |
+
[3] Louis-Philippe Asselin, Denis Laurendeau, and Jean-François Lalonde. Deep SVBRDF estimation on real materials. In International Conference on 3D Vision (3DV), 2020.
|
| 173 |
+
[4] Jonathan T. Barron and Jitendra Malik. Shape, illumination, and reflectance from shading. In IEEE Transactions on Pattern Analysis and Machine Intelligence (PAMI), 2015.
|
| 174 |
+
[5] David Berthelot, Colin Raffel, Aurko Roy, and Ian Goodfellow. Understanding and improving interpolation in autoencoders via an adversarial regularizer. International Conference on Learning Representations (ICLR), 2019.
|
| 175 |
+
[6] Sai Bi, Zexiang Xu, Pratul Srinivasan, Ben Mildenhall, Kalyan Sunkavalli, Miloš Hašan, Yannick Hold-Geoffroy, David Kriegman, and Ravi Ramamoorthi. Neural reflectance fields for appearance acquisition. ArXiv e-prints, 2020.
|
| 176 |
+
[7] Sai Bi, Zexiang Xu, Kalyan Sunkavalli, Miloš Hašan, Yannick Hold-Geoffroy, David Kriegman, and Ravi Ramamoorthi. Deep reflectance volumes: Relightable reconstructions from multi-view photometric images. In European Conference on Computer Vision (ECCV), 2020.
|
| 177 |
+
[8] Sai Bi, Zexiang Xu, Kalyan Sunkavalli, David Kriegman, and Ravi Ramamoorthi. Deep 3d capture: Geometry and reflectance from sparse multi-view images. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020.
|
| 178 |
+
[9] Mark Boss, Fabian Groh, Sebastian Herholz, and Hendrik P. A. Lensch. Deep Dual Loss BRDF Parameter Estimation. In Workshop on Material Appearance Modeling, 2018.
|
| 179 |
+
[10] Mark Boss, Varun Jampani, Kihwan Kim, Hendrik P.A. Lensch, and Jan Kautz. Two-shot spatially-varying BRDF and shape estimation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020.
|
| 180 |
+
[11] Mark Boss, Raphael Braun, Varun Jampani, Jonathan T. Barron, Ce Liu, and Hendrik P.A. Lensch. NeRD: Neural reflectance decomposition from image collections. In IEEE International Conference on Computer Vision (ICCV), 2021.
|
| 181 |
+
[12] Eric Chan, Marco Monteiro, Petr Kellnhofer, Jiajun Wu, and Gordon Wetzstein. pi-GAN: Periodic implicit generative adversarial networks for 3D-aware image synthesis. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2021.
|
| 182 |
+
[13] Zhe Chen, Shohei Nobuhara, and Ko Nishino. Invertible neural BRDF for object inverse rendering. In European Conference on Computer Vision (ECCV), 2020.
|
| 183 |
+
[14] Zhiqin Chen and Hao Zhang. Learning implicit fields for generative shape modeling. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019.
|
| 184 |
+
[15] Robert L. Cook and Kenneth E. Torrance. A reflectance model for computer graphics. ACM Transactions on Graphics (ToG), 1982.
|
| 185 |
+
[16] Valentin Deschaintre, Miika Aitalla, Fredo Durand, George Drettakis, and Adrien Bousseau. Single-image SVBRDF capture with a rendering-aware deep network. In ACM Transactions on Graphics (ToG), 2018.
|
| 186 |
+
[17] Valentin Deschaintre, Miika Aitalla, Fredo Durand, George Drettakis, and Adrien Bousseau. Flexible SVBRDF capture with a multi-image deep network. In Eurographics Symposium on Rendering, 2019.
|
| 187 |
+
[18] Valentin Deschaintre, George Drettakis, and Adrien Bousseau. Guided fine-tuning for largescale material transfer. In Eurographics Symposium on Rendering, 2020.
|
| 188 |
+
[19] Yue Dong, Guojun Chen, Pieter Peers, Jianwen Zhang, and Xin Tong. Appearance-from-motion: Recovering spatially varying surface reflectance under unknown lighting. ACM Transactions on Graphics (SIGGRAPH ASIA), 2014.
|
| 189 |
+
[20] Duan Gao, Xiao Li, Yue Dong, Pieter Peers, and Xin Tong. Deep inverse rendering for highresolution SVBRDF estimation from an arbitrary number of images. In ACM Transactions on Graphics (SIGGRAPH), 2019.
|
| 190 |
+
[21] Marc-André Gardner, Kalyan Sunkavalli, Ersin Yumer, Xiaohui Shen, Emiliano Gambaretto, Christian Gagné, and Jean-François Lalonde. Learning to predict indoor illumination from a single image. ACM Transactions on Graphics (ToG), 2017.
|
| 191 |
+
[22] Marc-Andre Gardner, Yannick Hold-Geoffroy, Kalyan Sunkavalli, Christian Gagne, and JeanFrancois Lalonde. Deep parametric indoor lighting estimation. In IEEE International Conference on Computer Vision (ICCV), 2019.
|
| 192 |
+
[23] Dan B. Goldman, Brian Curless, Aaron Hertzmann, and Steven M. Seitz. Shape and spatiallyvarying BRDFs from photometric stereo. IEEE Transactions on Pattern Analysis and Machine Intelligence (PAMI), 2009.
|
| 193 |
+
[24] Tom Haber, Christian Fuchs, Phillipe Bekaer, Hans-Peter Seidel, Michael Goesele, and Hendrik P. A. Lensch. Relighting objects from image collections. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2009.
|
| 194 |
+
[25] Peter Hedman, Pratul P. Srinivasan, Ben Mildenhall, Jonathan T. Barron, and Paul Debevec. Baking neural radiance fields for real-time view synthesis. In IEEE International Conference on Computer Vision (ICCV), 2021.
|
| 195 |
+
[26] Philipp Henzler, Valentin Deschaintre, Niloy J Mitra, and Tobias Ritschel. Generative modelling of BRDF textures from flash images. ACM Transactions on Graphics (SIGGRAPH ASIA), 2021.
|
| 196 |
+
[27] James T. Kajiya. The rendering equation. In ACM Transactions on Graphics (SIGGRAPH), 1986.
|
| 197 |
+
[28] Brian Karis. Real shading in unreal engine 4. Technical report, Epic Games, 2013.
|
| 198 |
+
[29] Jan Kautz, Pere-Pau Vázquez Alcocer, Wolfgang Heidrich, and Hans-Peter Seidel. A unified approach to prefiltered environment maps. Eurographics Symposium on Rendering, 2000.
|
| 199 |
+
[30] Berk Kaya, Suryansh Kumar, Carlos Oliveira, Vittorio Ferrari, and Luc Van Gool. Uncalibrated neural inverse rendering for photometric stereo of general surfaces. In IEEE International Conference on Computer Vision (ICCV), 2021.
|
| 200 |
+
[31] Petr Kellnhofer, Lars Jebe, Andrew Jones, Ryan Spicer, Kari Pulli, and Gordon Wetzstein. Neural lumigraph rendering. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2021.
|
| 201 |
+
[32] Jason Lawrence, Szymon Rusinkiewicz, and Ravi Ramamoorthi. Efficient BRDF importance sampling using a factored representation. ACM Transactions on Graphics (ToG), 2004.
|
| 202 |
+
[33] Hendrik P. A. Lensch, Jan Kautz, Michael Gosele, and Hans-Peter Seidel. Image-based reconstruction of spatially varying materials. In Eurographics Conference on Rendering, 2001.
|
| 203 |
+
[34] Hendrik P.A. Lensch, Jochen Lang, M. Sa Asla, and Hans-Peter Seidel. Planned sampling of spatially varying BRDFs. In Computer Graphics Forum, 2003.
|
| 204 |
+
[35] Xiao Li, Yue Dong, Pieter Peers, and Xin Tong. Modeling surface appearance from a single photograph using self-augmented convolutional neural networks. In ACM Transactions on Graphics (ToG), 2017.
|
| 205 |
+
[36] Zhengqin Li, Kalyan Sunkavalli, and Manmohan Chandraker. Materials for masses: SVBRDF acquisition with a single mobile phone image. In European Conference on Computer Vision (ECCV), 2018.
|
| 206 |
+
[37] Zhengqin Li, Zexiang Xu, Ravi Ramamoorthi, Kalyan Sunkavalli, and Manmohan Chandraker. Learning to reconstruct shape and spatially-varying reflectance from a single image. In ACM Transactions on Graphics (SIGGRAPH ASIA), 2018.
|
| 207 |
+
[38] Zhengqin Li, Mohammad Shafiei, Ravi Ramamoorthi, Kalyan Sunkavalli, and Manmohan Chandraker. Inverse rendering for complex indoor scenes: Shape, spatially-varying lighting and SVBRDF from a single image. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020.
|
| 208 |
+
[39] Lingjie Liu, Jiatao Gu, Kyaw Zaw Lin, Tat-Seng Chua, and Christian Theobalt. Neural sparse voxel fields. In Advances in Neural Information Processing Systems (NeurIPS), 2020.
|
| 209 |
+
[40] Stephen Lombardi, Tomas Simon, Jason Saragih, Gabriel Schwartz, Andreas Lehrmann, and Yaser Sheikh. Neural volumes: Learning dynamic renderable volumes from images. ACM Transactions on Graphics (ToG), 2019.
|
| 210 |
+
[41] Xudong Mao, Qing Li, Haoran Xie, Raymond Y.K. Lau, Zhen Wang, and Stephen Paul Smolley. Least squares generative adversarial networks. In IEEE International Conference on Computer Vision (ICCV), 2017.
|
| 211 |
+
[42] Ricardo Martin-Brualla, Noha Radwan, Mehdi S. M. Sajjadi, Jonathan T. Barron, Alexey Dosovitskiy, and Daniel Duckworth. NeRF in the Wild: Neural Radiance Fields for Unconstrained Photo Collections. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2021.
|
| 212 |
+
|
| 213 |
+
[43] Lars Mescheder, Michael Oechsle, Michael Niemeyer, Sebastian Nowozin, and Andreas Geiger. Occupancy networks: Learning 3d reconstruction in function space. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019.
|
| 214 |
+
|
| 215 |
+
[44] Ben Mildenhall, Pratul Srinivasan, Matthew Tancik, Jonathan T. Barron, Ravi Ramamoorthi, and Ren Ng. NeRF: Representing scenes as neural radiance fields for view synthesis. In European Conference on Computer Vision (ECCV), 2020.
|
| 216 |
+
|
| 217 |
+
[45] Giljoo Nam, Diego Gutierrez, and Min H. Kim. Practical SVBRDF acquisition of 3d objects with unstructured flash photography. In ACM Transactions on Graphics (SIGGRAPH ASIA), 2018.
|
| 218 |
+
|
| 219 |
+
[46] Jeong Joon Park, Peter Florence, Julian Straub, Richard Newcombe, and Steven Lovegrove. Deepsdf: Learning continuous signed distance functions for shape representation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2019.
|
| 220 |
+
|
| 221 |
+
[47] Shen Sang and Manmohan Chandraker. Single-shot neural relighting and SVBRDF estimation. In European Conference on Computer Vision (ECCV), 2020.
|
| 222 |
+
|
| 223 |
+
[48] Soumyadip Sengupta, Jinwei Gu, Kihwan Kim, Guilin Liu, David W. Jacobs, and Jan Kautz. Neural inverse rendering of an indoor scene from a single image. In IEEE International Conference on Computer Vision (ICCV), 2019.
|
| 224 |
+
|
| 225 |
+
[49] Vincent Sitzmann, Julien N.P. Martel, Alexander W. Bergman, David B. Lindell, and Gordon Wetzstein. Implicit neural representations with periodic activation functions. In Advances in Neural Information Processing Systems (NeurIPS), 2020.
|
| 226 |
+
|
| 227 |
+
[50] Shuran Song and Thomas Funkhouser. Neural illumination: Lighting prediction for indoor environments. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019.
|
| 228 |
+
|
| 229 |
+
[51] Pratul P. Srinivasan, Boyang Deng, Xiuming Zhang, Matthew Tancik, Ben Mildenhall, and Jonathan T. Barron. NeRV: Neural reflectance and visibility fields for relighting and view synthesis. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2021.
|
| 230 |
+
|
| 231 |
+
[52] Matthew Tancik, Pratul P. Srinivasan, Ben Mildenhall, Sara Fridovich-Keil, Nithin Raghavan, Utkarsh Singhal, Ravi Ramamoorthi, Jonathan T. Barron, and Ren Ng. Fourier features let networks learn high frequency functions in low dimensional domains. Advances in Neural Information Processing Systems (NeurIPS), 2020.
|
| 232 |
+
|
| 233 |
+
[53] Bruce Walter, Stephen R. Marschner, Hongsong Li, and Kenneth E. Torrance. Microfacet models for refraction through rough surfaces. In Eurographics Symposium on Rendering, 2007.
|
| 234 |
+
|
| 235 |
+
[54] Qianqian Wang, Zhicheng Wang, Kyle Genova, Pratul Srinivasan, Howard Zhou, Jonathan T. Barron, Ricardo Martin-Brualla, Noah Snavely, and Thomas Funkhouser. Ibrnet: Learning multi-view image-based rendering. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2021.
|
| 236 |
+
|
| 237 |
+
[55] Henrique Weber, Prévost. Donald, and Jean-François Lalonde. Learning to estimate indoor lighting from 3d objects. In International Conference on 3D Vision (3DV), 2018.
|
| 238 |
+
|
| 239 |
+
[56] Rui Xia, Yue Dong, Pieter Peers, and Xin Tong. Recovering shape and spatially-varying surface reflectance under unknown illumination. In ACM Transactions on Graphics (SIGGRAPH ASIA), 2016.
|
| 240 |
+
|
| 241 |
+
[57] Zexiang Xu, Sai Bi, Kalyan Sunkavalli, Sunil Hadap, Hao Su, and Ravi Ramamoorthi. Deep view synthesis from sparse photometric images. ACM Transactions on Graphics (ToG), 2019.
|
| 242 |
+
|
| 243 |
+
[58] Zexiang Xu et al. Deep image-based relighting from optimal sparse samples. ACM Transactions on Graphics (ToG), 2018.
|
| 244 |
+
|
| 245 |
+
[59] Wenjie Ye, Xiao Li, Yue Dong, Pieter Peers, and Xin Tong. Single image surface appearance modeling with self-augmented cnns and inexact supervision. Computer Graphics Forum, 2018.
|
| 246 |
+
|
| 247 |
+
[60] Alex Yu, Ruilong Li, Matthew Tancik, Hao Li, Ren Ng, and Angjoo Kanazawa. PlenOctrees for real-time rendering of neural radiance fields. In IEEE International Conference on Computer Vision (ICCV), 2021.
|
| 248 |
+
[61] Greg Zaal. Hdri haven, 2019. https://hdrihaven.com/.
|
| 249 |
+
[62] Jianzhao Zhang, Guojun Chen, Yue Dong, Jian Shi, Bob Zhang, and Enhua Wu. Deep inverse rendering for practical object appearance scan with uncalibrated illumination. In Advances in Computer Graphics, 2020.
|
| 250 |
+
[63] Kai Zhang, Fujun Luan, Qianqian Wang, Kavita Bala, and Noah Snavely. PhySG: Inverse rendering with spherical Gaussians for physics-based material editing and relighting. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2021.
|
| 251 |
+
[64] Yuxuan Zhang, Wenzheng Chen, Huan Ling, Jun Gao, Yinan Zhang, Antonio Torralba, and Sanja Fidler. Image GANs meet differentiable rendering for inverse graphics and interpretable 3d neural rendering. In International Conference on Learning Representations (ICLR), 2021.
|
md/train/fmgYOUahK9/fmgYOUahK9.md
ADDED
|
@@ -0,0 +1,263 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Deep Learning Through the Lens of Example Difficulty
|
| 2 |
+
|
| 3 |
+
Robert J. N. Baldock∗ Google Research, Brain Team rjnbaldock@gmail.com
|
| 4 |
+
|
| 5 |
+
Hartmut Maennel Google Research, Brain Team hartmutm@google.com
|
| 6 |
+
|
| 7 |
+
Behnam Neyshabur Google Research, Blueshift Team neyshabur@google.com
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
Existing work on understanding deep learning often employs measures that compress all data-dependent information into a few numbers. In this work, we adopt a perspective based on the role of individual examples. We introduce a measure of the computational difficulty of making a prediction for a given input: the (effective) prediction depth. Our extensive investigation reveals surprising yet simple relationships between the prediction depth of a given input and the model’s uncertainty, confidence, accuracy and speed of learning for that data point. We further categorize difficult examples into three interpretable groups, demonstrate how these groups are processed differently inside deep models and showcase how this understanding allows us to improve prediction accuracy. Insights from our study lead to a coherent view of a number of separately reported phenomena in the literature: early layers generalize while later layers memorize; early layers converge faster and networks learn easy data and simple functions first.
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
Much of the existing work on understanding deep learning “integrates out” the data, viewing the inductive bias of the model, or the properties of the optimizer as central to the success of the approach. Examples of such work include studies of eigenvalues of the Hessian and the geometry of the loss landscape (Ghorbani et al., 2019; Yao et al., 2020; Sagun et al., 2016; Li et al., 2018; Pennington and Bahri, 2017; Sagun et al., 2018), studies of margin and effective generalization measures (Long and Sedghi, 2019; Unterthiner et al., 2020; Jiang et al., 2020, 2018; Kawaguchi et al., 2017) and mean-field studies of stochastic optimization (Smith et al., 2021; Stephan et al., 2017; Smith and Le, 2018). However, in practice, we are rarely concerned with only the average behavior of a model.
|
| 16 |
+
|
| 17 |
+
One pathway to understanding the principles that govern how deep models process data is to study the properties of deep models for data points with different “amounts” or “types” of example difficulty. There are a number of definitions of example difficulty in the literature (E.g. see Carlini et al. (2019); Hooker et al. (2019); Lalor et al. (2018); Agarwal and Hooker (2020)). Two are particularly relevant to this work. Firstly, the probability of predicting the ground truth label for an example, when that example is omitted from the training set (Jiang et al., 2021), which represents a statistical view of example difficulty. Secondly, the difficulty of learning an example, parameterized by the earliest training iteration after which the model predicts the ground truth class for that example in all subsequent iterations (Toneva et al., 2019). This measure represents a learning view of example difficulty 2.
|
| 18 |
+
|
| 19 |
+
These notions suffer from two fundamental limitations. While early-exit strategies in computer vision (Teerapittayanon et al., 2016; Huang et al., 2018) and NLP (Dehghani et al., 2018; Liu et al., 2020b; Schwartz et al., 2020; Xin et al., 2020) suggest predictions for easier examples require less computation, the above example difficulty notions do not encapsulate the processing of data inside a given converged model. Moreover, existing notions of example difficulty (E.g. Carlini et al. (2019)) provide a one-dimensional view of difficulty which can not distinguish between examples that are difficult for different reasons.
|
| 20 |
+
|
| 21 |
+
In this paper, we take a significant step towards resolving the above shortcomings. To take the processing of the data into account we propose a new measure of example difficulty, the prediction depth, which is determined from the hidden embeddings. To escape the one-dimensional view of difficulty, we introduce three distinct difficulty types by relating the hidden embeddings for an input to high-level concepts about example difficulty: “Does this example look mislabeled?”; “Is classifying this example only easy if the label is given?”; “Is this example ambiguous both with and without its label?”. Furthermore, we show how this enhanced notion of example difficulty can unify our understanding of several seemingly unrelated phenomena in deep learning. We hope that the results presented in this work will aid the development of models that capture heteroscedastic uncertainty, our understanding of how deep networks respond to distributional shift, and the advancement of curriculum learning approaches and machine learning fairness. These connections are discussed in Section 5.
|
| 22 |
+
|
| 23 |
+
Contributions Our main contributions are as follows:
|
| 24 |
+
|
| 25 |
+
• We introduce a measure of computational example difficulty: the prediction depth (PD). The prediction depth, illustrated in Figure 1, represents the number of hidden layers after which the network’s final prediction is already (effectively) determined (Section 2).
|
| 26 |
+
We show that the prediction depth is larger for examples that visually appear to be more difficult, and that prediction depth is consistent between architectures and random seeds (Section 2.2).
|
| 27 |
+
• Our empirical investigation reveals that prediction depth appears to establish a linear lower bound on the consistency of a prediction. We further show that predictions are on average more accurate for validation points with small prediction depths (Section 3.1).
|
| 28 |
+
We demonstrate that final predictions for data points that converge earlier during training are typically determined in earlier layers which establishes a correspondence between the training history of the network and the processing of data in the hidden layers (Section 3.2).
|
| 29 |
+
• We show that both the adversarial input margin and the output margin are larger for examples with smaller prediction depths. We further design an intervention to reduce the output margin of a network and show that this leads to predictions being made only in the latest hidden layers (Section 3.3).
|
| 30 |
+
We identify three extreme forms of example difficulty by considering the prediction depth in the training and validation splits independently and demonstrate how a simple algorithm that uses the hidden embeddings in one middle layer to make predictions can lead to dramatic improvements in accuracy for inputs that strongly exhibit a specific form of example difficulty (Section 4).
|
| 31 |
+
We use our results to present a coherent picture of deep learning that unifies four seemingly unrelated deep learning phenomena: early layers generalize while later layers memorize; networks converge from input layer towards output layer; easy examples are learned first and networks present simpler functions earlier in training (Section 5).
|
| 32 |
+
|
| 33 |
+
Experimental Setup: To ensure that our results are robust to the choice of architectures and datasets, we report empirical findings for ResNet18 (He et al., 2016), VGG16 (Simonyan and Zisserman, 2015) and MLP architectures trained on CIFAR10, CIFAR100 (Krizhevsky et al., 2009), Fashion MNIST (FMNIST) (Xiao et al., 2017) and SVHN (Netzer et al., 2011) datasets. All models were trained using SGD with momentum. Our MLP comprises 7 hidden layers of width 2048 with ReLU activations. Details of the datasets, architectures, and hyperparameters used can be found in Appendix A.
|
| 34 |
+
|
| 35 |
+
Related Work: Our work uses hidden layer probes to determine example difficulty. We have discussed how our study relates to prior work on example difficulty. Hidden layer probes have also been used to study deep learning. Deep k-NN methods (Papernot and McDaniel, 2018) determine their predictions and estimate their own uncertainties by comparing the hidden embeddings of an input to those of the training set. Cohen et al. (2018) showed that SVM, $\mathbf { k }$ -Nearest Neighbors $\mathbf { k }$ -NN)
|
| 36 |
+
|
| 37 |
+
and logistic regression probes achieve similar accuracies. However, they did not study the processing of individual data points nor did they relate the $\mathbf { k }$ -NN accuracy to notions of example difficulty. Alain and Bengio (2017) used linear classifier probes in the hidden layers to interrogate deep models and demonstrated that linear separability of the embeddings increases monotonically with depth. We provide a more detailed discussion of related work in Appendix B.
|
| 38 |
+
|
| 39 |
+
# 2 Prediction Depth: a Computational View of Example Difficulty
|
| 40 |
+
|
| 41 |
+
We discussed the statistical and learning views of example difficulty in Section 1. In this section, we introduce a computational view of example difficulty parametrized by the prediction depth as defined in Section 2.1. This computational view asserts that, for “easy” examples, a deep model’s final prediction is effectively made after only a few layers, while more layers are used for “difficult” examples.
|
| 42 |
+
|
| 43 |
+
# 2.1 Definition
|
| 44 |
+
|
| 45 |
+
Asserting that the final prediction is effectively determined in earlier layers of a model, before the output, we estimate the depth at which a prediction is made for a given input as follows 3:
|
| 46 |
+
|
| 47 |
+
1. We construct k-NN classifier probes from the embeddings of the training set after particular layers of the network, including the input and the final softmax. The placement of $\mathbf { k }$ -NN probes is described in Appendix A.5. We use $k = 3 0$ in the $\mathbf { k }$ -NN probes. Appendix A.4 establishes that the k-NN accuracies we report are insensitive to $k$ over a wide range. 2. A prediction is defined to be made at a depth $L = l$ if the $\mathbf { k }$ -NN classification after layer $L = l - 1$ is different from the network’s final classification, but the classifications of k-NN probes after every layer $L \geq l$ are all equal to the final classification of the network. Data points consistently classified by all $\mathbf { k }$ -NN probes are determined to be (effectively) predicted in layer 0 (the input) 4.
|
| 48 |
+
|
| 49 |
+
It is worth noting that the prediction depth can be calculated for all data points: both in the training and validation splits. This leads to two notions of computational difficulty:
|
| 50 |
+
|
| 51 |
+
• The difficulty of predicting the (given) class for an input (in the training split) • The difficulty of making a prediction for an input, unseen in advance (from the validation split)
|
| 52 |
+
|
| 53 |
+
We examine both notions of computational difficulty in this paper and use the distinction between them to describe different forms of example difficulty in Section 4.
|
| 54 |
+
|
| 55 |
+
# 2.2 Prediction depth is a meaningful and robust notion of example difficulty
|
| 56 |
+
|
| 57 |
+
In this section we show that prediction depth agrees with intuitive notions of example difficulty and that it is consistent between different training runs and similar architectures.
|
| 58 |
+
|
| 59 |
+
Prediction depth is higher for examples and datasets that seem more difficult If prediction depth is a sensible measure of example difficulty then we would expect the following sanity checks to be observed:
|
| 60 |
+
|
| 61 |
+
1. Individual data points that are visually confusing or mislabeled should have larger prediction depths as compared to images that are clear examples of their class.
|
| 62 |
+
2. Data points from tasks that are intuitively simpler should have lower prediction depths on average.
|
| 63 |
+
|
| 64 |
+
Figure 1 shows that the prediction depth passes both of these sanity checks. Appendix C.1 presents additional images, providing further evidence for this claim.
|
| 65 |
+
|
| 66 |
+
Prediction depth is consistent across random seeds and similar architectures Figure 2 shows that the prediction depth is highly consistent between different architectures and random seeds for all datasets. Perfect agreement is not expected as different deep learning algorithms have different inductive biases which affects the perceived difficulty of examples. We observe stronger correlation between prediction depth for ResNet18 and VGG16, than between VGG16 and MLP. This may be explained by the fact that ResNet18 and VGG16 are both convolutional networks and we expect their inductive biases to be more similar to one another than to MLP.
|
| 67 |
+
|
| 68 |
+

|
| 69 |
+
Figure 1: Deep models use fewer layers to (effectively) determine the prediction for easy examples and more layers for hard examples. Left: A cartoon illustrating the definition of prediction depth (given in Section 2.1). Also shown are training examples from CIFAR100 (“Clock”) and SVHN (“Digit 8”). The examples shown are predicted at the input (first layer) or softmax (last layer) of ResNet18. The examples predicted in the input are visually typical (“easy”), while those predicted in the softmax are mislabeled and/or visually confusing (“hard” examples). To find the prediction depth, we build $\mathbf { k }$ -NN classifiers from the embeddings of the training set in different layers of the model. The prediction depth corresponds to the earliest layer at which the predictions of all subsequent k-NN classifiers converge to a fixed label. Right: Probability of prediction depth in ResNet18 models for four datasets (training split). We see that the four distributions have different characteristic prediction depths. Ranking the mean prediction depths of these datasets in ascending order, we observe: Fashion MNIST (smallest), SVHN (second), CIFAR10 (third), and CIFAR100 (largest). This order aligns with how one might intuitively rank the difficulties of these classification tasks.
|
| 70 |
+
|
| 71 |
+

|
| 72 |
+
Figure 2: Consistency of prediction depth between architectures and random seeds. Left: The panel shows the correlation coefficient between prediction depths in different architectures, for both train and validation splits in four datasets. Diagonal comparisons between an architecture and itself show the correlation for the same architecture trained with different random seeds. Right: Histograms comparing the mean value of prediction depth obtained for each data point in the training set of CIFAR10 from an ensemble of 250 trained models. In this plot, for visual simplicity, we rescale prediction depth to the interval $[ 0 , 1 ]$ for each network. Similar results for all other datasets are presented in Appendix C.2.
|
| 73 |
+
|
| 74 |
+
# 3 Deep Learning Phenomena Through the Lens of Prediction Depth
|
| 75 |
+
|
| 76 |
+
In this section, we explore how the prediction depth can be used to better understand three important aspects of Deep Learning: accuracy and consistency of a prediction; the order in which data is learned and the simplicity of the learned function (as measured by the margin) in the vicinity of a data point.
|
| 77 |
+
|
| 78 |
+
# 3.1 Depth of a prediction gives a linear lower bound on its consistency
|
| 79 |
+
|
| 80 |
+
Adopting a statistical view of example difficulty, Jiang et al. (2021) identified example difficulty with the expected accuracy of the learning algorithm for a given input, averaged over models trained on different random subsets of the training set with different random seeds. In this section, we clarify the relationship between the prediction depth and the expected accuracy by disentangling the accuracy from the sensitivity of predictions to the particular training split and random seed. Following Jiang et al. (2021), we measure the expected accuracy using the consistency score.
|
| 81 |
+
|
| 82 |
+
Consistency score $\hat { C }$ : The frequency of classifying an example correctly when it is omitted from the training set. An empirical estimator of the consistency score for a validation point $( x , y )$
|
| 83 |
+
|
| 84 |
+

|
| 85 |
+
Figure 3: Consistency score vs. prediction depth in the validation split (left) can be understood as the superposition of two simple functions (middle and right). We trained 250 ResNet18 models on CIFAR10, with $9 0 { : } 1 0 \%$ random train:validation splits as described in Appendix A. These histograms compare the frequency of correct predictions to the average prediction depth for a data point when it occurs in the validation split. The density of data points is indicated by the color bar, which follows a log scale. The average prediction depth forms two, surprisingly simple, linear bounds on the consistency score (see Section 3.1 for a full description.) This Figure is reproduced for all datasets and architectures in Appendix C.3, illustrating the consistency of this result.
|
| 86 |
+
|
| 87 |
+
is given by (Jiang et al., 2021):
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\hat { C } _ { A , S } ( x , y ) = \hat { \mathbb { E } } _ { \tilde { S } \sim { \cal S } \setminus \{ ( x , y ) \} } ^ { r } \left[ \delta _ { y _ { A } , y } \right]
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
where $A$ is a deep learning algorithm (architecture, loss and optimizer), $y$ is the ground truth class for $x$ , $\tilde { \cal S }$ is a random subset of $n$ points sampled from a training dataset $s$ excluding $( x , y )$ , $y _ { A }$ is the predicted class of $x$ for $A$ trained with data $\tilde { \cal S }$ , $\delta$ is the Kronecker delta and $\hat { \mathbb { E } } ^ { r }$ denotes empirical averaging with $r$ i.i.d. samples of such subsets $\tilde { \cal S }$ .
|
| 94 |
+
|
| 95 |
+
Figure 3 (left panel) shows the relationship between consistency score and prediction depth. This plot indicates a surprising piecewise linear boundary which is symmetric around consistency score $\frac { 1 } { 2 }$ This suggests the existence of a missing concept that could simplify the picture. We next show that the missing concept is the notion of a consensus class which is defined below.
|
| 96 |
+
|
| 97 |
+
Consensus class ${ \hat { y } } _ { A }$ : The consensus class of $x$ is defined as the predicted class for input $x$ by a majority voting ensemble of $r$ models each of which is trained on a randomly chosen subset ${ \tilde { \cal S } } \stackrel { n } { \sim } { \cal S } \backslash \{ ( x , y ) \} \stackrel { 5 } { \sim }$ .
|
| 98 |
+
|
| 99 |
+
Figure 3 (middle and right) shows how conditioning on whether consensus class matches the ground truth can change the relationship between consistency score and the prediction depth. For points where the consensus class matches the ground truth (middle) we see that the prediction depth forms a, surprisingly simple, linear lower bound on the consistency score. For points where the consensus class differs from the ground truth (right) at low prediction depth the consistency score is bounded from above by a line that reflects the bound from the middle plot in $\begin{array} { r } { \hat { C } = \frac { 1 } { 2 } } \end{array}$ , suggesting that such points are repeatedly mislabeled with a wrong class label. At high prediction depth, the consistency score is low, which suggests highly inconsistent predictions and low accuracy. This result suggests a simple hypothesis: that predictions with low prediction depth are consistent with the consensus class, whether that matches the ground truth class or not, while predictions made in later layers depend strongly on the specific training split and random seed used for training and initialization. We measure consistency with the consensus class using the consensus-consistency score.
|
| 100 |
+
|
| 101 |
+
Consensus-consistency score $C ^ { * }$ : The fraction of models in an ensemble that predict the ensemble’s consensus class ${ \hat { y } } _ { A } \left( x \right)$ for an unseen input $x$ .
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
C _ { A , S } ^ { * } ( x ) = \hat { \mathbb { E } } _ { \tilde { S } \sim \tilde { S } \backslash \{ ( x , y ) \} } ^ { r } \left[ \delta _ { y _ { A } , \hat { y } _ { A } ( x ) } \right]
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
where the notation is the same as in (1) 6.
|
| 108 |
+
|
| 109 |
+
Figure 4 (left) establishes that our simple hypothesis is indeed correct: the prediction depth forms a linear lower bound on the consensus-consistency score for all data points, irrespective of whether the consensus class matches or differs from the ground truth. Interestingly, Figure 4 (middle and right) shows how the prediction depth in a single model, can be used to estimate both of these quantities. That is, predictions of data points with lower prediction depth are both more likely to be consistent and more likely to be correct.
|
| 110 |
+
|
| 111 |
+

|
| 112 |
+
Figure 4: Left: Prediction depth provides us with a linear lower bound on consensus-consistency. Results for CIFAR100 with ResNet18. We train 250 models $( 9 0 { : } 1 0 \%$ random train:validation splits) and compare the average prediction depth when a point occurs in the validation set, to the consensus-consistency of the corresponding predictions. Predictions made for points with low mean prediction depths are highly consistent. Conversely, predictions for points with high mean prediction depths are typically more sensitive to the particular training split and random seed used during training. This left plot shows the result for CIFAR100 with ResNet18. The density of data points is indicated by the color bar, which follows a log scale. Middle: Prediction depth in one model predicts the consensus-consistency of an ensemble that does not include that model. For each dataset we train 25 ResNet18 models with the full training set (see Appendix A). The consensus-consistency of each test point is obtained from 24 of the models, while the prediction depth is obtained from the remaining 1 model. We see that prediction depth in one model predicts the consensus-consistency of a separate ensemble: a measure of the uncertainty of the prediction. The size of each marker in the middle and right plots shows the fraction of the dataset with each prediction depth. Reaffirming the second sanity check in Section 2.2, and in agreement with Figure 1 (right), intuitively simpler datasets (Fashion MNIST and SVHN) have low average prediction depths, while CIFAR100 (intuitively the hardest dataset) has the largest average prediction depth. Right: Prediction depth predicts accuracy. For each dataset we train 250 ResNet18 models $9 0 { : } 1 0 \%$ random train:validation splits). Each time a point appears in the validation split we record the prediction depth and whether the prediction was correct. Predictions made in earlier layers are more likely to be correct. Consistency of these plots is demonstrated for all datasets and architectures in Appendix C.3 where we also describe the relationship between the prediction depth and the entropy of the predictions for an ensemble.
|
| 113 |
+
|
| 114 |
+
# 3.2 The prediction depth of an input is correlated with its learning difficulty
|
| 115 |
+
|
| 116 |
+
In Section 3.1, we describe the relationship between the prediction depth, which represents a computational view of example difficulty and the consistency and consensus-consistency scores, which represent a statistical view. In this section we compare prediction depth to a learning view of example difficulty. We measure the difficulty of learning an example by the speed at which the model’s prediction converges for that input during training. The following definition is adapted from Toneva et al. (2019):
|
| 117 |
+
|
| 118 |
+
Iteration learned A data point is said to be learned by a classifier at training iteration $t = \tau$ if the predicted class at iteration $t = \tau - 1$ is different from the final prediction of the converged network and the predictions at all iterations $t \geq \tau$ are equal to the final prediction of the converged network. Data points consistently classified after all training steps and at the moment of initialization, are said to be learned in step $t = 0$ 7 .
|
| 119 |
+
|
| 120 |
+
Figure 5 (left plot) shows the positive correlation between the prediction depth and the iteration learned, for all four datasets in VGG16. Consistent results are presented for all architectures and datasets, in both the validation and training splits in Appendix C.4. As a result of the reported correlation, we anticipate that many of the data points correctly classified by the k-NN probe in a particular layer should also be correctly classified by the network at a corresponding interval of training steps. If this is correct then we would expect there to be a visual correspondence between the training learning curve (which shows how the accuracy of the network changes during training) and the accuracy of the $\mathbf { k }$ -NN probes as data passes from input, through the network, towards the output layer. We call the series of $\mathbf { k }$ -NN probe accuracies the inference learning curve.
|
| 121 |
+
|
| 122 |
+

|
| 123 |
+
Figure 5: Left: Data points with small prediction depths are on average learned before data points with higher prediction depths. We train 250 VGG16 models for each dataset, using a $9 0 { : } 1 0 \%$ random train:validation split as described in Appendix A. Each time an input appears in the validation split we record the prediction depth and the iteration learned in that model. This plot shows the average iteration learned for data points at each prediction depth. Marker size shows the fraction of the dataset with each prediction depth. The Pearson correlation coefficients for the four data sets are as follows. CIFAR100: 0.83. CIFAR10: 0.7. Fashion MNIST: 0.79. SVHN: 0.77. Middle and right: The training learning curve (middle) shares several important features with the inference learning curve (right). Blue, yellow and green curves represent different components of the CIFAR10 training split, in which we have randomized (and fixed) $40 \%$ of the labels, and red curves show the test split. The middle and right plots show results from 5 random seeds. The inference learning curve (right) is the sequence of k-NN probe accuracy values for each split. All three plots show results for VGG16. The hyperparameters used are given in Appendix A.
|
| 124 |
+
|
| 125 |
+

|
| 126 |
+
Figure 6: Left and Middle: Test examples with smaller prediction depths, on average, have larger output and input margins. We train 25 VGG16 models with different random seeds on CIFAR10 (see Appendix A for details) and compare the mean prediction depth of each test point in these 25 runs to its mean output and input margins (log scales). Correlation coefficients are $- 0 . 7 0$ (output margin) and $- 0 . 6 9$ (input margin). The density of data points is indicated by the color bar, which follows a log scale. Although the prediction depth could be at most 14, no data point has an average prediction depth greater than 12. Right: An intervention that does not encourage large output margin ( $^ { * } O$ -Hinge”) results, as predicted, in models where the predictions are effectively determined in higher layers in the network compared to the standard training $( \ ^ { \ast } C E ^ { \prime \prime } )$ .
|
| 127 |
+
|
| 128 |
+
To test this hypothesis we train a model on a training split where a subset of labels are corrupted and compare the training and inference learning curves on four splits of the data: unchanged training data; mislabeled training data; the original labels of the mislabeled training data and the test split. In Figure 5 (middle and right plots) we see that many of the important features of the training learning curve are indeed present in the inference learning curve. During training (middle), mislabeled data are initially processed as though they are a member of their original class (before they were mislabeled) (Liu et al., 2020a). After an initial period of learning, the network begins to learn the new (random) labels that have been assigned to those data points, so the orange curve moves upwards, and the green curve downwards. At this point, a maximum is observed in the training accuracy (Arpit et al., 2017). In the right plot we see that these same phenomena occur in the inference learning curve.
|
| 129 |
+
|
| 130 |
+
# 3.3 Deep models exhibit larger margins for inputs with lower prediction depth
|
| 131 |
+
|
| 132 |
+
It is reported in the literature that deep networks learn functions of increasing complexity during training (Hu et al., 2020; Kalimeris et al., 2019). We frame this observation differently: the learned function is “locally simpler” in the vicinity of data points with smaller prediction depths, and these points are typically learned earlier in training (Section 3.2).
|
| 133 |
+
|
| 134 |
+
Two known measures of the simplicity of a learned function are the output margin (the difference between the largest and second-largest logits) and the adversarial input margin (the smallest norm required for an adversarial perturbation in the input to change the model’s class prediction). We estimate the adversarial input margin, $\gamma$ , with a linear approximation (Jiang et al., 2018): for an input x with predicted class i, γ ' minj6=i |zi−zj ||∇x(zi−zj )| where $z _ { j }$ is the logit returned by the network for class $j$ . Figure 6 (left and middle plots) show that data points with smaller prediction depths have both larger input and output margins on average and that variances of the input and output margins decrease as the prediction depth increases.
|
| 135 |
+
|
| 136 |
+

|
| 137 |
+
Figure 7: The prediction depth can be the same, or very different for the same input when it occurs in the train and validation splits. Corners of this plot correspond to different forms of example difficulty. (See Section 4 for discussion.) We train 250 ResNet18 models on CIFAR10 with random $9 0 { : } 1 0 \%$ train:validation splits as described in Appendix A. These histograms compare average prediction depth for each data point when it occurs in the validation split vs the training split. This behavior is consistently reproduced for all datasets and architectures in Appendix C.6. Below we show extreme (not hand-chosen) images of “Birds” that appear closest to the corners of this plot. The consensus class is given above each image (tiebreaks favor the class “Bird”.)
|
| 138 |
+
|
| 139 |
+
To illustrate the strength of the relationship between the prediction depth and output margin, we demonstrate that reducing the output margin of the learned function results in a model that clusters the data only in the latest layers: such a solution has a very high average prediction depth. We do not minimize the output margin directly but rather use a loss and an optimizer that do not encourage high output margin. Naturally there are many unknowns that may contribute to this effect. We simply report the intervention and the outcome.
|
| 140 |
+
|
| 141 |
+
The intervention is performed as follows: we construct a loss function that does not promote confidence: a zero-margin hinge loss ( $^ { 6 6 } 0$ -Hinge”), and optimize the network using full-batch gradient descent with momentum and very small learning rate. For an input $x$ with label $i$ the 0-Hinge loss is given by $\begin{array} { r } { l ( x ) = \sum _ { j \neq i } \operatorname* { m a x } ( \dot { 0 } , z _ { i } - z _ { j } ) } \end{array}$ where $z _ { j }$ represents the logit for class $j$ . The form of this intervention is justified in Appendix A.7. As a control, we additionally train a model in the standard fashion using the cross-entropy loss and SGD with momentum and large initial learning rate. Since full-batch gradients are computationally expensive, we train on a subset of CIFAR10 (see Appendix A.7, where we also give the hyperparameters and learning curves.). The output margin obtained with the intervention is 5 orders of magnitude smaller than in the control experiment: $2 . 0 \times 1 0 ^ { - 4 } \pm 2 . 0 \times 1 0 ^ { - 4 }$ for the 0-Hinge loss and $1 . { \overline { { 6 } } } \times 1 0 ^ { 1 } \pm 0 . 5 0 \times 1 0 ^ { 1 }$ for cross-entropy loss. Figure 6 (right) compares the accuracies of the $\mathbf { k }$ -NN probes resulting from these training approaches. The 0-Hinge loss training achieves only a marginal improvement in accuracy (red) over an untrained network (purple), and the training split is accurately clustered only in the latest layers. This confirms the predicted behavior: the intervention leads to a model that exhibits both very small average output margins and very late clustering of the data. Very late clustering of the data implies high prediction depths since the $\mathbf { k }$ -NN probe classifications change in the latest layers for many data points.
|
| 142 |
+
|
| 143 |
+
# 4 Beyond a One-Dimensional Picture of Example Difficulty
|
| 144 |
+
|
| 145 |
+
In this section we transcend the one-dimensional picture of example difficulty by identifying different underlying reasons behind the difficulty of an example, in a way that is general to different architectures and datasets.
|
| 146 |
+
|
| 147 |
+
Figure 7 shows that the prediction depth can be different when an input occurs in the training split vs. the validation split. Thus, there are two axes of example difficulty:
|
| 148 |
+
|
| 149 |
+
1. Difficulty of making a prediction when an input is in the validation set 2. Difficulty of finding commonalities during training with other examples of the same ground truth class
|
| 150 |
+
|
| 151 |
+
Both axes have a range from “clear” to “ambiguous”. In Section 3.1 we show that predictions made for validation points with later prediction depths are often inconsistent, with low consensusconsistency. Conversely, a low prediction depth typically indicates an input with high consensusconsistency. For Axis 1 we will identify validation points with low prediction depths as “clear” and those with high prediction depths as “ambiguous”. We will additionally identify a low or high prediction depth in the training split with examples that are respectively “clear” and “ambiguous” on Axis 2. By making combinations of low/high values of $( \mathrm { P D } _ { \mathrm { V a l . } }$ , $\mathrm { P D } _ { \mathrm { T r a i n } _ { . } }$ ) we obtain four extremes of example difficulty:
|
| 152 |
+
|
| 153 |
+

|
| 154 |
+
Figure 8: Average k-NN probe confidence (solid lines) and accuracy (dotted lines) for the ground truth class (left) and consensus class (right), in the validation split for examples exhibiting extreme forms of difficulty. Mean values for 100 examples with each form of difficulty, identified as the 100 examples closest to the corners in Figure 7 (left). This result is for CIFAR10 with ResNet18: similar plots for all datasets and architectures are shown in Appendix C.7. See Section 4 for the discussion of the result and how it can be used to improve prediction accuracy.
|
| 155 |
+
|
| 156 |
+
Easy examples: (Low $\mathrm { P D } _ { \mathrm { V a l . } }$ , Low $\mathrm { P D } _ { \mathrm { T r a i n } }$ ). Such examples are often visually typical members of their class and the predicted label nearly always matches the ground truth.
|
| 157 |
+
Looks like a different class: (Low $\mathrm { P D } _ { \mathrm { V a l . } }$ , High $\mathrm { P D } _ { \mathrm { T r a i n } }$ ). In the validation set, there is a clear (and nearly always incorrect) classification for such an input, but it is difficult to connect such inputs to other examples of their ground truth class during training. Mislabeled examples are of this kind, as are visually confusing images which at first appear to show something else.
|
| 158 |
+
Ambiguous unless the label is given: (High $\mathrm { P D } _ { \mathrm { V a l . } }$ , Low $\mathrm { P D } _ { \mathrm { T r a i n } }$ ). These examples are difficult to connect to their predicted class in the validation split but easy to connect to their ground truth class during training. These points may, for example, visually resemble both their own class and another class. They are likely to be misclassified.
|
| 159 |
+
Ambiguous: (High $\mathrm { P D } _ { \mathrm { V a l . } }$ , High $\mathrm { P D } _ { \mathrm { T r a i n } }$ ). These examples may be corrupted or show an example of a rare sub-class. Predictions for these inputs can depend strongly on the random seed used for training and initialization.
|
| 160 |
+
|
| 161 |
+
In Figure 7 we visualize CIFAR10 “Bird” images with the extreme forms of example difficulty for ResNet18, as identified using the prediction depth in the training and validation splits. In the full dataset (left panel) we see that the prediction depth can be very different in the training and validation splits: the two prediction depths are typically similar for points where the consensus class is equal to the ground truth (right panel), but can be very different when the consensus class is different from the ground truth (middle panel). This behavior is consistently reproduced for all datasets and architectures in Appendix C.6.
|
| 162 |
+
|
| 163 |
+
Looking at these examples of the class “Bird” with different difficulty types, we observe that ResNet18 finds small garden birds easiest, while birds in flight against a blue background “look like airplanes”, ostriches are “ambiguous without their label” and the “ambiguous” examples are either unclear photographs or examples of rare sub-groups that don’t appear frequently in the data. We found the consensus-consistency of inputs that are “Ambiguous” or “Ambiguous without its label” to be significantly lower than those of examples that are “Easy” or “Look like a different class”.
|
| 164 |
+
|
| 165 |
+
In order to better understand how networks process examples with different, extreme forms of example difficulty, Fig. 8 examines how the k-NN confidence (fraction of votes) and accuracy of the ground truth class and of the consensus class progress, as validation points pass through the network. “Easy” examples are classified as their consensus class (which is equal to their ground truth class) in all k-NN probes and the confidence in the consensus class steadily increases as data points proceed through the hidden layers. Examples that “look like a different class” are also processed as members of their consensus class, similarly to “easy” examples. However, unlike “easy” examples, their consensus classes do not match their ground truth classes. Examples that are “ambiguous without their labels” are initially processed as members of their ground truth classes with intermediate confidence, but in later layers become mistaken for their consensus class. “Ambiguous” examples are processed with low confidence and accuracy in the early layers, for both ground truth and consensus classes. In later layers “ambiguous” examples are recognized, with intermediate confidence and accuracy, as members of the consensus class, which matches the ground truth class for a sizeable fraction of “ambiguous” examples.
|
| 166 |
+
|
| 167 |
+
Improving the prediction accuracy Can the prediction accuracy be improved using our understanding of how each class of difficult examples are processed by deep models? Figure 8 suggest that $\mathbf { k }$ -NN probes in intermediate layers may be more accurate than the full deep model for examples that are “ambiguous without their label” (data points closest to the lower right corner of Figure 7). In order to test this hypothesis, we compare the accuracy of the $\mathbf { k }$ -NN probe in layer 4 to the full model’s prediction for the 100 examples closest to the lower right corner of Figure 8. We obtain a striking improvement in accuracy from $2 5 \%$ to $98 \%$ for these examples. This showcases how insights from this study can be directly used to improve prediction accuracy.
|
| 168 |
+
|
| 169 |
+
# 5 Discussion
|
| 170 |
+
|
| 171 |
+
Summary We have introduced a notion of example difficulty called the prediction depth, which uses the processing of data inside the network to score the difficulty of an example. We have shown how the prediction depth is related to the accuracy and uncertainty of a prediction, the adversarial input margin and the output margin of the learned solution, and that data points that are easier according to the prediction depth are also typically learned earlier in training. We have also shown that the difficulty of an example can be both similar, or very different depending on whether an input appears in the validation split or the training split, and described four extremes of example difficulty. For data points that are “ambiguous without their label”, we have demonstrated how returning the $\mathbf { k }$ -NN prediction in a middle layer can lead to impressive increases in model accuracy: for CIFAR10 in ResNet18 we obtained an increase in accuracy from $2 5 \%$ to $98 \%$ for the inputs that are most “ambiguous without their label”.
|
| 172 |
+
|
| 173 |
+
Connecting known phenomena In the literature, the following phenomena are separately reported from different experimental paradigms:
|
| 174 |
+
|
| 175 |
+
1. Early layers generalize while later layers memorize (Stephenson et al., 2021).
|
| 176 |
+
2. Model layers converge from input layer towards output layer (Raghu et al., 2017; Morcos et al., 2018).
|
| 177 |
+
3. Deep models learn easy data (Jiang et al., 2021; Toneva et al., 2019) and simple functions first (Hu et al., 2020; Kalimeris et al., 2019).
|
| 178 |
+
|
| 179 |
+
Following this paper, a coherent and closely related picture emerges:
|
| 180 |
+
|
| 181 |
+
1. Predictions made in early layers are more likely to be consistent than those made in later layers. Consistent predictions are likely to be correct and the expected accuracy of inconsistent predictions is naturally low (Section 3.1).
|
| 182 |
+
2. Data points learned early in training typically have smaller prediction depths than those learned later during training (Section 3.2).
|
| 183 |
+
3. On average, deep neural networks exhibit wider input and output margins (common measures of “local simplicity”) in the vicinity of data with smaller prediction depths (Section 3.3).
|
| 184 |
+
|
| 185 |
+
Pertinence of example difficulty to topics in machine learning Curriculum Learning attempts to treat hard examples differently from easy examples during training. Robustness to distribution shifts that change the relative frequencies of common and rare subgroups in the test set (which we have shown can have different forms of example difficulty) is important for ML Fairness. Methods developed to address heteroscedastic uncertainty typically address example difficulty as a onedimensional quantity. We expand upon the relevance of our work to these three topics in Appendix D.
|
| 186 |
+
|
| 187 |
+
Limitations We believe that the results we report stem from a deep model’s representation, which is hierarchical by construction. We expect that the same results will therefore apply in larger models, larger datasets, and tasks other than image classification, but testing this remains as further work. Although we demonstrate that returning the results of a hidden k-NN can yield dramatic increases in accuracy for examples that are “ambiguous without their label”, we otherwise do not explore ways to practically apply the insights we present. In particular, we expressly do not claim that all that is required for good accuracy is to reduce the prediction depth: freezing later layers of the network would not be expected to result in good generalization.
|
| 188 |
+
|
| 189 |
+
# Funding Transparency Statement
|
| 190 |
+
|
| 191 |
+
This research was funded by, and undertaken at, Google. All calculations were performed using Google’s computer infrastructure.
|
| 192 |
+
|
| 193 |
+
# Acknowledgment
|
| 194 |
+
|
| 195 |
+
We would like to thank Hanie Sedghi, Ilya Tolstikhin, Ibrahim Alabdulmohsin, Daniel Keysers and Julian Eisenschlos for valuable discussions on the topic and Arthur Baldock for proofreading the manuscript.
|
| 196 |
+
|
| 197 |
+
# References
|
| 198 |
+
|
| 199 |
+
Agarwal, C. and Hooker, S. (2020). Estimating example difficulty using variance of gradients. In ICML, Workshop on Human Interpretability in Machine Learning (WHI).
|
| 200 |
+
Alain, G. and Bengio, Y. (2017). Understanding intermediate layers using linear classifier probes. In International Conference on Learning Representations (Workshop).
|
| 201 |
+
Arpit, D., Jastrzebski, S., Ballas, N., Krueger, D., Bengio, E., Kanwal, M. S., Maharaj, T., Fischer, A., Courville, A., Bengio, Y., et al. (2017). A closer look at memorization in deep networks. In International Conference on Machine Learning.
|
| 202 |
+
Bahri, D., Jiang, H., and Gupta, M. (2020). Deep k-nn for noisy labels. In International Conference on Machine Learning.
|
| 203 |
+
Bengio, Y., Louradour, J., Collobert, R., and Weston, J. (2009). Curriculum learning. In Proceedings of International Conference on Machine Learning.
|
| 204 |
+
Carlini, N., Erlingsson, U., and Papernot, N. (2019). Distribution density, tails, and outliers in machine learning: Metrics and applications. arXiv preprint arXiv:1910.13427.
|
| 205 |
+
Chatterjee, S. (2019). Coherent gradients: An approach to understanding generalization in gradient descent-based optimization. In International Conference on Learning Representations.
|
| 206 |
+
Cohen, G., Sapiro, G., and Giryes, R. (2018). Dnn or k-nn: That is the generalize vs. memorize question. In NeurIPS, Workshop on Integration of Deep Learning Theories.
|
| 207 |
+
Dehghani, M., Gouws, S., Vinyals, O., Uszkoreit, J., and Kaiser, L. (2018). Universal transformers. In International Conference on Learning Representations.
|
| 208 |
+
Elman, J. L. (1993). Learning and development in neural networks: The importance of starting small. Cognition, 48(1):71–99.
|
| 209 |
+
Feldman, V. and Zhang, C. (2020). What neural networks memorize and why: Discovering the long tail via influence estimation. In Proceedings of the 34th International Conference on Neural Information Processing Systems.
|
| 210 |
+
Ghorbani, B., Krishnan, S., and Xiao, Y. (2019). An investigation into neural net optimization via hessian eigenvalue density. In International Conference on Machine Learning.
|
| 211 |
+
Hacohen, G., Choshen, L., and Weinshall, D. (2020). Let’s agree to agree: Neural networks share classification order on real datasets. In International Conference on Machine Learning.
|
| 212 |
+
Hacohen, G. and Weinshall, D. (2019). On the power of curriculum learning in training deep networks. In International Conference on Machine Learning.
|
| 213 |
+
He, K., Zhang, X., Ren, S., and Sun, J. (2016). Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition.
|
| 214 |
+
Hooker, S., Courville, A., Clark, G., Dauphin, Y., and Frome, A. (2019). What do compressed deep neural networks forget? arXiv preprint arXiv:1911.05248.
|
| 215 |
+
Hooker, S., Moorosi, N., Clark, G., Bengio, S., and Denton, E. (2020). Characterising bias in compressed models. arXiv preprint arXiv:2010.03058.
|
| 216 |
+
Hu, W., Xiao, L., Adlam, B., and Pennington, J. (2020). The surprising simplicity of the early-time learning dynamics of neural networks. In Proceedings of the 34th International Conference on Neural Information Processing Systems.
|
| 217 |
+
Huang, G., Chen, D., Li, T., Wu, F., van der Maaten, L., and Weinberger, K. (2018). Multi-scale dense networks for resource efficient image classification. In International Conference on Learning Representations.
|
| 218 |
+
Jiang, Y., Krishnan, D., Mobahi, H., and Bengio, S. (2018). Predicting the generalization gap in deep networks with margin distributions. In International Conference on Learning Representations.
|
| 219 |
+
Jiang, Y., Neyshabur, B., Mobahi, H., Krishnan, D., and Bengio, S. (2020). Fantastic generalization measures and where to find them. In International Conference on Learning Representations.
|
| 220 |
+
Jiang, Z., Zhang, C., Talwar, K., and Mozer, M. C. (2021). Characterizing structural regularities of labeled data in overparameterized models. In International Conference on Machine Learning.
|
| 221 |
+
Kalimeris, D., Kaplun, G., Nakkiran, P., Edelman, B., Yang, T., Barak, B., and Zhang, H. (2019). Sgd on neural networks learns functions of increasing complexity. In Advances in Neural Information Processing Systems, volume 32.
|
| 222 |
+
Kawaguchi, K., Kaelbling, L. P., and Bengio, Y. (2017). Generalization in deep learning. arXiv preprint arXiv:1710.05468.
|
| 223 |
+
Kendall, A. and Gal, Y. (2017). What uncertainties do we need in bayesian deep learning for computer vision? In Proceedings of the 31st International Conference on Neural Information Processing Systems.
|
| 224 |
+
Kendall, A., Gal, Y., and Cipolla, R. (2018). Multi-task learning using uncertainty to weigh losses for scene geometry and semantics. In Proceedings of the IEEE conference on computer vision and pattern recognition.
|
| 225 |
+
Keskar, N. S., Nocedal, J., Tang, P. T. P., Mudigere, D., and Smelyanskiy, M. (2017). On large-batch training for deep learning: Generalization gap and sharp minima. In International Conference on Learning Representations.
|
| 226 |
+
Kolesnikov, A., Beyer, L., Zhai, X., Puigcerver, J., Yung, J., Gelly, S., and Houlsby, N. (2020). Big transfer (bit): General visual representation learning. In European Conference on Computer Vision.
|
| 227 |
+
Krizhevsky, A., Hinton, G., et al. (2009). Learning multiple layers of features from tiny images. Technical Report.
|
| 228 |
+
Lakshminarayanan, B., Pritzel, A., and Blundell, C. (2017). Simple and scalable predictive uncertainty estimation using deep ensembles. In Proceedings of the 31st International Conference on Neural Information Processing Systems.
|
| 229 |
+
Lalor, J. P., Wu, H., Munkhdalai, T., and Yu, H. (2018). Understanding deep learning performance through an examination of test set difficulty: A psychometric case study. In Proceedings of the Conference on Empirical Methods in Natural Language Processing.
|
| 230 |
+
Li, H., Xu, Z., Taylor, G., Studer, C., and Goldstein, T. (2018). Visualizing the loss landscape of neural nets. In Proceedings of the 32nd International Conference on Neural Information Processing Systems.
|
| 231 |
+
Liu, S., Niles-Weed, J., Razavian, N., and Fernandez-Granda, C. (2020a). Early-learning regularization prevents memorization of noisy labels. Advances in Neural Information Processing Systems, 33.
|
| 232 |
+
Liu, W., Zhou, P., Wang, Z., Zhao, Z., Deng, H., and JU, Q. (2020b). Fastbert: a self-distilling bert with adaptive inference time. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6035–6044.
|
| 233 |
+
Long, P. M. and Sedghi, H. (2019). Generalization bounds for deep convolutional neural networks. In International Conference on Learning Representations.
|
| 234 |
+
Mangalam, K. and Prabhu, V. (2019). Do deep neural networks learn shallow learnable examples first? In ICML, Workshop on Identifying and Understanding Deep Learning Phenomena.
|
| 235 |
+
Morcos, A. S., Raghu, M., and Bengio, S. (2018). Insights on representational similarity in neural networks with canonical correlation. In Proceedings of the 32nd International Conference on Neural Information Processing Systems.
|
| 236 |
+
Nagarajan, V., Andreassen, A., and Neyshabur, B. (2021). Understanding the failure modes of out-of-distribution generalization. In International Conference on Learning Representations.
|
| 237 |
+
Netzer, Y., Wang, T., Coates, A., Bissacco, A., Wu, B., and Ng, A. Y. (2011). Reading digits in natural images with unsupervised feature learning. Technical Report.
|
| 238 |
+
Neyshabur, B., Bhojanapalli, S., McAllester, D., and Srebro, N. (2017). Exploring generalization in deep learning. In Proceedings of the 31st International Conference on Neural Information Processing Systems.
|
| 239 |
+
Papernot, N. and McDaniel, P. (2018). Deep k-nearest neighbors: Towards confident, interpretable and robust deep learning. arXiv preprint arXiv:1803.04765.
|
| 240 |
+
Pennington, J. and Bahri, Y. (2017). Geometry of neural network loss surfaces via random matrix theory. In International Conference on Machine Learning.
|
| 241 |
+
Raghu, M., Gilmer, J., Yosinski, J., and Sohl-Dickstein, J. (2017). Svcca: singular vector canonical correlation analysis for deep learning dynamics and interpretability. In Proceedings of the 31st International Conference on Neural Information Processing Systems.
|
| 242 |
+
Recht, B., Roelofs, R., Schmidt, L., and Shankar, V. (2019). Do imagenet classifiers generalize to imagenet? In International Conference on Machine Learning.
|
| 243 |
+
Sagun, L., Bottou, L., and LeCun, Y. (2016). Eigenvalues of the hessian in deep learning: Singularity and beyond. arXiv preprint arXiv:1611.07476.
|
| 244 |
+
Sagun, L., Evci, U., Guney, V. U., Dauphin, Y., and Bottou, L. (2018). Empirical analysis of the hessian of over-parametrized neural networks. In International Conference on Learning Representations (Workshop).
|
| 245 |
+
Sanger, T. D. (1994). Neural network learning control of robot manipulators using gradually increasing task difficulty. IEEE transactions on Robotics and Automation, 10(3):323–333.
|
| 246 |
+
Schwartz, R., Stanovsky, G., Swayamdipta, S., Dodge, J., and Smith, N. A. (2020). The right tool for the job: Matching model and instance complexities. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics.
|
| 247 |
+
Simonyan, K. and Zisserman, A. (2015). Very deep convolutional networks for large-scale image recognition. In International Conference on Learning Representations.
|
| 248 |
+
Smith, S. L., Dherin, B., Barrett, D. G., and De, S. (2021). On the origin of implicit regularization in stochastic gradient descent. In International Conference on Learning Representations.
|
| 249 |
+
Smith, S. L., Kindermans, P.-J., Ying, C., and Le, Q. V. (2018). Don’t decay the learning rate, increase the batch size. In International Conference on Learning Representations.
|
| 250 |
+
Smith, S. L. and Le, Q. V. (2018). A bayesian perspective on generalization and stochastic gradient descent. In International Conference on Learning Representations.
|
| 251 |
+
Soudry, D., Hoffer, E., Nacson, M. S., Gunasekar, S., and Srebro, N. (2018). The implicit bias of gradient descent on separable data. The Journal of Machine Learning Research, 19(1):2822–2878.
|
| 252 |
+
Stephan, M., Hoffman, M. D., Blei, D. M., et al. (2017). Stochastic gradient descent as approximate bayesian inference. Journal of Machine Learning Research, 18(134):1–35.
|
| 253 |
+
Stephenson, C., suchismita padhy, Ganesh, A., Hui, Y., Tang, H., and Chung, S. (2021). On the geometry of generalization and memorization in deep neural networks. In International Conference on Learning Representations.
|
| 254 |
+
Teerapittayanon, S., McDanel, B., and Kung, H.-T. (2016). Branchynet: Fast inference via early exiting from deep neural networks. In International Conference on Pattern Recognition.
|
| 255 |
+
Toneva, M., Sordoni, A., des Combes, R. T., Trischler, A., Bengio, Y., and Gordon, G. J. (2019). An empirical study of example forgetting during deep neural network learning. In International Conference on Learning Representations.
|
| 256 |
+
Unterthiner, T., Keysers, D., Gelly, S., Bousquet, O., and Tolstikhin, I. (2020). Predicting neural network accuracy from weights. arXiv preprint arXiv:2002.11448.
|
| 257 |
+
Wen, Y., Tran, D., and Ba, J. (2019). Batchensemble: an alternative approach to efficient ensemble and lifelong learning. In International Conference on Learning Representations.
|
| 258 |
+
Wenzel, F., Snoek, J., Tran, D., and Jenatton, R. (2020). Hyperparameter ensembles for robustness and uncertainty quantification. In Proceedings of the 34th International Conference on Neural Information Processing Systems.
|
| 259 |
+
Wu, X., Dyer, E., and Neyshabur, B. (2021). When do curricula work? In International Conference on Learning Representations.
|
| 260 |
+
Xiao, H., Rasul, K., and Vollgraf, R. (2017). Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms. arXiv preprint arXiv:1708.07747.
|
| 261 |
+
Xin, J., Tang, R., Lee, J., Yu, Y., and Lin, J. (2020). Deebert: Dynamic early exiting for accelerating bert inference. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics.
|
| 262 |
+
Yao, Z., Gholami, A., Keutzer, K., and Mahoney, M. (2020). Pyhessian: Neural networks through the lens of the hessian. In International Conference on Machine Learning (Workshop).
|
| 263 |
+
Zielinski, P., Krishnan, S., and Chatterjee, S. (2020). Weak and strong gradient directions: Explaining memorization, generalization, and hardness of examples at scale. arXiv preprint arXiv:2003.07422.
|
md/train/iKQAk8a2kM0/iKQAk8a2kM0.md
ADDED
|
@@ -0,0 +1,434 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TARGETED ATTACK AGAINST DEEP NEURAL NET-WORKS VIA FLIPPING LIMITED WEIGHT BITS
|
| 2 |
+
|
| 3 |
+
Jiawang Bai 1, 2 †, Baoyuan $\mathbf { W } \mathbf { u } ^ { 3 , 4 }$ , Yong Zhang 5, Yiming Li 1, Zhifeng Li 5, Shu-Tao Xia 1, 2
|
| 4 |
+
|
| 5 |
+
1 Tsinghua Shenzhen International Graduate School, Tsinghua University
|
| 6 |
+
2 PCL Research Center of Networks and Communications, Peng Cheng Laboratory
|
| 7 |
+
3 School of Data Science, The Chinese University of Hong Kong, Shenzhen
|
| 8 |
+
4 Secure Computing Lab of Big Data, Shenzhen Research Institute of Big Data
|
| 9 |
+
5 Tencent AI Lab
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
To explore the vulnerability of deep neural networks (DNNs), many attack paradigms have been well studied, such as the poisoning-based backdoor attack in the training stage and the adversarial attack in the inference stage. In this paper, we study a novel attack paradigm, which modifies model parameters in the deployment stage for malicious purposes. Specifically, our goal is to misclassify a specific sample into a target class without any sample modification, while not significantly reduce the prediction accuracy of other samples to ensure the stealthiness. To this end, we formulate this problem as a binary integer programming (BIP), since the parameters are stored as binary bits (i.e., 0 and 1) in the memory. By utilizing the latest technique in integer programming, we equivalently reformulate this BIP problem as a continuous optimization problem, which can be effectively and efficiently solved using the alternating direction method of multipliers (ADMM) method. Consequently, the flipped critical bits can be easily determined through optimization, rather than using a heuristic strategy. Extensive experiments demonstrate the superiority of our method in attacking DNNs. The code is available at: https://github.com/jiawangbai/TA-LBF.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Due to the great success of deep neural networks (DNNs), its vulnerability (Szegedy et al., 2014; Gu et al., 2019) has attracted great attention, especially for security-critical applications (e.g., face recognition (Dong et al., 2019) and autonomous driving (Eykholt et al., 2018)). For example, backdoor attack (Saha et al., 2020; Xie et al., 2019) manipulates the behavior of the DNN model by mainly poisoning some training data in the training stage; adversarial attack (Goodfellow et al., 2015; Moosavi-Dezfooli et al., 2017) aims to fool the DNN model by adding malicious perturbations onto the input in the inference stage.
|
| 18 |
+
|
| 19 |
+
Compared to the backdoor attack and adversarial attack, a novel attack paradigm, dubbed weight attack (Breier et al., 2018), has been rarely studied. It assumes that the attacker has full access to the memory of a device, such that he/she can directly change the parameters of a deployed model to achieve some malicious purposes (e.g., crushing a fully functional DNN and converting it to a random output generator (Rakin et al., 2019)). Since weight attack neither modifies the input nor control the training process, both the service provider and the user are difficult to realize the existence of the attack. In practice, since the deployed DNN model is stored as binary bits in the memory, the attacker can modify the model parameters using some physical fault injection techniques, such as Row Hammer Attack (Agoyan et al., 2010; Selmke et al., 2015) and Laser Beam Attack (Kim et al., 2014). These techniques can precisely flip any bit of the data in the memory. Some previous works (Rakin et al., 2019; 2020a;b) have demonstrated that it is feasible to change the model weights via bit flipping to achieve some malicious purposes. However, the critical bits are identified mostly using some heuristic strategies in their methods. For example, Rakin et al. (2019) combined gradient ranking and progressive search to identify the critical bits for flipping.
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1: Demonstration of our proposed attack against a deployed DNN in the memory. By flipping critical bits (marked in red), our method can mislead a specific sample into the target class without any sample modification while not significantly reduce the prediction accuracy of other samples.
|
| 23 |
+
|
| 24 |
+
This work also focuses on the bit-level weight attack against DNNs in the deployment stage, whereas with two different goals, including effectiveness and stealthiness. The effectiveness requires that the attacked model can misclassify a specific sample to a attacker-specified target class without any sample modification, while the stealthiness encourages that the prediction accuracy of other samples will not be significantly reduced. As shown in Fig. 1, to achieve these goals, we propose to identify and flip bits that are critical to the prediction of the specific sample but not significantly impact the prediction of other samples. Specifically, we treat each bit in the memory as a binary variable, and our task is to determine its state (i.e., 0 or 1). Accordingly, it can be formulated as a binary integer programming (BIP) problem. To further improve the stealthiness, we also limit the number of flipped bits, which can be formulated as a cardinality constraint. However, how to solve the BIP problem with a cardinality constraint is a challenging problem. Fortunately, inspired by an advanced optimization method, the $\ell _ { p }$ -box ADMM (Wu & Ghanem, 2018), this problem can be reformulated as a continuous optimization problem, which can further be efficiently and effectively solved by the alternating direction method of multipliers (ADMM) (Glowinski & Marroco, 1975; Gabay & Mercier, 1976). Consequently, the flipped bits can be determined through optimization rather than the original heuristic strategy, which makes our attack more effective. Note that we also conduct attack against the quantized DNN models, following the setting in some related works (Rakin et al., 2019; 2020a). Extensive experiments demonstrate the superiority of the proposed method over several existing weight attacks. For example, our method achieves a $100 \%$ attack success rate with 7.37 bit-flips and $0 . 0 9 \%$ accuracy degradation of the rest unspecific inputs in attacking a 8-bit quantized ResNet-18 model on ImageNet. Moreover, we also demonstrate that the proposed method is also more resistant to existing defense methods.
|
| 25 |
+
|
| 26 |
+
The main contributions of this work are three-fold. 1) We explore a novel attack scenario where the attacker enforces a specific sample to be predicted as a target class by modifying the weights of a deployed model via bit flipping without any sample modification. 2) We formulate the attack as a BIP problem with the cardinality constraint and propose an effective and efficient method to solve this problem. 3) Extensive experiments verify the superiority of the proposed method against DNNs with or without defenses.
|
| 27 |
+
|
| 28 |
+
# 2 RELATED WORKS
|
| 29 |
+
|
| 30 |
+
Neural Network Weight Attack. How to perturb the weights of a trained DNN for malicious purposes received extensive attention (Liu et al., 2017a; 2018b; Hong et al., 2019). Liu et al. (2017a) firstly proposed two schemes to modify model parameters for misclassification without and with considering stealthiness, which is dubbed single bias attack (SBA) and gradient descent attack (GDA) respectively. After that, Trojan attack (Liu et al., 2018b) was proposed, which injects malicious behavior to the DNN by generating a general trojan trigger and then retraining the model. This method requires to change lots of parameters. Recently, fault sneaking attack (FSA) (Zhao et al., 2019) was proposed, which aims to misclassify certain samples into a target class by modifying the DNN parameters with two constraints, including maintaining the classification accuracy of other samples and minimizing parameter modifications. Note that all those methods are designed to misclassify multiple samples instead of a specific sample, which may probably modify lots of parameters or degrade the accuracy of other samples sharply.
|
| 31 |
+
|
| 32 |
+
Bit-Flip based Attack. Recently, some physical fault injection techniques (Agoyan et al., 2010; Kim et al., 2014; Selmke et al., 2015) were proposed, which can be adopted to precisely flip any bit in the memory. Those techniques promote researchers to study how to modify model parameters at the bit-level. As a branch of weight attack, the bit-flip based attack was firstly explored in (Rakin et al., 2019). It proposed an untargeted attack that can convert the attacked DNN to a random output generator with several bit-flips. Besides, Rakin et al. (2020a) proposed the targeted bit Trojan (TBT) to inject the fault into DNNs by flipping some critical bits. Specifically, the attacker flips the identified bits to force the network to classify all samples embedded with a trigger to a certain target class, while the network operates with normal inference accuracy with benign samples. Most recently, Rakin et al. (2020b) proposed the targeted bit-flip attack (T-BFA), which achieves malicious purposes without modifying samples. Specifically, T-BFA can mislead samples from single source class or all classes to a target class by flipping the identified weight bits. It is worth noting that the above bit-flip based attacks leverage heuristic strategies to identify critical weight bits. How to find critical bits for the bit-flip based attack method is still an important open question.
|
| 33 |
+
|
| 34 |
+
# 3 TARGETED ATTACK WITH LIMITED BIT-FLIPS (TA-LBF)
|
| 35 |
+
|
| 36 |
+
# 3.1 PRELIMINARIES
|
| 37 |
+
|
| 38 |
+
Storage and Calculation of Quantized DNNs. Currently, it is a widely-used technique to quantize DNNs before deploying on devices for efficiency and reducing storage size. For each weight in $l$ -th layer of a Q-bit quantized DNN, it will be represented and then stored as the signed integer in two’s complement representation $( v = [ v _ { Q } ; v _ { Q - 1 } ; . . . ; v _ { 1 } ] \in \{ 0 , 1 \} ^ { Q } )$ in the memory. Attacker can modify the weights of DNNs through flipping the stored binary bits. In this work, we adopt the layer-wise uniform weight quantization scheme similar to Tensor-RT (Migacz, 2017). Accordingly, each binary vector $\textbf { { v } }$ can be converted to a real number by a function $h ( \cdot )$ , as follow:
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
h ( \pmb { v } ) = ( - 2 ^ { Q - 1 } \cdot v _ { Q } + \sum _ { i = 1 } ^ { Q - 1 } 2 ^ { i - 1 } \cdot v _ { i } ) \cdot \Delta ^ { l } ,
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
where $l$ indicates which layer the weight is from, $\Delta ^ { l } > 0$ is a known and stored constant which represents the step size of the $l$ -th layer weight quantizer.
|
| 45 |
+
|
| 46 |
+
Notations. We denote a $\mathbf { Q }$ -bit quantized DNN-based classification model as $f : \mathcal { X } \mathcal { Y }$ , where $\boldsymbol { \mathcal { X } } \in \mathbb { R } ^ { d }$ being the input space and $\mathcal { V } \in \{ 1 , 2 , . . . , K \}$ being the $K$ -class output space. Assuming that the last layer of this DNN model is a fully-connected layer with $\pmb { \mathsf { B } } \in \mathsf { \bar { \Omega } } \{ 0 , 1 \} ^ { K \times C \times Q }$ being the quantized weights, where $C$ is the dimension of last layer’s input. Let $\bar { \mathsf { B } _ { i , j } } \in \bar { \{ 0 , 1 \} } ^ { Q }$ be the two’s complement representation of a single weight and $\pmb { \mathsf { B } } _ { i } \in \{ 0 , 1 \} ^ { C \times Q }$ denotes all the binary weights connected to the $i$ -th output neuron. Given a test sample $_ { \textbf { \em x } }$ with the ground-truth label $s$ , $f ( \bar { x ; \Theta } , \bar { \Theta } ) \in [ 0 , 1 ] ^ { K }$ is the output probability vector and $g ( \bar { \pmb { x } } ; \Theta ) \in \mathbb { R } ^ { C }$ is the input of the last layer, where $\Theta$ denotes the model parameters without the last layer.
|
| 47 |
+
|
| 48 |
+
Attack Scenario. In this paper, we focus on the white-box bit-flip based attack, which was first introduced in (Rakin et al., 2019). Specifically, we assume that the attacker has full knowledge of the model (including it’s architecture, parameters, and parameters’ location in the memory), and can precisely flip any bit in the memory. Besides, we also assume that attackers can have access to a small portion of benign samples, but they can not tamper the training process and the training data.
|
| 49 |
+
|
| 50 |
+
Attacker’s Goals. Attackers have two main goals, including the effectiveness and the stealthiness. Specifically, effectiveness requires that the attacked model can misclassify a specific sample to a predefined target class without any sample modification, and the stealthiness requires that the prediction accuracy of other samples will not be significantly reduced.
|
| 51 |
+
|
| 52 |
+
# 3.2 THE PROPOSED METHOD
|
| 53 |
+
|
| 54 |
+
Loss for Ensuring Effectiveness. Recall that our first target is to force a specific image to be classified as the target class by modifying the model parameters at the bit-level. To this end, the most straightforward way is maximizing the logit of the target class while minimizing that of the source class. For a sample $_ { \textbf { \em x } }$ , the logit of a class can be directly determined by the input of the last layer $g ( \pmb { x } ; \Theta )$ and weights connected to the node of that class. Accordingly, we can modify weights only connected to the source and target class to fulfill our purpose, as follows:
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\begin{array} { r } { \mathcal { L } _ { 1 } ( x ; \Theta , \underline { { \mathsf { B } } } , \hat { \mathsf { B } } _ { s } , \hat { \mathsf { B } } _ { t } ) = \operatorname* { m a x } \big ( m - p ( x ; \Theta , \hat { \mathsf { B } } _ { t } ) + \delta , 0 \big ) + \operatorname* { m a x } \big ( p ( x ; \Theta , \hat { \mathsf { B } } _ { s } ) - m + \delta , 0 \big ) , } \end{array}
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
wher $: p ( \pmb { x } ; \Theta , \hat { \mathbf { B } } _ { i } ) = [ h ( \hat { \mathbf { B } } _ { i , 1 } ) ; h ( \hat { \mathbf { B } } _ { i , 2 } ) ; . . . ; h ( \hat { \mathbf { B } } _ { i , C } ) ] ^ { \top } g ( \pmb { x } ; \Theta )$ denotes the logit of class $i$ $( i = s$ or $i = t$ ), $h ( \cdot )$ is the function defined in Eq. (1), $m = \operatorname* { m a x } _ { i \in \{ 0 , . . . , K \} \setminus \{ s \} } p ( x ; \Theta , { \\bf B } _ { i } )$ , and $\delta \ \in \ \mathbb { R }$ indicates a slack variable, which will be specified in later experiments. The first term of $\mathcal { L } _ { 1 }$ aims at increasing the logit of the target class, while the second term is to decrease the logit of the source class. The loss $\mathcal { L } _ { 1 }$ is 0 only when the output on target class is more than $m + \delta$ and the output on source class is less than $m - \delta$ . That is, the prediction on $_ { \textbf { \em x } }$ of the target model is the predefined target class. Note that $\hat { \mathbf { B } } _ { s } , \hat { \mathbf { B } } _ { t } \in \{ 0 , 1 \} ^ { C \times Q }$ are two variables we want to optimize, corresponding to the weights of the fully-connected layer w.r.t. class $s$ and $t$ , respectively, in the target DNN model. $\pmb { \mathsf { B } } \in \{ 0 , 1 \} ^ { K \times C \times Q }$ denotes the weights of the fully-connected layer of the original DNN model, and it is a constant tensor in $\mathcal { L } _ { 1 }$ . For clarity, hereafter we simplify $\mathcal { L } _ { 1 } ( \pmb { x } ; \Theta , \pmb { \mathsf { B } } , \hat { \pmb { \mathsf { B } } } _ { s } , \hat { \pmb { \mathsf { B } } } _ { t } )$ as $\mathcal { L } _ { 1 } ( \hat { \mathbf { B } } _ { s } , \hat { \mathbf { B } } _ { t } )$ , since $_ { \textbf { \em x } }$ and $\Theta$ are also provided input and weights.
|
| 61 |
+
|
| 62 |
+
Loss for Ensuring Stealthiness. As we mentioned in Section 3.1, we assume that the attacker can get access to an auxiliary sample set $\{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { N }$ . Accordingly, the stealthiness of the attack can be formulated as follows:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\mathcal { L } _ { 2 } ( \hat { \mathbf { B } } _ { s } , \hat { \mathbf { B } } _ { t } ) = \sum _ { i = 1 } ^ { N } \ell ( f ( \boldsymbol { x } _ { i } ; \boldsymbol { \Theta } , \mathbf { B } _ { \left\{ 1 , \dots , K \right\} \setminus \left\{ s , t \right\} } , \hat { \mathbf { B } } _ { s } , \hat { \mathbf { B } } _ { t } ) , y _ { i } ) ,
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
where $\mathsf { B } _ { \{ 1 , . . . , K \} \backslash \{ s , t \} }$ denotes $\{ \mathsf { B } _ { 1 } , \mathsf { B } _ { 2 } , . . . , \mathsf { B } _ { K } \} \backslash \{ \mathsf { B } _ { s } , \mathsf { B } _ { t } \}$ , and $f _ { j } ( x _ { i } ; \Theta , { \tt B } _ { \{ 1 , \ldots , K \} \backslash \{ s , t \} } , \hat { { \bf B } } _ { s } , \hat { { \bf B } } _ { t } )$ indicates the posterior probability of $\mathbf { \Delta } \mathbf { x } _ { i } \textrm { \textmu } _ { \mathrm { { + } } }$ . class $j$ , caclulated by $\mathrm { S o f t m a x } ( p ( { \pmb x } _ { i } ; { \pmb \Theta } , \hat { { \bf B } } _ { j } ) )$ or Softmax $( p ( \pmb { x } _ { i } ; \Theta , \pmb { \mathsf { B } } _ { j } ) )$ . $\ell ( \cdot , \cdot )$ is specified by the cross entropy loss. To keep clarity, $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ , $\Theta$ and $\pmb { \mathsf { B } } _ { \{ 1 , . . . , K \} \backslash \{ s , t \} }$ are omitted in $\mathcal { L } _ { 2 } ( \hat { \mathbf { B } } _ { s } , \hat { \mathbf { B } } _ { t } )$ .
|
| 69 |
+
|
| 70 |
+
Besides, to better meet our goal, a straightforward additional approach is reducing the magnitude of the modification. In this paper, we constrain the number of bit-flips less than $k$ . Physical bit flipping techniques can be time-consuming as discussed in (Van Der Veen et al., 2016; Zhao et al., 2019). Moreover, such techniques lead to abnormal behaviors in the attacked system (e.g., suspicious cache activity of processes), which may be detected by some physical detection-based defenses (Gruss et al., 2018). As such, minimizing the number of bit-flips is critical to make the attack more efficient and practical.
|
| 71 |
+
|
| 72 |
+
Overall Objective. In conclusion, the final objective function is as follows:
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\begin{array} { r l } { \displaystyle \operatorname* { m i n } _ { { \hat { \mathbf { B } } } _ { s } , \hat { \mathbf { B } } _ { t } } } & { \displaystyle \mathcal { L } _ { 1 } ( \hat { \mathbf { B } } _ { s } , \hat { \mathbf { B } } _ { t } ) + \lambda \mathcal { L } _ { 2 } ( \hat { \mathbf { B } } _ { s } , \hat { \mathbf { B } } _ { t } ) , } \\ { \displaystyle \hat { \mathbf { 3 } } _ { s } \in \{ 0 , 1 \} ^ { C \times Q } , ~ \hat { \mathbf { B } } _ { t } \in \{ 0 , 1 \} ^ { C \times Q } , ~ d _ { H } ( \mathbf { B } _ { s } , \hat { \mathbf { B } } _ { s } ) + d _ { H } ( \mathbf { B } _ { t } , \hat { \mathbf { B } } _ { t } ) \leq k , } \end{array}
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
where $d _ { H } ( \cdot , \cdot )$ denotes the Hamming distance and $\lambda > 0$ is a trade-off parameter.
|
| 79 |
+
|
| 80 |
+
For the sake of brevity, $\mathsf { B } _ { s }$ and $\mathtt { B } _ { t }$ are concatenated and further reshaped to the vector $b \in \{ 0 , 1 \} ^ { 2 C Q }$ . Similarly, $\hat { \mathbf { B } } _ { s }$ and $\hat { \mathbf { B } } _ { t }$ are concatenated and further reshaped to the vector $\hat { \pmb { b } } \in \{ 0 , 1 \} ^ { 2 C Q }$ . Besides, for binary vector $^ { b }$ and $\hat { b }$ , there exists a nice relationship between Hamming distance and Euclidean distance: $d _ { H } ( \pmb { b } , \hat { \pmb { b } } ) = | | \pmb { b } - \hat { \pmb { b } } | | _ { 2 } ^ { 2 }$ . The new formulation of the objective is as follows:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\operatorname* { m i n } _ { \hat { \boldsymbol b } } \quad \mathcal L _ { 1 } ( \hat { \boldsymbol b } ) + \lambda \mathcal L _ { 2 } ( \hat { \boldsymbol b } ) , \quad \mathrm { s . t . } ~ \hat { \boldsymbol b } \in \{ 0 , 1 \} ^ { 2 C Q } , ~ \vert \vert \boldsymbol b - \hat { \boldsymbol b } \vert \vert _ { 2 } ^ { 2 } - \boldsymbol k \leq 0 .
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
Problem (5) is denoted as TA-LBF (targeted attack with limited bit-flips). Note that TA-LBF is a binary integer programming (BIP) problem, whose optimization is challenging. We will introduce an effective and efficient method to solve it in the following section.
|
| 87 |
+
|
| 88 |
+
# 3.3 AN EFFECTIVE OPTIMIZATION METHOD FOR TA-LBF
|
| 89 |
+
|
| 90 |
+
To solve the challenging BIP problem (5), we adopt the generic solver for integer programming, dubbed $\ell _ { p }$ -Box ADMM (Wu & Ghanem, 2018). The solver presents its superior performance in many tasks, e.g., model pruning (Li et al., 2019), clustering (Bibi et al., 2019), MAP inference (Wu et al., 2020a), adversarial attack (Fan et al., 2020), etc.. It proposed to replace the binary constraint equivalently by the intersection of two continuous constraints, as follows
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
\hat { \pmb { b } } \in \{ 0 , 1 \} ^ { 2 C Q } \Leftrightarrow \hat { \pmb { b } } \in ( S _ { b } \cap \mathcal { S } _ { p } ) ,
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
where $\begin{array} { r } { \mathcal { S } _ { b } = [ 0 , 1 ] ^ { 2 C Q } } \end{array}$ indicates the box constraint, and $\begin{array} { r } { \mathcal { S } _ { p } = \{ \hat { \pmb { b } } : | | \hat { \pmb { b } } - \frac { \pmb { 1 } } { 2 } | | _ { 2 } ^ { 2 } = \frac { 2 C Q } { 4 } \} } \end{array}$ denotes the $\ell _ { 2 }$ -sphere constraint. Utilizing (6), Problem (5) is equivalently reformulated as
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\operatorname* { m i n } _ { \substack { \hat { b } , u _ { 1 } \in S _ { b } , u _ { 2 } \in S _ { p } , u _ { 3 } \in \mathbb { R } ^ { + } } } \quad \mathcal { L } _ { 1 } ( \hat { b } ) + \lambda \mathcal { L } _ { 2 } ( \hat { b } ) , \quad \mathrm { s . t . ~ } \hat { b } = u _ { 1 } , \hat { b } = u _ { 2 } , \vert \vert \hat { b } - \hat { b } \vert \vert _ { 2 } ^ { 2 } - k + u _ { 3 } = 0 ,
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
where two extra variables $\mathbf { \delta u } _ { 1 }$ and $\mathbf { \delta } \mathbf { u } _ { 2 }$ are introduced to split the constraints $w . r . t . \hat { b }$ . Besides, the nonnegative slack variable $u _ { 3 } \in \mathbb { R } ^ { + }$ is used to transform $| | \pmb { b } - \hat { \pmb { b } } | | _ { 2 } ^ { 2 } - k \le 0$ in (5) into $\begin{array} { r } { | | b - \hat { b } | | _ { 2 } ^ { 2 } - k + u _ { 3 } = } \end{array}$ 0. The above constrained optimization problem can be efficiently solved by the alternating direction method of multipliers (ADMM) (Boyd et al., 2011).
|
| 103 |
+
|
| 104 |
+
Following the standard procedure of ADMM, we firstly present the augmented Lagrangian function of the above problem, as follows:
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
\begin{array} { r l } & { L ( \hat { b } , u _ { 1 } , u _ { 2 } , u _ { 3 } , z _ { 1 } , z _ { 2 } , z _ { 3 } ) = \mathcal { L } _ { 1 } ( \hat { b } ) + \lambda \mathcal { L } _ { 2 } ( \hat { b } ) + z _ { 1 } ^ { \top } ( \hat { b } - u _ { 1 } ) + z _ { 2 } ^ { \top } ( \hat { b } - u _ { 2 } ) } \\ & { \quad \quad \quad \quad \quad \quad + z _ { 3 } ( | | b - \hat { b } | | _ { 2 } ^ { 2 } - k + u _ { 3 } ) + c _ { 1 } ( u _ { 1 } ) + c _ { 2 } ( u _ { 2 } ) + c _ { 3 } ( u _ { 3 } ) } \\ & { \quad \quad \quad \quad \quad \quad \quad + \frac { \rho _ { 1 } } { 2 } | | \hat { b } - u _ { 1 } | | _ { 2 } ^ { 2 } + \frac { \rho _ { 2 } } { 2 } | | \hat { b } - u _ { 2 } | | _ { 2 } ^ { 2 } + \frac { \rho _ { 3 } } { 2 } ( | | b - \hat { b } | | _ { 2 } ^ { 2 } - k + u _ { 3 } ) ^ { 2 } , } \end{array}
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
where $z _ { 1 } , z _ { 2 } \in \mathbb { R } ^ { 2 C Q }$ and $z _ { 3 } \in \mathbb { R }$ are dual variables, and $\rho _ { 1 } , \rho _ { 2 } , \rho _ { 3 } > 0$ are penalty factors, which will be specified later. $c _ { 1 } ( { \pmb u } _ { 1 } ) = \mathbb { I } _ { \{ { \pmb u } _ { 1 } \in { \pmb S } _ { b } \} }$ , $c _ { 2 } ( { \pmb u } _ { 2 } ) = \mathbb { I } _ { \{ { \pmb u } _ { 2 } \in { \pmb S } _ { p } \} }$ , and $c _ { 3 } ( u _ { 3 } ) = \mathbb { I } _ { \{ u _ { 3 } \in \mathbb { R } ^ { + } \} }$ capture the constraints ${ \cal S } _ { b } , { \cal S } _ { p }$ and $\mathbb { R } ^ { + }$ , respectively. The indicator function $\mathbb { I } _ { \{ a \} } = 0$ if $a$ is true; otherwise, $\mathbb { I } _ { \{ a \} } = + \infty$ . Based on the augmented Lagrangian function, the primary and dual variables are updated iteratively, with $r$ indicating the iteration index.
|
| 111 |
+
|
| 112 |
+
Given $( \hat { b } ^ { r } , z _ { 1 } ^ { r } , z _ { 2 } ^ { r } , z _ { 3 } ^ { r } )$ , update $( { \pmb u } _ { 1 } ^ { r + 1 } , { \pmb u } _ { 2 } ^ { r + 1 } , { \pmb u } _ { 3 } ^ { r + 1 } )$ . Given $( \hat { b } ^ { r } , z _ { 1 } ^ { r } , z _ { 2 } ^ { r } , z _ { 3 } ^ { r } )$ , $( { \pmb u } _ { 1 } , { \pmb u } _ { 2 } , { \pmb u } _ { 3 } )$ are independent, and they can be optimized in parallel, as follows
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\left\{ \begin{array} { l l } { u _ { 1 } ^ { r + 1 } = \underset { u _ { 1 } \in S _ { b } } { \mathrm { a r g } \mathrm { m i n } } \ ( z _ { 1 } ^ { r } ) ^ { \top } ( \hat { b } ^ { r } - u _ { 1 } ) + \frac { \rho _ { 1 } } { 2 } | | \hat { b } ^ { r } - u _ { 1 } | | _ { 2 } ^ { 2 } = \mathcal { P } _ { S _ { b } } ( \hat { b } ^ { r } + \frac { z _ { 1 } ^ { r } } { \rho _ { 1 } } ) , } \\ { u _ { 2 } ^ { r + 1 } = \underset { u _ { 2 } \in S _ { p } } { \mathrm { a r g } \mathrm { m i n } } \ ( z _ { 2 } ^ { r } ) ^ { \top } ( \hat { b } ^ { r } - u _ { 2 } ) + \frac { \rho _ { 2 } } { 2 } | | \hat { b } ^ { r } - u _ { 2 } | | _ { 2 } ^ { 2 } = \mathcal { P } _ { S _ { p } } ( \hat { b } ^ { r } + \frac { z _ { 2 } ^ { r } } { \rho _ { 2 } } ) , } \\ { u _ { 3 } ^ { r + 1 } = \underset { u _ { 3 } \in \mathbb { R } ^ { + } } { \mathrm { a r g } \mathrm { m i n } } z _ { 3 } ^ { r } ( | | b - \hat { b } ^ { r } | | _ { 2 } ^ { 2 } - k + u _ { 3 } ) + \frac { \rho _ { 3 } } { 2 } ( | | b - \hat { b } ^ { r } | | _ { 2 } ^ { 2 } - k + u _ { 3 } ) ^ { 2 } } \\ { \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 \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad = \mathcal { P } _ { \mathbb { R } ^ { + } } ( - | | b - \hat { b } ^ { r } | | _ { 2 } ^ { 2 } + k - \frac { z _ { 3 } ^ { r } } { \rho _ { 3 } } ) , } \end{array} \right.
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
where $\mathcal { P } _ { S _ { b } } ( \pmb { a } ) = \operatorname* { m i n } ( ( \mathbf { 1 } , \operatorname* { m a x } ( \mathbf { 0 } , \pmb { a } ) )$ with $\mathbf { \pmb { a } } \in \mathbb { R } ^ { n }$ is the projection onto the box constraint $\boldsymbol { S } _ { b }$ ; $\begin{array} { r } { \mathcal { P } _ { S _ { p } } ( \pmb { a } ) = \frac { \sqrt { n } } { 2 } \frac { \bar { \pmb { a } } } { | | \pmb { a } | | } + \frac { 1 } { 2 } } \end{array}$ with $\begin{array} { r } { \bar { \mathbf { a } } = \mathbf { a } - \frac { \mathbf { 1 } } { 2 } } \end{array}$ indicates the projection onto the $\ell _ { 2 }$ -sphere constraint $S _ { p }$ (Wu & Ghanem, 2018); ${ \mathcal { P } } _ { \mathbb { R } ^ { + } } ( a ) = \operatorname* { m a x } ( 0 , a )$ with $a \in \mathbb { R }$ indicates the projection onto $\mathbb { R } ^ { + }$ .
|
| 119 |
+
|
| 120 |
+
Given $( { \pmb u } _ { 1 } ^ { r + 1 } , { \pmb u } _ { 2 } ^ { r + 1 } , { \pmb u } _ { 3 } ^ { r + 1 } , z _ { 1 } ^ { r } , z _ { 2 } ^ { r } , z _ { 3 } ^ { r } )$ , update $\hat { b } ^ { r + 1 }$ . Although there is no closed-form solution to $\hat { b } ^ { r + 1 }$ , it can be easily updated by the gradient descent method, as both $\mathcal { L } _ { 1 } ( \hat { b } )$ and $\mathcal { L } _ { 2 } ( \hat { b } )$ are differentiable w.r.t. $\hat { b }$ , as follows
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\hat { \boldsymbol { b } } ^ { r + 1 } \gets \hat { \boldsymbol { b } } ^ { r } - \eta \cdot \frac { \partial L ( \hat { \boldsymbol { b } } , \boldsymbol { u } _ { 1 } ^ { r + 1 } , \boldsymbol { u } _ { 2 } ^ { r + 1 } , \boldsymbol { u } _ { 3 } ^ { r + 1 } , z _ { 1 } ^ { r } , z _ { 2 } ^ { r } , z _ { 3 } ^ { r } ) } { \partial \hat { \boldsymbol { b } } } \Big | _ { \hat { \boldsymbol { b } } = \hat { \boldsymbol { b } } ^ { r } } ,
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
where $\eta > 0$ denotes the step size. Note that we can run multiple steps of gradient descent in the above update. Both the number of steps and $\eta$ will be specified in later experiments. Besides, due to the space limit, the detailed derivation of $\partial L / \partial \hat { \boldsymbol { b } }$ will be presented in Appendix A.
|
| 127 |
+
|
| 128 |
+
Given $( \hat { b } ^ { r + 1 } , { \pmb u } _ { 1 } ^ { r + 1 } , { \pmb u } _ { 2 } ^ { r + 1 } , u _ { 3 } ^ { r + 1 } )$ , update $( z _ { 1 } ^ { r + 1 } , z _ { 2 } ^ { r + 1 } , z _ { 3 } ^ { r + 1 } )$ . The dual variables are updated by the gradient ascent method, as follows
|
| 129 |
+
|
| 130 |
+
$$
|
| 131 |
+
\left\{ \begin{array} { l } { z _ { 1 } ^ { r + 1 } = z _ { 1 } ^ { r } + \rho _ { 1 } ( \hat { b } ^ { r + 1 } - { \pmb u } _ { 1 } ^ { r + 1 } ) , } \\ { z _ { 2 } ^ { r + 1 } = z _ { 2 } ^ { r } + \rho _ { 2 } ( \hat { b } ^ { r + 1 } - { \pmb u } _ { 2 } ^ { r + 1 } ) , } \\ { z _ { 3 } ^ { r + 1 } = z _ { 3 } ^ { r } + \rho _ { 3 } ( | | { \pmb b } - \hat { { \pmb b } } ^ { r + 1 } | | _ { 2 } ^ { 2 } - k + u _ { 3 } ^ { r + 1 } ) . } \end{array} \right.
|
| 132 |
+
$$
|
| 133 |
+
|
| 134 |
+
Remarks. 1) Note that since $( { \pmb u } _ { 1 } ^ { r + 1 } , { \pmb u } _ { 2 } ^ { r + 1 } , { \pmb u } _ { 3 } ^ { r + 1 } )$ are updated in parallel, their updates belong to the same block. Thus, the above algorithm is a two-block ADMM algorithm. We provide the algorithm outline in Appendix B. 2) Except for the update of $\hat { b } ^ { r + 1 }$ , all other updates are very simple and efficient. The computational cost of the whole algorithm will be analyzed in Appendix C. 3) Due to the inexact solution to $\hat { b } ^ { r + 1 }$ using gradient descent, the theoretical convergence of the whole ADMM algorithm cannot be guaranteed. However, as demonstrated in many previous works (Gol’shtein & Tret’yakov, 1979; Eckstein & Bertsekas, 1992; Boyd et al., 2011), the inexact two-block ADMM often shows good practical convergence, which is also the case in our later experiments. Besides, the numerical convergence analysis is presented in Appendix D. 4) The proper adjustment of $( \rho _ { 1 } , \rho _ { 2 } , \rho _ { 3 } )$ could accelerate the practical convergence, which will be specified later .
|
| 135 |
+
|
| 136 |
+
# 4 EXPERIMENTS
|
| 137 |
+
|
| 138 |
+
# 4.1 EVALUATION SETUP
|
| 139 |
+
|
| 140 |
+
Settings. We compare our method (TA-LBF) with GDA (Liu et al., 2017a), FSA (Zhao et al., 2019), T-BFA (Rakin et al., 2020b), and TBT (Rakin et al., 2020a). All those methods can be adopted to misclassify a specific image into a target class. We also take the fine-tuning (FT) of the last fully-connected layer as a baseline method. We conduct experiments on CIFAR-10 (Krizhevsky et al., 2009) and ImageNet (Russakovsky et al., 2015). We randomly select 1,000 images from each dataset as the evaluation set for all methods. Specifically, for each of the 10 classes in CIFAR-10, we perform attacks on the 100 randomly selected validation images from the other 9 classes. For ImageNet, we randomly choose 50 target classes. For each target class, we perform attacks on 20 images randomly selected from the rest classes in the validation set. Besides, for all methods except GDA which does not employ auxiliary samples, we provide 128 and 512 auxiliary samples on CIFAR-10 and ImageNet, respectively. Following the setting in (Rakin et al., 2020a;b), we adopt the quantized ResNet (He et al., 2016) and VGG (Simonyan & Zisserman, 2015) as the target models. For our TA-LBF, the trade-off parameter $\lambda$ and the constraint parameter $k$ affect the attack stealthiness and the attack success rate. We adopt a strategy for jointly searching $\lambda$ and $k$ , which is specified in Appendix E.3. More descriptions of our settings are provided in Appendix E.
|
| 141 |
+
|
| 142 |
+
Evaluation Metrics. We adopt three metrics to evaluate the attack performance, i.e., the post attack accuracy (PA-ACC), the attack success rate (ASR), and the number of bit-flips $( \mathrm { N _ { f l i p } } )$ . PA-ACC denotes the post attack accuracy on the validation set except for the specific attacked sample and the auxiliary samples. ASR is defined as the ratio of attacked samples that are successfully attacked into the target class among all 1,000 attacked samples. $\mathrm { { N _ { f l i p } } }$ is the number of bit-flips required for an attack. A better attack performance corresponds to a higher PA-ACC and ASR, while a lower $\mathrm { { N _ { f l i p } } }$ . Besides, we also show the accuracy of the original model, denoted as ACC.
|
| 143 |
+
|
| 144 |
+
# 4.2 MAIN RESULTS
|
| 145 |
+
|
| 146 |
+
Results on CIFAR-10. The results of all methods on CIFAR-10 are shown in Table 1. Our method achieves a $100 \%$ ASR with the fewest $\mathrm { { N _ { f l i p } } }$ for all the bit-widths and architectures. FT modifies the maximum number of bits among all methods since there is no limitation of parameter modifications. Due to the absence of the training data, the PA-ACC of FT is also poor. These results indicate that fine-tuning the trained DNN as an attack method is infeasible. Although T-BFA flips the secondfewest bits under three cases, it fails to achieve a higher ASR than GDA and FSA. In terms of PA-ACC, TA-LBF is comparable to other methods. Note that the PA-ACC of TA-LBF significantly outperforms that of GDA, which is the most competitive w.r.t. ASR and $\mathrm { { N _ { f l i p } } }$ among all the baseline methods. The PA-ACC of GDA is relatively poor, because it does not employ auxiliary samples. Achieving the highest ASR, the lowest $\mathrm { { N _ { f l i p } } }$ , and the comparable PA-ACC demonstrates that our optimization-based method is more superior than other heuristic methods (TBT, T-BFA and GDA).
|
| 147 |
+
|
| 148 |
+
Table 1: Results of all attack methods across different bit-widths and architectures on CIFAR-10 and ImageNet (bold: the best; underline: the second best). The mean and standard deviation of PA-ACC and $\mathrm { { N _ { f l i p } } }$ are calculated by attacking the 1,000 images. Our method is denoted as TA-LBF.
|
| 149 |
+
|
| 150 |
+
<table><tr><td>Dataset</td><td>Method</td><td>Target Model</td><td>PA-ACC (%) 85.01±2.90</td><td>ASR (%)</td><td>Nfip</td><td>Target Model</td><td>PA-ACC (%</td><td>ASR (%)</td><td>Nfip</td></tr><tr><td colspan="16" rowspan="19" rowspan="19">CIPAIII1</td><td>84.31±3.10 VGG</td><td>98.7</td><td></td><td>11298.74±830.36</td></tr><tr><td>100.0 97.3</td><td>1507.51±86.54 246.70±8.19</td><td>77.79±23.35</td><td>51.6</td><td>599.40±19.53</td></tr><tr><td>ResNet 8-bit</td><td>88.07±0.84 87.56±2.22 98.7</td><td></td><td>9.91±2.33</td><td>8-bit 89.83±3.92</td><td>96.7</td><td>14.53±3.74</td></tr><tr><td>T-BFA FSA ACC:</td><td>88.38±2.28</td><td>98.9</td><td>185.51±54.93</td><td>88.80±2.86 ACC:</td><td>96.8</td><td>253.92±122.06</td></tr><tr><td>GDA 92.16%</td><td>86.73±3.50</td><td>99.8</td><td>26.83±12.50</td><td>85.51±2.88</td><td>100.0</td><td></td></tr><tr><td>TA-LBF</td><td>88.20±2.64</td><td>100.0</td><td>5.57±1.58</td><td>93.20% 86.06±3.17</td><td>100.0</td><td>21.54±6.79 7.40±2.72</td></tr><tr><td>FT</td><td>84.37±2.94</td><td>100.0</td><td>392.48±47.26</td><td>VGG</td><td>83.31±3.76 94.5</td><td>2270.52±324.69</td></tr><tr><td>TBT</td><td>ResNet 4-bit</td><td>87.79±1.86 96.0</td><td>118.20±15.03</td><td>4-bit</td><td>83.90±2.63</td><td>62.4</td></tr><tr><td>T-BFA</td><td></td><td>86.46±2.80 97.9</td><td>8.80±2.01</td><td>ACC:</td><td>88.74±4.52 96.2</td><td>266.40±18.70 11.23±2.36</td></tr><tr><td>FSA</td><td>87.73±2.36 ACC:</td><td>98.4</td><td>76.83±25.27</td><td>87.58±3.06</td><td>97.5</td><td>75.03±29.75</td></tr><tr><td>GDA</td><td>86.25±3.59</td><td>99.8</td><td>14.08±7.94</td><td>85.08±2.82</td><td>100.0</td><td>10.31±3.77</td></tr><tr><td>TA-LBF</td><td>91.90% 87.82±2.60</td><td>100.0</td><td>5.25±1.09</td><td>92.61%</td><td>85.91±3.29 100.0</td><td>6.26±2.37</td></tr><tr><td rowspan="12">aeegee</td><td></td><td>59.33±0.93</td><td>100.0</td><td>277424.29±12136.34</td><td>VGG</td><td>62.08±2.33</td><td>100.0 1729685.22±137539.54</td></tr><tr><td>FT ResNet TBT 8-bit</td><td>69.18±0.03</td><td>99.9</td><td>577.40±19.42</td><td>8-bit</td><td>72.99±0.02 99.2</td><td>4115.26±191.25</td></tr><tr><td>T-BFA</td><td>68.71±0.36</td><td>79.3</td><td>24.57±20.03</td><td>73.09±0.12</td><td>84.5</td><td>363.78±153.28</td></tr><tr><td>FSA ACC:</td><td>69.27±0.15</td><td>99.7</td><td>441.21±119.45</td><td>73.28±0.03</td><td>100.0</td><td>1030.03±260.30</td></tr><tr><td>GDA 69.50%</td><td>69.26±0.22</td><td>100.0</td><td>18.54±6.14</td><td>ACC: 73.29±0.02</td><td>100.0</td><td></td></tr><tr><td>TA-LBF</td><td>69.41±0.08</td><td>100.0</td><td>7.37±2.18</td><td>73.31% 73.28±0.03</td><td>100.0</td><td>197.05±49.85</td></tr><tr><td>FT</td><td></td><td>15.65±4.52 100.0</td><td>135854.50±21399.94</td><td>VGG</td><td>17.76±1.71</td><td>100.0</td><td>69.89±18.42 1900751.70±37329.44</td></tr><tr><td>TBT</td><td>ResNet</td><td>99.8</td><td>271.24±15.98</td><td>4-bit</td><td>71.18±0.03</td><td>100.0</td><td>3231.00±345.68</td></tr><tr><td>T-BFA</td><td>4-bit</td><td>66.36±0.07</td><td></td><td></td><td>71.49±0.15</td><td></td><td></td></tr><tr><td>FSA</td><td></td><td>65.86±0.42</td><td>80.4</td><td>24.79±19.02</td><td>71.69±0.09</td><td>84.3</td><td>350.33±158.57</td></tr><tr><td></td><td>ACC:</td><td>66.44±0.21</td><td>99.9</td><td>157.53±33.66</td><td>ACC:</td><td>100.0</td><td>441.32±111.26</td></tr><tr><td>GDA</td><td>66.77%</td><td>66.54±0.22</td><td>100.0</td><td>11.45±3.82</td><td>71.76%</td><td>71.73±0.03</td><td>100.0</td><td>107.18±28.70</td></tr><tr><td>TA-LBF</td><td></td><td>66.69±0.07</td><td>100.0</td><td>7.96±2.50</td><td></td><td>71.73±0.03</td><td>100.0</td><td>69.72±18.84</td></tr></table>
|
| 151 |
+
|
| 152 |
+
Results on ImageNet. The results on ImageNet are shown in Table 1. It can be observed that GDA shows very competitive performance compared to other methods. However, our method obtains the highest PA-ACC, the fewest bit-flips (less than 8), and a $100 \%$ ASR in attacking ResNet. For VGG, our method also achieves a $100 \%$ ASR with the fewest $\mathrm { { N _ { f l i p } } }$ for both bit-widths. The $\mathrm { { N _ { f l i p } } }$ results of our method are mainly attributed to the cardinality constraint on the number of bit-flips. Moreover, for our method, the average PA-ACC degradation over four cases on ImageNet is only $0 . 0 6 \%$ , which demonstrates the stealthiness of our attack. When comparing the results of ResNet and VGG, an interesting observation is that all methods require significantly more bit-flips for VGG. One reason is that VGG is much wider than ResNet. Similar to the claim in (He et al., 2020), increasing the network width contributes to the robustness against the bit-flip based attack.
|
| 153 |
+
|
| 154 |
+
# 4.3 RESISTANCE TO DEFENSE METHODS
|
| 155 |
+
|
| 156 |
+
Resistance to Piece-wise Clustering. He et al. (2020) proposed a novel training technique, called piece-wise clustering, to enhance the network robustness against the bit-flip based attack. Such a training technique introduces an additional weight penalty to the inference loss, which has the effect of eliminating close-to-zero weights (He et al., 2020). We test the resistance of all attack methods to the piece-wise clustering. We conduct experiments with the 8-bit quantized ResNet on CIFAR-10 and ImageNet. Following the ideal configuration in (He et al., 2020), the clustering coefficient, which is a hyper-parameter of piece-wise clustering, is set to 0.001 in our evaluation. For our method, the initial $k$ is set to 50 on ImageNet and the rest settings are the same as those in Section 4.1. Besides the three metrics in Section 4.1, we also present the number of increased $\mathrm { { N _ { f l i p } } }$ compared to the model without defense (i.e., results in Table 1), denoted as $\Delta \mathrm { N _ { f l i p } }$ .
|
| 157 |
+
|
| 158 |
+
The results of the resistance to the piece-wise clustering of all attack methods are shown in Table 2. It shows that the model trained with piece-wise clustering can improve the number of required bit-flips for all attack methods. However, our method still achieves a $100 \%$ ASR with the least number of bit-flips on both two datasets. Although TBT achieves a smaller $\Delta \mathrm { N _ { f l i p } }$ than ours on CIFAR-10, its ASR is only $5 2 . 3 \%$ , which also verifies the defense effectiveness of the piece-wise clustering. Compared with other methods, TA-LBF achieves the fewest $\Delta \mathrm { N _ { f l i p } }$ on ImageNet and the best PA-ACC on both datasets. These results demonstrate the superiority of our method over other methods when attacking models trained with piece-wise clustering.
|
| 159 |
+
|
| 160 |
+
Table 2: Results of all attack methods against the models with defense on CIFAR-10 and ImageNet (bold: the best; underline: the second best). The mean and standard deviation of PA-ACC and $\mathrm { { N _ { f l i p } } }$ are calculated by attacking the 1,000 images. Our method is denoted as TA-LBF. $\Delta \mathrm { N _ { f l i p } }$ denotes the increased $\mathrm { { N _ { f l i p } } }$ compared to the corresponding result in Table 1.
|
| 161 |
+
|
| 162 |
+
<table><tr><td rowspan=1 colspan=1>Defense</td><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>ACC(%</td><td rowspan=1 colspan=1>PA-ACC ASR Nflip △Nfip(% (%</td></tr><tr><td rowspan=6 colspan=1>Prreerreseeceeecs</td><td rowspan=4 colspan=1>CIFAIIIO</td><td rowspan=4 colspan=1>FTTBTT-BFAFSAGDATA-LBF</td><td rowspan=4 colspan=1>91.01</td><td rowspan=1 colspan=1>84.06±3.56 99.5 1893.55±68.98 386.04</td></tr><tr><td rowspan=1 colspan=1>87.05±1.69 52.3 254.20±10.22 7.50</td></tr><tr><td rowspan=1 colspan=1>85.82±1.89 98.6 45.51±9.47 35.6086.61±2.51 98.6 246.11±75.36 60.6084.12±4.77 100.0 52.76±16.29 25.93</td></tr><tr><td rowspan=1 colspan=1>87.30±2.74 100.0 18.93±7.11 13.36</td></tr><tr><td rowspan=2 colspan=1>1aeeeee</td><td rowspan=2 colspan=1>FTTBTT-BFAFSAGDATA-LBF</td><td rowspan=2 colspan=1>63.62</td><td rowspan=1 colspan=1>43.44±2.07 92.2 762267.56±52179.46 484843.2763.07±0.04 81.8 1184.14±30.30 606.74</td></tr><tr><td rowspan=1 colspan=1>62.82±0.27 90.1 273.56±191.29 248.99</td></tr><tr><td rowspan=10 colspan=1>ereereereter</td><td rowspan=4 colspan=1>CI-AIIIT</td><td rowspan=4 colspan=1>FTTBTT-BFAFSAGDATA-LBF</td><td rowspan=4 colspan=1>94.29</td><td rowspan=1 colspan=1>86.46±2.84 100.0 2753.43±188.27 1245.92</td></tr><tr><td rowspan=1 colspan=1>89.72±2.99 89.5 366.90±12.09 120.20</td></tr><tr><td rowspan=1 colspan=1>91.16±1.42 98.7 17.91±4.64 8.0090.70±2.37 98.5 271.27±65.18 85.76</td></tr><tr><td rowspan=1 colspan=1>89.83±3.02 100.0 48.96±21.03 22.1390.96±2.63 100.0 8.79±2.44 3.22</td></tr><tr><td rowspan=6 colspan=1>Jeagee</td><td rowspan=6 colspan=1>FTTBTT-BFAFSAGDATA-LBF</td><td rowspan=6 colspan=1>71.35</td><td rowspan=1 colspan=1>63.51±1.29 100.0 507456.61±34517.04 230032.32</td></tr><tr><td rowspan=1 colspan=1>71.12±0.04 99.9 1138.34±44.23 560.94</td></tr><tr><td rowspan=1 colspan=1>70.84±0.30 88.9 40.23±27.29 15.66</td></tr><tr><td rowspan=1 colspan=1>71.30±0.04 100.0 449.70±106.42 8.49</td></tr><tr><td rowspan=1 colspan=1>71.30±0.05 100.0 20.01±6.04 1.47</td></tr><tr><td rowspan=1 colspan=1>71.30±0.04 100.0 8.48±2.52 1.11</td></tr></table>
|
| 163 |
+
|
| 164 |
+

|
| 165 |
+
Figure 2: Results of TA-LBF with different parameters $\lambda , k$ , and the number of auxiliary samples $N$ on CIFAR-10. Regions in shadow indicate the standard deviation of attacking the 1,000 images.
|
| 166 |
+
|
| 167 |
+
Resistance to Larger Model Capacity. Previous studies (He et al., 2020; Rakin et al., 2020b) observed that increasing the network capacity can improve the robustness against the bit-flip based attack. Accordingly, we evaluate all attack methods against the models with a larger capacity using the 8-bit quantized ResNet on both datasets. Similar to the strategy in (He et al., 2020), we increase the model capacity by varying the network width (i.e., $2 \times$ width in our experiments). All settings of our method are the same as those used in Section 4.1.
|
| 168 |
+
|
| 169 |
+
The results are presented in Table 2. We observe that all methods require more bit-flips to attack the model with the $2 \times$ width. To some extent, it demonstrates that the wider network with the same architecture is more robust against the bit-flip based attack. However, our method still achieves a $100 \%$ ASR with the fewest $\mathrm { { N _ { f l i p } } }$ and $\Delta \mathrm { N _ { f l i p } }$ . Moreover, when comparing the two defense methods, we find that piece-wise clustering performs better than the model with a larger capacity in terms of $\Delta \mathrm { N _ { f l i p } }$ . However, piece-wise clustering training also causes the accuracy decrease of the original model (e.g., from $9 2 . 1 6 \%$ to $9 1 . 0 1 \%$ on CIFAR-10). We provide more results in attacking models with defense under different settings in Appendix $\mathbf { F }$ .
|
| 170 |
+
|
| 171 |
+

|
| 172 |
+
Figure 3: Visualization of decision boundaries of the original model and the post attack models. The attacked sample from Class 3 is misclassified into the Class 1 by FSA, GDA, and our method.
|
| 173 |
+
|
| 174 |
+
# 4.4 ABLATION STUDY
|
| 175 |
+
|
| 176 |
+
We perform ablation studies on parameters $\lambda$ and $k$ , and the number of auxiliary samples $N$ . We use the 8-bit quantized ResNet on CIFAR-10 as the representative for analysis. We discuss the attack performance of TA-LBF under different values of $\lambda$ while $k$ is fixed at 20, and under different values of $k$ while $\lambda$ is fixed at 10. To analyze the effect of $N$ , we configure $N$ from 25 to 800 and keep other settings the same as those in Section 4.1. The results are presented in Fig. 2. We observe that our method achieves a $100 \%$ ASR when $\lambda$ is less than 20. As expected, the PA-ACC increases while the ASR decreases along with the increase of $\lambda$ . The plot of parameter $k$ presents that $k$ can exactly limit the number of bit-flips, while other attack methods do not involve such constraint. This advantage is critical since it allows the attacker to identify limited bits to perform an attack when the budget is fixed. As shown in the figure, the number of auxiliary samples less than 200 has a marked positive impact on the PA-ACC. It’s intuitive that more auxiliary samples can lead to a better PA-ACC. The observation also indicates that TA-LBF still works well without too many auxiliary samples.
|
| 177 |
+
|
| 178 |
+
# 4.5 VISUALIZATION OF DECISION BOUNDARY
|
| 179 |
+
|
| 180 |
+
To further compare FSA and GDA with our method, we visualize the decision boundaries of the original and the post attack models in Fig. 3. We adopt a four-layer Multi-Layer Perceptron trained with the simulated 2-D Blob dataset from 4 classes. The original decision boundary indicates that the original model classifies all data points almost perfectly. The attacked sample is classified into Class 3 by all methods. Visually, GDA modifies the decision boundary drastically, especially for Class 0. However, our method modifies the decision boundary mainly around the attacked sample. Althoug FSA is comparable to ours visually in Fig. 3, it flips $1 0 \times$ bits than GDA and TA-LBF. In terms of the numerical results, TA-LBF achieves the best PA-ACC and the fewest $\mathrm { { N _ { f l i p } } }$ . This finding verifies that our method can achieve a successful attack even only tweaking the original classifier.
|
| 181 |
+
|
| 182 |
+
# 5 CONCLUSION
|
| 183 |
+
|
| 184 |
+
In this work, we have presented a novel attack paradigm that the weights of a deployed DNN can be slightly changed via bit flipping in the memory, to give a target prediction for a specific sample, while the predictions on other samples are not significantly influenced. Since the weights are stored as binary bits in the memory, we formulate this attack as a binary integer programming (BIP) problem, which can be effectively and efficiently solved by a continuous algorithm. Since the critical bits are determined through optimization, the proposed method can achieve the attack goals by flipping a few bits, and it shows very good performance under different experimental settings.
|
| 185 |
+
|
| 186 |
+
# ACKNOWLEDGMENTS
|
| 187 |
+
|
| 188 |
+
This work is supported in part by the National Key Research and Development Program of China under Grant 2018YFB1800204, the National Natural Science Foundation of China under Grant 61771273, the R&D Program of Shenzhen under Grant JCYJ20180508152204044. Baoyuan Wu is supported by the Natural Science Foundation of China under grant No. 62076213, and the university development fund of the Chinese University of Hong Kong, Shenzhen under grant No. 01001810.
|
| 189 |
+
|
| 190 |
+
# REFERENCES
|
| 191 |
+
|
| 192 |
+
Michel Agoyan, Jean-Max Dutertre, Amir-Pasha Mirbaha, David Naccache, Anne-Lise Ribotta, and Assia Tria. How to flip a bit? In IOLTS, pp. 235–239, 2010.
|
| 193 |
+
|
| 194 |
+
Naveed Akhtar and Ajmal Mian. Threat of adversarial attacks on deep learning in computer vision: A survey. IEEE Access, 6:14410–14430, 2018.
|
| 195 |
+
|
| 196 |
+
Jiawang Bai, Bin Chen, Yiming Li, Dongxian Wu, Weiwei Guo, Shu-tao Xia, and En-hui Yang. Targeted attack for deep hashing based retrieval. In ECCV, 2020.
|
| 197 |
+
|
| 198 |
+
Adel Bibi, Baoyuan Wu, and Bernard Ghanem. Constrained k-means with general pairwise and cardinality constraints. arXiv preprint arXiv:1907.10410, 2019.
|
| 199 |
+
|
| 200 |
+
Stephen Boyd, Neal Parikh, and Eric Chu. Distributed optimization and statistical learning via the alternating direction method of multipliers. Now Publishers Inc, 2011.
|
| 201 |
+
|
| 202 |
+
Jakub Breier, Xiaolu Hou, Dirmanto Jap, Lei Ma, Shivam Bhasin, and Yang Liu. Practical fault attack on deep neural networks. In CCS, pp. 2204–2206, 2018.
|
| 203 |
+
|
| 204 |
+
Yair Carmon, Aditi Raghunathan, Ludwig Schmidt, John C. Duchi, and Percy Liang. Unlabeled data improves adversarial robustness. In NeurIPS, 2019.
|
| 205 |
+
|
| 206 |
+
Weilun Chen, Zhaoxiang Zhang, Xiaolin Hu, and Baoyuan Wu. Boosting decision-based blackbox adversarial attacks with random sign flip. In Proceedings of the European Conference on Computer Vision, 2020.
|
| 207 |
+
|
| 208 |
+
Yinpeng Dong, Hang Su, Baoyuan Wu, Zhifeng Li, Wei Liu, Tong Zhang, and Jun Zhu. Efficient decision-based black-box adversarial attacks on face recognition. In CVPR, pp. 7714–7722, 2019.
|
| 209 |
+
|
| 210 |
+
Min Du, Ruoxi Jia, and Dawn Song. Robust anomaly detection and backdoor attack detection via differential privacy. ICLR, 2020.
|
| 211 |
+
|
| 212 |
+
Jonathan Eckstein and Dimitri P Bertsekas. On the douglas—rachford splitting method and the proximal point algorithm for maximal monotone operators. Mathematical Programming, 55(1- 3):293–318, 1992.
|
| 213 |
+
|
| 214 |
+
Kevin Eykholt, Ivan Evtimov, Earlence Fernandes, Bo Li, Amir Rahmati, Chaowei Xiao, Atul Prakash, Tadayoshi Kohno, and Dawn Song. Robust physical-world attacks on deep learning visual classification. In CVPR, pp. 1625–1634, 2018.
|
| 215 |
+
|
| 216 |
+
Yanbo Fan, Baoyuan Wu, Tuanhui Li, Yong Zhang, Mingyang Li, Zhifeng Li, and Yujiu Yang. Sparse adversarial attack via perturbation factorization. In European Conference on Computer Vision, 2020.
|
| 217 |
+
|
| 218 |
+
Yan Feng, Bin Chen, Tao Dai, and Shutao Xia. Adversarial attack on deep product quantization network for image retrieval. In AAAI, 2020.
|
| 219 |
+
|
| 220 |
+
Daniel Gabay and Bertrand Mercier. A dual algorithm for the solution of nonlinear variational problems via finite element approximation. Computers & mathematics with applications, 2(1): 17–40, 1976.
|
| 221 |
+
|
| 222 |
+
Roland Glowinski and A Marroco. Sur l’approximation, par el´ ements finis d’ordre un, et ´ la resolution, par p ´ enalisation-dualit ´ e d’une classe de probl ´ emes de dirichlet non lin \` eaires. ´ ESAIM: Mathematical Modelling and Numerical Analysis-Modelisation Math ´ ematique et Anal- ´ yse Numerique ´ , 9(R2):41–76, 1975.
|
| 223 |
+
|
| 224 |
+
E Gi Gol’shtein and NV Tret’yakov. Modified lagrangians in convex programming and their generalizations. In Point-to-Set Maps and Mathematical Programming, pp. 86–97. Springer, 1979.
|
| 225 |
+
|
| 226 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In ICLR, 2015.
|
| 227 |
+
|
| 228 |
+
Daniel Gruss, Moritz Lipp, Michael Schwarz, Daniel Genkin, Jonas Juffinger, Sioli O’Connell, Wolfgang Schoechl, and Yuval Yarom. Another flip in the wall of rowhammer defenses. In IEEE S&P, pp. 245–261, 2018.
|
| 229 |
+
|
| 230 |
+
Tianyu Gu, Kang Liu, Brendan Dolan-Gavitt, and Siddharth Garg. Badnets: Evaluating backdooring attacks on deep neural networks. IEEE Access, 7:47230–47244, 2019.
|
| 231 |
+
|
| 232 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, pp. 770–778, 2016.
|
| 233 |
+
|
| 234 |
+
Zhezhi He, Adnan Siraj Rakin, Jingtao Li, Chaitali Chakrabarti, and Deliang Fan. Defending and harnessing the bit-flip based adversarial weight attack. In CVPR, pp. 14095–14103, 2020.
|
| 235 |
+
|
| 236 |
+
Sanghyun Hong, Pietro Frigo, Yigitcan Kaya, Cristiano Giuffrida, and Tudor Dumitras ˘ , . Terminal brain damage: Exposing the graceless degradation in deep neural networks under hardware fault attacks. In USENIX Security Symposium, pp. 497–514, 2019.
|
| 237 |
+
|
| 238 |
+
Benoit Jacob, Skirmantas Kligys, Bo Chen, Menglong Zhu, Matthew Tang, Andrew Howard, Hartwig Adam, and Dmitry Kalenichenko. Quantization and training of neural networks for efficient integer-arithmetic-only inference. In CVPR, pp. 2704–2713, 2018.
|
| 239 |
+
|
| 240 |
+
Yoongu Kim, Ross Daly, Jeremie Kim, Chris Fallin, Ji Hye Lee, Donghyuk Lee, Chris Wilkerson, Konrad Lai, and Onur Mutlu. Flipping bits in memory without accessing them: An experimental study of dram disturbance errors. ACM SIGARCH Computer Architecture News, 42(3):361–372, 2014.
|
| 241 |
+
|
| 242 |
+
Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. Technical report, 2009.
|
| 243 |
+
|
| 244 |
+
Tuanhui Li, Baoyuan Wu, Yujiu Yang, Yanbo Fan, Yong Zhang, and Wei Liu. Compressing convolutional neural networks via factorized convolutional filters. In CVPR, 2019.
|
| 245 |
+
|
| 246 |
+
Yiming Li, Baoyuan Wu, Yong Jiang, Zhifeng Li, and Shu-Tao Xia. Backdoor learning: A survey. arXiv preprint arXiv:2007.08745, 2020.
|
| 247 |
+
|
| 248 |
+
Kang Liu, Brendan Dolan-Gavitt, and Siddharth Garg. Fine-pruning: Defending against backdooring attacks on deep neural networks. In RAID, pp. 273–294, 2018a.
|
| 249 |
+
|
| 250 |
+
Yannan Liu, Lingxiao Wei, Bo Luo, and Qiang Xu. Fault injection attack on deep neural network. In ICCAD, pp. 131–138, 2017a.
|
| 251 |
+
|
| 252 |
+
Yingqi Liu, Shiqing Ma, Yousra Aafer, Wen-Chuan Lee, Juan Zhai, Weihang Wang, and Xiangyu Zhang. Trojaning attack on neural networks. In NDSS, 2018b.
|
| 253 |
+
|
| 254 |
+
Yunfei Liu, Xingjun Ma, James Bailey, and Feng Lu. Reflection backdoor: A natural backdoor attack on deep neural networks. ECCV, 2020a.
|
| 255 |
+
|
| 256 |
+
Yuntao Liu, Yang Xie, and Ankur Srivastava. Neural trojans. In ICCD, pp. 45–48, 2017b.
|
| 257 |
+
|
| 258 |
+
Yuntao Liu, Ankit Mondal, Abhishek Chakraborty, Michael Zuzak, Nina Jacobsen, Daniel Xing, and Ankur Srivastava. A survey on neural trojans. In ISQED, 2020b.
|
| 259 |
+
|
| 260 |
+
Szymon Migacz. 8-bit inference with tensorrt. In GPU technology conference, 2017.
|
| 261 |
+
|
| 262 |
+
Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, Omar Fawzi, and Pascal Frossard. Universal adversarial perturbations. In CVPR, pp. 1765–1773, 2017.
|
| 263 |
+
|
| 264 |
+
Jonathan Pan. Blackbox trojanising of deep learning models: Using non-intrusive network structure and binary alterations. arXiv preprint arXiv:2008.00408, 2020.
|
| 265 |
+
|
| 266 |
+
Adnan Siraj Rakin, Zhezhi He, and Deliang Fan. Bit-flip attack: Crushing neural network with progressive bit search. In ICCV, pp. 1211–1220, 2019.
|
| 267 |
+
|
| 268 |
+
Adnan Siraj Rakin, Zhezhi He, and Deliang Fan. Tbt: Targeted neural network attack with bit trojan. In CVPR, pp. 13198–13207, 2020a.
|
| 269 |
+
|
| 270 |
+
Adnan Siraj Rakin, Zhezhi He, Jingtao Li, Fan Yao, Chaitali Chakrabarti, and Deliang Fan. T-bfa: Targeted bit-flip adversarial weight attack. arXiv preprint arXiv:2007.12336, 2020b.
|
| 271 |
+
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.
|
| 272 |
+
Aniruddha Saha, Akshayvarun Subramanya, and Hamed Pirsiavash. Hidden trigger backdoor attacks. In AAAI, pp. 11957–11965, 2020.
|
| 273 |
+
Bodo Selmke, Stefan Brummer, Johann Heyszl, and Georg Sigl. Precise laser fault injections into $9 0 \mathrm { n m }$ and $4 5 \mathrm { n m }$ sram-cells. In CARDIS, pp. 193–205. Springer, 2015.
|
| 274 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2015.
|
| 275 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In ICLR, 2014.
|
| 276 |
+
Brandon Tran, Jerry Li, and Aleksander Madry. Spectral signatures in backdoor attacks. In NeurIPS, pp. 8000–8010, 2018.
|
| 277 |
+
Victor Van Der Veen, Yanick Fratantonio, Martina Lindorfer, Daniel Gruss, Clementine Maurice, ´ Giovanni Vigna, Herbert Bos, Kaveh Razavi, and Cristiano Giuffrida. Drammer: Deterministic rowhammer attacks on mobile platforms. In CCS, pp. 1675–1689, 2016.
|
| 278 |
+
Bolun Wang, Yuanshun Yao, Shawn Shan, Huiying Li, Bimal Viswanath, Haitao Zheng, and Ben Y Zhao. Neural cleanse: Identifying and mitigating backdoor attacks in neural networks. In IEEE S&P, pp. 707–723, 2019.
|
| 279 |
+
Baoyuan Wu and Bernard Ghanem. $\ell _ { p }$ -box admm: A versatile framework for integer programming. IEEE transactions on pattern analysis and machine intelligence, 41(7):1695–1708, 2018.
|
| 280 |
+
Baoyuan Wu, Li Shen, Tong Zhang, and Bernard Ghanem. Map inference via l2-sphere linear program reformulation. International Journal of Computer Vision, pp. 1–24, 2020a.
|
| 281 |
+
Dongxian Wu, Yisen Wang, Shu-Tao Xia, James Bailey, and Xingjun Ma. Skip connections matter: On the transferability of adversarial examples generated with resnets. In ICLR, 2020b.
|
| 282 |
+
Dongxian Wu, Shu-Tao Xia, and Yisen Wang. Adversarial weight perturbation helps robust generalization. In NeurIPS, 2020c.
|
| 283 |
+
Chulin Xie, Keli Huang, Pin-Yu Chen, and Bo Li. Dba: Distributed backdoor attacks against federated learning. In ICLR, 2019.
|
| 284 |
+
Cihang Xie, Jianyu Wang, Zhishuai Zhang, Zhou Ren, and Alan Yuille. Mitigating adversarial effects through randomization. ICLR, 2018.
|
| 285 |
+
Weilin Xu, David Evans, and Yanjun Qi. Feature squeezing: Detecting adversarial examples in deep neural networks. NDSS, 2017.
|
| 286 |
+
Yan Xu, Baoyuan Wu, Fumin Shen, Yanbo Fan, Yong Zhang, Heng Tao Shen, and Wei Liu. Exact adversarial attack to image captioning via structured output learning with latent variables. In CVPR, 2019.
|
| 287 |
+
Fan Yao, Adnan Siraj Rakin, and Deliang Fan. Deephammer: Depleting the intelligence of deep neural networks through targeted chain of bit flips. In USENIX Security Symposium, pp. 1463– 1480, 2020.
|
| 288 |
+
Chaoning Zhang, Philipp Benz, Tooba Imtiaz, and In-So Kweon. Cd-uap: Class discriminative universal adversarial perturbation. In AAAI, 2020a.
|
| 289 |
+
Chaoning Zhang, Philipp Benz, Tooba Imtiaz, and In So Kweon. Understanding adversarial examples from the mutual influence of images and perturbations. In CVPR, 2020b.
|
| 290 |
+
Pu Zhao, Siyue Wang, Cheng Gongye, Yanzhi Wang, Yunsi Fei, and Xue Lin. Fault sneaking attack: A stealthy framework for misleading deep neural networks. In ACM DAC, pp. 1–6. IEEE, 2019.
|
| 291 |
+
|
| 292 |
+
# A UPDATE $\hat { b }$ BY GRADIENT DESCENT
|
| 293 |
+
|
| 294 |
+
In this section, we derive the gradient of $\textit { L w } . r . t . \textit { \textbf { b } }$ , which is adopted to update $\hat { b } ^ { r + 1 }$ by gradient descent (see Eq. (10)). The derivation consists of the following parts.
|
| 295 |
+
|
| 296 |
+
Derivation of $\partial \mathcal { L } _ { 1 } ( \hat { b } ) / \partial \hat { b }$ . For clarity, here we firstly repeat some definitions,
|
| 297 |
+
|
| 298 |
+
$$
|
| 299 |
+
\begin{array} { l } { \displaystyle \mathcal { L } _ { 1 } ( \hat { \mathbf { B } } _ { s } , \hat { \mathbf { B } } _ { t } ) = \operatorname* { m a x } \big ( m - p ( x ; \boldsymbol { \Theta } , \hat { \mathbf { B } } _ { t } ) + \delta , 0 \big ) + \operatorname* { m a x } \big ( p ( x ; \boldsymbol { \Theta } , \hat { \mathbf { B } } _ { s } ) - m + \delta , 0 \big ) , } \\ { \displaystyle p ( x ; \boldsymbol { \Theta } , \hat { \mathbf { B } } _ { i } ) = [ h ( \hat { \mathbf { B } } _ { i , 1 } ) ; h ( \hat { \mathbf { B } } _ { i , 2 } ) ; . . . ; h ( \hat { \mathbf { B } } _ { i , C } ) ] ^ { \top } g ( x ; \boldsymbol { \Theta } ) , } \\ { \displaystyle h ( v ) = ( - 2 ^ { Q - 1 } \cdot v _ { Q } + \sum _ { i = 1 } ^ { Q - 1 } 2 ^ { i - 1 } \cdot v _ { i } ) \cdot \Delta ^ { l } . } \end{array}
|
| 300 |
+
$$
|
| 301 |
+
|
| 302 |
+
Then, we obtain that
|
| 303 |
+
|
| 304 |
+
$$
|
| 305 |
+
\frac { \partial p ( x ; \boldsymbol { \Theta } , \hat { \mathbf { B } } _ { i } ) } { \partial \hat { \mathbf { B } } _ { i } } = [ g _ { 1 } ( x ; \boldsymbol { \Theta } ) \cdot ( \frac { \nabla h ( \hat { \mathbf { B } } _ { i , 1 } ) } { \partial \hat { \mathbf { B } } _ { i , 1 } } ) ^ { \top } ; . . . ; g _ { C } ( x ; \boldsymbol { \Theta } ) \cdot ( \frac { \nabla h ( \hat { \mathbf { B } } _ { i , C } ) } { \nabla \hat { \mathbf { B } } _ { i , C } } ) ^ { \top } ] ,
|
| 306 |
+
$$
|
| 307 |
+
|
| 308 |
+
where $\begin{array} { r } { \frac { \nabla h ( \pmb { v } ) } { \nabla \pmb { v } } = [ 2 ^ { 0 } ; 2 ^ { 1 } , \dots , 2 ^ { Q - 2 } ; - 2 ^ { Q - 1 } ] \cdot \Delta ^ { l } } \end{array}$ is a constant, and here $l$ indicates the last layer; $g _ { j } ( { \pmb x } ; { \Theta } )$ ∇v denotes the $j$ -th entry of the vector $g ( \pmb { x } ; \mathbf { \Theta } \Theta )$ . Utilizing (15), we have
|
| 309 |
+
|
| 310 |
+
$$
|
| 311 |
+
\begin{array} { r l } & { \frac { \partial \mathcal { L } _ { 1 } ( \hat { \mathbf { B } } _ { s } , \hat { \mathbf { B } } _ { t } ) } { \partial \hat { \mathbf { B } } _ { s } } = \left\{ \begin{array} { l l } { \frac { \partial p ( x ; \Theta , \hat { \mathbf { B } } _ { s } ) } { \partial \hat { \mathbf { B } } _ { s } } , \mathrm { ~ i f ~ } p ( x ; \Theta , \mathbf { B } _ { s } ) > m - \delta } \\ { \mathbf { 0 } , \mathrm { ~ o t h e r w i s e } } \end{array} \right. , } \\ & { \frac { \partial \mathcal { L } _ { 1 } ( \hat { \mathbf { B } } _ { s } , \hat { \mathbf { B } } _ { t } ) } { \partial \hat { \mathbf { B } } _ { t } } = \left\{ \begin{array} { l l } { - \frac { \partial p ( x ; \Theta , \hat { \mathbf { B } } _ { t } ) } { \partial \hat { \mathbf { B } } _ { t } } , \mathrm { ~ i f ~ } p ( x ; \Theta , \mathbf { B } _ { t } ) < m + \delta } \\ { \mathbf { 0 } , \mathrm { ~ o t h e r w i s e } } \end{array} \right. . } \end{array}
|
| 312 |
+
$$
|
| 313 |
+
|
| 314 |
+
Thus, we obtain that
|
| 315 |
+
|
| 316 |
+
$$
|
| 317 |
+
\frac { \partial \mathcal { L } _ { 1 } ( \hat { \boldsymbol { b } } ) } { \partial \hat { \boldsymbol { b } } } = \big [ \mathrm { R e s h a p e } \big ( \frac { \partial \mathcal { L } _ { 1 } ( \hat { \mathbf { B } } _ { s } , \hat { \mathbf { B } } _ { t } ) } { \partial \hat { \mathbf { B } } _ { s } } \big ) ; \mathrm { R e s h a p e } \big ( \frac { \partial \mathcal { L } _ { 1 } ( \hat { \mathbf { B } } _ { s } , \hat { \mathbf { B } } _ { t } ) } { \partial \hat { \mathbf { B } } _ { t } } \big ) \big ] ,
|
| 318 |
+
$$
|
| 319 |
+
|
| 320 |
+
where Reshape $( \cdot )$ elongates a matrix to a vector along the column.
|
| 321 |
+
|
| 322 |
+
Derivation of $\partial \mathcal { L } _ { 2 } ( \hat { b } ) / \partial \hat { b }$ . For clarity, here we firstly repeat the following definition
|
| 323 |
+
|
| 324 |
+
$$
|
| 325 |
+
\mathcal { L } _ { 2 } ( \hat { \mathbf { B } } _ { s } , \hat { \mathbf { B } } _ { t } ) = \sum _ { i = 1 } ^ { N } \ell \big ( f ( \pmb { x } _ { i } ; \boldsymbol { \Theta } , \mathbf { B } _ { \{ 1 , \dots , K \} \setminus \{ s , t \} } , \hat { \mathbf { B } } _ { s } , \hat { \mathbf { B } } _ { t } ) , y _ { i } \big ) ,
|
| 326 |
+
$$
|
| 327 |
+
|
| 328 |
+
where $f _ { j } ( { \pmb x } _ { i } ; \Theta , { \pmb \mathsf { B } } _ { \{ 1 , \dots , K \} \backslash \{ s , t \} } , { \hat { \pmb \mathsf { B } } } _ { s } , { \hat { \pmb \mathsf { B } } } _ { t } ) = \operatorname { S o f t m a x } ( p ( { \pmb x } _ { i } ; \Theta , { \hat { \pmb \mathsf { B } } } _ { j } ) )$ or $\mathrm { S o f t m a x } ( p ( { \pmb x } _ { i } ; { \pmb \Theta } , { \pmb B } _ { j } ) )$ indicates the posterior probability of $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ w.r.t. class $j$ , and we simply denote $f ( \pmb { x } _ { i } ) \in [ 0 , 1 ] ^ { K }$ as the posterior probability vector of $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ . $\{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { N }$ denotes the auxiliary sample set. $\ell ( \cdot , \cdot )$ is specified as the cross entropy loss. Then, we have
|
| 329 |
+
|
| 330 |
+
$$
|
| 331 |
+
\begin{array} { r l } & { \displaystyle \frac { \partial \mathcal { L } _ { 2 } ( \hat { \mathbf { B } } _ { s } , \hat { \mathbf { B } } _ { t } ) } { \partial \hat { \mathbf { B } } _ { s } } = \sum _ { i = 1 } ^ { N } \bigg [ \big ( \mathbb { I } ( y _ { i } = s ) - f _ { s } ( \pmb { x } _ { i } ; \boldsymbol { \Theta } , \mathbf { B } _ { \{ 1 , \dots , K \} \setminus \{ s , t \} } , \hat { \mathbf { B } } _ { s } , \hat { \mathbf { B } } _ { t } ) \big ) \cdot \frac { \partial p ( \pmb { x } _ { i } ; \boldsymbol { \Theta } , \hat { \mathbf { B } } _ { s } ) } { \partial \hat { \mathbf { B } } _ { s } } \bigg ] , } \\ & { \displaystyle \frac { \partial \mathcal { L } _ { 2 } ( \hat { \mathbf { B } } _ { s } , \hat { \mathbf { B } } _ { t } ) } { \partial \hat { \mathbf { B } } _ { t } } = \sum _ { i = 1 } ^ { N } \bigg [ \big ( \mathbb { I } ( y _ { i } = t ) - f _ { t } ( \pmb { x } _ { i } ; \boldsymbol { \Theta } , \mathbf { B } _ { \{ 1 , \dots , K \} \setminus \{ s , t \} } , \hat { \mathbf { B } } _ { s } , \hat { \mathbf { B } } _ { t } ) \big ) \cdot \frac { \partial p ( \pmb { x } _ { i } ; \boldsymbol { \Theta } , \hat { \mathbf { B } } _ { t } ) } { \partial \hat { \mathbf { B } } _ { t } } \bigg ] , } \end{array}
|
| 332 |
+
$$
|
| 333 |
+
|
| 334 |
+
where $\mathbb { I } ( a ) = 1$ of $a$ is true, otherwise $\mathbb { I } ( a ) = 0$ . Thus, we obtain
|
| 335 |
+
|
| 336 |
+
$$
|
| 337 |
+
\frac { \partial \mathcal { L } _ { 2 } ( \hat { \boldsymbol { b } } ) } { \partial \hat { \boldsymbol { b } } } = \bigg [ \mathrm { R e s h a p e } \big ( \frac { \partial \mathcal { L } _ { 2 } ( \hat { \mathbf { B } } _ { s } , \hat { \mathbf { B } } _ { t } ) } { \partial \hat { \mathbf { B } } _ { s } } \big ) ; \mathrm { R e s h a p e } \big ( \frac { \partial \mathcal { L } _ { 2 } ( \hat { \mathbf { B } } _ { s } , \hat { \mathbf { B } } _ { t } ) } { \partial \hat { \mathbf { B } } _ { t } } \big ) \bigg ] .
|
| 338 |
+
$$
|
| 339 |
+
|
| 340 |
+
Derivation of $\partial L ( \hat { b } ) / \partial \hat { b }$ . According to Eq. (8), and utilizing Eqs. (17) and (21), we obtain
|
| 341 |
+
|
| 342 |
+
$$
|
| 343 |
+
\frac { \partial L ( \hat { b } ) } { \partial \hat { b } } = \frac { \partial \mathcal { L } _ { 1 } ( \hat { b } ) } { \partial \hat { b } } + \frac { \partial \mathcal { L } _ { 2 } ( \hat { b } ) } { \partial \hat { b } } + z _ { 1 } + z _ { 2 } + \rho _ { 1 } ( \hat { b } - u _ { 1 } ) + \rho _ { 2 } ( \hat { b } - u _ { 2 } ) + 2 ( \hat { b } - b ) \cdot \big [ z _ { 3 } + \rho _ { 3 } \lvert \lvert \hat { b } - b \rvert \rvert _ { 2 } ^ { 2 } - k + u _ { 3 } \big ] .
|
| 344 |
+
$$
|
| 345 |
+
|
| 346 |
+
# B ALGORITHM OUTLINE
|
| 347 |
+
|
| 348 |
+
# Algorithm 1 Continuous optimization for the BIP problem (5).
|
| 349 |
+
|
| 350 |
+
Input: The original quantized DNN model $f$ with weights $\Theta , \mathsf { B }$ , attacked sample $_ { \textbf { \em x } }$ with groundtruth label $s$ , target class $t$ , auxiliary sample set $\{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { N }$ , hyper-parameters $\lambda , k$ , and $\delta$ .
|
| 351 |
+
|
| 352 |
+
# Output: $\hat { b }$
|
| 353 |
+
|
| 354 |
+
1: Initial $\pmb { u } _ { 1 } ^ { 0 }$ , ${ \pmb u } _ { 2 } ^ { 0 }$ , $u _ { 3 } ^ { 0 }$ , $z _ { 1 } ^ { 0 }$ , $z _ { 2 } ^ { 0 }$ , $z _ { 3 } ^ { 0 }$ , $\hat { b } ^ { 0 }$ and let $r \gets 0$ ;
|
| 355 |
+
2: while not converged do
|
| 356 |
+
3: Update $\pmb { u } _ { 1 } ^ { r + 1 }$ , $u _ { 2 } ^ { r + 1 }$ and $u _ { 3 } ^ { r + 1 }$ as Eq. (9);
|
| 357 |
+
4: Update $\hat { \pmb { b } } ^ { r + 1 }$ as Eq. (10);
|
| 358 |
+
5: Update $z _ { 1 } ^ { r + 1 }$ +1 , z r+12 a nd $z _ { 3 } ^ { r + 1 }$ as Eq. (11);
|
| 359 |
+
6: $r r + 1$ .
|
| 360 |
+
|
| 361 |
+
# C COMPLEXITY ANALYSIS
|
| 362 |
+
|
| 363 |
+
Table 3: Running time (seconds) of attacking one image for different methods. The mean and standard deviation are calculated by 10 attacks.
|
| 364 |
+
|
| 365 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>FT</td><td rowspan=1 colspan=1>TBT</td><td rowspan=1 colspan=1>T-BFA</td><td rowspan=1 colspan=1>FSA</td><td rowspan=1 colspan=1>GDA</td><td rowspan=1 colspan=1>TA-LBF</td></tr><tr><td rowspan=1 colspan=1>CIFAR-10ImageNet</td><td rowspan=1 colspan=1>15.54±1.64124.32±3.61</td><td rowspan=1 colspan=1>389.12±27.7931425.81±540.60</td><td rowspan=1 colspan=1>35.05±15.7919.16±3.52</td><td rowspan=1 colspan=1>2.71±0.4865.28±2.49</td><td rowspan=1 colspan=1>0.67±0.5461.97±1.59</td><td rowspan=1 colspan=1>113.38±6.54222.95±9.39</td></tr></table>
|
| 366 |
+
|
| 367 |
+
7: end while
|
| 368 |
+
|
| 369 |
+
The computational complexity of the proposed algorithm (i.e., Algorithm 1) consists of two parts, the forward and backward pass. In terms of the forward pass, since $\Theta , \mathsf { B } _ { \{ 1 , \dots , K \} \backslash \{ s , t \} }$ are fixed during the optimization, their involved terms, including $g ( \pmb { x } ; \Theta )$ and $p ( \pmb { x } ; \pmb { \Theta } , \pmb { \mathsf { B } } _ { i } ) | _ { i \neq s , t }$ , are calculated only one time. The main cost from $\hat { \mathbf { B } } _ { s }$ and $\hat { \mathbf { B } } _ { t }$ is $O ( 2 ( N + 1 ) C ^ { 2 } Q )$ per iteration, as there are $N + 1$ samples. In terms of the backward pass, the main cost is from the update of $\hat { b } ^ { r + 1 }$ , which is $O ( 2 ( N + 1 ) C Q )$ per iteration in the gradient descent. Since all other updates are very simple, their costs are omitted here. Thus, the overall computational cost is $O \big ( T _ { o u t e r } [ 2 ( \dot { N } + 1 ) \dot { C } Q \cdot ( C + T _ { i n n e r } ) ] \big )$ , with $T _ { o u t e r }$ being the iteration of the overall algorithm and $T _ { i n n e r }$ indicating the number of gradient steps in updating $\hat { b } ^ { r + 1 }$ . As shown in Section D, the proposed method TA-LBF always converges very fast in our experiments, thus $T _ { o u t e r }$ is not very large. As demonstrated in Section E.3, $T _ { i n n e r }$ is set to 5 in our experiments. In short, the proposed method can be optimized very efficiently.
|
| 370 |
+
|
| 371 |
+
Besides, we also compare the computational complexity of different attacks empirically. Specifically, we compare the running time of attacking one image of different methods against the 8-bit quantized ResNet on CIFAR-10 and ImageNet dataset. As shown in Table 3, TBT is the most timeconsuming method among all attacks. Although the proposed TA-LBF is not superior to T-BFA, FSA, and GDA in running time, this gap can be tolerated when attacking a single image in the deployment stage. Besides, our method performs better in terms of PA-ACC, ASR, and $\mathrm { { N _ { f l i p } } }$ as demonstrated in our experiments.
|
| 372 |
+
|
| 373 |
+
# D NUMERICAL CONVERGENCE ANALYSIS
|
| 374 |
+
|
| 375 |
+
We present the numerical convergence of TA-LBF in Fig. 4. Note that $| | \hat { b } - u _ { 1 } | | _ { 2 } ^ { 2 }$ and $| | \hat { b } - u _ { 2 } | | _ { 2 } ^ { 2 }$ characterize the degree of satisfaction of the box and $\ell _ { 2 }$ -sphere constraint, respectively. For the two examples of CIFAR-10 and ImageNet, the values of both indicators first increase, then drop, and finally close to 0. Another interesting observation is that $\mathcal { L } _ { 1 } + \lambda \mathcal { L } _ { 2 }$ first decreases evidently and then increases slightly. Such findings illustrate the optimization process of TA-LBF. In the early iterations, modifying the model parameters tends to achieve the two goals mentioned in Section 3.1; in the late iterations, $\hat { b }$ is encouraged to satisfy the box and $l _ { 2 }$ -sphere constraint. We also observe that both examples stop when meeting $| | \hat { \pmb b } - { \pmb u } _ { 1 } | | _ { 2 } ^ { 2 } \leq 1 0 ^ { - 4 }$ and $| | \hat { \pmb b } - { \pmb u } _ { 2 } | | _ { 2 } ^ { 2 } \leq 1 0 ^ { - 4 }$ and do not exceed the maximum number of iterations (i.e., 2000). The numerical results demonstrate the fast convergence of our method in practice.
|
| 376 |
+
|
| 377 |
+

|
| 378 |
+
Figure 4: Numerical convergence analysis of TA-LBF $w . r . t .$ . the attacked sample on CIFAR-10 and ImageNet, respectively. We present the values of $| | \hat { \pmb { b } } - \pmb { u } _ { 1 } | | _ { 2 } ^ { 2 } , | | \hat { \pmb { b } } - \pmb { u } _ { 2 } | | _ { 2 } ^ { 2 }$ and $\mathcal { L } _ { 1 } + \lambda \mathcal { L } _ { 2 }$ at different iterations in attacking 8-bit quantized ResNet. Note that $\lambda$ in the left figure is 100 and $\lambda$ in the right figure is $1 0 ^ { 4 }$ .
|
| 379 |
+
|
| 380 |
+
# E EVALUATION SETUP
|
| 381 |
+
|
| 382 |
+
# E.1 BASELINE METHODS
|
| 383 |
+
|
| 384 |
+
Since GDA (Liu et al., 2017a) and FSA (Zhao et al., 2019) are originally designed for attacking the full-precision network, we adapt these two methods to attack the quantized network by applying quantization-aware training (Jacob et al., 2018). We adopt the $\ell _ { 0 }$ -norm for FSA (Liu et al., 2017a) and modification compression for GDA (Zhao et al., 2019) to reduce the number of the modified parameters. Among three types of T-BFA (Rakin et al., 2020b), we compare to the most comparable method: the 1-to-1 stealthy attack scheme. The purpose of this attack scheme is to misclassify samples of a single source class into the target class while maintaining the prediction accuracy of other samples. Besides, we take the fine-tuning (FT) of the last fully-connected layer as a basic attack and present its results. We perform attack once for each selected image except TBT (Rakin et al., 2020a) and totally 1,000 attacks on each dataset. The attack objective of TBT is that the attacked DNN model misclassifies all inputs with a trigger to a certain target class. Due to such objective, the number of attacks for TBT is equal to the number of target classes (i.e., 10 attacks on CIFAR-10 and 50 attacks on ImageNet).
|
| 385 |
+
|
| 386 |
+
# E.2 TARGET MODELS
|
| 387 |
+
|
| 388 |
+
According to the setting in (Rakin et al., 2020a;b), we adopt two popular network architectures: ResNet (He et al., 2016) and VGG (Simonyan & Zisserman, 2015) for evaluation. On CIFAR-10, we perform experiments on ResNet-20 and VGG-16. On ImageNet, we use the pre-trained ResNet$1 8 ^ { * }$ and VGG- $\bar { 1 } 6 ^ { \dagger }$ network. We quantize all networks to the 4-bit and 8-bit quantization level using the layer-wise uniform weight quantization scheme, which is similar to the one involved in the Tensor-RT solution (Migacz, 2017).
|
| 389 |
+
|
| 390 |
+
# E.3 PARAMETER SETTINGS OF TA-LBF
|
| 391 |
+
|
| 392 |
+
For each attack, we adopt a strategy for jointly searching $\lambda$ and $k$ . Specifically, for an initially given $k$ , we search $\lambda$ from a relatively large initial value and divide it by 2 if the attack does not succeed. The maximum search times of $\lambda$ for a fixed $k$ is set to 8. If it exceeds the maximum search times, we double $k$ and search $\lambda$ from the relatively large initial value. The maximum search times of $k$ is set to 4. On CIFAR-10, the initial $k$ and $\lambda$ are set to 5 and 100. On ImageNet, $\lambda$ is initialized as $1 0 ^ { 4 }$ ; $k$ is initialized as 5 and 50 for ResNet and VGG, respectively. On CIFAR-10, the $\delta$ in $\mathcal { L } _ { 1 }$ is set to 10. On ImageNet, the $\delta$ is set to 3 and increased to 10 if the attack fails. $\mathbf { \delta u } _ { 1 }$ and $\mathbf { \delta } \mathbf { u } _ { 2 }$ are initialized as $^ { b }$ and $u _ { 3 }$ is initialized as 0. $z _ { 1 }$ and $z _ { 2 }$ are initialized as 0 and $z _ { 3 }$ is initialized as 0. $\hat { b }$ is initialized as $^ { b }$ . During each iteration, the number of gradient steps for updating $\hat { b }$ is 5 and the step size is set to 0.01 on both datasets. Hyper-parameters $( \rho _ { 1 } , \rho _ { 2 } , \rho _ { 3 } )$ (see Eq. (11)) are initialized as $( 1 0 ^ { - 4 } , 1 0 ^ { - 4 } , 1 0 ^ { - 5 } )$ on both datasets, and increase by $\rho _ { i } \gets \rho _ { i } \times 1 . 0 1$ , $i = { 1 , 2 , 3 }$ after each iteration. The maximum values of $( \rho _ { 1 } , \rho _ { 2 } , \rho _ { 3 } )$ are set to (50, 50, 5) on both datasets. Besides the maximum number of iterations (i.e., 2000), we also set another stopping criterion, i.e., $| | \hat { \pmb { b } } - { \pmb { u } } _ { 1 } | | _ { 2 } ^ { 2 } \leq 1 0 ^ { - 4 }$ and $| | \hat { b } - { \pmb u } _ { 2 } | | _ { 2 } ^ { 2 } \leq 1 0 ^ { - 4 }$ .
|
| 393 |
+
|
| 394 |
+
Table 4: Results of all attack methods against models trained with piece-wise clustering on CIFAR10 (bold: the best; underline: the second best). We adopt different clustering coefficients, including 0.0005, 0.005, and 0.01. The mean and standard deviation of PA-ACC and $\mathrm { { N _ { f l i p } } }$ are calculated by attacking the 1,000 images. Our method is denoted as TA-LBF. $\Delta \mathrm { N _ { f l i p } }$ denotes the increased $\mathrm { { N _ { f l i p } } }$ compared to the corresponding result in Table 1.
|
| 395 |
+
|
| 396 |
+
<table><tr><td>Clustering Coefficient</td><td>Method</td><td>ACC (%)</td><td>PA-ACC (%) 84.28±3.49</td><td>ASR (%)</td><td>Nflip</td><td>△Nfip</td></tr><tr><td>0.0005</td><td>FT TBT T-BFA FSA GDA TA-LBF</td><td>91.42</td><td>87.97±1.75 86.20±1.96 87.17±2.44 85.28±4.16 87.92±2.54</td><td>100.0 66.1 98.5 98.5 100.0 100.0</td><td>1868.26±72.48 250.30±10.97 30.95±6.50 222.70±56.52 41.33±12.84 13.47±5.34</td><td>360.75 3.60 21.04 37.19 14.50 7.90</td></tr><tr><td>0.005</td><td>FT TBT T-BFA FSA GDA TA-LBF</td><td>88.03</td><td>81.08±3.61 82.96±2.18 80.80±2.64 83.10±2.75 79.23±6.25 83.63±3.47</td><td>97.9 12.7 98.1 98.4 99.9 100.0</td><td>1774.69±51.47 246.80±16.06 61.72±12.17 231.66±89.21 64.87±22.78 25.52±11.59</td><td>267.18 0.10 51.81 46.15 38.04 19.95</td></tr><tr><td>0.01</td><td>FT TBT T-BFA FSA GDA TA-LBF</td><td>85.65</td><td>78.73±3.54 79.86±2.04 76.67±3.41 80.45±3.14 75.33±7.83 80.51±4.39</td><td>98.3 10.1 98.1 98.0 99.7 100.0</td><td>1748.54±46.19 236.50±10.93 55.49±11.77 220.28±101.01 59.17±23.63 24.60±13.03</td><td>241.03 -10.20 45.58 34.77 32.34 19.03</td></tr></table>
|
| 397 |
+
|
| 398 |
+
# F MORE RESULTS ON RESISTANCE TO DEFENSE METHODS
|
| 399 |
+
|
| 400 |
+
# F.1 RESISTANCE TO PIECE-WISE CLUSTERING
|
| 401 |
+
|
| 402 |
+
We conduct experiments using the 8-bit quantized ResNet on CIFAR-10 with different clustering coefficients. We set the maximum search times of $k$ to 5 for clustering coefficient 0.005 and 0.01 and keep the rest settings the same as those in Section 4.1. The results are presented in Table 4. As shown in the table, all values of $\mathrm { { N _ { f l i p } } }$ are larger than attacking models without defense for all methods, which is similar to Table 2. Our method achieves a $100 \%$ ASR with the fewest $\mathrm { { N _ { f l i p } } }$ under the three clustering coefficients. Although TBT obtains a smaller $\Delta \mathrm { N _ { f l i p } }$ than our method, it fails to achieve a satisfactory ASR. For example, TBT achieves only a $10 . 1 \%$ ASR when the clustering coefficient is set to 0.01. We observe that for all clustering coefficients, piece-wise clustering reduces the original accuracy. Such a phenomenon is more significant as the clustering coefficient increases. The results also show that there is no guarantee that if the clustering coefficient is larger (e.g., 0.01), the model is more robust, which is consistent with the finding in (He et al., 2020).
|
| 403 |
+
|
| 404 |
+
Table 5: Results of all attack methods against models with a larger capacity on CIFAR-10. We adopt $3 \times$ and $4 \times$ width networks. The mean and standard deviation of PA-ACC and $\mathrm { { N _ { f l i p } } }$ are calculated by attacking the 1,000 images. $\Delta \mathrm { N _ { f l i p } }$ denotes the increased $\mathrm { { N _ { f l i p } } }$ compared to the corresponding result in Table 1.
|
| 405 |
+
|
| 406 |
+
<table><tr><td>Model Width</td><td>Method</td><td>ACC (%)</td><td>PA-ACC (%)</td><td>ASR (%)</td><td>Nfip</td><td>△Nfip</td></tr><tr><td>3×</td><td>FT TBT T-BFA FSA GDA TA-LBF</td><td>94.90</td><td>86.96±2.79 90.67±5.23 92.18±1.14 91.40±2.38 90.79±2.91 91.42±2.81</td><td>100.0 74.1 98.9 99.0 100.0 100.0</td><td>4002.52±281.24 504.70±20.44 30.50±7.52 342.20±79.44 67.53±27.45 12.29±4.18</td><td>2495.01 258.00 20.59 156.69 40.70 6.72</td></tr><tr><td>4×</td><td>FT TBT T-BFA FSA GDA TA-LBF</td><td>95.02</td><td>86.94±2.78 85.39±5.08 92.49±1.22 91.60±2.42 90.76±3.00 90.94±3.11</td><td>100.0 90.1 99.4 98.7 100.0 100.0</td><td>4527.68±369.35 625.50±32.38 19.14±5.04 338.93±100.12 66.92±40.32 8.37±2.80</td><td>3020.17 378.80 9.23 153.42 40.09 2.80</td></tr></table>
|
| 407 |
+
|
| 408 |
+
# F.2 RESISTANCE TO LARGER MODEL CAPACITY
|
| 409 |
+
|
| 410 |
+
Besides the results of networks with a $2 \times$ width shown in Section 4.3, we also evaluate all methods against models with a $3 \times$ and $4 \times$ width. All settings are the same as those used in Section 4.1. The results are provided in Table 5. Among all attack methods, our method is least affected by increasing the network width. Especially for the network with a $4 \times$ width, our $\Delta \mathrm { N _ { f l i p } }$ is only 2.80. The results demonstrate the superiority of the formulated BIP problem and optimization. Moreover, compared with piece-wise clustering, having a larger model capacity can improve the original accuracy, but increases the model size and the computation complexity.
|
| 411 |
+
|
| 412 |
+
# G DISCUSSIONS
|
| 413 |
+
|
| 414 |
+
# G.1 COMPARING BACKDOOR, ADVERSARIAL, AND WEIGHT ATTACK
|
| 415 |
+
|
| 416 |
+
An attacker can achieve malicious purposes utilizing backdoor, adversarial, and weight attacks. In this section, we emphasize the differences among them.
|
| 417 |
+
|
| 418 |
+
Backdoor attack happens in the training stage and requires that the attacker can tamper the training data even the training process (Liu et al., 2020b; Li et al., 2020). Through poisoning some training samples with a trigger, the attacker can control the behavior of the attacked DNN in the inference stage. For example, images with reflections are misclassified into a target class, while benign images are classified normally (Liu et al., 2020a). However, such an attack paradigm causes the accuracy degradation on benign samples, which makes it detectable for users. Besides, these methods also require to modify samples in the inference stage, which is sometimes impossible for the attacker. Many defense methods against backdoor attack have been proposed, such as the preprocessingbased defense (Liu et al., 2017b), the model reconstruction-based defense (Liu et al., 2018a), and the trigger synthesis-based defense (Wang et al., 2019).
|
| 419 |
+
|
| 420 |
+
Adversarial attack modifies samples in the inference stage by adding small perturbations that remain imperceptible to the human vision system (Akhtar & Mian, 2018). Since adversarial attack only modifies inputs while keeping the model unchanged, it has no effect on the benign samples. Besides the basic white-box attack, the black-box attack (Wu et al., 2020b; Chen et al., 2020) and universal attack (Zhang et al., 2020b;a) have attracted wide attention. Inspired by its success in the classification, it also has been extended to other tasks, including image captioning (Xu et al., 2019), retrieval (Bai et al., 2020; Feng et al., 2020), etc.. Similarly, recent studies have demonstrated many defense methods against adversarial attack, including the preprocessing-based defense (Xie et al., 2018), the detection-based defense (Xu et al., 2017), and the adversarial learning-based defense (Carmon et al., 2019; Wu et al., 2020c).
|
| 421 |
+
|
| 422 |
+
Weight attack modifies model parameters in the deployment stage, which is the studied paradigm in this work. Weight attack generally aims at misleading the DNN model on the selected sample(s), while having a minor effect on other samples (Zhao et al., 2019; Rakin et al., 2020b). Many studies (Yao et al., 2020; Breier et al., 2018; Pan, 2020) have demonstrated that the DNN parameters can be modified in the bit-level in memory using fault injection techniques (Agoyan et al., 2010; Kim et al., 2014; Selmke et al., 2015) in practice. Note that the defense methods against weight attack have been not well studied. Although some defense methods (He et al., 2020) were proposed, they cannot achieve satisfactory performance. For example, our method can still achieve a $100 \%$ attack success rate against two proposed defense methods. Our work would encourage further investigation on the security of the model parameters from both attack and defense sides.
|
| 423 |
+
|
| 424 |
+
# G.2 COMPARING TA-LBF WITH OTHER WEIGHT ATTACKS
|
| 425 |
+
|
| 426 |
+
We compare our TA-LBF with other weight attack methods, including TBT (Rakin et al., 2020a), TBFA (Rakin et al., 2020b), GDA (Liu et al., 2017a), and FSA (Zhao et al., 2019) in this section. TBT tampers both the test sample and the model parameters. Specifically, it first locates critical bits and generates a trigger, and then flips these bits to classify all inputs embedded with the trigger to a target class. However, the malicious samples are easily detected by human inspection or many detection methods (Tran et al., 2018; Du et al., 2020). We do not modify the samples to perform TA-LBF, which makes the attack more stealthy. Rakin et al. (2020b) proposed T-BFA which misclassifies all samples (N-to-1 version) or samples from a source class (1-to-1 version) into a target class. Our method aims at misclassifying a specific sample, which meets the attacker’s requirement in some scenarios. For example, the attacker wants to manipulate the behavior of a face recognition engine on a specific input. Since it affects multiple samples, T-BFA maybe not stealthy enough in attacking real-world applications. GDA (Liu et al., 2017a) and FSA (Zhao et al., 2019) modify model parameters at the weight-level rather than bit-level. They are designed for misclassifying multiple samples from arbitrary classes, which makes it infeasible for them to only modify the parameters connected to the source and target class. They modify more parameters than our method as shown in the experiments, it might be due to the reason discussed above. Besides, TBT, T-BFA, and GDA determine the critical weights to modify using heuristic strategies, while our TA-LBF adopts optimization-based methods. Although FSA applies ADMM for solving the optimization problem, it has no explicit constraint to control the number of modified parameters, which makes it intends to modify more parameters than GDA and our TA-LBF.
|
| 427 |
+
|
| 428 |
+

|
| 429 |
+
H TRADE-OFF BETWEEN THREE EVALUATION METRICS
|
| 430 |
+
Figure 5: Curves of the trade-off between PA-ACC and $\mathrm { { N _ { f l i p } } }$ and the trade-off between PA-ACC and ASR for the proposed TA-LBF on two datasets.
|
| 431 |
+
|
| 432 |
+
In this section, we investigate the trade-off between three adopted evaluation metrics (i.e., PA-ACC, ASR, and $\mathrm { { N } _ { f l i p . } }$ ) for our attack. All experiments are conducted on CIFAR-10 and ImageNet dataset in attacking the 8-bit quantized ResNet.
|
| 433 |
+
|
| 434 |
+
We firstly discuss the trade-off between PA-ACC and $\mathrm { { N _ { f l i p } } }$ by fixing the ASR as $100 \%$ using the search strategy in Appendix E.3 and adjusting the initial $\lambda$ and $k$ to obtain different attack results. The two curves on the left show that increasing the $\mathrm { { N _ { f l i p } } }$ can improve the PA-ACC when $\mathrm { { N _ { f l i p } } }$ is relatively small; the PA-ACC decreases with the increase of $\mathrm { { N _ { f l i p } } }$ when $\mathrm { { N _ { f l i p } } }$ is greater than a threshold. This phenomenon demonstrates that constraining the number of bit-flips is essential to ensure the attack stealthiness, as mentioned in Section 3.2. To study the trade-off between PA-ACC and ASR, we fix the parameter $k$ as 10 for approximately 10 bit-flips and adjust the parameter $\lambda$ to obtain different PA-ACC and ASR results. The trade-off curves between PA-ACC and ASR show that increasing ASR can decrease the PA-ACC significantly. Therefore, how to achieve high ASR and PA-ACC simultaneously is still an important open problem.
|
md/train/lxHgXYN4bwl/lxHgXYN4bwl.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/nYz2_BbZnYk/nYz2_BbZnYk.md
ADDED
|
@@ -0,0 +1,268 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Representing Long-Range Context for Graph Neural Networks with Global Attention
|
| 2 |
+
|
| 3 |
+
Zhanghao $\mathbf { W _ { u } } ^ { * _ { 1 } }$ , Paras $\mathbf { J a i n } ^ { * _ { 1 } }$ , Matthew A. Wright1 Azalia Mirhoseini2, Joseph E. Gonzalez1, Ion Stoica1 1UC Berkeley, 2Google Brain Correspondence to: {zhwu, paras_jain}@berkeley.edu \*equal contribution, determined via a random coin flip.
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Graph neural networks are powerful architectures for structured datasets. However, current methods struggle to represent long-range dependencies. Scaling the depth or width of GNNs is insufficient to broaden receptive fields as larger GNNs encounter optimization instabilities such as vanishing gradients and representation oversmoothing, while pooling-based approaches have yet to become as universally useful as in computer vision. In this work, we propose the use of Transformer-based self-attention to learn long-range pairwise relationships, with a novel “readout” mechanism to obtain a global graph embedding. Inspired by recent computer vision results that find position-invariant attention performant in learning long-range relationships, our method, which we call GraphTrans, applies a permutation-invariant Transformer module after a standard GNN module. This simple architecture leads to state-of-the-art results on several graph classification tasks, outperforming methods that explicitly encode graph structure. Our results suggest that purely-learning-based approaches without graph structure may be suitable for learning high-level, long-range relationships on graphs. Code for GraphTrans is available at https://github.com/ucbrise/graphtrans.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Graph neural networks (GNNs) enable deep networks to process structured inputs such as molecules or social networks. GNNs learn mappings that compute representations at graph nodes and/or edges from the structure of and features in their neighborhoods. This neighborhood-local aggregation leverages the relational inductive bias encoded by the graph’s connectivity [3]. Similar to convolutional neural networks (CNNs), GNNs can aggregate information from beyond local neighborhoods by stacking layers, effectively broadening the GNN receptive field.
|
| 12 |
+
|
| 13 |
+
However, GNN performance drops dramatically when its depth increases [21]. This limitation has hurt the performance of GNNs on whole-graph classification and regression tasks, where we want to predict a target value describing the whole graph that may rely on long-range dependencies that may not be captured by a GNN with a limited receptive field [35]. Consider for example a large graph where node $A$ must attend to a distant node $B$ which is $K$ -hops away. If our GNN layer aggregates only over a node’s one-hop neighborhood, then a $K$ -layer GNN is required. However, the width of the receptive field of this GNN will grow exponentially, diluting the signal from node $B$ . That is, simply expanding the receptive field to a $K$ -hop neighborhood may not capture these long-range dependencies either [40]. Often, “too deep” GNNs lead to node representations that collapse to be equivalent over the entire graph, a phenomenon sometimes called oversmoothing or oversquashing [21, 5, 2]. Therefore, the maximum context size for common GNN architectures is effectively limited.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Architecture of GraphTrans. A standard GNN submodule learns local, short-range structure, then a global Transformer submodule learns global, long-range relationships.
|
| 17 |
+
|
| 18 |
+
Several proposed methods combat the oversmoothing problem via intermediate pooling operations similar to those found in today’s CNNs. Graph pooling operations gradually coarsen the graph in progressive GNN layers, usually by collapsing neighborhoods into single nodes [9, 37, 20, etc.]. In theory, hierarchical coarsening should allow better long-range learning, both by reducing the distance information has to travel and by filtering out unimportant nodes. However, no graph pooling operation has been found that is as universally applicable as CNN pooling. State-of-the-art results are often obtained with models using no intermediate graph coarsening [27], and some results suggest neighborhood-local coarsening may be unnecessary or counterproductive [23].
|
| 19 |
+
|
| 20 |
+
In this work, we take a different approach at graph pooling and learning long-range dependencies in GNNs. Like hierarchical pooling, our method is also inspired by methods for computer vision: we replace some of the atomic operations that explicitly encode relevant relational inductive biases (i.e., convolutions or spatial pooling in CNNs, neighborhood coarsening in GNNs) with purely learned operations like attention [11, 4, 7].
|
| 21 |
+
|
| 22 |
+
Our method, which we call Graph Transformer (GraphTrans, see Fig. 1), adds a Transformer subnetwork on top of a standard GNN layer stack. This Transformer subnetwork explicitly computes all pairwise node interactions in a position-agnostic fashion. This approach is intuitive as it retains the GNN as a specialized architecture to learn local representations of the structure of a node’s immediate neighborhood while leveraging the Transformer as a powerful global reasoning module. This parallels recent computer vision architectures, where authors have found hard relational inductive biases important for learning short-range patterns but less useful or even counterproductive in modeling long-range dependencies [25]. As the Transformer without a positional encoding is permutationinvariant, we find it is a natural fit for graphs. Moreover, GraphTrans does not require any specialized modules or architectures and can be implemented in any framework atop any existing GNN backbone.
|
| 23 |
+
|
| 24 |
+
We evaluate GraphTrans on a variety of popular graph classification datasets. We find significant improvements in accuracy on OpenGraphBenchmark [15] where we achieve state-of-the-art results on two graph classification tasks. Moreover, we find substantial improvements on the molecular dataset NCI1. Surprisingly, we find our simple model outperforms complex baselines for long-range modeling in graphs via hierarchical clustering such as self-attention pooling [20].
|
| 25 |
+
|
| 26 |
+
Our contributions are as follows:
|
| 27 |
+
|
| 28 |
+
• We show that long-range reasoning via Transformers improve graph neural network (GNN) accuracy. Our results suggest that modelling all pairwise node-node interactions in the graph is particularly important for large graph classification tasks.
|
| 29 |
+
• We introduce a novel GNN “readout module.” Inspired by text-classification applications of Transformers, we use a special $^ { 6 6 } < \mathrm { C L S } > ^ { , , }$ token whose output embedding aggregates all pairwise interactions into a single classification vector. We find that this approach outperforms both non-learned readout methods like global pooling as well as learned aggregation methods like graph-specific pooling methods [37, 20] and “virtual node” approaches.
|
| 30 |
+
• Using our novel architecture GraphTrans, we obtain state-of-the-art results on several OpenGraphBenchmark [15] datasets and the NCI biomolecular datasets [30].
|
| 31 |
+
|
| 32 |
+
# 2 Related Work
|
| 33 |
+
|
| 34 |
+
Graph Classification. Graph classification is an important task in real-world applications. Though GNNs encode the structured data into the node representations, aggregation of the representations to a single graph embedding for graph classification is still a problem. Similar to CNNs, pooling in GNNs can be either global, reducing a set of node and/or edge encodings to a single graph encoding, or local, collapsing subsets of nodes and/or edges to create a coarser graph. Paralleling the use of intermediate pooling within CNNs, several authors have proposed local pooling operations meant to be used within the GNN layer stack, progressively coarsening the graph. Methods proposed include both learned pooling schemes [37, 20, 14, 16, 1, etc.] and non-learned pooling methods based on classic graph coarsening schemes [10, 9, etc.]. However, the effectiveness or necessity of hierarchical, coarsening-based pooling in GNNs is unclear [23]. On the other hand, the most common global, whole-graph pooling methods, are i) non-learned mean or max-pooling over nodes and ii) the “virtual node” approach, where a final GNN layer outputs an embedding for a single virtual node that is connected to every “real” node in the graph.
|
| 35 |
+
|
| 36 |
+
A notable work related to graph pooling is the DAGNN (Directed Acyclic Graph Neural Network) of Thost and Chen [27], which had obtained the previous state-of-the-art accuracy on OGBG-Code2. The DAGNN layer aggregates over the entire graph within each layer via an RNN that traverses the DAG, unlike most GNN layers that only aggregate over a node’s neighborhood. While they did not characterize this method as a pooling operation, it is similar to GraphTrans in that it acts as a learned global pooling (in that it aggregates the embeddings of every node in a DAG into the sink nodes) that can model long-range dependencies. Note that GraphTrans is also complementary to DAGNN because their final graph-level pooling operation is a global max-pooling over the sink nodes rather than a learned operation.
|
| 37 |
+
|
| 38 |
+
Transformers on Graphs. Several authors have investigated applications of Transformer architectures to graphs. Recent works such as Zhang et al. [38], Rong et al. [24], and Dwivedi and Bresson [12] propose GNN layers that let nodes attend to other nodes in some surrounding neighborhood via Transformer-style attention, whereas we use self attention for a permutation-invariant, graph-level pooling or “readout” operation that collapses node encodings to a single graph encoding. Of these, Zhang et al. [38] and Rong et al. [24] tackle the problem of learning long-range dependencies without over smoothing by allowing nodes to attend to more than just the one-hop neighborhood: Zhang et al. [38] take the attended neighborhood radius as a tuning parameter and Rong et al. [24] attend to neighborhoods of random size during training and inference. In contrast, we use whole-graph self-attention to allow for learning of long-range dependencies.
|
| 39 |
+
|
| 40 |
+
While Zhang et al. [38] do not consider whole-graph prediction problems, in the case of Dwivedi and Bresson [12], when a graph-wide embedding was needed for graph classification or regression, they used global average pooling over the nodes, while Rong et al. [24] take a weighted sum over nodes with the weights computed bypassing the $h _ { v } ^ { L }$ ’s to a two-layer MLP. Note also that prior works consider graph-specific versions of a Transformer’s positional encoding, while we omit positional encodings to ensure permutation invariance.
|
| 41 |
+
|
| 42 |
+
Efficient Transformers. Transformer [28] has been widely used in sequence modeling. Recently, modifications of the transformer architecture emerge to further improve the efficiency [34, 19, 6]. The LiteTransformer [34] with less FLOPs, Reformer [19] with complexity, and Performer [6] with both less computation and memory complexity. Neural architecture search (NAS) was also applied to Transformer to fulfill the resource constraints for the edge devices [32]. These off-the-shelf architectures are orthogonal to our GraphTrans and can be adopted to improve the scalability.
|
| 43 |
+
|
| 44 |
+
# 3 Motivation: Modeling Long-Range Pairwise Interactions
|
| 45 |
+
|
| 46 |
+
To summarize, attempting long-range learning on graphs via stacking GNN layers or hierarchical pooling have not yet led to performance increases, and while some works have shown some success in expanding the receptive field of a single GNN layer beyond a one-hop neighborhood [38, 24, 40], it remains to be seen how this approach will scale to very large graphs with thousands of nodes.
|
| 47 |
+
|
| 48 |
+
An inspiration for an alternative approach can be found in the recent computer vision literature. In the last few years, researchers have found that attention mechanisms can act as drop-in replacements for traditional CNN convolutions [4, 7]: attention layers can learn to reproduce the strong relational inductive biases induced by local convolutions. More recently, state-of-the-art approaches to several computer vision tasks use an attention-style submodule on top of a traditional CNN backbone [2, 33, etc.]. These results suggest that while strong relational inductive biases are helpful for learning local, short-range correlations, for long-range correlations less structured modules may be preferred [2].
|
| 49 |
+
|
| 50 |
+

|
| 51 |
+
Figure 2: Example graph and attention map in our GraphTrans. The graph is randomly sampled from the Code2 validation set. The attention map is retrieved from the first layer of the transformer module in our GraphTrans. The horizontal axis corresponds to targets and the horizontal axis corresponds to sources (so, attention weights will sum to one over the horizontal axis). Note that in (b), index 18 corresponds to the special ${ \mathrm { \overline { { \mathbf { \Lambda } } } } } { \mathrm { C L S } } { \mathrm { \overline { { \mathbf { \Lambda } } } } }$ token described in section 4.
|
| 52 |
+
|
| 53 |
+
We leverage this insight to the graph learning domain with our GraphTrans model, which uses a traditional GNN subnetwork as a backbone, but leaves learning long-range dependencies to a Transformer subnetwork with no graph spatial priors. As mentioned, our Transformer application lets every node attend to every other node (unlike other approaches of applying Transformers to graphs that only allow attention to neighborhoods), which incentivizes the Transformer to learn the most important node-node relationships, instead of favoring nearby nodes (the latter task having been offloaded to the preceding GNN module).
|
| 54 |
+
|
| 55 |
+
Qualitatively, this scheme provides evidence that long-range relationships are indeed important. An example application of GraphTrans on the OGB Code2 dataset is depicted in Figure 2. In this task, we take in the Abstract Sentence Tree obtained by parsing a Python method and need to predict the tokens that form the method name. The attention map exhibits similar patterns to those found in NLP applications of Transformers: some nodes receive significant weighting from many other nodes, regardless of the distance between them. Note that node 17 assigns significant importance to node 8, despite these two nodes being five hops away. Also, in Figure 2’s attention map, index 18 refers to the embedding corresponding to the special ${ \tt C L S } >$ token we use as a readout mechanism, described in more detail below. We allow this embedding to be learnable, so the many nodes attending to it (represented by the many dark cells in column 18) may suggest these nodes are obtaining some graphgeneral memory from the learned embedding. This qualitative visualization, along with our new state-of-the-art results, suggest that removing spatial priors when learning long-range dependencies may be necessary for effective graph summarization.
|
| 56 |
+
|
| 57 |
+
# 4 Learning Global Information with GraphTrans
|
| 58 |
+
|
| 59 |
+
Referring back to Figure 1, GraphTrans consists of two primary modules: a GNN subnetwork followed by a Transformer subnetwork. We discuss these in detail next.
|
| 60 |
+
|
| 61 |
+
GNN module. We consider graph property prediction, i.e., for each graph $\mathcal { G } = ( \nu , \mathcal { E } )$ we have a graph-specific prediction target $y _ { \mathcal { G } }$ . We suppose that each node $v \in \nu$ has an initial feature vector $\bar { h } _ { v } ^ { 0 } \in \mathbb { R } ^ { \hat { d } _ { 0 } }$ . As GraphTrans is a generally-applicable framework that can be used in concert with a
|
| 62 |
+
|
| 63 |
+
variety of GNNs, we make very few assumptions on the GNN layers that feed into the Transformer subnetwork. A generic GNN layer stack can be expressed as
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\begin{array} { r } { \pmb { h } _ { v } ^ { \ell } = f _ { \ell } \left( \pmb { h } _ { v } ^ { \ell - 1 } , \{ \pmb { h } _ { u } ^ { \ell - 1 } | u \in \mathcal { N } ( v ) \} \right) , \quad \ell = 1 , \dots , L _ { \mathrm { G N N } } } \end{array}
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where $L _ { \mathrm { G N N } }$ is the total number of GNN layers, ${ \mathcal { N } } ( v ) \subseteq \gamma$ is some neighborhood of $v$ , and $f _ { \ell } ( \cdot )$ is some function parameterized by a neural network. Note that many GNN layers admit edge features, but to avoid notational clutter we omit discussion of them here.
|
| 70 |
+
|
| 71 |
+
Transformer module. Once we have the final per-node GNN encodings $h _ { v } ^ { L _ { \mathrm { G N N } } }$ , we pass these to GraphTrans’s Transformer subnetwork. The Transformer subnetwork operates as follows. We first perform a linear projection of the $h _ { v } ^ { L _ { \mathrm { G N N } } }$ ’s to the Transformer dimension and a Layer Normalization to normalize the embedding:
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\bar { h } _ { v } ^ { 0 } = \mathrm { L a y e r N o r m } ( W ^ { \mathrm { P r o j } } h _ { v } ^ { L _ { \mathrm { G N N } } } )
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
where $W ^ { \mathrm { P r o j } } \in \mathbb { R } ^ { d _ { \mathrm { T F } } \times d _ { L _ { \mathrm { G N N } } } }$ is a learnable weight matrix, and $d _ { \mathrm { T F } }$ and $d _ { L _ { \mathrm { G N N } } }$ are the Transformer dimension and the dimension of the final GNN embedding, respectively. The projected node embeddings $\bar { h } _ { v } ^ { 0 }$ are then fed into a standard Transformer layer stack, with no additive positional embeddings, as we expect the GNN to have already encoded the structural information into the node embeddings:
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\begin{array} { c } { { a _ { v , u } ^ { \ell } = ( W _ { \ell } ^ { Q } \bar { h } _ { v } ^ { \ell - 1 } ) ^ { \top } ( W _ { \ell } ^ { K } \bar { h } _ { u } ^ { \ell - 1 } ) / \sqrt { d _ { \mathrm { T F } } } \qquad \alpha _ { v , u } ^ { \ell } = \displaystyle { \operatorname { s o f t m a x } _ { w \in \mathcal { V } } ( a _ { v , w } ^ { \ell } ) } } } \\ { { \bar { h } _ { v } ^ { \prime \ell } = \displaystyle { \sum _ { w \in \mathcal { V } } \alpha _ { v , w } ^ { \ell } W _ { \ell } ^ { V } \bar { h } _ { w } ^ { \ell - 1 } } } } \end{array}
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
where $W _ { \ell } ^ { Q } , W _ { \ell } ^ { K } , W _ { \ell } ^ { V } \in \mathbb { R } ^ { d _ { \mathrm { T F } } / n _ { \mathrm { h e a d } } \times d _ { \mathrm { T F } } / n _ { \mathrm { h e a d } } }$ are the learned query, key, and value matrices, respectively, for a single attention head in layer $\ell$ . As is standard, we run $n _ { \mathrm { h e a d } }$ parallel attention heads and concatenate the resulting per-head encodings $\bar { h } _ { v } ^ { \prime \ell }$ . Concatenated encodings are then passed to a Transformer fully-connected subnetwork, consisting of the standard Dropout $ \mathrm { L a y e r N o r m } \mathrm { F C }$ nonlinearity Dropout $ \mathrm { F C } \mathrm { D r o p o u t } \mathrm { I }$ ayer Norm sequence, with residual connections from $\bar { h } _ { v } ^ { \ell - 1 }$ to after the first dropout, and from before the first fully-connected sublayer to after the dropout immediately following the second fully-connected sublayer.
|
| 84 |
+
|
| 85 |
+
${ \tt C L S } >$ embedding as a GNN “readout” method. As mentioned, for whole-graph classification we require a single embedding vector that describes the whole graph. In the GNN literature, this module that collapses embeddings for every node and/or edge to a single embedding is called the “readout” module, and the most common readout modules are simple mean or max pooling, or a single “virtual node” that is connected to every other node in the network.
|
| 86 |
+
|
| 87 |
+
In this work, we propose a special-token readout module similar to those used in other applications of Transformers. In text classification tasks with Transformers, a common practice is to append a special ${ \tt C L S } >$ token to the input sequence before passing it into the network, then to take the output embedding corresponding to this token’s position as the representation of the whole sentence. In that way, the Transformer will be trained to aggregate information of the sentence to that embedding, by calculating the one-to-one relationships between the ${ \tt C L S } >$ token and each other tokens in the sentence with the attention module.
|
| 88 |
+
|
| 89 |
+
Our application of special-token readout is similar to this. Concretely, when feeding the transformed per-node embeddings $\bar { h } _ { v } ^ { 0 }$ , we append an additional learnable embedding $h _ { < \mathrm { C L S } > }$ to the sequence, and take the first embedding $\bar { h } _ { < \mathrm { C L S } > } \in \mathbb { R } ^ { d _ { \mathrm { T F } } }$ from the transformer output as the representation of the whole graph (note that since we do not include positional encodings, placing the special token at the “beginning” of the sentence has no special computational meaning; the location is chosen by convention). Finally, we apply a linear projection followed by a softmax to generate the prediction:
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
y = \mathrm { s o f t m a x } ( W ^ { \mathrm { o u t } } \bar { h } _ { < \mathrm { C L S } > } ^ { L _ { \mathrm { T F } } } ) .
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
where $L _ { \mathrm { T F } }$ is the number of Transformer layers.
|
| 96 |
+
|
| 97 |
+
This special-token readout mechanism may be viewed as a generalization or a “deep” version of a virtual node readout. While a virtual node method requires every node in the graph to send its information to the virtual node and does not allow for learning pairwise relationships between graph nodes except within the virtual node’s embedding (possibly creating an information bottleneck), a Transformer-style special-token readout method lets the network learn long-range node-to-node relationships in earlier layers before needing to distill them in the later layers.
|
| 98 |
+
|
| 99 |
+
# 5 Experiments
|
| 100 |
+
|
| 101 |
+
We evaluate GraphTrans on graph classification tasks from three modalities: biology, computer programming, and chemistry. Our GraphTrans achieves consistent improvement over all of these benchmarks, indicating the generality and effectiveness of the framework. All of our models are trained with the Adam optimizer [17] with a learning rate of 0.0001, a weight decay of 0.0001, and the default Adam $\beta$ parameters. All Transformer modules used in our experiments have an embedding dimension $d _ { \mathrm { T F } }$ of 128 and a hidden dimension of 512 in the feedforward subnetwork. The Transformer baselines described below are trained with only the sequence of node embeddings, discarding the graph structure.
|
| 102 |
+
|
| 103 |
+
# 5.1 Biological benchmarks
|
| 104 |
+
|
| 105 |
+
Datasets. We choose two commonly used graph classification benchmarks, NCI1 and NCI109 [31]. Each of them contains about 4000 graphs with around 30 nodes on average, representing biochemical compounds. The task is to predict whether a compound contains anti-lung-cancer activity. We follow the settings in [20, 2] for the NCI1 and NCI109, randomly splitting the dataset into training, validation, and test set by a ratio of 8:1:1.
|
| 106 |
+
|
| 107 |
+
Training Setup. We trained GraphTrans on both the NCI1 and NCI109 datasets for 100 epochs with a batch size of 256. We run each experiment 20 times with different random seeds and calculate the average and standard deviation of the test accuracies. All the model follows the architecture in Figure 1, with 4 transformer layers and a dropout ratio of 0.1 for both the GNN and Transformer modules. We use two different settings adopted from prior literature for the width and depth of the GNN submodule in GraphTrans. The GNN module width and depth in the small GraphTrans model are copied from the simple baseline, i.e. the settings in [20], which has a hidden dimension of 128 and 3 GNN layers. The settings of the GNN module in the large GraphTrans model are adopted from the default GCN/GIN model provided by OGB, which has a hidden dimension of 300 and 4 GNN layers. We also adopt a cosine annealing schedule [22] for learning rate decay.
|
| 108 |
+
|
| 109 |
+
Results. We report the results on both NCI1 and NCI109 in Table 1. The simple baselines, including GCN Set2Set, SortPool, and SAGPool, are taken from [20], while the strong baselines [13], as well as the FA layer [2]. In Table 1, Our Graph Transformer (small) has the same architecture as the simple baseline but improves the average accuracy by $7 . 1 \%$ for NCI1 and $5 . 1 \%$ for NCI109. We also tested the framework with GIN as the encoder (GraphTrans (large)) to align with the settings in the strong baseline, which also significantly improves the accuracy of the strong baseline by $1 . 1 \%$ for NCI1 and the $8 . 2 \%$ for NCI109, even without the deep GNN, using 4 layers instead of 8.
|
| 110 |
+
|
| 111 |
+
# 5.2 Chemical benchmarks
|
| 112 |
+
|
| 113 |
+
Datasets. For chemical benchmarks, we evaluate our GraphTrans on a dataset larger than NCI dataset, molpcba from the Open Graph Benchmark (OGB) [15]. It contains 437929 graphs with 28 nodes on average. Each graph in the dataset represents a molecule, where nodes and edges are atoms and chemical bonds, respectively. The task is to predict the multiple properties of a molecule. We use the standard splitting from the benchmark. The performance on the GIN and GIN-Virtual baselines are as reported on the OGB leaderboard [15].
|
| 114 |
+
|
| 115 |
+
Training Setups. All the GNN modules in the experiments follow the settings of the default GIN model provided in OGB, with 4 layers and 300 hidden dimension. We train all the models for 100 epochs with a batch size of 256 and report the test result with the best validation ROC-AUC. For both GNN and Transformer modules, we apply a dropout of 0.3. We use GIN as the baseline and the GNN module, since it performs better than GCN models on the Molpcba dataset.
|
| 116 |
+
|
| 117 |
+
Table 1: NCI biological datasets GraphTrans outperforms past baselines on both NCI1 and NCI109 test accuracy while using fewer GNN layers than prior SOTA baselines.
|
| 118 |
+
|
| 119 |
+
<table><tr><td>Model</td><td>GNN Type</td><td>GNN layer count</td><td>NCI1 (%)</td><td>NCI109 (%)</td></tr><tr><td>Set2Set [29,20]</td><td>GCN</td><td>3</td><td>68.6± 1.9</td><td>69.8±1.2</td></tr><tr><td>SortPool [39,20]</td><td>GCN</td><td>3</td><td>73.8±1.0</td><td>74.0±1.2</td></tr><tr><td>SAGPoolh [20]</td><td>GCN</td><td>3</td><td>67.5±1.1</td><td>67.9±1.4</td></tr><tr><td>SAGPoolg [20]</td><td>GCN</td><td>3</td><td>74.2±1.2</td><td>74.1±0.8</td></tr><tr><td>Errica et al. [13]</td><td>GIN</td><td>8</td><td>80.0±1.4</td><td></td></tr><tr><td>Alon and Yahav [2]</td><td>GIN</td><td>8</td><td>81.5±1.2</td><td>1</td></tr><tr><td>Transformer [28]</td><td>1</td><td>二</td><td>68.5±2.6</td><td>70.1± 2.3</td></tr><tr><td>GraphTrans (small)</td><td>GCN</td><td>3</td><td>81.3±1.9</td><td>79.2±2.2</td></tr><tr><td>GraphTrans (large)</td><td>GIN</td><td>4</td><td>82.6±1.2</td><td>82.3±2.6</td></tr></table>
|
| 120 |
+
|
| 121 |
+
Table 2: OpenGraphBenchmark Molpcba dataset Overall, GraphTrans outperforms competitive baselines with two backbone GNN architectures.
|
| 122 |
+
|
| 123 |
+
<table><tr><td>Model</td><td>Valid ROC-AUC</td><td>Test ROC-AUC</td></tr><tr><td>GCN [18]</td><td>0.2059±0.0033</td><td>0.2020±0.0024</td></tr><tr><td>GIN [36]</td><td>0.2305±0.0027</td><td>0.2266±0.0028</td></tr><tr><td>GCN-Virtual [18]</td><td>0.2495±0.0042</td><td>0.2424±0.0034</td></tr><tr><td>GIN-Virtual [36]</td><td>0.2798±0.0025</td><td>0.2703±0.0023</td></tr><tr><td>Transformer [28]</td><td>0.1316±0.0012</td><td>0.1281±0.0039</td></tr><tr><td>GraphTrans (GIN)</td><td>0.2893±0.0050</td><td>0.2756±0.0039</td></tr><tr><td>GraphTrans (GIN-Virtual)</td><td>0.2867±0.0022</td><td>0.2761±0.0029</td></tr></table>
|
| 124 |
+
|
| 125 |
+
Results. In Table 2, we report the ROC-AUC on validation and test set of Molpcba. Though Transformer alone works very badly on this dataset, our GraphTrans still improves the ROC-AUC of the GIN and GIN-Virtual baseline. It indicates that our design could take benefit from both the local graph structure learned by the GNN and the long-range concept retrieved by the Transformer module based on the GNN embeddings.
|
| 126 |
+
|
| 127 |
+
# 5.3 Computer programming benchmark
|
| 128 |
+
|
| 129 |
+
Datasets. For the computer programming benchmark, we also adopt a large dataset, code2 from OGB, which has 45741 graphs each with 125 nodes on average. The dataset is a collection of Abstract Syntax Trees (ASTs) from about $4 5 0 \mathrm { k }$ Python method definitions. The task is to predict the sub-tokens forming the method name, given the method body represented by the AST. We also adopt the standard dataset splitting from the benchmark. All baseline performances are as reported on the OGB leaderboard.
|
| 130 |
+
|
| 131 |
+
Training Setups. We also apply the default settings of GCN for Code2 from OGB, with 4 GNN layers, 300 hidden dimension, and a dropout ratio of 0.0. We apply a dropout ratio of 0.3 to the Transformer module to avoid overfitting. We train all the models for 30 epochs with a batch size of 16, due to the large scale of the dataset. For the GraphTrans (PNA) model, we follow the settings in [26], with a hidden embedding of 272 for the GNN module and a weight decay of 3e-6. The only difference is that we still use the learning rate of 0.0001, instead of the heavily tuned 0.00063096 [26]. We run each experiment 5 times and take the average and standard deviation of the F1 score.
|
| 132 |
+
|
| 133 |
+
Results. In Table 3, we compare our GraphTrans with top tier architectures on the leaderboard on Code2 dataset. As the average number of nodes in each graph increases, the global information becomes more important as it becomes more difficult for the GNN to gather information from nodes far away. Even without heavy tuning, GraphTrans significantly outperforms the state-ofthe-art (DAGNN) [27] on the leaderboard. We also include the results for the PNA model and our GraphTrans with the PNA model as the GNN encoder. Our GraphTrans also significantly improves the result, which indicates that our architecture is orthogonal to the variants of the GNN encoder module.
|
| 134 |
+
|
| 135 |
+
Table 3: OpenGraphBenchmark Code2 dataset All the baselines are collected from the OGB leaderboard. GraphTrans outperforms the state-of-the-art DAGNN. The improvement based on PNA model indicates that our method is orthogonal to the type of GNN module.
|
| 136 |
+
|
| 137 |
+
<table><tr><td>Model</td><td>Valid F1 score</td><td>Test F1 score</td></tr><tr><td>GIN [36]</td><td>0.1376±0.0016</td><td>0.1495±0.0023</td></tr><tr><td>GCN [18]</td><td>0.1399±0.0017</td><td>0.1507±0.0018</td></tr><tr><td>GIN-Virtual [36]</td><td>0.1439±0.0026</td><td>0.1581±0.0020</td></tr><tr><td>GCN-Virtual [18]</td><td>0.1461±0.0013</td><td>0.1595±0.0018</td></tr><tr><td>PNA [8]</td><td>0.1453±0.0025</td><td>0.1570±0.0032</td></tr><tr><td>DAGNN (SOTA) [27]</td><td>0.1607±0.0040</td><td>0.1751±0.0049</td></tr><tr><td>Transformer [28]</td><td>0.1546±0.0018</td><td>0.1670±0.0015</td></tr><tr><td>GraphTrans (GCN)</td><td>0.1599±0.0009</td><td>0.1751±0.0015</td></tr><tr><td>GraphTrans (PNA)</td><td>0.1622±0.0025</td><td>0.1765±0.0033</td></tr><tr><td>GraphTrans (GCN-Virtual)</td><td>0.1661±0.0012</td><td>0.1830±0.0024</td></tr></table>
|
| 138 |
+
|
| 139 |
+
Table 4: Ablation of Transformer module On the Code2 dataset, only training the Transformer module in GraphTrans with a frozen pre-trained GNN module also improves the F1-score. It indicates that training the Transformer on GNN embeddings can learn information that is not captured by the GNN.
|
| 140 |
+
|
| 141 |
+
<table><tr><td>Model</td><td>Valid F1 score</td><td>Test F1 score</td></tr><tr><td>Pre-trained GCN-Virtual</td><td>0.1457</td><td>0.1574</td></tr><tr><td>GraphTrans, pre-trained GCN-Virtual, frozen GNN</td><td>0.1479</td><td>0.1616</td></tr><tr><td>GraphTrans, pre-trained GCN-Virtual, fine-tuned GNN</td><td>0.1564</td><td>0.1733</td></tr></table>
|
| 142 |
+
|
| 143 |
+
# 5.4 Transformers can capture long-range relationships
|
| 144 |
+
|
| 145 |
+
As we previously observed in Figure 2 and discussed in Section 3, the attention inside the transformer module can capture long-range information that is hard to be learned by the GNN module.
|
| 146 |
+
|
| 147 |
+
To further verify the hypothesis, we designed an experiment to show that the Transformer module can learn additional information to the GNN module. In Table 4, we first pretrain a GNN (GCN-Virtual) until converge on the Code2 dataset, and then freeze the GNN model and plug our Transformer module after it. By training the model on the training set with a fixed GNN module, we can still observe a 0.0022 F1-score improvement on validation set and 0.0042 on test set. It indicates that the Transformer can learn additional information that is hard to be learned by the GNN module along.
|
| 148 |
+
|
| 149 |
+
With pretrained and unfrozen GNN module, our GraphTrans can achieve an even higher F1-score. That may because the GNN module can now focus on learning the local structure information, by leaving the long-range information learning to the Transformer layer after it. The model benefits from the specialization as mentioned in [34]. Note that for all the experiments in Table 4, we do not concatenate the embeddings from the input graph to the input of Transformer for simplicity.
|
| 150 |
+
|
| 151 |
+
# 5.5 Effectiveness of ${ \tt C L S } >$ embedding
|
| 152 |
+
|
| 153 |
+
In Figure 2b, we can observe that row 18 (the last row is for ${ \mathrm { \tt C L S } } ^ { }$ ) has dark red on multiple columns, which indicates that the ${ \tt C L S } >$ learns to attend to important nodes in the graph to learn the representation for the whole graph.
|
| 154 |
+
|
| 155 |
+
Table 5: Ablation of ${ \tt C L S } >$ token The mean and last are two commonly used embedding aggregation method for sequence classification.
|
| 156 |
+
|
| 157 |
+
<table><tr><td>Model</td><td>Valid</td><td>Test</td></tr><tr><td>GraphTrans, mean</td><td>0.1398</td><td>0.1509</td></tr><tr><td>GraphTrans,last</td><td>0.1566</td><td>0.1716</td></tr><tr><td>GraphTrans,<CLS></td><td>0.1593</td><td>0.1784</td></tr><tr><td>GraphTrans,<CLS>,cat</td><td>0.1670</td><td>0.1810</td></tr></table>
|
| 158 |
+
|
| 159 |
+
Table 6: Scalability of Transformer to large graphs We profile our Code2 model on random graphs and list runtime in milliseconds. GraphTrans scales comparably to the GCN model due to the high cost neighbor sampling in GNN training. With graphs over 1000 nodes, GraphTrans is no less scalable than the GCN baseline.
|
| 160 |
+
|
| 161 |
+
<table><tr><td colspan="2"></td><td colspan="4">Edge Density</td></tr><tr><td>Node count</td><td>Model</td><td>20%</td><td>40%</td><td>60%</td><td>80%</td></tr><tr><td rowspan="2">500</td><td>GCN-Virtual [18]</td><td>44.3</td><td>58.5</td><td>79.3</td><td>99.0</td></tr><tr><td>GraphTrans (GCN)</td><td>48.4</td><td>57.5</td><td>76.4</td><td>93.7</td></tr><tr><td rowspan="2">1000</td><td>GCN-Virtual [18]</td><td>99.1</td><td>171.8</td><td>249.5</td><td>0OM</td></tr><tr><td>GraphTrans (GCN)</td><td>96.9</td><td>168.4</td><td>244.3</td><td>00M</td></tr><tr><td rowspan="2">1200</td><td>GCN-Virtual [18]</td><td>131.8</td><td>237.7</td><td>0OM</td><td>0OM</td></tr><tr><td>GraphTrans (GCN)</td><td>127.9</td><td>236.6</td><td>00M</td><td>0OM</td></tr></table>
|
| 162 |
+
|
| 163 |
+
We also examined the effectiveness of our ${ \tt C L S } >$ embedding quantitatively. In Table 5, we tested several common methods to for sequence classification. The mean operation averages the output embeddings of the transformer to a single graph embedding; the last operation takes the last embedding in the output sequence as the graph embedding. The quantitative results indicate that the ${ \tt C L S } >$ embedding is most effective with 0.0275 improvements on the test set, as the model can learn to retrieve information from different nodes and aggregate them into one embedding. The concatenation of the embeddings in the input graph and the input embeddings of the transformer can further improve the validation and test F1-score to 0.1670 and 0.1733.
|
| 164 |
+
|
| 165 |
+
# 5.6 Scalability
|
| 166 |
+
|
| 167 |
+
To quantitatively benchmark how GraphTrans scales with large graphs over 100 nodes, we ran a microbenchmark of iteration time for training with varying graph size and edge density. We train baselines on randomly generated Erdos-Renyi graphs with a varying number of nodes and edge density. As shown in the Table 6, our GraphTrans model scales at least as well as the GCN model when the number of nodes and edge density increases. Both GCN and GraphTrans see out of memory errors (OOM) with large dense graphs, but we note that GraphTrans had similar memory consumption to the GCN baseline.
|
| 168 |
+
|
| 169 |
+
# 5.7 Computational efficiency
|
| 170 |
+
|
| 171 |
+
To evaluate the overhead that our GraphTrans adds over a specific GNN backbone, we evaluate the forward pass runtime and backward pass runtime per iteration. We normalize models to have roughly similar parameter counts. The results are shown in Table 7. For the NCI1 dataset, GraphTrans is actually faster to train than a comparable GCN model. For the OGB-molpcba and OGB-Code2 datasets, GraphTrans is $7 . 1 1 \%$ slower than the baseline GNN architectures.
|
| 172 |
+
|
| 173 |
+
# 5.8 Number of parameters
|
| 174 |
+
|
| 175 |
+
We compare the number of parameters of the GNN baseline and the GraphTrans on different dataset in Table 8. Overall, GraphTrans only increases total parameters marginally for Molpcba and NCI.
|
| 176 |
+
|
| 177 |
+
Table 7: Speedup of Transformer module For GraphTrans models trained over the NCI1, OGBGMolpcba and OGBG-Code2 datasets, we find that the Transformer module adds minimal overhead. Speedup is the training iteration speed compared to GNN based model; larger number indicates a faster running speed.
|
| 178 |
+
|
| 179 |
+
<table><tr><td>Dataset</td><td>Method</td><td>Forward time (ms)</td><td>Backward time (ms)</td><td> Speedup</td></tr><tr><td rowspan="3">NCI1</td><td>GCN-Virtual [18]</td><td>22.27 ± 2.04</td><td>14.35 ± 2.46</td><td>1.00×</td></tr><tr><td>Transformer</td><td>12.31 ± 1.68</td><td>9.32 ± 1.68</td><td>1.69×</td></tr><tr><td>GraphTrans</td><td>15.01 ± 1.63</td><td>12.04 ± 2.25</td><td>1.35×</td></tr><tr><td rowspan="3">Molpcba</td><td>GCN-Virtual [18]</td><td>14.79 ± 2.54</td><td>12.75 ± 3.00</td><td>1.00×</td></tr><tr><td>Transformer</td><td>12.34 ± 1.43</td><td>10.52 ± 1.60</td><td>1.20×</td></tr><tr><td>GraphTrans</td><td>16.55 ± 2.93</td><td>14.3 ± 3.15</td><td>0.89×</td></tr><tr><td rowspan="3">Code2</td><td>GCN-Virtual [18]</td><td>22.97 ± 6.13</td><td>38.53 ± 6.92</td><td>1.00×</td></tr><tr><td>Transformer</td><td>31.01 ± 9.00</td><td>33.30 ± 16.09</td><td>0.96×</td></tr><tr><td>GraphTrans</td><td>34.93 ± 6.85</td><td>31.14 ± 12.90</td><td>0.93×</td></tr></table>
|
| 180 |
+
|
| 181 |
+
Table 8: Parameter count Overall, GraphTrans achieves improved accuracy with a minor increase in parameters.
|
| 182 |
+
|
| 183 |
+
<table><tr><td>Dataset</td><td>GNN</td><td>GraphTrans</td><td>Delta</td></tr><tr><td>Molpcba</td><td>3.4M</td><td>4.2M</td><td>0.8M</td></tr><tr><td>NCI</td><td>0.4M</td><td>0.5M</td><td>0.1M</td></tr><tr><td>Code2</td><td>12.5M</td><td>9.1M</td><td>-3.4M</td></tr></table>
|
| 184 |
+
|
| 185 |
+
For Code2, GraphTrans is substantially more parameter-efficient than the GNN while improving test F1 score from 0.1629 to 0.1810. One reason for improved parameter efficiency is that the Transformer reduces feature dimension before the expensive final prediction layer.
|
| 186 |
+
|
| 187 |
+
# 6 Conclusion
|
| 188 |
+
|
| 189 |
+
We proposed GraphTrans, a simple yet powerful framework for learning long-range relationships with GNNs. Leveraging recent results that suggest structural priors may be unnecessary or even counterproductive for high-level, long-range relationships, we augment standard GNN layer stacks with a subsequent permutation-invariant Transformer module. The Transformer module acts as a novel GNN “readout” module, simultaneously allowing the learning of pairwise interactions between graph nodes and summarizing them into a special token’s embedding as is done in common NLP applications of Transformers. This simple framework leads to surprising improvements upon the state of the art in several graph classification tasks across program analysis, molecules and protein association networks. In some cases, GraphTrans outperforms methods that attempt to encode domain-specific structural information. Overall, GraphTrans presents a simple yet general approach to improve long-range graph classification; next directions include applications to node and edge classification tasks as well as further scalability improvements of the Transformer to large graphs.
|
| 190 |
+
|
| 191 |
+
# 7 Acknowledgements
|
| 192 |
+
|
| 193 |
+
We thank Ethan Mehta, Azade Nazi, Daniel Rothschild, Adnan Sherif and Justin Wong for thoughtful discussions and feedback. In addition to NSF CISE Expeditions Award CCF-1730628, this research is supported by gifts from Amazon Web Services, Ant Group, Ericsson, Facebook, Futurewei, Google, Intel, Microsoft, Scotiabank, and VMware.
|
| 194 |
+
|
| 195 |
+
References
|
| 196 |
+
[1] A. H. K. Ahmadi, K. Hassani, P. Moradi, L. Lee, and Q. Morris. Memory-based graph networks. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. URL https://openreview. net/forum?id $\cdot ^ { = }$ r1laNeBYPB.
|
| 197 |
+
[2] U. Alon and E. Yahav. On the bottleneck of graph neural networks and its practical implications. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL https://openreview.net/forum? id=i80OPhOCVH2.
|
| 198 |
+
[3] P. W. Battaglia, J. B. Hamrick, V. Bapst, A. Sanchez-Gonzalez, V. Zambaldi, M. Malinowski, A. Tacchetti, D. Raposo, A. Santoro, R. Faulkner, C. Gulcehre, F. Song, A. Ballard, J. Gilmer, G. Dahl, A. Vaswani, K. Allen, C. Nash, V. Langston, C. Dyer, N. Heess, D. Wierstra, P. Kohli, M. Botvinick, O. Vinyals, Y. Li, and R. Pascanu. Relational inductive biases, deep learning, and graph networks. ArXiv preprint, abs/1806.01261, 2018. URL https://arxiv.org/abs/ 1806.01261.
|
| 199 |
+
[4] N. Carion, F. Massa, G. Synnaeve, N. Usunier, A. Kirillov, and S. Zagoruyko. End-to-End Object Detection with Transformers. ArXiv preprint, abs/2005.12872, 2020. URL https: //arxiv.org/abs/2005.12872.
|
| 200 |
+
[5] D. Chen, Y. Lin, W. Li, P. Li, J. Zhou, and X. Sun. Measuring and relieving the over-smoothing problem for graph neural networks from the topological view. In The Thirty-Fourth AAAI Conference on Artificial Intelligence, AAAI 2020, The Thirty-Second Innovative Applications of Artificial Intelligence Conference, IAAI 2020, The Tenth AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI 2020, New York, NY, USA, February 7-12, 2020, pages 3438–3445. AAAI Press, 2020. URL https://aaai.org/ojs/index.php/AAAI/ article/view/5747.
|
| 201 |
+
[6] K. M. Choromanski, V. Likhosherstov, D. Dohan, X. Song, A. Gane, T. Sarlós, P. Hawkins, J. Q. Davis, A. Mohiuddin, L. Kaiser, D. B. Belanger, L. J. Colwell, and A. Weller. Rethinking attention with performers. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL https: //openreview.net/forum?id=Ua6zuk0WRH.
|
| 202 |
+
[7] J. Cordonnier, A. Loukas, and M. Jaggi. On the relationship between self-attention and convolutional layers. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. URL https:// openreview.net/forum?id=HJlnC1rKPB.
|
| 203 |
+
[8] G. Corso, L. Cavalleri, D. Beaini, P. Liò, and P. Velickovic. Principal neighbourhood aggregation for graph nets. In H. Larochelle, M. Ranzato, R. Hadsell, M. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6- 12, 2020, virtual, 2020. URL https://proceedings.neurips.cc/paper/2020/hash/ 99cad265a1768cc2dd013f0e740300ae-Abstract.html.
|
| 204 |
+
[9] M. Defferrard, X. Bresson, and P. Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. In D. D. Lee, M. Sugiyama, U. von Luxburg, I. Guyon, and R. Garnett, editors, Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pages 3837–3845, 2016. URL https://proceedings.neurips.cc/paper/2016/hash/ 04df4d434d481c5bb723be1b6df1ee65-Abstract.html.
|
| 205 |
+
[10] I. S. Dhillon, Y. Guan, and B. Kulis. Weighted Graph Cuts without Eigenvectors A Multilevel Approach. IEEE Transactions on Pattern Analysis and Machine Intelligence, 29(11):1944–1957, 2007. ISSN 0162-8828. doi: 10.1109/TPAMI.2007.1115.
|
| 206 |
+
[11] A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly, J. Uszkoreit, and N. Houlsby. An image is worth 16x16
|
| 207 |
+
|
| 208 |
+
words: Transformers for image recognition at scale. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL https://openreview.net/forum?id=YicbFdNTTy.
|
| 209 |
+
|
| 210 |
+
[12] V. P. Dwivedi and X. Bresson. A Generalization of Transformer Networks to Graphs. ArXiv preprint, abs/2012.09699, 2020. URL https://arxiv.org/abs/2012.09699.
|
| 211 |
+
|
| 212 |
+
[13] F. Errica, M. Podda, D. Bacciu, and A. Micheli. A fair comparison of graph neural networks for graph classification. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. URL https:// openreview.net/forum?id $\underset { . } { = }$ HygDF6NFPB.
|
| 213 |
+
|
| 214 |
+
[14] H. Gao and S. Ji. Graph u-nets. In K. Chaudhuri and R. Salakhutdinov, editors, 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 2083–2092. PMLR, 2019. URL http://proceedings.mlr.press/v97/gao19a.html.
|
| 215 |
+
|
| 216 |
+
[15] W. Hu, M. Fey, M. Zitnik, Y. Dong, H. Ren, B. Liu, M. Catasta, and J. Leskovec. Open graph benchmark: Datasets for machine learning on graphs. In H. Larochelle, M. Ranzato, R. Hadsell, M. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6- 12, 2020, virtual, 2020. URL https://proceedings.neurips.cc/paper/2020/hash/ fb60d411a5c5b72b2e7d3527cfc84fd0-Abstract.html.
|
| 217 |
+
|
| 218 |
+
[16] J. Huang, Z. Li, N. Li, S. Liu, and G. Li. Attpool: Towards hierarchical feature representation in graph convolutional networks via attention mechanism. In 2019 IEEE/CVF International Conference on Computer Vision, ICCV 2019, Seoul, Korea (South), October 27 - November 2, 2019, pages 6479–6488. IEEE, 2019. doi: 10.1109/ICCV.2019.00658. URL https://doi. org/10.1109/ICCV.2019.00658.
|
| 219 |
+
|
| 220 |
+
[17] D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. In Y. Bengio and Y. LeCun, editors, 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.
|
| 221 |
+
|
| 222 |
+
[18] T. N. Kipf et al. Keras-GCN. https://github.com/tkipf/keras-gcn, 2017.
|
| 223 |
+
|
| 224 |
+
[19] N. Kitaev, L. Kaiser, and A. Levskaya. Reformer: The efficient transformer. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. URL https://openreview.net/forum?id $=$ rkgNKkHtvB.
|
| 225 |
+
|
| 226 |
+
[20] J. Lee, I. Lee, and J. Kang. Self-attention graph pooling. In K. Chaudhuri and R. Salakhutdinov, editors, 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 3734–3743. PMLR, 2019. URL http://proceedings.mlr.press/v97/ lee19c.html.
|
| 227 |
+
|
| 228 |
+
[21] Q. Li, Z. Han, and X. Wu. Deeper insights into graph convolutional networks for semisupervised learning. In S. A. McIlraith and K. Q. Weinberger, editors, 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. URL https://www.aaai.org/ocs/index. php/AAAI/AAAI18/paper/view/16098.
|
| 229 |
+
|
| 230 |
+
[22] I. Loshchilov and F. Hutter. SGDR: stochastic gradient descent with warm restarts. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017. URL https://openreview. net/forum?id $\equiv$ Skq89Scxx.
|
| 231 |
+
|
| 232 |
+
[23] D. P. P. Mesquita, A. H. S. Jr., and S. Kaski. Rethinking pooling in graph neural networks. In H. Larochelle, M. Ranzato, R. Hadsell, M. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020. URL https://proceedings.neurips.cc/paper/2020/hash/ 1764183ef03fc7324eb58c3842bd9a57-Abstract.html.
|
| 233 |
+
|
| 234 |
+
[24] Y. Rong, Y. Bian, T. Xu, W. Xie, Y. Wei, W. Huang, and J. Huang. Self-supervised graph transformer on large-scale molecular data. In H. Larochelle, M. Ranzato, R. Hadsell, M. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6- 12, 2020, virtual, 2020. URL https://proceedings.neurips.cc/paper/2020/hash/ 94aef38441efa3380a3bed3faf1f9d5d-Abstract.html.
|
| 235 |
+
|
| 236 |
+
[25] A. Srinivas, T.-Y. Lin, N. Parmar, J. Shlens, P. Abbeel, and A. Vaswani. Bottleneck Transformers for Visual Recognition. ArXiv preprint, abs/2101.11605, 2021. URL https://arxiv.org/ abs/2101.11605.
|
| 237 |
+
|
| 238 |
+
[26] S. A. Tailor, F. L. Opolka, P. Liò, and N. D. Lane. Adaptive filters and aggregator fusion for efficient graph convolutions. ArXiv preprint, abs/2104.01481, 2021. URL https://arxiv. org/abs/2104.01481.
|
| 239 |
+
|
| 240 |
+
[27] V. Thost and J. Chen. Directed acyclic graph neural networks. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL https://openreview.net/forum?id $\equiv$ JbuYF437WB6.
|
| 241 |
+
|
| 242 |
+
[28] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and I. Polosukhin. Attention is all you need. In I. Guyon, U. von Luxburg, S. Bengio, H. M. Wallach, R. Fergus, S. V. N. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pages 5998–6008, 2017. URL https://proceedings.neurips. cc/paper/2017/hash/3f5ee243547dee91fbd053c1c4a845aa-Abstract.html.
|
| 243 |
+
|
| 244 |
+
[29] O. Vinyals, S. Bengio, and M. Kudlur. Order matters: Sequence to sequence for sets. In Y. Bengio and Y. LeCun, editors, 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.06391.
|
| 245 |
+
|
| 246 |
+
[30] N. Wale and G. Karypis. Comparison of Descriptor Spaces for Chemical Compound Retrieval and Classification. In Sixth International Conference on Data Mining (ICDM’06), pages 678–689, 2006. doi: 10.1109/ICDM.2006.39.
|
| 247 |
+
|
| 248 |
+
[31] N. Wale, I. A. Watson, and G. Karypis. Comparison of descriptor spaces for chemical compound retrieval and classification. Knowledge and Information Systems, 14(3):347���375, 2008. ISSN 0219-3116. doi: 10.1007/s10115-007-0103-5. URL https://doi.org/10.1007/ s10115-007-0103-5.
|
| 249 |
+
|
| 250 |
+
[32] H. Wang, Z. Wu, Z. Liu, H. Cai, L. Zhu, C. Gan, and S. Han. HAT: Hardware-aware transformers for efficient natural language processing. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7675–7688, Online, 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.686. URL https://aclanthology.org/2020.acl-main.686.
|
| 251 |
+
|
| 252 |
+
[33] H. Wang, W. Wang, and J. Liu. Temporal Memory Attention for Video Semantic Segmentation. ArXiv preprint, abs/2102.08643, 2021. URL https://arxiv.org/abs/2102.08643.
|
| 253 |
+
|
| 254 |
+
[34] Z. Wu, Z. Liu, J. Lin, Y. Lin, and S. Han. Lite transformer with long-short range attention. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. URL https://openreview.net/forum?id= ByeMPlHKPH.
|
| 255 |
+
|
| 256 |
+
[35] K. Xu, C. Li, Y. Tian, T. Sonobe, K. Kawarabayashi, and S. Jegelka. Representation learning on graphs with jumping knowledge networks. In J. G. Dy and A. Krause, editors, Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmsmässan, Stockholm, Sweden, July 10-15, 2018, volume 80 of Proceedings of Machine Learning
|
| 257 |
+
|
| 258 |
+
Research, pages 5449–5458. PMLR, 2018. URL http://proceedings.mlr.press/v80/ xu18c.html.
|
| 259 |
+
|
| 260 |
+
[36] K. Xu, W. Hu, J. Leskovec, and S. Jegelka. How powerful are graph neural networks? In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019. URL https://openreview.net/forum?id= ryGs6iA5Km.
|
| 261 |
+
|
| 262 |
+
[37] Z. Ying, J. You, C. Morris, X. Ren, W. L. Hamilton, and J. Leskovec. Hierarchical graph representation learning with differentiable pooling. In S. Bengio, H. M. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett, editors, 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 4805–4815, 2018. URL https://proceedings.neurips.cc/paper/2018/hash/ e77dbaf6759253c7c6d0efc5690369c7-Abstract.html.
|
| 263 |
+
|
| 264 |
+
[38] J. Zhang, H. Zhang, C. Xia, and L. Sun. Graph-Bert: Only Attention is Needed for Learning Graph Representations. ArXiv preprint, abs/2001.05140, 2020. URL https://arxiv.org/ abs/2001.05140.
|
| 265 |
+
|
| 266 |
+
[39] M. Zhang, Z. Cui, M. Neumann, and Y. Chen. An end-to-end deep learning architecture for graph classification. In S. A. McIlraith and K. Q. Weinberger, editors, 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 4438–4445. AAAI Press, 2018. URL https://www.aaai.org/ocs/index. php/AAAI/AAAI18/paper/view/17146.
|
| 267 |
+
|
| 268 |
+
[40] J. Zhu, Y. Yan, L. Zhao, M. Heimann, L. Akoglu, and D. Koutra. Beyond homophily in graph neural networks: Current limitations and effective designs. In H. Larochelle, M. Ranzato, R. Hadsell, M. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020. URL https://proceedings.neurips.cc/paper/2020/ hash/58ae23d878a47004366189884c2f8440-Abstract.html.
|
md/train/r1gRTCVFvB/r1gRTCVFvB.md
ADDED
|
@@ -0,0 +1,339 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DECOUPLING REPRESENTATION AND CLASSIFIERFOR LONG-TAILED RECOGNITION
|
| 2 |
+
|
| 3 |
+
Bingyi $\mathbf { K a n g } ^ { 1 , 2 }$ , Saining $\mathbf { X i e ^ { 1 } }$ , Marcus Rohrbach1, Zhicheng $\mathbf { Y a n ^ { 1 } }$ , Albert Gordo1,
|
| 4 |
+
Jiashi Feng2, Yannis Kalantidis1
|
| 5 |
+
1Facebook AI, 2National University of Singapore
|
| 6 |
+
kang@u.nus.edu,{s9xie,mrf,zyan3,agordo,yannisk}@fb.com,elefjia@nus.edu.sg
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
The long-tail distribution of the visual world poses great challenges for deep learning based classification models on how to handle the class imbalance problem. Existing solutions usually involve class-balancing strategies, e.g. by loss re-weighting, data re-sampling, or transfer learning from head- to tail-classes, but most of them adhere to the scheme of jointly learning representations and classifiers. In this work, we decouple the learning procedure into representation learning and classification, and systematically explore how different balancing strategies affect them for long-tailed recognition. The findings are surprising: (1) data imbalance might not be an issue in learning high-quality representations; (2) with representations learned with the simplest instance-balanced (natural) sampling, it is also possible to achieve strong long-tailed recognition ability by adjusting only the classifier. We conduct extensive experiments and set new state-of-the-art performance on common long-tailed benchmarks like ImageNet-LT, Places-LT and iNaturalist, showing that it is possible to outperform carefully designed losses, sampling strategies, even complex modules with memory, by using a straightforward approach that decouples representation and classification. Our code is available at https://github.com/facebookresearch/classifier-balancing.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
Visual recognition research has made rapid advances during the past years, driven primarily by the use of deep convolutional neural networks (CNNs) and large image datasets, most importantly the ImageNet Challenge (Russakovsky et al., 2015). Such datasets are usually artificially balanced with respect to the number of instances for each object/class in the training set. Visual phenomena, however, follow a long-tailed distribution that many standard approaches fail to properly model, leading to a significant drop in accuracy. Motivated by this, a number of works have recently emerged that try to study long-tailed recognition, i.e., recognition in a setting where the number of instances in each class highly varies and follows a long-tailed distribution.
|
| 15 |
+
|
| 16 |
+
When learning with long-tailed data, a common challenge is that instance-rich (or head) classes dominate the training procedure. The learned classification model tends to perform better on these classes, while performance is significantly worse for instance-scarce (or tail) classes. To address this issue and to improve performance across all classes, one can re-sample the data or design specific loss functions that better facilitate learning with imbalanced data (Chawla et al., 2002; Cui et al., 2019; Cao et al., 2019). Another direction is to enhance recognition performance of the tail classes by transferring knowledge from the head classes (Wang et al., 2017; 2018; Zhong et al., 2019; Liu et al., 2019). Nevertheless, the common belief behind existing approaches is that designing proper sampling strategies, losses, or even more complex models, is useful for learning high-quality representations for long-tailed recognition.
|
| 17 |
+
|
| 18 |
+
Most aforementioned approaches thus learn the classifiers used for recognition jointly with the data representations. However, such a joint learning scheme makes it unclear how the long-tailed recognition ability is achieved—is it from learning a better representation or by handling the data imbalance better via shifting classifier decision boundaries? To answer this question, we take one step back and decouple long-tail recognition into representation learning and classification. For learning representations, the model is exposed to the training instances and trained through different sampling strategies or losses. For classification, upon the learned representations, the model recognizes the long-tailed classes through various classifiers. We evaluate the performance of various sampling and classifier training strategies for long-tailed recognition under both joint and decoupled learning schemes.
|
| 19 |
+
|
| 20 |
+
Specifically, we first train models to learn representations with different sampling strategies, including the standard instance-based sampling, class-balanced sampling and a mixture of them. Next, we study three different basic approaches to obtain a classifier with balanced decision boundaries, on top of the learned representations. They are 1) re-training the parametric linear classifier in a class-balancing manner (i.e., re-sampling); 2) non-parametric nearest class mean classifier, which classifies the data based on their closest class-specific mean representations from the training set; and 3) normalizing the classifier weights, which adjusts the weight magnitude directly to be more balanced, adding a temperature to modulate the normalization procedure.
|
| 21 |
+
|
| 22 |
+
We conduct extensive experiments to compare the aforementioned instantiations of the decoupled learning scheme with the conventional scheme that jointly trains the classifier and the representations. We also compare to recent, carefully designed and more complex models, including approaches using memory (e.g., OLTR (Liu et al., 2019)) as well as more sophisticated losses (Cui et al., 2019). From our extensive study across three long-tail datasets, ImageNet-LT, Places-LT and iNaturalist, we make the following intriguing observations:
|
| 23 |
+
|
| 24 |
+
• We find that decoupling representation learning and classification has surprising results that challenge common beliefs for long-tailed recognition: instance-balanced sampling learns the best and most generalizable representations. • It is advantageous in long-tailed recognition to re-adjust the decision boundaries specified by the jointly learned classifier during representation learning: Our experiments show that this can either be achieved by retraining the classifier with class-balanced sampling or by a simple, yet effective, classifier weight normalization which has only a single hyperparameter controlling the “temperature” and which does not require additional training. • By applying the decoupled learning scheme to standard networks (e.g., ResNeXt), we achieve significantly higher accuracy than well established state-of-the-art methods (different sampling strategies, new loss designs and other complex modules) on multiple longtailed recognition benchmark datasets, including ImageNet-LT, Places-LT, and iNaturalist.
|
| 25 |
+
|
| 26 |
+
# 2 RELATED WORK
|
| 27 |
+
|
| 28 |
+
Long-tailed recognition has attracted increasing attention due to the prevalence of imbalanced data in real-world applications (Wang et al., 2017; Zhou et al., 2017; Mahajan et al., 2018; Zhong et al., 2019; Gupta et al., 2019). Recent studies have mainly pursued the following three directions:
|
| 29 |
+
|
| 30 |
+
Data distribution re-balancing. Along this direction, researchers have proposed to re-sample the dataset to achieve a more balanced data distribution. These methods include over-sampling (Chawla et al., 2002; Han et al., 2005) for the minority classes (by adding copies of data), undersampling (Drummond et al., 2003) for the majority classes (by removing data), and class-balanced sampling (Shen et al., 2016; Mahajan et al., 2018) based on the number of samples for each class.
|
| 31 |
+
|
| 32 |
+
Class-balanced Losses. Various methods are proposed to assign different losses to different training samples for each class. The loss can vary at class-level for matching a given data distribution and improving the generalization of tail classes (Cui et al., 2019; Khan et al., 2017; Cao et al., 2019; Khan et al., 2019; Huang et al., 2019). A more fine-grained control of the loss can also be achieved at sample level, e.g. with Focal loss (Lin et al., 2017), Meta-Weight-Net (Shu et al., 2019), re-weighted training (Ren et al., 2018), or based on Bayesian uncertainty (Khan et al., 2019). Recently, Hayat et al. (2019) proposed to balance the classification regions of head and tail classes using an affinity measure to enforce cluster centers of classes to be uniformly spaced and equidistant.
|
| 33 |
+
|
| 34 |
+
Transfer learning from head- to tail classes. Transfer-learning based methods address the issue of imbalanced training data by transferring features learned from head classes with abundant training instances to under-represented tail classes. Recent work includes transferring the intra-class variance (Yin et al., 2019) and transferring semantic deep features (Liu et al., 2019). However it is usually a non-trivial task to design specific modules (e.g. external memory) for feature transfer.
|
| 35 |
+
|
| 36 |
+
A benchmark for low-shot recognition was proposed by Hariharan & Girshick (2017) and consists of a representation learning phase without access to the low-shot classes and a subsequent low-shot learning phase. In contrast, the setup for long-tail recognition assumes access to both head and tail classes and a more continuous decrease in in class labels. Recently, Liu et al. (2019) and Cao et al. (2019) adopt re-balancing schedules that learn representation and classifier jointly within a two-stage training scheme. OLTR (Liu et al., 2019) uses instance-balanced sampling to first learn representations that are fine-tuned in a second stage with class-balanced sampling together with a memory module. LDAM (Cao et al., 2019) introduces a label-distribution-aware margin loss that expands the decision boundaries of few-shot classes. In Section 5 we exhaustively compare to OLTR and LDAM, since they report state-of-the-art results for the ImageNet-LT, Places-LT and iNaturalist datasets. In our work, we argue for decoupling representation and classification. We demonstrate that in a long-tailed scenario, this separation allows straightforward approaches to achieve high recognition performance, without the need for designing sampling strategies, balance-aware losses or adding memory modules.
|
| 37 |
+
|
| 38 |
+
# 3 LEARNING REPRESENTATIONS FOR LONG-TAILED RECOGNITION
|
| 39 |
+
|
| 40 |
+
For long-tailed recognition, the training set follows a long-tailed distribution over the classes. As we have less data about infrequent classes during training, the models trained using imbalanced datasets tend to exhibit under-fitting on the few-shot classes. But in practice we are interested in obtaining the model capable of recognizing all classes well. Various re-sampling strategies (Chawla et al., 2002; Shen et al., 2016; Cao et al., 2019), loss reweighting and margin regularization over few-shot classes are thus proposed. However, it remains unclear how they achieve performance improvement, if any, for long-tailed recognition. Here we systematically investigate their effectiveness by disentangling representation learning from classifier learning, in order to identify what indeed matters for longtailed recognition.
|
| 41 |
+
|
| 42 |
+
Notation. We define the notation used through the paper. Let $X = \{ x _ { i } , y _ { i } \} , i \in \{ 1 , \dots , n \}$ be a
|
| 43 |
+
trainiclass we a g set, wh, and let ume that $y _ { i }$ bel for data point be the total num sorted by cardin $x _ { i }$ . Let r of tty in $n _ { j }$ denote the number oning samples. Withoreasing order, i.e., if ing ss of g, then $j$ $\begin{array} { r } { n = \sum _ { j = 1 } ^ { C } n _ { j } } \end{array}$ $i < j$ $n _ { i } \geq n _ { j }$
|
| 44 |
+
Additionally, since we are in a long-tail setting, $n _ { 1 } \gg n _ { C }$ . Finally, we denote with $f ( x ; \theta ) = z$
|
| 45 |
+
the representation for $x$ , where $f ( x ; \theta )$ is implemented by a deep CNN model with parameter $\theta$ .
|
| 46 |
+
The final class prediction $\tilde { y }$ is given by a classifier function $g$ , such that $\tilde { y } = \arg \operatorname* { m a x } g ( z )$ . For the
|
| 47 |
+
common case, $g$ is a linear classifier, i.e., $g ( z ) = W ^ { \top } z + b$ , where $W$ denotes the classifier weight
|
| 48 |
+
matrix, and $^ { b }$ is the bias. We present other instantiations of $g$ in Section 4.
|
| 49 |
+
|
| 50 |
+
Sampling strategies. In this section we present a number of sampling strategies that aim at rebalancing the data distribution for representation and classifier learning. For most sampling strategies presented below, the probability $p _ { j }$ of sampling a data point from class $j$ is given by:
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
p _ { j } = \frac { n _ { j } ^ { q } } { \sum _ { i = 1 } ^ { C } n _ { i } ^ { q } } ,
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
where $q \in [ 0 , 1 ]$ and $C$ is the number of training classes. Different sampling strategies arise for different values of $q$ and below we present strategies that correspond to $q = 1$ , $q = 0$ , and $q = 1 / 2$ .
|
| 57 |
+
|
| 58 |
+
Instance-balanced sampling. This is the most common way of sampling data, where each training example has equal probability of being selected. For instance-balanced sampling, the probability $p _ { j } ^ { \mathrm { I B } }$ is given by Equation 1 with $q = 1$ , i.e., a data point from class $j$ will be sampled proportionally to the cardinality $n _ { j }$ of the class in the training set.
|
| 59 |
+
|
| 60 |
+
Class-balanced sampling. For imbalanced datasets, instance-balanced sampling has been shown to be sub-optimal (Huang et al., 2016; Wang et al., 2017) as the model under-fits for few-shot classes leading to lower accuracy, especially for balanced test sets. Class-balanced sampling has been used to alleviate this discrepancy, as, in this case, each class has an equal probability of being selected. The probability $p _ { j } ^ { \mathrm { C B } }$ is given by Eq. (1) with $q = 0$ , i.e., $p _ { j } ^ { \mathrm { C B } } = 1 / \bar { C }$ . One can see this as a twostage sampling strategy, where first a class is selected uniformly from the set of classes, and then an instance from that class is subsequently uniformly sampled.
|
| 61 |
+
|
| 62 |
+
Square-root sampling. A number of variants of the previous sampling strategies have been explored. A commonly used variant is square-root sampling (Mikolov et al., 2013; Mahajan et al., 2018), where $q$ is set to $1 / 2$ in Eq. (1) above.
|
| 63 |
+
|
| 64 |
+
Progressively-balanced sampling. Recent approaches (Cui et al., 2018; Cao et al., 2019) utilized mixed ways of sampling, i.e., combinations of the sampling strategies presented above. In practice this involves first using instance-balanced sampling for a number of epochs, and then class-balanced sampling for the last epochs. These mixed sampling approaches require setting the number of epochs before switching the sampling strategy as an explicit hyper-parameter. Here, we experiment with a softer version, progressively-balanced sampling, that progressively “interpolates” between instancebalanced and class-balanced sampling as learning progresses. Its sampling probability/weight $p _ { j }$ for class $j$ is now a function of the epoch $t$ ,
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
p _ { j } ^ { \mathrm { P B } } ( t ) = ( 1 - \frac { t } { T } ) p _ { j } ^ { \mathrm { I B } } + \frac { t } { T } p _ { j } ^ { \mathrm { C B } } ,
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where $T$ is the total number of epochs. Figure 3 in appendix depicts the sampling probabilities.
|
| 71 |
+
|
| 72 |
+
Loss re-weighting strategies. Loss re-weighting functions for imbalanced data have been extensively studied, and it is beyond the scope of this paper to examine all related approaches. What is more, we found that some of the most recent approaches reporting high performance were hard to train and reproduce and in many cases require extensive, dataset-specific hyper-parameter tuning. In Section A of the Appendix we summarize the latest, best performing methods from this area. In Section 5 we show that, without bells and whistles, baseline methods equipped with a properly balanced classifier can perform equally well, if not better, than the latest loss re-weighting approaches.
|
| 73 |
+
|
| 74 |
+
# 4 CLASSIFICATION FOR LONG-TAILED RECOGNITION
|
| 75 |
+
|
| 76 |
+
When learning a classification model on balanced datasets, the classifier weights $W$ and $^ { b }$ are usually trained jointly with the model parameters $\theta$ for extracting the representation $f ( x _ { i } ; \theta )$ by minimizing the cross-entropy loss between the ground truth $y _ { i }$ and prediction $\boldsymbol { W } ^ { \top } f ( x _ { i } ; \dot { \theta } ) + \boldsymbol { b }$ . This is also a typical baseline for long-tailed recognition. Though various approaches of re-sampling, reweighting and transferring representations from head to tail classes have been proposed, the general scheme remains the same: classifiers are either learned jointly with the representations either endto-end, or via a two-stage approach where the classifier and the representation are jointly fine-tuned with variants of class-balanced sampling as a second stage (Cui et al., 2018; Cao et al., 2019).
|
| 77 |
+
|
| 78 |
+
In this section, we consider decoupling the representation from the classification in long-tailed recognition. We present ways of learning classifiers aiming at rectifying the decision boundaries on head- and tail-classes via fine-tuning with different sampling strategies or other non-parametric ways such as nearest class mean classifiers. We also consider an approach to rebalance the classifier weights that exhibits a high long-tailed recognition accuracy without any additional retraining.
|
| 79 |
+
|
| 80 |
+
Classifier Re-training (cRT). A straightforward approach is to re-train the classifier with classbalanced sampling. That is, keeping the representations fixed, we randomly re-initialize and optimize the classifier weights $W$ and $^ { b }$ for a small number of epochs using class-balanced sampling. A similar methodology was also recently used in (Zhang et al., 2019) for action recognition on a long-tail video dataset.
|
| 81 |
+
|
| 82 |
+
Nearest Class Mean classifier (NCM). Another commonly used approach is to first compute the mean feature representation for each class on the training set and then perform nearest neighbor search either using cosine similarity or the Euclidean distance computed on $L _ { 2 }$ normalized mean features (Snell et al., 2017; Guerriero et al., 2018; Rebuffi et al., 2017). Despite its simplicity, this is a strong baseline $\cdot f$ . the experimental evaluation in Section 5); the cosine similarity alleviates the weight imbalance problem via its inherent normalization (see also Figure 4).
|
| 83 |
+
|
| 84 |
+
$\tau$ -normalized classifier ( $\tau$ -normalized). We investigate an efficient approach to re-balance the decision boundaries of classifiers, inspired by an empirical observation: after joint training with instance-balanced sampling, the norms of the weights $\| w _ { j } \|$ are correlated with the cardinality of the classes $n _ { j }$ , while, after fine-tuning the classifiers using class-balanced sampling, the norms of the classifier weights tend to be more similar ( $_ { c f }$ . Figure 2-left).
|
| 85 |
+
|
| 86 |
+
Inspired by the above observations, we consider rectifying imbalance of decision boundaries by adjusting the classifier weight norms directly through the following $\tau$ -normalization procedure. Formally, let $W = \{ w _ { j } \} \in \mathbf { \bar { \mathbb { R } } } ^ { d \times C }$ , where $\boldsymbol { w _ { j } } \in \mathbb { R } ^ { d }$ are the classifier weights corresponding to class $j$ . We scale the weights of $W$ to get $\widetilde { W } = \{ \widetilde { w _ { j } } \}$ by:
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\widetilde { w _ { i } } = \frac { w _ { i } } { \vert \vert w _ { i } \vert \vert \tau } ,
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
where $\tau$ is a hyper-parameter controlling the “temperature” of the normalization, and $| | \cdot | |$ denotes the $L _ { 2 }$ norm. When $\tau = 1$ , it reduces to standard $L _ { 2 }$ -normalization. When $\tau = 0$ , no scaling is imposed. We empirically choose $\tau \in ( 0 , 1 )$ such that the weights can be rectified smoothly. After $\tau$ -normalization, the classification logits are given by $\widehat { y } = \widetilde { W } ^ { \top } f ( x ; \theta )$ . Note that we discard the bias term $^ { b }$ here due to its negligible effect on the logits and final predictions.
|
| 93 |
+
|
| 94 |
+
Learnable weight scaling (LWS). Another way of interpreting $\tau$ -normalization would be to think of it as a re-scaling of the magnitude for each classifier $w _ { i }$ keeping the direction unchanged. This could be written as
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
{ \widetilde { w _ { i } } } = f _ { i } * w _ { i } , { \mathrm { w h e r e ~ } } f _ { i } = { \frac { 1 } { | | w _ { i } | | ^ { \tau } } } .
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
Although for $\tau$ -normalized in general $\tau$ is chosen through cross-validation, we further investigate learning $f _ { i }$ on the training set, using class-balanced sampling (like cRT). In this case, we keep both the representations and classifier weights fixed and only learn the scaling factors $f _ { i }$ . We denote this variant as Learnable Weight Scaling (LWS) in our experiments.
|
| 101 |
+
|
| 102 |
+
# 5 EXPERIMENTS
|
| 103 |
+
|
| 104 |
+
# 5.1 EXPERIMENTAL SETUP
|
| 105 |
+
|
| 106 |
+
Datasets. We perform extensive experiments on three large-scale long-tailed datasets, including Places-LT (Liu et al., 2019), ImageNet-LT (Liu et al., 2019), and iNaturalist 2018 (iNatrualist, 2018). Places-LT and ImageNet-LT are artificially truncated from their balanced versions (Places2 (Zhou et al., 2017) and ImageNet-2012 (Deng et al., 2009)) so that the labels of the training set follow a long-tailed distribution. Places-LT contains images from 365 categories and the number of images per class ranges from 4980 to 5. ImageNet-LT has 1000 classes and the number of images per class ranges from 1280 to 5 images. iNaturalist 2018 is a real-world, naturally long-tailed dataset, consisting of samples from 8,142 species.
|
| 107 |
+
|
| 108 |
+
Evaluation Protocol. After training on the long-tailed datasets, we evaluate the models on the corresponding balanced test/validation datasets and report the commonly used top-1 accuracy over all classes, denoted as All. To better examine performance variations across classes with different number of examples seen during training, we follow Liu et al. (2019) and further report accuracy on three splits of the set of classes: Many-shot (more than 100 images), Medium-shot ( $2 0 \mathrm { \sim } 1 0 0$ images) and Few-shot (less than 20 images). Accuracy is reported as a percentage.
|
| 109 |
+
|
| 110 |
+
Implementation. We use the PyTorch (Paszke et al., 2017) framework for all experiments1. For Places-LT, we choose ResNet-152 as the backbone network and pretrain it on the full ImageNet2012 dataset, following Liu et al. (2019). On ImageNet-LT, we report results with ResNet$\{ 1 0 , 5 0 , 1 0 1 , 1 5 2 \}$ (He et al., 2016) and ResNeXt- $\{ 5 0 , 1 0 1 , 1 5 2 \} ( 3 2 \mathrm { x } 4 \mathrm { d } )$ (Xie et al., 2017) but mainly use ResNeXt-50 for analysis. Similarly, ResNet- $\{ 5 0 , 1 0 1 , 1 5 2 \}$ is also used for iNaturalist 2018. For all experiements, if not specified, we use SGD optimizer with momentum 0.9, batch size 512, cosine learning rate schedule (Loshchilov & Hutter, 2016) gradually decaying from 0.2 to 0 and image resolution $2 2 4 \times 2 2 4$ . In the first representation learning stage, the backbone network is usually trained for 90 epochs. In the second stage, i.e., for retraining a classifier (cRT), we restart the learning rate and train it for 10 epochs while keeping the backbone network fixed.
|
| 111 |
+
|
| 112 |
+

|
| 113 |
+
Figure 1: The performance of different classifiers for each split on ImageNet-LT with ResNeXt-50. Colored markers denote the sampling strategies used to learn the representations.
|
| 114 |
+
|
| 115 |
+
# 5.2 SAMPLING STRATEGIES AND DECOUPLED LEARNING
|
| 116 |
+
|
| 117 |
+
In Figure 1, we compare different sampling strategies for the conventional joint training scheme to a number of variations of the decoupled learning scheme on the ImageNet-LT dataset. For the joint training scheme (Joint), the linear classifier and backbone for representation learning are jointly trained for 90 epochs using a standard cross-entropy loss and different sampling strategies, i.e., Instance-balanced, Class-balanced, Square-root, and Progressively-balanced. For the decoupled learning schemes, we present results when learning the classifier in all the ways presented in Section 4, i.e., re-initialize and re-train (cRT), Nearest Class Mean (NCM) as well as $\tau$ -normalized classifier. Below, we discuss a number of key observations.
|
| 118 |
+
|
| 119 |
+
Sampling matters when training jointly. From the Joint results in Figure 1 across sampling methods and splits, we see consistent gains in performance when using better sampling strategies (see also Table 5). The trends are consistent for the overall performance as well as the medium- and fewshot classes, with progressively-balanced sampling giving the best results. As expected, instancebalanced sampling gives the highest performance for the many-shot classes. This is well expected since the resulted model is highly skewed to the many-shot classes. Our results for different sampling strategies on joint training validate related works that try to design better data sampling methods.
|
| 120 |
+
|
| 121 |
+
Joint or decoupled learning? For most cases presented in Figure 1, performance using decoupled methods is significantly better in terms of overall performance, as well as all splits apart from the many-shot case. Even the nonparametric NCM approach is highly competitive in most cases, while cRT and $\tau$ -normalized outperform the jointly trained baseline by a large margin (i.e. $5 \%$ higher than the jointly learned classifier), and even achieving $2 \%$ higher overall accuracy than the best jointly trained setup with progressively-balanced sampling. The gains are even higher for mediumand few-shot classes at $5 \%$ and $11 \%$ , respectively.
|
| 122 |
+
|
| 123 |
+
Table 1: Retraining/finetuning different parts of a ResNeXt-50 model on ImageNet-LT. B: backbone; C: classifier; LB: last block.
|
| 124 |
+
|
| 125 |
+
<table><tr><td>Re-train</td><td>Many</td><td>Medium</td><td>Few</td><td>All</td></tr><tr><td>B+C</td><td>55.4</td><td>45.3</td><td>24.5</td><td>46.3</td></tr><tr><td>B+C(0.1×lr)</td><td>61.9</td><td>45.6</td><td>22.8</td><td>48.8</td></tr><tr><td>LB+C</td><td>61.4</td><td>45.8</td><td>24.5</td><td>48.9</td></tr><tr><td>C</td><td>61.5</td><td>46.2</td><td>27.0</td><td>49.5</td></tr></table>
|
| 126 |
+
|
| 127 |
+
To further justify our claim that it is beneficial to decouple representation and classifier, we experiment with fine-tuning the backbone network (ResNeXt-50) jointly with the linear classifier. In Table 1, we present results when fine-tuning the whole network with standard or smaller $( 0 . 1 \times )$ learning rate, fine-tuning only the last block in the backbone, or only retraining the linear classifier and fixing the representation. Fine-tuning the whole network yields the worst performance $( 4 6 . 3 \%$ and $4 8 . 8 \%$ ), while keeping the representation frozen performs best $( 4 9 . 5 \% )$ . The trend is even more evident for the medium/few-shot classes. This result suggests that decoupling representation and classifier is desirable for long-tailed recognition.
|
| 128 |
+
|
| 129 |
+

|
| 130 |
+
Figure 2: Left: Classifier weight norms for ImageNet-LT validation set when classes are sorted by descending values of $n _ { j }$ . Blue line: classifier weights learned with instance-balanced sampling. Green line: weights after fine-tuning with class-balanced sampling. Gold line: after $\tau$ normalization. Brown line: weights by learnable weight scaling. Right: Accuracy with different values of the normalization parameter $\tau$ .
|
| 131 |
+
|
| 132 |
+
Instance-balanced sampling gives the most generalizable representations. Among all decoupled methods, when it comes to overall performance and all splits apart from the many-shot classes, we see that Instance-balanced sampling gives the best results. This is particularly interesting, as it implies that data imbalance might not be an issue learning high-quality representations.
|
| 133 |
+
|
| 134 |
+
# 5.3 HOW TO BALANCE YOUR CLASSIFIER?
|
| 135 |
+
|
| 136 |
+
Among the ways of balancing the classifier explored in Figure 1, the non-parametric NCM seems to perform slightly worse than cRT and $\tau$ -normalization. Those two methods are consistently better in most cases apart from the few-shot case, where NCM performs comparably. The biggest drop for the NCM approach comes from the many-shot case. It is yet still somehow surprising that both the NCM and $\tau$ -normalized cases give competitive performance even though they are free of additional training and involve no additional sampling procedure. As discussed in Section 4, their strong performance may stem from their ability to adaptively adjust the decision boundaries for many-, medium- and few-shot classes (see also Figure 4).
|
| 137 |
+
|
| 138 |
+
In Figure 2 (left) we empirically show the $L _ { 2 }$ norms of the weight vectors for all classifiers, as well as the training data distribution sorted in a descending manner with respect to the number of instances in the training set. We can observe that the weight norm of the joint classifier (blue line) is positively correlated with the number of training instances of the corresponding class. More-shot classes tend to learn a classifier with larger magnitudes. As illustrated in Figure 4, this yields a wider classification boundary in feature space, allowing the classifier to have much higher accuracy on data-rich classes, but hurting data-scarce classes. $\tau$ -normalized classifiers (gold line) alleviate this issue to some extent by providing more balanced classifier weight magnitudes. For retraining (green line), the weights are almost balanced except that few-shot classes have slightly larger classifier weight norms. Note that the NCM approach would give a horizontal line in the figure as the mean vectors are $L _ { 2 }$ -normalized before nearest neighbor search.
|
| 139 |
+
|
| 140 |
+
In Figure 2 (right), we further investigate how the performance changes as the temperature parameter $\tau$ for the $\tau$ -normalized classifier varies. The figure shows that as $\tau$ increases from 0, many-shot accuracy decays dramatically while few-shot accuracy increases dramatically.
|
| 141 |
+
|
| 142 |
+
# 5.4 COMPARISON WITH THE STATE-OF-THE-ART ON LONG-TAILED DATASETS
|
| 143 |
+
|
| 144 |
+
In this section, we compare the performance of the decoupled schemes to other recent works that report state-of-the-art results on on three common long-tailed benchmarks: ImageNet-LT, iNaturalist and Places-LT. Results are presented in Tables 2, 3 and 4, respectively.
|
| 145 |
+
|
| 146 |
+
Table 2: Long-tail recognition accuracy on ImageNet-LT for different backbone architectures. $^ \dagger$ denotes results directly copied from Liu et al. (2019). \* denotes results reproduced with the authors’ code. \*\* denotes OLTR with our representation learning stage.
|
| 147 |
+
|
| 148 |
+
<table><tr><td>Method</td><td>ResNet-10 ResNeXt-50 ResNeXt-152</td><td></td></tr><tr><td>FSLwFt (Gidaris & Komodakis,2018)</td><td>28.4</td><td></td></tr><tr><td>Focal Losst (Lin et al.,2017)</td><td>30.5</td><td></td></tr><tr><td>Range Losst (Zhang et al., 2017)</td><td>30.7</td><td></td></tr><tr><td>Lifted Losst (Oh Song et al., 2016)</td><td>30.8</td><td>=</td></tr><tr><td>OLTR† (Liu et al., 2019)</td><td>35.6</td><td>=</td></tr><tr><td>OLTR*</td><td>34.1</td><td>24.8</td></tr><tr><td>OLTR**</td><td>37.3</td><td>50.3</td></tr><tr><td>Joint</td><td>34.8</td><td>44.4 47.8</td></tr><tr><td>NCM</td><td>35.5</td><td>51.3</td></tr><tr><td>cRT</td><td>41.8</td><td>52.4</td></tr><tr><td>T-normalized</td><td>40.6</td><td>52.8</td></tr><tr><td>LWS</td><td>41.4</td><td>53.3</td></tr></table>
|
| 149 |
+
|
| 150 |
+
ImageNet-LT. Table 2 presents results for ImageNet-LT. Although related works present results with ResNet-10 (Liu et al., 2019), we found that using bigger backbone architectures increases performance significantly on this dataset. We therefore present results for three backbones: ResNet-10, ResNeXt-50 and the larger ResNeXt-152. For the state-of-the-art OLTR method of Liu et al. (2019) we adopt results reported in the paper, as well as results we reproduced using the authors’ opensourced codebase2 with two training settings: the one suggested in the codebase and the one using our training setting for the representation learning. From the table we see that the non-parametric decoupled NCM method performs on par with the state-of-the-art for most architectures. We also see that when re-balancing the classifier properly, either by re-training or $\tau$ -normalizing, we get results that, without bells and whistles outperform the current state-of-the-art for all backbone architectures. We further experimented with adding the memory mechanism of Liu et al. (2019) on top of our decoupled cRT setup, but the memory mechanism didn’t seem to further boost performance (see Appendix B.4).
|
| 151 |
+
|
| 152 |
+
iNaturalist 2018. We further evaluate our decoupled methods on the iNaturalist 2018 dataset. We present results after 90 and 200 epochs, as we found that 90 epochs were not enough for the representation learning stage to converge; this is different from Cao et al. (2019) where they train for 90 epochs. From Table 3 we see that results are consistent with the ImageNet-LT case: re-balancing the classifier gives results that outperform CB-Focal (Cui et al., 2019). Our performance, when training only for 90 epochs, is slightly lower than the very recently proposed LDAM $^ +$ DRW (Cao et al., 2019). However, with 200 training epochs and classifier normalization, we achieve a new state-of-the-art of 69.3 with ResNet-50 that can be further improved to 72.5 for ResNet-152. It is further worth noting that we cannot reproduce the numbers reported in Cao et al. (2019). We find that the $\tau$ -normalized classifier performs best and gives a new state-of-the-art for the dataset, while surprisingly achieving similar accuracy $( 6 9 \% / 7 2 \%$ for ResNet-50/ResNet-152) across all many-, medium- and few-shot class splits, a highly desired result for long-tailed recognition. Complete results, i.e., for all splits and more backbone architectures can be found in Table 8 of the Appendix.
|
| 153 |
+
|
| 154 |
+
Places-LT. For Places-LT we follow the protocol of Liu et al. (2019) and start from a ResNet-152 backbone pre-trained on the full ImageNet dataset. Similar to Liu et al. (2019), we then fine-tune the backbone with Instance-balanced sampling for representation learning. Classification follows with fixed representations for our decoupled methods. As we see in Table 4, all three decoupled methods outperform the state-of-the-art approaches, including Lifted Loss (Oh Song et al., 2016), Focal Loss (Lin et al., 2017), Range Loss (Zhang et al., 2017), FSLwF (Gidaris & Komodakis, 2018) and OLTR (Liu et al., 2019). Once again, the $\tau$ -normalized classifier give the top performance, with impressive gains for the medium- and few-shot classes.
|
| 155 |
+
|
| 156 |
+
Table 3: Overall accuracy on iNaturalist 2018. Rows with $^ \dagger$ denote results directly copied from Cao et al. (2019). We present results when training for 90/200 epochs.
|
| 157 |
+
|
| 158 |
+
<table><tr><td>Method</td><td>ResNet-50</td><td>ResNet-152</td></tr><tr><td>CB-Focalt</td><td>61.1</td><td></td></tr><tr><td>LDAMt</td><td>64.6</td><td></td></tr><tr><td>LDAM+DRW†</td><td>68.0</td><td>=</td></tr><tr><td>Joint</td><td>61.7/65.8</td><td>65.0/69.0</td></tr><tr><td>NCM</td><td>58.2/63.1</td><td>61.9/67.3</td></tr><tr><td>cRT</td><td>65.2/67.6</td><td>68.5/71.2</td></tr><tr><td>T-normalized</td><td>65.6/69.3</td><td>68.8/72.5</td></tr><tr><td>LWS</td><td>65.9/69.5</td><td>69.1/72.1</td></tr></table>
|
| 159 |
+
|
| 160 |
+
Table 4: Results on Places-LT, starting from an ImageNet pre-trained ResNet152. $^ \dagger$ denotes results directly copied from Liu et al. (2019).
|
| 161 |
+
|
| 162 |
+
<table><tr><td>Method</td><td>Many</td><td>Medium</td><td>Few</td><td>All</td></tr><tr><td>Lifted Losst</td><td>41.1</td><td>35.4</td><td>24.0</td><td>35.2</td></tr><tr><td>Focal Losst</td><td>41.1</td><td>34.8</td><td>22.4</td><td>34.6</td></tr><tr><td>Range Losst</td><td>41.1</td><td>35.4</td><td>23.2</td><td>35.1</td></tr><tr><td>FSLwFt</td><td>43.9</td><td>29.9</td><td>29.5</td><td>34.9</td></tr><tr><td>OLTR†</td><td>44.7</td><td>37.0</td><td>25.3</td><td>35.9</td></tr><tr><td>Joint</td><td>45.7</td><td>27.3</td><td>8.2</td><td>30.2</td></tr><tr><td>NCM</td><td>40.4</td><td>37.1</td><td>27.3</td><td>36.4</td></tr><tr><td>cRT</td><td>42.0</td><td>37.6</td><td>24.9</td><td>36.7</td></tr><tr><td>T-normalized</td><td>37.8</td><td>40.7</td><td>31.8</td><td>37.9</td></tr><tr><td>LWS</td><td>40.6</td><td>39.1</td><td>28.6</td><td>37.6</td></tr></table>
|
| 163 |
+
|
| 164 |
+
# 6 CONCLUSIONS
|
| 165 |
+
|
| 166 |
+
In this work, we explore a number of learning schemes for long-tailed recognition and compare jointly learning the representation and classifier to a number of straightforward decoupled methods. Through an extensive study we find that although sampling strategies matter when jointly learning representation and classifiers, instance-balanced sampling gives more generalizable representations that can achieve state-of-the-art performance after properly re-balancing the classifiers and without need of carefully designed losses or memory units. We set new state-of-the-art performance for three long-tailed benchmarks and believe that our findings not only contribute to a deeper understanding of the long-tailed recognition task, but can offer inspiration for future work.
|
| 167 |
+
|
| 168 |
+
# REFERENCES
|
| 169 |
+
|
| 170 |
+
Kaidi Cao, Colin Wei, Adrien Gaidon, Nikos Arechiga, and Tengyu Ma. Learning imbalanced datasets with label-distribution-aware margin loss. In Advances in Neural Information Processing Systems, 2019.
|
| 171 |
+
Nitesh V Chawla, Kevin W Bowyer, Lawrence O Hall, and W Philip Kegelmeyer. Smote: synthetic minority over-sampling technique. Journal of artificial intelligence research, 16:321–357, 2002.
|
| 172 |
+
Yin Cui, Yang Song, Chen Sun, Andrew Howard, and Serge Belongie. Large scale fine-grained categorization and domain-specific transfer learning. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 4109–4118, 2018.
|
| 173 |
+
Yin Cui, Menglin Jia, Tsung-Yi Lin, Yang Song, and Serge Belongie. Class-balanced loss based on effective number of samples. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 9268–9277, 2019.
|
| 174 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248–255. Ieee, 2009.
|
| 175 |
+
Chris Drummond, Robert C Holte, et al. C4. 5, class imbalance, and cost sensitivity: why undersampling beats over-sampling. In Workshop on learning from imbalanced datasets II, volume 11, pp. 1–8. Citeseer, 2003.
|
| 176 |
+
Spyros Gidaris and Nikos Komodakis. Dynamic few-shot visual learning without forgetting. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4367– 4375, 2018.
|
| 177 |
+
Samantha Guerriero, Barbara Caputo, and Thomas Mensink. Deep nearest class mean classifiers. In International Conference on Learning Representations, Worskhop Track, 2018.
|
| 178 |
+
|
| 179 |
+
Agrim Gupta, Piotr Dollar, and Ross Girshick. Lvis: A dataset for large vocabulary instance segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5356–5364, 2019.
|
| 180 |
+
|
| 181 |
+
Hui Han, Wen-Yuan Wang, and Bing-Huan Mao. Borderline-smote: a new over-sampling method in imbalanced data sets learning. In International conference on intelligent computing, pp. 878–887. Springer, 2005.
|
| 182 |
+
|
| 183 |
+
Bharath Hariharan and Ross Girshick. Low-shot visual recognition by shrinking and hallucinating features. In Proceedings of the IEEE International Conference on Computer Vision, pp. 3018– 3027, 2017.
|
| 184 |
+
|
| 185 |
+
Munawar Hayat, Salman Khan, Waqas Zamir, Jianbing Shen, and Ling Shao. Max-margin class imbalanced learning with gaussian affinity. arXiv preprint arXiv:1901.07711, 2019.
|
| 186 |
+
|
| 187 |
+
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.
|
| 188 |
+
|
| 189 |
+
Chen Huang, Yining Li, Chen Change Loy, and Xiaoou Tang. Learning deep representation for imbalanced classification. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 5375–5384, 2016.
|
| 190 |
+
|
| 191 |
+
Chen Huang, Yining Li, Change Loy Chen, and Xiaoou Tang. Deep imbalanced learning for face recognition and attribute prediction. IEEE transactions on pattern analysis and machine intelligence, 2019.
|
| 192 |
+
|
| 193 |
+
iNatrualist. The inaturalist 2018 competition dataset. https://github.com/visipedia/inat comp/tree/master/2018, 2018.
|
| 194 |
+
|
| 195 |
+
Salman Khan, Munawar Hayat, Syed Waqas Zamir, Jianbing Shen, and Ling Shao. Striking the right balance with uncertainty. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2019.
|
| 196 |
+
|
| 197 |
+
Salman H Khan, Munawar Hayat, Mohammed Bennamoun, Ferdous A Sohel, and Roberto Togneri. Cost-sensitive learning of deep feature representations from imbalanced data. IEEE transactions on neural networks and learning systems, 29(8):3573–3587, 2017.
|
| 198 |
+
|
| 199 |
+
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.
|
| 200 |
+
|
| 201 |
+
Ziwei Liu, Zhongqi Miao, Xiaohang Zhan, Jiayun Wang, Boqing Gong, and Stella X Yu. Large-scale long-tailed recognition in an open world. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2537–2546, 2019.
|
| 202 |
+
|
| 203 |
+
Ilya Loshchilov and Frank Hutter. Sgdr: Stochastic gradient descent with warm restarts. arXiv preprint arXiv:1608.03983, 2016.
|
| 204 |
+
|
| 205 |
+
Dhruv Mahajan, Ross Girshick, Vignesh Ramanathan, Kaiming He, Manohar Paluri, Yixuan Li, Ashwin Bharambe, and Laurens van der Maaten. Exploring the limits of weakly supervised pretraining. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 181– 196, 2018.
|
| 206 |
+
|
| 207 |
+
Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems, pp. 3111–3119, 2013.
|
| 208 |
+
|
| 209 |
+
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, pp. 4004–4012, 2016.
|
| 210 |
+
|
| 211 |
+
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.
|
| 212 |
+
|
| 213 |
+
Sylvestre-Alvise Rebuffi, Alexander Kolesnikov, Georg Sperl, and Christoph H Lampert. icarl: Incremental classifier and representation learning. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pp. 2001–2010, 2017.
|
| 214 |
+
|
| 215 |
+
Mengye Ren, Wenyuan Zeng, Bin Yang, and Raquel Urtasun. Learning to reweight examples for robust deep learning. In ICML, 2018.
|
| 216 |
+
|
| 217 |
+
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, 115(3):211–252, 2015.
|
| 218 |
+
|
| 219 |
+
Li Shen, Zhouchen Lin, and Qingming Huang. Relay backpropagation for effective learning of deep convolutional neural networks. In European conference on computer vision, pp. 467–482. Springer, 2016.
|
| 220 |
+
|
| 221 |
+
Jun Shu, Qi Xie, Lixuan Yi, Qian Zhao, Sanping Zhou, Zongben Xu, and Deyu Meng. Meta-weightnet: Learning an explicit mapping for sample weighting. arXiv preprint arXiv:1902.07379, 2019.
|
| 222 |
+
|
| 223 |
+
Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. In Advances in Neural Information Processing Systems, 2017.
|
| 224 |
+
|
| 225 |
+
Yu-Xiong Wang, Deva Ramanan, and Martial Hebert. Learning to model the tail. In Advances in Neural Information Processing Systems, pp. 7029–7039, 2017.
|
| 226 |
+
|
| 227 |
+
Yu-Xiong Wang, Ross Girshick, Martial Hebert, and Bharath Hariharan. Low-shot learning from imaginary data. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018.
|
| 228 |
+
|
| 229 |
+
Saining Xie, Ross Girshick, Piotr Dollar, Zhuowen Tu, and Kaiming He. Aggregated residual trans- ´ formations for deep neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1492–1500, 2017.
|
| 230 |
+
|
| 231 |
+
Xi Yin, Xiang Yu, Kihyuk Sohn, Xiaoming Liu, and Manmohan Chandraker. Feature transfer learning for face recognition with under-represented data. In In Proceeding of IEEE Computer Vision and Pattern Recognition, Long Beach, CA, June 2019.
|
| 232 |
+
|
| 233 |
+
Xiao Zhang, Zhiyuan Fang, Yandong Wen, Zhifeng Li, and Yu Qiao. Range loss for deep face recognition with long-tailed training data. In Proceedings of the IEEE International Conference on Computer Vision, pp. 5409–5418, 2017.
|
| 234 |
+
|
| 235 |
+
Yubo Zhang, Pavel Tokmakov, Martial Hebert, and Cordelia Schmid. A study on action detection in the wild. arXiv preprint arXiv:1904.12993, 2019.
|
| 236 |
+
|
| 237 |
+
Yaoyao Zhong, Weihong Deng, Mei Wang, Jiani Hu, Jianteng Peng, Xunqiang Tao, and Yaohai Huang. Unequal-training for deep face recognition with long-tailed noisy data. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, June 2019.
|
| 238 |
+
|
| 239 |
+
Bolei Zhou, Agata Lapedriza, Aditya Khosla, Aude Oliva, and Antonio Torralba. Places: A 10 million image database for scene recognition. IEEE transactions on pattern analysis and machine intelligence, 40(6):1452–1464, 2017.
|
| 240 |
+
|
| 241 |
+
# A LOSS RE-WEIGHTING STRATEGIES
|
| 242 |
+
|
| 243 |
+
Here, we summarize some of the best performing loss re-weighting methods that we compare against in Section 5. Introduced in the context of object detection where imbalance exists in most common benchmarks, the Focal loss (Lin et al., 2017) aims to balance the sample-wise classification loss for model training by down-weighing easy samples. To this end, given a probability prediction $h _ { i }$ for the sample $x _ { i }$ over its true category $y _ { i }$ , it adds a re-weighting factor $( 1 - h _ { i } ) ^ { \gamma }$ with $\gamma > 0$ into the standard cross-entropy loss $\mathcal { L } _ { C E }$ :
|
| 244 |
+
|
| 245 |
+
$$
|
| 246 |
+
\begin{array} { r } { \mathcal { L } _ { \mathrm { f o c a l } } : = ( 1 - h _ { i } ) ^ { \gamma } \mathcal { L } _ { C E } = - ( 1 - h _ { i } ) ^ { \gamma } \log ( h _ { i } ) . } \end{array}
|
| 247 |
+
$$
|
| 248 |
+
|
| 249 |
+
For easy samples (which may dominate the training samples) with large predicted probability $h _ { i }$ for their true categories, their corresponding cross entropy loss will be down weighted. Recently, Cui et al. (2019) presented a class balanced variant of the focal loss and applied it to long-tailed recognition. They modulated the Focal loss for a sample from class $j$ with a balance-aware coefficient equal to $( 1 - \beta ) / ( 1 - \beta _ { j } ^ { n } )$ . Very recently, Cao et al. (2019) proposed a label-distribution-aware margin (LDAM) loss that encourages few-shot classes to have larger margins, and their final loss is formulated as a cross-entropy loss with enforced margins:
|
| 250 |
+
|
| 251 |
+
$$
|
| 252 |
+
\mathcal { L } _ { \mathrm { L D A M } } : = - \log \frac { e ^ { \hat { y } _ { j } - \Delta _ { j } } } { e ^ { \hat { y } _ { j } - \Delta _ { j } } + \sum _ { c } \neq j e ^ { \hat { y } _ { c } - \Delta _ { c } } } ,
|
| 253 |
+
$$
|
| 254 |
+
|
| 255 |
+
$\hat { y }$ are the logits and $\Delta _ { j }$ is a class-aware margin, inversely proportional to $n _ { j } ^ { 1 / 4 }$
|
| 256 |
+
|
| 257 |
+
# B FURTHER ANALYSIS AND RESULTS
|
| 258 |
+
|
| 259 |
+
# B.1 SAMPLING STRATEGIES
|
| 260 |
+
|
| 261 |
+
In Figure 3 we visualize the sampling weights for the four sampling strategies we explore. In Table 5 we present accuracy on ImageNet-LT for “all” classes when training the representation and classifier jointly. It is clear that better sampling strategies help when jointly training the classifier with the representations/backbone architecture.
|
| 262 |
+
|
| 263 |
+

|
| 264 |
+
Figure 3: Sampling weights $p _ { j }$ for ImageNet-LT. Classes are ordered with decreasing $n _ { j }$ on the $\mathbf { X }$ -axis. Left: instance-balanced, class-balanced and square-root sampling. Right: Progressivelybalanced sampling; as epochs progress, sampling goes from instance-balanced to class-balanced sampling.
|
| 265 |
+
|
| 266 |
+
# B.2 CLASSIFIER DECISION BOUNDARIES FOR $\tau$ -NORMALIZED AND NCM
|
| 267 |
+
|
| 268 |
+
In Figure 4 we illustrate the classifier decision boundaries before/after normalization with Eq.(3), as well as when using cosine distance. Balancing the norms also leads to more balanced decision boundaries, allowing the classifiers for few-shot classes to occupy more space.
|
| 269 |
+
|
| 270 |
+
Table 5: Accuracy on ImageNet-LT when jointly learning the representation and classifier using different sampling strategies. Results in this Table are a subset of the results presented in Figure 1.
|
| 271 |
+
|
| 272 |
+
<table><tr><td>Sampling</td><td>Many</td><td>Medium</td><td>Few</td><td>All</td></tr><tr><td>Instance-balanced</td><td>65.9</td><td>37.5</td><td>7.7</td><td>44.4</td></tr><tr><td>Class-balanced</td><td>61.8</td><td>40.1</td><td>15.5</td><td>45.1</td></tr><tr><td>Square-root</td><td>64.3</td><td>41.2</td><td>17.0</td><td>46.8</td></tr><tr><td>Progressively-balanced</td><td>61.9</td><td>43.2</td><td>19.4</td><td>47.2</td></tr></table>
|
| 273 |
+
|
| 274 |
+

|
| 275 |
+
Figure 4: Illustrations on different classifiers and their corresponding decision boundaries, where $w _ { i }$ and $w _ { j }$ denote the classification weight for class $i$ and $j$ respectively, $\mathcal { C } _ { i }$ is the classification cone belongs to class $i$ in the feature space, $m _ { i }$ is the feature mean for class $i$ . From left to right: $\tau$ -normalized classifiers with $\tau 0$ : the classifier with larger weights have wider decision boundaries; $\tau$ -normalized classifiers with $\tau 1$ : the decision boundaries are more balanced for different classes; NCM with cosine-similarity whose decision boundary is independent of the classifier weights; NCM with Euclidean-similarity whose decision boundaries partition the feature space into Voronoi cells.
|
| 276 |
+
|
| 277 |
+
# B.3 CLASSIFIER LEARNING COMPARISON TABLE
|
| 278 |
+
|
| 279 |
+
Table 6 presents some comparative analysis for the four different ways of learning the classifier that are presented in Section 4.
|
| 280 |
+
|
| 281 |
+
# B.4 VARYING THE BACKBONE ARCHITECTURE SIZE
|
| 282 |
+
|
| 283 |
+
ImageNet-LT. In Figure 5 we compare the performance of different backbone architecture sizes (model capacity) under different methods, including of different methods 1) OLTR (Liu et al., 2019) using the authors’ codebase settings (OLTR\*); 2) OLTR using the representation learning stage detailed in Section 5 $( \mathrm { O L T R ^ { * * } } )$ ; 3) cRT with the memory module from Liu et al. (2019) while training the classifier; 4) cRT; and 5) $\tau$ -normalized. we see that a) the authors’ implementation of OLTR over-fits for larger models, b) overfitting can be alleviated with our training setup (different training and LR schedules) c) adding the memory unit when re-training the classifier doesn’t increase performance. Additional results of Table 2 are given in Table 7.
|
| 284 |
+
|
| 285 |
+
iNaturalist 2018. In Table 8 we present an extended version of the results of Table 3. We show results per split as well as results with a ResNet-101 backbone. As we see from the table and mentioned in Section 5, training only for 90 epochs gives sub-optimal representations, while both large models and longer training result in much higher accuracy on this challenging, large-scale task. What is even more interesting, we see performance across the many-, medium- and few-shot splits being approximately equal after re-balancing the classifier, with only a small advantage for the many-shot classes.
|
| 286 |
+
|
| 287 |
+
<table><tr><td></td><td>Joint</td><td>NCM</td><td>cRT</td><td>T-normalized</td><td>LWS</td></tr><tr><td>Decoupled from repr.</td><td>×</td><td>√</td><td>√</td><td>√</td><td>√</td></tr><tr><td>No extra training</td><td>√</td><td>√</td><td>×</td><td>√</td><td>X</td></tr><tr><td>No extra hyper-parameters</td><td>√</td><td>√</td><td>√</td><td>X</td><td>√</td></tr><tr><td>Performance</td><td>★</td><td></td><td>***</td><td>***</td><td>★**</td></tr></table>
|
| 288 |
+
|
| 289 |
+
Table 6: Comparative analysis for different ways of learning the classifier for long-tail recognition.
|
| 290 |
+
|
| 291 |
+

|
| 292 |
+
Figure 5: Accuracy on ImageNet-LT for different backbones
|
| 293 |
+
|
| 294 |
+
Table 7: Comprehensive results on ImageNet-LT with different backbone networks {ResNet, ResNeXt}-{50, 101,152}
|
| 295 |
+
|
| 296 |
+
<table><tr><td rowspan="2">Backbone</td><td rowspan="2">Method</td><td colspan="4">ResNet</td><td colspan="4">ResNeXt</td></tr><tr><td>Many</td><td>Medium</td><td>Few</td><td>All</td><td>Many</td><td>Medium</td><td>Few</td><td>All</td></tr><tr><td rowspan="5">*-50</td><td>Joint</td><td>64.0</td><td>33.8</td><td>5.8</td><td>41.6</td><td>65.9</td><td>37.5</td><td>7.7</td><td>44.4</td></tr><tr><td>NCM</td><td>53.1</td><td>42.3</td><td>26.5</td><td>44.3</td><td>56.6</td><td>45.3</td><td>28.1</td><td>47.3</td></tr><tr><td>cRT</td><td>58.8</td><td>44.0</td><td>26.1</td><td>47.3</td><td>61.8</td><td>46.2</td><td>27.4</td><td>49.6</td></tr><tr><td>T-normalized</td><td>56.6</td><td>44.2</td><td>27.4</td><td>46.7</td><td>59.1</td><td>46.9</td><td>30.7</td><td>49.4</td></tr><tr><td>LWS</td><td>57.1</td><td>45.2</td><td>29.3</td><td>47.7</td><td>60.2</td><td>47.2</td><td>30.3</td><td>49.9</td></tr><tr><td rowspan="5">*-101</td><td>Joint</td><td>66.6</td><td>36.8</td><td>7.1</td><td>44.2</td><td>66.2</td><td>37.8</td><td>8.6</td><td>44.8</td></tr><tr><td>NCM</td><td>56.8</td><td>45.1</td><td>28.8</td><td>47.4</td><td>57.2</td><td>45.5</td><td>29.5</td><td>47.8</td></tr><tr><td>cRT</td><td>61.6</td><td>46.5</td><td>28.0</td><td>49.8</td><td>61.7</td><td>46.0</td><td>27.0</td><td>49.4</td></tr><tr><td>T-normalized</td><td>59.4</td><td>47.0</td><td>30.6</td><td>49.6</td><td>59.1</td><td>47.0</td><td>31.7</td><td>49.6</td></tr><tr><td>LWS</td><td>60.1</td><td>47.6</td><td>31.2</td><td>50.2</td><td>60.5</td><td>47.2</td><td>31.2</td><td>50.1</td></tr><tr><td rowspan="5">*-152</td><td>Joint</td><td>66.9</td><td>27.7</td><td>7.7</td><td>44.9</td><td>69.1</td><td>41.4</td><td>10.4</td><td>47.8</td></tr><tr><td>NCM</td><td>56.9</td><td>45.6</td><td>29.9</td><td>47.8</td><td>60.3</td><td>49.0</td><td>33.6</td><td>51.3</td></tr><tr><td>cRT</td><td>61.8</td><td>46.8</td><td>28.4</td><td>50.1</td><td>64.7</td><td>49.1</td><td>29.4</td><td>52.4</td></tr><tr><td>T-normalized</td><td>59.6</td><td>47.5</td><td>32.2</td><td>50.1</td><td>62.2</td><td>50.1</td><td>35.8</td><td>52.8</td></tr><tr><td>LWS</td><td>60.6</td><td>47.8</td><td>31.4</td><td>50.5</td><td>63.5</td><td>50.4</td><td>34.2</td><td>53.3</td></tr></table>
|
| 297 |
+
|
| 298 |
+
# B.5 ON THE EXPLORATION OF DETERMINING $\tau$
|
| 299 |
+
|
| 300 |
+
The current tau-normalization strategy does require a validation set to choose tau, which could be a disadvantage depending on the practical scenario. Can we do better?
|
| 301 |
+
|
| 302 |
+
Finding $\tau$ value on training set. We also attempted to select $\tau$ directly on the training dataset.
|
| 303 |
+
Surprisingly, final performance on testing set is very similar, with $\tau$ selected using training set only.
|
| 304 |
+
|
| 305 |
+
We achieve this goal by simulating a balanced testing distribution from the training set. We first feed the whole training set through the network to get the top-1 accuracy for each of the classes. Then, we average the class-specific accuracies and use the averaged accuracy as the metric to determine the tau value. As shown in Table 9, we compare the $\tau$ found on training set and validation set for all three datasets. We can see that both the vale of $\tau$ and the overall performances are very close to each other, which demonstrates the effectiveness of searching for $\tau$ on training set. This strategy offers a practical way to find $\tau$ even when validation set is not available.
|
| 306 |
+
|
| 307 |
+
Learning $\tau$ value on training set. We further investigate if we can automatically learn the $\tau$ value instead of grid search. To this end, following cRT, we set $\tau$ as a learnable parameter and learn it on the training set with balanced sampling, while keeping all the other parameters fixed (including both the backbone network and classifier). Also, we compare the learned $\tau$ value and the corresponding results in the Table 9 (denoted by “learn” $= \checkmark$ ). This further reduces the manual effort of searching best $\tau$ values and make the strategy more accessible for practical usage.
|
| 308 |
+
|
| 309 |
+
Table 8: Comprehensive results on iNaturalist 2018 with different backbone networks (ResNet-50, ResNet-101 & ResNet-152) and different training epochs (90 & 200)
|
| 310 |
+
|
| 311 |
+
<table><tr><td rowspan="2">Backbone</td><td rowspan="2">Method</td><td colspan="4">90 Epochs</td><td colspan="4">200 Epochs</td></tr><tr><td>Many</td><td>Medium</td><td>Few</td><td>All</td><td>Many</td><td>Medium</td><td>Few</td><td>All</td></tr><tr><td rowspan="5">ResNet-50</td><td>Joint</td><td>72.2</td><td>63.0</td><td>57.2</td><td>61.7</td><td>75.7</td><td>66.9</td><td>61.7</td><td>65.8</td></tr><tr><td>NCM</td><td>55.5</td><td>57.9</td><td>59.3</td><td>58.2</td><td>61.0</td><td>63.5</td><td>63.3</td><td>63.1</td></tr><tr><td>cRT</td><td>69.0</td><td>66.0</td><td>63.2</td><td>65.2</td><td>73.2</td><td>68.8</td><td>66.1</td><td>68.2</td></tr><tr><td>T-normalized</td><td>65.6</td><td>65.3</td><td>65.9</td><td>65.6</td><td>71.1</td><td>68.9</td><td>69.3</td><td>69.3</td></tr><tr><td>LWS</td><td>65.0</td><td>66.3</td><td>65.5</td><td>65.9</td><td>71.0</td><td>69.8</td><td>68.8</td><td>69.5</td></tr><tr><td rowspan="5">ResNet-101</td><td>Joint</td><td>75.9</td><td>66.0</td><td>59.9</td><td>64.6</td><td>75.5</td><td>68.9</td><td>63.2</td><td>67.3</td></tr><tr><td>NCM</td><td>58.6</td><td>61.9</td><td>61.8</td><td>61.5</td><td>63.7</td><td>65.7</td><td>65.3</td><td>65.3</td></tr><tr><td>cRT</td><td>73.0</td><td>68.9</td><td>65.7</td><td>68.1</td><td>73.9</td><td>70.4</td><td>67.8</td><td>69.7</td></tr><tr><td>T-normalized</td><td>69.7</td><td>68.3</td><td>68.3</td><td>68.5</td><td>68.6</td><td>70.6</td><td>72.2</td><td>71.0</td></tr><tr><td>LWS</td><td>69.6</td><td>69.1</td><td>67.9</td><td>68.7</td><td>71.5</td><td>71.3</td><td>69.7</td><td>70.7</td></tr><tr><td rowspan="5">ResNet-152</td><td>Joint</td><td>75.2</td><td>66.3</td><td>60.7</td><td>65.0</td><td>78.2</td><td>70.6</td><td>64.7</td><td>69.0</td></tr><tr><td>NCM</td><td>59.3</td><td>61.9</td><td>62.6</td><td>61.9</td><td>66.3</td><td>67.5</td><td>67.2</td><td>67.3</td></tr><tr><td>cRT</td><td>73.6</td><td>69.3</td><td>66.3</td><td>68.5</td><td>75.9</td><td>71.9</td><td>69.1</td><td>71.2</td></tr><tr><td>T-normalized</td><td>69.8</td><td>68.5</td><td>68.9</td><td>68.8</td><td>74.3</td><td>72.3</td><td>72.2</td><td>72.5</td></tr><tr><td>LWS</td><td>69.4</td><td>69.5</td><td>68.6</td><td>69.1</td><td>74.3</td><td>72.4</td><td>71.2</td><td>72.1</td></tr></table>
|
| 312 |
+
|
| 313 |
+
Table 9: Determining $\tau$ on the training set
|
| 314 |
+
|
| 315 |
+
<table><tr><td>Dataset</td><td>split</td><td>learn</td><td>T</td><td>Many</td><td>Medium</td><td>Few</td><td>All</td></tr><tr><td rowspan="3">ImageNet-LT</td><td>val</td><td>×</td><td>0.7</td><td>59.1</td><td>46.9</td><td>30.7</td><td>49.4</td></tr><tr><td>train</td><td>X</td><td>0.7</td><td>59.1</td><td>46.9</td><td>30.7</td><td>49.4</td></tr><tr><td>train</td><td>√</td><td>0.6968</td><td>59.2</td><td>46.9</td><td>30.6</td><td>49.4</td></tr><tr><td rowspan="3">iNaturalist</td><td>val</td><td>X</td><td>0.3</td><td>65.6</td><td>65.3</td><td>65.9</td><td>65.6</td></tr><tr><td>train</td><td>×</td><td>0.2</td><td>69.0</td><td>65.2</td><td>63.6</td><td>65.0</td></tr><tr><td>train</td><td>√</td><td>0.3146</td><td>65.1</td><td>65.2</td><td>66.1</td><td>65.6</td></tr><tr><td rowspan="3">Places-LT</td><td>val</td><td>X</td><td>0.8</td><td>37.8</td><td>40.7</td><td>31.8</td><td>37.9</td></tr><tr><td>train</td><td>×</td><td>0.6</td><td>41.4</td><td>39.3</td><td>25.3</td><td>37.4</td></tr><tr><td>train</td><td>√</td><td>0.5246</td><td>42.6</td><td>38.3</td><td>22.7</td><td>36.8</td></tr></table>
|
| 316 |
+
|
| 317 |
+
# B.6 COMPARING MLP CLASSFIIER WITH LINEAR CLASSIFIER
|
| 318 |
+
|
| 319 |
+
We experimented with MLPs with different layers (2 or 3) and different number of hidden neurons (2048 or 512). We use ReLU as activation function, set the batch size to be 512, and train the MLP using balanced sampling on fixed representation for 10 epochs with a cosine learning rate schedule, which gradually decrease the learning rate to zero. We conducted experiments on two datasets.
|
| 320 |
+
|
| 321 |
+
On ImageNet-LT, we use ResNeXt50 as the backbone network. The results are summarized in Table 10. We can see that when the MLP going deeper, the performance are getting worse. It probably means the backbone network is enough to learn discriminative representation.
|
| 322 |
+
|
| 323 |
+
Table 10: MLP classifier on ImageNet-LT
|
| 324 |
+
|
| 325 |
+
<table><tr><td rowspan="2">Layers</td><td colspan="4">hid-dim : 2048</td><td colspan="4">hid-dim : 512</td></tr><tr><td>Many</td><td>Medium</td><td>Few</td><td>All</td><td>Many</td><td>Medium</td><td>Few</td><td>All</td></tr><tr><td>1</td><td>61.7</td><td>45.9</td><td>26.8</td><td>49.4</td><td></td><td></td><td></td><td></td></tr><tr><td>2</td><td>60.8</td><td>44.4</td><td>24.5</td><td>48.0</td><td>59.9</td><td>44.3</td><td>25.1</td><td>47.7</td></tr><tr><td>3</td><td>60.3</td><td>44.3</td><td>23.7</td><td>47.7</td><td>59.3</td><td>43.7</td><td>23.9</td><td>47.0</td></tr></table>
|
| 326 |
+
|
| 327 |
+
For iNaturalist, we use the representation from a ResNet50 model trained for 200 epochs. We only consider a hidden dimension of 2048, as this dataset contains much more classes. The results are shown in Table 11, and show that performance drop is even more severe when a deeper classifier is used.
|
| 328 |
+
|
| 329 |
+
Table 11: MLP classifier on iNaturalst
|
| 330 |
+
|
| 331 |
+
<table><tr><td>Layers|</td><td>Many</td><td>Medium</td><td>Few</td><td>All</td></tr><tr><td>1</td><td>73.2</td><td>68.8</td><td>66.1</td><td>68.2</td></tr><tr><td>2</td><td>60.4</td><td>61.8</td><td>60.6</td><td>61.2</td></tr><tr><td>3</td><td>68.5</td><td>63.6</td><td>60.1</td><td>62.8</td></tr></table>
|
| 332 |
+
|
| 333 |
+
# B.7 COSINE SIMILARITY FOR CLASSIFICATION
|
| 334 |
+
|
| 335 |
+
We tried to replace the linear classifier with a cosine similarity classifier with (denoted by “cos”) and without (denoted by ”cos(noRelu)”) the last ReLU activation function, following Gidaris & Komodakis (2018). We summarize the results in Table 12, which show that they are comparable to each other.
|
| 336 |
+
|
| 337 |
+
Table 12: Cosine similarity Classifier
|
| 338 |
+
|
| 339 |
+
<table><tr><td>Classifier</td><td>Many</td><td>Medium</td><td>Few</td><td>All</td></tr><tr><td>NCM</td><td>56.6</td><td>45.3</td><td>28.1</td><td>47.3</td></tr><tr><td>cRT</td><td>61.7</td><td>45.9</td><td>26.8</td><td>49.4</td></tr><tr><td>T-normalized</td><td>59.1</td><td>46.9</td><td>30.7</td><td>49.4</td></tr><tr><td>cos</td><td>60.4</td><td>46.8</td><td>29.3</td><td>49.7</td></tr><tr><td>cos(noRelu)</td><td>60.7</td><td>46.9</td><td>28.0</td><td>49.6</td></tr></table>
|
md/train/r1kNDlbCb/r1kNDlbCb.md
ADDED
|
@@ -0,0 +1,309 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING TO ENCODE TEXT AS HUMAN-READABLESUMMARIES USING GENERATIVE ADVERSARIAL NET-WORKS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Auto-encoders compress input data into a latent-space representation and reconstruct the original data from the representation. This latent representation is not easily interpreted by humans. In this paper, we propose training an auto-encoder that encodes input text into human-readable sentences. The auto-encoder is composed of a generator and a reconstructor. The generator encodes the input text into a shorter word sequence, and the reconstructor recovers the generator input from the generator output. To make the generator output human-readable, a discriminator restricts the output of the generator to resemble human-written sentences. By taking the generator output as the summary of the input text, abstractive summarization is achieved without document-summary pairs as training data. Promising results are shown on both English and Chinese corpora.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
When it comes to learning data representations, a popular approach involves the auto-encoder architecture, which compresses the data into a latent representation without supervision. In this paper we focus on learning text representations. Because text is a sequence of words, to encode a sequence, a sequence-to-sequence (seq2seq) auto-encoder (Li et al., 2015; Kiros et al., 2015) is usually used, in which a RNN is used to encode the input sequence into a fixed-length representation, after which another RNN is used to decode the original input sequence given this representation.
|
| 12 |
+
|
| 13 |
+
Although the latent representation learned by the auto-encoder can be used in downstream applications, they are usually not human-readable. In this work, we use comprehensible natural language as a latent representation of the input source text in an auto-encoder model. This human-readable latent representation is shorter than the source text; in order to reconstruct the source text, it must reflect the core idea of the source text. Intuitively, the latent representation can be considered a summary of the text.
|
| 14 |
+
|
| 15 |
+
The idea that using human comprehensible representation as a latent representation has been explored on text summarization (Miao & Blunsom, 2016), but only in a semi-supervised scenario. Previous work uses a prior distribution from a pre-trained language model to constrain the generated sequence to natural language. However, to teach the compressor network to generate text summaries, the model is trained using labeled data. In contrast, in this work we need no labeled data to learn the representations.
|
| 16 |
+
|
| 17 |
+
The proposed model is inspired from cycle consistency (Zhu et al., 2017; He et al., 2016). As shown in Fig. 1, the proposed model is composed of three components: a generator, a discriminator, and a reconstructor. Together, the generator and reconstructor form a text auto-encoder. The generator acts as an encoder in generating the latent representation from the input text. Instead of using a vector as latent representation, however, the generator generates a word sequence much shorter than the input text. From the shorter text, the reconstructor reconstructs the original input of the generator. By minimizing the reconstruction errors, the generator learns to generate short text segments that contain the main information in the original input. We use the seq2seq model in modeling the generator and reconstructor because both have input and output sequences with different lengths.
|
| 18 |
+
|
| 19 |
+
However, it is very possible that the generator’s output word sequence can be processed by the reconstructor but is not readable by humans. Here, instead of regularizing the generator output with a pre-trained language model (Miao & Blunsom, 2016), we borrow from adversarial autoencoders (Makhzani et al., 2015) and introduce a third component – the discriminator – to regularize the generator’s output word sequence.
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1: Proposed model. Given long text, the generator produces a shorter text as a summary. The generator is learned by minimizing the reconstruction loss together with the reconstructor and making discriminator regard its output as human-written text.
|
| 23 |
+
|
| 24 |
+
The discriminator and the generator form a generative adversarial network (GAN) (Goodfellow et al., 2014). GANs are generative models composed of a generator and a discriminator. The discriminator discriminates between the generator output and real data, and the generator produces output as similar as possible to real data to confuse the discriminator. Here, we only have to feed human-written sentences to the discriminator as real data. With the GAN framework, the discriminator teaches the generator how to create human-like summary sentences as a latent representation; however, this only guarantees that the generator produces grammatically correct sentences – not necessarily sentences that represent the input text. It is the reconstructor that teaches the generator how to produce a sentence that captures the core idea of the source text.
|
| 25 |
+
|
| 26 |
+
However, generating discrete distributions with GAN is challenging, since it is difficult to evaluate the distance between the continuous distribution from the generator and the discrete distribution of the real sample. In addition, if we feed sampled words from the generator output distribution to the discriminator, the process of word selection is non-differentiable, which yields a discriminator gradient that precludes back-propagation to the generator. With GAN, there are two ways to generate language: (1) by training with a policy gradient, which regards words as actions, or (2) by directly feeding the generator’s output layer to the discriminator, which yields a gradient suited to backpropagation to the generator. In this work, we propose new kind of method on training with policy gradient in which the discriminator evaluates the output of generator every time steps. On language generation with GAN, we conduct experiments using both (1) and (2) methods and evaluate their results.
|
| 27 |
+
|
| 28 |
+
We evaluate the results on an abstractive text summarization task in which the machine generates a text summary in its own words. The model is learned from a set of unpaired documents and summaries1. We use the sentences in the summaries as real data for discriminator2. As the summaries can come from another set of documents not related to the training documents, training is unsupervised. We use the output word sequence of the generator as the summaries of the input text. The results show that the generator generates summaries with reasonable quality on both English and Chinese corpora.
|
| 29 |
+
|
| 30 |
+
# 2 RELATED WORK
|
| 31 |
+
|
| 32 |
+
# GAN FOR LANGUAGE GENERATION
|
| 33 |
+
|
| 34 |
+
The major challenge in applying GAN to sentence generation is the discrete nature of natural language. To generate a word sequence, the generator usually has non-differential parts such as argmax or other sample functions which cause the original GAN to fail. Therefore, new kinds of GANs have been proposed for sentence generation.
|
| 35 |
+
|
| 36 |
+
SeqGAN (Yu et al., 2017) tackles the sequence generation problem with reinforcement learning. Here, we refer to this approach as adversarial REINFORCE, in which the generator is regarded as an agent, the generated sequence of words is viewed as a sequence of actions, and the current state is defined as the generated sequence to date and the prior input. However, the discriminator only measures the quality of whole sentences, and thus the rewards are extremely sparse and the rewards assigned to all actions in sequence are all the same. To tackle this problem, they propose MC search to evaluate approximate rewards at each time step, but this method suffers from high time complexity. Following this idea, (Li et al., 2017) proposes another approach to evaluate the expected reward at each time step. They break both the generated and real sequences into partial sequences, and the discriminator discriminates between the generated and real partial sequences. Inspired by this idea, we propose the self-critical adversarial REINFORCE algorithm as another way to evaluate the expected reward at each time step.
|
| 37 |
+
|
| 38 |
+
In (Gulrajani et al., 2017), instead of feeding a discrete word sequence, the authors directly feed the generator output layer to the discriminator. This method works because they use the earth mover’s distance on GAN as proposed in (Arjovsky et al., 2017), which is able to evaluate the distance between a discrete and a continuous distribution. In order to satisfy the requirement of the earth mover’s distance, they use a gradient penalty trick to confine the complexity of discriminator function. Their method achieves an amazing result: it is the first work on GAN training that performs language generation without pre-training. In our work, we also conduct experiments on this method with discriminator settings almost the same as the original paper.
|
| 39 |
+
|
| 40 |
+
# ABSTRACTIVE TEXT SUMMARIZATION
|
| 41 |
+
|
| 42 |
+
Recent model architectures for abstractive text summarization basically use the sequence-tosequence (Sutskever et al., 2014) framework in combination with various novel mechanisms. One popular mechanism is attention (Bahdanau et al., 2015), which has been shown helpful for summarization (Nallapati et al., 2016; Rush et al., 2015). It is also possible to directly optimize evaluation metrics such as ROUGE (Lin, 2004) with reinforcement learning (Ranzato et al., 2016; Paulus et al., 2017; Bahdanau et al., 2016). The hybrid pointer-generator network (See et al., 2017) selects words from the original text with a pointer (Vinyals et al., 2015) or from the whole vocabulary with a trained weight. In order to eliminate repetition, a coverage vector (Tu et al., 2016) can be used to keep track of attended words and coverage loss (See et al., 2017) can be used to encourage model focus on diverse words. While most papers focus on supervised learning with novel mechanisms, we explore unsupervised training models.
|
| 43 |
+
|
| 44 |
+
# 3 PROPOSED METHOD
|
| 45 |
+
|
| 46 |
+
The overview of the proposed model is shown in Fig. 2. The model is composed of three components: generator $G$ , discriminator $D$ , and reconstructor $R$ . Both $G$ and $R$ are seq2seq hybrid pointer-generator networks (See et al., 2017) which can decide to copy words from encoder input text via pointing or generate from vocabulary.They both take a word sequence as input and output a sequence of word distributions. Discriminator $D$ , on the other hand, takes a sequence as input and outputs a scalar. The model is learned from a set of documents $x$ and human-written sentences $y ^ { r e a l }$ . Although in real implementation, $y ^ { r e a l }$ are the sentences in summaries, we note that the documents and summaries are unpaired.
|
| 47 |
+
|
| 48 |
+
To train the model, a training document $\boldsymbol { x } = \{ x _ { 1 } , x _ { 2 } , . . . , x _ { t } , . . . , x _ { T } \}$ , where $x _ { t }$ represents a word, is fed to $G$ , which outputs a sequence of word distributions $G ( x ) = \left\{ y _ { 1 } , y _ { 2 } , . . . , y _ { n } , . . . , y _ { N } \right\}$ , where $y _ { n }$ is a distribution over all words in the lexicon. Then we sample a word $y _ { n } ^ { s }$ from each distribution $y _ { n }$ , and a word sequence $y ^ { s } = \{ y _ { 1 } ^ { s } , y _ { 2 } ^ { s } , . . . , y _ { N } ^ { s } \}$ is obtained according to $G ( x )$ . We feed the sampled word sequence $y ^ { s }$ to reconstructor $R$ , which outputs another sequence of word distributions $\hat { x }$ . The reconstructor $R$ reconstructs the original text $x$ from $y ^ { s }$ . That is, we seek an output of reconstructor $\hat { x }$ that is as close to the original text $x$ as possible; hence the loss for training the reconstructor $R$ , $R _ { l o s s }$ , is defined as
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
R _ { l o s s } = \sum _ { k = 1 } ^ { K } l _ { s } ( x , \hat { x } ) ,
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+

|
| 55 |
+
Figure 2: Architecture of proposed model. The generator network and reconstructor network are a seq2seq hybrid pointer-generator network, but for simplicity, we omit the pointer and the attention parts.
|
| 56 |
+
|
| 57 |
+
where the reconstruction loss $l _ { s } ( x , \hat { x } )$ is the cross-entropy loss computed between the reconstructor output sequence $\hat { x }$ and the source text $x$ , or the negative conditional log-likelihood of source text $x$ given word sequence $y ^ { s }$ sampled from $G ( x )$ . The reconstructor output sequence $\hat { x }$ is teacher-forced by source text $x$ . The subscript $s$ in $l _ { s } ( x , \hat { x } )$ indicates that $\hat { x }$ is reconstructed from $y ^ { s }$ . $K$ is the number of training examples (documents), and (1) is the summation of the cross-entropy loss over all the training documents $x$ .
|
| 58 |
+
|
| 59 |
+
In the proposed model, the generator $G$ and reconstructor $R$ form an auto-encoder. However, the reconstructor $R$ does not directly take the generator output distribution $G ( x )$ as input 3. Instead, the reconstructor takes a sampled discrete sequence $y ^ { s }$ as input. Due to the non-differentiable property of discrete sequences, we apply the REINFORCE algorithm, which is described in Section 4.
|
| 60 |
+
|
| 61 |
+
In addition to reconstruction, we need the discriminator $D$ to discriminate between the real sequence yreal and the generated sequence $y ^ { s }$ to regularize the generated sequence satisfying the summary distribution. $D$ learns to give $y ^ { r e a l }$ higher scores while giving $y ^ { s }$ lower scores. The loss for training the discriminator $D$ is denoted as $D _ { l o s s }$ ; this is further described in Section 5.
|
| 62 |
+
|
| 63 |
+
$G$ learns to minimize the reconstruction error $R _ { l o s s }$ , while maximizing the loss of the discriminator $D$ by generating a summary sequence $y ^ { s }$ that cannot be differentiated by $D$ from the real thing. The loss when training the generator $G$ , $G _ { l o s s }$ , is
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
G _ { l o s s } = \alpha R _ { l o s s } - D _ { l o s s } ^ { \prime }
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where $D _ { l o s s } ^ { \prime }$ is highly related to $D _ { l o s s }$ – but not necessary the same – and $\alpha$ is a hyper-parameter.
|
| 70 |
+
After obtaining the optimal generator by minimizing (2), we use it to generate summaries.
|
| 71 |
+
|
| 72 |
+
Generator $G$ and discriminator $D$ together form a GAN. We use two different adversarial training methods to train $D$ and $G$ ; as shown in Fig. 2, these two methods have their own discriminators 1 and 2. Discriminator 1 takes the generator output layer $G ( x )$ as input, whereas discriminator 2 takes the sampled discrete word sequence $y ^ { s }$ as input. The two methods are described respectively in Sections 5.1 and 5.2.
|
| 73 |
+
|
| 74 |
+
# 4 MINIMIZING RECONSTRUCTION ERROR
|
| 75 |
+
|
| 76 |
+
Because discrete sequences are non-differentiable, we use the REINFORCE algorithm. The generator is seen as an agent whose reward given the source text $x$ is $- l _ { s } ( x , \hat { x } )$ . Maximizing the reward is equivalent to minimizing the reconstruction loss $R _ { l o s s }$ in (1). However, the reconstruction loss varies widely from sample to sample, and thus the rewards to the generator are not stable either. Hence we add a baseline to reduce their difference. We apply self-critical sequence training (Rennie et al., 2017); the modified reward $r ^ { R } ( x , { \hat { x } } )$ from reconstructor $R$ with the baseline for the generator is
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
r ^ { R } ( x , \hat { x } ) = - l _ { s } ( x , \hat { x } ) - ( - l _ { a } ( x , \hat { x } ) - b )
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
where $- l _ { a } ( x , { \hat { x } } ) - b$ is the baseline. $l _ { a } ( x , \hat { x } )$ is also the same cross-entropy reconstruction loss as $l _ { s } ( x , \hat { x } )$ , except that $\hat { x }$ is obtained from $y ^ { a }$ instead of $y ^ { s }$ . $y ^ { a }$ is a word sequence $\left\{ y _ { 1 } ^ { a } , y _ { 2 } ^ { a } , . . . , y _ { n } ^ { a } , . . . , y _ { N } ^ { a } \right\}$ , where $y _ { n } ^ { a }$ is selected using the argmax function from the output distribution of generator $y _ { n }$ . As in the early training stage, the sequence $y ^ { s }$ barely yields higher reward than sequence $y ^ { a }$ , to encourage exploration we introduce the second baseline score $b$ , which gradually decreases to zero. Then, the generator is updated using the REINFORCE algorithm with reward $r ^ { R } ( x , { \hat { x } } )$ to minimize $R _ { l o s s }$ .
|
| 83 |
+
|
| 84 |
+
# 5 GAN TRAINING
|
| 85 |
+
|
| 86 |
+
With adversarial training, the generator learns to produce sentences as similar to the human-written sentences as possible. Here, we conduct experiments on two kinds of methods of language generation with GAN. In Section 5.1 we directly feed the generator output probability distributions to the discriminator and use a Wasserstein GAN (WGAN) with a gradient penalty. In Section 5.2, we explore adversarial REINFORCE, which feeds sampled discrete word sequences to the discriminator and evaluates the quality of the sequence from the discriminator for use as a reward signal to the generator.
|
| 87 |
+
|
| 88 |
+
# 5.1 DISCRIMINATOR 1: WASSERSTEIN GAN
|
| 89 |
+
|
| 90 |
+
In the lower left of Fig. 2, the discriminator model is shown as discriminator1. The discriminator loss $D _ { l o s s }$ is
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
D _ { l o s s } = \frac { 1 } { K } \sum _ { k = 1 } ^ { K } D ( y ^ { s ( k ) } ) - \frac { 1 } { K } \sum _ { k = 1 } ^ { K } D ( y ^ { r e a l ( k ) } ) + \beta ( \Delta _ { y ^ { i ( k ) } } D ( y ^ { i ( k ) } ) - 1 ) ^ { 2 } ,
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
where $K$ denotes the number of training examples in a batch, and $k$ denotes the $k$ -th example. The last term in (4) is the gradient penalty (Gulrajani et al., 2017). We interpolate the generator output layer $G ( x )$ and the real sample $y ^ { r e a \bar { l } }$ , and apply the gradient penalty to the interpolated sequence $y ^ { i }$ . $\beta$ determines the gradient penalty scale. In Equation (2), for WGAN, $D _ { l o s s } ^ { \prime }$ is the score of the generated example:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
D _ { l o s s } ^ { \prime } = \frac { 1 } { K } \sum _ { k = 1 } ^ { K } D ( G ( x ^ { ( k ) } ) ) .
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
# 5.2 SELF-CRITIC ADVERSARIAL REINFORCE
|
| 103 |
+
|
| 104 |
+
In this section, we describe in detail the proposed adversarial REINFORCE method. The core idea is we use the LSTM discriminator to evaluate the current quality of the generated sequence $\{ y _ { 1 } ^ { s } , y _ { 2 } ^ { s } , . . . , y _ { i } ^ { s } \}$ at each time step $i$ . Hence, the generator knows that compared to the last time step, as the generated sentence either improves or worsens, it can easily find the problematic generation step in a long sequence, and thus fix the problem easily.
|
| 105 |
+
|
| 106 |
+
# 5.2.1 DISCRIMINATOR 2
|
| 107 |
+
|
| 108 |
+
As shown in Fig. 2, the discriminator2 is a one-way LSTM network which takes a discrete word sequence as input. At time step $i$ , given input word $y _ { i } ^ { s }$ it predicts the current score $s _ { i }$ based on the sequence $\left\{ y _ { 1 } , y _ { 2 } , . . . , y _ { i } \right\}$ . The score is viewed as the quality of the current sequence.
|
| 109 |
+
|
| 110 |
+
In order to compute the discriminator loss $D _ { l o s s }$ , we sum the scores $\left\{ s _ { 1 } , s _ { 2 } , . . . , s _ { N } \right\}$ of the whole sequence $y ^ { s }$ to yield
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
\begin{array} { c } { { \displaystyle { D ( y ^ { s } ) = \frac { 1 } { N } \sum _ { n = 1 } ^ { N } s _ { n } . } } } \\ { { \displaystyle { D _ { l o s s } = \frac { 1 } { K } \sum _ { k = 1 } ^ { K } D ( y ^ { s ( k ) } ) - \frac { 1 } { K } \sum _ { k = 1 } ^ { K } D ( y ^ { r e a l ( k ) } ) , } } } \end{array}
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
where $K$ and $N$ denote the number of training examples and the generated sequence length respectively. With the loss mentioned above, the discriminator attempts to quickly determine whether the current sequence is real or fake. The earlier the timestep discriminator determines whether the current sequence is real or fake, the lower its loss. An example is shown in Fig. 3.
|
| 117 |
+
|
| 118 |
+

|
| 119 |
+
Figure 3: When the second arrested appears, the discriminator determines that this example came from the generator. Hence, after this time-step, it outputs low scores.
|
| 120 |
+
|
| 121 |
+
# 5.2.2 SELF-CRITICAL GENERATOR
|
| 122 |
+
|
| 123 |
+
Since we feed a discrete sequence $y ^ { s }$ to the discriminator, the gradient from the discriminator cannot directly back-propagate to the generator. Here, we use the policy gradient method. At timestep $i$ , we use the $i - 1$ timestep score $s _ { i - 1 }$ from the discriminator as its self-critical baseline. The reward r Di evaluates whether the quality of sequence in timestep $i$ is better or worse than that in timestep $i - 1$ . The generator reward $r _ { i } ^ { D }$ from $D$ is
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
r _ { i } ^ { D } = \left\{ \begin{array} { l l } { { s _ { i } \qquad } } & { { \mathrm { i f ~ i = 1 ~ } } } \\ { { s _ { i } - s _ { i - 1 } \qquad } } & { { \mathrm { o t h e r w i s e . } } } \end{array} \right.
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
However, some sentences may be judged as bad sentences at the previous timestep, but at later timesteps judged as good sentences, and vice versa. Hence we use the discounted expected reward $d$ with discount factor $\gamma$ to calculate the discounted reward $d _ { i }$ at time step $i$ as
|
| 130 |
+
|
| 131 |
+
$$
|
| 132 |
+
d _ { i } = \sum _ { j = i } ^ { N } \gamma ^ { j - i } r _ { j } ^ { D } .
|
| 133 |
+
$$
|
| 134 |
+
|
| 135 |
+
The adversarial REINFORCE score related to discriminator $D _ { l o s s } ^ { \prime }$ in (2) is
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
D _ { l o s s } ^ { \prime } = E _ { y _ { i } ^ { s } \sim p _ { G } ( y _ { i } ^ { s } | y _ { 1 } ^ { s } , . . . , y _ { i - 1 } ^ { s } , x ) } ^ { } [ d _ { i } ] .
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
We use the likelihood ratio trick to approximate the gradient.
|
| 142 |
+
|
| 143 |
+
# 6 IMPLEMENTATION
|
| 144 |
+
|
| 145 |
+
Network Architecture. The model architecture of generator and reconstructor is almost same except the length of input and output sequence. We adapt model architecture for our generator and reconstructor from See et al. (2017) who used hybrid-pointer network with coverage vector for text summarization. The hybrid-pointer networks of generator and reconstructor are all composed of two one-layer LSTMs as its encoder and decoder, respectively, with a hidden layer size of 600. Since we use two kinds of methods on adversarial training, there are two discriminators with different model architecture. In the Section 5.1, the discriminator is composed of four residual blocks with 512 hidden dimensions. While in Section 5.2, we use only one hidden-layer one-way LSTM with a hidden size of 512 as our discriminator.
|
| 146 |
+
|
| 147 |
+
Details of Training. We set the weight $\alpha$ in (2) controlling $R _ { l o s s }$ to 10 if not specified. We find that the if the value of $\alpha$ is too large, generator will start to generate output unlike human-written sentences. On the other hand, if the value of $\alpha$ is too small, the sentences generated by generator will sometimes become unrelated to input text of generator. For all the experiments, the baseline $b$ in (3) gradually decreases from 0.25 to zero within 10000 updates on generator.
|
| 148 |
+
|
| 149 |
+
In Section 5.1, we set the weight $\beta$ of the gradient penalty to 10, and used RMSPropOptimizer with a learning rate of 0.00001 and 0.001 on the generator and discriminator, respectively. In Section 5.2, we clip the value of the weights of discriminator to $\pm 0 . 1 5$ , and used RMSPropOptimizer with a learning rate of 0.0001 and 0.001 on the generator and discriminator, respectively. It’s also feasible to apply gradient penalty trick in this method to satisfy requirement of Wasserstein distance. However, in this method, the performance of gradient penalty trick and weights clipping trick is close.
|
| 150 |
+
|
| 151 |
+
# 7 EXPERIMENT
|
| 152 |
+
|
| 153 |
+
We evaluate our model on the Chinese Gigaword and English Gigaword datasets. Before jointly training the whole model, we pre-trained the three major components – generator, discriminator, and reconstructor – separately. First, we pre-trained the generator in an unsupervised manner so that the generator would be able to somewhat grasp the semantic meaning of the source text. The details of the pre-training are in Appendix A. We pre-trained the discriminator and reconstructor respectively with the pre-trained generator’s output to ensure that these two critic networks provide good feedback to the generator. During testing, when using the generator to generate summaries, we simply selected the words in a greedy fashion without beam-search, and we eliminated repetition.
|
| 154 |
+
|
| 155 |
+
# 7.1 CHINESE GIGAWORD
|
| 156 |
+
|
| 157 |
+
<table><tr><td rowspan=1 colspan=2>Methods</td><td rowspan=1 colspan=1>ROUGE-1</td><td rowspan=1 colspan=1>ROUGE-2</td><td rowspan=1 colspan=1>ROUGE-L</td></tr><tr><td rowspan=1 colspan=2>(A) Trainingwith paired data (supervised)</td><td rowspan=1 colspan=1>48.664</td><td rowspan=1 colspan=1>33.907</td><td rowspan=1 colspan=1>45.685</td></tr><tr><td rowspan=1 colspan=2>(B) Trivial baselines: lead - 15</td><td rowspan=1 colspan=1>30.077</td><td rowspan=1 colspan=1>18.237</td><td rowspan=1 colspan=1>27.736</td></tr><tr><td rowspan=3 colspan=1>(C) Unsupervised</td><td rowspan=1 colspan=1>(C-1) Pretrained generator</td><td rowspan=1 colspan=1>28.122</td><td rowspan=1 colspan=1>16.656</td><td rowspan=1 colspan=1>26.227</td></tr><tr><td rowspan=1 colspan=1>(C-2) WGAN</td><td rowspan=1 colspan=1>37.803</td><td rowspan=1 colspan=1>24.460</td><td rowspan=1 colspan=1>35.116</td></tr><tr><td rowspan=1 colspan=1>(C-3) Adversarial REINFORCE</td><td rowspan=1 colspan=1>40.053</td><td rowspan=1 colspan=1>26.126</td><td rowspan=1 colspan=1>37.118</td></tr></table>
|
| 158 |
+
|
| 159 |
+
Table 1: Results on Chinese Gigaword. In row (B), we select the article’s first fifteen words as its summary. Part (C) are the results obtained without paired data.
|
| 160 |
+
|
| 161 |
+
The Chinese Gigaword corpus is composed of $2 . 2 \mathbf { M }$ paired data of headlines and news. We preprocessed the raw data as following. First, we selected the 4000 most frequent Chinese characters as our vocabulary. We filtered out headline-news pairs with excessively long or short news segments, or that contained too many out-of-vocabulary Chinese characters, yielding 1.1M headline-news pairs from which we randomly selected 5K headline-news pairs as our testing set, 5K headline-news pairs as our validation set, and the remaining pairs as our training set. During training and testing, the generator took only the first 80 Chinese characters of the source text as input.
|
| 162 |
+
|
| 163 |
+
The results are shown in Table 1. Row (A) lists the results using 1.1 million document-summary pairs to directly train the generator without the reconstructor and discriminator: this is the upper bound of the proposed approach. In row (B), we simply took the first fifteen words in a document as its summary. The number of words was chosen to optimize the evaluation metrics. Part (C) are the results obtained in the unsupervised scenario without paired data. We show the results of the pre-trained generator in row (C-1); rows (C-2) and (C-3) are the results for the two GAN training methods respectively. We find that despite the performance gap between the unsupervised and supervised methods (rows (C-2), (C-3) v.s. (A)), the proposed method yielded much better performance than the trivial baselines (rows (C-2), (C-3) v.s. (B)).
|
| 164 |
+
|
| 165 |
+
# 7.2 ENGLISH GIGAWORD
|
| 166 |
+
|
| 167 |
+
On English Gigaword, we set our vocabulary size to 15k, and used the dataset preprocessed by (Rush et al., 2015) for training and testing. We used $3 . 8 \mathbf { M }$ unpaired training data for our training, and we used the whole $2 0 0 \mathrm { k }$ filtered data in validation set for testing.
|
| 168 |
+
|
| 169 |
+
The results on English Gigaword are shown in Table 2. In row (B-1), we simply took the first eight words in a document as its summary. Row (B-2) is another trivial baseline. With unpaired documents and summaries, we matched documents to the most relevant summaries with unsupervised method. Each document and each summary were represented as tf-idf (term frequency $\&$ inverse document frequency) vectors. The summary whose vector maximized cosine similarity of a document vector was retrieved as summary of the document. With paired data from unsupervised matching, given documents as generator input, the generator was trained to predict retrieved summaries.
|
| 170 |
+
|
| 171 |
+
Table 2: Results on English Gigaword: In row (B-1), we select the article’s first eight words as its summary. In row (B-2), we match the documents to their most relevant summaries with unsupervised method. Part (C) are the results obtained without paired data. In part (D), we pre-trained the generator on CNN/Diary. In part (E), we not only pre-trained on CNN/Diary but also used the summaries from CNN/Diary as real data for the discriminator.
|
| 172 |
+
|
| 173 |
+
<table><tr><td rowspan=1 colspan=4>Methods</td><td rowspan=1 colspan=1>ROUGE-1</td><td rowspan=1 colspan=1>ROUGE-2</td><td rowspan=1 colspan=1>ROUGE-L</td></tr><tr><td rowspan=1 colspan=4>(A) Training with paired data (supervised)</td><td rowspan=1 colspan=1>37.469</td><td rowspan=1 colspan=1>16.272</td><td rowspan=1 colspan=1>35.175</td></tr><tr><td rowspan=2 colspan=3>(B) Trivial baselines</td><td rowspan=1 colspan=1>(B-1) Lead-8</td><td rowspan=1 colspan=1>27.663</td><td rowspan=1 colspan=1>10.246</td><td rowspan=1 colspan=1>25.852</td></tr><tr><td rowspan=1 colspan=1>(B-2) Unsupervised matching</td><td rowspan=1 colspan=1>29.900</td><td rowspan=1 colspan=1>10.442</td><td rowspan=1 colspan=1>27.379</td></tr><tr><td rowspan=3 colspan=3>(C) Unsupervised</td><td rowspan=1 colspan=1>(C-1) Pre-trained generator</td><td rowspan=1 colspan=1>21.269</td><td rowspan=1 colspan=1>5.608</td><td rowspan=1 colspan=1>18.896</td></tr><tr><td rowspan=1 colspan=1>(C-2) WGAN</td><td rowspan=1 colspan=1>33.043</td><td rowspan=1 colspan=1>12.222</td><td rowspan=1 colspan=1>30.121</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>(C-3) Adversarial REINFORCE</td><td rowspan=1 colspan=1>32.826</td><td rowspan=1 colspan=1>9.332</td><td rowspan=1 colspan=1>28.727</td></tr><tr><td rowspan=3 colspan=3>(D) Transfer learning(Pre-train)</td><td rowspan=1 colspan=1>ng</td><td rowspan=1 colspan=3>(D-1) Pre-trained generator</td></tr><tr><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>(D-2)WGAN</td><td rowspan=1 colspan=1>32.405</td><td rowspan=1 colspan=1>12.313</td><td rowspan=1 colspan=1>29.689</td></tr><tr><td rowspan=1 colspan=1>(D-3) Adversarial REINFORCE</td><td rowspan=1 colspan=1>31.487</td><td rowspan=1 colspan=1>10.495</td><td rowspan=1 colspan=1>28.248</td></tr><tr><td rowspan=2 colspan=3>(E) Transfer learning(Pre-train+Discriminator)</td><td rowspan=1 colspan=1>(E-1) WGAN</td><td rowspan=1 colspan=1>29.912</td><td rowspan=1 colspan=1>10.695</td><td rowspan=1 colspan=1>27.324</td></tr><tr><td rowspan=1 colspan=1>(E-2) Adversarial REINFORCE</td><td rowspan=1 colspan=1>27.755</td><td rowspan=1 colspan=1>9.280</td><td rowspan=1 colspan=1>24.860</td></tr></table>
|
| 174 |
+
|
| 175 |
+
The results for the pre-trained generator is shown in row (C-1). Compared with the trivial baselines (part (B)), the proposed approach (rows (C-2) and (C-3)) showed good improvement in terms of ROUGE-1. As shown in Fig. 4, the unsupervised method selects key words in the source text and generates the text summary. However, as shown in Table 2, although both unsupervised methods yield ROUGE-1 scores close to that of supervised training, they achieve lower scores on ROUGE-2, especially when training GAN with reinforcement learning. This is because they are extracting the key words from the source text, despite sometimes failing to arrange these words in the correct order. As shown in part (C-3) of Fig. 5, the words in the sentence generated in an unsupervised manner are not arranged correctly: the Italian prime minister, Berlusconi, should not be visiting himself.
|
| 176 |
+
|
| 177 |
+
# 7.3 TRANSFER LEARNING
|
| 178 |
+
|
| 179 |
+
In this subsection, we study transfer learning. We used the CNN/Daily Mail dataset (Hermann et al., 2015; Nallapati et al., 2016) preprocessed by the script provided by (See et al., 2017) as our source domain $S$ , and English Gigaword as our target domain $T$ . The data distributions among the two datasets are quite different. In English Gigaword, the articles consist of 32 words on average and the summaries consist of one sentence with 8 words on average, whereas the CNN/Daily Mail dataset is composed of 790-word articles and multi-sentence summaries. We took only the first 30 to 45 words in the original source domain articles as our new source articles $S _ { a }$ . There are 50K source articles in $S _ { a }$ . The 50K source summaries of the source articles are $S _ { t }$ . In contrast to English Gigaword, the summaries in CNN/Daily Mail dataset are composed of more than one sentence. We split the summary of each article into several sentences, and obtained 240K sentences $S _ { r }$ in this way.
|
| 180 |
+
|
| 181 |
+
Transfer learning was applied in two directions. In the first direction, we pre-trained our generator on the data from the source dataset: we pre-trained the generator with $S _ { a }$ as input, and the generator predicted $S _ { t }$ . We pre-trained the generator in this manner in all of the transfer learning experiments. Then, after pre-training, the generator was further learned jointly with the reconstructor and discriminator on the data from the target domain. The results are shown in part (D) of Table 2. We found that pre-training on the source data set did not degrade performance, and even improved performance in some cases (parts (D) v.s. (C)).
|
| 182 |
+
|
| 183 |
+
In the second direction, we used the summary from the source domain as our real data. The experiments conducted up to this point required unpaired summary and text data in the target domain. In this experiment, the task was more challenging in that we used summaries $S _ { r }$ from the source domain $S$ as the real data for the discriminator; the generator took the target domain text as input. However, the summaries in each summarization task dataset had a different distribution in terms of the writing style, or in terms of the preferred summary words. To prevent overfitting to $S _ { r }$ , we set the weight $\alpha$ to 50 which was larger than other experiments. With small weight of $\alpha$ , as training progressed, the generator summary diverged more and more from the article, and the ROUGE scores became lower and lower.
|
| 184 |
+
|
| 185 |
+
The results without using summaries in the target domain are shown in part (E). We find that using sentences $S _ { r }$ from another dataset yields lower ROUGE scores on the target testing set (parts (E) v.s. (D)) due to the mismatch between the summaries of the source and target domains. However, the discriminator still roughly regularizes the language model of generated word sequence. After training, the model still greatly enhanced the ROUGE score of the pre-trained model (rows (E-1), (E-2) v.s. (D-1)).Although the results in part (E) are comparable with the trivial baselines in part (B), in inspecting the real examples, we found that the results in part (E) were in fact better; this is not reflected in the ROUGE scores. In Fig. 4, the results in part (E) are better than the leading 8 words and the pre-trained generator results. To support this idea, we provide more examples in the Appendix C.
|
| 186 |
+
|
| 187 |
+
Figure 4: Real example from our model in English Gigaword. The proposed method generates summaries that capture the core idea of the article.
|
| 188 |
+
Figure 5: In part (C-3), some words in the summary sentences are arranged in incorrect order.
|
| 189 |
+
|
| 190 |
+
<table><tr><td rowspan=1 colspan=2> Source Text:three stores and markets in beijing 's fengtai district have been forced to shut down andyesterday each was fined ###,### yuan -lrb- ##,### us dollars -rrb- for violating laws andregulations on fire prevention and control .</td></tr><tr><td rowspan=1 colspan=1>Ground Truth: stores markets punished for lack of fire controls</td><td rowspan=1 colspan=1>(A)Supervised Result:beijing 's district stores shut down</td></tr><tr><td rowspan=1 colspan=1>(C-1)Pretrained Generator:and yesterday prevention have been forced to shut down</td><td rowspan=1 colspan=1>(D-1)Pretrained Generator:three stores and markets fined ###,### yuandollars</td></tr><tr><td rowspan=1 colspan=1>(C-2)WGAN:three stores markets in beijing 's district haveforced to shut down yesterday</td><td rowspan=1 colspan=1>(C-3)Adversarial REINFORCE:three stores in beijing forced to shut down forviolating regulations</td></tr><tr><td rowspan=1 colspan=1>(E-1)WGAN :three stores and markets was forced to shutdown</td><td rowspan=1 colspan=1>(E-2)Adversarial REINFORCE:three stores and markets was forced to shutdown and yesterday each was fined</td></tr></table>
|
| 191 |
+
|
| 192 |
+

|
| 193 |
+
|
| 194 |
+
# 7.4 SEMI-SUPERVISED LEARNING
|
| 195 |
+
|
| 196 |
+
In semi-supervised training, generator was pre-trained with few available labeled data, and during unsupervised training, we conducted teacher-forcing with labeled data on generator every several unsupervised updates. In teacher forcing, given source text as input, the generator was teacherforced to predict the human-written summary of source text. Teacher-forcing can be regarded as regularization of unsupervised training that prevents generator from producing unreasonable summaries of source text. We found that if we teacher-forced generator too frequently, generator would overfit on training data since we only use very few labeled data on semi-supervised training.
|
| 197 |
+
|
| 198 |
+
The performance of semi-supervised model in English Gigaword regarding available labeled data is shown in Fig. 6. The horizontal axis is the number of labeled documents used in the experiments, while the vertical axis for Fig. 6 (a) and (b) are ROUGE-1 and ROUGE-2 respectively. The green curve is the results of supervised learning, and the red and blue curves are semi-supervised learning with different approaches. With the same amounts of labeled data, the performances of semi-supervised training are always better than supervised training. With only 100K labeled data, the ROUGE score of semi-supervised training using adversarial REINFORCE even slightly outperformed supervised training with whole labeled data. This shows that with the proposed approach, we need only $2 . 6 \%$ of labeled data to achieve the same performance as before (100K v.s. 3.8M). The complete results for semi-supervised learning in both datasets are shown in Appendix B.
|
| 199 |
+
|
| 200 |
+

|
| 201 |
+
Figure 6: Semi-supervised results in English Gigaword. With the same amount of labeled data, the performances of semi-supervised training are always better than supervised training.
|
| 202 |
+
|
| 203 |
+
# 7.5 GAN TRAINING
|
| 204 |
+
|
| 205 |
+
Table 3: Adversarial REINFORCE with/without self-critic with unsupervised training.
|
| 206 |
+
|
| 207 |
+
<table><tr><td rowspan=1 colspan=1>Corpus</td><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>ROUGE-1</td><td rowspan=1 colspan=1>ROUGE-2</td><td rowspan=1 colspan=1>ROUGE-L</td></tr><tr><td rowspan=2 colspan=1>Chinese</td><td rowspan=1 colspan=1>with self-critic</td><td rowspan=1 colspan=1>40.053</td><td rowspan=1 colspan=1>26.126</td><td rowspan=1 colspan=1>37.118</td></tr><tr><td rowspan=1 colspan=1>without self-critic</td><td rowspan=1 colspan=1>37.549</td><td rowspan=1 colspan=1>24.181</td><td rowspan=1 colspan=1>35.160</td></tr><tr><td rowspan=2 colspan=1>English</td><td rowspan=1 colspan=1>with self-critic</td><td rowspan=1 colspan=1>32.826</td><td rowspan=1 colspan=1>9.332</td><td rowspan=1 colspan=1>28.727</td></tr><tr><td rowspan=1 colspan=1>without self-critic</td><td rowspan=1 colspan=1>31.104</td><td rowspan=1 colspan=1>9.249</td><td rowspan=1 colspan=1>28.592</td></tr></table>
|
| 208 |
+
|
| 209 |
+
The two GAN training methods are not comparable as their settings are quite different, but we can still discuss the advantages and disadvantages of these two methods. When training with feeding output layer to discriminator, convergence is faster. This method sharpens the distribution at an early stage in training because it directly evaluates the distance between the generator’s continuous distribution and the real data’s discrete distribution data. However, this cause generator to converge to a not very good place.
|
| 210 |
+
|
| 211 |
+
In fact, adversarial REINFORCE is sensitive to initialization parameters. Adversarial REINFORCE requires better initialization for exploration; otherwise, with so many actions whose number is equal to vocabulary size to choose, it is extremely difficult to train generator from scratch. In semisupervised training, since we pre-trained generator with labeled data, the generator was better initialized, therefore adversarial REINFORCE performed better. To support this idea, in Fig. 6, we compare the performance of two methods regarding labeled data. The result implies that with more labeled data, our proposed adversarial REINFORCE method performs better. In order to evaluate the performance of proposed self-critic baseline trick mentioned in Section 5.2.2, we compared the performance of our model with and without this baseline trick in Table 3. For the experiments without the self-critic baseline trick, we replaced $s _ { i } - s _ { i - 1 }$ in Section 5.2.2 with $s _ { i }$ . We found that the performance degraded without self-critic.
|
| 212 |
+
|
| 213 |
+
# 8 CONCLUSION AND FUTURE WORK
|
| 214 |
+
|
| 215 |
+
Using GAN, we propose a model that encodes text as a human-readable summary, learned without document-summary pairs. Promising results are obtained on both Chinese and English corpora. In future work, we hope to explore more techniques for natural language generation using GAN. Moreover, we hope to use extra discriminators to control the style and sentiment of the generated summaries.
|
| 216 |
+
|
| 217 |
+
# REFERENCES
|
| 218 |
+
|
| 219 |
+
Martin Arjovsky, Soumith Chintala, and Lon Bottou. Wasserstein gan. arXiv preprint arXiv:1701.07875, 2017.
|
| 220 |
+
|
| 221 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. ICLR, 2015.
|
| 222 |
+
|
| 223 |
+
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.
|
| 224 |
+
|
| 225 |
+
Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial networks. arXiv preprint arXiv:1406.2661, 2014.
|
| 226 |
+
|
| 227 |
+
Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron Courville. Improved training of wasserstein gans. arXiv preprint arXiv:1704.00028, 2017.
|
| 228 |
+
|
| 229 |
+
Di He, Yingce Xia, Tao Qin, Liwei Wang, Nenghai Yu, Tie-Yan Liu, and Wei-Ying Ma. Dual learning for machine translation. NIPS, 2016.
|
| 230 |
+
|
| 231 |
+
Karl Moritz Hermann, Tom Koisk, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa Suleyman, and Phil Blunsom. Teaching machines to read and comprehend. NIPS, 2015.
|
| 232 |
+
|
| 233 |
+
Ryan Kiros, Yukun Zhu, Ruslan Salakhutdinov, Richard S. Zemel, Antonio Torralba, Raquel Urtasun, and Sanja Fidler. Skip-thought vectors. NIPS, 2015.
|
| 234 |
+
|
| 235 |
+
Jiwei Li, Minh-Thang Luong, and Dan Jurafsky. A hierarchical neural autoencoder for paragraphs and documents. ACL, 2015.
|
| 236 |
+
|
| 237 |
+
Jiwei Li, Will Monroe, Tianlin Shi, Sbastien Jean, Alan Ritter, and Dan Jurafsky. Adversarial learning for neural dialogue generation. arXiv preprint arXiv:1701.06547, 2017.
|
| 238 |
+
|
| 239 |
+
Chin-Yew Lin. Rouge: A package for automatic evaluation of summaries. In Text summarization branches out: ACL workshop, 2004.
|
| 240 |
+
|
| 241 |
+
Alireza Makhzani, Jonathon Shlens, Navdeep Jaitly, Ian Goodfellow, and Brendan Frey. Adversarial autoencoders. arXiv preprint arXiv:1511.05644, 2015.
|
| 242 |
+
|
| 243 |
+
Yishu Miao and Phil Blunsom. Language as a latent variable: Discrete generative models for sentence compression. EMNLP, 2016.
|
| 244 |
+
|
| 245 |
+
Ramesh Nallapati, Bowen Zhou, Cicero Nogueira dos santos, Caglar Gulcehre, and Bing Xiang. Abstractive text summarization using sequence-to-sequence rnns and beyond. EMNLP, 2016.
|
| 246 |
+
|
| 247 |
+
Romain Paulus, Caiming Xiong, and Richard Socher. A deep reinforced model for abstractive summarization. arXiv preprint arXiv:1705.04304, 2017.
|
| 248 |
+
|
| 249 |
+
Marc’Aurelio Ranzato, Sumit Chopra, Michael Auli, and Wojciech Zaremba. Sequence level training with recurrent neural networks. ICLR, 2016.
|
| 250 |
+
|
| 251 |
+
Steven J. Rennie, Etienne Marcheret, Youssef Mroueh, Jarret Ross, and Vaibhava Goel. Self-critical sequence training for image captioning. CVPR, 2017.
|
| 252 |
+
|
| 253 |
+
Alexander M. Rush, Sumit Chopra, and Jason Weston. A neural attention model for abstractive sentence summarization. EMNLP, 2015.
|
| 254 |
+
|
| 255 |
+
Abigail See, Peter J. Liu, and Christopher D. Manning. Get to the point: Summarization with pointer-generator networks. ACL, 2017.
|
| 256 |
+
|
| 257 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V. Le. Sequence to sequence learning with neural networks. NIPS, 2014.
|
| 258 |
+
|
| 259 |
+
Zhaopeng Tu, Zhengdong Lu, Yang Liu, Xiaohua Liu, and Hang Li. Modeling coverage for neural machine translation. ACL, 2016.
|
| 260 |
+
|
| 261 |
+
Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer networks. NIPS, 2015.
|
| 262 |
+
|
| 263 |
+
Lantao Yu, Weinan Zhang, Jun Wang, and Yong Yu. Seqgan: Sequence generative adversarial nets with policy gradient. AAAI, 2017.
|
| 264 |
+
|
| 265 |
+
Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A. Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. arXiv preprint arXiv:1703.10593, 2017.
|
| 266 |
+
|
| 267 |
+
# A MODEL PRE-TRAINING
|
| 268 |
+
|
| 269 |
+
As we found that the different pre-training methods for the generator influenced final performance dramatically in all of the experiments, we felt it was important to find a proper unsupervised pretraining method to help the machine grasp semantic meaning. We used the different pre-training strategies described below.
|
| 270 |
+
|
| 271 |
+
• Chinese Gigaword: Given the previous $i - 1$ sentences $s e n t _ { 0 } , s e n t _ { 1 } , . . . , s e n t _ { i - 1 }$ from the source text, the generator predicted the next sentence $s e n t _ { i }$ in the source text as its pretraining target. If more than $50 \%$ of the words in sentence $s e n t _ { i }$ did not appear in the given text, we filtered out this pre-training sample pair. This pre-training method allowed the generator to capture the important semantic meanings of the source text. English Gigaword: As the length of the source texts in English Gigaword dataset is comparatively short, it is difficult to split the last sentence from the source text; hence the previous pre-training method on Chinese Gigaword is not appropriate for this dataset. To properly initialize the set, we randomly selected 6 to 11 consecutive words in the source text, after which we randomly swapped $70 \%$ of the words in the source text. Given text with incorrect word arrangements, the generator predicted the selected words in the correct arrangement. We pre-trained in this way because we expect the generator to initialize with a rough language model. In Chinese Gigaword we also conducted experiments on pre-training in this manner, but the results were not as good as those shown in the part (C) of Table 1. We also used the retrieved paired data in row (B-1) in Table 2 to pre-train generator. However, pre-training generator with this method doesn’t yield results better than those in Table 2.
|
| 272 |
+
|
| 273 |
+
# B SEMI-SUPERVISED LEARNING
|
| 274 |
+
|
| 275 |
+
Semi-supervised learning experiments were conducted with 10K, 50K, 100K labeled data in both datasets. We conducted teacher-forcing on generator every 30, 12, 7 unsupervised updates with 10K, 50K, 100K labeled data respectively. The complete results for semi-supervised learning are shown in Tables 4 and 5.
|
| 276 |
+
|
| 277 |
+
Table 4: Semi-supervised learning in Chinese Gigaword with different amounts of labeled data (10K, 50K, 100K).
|
| 278 |
+
|
| 279 |
+
<table><tr><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>ROUGE-1</td><td rowspan=1 colspan=1>ROUGE-2</td><td rowspan=1 colspan=1>ROUGE-L</td></tr><tr><td rowspan=2 colspan=1>Unsupervised</td><td rowspan=1 colspan=1>WGAN</td><td rowspan=1 colspan=1>37.803</td><td rowspan=1 colspan=1>24.460</td><td rowspan=1 colspan=1>35.116</td></tr><tr><td rowspan=1 colspan=1>Adversarial REINFORCE</td><td rowspan=1 colspan=1>40.053</td><td rowspan=1 colspan=1>26.126</td><td rowspan=1 colspan=1>37.118</td></tr><tr><td rowspan=2 colspan=1>Semi-supervised(10K labeled)</td><td rowspan=1 colspan=1>WGAN</td><td rowspan=1 colspan=1>42.359</td><td rowspan=1 colspan=1>27.192</td><td rowspan=1 colspan=1>38.467</td></tr><tr><td rowspan=1 colspan=1>Adversarial REINFORCE</td><td rowspan=1 colspan=1>43.109</td><td rowspan=1 colspan=1>28.626</td><td rowspan=1 colspan=1>40.202</td></tr><tr><td rowspan=2 colspan=1>Semi-supervised(50K labeled)</td><td rowspan=1 colspan=1>WGAN</td><td rowspan=1 colspan=1>43.989</td><td rowspan=1 colspan=1>29.012</td><td rowspan=1 colspan=1>40.764</td></tr><tr><td rowspan=1 colspan=1>Adversarial REINFORCE</td><td rowspan=1 colspan=1>44.706</td><td rowspan=1 colspan=1>29.872</td><td rowspan=1 colspan=1>41.737</td></tr><tr><td rowspan=2 colspan=1>Semi-supervised(100K labeled)</td><td rowspan=1 colspan=1>WGAN</td><td rowspan=1 colspan=1>45.642</td><td rowspan=1 colspan=1>31.475</td><td rowspan=1 colspan=1>42.711</td></tr><tr><td rowspan=1 colspan=1>Adversarial REINFORCE</td><td rowspan=1 colspan=1>46.216</td><td rowspan=1 colspan=1>31.980</td><td rowspan=1 colspan=1>43.522</td></tr><tr><td rowspan=1 colspan=2>Supervised</td><td rowspan=1 colspan=1>48.664</td><td rowspan=1 colspan=1>33.907</td><td rowspan=1 colspan=1>45.685</td></tr></table>
|
| 280 |
+
|
| 281 |
+
Table 5: Semi-supervised learning in English Gigaword with different amounts of labeled data (10K, 50K, 100K).
|
| 282 |
+
|
| 283 |
+
<table><tr><td rowspan=1 colspan=4></td><td rowspan=1 colspan=1>ROUGE-1</td><td rowspan=1 colspan=1>ROUGE-2</td><td rowspan=1 colspan=1>ROUGE-L</td></tr><tr><td rowspan=2 colspan=3>Unsupervised</td><td rowspan=1 colspan=1>WGAN</td><td rowspan=1 colspan=1>33.043</td><td rowspan=1 colspan=1>12.222</td><td rowspan=1 colspan=1>30.121</td></tr><tr><td rowspan=1 colspan=1>Adversarial REINFORCE</td><td rowspan=1 colspan=1>32.826</td><td rowspan=1 colspan=1>9.332</td><td rowspan=1 colspan=1>28.727</td></tr><tr><td rowspan=2 colspan=3>Semi-supervised(10K labeled)</td><td rowspan=1 colspan=1>WGAN</td><td rowspan=1 colspan=1>34.127</td><td rowspan=1 colspan=1>13.087</td><td rowspan=1 colspan=1>31.451</td></tr><tr><td rowspan=1 colspan=1>led)</td><td rowspan=1 colspan=1>AdversarialREINFORCE</td><td rowspan=1 colspan=1>34.239</td><td rowspan=1 colspan=1>12.570</td><td rowspan=1 colspan=1>31.834</td></tr><tr><td rowspan=1 colspan=2>Semi-supervised</td><td rowspan=1 colspan=1>Semi-supervised</td><td rowspan=1 colspan=1>WGAN</td><td rowspan=1 colspan=1>34.937</td><td rowspan=1 colspan=1>13.838</td><td rowspan=1 colspan=1>32.372</td></tr><tr><td rowspan=1 colspan=3>(50K labeled)</td><td rowspan=1 colspan=1>AdversarialREINFORCE</td><td rowspan=1 colspan=1>35.642</td><td rowspan=1 colspan=1>14.057</td><td rowspan=1 colspan=1>32.983</td></tr><tr><td rowspan=2 colspan=3>Semi-supervised(100K labeled)</td><td rowspan=1 colspan=1>WGAN</td><td rowspan=1 colspan=1>36.615</td><td rowspan=1 colspan=1>15.363</td><td rowspan=1 colspan=1>33.682</td></tr><tr><td rowspan=1 colspan=1>Adversarial REINFORCE</td><td rowspan=1 colspan=1>38.213</td><td rowspan=1 colspan=1>16.279</td><td rowspan=1 colspan=1>35.137</td></tr><tr><td rowspan=1 colspan=4>Supervised</td><td rowspan=1 colspan=1>37.469</td><td rowspan=1 colspan=1>16.272</td><td rowspan=1 colspan=1>35.175</td></tr></table>
|
| 284 |
+
|
| 285 |
+
# C EXAMPLES
|
| 286 |
+
|
| 287 |
+
From Fig. 7 to 12, we show more examples.
|
| 288 |
+
|
| 289 |
+
Figure 7: Real example from our model in English Gigaword. In part (E-2), due to transfer learning, the summary sentence begins with word he, which never appears in the English Gigaword summary sentences.
|
| 290 |
+
|
| 291 |
+
<table><tr><td rowspan=1 colspan=2>Source Text: former zambian president kenneth kaunda appeared in court monday on charges of holding an illegal ally , declaring that he would continue to fight the “ oppressive regime " of presidentfredrick chiluba .</td></tr><tr><td rowspan=1 colspan=1> Ground Truth:former zambian president in court for illegal assembly</td><td rowspan=1 colspan=1>(A)Supervised Result:kaunda to continue to fight chiluba</td></tr><tr><td rowspan=1 colspan=1>(C-1)Pretrained Generator: president kenneth chiluba appeared in courtmonday on charges of</td><td rowspan=1 colspan=1>(D-1)Pretrained Generator:kaunda declaring that he would continue tofight the regime says</td></tr><tr><td rowspan=1 colspan=1>(C-2)WGAN: zambian kenneth kaunda in court charges of holding illegal rally</td><td rowspan=1 colspan=1>(C-3)Adversarial REINFORCE:former zambian president to continue illegalrally fight</td></tr><tr><td rowspan=1 colspan=1>(E-1)WGAN :former zambian president kenneth kaundaappeared in court of illegal rally</td><td rowspan=1 colspan=1>(E-2)Adversarial REINFORCE:he appeared in court he would continue to fight the regime</td></tr></table>
|
| 292 |
+
|
| 293 |
+
<table><tr><td rowspan=1 colspan=2>Source Text:hong kong tourist association -Irb- hkta -rrb- said wednesday it regretted having placed an advertisement thanking sponsors of last week 's lunar new year parade which killed one man andleft ## others injured .</td></tr><tr><td rowspan=1 colspan=1>Ground Truth:hong kong tourist body expresses regret overadvertisement</td><td rowspan=1 colspan=1>(A)Supervised Result:hong kong tourist regrets having placedadvertisement sponsors</td></tr><tr><td rowspan=1 colspan=1>(C-1)Pretrained Generator:hong kong said wednesday it regretted anadvertisement</td><td rowspan=1 colspan=1>(D-1)Pretrained Generator: one man was killed in the head of thesponsors of the said</td></tr><tr><td rowspan=1 colspan=1>(C-2)WGAN: hong kong tourist association regretted havingplaced advertisement sponsors</td><td rowspan=1 colspan=1>(C-3)Adversarial REINFORCE:hong kong tourist killed advertisement sponsors of last year 's lunar parade</td></tr><tr><td rowspan=1 colspan=1>(E-1)WGAN : hong kong tourist association regretted havingplaced an advertisement sponsors</td><td rowspan=1 colspan=1>(E-2)Adversarial REINFORCE: it regretted having placed advertisement sponsors of last week 's lunar new year</td></tr></table>
|
| 294 |
+
|
| 295 |
+
Figure 9: Real example from our model in English Gigaword.
|
| 296 |
+
|
| 297 |
+
<table><tr><td rowspan=1 colspan=2>Source Text:experts from iran and the un nuclear watchdog met thursday in vienna to discuss tehran 's plans toresume atomic fuel research ,an official from the agency said .</td></tr><tr><td rowspan=1 colspan=1>Ground Truth: iranian experts meet with un nuclear watchdog</td><td rowspan=1 colspan=1>(A)Supervised Result: iran un nuclear watchdog discuss tehran</td></tr><tr><td rowspan=1 colspan=1>(C-1)Pretrained Generator:to discuss tehran 's nuclear research watchdog</td><td rowspan=1 colspan=1>(D-1)Pretrained Generator:. official says experts from iran 's president 'swatchdog met</td></tr><tr><td rowspan=1 colspan=1>(C-2)WGAN:experts iran to un nuclear watchdog in vienna</td><td rowspan=1 colspan=1>(C-3)Adversarial REINFORCE: experts discuss un nuclear watchdog plans toresume tehran</td></tr><tr><td rowspan=1 colspan=1>(E-1)WGAN :experts from iran and the un nuclear watchdogmet</td><td rowspan=1 colspan=1>(E-2)Adversarial REINFORCE: experts from iran and the un nuclear watchdogmet</td></tr></table>
|
| 298 |
+
|
| 299 |
+
Figure 10: Real example from our model in English Gigaword.
|
| 300 |
+
|
| 301 |
+
<table><tr><td rowspan=1 colspan=2> Source Text:european shares fell monday, pressured by higher crude prices after oil giant bp said it will shutdown a key production field and on caution before a u.s. interest-rate decision .</td></tr><tr><td rowspan=1 colspan=1>Ground Truth:european stocks end lower</td><td rowspan=1 colspan=1>(A)Supervised Result:european stocks fall on bp decision</td></tr><tr><td rowspan=1 colspan=1>(C-1)Pretrained Generator:prices fell monday after caution on caution</td><td rowspan=1 colspan=1>(D-1)Pretrained Generator:oil giant bp says higher crude prices oncaution</td></tr><tr><td rowspan=1 colspan=1>(C-2)WGAN:european shares shut down higher after oil</td><td rowspan=1 colspan=1>(C-3)Adversarial REINFORCE:european shares shut down after higher oilproduction</td></tr><tr><td rowspan=1 colspan=1>(E-1)WGAN :european shares fell by higher crude prices afteroil</td><td rowspan=1 colspan=1>(E-2)Adversarial REINFORCE:by higher crude prices after oil giant and oncaution before it will shut</td></tr></table>
|
| 302 |
+
|
| 303 |
+
Figure 11: Real example from our model in English Gigaword.
|
| 304 |
+
|
| 305 |
+
<table><tr><td rowspan=1 colspan=2>Source Text: russian foreign minister igor ivanov urged iran to be open about its nuclear programs during a meeting with his iranian counterpart at the united nations , the foreign ministry said tuesday .</td></tr><tr><td rowspan=1 colspan=1>Ground Truth:russian minister urges iran to be open about nuclear programs</td><td rowspan=1 colspan=1>(A)Supervised Result:russian fm urges iran to be open about nuclearprograms</td></tr><tr><td rowspan=1 colspan=1>(C-1)Pretrained Generator: ivanov urged iran to be open its nuclear programs during</td><td rowspan=1 colspan=1>(D-1)Pretrained Generator:russian foreign minister igor ivanov saysmeeting will be open</td></tr><tr><td rowspan=1 colspan=1>(C-2)WGAN:russian igor to be open about nuclear programs during meeting</td><td rowspan=1 colspan=1>(C-3)Adversarial REINFORCE: russian foreign minister to open iran meetingabout its nuclear programs</td></tr><tr><td rowspan=1 colspan=1>(E-1)WGAN :russian foreign minister igor ivanov urged iran tobe open about nuclear programs</td><td rowspan=1 colspan=1>(E-2)Adversarial REINFORCE: new foreign feature urges iran to be open about its nuclear programs</td></tr></table>
|
| 306 |
+
|
| 307 |
+
Figure 12: Real example from our model in English Gigaword.
|
| 308 |
+
|
| 309 |
+
<table><tr><td rowspan=1 colspan=2> Source Text: the bewildering fight between the government and telemarketers over the national do-not-call list took another turn when a second federal agency said it would enforce the program , promising thatconsumers would soon see some reduction in telephone sales pitches .</td></tr><tr><td rowspan=1 colspan=1>Ground Truth: fcc steps in to enforce do-not-callist ; bush signs new law to support program</td><td rowspan=1 colspan=1>(A)Supervised Result:fight against consumers</td></tr><tr><td rowspan=1 colspan=1>(C-1)Pretrained Generator:the second list in telephone sales that wouldenforce</td><td rowspan=1 colspan=1>(D-1)Pretrained Generator:, promising that consumers would enforce turn</td></tr><tr><td rowspan=1 colspan=1>(C-2)WGAN:fight between government over national list took turn</td><td rowspan=1 colspan=1>(C-3)Adversarial REINFORCE:fight between government pitches see anotherreduction</td></tr><tr><td rowspan=1 colspan=1>(E-1)WGAN : the fight between the government and over thenational list took another turn</td><td rowspan=1 colspan=1>(E-2)Adversarial REINFORCE: fight between government and over nationallist took another turn when a second federal</td></tr></table>
|
md/train/rG2ponW2Si/rG2ponW2Si.md
ADDED
|
@@ -0,0 +1,257 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Direct Multi-view Multi-person 3D Pose Estimation
|
| 2 |
+
|
| 3 |
+
Tao Wang1,2∗, Jianfeng Zhang2∗, Yujun $\mathbf { C a i } ^ { 1 }$ , Shuicheng $\mathbf { Y a n } ^ { 1 }$ , Jiashi Feng1,
|
| 4 |
+
|
| 5 |
+
1Sea AI Lab 2National University of Singapore, twangnh@gmail.com, zhangjianfeng@u.nus.edu, {caiyj,yansc,fengjs}@sea.com
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
We present Multi-view Pose transformer (MvP) for estimating multi-person 3D poses from multi-view images. Instead of estimating 3D joint locations from costly volumetric representation or reconstructing the per-person 3D pose from multiple detected 2D poses as in previous methods, MvP directly regresses the multi-person 3D poses in a clean and efficient way, without relying on intermediate tasks. Specifically, MvP represents skeleton joints as learnable query embeddings and let them progressively attend to and reason over the multi-view information from the input images to directly regress the actual 3D joint locations. To improve the accuracy of such a simple pipeline, MvP presents a hierarchical scheme to concisely represent query embeddings of multi-person skeleton joints and introduces an inputdependent query adaptation approach. Further, MvP designs a novel geometrically guided attention mechanism, called projective attention, to more precisely fuse the cross-view information for each joint. MvP also introduces a RayConv operation to integrate the view-dependent camera geometry into the feature representations for augmenting the projective attention. We show experimentally that our MvP model outperforms the state-of-the-art methods on several benchmarks while being much more efficient. Notably, it achieves $9 2 . 3 \%$ $\mathsf { A P } _ { 2 5 }$ on the challenging Panoptic dataset, improving upon the previous best approach [40] by $9 . 8 \%$ . MvP is general and also extendable to recovering human mesh represented by the SMPL model, thus useful for modeling multi-person body shapes. Code and models are available at https://github.com/sail-sg/mvp.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Multi-view multi-person 3D pose estimation aims to localize 3D skeleton joints for each person instance in a scene from multi-view camera inputs. It is a fundamental task that benefits many real-world applications (such as surveillance, sportscast, gaming and mixed reality) and is mainly tackled by reconstruction-based [6, 14, 4] and volumetric [40] approaches in previous literature, as shown in Fig. 1 (a) and (b). The former first estimates 2D poses in each view independently and then aggregates them and reconstructs their 3D counterparts via triangulation or a 3D pictorial structure model. The volumetric approach [40] builds a 3D feature volume through heatmap estimation and 2D-to-3D un-projection at first, based on which instance localization and 3D pose estimation are performed for each person instance individually. Though with notable accuracy, the above paradigms are inefficient due to highly relying on those intermediate tasks. Moreover, they estimate 3D pose for each person separately, making the computation cost grow linearly with the number of persons.
|
| 14 |
+
|
| 15 |
+
Targeted at a more simplified and efficient pipeline, we were wondering if it is possible to directly regress 3D poses from multi-view images without relying on any intermediate task? Though conceptually attractive, adopting such a direct mapping paradigm is highly non-trivial as it remains unclear how to perform skeleton joints detection and association for multiple persons within a single stage. In this work, we address these challenges by developing a novel Multi-view Pose transformer (MvP) model which significantly simplifies the multi-person 3D pose estimation. Specifically, MvP represents each skeleton joint as a learnable positional embedding, named joint query, which is fed into the model and mapped into final 3D pose estimation directly (Fig. 1 (c)), via a specifically designed attention mechanism to fuse multi-view information and globally reason over the joint predictions to assign them to the corresponding person instances. We develop a novel hierarchical query embedding scheme to represent the multi-person joint queries. It shares joint embedding across different persons and introduces person-level query embedding to help the model in learning both person-level and joint-level priors. Benefiting from exploiting the person-joint relation, the model can more accurately localize the 3D joints. Further, we propose to update the joint queries with input-dependent scene-level information (i.e., globally pooled image features from multi-view inputs) such that the learnt joint queries can adapt to the target scene with better generalization performance.
|
| 16 |
+
|
| 17 |
+
To effectively fuse the multi-view information, we propose a geometrically-guided projective attention mechanism. Instead of applying full attention to densely aggregate features across spaces and views, it projects the estimated 3D joint into 2D anchor points for different views, and then selectively fuses the multi-view local features near to these anchors to precisely refine the 3D joint location. we propose to encode the camera rays into the multi-view feature representations via a novel RayConv operation to integrate multi-view positional information into the projective attention. In this way, the strong multi-view geometrical priors can be exploited by projective attention to obtain more accurate 3D pose estimation.
|
| 18 |
+
|
| 19 |
+
Comprehensive experiments on 3D pose benchmarks Panoptic [19], as well as Shelf and Campus [1] demonstrate our MvP works very well. Notably, it obtains $9 2 . 3 \%$ $\mathsf { A P _ { 2 5 } }$ on the challenging Panoptic dataset, improving upon the previous best approach VoxelPose [40] by $9 . 8 \%$ , while achieving nearly $2 \times$ speed up. Moreover, the design ethos of our MvP can be easily extended to more complex tasks—we show that a simple body mesh branch with SMPL representation [28] trained on top of a pre-trained MvP can achieve competitively qualitative results.
|
| 20 |
+
|
| 21 |
+
Our contributions are summarized as follows: 1) We strive for simplicity in addressing the challenging multi-view multi-person 3D pose estimation problem by casting it as a direct regression problem and accordingly develop a novel Multi-view Pose transformer (MvP) model, which achieves state-ofthe-art results on the challenging Panoptic benchmark. 2) Different from query embedding designs in most transformer models, we propose a more tailored and concise hierarchical joint query embedding scheme to enable the model to effectively encode person-joint relation. Additionally, we mitigate the commonly faced generalization issue by a simple query adaptation strategy. 3) We propose a novel projective attention module along with a RayConv operation for fusing multi-view information effectively, which we believe are also inspiring for model designs in other multi-view 3D tasks.
|
| 22 |
+
|
| 23 |
+
# 2 Related Works
|
| 24 |
+
|
| 25 |
+
3D Human Pose Estimation 3D pose estimation from monocular inputs [29, 30, 49, 35, 38, 31, 46, 10, 47] is an ill-posed problem as multiple 3D predictions may result in the same 2D projection. To alleviate such projective ambiguities, multi-view methods have been explored. Research works on single-person scenes use either multi-view geometry [11] for feature fusion [36, 13] and triangulation [16, 37], or pictorial structure models for fast and robust 3D pose reconstruction [34, 36], achieving promising results. However, it is more challenging as we progress towards multi-person scenes. Current approaches mainly exploit a multi-stage pipeline for multi-person tasks, including reconstruction-based [6, 4, 14, 21, 26] and volumetric [40] paradigms. Despite their notable accuracy, these methods suffer expensive computation cost from the intermediate tasks, such as cross-view matching and heatmap back-projection. Moreover, the total computation cost grows linearly with the number of persons in the scene, making them hardly scalable for larger scenes. Different from all previous approaches that rely on a multi-stage pipeline with computation redundancy, our method views multi-person 3D pose estimation as a direct regression problem based on a novel Multi-view Pose transformer model, enables an intermediate task-free single stage solution.
|
| 26 |
+
|
| 27 |
+
Attention and Transformers Driven by the recent success in natural language fields, there have been growing interests in exploring the Transformers for computer vision tasks, such as image recognition [8] and generation [18], as well as more complicated object detection [3, 51] and video instance segmentation [42]. However, multi-person 3D pose estimation has not been explored along this direction. In this study, we propose a novel Multi-view Pose Transformer architecture with a joint query embedding scheme and a projective attention module to regress 3D skeleton joints from multi-view images directly, delivering a simplified and effective pipeline.
|
| 28 |
+
|
| 29 |
+

|
| 30 |
+
Figure 1: Difference between our method and others for multi-view multi-person 3D pose estimation. Existing methods adopt complex multi-stage pipelines that are either (a) reconstruction-based or (b) volumetric representation based, which incur heavy computation burden. (c) Our method solves this task as a direct regression problem without relying on any intermediate task by a novel Multi-view Pose Transformer, and largely simplifies the pipeline and boosts the efficiency.
|
| 31 |
+
|
| 32 |
+
# 3 Multi-view Pose Transformer (MvP)
|
| 33 |
+
|
| 34 |
+
To build a direct multi-person 3D pose estimation framework from multi-view images, we introduce a novel Multi-view Pose transformer (MvP). MvP takes in the multi-view feature representations, and transforms them into groups of 3D joint locations directly (Fig. 2 (a)), delivering multi-person 3D pose results, with the following carefully designed query embedding and attention schemes for detecting and grouping the skeleton joints.
|
| 35 |
+
|
| 36 |
+
# 3.1 Joint Query Embedding Scheme
|
| 37 |
+
|
| 38 |
+
Inspired by transformers [41], MvP represents each skeleton joint as a learnable positional embedding, which is fed into the transformer decoder and mapped into final 3D joint location by jointly attending to other joints and the multi-view information (Fig. 2 (a)). The learnt embeddings encode a prior knowledge about the skeleton joints and we name them as joint queries. MvP develops the following concise query embedding scheme.
|
| 39 |
+
|
| 40 |
+
Hierarchical Query Embeddings The most straightforward way for designing joint query embeddings is to maintain a learnable query vector for each joint per person. However, we empirically find this scheme does not work well, likely because such a naive strategy cannot share the joint-level knowledge between different persons.
|
| 41 |
+
|
| 42 |
+
To tackle this problem, we develop a hierarchical query embedding scheme to explicitly encode the person-joint relation for better generalization to different scenes. The hierarchical embedding offers joint-level information sharing across different persons and reduces the learnable parameters, helping the model to learn useful knowledge from the training data, and thus generalize better. Concretely, instead of using the set of independent joint queries $\mathsf { \bar { \{ q } } _ { m } \} _ { m = 1 } ^ { M } \subset \mathbb { R } ^ { \tilde { C } }$ , we employ a set of person level queries $\{ \breve { \mathbf { h } } _ { n } \} _ { n = 1 } ^ { N } \subset \mathbb { R } ^ { C }$ m m=, and a set of joint level queries $\{ \mathbf { I } _ { j } \} _ { j = 1 } ^ { J } \subset \mathbb { R } ^ { C }$ to represent different persons and different skeleton joints, where denotes the feature dimension, is the number of persons, $J$ is the number of joints per person, and $M = N J$ . Then the query of joint $j$ of person $n$
|
| 43 |
+
|
| 44 |
+

|
| 45 |
+
Figure 2: (a) Overview of the proposed MvP model. Upon the multi-view image features from several convolution layers, it deploys a transformer decoder with a stack of decoder layers to map the input joint queries and the multi-view features to 3D poses directly. (b) The projective attention of MvP projects 3D skeleton joints to anchor points (the green dots) on different views and samples deformable points (the red dots) surrounding these anchors to aggregate local contextual features via learned weights (the brighter color density means larger weights).
|
| 46 |
+
|
| 47 |
+
can be hierarchically formulated as
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\mathbf { q } _ { n } ^ { j } = \mathbf { h } _ { n } + \mathbf { l } _ { j } .
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
With such a hierarchical embedding scheme, the number of learnable query embedding parameters is reduced from $N J C$ to $( N + J ) C$ .
|
| 54 |
+
|
| 55 |
+
Input-dependent Query Adaptation In the above, the learned joint query embeddings are shared for all the input images, independent of their contents, and thus may not generalize well on the novel target data. To address this limitation, we propose to augment the joint queries with input-dependent scene-level information in both model training and deployment, such that the learnt joint queries can be adaptive to the target data and generalize better. Concretely, we augment the above joint queries with a globally pooled feature vector $\mathbf { g } \in \mathbb { R } ^ { C }$ from the multi-view image feature representations:
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
\mathbf { q } _ { n } ^ { j } = \mathbf { g } + \mathbf { h } _ { n } + \mathbf { l } _ { j } .
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
Here $\mathbf { g } = \mathrm { C o n c a t } ( \mathrm { P o o l } ( \mathbf { Z } _ { 1 } ) , \dots , \mathrm { P o o l } ( \mathbf { Z } _ { V } ) ) \mathbf { W } ^ { g }$ , where $\mathbf { Z } _ { v }$ denotes image feature from $v$ -th view and $V$ is the total number of camera views; Concat and Pool denote concatenation and pooling operations, and $\mathbf { W } ^ { g }$ is a learnable linear weight.
|
| 62 |
+
|
| 63 |
+
# 3.2 Projective Attention for Multi-view Feature Fusion
|
| 64 |
+
|
| 65 |
+
It is crucial to aggregate complementary multi-view information to transform the joint embeddings into accurate 3D joint locations. We consider the dot product attention mechanism of transformers [41] to fuse the multi-view image features. However, naively applying such dot product attention densely over all spatial locations and camera views will incur enormous computation cost. Moreover, such dense attention is difficult to optimize and delivers poor performance empirically since it does not exploit any 3D geometric knowledge.
|
| 66 |
+
|
| 67 |
+
Therefore, we propose a geometrically-guided multi-view projective attention scheme, named projective attention. The core idea is to take the 2D projection of the estimated 3D joint location as the anchor point in each view, and only fuse the local features near those projected 2D locations from different views. Motivated by the deformable convolution [5, 50], we adopt an adaptive deformable sampling strategy to gather the localized context information in each camera view, as shown in Fig. 2 (b). Other local attention operations [48, 44, 43] can also be adopted as an alternative. Formally, given joint query feature $\mathbf { q }$ and 3D joint position y, the projective attention is defined as
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\begin{array} { r l r } { \mathrm { P A t t e n t i o n } ( \mathbf { q } , \mathbf { y } , \{ \mathbf { Z } _ { v } \} _ { v = 1 } ^ { V } ) = \mathrm { C o n c a t } ( \mathbf { f } _ { 1 } , \mathbf { f } _ { 2 } , \dots , \mathbf { f } _ { V } ) \mathbf { W } ^ { P } , } & \\ { \mathrm { w h e r e } \ \mathbf { f } _ { v } = \displaystyle \sum _ { k = 1 } ^ { K } \mathbf { a } ( k ) \cdot \mathbf { Z } _ { v } \big ( \Pi ( \mathbf { y } , \mathbf { C } _ { v } ) + \Delta \mathbf { p } ( k ) \big ) \mathbf { W } ^ { f } . } & \end{array}
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
Here the view-specific feature $\mathbf { f } _ { v }$ is obtained by aggregating features from $K$ discrete offsetted sampling points from an anchor point $\mathbf { p } = \Pi ( \mathbf { \bar { y } } , \mathbf { \bar { C } } _ { v } )$ , located by projecting the current 3D joint location $\mathbf { y }$ to 2D, where $\Pi : \mathbb { R } ^ { 3 } \mathbb { R } ^ { 2 }$ denotes perspective projection [11] and $\mathbf { C } _ { v }$ the corresponding camera parameters. $\mathbf { W } ^ { P }$ and $\mathbf { W } ^ { f }$ are learnable linear weights. The attention weight a and the offset to the projected anchor point $\Delta \mathbf { p }$ are estimated from the fusion of query feature $\mathbf { q }$ and the view-dependent feature at the projected anchor point $\mathbf { Z } _ { v } ( \mathbf { p } )$ , i.e., $\mathbf { a } = \mathrm { S o f t m a x } ( ( \mathbf { q } + \mathbf { Z } _ { v } ( \mathbf { p } ) ) \mathbf { W } ^ { a } )$ and $\Delta \mathbf { p } = ( \bar { \mathbf { q } } + \mathbf { Z } _ { v } ( \mathbf { p } ) ) \mathbf { W } ^ { p }$ , where $\mathbf { W } ^ { a }$ and $\mathbf { W } ^ { p }$ are learnable linear weights. If the projected location and the offset are fractional, we use bilinear interpolation to obtain the corresponding feature $\mathbf { Z } _ { v } ( \mathbf { p } )$ or $\mathbf { Z } _ { v } ( \mathbf { p } + \Delta \mathbf { p } ( t ) )$ .
|
| 74 |
+
|
| 75 |
+
The projective attention incorporates two geometrical cues, i.e., the corresponding 2D spatial locations across views from the 3D to 2D projection and the deformed neighborhood of the anchors from the learned offsets to gather view-adaptive contextual information. Unlike naive attention where the query feature densely interacts with the multi-view key features across all the spatial locations, the projective attention is more selective for the interaction between the query and each view—only the features from locations near to the projected anchors are aggregated, and thus is much more efficient.
|
| 76 |
+
|
| 77 |
+
Encoding Multi-view Positional Information with RayConv The positional encoding [41] is an important component of the transformer, which provides positional information of the input sequence. However, a simple per-view 2D positional encoding scheme cannot encode the multi-view geometrical information. To tackle this limitation, we propose to encode the camera ray directions that represent positional information in 3D space into the multi-view feature representations. Concretely, the camera ray direction $\mathbf { R } _ { v }$ , generated with the view-specific camera parameters, is concatenated channel-wisely to the corresponding image feature representation $\mathbf { Z } _ { v }$ . Then a standard convolution is applied to obtain the updated feature representation $\hat { \mathbf { Z } } _ { v }$ , with the view-dependent geometric information:
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\begin{array} { r } { \hat { \bf Z } _ { v } = \mathrm { C o n v } ( \mathrm { C o n c a t } ( { \bf Z } _ { v } , { \bf R } _ { v } ) ) . } \end{array}
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
We name the operation as RayConv. With it, the obtained feature representation $\hat { \mathbf { Z } } _ { v }$ is used for the projective attention by replacing $\mathbf { Z } _ { v }$ in Eqn. (3).
|
| 84 |
+
|
| 85 |
+
Such drop-in replacement introduces negligible computation, while injecting strong multi-view geometrical prior to augment the projective attention scheme, thus helping more precisely predict the refined 3D joint position.
|
| 86 |
+
|
| 87 |
+
# 3.3 Architecture
|
| 88 |
+
|
| 89 |
+
Our overall architecture (Fig. 2 (a)) is pleasantly simple. It adopts a convolution neural network, designed for 2D pose estimation [45], to obtain high-resolution image features $\{ \mathbf { Z } _ { v } \} _ { v = 1 } ^ { V }$ from multiview inputs $\{ \mathbf { I } _ { v } \} _ { v = 1 } ^ { V }$ . The features are then fed into the transformer decoder consisting of multiple decoder layers to predict the 3D joint locations. Each layer conducts a self-attention to perform pair-wise interaction between all the joints from all the persons in the scene; a projective attention to selectively gather the complementary multi-view information; and a feed-forward regression to predict the 3D joint positions and their confidence scores. Specifically, the transformer decoder applies a multi-layer progressive regression scheme, i.e., each decoder layer outputs 3D joint offsets to refine the input 3D joint positions from previous layer.
|
| 90 |
+
|
| 91 |
+
Extending to Body Mesh Recovery MvP learns skeleton joints feature representations and is extendable to recovering human mesh with a parametric body mesh model [28]. Specifically, after average pooling on the joint features into per-person feature, a feed-forward network is used to predict the corresponding body mesh represented by the parametric SMPL model [28]. Similar to the joint location prediction, the SMPL parameters follow multi-layer progressive regression scheme.
|
| 92 |
+
|
| 93 |
+
# 3.4 Training
|
| 94 |
+
|
| 95 |
+
MvP infers a fixed set of $M$ joint locations for $N$ different persons, where $M = N J$ . The main training challenge is how to associate the skeleton joints correctly for different person instances. Unlike the post-hoc grouping of detected skeleton joints as in bottom-up pose estimation methods [32, 24], MvP learns to directly predict the multi-joint 3D human pose in a group-wise fashion as shown in Fig. 2 (a). This is achieved by a grouped matching strategy during model training.
|
| 96 |
+
|
| 97 |
+
Groupscores ing Given the predicted joint, we group every consecutive ositions -joint p $\{ \mathbf { y } _ { m } \} _ { m = 1 } ^ { M } \subset \mathbb { R } ^ { 3 }$ and associated confidenceer-person pose estimation $\lbrace s _ { m } \rbrace _ { m = 1 } ^ { M }$ $J$
|
| 98 |
+
|
| 99 |
+
$\{ \mathbf { Y } _ { n } \} _ { n = 1 } ^ { N } \subset \mathbb { R } ^ { J \times 3 } .$ , and average their corresponding confidence scores to obtain the per-person confidence scores $\{ p _ { n } \} _ { n = 1 } ^ { N }$ . The same grouping strategy is used during inference.
|
| 100 |
+
|
| 101 |
+
The ground truth set $\mathbf { Y } ^ { * }$ of 3D poses of different person instances is smaller than the prediction set of size $N$ , which is padded to size $N$ with empty element $\mathcal { D }$ . Then we find a bipartite matching between the prediction set and the ground truth set by searching for a permutation of $\hat { \sigma } \in \aleph _ { N }$ that achieves the lowest matching cost:
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\hat { \sigma } = \underset { \sigma \in \aleph _ { N } } { \arg \operatorname* { m i n } } \sum _ { n = 1 } ^ { N } \mathcal { L } _ { \mathrm { m a t c h } } \big ( \mathbf { Y } _ { n } ^ { * } , \mathbf { Y } _ { \sigma ( n ) } \big ) .
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
We consider both the regressed 3D joint position and confidence score for the matching cost:
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
\mathcal { L } _ { \mathrm { m a t c h } } ( { \mathbf { Y } _ { n } ^ { * } } , { \mathbf { Y } _ { \sigma ( n ) } } ) = - p _ { i } + \mathcal { L } _ { 1 } ( { \mathbf { Y } _ { n } ^ { * } } , { \mathbf { Y } _ { \sigma ( n ) } } )
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
where $\mathbf { Y } _ { n } ^ { * } \neq \emptyset$ , and $\mathcal { L } _ { 1 }$ computes the $L _ { 1 }$ loss error. Following [3, 39], we employ the Hungarian algorithm [25] to compute the optimal assignment $\hat { \sigma }$ with the above matching cost.
|
| 114 |
+
|
| 115 |
+
Objective Function We compute the Hungarian loss with the obtained optimal assignment $\hat { \sigma }$ :
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
\mathcal { L } _ { \mathrm { H u n g a r i a n } } ( \mathbf { Y } ^ { * } , \mathbf { Y } ) = \sum _ { n = 1 } ^ { N } \left[ \mathcal { L } _ { \mathrm { c o n f } } ( \mathbf { Y } _ { n } ^ { * } , p _ { \hat { \sigma } ( n ) } ) + \mathbb { 1 } _ { \{ \mathbf { Y } _ { n } ^ { * } \neq \hat { \sigma } \} } \lambda \mathcal { L } _ { \mathrm { p o s e } } ( \mathbf { Y } _ { n } ^ { * } , \mathbf { Y } _ { \hat { \sigma } ( n ) } ) \right] .
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
Here ${ \mathcal { L } } _ { \mathrm { c o n f } }$ and $\mathcal { L } _ { \mathrm { p o s e } }$ are losses for confidence score and pose regression, respectively. $\lambda$ balances the two loss terms. We use focal loss [27] for confidence prediction which adaptively balances the positive and negative samples. For pose regression, we compute $L _ { 1 }$ loss for 3D joints and their projected 2D joints in different views.
|
| 122 |
+
|
| 123 |
+
To learn multi-laylayer. The total l progresss is thus $\begin{array} { r } { \mathcal { L } _ { \mathrm { t o t a l } } = \sum _ { l = 1 } ^ { L } \mathcal { L } _ { \mathrm { H u n g a r i a n } } ^ { l } } \end{array}$ tching a, where $\mathcal { L } _ { \mathrm { H u n g a r i a n } } ^ { l }$ applied for each decdenotes loss of the $l$ der-th $L$ is the number of decoder layers. When extending MvP to body mesh recovery, we apply $L _ { 1 }$ loss for 3D joints from the SMPL model and their 2D projections, as well as an adversarial loss following HMR [22, 17, 47] due to lack of GT SMPL parameters.
|
| 124 |
+
|
| 125 |
+
# 4 Experiments
|
| 126 |
+
|
| 127 |
+
In this section, we aim to answer following questions. 1) Can MvP provide both efficient and accurate multi-person 3D pose estimation? 2) How does the proposed attention mechanism help multi-view multi-person skeleton joints information fusing? 3) How does each individual design choice affect model performance? To this end, we conduct extensive experiments on several benchmark datasets.
|
| 128 |
+
|
| 129 |
+
Datasets Panoptic [20] is a large-scale benchmark with 3D skeleton joint annotations. It captures daily social activities in an indoor environment. We conduct extensive experiments on Panoptic to evaluate and analyze our approach. Following VoxelPose [40], we use the same data sequences except ‘160906_band3’ in the training set due to broken images. Unless otherwise stated, we use five HD cameras (3, 6, 12, 13, 23) in our experiments. All results reported in the experiments follow the same data setup. We use Average Precision (AP) and Recall [40], as well as Mean Per Joint Position Error (MPJPE) as evaluation metrics. Shelf and Campus [1] are two multi-person datasets capturing indoor and outdoor environments, respectively. We split them into training and testing sets following [1, 6, 40]. We report Percentage of Correct Parts (PCP) for these two datasets.
|
| 130 |
+
|
| 131 |
+
Implementation Details Following VoxelPose [40], we adopt a pose estimation model [45] build upon ResNet-50 [12] for multi-view image features extraction. Unless otherwise stated, we use a stack of six transformer decoder layers. The model is trained for 40 epochs, with the Adam optimizer of learning rate $1 0 ^ { - 4 }$ . During inference, a confidence threshold of 0.1 is used to filter out redundant predictions. Please refer to supplementary for more implementation details.
|
| 132 |
+
|
| 133 |
+
Table 1: Result on the Panoptic dataset. MvP is more accurate and faster than VoxelPose.
|
| 134 |
+
|
| 135 |
+
<table><tr><td>Methods</td><td>AP25</td><td>AP50</td><td>AP100</td><td>AP150</td><td>Recall@500</td><td>MPJPE[mm]</td><td>Time[ms]</td></tr><tr><td>VoxelPose 40]</td><td>84.0</td><td>96.4</td><td>97.5</td><td>97.8</td><td>98.1</td><td>17.8</td><td>320</td></tr><tr><td>MvP (Ours)</td><td>92.3</td><td>96.6</td><td>97.5</td><td>97.7</td><td>98.2</td><td>15.8</td><td>170</td></tr></table>
|
| 136 |
+
|
| 137 |
+
# 4.1 Main Results
|
| 138 |
+
|
| 139 |
+
Panoptic We first evaluate our MvP model on the challenging Panoptic dataset and compare it with the state-of-the-art VoxelPose model [40]. As shown in Table 1, Our MvP achieves 92.3 $\mathsf { A P _ { 2 5 } }$ , improving upon VoxelPose by $9 . 8 \%$ , and achieves much lower MPJPE (15.8 v.s 17.8). Moreover, MvP only requires $1 7 0 \mathrm { m s }$ to process a multi-view input, about $2 \times$ faster than Voxel$\mathrm { P o s e } ^ { \mathrm { ? } }$ . These results demonstrate both accuracy and efficiency advantages of MvP from estimating 3D poses of multiple persons in a direct regression paradigm. To further demonstrate efficiency of MvP, we compare its inference time with VoxelPose’s when processing different numbers of person instances. As shown in Fig. 3, the inference time of VoxelPose grows linearly with the number of persons in the scene due to the per-person regression paradigm. In
|
| 140 |
+
|
| 141 |
+

|
| 142 |
+
Figure 3: Inference time versus the number of person instances. Benefiting from its direct inference framework, MvP maintains almost constant inference time regardless of the number of persons.
|
| 143 |
+
|
| 144 |
+
contrast, MvP keeps constant inference time no matter how many instances in the scene. Notably, it takes only $1 8 5 \mathrm { m s }$ for MvP to process scenes even with 100 person instances (the blue line), demonstrating its great potential to handle crowded scenarios.
|
| 145 |
+
|
| 146 |
+
Shelf and Campus We further compare our MvP with state-of-the-art approaches on the Shelf and Campus datasets. The reconstruction-based methods [2, 9, 6] use 3D pictorial model [2, 6] or conditional random field [9] within a multi-stage paradigm; and the volumetric approach VoxelPose [40] highly relies on computationally intensive intermediate tasks. As shown in Table 2, our MvP achieves the best performance in all the actors on the Shelf dataset. Moreover, it obtains a comparable result on the Campus dataset as VoxelPose [40] without relying on any intermediate task. These results further confirm the effectiveness of MvP for estimating 3D poses of multiple persons directly.
|
| 147 |
+
|
| 148 |
+
Table 2: Results (in PCP) on Shelf and Campus datasets.
|
| 149 |
+
|
| 150 |
+
<table><tr><td rowspan="2">Methods</td><td colspan="4">Shelf</td><td colspan="4">Campus</td></tr><tr><td>Actor 1</td><td>Actor 2</td><td>Actor3</td><td>Average</td><td>Actor 1</td><td>Actor 2</td><td>Actor3 Average</td><td></td></tr><tr><td>Belagiannis et al. [2]</td><td>75.3</td><td>69.7</td><td>87.6</td><td>77.5</td><td>93.5</td><td>75.7</td><td>84.4</td><td>84.5</td></tr><tr><td>Ershadi et al. [9]</td><td>93.3</td><td>75.9</td><td>94.8</td><td>88.0</td><td>94.2</td><td>92.9</td><td>84.6</td><td>90.6</td></tr><tr><td>Dong et al. [6]</td><td>98.8</td><td>94.1</td><td>97.8</td><td>96.9</td><td>97.6</td><td>93.3</td><td>98.0</td><td>96.3</td></tr><tr><td>VoxelPose 40]</td><td>99.3</td><td>94.1</td><td>97.6</td><td>97.0</td><td>97.6</td><td>93.8</td><td>98.8</td><td>96.7</td></tr><tr><td>MvP (Ours)</td><td>99.3</td><td>95.1</td><td>97.8</td><td>97.4</td><td>98.2</td><td>94.1</td><td>97.4</td><td>96.6</td></tr></table>
|
| 151 |
+
|
| 152 |
+
# 4.2 Visualization
|
| 153 |
+
|
| 154 |
+
3D Pose and Body Mesh Estimation We visualize some 3D pose estimations of MvP on the challenging Panoptic dataset in Fig. 4. It can be observed that MvP is robust to large pose deformation (the 1st example) and severe occlusion (the 2nd example), and can achieve geometrically plausible results w.r.t. different viewpoints (the rightmost column). Moreover, MvP is extendable to body mesh recovery and can achieve fairly good reconstruction results (the 2nd and 4th rows). All these results verify both effectiveness and extendability of MvP. Please see supplementary for more examples.
|
| 155 |
+
|
| 156 |
+

|
| 157 |
+
Figure 4: Example 3D pose estimations from Panoptic dataset. The left four columns show the multi-view inputs and the corresponding body mesh estimations. The rightmost column shows the estimated 3D poses from two different viewpoints. Best viewed in color.
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 5: Visualization of projetive attention and self-attention on example skeleton joints. The attention weights are obtained with the 4-th decoder layer of a trained model. Projective attention (in the cropped image triplets): the green points denote the projected anchor points in each camera view, and the red points denote the offsetted spatial locations, with brighter color for stronger attention. Self-attention (in the 3D skeleton plots): example skeleton joint (green) to all the other skeleton joints (red) in the scene. The color density indicates attention weight. Best viewed in color and $2 \times$ zoom.
|
| 161 |
+
|
| 162 |
+
Attention Mechanism We visualize the projective attention and the self-attention in Fig. 5. Benefiting from the 3D-to-2D projection, the projective attention can accurately locate the skeleton joint in each camera view (the green point) based on the current estimated 3D joint location. We observe it learns to gather adaptive local context information (the red points) with the deformable sampling operation. For instance, when regressing the 3D position of mid-hip (the 1st example), the projective attention selectively attends to informative joints such as the left and right hips as well as thorax, which offers sufficient contextual information for accurate estimation. We also visualize the self-attention, which learns pair-wise interaction between all the skeleton joints in the scene. From the 3D plot in Fig. 5, we can observe a certain skeleton joint mainly attends to other joints of the same person instance (more opaque). It also attends to joints from other person instances, but with less attention (more transparent). This phenomenon is reasonable as the skeleton joints of a human body are strongly correlated to each other, e.g., with certain pose priors and bone length.
|
| 163 |
+
|
| 164 |
+
# 4.3 Ablation
|
| 165 |
+
|
| 166 |
+
Importance of RayConv MvP introduces RayConv to encode multi-view geometric information, i.e., camera ray directions into image feature representations. As shown in Table 3a, if removing RayConv, the performance drops significantly—4.8 decrease in $\mathsf { A P _ { 2 5 } }$ and 1.6 increase in MPJPE. This indicates the multi-view geometrical information is important for the model to more precisely localize the skeleton joints in 3D space. Without RayConv, the transformer decoder cannot accurately capture positional information in 3D space, resulting in performance drop.
|
| 167 |
+
|
| 168 |
+
<table><tr><td colspan="3">RConv AP25 AP100 MPJPE</td></tr><tr><td>w/</td><td>92.3 97.5</td><td>15.8</td></tr><tr><td>w/o</td><td>87.5 96.2</td><td>17.4</td></tr></table>
|
| 169 |
+
|
| 170 |
+
(a) The effect of RayConv. w/o means removing RayConv.
|
| 171 |
+
|
| 172 |
+
<table><tr><td>Query</td><td colspan="3">AP25 AP100 MPJPE</td></tr><tr><td>Per-joint</td><td>67.4</td><td>84.7</td><td>41.2</td></tr><tr><td>Hier.</td><td>82.5</td><td>93.2</td><td>19.5</td></tr><tr><td>Hier.+ad.</td><td>92.3</td><td>97.5</td><td>15.8</td></tr></table>
|
| 173 |
+
|
| 174 |
+
(b) Different joint query embedding schemes.
|
| 175 |
+
|
| 176 |
+
Table 3: Ablations on Panoptic. In (b), Hier. denotes the hierarchical query embedding scheme, Hier.+ad. means further adding the adaptation strategy. Please see supplement for more ablations.
|
| 177 |
+
|
| 178 |
+
<table><tr><td colspan="3">Thr. AP25 AP100 MPJPE</td></tr><tr><td>0.0</td><td>93.1</td><td>98.5 16.3</td></tr><tr><td>0.1</td><td>92.3 97.5</td><td>15.8</td></tr><tr><td>0.2</td><td>91.1 96.2</td><td>15.5</td></tr><tr><td>0.4</td><td>89.2 93.7</td><td>15.0</td></tr></table>
|
| 179 |
+
|
| 180 |
+
(c) Different confidence threshold during evaluation.
|
| 181 |
+
|
| 182 |
+
<table><tr><td>Dec.</td><td>AP25 AP100</td><td>MPJPE</td></tr><tr><td>2</td><td>6.3</td><td>92.5 49.6</td></tr><tr><td>3</td><td>63.4</td><td>95.6 22.8</td></tr><tr><td>4</td><td>86.8</td><td>96.8 17.5</td></tr><tr><td>5</td><td>91.8</td><td>97.6 16.2</td></tr><tr><td>6</td><td>92.3</td><td>97.5 15.8</td></tr><tr><td>7</td><td>92.0</td><td>97.5 15.9</td></tr></table>
|
| 183 |
+
|
| 184 |
+
(d) Number of decoder layers.
|
| 185 |
+
|
| 186 |
+
<table><tr><td></td><td>Cam.AP25 AP100</td><td>MPJPE</td></tr><tr><td>1</td><td>4.7</td><td>61.0 93.8</td></tr><tr><td>2</td><td>37.7</td><td>93.0 34.8</td></tr><tr><td>3</td><td>71.8</td><td>95.1 21.1</td></tr><tr><td>4</td><td>84.1</td><td>96.7 19.3</td></tr><tr><td>5</td><td>92.3</td><td>97.5 15.8</td></tr></table>
|
| 187 |
+
|
| 188 |
+
(e) Number of camera views.
|
| 189 |
+
|
| 190 |
+
<table><tr><td colspan="2">KAP25 AP100</td><td>MPJPE</td></tr><tr><td>1</td><td>88.6</td><td>96.3 18.2</td></tr><tr><td>2</td><td>89.3</td><td>97.5 17.4</td></tr><tr><td>4</td><td>92.3</td><td>97.7 15.8</td></tr><tr><td>8</td><td>84.4</td><td>91.1 20.3</td></tr></table>
|
| 191 |
+
|
| 192 |
+
(f) Number of deformable points $K$ .
|
| 193 |
+
|
| 194 |
+
Importance of Hierarchical Query Embedding As shown in Table 3b, compared with the straightforward and unstructured per-joint query embedding scheme, the proposed hierarchical query embedding boosts the performance sharply—14.1 increase in $\mathrm { { A P _ { 2 5 } } }$ and 23.4 decrease in MPJPE. Its advantageous performance clearly verifies introducing the person-level queries to collaborate with the joint-level queries can better exploit human body structural information and improve model to better localize the joints. Upon the hierarchical query embedding scheme, adding the query adaptation strategy further improves the performance significantly, reaching $\mathsf { A P } _ { 2 5 }$ of 92.3 and MPJPE of 15.8. This shows the proposed approach effectively adapts the query embeddings to the target scene and such adaptation is indeed beneficial for the generalization of MvP to novel scenes.
|
| 195 |
+
|
| 196 |
+
Different Model Designs We also examine effects of varying the following designs of the MvP model to gain better understanding on them.
|
| 197 |
+
|
| 198 |
+
Confidence Threshold During inference, a confidence threshold is used to to filter out the lowconfidence and erroneous pose predictions, and obtain the final result. Adopting a higher confidence will select the predictions in a more restrictive way. As shown in Table 3c, a higher confidence threshold brings lower MPJPE as it selects more accurate predictions; but it also filters out some true positive predictions and thus reduces the average precision.
|
| 199 |
+
|
| 200 |
+
Number of Decoder Layers Decoder layers are used for refining the pose estimation. Stacking more decoder layers thus gives better performance (Table 3d). For instance, the MPJPE is as high as 49.6 when using only two decoder layers, but it is significantly reduced to 22.8 when using three decoder layers. This clearly justifies the progressive refinement strategy of our MvP model is effective. However the benefit of using more decoder layers diminishes when the number of layers is large enough, implying the model has reached the ceiling of its model capacity.
|
| 201 |
+
|
| 202 |
+
Number of Camera Views Multi-view inputs provide complementary information to each other which is extremely useful when handling some challenging environment factors in 3D pose estimation like occlusions. We vary the number of camera views to examine whether MvP can effectively fuse and leverage multi-view information to continuously improve the pose estimation quality (Table 3e). As expected, with more camera views, the 3D pose estimation accuracy monotonically increases, demonstrating the capacity of MvP in fusing multi-view information.
|
| 203 |
+
|
| 204 |
+
Number of Deformable Sampling Points Table 3f shows the effect of the number of deformable sampling points $K$ used in the projective attention. With only one deformable point, MvP already achieves a respectable result, i.e., 88.6 in $\mathsf { A P _ { 2 5 } }$ and 17.4 in MPJPE. Using more sampling points further improves the performance, demonstrating the projective attention is effective at aggregating information from the useful locations. When $K = 4$ , the model gives the best result. Further increasing $K$ to 8, the performance starts to drop. It is likely because using too many deformable points introduces redundant information and thus makes the model more difficult to optimize.
|
| 205 |
+
|
| 206 |
+
# 5 Conclusion
|
| 207 |
+
|
| 208 |
+
We introduced a direct and efficient model, named Multi-view Pose transformer (MvP), to address the challenging multi-view multi-person 3D human pose estimation problem. Different from existing methods relying on tedious intermediate tasks, MvP substantially simplifies the pipeline into a direct regression one by carefully designing the transformer-alike model architecture with a novel hierarchical joint query embedding scheme and projective attention mechanism. We conducted extensive experiments to verify its superior performance and speed over the well-established baselines.
|
| 209 |
+
|
| 210 |
+
We empirically found MvP needs sufficient data for model training since it learns the 3D geometry implicitly. In the future, we will study how to enhance the data-efficiency of MvP by leveraging the strategy like self-supervised pre-training or exploring more advanced approaches. Similar to prior works, we also found MvP suffers from performance drop for cross-camera generalization, that is, generalizing on novel camera views. We will explore approaches like disentangling camera parameters and multi-view feature learning to improve this aspect. Besides, we will explore the large-scale applications of MvP and further extend it to other relevant tasks. Thanks to its efficiency, MvP would be scalable to handle very crowded scenes with many persons. Moreover, the framework of MvP is general and thus extensible to other 3D modeling tasks like dense mesh recovery of common objects.
|
| 211 |
+
|
| 212 |
+
# References
|
| 213 |
+
|
| 214 |
+
[1] Vasileios Belagiannis, Sikandar Amin, Mykhaylo Andriluka, Bernt Schiele, Nassir Navab, and Slobodan Ilic. 3d pictorial structures for multiple human pose estimation. In CVPR, 2014. [2] Vasileios Belagiannis, Sikandar Amin, Mykhaylo Andriluka, Bernt Schiele, Nassir Navab, and Slobodan Ilic. 3d pictorial structures revisited: Multiple human pose estimation. IEEE transactions on pattern analysis and machine intelligence, 38(10):1929–1942, 2015. [3] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In ECCV, 2020. [4] He Chen, Pengfei Guo, Pengfei Li, Gim Hee Lee, and Gregory Chirikjian. Multi-person 3d pose estimation in crowded scenes based on multi-view geometry. In ECCV, 2020. [5] Jifeng Dai, Haozhi Qi, Yuwen Xiong, Yi Li, Guodong Zhang, Han Hu, and Yichen Wei. Deformable convolutional networks. In ICCV, 2017.
|
| 215 |
+
[6] Junting Dong, Wen Jiang, Qixing Huang, Hujun Bao, and Xiaowei Zhou. Fast and robust multi-person 3d pose estimation from multiple views. In CVPR, 2019. [7] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv, 2020. [8] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv, 2020. [9] Sara Ershadi-Nasab, Erfan Noury, Shohreh Kasaei, and Esmaeil Sanaei. Multiple human 3d pose estimation from multiview images. Multimedia Tools and Applications, 77(12):15573–15601, 2018.
|
| 216 |
+
[10] Kehong Gong, Jianfeng Zhang, and Jiashi Feng. Poseaug: A differentiable pose augmentation framework for 3d human pose estimation. In CVPR, 2021.
|
| 217 |
+
[11] Richard Hartley and Andrew Zisserman. Multiple View Geometry in Computer Vision. Cambridge University Press, New York, NY, USA, 2 edition, 2003.
|
| 218 |
+
[12] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 219 |
+
[13] Yihui He, Rui Yan, Katerina Fragkiadaki, and Shoou-I Yu. Epipolar transformers. In CVPR, 2020.
|
| 220 |
+
[14] Congzhentao Huang, Shuai Jiang, Yang Li, Ziyue Zhang, Jason Traish, Chen Deng, Sam Ferguson, and Richard Yi Da Xu. End-to-end dynamic matching network for multi-view multi-person 3d pose estimation. In ECCV, 2020.
|
| 221 |
+
[15] Catalin Ionescu, Dragos Papava, Vlad Olaru, and Cristian Sminchisescu. Human3. 6m: Large scale datasets and predictive methods for 3d human sensing in natural environments. IEEE Trans. on Pattern Analysis and Machine Intelligence, 36(7):1325–1339, 2014.
|
| 222 |
+
[16] Karim Iskakov, Egor Burkov, Victor Lempitsky, and Yury Malkov. Learnable triangulation of human pose. In ICCV, 2019.
|
| 223 |
+
[17] Wen Jiang, Nikos Kolotouros, Georgios Pavlakos, Xiaowei Zhou, and Kostas Daniilidis. Coherent reconstruction of multiple humans from a single image. In CVPR, 2020.
|
| 224 |
+
[18] Yifan Jiang, Shiyu Chang, and Zhangyang Wang. Transgan: Two transformers can make one strong gan. arXiv, 2021.
|
| 225 |
+
[19] Hanbyul Joo, Hao Liu, Lei Tan, Lin Gui, Bart Nabbe, Iain Matthews, Takeo Kanade, Shohei Nobuhara, and Yaser Sheikh. Panoptic studio: A massively multiview system for social motion capture. In ICCV, 2015.
|
| 226 |
+
[20] Hanbyul Joo, Tomas Simon, Xulong Li, Hao Liu, Lei Tan, Lin Gui, Sean Banerjee, Timothy Godisart, Bart Nabbe, Iain Matthews, et al. Panoptic studio: A massively multiview system for social interaction capture. IEEE transactions on pattern analysis and machine intelligence, 41(1):190–204, 2017.
|
| 227 |
+
[21] Abdolrahim Kadkhodamohammadi and Nicolas Padoy. A generalizable approach for multi-view 3d human pose regression. Machine Vision and Applications, 32(1):1–14, 2021.
|
| 228 |
+
[22] Angjoo Kanazawa, Michael J. Black, David W. Jacobs, and Jitendra Malik. End-to-end recovery of human shape and pose. In CVPR, 2018.
|
| 229 |
+
[23] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICCV, 2015.
|
| 230 |
+
[24] Sven Kreiss, Lorenzo Bertoni, and Alexandre Alahi. Pifpaf: Composite fields for human pose estimation. In CVPR, 2019.
|
| 231 |
+
[25] Harold W Kuhn. The hungarian method for the assignment problem. Naval research logistics quarterly, 2(1-2):83–97, 1955.
|
| 232 |
+
[26] Jiahao Lin and Gim Hee Lee. Multi-view multi-person 3d pose estimation with plane sweep stereo. In CVPR, 2021.
|
| 233 |
+
[27] Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dollár. Focal loss for dense object detection. In ICCV, 2017.
|
| 234 |
+
[28] Matthew Loper, Naureen Mahmood, Javier Romero, Gerard Pons-Moll, and Michael J Black. Smpl: A skinned multi-person linear model. ACM transactions on graphics (TOG), 34(6):1–16, 2015.
|
| 235 |
+
[29] Julieta Martinez, Rayat Hossain, Javier Romero, and James J Little. A simple yet effective baseline for 3d human pose estimation. In ICCV, 2017.
|
| 236 |
+
[30] Dushyant Mehta, Srinath Sridhar, Oleksandr Sotnychenko, Helge Rhodin, Mohammad Shafiei, Hans-Peter Seidel, Weipeng Xu, Dan Casas, and Christian Theobalt. Vnect: Real-time 3d human pose estimation with a single rgb camera. ACM Trans. on Graphics, 36(4):44, 2017.
|
| 237 |
+
[31] Xuecheng Nie, Jianfeng Zhang, Shuicheng Yan, and Jiashi Feng. Single-stage multi-person pose machines. In ICCV, 2019.
|
| 238 |
+
[32] George Papandreou, Tyler Zhu, Liang-Chieh Chen, Spyros Gidaris, Jonathan Tompson, and Kevin Murphy. Personlab: Person pose estimation and instance segmentation with a bottom-up, part-based, geometric embedding model. In ECCV, 2018.
|
| 239 |
+
[33] 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 NeurIPSw, 2017.
|
| 240 |
+
[34] Georgios Pavlakos, Xiaowei Zhou, Konstantinos G Derpanis, and Kostas Daniilidis. Harvesting multiple views for marker-less 3d human pose annotations. In CVPR, 2017.
|
| 241 |
+
[35] Alin-Ionut Popa, Mihai Zanfir, and Cristian Sminchisescu. Deep multitask architecture for integrated 2d and 3d human sensing. In CVPR, 2017.
|
| 242 |
+
[36] Haibo Qiu, Chunyu Wang, Jingdong Wang, Naiyan Wang, and Wenjun Zeng. Cross view fusion for 3d human pose estimation. In ICCV, 2019.
|
| 243 |
+
[37] Edoardo Remelli, Shangchen Han, Sina Honari, Pascal Fua, and Robert Wang. Lightweight multi-view 3d pose estimation through camera-disentangled representation. In CVPR, 2020.
|
| 244 |
+
[38] Xiao Sun, Bin Xiao, Fangyin Wei, Shuang Liang, and Yichen Wei. Integral human pose regression. In ECCV, 2018.
|
| 245 |
+
[39] Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. arXiv, 2014.
|
| 246 |
+
[40] Hanyue Tu, Chunyu Wang, and Wenjun Zeng. Voxelpose: Towards multi-camera 3d human pose estimation in wild environment. In ECCV, 2020.
|
| 247 |
+
[41] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. arXiv, 2017.
|
| 248 |
+
[42] Yuqing Wang, Zhaoliang Xu, Xinlong Wang, Chunhua Shen, Baoshan Cheng, Hao Shen, and Huaxia Xia. End-to-end video instance segmentation with transformers. arXiv, 2020.
|
| 249 |
+
[43] Felix Wu, Angela Fan, Alexei Baevski, Yann N Dauphin, and Michael Auli. Pay less attention with lightweight and dynamic convolutions. arXiv, 2019.
|
| 250 |
+
[44] Zhanghao Wu, Zhijian Liu, Ji Lin, Yujun Lin, and Song Han. Lite transformer with long-short range attention. arXiv, 2020.
|
| 251 |
+
[45] Bin Xiao, Haiping Wu, and Yichen Wei. Simple baselines for human pose estimation and tracking. In ECCV, 2018.
|
| 252 |
+
[46] Jianfeng Zhang, Xuecheng Nie, and Jiashi Feng. Inference stage optimization for cross-scenario 3d human pose estimation. In NeurIPS, 2020.
|
| 253 |
+
[47] Jianfeng Zhang, Dongdong Yu, Jun Hao Liew, Xuecheng Nie, and Jiashi Feng. Body meshes as points. In CVPR, 2021.
|
| 254 |
+
[48] Hengshuang Zhao, Jiaya Jia, and Vladlen Koltun. Exploring self-attention for image recognition. In CVPR, 2020.
|
| 255 |
+
[49] Xingyi Zhou, Qixing Huang, Xiao Sun, Xiangyang Xue, and Yichen Wei. Towards 3d human pose estimation in the wild: a weakly-supervised approach. In ICCV, 2017.
|
| 256 |
+
[50] Xizhou Zhu, Han Hu, Stephen Lin, and Jifeng Dai. Deformable convnets v2: More deformable, better results. In CVPR, 2019.
|
| 257 |
+
[51] Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, and Jifeng Dai. Deformable detr: Deformable transformers for end-to-end object detection. In ICCV, 2020.
|
md/train/rJYFzMZC-/rJYFzMZC-.md
ADDED
|
@@ -0,0 +1,335 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SIMULATING ACTION DYNAMICS WITH NEURAL PROCESS NETWORKS
|
| 2 |
+
|
| 3 |
+
Antoine Bosselut†, Omer Levy†, Ari Holtzman†, Corin Ennis‡, Dieter Fox† & Yejin Choi†
|
| 4 |
+
|
| 5 |
+
†Paul G. Allen School of Computer Science & Engineering
|
| 6 |
+
University of Washington
|
| 7 |
+
{antoineb,omerlevy,ahai,fox,yejin}@cs.washington.edu
|
| 8 |
+
‡School of Science, Technology, Engineering & Mathematics
|
| 9 |
+
University of Washington - Bothell
|
| 10 |
+
{corin123}@uw.edu
|
| 11 |
+
|
| 12 |
+
# ABSTRACT
|
| 13 |
+
|
| 14 |
+
Understanding procedural language requires anticipating the causal effects of actions, even when they are not explicitly stated. In this work, we introduce Neural Process Networks to understand procedural text through (neural) simulation of action dynamics. Our model complements existing memory architectures with dynamic entity tracking by explicitly modeling actions as state transformers. The model updates the states of the entities by executing learned action operators. Empirical results demonstrate that our proposed model can reason about the unstated causal effects of actions, allowing it to provide more accurate contextual information for understanding and generating procedural text, all while offering more interpretable internal representations than existing alternatives.
|
| 15 |
+
|
| 16 |
+
# 1 INTRODUCTION
|
| 17 |
+
|
| 18 |
+
Understanding procedural text such as instructions or stories requires anticipating the implicit causal effects of actions on entities. For example, given instructions such as “add blueberries to the muffin mix, then bake for one half hour,” an intelligent agent must be able to anticipate a number of entailed facts (e.g., the blueberries are now in the oven; their “temperature” will increase). While this common sense reasoning is trivial for humans, most natural language understanding algorithms do not have the capacity to reason about causal effects not mentioned directly in the surface strings (Levy et al., 2015; Jia & Liang, 2017; Lucy & Gauthier, 2017).
|
| 19 |
+
|
| 20 |
+
In this paper, we introduce Neural Process Networks, a procedural language understanding system that tracks common sense attributes through neural simulation of action dynamics. Our network models interpretation of natural language instructions as a process of actions and their cumulative effects on entities. More concretely, reading one sentence at a time, our model attentively selects what actions to execute on which entities, and remembers the state changes induced with a recurrent memory structure. In Figure 1, for example, our model indexes the “tomato” embedding, selects the “wash” and “cut” functions and performs a computation that changes the “tomato” embedding so that it can reason about attributes such as its “SHAPE” and “CLEANLINESS”.
|
| 21 |
+
|
| 22 |
+

|
| 23 |
+
Figure 1: The process is a narrative of entity state changes induced by actions. In each sentence, these state changes are induced by simulated actions and must be remembered.
|
| 24 |
+
|
| 25 |
+
Our model contributes to a recent line of research that aims to model aspects of world state changes, such as language models and machine readers with explicit entity representations (Henaff et al., 2016; Yang et al., 2016; Ji et al., 2017), as well as other more general purpose memory network variants (Weston et al., 2014; Sukhbaatar et al., 2015; Hill et al., 2015; Seo et al., 2016). This worldcentric modeling of procedural language (i.e., understanding by simulation) abstracts away from the surface strings, complementing text-centric modeling of language, which focuses on syntactic and semantic labeling of surface words (i.e., understanding by labeling).
|
| 26 |
+
|
| 27 |
+
Unlike previous approaches, however, our model also learns explicit action representations as functional operators (See Figure 1). While representations of action semantics could be acquired through an embodied agent that can see and interact with the world (Oh et al., 2015), we propose to learn these representations from text. In particular, we require the model to be able to explain the causal effects of actions by predicting natural language attributes about entities such as “LOCATION” and “TEMPERATURE”. The model adjusts its representations of actions based on errors it makes in predicting the resultant state changes to attributes. This textual simulation allows us to model aspects of action causality that are not readily available in existing simulation environments. Indeed, most virtual environments offer limited aspects of the world – with a primary focus on spatial relations (Oh et al., 2015; Chiappa et al., 2017; Wahlstrom et al., 2015). They leave out various other dimensions of the world states that are implied by diverse everyday actions such as “dissolve” (change of “COMPOSITION”) and “wash” (change of “CLEANLINESS”).
|
| 28 |
+
|
| 29 |
+
Empirical results demonstrate that parametrizing explicit action embeddings provides an inductive bias that allows the neural process network to learn more informative context representations for understanding and generating natural language procedural text. In addition, our model offers more interpretable internal representations and can reason about the unstated causal effects of actions explained through natural language descriptors. Finally, we include a new dataset with fine-grained annotations on state changes, to be shared publicly, to encourage future research in this direction.
|
| 30 |
+
|
| 31 |
+
# 2 NEURAL PROCESS NETWORK
|
| 32 |
+
|
| 33 |
+
The neural process network is an interpreter that reads in natural language sentences, one at a time, and simulates the process of actions being applied to relevant entities through learned representations of actions and entities.
|
| 34 |
+
|
| 35 |
+
# 2.1 OVERVIEW AND NOTATION
|
| 36 |
+
|
| 37 |
+
The main component of the neural process network is the simulation module (§2.5), a recurrent unit whose internals simulate the effects of actions being applied to entities. A set of $V$ actions is known a priori and an embedding is initialized for each one, $\mathcal { F } = \{ f _ { 1 } , . . . f _ { V } \}$ . Similarly, a set of $I$ entities is known and an embedding is initialized for each one: $\mathcal { E } = \{ e _ { 1 } , . . . e _ { I } \}$ . Each $e _ { i }$ can be considered to encode information about state attributes of that entity, which can be extracted by a set of state predictors (§2.6). As the model reads text, it “applies” action embeddings to the entity vectors, thereby changing the state information encoded about the entities.
|
| 38 |
+
|
| 39 |
+
For any document $d$ , an initial list of entities $I _ { d }$ is known and $\mathcal { E } _ { d } = \{ e _ { i } | i \in I _ { d } \} \subset \mathcal { E }$ entity state embeddings are initialized. As the neural process network reads a sentence from the document, it selects a subset of both $\mathcal { F } \left( \ S 2 . 3 \right)$ and $\mathcal { E } _ { d }$ $( \ S 2 . 4 )$ based on the actions performed and entities affected in the sentence. The entity state embeddings are changed by the action and the new embeddings are used to predict end states for a set of state changes (§2.6). The prediction error for end states is backpropagated to the action embeddings, learning action representations that model the simulation of desired causal effects on entities. This process is broken down into five modules below. Unless explicitly defined, all $W$ and $b$ variables are parametrized linear projections and biases. We use the notation $\{ e _ { i } \} _ { t }$ when referring to the values of the entity embeddings before processing sentence $s _ { t }$ .
|
| 40 |
+
|
| 41 |
+
# 2.2 SENTENCE ENCODER
|
| 42 |
+
|
| 43 |
+
Given a sentence $s _ { t }$ , a Gated Recurrent Unit (Cho et al., 2014) encodes each word and outputs its last hidden vector as a sentence encoding $h _ { t }$ (Sutskever et al., 2014).
|
| 44 |
+
|
| 45 |
+
# 2.3 ACTION SELECTOR
|
| 46 |
+
|
| 47 |
+
Given $h _ { t }$ from the sentence encoder, the action selector (bottom left in Fig. 2) contextually determines which action(s) from $\mathcal { F }$ to execute. For example, if the input sentence is “wash and cut
|
| 48 |
+
|
| 49 |
+

|
| 50 |
+
Figure 2: Model Summary. The sentence encoder converts a sentence to a vector representation, $h _ { t }$ . The action selector and entity selector use the vector representation to choose the actions that are applied and the entities that are acted upon in the sentence. The simulation module indexes the action and entity state embeddings, and applies the transformation to the entities. The state predictors predict the new state of the entities if a state change has occurred. Equation references are provided in parentheses.
|
| 51 |
+
|
| 52 |
+
beets”, both $f _ { w a s h }$ and $f _ { c u t }$ must be selected. To account for multiple actions, we make a soft selection over $\mathcal { F }$ , yielding a weighted sum of the selected action embeddings $\bar { f } _ { t }$ :
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\begin{array} { l } { { \displaystyle w _ { p } = \mathbf { M L P } \big ( h _ { t } \big ) } } \\ { { \displaystyle \bar { w } _ { p } = \frac { w _ { p } } { \sum _ { j = 1 } ^ { V } w _ { p _ { j } } } } } \\ { { \displaystyle \bar { f } _ { t } = \bar { w } _ { p } ^ { \top } \mathcal { F } } } \end{array}
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
where MLP is a parametrized feed-forward network with a sigmoid activation and $w _ { p } \in \mathbb { R } ^ { V }$ is the attention distribution over $V$ possible actions (§3.1). We compose the action embedding by taking the weighted average of the selected actions.
|
| 59 |
+
|
| 60 |
+
# 2.4 ENTITY SELECTOR
|
| 61 |
+
|
| 62 |
+
Sentence Attention Given $h _ { t }$ from the sentence encoder, the entity selector chooses relevant entities using a soft attention mechanism:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\begin{array} { r l } & { \tilde { h } _ { t } = \mathrm { R e L U } ( W _ { 1 } h _ { t } + b _ { 1 } ) } \\ & { d _ { i } = \sigma ( e _ { i _ { 0 } } ^ { \top } W _ { 2 } [ \tilde { h } _ { t } ; w _ { p } ] ) } \end{array}
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
where $W _ { 2 }$ is a bilinear mapping, $e _ { i _ { 0 } }$ is a unique key for each entity (§2.5), and $d _ { i }$ is the attention weight for entity embedding $e _ { i }$ . For example, in “wash and cut beets and carrots”, the model should select $e _ { b e e t }$ and ecarrot.
|
| 69 |
+
|
| 70 |
+
Recurrent Attention While sentence attention would suffice if entities were always explicitly mentioned, natural language often elides arguments or uses referent pronouns. As such, the module must be able to consider entities mentioned in previous sentences. Using $\tilde { h } _ { t }$ , the model computes a soft choice over whether to choose affected entities from this step’s attention $d _ { i }$ or the previous step’s attention distribution.
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\begin{array} { r } { c = s o f t m a x ( W _ { 3 } \tilde { h } _ { t } + b _ { 3 } ) } \\ { a _ { i _ { t } } = c _ { 1 } d _ { i } + c _ { 2 } a _ { i _ { t - 1 } } + c _ { 3 } \mathbf { 0 } } \end{array}
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
where $c \in \mathbb { R } ^ { 3 }$ is the choice distribution, $a _ { i _ { t - 1 } }$ is the previous sentence’s attention weight for each entity, $a _ { i _ { t } }$ is the final attention for each entity, and 0 is a vector of zeroes (providing the option to not change any entity). Prior entity attentions can propagate forward for multiple steps.
|
| 77 |
+
|
| 78 |
+
# 2.5 SIMULATION MODULE
|
| 79 |
+
|
| 80 |
+
Entity Memory A unique state embedding $e _ { i }$ is initialized for every entity $i$ in the document. A unique key to index each embedding $e _ { i _ { 0 } }$ is set as the initial value of the embedding (Henaff et al., 2016; Miller et al., 2016). After the model reads $s _ { t }$ , it modifies $\{ e _ { i } \} _ { t }$ to reflect changes influenced by actions. At every time step, the entity memory receives the attention weights from the entity selector, normalizes them and computes a weighted average of the relevant entity state embeddings:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\alpha _ { i } = \frac { a _ { i } } { \sum _ { j = 1 } ^ { I _ { d } } a _ { j } }
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\bar { e } _ { t } = \sum _ { j = 1 } ^ { I _ { d } } \alpha _ { i } e _ { i }
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
Applicator Given the action summary embedding $\bar { f } _ { t }$ and the entity summary embedding $\bar { e _ { t } }$ , the applicator (middle right in Fig. 2) applies the selected actions to the selected entities, and outputs the new proposal entity embedding $k _ { t }$ .
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
k _ { t } = \mathrm { R e L U } ( \bar { f } _ { t } W _ { 4 } \bar { e } _ { t } + b _ { 4 } )
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
where $W _ { 4 }$ is a third order tensor projection. The vector $k _ { t }$ is the new representation of the entity $\bar { e } _ { t }$ after the applicator simulates the action being applied to it.
|
| 97 |
+
|
| 98 |
+
Entity Updater The entity updater interpolates the new proposal entity embedding $k _ { t }$ and the set of current entity embeddings $\{ e _ { i } \} _ { t }$ :
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
e _ { i _ { t + 1 } } = a _ { i _ { t } } k _ { t } + ( 1 - a _ { i _ { t } } ) e _ { i _ { t } }
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
yielding an updated set of entity embeddings $\{ e _ { i } \} _ { t + 1 }$ . Each embedding is updated proportional to its entity’s unnormalized attention $a _ { i }$ , allowing the model to completely overwrite the state embedding for any entity. For example, in the sentence “mix the flour and water,” the embeddings for $e _ { f l o u r }$ and $e _ { w a t e r }$ must both be overwritten by $k _ { t }$ because they no longer exist outside of this new composition.
|
| 105 |
+
|
| 106 |
+
# 2.6 STATE PREDICTORS
|
| 107 |
+
|
| 108 |
+
Given the new proposal entity embedding $k _ { t }$ , the state predictor (bottom right in Fig. 2) predicts changes to the resulting entity embedding $k _ { t }$ along the following six dimensions: location, cookedness, temperature, composition, shape, and cleanliness. Discrete multi-class classifiers, one for each dimension, take in $k _ { t }$ and predict a unique end state for their corresponding state change type:
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
P ( Y _ { s } | k _ { t } ) = s o f t m a x ( W _ { s } k _ { t } + b _ { s } )
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
For location changes, which require contextual information to predict the end state, $k _ { t }$ is concatenated with the original sentence representation $h _ { t }$ to predict the final state.
|
| 115 |
+
|
| 116 |
+
# 3 TRAINING
|
| 117 |
+
|
| 118 |
+
# 3.1 STATE CHANGE KNOWLEDGE
|
| 119 |
+
|
| 120 |
+
In this work we focus on physical action verbs in cooking recipes. We manually collect a set of 384 actions such as cut, bake, boil, arrange, and place, organizing their causal effects along the following predefined dimensions: LOCATION, COOKEDNESS, TEMPERATURE, SHAPE, CLEANLINESS and COMPOSITION. The textual simulation operated by the model induces state changes along these dimensions by applying actions functions from the above set of 384. For example, cut entails a change in SHAPE, while bake entails a change in TEMPERATURE, COOKEDNESS, and even LOCATION. We annotate the state changes each action induces, as well as the end state of the action, using Amazon Mechanical Turk. The set of possible end states for a state change can range from 2 for binary state changes to more than 200 (See Appendix C for details). Table 1 provides examples of annotations in this action lexicon.
|
| 121 |
+
|
| 122 |
+
Table 1: Example actions, the state changes they induce, and the possible end states
|
| 123 |
+
|
| 124 |
+
<table><tr><td rowspan=1 colspan=1>Action</td><td rowspan=1 colspan=1>State Change Types</td><td rowspan=1 colspan=1>End States</td></tr><tr><td rowspan=1 colspan=1>braise</td><td rowspan=1 colspan=1>COOKEDNESS;TEMPERATURE</td><td rowspan=7 colspan=1>COOKED;HOTCOLDMOLDEDCLEANCOMPOSEDCOLD;REFRIGERATORSEPARATED</td></tr><tr><td rowspan=1 colspan=1>chill</td><td rowspan=1 colspan=1>TEMPERATURE</td></tr><tr><td rowspan=1 colspan=1>knead</td><td rowspan=2 colspan=1>SHAPECLEANLINESS</td></tr><tr><td rowspan=1 colspan=1>wash</td></tr><tr><td rowspan=1 colspan=1>dissolve</td><td rowspan=1 colspan=1>COMPOSITION</td></tr><tr><td rowspan=1 colspan=1>refrigerate</td><td rowspan=1 colspan=1>TEMPERATURE;LOCATION</td></tr><tr><td rowspan=1 colspan=1>slice</td><td rowspan=1 colspan=1>SHAPE</td></tr></table>
|
| 125 |
+
|
| 126 |
+
# 3.2 DATASET
|
| 127 |
+
|
| 128 |
+
For learning and evaluation, we use a subset of the Now You’re Cooking dataset (Kiddon et al., 2016). We chose 65816 recipes for training, 175 recipes for development, and 700 recipes for testing. For the development and test sets, crowdsourced workers densely annotate actions, entities and state changes that occur in each sentence so that we can tune hyperparameters and evaluate on gold evaluation sets. Annotation details are provided in Appendix C.3.
|
| 129 |
+
|
| 130 |
+
# 3.3 COMPONENT-WISE TRAINING
|
| 131 |
+
|
| 132 |
+
The neural process network is trained by jointly optimizing multiple losses for the action selector, entity selector, and state change predictors. Importantly, our training scheme uses weak supervision because dense annotations are prohibitively expensive to acquire at a very large scale. Thus, we heuristically extract verb mentions from each recipe step and assign a state change label based on the state changes induced by that action (§3.1). Entities are extracted similarly based on string matching between the instructions and the ingredient list. We use the following losses for training:
|
| 133 |
+
|
| 134 |
+
Action Selection Loss Using noisy supervision, the action selector is trained to minimize the cross-entropy loss for each possible action, allowing multiple actions to be chosen at each step if multiple actions are mentioned in a sentence. The MLP in the action selector (Eq. 1) is pretrained.
|
| 135 |
+
|
| 136 |
+
Entity Selection Loss Similarly, to train the attentive entity selector, we minimize the binary cross-entropy loss of predicting whether each entity is affected in the sentence.
|
| 137 |
+
|
| 138 |
+
State Change Loss For each state change predictor, we minimize the negative loglikelihood of predicting the correct end state for each state change.
|
| 139 |
+
|
| 140 |
+
Coverage Loss An underlying assumption in many narratives is that all entities that are mentioned should be important to the narrative. We add a loss term that penalizes narratives whose combined attention weights for each entity does not sum to more than 1.
|
| 141 |
+
|
| 142 |
+
$$
|
| 143 |
+
\mathcal { L } _ { c o v e r } = - \frac { 1 } { I _ { d } } \sum _ { i = 1 } ^ { I _ { d } } \log \sum _ { t = 1 } ^ { S } a _ { i _ { t } }
|
| 144 |
+
$$
|
| 145 |
+
|
| 146 |
+
where $a _ { i _ { t } }$ is the attention weight for a particular entity at sentence $t$ and $I _ { d }$ is the number of entities in a document. $\textstyle \sum _ { t = 1 } ^ { S } a _ { i _ { t } }$ is upper bounded by 1. This is similar to the coverage penalty used in neural machine translation (Tu et al., 2016).
|
| 147 |
+
|
| 148 |
+
# 4 EXPERIMENTAL SETUP
|
| 149 |
+
|
| 150 |
+
We evaluate our model on a set of intrinsic tasks centered around tracking entities and state changes in recipes to show that the model can simulate preliminary dynamics of the recipe task. Additionally, we provide a qualitative analysis of the internal components of our model. Finally, we evaluate the quality of the states encoded by our model on the extrinsic task of generating future steps in a recipe.
|
| 151 |
+
|
| 152 |
+
# 4.1 INTRINSIC EVALUATION - TRACKING
|
| 153 |
+
|
| 154 |
+
In the tracking task, we evaluate the model’s ability to identify which entities are selected and what changes have been made to them in every step. We break the tracking task into two separate evaluations, entity selection and end state prediction, and also investigate whether the model learns internal representations that approximate recipe dynamics.
|
| 155 |
+
|
| 156 |
+
Table 2: Results for entity selection and state change selection
|
| 157 |
+
|
| 158 |
+
<table><tr><td rowspan="2">Model</td><td colspan="3">Entity Selection</td><td colspan="2">State Change</td></tr><tr><td>F1</td><td>UR</td><td>CR</td><td>F1</td><td>Acc</td></tr><tr><td>2-layer LSTM Entity Recognizer</td><td>50.98</td><td>74.03</td><td>13.33</td><td>1</td><td>1</td></tr><tr><td rowspan="3">Adapted Gated Recurrent Unit Adapted Recurrent Entity Network - Recurrent Attention (Eq. 3)</td><td>45.94</td><td>67.69</td><td>7.74</td><td>41.16</td><td>52.69</td></tr><tr><td>48.57</td><td>71.88</td><td>9.87</td><td>42.32</td><td>53.47</td></tr><tr><td>48.91</td><td>72.32</td><td>12.67</td><td>42.14</td><td>50.48</td></tr><tr><td rowspan="3">- Coverage Loss (Eq. 9) - Action Connections (Eq. 2)</td><td>55.18</td><td>73.98</td><td>20.23</td><td>44.44</td><td>55.20</td></tr><tr><td>54.85</td><td>73.54</td><td>20.03</td><td>44.05</td><td>54.81</td></tr><tr><td>54.91</td><td>73.87</td><td>20.30</td><td>44.28</td><td>55.00</td></tr><tr><td rowspan="2">- Action Selector Pretraining + Pretrained Action Embeddings - Action Embedding Updates</td><td>55.16</td><td>74.02</td><td>20.32</td><td>44.02</td><td>55.03</td></tr><tr><td>53.79</td><td>70.77</td><td>18.60</td><td>44.27</td><td>55.02</td></tr><tr><td>FullModel</td><td>55.39</td><td>74.88</td><td>20.45</td><td>44.65</td><td>55.07</td></tr></table>
|
| 159 |
+
|
| 160 |
+
Metrics In the entity selection test, we report the F1 score of choosing the correct entities in any step. A selected entity is defined as one whose attention weight $a _ { i }$ is greater than $50 \%$ $( \ S 2 . 4 )$ . Because entities may be harder to predict when they have been combined with other entities (e.g., the mixture may have a new name), we also report the recall for selecting combined (CR) and uncombined (UR) entities. In the end state prediction test, we report how often the model correctly predicts the state change performed in a recipe step and the resultant end state. This score is then scaled by the accuracy of predicting which entities were changed in that same step. We report the average F1 and accuracy across the six state change types.
|
| 161 |
+
|
| 162 |
+
Baselines We compare our models against two baselines. First, we built a GRU model that is trained to predict entities and state changes independently. This can be viewed as a bare minimum network with no action representations or recurrent entity memory. The second baseline is a Recurrent Entity Network (Henaff et al., 2016) with changes to fit our task. First, the model can tie memory cells to a subset of the full list of entities so that it only considers entities that are present in a particular recipe. Second, the entity distribution for writing to the memory cells is re-used when we query the memory cells. The normalized weighted average of the entity cells is used as the input to the state predictors. The unnormalized attention when writing to each cell is used to predict selected entities. Both baselines are trained with entity selection and state change losses (§3.3).
|
| 163 |
+
|
| 164 |
+
Ablations We report results on six ablations. First, we remove the recurrent attention (Eq. 3). The model only predicts entities using the current encoder hidden state. In the second ablation, the model is trained with no coverage penalty (Eq. 9). The third ablation prunes the connection from the action selector $w _ { p }$ to the entity selector (Eq. 2). We also explore not pretraining the action selector. Finally, we look at two ablations where we intialize the action embeddings with vectors from a skipgram model. In the first, the model operates normally, and in the second, we do not allow gradients to backpropagate to the action embeddings, updating only the mapping tensor $W _ { 4 }$ instead (Eq. 6).
|
| 165 |
+
|
| 166 |
+
# 4.2 EXTRINSIC EVALUATION - GENERATION
|
| 167 |
+
|
| 168 |
+
The generation task tests whether our system can produce the next step in a recipe based on the previous steps that have been performed. The model is provided all of the previous steps as context.
|
| 169 |
+
|
| 170 |
+
Metrics We report the combined BLEU score and ROUGE score of the generated sequence relative to the reference sequence. Each candidate sequence has one reference sentence. Both metrics are computed at the corpus-level. Also reported are “VF1”, the F1 score for the overlap of the actions performed in the reference sequence and the verbs mentioned in the generated sequence, and “SF1”, the F1 score for the overlap of end states annotated in the reference sequence and predicted by the generated sequences. End states for the generated sequences are extracted using the lexicon from Section 3.1 based on the actions performed in the sentence.
|
| 171 |
+
|
| 172 |
+
Setup To apply our model to the task of recipe step generation, we input the context sentences through the neural process network and record the entity state vectors once the entire context has been read (§2.5). These vectors can be viewed as a snapshot of the current state of the entities once the preceding context has been simulated inside the neural process network. We encode these vectors using a bidirectional GRU (Cho et al., 2014) and take the final time step hidden state $\mathbb { e } _ { I }$ . A different GRU encodes the context words in the same way (yielding $\mathbb { h } _ { T }$ ) and the first hidden state input to the decoder is computed using the projection function:
|
| 173 |
+
|
| 174 |
+
Table 3: Examples of the model selecting entities for sentence $s _ { t }$ . The previous sentences are provided as context in cases where they are relevant.
|
| 175 |
+
|
| 176 |
+
<table><tr><td rowspan=1 colspan=1>Good</td><td rowspan=1 colspan=1>St-1Stselectedcorrect</td><td rowspan=1 colspan=1>Add tomato paste,broth, garlic,chili powder,cumin,chile peppers,and water.Bring to boil, then turn very low,cover and simmer until meat is tender.meat,garlic, chili powder, tomato paste,cumin,chiles,beef broth,waterSame + [oil]</td></tr><tr><td rowspan=1 colspan=1>Good</td><td rowspan=1 colspan=1>St-4St-3St-2St-1Stselectedcorrect</td><td rowspan=1 colspan=1>Stir in oats, sugar, flour, corn syrup,milk, vanilla extract, and salt.Mix well.Drop by measuring teaspoonfuls onto cookie sheets.Bake 5-7 minutes.Let cool.oats,sugar, flour, corn syrup,milk,vanilla extract, saltoats,sugar, flour, corn syrup,milk,vanilla extract, salt</td></tr><tr><td rowspan=1 colspan=1>Good</td><td rowspan=1 colspan=1>St-1Stselectedcorrect</td><td rowspan=1 colspan=1>In a large saucepan over low heat, melt marshmallows.Add sprinkles,cereal,and raisins,stir until well coated.marshmallows,cereal,raisinsmarshmallows,cereal, raisins,sprinkles</td></tr><tr><td rowspan=1 colspan=1>Bad</td><td rowspan=1 colspan=1>St-3St-2St-1Stselectedcorrect</td><td rowspan=1 colspan=1>Ladle the barbecue sauce around the crust and spread.Add mozzarella, yellow cheddar,and monterey jack cheese.Next,add onion mixture and sliced chicken breast .Top pizza with jalapeno peppers.jalapenoscrust,sauce,mozzarella,cheddar,monterey jack,white onion,chicken, jalapenos</td></tr><tr><td rowspan=1 colspan=1>Bad</td><td rowspan=1 colspan=1>St-2St-1Stselectedcorrect</td><td rowspan=1 colspan=1>Combine 1 cup flour, salt,and 1 tbsp sugar.Cut in butter until mixture is crumbly, then sprinkle with vinegar .Gather dough into a ball and press into bottom of 9 inch springform pan.butter, vinegarflour, salt,sugar, butter, vinegar</td></tr></table>
|
| 177 |
+
|
| 178 |
+
$$
|
| 179 |
+
\tilde { h } _ { 0 } = W _ { 5 } ( \Subset _ { I } \circ \Join _ { T } )
|
| 180 |
+
$$
|
| 181 |
+
|
| 182 |
+
where $\circ$ is the Hadamard product between the two encoder outputs. All models are trained by minimizing the negative loglikelihood of predicting the next word for the full sequence. Implementation details can be found in Appendix A.
|
| 183 |
+
|
| 184 |
+
Baselines For the generation task, we use three baselines: a seq2seq model with no attention (Sutskever et al., 2014), an attentive seq2seq model (Bahdanau et al., 2014), and a similar variant as our NPN generator, except where the entity states have been computed by the Recurrent Entity Network (EntNet) baseline $( \ S 4 . 1 )$ . Implementation details for baselines can be found in Appendix B.
|
| 185 |
+
|
| 186 |
+
# 5 EXPERIMENTAL RESULTS
|
| 187 |
+
|
| 188 |
+
# 5.1 INTRINSIC EVALUATIONS
|
| 189 |
+
|
| 190 |
+
Entity Selection As shown in Table 8, our full model outperforms all baselines at selecting entities, with an F1 score of $5 5 . 3 9 \%$ . The ablation study shows that the recurrent attention, coverage loss, action connections and action selector pretraining improve performance. Our success at predicting entities extends to both uncomposed entities, which are still in their raw forms (e.g., melt the butter butter), and composed entities, in which all of the entities that make up a composition must be selected. For example, in a Cooking lasagna recipe, if the final step involves baking the prepared lasagna, the model must select all the entities that make up the lasagna (e.g., lasagna sheets, beef, tomato sauce). In Table 3, we provide examples of our model’s ability to handle complex cases such as compositional entities (Ex. 1, 3), and elided arguments over long time windows (Ex. 2). We also provide examples where the model fails to select the correct entities because it does not identify the mapping between a reference construct such as “pizza” (Ex. 4) or “dough” (Ex. 5) and the set of entities that composes it, showcasing the difficulty of selecting the full set for a composed entity.
|
| 191 |
+
|
| 192 |
+
Table 4: Most similar actions based on cosine similarity of action embeddings
|
| 193 |
+
|
| 194 |
+
<table><tr><td>Action</td><td>NearestNeighbor Actions</td></tr><tr><td>cut boil</td><td>slice,split, snap,slash,carve,slit,chop cook,microwave,fry,steam,simmer</td></tr><tr><td>add</td><td>sprinkle,mix,reduce,splash,stir,dust</td></tr><tr><td>wash</td><td>rinse,scrub,refresh,soak,wipe,scale</td></tr><tr><td>mash</td><td>spread, puree,squeeze,liquefy, blend</td></tr><tr><td>place rinse</td><td>ease,put,lace,arrange,leave</td></tr><tr><td></td><td>wash,refresh,soak,wipe,scrub,clean</td></tr><tr><td>warm</td><td>reheat, ignite,heat,light,crisp,preheat</td></tr><tr><td>steam</td><td></td></tr><tr><td></td><td>microwave,crisp,boil, parboil,heat</td></tr><tr><td>sprinkle</td><td>top,pat,add,dip,salt, season</td></tr><tr><td>grease</td><td>coat,rub,dribble,spray,smear, line</td></tr></table>
|
| 195 |
+
|
| 196 |
+

|
| 197 |
+
Figure 3: Change in cosine similarity of entity state embeddings
|
| 198 |
+
|
| 199 |
+
Table 5: Generation Results
|
| 200 |
+
|
| 201 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=2>BLEU</td><td rowspan=1 colspan=2>BLEU</td><td rowspan=1 colspan=1>ROUGE-L</td><td rowspan=1 colspan=1>R</td><td rowspan=1 colspan=1>VF1</td></tr><tr><td rowspan=1 colspan=1>Vanilla Seq2SeqAttentive Seq2SeqEntNet Generator</td><td rowspan=1 colspan=2>2.812.832.30</td><td rowspan=1 colspan=3>33.0033.1832.71</td><td rowspan=1 colspan=1>16.1716.9717.53</td><td rowspan=1 colspan=1>40.2141.4342.43</td></tr><tr><td rowspan=1 colspan=1>NPN Generator</td><td rowspan=1 colspan=2>3.74</td><td rowspan=1 colspan=3>35.64</td><td rowspan=1 colspan=1>20.12</td><td rowspan=1 colspan=1>43.40</td></tr></table>
|
| 202 |
+
|
| 203 |
+
State Change Tracking In Table 8, we show that our full model outperforms competitive baselines such as Recurrent Entity Networks (Henaff et al., 2016) and jointly trained GRUs. While the ablation without the coverage loss shows higher accuracy, we attribute this to the fact that it predicts a smaller number of total state changes. Interestingly, initializing action embeddings with skipgram vectors and locking their values shows relatively high performance, indicating the potential gains in using powerful pretrained representations to represent actions.
|
| 204 |
+
|
| 205 |
+
Action Embeddings In our model, each action is assigned its own embedding, but many actions induce similar changes in the physical world (e.g.,“cut” and “slice”). After training, we compute the pairwise cosine similarity between each pair of action embeddings. In Table 4, we see that actions that perform similar functions are neighbors in embedding space, indicating the model has captured certain semantic properties of these actions. Learning action representations through the state changes they induce has allowed the model to cluster actions by their transformation functions.
|
| 206 |
+
|
| 207 |
+
Entity Compositions When individual entities are combined into new constructs, our model averages their state embeddings (Eq. 5), applies an action embedding to them (Eq. 6), and writes them to memory (Eq. 7). The state embeddings of entities that are combined should be overwritten by the same new embedding. In Figure 3, we present the percentage increase in cosine similarity for state embeddings of entities that are combined in a sentence (blue) as opposed to the percentage increase for those that are not (red bars). While the soft attention mechanism for entity selection allows similarities to leak between entity embeddings, our system is generally able to model the compositionality patterns that result from entities being combined into new constructs.
|
| 208 |
+
|
| 209 |
+
# 5.2 EXTRINSIC EVALUATIONS
|
| 210 |
+
|
| 211 |
+
Recipe Step Generation Our results in Table 5 indicate that sequences generated using the neural process network entity states as additional input yield higher scores than competitive baselines. The entity states allow the model to predict next steps conditioned on a representation of the world being simulated by the neural process network. Additionally, the higher VF1 and SF1 scores indicate that the model is indeed using the extra information to better predict the actions that should follow the context provided. Example generations for each baselines from the dev set are provided in Table 6, showing that the NPN generator can use information about ingredient states to reason about the most likely next step. The first and second examples are interesting as it shows that the NPN-aware model has learned to condition on entity state – knowing that raw butter will likely be melted or that a cooked flan must be refrigerated. The third example is also interesting because the model learns that cooked vegetables such as squash will sometimes be drained, even if it is not relevant to this recipe because the squash is steamed. The seq2seq and EntNet baselines, meanwhile, output reasonable sentences given the immediate context, but do not exhibit understanding of global patterns.
|
| 212 |
+
|
| 213 |
+
Table 6: Examples of the model generating sentences compared to baselines. The context and reference are provided first, followed by our model’s generation and then the baseline generations
|
| 214 |
+
|
| 215 |
+
<table><tr><td rowspan=1 colspan=1>ContextReferenceNPNSeq2seqAttentive Seq2seqEntNet</td><td rowspan=1 colspan=1>Preheat oven to 425 degrees.Melt butter in saucepan and mix in bourbon, thyme,pepper, and salt.Melt butter in skillet.Lightly grease 4 x 8 baking pan with sunflower oil.Combine all ingredients and mix well.In a large bowl, combine flour,baking powder,baking soda, salt,and pepper.</td></tr><tr><td rowspan=1 colspan=1>ContextReferenceNPNSeq2seqAttentive Seq2seqEntNet</td><td rowspan=1 colspan=1>Pour egg mixture over caramelized sugar in cake pan. Place cake pan in large shallowbaking dish.Bake for 55 minutes or until knife inserted into flan comes out clean.Cover and chill at least 8 hours.Refrigerate until ready to use.Serve at room temperature.Store in an airtight container.Store in an airtight container.</td></tr><tr><td rowspan=1 colspan=1>ContextReferenceNPNSeq2seqAttentive Seq2seqEntNet</td><td rowspan=1 colspan=1>Cut squash into large pieces and steam. Remove cooked squash from shells;Measure 4 cups pulp and reserve remainder for another dish.Drain.Mash pulp with a fork.Set aside.Set aside.</td></tr></table>
|
| 216 |
+
|
| 217 |
+
# 6 RELATED WORK
|
| 218 |
+
|
| 219 |
+
Recent studies in machine comprehension have used a neural memory component to store a running representation of processed text (Weston et al., 2014; Sukhbaatar et al., 2015; Hill et al., 2015; Seo et al., 2016). While these approaches map text to memory vectors using standard neural encoder approaches, our model, in contrast, directly interprets text in terms of the effects actions induce in entities, providing an inductive bias for learning how to represent stored memories. More recent work in machine comprehension also sought to couple the memory representation with tracking entity states (Henaff et al., 2016). Our work seeks to provide a relatively more structured representation of domain-specific action knowledge to provide an inductive bias to the reasoning process.
|
| 220 |
+
|
| 221 |
+
Neural Programmers (Neelakantan et al., 2015; 2016) have also used functions to simulate reasoning, by building a model to select rows in a database and applying operation on those selected rows. While their work explicitly defined the effect of a number of operations for those rows, we provide a framework for learning representations for a more expansive set of actions, allowing the model to learn representations for how actions change the state space.
|
| 222 |
+
|
| 223 |
+
Works on instructional language studied the task of building discrete graph representations of recipes using probabilistic models (Kiddon et al., 2015; Mori et al., 2014; 2012). We propose a complementary new model by integrating action and entity relations into the neural network architecture and also address the additional challenge of tracking the state changes of the entities.
|
| 224 |
+
|
| 225 |
+
Additional work in tracking states with visual or multimodal context has focused on 1) building graph representations for how entities change in goal-oriented domains (Gao et al., 2016; Liu et al., 2016; Si et al., 2011) or 2) tracking visual state changes based on decisions taken by agents in environment simulators such as videos or games (Chiappa et al., 2017; Wahlstrom et al., 2015; Oh et al., 2015). Our work, in contrast, models state changes in embedding space using only text-based signals to map real-world actions to algebraic transformations.
|
| 226 |
+
|
| 227 |
+
# 7 CONCLUSION
|
| 228 |
+
|
| 229 |
+
We introduced the Neural Process Network for modeling a process of actions and their causal effects on entities by learning action transformations that change entity state representations. The model maintains a recurrent memory structure to track entity states and is trained to predict the state changes that entities undergo. Empirical results demonstrate that our model can learn the causal effects of action semantics in the cooking domain and track the dynamic state changes of entities, showing advantages over competitive baselines.
|
| 230 |
+
|
| 231 |
+
# ACKNOWLEDGMENTS
|
| 232 |
+
|
| 233 |
+
We thank Yonatan Bisk, Peter Clark, Bhavana Dalvi, Niket Tandon, and Yuyin Sun for helpful discussions at various stages of this work. This research was supported in part by NSF (IIS-1524371, IIS-1714566, NRI-1525251), DARPA under the CwC program through the ARO (W911NF-15-1- 0543), Samsung Research, and gifts by Google and Facebook.
|
| 234 |
+
|
| 235 |
+
# REFERENCES
|
| 236 |
+
|
| 237 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In ICLR 2015, 2014.
|
| 238 |
+
|
| 239 |
+
Silvia Chiappa, Sebastien Racani ´ ere, Daan Wierstra, and Shakir Mohamed. Recurrent environment \` simulators. CoRR, abs/1704.02254, 2017.
|
| 240 |
+
|
| 241 |
+
Kyunghyun Cho, Bart van Merrienboer, Caglar Gulcehre, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder-decoder for statistical machine translation. In Conference on Empirical Methods in Natural Language Processing (EMNLP 2014), 2014.
|
| 242 |
+
|
| 243 |
+
Qiaozi Gao, Malcolm Doering, Shaohua Yang, and Joyce Y Chai. Physical causality of action verbs in grounded language understanding. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (ACL), volume 1, pp. 1814–1824, 2016.
|
| 244 |
+
|
| 245 |
+
Mikael Henaff, Jason Weston, Arthur Szlam, Antoine Bordes, and Yann LeCun. Tracking the world state with recurrent entity networks. arXiv preprint arXiv:1612.03969, 2016.
|
| 246 |
+
|
| 247 |
+
Felix Hill, Antoine Bordes, Sumit Chopra, and Jason Weston. The goldilocks principle: Reading children’s books with explicit memory representations. arXiv preprint arXiv:1511.02301, 2015.
|
| 248 |
+
|
| 249 |
+
Yangfeng Ji, Chenhao Tan, Sebastian Martschat, Yejin Choi, and Noah A Smith. Dynamic entity representations in neural language models. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 1831–1840, 2017.
|
| 250 |
+
|
| 251 |
+
Robin Jia and Percy Liang. Adversarial examples for evaluating reading comprehension systems. In Empirical Methods in Natural Language Processing (EMNLP), 2017.
|
| 252 |
+
|
| 253 |
+
Chloe Kiddon, Ganesa Thandavam Ponnuraj, Luke Zettlemoyer, and Yejin Choi. Mise en place: ´ Unsupervised interpretation of instructional recipes. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pp. 982–992, 2015.
|
| 254 |
+
|
| 255 |
+
Chloe Kiddon, Luke Zettlemoyer, and Yejin Choi. Globally coherent text generation with neu-´ ral checklist models. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing (EMNLP), 2016.
|
| 256 |
+
|
| 257 |
+
Jin-Hwa Kim, Kyoung Woon On, Jeonghee Kim, JungWoo Ha, and Byoung-Tak Zhang. Hadamard product for low-rank bilinear pooling. CoRR, abs/1610.04325, 2016.
|
| 258 |
+
|
| 259 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 260 |
+
|
| 261 |
+
Omer Levy, Steffen Remus, Christian Biemann, and Ido Dagan. Do supervised distributional methods really learn lexical inference relations? In HLT-NAACL, 2015.
|
| 262 |
+
|
| 263 |
+
Changsong Liu, Shaohua Yang, Sari Saba-Sadiya, Nishant Shukla, Yunzhong He, Song-Chun Zhu, and Joyce Y Chai. Jointly learning grounded task structures from language instruction and visual demonstration. In Conference on Empirical Methods in Natural Language Processing (EMNLP), 2016.
|
| 264 |
+
|
| 265 |
+
Li Lucy and Jon Gauthier. Are distributional representations ready for the real world? evaluating word vectors for grounded perceptual meaning. CoRR, abs/1705.11168, 2017.
|
| 266 |
+
|
| 267 |
+
Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781, 2013a.
|
| 268 |
+
|
| 269 |
+
Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In C. J. C. Burges, L. Bottou, M. Welling, Z. Ghahramani, and K. Q. Weinberger (eds.), Advances in Neural Information Processing Systems 26, pp. 3111–3119, 2013b.
|
| 270 |
+
|
| 271 |
+
Alexander Miller, Adam Fisch, Jesse Dodge, Amir-Hossein Karimi, Antoine Bordes, and Jason Weston. Key-value memory networks for directly reading documents. arXiv preprint arXiv:1606.03126, 2016.
|
| 272 |
+
Shinsuke Mori, Tetsuro Sasada, Yoko Yamakata, and Koichiro Yoshino. A machine learning approach to recipe text processing. In Proceedings of the 1st Cooking with Computer Workshop, pp. 29–34, 2012.
|
| 273 |
+
Shinsuke Mori, Hirokuni Maeta, Yoko Yamakata, and Tetsuro Sasada. Flow graph corpus from recipe texts. In LREC, pp. 2370–2377, 2014.
|
| 274 |
+
Arvind Neelakantan, Quoc V. Le, and Ilya Sutskever. Neural programmer: Inducing latent programs with gradient descent. CoRR, abs/1511.04834, 2015.
|
| 275 |
+
Arvind Neelakantan, Quoc V. Le, Mart´ın Abadi, Andrew McCallum, and Dario Amodei. Learning a natural language interface with neural programmer. CoRR, abs/1611.08945, 2016.
|
| 276 |
+
Junhyuk Oh, Xiaoxiao Guo, Honglak Lee, Richard L. Lewis, and Satinder P. Singh. Actionconditional video prediction using deep networks in atari games. In NIPS, 2015.
|
| 277 |
+
Minjoon Seo, Sewon Min, Ali Farhadi, and Hannaneh Hajishirzi. Query-reduction networks for question answering. arXiv preprint arXiv:1606.04582, 2016.
|
| 278 |
+
Zhangzhang Si, Mingtao Pei, Benjamin Yao, and Song-Chun Zhu. Unsupervised learning of event and-or grammar and semantics from video. In Computer Vision (ICCV), 2011 IEEE International Conference on, pp. 41–48. IEEE, 2011.
|
| 279 |
+
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.
|
| 280 |
+
Sainbayar Sukhbaatar, Jason Weston, Rob Fergus, et al. End-to-end memory networks. In Advances in neural information processing systems, pp. 2440–2448, 2015.
|
| 281 |
+
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.
|
| 282 |
+
Zhaopeng Tu, Zhengdong Lu, Yang Liu, Xiaohua Liu, and Hang Li. Modeling coverage for neural machine translation. In ACL, 2016.
|
| 283 |
+
Niklas Wahlstrom, Thomas B. Schon, and Marc Peter Deisenroth. From pixels to torques: Policy ¨ learning with deep dynamical models. CoRR, abs/1502.02251, 2015.
|
| 284 |
+
Jason Weston, Sumit Chopra, and Antoine Bordes. Memory networks. arXiv preprint arXiv:1410.3916, 2014.
|
| 285 |
+
Zichao Yang, Phil Blunsom, Chris Dyer, and Wang Ling. Reference-aware language models. CoRR, abs/1611.01628, 2016. URL http://arxiv.org/abs/1611.01628.
|
| 286 |
+
|
| 287 |
+
# A TRAINING DETAILS OF OUR FULL MODEL AND ABLATIONS
|
| 288 |
+
|
| 289 |
+
# A.1 TRACKING MODELS
|
| 290 |
+
|
| 291 |
+
The hidden size of the instruction encoder is 100, the embedding sizes of action functions and entities are 30. We use dropout with a rate of 0.3 before any non-recurrent fully connected layers Srivastava et al. (2014). We use the Adam optimizer (Kingma & Ba, 2014) with a learning rate of .001 and decay by a factor of 0.1 if we see no improvement on validation loss over three epochs. We stop training early if the development loss does not decrease for five epochs. The batch size is 64. We use two instruction encoders, one for the entity selector, and one for the action selector. Word embeddings and entity embeddings are initialized with skipgram embeddings (Mikolov et al., 2013a;b) using a word2vec model trained on the training set. We use a vocabulary size of 7358 for words, and 2996 for entities. Gradients with respect to the coverage loss (Eq. 9) are only backpropagated in steps where no entity is annotated as being selected. To account for the false negatives in the training data due to the heuristic generation of the labels, gradients with respect to the entity selection loss are zeroed when no entity label is present.
|
| 292 |
+
|
| 293 |
+
# A.2 GENERATION MODEL
|
| 294 |
+
|
| 295 |
+
The hidden size of the context encoder is 200. The hidden size of the state vector encoder is 200. State vectors have dimensionality 30 (the same as in the neural process network). Dropout of 0.3 is used during training in the decoder. The context and state representations are projected jointly using an element-wise product followed by a linear projection Kim et al. (2016). Both encoders and the decoder are single layer. The learning rate is 0.0003 initially and is halved every 5 epochs. The model is trained with the Adam optimizer.
|
| 296 |
+
|
| 297 |
+
# B TRAINING DETAILS OF BASELINES
|
| 298 |
+
|
| 299 |
+
# B.1 TRACKING BASELINES
|
| 300 |
+
|
| 301 |
+
Joint Gated Recurrent Unit The hidden state of the GRU is 100. We use a dropout with a rate of 0.3 before any non-recurrent fully connected layers. We use the Adam optimizer with a learning rate of .001 and decay by a factor of 0.1 if we see no improvement on validation loss over a single epoch. We stop training early if the development loss does not decrease for five epochs. The batch size is 64. We use encoders, one for the entity selector, and one for the state change predictors. Word embeddings are initialized with skipgram embeddings using a word2vec model trained on the training set. We use a vocabulary size of 7358 for words.
|
| 302 |
+
|
| 303 |
+
Recurrent Entity Networks Memory cells are tied to the entities in the document. For a recipe with 12 ingredients, 12 entity cells are initialized. All hyperparameters are the same as the in the bAbI task from Henaff et al. (2016). The learning rate start at 0.01 and is halved every 25 epochs. Entity cells and word embeddings are 100 dimensional. The encoder is a multiplicative mask initialized the same as in Henaff et al. (2016). Intermediate supervision from the weak labels is provided to help predict entities. A separate encoder is used for computing the attention over memory cells and the content to write to the memory. Dropout of 0.3 is used in the encoders. The batch size is 64. We use a vocabulary size of 7358 for words, and 2996 for entities.
|
| 304 |
+
|
| 305 |
+
# B.2 GENERATION BASELINES
|
| 306 |
+
|
| 307 |
+
Seq2seq The encoder and decoder are both single-layer GRUs with hidden size 200. We use dropout with probability 0.3 in the decoder. We train with the Adam optimizer starting with a learning rate 0.0003 that is halved every 5 epochs. The encoder is bidirectional. The model is trained to minimize the negative loglikelihood of predicting the next word.
|
| 308 |
+
|
| 309 |
+
Attentive Seq2seq The encoder is the same as in the seq2seq baseline. A multiplicative attention between the decoder hidden state and the context vectors is used to compute the attention over the context at every decoder time step. The model is trained with the same learning rate, learning schedule and loss function as the seq2seq baseline.
|
| 310 |
+
|
| 311 |
+
EntNet Generator The model is trained in the same way as the NPN generator model in Appendix A.2 except that the state representations used as input are produced from by EntNet baseline described in Section 4.1 and Appendix B.1.
|
| 312 |
+
|
| 313 |
+
# C ANNOTATIONS
|
| 314 |
+
|
| 315 |
+
# C.1 ANNOTATING STATE CHANGES
|
| 316 |
+
|
| 317 |
+
We provide workers with a verb, its definition, an illustrative image of the action, and a set of sentences where the verb is mentioned. Workers are provided a checklist of the six state change types and instructed to identify which of them the verb causes. They are free to identify multiple changes. Seven workers annotate each verb and we assign a state change based on majority vote. Of the set of 384 verbs extracted, only 342 have a state change type identified with them. Of those, 74 entail multiple state change types.
|
| 318 |
+
|
| 319 |
+
# C.2 ANNOTATING END STATES
|
| 320 |
+
|
| 321 |
+
We give workers a verb, a state change type, and an example with the verb and ask them to provide an end state for the ingredient the verb is applied to in the example. We then use the answers to manually aggregate a set of end states for each state change type. These end states are used as labels when the model predicting state changes. For example, a LOCATION change might lead to an end state of “pan,” “pot”, or “oven.” End states for each state change type are provided in Table 7.
|
| 322 |
+
|
| 323 |
+
Table 7: End states for each state change type
|
| 324 |
+
|
| 325 |
+
<table><tr><td>State Change Type</td><td>End States</td></tr><tr><td>Temperature Composition Cleanliness Cookedness Shape Location</td><td>hot; cold; room composed; not composed clean; dirty; dry cooked; raw molded; hit; deformed; separated pan,pot, cupboard, screen, scale,</td></tr></table>
|
| 326 |
+
|
| 327 |
+
# C.3 ANNOTATING DEVELOPMENT AND TEST SETS
|
| 328 |
+
|
| 329 |
+
Annotators are instructed to note any entities that undergo one of the six state changes in each step, as well as to identify new combinations of ingredients that are created. For example, the sentence “Cut the tomatoes and add to the onions” would involve a SHAPE change for the tomatoes and a combination created from the “tomatoes” and “onions”. In a separate task, three workers are asked to identify the actions performed in every sentence of the development and test set recipes. If an action receives a majority vote that it is performed, it is included in the annotations.
|
| 330 |
+
|
| 331 |
+
D ADDITIONAL RESULTS D.1 REMOVING TRAINING DATA
|
| 332 |
+
|
| 333 |
+
Table 8: Results for entity selection and state change selection on the development set when randomly dropping a percentage of the training labels
|
| 334 |
+
|
| 335 |
+
<table><tr><td rowspan="2">Model</td><td colspan="3">Entity Selection</td><td colspan="2"> State Change</td></tr><tr><td>F1</td><td>UR</td><td>CR</td><td>F1</td><td>Acc</td></tr><tr><td>25% training data kept</td><td>54.34</td><td>75.71</td><td>21.17</td><td>2.52</td><td>50.23</td></tr><tr><td>50% training data kept</td><td>55.12</td><td>76.04</td><td>19.05</td><td>36.34</td><td>54.66</td></tr><tr><td>75% training data kept</td><td>56.64</td><td>76.03</td><td>21.00</td><td>48.86</td><td>57.62</td></tr><tr><td>100% training data</td><td>56.84</td><td>74.98</td><td>21.14</td><td>50.56</td><td>57.87</td></tr></table>
|
md/train/rJlUhhVYvS/rJlUhhVYvS.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/rk6cfpRjZ/rk6cfpRjZ.md
ADDED
|
@@ -0,0 +1,239 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING INTRINSIC SPARSE STRUCTURES WITHIN LONG SHORT-TERM MEMORY
|
| 2 |
+
|
| 3 |
+
Wei Wen∗, Yiran Chen & Hai Li Electrical and Computer Engineering, Duke University {wei.wen,yiran.chen,hai.li}@duke.edu
|
| 4 |
+
|
| 5 |
+
Yuxiong $\mathbf { H e } ^ { \dagger }$ , Samyam Rajbhandari†, Minjia Zhang†, Wenhan Wang†, Fang Liu§ & Bin $\mathbf { H } \mathbf { u } ^ { \mathrm { \ S } }$ Business AI† and Bing§, Microsoft {yuxhe,samyamr,minjiaz,wenhanw,fangliu,binhu}@microsoft.com
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Model compression is significant for the wide adoption of Recurrent Neural Networks (RNNs) in both user devices possessing limited resources and business clusters requiring quick responses to large-scale service requests. This work aims to learn structurally-sparse Long Short-Term Memory (LSTM) by reducing the sizes of basic structures within LSTM units, including input updates, gates, hidden states, cell states and outputs. Independently reducing the sizes of basic structures can result in inconsistent dimensions among them, and consequently, end up with invalid LSTM units. To overcome the problem, we propose Intrinsic Sparse Structures (ISS) in LSTMs. Removing a component of ISS will simultaneously decrease the sizes of all basic structures by one and thereby always maintain the dimension consistency. By learning ISS within LSTM units, the obtained LSTMs remain regular while having much smaller basic structures. Based on group Lasso regularization, our method achieves $1 0 . 5 9 \times$ speedup without losing any perplexity of a language modeling of Penn TreeBank dataset. It is also successfully evaluated through a compact model with only 2.69M weights for machine Question Answering of SQuAD dataset. Our approach is successfully extended to nonLSTM RNNs, like Recurrent Highway Networks (RHNs). Our source code is available1.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Model Compression (Jaderberg et al. (2014), Han et al. (2015a), Wen et al. (2017), Louizos et al. (2017)) is a class of approaches of reducing the size of Deep Neural Networks (DNNs) to accelerate inference. Structure Learning (Zoph & Le (2017), Philipp & Carbonell (2017), Cortes et al. (2017)) emerges as an active research area for DNN structure exploration, potentially replacing human labor with machine automation for design space exploration. In the intersection of both techniques, an important area is to learn compact structures in DNNs for efficient inference computation using minimal memory and execution time without losing accuracy. Learning compact structures in Convolutional Neural Networks (CNNs) have been widely explored in the past few years. Han et al. (2015b) proposed connection pruning for sparse CNNs. Pruning method also works successfully in coarse-grain levels, such as pruning filters in CNNs (Li et al. (2017)) and reducing neuron numbers (Alvarez & Salzmann (2016)). Wen et al. (2016) presented a general framework to learn versatile compact structures (neurons, filters, filter shapes, channels and even layers) in DNNs.
|
| 14 |
+
|
| 15 |
+
Learning the compact structures in Recurrent Neural Networks (RNNs) is more challenging. As a recurrent unit is shared across all the time steps in sequence, compressing the unit will aggressively affect all the steps. A recent work by Narang et al. (2017) proposes a pruning approach that deletes up to $9 0 \%$ connections in RNNs. Connection pruning methods sparsify weights of recurrent units but cannot explicitly change basic structures, e.g., the number of input updates, gates, hidden states, cell states and outputs. Moreover, the obtained sparse matrices have an irregular/nonstructured pattern of non-zero weights, which is unfriendly for efficient computation in modern hardware systems (Lebedev & Lempitsky (2016)). Previous study (Wen et al. (2016)) on sparse matrix multiplication in GPUs showed that the speedup2 was either counterproductive or ignorable. More specific, with sparsity3 of $6 7 . 6 \%$ , $9 2 . 4 \%$ , $9 7 . 2 \%$ , $9 6 . 6 \%$ and $9 4 . 3 \%$ in weight matrices of AlexNet, the speedup was $0 . 2 5 \times$ , $0 . 5 2 \times$ , $1 . 3 8 \times$ , $1 . 0 4 \times$ , and $1 . 3 6 \times$ , respectively. This problem also exists in CPUs. Fig. 1 shows that non-structured pattern in sparsity limits the speedup. We only starts to observe speed gain when the sparsity is beyond $8 0 \%$ , and the speedup is about $3 \times$ to $4 \times$ even when the sparsity is $9 5 \%$ which is far below the theoretical $2 0 \times$ . In this work, we focus on learning structurally sparse LSTMs for computation efficiency. More specific, we aim to reduce the number of basic structures simultaneously during learning, such that the obtained LSTMs have the original schematic with dense connections but with smaller sizes of these basic structures. Such compact models have structured sparsity, with columns and rows in weight matrices removed, whose computation efficiency is shown in Fig. 1. Moreover, off-the-shelf libraries in deep learning frameworks can be directly utilized to deploy the reduced LSTMs. Details should be explained.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Speedups of matrix multiplication using non-structured and structured sparsity. Speeds are measured in Intel MKL implementations in Intel Xeon CPU E5-2673 v3 $@$ $2 . 4 0 \mathrm { G H z }$ . General matrix-matrix multiplication (GEMM) of $\mathbf { W } \cdot \mathbf { X }$ is implemented by cblas sgemm. The matrix sizes are selected to reflect commonly used GEMMs in LSTMs. For example, (a) represents GEMM in LSTMs with hidden size 1500, input size 1500 and batch size 10. To accelerate GEMM by sparsity, W is sparsified. In non-structured sparsity approach, W is randomly sparsified and encoded as Compressed Sparse Row format for sparse computation (using mkl scsrmm); in structured sparsity approach, $2 k$ columns and $4 k$ rows in W are removed to match the same level of sparsity (i.e., the percentage of removed parameters) for faster GEMM under smaller sizes.
|
| 19 |
+
|
| 20 |
+
There is a vital challenge originated from recurrent units: as the basic structures interweave with each other, independently removing these structures can result in mismatch of their dimensions and then inducing invalid recurrent units. The problem does not exist in CNNs, where neurons (or filters) can be independently removed without violating the usability of the final network structure. One of our key contributions is to identify the structure inside RNNs that shall be considered as a group to most effectively explore sparsity in basic structures. More specific, we propose Intrinsic Sparse Structures (ISS) as groups to achieve the goal. By removing weights associated with one component of ISS, the sizes/dimensions (of basic structures) are simultaneously reduced by one.
|
| 21 |
+
|
| 22 |
+
We evaluated our method by LSTMs and RHNs in language modeling of Penn Treebank dataset (Marcus et al. (1993)) and machine Question Answering of SQuAD dataset (Rajpurkar et al. (2016)). Our approach works both in fine-tuning and in training from scratch. In a RNN with two stacked LSTM layers with hidden sizes of 1500 (i.e., 1500 components of ISS) for language modeling (Zaremba et al. (2014)), our method learns that the sizes of 373 and 315 in the first and second LSTMs, respectively, are sufficient for the same perplexity. It achieves $1 0 . 5 9 \times$ speedup of inference time. The result is obtained by training from scratch with the same number of epochs. Directly training LSTMs with sizes of 373 and 315 cannot achieve the same perplexity, which proves the advantage of learning ISS for model compression. Encouraging results are also obtained in more compact and state-of-the-art models – the RHN models (Zilly et al. (2017)) and BiDAF model (Seo et al. (2017)).
|
| 23 |
+
|
| 24 |
+
# 2 RELATED WORK
|
| 25 |
+
|
| 26 |
+
A major approach in DNN compression is to reduce the complexity of structures within DNNs. The studies can be categorized to three classes: removing redundant structures in original DNNs, approximating the original function of DNNs (Denil et al. (2013), Jaderberg et al. (2014), Hinton et al. (2015), Lu et al. (2016), Prabhavalkar et al. (2016), Molchanov et al. (2017)), and designing DNNs with inherently compact structures (Szegedy et al. (2015), He et al. (2016), Wu et al. (2017), Bradbury et al. (2016)). Our method belongs to the first category.
|
| 27 |
+
|
| 28 |
+
Research on removing redundant structures in Feed-forward Neural Networks (FNNs), typically in CNNs, has been extensively studied. Based on $\ell _ { 1 }$ regularization (Liu et al. (2015), Park et al. (2017)) or connection pruning (Han et al. (2015b), Guo et al. (2016)), the number of connections/parameters can be dramatically reduced. Group Lasso based methods were proved to be effective in reducing coarse-grain structures (e.g., neurons, filters, channels, filter shapes, and even layers) in CNNs (Wen et al. (2016), Alvarez & Salzmann (2016), Lebedev & Lempitsky (2016), Yoon & Hwang (2017)). For instance, Wen et al. (2016) reduced the number of layers from 32 to 18 in ResNet without any accuracy loss for CIFAR-10 dataset. A recent work by Narang et al. (2017) advances connection pruning techniques for RNNs. It compresses the size of Deep Speech 2 (Amodei et al. (2016)) from $2 6 8 \mathrm { M B }$ to around $3 2 \mathrm { { M B } }$ . However, to the best of our knowledge, little work has been carried out to reduce coarse-grain structures beyond fine-grain connections in RNNs. To fill this gap, our work targets to develop a method that can learn to reduce the number of basic structures within LSTM units. After learning those structures, final LSTMs are still regular LSTMs with the same connectivity, but have the sizes reduced.
|
| 29 |
+
|
| 30 |
+
Another line of related research is Structure Learning of FNNs or CNNs. Zoph & Le (2017) uses reinforcement learning to search good neural architectures. Philipp & Carbonell (2017) dynamically adds and eliminates neurons in FNNs by using group Lasso regularization. Cortes et al. (2017) gradually adds sub-networks to current networks to incrementally reduce the objective function. All these works focused on finding optimal structures in FNNs or CNNs for classification accuracy. In contrast, this work aims at learning compact structures in LSTMs for model compression.
|
| 31 |
+
|
| 32 |
+
# 3 LEARNING INTRINSIC SPARSE STRUCTURES
|
| 33 |
+
|
| 34 |
+
# 3.1 INTRINSIC SPARSE STRUCTURES
|
| 35 |
+
|
| 36 |
+
The computation within LSTMs is (Hochreiter & Schmidhuber (1997))
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
\begin{array} { r l } & { \mathbf i _ { t } = \sigma \left( \mathbf x _ { t } \cdot \mathbf W _ { x i } + \mathbf h _ { t - 1 } \cdot \mathbf W _ { h i } + \mathbf b _ { i } \right) } \\ & { \mathbf f _ { t } = \sigma \left( \mathbf x _ { t } \cdot \mathbf W _ { x f } + \mathbf h _ { t - 1 } \cdot \mathbf W _ { h f } + \mathbf b _ { f } \right) } \\ & { \mathbf o _ { t } = \sigma \left( \mathbf x _ { t } \cdot \mathbf W _ { x o } + \mathbf h _ { t - 1 } \cdot \mathbf W _ { h o } + \mathbf b _ { o } \right) } \\ & { \mathbf u _ { t } = t a n h \left( \mathbf x _ { t } \cdot \mathbf W _ { x u } + \mathbf h _ { t - 1 } \cdot \mathbf W _ { h u } + \mathbf b _ { u } \right) } \\ & { \mathbf c _ { t } = \mathbf f _ { t } \odot \mathbf c _ { t - 1 } + \mathbf i _ { t } \odot \mathbf u _ { t } } \\ & { \mathbf h _ { t } = \mathbf o _ { t } \odot t a n h \left( \mathbf c _ { t } \right) } \end{array}
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
where $\odot$ is element-wise multiplication, $\sigma ( \cdot )$ is sigmoid function, and $t a n h ( \cdot )$ is hyperbolic tangent function. Vectors are row vectors. Ws are weight matrices, which transform the concatenation (of hidden states $\mathbf { h } _ { t - 1 }$ and inputs $\mathbf { x } _ { t }$ ) to input updates $\mathbf { u } _ { t }$ and gates $( \mathbf { i } _ { t } , \mathbf { f } _ { t }$ and $\mathbf { o } _ { t }$ ). Fig. 2 is the schematic of LSTMs in the layout of Olah (2015). The transformations by Ws and the corresponding nonlinear functions are illustrated in rectangle blocks. Our goal is to reduce the size of this sophisticated structure within LSTMs, meanwhile maintaining the original schematic. Because of element-wise operators $ \mathrm { ( } ^ { 6 6 } \mathrm { ( } \oplus ^ { 3 } $ and “ $\circled { \times } \cdot$ ”), all vectors along the blue band in Fig. 2 must have the same dimension. We call this constraint as “dimension consistency”. The vectors required to obey the dimension consistency include input updates, all gates, hidden states, cell states, and outputs. Note that hidden states are usually outputs connected to classifier layer or stacked LSTM layers. As can be seen in Fig. 2, vectors (along the blue band) interweave with each other so removing an individual component from one or a few vectors independently can result in the violation of dimension consistency.
|
| 43 |
+
|
| 44 |
+

|
| 45 |
+
Figure 2: Intrinsic Sparse Structures (ISS) in LSTM units.
|
| 46 |
+
|
| 47 |
+

|
| 48 |
+
Figure 3: Applying Intrinsic Sparse Structures in weight matrices.
|
| 49 |
+
|
| 50 |
+
To overcome this, we propose Intrinsic Sparse Structures (ISS) within LSTMs as shown by the blue band in Fig. 2. One component of ISS is highlighted as the white strip. By decreasing the size of ISS (i.e., the width of the blue band), we are able to simultaneously reduce the dimensions of basic structures.
|
| 51 |
+
|
| 52 |
+
To learn sparse ISS, we turn to weight sparsifying. There are totally eight weight matrices in Eq. (1). We organize them in the form of Fig. 3 as basic LSTM cells in TensorFlow. We can remove one component of ISS by zeroing out all associated weights in the white rows and white columns in Fig. 3. Why? Suppose the $k$ -th hidden state of $\mathbf { h }$ is removable, then the $k$ -th row in the lower four weight matrices can be all zeros (as shown by the left white horizontal line in Fig. 3), because those weights are on connections receiving the $k$ -th useless hidden state. Likewise, all connections receiving the $k$ -th hidden state in next layer(s) can be removed as shown by the right white horizontal line. Note that next layer(s) can be an output layer, LSTM layers, fully-connected layers, or a mix of them. ISS overlay two or more layers, without explicit explanation, we refer to the first LSTM layer as the ownership of ISS. When the $k$ -th hidden state turns useless, the $k$ -th output gate and $k$ -th cell state generating this hidden state are removable. As the $k$ -th output gate is generated by the $k$ -th column in $\mathbf { W } _ { x o }$ and $\mathbf { W } _ { h o }$ , these weights can be zeroed out (as shown by the fourth vertical white line in Fig. 3). Tracing back against the computation flow in Fig. 2, we can reach similar conclusions for forget gates, input gates and input updates, as respectively shown by the first, second and third vertical line in Fig. 3. For convenience, we call the weights in white rows and columns as an “ISS weight group”. Although we propose ISS in LSTMs, variants of ISS for vanilla RNNs, Gated Recurrent Unit (GRU) (Cho et al. (2014)), and Recurrent Highway Networks (RHNs) (Zilly et al. (2017)) can also be realized based on the same philosophy.
|
| 53 |
+
|
| 54 |
+
For even a medium-scale LSTM, the number of weights in one ISS weight group can be very large. It seems to be very aggressive to simultaneously slaughter so many weights to maintain the original recognition performance. However, the proposed ISS intrinsically exists within LSTMs and can even be unveiled by independently sparsifying each weight using $\ell _ { 1 }$ -norm regularization. The experimental result is covered in Appendix A. It unveils that sparse ISS intrinsically exist in LSTMs and the learning process can easily converge to the status with a high ratio of ISS removed. In Section 3.2, we propose a learning method to explicitly remove much more ISS than the implicit $\ell _ { 1 }$ -norm regularization.
|
| 55 |
+
|
| 56 |
+
# 3.2 LEARNING METHOD
|
| 57 |
+
|
| 58 |
+
Suppose $\mathbf { w } _ { k } ^ { ( n ) }$ is a vector of all weights in the $k$ -th component of ISS in the $n$ -th LSTM layer $1 \leq n \leq N$ and $1 \leq k \leq K ^ { ( n ) } )$ , where $N$ is the number of LSTM layers and $K ^ { ( n ) }$ is the number of ISS components (i.e., hidden size) of the $n$ -th LSTM layer. The optimization goal is to remove as many “ISS weight groups” $\mathbf { w } _ { k } ^ { ( n ) }$ as possible without losing accuracy. Methods to remove weight groups (such as filters, channels and layers) have been successfully studied in CNNs as summarized in Section 2. However, how these methods perform in RNNs is unknown. Here, we extend the group Lasso based methods (Yuan & Lin (2006)) to RNNs for ISS sparsity learning. More specific, the group Lasso regularization is added to the minimization function in order to encourage sparsity in ISS. Formally, the ISS regularization is
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
R ( \mathbf { w } ) = \sum _ { n = 1 } ^ { N } \sum _ { k = 1 } ^ { K ^ { ( n ) } } \left| \left| \mathbf { w } _ { k } ^ { ( n ) } \right| \right| _ { 2 } ,
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
where w is the vector of all weights and $| | \cdot | | _ { 2 }$ is $\ell _ { 2 }$ -norm (i.e., Euclidean length). In Stochastic Gradient Descent (SGD) training, the step to update each ISS weight group becomes
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\mathbf { w } _ { k } ^ { ( n ) } \mathbf { w } _ { k } ^ { ( n ) } - \eta \cdot ( \frac { \partial E ( \mathbf { w } ) } { \partial \mathbf { w } _ { k } ^ { ( n ) } } + \lambda \cdot \frac { \mathbf { w } _ { k } ^ { ( n ) } } { \mathbf { w } _ { k } ^ { ( n ) } _ { 2 } } ) ,
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where $E ( \mathbf { w } )$ is data loss, $\eta$ is learning rate and $\lambda > 0$ is the coefficient of group Lasso regularization to trade off recognition accuracy and ISS sparsity. The regularization gradient, i.e., the last term in Eq. (3), is a unit vector. It constantly squeezes the Euclidean length of each w(n)k t o zero, such that, a high portion of ISS components can be enforced to fully-zeros after learning. To avoid division by zero in the computation of regularization gradient, we can add a tiny number $\epsilon$ in $| | \cdot | | _ { 2 }$ , that is,
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\left| \left| \mathbf { w } _ { k } ^ { ( n ) } \right| \right| _ { 2 } \triangleq \sqrt { \epsilon + \sum _ { j } \left( w _ { k j } ^ { ( n ) } \right) ^ { 2 } } ,
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
where wkj is the $j$ -th element of $\mathbf { w } _ { k } ^ { ( n ) }$ . We set $\epsilon = 1 . 0 e - 8$ . The learning method can effectively squeeze many groups near zeros, but it is very hard to exactly stabilize them as zeros because of the always-present fluctuating weight updates. Fortunately, the fluctuation is within a tiny ball centered at zero. To stabilize the sparsity during training, we zero out the weights whose absolute values are smaller than a pre-defined threshold $\tau$ . The process of thresholding is applied per mini-batch.
|
| 77 |
+
|
| 78 |
+
# 4 EXPERIMENTS
|
| 79 |
+
|
| 80 |
+
Our experiments use published models as baselines. The application domains include language modeling of Penn TreeBank and machine Question Answering of SQuAD dataset. For more comprehensive evaluation, we sparsify ISS in LSTM models with both a large hidden size of 1500 and a small hidden size of 100. We also extended ISS approach to state-of-the-art Recurrent Highway Networks (RHNs) (Zilly et al. (2017)) to reduce the number of units per layer. We maximize threshold $\tau$ to fully exploit the benefit. For a specific application, we preset $\tau$ by cross validation. The maximum $\tau$ which sparsifies the dense model (baseline) without deteriorating its performance is selected. The validation of $\tau$ is performed only once and no training effort is needed. $\tau$ is $1 . 0 e - 4$ for the stacked LSTMs in Penn TreeBank, and it is $4 . 0 e - 4$ for the RHN and the BiDAF model. We used HyperDrive by Rasley et al. (2017) to explore the hyperparameter of $\lambda$ . More details can be found in our source code.
|
| 81 |
+
|
| 82 |
+
To measure the inference speed, the experiments were run on a dual socket Intel Xeon CPU E5- $2 6 7 3 ~ \mathrm { v } 3 ~ \textcircled { \div } \ 2 . 4 0 \mathrm { G H z }$ processor with a total of 24 cores (12 per socket) and 128GB of memory. Intel MKL library 2017 update 2 was used for matrix-multiplication operations. OpenMP runtime was utilized for parallelism. We used Intel $\mathrm { C } { + + }$ Compiler 17.0 to generate executables that were run on Windows Server 2016. Each of the experiments was run for 1000 iterations, and the execution time was averaged to find the execution latency.
|
| 83 |
+
|
| 84 |
+
Table 1: Learning ISS sparsity from scratch in stacked LSTMs.
|
| 85 |
+
|
| 86 |
+
<table><tr><td>Method</td><td>Dropout keep ratio</td><td>Perplexity (validate, test)</td><td>ISS #in (1st,2nd) LSTM</td><td>Weight #</td><td>Total time*</td><td>Speedup</td><td>Mult-add reduction†</td></tr><tr><td>baseline</td><td>0.35</td><td>(82.57, 78.57)</td><td>(1500,1500)</td><td>66.0M</td><td>157.0ms</td><td>1.00×</td><td>1.00×</td></tr><tr><td>ISS</td><td>0.60</td><td>(82.59,78.65) (80.24,76.03)</td><td>(373,315) (381,535)</td><td>21.8M 25.2M</td><td>14.82ms 22.11ms</td><td>10.59× 7.10×</td><td>7.48× 5.01×</td></tr><tr><td>direct design</td><td>0.55</td><td>(90.31, 85.66)</td><td>(373,315)</td><td>21.8M</td><td>14.82ms</td><td>10.59×</td><td>7.48x</td></tr></table>
|
| 87 |
+
|
| 88 |
+
\* Measured with 10 batch size and 30 unrolled steps. † The reduction of multiplication-add operations in matrix multiplication. Defined as (original Mult-add)/(left Mult-add)
|
| 89 |
+
|
| 90 |
+

|
| 91 |
+
Figure 4: Intrinsic Sparse Structures learned by group Lasso regularization (zoom in for better view). Original weight matrices are plotted, where blue dots are nonzero weights and white ones refer zeros. For better visualization, original matrices are evenly down-sampled by $1 0 \times 1 0$ .
|
| 92 |
+
|
| 93 |
+
# 4.1 LANGUAGE MODELING
|
| 94 |
+
|
| 95 |
+
# 4.1.1 STACKED LSTMS
|
| 96 |
+
|
| 97 |
+
A RNN with two stacked LSTM layers for language modeling (Zaremba et al. (2014)) is selected as the baseline. It has hidden sizes of 1500 (i.e., 1500 components of ISS) in both LSTM units. The output layer has a vocabulary of 10000 words. The dimension of word embedding in the input layer is 1500. Word embedding layer is not sparsified because the computation of selecting a vector from a matrix is very efficient. The same training scheme as the baseline is adopted to learn ISS sparsity, except a larger dropout keep ratio of 0.6 versus 0.35 of the baseline because group Lasso regularization can also avoid over-fitting. All models are trained from scratch for 55 epochs. The results are shown in Table 1. Note that, when trained using dropout keep ratio of 0.6 without adopting group Lasso regularization, the baseline over-fits and the lowest validation perplexity is 97.73. The trade-off of perplexity and sparsity is controlled by $\lambda$ . In the second row, with tiny perplexity difference from baseline, our approach can reduce the number of ISS in the first and second LSTM unit from 1500, down to 373 and 315, respectively. It reduces the model size from 66.0M to 21.8M and achieves $1 0 . 5 9 \times$ speedup. Remarkably, the practical speedup $( 1 0 . 5 9 \times )$ even goes beyond theoretical mult-add reduction $( 7 . 4 8 \times )$ as shown in Table 1 —which comes from the increased computational efficiency. When applying structured sparsity, the underlying weight matrices become smaller so as to fit into the L3 cache with good locality, which improves the FLOPS (floating point operations per second). This is a key advantage of our approach over non-structurally sparse RNNs generated by connection pruning (Narang et al. (2017)), which suffers from irregular memory access pattern and inferior-theoretical speedup. At last, when learning a compact structure, our method can perform as structure regularization to avoid overfitting. As shown in the third row in Table 1, lower perplexity is achieved by even a smaller (25.2M) and faster $( 7 . 1 0 \times )$ model. Its learned weight matrices are visualized in Fig. 4, where 1119 and 965 ISS components shown by white strips are removed in the first and second LSTM, respectively.
|
| 98 |
+
|
| 99 |
+
A straightforward way to reduce model complexity is to directly design a RNN with a smaller hidden size and train from scratch. Compare with direct design approach, our ISS method can automatically learn optimal structures within LSTMs. More importantly, compact models learned by ISS method have lower perplexity, comparing with direct design method. To evaluate it, we directly design a RNN with exactly the same structure of the second RNN in Table 1 and train it from scratch instead of learning ISS from a larger RNN. The result is included in the last row of Table 1. We tuned dropout keep ratio to get best perplexity for the directly-designed RNN. The final test perplexity is 85.66, which is 7.01 higher that our ISS method.
|
| 100 |
+
|
| 101 |
+
Table 2: Learning ISS sparsity from scratch in RHNs.
|
| 102 |
+
|
| 103 |
+
<table><tr><td>Method</td><td>入</td><td>Perplexity (validate, test)</td><td>RHN width</td><td>Parameter #</td></tr><tr><td>baseline</td><td>0.0</td><td>(67.9, 65.4)</td><td>830</td><td>23.5M</td></tr><tr><td>ISs</td><td>0.004</td><td>(67.5, 65.0)</td><td>726</td><td>18.9M</td></tr><tr><td>ISS*</td><td>0.005</td><td>(68.1, 65.4)</td><td>517</td><td>11.1M</td></tr><tr><td>ISS*</td><td>0.006</td><td>(70.3, 67.7)</td><td>403</td><td>7.6M</td></tr><tr><td>ISS*</td><td>0.007</td><td>(74.5, 71.2)</td><td>328</td><td>5.7M</td></tr></table>
|
| 104 |
+
|
| 105 |
+
\* All dropout ratios are multiplied by $0 . 6 \times$
|
| 106 |
+
|
| 107 |
+
# 4.1.2 EXTENSION TO RECURRENT HIGHWAY NETWORKS
|
| 108 |
+
|
| 109 |
+
Recurrent Highway Networks (RHN) (Zilly et al. (2017)) is a class of state-of-the-art recurrent models, which enable “step-to-step transition depths larger than one”. In a RHN, we define the number of units per layer as RHN width. Specifically, we select the “Variational $\mathrm { R H N } + \mathrm { W T } ^ { \dag }$ model in Table 1 of Zilly et al. (2017) as the baseline. It has depth 10 and width 830, with totally 23.5M parameters. In a nutshell, our approach can reduce the RHN width from 830 to 517 without losing perplexity.
|
| 110 |
+
|
| 111 |
+
Following the same idea of identifying the “ISS weight groups” to reduce the size of basic structures in LSTMs, we can identify the groups in RHNs to reduce the RHN width. In brief, one group include corresponding columns/rows in weight matrices of the $H$ nonlinear transform, of the $T$ and $C$ gates, and of the embedding and output layers. The group size is 46520. The groups are indicated by JSON files in our source code4. By learning ISS in RHNs, we can simultaneously reduce the dimension of word embedding and the number of units per layer.
|
| 112 |
+
|
| 113 |
+
Table 2 summarizes results. All experiments are trained from scratch with the same hyperparameters in the baseline, except that smaller dropout ratios are used in ISS learning. Larger $\lambda$ , smaller RHN width but higher perplexity. More importantly, without losing perplexity, our approach can learn a smaller model with RHN width 517 from an initial model with RHN width 830. This reduces the model size to 11.1M, which is $5 2 . 8 \%$ reduction. Moreover, ISS learning can find a smaller RHN model with width 726, meanwhile improve the state-of-the-art perplexity as shown by the second entry in Table 2.
|
| 114 |
+
|
| 115 |
+
# 4.2 MACHINE READING COMPREHENSION
|
| 116 |
+
|
| 117 |
+
We evaluate ISS method by state-of-the-art dataset (SQuAD) and model (BiDAF). SQuAD (Rajpurkar et al. (2016)) is a recently released reading comprehension dataset, crowdsourced from 100, $0 0 0 +$ question-answer pairs on $5 0 0 +$ Wikipedia articles. ExactMatch (EM) and F1 scores are two major metrics for the task5. The higher those scores are, the better the model is. We adopt BiDAF (Seo et al. (2017)) to evaluate how ISS method works in small LSTM units. BiDAF is a compact machine Question Answering model with totally 2.69M weights. The ISS sizes are only 100 in all LSTM units. The implementation of BiDAF is made available by its authors 6.
|
| 118 |
+
|
| 119 |
+
BiDAF has character, word and contextual embedding layers to extract representations from input sentences, following which are bi-directional attention layer, modeling layer, and final output layer. LSTM units are used in contextual embedding layer, modeling layer, and output layer. All LSTMs are bidirectional (Schuster & Paliwal (1997)). In a bidirectional LSTM, there are one forward plus one backward LSTM branch. The two branches share inputs and their outputs are concatenated for next stacked layers. We found that it is hard to remove ISS components in contextual embedding layer, because the representations are relatively dense as it is close to inputs and the original hidden size (100) is relatively small. In our experiments, we exclude LSTMs in contextual embedding layer and sparsify all other LSTM layers. Those LSTM layers are the computation bottleneck of BiDAF.
|
| 120 |
+
|
| 121 |
+
Table 3: Remaining ISS components in BiDAF by fine-tuning.
|
| 122 |
+
|
| 123 |
+
<table><tr><td>EM</td><td>F1</td><td>ModFwd1</td><td>ModBwd1</td><td>ModFwd2</td><td>ModBwd2</td><td>OutFwd</td><td>OutBwd</td><td>weight #</td><td>Total time*</td></tr><tr><td>67.98</td><td>77.85</td><td>100</td><td>100</td><td>100</td><td>100</td><td>100</td><td>100</td><td>2.69M</td><td>6.20ms</td></tr><tr><td>67.21</td><td>76.71</td><td>100</td><td>95</td><td>78</td><td>82</td><td>71</td><td>52</td><td>2.08M</td><td>5.79ms</td></tr><tr><td>66.59</td><td>76.40</td><td>84</td><td>90</td><td>38</td><td>46</td><td>34</td><td>21</td><td>1.48M</td><td>4.52ms</td></tr><tr><td>65.29</td><td>75.47</td><td>54</td><td>47</td><td>22</td><td>30</td><td>18</td><td>12</td><td>1.03M</td><td>3.54ms</td></tr><tr><td>64.81</td><td>75.22</td><td>52</td><td>50</td><td>19</td><td>26</td><td>15</td><td>12</td><td>1.01M</td><td>3.51ms</td></tr></table>
|
| 124 |
+
|
| 125 |
+
Measured with batch size 1.
|
| 126 |
+
|
| 127 |
+
Table 4: Remaining ISS components in BiDAF by training from scratch.
|
| 128 |
+
|
| 129 |
+
<table><tr><td>EM</td><td>F1</td><td>ModFwd1</td><td>ModBwd1</td><td>ModFwd2</td><td>ModBwd2</td><td>OutFwd</td><td>OutBwd</td><td>weight #</td><td>Total time*</td></tr><tr><td>67.98</td><td>77.85</td><td>100</td><td>100</td><td>100</td><td>100</td><td>100</td><td>100</td><td>2.69M</td><td>6.20ms</td></tr><tr><td>67.36</td><td>77.16</td><td>87</td><td>81</td><td>87</td><td>92</td><td>74</td><td>96</td><td>2.29M</td><td>5.83ms</td></tr><tr><td>66.32</td><td>76.22</td><td>51</td><td>33</td><td>42</td><td>58</td><td>37</td><td>26</td><td>1.17M</td><td>4.46ms</td></tr><tr><td>65.36</td><td>75.78</td><td>20</td><td>33</td><td>40</td><td>38</td><td>31</td><td>16</td><td>0.95M</td><td>3.59ms</td></tr><tr><td>64.60</td><td>74.99</td><td>23</td><td>22</td><td>35</td><td>35</td><td>25</td><td>14</td><td>0.88M</td><td>2.74ms</td></tr></table>
|
| 130 |
+
|
| 131 |
+
Measured with batch size 1.
|
| 132 |
+
|
| 133 |
+
We profiled the computation time on CPUs, and find those LSTM layers (excluding contextual embedding layer) consume $7 6 . 4 7 \%$ of total inference time. There are three bi-directional LSTM layers we will sparsify, two of which belong to the modeling layer, and one belongs to the output layer. More details of BiDAF are covered by Seo et al. (2017). For brevity, we mark the forward (backward) path of the 1st bi-directional LSTM in the modeling layer as ModFwd1 (ModBwd1). Similarly, ModFwd2 and ModBwd2 are for the 2nd bi-directional LSTM. Forward (backward) LSTM path in the output layer are marked as OutFwd and OutBwd.
|
| 134 |
+
|
| 135 |
+
As discussed in Section 3.1, multiple parallel layers can receive the hidden states from the same LSTM layer and all connections (weights) receive those hidden states belong to the same ISS. For instance, ModFwd2 and ModBwd2 both receive hidden states of ModFwd1 as inputs, therefore the $k$ -th “ISS weight group” includes the $k$ -th rows of weights in both ModFwd2 and ModBwd2, plus the weights in the $k$ -th ISS component within ModFwd1. For simplicity, we use “ISS of ModFwd1” to refer to the whole group of weights. Structures of six ISS are included in Table 5 in Appendix B. We learn ISS sparsity in BiDAF by both fine-tuning the baseline and training from scratch. All the training schemes keep as the same as the baseline except applying a higher dropout keep ratio. After training, we zero out weights whose absolute values are smaller than 0.02. This does not impact EM and F1 scores, but increase sparsity.
|
| 136 |
+
|
| 137 |
+
Table 3 shows the EM, F1, the number of remaining ISS components, model size, and inference speed. The first row is the baseline BiDAF. Other rows are obtained by fine-tuning baseline using ISS regularization. In the second row by learning ISS, with small EM and F1 loss, we can reduce ISS in all LSTMs except ModFwd1. For example, almost half of the ISS components are removed in OutBwd. By increasing the strength of group Lasso regularization $( \lambda )$ , we can increase the ISS sparsity by losing some EM/F1 scores. The trade-off is listed in Table 3. With 2.63 F1 score loss, the sizes of OutFwd and OutBwd can be reduced from original 100 to 15 and 12, respectively. At last, we find it hard to reduce ISS sizes without losing any EM/F1 score. This implies that BiDAF is compact enough and its scale is suitable for both computation and accuracy. However, our method can still significantly compress this compact model under acceptable performance loss.
|
| 138 |
+
|
| 139 |
+
At last, instead of fine-tuning baseline, we train BiDAF from scratch with ISS learning. The results are summarized in Table 4. Our approach also works well when training from scratch. Overall, training from scratch balances the sparsity across all layers better than fine-tuning, which results in even better compression of model size and speedup of inference time. The histogram of vector lengths of “ISS weight groups” is plotted in Appendix C.
|
| 140 |
+
|
| 141 |
+
# 5 CONCLUSION
|
| 142 |
+
|
| 143 |
+
We proposed Intrinsic Sparse Structures (ISS) within LSTMs and its learning method to simultaneously reduce the sizes of input updates, gates, hidden states, cell states and outputs within the sophisticated LSTM structure. By learning ISS, a structurally sparse LSTM can be obtained, which essentially is a regular LSTM with reduced hidden dimension. Thus, no software or hardware specific customization is required to get storage saving and computation acceleration. Though ISS is proposed with LSTMs, it can be easily extended to vanilla RNNs, Gated Recurrent Unit (GRU) (Cho et al. (2014)), and Recurrent Highway Networks (RHNs) (Zilly et al. (2017)).
|
| 144 |
+
|
| 145 |
+
# ACKNOWLEDGMENTS
|
| 146 |
+
|
| 147 |
+
Thank researchers and engineers in Microsoft for giving valuable feedback on this work, with acknowledgments to Wei He, Freddie Zhang, Yi Liu, Jacob Devlin and Chen Zhou. Also thank Jeff Rasley (intern in Microsoft Research, Brown University) for helping me to use HyperDrive (Rasley et al. (2017)) for hyper-parameter exploration. This work was supported in part by NSF CCF1744082, NSF CCF-1725456 and DOE SC0017030. Any opinions, findings, conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of NSF, DOE, or their contractors.
|
| 148 |
+
|
| 149 |
+
# REFERENCES
|
| 150 |
+
|
| 151 |
+
Jose M Alvarez and Mathieu Salzmann. Learning the number of neurons in deep networks. In Advances in Neural Information Processing Systems, 2016.
|
| 152 |
+
|
| 153 |
+
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.
|
| 154 |
+
|
| 155 |
+
James Bradbury, Stephen Merity, Caiming Xiong, and Richard Socher. Quasi-recurrent neural networks. arXiv:1611.01576, 2016.
|
| 156 |
+
|
| 157 |
+
Kyunghyun Cho, Bart Van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Hol- ¨ ger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder-decoder for statistical machine translation. arXiv:1406.1078, 2014.
|
| 158 |
+
|
| 159 |
+
Corinna Cortes, Xavi Gonzalvo, Vitaly Kuznetsov, Mehryar Mohri, and Scott Yang. Adanet: Adaptive structural learning of artificial neural networks. In Proceedings of the 34th International Conference on Machine Learning, pp. 874–883, 2017.
|
| 160 |
+
|
| 161 |
+
Misha Denil, Babak Shakibi, Laurent Dinh, Nando de Freitas, et al. Predicting parameters in deep learning. In Advances in Neural Information Processing Systems, 2013.
|
| 162 |
+
|
| 163 |
+
Yiwen Guo, Anbang Yao, and Yurong Chen. Dynamic network surgery for efficient dnns. In Advances In Neural Information Processing Systems, 2016.
|
| 164 |
+
|
| 165 |
+
Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. arXiv:1510.00149, 2015a.
|
| 166 |
+
|
| 167 |
+
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, 2015b.
|
| 168 |
+
|
| 169 |
+
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.
|
| 170 |
+
|
| 171 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
|
| 172 |
+
|
| 173 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 174 |
+
|
| 175 |
+
Max Jaderberg, Andrea Vedaldi, and Andrew Zisserman. Speeding up convolutional neural networks with low rank expansions. arXiv:1405.3866, 2014.
|
| 176 |
+
|
| 177 |
+
Vadim Lebedev and Victor Lempitsky. Fast convnets using group-wise brain damage. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2554–2564, 2016.
|
| 178 |
+
|
| 179 |
+
Hao Li, Asim Kadav, Igor Durdanovic, Hanan Samet, and Hans Peter Graf. Pruning filters for efficient convnets. In International Conference on Learning Representations (ICLR), 2017.
|
| 180 |
+
|
| 181 |
+
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.
|
| 182 |
+
|
| 183 |
+
Christos Louizos, Karen Ullrich, and Max Welling. Bayesian compression for deep learning. arXiv:1705.08665, 2017.
|
| 184 |
+
|
| 185 |
+
Zhiyun Lu, Vikas Sindhwani, and Tara N Sainath. Learning compact recurrent neural networks. In Acoustics, Speech and Signal Processing (ICASSP), 2016 IEEE International Conference on, pp. 5960–5964. IEEE, 2016.
|
| 186 |
+
|
| 187 |
+
Mitchell P Marcus, Mary Ann Marcinkiewicz, and Beatrice Santorini. Building a large annotated corpus of english: The penn treebank. Computational linguistics, 19(2):313–330, 1993.
|
| 188 |
+
|
| 189 |
+
Pavlo Molchanov, Stephen Tyree, Tero Karras, Timo Aila, and Jan Kautz. Pruning convolutional neural networks for resource efficient inference. In International Conference on Learning Representations (ICLR), 2017.
|
| 190 |
+
|
| 191 |
+
Sharan Narang, Gregory Diamos, Shubho Sengupta, and Erich Elsen. Exploring sparsity in recurrent neural networks. arXiv:1704.05119, 2017.
|
| 192 |
+
|
| 193 |
+
Christopher Olah. Understanding lstm networks. GITHUB blog, posted on August, 27:2015, 2015.
|
| 194 |
+
|
| 195 |
+
Jongsoo Park, Sheng Li, Wei Wen, Ping Tak Peter Tang, Hai Li, Yiran Chen, and Pradeep Dubey. Faster cnns with direct sparse convolutions and guided pruning. In International Conference on Learning Representations (ICLR), 2017.
|
| 196 |
+
|
| 197 |
+
George Philipp and Jaime G Carbonell. Nonparametric neural networks. In International Conference on Learning Representations (ICLR), 2017.
|
| 198 |
+
|
| 199 |
+
Rohit Prabhavalkar, Ouais Alsharif, Antoine Bruguier, and Lan McGraw. On the compression of recurrent neural networks with an application to lvcsr acoustic modeling for embedded speech recognition. In Acoustics, Speech and Signal Processing (ICASSP), 2016 IEEE International Conference on, pp. 5970–5974. IEEE, 2016.
|
| 200 |
+
|
| 201 |
+
Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: $1 0 0 { , } 0 0 0 { + }$ questions for machine comprehension of text. arXiv:1606.05250, 2016.
|
| 202 |
+
|
| 203 |
+
Jeff Rasley, Yuxiong He, Feng Yan, Olatunji Ruwase, and Rodrigo Fonseca. HyperDrive: Exploring Hyperparameters with POP Scheduling. In Proceedings of the 18th International Middleware Conference, Middleware ’17. ACM, 2017.
|
| 204 |
+
|
| 205 |
+
Mike Schuster and Kuldip K Paliwal. Bidirectional recurrent neural networks. IEEE Transactions on Signal Processing, 45(11):2673–2681, 1997.
|
| 206 |
+
|
| 207 |
+
Minjoon Seo, Aniruddha Kembhavi, Ali Farhadi, and Hannaneh Hajishirzi. Bidirectional attention flow for machine comprehension. In International Conference on Learning Representations (ICLR), 2017.
|
| 208 |
+
|
| 209 |
+
Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1–9, 2015.
|
| 210 |
+
|
| 211 |
+
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, 2016.
|
| 212 |
+
|
| 213 |
+
Wei Wen, Cong Xu, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Coordinating filters for faster deep neural networks. In The IEEE International Conference on Computer Vision (ICCV), October 2017.
|
| 214 |
+
|
| 215 |
+
Chunpeng Wu, Wei Wen, Tariq Afzal, Yongmei Zhang, Yiran Chen, and Hai Li. A compact dnn: Approaching googlenet-level accuracy of classification and domain adaptation. In Proceedings of the IEEE conference on computer vision and pattern recognition, 2017.
|
| 216 |
+
|
| 217 |
+
Jaehong Yoon and Sung Ju Hwang. Combined group and exclusive sparsity for deep neural networks. In International Conference on Machine Learning, pp. 3958–3966, 2017.
|
| 218 |
+
|
| 219 |
+
Ming Yuan and Yi Lin. Model selection and estimation in regression with grouped variables. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 68(1):49–67, 2006.
|
| 220 |
+
|
| 221 |
+
Wojciech Zaremba, Ilya Sutskever, and Oriol Vinyals. Recurrent neural network regularization. arXiv:1409.2329, 2014.
|
| 222 |
+
|
| 223 |
+
Julian Georg Zilly, Rupesh Kumar Srivastava, Jan Koutn´ık, and Jurgen Schmidhuber. Recurrent ¨ highway networks. In Proceedings of the 34th International Conference on Machine Learning, pp. 4189–4198, 2017.
|
| 224 |
+
|
| 225 |
+
Barret Zoph and Quoc V Le. Neural architecture search with reinforcement learning. In International Conference on Learning Representations (ICLR), 2017.
|
| 226 |
+
|
| 227 |
+

|
| 228 |
+
Figure 5: Intrinsic Sparse Structures unveiled by $\ell _ { 1 }$ regularization (zoom in for a better view). The top row shows the original weight matrices, where blue dots are nonzero weights and white ones refer zeros; the bottom row are the weight matrices in the format of Fig. 3, where white strips are ISS components whose weights are all zeros. For better visualization, the original matrices are evenly down-sampled by $1 0 \times 1 0$ .
|
| 229 |
+
|
| 230 |
+
We take the large stacked LSTMs by Zaremba et al. (2014) for language modeling as the example. The network has two stacked LSTM layers whose dimensions of inputs and states are both 1500, and it has an output layer with a vocabulary of 10000 words. The sizes of “ISS weight groups” of two LSTM layers are 24000 and 28000. The perplexities of validation set and test set are respectively 82.57 and 78.57. We fine-tune this baseline LSTMs with $\ell _ { 1 }$ -norm regularization. The same training hyper-parameters as the baseline are adopted, except a bigger dropout keep ratio of 0.6 (original 0.35). A weaker dropout is used because $\ell _ { 1 }$ -norm is also a regularization to avoid overfitting. A too strong dropout plus $\ell _ { 1 }$ -norm regularization can result in underfitting. The weight decay of $\ell _ { 1 }$ - norm regularization is 0.0001. The sparsified network has validation perplexity and test perplexity of 82.40 and 78.60, respectively, which is approximately the same with the baseline. The sparsity of weights in the first LSTM layer, the second LSTM layer and the last output layer is $9 1 . 6 6 \%$ , $9 0 . 3 2 \%$ and $9 0 . 2 2 \%$ , respectively. Fig. 5 plots the learned sparse weight matrices. The sparse matrices in the top row reveal some interesting patterns: there are lots of all-zero columns and rows, and their positions are highly correlated. Those patterns are profiled in the bottom row. Much to our surprise, sparsifying individual weight independently can converge to sparse LSTMs with many ISS removed—504 and 220 ISS components in the first and second LSTM layer are all-zeros.
|
| 231 |
+
|
| 232 |
+
# APPENDIX B ISS IN BIDAF
|
| 233 |
+
|
| 234 |
+
Table 5: The ISS in BiDAF.
|
| 235 |
+
|
| 236 |
+
<table><tr><td>LSTM name</td><td>Dimensions of weight matrix</td><td>Receivers of hidden states</td><td>Size of “ISS weight group”</td></tr><tr><td>ModFwd1</td><td>900 × 400</td><td>ModFwd2 ModBwd2</td><td>4800</td></tr><tr><td>ModBwd1</td><td>900 × 400</td><td>ModFwd2 ModBwd2</td><td>4800</td></tr><tr><td>ModFwd2</td><td>300 × 400</td><td>OutFwd OutBwd logit layer for start index</td><td>3201</td></tr><tr><td>ModBwd2</td><td>300 × 400</td><td>OutFwd OutBwd logit layer for start index</td><td>3201</td></tr><tr><td>OutFwd</td><td>1500 × 400</td><td>logit layer for end index</td><td>6401</td></tr><tr><td>OutBwd</td><td>1500 × 400</td><td>logit layer for end index</td><td>6401</td></tr></table>
|
| 237 |
+
|
| 238 |
+

|
| 239 |
+
Figure 6: Histogram of vector lengths of “ISS weight groups” in BiDAF. The ISS-learned BiDAF is the one in the third row of Table 4 with $\mathrm { E M 6 6 . 3 2 }$ and F1 76.22. Using our approach, the lengths are regularized closer to zeros with a peak at the zero, resulting in high ISS sparsity.
|
md/train/rk6qdGgCZ/rk6qdGgCZ.md
ADDED
|
@@ -0,0 +1,252 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FIXING WEIGHT DECAY REGULARIZATION IN ADAM
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We note that common implementations of adaptive gradient algorithms, such as Adam, limit the potential benefit of weight decay regularization, because the weights do not decay multiplicatively (as would be expected for standard weight decay) but by an additive constant factor. We propose a simple way to resolve this issue by decoupling weight decay and the optimization steps taken w.r.t. the loss function. We provide empirical evidence that our proposed modification (i) decouples the optimal choice of weight decay factor from the setting of the learning rate for both standard SGD and Adam, and (ii) substantially improves Adam’s generalization performance, allowing it to compete with SGD with momentum on image classification datasets (on which it was previously typically outperformed by the latter). We also demonstrate that longer optimization runs require smaller weight decay values for optimal results and introduce a normalized variant of weight decay to reduce this dependence. Finally, we propose a version of Adam with warm restarts (AdamWR) that has strong anytime performance while achieving state-ofthe-art results on CIFAR-10 and ImageNet32x32. Our source code will become available after the review process.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Adaptive gradient methods, such as AdaGrad (Duchi et al., 2011), RMSProp (Tieleman & Hinton, 2012), and Adam (Kingma & Ba, 2014) have become a default method of choice for training feedforward and recurrent neural networks (Xu et al., 2015; Gregor et al., 2015; Radford et al., 2015). Nevertheless, state-of-the-art results for popular image classification datasets, such as CIFAR-10 and CIFAR-100 Krizhevsky (2009), are still obtained by applying SGD with momentum (Huang et al., 2016; 2017; Loshchilov & Hutter, 2016; Gastaldi, 2017). Furthermore, Wilson et al. (2017) suggested that adaptive gradient methods do not generalize as well as SGD with momentum when tested on a diverse set of deep learning tasks such as image classification, character-level language modeling and constituency parsing. Different hypotheses about the origins of this worse generalization have been investigated, such as the presence of sharp local minima (Keskar et al., 2016; Dinh et al., 2017) and inherent problems of adaptive gradient methods (Wilson et al., 2017). In this paper, we show that a major factor in the poor generalization of the most popular adaptive gradient method, Adam, lies in its dysfunctional implementation of weight decay; the issue we identify in Adam also pertains to other adaptive gradient methods.
|
| 12 |
+
|
| 13 |
+
Specifically, our analysis of Adam given in this paper leads to the following observations:
|
| 14 |
+
|
| 15 |
+
# The standard way to implement $\mathbf { L } _ { 2 }$ regularization/weight decay in Adam is dysfunctional.
|
| 16 |
+
|
| 17 |
+
One possible explanation why Adam and other adaptive gradient methods might be outperformed by SGD with momentum is that $\mathrm { L _ { 2 } }$ regularization/weight decay are implemented suboptimally in common deep learning libraries. Therefore, on tasks/datasets where the use of $\mathrm { L _ { 2 } }$ regularization is beneficial (e.g., on many popular image classification datasets), Adam leads to worse results than SGD with momentum (for which $\mathrm { L _ { 2 } }$ regularization behaves as expected).
|
| 18 |
+
|
| 19 |
+
$\mathbf { L } _ { 2 }$ regularization and weight decay are not the same thing. Contrary to common belief, the two techniques are not equivalent. For SGD, they can be made equivalent by a reparameterization of the weight decay factor based on the learning rate; this is not the case for Adam. In particular, when combined with adaptive gradients, $\mathrm { L _ { 2 } }$ regularization leads to weights with large gradients being regularized less than they would be when using weight decay.
|
| 20 |
+
|
| 21 |
+
Optimal weight decay is a function (among other things) of the total number of batch passes/weight updates.
|
| 22 |
+
|
| 23 |
+
Our empirical analysis of Adam suggests that the longer the runtime/number of batch passes to be performed, the smaller the optimal weight decay. This effect tends to be neglected because hyperparameters are often tuned for a fixed or a comparable number of training epochs. As a result, the values of the weight decay found to perform best for short runs do not generalize to much longer runs.
|
| 24 |
+
|
| 25 |
+
Our contributions are aimed at fixing the issues described above:
|
| 26 |
+
|
| 27 |
+
Decoupling weight decay from the gradient-based update (Section 2). We suggest to decouple the gradient-based update from weight decay for both SGD and Adam. The resulting SGD version SGDW decouples optimal settings of the learning rate and the weight decay factor, and the resulting Adam version AdamW generalizes substantially better than Adam.
|
| 28 |
+
|
| 29 |
+
Normalizing the values of weight decay (Section 3). We propose to parameterize the weight decay factor as a function of the total number of batch passes. This leads to a greater invariance of the hyperparameter settings in the sense that the values found to perform best for short runs also perform well for many times longer runs.
|
| 30 |
+
|
| 31 |
+
Adam with warm restarts and normalized weight decay (Section 4). After we fix the weight decay in Adam and design AdamW, we introduce AdamWR to obtain strong anytime performance by performing warm restarts.
|
| 32 |
+
|
| 33 |
+
The main motivation of this paper is to fix the weight decay in Adam to make it competitive w.r.t. SGD with momentum even for those problems where it did not use to be competitive. We hope that as a result, practitioners do not need to switch between Adam and SGD anymore, which in turn should help to reduce the common issue of selecting dataset/task-specific training algorithms and their hyperparameters.
|
| 34 |
+
|
| 35 |
+
# 2 DECOUPLING THE WEIGHT DECAY FROM THE GRADIENT-BASED UPDATE
|
| 36 |
+
|
| 37 |
+
In the weight decay described by Hanson & Pratt (1988), the weights $\boldsymbol { x }$ decay exponentially as
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
\begin{array} { r } { \pmb { x } _ { t + 1 } = ( 1 - w _ { t } ) \pmb { x } _ { t } - \alpha _ { t } \nabla f _ { t } ( \pmb { x } _ { t } ) , } \end{array}
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
where $w _ { t }$ defines the rate of the weight decay at time-step $t$ and $\nabla f _ { t } ( { \pmb x } _ { t } )$ is the $t { \cdot }$ -th batch gradient multiplied by a learning rate $\alpha _ { t }$ . Following Hanson & Pratt (1988), one can also modify the original batch loss $f _ { t } ( \pmb { x } _ { t } )$ and consider a bias term (also referred to as the regularization term) accounting for “costs” on weights which are, e.g., quadratic in the weight values as for $\mathrm { L _ { 2 } }$ regularization:
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
f _ { t , r e g } ( \pmb { x } _ { t } ) = f _ { t } ( \pmb { x } _ { t } ) + \frac { w _ { t } } { 2 } \left\| \pmb { x } _ { t } \right\| _ { 2 } ^ { 2 } ,
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
where $w _ { t }$ defines the impact of the $\mathrm { L _ { 2 } }$ regularization. In order to consider the weight decay regularization, one can reformulate the objective function as in Eq. (2) or directly adjust $\bar { \nabla } f _ { t } ( \pmb { x } _ { t } )$ as
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
\nabla f _ { t , r e g } ( { \pmb x } _ { t } ) = \nabla f _ { t } ( { \pmb x } _ { t } ) + w _ { t } { \pmb x } _ { t } .
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
Historically, stochastic gradient descent methods inherited this way of implementing the weight decay regularization.
|
| 56 |
+
|
| 57 |
+
The currently most common way (e.g., in popular libraries such as TensorFlow, Keras, PyTorch, Torch, and Lasagne) to introduce the weight decay regularization is to use the $\mathrm { L _ { 2 } }$ regularization term as in Eq. (2) or, often equivalently, to directly modify the gradient as in Eq. (3). Let’s first consider the simple case of SGD with momentum; Algorithm 1 demonstrates modifying the gradients directly in this method (see line 6). The weight decay term $w _ { t } \mathbf { x } _ { t - 1 }$ will first modify ${ \pmb g } _ { t }$ (see line 6) and then affect the momentum term $\pmb { m } _ { t }$ (see line 8). While the smoothing of the weight decay factor by $\beta _ { 1 }$
|
| 58 |
+
|
| 59 |
+
1: given learning rate $\alpha _ { t } \in \mathbb { R }$ , momentum factor $\beta _ { 1 } \in \mathbb { R }$ , weight decay factor $w \in \mathbb { R }$
|
| 60 |
+
2: initialize time step $t \gets 0$ , parameter vector $\pmb { x } _ { t = 0 } ~ \in ~ \mathbb { R } ^ { n }$ , first moment vector $\pmb { m } _ { t = 0 } \gets \pmb { \theta }$ ,
|
| 61 |
+
schedule multiplier $\eta _ { t = 0 } \in \mathbb { R }$
|
| 62 |
+
3: repeat
|
| 63 |
+
4: $t \gets t + 1$
|
| 64 |
+
5: $\nabla f _ { t } ( { \pmb x } _ { t - 1 } ) \gets S e l e c t B a t c h ( { \pmb x } _ { t - 1 } )$ . select batch and return the corresponding gradient
|
| 65 |
+
6: $\pmb { \mathscr { g } } _ { t } \gets \nabla f _ { t } ( \pmb { x } _ { t - 1 } ) \ + w _ { t } \pmb { x } _ { t - 1 }$
|
| 66 |
+
7: ηt ← SetScheduleMultiplier(t) . can be fixed, decay, be used for warm restarts
|
| 67 |
+
8: ${ \pmb { m } } _ { t } \gets \beta _ { 1 } { \pmb { m } } _ { t - 1 } + \eta _ { t } \alpha _ { t } \pmb { g } _ { t }$
|
| 68 |
+
9: $\pmb { x } _ { t } \gets \pmb { x } _ { t - 1 } - \pmb { m } _ { t } \gets \eta _ { t } w _ { t } \pmb { x } _ { t - 1 }$
|
| 69 |
+
|
| 70 |
+
<table><tr><td>Algorithm1 SGD with momentum</td><td>and SGDW with momentum</td><td></td></tr></table>
|
| 71 |
+
|
| 72 |
+
10: until stopping criterion is met
|
| 73 |
+
|
| 74 |
+
11: return optimized parameters $\mathbf { \boldsymbol { x } } _ { t }$
|
| 75 |
+
|
| 76 |
+
# Algorithm 2 Adam and AdamW
|
| 77 |
+
|
| 78 |
+
1: given $\alpha _ { t } = 0 . 0 0 1 , \beta _ { 1 } = 0 . 9 , \beta _ { 2 } = 0 . 9 9 9 , \epsilon = 1 0 ^ { - 8 } , w \in \mathbb { R }$
|
| 79 |
+
2: initialize time step $t \gets 0$ , parameter vector $\pmb { x } _ { t = 0 } \in \mathbb { R } ^ { n }$ , first moment vector $\pmb { m } _ { t = 0 } \pmb { \theta }$ , second
|
| 80 |
+
moment vector $\pmb { \nu } _ { t = 0 } \pmb { \theta }$ , schedule multiplier $\eta _ { t = 0 } \in \mathbb { R }$
|
| 81 |
+
3 : repeat
|
| 82 |
+
4: $t \gets t + 1$
|
| 83 |
+
5: $\nabla f _ { t } ( { \pmb x } _ { t - 1 } ) \gets S e l e c t B a t c h ( { \pmb x } _ { t - 1 } )$ . select batch and return the corresponding gradient
|
| 84 |
+
6: $\pmb { \mathrm { g } } _ { t } \nabla f _ { t } ( \pmb { x } _ { t - 1 } ) \ + w _ { t } \pmb { x } _ { t - 1 }$
|
| 85 |
+
7: $\pmb { m } _ { t } \beta _ { 1 } \pmb { m } _ { t - 1 } + \overline { { ( 1 - \beta _ { 1 } ) \pmb { g } _ { t } } }$ . here and below all operations are element-wise
|
| 86 |
+
8: $\pmb { \nu } _ { t } \gets \beta _ { 2 } \pmb { \nu } _ { t - 1 } + ( 1 - \beta _ { 2 } ) \pmb { g } _ { t } ^ { 2 }$
|
| 87 |
+
9: $\hat { \pmb { m } } _ { t } \gets \pmb { m } _ { t } / ( 1 - \beta _ { 1 } ^ { t } )$ $\triangleright$ here, $\beta _ { 1 }$ is taken to the power of $t$
|
| 88 |
+
10: $\hat { \pmb { { \nu } } } _ { t } \gets { \pmb { { \nu } } } _ { t } / ( 1 - \beta _ { 2 } ^ { t } )$ $\triangleright$ here, $\beta _ { 2 }$ is taken to the power of $t$
|
| 89 |
+
11: ηt ← SetScheduleMultiplier(t) . can be fixed, decay, be used for warm restarts
|
| 90 |
+
12: $\pmb { x } _ { t } \pmb { x } _ { t - 1 } - \eta _ { t } ( \alpha _ { t } \hat { m } _ { t } / ( \sqrt { \hat { \nu } _ { t } } + \epsilon ) + w _ { t } \pmb { x } _ { t - 1 } )$
|
| 91 |
+
13: until stopping criterion is met
|
| 92 |
+
14: return optimized parameters $\mathbf { \boldsymbol { x } } _ { t }$
|
| 93 |
+
|
| 94 |
+
(see line 8) might be a feature, we note (for simplicity, we omit $\eta _ { t }$ ) that $\mathbf { \boldsymbol { x } } _ { t }$ will decay by $\alpha _ { t } w _ { t } \pmb { x } _ { t - 1 }$ (see line 9) and not $w _ { t } \mathbf { x } _ { t - 1 }$ as one could expect according to the definition of the weight decay given by Eq. (1). Practically, if one wants to keep the actual weight decay $\alpha _ { t } w _ { t }$ fixed while changing $\alpha _ { t }$ to $\alpha _ { t } ^ { \prime }$ , then $w _ { t }$ should be modified to $\begin{array} { r } { w _ { t } ^ { \prime } = \frac { \alpha _ { t } w _ { t } } { \alpha _ { t } ^ { \prime } } } \end{array}$ αtwtα0 . This renders the problem of hyperparameter selection of $\alpha _ { t }$ and $w _ { t }$ non-separable.
|
| 95 |
+
|
| 96 |
+
We propose to fix this problem by following the original definition of weight decay given by Eq. (1) and decay the weights simultaneously with the update of $\mathbf { \boldsymbol { x } } _ { t }$ based on gradient information in Line 9 of Algorithm 1. This yields our proposed SGD variant SGDW with momentum. Although the proposed simple modification explicitly decouples $w _ { t }$ and $\alpha _ { t }$ , some problem-dependent implicit coupling is likely to remain. In order to account for a possible scheduling of both $\alpha _ { t }$ and $w _ { t }$ , we introduce a scaling factor $\eta _ { t }$ delivered by a user-defined procedure SetScheduleMultiplier $( t )$ . It should be noted that when $\mathrm { L _ { 2 } }$ regularization is used, weight decay contributes to the batch gradient and thus effectively is scheduled in the same way as the learning rate. Now, since we decouple the two we should also remember to schedule both of them with $\eta _ { t }$ .
|
| 97 |
+
|
| 98 |
+
Having shown that using $\mathrm { L _ { 2 } }$ regularization instead of weight decay already couples regularization and learning rate in the simple case of SGD with momentum, we now consider adaptive gradient optimizers, such as the Adam algorithm proposed by Kingma & Ba (2014), in which the coupling leads to even more unintended behavior. As an adaptive gradient method, Adam maintains a vector $\nu _ { t }$ responsible for storing smoothed amplitudes of parameter-wise gradients ${ \pmb g } _ { t } ^ { 2 }$ (see line 8 in Algorithm 2). These factors are used to control parameter-wise learning rates by normalizing parameter-wise√ gradients by $\sqrt { \hat { \nu _ { t } } } + \epsilon$ in line 12 of Algorithm 2. The common way to introduce the weight decay $w _ { t } \mathbf { x } _ { t - 1 }$ to Adam results in an update which only distantly resembles the original weight decay given by Eq. (1) because the $\nu _ { t }$ vectors are not only responsible for the parameter-wise amplitudes of $\pmb { g } _ { t }$ but also for the parameter-wise amplitudes of weights $\mathbf { \boldsymbol { x } } _ { t }$ . The amplitudes are then used to renormalize $\hat { \pmb { m } } _ { t }$ as given in line 12 of Algorithm 2. To gain a bit of intuition, let us consider the case when $t$ is large, causing $\beta _ { 1 } ^ { t }$ and $\beta _ { 2 } ^ { t }$ to go to zero and
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
\boldsymbol { x } _ { t } \gets \boldsymbol { x } _ { t - 1 } - \eta _ { t } \alpha _ { t } \frac { \beta _ { 1 } m _ { t - 1 } + ( 1 - \beta _ { 1 } ) g _ { t } } { \sqrt { \beta _ { 2 } \nu _ { t - 1 } + ( 1 - \beta _ { 2 } ) g _ { t } ^ { 2 } } + \epsilon } , \ \mathrm { w i t h } \ g _ { t } = \nabla f _ { t } ( \boldsymbol { x } _ { t - 1 } ) + w _ { t } \boldsymbol { x } _ { t - 1 } ,
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
where operations are performed parameter-wise. Not only the batch gradient $\nabla f _ { t } ( { \pmb x } _ { t - 1 } )$ is normalized but also the weight decay $w _ { t } \mathbf { x } _ { t - 1 }$ itself. Since this formula normalizes updates by their typical amplitudes, the decay of weights does not account for amplitudes anymore, leading to the relative decay being weaker for weights with large gradients. This is a correct implementation of $\mathbf { L } _ { 2 }$ regularization, but not of weight decay. Therefore, it might be misleading to use the two terms interchangeably, as is commonly done in the literature. We note that this difference between the two mechanisms for Adam has not been investigated and/or described before. As in the case of SGDW, we propose to follow the original definition of weight decay and perform it simultaneously with the gradient-based update as shown in line 12 of Algorithm 2 for AdamW. As we will demonstrate experimentally (in Section 5.2), AdamW generalizes much better than Adam.
|
| 105 |
+
|
| 106 |
+
# 3 NORMALIZED WEIGHT DECAY
|
| 107 |
+
|
| 108 |
+
Since our preliminary experiments showed that different weight decay factors are optimal for different computational budgets (defined in terms of the number of batch passes), we introduce a normalized weight decay to reduce this dependence. At iteration $t$ , $w _ { t }$ is set as follows:
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
w _ { t } = w _ { n o r m } \sqrt { \frac { b _ { t } } { B T _ { i } } } ,
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
where $b _ { t }$ is the batch size, $B$ is the total number of training points to be used in one epoch and $T _ { i }$ is the total number of epochs within the $i$ -th run/restart of the algorithm. Thus, $w _ { n o r m }$ can be interpreted as the weight decay to be used if only one batch pass is allowed. We note a recent relevant observation of Li et al. (2017) who demonstrated that a smaller batch size (for the same total number of epochs) leads to the shrinking effect of weight decay being more pronounced. Here, we propose to address that effect with normalized weight decay.
|
| 115 |
+
|
| 116 |
+
# 4 ADAM WITH WARM RESTARTS AND NORMALIZED WEIGHT DECAY
|
| 117 |
+
|
| 118 |
+
We now apply warm restarts to Adam, following the recent work of Loshchilov & Hutter (2016). There, the authors proposed Stochastic Gradient Descent with Warm Restarts (SGDR) to improve anytime performance of SGD by quickly cooling down the learning rate and periodically increasing it. SGDR has been successfully adopted to lead to new state-of-the-art results for popular image classification benchmarks (Huang et al., 2017; Gastaldi, 2017), and we therefore tried extending it to Adam. However, while our initial version of Adam with warm restarts had better anytime performance than Adam, it was not competitive with SGD with warm restarts, precisely because of Adam’s dysfunctional weight decay. Now, having fixed weight decay regularization (Section 2) and also having introduced normalized weight decay (Section 3), the work of Loshchilov & Hutter (2016) on warm restarts directly carries over, and we use it to construct AdamWR to fully benefit from warm restarts.
|
| 119 |
+
|
| 120 |
+
In the interest of keeping the presentation self-contained, we briefly describe how SGDR schedules the change of the effective learning rate in order to accelerate the training of DNNs. Here, we decouple the initial learning rate and its multiplier $\eta _ { t }$ used to obtain the actual learning rate at iteration $t$ (see, e.g., line 8 in Algorithm 1). In SGDR, we simulate a new warm-started run/restart of SGD once $T _ { i }$ epochs are performed, where $i$ is the index of the run. Importantly, the restarts are not performed from scratch but emulated by increasing $\eta _ { t }$ while the old value of $\mathbf { } _ { \pmb { x } _ { t } }$ is used as an initial solution. The amount by which $\eta _ { t }$ is increases controls to which extent the previously acquired information (e.g., momentum) is used. Within the $i \cdot$ -th run, the value of $\eta _ { t }$ decays according to the cosine annealing (Loshchilov & Hutter, 2016) for each batch as follows:
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\eta _ { t } = \eta _ { m i n } ^ { ( i ) } + 0 . 5 ( \eta _ { m a x } ^ { ( i ) } - \eta _ { m i n } ^ { ( i ) } ) ( 1 + \cos ( \pi T _ { c u r } / T _ { i } ) ) ,
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
where η min and $\eta _ { m a x } ^ { ( i ) }$ are ranges for the multiplier and $T _ { c u r }$ accounts for how many epochs have been performed since the last restart. $T _ { c u r }$ is updated at each batch iteration $t$ and is thus not constrained to integer values. Adjusting (e.g., decreasing) η(i)min and $\eta _ { m a x } ^ { ( i ) }$ at every $i$ -th restart (see also Smith (2016)) could potentially improve performance, but we do not consider that option in our experiments because it would involve additional hyperparameters. For $\eta _ { m a x } ^ { ( i ) } = 1$ and $\eta _ { m i n } ^ { ( i ) } = 0$ , one can simplify Eq. (6) to
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
\eta _ { t } = 0 . 5 + 0 . 5 \cos ( \pi T _ { c u r } / T _ { i } ) .
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+
In order to maintain a good anytime performance, one can start with an initially small $T _ { i }$ (e.g., from $1 \%$ to $10 \%$ of the expected total budget) and multiply it by a factor of $T _ { m u l t }$ (e.g., $T _ { m u l t } = 2$ ) at every restart. The $( i + 1 )$ -th restart is triggered when $T _ { c u r } = T _ { i }$ by setting $T _ { c u r }$ to 0. An example setting of the schedule multiplier is given in Section 1.1 of the supplementary material. Note that the effective learning rate is controlled by $\eta _ { t } \alpha _ { t }$ where $\alpha _ { t }$ is set to the initial learning rate and stays constant in our experimental setup. The reason why we employ $\alpha _ { t }$ and not simply $\alpha$ is to account for possible practical extensions, e.g., to adapt $\alpha _ { t }$ as a function of batch size in (scheduled) large-batch settings.
|
| 133 |
+
|
| 134 |
+
Our proposed AdamWR algorithm represents AdamW given in Algorithm 2 with $\eta _ { t }$ following Eq. (7) and $w _ { t }$ computed at each iteration using normalized weight decay according to Eq. (5). We note that normalized weight decay allowed us to use a constant parameter setting across short and long runs performed within AdamWR. Equivalently to AdamWR, we define SGDWR as SGDW with warm restarts.
|
| 135 |
+
|
| 136 |
+
# 5 EXPERIMENTAL VALIDATION
|
| 137 |
+
|
| 138 |
+
Our experimental setup follows that of Gastaldi (2017), who proposed, in addition to $\mathrm { L _ { 2 } }$ regularization, to apply the new Shake-Shake regularization to a 3-branch residual neural network. Gastaldi (2017) showed that this regularization allowed to achieve new state-of-the-art results of $2 . 8 6 \%$ on the CIFAR-10 dataset (Krizhevsky, 2009) and of $1 5 . 8 5 \%$ on CIFAR-100. The network was trained by SGDR with batch size 128 for 1800 epochs $\begin{array} { r } { T _ { 0 } = 1 8 0 0 \mathrm { \Omega } } \end{array}$ ) without restarts with the learning rate scheduled by Eq. (6). The regular data augmentation procedure used for the CIFAR datasets was applied. We used the same model/source code based on fb.resnet.torch 1. The base networks are a 26 2x64d ResNet (i.e. the network has a depth of 26, 2 residual branches and the first residual block has a width of 64) and $2 6 2 \mathrm { x } 9 6 \mathrm { d }$ ResNet with 11.6M and 25.6M parameters, respectively. For a detailed description of the network and the Shake-Shake method, we refer the interested reader to Gastaldi (2017).
|
| 139 |
+
|
| 140 |
+
# 5.1 DECOUPLING THE WEIGHT DECAY AND INITIAL LEARNING RATE PARAMETERS
|
| 141 |
+
|
| 142 |
+
In order to verify our hypothesis about the coupling of the initial learning rate $\alpha _ { t }$ and the weight decay factor $w _ { t }$ , we trained a 2x64d ResNet with cosine annealing for 100 epochs with different settings of $\alpha _ { t }$ and $w _ { t }$ . Throughout this paper, we scheduled the learning rate with cosine annealing because it leads to better results than a fixed learning rate (see SuppFigure 1 in the supplementary material). Figure 1 compares SGD vs. SGDW (top row) and Adam vs. AdamW (bottom row). For the case of SGD (Figure 1, top left), weight decay is not decoupled from the learning rate (the common way as described in Algorithm 1), and the figure clearly shows that the basin of best hyperparameter settings (depicted by color and top-10 hyperparameter settings by black circles) is not aligned with the $\mathbf { X }$ -axis or y-axis but lies on the diagonal. This suggests that the two hyperparameters are interdependent and need to be changed simultaneously, while only changing one of them might substantially worsen results. Consider, e.g., the setting at the top left black circle $( \alpha _ { t } = 1 / 2$ , $w _ { t } = 1 / 8 * 0 . 0 0 1 )$ ; only changing either $\alpha _ { t }$ or $w _ { t }$ by itself would worsen results, while changing both of them could still yield clear improvements. We note that this coupling of initial learning rate and weight decay factor might have contributed to SGD’s reputation of being very sensitive to its hyperparameter settings.
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 1: The Top-1 test error of a 26 2x64d ResNet on CIFAR-10 measured after 100 epochs. The proposed SGDW and AdamW (right column) have a more separable hyperparameter space.
|
| 146 |
+
|
| 147 |
+
In contrast, the results for our new SGDW in Figure 1 (top right) show that SGDW decouples weight decay and initial learning rate. The proposed approach renders the two hyperparameters more separable: even if the learning rate is not well tuned yet (e.g., consider the value of 1/1024 in Figure 1, top right), leaving it fixed and only optimizing the weight decay factor would yield a good value (of $1 / 4 ^ { * } 0 . 0 0 1$ ). This is not the case for the original SGD shown in Figure 1 (top left).
|
| 148 |
+
|
| 149 |
+
The results for different hyperparameter settings of the original Adam are given in Figure 1 (bottom left). Adam’s best hyperparameter settings performed clearly worse than SGD’s best ones (compare Figure 1, top left). While both methods use the original way to employ weight decay, the original Adam did not benefit from it at all: its best results obtained for non-zero weight decay values were comparable to the best ones obtained without the weight decay regularization, i.e., when $w _ { t } = 0$ . Similarly to the original SGD, the shape of the hyperparameter landscape suggests that the two hyperparameters are coupled.
|
| 150 |
+
|
| 151 |
+
In contrast, the results for our new AdamW in Figure 1 (bottom right) show that AdamW largely decouples weight decay and learning rate. The results for the best hyperparameter settings were substantially better than the best ones of the original Adam and rivaled those of SGD and SGDW.
|
| 152 |
+
|
| 153 |
+

|
| 154 |
+
Figure 2: Learning curves (top row) and generalization results (bottom row) obtained by a $2 6 2 \mathrm { x } 9 6 \mathrm { d }$ ResNet trained with Adam and AdamW on CIFAR-10. See text for details.
|
| 155 |
+
|
| 156 |
+
In summary, the experimental results in Figure 1 support our hypothesis that the weight decay and learning rate hyperparameters can be decoupled, and that this in turn simplifies the problem of hyperparameter tuning in SGD and improves Adam’s performance to be competitive w.r.t. SGD with momentum.
|
| 157 |
+
|
| 158 |
+
# 5.2 BETTER GENERALIZATION OF ADAMW
|
| 159 |
+
|
| 160 |
+
While the previous experiment suggested that the basin of optimal hyperparameters of AdamW is broader and deeper than the one of Adam, we next investigated the results for much longer runs of 1800 epochs to compare the generalization capabilities of AdamW and Adam.
|
| 161 |
+
|
| 162 |
+
We fixed the initial learning rate to 0.001 which represents both the default learning rate for Adam and the one which showed reasonably good results in our experiments. Figure 2 shows the results for 12 settings of the weight decay of Adam and 7 settings of the normalized weight decay of AdamW. Interestingly, while the dynamics of the learning curves of Adam and AdamW often coincided for the first half of the training run, AdamW often led to lower training loss and test errors (see Figure 2 top left and top right, respectively). Importantly, the use of weight decay in Adam did not yield as good results as in AdamW (see also Figure 2, bottom left). Next, we investigated whether AdamW’s better results were only due to better convergence or due to better generalization. The results in Figure 2 (bottom right) for the best settings of Adam and AdamW suggest that AdamW did not only yield better training loss but also yielded better generalization performance for similar training loss values. The results on ImageNet32x32 (see SuppFigure 4 in the supplementary material) lead to the same conclusion of substantially improved generalization performance.
|
| 163 |
+
|
| 164 |
+

|
| 165 |
+
Figure 3: Top-1 test error on CIFAR-10 (left) and Top-5 test error on ImageNet32x32 (right).
|
| 166 |
+
|
| 167 |
+
5.3 EASIER HYPERPARAMETER SELECTION DUE TO NORMALIZED WEIGHT DECAY
|
| 168 |
+
|
| 169 |
+
Our experimental results with Adam and SGD suggested that the total runtime in terms of the number of epochs affect the basin of optimal hyperparameters (see SuppFigure 3 in the supplementary material). More specifically, the greater the total number of epochs the smaller the values of the weight decay should be. SuppFigure 3 shows that our remedy for this problem, the normalized weight decay defined in Eq. (7), simplifies hyperparameter selection because the optimal values observed for short runs are similar to the ones for much longer runs. While our initial experiments on CIFAR-10 suggested the square root fit we proposed in Eq. (7), to double-check that this is not a coincidence, we also performed experiments on the ImageNet32x32 dataset (Chrabaszcz et al., 2017), a downsampled version of the original ImageNet dataset with 1.2 million $3 2 \times 3 2$ pixels images, where an epoch is 24 times longer than on CIFAR-10. This experiment also supported the square root scaling: the best values of the normalized weight decay observed on CIFAR-10 represented nearly optimal values for ImageNet $3 2 \mathrm { x } 3 2 $ (see SuppFigure 3). In contrast, had we used the same raw weight decay values $w _ { t }$ for ImageNet32x32 as for CIFAR-10 and for the same number of epochs, without the proposed normalization, $w _ { t }$ would have been roughly 5 greater than optimal for ImageNet32x32, leading to much worse performance. The optimal normalized weight decay values were also very similar (e.g., $w _ { n o r m } = 0 . 0 2 5$ and $w _ { n o r m } = 0 . 0 5$ ) across SGDW and AdamW.
|
| 170 |
+
|
| 171 |
+
We investigated whether the use of much longer runs (1800 epochs) of the original Adam with $\mathrm { L _ { 2 } }$ regularization makes the use of cosine annealing unnecessary. The results of Adam without cosine annealing (i.e., with fixed learning rate) for a 4 by 4 logarithmic grid of hyperparameter settings are given in SuppFigure 5 in the supplementary material. Even after taking into account the low resolution of the grid, the results appear to be at best comparable to the ones obtained with AdamW with 18 times less epochs and a smaller network (see SuppFigure 2). These results are not very surprising given Figure 1 (which demonstrates the effectiveness of AdamW) and SuppFigure 2 (which demonstrates the necessity to use some learning rate schedule such as cosine annealing).
|
| 172 |
+
|
| 173 |
+
# 5.4 ADAMWR WITH WARM RESTARTS FOR BETTER ANYTIME PERFORMANCE
|
| 174 |
+
|
| 175 |
+
Finally, we investigated the strong anytime performance AdamWR obtains from warm restarts (using normalized weight decay to avoid the need for a different weight decay factor for restarts with longer annealing schedules). As Figure 3 shows, AdamWR greatly sped up AdamW on CIFAR10 and ImageNet32x32, up to a factor of 10 (see the results at the first restart). For the default learning rate of 0.001, AdamW achieved $15 \%$ relative improvement in test errors compared to Adam both on CIFAR-10 (also see Figure 2) and ImageNet32x32 (also see SuppFigure 4). AdamWR achieved the same improved results but with a much better anytime performance. These improvements closed most of the gap between Adam and SGDWR on CIFAR-10 and yielded comparable performance on ImageNet32x32.
|
| 176 |
+
|
| 177 |
+
# 6 DISCUSSION AND CONCLUSION
|
| 178 |
+
|
| 179 |
+
Following suggestions that adaptive gradient methods such as Adam might lead to worse generalization than SGD with momentum (Wilson et al., 2017), we identified at least one possible explanation to this phenomenon: the dysfunctional use of $\mathrm { L _ { 2 } }$ regularization and weight decay. We proposed a simple fix to deal with this issue, yielding substantially better generalization performance in our AdamW variant. We also proposed normalized weight decay and warm restarts for Adam, showing that a more robust hyperparameteer selection and a better anytime performance can be achieved in our new AdamWR variant.
|
| 180 |
+
|
| 181 |
+
Our preliminary results obtained with AdamW and AdamWR on image classification datasets must be verified on a wider range of tasks, especially the ones where the use of regularization is expected to be important. It would be interesting to integrate our findings on weight decay into other methods which attempt to improve Adam, e.g, normalized direction-preserving Adam (Zhang et al., 2017). While we focussed our experimental analysis on Adam, we believe that similar results also hold for other adaptive gradient methods, such as AdaGrad (Duchi et al., 2011) and RMSProp (Tieleman & Hinton, 2012).
|
| 182 |
+
|
| 183 |
+
The results shown in Figure 2 suggest that Adam and AdamW follow very similar curves most of the time until the third phase of the run where AdamW starts to branch out to outperform Adam. As pointed out by an anonymous reviewer, it would be interesting to investigate what causes this branching and whether the desired effects are observed at the bottom of the landscape. One could investigate this using the approach of Im et al. (2016) to switch from Adam to AdamW at a given epoch index. Since it is quite possible that the effect of regularization is not that pronounced in the early stages of training, one could think of designing a version of Adam which exploits this by being fast in the early stages and well-regularized in the late stages of training. The latter might be achieved with a custom schedule of the weight decay factor.
|
| 184 |
+
|
| 185 |
+
In this paper, we argue that the popular interpretation that weight decay $\mathbf { \tau } = \mathbf { L } _ { 2 }$ regularization is not precise. Instead, the difference between the two leads to the following important consequences. Two algorithms as different as SGD and Adam will exhibit different effective rates of weight decay even if the same regularization coefficient is used to include $\mathrm { L _ { 2 } }$ regularization in the objective function. Moreover, when decoupled weight decay is applied, two algorithms as different as SGDW and AdamW will optimize two effectively different objective functions even if the same weight decay factor is used. Our findings suggest that the original Adam algorithm with $\mathrm { L _ { 2 } }$ regularization affects effective rates of weight decay in a way that precludes effective regularization, and that effective regularization is achievable by decoupling the weight decay.
|
| 186 |
+
|
| 187 |
+
Advani & Saxe (2017) analytically showed that in the limited data regime of deep networks the presence of eigenvalues that are zero forms a frozen subspace in which no learning occurs and thus smaller (e.g., zero) initial weight norms should be used to achieve best generalization results. Our future work shall consider adapting initial weight norms or weight norm constraints (Salimans & Kingma, 2016) at each warm restart. Kawaguchi et al. (2017) proposed a family of regularization techniques which are specific to the current batch and its size. Similarly to $\mathrm { L _ { 2 } }$ regularization and weight decay, the latter techniques might be attempted to be transformed to act directly on weights.
|
| 188 |
+
|
| 189 |
+
# REFERENCES
|
| 190 |
+
|
| 191 |
+
Madhu S. Advani and Andrew M. Saxe. High-dimensional dynamics of generalization error in neural networks. arXiv:1710.03667, 2017.
|
| 192 |
+
Patryk Chrabaszcz, Ilya Loshchilov, and Frank Hutter. A downsampled variant of ImageNet as an alternative to the CIFAR datasets. arXiv:1707.08819, 2017.
|
| 193 |
+
Laurent Dinh, Razvan Pascanu, Samy Bengio, and Yoshua Bengio. Sharp minima can generalize for deep nets. arXiv:1703.04933, 2017.
|
| 194 |
+
John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. The Journal of Machine Learning Research, 12:2121–2159, 2011.
|
| 195 |
+
Xavier Gastaldi. Shake-Shake regularization. arXiv preprint arXiv:1705.07485, 2017.
|
| 196 |
+
|
| 197 |
+
Karol Gregor, Ivo Danihelka, Alex Graves, Danilo Jimenez Rezende, and Daan Wierstra. Draw: A recurrent neural network for image generation. arXiv:1502.04623, 2015.
|
| 198 |
+
|
| 199 |
+
Stephen Jose Hanson and Lorien Y Pratt. Comparing biases for minimal network construction with ´ back-propagation. In Proceedings of the 1st International Conference on Neural Information Processing Systems, pp. 177–185, 1988.
|
| 200 |
+
|
| 201 |
+
Gao Huang, Zhuang Liu, and Kilian Q Weinberger. Densely connected convolutional networks. arXiv:1608.06993, 2016.
|
| 202 |
+
|
| 203 |
+
Gao Huang, Yixuan Li, Geoff Pleiss, Zhuang Liu, John E Hopcroft, and Kilian Q Weinberger. Snapshot ensembles: Train 1, get m for free. arXiv:1704.00109, 2017.
|
| 204 |
+
|
| 205 |
+
Daniel Jiwoong Im, Michael Tao, and Kristin Branson. An empirical analysis of deep network loss surfaces. arXiv preprint arXiv:1612.04010, 2016.
|
| 206 |
+
|
| 207 |
+
Kenji Kawaguchi, Leslie Pack Kaelbling, and Yoshua Bengio. Generalization in deep learning. arXiv:1710.05468, 2017.
|
| 208 |
+
|
| 209 |
+
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:1609.04836, 2016.
|
| 210 |
+
|
| 211 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv:1412.6980, 2014.
|
| 212 |
+
|
| 213 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images. 2009.
|
| 214 |
+
|
| 215 |
+
Hao Li, Zheng Xu, Gavin Taylor, and Tom Goldstein. Visualizing the loss landscape of neural nets. arXiv preprint arXiv:1712.09913, 2017.
|
| 216 |
+
|
| 217 |
+
Ilya Loshchilov and Frank Hutter. SGDR: stochastic gradient descent with warm restarts. arXiv:1608.03983, 2016.
|
| 218 |
+
|
| 219 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv:1511.06434, 2015.
|
| 220 |
+
|
| 221 |
+
Tim Salimans and Diederik P Kingma. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. In Advances in Neural Information Processing Systems, pp. 901–909, 2016.
|
| 222 |
+
|
| 223 |
+
Leslie N Smith. Cyclical learning rates for training neural networks. arXiv:1506.01186v3, 2016.
|
| 224 |
+
|
| 225 |
+
Tijmen Tieleman and Geoffrey Hinton. Lecture 6.5-rmsprop: Divide the gradient by a running average of its recent magnitude. COURSERA: Neural networks for machine learning, 4(2):26– 31, 2012.
|
| 226 |
+
|
| 227 |
+
Ashia C Wilson, Rebecca Roelofs, Mitchell Stern, Nathan Srebro, and Benjamin Recht. The marginal value of adaptive gradient methods in machine learning. arXiv:1705.08292, 2017.
|
| 228 |
+
|
| 229 |
+
Kelvin Xu, Jimmy Ba, Ryan Kiros, Kyunghyun Cho, Aaron Courville, Ruslan Salakhudinov, Rich Zemel, and Yoshua Bengio. Show, attend and tell: Neural image caption generation with visual attention. In International Conference on Machine Learning, pp. 2048–2057, 2015.
|
| 230 |
+
|
| 231 |
+
Zijun Zhang, Lin Ma, Zongpeng Li, and Chuan Wu. Normalized direction-preserving adam. arXiv:1709.04546, 2017.
|
| 232 |
+
|
| 233 |
+
# 1 SUPPLEMENTARY MATERIAL
|
| 234 |
+
|
| 235 |
+
# 1.1 AN EXAMPLE SETTING OF THE SCHEDULE MULTIPLIER
|
| 236 |
+
|
| 237 |
+
An example schedule of the schedule multiplier $\eta _ { t }$ is given in SuppFigure 1 for $T _ { i = 0 } = 1 0 0$ and $T _ { m u l t } = 2$ . After the initial 100 epochs the learning rate will reach 0 because $\eta _ { t = 1 0 0 } = 0$ . Then, since $T _ { c u r } = T _ { i = 0 }$ , we restart by resetting $T _ { c u r } = 0$ , causing the multiplier $\eta _ { t }$ to be reset to 1 due to Eq. (7). This multiplier will then decrease again from 1 to 0, but now over the course of 200 epochs because $T _ { i = 1 } = T _ { i = 0 } T _ { m u l t } = 2 0 0$ . Solutions obtained right before the restarts, when $\eta _ { t } = 0$ (e.g., at epoch indexes 100, 300, 700 and 1500 as shown in SuppFigure 1) are recommended by the optimizer as the solutions, with more recent solutions prioritized.
|
| 238 |
+
|
| 239 |
+

|
| 240 |
+
SuppFigure 1: An example schedule of the learning rate multiplier as a function of epoch index. The first run is scheduled to converge at epoch $T _ { i = 0 } = 1 0 0$ , then the budget for the next run is doubled as $T _ { i = 1 } = T _ { i = 0 } T _ { m u l t } = 2 0 0$ , etc.
|
| 241 |
+
|
| 242 |
+

|
| 243 |
+
SuppFigure 2: Adam with fixed learning rate (left) and with cosine annealing (right). We show the final test error of a $2 6 ~ 2 \mathrm { x } 6 4 \mathrm { d }$ ResNet on CIFAR-10 after 100 epochs of SGD with momentum. The results where the learning rate is fixed (left) are inferior to the ones where the learning rate is scheduled according to cosine annealing (right). Therefore, we schedule the learning rate with cosine annealing for all methods given in the paper.
|
| 244 |
+
|
| 245 |
+

|
| 246 |
+
SuppFigure 3: Effect of normalized weight decay. We show the final test Top-1 error on CIFAR10 (first two rows for AdamW without and with normalized weight decay) and Top-5 error on ImageNet32x32 (last two rows for AdamW and SGDW, both with normalized weight decay) of a $2 6 2 \mathrm { x } 6 4 \mathrm { d }$ ResNet after different numbers of epochs (see columns). While the optimal settings of the raw weight decay change significantly for different runtime budgets (see the first row), the values of the normalized weight decay remain very similar for different budgets (see the second row) and different datasets (here, CIFAR-10 and ImageNet32x32), and even across AdamW and SGDW.
|
| 247 |
+
|
| 248 |
+

|
| 249 |
+
SuppFigure 4: Learning curves (top row) and generalization results (Top-5 errors in bottom row) obtained by a $2 6 2 \mathrm { x } 9 6 \mathrm { d }$ ResNet trained with Adam and AdamW on ImageNet32x32.
|
| 250 |
+
|
| 251 |
+

|
| 252 |
+
SuppFigure 5: Adam without cosine annealing, i.e., with fixed learning rate. We show the final test error of a $2 6 ~ 2 \mathrm { x } 9 6 \mathrm { d }$ ResNet on CIFAR-10 after 1800 epochs of the original Adam for different settings of learning rate and weight decay used for $\mathrm { L _ { 2 } }$ regularization. These results can be compared to the ones of AdamW shown in SuppFigure 3 (top row). The results of AdamW with only 100 epochs and a smaller network seem to be at least as good as the ones of Adam with 18 times as many epochs and a bigger network.
|
md/train/ryGDEjCcK7/ryGDEjCcK7.md
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CONTROLLING COVARIATE SHIFT USINGEQUILIBRIUM NORMALIZATION OF WEIGHTS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We introduce a new normalization technique that exhibits the fast convergence properties of batch normalization using a transformation of layer weights instead of layer outputs. The proposed technique keeps the contribution of positive and negative weights to the layer output in equilibrium. We validate our method on a set of standard benchmarks including CIFAR-10/100, SVHN and ILSVRC 2012 ImageNet.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The introduction of normalizing layers to neural networks has in no small part contributed to the deep learning revolution in machine learning. The most successful of these techniques in the image classification domain is the batch normalization (BatchNorm) layer (Ioffe & Szegedy, 2015), which works by normalizing the univariate first and second order statistics between layers.
|
| 12 |
+
|
| 13 |
+
Batchnorm has seen near universal adoption in image classification tasks due to its surprisingly multifaceted benefits. Compared to an unnormalized network, its has been widely observed that using batch norm empirically results in:
|
| 14 |
+
|
| 15 |
+
• Stability over a wide range of step sizes • Faster convergence (particularly with larger step sizes) • Improved generalization
|
| 16 |
+
|
| 17 |
+
The multiple effects of BatchNorm make it both hard to replace and hard to analyze. In this paper we introduce Equilibrium Normalization (EquiNorm), a normalization that works in weight space and still uses a form of batch statistics unlike previous weight space approaches. EquiNorm results in very rapid convergence, even more so than BatchNorm, however as we will show in our experiments, this also results in a tendency to overfit. When combined with additional regularisation, EquiNorm can significantly outperform BatchNorm, which benefits less from this additional regularisation.
|
| 18 |
+
|
| 19 |
+
# 2 RELATED WORK
|
| 20 |
+
|
| 21 |
+
A number of normalization layers have been proposed that can be considered alternatives to batch normalization. Batch normalization has also been extended as batch renormalization (Ioffe, 2017) to handle smaller batch sizes.
|
| 22 |
+
|
| 23 |
+
Layer/Instance Normalization A simple modification of BatchNorm involves computing the statistics independently for each instance, so that no averaging is done across each mini-batch, instead averaging either across channels (layer norm) or separately for each channel (instance norm). Unfortunately these techniques are known to not generalize as well as batch norm for convolutional neural networks (Sec 6.7; Sec 4.1. Jimmy Lei Ba, 2016; Yuxin Wu, 2018).
|
| 24 |
+
|
| 25 |
+
Group Normalization A middle ground between layer and instance normalization can be found by averaging statistics over small groups of channels. This has been shown empirically to be superior to either approach, although there is still a gap in generalization performance (Yuxin Wu, 2018). Like the approaches above, it avoids a dependence on batch statistics, allowing for potentially much smaller batches to be used without a degradation in generalization performance.
|
| 26 |
+
|
| 27 |
+
Weight Normalization Additional stability can be introduced into NN training by constraining the norm of the weights corresponding to each output channel/neuron to be one. When this is done by an explicit division operation in the forward pass, rather than via an optimization constraint, this is known as weight normalization (Salimans & Kingma, 2016). An additional learnable scaling factor is also introduced. Unfortunately, to match the generalization performance of BatchNorm on image classification tasks such as CIFAR-10, this technique needs to be used together with partial (additive only) BatchNorm (Section 5.1, Salimans & Kingma, 2016).
|
| 28 |
+
|
| 29 |
+
Local Response Normalization A precursor to batch norm, local normalization methods (Jarrett et al., 2009; Lyu & Simoncelli, 2008) played an important part in the seminal AlexNet architecture (Krizhevsky et al., 2012), and were widely used before batch norm was introduced. LR normalization has similarities to group norm in that it uses a group of neighboring channels (with ordering set arbitrary at initialization) for normalization. Although it aids generalization in a similar manner to BatchNorm, it does not accelerate convergence or allow for larger step sizes to be used (Sec 4.2.1, Ioffe & Szegedy, 2015).
|
| 30 |
+
|
| 31 |
+
# 3 ASSUMPTIONS
|
| 32 |
+
|
| 33 |
+
The EquiNorm method functions by modifying the weights of a convolution before it is applied. For justifying the form of our method, we make the following assumptions about this convolution, which we will discuss relaxing after detailing the method:
|
| 34 |
+
|
| 35 |
+
1. All inputs to the convolutional layer are positive, such as when the layer is preceded by a ReLU.
|
| 36 |
+
2. The convolution has stride one.
|
| 37 |
+
3. Cyclic padding is used.
|
| 38 |
+
4. All weights are non-zero, and there exists at least one positive and one negative weight per output channel.
|
| 39 |
+
|
| 40 |
+
# 4 METHOD
|
| 41 |
+
|
| 42 |
+
Consider initially for simplicity a convolutional layer with a single input and output channel. Let
|
| 43 |
+
|
| 44 |
+
be the weight kernel for this neuron, and let
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
x : { \mathrm { b a t c h s i z e } } \times { \mathrm { h e i g h t } } \times { \mathrm { w i d t h } } ,
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
be the input tensor for a single mini-batch. We will compute scalar quantities $s$ and $b$ that modify the weights as follows:
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
w ^ { \prime \prime } = s w ^ { \prime } = s \left( w + b \right) .
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
This transformation will be fully differentiated through during the backwards pass (using automatic differentiation) so that the gradient of $w$ is correct. As with BatchNorm, we also include an additional affine transformation after the convolution to ensure no expressivity is lost due to the normalization operation.
|
| 57 |
+
|
| 58 |
+
The core idea of equilibrium normalization is to balance the contribution of positive and negative weights to the output of the convolution. To this end, we introduce additional notation to address the positive and negative weights separately. Let superscripts $+ / -$ (i.e. $w ^ { + } / w ^ { - } ,$ ) indicate sums of the positive/negative elements respectively. Also, let $v$ be the sum of the input data to the layer,
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
v = \sum _ { i , j , k } x _ { i j k } .
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
As we have two constants to determine, we need two constraints that we wish to be satisfied. The first constraint we introduce is common with batch normalization, a constraint on the mean of the
|
| 65 |
+
|
| 66 |
+
output. Since under the cyclic padding assumption, each weight is multiplied by each input element, we can constrain the mean of the output to be zero by requiring that:
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
v s \sum _ { j , j } ( w _ { j k } + b ) = 0 ,
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\therefore b = - \mathrm { m e a n } ( w ) .
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
The second constraint controls the magnitude within the total output of the layer, of the positive weight elements:
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\begin{array} { l } { { v s w ^ { \prime + } = r , } } \\ { { \displaystyle \therefore s = \frac { r } { v w _ { + } ^ { \prime } } . } } \end{array}
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
The constant $r$ is set so that the contribution is of average 1 per output element, which is achieved by setting $r$ to the product of batch-size, output width and output height. Note that due to the mean constraint, this automatically results in the negative weight contribution also being of magnitude $r$ .
|
| 83 |
+
|
| 84 |
+
# 4.1 FULL CASE
|
| 85 |
+
|
| 86 |
+
When multiple input channels are used, each weight no longer multiples each input, rather they each multiply only inputs from a single channel. To compensate for this we need to compute per-channel sums $v _ { c }$ (where $c$ is the channel index) and change the second constraint as follows:
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\sum _ { c } { \mathrm { ~ ~ \psi ~ } ^ { \mathnormal ~ } } v _ { c } s w _ { c } ^ { \prime + } = r .
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
The first constraint changes in the same fashion.
|
| 93 |
+
|
| 94 |
+
When multiple output channels are used, we just duplicate this procedure applying it to each channel’s weights separately. We thus maintain a $s$ and $b$ value per output channel, and compute as intermediate values a $w ^ { \prime + }$ of matrix shape. For completeness we give the full equations below. All summations are over the full range of the summed indexes.
|
| 95 |
+
|
| 96 |
+
# Tensor shapes
|
| 97 |
+
|
| 98 |
+
Updates:
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
\begin{array} { r c l } { v _ { c } } & { = } & { \displaystyle \sum _ { i , j , k } x _ { i < j , k } , } \\ { w _ { d e } } & { = } & { \displaystyle \sum _ { j , k } w _ { d e j k } , } \\ { r } & { = } & { \displaystyle \sum _ { i , k \in \mathrm { \scriptsize ~ c } } w _ { i k } \mathrm { i n } \le \mathrm { e x i g h t ~ o n t ~ v a r i t ~ t h e ~ s t a t ~ t h e n t ~ v a r t ~ a d e ~ ^ { \ell } ~ } } \\ { b _ { d } } & { = } & { \displaystyle - \frac { 1 } { ( \mathrm { R e } \pi \mathrm { n e l h } \mathrm { h } \mathrm { e } \mathrm { i } g h \mathrm { t ~ \times ~ } \mathrm { \times ~ } \mathrm { e x p } _ { \mathrm { n e l } } \mathrm { v _ { d e j k } } ) \sum _ { c } \nu _ { c } } , } \\ { w _ { d e } ^ { \prime + } } & { = } & { \displaystyle \sum _ { i , j , k } ( w _ { d e j k } + b _ { d } ) I [ w _ { d e j k } + b _ { d } > 0 ] , } \\ { s _ { d } } & { = } & { \displaystyle \sum _ { i < j } x _ { c } w _ { d e } ^ { \prime + } , } \\ { w _ { d e j k } ^ { \prime } } & { = } & { s _ { d } ( w _ { d e j k } + b _ { d } ) . } \end{array}
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
At test time, we follow the technique used in BatchNorm of using a running estimate of the data statistics ${ { v } _ { c } }$ in our method) that is computed during training time.
|
| 105 |
+
|
| 106 |
+

|
| 107 |
+
Figure 1: Equilibrium Normalization ensures the contribution from positive and negative kernel weights to the output remains of the same total magnitude, both compared to each other and between epochs. In the case shown of a $3 \times 3$ kernel (cyclic convolution) against a $3 \times 3$ image with padding 1, this magnitude is width $\mathrm { \Omega _ { o u t } \cdot h e i g h t _ { o u t } = 9 . 0 }$ .
|
| 108 |
+
|
| 109 |
+
# SINGLE PASS FORMULATION
|
| 110 |
+
|
| 111 |
+
The above calculation requires two passes over the weights, first to compute $b$ , then to compute the sum of positive elements after the addition of $b$ . We can do an approximate computation using only one pass by assuming the sign of each element does not change after the addition of $b$ . The $s$ calculation changes as follows:
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
\begin{array} { r c l } { { n _ { d c } ^ { + } } } & { { = } } & { { \displaystyle \sum _ { j , k } I [ w _ { d c j k } > 0 ] , } } \\ { { } } & { { } } & { { } } \\ { { s _ { d } } } & { { = } } & { { \displaystyle \frac { r } { \sum _ { c } v _ { c } \left( w _ { d c } ^ { + } + b _ { d } n _ { d c } ^ { + } \right) } . } } \end{array}
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
We use this variant in all experiments that follow.
|
| 118 |
+
|
| 119 |
+
# 5 DISCUSSION
|
| 120 |
+
|
| 121 |
+
# 5.1 CONTROLLING COVARIATE SHIFT
|
| 122 |
+
|
| 123 |
+
The original justification for batch normalization is its ability to minimize covariate shift, although there is some debate on whether or not this is the main contributing factor to its effectiveness, see Santurkar et al. (2018). In this context, covariate shift refers to the change between steps of the statistics of the outputs of a layer.
|
| 124 |
+
|
| 125 |
+
Like batch normalization, the approach we propose also controls the shift in the outputs of a layer between steps, just in a different way. Our approach is motivated by a hypothesis that it is not necessary to control the mean and variance precisely; other notions of scale and shift may work as well or better. Santurkar et al. (2018) show that normalizing by other norms, such as $L _ { 1 }$ , can work well, supporting this hypothesis.
|
| 126 |
+
|
| 127 |
+
The sum of the output from positive and negative weights is a form of $L _ { 1 }$ control which can be contrasted with the $L _ { 2 }$ control that Batchnorm uses. This control can be motivated by Young’s convolution inequality, which bounds the output of a convolution operation in terms of the norm of the input:
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
\begin{array} { l } { \displaystyle \| x \ast w \| _ { r } \leq \| w \| _ { p } \| x \| _ { q } , } \\ { \displaystyle \mathrm { w h e r e } \frac { 1 } { p } + \frac { 1 } { q } = \frac { 1 } { r } + 1 . } \end{array}
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
Note that $p , q , r \geq 1$ is also required, and that this only applies directly when there is a single input and output channel, which we assume in the remainder of this section for simplicity.
|
| 134 |
+
|
| 135 |
+
For EquiNorm, we have assumed that the input is positive, so that our input sum is equivalent to the $L _ { 1 }$ norm of the input. Additionally, after subtracting off the mean, the weight vector $w ^ { \prime }$ has $L _ { 1 }$ norm equal to $w ^ { \prime + } - w ^ { \prime - } = 2 w ^ { \prime + }$ , so we are also normalizing the weights by the $L _ { 1 }$ norm. In effect, we are applying Young’s convolution inequality with $p = q = r = 1$ .
|
| 136 |
+
|
| 137 |
+
It is also possible to apply the above inequality with $p = 2$ , $q = 1$ and $r = 2$ . I.e. normalize the weights using the $L _ { 2 }$ norm, giving a bound on the $L _ { 2 }$ norm of the output in terms of the $L _ { 1 }$ norm of the input. This is less satisfying as one convolution’s output is the input of another convolution (after passing through scaling $\&$ a nonlinearity) so we would like to use the same norm for both inputs and outputs. The related weight normalization (WN, Salimans & Kingma, 2016) method normalizes weights by their $L _ { 2 }$ norm, and differs from our method by centering outputs using an additional mean-only output batchnorm. Additionally, since it doesn’t normalize by the input norm, the output norm can be correspondingly large. These differences have a significant effect in practice.
|
| 138 |
+
|
| 139 |
+
# 5.2 ASSUMPTIONS
|
| 140 |
+
|
| 141 |
+
# INPUT TO THE CONVOLUTIONAL LAYER IS POSITIVE
|
| 142 |
+
|
| 143 |
+
This assumption is not necessary for the implementation of our method, rather it ensures that the output is more constrained than it otherwise would be. When ReLU nonlinearities are used in the standard fashion, this assumption holds except in the first layer of the network where input pixels are usually in the range [-1,1], due to pre-normalization. We recommend this pre-normalization is removed, as it is unnecessary when normalization happens immediately inside the first convolution. Recommendations in the literature that suggest input normalization is beneficial are usually referring to networks without per-layer normalization.
|
| 144 |
+
|
| 145 |
+
# NON-STRIDED CONVOLUTIONS
|
| 146 |
+
|
| 147 |
+
A strided convolution can thought of as a non-strided convolution with the extra output values thrown away. If Equilibrium normalization is used with a strided convolution, the contribution to the output from positive and negative weights will no longer be exactly balanced. In practice the violation will be small if the output of the non-strided version of the convolution is smooth.
|
| 148 |
+
|
| 149 |
+
# CYCLIC PADDING
|
| 150 |
+
|
| 151 |
+
Our equations for $b$ and $s$ assume that each weight for an input channel is multiplied by each input value for that channel. Most deep learning frameworks use zero-padded convolutions instead of cyclic padding, which violates this assumption. In practice we do not find this violation to be troublesome, as it only affects edge pixels, and has a dampening effect as it only reduces the output contribution of the positive or negative weights.
|
| 152 |
+
|
| 153 |
+
# ALL WEIGHTS ARE NON-ZERO, AND THERE EXISTS AT LEAST ONE POSITIVE AND ONENEGATIVE WEIGHT PER OUTPUT CHANNEL
|
| 154 |
+
|
| 155 |
+
We avoid the use of an $\epsilon$ parameter such as used in BatchNorm, as the denominator of our normalization factor is only zero if every weight for every input channel is simultaneously positive (or all negative), or the weights become extremely small. The later case does not appear to happen in practice. Nevertheless, we find it helps to initialize the weights in a balanced fashion, so that no channel’s weight kernel is all positive or all negative. We do this by modifying the default initialization by resampling any such kernel-weight’s signs.
|
| 156 |
+
|
| 157 |
+
# 6 EXPERIMENTS
|
| 158 |
+
|
| 159 |
+
In our plots we show a comparison to BatchNorm and GroupNorm. We omit a comparison to Layer/Instance Normalization as our initial experiments were consistant with findings in the literature that show that they are inferior to GroupNorm and BatchNorm, at least for the convolutional architectures we consider below (Yuxin Wu, 2018). We also performed a comparison against the WeightNorm method, however despite significant efforts we were not able to get it to reliably converge when using very deep architectures such as ResNet-152 that we choose for our experiments. We could not find any results in the literature where it is sucessfully applied to state-of-the-art deep networks, and we believe this is a real limitation of the method.
|
| 160 |
+
|
| 161 |
+
# 6.1 CIFAR-10/100
|
| 162 |
+
|
| 163 |
+
The CIFAR-10 dataset (Krizhevsky, 2009) is considered a standard benchmark among image classification tasks due to its non-trivial complexity, requiring tens of millions of weights to achieve state-of-the-art performance, and also its tractable training times due to its small size (60,000 instances). The downside of this small size is that significant care must be taken to avoid overfitting. This overfitting can be partially avoided using data augmentation, and we followed standard practice of using random horizontal flips and crops (pad 4px and crop to $3 2 \mathrm { p x }$ ) at training time only.
|
| 164 |
+
|
| 165 |
+
Our initial experiments involving a non-bottleneck wide ResNet network with 20 convolutions, 96 initial planes after first convolution and $9 . 7 \mathrm { m }$ parameters. The hyper-parameters used were LR: 0.1, $\mathbf { S } \mathbf { G } \mathbf { D } \mathbf { + } \mathbf { M } \mathbf { o } \mathbf { m }$ : 0.9, decay: 0.0001, batch-size: 128, 1 GPU, 10 fold learning reductions at epochs 150 and 225, and standard fan out normal initialization following He et al. (2015). These parameters are defaults commonly used with BatchNorm and were not tuned.
|
| 166 |
+
|
| 167 |
+
Our experiments indicated that our EquiNorm approach converged significantly faster than BatchNorm, but also overfit significantly more (Figure 2).
|
| 168 |
+
|
| 169 |
+
We believe this is caused by the batch statistics having less noise with EquiNorm than BatchNorm, rather than the faster initial convergence, as experiments involving reduced step sizes did not further improve generalization. Similarly, we were not able to achieve comparable fast initial convergence by using larger step-sizes with BatchNorm.
|
| 170 |
+
|
| 171 |
+

|
| 172 |
+
Figure 2: Indications of overfitting, as test loss starts to increase significantly after the first learning rate decrease.
|
| 173 |
+
|
| 174 |
+
We found instead that we could match the generalization of BatchNorm using either of the following two approaches:
|
| 175 |
+
|
| 176 |
+
1. Using fewer instances to compute the batch statistics. Using the first quarter of the batch to compute the statistics used for the full batch successfully fixed the overfitting seen in Figure 2, resulting in higher test accuracy for EquiNorm $( 9 5 . 8 \% )$ over BatchNorm $( 9 4 . 7 \% )$ and no overfitting visible in test loss.
|
| 177 |
+
2. Using mixup (Zhang et al., 2018) or manifold mixup (Verma et al., 2018), which introduce activation noise of a similar nature.
|
| 178 |
+
|
| 179 |
+
We recommend the use of manifold mixup, as it significantly improves test accuracy for both BatchNorm and EquiNorm, although it does result in higher test loss in some cases.
|
| 180 |
+
|
| 181 |
+
Following closely the approach of Verma et al. 2018, we applied both EquiNorm and BatchNorm to the larger near state-of-the-art pre-activation ResNet-152 architecture (He et al. 2016a, 58.1m parameters, [3,8,36,3] bottleneck blocks per layer respectively, 64 initial channels), using a modified version of their published code and the hyper-parameters listed above, with manifold mixup used for each method. As Figure 4a shows, the test set performance is essentially the same at the final epoch, but EquiNorm converges significantly faster at the early epochs.
|
| 182 |
+
|
| 183 |
+
# CIFAR100
|
| 184 |
+
|
| 185 |
+
We also achieved a similar performance on the CIFAR-100 dataset (which has similar properties to CIFAR10) as shown in Figure 4b, where we used the same hyper-parameters and network architecture as for CIFAR10.
|
| 186 |
+
|
| 187 |
+
# 6.2 SHORTER DURATION TRAINING
|
| 188 |
+
|
| 189 |
+
Given the encouraging results above during the early stages of optimization, we investigated if EquiNorm was superior when training is restricted to 30 epochs instead of 300. We used a “super convergence” learning rate schedule as suggested by Smith & Topin (2017), consisting of a 5 fold ramp in learning rate (starting at 0.1) from epochs 1 to 13, then a 5 fold ramp down to epoch 26, followed by further annealing by $1 0 0 \mathrm { x }$ down over the remaining epochs. Momentum follows a reverse pattern, from 0.95 to 0.85 to 0.95, and fixed at 0.85 after epoch 26. Manifold mixup was used again for both methods. Using this schedule EquiNorm shows a $9 4 . 0 \%$ (IQR 0.22) median test accuracy compared to $9 3 . 3 \%$ for BatchNorm (IQR 0.77).
|
| 190 |
+
|
| 191 |
+

|
| 192 |
+
Figure 3: Shorter duration CIFAR10 training (WRN network)
|
| 193 |
+
|
| 194 |
+
# 6.3 STREET VIEW HOUSE NUMBERS
|
| 195 |
+
|
| 196 |
+
The SVHN $^ +$ EXTRA dataset (Netzer et al., 2011) is much larger than CIFAR-10/100 $^ { 7 3 , 2 5 7 + }$ 531,131 training instances), so we trained across 2 GPUs, using $2 \times$ larger mini-batches (size 256) so as to keep the batch statistics noise (which are computed on a per-gpu basis) the same. Other hyper-parameters were also kept the same, with the exception that we trained for fewer epochs (with LR reductions moved to epochs 80 and 120). Figure 4c shows that EquiNorm achieves essentially the same generalization performance as BatchNorm. On this problem GroupNorm appears inferior, although this may be due to the default group-size of 32 being suboptimal here.
|
| 197 |
+
|
| 198 |
+
# 6.4 ILSVRC 2012 IMAGENET
|
| 199 |
+
|
| 200 |
+
We also ran some preliminary experiments on the ILSVRC 2012 ImageNet classification task using the standard ResNet50 architecture (He et al., 2016b). Our results here show a generalization gap between EquiNorm and BatchNorm/GroupNorm. It may be possible to eliminate this gap using additional regularisation as in the CIFAR-10 case, however we found manifold mixup to not yield such an improvement.
|
| 201 |
+
|
| 202 |
+
# 6.5 REPORTING TRAINING VARIABILITY
|
| 203 |
+
|
| 204 |
+
We are careful to report results aggregated over enough runs involving different RNG seeds so that run-to-run variability does not effect our conclusions. This is absolutely necessary for the smaller test problems above as the differences between runs can be comparable to the difference between the compared normalization methods, and indeed differences in reported results in the literature. We report median and inter-quartile statistics (i.e. our plots include point-wise $2 5 \%$ and $7 5 \%$ percentile ranges of the values seen), as these are more representative of actual performance, and particularly the asymmetry of test accuracy variability. The more commonly used two-standard-deviation bars based on a normal assumption can show values both below and above actually seen data (such as $> 1 0 0 \%$ accuracy upper bounds), and are not supported by statistical theory for small samples such as the ten used here.
|
| 205 |
+
|
| 206 |
+

|
| 207 |
+
Figure 4: Test set accuracy and loss. Median of 10 runs shown with interquartile regions overlaid with the exception of the ImageNet plot which uses 3 runs.
|
| 208 |
+
|
| 209 |
+
REFERENCES
|
| 210 |
+
|
| 211 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In Proceedings of the 2015 IEEE International Conference on Computer Vision (ICCV), ICCV ’15, pp. 1026– 1034, Washington, DC, USA, 2015. IEEE Computer Society. ISBN 978-1-4673-8391-2. doi: 10.1109/ICCV.2015.123. URL http://dx.doi.org/10.1109/ICCV.2015.123. 6.1
|
| 212 |
+
|
| 213 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. Technical report, Microsoft Research Asia, 2016a. 6.1
|
| 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, pp. 770–778, 2016b. 6.4
|
| 216 |
+
|
| 217 |
+
Sergey Ioffe. Batch renormalization: Towards reducing minibatch dependence in batchnormalized models. 31st Conference on Neural Information Processing Systems (NIPS 2017), 2017. 2
|
| 218 |
+
|
| 219 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. Proceedings of the 32nd International Conference on Machine Learning (ICML 2015), 2015. 1, 2
|
| 220 |
+
|
| 221 |
+
Kevin Jarrett, Koray Kavukcuoglu, Marc’Aurelio Ranzato, and Yann LeCun. What is the best multi-stage architecture for object recognition. International Conference on Computer Vision, 2009. 2
|
| 222 |
+
|
| 223 |
+
Geoffrey E. Hinton Jimmy Lei Ba, Jamie Ryan Kiros. Layer normalization. Deep Learning Symposium, NIPS 2016, 2016. 2
|
| 224 |
+
|
| 225 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009. 6.1
|
| 226 |
+
|
| 227 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. Imagenet classification with deep convolutional neural networks. 26th Conference on Neural Information Processing Systems (NIPS 2012), 2012. 2
|
| 228 |
+
|
| 229 |
+
Siwei Lyu and Eero P. Simoncelli. Nonlinear image representation using divisive normalization. IEEE Conference on Computer Vision and Pattern Recognition, 2008. 2
|
| 230 |
+
|
| 231 |
+
Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y. Ng. Reading digits in natural images with unsupervised feature learning. NIPS Workshop on Deep Learning and Unsupervised Feature Learning, 2011. 6.3
|
| 232 |
+
|
| 233 |
+
Tim Salimans and Diederik P. Kingma. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. 30th Conference on Neural Information Processing Systems (NIPS 2016), 2016. 2, 5.1
|
| 234 |
+
|
| 235 |
+
Shibani Santurkar, Dimitris Tsipras, Andrew Ilyas, and Aleksander Madry. How does batch normalization help optimization? (no, it is not about internal covariate shift). Technical report, MIT, 2018. 5.1
|
| 236 |
+
|
| 237 |
+
Leslie N. Smith and Nicholay Topin. Super-convergence: Very fast training of neural networks using large learning rates. Technical report, U.S. Naval Research Laboratory, 2017. 6.2
|
| 238 |
+
|
| 239 |
+
Vikas Verma, Alex Lamb, Christopher Beckham, Aaron Courville, Ioannis Mitliagkas, and Yoshua Bengio. Manifold mixup: Encouraging meaningful on-manifold interpolation as a regularizer. Technical report, Montreal Institute for Learning Algorithms, 2018. URL https://arxiv.org/pdf/1806.05236.pdf. 2, 6.1
|
| 240 |
+
|
| 241 |
+
Kaiming He Yuxin Wu. Group normalization. Technical report, Facebook, 2018. 2, 2, 6
|
| 242 |
+
|
| 243 |
+
Hongyi Zhang, Moustapha Cisse, Yann N. Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. International Conference on Learning Representations, 2018. 2
|
md/train/rylSzl-R-/rylSzl-R-.md
ADDED
|
@@ -0,0 +1,601 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ON UNIFYING DEEP GENERATIVE MODELS
|
| 2 |
+
|
| 3 |
+
Zhiting $\mathbf { H } \mathbf { u } ^ { 1 , 2 }$ Zichao Yang1 Ruslan Salakhutdinov1 Eric P. Xing1,2
|
| 4 |
+
Carnegie Mellon University1, Petuum Inc.2
|
| 5 |
+
|
| 6 |
+
# ABSTRACT
|
| 7 |
+
|
| 8 |
+
Deep generative models have achieved impressive success in recent years. Generative Adversarial Networks (GANs) and Variational Autoencoders (VAEs), as powerful frameworks for deep generative model learning, have largely been considered as two distinct paradigms and received extensive independent studies respectively. This paper aims to establish formal connections between GANs and VAEs through a new formulation of them. We interpret sample generation in GANs as performing posterior inference, and show that GANs and VAEs involve minimizing KL divergences of respective posterior and inference distributions with opposite directions, extending the two learning phases of classic wake-sleep algorithm, respectively. The unified view provides a powerful tool to analyze a diverse set of existing model variants, and enables to transfer techniques across research lines in a principled way. For example, we apply the importance weighting method in VAE literatures for improved GAN learning, and enhance VAEs with an adversarial mechanism that leverages generated samples. Experiments show generality and effectiveness of the transfered techniques.
|
| 9 |
+
|
| 10 |
+
# 1 INTRODUCTION
|
| 11 |
+
|
| 12 |
+
Deep generative models define distributions over a set of variables organized in multiple layers. Early forms of such models dated back to works on hierarchical Bayesian models (Neal, 1992) and neural network models such as Helmholtz machines (Dayan et al., 1995), originally studied in the context of unsupervised learning, latent space modeling, etc. Such models are usually trained via an EM style framework, using either a variational inference (Jordan et al., 1999) or a data augmentation (Tanner & Wong, 1987) algorithm. Of particular relevance to this paper is the classic wake-sleep algorithm dates by Hinton et al. (1995) for training Helmholtz machines, as it explored an idea of minimizing a pair of KL divergences in opposite directions of the posterior and its approximation.
|
| 13 |
+
|
| 14 |
+
In recent years there has been a resurgence of interests in deep generative modeling. The emerging approaches, including Variational Autoencoders (VAEs) (Kingma & Welling, 2013), Generative Adversarial Networks (GANs) (Goodfellow et al., 2014), Generative Moment Matching Networks (GMMNs) (Li et al., 2015; Dziugaite et al., 2015), auto-regressive neural networks (Larochelle & Murray, 2011; Oord et al., 2016), and so forth, have led to impressive results in a myriad of applications, such as image and text generation (Radford et al., 2015; Hu et al., 2017; van den Oord et al., 2016), disentangled representation learning (Chen et al., 2016; Kulkarni et al., 2015), and semi-supervised learning (Salimans et al., 2016; Kingma et al., 2014).
|
| 15 |
+
|
| 16 |
+
The deep generative model literature has largely viewed these approaches as distinct model training paradigms. For instance, GANs aim to achieve an equilibrium between a generator and a discriminator; while VAEs are devoted to maximizing a variational lower bound of the data log-likelihood. A rich array of theoretical analyses and model extensions have been developed independently for GANs (Arjovsky & Bottou, 2017; Arora et al., 2017; Salimans et al., 2016; Nowozin et al., 2016) and VAEs (Burda et al., 2015; Chen et al., 2017; Hu et al., 2017), respectively. A few works attempt to combine the two objectives in a single model for improved inference and sample generation (Mescheder et al., 2017; Larsen et al., 2015; Makhzani et al., 2015; Sønderby et al., 2017). Despite the significant progress specific to each method, it remains unclear how these apparently divergent approaches connect to each other in a principled way.
|
| 17 |
+
|
| 18 |
+
In this paper, we present a new formulation of GANs and VAEs that connects them under a unified view, and links them back to the classic wake-sleep algorithm. We show that GANs and VAEs involve minimizing opposite KL divergences of respective posterior and inference distributions, and extending the sleep and wake phases, respectively, for generative model learning. More specifically, we develop a reformulation of GANs that interprets generation of samples as performing posterior inference, leading to an objective that resembles variational inference as in VAEs. As a counterpart, VAEs in our interpretation contain a degenerated adversarial mechanism that blocks out generated samples and only allows real examples for model training.
|
| 19 |
+
|
| 20 |
+
The proposed interpretation provides a useful tool to analyze the broad class of recent GAN- and VAEbased algorithms, enabling perhaps a more principled and unified view of the landscape of generative modeling. For instance, one can easily extend our formulation to subsume InfoGAN (Chen et al., 2016) that additionally infers hidden representations of examples, VAE/GAN joint models (Larsen et al., 2015; Che et al., 2017a) that offer improved generation and reduced mode missing, and adversarial domain adaptation (ADA) (Ganin et al., 2016; Purushotham et al., 2017) that is traditionally framed in the discriminative setting.
|
| 21 |
+
|
| 22 |
+
The close parallelisms between GANs and VAEs further ease transferring techniques that were originally developed for improving each individual class of models, to in turn benefit the other class. We provide two examples in such spirit: 1) Drawn inspiration from importance weighted VAE (IWAE) (Burda et al., 2015), we straightforwardly derive importance weighted GAN (IWGAN) that maximizes a tighter lower bound on the marginal likelihood compared to the vanilla GAN. 2) Motivated by the GAN adversarial game we activate the originally degenerated discriminator in VAEs, resulting in a full-fledged model that adaptively leverages both real and fake examples for learning. Empirical results show that the techniques imported from the other class are generally applicable to the base model and its variants, yielding consistently better performance.
|
| 23 |
+
|
| 24 |
+
# 2 RELATED WORK
|
| 25 |
+
|
| 26 |
+
There has been a surge of research interest in deep generative models in recent years, with remarkable progress made in understanding several class of algorithms. The wake-sleep algorithm (Hinton et al., 1995) is one of the earliest general approaches for learning deep generative models. The algorithm incorporates a separate inference model for posterior approximation, and aims at maximizing a variational lower bound of the data log-likelihood, or equivalently, minimizing the KL divergence of the approximate posterior and true posterior. However, besides the wake phase that minimizes the KL divergence w.r.t the generative model, the sleep phase is introduced for tractability that minimizes instead the reversed KL divergence w.r.t the inference model. Recent approaches such as NVIL (Mnih & Gregor, 2014) and VAEs (Kingma & Welling, 2013) are developed to maximize the variational lower bound w.r.t both the generative and inference models jointly. To reduce the variance of stochastic gradient estimates, VAEs leverage reparametrized gradients. Many works have been done along the line of improving VAEs. Burda et al. (2015) develop importance weighted VAEs to obtain a tighter lower bound. As VAEs do not involve a sleep phase-like procedure, the model cannot leverage samples from the generative model for model training. Hu et al. (2017) combine VAEs with an extended sleep procedure that exploits generated samples for learning.
|
| 27 |
+
|
| 28 |
+
Another emerging family of deep generative models is the Generative Adversarial Networks (GANs) (Goodfellow et al., 2014), in which a discriminator is trained to distinguish between real and generated samples and the generator to confuse the discriminator. The adversarial approach can be alternatively motivated in the perspectives of approximate Bayesian computation (Gutmann et al., 2014) and density ratio estimation (Mohamed & Lakshminarayanan, 2016). The original objective of the generator is to minimize the log probability of the discriminator correctly recognizing a generated sample as fake. This is equivalent to minimizing a lower bound on the Jensen-Shannon divergence (JSD) of the generator and data distributions (Goodfellow et al., 2014; Nowozin et al., 2016; Huszar, 2016; Li, 2016). Besides, the objective suffers from vanishing gradient with strong discriminator. Thus in practice people have used another objective which maximizes the log probability of the discriminator recognizing a generated sample as real (Goodfellow et al., 2014; Arjovsky & Bottou, 2017). The second objective has the same optimal solution as with the original one. We base our analysis of GANs on the second objective as it is widely used in practice yet few theoretic analysis has been done on it. Numerous extensions of GANs have been developed, including combination with VAEs for improved generation (Larsen et al., 2015; Makhzani et al., 2015; Che et al., 2017a), and generalization of the objectives to minimize other f-divergence criteria beyond JSD (Nowozin et al., 2016; Sønderby et al., 2017). The adversarial principle has gone beyond the generation setting and been applied to other contexts such as domain adaptation (Ganin et al., 2016; Purushotham et al., 2017), and Bayesian inference (Mescheder et al., 2017; Tran et al., 2017; Huszar, 2017; Rosca et al., ´ 2017) which uses implicit variational distributions in VAEs and leverage the adversarial approach for optimization. This paper starts from the basic models of GANs and VAEs, and develops a general formulation that reveals underlying connections of different classes of approaches including many of the above variants, yielding a unified view of the broad set of deep generative modeling.
|
| 29 |
+
|
| 30 |
+
# 3 BRIDGING THE GAP
|
| 31 |
+
|
| 32 |
+
The structures of GANs and VAEs are at the first glance quite different from each other. VAEs are based on the variational inference approach, and include an explicit inference model that reverses the generative process defined by the generative model. On the contrary, in traditional view GANs lack an inference model, but instead have a discriminator that judges generated samples. In this paper, a key idea to bridge the gap is to interpret the generation of samples in GANs as performing inference, and the discrimination as a generative process that produces real/fake labels. The resulting new formulation reveals the connections of GANs to traditional variational inference. The reversed generation-inference interpretations between GANs and VAEs also expose their correspondence to the two learning phases in the classic wake-sleep algorithm.
|
| 33 |
+
|
| 34 |
+
For ease of presentation and to establish a systematic notation for the paper, we start with a new interpretation of Adversarial Domain Adaptation (ADA) (Ganin et al., 2016), the application of adversarial approach in the domain adaptation context. We then show GANs are a special case of ADA, followed with a series of analysis linking GANs, VAEs, and their variants in our formulation.
|
| 35 |
+
|
| 36 |
+
# 3.1 ADVERSARIAL DOMAIN ADAPTATION (ADA)
|
| 37 |
+
|
| 38 |
+
ADA aims to transfer prediction knowledge learned from a source domain to a target domain, by learning domain-invariant features (Ganin et al., 2016). That is, it learns a feature extractor whose output cannot be distinguished by a discriminator between the source and target domains.
|
| 39 |
+
|
| 40 |
+
We first review the conventional formulation of ADA. Figure 1(a) illustrates the computation flow. Let $_ { z }$ be a data example either in the source or target domain, and $y \in \{ 0 , 1 \}$ the domain indicator with $y = 0$ indicating the target domain and $y = 1$ the source domain. The data distributions conditioning on the domain are then denoted as $p ( z | y )$ . The feature extractor $G _ { \theta }$ parameterized with $\pmb \theta$ maps $_ z$ to feature $\pmb { x } = G _ { \theta } ( \pmb { z } )$ . To enforce domain invariance of feature $_ { \textbf { \em x } }$ , a discriminator $D _ { \phi }$ is learned. Specifically, $D _ { \phi } ( \pmb { x } )$ outputs the probability that $_ { \textbf { \em x } }$ comes from the source domain, and the discriminator is trained to maximize the binary classification accuracy of recognizing the domains:
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
\begin{array} { r } { \operatorname* { m a x } _ { \phi } \mathcal { L } _ { \phi } = \mathbb { E } _ { \alpha = G _ { \theta } ( z ) , z \sim p ( z | y = 1 ) } \left[ \log D _ { \phi } ( \pmb { x } ) \right] + \mathbb { E } _ { \mathbf { x } = G _ { \theta } ( z ) , z \sim p ( z | y = 0 ) } \left[ \log ( 1 - D _ { \phi } ( \pmb { x } ) ) \right] . } \end{array}
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
The feature extractor $G _ { \theta }$ is then trained to fool the discriminator:
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\begin{array} { r } { \operatorname* { m a x } _ { \theta } \mathcal { L } _ { \theta } = \mathbb { E } _ { s = G _ { \theta } ( z ) , z \sim p ( z | y = 1 ) } \left[ \log \bigl ( 1 - D _ { \phi } ( \mathbf { x } ) \bigr ) \right] + \mathbb { E } _ { s = G _ { \theta } ( z ) , z \sim p ( z | y = 0 ) } \left[ \log D _ { \phi } ( \mathbf { x } ) \right] . } \end{array}
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
Please see the supplementary materials for more details of ADA.
|
| 53 |
+
|
| 54 |
+
With the background of conventional formulation, we now frame our new interpretation of ADA. The data distribution $p ( z | y )$ and deterministic transformation $G _ { \theta }$ together form an implicit distribution over $_ { \textbf { \em x } }$ , denoted as $p _ { \theta } ( { \pmb x } | { \boldsymbol y } )$ , which is intractable to evaluate likelihood but easy to sample from. Let $p ( y )$ be the distribution of the domain indicator $y$ , e.g., a uniform distribution as in Eqs.(1)-(2). The discriminator defines a conditional distribution $q _ { \phi } ( y | \pmb { x } ) = D _ { \phi } ( \pmb { x } )$ . Let $q _ { \phi } ^ { r } ( y | \mathbf { x } ) = q _ { \phi } ( 1 - y | \mathbf { x } )$ be the reversed distribution over domains. The objectives of ADA are therefore rewritten as (omitting the constant scale factor 2):
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\begin{array} { r l } & { \operatorname* { m a x } _ { \phi } \mathcal { L } _ { \phi } = \mathbb { E } _ { p _ { \theta } ( \pmb { x } | \pmb { y } ) p ( \pmb { y } ) } \left[ \log q _ { \phi } ( \pmb { y } | \pmb { x } ) \right] } \\ & { \operatorname* { m a x } _ { \theta } \mathcal { L } _ { \theta } = \mathbb { E } _ { p _ { \theta } ( \pmb { x } | \pmb { y } ) p ( \pmb { y } ) } \left[ \log q _ { \phi } ^ { r } ( \pmb { y } | \pmb { x } ) \right] . } \end{array}
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
Note that $_ { z }$ is encapsulated in the implicit distribution $p _ { \theta } ( { \pmb x } | { \boldsymbol y } )$ . The only difference of the objectives of $\pmb \theta$ from $\phi$ is the replacement of $q ( y | { \pmb x } )$ with $q ^ { r } ( y | \mathbf { x } )$ . This is where the adversarial mechanism comes about. We defer deeper interpretation of the new objectives in the next subsection.
|
| 61 |
+
|
| 62 |
+

|
| 63 |
+
Figure 1: (a) Conventional view of ADA. To make direct correspondence to GANs, we use $_ { z }$ to denote the data and $_ { \textbf { \em x } }$ the feature. Subscripts src and tgt denote source and target domains, respectively. (b) Conventional view of GANs. (c) Schematic graphical model of both ADA and GANs (Eq.3). Arrows with solid lines denote generative process; arrows with dashed lines denote inference; hollow arrows denote deterministic transformation leading to implicit distributions; and blue arrows denote adversarial mechanism that involves respective conditional distribution $q$ and its reverse $q ^ { r }$ , e.g., $q ( y | { \pmb x } )$ and $q ^ { r } ( y | \mathbf { x } )$ (denoted as $q ^ { ( r ) } ( y | \mathbf { x } )$ for short). Note that in GANs we have interpreted $_ { \pmb { x } }$ as latent variable and $( z , y )$ as visible. (d) InfoGAN (Eq.9), which, compared to GANs, adds conditional generation of code $_ { z }$ with distribution $q _ { \eta } ( z | \boldsymbol { x } , y )$ . (e) VAEs (Eq.12), which is obtained by swapping the generation and inference processes of InfoGAN, i.e., in terms of the schematic graphical model, swapping solid-line arrows (generative process) and dashed-line arrows (inference) of (d).
|
| 64 |
+
|
| 65 |
+
# 3.2 GENERATIVE ADVERSARIAL NETWORKS (GANS)
|
| 66 |
+
|
| 67 |
+
GANs (Goodfellow et al., 2014) can be seen as a special case of ADA. Taking image generation for example, intuitively, we want to transfer the properties of real image (source domain) to generated image (target domain), making them indistinguishable to the discriminator. Figure 1(b) shows the conventional view of GANs.
|
| 68 |
+
|
| 69 |
+
Formally, $_ { \textbf { \em x } }$ now denotes a real example or a generated sample, $_ z$ is the respective latent code. For the generated sample domain $( y = 0$ ), the implicit distribution $p _ { \theta } ( { \pmb x } | y = 0 )$ is defined by the prior of $_ z$ and the generator $G _ { \theta } ( z )$ , which is also denoted as $p _ { g _ { \theta } } ( \pmb { x } )$ in the literature. For the real example domain $( y = 1 )$ ), the code space and generator are degenerated, and we are directly presented with a fixed distribution $p ( { \pmb x } | y = 1 )$ , which is just the real data distribution $p _ { d a t a } ( \pmb { x } )$ . Note that $p _ { d a t a } ( \pmb { x } )$ is also an implicit distribution and allows efficient empirical sampling. In summary, the conditional distribution over $_ { \textbf { \em x } }$ is constructed as
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
p _ { \theta } ( \pmb { x } | y ) = \left\{ \begin{array} { l l } { p _ { g _ { \theta } } ( \pmb { x } ) } & { y = 0 } \\ { p _ { d a t a } ( \pmb { x } ) } & { y = 1 . } \end{array} \right.
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
Here, free parameters $\pmb \theta$ are only associated with $p _ { g _ { \theta } } ( \pmb { x } )$ of the generated sample domain, while $p _ { d a t a } ( \pmb { x } )$ is constant. As in ADA, discriminator $D _ { \phi }$ is simultaneously trained to infer the probability that $_ { \textbf { \em x } }$ comes from the real data domain. That is, $q _ { \phi } ( y = 1 | \pmb { x } ) = D _ { \phi } ( \pmb { x } )$ .
|
| 76 |
+
|
| 77 |
+
With the established correspondence between GANs and ADA, we can see that the objectives of GANs are precisely expressed as Eq.(3). To make this clearer, we recover the classical form by unfolding over $y$ and plugging in conventional notations. For instance, the objective of the generative parameters $\pmb \theta$ in Eq.(3) is translated into
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\begin{array} { r l } & { \operatorname* { m a x } _ { \theta } \mathcal { L } _ { \theta } = \mathbb { E } _ { p _ { \theta } ( \alpha | y = 0 ) p ( y = 0 ) } \left[ \log q _ { \phi } ^ { r } ( y = 0 | x ) \right] + \mathbb { E } _ { p _ { \theta } ( \alpha | y = 1 ) p ( y = 1 ) } \left[ \log q _ { \phi } ^ { r } ( y = 1 | x ) \right] } \\ & { \phantom { = \ } = \frac { 1 } { 2 } \mathbb { E } _ { \alpha = G _ { \theta } ( z ) , z \sim p ( z | y = 0 ) } \left[ \log D _ { \phi } ( x ) \right] + c o n s t , } \end{array}
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
where $p ( y )$ is uniform and results in the constant scale factor $1 / 2$ . As noted in sec.2, we focus on the unsaturated objective for the generator (Goodfellow et al., 2014), as it is commonly used in practice yet still lacks systematic analysis.
|
| 84 |
+
|
| 85 |
+
New Interpretation Let us take a closer look into the form of Eq.(3). It closely resembles the data reconstruction term of a variational lower bound by treating $y$ as visible variable while $_ { \textbf { \em x } }$ as latent (as in ADA). That is, we are essentially reconstructing the real/fake indicator $y$ (or its reverse $1 - y )$ with the “generative distribution” $q _ { \phi } ( y | \mathbf { x } )$ and conditioning on $_ { \textbf { \em x } }$ from the “inference distribution” $p _ { \theta } ( { \pmb x } | { \boldsymbol y } )$ . Figure 1(c) shows a schematic graphical model that illustrates such generative and inference processes. (Sec.D in the supplementary materials gives an example of translating a given schematic graphical model into mathematical formula.) We go a step further to reformulate the objectives and reveal more insights to the problem. In particular, for each optimization step of $p _ { \theta } ( \pmb { x } | \boldsymbol { y } )$ at point $( \theta _ { 0 } , \phi _ { 0 } )$ in the parameter space, we have:
|
| 86 |
+
|
| 87 |
+

|
| 88 |
+
Figure 2: One optimization step of the parameter $\pmb \theta$ through Eq.(6) at point $\pmb { \theta } _ { 0 }$ . The posterior $q ^ { r } ( { \pmb x } | y )$ is a mixture of $p _ { \theta _ { 0 } } ( { \pmb x } | y = 0 )$ (blue) and $p _ { \theta _ { 0 } } \bar { ( \mathbf { \mathscr { x } } | \boldsymbol { y } = 1 ) }$ (red in the left panel) with the mixing weights induced from $q _ { \phi _ { 0 } } ^ { r } ( y | \mathbf { x } )$ . Minimizing the KLD drives $p _ { \theta } ( \mathbf { \dot { x } } | y = 0 )$ ) towards the respective mixture $\bar { q ^ { r } } ( { \pmb x } | y = 0 )$ (green), resulting in a new state where $p _ { \theta ^ { n e w } } ( { \pmb x } | y = 0 ) = p _ { g _ { \theta ^ { n e w } } } ( { \pmb x } )$ (red in the right panel) gets closer to $p _ { \theta _ { 0 } } ( { \pmb x } | y = 1 ) = p _ { d a t a } ( { \pmb x } )$ . Due to the asymmetry of KLD, $p _ { g _ { \theta ^ { n e w } } } ( \pmb { x } )$ missed the smaller mode of the mixture $q ^ { r } ( { \pmb x } | y = 0 )$ which is a mode of $p _ { d a t a } ( \pmb { x } )$ .
|
| 89 |
+
|
| 90 |
+
Lemma 1. Let $p ( y )$ be the uniform distribution. Let $p _ { \theta _ { 0 } } ( \pmb { x } ) = \mathbb { E } _ { p ( \pmb { y } ) } [ p _ { \theta _ { 0 } } ( \pmb { x } | \pmb { y } ) ] ,$ , and $q ^ { r } ( \pmb { x } | y ) ~ \propto$ $q _ { \phi _ { 0 } } ^ { r } ( y | \mathbf { x } ) p _ { \theta _ { 0 } } ( \pmb { x } )$ . Therefore, the updates of $\pmb \theta$ at $\pmb { \theta } _ { 0 }$ have
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
\begin{array} { r l } & { \nabla _ { \theta } \Big [ - \mathbb { E } _ { p _ { \theta } ( \alpha \vert y ) p ( y ) } \left[ \log q _ { \phi _ { 0 } } ^ { r } ( y \vert \alpha ) \right] \Big ] \Big \vert _ { \theta = \theta _ { 0 } } = } \\ & { \nabla _ { \theta } \Big [ \mathbb { E } _ { p ( y ) } \left[ K L \left( p _ { \theta } ( \alpha \vert y ) \middle \vert \middle \vert q ^ { r } ( x \vert y ) \right) \right] - J S D \left( p _ { \theta } ( x \vert y = 0 ) \middle \vert \middle \vert p _ { \theta } ( x \vert y = 1 ) \right) \Big ] \Big \vert _ { \theta = \theta _ { 0 } } , } \end{array}
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
where $K L ( \cdot \| \cdot )$ and $J S D ( \cdot \| \cdot )$ are the $K L$ and Jensen-Shannon Divergences, respectively.
|
| 97 |
+
|
| 98 |
+
Proofs are in the supplements (sec.B). Eq.(6) offers several insights into the GAN generator learning:
|
| 99 |
+
|
| 100 |
+
• Resemblance to variational inference. As above, we see $_ { \textbf { \em x } }$ as latent and $p _ { \theta } ( { \pmb x } | { \boldsymbol y } )$ as the inference distribution. The $p _ { \theta _ { 0 } } ( { \pmb x } )$ is fixed to the starting state of the current update step, and can naturally be seen as the prior over $_ { \textbf { \em x } }$ . By definition $q ^ { r } ( { \pmb x } | y )$ that combines the prior $p _ { \theta _ { 0 } } ( { \pmb x } )$ and the generative distribution $q _ { \phi _ { 0 } } ^ { r } ( y | \mathbf { x } )$ thus serves as the posterior. Therefore, optimizing the generator $G _ { \theta }$ is equivalent to minimizing the KL divergence between the inference distribution and the posterior (a standard from of variational inference), minus a JSD between the distributions $p _ { g _ { \theta } } ( \pmb { x } )$ and $p _ { d a t a } ( \pmb { x } )$ . The interpretation further reveals the connections to VAEs, as discussed later.
|
| 101 |
+
|
| 102 |
+
• Training dynamics. By definition, $p _ { \theta _ { 0 } } ( { \pmb x } ) = ( p _ { g _ { \theta _ { 0 } } } ( { \pmb x } ) + p _ { d a t a } ( { \pmb x } ) ) / 2$ is a mixture of $p _ { g _ { \theta _ { 0 } } } ( \pmb { x } )$ and $p _ { d a t a } ( \pmb { x } )$ with uniform mixing weights, so the posterior $q ^ { r } ( { \pmb x } | y ) \propto q _ { \phi _ { 0 } } ^ { r } ( y | { \pmb x } ) p _ { \theta _ { 0 } } ( { \pmb x } )$ is also a mixture of $p _ { g _ { \theta _ { 0 } } } ( \pmb { x } )$ and $p _ { d a t a } ( \pmb { x } )$ with mixing weights induced from the discriminator $q _ { \phi _ { 0 } } ^ { r } ( y | \mathbf { x } )$ . For the KL divergence to minimize, the component with $y = 1$ is $\begin{array} { r } { \mathrm { K L } \left( p _ { \theta } ( \pmb { x } | y = 1 ) \| q ^ { r } ( \pmb { x } | y = 1 ) \right) = } \end{array}$ $\mathrm { K L } \left( p _ { d a t a } ( \pmb { x } ) | | q ^ { r } ( \pmb { x } | y = 1 ) \right)$ which is a constant. The active component for optimization is with $y = 0$ , i.e., $\mathrm { K L } \left( p _ { \theta } ( { \pmb x } | y = 0 ) \| { \boldsymbol q } ^ { r } ( { \pmb x } | y = 0 ) \right) = \mathrm { K L } \left( p _ { g _ { \theta } } ( { \pmb x } ) \| { \boldsymbol q } ^ { r } ( { \pmb x } | y = 0 ) \right)$ . Thus, minimizing the KL divergence in effect drives $p _ { g _ { \theta } } ( \pmb { x } )$ to a mixture of $p _ { g _ { \theta _ { 0 } } } ( { \pmb x } )$ and $p _ { d a t a } ( \pmb { x } )$ . Since $p _ { d a t a } ( \pmb { x } )$ is fixed, $p _ { g _ { \theta } } ( \pmb { x } )$ gets closer to $p _ { d a t a } ( \pmb { x } )$ . Figure 2 illustrates the training dynamics schematically.
|
| 103 |
+
|
| 104 |
+
• The JSD term. The negative JSD term is due to the introduction of the prior $p _ { \theta _ { 0 } } ( { \pmb x } )$ . This term pushes $p _ { g _ { \theta } } ( \pmb { x } )$ away from $p _ { d a t a } ( \pmb { x } )$ , which acts oppositely from the KLD term. However, we show that the JSD term is upper bounded by the KLD term (sec.C). Thus, if the KLD term is sufficiently minimized, the magnitude of the JSD also decreases. Note that we do not mean the JSD is insignificant or negligible. Instead conclusions drawn from Eq.(6) should take the JSD term into account.
|
| 105 |
+
|
| 106 |
+
• Explanation of missing mode issue. JSD is a symmetric divergence measure while KLD is non-symmetric. The missing mode behavior widely observed in GANs (Metz et al., 2017; Che et al., 2017a) is thus explained by the asymmetry of the KLD which tends to concentrate $p _ { \boldsymbol { \theta } } ( \mathbf { \boldsymbol { x } } | \boldsymbol { y } )$ to large modes of $q ^ { r } ( { \pmb x } | { \pmb y } )$ and ignore smaller ones. See Figure 2 for the illustration. Concentration to few large modes also facilitates GANs to generate sharp and realistic samples.
|
| 107 |
+
|
| 108 |
+
• Optimality assumption of the discriminator. Previous theoretical works have typically assumed (near) optimal discriminator (Goodfellow et al., 2014; Arjovsky & Bottou, 2017):
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
q _ { \phi _ { 0 } } ( y | x ) \approx \frac { p _ { \theta _ { 0 } } ( x | y = 1 ) } { p _ { \theta _ { 0 } } ( x | y = 0 ) + p _ { \theta _ { 0 } } ( x | y = 1 ) } = \frac { p _ { d a t a } ( x ) } { p _ { g _ { \theta _ { 0 } } } ( x ) + p _ { d a t a } ( x ) } ,
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
which can be unwarranted in practice due to limited expressiveness of the discriminator (Arora et al., 2017). In contrast, our result does not rely on the optimality assumptions. Indeed, our result is a generalization of the previous theorem in (Arjovsky & Bottou, 2017), which is recovered by
|
| 115 |
+
|
| 116 |
+
plugging Eq.(7) into Eq.(6):
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\nabla _ { \theta } \bigg [ - \mathbb { E } _ { p _ { \theta } ( \alpha | y ) p ( y ) } [ \log { q _ { \phi _ { 0 } } ^ { r } ( y | x ) } ] \bigg ] \bigg | _ { \theta = \theta _ { 0 } } = \nabla _ { \theta } [ \frac { 1 } { 2 } \mathrm { K L } ( p _ { g _ { \theta } } \| p _ { d a t a } ) - \mathrm { J S D } ( p _ { g _ { \theta } } \| p _ { d a t a } ) ] \bigg | _ { \theta = \theta _ { 0 } } ,
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
which gives simplified explanations of the training dynamics and the missing mode issue only when the discriminator meets certain optimality criteria. Our generalized result enables understanding of broader situations. For instance, when the discriminator distribution $q _ { \phi _ { 0 } } ( y | \mathbf { x } )$ gives uniform guesses, or when $p _ { g _ { \theta } } = p _ { d a t a }$ that is indistinguishable by the discriminator, the gradients of the KL and JSD terms in Eq.(6) cancel out, which stops the generator learning.
|
| 123 |
+
|
| 124 |
+
InfoGAN Chen et al. (2016) developed InfoGAN which additionally recovers (part of) the latent code $_ z$ given sample $_ { \textbf { \em x } }$ . This can straightforwardly be formulated in our framework by introducing an extra conditional $q _ { \eta } ( z | \boldsymbol { x } , y )$ parameterized by $\eta$ . As discussed above, GANs assume a degenerated code space for real examples, thus $q _ { \eta } ( z | \mathbf { x } , y = 1 )$ is fixed without free parameters to learn, and $\eta$ is only associated to $y = 0$ . The InfoGAN is then recovered by combining $q _ { \eta } ( z | \boldsymbol { x } , y )$ with $q _ { \phi } ( y | \mathbf { x } )$ in Eq.(3) to perform full reconstruction of both $_ z$ and $y$ :
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\begin{array} { r l } & { \operatorname* { m a x } _ { \pmb { \phi } } \mathcal { L } _ { \phi } = \mathbb { E } _ { p _ { \theta } ( \pmb { x } | y ) p ( y ) } \left[ \log q _ { \eta } ( z | \pmb { x } , y ) q _ { \phi } ( y | \pmb { x } ) \right] } \\ & { \operatorname* { m a x } _ { \pmb { \theta } , \eta } \mathcal { L } _ { \theta , \eta } = \mathbb { E } _ { p _ { \theta } ( \pmb { x } | y ) p ( y ) } \left[ \log q _ { \eta } ( z | \pmb { x } , y ) q _ { \phi } ^ { r } ( y | \pmb { x } ) \right] . } \end{array}
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
Again, note that $_ { z }$ is encapsulated in the implicit distribution $p _ { \theta } ( { \pmb x } | { \boldsymbol y } )$ . The model is expressed as the schematic graphical model in Figure 1(d). Let $q ^ { r } ( { \pmb x } | z , y ) \propto q _ { \eta _ { 0 } } ( z | { \pmb x } , y ) q _ { \phi _ { 0 } } ^ { r } ( y | { \pmb x } ) p _ { \theta _ { 0 } } ( { \pmb x } )$ be the augmented “posterior”, the result in the form of Lemma.1 still holds by adding $_ z$ -related conditionals:
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\begin{array} { r l } & { \nabla _ { \theta } \Big [ - \mathbb { E } _ { p _ { \theta } ( x \mid y ) p ( y ) } \left[ \log q _ { \eta _ { 0 } } ( z | \mathbf { x } , y ) q _ { \phi _ { 0 } } ^ { r } ( y | \mathbf { x } ) \right] \Big ] \Big | _ { \theta = \theta _ { 0 } } = } \\ & { \nabla _ { \theta } \Big [ \mathbb { E } _ { p ( y ) } \left[ { \mathrm { K L } } \left( p _ { \theta } ( \mathbf { x } | y ) \big | \big | q ^ { r } ( \mathbf { x } | z , y ) \right) \right] - { \mathrm { J S D } } \left( p _ { \theta } ( \mathbf { x } | y = 0 ) \big | \big | p _ { \theta } ( \mathbf { x } | y = 1 ) \right) \Big ] \Big | _ { \theta = \theta _ { 0 } } , } \end{array}
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
The new formulation is also generally applicable to other GAN-related variants, such as Adversarial Autoencoder (Makhzani et al., 2015), Predictability Minimization (Schmidhuber, 1992), and cycleGAN (Zhu et al., 2017). In the supplements we provide interpretations of the above models.
|
| 137 |
+
|
| 138 |
+
# 3.3 VARIATIONAL AUTOENCODERS (VAES)
|
| 139 |
+
|
| 140 |
+
We next explore the second family of deep generative modeling. The resemblance of GAN generator learning to variational inference (Lemma.1) suggests strong relations between VAEs (Kingma & Welling, 2013) and GANs. We build correspondence between them, and show that VAEs involve minimizing a KLD in an opposite direction, with a degenerated adversarial discriminator.
|
| 141 |
+
|
| 142 |
+
The conventional definition of VAEs is written as:
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
\begin{array} { r } { \operatorname* { m a x } _ { \theta , \eta } \mathcal { L } _ { \theta , \eta } ^ { \mathrm { v a e } } = \mathbb { E } _ { p _ { d a t a } ( \mathbf { x } ) } \Big [ \mathbb { E } _ { \tilde { q } _ { \eta } ( z | \mathbf { x } ) } \left[ \log \tilde { p } _ { \theta } ( \pmb { x } | z ) \right] - \mathrm { K L } ( \tilde { q } _ { \eta } ( z | \pmb { x } ) \| \tilde { p } ( z ) ) \Big ] , } \end{array}
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
where $\tilde { p } _ { \boldsymbol { \theta } } ( \pmb { x } | \boldsymbol { z } )$ is the generator, $\tilde { q } _ { \eta } ( \boldsymbol { z } | \boldsymbol { x } )$ the inference model, and $\tilde { p } ( z )$ the prior. The parameters to learn are intentionally denoted with the notations of corresponding modules in GANs. VAEs appear to differ from GANs greatly as they use only real examples and lack adversarial mechanism.
|
| 149 |
+
|
| 150 |
+
To connect to GANs, we assume a perfect discriminator $q _ { * } ( y | { \pmb x } )$ which always predicts $y = 1$ with probability 1 given real examples, and $y = 0$ given generated samples. Again, for notational simplicity, let $\dot { q _ { * } ^ { r } } ( y | \mathbf { \bar { x } } ) = q _ { * } ( 1 - y | \mathbf { \bar { x } } )$ be the reversed distribution.
|
| 151 |
+
|
| 152 |
+
Lemma 2. Let $p _ { \theta } ( z , y | \pmb { x } ) \propto p _ { \theta } ( \pmb { x } | z , y ) p ( z | y ) p ( y )$ . The VAE objective $\mathcal { L } _ { \theta , \eta } ^ { \nu a e }$ in Eq.(11) is equivalent to (omitting the constant scale factor 2):
|
| 153 |
+
|
| 154 |
+
$$
|
| 155 |
+
\begin{array} { r l } & { \mathcal { L } _ { \theta , \eta } ^ { v o e } = \mathbb { E } _ { p _ { \theta _ { 0 } } ( \mathbf { x } ) } \left[ \mathbb { E } _ { q _ { \eta } ( z | \mathbf { x } , y ) q _ { * } ^ { r } ( y | \mathbf { x } ) } \left[ \log p _ { \theta } ( \pmb { x } | z , y ) \right] - K L \left( q _ { \eta } ( z | \mathbf { x } , y ) q _ { * } ^ { r } ( y | \mathbf { x } ) \right| \left| p ( z | y ) p ( y ) \right) \right] } \\ & { \qquad = \mathbb { E } _ { p _ { \theta _ { 0 } } ( \mathbf { x } ) } \Big [ - K L \left( q _ { \eta } ( z | \mathbf { x } , y ) q _ { * } ^ { r } ( y | \mathbf { x } ) \right| \left| p _ { \theta } ( z , y | \mathbf { x } ) \right) \Big ] . } \end{array}
|
| 156 |
+
$$
|
| 157 |
+
|
| 158 |
+
Here most of the components have exact correspondences (and the same definitions) in GANs and InfoGAN (see Table 1), except that the generation distribution $p _ { \theta } ( \pmb { x } | \pmb { z } , y )$ differs slightly from its
|
| 159 |
+
|
| 160 |
+
<table><tr><td>Components</td><td>ADA</td><td>GANs / InfoGAN</td><td>VAEs</td></tr><tr><td>x</td><td>features</td><td>data/generations</td><td>data/generations</td></tr><tr><td>y</td><td>domain indicator</td><td>real/fake indicator</td><td>real/fake indicator (degenerated)</td></tr><tr><td>2</td><td>data examples</td><td>code vector</td><td>code vector</td></tr><tr><td>pe(xly)</td><td>feature distr.</td><td>[I] generator, Eq.4</td><td>[G] pe(x|z,y),generator,Eq.13</td></tr><tr><td>q(ylx)</td><td>discriminator</td><td>[G] discriminator</td><td>[I] q*(y|x),discriminator (degenerated)</td></tr><tr><td>qn(zlxc,y)</td><td></td><td>[G] infer net (InfoGAN)</td><td>[I] infer net</td></tr><tr><td>KLD to min</td><td> same as GANs</td><td>KL(pe(xly)llqT(xly))</td><td>KL(qn(z|x,y)q(y|x)llpe(z,ylx))</td></tr></table>
|
| 161 |
+
|
| 162 |
+
Table 1: Correspondence between different approaches in the proposed formulation. The label “[G]” in bold indicates the respective component is involved in the generative process within our interpretation, while “[I]” indicates inference process. This is also expressed in the schematic graphical models in Figure 1.
|
| 163 |
+
|
| 164 |
+
counterpart $p _ { \theta } ( { \pmb x } | { \boldsymbol y } )$ in Eq.(4) to additionally account for the uncertainty of generating $_ { \textbf { \em x } }$ given $_ z$
|
| 165 |
+
|
| 166 |
+
$$
|
| 167 |
+
p _ { \theta } ( \pmb { x } | \boldsymbol { z } , y ) = \left\{ \begin{array} { l l } { \tilde { p } _ { \theta } ( \pmb { x } | \boldsymbol { z } ) } & { y = 0 } \\ { p _ { d a t a } ( \pmb { x } ) } & { y = 1 . } \end{array} \right.
|
| 168 |
+
$$
|
| 169 |
+
|
| 170 |
+
We provide the proof of Lemma 2 in the supplementary materials. Figure 1(e) shows the schematic graphical model of the new interpretation of VAEs, where the only difference from InfoGAN (Figure 1(d)) is swapping the solid-line arrows (generative process) and dashed-line arrows (inference). As in GANs and InfoGAN, for the real example domain with $y = 1$ , both $q _ { \eta } ( z | \mathbf { x } , y = 1 )$ ) and $p _ { \theta } ( { \pmb x } | { \pmb z } , y = 1 )$ are constant distributions. Since given a fake sample $_ { \textbf { \em x } }$ from $p _ { \theta _ { 0 } } ( { \pmb x } )$ , the reversed perfect discriminator $q _ { * } ^ { r } ( y | { \pmb x } )$ always predicts $y = 1$ with probability 1, the loss on fake samples is ∗therefore degenerated to a constant, which blocks out fake samples from contributing to learning.
|
| 171 |
+
|
| 172 |
+
# 3.4 CONNECTING GANS AND VAES
|
| 173 |
+
|
| 174 |
+
Table 1 summarizes the correspondence between the approaches. Lemma.1 and Lemma.2 have revealed that both GANs and VAEs involve minimizing a KLD of respective inference and posterior distributions. In particular, GANs involve minimizing the $K L \big ( p _ { \boldsymbol { \theta } } ( \dot { \mathbf { x } _ { | \boldsymbol { y } } } ) \big | \big | q ^ { r } ( \mathbf { x } | \boldsymbol { y } ) \big )$ while VAEs the $K L ( q _ { \eta } ( z | \mathbf { x } , y ) q _ { * } ^ { r } ( y | \mathbf { x } ) \big | \big | p _ { \theta } ( z , y | \mathbf { x } ) \big )$ . This exposes several new connections between the two model classes, each of which in turn leads to a set of existing research, or can inspire new research directions:
|
| 175 |
+
|
| 176 |
+
1) As discussed in Lemma.1, GANs now also relate to the variational inference algorithm as with VAEs, revealing a unified statistical view of the two classes. Moreover, the new perspective naturally enables many of the extensions of VAEs and vanilla variational inference algorithm to be transferred to GANs. We show an example in the next section.
|
| 177 |
+
2) The generator parameters $\pmb \theta$ are placed in the opposite directions in the two KLDs. The asymmetry of KLD leads to distinct model behaviors. For instance, as discussed in Lemma.1, GANs are able to generate sharp images but tend to collapse to one or few modes of the data (i.e., mode missing). In contrast, the KLD of VAEs tends to drive generator to cover all modes of the data distribution but also small-density regions (i.e., mode covering), which usually results in blurred, implausible samples. This naturally inspires combination of the two KLD objectives to remedy the asymmetry. Previous works have explored such combinations, though motivated in different perspectives (Larsen et al., 2015; Che et al., 2017a; Pu et al., 2017). We discuss more details in the supplements.
|
| 178 |
+
3) VAEs within our formulation also include an adversarial mechanism as in GANs. The discriminator is perfect and degenerated, disabling generated samples to help with learning. This inspires activating the adversary to allow learning from samples. We present a simple possible way in the next section.
|
| 179 |
+
4) GANs and VAEs have inverted latent-visible treatments of $( z , y )$ and $_ { \textbf { \em x } }$ , since we interpret sample generation in GANs as posterior inference. Such inverted treatments strongly relates to the symmetry of the sleep and wake phases in the wake-sleep algorithm, as presented shortly. In sec.6, we provide a more general discussion on a symmetric view of generation and inference.
|
| 180 |
+
|
| 181 |
+
# 3.5 CONNECTING TO WAKE SLEEP ALGORITHM (WS)
|
| 182 |
+
|
| 183 |
+
Wake-sleep algorithm (Hinton et al., 1995) was proposed for learning deep generative models such as Helmholtz machines (Dayan et al., 1995). WS consists of wake phase and sleep phase, which
|
| 184 |
+
|
| 185 |
+
optimize the generative model and inference model, respectively. We follow the above notations, and introduce new notations $^ { h }$ to denote general latent variables and $\lambda$ to denote general parameters. The wake sleep algorithm is thus written as:
|
| 186 |
+
|
| 187 |
+
$$
|
| 188 |
+
\begin{array} { r l } & { \mathrm { W a k e : } \quad \operatorname* { m a x } _ { \pmb { \theta } } \mathbb { E } _ { q _ { \lambda } ( \pmb { h } | \pmb { x } ) p _ { d a t a } ( \pmb { x } ) } \left[ \log p _ { \theta } ( \pmb { x } | \pmb { h } ) \right] } \\ & { \mathrm { S l e e p : } \quad \operatorname* { m a x } _ { \lambda } \mathbb { E } _ { p _ { \theta } ( \pmb { x } | \pmb { h } ) p ( \pmb { h } ) } \left[ \log q _ { \lambda } ( \pmb { h } | \pmb { x } ) \right] . } \end{array}
|
| 189 |
+
$$
|
| 190 |
+
|
| 191 |
+
Briefly, the wake phase updates the generator parameters $\pmb { \theta }$ by fitting $p _ { \theta } ( { \pmb x } | { \pmb h } )$ to the real data and hidden code inferred by the inference model $q _ { \lambda } ( \pmb { h } | \pmb { x } )$ . On the other hand, the sleep phase updates the parameters $\boldsymbol { \lambda }$ based on the generated samples from the generator.
|
| 192 |
+
|
| 193 |
+
The relations between WS and VAEs are clear in previous discussions (Bornschein & Bengio, 2014; Kingma & Welling, 2013). Indeed, WS was originally proposed to minimize the variational lower bound as in VAEs (Eq.11) with the sleep phase approximation (Hinton et al., 1995). Alternatively, VAEs can be seen as extending the wake phase. Specifically, if we let $^ { h }$ be $_ { z }$ and $\boldsymbol { \lambda }$ be $\eta$ , the wake phase objective recovers VAEs (Eq.11) in terms of generator optimization (i.e., optimizing $\pmb \theta$ ). Therefore, we can see VAEs as generalizing the wake phase by also optimizing the inference model $q _ { \eta }$ , with additional prior regularization on code $_ z$ .
|
| 194 |
+
|
| 195 |
+
On the other hand, GANs closely resemble the sleep phase. To make this clearer, let $^ { h }$ be $y$ and $\boldsymbol { \lambda }$ be $\phi$ . This results in a sleep phase objective identical to that of optimizing the discriminator $q _ { \phi }$ in Eq.(3), which is to reconstruct $y$ given sample $_ { \textbf { \em x } }$ . We thus can view GANs as generalizing the sleep phase by also optimizing the generative model $p _ { \theta }$ to reconstruct reversed $y$ . InfoGAN (Eq.9) further extends the correspondence to reconstruction of latents $_ z$ .
|
| 196 |
+
|
| 197 |
+
# 4 TRANSFERRING TECHNIQUES
|
| 198 |
+
|
| 199 |
+
The new interpretation not only reveals the connections underlying the broad set of existing approaches, but also facilitates to exchange ideas and transfer techniques across the two classes of algorithms. For instance, existing enhancements on VAEs can straightforwardly be applied to improve GANs, and vice versa. This section gives two examples. Here we only outline the main intuitions and resulting models, while providing the details in the supplement materials.
|
| 200 |
+
|
| 201 |
+
# 4.1 IMPORTANCE WEIGHTED GANS (IWGAN)
|
| 202 |
+
|
| 203 |
+
Burda et al. (2015) proposed importance weighted autoencoder (IWAE) that maximizes a tighter lower bound on the marginal likelihood. Within our framework it is straightforward to develop importance weighted GANs by copying the derivations of IWAE side by side, with little adaptations. Specifically, the variational inference interpretation in Lemma.1 suggests GANs can be viewed as maximizing a lower bound of the marginal likelihood on $y$ (putting aside the negative JSD term):
|
| 204 |
+
|
| 205 |
+
$$
|
| 206 |
+
\log q ( y ) = \log \int p _ { \theta } ( x | y ) \frac { q _ { \phi _ { 0 } } ^ { r } ( y | x ) p _ { \theta _ { 0 } } ( x ) } { p _ { \theta } ( x | y ) } d x \geq - \mathrm { K L } ( p _ { \theta } ( x | y ) | | q ^ { r } ( x | y ) ) + c o n s t .
|
| 207 |
+
$$
|
| 208 |
+
|
| 209 |
+
Following (Burda et al., 2015), we can derive a tighter lower bound through a $k$ -sample importance weighting estimate of the marginal likelihood. With necessary approximations for tractability, optimizing the tighter lower bound results in the following update rule for the generator learning:
|
| 210 |
+
|
| 211 |
+
$$
|
| 212 |
+
\nabla _ { \theta } \mathcal { L } _ { k } ( y ) = \mathbb { E } _ { z _ { 1 } , \dots , z _ { k } \sim p ( z \mid y ) } \left[ \sum _ { i = 1 } ^ { k } \widetilde { w _ { i } } \nabla _ { \theta } \log q _ { \phi _ { 0 } } ^ { r } ( y | x ( z _ { i } , \pmb { \theta } ) ) \right] .
|
| 213 |
+
$$
|
| 214 |
+
|
| 215 |
+
As in GANs, only $y = 0$ (i.e., generated samples) is effective for learning parameters $\pmb { \theta }$ . Compared to the vanilla GAN update (Eq.(6)), the only difference here is the additional importance weight $\widetilde { w _ { i } }$ which is the normalization of $\begin{array} { r } { w _ { i } = \frac { q _ { \phi _ { 0 } } ^ { r } ( y | \pmb { x } _ { i } ) } { q _ { \phi _ { 0 } } ( y | \pmb { x } _ { i } ) } } \end{array}$ over $k$ fsamples. Intuitively, the algorithm assigns higher weights to samples that are more realistic and fool the discriminator better, which is consistent to IWAE that emphasizes more on code states providing better reconstructions. Hjelm et al. (2017); Che et al. (2017b) developed a similar sample weighting scheme for generator training, while their generator of discrete data depends on explicit conditional likelihood. In practice, the $k$ samples correspond to sample minibatch in standard GAN update. Thus the only computational cost added by the importance weighting method is by evaluating the weight for each sample, and is negligible. The discriminator is trained in the same way as in standard GANs.
|
| 216 |
+
|
| 217 |
+
<table><tr><td></td><td>CGAN IWCGAN</td></tr><tr><td>MNIST</td><td>0.985±.002 0.987±.002</td></tr><tr><td>SVHN</td><td>0.797±.005 0.798±.006</td></tr></table>
|
| 218 |
+
|
| 219 |
+
Table 2: Left: Inception scores of GANs and the importance weighted extension. Middle: Classification accuracy of the generations by conditional GANs and the IW extension. Right: Classification accuracy of semi-supervised VAEs and the AA extension on MNIST test set, with $1 \%$ and $1 0 \%$ real labeled training data.
|
| 220 |
+
|
| 221 |
+
<table><tr><td>GAN</td><td>IWGAN</td></tr><tr><td>MNIST</td><td>8.34±.03 8.45±.04</td></tr><tr><td>SVHN</td><td>5.18±.03 5.34±.03</td></tr><tr><td>CIFAR10</td><td>7.86±.05 7.89± .04</td></tr></table>
|
| 222 |
+
|
| 223 |
+
<table><tr><td></td><td>SVAE</td><td>AASVAE</td></tr><tr><td>1%</td><td>0.9412</td><td>0.9425</td></tr><tr><td>10%</td><td>0.9768</td><td>0.9797</td></tr></table>
|
| 224 |
+
|
| 225 |
+
<table><tr><td>Train Data Size</td><td>VAE</td><td>AA-VAE</td><td>CVAE</td><td>AA-CVAE</td><td>SVAE</td><td>AA-SVAE</td></tr><tr><td>1%</td><td>-122.89</td><td>-122.15</td><td>-125.44</td><td>-122.88</td><td>-108.22</td><td>-107.61</td></tr><tr><td>10%</td><td>-104.49</td><td>-103.05</td><td>-102.63</td><td>-101.63</td><td>-99.44</td><td>-98.81</td></tr><tr><td>100%</td><td>-92.53</td><td>-92.42</td><td>-93.16</td><td>-92.75</td><td></td><td>一</td></tr></table>
|
| 226 |
+
|
| 227 |
+
Table 3: Variational lower bounds on MNIST test set, trained on $1 \%$ , $1 0 \%$ , and $1 0 0 \%$ training data, respectively. In the semi-supervised VAE (SVAE) setting, remaining training data are used for unsupervised training.
|
| 228 |
+
|
| 229 |
+
# 4.2 ADVERSARY ACTIVATED VAES (AAVAE)
|
| 230 |
+
|
| 231 |
+
By Lemma.2, VAEs include a degenerated discriminator which blocks out generated samples from contributing to model learning. We enable adaptive incorporation of fake samples by activating the adversarial mechanism. Specifically, we replace the perfect discriminator $q _ { * } ( y | { \pmb x } )$ in VAEs with a discriminator network $q _ { \phi } ( y | \mathbf { x } )$ parameterized with $\phi$ , resulting in an adapted objective of Eq.(12):
|
| 232 |
+
|
| 233 |
+
$$
|
| 234 |
+
\operatorname* { m a x } _ { \theta , \eta } \mathcal { L } _ { \theta , \eta } ^ { \mathrm { a u v e } } = \mathbb { E } _ { p _ { \theta _ { 0 } } ( x ) } \left[ \mathbb { E } _ { q _ { \eta } ( z | \mathbf { x } , y ) q _ { \phi } ^ { r } ( y | \mathbf { x } ) } \left[ \log p _ { \theta } ( \pmb { x } | z , y ) \right] - \mathrm { K L } ( q _ { \eta } ( z | \mathbf { x } , y ) q _ { \phi } ^ { r } ( y | \pmb { x } ) \| p ( z | y ) p ( y ) ) \right] .
|
| 235 |
+
$$
|
| 236 |
+
|
| 237 |
+
As detailed in the supplementary material, the discriminator is trained in the same way as in GANs.
|
| 238 |
+
|
| 239 |
+
The activated discriminator enables an effective data selection mechanism. First, AAVAE uses not only real examples, but also generated samples for training. Each sample is weighted by the inverted discriminator $q _ { \phi } ^ { r } ( y | \pmb { x } )$ , so that only those samples that resemble real data and successfully fool the discriminator will be incorporated for training. This is consistent with the importance weighting strategy in IWGAN. Second, real examples are also weighted by $q _ { \phi } ^ { r } ( y | \pmb { x } )$ . An example receiving large weight indicates it is easily recognized by the discriminator, which means the example is hard to be simulated from the generator. That is, AAVAE emphasizes more on harder examples.
|
| 240 |
+
|
| 241 |
+
# 5 EXPERIMENTS
|
| 242 |
+
|
| 243 |
+
We conduct preliminary experiments to demonstrate the generality and effectiveness of the importance weighting (IW) and adversarial activating (AA) techniques. In this paper we do not aim at achieving state-of-the-art performance, but leave it for future work. In particular, we show the IW and AA extensions improve the standard GANs and VAEs, as well as several of their variants, respectively. We present the results here, and provide details of experimental setups in the supplements.
|
| 244 |
+
|
| 245 |
+
# 5.1 IMPORTANCE WEIGHTED GANS
|
| 246 |
+
|
| 247 |
+
We extend both vanilla GANs and class-conditional GANs (CGAN) with the IW method. The base GAN model is implemented with the DCGAN architecture and hyperparameter setting (Radford et al., 2015). Hyperparameters are not tuned for the IW extensions. We use MNIST, SVHN, and CIFAR10 for evaluation. For vanilla GANs and its IW extension, we measure inception scores (Salimans et al., 2016) on the generated samples. For CGANs we evaluate the accuracy of conditional generation (Hu et al., 2017) with a pre-trained classifier. Please see the supplements for more details.
|
| 248 |
+
|
| 249 |
+
Table 2, left panel, shows the inception scores of GANs and IW-GAN, and the middle panel gives the classification accuracy of CGAN and and its IW extension. We report the averaged results $\pm$ one standard deviation over 5 runs. The IW strategy gives consistent improvements over the base models.
|
| 250 |
+
|
| 251 |
+
# 5.2 ADVERSARY ACTIVATED VAES
|
| 252 |
+
|
| 253 |
+
We apply the AA method on vanilla VAEs, class-conditional VAEs (CVAE), and semi-supervised VAEs (SVAE) (Kingma et al., 2014), respectively. We evaluate on the MNIST data. We measure the variational lower bound on the test set, with varying number of real training examples. For each batch of real examples, AA extended models generate equal number of fake samples for training.
|
| 254 |
+
|
| 255 |
+

|
| 256 |
+
Figure 3: Symmetric view of generation and inference. There is little difference of the two processes in terms of formulation: with implicit distribution modeling, both processes only need to perform simulation through black-box neural transformations between the latent and visible spaces.
|
| 257 |
+
|
| 258 |
+
Table 3 shows the results of activating the adversarial mechanism in VAEs. Generally, larger improvement is obtained with smaller set of real training data. Table 2, right panel, shows the improved accuracy of AA-SVAE over the base semi-supervised VAE.
|
| 259 |
+
|
| 260 |
+
# 6 DISCUSSIONS: SYMMETRIC VIEW OF GENERATION AND INFERENCE
|
| 261 |
+
|
| 262 |
+
Our new interpretations of GANs and VAEs have revealed strong connections between them, and linked the emerging new approaches to the classic wake-sleep algorithm. The generality of the proposed formulation offers a unified statistical insight of the broad landscape of deep generative modeling, and encourages mutual exchange of techniques across research lines. One of the key ideas in our formulation is to interpret sample generation in GANs as performing posterior inference. This section provides a more general discussion of this point.
|
| 263 |
+
|
| 264 |
+
Traditional modeling approaches usually distinguish between latent and visible variables clearly and treat them in very different ways. One of the key thoughts in our formulation is that it is not necessary to make clear boundary between the two types of variables (and between generation and inference), but instead, treating them as a symmetric pair helps with modeling and understanding. For instance, we treat the generation space $_ { \textbf { \em x } }$ in GANs as latent, which immediately reveals the connection between GANs and adversarial domain adaptation, and provides a variational inference interpretation of the generation. A second example is the classic wake-sleep algorithm, where the wake phase reconstructs visibles conditioned on latents, while the sleep phase reconstructs latents conditioned on visibles (i.e., generated samples). Hence, visible and latent variables are treated in a completely symmetric manner.
|
| 265 |
+
|
| 266 |
+
Empirical data distributions are usually implicit, i.e., easy to sample from but intractable for evaluating likelihood. In contrast, priors are usually defined as explicit distributions, amiable for likelihood evaluation.
|
| 267 |
+
• The complexity of the two distributions are different. Visible space is usually complex while latent space tends (or is designed) to be simpler.
|
| 268 |
+
|
| 269 |
+
However, the adversarial approach in GANs and other techniques such as density ratio estimation (Mohamed & Lakshminarayanan, 2016) and approximate Bayesian computation (Beaumont et al., 2002) have provided useful tools to bridge the gap in the first point. For instance, implicit generative models such as GANs require only simulation of the generative process without explicit likelihood evaluation, hence the prior distributions over latent variables are used in the same way as the empirical data distributions, namely, generating samples from the distributions. For explicit likelihood-based models, adversarial autoencoder (AAE) leverages the adversarial approach to allow implicit prior distributions over latent space. Besides, a few most recent work (Mescheder et al., 2017; Tran et al., 2017; Huszar, 2017; Rosca et al., 2017) extends VAEs by using implicit variational distributions as ´ the inference model. Indeed, the reparameterization trick in VAEs already resembles construction of implicit variational distributions (as also seen in the derivations of IWGANs in Eq.37). In these algorithms, adversarial approach is used to replace intractable minimization of the KL divergence between implicit variational distributions and priors.
|
| 270 |
+
|
| 271 |
+
The second difference in terms of space complexity guides us to choose appropriate tools (e.g., adversarial approach v.s. reconstruction optimization, etc) to minimize the distance between distributions to learn and their targets. However, the tools chosen do not affect the underlying modeling mechanism.
|
| 272 |
+
|
| 273 |
+
For instance, VAEs and adversarial autoencoder both regularize the model by minimizing the distance between the variational posterior and certain prior, though VAEs choose KL divergence loss while AAE selects adversarial loss.
|
| 274 |
+
|
| 275 |
+
We can further extend the symmetric treatment of visible/latent $_ { x / z }$ pair to data/label ${ \mathbf { } } x / t$ pair, leading to a unified view of the generative and discriminative paradigms for unsupervised and semi-supervised learning. Specifically, conditional generative models create (data, label) pairs by generating data $_ { \textbf { \em x } }$ given label $\pmb { t }$ . These pairs can be used for classifier training (Hu et al., 2017; Odena et al., 2017). In parallel, discriminative approaches such as knowledge distillation (Hinton et al., 2015; Hu et al., 2016) create (data, label) pairs by generating label $\pmb { t }$ conditioned on data $_ { \textbf { \em x } }$ . With the symmetric view of $_ { \textbf { \em x } }$ and $\pmb { t }$ spaces, and neural network based black-box mappings across spaces, we can see the two approaches are essentially the same.
|
| 276 |
+
|
| 277 |
+
# REFERENCES
|
| 278 |
+
|
| 279 |
+
Martin Arjovsky and Leon Bottou. Towards principled methods for training generative adversarial networks. In ´ ICLR, 2017.
|
| 280 |
+
Sanjeev Arora, Rong Ge, Yingyu Liang, Tengyu Ma, and Yi Zhang. Generalization and equilibrium in generative adversarial nets (GANs). arXiv preprint arXiv:1703.00573, 2017.
|
| 281 |
+
Mark A Beaumont, Wenyang Zhang, and David J Balding. Approximate Bayesian computation in population genetics. Genetics, 162(4):2025–2035, 2002.
|
| 282 |
+
Jorg Bornschein and Yoshua Bengio. Reweighted wake-sleep. ¨ arXiv preprint arXiv:1406.2751, 2014.
|
| 283 |
+
Yuri Burda, Roger Grosse, and Ruslan Salakhutdinov. Importance weighted autoencoders. arXiv preprint arXiv:1509.00519, 2015.
|
| 284 |
+
Tong Che, Yanran Li, Athul Paul Jacob, Yoshua Bengio, and Wenjie Li. Mode regularized generative adversarial networks. ICLR, 2017a.
|
| 285 |
+
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:1702.07983, 2017b.
|
| 286 |
+
Xi Chen, Yan Duan, Rein Houthooft, John Schulman, Ilya Sutskever, and Pieter Abbeel. InfoGAN: Interpretable representation learning by information maximizing generative adversarial nets. In NIPS, 2016.
|
| 287 |
+
Xi Chen, Diederik P Kingma, Tim Salimans, Yan Duan, Prafulla Dhariwal, John Schulman, Ilya Sutskever, and Pieter Abbeel. Variational lossy autoencoder. ICLR, 2017.
|
| 288 |
+
Peter Dayan, Geoffrey E Hinton, Radford M Neal, and Richard S Zemel. The helmholtz machine. Neural computation, 7(5):889–904, 1995.
|
| 289 |
+
Gintare Karolina Dziugaite, Daniel M Roy, and Zoubin Ghahramani. Training generative neural networks via maximum mean discrepancy optimization. arXiv preprint arXiv:1505.03906, 2015.
|
| 290 |
+
Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, Franc¸ois Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. JMLR, 2016.
|
| 291 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In NIPS, pp. 2672–2680, 2014.
|
| 292 |
+
Michael U Gutmann, Ritabrata Dutta, Samuel Kaski, and Jukka Corander. Statistical inference of intractable generative models via classification. arXiv preprint arXiv:1407.4981, 2014.
|
| 293 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
|
| 294 |
+
Geoffrey E Hinton, Peter Dayan, Brendan J Frey, and Radford M Neal. The” wake-sleep” algorithm for unsupervised neural networks. Science, 268(5214):1158, 1995.
|
| 295 |
+
R Devon Hjelm, Athul Paul Jacob, Tong Che, Kyunghyun Cho, and Yoshua Bengio. Boundary-seeking generative adversarial networks. arXiv preprint arXiv:1702.08431, 2017.
|
| 296 |
+
Zhiting Hu, Xuezhe Ma, Zhengzhong Liu, Eduard Hovy, and Eric Xing. Harnessing deep neural networks with logic rules. In ACL, 2016.
|
| 297 |
+
|
| 298 |
+
Zhiting Hu, Zichao Yang, Xiaodan Liang, Ruslan Salakhutdinov, and Eric P Xing. Toward controlled generation of text. In ICML, 2017.
|
| 299 |
+
|
| 300 |
+
Ferenc Huszar. InfoGAN: using the variational bound on mutual information (twice). Blogpost, 2016. URL http://www.inference.vc/ infogan-variational-bound-on-mutual-information-twice.
|
| 301 |
+
|
| 302 |
+
Ferenc Huszar. Variational inference using implicit distributions. ´ arXiv preprint arXiv:1702.08235, 2017.
|
| 303 |
+
|
| 304 |
+
Michael I Jordan, Zoubin Ghahramani, Tommi S Jaakkola, and Lawrence K Saul. An introduction to variational methods for graphical models. Machine learning, 37(2):183–233, 1999.
|
| 305 |
+
|
| 306 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational Bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 307 |
+
|
| 308 |
+
Diederik P Kingma, Shakir Mohamed, Danilo Jimenez Rezende, and Max Welling. Semi-supervised learning with deep generative models. In NIPS, pp. 3581–3589, 2014.
|
| 309 |
+
|
| 310 |
+
Tejas D Kulkarni, William F Whitney, Pushmeet Kohli, and Josh Tenenbaum. Deep convolutional inverse graphics network. In NIPS, pp. 2539–2547, 2015.
|
| 311 |
+
|
| 312 |
+
Hugo Larochelle and Iain Murray. The neural autoregressive distribution estimator. In AISTATS, 2011.
|
| 313 |
+
|
| 314 |
+
Anders Boesen Lindbo Larsen, Søren Kaae Sønderby, Hugo Larochelle, and Ole Winther. Autoencoding beyond pixels using a learned similarity metric. arXiv preprint arXiv:1512.09300, 2015.
|
| 315 |
+
|
| 316 |
+
Yingzhen Li. GANs, mutual information, and possibly algorithm selection? Blogpost, 2016. URL http: //www.yingzhenli.net/home/blog/ $? { \mathrm { p } } { = } 4 2 1$ .
|
| 317 |
+
|
| 318 |
+
Yujia Li, Kevin Swersky, and Rich Zemel. Generative moment matching networks. In ICML, 2015.
|
| 319 |
+
|
| 320 |
+
Alireza Makhzani, Jonathon Shlens, Navdeep Jaitly, Ian Goodfellow, and Brendan Frey. Adversarial autoencoders. arXiv preprint arXiv:1511.05644, 2015.
|
| 321 |
+
|
| 322 |
+
Lars Mescheder, Sebastian Nowozin, and Andreas Geiger. Adversarial variational Bayes: Unifying variational autoencoders and generative adversarial networks. arXiv preprint arXiv:1701.04722, 2017.
|
| 323 |
+
|
| 324 |
+
Luke Metz, Ben Poole, David Pfau, and Sohl-Dickstein. Unrolled generative adversarial networks. ICLR, 2017.
|
| 325 |
+
|
| 326 |
+
Andriy Mnih and Karol Gregor. Neural variational inference and learning in belief networks. arXiv preprint arXiv:1402.0030, 2014.
|
| 327 |
+
|
| 328 |
+
Shakir Mohamed and Balaji Lakshminarayanan. Learning in implicit generative models. arXiv preprint arXiv:1610.03483, 2016.
|
| 329 |
+
|
| 330 |
+
Radford M Neal. Connectionist learning of belief networks. Artificial intelligence, 56(1):71–113, 1992.
|
| 331 |
+
|
| 332 |
+
Sebastian Nowozin, Botond Cseke, and Ryota Tomioka. f-GAN: Training generative neural samplers using variational divergence minimization. In NIPS, pp. 271–279, 2016.
|
| 333 |
+
|
| 334 |
+
Augustus Odena, Christopher Olah, and Jonathon Shlens. Conditional image synthesis with auxiliary classifier GANs. ICML, 2017.
|
| 335 |
+
|
| 336 |
+
Aaron van den Oord, Nal Kalchbrenner, and Koray Kavukcuoglu. Pixel recurrent neural networks. arXiv preprint arXiv:1601.06759, 2016.
|
| 337 |
+
|
| 338 |
+
Yunchen Pu, Liqun Chen, Shuyang Dai, Weiyao Wang, Chunyuan Li, and Lawrence Carin. Symmetric variational autoencoder and connections to adversarial learning. arXiv preprint arXiv:1709.01846, 2017.
|
| 339 |
+
|
| 340 |
+
Sanjay Purushotham, Wilka Carvalho, Tanachat Nilanon, and Yan Liu. Variational recurrent adversarial deep domain adaptation. In ICLR, 2017.
|
| 341 |
+
|
| 342 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
|
| 343 |
+
|
| 344 |
+
Mihaela Rosca, Balaji Lakshminarayanan, David Warde-Farley, and Shakir Mohamed. Variational approaches for auto-encoding generative adversarial networks. arXiv preprint arXiv:1706.04987, 2017.
|
| 345 |
+
|
| 346 |
+
Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training GANs. In NIPS, pp. 2226–2234, 2016.
|
| 347 |
+
|
| 348 |
+
Jurgen Schmidhuber. Learning factorial codes by predictability minimization. ¨ Neural Computation, 1992.
|
| 349 |
+
|
| 350 |
+
Casper Kaae Sønderby, Jose Caballero, Lucas Theis, Wenzhe Shi, and Ferenc Huszar. Amortised MAP inference ´ for image super-resolution. ICLR, 2017.
|
| 351 |
+
|
| 352 |
+
Martin A Tanner and Wing Hung Wong. The calculation of posterior distributions by data augmentation. JASA, 82(398):528–540, 1987.
|
| 353 |
+
|
| 354 |
+
Dustin Tran, Rajesh Ranganath, and David M Blei. Deep and hierarchical implicit models. arXiv preprint arXiv:1702.08896, 2017.
|
| 355 |
+
|
| 356 |
+
Aaron van den Oord, Nal Kalchbrenner, Lasse Espeholt, Oriol Vinyals, Alex Graves, and Koray Kavukcuoglu. Conditional image generation with pixelCNN decoders. In NIPS, 2016.
|
| 357 |
+
|
| 358 |
+
Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. arXiv preprint arXiv:1703.10593, 2017.
|
| 359 |
+
|
| 360 |
+
# A ADVERSARIAL DOMAIN ADAPTATION (ADA)
|
| 361 |
+
|
| 362 |
+
ADA aims to transfer prediction knowledge learned from a source domain with labeled data to a target domain without labels, by learning domain-invariant features. Let $D _ { \phi } ( { \pmb x } ) = q _ { \phi } ( { \pmb y } | { \pmb x } )$ be the domain discriminator. The conventional formulation of ADA is as following:
|
| 363 |
+
|
| 364 |
+
$$
|
| 365 |
+
\begin{array} { r l } & { \operatorname* { m a x } _ { \phi } \mathcal { L } _ { \phi } = \mathbb { E } _ { \alpha = G _ { \theta } ( z ) , z \sim p ( z | y = 1 ) } \left[ \log D _ { \phi } ( \pmb { x } ) \right] + \mathbb { E } _ { \mathbf { x } = G _ { \theta } ( z ) , z \sim p ( z | y = 0 ) } \left[ \log ( 1 - D _ { \phi } ( \pmb { x } ) ) \right] , } \\ & { \operatorname* { m a x } _ { \theta } \mathcal { L } _ { \theta } = \mathbb { E } _ { \mathbf { x } = G _ { \theta } ( z ) , z \sim p ( z | y = 1 ) } \left[ \log ( 1 - D _ { \phi } ( \pmb { x } ) ) \right] + \mathbb { E } _ { \mathbf { x } = G _ { \theta } ( z ) , z \sim p ( z | y = 0 ) } \left[ \log D _ { \phi } ( \pmb { x } ) \right] . } \end{array}
|
| 366 |
+
$$
|
| 367 |
+
|
| 368 |
+
Further add the supervision objective of predicting label $t ( z )$ of data $_ z$ in the source domain, with a classifier $f _ { \omega } ( t | x )$ parameterized with $\pi$ :
|
| 369 |
+
|
| 370 |
+
$$
|
| 371 |
+
\begin{array} { r } { \operatorname* { m a x } _ { \omega , \theta } \mathcal { L } _ { \omega , \theta } = \mathbb { E } _ { z \sim p ( z \mid y = 1 ) } \left[ \log f _ { \omega } ( t ( z ) | G _ { \theta } ( z ) ) \right] . } \end{array}
|
| 372 |
+
$$
|
| 373 |
+
|
| 374 |
+
We then obtain the conventional formulation of adversarial domain adaptation used or similar in (Ganin et al., 2016; Purushotham et al., 2017).
|
| 375 |
+
|
| 376 |
+
# B PROOF OF LEMMA 1
|
| 377 |
+
|
| 378 |
+
Proof.
|
| 379 |
+
|
| 380 |
+
$$
|
| 381 |
+
\begin{array} { r l } & { \mathbb { E } _ { p _ { \theta } ( \pmb { x } | y ) p ( y ) } \left[ \log { q ^ { r } ( y | \pmb { x } ) } \right] = } \\ & { - \mathbb { E } _ { p ( y ) } \left[ \mathrm { K L } \left( p _ { \theta } ( \pmb { x } | y ) \| q ^ { r } ( \pmb { x } | y ) \right) - \mathrm { K L } \big ( p _ { \theta } ( \pmb { x } | y ) \| p _ { \theta _ { 0 } } ( \pmb { x } ) \big ) \right] , } \end{array}
|
| 382 |
+
$$
|
| 383 |
+
|
| 384 |
+
where
|
| 385 |
+
|
| 386 |
+
$$
|
| 387 |
+
\begin{array} { r l } & { { \mathbb E } _ { p ( y ) } \left[ { \mathrm { K L } } ( p _ { \theta } ( { \pmb x } | y ) \| p _ { \theta _ { 0 } } ( { \pmb x } ) ) \right] } \\ & { \ = p ( y = 0 ) \cdot { \mathrm { K L } } \left( p _ { \theta } ( { \pmb x } | y = 0 ) \| \frac { p _ { \theta _ { 0 } } ( { \pmb x } | y = 0 ) + p _ { \theta _ { 0 } } ( { \pmb x } | y = 1 ) } { 2 } \right) } \\ & { \ + p ( y = 1 ) \cdot { \mathrm { K L } } \left( p _ { \theta } ( { \pmb x } | y = 1 ) \| \frac { p _ { \theta _ { 0 } } ( { \pmb x } | y = 0 ) + p _ { \theta _ { 0 } } ( { \pmb x } | y = 1 ) } { 2 } \right) . } \end{array}
|
| 388 |
+
$$
|
| 389 |
+
|
| 390 |
+
Note that be simpli $p _ { \theta } ( { \pmb x } | y = 0 ) = p _ { g _ { \theta } } ( { \pmb x } )$ , and $p _ { \theta } ( { \pmb x } | y = 1 ) = p _ { d a t a } ( { \pmb x } )$ . Let $\begin{array} { r } { p _ { M _ { \theta } } = \frac { p _ { g _ { \theta } } + p _ { d a t a } } { 2 } } \end{array}$ . Eq.(21) can
|
| 391 |
+
|
| 392 |
+
$$
|
| 393 |
+
\mathbb { E } _ { p ( y ) } \left[ \mathrm { K L } \big ( p _ { \theta } ( \pmb { x } | y ) \| p _ { \theta _ { 0 } } ( \pmb { x } ) \big ) \right] = \frac { 1 } { 2 } \mathrm { K L } \left( p _ { g _ { \theta } } \| p _ { M _ { \theta _ { 0 } } } \right) + \frac { 1 } { 2 } \mathrm { K L } \left( p _ { d a t a } \| p _ { M _ { \theta _ { 0 } } } \right) .
|
| 394 |
+
$$
|
| 395 |
+
|
| 396 |
+
On the other hand,
|
| 397 |
+
|
| 398 |
+
$$
|
| 399 |
+
\begin{array} { r l } & { \| { \mathrm { S D } } ( p _ { g _ { \theta } } \| p _ { d a t a } ) = \frac { 1 } { 2 } \mathbb { E } _ { p _ { s \theta } } [ \log \frac { p _ { g _ { \theta } } } { p _ { M _ { \theta } } } ] + \frac { 1 } { 2 } \mathbb { E } _ { p _ { d a t a } } [ \log \frac { p _ { d a t a } } { p _ { M _ { \theta } } } ] } \\ & { \qquad = \frac { 1 } { 2 } \mathbb { E } _ { p _ { g _ { \theta } } } [ \log \frac { p _ { g _ { \theta } } } { p _ { M _ { \theta } } } ] + \frac { 1 } { 2 } \mathbb { E } _ { p _ { g _ { \theta } } } [ \log \frac { p _ { M _ { \theta } } } { p _ { M _ { \theta } } } ] } \\ & { \qquad + \frac { 1 } { 2 } \mathbb { E } _ { p _ { d a t a } } [ \log \frac { p _ { d a t a } } { p _ { M _ { \theta } } } ] + \frac { 1 } { 2 } \mathbb { E } _ { p _ { d a t a } } [ \log \frac { p _ { M _ { \theta } } } { p _ { M _ { \theta } } } ] } \\ & { \qquad = \frac { 1 } { 2 } \mathbb { E } _ { p _ { g _ { \theta } } } [ \log \frac { p _ { g _ { \theta } } } { p _ { M _ { \theta } } } ] + \frac { 1 } { 2 } \mathbb { E } _ { p _ { d a t a } } [ \log \frac { p _ { d a t a } } { p _ { M _ { \theta } } } ] + \mathbb { E } _ { p _ { M _ { \theta } } } [ \log \frac { p _ { M _ { \theta } } } { p _ { M _ { \theta } } } ] } \\ & { \qquad = \frac { 1 } { 2 } \mathrm { K L } ( p _ { g _ { \theta } } \| p _ { M _ { \theta _ { 0 } } } ) + \frac { 1 } { 2 } \mathrm { K L } ( p _ { d a t a } \| p _ { M _ { \theta _ { 0 } } } ) - \mathrm { K L } ( p _ { M _ { \theta } } \| p _ { M _ { \theta _ { 0 } } } ) . } \end{array}
|
| 400 |
+
$$
|
| 401 |
+
|
| 402 |
+
Note that
|
| 403 |
+
|
| 404 |
+
$$
|
| 405 |
+
\nabla _ { \boldsymbol { \theta } } \mathrm { K L } \left( p _ { M _ { \boldsymbol { \theta } } } \| p _ { M _ { \boldsymbol { \theta } _ { 0 } } } \right) \big | _ { \boldsymbol { \theta = \theta } _ { 0 } } = 0 .
|
| 406 |
+
$$
|
| 407 |
+
|
| 408 |
+
Taking derivatives of Eq.(22) w.r.t $\pmb \theta$ at $\pmb { \theta } _ { 0 }$ we get
|
| 409 |
+
|
| 410 |
+
$$
|
| 411 |
+
\begin{array} { l } { { \nabla _ { \theta } \mathbb { E } _ { p ( y ) } \left[ { \mathrm { K L } } ( p _ { \theta } ( \pmb { x } | y ) | | p _ { \theta _ { 0 } } ( \pmb { x } ) ) \right] | _ { \theta = \theta _ { 0 } } } } \\ { { = \nabla _ { \theta } \left( \frac { 1 } { 2 } \mathrm { K L } \left( p _ { g _ { \theta } } \| p _ { M _ { \theta _ { 0 } } } \right) | _ { \theta = \theta _ { 0 } } + \frac { 1 } { 2 } \mathrm { K L } \left( p _ { d a t a } \| p _ { M _ { \theta _ { 0 } } } \right) \right) | _ { \theta = \theta _ { 0 } } } } \\ { { = \nabla _ { \theta } \mathrm { J S D } ( p _ { g _ { \theta } } \| p _ { d a t a } ) | _ { \theta = \theta _ { 0 } } . } } \end{array}
|
| 412 |
+
$$
|
| 413 |
+
|
| 414 |
+
Taking derivatives of the both sides of Eq.(20) at w.r.t $\pmb \theta$ at $\pmb { \theta } _ { 0 }$ and plugging the last equation of Eq.(25), we obtain the desired results. □
|
| 415 |
+
|
| 416 |
+

|
| 417 |
+
Figure 4: Left: Graphical model of InfoGAN. Right: Graphical model of Adversarial Autoencoder (AAE), which is obtained by swapping data $_ { \textbf { \em x } }$ and code $_ z$ in InfoGAN.
|
| 418 |
+
|
| 419 |
+
# C PROOF OF JSD UPPER BOUND IN LEMMA 1
|
| 420 |
+
|
| 421 |
+
We show that, in Lemma.1 (Eq.6), the JSD term is upper bounded by the KL term, i.e.,
|
| 422 |
+
|
| 423 |
+
$$
|
| 424 |
+
\begin{array} { r } { \mathrm { J S D } \big ( p _ { \theta } ( { \pmb x } | y = 0 ) \| p _ { \theta } ( { \pmb x } | y = 1 ) \big ) \leq \mathbb { E } _ { p ( y ) } \left[ \mathrm { K L } \big ( p _ { \theta } ( { \pmb x } | y ) \| q ^ { r } ( { \pmb x } | y ) \big ) \right] . } \end{array}
|
| 425 |
+
$$
|
| 426 |
+
|
| 427 |
+
Proof. From Eq.(20), we have
|
| 428 |
+
|
| 429 |
+
$$
|
| 430 |
+
\begin{array} { r } { \mathbb { E } _ { p ( y ) } \left[ { \mathrm { K L } } ( p _ { \theta } ( \pmb { x } | y ) | | p _ { \theta _ { 0 } } ( \pmb { x } ) ) \right] \leq \mathbb { E } _ { p ( y ) } \left[ { \mathrm { K L } } \left( p _ { \theta } ( \pmb { x } | y ) | | q ^ { r } ( \pmb { x } | y ) \right) \right] . } \end{array}
|
| 431 |
+
$$
|
| 432 |
+
|
| 433 |
+
From Eq.(22) and Eq.(23), we have
|
| 434 |
+
|
| 435 |
+
$$
|
| 436 |
+
\begin{array} { r } { \mathrm { J S D } \big ( p _ { \theta } ( { \pmb x } | y = 0 ) \| p _ { \theta } ( { \pmb x } | y = 1 ) \big ) \leq \mathbb { E } _ { p ( y ) } \left[ \mathrm { K L } \big ( p _ { \theta } ( { \pmb x } | y ) \| p _ { \theta _ { 0 } } ( { \pmb x } ) \big ) \right] . } \end{array}
|
| 437 |
+
$$
|
| 438 |
+
|
| 439 |
+
Eq.(27) and Eq.(28) lead to Eq.(26).
|
| 440 |
+
|
| 441 |
+
# D SCHEMATIC GRAPHICAL MODELS AND AAE/PM/CYCLEGAN
|
| 442 |
+
|
| 443 |
+
Adversarial Autoencoder (AAE) (Makhzani et al., 2015) can be obtained by swapping code variable $_ z$ and data variable $_ { \textbf { \em x } }$ of InfoGAN in the graphical model, as shown in Figure 4. To see this, we directly write down the objectives represented by the graphical model in the right panel, and show they are precisely the original AAE objectives proposed in (Makhzani et al., 2015). We present detailed derivations, which also serve as an example for how one can translate a graphical model representation to the mathematical formulations. Readers can do similarly on the schematic graphical models of GANs, InfoGANs, VAEs, and many other relevant variants and write down the respective objectives conveniently.
|
| 444 |
+
|
| 445 |
+
We stick to the notational convention in the paper that parameter $\pmb \theta$ is associated with the distribution over $_ { \textbf { \em x } }$ , parameter $\eta$ with the distribution over $_ z$ , and parameter $\phi$ with the distribution over $y$ . Besides, we use $p$ to denote the distributions over $_ { \textbf { \em x } }$ , and $q$ the distributions over $_ { z }$ and $y$ .
|
| 446 |
+
|
| 447 |
+
From the graphical model, the inference process (dashed-line arrows) involves implicit distribution $q _ { \eta } ( z | y )$ (where $_ { \textbf { \em x } }$ is encapsulated). As in the formulations of GANs (Eq.4 in the paper) and VAEs (Eq.13 in the paper), $y = 1$ indicates the real distribution we want to approximate and $y = 0$ indicates the approximate distribution with parameters to learn. So we have
|
| 448 |
+
|
| 449 |
+
$$
|
| 450 |
+
q _ { \eta } ( z | y ) = { \left\{ \begin{array} { l l } { q _ { \eta } ( z | y = 0 ) } & { y = 0 } \\ { q ( z ) } & { y = 1 , } \end{array} \right. }
|
| 451 |
+
$$
|
| 452 |
+
|
| 453 |
+
where, as $_ z$ is the hidden code, $q ( z )$ is the prior distribution over $z ^ { 1 }$ , and the space of $_ { \textbf { \em x } }$ is degenerated. Here $q _ { \eta } ( z | y = 0 )$ is the implicit distribution such that
|
| 454 |
+
|
| 455 |
+
$$
|
| 456 |
+
z \sim q _ { \eta } ( z | y = 0 ) \quad \Longleftrightarrow \quad z = E _ { \eta } ( \pmb { x } ) , \ \pmb { x } \sim p _ { d a t a } ( \pmb { x } ) ,
|
| 457 |
+
$$
|
| 458 |
+
|
| 459 |
+
where $E _ { \eta } ( \pmb { x } )$ is a deterministic transformation parameterized with $\eta$ that maps data $_ { \textbf { \em x } }$ to code $_ z$ Note that as $_ { \textbf { \em x } }$ is a visible variable, the pre-fixed distribution of $_ { \textbf { \em x } }$ is the empirical data distribution.
|
| 460 |
+
|
| 461 |
+
On the other hand, the generative process (solid-line arrows) involves $p _ { \theta } ( \pmb { x } | \boldsymbol { z } , \boldsymbol { y } ) q _ { \phi } ^ { ( r ) } ( \boldsymbol { y } | \boldsymbol { z } )$ (here $q ^ { ( r ) }$ means we will swap between $q ^ { r }$ and $q$ ). As the space of $_ { \textbf { \em x } }$ is degenerated given $y = 1$ , thus $p _ { \theta } ( \pmb { x } | \pmb { z } , y )$ is fixed without parameters to learn, and $\pmb \theta$ is only associated to $y = 0$ .
|
| 462 |
+
|
| 463 |
+
With the above components, we maximize the log likelihood of the generative distributions $\log p _ { \theta } ( { \pmb x } | { \pmb z } , y ) q _ { \phi } ^ { ( r ) } ( y | { \pmb z } )$ conditioning on the variable $_ z$ inferred by $q _ { \eta } ( z | y )$ . Adding the prior distributions, the objectives are then written as
|
| 464 |
+
|
| 465 |
+
$$
|
| 466 |
+
\begin{array} { r l } & { \operatorname* { m a x } _ { \phi } \mathcal { L } _ { \phi } = \mathbb { E } _ { q _ { \eta } ( \boldsymbol { z } | \boldsymbol { y } ) p ( \boldsymbol { y } ) } \left[ \log p _ { \theta } ( \boldsymbol { x } | \boldsymbol { z } , \boldsymbol { y } ) q _ { \phi } ( \boldsymbol { y } | \boldsymbol { z } ) \right] } \\ & { \operatorname* { m a x } _ { \theta , \eta } \mathcal { L } _ { \theta , \eta } = \mathbb { E } _ { q _ { \eta } ( \boldsymbol { z } | \boldsymbol { y } ) p ( \boldsymbol { y } ) } \left[ \log p _ { \theta } ( \boldsymbol { x } | \boldsymbol { z } , \boldsymbol { y } ) q _ { \phi } ^ { r } ( \boldsymbol { y } | \boldsymbol { z } ) \right] . } \end{array}
|
| 467 |
+
$$
|
| 468 |
+
|
| 469 |
+
Again, the only difference between the objectives of $\phi$ and $\{ \theta , \eta \}$ is swapping between $q _ { \phi } ( y | z )$ and its reverse $q _ { \phi } ^ { r } ( y | z )$ .
|
| 470 |
+
|
| 471 |
+
To make it clearer that Eq.(31) is indeed the original AAE proposed in (Makhzani et al., 2015), we transform $\mathcal { L } _ { \phi }$ as
|
| 472 |
+
|
| 473 |
+
$$
|
| 474 |
+
\begin{array} { r l } { \operatorname* { m a x } _ { \phi } \mathcal { L } _ { \phi } = \mathbb { E } _ { q _ { \eta } ( z \mid y ) p ( y ) } \left[ \log q _ { \phi } ( y \vert z ) \right] } & { } \\ & { \quad \quad \quad = \cfrac { 1 } { 2 } \mathbb { E } _ { q _ { \eta } ( z \mid y = 0 ) } \left[ \log q _ { \phi } ( y = 0 \vert z ) \right] + \frac { 1 } { 2 } \mathbb { E } _ { q _ { \eta } ( z \mid y = 1 ) } \left[ \log q _ { \phi } ( y = 1 \vert z ) \right] } \\ & { \quad \quad \quad = \cfrac { 1 } { 2 } \mathbb { E } _ { z = E _ { \eta } ( x ) , x \sim p _ { d a t a } ( x ) } \left[ \log q _ { \phi } ( y = 0 \vert z ) \right] + \frac { 1 } { 2 } \mathbb { E } _ { z \sim q ( z ) } \left[ \log q _ { \phi } ( y = 1 \vert z ) \right] . } \end{array}
|
| 475 |
+
$$
|
| 476 |
+
|
| 477 |
+
That is, the discriminator with parameters $\phi$ is trained to maximize the accuracy of distinguishing the hidden code either sampled from the true prior $p ( z )$ or inferred from observed data example $_ { \textbf { \em x } }$ . The objective $\mathcal { L } _ { \boldsymbol { \theta } , \eta }$ optimizes $\pmb { \theta }$ and $\eta$ to minimize the reconstruction loss of observed data $_ { \textbf { \em x } }$ and at the same time to generate code $_ z$ that fools the discriminator. We thus get the conventional view of the AAE model.
|
| 478 |
+
|
| 479 |
+
Predictability Minimization (PM) (Schmidhuber, 1992) is the early form of adversarial approach which aims at learning code $_ z$ from data such that each unit of the code is hard to predict by the accompanying code predictor based on remaining code units. AAE closely resembles PM by seeing the discriminator as a special form of the code predictors.
|
| 480 |
+
|
| 481 |
+
CycleGAN (Zhu et al., 2017) is the model that learns to translate examples of one domain (e.g., images of horse) to another domain (e.g., images of zebra) and vice versa based on unpaired data. Let $_ { \textbf { \em x } }$ and $_ z$ be the variables of the two domains, then the objectives of AAE (Eq.31) is precisely the objectives that train the model to translate $_ { \textbf { \em x } }$ into $_ z$ . The reversed translation is trained with the objectives of InfoGAN (Eq.9 in the paper), the symmetric counterpart of AAE.
|
| 482 |
+
|
| 483 |
+
# E PROOF OF LEMME 2
|
| 484 |
+
|
| 485 |
+
Proof. For the reconstruction term:
|
| 486 |
+
|
| 487 |
+
$$
|
| 488 |
+
\begin{array} { l } { \displaystyle \mathbb { E } _ { p _ { \theta _ { 0 } } ( \pmb { x } ) } \left[ \mathbb { E } _ { q _ { \eta } ( z | \pmb { x } , y ) q _ { \ast } ^ { r } ( y | \pmb { x } ) } \left[ \log p _ { \theta } ( \pmb { x } | z , y ) \right] \right] } \\ { \displaystyle = \frac { 1 } { 2 } \mathbb { E } _ { p _ { \theta _ { 0 } } ( \pmb { x } | y = 1 ) } \left[ \mathbb { E } _ { q _ { \eta } ( z | \pmb { x } , y = 0 ) , y = 0 \sim q _ { \ast } ^ { r } ( y | \pmb { x } ) } \left[ \log p _ { \theta } ( \pmb { x } | z , y = 0 ) \right] \right] } \\ { \displaystyle + \frac { 1 } { 2 } \mathbb { E } _ { p _ { \theta _ { 0 } } ( \pmb { x } | y = 0 ) } \left[ \mathbb { E } _ { q _ { \eta } ( z | \pmb { x } , y = 1 ) , y = 1 \sim q _ { \ast } ^ { r } ( y | \pmb { x } ) } \left[ \log p _ { \theta } ( \pmb { x } | z , y = 1 ) \right] \right] } \\ { \displaystyle = \frac { 1 } { 2 } \mathbb { E } _ { p _ { d a t a } ( \pmb { x } ) } \left[ \mathbb { E } _ { \widetilde { q } _ { \eta } ( z | \pmb { x } ) } \left[ \log \widetilde { p } _ { \theta } ( \pmb { x } | z ) \right] \right] + c o n s t , } \end{array}
|
| 489 |
+
$$
|
| 490 |
+
|
| 491 |
+
where $y = 0 \sim q _ { * } ^ { r } ( y | \mathbf { x } )$ means $q _ { * } ^ { r } ( y | { \pmb x } )$ predicts $y = 0$ with probability 1. Note that both $q _ { \eta } ( z | \mathbf { x } , y =$ 1) and $p _ { \theta } ( { \pmb x } | { \pmb z } , y = 1 )$ ∗ are constant distributions without free parameters to learn; $q _ { \eta } ( z | \mathbf { x } , y = 0 ) =$ $\tilde { q } _ { \eta } ( \boldsymbol { z } | \boldsymbol { x } )$ , and $p _ { \theta } ( { \pmb x } | z , y = 0 ) = \tilde { p } _ { \theta } ( { \pmb x } | z )$ .
|
| 492 |
+
|
| 493 |
+
For the $\mathrm { K L }$ prior regularization term:
|
| 494 |
+
|
| 495 |
+
$$
|
| 496 |
+
\begin{array} { l } { { \mathbb { E } _ { p _ { \theta _ { 0 } } ( x ) } \left[ { \mathrm { K L } } ( q _ { \eta } ( z | x , y ) q _ { * } ^ { r } ( y | x ) \| p ( z | y ) p ( y ) ) \right] } } \\ { = { \mathbb { E } } _ { p _ { \theta _ { 0 } } ( x ) } \left[ \int q _ { * } ^ { r } ( y | x ) { \mathrm { K L } } \left( q _ { \eta } ( z | x , y ) \| p ( z | y ) \right) d y + { \mathrm { K L } } \left( q _ { * } ^ { r } ( y | x ) \| p ( y ) \right) \right] } \\ { = \displaystyle \frac { 1 } { 2 } { \mathbb { E } } _ { p _ { \theta _ { 0 } } ( x | y = 1 ) } \left[ { \mathrm { K L } } \left( q _ { \eta } ( z | x , y = 0 ) \| p ( z | y = 0 ) \right) + c o n s t \right] + \displaystyle \frac { 1 } { 2 } { \mathbb { E } } _ { p _ { \theta _ { 0 } } ( x | y = 1 ) } \left[ c o n s t \right] } \\ { = \displaystyle \frac { 1 } { 2 } { \mathbb { E } } _ { p _ { d a t a } ( x ) } \left[ { \mathrm { K L } } \left( \widetilde { q } _ { \eta } ( z | x ) \| \widetilde { p } ( z ) \right) \right] . } \end{array}
|
| 497 |
+
$$
|
| 498 |
+
|
| 499 |
+
Combining Eq.(33) and Eq.(34) we recover the conventional VAE objective in Eq.(7) in the paper.
|
| 500 |
+
|
| 501 |
+
# F VAE/GAN JOINT MODELS FOR MODE MISSING/COVERING
|
| 502 |
+
|
| 503 |
+
Previous works have explored combination of VAEs and GANs. This can be naturally motivated by the asymmetric behaviors of the KL divergences that the two algorithms aim to optimize respectively. Specifically, the VAE/GAN joint models (Larsen et al., 2015; Pu et al., 2017) that improve the sharpness of VAE generated images can be alternatively motivated by remedying the mode covering behavior of the KLD in VAEs. That is, the KLD tends to drive the generative model to cover all modes of the data distribution as well as regions with small values of $p _ { d a t a }$ , resulting in blurred, implausible samples. Incorporation of GAN objectives alleviates the issue as the inverted KL enforces the generator to focus on meaningful data modes. From the other perspective, augmenting GANs with VAE objectives helps addressing the mode missing problem, which justifies the intuition of (Che et al., 2017a).
|
| 504 |
+
|
| 505 |
+
# G IMPORTANCE WEIGHTED GANS (IWGAN)
|
| 506 |
+
|
| 507 |
+
From Eq.(6) in the paper, we can view GANs as maximizing a lower bound of the “marginal log-likelihood” on $y$ :
|
| 508 |
+
|
| 509 |
+
$$
|
| 510 |
+
\begin{array} { r } { \log q ( y ) = \log \displaystyle \int p _ { \theta } ( \pmb { x } | y ) \frac { q ^ { r } ( y | \pmb { x } ) p _ { \theta _ { 0 } } ( \pmb { x } ) } { p _ { \theta } ( \pmb { x } | y ) } d \pmb { x } } \\ { \geq \displaystyle \int p _ { \theta } ( \pmb { x } | y ) \log \frac { q ^ { r } ( y | \pmb { x } ) p _ { \theta _ { 0 } } ( \pmb { x } ) } { p _ { \theta } ( \pmb { x } | y ) } d \pmb { x } } \\ { = - \mathrm { K L } ( p _ { \theta } ( \pmb { x } | y ) | | q ^ { r } ( \pmb { x } | y ) ) + c o n s t . } \end{array}
|
| 511 |
+
$$
|
| 512 |
+
|
| 513 |
+
We can apply the same importance weighting method as in IWAE (Burda et al., 2015) to derive a tighter bound.
|
| 514 |
+
|
| 515 |
+
$$
|
| 516 |
+
\begin{array} { r l } & { \log q ( y ) = \log \mathbb { E } \left[ \frac { 1 } { k } \displaystyle \sum _ { i = 1 } ^ { k } \frac { q ^ { r } ( y | x _ { i } ) p \theta _ { 0 } \left( x _ { i } \right) } { p \theta \left( x _ { i } | y \right) } \right] } \\ & { \qquad \geq \mathbb { E } \left[ \log \frac { 1 } { k } \displaystyle \sum _ { i = 1 } ^ { k } \frac { q ^ { r } ( y | x _ { i } ) p \theta _ { 0 } \left( x _ { i } \right) } { p \theta \left( x _ { i } | y \right) } \right] } \\ & { \qquad = \mathbb { E } \left[ \log \displaystyle \frac { 1 } { k } \displaystyle \sum _ { i = 1 } ^ { k } w _ { i } \right] } \\ & { \qquad : = \mathcal { L } _ { k } ( y ) } \end{array}
|
| 517 |
+
$$
|
| 518 |
+
|
| 519 |
+
where we have denoted $\begin{array} { r } { w _ { i } = \frac { q ^ { r } ( y | \pmb { x } _ { i } ) p _ { \theta _ { 0 } } ( \pmb { x } _ { i } ) } { p _ { \theta } ( \pmb { x } _ { i } | y ) } } \end{array}$ , which is the unnormalized importance weight. We recover the lower bound of Eq.(35) when setting $k = 1$ .
|
| 520 |
+
|
| 521 |
+
To maximize the importance weighted lower bound $\mathcal { L } _ { k } ( y )$ , we take the derivative w.r.t $\pmb \theta$ and apply the reparameterization trick on samples $_ { \textbf { \em x } }$ :
|
| 522 |
+
|
| 523 |
+
$$
|
| 524 |
+
\begin{array} { r } { \nabla _ { \theta } \mathcal { L } _ { k } ( y ) = \nabla _ { \theta } \mathbb { E } _ { \mathbf { x } _ { 1 } , \dots , \mathbf { x } _ { k } } \left[ \log \frac { 1 } { k } \sum _ { i = 1 } ^ { k } w _ { i } \right] = \mathbb { E } _ { z _ { 1 } , \dots , z _ { k } } \left[ \nabla _ { \theta } \log \frac { 1 } { k } \sum _ { i = 1 } ^ { k } w ( y , \mathbf { x } ( z _ { i } , \theta ) ) \right] } \\ { = \mathbb { E } _ { z _ { 1 } , \dots , z _ { k } } \left[ \displaystyle \sum _ { i = 1 } ^ { k } \widetilde { w } _ { i } \nabla _ { \theta } \log w ( y , \mathbf { x } ( z _ { i } , \theta ) ) \right] , } \end{array}
|
| 525 |
+
$$
|
| 526 |
+
|
| 527 |
+
where $\begin{array} { r } { \widetilde { w _ { i } } = w _ { i } / \sum _ { i = 1 } ^ { k } w _ { i } } \end{array}$ are the normalized importance weights. We expand the weight at $\pmb \theta = \pmb \theta _ { 0 }$
|
| 528 |
+
|
| 529 |
+
$$
|
| 530 |
+
w _ { i } | _ { \theta = \theta _ { 0 } } = \frac { q ^ { r } ( y | x _ { i } ) p _ { \theta _ { 0 } } ( x _ { i } ) } { p _ { \theta } ( x _ { i } | y ) } = q ^ { r } ( y | x _ { i } ) \frac { \frac { 1 } { 2 } p _ { \theta _ { 0 } } ( x _ { i } | y = 0 ) + \frac { 1 } { 2 } p _ { \theta _ { 0 } } ( x _ { i } | y = 1 ) } { p _ { \theta _ { 0 } } ( x _ { i } | y ) } | _ { \theta = \theta _ { 0 } . }
|
| 531 |
+
$$
|
| 532 |
+
|
| 533 |
+
The ratio of $p _ { \theta _ { 0 } } ( { \pmb x } _ { i } | y = 0 )$ and $p _ { \theta _ { 0 } } ( { \pmb x } _ { i } | y = 1 )$ is intractable. Using the Bayes’ rule and approximating with the discriminator distribution, we have
|
| 534 |
+
|
| 535 |
+
$$
|
| 536 |
+
{ \frac { p ( { \pmb x } | y = 0 ) } { p ( { \pmb x } | y = 1 ) } } = { \frac { p ( y = 0 | { \pmb x } ) p ( y = 1 ) } { p ( y = 1 | { \pmb x } ) p ( y = 0 ) } } \approx { \frac { q ( y = 0 | { \pmb x } ) } { q ( y = 1 | { \pmb x } ) } } .
|
| 537 |
+
$$
|
| 538 |
+
|
| 539 |
+
Plug Eq.(39) into the above we have
|
| 540 |
+
|
| 541 |
+
$$
|
| 542 |
+
w _ { i } | _ { \theta = \theta _ { 0 } } \approx \frac { q ^ { r } ( y | \mathbf { x } _ { i } ) } { q ( y | \mathbf { x } _ { i } ) } .
|
| 543 |
+
$$
|
| 544 |
+
|
| 545 |
+
In Eq.(37), the derivative $\nabla _ { \boldsymbol { \theta } } \log { w _ { i } }$ is
|
| 546 |
+
|
| 547 |
+
$$
|
| 548 |
+
\nabla _ { \boldsymbol { \theta } } \log { w ( y , x ( z _ { i } , \pmb { \theta } ) ) } = \nabla _ { \boldsymbol { \theta } } \log { q ^ { r } ( y | \mathbf { x } ( z _ { i } , \pmb { \theta } ) ) } + \nabla _ { \boldsymbol { \theta } } \log { \frac { p _ { \boldsymbol { \theta _ { 0 } } } ( \mathbf { x } _ { i } ) } { p _ { \boldsymbol { \theta } } ( \mathbf { x } _ { i } | y ) } } .
|
| 549 |
+
$$
|
| 550 |
+
|
| 551 |
+
The second term in the RHS of the equation is intractable as it involves evaluating the likelihood of implicit distributions. However, if we take $k = 1$ , it can be shown that
|
| 552 |
+
|
| 553 |
+
$$
|
| 554 |
+
\begin{array} { r l } & { - \mathbb { E } _ { p ( y ) p ( z | y ) } \left[ \nabla _ { \theta } \log \frac { p _ { \theta _ { 0 } } ( x ( z , \theta ) ) } { p _ { \theta } ( x ( z , \theta ) | y ) } | _ { \theta = \theta _ { 0 } } \right] } \\ & { = - \nabla _ { \theta } \frac { 1 } { 2 } \mathbb { E } _ { p _ { \theta } ( x | y = 0 ) } \left[ \frac { p _ { \theta _ { 0 } } ( x ) } { p _ { \theta } ( x | y = 0 ) } \right] + \frac { 1 } { 2 } \mathbb { E } _ { p _ { \theta } ( x | y = 1 ) } \left[ \frac { p _ { \theta _ { 0 } } ( x ) } { p _ { \theta } ( x | y = 1 ) } \right] | _ { \theta = \theta _ { 0 } } } \\ & { = \nabla _ { \theta } \mathrm { J S D } ( p _ { g _ { \theta } } ( x ) | | p _ { d a t a } ( x ) ) | _ { \theta = \theta _ { 0 } } , } \end{array}
|
| 555 |
+
$$
|
| 556 |
+
|
| 557 |
+
where the last equation is based on Eq.(23). That is, the second term in the RHS of Eq.(41) is (when $k = 1$ ) indeed the gradient of the JSD, which is subtracted away in the standard GANs as shown in Eq.(6) in the paper. We thus follow the standard GANs and also remove the second term even when $k > 1$ . Therefore, the resulting update rule for the generator parameter $\pmb \theta$ is
|
| 558 |
+
|
| 559 |
+
$$
|
| 560 |
+
\nabla _ { \theta } \mathcal { L } _ { k } ( y ) = \mathbb { E } _ { z _ { 1 } , \dots , z _ { k } \sim p ( z \mid y ) } \left[ \sum _ { i = 1 } ^ { k } \widetilde { w _ { i } } \nabla _ { \theta } \log q _ { \phi _ { 0 } } ^ { r } ( y | x ( z _ { i } , \pmb { \theta } ) ) \right] .
|
| 561 |
+
$$
|
| 562 |
+
|
| 563 |
+
# H ADVERSARY ACTIVATED VAES (AAVAE)
|
| 564 |
+
|
| 565 |
+
In our formulation, VAEs include a degenerated adversarial discriminator which blocks out generated samples from contributing to model learning. We enable adaptive incorporation of fake samples by activating the adversarial mechanism. Again, derivations are straightforward by making symbolic analog to GANs.
|
| 566 |
+
|
| 567 |
+
We replace the perfect discriminator $q _ { * } ( y | { \pmb x } )$ in vanilla VAEs with the discriminator network $q _ { \phi } ( y | \mathbf { x } )$ parameterized with $\phi$ as in GANs, resulting in an adapted objective of Eq.(12) in the paper:
|
| 568 |
+
|
| 569 |
+
$$
|
| 570 |
+
\begin{array} { r } { \operatorname* { m a x } _ { \theta , \eta } \mathcal { L } _ { \theta , \eta } ^ { \mathrm { u v a c } } = \mathbb { E } _ { p _ { \theta _ { 0 } } ( x ) } \left[ \mathbb { E } _ { q _ { \eta } ( z | x , y ) q _ { \phi } ^ { r } ( y | x ) } \left[ \log p _ { \theta } ( x | z , y ) \right] - \mathrm { K L } ( q _ { \eta } ( z | x , y ) q _ { \phi } ^ { r } ( y | x ) \| p ( z | y ) p ( y ) ) \right] . } \end{array}
|
| 571 |
+
$$
|
| 572 |
+
|
| 573 |
+
The form of Eq.(44) is precisely symmetric to the objective of InfoGAN in Eq.(9) with the additional KL prior regularization. Before analyzing the effect of adding the learnable discriminator, we first look at how the discriminator is learned. In analog to GANs in Eq.(3) and InfoGANs in Eq.(9), the objective of optimizing $\phi$ is obtained by simply replacing the inverted distribution $q _ { \phi } ^ { r } ( y | \pmb { x } )$ with $q _ { \phi } ( y | \mathbf { x } )$ :
|
| 574 |
+
|
| 575 |
+
$$
|
| 576 |
+
\begin{array} { r } { \operatorname* { m a x } _ { \phi } \mathcal { L } _ { \phi } ^ { \mathrm { a u s a c } } = \mathbb { E } _ { p _ { \theta _ { 0 } } ( x ) } \left[ \mathbb { E } _ { q _ { \eta } ( z | x , y ) q _ { \phi } ( y | x ) } \left[ \log p _ { \theta } ( x | z , y ) \right] - \mathrm { K L } \big ( q _ { \eta } ( z | x , y ) q _ { \phi } ( y | x ) \| p ( z | y ) p ( y ) \big ) \right] . } \end{array}
|
| 577 |
+
$$
|
| 578 |
+
|
| 579 |
+
Intuitively, the discriminator is trained to distinguish between real and fake instances by predicting appropriate $y$ that selects the components of $q _ { \eta } ( z | \boldsymbol { x } , y )$ and $p _ { \theta } ( \pmb { x } | \pmb { z } , y )$ to best reconstruct $_ { \textbf { \em x } }$ . The difficulty of Eq.(45) is that $p _ { \theta } ( { \pmb x } | z , y = 1 ) = p _ { d a t a } ( { \pmb x } )$ is an implicit distribution which is intractable for likelihood evaluation. We thus use the alternative objective as in GANs to train a binary classifier:
|
| 580 |
+
|
| 581 |
+
$$
|
| 582 |
+
\begin{array} { r } { \operatorname* { m a x } _ { \phi } \mathcal { L } _ { \phi } ^ { \mathrm { a v a e } } = \mathbb { E } _ { p _ { \theta } ( \pmb { x } | \pmb { z } , \pmb { y } ) p ( \pmb { z } | \pmb { y } ) p ( \pmb { y } ) } \left[ \log q _ { \phi } ( \pmb { y } | \pmb { x } ) \right] . } \end{array}
|
| 583 |
+
$$
|
| 584 |
+
|
| 585 |
+
# I EXPERIMENTS
|
| 586 |
+
|
| 587 |
+
# I.1 IMPORTANCE WEIGHTED GANS
|
| 588 |
+
|
| 589 |
+
We extend both vanilla GANs and class-conditional GANs (CGAN) with the importance weighting method. The base GAN model is implemented with the DCGAN architecture and hyperparameter setting (Radford et al., 2015). We do not tune the hyperparameters for the importance weighted extensions. We use MNIST, SVHN, and CIFAR10 for evaluation. For vanilla GANs and its IW extension, we measure inception scores (Salimans et al., 2016) on the generated samples. We train deep residual networks provided in the tensorflow library as evaluation networks, which achieve inception scores of 9.09, 6.55, and 8.77 on the test sets of MNIST, SVHN, and CIFAR10, respectively. For conditional GANs we evaluate the accuracy of conditional generation (Hu et al., 2017). That is, we generate samples given class labels, and then use the pre-trained classifier to predict class labels of the generated samples. The accuracy is calculated as the percentage of the predictions that match the conditional labels. The evaluation networks achieve accuracy of 0.990 and 0.902 on the test sets of MNIST and SVHN, respectively.
|
| 590 |
+
|
| 591 |
+
# I.2 ADVERSARY ACTIVATED VAES
|
| 592 |
+
|
| 593 |
+
We apply the adversary activating method on vanilla VAEs, class-conditional VAEs (CVAE), and semi-supervised VAEs (SVAE) (Kingma et al., 2014). We evaluate on the MNIST data. The generator networks have the same architecture as the generators in GANs in the above experiments, with sigmoid activation functions on the last layer to compute the means of Bernoulli distributions over pixels. The inference networks, discriminators, and the classifier in SVAE share the same architecture as the discriminators in the GAN experiments.
|
| 594 |
+
|
| 595 |
+
We evaluate the lower bound value on the test set, with varying number of real training examples. For each minibatch of real examples we generate equal number of fake samples for training. In the experiments we found it is generally helpful to smooth the discriminator distributions by setting the temperature of the output sigmoid function larger than 1. This basically encourages the use of fake data for learning. We select the best temperature from $\{ 1 , 1 . 5 , 3 , 5 \}$ through cross-validation. We do not tune other hyperparameters for the adversary activated extensions.
|
| 596 |
+
|
| 597 |
+
Table 4 reports the full results of SVAE and AA-SVAE, with the average classification accuracy and standard deviations over 5 runs.
|
| 598 |
+
|
| 599 |
+
<table><tr><td></td><td>1%</td><td>10%</td></tr><tr><td>SVAE</td><td>0.9412±.0039</td><td>0.9768±.0009</td></tr><tr><td>AASVAE</td><td>0.9425±.0045</td><td>0.9797±.0010</td></tr></table>
|
| 600 |
+
|
| 601 |
+
Table 4: Classification accuracy of semi-supervised VAEs and the adversary activated extension on the MNIST test set, with varying size of real labeled training examples.
|
md/train/tPCrkaLa9Y5ld/tPCrkaLa9Y5ld.md
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# One-Shot Adaptation of Supervised Deep Convolutional Models
|
| 2 |
+
|
| 3 |
+
Judy Hoffman, Eric Tzeng, Jeff Donahue UC Berkeley, EECS & ICSI {jhoffman,etzeng,jdonahue}@eecs.berkeley.edu
|
| 4 |
+
|
| 5 |
+
Yangqing Jia∗ Google Research jiayq@google.com
|
| 6 |
+
|
| 7 |
+
Kate Saenko UMass Lowell, CS & ICSI saenko@cs.uml.edu
|
| 8 |
+
|
| 9 |
+
Trevor Darrell UC Berkeley, EECS & ICSI trevor@eecs.berkeley.edu
|
| 10 |
+
|
| 11 |
+
# Abstract
|
| 12 |
+
|
| 13 |
+
Dataset bias remains a significant barrier towards solving real world computer vision tasks. Though deep convolutional networks have proven to be a competitive approach for image classification, a question remains: have these models have solved the dataset bias problem? In general, training or fine-tuning a state-ofthe-art deep model on a new domain requires a significant amount of data, which for many applications is simply not available. Transfer of models directly to new domains without adaptation has historically led to poor recognition performance. In this paper, we pose the following question: is a single image dataset, much larger than previously explored for adaptation, comprehensive enough to learn general deep models that may be effectively applied to new image domains? In other words, are deep CNNs trained on large amounts of labeled data as susceptible to dataset bias as previous methods have been shown to be? We show that a generic supervised deep CNN model trained on a large dataset reduces, but does not remove, dataset bias. Furthermore, we propose several methods for adaptation with deep models that are able to operate with little (one example per category) or no labeled domain specific data. Our experiments show that adaptation of deep models on benchmark visual domain adaptation datasets can provide a significant performance boost.
|
| 14 |
+
|
| 15 |
+
# 1 Introduction
|
| 16 |
+
|
| 17 |
+
Supervised deep convolutional neural networks (CNNs) trained on large-scale classification tasks have been shown to learn impressive mid-level structures and obtain high levels of performance on contemporary classification challenges [3, 23]. These models generally assume extensive training using labeled data, and testing is limited to data from the same domain. In practice, however, the images we would like to classify are often produced under different imaging conditions or drawn from a different distribution, leading to a domain shift. Scaling such models to new domains remains an open challenge.
|
| 18 |
+
|
| 19 |
+
Deep CNNs require large amounts of training data to learn good mid-level convolutional models and final fully-connected classifier stages. While the continuing expansion of web-based datasets like ImageNet [3] promises to produce labeled data for almost any desired category, such large-scale supervised datasets may not include images of the category across all domains of practical interest. Earlier deep learning efforts addressed this challenge by learning layers in an unsupervised fashion using unlabeled data to discover salient mid-level structures [6, 8]. While such approaches are appealing, they have heretofore been unable to match the level of performance of supervised models, and unsupervised training of networks with the same level of depth as [17] remains a challenge.
|
| 20 |
+
|
| 21 |
+
Unfortunately, image datasets are inherently biased [21]. Theoretical [2, 4] and practical results from [20, 21] have shown that supervised methods’ test error increases in proportion to the difference between the test and training input distribution. Many visual domain adaptation methods have been put forth to compensate for dataset bias [7, 22, 1, 20, 18, 16, 13, 12, 14, 15], but are limited to shallow models. Evaluation for image category classification across visually distinct domains has focused on the Office dataset, which contains 31 image categories and 3 domains [20]. Recently, [9] showed that using the deep mid-level features learned on ImageNet, instead of the more conventional bag-of-words features, effectively removed the bias in some of the domain adaptation settings in the Office dataset [20]. However, [9] limited their experiments to small-scale source domains found only in Office, and evaluated on only a subset of relevant layers.
|
| 22 |
+
|
| 23 |
+
Yet until now, almost none of the previous domain adaptation studies used ImageNet as the source domain, nor utilized the full set of parameters of a deep CNN trained on source data. Recent work by Rodner et al. [19] attempted to adapt from ImageNet to the SUN dataset, but did not take advantage of deep convolutional features.
|
| 24 |
+
|
| 25 |
+
In this paper, we ask the question: will deep models still suffer from dataset bias when trained with all layers of the CNN and a truly large scale source dataset? Here, we provide the first evaluation of domain adaptation with deep learned representations in its most natural setting, in which all of ImageNet is used as source data for a target category. We use the 1.2 million labeled images available in the 2012 ImageNet 1000-way classification dataset [3] to train the model in [17] and evaluate its generalization to the Office dataset. This constitutes a three orders of magnitude increase in source data compared to the several thousand images available for the largest domain in Office.
|
| 26 |
+
|
| 27 |
+
We find that it is easier to adapt from ImageNet than from previous smaller source domains, but that dataset bias remains a major issue. Fine-tuning the parameters on the small amount of labeled target data (we consider one-shot adaptation) turns out to be unsurprisingly problematic. Instead, we propose a simple yet intuitive adaptation method: train a final domain-adapted classification “layer” using various layers of the pre-trained network as features, without any fine-tuning its parameters. We provide a comprehensive evaluation of existing methods for classifier adaptation as applied to each of the fully connected layers of the network, including the last, task-specific classification layer. When adapting from ImageNet to Office, it turns out to be possible to achieve target domain performance on par with source domain performance using only a single labeled example per target category.
|
| 28 |
+
|
| 29 |
+
We examine both the setting where there are a few labeled examples from the target domain (supervised adaptation) and the setting where there are no labeled target examples (unsupervised adaptation). We also describe practical solutions for choosing between the various adaptation methods based on experimental constraints such as limited computation time.
|
| 30 |
+
|
| 31 |
+
# 2 Background: Deep Domain Adaptation Approaches
|
| 32 |
+
|
| 33 |
+
For our task we consider adapting between a large source domain and a target domain with few or or no labeled examples. A typical approach to domain adaptation or transfer learning with deep architectures is to take the representation learned via back-propagation on a large dataset, and then transfer the representation to a smaller dataset by fine-tuning, i.e. backpropagation at a lower learning rate [11, 23]. However, fine-tuning requires an ample amount of labeled target data and so should not be expected to work well when we consider the very sparse label condition, such as the one-shot learning scenario we evaluate below, where we have just one labeled example per category in the target domain.
|
| 34 |
+
|
| 35 |
+
In fact, in our experiments under this setting, fine-tuning actually reduces performance. Specifically, on the ImageNet Webcam task reported in Section 4, using the final output layer as a predictor in the target domain received $6 6 \%$ accuracy, while using the final output layer after fine tuning produced a degraded accuracy of $61 \%$ .
|
| 36 |
+
|
| 37 |
+
A separate method that was recently proposed for deep adaptation is called Deep Learning for domain adaptation by Interpolating between Domains (DLID) [5]. This method learns multiple unsupervised deep models directly on the source, target, and combined datasets and uses a representation which is the concatenation of the outputs of each model as its adaptation approach. While this was shown to be an interesting approach, it is limited by its use of unsupervised deep structures.
|
| 38 |
+
|
| 39 |
+
In general, unsupervised deep convolutional models have been unable to achieve the performance of supervised deep CNNs. However, training a supervised deep model requires sufficient labeled data. Our insight is that the extensive labeled data available in the source domain can be exploited using a supervised model without requiring a significant amount of labeled target data.
|
| 40 |
+
|
| 41 |
+
Therefore, we propose using a supervised deep source model with supervised or unsupervised adaptation algorithms that are applied to models learned on the target data directly. This hybrid approach will utilize the strong representation available from the supervised deep model trained on a large source dataset while requiring only enough target labeled data to train a shallow model with far fewer parameters. Specifically, we consider training a convolutional neural network (CNN) on the source domain and using that network to extract features on the target data that can then be used to train an auxiliary shallow learner. For extracting features from the deep source model, we follow the setup of Donahue et al. [9], which extracts a visual feature $D e C A F$ from the ImageNet-trained architecture of [17].
|
| 42 |
+
|
| 43 |
+
# 3 Adapting Deep CNNs with Few Labeled Target Examples
|
| 44 |
+
|
| 45 |
+
We propose a general framework for selectively adapting the parameters of a convolutional neural network (CNN) whose representation and classifier weights are trained on a large-scale source domain, such as ImageNet. Our framework adds a final domain-adaptive classification “layer” that takes the activations of one of the existing network’s layers as input features. Note that the network cannot be effectively fine-tuned without access to more labeled target data. This adapted layer is a linear classifier that combines source and target training data using an adaptation method. To demonstrate the generality of our framework, we select a representative set of popular linear classifier adaptation approaches that we empirically evaluate in Section 4. We separate our discussion into the set of supervised and unsupervised adaptation settings.
|
| 46 |
+
|
| 47 |
+
Below we denote the features extracted over the source domain as $\boldsymbol { X }$ and the features extracted over the target domain as $\tilde { X }$ . Similarly, we denote the source domain image classifier as $\pmb { \theta }$ and the target domain image classifier as $\tilde { \theta }$ .
|
| 48 |
+
|
| 49 |
+
# 3.1 Unsupervised Adaptation
|
| 50 |
+
|
| 51 |
+
Many unsupervised adaptation techniques seek to minimize the distance between subspaces that represent the source and target domains. We denote these subspaces as $U$ and $\tilde { U }$ , respectively.
|
| 52 |
+
|
| 53 |
+
GFK [12] The Geodesic Flow Kernel (GFK) method [12] is an unsupervised domain adaptation approach which seeks embeddings for the source and target points that minimize domain shift. Inputs to the method are $U$ and $\tilde { U }$ , lower-dimensional embeddings of the source and target domains (e.g. from principal component analysis). The method constructs the geodesic flow $\phi ( t )$ along the manifold of subspaces such that $U = \phi ( 0 )$ and $\tilde { U } = \phi ( 1 )$ . Finally, a transformation $G$ is constructed by computing $\begin{array} { r } { G = \int _ { 0 } ^ { 1 } \phi ( t ) \phi ( t ) ^ { \intercal } d t } \end{array}$ using a closed-form solution, and classification is performed by training an SVM on the source data $\boldsymbol { X }$ and transformed target data $G \tilde { X }$ .
|
| 54 |
+
|
| 55 |
+
SA [10] The Subspace Alignment (SA) method [10] also begins with low-dimensional embeddings of the source and target domains $U$ and $\tilde { U }$ , respectively. It seeks to minimize in $M$ , a transformation matrix, the objective $\| U M - \tilde { U } \| _ { F } ^ { 2 }$ . The analytical solution to this objective is $M ^ { * } = U ^ { \boldsymbol { \mathsf { T } } } \tilde { U }$ . Given $M ^ { * }$ , an SVM is trained on source data $\boldsymbol { X }$ and transformed target data $U M ^ { * } \tilde { U } ^ { \dagger } \tilde { X }$ .
|
| 56 |
+
|
| 57 |
+
# 3.2 Supervised Adaptation
|
| 58 |
+
|
| 59 |
+
Late Fusion Perhaps the simplest supervised adaptation method is to independently train a source and target classifier and combine the scores of the two to create a final scoring function. We call this approach Late Fusion. It has been explored by many for a simple adaptation approach. Let us denote the score from the source classifier as $v _ { s }$ and the score from the target classifier as $v _ { t }$ . For our experiments we explore two methods of combining these scores, which are described below:
|
| 60 |
+
|
| 61 |
+
• Max: Produce the scores of both the source and target classifier and simply choose the max of the two as the final score for each example. Therefore, $v _ { \mathrm { a d a p t } } = \operatorname* { m a x } ( v _ { s } , v _ { t } )$ . • Linear Interpolation: Set the score for a particular example to equal the convex combination of the source and target classifier scores, $v _ { \mathrm { a d a p t } } = ( 1 - \alpha ) v _ { s } + \alpha v _ { t }$ . This method requires setting a hyperparameter, $\alpha$ , which determines the weights of the source and target classifiers.
|
| 62 |
+
|
| 63 |
+
Late Fusion has two major advantages: it is easy to implement, and the source classifier it uses may be precomputed to make adaptation very fast. In the case of the linear interpolation combination rule, however, this method can potentially suffer from having a sensitive hyperparameter. We show a hyperparameter analysis in Section 4.
|
| 64 |
+
|
| 65 |
+
Daume III [7] ´ This simple feature replication method was proposed for domain adaptation by [7]. The method augments feature vectors with a source component, a target component, and a shared component. Each source data point $_ { \textbf { \em x } }$ is augmented to $\bar { \mathbf { x ^ { \prime } } } = ( \mathbf { x } ; x ; \mathbf { 0 } )$ , and each target data point $\tilde { \pmb { x } }$ is augmented to $\tilde { \pmb { x } } ^ { \prime } = ( \tilde { \pmb { x } } ; \mathbf { 0 } ; \tilde { \pmb { x } } )$ . Finally, an SVM is trained on the augmented source and target data—a relatively expensive procedure given the potentially large size of the source domain and the tripled augmented feature dimensionality.
|
| 66 |
+
|
| 67 |
+
PMT [1] This classifier adaptation method, Projective Model Transfer (PMT), proposed by [1], is a variant of adaptive SVM. It takes as input a classifier $\pmb \theta$ pre-trained on the source domain. PMTSVM learns a target domain classifier $\tilde { \pmb { \theta } }$ by adding an extra term to the usual SVM objective which regularizes the angle $\begin{array} { r } { \alpha ( \tilde { \theta } , \theta ) = \cos ^ { - 1 } \left( \frac { \theta ^ { \top } \tilde { \theta } } { \lVert \theta \rVert \lVert \tilde { \theta } \rVert } \right) } \end{array}$ between the target and source hyperplanes. This results in the following loss function:
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\mathcal { L } _ { P M T } ( \tilde { \pmb { \theta } } ) = \frac { 1 } { 2 } \| \tilde { \pmb { \theta } } \| _ { 2 } ^ { 2 } + \frac { \Gamma } { 2 } \| \tilde { \pmb { \theta } } \| _ { 2 } ^ { 2 } \sin ^ { 2 } \alpha ( \tilde { \pmb { \theta } } , \pmb { \theta } ) + \ell _ { h i n g e } ( \tilde { \pmb { X } } , \tilde { \pmb { Y } } ; \tilde { \pmb { \theta } } ) \ ,
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
where $\ell _ { h i n g e } ( X , Y ; \pmb \theta )$ denotes the SVM hinge loss of a data matrix $\boldsymbol { X }$ , label vector $\mathbf { Y }$ , and classifier hyperplane $\pmb \theta$ , and $\Gamma$ is a hyperparameter which, as it increases, enforces more transfer from the source classifier.
|
| 74 |
+
|
| 75 |
+
MMDT [15] The Max-margin Domain Transforms (MMDT) method from [15] jointly optimizes an SVM-like objective over a feature transformation matrix $A$ mapping target points to the source feature space and classifier parameters $\pmb { \theta }$ in the source feature space. In particular, MMDT minimizes the following loss function (assuming a binary classification task to simplify notation, and with $\ell _ { h i n g e }$ defined as in PMT):
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\mathcal { L } _ { M M D T } ( \pmb { \theta } , A ) = \frac { 1 } { 2 } \| \pmb { \theta } \| _ { 2 } ^ { 2 } + \frac { 1 } { 2 } \| A - I \| _ { F } ^ { 2 } + C _ { s } \ell _ { h i n g e } ( \pmb { X } , \pmb { Y } ; \pmb { \theta } ) + C _ { t } \ell _ { h i n g e } ( A \tilde { \pmb { X } } , \tilde { \pmb { Y } } ; \pmb { \theta } ) ,
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
where $C _ { s }$ and $C _ { t }$ are hyperparameters controlling the importance of correctly classifying the source and target points (respectively).
|
| 82 |
+
|
| 83 |
+
# 4 Evaluation
|
| 84 |
+
|
| 85 |
+
# 4.1 Datasets
|
| 86 |
+
|
| 87 |
+
The Office [20] dataset is a collection of images from three distinct domains: Amazon, DSLR, and Webcam. The 31 categories in the dataset consist of objects commonly encountered in office settings, such as keyboards, file cabinets, and laptops. Of these 31 categories, 16 overlap with the categories present in the 1000-category ImageNet classification task1. Thus, for our experiments, we limit ourselves to these 16 classes. In our experiments using Amazon as a source domain, we follow the standard training protocol for this dataset of using 20 source examples per category [20, 12], for a total of 320 images.
|
| 88 |
+
|
| 89 |
+
ImageNet [3] is the largest available dataset of image category labels. We use 1000 categories’ worth of data (1.2M images) to train the network, and use the 16 categories that overlap with Office (approximately 1200 examples per category or ${ \approx } 2 0 \mathrm { K }$ images total) as labeled source classifier data.
|
| 90 |
+
|
| 91 |
+
# 4.2 Experimental Setup & Baselines
|
| 92 |
+
|
| 93 |
+
For our experiments, we use the fully trained deep CNN model described in Section 2, extracting feature representations from three different layers of the CNN. We then train a source classifier using these features on one of two source domains, and adapt to the target domain.
|
| 94 |
+
|
| 95 |
+
The source domains we consider are either the Amazon domain, or the corresponding 16-category ImageNet subset where each category has many more examples. We focus on the Webcam domain as our target (test) domain, as Amazon-to-Webcam was shown to be the only challenging shift in [9] (the DSLR domain is much more similar to Webcam and did not require adaptation when using deep mid-level features). This combination exemplifies the shift from online web images to realworld images taken in typical office/home environments. Note that, regardless of the source domain chosen to learn the classifier, ImageNet data from all 1000 categories was used to train the network.
|
| 96 |
+
|
| 97 |
+
In addition, for the supervised adaptation setting we assume access to only a single example per category from the target domain (Webcam).
|
| 98 |
+
|
| 99 |
+
Each method is then evaluated across 20 random train/test splits, and we report averages and standard errors for each setting. For each random train/test split we choose one example for training and 10 other examples for testing (so there is a balanced test set across categories). Therefore, each test split has 160 examples. The unsupervised adaptation methods operate in a transductive setting, so the target subspaces are learned from the unlabeled test data.
|
| 100 |
+
|
| 101 |
+
Non-adaptive Baselines In addition to the adaptation methods outlined in Section 3, we also evaluate using the following non-adaptive baselines.
|
| 102 |
+
|
| 103 |
+
• SVM (source only): A support vector machine trained only on source data. • SVM (target only): A support vector machine trained only on target data. • SVM (source and target): A support vector machine trained on both source and target data. To account for the large discrepancy between the number of training data points in the source and target domains, we weighted the data points such that the constraints from the source and target domains effectively contribute equally to the optimization problem. Specifically, each source data point receives a weight of $\frac { n _ { t } } { n _ { s } + n _ { t } }$ , and each target data point receives a weight of $\frac { n _ { s } } { n _ { s } + n _ { t } }$ , where $n _ { s } , n _ { t }$ denote the number of data points in the source and target, respectively.
|
| 104 |
+
|
| 105 |
+
Many of the adaptation methods we evaluate have hyperparameters that must be cross-validated for use in practice, so we set the parameters of the adaptation techniques as follows.
|
| 106 |
+
|
| 107 |
+
First, the C value used for C-SVM in the classifier for all methods is set to $C = 1$ . Without any validation data we are not able to tune this parameter properly, so we choose to leave it as the default value. Since all methods we report require setting of this parameter, we feel that the relative comparisons between methods is sound even if the absolute numbers could be improved with a new setting for C. For Daume III and MMDT, which look at the source and target data simultaneously, ´ we use the same weighting scheme as we did for the source and target SVM. Late Fusion with the linear interpolation combination rule is reported across hyperparameter settings in Figure 1(a) to help understand how performance varies as we trade off emphasis between the learned classifiers from the source and target domains. Again, we do not have the validation data to tune this parameter so we report in the tables the performance averaged across parameter settings. The plot vs $\alpha$ indicates that there is usually a best parameter setting that could be learned with more available data. For PMT, we choose $\Gamma = 1 0 0 0$ , which corresponds to allowing a large amount of transfer from the source classifier to the target classifier. We do this because the source-only classifier is stronger than the target-only classifier (with ImageNet source). For the unsupervised methods GFK and SA, again we evaluated a variety of subspace dimensionalities and Figure 1(b) shows that the overall method performance does not vary significantly with the dimensionality choice.
|
| 108 |
+
|
| 109 |
+
<table><tr><td>Adaptation Method</td><td>Training Data</td><td>DeCAF6</td><td>DeCAF7</td></tr><tr><td>SVM (source only)</td><td>Amazon</td><td>50.28 ± 1.8</td><td>54.08 ± 1.7</td></tr><tr><td>SVM (target only)</td><td>Webcam</td><td>62.28 ± 1.8</td><td>64.97 ± 1.8</td></tr><tr><td>GFK[12]</td><td>Amazon</td><td>53.13 ±1.1</td><td>53.39 ± 1.1</td></tr><tr><td>SA [10]</td><td>Amazon</td><td>51.74 ± 1.2</td><td>53.86 ± 1.0</td></tr><tr><td>SVM (source and target)</td><td>Amazon+Webcam</td><td>62.91 ±1.8</td><td>65.82 ± 1.4</td></tr><tr><td>Late Fusion (Max)</td><td>Amazon+Webcam</td><td>65.35 ± 1.7</td><td>58.42 ± 1.1</td></tr><tr><td>Late Fusion (Lin. Int. Avg)</td><td>Amazon+Webcam</td><td>63.23 ± 1.4</td><td>64.29 ± 1.3</td></tr><tr><td>Daumé III [7]</td><td>Amazon+Webcam</td><td>68.89 ± 1.9</td><td>72.09 ± 1.4</td></tr><tr><td>PMT[1]</td><td>Amazon+Webcam</td><td>64.84 ± 1.5</td><td>65.63 ± 1.8</td></tr><tr><td>MMDT[15]</td><td>Amazon+Webcam</td><td>65.47 ± 1.8</td><td>68.10 ± 1.5</td></tr><tr><td>Late Fusion (Lin. Int. Oracle)</td><td>Amazon+Webcam</td><td>71.1 ± 1.7</td><td>72.82 ±1.4</td></tr></table>
|
| 110 |
+
|
| 111 |
+
Table 1: Amazon Webcam adaptation experiment. We show here multiclass accuracy on the target domain test set for both supervised and unsupervised adaptation experiments across the two fully connected layer features (similar to [9], but with one labeled target example). The best performing unsupervised adaptation algorithms are shown in blue and the best performing supervised adaptation algorithms are shown in red.
|
| 112 |
+
|
| 113 |
+
# 4.3 Effect of Source Domain Size
|
| 114 |
+
|
| 115 |
+
Previous studies considered source domains from the Office dataset. In this section, we ask what happens when an orders-of-magnitute larger source dataset is used.
|
| 116 |
+
|
| 117 |
+
For completeness we begin by evaluating Amazon as a source domain. Preliminary results on this setting are reported in [9], here we extend the comparison here by presenting the results with more adaptation algorithms and more complete evaluation of hyperparameter settings. Table 1 presents multiclass accuracies for each algorithm using either layer 6 or 7 from the deep network, which corresponds to the output from each of the fully connected layers.
|
| 118 |
+
|
| 119 |
+
An SVM trained using only Amazon data achieves $7 8 . 6 \%$ in-domain accuracy (tested on the same domain) when using the ${ \mathrm { D e C A F } } _ { 6 }$ feature and $8 0 . 2 \%$ in-domain accuracy when using the ${ \mathrm { D e C A F } } _ { 7 }$ feature. These numbers are significantly higher than the performance of the same classifier on Webcam test data, indicating that even with the DeCAF features, there is a still a domain shift between the Amazon and Webcam datasets.
|
| 120 |
+
|
| 121 |
+
Next, we consider an unsupervised adaptation setting where no labeled examples are available from the target dataset. In this scenario, we apply two state-of-the-art unsupervised adaptation methods, GFK [12] and SA [10]. Both of these methods make use of a subspace dimensionality hyperparameter. We show the results using a 100-dimensional subspace and leave the discussion of setting this parameter until Section 4.6. For this shift the adaptation algorithms increase performance when using the layer 6 feature, but offer no additional improvement when using the layer 7 feature.
|
| 122 |
+
|
| 123 |
+
We finally assume that a single example per category is available in the target domain. As the bottom rows of Table 1 show, supervised adaptation algorithms are able to provide significant improvement regardless of the feature space chosen, even in the one-shot scenario. For this experiment we noticed that using the second fully connected layer $( \mathrm { D e C A F } _ { 7 }$ ) was a stronger overall feature in general.
|
| 124 |
+
|
| 125 |
+
# 4.4 Adapting with a Large Scale Source Domain
|
| 126 |
+
|
| 127 |
+
We next address one of the main questions of this paper: Is there still a domain shift when using a large source dataset such as ImageNet? To begin to answer this question we follow the same experimental paradigm as the previous experiment, but use ImageNet as our source dataset. The results are shown in Table 2.
|
| 128 |
+
|
| 129 |
+
Again, we first verify that the source only SVM achieves higher performance when tested on indomain data than on Webcam data. Indeed, for the 16 overlapping labels, the source SVM produces $6 2 . 5 0 \%$ accuracy on ImageNet data using ${ \mathrm { D e C A F } } _ { 6 }$ features and $7 4 . 5 0 \%$ accuracy when using ${ \mathrm { D e C A F } } _ { 7 }$ features. Compare this to the $54 \%$ and $59 \%$ for Webcam evaluation and a dataset bias is still clearly evident.
|
| 130 |
+
|
| 131 |
+
Table 2: ImageNet Webcam adaptation experiment. Comparison of unsupervised and supervised adaptation algorithms on the ImageNet to Webcam domain shift. Results are computed using the outputs of each of the fully connected layers as features. The best supervised adaptation performance is indicated in red and the best unsupervised adaptation performance is highlighted in blue.
|
| 132 |
+
|
| 133 |
+
<table><tr><td>Adaptation Method</td><td>Training Data</td><td>DeCAF6</td><td>DeCAF7</td></tr><tr><td>SVM (source only)</td><td>ImageNet</td><td>53.51 ± 1.1</td><td>59.15 ± 1.1</td></tr><tr><td>SVM (target only)</td><td>Webcam</td><td>62.28 ± 1.8</td><td>64.97 ± 1.8</td></tr><tr><td>GFK [12]</td><td>ImageNet</td><td>65.16 ± 1.1</td><td>67.97 ± 1.4</td></tr><tr><td>SA [10]</td><td>ImageNet</td><td>59.30 ± 1.4</td><td>66.08 ± 1.4</td></tr><tr><td>SVM (source and target)</td><td>ImageNet+Webcam</td><td>56.68 ± 1.2</td><td>66.93 ± 1.3</td></tr><tr><td>Late Fusion (Max)</td><td>ImageNet+Webcam</td><td>59.59 ± 1.3</td><td>68.86 ± 1.2</td></tr><tr><td>Late Fusion (Lin. Int. Avg)</td><td>ImageNet+Webcam</td><td>60.64 ± 1.3</td><td>66.45 ± 1.1</td></tr><tr><td>Daumé III [7]</td><td>ImageNet+Webcam</td><td>59.21 ± 1.7</td><td>71.39 ± 1.5</td></tr><tr><td>PMT[1]</td><td>ImageNet+Webcam</td><td>66.30 ± 2.1</td><td>69.81 ± 1.8</td></tr><tr><td>MMDT[15]</td><td>ImageNet+Webcam</td><td>59.21 ± 1.3</td><td>67.75 ± 1.4</td></tr><tr><td>Late Fusion (Lin. Int. Oracle)</td><td>ImageNet+Webcam</td><td>71.65 ± 2.0</td><td>76.76 ± 1.3</td></tr></table>
|
| 134 |
+
|
| 135 |
+
Table 3: ImageNet Webcam and Amazon Webcam adaptation experiments using $\mathrm { D e C A F _ { 8 } }$ , the label activations of the CNN trained on the full ImageNet data. Again, we compare multiclass accuracy of various unsupervised and supervised adaptation methods. The best performing unsupervised adaptation algorithm is shown in blue and the best performing supervised adaptation algorithms are shown in red.
|
| 136 |
+
|
| 137 |
+
<table><tr><td>Adaptation Method</td><td>Training Data</td><td>Source=ImageNet</td><td>Source=Amazon</td></tr><tr><td>SVM (source only)</td><td>Source</td><td>66.23 ± 0.8</td><td>53.23 ± 1.6</td></tr><tr><td>SVM (target only)</td><td>Webcam</td><td>63.13 ± 1.9</td><td>63.13 ± 1.9</td></tr><tr><td>GFK[12]</td><td>Source</td><td>68.73 ±1.1</td><td>54.56 ± 1.2</td></tr><tr><td>SA[10]</td><td>Source</td><td>66.08 ± 1.1</td><td>55.98 ± 1.0</td></tr><tr><td> SVM (source and target)</td><td>Source+Webcam</td><td>75.13 ± 1.1</td><td>63.20 ± 1.7</td></tr><tr><td>Late Fusion (Max)</td><td>Source+Webcam</td><td>71.77 ± 1.4</td><td>62.25 ± 0.8</td></tr><tr><td>Late Fusion (LinInt Avg)</td><td>Source+Webcam</td><td>70.56 ± 1.2</td><td>64.56 ± 1.3</td></tr><tr><td>Daumé III [7]</td><td>Source+Webcam</td><td>77.15 ± 1.1</td><td>70.51 ± 1.7</td></tr><tr><td>PMT[1]</td><td>Source+Webcam</td><td>70.28 ± 1.8</td><td>66.77 ± 2.1</td></tr><tr><td>MMDT[15]</td><td>Source+Webcam</td><td>73.96 ± 1.2</td><td>66.23 ± 1.4</td></tr><tr><td>Late Fusion (Lin. Int. Oracle)</td><td>Source+Webcam</td><td>76.61 ± 1.5</td><td>71.49 ± 1.3</td></tr></table>
|
| 138 |
+
|
| 139 |
+
Note that when using ImageNet as a source domain, overall performance of all algorithms improves. In addition, unsupervised adaptation approaches are more effective than for the smaller source domain experiment.
|
| 140 |
+
|
| 141 |
+
# 4.5 Adapting a Pre-trained Classifier to a New Label Set
|
| 142 |
+
|
| 143 |
+
$\mathrm { D e C A F _ { 8 } }$ differs from the other DeCAF features in that it constitutes the 1000 activations corresponding to the 1000 labels in the ImageNet classification task. In the CNN proposed by [17], these activations are fed into a softmax unit to compute the label probabilities. We instead experiment with using the $\mathrm { D e C A F _ { 8 } }$ activations directly as a feature representation, which is akin to training another classifier using the output of the 1000-way CNN classifier.
|
| 144 |
+
|
| 145 |
+
Table 3 shows results for various adaptation techniques using both ImageNet and Amazon as source domains. We use the same setup as before, but instead use $\mathrm { D e C A F _ { 8 } }$ as the feature representation.
|
| 146 |
+
|
| 147 |
+
The ImageNet results are uniformly better with $\mathrm { D e C A F _ { 8 } }$ than with ${ \mathrm { D e C A F } } _ { 6 }$ or ${ \mathrm { D e C A F } } _ { 7 }$ , likely due to the fact that $\mathrm { D e C A F _ { 8 } }$ was explicitly trained on ImageNet data to effectively discriminate between ImageNet categories. Because it can more effectively classify images from the source domain, it is able to better adapt from the source domain to the target domain.
|
| 148 |
+
|
| 149 |
+
However, we see a negligible difference in performance for Amazon, with performance actually decreasing with respect to ${ \mathrm { D e C A F } } _ { 7 }$ for certain adaptation methods. We believe this is because the final activation vector is too specific to the 1000-way ImageNet task, and that ${ \mathrm { D e C A F } } _ { 7 }$ provides a more general representation that is better suited to the Amazon domain. This, in turn, results in improved adaptation. In general, however, the difference between the various DeCAF representations with Amazon as a source are small enough to be insignificant.
|
| 150 |
+
|
| 151 |
+
# 4.6 Analysis and Practical Considerations
|
| 152 |
+
|
| 153 |
+
Our adaptation experiments show that, despite its large size, even ImageNet is not large enough to cover all domains, and that traditional domain adaptation methods go a long way in increasing performance and mitigating the effects of this shift. Depending on the characteristics of the problem at hand, our results suggest different methods may be most suitable.
|
| 154 |
+
|
| 155 |
+
If no labels exist in the target domain, then there are unsupervised adaptation algorithms that are easy to use and fast to compute at adaptation time, yet still achieve increased performance over sourceonly methods. For this scenario, we experimented with two subspace alignment based methods that both require setting a parameter that indicates the dimensionality of the input subspaces. Figure 1(b) shows the effect that changing the subspace dimensionality has on the overall method performance. In general, we noticed that these methods were not particularly sensitive to this parameter so long as the dimensionality remains larger than the number of categories in our label set. Below this threshold, the subspace is less likely to capture all important discriminative information needed for classification.
|
| 156 |
+
|
| 157 |
+
In the case where we have a large source dataset and a limited number of labeled target examples, it may be preferable to compute source classifier parameters in advance, then examine only the source parameters and the target data at adaptation time. Examples of these kinds of methods are Late Fusion and PMT. These methods are unaffected by the number of data points in the source domain at adaptation time, and can thus be applied quickly. In our experiments, we found that a properly tuned Late Fusion classifier with linear interpolation was the fastest and most effective approach. Figure 1(a) shows the performance of linear interpolation Late Fusion as we vary the hyperparameter $\alpha$ . Although the method is sensitive to $\alpha$ , we found that for both source domains, the basic strategy of setting $\alpha$ around 0.8 provides a close approximation to optimal performance. This setting can be interpreted as trusting the target classifier more than the source, but not so much as to completely discount the information available from the source classifier. In each table we report both the performance of linear interpolation both averaged across hyper parameter settings $\bar { \alpha \in [ 0 , 1 ] }$ as well as the performance of linear interpolation with the best possible setting of $\alpha$ per experiment – this is denoted as “Oracle” performance.
|
| 158 |
+
|
| 159 |
+
If there are no computational constraints and there are very few labels in the target domain, the best-performing method seems to be the “frustratingly easy” approach originally proposed by Daume III [7] and applied again for deep models in [5]. ´
|
| 160 |
+
|
| 161 |
+
Finally, we found that feature representation can have a significant impact on adaptation performance. Our results show that ImageNet as source performs best with the $\mathrm { D e C A F _ { 8 } }$ representation, whereas Amazon as source performs best with the ${ \mathrm { D e C A F } } _ { 7 }$ representation. This, combined with our intuition, seems to indicate that for adaptation from source domains other than ImageNet, an intermediate representation other than $\mathrm { D e C A F _ { 8 } }$ is more powerful for adaptation, whereas ImageNet classification works best with the full representation that was trained on it.
|
| 162 |
+
|
| 163 |
+
# 5 Conclusion
|
| 164 |
+
|
| 165 |
+
In this paper, we presented the first evaluation of domain adaptation from a large-scale source dataset with deep features. We demonstrated that, although using ImageNet as a source domain generalizes better than other smaller source domains, there is still a domain shift when adapting to other visual domains.
|
| 166 |
+
|
| 167 |
+

|
| 168 |
+
Figure 1: Evaluation of hyperparameters for domain adaptation methods. (a) Analysis of the combination hyperparameter $\alpha$ for Late Fusion with linear interpolation. (b) Analysis of the subspace dimensionality for the unsupervised adaptation algorithms
|
| 169 |
+
|
| 170 |
+
Our experimental results show that deep adaptation methods can go a long way in mitigating the effects of this domain shift. Based on our results, we also provided a set of practical recommendations for choosing a feature representation and adaptation method accounting for constraints on runtime and accuracy.
|
| 171 |
+
|
| 172 |
+
There are a number of interesting directions to take given our results. First we notice that though $\mathrm { D e C A F _ { 8 } }$ is the strongest feature to use for learning a classifier on ImageNet data, ${ \mathrm { D e C A F } } _ { 7 }$ is actually a better feature to use with the Amazon source domain and the Webcam target domain. This could lead to a hybrid approach where one uses different feature representations for the various domains and produces a combined adapted model. Another interesting direction that should be explored is to integrate the adaption algorithms into the deep models explicitly and even allow for feedback between the two stages. Current deep models although allow information flow between the final classifier and the representation learning architecture. We feel that the next step is to have a separate task specific adaptable layer that does not simply learn a new final layer, but instead learns a separate, but equivalent final layer, that is regularized by the final layer learned on the source dataset.
|
| 173 |
+
|
| 174 |
+
This future work is a natural extension of the result we have shown in this paper: that pre-trained deep representations with large source domains can be effectively adapted to new target domains using only shallow, linear adaptation methods, and that in cases where the target data is limited, this approach is the best way to mitigate dataset bias.
|
| 175 |
+
|
| 176 |
+
# References
|
| 177 |
+
|
| 178 |
+
[1] Y. Aytar and A. Zisserman. Tabula rasa: Model transfer for object category detection. In Proc. ICCV, 2011.
|
| 179 |
+
[2] Shai Ben-David, John Blitzer, Koby Crammer, Fernando Pereira, et al. Analysis of representations for domain adaptation. Proc. NIPS, 2007.
|
| 180 |
+
[3] A. Berg, J. Deng, and L. Fei-Fei. ImageNet Large Scale Visual Recognition Challenge 2012. 2012.
|
| 181 |
+
[4] John Blitzer, Koby Crammer, Alex Kulesza, Fernando Pereira, and Jennifer Wortman. Learning bounds for domain adaptation. In Proc. NIPS, 2007.
|
| 182 |
+
[5] S. Chopra, S. Balakrishnan, and R. Gopalan. DLID: Deep learning for domain adaptation by interpolating between domains. In ICML Workshop on Challenges in Representation Learning, 2013.
|
| 183 |
+
[6] A. Coates, A. Karpathy, and A. Ng. Emergence of object-selective features in unsupervised feature learning. In Proc. NIPS, 2012.
|
| 184 |
+
[7] H. Daume III. Frustratingly easy domain adaptation. In ´ ACL, 2007.
|
| 185 |
+
[8] J. Dean, G. Corrado, R. Monga, K. Chen, M. Devin, Q. Le, M. Mao, M. Ranzato, A. Senior, P. Tucker, K. Yang, and A. Ng. Large scale distributed deep networks. In Proc. NIPS, 2012.
|
| 186 |
+
[9] J. Donahue, Y. Jia, O. Vinyals, J. Hoffman, N. Zhang, E. Tzeng, and T. Darrell. DeCAF: A Deep Convolutional Activation Feature for Generic Visual Recognition. arXiv e-prints, 2013.
|
| 187 |
+
[10] B. Fernando, A. Habrard, M. Sebban, and T. Tuytelaars. Unsupervised visual domain adaptation using subspace alignment. In Proc. ICCV, 2013.
|
| 188 |
+
[11] R. Girshick, J. Donahue, T. Darrell, and J. Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. arXiv e-prints, 2013.
|
| 189 |
+
[12] B. Gong, Y. Shi, F. Sha, and K. Grauman. Geodesic flow kernel for unsupervised domain adaptation. In Proc. CVPR, 2012.
|
| 190 |
+
[13] R. Gopalan, R. Li, and R. Chellappa. Domain adaptation for object recognition: An unsupervised approach. In Proc. ICCV, 2011.
|
| 191 |
+
[14] J. Hoffman, B. Kulis, T. Darrell, and K. Saenko. Discovering latent domains for multisource domain adaptation. In Proc. ECCV, 2012.
|
| 192 |
+
[15] J. Hoffman, E. Rodner, J. Donahue, K. Saenko, and T. Darrell. Efficient learning of domain-invariant image representations. In Proc. ICLR, 2013.
|
| 193 |
+
[16] A. Khosla, T. Zhou, T. Malisiewicz, A. Efros, and A. Torralba. Undoing the damage of dataset bias. In Proc. ECCV, 2012.
|
| 194 |
+
[17] A. Krizhevsky, I. Sutskever, and G. E. Hinton. ImageNet classification with deep convolutional neural networks. In Proc. NIPS, 2012.
|
| 195 |
+
[18] B. Kulis, K. Saenko, and T. Darrell. What you saw is not what you get: Domain adaptation using asymmetric kernel transforms. In Proc. CVPR, 2011.
|
| 196 |
+
[19] Erik Rodner, Judy Hoffman, Jeff Donahue, Trevor Darrell, and Kate Saenko. Towards adapting imagenet to reality: Scalable domain adaptation with implicit low-rank transformations. CoRR, abs/1308.4200, 2013.
|
| 197 |
+
[20] K. Saenko, B. Kulis, M. Fritz, and T. Darrell. Adapting visual category models to new domains. In Proc. ECCV, 2010.
|
| 198 |
+
[21] A. Torralba and A. Efros. Unbiased look at dataset bias. In Proc. CVPR, 2011.
|
| 199 |
+
[22] J. Yang, R. Yan, and A. Hauptmann. Adapting SVM classifiers to data with shifted distributions. In ICDM Workshops, 2007.
|
| 200 |
+
[23] M. Zeiler and R. Fergus. Visualizing and Understanding Convolutional Networks. ArXiv e-prints, 2013.
|
md/train/x2TMPhseWAW/x2TMPhseWAW.md
ADDED
|
@@ -0,0 +1,427 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Label Noise SGD Provably Prefers Flat Global Minimizers
|
| 2 |
+
|
| 3 |
+
Alex Damian Princeton University ad27@princeton.edu
|
| 4 |
+
|
| 5 |
+
Tengyu Ma Stanford University tengyuma@stanford.edu
|
| 6 |
+
|
| 7 |
+
Jason Lee Princeton University jasonlee@princeton.edu
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
In overparametrized models, the noise in stochastic gradient descent (SGD) implicitly regularizes the optimization trajectory and determines which local minimum SGD converges to. Motivated by empirical studies that demonstrate that training with noisy labels improves generalization, we study the implicit regularization effect of SGD with label noise. We show that SGD with label noise converges to a stationary point of a regularized loss $L ( \theta ) + \lambda R ( \theta )$ , where $L ( \theta )$ is the training loss, $\lambda$ is an effective regularization parameter depending on the step size, strength of the label noise, and the batch size, and $R ( \theta )$ is an explicit regularizer that penalizes sharp minimizers. Our analysis uncovers an additional regularization effect of large learning rates beyond the linear scaling rule that penalizes large eigenvalues of the Hessian more than small ones. We also prove extensions to classification with general loss functions, significantly strengthening the prior work of Blanc et al. [3] to global convergence and large learning rates and of HaoChen et al. [12] to general models.
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
One of the central questions in modern machine learning theory is the generalization capability of overparametrized models trained by stochastic gradient descent (SGD). Recent work identifies the implicit regularization effect due to the optimization algorithm as one key factor in explaining the generalization of overparameterized models [27, 11, 19, 10]. This implicit regularization is controlled by many properties of the optimization algorithm including search direction [11], learning rate [20], batch size [26], momentum [21] and dropout [22].
|
| 16 |
+
|
| 17 |
+
The parameter-dependent noise distribution in SGD is a crucial source of regularization [16, 18]. Blanc et al. [3] initiated the study of the regularization effect of label noise SGD with square loss1 by characterizing the local stability of global minimizers of the training loss. By identifying a data-dependent regularizer $R ( \theta )$ , Blanc et al. [3] proved that label noise SGD locally diverges from the global minimizer $\theta ^ { * }$ if and only if $\theta ^ { * }$ is not a first-order stationary point of minθ $R ( \theta )$ subject to $\bar { \cal L ( \theta ) } = 0$ . The analysis is only able to demonstrate that with sufficiently small step size $\eta$ , label noise SGD initialized at $\theta ^ { * }$ locally diverges by a distance of $\eta ^ { 0 . 4 }$ and correspondingly decreases the regularizer by $\eta ^ { 0 . 4 }$ . This is among the first results that establish that the noise distribution alters the local stability of stochastic gradient descent. However, the parameter movement of $\eta ^ { 0 . 4 }$ is required to be inversely polynomially small in dimension and condition number and is thus too small to affect the predictions of the model.
|
| 18 |
+
|
| 19 |
+
HaoChen et al. [12], motivated by the local nature of Blanc et al. [3], analyzed label noise SGD in the quadratically-parametrized linear regression model [29, 32, 23]. Under a well-specified sparse linear regression model and with isotropic features, HaoChen et al. [12] proved that label noise SGD recovers the sparse ground-truth despite overparametrization, which demonstrated a global implicit bias towards sparsity in the quadratically-parametrized linear regression model.
|
| 20 |
+
|
| 21 |
+
This work seeks to identify the global implicit regularization effect of label noise SGD. Our primary result, which supports Blanc et al. [3], proves that label noise SGD converges to a stationary point of $L ( \theta ) + \lambda R ( \theta )$ , where the regularizer $R ( \theta )$ penalizes sharp regions of the loss landscape.
|
| 22 |
+
|
| 23 |
+
The focus of this paper is on label noise SGD due to its strong regularization effects in both real and synthetic experiments [25, 28, 31]. Furthermore, label noise is used in large-batch training as an additional regularizer [25] when the regularization from standard regularizers (e.g. mini-batch, batch-norm, and dropout) is not sufficient. Label noise SGD is also known to be less sensitive to initialization, as shown in HaoChen et al. [12]. In stark contrast, mini-batch SGD remains stuck when initialized at any poor global minimizer. Our analysis demonstrates a global regularization effect of label noise SGD by proving it converges to a stationary point of a regularized loss $L ( \theta ) + \lambda R ( \theta )$ , even when initialized at a zero error global minimum.
|
| 24 |
+
|
| 25 |
+
The learning rate and minibatch size in SGD are known to be important sources of regularization [9]. Our main theorem highlights the importance of learning rate and batch size as the hyperparameters that control the balance between the loss and the regularizer – larger learning rates and smaller batch sizes lead to stronger regularization.
|
| 26 |
+
|
| 27 |
+
Section 2 reviews the notation and assumptions used throughout the paper. Section 2.4 formally states the main result and Section 3 sketches the proof. Section 4 presents experimental results which support our theory. Finally, Section 6 discusses the implications of this work.
|
| 28 |
+
|
| 29 |
+
# 2 Problem Setup and Main Result
|
| 30 |
+
|
| 31 |
+
Section 2.1 describes our notation and the SGD with label noise algorithm. Section 2.2 introduces the explicit formula for the regularizer $R ( \theta )$ . Sections 2.3 and 2.4 formally state our main result.
|
| 32 |
+
|
| 33 |
+
# 2.1 Notation
|
| 34 |
+
|
| 35 |
+
We focus on the regression setting (see Appendix $\mathrm { E }$ for the extension to the classification setting). Let $\{ ( x _ { i } , y _ { i } ) \} _ { i \in [ n ] }$ be $n$ datapoints with $x _ { i } \in \mathcal { D }$ and $y _ { i } \in \mathbb { R }$ . Let $f : \mathcal { D } \times \mathbb { R } ^ { d } \to \mathbb { R }$ and let $f _ { i } ( \theta ) = f ( x _ { i } , \theta )$ denote the value of $f$ on the datapoint $x _ { i }$ . Define $\begin{array} { r } { \ell _ { i } ( \theta ) = \frac { 1 } { 2 } \left( f _ { i } ( \theta ) - y _ { i } \right) ^ { 2 } } \end{array}$ and $\begin{array} { r } { L ( \theta ) = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \ell _ { i } ( \theta ) } \end{array}$ Then we will follow Algorithm 1 which adds fresh additive noise to the labels $y _ { i }$ at every step before computing the gradient:
|
| 36 |
+
|
| 37 |
+
# Algorithm 1: SGD with Label Noise
|
| 38 |
+
|
| 39 |
+
<table><tr><td>Input: 0o,step size n, noise variance g²,batch size B,steps T fork=0toT-1do</td></tr><tr><td>Sample batch B(k) C[n}B uniformly and label noise e(𝑘)~{-σ,σ} for i ∈ B(𝑘).</td></tr><tr><td>Lete((0)=2(() -y - () and L(k)= B∑i∈B(k) ).</td></tr><tr><td></td></tr><tr><td>0k+1←0k-n∀L(k)(0k)</td></tr><tr><td>end</td></tr></table>
|
| 40 |
+
|
| 41 |
+
Note that $\sigma$ controls the strength of the label noise and will control the strength of the implicit regularization in Theorem 1. Throughout the paper we will use $\| \cdot \| = \| \cdot \| _ { 2 }$ . We make the following standard assumption on $f$ :
|
| 42 |
+
|
| 43 |
+
Assumption 1 (Smoothness). We assume that each $f _ { i }$ is $\ell _ { f }$ -Lipschitz, $\nabla f _ { i }$ is $\rho _ { f }$ -Lipschitz, and $\nabla ^ { 2 } f _ { i }$ is $\kappa _ { f }$ -Lipschitz with respect to $\parallel \cdot \parallel _ { 2 } f o r i = 1 , \ldots , n$ .
|
| 44 |
+
|
| 45 |
+
We will define $\ell = \ell _ { f } ^ { 2 }$ to be an upper bound on $\begin{array} { r } { \| \frac { 1 } { n } \sum _ { i } \nabla f _ { i } ( \theta ) \nabla f _ { i } ( \theta ) ^ { T } \| _ { 2 } } \end{array}$ , which is equal to $\| \nabla ^ { 2 } L ( \theta ) \| _ { 2 }$ at any global minimizer $\theta$ . Our results extend to any learning rate $\eta \in ( 0 , \frac { 2 } { \ell } )$ . However, they do not extend to the limit as $\begin{array} { r } { \eta \to \frac { 2 } { \ell } } \end{array}$ . Because we still want to track the dependence on $\frac { 1 } { \eta }$ , we do not assume $\eta$ is a fixed constant and instead assume some constant separation:
|
| 46 |
+
|
| 47 |
+
Assumption 2 (Learning Rate Separation). There exists a constant $\nu \in ( 0 , 1 )$ such that $\begin{array} { r } { \eta \le \frac { 2 - \nu } { \ell } } \end{array}$
|
| 48 |
+
|
| 49 |
+
In addition, we make the following local Kurdyka-Łojasiewicz assumption (KL assumption) which ensures that there are no regions where the loss is very flat. The KL assumption is very general and holds for some $\delta > 0$ for any analytic function defined on a compact domain (see Lemma 17).
|
| 50 |
+
|
| 51 |
+
Assumption 3 (KL). Let $\theta ^ { * }$ be any global minimizer of $L$ . Then there exist $\epsilon _ { K L } > 0 , \mu > 0$ and $0 < \delta \le 1 / 2$ such that if $L ( \theta ) - L ( \theta ^ { * } ) \leq \epsilon _ { K L } ,$ , then $L ( \theta ) - L ( \theta ^ { * } ) \leq \mu \| \nabla L ( \theta ) \| ^ { 1 + \delta }$ .
|
| 52 |
+
|
| 53 |
+
We assume $L ( \theta ^ { * } ) = 0$ for any global minimizer $\theta ^ { * }$ . Note that if $L$ satisfies Assumption 3 for some $\delta$ then it also satisfies Assumption 3 for any $\delta ^ { \prime } < \delta$ . Assumption 3 with $\delta = 1$ is equivalent to the much stronger Polyak-Łojasiewicz condition which is equivalent to local strong convexity.
|
| 54 |
+
|
| 55 |
+
We will use $O , \Theta , \Omega$ to hide any polynomial dependence on $\mu , \ell _ { f } , \rho _ { f } , \kappa _ { f } , \nu , 1 / \sigma , n , d$ and $\tilde { O }$ to hide additional polynomial dependence on $\log { 1 / \eta } , \log { B }$ .
|
| 56 |
+
|
| 57 |
+
# 2.2 The Implicit Regularizer $R ( \theta )$
|
| 58 |
+
|
| 59 |
+
For $L , \sigma ^ { 2 } , B , \eta$ as defined above, we define the implicit regularizer $R ( \theta )$ , the effective regularization parameter $\lambda$ , and the regularized loss $\tilde { L } ( \theta )$ :
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
R ( \theta ) = - \frac { 1 } { 2 \eta } \mathrm { t r } \log \left( 1 - \frac { \eta } { 2 } \nabla ^ { 2 } L ( \theta ) \right) , \qquad \lambda = \frac { \eta \sigma ^ { 2 } } { B } , \qquad \tilde { L } ( \theta ) = L ( \theta ) + \lambda R ( \theta ) .
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
Here log refers to the matrix logarithm. To better understand the regularizer $R ( \theta )$ , let $\lambda _ { 1 } , \ldots , \lambda _ { d }$ be the eigenvalues of $\nabla ^ { 2 } L ( \theta )$ and let $\begin{array} { r } { R ( \lambda _ { i } ) = - \frac { 1 } { 2 \eta } \log ( 1 - \frac { \eta \lambda _ { i } } { 2 } ) } \end{array}$ . Then,
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
R ( \theta ) = \sum _ { i = 1 } ^ { d } R ( \lambda _ { i } ) = \sum _ { i = 1 } ^ { d } \left( \frac { \lambda _ { i } } { 4 } + \frac { \eta \lambda _ { i } ^ { 2 } } { 1 6 } + \frac { \eta ^ { 2 } \lambda _ { i } ^ { 3 } } { 4 8 } + . . . \right) .
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
In the limit as $\eta 0$ , $R ( \theta ) \to { \textstyle { \frac { 1 } { 4 } } } \mathrm { t r } \nabla ^ { 2 } L ( \theta )$ , which matches the regularizer in Blanc et al. [3] for infinitesimal learning rate near a global minimizer. However, in additional to the linear scaling rule, which is implicit in our definition of $\lambda$ , our analysis uncovers an additional regularization effect of large learning rates that penalizes larger eigenvalues more than smaller ones (see Figure 1 and Section 6.1).
|
| 72 |
+
|
| 73 |
+
The goal of this paper is to show that Algorithm 1 converges to a stationary point of the regularized loss $\tilde { L } = L + \lambda R$ . In particular, we will show convergence to an $( \epsilon , \gamma )$ -stationary point, which is defined in the next section.
|
| 74 |
+
|
| 75 |
+

|
| 76 |
+
Figure 1: Regularization strength as a function of $\eta$
|
| 77 |
+
|
| 78 |
+
# 2.3 $( \epsilon , \gamma )$ -Stationary Points
|
| 79 |
+
|
| 80 |
+
We begin with the standard definition of an approximate stationary point:
|
| 81 |
+
|
| 82 |
+
Definition 1 ( $\epsilon$ -stationary point). $\theta$ is an $\epsilon$ -stationary point of $f i f \| \nabla f ( \theta ) \| \leq \epsilon .$
|
| 83 |
+
|
| 84 |
+
In stochastic gradient descent it is often necessary to allow λ = ησ2B to scale with $\epsilon$ to reach an $\epsilon$ -stationary point [8, 15] (e.g., $\lambda$ may need to be less than $\epsilon ^ { 2 }$ ). However, for $\lambda = { \cal O } ( \epsilon )$ , any local minimizer $\theta ^ { * }$ is an $\epsilon \cdot$ -stationary point of $\tilde { L } = L + \lambda R$ . Therefore, reaching a $\epsilon$ -stationary point of $\tilde { L }$ would be equivalent to finding a local minimizer and would not be evidence for implicit regularization. To address this scaling issue, we consider the rescaled regularized loss:
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\frac { 1 } { \lambda } \tilde { L } = \frac { 1 } { \lambda } L + R .
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+

|
| 91 |
+
Figure 2: Local Coupling: We decompose $\theta$ as the sum of a regularized trajectory $\Phi _ { \tau _ { 1 } } ( \theta _ { 0 } ^ { * } )$ , a mean zero oscillating process $\xi _ { \tau _ { 1 } }$ , and an error term $\Delta _ { 1 }$ . Global Convergence: We repeat the coupling with a sequence of reference points $\{ \theta _ { m } ^ { * } \} _ { m }$ to prove convergence to a stationary point of $\textstyle { \frac { 1 } { \lambda } } { \tilde { L } }$ .
|
| 92 |
+
|
| 93 |
+
Reaching an $\epsilon$ -stationary point of $\textstyle { \frac { 1 } { \lambda } } { \tilde { L } }$ requires non-trivially taking the regularizer $R$ into account. However, it is not possible for Algorithm 1 to reach an $\epsilon$ -stationary point of $\textstyle { \frac { 1 } { \lambda } } { \tilde { L } }$ even in the ideal setting when $\theta$ is initialized near a global minimizer $\theta ^ { * }$ of $\tilde { L }$ . The label noise will cause fluctuations of order $\sqrt { \lambda }$ around $\theta ^ { * }$ (see section 3) so $\Vert \nabla L \Vert$ will remain around $\sqrt { \lambda }$ . This causes $\scriptstyle { \frac { 1 } { \lambda } } \nabla L$ to become unbounded for $\lambda$ (and therefore $\epsilon$ ) sufficiently small, and thus Algorithm 1 cannot converge to an $\epsilon$ -stationary point. We therefore prove convergence to an $( \epsilon , \gamma )$ -stationary point:
|
| 94 |
+
|
| 95 |
+
Definition 2 $( ( \epsilon , \gamma )$ -stationary point). $\theta$ is an $( \epsilon , \gamma )$ -stationary point of $f$ if there exists some $\theta ^ { * }$ such that $\| \nabla f ( \theta ^ { * } ) \| \le \epsilon$ and $\lVert \theta - \theta ^ { * } \rVert \leq \gamma$ .
|
| 96 |
+
|
| 97 |
+
Intuitively, Algorithm 1 converges to an $( \epsilon , \gamma )$ -stationary point when it converges to a neighborhood of some $\epsilon$ -stationary point $\theta ^ { * }$ .
|
| 98 |
+
|
| 99 |
+
# 2.4 Main Result
|
| 100 |
+
|
| 101 |
+
Having defined an $( \epsilon , \gamma )$ -stationary point we can now state our main result:
|
| 102 |
+
|
| 103 |
+
Theorem 1. Assume that $f$ satisfies Assumption $I , ~ \eta$ satisfies Assumption 2, and $L$ satisfies Assumption $3$ , i.e. $L ( \theta ) \ \overset { \cdot } { \leq } \ \mu \Vert \dot { \nabla } L ( \theta ) \Vert ^ { 1 + \delta }$ for $L ( \theta ) ~ \le ~ \epsilon _ { K L }$ . Let $\eta , B$ be chosen such that $\begin{array} { r } { \lambda : = \frac { \eta \sigma ^ { 2 } } { B } = \tilde { \Theta } ( \operatorname* { m i n } ( \epsilon ^ { 2 / \delta } , \gamma ^ { 2 } ) ) } \end{array}$ , and let $T = \tilde { \Theta } ( \eta ^ { - 1 } \lambda ^ { - 1 - \delta } ) = \mathrm { p o l y } ( \eta ^ { - 1 } , \gamma ^ { - 1 } )$ . Assume that $\theta$ is initialized within $O ( \sqrt { \lambda ^ { 1 + \delta } } )$ of some $\theta ^ { * }$ satisfying $L ( \theta ^ { * } ) = O ( \lambda ^ { 1 + \delta } )$ . Then for any $\zeta \in ( 0 , 1 )$ , with probability at least $1 - \zeta$ , if $\{ \theta _ { k } \}$ follows Algorithm $^ { l }$ with parameters $\eta , \sigma , T ,$ , there exists $k < T$ such that $\theta _ { k }$ is an $( \epsilon , \gamma )$ -stationary point of $\textstyle { \frac { 1 } { \lambda } } { \tilde { L } }$ .
|
| 104 |
+
|
| 105 |
+
Theorem 1 guarantees that Algorithm 1 will hit an $( \epsilon , \gamma )$ -stationary point of $\textstyle { \frac { 1 } { \lambda } } { \tilde { L } }$ within a polynomial number of steps in $\epsilon ^ { - 1 } , \gamma ^ { - 1 }$ . In particular, when $\begin{array} { r } { \delta = \frac { 1 } { 2 } } \end{array}$ , Theorem 1 guarantees convergence within ${ \tilde { O } } ( \epsilon ^ { - 6 } + \gamma ^ { - 3 } )$ steps. The condition that $\theta _ { 0 }$ is close to an approximate global minimizer $\theta ^ { * }$ is not a strong assumption as recent methods have shown that overparameterized models can easily achieve zero training loss in the kernel regime (see Appendix C). However, in practice these minimizers of the training loss generalize poorly [1]. Theorem 1 shows that Algorithm 1 can then converge to a stationary point of the regularized loss which has better generalization guarantees (see Section 6.2). Theorem 1 also generalizes the local analysis in Blanc et al. [3] to a global result with weaker assumptions on the learning rate $\eta$ . For a full comparison with Blanc et al. [3], see section 3.1.
|
| 106 |
+
|
| 107 |
+
# 3 Proof Sketch
|
| 108 |
+
|
| 109 |
+
The proof of convergence to an $( \epsilon , \varphi )$ -stationary point of $\textstyle { \frac { 1 } { \lambda } } { \tilde { L } }$ has two components. In Section 3.1, we pick a reference point $\theta ^ { * }$ and analyze the behavior of Algorithm 1 in a neighborhood of $\theta ^ { * }$ . In Section 3.2, we repeat this local analysis with a sequence of reference points $\{ \bar { \theta } _ { m } ^ { * } \}$ .
|
| 110 |
+
|
| 111 |
+
# 3.1 Local Coupling
|
| 112 |
+
|
| 113 |
+
Let $\Phi _ { k } ( \cdot )$ denote $k$ steps of gradient descent on the regularized loss $\tilde { L }$ , i.e.
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
\Phi _ { 0 } ( \theta ) = \theta \qquad \mathrm { a n d } \qquad \Phi _ { k + 1 } ( \theta ) = \Phi _ { k } ( \theta ) - \eta \nabla \tilde { L } ( \Phi _ { k } ( \theta ) ) ,
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
where $\tilde { L } ( \theta ) = L ( \theta ) + \lambda R ( \theta )$ is the regularized loss defined in Equation (1). Lemma 1 states that if $\theta$ is initialized at an approximate global minimizer $\theta ^ { * }$ and follows Algorithm 1, there is a small mean zero random process $\xi$ such that $\theta _ { k } \approx \Phi _ { k } ( \theta ^ { * } ) + \xi _ { k }$ :
|
| 120 |
+
|
| 121 |
+
# Lemma 1. Let
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
\iota = c \log \frac { d } { \lambda \zeta } , \quad \mathcal { X } = \sqrt { \frac { 2 \lambda n d \iota } { \nu } } , \quad \mathcal { L } = c \lambda ^ { 1 + \delta } , \quad \mathcal { D } = c \sqrt { \mathcal { L } } \iota , \quad \mathcal { M } = \frac { \mathcal { D } } { \nu } , \quad \mathcal { T } = \frac { 1 } { c ^ { 2 } \eta \mathcal { X } \iota } ,
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
where c is a sufficiently large constant. Assume $f$ satisfies Assumption $I$ and $\eta$ satisfies Assumption 2. Let θ follow Algorithm $^ { l }$ starting at $\theta ^ { * }$ and assume that $L ( \theta ^ { * } ) \leq \mathcal { L }$ for some $0 < \delta \le 1 / 2$ . Then there exists a random process $\{ \xi _ { k } \}$ such that for any $\tau \leq \mathcal { T }$ satisfying $\begin{array} { r } { \operatorname* { m a x } _ { k \leq \tau } \| \Phi _ { k } ( \theta ^ { * } ) - \theta ^ { * } \| \leq 8 \mathcal { M } , } \end{array}$ , with probability at least $1 - 1 0 d \tau e ^ { - \iota }$ we have simultaneously for all $k \leq \tau$ ,
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
\begin{array} { r } { \| \theta _ { k } - \xi _ { k } - \Phi _ { k } ( \theta ^ { * } ) \| \le \mathcal { D } , \qquad \mathbb { E } [ \xi _ { k } ] = 0 , \qquad a n d \qquad \| \xi _ { k } \| \le \mathcal { X } . } \end{array}
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
Note that because $\mathcal { M } \geq \mathcal { D }$ , the error term $\mathcal { D }$ is at least 8 times smaller than the movement in the direction of the regularized trajectory $\Phi _ { \tau } ( \theta ^ { * } )$ , which will allow us to prove convergence to an $( \epsilon , \gamma )$ -stationary point of $\textstyle { \frac { 1 } { \lambda } } { \tilde { L } }$ in Section 3.2.
|
| 134 |
+
|
| 135 |
+
Toward simplifying the update in Algorithm 1, we define $L ^ { ( k ) }$ to be the true loss without label noise on batch $B ^ { ( k ) }$ . The label-noise update $\hat { L } ^ { ( k ) } ( \theta _ { k } )$ is an unbiased perturbation of the mini-batch update: $\begin{array} { r } { \nabla \hat { L } ^ { ( k ) } ( \theta _ { k } ) = \nabla L ^ { ( k ) } ( \theta _ { k } ) - \frac { 1 } { B } \sum _ { i \in \mathcal { B } ^ { ( k ) } } \epsilon _ { i } ^ { ( k ) } \nabla f _ { i } ( \theta _ { k } ) } \end{array}$ (k)i ∇fi(θk). We decompose the update rule into three parts:
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
\theta _ { k + 1 } = \theta _ { k } - \underbrace { \eta \nabla L ( \theta _ { k } ) } _ { \mathrm { g r a d i e n t \ d e s c e n t } } - \underbrace { \eta [ \nabla L ^ { ( k ) } ( \theta _ { k } ) - \nabla L ( \theta _ { k } ) ] } _ { \mathrm { m i n i b a t e h \ n o i s e } } + \underbrace { \eta \sum _ { i } \epsilon _ { i } ^ { ( k ) } \nabla f _ { i } ( \theta _ { k } ) } _ { \substack { \mathrm { i } \in \mathcal { B } ^ { ( k ) } } } .
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
Let $m _ { k } = - \eta [ \nabla L ^ { ( k ) } ( \theta _ { k } ) - \nabla L ( \theta _ { k } ) ]$ denote the minibatch noise. Throughout the proof we will show that the minibatch noise is dominated by the label noise. We will also decompose the label noise into two terms. The first, $\epsilon _ { k } ^ { * }$ , will represent the label noise if the gradient were evaluated at $\theta ^ { * }$ whose distribution does not vary with $k$ . The other term, $z _ { k }$ represents the change in the noise due to evaluating the gradient at $\theta _ { k }$ rather than $\theta ^ { * }$ . More precisely, we have
|
| 142 |
+
|
| 143 |
+
$$
|
| 144 |
+
\epsilon _ { k } ^ { * } = \frac { \eta } { B } \sum _ { i \in \mathcal { B } ^ { ( k ) } } \epsilon _ { i } ^ { ( k ) } \nabla f _ { i } ( \theta ^ { * } ) \qquad \mathrm { a n d } \qquad z _ { k } = \frac { \eta } { B } \sum _ { i \in \mathcal { B } ^ { ( k ) } } \epsilon _ { i } ^ { ( k ) } [ \nabla f _ { i } ( \theta _ { k } ) - \nabla f _ { i } ( \theta ^ { * } ) ] .
|
| 145 |
+
$$
|
| 146 |
+
|
| 147 |
+
We define $\begin{array} { r } { G ( \theta ) = \frac { 1 } { n } \sum _ { i } \nabla f _ { i } ( \theta ) \nabla f _ { i } ( \theta ) ^ { T } } \end{array}$ to be the covariance of the model gradients. Note that $\epsilon _ { k } ^ { * }$ has covariance $\eta \lambda \dot { G } ( \theta ^ { \ast } )$ . To simplify notation in the Taylor expansions, we will use the following shorthand to refer to various quantities evaluated at $\theta ^ { * }$ :
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
G = G ( \theta ^ { * } ) , \qquad \nabla ^ { 2 } L = \nabla ^ { 2 } L ( \theta ^ { * } ) , \qquad \nabla ^ { 3 } L = \nabla ^ { 3 } L ( \theta ^ { * } ) , \qquad \nabla R = \nabla R ( \theta ^ { * } ) .
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
First we need the following standard decompositions of the Hessian:
|
| 154 |
+
|
| 155 |
+
Proposition 1. For any $\theta \in \mathbb { R } ^ { d }$ we can decompose $\nabla ^ { 2 } L ( \theta ) = G ( \theta ) + E ( \theta )$ where $E ( \theta ) =$ $\begin{array} { r } { \frac { 1 } { n } \sum _ { i = 1 } ^ { n } ( f _ { i } ( \theta ) - y _ { i } ) \nabla ^ { 2 } f _ { i } ( \theta ) } \end{array}$ satisfies $\lVert E ( { \boldsymbol { \theta } } ) \rVert \leq \sqrt { 2 \rho _ { f } L ( { \boldsymbol { \theta } } ) }$ where $\rho _ { f }$ is defined in Assumption $^ { l }$ .
|
| 156 |
+
|
| 157 |
+
The matrix $G$ in Proposition 1 is known as the Gauss-Newton term of the Hessian. We can now Taylor expand Algorithm 1 and Equation (2) to first order around $\theta ^ { * }$ :
|
| 158 |
+
|
| 159 |
+
$$
|
| 160 |
+
\begin{array} { c } { { \Phi _ { k + 1 } \bigl ( \theta ^ { * } \bigr ) \approx \Phi _ { k } \bigl ( \theta ^ { * } \bigr ) - \eta \bigl [ \nabla L + \nabla ^ { 2 } L \bigl ( \Phi _ { k } \bigl ( \theta ^ { * } \bigr ) - \theta ^ { * } \bigr ) \bigr ] , } } \\ { { \theta _ { k + 1 } \approx \theta _ { k } - \eta \bigl [ \nabla L + \nabla ^ { 2 } L \bigl ( \theta _ { k } - \theta ^ { * } \bigr ) \bigr ] + \epsilon _ { k } ^ { * } . } } \end{array}
|
| 161 |
+
$$
|
| 162 |
+
|
| 163 |
+
We define $v _ { k } = \theta _ { k } - \Phi _ { k } ( \theta ^ { * } )$ to be the deviation from the regularized trajectory. Then subtracting these two equations gives
|
| 164 |
+
|
| 165 |
+
$$
|
| 166 |
+
v _ { k + 1 } \approx ( I - \eta \nabla ^ { 2 } L ) v _ { k } + \epsilon _ { k } ^ { * } \approx ( I - \eta G ) v _ { k } + \epsilon _ { k } ^ { * } ,
|
| 167 |
+
$$
|
| 168 |
+
|
| 169 |
+
where we used Proposition 1 to replace $\nabla ^ { 2 } L$ with $G$ . Temporarily ignoring the higher order terms, we define the random process $\xi$ by
|
| 170 |
+
|
| 171 |
+
$$
|
| 172 |
+
\xi _ { k + 1 } = ( I - \eta G ) \xi _ { k } + \epsilon _ { k } ^ { * } \qquad \mathrm { a n d } \qquad \xi _ { 0 } = 0 .
|
| 173 |
+
$$
|
| 174 |
+
|
| 175 |
+
The process $\xi$ is referred to as an Ornstein Uhlenbeck process and it encodes the movement of $\theta$ to first order around $\theta ^ { * }$ . We defer the proofs of the following properties of $\xi$ to Appendix B:
|
| 176 |
+
|
| 177 |
+
Proposition 2. For any $k \geq 0$ , with probability at least $1 - 2 d e ^ { - \iota }$ , $\| \xi _ { k } \| \le \mathcal { X }$ . In addition, as $k \to \infty$ , $\mathbb { E } [ \xi _ { k } \xi _ { k } ^ { T } ] \lambda \dot { \Pi _ { G } } ( 2 - \eta G ) ^ { - 1 }$ where $\Pi _ { G }$ is the projection onto the span of $G$ .
|
| 178 |
+
|
| 179 |
+
We can now analyze the effect of $\xi _ { k }$ on the second order Taylor expansion. Let $r _ { k } = \theta _ { k } - \Phi _ { k } ( \theta ^ { * } ) - \xi _ { k }$ be the deviation of $\theta$ from the regularized trajectory after removing the Ornstein Uhlenbeck process $\xi$ . Lemma 1 is equivalent to $\mathrm { P r } [ \| r _ { \tau } \| \geq \mathcal { D } ] \stackrel { . } { \leq } 1 0 \tau \dot { d } e ^ { - \iota }$ .
|
| 180 |
+
|
| 181 |
+
We will prove by induction that $\| r _ { k } \| \le \mathcal { D }$ for all $k \leq t$ with probability at least $1 - 1 0 t d e ^ { - \iota }$ for all $t \leq \tau$ . The base case follows from $r _ { 0 } = 0$ so assume the result for some $t \geq 0$ . The remainder of this section will be conditioned on the event $\| r _ { k } \| \le \mathcal { D }$ for all $k \leq t . { \cal O } ( \cdot )$ notation will only be used to hide absolute constants that do not change with $t$ and will additionally not hide dependence on the absolute constant $c$ . The following proposition fills in the missing second order terms in the Taylor expansion around $\theta ^ { * }$ of $r _ { k }$ :
|
| 182 |
+
|
| 183 |
+
Proposition 3. With probability at least $1 - 2 d e ^ { - \iota }$ ,
|
| 184 |
+
|
| 185 |
+
$$
|
| 186 |
+
r _ { k + 1 } = ( I - \eta G ) r _ { k } - \eta \left[ \frac { 1 } { 2 } \nabla ^ { 3 } L ( \xi _ { k } , \xi _ { k } ) - \lambda \nabla R \right] + m _ { k } + z _ { k } + \tilde { O } \left( c ^ { 5 / 2 } \eta \lambda ^ { 1 + \delta } \right)
|
| 187 |
+
$$
|
| 188 |
+
|
| 189 |
+
The intuition for the implicit regularizer $R ( \theta )$ is that by Propositions 1 and 2,
|
| 190 |
+
|
| 191 |
+
$$
|
| 192 |
+
\begin{array} { r } { \mathbb { E } [ \xi _ { k } \xi _ { k } ^ { T } ] \to \Pi _ { G } \lambda ( 2 - \eta G ) ^ { - 1 } \approx \lambda ( 2 - \eta \nabla ^ { 2 } L ) ^ { - 1 } . } \end{array}
|
| 193 |
+
$$
|
| 194 |
+
|
| 195 |
+
Therefore, when averaged over long timescales,
|
| 196 |
+
|
| 197 |
+
$$
|
| 198 |
+
\operatorname { \mathbb { E } } [ \nabla ^ { 3 } L ( \xi _ { k } , \xi _ { k } ) ] \approx \frac { \lambda } { 2 } \nabla ^ { 3 } L \left[ ( 2 - \eta \nabla ^ { 2 } L ) ^ { - 1 } \right] = \lambda \nabla \left[ - \frac { 1 } { 2 \eta } \operatorname { t r } \log \left( 1 - \frac { \eta } { 2 } \nabla ^ { 2 } L ( \theta ) \right) \right] \bigg | _ { \theta = \theta ^ { * } } = \lambda \nabla R .
|
| 199 |
+
$$
|
| 200 |
+
|
| 201 |
+
The second equality follows from the more general equality that for any matrix function $A$ and any scalar function $h$ that acts independently on each eigenvalue, $\nabla ( \mathrm { t r } h ( A ( \theta ) ) ) = ( \nabla A ( \theta ) ) ( h ^ { \prime } ( A ( \theta ) ) )$ which follows from the chain rule. The above equality is the special case when $A ( \theta ) = \nabla ^ { 2 } L ( \theta )$ and $\begin{array} { r } { h ( x ) = - \frac { 1 } { \eta } \log { \left( 1 - \frac { \eta } { 2 } x \right) } } \end{array}$ , which satisfies $\begin{array} { r } { h ^ { \prime } ( x ) = \frac { 1 } { 2 - \eta x } } \end{array}$ .
|
| 202 |
+
|
| 203 |
+
The remaining details involve concentrating the mean zero error terms $m _ { k } , z _ { k }$ and showing that $\mathbb { E } [ \xi _ { k } \xi _ { k } ^ { T } ]$ does concentrate in the directions with large eigenvalues and that the directions with small eigenvalues, in which the covariance does not concentrate, do not contribute much to the error. This yields the following bound:
|
| 204 |
+
|
| 205 |
+
Proposition 4. With probability at least $1 - 1 0 d e ^ { - \iota }$ , $\begin{array} { r } { \| r _ { t + 1 } \| = \tilde { O } \Big ( \frac { \lambda ^ { 1 / 2 + \delta / 2 } } { \sqrt { c } } \Big ) . } \end{array}$
|
| 206 |
+
|
| 207 |
+
The proof of Proposition 4 can be found in Appendix B. Finally, because $\mathcal { D } = \tilde { O } ( c ^ { 5 / 2 } \lambda ^ { 1 / 2 + \delta / 2 } )$ , $\| r _ { t + 1 } \| \leq \mathcal { D }$ for sufficiently large $c$ . This completes the induction and the proof of Lemma 1.
|
| 208 |
+
|
| 209 |
+
Comparison with Blanc et al. [3] Like Blanc et al. [3], Lemma 1 shows that $\theta$ locally follows the trajectory of gradient descent on an implicit regularizer $R ( \theta )$ . However, there are a few crucial differences:
|
| 210 |
+
|
| 211 |
+
• Because we do not assume we start near a global minimizer where $L \ = \ 0$ , we couple to a regularized loss $\tilde { L } = L + \lambda R$ rather than just the regularizer $R ( \theta )$ . In this setting there is an additional correction term to the Hessian (Proposition 1) that requires carefully controlling the value of the loss across reference points to prove convergence to a stationary point. • The analysis in Blanc et al. [3] requires $\eta , \tau$ to be chosen in terms of the condition number of $\nabla ^ { 2 } L$ which can quickly grow during training as $\nabla ^ { 2 } L$ is changing. This makes it impossible to directly repeat the argument. We avoid this by precisely analyzing the error incurred by small eigenvalues, allowing us to prove convergence to an $( \epsilon , \gamma )$ stationary point of $\textstyle { \frac { 1 } { \lambda } } { \tilde { L } }$ for fixed $\eta , \lambda$ even if the smallest nonzero eigenvalue of $\nabla ^ { 2 } L$ converges to 0 during training. Unlike in Blanc et al. [3], we do not require the learning rate $\eta$ to be small. Instead, we only require that $\lambda$ scales with $\epsilon$ which can be accomplished either by decreasing the learning rate $\eta$ or increasing the batch size $B$ . This allows for stronger implicit regularization in the setting when $\eta$ is large (see Section 6.1). In particular, our regularizer $R ( \theta )$ changes with $\eta$ and is only equal to the regularizer in Blanc et al. [3] in the limit $\eta 0$ .
|
| 212 |
+
|
| 213 |
+
# 3.2 Global Convergence
|
| 214 |
+
|
| 215 |
+
In order to prove convergence to an $( \epsilon , \gamma )$ -stationary point of $\begin{array} { r l } { { \frac { 1 } { \eta } \nabla \tilde { L } } } & { { } } \end{array}$ , we will define a sequence of reference points $\theta _ { m } ^ { * }$ and coupling times $\{ \tau _ { m } \}$ and repeatedly use a version of Lemma 1 to describe the long term behavior of $\theta$ . For notational simplicity, given a sequence of coupling times $\{ \tau _ { m } \}$ , define $\begin{array} { r } { \bar { T } _ { m } = \sum _ { k < m } \tau _ { k } } \end{array}$ to be the total number of steps until we have reached the reference point $\theta _ { m } ^ { * }$
|
| 216 |
+
|
| 217 |
+
To be able to repeat the local analysis in Lemma 1 with multiple reference points, we need a more general coupling lemma that allows the random process $\xi$ defined in each coupling to continue where the random process in the previous coupling ended. To accomplish this, we define $\xi$ outside the scope of the local coupling lemma:
|
| 218 |
+
|
| 219 |
+
Definition 3. Given a sequence of reference points $\{ \theta _ { m } ^ { * } \}$ and a sequence of coupling times $\{ \tau _ { m } \}$ , we define the random process $\xi$ by $\xi _ { 0 } = 0$ , and for $k \in [ T _ { m } , T _ { m + 1 } )$ ,
|
| 220 |
+
|
| 221 |
+
$$
|
| 222 |
+
\epsilon _ { k } ^ { * } = \frac { \eta } { B } \sum _ { i \in \mathcal { B } ^ { ( k ) } } \epsilon _ { i } ^ { ( k ) } \nabla f _ { i } ( \theta _ { m } ^ { * } ) \qquad a n d \qquad \xi _ { k + 1 } = ( I - \eta G ( \theta _ { m } ^ { * } ) ) \xi _ { k } + \epsilon _ { k } ^ { * } .
|
| 223 |
+
$$
|
| 224 |
+
|
| 225 |
+
Then we can prove the following more general coupling lemma:
|
| 226 |
+
|
| 227 |
+
Lemma 2. Let $\mathcal { X } , \mathcal { L } , \mathcal { D } , \mathcal { M } , \mathcal { T }$ be defined as in Lemma $^ { l }$ . Assume $f$ satisfies Assumption $^ { l }$ and $\eta$ satisfies Assumption 2. Let $\Delta _ { m } = \theta _ { T _ { m } } - \xi _ { T _ { m } } - \theta _ { m } ^ { * }$ and assume that $\| \Delta _ { m } \| \leq \mathcal { D }$ and $L ( \theta _ { m } ^ { * } ) \leq \mathcal { L }$ for some $0 < \delta \le 1 / 2$ . Then for any $\tau _ { m } \leq \mathcal { T }$ satisfying $\begin{array} { r l } { \operatorname* { m a x } _ { k \in [ T _ { m } , T _ { m + 1 } ) } \left. \Phi _ { k - T _ { m } } ( \theta _ { m } ^ { * } + \Delta _ { m } ) - \theta _ { m } ^ { * } \right. \le } & { { } \quad } \end{array}$ $8 \mathcal { M }$ , with probability at least $1 - 1 0 d \tau _ { m } e ^ { - \iota }$ we have simultaneously for all $k \in ( T _ { m } , T _ { m + 1 } ]$ ,
|
| 228 |
+
|
| 229 |
+
$$
|
| 230 |
+
\begin{array} { r } { \| \theta _ { k } - \xi _ { k } - \Phi _ { k - T _ { m } } ( \theta _ { m } ^ { * } + \Delta _ { m } ) \| \le \mathcal { D } , \quad \quad \mathbb { E } [ \xi _ { k } ] = 0 , \quad \quad a n d \quad \quad \| \xi _ { k } \| \le \mathcal { X } . } \end{array}
|
| 231 |
+
$$
|
| 232 |
+
|
| 233 |
+
Unlike in Lemma 1, we couple to the regularized trajectory starting at $\theta _ { m } ^ { * } + \Delta _ { m }$ rather than at $\theta _ { m } ^ { * }$ to avoid accumulating errors (see Figure 2). The proof is otherwise identical to that of Lemma 1.
|
| 234 |
+
|
| 235 |
+
The proof of Theorem 1 easily follows from the following lemma which states that we decrease the regularized loss $\tilde { L }$ by at least $\mathcal { F }$ after every coupling:
|
| 236 |
+
|
| 237 |
+
Lemma 3. Let $\begin{array} { r } { \mathcal { F } = \frac { { \mathcal { D } } ^ { 2 } } { \eta \nu \mathcal { T } } } \end{array}$ . Let $\Delta _ { m } = \theta _ { T _ { m } } - \xi _ { T _ { m } } - \theta _ { m } ^ { * }$ and assume $\| \Delta _ { m } \| \leq \mathcal { D }$ and $L ( \theta _ { m } ^ { * } ) \leq \mathcal { L }$ Then if $\theta _ { T _ { m } }$ is not an $( \epsilon , \gamma )$ -stationary point, there exists some $\tau _ { m } < \mathcal { T }$ such that if we define
|
| 238 |
+
|
| 239 |
+
$$
|
| 240 |
+
\begin{array} { r } { \theta _ { m + 1 } ^ { * } = \Phi _ { \tau _ { n } } \bigl ( \theta _ { m } ^ { * } + \Delta _ { m } \bigr ) \qquad a n d \qquad \Delta _ { m + 1 } = \theta _ { T _ { m + 1 } } - \xi _ { T _ { m + 1 } } - \theta _ { m + 1 } ^ { * } , } \end{array}
|
| 241 |
+
$$
|
| 242 |
+
|
| 243 |
+
then with probability $1 - 1 0 d \tau _ { m } e ^ { - \iota }$
|
| 244 |
+
|
| 245 |
+
$$
|
| 246 |
+
\begin{array} { r } { \tilde { L } ( \theta _ { m + 1 } ^ { * } ) \leq L ( \theta _ { m } ^ { * } ) - \mathcal { F } , \qquad \| \Delta _ { m + 1 } \| \leq \mathcal { D } \qquad a n d \qquad L ( \theta _ { m + 1 } ^ { * } ) \leq \mathcal { L } . } \end{array}
|
| 247 |
+
$$
|
| 248 |
+
|
| 249 |
+
We defer the proofs of Lemma 2 and Lemma 3 to Appendix B. Theorem 1 now follows directly from repeated applications of Lemma 3:
|
| 250 |
+
|
| 251 |
+
Proof of Theorem $^ { l }$ . By assumption there exists some $\theta _ { 0 } ^ { * }$ such that $L ( \theta _ { 0 } ^ { * } ) \leq \mathcal { L }$ and $\lVert { \boldsymbol { \theta } } _ { 0 } - { \boldsymbol { \theta } } _ { 0 } ^ { * } \rVert \leq \mathcal { D }$ . Then so long as $\theta _ { T _ { m } }$ is not an $( \epsilon , \gamma )$ -stationary point, we can inductively apply Lemma 3 to get the existence of coupling times $\{ \tau _ { m } \}$ and reference points $\{ \theta _ { m } ^ { * } \}$ such that for any $m \geq 0$ , with probability $1 - 1 0 d T _ { m } e ^ { - \iota }$ we have $\tilde { L } ( \theta _ { m } ^ { * } ) \leq \tilde { L } ( \theta _ { 0 } ^ { * } ) - m \mathcal { \bar { F } }$ . As $\tilde { L } ( \theta _ { 0 } ^ { * } ) - \tilde { L } ( \theta _ { m } ^ { * } ) = O ( \lambda )$ , this can happen for at most $\begin{array} { r } { m = O \left( \frac { \lambda } { \mathcal { F } } \right) } \end{array}$ reference points, so at most $\begin{array} { r } { T = O \left( \frac { \lambda \mathcal { T } } { \mathcal { F } } \right) = \tilde { O } \left( \eta ^ { - 1 } \lambda ^ { - 1 - \delta } \right) } \end{array}$ iterations of Algorithm 1. By the choice of $\iota$ , this happens with probability $1 - 1 0 d T e ^ { - \iota } \geq 1 - \zeta$ .
|
| 252 |
+
|
| 253 |
+
# 4 Experiments
|
| 254 |
+
|
| 255 |
+
In order to test the ability of SGD with label noise to escape poor global minimizers and converge to better minimizers, we initialize Algorithm 1 at global minimizers of the training loss which achieve $1 0 0 \%$ training accuracy yet generalize poorly to the test set. Minibatch SGD would remain fixed at these initializations because both the gradient and the noise in minibatch SGD vanish at any global minimizer of the training loss. We show that SGD with label noise escapes these poor initializations and converges to flatter minimizers that generalize well, which supports Theorem 1. We run experiments with two initializations:
|
| 256 |
+
|
| 257 |
+

|
| 258 |
+
Figure 3: Label Noise SGD escapes poor global minimizers. The left column displays the training accuracy over time, the middle column displays the value of $\operatorname { t r } \nabla ^ { 2 } L ( \theta )$ over time which we use to approximate the implicit regularizer $R ( \theta )$ , and the right column displays their correlation. The horizontal dashed line represents the minibatch SGD baseline with random initialization. We report the median results over 3 random seeds and shaded error bars denote the $\operatorname* { m i n } / \operatorname* { m a x }$ over the three runs. The correlation plot uses a running average of 100 epochs for visual clarity.
|
| 259 |
+
|
| 260 |
+
Full Batch Initialization: We run full batch gradient descent with random initialization until convergence to a global minimizer. We call this minimizer the full batch initialization. The final test accuracy of the full batch initialization was $76 \%$ .
|
| 261 |
+
|
| 262 |
+
Adversarial Initialization: Following Liu et al. [21], we generate an adversarial initialization with final test accuracy $4 8 \%$ that achieves zero training loss by first teaching the network to memorize random labels and then training it on the true labels. See Appendix D for full details.
|
| 263 |
+
|
| 264 |
+
Experiments were run with ResNet18 on CIFAR10 [17] without data augmentation or weight decay. The experiments were conducted with randomized label flipping with probability 0.2 (see Appendix E for the extension of Theorem 1 to classification with label flipping), cross entropy loss, and batch size 256. Because of the difficulty in computing the regularizer $R ( \theta )$ , we approximate it by its lower bound $\operatorname { t r } \nabla ^ { 2 } L ( \theta )$ . Figure 3 shows the test accuracy and $\mathrm { t r } \nabla ^ { 2 } L$ throughout training.
|
| 265 |
+
|
| 266 |
+
SGD with label noise escapes both zero training loss initializations and converges to flatter minimizers that generalize much better, reaching the SGD baseline from the fullbatch initialization and getting within $1 \%$ of the baseline from the adversarial initialization. The test accuracy in both cases is strongly correlated with $\mathrm { t r } \nabla ^ { 2 } L$ . The strength of the regularization is also strongly correlated with $\eta$ which supports Theorem 1.
|
| 267 |
+
|
| 268 |
+
# 5 Extensions
|
| 269 |
+
|
| 270 |
+
# 5.1 SGD with momentum
|
| 271 |
+
|
| 272 |
+
We replace the update in Algorithm 1 with heavy ball momentum with parameter $\beta$ :
|
| 273 |
+
|
| 274 |
+
$$
|
| 275 |
+
\theta _ { k + 1 } = \theta _ { k } - \eta \nabla \hat { L } ^ { ( k ) } ( \theta _ { k } ) + \beta ( \theta _ { k } - \theta _ { k - 1 } ) .
|
| 276 |
+
$$
|
| 277 |
+
|
| 278 |
+
We define:
|
| 279 |
+
|
| 280 |
+
$$
|
| 281 |
+
R ( \theta ) = \frac { 1 + \beta } { 2 \eta } \mathrm { t r } \log \left( 1 - \frac { \eta } { 2 ( 1 + \beta ) } \nabla ^ { 2 } L ( \theta ) \right) , \qquad \lambda = \frac { \eta \sigma ^ { 2 } } { B ( 1 - \beta ) } ,
|
| 282 |
+
$$
|
| 283 |
+
|
| 284 |
+
and as before $\tilde { L } ( \theta ) = L ( \theta ) + \lambda R ( \theta )$ . Let
|
| 285 |
+
|
| 286 |
+
$$
|
| 287 |
+
\Phi _ { 0 } ( \theta ) = \theta , \qquad \Phi _ { k + 1 } ( \theta ) = \Phi _ { k } ( \theta ) - \eta \nabla \tilde { L } ( \Phi _ { k } ( \theta ) ) + \beta ( \Phi _ { k } ( \theta ) - \Phi _ { k - 1 } ( \theta ) )
|
| 288 |
+
$$
|
| 289 |
+
|
| 290 |
+
represent gradient descent with momentum on $\tilde { L }$ . Then we have the following local coupling lemma:
|
| 291 |
+
|
| 292 |
+
Lemma 4. Let
|
| 293 |
+
|
| 294 |
+
$$
|
| 295 |
+
\mathcal { X } = \sqrt { \frac { 2 \lambda n ^ { 2 } \iota } { \nu } } , \qquad \mathcal { L } = c \lambda ^ { 1 + \delta } , \qquad \mathcal { D } = c \sqrt { \mathcal { L } } \iota , \qquad \mathcal { T } = \frac { 1 } { c ^ { 2 } \eta \mathcal { X } \iota } ,
|
| 296 |
+
$$
|
| 297 |
+
|
| 298 |
+
where c is a sufficfollow Algorithm ntly large consta with momentum . Assume starting $f$ tisfieand $^ { l }$ and r so $\begin{array} { r } { \eta \le \frac { ( 2 - \nu ) ( 1 + \beta ) } { \ell } } \end{array}$ . Let . The $\theta$ $^ { l }$ $\beta$ $\theta ^ { * }$ $L ( \theta ^ { * } ) \leq \mathcal { L }$ $0 < \delta \le 1 / 2$ there exists a random process $\{ \xi _ { k } \}$ such that for any $\tau \leq \mathcal { T }$ satisfying $\begin{array} { r } { \operatorname* { m a x } _ { k \leq \tau } \| \Phi _ { k } ( \theta ^ { * } ) - \theta ^ { * } \| \leq 8 \mathcal { D } } \end{array}$ with probability at least $1 - 1 0 d \tau e ^ { - \iota }$ we have simultaneously for all $k \leq \tau$ ,
|
| 299 |
+
|
| 300 |
+
$$
|
| 301 |
+
\begin{array} { r } { \| \theta _ { k } - \xi _ { k } - \Phi _ { k } ( \theta ^ { * } ) \| \le \mathcal { D } , \qquad \mathbb { E } [ \xi _ { k } ] = 0 , \qquad a n d \qquad \| \xi _ { k } \| \le \mathcal { X } . } \end{array}
|
| 302 |
+
$$
|
| 303 |
+
|
| 304 |
+
As in Lemma 1, the error is 8 times smaller than the maximum movement of the regularized trajectory. Note that momentum increases the regularization parameter $\lambda$ by $\frac { 1 } { 1 - \beta }$ . For the commonly used momentum parameter $\beta = 0 . 9$ , this represents a $1 0 \times$ increase in regularization, which is likely the cause of the improved performance in Figure 4 $\beta = 0 . 9$ ) over Figure 3 $\beta = 0$ ).
|
| 305 |
+
|
| 306 |
+
# 5.2 Arbitrary Noise Covariances
|
| 307 |
+
|
| 308 |
+
The analysis in Section 3.1 is not specific to label noise SGD and can be carried out for arbitrary noise schemes. Let $\theta$ follow $\theta _ { k + 1 } \overset { \cdot } { = } \theta _ { k } - \eta \nabla L ( \theta _ { k } ) + \epsilon _ { k }$ starting at $\theta _ { 0 }$ where $\epsilon _ { k } \sim { \cal N } ( 0 , \eta \lambda \Sigma ( \theta _ { k } ) )$ and $\Sigma ^ { 1 / 2 }$ is Lipschitz. Given a matrix $S$ we define the regularizer $R _ { S } ( \theta ) = \left. S , \nabla ^ { 2 } L ( \theta ) \right.$ . The matrix $S$ controls the weight of each eigenvalue. As before we can define $\tilde { L } _ { S } ( \theta ) = L ( \theta ) + \lambda R _ { S } ( \theta )$ and $\Phi _ { k + 1 } ^ { S } ( \theta ) = \Phi _ { k } ^ { S } ( \theta ) - \eta \nabla \tilde { L } _ { S } ( \Phi _ { k } ( \theta ) )$ to be the regularized loss and the regularized trajectory respectively. Then we have the following version of Lemma 1:
|
| 309 |
+
|
| 310 |
+
Proposition 5. Let $\theta$ be initialized at a minimizer $\theta ^ { * }$ of $L$ . Assume $\nabla ^ { 2 } L$ is Lipschitz, let $H = \nabla ^ { 2 } L ( \theta ^ { * } )$ and assume that $\Sigma ( \theta ^ { * } ) \preceq C H$ for some absolute constant $C$ . Let $\begin{array} { r } { \mathcal { X } = \sqrt { \frac { C d \lambda \iota } { \nu } } } \end{array}$ , $\mathcal { D } = c \lambda ^ { 3 / 4 } \iota ,$ , and $\begin{array} { r } { \mathcal { T } = \frac { 1 } { c ^ { 2 } \eta \mathcal { X } \iota } } \end{array}$ for a sufficiently large constant c. Then there exists a mean zero random process $\xi$ such that for any $\tau \leq \mathcal { T }$ satisfying $\begin{array} { r } { \operatorname* { m a x } _ { k < \tau } \| \Phi _ { k } ( \theta ^ { * } ) - \theta ^ { * } \| \leq 8 \mathcal { D } } \end{array}$ and with probability $1 - 1 0 d \tau e ^ { - \iota }$ , we have simultaneously for all $k \leq \tau$ :
|
| 311 |
+
|
| 312 |
+
$$
|
| 313 |
+
\begin{array} { r } { \| \theta _ { k } - \xi _ { k } - \Phi _ { k } ^ { S } ( \theta _ { 0 } ) \| \le \mathcal { D } \qquad a n d \qquad \| \xi _ { k } \| \le \mathcal { X } , } \end{array}
|
| 314 |
+
$$
|
| 315 |
+
|
| 316 |
+
where $S$ is the unique fixed point of $S \gets ( I - \eta H ) S ( I - \eta H ) + \eta \lambda \Sigma ( \theta ^ { * } )$ restricted to span $( H )$
|
| 317 |
+
|
| 318 |
+
As in Lemma 1, the error is 8 times smaller than the maximum movement of the regularized trajectory. Although Proposition 5 couples to gradient descent on $R _ { S }$ , $S$ is defined in terms of the Hessian and the noise covariance at $\theta ^ { * }$ and therefore depends on the choice of reference point. Because $R _ { S }$ is changing, we cannot repeat Proposition 5 as in Section 3.2 to prove convergence to a stationary point because there is no fixed potential. Although it is sometimes possible to relate $R _ { S }$ to a fixed potential $R$ , we show in Appendix F.2 that this is not generally possible by providing an example where minibatch SGD perpetually cycles. Exploring the properties of these continuously changing potentials and their connections to generalization is an interesting avenue for future work.
|
| 319 |
+
|
| 320 |
+
# 6 Discussion
|
| 321 |
+
|
| 322 |
+
# 6.1 Sharpness and the Effect of Large Learning Rates
|
| 323 |
+
|
| 324 |
+
Various factors can control the strength of the implicit regularization in Theorem 1. Most important is the implicit regularization parameter $\begin{array} { r } { \lambda = \frac { \eta \sigma ^ { 2 } } { | B | } } \end{array}$ . This supports the hypothesis that large learning rates and small batch sizes are necessary for implicit regularization [9, 26], and agrees with the standard linear scaling rule which proposes that for constant regularization strength, the learning rate $\eta$ needs to be inversely proportional to the batch size $| B |$ .
|
| 325 |
+
|
| 326 |
+
However, our analysis also uncovers an additional regularization effect of large learning rates. Unlike the regularizer in Blanc et al. [3], the implicit regularizer $R ( \theta )$ defined in Equation (1) is dependent on $\eta$ . It is not possible to directly analyze the behavior of $R ( \theta )$ as $\eta 2 / \lambda _ { 1 }$ where $\lambda _ { 1 }$ is the largest eigenvalue of $\nabla ^ { 2 } L$ , as in this regime, $R ( \theta ) \to \infty$ (see Figure 1). If we let $\begin{array} { r } { \eta = \frac { 2 - \nu } { \lambda _ { 1 } } } \end{array}$ 2−ν , then we can better understand the behavior of $R ( \theta )$ by normalizing it by $\log 2 / \nu$ . This gives2
|
| 327 |
+
|
| 328 |
+
$$
|
| 329 |
+
\frac { R ( \theta ) } { \log 2 / \nu } = \sum _ { i } \frac { R ( \lambda _ { i } ) } { \log 2 / \nu } = \| \nabla ^ { 2 } L ( \theta ) \| _ { 2 } + O \left( \frac { 1 } { \log 2 / \nu } \right) \xrightarrow { \nu \to 0 } \| \nabla ^ { 2 } L ( \theta ) \| _ { 2 }
|
| 330 |
+
$$
|
| 331 |
+
|
| 332 |
+
so after normalization, $R ( \theta )$ becomes a better and better approximation of the spectral norm $\| \nabla ^ { 2 } L ( \theta ) \|$ as $\eta 2 / \lambda _ { 1 }$ . $R ( \theta )$ can therefore be seen as interpolating between $\mathrm { t r } \hat { \nabla } ^ { 2 } L ( \theta )$ , when $\eta \approx 0$ , and $\| \nabla ^ { 2 } L ( \theta ) \| _ { 2 }$ when $\eta \approx 2 / \lambda _ { 1 }$ . This also suggests that SGD with large learning rates may be more resilient to the edge of stability phenomenon observed in Cohen et al. [4] as the implicit regularization works harder to control eigenvalues approaching $2 / \eta$ .
|
| 333 |
+
|
| 334 |
+
The sharpness-aware algorithm (SAM) of [7] is also closely related to $R ( \theta )$ . SAM proposes to minimize $\begin{array} { r } { \operatorname* { m a x } _ { \parallel \delta \parallel _ { 2 } } \le _ { \epsilon } L ( \theta + \delta ) } \end{array}$ . At a global minimizer of the training loss,
|
| 335 |
+
|
| 336 |
+
$$
|
| 337 |
+
\operatorname* { m a x } _ { \| \delta \| _ { 2 } \leq \epsilon } L ( \theta ^ { * } + \delta ) = \operatorname* { m a x } _ { \| \delta \| _ { 2 } \leq \epsilon } \frac { 1 } { 2 } \delta ^ { \top } \nabla ^ { 2 } L ( \theta ^ { * } ) \delta + O ( \epsilon ^ { 3 } ) \approx \frac { \epsilon ^ { 2 } } { 2 } \| \nabla ^ { 2 } L ( \theta ^ { * } ) \| _ { 2 } .
|
| 338 |
+
$$
|
| 339 |
+
|
| 340 |
+
The SAM algorithm is therefore explicitly regularizing the spectral norm of $\nabla ^ { 2 } L ( \theta )$ , which is closely connected to the large learning rate regularization effect of $R ( \theta )$ when $\eta \approx 2 / \lambda _ { 1 }$ .
|
| 341 |
+
|
| 342 |
+
# 6.2 Generalization Bounds
|
| 343 |
+
|
| 344 |
+
The implicit regularizer $R ( \theta )$ is intimately connected to data-dependent generalization bounds, which measure the Lipschitzness of the network via the network Jacobiapropose the all-layer margin, which bounds the generalization error $\begin{array} { r } { \lesssim \frac { \sum _ { l = 1 } ^ { L } \mathcal { C } _ { l } } { \sqrt { n } } \sqrt { \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \frac { 1 } { m _ { F } ( x _ { i } , y _ { i } ) ^ { 2 } } } } \end{array}$ is the all-layer margin. The norm of the parameters is generally controlled by weight decay regularization, so we focus our discussion on the all-layer margin. Ignoring higher-order secondary terms, Wei and Ma [30, Heuristic derivation of Lemma 3.1] showed for a feed-forward network $\begin{array} { r } { \dot { f } ( \theta ; x ) = \theta _ { L } \sigma ( \theta _ { L - 1 } \dots \sigma ( \theta _ { 1 } x ) ) } \end{array}$ , the all-layer margin satisfies3:
|
| 345 |
+
|
| 346 |
+
$$
|
| 347 |
+
\frac { 1 } { m _ { F } ( x , y ) } \lesssim \frac { \| \{ \frac { \partial f } { \partial \theta _ { l } } \} _ { l \in [ L ] } \| _ { 2 } } { \mathrm { o u t p u t ~ m a r g i n ~ o f ~ } ( x , y ) } \implies \mathrm { g e n e r a l i z a t i o n ~ e r r o r } \lesssim \frac { \sum _ { l = 1 } ^ { L } \mathcal { C } _ { l } } { \sqrt { n } } \sqrt { \frac { R ( \theta ) } { \mathrm { o u t p u t ~ m a r g i n } } }
|
| 348 |
+
$$
|
| 349 |
+
|
| 350 |
+
as $R ( \theta )$ is an upper bound on the squared norm of the Jacobian at any global minimizer $\theta$ . We emphasize this bound is informal as we discarded the higher-order terms in controlling the all-layer margin, but it accurately reflects that the regularizer $R ( \bar { \theta ) }$ lower bounds the all-layer margin $m _ { F }$ up to higher-order terms. Therefore SGD with label noise implicitly regularizes the all-layer margin.
|
| 351 |
+
|
| 352 |
+
# Acknowledgments and Disclosure of Funding
|
| 353 |
+
|
| 354 |
+
AD acknowledges support from a NSF Graduate Research Fellowship. TM acknowledges support of Google Faculty Award and NSF IIS 2045685. JDL acknowledges support of the ARO under MURI Award W911NF-11-1-0303, the Sloan Research Fellowship, NSF CCF 2002272, and an ONR Young Investigator Award.
|
| 355 |
+
|
| 356 |
+
The experiments in this paper were performed on computational resources managed and supported by Princeton Research Computing, a consortium of groups including the Princeton Institute for Computational Science and Engineering (PICSciE) and the Office of Information Technology’s High Performance Computing Center and Visualization Laboratory at Princeton University.
|
| 357 |
+
|
| 358 |
+
We would also like to thank Honglin Yuan and Jeff Z. HaoChen for useful discussions throughout various stages of the project.
|
| 359 |
+
|
| 360 |
+
References
|
| 361 |
+
[1] S. Arora, S. S. Du, W. Hu, Z. Li, R. Salakhutdinov, and R. Wang. On exact computation with an infinitely wide neural net. arXiv preprint arXiv:1904.11955, 2019.
|
| 362 |
+
[2] L. Biewald. Experiment tracking with weights and biases, 2020. URL https://www.wandb. com/. Software available from wandb.com.
|
| 363 |
+
[3] G. Blanc, N. Gupta, G. Valiant, and P. Valiant. Implicit regularization for deep neural networks driven by an ornstein-uhlenbeck like process. arXiv preprint arXiv:1904.09080, 2019.
|
| 364 |
+
[4] J. M. Cohen, S. Kaur, Y. Li, J. Z. Kolter, and A. Talwalkar. Gradient descent on neural networks typically occurs at the edge of stability, 2021.
|
| 365 |
+
[5] S. S. Du, J. D. Lee, H. Li, L. Wang, and X. Zhai. Gradient descent finds global minima of deep neural networks, 2019.
|
| 366 |
+
[6] W. Falcon et al. Pytorch lightning. GitHub. Note: https://github.com/PyTorchLightning/pytorchlightning, 3, 2019.
|
| 367 |
+
[7] P. Foret, A. Kleiner, H. Mobahi, and B. Neyshabur. Sharpness-aware minimization for efficiently improving generalization. arXiv preprint arXiv:2010.01412, 2020.
|
| 368 |
+
[8] R. Ge, F. Huang, C. Jin, and Y. Yuan. Escaping from saddle points—online stochastic gradient for tensor decomposition. In Conference on Learning Theory, pages 797–842, 2015.
|
| 369 |
+
[9] P. Goyal, P. Dollár, R. Girshick, P. Noordhuis, L. Wesolowski, A. Kyrola, A. Tulloch, Y. Jia, and K. He. Accurate, large minibatch sgd: Training imagenet in 1 hour. arXiv preprint arXiv:1706.02677, 2017.
|
| 370 |
+
[10] S. Gunasekar, B. E. Woodworth, S. Bhojanapalli, B. Neyshabur, and N. Srebro. Implicit regularization in matrix factorization. In Advances in Neural Information Processing Systems, pages 6151–6159, 2017.
|
| 371 |
+
[11] S. Gunasekar, J. Lee, D. Soudry, and N. Srebro. Characterizing implicit bias in terms of optimization geometry. arXiv preprint arXiv:1802.08246, 2018.
|
| 372 |
+
[12] J. Z. HaoChen, C. Wei, J. D. Lee, and T. Ma. Shape matters: Understanding the implicit bias of the noise covariance. arXiv preprint arXiv:2006.08680, 2020.
|
| 373 |
+
[13] D. Hendrycks and K. Gimpel. Gaussian error linear units (gelus), 2020.
|
| 374 |
+
[14] A. Jacot, F. Gabriel, and C. Hongler. Neural tangent kernel: Convergence and generalization in neural networks. In Advances in neural information processing systems, pages 8571–8580, 2018.
|
| 375 |
+
[15] C. Jin, P. Netrapalli, R. Ge, S. M. Kakade, and M. I. Jordan. Stochastic gradient descent escapes saddle points efficiently. arXiv preprint arXiv:1902.04811, 2019.
|
| 376 |
+
[16] N. S. Keskar, D. Mudigere, J. Nocedal, M. Smelyanskiy, and P. T. P. Tang. On large-batch training for deep learning: Generalization gap and sharp minima. arXiv preprint arXiv:1609.04836, 2016.
|
| 377 |
+
[17] A. Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009.
|
| 378 |
+
[18] Y. A. LeCun, L. Bottou, G. B. Orr, and K.-R. Müller. Efficient backprop. In Neural networks: Tricks of the trade, pages 9–48. Springer, 2012.
|
| 379 |
+
[19] Y. Li, T. Ma, and H. Zhang. Algorithmic regularization in over-parameterized matrix sensing and neural networks with quadratic activations. arXiv preprint arXiv:1712.09203, 2017.
|
| 380 |
+
[20] Y. Li, C. Wei, and T. Ma. Towards explaining the regularization effect of initial large learning rate in training neural networks. In Advances in Neural Information Processing Systems, pages 11669–11680, 2019.
|
| 381 |
+
[21] S. Liu, D. Papailiopoulos, and D. Achlioptas. Bad global minima exist and sgd can reach them. arXiv preprint arXiv:1906.02613, 2019.
|
| 382 |
+
[22] P. Mianjy, R. Arora, and R. Vidal. On the implicit bias of dropout. arXiv preprint arXiv:1806.09777, 2018.
|
| 383 |
+
[23] E. Moroshko, S. Gunasekar, B. Woodworth, J. D. Lee, N. Srebro, and D. Soudry. Implicit bias in deep linear classification: Initialization scale vs training accuracy. Neural Information Processing Systems (NeurIPS), 2020.
|
| 384 |
+
[24] A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga, A. Desmaison, A. Kopf, E. Yang, Z. DeVito, M. Raison, A. Tejani, S. Chilamkurthy, B. Steiner, L. Fang, J. Bai, and S. Chintala. Pytorch: An imperative style, highperformance deep learning library. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché- Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems 32, pages 8024–8035. Curran Associates, Inc., 2019. URL http://papers.neurips.cc/paper/ 9015-pytorch-an-imperative-style-high-performance-deep-learning-library. pdf.
|
| 385 |
+
[25] C. J. Shallue, J. Lee, J. Antognini, J. Sohl-Dickstein, R. Frostig, and G. E. Dahl. Measuring the effects of data parallelism on neural network training. arXiv preprint arXiv:1811.03600, 2018.
|
| 386 |
+
[26] S. L. Smith, P.-J. Kindermans, C. Ying, and Q. V. Le. Don’t decay the learning rate, increase the batch size. arXiv preprint arXiv:1711.00489, 2017.
|
| 387 |
+
[27] D. Soudry, E. Hoffer, M. S. Nacson, S. Gunasekar, and N. Srebro. The implicit bias of gradient descent on separable data. The Journal of Machine Learning Research, 19(1):2822–2878, 2018.
|
| 388 |
+
[28] C. Szegedy, V. Vanhoucke, S. Ioffe, J. Shlens, and Z. Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2818–2826, 2016.
|
| 389 |
+
[29] T. Vaskevicius, V. Kanade, and P. Rebeschini. Implicit regularization for optimal sparse recovery. In Advances in Neural Information Processing Systems, pages 2968–2979, 2019.
|
| 390 |
+
[30] C. Wei and T. Ma. Improved sample complexities for deep networks and robust classification via an all-layer margin. arXiv preprint arXiv:1910.04284, 2019.
|
| 391 |
+
[31] Y. Wen, K. Luk, M. Gazeau, G. Zhang, H. Chan, and J. Ba. Interplay between optimization and generalization of stochastic gradient descent with covariance noise. arXiv preprint arXiv:1902.08234, 2019.
|
| 392 |
+
[32] B. Woodworth, S. Gunasekar, J. D. Lee, E. Moroshko, P. Savarese, I. Golan, D. Soudry, and N. Srebro. Kernel and rich regimes in overparametrized models. arXiv preprint arXiv:2002.09277, 2020.
|
| 393 |
+
|
| 394 |
+
# Checklist
|
| 395 |
+
|
| 396 |
+
1. For all authors...
|
| 397 |
+
|
| 398 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 399 |
+
(b) Did you describe the limitations of your work? [Yes] See Section 2 for a list of assumptions made in this paper and see Appendix A for a full discussion.
|
| 400 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A] This work is mainly theoretical and focuses on understanding an existing algorithm (Label Noise SGD).
|
| 401 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 402 |
+
|
| 403 |
+
2. If you are including theoretical results...
|
| 404 |
+
|
| 405 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] See Section 2 for a list of assumptions made in this paper.
|
| 406 |
+
(b) Did you include complete proofs of all theoretical results? [Yes] A proof sketch of Theorem 1 is provided in Section 3 however full proofs of all claims in the paper can be found in Appendix B.
|
| 407 |
+
|
| 408 |
+
3. If you ran experiments...
|
| 409 |
+
|
| 410 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] The instructions needed to reproduce the experiments in Section 4 can be found in Appendix D. Code will be submitted through the supplementary material and will be made available (through Github) upon acceptance.
|
| 411 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section 4 and Appendix D.
|
| 412 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] See Figure 3 and Figure 4.
|
| 413 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Appendix D.
|
| 414 |
+
|
| 415 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 416 |
+
|
| 417 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] For CIFAR10 we cite Krizhevsky [17], as requested by the creators on https://www.cs.toronto.edu/ kriz/cifar.html. In Appendix D we additionally cite PyTorch [24], PyTorch Lightning [6], and Wandb [2].
|
| 418 |
+
(b) Did you mention the license of the assets? [Yes] We mention the MIT license for CIFAR10 in Appendix D.
|
| 419 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 420 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 421 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 422 |
+
|
| 423 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 424 |
+
|
| 425 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 426 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 427 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/xpFFI_NtgpW/xpFFI_NtgpW.md
ADDED
|
@@ -0,0 +1,369 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RETHINKING EMBEDDING COUPLING IN PRE-TRAINED LANGUAGE MODELS
|
| 2 |
+
|
| 3 |
+
Hyung Won Chung∗† Google Research hwchung@google.com
|
| 4 |
+
|
| 5 |
+
Thibault Fevry´ ∗† thibaultfevry@gmail.com
|
| 6 |
+
|
| 7 |
+
Henry Tsai
|
| 8 |
+
Google Research
|
| 9 |
+
henrytsai@google.com
|
| 10 |
+
|
| 11 |
+
Melvin Johnson Google Research melvinp@google.com
|
| 12 |
+
|
| 13 |
+
Sebastian Ruder DeepMind ruder@google.com
|
| 14 |
+
|
| 15 |
+
# ABSTRACT
|
| 16 |
+
|
| 17 |
+
We re-evaluate the standard practice of sharing weights between input and output embeddings in state-of-the-art pre-trained language models. We show that decoupled embeddings provide increased modeling flexibility, allowing us to significantly improve the efficiency of parameter allocation in the input embedding of multilingual models. By reallocating the input embedding parameters in the Transformer layers, we achieve dramatically better performance on standard natural language understanding tasks with the same number of parameters during fine-tuning. We also show that allocating additional capacity to the output embedding provides benefits to the model that persist through the fine-tuning stage even though the output embedding is discarded after pre-training. Our analysis shows that larger output embeddings prevent the model’s last layers from overspecializing to the pre-training task and encourage Transformer representations to be more general and more transferable to other tasks and languages. Harnessing these findings, we are able to train models that achieve strong performance on the XTREME benchmark without increasing the number of parameters at the fine-tuning stage.
|
| 18 |
+
|
| 19 |
+
# 1 INTRODUCTION
|
| 20 |
+
|
| 21 |
+
The performance of models in natural language processing (NLP) has dramatically improved in recent years, mainly driven by advances in transfer learning from large amounts of unlabeled data (Howard & Ruder, 2018; Devlin et al., 2019). The most successful paradigm consists of pre-training a large Transformer (Vaswani et al., 2017) model with a self-supervised loss and fine-tuning it on data of a downstream task (Ruder et al., 2019). Despite its empirical success, inefficiencies have been observed related to the training duration (Liu et al., 2019b), pre-training objective (Clark et al., 2020b), and training data (Conneau et al., 2020a), among others. In this paper, we reconsider a modeling assumption that may have a similarly pervasive practical impact: the coupling of input and output embeddings1 in state-of-the-art pre-trained language models.
|
| 22 |
+
|
| 23 |
+
State-of-the-art pre-trained language models (Devlin et al., 2019; Liu et al., 2019b) and their multilingual counterparts (Devlin et al., 2019; Conneau et al., 2020a) have inherited the practice of embedding coupling from their language model predecessors (Press & Wolf, 2017; Inan et al., 2017). However, in contrast to their language model counterparts, embedding coupling in encoder-only pre-trained models such as Devlin et al. (2019) is only useful during pre-training since output embeddings are generally discarded after fine-tuning.2 In addition, given the willingness of researchers to exchange additional compute during pre-training for improved downstream performance (Raffel et al., 2020; Brown et al., 2020) and the fact that pre-trained models are often used for inference millions of times (Wolf et al., 2019), pre-training-specific parameter savings are less important overall.
|
| 24 |
+
|
| 25 |
+
Table 1: Overview of the number of parameters in (coupled) embedding matrices of state-of-the-art multilingual (top) and monolingual (bottom) models with regard to overall parameter budget. $| V |$ : vocabulary size. $N$ , $N _ { \mathrm { e m b } }$ : number of parameters in total and in the embedding matrix respectively.
|
| 26 |
+
|
| 27 |
+
<table><tr><td>Model</td><td>Languages</td><td>V</td><td>N</td><td>Nemb</td><td>%Emb.</td></tr><tr><td>mBERT (Devlin et al., 2019)</td><td>104</td><td>120k</td><td>178M</td><td>92M</td><td>52%</td></tr><tr><td>XLM-RBase (Conneau et al.,2020a)</td><td>100</td><td>250k</td><td>270M</td><td>192M</td><td>71%</td></tr><tr><td>XLM-RLarge :(Conneau et al., 2020a)</td><td>100</td><td>250k</td><td>550M</td><td>256M</td><td>47%</td></tr><tr><td>BERTBase (Devlin et al., 2019)</td><td>1</td><td>30k</td><td>110M</td><td>23M</td><td>21%</td></tr><tr><td>BERTLarge (Devlin et al., 2019)</td><td>1</td><td>30k</td><td>335M</td><td>31M</td><td>9%</td></tr></table>
|
| 28 |
+
|
| 29 |
+
On the other hand, tying input and output embeddings constrains the model to use the same dimensionality for both embeddings. This restriction limits the researcher’s flexibility in parameterizing the model and can lead to allocating too much capacity to the input embeddings, which may be wasteful. This is a problem particularly for multilingual models, which require large vocabularies with high-dimensional embeddings that make up between $4 7 - 7 1 \%$ of the entire parameter budget (Table 1), suggesting an inefficient parameter allocation.
|
| 30 |
+
|
| 31 |
+
In this paper, we systematically study the impact of embedding coupling on state-of-the-art pretrained language models, focusing on multilingual models. First, we observe that while na¨ıvely decoupling the input and output embedding parameters does not consistently improve downstream evaluation metrics, decoupling their shapes comes with a host of benefits. In particular, it allows us to independently modify the input and output embedding dimensions. We show that the input embedding dimension can be safely reduced without affecting downstream performance. Since the output embedding is discarded after pre-training, we can increase its dimension, which improves fine-tuning accuracy and outperforms other capacity expansion strategies. By reinvesting saved parameters to the width and depth of the Transformer layers, we furthermore achieve significantly improved performance over a strong mBERT (Devlin et al., 2019) baseline on multilingual tasks from the XTREME benchmark (Hu et al., 2020). Finally, we combine our techniques in a Rebalanced mBERT (RemBERT) model that outperforms XLM-R (Conneau et al., 2020a), the state-of-the-art cross-lingual model while having been pre-trained on $3 . 5 \times$ fewer tokens and 10 more languages.
|
| 32 |
+
|
| 33 |
+
We thoroughly investigate reasons for the benefits of embedding decoupling. We observe that an increased output embedding size enables a model to improve on the pre-training task, which correlates with downstream performance. We also find that it leads to Transformers that are more transferable across tasks and languages—particularly for the upper-most layers. Overall, larger output embeddings prevent the model’s last layers from over-specializing to the pre-training task (Zhang et al., 2020; Tamkin et al., 2020), which enables training of more general Transformer models.
|
| 34 |
+
|
| 35 |
+
# 2 RELATED WORK
|
| 36 |
+
|
| 37 |
+
Embedding coupling Sharing input and output embeddings in neural language models was proposed to improve perplexity and motivated based on embedding similarity (Press & Wolf, 2017) as well as by theoretically showing that the output probability space can be constrained to a subspace governed by the embedding matrix for a restricted case (Inan et al., 2017). Embedding coupling is also common in neural machine translation models where it reduces model complexity (Firat et al., 2016) and saves memory (Johnson et al., 2017), in recent state-of-the-art language models (Melis et al., 2020), as well as all pre-trained models we are aware of (Devlin et al., 2019; Liu et al., 2019b).
|
| 38 |
+
|
| 39 |
+
Transferability of representations Representations of large pre-trained models in computer vision and NLP have been observed to transition from general to task-specific from the first to the last layer (Yosinski et al., 2014; Howard & Ruder, 2018; Liu et al., 2019a). In Transformer models, the last few layers have been shown to become specialized to the MLM task and—as a result—less transferable (Zhang et al., 2020; Tamkin et al., 2020).
|
| 40 |
+
|
| 41 |
+
Multilingual models Recent multilingual models are pre-trained on data covering around 100 languages using a subword vocabulary shared across all languages (Devlin et al., 2019; Pires et al., 2019; Conneau et al., 2020a). In order to achieve reasonable performance for most languages, these models need to allocate sufficient capacity for each language, known as the curse of multilinguality (Conneau et al., 2020a; Pfeiffer et al., 2020). As a result, such multilingual models have large vocabularies with large embedding sizes to ensure that tokens in all languages are adequately represented.
|
| 42 |
+
|
| 43 |
+
Efficient models Most work on more efficient pre-trained models focuses on pruning or distillation (Hinton et al., 2015). Pruning approaches remove parts of the model, typically attention heads (Michel et al., 2019; Voita et al., 2019) while distillation approaches distill a large pre-trained model into a smaller one (Sun et al., 2020). Distillation can be seen as an alternative form of allocating pre-training capacity via a large teacher model. However, distilling a pre-trained model is expensive (Sanh et al., 2019) and requires overcoming architecture differences and balancing training data and loss terms (Mukherjee & Awadallah, 2020). Our proposed methods are simpler and complementary to distillation as they can improve the pre-training of compact student models (Turc et al., 2019).
|
| 44 |
+
|
| 45 |
+
# 3 EXPERIMENTAL METHODOLOGY
|
| 46 |
+
|
| 47 |
+
Efficiency of models has been measured along different dimensions, from the number of floating point operations (Schwartz et al., 2019) to their runtime (Zhou et al., 2020). We follow previous work (Sun et al., 2020) and compare models in terms of their number of parameters during finetuning (see Appendix A.1 for further justification of this setting). For completeness, we generally report the number of pre-training (PT) and fine-tuning (FT) parameters.
|
| 48 |
+
|
| 49 |
+
Baseline Our baseline has the same architecture as multilingual BERT (mBERT; Devlin et al., 2019). It consists of 12 Transformer layers with a hidden size $H$ of 768. Input and output embeddings are coupled and have the same dimensionality $E$ as the hidden size, i.e. $E _ { \mathrm { o u t } } = E _ { \mathrm { i n } } = H$ . The total number of parameters during pre-training and fine-tuning is 177M (see Appendix A.2 for further details). We train variants of this model that differ in certain hyper-parameters but otherwise are trained under the same conditions to ensure a fair comparison.
|
| 50 |
+
|
| 51 |
+
Tasks For our experiments, we employ tasks from the XTREME benchmark (Hu et al., 2020) that require fine-tuning, including the XNLI (Conneau et al., 2018), NER (Pan et al., 2017), PAWS-X (Yang et al., 2019), XQuAD (Artetxe et al., 2020), MLQA (Lewis et al., 2020), and TyDiQA-GoldP (Clark et al., 2020a) datasets. We provide details for them in Appendix A.4. We average results across three fine-tuning runs and evaluate on the dev sets unless otherwise stated.
|
| 52 |
+
|
| 53 |
+
# 4 EMBEDDING DECOUPLING REVISITED
|
| 54 |
+
|
| 55 |
+
Na¨ıve decoupling Embeddings make up a large fraction of the parameter budget in state-of-theart multilingual models (see Table 1). We now study the effect of embedding decoupling on such models. In Table 2, we show the impact of decoupling the input and output embeddings in our baseline model (§3) with coupled embeddings. Na¨ıvely decoupling the output embedding matrix slightly improves the performance as evidenced by a 0.4 increase on average. However, the gain is not uniformly observed in all tasks. Overall, these results suggest that decoupling the embedding matrices na¨ıvely while keeping the dimensionality fixed does not greatly affect the performance of the model. What is more important, however, is that decoupling the input and output embeddings decouples the shapes, endowing significant modeling flexibility, which we investigate in the following.
|
| 56 |
+
|
| 57 |
+
Input vs output embeddings Decoupling input and output embeddings allows us to flexibly change the dimensionality of both matrices and to determine which one is more important for good transfer performance of the model. To this end, we compare the performance of a model with
|
| 58 |
+
|
| 59 |
+
Table 2: Effect of decoupling the input and output embedding matrices on performance on multiple tasks in XTREME. PT: Pre-training. FT: Fine-tuning. The decoupled model has input and output embeddings with the same size $E = 7 6 8$ ) as the embedding of the coupled model. The Transformer parts of the models are the same (i.e., 12 layers with $H = 7 6 8$ ).
|
| 60 |
+
|
| 61 |
+
<table><tr><td></td><td>#PT params</td><td>#FT params</td><td>XNLI Acc</td><td>NER F1</td><td>PAWS-X Acc</td><td>XQuAD EM/F1</td><td>MLQA EM/F1</td><td>TyDi-GoldP EM/F1</td><td>Avg</td></tr><tr><td>Coupled</td><td>177M</td><td>177M</td><td>70.7</td><td>69.2</td><td>85.3</td><td>46.2/63.2</td><td>37.3/53.1</td><td>40.7/56.7</td><td>62.3</td></tr><tr><td>Decoupled</td><td>269M</td><td>177M</td><td>71.3</td><td>68.9</td><td>85.0</td><td>46.9/63.8</td><td>37.3/53.1</td><td>42.8/58.1</td><td>62.7</td></tr></table>
|
| 62 |
+
|
| 63 |
+
Table 3: Performance of models with a large input and small output embedding size and vice versa. Both models have 12 Transformer layers with $H = 7 6 8$ .
|
| 64 |
+
|
| 65 |
+
<table><tr><td></td><td></td><td>#PT params</td><td>#FT params</td><td></td><td>XNLI Acc</td><td>NER F1</td><td>PAWS-X Acc</td><td>XQuAD EM/F1</td><td>MLQA EM/F1</td><td>TyDi-GoldP EM/F1</td><td>Avg</td></tr><tr><td>Ein =768,Eout =128</td><td></td><td>192M</td><td></td><td>177M</td><td>70.0</td><td>68.3</td><td>84.3</td><td>42.0/60.8</td><td>34.7/50.9</td><td>35.2/52.2</td><td>60.1</td></tr><tr><td>Ein=128,Eout =768</td><td></td><td>192M</td><td></td><td>100M</td><td>70.4</td><td>67.6</td><td>84.9</td><td>43.9/60.0</td><td>34.6/49.5</td><td>37.8/51.0</td><td>60.2</td></tr></table>
|
| 66 |
+
|
| 67 |
+
$E _ { \mathrm { i n } } = 7 6 8$ , $E _ { \mathrm { o u t } } = 1 2 8$ to that of a model with $E _ { \mathrm { i n } } = 1 2 8$ , $E _ { \mathrm { o u t } } = 7 6 8 ^ { 3 }$ (the remaining hyperparameters are the same as the baseline in $\ S 3$ ). During fine-tuning, the latter model has $43 \%$ fewer parameters. We show the results in Table 3. Surprisingly, the model pre-trained with a larger output embedding size is competitive with the comparison method on average despite having 77M fewer parameters during fine-tuning.4
|
| 68 |
+
|
| 69 |
+
Reducing the input embedding dimension saves a significant number of parameters at a noticeably smaller cost to accuracy than reducing the output embedding size. In light of this, the parameter allocation of multilingual models (see Table 1) seems particularly inefficient. For a multilingual model with coupled embeddings, reducing the input embedding dimension to save parameters as proposed by Lan et al. (2020) is very detrimental to performance (see Appendix A.5 for details).
|
| 70 |
+
|
| 71 |
+
The results in this section indicate that the output embedding plays an important role in the transferability of pre-trained representations. For multilingual models in particular, a small input embedding dimension frees up a significant number of parameters at a small cost to performance. In the next section, we study how to improve the performance of a model by resizing embeddings and layers.
|
| 72 |
+
|
| 73 |
+
# 5 EMBEDDING AND LAYER RESIZING FOR MORE EFFICIENT FINE-TUNING
|
| 74 |
+
|
| 75 |
+
Increasing the output embedding size In $\ S 4$ , we observed that reducing $E _ { \mathrm { o u t } }$ hurts performance on the fine-tuning tasks, suggesting $E _ { \mathrm { o u t } }$ is important for transferability. Motivated by this result, we study the opposite scenario, i.e., whether increasing $E _ { \mathrm { o u t } }$ beyond $H$ improves the performance. We experiment with an output embedding size $E _ { \mathrm { o u t } }$ in the range $\{ 1 2 8 , 7 6 8 , 3 0 7 2 \}$ while keeping the input embedding size $E _ { \mathrm { i n } } = 1 2 8$ and all other parts of the model the same as described in §3 ( $H = 7 6 8$ , 12 layers, etc).
|
| 76 |
+
|
| 77 |
+
We show the results in Table 4. In all of the tasks we consider, increasing $E _ { \mathrm { o u t } }$ monotonically improves the performance. The improvement is particularly impressive for the more complex question answering datasets. It is important to note that during fine-tuning, all three models have the exact same sizes for $E _ { \mathrm { i n } }$ and $H$ . The only difference among them is the output embedding, which is discarded after pre-training. These results show that the effect of additional capacity during pre-training persists through the fine-tuning stage even if the added capacity is discarded after pre-training. We perform an extensive analysis on this behavior in $\ S 6$ . We show results with an English BERTBase model in Appendix A.6, which show the same trend.
|
| 78 |
+
|
| 79 |
+
Table 4: Effect of an increased output embedding size $E _ { \mathrm { o u t } }$ on tasks in XTREME. All three models have $E _ { \mathrm { i n } } = 1 2 8$ and 12 Transformer layers with $H = 7 6 8$ .
|
| 80 |
+
|
| 81 |
+
<table><tr><td></td><td>#PT params</td><td></td><td>#FT params</td><td>XNLI Acc</td><td>NER F1</td><td>PAWS-X Acc</td><td>XQuAD EM/F1</td><td>MLQA EM/F1</td><td>TyDi-GoldP EM/F1</td><td>Avg</td></tr><tr><td>Eout =128</td><td></td><td>115M</td><td>100M</td><td>68.1</td><td>65.2</td><td>83.3</td><td>38.6/54.8</td><td>30.9/45.2</td><td>32.2/44.2</td><td>56.6</td></tr><tr><td>Eout =768</td><td></td><td>192M</td><td>100M</td><td>70.4</td><td>67.6</td><td>84.9</td><td>43.9/60.0</td><td>34.6/49.5</td><td>37.8/51.0</td><td>60.2</td></tr><tr><td>Eout =3072</td><td></td><td>469M</td><td>100M</td><td>71.1</td><td>68.1</td><td>85.1</td><td>45.3/63.3</td><td>37.2/53.1</td><td>39.4/54.7</td><td>61.8</td></tr></table>
|
| 82 |
+
|
| 83 |
+
Table 5: Effect of additional capacity via more Transformer layers during pre-training. Both models have $E _ { \mathrm { i n } } = 1 2 8$ . The $E _ { \mathrm { o u t } } = 7 6 8$ model has a larger output embedding size $E _ { \mathrm { o u t } }$ and 12 Transformer layers. In contrast, the model with 11 additional Transformer layers has $E _ { \mathrm { o u t } } = 1 2 8$ . Those additional layers are dropped after pre-training, leaving 12 layers for fair comparison during fine-tuning.
|
| 84 |
+
|
| 85 |
+
<table><tr><td></td><td>#PT params</td><td>#FT params</td><td>XNLI Acc</td><td>NER F1</td><td>PAWS-X Acc</td><td>XQuAD EM/F1</td><td>MLQA EM/F1</td><td>TyDi-GoldP EM/F1</td><td>Avg</td></tr><tr><td>Eout =768</td><td>192M</td><td>100M</td><td>70.4</td><td>67.6</td><td>84.9</td><td>43.9/60.0</td><td>34.6/49.5</td><td>37.8/51.0</td><td>60.2</td></tr><tr><td>11 add. layers</td><td>193M</td><td>100M</td><td>71.2</td><td>67.3</td><td>85.0</td><td>38.8/55.5</td><td>31.4/46.6</td><td>31.3/45.5</td><td>58.0</td></tr></table>
|
| 86 |
+
|
| 87 |
+
Adding capacity via layers We investigate alternative ways of adding capacity during pre-training such as increasing the number of layers and discarding them after pre-training. For a fair comparison with the $E _ { \mathrm { o u t } } = 7 6 8$ model, we add 11 additional layers (total of 23) and drop the 11 upper layers after pre-training. This setting ensures that both models have the same pre-training and fine-tuning parameters. We show the results in Table 5. The model with additional layers performs poorly on the question answering tasks, likely because the top layers contain useful semantic information (Tenney et al., 2019). In addition to higher performance, increasing $E _ { \mathrm { o u t } }$ relies only a more expensive dense matrix multiplication, which is highly optimized on typical accelerators and can be scaled up more easily with model parallelism (Shazeer et al., 2018) because of small additional communication cost. We thus focus on increasing $E _ { \mathrm { o u t } }$ to expand pre-training capacity and leave an exploration of alternative strategies to future work.
|
| 88 |
+
|
| 89 |
+
Reinvesting input embedding parameters Reducing $E _ { \mathrm { i n } }$ from 768 to 128 reduces the number of parameters from 177M to 100M. We redistribute these 77M parameters for the model with $E _ { \mathrm { o u t } } =$ 768 to add capacity where it might be more useful by increasing the width or depth of the model. Specifically, we 1) increase the hidden dimension $H$ of the Transformer layers from 768 to $1 0 2 4 ^ { 5 }$ and 2) increase the number of Transformer layers $( L )$ from 12 to 23 at the same $H$ to obtain models with similar number of parameters during fine-tuning.
|
| 90 |
+
|
| 91 |
+
Table 6 shows the results for these two strategies. Reinvesting the input embedding parameters in both $H$ and $L$ improves performance on all tasks while increasing the number of Transformer layers $L$ results in the best performance, with an average improvement of 3.9 over the baseline model with coupled embeddings and the same number of fine-tuning parameters overall.
|
| 92 |
+
|
| 93 |
+
A rebalanced mBERT We finally combine and scale up our techniques to design a rebalanced mBERT model that outperforms the current state-of-the-art unsupervised model, XLM-R (Conneau et al., 2020a). As the performance of Transformer-based models strongly depends on their number of parameters (Raffel et al., 2020), we propose a Rebalanced mBERT (RemBERT) model that matches XLM-R’s number of fine-tuning parameters (559M) while using a reduced embedding size, resized layers, and more effective capacity during pre-training. The model has a vocabulary size of 250k, $E _ { \mathrm { i n } } = 2 5 6$ , $E _ { \mathrm { o u t } } = 1 5 3 6$ , and 32 layers with 1152 dimensions and 18 attention heads per layer and was trained on data covering 110 languages. We provide further details in Appendix A.7.
|
| 94 |
+
|
| 95 |
+
We compare RemBERT to XLM-R and the best-performing models on the XTREME leaderboard in Table 7 (see Appendix A.8 for the per-task results).6 The models in the first three rows use additional task or translation data for fine-tuning, which significantly boosts performance $\mathrm { H u }$ et al., 2020). XLM-R and RemBERT are the only two models that are fine-tuned using only the English training data of the corresponding task. XLM-R was trained with a batch size of $2 ^ { 1 3 }$ sequences each with $2 ^ { \bar { 9 } }$ tokens and 1.5M steps (total of $6 . 3 \mathrm { T }$ tokens). In comparison, RemBERT is trained with $2 ^ { 1 1 }$ sequences of $2 ^ { 9 }$ tokens for 1.76M steps (1.8T tokens). Even though it was trained with $3 . 5 \times$ fewer tokens and has 10 more languages competiting for the model capacity, RemBERT outperforms XLM-R on all tasks we considered. This strong result suggests that our proposed methods are also effective at scale. We will release the pre-trained model checkpoint and the source code for RemBERT in order to promote reproducibility and share the pre-training cost with other researchers.
|
| 96 |
+
|
| 97 |
+
Table 6: Effect of reinvesting the input embedding parameters to increase the hidden dimension $H$ and number of Transformer layers $L$ on XTREME tasks. $E _ { \mathrm { i n } } = 1 2 8 , E _ { \mathrm { o u t } } = 7 6 8 , H = 7 6 8$ for all models except for the baseline, which has coupled embeddings and $E _ { \mathrm { i n } } = E _ { \mathrm { o u t } } = 7 6 8$ .
|
| 98 |
+
|
| 99 |
+
<table><tr><td></td><td>#PT params</td><td>#FT params</td><td>XNLI Acc</td><td>NER F1</td><td>PAWS-X Acc</td><td>XQuAD EM/F1</td><td>MLQA EM/F1</td><td>TyDi-GoldP EM/F1</td><td>Avg</td></tr><tr><td>Baseline</td><td>177M</td><td>177M</td><td>70.7</td><td>69.2</td><td>85.3</td><td>46.2/63.2</td><td>37.3/53.1</td><td>40.7/56.7</td><td>62.3</td></tr><tr><td>Ein=128,Eout=768</td><td>192M</td><td>100M</td><td>70.4</td><td>67.6</td><td>84.9</td><td>43.9/60.0</td><td>34.6/49.5</td><td>37.8/51.0</td><td>60.2</td></tr><tr><td>Reinvested in H</td><td>260M</td><td>168M</td><td>72.8</td><td>69.2</td><td>85.6</td><td>50.2/67.2</td><td>40.7/56.4</td><td>44.8/60.0</td><td>64.5</td></tr><tr><td>Reinvested in L</td><td>270M</td><td>178M</td><td>73.6</td><td>71.0</td><td>86.7</td><td>51.7/68.8</td><td>42.4/58.2</td><td>48.2/62.9</td><td>66.2</td></tr></table>
|
| 100 |
+
|
| 101 |
+
Table 7: Comparison of our model to other models on the XTREME leaderboard. Details about VECO are due to communication with the authors.
|
| 102 |
+
|
| 103 |
+
<table><tr><td></td><td>#PT params</td><td>#FT params</td><td>Langs</td><td>Add. task data</td><td>Trans- lation data</td><td>Sentence-pair Classification Acc</td><td>Structured Prediction F1</td><td>Question Answering EM/F1</td><td>Avg</td></tr><tr><td colspan="10">Models fine-tuned on translations or additional task data</td></tr><tr><td>STiLTs (Phang et al.,2020)</td><td>559M</td><td>559M</td><td>100</td><td>√</td><td></td><td>83.9</td><td>69.4</td><td>67.2</td><td>73.5</td></tr><tr><td>FILTER (Fang et al., 2020)</td><td>559M</td><td>559M</td><td>100</td><td></td><td>√</td><td>87.5</td><td>71.9</td><td>68.5</td><td>76.0</td></tr><tr><td>VECO (Luo et al.,2020)</td><td>662M</td><td>662M</td><td>50</td><td></td><td>√</td><td>87.0</td><td>70.4</td><td>68.0</td><td>75.1</td></tr><tr><td colspan="10">Models fine-tuned only on English task data</td></tr><tr><td>XLM-R (Conneau et al.,2020a)</td><td>559M</td><td>559M</td><td>100</td><td></td><td></td><td>82.8</td><td>69.0</td><td>62.3</td><td>71.4</td></tr><tr><td>RemBERT(ours)</td><td>995M</td><td>575M</td><td>110</td><td></td><td></td><td>84.2</td><td>73.3</td><td>68.6</td><td>75.4</td></tr></table>
|
| 104 |
+
|
| 105 |
+
# 6 ON THE IMPORTANCE OF THE OUTPUT EMBEDDING SIZE
|
| 106 |
+
|
| 107 |
+
We carefully design a set of experiments to analyze the impact of an increased output embedding size on various parts of the model. We study the nature of the decoupled input and output representations (§6.1) and the transferability of the Transformer layers with regard to task-specific (§6.2) and language-specific knowledge (§6.3).
|
| 108 |
+
|
| 109 |
+
# 6.1 NATURE OF INPUT AND OUTPUT EMBEDDING REPRESENTATIONS
|
| 110 |
+
|
| 111 |
+
We first investigate to what extent the representations of decoupled input and output embeddings differ based on word embedding association tests (Caliskan et al., 2017). Similar to Press & Wolf (2017), for a given pair of words, we evaluate the correlation between human similarity judgements of the strength of the relationship and the dot product of the word embeddings. We evaluate on MEN (Bruni et al., 2014), MTurk771 (Halawi et al., 2012), Rare-Word (Luong et al., 2013), SimLex999 (Hill et al., 2015), and Verb-143 (Baker et al., 2014). As our model uses subwords, we average the token representations for words with multiple subwords.
|
| 112 |
+
|
| 113 |
+
We show the results in Table 8. In the first two rows, we can observe that the input embedding of the decoupled model performs similarly to the embeddings of the coupled model while the output embeddings have lower scores.7 We note that higher scores are not necessarily desirable as they only measure how well the embedding captures semantic similarity at the lexical level. Focusing on the difference in scores, we can observe that the input embedding learns representations that capture semantic similarity in contrast to the decoupled output embedding. At the same time, the decoupled model achieves higher performance in masked language modeling.
|
| 114 |
+
|
| 115 |
+
Table 8: Results on word embedding association tests for the input (I) and output (O) embeddings of models (left) and the models’ masked language modeling performance (right). The first two rows show the performance of coupled and decoupled embeddings with the same embedding size $E _ { \mathrm { i n } } = E _ { \mathrm { o u t } } = 7 6 8$ . The last three rows show the performance as we increase the output embedding size with $E _ { \mathrm { i n } } = 1 2 8$ .
|
| 116 |
+
|
| 117 |
+
<table><tr><td></td><td colspan="2">MEN</td><td colspan="2">MTurk771</td><td colspan="2">Rare-Word</td><td colspan="2">Simlex999</td><td colspan="2">Verb-143 I</td><td rowspan="2"></td><td rowspan="2">MLM acc.</td></tr><tr><td></td><td>I</td><td>0</td><td>I</td><td>0</td><td>I</td><td>0</td><td>I</td><td>0</td><td>0</td><td></td></tr><tr><td>Coupled</td><td>40.8</td><td></td><td>37.5</td><td></td><td></td><td>25.0</td><td></td><td>20.1</td><td>56.0</td><td></td><td>Coupled</td><td>61.1</td></tr><tr><td>Decoupled</td><td>39.2</td><td>27.7</td><td>37.5</td><td>24.3</td><td>24.0</td><td>12.2</td><td>17.6</td><td>16.1</td><td>59.4</td><td>43.9</td><td>Decoupled</td><td>61.6</td></tr><tr><td>Eout =128</td><td>40.7</td><td>36.6</td><td>37.7</td><td>32.8</td><td>23.6</td><td>16.4</td><td>17.5</td><td>17.3</td><td>48.9</td><td>46.4</td><td>Eout =128</td><td>59.0</td></tr><tr><td>Eout =768</td><td>38.6</td><td>27.8</td><td>35.2</td><td>23.9</td><td>22.6</td><td>11.5</td><td>19.7</td><td>15.6</td><td>50.6</td><td>45.5</td><td>Eout =768</td><td>60.7</td></tr><tr><td>Eout =3072</td><td>40.1</td><td>10.8</td><td>36.2</td><td>8.8</td><td>22.6</td><td>-1.2</td><td>18.9</td><td>13.0</td><td>43.3</td><td>19.5</td><td>Eout =3072</td><td>62.3</td></tr></table>
|
| 118 |
+
|
| 119 |
+
The last three rows of Table 8 show that as $E _ { \mathrm { o u t } }$ increases, the difference in the input and output embedding increases as well. With additional capacity, the output embedding progressively learns representations that differ more significantly from the input embedding. We also observe that the MLM accuracy increases with $E _ { \mathrm { o u t } }$ . Collectively, the results in Table 8 suggest that with increased capacity, the output embeddings learn representations that are worse at capturing traditional semantic similarity (which is purely restricted to the lexical level) while being more specialized to the MLM task (which requires more contextual representations). Decoupling embeddings thus give the model the flexibility to avoid encoding relationships in its output embeddings that may not be useful for its pre-training task. As pre-training performance correlates well with downstream performance (Devlin et al., 2019), forcing output embeddings to encode lexical information can hurt the latter.
|
| 120 |
+
|
| 121 |
+
6.2 CROSS-TASK TRANSFERABILITY OF TRANSFORMER LAYER REPRESENTATIONS
|
| 122 |
+
|
| 123 |
+
We investigate to what extent more capacity in the output embeddings during pre-training reduces the MLM-specific burden on the Transformer layers and hence prevents them from over-specializing to the MLM task.
|
| 124 |
+
|
| 125 |
+
Dropping the last few layers We first study the impact of an increased output embedding size on the transferability of the last few layers. Previous work (Zhang et al., 2020; Tamkin et al., 2020) randomly reinitialized the last few layers to investigate their transferability. However, those parameters are still present during fine-tuning. We propose a more aggressive pruning scheme where we completely remove the last few layers. This setting demonstrates more drastically whether a model’s upper layers are over-specialized to the pre-training task by assessing whether performance can be improved with millions fewer parameters.8
|
| 126 |
+
|
| 127 |
+
We show the performance of models with 8–12 remaining layers (removing up to 4 of the last layers) for different output embedding sizes $E _ { \mathrm { o u t } }$ on XNLI in Figure 1. For both $E _ { \mathrm { o u t } } = 1 2 8$ and $E _ { \mathrm { o u t } } = 7 6 8$ , removing the last layer improves performance. In other words, the model performs better even with 7.1M fewer parameters. With $E _ { \mathrm { o u t } } = 1 2 8$ , the performance remains similar when removing the last few layers, which suggests that the last few layers are not critical for transferability.
|
| 128 |
+
|
| 129 |
+
As we increase $E _ { \mathrm { o u t } }$ , the last layers become more transferable. With $E _ { \mathrm { o u t } } = 7 6 8$ , removing more than one layer results in a sharp reduction in performance. Finally when $E _ { \mathrm { o u t } } = 3 0 7 2$ , every layer is useful and removing any layer worsens the performance. This analysis demonstrates that increasing $E _ { \mathrm { o u t } }$ improves the transferability of the representations learned by the last few Transformer layers.
|
| 130 |
+
|
| 131 |
+

|
| 132 |
+
Figure 1: XNLI accuracy with the last layers removed. Larger $E _ { \mathrm { o u t } }$ improves transferability.
|
| 133 |
+
|
| 134 |
+

|
| 135 |
+
Figure 2: Nearest-neighbor English-to-German translation accuracy of each layer.
|
| 136 |
+
|
| 137 |
+
Table 9: Probing analysis of Tenney et al. (2019) with mix strategy.
|
| 138 |
+
|
| 139 |
+
<table><tr><td></td><td># PT params</td><td>#FT params</td><td>POS</td><td>Const.</td><td>Deps.</td><td>Entities</td><td>SRL</td><td>Coref.O</td><td>Coref.W</td><td>SPR1</td><td>SPR2</td><td>Rel.</td><td>Avg</td></tr><tr><td>Eout =128</td><td>115M</td><td>100M</td><td>96.7</td><td>87.9</td><td>94.3</td><td>93.7</td><td>91.7</td><td>95.0</td><td>67.2</td><td>83.0</td><td>82.7</td><td>77.0</td><td>86.9</td></tr><tr><td>Eout =768</td><td>192M</td><td>100M</td><td>96.7</td><td>87.9</td><td>94.4</td><td>94.0</td><td>91.8</td><td>95.0</td><td>67.0</td><td>83.1</td><td>82.8</td><td>78.6</td><td>87.1</td></tr><tr><td>Eout =3072</td><td>469M</td><td>100M</td><td>96.8</td><td>88.0</td><td>94.5</td><td>94.2</td><td>92.0</td><td>95.3</td><td>67.6</td><td>84.1</td><td>82.6</td><td>78.9</td><td>87.4</td></tr></table>
|
| 140 |
+
|
| 141 |
+
Probing analysis We further study whether an increased output embedding size improves the general natural language processing ability of the Transformer. We employ the probing analysis of Tenney et al. (2019) and the mix probing strategy where a 2-layer dense network is trained on top of a weighted combination of the 12 Transformer layers. We evaluate performance with regard to core NLP concepts including part-of-speech tagging (POS), constituents (Consts.), dependencies (Deps.), entities, semantic role labeling (SRL), coreference (Coref.), semantic proto-roles (SPR), and relations (Rel.). For a thorough description of the task setup, see Tenney et al. (2019).9
|
| 142 |
+
|
| 143 |
+
We show the results of the probing analysis in Table 9. As we increase $E _ { \mathrm { o u t } }$ , the model improves across all tasks, even though the number of parameters is the same. This demonstrates that increasing $E _ { \mathrm { o u t } }$ enables the Transformer layers to learn more general representations.10
|
| 144 |
+
|
| 145 |
+
6.3 CROSS-LINGUAL TRANSFERABILITY OF TRANSFORMER LAYER REPRESENTATIONS
|
| 146 |
+
|
| 147 |
+
So far, our analyses were not specialized to multilingual models. Unlike monolingual models, multilingual models have another dimension of transferability: cross-lingual transfer, the ability to transfer knowledge from one language to another.
|
| 148 |
+
|
| 149 |
+
Previous work (Pires et al., 2019; Artetxe et al., 2020) has found that MLM on multilingual data encourages cross-lingual alignment of representations without explicit cross-lingual supervision. While it has been shown that multilingual models learn useful cross-lingual representations, overspecialization to the pre-training task may result in higher layers being less cross-lingual and focusing on language-specific phenomena necessary for predicting the next word in a given language. To investigate to what extent this is the case and whether increasing $E _ { \mathrm { o u t } }$ improves cross-lingual alignment, we evaluate the model’s nearest neighbour translation accuracy (Pires et al., 2019) on English-to-German translation (see Appendix A.9 for a description of the method).
|
| 150 |
+
|
| 151 |
+
We show the nearest neighbor translation accuracy for each layer in Figure 2. As $E _ { \mathrm { o u t } }$ increases, we observe that a) the Transformer layers become more language-agnostic as evidenced by higher accuracy and b) the language-agnostic representation is maintained to a higher layer as indicated by a flatter slope from layer 7 to 11. In all cases, the last layer is less language-agnostic than the previous one. The sharp drop in performance after layer 8 at $E _ { \mathrm { o u t } } = 1 2 8$ is in line with previous results on cross-lingual retrieval (Pires et al., 2019; Hu et al., 2020) and is partially mitigated by an increased $E _ { \mathrm { o u t } }$ . In sum, not only does a larger output embedding size improve cross-task transferability but it also helps with cross-lingual alignment and thereby cross-lingual transfer on downstream tasks.
|
| 152 |
+
|
| 153 |
+
# 7 CONCLUSION
|
| 154 |
+
|
| 155 |
+
We have assessed the impact of embedding coupling in pre-trained language models. We have identified the main benefit of decoupled embeddings to be the flexibility endowed by decoupling their shapes. We showed that input embeddings can be safely reduced and that larger output embeddings and reinvesting saved parameters lead to performance improvements. Our rebalanced multilingual BERT (RemBERT) outperforms XLM-R with the same number of fine-tuning parameters while having been trained on $3 . 5 \times$ fewer tokens. Overall, we found that larger output embeddings lead to more transferable and more general representations, particularly in a Transformer’s upper layers.
|
| 156 |
+
|
| 157 |
+
# ACKNOWLEDGEMENTS
|
| 158 |
+
|
| 159 |
+
We would like to thank Laura Rimell for valuable feedback on a draft of this paper.
|
| 160 |
+
|
| 161 |
+
# REFERENCES
|
| 162 |
+
|
| 163 |
+
Roee Aharoni, Melvin Johnson, and Orhan Firat. Massively Multilingual Neural Machine Translation. In Proceedings of NAACL 2019, 2019.
|
| 164 |
+
Asaf Amrami and Yoav Goldberg. Towards better substitution-based word sense induction. arXiv preprint arXiv:1905.12598, 2019.
|
| 165 |
+
Mikel Artetxe and Holger Schwenk. Massively Multilingual Sentence Embeddings for Zero-Shot Cross-Lingual Transfer and Beyond. Transactions of the ACL 2019, 2019.
|
| 166 |
+
Mikel Artetxe, Sebastian Ruder, and Dani Yogatama. On the Cross-lingual Transferability of Monolingual Representations. In Proceedings of ACL 2020, 2020.
|
| 167 |
+
Simon Baker, Roi Reichart, and Anna Korhonen. An unsupervised model for instance level subcategorization acquisition. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 278–289, 2014.
|
| 168 |
+
Ondˇrej Bojar, Yvette Graham, Amir Kamran, and Milos Stanojevi ˇ c. Results of the wmt16 metrics ´ shared task. In Proceedings of the First Conference on Machine Translation: Volume 2, Shared Task Papers, pp. 199–231, 2016.
|
| 169 |
+
Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCand lish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language Models are Few-Shot Learners. arXiv e-prints, art. arXiv:2005.14165, May 2020.
|
| 170 |
+
Elia Bruni, Nam-Khanh Tran, and Marco Baroni. Multimodal distributional semantics. Journal of Artificial Intelligence Research, 49:1–47, 2014.
|
| 171 |
+
Aylin Caliskan, Joanna J Bryson, and Arvind Narayanan. Semantics derived automatically from language corpora contain human-like biases. Science, 356(6334):183–186, 2017.
|
| 172 |
+
|
| 173 |
+
Jonathan H. Clark, Eunsol Choi, Michael Collins, Dan Garrette, Tom Kwiatkowski, Vitaly Nikolaev, and Jennimaria Palomaki. TyDi QA: A Benchmark for Information-Seeking Question Answering in Typologically Diverse Languages. In Transactions of the Association of Computational Linguistics, 2020a.
|
| 174 |
+
|
| 175 |
+
Kevin Clark, Minh-Thang Luong, Quoc V. Le, and Christopher D. Manning. ELECTRA: Pretraining Text Encoders as Discriminators Rather Than Generators. In Proceedings of ICLR 2020, 2020b.
|
| 176 |
+
|
| 177 |
+
Alexis Conneau, Ruty Rinott, Guillaume Lample, Adina Williams, Samuel Bowman, Holger Schwenk, and Veselin Stoyanov. XNLI: Evaluating cross-lingual sentence representations. In Proceedings of EMNLP 2018, pp. 2475–2485, 2018.
|
| 178 |
+
|
| 179 |
+
Alexis Conneau, Kartikay Khandelwal, Naman Goyal, Vishrav Chaudhary, Guillaume Wenzek, Francisco Guzman, Edouard Grave, Myle Ott, Luke Zettlemoyer, and Veselin Stoyanov. Un- ´ supervised cross-lingual representation learning at scale. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 8440–8451, Online, July 2020a. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.747. URL https: //www.aclweb.org/anthology/2020.acl-main.747.
|
| 180 |
+
|
| 181 |
+
Alexis Conneau, Shijie Wu, Haoran Li, Luke Zettlemoyer, and Veselin Stoyanov. Emerging crosslingual structure in pretrained language models. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 6022–6034, Online, July 2020b. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.536. URL https://www. aclweb.org/anthology/2020.acl-main.536.
|
| 182 |
+
|
| 183 |
+
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. doi: 10.18653/v1/N19-1423. URL https: //www.aclweb.org/anthology/N19-1423.
|
| 184 |
+
|
| 185 |
+
Yanai Elazar and Yoav Goldberg. oLMpics - On what Language Model Pre-training Captures. arXiv preprint arXiv:1912.13283, 2019.
|
| 186 |
+
|
| 187 |
+
Yuwei Fang, Shuohang Wang, Zhe Gan, Siqi Sun, and Jingjing Liu. FILTER: An Enhanced Fusion Method for Cross-lingual Language Understanding. arXiv preprint arXiv:2009.05166, 2020.
|
| 188 |
+
|
| 189 |
+
Orhan Firat, Baskaran Sankaran, Yaser Al-onaizan, Fatos T. Yarman Vural, and Kyunghyun Cho. Zero-Resource Translation with Multi-Lingual Neural Machine Translation. In Proceedings of EMNLP 2016, pp. 268–277, 2016.
|
| 190 |
+
|
| 191 |
+
Suchin Gururangan, Ana Marasovic, Swabha Swayamdipta, Kyle Lo, Iz Beltagy, Doug Downey, ´ and Noah A. Smith. Don’t Stop Pretraining: Adapt Language Models to Domains and Tasks. In Proceedings of ACL 2020, 2020.
|
| 192 |
+
|
| 193 |
+
Guy Halawi, Gideon Dror, Evgeniy Gabrilovich, and Yehuda Koren. Large-scale learning of word relatedness with constraints. In Proceedings of the 18th ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 1406–1414, 2012.
|
| 194 |
+
|
| 195 |
+
Felix Hill, Roi Reichart, and Anna Korhonen. Simlex-999: Evaluating semantic models with (genuine) similarity estimation. Computational Linguistics, 41(4):665–695, 2015.
|
| 196 |
+
|
| 197 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the Knowledge in a Neural Network. arXiv preprint arXiv:1503.02531, 2015.
|
| 198 |
+
|
| 199 |
+
Jeremy Howard and Sebastian Ruder. Universal Language Model Fine-tuning for Text Classification. In Proceedings of ACL 2018, 2018.
|
| 200 |
+
|
| 201 |
+
Junjie Hu, Sebastian Ruder, Aditya Siddhant, Graham Neubig, Orhan Firat, and Melvin Johnson. XTREME: A Massively Multilingual Multi-task Benchmark for Evaluating Cross-lingual Generalization. In Proceedings of the 37th International Conference on Machine Learning (ICML), 2020.
|
| 202 |
+
|
| 203 |
+
Hakan Inan, Khashayar Khosravi, and Richard Socher. Tying Word Vectors and Word Classifiers: A Loss Framework for Language Modeling. In Proceedings of ICLR 2017, 2017.
|
| 204 |
+
|
| 205 |
+
Melvin Johnson, Mike Schuster, Quoc V Le, Maxim Krikun, Yonghui Wu, Zhifeng Chen, Nikhil Thorat, Fernanda Viegas, Martin Wattenberg, Greg Corrado, Macduff Hughes, and Jeffrey Dean. ´ Google’s Multilingual Neural Machine Translation System: Enabling Zero-Shot Translation. Transactions of the ACL 2017, 2017.
|
| 206 |
+
|
| 207 |
+
Karthikeyan K, Zihan Wang, Stephen Mayhew, and Dan Roth. Cross-lingual ability of multilingual bert: An empirical study. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ HJeT3yrtDr.
|
| 208 |
+
|
| 209 |
+
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 e-prints, art. arXiv:2001.08361, January 2020.
|
| 210 |
+
|
| 211 |
+
Taku Kudo and John Richardson. SentencePiece: A simple and language independent subword tokenizer and detokenizer for neural text processing. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pp. 66–71, Brussels, Belgium, November 2018. Association for Computational Linguistics. doi: 10.18653/v1/D18-2012. URL https://www.aclweb.org/anthology/D18-2012.
|
| 212 |
+
|
| 213 |
+
Zhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, and Radu Soricut. ALBERT: A Lite BERT for Self-supervised Learning of Language Representations. In International Conference on Learning Representations, 2020. URL https://openreview. net/forum?id ${ . } = { }$ H1eA7AEtvS.
|
| 214 |
+
|
| 215 |
+
Dmitry Lepikhin, HyoukJoong Lee, Yuanzhong Xu, Dehao Chen, Orhan Firat, Yanping Huang, Maxim Krikun, Noam Shazeer, and Zhifeng Chen. GShard: Scaling Giant Models with Conditional Computation and Automatic Sharding. arXiv e-prints, art. arXiv:2006.16668, June 2020.
|
| 216 |
+
|
| 217 |
+
Patrick Lewis, Barlas Oguz, Ruty Rinott, Sebastian Riedel, and Holger Schwenk. MLQA: Evaluat- ˘ ing Cross-lingual Extractive Question Answering. In Proceedings of ACL 2020, 2020.
|
| 218 |
+
|
| 219 |
+
Nelson F. Liu, Matt Gardner, Yonatan Belinkov, Matthew E. Peters, and Noah A. Smith. Linguistic Knowledge and Transferability of Contextual Representations. In Proceedings of NAACL 2019, 2019a.
|
| 220 |
+
|
| 221 |
+
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.
|
| 222 |
+
|
| 223 |
+
Fuli Luo, Wei Wang, Jiahao Liu, Yijia Liu, Bin Bi, Songfang Huang, Fei Huang, and Luo Si. VECO: Variable Encoder-decoder Pre-training for Cross-lingual Understanding and Generation. arXiv eprints, art. arXiv:2010.16046, October 2020.
|
| 224 |
+
|
| 225 |
+
Minh-Thang Luong, Richard Socher, and Christopher D Manning. Better word representations with recursive neural networks for morphology. In Proceedings of the Seventeenth Conference on Computational Natural Language Learning, pp. 104–113, 2013.
|
| 226 |
+
|
| 227 |
+
Gabor Melis, Tom ´ a´s Ko ˇ cisk ˇ y, and Phil Blunsom. Mogrifier LSTM. In ´ Proceedings of ICLR 2020, 2020.
|
| 228 |
+
|
| 229 |
+
Paul Michel, Omer Levy, and Graham Neubig. Are Sixteen Heads Really Better than One? In Proceedings of NeurIPS 2019, 2019.
|
| 230 |
+
|
| 231 |
+
Subhabrata Mukherjee and Ahmed Hassan Awadallah. XtremeDistil : Multi-stage Distillation for Massive Multilingual Models. In Proceedings of ACL 2020, pp. 2221–2234, 2020.
|
| 232 |
+
|
| 233 |
+
Joakim Nivre, Mitchell Abrams, Zeljko Agi ˇ c, Lars Ahrenberg, Lene Antonsen, Maria Jesus Aran- ´ zabe, Gashaw Arutie, Masayuki Asahara, Luma Ateyah, Mohammed Attia, et al. Universal dependencies 2.2. 2018.
|
| 234 |
+
|
| 235 |
+
Xiaoman Pan, Boliang Zhang, Jonathan May, Joel Nothman, Kevin Knight, and Heng Ji. Crosslingual name tagging and linking for 282 languages. In Proceedings of ACL 2017, pp. 1946–1958, 2017.
|
| 236 |
+
|
| 237 |
+
Jonas Pfeiffer, Ivan Vuli, Iryna Gurevych, and Sebastian Ruder. MAD-X: An Adapter-based Framework for Multi-task Cross-lingual Transfer. In Proceedings of EMNLP 2020, 2020.
|
| 238 |
+
|
| 239 |
+
Jason Phang, Phu Mon Htut, Yada Pruksachatkun, Haokun Liu, Clara Vania, Katharina Kann, Iacer Calixto, and Samuel R Bowman. English intermediate-task training improves zero-shot crosslingual transfer too. arXiv preprint arXiv:2005.13013, 2020.
|
| 240 |
+
|
| 241 |
+
Telmo Pires, Eva Schlinger, and Dan Garrette. How multilingual is multilingual BERT? In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 4996–5001, Florence, Italy, July 2019. Association for Computational Linguistics. doi: 10.18653/v1/P19-1493. URL https://www.aclweb.org/anthology/P19-1493.
|
| 242 |
+
|
| 243 |
+
Ofir Press and Lior Wolf. Using the output embedding to improve language models. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 2, Short Papers, pp. 157–163, Valencia, Spain, April 2017. Association for Computational Linguistics. URL https://www.aclweb.org/anthology/E17-2025.
|
| 244 |
+
|
| 245 |
+
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-totext transformer. Journal of Machine Learning Research, 21(140):1–67, 2020. URL http: //jmlr.org/papers/v21/20-074.html.
|
| 246 |
+
|
| 247 |
+
Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. SQuAD: $^ { 1 0 0 , 0 0 0 + }$ Questions for Machine Comprehension of Text. In Proceedings of EMNLP 2016, 2016.
|
| 248 |
+
|
| 249 |
+
Sebastian Ruder, Matthew E Peters, Swabha Swayamdipta, and Thomas Wolf. Transfer learning in natural language processing. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Tutorials, pp. 15–18, 2019.
|
| 250 |
+
|
| 251 |
+
Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter. arXiv preprint arXiv:1910.01108, 2019.
|
| 252 |
+
|
| 253 |
+
Roy Schwartz, Jesse Dodge, Noah A. Smith, and Oren Etzioni. Green AI. arXiv preprint arXiv:1907.10597, 2019.
|
| 254 |
+
|
| 255 |
+
Noam Shazeer, Youlong Cheng, Niki Parmar, Dustin Tran, Ashish Vaswani, Penporn Koanantakool, Peter Hawkins, HyoukJoong Lee, Mingsheng Hong, Cliff Young, Ryan Sepassi, and Blake Hechtman. Mesh-tensorflow: Deep learning for supercomputers. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems 31, pp. 10414– 10423. Curran Associates, Inc., 2018. URL http://papers.nips.cc/paper/ 8242-mesh-tensorflow-deep-learning-for-supercomputers.pdf.
|
| 256 |
+
|
| 257 |
+
Mohammad Shoeybi, Mostofa Patwary, Raul Puri, Patrick LeGresley, Jared Casper, and Bryan Catanzaro. Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism. arXiv e-prints, art. arXiv:1909.08053, September 2019.
|
| 258 |
+
|
| 259 |
+
Zhiqing Sun, Hongkun Yu, Xiaodan Song, Renjie Liu, Yiming Yang, and Denny Zhou. MobileBERT : a Compact Task-Agnostic BERT for Resource-Limited Devices. In Proceedings of ACL 2020, pp. 2158–2170, 2020.
|
| 260 |
+
|
| 261 |
+
Alex Tamkin, Trisha Singh, Davide Giovanardi, and Noah Goodman. Investigating Transferability in Pretrained Language Models. arXiv e-prints, art. arXiv:2004.14975, April 2020.
|
| 262 |
+
|
| 263 |
+
Ian Tenney, Dipanjan Das, and Ellie Pavlick. BERT rediscovers the classical NLP pipeline. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 4593–4601, Florence, Italy, July 2019. Association for Computational Linguistics. doi: 10.18653/ v1/P19-1452. URL https://www.aclweb.org/anthology/P19-1452.
|
| 264 |
+
|
| 265 |
+
Iulia Turc, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Well-Read Students Learn Better: On the Importance of Pre-training Compact Models. arXiv preprint arXiv:1908.08962, 2019.
|
| 266 |
+
|
| 267 |
+
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.
|
| 268 |
+
|
| 269 |
+
Elena Voita, David Talbot, Fedor Moiseev, Rico Sennrich, and Ivan Titov. Analyzing Multi-Head Self-Attention: Specialized Heads Do the Heavy Lifting, the Rest Can Be Pruned. In Proceedings of ACL 2019, 2019.
|
| 270 |
+
|
| 271 |
+
Adina Williams, Nikita Nangia, and Samuel R. Bowman. A Broad-Coverage Challenge Corpus for Sentence Understanding through Inference. In Proceedings of NAACL-HLT 2018, 2018.
|
| 272 |
+
|
| 273 |
+
Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Remi Louf, Morgan Funtowicz, and Jamie Brew. HuggingFace’s Trans- ´ formers: State-of-the-art Natural Language Processing. arXiv preprint arXiv:1910.03771, 2019.
|
| 274 |
+
|
| 275 |
+
Shijie Wu and Mark Dredze. Beto, bentz, becas: The surprising cross-lingual effectiveness of BERT. 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. 833–844, Hong Kong, China, November 2019. Association for Computational Linguistics. doi: 10.18653/v1/D19-1077. URL https://www.aclweb.org/anthology/ D19-1077.
|
| 276 |
+
|
| 277 |
+
Yinfei Yang, Yuan Zhang, Chris Tar, and Jason Baldridge. PAWS-X: A cross-lingual adversarial dataset for paraphrase identification. In Proceedings of EMNLP 2019, pp. 3685–3690, 2019.
|
| 278 |
+
|
| 279 |
+
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.
|
| 280 |
+
|
| 281 |
+
Tianyi Zhang, Felix Wu, Arzoo Katiyar, Kilian Q. Weinberger, and Yoav Artzi. Revisiting Fewsample BERT Fine-tuning. arXiv e-prints, art. arXiv:2006.05987, June 2020.
|
| 282 |
+
|
| 283 |
+
Xiyou Zhou, Zhiyu Chen, Xiaoyong Jin, and William Yang Wang. HULK: An Energy Efficiency Benchmark Platform for Responsible Natural Language Processing. arXiv preprint arXiv:2002.05829, 2020.
|
| 284 |
+
|
| 285 |
+
Pierre Zweigenbaum, Serge Sharoff, and Reinhard Rapp. Overview of the third bucc shared task: Spotting parallel sentences in comparable corpora. In Proceedings of 11th Workshop on Building and Using Comparable Corpora, pp. 39–42, 2018.
|
| 286 |
+
|
| 287 |
+
# A APPENDIX
|
| 288 |
+
|
| 289 |
+
A.1 EFFICIENCY COMPARISON BASED ON PARAMETER COUNT DURING FINE-TUNING
|
| 290 |
+
|
| 291 |
+
We compare the efficiency of models based on their number of parameters. We believe this to be a reasonable proxy for a model’s efficiency as the performance of Transformer-based language models has been shown to improve monotonically with the number of parameters (Kaplan et al., 2020; Raffel et al., 2020; Lepikhin et al., 2020; Brown et al., 2020; Shoeybi et al., 2019; Aharoni et al., 2019). As the number of parameters during pre-training and fine-tuning may differ11, we compare models based on their number of parameters during the fine-tuning stage (without the task-specific head). We argue that this is the most practically relevant number as a model is generally pre-trained only once but may be fine-tuned or used for inference millions of times.
|
| 292 |
+
|
| 293 |
+
Table 10: Fine-tuning hyperparameters for all models except RemBERT.
|
| 294 |
+
|
| 295 |
+
<table><tr><td></td><td>Learning rate</td><td>Batch size</td><td>Train epochs</td></tr><tr><td>PAWS-X</td><td>[3×10-5, 4× 10-5,5×10-5]</td><td>32</td><td>3</td></tr><tr><td>XNLI</td><td>[1 × 10-5, 2× 10-5, 3× 10-5]</td><td>32</td><td>3</td></tr><tr><td> SQuAD</td><td>[2 × 10-5, 3× 10-5,4× 10-5]</td><td>32</td><td>3</td></tr><tr><td>NER</td><td>[1 × 10-5, 2 × 10-5, 3× 10-5,4× 10-5,5 × 10-5]</td><td>32</td><td>3</td></tr></table>
|
| 296 |
+
|
| 297 |
+
Table 11: Statistics for the datasets in XTREME, including the number of training, development, and test examples as well as the number of languages for each task.
|
| 298 |
+
|
| 299 |
+
<table><tr><td>Task</td><td>Corpus</td><td>|Train]</td><td>[Dev|</td><td>|Test]</td><td>|Lang.|</td><td>Task</td><td>Metric</td><td>Domain</td></tr><tr><td rowspan="2">Classification</td><td>XNLI</td><td>392,702</td><td>2,490</td><td>5,010</td><td>15</td><td>NLI</td><td>Acc.</td><td>Misc.</td></tr><tr><td>PAWS-X</td><td>49,401</td><td>2.000</td><td>2.000</td><td>7</td><td>Paraphrase</td><td>Acc.</td><td>Wiki / Quora</td></tr><tr><td rowspan="2">Structured prediction</td><td>POS</td><td>21,253</td><td>3,974</td><td>47-20,436</td><td>33</td><td>POS</td><td>F1</td><td>Misc.</td></tr><tr><td>NER</td><td>20,000</td><td>10,000</td><td>1,000-10,000</td><td>40</td><td>NER</td><td>F1</td><td>Wikipedia</td></tr><tr><td rowspan="3">QA</td><td>XQuAD</td><td></td><td></td><td>1,190</td><td>11</td><td>Span extraction</td><td>F1/EM</td><td>Wikipedia</td></tr><tr><td>MLQA</td><td>87,599</td><td>34,726</td><td>4,517-11,590</td><td>7</td><td>Span extraction</td><td>F1/EM</td><td>Wikipedia</td></tr><tr><td>TyDiQA-GoldP</td><td>3.696</td><td>634</td><td>323-2,719</td><td>9</td><td>Span extraction</td><td>F1/EM</td><td>Wikipedia</td></tr><tr><td rowspan="2">Retrieval</td><td>BUCC</td><td>-</td><td>-</td><td>1,896-14,330</td><td>5</td><td>Retrieval</td><td>F1</td><td>Wiki/news</td></tr><tr><td>Tatoeba</td><td>-</td><td>1</td><td>1,000</td><td>33</td><td>Retrieval</td><td>Acc.</td><td>misc.</td></tr></table>
|
| 300 |
+
|
| 301 |
+
# A.2 BASELINE MODEL DETAILS
|
| 302 |
+
|
| 303 |
+
Our baseline model has the same architecture as multilingual BERT (mBERT; Devlin et al., 2019). It consists of 12 Transformer layers with a hidden size $H$ of 768 and 12 attention heads with 64 dimensions each. Input and output embeddings are coupled and have the same dimensionality $E$ as the hidden size, i.e. $E _ { \mathrm { o u t } } ~ = ~ E _ { \mathrm { i n } } ~ = ~ H$ . The total number of parameters during pre-training and fine-tuning is 177M. We do not use dropout following the recommendation from Lan et al. (2020). We use the SentencePiece tokenizer (Kudo & Richardson, 2018) and a shared vocabulary of 120k subwords. The model is trained on Wikipedia dumps in 104 languages following Devlin et al. (2019) using masked language modeling (MLM). We choose this baseline as its behavior has been thoroughly studied (K et al., 2020; Conneau et al., 2020b; Pires et al., 2019; Wu & Dredze, 2019).
|
| 304 |
+
|
| 305 |
+
# A.3 TRAINING DETAILS
|
| 306 |
+
|
| 307 |
+
For all pre-training except for the large scale RemBERT, we trained using 64 Google Cloud TPUs. We trained over 26B tokens of Wikipedia data. All fine-tuning experiments were run on 8 Cloud TPUs. For all fine-tuning experiments other than RemBERT, we use batch size of 32. We sweep over the learning rate values specified in Table 10.
|
| 308 |
+
|
| 309 |
+
We used the SentencePiece tokenizer trained with unigram language modeling
|
| 310 |
+
|
| 311 |
+
# A.4 XTREME TASKS
|
| 312 |
+
|
| 313 |
+
For our experiments, we employ tasks from the XTREME benchmark (Hu et al., 2020). We show statistics for them in Table 11. XTREME includes the following datasets: The Cross-lingual Natural Language Inference (XNLI; Conneau et al., 2018) corpus, the Cross-lingual Paraphrase Adversaries from Word Scrambling (PAWS-X; Yang et al., 2019) dataset, part-of-speech (POS) tagging data from the Universal Dependencies v2.5 (Nivre et al., 2018) treebanks, the Wikiann (Pan et al., 2017) dataset for named entity recognition (NER), the Cross-lingual Question Answering Dataset (XQuAD; Artetxe et al., 2020), the Multilingual Question Answering (MLQA; Lewis et al., 2020) dataset, the gold passage version of the Typologically Diverse Question Answering (TyDiQA; Clark et al., 2020a) dataset, data from the third shared task of the workshop on Building and Using Parallel Corpora (BUCC; Zweigenbaum et al., 2018), and the Tatoeba dataset (Artetxe & Schwenk, 2019). We refer the reader to Hu et al. (2020) for more details. We average results across three fine-tuning runs and evaluate on the dev sets unless otherwise stated.
|
| 314 |
+
|
| 315 |
+
Table 12: Effect of reducing the embedding size $E$ for monolingual vs. multilingual models on MNLI and XNLI performance respectively. Monolingual numbers are from Lan et al. (2020) and have vocabulary size of $3 0 \mathrm { k }$ .
|
| 316 |
+
|
| 317 |
+
<table><tr><td>English</td><td># PT params</td><td>#FT params</td><td>MNLI</td></tr><tr><td>E=H=768</td><td>110M</td><td>110M</td><td>84.5</td></tr><tr><td>E=H=128</td><td>89M</td><td>89M</td><td>83.7</td></tr></table>
|
| 318 |
+
|
| 319 |
+
<table><tr><td>Multilingual</td><td>#PT params</td><td>#FT params</td><td>XNLI</td></tr><tr><td>E=H=768</td><td>177M</td><td>177M</td><td>70.7</td></tr><tr><td>E=H=128</td><td>100M</td><td>100M</td><td>68.1</td></tr></table>
|
| 320 |
+
|
| 321 |
+
Table 13: Effect of an increased output embedding size $E _ { \mathrm { o u t } }$ and additional layers during pre-training $L = 1 5$ on English $\mathbf { B E R T _ { B a s e } }$ $E _ { \mathrm { i n } } = 1 2 8 )$ ).
|
| 322 |
+
|
| 323 |
+
<table><tr><td></td><td>#PT params</td><td>#FT params</td><td>MNLI Acc</td><td>SQuAD EM/F1</td></tr><tr><td>BERTBase (ours)</td><td>110M</td><td>110M</td><td>79.8</td><td>78.4/86.2</td></tr><tr><td>Eout 128 二</td><td>93M</td><td>89M</td><td>75.9</td><td>75.5/84.2</td></tr><tr><td>Eout = 768</td><td>112M</td><td>89M</td><td>77.5</td><td>77.5/85.5</td></tr><tr><td>Eout = 3072</td><td>181M</td><td>89M</td><td>79.5</td><td>78.4/86.2</td></tr><tr><td>L=15</td><td>114M</td><td>89M</td><td>80.1</td><td>78.7/86.3</td></tr><tr><td>L=24</td><td>178M</td><td>89M</td><td>79.0</td><td>77.8/85.5</td></tr></table>
|
| 324 |
+
|
| 325 |
+
# A.5 COMPARISON TO LAN ET AL. (2020)
|
| 326 |
+
|
| 327 |
+
Crucially, our finding differs from the dimensionality reduction in ALBERT (Lan et al., 2020). While they show that smaller embeddings can be used, their input and output embeddings are coupled and use a much smaller vocabulary (30k vs 120k). In contrast, we find that simultaneously decreasing both the input and output embedding size drastically reduces the performance of multilingual models.
|
| 328 |
+
|
| 329 |
+
In Table 12, we show the impact of their factorized embedding parameterization on a monolingual and a multilingual model. While the English model suffers a smaller $( 0 . 8 \% )$ drop in accuracy, the multilingual model’s performance drops by $2 . 6 \%$ . Direct application of a factorized embedding parameterization (Lan et al., 2020) is thus not viable for multilingual models.
|
| 330 |
+
|
| 331 |
+
# A.6 ENGLISH MONOLINGUAL RESULTS
|
| 332 |
+
|
| 333 |
+
So far, we have focused on multilingual models as the number of saved parameters when reducing the input embedding size is largest for them. We now apply the same techniques to the English 12-layer $\mathbf { B E R T _ { B a s e } }$ with a 30k vocabulary (Devlin et al., 2019). Specifically, we decouple the embeddings, reduce $E _ { \mathrm { i n } }$ to 128, and increase the output embedding size or the number of layers during pre-training. We show the performance on MNLI (Williams et al., 2018) and SQuAD (Rajpurkar et al., 2016) in Table 13. By adding more capacity during pre-training, performance monotonically increases similar to the multilingual models. Interestingly, pruning a 24-layer model to 12 layers reduces performance, presumably because some upper layers still contain useful information.
|
| 334 |
+
|
| 335 |
+
# A.7 REMBERT DETAILS
|
| 336 |
+
|
| 337 |
+
We design a Rebalanced mBERT (RemBERT) to leverage capacity more effectively during pretraining. The model has 995M parameters during pre-training and 575M parameters during finetuning. We pre-train on large unlabeled text using both Wikipedia and Common Crawl data, covering 110 languages. The details of hyperparameters and architecture are shown in Table 14.
|
| 338 |
+
|
| 339 |
+
For each language $l$ , we define the empirical distribution as
|
| 340 |
+
|
| 341 |
+
$$
|
| 342 |
+
p _ { l } = \frac { n _ { l } } { \sum _ { l ^ { \prime } \in L } n _ { l ^ { \prime } } }
|
| 343 |
+
$$
|
| 344 |
+
|
| 345 |
+
Table 14: Hyperparameters for RemBERT architecture and pre-training.
|
| 346 |
+
|
| 347 |
+
<table><tr><td>Hyperparameter</td><td>RemBERT</td></tr><tr><td>Number of layers Hidden size</td><td>32</td></tr><tr><td>Vocabulary size Input embedding dimension</td><td>1152 250,000</td></tr><tr><td>Output embedding dimension Number of attention heads</td><td>256 1536 18</td></tr><tr><td>Attention head dimension</td><td>64</td></tr><tr><td>Dropout</td><td>0</td></tr><tr><td>Learning rate</td><td>0.0002</td></tr><tr><td>Batch size</td><td>2048</td></tr><tr><td>Train steps</td><td>1.76M</td></tr><tr><td>Adam β1</td><td></td></tr><tr><td>Adam β2</td><td>0.9</td></tr><tr><td></td><td>0.999</td></tr><tr><td>Adam e</td><td>10-6</td></tr><tr><td>Weight decay</td><td>0.01</td></tr><tr><td>Gradient clipping norm</td><td>1</td></tr><tr><td>Warmup steps</td><td>15000</td></tr></table>
|
| 348 |
+
|
| 349 |
+
Table 15: Hyperparameters for RemBERT fine-tuning.
|
| 350 |
+
|
| 351 |
+
<table><tr><td></td><td>Learning rate</td><td>Batch size</td><td>Train epochs</td></tr><tr><td>PAWS-X</td><td>8×10-6</td><td>128</td><td>3</td></tr><tr><td>XNLI</td><td>1 ×10-5</td><td>128</td><td>3</td></tr><tr><td>SQuAD</td><td>9 ×10-6</td><td>128</td><td>3</td></tr><tr><td>POS</td><td>3 ×10-5</td><td>128</td><td>3</td></tr><tr><td>NER</td><td>8×10-6</td><td>64</td><td>3</td></tr></table>
|
| 352 |
+
|
| 353 |
+
where $n _ { l }$ is the number of sentences in $l ^ { \prime }$ ’s pre-training corpus. Following Devlin et al. (2019), we use an exponentially smoothed distribution, i.e., we exponentiaate $p _ { l }$ by $\alpha = 0 . 5$ and renormalize to obtain the sampling distribution.
|
| 354 |
+
|
| 355 |
+
Hyperparameters and pre-training details are summarized in Table 14. Hyperparameters used for the leaderboard submission are shown in Table 15.
|
| 356 |
+
|
| 357 |
+
# A.8 XTREME TASK RESULTS
|
| 358 |
+
|
| 359 |
+
We show the detailed results for RemBERT and the comparison per task on the XTREME leaderboard in Table 16. Compared to Table 7, which shows the average across task categories, this table shows the average across tasks.
|
| 360 |
+
|
| 361 |
+
# A.9 NEAREST-NEIGHBOR TRANSLATION COMPUTATION
|
| 362 |
+
|
| 363 |
+
For an English-to-German translation, we sample $M \ = \ 5 0 0 0$ pairs of sentences from WMT16 (Bojar et al., 2016). For each sentence in each language, we obtain a representation $v _ { \mathrm { L A N G } } ^ { ( l ) }$ at each layer $l$ by averaging the activations of all tokens (except the [CLS] and [SEP] tokens) at that layer. We then compute a translation vector from English to German by averaging the difference between the vectors of each sentence pair across all pairs: v¯(l)EN→DE = 1M $\begin{array} { r } { \bar { v } _ { \mathrm { E N D E } } ^ { ( l ) } = \frac { 1 } { M } \bar { \sum _ { i = 1 } ^ { M } } \bar { ( v _ { \mathrm { D E } _ { i } } ^ { ( l ) } - v _ { \mathrm { E N } _ { i } } ^ { ( l ) } ) } } \end{array}$
|
| 364 |
+
|
| 365 |
+
For each English sentence $v _ { \mathrm { E N } _ { i } } ^ { ( l ) }$ , we can now translate it with this vector: $v _ { \mathrm { E N } _ { i } } ^ { ( l ) } + \bar { v } _ { \mathrm { E N } \mathrm { D E } } ^ { ( l ) }$ . We locate the closest German sentence vector based on $\ell _ { 2 }$ distance and measure how often the nearest neighbour is the correct pair.
|
| 366 |
+
|
| 367 |
+
Table 16: Comparison of our model to other models on the XTREME leaderboard. Details about VECO are due to communication with the authors. $\mathbf { A v g } _ { \mathrm { t a s k } }$ is averaged over tasks whereas Avg is averaged over task categories just like Table 7.
|
| 368 |
+
|
| 369 |
+
<table><tr><td></td><td>#PT params</td><td>#FT params</td><td>XNLI Acc</td><td>POS F1</td><td>NER F1</td><td>PAWS-X Acc</td><td>XQuAD EM/F1</td><td>MLQA EM/F1</td><td>TyDi-GoldP EM/F1</td><td>Avgtask</td><td>Avg</td></tr><tr><td colspan="10">Models fine-tuned on translations or additional task data</td><td></td><td></td></tr><tr><td>STiLTs (Phang et al., 2020)</td><td>559M</td><td>559M</td><td>80.0</td><td>74.9</td><td>64.0</td><td>87.9</td><td>63.3/78.7</td><td>53.7/72.4</td><td>59.5/76.0</td><td>72.7</td><td>73.5</td></tr><tr><td>FILTER (Fang et al.,2020)</td><td>559M</td><td>559M</td><td>83.9</td><td>76.2</td><td>67.7</td><td>91.4</td><td>68.0/82.4</td><td>57.7/76.2</td><td>50.9/68.3</td><td>74.9</td><td>76.0</td></tr><tr><td>VECO (Luo et al.,2020)</td><td>662M</td><td>662M</td><td>83.0</td><td>75.1</td><td>65.7</td><td>91.1</td><td>66.3/79.9</td><td>54.9/73.1</td><td>58.9/75.0</td><td>74.1</td><td>75.1</td></tr><tr><td colspan="10">Models fine-tuned only on English task data</td><td></td><td></td></tr><tr><td>XLM-R (Conneau et al., 2020a)</td><td>559M</td><td>559M</td><td>79.2</td><td>73.8</td><td>65.4</td><td>86.4</td><td>60.8/76.6</td><td>53.2/71.6</td><td>45.0/65.1</td><td>70.1</td><td>71.4</td></tr><tr><td>RemBERT(ours)</td><td>995M</td><td>575M</td><td>80.8</td><td>76.5</td><td>70.1</td><td>87.5</td><td>64.0/79.6</td><td>55.0/73.1</td><td>63.0/77.0</td><td>74.4</td><td>75.4</td></tr></table>
|